@arcgis/core 4.27.0-next.20230514 → 4.27.0-next.20230516

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (419) hide show
  1. package/Graphic.js +1 -1
  2. package/arcade/featureset/sources/FeatureLayerDynamic.js +1 -1
  3. package/arcade/featureset/sources/FeatureLayerMemory.js +1 -1
  4. package/arcade/functions/string.js +1 -1
  5. package/assets/esri/core/workers/RemoteClient.js +1 -1
  6. package/assets/esri/core/workers/chunks/0618fb0058f39ecd363f.js +1 -0
  7. package/assets/esri/core/workers/chunks/415c326d268b1a8fd03f.js +1 -0
  8. package/assets/esri/core/workers/chunks/5c811527898eb1c04e67.js +1 -0
  9. package/assets/esri/core/workers/chunks/62d9d15f0d00a75da42c.js +1 -0
  10. package/assets/esri/core/workers/chunks/93ad67930aa7d4a4b0ac.js +1 -0
  11. package/assets/esri/core/workers/chunks/953407451813f406fdf1.js +1 -0
  12. package/assets/esri/core/workers/chunks/{27081162d73cdded68ff.js → 9e209c6a2aded37f90fb.js} +1 -1
  13. package/assets/esri/core/workers/chunks/a507135977d83aea4421.js +1 -0
  14. package/assets/esri/core/workers/chunks/abe6c99a1a719543dbe8.js +1 -0
  15. package/assets/esri/core/workers/chunks/b91c155de9a89e4e6971.js +1 -0
  16. package/assets/esri/core/workers/chunks/cbe817e966b57599bafd.js +1 -0
  17. package/assets/esri/core/workers/chunks/d265da47f6c752a40ac1.js +1 -0
  18. package/assets/esri/core/workers/chunks/d95ca50ca7af4c222036.js +1 -0
  19. package/assets/esri/core/workers/chunks/e1e0b3580e2c3098c9f4.js +1 -0
  20. package/assets/esri/core/workers/chunks/ef141014ed21a7fd1ff3.js.LICENSE.txt +1 -1
  21. package/assets/esri/t9n/common_ar.json +1 -1
  22. package/assets/esri/t9n/common_bg.json +1 -1
  23. package/assets/esri/t9n/common_bs.json +1 -1
  24. package/assets/esri/t9n/common_ca.json +1 -1
  25. package/assets/esri/t9n/common_cs.json +1 -1
  26. package/assets/esri/t9n/common_da.json +1 -1
  27. package/assets/esri/t9n/common_de.json +1 -1
  28. package/assets/esri/t9n/common_el.json +1 -1
  29. package/assets/esri/t9n/common_es.json +1 -1
  30. package/assets/esri/t9n/common_et.json +1 -1
  31. package/assets/esri/t9n/common_fi.json +1 -1
  32. package/assets/esri/t9n/common_fr.json +1 -1
  33. package/assets/esri/t9n/common_he.json +1 -1
  34. package/assets/esri/t9n/common_hr.json +1 -1
  35. package/assets/esri/t9n/common_hu.json +1 -1
  36. package/assets/esri/t9n/common_id.json +1 -1
  37. package/assets/esri/t9n/common_it.json +1 -1
  38. package/assets/esri/t9n/common_ja.json +1 -1
  39. package/assets/esri/t9n/common_ko.json +1 -1
  40. package/assets/esri/t9n/common_lt.json +1 -1
  41. package/assets/esri/t9n/common_lv.json +1 -1
  42. package/assets/esri/t9n/common_nb.json +1 -1
  43. package/assets/esri/t9n/common_nl.json +1 -1
  44. package/assets/esri/t9n/common_pl.json +1 -1
  45. package/assets/esri/t9n/common_pt-BR.json +1 -1
  46. package/assets/esri/t9n/common_pt-PT.json +1 -1
  47. package/assets/esri/t9n/common_ro.json +1 -1
  48. package/assets/esri/t9n/common_ru.json +1 -1
  49. package/assets/esri/t9n/common_sk.json +1 -1
  50. package/assets/esri/t9n/common_sl.json +1 -1
  51. package/assets/esri/t9n/common_sr.json +1 -1
  52. package/assets/esri/t9n/common_sv.json +1 -1
  53. package/assets/esri/t9n/common_th.json +1 -1
  54. package/assets/esri/t9n/common_tr.json +1 -1
  55. package/assets/esri/t9n/common_uk.json +1 -1
  56. package/assets/esri/t9n/common_vi.json +1 -1
  57. package/assets/esri/t9n/common_zh-CN.json +1 -1
  58. package/assets/esri/t9n/common_zh-HK.json +1 -1
  59. package/assets/esri/t9n/common_zh-TW.json +1 -1
  60. package/assets/esri/themes/base/_core.scss +2 -0
  61. package/assets/esri/themes/base/widgets/_BasemapGallery.scss +198 -125
  62. package/assets/esri/themes/base/widgets/_Features.scss +57 -0
  63. package/assets/esri/themes/base/widgets/_Popup.scss +3 -0
  64. package/assets/esri/themes/dark/main.css +1 -1
  65. package/assets/esri/themes/light/main.css +1 -1
  66. package/assets/esri/themes/light/view.css +1 -1
  67. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery.json +1 -1
  68. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_en.json +1 -1
  69. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_ar.json +1 -1
  70. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_bg.json +1 -1
  71. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_bs.json +1 -1
  72. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_ca.json +1 -1
  73. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_cs.json +1 -1
  74. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_da.json +1 -1
  75. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_de.json +1 -1
  76. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_el.json +1 -1
  77. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_es.json +1 -1
  78. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_et.json +1 -1
  79. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_fi.json +1 -1
  80. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_fr.json +1 -1
  81. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_he.json +1 -1
  82. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_hr.json +1 -1
  83. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_hu.json +1 -1
  84. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_id.json +1 -1
  85. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_it.json +1 -1
  86. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_ja.json +1 -1
  87. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_ko.json +1 -1
  88. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_lt.json +1 -1
  89. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_lv.json +1 -1
  90. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_nb.json +1 -1
  91. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_nl.json +1 -1
  92. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_pl.json +1 -1
  93. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_pt-BR.json +1 -1
  94. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_pt-PT.json +1 -1
  95. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_ro.json +1 -1
  96. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_ru.json +1 -1
  97. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_sk.json +1 -1
  98. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_sl.json +1 -1
  99. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_sr.json +1 -1
  100. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_sv.json +1 -1
  101. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_th.json +1 -1
  102. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_tr.json +1 -1
  103. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_uk.json +1 -1
  104. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_vi.json +1 -1
  105. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_zh-CN.json +1 -1
  106. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_zh-HK.json +1 -1
  107. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_zh-TW.json +1 -1
  108. package/assets/esri/widgets/Directions/t9n/Directions_ar.json +1 -1
  109. package/assets/esri/widgets/Directions/t9n/Directions_bg.json +1 -1
  110. package/assets/esri/widgets/Directions/t9n/Directions_bs.json +1 -1
  111. package/assets/esri/widgets/Directions/t9n/Directions_ca.json +1 -1
  112. package/assets/esri/widgets/Directions/t9n/Directions_cs.json +1 -1
  113. package/assets/esri/widgets/Directions/t9n/Directions_da.json +1 -1
  114. package/assets/esri/widgets/Directions/t9n/Directions_de.json +1 -1
  115. package/assets/esri/widgets/Directions/t9n/Directions_el.json +1 -1
  116. package/assets/esri/widgets/Directions/t9n/Directions_es.json +1 -1
  117. package/assets/esri/widgets/Directions/t9n/Directions_et.json +1 -1
  118. package/assets/esri/widgets/Directions/t9n/Directions_fi.json +1 -1
  119. package/assets/esri/widgets/Directions/t9n/Directions_fr.json +1 -1
  120. package/assets/esri/widgets/Directions/t9n/Directions_he.json +1 -1
  121. package/assets/esri/widgets/Directions/t9n/Directions_hr.json +1 -1
  122. package/assets/esri/widgets/Directions/t9n/Directions_hu.json +1 -1
  123. package/assets/esri/widgets/Directions/t9n/Directions_id.json +1 -1
  124. package/assets/esri/widgets/Directions/t9n/Directions_it.json +1 -1
  125. package/assets/esri/widgets/Directions/t9n/Directions_ja.json +1 -1
  126. package/assets/esri/widgets/Directions/t9n/Directions_ko.json +1 -1
  127. package/assets/esri/widgets/Directions/t9n/Directions_lt.json +1 -1
  128. package/assets/esri/widgets/Directions/t9n/Directions_lv.json +1 -1
  129. package/assets/esri/widgets/Directions/t9n/Directions_nb.json +1 -1
  130. package/assets/esri/widgets/Directions/t9n/Directions_nl.json +1 -1
  131. package/assets/esri/widgets/Directions/t9n/Directions_pl.json +1 -1
  132. package/assets/esri/widgets/Directions/t9n/Directions_pt-BR.json +1 -1
  133. package/assets/esri/widgets/Directions/t9n/Directions_pt-PT.json +1 -1
  134. package/assets/esri/widgets/Directions/t9n/Directions_ro.json +1 -1
  135. package/assets/esri/widgets/Directions/t9n/Directions_ru.json +1 -1
  136. package/assets/esri/widgets/Directions/t9n/Directions_sk.json +1 -1
  137. package/assets/esri/widgets/Directions/t9n/Directions_sl.json +1 -1
  138. package/assets/esri/widgets/Directions/t9n/Directions_sr.json +1 -1
  139. package/assets/esri/widgets/Directions/t9n/Directions_sv.json +1 -1
  140. package/assets/esri/widgets/Directions/t9n/Directions_th.json +1 -1
  141. package/assets/esri/widgets/Directions/t9n/Directions_tr.json +1 -1
  142. package/assets/esri/widgets/Directions/t9n/Directions_uk.json +1 -1
  143. package/assets/esri/widgets/Directions/t9n/Directions_vi.json +1 -1
  144. package/assets/esri/widgets/Directions/t9n/Directions_zh-CN.json +1 -1
  145. package/assets/esri/widgets/Directions/t9n/Directions_zh-HK.json +1 -1
  146. package/assets/esri/widgets/Directions/t9n/Directions_zh-TW.json +1 -1
  147. package/assets/esri/widgets/Feature/t9n/Feature_ar.json +1 -1
  148. package/assets/esri/widgets/Feature/t9n/Feature_bg.json +1 -1
  149. package/assets/esri/widgets/Feature/t9n/Feature_bs.json +1 -1
  150. package/assets/esri/widgets/Feature/t9n/Feature_ca.json +1 -1
  151. package/assets/esri/widgets/Feature/t9n/Feature_cs.json +1 -1
  152. package/assets/esri/widgets/Feature/t9n/Feature_da.json +1 -1
  153. package/assets/esri/widgets/Feature/t9n/Feature_de.json +1 -1
  154. package/assets/esri/widgets/Feature/t9n/Feature_el.json +1 -1
  155. package/assets/esri/widgets/Feature/t9n/Feature_es.json +1 -1
  156. package/assets/esri/widgets/Feature/t9n/Feature_et.json +1 -1
  157. package/assets/esri/widgets/Feature/t9n/Feature_fi.json +1 -1
  158. package/assets/esri/widgets/Feature/t9n/Feature_fr.json +1 -1
  159. package/assets/esri/widgets/Feature/t9n/Feature_he.json +1 -1
  160. package/assets/esri/widgets/Feature/t9n/Feature_hr.json +1 -1
  161. package/assets/esri/widgets/Feature/t9n/Feature_hu.json +1 -1
  162. package/assets/esri/widgets/Feature/t9n/Feature_id.json +1 -1
  163. package/assets/esri/widgets/Feature/t9n/Feature_it.json +1 -1
  164. package/assets/esri/widgets/Feature/t9n/Feature_ja.json +1 -1
  165. package/assets/esri/widgets/Feature/t9n/Feature_ko.json +1 -1
  166. package/assets/esri/widgets/Feature/t9n/Feature_lt.json +1 -1
  167. package/assets/esri/widgets/Feature/t9n/Feature_lv.json +1 -1
  168. package/assets/esri/widgets/Feature/t9n/Feature_nb.json +1 -1
  169. package/assets/esri/widgets/Feature/t9n/Feature_nl.json +1 -1
  170. package/assets/esri/widgets/Feature/t9n/Feature_pl.json +1 -1
  171. package/assets/esri/widgets/Feature/t9n/Feature_pt-BR.json +1 -1
  172. package/assets/esri/widgets/Feature/t9n/Feature_pt-PT.json +1 -1
  173. package/assets/esri/widgets/Feature/t9n/Feature_ro.json +1 -1
  174. package/assets/esri/widgets/Feature/t9n/Feature_ru.json +1 -1
  175. package/assets/esri/widgets/Feature/t9n/Feature_sk.json +1 -1
  176. package/assets/esri/widgets/Feature/t9n/Feature_sl.json +1 -1
  177. package/assets/esri/widgets/Feature/t9n/Feature_sr.json +1 -1
  178. package/assets/esri/widgets/Feature/t9n/Feature_sv.json +1 -1
  179. package/assets/esri/widgets/Feature/t9n/Feature_th.json +1 -1
  180. package/assets/esri/widgets/Feature/t9n/Feature_tr.json +1 -1
  181. package/assets/esri/widgets/Feature/t9n/Feature_uk.json +1 -1
  182. package/assets/esri/widgets/Feature/t9n/Feature_vi.json +1 -1
  183. package/assets/esri/widgets/Feature/t9n/Feature_zh-CN.json +1 -1
  184. package/assets/esri/widgets/Feature/t9n/Feature_zh-HK.json +1 -1
  185. package/assets/esri/widgets/Feature/t9n/Feature_zh-TW.json +1 -1
  186. package/assets/esri/widgets/LayerList/t9n/LayerList_ar.json +1 -1
  187. package/assets/esri/widgets/LayerList/t9n/LayerList_bg.json +1 -1
  188. package/assets/esri/widgets/LayerList/t9n/LayerList_bs.json +1 -1
  189. package/assets/esri/widgets/LayerList/t9n/LayerList_ca.json +1 -1
  190. package/assets/esri/widgets/LayerList/t9n/LayerList_cs.json +1 -1
  191. package/assets/esri/widgets/LayerList/t9n/LayerList_da.json +1 -1
  192. package/assets/esri/widgets/LayerList/t9n/LayerList_de.json +1 -1
  193. package/assets/esri/widgets/LayerList/t9n/LayerList_el.json +1 -1
  194. package/assets/esri/widgets/LayerList/t9n/LayerList_es.json +1 -1
  195. package/assets/esri/widgets/LayerList/t9n/LayerList_et.json +1 -1
  196. package/assets/esri/widgets/LayerList/t9n/LayerList_fi.json +1 -1
  197. package/assets/esri/widgets/LayerList/t9n/LayerList_fr.json +1 -1
  198. package/assets/esri/widgets/LayerList/t9n/LayerList_he.json +1 -1
  199. package/assets/esri/widgets/LayerList/t9n/LayerList_hr.json +1 -1
  200. package/assets/esri/widgets/LayerList/t9n/LayerList_hu.json +1 -1
  201. package/assets/esri/widgets/LayerList/t9n/LayerList_id.json +1 -1
  202. package/assets/esri/widgets/LayerList/t9n/LayerList_it.json +1 -1
  203. package/assets/esri/widgets/LayerList/t9n/LayerList_ja.json +1 -1
  204. package/assets/esri/widgets/LayerList/t9n/LayerList_ko.json +1 -1
  205. package/assets/esri/widgets/LayerList/t9n/LayerList_lt.json +1 -1
  206. package/assets/esri/widgets/LayerList/t9n/LayerList_lv.json +1 -1
  207. package/assets/esri/widgets/LayerList/t9n/LayerList_nb.json +1 -1
  208. package/assets/esri/widgets/LayerList/t9n/LayerList_nl.json +1 -1
  209. package/assets/esri/widgets/LayerList/t9n/LayerList_pl.json +1 -1
  210. package/assets/esri/widgets/LayerList/t9n/LayerList_pt-BR.json +1 -1
  211. package/assets/esri/widgets/LayerList/t9n/LayerList_pt-PT.json +1 -1
  212. package/assets/esri/widgets/LayerList/t9n/LayerList_ro.json +1 -1
  213. package/assets/esri/widgets/LayerList/t9n/LayerList_ru.json +1 -1
  214. package/assets/esri/widgets/LayerList/t9n/LayerList_sk.json +1 -1
  215. package/assets/esri/widgets/LayerList/t9n/LayerList_sl.json +1 -1
  216. package/assets/esri/widgets/LayerList/t9n/LayerList_sr.json +1 -1
  217. package/assets/esri/widgets/LayerList/t9n/LayerList_sv.json +1 -1
  218. package/assets/esri/widgets/LayerList/t9n/LayerList_th.json +1 -1
  219. package/assets/esri/widgets/LayerList/t9n/LayerList_tr.json +1 -1
  220. package/assets/esri/widgets/LayerList/t9n/LayerList_uk.json +1 -1
  221. package/assets/esri/widgets/LayerList/t9n/LayerList_vi.json +1 -1
  222. package/assets/esri/widgets/LayerList/t9n/LayerList_zh-CN.json +1 -1
  223. package/assets/esri/widgets/LayerList/t9n/LayerList_zh-HK.json +1 -1
  224. package/assets/esri/widgets/LayerList/t9n/LayerList_zh-TW.json +1 -1
  225. package/assets/esri/widgets/Slice/t9n/Slice_ar.json +1 -1
  226. package/assets/esri/widgets/Slice/t9n/Slice_bg.json +1 -1
  227. package/assets/esri/widgets/Slice/t9n/Slice_bs.json +1 -1
  228. package/assets/esri/widgets/Slice/t9n/Slice_ca.json +1 -1
  229. package/assets/esri/widgets/Slice/t9n/Slice_cs.json +1 -1
  230. package/assets/esri/widgets/Slice/t9n/Slice_da.json +1 -1
  231. package/assets/esri/widgets/Slice/t9n/Slice_de.json +1 -1
  232. package/assets/esri/widgets/Slice/t9n/Slice_el.json +1 -1
  233. package/assets/esri/widgets/Slice/t9n/Slice_es.json +1 -1
  234. package/assets/esri/widgets/Slice/t9n/Slice_et.json +1 -1
  235. package/assets/esri/widgets/Slice/t9n/Slice_fi.json +1 -1
  236. package/assets/esri/widgets/Slice/t9n/Slice_fr.json +1 -1
  237. package/assets/esri/widgets/Slice/t9n/Slice_he.json +1 -1
  238. package/assets/esri/widgets/Slice/t9n/Slice_hr.json +1 -1
  239. package/assets/esri/widgets/Slice/t9n/Slice_hu.json +1 -1
  240. package/assets/esri/widgets/Slice/t9n/Slice_id.json +1 -1
  241. package/assets/esri/widgets/Slice/t9n/Slice_it.json +1 -1
  242. package/assets/esri/widgets/Slice/t9n/Slice_ja.json +1 -1
  243. package/assets/esri/widgets/Slice/t9n/Slice_ko.json +1 -1
  244. package/assets/esri/widgets/Slice/t9n/Slice_lt.json +1 -1
  245. package/assets/esri/widgets/Slice/t9n/Slice_lv.json +1 -1
  246. package/assets/esri/widgets/Slice/t9n/Slice_nb.json +1 -1
  247. package/assets/esri/widgets/Slice/t9n/Slice_nl.json +1 -1
  248. package/assets/esri/widgets/Slice/t9n/Slice_pl.json +1 -1
  249. package/assets/esri/widgets/Slice/t9n/Slice_pt-BR.json +1 -1
  250. package/assets/esri/widgets/Slice/t9n/Slice_pt-PT.json +1 -1
  251. package/assets/esri/widgets/Slice/t9n/Slice_ro.json +1 -1
  252. package/assets/esri/widgets/Slice/t9n/Slice_ru.json +1 -1
  253. package/assets/esri/widgets/Slice/t9n/Slice_sk.json +1 -1
  254. package/assets/esri/widgets/Slice/t9n/Slice_sl.json +1 -1
  255. package/assets/esri/widgets/Slice/t9n/Slice_sr.json +1 -1
  256. package/assets/esri/widgets/Slice/t9n/Slice_sv.json +1 -1
  257. package/assets/esri/widgets/Slice/t9n/Slice_th.json +1 -1
  258. package/assets/esri/widgets/Slice/t9n/Slice_tr.json +1 -1
  259. package/assets/esri/widgets/Slice/t9n/Slice_uk.json +1 -1
  260. package/assets/esri/widgets/Slice/t9n/Slice_vi.json +1 -1
  261. package/assets/esri/widgets/Slice/t9n/Slice_zh-CN.json +1 -1
  262. package/assets/esri/widgets/Slice/t9n/Slice_zh-HK.json +1 -1
  263. package/assets/esri/widgets/Slice/t9n/Slice_zh-TW.json +1 -1
  264. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_ar.json +1 -1
  265. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_bg.json +1 -1
  266. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_bs.json +1 -1
  267. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_ca.json +1 -1
  268. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_cs.json +1 -1
  269. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_da.json +1 -1
  270. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_de.json +1 -1
  271. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_el.json +1 -1
  272. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_es.json +1 -1
  273. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_et.json +1 -1
  274. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_fi.json +1 -1
  275. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_fr.json +1 -1
  276. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_he.json +1 -1
  277. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_hr.json +1 -1
  278. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_hu.json +1 -1
  279. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_id.json +1 -1
  280. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_it.json +1 -1
  281. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_ja.json +1 -1
  282. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_ko.json +1 -1
  283. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_lt.json +1 -1
  284. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_lv.json +1 -1
  285. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_nb.json +1 -1
  286. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_nl.json +1 -1
  287. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_pl.json +1 -1
  288. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_pt-BR.json +1 -1
  289. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_pt-PT.json +1 -1
  290. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_ro.json +1 -1
  291. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_ru.json +1 -1
  292. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_sk.json +1 -1
  293. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_sl.json +1 -1
  294. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_sr.json +1 -1
  295. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_sv.json +1 -1
  296. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_th.json +1 -1
  297. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_tr.json +1 -1
  298. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_uk.json +1 -1
  299. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_vi.json +1 -1
  300. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_zh-CN.json +1 -1
  301. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_zh-HK.json +1 -1
  302. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_zh-TW.json +1 -1
  303. package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_ar.json +1 -1
  304. package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_bg.json +1 -1
  305. package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_bs.json +1 -1
  306. package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_ca.json +1 -1
  307. package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_cs.json +1 -1
  308. package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_da.json +1 -1
  309. package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_de.json +1 -1
  310. package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_el.json +1 -1
  311. package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_es.json +1 -1
  312. package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_et.json +1 -1
  313. package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_fi.json +1 -1
  314. package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_fr.json +1 -1
  315. package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_he.json +1 -1
  316. package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_hr.json +1 -1
  317. package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_hu.json +1 -1
  318. package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_id.json +1 -1
  319. package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_it.json +1 -1
  320. package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_ja.json +1 -1
  321. package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_ko.json +1 -1
  322. package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_lt.json +1 -1
  323. package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_lv.json +1 -1
  324. package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_nb.json +1 -1
  325. package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_nl.json +1 -1
  326. package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_pl.json +1 -1
  327. package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_pt-BR.json +1 -1
  328. package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_pt-PT.json +1 -1
  329. package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_ro.json +1 -1
  330. package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_ru.json +1 -1
  331. package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_sk.json +1 -1
  332. package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_sl.json +1 -1
  333. package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_sr.json +1 -1
  334. package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_sv.json +1 -1
  335. package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_th.json +1 -1
  336. package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_tr.json +1 -1
  337. package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_uk.json +1 -1
  338. package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_vi.json +1 -1
  339. package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_zh-CN.json +1 -1
  340. package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_zh-HK.json +1 -1
  341. package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_zh-TW.json +1 -1
  342. package/chunks/languageUtils.js +1 -1
  343. package/core/ReactiveMap.js +5 -0
  344. package/core/ReactiveSet.js +5 -0
  345. package/form/elements/RelationshipElement.js +1 -1
  346. package/geometry/Mesh.js +1 -1
  347. package/geometry/support/meshUtils/External.js +1 -1
  348. package/interfaces.d.ts +102 -54
  349. package/layers/BuildingSceneLayer.js +1 -1
  350. package/layers/KnowledgeGraphLayer.js +1 -1
  351. package/layers/LinkChartLayer.js +1 -1
  352. package/layers/SceneLayer.js +1 -1
  353. package/layers/graphics/sources/FeatureLayerSource.js +1 -1
  354. package/layers/graphics/sources/support/uploadAssets.js +1 -1
  355. package/layers/knowledgeGraph/KnowledgeGraphLayerDataManager.js +1 -1
  356. package/layers/video/VideoEngine.js +1 -1
  357. package/package.json +2 -2
  358. package/portal/schemas/buildingSceneLayerItem.js +1 -1
  359. package/portal/schemas/definitions.js +1 -1
  360. package/support/basemapUtils.js +1 -1
  361. package/support/revision.js +1 -1
  362. package/symbols/cim/cimAnalyzer.js +1 -1
  363. package/symbols/cim/placements/PlacementInsidePolygon.js +1 -1
  364. package/views/2d/engine/webgl/brushes/WGLGeometryBrushFill.js +1 -1
  365. package/views/2d/engine/webgl/definitions.js +1 -1
  366. package/views/2d/engine/webgl/mesh/templates/WGLDynamicFillTemplate.js +1 -1
  367. package/views/2d/engine/webgl/mesh/templates/WGLFillTemplate.js +1 -1
  368. package/views/2d/engine/webgl/painter/RenderPass.js +1 -1
  369. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  370. package/views/2d/layers/FeatureLayerView2D.js +1 -1
  371. package/views/2d/layers/MediaLayerView2D.js +1 -1
  372. package/views/2d/layers/TileLayerView2D.js +1 -1
  373. package/views/3d/analysis/Slice/SliceTool.js +1 -1
  374. package/views/3d/interactive/editingTools/draw/DrawGraphicTool3D.js +1 -1
  375. package/views/3d/interactive/editingTools/moveGraphic/GraphicMoveTool.js +1 -1
  376. package/views/3d/interactive/editingTools/transformGraphic/GraphicTransformTool.js +1 -1
  377. package/views/3d/layers/graphics/ElevationAligners.js +1 -1
  378. package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
  379. package/views/3d/layers/i3s/I3SClientNodeLoader.js +1 -1
  380. package/views/3d/layers/i3s/I3SMaterialUtil.js +1 -1
  381. package/views/3d/webgl-engine/lib/OffscreenRendering.js +1 -1
  382. package/views/3d/webgl-engine/lib/RenderFeature.js +1 -1
  383. package/views/3d/webgl-engine/lib/RenderTargetHelper.js +1 -1
  384. package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
  385. package/views/3d/webgl-engine/lib/SmaaRenderPass.js +1 -1
  386. package/views/3d/webgl-engine/lib/TextTextureAtlas.js +1 -1
  387. package/views/3d/webgl-engine/lib/textureUtils.js +5 -0
  388. package/views/PopupView.js +1 -1
  389. package/views/ToolViewManager.js +1 -1
  390. package/views/View.js +1 -1
  391. package/views/interactive/InteractiveToolBase.js +1 -1
  392. package/views/interactive/ToolViewManagerManipulatorState.js +1 -1
  393. package/widgets/BasemapGallery/css.js +1 -1
  394. package/widgets/BasemapGallery.js +1 -1
  395. package/widgets/Editor/Edits.js +1 -1
  396. package/widgets/Editor/UpdateWorkflow.js +1 -1
  397. package/widgets/Editor/workflowUtils.js +1 -1
  398. package/widgets/Feature/FeatureRelationship.js +1 -1
  399. package/widgets/FeatureForm/RelationshipInput.js +1 -1
  400. package/widgets/FeatureForm.js +1 -1
  401. package/widgets/FeatureTable/support/FeatureStore.js +1 -1
  402. package/widgets/Features/FeaturesViewModel.js +5 -0
  403. package/widgets/Features.js +5 -0
  404. package/widgets/Popup/actionUtils.js +1 -1
  405. package/widgets/Popup/actions.js +1 -1
  406. package/widgets/Popup.js +1 -1
  407. package/assets/esri/core/workers/chunks/08e1453cc3689a0094a6.js +0 -1
  408. package/assets/esri/core/workers/chunks/3a658eb0bc632ff0d01c.js +0 -1
  409. package/assets/esri/core/workers/chunks/43fcc9a3b5a46c3dfd0d.js +0 -1
  410. package/assets/esri/core/workers/chunks/47f721daa1652124c066.js +0 -1
  411. package/assets/esri/core/workers/chunks/544dce9710638d126763.js +0 -1
  412. package/assets/esri/core/workers/chunks/630b3fca46208caf4190.js +0 -1
  413. package/assets/esri/core/workers/chunks/6d2a448fe0dc6ebdbd6d.js +0 -1
  414. package/assets/esri/core/workers/chunks/7e9b173a71beeba8b263.js +0 -1
  415. package/assets/esri/core/workers/chunks/b1976202b918a64357ac.js +0 -1
  416. package/assets/esri/core/workers/chunks/b4d03661d1d8983fc13f.js +0 -1
  417. package/assets/esri/core/workers/chunks/b636581516f2e7342d29.js +0 -1
  418. package/assets/esri/core/workers/chunks/e7e7f6046cf1286365ca.js +0 -1
  419. package/assets/esri/core/workers/chunks/f17a7024dd49abeaa4f3.js +0 -1
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../AggregateGraphic.js";import"../../../geometry.js";import r from"../../../Graphic.js";import{isSome as i}from"../../../core/arrayUtils.js";import s from"../../../core/Collection.js";import a from"../../../core/Error.js";import has from"../../../core/has.js";import{clone as n}from"../../../core/lang.js";import o from"../../../core/Logger.js";import{applySome as l,destroyMaybe as u,removeMaybe as d}from"../../../core/maybe.js";import{debounce as h,isAbortError as p}from"../../../core/promiseUtils.js";import{watch as c,syncAndInitial as y,initial as g}from"../../../core/reactiveUtils.js";import{property as f}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as m}from"../../../core/accessorSupport/decorators/subclass.js";import _ from"../../../layers/effects/FeatureEffectView.js";import v from"../../../layers/support/FeatureFilter.js";import{getEffectiveLayerCapabilities as b}from"../../../layers/support/layerUtils.js";import R from"../../../rest/support/AggregateFeatureSet.js";import S from"../../../rest/support/FeatureSet.js";import w from"../../../rest/support/Query.js";import{MAX_FILTERS as x}from"../engine/webgl/definitions.js";import{LayerView2DMixin as F}from"./LayerView2D.js";import{createSchema as U}from"./features/schemaUtils.js";import{createOrReuseTileRenderer as C}from"./features/tileRenderers.js";import{isRendererSupported as q}from"./features/support/rendererUtils.js";import{findSizeVV as I,createClusterCountSizeVariable as O,injectDynamicLevelDependentSizeVisualVariable as V,isClusterCompatibleRenderer as E,createClusterRenderer as T}from"./support/clusterUtils.js";import j from"./support/FeatureCommandQueue.js";import A from"./support/FeatureLayerProxy.js";import{toJSONGeometryType as L}from"./support/util.js";import{TileManager as N}from"../tiling/TileManager.js";import Q from"../../layers/FeatureLayerView.js";import k from"../../layers/LayerView.js";import H from"../../layers/RefreshableLayerView.js";import{getWebGLCapabilities as P}from"../../webgl/capabilities.js";import J from"../../../geometry/Extent.js";function z(e){return e&&"openPorts"in e}let D=class extends(Q(H(F(k)))){constructor(){super(...arguments),this._pipelineIsUpdating=!0,this._commandsQueue=new j({process:e=>{switch(e.type){case"processed-edit":return this._doEdit(e);case"refresh":return this._doRefresh(e.dataChanged);case"update":return this._doUpdate()}}}),this._visibilityOverrides=new Set,this._highlightIds=new Map,this._updateHighlight=h((async()=>this._proxy.setHighlight(Array.from(this._highlightIds.keys())))),this._uploadsLocked=!1,this._needsClusterSizeUpdate=!1,this.featureEffectView=new _,this._lastDefinitionExpression=null}destroy(){l(this._updateClusterSizeTask,(e=>e.remove())),this._proxy?.destroy(),this._commandsQueue.destroy()}initialize(){this.addResolvingPromise(Promise.all([this._initProxy(),this._initServiceOptions()])),this.addHandles([this.on("valueRangesChanged",(e=>{this._set("_aggregateValueRanges",e.valueRanges)})),c((()=>this.featureEffect),(e=>{this.featureEffectView.featureEffect=e}),y)],"constructor"),this.featureEffectView.endTransitions()}async _initProxy(){const e=this.layer;if("isTable"in e&&e.isTable)throw new a("featurelayerview:table-not-supported","table feature layer can't be displayed",{layer:this.layer});if(("feature"===e.type||"subtype-group"===e.type)&&!b(e)?.operations.supportsQuery)throw new a("featurelayerview:query-not-supported","layer view requires a layer with query capability",{layer:e});this._proxy&&this._proxy.destroy();const t=this._createClientOptions();return this._set("_proxy",new A({client:t})),this._proxy.when()}async _initServiceOptions(){return this._set("_serviceOptions",await this._createServiceOptions()),this._serviceOptions}get _effectiveFeatureReduction(){if(!("featureReduction"in this.layer))return null;const e=this.layer.featureReduction;return e&&(!("maxScale"in e)||!e.maxScale||e.maxScale<this.view.scale)?e:null}get orderByFields(){return"stream"!==this._serviceOptions?.type?this._serviceOptions?.orderByFields:void 0}get labelsVisible(){const e="subtype-group"===this.layer.type?this.layer.sublayers.items:[this.layer];return!this.suspended&&e.some((e=>e.labelingInfo&&e.labelsVisible))}get queryMode(){return this._serviceOptions?.type}get renderingConfigHash(){if(!this.layer)return null;const e=this.availableFields,t=this.layer,r=this.view.floors,{definitionExpression:i}=t,s="subtype-group"!==this.layer.type&&this.layer.labelsVisible&&this.layer.labelingInfo,a="renderer"in t&&t.renderer,n="gdbVersion"in t?t.gdbVersion:void 0,o="historicMoment"in t?t.historicMoment?.getTime():void 0,{timeExtent:l}=this,u="customParameters"in t?JSON.stringify(t.customParameters):void 0,d="apiKey"in t?t.apiKey:void 0,h="stream"===t.type?`${JSON.stringify(t.geometryDefinition)}${t.definitionExpression}`:null,p=JSON.stringify(this.clips),c=this._effectiveFeatureReduction?.toJSON(),y="orderBy"in this.layer&&JSON.stringify(this.layer.orderBy),g="sublayers"in this.layer&&this.layer.sublayers.items.reduce(((e,t)=>e+`${t.visible?1:0}.${JSON.stringify(t.renderer)}.${t.labelsVisible}\n.${JSON.stringify(t.labelingInfo)}`),""),f="subtypeCode"in this.layer&&this.layer.subtypeCode;return JSON.stringify({orderBy:y,sublayerHash:g,subtypeCode:f,filterHash:null!=this.filter&&this.filter.toJSON(),effectHash:null!=this.featureEffect&&this.featureEffect.toJSON(),streamFilter:h,gdbVersion:n,definitionExpression:i,historicMoment:o,availableFields:e,renderer:a,labelingInfo:s,timeExtent:l,floors:r,clipsHash:p,featureReduction:c,customParameters:u,apiKey:d})}highlight(e){let t;e instanceof r?t=[e.getObjectId()]:"number"==typeof e||"string"==typeof e?t=[e]:s.isCollection(e)&&e.length>0?t=e.map((e=>e?.getObjectId())).toArray():Array.isArray(e)&&e.length>0&&(t="number"==typeof e[0]||"string"==typeof e[0]?e:e.map((e=>e?.getObjectId())));const a=t?.filter(i);return a&&a.length?(this._addHighlight(a),{remove:()=>this._removeHighlight(a)}):{remove:()=>{}}}hasHighlight(){return!!this._highlightIds.size}async hitTest(e,i){if(!this.tileRenderer)return null;const s=await this.tileRenderer.hitTest(i);if(0===s.length)return null;const{features:a,aggregates:n}=await this._proxy.getFeatures(s);return[...n.map((r=>this._createGraphicHit(e,t.fromJSON(r)))),...a.map((t=>this._createGraphicHit(e,r.fromJSON(t))))]}queryStatistics(){return this._proxy.queryStatistics()}async querySummaryStatistics(e,t,r){const i={...t,scale:this.view.scale};return this._proxy.querySummaryStatistics(this._cleanUpQuery(e),i,r)}async queryAggregateSummaryStatistics(e,t,r){const i={...t,scale:this.view.scale};return this._proxy.queryAggregateSummaryStatistics(this._cleanUpAggregateQuery(e),i,r)}async queryUniqueValues(e,t,r){const i={...t,scale:this.view.scale};return this._proxy.queryUniqueValues(this._cleanUpQuery(e),i,r)}async queryAggregateUniqueValues(e,t,r){const i={...t,scale:this.view.scale};return this._proxy.queryAggregateUniqueValues(this._cleanUpAggregateQuery(e),i,r)}async queryClassBreaks(e,t,r){const i={...t,scale:this.view.scale};return this._proxy.queryClassBreaks(this._cleanUpQuery(e),i,r)}async queryAggregateClassBreaks(e,t,r){const i={...t,scale:this.view.scale};return this._proxy.queryAggregateClassBreaks(this._cleanUpAggregateQuery(e),i,r)}async queryHistogram(e,t,r){const i={...t,scale:this.view.scale};return this._proxy.queryHistogram(this._cleanUpQuery(e),i,r)}async queryAggregateHistogram(e,t,r){const i={...t,scale:this.view.scale};return this._proxy.queryAggregateHistogram(this._cleanUpAggregateQuery(e),i,r)}queryFeatures(e,t){return this.queryFeaturesJSON(e,t).then((e=>{const t=S.fromJSON(e);return t.features.forEach((e=>this._setLayersForFeature(e))),t}))}queryVisibleFeatures(e,t){return this._proxy.queryVisibleFeatures(this._cleanUpQuery(e),t).then((e=>{const t=S.fromJSON(e);return t.features.forEach((e=>this._setLayersForFeature(e))),t}))}async queryAggregates(e,t){const r=await this._proxy.queryAggregates(this._cleanUpAggregateQuery(e),t),i=R.fromJSON(r);return i.features.forEach((e=>this._setLayersForFeature(e))),i}queryAggregateIds(e,t){return this._proxy.queryAggregateIds(this._cleanUpAggregateQuery(e),t)}queryAggregateCount(e,t){return this._proxy.queryAggregateCount(this._cleanUpAggregateQuery(e),t)}queryAggregateJSON(e,t){return this._proxy.queryAggregates(this._cleanUpAggregateQuery(e),t)}queryFeaturesJSON(e,t){return this._proxy.queryFeatures(this._cleanUpQuery(e),t)}queryObjectIds(e,t){return this._proxy.queryObjectIds(this._cleanUpQuery(e),t)}queryFeatureCount(e,t){return this._proxy.queryFeatureCount(this._cleanUpQuery(e),t)}queryExtent(e,t){return this._proxy.queryExtent(this._cleanUpQuery(e),t).then((e=>({count:e.count,extent:J.fromJSON(e.extent)})))}setVisibility(e,t){t?this._visibilityOverrides.delete(e):this._visibilityOverrides.add(e),this._update()}update(e){if(!this._tileStrategy||!this.tileRenderer)return;const{hasMissingTiles:t,added:r,removed:i}=this._tileStrategy.update(e);(r.length||i.length)&&this._proxy.updateTiles({added:r,removed:i}),t&&this.requestUpdate(),this.notifyChange("updating")}attach(){this.view.timeline.record(`${this.layer.title} (FeatureLayer) Attach`),this._tileStrategy=new N({acquireTile:e=>this._acquireTile(e),releaseTile:e=>this._releaseTile(e),tileInfoView:this.view.featuresTilingScheme,buffer:0}),this.addAttachHandles(c((()=>this.renderingConfigHash),(()=>this._update()),g)),"stream"!==this.layer.type&&this.addAttachHandles(this.layer.on("edits",(e=>this._edit(e))))}detach(){this._commandsQueue.clear(),this._proxy?.stop(),this.container.removeAllChildren(),this.tileRenderer?.uninstall(this.container),this.tileRenderer=null,this._tileStrategy=u(this._tileStrategy),this._tileRendererHash=null}moveStart(){this.requestUpdate()}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}isUpdating(){const e="renderer"in this.layer&&null!=this.layer.renderer,t=this._commandsQueue.updating,r=null!=this._updatingRequiredFieldsPromise,i=!this._proxy||!this._proxy.isReady,s=this._pipelineIsUpdating,a=null==this.tileRenderer||this.tileRenderer?.updating,n=e&&(t||r||i||s||a);return has("esri-2d-log-updating")&&console.log(`Updating FLV2D (${this.layer.id}): ${n}\n -> hasRenderer ${e}\n -> hasPendingCommand ${t}\n -> updatingRequiredFields ${r}\n -> updatingProxy ${i}\n -> updatingPipeline ${s}\n -> updatingTileRenderer ${a}\n`),n}_createClientOptions(){return{setUpdating:e=>{this._set("_pipelineIsUpdating",e)},emitEvent:e=>{this.emit(e.name,e.event)}}}async _detectQueryMode(e){const t="path"in e,{layer:r}=this,i="editingInfo"in r&&r.editingInfo?.lastEditDate,s="refreshInterval"in r&&!!r.refreshInterval,a=!i&&s,n=b(r);if(t&&("feature"===r.type||"subtype-group"===r.type)&&"point"===r.geometryType&&n?.query.supportsPagination&&!n?.operations.supportsEditing&&!a&&has("featurelayer-snapshot-enabled"))try{const e=await r.queryFeatureCount();if(e<=has("featurelayer-snapshot-point-min-threshold"))return{mode:"snapshot",featureCount:e};const t=has("featurelayer-snapshot-point-max-threshold"),i=has("featurelayer-snapshot-point-coverage"),s=this.view.extent,a=r.fullExtent,n=a?.clone().intersection(s),o=null!=n?n.width*n.height:0,l=a?.width*a?.height;if(e<=t&&(0===l?0:o/l)>=i)return{mode:"snapshot",featureCount:e}}catch(l){o.getLogger(this).warn("mapview-feature-layer","Encountered an error when querying for featureCount",{error:l})}return{mode:"on-demand"}}async _createServiceOptions(){const e=this.layer;if("stream"===e.type)return null;const t=b(e),{capabilities:r,objectIdField:i}=e,s=e.fields.map((e=>e.toJSON())),a=null!=e.fullExtent?e.fullExtent.toJSON():null,o=L(e.geometryType),l="timeInfo"in e&&e.timeInfo&&e.timeInfo.toJSON()||null,u=e.spatialReference?e.spatialReference.toJSON():null,d="feature"===e.type?e.globalIdField:null;let h;"ogc-feature"===e.type?h=e.source.getSource():z(e.source)?h=await e.source.openPorts():e.parsedUrl&&(h=n(e.parsedUrl),"dynamicDataSource"in e&&e.dynamicDataSource&&(h.query={layer:JSON.stringify({source:e.dynamicDataSource})}));const p="datesInUnknownTimezone"in this.layer&&this.layer.datesInUnknownTimezone,c=("subtypeField"in this.layer?this.layer.subtypeField:null)??null,{mode:y,featureCount:g}=await this._detectQueryMode(h);let f=this.layer.objectIdField;if("feature"===this.layer.type&&null!=this.layer.orderBy&&this.layer.orderBy.length){const e=!this.layer.orderBy[0].valueExpression&&this.layer.orderBy[0].field;e&&(f=e)}return{type:y,timeReferenceUnknownClient:p,subtypeField:c,featureCount:g,globalIdField:d,maxRecordCount:r.query.maxRecordCount,tileMaxRecordCount:r.query.tileMaxRecordCount,capabilities:r,effectiveCapabilities:t,fields:s,fullExtent:a,geometryType:o,objectIdField:i,source:h,timeInfo:l,spatialReference:u,orderByFields:f,datesInUnknownTimezone:p,dateFieldsTimeReference:("dateFieldsTimeReference"in this.layer?this.layer.dateFieldsTimeReference?.toJSON():null)||null,preferredTimeReference:("preferredTimeReference"in this.layer?this.layer.preferredTimeReference?.toJSON():null)||null,editFieldsInfo:"editFieldsInfo"in this.layer?this.layer.editFieldsInfo?.toJSON():null}}async _createMemoryServiceOptions(e){const t=await e.openPorts();return{...this._createServiceOptions(),type:"memory",source:t}}_cleanUpQuery(e){const t=w.from(e)||this.createQuery();return t.outSpatialReference||(t.outSpatialReference=this.view.spatialReference),t}_cleanUpAggregateQuery(e){const t=w.from(e)||this.createAggregateQuery();return t.outSpatialReference||(t.outSpatialReference=this.view.spatialReference),t}async _update(){return this._commandsQueue.push({type:"update"})}async _edit(e){if(this.suspended)return void this._clearTiles();return this._validateEdit(e)?this._commandsQueue.push({type:"edit",edits:e}):void 0}async doRefresh(e){if(this.attached&&this._tileStrategy.tileKeys().length)return this.suspended&&e?void this._clearTiles():this._commandsQueue.push({type:"refresh",dataChanged:e})}_clearTiles(){this._tileStrategy.tileKeys().length&&(this._proxy.updateTiles({added:[],removed:this._tileStrategy.tileKeys()}),this._tileStrategy.clear(),this.requestUpdate(),this._commandsQueue.clear(),this._update())}_validateEdit(e){const t="globalIdField"in this.layer&&this.layer.globalIdField,r=e.deletedFeatures.some((e=>-1===e.objectId||!e.objectId)),i=t&&this.availableFields.includes(t);return r&&!i?(o.getLogger(this).error(new a("mapview-apply-edits",`Editing the specified service requires the layer's globalIdField, ${t} to be included the layer's outFields for updates to be reflected on the map`)),null):e}async _doUpdate(){try{if(this.destroyed||!this._hasRequiredSupport(this.layer)||!this._tileStrategy)return;const{featureEffectView:t,filter:r}=this;if(await this._updateRequiredFields(),this.destroyed)return;const{renderer:i}=this._getEffectiveRenderer();this._set("_effectiveRenderer",i);const s=this._createSchemaConfig(),a=this._createConfiguration(s,r,t.filter),n=this._lastDefinitionExpression!==a.schema.source.definitionExpression;this._lastDefinitionExpression=a.schema.source.definitionExpression;const l=a.schema.tileRenderer,u=this._createTileRendererHash(l);if("snapshot"===this._serviceOptions.type&&(a.schema.source.initialFeatureCount=this._serviceOptions.featureCount),u!==this._tileRendererHash){this._initTileRenderer(l,i);const e=this.layer,t="stream"===e.type?await this._initServiceOptions():this._serviceOptions;this.tileRenderer.onConfigUpdate(i),"stream"!==e.type&&z(e.source)&&(t.source=await e.source.openPorts());const r={added:this._tileStrategy.tileKeys(),removed:[]};has("esri-2d-update-debug")&&console.debug("FeatureLayerView2D: Proxy startup"),await this._proxy.startup(this.view.featuresTilingScheme,a,t,r),has("esri-2d-update-debug")&&console.debug("FeatureLayerView2D: Finished proxy startup"),this.hasHighlight()&&(has("esri-2d-update-debug")&&console.debug("FeatureLayerView2D: Updating highlight"),await this._proxy.setHighlight(Array.from(this._highlightIds.keys())),has("esri-2d-update-debug")&&console.debug("FeatureLayerView2D: Finished highlight update")),has("esri-2d-update-debug")&&console.debug("FeatureLayerView2D: onConfigUpdate start"),this.tileRenderer.onConfigUpdate(i),has("esri-2d-update-debug")&&console.debug("FeatureLayerView2D: onConfigUpdate end")}else{"snapshot"===this._serviceOptions.type&&n&&(a.schema.source.changedFeatureCount=await this.layer.queryFeatureCount()),has("esri-2d-update-debug")&&console.debug("FeatureLayerView2D: Updating proxy");const t=await this._proxy.update(a);has("esri-2d-update-debug")&&console.debug("FeatureLayerView2D: Finished proxy update"),(t.mesh||t.targets?.aggregate)&&(has("esri-2d-update-debug")&&console.debug("FeatureLayerView2D: Locking GPU Uploads"),this._lockGPUUploads());try{has("esri-2d-update-debug")&&console.debug("FeatureLayerView2D: Applying update to proxy"),await this._proxy.applyUpdate(t),has("esri-2d-update-debug")&&console.debug("FeatureLayerView2D: Finished applying update to proxy")}catch(e){p(e)||o.getLogger(this).error(e)}(t.mesh||t.targets?.aggregate)&&this._unlockGPUUploads(),this.tileRenderer.onConfigUpdate(i),this._updateClusterSizeVariable(),this._forceAttributeTextureUpload()}this._tileRendererHash=u,this.tileRenderer.invalidateLabels(),this.requestUpdate()}catch(e){}}async _doEdit(e){try{await this._proxy.onEdits(e)}catch(t){p(t),0}}async _doRefresh(e){this._lockGPUUploads();try{let t;e&&"snapshot"===this.queryMode&&"queryFeatureCount"in this.layer&&(t=await this.layer.queryFeatureCount()),await this._proxy.refresh({dataChanged:e,featureCount:t})}catch(t){p(t),0}this._unlockGPUUploads(),this._effectiveFeatureReduction&&this._updateClusterSizeVariable()}_updateClusterSizeVariable(){this._needsClusterSizeUpdate&&(this.tileRenderer.onConfigUpdate(this._effectiveRenderer),this._needsClusterSizeUpdate=!1)}_createUpdateClusterSizeTask(e,t){return c((()=>this._aggregateValueRanges),(r=>{this._updateClusterEffectiveRendererSizeVariable(e,t,r),this._needsClusterSizeUpdate=!0,this._uploadsLocked||this._updateClusterSizeVariable()}))}async _updateClusterEffectiveRendererSizeVariable(e,t,r){if(e.dynamicClusterSize&&"visualVariables"in e&&e.visualVariables){const i=I(e.visualVariables);if(null!=i&&"cluster_count"===i.field){const s=e.visualVariables.indexOf(i);e.visualVariables[s]=O(t,r);const a=e.clone();a.dynamicClusterSize=!0,this._set("_effectiveRenderer",a)}}}_getEffectiveRenderer(){const e=this.layer,t="renderer"in e?e.renderer:null,r=this._effectiveFeatureReduction;if(this._updateClusterSizeTask=d(this._updateClusterSizeTask),r&&"renderer"in r&&r.renderer&&!r.renderer.authoringInfo?.isAutoGenerated){const e=r.fields;if("cluster"===r.type){const{renderer:t,didInject:i}=V(r.renderer,r,this._aggregateValueRanges);return i&&(this._updateClusterSizeTask=this._createUpdateClusterSizeTask(t,r)),{renderer:t,aggregateFields:e,featureReduction:r}}return{renderer:r.renderer,aggregateFields:e,featureReduction:r}}if(r&&"cluster"===r.type&&t&&E(t)){const e=r,i=[],s=T(i,t,e,this._aggregateValueRanges,!0);return this._updateClusterSizeTask=this._createUpdateClusterSizeTask(s,e),{renderer:s,aggregateFields:i,featureReduction:r}}return{renderer:t,aggregateFields:[],featureReduction:null}}_acquireTile(e){const t=this.tileRenderer.acquireTile(e);return t.once("attach",(()=>{this.requestUpdate()})),t}_releaseTile(e){this.tileRenderer.releaseTile(e)}_initTileRenderer(e,t){const r=C(e,{layerView:this,tileInfoView:this.view.featuresTilingScheme,layer:this.layer});return this.tileRenderer&&(this._tileStrategy.clear(),this.tileRenderer.uninstall(this.container),this.tileRenderer=u(this.tileRenderer)),this.destroyed?null:(this._proxy.tileRenderer=r,this._set("tileRenderer",r),this.tileRenderer.install(this.container),this.tileRenderer.onConfigUpdate(t),this.requestUpdate(),this.tileRenderer)}_createTileRendererHash(e){return`${e.type}`}get hasFilter(){const e=!!("floorInfo"in this.layer&&this.layer.floorInfo&&this.view.floors&&this.view.floors.length);return!!this.filter||e||!!this._visibilityOverrides.size||!!this.timeExtent}_injectOverrides(e){const t=null!=e?e.timeExtent:null,r=null!=this.timeExtent&&null!=t?this.timeExtent.intersection(t):this.timeExtent||t;let i=null;const s="floorInfo"in this.layer&&this.layer.floorInfo;if(s){const t=null!=e?e.where:null;i=this._addFloorFilterClause(t)}if(!this._visibilityOverrides.size&&!r&&!s)return null!=e?e.toJSON():null;(e=null!=e&&e.clone()||new v).timeExtent=r,i&&(e.where=i);const a=e.toJSON();return a.hiddenIds=Array.from(this._visibilityOverrides),a}_addFloorFilterClause(e){const t=this.layer;let r=e||"";if("floorInfo"in t&&t.floorInfo){let e=this.view.floors;if(!e||!e.length)return r;t.floorInfo.viewAllLevelIds?.length&&(e=t.floorInfo.viewAllLevelIds);const i=e.filter((e=>""!==e)).map((e=>"'"+e+"'"));i.push("''");const s=t.floorInfo.floorField;let a="("+s+" IN ({ids}) OR "+s+" IS NULL)";if(a=a.replace("{ids}",i.join(", ")),null!=r&&r.includes(s)){let e=new RegExp("AND \\("+s+".*NULL\\)","g");r=r.replace(e,""),e=new RegExp("\\("+s+".*NULL\\)","g"),r=r.replace(e,""),r=r.replaceAll(/\s+/g," ").trim()}r=""!==r?"("+r+") AND "+a:a}return""!==r?r:null}_createConfiguration(e,t,r){const i="feature"===this.layer.type&&this.layer.historicMoment?this.layer.historicMoment.getTime():void 0,s="feature"===this.layer.type?this.layer.gdbVersion??void 0:void 0,a=new Array(x),n=this._injectOverrides(t);a[0]=n,a[1]=null!=r?r.toJSON():null;const o=U(e);if(null==o)return null;const l=P("2d");return{availableFields:this.availableFields,gdbVersion:s,historicMoment:i,devicePixelRatio:window.devicePixelRatio||1,filters:a,schema:o,supportsTextureFloat:l.supportsTextureFloat,maxTextureSize:l.maxTextureSize}}_hasRequiredSupport(e){return!("renderer"in e)||q(e.renderer)}_lockGPUUploads(){this.tileRenderer&&(this._uploadsLocked=!0,this.tileRenderer.lockGPUUploads())}_unlockGPUUploads(){this.tileRenderer&&(this._uploadsLocked=!1,this.tileRenderer.unlockGPUUploads())}_forceAttributeTextureUpload(){this.tileRenderer&&this.tileRenderer.forceAttributeTextureUpload()}_createSchemaConfig(){const e=this.layer;return{renderer:"renderer"in e?e.renderer:null,spatialReference:e.spatialReference,timeExtent:"timeExtent"in e?e.timeExtent:null,definitionExpression:e.definitionExpression,featureReduction:this._effectiveFeatureReduction,fields:e.fields,geometryType:e.geometryType,historicMoment:"historicMoment"in e?e.historicMoment:null,labelsVisible:"labelsVisible"in e&&e.labelsVisible,labelingInfo:"labelingInfo"in e?e.labelingInfo:null,availableFields:this.availableFields,featureEffect:this.featureEffect,filter:this.filter,gdbVersion:"gdbVersion"in e?e.gdbVersion:null,pixelBuffer:0,orderBy:"orderBy"in e&&e.orderBy?e.orderBy:null,customParameters:{..."customParameters"in e?e.customParameters:void 0,token:"apiKey"in e?e.apiKey??void 0:void 0},subtypeCode:"subtypeCode"in e?e.subtypeCode:void 0,subtypeField:"subtypeField"in e?e.subtypeField:void 0}}_addHighlight(e){for(const t of e)if(this._highlightIds.has(t)){const e=this._highlightIds.get(t);this._highlightIds.set(t,e+1)}else this._highlightIds.set(t,1);this._updateHighlight().catch((e=>{p(e)||o.getLogger(this).error(e)}))}_removeHighlight(e){for(const t of e)if(this._highlightIds.has(t)){const e=this._highlightIds.get(t)-1;0===e?this._highlightIds.delete(t):this._highlightIds.set(t,e)}this._updateHighlight().catch((e=>{p(e)||o.getLogger(this).error(e)}))}_setLayersForFeature(e){const t=this.layer;e.layer=t,e.sourceLayer=t}_createGraphicHit(e,t){return this._setLayersForFeature(t),null!=t.geometry&&(t.geometry.spatialReference=this.view.spatialReference),{type:"graphic",graphic:t,layer:this.layer,mapPoint:e}}};e([f()],D.prototype,"_serviceOptions",void 0),e([f()],D.prototype,"_proxy",void 0),e([f()],D.prototype,"_pipelineIsUpdating",void 0),e([f()],D.prototype,"_effectiveRenderer",void 0),e([f()],D.prototype,"_effectiveFeatureReduction",null),e([f()],D.prototype,"_aggregateValueRanges",void 0),e([f()],D.prototype,"_commandsQueue",void 0),e([f()],D.prototype,"featureEffectView",void 0),e([f()],D.prototype,"labelsVisible",null),e([f({readOnly:!0})],D.prototype,"queryMode",null),e([f()],D.prototype,"renderingConfigHash",null),e([f()],D.prototype,"tileRenderer",void 0),e([f()],D.prototype,"updating",void 0),D=e([m("esri.views.2d.layers.FeatureLayerView2D")],D);const M=D;export{M as default};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../AggregateGraphic.js";import"../../../geometry.js";import r from"../../../Graphic.js";import{isSome as i}from"../../../core/arrayUtils.js";import s from"../../../core/Collection.js";import a from"../../../core/Error.js";import has from"../../../core/has.js";import{clone as n}from"../../../core/lang.js";import o from"../../../core/Logger.js";import{applySome as l,destroyMaybe as u,removeMaybe as d}from"../../../core/maybe.js";import{debounce as h,isAbortError as p}from"../../../core/promiseUtils.js";import{watch as c,syncAndInitial as y,initial as g}from"../../../core/reactiveUtils.js";import{property as f}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as m}from"../../../core/accessorSupport/decorators/subclass.js";import _ from"../../../layers/effects/FeatureEffectView.js";import v from"../../../layers/support/FeatureFilter.js";import{getEffectiveLayerCapabilities as b}from"../../../layers/support/layerUtils.js";import R from"../../../rest/support/AggregateFeatureSet.js";import w from"../../../rest/support/FeatureSet.js";import S from"../../../rest/support/Query.js";import{MAX_FILTERS as x}from"../engine/webgl/definitions.js";import{LayerView2DMixin as F}from"./LayerView2D.js";import{createSchema as U}from"./features/schemaUtils.js";import{createOrReuseTileRenderer as C}from"./features/tileRenderers.js";import{isRendererSupported as q}from"./features/support/rendererUtils.js";import{findSizeVV as I,createClusterCountSizeVariable as O,injectDynamicLevelDependentSizeVisualVariable as V,isClusterCompatibleRenderer as E,createClusterRenderer as T}from"./support/clusterUtils.js";import j from"./support/FeatureCommandQueue.js";import A from"./support/FeatureLayerProxy.js";import{toJSONGeometryType as L}from"./support/util.js";import{TileManager as N}from"../tiling/TileManager.js";import Q from"../../layers/FeatureLayerView.js";import k from"../../layers/LayerView.js";import H from"../../layers/RefreshableLayerView.js";import{getWebGLCapabilities as P}from"../../webgl/capabilities.js";import J from"../../../geometry/Extent.js";function z(e){return e&&"openPorts"in e}let D=class extends(Q(H(F(k)))){constructor(){super(...arguments),this._pipelineIsUpdating=!0,this._commandsQueue=new j({process:e=>{switch(e.type){case"processed-edit":return this._doEdit(e);case"refresh":return this._doRefresh(e.dataChanged);case"update":return this._doUpdate()}}}),this._visibilityOverrides=new Set,this._highlightIds=new Map,this._updateHighlight=h((async()=>this._proxy.setHighlight(Array.from(this._highlightIds.keys())))),this._uploadsLocked=!1,this._needsClusterSizeUpdate=!1,this.featureEffectView=new _,this._lastDefinitionExpression=null}destroy(){l(this._updateClusterSizeTask,(e=>e.remove())),this._proxy?.destroy(),this._commandsQueue.destroy()}initialize(){this.addResolvingPromise(Promise.all([this._initProxy(),this._initServiceOptions()])),this.addHandles([this.on("valueRangesChanged",(e=>{this._set("_aggregateValueRanges",e.valueRanges)})),c((()=>this.featureEffect),(e=>{this.featureEffectView.featureEffect=e}),y)],"constructor"),this.featureEffectView.endTransitions()}async _initProxy(){const e=this.layer;if("isTable"in e&&e.isTable)throw new a("featurelayerview:table-not-supported","table feature layer can't be displayed",{layer:this.layer});if(("feature"===e.type||"subtype-group"===e.type)&&!b(e)?.operations.supportsQuery)throw new a("featurelayerview:query-not-supported","layer view requires a layer with query capability",{layer:e});this._proxy&&this._proxy.destroy();const t=this._createClientOptions();return this._set("_proxy",new A({client:t})),this._proxy.when()}async _initServiceOptions(){return this._set("_serviceOptions",await this._createServiceOptions()),this._serviceOptions}get _effectiveFeatureReduction(){if(!("featureReduction"in this.layer))return null;const e=this.layer.featureReduction;return e&&(!("maxScale"in e)||!e.maxScale||e.maxScale<this.view.scale)?e:null}get orderByFields(){return"stream"!==this._serviceOptions?.type?this._serviceOptions?.orderByFields:void 0}get labelsVisible(){const e="subtype-group"===this.layer.type?this.layer.sublayers.items:[this.layer];return!this.suspended&&e.some((e=>e.labelingInfo&&e.labelsVisible))}get queryMode(){return this._serviceOptions?.type}get renderingConfigHash(){if(!this.layer)return null;const e=this.availableFields,t=this.layer,r=this.view.floors,{definitionExpression:i}=t,s="subtype-group"!==this.layer.type&&this.layer.labelsVisible&&this.layer.labelingInfo,a="renderer"in t&&t.renderer,n="gdbVersion"in t?t.gdbVersion:void 0,o="historicMoment"in t?t.historicMoment?.getTime():void 0,{timeExtent:l}=this,u="customParameters"in t?JSON.stringify(t.customParameters):void 0,d="apiKey"in t?t.apiKey:void 0,h="stream"===t.type?`${JSON.stringify(t.geometryDefinition)}${t.definitionExpression}`:null,p=JSON.stringify(this.clips),c=this._effectiveFeatureReduction?.toJSON(),y="orderBy"in this.layer&&JSON.stringify(this.layer.orderBy),g="sublayers"in this.layer&&this.layer.sublayers.items.reduce(((e,t)=>e+`${t.visible?1:0}.${JSON.stringify(t.renderer)}.${t.labelsVisible}\n.${JSON.stringify(t.labelingInfo)}`),""),f="subtypeCode"in this.layer&&this.layer.subtypeCode;return JSON.stringify({orderBy:y,sublayerHash:g,subtypeCode:f,filterHash:null!=this.filter&&this.filter.toJSON(),effectHash:null!=this.featureEffect&&this.featureEffect.toJSON(),streamFilter:h,gdbVersion:n,definitionExpression:i,historicMoment:o,availableFields:e,renderer:a,labelingInfo:s,timeExtent:l,floors:r,clipsHash:p,featureReduction:c,customParameters:u,apiKey:d})}highlight(e){let t;e instanceof r?t=[e.getObjectId()]:"number"==typeof e||"string"==typeof e?t=[e]:s.isCollection(e)&&e.length>0?t=e.map((e=>e?.getObjectId())).toArray():Array.isArray(e)&&e.length>0&&(t="number"==typeof e[0]||"string"==typeof e[0]?e:e.map((e=>e?.getObjectId())));const a=t?.filter(i);return a&&a.length?(this._addHighlight(a),{remove:()=>this._removeHighlight(a)}):{remove:()=>{}}}hasHighlight(){return!!this._highlightIds.size}async hitTest(e,i){if(!this.tileRenderer)return null;const s=await this.tileRenderer.hitTest(i);if(0===s.length)return null;has("featurelayer-force-marker-text-draw-order")&&s.sort(((e,t)=>e-t));const{features:a,aggregates:n}=await this._proxy.getFeatures(s);return[...n.map((r=>this._createGraphicHit(e,t.fromJSON(r)))),...a.map((t=>this._createGraphicHit(e,r.fromJSON(t))))]}queryStatistics(){return this._proxy.queryStatistics()}async querySummaryStatistics(e,t,r){const i={...t,scale:this.view.scale};return this._proxy.querySummaryStatistics(this._cleanUpQuery(e),i,r)}async queryAggregateSummaryStatistics(e,t,r){const i={...t,scale:this.view.scale};return this._proxy.queryAggregateSummaryStatistics(this._cleanUpAggregateQuery(e),i,r)}async queryUniqueValues(e,t,r){const i={...t,scale:this.view.scale};return this._proxy.queryUniqueValues(this._cleanUpQuery(e),i,r)}async queryAggregateUniqueValues(e,t,r){const i={...t,scale:this.view.scale};return this._proxy.queryAggregateUniqueValues(this._cleanUpAggregateQuery(e),i,r)}async queryClassBreaks(e,t,r){const i={...t,scale:this.view.scale};return this._proxy.queryClassBreaks(this._cleanUpQuery(e),i,r)}async queryAggregateClassBreaks(e,t,r){const i={...t,scale:this.view.scale};return this._proxy.queryAggregateClassBreaks(this._cleanUpAggregateQuery(e),i,r)}async queryHistogram(e,t,r){const i={...t,scale:this.view.scale};return this._proxy.queryHistogram(this._cleanUpQuery(e),i,r)}async queryAggregateHistogram(e,t,r){const i={...t,scale:this.view.scale};return this._proxy.queryAggregateHistogram(this._cleanUpAggregateQuery(e),i,r)}queryFeatures(e,t){return this.queryFeaturesJSON(e,t).then((e=>{const t=w.fromJSON(e);return t.features.forEach((e=>this._setLayersForFeature(e))),t}))}queryVisibleFeatures(e,t){return this._proxy.queryVisibleFeatures(this._cleanUpQuery(e),t).then((e=>{const t=w.fromJSON(e);return t.features.forEach((e=>this._setLayersForFeature(e))),t}))}async queryAggregates(e,t){const r=await this._proxy.queryAggregates(this._cleanUpAggregateQuery(e),t),i=R.fromJSON(r);return i.features.forEach((e=>this._setLayersForFeature(e))),i}queryAggregateIds(e,t){return this._proxy.queryAggregateIds(this._cleanUpAggregateQuery(e),t)}queryAggregateCount(e,t){return this._proxy.queryAggregateCount(this._cleanUpAggregateQuery(e),t)}queryAggregateJSON(e,t){return this._proxy.queryAggregates(this._cleanUpAggregateQuery(e),t)}queryFeaturesJSON(e,t){return this._proxy.queryFeatures(this._cleanUpQuery(e),t)}queryObjectIds(e,t){return this._proxy.queryObjectIds(this._cleanUpQuery(e),t)}queryFeatureCount(e,t){return this._proxy.queryFeatureCount(this._cleanUpQuery(e),t)}queryExtent(e,t){return this._proxy.queryExtent(this._cleanUpQuery(e),t).then((e=>({count:e.count,extent:J.fromJSON(e.extent)})))}setVisibility(e,t){t?this._visibilityOverrides.delete(e):this._visibilityOverrides.add(e),this._update()}update(e){if(!this._tileStrategy||!this.tileRenderer)return;const{hasMissingTiles:t,added:r,removed:i}=this._tileStrategy.update(e);(r.length||i.length)&&this._proxy.updateTiles({added:r,removed:i}),t&&this.requestUpdate(),this.notifyChange("updating")}attach(){this.view.timeline.record(`${this.layer.title} (FeatureLayer) Attach`),this._tileStrategy=new N({acquireTile:e=>this._acquireTile(e),releaseTile:e=>this._releaseTile(e),tileInfoView:this.view.featuresTilingScheme,buffer:0}),this.addAttachHandles(c((()=>this.renderingConfigHash),(()=>this._update()),g)),"stream"!==this.layer.type&&this.addAttachHandles(this.layer.on("edits",(e=>this._edit(e))))}detach(){this._commandsQueue.clear(),this._proxy?.stop(),this.container.removeAllChildren(),this.tileRenderer?.uninstall(this.container),this.tileRenderer=null,this._tileStrategy=u(this._tileStrategy),this._tileRendererHash=null}moveStart(){this.requestUpdate()}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}isUpdating(){const e="renderer"in this.layer&&null!=this.layer.renderer,t=this._commandsQueue.updating,r=null!=this._updatingRequiredFieldsPromise,i=!this._proxy||!this._proxy.isReady,s=this._pipelineIsUpdating,a=null==this.tileRenderer||this.tileRenderer?.updating,n=e&&(t||r||i||s||a);return has("esri-2d-log-updating")&&console.log(`Updating FLV2D (${this.layer.id}): ${n}\n -> hasRenderer ${e}\n -> hasPendingCommand ${t}\n -> updatingRequiredFields ${r}\n -> updatingProxy ${i}\n -> updatingPipeline ${s}\n -> updatingTileRenderer ${a}\n`),n}_createClientOptions(){return{setUpdating:e=>{this._set("_pipelineIsUpdating",e)},emitEvent:e=>{this.emit(e.name,e.event)}}}async _detectQueryMode(e){const t="path"in e,{layer:r}=this,i="editingInfo"in r&&r.editingInfo?.lastEditDate,s="refreshInterval"in r&&!!r.refreshInterval,a=!i&&s,n=b(r);if(t&&("feature"===r.type||"subtype-group"===r.type)&&"point"===r.geometryType&&n?.query.supportsPagination&&!n?.operations.supportsEditing&&!a&&has("featurelayer-snapshot-enabled"))try{const e=await r.queryFeatureCount();if(e<=has("featurelayer-snapshot-point-min-threshold"))return{mode:"snapshot",featureCount:e};const t=has("featurelayer-snapshot-point-max-threshold"),i=has("featurelayer-snapshot-point-coverage"),s=this.view.extent,a=r.fullExtent,n=a?.clone().intersection(s),o=null!=n?n.width*n.height:0,l=a?.width*a?.height;if(e<=t&&(0===l?0:o/l)>=i)return{mode:"snapshot",featureCount:e}}catch(l){o.getLogger(this).warn("mapview-feature-layer","Encountered an error when querying for featureCount",{error:l})}return{mode:"on-demand"}}async _createServiceOptions(){const e=this.layer;if("stream"===e.type)return null;const t=b(e),{capabilities:r,objectIdField:i}=e,s=e.fields.map((e=>e.toJSON())),a=null!=e.fullExtent?e.fullExtent.toJSON():null,o=L(e.geometryType),l="timeInfo"in e&&e.timeInfo&&e.timeInfo.toJSON()||null,u=e.spatialReference?e.spatialReference.toJSON():null,d="feature"===e.type?e.globalIdField:null;let h;"ogc-feature"===e.type?h=e.source.getSource():z(e.source)?h=await e.source.openPorts():e.parsedUrl&&(h=n(e.parsedUrl),"dynamicDataSource"in e&&e.dynamicDataSource&&(h.query={layer:JSON.stringify({source:e.dynamicDataSource})}));const p="datesInUnknownTimezone"in this.layer&&this.layer.datesInUnknownTimezone,c=("subtypeField"in this.layer?this.layer.subtypeField:null)??null,{mode:y,featureCount:g}=await this._detectQueryMode(h);let f=this.layer.objectIdField;if("feature"===this.layer.type&&null!=this.layer.orderBy&&this.layer.orderBy.length){const e=!this.layer.orderBy[0].valueExpression&&this.layer.orderBy[0].field;e&&(f=e)}return{type:y,timeReferenceUnknownClient:p,subtypeField:c,featureCount:g,globalIdField:d,maxRecordCount:r.query.maxRecordCount,tileMaxRecordCount:r.query.tileMaxRecordCount,capabilities:r,effectiveCapabilities:t,fields:s,fullExtent:a,geometryType:o,objectIdField:i,source:h,timeInfo:l,spatialReference:u,orderByFields:f,datesInUnknownTimezone:p,dateFieldsTimeReference:("dateFieldsTimeReference"in this.layer?this.layer.dateFieldsTimeReference?.toJSON():null)||null,preferredTimeReference:("preferredTimeReference"in this.layer?this.layer.preferredTimeReference?.toJSON():null)||null,editFieldsInfo:"editFieldsInfo"in this.layer?this.layer.editFieldsInfo?.toJSON():null}}async _createMemoryServiceOptions(e){const t=await e.openPorts();return{...this._createServiceOptions(),type:"memory",source:t}}_cleanUpQuery(e){const t=S.from(e)||this.createQuery();return t.outSpatialReference||(t.outSpatialReference=this.view.spatialReference),t}_cleanUpAggregateQuery(e){const t=S.from(e)||this.createAggregateQuery();return t.outSpatialReference||(t.outSpatialReference=this.view.spatialReference),t}async _update(){return this._commandsQueue.push({type:"update"})}async _edit(e){if(this.suspended)return void this._clearTiles();return this._validateEdit(e)?this._commandsQueue.push({type:"edit",edits:e}):void 0}async doRefresh(e){if(this.attached&&this._tileStrategy.tileKeys().length)return this.suspended&&e?void this._clearTiles():this._commandsQueue.push({type:"refresh",dataChanged:e})}_clearTiles(){this._tileStrategy.tileKeys().length&&(this._proxy.updateTiles({added:[],removed:this._tileStrategy.tileKeys()}),this._tileStrategy.clear(),this.requestUpdate(),this._commandsQueue.clear(),this._update())}_validateEdit(e){const t="globalIdField"in this.layer&&this.layer.globalIdField,r=e.deletedFeatures.some((e=>-1===e.objectId||!e.objectId)),i=t&&this.availableFields.includes(t);return r&&!i?(o.getLogger(this).error(new a("mapview-apply-edits",`Editing the specified service requires the layer's globalIdField, ${t} to be included the layer's outFields for updates to be reflected on the map`)),null):e}async _doUpdate(){try{if(this.destroyed||!this._hasRequiredSupport(this.layer)||!this._tileStrategy)return;const{featureEffectView:t,filter:r}=this;if(await this._updateRequiredFields(),this.destroyed)return;const{renderer:i}=this._getEffectiveRenderer();this._set("_effectiveRenderer",i);const s=this._createSchemaConfig(),a=this._createConfiguration(s,r,t.filter),n=this._lastDefinitionExpression!==a.schema.source.definitionExpression;this._lastDefinitionExpression=a.schema.source.definitionExpression;const l=a.schema.tileRenderer,u=this._createTileRendererHash(l);if("snapshot"===this._serviceOptions.type&&(a.schema.source.initialFeatureCount=this._serviceOptions.featureCount),u!==this._tileRendererHash){this._initTileRenderer(l,i);const e=this.layer,t="stream"===e.type?await this._initServiceOptions():this._serviceOptions;this.tileRenderer.onConfigUpdate(i),"stream"!==e.type&&z(e.source)&&(t.source=await e.source.openPorts());const r={added:this._tileStrategy.tileKeys(),removed:[]};has("esri-2d-update-debug")&&console.debug("FeatureLayerView2D: Proxy startup"),await this._proxy.startup(this.view.featuresTilingScheme,a,t,r),has("esri-2d-update-debug")&&console.debug("FeatureLayerView2D: Finished proxy startup"),this.hasHighlight()&&(has("esri-2d-update-debug")&&console.debug("FeatureLayerView2D: Updating highlight"),await this._proxy.setHighlight(Array.from(this._highlightIds.keys())),has("esri-2d-update-debug")&&console.debug("FeatureLayerView2D: Finished highlight update")),has("esri-2d-update-debug")&&console.debug("FeatureLayerView2D: onConfigUpdate start"),this.tileRenderer.onConfigUpdate(i),has("esri-2d-update-debug")&&console.debug("FeatureLayerView2D: onConfigUpdate end")}else{"snapshot"===this._serviceOptions.type&&n&&(a.schema.source.changedFeatureCount=await this.layer.queryFeatureCount()),has("esri-2d-update-debug")&&console.debug("FeatureLayerView2D: Updating proxy");const t=await this._proxy.update(a);has("esri-2d-update-debug")&&console.debug("FeatureLayerView2D: Finished proxy update"),(t.mesh||t.targets?.aggregate)&&(has("esri-2d-update-debug")&&console.debug("FeatureLayerView2D: Locking GPU Uploads"),this._lockGPUUploads());try{has("esri-2d-update-debug")&&console.debug("FeatureLayerView2D: Applying update to proxy"),await this._proxy.applyUpdate(t),has("esri-2d-update-debug")&&console.debug("FeatureLayerView2D: Finished applying update to proxy")}catch(e){p(e)||o.getLogger(this).error(e)}(t.mesh||t.targets?.aggregate)&&this._unlockGPUUploads(),this.tileRenderer.onConfigUpdate(i),this._updateClusterSizeVariable(),this._forceAttributeTextureUpload()}this._tileRendererHash=u,this.tileRenderer.invalidateLabels(),this.requestUpdate()}catch(e){}}async _doEdit(e){try{await this._proxy.onEdits(e)}catch(t){p(t),0}}async _doRefresh(e){this._lockGPUUploads();try{let t;e&&"snapshot"===this.queryMode&&"queryFeatureCount"in this.layer&&(t=await this.layer.queryFeatureCount()),await this._proxy.refresh({dataChanged:e,featureCount:t})}catch(t){p(t),0}this._unlockGPUUploads(),this._effectiveFeatureReduction&&this._updateClusterSizeVariable()}_updateClusterSizeVariable(){this._needsClusterSizeUpdate&&(this.tileRenderer.onConfigUpdate(this._effectiveRenderer),this._needsClusterSizeUpdate=!1)}_createUpdateClusterSizeTask(e,t){return c((()=>this._aggregateValueRanges),(r=>{this._updateClusterEffectiveRendererSizeVariable(e,t,r),this._needsClusterSizeUpdate=!0,this._uploadsLocked||this._updateClusterSizeVariable()}))}async _updateClusterEffectiveRendererSizeVariable(e,t,r){if(e.dynamicClusterSize&&"visualVariables"in e&&e.visualVariables){const i=I(e.visualVariables);if(null!=i&&"cluster_count"===i.field){const s=e.visualVariables.indexOf(i);e.visualVariables[s]=O(t,r);const a=e.clone();a.dynamicClusterSize=!0,this._set("_effectiveRenderer",a)}}}_getEffectiveRenderer(){const e=this.layer,t="renderer"in e?e.renderer:null,r=this._effectiveFeatureReduction;if(this._updateClusterSizeTask=d(this._updateClusterSizeTask),r&&"renderer"in r&&r.renderer&&!r.renderer.authoringInfo?.isAutoGenerated){const e=r.fields;if("cluster"===r.type){const{renderer:t,didInject:i}=V(r.renderer,r,this._aggregateValueRanges);return i&&(this._updateClusterSizeTask=this._createUpdateClusterSizeTask(t,r)),{renderer:t,aggregateFields:e,featureReduction:r}}return{renderer:r.renderer,aggregateFields:e,featureReduction:r}}if(r&&"cluster"===r.type&&t&&E(t)){const e=r,i=[],s=T(i,t,e,this._aggregateValueRanges,!0);return this._updateClusterSizeTask=this._createUpdateClusterSizeTask(s,e),{renderer:s,aggregateFields:i,featureReduction:r}}return{renderer:t,aggregateFields:[],featureReduction:null}}_acquireTile(e){const t=this.tileRenderer.acquireTile(e);return t.once("attach",(()=>{this.requestUpdate()})),t}_releaseTile(e){this.tileRenderer.releaseTile(e)}_initTileRenderer(e,t){const r=C(e,{layerView:this,tileInfoView:this.view.featuresTilingScheme,layer:this.layer});return this.tileRenderer&&(this._tileStrategy.clear(),this.tileRenderer.uninstall(this.container),this.tileRenderer=u(this.tileRenderer)),this.destroyed?null:(this._proxy.tileRenderer=r,this._set("tileRenderer",r),this.tileRenderer.install(this.container),this.tileRenderer.onConfigUpdate(t),this.requestUpdate(),this.tileRenderer)}_createTileRendererHash(e){return`${e.type}`}get hasFilter(){const e=!!("floorInfo"in this.layer&&this.layer.floorInfo&&this.view.floors&&this.view.floors.length);return!!this.filter||e||!!this._visibilityOverrides.size||!!this.timeExtent}_injectOverrides(e){const t=null!=e?e.timeExtent:null,r=null!=this.timeExtent&&null!=t?this.timeExtent.intersection(t):this.timeExtent||t;let i=null;const s="floorInfo"in this.layer&&this.layer.floorInfo;if(s){const t=null!=e?e.where:null;i=this._addFloorFilterClause(t)}if(!this._visibilityOverrides.size&&!r&&!s)return null!=e?e.toJSON():null;(e=null!=e&&e.clone()||new v).timeExtent=r,i&&(e.where=i);const a=e.toJSON();return a.hiddenIds=Array.from(this._visibilityOverrides),a}_addFloorFilterClause(e){const t=this.layer;let r=e||"";if("floorInfo"in t&&t.floorInfo){let e=this.view.floors;if(!e||!e.length)return r;t.floorInfo.viewAllLevelIds?.length&&(e=t.floorInfo.viewAllLevelIds);const i=e.filter((e=>""!==e)).map((e=>"'"+e+"'"));i.push("''");const s=t.floorInfo.floorField;let a="("+s+" IN ({ids}) OR "+s+" IS NULL)";if(a=a.replace("{ids}",i.join(", ")),null!=r&&r.includes(s)){let e=new RegExp("AND \\("+s+".*NULL\\)","g");r=r.replace(e,""),e=new RegExp("\\("+s+".*NULL\\)","g"),r=r.replace(e,""),r=r.replaceAll(/\s+/g," ").trim()}r=""!==r?"("+r+") AND "+a:a}return""!==r?r:null}_createConfiguration(e,t,r){const i="feature"===this.layer.type&&this.layer.historicMoment?this.layer.historicMoment.getTime():void 0,s="feature"===this.layer.type?this.layer.gdbVersion??void 0:void 0,a=new Array(x),n=this._injectOverrides(t);a[0]=n,a[1]=null!=r?r.toJSON():null;const o=U(e);if(null==o)return null;const l=P("2d");return{availableFields:this.availableFields,gdbVersion:s,historicMoment:i,devicePixelRatio:window.devicePixelRatio||1,filters:a,schema:o,supportsTextureFloat:l.supportsTextureFloat,maxTextureSize:l.maxTextureSize}}_hasRequiredSupport(e){return!("renderer"in e)||q(e.renderer)}_lockGPUUploads(){this.tileRenderer&&(this._uploadsLocked=!0,this.tileRenderer.lockGPUUploads())}_unlockGPUUploads(){this.tileRenderer&&(this._uploadsLocked=!1,this.tileRenderer.unlockGPUUploads())}_forceAttributeTextureUpload(){this.tileRenderer&&this.tileRenderer.forceAttributeTextureUpload()}_createSchemaConfig(){const e=this.layer;return{renderer:"renderer"in e?e.renderer:null,spatialReference:e.spatialReference,timeExtent:"timeExtent"in e?e.timeExtent:null,definitionExpression:e.definitionExpression,featureReduction:this._effectiveFeatureReduction,fields:e.fields,geometryType:e.geometryType,historicMoment:"historicMoment"in e?e.historicMoment:null,labelsVisible:"labelsVisible"in e&&e.labelsVisible,labelingInfo:"labelingInfo"in e?e.labelingInfo:null,availableFields:this.availableFields,featureEffect:this.featureEffect,filter:this.filter,gdbVersion:"gdbVersion"in e?e.gdbVersion:null,pixelBuffer:0,orderBy:"orderBy"in e&&e.orderBy?e.orderBy:null,customParameters:{..."customParameters"in e?e.customParameters:void 0,token:"apiKey"in e?e.apiKey??void 0:void 0},subtypeCode:"subtypeCode"in e?e.subtypeCode:void 0,subtypeField:"subtypeField"in e?e.subtypeField:void 0}}_addHighlight(e){for(const t of e)if(this._highlightIds.has(t)){const e=this._highlightIds.get(t);this._highlightIds.set(t,e+1)}else this._highlightIds.set(t,1);this._updateHighlight().catch((e=>{p(e)||o.getLogger(this).error(e)}))}_removeHighlight(e){for(const t of e)if(this._highlightIds.has(t)){const e=this._highlightIds.get(t)-1;0===e?this._highlightIds.delete(t):this._highlightIds.set(t,e)}this._updateHighlight().catch((e=>{p(e)||o.getLogger(this).error(e)}))}_setLayersForFeature(e){const t=this.layer;e.layer=t,e.sourceLayer=t}_createGraphicHit(e,t){return this._setLayersForFeature(t),null!=t.geometry&&(t.geometry.spatialReference=this.view.spatialReference),{type:"graphic",graphic:t,layer:this.layer,mapPoint:e}}};e([f()],D.prototype,"_serviceOptions",void 0),e([f()],D.prototype,"_proxy",void 0),e([f()],D.prototype,"_pipelineIsUpdating",void 0),e([f()],D.prototype,"_effectiveRenderer",void 0),e([f()],D.prototype,"_effectiveFeatureReduction",null),e([f()],D.prototype,"_aggregateValueRanges",void 0),e([f()],D.prototype,"_commandsQueue",void 0),e([f()],D.prototype,"featureEffectView",void 0),e([f()],D.prototype,"labelsVisible",null),e([f({readOnly:!0})],D.prototype,"queryMode",null),e([f()],D.prototype,"renderingConfigHash",null),e([f()],D.prototype,"tileRenderer",void 0),e([f()],D.prototype,"updating",void 0),D=e([m("esri.views.2d.layers.FeatureLayerView2D")],D);const M=D;export{M 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.27/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import"../../../geometry.js";import"../../../Graphic.js";import"../../../renderers/ClassBreaksRenderer.js";import"../../../renderers/DictionaryRenderer.js";import"../../../renderers/DotDensityRenderer.js";import"../../../renderers/HeatmapRenderer.js";import"../../../renderers/PieChartRenderer.js";import"../../../renderers/Renderer.js";import"../../../renderers/SimpleRenderer.js";import"../../../renderers/UniqueValueRenderer.js";import"../../../renderers/support/jsonUtils.js";import"../../../symbols.js";import t from"../../../core/Collection.js";import"../../../core/has.js";import r from"../../../core/Logger.js";import{getOrCreateMapValue as s}from"../../../core/MapUtils.js";import{isAbortError as i}from"../../../core/promiseUtils.js";import{on as n}from"../../../core/reactiveUtils.js";import{property as o}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import"../../../core/arrayUtils.js";import{subclass as l}from"../../../core/accessorSupport/decorators/subclass.js";import{create as a}from"../../../geometry/support/aaBoundingRect.js";import{ringsContainsCoords as m}from"../../../geometry/support/contains.js";import{extentIntersectsPolygon as p}from"../../../geometry/support/intersectsBase.js";import{MediaElementView as c}from"../../../layers/support/MediaElementView.js";import"../../../core/Error.js";import"../../../core/scheduling.js";import"../../../request.js";import"../../../chunks/index2.js";import"../../../core/urlUtils.js";import"../../../chunks/index3.js";import"../../../layers/effects/EffectView.js";import"../engine/DisplayObject.js";import"../engine/webgl/effects/highlight/HighlightGradient.js";import"../engine/webgl/BufferPool.js";import"../engine/webgl/enums.js";import"../engine/webgl/brushes/BrushBitmap.js";import"../../../chunks/vec4f32.js";import"../engine/webgl/Utils.js";import"../engine/webgl/shaders/BackgroundPrograms.js";import"../../webgl/enums.js";import"../../webgl/checkWebGLError.js";import"../../webgl/contextUtils.js";import"../../../chunks/builtins.js";import"../../../core/RandomLCG.js";import"../engine/webgl/materialKey/MaterialKey.js";import"../engine/webgl/techniques/Technique.js";import"../engine/webgl/techniques/dotDensity/TechniqueDotDensity.js";import"../engine/webgl/techniques/heatmap/TechniqueHeatmap.js";import"../engine/webgl/techniques/pieChart/TechniquePieChart.js";import"../../webgl/BufferObject.js";import"../../webgl/FramebufferObject.js";import"../../webgl/GLObjectType.js";import"../../webgl/Texture.js";import"../../webgl/VertexArrayObject.js";import"../engine/webgl/brushes/WGLBrushHeatmap.js";import"../engine/webgl/DefaultVertexAttributeLayouts.js";import"../engine/webgl/shaders/TileInfoPrograms.js";import"../engine/webgl/brushes/WGLGeometryBrushMarker.js";import"../../../core/mathUtils.js";import"../engine/webgl/number.js";import"../engine/vectorTiles/style/StyleDefinition.js";import"../../../chunks/vec2f32.js";import"../engine/vectorTiles/enums.js";import"../engine/vectorTiles/shaders/sources/resolver.js";import"../engine/webgl/shaders/BitBlitPrograms.js";import"../engine/webgl/shaders/sources/resolver.js";import"../engine/webgl/TextureManager.js";import"../engine/webgl/shaders/StencilPrograms.js";import"../engine/webgl/effects/BlendEffect.js";import"../engine/webgl/shaders/HighlightPrograms.js";import"../engine/webgl/Profiler.js";import"../../webgl/renderState.js";import"../../3d/webgl-engine/core/shaderModules/interfaces.js";import"../../../core/floatRGBA.js";import"../../3d/webgl-engine/lib/OrderIndependentTransparency.js";import"../LabelManager.js";import"./graphics/GraphicsView2D.js";import"../engine/webgl/AttributeStoreView.js";import"../../../chunks/earcut.js";import"../../../layers/graphics/featureConversionUtils.js";import"../../../core/unitUtils.js";import"../../../renderers/support/lengthUtils.js";import"../../../chunks/vec3f32.js";import"../../../geometry/support/normalizeUtils.js";import"../navigation/MapViewNavigation.js";import"../../../core/asyncUtils.js";import"../engine/webgl/shaders/MagnifierPrograms.js";import"../tiling/PagedTileQueue.js";import"../tiling/TileInfoView.js";import"../tiling/TileKey.js";import h from"../tiling/TileQueue.js";import u from"../tiling/TileStrategy.js";import d from"../engine/webgl/Overlay.js";import g from"../engine/webgl/OverlayContainer.js";import{LayerView2DMixin as f}from"./LayerView2D.js";import j from"../../layers/LayerView.js";import y from"../../../geometry/Extent.js";let w=class extends(f(j)){constructor(){super(...arguments),this._overlayContainer=null,this._fetchQueue=null,this._tileStrategy=null,this._elementReferences=new Map,this._debugGraphicsView=null,this.layer=null,this.elements=new t}attach(){this.addAttachHandles([n((()=>this.layer.effectiveSource),"refresh",(()=>{for(const e of this._tileStrategy.tiles)this._updateTile(e);this.requestUpdate()})),n((()=>this.layer.effectiveSource),"change",(({element:e})=>this._elementUpdateHandler(e)))]),this._overlayContainer=new g,this.container.addChild(this._overlayContainer),this._fetchQueue=new h({tileInfoView:this.view.featuresTilingScheme,concurrency:10,process:(e,t)=>this._queryElements(e,t)}),this._tileStrategy=new u({cachePolicy:"purge",resampling:!0,acquireTile:e=>this._acquireTile(e),releaseTile:e=>this._releaseTile(e),tileInfoView:this.view.featuresTilingScheme}),this.requestUpdate()}detach(){this.elements.removeAll(),this._tileStrategy.destroy(),this._fetchQueue.destroy(),this._overlayContainer.removeAllChildren(),this.container.removeAllChildren(),this._elementReferences.clear(),this._debugGraphicsView?.destroy()}supportsSpatialReference(e){return!0}moveStart(){this.requestUpdate()}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}update(e){this._tileStrategy.update(e),this._debugGraphicsView?.update(e)}async hitTest(e,t){const r=[],s=e.normalize(),i=[s.x,s.y];for(const{projectedElement:{normalizedCoords:n,element:o}}of this._elementReferences.values())null!=n&&m(n.rings,i)&&r.push({type:"media",element:o,layer:this.layer,mapPoint:e});return r.reverse()}canResume(){return null!=this.layer.source&&super.canResume()}async doRefresh(){this._fetchQueue.reset(),this._tileStrategy.tiles.forEach((e=>this._updateTile(e)))}_acquireTile(e){const t=new T(e.clone());return this._updateTile(t),t}_updateTile(e){this.updatingHandles.addPromise(this._fetchQueue.push(e.key).then((t=>{const[r,s]=e.setElements(t);this._referenceElements(e,r),this._dereferenceElements(e,s),this.requestUpdate()}),(e=>{i(e)||r.getLogger(this).error(e)})))}_releaseTile(e){this._fetchQueue.abort(e.key.id),e.elements&&this._dereferenceElements(e,e.elements),this.requestUpdate()}async _queryElements(e,t){const r=this.layer.effectiveSource;if(null==r)return[];this.view.featuresTilingScheme.getTileBounds(b,e,!0);const s=new y({xmin:b[0],ymin:b[1],xmax:b[2],ymax:b[3],spatialReference:this.view.spatialReference});return r.queryElements(s,t)}_referenceElements(e,t){if(null!=this.layer.source)for(const r of t)this._referenceElement(e,r)}_referenceElement(e,t){s(this._elementReferences,t.uid,(()=>{const e=new c({element:t,spatialReference:this.view.spatialReference}),r=new d(e);this._overlayContainer.addChild(r),this.elements.add(t);let s=null;return{tiles:new Set,projectedElement:e,overlay:r,debugGraphic:s}})).tiles.add(e)}_dereferenceElements(e,t){for(const r of t)this._dereferenceElement(e,r)}_dereferenceElement(e,t){const r=this._elementReferences.get(t.uid);r.tiles.delete(e),r.tiles.size||(this._overlayContainer.removeChild(r.overlay),r.overlay.destroy(),r.projectedElement.destroy(),this._elementReferences.delete(t.uid),this.elements.remove(t),this._debugGraphicsView?.graphics.remove(r.debugGraphic))}_elementUpdateHandler(e){let t=this._elementReferences.get(e.uid);if(t){const r=t.projectedElement.normalizedCoords;if(null==r)return this._overlayContainer.removeChild(t.overlay),t.overlay.destroy(),t.projectedElement.destroy(),this._elementReferences.delete(e.uid),this.elements.remove(e),void this._debugGraphicsView?.graphics.remove(t.debugGraphic);const s=[],i=[];for(const e of this._tileStrategy.tiles){const n=v(this.view.featuresTilingScheme,e,r);t.tiles.has(e)?n||i.push(e):n&&s.push(e)}for(const t of s)this._referenceElement(t,e);for(const t of i)this._dereferenceElement(t,e);return t=this._elementReferences.get(e.uid),void(t?.debugGraphic&&(t.debugGraphic.geometry=t.projectedElement.normalizedCoords,this._debugGraphicsView.graphicUpdateHandler({graphic:t.debugGraphic,property:"geometry"})))}const r=new c({element:e,spatialReference:this.view.spatialReference}).normalizedCoords;if(null!=r)for(const s of this._tileStrategy.tiles){v(this.view.featuresTilingScheme,s,r)&&this._referenceElement(s,e)}}};e([o()],w.prototype,"_fetchQueue",void 0),e([o()],w.prototype,"layer",void 0),e([o({readOnly:!0})],w.prototype,"elements",void 0),w=e([l("esri.views.2d.layers.MediaLayerView2D")],w);const b=a(),_={xmin:0,ymin:0,xmax:0,ymax:0};function v(e,t,r){return e.getTileBounds(b,t.key,!0),_.xmin=b[0],_.ymin=b[1],_.xmax=b[2],_.ymax=b[3],p(_,r)}class T{constructor(e){this.key=e,this.elements=null,this.isReady=!1,this.visible=!0}setElements(e){const t=[],r=new Set(this.elements);this.elements=e;for(const s of e)r.has(s)?r.delete(s):t.push(s);return this.isReady=!0,[t,Array.from(r)]}destroy(){}}const R=w;export{R as default};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import"../../../geometry.js";import"../../../Graphic.js";import"../../../renderers/ClassBreaksRenderer.js";import"../../../renderers/DictionaryRenderer.js";import"../../../renderers/DotDensityRenderer.js";import"../../../renderers/HeatmapRenderer.js";import"../../../renderers/PieChartRenderer.js";import"../../../renderers/Renderer.js";import"../../../renderers/SimpleRenderer.js";import"../../../renderers/UniqueValueRenderer.js";import"../../../renderers/support/jsonUtils.js";import"../../../symbols.js";import t from"../../../core/Collection.js";import"../../../core/has.js";import r from"../../../core/Logger.js";import{getOrCreateMapValue as i}from"../../../core/MapUtils.js";import{isAbortError as s}from"../../../core/promiseUtils.js";import{on as n}from"../../../core/reactiveUtils.js";import{property as o}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import"../../../core/arrayUtils.js";import{subclass as l}from"../../../core/accessorSupport/decorators/subclass.js";import{create as a}from"../../../geometry/support/aaBoundingRect.js";import{ringsContainsCoords as m}from"../../../geometry/support/contains.js";import{extentIntersectsPolygon as p}from"../../../geometry/support/intersectsBase.js";import{MediaElementView as c}from"../../../layers/support/MediaElementView.js";import"../../../core/Error.js";import"../../../core/scheduling.js";import"../../../request.js";import"../../../chunks/index2.js";import"../../../core/urlUtils.js";import"../../../chunks/index3.js";import"../../../layers/effects/EffectView.js";import"../engine/DisplayObject.js";import"../engine/webgl/effects/highlight/HighlightGradient.js";import"../engine/webgl/BufferPool.js";import"../engine/webgl/enums.js";import"../engine/webgl/brushes/BrushBitmap.js";import"../../../chunks/vec4f32.js";import"../engine/webgl/Utils.js";import"../engine/webgl/shaders/BackgroundPrograms.js";import"../../webgl/enums.js";import"../../webgl/checkWebGLError.js";import"../../webgl/contextUtils.js";import"../../../chunks/builtins.js";import"../engine/webgl/definitions.js";import"../../../core/RandomLCG.js";import"../engine/webgl/materialKey/MaterialKey.js";import"../engine/webgl/techniques/Technique.js";import"../engine/webgl/techniques/dotDensity/TechniqueDotDensity.js";import"../engine/webgl/techniques/heatmap/TechniqueHeatmap.js";import"../engine/webgl/techniques/pieChart/TechniquePieChart.js";import"../../webgl/BufferObject.js";import"../../webgl/FramebufferObject.js";import"../../webgl/GLObjectType.js";import"../../webgl/Texture.js";import"../../webgl/VertexArrayObject.js";import"../engine/webgl/brushes/WGLBrushHeatmap.js";import"../engine/webgl/DefaultVertexAttributeLayouts.js";import"../engine/webgl/shaders/TileInfoPrograms.js";import"../engine/webgl/brushes/WGLGeometryBrushMarker.js";import"../../../core/mathUtils.js";import"../engine/webgl/number.js";import"../engine/vectorTiles/style/StyleDefinition.js";import"../../../chunks/vec2f32.js";import"../engine/vectorTiles/enums.js";import"../engine/vectorTiles/shaders/sources/resolver.js";import"../engine/webgl/shaders/BitBlitPrograms.js";import"../engine/webgl/shaders/sources/resolver.js";import"../engine/webgl/TextureManager.js";import"../engine/webgl/shaders/StencilPrograms.js";import"../engine/webgl/effects/BlendEffect.js";import"../engine/webgl/shaders/HighlightPrograms.js";import"../engine/webgl/Profiler.js";import"../../webgl/renderState.js";import"../../3d/webgl-engine/core/shaderModules/interfaces.js";import"../../../core/floatRGBA.js";import"../../3d/webgl-engine/lib/OrderIndependentTransparency.js";import"../LabelManager.js";import"./graphics/GraphicsView2D.js";import"../engine/webgl/AttributeStoreView.js";import"../../../chunks/earcut.js";import"../../../layers/graphics/featureConversionUtils.js";import"../../../core/unitUtils.js";import"../../../renderers/support/lengthUtils.js";import"../../../chunks/vec3f32.js";import"../../../geometry/support/normalizeUtils.js";import"../navigation/MapViewNavigation.js";import"../../../core/asyncUtils.js";import"../engine/webgl/shaders/MagnifierPrograms.js";import"../tiling/PagedTileQueue.js";import"../tiling/TileInfoView.js";import"../tiling/TileKey.js";import h from"../tiling/TileQueue.js";import u from"../tiling/TileStrategy.js";import d from"../engine/webgl/Overlay.js";import g from"../engine/webgl/OverlayContainer.js";import{LayerView2DMixin as f}from"./LayerView2D.js";import j from"../../layers/LayerView.js";import y from"../../../geometry/Extent.js";let w=class extends(f(j)){constructor(){super(...arguments),this._overlayContainer=null,this._fetchQueue=null,this._tileStrategy=null,this._elementReferences=new Map,this._debugGraphicsView=null,this.layer=null,this.elements=new t}attach(){this.addAttachHandles([n((()=>this.layer.effectiveSource),"refresh",(()=>{for(const e of this._tileStrategy.tiles)this._updateTile(e);this.requestUpdate()})),n((()=>this.layer.effectiveSource),"change",(({element:e})=>this._elementUpdateHandler(e)))]),this._overlayContainer=new g,this.container.addChild(this._overlayContainer),this._fetchQueue=new h({tileInfoView:this.view.featuresTilingScheme,concurrency:10,process:(e,t)=>this._queryElements(e,t)}),this._tileStrategy=new u({cachePolicy:"purge",resampling:!0,acquireTile:e=>this._acquireTile(e),releaseTile:e=>this._releaseTile(e),tileInfoView:this.view.featuresTilingScheme}),this.requestUpdate()}detach(){this.elements.removeAll(),this._tileStrategy.destroy(),this._fetchQueue.destroy(),this._overlayContainer.removeAllChildren(),this.container.removeAllChildren(),this._elementReferences.clear(),this._debugGraphicsView?.destroy()}supportsSpatialReference(e){return!0}moveStart(){this.requestUpdate()}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}update(e){this._tileStrategy.update(e),this._debugGraphicsView?.update(e)}async hitTest(e,t){const r=[],i=e.normalize(),s=[i.x,i.y];for(const{projectedElement:{normalizedCoords:n,element:o}}of this._elementReferences.values())null!=n&&m(n.rings,s)&&r.push({type:"media",element:o,layer:this.layer,mapPoint:e});return r.reverse()}canResume(){return null!=this.layer.source&&super.canResume()}async doRefresh(){this._fetchQueue.reset(),this._tileStrategy.tiles.forEach((e=>this._updateTile(e)))}_acquireTile(e){const t=new T(e.clone());return this._updateTile(t),t}_updateTile(e){this.updatingHandles.addPromise(this._fetchQueue.push(e.key).then((t=>{const[r,i]=e.setElements(t);this._referenceElements(e,r),this._dereferenceElements(e,i),this.requestUpdate()}),(e=>{s(e)||r.getLogger(this).error(e)})))}_releaseTile(e){this._fetchQueue.abort(e.key.id),e.elements&&this._dereferenceElements(e,e.elements),this.requestUpdate()}async _queryElements(e,t){const r=this.layer.effectiveSource;if(null==r)return[];this.view.featuresTilingScheme.getTileBounds(b,e,!0);const i=new y({xmin:b[0],ymin:b[1],xmax:b[2],ymax:b[3],spatialReference:this.view.spatialReference});return r.queryElements(i,t)}_referenceElements(e,t){if(null!=this.layer.source)for(const r of t)this._referenceElement(e,r)}_referenceElement(e,t){i(this._elementReferences,t.uid,(()=>{const e=new c({element:t,spatialReference:this.view.spatialReference}),r=new d(e);this._overlayContainer.addChild(r),this.elements.add(t);let i=null;return{tiles:new Set,projectedElement:e,overlay:r,debugGraphic:i}})).tiles.add(e)}_dereferenceElements(e,t){for(const r of t)this._dereferenceElement(e,r)}_dereferenceElement(e,t){const r=this._elementReferences.get(t.uid);r.tiles.delete(e),r.tiles.size||(this._overlayContainer.removeChild(r.overlay),r.overlay.destroy(),r.projectedElement.destroy(),this._elementReferences.delete(t.uid),this.elements.remove(t),this._debugGraphicsView?.graphics.remove(r.debugGraphic))}_elementUpdateHandler(e){let t=this._elementReferences.get(e.uid);if(t){const r=t.projectedElement.normalizedCoords;if(null==r)return this._overlayContainer.removeChild(t.overlay),t.overlay.destroy(),t.projectedElement.destroy(),this._elementReferences.delete(e.uid),this.elements.remove(e),void this._debugGraphicsView?.graphics.remove(t.debugGraphic);const i=[],s=[];for(const e of this._tileStrategy.tiles){const n=v(this.view.featuresTilingScheme,e,r);t.tiles.has(e)?n||s.push(e):n&&i.push(e)}for(const t of i)this._referenceElement(t,e);for(const t of s)this._dereferenceElement(t,e);return t=this._elementReferences.get(e.uid),void(t?.debugGraphic&&(t.debugGraphic.geometry=t.projectedElement.normalizedCoords,this._debugGraphicsView.graphicUpdateHandler({graphic:t.debugGraphic,property:"geometry"})))}const r=new c({element:e,spatialReference:this.view.spatialReference}).normalizedCoords;if(null!=r)for(const i of this._tileStrategy.tiles){v(this.view.featuresTilingScheme,i,r)&&this._referenceElement(i,e)}}};e([o()],w.prototype,"_fetchQueue",void 0),e([o()],w.prototype,"layer",void 0),e([o({readOnly:!0})],w.prototype,"elements",void 0),w=e([l("esri.views.2d.layers.MediaLayerView2D")],w);const b=a(),_={xmin:0,ymin:0,xmax:0,ymax:0};function v(e,t,r){return e.getTileBounds(b,t.key,!0),_.xmin=b[0],_.ymin=b[1],_.xmax=b[2],_.ymax=b[3],p(_,r)}class T{constructor(e){this.key=e,this.elements=null,this.isReady=!1,this.visible=!0}setElements(e){const t=[],r=new Set(this.elements);this.elements=e;for(const i of e)r.has(i)?r.delete(i):t.push(i);return this.isReady=!0,[t,Array.from(r)]}destroy(){}}const R=w;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.27/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Logger.js";import{isAbortError as i}from"../../../core/promiseUtils.js";import{watch as r}from"../../../core/reactiveUtils.js";import{property as s}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import{subclass as l}from"../../../core/accessorSupport/decorators/subclass.js";import{equals as o}from"../../../geometry/support/spatialReferenceUtils.js";import{GraphicsCollection as h}from"../../../support/GraphicsCollection.js";import"../../../core/Error.js";import"../../../core/scheduling.js";import"../../../request.js";import"../../../chunks/index2.js";import"../../../core/urlUtils.js";import"../../../chunks/index3.js";import"../../../layers/effects/EffectView.js";import"../engine/DisplayObject.js";import"../engine/webgl/effects/highlight/HighlightGradient.js";import"../engine/webgl/BufferPool.js";import"../engine/webgl/enums.js";import"../engine/webgl/brushes/BrushBitmap.js";import"../../../chunks/vec4f32.js";import"../engine/webgl/Utils.js";import"../engine/webgl/shaders/BackgroundPrograms.js";import"../../webgl/enums.js";import"../../webgl/checkWebGLError.js";import"../../webgl/contextUtils.js";import"../../../chunks/builtins.js";import"../../../core/RandomLCG.js";import"../engine/webgl/materialKey/MaterialKey.js";import"../engine/webgl/techniques/Technique.js";import"../engine/webgl/techniques/dotDensity/TechniqueDotDensity.js";import"../engine/webgl/techniques/heatmap/TechniqueHeatmap.js";import"../engine/webgl/techniques/pieChart/TechniquePieChart.js";import"../../webgl/BufferObject.js";import"../../webgl/FramebufferObject.js";import"../../webgl/GLObjectType.js";import"../../webgl/Texture.js";import"../../webgl/VertexArrayObject.js";import"../engine/webgl/brushes/WGLBrushHeatmap.js";import"../engine/webgl/DefaultVertexAttributeLayouts.js";import"../engine/webgl/shaders/TileInfoPrograms.js";import"../engine/webgl/brushes/WGLGeometryBrushMarker.js";import"../../../core/mathUtils.js";import"../engine/webgl/number.js";import"../engine/vectorTiles/style/StyleDefinition.js";import"../../../chunks/vec2f32.js";import"../engine/vectorTiles/enums.js";import"../engine/vectorTiles/shaders/sources/resolver.js";import"../engine/webgl/shaders/BitBlitPrograms.js";import"../engine/webgl/shaders/sources/resolver.js";import"../engine/webgl/TextureManager.js";import"../engine/webgl/shaders/StencilPrograms.js";import"../engine/webgl/effects/BlendEffect.js";import"../engine/webgl/shaders/HighlightPrograms.js";import"../engine/webgl/Profiler.js";import"../../webgl/renderState.js";import"../../3d/webgl-engine/core/shaderModules/interfaces.js";import"../../../core/floatRGBA.js";import"../../3d/webgl-engine/lib/OrderIndependentTransparency.js";import"../LabelManager.js";import a from"./graphics/GraphicsView2D.js";import"../engine/webgl/AttributeStoreView.js";import"../../../chunks/earcut.js";import"../../../layers/graphics/featureConversionUtils.js";import"../../../core/unitUtils.js";import"../../../renderers/support/lengthUtils.js";import"../../../chunks/vec3f32.js";import"../../../geometry/support/normalizeUtils.js";import"../navigation/MapViewNavigation.js";import"../../../core/asyncUtils.js";import"../engine/webgl/shaders/MagnifierPrograms.js";import{BitmapTileLayerView2D as n}from"./BitmapTileLayerView2D.js";import{LayerView2DMixin as p}from"./LayerView2D.js";import g from"./graphics/HighlightGraphicContainer.js";import{createBlankImage as c,resampleImage as m}from"./support/imageUtils.js";import u from"../tiling/TileInfoView.js";import f from"../tiling/TileKey.js";import w from"../tiling/TileQueue.js";import j from"../tiling/TileStrategy.js";import d from"../../layers/LayerView.js";import y from"../../layers/RefreshableLayerView.js";import{isMapServiceLayerView as b,MapServiceLayerViewHelper as _}from"../../layers/support/MapServiceLayerViewHelper.js";import{createQueryGeometry as T}from"../../support/drapedUtils.js";const V=[0,0];let v=class extends(y(n(p(d)))){constructor(){super(...arguments),this._fetchQueue=null,this._highlightGraphics=new h,this._highlightView=null,this._popupHighlightHelper=null,this._tileStrategy=null,this.layer=null}get resampling(){return!("resampling"in this.layer)||!1!==this.layer.resampling}get tilemapCache(){return"tilemapCache"in this.layer?this.layer.tilemapCache:null}update(e){this._fetchQueue.pause(),this._fetchQueue.state=e.state,this._tileStrategy.update(e),this._fetchQueue.resume(),this._highlightView?.processUpdate(e)}attach(){const e="tileServers"in this.layer?this.layer.tileServers:null,t=this.tilemapCache;if(this._tileInfoView=new u(this.layer.tileInfo,this.layer.fullExtent,t?.effectiveMinLOD,t?.effectiveMaxLOD),this._fetchQueue=new w({tileInfoView:this._tileInfoView,concurrency:e&&10*e.length||10,process:(e,t)=>this.fetchTile(e,t)}),this._tileStrategy=new j({cachePolicy:"keep",resampling:this.resampling,acquireTile:e=>this.acquireTile(e),releaseTile:e=>this.releaseTile(e),tileInfoView:this._tileInfoView}),b(this,this.layer)){const e=this._highlightView=new a({view:this.view,graphics:this._highlightGraphics,requestUpdateCallback:()=>this.requestUpdate(),container:new g(this.view.featuresTilingScheme),defaultPointSymbolEnabled:!1});this.container.addChild(this._highlightView.container),this._popupHighlightHelper=new _({createFetchPopupFeaturesQueryGeometry:(e,t)=>T(e,t,this.view),highlightGraphics:this._highlightGraphics,highlightGraphicUpdated:(t,i)=>{e.graphicUpdateHandler({graphic:t,property:i})},layerView:this,updatingHandles:this.updatingHandles})}this.requestUpdate(),this.addAttachHandles(r((()=>this.resampling),(()=>{this.doRefresh()}))),super.attach()}detach(){super.detach(),this._tileStrategy.destroy(),this._fetchQueue.clear(),this.container.removeAllChildren(),this._popupHighlightHelper?.destroy(),this._fetchQueue=this._tileStrategy=this._tileInfoView=this._popupHighlightHelper=null}async fetchPopupFeatures(e,t){return this._popupHighlightHelper?this._popupHighlightHelper.fetchPopupFeatures(e,t):[]}highlight(e){return this._popupHighlightHelper?this._popupHighlightHelper.highlight(e):{remove(){}}}moveStart(){this.requestUpdate()}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}supportsSpatialReference(e){return o(this.layer.tileInfo?.spatialReference,e)}async doRefresh(){!this.attached||this.updateRequested||this.suspended||(this._fetchQueue.reset(),this._tileStrategy.tiles.forEach((e=>this._enqueueTileFetch(e))))}isUpdating(){return this._fetchQueue?.updating??!1}acquireTile(e){const t=this._bitmapView.createTile(e),i=t.bitmap;return[i.x,i.y]=this._tileInfoView.getTileCoords(V,t.key),i.resolution=this._tileInfoView.getTileResolution(t.key),[i.width,i.height]=this._tileInfoView.tileInfo.size,this._enqueueTileFetch(t),this._bitmapView.addChild(t),this.requestUpdate(),t}releaseTile(e){this._fetchQueue.abort(e.key.id),this._bitmapView.removeChild(e),e.once("detach",(()=>e.destroy())),this.requestUpdate()}async fetchTile(e,t={}){const r=this.tilemapCache,{signal:s,resamplingLevel:l=0}=t;if(!r)try{return await this._fetchImage(e,s)}catch(a){if(!i(a)&&!this.resampling)return c(this._tileInfoView.tileInfo.size);if(l<3){const i=this._tileInfoView.getTileParentId(e.id);if(i){const r=new f(i),s=await this.fetchTile(r,{...t,resamplingLevel:l+1});return m(this._tileInfoView,s,r,e)}}throw a}const o=new f(0,0,0,0);let h;try{if(await r.fetchAvailabilityUpsample(e.level,e.row,e.col,o,{signal:s}),o.level!==e.level&&!this.resampling)return c(this._tileInfoView.tileInfo.size);h=await this._fetchImage(o,s)}catch(a){if(i(a))throw a;h=await this._fetchImage(e,s)}return this.resampling?m(this._tileInfoView,h,o,e):h}async _enqueueTileFetch(e){if(!this._fetchQueue.has(e.key.id)){try{const t=await this._fetchQueue.push(e.key);e.bitmap.source=t,e.bitmap.width=this._tileInfoView.tileInfo.size[0],e.bitmap.height=this._tileInfoView.tileInfo.size[1],e.once("attach",(()=>this.requestUpdate()))}catch(r){i(r)||t.getLogger(this).error(r)}this.requestUpdate()}}async _fetchImage(e,t){return this.layer.fetchImageBitmapTile(e.level,e.row,e.col,{signal:t})}};e([s()],v.prototype,"_fetchQueue",void 0),e([s()],v.prototype,"resampling",null),e([s()],v.prototype,"tilemapCache",null),v=e([l("esri.views.2d.layers.TileLayerView2D")],v);const I=v;export{I as default};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import i from"../../../core/Logger.js";import{isAbortError as t}from"../../../core/promiseUtils.js";import{watch as r}from"../../../core/reactiveUtils.js";import{property as s}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import{subclass as o}from"../../../core/accessorSupport/decorators/subclass.js";import{equals as l}from"../../../geometry/support/spatialReferenceUtils.js";import{GraphicsCollection as h}from"../../../support/GraphicsCollection.js";import"../../../core/Error.js";import"../../../core/scheduling.js";import"../../../request.js";import"../../../chunks/index2.js";import"../../../core/urlUtils.js";import"../../../chunks/index3.js";import"../../../layers/effects/EffectView.js";import"../engine/DisplayObject.js";import"../engine/webgl/effects/highlight/HighlightGradient.js";import"../engine/webgl/BufferPool.js";import"../engine/webgl/enums.js";import"../engine/webgl/brushes/BrushBitmap.js";import"../../../chunks/vec4f32.js";import"../engine/webgl/Utils.js";import"../engine/webgl/shaders/BackgroundPrograms.js";import"../../webgl/enums.js";import"../../webgl/checkWebGLError.js";import"../../webgl/contextUtils.js";import"../../../chunks/builtins.js";import"../engine/webgl/definitions.js";import"../../../core/RandomLCG.js";import"../engine/webgl/materialKey/MaterialKey.js";import"../engine/webgl/techniques/Technique.js";import"../engine/webgl/techniques/dotDensity/TechniqueDotDensity.js";import"../engine/webgl/techniques/heatmap/TechniqueHeatmap.js";import"../engine/webgl/techniques/pieChart/TechniquePieChart.js";import"../../webgl/BufferObject.js";import"../../webgl/FramebufferObject.js";import"../../webgl/GLObjectType.js";import"../../webgl/Texture.js";import"../../webgl/VertexArrayObject.js";import"../engine/webgl/brushes/WGLBrushHeatmap.js";import"../engine/webgl/DefaultVertexAttributeLayouts.js";import"../engine/webgl/shaders/TileInfoPrograms.js";import"../engine/webgl/brushes/WGLGeometryBrushMarker.js";import"../../../core/mathUtils.js";import"../engine/webgl/number.js";import"../engine/vectorTiles/style/StyleDefinition.js";import"../../../chunks/vec2f32.js";import"../engine/vectorTiles/enums.js";import"../engine/vectorTiles/shaders/sources/resolver.js";import"../engine/webgl/shaders/BitBlitPrograms.js";import"../engine/webgl/shaders/sources/resolver.js";import"../engine/webgl/TextureManager.js";import"../engine/webgl/shaders/StencilPrograms.js";import"../engine/webgl/effects/BlendEffect.js";import"../engine/webgl/shaders/HighlightPrograms.js";import"../engine/webgl/Profiler.js";import"../../webgl/renderState.js";import"../../3d/webgl-engine/core/shaderModules/interfaces.js";import"../../../core/floatRGBA.js";import"../../3d/webgl-engine/lib/OrderIndependentTransparency.js";import"../LabelManager.js";import a from"./graphics/GraphicsView2D.js";import"../engine/webgl/AttributeStoreView.js";import"../../../chunks/earcut.js";import"../../../layers/graphics/featureConversionUtils.js";import"../../../core/unitUtils.js";import"../../../renderers/support/lengthUtils.js";import"../../../chunks/vec3f32.js";import"../../../geometry/support/normalizeUtils.js";import"../navigation/MapViewNavigation.js";import"../../../core/asyncUtils.js";import"../engine/webgl/shaders/MagnifierPrograms.js";import{BitmapTileLayerView2D as n}from"./BitmapTileLayerView2D.js";import{LayerView2DMixin as p}from"./LayerView2D.js";import g from"./graphics/HighlightGraphicContainer.js";import{createBlankImage as c,resampleImage as m}from"./support/imageUtils.js";import u from"../tiling/TileInfoView.js";import f from"../tiling/TileKey.js";import w from"../tiling/TileQueue.js";import j from"../tiling/TileStrategy.js";import d from"../../layers/LayerView.js";import y from"../../layers/RefreshableLayerView.js";import{isMapServiceLayerView as b,MapServiceLayerViewHelper as _}from"../../layers/support/MapServiceLayerViewHelper.js";import{createQueryGeometry as T}from"../../support/drapedUtils.js";const V=[0,0];let v=class extends(y(n(p(d)))){constructor(){super(...arguments),this._fetchQueue=null,this._highlightGraphics=new h,this._highlightView=null,this._popupHighlightHelper=null,this._tileStrategy=null,this.layer=null}get resampling(){return!("resampling"in this.layer)||!1!==this.layer.resampling}get tilemapCache(){return"tilemapCache"in this.layer?this.layer.tilemapCache:null}update(e){this._fetchQueue.pause(),this._fetchQueue.state=e.state,this._tileStrategy.update(e),this._fetchQueue.resume(),this._highlightView?.processUpdate(e)}attach(){const e="tileServers"in this.layer?this.layer.tileServers:null,i=this.tilemapCache;if(this._tileInfoView=new u(this.layer.tileInfo,this.layer.fullExtent,i?.effectiveMinLOD,i?.effectiveMaxLOD),this._fetchQueue=new w({tileInfoView:this._tileInfoView,concurrency:e&&10*e.length||10,process:(e,i)=>this.fetchTile(e,i)}),this._tileStrategy=new j({cachePolicy:"keep",resampling:this.resampling,acquireTile:e=>this.acquireTile(e),releaseTile:e=>this.releaseTile(e),tileInfoView:this._tileInfoView}),b(this,this.layer)){const e=this._highlightView=new a({view:this.view,graphics:this._highlightGraphics,requestUpdateCallback:()=>this.requestUpdate(),container:new g(this.view.featuresTilingScheme),defaultPointSymbolEnabled:!1});this.container.addChild(this._highlightView.container),this._popupHighlightHelper=new _({createFetchPopupFeaturesQueryGeometry:(e,i)=>T(e,i,this.view),highlightGraphics:this._highlightGraphics,highlightGraphicUpdated:(i,t)=>{e.graphicUpdateHandler({graphic:i,property:t})},layerView:this,updatingHandles:this.updatingHandles})}this.requestUpdate(),this.addAttachHandles(r((()=>this.resampling),(()=>{this.doRefresh()}))),super.attach()}detach(){super.detach(),this._tileStrategy.destroy(),this._fetchQueue.clear(),this.container.removeAllChildren(),this._popupHighlightHelper?.destroy(),this._fetchQueue=this._tileStrategy=this._tileInfoView=this._popupHighlightHelper=null}async fetchPopupFeatures(e,i){return this._popupHighlightHelper?this._popupHighlightHelper.fetchPopupFeatures(e,i):[]}highlight(e){return this._popupHighlightHelper?this._popupHighlightHelper.highlight(e):{remove(){}}}moveStart(){this.requestUpdate()}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}supportsSpatialReference(e){return l(this.layer.tileInfo?.spatialReference,e)}async doRefresh(){!this.attached||this.updateRequested||this.suspended||(this._fetchQueue.reset(),this._tileStrategy.tiles.forEach((e=>this._enqueueTileFetch(e))))}isUpdating(){return this._fetchQueue?.updating??!1}acquireTile(e){const i=this._bitmapView.createTile(e),t=i.bitmap;return[t.x,t.y]=this._tileInfoView.getTileCoords(V,i.key),t.resolution=this._tileInfoView.getTileResolution(i.key),[t.width,t.height]=this._tileInfoView.tileInfo.size,this._enqueueTileFetch(i),this._bitmapView.addChild(i),this.requestUpdate(),i}releaseTile(e){this._fetchQueue.abort(e.key.id),this._bitmapView.removeChild(e),e.once("detach",(()=>e.destroy())),this.requestUpdate()}async fetchTile(e,i={}){const r=this.tilemapCache,{signal:s,resamplingLevel:o=0}=i;if(!r)try{return await this._fetchImage(e,s)}catch(a){if(!t(a)&&!this.resampling)return c(this._tileInfoView.tileInfo.size);if(o<3){const t=this._tileInfoView.getTileParentId(e.id);if(t){const r=new f(t),s=await this.fetchTile(r,{...i,resamplingLevel:o+1});return m(this._tileInfoView,s,r,e)}}throw a}const l=new f(0,0,0,0);let h;try{if(await r.fetchAvailabilityUpsample(e.level,e.row,e.col,l,{signal:s}),l.level!==e.level&&!this.resampling)return c(this._tileInfoView.tileInfo.size);h=await this._fetchImage(l,s)}catch(a){if(t(a))throw a;h=await this._fetchImage(e,s)}return this.resampling?m(this._tileInfoView,h,l,e):h}async _enqueueTileFetch(e){if(!this._fetchQueue.has(e.key.id)){try{const i=await this._fetchQueue.push(e.key);e.bitmap.source=i,e.bitmap.width=this._tileInfoView.tileInfo.size[0],e.bitmap.height=this._tileInfoView.tileInfo.size[1],e.once("attach",(()=>this.requestUpdate()))}catch(r){t(r)||i.getLogger(this).error(r)}this.requestUpdate()}}async _fetchImage(e,i){return this.layer.fetchImageBitmapTile(e.level,e.row,e.col,{signal:i})}};e([s()],v.prototype,"_fetchQueue",void 0),e([s()],v.prototype,"resampling",null),e([s()],v.prototype,"tilemapCache",null),v=e([o("esri.views.2d.layers.TileLayerView2D")],v);const I=v;export{I 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.27/esri/copyright.txt for details.
4
4
  */
5
- import{_ as t}from"../../../../chunks/tslib.es6.js";import e from"../../../../Color.js";import i from"../../../../analysis/SlicePlane.js";import{clock as a}from"../../../../core/clock.js";import s from"../../../../core/Handles.js";import{releaseMaybe as n,destroyMaybe as r,removeMaybe as l}from"../../../../core/maybe.js";import{watch as o,sync as h,syncAndInitial as p}from"../../../../core/reactiveUtils.js";import{addFrameTask as u}from"../../../../core/scheduling.js";import{createScreenPoint as c,screenPointObjectToArray as d,createScreenPointArray as _}from"../../../../core/screenUtils.js";import{property as v}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/accessorSupport/ensureType.js";import"../../../../core/arrayUtils.js";import"../../../../core/has.js";import{subclass as P}from"../../../../core/accessorSupport/decorators/subclass.js";import{d as y,E as m,m as g}from"../../../../chunks/mat4.js";import{e as w,l as f,c as M,g as T,a as D,m as V,n as b,s as k}from"../../../../chunks/vec3.js";import{a as E,c as S}from"../../../../chunks/vec3f64.js";import{Z as H}from"../../../../chunks/vec4f64.js";import{a as x,c as R,n as I,f as C}from"../../../../chunks/boundedPlane.js";import{signedDistance as j,create as O,intersectRay as z,normal as G}from"../../../../geometry/support/plane.js";import{create as U}from"../../../../geometry/support/ray.js";import{sv3d as A,sm4d as L,sv2d as B}from"../../../../geometry/support/vectorStacks.js";import{settings as K}from"./settings.js";import{POINTER_MOVE_TIMER_MS as F,PLANE_PREVIEW_OUTLINE_WIDTH as N,forceVerticalModifier as Z,forceHorizontalModifier as q,PREVIEW_FADE_DOT_THRESHOLD as W,PREVIEW_FADE_DURATION_SECONDS as J,INITIAL_DEPTH_OFFSET_FRAC as Q}from"./sliceToolConfig.js";import{createShiftManipulator as X,OffsetMode as Y,createRotateManipulator as $,createResizeManipulator as tt,createGridVisualElement as et,createOutlineVisualElement as it,planeToShape as at,createRotatePlane as st,RotationAxis as nt,resizePlane as rt,calculatePlaneHalfSize as lt,SliceOrientation as ot,createPlane as ht,DidPointerMoveRecentlyFlag as pt,calculateBoundedPlaneTranslateRotate as ut,updateShiftRestartHandle as ct,updateRotateHeadingHandle as dt,updateRotateTiltHandle as _t,updateResizeHandle as vt,createShiftPlane as Pt}from"./sliceToolUtils.js";import{getRotateHeadingTexture as yt,getTiltRotateTexture as mt}from"./images/Factory.js";import{calculateInputRotationTransform as gt}from"../../interactive/manipulatorUtils.js";import{screenToRenderPlane as wt}from"../../interactive/editingTools/dragEventPipeline3D.js";import{fromScreen as ft}from"../../support/geometryUtils/ray.js";import{newIntersector as Mt}from"../../webgl-engine/lib/Intersector.js";import{StoreResults as Tt}from"../../webgl-engine/lib/IntersectorInterfaces.js";import{AnalysisToolBase as Dt}from"../../../interactive/AnalysisToolBase.js";import{createManipulatorDragEventPipeline as Vt}from"../../../interactive/dragEventPipeline.js";import{createScreenPointFromEvent as bt}from"../../../support/screenUtils.js";var kt;let Et=kt=class extends Dt{constructor(t){super(t),this._clock=a,this._previewPlaneOpacity=1,this.removeIncompleteOnCancel=!1,this.layersMode="none",this.shiftManipulator=null,this.rotateHeadingManipulator=null,this.rotateTiltManipulator=null,this.resizeManipulators=null,this._handles=new s,this._viewHandles=new s,this._frameTask=null,this._pointerMoveTimerMs=F,this._prevPointerMoveTimeout=null,this._previewPlaneGridVisualElement=null,this._previewPlaneOutlineVisualElement=null,this._startPlane=x(),this._previewPlane=null,this._activeKeyModifiers={},this._lastCursorPosition=c(),this._resizeHandles=[{direction:[1,0]},{direction:[1,1]},{direction:[0,1]},{direction:[-1,1]},{direction:[-1,0]},{direction:[-1,-1]},{direction:[0,-1]},{direction:[1,-1]}],this._intersector=Mt(t.view.state.viewingMode),this._intersector.options.store=Tt.MIN}initialize(){if(null==this.analysis)throw new Error("SliceTool requires valid analysis, but null was provided.");const t=!this.view._stage?.renderView.renderingContext.driverTest.svgPremultipliesAlpha.result,e={accentColor:K.rotateManipulators.color,contrastColor:K.rotateManipulators.contrastColor,preMultiplyAlpha:t};this._rotateHeadingImage=yt(this.view.toolViewManager.textures,e),this._rotateTiltImage=mt(this.view.toolViewManager.textures,e);const i=t=>{this._updateManipulatorsInteractive(t),t.grabbing||(null!=this.analysisViewData.plane&&R(this.analysisViewData.plane,this._startPlane),this.inputState=null)};this.shiftManipulator=X(this.view,{offsetMode:Y.CENTER_ON_ARROW,calloutColor:K.callouts.color,color:K.shiftManipulator.color,outlineColor:K.shiftManipulator.outlineColor}),this.manipulators.add(this.shiftManipulator),this.shiftManipulator.events.on("grab-changed",(t=>{this._onShiftGrab(t),i(this.shiftManipulator)})),this._handles.add(this._createShiftDragPipeline(this.shiftManipulator)),this.rotateHeadingManipulator=$(this.view,this._rotateHeadingImage.texture),this.manipulators.add(this.rotateHeadingManipulator),this.rotateHeadingManipulator.events.on("grab-changed",(t=>{this._onRotateHeadingGrab(t),i(this.rotateHeadingManipulator)})),this._handles.add(this._createRotateHeadingDragPipeline(this.rotateHeadingManipulator)),this.rotateTiltManipulator=$(this.view,this._rotateTiltImage.texture),this.manipulators.add(this.rotateTiltManipulator),this.rotateTiltManipulator.events.on("grab-changed",(t=>{this._onRotateTiltGrab(t),i(this.rotateTiltManipulator)})),this._handles.add(this._createRotateTiltDragPipeline(this.rotateTiltManipulator)),this.resizeManipulators=this._resizeHandles.map(((t,e)=>{const a=tt(this.view,t,{color:K.resizeManipulators.color});return a.events.on("grab-changed",(t=>{this._onResizeGrab(t,e),i(a)})),this._handles.add(this._createResizeDragPipeline(a)),a})),this.manipulators.addMany(this.resizeManipulators),this._previewPlaneGridVisualElement=et(this.view),this._previewPlaneOutlineVisualElement=it(this.view),this._previewPlaneOutlineVisualElement.width=N,this._handles.add(o((()=>[this.analysisViewData.plane,this.analysis.tiltEnabled]),(()=>this._updateManipulators()),h));const a=o((()=>this.state),(t=>{"sliced"===t&&this.finishToolCreation()}),p);this._handles.add([a,o((()=>this.view.state.camera),(()=>this._onCameraChange()))])}destroy(){this._rotateHeadingImage=n(this._rotateHeadingImage),this._rotateTiltImage=n(this._rotateTiltImage),this._handles=r(this._handles),this._viewHandles=r(this._viewHandles),this._removeFrameTask(),this._clearPointerMoveTimeout(),this._previewPlaneOutlineVisualElement=r(this._previewPlaneOutlineVisualElement),this._previewPlaneGridVisualElement=r(this._previewPlaneGridVisualElement)}get state(){const t=!!this.analysisViewData.plane,e=!!this.inputState;return t?t&&e?"slicing":t&&!e?"sliced":"ready":"ready"}get cursor(){return this._isPlacingSlicePlane||"exclude"===this.layersMode?"crosshair":null!=this._creatingPointerId?"grabbing":null}set analysis(t){if(null==t)throw new Error("SliceTool requires valid analysis, but null was provided.");this._handles.remove("analysis"),this._set("analysis",t)}get inputState(){return this._get("inputState")}set inputState(t){this._set("inputState",t),this.analysisViewData.showGrid=null!=t&&"resize"===t.type,this._updateMaterials()}get _isPlacingSlicePlane(){return!this.inputState&&!this.analysisViewData.plane&&this.active}get _creatingPointerId(){return null!=this.inputState&&"shift"===this.inputState.type?this.inputState.creatingPointerId:null}enterExcludeLayerMode(){null!=this.analysisViewData.plane&&(this._set("layersMode","exclude"),this.active||(this.view.activeTool=this))}exitExcludeLayerMode(){null!=this.analysisViewData.plane&&(this._set("layersMode","none"),this.active&&(this.view.activeTool=null))}onDeactivate(){this._set("layersMode","none"),this._updatePreviewPlane(null)}onShow(){this._updateVisibility(!0)}onHide(){this._updateVisibility(!1)}_updateVisibility(t){this._updateManipulators(),t||this._clearPointerMoveTimeout()}onInputEvent(t){switch(t.type){case"pointer-drag":if(!Ht(t))return;this._isPlacingSlicePlane?this._onClickPlacePlane(t)&&t.stopPropagation():this._onPointerDrag(t)&&t.stopPropagation();break;case"pointer-move":this._onPointerMove(t);break;case"pointer-up":this._onPointerUp(t)&&t.stopPropagation();break;case"immediate-click":if(!Ht(t))return;this._onClickPlacePlane(t)&&t.stopPropagation();break;case"click":if(!Ht(t))return;this._onClickExcludeLayer(t)&&t.stopPropagation();break;case"drag":this.inputState&&t.stopPropagation();break;case"key-down":this._onKeyDown(t)&&t.stopPropagation();break;case"key-up":this._onKeyUp(t)&&t.stopPropagation()}}onEditableChange(){this.analysisViewData.editable=this.internallyEditable}_onPointerDrag(t){const e=this.inputState;if(t.pointerId===this._creatingPointerId&&null!=e&&"shift"===e.type){const i=bt(t);return this.shiftManipulator.events.emit("drag",{action:e.hasBeenDragged?"update":"start",pointerType:t.pointerType,start:i,screenPoint:i}),e.hasBeenDragged=!0,!0}return!1}_onPointerMove(t){this._lastCursorPosition.x=t.x,this._lastCursorPosition.y=t.y,this._resetPointerMoveTimeout(),"touch"!==t.pointerType&&this._updatePreviewPlane(bt(t),this._activeKeyModifiers)}_onCameraChange(){this._updatePreviewPlane(this._lastCursorPosition,this._activeKeyModifiers),this._updateManipulators()}_onPointerUp(t){if(t.pointerId===this._creatingPointerId&&null!=this.analysisViewData.plane){const e=bt(t);return this.shiftManipulator.events.emit("drag",{action:"end",start:e,screenPoint:e}),R(this.analysisViewData.plane,this._startPlane),this.inputState=null,!0}return!1}_onClickPlacePlane(t){if("exclude"===this.layersMode)return!1;if(this._isPlacingSlicePlane){const e=bt(t),a=x();if(this._pickPlane(e,!1,this._activeKeyModifiers,a)){if(R(a,this._startPlane),this.analysis.shape=at(a,this.view,this.view.spatialReference,new i),"pointer-drag"===t.type){const i=this._calculatePickRay(e);this.inputState=St(i,t.pointerId,a.origin,a)}return!0}}return!1}_onClickExcludeLayer(t){return!("exclude"!==this.layersMode||!this.created)&&(this.view.hitTest(bt(t)).then((t=>{if(t.results.length){const e=t.results[0],i="graphic"===e?.type&&e.graphic;if(i){const t=i.sourceLayer||i.layer;t&&this.analysis.excludedLayers.push(t)}}else t.ground.layer?this.analysis.excludedLayers.push(t.ground.layer):this.analysis.excludeGroundSurface=!0})),this._set("layersMode","none"),this.active&&(this.view.activeTool=null),!0)}_onKeyDown(t){return(t.key===Z||t.key===q)&&(this._activeKeyModifiers[t.key]=!0,null!=this._previewPlane&&this._updatePreviewPlane(this._lastCursorPosition,this._activeKeyModifiers),!0)}_onKeyUp(t){return!(t.key!==Z&&t.key!==q||!this._activeKeyModifiers[t.key])&&(delete this._activeKeyModifiers[t.key],null!=this._previewPlane&&this._updatePreviewPlane(this._lastCursorPosition,this._activeKeyModifiers),!0)}_onShiftGrab(t){if("start"!==t.action||null==this.analysisViewData.plane||!t.screenPoint)return;const e=this._calculatePickRay(t.screenPoint);R(this.analysisViewData.plane,this._startPlane),this.inputState=St(e,null,this.shiftManipulator.renderLocation,this.analysisViewData.plane)}_createShiftDragPipeline(t){return Vt(t,((t,e,i)=>{const a=this.inputState;if(null==a||"shift"!==a.type)return;const s=null!=this.analysisViewData.plane?R(this.analysisViewData.plane,x()):null;e.next(wt(this.view,a.shiftPlane)).next(this._shiftDragAdjustSensitivity(a)).next(this._shiftDragUpdatePlane(a)),i.next((()=>{null!=s&&this._updateBoundedPlane(s)}))}))}_shiftDragAdjustSensitivity(t){return e=>{if(null==this.analysisViewData.plane)return null;const i=.001,a=Math.min((1-Math.abs(w(I(this.analysisViewData.plane),e.ray.direction)/f(e.ray.direction)))/i,1),s=-j(this._startPlane.plane,e.renderEnd),n=-j(this._startPlane.plane,t.startPoint);return t.depth=t.depth*(1-a)+s*a-n,e}}_shiftDragUpdatePlane(t){return()=>{if(null==this.analysisViewData.plane)return;const e=M(A.get(),this._startPlane.origin),i=M(A.get(),I(this._startPlane));T(i,i,-t.depth),D(i,i,e);const a=C(i,this.analysisViewData.plane.basis1,this.analysisViewData.plane.basis2,x());this._updateBoundedPlane(a)}}_onRotateHeadingGrab(t){if("start"!==t.action||null==this.analysisViewData.plane||!t.screenPoint)return;const e=st(this.analysisViewData.plane,this.view.renderCoordsHelper,nt.HEADING,O()),i=this._calculatePickRay(t.screenPoint),a=S();z(e,i,a)&&(R(this.analysisViewData.plane,this._startPlane),this.inputState={type:"rotate",rotatePlane:e,startPoint:a})}_createRotateHeadingDragPipeline(t){return Vt(t,((t,e,i)=>{const a=this.inputState;if(null==a||"rotate"!==a.type)return;const s=null!=this.analysisViewData.plane?R(this.analysisViewData.plane,x()):null;e.next(wt(this.view,a.rotatePlane)).next(this._rotateDragRenderPlaneToRotate(a)).next(this._rotateDragUpdatePlaneFromRotate()),i.next((()=>{null!=s&&this._updateBoundedPlane(s)}))}))}_onRotateTiltGrab(t){if("start"!==t.action||null==this.analysisViewData.plane||!t.screenPoint)return;const e=st(this.analysisViewData.plane,this.view.renderCoordsHelper,nt.TILT,O()),i=this._calculatePickRay(t.screenPoint),a=S();z(e,i,a)&&(R(this.analysisViewData.plane,this._startPlane),this.inputState={type:"rotate",rotatePlane:e,startPoint:a})}_createRotateTiltDragPipeline(t){return Vt(t,((t,e,i)=>{const a=this.inputState;if(null==a||"rotate"!==a.type)return;const s=null!=this.analysisViewData.plane?R(this.analysisViewData.plane,x()):null;e.next(wt(this.view,a.rotatePlane)).next(this._rotateDragRenderPlaneToRotate(a)).next(this._rotateDragUpdatePlaneFromRotate()),i.next((()=>{null!=s&&this._updateBoundedPlane(s)}))}))}_rotateDragRenderPlaneToRotate(t){return e=>{if(null==this.analysisViewData.plane)return null;const i=G(t.rotatePlane),a=gt(t.startPoint,e.renderEnd,this.analysisViewData.plane.origin,i);return{...e,rotateAxis:i,rotateAngle:a}}}_rotateDragUpdatePlaneFromRotate(){return t=>{if(null==this.analysisViewData.plane)return;const e=y(L.get(),t.rotateAngle,t.rotateAxis);if(null==e)return;const i=V(A.get(),this._startPlane.basis1,e),a=V(A.get(),this._startPlane.basis2,e),s=C(this.analysisViewData.plane.origin,i,a,x());this._updateBoundedPlane(s)}}_onResizeGrab(t,e){if("start"!==t.action||null==this.analysisViewData.plane||!t.screenPoint)return;const i=this._calculatePickRay(t.screenPoint),a=A.get();z(this.analysisViewData.plane.plane,i,a)&&(R(this.analysisViewData.plane,this._startPlane),this.inputState={type:"resize",activeHandleIdx:e,startPoint:E(a)})}_createResizeDragPipeline(t){return Vt(t,((t,e,i)=>{const a=this.inputState;if(null==a||"resize"!==a.type||null==this.analysisViewData.plane)return;const s=R(this.analysisViewData.plane,x());e.next(wt(this.view,this.analysisViewData.plane.plane)).next(this._resizeDragUpdatePlane(a)),i.next((()=>{this._updateBoundedPlane(s)}))}))}_resizeDragUpdatePlane(t){return e=>{if(null==this.analysisViewData.plane)return;const i=this._resizeHandles[t.activeHandleIdx],a=rt(i,t.startPoint,e.renderEnd,this.view.state.camera,this._startPlane,R(this.analysisViewData.plane));this._updateBoundedPlane(a)}}_updateBoundedPlane(t){const e=this.analysisViewData;if(null==e)throw new Error("valid internal object expected");e.plane=t}_updatePreviewPlane(t,e={}){let i=this._previewPlane;if(this._previewPlane=null,null==t)return this._removeFrameTask(),void this._updateManipulators();if(!this.analysisViewData.plane&&this.active){const a=null!=i?i:x();if(i=null!=i?R(i,xt):null,this._pickPlane(t,!0,e,a)){const t=W;let e=!1;null!=i&&(e=w(i.plane,a.plane)<t||w(b(A.get(),i.basis1),b(A.get(),a.basis1))<t),e&&(this._previewPlaneOpacity=0),this._previewPlane=a}}null!=this._previewPlane&&null==this._frameTask&&0===this._previewPlaneOpacity?this._frameTask=u({update:({deltaTime:t})=>{this._previewPlaneOpacity=Math.min(this._previewPlaneOpacity+t/(1e3*J),1),this._updateManipulators(),1===this._previewPlaneOpacity&&this._removeFrameTask()}}):null==this._previewPlane&&null!=this._frameTask?this._removeFrameTask():null!=this._previewPlane&&this._updateManipulators()}_removeFrameTask(){this._frameTask=l(this._frameTask)}_calculatePickRay(t){const e=U(),i=d(t,Rt);return ft(this.view.state.camera,i,e),b(e.direction,e.direction),e}_pickMinResult(t){const e=d(t,B.get());return this.view.sceneIntersectionHelper.intersectToolIntersectorScreen(e,this._intersector),this._intersector.results.min}_pickPlane(t,e,i,a){const s=this._pickMinResult(t),n=A.get();if(!s.getIntersectionPoint(n))return!1;const r=s.getTransformedNormal(A.get()),l=this.view.state.camera;w(r,l.viewForward)>0&&T(r,r,-1);const o=lt(n,l),h=(e?1:-1)*o*Q,p=T(A.get(),r,h);D(p,p,n);const u=this.analysis.tiltEnabled?ot.TILTED:ot.HORIZONTAL_OR_VERTICAL,c=i[Z]?ot.VERTICAL:i[q]?ot.HORIZONTAL:u;return ht(p,r,o,o,l,c,this.view.renderCoordsHelper,a),!0}_clearPointerMoveTimeout(){this._prevPointerMoveTimeout=l(this._prevPointerMoveTimeout)}_resetPointerMoveTimeout(){this._clearPointerMoveTimeout(),this.shiftManipulator.state|=pt,this.rotateHeadingManipulator.state|=pt,this.rotateTiltManipulator.state|=pt,this._prevPointerMoveTimeout=this._clock.setTimeout((()=>{this.shiftManipulator.state&=~pt,this.rotateHeadingManipulator.state&=~pt,this.rotateTiltManipulator.state&=~pt}),this._pointerMoveTimerMs)}_updateManipulators(){if(kt.disableEngineLayers)return;let t,e=!1;if(null!=this.analysisViewData.plane)t=this.analysisViewData.plane,e=!1;else{if(null==this._previewPlane)return this.shiftManipulator.available=!1,this.rotateHeadingManipulator.available=!1,this.rotateTiltManipulator.available=!1,this.resizeManipulators.forEach((t=>t.available=!1)),this._previewPlaneOutlineVisualElement.visible=!1,void(this._previewPlaneGridVisualElement.visible=!1);t=this._previewPlane,e=!0}const i=ut(t,L.get());e?(this.shiftManipulator.available=!1,this.rotateHeadingManipulator.available=!1,this.rotateTiltManipulator.available=!1,this.resizeManipulators.forEach((t=>t.available=!1)),this._previewPlaneOutlineVisualElement.attached=!0,this._previewPlaneGridVisualElement.attached=!0,this._previewPlaneOutlineVisualElement.visible=!0,this._previewPlaneGridVisualElement.visible=!0):(this.shiftManipulator.available=!0,this.rotateHeadingManipulator.available=!0,this.rotateTiltManipulator.available=this.analysis.tiltEnabled,this.resizeManipulators.forEach((t=>t.available=!0)),ct(this.shiftManipulator,i,t,this.view.state.camera),dt(this.rotateHeadingManipulator,i,t,this.view.renderCoordsHelper),_t(this.rotateTiltManipulator,i,t),this.resizeManipulators.forEach(((e,a)=>vt(e,this._resizeHandles[a],i,t))),this._previewPlaneOutlineVisualElement.visible=!1,this._previewPlaneGridVisualElement.visible=!1);const a=k(A.get(),f(t.basis1),f(t.basis2),1),s=m(L.get(),a),n=g(s,i,s);this._previewPlaneOutlineVisualElement.transform=n,this._previewPlaneGridVisualElement.transform=n,this._updateMaterials()}_updateMaterials(){const t=e.toUnitRGBA(K.plane.outlineColor);t[3]*=this._previewPlaneOpacity;const i=e.toUnitRGBA(K.plane.color);i[3]*=this._previewPlaneOpacity,this._previewPlaneOutlineVisualElement.color=t,this._previewPlaneGridVisualElement.backgroundColor=i,this._previewPlaneGridVisualElement.gridColor=H}_updateManipulatorsInteractive(t){if(!t.grabbing)return this.shiftManipulator.interactive=!0,this.rotateHeadingManipulator.interactive=!0,this.rotateTiltManipulator.interactive=!0,void this.resizeManipulators.forEach((t=>{t.interactive=!0}));this.shiftManipulator.interactive=this.shiftManipulator===t,this.rotateHeadingManipulator.interactive=this.rotateHeadingManipulator===t,this.rotateTiltManipulator.interactive=this.rotateTiltManipulator===t,this.resizeManipulators.forEach((e=>{e.interactive=e===t}))}testData(){return{plane:this.analysisViewData.plane,setPointerMoveTimerMs:t=>{this._pointerMoveTimerMs=t}}}};function St(t,e,i,a){const s=Pt(i,I(a),t.direction,O()),n=S();return z(s,t,n)?{type:"shift",creatingPointerId:e,hasBeenDragged:!1,shiftPlane:s,depth:0,startPoint:n}:null}function Ht(t){return"mouse"!==t.pointerType||0===t.button}Et.disableEngineLayers=!1,t([v()],Et.prototype,"_clock",void 0),t([v({constructOnly:!0})],Et.prototype,"view",void 0),t([v()],Et.prototype,"analysisViewData",void 0),t([v({readOnly:!0})],Et.prototype,"state",null),t([v({readOnly:!0})],Et.prototype,"cursor",null),t([v()],Et.prototype,"analysis",null),t([v()],Et.prototype,"removeIncompleteOnCancel",void 0),t([v({readOnly:!0})],Et.prototype,"layersMode",void 0),t([v({value:null})],Et.prototype,"inputState",null),t([v()],Et.prototype,"_isPlacingSlicePlane",null),t([v()],Et.prototype,"_creatingPointerId",null),Et=kt=t([P("esri.views.3d.analysis.Slice.SliceTool")],Et);const xt=x(),Rt=_(),It=Et;export{It as default};
5
+ import{_ as t}from"../../../../chunks/tslib.es6.js";import e from"../../../../Color.js";import i from"../../../../analysis/SlicePlane.js";import{clock as a}from"../../../../core/clock.js";import s from"../../../../core/Handles.js";import{releaseMaybe as n,destroyMaybe as r,removeMaybe as l}from"../../../../core/maybe.js";import{watch as o,sync as h,syncAndInitial as p}from"../../../../core/reactiveUtils.js";import{addFrameTask as u}from"../../../../core/scheduling.js";import{createScreenPoint as c,screenPointObjectToArray as d,createScreenPointArray as _}from"../../../../core/screenUtils.js";import{property as v}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/accessorSupport/ensureType.js";import"../../../../core/arrayUtils.js";import"../../../../core/has.js";import{subclass as P}from"../../../../core/accessorSupport/decorators/subclass.js";import{d as y,E as m,m as g}from"../../../../chunks/mat4.js";import{e as w,l as f,c as M,g as T,a as D,m as V,n as b,s as k}from"../../../../chunks/vec3.js";import{a as E,c as S}from"../../../../chunks/vec3f64.js";import{Z as H}from"../../../../chunks/vec4f64.js";import{a as x,c as R,n as I,f as C}from"../../../../chunks/boundedPlane.js";import{signedDistance as j,create as O,intersectRay as z,normal as G}from"../../../../geometry/support/plane.js";import{create as U}from"../../../../geometry/support/ray.js";import{sv3d as A,sm4d as L,sv2d as B}from"../../../../geometry/support/vectorStacks.js";import{settings as K}from"./settings.js";import{POINTER_MOVE_TIMER_MS as F,PLANE_PREVIEW_OUTLINE_WIDTH as N,forceVerticalModifier as Z,forceHorizontalModifier as q,PREVIEW_FADE_DOT_THRESHOLD as W,PREVIEW_FADE_DURATION_SECONDS as J,INITIAL_DEPTH_OFFSET_FRAC as Q}from"./sliceToolConfig.js";import{createShiftManipulator as X,OffsetMode as Y,createRotateManipulator as $,createResizeManipulator as tt,createGridVisualElement as et,createOutlineVisualElement as it,planeToShape as at,createRotatePlane as st,RotationAxis as nt,resizePlane as rt,calculatePlaneHalfSize as lt,SliceOrientation as ot,createPlane as ht,DidPointerMoveRecentlyFlag as pt,calculateBoundedPlaneTranslateRotate as ut,updateShiftRestartHandle as ct,updateRotateHeadingHandle as dt,updateRotateTiltHandle as _t,updateResizeHandle as vt,createShiftPlane as Pt}from"./sliceToolUtils.js";import{getRotateHeadingTexture as yt,getTiltRotateTexture as mt}from"./images/Factory.js";import{calculateInputRotationTransform as gt}from"../../interactive/manipulatorUtils.js";import{screenToRenderPlane as wt}from"../../interactive/editingTools/dragEventPipeline3D.js";import{fromScreen as ft}from"../../support/geometryUtils/ray.js";import{newIntersector as Mt}from"../../webgl-engine/lib/Intersector.js";import{StoreResults as Tt}from"../../webgl-engine/lib/IntersectorInterfaces.js";import{AnalysisToolBase as Dt}from"../../../interactive/AnalysisToolBase.js";import{createManipulatorDragEventPipeline as Vt}from"../../../interactive/dragEventPipeline.js";import{createScreenPointFromEvent as bt}from"../../../support/screenUtils.js";var kt;let Et=kt=class extends Dt{constructor(t){super(t),this._clock=a,this._previewPlaneOpacity=1,this.removeIncompleteOnCancel=!1,this.layersMode="none",this.shiftManipulator=null,this.rotateHeadingManipulator=null,this.rotateTiltManipulator=null,this.resizeManipulators=null,this._handles=new s,this._viewHandles=new s,this._frameTask=null,this._pointerMoveTimerMs=F,this._prevPointerMoveTimeout=null,this._previewPlaneGridVisualElement=null,this._previewPlaneOutlineVisualElement=null,this._startPlane=x(),this._previewPlane=null,this._activeKeyModifiers={},this._lastCursorPosition=c(),this._resizeHandles=[{direction:[1,0]},{direction:[1,1]},{direction:[0,1]},{direction:[-1,1]},{direction:[-1,0]},{direction:[-1,-1]},{direction:[0,-1]},{direction:[1,-1]}],this._intersector=Mt(t.view.state.viewingMode),this._intersector.options.store=Tt.MIN}initialize(){if(null==this.analysis)throw new Error("SliceTool requires valid analysis, but null was provided.");const t=!this.view._stage?.renderView.renderingContext.driverTest.svgPremultipliesAlpha.result,e={accentColor:K.rotateManipulators.color,contrastColor:K.rotateManipulators.contrastColor,preMultiplyAlpha:t};this._rotateHeadingImage=yt(this.view.toolViewManager.textures,e),this._rotateTiltImage=mt(this.view.toolViewManager.textures,e);const i=t=>{this._updateManipulatorsInteractive(t),t.grabbing||(null!=this.analysisViewData.plane&&R(this.analysisViewData.plane,this._startPlane),this.inputState=null)};this.shiftManipulator=X(this.view,{offsetMode:Y.CENTER_ON_ARROW,calloutColor:K.callouts.color,color:K.shiftManipulator.color,outlineColor:K.shiftManipulator.outlineColor}),this.manipulators.add(this.shiftManipulator),this.shiftManipulator.events.on("grab-changed",(t=>{this._onShiftGrab(t),i(this.shiftManipulator)})),this._handles.add(this._createShiftDragPipeline(this.shiftManipulator)),this.rotateHeadingManipulator=$(this.view,this._rotateHeadingImage.texture),this.manipulators.add(this.rotateHeadingManipulator),this.rotateHeadingManipulator.events.on("grab-changed",(t=>{this._onRotateHeadingGrab(t),i(this.rotateHeadingManipulator)})),this._handles.add(this._createRotateHeadingDragPipeline(this.rotateHeadingManipulator)),this.rotateTiltManipulator=$(this.view,this._rotateTiltImage.texture),this.manipulators.add(this.rotateTiltManipulator),this.rotateTiltManipulator.events.on("grab-changed",(t=>{this._onRotateTiltGrab(t),i(this.rotateTiltManipulator)})),this._handles.add(this._createRotateTiltDragPipeline(this.rotateTiltManipulator)),this.resizeManipulators=this._resizeHandles.map(((t,e)=>{const a=tt(this.view,t,{color:K.resizeManipulators.color});return a.events.on("grab-changed",(t=>{this._onResizeGrab(t,e),i(a)})),this._handles.add(this._createResizeDragPipeline(a)),a})),this.manipulators.addMany(this.resizeManipulators),this._previewPlaneGridVisualElement=et(this.view),this._previewPlaneOutlineVisualElement=it(this.view),this._previewPlaneOutlineVisualElement.width=N,this._handles.add(o((()=>[this.analysisViewData.plane,this.analysis.tiltEnabled]),(()=>this._updateManipulators()),h));const a=o((()=>this.state),(t=>{"sliced"===t&&this.finishToolCreation()}),p);this._handles.add([a,o((()=>this.view.state.camera),(()=>this._onCameraChange()))])}destroy(){this._rotateHeadingImage=n(this._rotateHeadingImage),this._rotateTiltImage=n(this._rotateTiltImage),this._handles=r(this._handles),this._viewHandles=r(this._viewHandles),this._removeFrameTask(),this._clearPointerMoveTimeout(),this._previewPlaneOutlineVisualElement=r(this._previewPlaneOutlineVisualElement),this._previewPlaneGridVisualElement=r(this._previewPlaneGridVisualElement)}get state(){const t=!!this.analysisViewData.plane,e=!!this.inputState;return t?t&&e?"slicing":t&&!e?"sliced":"ready":"ready"}get cursor(){return this._isPlacingSlicePlane||"exclude"===this.layersMode?"crosshair":null!=this._creatingPointerId?"grabbing":null}set analysis(t){if(null==t)throw new Error("SliceTool requires valid analysis, but null was provided.");this._handles.remove("analysis"),this._set("analysis",t)}get inputState(){return this._get("inputState")}set inputState(t){this._set("inputState",t),this.analysisViewData.showGrid=null!=t&&"resize"===t.type,this._updateMaterials()}get _isPlacingSlicePlane(){return!this.inputState&&!this.analysisViewData.plane&&this.active}get _creatingPointerId(){return null!=this.inputState&&"shift"===this.inputState.type?this.inputState.creatingPointerId:null}enterExcludeLayerMode(){null!=this.analysisViewData.plane&&(this._set("layersMode","exclude"),this.active||(this.view.activeTool=this))}exitExcludeLayerMode(){null!=this.analysisViewData.plane&&(this._set("layersMode","none"),this.active&&(this.view.activeTool=null))}onDeactivate(){this._set("layersMode","none"),this._updatePreviewPlane(null)}onShow(){this._updateVisibility(!0)}onHide(){this._updateVisibility(!1)}_updateVisibility(t){this._updateManipulators(),t||this._clearPointerMoveTimeout()}onInputEvent(t){switch(t.type){case"pointer-drag":if(!Ht(t))return;this._isPlacingSlicePlane?this._onClickPlacePlane(t)&&t.stopPropagation():this._onPointerDrag(t)&&t.stopPropagation();break;case"pointer-move":this._onPointerMove(t);break;case"pointer-up":this._onPointerUp(t)&&t.stopPropagation();break;case"immediate-click":if(!Ht(t))return;this._onClickPlacePlane(t)&&t.stopPropagation();break;case"click":if(!Ht(t))return;this._onClickExcludeLayer(t)&&t.stopPropagation();break;case"drag":this.inputState&&t.stopPropagation();break;case"key-down":this._onKeyDown(t)&&t.stopPropagation();break;case"key-up":this._onKeyUp(t)&&t.stopPropagation()}}onEditableChange(){this.analysisViewData.editable=this.internallyEditable}_onPointerDrag(t){const e=this.inputState;if(t.pointerId===this._creatingPointerId&&null!=e&&"shift"===e.type){const i=bt(t);return this.shiftManipulator.events.emit("drag",{action:e.hasBeenDragged?"update":"start",pointerType:t.pointerType,start:i,screenPoint:i}),e.hasBeenDragged=!0,!0}return!1}_onPointerMove(t){this._lastCursorPosition.x=t.x,this._lastCursorPosition.y=t.y,this._resetPointerMoveTimeout(),"touch"!==t.pointerType&&this._updatePreviewPlane(bt(t),this._activeKeyModifiers)}_onCameraChange(){this._updatePreviewPlane(this._lastCursorPosition,this._activeKeyModifiers),this._updateManipulators()}_onPointerUp(t){if(t.pointerId===this._creatingPointerId&&null!=this.analysisViewData.plane){const e=bt(t);return this.shiftManipulator.events.emit("drag",{action:"end",start:e,screenPoint:e}),R(this.analysisViewData.plane,this._startPlane),this.inputState=null,!0}return!1}_onClickPlacePlane(t){if("exclude"===this.layersMode)return!1;if(this._isPlacingSlicePlane){const e=bt(t),a=x();if(this._pickPlane(e,!1,this._activeKeyModifiers,a)){if("pointer-drag"===t.type){const i=this._calculatePickRay(e);this.inputState=St(i,t.pointerId,a.origin,a)}return R(a,this._startPlane),this.analysis.shape=at(a,this.view,this.view.spatialReference,new i),!0}}return!1}_onClickExcludeLayer(t){return!("exclude"!==this.layersMode||!this.created)&&(this.view.hitTest(bt(t)).then((t=>{if(t.results.length){const e=t.results[0],i="graphic"===e?.type&&e.graphic;if(i){const t=i.sourceLayer||i.layer;t&&this.analysis.excludedLayers.push(t)}}else t.ground.layer?this.analysis.excludedLayers.push(t.ground.layer):this.analysis.excludeGroundSurface=!0})),this._set("layersMode","none"),this.active&&(this.view.activeTool=null),!0)}_onKeyDown(t){return(t.key===Z||t.key===q)&&(this._activeKeyModifiers[t.key]=!0,null!=this._previewPlane&&this._updatePreviewPlane(this._lastCursorPosition,this._activeKeyModifiers),!0)}_onKeyUp(t){return!(t.key!==Z&&t.key!==q||!this._activeKeyModifiers[t.key])&&(delete this._activeKeyModifiers[t.key],null!=this._previewPlane&&this._updatePreviewPlane(this._lastCursorPosition,this._activeKeyModifiers),!0)}_onShiftGrab(t){if("start"!==t.action||null==this.analysisViewData.plane||!t.screenPoint)return;const e=this._calculatePickRay(t.screenPoint);R(this.analysisViewData.plane,this._startPlane),this.inputState=St(e,null,this.shiftManipulator.renderLocation,this.analysisViewData.plane)}_createShiftDragPipeline(t){return Vt(t,((t,e,i)=>{const a=this.inputState;if(null==a||"shift"!==a.type)return;const s=null!=this.analysisViewData.plane?R(this.analysisViewData.plane,x()):null;e.next(wt(this.view,a.shiftPlane)).next(this._shiftDragAdjustSensitivity(a)).next(this._shiftDragUpdatePlane(a)),i.next((()=>{null!=s&&this._updateBoundedPlane(s)}))}))}_shiftDragAdjustSensitivity(t){return e=>{if(null==this.analysisViewData.plane)return null;const i=.001,a=Math.min((1-Math.abs(w(I(this.analysisViewData.plane),e.ray.direction)/f(e.ray.direction)))/i,1),s=-j(this._startPlane.plane,e.renderEnd),n=-j(this._startPlane.plane,t.startPoint);return t.depth=t.depth*(1-a)+s*a-n,e}}_shiftDragUpdatePlane(t){return()=>{if(null==this.analysisViewData.plane)return;const e=M(A.get(),this._startPlane.origin),i=M(A.get(),I(this._startPlane));T(i,i,-t.depth),D(i,i,e);const a=C(i,this.analysisViewData.plane.basis1,this.analysisViewData.plane.basis2,x());this._updateBoundedPlane(a)}}_onRotateHeadingGrab(t){if("start"!==t.action||null==this.analysisViewData.plane||!t.screenPoint)return;const e=st(this.analysisViewData.plane,this.view.renderCoordsHelper,nt.HEADING,O()),i=this._calculatePickRay(t.screenPoint),a=S();z(e,i,a)&&(R(this.analysisViewData.plane,this._startPlane),this.inputState={type:"rotate",rotatePlane:e,startPoint:a})}_createRotateHeadingDragPipeline(t){return Vt(t,((t,e,i)=>{const a=this.inputState;if(null==a||"rotate"!==a.type)return;const s=null!=this.analysisViewData.plane?R(this.analysisViewData.plane,x()):null;e.next(wt(this.view,a.rotatePlane)).next(this._rotateDragRenderPlaneToRotate(a)).next(this._rotateDragUpdatePlaneFromRotate()),i.next((()=>{null!=s&&this._updateBoundedPlane(s)}))}))}_onRotateTiltGrab(t){if("start"!==t.action||null==this.analysisViewData.plane||!t.screenPoint)return;const e=st(this.analysisViewData.plane,this.view.renderCoordsHelper,nt.TILT,O()),i=this._calculatePickRay(t.screenPoint),a=S();z(e,i,a)&&(R(this.analysisViewData.plane,this._startPlane),this.inputState={type:"rotate",rotatePlane:e,startPoint:a})}_createRotateTiltDragPipeline(t){return Vt(t,((t,e,i)=>{const a=this.inputState;if(null==a||"rotate"!==a.type)return;const s=null!=this.analysisViewData.plane?R(this.analysisViewData.plane,x()):null;e.next(wt(this.view,a.rotatePlane)).next(this._rotateDragRenderPlaneToRotate(a)).next(this._rotateDragUpdatePlaneFromRotate()),i.next((()=>{null!=s&&this._updateBoundedPlane(s)}))}))}_rotateDragRenderPlaneToRotate(t){return e=>{if(null==this.analysisViewData.plane)return null;const i=G(t.rotatePlane),a=gt(t.startPoint,e.renderEnd,this.analysisViewData.plane.origin,i);return{...e,rotateAxis:i,rotateAngle:a}}}_rotateDragUpdatePlaneFromRotate(){return t=>{if(null==this.analysisViewData.plane)return;const e=y(L.get(),t.rotateAngle,t.rotateAxis);if(null==e)return;const i=V(A.get(),this._startPlane.basis1,e),a=V(A.get(),this._startPlane.basis2,e),s=C(this.analysisViewData.plane.origin,i,a,x());this._updateBoundedPlane(s)}}_onResizeGrab(t,e){if("start"!==t.action||null==this.analysisViewData.plane||!t.screenPoint)return;const i=this._calculatePickRay(t.screenPoint),a=A.get();z(this.analysisViewData.plane.plane,i,a)&&(R(this.analysisViewData.plane,this._startPlane),this.inputState={type:"resize",activeHandleIdx:e,startPoint:E(a)})}_createResizeDragPipeline(t){return Vt(t,((t,e,i)=>{const a=this.inputState;if(null==a||"resize"!==a.type||null==this.analysisViewData.plane)return;const s=R(this.analysisViewData.plane,x());e.next(wt(this.view,this.analysisViewData.plane.plane)).next(this._resizeDragUpdatePlane(a)),i.next((()=>{this._updateBoundedPlane(s)}))}))}_resizeDragUpdatePlane(t){return e=>{if(null==this.analysisViewData.plane)return;const i=this._resizeHandles[t.activeHandleIdx],a=rt(i,t.startPoint,e.renderEnd,this.view.state.camera,this._startPlane,R(this.analysisViewData.plane));this._updateBoundedPlane(a)}}_updateBoundedPlane(t){const e=this.analysisViewData;if(null==e)throw new Error("valid internal object expected");e.plane=t}_updatePreviewPlane(t,e={}){let i=this._previewPlane;if(this._previewPlane=null,null==t)return this._removeFrameTask(),void this._updateManipulators();if(!this.analysisViewData.plane&&this.active){const a=null!=i?i:x();if(i=null!=i?R(i,xt):null,this._pickPlane(t,!0,e,a)){const t=W;let e=!1;null!=i&&(e=w(i.plane,a.plane)<t||w(b(A.get(),i.basis1),b(A.get(),a.basis1))<t),e&&(this._previewPlaneOpacity=0),this._previewPlane=a}}null!=this._previewPlane&&null==this._frameTask&&0===this._previewPlaneOpacity?this._frameTask=u({update:({deltaTime:t})=>{this._previewPlaneOpacity=Math.min(this._previewPlaneOpacity+t/(1e3*J),1),this._updateManipulators(),1===this._previewPlaneOpacity&&this._removeFrameTask()}}):null==this._previewPlane&&null!=this._frameTask?this._removeFrameTask():null!=this._previewPlane&&this._updateManipulators()}_removeFrameTask(){this._frameTask=l(this._frameTask)}_calculatePickRay(t){const e=U(),i=d(t,Rt);return ft(this.view.state.camera,i,e),b(e.direction,e.direction),e}_pickMinResult(t){const e=d(t,B.get());return this.view.sceneIntersectionHelper.intersectToolIntersectorScreen(e,this._intersector),this._intersector.results.min}_pickPlane(t,e,i,a){const s=this._pickMinResult(t),n=A.get();if(!s.getIntersectionPoint(n))return!1;const r=s.getTransformedNormal(A.get()),l=this.view.state.camera;w(r,l.viewForward)>0&&T(r,r,-1);const o=lt(n,l),h=(e?1:-1)*o*Q,p=T(A.get(),r,h);D(p,p,n);const u=this.analysis.tiltEnabled?ot.TILTED:ot.HORIZONTAL_OR_VERTICAL,c=i[Z]?ot.VERTICAL:i[q]?ot.HORIZONTAL:u;return ht(p,r,o,o,l,c,this.view.renderCoordsHelper,a),!0}_clearPointerMoveTimeout(){this._prevPointerMoveTimeout=l(this._prevPointerMoveTimeout)}_resetPointerMoveTimeout(){this._clearPointerMoveTimeout(),this.shiftManipulator.state|=pt,this.rotateHeadingManipulator.state|=pt,this.rotateTiltManipulator.state|=pt,this._prevPointerMoveTimeout=this._clock.setTimeout((()=>{this.shiftManipulator.state&=~pt,this.rotateHeadingManipulator.state&=~pt,this.rotateTiltManipulator.state&=~pt}),this._pointerMoveTimerMs)}_updateManipulators(){if(kt.disableEngineLayers)return;let t,e=!1;if(null!=this.analysisViewData.plane)t=this.analysisViewData.plane,e=!1;else{if(null==this._previewPlane)return this.shiftManipulator.available=!1,this.rotateHeadingManipulator.available=!1,this.rotateTiltManipulator.available=!1,this.resizeManipulators.forEach((t=>t.available=!1)),this._previewPlaneOutlineVisualElement.visible=!1,void(this._previewPlaneGridVisualElement.visible=!1);t=this._previewPlane,e=!0}const i=ut(t,L.get());e?(this.shiftManipulator.available=!1,this.rotateHeadingManipulator.available=!1,this.rotateTiltManipulator.available=!1,this.resizeManipulators.forEach((t=>t.available=!1)),this._previewPlaneOutlineVisualElement.attached=!0,this._previewPlaneGridVisualElement.attached=!0,this._previewPlaneOutlineVisualElement.visible=!0,this._previewPlaneGridVisualElement.visible=!0):(this.shiftManipulator.available=!0,this.rotateHeadingManipulator.available=!0,this.rotateTiltManipulator.available=this.analysis.tiltEnabled,this.resizeManipulators.forEach((t=>t.available=!0)),ct(this.shiftManipulator,i,t,this.view.state.camera),dt(this.rotateHeadingManipulator,i,t,this.view.renderCoordsHelper),_t(this.rotateTiltManipulator,i,t),this.resizeManipulators.forEach(((e,a)=>vt(e,this._resizeHandles[a],i,t))),this._previewPlaneOutlineVisualElement.visible=!1,this._previewPlaneGridVisualElement.visible=!1);const a=k(A.get(),f(t.basis1),f(t.basis2),1),s=m(L.get(),a),n=g(s,i,s);this._previewPlaneOutlineVisualElement.transform=n,this._previewPlaneGridVisualElement.transform=n,this._updateMaterials()}_updateMaterials(){const t=e.toUnitRGBA(K.plane.outlineColor);t[3]*=this._previewPlaneOpacity;const i=e.toUnitRGBA(K.plane.color);i[3]*=this._previewPlaneOpacity,this._previewPlaneOutlineVisualElement.color=t,this._previewPlaneGridVisualElement.backgroundColor=i,this._previewPlaneGridVisualElement.gridColor=H}_updateManipulatorsInteractive(t){if(!t.grabbing)return this.shiftManipulator.interactive=!0,this.rotateHeadingManipulator.interactive=!0,this.rotateTiltManipulator.interactive=!0,void this.resizeManipulators.forEach((t=>{t.interactive=!0}));this.shiftManipulator.interactive=this.shiftManipulator===t,this.rotateHeadingManipulator.interactive=this.rotateHeadingManipulator===t,this.rotateTiltManipulator.interactive=this.rotateTiltManipulator===t,this.resizeManipulators.forEach((e=>{e.interactive=e===t}))}testData(){return{plane:this.analysisViewData.plane,setPointerMoveTimerMs:t=>{this._pointerMoveTimerMs=t}}}};function St(t,e,i,a){const s=Pt(i,I(a),t.direction,O()),n=S();return z(s,t,n)?{type:"shift",creatingPointerId:e,hasBeenDragged:!1,shiftPlane:s,depth:0,startPoint:n}:null}function Ht(t){return"mouse"!==t.pointerType||0===t.button}Et.disableEngineLayers=!1,t([v()],Et.prototype,"_clock",void 0),t([v({constructOnly:!0})],Et.prototype,"view",void 0),t([v()],Et.prototype,"analysisViewData",void 0),t([v({readOnly:!0})],Et.prototype,"state",null),t([v({readOnly:!0})],Et.prototype,"cursor",null),t([v()],Et.prototype,"analysis",null),t([v()],Et.prototype,"removeIncompleteOnCancel",void 0),t([v({readOnly:!0})],Et.prototype,"layersMode",void 0),t([v({value:null})],Et.prototype,"inputState",null),t([v()],Et.prototype,"_isPlacingSlicePlane",null),t([v()],Et.prototype,"_creatingPointerId",null),Et=kt=t([P("esri.views.3d.analysis.Slice.SliceTool")],Et);const xt=x(),Rt=_(),It=Et;export{It 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.27/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../../chunks/tslib.es6.js";import{handlesGroup as t,makeHandle as i}from"../../../../../core/handleUtils.js";import{applySome as s,destroyMaybe as r}from"../../../../../core/maybe.js";import{watch as n,initial as a}from"../../../../../core/reactiveUtils.js";import{property as o}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/accessorSupport/ensureType.js";import"../../../../../core/arrayUtils.js";import"../../../../../core/has.js";import{subclass as l}from"../../../../../core/accessorSupport/decorators/subclass.js";import{s as c}from"../../../../../chunks/vec3.js";import{c as p}from"../../../../../chunks/vec3f64.js";import{getEffectiveElevationInfo as h,getEffectiveElevationMode as u}from"../../../../../support/elevationInfoUtils.js";import m from"../../../../../symbols/support/ElevationInfo.js";import{SegmentLabels3D as d}from"../../SegmentLabels3D.js";import{SnappingVisualizer3D as v}from"../../SnappingVisualizer3D.js";import{getSettings as f}from"../settings.js";import{ExtendedLineVisualElement as V}from"../../visualElements/ExtendedLineVisualElement.js";import{OutlineVisualElement as E}from"../../visualElements/OutlineVisualElement.js";import{VerticesVisualElement as y}from"../../visualElements/VerticesVisualElement.js";import{evaluateElevationAlignmentAtPoint as w}from"../../../layers/graphics/elevationAlignmentUtils.js";import{ElevationContext as _}from"../../../layers/graphics/ElevationContext.js";import{GraphicState as g}from"../../../layers/graphics/GraphicState.js";import{RenderOccludedFlag as j}from"../../../webgl-engine/lib/Material.js";import{DrawGraphicTool as G,geometryTypeToDrawOperationGeometryType as S}from"../../../../draw/DrawGraphicTool.js";import{DrawOperation as I}from"../../../../draw/DrawOperation.js";import{SceneDrawSurface as L,ElevationDrawSurface as D}from"../../../../draw/drawSurfaces.js";import{unitRGBAFromColor as O}from"../../../../support/colorUtils.js";let x=class extends G{constructor(e){super(e),this._activeVertexVisualElement=null,this._createGraphicState=null,this._outlineVisualElement=null,this._verticesVisualElement=null,this._verticalLineVisualElement=null,this.geometryType=null,this.type="draw-3d"}initialize(){const{mode:e,offset:t}=this.elevationInfo;this.internalGraphicsLayer.elevationInfo=new m({mode:e,offset:t})}normalizeCtorArgs(e){if(!e.elevationInfo){const t=e.hasZ??!0;return{...e,elevationInfo:h(t)}}return e}initializeGraphic(e){const i=this._createGraphicState=new g({graphic:e});return t([this.view.maskOccludee(e),this.view.trackGraphicState(i),n((()=>({element:this._outlineVisualElement,isDraped:i.isDraped})),(({element:e,isDraped:t})=>{s(e,(e=>e.isDraped=t))}),a)])}makeDrawOperation(){const{geometryType:e}=this,t="circle"!==e&&"rectangle"!==e;return new I({view:this.view,manipulators:this.manipulators,geometryType:S(e),drawingMode:this.mode,hasZ:this.hasZ,defaultZ:this.defaultZ,snapToSceneEnabled:this.snapToScene,drawSurface:new L(this.view,this.elevationInfo,[this.internalGraphicsLayer]),elevationDrawSurface:new D(this.elevationInfo,this.defaultZ,this.view,this.internalGraphicsLayer),hasM:!1,elevationInfo:this.elevationInfo,snappingManager:this.snappingManager,snappingVisualizer:new v,segmentLabels:t?new d:null,labelOptions:this.labelOptions,tooltipOptions:this.tooltipOptions,isDraped:this._createGraphicState?this._createGraphicState.isDraped:"on-the-ground"===u(this.hasZ,this.elevationInfo)})}onActiveVertexChanged(e){const{view:t}=this,s=f(t);if(this._activeVertexVisualElement)return this._activeVertexVisualElement.vertices=[e],this._updateVerticalLineVisualElement(e),null;const n=s.manipulators,a=n.vertex;this._activeVertexVisualElement=new y({view:t,spatialReference:t.spatialReference,vertices:[e],elevationInfo:this.internalGraphicsLayer.elevationInfo,color:O(a.color),size:a.size,outlineColor:O(a.outlineColor),outlineSize:a.outlineSize,renderOccluded:a.renderOccluded,attached:!1}),this._activeVertexVisualElement.color=O(n.selected.color),this._activeVertexVisualElement.attached=!0;const o=s.visualElements.zVerticalLine;return this._verticalLineVisualElement=new V({view:t,extensionType:o.extensionType,innerWidth:1,attached:!1,writeDepthEnabled:!1,renderOccluded:j.OccludeAndTransparent}),o.apply(this._verticalLineVisualElement),i((()=>{this._activeVertexVisualElement=r(this._activeVertexVisualElement),this._verticalLineVisualElement=r(this._verticalLineVisualElement)}))}_updateVerticalLineVisualElement(e){const t=this._verticalLineVisualElement;if(!t)return;const{renderCoordsHelper:i,elevationProvider:s}=this.view;c(z,e[0],e[1],e[2]),T.setFromElevationInfo(this.elevationInfo),z[2]=w(z,s,T,i);i.toRenderCoords(z,this.view.spatialReference,z)?(t.setStartEndFromWorldDownAtLocation(z),t.attached=!0):t.attached=!1}onOutlineChanged(e){if(this._outlineVisualElement)return this._outlineVisualElement.geometry=e,null;const t=this.internalGraphicsLayer.elevationInfo,{view:s}=this,n=f(s);return this._outlineVisualElement=new E({view:s,geometry:e,elevationInfo:t,isDraped:this._createGraphicState?this._createGraphicState.isDraped:"on-the-ground"===u(this.hasZ,t),attached:!1}),n.visualElements.lineGraphics.outline.apply(this._outlineVisualElement),n.visualElements.lineGraphics.shadowStyle.apply(this._outlineVisualElement),this._outlineVisualElement.attached=!0,this._outlineVisualElement.laserlineEnabled=!0,i((()=>{this._outlineVisualElement=r(this._outlineVisualElement)}))}onRegularVerticesChanged(e){if(this._verticesVisualElement)return this._verticesVisualElement.vertices=e,null;const{view:t}=this,s=f(t).manipulators.vertex;return this._verticesVisualElement=new y({view:t,spatialReference:t.spatialReference,vertices:e,elevationInfo:this.internalGraphicsLayer.elevationInfo,color:O(s.color),size:s.size,outlineColor:O(s.outlineColor),outlineSize:s.outlineSize,renderOccluded:s.renderOccluded,attached:!1}),this._verticesVisualElement.attached=!0,i((()=>{this._verticesVisualElement=r(this._verticesVisualElement)}))}_updateGraphicGeometry(e,t){if("mesh"===this.geometryType&&"point"===t?.type){const i=this.geometryToPlace;return"mesh"===i?.type&&i.centerAt(t),e.geometry=i,void e.notifyGeometryChanged()}super._updateGraphicGeometry(e,t)}};e([o({constructOnly:!0})],x.prototype,"elevationInfo",void 0),e([o({constructOnly:!0})],x.prototype,"geometryType",void 0),e([o()],x.prototype,"type",void 0),e([o({constructOnly:!0})],x.prototype,"view",void 0),x=e([l("esri.views.3d.interactive.editingTools.draw.DrawGraphicTool3D")],x);const T=new _,z=p();export{x as DrawGraphicTool3D};
5
+ import{_ as e}from"../../../../../chunks/tslib.es6.js";import{handlesGroup as t,makeHandle as i}from"../../../../../core/handleUtils.js";import{applySome as s,destroyMaybe as r}from"../../../../../core/maybe.js";import{watch as n,when as a,syncAndInitial as o,initial as l}from"../../../../../core/reactiveUtils.js";import{property as c}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/accessorSupport/ensureType.js";import"../../../../../core/arrayUtils.js";import"../../../../../core/has.js";import{subclass as p}from"../../../../../core/accessorSupport/decorators/subclass.js";import{s as h}from"../../../../../chunks/vec3.js";import{c as m}from"../../../../../chunks/vec3f64.js";import{getEffectiveElevationInfo as u,getEffectiveElevationMode as d}from"../../../../../support/elevationInfoUtils.js";import v from"../../../../../symbols/support/ElevationInfo.js";import{SegmentLabels3D as f}from"../../SegmentLabels3D.js";import{SnappingVisualizer3D as V}from"../../SnappingVisualizer3D.js";import{tryEnableMeshTransformFastUpdates as y,tryDisableMeshTransformFastUpdates as E}from"../meshFastUpdateUtils.js";import{getSettings as w}from"../settings.js";import{ExtendedLineVisualElement as _}from"../../visualElements/ExtendedLineVisualElement.js";import{OutlineVisualElement as g}from"../../visualElements/OutlineVisualElement.js";import{VerticesVisualElement as j}from"../../visualElements/VerticesVisualElement.js";import{evaluateElevationAlignmentAtPoint as G}from"../../../layers/graphics/elevationAlignmentUtils.js";import{ElevationContext as S}from"../../../layers/graphics/ElevationContext.js";import{GraphicState as I}from"../../../layers/graphics/GraphicState.js";import{RenderOccludedFlag as L}from"../../../webgl-engine/lib/Material.js";import{DrawGraphicTool as D,geometryTypeToDrawOperationGeometryType as O}from"../../../../draw/DrawGraphicTool.js";import{DrawOperation as x}from"../../../../draw/DrawOperation.js";import{SceneDrawSurface as T,ElevationDrawSurface as z}from"../../../../draw/drawSurfaces.js";import{unitRGBAFromColor as b}from"../../../../support/colorUtils.js";let C=class extends D{constructor(e){super(e),this._activeVertexVisualElement=null,this._createGraphicState=null,this._outlineVisualElement=null,this._verticesVisualElement=null,this._verticalLineVisualElement=null,this.geometryType=null,this.type="draw-3d"}initialize(){const{mode:e,offset:t}=this.elevationInfo;this.internalGraphicsLayer.elevationInfo=new v({mode:e,offset:t})}normalizeCtorArgs(e){if(!e.elevationInfo){const t=e.hasZ??!0;return{...e,elevationInfo:u(t)}}return e}initializeGraphic(e){const r=this._createGraphicState=new I({graphic:e});return t([this.view.maskOccludee(e),this.view.trackGraphicState(r),n((()=>({element:this._outlineVisualElement,isDraped:r.isDraped})),(({element:e,isDraped:t})=>{s(e,(e=>e.isDraped=t))}),l),a((()=>r.displaying),(()=>{y(e),this.addHandles(i((()=>E(e))))}),{...o,once:!0})])}makeDrawOperation(){const{geometryType:e}=this,t="circle"!==e&&"rectangle"!==e;return new x({view:this.view,manipulators:this.manipulators,geometryType:O(e),drawingMode:this.mode,hasZ:this.hasZ,defaultZ:this.defaultZ,snapToSceneEnabled:this.snapToScene,drawSurface:new T(this.view,this.elevationInfo,[this.internalGraphicsLayer]),elevationDrawSurface:new z(this.elevationInfo,this.defaultZ,this.view,this.internalGraphicsLayer),hasM:!1,elevationInfo:this.elevationInfo,snappingManager:this.snappingManager,snappingVisualizer:new V,segmentLabels:t?new f:null,labelOptions:this.labelOptions,tooltipOptions:this.tooltipOptions,isDraped:this._createGraphicState?this._createGraphicState.isDraped:"on-the-ground"===d(this.hasZ,this.elevationInfo)})}onActiveVertexChanged(e){const{view:t}=this,s=w(t);if(this._activeVertexVisualElement)return this._activeVertexVisualElement.vertices=[e],this._updateVerticalLineVisualElement(e),null;const n=s.manipulators,a=n.vertex;this._activeVertexVisualElement=new j({view:t,spatialReference:t.spatialReference,vertices:[e],elevationInfo:this.internalGraphicsLayer.elevationInfo,color:b(a.color),size:a.size,outlineColor:b(a.outlineColor),outlineSize:a.outlineSize,renderOccluded:a.renderOccluded,attached:!1}),this._activeVertexVisualElement.color=b(n.selected.color),this._activeVertexVisualElement.attached=!0;const o=s.visualElements.zVerticalLine;return this._verticalLineVisualElement=new _({view:t,extensionType:o.extensionType,innerWidth:1,attached:!1,writeDepthEnabled:!1,renderOccluded:L.OccludeAndTransparent}),o.apply(this._verticalLineVisualElement),i((()=>{this._activeVertexVisualElement=r(this._activeVertexVisualElement),this._verticalLineVisualElement=r(this._verticalLineVisualElement)}))}_updateVerticalLineVisualElement(e){const t=this._verticalLineVisualElement;if(!t)return;const{renderCoordsHelper:i,elevationProvider:s}=this.view;h(Z,e[0],e[1],e[2]),U.setFromElevationInfo(this.elevationInfo),Z[2]=G(Z,s,U,i);i.toRenderCoords(Z,this.view.spatialReference,Z)?(t.setStartEndFromWorldDownAtLocation(Z),t.attached=!0):t.attached=!1}onOutlineChanged(e){if(this._outlineVisualElement)return this._outlineVisualElement.geometry=e,null;const t=this.internalGraphicsLayer.elevationInfo,{view:s}=this,n=w(s);return this._outlineVisualElement=new g({view:s,geometry:e,elevationInfo:t,isDraped:this._createGraphicState?this._createGraphicState.isDraped:"on-the-ground"===d(this.hasZ,t),attached:!1}),n.visualElements.lineGraphics.outline.apply(this._outlineVisualElement),n.visualElements.lineGraphics.shadowStyle.apply(this._outlineVisualElement),this._outlineVisualElement.attached=!0,this._outlineVisualElement.laserlineEnabled=!0,i((()=>{this._outlineVisualElement=r(this._outlineVisualElement)}))}onRegularVerticesChanged(e){if(this._verticesVisualElement)return this._verticesVisualElement.vertices=e,null;const{view:t}=this,s=w(t).manipulators.vertex;return this._verticesVisualElement=new j({view:t,spatialReference:t.spatialReference,vertices:e,elevationInfo:this.internalGraphicsLayer.elevationInfo,color:b(s.color),size:s.size,outlineColor:b(s.outlineColor),outlineSize:s.outlineSize,renderOccluded:s.renderOccluded,attached:!1}),this._verticesVisualElement.attached=!0,i((()=>{this._verticesVisualElement=r(this._verticesVisualElement)}))}_updateGraphicGeometry(e,t){if("mesh"===this.geometryType&&"point"===t?.type){const i=this.geometryToPlace;return i&&i.centerAt(t),void(i&&e.geometry===i?i.transform?.geographic?e.notifyMeshTransformChanged():e.notifyGeometryChanged():e.geometry=i)}super._updateGraphicGeometry(e,t)}};e([c({constructOnly:!0})],C.prototype,"elevationInfo",void 0),e([c({constructOnly:!0})],C.prototype,"geometryType",void 0),e([c()],C.prototype,"type",void 0),e([c({constructOnly:!0})],C.prototype,"view",void 0),C=e([p("esri.views.3d.interactive.editingTools.draw.DrawGraphicTool3D")],C);const U=new S,Z=m();export{C as DrawGraphicTool3D};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
4
  */
5
- import{_ as t}from"../../../../../chunks/tslib.es6.js";import i from"../../../../../core/Collection.js";import e from"../../../../../core/Evented.js";import{HandleOwnerMixin as o}from"../../../../../core/HandleOwner.js";import{makeHandle as a}from"../../../../../core/handleUtils.js";import{destroyMaybe as n}from"../../../../../core/maybe.js";import{scale as s,zeroMeters as r}from"../../../../../core/quantityUtils.js";import{watch as p,when as l,syncAndInitial as h}from"../../../../../core/reactiveUtils.js";import{property as c}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/accessorSupport/ensureType.js";import"../../../../../core/arrayUtils.js";import"../../../../../core/has.js";import{subclass as u}from"../../../../../core/accessorSupport/decorators/subclass.js";import{makeDehydratedPoint as m}from"../../../../../layers/graphics/dehydratedFeatures.js";import{getGraphicEffectiveElevationInfo as d,getConvertedElevation as g}from"../../../../../support/elevationInfoUtils.js";import{getGraphicAttachmentOrigin as v}from"../../manipulatorUtils.js";import{SnappingVisualizer3D as f}from"../../SnappingVisualizer3D.js";import{SupportedGraphicResult as M}from"../isSupportedGraphicUtils.js";import{canMoveZ as y}from"../manipulatorUtils.js";import{tryDisableMeshTransformFastUpdates as _,tryEnableMeshTransformFastUpdates as w}from"../meshFastUpdateUtils.js";import{createVisualElements as j}from"../visualElementUtils.js";import{DISC_RADIUS as b}from"../manipulations/config.js";import{ManipulationType as x,MoveManipulation as S}from"../manipulations/MoveManipulation.js";import{shapeOrientation as E,axisConstrainedDragSign as T}from"../manipulations/moveUtils.js";import{MoveXYGraphicManipulation as O}from"../manipulations/MoveXYGraphicManipulation.js";import{isSupportedGraphic as U}from"./isSupportedGraphic.js";import{OutlineVisualElement as D}from"../../visualElements/OutlineVisualElement.js";import{GraphicState as X}from"../../../layers/graphics/GraphicState.js";import{dragGraphicMany as A,resetGraphicMany as G}from"../../../../interactive/dragEventPipeline.js";import{InteractiveToolBase as Y}from"../../../../interactive/InteractiveToolBase.js";import{EditGeometryOperations as z}from"../../../../interactive/editGeometry/EditGeometryOperations.js";import P from"../../../../interactive/sketch/SketchTooltipOptions.js";import{SnappingContext as k}from"../../../../interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as I}from"../../../../interactive/snapping/SnappingDragPipelineStep.js";import{Tooltip as R}from"../../../../interactive/tooltip/Tooltip.js";import{TranslateGraphicTooltipInfo as F,TranslateGraphicZTooltipInfo as H,TranslateGraphicXYTooltipInfo as Z}from"../../../../interactive/tooltip/TranslateTooltipInfos.js";import{autoHorizontalDistanceByElevationModeBetweenPoints as C}from"../../../../support/automaticLengthMeasurementUtils.js";import{verticalSignedDistanceBetweenPoints as V}from"../../../../support/euclideanLengthMeasurementUtils.js";class L{constructor(t){this.allGraphics=t,this.type="graphic-move-start"}}class N{constructor(t,i,e){this.dx=t,this.dy=i,this.allGraphics=e,this.type="graphic-move"}}class q{constructor(t){this.allGraphics=t,this.type="graphic-move-stop"}}let B=class extends(o(e.EventedMixin(Y))){constructor(t){super(t),this.graphics=new i,this.enableZ=!0,this.tooltipOptions=new P,this.type="move-3d",this._tooltip=null}initialize(){const{graphics:t,view:i}=this;this.addHandles([t.on("change",(t=>{const i=this._createGraphicInfos();this._setupFastTransformUpdates(i),t.removed.forEach(_),this._refreshManipulators(i)})),p((()=>this.tooltipOptions.enabled),(t=>{this._tooltip=t?new R({view:i}):n(this._tooltip)}),h)]);const e=this._createGraphicInfos();this._setupFastTransformUpdates(e),this._refreshManipulators(e),this.finishToolCreation()}destroy(){this._tooltip=n(this._tooltip),this._moveManipulation=n(this._moveManipulation),this.handles.removeAll(),this.graphics.drain(_),this._set("view",null)}get updating(){return this.updatingHandles.updating}reset(){}_createGraphicInfos(){return this.graphics.toArray().filter((t=>U(t)===M.SUPPORTED)).map((t=>new J(t)))}_setupFastTransformUpdates(t){for(const i of t)this.addHandles(l((()=>i.state.displaying),(()=>w(i.graphic)),{...h,once:!0}))}_refreshManipulators(t){this.handles.removeAll(),this._moveManipulation?.destroy(),this.manipulators.removeAll(),t.length&&(this._createManipulators(t),this._createVisualElements(t),this.handles.add(t.map((t=>this.view.trackGraphicState(t.state)))),this._updateMoveManipulation(t))}_createManipulators(t){for(const i of t){const e=i.state;i.manipulationXY=new O({tool:this,view:this.view,graphicState:e}),i.manipulationXY.forEachManipulator((t=>this.handles.add([t.events.on("immediate-click",(t=>{this.emit("immediate-click",{...t,graphic:e.graphic}),t.stopPropagation()})),t.events.on("grab-changed",(({action:t})=>{const{tooltipOptions:i,_tooltip:e}=this;null!=e&&("start"===t?e.info=new F({tooltipOptions:i}):e.clear())}))]))),this.handles.add(i.manipulationXY.createDragPipeline(((i,e,o,a)=>this._buildDragEventPipeline(t,x.XY,i,e,o,a))))}this._createMoveManipulation(t)}_createMoveManipulation(t){const i=new S({tool:this,view:this.view,snapToScene:!1,xyAvailable:!0,xyAxisAvailable:!0,zAvailable:!0,radius:1===t.length?S.radiusForSymbol(t[0].graphic.symbol):b});this._moveManipulation=i,i.elevationInfo={mode:"absolute-height",offset:0},i.forEachManipulator((t=>{this.handles.add(t.events.on("immediate-click",(e=>{i.zManipulation.hasManipulator(t)||1!==this.graphics.length||this.emit("immediate-click",{...e,graphic:this.graphics.getItemAt(0)}),e.stopPropagation()})))}));const e=i=>e=>{this.handles.add(e.events.on("focus-changed",(({action:e})=>{const o=this._tooltip;null!=o&&("focus"===e?this._updateMoveTooltip(t,i):o.clear())})))};this._moveManipulation.xyManipulation.forEachManipulator(e(x.XY)),this._moveManipulation.xyAxisManipulation.forEachManipulator(e(x.XY_AXIS)),this._moveManipulation.zManipulation.forEachManipulator(e(x.Z));const o=()=>this._updateMoveManipulation(t);for(const n of t)this.handles.add([n.state.on("changed",o),p((()=>n.state.displaying),o)]);const a=t[t.length-1];this.handles.add(a.state.on("changed",(()=>this._updateMoveManipulationAngle(a)))),this.handles.add(i.createDragPipeline(((i,e,o,a,n)=>this._buildDragEventPipeline(t,i,e,o,a,n)),d(a.graphic),a.graphic.geometry.spatialReference,a.graphic)),this._updateMoveManipulationAngle(a)}_createVisualElements(t){for(const i of t){const e=i.graphic,o=j({view:this.view,graphic:e,forEachManipulator:t=>{i.manipulationXY?.forEachManipulator(t),this._moveManipulation.forEachManipulator(t)},onManipulatorsChanged:()=>a()});null!=o&&(i.geometryRepresentation=o.visualElement,i.geometryRepresentation instanceof D&&this.handles.add([i.geometryRepresentation.events.on("attachment-origin-changed",(()=>{i.state.isDraped||this._updateMoveManipulation(t)})),p((()=>i.state.isDraped),(()=>this._updateMoveManipulation(t)))]),this.handles.add(o))}}_updateMoveManipulationAngle(t){this._moveManipulation.angle=E(t.graphic.geometry)}_updateMoveManipulation(t){const i=m(0,0,0,this.view.spatialReference);let e=0,o=!1;const a=this._moveManipulation;for(const n of t){if(!n.state.displaying)continue;const t=n.state.graphic;this.enableZ&&y(t)&&(o=!0);const a=n.geometryRepresentation instanceof D&&!n.state.isDraped?n.geometryRepresentation.attachmentOrigin:v(this.view,t);if(null!=a){const{x:t,y:o,z:n}=a;i.x+=t,i.y+=o,n&&(i.z??=0,i.z+=n),e++}}e>0?(i.x/=e,i.y/=e,i.z??=0,i.z/=e,a.location=i,a.xyManipulation.available=!0,a.xyAxisManipulation.available=!0,a.zManipulation.available=o):a.available=!1}_buildDragEventPipeline(t,i,e,o,a,n){const s=[],r=[];let p=null,l=null;const h=()=>{for(const t of s)t.dragging=!1;s.length=0,r.length=0,p=null,l=null,this._moveManipulation.interactive=!0};if(1===t.length&&i===x.XY){const i=t[0].graphic;({steps:o,cancel:a}=this._buildSnappingPipelineSteps(i,d(i),o,a,n))}return a=a.next((t=>l?.(t))).next((()=>(this.emit("graphic-move-stop",new q(r)),this.destroyed||h(),null))),{steps:o=o.next((i=>{if("start"===i.action){s.length=0,r.length=0;for(const i of t)i.dragging||!i.manipulationXY?.hasManipulator(e)&&i.manipulationXY?.grabbing||(s.push(i),r.push(i.graphic),i.dragging=!0);if(0!==r.length&&(this._moveManipulation.interactive=!1,p=A(r,this.view.state.viewingMode),l=G(r),this.emit("graphic-move-start",new L(r)),this.destroyed))return null}return 0!==r.length?i:null})).next((t=>p?.(t))).next((e=>(this._updateMoveTooltip(t,i,e),e))).next((t=>{switch(t.action){case"start":case"update":if(t.translationX||t.translationY||t.translationZ){const i=this.view.toScreen(t.mapStart),e=this.view.toScreen(t.mapEnd),o=e.x-i.x,a=e.y-i.y;if(this.emit("graphic-move",new N(o,a,r)),this.destroyed)return null}break;case"end":if(this.emit("graphic-move-stop",new q(r)),this.destroyed)return null;h()}return null})),cancel:a}}_updateMoveTooltip(t,i,e){const{tooltipOptions:o,_tooltip:a}=this;if(null==a)return;a.clear();const n=0===t.length?"absolute-height":t[0].state.isDraped?"on-the-ground":"absolute-height";switch(i){case x.XY:a.info=new F({tooltipOptions:o}),this._updateMoveTooltipDistance(a.info,e,((t,i)=>C(t,i,n)));break;case x.XY_AXIS:a.info=new Z({tooltipOptions:o}),this._updateMoveTooltipDistance(a.info,e,((t,i)=>{const o=C(t,i,n);return s(o,T(e))}));break;case x.Z:a.info=new H({tooltipOptions:o}),this._updateMoveTooltipDistance(a.info,e,V)}}_updateMoveTooltipDistance(t,i,e){if(null!=i&&"end"!==i.action){const{mapStart:o,mapEnd:a}=i,n=e(o,a);t.distance=null!=n?n:r}}_buildSnappingPipelineSteps(t,i,e,o,a){const n=t.geometry;if(null==n||"point"!==n.type&&"mesh"!==n.type)return{steps:e,cancel:o};const s=("point"===n.type?n:n.anchor).clone(),r=new k({elevationInfo:i,pointer:a,editGeometryOperations:z.fromGeometry(s,this.view.state.viewingMode),visualizer:new f,excludeFeature:t}),p=this.snappingManager,{snappingStep:l,cancelSnapping:h}=I({snappingContext:r,snappingManager:p,updatingHandles:this.updatingHandles});return o=o.next(h),{steps:e=e.next((i=>{s.z=g(this.view,s,d(t),{mode:"absolute-height",offset:0});return{...i,snapOrigin:r.coordinateHelper.pointToVector(s)}})).next(...l),cancel:o}}get test(){return{tooltip:this._tooltip}}};t([c({constructOnly:!0,nonNullable:!0})],B.prototype,"view",void 0),t([c()],B.prototype,"graphics",void 0),t([c({constructOnly:!0,nonNullable:!0})],B.prototype,"enableZ",void 0),t([c({constructOnly:!0,type:P})],B.prototype,"tooltipOptions",void 0),t([c({constructOnly:!0})],B.prototype,"snappingManager",void 0),t([c()],B.prototype,"type",void 0),t([c()],B.prototype,"updating",null),B=t([u("esri.views.3d.interactive.editingTools.graphicMove3D.GraphicMoveTool")],B);class J{constructor(t){this.geometryRepresentation=null,this.manipulationXY=null,this.dragging=!1,this.state=new X({graphic:t})}get graphic(){return this.state.graphic}}export{N as GraphicMoveEvent,L as GraphicMoveStartEvent,q as GraphicMoveStopEvent,B as GraphicMoveTool};
5
+ import{_ as t}from"../../../../../chunks/tslib.es6.js";import i from"../../../../../core/Collection.js";import e from"../../../../../core/Evented.js";import{HandleOwnerMixin as o}from"../../../../../core/HandleOwner.js";import{makeHandle as a}from"../../../../../core/handleUtils.js";import{destroyMaybe as n}from"../../../../../core/maybe.js";import{scale as s,zeroMeters as r}from"../../../../../core/quantityUtils.js";import{watch as p,when as l,syncAndInitial as h}from"../../../../../core/reactiveUtils.js";import{property as c}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/accessorSupport/ensureType.js";import"../../../../../core/arrayUtils.js";import"../../../../../core/has.js";import{subclass as u}from"../../../../../core/accessorSupport/decorators/subclass.js";import{makeDehydratedPoint as m}from"../../../../../layers/graphics/dehydratedFeatures.js";import{getGraphicEffectiveElevationInfo as d,getConvertedElevation as g}from"../../../../../support/elevationInfoUtils.js";import{getGraphicAttachmentOrigin as v}from"../../manipulatorUtils.js";import{SnappingVisualizer3D as f}from"../../SnappingVisualizer3D.js";import{SupportedGraphicResult as M}from"../isSupportedGraphicUtils.js";import{canMoveZ as _}from"../manipulatorUtils.js";import{tryDisableMeshTransformFastUpdates as y,tryEnableMeshTransformFastUpdates as w}from"../meshFastUpdateUtils.js";import{createVisualElements as j}from"../visualElementUtils.js";import{DISC_RADIUS as b}from"../manipulations/config.js";import{ManipulationType as x,MoveManipulation as S}from"../manipulations/MoveManipulation.js";import{shapeOrientation as E,axisConstrainedDragSign as T}from"../manipulations/moveUtils.js";import{MoveXYGraphicManipulation as O}from"../manipulations/MoveXYGraphicManipulation.js";import{isSupportedGraphic as H}from"./isSupportedGraphic.js";import{OutlineVisualElement as U}from"../../visualElements/OutlineVisualElement.js";import{GraphicState as D}from"../../../layers/graphics/GraphicState.js";import{dragGraphicMany as X,resetGraphicMany as A}from"../../../../interactive/dragEventPipeline.js";import{InteractiveToolBase as G}from"../../../../interactive/InteractiveToolBase.js";import{EditGeometryOperations as Y}from"../../../../interactive/editGeometry/EditGeometryOperations.js";import z from"../../../../interactive/sketch/SketchTooltipOptions.js";import{SnappingContext as P}from"../../../../interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as k}from"../../../../interactive/snapping/SnappingDragPipelineStep.js";import{Tooltip as I}from"../../../../interactive/tooltip/Tooltip.js";import{TranslateGraphicTooltipInfo as R,TranslateGraphicZTooltipInfo as F,TranslateGraphicXYTooltipInfo as Z}from"../../../../interactive/tooltip/TranslateTooltipInfos.js";import{autoHorizontalDistanceByElevationModeBetweenPoints as C}from"../../../../support/automaticLengthMeasurementUtils.js";import{verticalSignedDistanceBetweenPoints as V}from"../../../../support/euclideanLengthMeasurementUtils.js";class L{constructor(t){this.allGraphics=t,this.type="graphic-move-start"}}class N{constructor(t,i,e){this.dx=t,this.dy=i,this.allGraphics=e,this.type="graphic-move"}}class q{constructor(t){this.allGraphics=t,this.type="graphic-move-stop"}}const B="manipulators";let J=class extends(o(e.EventedMixin(G))){constructor(t){super(t),this._infos=new Map,this.graphics=new i,this.enableZ=!0,this.tooltipOptions=new z,this.type="move-3d",this._moveManipulation=null,this._tooltip=null}initialize(){const{view:t}=this;this.addHandles([this.graphics.on("change",(t=>{t.removed.forEach((t=>this.removeHandles(t))),this._updateGraphicInfos(t),this._setupFastTransformUpdates(t.added),this._refreshManipulators()})),p((()=>this.tooltipOptions.enabled),(i=>{this._tooltip=i?new I({view:t}):n(this._tooltip)}),h)]);const i=this.graphics.toArray();this._updateGraphicInfos({added:i,removed:[]}),this._setupFastTransformUpdates(i),this._refreshManipulators(),this.finishToolCreation()}destroy(){this._tooltip=n(this._tooltip),this._moveManipulation=n(this._moveManipulation),this.removeAllHandles(),this.graphics.drain(y),this._set("view",null)}get updating(){return this.updatingHandles.updating}reset(){}_updateGraphicInfos({added:t,removed:i}){for(const e of t){if(H(e)!==M.SUPPORTED)continue;const t=new K(e),i=this.view.trackGraphicState(t.state);this._infos.set(t.graphic,{info:t,handle:i})}for(const e of i)this._infos.get(e)?.handle.remove(),this._infos.delete(e)}_setupFastTransformUpdates(t){for(const i of t){const{info:t}=this._infos.get(i);this.addHandles(l((()=>t.state.displaying),(()=>w(i)),{...h,once:!0}),i),this.addHandles(a((()=>y(i))),i)}}_refreshManipulators(){if(this.removeHandles(B),this._moveManipulation=n(this._moveManipulation),this.manipulators.removeAll(),0===this._infos.size)return;const t=Array.from(this._infos.values(),(({info:t})=>t));this._createManipulators(t),this._createVisualElements(t),this._updateMoveManipulation(t)}_createManipulators(t){for(const i of t){const e=i.state;i.manipulationXY=new O({tool:this,view:this.view,graphicState:e}),i.manipulationXY.forEachManipulator((t=>this.addHandles([t.events.on("immediate-click",(t=>{this.emit("immediate-click",{...t,graphic:e.graphic}),t.stopPropagation()})),t.events.on("grab-changed",(({action:t})=>{const{tooltipOptions:i,_tooltip:e}=this;null!=e&&("start"===t?e.info=new R({tooltipOptions:i}):e.clear())}))],B))),this.addHandles(i.manipulationXY.createDragPipeline(((i,e,o,a)=>this._buildDragEventPipeline(t,x.XY,i,e,o,a))),B)}this._createMoveManipulation(t)}_createMoveManipulation(t){const i=new S({tool:this,view:this.view,snapToScene:!1,xyAvailable:!0,xyAxisAvailable:!0,zAvailable:!0,radius:1===t.length?S.radiusForSymbol(t[0].graphic.symbol):b});this._moveManipulation=i,i.elevationInfo={mode:"absolute-height",offset:0},i.forEachManipulator((t=>{this.addHandles(t.events.on("immediate-click",(e=>{i.zManipulation.hasManipulator(t)||1!==this.graphics.length||this.emit("immediate-click",{...e,graphic:this.graphics.getItemAt(0)}),e.stopPropagation()})),B)}));const e=i=>e=>{this.addHandles(e.events.on("focus-changed",(({action:e})=>{const o=this._tooltip;null!=o&&("focus"===e?this._updateMoveTooltip(t,i):o.clear())})),B)};this._moveManipulation.xyManipulation.forEachManipulator(e(x.XY)),this._moveManipulation.xyAxisManipulation.forEachManipulator(e(x.XY_AXIS)),this._moveManipulation.zManipulation.forEachManipulator(e(x.Z));const o=()=>this._updateMoveManipulation(t);for(const n of t)this.addHandles([n.state.on("changed",o),p((()=>n.state.displaying),o)],B);const a=t[t.length-1];this.addHandles(a.state.on("changed",(()=>this._updateMoveManipulationAngle(a))),B),this.addHandles(i.createDragPipeline(((i,e,o,a,n)=>this._buildDragEventPipeline(t,i,e,o,a,n)),d(a.graphic),a.graphic.geometry.spatialReference,a.graphic),B),this._updateMoveManipulationAngle(a)}_createVisualElements(t){for(const i of t){const e=i.graphic,o=j({view:this.view,graphic:e,forEachManipulator:t=>{i.manipulationXY?.forEachManipulator(t),this._moveManipulation?.forEachManipulator(t)},onManipulatorsChanged:()=>a()});null!=o&&(i.geometryRepresentation=o.visualElement,i.geometryRepresentation instanceof U&&this.addHandles([i.geometryRepresentation.events.on("attachment-origin-changed",(()=>{i.state.isDraped||this._updateMoveManipulation(t)})),p((()=>i.state.isDraped),(()=>this._updateMoveManipulation(t)))],B),this.addHandles(o,B))}}_updateMoveManipulationAngle(t){this._moveManipulation&&(this._moveManipulation.angle=E(t.graphic.geometry))}_updateMoveManipulation(t){const i=m(0,0,0,this.view.spatialReference);let e=0,o=!1;const a=this._moveManipulation;if(a){for(const a of t){if(!a.state.displaying)continue;const t=a.state.graphic;this.enableZ&&_(t)&&(o=!0);const n=a.geometryRepresentation instanceof U&&!a.state.isDraped?a.geometryRepresentation.attachmentOrigin:v(this.view,t);if(null!=n){const{x:t,y:o,z:a}=n;i.x+=t,i.y+=o,a&&(i.z??=0,i.z+=a),e++}}e>0?(i.x/=e,i.y/=e,i.z??=0,i.z/=e,a.location=i,a.xyManipulation.available=!0,a.xyAxisManipulation.available=!0,a.zManipulation.available=o):a.available=!1}}_buildDragEventPipeline(t,i,e,o,a,n){const s=[],r=[];let p=null,l=null;const h=()=>{for(const t of s)t.dragging=!1;s.length=0,r.length=0,p=null,l=null,this._moveManipulation&&(this._moveManipulation.interactive=!0)};if(1===t.length&&i===x.XY){const i=t[0].graphic;({steps:o,cancel:a}=this._buildSnappingPipelineSteps(i,d(i),o,a,n))}return a=a.next((t=>l?.(t))).next((()=>(this.emit("graphic-move-stop",new q(r)),this.destroyed||h(),null))),{steps:o=o.next((i=>{if("start"===i.action){s.length=0,r.length=0;for(const i of t)i.dragging||!i.manipulationXY?.hasManipulator(e)&&i.manipulationXY?.grabbing||(s.push(i),r.push(i.graphic),i.dragging=!0);if(0!==r.length&&(this._moveManipulation&&(this._moveManipulation.interactive=!1),p=X(r,this.view.state.viewingMode),l=A(r),this.emit("graphic-move-start",new L(r)),this.destroyed))return null}return 0!==r.length?i:null})).next((t=>p?.(t))).next((e=>(this._updateMoveTooltip(t,i,e),e))).next((t=>{switch(t.action){case"start":case"update":if(t.translationX||t.translationY||t.translationZ){const i=this.view.toScreen(t.mapStart),e=this.view.toScreen(t.mapEnd),o=e.x-i.x,a=e.y-i.y;if(this.emit("graphic-move",new N(o,a,r)),this.destroyed)return null}break;case"end":if(this.emit("graphic-move-stop",new q(r)),this.destroyed)return null;h()}return null})),cancel:a}}_updateMoveTooltip(t,i,e){const{tooltipOptions:o,_tooltip:a}=this;if(null==a)return;a.clear();const n=0===t.length?"absolute-height":t[0].state.isDraped?"on-the-ground":"absolute-height";switch(i){case x.XY:a.info=new R({tooltipOptions:o}),this._updateMoveTooltipDistance(a.info,e,((t,i)=>C(t,i,n)));break;case x.XY_AXIS:a.info=new Z({tooltipOptions:o}),this._updateMoveTooltipDistance(a.info,e,((t,i)=>{const o=C(t,i,n);return s(o,T(e))}));break;case x.Z:a.info=new F({tooltipOptions:o}),this._updateMoveTooltipDistance(a.info,e,V)}}_updateMoveTooltipDistance(t,i,e){if(null!=i&&"end"!==i.action){const{mapStart:o,mapEnd:a}=i,n=e(o,a);t.distance=null!=n?n:r}}_buildSnappingPipelineSteps(t,i,e,o,a){const n=t.geometry;if(null==n||"point"!==n.type&&"mesh"!==n.type)return{steps:e,cancel:o};const s=("point"===n.type?n:n.anchor).clone(),r=new P({elevationInfo:i,pointer:a,editGeometryOperations:Y.fromGeometry(s,this.view.state.viewingMode),visualizer:new f,excludeFeature:t}),p=this.snappingManager,{snappingStep:l,cancelSnapping:h}=k({snappingContext:r,snappingManager:p,updatingHandles:this.updatingHandles});return o=o.next(h),{steps:e=e.next((i=>{s.z=g(this.view,s,d(t),{mode:"absolute-height",offset:0});return{...i,snapOrigin:r.coordinateHelper.pointToVector(s)}})).next(...l),cancel:o}}get test(){return{tooltip:this._tooltip}}};t([c({constructOnly:!0,nonNullable:!0})],J.prototype,"view",void 0),t([c()],J.prototype,"graphics",void 0),t([c({constructOnly:!0,nonNullable:!0})],J.prototype,"enableZ",void 0),t([c({constructOnly:!0,type:z})],J.prototype,"tooltipOptions",void 0),t([c({constructOnly:!0})],J.prototype,"snappingManager",void 0),t([c()],J.prototype,"type",void 0),t([c()],J.prototype,"updating",null),J=t([u("esri.views.3d.interactive.editingTools.graphicMove3D.GraphicMoveTool")],J);class K{constructor(t){this.geometryRepresentation=null,this.manipulationXY=null,this.dragging=!1,this.state=new D({graphic:t})}get graphic(){return this.state.graphic}}export{N as GraphicMoveEvent,L as GraphicMoveStartEvent,q as GraphicMoveStopEvent,J as GraphicMoveTool};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
4
  */
