@arcgis/core 4.34.0-next.87 → 4.34.0-next.88

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 (293) hide show
  1. package/assets/components/assets/accordion-item/t9n/messages.ar.json +1 -1
  2. package/assets/components/assets/accordion-item/t9n/messages.bg.json +1 -1
  3. package/assets/components/assets/accordion-item/t9n/messages.bs.json +1 -1
  4. package/assets/components/assets/accordion-item/t9n/messages.ca.json +1 -1
  5. package/assets/components/assets/accordion-item/t9n/messages.cs.json +1 -1
  6. package/assets/components/assets/accordion-item/t9n/messages.da.json +1 -1
  7. package/assets/components/assets/accordion-item/t9n/messages.de.json +1 -1
  8. package/assets/components/assets/accordion-item/t9n/messages.el.json +1 -1
  9. package/assets/components/assets/accordion-item/t9n/messages.es.json +1 -1
  10. package/assets/components/assets/accordion-item/t9n/messages.et.json +1 -1
  11. package/assets/components/assets/accordion-item/t9n/messages.fi.json +1 -1
  12. package/assets/components/assets/accordion-item/t9n/messages.fr.json +1 -1
  13. package/assets/components/assets/accordion-item/t9n/messages.he.json +1 -1
  14. package/assets/components/assets/accordion-item/t9n/messages.hr.json +1 -1
  15. package/assets/components/assets/accordion-item/t9n/messages.hu.json +1 -1
  16. package/assets/components/assets/accordion-item/t9n/messages.id.json +1 -1
  17. package/assets/components/assets/accordion-item/t9n/messages.it.json +1 -1
  18. package/assets/components/assets/accordion-item/t9n/messages.ja.json +1 -1
  19. package/assets/components/assets/accordion-item/t9n/messages.ko.json +1 -1
  20. package/assets/components/assets/accordion-item/t9n/messages.lt.json +1 -1
  21. package/assets/components/assets/accordion-item/t9n/messages.lv.json +1 -1
  22. package/assets/components/assets/accordion-item/t9n/messages.nl.json +1 -1
  23. package/assets/components/assets/accordion-item/t9n/messages.no.json +1 -1
  24. package/assets/components/assets/accordion-item/t9n/messages.pl.json +1 -1
  25. package/assets/components/assets/accordion-item/t9n/messages.pt-BR.json +1 -1
  26. package/assets/components/assets/accordion-item/t9n/messages.pt-PT.json +1 -1
  27. package/assets/components/assets/accordion-item/t9n/messages.ro.json +1 -1
  28. package/assets/components/assets/accordion-item/t9n/messages.ru.json +1 -1
  29. package/assets/components/assets/accordion-item/t9n/messages.sk.json +1 -1
  30. package/assets/components/assets/accordion-item/t9n/messages.sl.json +1 -1
  31. package/assets/components/assets/accordion-item/t9n/messages.sr.json +1 -1
  32. package/assets/components/assets/accordion-item/t9n/messages.sv.json +1 -1
  33. package/assets/components/assets/accordion-item/t9n/messages.th.json +1 -1
  34. package/assets/components/assets/accordion-item/t9n/messages.tr.json +1 -1
  35. package/assets/components/assets/accordion-item/t9n/messages.uk.json +1 -1
  36. package/assets/components/assets/accordion-item/t9n/messages.vi.json +1 -1
  37. package/assets/components/assets/accordion-item/t9n/messages.zh-CN.json +1 -1
  38. package/assets/components/assets/accordion-item/t9n/messages.zh-HK.json +1 -1
  39. package/assets/components/assets/accordion-item/t9n/messages.zh-TW.json +1 -1
  40. package/assets/components/assets/action-bar/t9n/messages.ar.json +1 -1
  41. package/assets/components/assets/action-bar/t9n/messages.bg.json +1 -1
  42. package/assets/components/assets/action-bar/t9n/messages.bs.json +1 -1
  43. package/assets/components/assets/action-bar/t9n/messages.ca.json +1 -1
  44. package/assets/components/assets/action-bar/t9n/messages.cs.json +1 -1
  45. package/assets/components/assets/action-bar/t9n/messages.da.json +1 -1
  46. package/assets/components/assets/action-bar/t9n/messages.de.json +1 -1
  47. package/assets/components/assets/action-bar/t9n/messages.el.json +1 -1
  48. package/assets/components/assets/action-bar/t9n/messages.es.json +1 -1
  49. package/assets/components/assets/action-bar/t9n/messages.et.json +1 -1
  50. package/assets/components/assets/action-bar/t9n/messages.fi.json +1 -1
  51. package/assets/components/assets/action-bar/t9n/messages.fr.json +1 -1
  52. package/assets/components/assets/action-bar/t9n/messages.he.json +1 -1
  53. package/assets/components/assets/action-bar/t9n/messages.hr.json +1 -1
  54. package/assets/components/assets/action-bar/t9n/messages.hu.json +1 -1
  55. package/assets/components/assets/action-bar/t9n/messages.id.json +1 -1
  56. package/assets/components/assets/action-bar/t9n/messages.it.json +1 -1
  57. package/assets/components/assets/action-bar/t9n/messages.ja.json +1 -1
  58. package/assets/components/assets/action-bar/t9n/messages.ko.json +1 -1
  59. package/assets/components/assets/action-bar/t9n/messages.lt.json +1 -1
  60. package/assets/components/assets/action-bar/t9n/messages.lv.json +1 -1
  61. package/assets/components/assets/action-bar/t9n/messages.nl.json +1 -1
  62. package/assets/components/assets/action-bar/t9n/messages.no.json +1 -1
  63. package/assets/components/assets/action-bar/t9n/messages.pl.json +1 -1
  64. package/assets/components/assets/action-bar/t9n/messages.pt-BR.json +1 -1
  65. package/assets/components/assets/action-bar/t9n/messages.pt-PT.json +1 -1
  66. package/assets/components/assets/action-bar/t9n/messages.ro.json +1 -1
  67. package/assets/components/assets/action-bar/t9n/messages.ru.json +1 -1
  68. package/assets/components/assets/action-bar/t9n/messages.sk.json +1 -1
  69. package/assets/components/assets/action-bar/t9n/messages.sl.json +1 -1
  70. package/assets/components/assets/action-bar/t9n/messages.sr.json +1 -1
  71. package/assets/components/assets/action-bar/t9n/messages.sv.json +1 -1
  72. package/assets/components/assets/action-bar/t9n/messages.th.json +1 -1
  73. package/assets/components/assets/action-bar/t9n/messages.tr.json +1 -1
  74. package/assets/components/assets/action-bar/t9n/messages.uk.json +1 -1
  75. package/assets/components/assets/action-bar/t9n/messages.vi.json +1 -1
  76. package/assets/components/assets/action-bar/t9n/messages.zh-CN.json +1 -1
  77. package/assets/components/assets/action-bar/t9n/messages.zh-HK.json +1 -1
  78. package/assets/components/assets/action-bar/t9n/messages.zh-TW.json +1 -1
  79. package/assets/components/assets/action-pad/t9n/messages.ar.json +1 -1
  80. package/assets/components/assets/action-pad/t9n/messages.bg.json +1 -1
  81. package/assets/components/assets/action-pad/t9n/messages.bs.json +1 -1
  82. package/assets/components/assets/action-pad/t9n/messages.ca.json +1 -1
  83. package/assets/components/assets/action-pad/t9n/messages.cs.json +1 -1
  84. package/assets/components/assets/action-pad/t9n/messages.da.json +1 -1
  85. package/assets/components/assets/action-pad/t9n/messages.de.json +1 -1
  86. package/assets/components/assets/action-pad/t9n/messages.el.json +1 -1
  87. package/assets/components/assets/action-pad/t9n/messages.es.json +1 -1
  88. package/assets/components/assets/action-pad/t9n/messages.et.json +1 -1
  89. package/assets/components/assets/action-pad/t9n/messages.fi.json +1 -1
  90. package/assets/components/assets/action-pad/t9n/messages.fr.json +1 -1
  91. package/assets/components/assets/action-pad/t9n/messages.he.json +1 -1
  92. package/assets/components/assets/action-pad/t9n/messages.hr.json +1 -1
  93. package/assets/components/assets/action-pad/t9n/messages.hu.json +1 -1
  94. package/assets/components/assets/action-pad/t9n/messages.id.json +1 -1
  95. package/assets/components/assets/action-pad/t9n/messages.it.json +1 -1
  96. package/assets/components/assets/action-pad/t9n/messages.ja.json +1 -1
  97. package/assets/components/assets/action-pad/t9n/messages.ko.json +1 -1
  98. package/assets/components/assets/action-pad/t9n/messages.lt.json +1 -1
  99. package/assets/components/assets/action-pad/t9n/messages.lv.json +1 -1
  100. package/assets/components/assets/action-pad/t9n/messages.nl.json +1 -1
  101. package/assets/components/assets/action-pad/t9n/messages.no.json +1 -1
  102. package/assets/components/assets/action-pad/t9n/messages.pl.json +1 -1
  103. package/assets/components/assets/action-pad/t9n/messages.pt-BR.json +1 -1
  104. package/assets/components/assets/action-pad/t9n/messages.pt-PT.json +1 -1
  105. package/assets/components/assets/action-pad/t9n/messages.ro.json +1 -1
  106. package/assets/components/assets/action-pad/t9n/messages.ru.json +1 -1
  107. package/assets/components/assets/action-pad/t9n/messages.sk.json +1 -1
  108. package/assets/components/assets/action-pad/t9n/messages.sl.json +1 -1
  109. package/assets/components/assets/action-pad/t9n/messages.sr.json +1 -1
  110. package/assets/components/assets/action-pad/t9n/messages.sv.json +1 -1
  111. package/assets/components/assets/action-pad/t9n/messages.th.json +1 -1
  112. package/assets/components/assets/action-pad/t9n/messages.tr.json +1 -1
  113. package/assets/components/assets/action-pad/t9n/messages.uk.json +1 -1
  114. package/assets/components/assets/action-pad/t9n/messages.vi.json +1 -1
  115. package/assets/components/assets/action-pad/t9n/messages.zh-CN.json +1 -1
  116. package/assets/components/assets/action-pad/t9n/messages.zh-HK.json +1 -1
  117. package/assets/components/assets/action-pad/t9n/messages.zh-TW.json +1 -1
  118. package/assets/components/assets/icon/layer3D16.json +1 -0
  119. package/assets/components/assets/icon/layer3D24.json +1 -0
  120. package/assets/components/assets/icon/layer3D32.json +1 -0
  121. package/assets/components/assets/sort-handle/t9n/messages.ar.json +1 -1
  122. package/assets/components/assets/sort-handle/t9n/messages.bg.json +1 -1
  123. package/assets/components/assets/sort-handle/t9n/messages.bs.json +1 -1
  124. package/assets/components/assets/sort-handle/t9n/messages.ca.json +1 -1
  125. package/assets/components/assets/sort-handle/t9n/messages.cs.json +1 -1
  126. package/assets/components/assets/sort-handle/t9n/messages.da.json +1 -1
  127. package/assets/components/assets/sort-handle/t9n/messages.de.json +1 -1
  128. package/assets/components/assets/sort-handle/t9n/messages.el.json +1 -1
  129. package/assets/components/assets/sort-handle/t9n/messages.es.json +1 -1
  130. package/assets/components/assets/sort-handle/t9n/messages.et.json +1 -1
  131. package/assets/components/assets/sort-handle/t9n/messages.fi.json +1 -1
  132. package/assets/components/assets/sort-handle/t9n/messages.fr.json +1 -1
  133. package/assets/components/assets/sort-handle/t9n/messages.he.json +1 -1
  134. package/assets/components/assets/sort-handle/t9n/messages.hr.json +1 -1
  135. package/assets/components/assets/sort-handle/t9n/messages.hu.json +1 -1
  136. package/assets/components/assets/sort-handle/t9n/messages.id.json +1 -1
  137. package/assets/components/assets/sort-handle/t9n/messages.it.json +1 -1
  138. package/assets/components/assets/sort-handle/t9n/messages.ja.json +1 -1
  139. package/assets/components/assets/sort-handle/t9n/messages.ko.json +1 -1
  140. package/assets/components/assets/sort-handle/t9n/messages.lt.json +1 -1
  141. package/assets/components/assets/sort-handle/t9n/messages.lv.json +1 -1
  142. package/assets/components/assets/sort-handle/t9n/messages.nl.json +1 -1
  143. package/assets/components/assets/sort-handle/t9n/messages.no.json +1 -1
  144. package/assets/components/assets/sort-handle/t9n/messages.pl.json +1 -1
  145. package/assets/components/assets/sort-handle/t9n/messages.pt-BR.json +1 -1
  146. package/assets/components/assets/sort-handle/t9n/messages.pt-PT.json +1 -1
  147. package/assets/components/assets/sort-handle/t9n/messages.ro.json +1 -1
  148. package/assets/components/assets/sort-handle/t9n/messages.ru.json +1 -1
  149. package/assets/components/assets/sort-handle/t9n/messages.sk.json +1 -1
  150. package/assets/components/assets/sort-handle/t9n/messages.sl.json +1 -1
  151. package/assets/components/assets/sort-handle/t9n/messages.sr.json +1 -1
  152. package/assets/components/assets/sort-handle/t9n/messages.sv.json +1 -1
  153. package/assets/components/assets/sort-handle/t9n/messages.th.json +1 -1
  154. package/assets/components/assets/sort-handle/t9n/messages.tr.json +1 -1
  155. package/assets/components/assets/sort-handle/t9n/messages.uk.json +1 -1
  156. package/assets/components/assets/sort-handle/t9n/messages.vi.json +1 -1
  157. package/assets/components/assets/sort-handle/t9n/messages.zh-CN.json +1 -1
  158. package/assets/components/assets/sort-handle/t9n/messages.zh-HK.json +1 -1
  159. package/assets/components/assets/sort-handle/t9n/messages.zh-TW.json +1 -1
  160. package/assets/esri/core/workers/RemoteClient.js +1 -1
  161. package/assets/esri/core/workers/chunks/{c6d4b8d683a34fc0d111.js → 0103b70126bc5dffc55e.js} +1 -1
  162. package/assets/esri/core/workers/chunks/24921d31efa8d222ad2d.js +2 -0
  163. package/assets/esri/core/workers/chunks/{268f5b233640a9dbbf89.js.LICENSE.txt → 24921d31efa8d222ad2d.js.LICENSE.txt} +1 -1
  164. package/assets/esri/core/workers/chunks/3a457e718a901a45902e.js +2 -0
  165. package/assets/esri/core/workers/chunks/{47e4f66c33bb697fbe6b.js.LICENSE.txt → 3a457e718a901a45902e.js.LICENSE.txt} +1 -1
  166. package/assets/esri/core/workers/chunks/46ef545d2b3b3f4e6d32.js +2 -0
  167. package/assets/esri/core/workers/chunks/{336b54144afec0c7d396.js.LICENSE.txt → 46ef545d2b3b3f4e6d32.js.LICENSE.txt} +1 -1
  168. package/assets/esri/core/workers/chunks/4e77b9cc1d9437bcbb0c.js +1 -0
  169. package/assets/esri/core/workers/chunks/5f0a50ebd2a08b9b9de2.js +1 -0
  170. package/assets/esri/core/workers/chunks/67d9cfe02613cb73ee37.js.LICENSE.txt +1 -1
  171. package/assets/esri/core/workers/chunks/773d106f60f7dad1493d.js +1 -0
  172. package/assets/esri/core/workers/chunks/9ca55d33ae4bf25e8edd.js +1 -0
  173. package/assets/esri/core/workers/chunks/{47e4f66c33bb697fbe6b.js → a8f998b8ec8c56150479.js} +2 -2
  174. package/assets/esri/core/workers/chunks/{f6e18668f728dfd8ba5e.js.LICENSE.txt → a8f998b8ec8c56150479.js.LICENSE.txt} +1 -1
  175. package/assets/esri/core/workers/chunks/a9e133166e9200fe135e.js +1 -0
  176. package/assets/esri/core/workers/chunks/aa78b69219d9a0ef1c54.js.LICENSE.txt +1 -1
  177. package/assets/esri/core/workers/chunks/acb1c5dd987c801d7b31.js +1 -0
  178. package/assets/esri/core/workers/chunks/c1d75c48558ed23c5b2b.js +1 -0
  179. package/assets/esri/core/workers/chunks/{c50e8d5f554cf151865c.js → ce16489cf7eb0d78c741.js} +2 -2
  180. package/assets/esri/core/workers/chunks/{c50e8d5f554cf151865c.js.LICENSE.txt → ce16489cf7eb0d78c741.js.LICENSE.txt} +1 -1
  181. package/assets/esri/core/workers/chunks/d6e0528eacee7ea4c1ce.js.LICENSE.txt +1 -1
  182. package/assets/esri/core/workers/chunks/f651c05604eab83aef5f.js.LICENSE.txt +1 -1
  183. package/assets/esri/themes/dark/main.css +1 -1
  184. package/assets/esri/themes/light/main.css +1 -1
  185. package/assets/esri/themes/light/view.css +1 -1
  186. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_en.json +1 -0
  187. package/assets/esri/widgets/Editor/t9n/Editor_ar.json +1 -1
  188. package/assets/esri/widgets/Editor/t9n/Editor_bg.json +1 -1
  189. package/assets/esri/widgets/Editor/t9n/Editor_bs.json +1 -1
  190. package/assets/esri/widgets/Editor/t9n/Editor_ca.json +1 -1
  191. package/assets/esri/widgets/Editor/t9n/Editor_cs.json +1 -1
  192. package/assets/esri/widgets/Editor/t9n/Editor_da.json +1 -1
  193. package/assets/esri/widgets/Editor/t9n/Editor_de.json +1 -1
  194. package/assets/esri/widgets/Editor/t9n/Editor_el.json +1 -1
  195. package/assets/esri/widgets/Editor/t9n/Editor_es.json +1 -1
  196. package/assets/esri/widgets/Editor/t9n/Editor_et.json +1 -1
  197. package/assets/esri/widgets/Editor/t9n/Editor_fi.json +1 -1
  198. package/assets/esri/widgets/Editor/t9n/Editor_fr.json +1 -1
  199. package/assets/esri/widgets/Editor/t9n/Editor_he.json +1 -1
  200. package/assets/esri/widgets/Editor/t9n/Editor_hr.json +1 -1
  201. package/assets/esri/widgets/Editor/t9n/Editor_hu.json +1 -1
  202. package/assets/esri/widgets/Editor/t9n/Editor_id.json +1 -1
  203. package/assets/esri/widgets/Editor/t9n/Editor_it.json +1 -1
  204. package/assets/esri/widgets/Editor/t9n/Editor_ja.json +1 -1
  205. package/assets/esri/widgets/Editor/t9n/Editor_ko.json +1 -1
  206. package/assets/esri/widgets/Editor/t9n/Editor_lt.json +1 -1
  207. package/assets/esri/widgets/Editor/t9n/Editor_lv.json +1 -1
  208. package/assets/esri/widgets/Editor/t9n/Editor_nl.json +1 -1
  209. package/assets/esri/widgets/Editor/t9n/Editor_no.json +1 -1
  210. package/assets/esri/widgets/Editor/t9n/Editor_pl.json +1 -1
  211. package/assets/esri/widgets/Editor/t9n/Editor_pt-BR.json +1 -1
  212. package/assets/esri/widgets/Editor/t9n/Editor_pt-PT.json +1 -1
  213. package/assets/esri/widgets/Editor/t9n/Editor_ro.json +1 -1
  214. package/assets/esri/widgets/Editor/t9n/Editor_ru.json +1 -1
  215. package/assets/esri/widgets/Editor/t9n/Editor_sk.json +1 -1
  216. package/assets/esri/widgets/Editor/t9n/Editor_sl.json +1 -1
  217. package/assets/esri/widgets/Editor/t9n/Editor_sr.json +1 -1
  218. package/assets/esri/widgets/Editor/t9n/Editor_sv.json +1 -1
  219. package/assets/esri/widgets/Editor/t9n/Editor_th.json +1 -1
  220. package/assets/esri/widgets/Editor/t9n/Editor_tr.json +1 -1
  221. package/assets/esri/widgets/Editor/t9n/Editor_uk.json +1 -1
  222. package/assets/esri/widgets/Editor/t9n/Editor_vi.json +1 -1
  223. package/assets/esri/widgets/Editor/t9n/Editor_zh-CN.json +1 -1
  224. package/assets/esri/widgets/Editor/t9n/Editor_zh-HK.json +1 -1
  225. package/assets/esri/widgets/Editor/t9n/Editor_zh-TW.json +1 -1
  226. package/config.js +1 -1
  227. package/geometry/support/curves/densifyCurvedGeometry.js +1 -1
  228. package/interfaces.d.ts +66 -22
  229. package/kernel.js +1 -1
  230. package/layers/support/BuildingFieldStatistics.js +5 -0
  231. package/layers/support/BuildingSummaryStatistics.js +1 -1
  232. package/layers/support/ControlPoint.js +5 -0
  233. package/layers/support/ControlPointsGeoreference.js +1 -1
  234. package/layers/support/VideoFrame.js +1 -1
  235. package/layers/support/mediaUtils.js +1 -1
  236. package/package.json +2 -2
  237. package/renderers/support/RasterSymbolizer.js +1 -1
  238. package/rest/support/imageMeasureUtils.js +1 -1
  239. package/support/revision.js +1 -1
  240. package/views/2d/analysis/ElevationProfileAnalysisView2D.js +1 -1
  241. package/views/2d/engine/webgl/OverlayMultipoint.js +1 -1
  242. package/views/2d/engine/webgl/shaderGraph/techniques/TextureStatisticsTechnique.js +1 -1
  243. package/views/2d/engine/webgl/shaderGraph/techniques/raster/RasterColorizerTechnique.js +1 -1
  244. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/TextureStatisticsDiffShader.js +1 -1
  245. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/TextureStatisticsMinMaxSumShader.js +1 -1
  246. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/TextureStatisticsStdDevShader.js +1 -1
  247. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/TextureStatisticsSumOfSquaredDiffShader.js +1 -1
  248. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/RasterColorizerStretchShader.js +1 -1
  249. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/math.js +1 -1
  250. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/stretch.js +1 -1
  251. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/utils.js +1 -1
  252. package/views/2d/layers/BaseLayerView2D.js +1 -1
  253. package/views/2d/layers/BaseLayerViewGL2D.js +1 -1
  254. package/views/2d/layers/FeatureLayerView2D.js +1 -1
  255. package/views/3d/analysis/ElevationProfileAnalysisView3D.js +1 -1
  256. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementConfiguration.js +1 -1
  257. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillVisualization.js +1 -1
  258. package/views/3d/analysis/VolumeMeasurementAnalysisView3D.js +1 -1
  259. package/views/3d/layers/GaussianSplatLayerView3D.js +1 -1
  260. package/views/3d/layers/support/MediaLayerInteractionOptions.js +1 -1
  261. package/views/3d/support/QualitySettings.js +1 -1
  262. package/views/analysis/ElevationProfile/ElevationProfileHoveredPointsVisualization.js +1 -1
  263. package/views/draw/input/DrawEvents.js +1 -1
  264. package/views/layers/ImageryTileLayerView.js +1 -1
  265. package/widgets/Editor/AddAssociationWorkflowData.js +1 -1
  266. package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
  267. package/widgets/Editor/EditorViewModel.js +1 -1
  268. package/widgets/Editor/SplitFeatureWorkflow.js +1 -1
  269. package/widgets/Editor/UpdateFeaturesWorkflow.js +1 -1
  270. package/widgets/Editor/UpdateRecordWorkflowData.js +1 -1
  271. package/widgets/Editor/UpdateWorkflow.js +1 -1
  272. package/widgets/Editor/UpdateWorkflowData.js +1 -1
  273. package/widgets/Editor/components/FeatureList.js +1 -1
  274. package/widgets/Editor/workflowUtils.js +1 -1
  275. package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
  276. package/widgets/FeatureTable/support/FeatureStore.js +1 -1
  277. package/widgets/FeatureTable/support/templateUtils.js +1 -1
  278. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  279. package/widgets/OrientedImageryViewer/adapters/sketch/DataCaptureAdapter.js +1 -1
  280. package/widgets/OrientedImageryViewer/adapters/view/MapViewAdapter.js +1 -1
  281. package/widgets/OrientedImageryViewer.js +1 -1
  282. package/widgets/PanoramicVideoViewer.js +5 -0
  283. package/widgets/PanoramicViewer/PanoramicVideoViewerViewModel.js +5 -0
  284. package/widgets/ShadowCast/ShadowCastViewModel.js +1 -1
  285. package/assets/esri/core/workers/chunks/0dd6b8b3e634bb5f0ca7.js +0 -1
  286. package/assets/esri/core/workers/chunks/268f5b233640a9dbbf89.js +0 -2
  287. package/assets/esri/core/workers/chunks/336b54144afec0c7d396.js +0 -2
  288. package/assets/esri/core/workers/chunks/4840bd93d8fe15c7aefd.js +0 -1
  289. package/assets/esri/core/workers/chunks/804e3b3df375177e6c86.js +0 -1
  290. package/assets/esri/core/workers/chunks/a2652d10bb0bc41c9a8d.js +0 -1
  291. package/assets/esri/core/workers/chunks/d142a42755a78bb157ed.js +0 -1
  292. package/assets/esri/core/workers/chunks/f35003a90163847fe1e2.js +0 -1
  293. package/assets/esri/core/workers/chunks/f6e18668f728dfd8ba5e.js +0 -2
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{on as t}from"../../../../core/events.js";import e from"../../../../core/Handles.js";import{disposeMaybe as r}from"../../../../core/maybe.js";import{when as i,initial as s}from"../../../../core/reactiveUtils.js";import{createScreenPoint as o}from"../../../../core/screenUtils.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import a from"../../../../geometry/Point.js";import h from"../../../../geometry/Polygon.js";import{project as l}from"../../../../geometry/projectionUtils.js";import{DisplayObject as u}from"../DisplayObject.js";import d from"../../../layers/support/Geometry.js";import{Texture as c}from"../../../webgl/Texture.js";import{TextureDescriptor as m}from"../../../webgl/TextureDescriptor.js";const p=2;class f extends u{constructor(r){super(),this.element=r,this._handles=new e,this.isWrapAround=!1,this.perspectiveTransform=n(),this.wrapAroundShift=0,this.clipGeometry=null,this._handles.add(i(()=>this.element,()=>{const e=this.element;this.ready(),e&&this._handles.add(t(e,"play",()=>this.requestRender()))},s))}getMesh(t){throw new Error("Method not implemented.")}destroy(){super.destroy(),this._handles.destroy(),this.texture=r(this.texture)}get textureSize(){if(!this.texture)return[1,1];const t=this.texture.descriptor;return[t.width,t.height]}get dvsMat3(){return this.parent.dvsMat3}beforeRender(t){const e=this.element;if(null==e)return;const{context:r}=t,{videoWidth:i,videoHeight:s}=e;if(0!==i&&0!==s){if(this.texture)e.paused||this.texture.setData(e);else{const t=new m(i,s);t.wrapMode=33071,t.preMultiplyAlpha=!0,this.texture=new c(r,t,e)}e.paused||(this.texture.generateMipmap(),this.requestRender()),super.beforeRender(t)}}_createTransforms(){return null}updateDrawCoords(t,e,r,i){const s=this.element,o=this._getFrameInfo();if(!s||!o)return;const{spatialReference:n}=r;this._initializeData(t,o,n);const{controlPoints:a,horizon:u}=o,c=Math.sqrt(a.length),m=c,{x:f,y:x}=t,y=this._vertices,g=a[0],P=a[c-1],w=a[(m-1)*c],_=a[(m-1)*c+c-1],v=l(u?u[0].mapPoint:g.mapPoint,n),j=l(u?u[1].mapPoint:P.mapPoint,n),M=l(w.mapPoint,n),A=l(_.mapPoint,n);this.clipGeometry=u?new d({geometry:h.fromJSON({rings:[[[M.x,M.y],[A.x,A.y],[j.x,j.y],[v.x,v.y],[M.x,M.y]]],spatialReference:n})}):null;for(let h=0;h<a.length;h++){const t=a[h],{sourcePoint:e,mapPoint:r}=t;if(null==e||null==r)continue;const i=l(r,n);y[h*p+0]=i.x-f,y[h*p+1]=i.y-x}let b=e;if(i){const t=Math.min(v.x,j.x,M.x,A.x),e=Math.max(v.x,j.x,M.x,A.x),{worldWidth:r,xBounds:s}=i,[o,n]=s;t<o&&e>o?b=r:e>n&&t<n&&(b=-r)}this.wrapAroundShift=b,this.isWrapAround=0!==b}draw(t,e){if(!this.visible)return;if(!(this.isReady&&this._vertices&&this._indices&&this._texCoords))return void this.requestRender();this.stage||console.warn("OverlayMultipoint: stage is null"),e.render(t,{transform:{dvs:this.dvsMat3},config:{perspective:this.perspectiveTransform,texSize:this.textureSize,wrapAroundShift:this.wrapAroundShift,isWrapAround:this.isWrapAround,opacity:this.opacity,texture:{texture:this.texture,unit:0}},position:this._vertices,tex:this._texCoords,index:this._indices})}_initializeData(t,e,r){if(null!=this._vertices&&null!=this._indices)return;const{controlPoints:i}=e,s=Math.sqrt(i.length),o=s,n=new Float32Array(p*i.length),a=new Uint16Array(2*i.length);for(let d=0;d<i.length;d++){const e=i[d],{sourcePoint:s,mapPoint:o}=e;if(null==s||null==o)continue;const h=l(o,r);n[d*p+0]=h.x-t.x,n[d*p+1]=h.y-t.y,a[2*d+0]=s.x,a[2*d+1]=s.y}const h=new Uint16Array(o*s+(o-2)*(s+2));let u=0;for(let l=0;l<o;l++){for(let t=0;t<s;t++)h[u++]=l*s+t,h[u++]=(l+1)*s+t;l<o-2&&(h[u++]=(l+1)*s+(s-1),h[u++]=(l+1)*s)}this._vertices=n,this._texCoords=a,this._indices=h}_getFrameInfo(){if(!this.groundControlPoints)return null;const t=this._getFrameControlPoints(),e=this.frameHorizonPoints;let r=null;if(e){const t=e.startX,i=e.startY,s=e.endX,n=e.endY;r=[{sourcePoint:o(t,i),mapPoint:new a(e.startLongitude,e.startLatitude)},{sourcePoint:o(s,n),mapPoint:new a(e.endLongitude,e.endLatitude)}]}return{controlPoints:t,horizon:r}}_getFrameControlPoints(){const t=this.groundControlPoints,e=t?.length;if(!e)return[];const r=new Array(e),i=Math.max(...t.map(({x:t})=>t)),s=this.element.videoWidth/i;for(let n=0;n<e;n++){const{x:e,y:i,lat:h,lon:l}=t[n];r[n]={sourcePoint:o(e*s,-i*s),mapPoint:new a(l,h)}}return r}}export{f as default};
5
+ import{on as t}from"../../../../core/events.js";import e from"../../../../core/Handles.js";import{disposeMaybe as r}from"../../../../core/maybe.js";import{when as i,initial as s}from"../../../../core/reactiveUtils.js";import{createScreenPoint as o}from"../../../../core/screenUtils.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import a from"../../../../geometry/Point.js";import l from"../../../../geometry/Polygon.js";import{project as h}from"../../../../geometry/projectionUtils.js";import u from"../../../../layers/support/ControlPoint.js";import{DisplayObject as p}from"../DisplayObject.js";import d from"../../../layers/support/Geometry.js";import{Texture as m}from"../../../webgl/Texture.js";import{TextureDescriptor as c}from"../../../webgl/TextureDescriptor.js";const f=2;class x extends p{constructor(r){super(),this.element=r,this._handles=new e,this.isWrapAround=!1,this.perspectiveTransform=n(),this.wrapAroundShift=0,this.clipGeometry=null,this._handles.add(i(()=>this.element,()=>{const e=this.element;this.ready(),e&&this._handles.add(t(e,"play",()=>this.requestRender()))},s))}getMesh(t){throw new Error("Method not implemented.")}destroy(){super.destroy(),this._handles.destroy(),this.texture=r(this.texture)}get textureSize(){if(!this.texture)return[1,1];const t=this.texture.descriptor;return[t.width,t.height]}get dvsMat3(){return this.parent.dvsMat3}beforeRender(t){const e=this.element;if(null==e)return;const{context:r}=t,{videoWidth:i,videoHeight:s}=e;if(0!==i&&0!==s){if(this.texture)e.paused||this.texture.setData(e);else{const t=new c(i,s);t.wrapMode=33071,t.preMultiplyAlpha=!0,this.texture=new m(r,t,e)}e.paused||(this.texture.generateMipmap(),this.requestRender()),super.beforeRender(t)}}_createTransforms(){return null}updateDrawCoords(t,e,r,i){const s=this.element,o=this._getFrameInfo();if(!s||!o)return;const{spatialReference:n}=r;this._initializeData(t,o,n);const{controlPoints:a,horizon:u}=o,p=Math.sqrt(a.length),m=p,{x:c,y:x}=t,y=this._vertices,g=a[0],w=a[p-1],P=a[(m-1)*p],_=a[(m-1)*p+p-1],v=h(u?u[0].mapPoint:g.mapPoint,n),j=h(u?u[1].mapPoint:w.mapPoint,n),M=h(P.mapPoint,n),A=h(_.mapPoint,n);this.clipGeometry=u?new d({geometry:l.fromJSON({rings:[[[M.x,M.y],[A.x,A.y],[j.x,j.y],[v.x,v.y],[M.x,M.y]]],spatialReference:n})}):null;for(let l=0;l<a.length;l++){const t=a[l],{sourcePoint:e,mapPoint:r}=t;if(null==e||null==r)continue;const i=h(r,n);y[l*f+0]=i.x-c,y[l*f+1]=i.y-x}let C=e;if(i){const t=Math.min(v.x,j.x,M.x,A.x),e=Math.max(v.x,j.x,M.x,A.x),{worldWidth:r,xBounds:s}=i,[o,n]=s;t<o&&e>o?C=r:e>n&&t<n&&(C=-r)}this.wrapAroundShift=C,this.isWrapAround=0!==C}draw(t,e){if(!this.visible)return;if(!(this.isReady&&this._vertices&&this._indices&&this._texCoords))return void this.requestRender();this.stage||console.warn("OverlayMultipoint: stage is null"),e.render(t,{transform:{dvs:this.dvsMat3},config:{perspective:this.perspectiveTransform,texSize:this.textureSize,wrapAroundShift:this.wrapAroundShift,isWrapAround:this.isWrapAround,opacity:this.opacity,texture:{texture:this.texture,unit:0}},position:this._vertices,tex:this._texCoords,index:this._indices})}_initializeData(t,e,r){if(null!=this._vertices&&null!=this._indices)return;const{controlPoints:i}=e,s=Math.sqrt(i.length),o=s,n=new Float32Array(f*i.length),a=new Uint16Array(2*i.length);for(let p=0;p<i.length;p++){const e=i[p],{sourcePoint:s,mapPoint:o}=e;if(null==s||null==o)continue;const l=h(o,r);n[p*f+0]=l.x-t.x,n[p*f+1]=l.y-t.y,a[2*p+0]=s.x,a[2*p+1]=s.y}const l=new Uint16Array(o*s+(o-2)*(s+2));let u=0;for(let h=0;h<o;h++){for(let t=0;t<s;t++)l[u++]=h*s+t,l[u++]=(h+1)*s+t;h<o-2&&(l[u++]=(h+1)*s+(s-1),l[u++]=(h+1)*s)}this._vertices=n,this._texCoords=a,this._indices=l}_getFrameInfo(){if(!this.groundControlPoints)return null;const t=this._getFrameControlPoints(),e=this.frameHorizonPoints;let r=null;if(e){const t=e.startX,i=e.startY,s=e.endX,n=e.endY;r=[new u({sourcePoint:o(t,i),mapPoint:new a(e.startLongitude,e.startLatitude)}),new u({sourcePoint:o(s,n),mapPoint:new a(e.endLongitude,e.endLatitude)})]}return{controlPoints:t,horizon:r}}_getFrameControlPoints(){const t=this.groundControlPoints,e=t?.length;if(!e)return[];const r=new Array(e),i=Math.max(...t.map(({x:t})=>t)),s=this.element.videoWidth/i;for(let n=0;n<e;n++){const{x:e,y:i,lat:l,lon:h}=t[n];r[n]=new u({sourcePoint:o(e*s,-i*s),mapPoint:new a(h,l)})}return r}}export{x as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import"../../../../../../core/has.js";import{isPowerOfTwo as e,nextPowerOfTwo as t}from"../../../../../../core/mathUtils.js";import{disposeMaybe as r}from"../../../../../../core/maybe.js";import{simplePipelineState as s}from"../utils.js";import{Technique as u}from"./Technique.js";import{TextureStatisticsDiffShader as o}from"./shaders/TextureStatisticsDiffShader.js";import{TextureStatisticsMinMaxSumShader as i}from"./shaders/TextureStatisticsMinMaxSumShader.js";import{TextureStatisticsStdDevShader as a}from"./shaders/TextureStatisticsStdDevShader.js";import{TextureStatisticsSumOfSquaredDiffShader as f}from"./shaders/TextureStatisticsSumOfSquaredDiffShader.js";import{getWebGLCapabilities as n}from"../../../../../webgl/capabilities.js";import{ColorAttachment2 as l,ColorAttachment3 as h,SizedPixelFormat as m,PixelType as x,ColorAttachment0 as c,ColorAttachment1 as T}from"../../../../../webgl/enums.js";import{FramebufferObject as p}from"../../../../../webgl/FramebufferObject.js";import{Texture as d}from"../../../../../webgl/Texture.js";import{TextureDescriptor as b}from"../../../../../webgl/TextureDescriptor.js";const _=1048576;class F extends u{constructor(){super(...arguments),this.type=32,this._width=0,this._height=0,this._framebuffers=null,this._minTexture=null,this._maxTexture=null,this._sumTexture=null,this._numOfNoDataTexture=null,this._resultsFramebuffer=null,this._startFramebuffer=null,this._diffFramebuffer=null,this._scaleFbo=null,this.shaders={textureStatisticsMinMaxSum:new i,textureStatisticsSum:new f,textureStatisticsDiff:new o,textureStatisticsStdDev:new a}}dispose(){this.shaders.textureStatisticsMinMaxSum=null,this._framebuffers&&(this._framebuffers.forEach(e=>r(e)),this._framebuffers=null),r(this._resultsFramebuffer),r(this._startFramebuffer),r(this._diffFramebuffer),r(this._scaleFbo),r(this._minTexture),r(this._maxTexture),r(this._sumTexture),r(this._numOfNoDataTexture)}get minValuesTexture(){return this._minTexture||null}get maxValuesTexture(){return this._maxTexture||null}get meanValuesTexture(){return this._resultsFramebuffer?.getColorTexture(l)||null}get stdDevValuesTexture(){return this._resultsFramebuffer?.getColorTexture(h)||null}get statsFbo(){return this._resultsFramebuffer}render(t,r){const{context:u,painter:o}=t;let i=r.fbo.width,a=r.fbo.height,f=r.fbo;const n=u.gl,l=u.getBoundFramebufferObject();if(i*a>_||!e(i)||!e(a)){const t=i/a;if(i*a>_){const e=Math.max(Math.floor(Math.sqrt(_/t)),1);i=Math.max(Math.floor(t*e),1),a=e}e(i)||(i=S(i)),e(a)||(a=S(a)),this._scaleFbo?this._scaleFbo.resize(i,a):this._scaleFbo=w(u,i,a,x.UNSIGNED_BYTE,m.RGBA8),u.bindFramebuffer(this._scaleFbo),u.setViewport(0,0,i,a),o.blitTexture(u,f.getColorTexture(c),9728),f=this._scaleFbo}this._updateResources(t,f),o.setPipelineState({...s,color:{write:[!0,!0,!0,!0],blendMode:"none"}});const h=this._applyReductionPass(t);n.readBuffer(n.COLOR_ATTACHMENT3),h.copyToTexture(0,0,1,1,0,0,this._numOfNoDataTexture),n.readBuffer(n.COLOR_ATTACHMENT2),h.copyToTexture(0,0,1,1,0,0,this._sumTexture),n.readBuffer(n.COLOR_ATTACHMENT1),h.copyToTexture(0,0,1,1,0,0,this._maxTexture),n.readBuffer(n.COLOR_ATTACHMENT0),h.copyToTexture(0,0,1,1,0,0,this._minTexture);const T=r.fbo.getColorTexture(c);if(!T)throw new Error("Start buffer color texture is not available, cannot compute diff.");this._computeDiff(t,T,this._sumTexture,this._numOfNoDataTexture,i,a);const p=this._applySecondReductionPass(t,i,a).getColorTexture(c);this._computeSdtDev(t,this._minTexture,this._maxTexture,this._sumTexture,this._numOfNoDataTexture,p,i,a),u.bindFramebuffer(l),u.setViewport(0,0,i,a),u.setDrawBuffers([c]),o.setPipelineState(s)}_applyReductionPass(e){const{context:t,painter:r}=e,s=this.shaders.textureStatisticsMinMaxSum,u=this._framebuffers;if(null===u)throw new Error("Framebuffers are not initialized, cannot apply reduction pass.");t.setDrawBuffers([c,T,l]);const o=this._startFramebuffer;let i=o.getColorTexture(c),a=o.getColorTexture(T),f=o.getColorTexture(l),n=o.getColorTexture(h);const m=u;let x=0;for(const p of m){t.setViewport(0,0,p.width,p.height),t.bindFramebuffer(p),t.setClearColor(0,0,0,0),t.clear(16384);const e={shader:s,uniforms:{config:{minTexture:{texture:i,unit:1},maxTexture:{texture:a,unit:2},sumTexture:{texture:f,unit:3},numOfNoDataTexture:{texture:n,unit:4},width:p.width,height:p.height,isFirstPass:0===x?1:0}},defines:null,optionalAttributes:null,useComputeBuffer:!1};r.submitDrawMesh(t,e,r.quadMesh),i=p.getColorTexture(c),a=p.getColorTexture(T),f=p.getColorTexture(l),n=p.getColorTexture(h),x++}return u.at(-1)}_applySecondReductionPass(e,t,r){const{context:s,painter:u}=e,o=this.shaders.textureStatisticsSum,i=this._framebuffers;if(null===i||null==this._diffFramebuffer)throw new Error("Framebuffers are not initialized, cannot apply reduction pass.");s.setDrawBuffers([c]);let a=this._diffFramebuffer.getColorTexture(c);const f=i;for(const n of f){s.setViewport(0,0,n.width,n.height),s.bindFramebuffer(n),s.setClearColor(0,0,0,0),s.clear(16384);const e={shader:o,uniforms:{config:{sumTexture:{texture:a,unit:2},width:n.width,height:n.height}},defines:null,optionalAttributes:null,useComputeBuffer:!1};u.submitDrawMesh(s,e,u.quadMesh),a=n.getColorTexture(c)}return i.at(-1)}_updateResources(e,t){const{context:r}=e,s=t.width,u=t.height;if(null===this._startFramebuffer){if(!n().supportsColorBufferFloat)throw new Error("WebGL does not support color buffer float, cannot compute texture statistics.");const e=t.getColorTexture(c);if(!e)throw new Error("Input FBO does not have a color attachment 0, cannot compute texture statistics.");const o=e.descriptor,{dataType:i,internalFormat:a}=o,f=w(r,s,u,i,a??m.RGBA8,4),p=f.getColorTexture(c),d=f.getColorTexture(T),b=f.getColorTexture(l),_=f.getColorTexture(h);t.copyToTexture(0,0,s,u,0,0,p),t.copyToTexture(0,0,s,u,0,0,d),t.copyToTexture(0,0,s,u,0,0,b),t.copyToTexture(0,0,s,u,0,0,_),this._startFramebuffer=f,this._diffFramebuffer=w(r,s,u,x.FLOAT,m.RGBA32F),this._resultsFramebuffer=w(r,1,1,x.FLOAT,m.RGBA32F,4),this._minTexture=C(r,1,1,x.FLOAT,m.RGBA32F),this._maxTexture=C(r,1,1,x.FLOAT,m.RGBA32F),this._sumTexture=C(r,1,1,x.FLOAT,m.RGBA32F),this._numOfNoDataTexture=C(r,1,1,x.FLOAT,m.R32F)}else{const e=this._startFramebuffer;e.resize(s,u);const r=e.getColorTexture(c),o=e.getColorTexture(T),i=e.getColorTexture(l),a=e.getColorTexture(h);t.copyToTexture(0,0,s,u,0,0,r),t.copyToTexture(0,0,s,u,0,0,o),t.copyToTexture(0,0,s,u,0,0,i),t.copyToTexture(0,0,s,u,0,0,a),this._diffFramebuffer.resize(s,u)}if(this._width===s&&this._height===u&&null!==this._framebuffers)return;const o=(this._framebuffers||[]).reverse();this._framebuffers=null,this._width=s,this._height=u,this._framebuffers=this._updateFramebuffers(r,s,u,o,4)}_updateFramebuffers(e,t,s,u,o=1){const i=[];let a=t,f=s;for(;a>1||f>1;){const t=Math.max(1,Math.floor(a/2)),r=Math.max(1,Math.floor(f/2)),s=g(e,t,r,u,o);i.push(s),a=t,f=r}return i.at(-1),u.forEach(e=>r(e)),u.length=0,i}_computeDiff(e,t,r,s,u,o){const{context:i,painter:a}=e;i.bindFramebuffer(this._diffFramebuffer),i.setDrawBuffers([c]),i.setViewport(0,0,u,o),i.setClearColor(0,0,0,0),i.clear(16384);const f={shader:this.shaders.textureStatisticsDiff,uniforms:{config:{inputTexture:{texture:t,unit:1},sumTexture:{texture:r,unit:2},numOfNoDataTexture:{texture:s,unit:3},numTexels:u*o}},defines:null,optionalAttributes:null,useComputeBuffer:!1};a.submitDrawMesh(i,f,a.quadMesh)}_computeSdtDev(e,t,r,s,u,o,i,a){const{context:f,painter:n}=e;f.bindFramebuffer(this._resultsFramebuffer),f.setDrawBuffers([c,T,l,h]),f.setViewport(0,0,1,1),f.setClearColor(0,0,0,0),f.clear(16384);const m={shader:this.shaders.textureStatisticsStdDev,uniforms:{config:{minTexture:{texture:t,unit:1},maxTexture:{texture:r,unit:2},sumTexture:{texture:s,unit:3},numOfNoDataTexture:{texture:u,unit:4},diffSqTexture:{texture:o,unit:5},numTexels:i*a}},defines:null,optionalAttributes:null,useComputeBuffer:!1};n.submitDrawMesh(f,m,n.quadMesh)}}function g(e,t,r,s,u=1){let o=s.pop();return void 0!==o?o.resize(t,r):o=w(e,t,r,x.FLOAT,m.RGBA32F,u),o}function w(e,t,r,s,u,o=1){if(o<1||o>4)throw new Error("Number of color attachments must be between 1 and 4.");const i=new p(e,C(e,t,r,s,u));for(let a=1;a<o;a++){const o=C(e,t,r,s,u);i.attachColorTexture(o,c+a)}return i}function C(e,t,r,s,u){const o=new b(t,r);return o.samplingMode=9728,o.wrapMode=33071,o.pixelFormat=6408,o.dataType=s,o.internalFormat=u,new d(e,o)}function S(e){const r=t(e),s=r/2;return Math.abs(r-e)<Math.abs(s-e)?r:s}export{F as TextureStatisticsTechnique};
5
+ import"../../../../../../core/has.js";import{isPowerOfTwo as e,nextPowerOfTwo as t}from"../../../../../../core/mathUtils.js";import{disposeMaybe as r}from"../../../../../../core/maybe.js";import{simplePipelineState as s}from"../utils.js";import{Technique as u}from"./Technique.js";import{TextureStatisticsDiffShader as o}from"./shaders/TextureStatisticsDiffShader.js";import{TextureStatisticsMinMaxSumShader as i}from"./shaders/TextureStatisticsMinMaxSumShader.js";import{TextureStatisticsStdDevShader as a}from"./shaders/TextureStatisticsStdDevShader.js";import{TextureStatisticsSumOfSquaredDiffShader as f}from"./shaders/TextureStatisticsSumOfSquaredDiffShader.js";import{getWebGLCapabilities as n}from"../../../../../webgl/capabilities.js";import{ColorAttachment2 as l,ColorAttachment3 as h,ColorAttachment0 as m,ColorAttachment1 as x,SizedPixelFormat as c,PixelType as T}from"../../../../../webgl/enums.js";import{FramebufferObject as d}from"../../../../../webgl/FramebufferObject.js";import{Texture as p}from"../../../../../webgl/Texture.js";import{TextureDescriptor as b}from"../../../../../webgl/TextureDescriptor.js";const _=1048576;class F extends u{constructor(){super(...arguments),this.type=32,this._width=0,this._height=0,this._framebuffers=null,this._minTexture=null,this._maxTexture=null,this._sumTexture=null,this._numOfNoDataTexture=null,this._resultsFramebuffer=null,this._startFramebuffer=null,this._diffFramebuffer=null,this._scaleFbo=null,this.shaders={textureStatisticsMinMaxSum:new i,textureStatisticsSum:new f,textureStatisticsDiff:new o,textureStatisticsStdDev:new a}}dispose(){this.shaders.textureStatisticsMinMaxSum=null,this._framebuffers&&(this._framebuffers.forEach(e=>r(e)),this._framebuffers=null),r(this._resultsFramebuffer),r(this._startFramebuffer),r(this._diffFramebuffer),r(this._scaleFbo),r(this._minTexture),r(this._maxTexture),r(this._sumTexture),r(this._numOfNoDataTexture)}get minValuesTexture(){return this._minTexture||null}get maxValuesTexture(){return this._maxTexture||null}get meanValuesTexture(){return this._resultsFramebuffer?.getColorTexture(l)||null}get stdDevValuesTexture(){return this._resultsFramebuffer?.getColorTexture(h)||null}get statsFbo(){return this._resultsFramebuffer}render(t,r){const{context:u,painter:o}=t;let i=r.fbo.width,a=r.fbo.height,f=r.fbo;const n=u.gl,l=u.getBoundFramebufferObject();if(i*a>_||!e(i)||!e(a)){const t=i/a;if(i*a>_){const e=Math.max(Math.floor(Math.sqrt(_/t)),1);i=Math.max(Math.floor(t*e),1),a=e}if(e(i)||(i=S(i)),e(a)||(a=S(a)),this._scaleFbo)this._scaleFbo.resize(i,a);else{const{dataType:e,internalFormat:t}=r.fbo.getColorTexture(m).descriptor,s=t??c.RGBA8;this._scaleFbo=w(u,i,a,e,s)}u.bindFramebuffer(this._scaleFbo),u.setViewport(0,0,i,a),o.blitTexture(u,f.getColorTexture(m),9728),f=this._scaleFbo}this._updateResources(t,f),o.setPipelineState({...s,color:{write:[!0,!0,!0,!0],blendMode:"none"}});const h=this._applyReductionPass(t);n.readBuffer(n.COLOR_ATTACHMENT3),h.copyToTexture(0,0,1,1,0,0,this._numOfNoDataTexture),n.readBuffer(n.COLOR_ATTACHMENT2),h.copyToTexture(0,0,1,1,0,0,this._sumTexture),n.readBuffer(n.COLOR_ATTACHMENT1),h.copyToTexture(0,0,1,1,0,0,this._maxTexture),n.readBuffer(n.COLOR_ATTACHMENT0),h.copyToTexture(0,0,1,1,0,0,this._minTexture);const x=r.fbo.getColorTexture(m);if(!x)throw new Error("Start buffer color texture is not available, cannot compute diff.");this._computeDiff(t,x,this._sumTexture,this._numOfNoDataTexture,i,a);const T=this._applySecondReductionPass(t,i,a).getColorTexture(m);this._computeSdtDev(t,this._minTexture,this._maxTexture,this._sumTexture,this._numOfNoDataTexture,T,i,a),u.bindFramebuffer(l),u.setViewport(0,0,r.fbo.width,r.fbo.height),u.setDrawBuffers([m]),o.setPipelineState(s)}_applyReductionPass(e){const{context:t,painter:r}=e,s=this.shaders.textureStatisticsMinMaxSum,u=this._framebuffers;if(null===u)throw new Error("Framebuffers are not initialized, cannot apply reduction pass.");t.setDrawBuffers([m,x,l]);const o=this._startFramebuffer;let i=o.getColorTexture(m),a=o.getColorTexture(x),f=o.getColorTexture(l),n=o.getColorTexture(h);const c=u;let T=0;for(const d of c){t.setViewport(0,0,d.width,d.height),t.bindFramebuffer(d),t.setClearColor(0,0,0,0),t.clear(16384);const e={shader:s,uniforms:{config:{minTexture:{texture:i,unit:1},maxTexture:{texture:a,unit:2},sumTexture:{texture:f,unit:3},numOfNoDataTexture:{texture:n,unit:4},width:d.width,height:d.height,isFirstPass:0===T?1:0}},defines:null,optionalAttributes:null,useComputeBuffer:!1};r.submitDrawMesh(t,e,r.quadMesh),i=d.getColorTexture(m),a=d.getColorTexture(x),f=d.getColorTexture(l),n=d.getColorTexture(h),T++}return u.at(-1)}_applySecondReductionPass(e,t,r){const{context:s,painter:u}=e,o=this.shaders.textureStatisticsSum,i=this._framebuffers;if(null===i||null==this._diffFramebuffer)throw new Error("Framebuffers are not initialized, cannot apply reduction pass.");s.setDrawBuffers([m]);let a=this._diffFramebuffer.getColorTexture(m);const f=i;for(const n of f){s.setViewport(0,0,n.width,n.height),s.bindFramebuffer(n),s.setClearColor(0,0,0,0),s.clear(16384);const e={shader:o,uniforms:{config:{sumTexture:{texture:a,unit:2},width:n.width,height:n.height}},defines:null,optionalAttributes:null,useComputeBuffer:!1};u.submitDrawMesh(s,e,u.quadMesh),a=n.getColorTexture(m)}return i.at(-1)}_updateResources(e,t){const{context:r}=e,s=t.width,u=t.height;if(null===this._startFramebuffer){if(!n().supportsColorBufferFloat)throw new Error("WebGL does not support color buffer float, cannot compute texture statistics.");const e=t.getColorTexture(m);if(!e)throw new Error("Input FBO does not have a color attachment 0, cannot compute texture statistics.");const o=e.descriptor,{dataType:i,internalFormat:a}=o,f=w(r,s,u,i,a??c.RGBA8,4),d=f.getColorTexture(m),p=f.getColorTexture(x),b=f.getColorTexture(l),_=f.getColorTexture(h);t.copyToTexture(0,0,s,u,0,0,d),t.copyToTexture(0,0,s,u,0,0,p),t.copyToTexture(0,0,s,u,0,0,b),t.copyToTexture(0,0,s,u,0,0,_),this._startFramebuffer=f,this._diffFramebuffer=w(r,s,u,T.FLOAT,c.RGBA32F),this._resultsFramebuffer=w(r,1,1,T.FLOAT,c.RGBA32F,4),this._minTexture=C(r,1,1,T.FLOAT,c.RGBA32F),this._maxTexture=C(r,1,1,T.FLOAT,c.RGBA32F),this._sumTexture=C(r,1,1,T.FLOAT,c.RGBA32F),this._numOfNoDataTexture=C(r,1,1,T.FLOAT,c.R32F)}else{const e=this._startFramebuffer;e.resize(s,u);const r=e.getColorTexture(m),o=e.getColorTexture(x),i=e.getColorTexture(l),a=e.getColorTexture(h);t.copyToTexture(0,0,s,u,0,0,r),t.copyToTexture(0,0,s,u,0,0,o),t.copyToTexture(0,0,s,u,0,0,i),t.copyToTexture(0,0,s,u,0,0,a),this._diffFramebuffer.resize(s,u)}if(this._width===s&&this._height===u&&null!==this._framebuffers)return;const o=(this._framebuffers||[]).reverse();this._framebuffers=null,this._width=s,this._height=u,this._framebuffers=this._updateFramebuffers(r,s,u,o,4)}_updateFramebuffers(e,t,s,u,o=1){const i=[];let a=t,f=s;for(;a>1||f>1;){const t=Math.max(1,Math.floor(a/2)),r=Math.max(1,Math.floor(f/2)),s=g(e,t,r,u,o);i.push(s),a=t,f=r}return i.at(-1),u.forEach(e=>r(e)),u.length=0,i}_computeDiff(e,t,r,s,u,o){const{context:i,painter:a}=e;i.bindFramebuffer(this._diffFramebuffer),i.setDrawBuffers([m]),i.setViewport(0,0,u,o),i.setClearColor(0,0,0,0),i.clear(16384);const f={shader:this.shaders.textureStatisticsDiff,uniforms:{config:{inputTexture:{texture:t,unit:1},sumTexture:{texture:r,unit:2},numOfNoDataTexture:{texture:s,unit:3},numTexels:u*o}},defines:null,optionalAttributes:null,useComputeBuffer:!1};a.submitDrawMesh(i,f,a.quadMesh)}_computeSdtDev(e,t,r,s,u,o,i,a){const{context:f,painter:n}=e;f.bindFramebuffer(this._resultsFramebuffer),f.setDrawBuffers([m,x,l,h]),f.setViewport(0,0,1,1),f.setClearColor(0,0,0,0),f.clear(16384);const c={shader:this.shaders.textureStatisticsStdDev,uniforms:{config:{minTexture:{texture:t,unit:1},maxTexture:{texture:r,unit:2},sumTexture:{texture:s,unit:3},numOfNoDataTexture:{texture:u,unit:4},diffSqTexture:{texture:o,unit:5},numTexels:i*a}},defines:null,optionalAttributes:null,useComputeBuffer:!1};n.submitDrawMesh(f,c,n.quadMesh)}}function g(e,t,r,s,u=1){let o=s.pop();return void 0!==o?o.resize(t,r):o=w(e,t,r,T.FLOAT,c.RGBA32F,u),o}function w(e,t,r,s,u,o=1){if(o<1||o>4)throw new Error("Number of color attachments must be between 1 and 4.");const i=new d(e,C(e,t,r,s,u));for(let a=1;a<o;a++){const o=C(e,t,r,s,u);i.attachColorTexture(o,m+a)}return i}function C(e,t,r,s,u){const o=new b(t,r);return o.samplingMode=9728,o.wrapMode=33071,o.pixelFormat=6408,o.dataType=s,o.internalFormat=u,new p(e,o)}function S(e){const r=t(e),s=r/2;return Math.abs(r-e)<Math.abs(s-e)?r:s}export{F as TextureStatisticsTechnique};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{Technique as e}from"../Technique.js";import{getInterpolationDefines as i}from"./processor/textureUtils.js";import{RasterColorizerLUTShader as t}from"../shaders/raster/RasterColorizerLUTShader.js";import{RasterColorizerShadedReliefShader as o}from"../shaders/raster/RasterColorizerShadedReliefShader.js";import{RasterColorizerStretchShader as r}from"../shaders/raster/RasterColorizerStretchShader.js";class s extends e{constructor(){super(...arguments),this.name="BrushRasterColorizer",this.type=0,this.shaders={lut:new t,stretch:new r,shadedRelief:new o}}render(e,i){for(const t of i.bitmaps){if(!t.source||t.suspended)continue;e.timeline.begin(this.name);const{painter:i}=e;i.setPipelineState({depth:!1,stencil:{test:{mask:255,compare:514,op:{fail:7680,zFail:7680,zPass:7680}},write:!1},color:{write:[!0,!0,!0,!0],blendMode:"composite"}}),t.updateTexture(e),t.updateProcessedTexture();const{type:o}=t.symbolizerParameters,r="stretch"===o?this._getStretchOptions(t):"lut"===o?this._getLutOptions(t):this._getShadedReliefOptions(t);"bilinear"!==t.interpolation||e.context.capabilities.textureFloatLinear||(r.defines.bilinear=!0),i.submitDrawMesh(e.context,r,i.quadMesh,t),e.timeline.end(this.name)}}_getLutOptions(e){const{config:t,projectionConfig:o,colormapConfig:r,pixelMaskConfig:s,highlightConfig:n,projectionDefines:a}=this._getCommonConfig(e),l=i(e);return{shader:this.shaders.lut,uniforms:{projectionConfig:o,config:t,colormapConfig:r,pixelMaskConfig:s,highlightConfig:n},defines:{...a,...l,applyPixelMask:!!s,applyPixelHighlights:!!n},optionalAttributes:null,useComputeBuffer:!1}}_getStretchOptions(e){const t=e.symbolizerParameters,{config:o,projectionConfig:r,colormapConfig:s,pixelMaskConfig:n,highlightConfig:a,projectionDefines:l}=this._getCommonConfig(e),p=i(e);return{shader:this.shaders.stretch,uniforms:{projectionConfig:r,config:o,stretchConfig:t,colormapConfig:s,pixelMaskConfig:n,highlightConfig:a},defines:{...l,...p,isMultiband:t.bandCount>1,applyColormap:!!s,useGamma:t.useGamma,noOp:e.isRendereredSource&&!e.processed,applyPixelMask:!!n,applyPixelHighlights:!!a},optionalAttributes:null,useComputeBuffer:!1}}_getShadedReliefOptions(e){const t=e.symbolizerParameters,{config:o,projectionConfig:r,colormapConfig:s,pixelMaskConfig:n,highlightConfig:a,projectionDefines:l}=this._getCommonConfig(e),p=i(e);return{shader:this.shaders.shadedRelief,uniforms:{projectionConfig:r,config:o,hillshadeConfig:t,colormapConfig:s,pixelMaskConfig:n,highlightConfig:a},defines:{...l,...p,isMultidirectional:t.hillshadeType>0,applyColormap:!!s,applyPixelMask:!!n,applyPixelHighlights:!!a},optionalAttributes:null,useComputeBuffer:!1}}_getCommonConfig(e){const{coordScale:i,computedOpacity:t,transforms:o}=e,{names:r,textures:s}=e.getTextures({useProcessedTexture:e.processed}),n=s[r.indexOf("u_image")],a=e.getRasterTextureSize(),l={texture:{texture:n,unit:0},dvsMat3:o.displayViewScreenMat3,coordScale:i,srcImageSize:a,opacity:t},p=s[r.indexOf("u_transformGrid")],{transformGrid:g}=e,f=!(!p||!g),h=f?{transformTexture:{texture:p,unit:2},targetImageSize:[e.width,e.height],transformSpacing:g.spacing,transformGridSize:g.size}:void 0,c=s[r.indexOf("u_colormap")],{colormap:u,colormapOffset:m}=e.symbolizerParameters,d=c&&u?{colormapTexture:{texture:c,unit:1},colormapOffset:m??0,colormapMaxIndex:u.length/4-1}:void 0,C=s[r.indexOf("u_mask")],x=C?{maskTexture:{texture:C,unit:3}}:void 0,{highlightTexture:y}=e;return{config:l,projectionConfig:h,colormapConfig:d,pixelMaskConfig:x,highlightConfig:y?{highlightTexture:{texture:y,unit:4}}:void 0,projectionDefines:{applyProjection:f,lookupProjection:f&&1===g.spacing[0]}}}}export{s as RasterColorizerTechnique};
5
+ import{disposeMaybe as e}from"../../../../../../../core/maybe.js";import{Technique as t}from"../Technique.js";import{TextureStatisticsTechnique as i}from"../TextureStatisticsTechnique.js";import{getInterpolationDefines as s}from"./processor/textureUtils.js";import{RasterColorizerLUTShader as o}from"../shaders/raster/RasterColorizerLUTShader.js";import{RasterColorizerShadedReliefShader as r}from"../shaders/raster/RasterColorizerShadedReliefShader.js";import{RasterColorizerStretchShader as n}from"../shaders/raster/RasterColorizerStretchShader.js";import{SizedPixelFormat as a,PixelType as u}from"../../../../../../webgl/enums.js";import{FramebufferObject as c}from"../../../../../../webgl/FramebufferObject.js";import{Texture as m}from"../../../../../../webgl/Texture.js";import{TextureDescriptor as l}from"../../../../../../webgl/TextureDescriptor.js";class p extends t{constructor(){super(...arguments),this.name="BrushRasterColorizer",this.type=0,this.shaders={lut:new o,stretch:new n,shadedRelief:new r},this._mosaicFbo=null,this._statisticsTechnique=null}shutdown(t){super.shutdown(t),this._mosaicFbo=e(this._mosaicFbo),this._statisticsTechnique=e(this._statisticsTechnique)}render(t,i){const s=i.bitmaps.some(f);s||(this._mosaicFbo=e(this._mosaicFbo),this._statisticsTechnique=e(this._statisticsTechnique));const o=s?this._computeStatisticsTextures(t,i):void 0;for(const e of i.bitmaps){if(!e.source||e.suspended)continue;t.timeline.begin(this.name);const{painter:i}=t;i.setPipelineState({depth:!1,stencil:{test:{mask:255,compare:514,op:{fail:7680,zFail:7680,zPass:7680}},write:!1},color:{write:[!0,!0,!0,!0],blendMode:"composite"}}),e.updateTexture(t),e.updateProcessedTexture();const{type:s}=e.symbolizerParameters,r="stretch"===s?this._getStretchOptions(e,o):"lut"===s?this._getLutOptions(e):this._getShadedReliefOptions(e);"bilinear"!==e.interpolation||t.context.capabilities.textureFloatLinear||(r.defines.bilinear=!0),i.submitDrawMesh(t.context,r,i.quadMesh,e),t.timeline.end(this.name)}}_computeStatisticsTextures(e,t){this._statisticsTechnique??=new i;const s=this._statisticsTechnique;return this._mosaic(e,t),s.render(e,{fbo:this._mosaicFbo}),{minTexture:s.minValuesTexture,maxTexture:s.maxValuesTexture,meanTexture:s.meanValuesTexture,stddevTexture:s.stdDevValuesTexture}}_mosaic(e,t){const{context:i,painter:s}=e,o=i.getBoundFramebufferObject();if(this._mosaicFbo)this._mosaicFbo.resize(o.width,o.height);else{const e=h(i,o.width,o.height);this._mosaicFbo=new c(i,e)}i.bindFramebuffer(this._mosaicFbo);const r="RasterColorizerMosaic";for(const n of t.bitmaps){if(!f(n))continue;e.timeline.begin(r),s.setPipelineState({depth:!1,stencil:{test:{mask:255,compare:514,op:{fail:7680,zFail:7680,zPass:7680}},write:!1},color:{write:[!0,!0,!0,!0],blendMode:"composite"}});const t=n.interpolation;n.interpolation="nearest",n.updateTexture(e),n.updateProcessedTexture();const i=this._getStretchOptions(n);i.defines.noOp=!0,s.submitDrawMesh(e.context,i,s.quadMesh,n),n.interpolation=t,e.timeline.end(r)}i.bindFramebuffer(o)}_getLutOptions(e){const{config:t,projectionConfig:i,colormapConfig:o,pixelMaskConfig:r,highlightConfig:n,projectionDefines:a}=this._getCommonConfig(e),u=s(e);return{shader:this.shaders.lut,uniforms:{projectionConfig:i,config:t,colormapConfig:o,pixelMaskConfig:r,highlightConfig:n},defines:{...a,...u,applyPixelMask:!!r,applyPixelHighlights:!!n},optionalAttributes:null,useComputeBuffer:!1}}_getStretchOptions(e,t){const i=e.symbolizerParameters,{config:o,projectionConfig:r,colormapConfig:n,pixelMaskConfig:a,highlightConfig:u,projectionDefines:c,textureUnit:m}=this._getCommonConfig(e),l=s(e),p=t?{minTexture:{texture:t.minTexture,unit:m},maxTexture:{texture:t.maxTexture,unit:m+1},meanTexture:{texture:t.meanTexture,unit:m+2},stddevTexture:{texture:t.stddevTexture,unit:m+3},numberOfStandardDeviations:i.numberOfStandardDeviations||2}:void 0,h=t?"standardDeviation"===i.stretchType?2:1:0;return{shader:this.shaders.stretch,uniforms:{projectionConfig:r,config:o,stretchConfig:i,colormapConfig:n,pixelMaskConfig:a,highlightConfig:u,statisticsConfig:p},defines:{...c,...l,isMultiband:i.bandCount>1,applyColormap:!!n,useGamma:i.useGamma,noOp:e.isRendereredSource&&!e.processed,applyPixelMask:!!a,applyPixelHighlights:!!u,draStretchType:h},optionalAttributes:null,useComputeBuffer:!1}}_getShadedReliefOptions(e){const t=e.symbolizerParameters,{config:i,projectionConfig:o,colormapConfig:r,pixelMaskConfig:n,highlightConfig:a,projectionDefines:u}=this._getCommonConfig(e),c=s(e);return{shader:this.shaders.shadedRelief,uniforms:{projectionConfig:o,config:i,hillshadeConfig:t,colormapConfig:r,pixelMaskConfig:n,highlightConfig:a},defines:{...u,...c,isMultidirectional:t.hillshadeType>0,applyColormap:!!r,applyPixelMask:!!n,applyPixelHighlights:!!a},optionalAttributes:null,useComputeBuffer:!1}}_getCommonConfig(e){const{coordScale:t,computedOpacity:i,transforms:s}=e,{names:o,textures:r}=e.getTextures({useProcessedTexture:e.processed}),n=r[o.indexOf("u_image")],a=e.getRasterTextureSize();let u=0;const c={texture:{texture:n,unit:u++},dvsMat3:s.displayViewScreenMat3,coordScale:t,srcImageSize:a,opacity:i},m=r[o.indexOf("u_transformGrid")],{transformGrid:l}=e,p=!(!m||!l),h=p?{transformTexture:{texture:m,unit:u++},targetImageSize:[e.width,e.height],transformSpacing:l.spacing,transformGridSize:l.size}:void 0,f=r[o.indexOf("u_colormap")],{colormap:d,colormapOffset:g}=e.symbolizerParameters,x=f&&d?{colormapTexture:{texture:f,unit:u++},colormapOffset:g??0,colormapMaxIndex:d.length/4-1}:void 0,C=r[o.indexOf("u_mask")],b=C?{maskTexture:{texture:C,unit:u++}}:void 0,{highlightTexture:T}=e;return{config:c,projectionConfig:h,colormapConfig:x,pixelMaskConfig:b,highlightConfig:T?{highlightTexture:{texture:T,unit:u++}}:void 0,projectionDefines:{applyProjection:p,lookupProjection:p&&1===l.spacing[0]},textureUnit:u}}}function h(e,t,i){const s=new l(t,i);return s.internalFormat=a.RGBA32F,s.samplingMode=9728,s.dataType=u.FLOAT,s.wrapMode=33071,new m(e,s)}function f(e){return!e.suspended&&null!=e.source&&!e.isRendereredSource&&"stretch"===e.symbolizerParameters.type&&!!e.symbolizerParameters.dynamicRangeAdjustment}export{p as RasterColorizerTechnique};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as t,__param as e}from"tslib";import{location as o,uniform as r,input as s,VertexInput as i,UniformGroup as n,GraphShaderModule as p,FragmentOutput as u,FragmentInput as l}from"../../GraphShaderModule.js";import{Vec2 as a,Sampler2D as m,Float as x,Vec4 as c,texture2D as d,texelFetch as f,Int as v,IVec2 as y,step as g}from"../../graph/glsl.js";import{uvToClip as T}from"./utils.js";class w extends i{}t([o(0,a)],w.prototype,"position",void 0);class h extends l{}class b extends n{}t([r(m)],b.prototype,"inputTexture",void 0),t([r(m)],b.prototype,"sumTexture",void 0),t([r(m)],b.prototype,"numOfNoDataTexture",void 0),t([r(x)],b.prototype,"numTexels",void 0);class j extends p{constructor(){super(...arguments),this.type="TextureStatisticsDiffShader"}vertex(t){const e=t.position;return{uv:e,glPosition:new c(T(e),0,1)}}fragment(t){const{inputTexture:e,numOfNoDataTexture:o,sumTexture:r}=this.config,s=new u,i=d(e,t.uv),n=f(r,new y(0,0),new v(0)),p=f(o,new y(0,0),new v(0)).r,l=this.config.numTexels.subtract(p),a=n.divide(l),m=g(i.a,new x(0)),c=new x(1).subtract(m).multiply(i.subtract(a));return s.fragColor=c.multiply(c),s}}t([r(b)],j.prototype,"config",void 0),t([e(0,s(w))],j.prototype,"vertex",null),t([e(0,s(h))],j.prototype,"fragment",null);export{j as TextureStatisticsDiffShader};
5
+ import{__decorate as t,__param as e}from"tslib";import{GraphShaderModule as o,FragmentOutput as r,location as s,uniform as i,input as n,VertexInput as p,UniformGroup as u,FragmentInput as l}from"../../GraphShaderModule.js";import{Vec4 as a,texture2D as m,texelFetch as x,Int as c,IVec2 as d,step as f,Float as v,Vec2 as y,Sampler2D as g}from"../../graph/glsl.js";import{uvToClip as T}from"./utils.js";class w extends p{}t([s(0,y)],w.prototype,"position",void 0);class h extends l{}class b extends u{}t([i(g)],b.prototype,"inputTexture",void 0),t([i(g)],b.prototype,"sumTexture",void 0),t([i(g)],b.prototype,"numOfNoDataTexture",void 0),t([i(v)],b.prototype,"numTexels",void 0);class j extends o{constructor(){super(...arguments),this.type="TextureStatisticsDiffShader"}vertex(t){const e=t.position;return{uv:e,glPosition:new a(T(e),0,1)}}fragment(t){const{inputTexture:e,numOfNoDataTexture:o,sumTexture:s}=this.config,i=new r,n=m(e,t.uv),p=x(s,new d(0,0),new c(0)),u=x(o,new d(0,0),new c(0)).r,l=this.config.numTexels.subtract(u),a=p.divide(l),y=f(n.a,new v(0)),g=new v(1).subtract(y).multiply(n.subtract(a));return i.fragColor=g.multiply(g),i}}t([i(b)],j.prototype,"config",void 0),t([e(0,n(w))],j.prototype,"vertex",null),t([e(0,n(h))],j.prototype,"fragment",null);export{j as TextureStatisticsDiffShader};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as t,__param as e}from"tslib";import{location as n,uniform as o,input as r,VertexInput as a,UniformGroup as i,GraphShaderModule as s,FragmentOutput as d,FragmentInput as u}from"../../GraphShaderModule.js";import{Vec2 as p,Sampler2D as l,Int as w,Vec4 as m,IVec2 as c,texelFetch as y,Float as f,step as x,min as g,max as v}from"../../graph/glsl.js";import{maxRepresentableInt as h}from"./constants.js";import{uvToClip as T,sum4 as D}from"./utils.js";class b extends a{}t([n(0,p)],b.prototype,"position",void 0);class j extends u{}class S extends i{}t([o(l)],S.prototype,"minTexture",void 0),t([o(l)],S.prototype,"maxTexture",void 0),t([o(l)],S.prototype,"sumTexture",void 0),t([o(l)],S.prototype,"numOfNoDataTexture",void 0),t([o(w)],S.prototype,"width",void 0),t([o(w)],S.prototype,"height",void 0),t([o(w)],S.prototype,"isFirstPass",void 0);class F extends s{constructor(){super(...arguments),this.type="TextureStatisticsMinMaxSumShader"}vertex(t){const e=t.position;return{uv:e,glPosition:new m(T(e),0,1)}}fragment(t){const e=new d,{minTexture:n,maxTexture:o,sumTexture:r,numOfNoDataTexture:a}=this.config,i=t.glFragCoord.xy,s=new c(i.multiply(2)),u=new w(0),p=y(n,s,u),l=y(n,s.add(new c(-1,0)),u),x=y(n,s.add(new c(0,-1)),u),g=y(n,s.add(new c(-1,-1)),u),v=M(M(p,M(l,new m(h))),M(x,M(g,new m(h)))),T=y(o,s,u),b=y(o,s.add(new c(-1,0)),u),j=y(o,s.add(new c(0,-1)),u),S=y(o,s.add(new c(-1,-1)),u),F=P(P(T,P(b,new m(-h))),P(j,P(S,new m(-h)))),C=y(r,s,u),G=y(r,s.add(new c(-1,0)),u),k=y(r,s.add(new c(0,-1)),u),q=y(r,s.add(new c(-1,-1)),u),z=D(N(C),N(G),N(k),N(q)),A=y(a,s,u),B=y(a,s.add(new c(-1,0)),u),E=y(a,s.add(new c(0,-1)),u),H=y(a,s.add(new c(-1,-1)),u),I=new f(this.config.isFirstPass),J=D(O(A,I),O(B,I),O(E,I),O(H,I));return e.fragData0=v,e.fragData1=F,e.fragData2=z,e.fragData3=J,e}}function M(t,e){const n=x(t.a,new f(0));return g(t,e).multiply(new f(1).subtract(n)).add(e.multiply(n))}function P(t,e){const n=x(t.a,new f(0));return v(t,e).multiply(new f(1).subtract(n)).add(e.multiply(n))}function N(t){const e=x(t.a,new f(0)),n=new f(1).subtract(e);return t.multiply(n)}function O(t,e){const n=x(t.a,new f(0)),o=new f(1).subtract(e);return e.multiply(n).multiply(new m(1)).add(o.multiply(t))}t([o(S)],F.prototype,"config",void 0),t([e(0,r(b))],F.prototype,"vertex",null),t([e(0,r(j))],F.prototype,"fragment",null);export{F as TextureStatisticsMinMaxSumShader};
5
+ import{__decorate as t,__param as e}from"tslib";import{GraphShaderModule as n,FragmentOutput as o,location as r,uniform as a,input as i,VertexInput as s,UniformGroup as d,FragmentInput as u}from"../../GraphShaderModule.js";import{Vec4 as p,IVec2 as l,Int as w,texelFetch as m,Float as c,step as y,min as f,max as x,Vec2 as g,Sampler2D as v}from"../../graph/glsl.js";import{maxRepresentableInt as h}from"./constants.js";import{uvToClip as T,sum4 as D}from"./utils.js";class b extends s{}t([r(0,g)],b.prototype,"position",void 0);class j extends u{}class S extends d{}t([a(v)],S.prototype,"minTexture",void 0),t([a(v)],S.prototype,"maxTexture",void 0),t([a(v)],S.prototype,"sumTexture",void 0),t([a(v)],S.prototype,"numOfNoDataTexture",void 0),t([a(w)],S.prototype,"width",void 0),t([a(w)],S.prototype,"height",void 0),t([a(w)],S.prototype,"isFirstPass",void 0);class F extends n{constructor(){super(...arguments),this.type="TextureStatisticsMinMaxSumShader"}vertex(t){const e=t.position;return{uv:e,glPosition:new p(T(e),0,1)}}fragment(t){const e=new o,{minTexture:n,maxTexture:r,sumTexture:a,numOfNoDataTexture:i}=this.config,s=t.glFragCoord.xy,d=new l(s.multiply(2)),u=new w(0),y=m(n,d,u),f=m(n,d.add(new l(-1,0)),u),x=m(n,d.add(new l(0,-1)),u),g=m(n,d.add(new l(-1,-1)),u),v=M(M(y,M(f,new p(h))),M(x,M(g,new p(h)))),T=m(r,d,u),b=m(r,d.add(new l(-1,0)),u),j=m(r,d.add(new l(0,-1)),u),S=m(r,d.add(new l(-1,-1)),u),F=P(P(T,P(b,new p(-h))),P(j,P(S,new p(-h)))),C=m(a,d,u),G=m(a,d.add(new l(-1,0)),u),k=m(a,d.add(new l(0,-1)),u),q=m(a,d.add(new l(-1,-1)),u),z=D(N(C),N(G),N(k),N(q)),A=m(i,d,u),B=m(i,d.add(new l(-1,0)),u),E=m(i,d.add(new l(0,-1)),u),H=m(i,d.add(new l(-1,-1)),u),I=new c(this.config.isFirstPass),J=D(O(A,I),O(B,I),O(E,I),O(H,I));return e.fragData0=v,e.fragData1=F,e.fragData2=z,e.fragData3=J,e}}function M(t,e){const n=y(t.a,new c(0));return f(t,e).multiply(new c(1).subtract(n)).add(e.multiply(n))}function P(t,e){const n=y(t.a,new c(0));return x(t,e).multiply(new c(1).subtract(n)).add(e.multiply(n))}function N(t){const e=y(t.a,new c(0)),n=new c(1).subtract(e);return t.multiply(n)}function O(t,e){const n=y(t.a,new c(0)),o=new c(1).subtract(e);return e.multiply(n).multiply(new p(1)).add(o.multiply(t))}t([a(S)],F.prototype,"config",void 0),t([e(0,i(b))],F.prototype,"vertex",null),t([e(0,i(j))],F.prototype,"fragment",null);export{F as TextureStatisticsMinMaxSumShader};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as t,__param as e}from"tslib";import{location as o,uniform as r,input as i,VertexInput as s,UniformGroup as a,GraphShaderModule as p,FragmentOutput as n,FragmentInput as u}from"../../GraphShaderModule.js";import{Vec2 as d,Sampler2D as x,Float as m,Vec4 as f,IVec2 as l,Int as g,texelFetch as v,sqrt as c}from"../../graph/glsl.js";import{uvToClip as T}from"./utils.js";class y extends s{}t([o(0,d)],y.prototype,"position",void 0);class h extends u{}class D extends a{}t([r(x)],D.prototype,"minTexture",void 0),t([r(x)],D.prototype,"maxTexture",void 0),t([r(x)],D.prototype,"sumTexture",void 0),t([r(x)],D.prototype,"numOfNoDataTexture",void 0),t([r(x)],D.prototype,"diffSqTexture",void 0),t([r(m)],D.prototype,"numTexels",void 0);class S extends p{constructor(){super(...arguments),this.type="TextureStatisticsStdDevShader"}vertex(t){const e=t.position;return{uv:e,glPosition:new f(T(e),0,1)}}fragment(t){const e=new n,{minTexture:o,maxTexture:r,numOfNoDataTexture:i,sumTexture:s,diffSqTexture:a}=this.config,p=t.glFragCoord.xy,u=new l(p),d=new g(0),x=v(o,u,d),m=v(r,u,d),f=v(s,u,d),T=v(i,u,d).r,y=v(a,u,d),h=this.config.numTexels.subtract(T),D=f.divide(h),S=y.divide(h),w=c(S);return e.fragData0=x,e.fragData1=m,e.fragData2=D,e.fragData3=w,e}}t([r(D)],S.prototype,"config",void 0),t([e(0,i(y))],S.prototype,"vertex",null),t([e(0,i(h))],S.prototype,"fragment",null);export{S as TextureStatisticsStdDevShader};
5
+ import{__decorate as t,__param as e}from"tslib";import{GraphShaderModule as o,FragmentOutput as r,location as i,uniform as s,input as a,VertexInput as p,UniformGroup as n,FragmentInput as u}from"../../GraphShaderModule.js";import{Vec4 as d,IVec2 as x,Int as m,texelFetch as f,sqrt as l,Vec2 as g,Sampler2D as v,Float as c}from"../../graph/glsl.js";import{uvToClip as T}from"./utils.js";class y extends p{}t([i(0,g)],y.prototype,"position",void 0);class h extends u{}class D extends n{}t([s(v)],D.prototype,"minTexture",void 0),t([s(v)],D.prototype,"maxTexture",void 0),t([s(v)],D.prototype,"sumTexture",void 0),t([s(v)],D.prototype,"numOfNoDataTexture",void 0),t([s(v)],D.prototype,"diffSqTexture",void 0),t([s(c)],D.prototype,"numTexels",void 0);class S extends o{constructor(){super(...arguments),this.type="TextureStatisticsStdDevShader"}vertex(t){const e=t.position;return{uv:e,glPosition:new d(T(e),0,1)}}fragment(t){const e=new r,{minTexture:o,maxTexture:i,numOfNoDataTexture:s,sumTexture:a,diffSqTexture:p}=this.config,n=t.glFragCoord.xy,u=new x(n),d=new m(0),g=f(o,u,d),v=f(i,u,d),c=f(a,u,d),T=f(s,u,d).r,y=f(p,u,d),h=this.config.numTexels.subtract(T),D=c.divide(h),S=y.divide(h),w=l(S);return e.fragData0=g,e.fragData1=v,e.fragData2=D,e.fragData3=w,e}}t([s(D)],S.prototype,"config",void 0),t([e(0,a(y))],S.prototype,"vertex",null),t([e(0,a(h))],S.prototype,"fragment",null);export{S as TextureStatisticsStdDevShader};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as t,__param as e}from"tslib";import{location as o,uniform as r,input as s,VertexInput as a,UniformGroup as n,GraphShaderModule as i,FragmentOutput as p,FragmentInput as d}from"../../GraphShaderModule.js";import{Vec2 as l,Sampler2D as u,Int as f,Vec4 as g,IVec2 as m,texelFetch as c}from"../../graph/glsl.js";import{uvToClip as w,sum4 as x}from"./utils.js";class y extends a{}t([o(0,l)],y.prototype,"position",void 0);class h extends d{}class v extends n{}t([r(u)],v.prototype,"sumTexture",void 0),t([r(f)],v.prototype,"width",void 0),t([r(f)],v.prototype,"height",void 0);class D extends i{constructor(){super(...arguments),this.type="TextureStatisticsSumOfSquaredDiffShader"}vertex(t){const e=t.position;return{uv:e,glPosition:new g(w(e),0,1)}}fragment(t){const e=new p,{sumTexture:o}=this.config,r=t.glFragCoord.xy,s=new m(r.multiply(2)),a=new f(0),n=c(o,s,a),i=c(o,s.add(new m(-1,0)),a),d=c(o,s.add(new m(0,-1)),a),l=c(o,s.add(new m(-1,-1)),a),u=x(n,i,d,l);return e.fragData0=u,e.fragData1=new g(0),e.fragData2=new g(0),e.fragData3=new g(0),e}}t([r(v)],D.prototype,"config",void 0),t([e(0,s(y))],D.prototype,"vertex",null),t([e(0,s(h))],D.prototype,"fragment",null);export{D as TextureStatisticsSumOfSquaredDiffShader};
5
+ import{__decorate as t,__param as e}from"tslib";import{GraphShaderModule as o,FragmentOutput as r,location as s,uniform as a,input as n,VertexInput as i,UniformGroup as p,FragmentInput as d}from"../../GraphShaderModule.js";import{Vec4 as l,IVec2 as u,Int as f,texelFetch as g,Vec2 as m,Sampler2D as c}from"../../graph/glsl.js";import{uvToClip as w,sum4 as x}from"./utils.js";class y extends i{}t([s(0,m)],y.prototype,"position",void 0);class h extends d{}class v extends p{}t([a(c)],v.prototype,"sumTexture",void 0),t([a(f)],v.prototype,"width",void 0),t([a(f)],v.prototype,"height",void 0);class D extends o{constructor(){super(...arguments),this.type="TextureStatisticsSumOfSquaredDiffShader"}vertex(t){const e=t.position;return{uv:e,glPosition:new l(w(e),0,1)}}fragment(t){const e=new r,{sumTexture:o}=this.config,s=t.glFragCoord.xy,a=new u(s.multiply(2)),n=new f(0),i=g(o,a,n),p=g(o,a.add(new u(-1,0)),n),d=g(o,a.add(new u(0,-1)),n),m=g(o,a.add(new u(-1,-1)),n),c=x(i,p,d,m);return e.fragData0=c,e.fragData1=new l(0),e.fragData2=new l(0),e.fragData3=new l(0),e}}t([a(v)],D.prototype,"config",void 0),t([e(0,n(y))],D.prototype,"vertex",null),t([e(0,n(h))],D.prototype,"fragment",null);export{D as TextureStatisticsSumOfSquaredDiffShader};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as o}from"tslib";import{define as t,uniform as r,option as i}from"../../../GraphShaderModule.js";import{Vec4 as s,Float as e}from"../../../graph/glsl.js";import{BaseRasterColorizerShader as p}from"./BaseRasterColorizerShader.js";import{lookupColor as a,ColormapConfig as m}from"./lut.js";import{stretch as h,StretchConfig as l}from"./stretch.js";class n extends p{constructor(){super(...arguments),this.type="RasterColorizerStretchShader",this.isMultiband=!0,this.applyColormap=!1,this.useGamma=!1,this.noOp=!1}_colorize(o){const t=this._getPixel(o);if(this.noOp)return t;let r=h(t,this.stretchConfig,this.useGamma);if(this.isMultiband)return r;if(r=new s(r.rrr,r.a),this.applyColormap){const o=this.useGamma?255:1;r=a(r,new e(o),this.colormapConfig)}return r}}o([t],n.prototype,"isMultiband",void 0),o([t],n.prototype,"applyColormap",void 0),o([t],n.prototype,"useGamma",void 0),o([t],n.prototype,"noOp",void 0),o([r(l)],n.prototype,"stretchConfig",void 0),o([i(m)],n.prototype,"colormapConfig",void 0);export{n as RasterColorizerStretchShader};
5
+ import{__decorate as t}from"tslib";import{define as o,uniform as r,option as i}from"../../../GraphShaderModule.js";import{Vec4 as s,Float as e}from"../../../graph/glsl.js";import{BaseRasterColorizerShader as p}from"./BaseRasterColorizerShader.js";import{lookupColor as a,ColormapConfig as h}from"./lut.js";import{stretch as m,stretchWithStatisticsTexture as l,StretchConfig as n,StatisticsConfig as d}from"./stretch.js";class c extends p{constructor(){super(...arguments),this.type="RasterColorizerStretchShader",this.isMultiband=!0,this.applyColormap=!1,this.useGamma=!1,this.noOp=!1,this.draStretchType=0}_colorize(t){const o=this._getPixel(t);if(this.noOp)return o;const{draStretchType:r,stretchConfig:i,useGamma:p,statisticsConfig:h}=this;let n=0===r?m(o,i,p):l(o,i,h,p,2===r);if(this.isMultiband)return n;if(n=new s(n.rrr,n.a),this.applyColormap){const t=this.useGamma?255:1;n=a(n,new e(t),this.colormapConfig)}return n}}t([o],c.prototype,"isMultiband",void 0),t([o],c.prototype,"applyColormap",void 0),t([o],c.prototype,"useGamma",void 0),t([o],c.prototype,"noOp",void 0),t([o],c.prototype,"draStretchType",void 0),t([r(n)],c.prototype,"stretchConfig",void 0),t([i(h)],c.prototype,"colormapConfig",void 0),t([i(d)],c.prototype,"statisticsConfig",void 0);export{c as RasterColorizerStretchShader};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{maxMapSizeGpu as n}from"../../../../../../../../../layers/support/rasterFunctions/pixelUtils.js";import{Vec3 as t,step as e,sign as r,dot as l,Vec4 as o,floor as u,abs as i,Float as s,mix as c}from"../../../../graph/glsl.js";function w(n){const t=r(n),e=n.add(i(t).subtract(1));return t.multiply(t).divide(e)}function a(n){return new o(u(n.rgb.add(.5)),n.a)}function p(n,t){return e(t.x,n).multiply(e(n,t.y))}function d(o,u){let i=new t(0,0,0);const s=new t(o);for(let r=0;r<n/3;r++){const n=6*r,l=new t(u[n],u[n+2],u[n+4]),o=new t(u[n+1],u[n+3],u[n+5]);i=i.add(e(l,s).multiply(e(s,o)))}return r(l(i,new t(1,1,1)))}function f(n,o,u){const i=new t(n);let w=new t(0,0,0),a=new s(0);for(let r=0;r<u/3;r++){const n=9*r,l=new t(o[n],o[n+3],o[n+6]),u=new t(o[n+1],o[n+4],o[n+7]),s=e(l,i).multiply(e(i,u)),p=new t(o[n+2],o[n+5],o[n+8]);a=c(a,p.x,s.x),a=c(a,p.y,s.y),a=c(a,p.z,s.z),w=w.add(s)}return{mapValue:a,includeMask:r(l(w,new t(1,1,1)))}}export{f as computeMapValue,d as computeSingleBandRangeFactor,p as getRangeClipFactor,w as invertValue,a as roundOutput};
5
+ import{maxMapSizeGpu as n}from"../../../../../../../../../layers/support/rasterFunctions/pixelUtils.js";import{Vec3 as t,step as e,sign as r,dot as l,abs as o,Vec4 as u,floor as i,Float as s,mix as c}from"../../../../graph/glsl.js";function w(n){const t=r(n),e=n.add(o(t).subtract(1));return t.multiply(t).divide(e)}function a(n){return new u(i(n.rgb.add(.5)),n.a)}function p(n,t){return e(t.x,n).multiply(e(n,t.y))}function d(o,u){let i=new t(0,0,0);const s=new t(o);for(let r=0;r<n/3;r++){const n=6*r,l=new t(u[n],u[n+2],u[n+4]),o=new t(u[n+1],u[n+3],u[n+5]);i=i.add(e(l,s).multiply(e(s,o)))}return r(l(i,new t(1,1,1)))}function f(n,o,u){const i=new t(n);let w=new t(0,0,0),a=new s(0);for(let r=0;r<u/3;r++){const n=9*r,l=new t(o[n],o[n+3],o[n+6]),u=new t(o[n+1],o[n+4],o[n+7]),s=e(l,i).multiply(e(i,u)),p=new t(o[n+2],o[n+5],o[n+8]);a=c(a,p.x,s.x),a=c(a,p.y,s.y),a=c(a,p.z,s.z),w=w.add(s)}return{mapValue:a,includeMask:r(l(w,new t(1,1,1)))}}export{f as computeMapValue,d as computeSingleBandRangeFactor,p as getRangeClipFactor,w as invertValue,a as roundOutput};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as t}from"tslib";import{uniform as o,UniformGroup as i}from"../../../GraphShaderModule.js";import{Vec4 as r,clamp as u,step as m,Float as p,sign as a,Vec3 as e,pow as n}from"../../../graph/glsl.js";import{oneMinus as d}from"../utils.js";class f extends i{}function l(t,o){const{minCutOff:i,maxCutOff:r,factor:m,minOutput:p}=o;return u(t,i,r).subtract(i).multiply(m).add(p)}function s(t,o){const{minCutOff:i,maxCutOff:r,minOutput:f,maxOutput:l,gamma:s,gammaCorrection:c}=o,y=u(t,i,r).subtract(i),v=r.subtract(i),O=y.divide(v),b=m(new p(1),s),g=a(s.subtract(1)),C=l.subtract(f),x=new e(1),h=n(x.divide(C),O.multiply(c)),j=d(b.multiply(g).multiply(h)),w=n(O,x.divide(s)),G=j.multiply(C).multiply(w).add(f);return u(G,f,l)}function c(t,o,i,u=255){const m=i?s(t.rgb,o).divide(u):l(t.rgb,o);return new r(m,t.a)}t([o(p)],f.prototype,"minOutput",void 0),t([o(p)],f.prototype,"maxOutput",void 0),t([o(e)],f.prototype,"minCutOff",void 0),t([o(e)],f.prototype,"maxCutOff",void 0),t([o(e)],f.prototype,"factor",void 0),t([o(e)],f.prototype,"gamma",void 0),t([o(e)],f.prototype,"gammaCorrection",void 0);export{f as StretchConfig,c as stretch};
5
+ import{__decorate as t}from"tslib";import{uniform as r,UniformGroup as o}from"../../../GraphShaderModule.js";import{Vec4 as e,IVec2 as i,Int as u,texelFetch as m,max as p,min as a,Vec3 as n,clamp as d,step as s,Float as f,sign as c,pow as l,Sampler2D as v}from"../../../graph/glsl.js";import{oneMinus as x}from"../utils.js";import{invertValue as y}from"./processor/math.js";class b extends o{}t([r(f)],b.prototype,"minOutput",void 0),t([r(f)],b.prototype,"maxOutput",void 0),t([r(n)],b.prototype,"minCutOff",void 0),t([r(n)],b.prototype,"maxCutOff",void 0),t([r(n)],b.prototype,"factor",void 0),t([r(n)],b.prototype,"gamma",void 0),t([r(n)],b.prototype,"gammaCorrection",void 0);class O extends o{}function g(t,r){const{minCutOff:o,maxCutOff:e,factor:i,minOutput:u}=r;return d(t,o,e).subtract(o).multiply(i).add(u)}function C(t,r){const{minCutOff:o,maxCutOff:e,minOutput:i,maxOutput:u,gamma:m,gammaCorrection:p}=r,a=d(t,o,e).subtract(o),v=e.subtract(o),y=a.divide(v),b=s(new f(1),m),O=c(m.subtract(1)),g=u.subtract(i),C=new n(1),T=l(C.divide(g),y.multiply(p)),w=x(b.multiply(O).multiply(T)),h=l(y,C.divide(m)),j=w.multiply(g).multiply(h).add(i);return d(j,i,u)}function T(t,r,o,i=255){const u=o?C(t.rgb,r).divide(i):g(t.rgb,r);return new e(u,t.a)}function w(t,r,o,d,s){const f=new i(0,0),c=new u(0);let l=m(o.minTexture,f,c).rgb,v=m(o.maxTexture,f,c).rgb;if(s){const t=m(o.meanTexture,f,c).rgb,r=m(o.stddevTexture,f,c).rgb.multiply(o.numberOfStandardDeviations);l=p(l,t.subtract(r)),v=a(v,t.add(r))}const x=v.subtract(l),b=new n(y(x.x),y(x.y),y(x.z)),O=r.maxOutput.subtract(r.minOutput).multiply(b),T={...r,minCutOff:l,maxCutOff:v,factor:O},w=d?C(t.rgb,r).divide(255):g(t.rgb,T);return new e(w,t.a)}t([r(v)],O.prototype,"minTexture",void 0),t([r(v)],O.prototype,"maxTexture",void 0),t([r(v)],O.prototype,"meanTexture",void 0),t([r(v)],O.prototype,"stddevTexture",void 0),t([r(f)],O.prototype,"numberOfStandardDeviations",void 0);export{O as StatisticsConfig,b as StretchConfig,T as stretch,w as stretchWithStatisticsTexture};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{maxHighlightReasons as t}from"../../../definitions.js";import{Float as n,greaterThan as r,float as u,max as c,mod as i,floor as o,vec4 as e,dot as f,vec2 as s,fract as l,sin as a,equal as m,vec3 as p,Vec4 as b,divide as d}from"../../graph/glsl.js";import{nanMagicNumber as y}from"./constants.js";function w(t){const n=u(12.9898),r=u(78.233),c=u(43758.5453),o=f(t,s(n,r)),e=i(o,u(3.14));return l(a(e).multiply(c))}function x(t){return m(t,u(y))}function j(t){return d(t,u(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 r=u(2**n);return i(o(t.divide(r)),u(2))}function k(t,n){return r(h(t,n),u(.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),r=u(1).subtract(n),c=t.xyz.subtract(p(0,0,u(128)));return r.multiply(t).add(n.multiply(c))}function C(t){const n=e(255/256,255/65536,255/16777216,255/4294967296);return f(t,n)}function D(t){return c(c(c(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};
5
+ import{maxHighlightReasons as t}from"../../../definitions.js";import{Float as n,greaterThan as r,float as u,max as c,mod as i,floor as o,vec4 as e,dot as f,vec2 as s,fract as l,sin as a,equal as m,Vec4 as p,vec3 as b,divide as d}from"../../graph/glsl.js";import{nanMagicNumber as y}from"./constants.js";function w(t){const n=u(12.9898),r=u(78.233),c=u(43758.5453),o=f(t,s(n,r)),e=i(o,u(3.14));return l(a(e).multiply(c))}function x(t){return m(t,u(y))}function j(t){return d(t,u(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 r=u(2**n);return i(o(t.divide(r)),u(2))}function k(t,n){return r(h(t,n),u(.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),r=u(1).subtract(n),c=t.xyz.subtract(b(0,0,u(128)));return r.multiply(t).add(n.multiply(c))}function C(t){const n=e(255/256,255/65536,255/16777216,255/4294967296);return f(t,n)}function D(t){return c(c(c(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 p(0);const i=new p(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,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{property as t}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as s}from"../../../core/accessorSupport/decorators/subclass.js";import{create as i}from"../../../geometry/support/aaBoundingRect.js";import{equals as o}from"../../../geometry/support/spatialReferenceUtils.js";import r from"../tiling/TileInfoView.js";import"../tiling/TileKey.js";import"../tiling/TileQueue.js";import"../tiling/TileStrategy.js";import{LayerView2DMixin as l}from"./LayerView2D.js";import{Display as n}from"./support/Display.js";import a from"../../layers/LayerView.js";import{RefreshableLayerView as p}from"../../layers/RefreshableLayerView.js";const h=new Set,c=[],d=[];class u{constructor(e,t,s,o,r,l,n,a=[0,0],p=i()){this.id=e,this.level=t,this.row=s,this.col=o,this.world=r,this.resolution=l,this.scale=n,this.coords=a,this.bounds=p}}let m=class extends(p(l(a))){constructor(e){super(e),this._tileMap=new Map,this.layer=null,this.tiles=[]}initialize(){this.display=new n(this),this.container.addChild(this.display)}get _tileInfoView(){const e=this.layer?.tileInfo;return e?new r(e):null}attach(){}detach(){}requestRender(){this.display.requestRender()}tilesChanged(e,t){}supportsSpatialReference(e){const t=this.layer?.tileInfo;return!t||o(t.spatialReference,e)}async doRefresh(){}isUpdating(){return!1}update(e){const t=this._tileInfoView,s=this.tiles;if(t){const i=t.getTileCoverage(e.state,0),{spans:o,lodInfo:r}=i??{};if(o?.length&&r)for(const{row:e,colFrom:t,colTo:l}of o)for(let i=t;i<=l;i++){const t=r.normalizeCol(i),o=r.getWorldForColumn(i),l=`${r.level}/${e}/${t}/${o}`;if(!this._tileMap.has(l)){const i=new u(l,r.level,e,t,o,r.resolution,r.scale);r.getTileCoords(i.coords,i,!1),r.getTileBounds(i.bounds,i,!0),this._tileMap.set(l,i),s.push(i),c.push(i)}h.add(l)}}for(let i=s.length-1;i>=0;i--){const e=s[i];h.has(e.id)||(s.splice(i,1),d.push(e),this._tileMap.delete(e.id))}(c.length||d.length)&&(this.tilesChanged(c,d),c.length=d.length=0),h.clear(),this.requestRender()}viewChange(){this.requestUpdate()}moveEnd(){}};e([t()],m.prototype,"_tileInfoView",null),e([t()],m.prototype,"layer",void 0),m=e([s("esri.views.2d.layers.BaseLayerView2D")],m);const f=m;export{f as default};
5
+ import{__decorate as e}from"tslib";import{property as t}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as s}from"../../../core/accessorSupport/decorators/subclass.js";import{create as i}from"../../../geometry/support/aaBoundingRect.js";import{equals as o}from"../../../geometry/support/spatialReferenceUtils.js";import r from"../tiling/TileInfoView.js";import"../tiling/TileKey.js";import"../tiling/TileQueue.js";import"../tiling/TileStrategy.js";import{LayerView2DMixin as l}from"./LayerView2D.js";import{Display as n}from"./support/Display.js";import a from"../../layers/LayerView.js";import{RefreshableLayerView as p}from"../../layers/RefreshableLayerView.js";const h=new Set,c=[],d=[];class u{constructor(e,t,s,o,r,l,n,a=[0,0],p=i()){this.id=e,this.level=t,this.row=s,this.col=o,this.world=r,this.resolution=l,this.scale=n,this.coords=a,this.bounds=p}}let m=class extends(p(l(a))){constructor(e){super(e),this._tileMap=new Map,this.layer=null,this.tiles=[]}initialize(){this.display=new n(this),this.container.addChild(this.display)}get _tileInfoView(){const e=this.layer?.tileInfo;return e?new r(e):null}attach(){}detach(){}requestRender(){this.display.requestRender()}tilesChanged(e,t){}supportsSpatialReference(e){const t=this.layer?.tileInfo;return!t||o(t.spatialReference,e)}async doRefresh(){}isUpdating(){return!1}update(e){const t=this._tileInfoView,s=this.tiles;if(t){const i=t.getTileCoverage(e.state,0),{spans:o,lodInfo:r}=i??{};if(o?.length&&r)for(const{row:e,colFrom:t,colTo:l}of o)for(let i=t;i<=l;i++){const t=r.normalizeCol(i),o=r.getWorldForColumn(i),l=`${r.level}/${e}/${t}/${o}`;if(!this._tileMap.has(l)){const i=new u(l,r.level,e,t,o,r.resolution,r.scale),n=i;r.getTileCoords(n.coords,n,!1),r.getTileBounds(i.bounds,n,!0),this._tileMap.set(l,n),s.push(n),c.push(n)}h.add(l)}}for(let i=s.length-1;i>=0;i--){const e=s[i];h.has(e.id)||(s.splice(i,1),d.push(e),this._tileMap.delete(e.id))}(c.length||d.length)&&(this.tilesChanged(c,d),c.length=d.length=0),h.clear(),this.requestRender()}viewChange(){this.requestUpdate()}moveEnd(){}};e([t()],m.prototype,"_tileInfoView",null),e([t()],m.prototype,"layer",void 0),m=e([s("esri.views.2d.layers.BaseLayerView2D")],m);const f=m;export{f as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{property as t}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as s}from"../../../core/accessorSupport/decorators/subclass.js";import{e as r}from"../../../chunks/earcut.js";import{create as o}from"../../../geometry/support/aaBoundingRect.js";import{closeRings as i}from"../../../geometry/support/coordsUtils.js";import{normalizeCentralMeridianForDisplay as n}from"../../../geometry/support/normalizeUtilsSync.js";import{equals as a}from"../../../geometry/support/spatialReferenceUtils.js";import{checkProjectionSupport as c,project as l}from"../../../layers/graphics/data/projectionSupport.js";import p from"../tiling/TileInfoView.js";import"../tiling/TileKey.js";import"../tiling/TileQueue.js";import"../tiling/TileStrategy.js";import{thinLineHalfWidthThreshold as f}from"../engine/webgl/definitions.js";import{LineTessellation as h}from"../engine/webgl/TurboLine.js";import{LayerView2DMixin as d}from"./LayerView2D.js";import u from"./support/DisplayGL.js";import{analyzeRings as m}from"./support/util.js";import y from"../../layers/LayerView.js";import{RefreshableLayerView as x}from"../../layers/RefreshableLayerView.js";const g=new Set,v=[],w=[];class T{constructor(e,t,s,r,i,n,a,c=[0,0],l=o()){this.id=e,this.level=t,this.row=s,this.col=r,this.world=i,this.resolution=n,this.scale=a,this.coords=c,this.bounds=l}}let j=class extends(x(d(y))){constructor(e){super(e),this._tileMap=new Map,this.container=new u(this),this.layer=null,this.tiles=[],this._renderTarget={framebuffer:null,viewport:[0,0,0,0]}}get _tileInfoView(){const e=this.layer?.tileInfo;return e?new p(e):null}get context(){return this.view.stage.context.gl}attach(){}detach(){}requestRender(){this.container.requestRender()}tilesChanged(e,t){}supportsSpatialReference(e){const t=this.layer?.tileInfo;return!t||a(t.spatialReference,e)}async doRefresh(){}isUpdating(){return!1}update(e){const t=this._tileInfoView,s=this.tiles;if(t){const r=t.getTileCoverage(e.state,0),o=r?.spans,i=r?.lodInfo;if(o?.length&&i){const e=i.level;for(const{row:t,colFrom:r,colTo:n}of o)for(let o=r;o<=n;o++){const r=i.normalizeCol(o),n=i.getWorldForColumn(o),a=`${e}/${t}/${r}/${n}`;if(!this._tileMap.has(a)){const o=new T(a,e,t,r,n,i.resolution,i.scale);i.getTileCoords(o.coords,o,!1),i.getTileBounds(o.bounds,o,!0),this._tileMap.set(a,o),s.push(o),v.push(o)}g.add(a)}}}for(let r=s.length-1;r>=0;r--){const e=s[r];g.has(e.id)||(s.splice(r,1),w.push(e),this._tileMap.delete(e.id))}(v.length||w.length)&&(this.tilesChanged(v,w),v.length=w.length=0),g.clear(),this.requestRender()}viewChange(){this.requestUpdate()}moveEnd(){}bindRenderTarget(){this.context.bindFramebuffer(this.context.FRAMEBUFFER,this._renderTarget.framebuffer),this.context.viewport(this._renderTarget.viewport[0],this._renderTarget.viewport[1],this._renderTarget.viewport[2],this._renderTarget.viewport[3])}getRenderTarget(){return this._renderTarget}async tessellateExtent(e){const t={vertices:[],indices:[]},s=await this._projectAndNormalizeGeometry(e),r=t.vertices.length;return t.vertices.push({x:s.xmin,y:s.ymin,xOffset:0,yOffset:0,uTexcoord:0,vTexcoord:0,distance:0}),t.vertices.push({x:s.xmax,y:s.ymin,xOffset:0,yOffset:0,uTexcoord:1,vTexcoord:0,distance:0}),t.vertices.push({x:s.xmin,y:s.ymax,xOffset:0,yOffset:0,uTexcoord:0,vTexcoord:1,distance:0}),t.vertices.push({x:s.xmax,y:s.ymax,xOffset:0,yOffset:0,uTexcoord:1,vTexcoord:1,distance:0}),t.indices.push(r,r+1,r+2,r+1,r+3,r+2),t}async tessellatePoint(e,t){const s=await this._projectAndNormalizeGeometry(e);return this._tessellatePoints([s],t)}async tessellateMultipoint(e,t){const s=await this._projectAndNormalizeGeometry(e),r=s.points.map(e=>({x:e[0],y:e[1],spatialReference:s.spatialReference}));return this._tessellatePoints(r,t)}async _tessellatePoints(e,t){const s={vertices:[],indices:[]};for(const r of e){const e=s.vertices.length;s.vertices.push({x:r.x,y:r.y,xOffset:t.x,yOffset:t.y+t.height,uTexcoord:0,vTexcoord:0,distance:0}),s.vertices.push({x:r.x,y:r.y,xOffset:t.x+t.width,yOffset:t.y+t.height,uTexcoord:1,vTexcoord:0,distance:0}),s.vertices.push({x:r.x,y:r.y,xOffset:t.x,yOffset:t.y,uTexcoord:0,vTexcoord:1,distance:0}),s.vertices.push({x:r.x,y:r.y,xOffset:t.x+t.width,yOffset:t.y,uTexcoord:1,vTexcoord:1,distance:0}),s.indices.push(e,e+1,e+2,e+1,e+3,e+2)}return s}async tessellatePolyline(e,t){const s={vertices:[],indices:[]},r=(await this._projectAndNormalizeGeometry(e)).paths;if(!r?.length)return s;let o;const i=new h((e,r,i,n,a,c,l,p,f,h,d)=>{const u=s.vertices.length;return s.vertices.push({x:e,y:-r,xOffset:l*t/2,yOffset:p*t/2,uTexcoord:d/o,vTexcoord:(h+1)/2,distance:d}),u},(e,t,r)=>{s.indices.push(e,t,r)},!0);for(const n of r){o=0;for(let t=1;t<n.length;++t){const e=n[t][0]-n[t-1][0],s=n[t][1]-n[t-1][1];o+=Math.sqrt(e*e+s*s)}const e=n.map(e=>({x:e[0],y:-e[1]}));i.tessellate(e,_)}return s}async tessellatePolygon(e){const t={vertices:[],indices:[]},s=await this._projectAndNormalizeGeometry(e),r=s.rings;if(!r?.length)return t;i(s);for(const i of s.rings)for(const e of i)e[1]=-e[1];let o=1/0,n=1/0,a=-1/0,c=-1/0;return m(s.rings,()=>{},(e,t,s)=>{for(let r=e;r<t;r+=2)o=Math.min(o,s[r]),n=Math.min(n,s[r+1]),a=Math.max(a,s[r]),c=Math.max(c,s[r+1])}),m(s.rings,()=>{},(e,s,r,i)=>{this._invokeEarcut(t,e,s,r,i,[o,n,a,c])}),t}_invokeEarcut(e,t,s,o,i,n){const a=o.slice(t,s),c=r(a,i,2),l=e.vertices.length;for(let r=0;r<a.length;r+=2){const t=a[r],s=a[r+1];e.vertices.push({x:t,y:-s,xOffset:0,yOffset:0,uTexcoord:(t-n[0])/(n[2]-n[0]),vTexcoord:1-(s-n[1])/(n[3]-n[1]),distance:0})}for(let r=0;r<c.length;++r)e.indices.push(l+c[r])}async _projectAndNormalizeGeometry(e){await c(e.spatialReference,this.view.spatialReference);const t=n(e);return l(t,e.spatialReference,this.view.spatialReference)}};e([t()],j.prototype,"_tileInfoView",null),e([t()],j.prototype,"layer",void 0),e([t()],j.prototype,"context",null),j=e([s("esri.views.2d.layers.BaseLayerViewGL2D")],j);const _={pixelCoordRatio:1,wrapDistance:1e11,halfWidth:f+1,initialDistance:0,textured:!0,offset:0},R=j;export{R as default};
5
+ import{__decorate as e}from"tslib";import{property as t}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as s}from"../../../core/accessorSupport/decorators/subclass.js";import{e as r}from"../../../chunks/earcut.js";import{create as o}from"../../../geometry/support/aaBoundingRect.js";import{closeRings as i}from"../../../geometry/support/coordsUtils.js";import{normalizeCentralMeridianForDisplay as n}from"../../../geometry/support/normalizeUtilsSync.js";import{equals as a}from"../../../geometry/support/spatialReferenceUtils.js";import{checkProjectionSupport as c,project as l}from"../../../layers/graphics/data/projectionSupport.js";import p from"../tiling/TileInfoView.js";import"../tiling/TileKey.js";import"../tiling/TileQueue.js";import"../tiling/TileStrategy.js";import{thinLineHalfWidthThreshold as f}from"../engine/webgl/definitions.js";import{LineTessellation as h}from"../engine/webgl/TurboLine.js";import{LayerView2DMixin as d}from"./LayerView2D.js";import u from"./support/DisplayGL.js";import{analyzeRings as m}from"./support/util.js";import y from"../../layers/LayerView.js";import{RefreshableLayerView as x}from"../../layers/RefreshableLayerView.js";const g=new Set,v=[],w=[];class T{constructor(e,t,s,r,i,n,a,c=[0,0],l=o()){this.id=e,this.level=t,this.row=s,this.col=r,this.world=i,this.resolution=n,this.scale=a,this.coords=c,this.bounds=l}}let j=class extends(x(d(y))){constructor(e){super(e),this._tileMap=new Map,this.container=new u(this),this.layer=null,this.tiles=[],this._renderTarget={framebuffer:null,viewport:[0,0,0,0]}}get _tileInfoView(){const e=this.layer?.tileInfo;return e?new p(e):null}get context(){return this.view.stage.context.gl}attach(){}detach(){}requestRender(){this.container.requestRender()}tilesChanged(e,t){}supportsSpatialReference(e){const t=this.layer?.tileInfo;return!t||a(t.spatialReference,e)}async doRefresh(){}isUpdating(){return!1}update(e){const t=this._tileInfoView,s=this.tiles;if(t){const r=t.getTileCoverage(e.state,0),o=r?.spans,i=r?.lodInfo;if(o?.length&&i){const e=i.level;for(const{row:t,colFrom:r,colTo:n}of o)for(let o=r;o<=n;o++){const r=i.normalizeCol(o),n=i.getWorldForColumn(o),a=`${e}/${t}/${r}/${n}`;if(!this._tileMap.has(a)){const o=new T(a,e,t,r,n,i.resolution,i.scale),c=o;i.getTileCoords(c.coords,c,!1),i.getTileBounds(o.bounds,c,!0),this._tileMap.set(a,c),s.push(c),v.push(c)}g.add(a)}}}for(let r=s.length-1;r>=0;r--){const e=s[r];g.has(e.id)||(s.splice(r,1),w.push(e),this._tileMap.delete(e.id))}(v.length||w.length)&&(this.tilesChanged(v,w),v.length=w.length=0),g.clear(),this.requestRender()}viewChange(){this.requestUpdate()}moveEnd(){}bindRenderTarget(){this.context.bindFramebuffer(this.context.FRAMEBUFFER,this._renderTarget.framebuffer),this.context.viewport(this._renderTarget.viewport[0],this._renderTarget.viewport[1],this._renderTarget.viewport[2],this._renderTarget.viewport[3])}getRenderTarget(){return this._renderTarget}async tessellateExtent(e){const t={vertices:[],indices:[]},s=await this._projectAndNormalizeGeometry(e),r=t.vertices.length;return t.vertices.push({x:s.xmin,y:s.ymin,xOffset:0,yOffset:0,uTexcoord:0,vTexcoord:0,distance:0}),t.vertices.push({x:s.xmax,y:s.ymin,xOffset:0,yOffset:0,uTexcoord:1,vTexcoord:0,distance:0}),t.vertices.push({x:s.xmin,y:s.ymax,xOffset:0,yOffset:0,uTexcoord:0,vTexcoord:1,distance:0}),t.vertices.push({x:s.xmax,y:s.ymax,xOffset:0,yOffset:0,uTexcoord:1,vTexcoord:1,distance:0}),t.indices.push(r,r+1,r+2,r+1,r+3,r+2),t}async tessellatePoint(e,t){const s=await this._projectAndNormalizeGeometry(e);return this._tessellatePoints([s],t)}async tessellateMultipoint(e,t){const s=await this._projectAndNormalizeGeometry(e),r=s.points.map(e=>({x:e[0],y:e[1],spatialReference:s.spatialReference}));return this._tessellatePoints(r,t)}async _tessellatePoints(e,t){const s={vertices:[],indices:[]};for(const r of e){const e=s.vertices.length;s.vertices.push({x:r.x,y:r.y,xOffset:t.x,yOffset:t.y+t.height,uTexcoord:0,vTexcoord:0,distance:0}),s.vertices.push({x:r.x,y:r.y,xOffset:t.x+t.width,yOffset:t.y+t.height,uTexcoord:1,vTexcoord:0,distance:0}),s.vertices.push({x:r.x,y:r.y,xOffset:t.x,yOffset:t.y,uTexcoord:0,vTexcoord:1,distance:0}),s.vertices.push({x:r.x,y:r.y,xOffset:t.x+t.width,yOffset:t.y,uTexcoord:1,vTexcoord:1,distance:0}),s.indices.push(e,e+1,e+2,e+1,e+3,e+2)}return s}async tessellatePolyline(e,t){const s={vertices:[],indices:[]},r=(await this._projectAndNormalizeGeometry(e)).paths;if(!r?.length)return s;let o;const i=new h((e,r,i,n,a,c,l,p,f,h,d)=>{const u=s.vertices.length;return s.vertices.push({x:e,y:-r,xOffset:l*t/2,yOffset:p*t/2,uTexcoord:d/o,vTexcoord:(h+1)/2,distance:d}),u},(e,t,r)=>{s.indices.push(e,t,r)},!0);for(const n of r){o=0;for(let t=1;t<n.length;++t){const e=n[t][0]-n[t-1][0],s=n[t][1]-n[t-1][1];o+=Math.sqrt(e*e+s*s)}const e=n.map(e=>({x:e[0],y:-e[1]}));i.tessellate(e,_)}return s}async tessellatePolygon(e){const t={vertices:[],indices:[]},s=await this._projectAndNormalizeGeometry(e),r=s.rings;if(!r?.length)return t;i(s);for(const i of s.rings)for(const e of i)e[1]=-e[1];let o=1/0,n=1/0,a=-1/0,c=-1/0;return m(s.rings,()=>{},(e,t,s)=>{for(let r=e;r<t;r+=2)o=Math.min(o,s[r]),n=Math.min(n,s[r+1]),a=Math.max(a,s[r]),c=Math.max(c,s[r+1])}),m(s.rings,()=>{},(e,s,r,i)=>{this._invokeEarcut(t,e,s,r,i,[o,n,a,c])}),t}_invokeEarcut(e,t,s,o,i,n){const a=o.slice(t,s),c=r(a,i,2),l=e.vertices.length;for(let r=0;r<a.length;r+=2){const t=a[r],s=a[r+1];e.vertices.push({x:t,y:-s,xOffset:0,yOffset:0,uTexcoord:(t-n[0])/(n[2]-n[0]),vTexcoord:1-(s-n[1])/(n[3]-n[1]),distance:0})}for(let r=0;r<c.length;++r)e.indices.push(l+c[r])}async _projectAndNormalizeGeometry(e){await c(e.spatialReference,this.view.spatialReference);const t=n(e);return l(t,e.spatialReference,this.view.spatialReference)}};e([t()],j.prototype,"_tileInfoView",null),e([t()],j.prototype,"layer",void 0),e([t()],j.prototype,"context",null),j=e([s("esri.views.2d.layers.BaseLayerViewGL2D")],j);const _={pixelCoordRatio:1,wrapDistance:1e11,halfWidth:f+1,initialDistance:0,textured:!0,offset:0},R=j;export{R as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../../../AggregateGraphic.js";import r from"../../../Graphic.js";import i from"../../../TrackGraphic.js";import{isSome as s}from"../../../core/arrayUtils.js";import a from"../../../core/Collection.js";import{neverReached as o}from"../../../core/compilerUtils.js";import n from"../../../core/Error.js";import{makeHandle as u,handlesGroup as l}from"../../../core/handleUtils.js";import has from"../../../core/has.js";import h from"../../../core/Logger.js";import{destroyMaybe as c}from"../../../core/maybe.js";import{notDeepEqual as p}from"../../../core/object.js";import{createAbortError as d,createResolver as y,ignoreAbortErrors as g,throwIfNotAbortError as f,isAbortError as m}from"../../../core/promiseUtils.js";import{watch as w}from"../../../core/reactiveUtils.js";import{sqlAnd as v}from"../../../core/sql.js";import{property as _}from"../../../core/accessorSupport/decorators/property.js";import{subclass as b}from"../../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as A}from"../../../core/support/UpdatingHandles.js";import S from"../../../geometry/Extent.js";import F from"../../../layers/effects/FeatureEffectView.js";import{convertFromFeature as j}from"../../../layers/graphics/featureConversionUtils.js";import U from"../../../layers/support/FeatureFilter.js";import{checkServiceCurrentUserSupport as x}from"../../../layers/support/featureLayerUtils.js";import{packFields as I}from"../../../layers/support/fieldUtils.js";import{getEffectiveLayerCapabilities as k}from"../../../layers/support/layerUtils.js";import{combineTimeExtent as E}from"../../../layers/support/timeSupport.js";import C from"../../../rest/support/AggregateFeatureSet.js";import O from"../../../rest/support/AttributeBinsFeatureSet.js";import R from"../../../rest/support/AttributeBinsQuery.js";import V from"../../../rest/support/FeatureSet.js";import q from"../../../rest/support/Query.js";import{LayerView2DMixin as Q}from"./LayerView2D.js";import{FeatureContainer as L}from"./features/FeatureContainer.js";import{createFeaturePipelineWorkerProxy as T}from"./features/FeaturePipelineWorkerProxy.js";import{FeatureSourceEventLog as M}from"./features/FeatureSourceEventLog.js";import{CatalogFootprintLayerAdapter as H}from"./features/layerAdapters/CatalogFootprintLayerAdapter.js";import{FeatureLayerAdapter as P}from"./features/layerAdapters/FeatureLayerAdapter.js";import{createFeatureIdInfo as W}from"./features/layerAdapters/featureServiceUtils.js";import{InMemoryLayerAdapter as D}from"./features/layerAdapters/InMemoryLayerAdapter.js";import{KnowledgeGraphSublayerAdapter as G}from"./features/layerAdapters/KnowledgeGraphSublayerAdapter.js";import{OGCFeatureLayerAdapter as N}from"./features/layerAdapters/OGCFeatureLayerAdapter.js";import{OrientedImageryLayerAdapter as J}from"./features/layerAdapters/OrientedImageryLayerAdapter.js";import{ParquetLayerAdapter as $}from"./features/layerAdapters/ParquetLayerAdapter.js";import{StreamLayerAdapter as B}from"./features/layerAdapters/StreamLayerAdapter.js";import{SubtypeGroupLayerAdapter as z}from"./features/layerAdapters/SubtypeGroupLayerAdapter.js";import{createComplexSymbolInstances as Z}from"./features/schema/processor/symbols/ComplexSymbolSchema.js";import{DebouncedFeatureOverride as K}from"./support/DebouncedFeatureOverride.js";import{FeatureCommandQueue as X}from"./support/FeatureCommandQueue.js";import{handleNoEngineError as Y}from"./support/handleNoEngineError.js";import{toJSONGeometryType as ee}from"./support/util.js";import{FeatureTileSubscriptionManager as te}from"../tiling/FeatureTileSubscriptionManager.js";import{FeatureLayerView as re}from"../../layers/FeatureLayerView.js";import ie from"../../layers/LayerView.js";import{RefreshableLayerView as se}from"../../layers/RefreshableLayerView.js";import{getHighlightName as ae}from"../../support/highlightOptionsUtils.js";function oe(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 ne=4294967294;function ue(e,t){return l(e.map(e=>w(()=>{const t=e();return t&&"object"==typeof t?"getTime"in t&&"function"==typeof t.getTime?t.getTime():JSON.stringify(t):t},t)))}let le=class extends(re(se(Q(ie)))){constructor(){super(...arguments),this._commandsQueue=new X({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.eventLog=new M,this._sourceRefreshVersion=1,this._displayRefreshVersion=1,this._pipelineUpdating=!1,this._editUpdatingHandles=new A,this._fields=null,this._sourceUpdating=!1,this.featureEffectView=new F,this._lastUpdate=0}destroy(){this._editUpdatingHandles.destroy(),this._workerProxy?.destroy(),this._workerAttached.reject(d()),this._commandsQueue.destroy()}initialize(){this._workerAttached=y(),g(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 n("featurelayerview:table-not-supported","table feature layer can't be displayed",{layer:e});if(("feature"===e.type||"subtype-group"===e.type)&&!1===k(e)?.operations.supportsQuery)throw new n("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 T(t)}async _attachProxy(){const e={tileInfoJSON:this.view?.featuresTilingScheme?.tileInfo?.toJSON()};try{await this._workerProxy.pipeline.onAttach(e),this._workerAttached.resolve()}catch(t){this._workerAttached.reject(d()),f(t)}}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 labelingCollisionInfos(){const e=this.layerAdapter.getLabelingDeconflictionInfo(this.view),t=this.layer.geometryType,r=!this.suspended;return e.map(({vvEvaluators:e,deconflictionEnabled:i,labelingInfo:s})=>({labelingInfo:s,container:this.featureContainer,vvEvaluators:e,deconflictionEnabled:i,geometryType:t,visible:r}))}get layerAdapter(){switch(this.layer.type){case"feature":return"memory"===this.layer.source.type?new D(this.layer):new P(this.layer);case"geojson":case"csv":case"wfs":return new D(this.layer);case"parquet":return new $(this.layer);case"subtype-group":return new z(this.layer);case"ogc-feature":return new N(this.layer);case"stream":return new B(this.layer);case"oriented-imagery":return new J(this.layer);case"knowledge-graph-sublayer":return new G(this.layer);case"catalog-footprint":return new H(this.layer);default:o(this.layer)}return null}get timeExtent(){return E(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)}async queryHeatmapStatistics(e){return(await this.getWorker()).pipeline.queryHeatmapStatistics(e)}highlight(e,t){let i;e instanceof r?i=[e.getObjectId()]:"number"==typeof e||"string"==typeof e?i=[e]:a.isCollection(e)&&e.length>0?i=e.map(e=>e?.getObjectId()).toArray():Array.isArray(e)&&e.length>0&&(i="number"==typeof e[0]||"string"==typeof e[0]?e:e.map(e=>e?.getObjectId()));const o=i?.filter(s);if(!o?.length)return u();const n=ae(t);return this._addHighlights(o,n),u(()=>!this.destroyed&&this._removeHighlights(o,n))}async hitTest(e,s){const a=await this.featureContainer.hitTest(s);if(0===a.length)return null;const o=await this.getWorker(),{features:n,aggregates:u,tracks:l}=await o.pipeline.getDisplayFeatures(a),h=this.featureContainer.getSortKeys(a),c=({displayId:e},{displayId:t})=>h.has(e)&&h.has(t)?h.get(e)-h.get(t):e-t;return n.sort(c).reverse(),u.sort(c).reverse(),[...u.map(r=>this._createAggregateGraphicHit(e,t.fromJSON(r))),...l.map(t=>this._createTrackGraphicHit(e,i.fromJSON(t))),...n.map(t=>this._createFeatureGraphicHit(e,r.fromJSON(t)))]}async queryStatistics(){const e=await this.getWorker();return Y(e.pipeline.queryStatistics(),{featureCount:0,ringCount:0,vertexCount:0})}async querySummaryStatistics(e,t,r){const i=await this.getWorker(),s={...t,scale:this.view.scale},a=i.features.executeQueryForSummaryStatistics(this._cleanUpQuery(e),s,r);return Y(a,{})}async queryAggregateSummaryStatistics(e,t,r){const i={...t,scale:this.view.scale},s=(await this.getWorker()).aggregates.executeQueryForSummaryStatistics(this._cleanUpAggregateQuery(e),i,r);return Y(s,{})}async queryUniqueValues(e,t,r){const i=await this.getWorker(),s={...t,scale:this.view.scale},a=i.features.executeQueryForUniqueValues(this._cleanUpQuery(e),s,r);return Y(a,{uniqueValueInfos:[]})}async queryAggregateUniqueValues(e,t,r){const i=await this.getWorker(),s={...t,scale:this.view.scale},a=i.aggregates.executeQueryForUniqueValues(this._cleanUpAggregateQuery(e),s,r);return Y(a,{uniqueValueInfos:[]})}async queryClassBreaks(e,t,r){const i=await this.getWorker(),s={...t,scale:this.view.scale},a=i.features.executeQueryForClassBreaks(this._cleanUpQuery(e),s,r);return Y(a,{classBreakInfos:[]})}async queryAggregateClassBreaks(e,t,r){const i=await this.getWorker(),s={...t,scale:this.view.scale},a=i.aggregates.executeQueryForClassBreaks(this._cleanUpAggregateQuery(e),s,r);return Y(a,{classBreakInfos:[]})}async queryHistogram(e,t,r){const i=await this.getWorker(),s={...t,scale:this.view.scale},a=i.features.executeQueryForHistogram(this._cleanUpQuery(e),s,r);return Y(a,{bins:[],maxValue:null,minValue:null,normalizationTotal:null})}async queryAggregateHistogram(e,t,r){const i=await this.getWorker(),s={...t,scale:this.view.scale},a=i.aggregates.executeQueryForHistogram(this._cleanUpAggregateQuery(e),s,r);return Y(a,{bins:[],maxValue:null,minValue:null,normalizationTotal:null})}queryFeatures(e,t){return this.queryFeaturesJSON(e,t).then(e=>{const t=V.fromJSON(e);return t.features.forEach(e=>this._setOriginForFeature(e)),t})}async queryVisibleFeatures(e,t){const r=(await this.getWorker()).pipeline.queryVisibleFeatures(this._cleanUpQuery(e),t),i=await Y(r,{features:[]}),s=V.fromJSON(i);return s.features.forEach(e=>this._setOriginForFeature(e)),s}async queryAggregates(e,t){const r=(await this.getWorker()).aggregates.executeQuery(this._cleanUpAggregateQuery(e),t),i=await Y(r,{features:[]}),s=C.fromJSON(i);return s.features.forEach(e=>this.layerAdapter.setAggregateGraphicOrigin?.(e)),s}async queryAggregateIds(e,t){const r=(await this.getWorker()).aggregates.executeQueryForIds(this._cleanUpAggregateQuery(e),t);return Y(r,[])}async queryAggregateCount(e,t){const r=(await this.getWorker()).aggregates.executeQueryForCount(this._cleanUpAggregateQuery(e),t);return Y(r,0)}async queryAggregateJSON(e,t){const r=(await this.getWorker()).aggregates.executeQuery(this._cleanUpAggregateQuery(e),t);return Y(r,{features:[]})}async queryFeaturesJSON(e,t){const r=(await this.getWorker()).features.executeQuery(this._cleanUpQuery(e),t);return Y(r,{features:[]})}async queryObjectIds(e,t){const r=(await this.getWorker()).features.executeQueryForIds(this._cleanUpQuery(e),t);return Y(r,[])}async queryFeatureCount(e,t){const r=(await this.getWorker()).features.executeQueryForCount(this._cleanUpQuery(e),t);return Y(r,0)}async queryExtent(e,t){const r=(await this.getWorker()).features.executeQueryForExtent(this._cleanUpQuery(e),t),i=await Y(r,{count:0,extent:null});return{count:i.count,extent:S.fromJSON(i.extent)}}async queryAttributeBins(e,t){const r=(await this.getWorker()).features.executeAttributeBinsQuery(this._cleanUpAttributeBinsQuery(e),t),i=await Y(r,{features:[]});return O.fromJSON(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){const t=performance.now();if(t-this._lastUpdate<200)return;if(this._lastUpdate=t,!this.subscriptionManager)return;this.view.animation&&!this._lastTargetState&&(this._lastTargetState=e.state.clone()),!this.view.animation&&this._lastTargetState&&(this._lastTargetState=null);const r=this.subscriptionManager.update(e.targetState,this._lastTargetState),i=new Set(this.subscriptionManager.coverage?.target.keys());for(const s of this.featureContainer.tiles||[])s.isCoverage=i.has(s.id);this.featureContainer.setVisibleTiles(r)}attach(){has("esri-2d-update-debug")&&console.debug("FeatureLayerView2D.attach"),g(this._updatingHandles.addPromise(this._workerAttached.promise)),g(this._attachProxy()),this.featureContainer=new L(this),this.container.addChild(this.featureContainer),this.view.timeline.record(`${this.layer.title} (FeatureLayer) Attach`),this.subscriptionManager=new te({tileInfoView:this.view.featuresTilingScheme,updateSubscriptions:e=>{this.featureContainer.updateSubscriptions(e),g(this._updatingHandles.addPromise(this.getWorker().then(t=>t.pipeline.updateSubscriptions(e))))},isDone:e=>this.featureContainer.isDone(e)}),this.requestUpdate(),this.addAttachHandles([ue([()=>this._displayRefreshVersion,()=>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()),w(()=>this.updateSuspended,e=>{e||(this.subscriptionManager.resume(),this.view.labelManager.requestUpdate())}),w(()=>this.visible,e=>{this.view.labelManager.requestUpdate()})]),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.view.labelManager.removeContainer(this.featureContainer),this.featureContainer.destroy(),this.featureContainer=null,this._commandsQueue.clear(),this.container.removeAllChildren(),this.subscriptionManager=c(this.subscriptionManager),this._workerProxy.pipeline.onDetach(),this._workerAttached=y(),g(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 n("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})}isUpdating(){const e="renderer"in this.layer&&null!=this.layer.renderer,t=this._commandsQueue.updateTracking.updating,r=null!=this._updatingRequiredPromise,i=this.featureContainer.updatingHandles.updating,s=this.updateRequested||e&&(t||r)||i||this._pipelineUpdating||this.dataUpdating;if(has("esri-2d-log-updating")){console.log(`Updating FLV2D (${this.layer.id}): ${s}\n -> updateRequested ${this.updateRequested}\n -> hasRenderer ${e}\n -> updatingRequiredFields ${r}\n -> hasPendingCommand ${t}\n -> dataUpdating ${this.dataUpdating}\n -> processing ${this._pipelineUpdating}\n -> updatingContainer ${i}\n`);for(const e of this.featureContainer.subscriptions())console.log(` -> Tile[${e.id}] Done: ${e.done}`)}return s}_createClientOptions(){const e=this;return{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")},get container(){return e.featureContainer},setUpdating:e=>{this._set("_pipelineUpdating",e.pipeline),this._set("_sourceUpdating",e.source)},emitEvent:e=>{this.emit(e.name,e.event)},get eventLog(){return e.eventLog},fetch:async t=>{if(has("esri-2d-stabilize-glyphs")){const r=[];for(const i of t)r.push(await e.view.stage.painter.textureManager.rasterizeItem(i));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)))}}async _fetchDictionaryRequest(e){try{if("subtype-group"===this.layer.type)throw new Error("InternalError: SubtypeGroupLayer does not support dictionary renderer");const t=this.layer.renderer;if(!t||"dictionary"!==t.type)throw new Error("InternalError: Expected layer to have a DictionaryRenderer");const r=this._lastSchema.processor.mesh.factory.symbology;if("dictionary"!==r.type)throw new Error("InternalError: Expected schema to be of type 'dictionary'");const i={cimAnalyzer:this.view.stage.cimAnalyzer,cimResourceManager:this.view.stage.painter.textureManager.resourceManager,store:this.featureContainer.instanceStore,scaleExpression:r.scaleExpression};this._fields||(this._fields=this.layer.fields.map(e=>e.toJSON()));const s=r.visualVariableUniforms,a=ee(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 Z({...o.data,hasTextStringTemplates:!0},{uniforms:s,path:"renderer",schemaOptions:i})}}catch(t){return{type:"dictionary-response",meshes:[]}}}_cleanUpQuery(e){const t=q.from(e)||this.createQuery();return t.outSpatialReference||(t.outSpatialReference=this.view.spatialReference),t.toJSON()}_cleanUpAttributeBinsQuery(e){const t=R.from(e);return t.outSpatialReference||(t.outSpatialReference=this.view.spatialReference),t.toJSON()}_cleanUpAggregateQuery(e){const t=q.from(e)||this.createAggregateQuery();t.outSpatialReference||(t.outSpatialReference=this.view.spatialReference);const r=t.objectIds??[];for(const i of t.aggregateIds??[])r.push(i);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)%ne+1}incrementDisplayRefreshVersion(){this._displayRefreshVersion=(this._displayRefreshVersion+1)%ne+1}async _resolveIdenifiers(e){const t=[],r=[];for(const a of e)null==a.objectId||-1===a.objectId?null==a.globalId?h.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 i="globalIdField"in this.layer&&this.layer.globalIdField,s=i&&this.availableFields.includes(i);if(r.length&&!s)return h.getLogger(this).error(new n("mapview-apply-edits",`Editing the specified service requires the layer's globalIdField, ${i} 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,i=ee(this.layer.geometryType),s=W(this.layer),a=[];for(const o of e.added){const e=j(o,i,t,r,s);if(null==e.objectId)throw new n("featurelayerview:bad-override","Feature does not have an objectId",{feature:o});a.push(e)}for(const o of e.updated){const e=j(o,i,t,r,s);if(null==e.objectId)throw new n("featurelayerview:bad-override","Feature does not have an objectId",{feature:o});a.push(e)}for(const o of e.removed)if(null==o)throw new n("featurelayerview:bad-override","Tried to remove an invalid objectId",{objectId:o});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,i="layerId"in t&&e.editedFeatures?.find(e=>e.layerId===t.layerId);if(i&&this._canEditByFeature(i)){const{adds:e,deletes:t,updates:s}=i.editedFeatures,a=this.layer.objectIdField,o=s.map(e=>e.current),n=t.map(e=>"attributes"in e?{objectId:a?e.attributes[a]:null}:e),u=await this._resolveIdenifiers(n);return this._resolveOverrides({added:e,updated:o,removed:u,historicMoment:r,isWeak:!0,release:[]})}const[s,a,o]=await Promise.all([this._resolveIdenifiers(e.addedFeatures),this._resolveIdenifiers(e.updatedFeatures),this._resolveIdenifiers(e.deletedFeatures)]);return{type:"override-by-id",updates:[...s,...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 _doUpdate(){"featureReduction"in this.layer&&this.layer.featureReduction&&this.layer.featureReduction!==this._lastFeatureReduction&&(this.layer.featureReduction=this.layer.featureReduction?.clone(),this._lastFeatureReduction=this.layer.featureReduction);try{if(await Promise.allSettled([this._handleChange(),x(this.layer)]),this.destroyed||!this.layerAdapter?.hasRequiredSupport||!this.subscriptionManager)return;const e=this.featureContainer.instanceStore;this.featureContainer.attributeView.lockTextureUploads();const t=this._lastSchema?.processor.mesh.factory.symbology?.type;let r=!0;"subtype-group"!==this.layer.type&&"dictionary"===this.layer.renderer?.type&&"dictionary"===t&&(r=!1),e.updateStart(r);const i=this.featureEffect,s={store:e,cimAnalyzer:this.view.stage.cimAnalyzer,cimResourceManager:this.view.stage.painter.textureManager.resourceManager,scaleExpression:void 0},a=await this._createViewSchemaConfig(),o={source:await this.layerAdapter.createSourceSchema(a,this._sourceRefreshVersion),processor:await this.layerAdapter.createProcessorSchema(s,a,this._displayRefreshVersion)},n=o.processor.mesh.factory.labels;n&&this.view.labelManager.setLabelSchemaStyles(n,this.featureContainer);const u=p(this._lastSchema?.source.strategy,o.source.strategy)||p(this._lastSchema?.processor,o.processor);if(!u)return this.featureContainer.requestRender(),this.featureContainer.attributeView.unlockTextureUploads(),e.updateEnd(r),void(this.featureEffectView.featureEffect=i);this._lastSchema=o,this._fields=null;const l=Math.round(performance.now());has("esri-2d-update-debug")&&console.debug(`Id[${this.layer.uid}] Version[${l}] FeatureLayerView2D._doUpdate`,{changes:u});const h=await this.getWorker();await h.pipeline.updateSchema(o,l),e.updateEnd(r),this.featureEffectView.featureEffect=i,this.featureEffectView.endTransition(),this.featureContainer.restartAllAnimations(),this.featureContainer.attributeView.unlockTextureUploads(),this.featureContainer.trySwapRenderState(),this.featureContainer.requestRender();const c=o.processor.mesh.strategy,d="cluster"===c.type||"binning"===c.type,y="heatmap"===o.processor.mesh.factory.symbology.type,g=d||y?"target-defer":"eager";this.subscriptionManager.setVisibilityStrategy(g),has("esri-2d-update-debug")&&console.debug(`Version[${l}] FeatureLayerView2D.updateEnd`),this.requestUpdate()}catch(e){has("esri-2d-update-debug")&&console.error("Encountered an error during update",e)}}async _doOverride(e){const t=await this.getWorker();try{for(const r of e.messages)switch(r.type){case"edit":{const e=new K;e.add(await this._resolveEdit(r.event)),await t.pipeline.onOverride(e.toMessage());break}case"override":{const e=new K;e.add(this._resolveOverrides(r.options)),await t.pipeline.onOverride(e.toMessage());break}}}catch(r){m(r),0}}_getEffectiveAvailableFields(e){const t=oe(this._lastAvailableFields,e);return this._lastAvailableFields=t,I(this.layer.fieldsIndex,t)}async _createViewSchemaConfig(){const e=this.requiresCurrentUser?await this.signedInUser:null,t=[he(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}}_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)||h.getLogger(this).error(e)});this._updatingHandles.addPromise(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 he(e,t,r,i,s,a){s&&(s=s.clone());const o=null!=s?s.timeExtent:null,n=null!=r&&null!=o?r.intersection(o):r||o;n&&(s??=new U,s.timeExtent=n),s=t.addFilters?.(s,e)??s,a&&(s??=new U,s.where=v(s.where,a));let u=s?.toJSON()??null;return i.size&&(u??=(new U).toJSON(),u.hiddenIds=Array.from(i)),u}e([_()],le.prototype,"_commandsQueue",void 0),e([_()],le.prototype,"_sourceRefreshVersion",void 0),e([_()],le.prototype,"_displayRefreshVersion",void 0),e([_({readOnly:!0})],le.prototype,"_pipelineUpdating",void 0),e([_()],le.prototype,"_sourceUpdating",void 0),e([_({readOnly:!0})],le.prototype,"dataUpdating",null),e([_({readOnly:!0})],le.prototype,"hasAllFeatures",null),e([_({readOnly:!0})],le.prototype,"hasAllFeaturesInView",null),e([_({readOnly:!0})],le.prototype,"hasFullGeometries",null),e([_()],le.prototype,"featureEffectView",void 0),e([_()],le.prototype,"labelingCollisionInfos",null),e([_()],le.prototype,"layerAdapter",null),e([_({readOnly:!0})],le.prototype,"timeExtent",null),le=e([b("esri.views.2d.layers.FeatureLayerView2D")],le);export{le as default};
5
+ import{__decorate as e}from"tslib";import t from"../../../AggregateGraphic.js";import r from"../../../Graphic.js";import i from"../../../TrackGraphic.js";import{isSome as s}from"../../../core/arrayUtils.js";import a from"../../../core/Collection.js";import{neverReached as o}from"../../../core/compilerUtils.js";import n from"../../../core/Error.js";import{makeHandle as u,handlesGroup as l}from"../../../core/handleUtils.js";import has from"../../../core/has.js";import c from"../../../core/Logger.js";import{destroyMaybe as h}from"../../../core/maybe.js";import{notDeepEqual as p}from"../../../core/object.js";import{createAbortError as d,createResolver as y,ignoreAbortErrors as g,throwIfNotAbortError as f,isAbortError as m}from"../../../core/promiseUtils.js";import{watch as w}from"../../../core/reactiveUtils.js";import{sqlAnd as v}from"../../../core/sql.js";import{getMetersPerUnitForSR as _}from"../../../core/unitUtils.js";import{property as b}from"../../../core/accessorSupport/decorators/property.js";import{subclass as S}from"../../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as A}from"../../../core/support/UpdatingHandles.js";import F from"../../../geometry/Extent.js";import{isCurvedGeometry as j}from"../../../geometry/support/curves/curveUtils.js";import{densifyCurvedGeometry as U}from"../../../geometry/support/curves/densifyCurvedGeometry.js";import x from"../../../layers/effects/FeatureEffectView.js";import{convertFromFeature as I}from"../../../layers/graphics/featureConversionUtils.js";import k from"../../../layers/support/FeatureFilter.js";import{checkServiceCurrentUserSupport as E}from"../../../layers/support/featureLayerUtils.js";import{packFields as C}from"../../../layers/support/fieldUtils.js";import{getEffectiveLayerCapabilities as O}from"../../../layers/support/layerUtils.js";import{combineTimeExtent as R}from"../../../layers/support/timeSupport.js";import V from"../../../rest/support/AggregateFeatureSet.js";import q from"../../../rest/support/AttributeBinsFeatureSet.js";import Q from"../../../rest/support/AttributeBinsQuery.js";import L from"../../../rest/support/FeatureSet.js";import T from"../../../rest/support/Query.js";import{LayerView2DMixin as M}from"./LayerView2D.js";import{FeatureContainer as P}from"./features/FeatureContainer.js";import{createFeaturePipelineWorkerProxy as H}from"./features/FeaturePipelineWorkerProxy.js";import{FeatureSourceEventLog as W}from"./features/FeatureSourceEventLog.js";import{CatalogFootprintLayerAdapter as D}from"./features/layerAdapters/CatalogFootprintLayerAdapter.js";import{FeatureLayerAdapter as G}from"./features/layerAdapters/FeatureLayerAdapter.js";import{createFeatureIdInfo as N}from"./features/layerAdapters/featureServiceUtils.js";import{InMemoryLayerAdapter as J}from"./features/layerAdapters/InMemoryLayerAdapter.js";import{KnowledgeGraphSublayerAdapter as $}from"./features/layerAdapters/KnowledgeGraphSublayerAdapter.js";import{OGCFeatureLayerAdapter as B}from"./features/layerAdapters/OGCFeatureLayerAdapter.js";import{OrientedImageryLayerAdapter as z}from"./features/layerAdapters/OrientedImageryLayerAdapter.js";import{ParquetLayerAdapter as Z}from"./features/layerAdapters/ParquetLayerAdapter.js";import{StreamLayerAdapter as K}from"./features/layerAdapters/StreamLayerAdapter.js";import{SubtypeGroupLayerAdapter as X}from"./features/layerAdapters/SubtypeGroupLayerAdapter.js";import{createComplexSymbolInstances as Y}from"./features/schema/processor/symbols/ComplexSymbolSchema.js";import{DebouncedFeatureOverride as ee}from"./support/DebouncedFeatureOverride.js";import{FeatureCommandQueue as te}from"./support/FeatureCommandQueue.js";import{handleNoEngineError as re}from"./support/handleNoEngineError.js";import{toJSONGeometryType as ie}from"./support/util.js";import{FeatureTileSubscriptionManager as se}from"../tiling/FeatureTileSubscriptionManager.js";import{FeatureLayerView as ae}from"../../layers/FeatureLayerView.js";import oe from"../../layers/LayerView.js";import{RefreshableLayerView as ne}from"../../layers/RefreshableLayerView.js";import{getHighlightName as ue}from"../../support/highlightOptionsUtils.js";function le(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 ce=4294967294;function he(e,t){return l(e.map(e=>w(()=>{const t=e();return t&&"object"==typeof t?"getTime"in t&&"function"==typeof t.getTime?t.getTime():JSON.stringify(t):t},t)))}function pe(e){if(!e.geometry)return e;if(!j(e.geometry))return e;const t=.001/_(e.geometry.spatialReference),r=100;return{geometry:U(e.geometry,{maxSegmentsPerCurve:12e3,maxSegmentLength:r*t,maxDeviation:0}),attributes:e.attributes}}let de=class extends(ae(ne(M(oe)))){constructor(){super(...arguments),this._commandsQueue=new te({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.eventLog=new W,this._sourceRefreshVersion=1,this._displayRefreshVersion=1,this._pipelineUpdating=!1,this._editUpdatingHandles=new A,this._fields=null,this._sourceUpdating=!1,this.featureEffectView=new x,this._lastUpdate=0}destroy(){this._editUpdatingHandles.destroy(),this._workerProxy?.destroy(),this._workerAttached.reject(d()),this._commandsQueue.destroy()}initialize(){this._workerAttached=y(),g(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 n("featurelayerview:table-not-supported","table feature layer can't be displayed",{layer:e});if(("feature"===e.type||"subtype-group"===e.type)&&!1===O(e)?.operations.supportsQuery)throw new n("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 H(t)}async _attachProxy(){const e={tileInfoJSON:this.view?.featuresTilingScheme?.tileInfo?.toJSON()};try{await this._workerProxy.pipeline.onAttach(e),this._workerAttached.resolve()}catch(t){this._workerAttached.reject(d()),f(t)}}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 labelingCollisionInfos(){const e=this.layerAdapter.getLabelingDeconflictionInfo(this.view),t=this.layer.geometryType,r=!this.suspended;return e.map(({vvEvaluators:e,deconflictionEnabled:i,labelingInfo:s})=>({labelingInfo:s,container:this.featureContainer,vvEvaluators:e,deconflictionEnabled:i,geometryType:t,visible:r}))}get layerAdapter(){switch(this.layer.type){case"feature":return"memory"===this.layer.source.type?new J(this.layer):new G(this.layer);case"geojson":case"csv":case"wfs":return new J(this.layer);case"parquet":return new Z(this.layer);case"subtype-group":return new X(this.layer);case"ogc-feature":return new B(this.layer);case"stream":return new K(this.layer);case"oriented-imagery":return new z(this.layer);case"knowledge-graph-sublayer":return new $(this.layer);case"catalog-footprint":return new D(this.layer);default:o(this.layer)}return null}get timeExtent(){return R(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)}async queryHeatmapStatistics(e){return(await this.getWorker()).pipeline.queryHeatmapStatistics(e)}highlight(e,t){let i;e instanceof r?i=[e.getObjectId()]:"number"==typeof e||"string"==typeof e?i=[e]:a.isCollection(e)&&e.length>0?i=e.map(e=>e?.getObjectId()).toArray():Array.isArray(e)&&e.length>0&&(i="number"==typeof e[0]||"string"==typeof e[0]?e:e.map(e=>e?.getObjectId()));const o=i?.filter(s);if(!o?.length)return u();const n=ue(t);return this._addHighlights(o,n),u(()=>!this.destroyed&&this._removeHighlights(o,n))}async hitTest(e,s){const a=await this.featureContainer.hitTest(s);if(0===a.length)return null;const o=await this.getWorker(),{features:n,aggregates:u,tracks:l}=await o.pipeline.getDisplayFeatures(a),c=this.featureContainer.getSortKeys(a),h=({displayId:e},{displayId:t})=>c.has(e)&&c.has(t)?c.get(e)-c.get(t):e-t;return n.sort(h).reverse(),u.sort(h).reverse(),[...u.map(r=>this._createAggregateGraphicHit(e,t.fromJSON(r))),...l.map(t=>this._createTrackGraphicHit(e,i.fromJSON(t))),...n.map(t=>this._createFeatureGraphicHit(e,r.fromJSON(t)))]}async queryStatistics(){const e=await this.getWorker();return re(e.pipeline.queryStatistics(),{featureCount:0,ringCount:0,vertexCount:0})}async querySummaryStatistics(e,t,r){const i=await this.getWorker(),s={...t,scale:this.view.scale},a=i.features.executeQueryForSummaryStatistics(this._cleanUpQuery(e),s,r);return re(a,{})}async queryAggregateSummaryStatistics(e,t,r){const i={...t,scale:this.view.scale},s=(await this.getWorker()).aggregates.executeQueryForSummaryStatistics(this._cleanUpAggregateQuery(e),i,r);return re(s,{})}async queryUniqueValues(e,t,r){const i=await this.getWorker(),s={...t,scale:this.view.scale},a=i.features.executeQueryForUniqueValues(this._cleanUpQuery(e),s,r);return re(a,{uniqueValueInfos:[]})}async queryAggregateUniqueValues(e,t,r){const i=await this.getWorker(),s={...t,scale:this.view.scale},a=i.aggregates.executeQueryForUniqueValues(this._cleanUpAggregateQuery(e),s,r);return re(a,{uniqueValueInfos:[]})}async queryClassBreaks(e,t,r){const i=await this.getWorker(),s={...t,scale:this.view.scale},a=i.features.executeQueryForClassBreaks(this._cleanUpQuery(e),s,r);return re(a,{classBreakInfos:[]})}async queryAggregateClassBreaks(e,t,r){const i=await this.getWorker(),s={...t,scale:this.view.scale},a=i.aggregates.executeQueryForClassBreaks(this._cleanUpAggregateQuery(e),s,r);return re(a,{classBreakInfos:[]})}async queryHistogram(e,t,r){const i=await this.getWorker(),s={...t,scale:this.view.scale},a=i.features.executeQueryForHistogram(this._cleanUpQuery(e),s,r);return re(a,{bins:[],maxValue:null,minValue:null,normalizationTotal:null})}async queryAggregateHistogram(e,t,r){const i=await this.getWorker(),s={...t,scale:this.view.scale},a=i.aggregates.executeQueryForHistogram(this._cleanUpAggregateQuery(e),s,r);return re(a,{bins:[],maxValue:null,minValue:null,normalizationTotal:null})}queryFeatures(e,t){return this.queryFeaturesJSON(e,t).then(e=>{const t=L.fromJSON(e);return t.features.forEach(e=>this._setOriginForFeature(e)),t})}async queryVisibleFeatures(e,t){const r=(await this.getWorker()).pipeline.queryVisibleFeatures(this._cleanUpQuery(e),t),i=await re(r,{features:[]}),s=L.fromJSON(i);return s.features.forEach(e=>this._setOriginForFeature(e)),s}async queryAggregates(e,t){const r=(await this.getWorker()).aggregates.executeQuery(this._cleanUpAggregateQuery(e),t),i=await re(r,{features:[]}),s=V.fromJSON(i);return s.features.forEach(e=>this.layerAdapter.setAggregateGraphicOrigin?.(e)),s}async queryAggregateIds(e,t){const r=(await this.getWorker()).aggregates.executeQueryForIds(this._cleanUpAggregateQuery(e),t);return re(r,[])}async queryAggregateCount(e,t){const r=(await this.getWorker()).aggregates.executeQueryForCount(this._cleanUpAggregateQuery(e),t);return re(r,0)}async queryAggregateJSON(e,t){const r=(await this.getWorker()).aggregates.executeQuery(this._cleanUpAggregateQuery(e),t);return re(r,{features:[]})}async queryFeaturesJSON(e,t){const r=(await this.getWorker()).features.executeQuery(this._cleanUpQuery(e),t);return re(r,{features:[]})}async queryObjectIds(e,t){const r=(await this.getWorker()).features.executeQueryForIds(this._cleanUpQuery(e),t);return re(r,[])}async queryFeatureCount(e,t){const r=(await this.getWorker()).features.executeQueryForCount(this._cleanUpQuery(e),t);return re(r,0)}async queryExtent(e,t){const r=(await this.getWorker()).features.executeQueryForExtent(this._cleanUpQuery(e),t),i=await re(r,{count:0,extent:null});return{count:i.count,extent:F.fromJSON(i.extent)}}async queryAttributeBins(e,t){const r=(await this.getWorker()).features.executeAttributeBinsQuery(this._cleanUpAttributeBinsQuery(e),t),i=await re(r,{features:[]});return q.fromJSON(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){const t=performance.now();if(t-this._lastUpdate<200)return;if(this._lastUpdate=t,!this.subscriptionManager)return;this.view.animation&&!this._lastTargetState&&(this._lastTargetState=e.state.clone()),!this.view.animation&&this._lastTargetState&&(this._lastTargetState=null);const r=this.subscriptionManager.update(e.targetState,this._lastTargetState),i=new Set(this.subscriptionManager.coverage?.target.keys());for(const s of this.featureContainer.tiles||[])s.isCoverage=i.has(s.id);this.featureContainer.setVisibleTiles(r)}attach(){has("esri-2d-update-debug")&&console.debug("FeatureLayerView2D.attach"),g(this._updatingHandles.addPromise(this._workerAttached.promise)),g(this._attachProxy()),this.featureContainer=new P(this),this.container.addChild(this.featureContainer),this.view.timeline.record(`${this.layer.title} (FeatureLayer) Attach`),this.subscriptionManager=new se({tileInfoView:this.view.featuresTilingScheme,updateSubscriptions:e=>{this.featureContainer.updateSubscriptions(e),g(this._updatingHandles.addPromise(this.getWorker().then(t=>t.pipeline.updateSubscriptions(e))))},isDone:e=>this.featureContainer.isDone(e)}),this.requestUpdate(),this.addAttachHandles([he([()=>this._displayRefreshVersion,()=>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()),w(()=>this.updateSuspended,e=>{e||(this.subscriptionManager.resume(),this.view.labelManager.requestUpdate())}),w(()=>this.visible,e=>{this.view.labelManager.requestUpdate()})]),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.view.labelManager.removeContainer(this.featureContainer),this.featureContainer.destroy(),this.featureContainer=null,this._commandsQueue.clear(),this.container.removeAllChildren(),this.subscriptionManager=h(this.subscriptionManager),this._workerProxy.pipeline.onDetach(),this._workerAttached=y(),g(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 n("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})}isUpdating(){const e="renderer"in this.layer&&null!=this.layer.renderer,t=this._commandsQueue.updateTracking.updating,r=null!=this._updatingRequiredPromise,i=this.featureContainer.updatingHandles.updating,s=this.updateRequested||e&&(t||r)||i||this._pipelineUpdating||this.dataUpdating;if(has("esri-2d-log-updating")){console.log(`Updating FLV2D (${this.layer.id}): ${s}\n -> updateRequested ${this.updateRequested}\n -> hasRenderer ${e}\n -> updatingRequiredFields ${r}\n -> hasPendingCommand ${t}\n -> dataUpdating ${this.dataUpdating}\n -> processing ${this._pipelineUpdating}\n -> updatingContainer ${i}\n`);for(const e of this.featureContainer.subscriptions())console.log(` -> Tile[${e.id}] Done: ${e.done}`)}return s}_createClientOptions(){const e=this;return{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")},get container(){return e.featureContainer},setUpdating:e=>{this._set("_pipelineUpdating",e.pipeline),this._set("_sourceUpdating",e.source)},emitEvent:e=>{this.emit(e.name,e.event)},get eventLog(){return e.eventLog},fetch:async t=>{if(has("esri-2d-stabilize-glyphs")){const r=[];for(const i of t)r.push(await e.view.stage.painter.textureManager.rasterizeItem(i));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)))}}async _fetchDictionaryRequest(e){try{if("subtype-group"===this.layer.type)throw new Error("InternalError: SubtypeGroupLayer does not support dictionary renderer");const t=this.layer.renderer;if(!t||"dictionary"!==t.type)throw new Error("InternalError: Expected layer to have a DictionaryRenderer");const r=this._lastSchema.processor.mesh.factory.symbology;if("dictionary"!==r.type)throw new Error("InternalError: Expected schema to be of type 'dictionary'");const i={cimAnalyzer:this.view.stage.cimAnalyzer,cimResourceManager:this.view.stage.painter.textureManager.resourceManager,store:this.featureContainer.instanceStore,scaleExpression:r.scaleExpression};this._fields||(this._fields=this.layer.fields.map(e=>e.toJSON()));const s=r.visualVariableUniforms,a=ie(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 Y({...o.data,hasTextStringTemplates:!0},{uniforms:s,path:"renderer",schemaOptions:i})}}catch(t){return{type:"dictionary-response",meshes:[]}}}_cleanUpQuery(e){const t=T.from(e)||this.createQuery();return t.outSpatialReference||(t.outSpatialReference=this.view.spatialReference),t.toJSON()}_cleanUpAttributeBinsQuery(e){const t=Q.from(e);return t.outSpatialReference||(t.outSpatialReference=this.view.spatialReference),t.toJSON()}_cleanUpAggregateQuery(e){const t=T.from(e)||this.createAggregateQuery();t.outSpatialReference||(t.outSpatialReference=this.view.spatialReference);const r=t.objectIds??[];for(const i of t.aggregateIds??[])r.push(i);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)%ce+1}incrementDisplayRefreshVersion(){this._displayRefreshVersion=(this._displayRefreshVersion+1)%ce+1}async _resolveIdenifiers(e){const t=[],r=[];for(const a of e)null==a.objectId||-1===a.objectId?null==a.globalId?c.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 i="globalIdField"in this.layer&&this.layer.globalIdField,s=i&&this.availableFields.includes(i);if(r.length&&!s)return c.getLogger(this).error(new n("mapview-apply-edits",`Editing the specified service requires the layer's globalIdField, ${i} 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,i=ie(this.layer.geometryType),s=N(this.layer),a=[];for(const o of e.added){const e=I(pe(o),i,t,r,s);if(null==e.objectId)throw new n("featurelayerview:bad-override","Feature does not have an objectId",{feature:o});a.push(e)}for(const o of e.updated){const e=I(pe(o),i,t,r,s);if(null==e.objectId)throw new n("featurelayerview:bad-override","Feature does not have an objectId",{feature:o});a.push(e)}for(const o of e.removed)if(null==o)throw new n("featurelayerview:bad-override","Tried to remove an invalid objectId",{objectId:o});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,i="layerId"in t&&e.editedFeatures?.find(e=>e.layerId===t.layerId);if(i&&this._canEditByFeature(i)){const{adds:e,deletes:t,updates:s}=i.editedFeatures,a=this.layer.objectIdField,o=s.map(e=>e.current),n=t.map(e=>"attributes"in e?{objectId:a?e.attributes[a]:null}:e),u=await this._resolveIdenifiers(n);return this._resolveOverrides({added:e,updated:o,removed:u,historicMoment:r,isWeak:!0,release:[]})}const[s,a,o]=await Promise.all([this._resolveIdenifiers(e.addedFeatures),this._resolveIdenifiers(e.updatedFeatures),this._resolveIdenifiers(e.deletedFeatures)]);return{type:"override-by-id",updates:[...s,...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 _doUpdate(){"featureReduction"in this.layer&&this.layer.featureReduction&&this.layer.featureReduction!==this._lastFeatureReduction&&(this.layer.featureReduction=this.layer.featureReduction?.clone(),this._lastFeatureReduction=this.layer.featureReduction);try{if(await Promise.allSettled([this._handleChange(),E(this.layer)]),this.destroyed||!this.layerAdapter?.hasRequiredSupport||!this.subscriptionManager)return;const e=this.featureContainer.instanceStore;this.featureContainer.attributeView.lockTextureUploads();const t=this._lastSchema?.processor.mesh.factory.symbology?.type;let r=!0;"subtype-group"!==this.layer.type&&"dictionary"===this.layer.renderer?.type&&"dictionary"===t&&(r=!1),e.updateStart(r);const i=this.featureEffect,s={store:e,cimAnalyzer:this.view.stage.cimAnalyzer,cimResourceManager:this.view.stage.painter.textureManager.resourceManager,scaleExpression:void 0},a=await this._createViewSchemaConfig(),o={source:await this.layerAdapter.createSourceSchema(a,this._sourceRefreshVersion),processor:await this.layerAdapter.createProcessorSchema(s,a,this._displayRefreshVersion)},n=o.processor.mesh.factory.labels;n&&this.view.labelManager.setLabelSchemaStyles(n,this.featureContainer);const u=p(this._lastSchema?.source.strategy,o.source.strategy)||p(this._lastSchema?.processor,o.processor);if(!u)return this.featureContainer.requestRender(),this.featureContainer.attributeView.unlockTextureUploads(),e.updateEnd(r),void(this.featureEffectView.featureEffect=i);this._lastSchema=o,this._fields=null;const l=Math.round(performance.now());has("esri-2d-update-debug")&&console.debug(`Id[${this.layer.uid}] Version[${l}] FeatureLayerView2D._doUpdate`,{changes:u});const c=await this.getWorker();await c.pipeline.updateSchema(o,l),e.updateEnd(r),this.featureEffectView.featureEffect=i,this.featureEffectView.endTransition(),this.featureContainer.restartAllAnimations(),this.featureContainer.attributeView.unlockTextureUploads(),this.featureContainer.trySwapRenderState(),this.featureContainer.requestRender();const h=o.processor.mesh.strategy,d="cluster"===h.type||"binning"===h.type,y="heatmap"===o.processor.mesh.factory.symbology.type,g=d||y?"target-defer":"eager";this.subscriptionManager.setVisibilityStrategy(g),has("esri-2d-update-debug")&&console.debug(`Version[${l}] FeatureLayerView2D.updateEnd`),this.requestUpdate()}catch(e){has("esri-2d-update-debug")&&console.error("Encountered an error during update",e)}}async _doOverride(e){const t=await this.getWorker();try{for(const r of e.messages)switch(r.type){case"edit":{const e=new ee;e.add(await this._resolveEdit(r.event)),await t.pipeline.onOverride(e.toMessage());break}case"override":{const e=new ee;e.add(this._resolveOverrides(r.options)),await t.pipeline.onOverride(e.toMessage());break}}}catch(r){m(r),0}}_getEffectiveAvailableFields(e){const t=le(this._lastAvailableFields,e);return this._lastAvailableFields=t,C(this.layer.fieldsIndex,t)}async _createViewSchemaConfig(){const e=this.requiresCurrentUser?await this.signedInUser:null,t=[ye(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}}_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)||c.getLogger(this).error(e)});this._updatingHandles.addPromise(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 ye(e,t,r,i,s,a){s&&(s=s.clone());const o=null!=s?s.timeExtent:null,n=null!=r&&null!=o?r.intersection(o):r||o;n&&(s??=new k,s.timeExtent=n),s=t.addFilters?.(s,e)??s,a&&(s??=new k,s.where=v(s.where,a));let u=s?.toJSON()??null;return i.size&&(u??=(new k).toJSON(),u.hiddenIds=Array.from(i)),u}e([b()],de.prototype,"_commandsQueue",void 0),e([b()],de.prototype,"_sourceRefreshVersion",void 0),e([b()],de.prototype,"_displayRefreshVersion",void 0),e([b({readOnly:!0})],de.prototype,"_pipelineUpdating",void 0),e([b()],de.prototype,"_sourceUpdating",void 0),e([b({readOnly:!0})],de.prototype,"dataUpdating",null),e([b({readOnly:!0})],de.prototype,"hasAllFeatures",null),e([b({readOnly:!0})],de.prototype,"hasAllFeaturesInView",null),e([b({readOnly:!0})],de.prototype,"hasFullGeometries",null),e([b()],de.prototype,"featureEffectView",void 0),e([b()],de.prototype,"labelingCollisionInfos",null),e([b()],de.prototype,"layerAdapter",null),e([b({readOnly:!0})],de.prototype,"timeExtent",null),de=e([S("esri.views.2d.layers.FeatureLayerView2D")],de);export{de as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as t}from"tslib";import{property as e}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as o}from"../../../core/accessorSupport/decorators/subclass.js";import{AnalysisView3D as r}from"./AnalysisView3D.js";import{ElevationProfileLineSceneComputation as i}from"./ElevationProfile/ElevationProfileLineSceneComputation.js";import{ElevationProfileVisualization3D as s}from"./ElevationProfile/ElevationProfileVisualization3D.js";import{ElevationProfileController as l}from"../../analysis/ElevationProfile/ElevationProfileController.js";import{ElevationProfileLineGroundComputation as n}from"../../analysis/ElevationProfile/ElevationProfileLineGroundComputation.js";import{ElevationProfileLineInputComputation as a}from"../../analysis/ElevationProfile/ElevationProfileLineInputComputation.js";import{ElevationProfileLineQueryComputation as p}from"../../analysis/ElevationProfile/ElevationProfileLineQueryComputation.js";import{ElevationProfileTool as c}from"../../analysis/ElevationProfile/ElevationProfileTool.js";let u=class extends r{constructor(t){super(t),this.type="elevation-profile-view-3d",this.analysis=null,this.hoveredPosition=null}initialize(){const{analysis:t,view:e}=this;this._controller=new l({analysis:t,analysisViewData:this,view:e,computationFactory:{create:t=>{switch(t.profileLine.type){case"ground":return new n(t);case"input":return new a(t);case"query":return new p(t);case"scene":return new i(t)}}}}),this._visualization=new s({view:e,analysisViewData:this}),this._sketchTool=new c({view:e,analysisViewData:this})}destroy(){this._controller.destroy(),this._visualization.destroy(),this._sketchTool?.destroy()}get effectiveUnits(){return this._controller.effectiveUnits}get error(){return this._controller.error}get hoveredPoints(){return this._controller.hoveredPoints}get interactive(){return super.interactive}set interactive(t){super.interactive=t}get progress(){return this._controller.progress}get results(){return this._controller.results}get statistics(){return this._controller.statistics}get updating(){return!0===this._controller.updating||!0===this._visualization.updating||!0===this._sketchTool?.updating}get visible(){return super.visible}set visible(t){super.visible=t}get sketchGraphic(){return this._sketchTool?.sketchGraphic}get toolState(){return this._sketchTool?.state??"idle"}place(t){return this._sketchTool.place(t)}pickGraphic(t){return this._sketchTool.pickGraphic(t)}};t([e({readOnly:!0})],u.prototype,"type",void 0),t([e({constructOnly:!0,nonNullable:!0})],u.prototype,"analysis",void 0),t([e({readOnly:!0})],u.prototype,"effectiveUnits",null),t([e({readOnly:!0})],u.prototype,"error",null),t([e()],u.prototype,"hoveredPosition",void 0),t([e()],u.prototype,"hoveredPoints",null),t([e({readOnly:!0})],u.prototype,"progress",null),t([e({readOnly:!0})],u.prototype,"results",null),t([e({readOnly:!0})],u.prototype,"statistics",null),t([e({readOnly:!0})],u.prototype,"updating",null),t([e()],u.prototype,"sketchGraphic",null),t([e()],u.prototype,"toolState",null),t([e()],u.prototype,"_controller",void 0),t([e()],u.prototype,"_visualization",void 0),t([e()],u.prototype,"_sketchTool",void 0),u=t([o("esri.views.3d.analysis.ElevationProfileAnalysisView3D")],u);const h=u;export{h as default};
5
+ import{__decorate as t}from"tslib";import{property as e}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as o}from"../../../core/accessorSupport/decorators/subclass.js";import{AnalysisView3D as r}from"./AnalysisView3D.js";import{ElevationProfileLineSceneComputation as i}from"./ElevationProfile/ElevationProfileLineSceneComputation.js";import{ElevationProfileVisualization3D as s}from"./ElevationProfile/ElevationProfileVisualization3D.js";import{ElevationProfileController as l}from"../../analysis/ElevationProfile/ElevationProfileController.js";import{ElevationProfileLineGroundComputation as n}from"../../analysis/ElevationProfile/ElevationProfileLineGroundComputation.js";import{ElevationProfileLineInputComputation as a}from"../../analysis/ElevationProfile/ElevationProfileLineInputComputation.js";import{ElevationProfileLineQueryComputation as p}from"../../analysis/ElevationProfile/ElevationProfileLineQueryComputation.js";import{ElevationProfileTool as c}from"../../analysis/ElevationProfile/ElevationProfileTool.js";let u=class extends r{constructor(t){super(t),this.type="elevation-profile-view-3d",this.analysis=null,this.hoveredPosition=null}initialize(){const{analysis:t,view:e}=this;this._controller=new l({analysis:t,analysisViewData:this,view:e,computationFactory:{create:t=>{switch(t.profileLine.type){case"ground":return new n(t);case"input":return new a(t);case"query":return new p(t);case"scene":return new i(t)}}}}),this._visualization=new s({view:e,analysisViewData:this}),this._sketchTool=new c({view:e,analysisViewData:this})}destroy(){this._controller?.destroy(),this._visualization?.destroy(),this._sketchTool?.destroy()}get effectiveUnits(){return this._controller?.effectiveUnits??{distance:"meters",elevation:"meters"}}get error(){return this._controller?.error}get hoveredPoints(){return this._controller?.hoveredPoints??[]}get interactive(){return super.interactive}set interactive(t){super.interactive=t}get progress(){return this._controller?.progress??0}get results(){return this._controller?.results??[]}get statistics(){return this._controller?.statistics}get updating(){return!0===this._controller?.updating||!0===this._visualization?.updating||!0===this._sketchTool?.updating}get visible(){return super.visible}set visible(t){super.visible=t}get sketchGraphic(){return this._sketchTool?.sketchGraphic}get toolState(){return this._sketchTool?.state??"idle"}place(t){return this._sketchTool.place(t)}pickGraphic(t){return this._sketchTool.pickGraphic(t)}};t([e({readOnly:!0})],u.prototype,"type",void 0),t([e({constructOnly:!0,nonNullable:!0})],u.prototype,"analysis",void 0),t([e({readOnly:!0})],u.prototype,"effectiveUnits",null),t([e({readOnly:!0})],u.prototype,"error",null),t([e()],u.prototype,"hoveredPosition",void 0),t([e()],u.prototype,"hoveredPoints",null),t([e({readOnly:!0})],u.prototype,"progress",null),t([e({readOnly:!0})],u.prototype,"results",null),t([e({readOnly:!0})],u.prototype,"statistics",null),t([e({readOnly:!0})],u.prototype,"updating",null),t([e()],u.prototype,"sketchGraphic",null),t([e()],u.prototype,"toolState",null),t([e()],u.prototype,"_controller",void 0),t([e()],u.prototype,"_visualization",void 0),t([e()],u.prototype,"_sketchTool",void 0),u=t([o("esri.views.3d.analysis.ElevationProfileAnalysisView3D")],u);const h=u;export{h as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import o from"../../../../Color.js";const t=new o("black");class i{constructor(){this.geometryOutlineWidth=1.5,this.targetGeometryOutlineColor=new o("grey"),this.cutColor=new o([153,198,111,.9]),this.fillColor=new o([200,200,230,.8]),this.cutProjectionLineColor=o.blendColors(this.cutColor,t,.4),this.fillProjectionLineColor=o.blendColors(this.fillColor,t,.4),this.projectionLineWidth=2,this.projectionLineStippleSize=4,this.labelDistance=40}}const e=new i;export{i as CutFillVisualizationConfiguration,e as cutFillConfiguration};
5
+ import o from"../../../../Color.js";const t=new o("black");class i{constructor(){this.geometryOutlineWidth=1.5,this.geometryOutlineColor=new o("grey"),this.cutColor=new o([153,198,111,.75]),this.fillColor=new o([200,200,230,.75]),this.cutProjectionLineColor=o.blendColors(this.cutColor,t,.4),this.fillProjectionLineColor=o.blendColors(this.fillColor,t,.4),this.projectionLineWidth=2,this.projectionLineStippleSize=4,this.labelDistance=40}}const e=new i;export{i as CutFillVisualizationConfiguration,e as cutFillConfiguration};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../../../../Color.js";import"../../../../intl.js";import i from"../../../../core/Accessor.js";import{destroyMaybe as s}from"../../../../core/maybe.js";import{formatDecimal as o}from"../../../../core/quantityFormatUtils.js";import{watch as l,initial as r}from"../../../../core/reactiveUtils.js";import{adaptiveVolumeUnit as n}from"../../../../core/unitUtils.js";import{property as a}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as m}from"../../../../core/accessorSupport/decorators/subclass.js";import{e as u}from"../../../../chunks/earcut.js";import{create as c}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{i as p}from"../../../../chunks/vec32.js";import{create as h,fromValues as d}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{computeTranslationToOriginAndRotation as g}from"../../../../geometry/projection/computeTranslationToOriginAndRotation.js";import{newDoubleArray as f}from"../../../../geometry/support/DoubleArray.js";import{newIndexArray as y}from"../../../../geometry/support/Indices.js";import{t as v}from"../../../../chunks/vec3.js";import _ from"../../../../symbols/support/ElevationInfo.js";import{cutFillConfiguration as b}from"./VolumeMeasurementConfiguration.js";import{LabelVisualElement as j}from"../../interactive/visualElements/LabelVisualElement.js";import{LineVisualElement as V}from"../../interactive/visualElements/LineVisualElement.js";import{OutlineVisualElement as w}from"../../interactive/visualElements/OutlineVisualElement.js";import{GeodesicSegment as L}from"../../interactive/visualElements/support/Segment.js";import{ElevationContext as G}from"../../layers/graphics/ElevationContext.js";import{extrudePolygon as C}from"../../layers/graphics/Graphics3DExtrudeSymbolLayer.js";import{geometryToRenderInfo as A}from"../../support/renderInfoUtils/polygon.js";import{CutFillColor as x,VolumeGeometry as M}from"../../webgl-engine/lib/CutFillColor.js";import{createStipplePatternSimple as R}from"../../webgl-engine/materials/lineStippleUtils.js";import{onLocaleChange as D}from"../../../../intl/locale.js";import{fetchMessageBundle as P}from"../../../../intl/messages.js";import{substitute as E}from"../../../../intl/substitute.js";let U=class extends i{get visible(){return this.analysisViewData.visible&&null!=this.analysisViewData.elevationAlignedGeometry&&null!=this.analysisViewData.targetGeometry}get updating(){return this.loadingMessages}constructor(e){super(e),this.unitsMessages=null,this.messages=null,this.loadingMessages=!0,this._elevationContext=G.fromElevationInfo(new _({mode:"absolute-height"})),this._extrusionHeight=1e4}initialize(){const{view:e}=this,{accentColor:i}=e.effectiveTheme,s={view:e,isDecoration:!0},o=b,n={...s,width:o.geometryOutlineWidth},a=t.toUnitRGBA(i),m=t.toUnitRGBA(o.targetGeometryOutlineColor);this._elevationAlignedGeometry=new w({...n,isDraped:!0,color:a}),this._targetGeometry=new w({...n,color:m});const u={...s,attached:!0,width:o.projectionLineWidth,stipplePattern:R(o.projectionLineStippleSize),renderOccluded:4},c=t.toUnitRGBA(o.cutProjectionLineColor),p=t.toUnitRGBA(o.fillProjectionLineColor);this._cutProjectionLines=new V({...u,color:c}),this._fillProjectionLines=new V({...u,color:p});const h={...s,attached:!0};this._cutVolumeLabel=new j(h),this._fillVolumeLabel=new j(h),this._cutFillRenderNode=new x({view:e,cutColor:o.cutColor,fillColor:o.fillColor}),this.addHandles([l(()=>[this.analysisViewData.elevationAlignedGeometry,this.analysisViewData.targetGeometry,this.visible],()=>this._updateVisualElements()),l(()=>this.view.effectiveTheme.accentColor,e=>{this._elevationAlignedGeometry.color=t.toUnitRGBA(e)}),l(()=>this.analysisViewData.targetGeometry,()=>this._updateCutFillGeometry(),r),l(()=>this.visible,()=>this._updateCutFillVisibility()),l(()=>{const{messages:e,unitsMessages:t,visible:i,analysisViewData:s}=this;return{labelAnchors:s.labelAnchors,effectiveDisplayUnits:s.effectiveDisplayUnits,messages:e,unitsMessages:t,result:s.result,visible:i}},e=>this._updateLabels(e)),D(()=>this._updateMessageBundle())]),this._updateMessageBundle()}destroy(){this._elevationAlignedGeometry=s(this._elevationAlignedGeometry),this._targetGeometry=s(this._targetGeometry),this._cutProjectionLines=s(this._cutProjectionLines),this._fillProjectionLines=s(this._fillProjectionLines),this._cutVolumeLabel=s(this._cutVolumeLabel),this._fillVolumeLabel=s(this._fillVolumeLabel),this._cutFillRenderNode.destroy()}get _config(){return b}_updateVisualElements(){this._updateGeometries(),this._updateProjectionLines()}_updateGeometries(){const e=this.visible,{elevationAlignedGeometry:t,targetGeometry:i}=this.analysisViewData;this._elevationAlignedGeometry.geometry=t,this._elevationAlignedGeometry.visible=e,this._targetGeometry.geometry=i,this._targetGeometry.visible=e}_updateProjectionLines(){const e=this.visible,{elevationAlignedGeometry:t,targetGeometry:i}=this.analysisViewData;if(this._cutProjectionLines.visible=e,this._fillProjectionLines.visible=e,!t||!i)return;const{renderCoordsHelper:s}=this.view,o=s.spatialReference,l=[],r=[],n=t.spatialReference;for(let a=0;a<t.rings[0].length;++a){const e=t.rings[0][a],m=p(S,e[0],e[1],e[2]);s.toRenderCoords(m,n,m);const u=i.rings[0][a],c=p(B,u[0],u[1],u[2]);s.toRenderCoords(c,n,c);const h=new L(m,c,o);m[2]>c[2]?l.push(h):r.push(h)}this._cutProjectionLines.setGeometryFromSegments(l),this._fillProjectionLines.setGeometryFromSegments(r)}_updateLabels(e){const{labelDistance:t}=this._config,{effectiveDisplayUnits:i,labelAnchors:s,messages:o,unitsMessages:l,result:r,visible:n}=e;if(this._cutVolumeLabel.visible=n,this._fillVolumeLabel.visible=n,this._cutVolumeLabel.geometry=s.cut?{type:"point",point:s.cut,callout:{distance:t,offset:0}}:null,this._fillVolumeLabel.geometry=s.fill?{type:"point",point:s.fill,callout:{distance:-t,offset:0}}:null,null==r||null==o||null==l)return this._cutVolumeLabel.text="-",void(this._fillVolumeLabel.text="-");const a=i.volume,m=E(o.labels.cut,{volume:F(l,r.cutVolume,a)}),u=E(o.labels.fill,{volume:F(l,r.fillVolume,a)});this._cutVolumeLabel.text=m,this._fillVolumeLabel.text=u}_updateCutFillVisibility(){this.visible?this._cutFillRenderNode.enable():this._cutFillRenderNode.disable()}_updateCutFillGeometry(){const{renderCoordsHelper:e}=this.view,{targetGeometry:t}=this.analysisViewData;if(!t?.extent)return;const{center:i}=t.extent,s=d(i.x,i.y,0),o=h();e.toRenderCoords(s,t.spatialReference,o);const l=this._getExtrudedVolumes(t,this._extrusionHeight,s),r=this._getExtrudedVolumes(t,-this._extrusionHeight,s);this._cutFillRenderNode.updateGeometries(l,r,o)}_getExtrudedVolumes(e,t,i){const{renderCoordsHelper:s,spatialReference:o,elevationProvider:l}=this.view,r=h(),n=1===s.viewingMode;n||s.worldUpAtPosition([0,0,0],r);const a=A(e,l,s,this._elevationContext),{polygons:m,mapPositions:p,position:d}=a,_=m[0],b=_.count,j=u(_.mapPositions,_.holeIndices,3),V=j.length,w=6*b,L=y(w+V),G=y(V),x=f(3*w),R=f(3*w);C(d,p,j,_,x,null,R,null,L,G,t,r,n);const D=c(),P=c();return g(o,i,D,s.spatialReference),P[12]=-D[12],P[13]=-D[13],P[14]=-D[14],v(x,x,P),new M(x,G,L,R)}async _updateMessageBundle(){this.loadingMessages=!0;try{this.unitsMessages=await P("esri/core/t9n/Units"),this.messages=await P("esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis")}finally{this.loadingMessages=!1}}};function F(e,t,i){return e&&t&&o(e,t,n(t.value,t.unit,i))}e([a({constructOnly:!0})],U.prototype,"view",void 0),e([a({constructOnly:!0})],U.prototype,"analysisViewData",void 0),e([a()],U.prototype,"unitsMessages",void 0),e([a()],U.prototype,"messages",void 0),e([a()],U.prototype,"loadingMessages",void 0),e([a({readOnly:!0})],U.prototype,"visible",null),e([a()],U.prototype,"updating",null),U=e([m("esri.views.3d.analysis.VolumeMeasurement.VolumeMeasurementCutFillVisualization")],U);const S=h(),B=h();export{U as VolumeMeasurementCutFillVisualization};
5
+ import{__decorate as e}from"tslib";import t from"../../../../Color.js";import"../../../../intl.js";import i from"../../../../core/Accessor.js";import{destroyMaybe as s}from"../../../../core/maybe.js";import{formatDecimal as o}from"../../../../core/quantityFormatUtils.js";import{watch as l,initial as r}from"../../../../core/reactiveUtils.js";import{adaptiveVolumeUnit as n}from"../../../../core/unitUtils.js";import{property as a}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as m}from"../../../../core/accessorSupport/decorators/subclass.js";import{e as c}from"../../../../chunks/earcut.js";import{create as u}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{i as p}from"../../../../chunks/vec32.js";import{create as h,fromValues as d}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{computeTranslationToOriginAndRotation as g}from"../../../../geometry/projection/computeTranslationToOriginAndRotation.js";import{newDoubleArray as y}from"../../../../geometry/support/DoubleArray.js";import{newIndexArray as f}from"../../../../geometry/support/Indices.js";import{t as v}from"../../../../chunks/vec3.js";import _ from"../../../../symbols/support/ElevationInfo.js";import{cutFillConfiguration as b}from"./VolumeMeasurementConfiguration.js";import{LabelVisualElement as j}from"../../interactive/visualElements/LabelVisualElement.js";import{LineVisualElement as L}from"../../interactive/visualElements/LineVisualElement.js";import{OutlineVisualElement as V}from"../../interactive/visualElements/OutlineVisualElement.js";import{GeodesicSegment as G}from"../../interactive/visualElements/support/Segment.js";import{ElevationContext as w}from"../../layers/graphics/ElevationContext.js";import{extrudePolygon as C}from"../../layers/graphics/Graphics3DExtrudeSymbolLayer.js";import{geometryToRenderInfo as A}from"../../support/renderInfoUtils/polygon.js";import{CutFillColor as P,VolumeGeometry as R}from"../../webgl-engine/lib/CutFillColor.js";import{createStipplePatternSimple as x}from"../../webgl-engine/materials/lineStippleUtils.js";import{onLocaleChange as D}from"../../../../intl/locale.js";import{fetchMessageBundle as M}from"../../../../intl/messages.js";import{substitute as U}from"../../../../intl/substitute.js";let E=class extends i{get visible(){return this.analysisViewData.visible&&null!=this.analysisViewData.elevationAlignedGeometry&&null!=this.analysisViewData.targetGeometry}get updating(){return this.loadingMessages}constructor(e){super(e),this.unitsMessages=null,this.messages=null,this.loadingMessages=!0,this._elevationContext=w.fromElevationInfo(new _({mode:"absolute-height"})),this._extrusionHeight=1e4}initialize(){const{view:e}=this,i={view:e,isDecoration:!0},s=b,o={...i,width:s.geometryOutlineWidth};this._elevationAlignedGeometry=new V({...o,isDraped:!0,color:t.toUnitRGBA(s.geometryOutlineColor)}),this._targetGeometry=new V(o);const n={...i,attached:!0,width:s.projectionLineWidth,stipplePattern:x(s.projectionLineStippleSize),renderOccluded:4},a=t.toUnitRGBA(s.cutProjectionLineColor),m=t.toUnitRGBA(s.fillProjectionLineColor);this._cutProjectionLines=new L({...n,color:a}),this._fillProjectionLines=new L({...n,color:m});const c={...i,attached:!0};this._cutVolumeLabel=new j(c),this._fillVolumeLabel=new j(c),this._cutFillRenderNode=new P({view:e,cutColor:s.cutColor,fillColor:s.fillColor}),this.addHandles([l(()=>({elevationAlignedGeometry:this.analysisViewData.elevationAlignedGeometry,targetGeometry:this.analysisViewData.targetGeometry}),({elevationAlignedGeometry:e,targetGeometry:t})=>{this._elevationAlignedGeometry.geometry=e,this._targetGeometry.geometry=t},r),l(()=>({interactive:this.analysisViewData.interactive,measureType:this.analysis.measureType,visible:this.visible}),({visible:e,interactive:t,measureType:i})=>{this._elevationAlignedGeometry.visible=e&&!t,this._targetGeometry.visible=e&&"cut-fill"===i},r),l(()=>({elevationAlignedGeometry:this.analysisViewData.elevationAlignedGeometry,targetGeometry:this.analysisViewData.targetGeometry,visible:this.visible}),({elevationAlignedGeometry:e,targetGeometry:t,visible:i})=>this._updateProjectionLines(e,t,i)),l(()=>({interactive:this.analysisViewData.interactive,accentColor:this.view.effectiveTheme.accentColor}),({interactive:e,accentColor:t})=>{this._updateColors(e,t)},r),l(()=>this.analysisViewData.targetGeometry,()=>this._updateCutFillGeometry(),r),l(()=>this.visible,()=>this._updateCutFillVisibility()),l(()=>{const{messages:e,unitsMessages:t,visible:i,analysisViewData:s}=this;return{labelAnchors:s.labelAnchors,effectiveDisplayUnits:s.effectiveDisplayUnits,messages:e,unitsMessages:t,result:s.result,visible:i}},e=>this._updateLabels(e)),D(()=>this._updateMessageBundle())]),this._updateMessageBundle()}destroy(){this._elevationAlignedGeometry=s(this._elevationAlignedGeometry),this._targetGeometry=s(this._targetGeometry),this._cutProjectionLines=s(this._cutProjectionLines),this._fillProjectionLines=s(this._fillProjectionLines),this._cutVolumeLabel=s(this._cutVolumeLabel),this._fillVolumeLabel=s(this._fillVolumeLabel),this._cutFillRenderNode.destroy()}get _config(){return b}_updateProjectionLines(e,t,i){if(this._cutProjectionLines.visible=i,this._fillProjectionLines.visible=i,!e||!t)return;const{renderCoordsHelper:s}=this.view,o=s.spatialReference,l=[],r=[],n=e.spatialReference;for(let a=0;a<e.rings[0].length;++a){const i=e.rings[0][a],m=p(B,i[0],i[1],i[2]);s.toRenderCoords(m,n,m);const c=t.rings[0][a],u=p(O,c[0],c[1],c[2]);s.toRenderCoords(u,n,u);const h=new G(m,u,o);m[2]>u[2]?l.push(h):r.push(h)}this._cutProjectionLines.setGeometryFromSegments(l),this._fillProjectionLines.setGeometryFromSegments(r)}_updateColors(e,i){const{geometryOutlineColor:s,cutProjectionLineColor:o,fillProjectionLineColor:l}=this._config;if(e){const e=t.toUnitRGBA(i);this._targetGeometry.color=e,this._cutProjectionLines.color=e,this._fillProjectionLines.color=e}else this._targetGeometry.color=t.toUnitRGBA(s),this._cutProjectionLines.color=t.toUnitRGBA(o),this._fillProjectionLines.color=t.toUnitRGBA(l)}_updateLabels(e){const{labelDistance:t}=this._config,{effectiveDisplayUnits:i,labelAnchors:s,messages:o,unitsMessages:l,result:r,visible:n}=e;if(this._cutVolumeLabel.visible=n,this._fillVolumeLabel.visible=n,this._cutVolumeLabel.geometry=s.cut?{type:"point",point:s.cut,callout:{distance:t,offset:0}}:null,this._fillVolumeLabel.geometry=s.fill?{type:"point",point:s.fill,callout:{distance:-t,offset:0}}:null,null==r||null==o||null==l)return this._cutVolumeLabel.text="-",void(this._fillVolumeLabel.text="-");const a=i.volume,m=U(o.labels.cut,{volume:F(l,r.cutVolume,a)}),c=U(o.labels.fill,{volume:F(l,r.fillVolume,a)});this._cutVolumeLabel.text=m,this._fillVolumeLabel.text=c}_updateCutFillVisibility(){this.visible?this._cutFillRenderNode.enable():this._cutFillRenderNode.disable()}_updateCutFillGeometry(){const{renderCoordsHelper:e}=this.view,{targetGeometry:t}=this.analysisViewData;if(!t?.extent)return;const{center:i}=t.extent,s=d(i.x,i.y,0),o=h();e.toRenderCoords(s,t.spatialReference,o);const l=this._getExtrudedVolumes(t,this._extrusionHeight,s),r=this._getExtrudedVolumes(t,-this._extrusionHeight,s);this._cutFillRenderNode.updateGeometries(l,r,o)}_getExtrudedVolumes(e,t,i){const{renderCoordsHelper:s,spatialReference:o,elevationProvider:l}=this.view,r=h(),n=1===s.viewingMode;n||s.worldUpAtPosition([0,0,0],r);const a=A(e,l,s,this._elevationContext),{polygons:m,mapPositions:p,position:d}=a,_=m[0],b=_.count,j=c(_.mapPositions,_.holeIndices,3),L=j.length,V=6*b,G=f(V+L),w=f(L),P=y(3*V),x=y(3*V);C(d,p,j,_,P,null,x,null,G,w,t,r,n);const D=u(),M=u();return g(o,i,D,s.spatialReference),M[12]=-D[12],M[13]=-D[13],M[14]=-D[14],v(P,P,M),new R(P,w,G,x)}async _updateMessageBundle(){this.loadingMessages=!0;try{this.unitsMessages=await M("esri/core/t9n/Units"),this.messages=await M("esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis")}finally{this.loadingMessages=!1}}};function F(e,t,i){return e&&t&&o(e,t,n(t.value,t.unit,i))}e([a({constructOnly:!0})],E.prototype,"view",void 0),e([a({constructOnly:!0})],E.prototype,"analysis",void 0),e([a({constructOnly:!0})],E.prototype,"analysisViewData",void 0),e([a()],E.prototype,"unitsMessages",void 0),e([a()],E.prototype,"messages",void 0),e([a()],E.prototype,"loadingMessages",void 0),e([a({readOnly:!0})],E.prototype,"visible",null),e([a()],E.prototype,"updating",null),E=e([m("esri.views.3d.analysis.VolumeMeasurement.VolumeMeasurementCutFillVisualization")],E);const B=h(),O=h();export{E as VolumeMeasurementCutFillVisualization};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import"../../../core/has.js";import{destroyMaybe as t}from"../../../core/maybe.js";import{verticalLengthUnitFromSpatialReference as i,convertUnit as s}from"../../../core/unitUtils.js";import{property as l}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as o}from"../../../core/accessorSupport/decorators/subclass.js";import{create as r}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import n from"../../../geometry/Point.js";import{getDefaultUnitForView as a}from"../../../support/getDefaultUnitForView.js";import{AnalysisView3D as u}from"./AnalysisView3D.js";import{VolumeMeasurementCutFillController as p}from"./VolumeMeasurement/VolumeMeasurementCutFillController.js";import{VolumeMeasurementCutFillVisualization as m}from"./VolumeMeasurement/VolumeMeasurementCutFillVisualization.js";import y from"./VolumeMeasurement/VolumeMeasurementTool.js";let c=class extends u{constructor(e){super(e),this.type="volume-measurement-view-3d",this.analysis=null,this.elevationAlignedGeometry=null,this.targetGeometry=null}initialize(){const{analysis:e,view:t}=this;this._analysisController=new p({view:t,analysis:e,analysisViewData:this}),this._analysisTool=new y({analysis:e,view:t,analysisViewData:this}),this._analysisVisualization=new m({view:t,analysisViewData:this})}destroy(){this._analysisController=t(this._analysisController),this._analysisVisualization=t(this._analysisVisualization),this._analysisTool.destroy()}get result(){return this._analysisController?.result}get interactive(){return super.interactive}set interactive(e){super.interactive=e}get visible(){return super.visible}set visible(e){super.visible=e}get effectiveTargetElevation(){const{cutFillOptions:e,inputUnits:t}=this.analysis,{targetElevation:l}=e,o=t?.elevation??"meters",r=i(this.view.spatialReference);if(null!=l&&null!=r)return s(l,o,r);const n=this.elevationAlignedGeometry?.extent;return null==n?.zmin||null==n?.zmax?null:(n.zmax+n.zmin)/2}get effectiveDisplayUnits(){const{displayUnits:e}=this.analysis,t=a(this.view);return{elevation:e.elevation??t,volume:e.volume??t}}get labelAnchors(){const{elevationAlignedGeometry:e,view:t}=this,{renderCoordsHelper:i}=t;if(!e)return{cut:null,fill:null};let s=e.rings[0][0],l=e.rings[0][0];e.rings[0].forEach(e=>{e[2]>s[2]&&(s=e),e[2]<l[2]&&(l=e)});const{spatialReference:o}=e,a=new n({x:s[0],y:s[1],z:s[2],spatialReference:o}),u=new n({x:l[0],y:l[1],z:l[2],spatialReference:o}),p=r(),m=r();return i.toRenderCoords(a,p),i.toRenderCoords(u,m),{cut:p,fill:m}}get updating(){return null!=this._analysisController&&this._analysisController.updating||this._analysisTool.updating||this._analysisVisualization.updating}place(e){return this._analysisTool.place(e)}get test(){}};e([l({readOnly:!0})],c.prototype,"type",void 0),e([l({constructOnly:!0,nonNullable:!0})],c.prototype,"analysis",void 0),e([l({readOnly:!0})],c.prototype,"result",null),e([l()],c.prototype,"elevationAlignedGeometry",void 0),e([l({type:Number})],c.prototype,"effectiveTargetElevation",null),e([l()],c.prototype,"targetGeometry",void 0),e([l()],c.prototype,"effectiveDisplayUnits",null),e([l()],c.prototype,"labelAnchors",null),e([l()],c.prototype,"updating",null),c=e([o("esri.views.3d.analysis.VolumeMeasurementAnalysisView3D")],c);const v=c;export{v as default};
5
+ import{__decorate as e}from"tslib";import"../../../core/has.js";import{destroyMaybe as t}from"../../../core/maybe.js";import{verticalLengthUnitFromSpatialReference as i,convertUnit as s}from"../../../core/unitUtils.js";import{property as l}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as o}from"../../../core/accessorSupport/decorators/subclass.js";import{create as r}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import n from"../../../geometry/Point.js";import{getDefaultUnitForView as a}from"../../../support/getDefaultUnitForView.js";import{AnalysisView3D as u}from"./AnalysisView3D.js";import{VolumeMeasurementCutFillController as p}from"./VolumeMeasurement/VolumeMeasurementCutFillController.js";import{VolumeMeasurementCutFillVisualization as m}from"./VolumeMeasurement/VolumeMeasurementCutFillVisualization.js";import y from"./VolumeMeasurement/VolumeMeasurementTool.js";let c=class extends u{constructor(e){super(e),this.type="volume-measurement-view-3d",this.analysis=null,this.elevationAlignedGeometry=null,this.targetGeometry=null}initialize(){const{analysis:e,view:t}=this;this._analysisController=new p({view:t,analysis:e,analysisViewData:this}),this._analysisTool=new y({analysis:e,view:t,analysisViewData:this}),this._analysisVisualization=new m({view:t,analysis:e,analysisViewData:this})}destroy(){this._analysisController=t(this._analysisController),this._analysisVisualization=t(this._analysisVisualization),this._analysisTool.destroy()}get result(){return this._analysisController?.result}get interactive(){return super.interactive}set interactive(e){super.interactive=e}get visible(){return super.visible}set visible(e){super.visible=e}get effectiveTargetElevation(){const{cutFillOptions:e,inputUnits:t}=this.analysis,{targetElevation:l}=e,o=t?.elevation??"meters",r=i(this.view.spatialReference);if(null!=l&&null!=r)return s(l,o,r);const n=this.elevationAlignedGeometry?.extent;return null==n?.zmin||null==n?.zmax?null:(n.zmax+n.zmin)/2}get effectiveDisplayUnits(){const{displayUnits:e}=this.analysis,t=a(this.view);return{elevation:e.elevation??t,volume:e.volume??t}}get labelAnchors(){const{elevationAlignedGeometry:e,view:t}=this,{renderCoordsHelper:i}=t;if(!e)return{cut:null,fill:null};let s=e.rings[0][0],l=e.rings[0][0];e.rings[0].forEach(e=>{e[2]>s[2]&&(s=e),e[2]<l[2]&&(l=e)});const{spatialReference:o}=e,a=new n({x:s[0],y:s[1],z:s[2],spatialReference:o}),u=new n({x:l[0],y:l[1],z:l[2],spatialReference:o}),p=r(),m=r();return i.toRenderCoords(a,p),i.toRenderCoords(u,m),{cut:p,fill:m}}get updating(){return null!=this._analysisController&&this._analysisController.updating||this._analysisTool.updating||this._analysisVisualization.updating}place(e){return this._analysisTool.place(e)}get test(){}};e([l({readOnly:!0})],c.prototype,"type",void 0),e([l({constructOnly:!0,nonNullable:!0})],c.prototype,"analysis",void 0),e([l({readOnly:!0})],c.prototype,"result",null),e([l()],c.prototype,"elevationAlignedGeometry",void 0),e([l({type:Number})],c.prototype,"effectiveTargetElevation",null),e([l()],c.prototype,"targetGeometry",void 0),e([l()],c.prototype,"effectiveDisplayUnits",null),e([l()],c.prototype,"labelAnchors",null),e([l()],c.prototype,"updating",null),c=e([o("esri.views.3d.analysis.VolumeMeasurementAnalysisView3D")],c);const v=c;export{v as default};