@arcgis/core 5.2.0-next.112 → 5.2.0-next.113

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 (419) hide show
  1. package/Ground.d.ts +4 -5
  2. package/Ground.js +1 -1
  3. package/arcgisGlobal.d.ts +5 -0
  4. package/assets/esri/core/workers/RemoteClient.js +1 -1
  5. package/assets/esri/core/workers/chunks/01ca17092545d72be7b6.js +1 -0
  6. package/assets/esri/core/workers/chunks/{f5a988bb850f7a7af143.js → 05b373a663cb5d4d722f.js} +1 -1
  7. package/assets/esri/core/workers/chunks/{36f8caeb574dcd5c0ed5.js → 0b727d7bf3e36e146725.js} +1 -1
  8. package/assets/esri/core/workers/chunks/0c65862e3dd810015491.js +1 -0
  9. package/assets/esri/core/workers/chunks/0e3e58ba8e2d358121a5.js +1 -0
  10. package/assets/esri/core/workers/chunks/0edebc6c516f0b9dac7b.js +1 -0
  11. package/assets/esri/core/workers/chunks/1004e77593dfa506cd5d.js +1 -0
  12. package/assets/esri/core/workers/chunks/184942ea601237c8241a.js +1 -0
  13. package/assets/esri/core/workers/chunks/20de0ea9fa08a6545978.js +1 -0
  14. package/assets/esri/core/workers/chunks/214d63813d268afc265d.js +1 -0
  15. package/assets/esri/core/workers/chunks/22e85819e23202a8ba90.js +1 -0
  16. package/assets/esri/core/workers/chunks/{6e677505d257e0848075.js → 23f9ab77e4e263f82636.js} +1 -1
  17. package/assets/esri/core/workers/chunks/28a04887ecaee5445d14.js +1 -0
  18. package/assets/esri/core/workers/chunks/{2fc5c1504691badc7792.js → 2ac2d0a7623dd060c144.js} +1 -1
  19. package/assets/esri/core/workers/chunks/2afce71e8b6ae86e0792.js +1 -0
  20. package/assets/esri/core/workers/chunks/36792b8a85e88044cb49.js +1 -0
  21. package/assets/esri/core/workers/chunks/36a7e19f43517aa94577.js +1 -0
  22. package/assets/esri/core/workers/chunks/{6e6cdff4bbe1ff2f44ac.js → 3ab25279aaa30f035038.js} +1 -1
  23. package/assets/esri/core/workers/chunks/{e6dae16208f6978b59e0.js → 3b499cfc89c8f87cdb20.js} +1 -1
  24. package/assets/esri/core/workers/chunks/445b0ca1b70730c9a2e6.js +1 -0
  25. package/assets/esri/core/workers/chunks/{24673aac70d6c949b6fa.js → 4bf2cc4d092601ff2b86.js} +1 -1
  26. package/assets/esri/core/workers/chunks/{d45483dd0dc2853b18b7.js → 4bfd63f3cf9208eb839b.js} +33 -33
  27. package/assets/esri/core/workers/chunks/501df20cdd09384f6ee2.js +1 -0
  28. package/assets/esri/core/workers/chunks/510a190a6f0a60ae38c3.js +1 -0
  29. package/assets/esri/core/workers/chunks/{89a785f8b61263e2d592.js → 552c92b01a5f02a115c5.js} +1 -1
  30. package/assets/esri/core/workers/chunks/564fdf0d663b773806cc.js +1 -0
  31. package/assets/esri/core/workers/chunks/{d9270f4935eb0d044db3.js → 57328c206f1e699ac06f.js} +1 -1
  32. package/assets/esri/core/workers/chunks/{50951fb13013b11b8a24.js → 58e62c8ce1292f4d3b06.js} +1 -1
  33. package/assets/esri/core/workers/chunks/5aee7739afb5160d4ace.js +1 -0
  34. package/assets/esri/core/workers/chunks/5b9925f23d4b10a7087e.js +1 -0
  35. package/assets/esri/core/workers/chunks/5f79ba5639067f734791.js +1 -0
  36. package/assets/esri/core/workers/chunks/{b013b70e40dfb6ce013e.js → 60c61f34733063730386.js} +1 -1
  37. package/assets/esri/core/workers/chunks/62b1f94f4fa978d4da48.js +1 -0
  38. package/assets/esri/core/workers/chunks/6b264006b96cbf93d8ed.js +1 -0
  39. package/assets/esri/core/workers/chunks/6b9d29ca568590358478.js +1 -0
  40. package/assets/esri/core/workers/chunks/{7c5310e0104c22da0261.js → 6c7cb7974969e3167f2b.js} +1 -1
  41. package/assets/esri/core/workers/chunks/6c82cbcd504c711a7450.js +1 -0
  42. package/assets/esri/core/workers/chunks/{e98b785e8f4edc8bd3ff.js → 6eceeca33fac8e900d9d.js} +1 -1
  43. package/assets/esri/core/workers/chunks/7232fc11b23777b6be94.js +1 -0
  44. package/assets/esri/core/workers/chunks/726ca458b98bb4334431.js +1 -0
  45. package/assets/esri/core/workers/chunks/785206da3962ba23de16.js +1 -0
  46. package/assets/esri/core/workers/chunks/{1c70620f40be02f532b5.js → 7b169eabafcc03bfaee6.js} +1 -1
  47. package/assets/esri/core/workers/chunks/7bbc3d22383388d11345.js +1 -0
  48. package/assets/esri/core/workers/chunks/{082069f80eee0407b828.js → 7edf57e31ff07af9032b.js} +1 -1
  49. package/assets/esri/core/workers/chunks/83ed38468e316302b157.js +1 -0
  50. package/assets/esri/core/workers/chunks/85c876ee9e63d5732937.js +1 -0
  51. package/assets/esri/core/workers/chunks/8f0ecf4d06ec7b67d4ed.js +1 -0
  52. package/assets/esri/core/workers/chunks/8f1c5f5e70d4b33d021d.js +1 -0
  53. package/assets/esri/core/workers/chunks/{a1916bca1af5c65be4b0.js → 90ab3c47138875070a53.js} +1 -1
  54. package/assets/esri/core/workers/chunks/{10389c87d9c6a43363ce.js → 917dec9c004218c58950.js} +1 -1
  55. package/assets/esri/core/workers/chunks/91f451b98e0f696043df.js +1 -0
  56. package/assets/esri/core/workers/chunks/943d0026ca4d49eb3ac2.js +1 -0
  57. package/assets/esri/core/workers/chunks/982a396bd4fffa62e911.js +1 -0
  58. package/assets/esri/core/workers/chunks/98a5327fd96d9542b39f.js +1 -0
  59. package/assets/esri/core/workers/chunks/9b9a60f1e0c48aa701f0.js +1 -0
  60. package/assets/esri/core/workers/chunks/9d92e6f0beed9a8580fa.js +1 -0
  61. package/assets/esri/core/workers/chunks/9df379041e8860fe7f01.js +1 -0
  62. package/assets/esri/core/workers/chunks/{1e8ceb4a4b28625236e3.js → a42505b978d54d36d3b6.js} +1 -1
  63. package/assets/esri/core/workers/chunks/{bfbe6ff786435fe1e7cf.js → a86a4e550a92f770d6d5.js} +1 -1
  64. package/assets/esri/core/workers/chunks/{a34eee4c9d4c1c2b8c49.js → ab60f3bc18b5ea504f70.js} +1 -1
  65. package/assets/esri/core/workers/chunks/{18b9ec6ba7a6c0fa2ac6.js → b1880d9f5eafd50ce84b.js} +1 -1
  66. package/assets/esri/core/workers/chunks/{777fc163530448eea13e.js → b4222152efaf73b37b53.js} +1 -1
  67. package/assets/esri/core/workers/chunks/b6ca73c1384f07b30b74.js +1 -0
  68. package/assets/esri/core/workers/chunks/bb4cbf6b7c35e8c78cc7.js +1 -0
  69. package/assets/esri/core/workers/chunks/bb831d23422acfb00ae2.js +1 -0
  70. package/assets/esri/core/workers/chunks/c0855be20ffcd52c7026.js +1 -0
  71. package/assets/esri/core/workers/chunks/{a0f742fd947104662d37.js → c6277236ec47586dca00.js} +1 -1
  72. package/assets/esri/core/workers/chunks/{3be33a129d3ae7dc4f06.js → caf38cf4d8542fb11c46.js} +1 -1
  73. package/assets/esri/core/workers/chunks/{2728eda8178e02fbca47.js → cd0f5cd0fefe7f49e3d8.js} +1 -1
  74. package/assets/esri/core/workers/chunks/{48a53bfeef11c32dadcc.js → d25fb32a233d2128afbe.js} +1 -1
  75. package/assets/esri/core/workers/chunks/d629708bf23da24ee523.js +1 -0
  76. package/assets/esri/core/workers/chunks/db141122060d8d9b38da.js +1 -0
  77. package/assets/esri/core/workers/chunks/dc1944a7601b518a9c48.js +1 -0
  78. package/assets/esri/core/workers/chunks/{573ee2e59d26bc75201e.js → dc8670f32bb0b93c1473.js} +1 -1
  79. package/assets/esri/core/workers/chunks/e1f2b07be33e33117313.js +1 -0
  80. package/assets/esri/core/workers/chunks/e52f30dfb7c82491a7f2.js +1 -0
  81. package/assets/esri/core/workers/chunks/e5906b28b981199fd489.js +1 -0
  82. package/assets/esri/core/workers/chunks/{b3293ee9f221423a6825.js → e611e452f04a9ce64cf8.js} +1 -1
  83. package/assets/esri/core/workers/chunks/{0f20c458f873564faff2.js → ec4f887153c24ab83f2c.js} +1 -1
  84. package/assets/esri/core/workers/chunks/{707b4ae689c4329cad3b.js → f40ceb5e03c699605302.js} +1 -1
  85. package/assets/esri/core/workers/chunks/{547a073c789fdfb78310.js → f42243c62dd0b6993816.js} +1 -1
  86. package/assets/esri/core/workers/chunks/f91cab9904020cf25d50.js +1 -0
  87. package/assets/esri/core/workers/chunks/f9b29d2ce1cd31c0fce1.js +1 -0
  88. package/assets/esri/core/workers/chunks/fdf5ceffec9d5185953d.js +1 -0
  89. package/assets/esri/views/3d/environment/resources/milkyway-band.ktx2 +0 -0
  90. package/chunks/DeepSky.glsl.js +1 -1
  91. package/chunks/FocusArea.glsl.js +1 -1
  92. package/chunks/GaussianSplatDepth.glsl.js +3 -3
  93. package/chunks/RibbonLine.glsl.js +15 -13
  94. package/config.js +1 -1
  95. package/geometry/Extent.js +1 -1
  96. package/geometry/operators/affineTransformOperator.d.ts +9 -3
  97. package/geometry/operators/affineTransformOperator.js +1 -1
  98. package/geometry/operators/alphaShapeOperator.d.ts +14 -4
  99. package/geometry/operators/alphaShapeOperator.js +1 -1
  100. package/geometry/operators/areaOperator.d.ts +11 -3
  101. package/geometry/operators/areaOperator.js +1 -1
  102. package/geometry/operators/autoCompleteOperator.d.ts +6 -2
  103. package/geometry/operators/autoCompleteOperator.js +1 -1
  104. package/geometry/operators/boundaryOperator.d.ts +9 -3
  105. package/geometry/operators/boundaryOperator.js +1 -1
  106. package/geometry/operators/bufferOperator.d.ts +19 -5
  107. package/geometry/operators/bufferOperator.js +1 -1
  108. package/geometry/operators/centroidOperator.d.ts +6 -2
  109. package/geometry/operators/centroidOperator.js +1 -1
  110. package/geometry/operators/clipOperator.d.ts +9 -3
  111. package/geometry/operators/clipOperator.js +1 -1
  112. package/geometry/operators/containsOperator.d.ts +9 -3
  113. package/geometry/operators/containsOperator.js +1 -1
  114. package/geometry/operators/convexHullOperator.d.ts +17 -5
  115. package/geometry/operators/convexHullOperator.js +1 -1
  116. package/geometry/operators/crossesOperator.d.ts +9 -3
  117. package/geometry/operators/crossesOperator.js +1 -1
  118. package/geometry/operators/cutOperator.d.ts +6 -2
  119. package/geometry/operators/cutOperator.js +1 -1
  120. package/geometry/operators/densifyOperator.d.ts +14 -4
  121. package/geometry/operators/densifyOperator.js +1 -1
  122. package/geometry/operators/differenceOperator.d.ts +9 -3
  123. package/geometry/operators/differenceOperator.js +1 -1
  124. package/geometry/operators/disjointOperator.d.ts +9 -3
  125. package/geometry/operators/disjointOperator.js +1 -1
  126. package/geometry/operators/distanceOperator.d.ts +11 -3
  127. package/geometry/operators/distanceOperator.js +1 -1
  128. package/geometry/operators/equalsOperator.d.ts +9 -3
  129. package/geometry/operators/equalsOperator.js +1 -1
  130. package/geometry/operators/extendOperator.d.ts +11 -3
  131. package/geometry/operators/extendOperator.js +1 -1
  132. package/geometry/operators/generalizeOperator.d.ts +14 -4
  133. package/geometry/operators/generalizeOperator.js +1 -1
  134. package/geometry/operators/geodesicBufferOperator.d.ts +25 -7
  135. package/geometry/operators/geodesicBufferOperator.js +1 -1
  136. package/geometry/operators/geodesicProximityOperator.d.ts +28 -8
  137. package/geometry/operators/geodesicProximityOperator.js +1 -1
  138. package/geometry/operators/geodeticAreaOperator.d.ts +17 -5
  139. package/geometry/operators/geodeticAreaOperator.js +1 -1
  140. package/geometry/operators/geodeticDensifyOperator.d.ts +20 -6
  141. package/geometry/operators/geodeticDensifyOperator.js +1 -1
  142. package/geometry/operators/geodeticDistanceOperator.d.ts +17 -5
  143. package/geometry/operators/geodeticDistanceOperator.js +1 -1
  144. package/geometry/operators/geodeticLengthOperator.d.ts +17 -5
  145. package/geometry/operators/geodeticLengthOperator.js +1 -1
  146. package/geometry/operators/geodeticUtilsOperator.d.ts +17 -5
  147. package/geometry/operators/geodeticUtilsOperator.js +1 -1
  148. package/geometry/operators/graphicBufferOperator.d.ts +11 -3
  149. package/geometry/operators/graphicBufferOperator.js +1 -1
  150. package/geometry/operators/integrateOperator.d.ts +6 -2
  151. package/geometry/operators/integrateOperator.js +1 -1
  152. package/geometry/operators/intersectionOperator.d.ts +12 -4
  153. package/geometry/operators/intersectionOperator.js +1 -1
  154. package/geometry/operators/intersectsOperator.d.ts +9 -3
  155. package/geometry/operators/intersectsOperator.js +1 -1
  156. package/geometry/operators/isNearOperator.d.ts +11 -3
  157. package/geometry/operators/isNearOperator.js +1 -1
  158. package/geometry/operators/json/bufferOperator.js +1 -1
  159. package/geometry/operators/json/containsOperator.js +1 -1
  160. package/geometry/operators/json/convexHullOperator.js +1 -1
  161. package/geometry/operators/json/crossesOperator.js +1 -1
  162. package/geometry/operators/json/disjointOperator.js +1 -1
  163. package/geometry/operators/json/generalizeOperator.js +1 -1
  164. package/geometry/operators/json/geodesicBufferOperator.js +1 -1
  165. package/geometry/operators/json/graphicBufferOperator.js +1 -1
  166. package/geometry/operators/json/intersectionOperator.js +1 -1
  167. package/geometry/operators/json/intersectsOperator.js +1 -1
  168. package/geometry/operators/json/lengthOperator.js +1 -1
  169. package/geometry/operators/json/offsetOperator.js +1 -1
  170. package/geometry/operators/json/overlapsOperator.js +1 -1
  171. package/geometry/operators/json/projectOperator.js +1 -1
  172. package/geometry/operators/json/simplifyOperator.js +1 -1
  173. package/geometry/operators/json/simplifyOperatorOGC.js +1 -1
  174. package/geometry/operators/json/touchesOperator.js +1 -1
  175. package/geometry/operators/json/unionOperator.js +1 -1
  176. package/geometry/operators/json/withinOperator.js +1 -1
  177. package/geometry/operators/labelPointOperator.d.ts +9 -3
  178. package/geometry/operators/labelPointOperator.js +1 -1
  179. package/geometry/operators/lengthOperator.d.ts +11 -3
  180. package/geometry/operators/lengthOperator.js +1 -1
  181. package/geometry/operators/linesToPolygonsOperator.d.ts +6 -2
  182. package/geometry/operators/linesToPolygonsOperator.js +1 -1
  183. package/geometry/operators/locateBetweenOperator.d.ts +6 -2
  184. package/geometry/operators/locateBetweenOperator.js +1 -1
  185. package/geometry/operators/minimumBoundingCircleOperator.d.ts +14 -4
  186. package/geometry/operators/minimumBoundingCircleOperator.js +1 -1
  187. package/geometry/operators/multiPartToSinglePartOperator.d.ts +11 -3
  188. package/geometry/operators/multiPartToSinglePartOperator.js +1 -1
  189. package/geometry/operators/offsetOperator.d.ts +14 -4
  190. package/geometry/operators/offsetOperator.js +1 -1
  191. package/geometry/operators/overlapsOperator.d.ts +9 -3
  192. package/geometry/operators/overlapsOperator.js +1 -1
  193. package/geometry/operators/polygonOverlayOperator.d.ts +11 -3
  194. package/geometry/operators/polygonOverlayOperator.js +1 -1
  195. package/geometry/operators/polygonSlicerOperator.d.ts +22 -6
  196. package/geometry/operators/polygonSlicerOperator.js +1 -1
  197. package/geometry/operators/projectOperator.d.ts +15 -5
  198. package/geometry/operators/projectOperator.js +1 -1
  199. package/geometry/operators/proximityOperator.d.ts +22 -6
  200. package/geometry/operators/proximityOperator.js +1 -1
  201. package/geometry/operators/relateOperator.d.ts +12 -4
  202. package/geometry/operators/relateOperator.js +1 -1
  203. package/geometry/operators/reshapeOperator.d.ts +6 -2
  204. package/geometry/operators/reshapeOperator.js +1 -1
  205. package/geometry/operators/shapePreservingProjectOperator.d.ts +20 -6
  206. package/geometry/operators/shapePreservingProjectOperator.js +1 -1
  207. package/geometry/operators/simplifyOGCOperator.d.ts +3 -1
  208. package/geometry/operators/simplifyOGCOperator.js +1 -1
  209. package/geometry/operators/simplifyOperator.d.ts +12 -4
  210. package/geometry/operators/simplifyOperator.js +1 -1
  211. package/geometry/operators/singlePartToMultiPartOperator.js +1 -1
  212. package/geometry/operators/support/deprecatedOperator.js +2 -0
  213. package/geometry/operators/symmetricDifferenceOperator.d.ts +9 -3
  214. package/geometry/operators/symmetricDifferenceOperator.js +1 -1
  215. package/geometry/operators/touchesOperator.d.ts +9 -3
  216. package/geometry/operators/touchesOperator.js +1 -1
  217. package/geometry/operators/unionOperator.d.ts +9 -3
  218. package/geometry/operators/unionOperator.js +1 -1
  219. package/geometry/operators/withinOperator.d.ts +9 -3
  220. package/geometry/operators/withinOperator.js +1 -1
  221. package/geometry/support/intersectsBase.js +1 -1
  222. package/geometry/support/normalizeUtils.js +1 -1
  223. package/kernel.js +1 -1
  224. package/layers/IntegratedMesh3DTilesLayer.js +1 -1
  225. package/layers/IntegratedMeshLayer.js +1 -1
  226. package/layers/SceneLayer.js +1 -1
  227. package/layers/buildingSublayers/BuildingComponentSublayer.js +1 -1
  228. package/layers/list/BasemapItemCollection.d.ts +40 -14
  229. package/layers/list/BasemapItemCollection.js +1 -1
  230. package/layers/list/CatalogItemCollection.d.ts +29 -11
  231. package/layers/list/CatalogItemCollection.js +1 -1
  232. package/layers/list/Item.d.ts +66 -122
  233. package/layers/list/Item.js +1 -1
  234. package/layers/list/ItemPanel.d.ts +23 -34
  235. package/layers/list/LayerItemCollection.d.ts +33 -43
  236. package/layers/list/LayerItemCollection.js +1 -1
  237. package/layers/list/TableItem.d.ts +42 -53
  238. package/layers/list/TableItem.js +1 -1
  239. package/layers/list/TableItemCollection.d.ts +25 -55
  240. package/layers/list/TableItemCollection.js +1 -1
  241. package/layers/list/TableItemPanel.d.ts +25 -23
  242. package/layers/list/support/layerListUtils.js +1 -1
  243. package/layers/list/types.d.ts +158 -37
  244. package/layers/support/ElevationQuery.js +1 -1
  245. package/layers/support/FeatureFilter.d.ts +2 -1
  246. package/layers/support/FeatureFilter.js +1 -1
  247. package/package.json +2 -2
  248. package/rest/knowledgeGraph/GraphDeleteNamedTypeResult.d.ts +0 -1
  249. package/support/revision.js +1 -1
  250. package/symbols/LineSymbol3DLayer.d.ts +9 -3
  251. package/symbols/cim/CIMSymbolDrawHelper.js +1 -1
  252. package/symbols/cim/CIMSymbolHelper.js +1 -1
  253. package/symbols/cim/OverrideHelper.js +1 -1
  254. package/symbols/cim/Rasterizer.js +1 -1
  255. package/symbols/cim/cimAnalyzer.js +1 -1
  256. package/symbols/cim/dashUtils.js +2 -0
  257. package/symbols/cim/effects/EffectDashes.js +1 -1
  258. package/symbols/cim/fromCIMFontStyle.js +2 -0
  259. package/symbols/cim/richTextUtils.js +1 -1
  260. package/symbols/cim/utils.js +1 -1
  261. package/symbols/patterns/LinePattern3D.d.ts +10 -4
  262. package/symbols/patterns/LinePattern3D.js +1 -1
  263. package/symbols/patterns/LineTemplatePattern3D.d.ts +48 -0
  264. package/symbols/patterns/LineTemplatePattern3D.js +2 -0
  265. package/symbols/patterns/utils.js +1 -1
  266. package/symbols/support/Symbol3DOutline.js +1 -1
  267. package/views/2d/engine/webgl/AttributeStoreView.js +1 -1
  268. package/views/2d/engine/webgl/FeatureDisplayList.js +1 -1
  269. package/views/2d/engine/webgl/GlyphMosaic.js +1 -1
  270. package/views/2d/engine/webgl/GlyphWorker.js +1 -1
  271. package/views/2d/engine/webgl/TextureManager.js +1 -1
  272. package/views/2d/engine/webgl/decorGlyphRect.js +2 -0
  273. package/views/2d/engine/webgl/definitions.js +1 -1
  274. package/views/2d/engine/webgl/effects/highlight/HighlightGradient.js +1 -1
  275. package/views/2d/engine/webgl/effects/highlight/MultiHighlightGradient.js +1 -1
  276. package/views/2d/engine/webgl/hashMosaic.js +2 -0
  277. package/views/2d/engine/webgl/shaderGraph/techniques/featureTechniqueUtils.js +1 -1
  278. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/AFeatureShader.js +1 -1
  279. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/ShaderHighlight.js +1 -1
  280. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/utils.js +1 -1
  281. package/views/2d/layers/FeatureLikeLayerView2D.js +1 -1
  282. package/views/2d/layers/GraphicsLayerView2D.js +1 -1
  283. package/views/2d/layers/ImageryLayerView2D.js +1 -1
  284. package/views/2d/layers/LayerView2D.js +1 -1
  285. package/views/2d/layers/MapImageLayerView2D.js +1 -1
  286. package/views/2d/layers/MapNotesLayerView2D.js +1 -1
  287. package/views/2d/layers/RouteLayerView2D.js +1 -1
  288. package/views/2d/layers/TileLayerView2D.js +1 -1
  289. package/views/2d/layers/features/FeatureContainer.js +1 -1
  290. package/views/2d/layers/features/FeaturePipelineWorker.js +1 -1
  291. package/views/2d/layers/features/Processor.js +1 -1
  292. package/views/2d/layers/features/processor/AProcessorStrategy.js +1 -1
  293. package/views/2d/layers/features/processor/AggregateStrategy.js +1 -1
  294. package/views/2d/layers/features/processor/FeatureUpdateStrategy.js +1 -1
  295. package/views/2d/layers/features/processor/bins/BinLevelState.js +1 -1
  296. package/views/2d/layers/features/processor/clusters/ClusterLevelState.js +1 -1
  297. package/views/2d/layers/features/processor/tracks/TrackLevelState.js +1 -1
  298. package/views/2d/layers/features/schema/processor/SimpleProcessorSchema.js +1 -1
  299. package/views/2d/layers/features/sources/FeatureSource.js +1 -1
  300. package/views/2d/layers/features/support/AttributeStore.js +1 -1
  301. package/views/2d/layers/graphics/AGraphicContainer.js +1 -1
  302. package/views/2d/layers/graphics/GraphicBoundsRenderer.js +1 -1
  303. package/views/2d/layers/graphics/GraphicsView2D.js +1 -1
  304. package/views/2d/layers/support/FeatureCommandQueue.js +1 -1
  305. package/views/2d/layers/support/FilterSchema.js +2 -0
  306. package/views/2d/layers/support/HighlightRegistry.js +2 -0
  307. package/views/2d/layers/support/annodime/dimensionUtils.js +1 -1
  308. package/views/2d/layers/support/util.js +1 -1
  309. package/views/3d/analysis/LineOfSight/LineOfSightRayIntersector.js +1 -1
  310. package/views/3d/input/SceneInputManager.js +1 -1
  311. package/views/3d/input/handlers/ground/GroundNavigation.js +1 -1
  312. package/views/3d/layers/GaussianSplatLayerView3D.js +1 -1
  313. package/views/3d/layers/I3SMeshView3D.js +1 -1
  314. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  315. package/views/3d/layers/IntegratedMeshLayerView3D.js +1 -1
  316. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  317. package/views/3d/layers/graphics/Graphics3DFeatureStore.js +1 -1
  318. package/views/3d/layers/graphics/Graphics3DGraphic.js +1 -1
  319. package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
  320. package/views/3d/layers/support/Tiles3DMeshIntersectionHandler.js +1 -1
  321. package/views/3d/navigation/Navigation3D.d.ts +16 -0
  322. package/views/3d/navigation/Navigation3D.js +2 -0
  323. package/views/3d/navigation/modes/DefaultNavigationMode3D.d.ts +4 -0
  324. package/views/3d/navigation/modes/DefaultNavigationMode3D.js +2 -0
  325. package/views/3d/navigation/modes/GroundNavigationMode3D.d.ts +4 -0
  326. package/views/3d/navigation/modes/GroundNavigationMode3D.js +2 -0
  327. package/views/3d/navigation/modes/NavigationMode3D.d.ts +4 -0
  328. package/views/3d/navigation/modes/NavigationMode3D.js +2 -0
  329. package/views/3d/navigation/modes/NavigationMode3DUnion.d.ts +5 -0
  330. package/views/3d/state/ConstraintsManager.js +1 -1
  331. package/views/3d/support/QualityProfile.js +1 -1
  332. package/views/3d/support/hitTest.js +1 -1
  333. package/views/3d/terrain/ExtentHelper.js +1 -1
  334. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  335. package/views/3d/webgl-engine/effects/AmbientIllumination.js +2 -0
  336. package/views/3d/webgl-engine/effects/fog/Fog.js +1 -1
  337. package/views/3d/webgl-engine/effects/globalIllumination/GlobalIllumination.js +1 -1
  338. package/views/3d/webgl-engine/effects/glow/BlurEmission.js +1 -1
  339. package/views/3d/webgl-engine/effects/ssao/SSAO.js +1 -1
  340. package/views/3d/webgl-engine/effects/stars/Stars.js +1 -1
  341. package/views/3d/webgl-engine/lib/BindParameters.js +1 -1
  342. package/views/3d/webgl-engine/lib/EmissionComposite.js +1 -1
  343. package/views/3d/webgl-engine/lib/GaussianSplatDepthRenderer.js +1 -1
  344. package/views/3d/webgl-engine/lib/RenderFeature.js +1 -1
  345. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  346. package/views/3d/webgl-engine/lib/SortedRenderGeometryRenderer.js +1 -1
  347. package/views/3d/webgl-engine/materials/lineStippleUtils.js +1 -1
  348. package/views/3d/webgl-engine/parts/RenderView.js +1 -1
  349. package/views/3d/webgl-engine/shaders/GaussianSplatPass.glsl.js +12 -8
  350. package/views/3d/webgl-engine/shaders/GaussianSplatTechniqueConfiguration.js +1 -1
  351. package/views/PopupView.js +1 -1
  352. package/views/SceneView.js +1 -1
  353. package/views/View.js +1 -1
  354. package/views/layers/FeatureLikeLayerView.js +1 -1
  355. package/widgets/LayerList/LayerListViewModel.d.ts +1 -0
  356. package/widgets/LayerList/LayerListViewModel.js +1 -1
  357. package/widgets/LayerList/ListItem.d.ts +4 -0
  358. package/widgets/LayerList/ListItemPanel.d.ts +3 -0
  359. package/widgets/OrientedImageryViewer/types.d.ts +2 -2
  360. package/widgets/OrientedImageryViewer.d.ts +20 -1
  361. package/widgets/OrientedImageryViewer.js +1 -1
  362. package/widgets/Sketch/SketchViewModel.js +1 -1
  363. package/widgets/support/iconUtils.js +1 -1
  364. package/assets/esri/core/workers/chunks/03601be8b0763f82e88f.js +0 -1
  365. package/assets/esri/core/workers/chunks/0bff8d589312be6588fe.js +0 -1
  366. package/assets/esri/core/workers/chunks/0de90b1ad8118457fd5a.js +0 -1
  367. package/assets/esri/core/workers/chunks/0e1a067ab243900d0371.js +0 -1
  368. package/assets/esri/core/workers/chunks/0ee6109e6578395a7900.js +0 -1
  369. package/assets/esri/core/workers/chunks/0ee7376c29e0fd8f676c.js +0 -1
  370. package/assets/esri/core/workers/chunks/13551987fbeaae154df8.js +0 -1
  371. package/assets/esri/core/workers/chunks/186350d720352bd5ff33.js +0 -1
  372. package/assets/esri/core/workers/chunks/25ecf94d776c3b6db0f3.js +0 -1
  373. package/assets/esri/core/workers/chunks/262052dfaec3af8a58b9.js +0 -1
  374. package/assets/esri/core/workers/chunks/2c01477b69c38f691e19.js +0 -1
  375. package/assets/esri/core/workers/chunks/307297e025eed110095f.js +0 -1
  376. package/assets/esri/core/workers/chunks/33422dca6f4bcaa0ea74.js +0 -1
  377. package/assets/esri/core/workers/chunks/33e583166ab3943ecf0e.js +0 -1
  378. package/assets/esri/core/workers/chunks/37ae52c71bf9c70fbb92.js +0 -1
  379. package/assets/esri/core/workers/chunks/3daddcb106a7009c5a70.js +0 -1
  380. package/assets/esri/core/workers/chunks/3de6e54b6ed0feae1940.js +0 -1
  381. package/assets/esri/core/workers/chunks/448f068a14f24f2f8a43.js +0 -1
  382. package/assets/esri/core/workers/chunks/4c088c26d5d546c95c90.js +0 -1
  383. package/assets/esri/core/workers/chunks/5134241be1f1bf25231a.js +0 -1
  384. package/assets/esri/core/workers/chunks/56163189fbe63aa11e94.js +0 -1
  385. package/assets/esri/core/workers/chunks/571cf99c3eab8e517542.js +0 -1
  386. package/assets/esri/core/workers/chunks/5762746cfb02a4119d82.js +0 -1
  387. package/assets/esri/core/workers/chunks/5830deda121e4c95d199.js +0 -1
  388. package/assets/esri/core/workers/chunks/58e4aecabca047f1d229.js +0 -1
  389. package/assets/esri/core/workers/chunks/5c8f423812a23c02c1fd.js +0 -1
  390. package/assets/esri/core/workers/chunks/5eb726317b6602f1e206.js +0 -1
  391. package/assets/esri/core/workers/chunks/6e2075bd4832ff0db68c.js +0 -1
  392. package/assets/esri/core/workers/chunks/7608de0d942b4c16b2f6.js +0 -1
  393. package/assets/esri/core/workers/chunks/7610dd0b46948b7bd840.js +0 -1
  394. package/assets/esri/core/workers/chunks/7737ab739eba6d81282d.js +0 -1
  395. package/assets/esri/core/workers/chunks/7be56ac60e580c806a5d.js +0 -1
  396. package/assets/esri/core/workers/chunks/7d9468e38f3bf006f86e.js +0 -1
  397. package/assets/esri/core/workers/chunks/7efc51324cfc8e08c756.js +0 -1
  398. package/assets/esri/core/workers/chunks/84dc2afd89263a311b81.js +0 -1
  399. package/assets/esri/core/workers/chunks/852649460d664b0a1a1d.js +0 -1
  400. package/assets/esri/core/workers/chunks/ab332bd411d6c7d4190c.js +0 -1
  401. package/assets/esri/core/workers/chunks/bc9b96a539f28afcb8cb.js +0 -1
  402. package/assets/esri/core/workers/chunks/be69e2dda75b079362b2.js +0 -1
  403. package/assets/esri/core/workers/chunks/bf9eba555aebca2c132b.js +0 -1
  404. package/assets/esri/core/workers/chunks/c18de0f6cbeecee4ce34.js +0 -1
  405. package/assets/esri/core/workers/chunks/c9df18e9ff7367a004b6.js +0 -1
  406. package/assets/esri/core/workers/chunks/d33d08cb6856cd2eb35e.js +0 -1
  407. package/assets/esri/core/workers/chunks/e688e6e816824b53a25e.js +0 -1
  408. package/assets/esri/core/workers/chunks/ea068c797e3e462f4518.js +0 -1
  409. package/assets/esri/core/workers/chunks/eaf1d38f09744b7e84f5.js +0 -1
  410. package/assets/esri/core/workers/chunks/eff99e45d818e58fd443.js +0 -1
  411. package/assets/esri/core/workers/chunks/f219ba010c480bb75684.js +0 -1
  412. package/assets/esri/core/workers/chunks/f60d5ce49c173d5381ec.js +0 -1
  413. package/assets/esri/core/workers/chunks/f72f4413fc7461e11a2a.js +0 -1
  414. package/assets/esri/core/workers/chunks/f834aa732c3f06525089.js +0 -1
  415. package/assets/esri/core/workers/chunks/fae14e30fa7d81bf706e.js +0 -1
  416. package/assets/esri/core/workers/chunks/fb6f1b562ee0983c8c6e.js +0 -1
  417. package/assets/esri/core/workers/chunks/fc1658eae7b312502fab.js +0 -1
  418. package/views/2d/engine/webgl/Utils.js +0 -2
  419. package/views/2d/layers/support/HighlightCounter.js +0 -2
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import t from"./LinePattern3D.js";import e from"./LineStylePattern3D.js";import r from"./Pattern3D.js";import p from"./StylePattern3D.js";const s={types:{key:"type",base:r,typeMap:{style:p}},json:{write:!0}},o={types:{key:"type",base:t,typeMap:{style:e}},json:{write:!0}};export{o as symbol3dLinePatternProperty,s as symbol3dPatternProperty};
2
+ import e from"./LinePattern3D.js";import t from"./LineStylePattern3D.js";import p from"./LineTemplatePattern3D.js";import r from"./Pattern3D.js";import y from"./StylePattern3D.js";const s={key:"type",base:e,typeMap:{style:t}},o={types:{key:"type",base:r,typeMap:{style:y}},json:{write:!0}},a={types:{key:"type",base:e,typeMap:{style:t,template:p}},json:{types:s,write:{overridePolicy:e=>({enabled:"template"!==e?.type})}}},i={types:s,json:{write:!0}};export{a as symbol3dLinePatternProperty,i as symbol3dOutlineLinePatternProperty,o as symbol3dPatternProperty};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as t}from"tslib";import r from"../../Color.js";import{JSONSupport as o}from"../../core/JSONSupport.js";import{px2pt as e}from"../../core/screenUtils.js";import{property as s,subclass as i}from"../../core/accessorSupport/decorators.js";import{symbol3dLinePatternProperty as l}from"../patterns/utils.js";import{colorAndTransparencyProperty as p,screenSizeProperty as n}from"./materialUtils.js";import{lineCaps as a}from"./symbolLayerUtils3D.js";var u;let c=u=class extends o{constructor(t){super(t),this.color=new r([0,0,0,1]),this.pattern=null,this.patternCap="butt"}get size(){return this._get("size")??e(1)}set size(t){this._set("size",t)}clone(){const t={color:null!=this.color?this.color.clone():null,size:this.size,pattern:null!=this.pattern?this.pattern.clone():null,patternCap:this.patternCap};return new u(t)}};t([s(p({colorRequiredOnWrite:!0}))],c.prototype,"color",void 0),t([s({...n,json:{write:{isRequired:!0}}})],c.prototype,"size",null),t([s(l)],c.prototype,"pattern",void 0),t([s({type:a,json:{default:"butt",write:{overridePolicy(){return{enabled:null!=this.pattern}}}}})],c.prototype,"patternCap",void 0),c=u=t([i("esri.symbols.support.Symbol3DOutline")],c);const m=c;export{m as default};
2
+ import{__decorate as t}from"tslib";import r from"../../Color.js";import{JSONSupport as o}from"../../core/JSONSupport.js";import{px2pt as e}from"../../core/screenUtils.js";import{property as s,subclass as i}from"../../core/accessorSupport/decorators.js";import{symbol3dOutlineLinePatternProperty as l}from"../patterns/utils.js";import{colorAndTransparencyProperty as p,screenSizeProperty as n}from"./materialUtils.js";import{lineCaps as a}from"./symbolLayerUtils3D.js";var u;let c=u=class extends o{constructor(t){super(t),this.color=new r([0,0,0,1]),this.pattern=null,this.patternCap="butt"}get size(){return this._get("size")??e(1)}set size(t){this._set("size",t)}clone(){const t={color:null!=this.color?this.color.clone():null,size:this.size,pattern:null!=this.pattern?this.pattern.clone():null,patternCap:this.patternCap};return new u(t)}};t([s(p({colorRequiredOnWrite:!0}))],c.prototype,"color",void 0),t([s({...n,json:{write:{isRequired:!0}}})],c.prototype,"size",null),t([s(l)],c.prototype,"pattern",void 0),t([s({type:a,json:{default:"butt",write:{overridePolicy(){return{enabled:null!=this.pattern}}}}})],c.prototype,"patternCap",void 0),c=u=t([i("esri.symbols.support.Symbol3DOutline")],c);const m=c;export{m as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import t from"../../../../core/Error.js";import has from"../../../../core/has.js";import e from"../../../../core/Logger.js";import{estimateNumberArrayMemory as i}from"../../../../core/memoryEstimations.js";import{signal as s}from"../../../../core/signal.js";import{dataDrivenUnit2 as r,dataDrivenUnit1 as n,dataDrivenUnit0 as a,visualVariableUnit as u,localTimeOriginUnit as h,gpgpuUnit as o,animationUnit as d,filterFlagsUnit as l}from"./definitions.js";import{getDisplayIdTexel as g}from"./DisplayId.js";import{getPixelArrayCtor as p,getPixelBytes as _}from"./Utils.js";import{SizedPixelFormat as c}from"../../../webgl/enums.js";import{DisposableFramebufferObject as x}from"../../../webgl/FramebufferObject.js";import f from"../../../webgl/Texture.js";import{TextureDescriptor as b}from"../../../webgl/TextureDescriptor.js";const m=()=>e.getLogger("esri.views.2d.engine.webgl.AttributeStoreView");class T{constructor(t,e,i){this._texture=null,this._lastTexture=null,this._fbos={},this.texelSize=4;const{buffer:s,pixelType:r,textureOnly:n}=t,a=p(r);this.blockIndex=i,this.pixelType=r,this.size=e,this.textureOnly=n,n||(this.data=new a(s)),this._resetRange()}destroy(){this._texture?.dispose();for(const t in this._fbos){const e=this._fbos[t];e&&("0"===t&&e.detachColorTexture(),e.dispose()),this._fbos[t]=null}this._texture=null}get _textureDesc(){const t=new b(this.size);if(t.wrapMode=33071,t.samplingMode=9728,t.dataType=this.pixelType,2===this.blockIndex)t.pixelFormat=6403,t.internalFormat=c.R8;return t}get usedMemory(){return null!=this.data?i(this.data):0}setData(t,e,i){const s=g(t),r=this.data,n=s*this.texelSize+e;!r||n>=r.length||(r[n]=i,this.dirtyStart=Math.min(this.dirtyStart,s),this.dirtyEnd=Math.max(this.dirtyEnd,s))}getData(t,e){if(null==this.data)return null;const i=g(t)*this.texelSize+e;return!this.data||i>=this.data.length?null:this.data[i]}getTexture(t){return this._texture??this._initTexture(t)}getFBO(t,e=0){if(!this._fbos[e]){const i=0===e?this.getTexture(t):this._textureDesc;this._fbos[e]=new x(t,i)}return this._fbos[e]}get hasDirty(){const t=this.dirtyStart;return this.dirtyEnd>=t}updateTexture(e,i){try{const s=this.dirtyStart,r=this.dirtyEnd;if(!this.hasDirty)return;has("esri-2d-update-debug")&&console.debug(`Version[${i}] AttributeStoreView.updateTexture`,{start:s,end:r,firstBytes:new Uint8Array(this.data.buffer.slice(0,16)),block:this}),this._resetRange();const n=this.data.buffer,a=this.getTexture(e),u=4,h=(s-s%this.size)/this.size,o=(r-r%this.size)/this.size,d=h,l=this.size,g=o,_=h*this.size*u,c=(l+g*this.size)*u-_,x=p(this.pixelType),f=new x(n,_*x.BYTES_PER_ELEMENT,c),b=this.size,T=g-d+1;if(T>this.size)return void m().error(new t("mapview-webgl","Out-of-bounds index when updating AttributeData"));a.updateData(0,0,d,b,T,f)}catch(s){}}update(t){const{data:e,start:i,end:s}=t;if(null!=e&&null!=this.data){const s=this.data,r=i*this.texelSize;for(let i=0;i<e.length;i++){const n=1<<i%this.texelSize;t.layout&n&&(s[r+i]=e[i])}}this.dirtyStart=Math.min(this.dirtyStart,i),this.dirtyEnd=Math.max(this.dirtyEnd,s)}resize(t,e){const i=this.size;if(this.size=e,this.textureOnly)return void(i!==this.size&&(this._lastTexture=this._texture,this._texture=null));const s=p(this.pixelType);this.destroy(),this.data=new s(t.buffer)}_resetRange(){this.dirtyStart=2147483647,this.dirtyEnd=0}_initTexture(t){const e=new f(t,this._textureDesc,this.data??void 0);if(null!=this._lastTexture&&this._fbos[0]){const i=this._lastTexture.descriptor.width,s=this._lastTexture.descriptor.height,r=this._lastTexture.descriptor.dataType,n=this._lastTexture.descriptor.pixelFormat,a=this.getFBO(t),u=_(r),h=new(p(r))(new ArrayBuffer(i*s*u*this.texelSize)),o=t.boundFramebuffer,{x:d,y:l,width:g,height:c}=t.getViewport();t.bindFramebuffer(a),a.readPixels(0,0,i,s,n,r,h),e.updateData(0,0,0,2*i,s/2,h),t.setViewport(d,l,g,c),t.bindFramebuffer(o)}return this.destroy(),this._texture=e,this._texture}}class y{constructor(){this.size=0,this._pendingAttributeUpdates=[],this._version=0,this._epoch=0,this._hasPendingUpdate=s(!1),this._locked=!1}get updating(){return this._hasPendingUpdate.value}get locked(){return this._locked}get usedMemory(){let t=0;for(const e of this._data??[])null!=e&&(t+=e.usedMemory);return t}_initialize(t){if(!t)throw new Error("InternalError: initArgs must be defined");const e=t.blockDescriptors;if(this.size=t.blockSize,has("esri-2d-update-debug")&&console.debug("AttributeStoreView.initialize",{message:t}),null==this._data)this._data=e.map((t,e)=>null!=t?new T(t,this.size,e):null);else for(let i=0;i<this._data.length;i++){const t=this._data[i],s=e[i];null!=s&&(null==t?this._data[i]=new T(s,this.size,i):t.resize(s,this.size))}}destroy(){for(const t of this._data??[])t?.destroy();this._defaultTexture?.dispose(),this._defaultTexture=null,this._pendingAttributeUpdates=[]}isEmpty(){return null==this._data}getBlock(t){if(null==this._data)return null;return this._data[t]}setLabelMinZoom(t,e){this.setData(t,0,1,e)}setLocalTimeOrigin(t,e){this.setData(t,7,0,e)}getLabelMinZoom(t){return this.getData(t,0,1,255)}getFilterFlags(t){return this.getData(t,0,0,0)}getVisualVariableData(t,e){return this.getData(t,3,e,0)}getData(t,e,i,s){if(!this._data)return 0;const r=this._data[e];if(null==r)return 0;const n=r.getData(t,i);return null!=n?n:s}setData(t,e,i,s){this._data[e].setData(t,i,s)}lockTextureUploads(){this._locked=!0}unlockTextureUploads(){return this._locked=!1,this.update()}requestUpdate(t){this._version=t.version,this._pendingAttributeUpdates.push(t),this._hasPendingUpdate.value=!0,has("esri-2d-update-debug")&&console.debug(`Version[${this._version}] AttributeStoreView.requestUpdate`,{message:t})}get currentEpoch(){return this._epoch}get hasPendingUpdates(){return this._pendingAttributeUpdates.length>0}update(){if(this._locked)return!1;const t=this._pendingAttributeUpdates;this._pendingAttributeUpdates=[];const e=!!t.length;for(const i of t){const{blockData:t,initArgs:e,sendUpdateEpoch:s,version:r}=i;has("esri-2d-update-debug")&&console.debug(`Version[${this._version}] Epoch[${s}] AttributeStoreView.applyUpdate`),this._version=r,this._epoch=s,null!=e&&this._initialize(e);const n=this._data;for(let i=0;i<t.length;i++){const e=t[i],s=n[i];null!=s&&null!=e&&(has("esri-2d-update-debug")&&console.debug(`Version[${this._version}] CpuBlock[${i}] AttributeStoreView.update`,{block:e}),s.update(e))}}return this._hasPendingUpdate.value=!1,e}getUniforms(){return{size:this.size}}getTextures(t){return{filterFlags:{texture:this._getTexture(t,0),unit:l},animation:{texture:this._getTexture(t,1),unit:d},gpgpu:{texture:this._getTexture(t,2),unit:o},localTimeOrigin:{texture:this._getTexture(t,7),unit:h},visualVariableData:{texture:this._getTexture(t,3),unit:u},dataDriven0:{texture:this._getTexture(t,4),unit:a},dataDriven1:{texture:this._getTexture(t,5),unit:n},dataDriven2:{texture:this._getTexture(t,6),unit:r}}}_getTexture(t,e){const i=this._data?.[e];return i?(i.updateTexture(t,this._version),i.getTexture(t)):this._getDefaultTexture(t)}_getDefaultTexture(t){if(null==this._defaultTexture){const e=new b(1);e.wrapMode=33071,e.samplingMode=9728,this._defaultTexture=new f(t,e,new Uint8Array(4))}return this._defaultTexture}}export{y as AttributeStoreView};
2
+ import t from"../../../../core/Error.js";import has from"../../../../core/has.js";import e from"../../../../core/Logger.js";import{estimateNumberArrayMemory as i}from"../../../../core/memoryEstimations.js";import{signal as s}from"../../../../core/signal.js";import{dataDrivenUnit2 as r,dataDrivenUnit1 as n,dataDrivenUnit0 as a,visualVariableUnit as u,localTimeOriginUnit as h,gpgpuUnit as o,animationUnit as d,filterFlagsUnit as l}from"./definitions.js";import{getDisplayIdTexel as _}from"./DisplayId.js";import{SizedPixelFormat as g,PixelType as p}from"../../../webgl/enums.js";import{DisposableFramebufferObject as c}from"../../../webgl/FramebufferObject.js";import x from"../../../webgl/Texture.js";import{TextureDescriptor as f}from"../../../webgl/TextureDescriptor.js";const b=()=>e.getLogger("esri.views.2d.engine.webgl.AttributeStoreView"),T=e=>{switch(e){case p.UNSIGNED_BYTE:return 1;case p.UNSIGNED_SHORT_4_4_4_4:return 2;case p.FLOAT:return 4;default:return void b().error(new t("webgl-utils",`Unable to handle type ${e}`))}},m=e=>{switch(e){case p.UNSIGNED_BYTE:return Uint8Array;case p.UNSIGNED_SHORT_4_4_4_4:return Uint16Array;case p.FLOAT:return Float32Array;default:return void b().error(new t("webgl-utils",`Unable to handle type ${e}`))}};class y{constructor(t,e,i){this._texture=null,this._lastTexture=null,this._fbos={},this.texelSize=4;const{buffer:s,pixelType:r,textureOnly:n}=t,a=m(r);this.blockIndex=i,this.pixelType=r,this.size=e,this.textureOnly=n,n||(this.data=new a(s)),this._resetRange()}destroy(){this._texture?.dispose();for(const t in this._fbos){const e=this._fbos[t];e&&("0"===t&&e.detachColorTexture(),e.dispose()),this._fbos[t]=null}this._texture=null}get _textureDesc(){const t=new f(this.size);if(t.wrapMode=33071,t.samplingMode=9728,t.dataType=this.pixelType,2===this.blockIndex)t.pixelFormat=6403,t.internalFormat=g.R8;return t}get usedMemory(){return null!=this.data?i(this.data):0}setData(t,e,i){const s=_(t),r=this.data,n=s*this.texelSize+e;!r||n>=r.length||(r[n]=i,this.dirtyStart=Math.min(this.dirtyStart,s),this.dirtyEnd=Math.max(this.dirtyEnd,s))}getData(t,e){if(null==this.data)return null;const i=_(t)*this.texelSize+e;return!this.data||i>=this.data.length?null:this.data[i]}getTexture(t){return this._texture??this._initTexture(t)}getFBO(t,e=0){if(!this._fbos[e]){const i=0===e?this.getTexture(t):this._textureDesc;this._fbos[e]=new c(t,i)}return this._fbos[e]}get hasDirty(){const t=this.dirtyStart;return this.dirtyEnd>=t}updateTexture(e,i){try{const s=this.dirtyStart,r=this.dirtyEnd;if(!this.hasDirty)return;has("esri-2d-update-debug")&&console.debug(`Version[${i}] AttributeStoreView.updateTexture`,{start:s,end:r,firstBytes:new Uint8Array(this.data.buffer.slice(0,16)),block:this}),this._resetRange();const n=this.data.buffer,a=this.getTexture(e),u=4,h=(s-s%this.size)/this.size,o=(r-r%this.size)/this.size,d=h,l=this.size,_=o,g=h*this.size*u,p=(l+_*this.size)*u-g,c=m(this.pixelType),x=new c(n,g*c.BYTES_PER_ELEMENT,p),f=this.size,T=_-d+1;if(T>this.size)return void b().error(new t("mapview-webgl","Out-of-bounds index when updating AttributeData"));a.updateData(0,0,d,f,T,x)}catch(s){}}update(t){const{data:e,start:i,end:s}=t;if(null!=e&&null!=this.data){const s=this.data,r=i*this.texelSize;for(let i=0;i<e.length;i++){const n=1<<i%this.texelSize;t.layout&n&&(s[r+i]=e[i])}}this.dirtyStart=Math.min(this.dirtyStart,i),this.dirtyEnd=Math.max(this.dirtyEnd,s)}resize(t,e){const i=this.size;if(this.size=e,this.textureOnly)return void(i!==this.size&&(this._lastTexture=this._texture,this._texture=null));const s=m(this.pixelType);this.destroy(),this.data=new s(t.buffer)}_resetRange(){this.dirtyStart=2147483647,this.dirtyEnd=0}_initTexture(t){const e=new x(t,this._textureDesc,this.data??void 0);if(null!=this._lastTexture&&this._fbos[0]){const i=this._lastTexture.descriptor.width,s=this._lastTexture.descriptor.height,r=this._lastTexture.descriptor.dataType,n=this._lastTexture.descriptor.pixelFormat,a=this.getFBO(t),u=T(r),h=new(m(r))(new ArrayBuffer(i*s*u*this.texelSize)),o=t.boundFramebuffer,{x:d,y:l,width:_,height:g}=t.getViewport();t.bindFramebuffer(a),a.readPixels(0,0,i,s,n,r,h),e.updateData(0,0,0,2*i,s/2,h),t.setViewport(d,l,_,g),t.bindFramebuffer(o)}return this.destroy(),this._texture=e,this._texture}}class w{constructor(){this.size=0,this._pendingAttributeUpdates=[],this._version=0,this._epoch=0,this._hasPendingUpdate=s(!1),this._locked=!1}get updating(){return this._hasPendingUpdate.value}get locked(){return this._locked}get usedMemory(){let t=0;for(const e of this._data??[])null!=e&&(t+=e.usedMemory);return t}_initialize(t){if(!t)throw new Error("InternalError: initArgs must be defined");const e=t.blockDescriptors;if(this.size=t.blockSize,has("esri-2d-update-debug")&&console.debug("AttributeStoreView.initialize",{message:t}),null==this._data)this._data=e.map((t,e)=>null!=t?new y(t,this.size,e):null);else for(let i=0;i<this._data.length;i++){const t=this._data[i],s=e[i];null!=s&&(null==t?this._data[i]=new y(s,this.size,i):t.resize(s,this.size))}}destroy(){for(const t of this._data??[])t?.destroy();this._defaultTexture?.dispose(),this._defaultTexture=null,this._pendingAttributeUpdates=[]}isEmpty(){return null==this._data}getBlock(t){if(null==this._data)return null;return this._data[t]}setLabelMinZoom(t,e){this.setData(t,0,1,e)}setLocalTimeOrigin(t,e){this.setData(t,7,0,e)}getLabelMinZoom(t){return this.getData(t,0,1,255)}getFilterFlags(t){return this.getData(t,0,0,0)}getVisualVariableData(t,e){return this.getData(t,3,e,0)}getData(t,e,i,s){if(!this._data)return 0;const r=this._data[e];if(null==r)return 0;const n=r.getData(t,i);return null!=n?n:s}setData(t,e,i,s){this._data[e].setData(t,i,s)}lockTextureUploads(){this._locked=!0}unlockTextureUploads(){return this._locked=!1,this.update()}requestUpdate(t){this._version=t.version,this._pendingAttributeUpdates.push(t),this._hasPendingUpdate.value=!0,has("esri-2d-update-debug")&&console.debug(`Version[${this._version}] AttributeStoreView.requestUpdate`,{message:t})}get currentEpoch(){return this._epoch}get hasPendingUpdates(){return this._pendingAttributeUpdates.length>0}update(){if(this._locked)return!1;const t=this._pendingAttributeUpdates;this._pendingAttributeUpdates=[];const e=!!t.length;for(const i of t){const{blockData:t,initArgs:e,sendUpdateEpoch:s,version:r}=i;has("esri-2d-update-debug")&&console.debug(`Version[${this._version}] Epoch[${s}] AttributeStoreView.applyUpdate`),this._version=r,this._epoch=s,null!=e&&this._initialize(e);const n=this._data;for(let i=0;i<t.length;i++){const e=t[i],s=n[i];null!=s&&null!=e&&(has("esri-2d-update-debug")&&console.debug(`Version[${this._version}] CpuBlock[${i}] AttributeStoreView.update`,{block:e}),s.update(e))}}return this._hasPendingUpdate.value=!1,e}getUniforms(){return{size:this.size}}getTextures(t){return{filterFlags:{texture:this._getTexture(t,0),unit:l},animation:{texture:this._getTexture(t,1),unit:d},gpgpu:{texture:this._getTexture(t,2),unit:o},localTimeOrigin:{texture:this._getTexture(t,7),unit:h},visualVariableData:{texture:this._getTexture(t,3),unit:u},dataDriven0:{texture:this._getTexture(t,4),unit:a},dataDriven1:{texture:this._getTexture(t,5),unit:n},dataDriven2:{texture:this._getTexture(t,6),unit:r}}}_getTexture(t,e){const i=this._data?.[e];return i?(i.updateTexture(t,this._version),i.getTexture(t)):this._getDefaultTexture(t)}_getDefaultTexture(t){if(null==this._defaultTexture){const e=new f(1);e.wrapMode=33071,e.samplingMode=9728,this._defaultTexture=new x(t,e,new Uint8Array(4))}return this._defaultTexture}}export{w as AttributeStoreView};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import"../../../../core/has.js";import{estimateNumberMemory as t}from"../../../../core/memoryEstimations.js";import{List as e}from"./cpuMapped/FreeList.js";import{isHittest as n}from"./shaderGraph/techniques/featureTechniqueUtils.js";import{PrimitiveType as i,DataType as s}from"../../../webgl/enums.js";function a(t,e){return t<<16|255&e}function r(t){return 255&t}function d(t,e){return e?e.get(t.instanceId)??t.techniqueRef.symbologyPlane:t.techniqueRef.symbologyPlane}class h{constructor(t,e,n,i,s){this.instance=t,this.materialKey=e,this.target=n,this.start=i,this.count=s}get textureKey(){return r(this.materialKey)}get indexEnd(){return this.start+this.count}extend(t){this.count+=t}render(t){const e=this.instance.techniqueRef;this.target.bind(t.context),e.render(t,this)}getStencilReference(){return this.target.stencilRef}getAttributePrecisionPackFactors(){const t=this.instance.instanceId;return this.target.getMesh(t).getAttributePrecisionPackFactors()}draw(t,e){n(t)?this.drawCompute(t.context,e):this.drawGeometry(t.context,e)}drawCompute(t,e){const n=this.instance.instanceId,a=this.target.getMesh(n).getComputeVAO(t,e),r=this.start*Uint32Array.BYTES_PER_ELEMENT/3;t.bindVAO(a,e.locations),t.drawElements(i.POINTS,this.count/3,s.UNSIGNED_INT,r),t.bindVAO(null)}drawGeometry(t,e){const n=this.instance.instanceId,a=this.target.getMesh(n).getGeometryVAO(t,e),r=this.start*Uint32Array.BYTES_PER_ELEMENT;t.bindVAO(a,e.locations),t.drawElements(i.TRIANGLES,this.count,s.UNSIGNED_INT,r),t.bindVAO(null)}}class o{constructor(){this._length=0,this._minOrderedLength=0,this._materialKeys=new Set}static fromDisplayEntities(t,e,n,i){const s=new o,r=n.getInstanceOrder();for(const d of t.values())for(const t of d.records){const d=n.getInstance(t.instanceId),h=a(d.instanceId,t.textureKey);s.addRecord(d,h,t.indexStart,t.indexCount,t.vertexStart,t.vertexCount,e,i,r)}return s}get length(){return this._length}get minOrderedLength(){return this._minOrderedLength}get minUnorderedLength(){return this._materialKeys.size}get usedMemory(){return this._length?5*this._length*t:0}render(t,e){const{drawPhase:n}=t;for(const i of this.infos()){const s=i.instance.techniqueRef;s.drawPhase&n&&(null==e||s.type===e)&&i.render(t)}}addRecord(t,n,i,s,a,r,o,l,c){let u=i,_=s;if(_||(u=a,_=r),!_)return;if(null==this._head){const i=new h(t,n,o,u,_);return this._head=new e(i),this._tail=this._head,this._length++,void this._minOrderedLength++}if(1===l)return this._insert(t,n,o,u,_,this._tail,null);let g=null,m=this._head;const f=t.instanceId,y=d(t,c);if(2===l&&(2===y||3===y))return this._insert(t,n,o,u,_,this._tail,null);for(;m;){const e=m.data.instance,i=e.instanceId,s=d(e,c),a=g?.data.instance.instanceId;if(y<s||f===a&&f!==i)return this._insert(t,n,o,u,_,g,m);g=m,m=m.next}this._insert(t,n,o,u,_,g,null)}*infos(){if(null!=this._head)for(const t of this._head.values())yield t}_insert(t,n,i,s,a,r,d){if(null==r&&null==d){const r=new h(t,n,i,s,a);return this._head=new e(r),this._tail=this._head,this._length++,void this._minOrderedLength++}return n!==this._tail.data.materialKey&&this._minOrderedLength++,this._materialKeys.add(n),null==r&&null!=d?this._insertAtHead(t,n,i,s,a,d):null!=r&&null==d?this._insertAtEnd(t,n,i,s,a,r):null!=r&&null!=d?this._insertAtMiddle(t,n,i,s,a,r,d):void 0}_insertAtHead(t,n,i,s,a,r){const d=s+a;if(n===r.data.materialKey&&i===r.data.target&&d===r.data.start)r.data.start=s,r.data.count+=a;else{const d=new h(t,n,i,s,a);this._head=new e(d),this._head.next=r,this._length++}}_insertAtEnd(t,n,i,s,a,r){if(r.data.materialKey===n&&r.data.indexEnd===s)r.data.count+=a;else{const d=new h(t,n,i,s,a);this._tail=new e(d),r.next=this._tail,this._length++}}_insertAtMiddle(t,n,i,s,a,r,d){const o=s+a;if(r.data.materialKey===n&&r.data.target===i&&r.data.indexEnd===s)r.data.count+=a,r.data.materialKey===d.data.materialKey&&r.data.target===d.data.target&&r.data.indexEnd===d.data.start&&(r.data.count+=d.data.count,r.next=d.next,this._length--);else if(n===d.data.materialKey&&i===d.data.target&&o===d.data.start)d.data.start=s,d.data.count+=a;else{const o=new h(t,n,i,s,a),l=new e(o);r.next=l,l.next=d,this._length++}}}export{o as DisplayList,h as DisplayListInfo};
2
+ import"../../../../core/has.js";import{estimateNumberMemory as t}from"../../../../core/memoryEstimations.js";import{List as e}from"./cpuMapped/FreeList.js";import{isHittest as n}from"./shaderGraph/techniques/featureTechniqueUtils.js";import{PrimitiveType as i,DataType as s}from"../../../webgl/enums.js";function a(t,e){return t<<16|255&e}function r(t){return 255&t}function d(t,e){return e?e.get(t.instanceId)??t.techniqueRef.symbologyPlane:t.techniqueRef.symbologyPlane}class h{constructor(t,e,n,i,s){this.instance=t,this.materialKey=e,this.target=n,this.start=i,this.count=s}get textureKey(){return r(this.materialKey)}get indexEnd(){return this.start+this.count}extend(t){this.count+=t}render(t){const e=this.instance.techniqueRef;this.target.bind(t.context),e.render(t,this)}getStencilReference(){return this.target.stencilRef}getAttributePrecisionPackFactors(){const t=this.instance.instanceId;return this.target.getMesh(t).getAttributePrecisionPackFactors()}draw(t,e){n(t)?this.drawCompute(t.context,e):this.drawGeometry(t.context,e)}drawCompute(t,e){const n=this.instance.instanceId,a=this.target.getMesh(n).getComputeVAO(t,e),r=this.start*Uint32Array.BYTES_PER_ELEMENT/3;t.bindVAO(a,e.locations),t.drawElements(i.POINTS,this.count/3,s.UNSIGNED_INT,r),t.bindVAO(null)}drawGeometry(t,e){const n=this.instance.instanceId,a=this.target.getMesh(n).getGeometryVAO(t,e),r=this.start*Uint32Array.BYTES_PER_ELEMENT;t.bindVAO(a,e.locations),t.drawElements(i.TRIANGLES,this.count,s.UNSIGNED_INT,r),t.bindVAO(null)}}class o{constructor(){this._length=0,this._minOrderedLength=0,this._materialKeys=new Set}static fromDisplayEntities(t,e,n,i){const s=new o,r=n.getInstanceOrder();for(const d of t.values())for(const t of d.records){const d=n.getInstance(t.instanceId),h=a(d.instanceId,t.textureKey);s.addRecord(d,h,t.indexStart,t.indexCount,t.vertexStart,t.vertexCount,e,i,r)}return s}get length(){return this._length}get minOrderedLength(){return this._minOrderedLength}get minUnorderedLength(){return this._materialKeys.size}get usedMemory(){return this._length?5*this._length*t:0}render(t,e){const{drawPhase:n}=t;let i=!1;for(const s of this.infos()){const a=s.instance.techniqueRef;a.drawPhase&n&&(null==e||a.type===e)&&(s.render(t),i=!0)}return i}addRecord(t,n,i,s,a,r,o,l,c){let u=i,_=s;if(_||(u=a,_=r),!_)return;if(null==this._head){const i=new h(t,n,o,u,_);return this._head=new e(i),this._tail=this._head,this._length++,void this._minOrderedLength++}if(1===l)return this._insert(t,n,o,u,_,this._tail,null);let g=null,m=this._head;const f=t.instanceId,y=d(t,c);if(2===l&&(2===y||3===y))return this._insert(t,n,o,u,_,this._tail,null);for(;m;){const e=m.data.instance,i=e.instanceId,s=d(e,c),a=g?.data.instance.instanceId;if(y<s||f===a&&f!==i)return this._insert(t,n,o,u,_,g,m);g=m,m=m.next}this._insert(t,n,o,u,_,g,null)}*infos(){if(null!=this._head)for(const t of this._head.values())yield t}_insert(t,n,i,s,a,r,d){if(null==r&&null==d){const r=new h(t,n,i,s,a);return this._head=new e(r),this._tail=this._head,this._length++,void this._minOrderedLength++}return n!==this._tail.data.materialKey&&this._minOrderedLength++,this._materialKeys.add(n),null==r&&null!=d?this._insertAtHead(t,n,i,s,a,d):null!=r&&null==d?this._insertAtEnd(t,n,i,s,a,r):null!=r&&null!=d?this._insertAtMiddle(t,n,i,s,a,r,d):void 0}_insertAtHead(t,n,i,s,a,r){const d=s+a;if(n===r.data.materialKey&&i===r.data.target&&d===r.data.start)r.data.start=s,r.data.count+=a;else{const d=new h(t,n,i,s,a);this._head=new e(d),this._head.next=r,this._length++}}_insertAtEnd(t,n,i,s,a,r){if(r.data.materialKey===n&&r.data.indexEnd===s)r.data.count+=a;else{const d=new h(t,n,i,s,a);this._tail=new e(d),r.next=this._tail,this._length++}}_insertAtMiddle(t,n,i,s,a,r,d){const o=s+a;if(r.data.materialKey===n&&r.data.target===i&&r.data.indexEnd===s)r.data.count+=a,r.data.materialKey===d.data.materialKey&&r.data.target===d.data.target&&r.data.indexEnd===d.data.start&&(r.data.count+=d.data.count,r.next=d.next,this._length--);else if(n===d.data.materialKey&&i===d.data.target&&o===d.data.start)d.data.start=s,d.data.count+=a;else{const o=new h(t,n,i,s,a),l=new e(o);r.next=l,l.next=d,this._length++}}}export{o as DisplayList,h as DisplayListInfo};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import has from"../../../../core/has.js";import{open as t}from"../../../../core/workers.js";import{sdfBufferServer as e}from"./definitions.js";import i from"./Rect.js";import s from"../../../webgl/Texture.js";import{TextureDescriptor as r}from"../../../webgl/TextureDescriptor.js";const h={width:5,height:2,left:0,top:0},o=new i(0,0,11,8),n=new i(11,0,11,8);class a{constructor(t,e,i,s){this._snapCoords=i,this._setTextureBinding=s,this.width=0,this.height=0,this._dirties=[],this._pageData=[],this._currentPage=0,this._textures=[],this._worker=this._load(),this.width=t,this.height=e,this._pageData.push(new Uint8Array(t*e)),this._dirties.push(!0),this._textures.push(null),this._initDecorationGlyphs()}dispose(){for(const t of this._textures)t&&t.dispose();this._textures.length=0,this._pageData.length=0,this._worker.then(t=>t.connection.close())}async openMessagePorts(){return(await this._worker).connection.openPorts()}async rasterizeText(t,e,i){return(await this._worker).worker.rasterizeText(t,e,i)}getTexture(t,e){if(!this._textures[e]){const i=new r(this.width,this.height);i.pixelFormat=6406,i.wrapMode=33071,this._textures[e]=new s(t,i,new Uint8Array(this.width*this.height))}return this._dirties[e]&&(this._textures[e].setData(this._pageData[e]),this._dirties[e]=!1),this._textures[e]}bind(t,e,i,s){const r=this.getTexture(t,i);r.setSamplingMode(e),t.bindTexture(r,s)}async _load(){const i={getOptions:()=>({width:this.width,height:this.height,snapCoords:!!this._snapCoords}),recordGlyphs:t=>{const i=e;for(const e of t)e.sdf&&this.recordGlyph(e.mosaicItem,e.rect,e.sdf.buffer,i),this._setTextureBinding&&0!==e.mosaicItem.textureBinding&&this._setTextureBinding(e.mosaicItem)}},s=await t("GlyphWorker",{client:i,strategy:"dedicated"});return{worker:s.createInvokeProxy(),connection:s}}_invalidate(){this._dirties[this._currentPage]=!0}recordGlyph(t,e,i,s){const{page:r,rect:h}=t;if(0===e.width)return;const o=e.width+2*s,n=e.height+2*s;this._pageData[r]||this._allocNewPage(r);const a=this._pageData[r];for(let c=0;c<n;c++){const t=o*c,e=this.width*(h.y+c)+h.x;for(let s=0;s<o;s++)a[e+s]=i[t+s]}has("esri-glyph-debug")&&this._showDebugPage(a),this._invalidate()}_allocNewPage(t){this._dirties[this._currentPage]||(this._pageData[this._currentPage]=null),this._currentPage=t,this._pageData[t]=new Uint8Array(this.width*this.height),this._dirties[t]=!0,this._textures[t]=null,this._initDecorationGlyphs()}_initDecorationGlyphs(){const t=[117,149,181,207,207,181,149,117],i=[],s=[];for(let e=0;e<t.length;e++){const r=t[e];for(let t=0;t<11;t++){const h=e>=3&&e<5&&t>=3&&t<8?255:0;i.push(r),s.push(h)}}const r=new Uint8Array(i),a={rect:o,page:this._currentPage,sdf:!0},c=new Uint8Array(s),d={rect:n,page:this._currentPage,sdf:!0};this.recordGlyph(a,h,r,e),this.recordGlyph(d,h,c,e)}_showDebugPage(t){const e=document.createElement("canvas"),i=e.getContext("2d"),s=new ImageData(this.width,this.height),r=s.data;e.width=this.width,e.height=this.height,e.style.border="1px solid black";for(let h=0;h<t.length;++h)r[4*h]=t[h],r[4*h+1]=0,r[4*h+2]=0,r[4*h+3]=255;i.putImageData(s,0,0),document.body.appendChild(e)}}export{a as GlyphMosaic,h as decorGlyphRect};
2
+ import has from"../../../../core/has.js";import{open as t}from"../../../../core/workers.js";import{decorGlyphRect as e}from"./decorGlyphRect.js";import{sdfBufferServer as i}from"./definitions.js";import s from"./Rect.js";import r from"../../../webgl/Texture.js";import{TextureDescriptor as h}from"../../../webgl/TextureDescriptor.js";const o=new s(0,0,11,8),n=new s(11,0,11,8);class a{constructor(t,e,i,s){this._snapCoords=i,this._setTextureBinding=s,this.width=0,this.height=0,this._dirties=[],this._pageData=[],this._currentPage=0,this._textures=[],this._worker=this._load(),this.width=t,this.height=e,this._pageData.push(new Uint8Array(t*e)),this._dirties.push(!0),this._textures.push(null),this._initDecorationGlyphs()}dispose(){for(const t of this._textures)t&&t.dispose();this._textures.length=0,this._pageData.length=0,this._worker.then(t=>t.connection.close())}async openMessagePorts(){return(await this._worker).connection.openPorts()}async rasterizeText(t,e,i){return(await this._worker).worker.rasterizeText(t,e,i)}getTexture(t,e){if(!this._textures[e]){const i=new h(this.width,this.height);i.pixelFormat=6406,i.wrapMode=33071,this._textures[e]=new r(t,i,new Uint8Array(this.width*this.height))}return this._dirties[e]&&(this._textures[e].setData(this._pageData[e]),this._dirties[e]=!1),this._textures[e]}bind(t,e,i,s){const r=this.getTexture(t,i);r.setSamplingMode(e),t.bindTexture(r,s)}async _load(){const e={getOptions:()=>({width:this.width,height:this.height,snapCoords:!!this._snapCoords}),recordGlyphs:t=>{const e=i;for(const i of t)i.sdf&&this.recordGlyph(i.mosaicItem,i.rect,i.sdf.buffer,e),this._setTextureBinding&&0!==i.mosaicItem.textureBinding&&this._setTextureBinding(i.mosaicItem)}},s=await t("GlyphWorker",{client:e,strategy:"dedicated"});return{worker:s.createInvokeProxy(),connection:s}}_invalidate(){this._dirties[this._currentPage]=!0}recordGlyph(t,e,i,s){const{page:r,rect:h}=t;if(0===e.width)return;const o=e.width+2*s,n=e.height+2*s;this._pageData[r]||this._allocNewPage(r);const a=this._pageData[r];for(let c=0;c<n;c++){const t=o*c,e=this.width*(h.y+c)+h.x;for(let s=0;s<o;s++)a[e+s]=i[t+s]}has("esri-glyph-debug")&&this._showDebugPage(a),this._invalidate()}_allocNewPage(t){this._dirties[this._currentPage]||(this._pageData[this._currentPage]=null),this._currentPage=t,this._pageData[t]=new Uint8Array(this.width*this.height),this._dirties[t]=!0,this._textures[t]=null,this._initDecorationGlyphs()}_initDecorationGlyphs(){const t=[117,149,181,207,207,181,149,117],s=[],r=[];for(let e=0;e<t.length;e++){const i=t[e];for(let t=0;t<11;t++){const h=e>=3&&e<5&&t>=3&&t<8?255:0;s.push(i),r.push(h)}}const h=new Uint8Array(s),a={rect:o,page:this._currentPage,sdf:!0},c=new Uint8Array(r),d={rect:n,page:this._currentPage,sdf:!0};this.recordGlyph(a,e,h,i),this.recordGlyph(d,e,c,i)}_showDebugPage(t){const e=document.createElement("canvas"),i=e.getContext("2d"),s=new ImageData(this.width,this.height),r=s.data;e.width=this.width,e.height=this.height,e.style.border="1px solid black";for(let h=0;h<t.length;++h)r[4*h]=t[h],r[4*h+1]=0,r[4*h+2]=0,r[4*h+3]=255;i.putImageData(s,0,0),document.body.appendChild(e)}}export{a as GlyphMosaic};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import t from"../../../../request.js";import{bidiText as e}from"../../../../core/BidiText.js";import{getFullyQualifiedFontName as s}from"../../../../core/fontUtils.js";import has from"../../../../core/has.js";import i from"../../../../core/Logger.js";import{throwIfNotAbortError as a}from"../../../../core/promiseUtils.js";import{loadTextModule as r}from"../../../../libs/librust-text/loadTextModule.js";import{parseRichTextRuns as h}from"../../../../symbols/cim/richTextUtils.js";import{sdfRadiusComplex as n,sdfBufferGlyphSDFCreator as o,sdfSizeComplex as c,sdfBufferServer as p,sdfRadiusSimple as l,sdfSizeSimple as f}from"./definitions.js";import{decorGlyphRect as g}from"./GlyphMosaic.js";import{GlyphSDFCreator as d}from"./GlyphSDFCreator.js";import _ from"./GlyphSource.js";import y from"./Rect.js";import u from"./RectangleBinPack.js";import{hashMosaic as m}from"./TextureManager.js";import{charCodes as w}from"./Utils.js";const S=.25,C="arial-unicode-ms-regular",G=/[\u0695\u0698\u06a9\u06af\u06b5\u06be\u06c6\u06cc\u06ce\u06d5\u06ca]|\p{Script=Thai}|\p{Script=Lao}|\p{Script=Tamil}|\p{Script=Khmer}/u,P=new Set(["Noto Sans Khmer","Noto Sans Lao","Noto Sans Myanmar","Noto Sans Thai"]),b=()=>i.getLogger("esri.views.MapView"),x=(t,e="")=>b().warnOnce(t,e);class R{constructor(){this._glyphSources=new Map,this._snapCoords=!0,this._currentPage=0,this._faces=new Map,this._facePromises=new Map,this._pbfRangePromises=new Map,this._glyphCache=new Map,this._pbfGlyphCache=new Map,this._invalidFonts=new Set,this._preloadCache={},this._glyphSDFCreator=new d({sdfSizePx:c,sdfBufferPx:o,radius:n,cutoff:S})}set remoteClient(t){this._client=t.createInvokeProxy();const e=this._client.getOptions();this._inited=this._init(e)}async rasterizeText(t,e,s){await this._inited;const i=e.symbol?h(e):null;if(i){return{type:"rich-glyphs",runs:(await Promise.all(i.map(async e=>({fontSize:e.fontSize,characterSpacing:e.characterSpacing,decoration:e.font.decoration,color:e.color,glyphs:await this._rasterizeTextRun(t,e.font,e.text,s)})))).filter(t=>null!=t.glyphs)}}return this._rasterizeTextRun(t,e.font,e.textString,s)}async _rasterizeTextRun(t,e,i,a){const r=s(e),h=this._invalidFonts.has(r),n=!!has("esri-2d-force-complex-shaping"),o=!!has("esri-2d-complex-shaping")&&G.test(i),c=P.has(e.family),p=n||o||c,l=h?C:r;let f=await this.getGlyphItems(i,p,t,l,!1,a);return f||(x(`Font ${r} is not available on the web, using "Arial Unicode MS Regular"`),this._invalidFonts.add(r),f=await this.getGlyphItems(i,p,t,C,!1,a)),f}async getGlyphItems(t,s,i,a,r,h){await this._inited;const g=this._getSource(i),d=s?c:f,_=s?n:l,y=s?o:p;let u,m,S;if(has("esri-2d-stabilize-glyphs")&&await this.preloadASCIIGlyphCache(g,a).catch(()=>{}),s){const e=await this._getFace(g,a);if(!e)return null;let s=this._glyphCache.get(a);s||(s=new Map,this._glyphCache.set(a,s));const{shaping:i,isRTL:r}=this._shape(e,t);S=r,u=i.map(t=>this._getShapedGlyph(e,s,t)),m={baseline:e.baseline()/d,midline:e.midline()/d}}else{let s=this._pbfGlyphCache.get(a);s||(s=new Map,this._pbfGlyphCache.set(a,s));const[i,n,o]=e(t),c=w(i);try{await this._fetchRanges(g,a,c,h)}catch{return null}S=n,u=c.map(t=>this._getPBFGlyph(s,g,a,t,r)).filter(t=>!!t)}const C=u.filter(t=>t.needsRecord);return C.length>0&&await this._client.recordGlyphs(C),{type:"glyphs",glyphs:u,faceInfo:m,isRightToLeft:S,sdfSize:d,sdfRadius:_,sdfPadding:y}}async _init(t){const{width:e,height:s,snapCoords:i}=await t;this._glyphCache=new Map,this._pbfGlyphCache=new Map,this._binPack=new u(e,s),this._snapCoords=i,this._currentPage=0,this._initDecorationGlyphs()}_getShapedGlyph(t,e,s){let i,a,r=e.get(s.glyphId);if(!r){i=this._glyphSDFCreator.draw(t,s.glyphId);const h=this._glyphSDFCreator.sdfBufferPx;r={mosaicItem:{rect:this._recordGlyph(i?.rect,h),page:this._currentPage,sdf:!0,textureBinding:m(1,this._currentPage,!0)},glyphRect:i?.rect??{width:0,height:0,top:0,left:0}},e.set(s.glyphId,r),a=!0}return{mosaicItem:r.mosaicItem,rect:r.glyphRect,shaping:{xAdvance:s.xAdvance,yAdvance:s.yAdvance,xOffset:s.xOffset,yOffset:s.yOffset},code:s.isNewline?10:s.isWhitespace?32:NaN,sdf:i,needsRecord:a}}_getPBFGlyph(t,e,s,i,a=!1){let r,h,n=t.get(i);if(!n){const c=e.getRange(s,i),p=c?.getRect(i),l=c?.getShaping(i),f=c?.getBitmap(i);if(a&&(!p||!l))return;if(!p||!l)return j(i);r=f&&{buffer:f,rect:p},n={mosaicItem:{rect:f?this._recordGlyph(p,o):new y(0,0,0,0),sdf:!0,page:this._currentPage,textureBinding:m(1,this._currentPage,!0)},rect:p,shaping:l,code:i},h=!0,t.set(i,n)}const{mosaicItem:c,rect:p,shaping:l}=n;return{mosaicItem:c,rect:p,shaping:l,code:i,sdf:r,needsRecord:h}}_shape(t,s){const i=this._glyphSDFCreator.sdfSizePx,[a,r,h]=e(s,!1),n=new Uint32Array(Array.from(a).map((t,e)=>h.levels[h.targetToSource[e]]));return{shaping:t.shape(a,n,i),isRTL:r}}async _getFace(e,s,i){if(this._faces.has(s))return this._faces.get(s);const a=e.woffURL(s);return await M(this._facePromises,s,async()=>{const e=await t(a,{responseType:"array-buffer",...i}),h=(await r()).Face.parseWoff2(new Uint8Array(e.data));this._faces.set(s,h)}),this._faces.get(s)}_getSource(t){return this._glyphSources.has(t)||this._glyphSources.set(t,new _(t)),this._glyphSources.get(t)}async _fetchRanges(t,e,s,i){const a=I(s),r=[];a.forEach(s=>{r.push(this._fetchRange(t,e,s,i))}),await Promise.all(r)}async _fetchRange(t,e,s,i){if(s>256)return;const a=e+s;return M(this._pbfRangePromises,a,()=>t.fetchRange(e,s,i))}_allocNewPage(){this._currentPage++,this._binPack=new u(this._binPack.width,this._binPack.height),this._initDecorationGlyphs()}_recordGlyph(t,e){const s=this._binPack;if(!t||0===t.width)return new y;const i=t.width+2*e,a=t.height+2*e;let r=i,h=a;if(this._snapCoords){r+=i%4?4-i%4:4,h+=a%4?4-a%4:4}const n=s.allocate(r,h);return n.isEmpty?(this._allocNewPage(),s.allocate(r,h)):n}_initDecorationGlyphs(){this._recordGlyph(g,p),this._recordGlyph(g,p)}preloadASCIIGlyphCache(t,e){const s=this._preloadCache[e];if(null!=s)return s;const i=t.preloadASCIIRange(e).then(async()=>{let s=this._pbfGlyphCache.get(e);s||(s=new Map,this._pbfGlyphCache.set(e,s));for(let a=0;a<256;a++)this._getPBFGlyph(s,t,e,a);const i=Array.from(this._pbfGlyphCache.get(e).values());await this._client.recordGlyphs(i)},t=>{throw delete this._preloadCache[e],t});return this._preloadCache[e]=i,i}}function I(t){const e=new Set;for(const s of t)e.add(Math.floor(s/256));return e}function M(t,e,s){return t.has(e)||t.set(e,s().finally(()=>{t.delete(e)}).catch(t=>{a(t)})),t.get(e)}const j=t=>({mosaicItem:{rect:new y(0,0,0,0),sdf:!0,page:0},rect:{left:0,width:0,height:0,top:0},shaping:{xAdvance:0,yAdvance:0,xOffset:0,yOffset:0},code:t});export{R as default};
2
+ import t from"../../../../request.js";import{bidiText as e}from"../../../../core/BidiText.js";import{getFullyQualifiedFontName as s}from"../../../../core/fontUtils.js";import has from"../../../../core/has.js";import i from"../../../../core/Logger.js";import{throwIfNotAbortError as a}from"../../../../core/promiseUtils.js";import{loadTextModule as r}from"../../../../libs/librust-text/loadTextModule.js";import{parseRichTextRuns as h}from"../../../../symbols/cim/richTextUtils.js";import{decorGlyphRect as n}from"./decorGlyphRect.js";import{sdfRadiusComplex as o,sdfBufferGlyphSDFCreator as c,sdfSizeComplex as p,sdfBufferServer as l,sdfRadiusSimple as f,sdfSizeSimple as g}from"./definitions.js";import{GlyphSDFCreator as d}from"./GlyphSDFCreator.js";import _ from"./GlyphSource.js";import{hashMosaic as y}from"./hashMosaic.js";import u from"./Rect.js";import m from"./RectangleBinPack.js";const w=.25,S="arial-unicode-ms-regular",C=/[\u0695\u0698\u06a9\u06af\u06b5\u06be\u06c6\u06cc\u06ce\u06d5\u06ca]|\p{Script=Thai}|\p{Script=Lao}|\p{Script=Tamil}|\p{Script=Khmer}/u,G=new Set(["Noto Sans Khmer","Noto Sans Lao","Noto Sans Myanmar","Noto Sans Thai"]),P=()=>i.getLogger("esri.views.MapView"),b=(t,e="")=>P().warnOnce(t,e);class R{constructor(){this._glyphSources=new Map,this._snapCoords=!0,this._currentPage=0,this._faces=new Map,this._facePromises=new Map,this._pbfRangePromises=new Map,this._glyphCache=new Map,this._pbfGlyphCache=new Map,this._invalidFonts=new Set,this._preloadCache={},this._glyphSDFCreator=new d({sdfSizePx:p,sdfBufferPx:c,radius:o,cutoff:w})}set remoteClient(t){this._client=t.createInvokeProxy();const e=this._client.getOptions();this._inited=this._init(e)}async rasterizeText(t,e,s){await this._inited;const i=e.symbol?h(e):null;if(i){return{type:"rich-glyphs",runs:(await Promise.all(i.map(async e=>({fontSize:e.fontSize,characterSpacing:e.characterSpacing,decoration:e.font.decoration,color:e.color,glyphs:await this._rasterizeTextRun(t,e.font,e.text,s)})))).filter(t=>null!=t.glyphs)}}return this._rasterizeTextRun(t,e.font,e.textString,s)}async _rasterizeTextRun(t,e,i,a){const r=s(e),h=this._invalidFonts.has(r),n=!!has("esri-2d-force-complex-shaping"),o=!!has("esri-2d-complex-shaping")&&C.test(i),c=G.has(e.family),p=n||o||c,l=h?S:r;let f=await this.getGlyphItems(i,p,t,l,!1,a);return f||(b(`Font ${r} is not available on the web, using "Arial Unicode MS Regular"`),this._invalidFonts.add(r),f=await this.getGlyphItems(i,p,t,S,!1,a)),f}async getGlyphItems(t,s,i,a,r,h){await this._inited;const n=this._getSource(i),d=s?p:g,_=s?o:f,y=s?c:l;let u,m,w;if(has("esri-2d-stabilize-glyphs")&&await this.preloadASCIIGlyphCache(n,a).catch(()=>{}),s){const e=await this._getFace(n,a);if(!e)return null;let s=this._glyphCache.get(a);s||(s=new Map,this._glyphCache.set(a,s));const{shaping:i,isRTL:r}=this._shape(e,t);w=r,u=i.map(t=>this._getShapedGlyph(e,s,t)),m={baseline:e.baseline()/d,midline:e.midline()/d}}else{let s=this._pbfGlyphCache.get(a);s||(s=new Map,this._pbfGlyphCache.set(a,s));const[i,o,c]=e(t),p=j(i);try{await this._fetchRanges(n,a,p,h)}catch{return null}w=o,u=p.map(t=>this._getPBFGlyph(s,n,a,t,r)).filter(t=>!!t)}const S=u.filter(t=>t.needsRecord);return S.length>0&&await this._client.recordGlyphs(S),{type:"glyphs",glyphs:u,faceInfo:m,isRightToLeft:w,sdfSize:d,sdfRadius:_,sdfPadding:y}}async _init(t){const{width:e,height:s,snapCoords:i}=await t;this._glyphCache=new Map,this._pbfGlyphCache=new Map,this._binPack=new m(e,s),this._snapCoords=i,this._currentPage=0,this._initDecorationGlyphs()}_getShapedGlyph(t,e,s){let i,a,r=e.get(s.glyphId);if(!r){i=this._glyphSDFCreator.draw(t,s.glyphId);const h=this._glyphSDFCreator.sdfBufferPx;r={mosaicItem:{rect:this._recordGlyph(i?.rect,h),page:this._currentPage,sdf:!0,textureBinding:y(1,this._currentPage,!0)},glyphRect:i?.rect??{width:0,height:0,top:0,left:0}},e.set(s.glyphId,r),a=!0}return{mosaicItem:r.mosaicItem,rect:r.glyphRect,shaping:{xAdvance:s.xAdvance,yAdvance:s.yAdvance,xOffset:s.xOffset,yOffset:s.yOffset},code:s.isNewline?10:s.isWhitespace?32:NaN,sdf:i,needsRecord:a}}_getPBFGlyph(t,e,s,i,a=!1){let r,h,n=t.get(i);if(!n){const o=e.getRange(s,i),p=o?.getRect(i),l=o?.getShaping(i),f=o?.getBitmap(i);if(a&&(!p||!l))return;if(!p||!l)return M(i);r=f&&{buffer:f,rect:p},n={mosaicItem:{rect:f?this._recordGlyph(p,c):new u(0,0,0,0),sdf:!0,page:this._currentPage,textureBinding:y(1,this._currentPage,!0)},rect:p,shaping:l,code:i},h=!0,t.set(i,n)}const{mosaicItem:o,rect:p,shaping:l}=n;return{mosaicItem:o,rect:p,shaping:l,code:i,sdf:r,needsRecord:h}}_shape(t,s){const i=this._glyphSDFCreator.sdfSizePx,[a,r,h]=e(s,!1),n=new Uint32Array(Array.from(a).map((t,e)=>h.levels[h.targetToSource[e]]));return{shaping:t.shape(a,n,i),isRTL:r}}async _getFace(e,s,i){if(this._faces.has(s))return this._faces.get(s);const a=e.woffURL(s);return await I(this._facePromises,s,async()=>{const e=await t(a,{responseType:"array-buffer",...i}),h=(await r()).Face.parseWoff2(new Uint8Array(e.data));this._faces.set(s,h)}),this._faces.get(s)}_getSource(t){return this._glyphSources.has(t)||this._glyphSources.set(t,new _(t)),this._glyphSources.get(t)}async _fetchRanges(t,e,s,i){const a=x(s),r=[];a.forEach(s=>{r.push(this._fetchRange(t,e,s,i))}),await Promise.all(r)}async _fetchRange(t,e,s,i){if(s>256)return;const a=e+s;return I(this._pbfRangePromises,a,()=>t.fetchRange(e,s,i))}_allocNewPage(){this._currentPage++,this._binPack=new m(this._binPack.width,this._binPack.height),this._initDecorationGlyphs()}_recordGlyph(t,e){const s=this._binPack;if(!t||0===t.width)return new u;const i=t.width+2*e,a=t.height+2*e;let r=i,h=a;if(this._snapCoords){r+=i%4?4-i%4:4,h+=a%4?4-a%4:4}const n=s.allocate(r,h);return n.isEmpty?(this._allocNewPage(),s.allocate(r,h)):n}_initDecorationGlyphs(){this._recordGlyph(n,l),this._recordGlyph(n,l)}preloadASCIIGlyphCache(t,e){const s=this._preloadCache[e];if(null!=s)return s;const i=t.preloadASCIIRange(e).then(async()=>{let s=this._pbfGlyphCache.get(e);s||(s=new Map,this._pbfGlyphCache.set(e,s));for(let a=0;a<256;a++)this._getPBFGlyph(s,t,e,a);const i=Array.from(this._pbfGlyphCache.get(e).values());await this._client.recordGlyphs(i)},t=>{throw delete this._preloadCache[e],t});return this._preloadCache[e]=i,i}}function x(t){const e=new Set;for(const s of t)e.add(Math.floor(s/256));return e}function I(t,e,s){return t.has(e)||t.set(e,s().finally(()=>{t.delete(e)}).catch(t=>{a(t)})),t.get(e)}const M=t=>({mosaicItem:{rect:new u(0,0,0,0),sdf:!0,page:0},rect:{left:0,width:0,height:0,top:0},shaping:{xAdvance:0,yAdvance:0,xOffset:0,yOffset:0},code:t});function j(t){const e=[];for(let s=0;s<t.length;s++)e.push(t.charCodeAt(s));return e}export{R as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import e from"../../../../config.js";import t from"../../../../request.js";import i from"../../../../core/Error.js";import r from"../../../../core/Logger.js";import{throwIfAborted as s,isAbortError as a}from"../../../../core/promiseUtils.js";import{QueueProcessor as n}from"../../../../core/QueueProcessor.js";import{pt2px as o}from"../../../../core/screenUtils.js";import{numericHash as c}from"../../../../core/string.js";import l from"../../../../symbols/cim/CIMResourceManager.js";import{CIMSymbolHelper as h}from"../../../../symbols/cim/CIMSymbolHelper.js";import u from"../../../../symbols/cim/Rasterizer.js";import{normalizeDashTemplate as m}from"../../../../symbols/cim/utils.js";import{svgSdfTextureInnerSize as p,textureBindingGlyphAtlas as d,textureBindingSpriteAtlas as g}from"./definitions.js";import{GlyphMosaic as f}from"./GlyphMosaic.js";import y from"./Rect.js";import M from"./SDFConverter.js";import _ from"./SpriteMosaic.js";import{discardUrlIfHasUrlHash as I}from"./urlUtils.js";import{getCIMMarkerPlacementHash as w,isSVGImage as S}from"./Utils.js";import{AnimatableTextureResource as z}from"./animatedFormats/AnimatableTextureResource.js";import{AnimationStore as T}from"./animations/store/AnimationStore.js";const C=()=>r.getLogger("esri.views.MapView"),R=(e,t,r)=>C().error(new i(e,t,r));class P{static fromMosaic(e,t){return new P(e,t.page,t.sdf,t.samplingMode)}constructor(e,t,i,r){this.mosaicType=e,this.page=t,this.sdf=i,this.samplingMode=r}}class b{constructor(r){this._requestRender=r,this._resourceManager=new l,this._sdfConverter=new M(p),this._hashToBindingInfo=new Map,this._ongoingRasterizations=new Map,this._imageRequestQueue=new n({concurrency:10,process:async(e,r)=>{s(r);try{return await t(e,{responseType:"image",signal:r})}catch(n){if(!a(n))throw new i("mapview-invalid-resource",`Could not fetch requested resource at ${e}`,n);throw n}}}),this.animationStore=new T,this._spriteMosaic=new _(2048,2048,500),this._glyphMosaic=new f(1024,1024,!1,e=>this._setTextureBinding(1,e)),this._rasterizer=new u(this.resourceManager),this._baseUrl=`${e.fontsUrl}/{fontstack}/{range}.pbf`}dispose(){this._spriteMosaic.dispose(),this._glyphMosaic.dispose(),this._rasterizer.dispose(),this._sdfConverter.dispose(),this._spriteMosaic=null,this._glyphMosaic=null,this._sdfConverter=null,this._hashToBindingInfo.clear(),this._hashToBindingInfo=null,this._ongoingRasterizations.clear(),this._ongoingRasterizations=null,this._imageRequestQueue.clear(),this._imageRequestQueue=null,this._resourceManager.destroy(),this.animationStore.destroy()}get sprites(){return this._spriteMosaic}get glyphs(){return this._glyphMosaic}get resourceManager(){return this._resourceManager}openMessagePorts(){return this._glyphMosaic.openMessagePorts()}async rasterizeItem(e,t){if(null==e)return R("mapview-null-resource","Unable to rasterize null resource"),null;if("animation-info"===e.type){const{resource:t}=e,i=this.animationStore.add(t),{location:r}=i;return{rect:new y(r.column,r.row,t.length,1),page:r.page,textureBinding:1,type:"sprite",width:t.length,height:1,rasterizationScale:1,sdfPaddingRatio:.5,samplingMode:"Linear",sdfDecodeCoeff:1,simplePattern:!1}}if("cim-rasterization-info"!==e.type)return R("mapview-unexpected-resource","Unable to rasterize resource"),null;const{resource:i}=e;if("text"===i.type){const e=await this._rasterizeText(i,t);return this._forEachGlyphItem(e,e=>this._setTextureBinding(1,e.mosaicItem)),e}const r=await this._rasterizeSprite(i,t);return r&&this._setTextureBinding(0,r),r}getBindingInfo(e,t,i){const{context:r}=e,s=this._hashToBindingInfo.get(t);if(!s)return R("mapview-texture-manager",`Could not find binding info for textureKey ${t}!`),{mosaicInfo:{size:[0,0]},mosaicTexture:null};const a=s.page,n="Nearest"===s.samplingMode?9728:i?9987:9729;let o,c,l;if(0===s.mosaicType)c=this._spriteMosaic.getTexture(e,a),l=g,o=this._spriteMosaic.getSize(a);else{if(1!==s.mosaicType)return R("mapview-texture-manager",`Cannot handle unknown type ${s.mosaicType}`),{mosaicInfo:{size:[0,0]},mosaicTexture:null};c=this._glyphMosaic.getTexture(r,a),l=d,o=[this.glyphs.width,this.glyphs.height],this._glyphMosaic.bind(r,n,a,d)}return c.setSamplingMode(n),{mosaicInfo:{size:o},mosaicTexture:{texture:c,unit:l}}}_setTextureBinding(e,t){const{sdf:i,samplingMode:r,page:s}=t,a=F(e,s,!!i,r);if(!this._hashToBindingInfo.has(a)){const i=P.fromMosaic(e,t);this._hashToBindingInfo.set(a,i)}return t.textureBinding=a,a}async _rasterizeText(e,t){return this._glyphMosaic.rasterizeText(this._baseUrl,e,t)}_forEachGlyphItem(e,t){if(e)if("glyphs"!==e.type)for(const i of e.runs)i.glyphs.glyphs.forEach(t);else e.glyphs.forEach(t)}_hashSpriteResource(e){switch(e.type){case"path":return`path:${e.path}.${e.asFill?1:0}`;case"CIMPictureMarker":return`${e.type}:${e.url}:${e.size}:${w(e.markerPlacement)}`;case"CIMPictureFill":return`${e.type}:${e.url}:${e.height}`;case"CIMPictureStroke":return`${e.type}:${e.url}:${e.width}`;case"dash":return`dash:${e.capStyle}.${m(e.dashTemplate).join("")}`;case"sdf":return`sdf:${JSON.stringify(e.geometry)}.${e.sdfTextureSize}.${e.asFill?1:0}`;case"fill-style":return`fill_style:${e.style}`;case"animated":return JSON.stringify(I(e));case"CIMGradientFill":case"CIMGradientStroke":return`gradient:${JSON.stringify(e.colorRamp)}.${e.gradientType}.${e.interval}`;case"CIMHatchFill":case"CIMVectorMarker":case"cim-point-symbol-halo":return JSON.stringify(e)}}async _rasterizeSprite(e,t){if(!e)return null;const i=c(this._hashSpriteResource(e));if(this._spriteMosaic.has(i))return this._spriteMosaic.getSpriteItem(i);if("url"in e&&e.url&&"animated"!==e.type||"CIMPictureFill"===e.type||"CIMPictureStroke"===e.type||"CIMPictureMarker"===e.type||"CIMVectorMarker"===e.type||"cim-point-symbol-halo"===e.type){const t="cim-point-symbol-halo"===e.type?e.symbol:{type:"CIMPointSymbol",symbolLayers:[e]};await h.normalizeSymbolAndFetchResources(t,this._resourceManager)}switch(e.type){case"CIMPictureMarker":return"CIMMarkerPlacementInsidePolygon"===e.markerPlacement?.type?this._rasterizeJSONResource(i,e):this._handleAsyncResource(i,e,t);case"animated":case"CIMPictureFill":case"CIMPictureStroke":case"path":return this._handleAsyncResource(i,e,t);case"CIMGradientFill":case"CIMGradientStroke":case"CIMHatchFill":case"CIMVectorMarker":case"cim-point-symbol-halo":case"dash":case"fill-style":case"sdf":return this._rasterizeJSONResource(i,e)}}_rasterizeJSONResource(e,t){const i=this._rasterizer.rasterizeJSONResource(t);if(i){const{size:r,image:s,sdf:a,simplePattern:n,rasterizationScale:o,samplingMode:c,sdfPaddingRatio:l,sdfDecodeCoeff:h}=i;return this._addItemToMosaic(e,r,{type:"static",data:s},$(t),a,n,o,c,l,h)}return null}async _handleAsyncResource(e,t,i){if(this._ongoingRasterizations.has(e))return this._ongoingRasterizations.get(e);let r;return r="path"===t.type?this._handleSVG(t,e,i):this._handleImage(t,e,i),this._ongoingRasterizations.set(e,r),r.finally(()=>this._ongoingRasterizations.delete(e)),r}async _handleSVG(e,t,i){const r=[p,p],{asFill:s}=e,a=await this._sdfConverter.draw(e.path,s,i);return this._addItemToMosaic(t,r,{type:"static",data:new Uint32Array(a.buffer)},!1,!0,!0)}_handleGIFOrPNG(e,t,i){const r=e.url,s=this.resourceManager.getResource(r);if(null==s)return null;const{width:a,height:n}=s;if(s instanceof HTMLImageElement){if("animated"===e.type)return R("mapview-unexpected-resource","Attempt to configure animations for a non-animated image."),null;const i="colorSubstitutions"in e?e.colorSubstitutions:void 0,{size:r,sdf:o,image:c}=this._rasterizer.rasterizeImageResource(a,n,s,i);return this._addItemToMosaic(t,r,{type:"static",data:c},$(e),o,!1)}let o,c,l;"animated"===e.type?(o=!1,c={type:"CIMAnimatedSymbolProperties",playAnimation:e.playAnimation,reverseAnimation:e.reverseAnimation,randomizeStartTime:e.randomizeStartTime,randomizeStartSeed:e.randomizeStartSeed,startTimeOffset:e.startTimeOffset,duration:e.duration,repeatType:e.repeatType,repeatDelay:e.repeatDelay},l=e.startGroup||0):(o=$(e),c={type:"CIMAnimatedSymbolProperties",playAnimation:!0},l=0);const h=new z(s,this._requestRender,c,l);return this._addItemToMosaic(t,[h.width,h.height],{type:"animated",data:h},o,!1,!1)}async _handleImage(e,t,r){const s=e.url;if(j(s)||v(s))return this._handleGIFOrPNG(e,t,r);if("animated"===e.type)return R("mapview-unexpected-resource","Attempt to configure animations for a non-animated image."),null;try{let i;const a=this.resourceManager.getResource(s);if(null!=a&&a instanceof HTMLImageElement)i=a;else{const{data:e}=await this._imageRequestQueue.push(s,{...r});i=e}if(S(s))if("width"in e&&"height"in e)i.width=o(e.width),i.height=o(e.height);else if("cim"in e){const t=e;i.width=o(t.width??t.scaleX*t.size),i.height=o(t.size)}if(!i.width||!i.height)return null;const n=i.width,c=i.height,l="colorSubstitutions"in e?e.colorSubstitutions:void 0,{size:h,sdf:u,image:m}=this._rasterizer.rasterizeImageResource(n,c,i,l);return this._addItemToMosaic(t,h,{type:"static",data:m},$(e),u,!1)}catch(R){if(!a(R))throw new i("mapview-invalid-resource",`Could not fetch requested resource at ${s}. ${R.message}`);throw R}}_addItemToMosaic(e,t,i,r,s,a,n,o,c,l){return this._spriteMosaic.addSpriteItem(e,t,i,r,s,a,n,o,c,l)}}function $(e){switch(e.type){case"CIMVectorMarker":case"CIMPictureMarker":return A(e);case"cim-point-symbol-halo":return!1;default:return!0}}const x=e=>null!=e&&e.startsWith("data:image/gif"),j=e=>e&&(e.includes(".gif")||x(e)),k=e=>null!=e&&e.startsWith("data:image/png"),v=e=>e&&(e.includes(".png")||k(e)),A=e=>e&&"markerPlacement"in e&&e.markerPlacement&&"CIMMarkerPlacementInsidePolygon"===e.markerPlacement.type;function F(e,t,i,r){return 1|e<<1|(i?1:0)<<2|("Nearest"===r?1:0)<<3|t<<4}export{b as TextureManager,F as hashMosaic};
2
+ import e from"../../../../config.js";import t from"../../../../request.js";import i from"../../../../core/Error.js";import r from"../../../../core/Logger.js";import{throwIfAborted as s,isAbortError as a}from"../../../../core/promiseUtils.js";import{QueueProcessor as n}from"../../../../core/QueueProcessor.js";import{pt2px as o}from"../../../../core/screenUtils.js";import{numericHash as c}from"../../../../core/string.js";import l from"../../../../symbols/cim/CIMResourceManager.js";import{CIMSymbolHelper as u}from"../../../../symbols/cim/CIMSymbolHelper.js";import{normalizeDashTemplate as m}from"../../../../symbols/cim/dashUtils.js";import h from"../../../../symbols/cim/Rasterizer.js";import{svgSdfTextureInnerSize as p,textureBindingGlyphAtlas as d,textureBindingSpriteAtlas as g}from"./definitions.js";import{GlyphMosaic as f}from"./GlyphMosaic.js";import{hashMosaic as y}from"./hashMosaic.js";import M from"./Rect.js";import _ from"./SDFConverter.js";import I from"./SpriteMosaic.js";import{discardUrlIfHasUrlHash as $}from"./urlUtils.js";import{AnimatableTextureResource as w}from"./animatedFormats/AnimatableTextureResource.js";import{AnimationStore as S}from"./animations/store/AnimationStore.js";const z=()=>r.getLogger("esri.views.MapView"),C=(e,t,r)=>z().error(new i(e,t,r));class P{static fromMosaic(e,t){return new P(e,t.page,t.sdf,t.samplingMode)}constructor(e,t,i,r){this.mosaicType=e,this.page=t,this.sdf=i,this.samplingMode=r}}class T{constructor(r){this._requestRender=r,this._resourceManager=new l,this._sdfConverter=new _(p),this._hashToBindingInfo=new Map,this._ongoingRasterizations=new Map,this._imageRequestQueue=new n({concurrency:10,process:async(e,r)=>{s(r);try{return await t(e,{responseType:"image",signal:r})}catch(n){if(!a(n))throw new i("mapview-invalid-resource",`Could not fetch requested resource at ${e}`,n);throw n}}}),this.animationStore=new S,this._spriteMosaic=new I(2048,2048,500),this._glyphMosaic=new f(1024,1024,!1,e=>this._setTextureBinding(1,e)),this._rasterizer=new h(this.resourceManager),this._baseUrl=`${e.fontsUrl}/{fontstack}/{range}.pbf`}dispose(){this._spriteMosaic.dispose(),this._glyphMosaic.dispose(),this._rasterizer.dispose(),this._sdfConverter.dispose(),this._spriteMosaic=null,this._glyphMosaic=null,this._sdfConverter=null,this._hashToBindingInfo.clear(),this._hashToBindingInfo=null,this._ongoingRasterizations.clear(),this._ongoingRasterizations=null,this._imageRequestQueue.clear(),this._imageRequestQueue=null,this._resourceManager.destroy(),this.animationStore.destroy()}get sprites(){return this._spriteMosaic}get glyphs(){return this._glyphMosaic}get resourceManager(){return this._resourceManager}openMessagePorts(){return this._glyphMosaic.openMessagePorts()}async rasterizeItem(e,t){if(null==e)return C("mapview-null-resource","Unable to rasterize null resource"),null;if("animation-info"===e.type){const{resource:t}=e,i=this.animationStore.add(t),{location:r}=i;return{rect:new M(r.column,r.row,t.length,1),page:r.page,textureBinding:1,type:"sprite",width:t.length,height:1,rasterizationScale:1,sdfPaddingRatio:.5,samplingMode:"Linear",sdfDecodeCoeff:1,simplePattern:!1}}if("cim-rasterization-info"!==e.type)return C("mapview-unexpected-resource","Unable to rasterize resource"),null;const{resource:i}=e;if("text"===i.type){const e=await this._rasterizeText(i,t);return this._forEachGlyphItem(e,e=>this._setTextureBinding(1,e.mosaicItem)),e}const r=await this._rasterizeSprite(i,t);return r&&this._setTextureBinding(0,r),r}getBindingInfo(e,t,i){const{context:r}=e,s=this._hashToBindingInfo.get(t);if(!s)return C("mapview-texture-manager",`Could not find binding info for textureKey ${t}!`),{mosaicInfo:{size:[0,0]},mosaicTexture:null};const a=s.page,n="Nearest"===s.samplingMode?9728:i?9987:9729;let o,c,l;if(0===s.mosaicType)c=this._spriteMosaic.getTexture(e,a),l=g,o=this._spriteMosaic.getSize(a);else{if(1!==s.mosaicType)return C("mapview-texture-manager",`Cannot handle unknown type ${s.mosaicType}`),{mosaicInfo:{size:[0,0]},mosaicTexture:null};c=this._glyphMosaic.getTexture(r,a),l=d,o=[this.glyphs.width,this.glyphs.height],this._glyphMosaic.bind(r,n,a,d)}return c.setSamplingMode(n),{mosaicInfo:{size:o},mosaicTexture:{texture:c,unit:l}}}_setTextureBinding(e,t){const{sdf:i,samplingMode:r,page:s}=t,a=y(e,s,!!i,r);if(!this._hashToBindingInfo.has(a)){const i=P.fromMosaic(e,t);this._hashToBindingInfo.set(a,i)}return t.textureBinding=a,a}async _rasterizeText(e,t){return this._glyphMosaic.rasterizeText(this._baseUrl,e,t)}_forEachGlyphItem(e,t){if(e)if("glyphs"!==e.type)for(const i of e.runs)i.glyphs.glyphs.forEach(t);else e.glyphs.forEach(t)}_hashSpriteResource(e){switch(e.type){case"path":return`path:${e.path}.${e.asFill?1:0}`;case"CIMPictureMarker":return`${e.type}:${e.url}:${e.size}:${k(e.markerPlacement)}`;case"CIMPictureFill":return`${e.type}:${e.url}:${e.height}`;case"CIMPictureStroke":return`${e.type}:${e.url}:${e.width}`;case"dash":return`dash:${e.capStyle}.${m(e.dashTemplate).join("")}`;case"sdf":return`sdf:${JSON.stringify(e.geometry)}.${e.sdfTextureSize}.${e.asFill?1:0}`;case"fill-style":return`fill_style:${e.style}`;case"animated":return JSON.stringify($(e));case"CIMGradientFill":case"CIMGradientStroke":return`gradient:${JSON.stringify(e.colorRamp)}.${e.gradientType}.${e.interval}`;case"CIMHatchFill":case"CIMVectorMarker":case"cim-point-symbol-halo":return JSON.stringify(e)}}async _rasterizeSprite(e,t){if(!e)return null;const i=c(this._hashSpriteResource(e));if(this._spriteMosaic.has(i))return this._spriteMosaic.getSpriteItem(i);if("url"in e&&e.url&&"animated"!==e.type||"CIMPictureFill"===e.type||"CIMPictureStroke"===e.type||"CIMPictureMarker"===e.type||"CIMVectorMarker"===e.type||"cim-point-symbol-halo"===e.type){const t="cim-point-symbol-halo"===e.type?e.symbol:{type:"CIMPointSymbol",symbolLayers:[e]};await u.normalizeSymbolAndFetchResources(t,this._resourceManager)}switch(e.type){case"CIMPictureMarker":return"CIMMarkerPlacementInsidePolygon"===e.markerPlacement?.type?this._rasterizeJSONResource(i,e):this._handleAsyncResource(i,e,t);case"animated":case"CIMPictureFill":case"CIMPictureStroke":case"path":return this._handleAsyncResource(i,e,t);case"CIMGradientFill":case"CIMGradientStroke":case"CIMHatchFill":case"CIMVectorMarker":case"cim-point-symbol-halo":case"dash":case"fill-style":case"sdf":return this._rasterizeJSONResource(i,e)}}_rasterizeJSONResource(e,t){const i=this._rasterizer.rasterizeJSONResource(t);if(i){const{size:r,image:s,sdf:a,simplePattern:n,rasterizationScale:o,samplingMode:c,sdfPaddingRatio:l,sdfDecodeCoeff:u}=i;return this._addItemToMosaic(e,r,{type:"static",data:s},b(t),a,n,o,c,l,u)}return null}async _handleAsyncResource(e,t,i){if(this._ongoingRasterizations.has(e))return this._ongoingRasterizations.get(e);let r;return r="path"===t.type?this._handleSVG(t,e,i):this._handleImage(t,e,i),this._ongoingRasterizations.set(e,r),r.finally(()=>this._ongoingRasterizations.delete(e)),r}async _handleSVG(e,t,i){const r=[p,p],{asFill:s}=e,a=await this._sdfConverter.draw(e.path,s,i);return this._addItemToMosaic(t,r,{type:"static",data:new Uint32Array(a.buffer)},!1,!0,!0)}_handleGIFOrPNG(e,t,i){const r=e.url,s=this.resourceManager.getResource(r);if(null==s)return null;const{width:a,height:n}=s;if(s instanceof HTMLImageElement){if("animated"===e.type)return C("mapview-unexpected-resource","Attempt to configure animations for a non-animated image."),null;const i="colorSubstitutions"in e?e.colorSubstitutions:void 0,{size:r,sdf:o,image:c}=this._rasterizer.rasterizeImageResource(a,n,s,i);return this._addItemToMosaic(t,r,{type:"static",data:c},b(e),o,!1)}let o,c,l;"animated"===e.type?(o=!1,c={type:"CIMAnimatedSymbolProperties",playAnimation:e.playAnimation,reverseAnimation:e.reverseAnimation,randomizeStartTime:e.randomizeStartTime,randomizeStartSeed:e.randomizeStartSeed,startTimeOffset:e.startTimeOffset,duration:e.duration,repeatType:e.repeatType,repeatDelay:e.repeatDelay},l=e.startGroup||0):(o=b(e),c={type:"CIMAnimatedSymbolProperties",playAnimation:!0},l=0);const u=new w(s,this._requestRender,c,l);return this._addItemToMosaic(t,[u.width,u.height],{type:"animated",data:u},o,!1,!1)}async _handleImage(e,t,r){const s=e.url;if(v(s)||j(s))return this._handleGIFOrPNG(e,t,r);if("animated"===e.type)return C("mapview-unexpected-resource","Attempt to configure animations for a non-animated image."),null;try{let i;const a=this.resourceManager.getResource(s);if(null!=a&&a instanceof HTMLImageElement)i=a;else{const{data:e}=await this._imageRequestQueue.push(s,{...r});i=e}if(R(s))if("width"in e&&"height"in e)i.width=o(e.width),i.height=o(e.height);else if("cim"in e){const t=e;i.width=o(t.width??t.scaleX*t.size),i.height=o(t.size)}if(!i.width||!i.height)return null;const n=i.width,c=i.height,l="colorSubstitutions"in e?e.colorSubstitutions:void 0,{size:u,sdf:m,image:h}=this._rasterizer.rasterizeImageResource(n,c,i,l);return this._addItemToMosaic(t,u,{type:"static",data:h},b(e),m,!1)}catch(C){if(!a(C))throw new i("mapview-invalid-resource",`Could not fetch requested resource at ${s}. ${C.message}`);throw C}}_addItemToMosaic(e,t,i,r,s,a,n,o,c,l){return this._spriteMosaic.addSpriteItem(e,t,i,r,s,a,n,o,c,l)}}function R(e){return e.includes("data:image/svg+xml")}function k(e){if(null==e)return"";const{type:t}=e;switch(t){case"CIMMarkerPlacementAlongLineRandomSize":return`${t}-${e.seed}-${e.randomization}`;case"CIMMarkerPlacementAlongLineVariableSize":return`${t}-${e.maxRandomOffset}-${e.numberOfSizes}-${e.seed}-${e.variationMethod}`;case"CIMMarkerPlacementAtExtremities":return`${t}-${e.extremityPlacement}-${e.offsetAlongLine}`;case"CIMMarkerPlacementAtRatioPositions":return`${t}-${e.beginPosition}-${e.endPosition}-${e.flipFirst}-${JSON.stringify(e.positionArray)}`;case"CIMMarkerPlacementAtMeasuredUnits":return`${t}-${e.interval}-${e.skipMarkerRate}-${e.placeAtExtremities}`;case"CIMMarkerPlacementInsidePolygon":return`${t}-${e.stepX}-${e.stepY}-${e.randomness}-${e.gridType}-${e.seed}-${e.shiftOddRows}`;case"CIMMarkerPlacementOnLine":return`${t}-${e.relativeTo}-${e.startPointOffset}`;case"CIMMarkerPlacementOnVertices":return`${t}-${e.placeOnControlPoints}-${e.placeOnEndPoints}-${e.placeOnRegularVertices}`;case"CIMMarkerPlacementPolygonCenter":return`${t}-${e.method}`;default:return`${t}`}}function b(e){switch(e.type){case"CIMVectorMarker":case"CIMPictureMarker":return O(e);case"cim-point-symbol-halo":return!1;default:return!0}}const x=e=>null!=e&&e.startsWith("data:image/gif"),v=e=>e&&(e.includes(".gif")||x(e)),A=e=>null!=e&&e.startsWith("data:image/png"),j=e=>e&&(e.includes(".png")||A(e)),O=e=>e&&"markerPlacement"in e&&e.markerPlacement&&"CIMMarkerPlacementInsidePolygon"===e.markerPlacement.type;export{T as TextureManager};
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ const t={width:5,height:2,left:0,top:0};export{t as decorGlyphRect};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- const t=8,e=t-2,c=1e-30,h=64,i=4294967295,o=512,a=256,d=256/360,n=128,p=16777216,r=!1,s=128,f=8,g=10,l=29,m=.25,v=4,w=10,x=1,b=16,j=16,k=o/s,q=8,u=50,y=10,z=24,A=3,B=24,C=8,D=3,E=24,F=8,G=4,H={metrics:{width:15,height:17,left:0,top:-7,advance:14}},I=1024,J=0,K=0,L=0,M=1,N=2,O=3,P=4,Q=5,R=6,S=11,T=12,U=13,V=5,W=6,X=5,Y=6,Z=6,$=1<<Z,_=$<<1,tt=!1,et=1.05,ct=3,ht=1,it=3,ot=3,at=512,dt=5,nt=6,pt=1.15,rt=2,st=4,ft=128,gt=256,lt=gt-2*st,mt=2,vt=128,wt=1,xt=8,bt=500,jt=4,kt=128,qt=1024,ut=2,yt=0,zt=1,At=4,Bt=8,Ct=16,Dt=4,Et=1,Ft=4,Gt=8,Ht=32,It=64,Jt=128,Kt=4,Lt=1,Mt=1<<20,Nt=.75,Ot=10,Pt=.75,Qt=12,Rt=256,St=32,Tt=512,Ut=0,Vt=1;export{Lt as MAX_TILE_RESHUFFLES_PER_FRAME,Ot as RESHUFFLING_EXEMPT_DRAW_CALLS,Mt as RESHUFFLING_EXEMPT_MEMORY_BYTES,Pt as RESHUFFLING_TARGET_DRAW_EFFICIENCY,Nt as RESHUFFLING_TARGET_MEMORY_EFFICIENCY,N as animationUnit,Rt as attributeStoreInitialSize,I as attributeStoreTextureSize,H as averageGlyphMosaicItem,Vt as backbufferStencilClipped,Ut as backbufferStencilVisible,Ht as bitsetFillHasPatternHeightPrecisionFactor,It as bitsetFillHasPatternWidthPrecisionFactor,Gt as bitsetFillHasUnresolvedReplacementColor,Ft as bitsetFillRandomPatternOffset,Ct as bitsetGenericConsiderAlphaOnly,ut as bitsetGenericLockColor,Dt as bitsetLineScaleDash,zt as bitsetMarkerAlignmentMap,yt as bitsetMarkerAlignmentScreen,At as bitsetMarkerOutlineAllowColorOverride,Bt as bitsetMarkerScaleSymbolsProportionally,Et as bitsetTypeFillOutline,kt as bufferDataMinimumSize,jt as bufferDataPoolSize,g as chartMaxFields,j as collisionBoxPadding,s as collisionBucketSize,b as collisionEarlyRejectBucketSize,x as collisionMaxZoomDelta,q as collisionPlacementPadding,k as collisionTileBoxSize,n as compressionFactorForU16,P as dataDrivenUnit0,Q as dataDrivenUnit1,R as dataDrivenUnit2,r as debugLabels,ft as defaultSdfTextureSize,xt as displayRecordIntPerElement,f as dotDensityMaxFields,_ as effectFlag0,tt as enableEarlyLabelDiscard,h as extrudeScale,$ as filterFlag0,M as filterFlagsUnit,z as glyphSize,T as gpgpuUnit,wt as gradientTextureExternalPadding,y as heuristicGlyphsPerFeature,u as heuristicGlyphsPerLine,at as hittestMaskTextureSize,S as hittestMaskTextureUnit,ot as hittestSmallSymbolThreshold,ht as hittestToleranceDesktop,ct as hittestToleranceMobile,it as hittestToleranceSmallSymbol,G as labelPlacementOffsetPadding,w as labelU16ZoomPrecisionFactor,U as localTimeOriginUnit,l as magicLabelLineHeight,Qt as maxGeohashLevel,rt as maxGpuUploadsPerFrame,Z as maxHighlightReasons,v as maxLineHeightRatio,p as maxRepresentableInt,Tt as maxTextLineWidth,m as minLineHeightRatio,St as minTextLineWidth,c as nanMagicNumber,d as packDegreesU8,bt as patchPixelBufferAllocSize,mt as patternFillRasterizationScale,i as pictureFillColor,qt as randomInsidePolygonTextureSize,a as rasterTileSize,vt as rasterizedVectorMarkerMinSize,D as sdfBufferGlyphSDFCreator,A as sdfBufferServer,F as sdfRadiusComplex,C as sdfRadiusSimple,E as sdfSizeComplex,B as sdfSizeSimple,st as spritePadding,lt as svgSdfTextureInnerSize,gt as svgSdfTextureSize,L as textureBindingBitmap,K as textureBindingGlyphAtlas,V as textureBindingHighlight0,W as textureBindingHighlight1,X as textureBindingRenderer0,Y as textureBindingRenderer1,J as textureBindingSpriteAtlas,Kt as textureUploadManagerBudget,Jt as textureUploadManagerChunkSize,et as thinLineHalfWidthThreshold,o as tileSize,O as visualVariableUnit,pt as vtlHighResCutoff,nt as vtlTextureBindingUnitGlyphs,dt as vtlTextureBindingUnitSprites,e as webglMaxInnerStops,t as webglMaxStops};
2
+ const t=8,e=t-2,c=1e-30,h=64,i=4294967295,o=512,a=256,d=256/360,n=128,p=16777216,r=!1,s=128,f=8,g=10,l=29,m=.25,v=4,w=10,x=1,b=16,j=16,k=o/s,q=8,u=50,y=10,z=24,A=3,B=24,C=8,D=3,E=24,F=8,G=4,H={metrics:{width:15,height:17,left:0,top:-7,advance:14}},I=1024,J=0,K=0,L=0,M=1,N=2,O=3,P=4,Q=5,R=6,S=11,T=12,U=13,V=5,W=6,X=5,Y=6,Z=6,$=Z+1,_=1<<Z,tt=1<<$,et=!1,ct=1.05,ht=3,it=1,ot=3,at=3,dt=512,nt=5,pt=6,rt=1.15,st=2,ft=4,gt=128,lt=256,mt=lt-2*ft,vt=2,wt=128,xt=1,bt=8,jt=500,kt=4,qt=128,ut=1024,yt=2,zt=0,At=1,Bt=4,Ct=8,Dt=16,Et=4,Ft=1,Gt=4,Ht=8,It=32,Jt=64,Kt=128,Lt=4,Mt=1,Nt=1<<20,Ot=.75,Pt=10,Qt=.75,Rt=12,St=256,Tt=32,Ut=512,Vt=0,Wt=1;export{Mt as MAX_TILE_RESHUFFLES_PER_FRAME,Pt as RESHUFFLING_EXEMPT_DRAW_CALLS,Nt as RESHUFFLING_EXEMPT_MEMORY_BYTES,Qt as RESHUFFLING_TARGET_DRAW_EFFICIENCY,Ot as RESHUFFLING_TARGET_MEMORY_EFFICIENCY,N as animationUnit,St as attributeStoreInitialSize,I as attributeStoreTextureSize,H as averageGlyphMosaicItem,Wt as backbufferStencilClipped,Vt as backbufferStencilVisible,It as bitsetFillHasPatternHeightPrecisionFactor,Jt as bitsetFillHasPatternWidthPrecisionFactor,Ht as bitsetFillHasUnresolvedReplacementColor,Gt as bitsetFillRandomPatternOffset,Dt as bitsetGenericConsiderAlphaOnly,yt as bitsetGenericLockColor,Et as bitsetLineScaleDash,At as bitsetMarkerAlignmentMap,zt as bitsetMarkerAlignmentScreen,Bt as bitsetMarkerOutlineAllowColorOverride,Ct as bitsetMarkerScaleSymbolsProportionally,Ft as bitsetTypeFillOutline,qt as bufferDataMinimumSize,kt as bufferDataPoolSize,g as chartMaxFields,j as collisionBoxPadding,s as collisionBucketSize,b as collisionEarlyRejectBucketSize,x as collisionMaxZoomDelta,q as collisionPlacementPadding,k as collisionTileBoxSize,n as compressionFactorForU16,P as dataDrivenUnit0,Q as dataDrivenUnit1,R as dataDrivenUnit2,r as debugLabels,gt as defaultSdfTextureSize,bt as displayRecordIntPerElement,f as dotDensityMaxFields,$ as effectBitIndex,tt as effectFlag0,et as enableEarlyLabelDiscard,h as extrudeScale,_ as filterFlag0,M as filterFlagsUnit,z as glyphSize,T as gpgpuUnit,xt as gradientTextureExternalPadding,y as heuristicGlyphsPerFeature,u as heuristicGlyphsPerLine,dt as hittestMaskTextureSize,S as hittestMaskTextureUnit,at as hittestSmallSymbolThreshold,it as hittestToleranceDesktop,ht as hittestToleranceMobile,ot as hittestToleranceSmallSymbol,G as labelPlacementOffsetPadding,w as labelU16ZoomPrecisionFactor,U as localTimeOriginUnit,l as magicLabelLineHeight,Rt as maxGeohashLevel,st as maxGpuUploadsPerFrame,Z as maxHighlightGroups,v as maxLineHeightRatio,p as maxRepresentableInt,Ut as maxTextLineWidth,m as minLineHeightRatio,Tt as minTextLineWidth,c as nanMagicNumber,d as packDegreesU8,jt as patchPixelBufferAllocSize,vt as patternFillRasterizationScale,i as pictureFillColor,ut as randomInsidePolygonTextureSize,a as rasterTileSize,wt as rasterizedVectorMarkerMinSize,D as sdfBufferGlyphSDFCreator,A as sdfBufferServer,F as sdfRadiusComplex,C as sdfRadiusSimple,E as sdfSizeComplex,B as sdfSizeSimple,ft as spritePadding,mt as svgSdfTextureInnerSize,lt as svgSdfTextureSize,L as textureBindingBitmap,K as textureBindingGlyphAtlas,V as textureBindingHighlight0,W as textureBindingHighlight1,X as textureBindingRenderer0,Y as textureBindingRenderer1,J as textureBindingSpriteAtlas,Lt as textureUploadManagerBudget,Kt as textureUploadManagerChunkSize,ct as thinLineHalfWidthThreshold,o as tileSize,O as visualVariableUnit,rt as vtlHighResCutoff,pt as vtlTextureBindingUnitGlyphs,nt as vtlTextureBindingUnitSprites,e as webglMaxInnerStops,t as webglMaxStops};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import o from"../../../../../../core/Logger.js";import{maxHighlightReasons as i}from"../../definitions.js";import{shadeTextureSize as t,sigma as e}from"./parameters.js";import l from"../../../../../support/HighlightOptions.js";import r from"../../../../../webgl/Texture.js";import{TextureDescriptor as h}from"../../../../../webgl/TextureDescriptor.js";const n=()=>o.getLogger("esri.views.2d.engine.webgl.painter.highlight.HighlightGradient");function s(o,i){i.fillColor[0]=o.color.r/255,i.fillColor[1]=o.color.g/255,i.fillColor[2]=o.color.b/255,i.fillColor[3]=o.color.a,o.haloColor?(i.outlineColor[0]=o.haloColor.r/255,i.outlineColor[1]=o.haloColor.g/255,i.outlineColor[2]=o.haloColor.b/255,i.outlineColor[3]=o.haloColor.a):(i.outlineColor[0]=i.fillColor[0],i.outlineColor[1]=i.fillColor[1],i.outlineColor[2]=i.fillColor[2],i.outlineColor[3]=i.fillColor[3]),i.fillColor[3]*=o.fillOpacity,i.outlineColor[3]*=o.haloOpacity,i.fillColor[0]*=i.fillColor[3],i.fillColor[1]*=i.fillColor[3],i.fillColor[2]*=i.fillColor[3],i.outlineColor[0]*=i.outlineColor[3],i.outlineColor[1]*=i.outlineColor[3],i.outlineColor[2]*=i.outlineColor[3],i.outlineWidth=(1-o.haloBlur)*o.haloWidth,i.outerHaloWidth=o.haloBlur*o.haloWidth/2,i.innerHaloWidth=o.haloBlur*o.haloWidth/2,i.outlinePosition=0}const a=[0,0,0,0];class u{constructor(){this.type="single",this._highlightOptions=new l,this._convertedHighlightOptions={fillColor:[0,0,0,0],outlineColor:[0,0,0,0],outlinePosition:0,outlineWidth:0,innerHaloWidth:0,outerHaloWidth:0},this._optionsShadeTexKey="",this._texelData=new Uint8Array(4*t),this._minMaxDistance=[0,0]}setHighlightOptions(o){this._highlightOptions=o}getProgramState(o){return this._updateGradientTexture(o),{minMaxDistance:this._minMaxDistance,shadeTexture:this._shadeTex}}destroy(){this._shadeTex?.dispose(),this._shadeTex=null}getReasonsWithGradients(){return[{activeReasons:(1<<i)-1,activeGradient:this}]}_updateGradientTexture(o){const i=d(this._highlightOptions);if(i===this._optionsShadeTexKey)return;this._optionsShadeTexKey=i,s(this._highlightOptions,this._convertedHighlightOptions);const l=this._convertedHighlightOptions,u=l.outlinePosition-l.outlineWidth/2-l.outerHaloWidth,g=l.outlinePosition-l.outlineWidth/2,f=l.outlinePosition+l.outlineWidth/2,C=l.outlinePosition+l.outlineWidth/2+l.innerHaloWidth,c=Math.sqrt(Math.PI/2)*e,p=Math.abs(u)>c?Math.round(10*(Math.abs(u)-c))/10:0,m=Math.abs(C)>c?Math.round(10*(Math.abs(C)-c))/10:0;let x;p&&!m?n().error("The outer rim of the highlight is "+p+"px away from the edge of the feature; consider reducing some width values or shifting the outline position towards positive values (inwards)."):!p&&m?n().error("The inner rim of the highlight is "+m+"px away from the edge of the feature; consider reducing some width values or shifting the outline position towards negative values (outwards)."):p&&m&&n().error("The highlight is "+Math.max(p,m)+"px away from the edge of the feature; consider reducing some width values.");const _=[void 0,void 0,void 0,void 0];function w(o,i,t){_[0]=(1-t)*o[0]+t*i[0],_[1]=(1-t)*o[1]+t*i[1],_[2]=(1-t)*o[2]+t*i[2],_[3]=(1-t)*o[3]+t*i[3]}const{_texelData:v}=this;for(let e=0;e<t;++e)x=u+e/(t-1)*(C-u),x<u?(_[0]=0,_[1]=0,_[2]=0,_[3]=0):x<g?w(a,l.outlineColor,(x-u)/(g-u)):x<f?[_[0],_[1],_[2],_[3]]=l.outlineColor:x<C?w(l.outlineColor,l.fillColor,(x-f)/(C-f)):[_[0],_[1],_[2],_[3]]=l.fillColor,v[4*e]=255*_[0],v[4*e+1]=255*_[1],v[4*e+2]=255*_[2],v[4*e+3]=255*_[3];if(this._minMaxDistance[0]=u,this._minMaxDistance[1]=C,!this._shadeTex){const i=new h(t,1);i.wrapMode=33071,this._shadeTex=new r(o,i)}this._shadeTex.updateData(0,0,0,t,1,this._texelData)}}function d(o){return`${o.color};${o.haloColor};${o.haloOpacity};${o.fillOpacity};${o.haloWidth};${o.haloBlur}`}export{u as default};
2
+ import o from"../../../../../../core/Logger.js";import{maxHighlightGroups as i}from"../../definitions.js";import{shadeTextureSize as t,sigma as e}from"./parameters.js";import l from"../../../../../support/HighlightOptions.js";import r from"../../../../../webgl/Texture.js";import{TextureDescriptor as h}from"../../../../../webgl/TextureDescriptor.js";const n=()=>o.getLogger("esri.views.2d.engine.webgl.painter.highlight.HighlightGradient");function s(o,i){i.fillColor[0]=o.color.r/255,i.fillColor[1]=o.color.g/255,i.fillColor[2]=o.color.b/255,i.fillColor[3]=o.color.a,o.haloColor?(i.outlineColor[0]=o.haloColor.r/255,i.outlineColor[1]=o.haloColor.g/255,i.outlineColor[2]=o.haloColor.b/255,i.outlineColor[3]=o.haloColor.a):(i.outlineColor[0]=i.fillColor[0],i.outlineColor[1]=i.fillColor[1],i.outlineColor[2]=i.fillColor[2],i.outlineColor[3]=i.fillColor[3]),i.fillColor[3]*=o.fillOpacity,i.outlineColor[3]*=o.haloOpacity,i.fillColor[0]*=i.fillColor[3],i.fillColor[1]*=i.fillColor[3],i.fillColor[2]*=i.fillColor[3],i.outlineColor[0]*=i.outlineColor[3],i.outlineColor[1]*=i.outlineColor[3],i.outlineColor[2]*=i.outlineColor[3],i.outlineWidth=(1-o.haloBlur)*o.haloWidth,i.outerHaloWidth=o.haloBlur*o.haloWidth/2,i.innerHaloWidth=o.haloBlur*o.haloWidth/2,i.outlinePosition=0}const a=[0,0,0,0];class u{constructor(){this.type="single",this._highlightOptions=new l,this._convertedHighlightOptions={fillColor:[0,0,0,0],outlineColor:[0,0,0,0],outlinePosition:0,outlineWidth:0,innerHaloWidth:0,outerHaloWidth:0},this._optionsShadeTexKey="",this._texelData=new Uint8Array(4*t),this._minMaxDistance=[0,0]}setHighlightOptions(o){this._highlightOptions=o}getProgramState(o){return this._updateGradientTexture(o),{minMaxDistance:this._minMaxDistance,shadeTexture:this._shadeTex}}destroy(){this._shadeTex?.dispose(),this._shadeTex=null}getGroupsWithGradients(){return[{activeGroups:(1<<i)-1,activeGradient:this}]}_updateGradientTexture(o){const i=d(this._highlightOptions);if(i===this._optionsShadeTexKey)return;this._optionsShadeTexKey=i,s(this._highlightOptions,this._convertedHighlightOptions);const l=this._convertedHighlightOptions,u=l.outlinePosition-l.outlineWidth/2-l.outerHaloWidth,g=l.outlinePosition-l.outlineWidth/2,f=l.outlinePosition+l.outlineWidth/2,C=l.outlinePosition+l.outlineWidth/2+l.innerHaloWidth,p=Math.sqrt(Math.PI/2)*e,c=Math.abs(u)>p?Math.round(10*(Math.abs(u)-p))/10:0,m=Math.abs(C)>p?Math.round(10*(Math.abs(C)-p))/10:0;let x;c&&!m?n().error("The outer rim of the highlight is "+c+"px away from the edge of the feature; consider reducing some width values or shifting the outline position towards positive values (inwards)."):!c&&m?n().error("The inner rim of the highlight is "+m+"px away from the edge of the feature; consider reducing some width values or shifting the outline position towards negative values (outwards)."):c&&m&&n().error("The highlight is "+Math.max(c,m)+"px away from the edge of the feature; consider reducing some width values.");const _=[void 0,void 0,void 0,void 0];function w(o,i,t){_[0]=(1-t)*o[0]+t*i[0],_[1]=(1-t)*o[1]+t*i[1],_[2]=(1-t)*o[2]+t*i[2],_[3]=(1-t)*o[3]+t*i[3]}const{_texelData:v}=this;for(let e=0;e<t;++e)x=u+e/(t-1)*(C-u),x<u?(_[0]=0,_[1]=0,_[2]=0,_[3]=0):x<g?w(a,l.outlineColor,(x-u)/(g-u)):x<f?[_[0],_[1],_[2],_[3]]=l.outlineColor:x<C?w(l.outlineColor,l.fillColor,(x-f)/(C-f)):[_[0],_[1],_[2],_[3]]=l.fillColor,v[4*e]=255*_[0],v[4*e+1]=255*_[1],v[4*e+2]=255*_[2],v[4*e+3]=255*_[3];if(this._minMaxDistance[0]=u,this._minMaxDistance[1]=C,!this._shadeTex){const i=new h(t,1);i.wrapMode=33071,this._shadeTex=new r(o,i)}this._shadeTex.updateData(0,0,0,t,1,this._texelData)}}function d(o){return`${o.color};${o.haloColor};${o.haloOpacity};${o.fillOpacity};${o.haloWidth};${o.haloBlur}`}export{u as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import t from"./HighlightGradient.js";class s{constructor(){this.type="multi",this.gradients=[]}setHighlightOptions(s){for(let e=0;e<s.length;e++)this.gradients[e]||(this.gradients[e]=new t),this.gradients[e].setHighlightOptions(s[e]);for(let t=s.length+1;t<this.gradients.length;t++)this.gradients[t].destroy();this.gradients.length=s.length}destroy(){for(const t of this.gradients)t.destroy()}getReasonsWithGradients(){let t=1;const s=[];for(let e=0;e<this.gradients.length;e++){const i=this.gradients[e];s.push({activeReasons:t,activeGradient:i}),t<<=1}return s}}export{s as MultiHighlightGradient};
2
+ import t from"./HighlightGradient.js";class s{constructor(){this.type="multi",this.gradients=[]}setHighlightOptions(s){for(let i=0;i<s.length;i++)this.gradients[i]||(this.gradients[i]=new t),this.gradients[i].setHighlightOptions(s[i]);for(let t=s.length+1;t<this.gradients.length;t++)this.gradients[t].destroy();this.gradients.length=s.length}destroy(){for(const t of this.gradients)t.destroy()}getGroupsWithGradients(){let t=1;const s=[];for(let i=0;i<this.gradients.length;i++){const e=this.gradients[i];s.push({activeGroups:t,activeGradient:e}),t<<=1}return s}}export{s as MultiHighlightGradient};
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ function e(e,r,t,n){return 1|e<<1|(t?1:0)<<2|("Nearest"===n?1:0)<<3|r<<4}export{e as hashMosaic};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{maxRepresentableInt as t,hittestMaskTextureUnit as e,tileSize as n}from"../../definitions.js";const i={color:{write:[!0,!0,!0,!0],blendMode:"composite"},depth:!1,stencil:{write:!1,test:{compare:514,mask:255,op:{fail:7680,zFail:7680,zPass:7681}}}},s={color:{write:[!0,!0,!0,!0],blendParameters:{srcRGB:1,dstRGB:1,srcAlpha:1,dstAlpha:1},blendEquation:32776,blendMode:"custom"},depth:!1,stencil:!1},o={...i,color:{write:[!0,!0,!0,!0],blendMode:"delete"}};function r(t){return"highlight"===t.passOptions?.type}function l(t){return"hittest"===t.passOptions?.type}function c(t){if(!l(t))return null;const{target:e,distance:n,smallSymbolDistance:i,smallSymbolSizeThreshold:s,hittestType:o}=t.passOptions,r=[e[0],e[1]],c=4===e.length?e:[-1,-1,-1,-1],u="point"===o?0:"rect"===o?1:2;return{position:r,distance:n,smallSymbolDistance:i,smallSymbolSizeThreshold:s,viewSize:t.state.size,rect:c,hittestType:u}}function u(t){if(!r(t))return null;const{activeReasons:e,highlightAll:n}=t.passOptions;return{activeReasons:e,highlightAll:n?1:0}}function a(t,e,n){const i={};for(const s in n)"function"!=typeof n[s]?i[s]=n[s]:i[s]=n[s](t,e);return i}function p(t){return{storage:t.attributeView.getUniforms(),hittestRequest:c(t),highlight:u(t)}}function h(t){if(!l(t)||"polygon"!==t.passOptions.hittestType)return null;const n=t.painter.effects.hittest.getHittestMaskTexture();return n?{texture:n,unit:e}:null}function f(t){return t.attributeView.getTextures(t.context)}function d(t){return{storageTextures:f(t),hittestMaskTexture:h(t)}}function g(t){return{inside:2===t.selection,outside:3===t.selection}}function m(t){return l(t)?s:r(t)&&"clear"===t.passOptions.stepType?o:i}function y(e){const{row:i,col:s}=e.key,o=s*n,r=i*n;return{tileOffsetFromLocalOrigin:[o%t,r%t],maxIntsToLocalOrigin:[Math.floor(o/t),Math.floor(r/t)]}}export{h as getFeatureHittestTexture,m as getFeaturePipelineState,f as getFeatureStorageTextures,d as getFeatureTextures,p as getFeatureUniforms,y as getLocalTileOffset,g as getSelectionDefines,r as isHighlight,l as isHittest,a as resolveDynamicUniforms};
2
+ import{maxRepresentableInt as t,hittestMaskTextureUnit as e,tileSize as n}from"../../definitions.js";const i={color:{write:[!0,!0,!0,!0],blendMode:"composite"},depth:!1,stencil:{write:!1,test:{compare:514,mask:255,op:{fail:7680,zFail:7680,zPass:7681}}}},s={color:{write:[!0,!0,!0,!0],blendParameters:{srcRGB:1,dstRGB:1,srcAlpha:1,dstAlpha:1},blendEquation:32776,blendMode:"custom"},depth:!1,stencil:!1},o={...i,color:{write:[!0,!0,!0,!0],blendMode:"delete"}};function r(t){return"highlight"===t.passOptions?.type}function l(t){return"hittest"===t.passOptions?.type}function c(t){if(!l(t))return null;const{target:e,distance:n,smallSymbolDistance:i,smallSymbolSizeThreshold:s,hittestType:o}=t.passOptions,r=[e[0],e[1]],c=4===e.length?e:[-1,-1,-1,-1],u="point"===o?0:"rect"===o?1:2;return{position:r,distance:n,smallSymbolDistance:i,smallSymbolSizeThreshold:s,viewSize:t.state.size,rect:c,hittestType:u}}function u(t){if(!r(t))return null;const{activeGroups:e,highlightAll:n}=t.passOptions;return{activeGroups:e,highlightAll:n?1:0}}function a(t,e,n){const i={};for(const s in n)"function"!=typeof n[s]?i[s]=n[s]:i[s]=n[s](t,e);return i}function p(t){return{storage:t.attributeView.getUniforms(),hittestRequest:c(t),highlight:u(t)}}function h(t){if(!l(t)||"polygon"!==t.passOptions.hittestType)return null;const n=t.painter.effects.hittest.getHittestMaskTexture();return n?{texture:n,unit:e}:null}function f(t){return t.attributeView.getTextures(t.context)}function d(t){return{storageTextures:f(t),hittestMaskTexture:h(t)}}function g(t){return{inside:2===t.selection,outside:3===t.selection}}function m(t){return l(t)?s:r(t)&&"clear"===t.passOptions.stepType?o:i}function y(e){const{row:i,col:s}=e.key,o=s*n,r=i*n;return{tileOffsetFromLocalOrigin:[o%t,r%t],maxIntsToLocalOrigin:[Math.floor(o/t),Math.floor(r/t)]}}export{h as getFeatureHittestTexture,m as getFeaturePipelineState,f as getFeatureStorageTextures,d as getFeatureTextures,p as getFeatureUniforms,y as getLocalTileOffset,g as getSelectionDefines,r as isHighlight,l as isHittest,a as resolveDynamicUniforms};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as t}from"tslib";import{maxHighlightReasons as e}from"../../../definitions.js";import{location as i,define as o,option as r,uniform as s,texture as l,VertexInput as a,ComputeVertexInput as h,GraphShaderModule as n,FragmentOutput as g,FragmentInput as u}from"../../GraphShaderModule.js";import{Vec3 as p,Float as d,Vec2 as m,Sampler2D as c,float as y,step as w,Vec4 as b,equal as f,ifElse as x,or as v}from"../../graph/glsl.js";import{trueHit as T,candidateHit as V,noHit as C}from"./constants.js";import{EntityStorage as H,EntityStorageTextures as D}from"./EntityStorage.js";import{ShaderHighlight as j}from"./ShaderHighlight.js";import{ShaderHittest as A}from"./ShaderHittest.js";import{Tile as _}from"./Tile.js";import{TileInfo as R}from"./TileInfo.js";import{getFilterBit as S,getHighlightBit as F,getBit as k,uvToClip as P}from"./utils.js";import{ViewInfo as I}from"./ViewInfo.js";class O extends a{}t([i(0,p)],O.prototype,"id",void 0),t([i(1,d)],O.prototype,"bitset",void 0),t([i(2,m)],O.prototype,"pos",void 0);class z extends h{}t([i(14,m)],z.prototype,"nextPos1",void 0),t([i(15,m)],z.prototype,"nextPos2",void 0);class q extends u{}class B extends n{clip(t,e){let i=new d(0);const o=this.getFilterFlags(t);if(i=i.add(y(2).multiply(y(1).subtract(S(o,0)))),this.inside?i=i.add(y(2).multiply(y(1).subtract(S(o,1)))):this.outside?i=i.add(y(2).multiply(S(o,1))):this.highlight&&(i=i.add(y(2).multiply(y(1).subtract(this._checkHighlight(o))))),null!=e){const t=new d(1).subtract(w(e.x,this.tileInfo.currentZoom)),o=w(e.y,this.tileInfo.currentZoom);i=i.add(new d(2).multiply(t.add(o)))}return i}getFragmentOutput(t,e,i=new d(1/255)){const o=new g;return o.fragColor=this._maybeWriteHittest(e)??this._maybeHighlight(t,i)??t,o}_maybeHighlight(t,e){return this.highlight?new b(t.rgb,w(e,t.a)):null}_checkHighlight(t){let i=this._checkHighlightBit(t,0);for(let o=1;o<e;o++)i=i.add(this._checkHighlightBit(t,o));return w(new d(.1),i.add(this.highlight.highlightAll))}_checkHighlightBit(t,e){return F(t,e).multiply(k(this.highlight.activeReasons,e))}computeHittestTriangle(t,e,i){const o=this.tile.getViewScreenMat3(this.view),{nextPos1:r,nextPos2:s}=e;return{pos0:o.multiply(new p(t.pos,1)).xy,pos1:o.multiply(new p(r,1)).xy,pos2:o.multiply(new p(s,1)).xy}}maybeRunHittest(t,e,i){if(null==this.hittestRequest)return null;const o=this.hittest(t,e,i),r=f(o,new d(T)),s=f(o,new d(V)),l=x(s,()=>new b(new d(1/255),0,0,0),x(r,()=>new b(new d(2/255),0,0,0),new b(C)));let a=x(v(r,s),new d(0),new d(2));const h=this.getAttributeDataCoords(t.id),n=P(h);return a=a.add(this.clip(t.id,t.zoomRange)),{glPointSize:new d(1),glPosition:new b(n,a,1),color:l}}_maybeWriteHittest(t){return null!=this.hittestRequest?t.color:null}getAttributeDataCoords(t){return this.storage.getAttributeDataCoords(t)}getVVData(t){return this.storageTextures.getVVData(this.getAttributeDataCoords(t))}getFilterFlags(t){return this.storageTextures.getFilterFlags(this.getAttributeDataCoords(t))}getLocalTimeOrigin(t){return this.storageTextures.getLocalTimeOrigin(this.getAttributeDataCoords(t))}getSizeValue(t){return this.storageTextures.getSizeValue(this.getAttributeDataCoords(t))}getColorValue(t){return this.storageTextures.getColorValue(this.getAttributeDataCoords(t))}getOpacityValue(t){return this.storageTextures.getOpacityValue(this.getAttributeDataCoords(t))}getRotationValue(t){return this.storageTextures.getRotationValue(this.getAttributeDataCoords(t))}}t([o],B.prototype,"inside",void 0),t([o],B.prototype,"outside",void 0),t([r(j)],B.prototype,"highlight",void 0),t([s(H)],B.prototype,"storage",void 0),t([l(D)],B.prototype,"storageTextures",void 0),t([l(c)],B.prototype,"hittestMaskTexture",void 0),t([s(I)],B.prototype,"view",void 0),t([s(R)],B.prototype,"tileInfo",void 0),t([s(_)],B.prototype,"tile",void 0),t([r(A)],B.prototype,"hittestRequest",void 0);export{B as AFeatureShader,z as BaseHittestVertexInput,q as FeatureFragmentInput,O as FeatureVertexInput};
2
+ import{__decorate as t}from"tslib";import{maxHighlightGroups as e}from"../../../definitions.js";import{location as i,define as o,option as r,uniform as s,texture as l,VertexInput as a,ComputeVertexInput as h,GraphShaderModule as n,FragmentOutput as g,FragmentInput as u}from"../../GraphShaderModule.js";import{Vec3 as p,Float as d,Vec2 as m,Sampler2D as c,float as y,step as w,Vec4 as b,equal as f,ifElse as x,or as v}from"../../graph/glsl.js";import{trueHit as T,candidateHit as V,noHit as C}from"./constants.js";import{EntityStorage as H,EntityStorageTextures as D}from"./EntityStorage.js";import{ShaderHighlight as j}from"./ShaderHighlight.js";import{ShaderHittest as A}from"./ShaderHittest.js";import{Tile as _}from"./Tile.js";import{TileInfo as S}from"./TileInfo.js";import{getFilterBit as F,getHighlightBit as R,getBit as k,uvToClip as P}from"./utils.js";import{ViewInfo as I}from"./ViewInfo.js";class O extends a{}t([i(0,p)],O.prototype,"id",void 0),t([i(1,d)],O.prototype,"bitset",void 0),t([i(2,m)],O.prototype,"pos",void 0);class z extends h{}t([i(14,m)],z.prototype,"nextPos1",void 0),t([i(15,m)],z.prototype,"nextPos2",void 0);class q extends u{}class B extends n{clip(t,e){let i=new d(0);const o=this.getFilterFlags(t);if(i=i.add(y(2).multiply(y(1).subtract(F(o,0)))),this.inside?i=i.add(y(2).multiply(y(1).subtract(F(o,1)))):this.outside?i=i.add(y(2).multiply(F(o,1))):this.highlight&&(i=i.add(y(2).multiply(y(1).subtract(this._checkHighlight(o))))),null!=e){const t=new d(1).subtract(w(e.x,this.tileInfo.currentZoom)),o=w(e.y,this.tileInfo.currentZoom);i=i.add(new d(2).multiply(t.add(o)))}return i}getFragmentOutput(t,e,i=new d(1/255)){const o=new g;return o.fragColor=this._maybeWriteHittest(e)??this._maybeHighlight(t,i)??t,o}_maybeHighlight(t,e){return this.highlight?new b(t.rgb,w(e,t.a)):null}_checkHighlight(t){let i=this._checkHighlightBit(t,0);for(let o=1;o<e;o++)i=i.add(this._checkHighlightBit(t,o));return w(new d(.1),i.add(this.highlight.highlightAll))}_checkHighlightBit(t,e){return R(t,e).multiply(k(this.highlight.activeGroups,e))}computeHittestTriangle(t,e,i){const o=this.tile.getViewScreenMat3(this.view),{nextPos1:r,nextPos2:s}=e;return{pos0:o.multiply(new p(t.pos,1)).xy,pos1:o.multiply(new p(r,1)).xy,pos2:o.multiply(new p(s,1)).xy}}maybeRunHittest(t,e,i){if(null==this.hittestRequest)return null;const o=this.hittest(t,e,i),r=f(o,new d(T)),s=f(o,new d(V)),l=x(s,()=>new b(new d(1/255),0,0,0),x(r,()=>new b(new d(2/255),0,0,0),new b(C)));let a=x(v(r,s),new d(0),new d(2));const h=this.getAttributeDataCoords(t.id),n=P(h);return a=a.add(this.clip(t.id,t.zoomRange)),{glPointSize:new d(1),glPosition:new b(n,a,1),color:l}}_maybeWriteHittest(t){return null!=this.hittestRequest?t.color:null}getAttributeDataCoords(t){return this.storage.getAttributeDataCoords(t)}getVVData(t){return this.storageTextures.getVVData(this.getAttributeDataCoords(t))}getFilterFlags(t){return this.storageTextures.getFilterFlags(this.getAttributeDataCoords(t))}getLocalTimeOrigin(t){return this.storageTextures.getLocalTimeOrigin(this.getAttributeDataCoords(t))}getSizeValue(t){return this.storageTextures.getSizeValue(this.getAttributeDataCoords(t))}getColorValue(t){return this.storageTextures.getColorValue(this.getAttributeDataCoords(t))}getOpacityValue(t){return this.storageTextures.getOpacityValue(this.getAttributeDataCoords(t))}getRotationValue(t){return this.storageTextures.getRotationValue(this.getAttributeDataCoords(t))}}t([o],B.prototype,"inside",void 0),t([o],B.prototype,"outside",void 0),t([r(j)],B.prototype,"highlight",void 0),t([s(H)],B.prototype,"storage",void 0),t([l(D)],B.prototype,"storageTextures",void 0),t([l(c)],B.prototype,"hittestMaskTexture",void 0),t([s(I)],B.prototype,"view",void 0),t([s(S)],B.prototype,"tileInfo",void 0),t([s(_)],B.prototype,"tile",void 0),t([r(A)],B.prototype,"hittestRequest",void 0);export{B as AFeatureShader,z as BaseHittestVertexInput,q as FeatureFragmentInput,O as FeatureVertexInput};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as o}from"tslib";import{uniform as r,UniformGroup as t}from"../../GraphShaderModule.js";import{Float as p}from"../../graph/glsl.js";class e extends t{}o([r(p)],e.prototype,"activeReasons",void 0),o([r(p)],e.prototype,"highlightAll",void 0);export{e as ShaderHighlight};
2
+ import{__decorate as o}from"tslib";import{uniform as r,UniformGroup as t}from"../../GraphShaderModule.js";import{Float as p}from"../../graph/glsl.js";class i extends t{}o([r(p)],i.prototype,"activeGroups",void 0),o([r(p)],i.prototype,"highlightAll",void 0);export{i as ShaderHighlight};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{maxHighlightReasons as t}from"../../../definitions.js";import{Float as n,float as r,vec3 as u,mod as c,floor as i,equal as o,vec4 as e,dot as f,vec2 as s,fract as l,sin as a,greaterThan as m,max as p,Vec4 as b,divide as d}from"../../graph/glsl.js";import{nanMagicNumber as y}from"./constants.js";function w(t){const n=r(12.9898),u=r(78.233),i=r(43758.5453),o=f(t,s(n,u)),e=c(o,r(3.14));return l(a(e).multiply(i))}function x(t){return o(t,r(y))}function j(t){return d(t,r(255))}function z(t,n){return t.x.multiply(n.y).subtract(n.x.multiply(t.y))}function g(t){return t.multiply(2).subtract(1)}function v(t){return t.multiply(.5).add(.5)}function h(t,n){const u=r(2**n);return c(i(t.divide(u)),r(2))}function k(t,n){return m(h(t,n),r(.5))}function q(n,r){return h(n,r+t)}function A(t,n){return h(t,n)}function B(t){const n=h(t.z,7),c=r(1).subtract(n),i=t.xyz.subtract(u(0,0,r(128)));return c.multiply(t).add(n.multiply(i))}function C(t){const n=e(255/256,255/65536,255/16777216,255/4294967296);return f(t,n)}function D(t){return p(p(p(t.x,t.y),t.z),t.w)}function E(t){return new n(1).subtract(t)}function F(t){return t.subtract(new n(1))}function G(t){return new n(1).divide(t)}function H(t,r){return new n(t).subtract(r)}function I(t,r){return t.subtract(new n(r))}function J(t,n,r,u){let c=new b(0);const i=new b(0);return c=K(c,t,i),c=K(c,n,i),c=K(c,r,i),c=K(c,u,i),c}function K(t,n,r){const u=n.subtract(r),c=t.add(u);return r=c.subtract(t).subtract(u),c}export{v as clipToUv,z as cross2,h as getBit,k as getBitBool,q as getFilterBit,A as getHighlightBit,x as isNan,K as kahanSummation,D as max4,F as minusOne,I as minusScalar,j as norm,E as oneMinus,G as oneOver,w as rand,C as rgba2float,H as scalarMinus,J as sum4,B as unpackDisplayIdTexel,g as uvToClip};
2
+ import{maxHighlightGroups as t}from"../../../definitions.js";import{Float as n,float as r,vec3 as u,mod as c,floor as i,equal as o,vec4 as e,dot as f,vec2 as s,fract as l,sin as a,greaterThan as m,max as p,Vec4 as b,divide as d}from"../../graph/glsl.js";import{nanMagicNumber as y}from"./constants.js";function w(t){const n=r(12.9898),u=r(78.233),i=r(43758.5453),o=f(t,s(n,u)),e=c(o,r(3.14));return l(a(e).multiply(i))}function x(t){return o(t,r(y))}function j(t){return d(t,r(255))}function z(t,n){return t.x.multiply(n.y).subtract(n.x.multiply(t.y))}function g(t){return t.multiply(2).subtract(1)}function v(t){return t.multiply(.5).add(.5)}function h(t,n){const u=r(2**n);return c(i(t.divide(u)),r(2))}function k(t,n){return m(h(t,n),r(.5))}function q(n,r){return h(n,r+t)}function A(t,n){return h(t,n)}function B(t){const n=h(t.z,7),c=r(1).subtract(n),i=t.xyz.subtract(u(0,0,r(128)));return c.multiply(t).add(n.multiply(i))}function C(t){const n=e(255/256,255/65536,255/16777216,255/4294967296);return f(t,n)}function D(t){return p(p(p(t.x,t.y),t.z),t.w)}function E(t){return new n(1).subtract(t)}function F(t){return t.subtract(new n(1))}function G(t){return new n(1).divide(t)}function H(t,r){return new n(t).subtract(r)}function I(t,r){return t.subtract(new n(r))}function J(t,n,r,u){let c=new b(0);const i=new b(0);return c=K(c,t,i),c=K(c,n,i),c=K(c,r,i),c=K(c,u,i),c}function K(t,n,r){const u=n.subtract(r),c=t.add(u);return r=c.subtract(t).subtract(u),c}export{v as clipToUv,z as cross2,h as getBit,k as getBitBool,q as getFilterBit,A as getHighlightBit,x as isNan,K as kahanSummation,D as max4,F as minusOne,I as minusScalar,j as norm,E as oneMinus,G as oneOver,w as rand,C as rgba2float,H as scalarMinus,J as sum4,B as unpackDisplayIdTexel,g as uvToClip};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../AggregateGraphic.js";import r from"../../../Graphic.js";import s from"../../../TrackGraphic.js";import{isSome as i}from"../../../core/arrayUtils.js";import a from"../../../core/Collection.js";import o from"../../../core/Error.js";import{makeHandle as n,handlesGroup as l}from"../../../core/handleUtils.js";import has from"../../../core/has.js";import u from"../../../core/Logger.js";import{destroyMaybe as h}from"../../../core/maybe.js";import{notDeepEqual as c}from"../../../core/object.js";import{createAbortError as p,ignoreAbortErrors as d,throwIfNotAbortError as y,isAbortError as m}from"../../../core/promiseUtils.js";import{watch as g,sync as f}from"../../../core/reactiveUtils.js";import{sqlAnd as w}from"../../../core/sql.js";import{getMetersPerUnitForSR as v}from"../../../core/units.js";import{property as _,subclass as b}from"../../../core/accessorSupport/decorators.js";import{UpdatingHandles as S}from"../../../core/support/UpdatingHandles.js";import A from"../../../geometry/Extent.js";import{fromJSON as F}from"../../../geometry/support/jsonUtils.js";import j from"../../../geometry/support/rotate.js";import{isCurvedGeometry as x}from"../../../geometry/support/curves/curveUtils.js";import{densifyCurvedGeometry as R}from"../../../geometry/support/curves/densifyCurvedGeometry.js";import E from"../../../layers/effects/FeatureEffectView.js";import{convertFromFeature as I}from"../../../layers/graphics/featureConversionUtils.js";import k from"../../../layers/support/FeatureFilter.js";import{checkServiceCurrentUserSupport as O}from"../../../layers/support/featureLayerUtils.js";import{packFields as U}from"../../../layers/support/fieldUtils.js";import{getEffectiveLayerCapabilities as V}from"../../../layers/support/layerUtils.js";import{combineTimeExtent as C}from"../../../layers/support/timeSupport.js";import Q from"../../../rest/support/AggregateFeatureSet.js";import q from"../../../rest/support/AttributeBinsFeatureSet.js";import M from"../../../rest/support/AttributeBinsQuery.js";import P from"../../../rest/support/FeatureSet.js";import H from"../../../rest/support/Query.js";import{HittestDrawHelper as L}from"../../../symbols/cim/CIMSymbolDrawHelper.js";import{symbolToCIM as T}from"../../../symbols/cim/CIMSymbolHelper.js";import{getDisplayedSymbol as W}from"../../../symbols/support/symbolUtils.js";import{LayerView2D as D}from"./LayerView2D.js";import{FeatureContainer as G}from"./features/FeatureContainer.js";import{createFeaturePipelineWorkerProxy as N}from"./features/FeaturePipelineWorkerProxy.js";import{FeatureSourceEventLog as J}from"./features/FeatureSourceEventLog.js";import{AnnotationLayerAdapter as z}from"./features/layerAdapters/AnnotationLayerAdapter.js";import{CatalogFootprintLayerAdapter as B}from"./features/layerAdapters/CatalogFootprintLayerAdapter.js";import{DimensionLayerAdapter as Z}from"./features/layerAdapters/DimensionLayerAdapter.js";import{FeatureLayerAdapter as K}from"./features/layerAdapters/FeatureLayerAdapter.js";import{createFeatureIdInfo as $}from"./features/layerAdapters/featureServiceUtils.js";import{InMemoryLayerAdapter as X}from"./features/layerAdapters/InMemoryLayerAdapter.js";import{KnowledgeGraphSublayerAdapter as Y}from"./features/layerAdapters/KnowledgeGraphSublayerAdapter.js";import{OGCFeatureLayerAdapter as ee}from"./features/layerAdapters/OGCFeatureLayerAdapter.js";import{OrientedImageryLayerAdapter as te}from"./features/layerAdapters/OrientedImageryLayerAdapter.js";import{ParquetLayerAdapter as re}from"./features/layerAdapters/ParquetLayerAdapter.js";import{StreamLayerAdapter as se}from"./features/layerAdapters/StreamLayerAdapter.js";import{SubtypeGroupLayerAdapter as ie}from"./features/layerAdapters/SubtypeGroupLayerAdapter.js";import{createComplexSymbolInstances as ae}from"./features/schema/processor/symbols/ComplexSymbolSchema.js";import{DebouncedFeatureOverride as oe}from"./support/DebouncedFeatureOverride.js";import{FeatureCommandQueue as ne}from"./support/FeatureCommandQueue.js";import{handleNoEngineError as le}from"./support/handleNoEngineError.js";import{toJSONGeometryType as ue}from"./support/util.js";import{getMapPointsFromScreen as he,getHittestType as ce}from"../support/hitTestUtils.js";import{FeatureTileSubscriptionManager as pe}from"../tiling/FeatureTileSubscriptionManager.js";import{RefreshableLayerView as de}from"../../layers/RefreshableLayerView.js";import{getHighlightName as ye}from"../../support/highlightOptionsUtils.js";function me(e,t){const r=new Set;return e&&e.forEach(e=>r.add(e)),t&&t.forEach(e=>r.add(e)),r.has("*")?["*"]:Array.from(r)}const ge=4294967294;function fe(e,t){return l(e.map(e=>g(()=>{const t=e();return t&&"object"==typeof t?"getTime"in t&&"function"==typeof t.getTime?t.getTime():JSON.stringify(t):t},t,f)))}function we(e){if(!e.geometry)return e;if(!x(e.geometry))return e;const t=.001/v(e.geometry.spatialReference),r=100;return{geometry:R(e.geometry,{maxSegmentsPerCurve:12e3,maxSegmentLength:r*t,maxDeviation:0}),attributes:e.attributes}}const ve=l=>{const f=de(D(l));let v=class extends f{constructor(){super(...arguments),this._commandsQueue=new ne({process:e=>{switch(e.type){case"override-batch":return this._doOverride(e);case"update":return this._doUpdate();case"highlight":return this._updateHighlights()}}}),this._visibilityOverrides=new Set,this._lastAvailableFields=[],this._lastTargetState=null,this._stationaryRotation=0,this.eventLog=new J,this._sourceRefreshVersion=1,this._displayRefreshVersion=1,this._pipelineUpdating=!1,this._editUpdatingHandles=new S,this._fields=null,this._hittestDrawHelper=null,this._sourceUpdating=!1,this.featureEffectView=new E}destroy(){this._editUpdatingHandles.destroy(),this._workerProxy?.destroy(),this._workerAttached.reject(p()),this._commandsQueue.destroy(),this._hittestDrawHelper?.destroy()}initialize(){this._workerAttached=Promise.withResolvers(),d(this._workerAttached.promise),this.addResolvingPromise(this._initProxy()),this.featureEffectView.featureEffect=this.featureEffect,this.featureEffectView.endTransition()}async _initProxy(){const e=this.layer;if("isTable"in e&&e.isTable)throw new o("featurelayerview:table-not-supported","table feature layer can't be displayed",{layer:e});if(("feature"===e.type||"subtype-group"===e.type)&&!1===V(e)?.operations.supportsQuery)throw new o("featurelayerview:query-not-supported","layer view requires a layer with query capability",{layer:e});this._workerProxy&&this._workerProxy.destroy();const t=this._createClientOptions();this._workerProxy=await N(t)}async _attachProxy(){const e=j(this.view.extent,this.view.rotation,this.view.center),t={tileInfoJSON:this.view?.featuresTilingScheme?.tileInfo?.toJSON(),initialViewExtent:e.toJSON()};try{await this._workerProxy.pipeline.onAttach(t),this._workerAttached.resolve()}catch(r){this._workerAttached.reject(p()),y(r)}}async _detachProxy(){return this._workerProxy.pipeline.onDetach()}async getWorker(){return await this._workerAttached.promise,this._workerProxy}get dataUpdating(){return this._sourceUpdating||this._editUpdatingHandles.updating}get hasAllFeatures(){return this.layer.visible&&!this.suspended&&this.eventLog.hasAllData&&this.eventLog.willQueryAllFeatures}get hasAllFeaturesInView(){const e=this.effectiveDisplayFilter?.where||null,t=!this.eventLog.willQueryAllFeatures&&null!=e&&"1=1"!==e;return this.layer.visible&&!this.suspended&&this.eventLog.hasAllData&&!t}get hasFullGeometries(){return this.layer.visible&&!this.suspended&&this.eventLog.hasAllData&&this.eventLog.willQueryFullResolutionGeometry}get layerAdapter(){switch(this.layer.type){case"annotation-feature":return new z(this.layer);case"dimension-feature":return new Z(this.layer);case"feature":return"memory"===this.layer.source.type?new X(this.layer):new K(this.layer);case"geojson":case"csv":case"wfs":return new X(this.layer);case"parquet":return new re(this.layer);case"subtype-group":return new ie(this.layer);case"ogc-feature":return new ee(this.layer);case"stream":return new se(this.layer);case"oriented-imagery":return new te(this.layer);case"knowledge-graph-sublayer":return new Y(this.layer);case"catalog-footprint":return new B(this.layer);default:this.layer}return null}get timeExtent(){return C(this.layerAdapter.timeOptions,this.view?.timeExtent,this._get("timeExtent"))}get usedMemory(){return this.container.usedMemory+this.eventLog.pipelineStatistics.usedMemory}getDisplayStatistics(e,t){return this.featureContainer?.getDisplayStatistics(e,t)}highlight(e,t){let s;e instanceof r?s=[e.getObjectId()]:"number"==typeof e||"string"==typeof e?s=[e]:a.isCollection(e)&&e.length>0?s=e.map(e=>e?.getObjectId()).toArray():Array.isArray(e)&&e.length>0&&(s="number"==typeof e[0]||"string"==typeof e[0]?e:e.map(e=>e?.getObjectId()));const o=s?.filter(i);if(!o?.length)return n();const l=ye(t);return this._addHighlights(o,l),n(()=>!this.destroyed&&this._removeHighlights(o,l))}async hitTest(e,i,a){const o=ce(i);if(!o)return null;const n="point"===o,{trueHitIds:l,candidateHitIds:u}=await this.featureContainer.hitTest(i,a??null),h=await this.getWorker(),[c,p]=await Promise.all([h.pipeline.getDisplayFeatures(u),h.pipeline.getDisplayFeatures(l)]),{features:d,aggregates:y,tracks:g}=c,{features:f,aggregates:w,tracks:v}=p,_=[];if(!n&&this.hasRenderer()){const e=new Map,t=new r;for(const r of d){t.attributes=r.attributes,t.geometry=F(r.geometry),t.symbol=null;const s=this.layerAdapter.getRenderer(t);if(!s){_.push(r);continue}const i=await W(t,{renderer:s,scale:this.view.scale,resolution:this.view.resolution,spatialReference:this.view.spatialReference,viewingMode:"2d",timeZone:this.view.timeZone});if(!i)continue;let a=null;const o=T(i);if("web-style"===o.type)try{const e=T(await o.fetchSymbol({acceptedFormats:["cim","web"]}));a="web-style"===e.type?null:e}catch(R){m(R),0;continue}else a=o;const n=a?.symbol;if(!n)continue;const l=this.view.stage.cimAnalyzer.analyzeSymbolReference(a,!1).some(e=>"alignment"in e&&0===e.alignment);e.set(r,{cimSymbol:n,isScreenAligned:l})}e.size>0&&!this._hittestDrawHelper&&(this._hittestDrawHelper=new L(this.view.stage.painter.textureManager.resourceManager));const{resolution:s,rotation:a}=this.view.state,n=he(this.view,i);for(const[r,{cimSymbol:i,isScreenAligned:l}]of e){if(!r)continue;const e={hittestType:o,textInfo:null,mapRotation:a,resolution:s,searchDist:0,isScreenAligned:l};this._hittestDrawHelper.hitTest(n,i,r.geometry,e)&&_.push(r)}}else _.push(...d);const b=[...f,..._],S=[...w,...y],A=[...v,...g],j=this.featureContainer.getSortKeys(b.map(e=>e.displayId)),x=({displayId:e},{displayId:t})=>j.has(e)&&j.has(t)?j.get(e)-j.get(t):e-t;return b.sort(x).reverse(),S.sort(x).reverse(),[...S.map(r=>this._createAggregateGraphicHit(e,t.fromJSON(r))),...A.map(t=>this._createTrackGraphicHit(e,s.fromJSON(t))),...b.map(t=>this._createFeatureGraphicHit(n?e:null,r.fromJSON(t)))]}async queryAggregateSummaryStatistics(e,t,r){const s={...t,scale:this.view.scale},i=(await this.getWorker()).aggregates.executeQueryForSummaryStatistics(this._cleanUpAggregateQuery(e),s,r);return le(i,{})}async queryUniqueValues(e,t,r){const s=await this.getWorker(),i={...t,scale:this.view.scale},a=s.features.executeQueryForUniqueValues(this._cleanUpQuery(e),i,r);return le(a,{uniqueValueInfos:[]})}async queryAggregateUniqueValues(e,t,r){const s=await this.getWorker(),i={...t,scale:this.view.scale},a=s.aggregates.executeQueryForUniqueValues(this._cleanUpAggregateQuery(e),i,r);return le(a,{uniqueValueInfos:[]})}async queryAggregateClassBreaks(e,t,r){const s=await this.getWorker(),i={...t,scale:this.view.scale},a=s.aggregates.executeQueryForClassBreaks(this._cleanUpAggregateQuery(e),i,r);return le(a,{classBreakInfos:[]})}async queryHistogram(e,t,r){const s=await this.getWorker(),i={...t,scale:this.view.scale},a=s.features.executeQueryForHistogram(this._cleanUpQuery(e),i,r);return le(a,{bins:[],maxValue:null,minValue:null,normalizationTotal:null})}async queryAggregateCount(e,t){const r=(await this.getWorker()).aggregates.executeQueryForCount(this._cleanUpAggregateQuery(e),t);return le(r,0)}async queryAggregateHistogram(e,t,r){const s=await this.getWorker(),i={...t,scale:this.view.scale},a=s.aggregates.executeQueryForHistogram(this._cleanUpAggregateQuery(e),i,r);return le(a,{bins:[],maxValue:null,minValue:null,normalizationTotal:null})}async queryAggregateIds(e,t){const r=(await this.getWorker()).aggregates.executeQueryForIds(this._cleanUpAggregateQuery(e),t);return le(r,[])}async queryAggregateJSON(e,t){const r=(await this.getWorker()).aggregates.executeQuery(this._cleanUpAggregateQuery(e),t);return le(r,{features:[]})}async queryAttributeBins(e,t){const r=(await this.getWorker()).features.executeAttributeBinsQuery(this._cleanUpAttributeBinsQuery(e),t),s=await le(r,{features:[]});return q.fromJSON(s)}async queryAggregates(e,t){const r=(await this.getWorker()).aggregates.executeQuery(this._cleanUpAggregateQuery(e),t),s=await le(r,{features:[]}),i=Q.fromJSON(s);return i.features.forEach(e=>this.layerAdapter.setAggregateGraphicOrigin?.(e)),i}async queryClassBreaks(e,t,r){const s=await this.getWorker(),i={...t,scale:this.view.scale},a=s.features.executeQueryForClassBreaks(this._cleanUpQuery(e),i,r);return le(a,{classBreakInfos:[]})}async queryExtent(e,t){const r=(await this.getWorker()).features.executeQueryForExtent(this._cleanUpQuery(e),t),s=await le(r,{count:0,extent:null});return{count:s.count,extent:A.fromJSON(s.extent)}}async queryFeatureCount(e,t){const r=(await this.getWorker()).features.executeQueryForCount(this._cleanUpQuery(e),t);return le(r,0)}queryFeatures(e,t){return this.queryFeaturesJSON(e,t).then(e=>{const t=P.fromJSON(e);return t.features.forEach(e=>this._setOriginForFeature(e)),t})}async queryFeaturesJSON(e,t){const r=(await this.getWorker()).features.executeQuery(this._cleanUpQuery(e),t);return le(r,{features:[]})}async queryHeatmapStatistics(e){return(await this.getWorker()).pipeline.queryHeatmapStatistics(e)}async queryObjectIds(e,t){const r=(await this.getWorker()).features.executeQueryForIds(this._cleanUpQuery(e),t);return le(r,[])}async queryStatistics(){const e=await this.getWorker();return le(e.pipeline.queryStatistics(),{featureCount:0,ringCount:0,vertexCount:0})}async querySummaryStatistics(e,t,r){const s=await this.getWorker(),i={...t,scale:this.view.scale},a=s.features.executeQueryForSummaryStatistics(this._cleanUpQuery(e),i,r);return le(a,{})}async queryVisibleFeatures(e,t){const r=(await this.getWorker()).pipeline.queryVisibleFeatures(this._cleanUpQuery(e),t),s=await le(r,{features:[]}),i=P.fromJSON(s);return i.features.forEach(e=>this._setOriginForFeature(e)),i}async getSampleFeatures(e){return(await this.getWorker()).pipeline.getSampleFeatures(e)}setVisibility(e,t){t?this._visibilityOverrides.delete(e):this._visibilityOverrides.add(e),this._update()}update(e){if(!this._subscriptions)return;this.view.animation&&!this._lastTargetState&&(this._lastTargetState=e.state.clone()),!this.view.animation&&this._lastTargetState&&(this._lastTargetState=null);const t=this.featureContainer.getPresenting(),r=this._subscriptions.update(e.targetState,this._lastTargetState,t);r&&(this.featureContainer.updateSubscriptions(r),d(this._updatingHandles.addPromise(this.getWorker().then(e=>e.pipeline.updateSubscriptions(r))))),this._subscriptions.coverage&&this.featureContainer.setCoverage(this._subscriptions.coverage)}attach(){has("esri-2d-update-debug")&&console.debug("FeatureLayerView2D.attach"),d(this._updatingHandles.addPromise(this._workerAttached.promise)),d(this._attachProxy()),this.featureContainer=new G(this),this.container.addChild(this.featureContainer),this.view.timeline.record(`${this.layer.title} (FeatureLayer) Attach`),this._subscriptions=new pe(this.view.featuresTilingScheme),this._stationaryRotation=this.view.rotation,this.requestUpdate(),this.addAttachHandles([fe([()=>this._displayRefreshVersion,()=>"displayFilterInfo"in this.layer&&this.layer.displayFilterInfo,()=>this.timeExtent,()=>this.clips,()=>this.filter,()=>this.effectiveDisplayFilterClause,()=>this.featureEffect,()=>this._sourceRefreshVersion,()=>this.view.timeZone,()=>this.view.timeExtent,...this.layerAdapter.getUpdateHashProperties(this.view)],()=>this._update()),g(()=>this.updateSuspended,e=>{e||this._subscriptions.resume(this.featureContainer.getPresenting())}),g(()=>this.view.stationary,e=>{if(!e)return;const t=this.view.rotation;t!==this._stationaryRotation&&(this._stationaryRotation=t,this._update()),this.getWorker().then(e=>{if(this.destroyed)return;const t=j(this.view.extent,this.view.rotation,this.view.center);return e.pipeline.updateStationaryExtent(t.toJSON(),this.featureContainer.requiresRefresh)}).catch(()=>{})})]),this._update(),"stream"!==this.layer.type&&"parquet"!==this.layer.type&&"catalog-footprint"!==this.layer.type&&this.addAttachHandles(this.layer.on("edits",e=>this._editUpdatingHandles.addPromise(this._edit(e))))}detach(){has("esri-2d-update-debug")&&console.debug("FeatureLayerView2D.detach"),this._detachProxy(),this._fields=null,this.featureContainer.destroy(),this.featureContainer=null,this._commandsQueue.clear(),this.container.removeAllChildren(),this._subscriptions=h(this._subscriptions),this._workerProxy.pipeline.onDetach(),this._workerAttached=Promise.withResolvers(),d(this._workerAttached.promise),this._lastAvailableFields=[],this._lastSchema=null}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}addOverrides(e){return this._commandsQueue.push({type:"override",options:{...e,release:[]}})}removeOverrides(e){for(const r of e)if(null==r)throw new o("featurelayerview:bad-override","Tried to remove an override for an invalid objectId",{objectId:r});const t={added:[],updated:[],removed:[],release:e,isWeak:!1,historicMoment:null};return this._commandsQueue.push({type:"override",options:t})}onProxyClientEvent(e){}hasRenderer(){return"renderer"in this.layer&&null!=this.layer.renderer}isUpdating(){const e=this.hasRenderer(),t=this._commandsQueue.updateTracking.updating,r=null!=this._updatingRequiredPromise,s=this.featureContainer.updating;return this.updateRequested||e&&(t||r)||s||this._pipelineUpdating||this.dataUpdating}_createClientOptions(){const e=this;return{updateSchemaStart:()=>e.updateSchemaStart(),updateSchemaEnd:t=>e.updateSchemaEnd(t),openMemoryPorts:async()=>{if(this.layerAdapter?.openMessagePorts){const e=await this.layerAdapter.openMessagePorts();return{result:e,transferList:e}}throw new Error("InternalError: Layer adapter does not support opening message ports")},openGlyphPorts:async()=>{const t=await e.container.stage.textureManager.openMessagePorts();return{result:t,transferList:t}},get container(){return e.featureContainer},setUpdating:e=>{this._set("_pipelineUpdating",e.pipeline),this._set("_sourceUpdating",e.source)},emitEvent:e=>{this.onProxyClientEvent(e)},get eventLog(){return e.eventLog},fetch:async t=>{if(has("esri-2d-stabilize-glyphs")){const r=[];for(const s of t)r.push(await e.view.stage.painter.textureManager.rasterizeItem(s));return r}return Promise.all(t.map(t=>e.view.stage.painter.textureManager.rasterizeItem(t)))},fetchDictionary:e=>Promise.all(e.map(e=>this._fetchDictionaryRequest(e))),fetchMesh:e=>Promise.all(e.map(e=>this._fetchMeshRequest(e)))}}async _fetchDictionaryRequest(e){try{if(!("renderer"in this.layer)||!this.layer.renderer||"dictionary"!==this.layer.renderer.type)throw new Error("InternalError: Expected renderer to be of type 'dictionary'");const t=this.layer.renderer,r=this._lastSchema.processor.mesh.factory.symbology;if("dictionary"!==r.type)throw new Error("InternalError: Expected schema to be of type 'dictionary'");const s={cimAnalyzer:this.view.stage.cimAnalyzer,cimResourceManager:this.view.stage.painter.textureManager.resourceManager,store:this.featureContainer.instanceStore,scaleExpression:r.scaleExpression,viewRotation:this._stationaryRotation};this._fields||(this._fields=this.layer.fields.map(e=>e.toJSON()));const i=r.visualVariableUniforms,a=ue(this.layer.geometryType),o=await t.getSymbolForControlString(e.controlString,a,!1);if(!o||!o.data)return{type:"dictionary-response",meshes:[]};return{type:"dictionary-response",meshes:await ae({...o.data,hasTextStringTemplates:!0},{uniforms:i,path:"renderer",schemaOptions:s})}}catch(t){return{type:"dictionary-response",meshes:[]}}}async _fetchMeshRequest(e){const{layer:t}=this;try{const r={cimAnalyzer:this.view.stage.cimAnalyzer,cimResourceManager:this.view.stage.painter.textureManager.resourceManager,store:this.featureContainer.instanceStore,scaleExpression:null,viewRotation:this._stationaryRotation};this._fields||(this._fields=t.fields.map(e=>e.toJSON()));return{type:"mesh-response",meshes:await ae({...e.symbolReference,hasTextStringTemplates:!0},{path:"anno-like",schemaOptions:r,uniforms:{visualVariableColor:null,visualVariableOpacity:null,visualVariableRotation:null,visualVariableSizeStops:null,visualVariableSizeScaleStops:null,visualVariableSizeOutlineScaleStops:null,visualVariableSizeUnitValue:null,visualVariableSizeMinMaxValue:null}})}}catch(r){return{type:"mesh-response",meshes:[]}}}_cleanUpQuery(e){const t=H.from(e)||this.createQuery();return t.outSpatialReference||(t.outSpatialReference=this.view.spatialReference),"returnZ"in this.layer&&(t.returnZ??=this.layer.returnZ),"returnM"in this.layer&&(t.returnM??=this.layer.returnM),t.toJSON()}_cleanUpAttributeBinsQuery(e){const t=M.from(e);return t.outSpatialReference||(t.outSpatialReference=this.view.spatialReference),t.toJSON()}_cleanUpAggregateQuery(e){const t=H.from(e)||this.createAggregateQuery();t.outSpatialReference||(t.outSpatialReference=this.view.spatialReference);const r=t.objectIds??[];for(const s of t.aggregateIds??[])r.push(s);return t.objectIds=r,t.aggregateIds=[],t.toJSON()}async _update(){return this._commandsQueue.push({type:"update"})}_edit(e){return this._commandsQueue.push({type:"edit",event:e})}async doRefresh(e){this.attached&&(this.updateSuspended&&e||(e?this.incrementSourceRefreshVersion():this.incrementDisplayRefreshVersion()))}incrementSourceRefreshVersion(){this._sourceRefreshVersion=(this._sourceRefreshVersion+1)%ge+1}incrementDisplayRefreshVersion(){this._displayRefreshVersion=(this._displayRefreshVersion+1)%ge+1}async _resolveIdenifiers(e){const t=[],r=[];for(const a of e)null==a.objectId||-1===a.objectId?null==a.globalId?u.getLogger(this).warn("mapview-apply-edits","A feature identifier must contain either a GlobalId or ObjectId. Ignoring",{identifier:a}):r.push(a.globalId):t.push(a.objectId);const s="globalIdField"in this.layer&&this.layer.globalIdField,i=s&&this.availableFields.includes(s);if(r.length&&!i)return u.getLogger(this).error(new o("mapview-apply-edits",`Editing the specified service requires the layer's globalIdField, ${s} to be included the layer's outFields for updates to be reflected on the map`)),t;if(r.length){const e=await this._workerProxy.pipeline.getObjectIdsFromGlobalIds(r);for(const r of e)t.push(r)}return t}_resolveOverrides(e){const t=!1,r=!1,s=ue(this.layer.geometryType),i=$(this.layer),a=[];for(const n of e.added){const e=I(we(n),s,t,r,i);if(null==e.objectId)throw new o("featurelayerview:bad-override","Feature does not have an objectId",{feature:n});a.push(e)}for(const n of e.updated){const e=I(we(n),s,t,r,i);if(null==e.objectId)throw new o("featurelayerview:bad-override","Feature does not have an objectId",{feature:n});a.push(e)}for(const n of e.removed)if(null==n)throw new o("featurelayerview:bad-override","Tried to remove an invalid objectId",{objectId:n});return{type:"override",updates:a,removed:e.removed,release:e.release,isWeak:e.isWeak??!1,historicMoment:e.historicMoment??null}}async _resolveEdit(e){const t=this.layer,r=e.historicMoment?.getTime()??null,s="layerId"in t&&e.editedFeatures?.find(e=>e.layerId===t.layerId);if(s&&this._canEditByFeature(s)){const{adds:e,deletes:t,updates:i}=s.editedFeatures,a=this.layer.objectIdField,o=i.map(e=>e.current),n=t.map(e=>"attributes"in e?{objectId:a?e.attributes[a]:null}:e),l=await this._resolveIdenifiers(n);return this._resolveOverrides({added:e,updated:o,removed:l,historicMoment:r,isWeak:!0,release:[]})}const[i,a,o]=await Promise.all([this._resolveIdenifiers(e.addedFeatures),this._resolveIdenifiers(e.updatedFeatures),this._resolveIdenifiers(e.deletedFeatures)]);return{type:"override-by-id",updates:[...i,...a],removed:o,historicMoment:r,isWeak:!0}}_canEditByFeature(e){const{adds:t,updates:r}=e.editedFeatures;return t.every(e=>this.view.spatialReference.equals(e.geometry?.spatialReference))&&r.every(e=>this.view.spatialReference.equals(e.current.geometry?.spatialReference))}async updateSchemaStart(){const e=this.layer;"featureReduction"in e&&e.featureReduction&&e.featureReduction!==this._lastFeatureReduction&&(e.featureReduction=e.featureReduction?.clone(),this._lastFeatureReduction=e.featureReduction);try{if(await Promise.allSettled([this._handleChange(),O(e)]),this.destroyed||!this.layerAdapter?.hasRequiredSupport||!this._subscriptions)return null;const t=this.featureContainer.updateStart("subtype-group"===e.type);this._lastFeatureEffect=this.featureEffect;const r={store:t,cimAnalyzer:this.view.stage.cimAnalyzer,cimResourceManager:this.view.stage.painter.textureManager.resourceManager,scaleExpression:void 0,viewRotation:this._stationaryRotation},s=await this._createViewSchemaConfig(),i={source:await this.layerAdapter.createSourceSchema(s,this._sourceRefreshVersion),processor:await this.layerAdapter.createProcessorSchema(r,s,this._displayRefreshVersion)};return c(this._lastSchema?.source.strategy,i.source.strategy)||c(this._lastSchema?.processor,i.processor)?(this._lastSchema=i,this._fields=null,i):null}catch(t){}return null}async updateSchemaEnd(e){try{this.featureEffectView.featureEffect=this._lastFeatureEffect,e&&this.featureEffectView.endTransition(),await this.featureContainer.updateEnd(this._lastSchema.processor,this.layerAdapter.getLabelingDeconflictionInfo(),e),has("esri-2d-update-debug")&&console.debug("FeatureLayerView2D.updateEnd")}catch(t){}}async _doUpdate(){const e=Math.round(performance.now()),t=await this.getWorker();await t.pipeline.updateSchema(e),this.requestUpdate()}async _doOverride(e){const t=await this.getWorker();try{let r=new oe;for(const s of e.messages)switch(s.type){case"edit":r.tryAdd(await this._resolveEdit(s.event))||(await t.pipeline.onOverride(r.toMessage()),r=new oe,r.tryAdd(await this._resolveEdit(s.event)));break;case"override":r.tryAdd(this._resolveOverrides(s.options))||(await t.pipeline.onOverride(r.toMessage()),r=new oe,r.tryAdd(this._resolveOverrides(s.options)));break}await t.pipeline.onOverride(r.toMessage())}catch(r){m(r),0}}_getEffectiveAvailableFields(e){const t=me(this._lastAvailableFields,e);return this._lastAvailableFields=t,U(this.layer.fieldsIndex,t)}async _createViewSchemaConfig(){const e=this.requiresCurrentUser?await this.signedInUser:null,t=[x(this.view,this.layerAdapter,this.timeExtent,this._visibilityOverrides,this.filter,this.effectiveDisplayFilterClause),this.featureEffect?.filter?.toJSON()??null];return{availableFields:this._getEffectiveAvailableFields(this.availableFields),displayFilterEnabled:this.displayFilterEnabled,filters:t,scale:this.view.scale,timeZone:this.view.timeZone,timeExtent:this.view.timeExtent,currentUser:e,spatialReference:this.view.spatialReference,extent:this.view.extent,returnZ:this.hasZ,returnM:this.hasM}}_processHighlight(){this._commandsQueue.push({type:"highlight"})}async _updateHighlights(){const e=this._getHighlights(),t=await this.getWorker();if(this.destroyed)return;const r=t.pipeline.updateHighlight({highlights:e}).catch(e=>{m(e)||u.getLogger(this).error(e)});this._updatingHandles.consumePromise(r)}_setOriginForFeature(e){e.layer=e.sourceLayer=this.layer,this.layerAdapter.setGraphicOrigin(e)}_createFeatureGraphicHit(e,t){return this._setOriginForFeature(t),this._createGraphicHit(e,t)}_createTrackGraphicHit(e,t){return t.layer=t.sourceLayer=this.layer,this.layerAdapter.setTrackGraphicOrigin?.(t),this._createGraphicHit(e,t)}_createAggregateGraphicHit(e,t){return t.layer=t.sourceLayer=this.layer,this.layerAdapter.setAggregateGraphicOrigin?.(t),this._createGraphicHit(e,t)}_createGraphicHit(e,t){return null!=t.geometry&&(t.geometry.spatialReference=this.view.spatialReference),{type:"graphic",graphic:t,layer:this.layer,mapPoint:e}}};function x(e,t,r,s,i,a){i&&(i=i.clone());const o=null!=i?i.timeExtent:null,n=null!=r&&null!=o?r.intersection(o):r||o;n&&(i??=new k,i.timeExtent=n),i=t.addFilters?.(i,e)??i,a&&(i??=new k,i.where=w(i.where,a));let l=i?.toJSON()??null;return s.size&&(l??=(new k).toJSON(),l.hiddenIds=Array.from(s)),l}return e([_()],v.prototype,"_commandsQueue",void 0),e([_()],v.prototype,"_sourceRefreshVersion",void 0),e([_()],v.prototype,"_displayRefreshVersion",void 0),e([_({readOnly:!0})],v.prototype,"_pipelineUpdating",void 0),e([_()],v.prototype,"_sourceUpdating",void 0),e([_({readOnly:!0})],v.prototype,"dataUpdating",null),e([_({readOnly:!0})],v.prototype,"hasAllFeatures",null),e([_({readOnly:!0})],v.prototype,"hasAllFeaturesInView",null),e([_({readOnly:!0})],v.prototype,"hasFullGeometries",null),e([_()],v.prototype,"featureEffectView",void 0),e([_()],v.prototype,"layerAdapter",null),e([_({readOnly:!0})],v.prototype,"timeExtent",null),v=e([b("esri.views.2d.layers.FeatureLikeLayerView2D")],v),v};export{ve as FeatureLikeLayerView2D};
2
+ import{__decorate as e}from"tslib";import t from"../../../AggregateGraphic.js";import r from"../../../Graphic.js";import s from"../../../TrackGraphic.js";import{isSome as i}from"../../../core/arrayUtils.js";import a from"../../../core/Collection.js";import o from"../../../core/Error.js";import{makeHandle as n,handlesGroup as l}from"../../../core/handleUtils.js";import has from"../../../core/has.js";import u from"../../../core/Logger.js";import{destroyMaybe as h}from"../../../core/maybe.js";import{notDeepEqual as c}from"../../../core/object.js";import{createAbortError as p,ignoreAbortErrors as d,throwIfNotAbortError as y,isAbortError as m}from"../../../core/promiseUtils.js";import{watch as f,sync as g}from"../../../core/reactiveUtils.js";import{sqlAnd as w}from"../../../core/sql.js";import{getMetersPerUnitForSR as v}from"../../../core/units.js";import{property as _,subclass as b}from"../../../core/accessorSupport/decorators.js";import{UpdatingHandles as S}from"../../../core/support/UpdatingHandles.js";import A from"../../../geometry/Extent.js";import{fromJSON as F}from"../../../geometry/support/jsonUtils.js";import j from"../../../geometry/support/rotate.js";import{isCurvedGeometry as x}from"../../../geometry/support/curves/curveUtils.js";import{densifyCurvedGeometry as R}from"../../../geometry/support/curves/densifyCurvedGeometry.js";import I from"../../../layers/effects/FeatureEffectView.js";import{convertFromFeature as E}from"../../../layers/graphics/featureConversionUtils.js";import O from"../../../layers/support/FeatureFilter.js";import{checkServiceCurrentUserSupport as k}from"../../../layers/support/featureLayerUtils.js";import{packFields as U}from"../../../layers/support/fieldUtils.js";import{getEffectiveLayerCapabilities as C}from"../../../layers/support/layerUtils.js";import{combineTimeExtent as V}from"../../../layers/support/timeSupport.js";import Q from"../../../rest/support/AggregateFeatureSet.js";import q from"../../../rest/support/AttributeBinsFeatureSet.js";import M from"../../../rest/support/AttributeBinsQuery.js";import P from"../../../rest/support/FeatureSet.js";import L from"../../../rest/support/Query.js";import{HittestDrawHelper as H}from"../../../symbols/cim/CIMSymbolDrawHelper.js";import{symbolToCIM as T}from"../../../symbols/cim/CIMSymbolHelper.js";import{getDisplayedSymbol as D}from"../../../symbols/support/symbolUtils.js";import{LayerView2D as W}from"./LayerView2D.js";import{FeatureContainer as G}from"./features/FeatureContainer.js";import{createFeaturePipelineWorkerProxy as N}from"./features/FeaturePipelineWorkerProxy.js";import{FeatureSourceEventLog as J}from"./features/FeatureSourceEventLog.js";import{AnnotationLayerAdapter as z}from"./features/layerAdapters/AnnotationLayerAdapter.js";import{CatalogFootprintLayerAdapter as B}from"./features/layerAdapters/CatalogFootprintLayerAdapter.js";import{DimensionLayerAdapter as Z}from"./features/layerAdapters/DimensionLayerAdapter.js";import{FeatureLayerAdapter as K}from"./features/layerAdapters/FeatureLayerAdapter.js";import{createFeatureIdInfo as $}from"./features/layerAdapters/featureServiceUtils.js";import{InMemoryLayerAdapter as X}from"./features/layerAdapters/InMemoryLayerAdapter.js";import{KnowledgeGraphSublayerAdapter as Y}from"./features/layerAdapters/KnowledgeGraphSublayerAdapter.js";import{OGCFeatureLayerAdapter as ee}from"./features/layerAdapters/OGCFeatureLayerAdapter.js";import{OrientedImageryLayerAdapter as te}from"./features/layerAdapters/OrientedImageryLayerAdapter.js";import{ParquetLayerAdapter as re}from"./features/layerAdapters/ParquetLayerAdapter.js";import{StreamLayerAdapter as se}from"./features/layerAdapters/StreamLayerAdapter.js";import{SubtypeGroupLayerAdapter as ie}from"./features/layerAdapters/SubtypeGroupLayerAdapter.js";import{createComplexSymbolInstances as ae}from"./features/schema/processor/symbols/ComplexSymbolSchema.js";import{DebouncedFeatureOverride as oe}from"./support/DebouncedFeatureOverride.js";import{FeatureCommandQueue as ne}from"./support/FeatureCommandQueue.js";import{createFilterSchemas as le}from"./support/FilterSchema.js";import{handleNoEngineError as ue}from"./support/handleNoEngineError.js";import{toJSONGeometryType as he}from"./support/util.js";import{getMapPointsFromScreen as ce,getHittestType as pe}from"../support/hitTestUtils.js";import{FeatureTileSubscriptionManager as de}from"../tiling/FeatureTileSubscriptionManager.js";import{RefreshableLayerView as ye}from"../../layers/RefreshableLayerView.js";import{getHighlightName as me}from"../../support/highlightOptionsUtils.js";function fe(e,t){const r=new Set;return e&&e.forEach(e=>r.add(e)),t&&t.forEach(e=>r.add(e)),r.has("*")?["*"]:Array.from(r)}const ge=4294967294;function we(e,t){return l(e.map(e=>f(()=>{const t=e();return t&&"object"==typeof t?"getTime"in t&&"function"==typeof t.getTime?t.getTime():JSON.stringify(t):t},t,g)))}function ve(e){if(!e.geometry)return e;if(!x(e.geometry))return e;const t=.001/v(e.geometry.spatialReference),r=100;return{geometry:R(e.geometry,{maxSegmentsPerCurve:12e3,maxSegmentLength:r*t,maxDeviation:0}),attributes:e.attributes}}const _e=l=>{const g=ye(W(l));let v=class extends g{constructor(){super(...arguments),this._commandsQueue=new ne({process:e=>{switch(e.type){case"override-batch":return this._doOverride(e);case"update":return this._doUpdate()}}}),this._visibilityOverrides=new Set,this._lastAvailableFields=[],this._lastTargetState=null,this._stationaryRotation=0,this.eventLog=new J,this._sourceRefreshVersion=1,this._displayRefreshVersion=1,this._pipelineUpdating=!1,this._editUpdatingHandles=new S,this._fields=null,this._hittestDrawHelper=null,this._sourceUpdating=!1,this.featureEffectView=new I}destroy(){this._editUpdatingHandles.destroy(),this._workerProxy?.destroy(),this._workerAttached.reject(p()),this._commandsQueue.destroy(),this._hittestDrawHelper?.destroy()}initialize(){this._workerAttached=Promise.withResolvers(),d(this._workerAttached.promise),this.addResolvingPromise(this._initProxy()),this.featureEffectView.featureEffect=this.featureEffect,this.featureEffectView.endTransition()}async _initProxy(){const e=this.layer;if("isTable"in e&&e.isTable)throw new o("featurelayerview:table-not-supported","table feature layer can't be displayed",{layer:e});if(("feature"===e.type||"subtype-group"===e.type)&&!1===C(e)?.operations.supportsQuery)throw new o("featurelayerview:query-not-supported","layer view requires a layer with query capability",{layer:e});this._workerProxy&&this._workerProxy.destroy();const t=this._createClientOptions();this._workerProxy=await N(t)}async _attachProxy(){const e=j(this.view.extent,this.view.rotation,this.view.center),t={tileInfoJSON:this.view?.featuresTilingScheme?.tileInfo?.toJSON(),initialViewExtent:e.toJSON()};try{await this._workerProxy.pipeline.onAttach(t),this._workerAttached.resolve()}catch(r){this._workerAttached.reject(p()),y(r)}}async _detachProxy(){return this._workerProxy.pipeline.onDetach()}async getWorker(){return await this._workerAttached.promise,this._workerProxy}get dataUpdating(){return this._sourceUpdating||this._editUpdatingHandles.updating}get hasAllFeatures(){return this.layer.visible&&!this.suspended&&this.eventLog.hasAllData&&this.eventLog.willQueryAllFeatures}get hasAllFeaturesInView(){const e=this.effectiveDisplayFilter?.where||null,t=!this.eventLog.willQueryAllFeatures&&null!=e&&"1=1"!==e;return this.layer.visible&&!this.suspended&&this.eventLog.hasAllData&&!t}get hasFullGeometries(){return this.layer.visible&&!this.suspended&&this.eventLog.hasAllData&&this.eventLog.willQueryFullResolutionGeometry}get layerAdapter(){switch(this.layer.type){case"annotation-feature":return new z(this.layer);case"dimension-feature":return new Z(this.layer);case"feature":return"memory"===this.layer.source.type?new X(this.layer):new K(this.layer);case"geojson":case"csv":case"wfs":return new X(this.layer);case"parquet":return new re(this.layer);case"subtype-group":return new ie(this.layer);case"ogc-feature":return new ee(this.layer);case"stream":return new se(this.layer);case"oriented-imagery":return new te(this.layer);case"knowledge-graph-sublayer":return new Y(this.layer);case"catalog-footprint":return new B(this.layer);default:this.layer}return null}get timeExtent(){return V(this.layerAdapter.timeOptions,this.view?.timeExtent,this._get("timeExtent"))}get usedMemory(){return this.container.usedMemory+this.eventLog.pipelineStatistics.usedMemory}getDisplayStatistics(e,t){return this.featureContainer?.getDisplayStatistics(e,t)}highlight(e,t){const s=me(t);let o;if(e instanceof O)o=e;else{let t;e instanceof r?t=[e.getObjectId()]:"number"==typeof e||"string"==typeof e?t=[e]:a.isCollection(e)&&e.length>0?t=e.map(e=>e?.getObjectId()).toArray():Array.isArray(e)&&e.length>0&&(t="number"==typeof e[0]||"string"==typeof e[0]?e:e.map(e=>e?.getObjectId()));const s=t?.filter(i);if(!s?.length)return n();o=new O({objectIds:s})}const l=this._addHighlightFilter(o,s);return n(()=>!this.destroyed&&this._removeHighlight(l))}async hitTest(e,i,a){const o=pe(i);if(!o)return null;const n="point"===o,{trueHitIds:l,candidateHitIds:u}=await this.featureContainer.hitTest(i,a??null),h=await this.getWorker(),[c,p]=await Promise.all([h.pipeline.getDisplayFeatures(u),h.pipeline.getDisplayFeatures(l)]),{features:d,aggregates:y,tracks:f}=c,{features:g,aggregates:w,tracks:v}=p,_=[];if(!n&&this.hasRenderer()){const e=new Map,t=new r;for(const r of d){t.attributes=r.attributes,t.geometry=F(r.geometry),t.symbol=null;const s=this.layerAdapter.getRenderer(t);if(!s){_.push(r);continue}const i=await D(t,{renderer:s,scale:this.view.scale,resolution:this.view.resolution,spatialReference:this.view.spatialReference,viewingMode:"2d",timeZone:this.view.timeZone});if(!i)continue;let a=null;const o=T(i);if("web-style"===o.type)try{const e=T(await o.fetchSymbol({acceptedFormats:["cim","web"]}));a="web-style"===e.type?null:e}catch(R){m(R),0;continue}else a=o;const n=a?.symbol;if(!n)continue;const l=this.view.stage.cimAnalyzer.analyzeSymbolReference(a,!1).some(e=>"alignment"in e&&0===e.alignment);e.set(r,{cimSymbol:n,isScreenAligned:l})}e.size>0&&!this._hittestDrawHelper&&(this._hittestDrawHelper=new H(this.view.stage.painter.textureManager.resourceManager));const{resolution:s,rotation:a}=this.view.state,n=ce(this.view,i);for(const[r,{cimSymbol:i,isScreenAligned:l}]of e){if(!r)continue;const e={hittestType:o,textInfo:null,mapRotation:a,resolution:s,searchDist:0,isScreenAligned:l};this._hittestDrawHelper.hitTest(n,i,r.geometry,e)&&_.push(r)}}else _.push(...d);const b=[...g,..._],S=[...w,...y],A=[...v,...f],j=this.featureContainer.getSortKeys(b.map(e=>e.displayId)),x=({displayId:e},{displayId:t})=>j.has(e)&&j.has(t)?j.get(e)-j.get(t):e-t;return b.sort(x).reverse(),S.sort(x).reverse(),[...S.map(r=>this._createAggregateGraphicHit(e,t.fromJSON(r))),...A.map(t=>this._createTrackGraphicHit(e,s.fromJSON(t))),...b.map(t=>this._createFeatureGraphicHit(n?e:null,r.fromJSON(t)))]}async queryAggregateSummaryStatistics(e,t,r){const s={...t,scale:this.view.scale},i=(await this.getWorker()).aggregates.executeQueryForSummaryStatistics(this._cleanUpAggregateQuery(e),s,r);return ue(i,{})}async queryUniqueValues(e,t,r){const s=await this.getWorker(),i={...t,scale:this.view.scale},a=s.features.executeQueryForUniqueValues(this._cleanUpQuery(e),i,r);return ue(a,{uniqueValueInfos:[]})}async queryAggregateUniqueValues(e,t,r){const s=await this.getWorker(),i={...t,scale:this.view.scale},a=s.aggregates.executeQueryForUniqueValues(this._cleanUpAggregateQuery(e),i,r);return ue(a,{uniqueValueInfos:[]})}async queryAggregateClassBreaks(e,t,r){const s=await this.getWorker(),i={...t,scale:this.view.scale},a=s.aggregates.executeQueryForClassBreaks(this._cleanUpAggregateQuery(e),i,r);return ue(a,{classBreakInfos:[]})}async queryHistogram(e,t,r){const s=await this.getWorker(),i={...t,scale:this.view.scale},a=s.features.executeQueryForHistogram(this._cleanUpQuery(e),i,r);return ue(a,{bins:[],maxValue:null,minValue:null,normalizationTotal:null})}async queryAggregateCount(e,t){const r=(await this.getWorker()).aggregates.executeQueryForCount(this._cleanUpAggregateQuery(e),t);return ue(r,0)}async queryAggregateHistogram(e,t,r){const s=await this.getWorker(),i={...t,scale:this.view.scale},a=s.aggregates.executeQueryForHistogram(this._cleanUpAggregateQuery(e),i,r);return ue(a,{bins:[],maxValue:null,minValue:null,normalizationTotal:null})}async queryAggregateIds(e,t){const r=(await this.getWorker()).aggregates.executeQueryForIds(this._cleanUpAggregateQuery(e),t);return ue(r,[])}async queryAggregateJSON(e,t){const r=(await this.getWorker()).aggregates.executeQuery(this._cleanUpAggregateQuery(e),t);return ue(r,{features:[]})}async queryAttributeBins(e,t){const r=(await this.getWorker()).features.executeAttributeBinsQuery(this._cleanUpAttributeBinsQuery(e),t),s=await ue(r,{features:[]});return q.fromJSON(s)}async queryAggregates(e,t){const r=(await this.getWorker()).aggregates.executeQuery(this._cleanUpAggregateQuery(e),t),s=await ue(r,{features:[]}),i=Q.fromJSON(s);return i.features.forEach(e=>this.layerAdapter.setAggregateGraphicOrigin?.(e)),i}async queryClassBreaks(e,t,r){const s=await this.getWorker(),i={...t,scale:this.view.scale},a=s.features.executeQueryForClassBreaks(this._cleanUpQuery(e),i,r);return ue(a,{classBreakInfos:[]})}async queryExtent(e,t){const r=(await this.getWorker()).features.executeQueryForExtent(this._cleanUpQuery(e),t),s=await ue(r,{count:0,extent:null});return{count:s.count,extent:A.fromJSON(s.extent)}}async queryFeatureCount(e,t){const r=(await this.getWorker()).features.executeQueryForCount(this._cleanUpQuery(e),t);return ue(r,0)}queryFeatures(e,t){return this.queryFeaturesJSON(e,t).then(e=>{const t=P.fromJSON(e);return t.features.forEach(e=>this._setOriginForFeature(e)),t})}async queryFeaturesJSON(e,t){const r=(await this.getWorker()).features.executeQuery(this._cleanUpQuery(e),t);return ue(r,{features:[]})}async queryHeatmapStatistics(e){return(await this.getWorker()).pipeline.queryHeatmapStatistics(e)}async queryObjectIds(e,t){const r=(await this.getWorker()).features.executeQueryForIds(this._cleanUpQuery(e),t);return ue(r,[])}async queryStatistics(){const e=await this.getWorker();return ue(e.pipeline.queryStatistics(),{featureCount:0,ringCount:0,vertexCount:0})}async querySummaryStatistics(e,t,r){const s=await this.getWorker(),i={...t,scale:this.view.scale},a=s.features.executeQueryForSummaryStatistics(this._cleanUpQuery(e),i,r);return ue(a,{})}async queryVisibleFeatures(e,t){const r=(await this.getWorker()).pipeline.queryVisibleFeatures(this._cleanUpQuery(e),t),s=await ue(r,{features:[]}),i=P.fromJSON(s);return i.features.forEach(e=>this._setOriginForFeature(e)),i}async getSampleFeatures(e){return(await this.getWorker()).pipeline.getSampleFeatures(e)}setVisibility(e,t){t?this._visibilityOverrides.delete(e):this._visibilityOverrides.add(e),this._update()}update(e){if(!this._subscriptions)return;this.view.animation&&!this._lastTargetState&&(this._lastTargetState=e.state.clone()),!this.view.animation&&this._lastTargetState&&(this._lastTargetState=null);const t=this.featureContainer.getPresenting(),r=this._subscriptions.update(e.targetState,this._lastTargetState,t);r&&(this.featureContainer.updateSubscriptions(r),d(this._updatingHandles.addPromise(this.getWorker().then(e=>e.pipeline.updateSubscriptions(r))))),this._subscriptions.coverage&&this.featureContainer.setCoverage(this._subscriptions.coverage)}attach(){has("esri-2d-update-debug")&&console.debug("FeatureLayerView2D.attach"),d(this._updatingHandles.addPromise(this._workerAttached.promise)),d(this._attachProxy()),this.featureContainer=new G(this),this.container.addChild(this.featureContainer),this.view.timeline.record(`${this.layer.title} (FeatureLayer) Attach`),this._subscriptions=new de(this.view.featuresTilingScheme),this._stationaryRotation=this.view.rotation,this.requestUpdate(),this.addAttachHandles([we([()=>this._displayRefreshVersion,()=>"displayFilterInfo"in this.layer&&this.layer.displayFilterInfo,()=>this.timeExtent,()=>this.clips,()=>this.filter,()=>this.effectiveDisplayFilterClause,()=>this.featureEffect,()=>this._sourceRefreshVersion,()=>this.view.timeZone,()=>this.view.timeExtent,...this.layerAdapter.getUpdateHashProperties(this.view)],()=>this._update()),f(()=>this.updateSuspended,e=>{e||this._subscriptions.resume(this.featureContainer.getPresenting())}),f(()=>this.view.stationary,e=>{if(!e)return;const t=this.view.rotation;t!==this._stationaryRotation&&(this._stationaryRotation=t,this._update()),this.getWorker().then(e=>{if(this.destroyed)return;const t=j(this.view.extent,this.view.rotation,this.view.center);return e.pipeline.updateStationaryExtent(t.toJSON(),this.featureContainer.requiresRefresh)}).catch(()=>{})})]),this._update(),"stream"!==this.layer.type&&"parquet"!==this.layer.type&&"catalog-footprint"!==this.layer.type&&this.addAttachHandles(this.layer.on("edits",e=>this._editUpdatingHandles.addPromise(this._edit(e))))}emitFirstDraw(e){this.emit("first-draw",{timestamp:e})}detach(){has("esri-2d-update-debug")&&console.debug("FeatureLayerView2D.detach"),this._detachProxy(),this._fields=null,this.featureContainer.destroy(),this.featureContainer=null,this._commandsQueue.clear(),this.container.removeAllChildren(),this._subscriptions=h(this._subscriptions),this._workerProxy.pipeline.onDetach(),this._workerAttached=Promise.withResolvers(),d(this._workerAttached.promise),this._lastAvailableFields=[],this._lastSchema=null}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}addOverrides(e){return this._commandsQueue.push({type:"override",options:{...e,release:[]}})}removeOverrides(e){for(const r of e)if(null==r)throw new o("featurelayerview:bad-override","Tried to remove an override for an invalid objectId",{objectId:r});const t={added:[],updated:[],removed:[],release:e,isWeak:!1,historicMoment:null};return this._commandsQueue.push({type:"override",options:t})}onProxyClientEvent(e){}hasRenderer(){return"renderer"in this.layer&&null!=this.layer.renderer}isUpdating(){const e=this.hasRenderer(),t=this._commandsQueue.updateTracking.updating,r=null!=this._updatingRequiredPromise,s=this.featureContainer.updating;return this.updateRequested||e&&(t||r)||s||this._pipelineUpdating||this.dataUpdating}_createClientOptions(){const e=this;return{updateSchemaStart:()=>e.updateSchemaStart(),updateSchemaEnd:t=>e.updateSchemaEnd(t),openMemoryPorts:async()=>{if(this.layerAdapter?.openMessagePorts){const e=await this.layerAdapter.openMessagePorts();return{result:e,transferList:e}}throw new Error("InternalError: Layer adapter does not support opening message ports")},openGlyphPorts:async()=>{const t=await e.container.stage.textureManager.openMessagePorts();return{result:t,transferList:t}},get container(){return e.featureContainer},setUpdating:e=>{this._set("_pipelineUpdating",e.pipeline),this._set("_sourceUpdating",e.source)},emitEvent:e=>{this.onProxyClientEvent(e)},get eventLog(){return e.eventLog},fetch:async t=>{if(has("esri-2d-stabilize-glyphs")){const r=[];for(const s of t)r.push(await e.view.stage.painter.textureManager.rasterizeItem(s));return r}return Promise.all(t.map(t=>e.view.stage.painter.textureManager.rasterizeItem(t)))},fetchDictionary:e=>Promise.all(e.map(e=>this._fetchDictionaryRequest(e))),fetchMesh:e=>Promise.all(e.map(e=>this._fetchMeshRequest(e)))}}async _fetchDictionaryRequest(e){try{if(!("renderer"in this.layer)||!this.layer.renderer||"dictionary"!==this.layer.renderer.type)throw new Error("InternalError: Expected renderer to be of type 'dictionary'");const t=this.layer.renderer,r=this._lastSchema.processor.mesh.factory.symbology;if("dictionary"!==r.type)throw new Error("InternalError: Expected schema to be of type 'dictionary'");const s={cimAnalyzer:this.view.stage.cimAnalyzer,cimResourceManager:this.view.stage.painter.textureManager.resourceManager,store:this.featureContainer.instanceStore,scaleExpression:r.scaleExpression,viewRotation:this._stationaryRotation};this._fields||(this._fields=this.layer.fields.map(e=>e.toJSON()));const i=r.visualVariableUniforms,a=he(this.layer.geometryType),o=await t.getSymbolForControlString(e.controlString,a,!1);if(!o||!o.data)return{type:"dictionary-response",meshes:[]};return{type:"dictionary-response",meshes:await ae({...o.data,hasTextStringTemplates:!0},{uniforms:i,path:"renderer",schemaOptions:s})}}catch(t){return{type:"dictionary-response",meshes:[]}}}async _fetchMeshRequest(e){const{layer:t}=this;try{const r={cimAnalyzer:this.view.stage.cimAnalyzer,cimResourceManager:this.view.stage.painter.textureManager.resourceManager,store:this.featureContainer.instanceStore,scaleExpression:null,viewRotation:this._stationaryRotation};this._fields||(this._fields=t.fields.map(e=>e.toJSON()));return{type:"mesh-response",meshes:await ae({...e.symbolReference,hasTextStringTemplates:!0},{path:"anno-like",schemaOptions:r,uniforms:{visualVariableColor:null,visualVariableOpacity:null,visualVariableRotation:null,visualVariableSizeStops:null,visualVariableSizeScaleStops:null,visualVariableSizeOutlineScaleStops:null,visualVariableSizeUnitValue:null,visualVariableSizeMinMaxValue:null}})}}catch(r){return{type:"mesh-response",meshes:[]}}}_cleanUpQuery(e){const t=L.from(e)||this.createQuery();return t.outSpatialReference||(t.outSpatialReference=this.view.spatialReference),"returnZ"in this.layer&&(t.returnZ??=this.layer.returnZ),"returnM"in this.layer&&(t.returnM??=this.layer.returnM),t.toJSON()}_cleanUpAttributeBinsQuery(e){const t=M.from(e);return t.outSpatialReference||(t.outSpatialReference=this.view.spatialReference),t.toJSON()}_cleanUpAggregateQuery(e){const t=L.from(e)||this.createAggregateQuery();t.outSpatialReference||(t.outSpatialReference=this.view.spatialReference);const r=t.objectIds??[];for(const s of t.aggregateIds??[])r.push(s);return t.objectIds=r,t.aggregateIds=[],t.toJSON()}async _update(){return this._commandsQueue.push({type:"update"})}_edit(e){return this._commandsQueue.push({type:"edit",event:e})}async doRefresh(e){this.attached&&(this.updateSuspended&&e||(e?this.incrementSourceRefreshVersion():this.incrementDisplayRefreshVersion()))}incrementSourceRefreshVersion(){this._sourceRefreshVersion=(this._sourceRefreshVersion+1)%ge+1}incrementDisplayRefreshVersion(){this._displayRefreshVersion=(this._displayRefreshVersion+1)%ge+1}async _resolveIdenifiers(e){const t=[],r=[];for(const a of e)null==a.objectId||-1===a.objectId?null==a.globalId?u.getLogger(this).warn("mapview-apply-edits","A feature identifier must contain either a GlobalId or ObjectId. Ignoring",{identifier:a}):r.push(a.globalId):t.push(a.objectId);const s="globalIdField"in this.layer&&this.layer.globalIdField,i=s&&this.availableFields.includes(s);if(r.length&&!i)return u.getLogger(this).error(new o("mapview-apply-edits",`Editing the specified service requires the layer's globalIdField, ${s} to be included the layer's outFields for updates to be reflected on the map`)),t;if(r.length){const e=await this._workerProxy.pipeline.getObjectIdsFromGlobalIds(r);for(const r of e)t.push(r)}return t}_resolveOverrides(e){const t=!1,r=!1,s=he(this.layer.geometryType),i=$(this.layer),a=[];for(const n of e.added){const e=E(ve(n),s,t,r,i);if(null==e.objectId)throw new o("featurelayerview:bad-override","Feature does not have an objectId",{feature:n});a.push(e)}for(const n of e.updated){const e=E(ve(n),s,t,r,i);if(null==e.objectId)throw new o("featurelayerview:bad-override","Feature does not have an objectId",{feature:n});a.push(e)}for(const n of e.removed)if(null==n)throw new o("featurelayerview:bad-override","Tried to remove an invalid objectId",{objectId:n});return{type:"override",updates:a,removed:e.removed,release:e.release,isWeak:e.isWeak??!1,historicMoment:e.historicMoment??null}}async _resolveEdit(e){const t=this.layer,r=e.historicMoment?.getTime()??null,s="layerId"in t&&e.editedFeatures?.find(e=>e.layerId===t.layerId);if(s&&this._canEditByFeature(s)){const{adds:e,deletes:t,updates:i}=s.editedFeatures,a=this.layer.objectIdField,o=i.map(e=>e.current),n=t.map(e=>"attributes"in e?{objectId:a?e.attributes[a]:null}:e),l=await this._resolveIdenifiers(n);return this._resolveOverrides({added:e,updated:o,removed:l,historicMoment:r,isWeak:!0,release:[]})}const[i,a,o]=await Promise.all([this._resolveIdenifiers(e.addedFeatures),this._resolveIdenifiers(e.updatedFeatures),this._resolveIdenifiers(e.deletedFeatures)]);return{type:"override-by-id",updates:[...i,...a],removed:o,historicMoment:r,isWeak:!0}}_canEditByFeature(e){const{adds:t,updates:r}=e.editedFeatures;return t.every(e=>this.view.spatialReference.equals(e.geometry?.spatialReference))&&r.every(e=>this.view.spatialReference.equals(e.current.geometry?.spatialReference))}async updateSchemaStart(){const e=this.layer;"featureReduction"in e&&e.featureReduction&&e.featureReduction!==this._lastFeatureReduction&&(e.featureReduction=e.featureReduction?.clone(),this._lastFeatureReduction=e.featureReduction);try{if(await Promise.allSettled([this._handleChange(),k(e)]),this.destroyed||!this.layerAdapter?.hasRequiredSupport||!this._subscriptions)return null;const t=this.featureContainer.updateStart("subtype-group"===e.type);this._lastFeatureEffect=this.featureEffect;const r={store:t,cimAnalyzer:this.view.stage.cimAnalyzer,cimResourceManager:this.view.stage.painter.textureManager.resourceManager,scaleExpression:void 0,viewRotation:this._stationaryRotation},s=await this._createViewSchemaConfig(),i={source:await this.layerAdapter.createSourceSchema(s,this._sourceRefreshVersion),processor:await this.layerAdapter.createProcessorSchema(r,s,this._displayRefreshVersion)};return c(this._lastSchema?.source.strategy,i.source.strategy)||c(this._lastSchema?.processor,i.processor)?(this._lastSchema=i,this._fields=null,i):null}catch(t){}return null}async updateSchemaEnd(e){try{this.featureEffectView.featureEffect=this._lastFeatureEffect,e&&this.featureEffectView.endTransition(),await this.featureContainer.updateEnd(this._lastSchema.processor,this.layerAdapter.getLabelingDeconflictionInfo(),e),has("esri-2d-update-debug")&&console.debug("FeatureLayerView2D.updateEnd")}catch(t){}}async _doUpdate(){const e=Math.round(performance.now()),t=await this.getWorker();await t.pipeline.updateSchema(e),this.requestUpdate()}async _doOverride(e){const t=await this.getWorker();try{let r=new oe;for(const s of e.messages)switch(s.type){case"edit":r.tryAdd(await this._resolveEdit(s.event))||(await t.pipeline.onOverride(r.toMessage()),r=new oe,r.tryAdd(await this._resolveEdit(s.event)));break;case"override":r.tryAdd(this._resolveOverrides(s.options))||(await t.pipeline.onOverride(r.toMessage()),r=new oe,r.tryAdd(this._resolveOverrides(s.options)));break}await t.pipeline.onOverride(r.toMessage())}catch(r){m(r),0}}_getEffectiveAvailableFields(e){const t=fe(this._lastAvailableFields,e);return this._lastAvailableFields=t,U(this.layer.fieldsIndex,t)}async _createViewSchemaConfig(){const e=this.requiresCurrentUser?await this.signedInUser:null,t=x(this.view,this.layerAdapter,this.timeExtent,this._visibilityOverrides,this.filter,this.effectiveDisplayFilterClause),r=this.featureEffect?.filter?.toJSON()??null,s=this._getHighlightFilterGroups().map(({order:e,filters:t})=>({order:e,filters:t.map(e=>e.toJSON())})),i=le({layerFilter:t,effectFilter:r,highlightFilters:s});return{availableFields:this._getEffectiveAvailableFields(this.availableFields),displayFilterEnabled:this.displayFilterEnabled,filters:i,scale:this.view.scale,timeZone:this.view.timeZone,timeExtent:this.view.timeExtent,currentUser:e,spatialReference:this.view.spatialReference,extent:this.view.extent,returnZ:this.hasZ,returnM:this.hasM}}_onHighlightChange(){this._commandsQueue.push({type:"update"})}_setOriginForFeature(e){e.layer=e.sourceLayer=this.layer,this.layerAdapter.setGraphicOrigin(e)}_createFeatureGraphicHit(e,t){return this._setOriginForFeature(t),this._createGraphicHit(e,t)}_createTrackGraphicHit(e,t){return t.layer=t.sourceLayer=this.layer,this.layerAdapter.setTrackGraphicOrigin?.(t),this._createGraphicHit(e,t)}_createAggregateGraphicHit(e,t){return t.layer=t.sourceLayer=this.layer,this.layerAdapter.setAggregateGraphicOrigin?.(t),this._createGraphicHit(e,t)}_createGraphicHit(e,t){return null!=t.geometry&&(t.geometry.spatialReference=this.view.spatialReference),{type:"graphic",graphic:t,layer:this.layer,mapPoint:e}}};function x(e,t,r,s,i,a){i&&(i=i.clone());const o=null!=i?i.timeExtent:null,n=null!=r&&null!=o?r.intersection(o):r||o;n&&(i??=new O,i.timeExtent=n),i=t.addFilters?.(i,e)??i,a&&(i??=new O,i.where=w(i.where,a));let l=i?.toJSON()??null;return s.size&&(l??=(new O).toJSON(),l.hiddenIds=Array.from(s)),l}return e([_()],v.prototype,"_commandsQueue",void 0),e([_()],v.prototype,"_sourceRefreshVersion",void 0),e([_()],v.prototype,"_displayRefreshVersion",void 0),e([_({readOnly:!0})],v.prototype,"_pipelineUpdating",void 0),e([_()],v.prototype,"_sourceUpdating",void 0),e([_({readOnly:!0})],v.prototype,"dataUpdating",null),e([_({readOnly:!0})],v.prototype,"hasAllFeatures",null),e([_({readOnly:!0})],v.prototype,"hasAllFeaturesInView",null),e([_({readOnly:!0})],v.prototype,"hasFullGeometries",null),e([_()],v.prototype,"featureEffectView",void 0),e([_()],v.prototype,"layerAdapter",null),e([_({readOnly:!0})],v.prototype,"timeExtent",null),v=e([b("esri.views.2d.layers.FeatureLikeLayerView2D")],v),v};export{_e as FeatureLikeLayerView2D};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as i}from"tslib";import e from"../../../Graphic.js";import{isSome as r}from"../../../core/arrayUtils.js";import t from"../../../core/Collection.js";import{makeHandle as s}from"../../../core/handleUtils.js";import{destroyMaybe as h}from"../../../core/maybe.js";import{when as a}from"../../../core/reactiveUtils.js";import{isScreenRect as p}from"../../../core/screenUtils.js";import{property as o,subclass as c}from"../../../core/accessorSupport/decorators.js";import{LayerView2D as l}from"./LayerView2D.js";import g from"./graphics/GraphicContainer.js";import n from"./graphics/GraphicsView2D.js";import m from"../../layers/GraphicsLayerView.js";import{getHighlightName as d}from"../../support/highlightOptionsUtils.js";let w=class extends(l(m)){attach(){this.graphicsView=new n({requestUpdateCallback:()=>this.requestUpdate(),view:this.view,graphics:this.layer.graphics,container:new g(this.view.featuresTilingScheme),layerId:this.layer.id}),this.container.addChild(this.graphicsView.container),this.addAttachHandles([this.layer.on("graphic-update",this.graphicsView.graphicUpdateHandler),a(()=>this.layer?.visible,()=>{this.graphicsView.update({state:this.view.state}),this.graphicsView.pushUpdate()})]),this._processHighlight()}detach(){this.container.removeAllChildren(),this.graphicsView=h(this.graphicsView)}async hitTest(i,e){return this.graphicsView?this.graphicsView.hitTest(this.view,e).map(r=>({type:"graphic",graphic:r,mapPoint:p(e)?null:i,layer:this.layer})):null}queryGraphics(){return Promise.resolve(this.graphicsView.graphics)}update(i){this.graphicsView.processUpdate(i)}viewChange(){this.graphicsView.viewChange()}moveEnd(){}isUpdating(){return!this.graphicsView||this.graphicsView.updating}highlight(i,h){let a;"number"==typeof i?a=[i]:i instanceof e?a=[i.uid]:Array.isArray(i)&&i.length>0?a="number"==typeof i[0]?i:i.map(i=>i&&i.uid):t.isCollection(i)&&i.length>0&&(a=i.map(i=>i&&i.uid).toArray());const p=a?.filter(r);if(!p?.length)return s();const o=d(h);return this._addHighlights(p,o),s(()=>!this.destroyed&&this._removeHighlights(p,o))}_processHighlight(){const i=this._getHighlights();this.graphicsView?.setHighlight(i)}};i([o()],w.prototype,"graphicsView",void 0),w=i([c("esri.views.2d.layers.GraphicsLayerView2D")],w);const u=w;export{u as default};
2
+ import{__decorate as i}from"tslib";import e from"../../../Graphic.js";import{isSome as r}from"../../../core/arrayUtils.js";import t from"../../../core/Collection.js";import{makeHandle as s}from"../../../core/handleUtils.js";import{destroyMaybe as h}from"../../../core/maybe.js";import{when as a}from"../../../core/reactiveUtils.js";import{isScreenRect as o}from"../../../core/screenUtils.js";import{property as p,subclass as c}from"../../../core/accessorSupport/decorators.js";import l from"../../../layers/support/FeatureFilter.js";import{LayerView2D as n}from"./LayerView2D.js";import g from"./graphics/GraphicContainer.js";import m from"./graphics/GraphicsView2D.js";import d from"../../layers/GraphicsLayerView.js";import{getHighlightName as w}from"../../support/highlightOptionsUtils.js";let u=class extends(n(d)){attach(){this.graphicsView=new m({requestUpdateCallback:()=>this.requestUpdate(),view:this.view,graphics:this.layer.graphics,container:new g(this.view.featuresTilingScheme),layerId:this.layer.id}),this.container.addChild(this.graphicsView.container),this.addAttachHandles([this.layer.on("graphic-update",this.graphicsView.graphicUpdateHandler),a(()=>this.layer?.visible,()=>{this.graphicsView.update({state:this.view.state}),this.graphicsView.pushUpdate()})]),this._onHighlightChange()}detach(){this.container.removeAllChildren(),this.graphicsView=h(this.graphicsView)}async hitTest(i,e){return this.graphicsView?this.graphicsView.hitTest(this.view,e).map(r=>({type:"graphic",graphic:r,mapPoint:o(e)?null:i,layer:this.layer})):null}queryGraphics(){return Promise.resolve(this.graphicsView.graphics)}update(i){this.graphicsView.processUpdate(i)}viewChange(){this.graphicsView.viewChange()}moveEnd(){}isUpdating(){return!this.graphicsView||this.graphicsView.updating}highlight(i,h){let a;"number"==typeof i?a=[i]:i instanceof e?a=[i.uid]:Array.isArray(i)&&i.length>0?a="number"==typeof i[0]?i:i.map(i=>i&&i.uid):t.isCollection(i)&&i.length>0&&(a=i.map(i=>i&&i.uid).toArray());const o=a?.filter(r);if(!o?.length)return s();const p=w(h),c=this._addHighlightFilter(new l({objectIds:o}),p);return s(()=>!this.destroyed&&this._removeHighlight(c))}_onHighlightChange(){const i=this._getHighlightFilterGroups();this.graphicsView?.setHighlightFilters(i)}};i([p()],u.prototype,"graphicsView",void 0),u=i([c("esri.views.2d.layers.GraphicsLayerView2D")],u);const y=u;export{y as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as t}from"tslib";import i from"../../../Graphic.js";import{isSome as e}from"../../../core/arrayUtils.js";import s from"../../../core/Collection.js";import{makeHandle as r}from"../../../core/handleUtils.js";import"../../../core/has.js";import{QueueProcessor as h}from"../../../core/QueueProcessor.js";import{watch as a,sync as o}from"../../../core/reactiveUtils.js";import{isScreenRect as n}from"../../../core/screenUtils.js";import{property as l,subclass as g}from"../../../core/accessorSupport/decorators.js";import{convertGeometryToMask as p}from"../../../layers/raster/functions/clipUtils.js";import{GraphicsCollection as c}from"../../../support/GraphicsCollection.js";import d from"../engine/flow/FlowView2D.js";import{LayerView2D as u}from"./LayerView2D.js";import m from"./graphics/GraphicsView2D.js";import w from"./graphics/HighlightGraphicContainer.js";import y from"./imagery/ImageryView2D.js";import f from"./imagery/VectorFieldView2D.js";import v from"../../layers/ImageryLayerView.js";import{RefreshableLayerView as _}from"../../layers/RefreshableLayerView.js";import{isPixelHighlightTarget as b,isEmptyPixelRanges as x}from"../../layers/support/highlightUtils.js";import{defaultColor as H}from"../../support/HighlightDefaults.js";import{getHighlightName as V}from"../../support/highlightOptionsUtils.js";let j=class extends(_(u(v))){constructor(){super(...arguments),this._exportImageVersion=-1,this._highlightGraphics=new c,this._highlightView=void 0,this._pixelHighlights=[],this.layer=null,this.subview=null}get pixelData(){const{subview:t}=this;return this.updating||!t?null:"getPixelData"in t?t.getPixelData():null}update(t){this.subview?.update(t)}attach(){this.layer.increaseRasterJobHandlerUsage(),this._setSubView(),this.view&&(this._highlightView=new m({view:this.view,graphics:this._highlightGraphics,requestUpdateCallback:()=>this.requestUpdate(),container:new w(this.view.featuresTilingScheme)}),this.container.addChild(this._highlightView.container)),this.addAttachHandles([a(()=>this.layer.exportImageServiceParameters.version,t=>{t&&this._exportImageVersion!==t&&(this._exportImageVersion=t,this.requestUpdate())},o),a(()=>this.timeExtent,t=>{const{subview:i}=this;i&&(i.timeExtent=t,"redraw"in i?this.requestUpdate():i.redrawOrRefetch())},o),this.layer.on("redraw",()=>{const{subview:t}=this;t&&("redraw"in t?t.redraw():t.redrawOrRefetch())}),a(()=>this.layer.renderer,()=>this._setSubView()),a(()=>this.view?.highlights.items.map(({name:t,color:i})=>({name:t,color:i})),()=>this._updateHighlightOptions(this.subview))])}detach(){this.layer.decreaseRasterJobHandlerUsage(),this.container.removeAllChildren(),this._detachSubview(this.subview),this.subview?.destroy(),this.subview=null,this._highlightView?.destroy(),this._exportImageVersion=-1}viewChange(){}moveEnd(){this.requestUpdate()}async hitTest(t,i){const{layer:e,subview:s}=this;if(!e.loaded||!this.attached||!s?.attached)return null;n(i)&&(t=this.view.toMap({x:i.x+i.width/2,y:i.y+i.height/2}));const r=await s.hitTest(t);return null==r?null:[{type:"raster",layer:e,mapPoint:t,...r}]}highlight(t,h){if(b(t))return x(t)?r():this._highlightPixels(t,h);if("number"==typeof t||"string"==typeof t)return this._highlightByImageIds([t],h);const a=Array.isArray(t)||s.isCollection(t)?t.at(0):t;if("number"==typeof a||"string"==typeof a)return this._highlightByImageIds(t,h);if(!(a instanceof i))return r();let o=[];Array.isArray(t)||s.isCollection(t)?o=t.map(t=>t.clone()):t instanceof i&&(o=[t.clone()]);const n=o?.filter(e);if(!n?.length)return r();const l=V(h);return this._addHighlightGraphics(o,l),r(()=>!this.destroyed&&this._removeHighlightGraphics(o,l))}_highlightByImageIds(t,i){const e=V(i),s=new AbortController,{signal:a}=s,o=this.layer.sourceJSON.maxRecordCount??1e3,n=Math.ceil(t.length/o),l=[],g=[],p=new h({concurrency:4,process:t=>this.layer.queryFeatures({objectIds:t.ids,returnGeometry:!0,outSpatialReference:this.view.spatialReference},{signal:a}).then(t=>g.push(...t.features)).catch(()=>{})});for(let r=0;r<n;r++)l.push(p.push({ids:t.slice(r*o,(r+1)*o)}));return Promise.allSettled(l).then(()=>{g.length&&!a.aborted&&(this._addHighlightGraphics(g,e),a.addEventListener("abort",()=>{this._removeHighlightGraphics(g,e)}))}),r(()=>s.abort())}_highlightPixels(t,i){const e={target:t,options:i};return this._pixelHighlights.push(e),this._updateHighlightOptions(this.subview),r(()=>{const t=this._pixelHighlights.indexOf(e);t>-1&&(this._pixelHighlights.splice(t,1),this._updateHighlightOptions(this.subview))})}_addHighlightGraphics(t,i){this._highlightGraphics.addMany(t),this._addHighlights(t.map(t=>t.uid),i)}_removeHighlightGraphics(t,i){this._highlightGraphics.removeMany(t),this._removeHighlights(t.map(t=>t.uid),i)}async doRefresh(){this.requestUpdate()}isUpdating(){return!this.subview||this.subview.updating||!!this._highlightView?.updating}_processHighlight(){const t=this._getHighlights();this._highlightView?.setHighlight(t)}_setSubView(){if(!this.view)return;const t=this.layer.renderer?.type;let i="imagery";if("vector-field"===t?i="imageryVF":"flow"===t&&(i="flow"),this.subview){const{type:t}=this.subview;if(t===i)return this._attachSubview(this.subview),void("flow"===t?this.subview.redrawOrRefetch():"imagery"===t&&"lerc"===this.layer.format?this.subview.redraw():this.requestUpdate());this._detachSubview(this.subview),this.subview?.destroy()}"imagery"===i?(this.subview=new y({layer:this.layer,view:this.view,timeExtent:this.timeExtent,updatingHandles:this._updatingHandles}),this._updateHighlightOptions(this.subview)):this.subview="imageryVF"===i?new f({layer:this.layer,view:this.view,timeExtent:this.timeExtent}):new d({layer:this.layer,layerView:this}),this._attachSubview(this.subview),this.requestUpdate()}_attachSubview(t){t&&!t.attached&&(t.attach(),t.attached=!0,this.container.addChildAt(t.container,0))}_detachSubview(t){t?.attached&&(this.container.removeChild(t.container),t.detach(),t.attached=!1)}_updateHighlightOptions(t){const i=this.view.highlights;this._pixelHighlights.sort((t,e)=>i.findIndex(({name:t})=>t===V(e.options))-i.findIndex(({name:i})=>i===V(t.options)));const s=this._pixelHighlights.map(({target:t,options:e})=>I(t,i,e)).filter(e);"imagery"===t?.type&&(t.pixelHighlights=s,t.attached&&("lerc"===this.layer.format?t.redraw():this.requestUpdate()))}};function I(t,i,e){const s=V(e),r=(i.find(t=>t.name===s)?.color??H).toArray(),{pixelRanges:h}=t;if(Array.isArray(h))return{ranges:h,bandId:t.bandId??0,color:r};const a="extent"===h.type?h:h.extent;if(!a)return;const o=[a.xmin,a.xmax],n=[a.ymin,a.ymax],{xBandId:l,yBandId:g}=t,c=1024,d=1024;return{xBandId:l,yBandId:g,xBandRange:o,yBandRange:n,color:r,width:c,height:d,xyMask:"polygon"===h.type?p({srcExtent:a,geometry:h,size:[c,d]}):void 0}}t([l()],j.prototype,"pixelData",null),t([l()],j.prototype,"subview",void 0),j=t([g("esri.views.2d.layers.ImageryLayerView2D")],j);const U=j;export{U as default};
2
+ import{__decorate as t}from"tslib";import i from"../../../Graphic.js";import{isSome as e}from"../../../core/arrayUtils.js";import s from"../../../core/Collection.js";import{makeHandle as r}from"../../../core/handleUtils.js";import"../../../core/has.js";import{QueueProcessor as h}from"../../../core/QueueProcessor.js";import{watch as a,sync as o}from"../../../core/reactiveUtils.js";import{isScreenRect as n}from"../../../core/screenUtils.js";import{property as l,subclass as g}from"../../../core/accessorSupport/decorators.js";import{convertGeometryToMask as p}from"../../../layers/raster/functions/clipUtils.js";import c from"../../../layers/support/FeatureFilter.js";import{GraphicsCollection as d}from"../../../support/GraphicsCollection.js";import u from"../engine/flow/FlowView2D.js";import{LayerView2D as m}from"./LayerView2D.js";import w from"./graphics/GraphicsView2D.js";import y from"./graphics/HighlightGraphicContainer.js";import f from"./imagery/ImageryView2D.js";import v from"./imagery/VectorFieldView2D.js";import b from"../../layers/ImageryLayerView.js";import{RefreshableLayerView as _}from"../../layers/RefreshableLayerView.js";import{isPixelHighlightTarget as x,isEmptyPixelRanges as H}from"../../layers/support/highlightUtils.js";import{defaultColor as j}from"../../support/HighlightDefaults.js";import{getHighlightName as V}from"../../support/highlightOptionsUtils.js";let I=class extends(_(m(b))){constructor(){super(...arguments),this._exportImageVersion=-1,this._highlightGraphics=new d,this._highlightView=void 0,this._pixelHighlights=[],this.layer=null,this.subview=null}get pixelData(){const{subview:t}=this;return this.updating||!t?null:"getPixelData"in t?t.getPixelData():null}update(t){this.subview?.update(t)}attach(){this.layer.increaseRasterJobHandlerUsage(),this._setSubView(),this.view&&(this._highlightView=new w({view:this.view,graphics:this._highlightGraphics,requestUpdateCallback:()=>this.requestUpdate(),container:new y(this.view.featuresTilingScheme)}),this.container.addChild(this._highlightView.container)),this.addAttachHandles([a(()=>this.layer.exportImageServiceParameters.version,t=>{t&&this._exportImageVersion!==t&&(this._exportImageVersion=t,this.requestUpdate())},o),a(()=>this.timeExtent,t=>{const{subview:i}=this;i&&(i.timeExtent=t,"redraw"in i?this.requestUpdate():i.redrawOrRefetch())},o),this.layer.on("redraw",()=>{const{subview:t}=this;t&&("redraw"in t?t.redraw():t.redrawOrRefetch())}),a(()=>this.layer.renderer,()=>this._setSubView()),a(()=>this.view?.highlights.items.map(({name:t,color:i})=>({name:t,color:i})),()=>this._updateHighlightOptions(this.subview))])}detach(){this.layer.decreaseRasterJobHandlerUsage(),this.container.removeAllChildren(),this._detachSubview(this.subview),this.subview?.destroy(),this.subview=null,this._highlightView?.destroy(),this._exportImageVersion=-1}viewChange(){}moveEnd(){this.requestUpdate()}async hitTest(t,i){const{layer:e,subview:s}=this;if(!e.loaded||!this.attached||!s?.attached)return null;n(i)&&(t=this.view.toMap({x:i.x+i.width/2,y:i.y+i.height/2}));const r=await s.hitTest(t);return null==r?null:[{type:"raster",layer:e,mapPoint:t,...r}]}highlight(t,h){if(x(t))return H(t)?r():this._highlightPixels(t,h);if("number"==typeof t||"string"==typeof t)return this._highlightByImageIds([t],h);const a=Array.isArray(t)||s.isCollection(t)?t.at(0):t;if("number"==typeof a||"string"==typeof a)return this._highlightByImageIds(t,h);if(!(a instanceof i))return r();let o=[];Array.isArray(t)||s.isCollection(t)?o=t.map(t=>t.clone()):t instanceof i&&(o=[t.clone()]);const n=o?.filter(e);if(!n?.length)return r();const l=V(h),g=this._addHighlightGraphics(o,l);return r(()=>!this.destroyed&&this._removeHighlightGraphics(o,g))}_highlightByImageIds(t,i){const e=V(i),s=new AbortController,{signal:a}=s,o=this.layer.sourceJSON.maxRecordCount??1e3,n=Math.ceil(t.length/o),l=[],g=[],p=new h({concurrency:4,process:t=>this.layer.queryFeatures({objectIds:t.ids,returnGeometry:!0,outSpatialReference:this.view.spatialReference},{signal:a}).then(t=>g.push(...t.features)).catch(()=>{})});for(let r=0;r<n;r++)l.push(p.push({ids:t.slice(r*o,(r+1)*o)}));return Promise.allSettled(l).then(()=>{if(g.length&&!a.aborted){const t=this._addHighlightGraphics(g,e);a.addEventListener("abort",()=>{this._removeHighlightGraphics(g,t)})}}),r(()=>s.abort())}_highlightPixels(t,i){const e={target:t,options:i};return this._pixelHighlights.push(e),this._updateHighlightOptions(this.subview),r(()=>{const t=this._pixelHighlights.indexOf(e);t>-1&&(this._pixelHighlights.splice(t,1),this._updateHighlightOptions(this.subview))})}_addHighlightGraphics(t,i){return this._highlightGraphics.addMany(t),this._addHighlightFilter(new c({objectIds:t.map(t=>t.uid)}),i)}_removeHighlightGraphics(t,i){this._highlightGraphics.removeMany(t),this._removeHighlight(i)}async doRefresh(){this.requestUpdate()}isUpdating(){return!this.subview||this.subview.updating||!!this._highlightView?.updating}_onHighlightChange(){const t=this._getHighlightFilterGroups();this._highlightView?.setHighlightFilters(t)}_setSubView(){if(!this.view)return;const t=this.layer.renderer?.type;let i="imagery";if("vector-field"===t?i="imageryVF":"flow"===t&&(i="flow"),this.subview){const{type:t}=this.subview;if(t===i)return this._attachSubview(this.subview),void("flow"===t?this.subview.redrawOrRefetch():"imagery"===t&&"lerc"===this.layer.format?this.subview.redraw():this.requestUpdate());this._detachSubview(this.subview),this.subview?.destroy()}"imagery"===i?(this.subview=new f({layer:this.layer,view:this.view,timeExtent:this.timeExtent,updatingHandles:this._updatingHandles}),this._updateHighlightOptions(this.subview)):this.subview="imageryVF"===i?new v({layer:this.layer,view:this.view,timeExtent:this.timeExtent}):new u({layer:this.layer,layerView:this}),this._attachSubview(this.subview),this.requestUpdate()}_attachSubview(t){t&&!t.attached&&(t.attach(),t.attached=!0,this.container.addChildAt(t.container,0))}_detachSubview(t){t?.attached&&(this.container.removeChild(t.container),t.detach(),t.attached=!1)}_updateHighlightOptions(t){const i=this.view.highlights;this._pixelHighlights.sort((t,e)=>i.findIndex(({name:t})=>t===V(e.options))-i.findIndex(({name:i})=>i===V(t.options)));const s=this._pixelHighlights.map(({target:t,options:e})=>U(t,i,e)).filter(e);"imagery"===t?.type&&(t.pixelHighlights=s,t.attached&&("lerc"===this.layer.format?t.redraw():this.requestUpdate()))}};function U(t,i,e){const s=V(e),r=(i.find(t=>t.name===s)?.color??j).toArray(),{pixelRanges:h}=t;if(Array.isArray(h))return{ranges:h,bandId:t.bandId??0,color:r};const a="extent"===h.type?h:h.extent;if(!a)return;const o=[a.xmin,a.xmax],n=[a.ymin,a.ymax],{xBandId:l,yBandId:g}=t,c=1024,d=1024;return{xBandId:l,yBandId:g,xBandRange:o,yBandRange:n,color:r,width:c,height:d,xyMask:"polygon"===h.type?p({srcExtent:a,geometry:h,size:[c,d]}):void 0}}t([l()],I.prototype,"pixelData",null),t([l()],I.prototype,"subview",void 0),I=t([g("esri.views.2d.layers.ImageryLayerView2D")],I);const G=I;export{G as default};