5
- import{_ as t}from"../../../../../chunks/tslib.es6.js";import e from"../../../../../core/Evented.js";import{HandleOwnerMixin as i}from"../../../../../core/HandleOwner.js";import{makeHandle as a}from"../../../../../core/handleUtils.js";import{destroyMaybe as o}from"../../../../../core/maybe.js";import{scale as n,zeroMeters as s}from"../../../../../core/quantityUtils.js";import{watch as r,when as l,syncAndInitial as p}from"../../../../../core/reactiveUtils.js";import{property as c}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/accessorSupport/ensureType.js";import"../../../../../core/arrayUtils.js";import"../../../../../core/has.js";import{subclass as h}from"../../../../../core/accessorSupport/decorators/subclass.js";import d from"../../../../../geometry/Point.js";import{getGraphicEffectiveElevationInfo as m}from"../../../../../support/elevationInfoUtils.js";import{ViewingMode as u}from"../../../../ViewingMode.js";import{Manipulator3D as g}from"../../Manipulator3D.js";import{placeAtGraphic as v}from"../../manipulatorUtils.js";import{SnappingVisualizer3D as _}from"../../SnappingVisualizer3D.js";import{canMoveZ as M}from"../manipulatorUtils.js";import{tryEnableMeshTransformFastUpdates as f,tryDisableMeshTransformFastUpdates as y}from"../meshFastUpdateUtils.js";import{createVisualElements as S}from"../visualElementUtils.js";import{ALIGN_ARROWS_SCALE_THRESHOLD as R}from"../manipulations/config.js";import{MoveManipulation as w,ManipulationType as b}from"../manipulations/MoveManipulation.js";import{axisConstrainedDragSign as j}from"../manipulations/moveUtils.js";import{GraphicScaleRotateTransform as A}from"./GraphicScaleRotateTransform.js";import{ScaleRotateMeshAdapter as T}from"./ScaleRotateMeshAdapter.js";import{ScaleRotateObjectSymbol3DAdapter as x}from"./ScaleRotateObjectSymbol3DAdapter.js";import{createGraphicGeometryUndoRecord as O}from"./undoRecords.js";import{GraphicState as E}from"../../../layers/graphics/GraphicState.js";import{sceneSnappingAtProjectedLocation as G}from"../../../../interactive/dragEventPipeline.js";import{InteractiveToolBase as U}from"../../../../interactive/InteractiveToolBase.js";import{EditGeometryOperations as z}from"../../../../interactive/editGeometry/EditGeometryOperations.js";import D from"../../../../interactive/sketch/SketchTooltipOptions.js";import{SnappingContext as I}from"../../../../interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as k}from"../../../../interactive/snapping/SnappingDragPipelineStep.js";import{Tooltip as C}from"../../../../interactive/tooltip/Tooltip.js";import{TranslateGraphicZTooltipInfo as L,TranslateGraphicXYTooltipInfo as Z,TranslateGraphicTooltipInfo as H}from"../../../../interactive/tooltip/TranslateTooltipInfos.js";import{autoHorizontalDistanceByElevationModeBetweenPoints as X}from"../../../../support/automaticLengthMeasurementUtils.js";import{verticalSignedDistanceBetweenPoints as F}from"../../../../support/euclideanLengthMeasurementUtils.js";let P=class extends(i(e.EventedMixin(U))){constructor(t){super(t),this.enableZ=!0,this.enableRotation=!0,this.enableScaling=!0,this.tooltipOptions=new D,this.type="transform-3d",this._scaleRotate=null,this._tooltip=null}initialize(){const{graphic:t,view:e}=this;this.graphicState=new E({graphic:t}),this.addHandles(r((()=>this.tooltipOptions.enabled),(t=>{this._tooltip=t?new C({view:e}):o(this._tooltip)}),p)),this._moveManipulation=new w({tool:this,view:e,snapToScene:this.snapToScene,xyAvailable:!0,xyAxisAvailable:!0,zAvailable:this.enableZ&&M(t),radius:w.radiusForSymbol(t.symbol)}),this._moveManipulation.forEachManipulator((e=>this.handles.add(e.events.on("immediate-click",(e=>{this.emit("immediate-click",{...e,graphic:t}),e.stopPropagation()})))));const i=t=>e=>{this.handles.add(e.events.on("focus-changed",(({action:e})=>{const i=this._tooltip;null!=i&&("focus"===e?this._updateMoveTooltip(t):i.clear())})))};this._moveManipulation.xyManipulation.forEachManipulator(i(b.XY)),this._moveManipulation.xyAxisManipulation.forEachManipulator(i(b.XY_AXIS)),this._moveManipulation.zManipulation.forEachManipulator(i(b.Z));const n=m(t);this._moveManipulation.elevationInfo=n,this.addHandles(l((()=>this.graphicState.displaying),(()=>{f(t),this.addHandles({remove:()=>y(t)})}),{...p,once:!0}));const{geometry:s}=t;if(this._moveManipulation.createGraphicDragPipeline(((i,a,o,r,l)=>{if(null!=s&&i===b.XY){const{snappingStep:i,cancelSnapping:a}=k({snappingContext:new I({elevationInfo:n,pointer:l,editGeometryOperations:z.fromGeometry(new d({spatialReference:s.spatialReference}),e.state.viewingMode),visualizer:new _,excludeFeature:t}),snappingManager:this.snappingManager,updatingHandles:this.updatingHandles,useZ:!1});r=r.next(a),o=o.next(G(this.view,n)).next(...i)}return{steps:o=o.next((t=>(this._updateMoveTooltip(i,t),t))),cancel:r}}),this.graphicState,(t=>{const{action:e,graphic:i,dxScreen:a,dyScreen:o}=t,n={graphic:i,dxScreen:a,dyScreen:o};switch(e){case"start":this.emit("graphic-translate-start",n),this.emit("record-undo",{record:this._createGeometryUndoRecord()});break;case"update":this.emit("graphic-translate",n);break;case"end":this.emit("graphic-translate-stop",n)}})),this._moveManipulation.angle=null!=this._scaleRotate?this._scaleRotate.angle:0,this._scaleRotateAdapter=this._createScaleRotateAdapter(),this.handles.add(r((()=>this._scaleRotateAdapter.angle),(()=>this._updateMoveAngle()))),this.enableScaling||this.enableRotation){const t=this.enableScaling&&this.enableRotation?null:this.enableScaling?"scale":"rotate";this._scaleRotate=new A({tool:this,mode:t,adapter:this._scaleRotateAdapter,tooltipOptions:this.tooltipOptions}),this.handles.add(this._scaleRotate.events.on("scale-changed",(()=>this._onScaleChanged())))}this.handles.add([S({view:this.view,graphic:this.graphic,forEachManipulator:t=>this._forEachManipulator(t),onManipulatorsChanged:()=>a()}),this.graphicState.on("changed",(()=>this._onGeometryChanged())),this._hideManipulatorsForGraphicState(),r((()=>e.scale),(()=>this._updateMoveAngle()))]),this.handles.add(this.view.trackGraphicState(this.graphicState)),this._onGeometryChanged(),this._updateMoveAngle(),this._forEachManipulator((t=>{t instanceof g&&this.handles.add(t.events.on("grab-changed",(()=>this._updateManipulatorsInteractive())))})),this.finishToolCreation()}destroy(){this._tooltip=o(this._tooltip),this._moveManipulation.destroy(),this._scaleRotate=o(this._scaleRotate),this._scaleRotateAdapter=o(this._scaleRotateAdapter),this._set("view",null),this._set("graphic",null)}_updateManipulatorsInteractive(){null!=this._scaleRotate&&(this._scaleRotate.interactive=!this._moveManipulation.grabbing,this._moveManipulation.interactive=!this._scaleRotate.grabbing)}_createScaleRotateAdapter(){return null!=this.graphic.geometry&&"mesh"===this.graphic.geometry.type?new T({graphic:this.graphic,geometry:this.graphic.geometry,viewingMode:this.view.state.viewingMode}):new x({graphic:this.graphic,sizeFilter:t=>this._enforceNonZeroSize(t),findLayerView:()=>this.view.allLayerViews.find((t=>t.layer===this.graphic.layer)),sizeAxis:this.tooltipOptions?.visualVariables?.size?.axis??null})}_forEachManipulator(t){this._moveManipulation?.forEachManipulator(t),this._scaleRotate?.forEachManipulator(t)}_hideManipulatorsForGraphicState(){return r((()=>this.graphicState.displaying),(t=>{this._forEachManipulator((e=>e.available=t)),this._moveManipulation.zManipulation.available=t&&this.enableZ&&M(this.graphic)}))}_createGeometryUndoRecord(){return O(this.graphic)}set snapToScene(t){this._moveManipulation&&(this._moveManipulation.snapToScene=t),this._set("snapToScene",t)}get updating(){return this.updatingHandles.updating}set location(t){this._moveManipulation.location=t,this._scaleRotate&&(this._scaleRotate.location=t)}set elevationAlignedLocation(t){this._moveManipulation.elevationAlignedLocation=t,this._scaleRotate&&(this._scaleRotate.elevationAlignedLocation=t)}reset(){}onHide(){this._scaleRotate?.cancelActiveAnimation()}_onScaleChanged(){null!=this._scaleRotate&&(this._moveManipulation.displayScale=this._scaleRotate.getScale())}_updateMoveAngle(){this.view.state.viewingMode===u.Local||this.view.scale<R?this._moveManipulation.angle=this._scaleRotateAdapter.angle:this._moveManipulation.angle=0}_onGeometryChanged(){v(this.view,this,this.graphic)}_enforceNonZeroSize(t){return t||this.view.state.camera.computeRenderPixelSizeAt(this._moveManipulation.renderLocation)}_updateMoveTooltip(t,e){const{tooltipOptions:i,_tooltip:a}=this;if(null==a)return;a.clear();const o=this.graphicState.isDraped?"on-the-ground":"absolute-height";switch(t){case b.XY:a.info=new H({tooltipOptions:i}),this._updateMoveTooltipDistance(a.info,e,((t,e)=>X(t,e,o)));break;case b.XY_AXIS:a.info=new Z({tooltipOptions:i}),this._updateMoveTooltipDistance(a.info,e,((t,i)=>{const a=X(t,i,o);return n(a,j(e))}));break;case b.Z:a.info=new L({tooltipOptions:i}),this._updateMoveTooltipDistance(a.info,e,F)}}_updateMoveTooltipDistance(t,e,i){if(null!=e&&"end"!==e.action){const{mapStart:a,mapEnd:o}=e,n=i(a,o);t.distance=null!=n?n:s}}get test(){return{discManipulator:this._moveManipulation.xyManipulation.test.discManipulator,zManipulator:this._moveManipulation.zManipulation.test.manipulator,ringManipulator:null!=this._scaleRotate?this._scaleRotate.test.ringManipulator:null,arrowManipulators:this._moveManipulation.xyAxisManipulation.test.arrowManipulators,setRingIndicatorDelayMs:t=>null!=this._scaleRotate?this._scaleRotate.test.setRingIndicatorDelayMs(t):null,scaleRotateAdapter:this._scaleRotateAdapter,scaleRotateTransform:this._scaleRotate,tooltip:this._tooltip}}};t([c({constructOnly:!0,nonNullable:!0})],P.prototype,"view",void 0),t([c({constructOnly:!0,nonNullable:!0})],P.prototype,"graphic",void 0),t([c({constructOnly:!0,nonNullable:!0})],P.prototype,"enableZ",void 0),t([c()],P.prototype,"enableRotation",void 0),t([c()],P.prototype,"enableScaling",void 0),t([c({constructOnly:!0,type:D})],P.prototype,"tooltipOptions",void 0),t([c()],P.prototype,"graphicState",void 0),t([c({value:!1})],P.prototype,"snapToScene",null),t([c({constructOnly:!0})],P.prototype,"snappingManager",void 0),t([c({readOnly:!0})],P.prototype,"type",void 0),t([c({readOnly:!0})],P.prototype,"updating",null),P=t([h("esri.views.3d.interactive.editingTools.graphicTransform3D.GraphicTransformTool")],P);export{P as GraphicTransformTool};
5
+ import{_ as t}from"../../../../../chunks/tslib.es6.js";import e from"../../../../../core/Evented.js";import{HandleOwnerMixin as i}from"../../../../../core/HandleOwner.js";import{makeHandle as a}from"../../../../../core/handleUtils.js";import{destroyMaybe as o}from"../../../../../core/maybe.js";import{scale as n,zeroMeters as s}from"../../../../../core/quantityUtils.js";import{watch as r,when as l,syncAndInitial as p}from"../../../../../core/reactiveUtils.js";import{property as c}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/accessorSupport/ensureType.js";import"../../../../../core/arrayUtils.js";import"../../../../../core/has.js";import{subclass as h}from"../../../../../core/accessorSupport/decorators/subclass.js";import d from"../../../../../geometry/Point.js";import{getGraphicEffectiveElevationInfo as u}from"../../../../../support/elevationInfoUtils.js";import{ViewingMode as m}from"../../../../ViewingMode.js";import{Manipulator3D as g}from"../../Manipulator3D.js";import{placeAtGraphic as v}from"../../manipulatorUtils.js";import{SnappingVisualizer3D as _}from"../../SnappingVisualizer3D.js";import{canMoveZ as M}from"../manipulatorUtils.js";import{tryEnableMeshTransformFastUpdates as f,tryDisableMeshTransformFastUpdates as y}from"../meshFastUpdateUtils.js";import{createVisualElements as S}from"../visualElementUtils.js";import{ALIGN_ARROWS_SCALE_THRESHOLD as R}from"../manipulations/config.js";import{MoveManipulation as w,ManipulationType as b}from"../manipulations/MoveManipulation.js";import{axisConstrainedDragSign as j}from"../manipulations/moveUtils.js";import{GraphicScaleRotateTransform as A}from"./GraphicScaleRotateTransform.js";import{ScaleRotateMeshAdapter as T}from"./ScaleRotateMeshAdapter.js";import{ScaleRotateObjectSymbol3DAdapter as x}from"./ScaleRotateObjectSymbol3DAdapter.js";import{createGraphicGeometryUndoRecord as O}from"./undoRecords.js";import{GraphicState as E}from"../../../layers/graphics/GraphicState.js";import{sceneSnappingAtProjectedLocation as G}from"../../../../interactive/dragEventPipeline.js";import{InteractiveToolBase as U}from"../../../../interactive/InteractiveToolBase.js";import{EditGeometryOperations as z}from"../../../../interactive/editGeometry/EditGeometryOperations.js";import D from"../../../../interactive/sketch/SketchTooltipOptions.js";import{SnappingContext as I}from"../../../../interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as k}from"../../../../interactive/snapping/SnappingDragPipelineStep.js";import{Tooltip as C}from"../../../../interactive/tooltip/Tooltip.js";import{TranslateGraphicZTooltipInfo as L,TranslateGraphicXYTooltipInfo as Z,TranslateGraphicTooltipInfo as H}from"../../../../interactive/tooltip/TranslateTooltipInfos.js";import{autoHorizontalDistanceByElevationModeBetweenPoints as X}from"../../../../support/automaticLengthMeasurementUtils.js";import{verticalSignedDistanceBetweenPoints as F}from"../../../../support/euclideanLengthMeasurementUtils.js";let P=class extends(i(e.EventedMixin(U))){constructor(t){super(t),this.enableZ=!0,this.enableRotation=!0,this.enableScaling=!0,this.tooltipOptions=new D,this.type="transform-3d",this._scaleRotate=null,this._tooltip=null}initialize(){const{graphic:t,view:e}=this;this.graphicState=new E({graphic:t}),this.addHandles(r((()=>this.tooltipOptions.enabled),(t=>{this._tooltip=t?new C({view:e}):o(this._tooltip)}),p)),this._moveManipulation=new w({tool:this,view:e,snapToScene:this.snapToScene,xyAvailable:!0,xyAxisAvailable:!0,zAvailable:this.enableZ&&M(t),radius:w.radiusForSymbol(t.symbol)}),this._moveManipulation.forEachManipulator((e=>this.handles.add(e.events.on("immediate-click",(e=>{this.emit("immediate-click",{...e,graphic:t}),e.stopPropagation()})))));const i=t=>e=>{this.handles.add(e.events.on("focus-changed",(({action:e})=>{const i=this._tooltip;null!=i&&("focus"===e?this._updateMoveTooltip(t):i.clear())})))};this._moveManipulation.xyManipulation.forEachManipulator(i(b.XY)),this._moveManipulation.xyAxisManipulation.forEachManipulator(i(b.XY_AXIS)),this._moveManipulation.zManipulation.forEachManipulator(i(b.Z));const n=u(t);this._moveManipulation.elevationInfo=n,this.addHandles(l((()=>this.graphicState.displaying),(()=>{f(t),this.addHandles(a((()=>y(t))))}),{...p,once:!0}));const{geometry:s}=t;if(this._moveManipulation.createGraphicDragPipeline(((i,a,o,r,l)=>{if(null!=s&&i===b.XY){const{snappingStep:i,cancelSnapping:a}=k({snappingContext:new I({elevationInfo:n,pointer:l,editGeometryOperations:z.fromGeometry(new d({spatialReference:s.spatialReference}),e.state.viewingMode),visualizer:new _,excludeFeature:t}),snappingManager:this.snappingManager,updatingHandles:this.updatingHandles,useZ:!1});r=r.next(a),o=o.next(G(this.view,n)).next(...i)}return{steps:o=o.next((t=>(this._updateMoveTooltip(i,t),t))),cancel:r}}),this.graphicState,(t=>{const{action:e,graphic:i,dxScreen:a,dyScreen:o}=t,n={graphic:i,dxScreen:a,dyScreen:o};switch(e){case"start":this.emit("graphic-translate-start",n),this.emit("record-undo",{record:this._createGeometryUndoRecord()});break;case"update":this.emit("graphic-translate",n);break;case"end":this.emit("graphic-translate-stop",n)}})),this._moveManipulation.angle=null!=this._scaleRotate?this._scaleRotate.angle:0,this._scaleRotateAdapter=this._createScaleRotateAdapter(),this.handles.add(r((()=>this._scaleRotateAdapter.angle),(()=>this._updateMoveAngle()))),this.enableScaling||this.enableRotation){const t=this.enableScaling&&this.enableRotation?null:this.enableScaling?"scale":"rotate";this._scaleRotate=new A({tool:this,mode:t,adapter:this._scaleRotateAdapter,tooltipOptions:this.tooltipOptions}),this.handles.add(this._scaleRotate.events.on("scale-changed",(()=>this._onScaleChanged())))}this.handles.add([S({view:this.view,graphic:this.graphic,forEachManipulator:t=>this._forEachManipulator(t),onManipulatorsChanged:()=>a()}),this.graphicState.on("changed",(()=>this._onGeometryChanged())),this._hideManipulatorsForGraphicState(),r((()=>e.scale),(()=>this._updateMoveAngle()))]),this.handles.add(this.view.trackGraphicState(this.graphicState)),this._onGeometryChanged(),this._updateMoveAngle(),this._forEachManipulator((t=>{t instanceof g&&this.handles.add(t.events.on("grab-changed",(()=>this._updateManipulatorsInteractive())))})),this.finishToolCreation()}destroy(){this._tooltip=o(this._tooltip),this._moveManipulation.destroy(),this._scaleRotate=o(this._scaleRotate),this._scaleRotateAdapter=o(this._scaleRotateAdapter),this._set("view",null),this._set("graphic",null)}_updateManipulatorsInteractive(){null!=this._scaleRotate&&(this._scaleRotate.interactive=!this._moveManipulation.grabbing,this._moveManipulation.interactive=!this._scaleRotate.grabbing)}_createScaleRotateAdapter(){return null!=this.graphic.geometry&&"mesh"===this.graphic.geometry.type?new T({graphic:this.graphic,geometry:this.graphic.geometry,viewingMode:this.view.state.viewingMode}):new x({graphic:this.graphic,sizeFilter:t=>this._enforceNonZeroSize(t),findLayerView:()=>this.view.allLayerViews.find((t=>t.layer===this.graphic.layer)),sizeAxis:this.tooltipOptions?.visualVariables?.size?.axis??null})}_forEachManipulator(t){this._moveManipulation?.forEachManipulator(t),this._scaleRotate?.forEachManipulator(t)}_hideManipulatorsForGraphicState(){return r((()=>this.graphicState.displaying),(t=>{this._forEachManipulator((e=>e.available=t)),this._moveManipulation.zManipulation.available=t&&this.enableZ&&M(this.graphic)}))}_createGeometryUndoRecord(){return O(this.graphic)}set snapToScene(t){this._moveManipulation&&(this._moveManipulation.snapToScene=t),this._set("snapToScene",t)}get updating(){return this.updatingHandles.updating}set location(t){this._moveManipulation.location=t,this._scaleRotate&&(this._scaleRotate.location=t)}set elevationAlignedLocation(t){this._moveManipulation.elevationAlignedLocation=t,this._scaleRotate&&(this._scaleRotate.elevationAlignedLocation=t)}reset(){}onHide(){this._scaleRotate?.cancelActiveAnimation()}_onScaleChanged(){null!=this._scaleRotate&&(this._moveManipulation.displayScale=this._scaleRotate.getScale())}_updateMoveAngle(){this.view.state.viewingMode===m.Local||this.view.scale<R?this._moveManipulation.angle=this._scaleRotateAdapter.angle:this._moveManipulation.angle=0}_onGeometryChanged(){v(this.view,this,this.graphic)}_enforceNonZeroSize(t){return t||this.view.state.camera.computeRenderPixelSizeAt(this._moveManipulation.renderLocation)}_updateMoveTooltip(t,e){const{tooltipOptions:i,_tooltip:a}=this;if(null==a)return;a.clear();const o=this.graphicState.isDraped?"on-the-ground":"absolute-height";switch(t){case b.XY:a.info=new H({tooltipOptions:i}),this._updateMoveTooltipDistance(a.info,e,((t,e)=>X(t,e,o)));break;case b.XY_AXIS:a.info=new Z({tooltipOptions:i}),this._updateMoveTooltipDistance(a.info,e,((t,i)=>{const a=X(t,i,o);return n(a,j(e))}));break;case b.Z:a.info=new L({tooltipOptions:i}),this._updateMoveTooltipDistance(a.info,e,F)}}_updateMoveTooltipDistance(t,e,i){if(null!=e&&"end"!==e.action){const{mapStart:a,mapEnd:o}=e,n=i(a,o);t.distance=null!=n?n:s}}get test(){return{discManipulator:this._moveManipulation.xyManipulation.test.discManipulator,zManipulator:this._moveManipulation.zManipulation.test.manipulator,ringManipulator:null!=this._scaleRotate?this._scaleRotate.test.ringManipulator:null,arrowManipulators:this._moveManipulation.xyAxisManipulation.test.arrowManipulators,setRingIndicatorDelayMs:t=>null!=this._scaleRotate?this._scaleRotate.test.setRingIndicatorDelayMs(t):null,scaleRotateAdapter:this._scaleRotateAdapter,scaleRotateTransform:this._scaleRotate,tooltip:this._tooltip}}};t([c({constructOnly:!0,nonNullable:!0})],P.prototype,"view",void 0),t([c({constructOnly:!0,nonNullable:!0})],P.prototype,"graphic",void 0),t([c({constructOnly:!0,nonNullable:!0})],P.prototype,"enableZ",void 0),t([c()],P.prototype,"enableRotation",void 0),t([c()],P.prototype,"enableScaling",void 0),t([c({constructOnly:!0,type:D})],P.prototype,"tooltipOptions",void 0),t([c()],P.prototype,"graphicState",void 0),t([c({value:!1})],P.prototype,"snapToScene",null),t([c({constructOnly:!0})],P.prototype,"snappingManager",void 0),t([c({readOnly:!0})],P.prototype,"type",void 0),t([c({readOnly:!0})],P.prototype,"updating",null),P=t([h("esri.views.3d.interactive.editingTools.graphicTransform3D.GraphicTransformTool")],P);export{P as GraphicTransformTool};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
4
  */
5
- import{c as t}from"../../../../chunks/mat4.js";import{c as e}from"../../../../chunks/mat4f64.js";import{s as n}from"../../../../chunks/vec3.js";import{c as o}from"../../../../chunks/vec3f64.js";import{computeTranslationToOriginAndRotation as a,projectBuffer as r}from"../../../../geometry/projection.js";import{SampleElevationInfo as s}from"./elevationAlignmentUtils.js";import{updateVertexAttributeAuxpos1w as i}from"./graphicUtils.js";import l from"../../support/debugFlags.js";import{SamplePosition as c}from"../../support/ElevationProvider.js";import{isGeometryWithMapPositions as m}from"../../webgl-engine/lib/GeometryWithMapPositions.js";import{VertexAttribute as f}from"../../webgl-engine/lib/VertexAttribute.js";function u(t,e,n,o,a){const r=t.stageObject,s=r.geometries;let i=0;for(const l of s){if(!m(l))continue;const{update:t,averageGeometrySampledElevation:s}=A(l,e,n,o,a);i+=s,t&&r.geometryVertexAttrsUpdated(l)}return i/s.length}function p(e,o,r,s,c){const m=e.stageObject,f=o.centerPointInElevationSR;let u=0;if(m.usesVerticalDistanceToGround)s(f,M),i(m,M.verticalDistanceToGround),u=M.sampledElevation;else{s(f,M);"absolute-height"!==o.mode&&(u=M.sampledElevation)}const p=t(d,m.transformation),g=n(E,p[12],p[13],p[14]);l.TESTS_DISABLE_OPTIMIZATIONS?(T[0]=f.x,T[1]=f.y,T[2]=M.z,a(f.spatialReference,T,p,c.spatialReference)&&(m.transformation=p)):c.setAltitudeOfTransformation(M.z,p);const I=b/c.unitInMeters;return(Math.abs(p[12]-g[0])>=I||Math.abs(p[13]-g[1])>=I||Math.abs(p[14]-g[2])>=I)&&(m.transformation=p),u}const d=e();function g(t,e,o,r,s){const i=t.graphics3DSymbolLayer.lodRenderer;if(null==i)return 0;const c=e.centerPointInElevationSR;r(c,M);const m="absolute-height"!==e.mode?M.sampledElevation:0,f=i.instanceData,u=t.instanceIndex,p=v;f.getGlobalTransform(u,p);const d=n(E,p[12],p[13],p[14]);l.TESTS_DISABLE_OPTIMIZATIONS?(T[0]=c.x,T[1]=c.y,T[2]=M.z,a(c.spatialReference,T,p,s.spatialReference)&&f.setGlobalTransform(u,p)):s.setAltitudeOfTransformation(M.z,p);const g=b/s.unitInMeters;return(l.TESTS_DISABLE_OPTIMIZATIONS||Math.abs(p[12]-d[0])>=g||Math.abs(p[13]-d[1])>=g||Math.abs(p[14]-d[2])>=g)&&f.setGlobalTransform(u,p),m}function I(t,e,n,o,a){const r=t.stageObject,s=r.geometries;if(0===s.length)return 0;let i=0,l=null,c=0,u=!1;for(const p of s){if(!m(p))continue;const t=p.vertexAttributes.get(f.POSITION);if(t!==l){const{update:r,averageGeometrySampledElevation:s}=A(p,e,n,o,a);c=s,l=t,u=r}u&&r.geometryVertexAttrsUpdated(p),i+=c}return i/s.length}const b=.01,T=o(),h=o(),S=o(),v=e(),E=o(),M=new s;function A(t,e,n,o,a){let s=!1;const i=t.shaderTransformation,m=e.requiresSampledElevationInfo;h[0]=i[12],h[1]=i[13],h[2]=i[14],t.invalidateBoundingInfo();const u=t.getMutableAttribute(f.POSITION),p=u.data,d=u.size,g=p.length/d,I=new c(t.mapPositions,n);let v=0,E=0;for(let c=0;c<g;c++){if(S[0]=p[v],S[1]=p[v+1],S[2]=p[v+2],o(I,M),m&&(E+=M.sampledElevation),l.TESTS_DISABLE_OPTIMIZATIONS)p[v]=I.array[I.offset],p[v+1]=I.array[I.offset+1],p[v+2]=M.z,r(p,n,v,p,a.spatialReference,v,1),p[v]-=h[0],p[v+1]-=h[1],p[v+2]-=h[2],s=!0;else{T[0]=p[v]+h[0],T[1]=p[v+1]+h[1],T[2]=p[v+2]+h[2],a.setAltitude(T,M.z),p[v]=T[0]-h[0],p[v+1]=T[1]-h[1],p[v+2]=T[2]-h[2];const t=b/a.unitInMeters;(Math.abs(S[0]-p[v])>=t||Math.abs(S[1]-p[v+1])>=t||Math.abs(S[2]-p[v+2])>=t)&&(s=!0)}v+=d,I.offset+=3}return E/=g,{update:s,averageGeometrySampledElevation:E}}export{g as perLodInstanceElevationAligner,p as perObjectElevationAligner,u as perVertexElevationAligner,I as sharedGeometryElevationAligner};
5
+ import{c as t}from"../../../../chunks/mat4.js";import{c as e}from"../../../../chunks/mat4f64.js";import{s as n}from"../../../../chunks/vec3.js";import{c as o}from"../../../../chunks/vec3f64.js";import{computeTranslationToOriginAndRotation as a,projectBuffer as r}from"../../../../geometry/projection.js";import{SampleElevationInfo as s}from"./elevationAlignmentUtils.js";import{updateVertexAttributeAuxpos1w as i}from"./graphicUtils.js";import l from"../../support/debugFlags.js";import{SamplePosition as c}from"../../support/ElevationProvider.js";import{isGeometryWithMapPositions as m}from"../../webgl-engine/lib/GeometryWithMapPositions.js";import{VertexAttribute as f}from"../../webgl-engine/lib/VertexAttribute.js";function u(t,e,n,o,a){const r=t.stageObject,s=r.geometries;let i=0;for(const l of s){if(!m(l))continue;const{update:t,averageGeometrySampledElevation:s}=A(l,e,n,o,a);i+=s,t&&r.geometryVertexAttrsUpdated(l)}return i/s.length}function p(e,o,r,s,c,m){const f=e.stageObject,u=o.centerPointInElevationSR;let p=0;if(f.usesVerticalDistanceToGround)s(u,M),i(f,M.verticalDistanceToGround),p=M.sampledElevation;else{s(u,M);"absolute-height"!==o.mode&&(p=M.sampledElevation)}const g=t(d,m??f.transformation),I=n(E,g[12],g[13],g[14]);l.TESTS_DISABLE_OPTIMIZATIONS?(T[0]=u.x,T[1]=u.y,T[2]=M.z,a(u.spatialReference,T,g,c.spatialReference)&&(m?t(m,g):f.transformation=g)):c.setAltitudeOfTransformation(M.z,g);const h=b/c.unitInMeters;return(Math.abs(g[12]-I[0])>=h||Math.abs(g[13]-I[1])>=h||Math.abs(g[14]-I[2])>=h)&&(m?t(m,g):f.transformation=g),p}const d=e();function g(t,e,o,r,s){const i=t.graphics3DSymbolLayer.lodRenderer;if(null==i)return 0;const c=e.centerPointInElevationSR;r(c,M);const m="absolute-height"!==e.mode?M.sampledElevation:0,f=i.instanceData,u=t.instanceIndex,p=v;f.getGlobalTransform(u,p);const d=n(E,p[12],p[13],p[14]);l.TESTS_DISABLE_OPTIMIZATIONS?(T[0]=c.x,T[1]=c.y,T[2]=M.z,a(c.spatialReference,T,p,s.spatialReference)&&f.setGlobalTransform(u,p)):s.setAltitudeOfTransformation(M.z,p);const g=b/s.unitInMeters;return(l.TESTS_DISABLE_OPTIMIZATIONS||Math.abs(p[12]-d[0])>=g||Math.abs(p[13]-d[1])>=g||Math.abs(p[14]-d[2])>=g)&&f.setGlobalTransform(u,p),m}function I(t,e,n,o,a){const r=t.stageObject,s=r.geometries;if(0===s.length)return 0;let i=0,l=null,c=0,u=!1;for(const p of s){if(!m(p))continue;const t=p.vertexAttributes.get(f.POSITION);if(t!==l){const{update:r,averageGeometrySampledElevation:s}=A(p,e,n,o,a);c=s,l=t,u=r}u&&r.geometryVertexAttrsUpdated(p),i+=c}return i/s.length}const b=.01,T=o(),h=o(),S=o(),v=e(),E=o(),M=new s;function A(t,e,n,o,a){let s=!1;const i=t.shaderTransformation,m=e.requiresSampledElevationInfo;h[0]=i[12],h[1]=i[13],h[2]=i[14],t.invalidateBoundingInfo();const u=t.getMutableAttribute(f.POSITION),p=u.data,d=u.size,g=p.length/d,I=new c(t.mapPositions,n);let v=0,E=0;for(let c=0;c<g;c++){if(S[0]=p[v],S[1]=p[v+1],S[2]=p[v+2],o(I,M),m&&(E+=M.sampledElevation),l.TESTS_DISABLE_OPTIMIZATIONS)p[v]=I.array[I.offset],p[v+1]=I.array[I.offset+1],p[v+2]=M.z,r(p,n,v,p,a.spatialReference,v,1),p[v]-=h[0],p[v+1]-=h[1],p[v+2]-=h[2],s=!0;else{T[0]=p[v]+h[0],T[1]=p[v+1]+h[1],T[2]=p[v+2]+h[2],a.setAltitude(T,M.z),p[v]=T[0]-h[0],p[v+1]=T[1]-h[1],p[v+2]=T[2]-h[2];const t=b/a.unitInMeters;(Math.abs(S[0]-p[v])>=t||Math.abs(S[1]-p[v+1])>=t||Math.abs(S[2]-p[v+2])>=t)&&(s=!0)}v+=d,I.offset+=3}return E/=g,{update:s,averageGeometrySampledElevation:E}}export{g as perLodInstanceElevationAligner,p as perObjectElevationAligner,u as perVertexElevationAligner,I as sharedGeometryElevationAligner};