@arcgis/core 4.28.0-next.20231003 → 4.28.0-rc.1

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 (525) hide show
  1. package/assets/components/assets/icon/addConstant16.json +1 -0
  2. package/assets/components/assets/icon/addConstant24.json +1 -0
  3. package/assets/components/assets/icon/addConstant32.json +1 -0
  4. package/assets/components/assets/icon/addRasterVariable16.json +1 -0
  5. package/assets/components/assets/icon/addRasterVariable24.json +1 -0
  6. package/assets/components/assets/icon/addRasterVariable32.json +1 -0
  7. package/assets/components/assets/icon/addRasters16.json +1 -0
  8. package/assets/components/assets/icon/addRasters24.json +1 -0
  9. package/assets/components/assets/icon/addRasters32.json +1 -0
  10. package/assets/components/assets/icon/alertOffCircle16F.json +1 -0
  11. package/assets/components/assets/icon/alertOffCircle24F.json +1 -0
  12. package/assets/components/assets/icon/alertOffCircle32F.json +1 -0
  13. package/assets/components/assets/icon/boxChartSeries16.json +1 -0
  14. package/assets/components/assets/icon/boxChartSeries24.json +1 -0
  15. package/assets/components/assets/icon/boxChartSeries32.json +1 -0
  16. package/assets/components/assets/icon/breakRecurrence16.json +1 -0
  17. package/assets/components/assets/icon/breakRecurrence24.json +1 -0
  18. package/assets/components/assets/icon/breakRecurrence32.json +1 -0
  19. package/assets/components/assets/icon/bulletPoint16.json +1 -1
  20. package/assets/components/assets/icon/bulletPoint24.json +1 -1
  21. package/assets/components/assets/icon/bulletPoint32.json +1 -1
  22. package/assets/components/assets/icon/bulletPointLarge16.json +1 -0
  23. package/assets/components/assets/icon/bulletPointLarge24.json +1 -0
  24. package/assets/components/assets/icon/bulletPointLarge32.json +1 -0
  25. package/assets/components/assets/icon/chevronEnd16.json +1 -0
  26. package/assets/components/assets/icon/chevronEnd24.json +1 -0
  27. package/assets/components/assets/icon/chevronEnd32.json +1 -0
  28. package/assets/components/assets/icon/chevronStart16.json +1 -0
  29. package/assets/components/assets/icon/chevronStart24.json +1 -0
  30. package/assets/components/assets/icon/chevronStart32.json +1 -0
  31. package/assets/components/assets/icon/configureGridUnit16.json +1 -0
  32. package/assets/components/assets/icon/configureGridUnit24.json +1 -0
  33. package/assets/components/assets/icon/configureGridUnit32.json +1 -0
  34. package/assets/components/assets/icon/dimensionsUnit16.json +1 -0
  35. package/assets/components/assets/icon/dimensionsUnit24.json +1 -0
  36. package/assets/components/assets/icon/dimensionsUnit32.json +1 -0
  37. package/assets/components/assets/icon/dimensionsWall16.json +1 -0
  38. package/assets/components/assets/icon/dimensionsWall24.json +1 -0
  39. package/assets/components/assets/icon/dimensionsWall32.json +1 -0
  40. package/assets/components/assets/icon/flipVertical16.json +1 -0
  41. package/assets/components/assets/icon/flipVertical24.json +1 -0
  42. package/assets/components/assets/icon/flipVertical32.json +1 -0
  43. package/assets/components/assets/icon/imageCollectionExplorer16.json +1 -0
  44. package/assets/components/assets/icon/imageCollectionExplorer24.json +1 -0
  45. package/assets/components/assets/icon/imageCollectionExplorer32.json +1 -0
  46. package/assets/components/assets/icon/imageMagnifyingGlass16.json +1 -0
  47. package/assets/components/assets/icon/imageMagnifyingGlass24.json +1 -0
  48. package/assets/components/assets/icon/imageMagnifyingGlass32.json +1 -0
  49. package/assets/components/assets/icon/launch216.json +1 -0
  50. package/assets/components/assets/icon/launch224.json +1 -0
  51. package/assets/components/assets/icon/launch232.json +1 -0
  52. package/assets/components/assets/icon/mergeDetails16.json +1 -0
  53. package/assets/components/assets/icon/mergeDetails24.json +1 -0
  54. package/assets/components/assets/icon/mergeDetails32.json +1 -0
  55. package/assets/components/assets/icon/mergeUnits16.json +1 -0
  56. package/assets/components/assets/icon/mergeUnits24.json +1 -0
  57. package/assets/components/assets/icon/mergeUnits32.json +1 -0
  58. package/assets/components/assets/icon/minusCircle16F.json +1 -0
  59. package/assets/components/assets/icon/minusCircle24F.json +1 -0
  60. package/assets/components/assets/icon/minusCircle32F.json +1 -0
  61. package/assets/components/assets/icon/polygonSelect16.json +1 -0
  62. package/assets/components/assets/icon/polygonSelect24.json +1 -0
  63. package/assets/components/assets/icon/polygonSelect32.json +1 -0
  64. package/assets/components/assets/icon/projectMission16.json +1 -0
  65. package/assets/components/assets/icon/projectMission24.json +1 -0
  66. package/assets/components/assets/icon/projectMission32.json +1 -0
  67. package/assets/components/assets/icon/projectTemplate16.json +1 -0
  68. package/assets/components/assets/icon/projectTemplate24.json +1 -0
  69. package/assets/components/assets/icon/projectTemplate32.json +1 -0
  70. package/assets/components/assets/icon/properties16.json +1 -0
  71. package/assets/components/assets/icon/properties24.json +1 -0
  72. package/assets/components/assets/icon/properties32.json +1 -0
  73. package/assets/components/assets/icon/saveAs16.json +1 -0
  74. package/assets/components/assets/icon/saveAs24.json +1 -0
  75. package/assets/components/assets/icon/saveAs32.json +1 -0
  76. package/assets/components/assets/icon/splitUnits16.json +1 -0
  77. package/assets/components/assets/icon/splitUnits24.json +1 -0
  78. package/assets/components/assets/icon/splitUnits32.json +1 -0
  79. package/assets/components/assets/icon/storage16.json +1 -0
  80. package/assets/components/assets/icon/storage24.json +1 -0
  81. package/assets/components/assets/icon/storage32.json +1 -0
  82. package/assets/components/assets/panel/t9n/messages.json +3 -1
  83. package/assets/components/assets/panel/t9n/messages_ar.json +3 -1
  84. package/assets/components/assets/panel/t9n/messages_bg.json +3 -1
  85. package/assets/components/assets/panel/t9n/messages_bs.json +3 -1
  86. package/assets/components/assets/panel/t9n/messages_ca.json +3 -1
  87. package/assets/components/assets/panel/t9n/messages_cs.json +3 -1
  88. package/assets/components/assets/panel/t9n/messages_da.json +3 -1
  89. package/assets/components/assets/panel/t9n/messages_de.json +3 -1
  90. package/assets/components/assets/panel/t9n/messages_el.json +3 -1
  91. package/assets/components/assets/panel/t9n/messages_en.json +3 -1
  92. package/assets/components/assets/panel/t9n/messages_es.json +3 -1
  93. package/assets/components/assets/panel/t9n/messages_et.json +3 -1
  94. package/assets/components/assets/panel/t9n/messages_fi.json +3 -1
  95. package/assets/components/assets/panel/t9n/messages_fr.json +3 -1
  96. package/assets/components/assets/panel/t9n/messages_he.json +3 -1
  97. package/assets/components/assets/panel/t9n/messages_hr.json +3 -1
  98. package/assets/components/assets/panel/t9n/messages_hu.json +3 -1
  99. package/assets/components/assets/panel/t9n/messages_id.json +3 -1
  100. package/assets/components/assets/panel/t9n/messages_it.json +3 -1
  101. package/assets/components/assets/panel/t9n/messages_ja.json +3 -1
  102. package/assets/components/assets/panel/t9n/messages_ko.json +3 -1
  103. package/assets/components/assets/panel/t9n/messages_lt.json +3 -1
  104. package/assets/components/assets/panel/t9n/messages_lv.json +3 -1
  105. package/assets/components/assets/panel/t9n/messages_nl.json +3 -1
  106. package/assets/components/assets/panel/t9n/messages_no.json +3 -1
  107. package/assets/components/assets/panel/t9n/messages_pl.json +3 -1
  108. package/assets/components/assets/panel/t9n/messages_pt-BR.json +3 -1
  109. package/assets/components/assets/panel/t9n/messages_pt-PT.json +3 -1
  110. package/assets/components/assets/panel/t9n/messages_ro.json +3 -1
  111. package/assets/components/assets/panel/t9n/messages_ru.json +3 -1
  112. package/assets/components/assets/panel/t9n/messages_sk.json +3 -1
  113. package/assets/components/assets/panel/t9n/messages_sl.json +3 -1
  114. package/assets/components/assets/panel/t9n/messages_sr.json +3 -1
  115. package/assets/components/assets/panel/t9n/messages_sv.json +3 -1
  116. package/assets/components/assets/panel/t9n/messages_th.json +3 -1
  117. package/assets/components/assets/panel/t9n/messages_tr.json +3 -1
  118. package/assets/components/assets/panel/t9n/messages_uk.json +3 -1
  119. package/assets/components/assets/panel/t9n/messages_vi.json +3 -1
  120. package/assets/components/assets/panel/t9n/messages_zh-CN.json +3 -1
  121. package/assets/components/assets/panel/t9n/messages_zh-HK.json +3 -1
  122. package/assets/components/assets/panel/t9n/messages_zh-TW.json +3 -1
  123. package/assets/components/assets/table/t9n/messages_ar.json +5 -5
  124. package/assets/components/assets/table/t9n/messages_bg.json +5 -5
  125. package/assets/components/assets/table/t9n/messages_bs.json +5 -5
  126. package/assets/components/assets/table/t9n/messages_ca.json +5 -5
  127. package/assets/components/assets/table/t9n/messages_cs.json +5 -5
  128. package/assets/components/assets/table/t9n/messages_da.json +5 -5
  129. package/assets/components/assets/table/t9n/messages_de.json +5 -5
  130. package/assets/components/assets/table/t9n/messages_el.json +5 -5
  131. package/assets/components/assets/table/t9n/messages_es.json +5 -5
  132. package/assets/components/assets/table/t9n/messages_et.json +5 -5
  133. package/assets/components/assets/table/t9n/messages_fi.json +5 -5
  134. package/assets/components/assets/table/t9n/messages_fr.json +4 -4
  135. package/assets/components/assets/table/t9n/messages_he.json +5 -5
  136. package/assets/components/assets/table/t9n/messages_hr.json +5 -5
  137. package/assets/components/assets/table/t9n/messages_hu.json +5 -5
  138. package/assets/components/assets/table/t9n/messages_id.json +5 -5
  139. package/assets/components/assets/table/t9n/messages_it.json +5 -5
  140. package/assets/components/assets/table/t9n/messages_ja.json +5 -5
  141. package/assets/components/assets/table/t9n/messages_ko.json +5 -5
  142. package/assets/components/assets/table/t9n/messages_lt.json +5 -5
  143. package/assets/components/assets/table/t9n/messages_lv.json +5 -5
  144. package/assets/components/assets/table/t9n/messages_nl.json +5 -5
  145. package/assets/components/assets/table/t9n/messages_no.json +5 -5
  146. package/assets/components/assets/table/t9n/messages_pl.json +5 -5
  147. package/assets/components/assets/table/t9n/messages_pt-BR.json +5 -5
  148. package/assets/components/assets/table/t9n/messages_pt-PT.json +5 -5
  149. package/assets/components/assets/table/t9n/messages_ro.json +5 -5
  150. package/assets/components/assets/table/t9n/messages_ru.json +5 -5
  151. package/assets/components/assets/table/t9n/messages_sk.json +5 -5
  152. package/assets/components/assets/table/t9n/messages_sl.json +5 -5
  153. package/assets/components/assets/table/t9n/messages_sr.json +5 -5
  154. package/assets/components/assets/table/t9n/messages_sv.json +5 -5
  155. package/assets/components/assets/table/t9n/messages_th.json +5 -5
  156. package/assets/components/assets/table/t9n/messages_tr.json +5 -5
  157. package/assets/components/assets/table/t9n/messages_uk.json +5 -5
  158. package/assets/components/assets/table/t9n/messages_vi.json +5 -5
  159. package/assets/components/assets/table/t9n/messages_zh-CN.json +5 -5
  160. package/assets/components/assets/table/t9n/messages_zh-HK.json +5 -5
  161. package/assets/components/assets/table/t9n/messages_zh-TW.json +5 -5
  162. package/assets/components/assets/table-cell/t9n/messages_ar.json +5 -5
  163. package/assets/components/assets/table-cell/t9n/messages_bg.json +5 -5
  164. package/assets/components/assets/table-cell/t9n/messages_bs.json +5 -5
  165. package/assets/components/assets/table-cell/t9n/messages_ca.json +5 -5
  166. package/assets/components/assets/table-cell/t9n/messages_cs.json +5 -5
  167. package/assets/components/assets/table-cell/t9n/messages_da.json +5 -5
  168. package/assets/components/assets/table-cell/t9n/messages_de.json +5 -5
  169. package/assets/components/assets/table-cell/t9n/messages_el.json +5 -5
  170. package/assets/components/assets/table-cell/t9n/messages_es.json +5 -5
  171. package/assets/components/assets/table-cell/t9n/messages_et.json +5 -5
  172. package/assets/components/assets/table-cell/t9n/messages_fi.json +5 -5
  173. package/assets/components/assets/table-cell/t9n/messages_fr.json +5 -5
  174. package/assets/components/assets/table-cell/t9n/messages_he.json +5 -5
  175. package/assets/components/assets/table-cell/t9n/messages_hr.json +5 -5
  176. package/assets/components/assets/table-cell/t9n/messages_hu.json +5 -5
  177. package/assets/components/assets/table-cell/t9n/messages_id.json +5 -5
  178. package/assets/components/assets/table-cell/t9n/messages_it.json +5 -5
  179. package/assets/components/assets/table-cell/t9n/messages_ja.json +5 -5
  180. package/assets/components/assets/table-cell/t9n/messages_ko.json +5 -5
  181. package/assets/components/assets/table-cell/t9n/messages_lt.json +5 -5
  182. package/assets/components/assets/table-cell/t9n/messages_lv.json +5 -5
  183. package/assets/components/assets/table-cell/t9n/messages_nl.json +5 -5
  184. package/assets/components/assets/table-cell/t9n/messages_no.json +5 -5
  185. package/assets/components/assets/table-cell/t9n/messages_pl.json +5 -5
  186. package/assets/components/assets/table-cell/t9n/messages_pt-BR.json +5 -5
  187. package/assets/components/assets/table-cell/t9n/messages_pt-PT.json +5 -5
  188. package/assets/components/assets/table-cell/t9n/messages_ro.json +5 -5
  189. package/assets/components/assets/table-cell/t9n/messages_ru.json +5 -5
  190. package/assets/components/assets/table-cell/t9n/messages_sk.json +5 -5
  191. package/assets/components/assets/table-cell/t9n/messages_sl.json +5 -5
  192. package/assets/components/assets/table-cell/t9n/messages_sr.json +5 -5
  193. package/assets/components/assets/table-cell/t9n/messages_sv.json +5 -5
  194. package/assets/components/assets/table-cell/t9n/messages_th.json +5 -5
  195. package/assets/components/assets/table-cell/t9n/messages_tr.json +5 -5
  196. package/assets/components/assets/table-cell/t9n/messages_uk.json +5 -5
  197. package/assets/components/assets/table-cell/t9n/messages_vi.json +5 -5
  198. package/assets/components/assets/table-cell/t9n/messages_zh-CN.json +5 -5
  199. package/assets/components/assets/table-cell/t9n/messages_zh-HK.json +5 -5
  200. package/assets/components/assets/table-cell/t9n/messages_zh-TW.json +5 -5
  201. package/assets/components/assets/table-header/t9n/messages_ar.json +6 -6
  202. package/assets/components/assets/table-header/t9n/messages_bg.json +6 -6
  203. package/assets/components/assets/table-header/t9n/messages_bs.json +6 -6
  204. package/assets/components/assets/table-header/t9n/messages_ca.json +6 -6
  205. package/assets/components/assets/table-header/t9n/messages_cs.json +6 -6
  206. package/assets/components/assets/table-header/t9n/messages_da.json +6 -6
  207. package/assets/components/assets/table-header/t9n/messages_de.json +6 -6
  208. package/assets/components/assets/table-header/t9n/messages_el.json +6 -6
  209. package/assets/components/assets/table-header/t9n/messages_es.json +6 -6
  210. package/assets/components/assets/table-header/t9n/messages_et.json +6 -6
  211. package/assets/components/assets/table-header/t9n/messages_fi.json +6 -6
  212. package/assets/components/assets/table-header/t9n/messages_fr.json +6 -6
  213. package/assets/components/assets/table-header/t9n/messages_he.json +6 -6
  214. package/assets/components/assets/table-header/t9n/messages_hr.json +6 -6
  215. package/assets/components/assets/table-header/t9n/messages_hu.json +6 -6
  216. package/assets/components/assets/table-header/t9n/messages_id.json +6 -6
  217. package/assets/components/assets/table-header/t9n/messages_it.json +6 -6
  218. package/assets/components/assets/table-header/t9n/messages_ja.json +6 -6
  219. package/assets/components/assets/table-header/t9n/messages_ko.json +6 -6
  220. package/assets/components/assets/table-header/t9n/messages_lt.json +6 -6
  221. package/assets/components/assets/table-header/t9n/messages_lv.json +6 -6
  222. package/assets/components/assets/table-header/t9n/messages_nl.json +6 -6
  223. package/assets/components/assets/table-header/t9n/messages_no.json +6 -6
  224. package/assets/components/assets/table-header/t9n/messages_pl.json +6 -6
  225. package/assets/components/assets/table-header/t9n/messages_pt-BR.json +6 -6
  226. package/assets/components/assets/table-header/t9n/messages_pt-PT.json +6 -6
  227. package/assets/components/assets/table-header/t9n/messages_ro.json +6 -6
  228. package/assets/components/assets/table-header/t9n/messages_ru.json +6 -6
  229. package/assets/components/assets/table-header/t9n/messages_sk.json +6 -6
  230. package/assets/components/assets/table-header/t9n/messages_sl.json +6 -6
  231. package/assets/components/assets/table-header/t9n/messages_sr.json +6 -6
  232. package/assets/components/assets/table-header/t9n/messages_sv.json +6 -6
  233. package/assets/components/assets/table-header/t9n/messages_th.json +6 -6
  234. package/assets/components/assets/table-header/t9n/messages_tr.json +6 -6
  235. package/assets/components/assets/table-header/t9n/messages_uk.json +6 -6
  236. package/assets/components/assets/table-header/t9n/messages_vi.json +6 -6
  237. package/assets/components/assets/table-header/t9n/messages_zh-CN.json +6 -6
  238. package/assets/components/assets/table-header/t9n/messages_zh-HK.json +6 -6
  239. package/assets/components/assets/table-header/t9n/messages_zh-TW.json +6 -6
  240. package/assets/components/assets/time-picker/t9n/messages_ar.json +3 -0
  241. package/assets/components/assets/time-picker/t9n/messages_bg.json +3 -0
  242. package/assets/components/assets/time-picker/t9n/messages_bs.json +3 -0
  243. package/assets/components/assets/time-picker/t9n/messages_ca.json +3 -0
  244. package/assets/components/assets/time-picker/t9n/messages_cs.json +3 -0
  245. package/assets/components/assets/time-picker/t9n/messages_da.json +3 -0
  246. package/assets/components/assets/time-picker/t9n/messages_de.json +3 -0
  247. package/assets/components/assets/time-picker/t9n/messages_el.json +3 -0
  248. package/assets/components/assets/time-picker/t9n/messages_es.json +3 -0
  249. package/assets/components/assets/time-picker/t9n/messages_et.json +3 -0
  250. package/assets/components/assets/time-picker/t9n/messages_fi.json +3 -0
  251. package/assets/components/assets/time-picker/t9n/messages_fr.json +3 -0
  252. package/assets/components/assets/time-picker/t9n/messages_he.json +3 -0
  253. package/assets/components/assets/time-picker/t9n/messages_hr.json +3 -0
  254. package/assets/components/assets/time-picker/t9n/messages_hu.json +3 -0
  255. package/assets/components/assets/time-picker/t9n/messages_id.json +3 -0
  256. package/assets/components/assets/time-picker/t9n/messages_it.json +3 -0
  257. package/assets/components/assets/time-picker/t9n/messages_ja.json +3 -0
  258. package/assets/components/assets/time-picker/t9n/messages_ko.json +3 -0
  259. package/assets/components/assets/time-picker/t9n/messages_lt.json +3 -0
  260. package/assets/components/assets/time-picker/t9n/messages_lv.json +3 -0
  261. package/assets/components/assets/time-picker/t9n/messages_nl.json +3 -0
  262. package/assets/components/assets/time-picker/t9n/messages_no.json +3 -0
  263. package/assets/components/assets/time-picker/t9n/messages_pl.json +3 -0
  264. package/assets/components/assets/time-picker/t9n/messages_pt-BR.json +3 -0
  265. package/assets/components/assets/time-picker/t9n/messages_pt-PT.json +3 -0
  266. package/assets/components/assets/time-picker/t9n/messages_ro.json +3 -0
  267. package/assets/components/assets/time-picker/t9n/messages_ru.json +3 -0
  268. package/assets/components/assets/time-picker/t9n/messages_sk.json +3 -0
  269. package/assets/components/assets/time-picker/t9n/messages_sl.json +3 -0
  270. package/assets/components/assets/time-picker/t9n/messages_sr.json +3 -0
  271. package/assets/components/assets/time-picker/t9n/messages_sv.json +3 -0
  272. package/assets/components/assets/time-picker/t9n/messages_th.json +3 -0
  273. package/assets/components/assets/time-picker/t9n/messages_tr.json +3 -0
  274. package/assets/components/assets/time-picker/t9n/messages_uk.json +3 -0
  275. package/assets/components/assets/time-picker/t9n/messages_vi.json +3 -0
  276. package/assets/components/assets/time-picker/t9n/messages_zh-CN.json +3 -0
  277. package/assets/components/assets/time-picker/t9n/messages_zh-HK.json +3 -0
  278. package/assets/components/assets/time-picker/t9n/messages_zh-TW.json +3 -0
  279. package/assets/esri/core/workers/RemoteClient.js +1 -1
  280. package/assets/esri/core/workers/chunks/0036b6df93a17e57e3b9.js +1 -0
  281. package/assets/esri/core/workers/chunks/09886c56427c4b3f18b5.js +1 -0
  282. package/assets/esri/core/workers/chunks/{5e9edd06e624f385fa4b.js → 121a9e148509f2fe2210.js} +1 -1
  283. package/assets/esri/core/workers/chunks/1461910bd37aea28948b.js +1 -0
  284. package/assets/esri/core/workers/chunks/16d45f439b89da3ec835.js +1 -0
  285. package/assets/esri/core/workers/chunks/1ef3533abdd937ae2794.js +1 -0
  286. package/assets/esri/core/workers/chunks/24ff267cf253feac22de.js +1 -0
  287. package/assets/esri/core/workers/chunks/{3c8613596659801fd6ab.js → 29cab345819ec02ed60a.js} +1 -1
  288. package/assets/esri/core/workers/chunks/{169a61c6e128b8a16021.js → 2c560a075d9ef2069ed1.js} +1 -1
  289. package/assets/esri/core/workers/chunks/2f8e71dac98135bbc3e6.js +1 -0
  290. package/assets/esri/core/workers/chunks/31cb4c73764555b40328.js +1 -0
  291. package/assets/esri/core/workers/chunks/341fb51b2165522963b3.js +1 -0
  292. package/assets/esri/core/workers/chunks/369f2ef414498c17a05a.js +1 -0
  293. package/assets/esri/core/workers/chunks/435f04e3964b1c6d4880.js +1 -0
  294. package/assets/esri/core/workers/chunks/44b870cb53ba68b17c32.js +1 -0
  295. package/assets/esri/core/workers/chunks/4781e2011a32d7724889.js +1 -0
  296. package/assets/esri/core/workers/chunks/{0526d623d0b4c12929bd.js → 4c3345ffbe79ee0167fb.js} +1 -1
  297. package/assets/esri/core/workers/chunks/{8a7fa4e8b0d14da7c9eb.js → 4cc680fe4c9c39d2f853.js} +1 -1
  298. package/assets/esri/core/workers/chunks/{6730c9f0890191a95fdb.js → 4d81aa50d90f5701a343.js} +1 -1
  299. package/assets/esri/core/workers/chunks/4e0bf30da4281070e453.js +1 -0
  300. package/assets/esri/core/workers/chunks/4e60ac00b15b34a3b5f5.js +1 -0
  301. package/assets/esri/core/workers/chunks/4e6bf1efe3b0b474cbb4.js +1 -0
  302. package/assets/esri/core/workers/chunks/505132c47dbdf5fdeacc.js +1 -0
  303. package/assets/esri/core/workers/chunks/5e907ec0ee1565b5fbbc.js +1 -0
  304. package/assets/esri/core/workers/chunks/66ba749ab0a631bbfdec.js +1 -0
  305. package/assets/esri/core/workers/chunks/6b14d89d689a21014aec.js +1 -0
  306. package/assets/esri/core/workers/chunks/{576269fd1f9049876aa1.js → 6b7b5544ed1f9a84623f.js} +1 -1
  307. package/assets/esri/core/workers/chunks/710a6268de62003af825.js +1 -0
  308. package/assets/esri/core/workers/chunks/77923afde29ae1ff10ca.js +1 -0
  309. package/assets/esri/core/workers/chunks/7cf7f2b991a7cbdad2ce.js +1 -0
  310. package/assets/esri/core/workers/chunks/{329669a9beda89b028dd.js → 7f6840c53a456524b74c.js} +1 -1
  311. package/assets/esri/core/workers/chunks/8634d6a62f4de973e39b.js +1 -0
  312. package/assets/esri/core/workers/chunks/{c7ebd5d431fb996bfcee.js → 9f8207c82a17508a87a8.js} +1 -1
  313. package/assets/esri/core/workers/chunks/{557305b91f77569ce664.js → a01ffe03b1465c21b9e6.js} +1 -1
  314. package/assets/esri/core/workers/chunks/a298c9031962951e55a9.js +1 -0
  315. package/assets/esri/core/workers/chunks/a877a4826cd6a46ec99b.js +1 -0
  316. package/assets/esri/core/workers/chunks/a9a0194120ec65a00f6d.js +1 -0
  317. package/assets/esri/core/workers/chunks/ad38e456a7cee940a165.js +1 -0
  318. package/assets/esri/core/workers/chunks/adf6bcf2447c95aeb440.js +1 -0
  319. package/assets/esri/core/workers/chunks/aeb3efa91165dd3d2493.js.LICENSE.txt +1 -1
  320. package/assets/esri/core/workers/chunks/b0526633a93ef69ec47b.js +1 -0
  321. package/assets/esri/core/workers/chunks/b3243695e0edfcbca276.js +1 -0
  322. package/assets/esri/core/workers/chunks/b98a2191cb997d632438.js +1 -0
  323. package/assets/esri/core/workers/chunks/c0061d993e1ede22b1dc.js +1 -0
  324. package/assets/esri/core/workers/chunks/{36c4b4c3eca57417da2c.js → c260ad3434bb00ba64a7.js} +1 -1
  325. package/assets/esri/core/workers/chunks/c2be3b9aa28e454cf931.js +1 -0
  326. package/assets/esri/core/workers/chunks/{39922ce232338de076ae.js → c459c8d8630eb4b955b1.js} +1 -1
  327. package/assets/esri/core/workers/chunks/c4df42fe859a9115a6e4.js +1 -0
  328. package/assets/esri/core/workers/chunks/c607fe4df3ca054f9aa8.js +1 -0
  329. package/assets/esri/core/workers/chunks/{b6847d68c35e7dbf6004.js → ca023e409bb7de9a69ab.js} +1 -1
  330. package/assets/esri/core/workers/chunks/ca85e88dad30b5f2956b.js +1 -0
  331. package/assets/esri/core/workers/chunks/{8e56d40691b6bf75d7cc.js → ce409944221a784ddb61.js} +1 -1
  332. package/assets/esri/core/workers/chunks/d13f75f233cf313e5a1d.js +1 -0
  333. package/assets/esri/core/workers/chunks/{77958089748dc31757cf.js → d6ded127949160103f69.js} +1 -1
  334. package/assets/esri/core/workers/chunks/d8c696da42f8f8919b83.js +1 -0
  335. package/assets/esri/core/workers/chunks/{304c81f6297ecba3a324.js → d95eed98316e59f8f35d.js} +1 -1
  336. package/assets/esri/core/workers/chunks/df7267892b6e0493e1d7.js +1 -0
  337. package/assets/esri/core/workers/chunks/{70dffbf49b0633b1a5f1.js → e52b9e423c0ba4134309.js} +1 -1
  338. package/assets/esri/core/workers/chunks/{52dca349e1a45555954d.js → e52d5a48e83d8df36f92.js} +1 -1
  339. package/assets/esri/core/workers/chunks/e53df0f018a82e3a35bd.js +1 -0
  340. package/assets/esri/core/workers/chunks/ea953f5a0a975f7bd7b9.js +1 -0
  341. package/assets/esri/core/workers/chunks/f183a4b52095e4c498b4.js +1 -0
  342. package/assets/esri/core/workers/chunks/{8e4c4ba900a90373217f.js → f221b9c6ae6c7eb4ca01.js} +1 -1
  343. package/assets/esri/core/workers/chunks/f6b7036114b1d754fdd9.js +1 -0
  344. package/assets/esri/core/workers/chunks/{c4631241dc777ca77aaa.js → f6c0680c535c5a3c73ee.js} +1 -1
  345. package/assets/esri/core/workers/chunks/f72a5af2a7ca1536f10a.js +1 -0
  346. package/assets/esri/core/workers/chunks/f99deed4120f605b6cd6.js +1 -0
  347. package/assets/esri/core/workers/chunks/fac3e57784d7f37053af.js +1 -0
  348. package/assets/esri/themes/base/widgets/_DirectionalPad.scss +2 -1
  349. package/assets/esri/themes/base/widgets/_FeatureForm.scss +10 -15
  350. package/assets/esri/themes/dark/main.css +1 -1
  351. package/assets/esri/themes/light/main.css +1 -1
  352. package/assets/esri/themes/light/view.css +1 -1
  353. package/chunks/ComponentShader.glsl.js +27 -27
  354. package/config.js +1 -1
  355. package/core/pbf.js +1 -1
  356. package/core/sql/WhereClauseCache.js +1 -1
  357. package/geometry/support/meshUtils/loadExternal.js +1 -1
  358. package/interfaces.d.ts +3 -51
  359. package/kernel.js +1 -1
  360. package/layers/GroupLayer.js +1 -1
  361. package/layers/SceneLayer.js +1 -1
  362. package/layers/graphics/data/AttributesBuilder.js +1 -1
  363. package/layers/graphics/data/FeatureStore.js +1 -1
  364. package/layers/graphics/data/QueryEngine.js +1 -1
  365. package/layers/graphics/data/QueryEngineResult.js +1 -1
  366. package/layers/graphics/data/attributeSupport.js +1 -1
  367. package/layers/graphics/data/geometryUtils.js +5 -0
  368. package/layers/graphics/data/queryUtils.js +5 -0
  369. package/layers/graphics/data/queryValidationUtils.js +5 -0
  370. package/layers/graphics/data/spatialQuerySupport.js +1 -1
  371. package/layers/graphics/editingSupport.js +1 -1
  372. package/layers/graphics/sources/WFSSourceWorker.js +1 -1
  373. package/layers/graphics/sources/geojson/GeoJSONSourceWorker.js +1 -1
  374. package/layers/graphics/sources/support/CSVSourceWorker.js +1 -1
  375. package/layers/graphics/sources/support/MemorySourceWorker.js +1 -1
  376. package/layers/mixins/OperationalLayer.js +1 -1
  377. package/layers/save/featureLayerUtils.js +1 -1
  378. package/layers/save/groupLayerUtils.js +5 -0
  379. package/layers/save/utils.js +1 -1
  380. package/layers/support/LayerLoadContext.js +5 -0
  381. package/layers/support/featureLayerUtils.js +1 -1
  382. package/layers/support/fieldProperties.js +1 -1
  383. package/layers/support/labelFormatUtils.js +1 -1
  384. package/layers/support/layersCreator.js +1 -1
  385. package/layers/support/rasterFormats/Lerc.js +1 -1
  386. package/layers/support/rasterFormats/RasterCodec.js +1 -1
  387. package/layers/support/rasterFormats/pixelRangeUtils.js +1 -1
  388. package/package.json +2 -2
  389. package/portal/schemas/definitions.js +1 -1
  390. package/portal/support/jsonContext.js +1 -1
  391. package/portal/support/layersLoader.js +1 -1
  392. package/portal/support/loadUtils.js +5 -0
  393. package/portal/support/portalItemUtils.js +1 -1
  394. package/portal/support/portalLayers.js +1 -1
  395. package/renderers/support/RasterSymbolizer.js +1 -1
  396. package/support/basemapUtils.js +1 -1
  397. package/support/revision.js +1 -1
  398. package/symbols/PolygonSymbol3D.js +1 -1
  399. package/symbols/cim/CIMSymbolHelper.js +1 -1
  400. package/views/2d/engine/BitmapContainer.js +1 -1
  401. package/views/2d/engine/BitmapTile.js +1 -1
  402. package/views/2d/engine/Container.js +1 -1
  403. package/views/2d/engine/DisplayObject.js +1 -1
  404. package/views/2d/engine/FeatureContainer.js +1 -1
  405. package/views/2d/engine/Stage.js +1 -1
  406. package/views/2d/engine/flow/FlowContainer.js +1 -1
  407. package/views/2d/engine/imagery/RasterBitmap.js +1 -1
  408. package/views/2d/engine/imagery/RasterVFContainer.js +1 -1
  409. package/views/2d/engine/imagery/colorizer/shadedrelief.js +1 -1
  410. package/views/2d/engine/imagery/colorizer/stretch.js +1 -1
  411. package/views/2d/engine/webgl/OverlayContainer.js +1 -1
  412. package/views/2d/engine/webgl/Painter.js +1 -1
  413. package/views/2d/engine/webgl/TileContainer.js +1 -1
  414. package/views/2d/engine/webgl/WGLContainer.js +1 -1
  415. package/views/2d/input/handlers/KeyPan.js +1 -1
  416. package/views/2d/input/handlers/KeyRotate.js +1 -1
  417. package/views/2d/layers/GroupLayerView2D.js +1 -1
  418. package/views/2d/layers/ImageryLayerView2D.js +1 -1
  419. package/views/2d/layers/MapNotesLayerView2D.js +1 -1
  420. package/views/2d/layers/features/controllers/FeatureController2D.js +1 -1
  421. package/views/2d/layers/features/support/FeatureFilter.js +1 -1
  422. package/views/2d/layers/features/support/FeatureSetReader.js +1 -1
  423. package/views/2d/layers/features/support/FeatureSetReaderPBFIndirect.js +1 -1
  424. package/views/3d/glTF/internal/Resource.js +1 -1
  425. package/views/3d/input/handlers/KeyboardNavigation.js +1 -1
  426. package/views/3d/interactive/visualElements/LineVisualElement.js +1 -1
  427. package/views/3d/layers/I3SMeshView3D.js +1 -1
  428. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  429. package/views/3d/layers/graphics/Graphics3DFeatureProcessor.js +1 -1
  430. package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
  431. package/views/3d/layers/graphics/Graphics3DMeshObject3DGraphicLayer.js +1 -1
  432. package/views/3d/layers/i3s/I3SQueryEngine.js +1 -1
  433. package/views/3d/layers/i3s/featureEditing.js +1 -1
  434. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  435. package/views/3d/webgl-engine/collections/Component/Material/shader/VertexDiscardByOpacity.glsl.js +1 -1
  436. package/views/3d/webgl-engine/core/shaderLibrary/hud/HUD.glsl.js +54 -33
  437. package/views/3d/webgl-engine/core/shaderLibrary/hud/HUDOcclusionPass.glsl.js +1 -2
  438. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  439. package/views/3d/webgl-engine/lib/edgeRendering/EdgeRenderer.js +1 -1
  440. package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
  441. package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
  442. package/views/3d/webgl-engine/materials/LineCalloutMaterial.js +1 -1
  443. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  444. package/views/3d/webgl-engine/shaders/HUDMaterialTechniqueConfiguration.js +1 -1
  445. package/views/3d/webgl-engine/shaders/LineCalloutTechniqueConfiguration.js +1 -1
  446. package/views/DOMContainer.js +1 -1
  447. package/views/input/VisibilityChange.js +5 -0
  448. package/views/interactive/SegmentLabels.js +1 -1
  449. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiledFetcher.js +1 -1
  450. package/webdoc/support/saveUtils.js +1 -1
  451. package/webdoc/webdocLoadUtils.js +1 -1
  452. package/webdoc/webdocSaveUtils.js +1 -1
  453. package/widgets/DirectionalPad/DirectionalPadViewModel.js +1 -1
  454. package/widgets/DirectionalPad/constants.js +1 -1
  455. package/widgets/DirectionalPad.js +1 -1
  456. package/widgets/Editor/EditorViewModel.js +1 -1
  457. package/widgets/Feature/FeatureRelationship/FeatureRelationshipViewModel.js +1 -1
  458. package/widgets/FeatureForm/FeatureFormViewModel.js +1 -1
  459. package/widgets/FeatureForm/FieldInput.js +1 -1
  460. package/widgets/FeatureForm/InputBase.js +1 -1
  461. package/widgets/FeatureForm/RelationshipInput.js +1 -1
  462. package/widgets/FeatureForm/css.js +1 -1
  463. package/widgets/FeatureForm/featureFormUtils.js +1 -1
  464. package/widgets/FeatureForm.js +1 -1
  465. package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
  466. package/widgets/FeatureTable/FieldColumn.js +1 -1
  467. package/widgets/UtilityNetworkAssociations/UtilityNetworkAssociationsViewModel.js +1 -1
  468. package/widgets/UtilityNetworkTrace/support/GeometryHandler.js +1 -1
  469. package/widgets/UtilityNetworkValidateTopology/UtilityNetworkValidateTopologyViewModel.js +1 -1
  470. package/widgets/support/dateUtils.js +1 -1
  471. package/assets/esri/core/workers/chunks/027f8b57565c65fbccda.js +0 -1
  472. package/assets/esri/core/workers/chunks/048265fb5953350e3e33.js +0 -1
  473. package/assets/esri/core/workers/chunks/0b9cf14f8aafb76c578b.js +0 -1
  474. package/assets/esri/core/workers/chunks/10fd951bd296b2beeeba.js +0 -1
  475. package/assets/esri/core/workers/chunks/1224475f3eefdfd59c76.js +0 -1
  476. package/assets/esri/core/workers/chunks/162b0220e24e9ba72655.js +0 -1
  477. package/assets/esri/core/workers/chunks/1e611cad53b745ee146f.js +0 -1
  478. package/assets/esri/core/workers/chunks/2688213bbff536da7917.js +0 -1
  479. package/assets/esri/core/workers/chunks/29ed31fd4f9d5cf53686.js +0 -1
  480. package/assets/esri/core/workers/chunks/2b6d1c8e4ed759767827.js +0 -1
  481. package/assets/esri/core/workers/chunks/34b44b0fab88f838885c.js +0 -1
  482. package/assets/esri/core/workers/chunks/364f55294a1d7bf163d7.js +0 -1
  483. package/assets/esri/core/workers/chunks/3714ab435dd5ccf9e694.js +0 -1
  484. package/assets/esri/core/workers/chunks/3788009a5ece453011f3.js +0 -1
  485. package/assets/esri/core/workers/chunks/3aafe8160b3bfbaa6935.js +0 -1
  486. package/assets/esri/core/workers/chunks/3e40c8402ff7a8fe48b9.js +0 -1
  487. package/assets/esri/core/workers/chunks/3e6255ab48b561af131e.js +0 -1
  488. package/assets/esri/core/workers/chunks/41c002e4c42c581cda8d.js +0 -1
  489. package/assets/esri/core/workers/chunks/47be4c75dd6372b96fe4.js +0 -1
  490. package/assets/esri/core/workers/chunks/4e8d1e6051f6654a5e83.js +0 -1
  491. package/assets/esri/core/workers/chunks/53746e9976758630159b.js +0 -1
  492. package/assets/esri/core/workers/chunks/5449fdd69e12e5cbd12a.js +0 -1
  493. package/assets/esri/core/workers/chunks/57ce4ece0147afb0d43c.js +0 -1
  494. package/assets/esri/core/workers/chunks/5e83d21400a5dec05c81.js +0 -1
  495. package/assets/esri/core/workers/chunks/6047f4487dcd37cca98e.js +0 -1
  496. package/assets/esri/core/workers/chunks/6967d2b3721678b38774.js +0 -1
  497. package/assets/esri/core/workers/chunks/6ac5ca7de651e3d672a1.js +0 -1
  498. package/assets/esri/core/workers/chunks/6b7ee9164149428edb9e.js +0 -1
  499. package/assets/esri/core/workers/chunks/6c495077cc79e1898927.js +0 -1
  500. package/assets/esri/core/workers/chunks/6d43648d5326e01b4474.js +0 -1
  501. package/assets/esri/core/workers/chunks/74fb07de0f990d45af89.js +0 -1
  502. package/assets/esri/core/workers/chunks/7c960a2694c4c3123acf.js +0 -1
  503. package/assets/esri/core/workers/chunks/8e9a52062ce059153a89.js +0 -1
  504. package/assets/esri/core/workers/chunks/919a57d372419785cd5e.js +0 -1
  505. package/assets/esri/core/workers/chunks/939f0a1a7d605e389e45.js +0 -1
  506. package/assets/esri/core/workers/chunks/9932f23ba6589df14a3d.js +0 -1
  507. package/assets/esri/core/workers/chunks/a25a38c9f338e0beffef.js +0 -1
  508. package/assets/esri/core/workers/chunks/a97581e584336b46ede7.js +0 -1
  509. package/assets/esri/core/workers/chunks/ad8e0f82cb1feafa9e2f.js +0 -1
  510. package/assets/esri/core/workers/chunks/b04eb35e06b1c5759ad0.js +0 -1
  511. package/assets/esri/core/workers/chunks/b1cb932cfadc4dc3f1e4.js +0 -1
  512. package/assets/esri/core/workers/chunks/b4f31d291c05b5f8ddac.js +0 -1
  513. package/assets/esri/core/workers/chunks/be3fb6113b0b27b94537.js +0 -1
  514. package/assets/esri/core/workers/chunks/c37119f5692e19aa1ce2.js +0 -1
  515. package/assets/esri/core/workers/chunks/c685f16435d9861bbbd0.js +0 -1
  516. package/assets/esri/core/workers/chunks/dca925a0d73f967f6897.js +0 -1
  517. package/assets/esri/core/workers/chunks/e6416a2684866d677b3e.js +0 -1
  518. package/assets/esri/core/workers/chunks/eb01f4cdb9b918cc61e7.js +0 -1
  519. package/assets/esri/core/workers/chunks/eb4aed4fdb44495a4fe6.js +0 -1
  520. package/assets/esri/core/workers/chunks/ec8258c9dc1491e97fc8.js +0 -1
  521. package/assets/esri/core/workers/chunks/eda86faa708cfe4c9f9a.js +0 -1
  522. package/assets/esri/core/workers/chunks/eeac53da496de4cd4182.js +0 -1
  523. package/layers/graphics/data/utils.js +0 -5
  524. package/views/2d/engine/webgl/GroupContainer.js +0 -5
  525. package/views/3d/analysis/DimensionAnalysisView3D.d.ts +0 -4
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../chunks/tslib.es6.js";import"../../../../geometry.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 t from"../../../../renderers/UniqueValueRenderer.js";import"../../../../renderers/support/jsonUtils.js";import i from"../../../../core/Logger.js";import"../../../../symbols.js";import r from"../../../../core/Accessor.js";import{isSome as s}from"../../../../core/arrayUtils.js";import"../../../../core/has.js";import a from"../../../../core/Error.js";import{makeHandle as n}from"../../../../core/handleUtils.js";import{someMap as o,findInMap as l}from"../../../../core/MapUtils.js";import{destroyMaybe as h,removeMaybe as d,disposeMaybe as p}from"../../../../core/maybe.js";import c from"../../../../core/PooledArray.js";import{throwIfAborted as y,createResolver as g,isAbortError as m}from"../../../../core/promiseUtils.js";import{watch as u,when as b,on as _,syncAndInitial as f,whenOnce as v}from"../../../../core/reactiveUtils.js";import{schedule as C}from"../../../../core/scheduling.js";import{property as S}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/accessorSupport/ensureType.js";import{subclass as w}from"../../../../core/accessorSupport/decorators/subclass.js";import{diff as G,isEmpty as R}from"../../../../core/accessorSupport/diffUtils.js";import{s as P,g as x,i as D}from"../../../../chunks/vec3.js";import{c as E}from"../../../../chunks/vec3f64.js";import{canProjectWithoutEngine as I}from"../../../../geometry/projection.js";import{projectBuffer as U}from"../../../../geometry/projection/projectBuffer.js";import{projectVectorToVector as A}from"../../../../geometry/projection/projectVectorToVector.js";import{projectXYZToVector as j}from"../../../../geometry/projection/projectXYZToVector.js";import{create as L,center as V,fromRect as O,equals as F}from"../../../../geometry/support/aaBoundingBox.js";import{create as T}from"../../../../geometry/support/aaBoundingRect.js";import{equals as k}from"../../../../geometry/support/spatialReferenceUtils.js";import z from"../../../../layers/Layer.js";import{getObjectId as M,computeAABB as W,hasGeometry as H}from"../../../../layers/graphics/dehydratedFeatures.js";import{hydrateGraphic as N}from"../../../../layers/graphics/hydratedFeatures.js";import{isSupportedRenderer3D as B,validateTo3D as q}from"../../../../renderers/support/rendererConversion.js";import{loadArcade as Y}from"../../../../support/arcadeOnDemand.js";import{isBasemapLayer as $}from"../../../../support/basemapUtils.js";import{getDefaultSymbol3D as Z}from"../../../../symbols/support/defaults3D.js";import{to3D as J}from"../../../../symbols/support/symbolConversion.js";import{averageSymbolComplexities as Q,defaultSymbolComplexity as X}from"./defaultSymbolComplexity.js";import{DisplayFeatureLimit as K}from"./DisplayFeatureLimit.js";import{ViewElevationProvider as ee}from"./ElevationQuery.js";import{VisibilityGroup as te,VisibilityFlag as ie}from"./enums.js";import{extractExpressionInfo as re,createContext as se}from"./featureExpressionInfoUtils.js";import{Graphics3DFeatureStore as ae}from"./Graphics3DFeatureStore.js";import{Graphics3DGraphicCreationContext as ne}from"./Graphics3DGraphicCreationContext.js";import{Graphics3DSymbolCreationContext as oe}from"./Graphics3DSymbolCreationContext.js";import{make as le}from"./Graphics3DSymbolFactory.js";import{Graphics3DWebStyleSymbol as he}from"./Graphics3DWebStyleSymbol.js";import{GraphicStateTracking as de}from"./GraphicStateTracking.js";import{computeCentroid as pe}from"./graphicUtils.js";import{ApplyRendererDiffResult as ce}from"./interfaces.js";import{LoadStatus as ye}from"./Loadable.js";import{SpatialIndex2D as ge}from"./SpatialIndex2D.js";import{StageLayerElevationProvider as me}from"../support/StageLayerElevationProvider.js";import{toBoundingRect as ue}from"../../support/extentUtils.js";import{PropertiesPool as be}from"../../support/PropertiesPool.js";import{GridLocalOriginFactory as _e}from"../../webgl-engine/lib/GridLocalOriginFactory.js";import{UpdatePolicy as fe}from"../../webgl-engine/lib/UpdatePolicy.js";import{affectsGeometry as ve}from"../../webgl-engine/lib/VertexAttribute.js";import{WebGLLayer as Ce}from"../../webgl-engine/lib/WebGLLayer.js";import{hasPopupTemplate as Se}from"../../../layers/support/popupUtils.js";import{ImmediateTask as we,noBudget as Ge,TaskPriority as Re,Task as Pe}from"../../../support/Scheduler.js";import xe from"../../../../geometry/Extent.js";import De from"../../../../geometry/Point.js";import Ee from"../../../../symbols/LabelSymbol3D.js";import Ie from"../../../../symbols/TextSymbol.js";import Ue from"../../../../symbols/WebStyleSymbol.js";var Ae;const je=E(),Le=L(),Ve="esri.views.3d.layers.graphics.Graphics3DCore",Oe=i.getLogger(Ve);let Fe=Ae=class extends r{get _viewSpatialReference(){return this.owner.view.spatialReference}get spatialIndex(){return this._spatialIndex||(this._spatialIndex=new ge({objectIdField:this.owner.layer?.objectIdField,spatialReference:this._viewSpatialReference,hasZ:!!this.hasZ,hasM:!!this.hasM}),this._spatialIndex.setup(Array.from(this.graphics3DGraphics.values()))),this._spatialIndex.update(),this._spatialIndex}get numberOfGraphics(){return this._numberOfGraphics}get effectiveUpdatePolicy(){return null!=this.currentRenderer&&"dictionary"===this.currentRenderer.type?fe.ASYNC:this._forcedUpdatePolicy??this.preferredUpdatePolicy}get featureStore(){return this._featureStore}get initializePromise(){return this._initializePromise}get scaleVisibility(){return this._scaleVisibility}get elevationAlignment(){return this._elevationAlignment}get objectStates(){return this._objectStates}get filterVisibility(){return this._filterVisibility}get updating(){return!!(this._graphicsWaitingForSymbol.size>0||this.running||this._elevationAlignment?.updating||null!=this._scaleVisibility&&this._scaleVisibility.updating||null!=this._filterVisibility&&this._filterVisibility.updating||this._rendererChangeAbortController||this._elevationInfoChangeAbortController||this._updatingPendingLoadedGraphicsChange||this._frameTask.updating||this._loadingSymbols>0)}get running(){return this._pendingUpdates.size>0||!!this._spatialIndex?.updating}get suspendedOrOutsideOfView(){return this.owner.suspended||!!this.owner.suspendInfo?.outsideOfView}get updatingRemaining(){return this.updating?this._pendingUpdates.size+.1*(this._spatialIndex?.updatingRemaining||0)+.1*(this._elevationAlignment?.updatingRemaining||0):0}get displayFeatureLimit(){const e=this.owner&&this.owner.view&&this.owner.view.qualitySettings,t=e?.graphics3D.minTotalNumberOfFeatures??0,i=e?.graphics3D.maxTotalNumberOfFeatures??0,r=e?.graphics3D.maxNumberOfDrawCalls??0,s=e?.graphics3D.maxTotalNumberOfVertices??0,a=this.averageSymbolComplexity,n=Math.max(1,a?.verticesPerFeature??1),o=a&&a.drawCallsPerFeature>0&&r>0?r/a.drawCallsPerFeature:i,l=Math.ceil(s/n),h=Math.max(t,Math.min(i,l,o)),d=this._get("displayFeatureLimit");return d&&d.maximumTotalNumberOfVertices===s&&d.averageSymbolComplexity===a&&d.maximumNumberOfFeatures===h?d:new K(s,h,a)}get averageSymbolComplexity(){const e=Q(this._symbolComplexities),t=this._get("averageSymbolComplexity");return 0===e.numComplexities||null!=t&&(e.estimated&&(t.verticesPerFeature>=e.verticesPerFeature||t.verticesPerCoordinate>=e.verticesPerCoordinate||t.drawCallsPerFeature>=e.drawCallsPerFeature)||t.verticesPerFeature===e.verticesPerFeature&&t.verticesPerCoordinate===e.verticesPerCoordinate&&t.drawCallsPerFeature===e.drawCallsPerFeature)?t:e}get usedMemory(){const e=null!=this.averageSymbolComplexity&&this.labelsEnabled?this.averageSymbolComplexity.memory.bytesPerFeatureLabel*this._numberOfGraphics:0,t=this._getSymbolComplexitiesUsed().reduce(((e,t)=>e+t.memory.resourceBytes),0),i=this.owner.view._stage.renderer,r=this.owner.view.basemapTerrain.overlayManager.renderer,s=Array.from(this._symbols.values()).reduce(((e,t)=>e+(t?.symbolLayers.reduce(((e,t)=>e+(t?.materials.reduce(((e,t)=>e+i.getMemoryForMaterial(t)+r.getMemoryForMaterial(t)),0)??0)),0)??0)),0);return this._usedMemory+e+t+s}get usedMemoryPerGraphic(){if(this._usedMemory&&this._numberOfGraphics){const e=this._numberOfGraphics/(this._numberOfGraphics+Math.max(this._pendingAdds,this._pendingRemoves));return this._usedMemory/this._numberOfGraphics*e}if(null!=this.averageSymbolComplexity){const e=this.labelsEnabled?this.averageSymbolComplexity.memory.bytesPerFeatureLabel:0;return this.averageSymbolComplexity.memory.bytesPerFeature+e}return 0}get unprocessedMemoryEstimate(){return(this._pendingAdds-this._pendingRemoves)*this.usedMemoryPerGraphic}get _symbolComplexities(){return this.currentRenderer?this._getSymbolComplexitiesUsedOrRenderer(this.currentRenderer):this._getSymbolComplexitiesUsed()}get visible(){return this._visible}_getConvertedSymbol(e){if("web-style"===e.type)return e.clone();const t=this._symbolConversionCache.get(e.id);if(null!=t)return t;const i=J(e,{geometryType:this.layer?.geometryType??void 0,retainId:!0,hasLabelingContext:this._hasLabelingContext(e)}),r=i.symbol||null;return null==r&&i.error&&Oe.error(i.error.message),this._symbolConversionCache.set(e.id,r),r}_getSymbolComplexitiesUsedOrRenderer(e){if(null==e)return[];const t=e.getSymbols(),i="backgroundFillSymbol"in e?e.backgroundFillSymbol:null;if(!i&&!t?.length)return[];const r=[],s=this._getSymbolComplexityUsedOrRenderer(i);null!=s&&r.push(s);for(const a of t){const e=this._getSymbolComplexityUsedOrRenderer(a);null!=e&&r.push(e)}return r}_getSymbolComplexityUsedOrRenderer(e){if(null==e)return null;const t=this._symbols.get(e.id);if(null!=t)return t.complexity;const i=this._getConvertedSymbol(e);return null!=i?X(i):null}_getSymbolComplexitiesUsed(){const e=[];return this._symbols.forEach((t=>{null!=t&&e.push(t.complexity)})),e}get _objectIdField(){return this.layer.objectIdField}constructor(e){super(e),this._propertiesPool=new be({computedExtent:xe},this),this.computedExtent=null,this.currentRenderer=null,this.rendererHasGeometryOperations=!1,this._graphicStateTracking=null,this.graphics3DGraphics=new Map,this.stageLayer=null,this.stage=null,this._graphicsDrapedUids=new Set,this._graphicsBySymbol=new Map,this._symbolConversionCache=new Map,this._symbols=new Map,this._graphicsWithoutSymbol=new Map,this._graphicsWaitingForSymbol=new Map,this._graphicsUpdateId=0,this._frameTask=we,this._suspendSymbolCleanup=!1,this._arcadeOnDemand=null,this._rendererChangeAbortController=null,this._elevationInfoChangeAbortController=null,this._initializeAbortController=null,this._scaleVisibility=null,this._filterVisibility=null,this._spatialIndex=null,this.extentPadding=0,this._updatingPendingLoadedGraphicsChange=null,this._featureStore=null,this._deconflictor=null,this._labeler=null,this._objectStates=null,this._viewElevationProvider=null,this._stageLayerElevationProvider=null,this._sharedSymbolResourcesOwnerHandle=null,this._whenGraphics3DGraphicRequests={},this._pendingUpdates=new Map,this._numberOfGraphics=0,this._numberOfGraphicsProvidingElevation=0,this._pendingAdds=0,this._pendingRemoves=0,this._applyPendingRemovesFirst=!1,this._loadingSymbols=0,this._pendingUpdatesPool=new c({allocator:e=>e||new ke,deallocator:e=>(e.clear(),e)}),this._symbolWarningLogged=!1,this._geometryWarningLogged=!1,this._objectIdInvisibleSet=new Set,this._whenSymbolRemoved=new c,this.preferredUpdatePolicy=fe.SYNC,this._forcedUpdatePolicy=null,this.elevationFeatureExpressionEnabled=!0,this.owner=null,this.layer=null,this.graphicSymbolSupported=!0,this.getRenderingInfoWithoutRenderer=!1,this.setUidToIdOnAdd=!0,this.hasZ=null,this.hasM=null,this._usedMemory=0,this._visible=!1,this._startCreateGraphics=!1,this.symbolCreationContext=new oe(e.owner.view.resourceController.scheduler,((e,t)=>this._frameTask.schedule(e,t)))}initialize(){this._featureStore=new ae({objectIdField:this.owner.layer?.objectIdField,hasZ:!!this.hasZ,hasM:!!this.hasM,viewSpatialReference:this._viewSpatialReference,featureSpatialReference:this.owner.featureSpatialReference,getSpatialIndex:()=>this.spatialIndex,forEach:e=>this.graphics3DGraphics.forEach(e)});const e=(e,t,i)=>this.spatialIndex.queryGraphicUIDsInExtent(e,t,i),{componentFactories:t}=this;if(null!=t.elevationAlignment){const i=t.elevationAlignment(this,e);this._elevationAlignment=i}if(null!=t.scaleVisibility){const i=t.scaleVisibility(this,e);this._scaleVisibility=i}if(null!=t.filterVisibility){const e=t.filterVisibility({featureStore:this._featureStore,getFeatureCount:()=>this.graphics3DGraphics.size,updateFeatureVisibilities:e=>this.modifyGraphics3DGraphicVisibilities((t=>t.setVisibilityFlag(te.GRAPHIC,ie.FILTER,e(M(t.graphic,this._objectIdField))))),setAllFeaturesVisibility:e=>this.modifyGraphics3DGraphicVisibilities((t=>t.setVisibilityFlag(te.GRAPHIC,ie.FILTER,e))),clearFeaturesVisibility:()=>this.modifyGraphics3DGraphicVisibilities((e=>e.setVisibilityFlag(te.GRAPHIC,ie.FILTER,!0)))});this._filterVisibility=e}if(null!=t.deconflictor){const e=t.deconflictor(this);this._deconflictor=e}if(null!=t.labeler&&null!=this._scaleVisibility){const e=t.labeler(this,this._scaleVisibility);this._labeler=e}if(null!=t.objectStates){const e=t.objectStates(this);this._objectStates=e}this._initializeAbortController=new AbortController,this._initializePromise=this._initializeAsync()}async _initializeAsync(){const e=this._initializeAbortController?.signal,t=this.owner.view;this._viewElevationProvider=new ee(this._viewSpatialReference,t),this._initializeStage(t,this.layer.uid);const i=t.sharedSymbolResources;this.symbolCreationContext.sharedResources=i,this._sharedSymbolResourcesOwnerHandle=i.addGraphicsOwner(this.owner),null!=this.currentRenderer&&(this.symbolCreationContext.renderer=this.currentRenderer),this.symbolCreationContext.stage=this.stage,this.symbolCreationContext.streamDataRequester=i.streamDataRequester,this.symbolCreationContext.renderCoordsHelper=t.renderCoordsHelper,this.symbolCreationContext.layer=this.layer,this.symbolCreationContext.graphicsCoreOwner=this.owner,this.symbolCreationContext.localOriginFactory=new _e(t.renderSpatialReference),this.symbolCreationContext.elevationProvider=t.elevationProvider,this.symbolCreationContext.notifyGraphicGeometryChanged=e=>this.notifyGraphicGeometryChanged(e),this.symbolCreationContext.notifyGraphicVisibilityChanged=e=>this.notifyGraphicVisibilityChanged(e);const r=re(this.layer.elevationInfo,this.elevationFeatureExpressionEnabled);if(this.symbolCreationContext.featureExpressionInfoContext=await se(r,this._viewSpatialReference,e,Oe),y(e),this.symbolCreationContext.screenSizePerspectiveEnabled=t.screenSizePerspectiveEnabled&&!!this.layer.screenSizePerspectiveEnabled,this.symbolCreationContext.slicePlaneEnabled=!!this.owner.slicePlaneEnabled,this.symbolCreationContext.physicalBasedRenderingEnabled=!!this.owner.view.qualitySettings?.physicallyBasedRenderingEnabled,this.symbolCreationContext.skipHighSymbolLods=!!this.owner.view.qualitySettings?.graphics3D?.skipHighSymbolLods,"drapeSourceType"in this.owner){const{owner:e}=this;this.symbolCreationContext.drapeSourceRenderer=t.basemapTerrain.overlayManager.registerGeometryDrapeSource(e),this.addHandles(n((()=>t.basemapTerrain.overlayManager.unregisterDrapeSource(e))))}this.addHandles([u((()=>this.suspendedOrOutsideOfView),(()=>this._frameTask.reschedule((()=>this._updateLayerVisibility())))),u((()=>[this.layer?.screenSizePerspectiveEnabled,this.owner.view?.screenSizePerspectiveEnabled]),(()=>{const e=t.screenSizePerspectiveEnabled&&!!this.layer.screenSizePerspectiveEnabled;e!==this.symbolCreationContext.screenSizePerspectiveEnabled&&(this.symbolCreationContext.screenSizePerspectiveEnabled=e,this._labeler?.reset(),this.recreateAllGraphicsAndSymbols())})),u((()=>this.owner.slicePlaneEnabled),(e=>this._slicePlaneEnabledChange(!!e))),u((()=>this.owner.view.state?.rasterPixelRatio),(()=>this._pixelRatioChange())),u((()=>!!this.owner.view.qualitySettings?.physicallyBasedRenderingEnabled),(e=>this._physicalBasedRenderingChange(e))),u((()=>!!this.owner.view.qualitySettings?.graphics3D?.skipHighSymbolLods),(e=>this._skipHighSymbolLoDsChange(e))),b((()=>t.basemapTerrain?.tilingScheme),(e=>{if(e.spatialReference.equals(this.symbolCreationContext.overlaySR)||null==t.basemapTerrain.spatialReference||(this.symbolCreationContext.overlaySR=t.basemapTerrain.spatialReference),this.hasHandles("loaded-graphics"))this.recreateAllGraphics();else{const e=()=>this.owner?.loadedGraphics;this.addHandles([_(e,"change",(e=>{this._graphicsCollectionChanged(e),this._signalUpdatingDuringAsyncLoadedGraphicsChange()}),{onListenerAdd:()=>{this.recreateAllGraphics(),this._signalUpdatingDuringAsyncLoadedGraphicsChange()}})],"loaded-graphics")}}),{initial:!0}),u((()=>this.effectiveUpdatePolicy),(e=>{null!=this.stageLayer&&(this.stageLayer.updatePolicy=e),this.symbolCreationContext.isAsync=this.effectiveUpdatePolicy===fe.ASYNC,e===fe.SYNC&&this.runTask(Ge)}),f)]),this._frameTask=t.resourceController.scheduler.registerTask(Re.GRAPHICS_CORE,this),this.layer&&"featureReduction"in this.layer&&this.addHandles(u((()=>this.layer.featureReduction),(()=>this._deconflictor.featureReductionChange()))),this.notifyChange("averageSymbolComplexity"),this.rendererChange(this.owner.renderer).catch((()=>{})),this._initializeAbortController=null}_abortInitialize(){this._initializeAbortController&&(this._initializeAbortController.abort(),this._initializeAbortController=null)}destroy(){this._abortInitialize(),this._abortRendererChange(),this._abortElevationInfoChange(),this._frameTask.remove(),this._frameTask=we,this.owner.view?.deconflictor?.removeGraphicsOwner(this),this.owner.view?.labeler?.removeGraphicsOwner(this),this._elevationAlignment=h(this._elevationAlignment),this._scaleVisibility=h(this._scaleVisibility),this._filterVisibility=h(this._filterVisibility),this._deconflictor=null,this._labeler=null,this._objectStates=h(this._objectStates),this.clear(),this._featureStore=h(this._featureStore),this._updatingPendingLoadedGraphicsChange=d(this._updatingPendingLoadedGraphicsChange),this._graphicStateTracking=h(this._graphicStateTracking),this.stage&&(this.stageLayer=h(this.stageLayer),this.stage=null),this._set("owner",null);for(const e in this._whenGraphics3DGraphicRequests)this._whenGraphics3DGraphicRequests[e].reject(new a("graphic:layer-destroyed","Layer has been destroyed"));this._whenGraphics3DGraphicRequests=null,this._sharedSymbolResourcesOwnerHandle=d(this._sharedSymbolResourcesOwnerHandle),this._propertiesPool=h(this._propertiesPool),this._pendingUpdatesPool=null,this._symbolConversionCache.clear(),this._objectIdInvisibleSet.clear(),this._spatialIndex=h(this._spatialIndex)}clear(){this._objectStates?.allGraphicsDeleted(),null!=this._graphicStateTracking&&this._graphicStateTracking.allGraphicsDeleted(),this.graphics3DGraphics.forEach((e=>e.destroy())),this._spatialIndex?.clear(),this.graphics3DGraphics.clear(),this._numberOfGraphics=0,this._usedMemory=0,this._updateLayerVisibility(),this._symbols.forEach(h),this._symbols.clear(),this._graphicsBySymbol.clear(),this._graphicsWithoutSymbol.clear(),this._graphicsWaitingForSymbol.clear(),this._pendingUpdates.clear(),this._pendingUpdatesPool.clear(),this._pendingAdds=0,this._pendingRemoves=0,this._applyPendingRemovesFirst=!1,this.notifyChange("updating"),this.notifyChange("running"),this.notifyChange("updatingRemaining"),this._featureStore.events.emit("changed")}_initializeStage(e,t){this.stage=e._stage,this.stageLayer=new Ce(this.stage,{pickable:!this.suspendedOrOutsideOfView,updatePolicy:this.effectiveUpdatePolicy},t);const i=this.stageLayer.events;i.on("transformationChanged",(e=>this.notifyGraphicGeometryChanged(e.graphicUid))),i.on("shaderTransformationChanged",(e=>this.notifyGraphicGeometryChanged(e.graphicUid))),i.on("visibilityChanged",(e=>this.notifyGraphicVisibilityChanged(e.graphicUid))),i.on("geometryAdded",(e=>this.notifyGraphicGeometryChanged(e.object.graphicUid))),i.on("geometryRemoved",(e=>this.notifyGraphicGeometryChanged(e.object.graphicUid))),i.on("attributesChanged",(e=>ve(e.attribute)&&this.notifyGraphicGeometryChanged(e.object.graphicUid)))}notifyGraphicGeometryChanged(e){if(null==this._graphicStateTracking||null==e)return;const t=this.graphics3DGraphics.get(e);t&&this._graphicStateTracking.updateGraphicGeometry(t)}notifyGraphicVisibilityChanged(e){if(null==this._graphicStateTracking||null==e)return;const t=this.graphics3DGraphics.get(e);t&&this._graphicStateTracking.updateGraphicVisibility(t)}_updateLayerVisibility(){const e=this.displayFeatureLimit.maximumNumberOfFeatures,t=this._numberOfGraphics>e*ze,i=!this.suspendedOrOutsideOfView&&!t;i!==this._visible&&(this._visible=i,i?(this.stageLayer.pickable=!0,this.updateAllGraphicsVisibility()):(this.stageLayer.pickable=!1,this._hideAllGraphics()),this._updateStageLayerVisibility())}_updateStageLayerVisibility(){this.stageLayer.visible=this._visible&&(null==this.layer.opacity||this.layer.opacity>0)}getGraphics3DGraphicById(e){return null!=e?this.graphics3DGraphics.get(e):void 0}getGraphics3DGraphicByObjectId(e){return this.owner.layer?.objectIdField?this._findGraphics3DGraphicByObjectId(e):null}_getGraphicObjectID(e,t=this.owner.layer?.objectIdField){return M(e,t)}get graphics3DGraphicsByObjectID(){const e=this.owner.layer?.objectIdField;if(!e)return;const t=new Map;return this.graphics3DGraphics.forEach((i=>{if(!i)return;const r=i.graphic,s=this._getGraphicObjectID(r,e);null!=s&&t.set(s,i)})),t}get labelsEnabled(){return!(!this._labeler||!this._labeler.layerLabelsEnabled())}async updateLabelingInfo(e){const t=this._deconflictor&&this._deconflictor.labelingInfoChange(e),i=this._labeler&&this._labeler.labelingInfoChange(e);await Promise.allSettled([t,i])}updateVisibilityInfo(){this._deconflictor&&this._deconflictor.labelingInfoChange(),this._labeler&&this._labeler.visibilityInfoChange()}get symbolUpdateType(){if(this._pendingUpdates.size>0)return"unknown";let e=0,t=0;return o(this._symbols,((i,r)=>{if(null!=i){const s=i.getFastUpdateStatus();if(s.loading>0)return!0;this._graphicsBySymbol.has(r)&&(t+=s.fast,e+=s.slow)}return!1}))?"unknown":t>=0&&0===e?"fast":e>=0&&0===t?"slow":"mixed"}runTask(e){if(this._frameTask.processQueue(e),this._applyPendingUpdates(e),this.notifyChange("running"),this.running||this.notifyChange("updating"),this.notifyChange("updatingRemaining"),!e.hasProgressed)return Pe.YIELD}setObjectIdVisibility(e,t){t?this._objectIdInvisibleSet.delete(e):this._objectIdInvisibleSet.add(e);const i=this._findGraphics3DGraphicByObjectId(e);null!=i&&this._updateUserVisibility(i)}_findGraphics3DGraphicByObjectId(e){return l(this.graphics3DGraphics,(t=>this._getGraphicObjectID(t.graphic)===e))}_updateUserVisibility(e){if(null==e)return!1;const t=e.graphic,i=this._getGraphicObjectID(t),r=t.visible&&!this.owner.suspended&&(null==i||!this._objectIdInvisibleSet.has(i));return e.setVisibilityFlag(te.GRAPHIC,ie.USER,r)}_whenGraphics3DGraphic(e){const t=this.graphics3DGraphics.get(e.uid);if(t)return Promise.resolve(t);const i=this._whenGraphics3DGraphicRequests[e.uid];if(i)return i.promise;const r=g();return this._whenGraphics3DGraphicRequests[e.uid]=r,r.promise}async _boundsForGraphics3DGraphic(e,t){const i=this._viewSpatialReference,r=this.owner.view.renderSpatialReference,s=this.owner.view.basemapTerrain.spatialReference,a=(e,t,s)=>U(e,r,t,e,i,t,s),n=(e,t,r)=>U(e,s,t,e,i,t,r),o=this._viewElevationProvider?{service:this._viewElevationProvider,useViewElevation:null!=t&&!!t.useViewElevation,minDemResolution:null!=t?t.minDemResolution:null,minDemResolutionForPoints:this.owner.view.resolution}:null,l=await e.getProjectedBoundingBox(a,n,o,t?.signal);if(!l)return null;const h=l.boundingBox;if(l.requiresDrapedElevation){const e=this.symbolCreationContext.elevationProvider;if(e){V(h,je);const t=e.getElevation(je[0],je[1],0,i,"ground")??0;h[2]=Math.min(h[2],t),h[5]=Math.max(h[5],t)}}return{boundingBox:h,screenSpaceObjects:l.screenSpaceObjects}}async whenGraphicBounds(e,t){await v((()=>this.owner?.loadedGraphics));const i=this.owner.layer?.objectIdField,r=this.owner.loadedGraphics.find((t=>t===e||null!=i&&null!=t.attributes&&e.attributes&&t.attributes[i]===e.attributes[i]));if(!r)throw new a("internal:graphic-not-part-of-view","Graphic is not part of this view");const s=await this._whenGraphics3DGraphic(r);return this._boundsForGraphics3DGraphic(s,t)}computeAttachmentOrigin(e,t){const i=this.graphics3DGraphics.get(e.uid);if(!i)return null;const r=i.computeAttachmentOrigin();if(0===r.render.num&&0===r.draped.num)return null;P(Me,0,0,0);let s=0;if(r.render.num>0){if(!A(r.render.origin,this.symbolCreationContext.renderCoordsHelper.spatialReference,We,t))return null;x(Me,Me,We),s++}if(r.draped.num>0){const[e,i]=r.draped.origin,a=this._viewElevationProvider.getElevation(e,i,"ground")??0;if(P(We,e,i,a),!A(We,this._viewElevationProvider.spatialReference,We,t))return null;x(Me,Me,We),s++}return s>1&&D(Me,Me,1/s),new De({x:Me[0],y:Me[1],z:Me[2],spatialReference:t})}getSymbolLayerSize(e,t){const i=this._symbols.get(e.id);if(null==i)throw new a("internal:symbol-not-part-of-view","Symbol is not part of this view");const r=e.symbolLayers.indexOf(t);if(-1===r)throw new a("internal:missing-symbol-layer","Symbol layer is not in symbol");const s=i.getSymbolLayerSize(r);if(null==s)throw new a("internal:missing-size","Symbol layer has no valid size");return s}_graphicsCollectionChanged(e){this._startCreateGraphics&&(this.add(e.added),this.remove(e.removed))}graphicUpdateHandler(e){const t=e.graphic.uid,i=this.graphics3DGraphics.get(t);if(null!=i||null!=this._graphicsWithoutSymbol.get(t))switch(e.property){case"visible":this._graphicUpdateVisibleHandler(i);break;case"geometry":this._graphicUpdateGeometryHandler(i,e);break;case"symbol":this._graphicUpdateSymbolHandler(i,e);break;case"attributes":break;case"origin-transform":this._graphicUpdateTransformHandler(i,e)}}_graphicUpdateGeometryHandler(e,t){this._graphicUpdateGeometryOrTransformHandler(e,t,(()=>null!=t.newValue&&null!=e&&e.graphics3DSymbol.updateGeometry(e,t.newValue)));const i=t.graphic.geometry;null!=i&&this._expandComputedExtent(i)}_graphicUpdateTransformHandler(e,t){const i=t.graphic.geometry;this._graphicUpdateGeometryOrTransformHandler(e,t,(()=>null!=t.newValue&&null!=e&&null!=i&&e.graphics3DSymbol.updateTransform(e,i.spatialReference,t.newValue,t.action)))}_graphicUpdateGeometryOrTransformHandler(e,t,i){if(null!=t.graphic.geometry)if(null!=e)i()||this._recreateGraphic(e.graphic);else{const e=t.graphic.symbol?.id;if(e){const t=this._symbols.get(e);if(null!=t&&t.loadStatus===ye.LOADING)return}this._recreateGraphic(t.graphic)}else this._recreateGraphic(t.graphic)}_graphicUpdateSymbolHandler(e,t){const i=t.graphic,r=null!=e?e.graphics3DSymbol:null!=t.oldValue?this._symbols.get(t.oldValue.id):null;if(null==r||null==t.newValue)return void this._recreateGraphic(i);const s=r.symbol,a=this._getConvertedSymbol(t.newValue);if(null!=a&&(a.type!==s.type||"web-style"===a.type)||"web-style"===s.type)return void this._recreateGraphic(i);const n=this._graphicsBySymbol.get(s.id);if(n&&1!==n.size)return void this._recreateGraphic(i);const o=G(s,a);if(null==o)return void this._updateSymbolMapping(s.id,a);const l={diff:o,graphics3DGraphicPatches:[],symbolStatePatches:[]};if(r.prepareSymbolPatch(l),!R(l.diff))return void this._recreateGraphic(i);const h=this._getRenderingInfo(i);if(null==h)return void this._recreateGraphic(i);const d=r.extentPadding;for(const p of l.symbolStatePatches)p();if(d!==r.extentPadding&&this._recomputeExtentPadding(),null!=e)for(const p of l.graphics3DGraphicPatches)p(e,h);this._updateSymbolMapping(s.id,a)}_graphicUpdateVisibleHandler(e){this._updateUserVisibility(e)&&(this._labeler&&this.owner.view.labeler.setDirty(),this.owner.view.deconflictor.setDirty())}recreateGraphics(e){this._suspendSymbolCleanup=!0,this.remove(e),this.add(e),this._suspendSymbolCleanup=!1,this.effectiveUpdatePolicy===fe.SYNC&&this._cleanupSymbols()}_recreateGraphic(e){this.recreateGraphics([e])}_beginGraphicUpdate(e){const t=this._graphicsUpdateId;return this._graphicsUpdateId++,this._graphicsWaitingForSymbol.set(e.uid,t),1===this._graphicsWaitingForSymbol.size&&this.notifyChange("updating"),t}_endGraphicUpdate(e){e&&(this._graphicsWaitingForSymbol.delete(e.uid),0===this._graphicsWaitingForSymbol.size&&(this._cleanupSymbols(),this.notifyChange("updating")))}_recomputeExtentPadding(){let e=0;this._symbols.forEach((t=>{null!=t&&(e=Math.max(e,t.extentPadding))})),this._set("extentPadding",e)}_expandComputedExtent(e){const t=Le,i=e.spatialReference;W(e,t);const r=this._viewSpatialReference,s=Ae.tmpVec;if(k(i,r)||j(t[0],t[1],0,i,s,r)&&(t[0]=s[0],t[1]=s[1],j(t[3],t[4],0,i,s,r),t[3]=s[0],t[4]=s[1]),!(isFinite(t[0])&&isFinite(t[3])&&isFinite(t[1])&&isFinite(t[4])))return;const a=this.computedExtent;let n=null;const o=isFinite(t[2])&&isFinite(t[5]),l=o&&(null==a?.zmin||t[2]<a.zmin),h=o&&(null==a?.zmax||t[5]>a.zmax);if(a){(t[0]<a.xmin||t[1]<a.ymin||t[3]>a.xmax||t[4]>a.ymax||l||h)&&(n=this._propertiesPool.get("computedExtent"),n.xmin=Math.min(t[0],a.xmin),n.ymin=Math.min(t[1],a.ymin),n.xmax=Math.max(t[3],a.xmax),n.ymax=Math.max(t[4],a.ymax),n.spatialReference=r)}else n=this._propertiesPool.get("computedExtent"),n.xmin=t[0],n.ymin=t[1],n.xmax=t[3],n.ymax=t[4],n.spatialReference=r;n&&(l&&(n.zmin=t[2]),h&&(n.zmax=t[5]),this._set("computedExtent",n))}_abortElevationInfoChange(){this._elevationInfoChangeAbortController&&(this._elevationInfoChangeAbortController.abort(),this._elevationInfoChangeAbortController=null)}async elevationInfoChange(){this._abortElevationInfoChange();const e=new AbortController;this._elevationInfoChangeAbortController=e;const t=re(this.layer.elevationInfo,this.elevationFeatureExpressionEnabled);this.symbolCreationContext.featureExpressionInfoContext=await se(t,this._viewSpatialReference,e.signal,Oe),y(e.signal),this._elevationInfoChangeAbortController=null,this._labeler?.elevationInfoChange(),this.forEachGraphics3DSymbol(((e,t,i)=>{e.globalPropertyChanged("elevationInfo",t)?t.forEach((e=>{const t=e.graphic,i=e.labelLayers;for(const r of i){r.graphics3DSymbolLayer.updateGraphicElevationContext(t,r)}})):this._recreateSymbol(i)})),this.updateStageLayerElevationProvider(),this._elevationAlignment?.elevationInfoChange()}updateStageLayerElevationProvider(){this._stageLayerElevationProvider?(this.layer.elevationInfo&&"relative-to-scene"===this.layer.elevationInfo.mode||0===this._numberOfGraphicsProvidingElevation)&&(this.owner.view.elevationProvider.unregister(this._stageLayerElevationProvider),this._stageLayerElevationProvider=p(this._stageLayerElevationProvider)):(!this.layer.elevationInfo||this.layer.elevationInfo&&"relative-to-scene"!==this.layer.elevationInfo.mode)&&this._numberOfGraphicsProvidingElevation>0&&(this._stageLayerElevationProvider=new me({layer:this.layer,stageLayer:this.stageLayer,view:this.owner.view}),this.owner.view.elevationProvider.register("scene",this._stageLayerElevationProvider))}_clearSymbolsAndGraphics(){this.clear(),null!=this._filterVisibility&&this._filterVisibility.clear(),this._labeler?.reset(),this._deconflictor?.clear(),this._elevationAlignment?.clear(),this.stageLayer?.invalidateSpatialQueryAccelerator(),this._stageLayerElevationProvider&&(this.owner.view.elevationProvider.unregister(this._stageLayerElevationProvider),this._stageLayerElevationProvider=p(this._stageLayerElevationProvider))}startCreateGraphics(){this._startCreateGraphics=!0,this.recreateAllGraphics()}recreateAllGraphics(){this._recreateAllGraphics(!1)}recreateAllGraphicsAndSymbols(){this._recreateAllGraphics(!0)}_recreateAllGraphics(e=!1){if(!this._startCreateGraphics)return;const{loadedGraphics:t,view:i}=this.owner,r=i.basemapTerrain.tilingScheme&&t?.length?t.toArray():null;!e&&r||this._clearSymbolsAndGraphics(),this.symbolCreationContext.screenSizePerspectiveEnabled=this.owner.view.screenSizePerspectiveEnabled&&!!this.layer.screenSizePerspectiveEnabled,this.symbolCreationContext.slicePlaneEnabled=!!this.owner.slicePlaneEnabled,this._set("computedExtent",null),r&&(e?this.add(r):this.recreateGraphics(r))}_recreateSymbol(e){const t=this._graphicsBySymbol.get(e),i=[];t&&(t.forEach(((e,t)=>{const r=e.usedMemory;this._conditionalRemove(e,t),this._spatialIndex?.remove(e),i.push(e.graphic),e.destroy(),this._removeGraphics3DGraphic(t,r),this._updateLayerVisibility(),this._featureStore.events.emit("changed")})),this._graphicsBySymbol.set(e,new Map));const r=this._symbols.get(e);h(r),this._symbols.delete(e),this.add(i)}_recreateGraphicsForSymbol(e){const t=this._graphicsBySymbol.get(e);if(t){const e=[];t.forEach((t=>e.push(t.graphic))),this.recreateGraphics(e)}}_conditionalRemove(e,t){this._graphicsDrapedUids.delete(t),this._objectStates?.removeGraphic(e),this._labeler?.removeGraphic(e),this._deconflictor?.removeGraphic(e),null!=this._graphicStateTracking&&this._graphicStateTracking.removeGraphic(e)}add(e){e&&0!==e.length&&(this.owner.view.basemapTerrain?.tilingScheme?(this._updatePolicyForGraphics(e)===fe.ASYNC?this._addDelayed(e):this._addImmediate(e),this.notifyChange("updating")):Oe.error("#add()","Cannot add graphics before terrain surface has been initialized"))}_updatePolicyForGraphics(e){if(this.effectiveUpdatePolicy===fe.SYNC&&("mesh"===this.layer.geometryType||null==this.layer.geometryType))for(const t of e)if(null!=t.geometry&&"mesh"===t.geometry.type&&!t.geometry.loaded)return fe.ASYNC;return this.effectiveUpdatePolicy}_addImmediate(e){this._geometryWarningLogged=!1,this._symbolWarningLogged=!1;for(const t of e)this._addGraphic(t,this._getRenderingInfo(t,Oe),fe.SYNC);this._cleanupSymbols(),this._labeler&&(this.owner.view.labeler.setDirty(),this._cleanupSymbols()),this.owner.view.deconflictor.setDirty()}_addDelayed(e){for(const t of e){const e=t.uid;let i=this._pendingUpdates.get(e);i?i.add?i.state!==Te.NEW&&i.abortController?.abort():this._pendingAdds++:(i=this._pendingUpdatesPool.pushNew(),this._pendingAdds++,this._pendingUpdates.set(e,i)),i.add=t}this.notifyChange("running"),this.notifyChange("updatingRemaining")}remove(e){this.effectiveUpdatePolicy===fe.ASYNC?this._removeDelayed(e):this._removeImmediate(e),this.notifyChange("updating")}_removeImmediate(e){for(const t of e)this._removeGraphic(t);this._cleanupSymbols(),this._labeler&&this.owner.view.labeler.setDirty(),this.owner.view.deconflictor.setDirty()}_removeDelayed(e){for(const t of e){const e=t.uid,i=this._pendingUpdates.get(e);if(i)i.add&&(i.remove?i.add=null:this._pendingUpdates.delete(e),i.state===Te.LOADING&&i.abortController?.abort(),this._pendingAdds--);else{const i=this._pendingUpdatesPool.pushNew();i.remove=t,this._pendingUpdates.set(e,i),this._pendingRemoves++,this._applyPendingRemovesFirst=!0}}0===this._pendingUpdates.size&&this._finishPendingUpdates(),this.notifyChange("running"),this.notifyChange("updatingRemaining")}_finishPendingUpdates(){this._pendingUpdatesPool.clear(),this._cleanupSymbols(),(this._pendingAdds||this._pendingRemoves)&&Oe.warn("pendingAdds/Removes in inconsistent state!"),this._pendingAdds=0,this._pendingRemoves=0,this._applyPendingRemovesFirst=!1}_applyPendingUpdates(e){if(this._geometryWarningLogged=!1,this._symbolWarningLogged=!1,0===this._pendingUpdates.size&&this._spatialIndex?.updating)return this._spatialIndex.update(),void e.madeProgress();if(this._applyPendingRemovesFirst){this._applyPendingRemovesFirst=!1;for(const[t,i]of this._pendingUpdates){if(e.done){this._applyPendingRemovesFirst=!0;break}if(i.remove&&!i.add&&(this._pendingRemoves--,e.madeProgress(),this._removeGraphic(i.remove),i.remove=null,this._pendingUpdates.delete(t),0===this._pendingRemoves))break}}for(const[t,i]of this._pendingUpdates){if(e.done)break;i.add&&i.state===Te.NEW&&this._processPendingUpdateNew(i);let r=this.effectiveUpdatePolicy;if(!i.remove||i.add&&i.state!==Te.READY||(this._pendingRemoves--,e.madeProgress(),this._removeGraphic(i.remove),i.remove=null,r=fe.SYNC),i.add)switch(i.state){case Te.READY:this._addGraphic(i.add,i.renderingInfo,r),i.add=null,this._pendingAdds--,e.madeProgress();break;case Te.REJECTED:i.add=null,this._pendingAdds--;case Te.LOADING:}null==i.remove&&null==i.add&&this._pendingUpdates.delete(t)}0===this._pendingUpdates.size&&(this._finishPendingUpdates(),this.notifyChange("running"))}_processPendingUpdateNew(e){if(!e.add)return void(e.state=Te.READY);const t=e.add.geometry;null==t||"mesh"!==t.type||t.loaded?this._processPendingUpdateNewRenderingInfo(e):this._processPendingUpdateNewMesh(e,t)}async _processPendingUpdateNewMesh(e,t){e.state=Te.LOADING,e.abortController=new AbortController;const i=e.abortController.signal;try{await t.load({signal:i})}catch(r){return this._processPendingUpdateNewError(e,r)}e.abortController=null,this._processPendingUpdateNewRenderingInfo(e)}_processPendingUpdateNewError(e,t){e.abortController=null,m(t)?e.state=Te.NEW:e.state=Te.REJECTED}async _processPendingUpdateNewRenderingInfo(e){if(null==this.layer.renderer||"dictionary"!==this.layer.renderer.type)return e.renderingInfo=this._getRenderingInfo(e.add,Oe),void(e.state=Te.READY);e.state=Te.LOADING,e.abortController=new AbortController;let t=null;try{t=await this._getRenderingInfoAsync(e.add,{signal:e.abortController.signal})}catch(i){return e.abortController=null,void(m(i)?e.state=Te.NEW:e.state=Te.REJECTED)}null==t?.symbol?(Oe&&!this._symbolWarningLogged&&(this._symbolWarningLogged=!0,Oe.warn(`Graphic in layer ${this.layer.id} has no symbol and will not render`)),e.renderingInfo=null):e.renderingInfo=t,e.state=Te.READY}_addGraphic(e,t,i){if(this._graphicsWithoutSymbol.set(e.uid,e),null==t?.symbol||!H(e))return;if(null!=this.stage.renderView.objectAndLayerIdRenderHelper&&this.setUidToIdOnAdd){const t=$(this.owner.view.map,this.layer.uid);this.stage.renderView.objectAndLayerIdRenderHelper.setUidToObjectAndLayerId(e.objectId,e.uid,this.layer.id,this.layer.uid,!!this.layer.popupEnabled&&!t&&Se(this.layer,this.owner.view.popup?.defaultPopupTemplateEnabled))}const r=t.symbol,s=this.getOrCreateGraphics3DSymbol(r,t.renderer);if(null==s)return;this._expandComputedExtent(e.geometry);const a=this._beginGraphicUpdate(e),n=new ne(e,t,this.layer);let o=!1;const l=e=>{e===s.symbol.id&&(o=!0)};this._whenSymbolRemoved.push(l);const h=()=>{if(--this._loadingSymbols,this.destroyed)return;this._whenSymbolRemoved.removeUnordered(l);if(this._graphicsWaitingForSymbol.get(e.uid)!==a||o||s.destroyed||this.graphicSymbolSupported&&e.symbol&&e.symbol.id!==s.symbol.id)--s.referenced,this._cleanupSymbols();else{const t=this._createGraphics3DGraphic(s,n);this._spatialIndex&&null!=t&&this._spatialIndex.add(t),--s.referenced,this._endGraphicUpdate(e)}this._featureStore.events.emit("changed"),this._labeler&&this.owner.view.labeler.setDirty()},d=t=>{--this._loadingSymbols,this.destroyed||(this._whenSymbolRemoved.removeUnordered(l),o||(m(t)?this.add([e]):s.destroyed||this._endGraphicUpdate(e)))};++this._loadingSymbols,i===fe.ASYNC?s.load((()=>this._frameTask.schedule(h)),(e=>this._frameTask.schedule((()=>d(e))))):s.load(h,d)}_removeGraphic(e){const t=e.uid,i=this.graphics3DGraphics.get(t);if(i){i.graphics3DSymbol.onRemoveGraphic(i);const e=i.usedMemory,r=i.isElevationSource;this._conditionalRemove(i,t),this._spatialIndex?.remove(i);const s=i.graphics3DSymbol.symbol.id;this._graphicsBySymbol.get(s)?.delete(t),this._graphicsWithoutSymbol.delete(t),this._removeGraphics3DGraphic(t,e,r),i.destroy(),this._featureStore.events.emit("changed")}else this._graphicsWithoutSymbol.delete(t),this._graphicsWaitingForSymbol.delete(t),0===this._graphicsWaitingForSymbol.size&&(this._cleanupSymbols(),this.notifyChange("updating"))}_hasLabelingContext(e){if(e instanceof Ee||e instanceof Ie){const t=this.symbolCreationContext.layer;return!!t.labelingInfo&&t.labelingInfo.some((t=>t.symbol===e))}return!1}_hasValidSymbolCreationContext(e){return!(e instanceof Ee&&!this._hasLabelingContext(e))||(Oe.error("LabelSymbol3D is only valid as part of a LabelClass. Using LabelSymbol3D as a renderer symbol is not supported."),!1)}_getRenderingInfo(e,t){const i=e.geometry;if(null==i)return t&&!this._geometryWarningLogged&&(this._geometryWarningLogged=!0,t.warn(`Graphic in layer ${this.layer.id} has no geometry and will not render`)),null;if(!I(i.spatialReference,this._viewSpatialReference))return t&&!this._geometryWarningLogged&&(this._geometryWarningLogged=!0,t.warn(`Graphic in layer ${this.layer.id} has incompatible spatial reference and will not render`)),null;if(!this.graphicSymbolSupported&&null!=e.symbol)return t&&!this._symbolWarningLogged&&(this._symbolWarningLogged=!0,t.warn(`Graphic in layer ${this.layer.id} is not allowed to have a symbol, use a renderer instead`)),null;const r=this.rendererHasGeometryOperations?N(e,this.layer):e;let s;if(this.owner.getRenderingInfo&&(this.getRenderingInfoWithoutRenderer||null!=this.currentRenderer))s=this.owner.getRenderingInfo(r,this.currentRenderer,this._arcadeOnDemand);else{s={symbol:r.symbol||Z(r.geometry)}}return null==s?.symbol?(t&&!this._symbolWarningLogged&&(this._symbolWarningLogged=!0,t.warn(`Graphic in layer ${this.layer.id} has no symbol and will not render`)),null):s}_getRenderingInfoAsync(e,t){if(null==e.geometry)return Oe&&!this._geometryWarningLogged&&(this._geometryWarningLogged=!0,Oe.warn(`Graphic in layer ${this.layer.id} has no geometry and will not render`)),null;if(!this.graphicSymbolSupported&&null!=e.symbol)return Oe&&!this._symbolWarningLogged&&(this._symbolWarningLogged=!0,Oe.warn(`Graphic in layer ${this.layer.id} is not allowed to have a symbol, use a renderer instead`)),null;const i=this.rendererHasGeometryOperations?N(e,this.layer):e;return this.owner.getRenderingInfoAsync(i,this.currentRenderer,this._arcadeOnDemand,t)}_createGraphics3DSymbol(e,t){if(!this._hasValidSymbolCreationContext(e))return null;const i=this._getConvertedSymbol(e);if(!i)return null;let r;if(null!=t&&"backgroundFillSymbol"in t&&t.backgroundFillSymbol){const e=J(t.backgroundFillSymbol,{ignoreDrivers:!0});null!=e.symbol&&"web-style"!==e.symbol.type&&"cim"!==e.symbol.type&&(r=e.symbol.symbolLayers)}const s=le(i,this.symbolCreationContext,r);return s.load((()=>{const e=s.extentPadding;e>this.extentPadding&&this._set("extentPadding",e),this.notifyChange("averageSymbolComplexity")}),(()=>{})),s}getOrCreateGraphics3DSymbol(e,t){let i=this._symbols.get(e.id);return void 0===i&&(i=e instanceof Ue?new he(e,(e=>this._frameTask.schedule(e)),(e=>this._createGraphics3DSymbol(e,t))):this._createGraphics3DSymbol(e,t),this._symbols.set(e.id,i)),null!=i&&++i.referenced,i}trackGraphicState(e){return null==this._graphicStateTracking&&(this._graphicStateTracking=new de(this)),this._graphicStateTracking.add(e)}_addGraphics3DGraphic(e){this._usedMemory+=e.usedMemory,this.graphics3DGraphics.set(e.graphic.uid,e),this._numberOfGraphics++,e.isElevationSource&&(this._numberOfGraphicsProvidingElevation++,this.updateStageLayerElevationProvider()),this._updateLayerVisibility()}_removeGraphics3DGraphic(e,t,i=!1){this._usedMemory-=t,this.graphics3DGraphics.delete(e),this._numberOfGraphics--,i&&(this._numberOfGraphicsProvidingElevation--,this.updateStageLayerElevationProvider()),this._updateLayerVisibility()}_createGraphics3DGraphic(e,t){const i=t.graphic;if(this._graphicsWithoutSymbol.delete(i.uid),!this._symbols.has(e.symbol.id))return this.add([i]),null;if(this.graphics3DGraphics.has(i.uid))return null;const r=e.createGraphics3DGraphic(t);if(null==r)return null;this._addGraphics3DGraphic(r);const s=e.symbol.id;this._graphicsBySymbol.has(s)||this._graphicsBySymbol.set(s,new Map),this._graphicsBySymbol.get(s).set(i.uid,r);if(r.isDraped&&this._graphicsDrapedUids.add(i.uid),r.centroid=null,null!=i.geometry&&"point"!==i.geometry.type&&(r.centroid=pe(i.geometry,this._viewSpatialReference)),this._updateUserVisibility(r),null!=this._scaleVisibility&&this._scaleVisibility.updateVisibility(r),null!=this._filterVisibility){const{defaultVisibility:e}=this._filterVisibility;r.setVisibilityFlag(te.GRAPHIC,ie.FILTER,e),e||this._filterVisibility.reapply()}this._deconflictor?.addGraphic(r),this._labeler?.addGraphic(r),this._objectStates?.addGraphic(r),this._deconflictor&&this.owner.view.deconflictor.setInitialIconVisibilityFlag(this,r),r.initialize(this.stageLayer,this.owner),null!=this._graphicStateTracking&&this._graphicStateTracking.addGraphic(r);const a=this._whenGraphics3DGraphicRequests[i.uid];return a&&(delete this._whenGraphics3DGraphicRequests[i.uid],a.resolve(r)),r}_abortRendererChange(){this._rendererChangeAbortController&&(this._rendererChangeAbortController.abort(),this._rendererChangeAbortController=null)}async rendererChange(e){if(this._abortRendererChange(),e!==this.currentRenderer)if(this._validateRenderer(e),null==e&&this._currentRendererChange(null,!1),B(e))if(null!=e&&e.arcadeRequired){const t=new AbortController;this._rendererChangeAbortController=t;const{arcadeUtils:i}=await this._ensureArcade();y(t);const r=i.hasGeometryOperations(e);r&&(await i.enableGeometryOperations(),y(t)),this.effectiveUpdatePolicy===fe.ASYNC?await this._frameTask.schedule((()=>this._currentRendererChange(e,r)),t.signal):this._currentRendererChange(e,r),this._rendererChangeAbortController=null}else if(this.effectiveUpdatePolicy===fe.ASYNC){const t=new AbortController;this._rendererChangeAbortController=t,await this._frameTask.schedule((()=>this._currentRendererChange(e,!1)),t.signal),this._rendererChangeAbortController=null}else this._currentRendererChange(e,!1);else this._currentRendererChange(e,!1)}async _ensureArcade(){return null==this._arcadeOnDemand?(this._arcadeOnDemand=await Y(),this._arcadeOnDemand):this._arcadeOnDemand}_currentRendererChange(e,t){this.currentRenderer=e,this.rendererHasGeometryOperations=t,this.symbolCreationContext.arcade=this._arcadeOnDemand;const i=this.symbolCreationContext.renderer;if(e===i)return;if(this._symbolConversionCache.clear(),null==e)return this.symbolCreationContext.renderer=null,void this.recreateAllGraphicsAndSymbols();const r=G(i,e);this._updateUnchangedSymbolMappings(r,e,i),this.symbolCreationContext.renderer=e,null!=r&&("complete"===r.type?this.recreateAllGraphicsAndSymbols():"partial"===r.type&&(this._applyRendererDiff(r,e,i)?this._labeler?.reset():this.recreateAllGraphicsAndSymbols()),this.notifyChange("averageSymbolComplexity"))}_diffHasSymbolChange(e){for(const t in e.diff)switch(t){case"visualVariables":case"defaultSymbol":case"uniqueValueInfos":break;case"uniqueValueGroups":case"authoringInfo":case"fieldDelimiter":delete e.diff[t];break;default:return!0}return!1}_applySymbolSetDiff(e,t,i){e=e||[],t=t||[];const r=[];for(const s of t){const t=this._graphicsBySymbol.get(s.id);t&&t.forEach(((a,n)=>{const o=a.graphic,l=this.layer instanceof z?this.layer:null,h=this._arcadeOnDemand;if(s===i.defaultSymbol&&i.getSymbol(N(o,l),{arcade:h})===i.defaultSymbol)return;const d=a.usedMemory;e.length||i.defaultSymbol?r.push(o):this._graphicsWithoutSymbol.set(n,o);const p=this.graphics3DGraphics.get(n);this._conditionalRemove(p,n),a.destroy(),t.delete(n),this._removeGraphics3DGraphic(n,d),this._updateLayerVisibility()})),this._whenSymbolRemoved.forAll((e=>e(s.id)))}(e.length||r.length)&&(this._graphicsWithoutSymbol.forEach((e=>r.push(e))),this._graphicsWithoutSymbol.clear(),this.add(r)),this._cleanupSymbols(),this._labeler&&this.owner.view.labeler.setDirty(),this.owner.view.deconflictor.setDirty()}_applyUniqueValueRendererDiff(e,t,i){const r=e.diff.defaultSymbol,a=e.diff.uniqueValueInfos;if(r||a){const n=a?a.added.map((e=>e.symbol)).filter(s):[],o=a?a.removed.map((e=>e.symbol)).filter(s):[];if(a)for(let e=0;e<a.changed.length;e++)n.push(a.changed[e].newValue.symbol),o.push(a.changed[e].oldValue.symbol);return r?(i.defaultSymbol&&o.push(i.defaultSymbol),t.defaultSymbol&&n.push(t.defaultSymbol)):i.defaultSymbol&&n.length&&o.push(t.defaultSymbol),this._applySymbolSetDiff(n,o,t),delete e.diff.defaultSymbol,delete e.diff.uniqueValueInfos,!0}return!1}_calculateUnchangedSymbolMapping(e,t,i){if("unique-value"!==t?.type||"unique-value"!==i?.type||null!=e&&"partial"!==e.type)return[];const r=e=>null!=e?e.id:null,s=e&&e.diff,a=s?.defaultSymbol,n=s&&s.uniqueValueInfos;let o;if(n)o=n.unchanged.map((e=>({oldId:r(e.oldValue.symbol),newId:r(e.newValue.symbol)})));else{o=[];for(const e of i.uniqueValueInfos??[]){const i=r(e.symbol),s=t.uniqueValueInfos?.find((t=>t.value===e.value));s&&i!==r(s.symbol)&&o.push({oldId:i,newId:r(s.symbol)})}}return!a&&i.defaultSymbol&&o.push({oldId:r(i.defaultSymbol),newId:r(t.defaultSymbol)}),o}_updateSymbolMapping(e,t){const i=null!=t&&t?"string"==typeof t?t:t.id:null;if(null==e||e===i)return;const r=this._graphicsBySymbol.get(e);this._graphicsBySymbol.delete(e),void 0!==r&&this._graphicsBySymbol.set(i,r);const s=this._symbols.get(e);if(void 0!==s&&(this._symbols.delete(e),this._symbols.set(i,s),null!=s)){const e="string"==typeof t?null:t;null!=e?s.symbol=e:s.symbol.id=i}}_updateUnchangedSymbolMappings(e,t,i){const r=this._calculateUnchangedSymbolMapping(e,t,i);for(const{oldId:s,newId:a}of r)this._updateSymbolMapping(s,a)}_applyRendererDiff(e,i,r){if(this._diffHasSymbolChange(e))return!1;if(i instanceof t&&r instanceof t&&this._applyUniqueValueRendererDiff(e,i,r)&&0===Object.keys(e.diff).length)return!0;for(const[t]of this._graphicsBySymbol){const r=this._symbols.get(t);if(null!=r)switch(r.applyRendererDiff(e,i)){case ce.RecreateSymbol:this._recreateSymbol(t);break;case ce.RecreateGraphics:this._recreateGraphicsForSymbol(t);case ce.FastUpdate:}}return!0}opacityChange(){this.forEachGraphics3DSymbol(((e,t)=>e.globalPropertyChanged("opacity",t))),this._updateStageLayerVisibility()}_slicePlaneEnabledChange(e){e!==this.symbolCreationContext.slicePlaneEnabled&&(this.symbolCreationContext.slicePlaneEnabled=e,this.stageLayer.sliceable=e,this.forEachGraphics3DSymbol(((e,t)=>e.globalPropertyChanged("slicePlaneEnabled",t))),this._deconflictor&&this._deconflictor.slicePlaneEnabledChange(),this._labeler&&this._labeler.slicePlaneEnabledChange())}_physicalBasedRenderingChange(e){this.symbolCreationContext.physicalBasedRenderingEnabled=e,this.forEachGraphics3DSymbol(((e,t,i)=>{e.globalPropertyChanged("physicalBasedRenderingEnabled",t)||this._recreateSymbol(i)}))}_skipHighSymbolLoDsChange(e){this.symbolCreationContext.skipHighSymbolLods=e,this.forEachGraphics3DSymbol(((e,t,i)=>{e.globalPropertyChanged("skipHighSymbolLods",t)||this._recreateSymbol(i)}))}_pixelRatioChange(){this.forEachGraphics3DSymbol(((e,t,i)=>{e.globalPropertyChanged("pixelRatio",t)||this._recreateSymbol(i)}))}_signalUpdatingDuringAsyncLoadedGraphicsChange(){this._updatingPendingLoadedGraphicsChange&&this._updatingPendingLoadedGraphicsChange.remove(),this._updatingPendingLoadedGraphicsChange=C((()=>{this._updatingPendingLoadedGraphicsChange=null}))}setClippingExtent(e,t){const i=this.symbolCreationContext.clippingExtent,r=T();return ue(e,r,t)?this.symbolCreationContext.clippingExtent=O(L(),r):this.symbolCreationContext.clippingExtent=null,!F(this.symbolCreationContext.clippingExtent,i)}modifyGraphics3DGraphicVisibilities(e){if(this.destroyed)return;let t=!1;this.graphics3DGraphics.forEach((i=>{e(i)&&(t=!0)})),t&&(this.owner.view.labeler?.setDirty(),this.owner.view.deconflictor?.setDirty())}forEachGraphics3DSymbol(e){for(const[t,i]of this._symbols){if(null==i)return;e(i,this._graphicsBySymbol.get(t)||He,t)}}updateAllGraphicsVisibility(){null!=this._filterVisibility&&this._filterVisibility.reapply(),this.modifyGraphics3DGraphicVisibilities((e=>{const t=this._updateUserVisibility(e),i=null!=this._scaleVisibility&&this._scaleVisibility.updateVisibility(e);return t||i}))}_hideAllGraphics(){this.modifyGraphics3DGraphicVisibilities((e=>e.setVisibilityFlag(te.GRAPHIC,ie.USER,!1)))}_validateRenderer(e){const t=q(e,{geometryType:this.layer?.geometryType});if(t){const e=`Renderer for layer '${this.layer.title?`${this.layer.title}, `:""}, id:${this.layer.id}' is not supported in a SceneView`;Oe.warn(e,t.message)}}_cleanupSymbols(){if(this._graphicsWaitingForSymbol.size>0||this._suspendSymbolCleanup)return;let e=!1;this._symbols.forEach(((t,i)=>{if(null==t||t.referenced>0)return;const r=this._graphicsBySymbol.get(i);r&&0!==r.size||(this._graphicsBySymbol.delete(i),this._symbols.delete(i),h(t),e=!0)})),e&&(this._recomputeExtentPadding(),this.notifyChange("averageSymbolComplexity"))}get test(){return{snapshotInternals:()=>({graphics:[...this.graphics3DGraphics.keys()].sort(),symbols:[...this._symbols.keys()].sort(),graphicsBySymbol:[...this._graphicsBySymbol.keys()].sort().map((e=>({symbolId:e,graphics:[...this._graphicsBySymbol.get(e).keys()].sort()}))),graphicsWithoutSymbol:[...this._graphicsWithoutSymbol.keys()].sort(),graphicsDrapedUids:[...this._graphicsDrapedUids].sort(),pendingUpdates:this._pendingUpdates}),symbols:this._symbols,filterVisibility:this._filterVisibility,numPending:this._pendingUpdates.size,forceUpdatePolicy:e=>{this._forcedUpdatePolicy=e}}}get performanceInfo(){return{visible:this.graphics3DGraphics.size,missing:this._graphicsWithoutSymbol.size,pending:this._pendingUpdates.size}}};var Te;Fe.tmpVec=E(),e([S({readOnly:!0})],Fe.prototype,"computedExtent",void 0),e([S()],Fe.prototype,"currentRenderer",void 0),e([S()],Fe.prototype,"rendererHasGeometryOperations",void 0),e([S()],Fe.prototype,"_frameTask",void 0),e([S({readOnly:!0})],Fe.prototype,"_viewSpatialReference",null),e([S()],Fe.prototype,"_rendererChangeAbortController",void 0),e([S()],Fe.prototype,"_elevationInfoChangeAbortController",void 0),e([S()],Fe.prototype,"_initializeAbortController",void 0),e([S()],Fe.prototype,"_elevationAlignment",void 0),e([S()],Fe.prototype,"_scaleVisibility",void 0),e([S()],Fe.prototype,"_filterVisibility",void 0),e([S()],Fe.prototype,"_initializePromise",void 0),e([S()],Fe.prototype,"_spatialIndex",void 0),e([S({readOnly:!0})],Fe.prototype,"extentPadding",void 0),e([S()],Fe.prototype,"_updatingPendingLoadedGraphicsChange",void 0),e([S()],Fe.prototype,"_featureStore",void 0),e([S()],Fe.prototype,"_deconflictor",void 0),e([S()],Fe.prototype,"_labeler",void 0),e([S()],Fe.prototype,"_objectStates",void 0),e([S()],Fe.prototype,"_loadingSymbols",void 0),e([S()],Fe.prototype,"preferredUpdatePolicy",void 0),e([S()],Fe.prototype,"_forcedUpdatePolicy",void 0),e([S({readOnly:!0})],Fe.prototype,"effectiveUpdatePolicy",null),e([S({constructOnly:!0})],Fe.prototype,"elevationFeatureExpressionEnabled",void 0),e([S({constructOnly:!0})],Fe.prototype,"owner",void 0),e([S({constructOnly:!0})],Fe.prototype,"layer",void 0),e([S({constructOnly:!0})],Fe.prototype,"graphicSymbolSupported",void 0),e([S({constructOnly:!0})],Fe.prototype,"getRenderingInfoWithoutRenderer",void 0),e([S({constructOnly:!0})],Fe.prototype,"componentFactories",void 0),e([S({constructOnly:!0})],Fe.prototype,"setUidToIdOnAdd",void 0),e([S()],Fe.prototype,"featureStore",null),e([S()],Fe.prototype,"initializePromise",null),e([S()],Fe.prototype,"scaleVisibility",null),e([S()],Fe.prototype,"elevationAlignment",null),e([S()],Fe.prototype,"objectStates",null),e([S()],Fe.prototype,"filterVisibility",null),e([S({readOnly:!0})],Fe.prototype,"updating",null),e([S({readOnly:!0})],Fe.prototype,"running",null),e([S({readOnly:!0})],Fe.prototype,"suspendedOrOutsideOfView",null),e([S({readOnly:!0,dependsOn:[]})],Fe.prototype,"updatingRemaining",null),e([S({readOnly:!0})],Fe.prototype,"displayFeatureLimit",null),e([S({readOnly:!0,dependsOn:[]})],Fe.prototype,"averageSymbolComplexity",null),e([S({constructOnly:!0})],Fe.prototype,"hasZ",void 0),e([S({constructOnly:!0})],Fe.prototype,"hasM",void 0),e([S()],Fe.prototype,"_objectIdField",null),Fe=Ae=e([w(Ve)],Fe),function(e){e[e.NEW=0]="NEW",e[e.LOADING=1]="LOADING",e[e.READY=2]="READY",e[e.REJECTED=3]="REJECTED"}(Te||(Te={}));class ke{constructor(){this.add=null,this.renderingInfo=null,this.state=Te.NEW,this.abortController=null,this.remove=null}clear(){this.add=null,this.renderingInfo=null,this.state=Te.NEW,this.abortController=null,this.remove=null}}const ze=10,Me=E(),We=E(),He=new Map;export{Fe as Graphics3DCore};
5
+ import{_ as e}from"../../../../chunks/tslib.es6.js";import"../../../../geometry.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 t from"../../../../renderers/UniqueValueRenderer.js";import"../../../../renderers/support/jsonUtils.js";import i from"../../../../core/Logger.js";import"../../../../symbols.js";import r from"../../../../core/Accessor.js";import{isSome as s}from"../../../../core/arrayUtils.js";import"../../../../core/has.js";import a from"../../../../core/Error.js";import{makeHandle as n}from"../../../../core/handleUtils.js";import{someMap as o,findInMap as l}from"../../../../core/MapUtils.js";import{destroyMaybe as h,removeMaybe as d,disposeMaybe as p}from"../../../../core/maybe.js";import c from"../../../../core/PooledArray.js";import{throwIfAborted as y,createResolver as g,isAbortError as m}from"../../../../core/promiseUtils.js";import{watch as u,when as b,on as _,syncAndInitial as f,whenOnce as v}from"../../../../core/reactiveUtils.js";import{schedule as C}from"../../../../core/scheduling.js";import{property as S}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/accessorSupport/ensureType.js";import{subclass as w}from"../../../../core/accessorSupport/decorators/subclass.js";import{diff as G,isEmpty as R}from"../../../../core/accessorSupport/diffUtils.js";import{s as P,g as x,i as D}from"../../../../chunks/vec3.js";import{c as E}from"../../../../chunks/vec3f64.js";import{canProjectWithoutEngine as I}from"../../../../geometry/projection.js";import{projectBuffer as U}from"../../../../geometry/projection/projectBuffer.js";import{projectVectorToVector as A}from"../../../../geometry/projection/projectVectorToVector.js";import{projectXYZToVector as j}from"../../../../geometry/projection/projectXYZToVector.js";import{create as L,center as O,fromRect as V,equals as F}from"../../../../geometry/support/aaBoundingBox.js";import{create as T}from"../../../../geometry/support/aaBoundingRect.js";import{equals as k}from"../../../../geometry/support/spatialReferenceUtils.js";import z from"../../../../layers/Layer.js";import{getObjectId as M,computeAABB as W,hasGeometry as H}from"../../../../layers/graphics/dehydratedFeatures.js";import{hydrateGraphic as N}from"../../../../layers/graphics/hydratedFeatures.js";import{isSupportedRenderer3D as B,validateTo3D as q}from"../../../../renderers/support/rendererConversion.js";import{loadArcade as Y}from"../../../../support/arcadeOnDemand.js";import{isBasemapLayer as $}from"../../../../support/basemapUtils.js";import{getDefaultSymbol3D as Z}from"../../../../symbols/support/defaults3D.js";import{to3D as J}from"../../../../symbols/support/symbolConversion.js";import{averageSymbolComplexities as Q,defaultSymbolComplexity as X}from"./defaultSymbolComplexity.js";import{DisplayFeatureLimit as K}from"./DisplayFeatureLimit.js";import{ViewElevationProvider as ee}from"./ElevationQuery.js";import{VisibilityGroup as te,VisibilityFlag as ie}from"./enums.js";import{extractExpressionInfo as re,createContext as se}from"./featureExpressionInfoUtils.js";import{Graphics3DFeatureStore as ae}from"./Graphics3DFeatureStore.js";import{Graphics3DGraphicCreationContext as ne}from"./Graphics3DGraphicCreationContext.js";import{Graphics3DSymbolCreationContext as oe}from"./Graphics3DSymbolCreationContext.js";import{make as le}from"./Graphics3DSymbolFactory.js";import{Graphics3DWebStyleSymbol as he}from"./Graphics3DWebStyleSymbol.js";import{GraphicStateTracking as de}from"./GraphicStateTracking.js";import{computeCentroid as pe}from"./graphicUtils.js";import{ApplyRendererDiffResult as ce}from"./interfaces.js";import{LoadStatus as ye}from"./Loadable.js";import{SpatialIndex2D as ge}from"./SpatialIndex2D.js";import{StageLayerElevationProvider as me}from"../support/StageLayerElevationProvider.js";import{toBoundingRect as ue}from"../../support/extentUtils.js";import{PropertiesPool as be}from"../../support/PropertiesPool.js";import{GridLocalOriginFactory as _e}from"../../webgl-engine/lib/GridLocalOriginFactory.js";import{UpdatePolicy as fe}from"../../webgl-engine/lib/UpdatePolicy.js";import{affectsGeometry as ve}from"../../webgl-engine/lib/VertexAttribute.js";import{WebGLLayer as Ce}from"../../webgl-engine/lib/WebGLLayer.js";import{hasPopupTemplate as Se}from"../../../layers/support/popupUtils.js";import{ImmediateTask as we,noBudget as Ge,TaskPriority as Re,Task as Pe}from"../../../support/Scheduler.js";import xe from"../../../../geometry/Extent.js";import De from"../../../../geometry/Point.js";import Ee from"../../../../symbols/LabelSymbol3D.js";import Ie from"../../../../symbols/TextSymbol.js";import Ue from"../../../../symbols/WebStyleSymbol.js";var Ae;const je=E(),Le=L(),Oe="esri.views.3d.layers.graphics.Graphics3DCore",Ve=i.getLogger(Oe);let Fe=Ae=class extends r{get _viewSpatialReference(){return this.owner.view.spatialReference}get spatialIndex(){return this._spatialIndex||(this._spatialIndex=new ge({objectIdField:this.owner.layer?.objectIdField,spatialReference:this._viewSpatialReference,hasZ:!!this.hasZ,hasM:!!this.hasM}),this._spatialIndex.setup(Array.from(this.graphics3DGraphics.values()))),this._spatialIndex.update(),this._spatialIndex}get numberOfGraphics(){return this._numberOfGraphics}get effectiveUpdatePolicy(){return null!=this.currentRenderer&&"dictionary"===this.currentRenderer.type?fe.ASYNC:this._forcedUpdatePolicy??this.preferredUpdatePolicy}get featureStore(){return this._featureStore}get initializePromise(){return this._initializePromise}get scaleVisibility(){return this._scaleVisibility}get elevationAlignment(){return this._elevationAlignment}get objectStates(){return this._objectStates}get filterVisibility(){return this._filterVisibility}get updating(){return!!(this._graphicsWaitingForSymbol.size>0||this.running||this._elevationAlignment?.updating||this._scaleVisibility?.updating||this._filterVisibility?.updating||this._rendererChangeAbortController||this._elevationInfoChangeAbortController||this._updatingPendingLoadedGraphicsChange||this._frameTask.updating||this._loadingSymbols>0)}get running(){return this._pendingUpdates.size>0||!!this._spatialIndex?.updating}get suspendedOrOutsideOfView(){return this.owner.suspended||!!this.owner.suspendInfo?.outsideOfView}get updatingRemaining(){return this.updating?this._pendingUpdates.size+.1*(this._spatialIndex?.updatingRemaining||0)+.1*(this._elevationAlignment?.updatingRemaining||0):0}get displayFeatureLimit(){const e=this.owner&&this.owner.view&&this.owner.view.qualitySettings,t=e?.graphics3D.minTotalNumberOfFeatures??0,i=e?.graphics3D.maxTotalNumberOfFeatures??0,r=e?.graphics3D.maxNumberOfDrawCalls??0,s=e?.graphics3D.maxTotalNumberOfVertices??0,a=this.averageSymbolComplexity,n=Math.max(1,a?.verticesPerFeature??1),o=a&&a.drawCallsPerFeature>0&&r>0?r/a.drawCallsPerFeature:i,l=Math.ceil(s/n),h=Math.max(t,Math.min(i,l,o)),d=this._get("displayFeatureLimit");return d&&d.maximumTotalNumberOfVertices===s&&d.averageSymbolComplexity===a&&d.maximumNumberOfFeatures===h?d:new K(s,h,a)}get averageSymbolComplexity(){const e=Q(this._symbolComplexities),t=this._get("averageSymbolComplexity");return 0===e.numComplexities||null!=t&&(e.estimated&&(t.verticesPerFeature>=e.verticesPerFeature||t.verticesPerCoordinate>=e.verticesPerCoordinate||t.drawCallsPerFeature>=e.drawCallsPerFeature)||t.verticesPerFeature===e.verticesPerFeature&&t.verticesPerCoordinate===e.verticesPerCoordinate&&t.drawCallsPerFeature===e.drawCallsPerFeature)?t:e}get usedMemory(){const e=null!=this.averageSymbolComplexity&&this.labelsEnabled?this.averageSymbolComplexity.memory.bytesPerFeatureLabel*this._numberOfGraphics:0,t=this._getSymbolComplexitiesUsed().reduce(((e,t)=>e+t.memory.resourceBytes),0),i=this.owner.view._stage.renderer,r=this.owner.view.basemapTerrain.overlayManager.renderer,s=Array.from(this._symbols.values()).reduce(((e,t)=>e+(t?.symbolLayers.reduce(((e,t)=>e+(t?.materials.reduce(((e,t)=>e+i.getMemoryForMaterial(t)+r.getMemoryForMaterial(t)),0)??0)),0)??0)),0);return this._usedMemory+e+t+s}get usedMemoryPerGraphic(){if(this._usedMemory&&this._numberOfGraphics){const e=this._numberOfGraphics/(this._numberOfGraphics+Math.max(this._pendingAdds,this._pendingRemoves));return this._usedMemory/this._numberOfGraphics*e}if(null!=this.averageSymbolComplexity){const e=this.labelsEnabled?this.averageSymbolComplexity.memory.bytesPerFeatureLabel:0;return this.averageSymbolComplexity.memory.bytesPerFeature+e}return 0}get unprocessedMemoryEstimate(){return(this._pendingAdds-this._pendingRemoves)*this.usedMemoryPerGraphic}get _symbolComplexities(){return this.currentRenderer?this._getSymbolComplexitiesUsedOrRenderer(this.currentRenderer):this._getSymbolComplexitiesUsed()}get visible(){return this._visible}_getConvertedSymbol(e){if("web-style"===e.type)return e.clone();const t=this._symbolConversionCache.get(e.id);if(null!=t)return t;const i=J(e,{geometryType:this.layer?.geometryType??void 0,retainId:!0,hasLabelingContext:this._hasLabelingContext(e)}),r=i.symbol||null;return null==r&&i.error&&Ve.error(i.error.message),this._symbolConversionCache.set(e.id,r),r}_getSymbolComplexitiesUsedOrRenderer(e){if(null==e)return[];const t=e.getSymbols(),i="backgroundFillSymbol"in e?e.backgroundFillSymbol:null;if(!i&&!t?.length)return[];const r=[],s=this._getSymbolComplexityUsedOrRenderer(i);null!=s&&r.push(s);for(const a of t){const e=this._getSymbolComplexityUsedOrRenderer(a);null!=e&&r.push(e)}return r}_getSymbolComplexityUsedOrRenderer(e){if(null==e)return null;const t=this._symbols.get(e.id);if(null!=t)return t.complexity;const i=this._getConvertedSymbol(e);return null!=i?X(i):null}_getSymbolComplexitiesUsed(){const e=[];return this._symbols.forEach((t=>{null!=t&&e.push(t.complexity)})),e}get _objectIdField(){return this.layer.objectIdField}constructor(e){super(e),this._propertiesPool=new be({computedExtent:xe},this),this.computedExtent=null,this.currentRenderer=null,this.rendererHasGeometryOperations=!1,this._graphicStateTracking=null,this.graphics3DGraphics=new Map,this.stageLayer=null,this.stage=null,this._graphicsDrapedUids=new Set,this._graphicsBySymbol=new Map,this._symbolConversionCache=new Map,this._symbols=new Map,this._graphicsWithoutSymbol=new Map,this._graphicsWaitingForSymbol=new Map,this._graphicsUpdateId=0,this._frameTask=we,this._suspendSymbolCleanup=!1,this._arcadeOnDemand=null,this._rendererChangeAbortController=null,this._elevationInfoChangeAbortController=null,this._initializeAbortController=null,this._scaleVisibility=null,this._filterVisibility=null,this._spatialIndex=null,this.extentPadding=0,this._updatingPendingLoadedGraphicsChange=null,this._featureStore=null,this._deconflictor=null,this._labeler=null,this._objectStates=null,this._viewElevationProvider=null,this._stageLayerElevationProvider=null,this._sharedSymbolResourcesOwnerHandle=null,this._whenGraphics3DGraphicRequests={},this._pendingUpdates=new Map,this._numberOfGraphics=0,this._numberOfGraphicsProvidingElevation=0,this._pendingAdds=0,this._pendingRemoves=0,this._applyPendingRemovesFirst=!1,this._loadingSymbols=0,this._pendingUpdatesPool=new c({allocator:e=>e||new ke,deallocator:e=>(e.clear(),e)}),this._symbolWarningLogged=!1,this._geometryWarningLogged=!1,this._objectIdInvisibleSet=new Set,this._whenSymbolRemoved=new c,this.preferredUpdatePolicy=fe.SYNC,this._forcedUpdatePolicy=null,this.elevationFeatureExpressionEnabled=!0,this.owner=null,this.layer=null,this.graphicSymbolSupported=!0,this.getRenderingInfoWithoutRenderer=!1,this.setUidToIdOnAdd=!0,this.hasZ=null,this.hasM=null,this._usedMemory=0,this._visible=!1,this._startCreateGraphics=!1,this.symbolCreationContext=new oe(e.owner.view.resourceController.scheduler,((e,t)=>this._frameTask.schedule(e,t)))}initialize(){this._featureStore=new ae({objectIdField:this.owner.layer?.objectIdField,hasZ:!!this.hasZ,hasM:!!this.hasM,viewSpatialReference:this._viewSpatialReference,featureSpatialReference:this.owner.featureSpatialReference,getSpatialIndex:()=>this.spatialIndex,forEach:e=>this.graphics3DGraphics.forEach(e)});const e=(e,t,i)=>this.spatialIndex.queryGraphicUIDsInExtent(e,t,i),{componentFactories:t}=this;if(null!=t.elevationAlignment){const i=t.elevationAlignment(this,e);this._elevationAlignment=i}if(null!=t.scaleVisibility){const i=t.scaleVisibility(this,e);this._scaleVisibility=i}if(null!=t.filterVisibility){const e=t.filterVisibility({featureStore:this._featureStore,getFeatureCount:()=>this.graphics3DGraphics.size,updateFeatureVisibilities:e=>this.modifyGraphics3DGraphicVisibilities((t=>t.setVisibilityFlag(te.GRAPHIC,ie.FILTER,e(M(t.graphic,this._objectIdField))))),setAllFeaturesVisibility:e=>this.modifyGraphics3DGraphicVisibilities((t=>t.setVisibilityFlag(te.GRAPHIC,ie.FILTER,e))),clearFeaturesVisibility:()=>this.modifyGraphics3DGraphicVisibilities((e=>e.setVisibilityFlag(te.GRAPHIC,ie.FILTER,!0)))});this._filterVisibility=e}if(null!=t.deconflictor){const e=t.deconflictor(this);this._deconflictor=e}if(null!=t.labeler&&null!=this._scaleVisibility){const e=t.labeler(this,this._scaleVisibility);this._labeler=e}if(null!=t.objectStates){const e=t.objectStates(this);this._objectStates=e}this._initializeAbortController=new AbortController,this._initializePromise=this._initializeAsync()}async _initializeAsync(){const e=this._initializeAbortController?.signal,t=this.owner.view;this._viewElevationProvider=new ee(this._viewSpatialReference,t),this._initializeStage(t,this.layer.uid);const i=t.sharedSymbolResources;this.symbolCreationContext.sharedResources=i,this._sharedSymbolResourcesOwnerHandle=i.addGraphicsOwner(this.owner),null!=this.currentRenderer&&(this.symbolCreationContext.renderer=this.currentRenderer),this.symbolCreationContext.stage=this.stage,this.symbolCreationContext.streamDataRequester=i.streamDataRequester,this.symbolCreationContext.renderCoordsHelper=t.renderCoordsHelper,this.symbolCreationContext.layer=this.layer,this.symbolCreationContext.graphicsCoreOwner=this.owner,this.symbolCreationContext.localOriginFactory=new _e(t.renderSpatialReference),this.symbolCreationContext.elevationProvider=t.elevationProvider,this.symbolCreationContext.notifyGraphicGeometryChanged=e=>this.notifyGraphicGeometryChanged(e),this.symbolCreationContext.notifyGraphicVisibilityChanged=e=>this.notifyGraphicVisibilityChanged(e);const r=re(this.layer.elevationInfo,this.elevationFeatureExpressionEnabled);if(this.symbolCreationContext.featureExpressionInfoContext=await se(r,this._viewSpatialReference,e,Ve),y(e),this.symbolCreationContext.screenSizePerspectiveEnabled=t.screenSizePerspectiveEnabled&&!!this.layer.screenSizePerspectiveEnabled,this.symbolCreationContext.slicePlaneEnabled=!!this.owner.slicePlaneEnabled,this.symbolCreationContext.physicalBasedRenderingEnabled=!!this.owner.view.qualitySettings?.physicallyBasedRenderingEnabled,this.symbolCreationContext.skipHighSymbolLods=!!this.owner.view.qualitySettings?.graphics3D?.skipHighSymbolLods,"drapeSourceType"in this.owner){const{owner:e}=this;this.symbolCreationContext.drapeSourceRenderer=t.basemapTerrain.overlayManager.registerGeometryDrapeSource(e),this.addHandles(n((()=>t.basemapTerrain.overlayManager.unregisterDrapeSource(e))))}this.addHandles([u((()=>this.suspendedOrOutsideOfView),(()=>this._frameTask.reschedule((()=>this._updateLayerVisibility())))),u((()=>[this.layer?.screenSizePerspectiveEnabled,this.owner.view?.screenSizePerspectiveEnabled]),(()=>{const e=t.screenSizePerspectiveEnabled&&!!this.layer.screenSizePerspectiveEnabled;e!==this.symbolCreationContext.screenSizePerspectiveEnabled&&(this.symbolCreationContext.screenSizePerspectiveEnabled=e,this._labeler?.reset(),this.recreateAllGraphicsAndSymbols())})),u((()=>this.owner.slicePlaneEnabled),(e=>this._slicePlaneEnabledChange(!!e))),u((()=>this.owner.view.state?.rasterPixelRatio),(()=>this._pixelRatioChange())),u((()=>!!this.owner.view.qualitySettings?.physicallyBasedRenderingEnabled),(e=>this._physicalBasedRenderingChange(e))),u((()=>!!this.owner.view.qualitySettings?.graphics3D?.skipHighSymbolLods),(e=>this._skipHighSymbolLoDsChange(e))),b((()=>t.basemapTerrain?.tilingScheme),(e=>{if(e.spatialReference.equals(this.symbolCreationContext.overlaySR)||null==t.basemapTerrain.spatialReference||(this.symbolCreationContext.overlaySR=t.basemapTerrain.spatialReference),this.hasHandles("loaded-graphics"))this.recreateAllGraphics();else{const e=()=>this.owner?.loadedGraphics;this.addHandles([_(e,"change",(e=>{this._graphicsCollectionChanged(e),this._signalUpdatingDuringAsyncLoadedGraphicsChange()}),{onListenerAdd:()=>{this.recreateAllGraphics(),this._signalUpdatingDuringAsyncLoadedGraphicsChange()}})],"loaded-graphics")}}),{initial:!0}),u((()=>this.effectiveUpdatePolicy),(e=>{null!=this.stageLayer&&(this.stageLayer.updatePolicy=e),this.symbolCreationContext.isAsync=this.effectiveUpdatePolicy===fe.ASYNC,e===fe.SYNC&&this.runTask(Ge)}),f)]),this._frameTask=t.resourceController.scheduler.registerTask(Re.GRAPHICS_CORE,this),this.layer&&"featureReduction"in this.layer&&this.addHandles(u((()=>this.layer.featureReduction),(()=>this._deconflictor.featureReductionChange()))),this.notifyChange("averageSymbolComplexity"),this.rendererChange(this.owner.renderer).catch((()=>{})),this._initializeAbortController=null}_abortInitialize(){this._initializeAbortController&&(this._initializeAbortController.abort(),this._initializeAbortController=null)}destroy(){this._abortInitialize(),this._abortRendererChange(),this._abortElevationInfoChange(),this._frameTask.remove(),this._frameTask=we,this.owner.view?.deconflictor?.removeGraphicsOwner(this),this.owner.view?.labeler?.removeGraphicsOwner(this),this._elevationAlignment=h(this._elevationAlignment),this._scaleVisibility=h(this._scaleVisibility),this._filterVisibility=h(this._filterVisibility),this._deconflictor=null,this._labeler=null,this._objectStates=h(this._objectStates),this.clear(),this._featureStore=h(this._featureStore),this._updatingPendingLoadedGraphicsChange=d(this._updatingPendingLoadedGraphicsChange),this._graphicStateTracking=h(this._graphicStateTracking),this.stage&&(this.stageLayer=h(this.stageLayer),this.stage=null),this._set("owner",null);for(const e in this._whenGraphics3DGraphicRequests)this._whenGraphics3DGraphicRequests[e].reject(new a("graphic:layer-destroyed","Layer has been destroyed"));this._whenGraphics3DGraphicRequests=null,this._sharedSymbolResourcesOwnerHandle=d(this._sharedSymbolResourcesOwnerHandle),this._propertiesPool=h(this._propertiesPool),this._pendingUpdatesPool=null,this._symbolConversionCache.clear(),this._objectIdInvisibleSet.clear(),this._spatialIndex=h(this._spatialIndex)}clear(){this._objectStates?.allGraphicsDeleted(),null!=this._graphicStateTracking&&this._graphicStateTracking.allGraphicsDeleted(),this.graphics3DGraphics.forEach((e=>e.destroy())),this._spatialIndex?.clear(),this.graphics3DGraphics.clear(),this._numberOfGraphics=0,this._usedMemory=0,this._updateLayerVisibility(),this._symbols.forEach(h),this._symbols.clear(),this._graphicsBySymbol.clear(),this._graphicsWithoutSymbol.clear(),this._graphicsWaitingForSymbol.clear(),this._pendingUpdates.clear(),this._pendingUpdatesPool.clear(),this._pendingAdds=0,this._pendingRemoves=0,this._applyPendingRemovesFirst=!1,this.notifyChange("updating"),this.notifyChange("running"),this.notifyChange("updatingRemaining"),this._featureStore.events.emit("changed")}_initializeStage(e,t){this.stage=e._stage,this.stageLayer=new Ce(this.stage,{pickable:!this.suspendedOrOutsideOfView,updatePolicy:this.effectiveUpdatePolicy},t);const i=this.stageLayer.events;i.on("transformationChanged",(e=>this.notifyGraphicGeometryChanged(e.graphicUid))),i.on("shaderTransformationChanged",(e=>this.notifyGraphicGeometryChanged(e.graphicUid))),i.on("visibilityChanged",(e=>this.notifyGraphicVisibilityChanged(e.graphicUid))),i.on("geometryAdded",(e=>this.notifyGraphicGeometryChanged(e.object.graphicUid))),i.on("geometryRemoved",(e=>this.notifyGraphicGeometryChanged(e.object.graphicUid))),i.on("attributesChanged",(e=>ve(e.attribute)&&this.notifyGraphicGeometryChanged(e.object.graphicUid)))}notifyGraphicGeometryChanged(e){if(null==this._graphicStateTracking||null==e)return;const t=this.graphics3DGraphics.get(e);t&&this._graphicStateTracking.updateGraphicGeometry(t)}notifyGraphicVisibilityChanged(e){if(null==this._graphicStateTracking||null==e)return;const t=this.graphics3DGraphics.get(e);t&&this._graphicStateTracking.updateGraphicVisibility(t)}_updateLayerVisibility(){const e=this.displayFeatureLimit.maximumNumberOfFeatures,t=this._numberOfGraphics>e*ze,i=!this.suspendedOrOutsideOfView&&!t;i!==this._visible&&(this._visible=i,i?(this.stageLayer.pickable=!0,this.updateAllGraphicsVisibility()):(this.stageLayer.pickable=!1,this._hideAllGraphics()),this._updateStageLayerVisibility())}_updateStageLayerVisibility(){this.stageLayer.visible=this._visible&&(null==this.layer.opacity||this.layer.opacity>0)}getGraphics3DGraphicById(e){return null!=e?this.graphics3DGraphics.get(e):void 0}getGraphics3DGraphicByObjectId(e){return this.owner.layer?.objectIdField?this._findGraphics3DGraphicByObjectId(e):null}_getGraphicObjectID(e,t=this.owner.layer?.objectIdField){return M(e,t)}get graphics3DGraphicsByObjectID(){const e=this.owner.layer?.objectIdField;if(!e)return;const t=new Map;return this.graphics3DGraphics.forEach((i=>{if(!i)return;const r=i.graphic,s=this._getGraphicObjectID(r,e);null!=s&&t.set(s,i)})),t}get labelsEnabled(){return!(!this._labeler||!this._labeler.layerLabelsEnabled())}async updateLabelingInfo(e){const t=this._deconflictor&&this._deconflictor.labelingInfoChange(e),i=this._labeler&&this._labeler.labelingInfoChange(e);await Promise.allSettled([t,i])}updateVisibilityInfo(){this._deconflictor&&this._deconflictor.labelingInfoChange(),this._labeler&&this._labeler.visibilityInfoChange()}get symbolUpdateType(){if(this._pendingUpdates.size>0)return"unknown";let e=0,t=0;return o(this._symbols,((i,r)=>{if(null!=i){const s=i.getFastUpdateStatus();if(s.loading>0)return!0;this._graphicsBySymbol.has(r)&&(t+=s.fast,e+=s.slow)}return!1}))?"unknown":t>=0&&0===e?"fast":e>=0&&0===t?"slow":"mixed"}runTask(e){if(this._frameTask.processQueue(e),this._applyPendingUpdates(e),this.notifyChange("running"),this.running||this.notifyChange("updating"),this.notifyChange("updatingRemaining"),!e.hasProgressed)return Pe.YIELD}setObjectIdVisibility(e,t){t?this._objectIdInvisibleSet.delete(e):this._objectIdInvisibleSet.add(e);const i=this._findGraphics3DGraphicByObjectId(e);null!=i&&this._updateUserVisibility(i)}_findGraphics3DGraphicByObjectId(e){return l(this.graphics3DGraphics,(t=>this._getGraphicObjectID(t.graphic)===e))}_updateUserVisibility(e){if(null==e)return!1;const t=e.graphic,i=this._getGraphicObjectID(t),r=t.visible&&!this.owner.suspended&&(null==i||!this._objectIdInvisibleSet.has(i));return e.setVisibilityFlag(te.GRAPHIC,ie.USER,r)}_whenGraphics3DGraphic(e){const t=this.graphics3DGraphics.get(e.uid);if(t)return Promise.resolve(t);const i=this._whenGraphics3DGraphicRequests[e.uid];if(i)return i.promise;const r=g();return this._whenGraphics3DGraphicRequests[e.uid]=r,r.promise}async _boundsForGraphics3DGraphic(e,t){const i=this._viewSpatialReference,r=this.owner.view.renderSpatialReference,s=this.owner.view.basemapTerrain.spatialReference,a=(e,t,s)=>U(e,r,t,e,i,t,s),n=(e,t,r)=>U(e,s,t,e,i,t,r),o=this._viewElevationProvider?{service:this._viewElevationProvider,useViewElevation:null!=t&&!!t.useViewElevation,minDemResolution:null!=t?t.minDemResolution:null,minDemResolutionForPoints:this.owner.view.resolution}:null,l=await e.getProjectedBoundingBox(a,n,o,t?.signal);if(!l)return null;const h=l.boundingBox;if(l.requiresDrapedElevation){const e=this.symbolCreationContext.elevationProvider;if(e){O(h,je);const t=e.getElevation(je[0],je[1],0,i,"ground")??0;h[2]=Math.min(h[2],t),h[5]=Math.max(h[5],t)}}return{boundingBox:h,screenSpaceObjects:l.screenSpaceObjects}}async whenGraphicBounds(e,t){await v((()=>this.owner?.loadedGraphics));const i=this.owner.layer?.objectIdField,r=this.owner.loadedGraphics.find((t=>t===e||null!=i&&null!=t.attributes&&e.attributes&&t.attributes[i]===e.attributes[i]));if(!r)throw new a("internal:graphic-not-part-of-view","Graphic is not part of this view");const s=await this._whenGraphics3DGraphic(r);return this._boundsForGraphics3DGraphic(s,t)}computeAttachmentOrigin(e,t){const i=this.graphics3DGraphics.get(e.uid);if(!i)return null;const r=i.computeAttachmentOrigin();if(0===r.render.num&&0===r.draped.num)return null;P(Me,0,0,0);let s=0;if(r.render.num>0){if(!A(r.render.origin,this.symbolCreationContext.renderCoordsHelper.spatialReference,We,t))return null;x(Me,Me,We),s++}if(r.draped.num>0){const[e,i]=r.draped.origin,a=this._viewElevationProvider.getElevation(e,i,"ground")??0;if(P(We,e,i,a),!A(We,this._viewElevationProvider.spatialReference,We,t))return null;x(Me,Me,We),s++}return s>1&&D(Me,Me,1/s),new De({x:Me[0],y:Me[1],z:Me[2],spatialReference:t})}getSymbolLayerSize(e,t){const i=this._symbols.get(e.id);if(null==i)throw new a("internal:symbol-not-part-of-view","Symbol is not part of this view");const r=e.symbolLayers.indexOf(t);if(-1===r)throw new a("internal:missing-symbol-layer","Symbol layer is not in symbol");const s=i.getSymbolLayerSize(r);if(null==s)throw new a("internal:missing-size","Symbol layer has no valid size");return s}_graphicsCollectionChanged(e){this._startCreateGraphics&&(this.add(e.added),this.remove(e.removed))}graphicUpdateHandler(e){const t=e.graphic.uid,i=this.graphics3DGraphics.get(t);if(null!=i||null!=this._graphicsWithoutSymbol.get(t))switch(e.property){case"visible":this._graphicUpdateVisibleHandler(i);break;case"geometry":this._graphicUpdateGeometryHandler(i,e);break;case"symbol":this._graphicUpdateSymbolHandler(i,e);break;case"attributes":break;case"origin-transform":this._graphicUpdateTransformHandler(i,e)}}_graphicUpdateGeometryHandler(e,t){this._graphicUpdateGeometryOrTransformHandler(e,t,(()=>null!=t.newValue&&null!=e&&e.graphics3DSymbol.updateGeometry(e,t.newValue)));const i=t.graphic.geometry;null!=i&&this._expandComputedExtent(i)}_graphicUpdateTransformHandler(e,t){const i=t.graphic.geometry;this._graphicUpdateGeometryOrTransformHandler(e,t,(()=>null!=t.newValue&&null!=e&&null!=i&&e.graphics3DSymbol.updateTransform(e,i.spatialReference,t.newValue,t.action)))}_graphicUpdateGeometryOrTransformHandler(e,t,i){if(null!=t.graphic.geometry)if(null!=e)i()||this._recreateGraphic(e.graphic);else{const e=t.graphic.symbol?.id;if(e){const t=this._symbols.get(e);if(null!=t&&t.loadStatus===ye.LOADING)return}this._recreateGraphic(t.graphic)}else this._recreateGraphic(t.graphic)}_graphicUpdateSymbolHandler(e,t){const i=t.graphic,r=null!=e?e.graphics3DSymbol:null!=t.oldValue?this._symbols.get(t.oldValue.id):null;if(null==r||null==t.newValue)return void this._recreateGraphic(i);const s=r.symbol,a=this._getConvertedSymbol(t.newValue);if(null!=a&&(a.type!==s.type||"web-style"===a.type)||"web-style"===s.type)return void this._recreateGraphic(i);const n=this._graphicsBySymbol.get(s.id);if(n&&1!==n.size)return void this._recreateGraphic(i);const o=G(s,a);if(null==o)return void this._updateSymbolMapping(s.id,a);const l={diff:o,graphics3DGraphicPatches:[],symbolStatePatches:[]};if(r.prepareSymbolPatch(l),!R(l.diff))return void this._recreateGraphic(i);const h=this._getRenderingInfo(i);if(null==h)return void this._recreateGraphic(i);const d=r.extentPadding;for(const p of l.symbolStatePatches)p();if(d!==r.extentPadding&&this._recomputeExtentPadding(),null!=e)for(const p of l.graphics3DGraphicPatches)p(e,h);this._updateSymbolMapping(s.id,a)}_graphicUpdateVisibleHandler(e){this._updateUserVisibility(e)&&(this._labeler&&this.owner.view.labeler.setDirty(),this.owner.view.deconflictor.setDirty())}recreateGraphics(e){this._suspendSymbolCleanup=!0,this.remove(e),this.add(e),this._suspendSymbolCleanup=!1,this.effectiveUpdatePolicy===fe.SYNC&&this._cleanupSymbols()}_recreateGraphic(e){this.recreateGraphics([e])}_beginGraphicUpdate(e){const t=this._graphicsUpdateId;return this._graphicsUpdateId++,this._graphicsWaitingForSymbol.set(e.uid,t),1===this._graphicsWaitingForSymbol.size&&this.notifyChange("updating"),t}_endGraphicUpdate(e){e&&(this._graphicsWaitingForSymbol.delete(e.uid),0===this._graphicsWaitingForSymbol.size&&(this._cleanupSymbols(),this.notifyChange("updating")))}_recomputeExtentPadding(){let e=0;this._symbols.forEach((t=>{null!=t&&(e=Math.max(e,t.extentPadding))})),this._set("extentPadding",e)}_expandComputedExtent(e){const t=Le,i=e.spatialReference;W(e,t);const r=this._viewSpatialReference,s=Ae.tmpVec;if(k(i,r)||j(t[0],t[1],0,i,s,r)&&(t[0]=s[0],t[1]=s[1],j(t[3],t[4],0,i,s,r),t[3]=s[0],t[4]=s[1]),!(isFinite(t[0])&&isFinite(t[3])&&isFinite(t[1])&&isFinite(t[4])))return;const a=this.computedExtent;let n=null;const o=isFinite(t[2])&&isFinite(t[5]),l=o&&(null==a?.zmin||t[2]<a.zmin),h=o&&(null==a?.zmax||t[5]>a.zmax);if(a){(t[0]<a.xmin||t[1]<a.ymin||t[3]>a.xmax||t[4]>a.ymax||l||h)&&(n=this._propertiesPool.get("computedExtent"),n.xmin=Math.min(t[0],a.xmin),n.ymin=Math.min(t[1],a.ymin),n.xmax=Math.max(t[3],a.xmax),n.ymax=Math.max(t[4],a.ymax),n.spatialReference=r)}else n=this._propertiesPool.get("computedExtent"),n.xmin=t[0],n.ymin=t[1],n.xmax=t[3],n.ymax=t[4],n.spatialReference=r;n&&(l&&(n.zmin=t[2]),h&&(n.zmax=t[5]),this._set("computedExtent",n))}_abortElevationInfoChange(){this._elevationInfoChangeAbortController&&(this._elevationInfoChangeAbortController.abort(),this._elevationInfoChangeAbortController=null)}async elevationInfoChange(){this._abortElevationInfoChange();const e=new AbortController;this._elevationInfoChangeAbortController=e;const t=re(this.layer.elevationInfo,this.elevationFeatureExpressionEnabled);this.symbolCreationContext.featureExpressionInfoContext=await se(t,this._viewSpatialReference,e.signal,Ve),y(e.signal),this._elevationInfoChangeAbortController=null,this._labeler?.elevationInfoChange(),this.forEachGraphics3DSymbol(((e,t,i)=>{e.globalPropertyChanged("elevationInfo",t)?t.forEach((e=>{const t=e.graphic,i=e.labelLayers;for(const r of i){r.graphics3DSymbolLayer.updateGraphicElevationContext(t,r)}})):this._recreateSymbol(i)})),this.updateStageLayerElevationProvider(),this._elevationAlignment?.elevationInfoChange()}updateStageLayerElevationProvider(){this._stageLayerElevationProvider?(this.layer.elevationInfo&&"relative-to-scene"===this.layer.elevationInfo.mode||0===this._numberOfGraphicsProvidingElevation)&&(this.owner.view.elevationProvider.unregister(this._stageLayerElevationProvider),this._stageLayerElevationProvider=p(this._stageLayerElevationProvider)):(!this.layer.elevationInfo||this.layer.elevationInfo&&"relative-to-scene"!==this.layer.elevationInfo.mode)&&this._numberOfGraphicsProvidingElevation>0&&(this._stageLayerElevationProvider=new me({layer:this.layer,stageLayer:this.stageLayer,view:this.owner.view}),this.owner.view.elevationProvider.register("scene",this._stageLayerElevationProvider))}_clearSymbolsAndGraphics(){this.clear(),null!=this._filterVisibility&&this._filterVisibility.clear(),this._labeler?.reset(),this._deconflictor?.clear(),this._elevationAlignment?.clear(),this.stageLayer?.invalidateSpatialQueryAccelerator(),this._stageLayerElevationProvider&&(this.owner.view.elevationProvider.unregister(this._stageLayerElevationProvider),this._stageLayerElevationProvider=p(this._stageLayerElevationProvider))}startCreateGraphics(){this._startCreateGraphics=!0,this.recreateAllGraphics()}recreateAllGraphics(){this._recreateAllGraphics(!1)}recreateAllGraphicsAndSymbols(){this._recreateAllGraphics(!0)}_recreateAllGraphics(e=!1){if(!this._startCreateGraphics)return;const{loadedGraphics:t,view:i}=this.owner,r=i.basemapTerrain.tilingScheme&&t?.length?t.toArray():null;!e&&r||this._clearSymbolsAndGraphics(),this.symbolCreationContext.screenSizePerspectiveEnabled=this.owner.view.screenSizePerspectiveEnabled&&!!this.layer.screenSizePerspectiveEnabled,this.symbolCreationContext.slicePlaneEnabled=!!this.owner.slicePlaneEnabled,this._set("computedExtent",null),r&&(e?this.add(r):this.recreateGraphics(r))}_recreateSymbol(e){const t=this._graphicsBySymbol.get(e),i=[];t&&(t.forEach(((e,t)=>{const r=e.usedMemory;this._conditionalRemove(e,t),this._spatialIndex?.remove(e),i.push(e.graphic),e.destroy(),this._removeGraphics3DGraphic(t,r),this._updateLayerVisibility(),this._featureStore.events.emit("changed")})),this._graphicsBySymbol.set(e,new Map));const r=this._symbols.get(e);h(r),this._symbols.delete(e),this.add(i)}_recreateGraphicsForSymbol(e){const t=this._graphicsBySymbol.get(e);if(t){const e=[];t.forEach((t=>e.push(t.graphic))),this.recreateGraphics(e)}}_conditionalRemove(e,t){this._graphicsDrapedUids.delete(t),this._objectStates?.removeGraphic(e),this._labeler?.removeGraphic(e),this._deconflictor?.removeGraphic(e),null!=this._graphicStateTracking&&this._graphicStateTracking.removeGraphic(e)}add(e){e&&0!==e.length&&(this.owner.view.basemapTerrain?.tilingScheme?(this._updatePolicyForGraphics(e)===fe.ASYNC?this._addDelayed(e):this._addImmediate(e),this.notifyChange("updating")):Ve.error("#add()","Cannot add graphics before terrain surface has been initialized"))}_updatePolicyForGraphics(e){if(this.effectiveUpdatePolicy===fe.SYNC&&("mesh"===this.layer.geometryType||null==this.layer.geometryType))for(const t of e)if(null!=t.geometry&&"mesh"===t.geometry.type&&!t.geometry.loaded)return fe.ASYNC;return this.effectiveUpdatePolicy}_addImmediate(e){this._geometryWarningLogged=!1,this._symbolWarningLogged=!1;for(const t of e)this._addGraphic(t,this._getRenderingInfo(t,Ve),fe.SYNC);this._cleanupSymbols(),this._labeler&&(this.owner.view.labeler.setDirty(),this._cleanupSymbols()),this.owner.view.deconflictor.setDirty()}_addDelayed(e){for(const t of e){const e=t.uid;let i=this._pendingUpdates.get(e);i?i.add?i.state!==Te.NEW&&i.abortController?.abort():this._pendingAdds++:(i=this._pendingUpdatesPool.pushNew(),this._pendingAdds++,this._pendingUpdates.set(e,i)),i.add=t}this.notifyChange("running"),this.notifyChange("updatingRemaining")}remove(e){this.effectiveUpdatePolicy===fe.ASYNC?this._removeDelayed(e):this._removeImmediate(e),this.notifyChange("updating")}_removeImmediate(e){for(const t of e)this._removeGraphic(t);this._cleanupSymbols(),this._labeler&&this.owner.view.labeler.setDirty(),this.owner.view.deconflictor.setDirty()}_removeDelayed(e){for(const t of e){const e=t.uid,i=this._pendingUpdates.get(e);if(i)i.add&&(i.remove?i.add=null:this._pendingUpdates.delete(e),i.state===Te.LOADING&&i.abortController?.abort(),this._pendingAdds--);else{const i=this._pendingUpdatesPool.pushNew();i.remove=t,this._pendingUpdates.set(e,i),this._pendingRemoves++,this._applyPendingRemovesFirst=!0}}0===this._pendingUpdates.size&&this._finishPendingUpdates(),this.notifyChange("running"),this.notifyChange("updatingRemaining")}_finishPendingUpdates(){this._pendingUpdatesPool.clear(),this._cleanupSymbols(),(this._pendingAdds||this._pendingRemoves)&&Ve.warn("pendingAdds/Removes in inconsistent state!"),this._pendingAdds=0,this._pendingRemoves=0,this._applyPendingRemovesFirst=!1}_applyPendingUpdates(e){if(this._geometryWarningLogged=!1,this._symbolWarningLogged=!1,0===this._pendingUpdates.size&&this._spatialIndex?.updating)return this._spatialIndex.update(),void e.madeProgress();if(this._applyPendingRemovesFirst){this._applyPendingRemovesFirst=!1;for(const[t,i]of this._pendingUpdates){if(e.done){this._applyPendingRemovesFirst=!0;break}if(i.remove&&!i.add&&(this._pendingRemoves--,e.madeProgress(),this._removeGraphic(i.remove),i.remove=null,this._pendingUpdates.delete(t),0===this._pendingRemoves))break}}for(const[t,i]of this._pendingUpdates){if(e.done)break;i.add&&i.state===Te.NEW&&this._processPendingUpdateNew(i);let r=this.effectiveUpdatePolicy;if(!i.remove||i.add&&i.state!==Te.READY||(this._pendingRemoves--,e.madeProgress(),this._removeGraphic(i.remove),i.remove=null,r=fe.SYNC),i.add)switch(i.state){case Te.READY:this._addGraphic(i.add,i.renderingInfo,r),i.add=null,this._pendingAdds--,e.madeProgress();break;case Te.REJECTED:i.add=null,this._pendingAdds--;case Te.LOADING:}null==i.remove&&null==i.add&&this._pendingUpdates.delete(t)}0===this._pendingUpdates.size&&(this._finishPendingUpdates(),this.notifyChange("running"))}_processPendingUpdateNew(e){if(!e.add)return void(e.state=Te.READY);const t=e.add.geometry;null==t||"mesh"!==t.type||t.loaded?this._processPendingUpdateNewRenderingInfo(e):this._processPendingUpdateNewMesh(e,t)}async _processPendingUpdateNewMesh(e,t){e.state=Te.LOADING,e.abortController=new AbortController;const i=e.abortController.signal;try{await t.load({signal:i})}catch(r){return this._processPendingUpdateNewError(e,r)}e.abortController=null,this._processPendingUpdateNewRenderingInfo(e)}_processPendingUpdateNewError(e,t){e.abortController=null,m(t)?e.state=Te.NEW:e.state=Te.REJECTED}async _processPendingUpdateNewRenderingInfo(e){if(null==this.layer.renderer||"dictionary"!==this.layer.renderer.type)return e.renderingInfo=this._getRenderingInfo(e.add,Ve),void(e.state=Te.READY);e.state=Te.LOADING,e.abortController=new AbortController;let t=null;try{t=await this._getRenderingInfoAsync(e.add,{signal:e.abortController.signal})}catch(i){return e.abortController=null,void(m(i)?e.state=Te.NEW:e.state=Te.REJECTED)}null==t?.symbol?(Ve&&!this._symbolWarningLogged&&(this._symbolWarningLogged=!0,Ve.warn(`Graphic in layer ${this.layer.id} has no symbol and will not render`)),e.renderingInfo=null):e.renderingInfo=t,e.state=Te.READY}_addGraphic(e,t,i){if(this._graphicsWithoutSymbol.set(e.uid,e),null==t?.symbol||!H(e))return;if(null!=this.stage.renderView.objectAndLayerIdRenderHelper&&this.setUidToIdOnAdd){const t=$(this.owner.view.map,this.layer.uid);this.stage.renderView.objectAndLayerIdRenderHelper.setUidToObjectAndLayerId(e.objectId,e.uid,this.layer.id,this.layer.uid,!!this.layer.popupEnabled&&!t&&Se(this.layer,this.owner.view.popup?.defaultPopupTemplateEnabled))}const r=t.symbol,s=this.getOrCreateGraphics3DSymbol(r,t.renderer);if(null==s)return;this._expandComputedExtent(e.geometry);const a=this._beginGraphicUpdate(e),n=new ne(e,t,this.layer);let o=!1;const l=e=>{e===s.symbol.id&&(o=!0)};this._whenSymbolRemoved.push(l);const h=()=>{if(--this._loadingSymbols,this.destroyed)return;this._whenSymbolRemoved.removeUnordered(l);if(this._graphicsWaitingForSymbol.get(e.uid)!==a||o||s.destroyed||this.graphicSymbolSupported&&e.symbol&&e.symbol.id!==s.symbol.id)--s.referenced,this._cleanupSymbols();else{const t=this._createGraphics3DGraphic(s,n);this._spatialIndex&&null!=t&&this._spatialIndex.add(t),--s.referenced,this._endGraphicUpdate(e)}this._featureStore.events.emit("changed"),this._labeler&&this.owner.view.labeler.setDirty()},d=t=>{--this._loadingSymbols,this.destroyed||(this._whenSymbolRemoved.removeUnordered(l),o||(m(t)?this.add([e]):s.destroyed||this._endGraphicUpdate(e)))};++this._loadingSymbols,i===fe.ASYNC?s.load((()=>this._frameTask.schedule(h)),(e=>this._frameTask.schedule((()=>d(e))))):s.load(h,d)}_removeGraphic(e){const t=e.uid,i=this.graphics3DGraphics.get(t);if(i){i.graphics3DSymbol.onRemoveGraphic(i);const e=i.usedMemory,r=i.isElevationSource;this._conditionalRemove(i,t),this._spatialIndex?.remove(i);const s=i.graphics3DSymbol.symbol.id;this._graphicsBySymbol.get(s)?.delete(t),this._graphicsWithoutSymbol.delete(t),this._removeGraphics3DGraphic(t,e,r),i.destroy(),this._featureStore.events.emit("changed")}else this._graphicsWithoutSymbol.delete(t),this._graphicsWaitingForSymbol.delete(t),0===this._graphicsWaitingForSymbol.size&&(this._cleanupSymbols(),this.notifyChange("updating"))}_hasLabelingContext(e){if(e instanceof Ee||e instanceof Ie){const t=this.symbolCreationContext.layer;return!!t.labelingInfo&&t.labelingInfo.some((t=>t.symbol===e))}return!1}_hasValidSymbolCreationContext(e){return!(e instanceof Ee&&!this._hasLabelingContext(e))||(Ve.error("LabelSymbol3D is only valid as part of a LabelClass. Using LabelSymbol3D as a renderer symbol is not supported."),!1)}_getRenderingInfo(e,t){const i=e.geometry;if(null==i)return t&&!this._geometryWarningLogged&&(this._geometryWarningLogged=!0,t.warn(`Graphic in layer ${this.layer.id} has no geometry and will not render`)),null;if(!I(i.spatialReference,this._viewSpatialReference))return t&&!this._geometryWarningLogged&&(this._geometryWarningLogged=!0,t.warn(`Graphic in layer ${this.layer.id} has incompatible spatial reference and will not render`)),null;if(!this.graphicSymbolSupported&&null!=e.symbol)return t&&!this._symbolWarningLogged&&(this._symbolWarningLogged=!0,t.warn(`Graphic in layer ${this.layer.id} is not allowed to have a symbol, use a renderer instead`)),null;const r=this.rendererHasGeometryOperations?N(e,this.layer):e;let s;if(this.owner.getRenderingInfo&&(this.getRenderingInfoWithoutRenderer||null!=this.currentRenderer))s=this.owner.getRenderingInfo(r,this.currentRenderer,this._arcadeOnDemand);else{s={symbol:r.symbol||Z(r.geometry)}}return null==s?.symbol?(t&&!this._symbolWarningLogged&&(this._symbolWarningLogged=!0,t.warn(`Graphic in layer ${this.layer.id} has no symbol and will not render`)),null):s}_getRenderingInfoAsync(e,t){if(null==e.geometry)return Ve&&!this._geometryWarningLogged&&(this._geometryWarningLogged=!0,Ve.warn(`Graphic in layer ${this.layer.id} has no geometry and will not render`)),null;if(!this.graphicSymbolSupported&&null!=e.symbol)return Ve&&!this._symbolWarningLogged&&(this._symbolWarningLogged=!0,Ve.warn(`Graphic in layer ${this.layer.id} is not allowed to have a symbol, use a renderer instead`)),null;const i=this.rendererHasGeometryOperations?N(e,this.layer):e;return this.owner.getRenderingInfoAsync(i,this.currentRenderer,this._arcadeOnDemand,t)}_createGraphics3DSymbol(e,t){if(!this._hasValidSymbolCreationContext(e))return null;const i=this._getConvertedSymbol(e);if(!i)return null;let r;if(null!=t&&"backgroundFillSymbol"in t&&t.backgroundFillSymbol){const e=J(t.backgroundFillSymbol,{ignoreDrivers:!0});null!=e.symbol&&"web-style"!==e.symbol.type&&"cim"!==e.symbol.type&&(r=e.symbol.symbolLayers)}const s=le(i,this.symbolCreationContext,r);return s.load((()=>{const e=s.extentPadding;e>this.extentPadding&&this._set("extentPadding",e),this.notifyChange("averageSymbolComplexity")}),(()=>{})),s}getOrCreateGraphics3DSymbol(e,t){let i=this._symbols.get(e.id);return void 0===i&&(i=e instanceof Ue?new he(e,(e=>this._frameTask.schedule(e)),(e=>this._createGraphics3DSymbol(e,t))):this._createGraphics3DSymbol(e,t),this._symbols.set(e.id,i)),null!=i&&++i.referenced,i}trackGraphicState(e){return null==this._graphicStateTracking&&(this._graphicStateTracking=new de(this)),this._graphicStateTracking.add(e)}_addGraphics3DGraphic(e){this._usedMemory+=e.usedMemory,this.graphics3DGraphics.set(e.graphic.uid,e),this._numberOfGraphics++,e.isElevationSource&&(this._numberOfGraphicsProvidingElevation++,this.updateStageLayerElevationProvider()),this._updateLayerVisibility()}_removeGraphics3DGraphic(e,t,i=!1){this._usedMemory-=t,this.graphics3DGraphics.delete(e),this._numberOfGraphics--,i&&(this._numberOfGraphicsProvidingElevation--,this.updateStageLayerElevationProvider()),this._updateLayerVisibility()}_createGraphics3DGraphic(e,t){const i=t.graphic;if(this._graphicsWithoutSymbol.delete(i.uid),!this._symbols.has(e.symbol.id))return this.add([i]),null;if(this.graphics3DGraphics.has(i.uid))return null;const r=e.createGraphics3DGraphic(t);if(null==r)return null;this._addGraphics3DGraphic(r);const s=e.symbol.id;this._graphicsBySymbol.has(s)||this._graphicsBySymbol.set(s,new Map),this._graphicsBySymbol.get(s).set(i.uid,r);if(r.isDraped&&this._graphicsDrapedUids.add(i.uid),r.centroid=null,null!=i.geometry&&"point"!==i.geometry.type&&(r.centroid=pe(i.geometry,this._viewSpatialReference)),this._updateUserVisibility(r),null!=this._scaleVisibility&&this._scaleVisibility.updateVisibility(r),null!=this._filterVisibility){const{defaultVisibility:e}=this._filterVisibility;r.setVisibilityFlag(te.GRAPHIC,ie.FILTER,e),e||this._filterVisibility.reapply()}this._deconflictor?.addGraphic(r),this._labeler?.addGraphic(r),this._objectStates?.addGraphic(r),this._deconflictor&&this.owner.view.deconflictor.setInitialIconVisibilityFlag(this,r),r.initialize(this.stageLayer,this.owner),null!=this._graphicStateTracking&&this._graphicStateTracking.addGraphic(r);const a=this._whenGraphics3DGraphicRequests[i.uid];return a&&(delete this._whenGraphics3DGraphicRequests[i.uid],a.resolve(r)),r}_abortRendererChange(){this._rendererChangeAbortController&&(this._rendererChangeAbortController.abort(),this._rendererChangeAbortController=null)}async rendererChange(e){if(this._abortRendererChange(),e!==this.currentRenderer)if(this._validateRenderer(e),null==e&&this._currentRendererChange(null,!1),B(e))if(null!=e&&e.arcadeRequired){const t=new AbortController;this._rendererChangeAbortController=t;const{arcadeUtils:i}=await this._ensureArcade();y(t);const r=i.hasGeometryOperations(e);r&&(await i.enableGeometryOperations(),y(t)),this.effectiveUpdatePolicy===fe.ASYNC?await this._frameTask.schedule((()=>this._currentRendererChange(e,r)),t.signal):this._currentRendererChange(e,r),this._rendererChangeAbortController=null}else if(this.effectiveUpdatePolicy===fe.ASYNC){const t=new AbortController;this._rendererChangeAbortController=t,await this._frameTask.schedule((()=>this._currentRendererChange(e,!1)),t.signal),this._rendererChangeAbortController=null}else this._currentRendererChange(e,!1);else this._currentRendererChange(e,!1)}async _ensureArcade(){return null==this._arcadeOnDemand?(this._arcadeOnDemand=await Y(),this._arcadeOnDemand):this._arcadeOnDemand}_currentRendererChange(e,t){this.currentRenderer=e,this.rendererHasGeometryOperations=t,this.symbolCreationContext.arcade=this._arcadeOnDemand;const i=this.symbolCreationContext.renderer;if(e===i)return;if(this._symbolConversionCache.clear(),null==e)return this.symbolCreationContext.renderer=null,void this.recreateAllGraphicsAndSymbols();const r=G(i,e);this._updateUnchangedSymbolMappings(r,e,i),this.symbolCreationContext.renderer=e,null!=r&&("complete"===r.type?this.recreateAllGraphicsAndSymbols():"partial"===r.type&&(this._applyRendererDiff(r,e,i)?this._labeler?.reset():this.recreateAllGraphicsAndSymbols()),this.notifyChange("averageSymbolComplexity"))}_diffHasSymbolChange(e){for(const t in e.diff)switch(t){case"visualVariables":case"defaultSymbol":case"uniqueValueInfos":break;case"uniqueValueGroups":case"authoringInfo":case"fieldDelimiter":delete e.diff[t];break;default:return!0}return!1}_applySymbolSetDiff(e,t,i){e=e||[],t=t||[];const r=[];for(const s of t){const t=this._graphicsBySymbol.get(s.id);t&&t.forEach(((a,n)=>{const o=a.graphic,l=this.layer instanceof z?this.layer:null,h=this._arcadeOnDemand;if(s===i.defaultSymbol&&i.getSymbol(N(o,l),{arcade:h})===i.defaultSymbol)return;const d=a.usedMemory;e.length||i.defaultSymbol?r.push(o):this._graphicsWithoutSymbol.set(n,o);const p=this.graphics3DGraphics.get(n);this._conditionalRemove(p,n),a.destroy(),t.delete(n),this._removeGraphics3DGraphic(n,d),this._updateLayerVisibility()})),this._whenSymbolRemoved.forAll((e=>e(s.id)))}(e.length||r.length)&&(this._graphicsWithoutSymbol.forEach((e=>r.push(e))),this._graphicsWithoutSymbol.clear(),this.add(r)),this._cleanupSymbols(),this._labeler&&this.owner.view.labeler.setDirty(),this.owner.view.deconflictor.setDirty()}_applyUniqueValueRendererDiff(e,t,i){const r=e.diff.defaultSymbol,a=e.diff.uniqueValueInfos;if(r||a){const n=a?a.added.map((e=>e.symbol)).filter(s):[],o=a?a.removed.map((e=>e.symbol)).filter(s):[];if(a)for(let e=0;e<a.changed.length;e++)n.push(a.changed[e].newValue.symbol),o.push(a.changed[e].oldValue.symbol);return r?(i.defaultSymbol&&o.push(i.defaultSymbol),t.defaultSymbol&&n.push(t.defaultSymbol)):i.defaultSymbol&&n.length&&o.push(t.defaultSymbol),this._applySymbolSetDiff(n,o,t),delete e.diff.defaultSymbol,delete e.diff.uniqueValueInfos,!0}return!1}_calculateUnchangedSymbolMapping(e,t,i){if("unique-value"!==t?.type||"unique-value"!==i?.type||null!=e&&"partial"!==e.type)return[];const r=e=>null!=e?e.id:null,s=e&&e.diff,a=s?.defaultSymbol,n=s&&s.uniqueValueInfos;let o;if(n)o=n.unchanged.map((e=>({oldId:r(e.oldValue.symbol),newId:r(e.newValue.symbol)})));else{o=[];for(const e of i.uniqueValueInfos??[]){const i=r(e.symbol),s=t.uniqueValueInfos?.find((t=>t.value===e.value));s&&i!==r(s.symbol)&&o.push({oldId:i,newId:r(s.symbol)})}}return!a&&i.defaultSymbol&&o.push({oldId:r(i.defaultSymbol),newId:r(t.defaultSymbol)}),o}_updateSymbolMapping(e,t){const i=null!=t&&t?"string"==typeof t?t:t.id:null;if(null==e||e===i)return;const r=this._graphicsBySymbol.get(e);this._graphicsBySymbol.delete(e),void 0!==r&&this._graphicsBySymbol.set(i,r);const s=this._symbols.get(e);if(void 0!==s&&(this._symbols.delete(e),this._symbols.set(i,s),null!=s)){const e="string"==typeof t?null:t;null!=e?s.symbol=e:s.symbol.id=i}}_updateUnchangedSymbolMappings(e,t,i){const r=this._calculateUnchangedSymbolMapping(e,t,i);for(const{oldId:s,newId:a}of r)this._updateSymbolMapping(s,a)}_applyRendererDiff(e,i,r){if(this._diffHasSymbolChange(e))return!1;if(i instanceof t&&r instanceof t&&this._applyUniqueValueRendererDiff(e,i,r)&&0===Object.keys(e.diff).length)return!0;for(const[t]of this._graphicsBySymbol){const r=this._symbols.get(t);if(null!=r)switch(r.applyRendererDiff(e,i)){case ce.RecreateSymbol:this._recreateSymbol(t);break;case ce.RecreateGraphics:this._recreateGraphicsForSymbol(t);case ce.FastUpdate:}}return!0}opacityChange(){this.forEachGraphics3DSymbol(((e,t)=>e.globalPropertyChanged("opacity",t))),this._updateStageLayerVisibility()}_slicePlaneEnabledChange(e){e!==this.symbolCreationContext.slicePlaneEnabled&&(this.symbolCreationContext.slicePlaneEnabled=e,this.stageLayer.sliceable=e,this.forEachGraphics3DSymbol(((e,t)=>e.globalPropertyChanged("slicePlaneEnabled",t))),this._deconflictor&&this._deconflictor.slicePlaneEnabledChange(),this._labeler&&this._labeler.slicePlaneEnabledChange())}_physicalBasedRenderingChange(e){this.symbolCreationContext.physicalBasedRenderingEnabled=e,this.forEachGraphics3DSymbol(((e,t,i)=>{e.globalPropertyChanged("physicalBasedRenderingEnabled",t)||this._recreateSymbol(i)}))}_skipHighSymbolLoDsChange(e){this.symbolCreationContext.skipHighSymbolLods=e,this.forEachGraphics3DSymbol(((e,t,i)=>{e.globalPropertyChanged("skipHighSymbolLods",t)||this._recreateSymbol(i)}))}_pixelRatioChange(){this.forEachGraphics3DSymbol(((e,t,i)=>{e.globalPropertyChanged("pixelRatio",t)||this._recreateSymbol(i)}))}_signalUpdatingDuringAsyncLoadedGraphicsChange(){this._updatingPendingLoadedGraphicsChange&&this._updatingPendingLoadedGraphicsChange.remove(),this._updatingPendingLoadedGraphicsChange=C((()=>{this._updatingPendingLoadedGraphicsChange=null}))}setClippingExtent(e,t){const i=this.symbolCreationContext.clippingExtent,r=T();return ue(e,r,t)?this.symbolCreationContext.clippingExtent=V(L(),r):this.symbolCreationContext.clippingExtent=null,!F(this.symbolCreationContext.clippingExtent,i)}modifyGraphics3DGraphicVisibilities(e){if(this.destroyed)return;let t=!1;this.graphics3DGraphics.forEach((i=>{e(i)&&(t=!0)})),t&&(this.owner.view.labeler?.setDirty(),this.owner.view.deconflictor?.setDirty())}forEachGraphics3DSymbol(e){for(const[t,i]of this._symbols){if(null==i)return;e(i,this._graphicsBySymbol.get(t)||He,t)}}updateAllGraphicsVisibility(){null!=this._filterVisibility&&this._filterVisibility.reapply(),this.modifyGraphics3DGraphicVisibilities((e=>{const t=this._updateUserVisibility(e),i=null!=this._scaleVisibility&&this._scaleVisibility.updateVisibility(e);return t||i}))}_hideAllGraphics(){this.modifyGraphics3DGraphicVisibilities((e=>e.setVisibilityFlag(te.GRAPHIC,ie.USER,!1)))}_validateRenderer(e){const t=q(e,{geometryType:this.layer?.geometryType});if(t){const e=`Renderer for layer '${this.layer.title?`${this.layer.title}, `:""}, id:${this.layer.id}' is not supported in a SceneView`;Ve.warn(e,t.message)}}_cleanupSymbols(){if(this._graphicsWaitingForSymbol.size>0||this._suspendSymbolCleanup)return;let e=!1;this._symbols.forEach(((t,i)=>{if(null==t||t.referenced>0)return;const r=this._graphicsBySymbol.get(i);r&&0!==r.size||(this._graphicsBySymbol.delete(i),this._symbols.delete(i),h(t),e=!0)})),e&&(this._recomputeExtentPadding(),this.notifyChange("averageSymbolComplexity"))}get test(){return{snapshotInternals:()=>({graphics:[...this.graphics3DGraphics.keys()].sort(),symbols:[...this._symbols.keys()].sort(),graphicsBySymbol:[...this._graphicsBySymbol.keys()].sort().map((e=>({symbolId:e,graphics:[...this._graphicsBySymbol.get(e).keys()].sort()}))),graphicsWithoutSymbol:[...this._graphicsWithoutSymbol.keys()].sort(),graphicsDrapedUids:[...this._graphicsDrapedUids].sort(),pendingUpdates:this._pendingUpdates}),symbols:this._symbols,filterVisibility:this._filterVisibility,numPending:this._pendingUpdates.size,forceUpdatePolicy:e=>{this._forcedUpdatePolicy=e}}}get performanceInfo(){return{visible:this.graphics3DGraphics.size,missing:this._graphicsWithoutSymbol.size,pending:this._pendingUpdates.size}}};var Te;Fe.tmpVec=E(),e([S({readOnly:!0})],Fe.prototype,"computedExtent",void 0),e([S()],Fe.prototype,"currentRenderer",void 0),e([S()],Fe.prototype,"rendererHasGeometryOperations",void 0),e([S()],Fe.prototype,"_frameTask",void 0),e([S({readOnly:!0})],Fe.prototype,"_viewSpatialReference",null),e([S()],Fe.prototype,"_rendererChangeAbortController",void 0),e([S()],Fe.prototype,"_elevationInfoChangeAbortController",void 0),e([S()],Fe.prototype,"_initializeAbortController",void 0),e([S()],Fe.prototype,"_elevationAlignment",void 0),e([S()],Fe.prototype,"_scaleVisibility",void 0),e([S()],Fe.prototype,"_filterVisibility",void 0),e([S()],Fe.prototype,"_initializePromise",void 0),e([S()],Fe.prototype,"_spatialIndex",void 0),e([S({readOnly:!0})],Fe.prototype,"extentPadding",void 0),e([S()],Fe.prototype,"_updatingPendingLoadedGraphicsChange",void 0),e([S()],Fe.prototype,"_featureStore",void 0),e([S()],Fe.prototype,"_deconflictor",void 0),e([S()],Fe.prototype,"_labeler",void 0),e([S()],Fe.prototype,"_objectStates",void 0),e([S()],Fe.prototype,"_loadingSymbols",void 0),e([S()],Fe.prototype,"preferredUpdatePolicy",void 0),e([S()],Fe.prototype,"_forcedUpdatePolicy",void 0),e([S({readOnly:!0})],Fe.prototype,"effectiveUpdatePolicy",null),e([S({constructOnly:!0})],Fe.prototype,"elevationFeatureExpressionEnabled",void 0),e([S({constructOnly:!0})],Fe.prototype,"owner",void 0),e([S({constructOnly:!0})],Fe.prototype,"layer",void 0),e([S({constructOnly:!0})],Fe.prototype,"graphicSymbolSupported",void 0),e([S({constructOnly:!0})],Fe.prototype,"getRenderingInfoWithoutRenderer",void 0),e([S({constructOnly:!0})],Fe.prototype,"componentFactories",void 0),e([S({constructOnly:!0})],Fe.prototype,"setUidToIdOnAdd",void 0),e([S()],Fe.prototype,"featureStore",null),e([S()],Fe.prototype,"initializePromise",null),e([S()],Fe.prototype,"scaleVisibility",null),e([S()],Fe.prototype,"elevationAlignment",null),e([S()],Fe.prototype,"objectStates",null),e([S()],Fe.prototype,"filterVisibility",null),e([S({readOnly:!0})],Fe.prototype,"updating",null),e([S({readOnly:!0})],Fe.prototype,"running",null),e([S({readOnly:!0})],Fe.prototype,"suspendedOrOutsideOfView",null),e([S({readOnly:!0,dependsOn:[]})],Fe.prototype,"updatingRemaining",null),e([S({readOnly:!0})],Fe.prototype,"displayFeatureLimit",null),e([S({readOnly:!0,dependsOn:[]})],Fe.prototype,"averageSymbolComplexity",null),e([S({constructOnly:!0})],Fe.prototype,"hasZ",void 0),e([S({constructOnly:!0})],Fe.prototype,"hasM",void 0),e([S()],Fe.prototype,"_objectIdField",null),Fe=Ae=e([w(Oe)],Fe),function(e){e[e.NEW=0]="NEW",e[e.LOADING=1]="LOADING",e[e.READY=2]="READY",e[e.REJECTED=3]="REJECTED"}(Te||(Te={}));class ke{constructor(){this.add=null,this.renderingInfo=null,this.state=Te.NEW,this.abortController=null,this.remove=null}clear(){this.add=null,this.renderingInfo=null,this.state=Te.NEW,this.abortController=null,this.remove=null}}const ze=10,Me=E(),We=E(),He=new Map;export{Fe as Graphics3DCore};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../chunks/tslib.es6.js";import t from"../../../../Graphic.js";import{XXH as i}from"../../../../arcade/functions/hash.js";import s from"../../../../core/Accessor.js";import{neverReached as r}from"../../../../core/compilerUtils.js";import{makeHandle as n}from"../../../../core/handleUtils.js";import{destroyMaybe as a}from"../../../../core/maybe.js";import{logOnError as o}from"../../../../core/promiseUtils.js";import{watch as l,initial as p,when as d}from"../../../../core/reactiveUtils.js";import{property as u}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/accessorSupport/ensureType.js";import"../../../../core/arrayUtils.js";import{subclass as h}from"../../../../core/accessorSupport/decorators/subclass.js";import{diff as c}from"../../../../core/accessorSupport/diffUtils.js";import{UpdatingHandles as y}from"../../../../core/support/UpdatingHandles.js";import{canProject as g,project as m}from"../../../../geometry/support/webMercatorUtils.js";import{matchRandomRotationExpression as b}from"../../../../renderers/support/randomRotationExpression.js";import{getRenderingInfo as f,getRenderingInfoAsync as E}from"../../../../renderers/support/renderingInfoUtils.js";import C from"../../../../rest/support/Query.js";import{DrapeSourceType as x}from"../interfaces.js";import{suspendResumeExtentOptimism as w}from"./constants.js";import{DisplayFeatureLimit as v}from"./DisplayFeatureLimit.js";import{Graphics3DCore as V}from"./Graphics3DCore.js";import{Graphics3DElevationAlignment as j}from"./Graphics3DElevationAlignment.js";import{Graphics3DFrustumVisibility as S}from"./Graphics3DFrustumVisibility.js";import{Graphics3DObjectStates as R}from"./Graphics3DObjectStates.js";import{Graphics3DScaleVisibility as _}from"./Graphics3DScaleVisibility.js";import{enlargeExtent as O}from"./graphicUtils.js";import{attributeLookup as I}from"../support/attributeUtils.js";import{FeatureVisibilityFilter as G}from"../support/FeatureVisibilityFilter.js";import{Object3DState as A}from"../../webgl-engine/lib/basicInterfaces.js";import{UpdatePolicy as U}from"../../webgl-engine/lib/UpdatePolicy.js";let P=class extends s{constructor(e){super(e),this.type="graphics-3d",this._randomRotationRenderers=null,this._updatingHandles=new y,this.elevationFeatureExpressionEnabled=!1,this.scaleVisibilityEnabled=!1,this.filterVisibilityEnabled=!1,this.frustumVisibilityEnabled=!1,this.elevationAlignmentEnabled=!1,this.timeExtentEnabled=!1,this.setUidToIdOnAdd=!0,this.dataExtent=null,this.drapeSourceType=x.Features,this.preferredUpdatePolicy=U.ASYNC,this._suspendResumeExtent=null}initialize(){const e=this.owner,t=(this.filterVisibilityEnabled||this.timeExtentEnabled)&&"multipatch"!==e.layer.geometryType,i=new V({owner:this,layer:this.layer,preferredUpdatePolicy:this.preferredUpdatePolicy,elevationFeatureExpressionEnabled:this.elevationFeatureExpressionEnabled,graphicSymbolSupported:!1,hasZ:e.hasZ,hasM:e.hasM,setUidToIdOnAdd:this.setUidToIdOnAdd,componentFactories:{deconflictor:t=>e.view.deconflictor.addGraphicsOwner(t),labeler:(t,i)=>e.view.labeler.addGraphicsOwner(t,i),elevationAlignment:this.elevationAlignmentEnabled?(t,i)=>new j({graphicsCoreOwner:this,graphicsCore:t,queryGraphicUIDsInExtent:i,elevationProvider:e.view.elevationProvider}):null,scaleVisibility:this.scaleVisibilityEnabled?(t,i)=>new _({graphicsCoreOwner:this,layer:this.layer,queryGraphicUIDsInExtent:i,graphicsCore:t,basemapTerrain:e.view.basemapTerrain}):null,filterVisibility:t?t=>new G({context:{layerView:e,...t}}):null,objectStates:e=>new R(e)}});this._set("graphicsCore",i),this.frustumVisibilityEnabled&&this._set("frustumVisibility",new S({graphicsCoreOwner:this})),this.elevationAlignment&&this._updatingHandles.add((()=>this.layer.elevationInfo),((e,t)=>{c(e,t)&&this._updatingHandles.addPromise(this.graphicsCore.elevationInfoChange())})),this._updatingHandles.add((()=>this.layer.labelsVisible),(()=>this.graphicsCore.updateVisibilityInfo())),this._updatingHandles.add((()=>this.layer.labelingInfo),((e,t)=>{c(e,t)&&this.graphicsCore.updateLabelingInfo()})),this._updatingHandles.add((()=>this.preferredUpdatePolicy),(e=>this.graphicsCore.preferredUpdatePolicy=e)),this._set("initializePromise",this._initializeAsync()),this._updatingHandles.addPromise(this.initializePromise)}async _initializeAsync(){await o(this.graphicsCore.initializePromise);const e=this.owner;this._updatingHandles.add((()=>this.renderer),(e=>this._updatingHandles.addPromise(this.graphicsCore.rendererChange(e)))),this._updatingHandles.add((()=>e.fullOpacity),(()=>this.graphicsCore.opacityChange())),this._setupSuspendResumeExtent(),this.updateClippingExtent&&(this._updatingHandles.add((()=>e.view.clippingArea),(()=>this._updateClippingExtent())),this._updateClippingExtent()),this.graphicsCore.startCreateGraphics(),this.graphicsCore.labelsEnabled&&await o(this.graphicsCore.updateLabelingInfo())}destroy(){this._updatingHandles.destroy(),this._set("frustumVisibility",a(this.frustumVisibility)),this._set("graphicsCore",a(this.graphicsCore)),this._set("owner",null)}get layer(){return this.owner.layer}get renderer(){const{renderer:e,objectIdField:t}=this.layer;if(!e||!t||"heatmap"===e.type||!e.visualVariables)return e;const i=e.visualVariables.findIndex((e=>"rotation"===e.type&&null!=e.valueExpression&&b(e.valueExpression)===t&&(null==e.axis||"heading"===e.axis)&&"geographic"===e.rotationType));if(i<0)return e;const s=e.clone();return s.visualVariables.splice(i,1),this._randomRotationRenderers||(this._randomRotationRenderers=new WeakMap),this._randomRotationRenderers.set(s,t),s}get scaleVisibility(){return this.graphicsCore?.scaleVisibility}get filterVisibility(){return this.graphicsCore?.filterVisibility}get elevationAlignment(){return this.graphicsCore?.elevationAlignment}get objectStates(){return this.graphicsCore?.objectStates}get suspendResumeExtentMode(){return"suspendResumeExtentMode"in this.owner?this.owner.suspendResumeExtentMode:"computed"}get scaleVisibilitySuspended(){return null!=this.scaleVisibility&&this.scaleVisibility.suspended}get suspended(){return this.owner.suspended}get legendEnabled(){return null==this.frustumVisibility||!this.frustumVisibility.suspended}get suspendInfo(){const e={};return this.scaleVisibilitySuspended&&(e.outsideScaleRange=!0),null!=this.frustumVisibility&&this.frustumVisibility.suspended&&(e.outsideOfView=!0),e}get updating(){return!!(this.graphicsCore?.updating||null!=this.frustumVisibility&&this.frustumVisibility.updating||this._updatingHandles.updating)}get updatingRemaining(){return this.graphicsCore?.updatingRemaining??0}get featureStore(){return this.graphicsCore?.featureStore}get view(){return this.owner.view}get loadedGraphics(){return this.owner.loadedGraphics}get fullOpacity(){return this.owner?.fullOpacity}get filter(){return"filter"in this.owner?this.owner.filter:null}get slicePlaneEnabled(){return this.owner.slicePlaneEnabled}get updatePolicy(){return this.owner.updatePolicy}get featureSpatialReference(){return"featureSpatialReference"in this.owner?this.owner.featureSpatialReference:this.owner.view.spatialReference}get graphics3DGraphics(){return this.graphicsCore?.graphics3DGraphics}get graphics3DGraphicsByObjectID(){return this.graphicsCore?.graphics3DGraphicsByObjectID}get symbolUpdateType(){return this.graphicsCore?.symbolUpdateType}get displayFeatureLimit(){const e=this.view.quality,t=this.graphicsCore?.displayFeatureLimit;if(1===e)return t;const i=Math.ceil(t.maximumNumberOfFeatures*e);return new v(t.maximumTotalNumberOfVertices,i,t.averageSymbolComplexity)}get usedMemory(){return this.graphicsCore?.usedMemory??0}get loadedFeatures(){return this.graphicsCore?.numberOfGraphics??0}get usedMemoryPerFeature(){return this.graphicsCore?.usedMemoryPerGraphic??0}get unprocessedMemoryEstimate(){return this.graphicsCore?.unprocessedMemoryEstimate??0}get performanceInfo(){return{core:this.graphicsCore.performanceInfo,elevationUpdating:this.elevationAlignment.updating,visibilityFrustum:null==this.frustumVisibility||!this.frustumVisibility.suspended,visibilityScale:!this.scaleVisibilitySuspended}}maskOccludee(e){const{set:t,handle:i}=this.objectStates.acquireSet(A.MaskOccludee,null);return this.objectStates.setUid(t,e.uid),i}highlight(e,i){if(e instanceof C){const{set:t,handle:s}=this.objectStates.acquireSet(A.Highlight,i);return this.owner.queryObjectIds(e).then((e=>this.objectStates.setObjectIds(t,e))),s}if("number"==typeof e||"string"==typeof e)return this.highlight([e],i);if(e instanceof t)return this.highlight([e],i);if("toArray"in e&&(e=e.toArray()),Array.isArray(e)&&e.length>0){if(e[0]instanceof t){const t=e;if(null==I(this.layer.fieldsIndex,t[0].attributes,i)){const e=t.map((e=>e.uid)),{set:i,handle:s}=this.objectStates.acquireSet(A.Highlight,null);return this.objectStates.setUids(i,e),s}e=t.map((e=>I(this.layer.fieldsIndex,e.attributes,i)))}if(Array.isArray(e)&&("number"==typeof e[0]||"string"==typeof e[0])){const t=e,{set:s,handle:r}=this.objectStates.acquireSet(A.Highlight,i);return this.objectStates.setObjectIds(s,t),r}}return n()}resetObjectStates(){this.objectStates.reset()}whenGraphicBounds(e,t){return this.graphicsCore?.whenGraphicBounds(e,t)}computeAttachmentOrigin(e,t){return this.graphicsCore?.computeAttachmentOrigin(e,t)}notifyGraphicGeometryChanged(e){this.graphicsCore.notifyGraphicGeometryChanged(e)}notifyGraphicVisibilityChanged(e){this.graphicsCore.notifyGraphicVisibilityChanged(e)}getRenderingInfo(e,t,s){const r=f(e,{renderer:t,arcade:s});if(r?.color){const e=r.color;e[0]=e[0]/255,e[1]=e[1]/255,e[2]=e[2]/255}if(null!=r&&null!=t&&this._randomRotationRenderers?.has(t)){const s=this._randomRotationRenderers.get(t),n=e.attributes[s],a=new i(0);a.updateFloatArray([n]),a.updateUint8Array([173]),r.heading=8.381e-8*a.digest()}return r}getRenderingInfoAsync(e,t,i,s){return E(e,{renderer:t,arcade:i,...s})}getSymbolLayerSize(e,t){return this.graphicsCore?.getSymbolLayerSize(e,t)}setObjectIdVisibility(e,t){this.graphicsCore?.setObjectIdVisibility(e,t)}refreshFilter(){null!=this.filterVisibility&&this.filterVisibility.reapply()}getGraphics3DGraphicByObjectId(e){return this.graphicsCore?.getGraphics3DGraphicByObjectId(e)}_updateClippingExtent(){const e=this.owner.view.clippingArea;this.graphicsCore.setClippingExtent(e,this.owner.view.spatialReference)&&(this.updateClippingExtent(e)||this.graphicsCore.recreateAllGraphics())}_setupSuspendResumeExtent(){(this.frustumVisibility||this.scaleVisibility)&&this.addHandles(l((()=>this.suspendResumeExtentMode),(()=>{switch(this.removeHandles(F),this.suspendResumeExtentMode){case"computed":this.addHandles([l((()=>this.graphicsCore.computedExtent),(e=>this._updateSuspendResumeExtent(e)),p),l((()=>this.graphicsCore.extentPadding),(()=>this._updateSuspendResumeExtent(this.graphicsCore.computedExtent)))],F);break;case"data":this.addHandles([d((()=>this.dataExtent),(e=>this._updateSuspendResumeExtent(e)),p),l((()=>this.graphicsCore.extentPadding),(()=>this._updateSuspendResumeExtent(this.dataExtent)))],F);break;default:r(this.suspendResumeExtentMode)}}),p))}_updateSuspendResumeExtent(e){e?this._suspendResumeExtentChanged(this._extentToSuspendResumeRect(e,this._suspendResumeExtent)):this._suspendResumeExtentChanged(null)}_extentToSuspendResumeRect(e,t){const i=this.owner.view.spatialReference;if(!e.spatialReference.equals(i)){if(!g(e,i))return;e=m(e,i)}return O(e,t,w,this.graphicsCore.extentPadding)}_suspendResumeExtentChanged(e){null!=this.frustumVisibility&&this.frustumVisibility.setExtent(e),null!=this.scaleVisibility&&this.scaleVisibility.setExtent(e)}};e([u()],P.prototype,"type",void 0),e([u({constructOnly:!0})],P.prototype,"owner",void 0),e([u()],P.prototype,"layer",null),e([u()],P.prototype,"renderer",null),e([u({constructOnly:!0})],P.prototype,"updateClippingExtent",void 0),e([u({constructOnly:!0})],P.prototype,"elevationFeatureExpressionEnabled",void 0),e([u({constructOnly:!0})],P.prototype,"graphicsCore",void 0),e([u({constructOnly:!0})],P.prototype,"scaleVisibilityEnabled",void 0),e([u({constructOnly:!0})],P.prototype,"filterVisibilityEnabled",void 0),e([u({constructOnly:!0})],P.prototype,"frustumVisibilityEnabled",void 0),e([u({constructOnly:!0})],P.prototype,"elevationAlignmentEnabled",void 0),e([u({constructOnly:!0})],P.prototype,"timeExtentEnabled",void 0),e([u({constructOnly:!0})],P.prototype,"setUidToIdOnAdd",void 0),e([u()],P.prototype,"scaleVisibility",null),e([u()],P.prototype,"filterVisibility",null),e([u()],P.prototype,"elevationAlignment",null),e([u({constructOnly:!0})],P.prototype,"frustumVisibility",void 0),e([u()],P.prototype,"objectStates",null),e([u()],P.prototype,"initializePromise",void 0),e([u()],P.prototype,"suspendResumeExtentMode",null),e([u()],P.prototype,"dataExtent",void 0),e([u()],P.prototype,"scaleVisibilitySuspended",null),e([u()],P.prototype,"suspended",null),e([u()],P.prototype,"legendEnabled",null),e([u()],P.prototype,"suspendInfo",null),e([u()],P.prototype,"updating",null),e([u()],P.prototype,"updatingRemaining",null),e([u()],P.prototype,"featureStore",null),e([u()],P.prototype,"view",null),e([u()],P.prototype,"loadedGraphics",null),e([u()],P.prototype,"fullOpacity",null),e([u()],P.prototype,"filter",null),e([u()],P.prototype,"slicePlaneEnabled",null),e([u()],P.prototype,"drapeSourceType",void 0),e([u()],P.prototype,"updatePolicy",null),e([u()],P.prototype,"preferredUpdatePolicy",void 0),e([u({readOnly:!0})],P.prototype,"displayFeatureLimit",null),P=e([h("esri.views.3d.layers.graphics.Graphics3DFeatureProcessor")],P);const F="suspendResumeExtentMode";export{P as Graphics3DFeatureProcessor};
5
+ import{_ as e}from"../../../../chunks/tslib.es6.js";import t from"../../../../Graphic.js";import{XXH as i}from"../../../../arcade/functions/hash.js";import s from"../../../../core/Accessor.js";import{neverReached as r}from"../../../../core/compilerUtils.js";import{makeHandle as n}from"../../../../core/handleUtils.js";import{destroyMaybe as a}from"../../../../core/maybe.js";import{logOnError as o}from"../../../../core/promiseUtils.js";import{watch as l,initial as p,when as d}from"../../../../core/reactiveUtils.js";import{property as u}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/accessorSupport/ensureType.js";import"../../../../core/arrayUtils.js";import{subclass as h}from"../../../../core/accessorSupport/decorators/subclass.js";import{diff as c}from"../../../../core/accessorSupport/diffUtils.js";import{UpdatingHandles as y}from"../../../../core/support/UpdatingHandles.js";import{canProject as g,project as m}from"../../../../geometry/support/webMercatorUtils.js";import{matchRandomRotationExpression as b}from"../../../../renderers/support/randomRotationExpression.js";import{getRenderingInfo as f,getRenderingInfoAsync as E}from"../../../../renderers/support/renderingInfoUtils.js";import C from"../../../../rest/support/Query.js";import{DrapeSourceType as x}from"../interfaces.js";import{suspendResumeExtentOptimism as w}from"./constants.js";import{DisplayFeatureLimit as v}from"./DisplayFeatureLimit.js";import{Graphics3DCore as j}from"./Graphics3DCore.js";import{Graphics3DElevationAlignment as V}from"./Graphics3DElevationAlignment.js";import{Graphics3DFrustumVisibility as S}from"./Graphics3DFrustumVisibility.js";import{Graphics3DObjectStates as R}from"./Graphics3DObjectStates.js";import{Graphics3DScaleVisibility as _}from"./Graphics3DScaleVisibility.js";import{enlargeExtent as O}from"./graphicUtils.js";import{attributeLookup as I}from"../support/attributeUtils.js";import{FeatureVisibilityFilter as G}from"../support/FeatureVisibilityFilter.js";import{Object3DState as A}from"../../webgl-engine/lib/basicInterfaces.js";import{UpdatePolicy as U}from"../../webgl-engine/lib/UpdatePolicy.js";let P=class extends s{constructor(e){super(e),this.type="graphics-3d",this._randomRotationRenderers=null,this._updatingHandles=new y,this.elevationFeatureExpressionEnabled=!1,this.scaleVisibilityEnabled=!1,this.filterVisibilityEnabled=!1,this.frustumVisibilityEnabled=!1,this.elevationAlignmentEnabled=!1,this.timeExtentEnabled=!1,this.setUidToIdOnAdd=!0,this.dataExtent=null,this.drapeSourceType=x.Features,this.preferredUpdatePolicy=U.ASYNC,this._suspendResumeExtent=null}initialize(){const e=this.owner,t=(this.filterVisibilityEnabled||this.timeExtentEnabled)&&"multipatch"!==e.layer.geometryType,i=new j({owner:this,layer:this.layer,preferredUpdatePolicy:this.preferredUpdatePolicy,elevationFeatureExpressionEnabled:this.elevationFeatureExpressionEnabled,graphicSymbolSupported:!1,hasZ:e.hasZ,hasM:e.hasM,setUidToIdOnAdd:this.setUidToIdOnAdd,componentFactories:{deconflictor:t=>e.view.deconflictor.addGraphicsOwner(t),labeler:(t,i)=>e.view.labeler.addGraphicsOwner(t,i),elevationAlignment:this.elevationAlignmentEnabled?(t,i)=>new V({graphicsCoreOwner:this,graphicsCore:t,queryGraphicUIDsInExtent:i,elevationProvider:e.view.elevationProvider}):null,scaleVisibility:this.scaleVisibilityEnabled?(t,i)=>new _({graphicsCoreOwner:this,layer:this.layer,queryGraphicUIDsInExtent:i,graphicsCore:t,basemapTerrain:e.view.basemapTerrain}):null,filterVisibility:t?t=>new G({context:{layerView:e,...t}}):null,objectStates:e=>new R(e)}});this._set("graphicsCore",i),this.frustumVisibilityEnabled&&this._set("frustumVisibility",new S({graphicsCoreOwner:this})),this.elevationAlignment&&this._updatingHandles.add((()=>this.layer.elevationInfo),((e,t)=>{c(e,t)&&this._updatingHandles.addPromise(this.graphicsCore.elevationInfoChange())})),this._updatingHandles.add((()=>this.layer.labelsVisible),(()=>this.graphicsCore.updateVisibilityInfo())),this._updatingHandles.add((()=>this.layer.labelingInfo),((e,t)=>{c(e,t)&&this.graphicsCore.updateLabelingInfo()})),this._updatingHandles.add((()=>this.preferredUpdatePolicy),(e=>this.graphicsCore.preferredUpdatePolicy=e)),this._set("initializePromise",this._initializeAsync()),this._updatingHandles.addPromise(this.initializePromise)}async _initializeAsync(){await o(this.graphicsCore.initializePromise);const e=this.owner;this._updatingHandles.add((()=>this.renderer),(e=>this._updatingHandles.addPromise(this.graphicsCore.rendererChange(e)))),this._updatingHandles.add((()=>e.fullOpacity),(()=>this.graphicsCore.opacityChange())),this._setupSuspendResumeExtent(),this.updateClippingExtent&&(this._updatingHandles.add((()=>e.view.clippingArea),(()=>this._updateClippingExtent())),this._updateClippingExtent()),this.graphicsCore.startCreateGraphics(),this.graphicsCore.labelsEnabled&&await o(this.graphicsCore.updateLabelingInfo())}destroy(){this._updatingHandles.destroy(),this._set("frustumVisibility",a(this.frustumVisibility)),this._set("graphicsCore",a(this.graphicsCore)),this._set("owner",null)}get layer(){return this.owner.layer}get renderer(){const{renderer:e,objectIdField:t}=this.layer;if(!e||!t||"heatmap"===e.type||!e.visualVariables)return e;const i=e.visualVariables.findIndex((e=>"rotation"===e.type&&null!=e.valueExpression&&b(e.valueExpression)===t&&(null==e.axis||"heading"===e.axis)&&"geographic"===e.rotationType));if(i<0)return e;const s=e.clone();return s.visualVariables.splice(i,1),this._randomRotationRenderers||(this._randomRotationRenderers=new WeakMap),this._randomRotationRenderers.set(s,t),s}get scaleVisibility(){return this.graphicsCore?.scaleVisibility}get filterVisibility(){return this.graphicsCore?.filterVisibility}get elevationAlignment(){return this.graphicsCore?.elevationAlignment}get objectStates(){return this.graphicsCore?.objectStates}get suspendResumeExtentMode(){return"suspendResumeExtentMode"in this.owner?this.owner.suspendResumeExtentMode:"computed"}get scaleVisibilitySuspended(){return null!=this.scaleVisibility&&this.scaleVisibility.suspended}get suspended(){return this.owner.suspended}get legendEnabled(){return null==this.frustumVisibility||!this.frustumVisibility.suspended}get suspendInfo(){const e={};return this.scaleVisibilitySuspended&&(e.outsideScaleRange=!0),null!=this.frustumVisibility&&this.frustumVisibility.suspended&&(e.outsideOfView=!0),e}get updating(){return!!(this.graphicsCore?.updating||this.frustumVisibility?.updating||this._updatingHandles.updating)}get updatingRemaining(){return this.graphicsCore?.updatingRemaining??0}get featureStore(){return this.graphicsCore?.featureStore}get view(){return this.owner.view}get loadedGraphics(){return this.owner.loadedGraphics}get fullOpacity(){return this.owner?.fullOpacity}get filter(){return"filter"in this.owner?this.owner.filter:null}get slicePlaneEnabled(){return this.owner.slicePlaneEnabled}get updatePolicy(){return this.owner.updatePolicy}get featureSpatialReference(){return"featureSpatialReference"in this.owner?this.owner.featureSpatialReference:this.owner.view.spatialReference}get graphics3DGraphics(){return this.graphicsCore?.graphics3DGraphics}get graphics3DGraphicsByObjectID(){return this.graphicsCore?.graphics3DGraphicsByObjectID}get symbolUpdateType(){return this.graphicsCore?.symbolUpdateType}get displayFeatureLimit(){const e=this.view.quality,t=this.graphicsCore?.displayFeatureLimit;if(1===e)return t;const i=Math.ceil(t.maximumNumberOfFeatures*e);return new v(t.maximumTotalNumberOfVertices,i,t.averageSymbolComplexity)}get usedMemory(){return this.graphicsCore?.usedMemory??0}get loadedFeatures(){return this.graphicsCore?.numberOfGraphics??0}get usedMemoryPerFeature(){return this.graphicsCore?.usedMemoryPerGraphic??0}get unprocessedMemoryEstimate(){return this.graphicsCore?.unprocessedMemoryEstimate??0}get performanceInfo(){return{core:this.graphicsCore.performanceInfo,elevationUpdating:this.elevationAlignment.updating,visibilityFrustum:null==this.frustumVisibility||!this.frustumVisibility.suspended,visibilityScale:!this.scaleVisibilitySuspended}}maskOccludee(e){const{set:t,handle:i}=this.objectStates.acquireSet(A.MaskOccludee,null);return this.objectStates.setUid(t,e.uid),i}highlight(e,i){if(e instanceof C){const{set:t,handle:s}=this.objectStates.acquireSet(A.Highlight,i);return this.owner.queryObjectIds(e).then((e=>this.objectStates.setObjectIds(t,e))),s}if("number"==typeof e||"string"==typeof e)return this.highlight([e],i);if(e instanceof t)return this.highlight([e],i);if("toArray"in e&&(e=e.toArray()),Array.isArray(e)&&e.length>0){if(e[0]instanceof t){const t=e;if(null==I(this.layer.fieldsIndex,t[0].attributes,i)){const e=t.map((e=>e.uid)),{set:i,handle:s}=this.objectStates.acquireSet(A.Highlight,null);return this.objectStates.setUids(i,e),s}e=t.map((e=>I(this.layer.fieldsIndex,e.attributes,i)))}if(Array.isArray(e)&&("number"==typeof e[0]||"string"==typeof e[0])){const t=e,{set:s,handle:r}=this.objectStates.acquireSet(A.Highlight,i);return this.objectStates.setObjectIds(s,t),r}}return n()}resetObjectStates(){this.objectStates.reset()}whenGraphicBounds(e,t){return this.graphicsCore?.whenGraphicBounds(e,t)}computeAttachmentOrigin(e,t){return this.graphicsCore?.computeAttachmentOrigin(e,t)}notifyGraphicGeometryChanged(e){this.graphicsCore.notifyGraphicGeometryChanged(e)}notifyGraphicVisibilityChanged(e){this.graphicsCore.notifyGraphicVisibilityChanged(e)}getRenderingInfo(e,t,s){const r=f(e,{renderer:t,arcade:s});if(r?.color){const e=r.color;e[0]=e[0]/255,e[1]=e[1]/255,e[2]=e[2]/255}if(null!=r&&null!=t&&this._randomRotationRenderers?.has(t)){const s=this._randomRotationRenderers.get(t),n=e.attributes[s],a=new i(0);a.updateFloatArray([n]),a.updateUint8Array([173]),r.heading=8.381e-8*a.digest()}return r}getRenderingInfoAsync(e,t,i,s){return E(e,{renderer:t,arcade:i,...s})}getSymbolLayerSize(e,t){return this.graphicsCore?.getSymbolLayerSize(e,t)}setObjectIdVisibility(e,t){this.graphicsCore?.setObjectIdVisibility(e,t)}refreshFilter(){null!=this.filterVisibility&&this.filterVisibility.reapply()}getGraphics3DGraphicByObjectId(e){return this.graphicsCore?.getGraphics3DGraphicByObjectId(e)}_updateClippingExtent(){const e=this.owner.view.clippingArea;this.graphicsCore.setClippingExtent(e,this.owner.view.spatialReference)&&(this.updateClippingExtent(e)||this.graphicsCore.recreateAllGraphics())}_setupSuspendResumeExtent(){(this.frustumVisibility||this.scaleVisibility)&&this.addHandles(l((()=>this.suspendResumeExtentMode),(()=>{switch(this.removeHandles(F),this.suspendResumeExtentMode){case"computed":this.addHandles([l((()=>this.graphicsCore.computedExtent),(e=>this._updateSuspendResumeExtent(e)),p),l((()=>this.graphicsCore.extentPadding),(()=>this._updateSuspendResumeExtent(this.graphicsCore.computedExtent)))],F);break;case"data":this.addHandles([d((()=>this.dataExtent),(e=>this._updateSuspendResumeExtent(e)),p),l((()=>this.graphicsCore.extentPadding),(()=>this._updateSuspendResumeExtent(this.dataExtent)))],F);break;default:r(this.suspendResumeExtentMode)}}),p))}_updateSuspendResumeExtent(e){e?this._suspendResumeExtentChanged(this._extentToSuspendResumeRect(e,this._suspendResumeExtent)):this._suspendResumeExtentChanged(null)}_extentToSuspendResumeRect(e,t){const i=this.owner.view.spatialReference;if(!e.spatialReference.equals(i)){if(!g(e,i))return;e=m(e,i)}return O(e,t,w,this.graphicsCore.extentPadding)}_suspendResumeExtentChanged(e){null!=this.frustumVisibility&&this.frustumVisibility.setExtent(e),null!=this.scaleVisibility&&this.scaleVisibility.setExtent(e)}};e([u()],P.prototype,"type",void 0),e([u({constructOnly:!0})],P.prototype,"owner",void 0),e([u()],P.prototype,"layer",null),e([u()],P.prototype,"renderer",null),e([u({constructOnly:!0})],P.prototype,"updateClippingExtent",void 0),e([u({constructOnly:!0})],P.prototype,"elevationFeatureExpressionEnabled",void 0),e([u({constructOnly:!0})],P.prototype,"graphicsCore",void 0),e([u({constructOnly:!0})],P.prototype,"scaleVisibilityEnabled",void 0),e([u({constructOnly:!0})],P.prototype,"filterVisibilityEnabled",void 0),e([u({constructOnly:!0})],P.prototype,"frustumVisibilityEnabled",void 0),e([u({constructOnly:!0})],P.prototype,"elevationAlignmentEnabled",void 0),e([u({constructOnly:!0})],P.prototype,"timeExtentEnabled",void 0),e([u({constructOnly:!0})],P.prototype,"setUidToIdOnAdd",void 0),e([u()],P.prototype,"scaleVisibility",null),e([u()],P.prototype,"filterVisibility",null),e([u()],P.prototype,"elevationAlignment",null),e([u({constructOnly:!0})],P.prototype,"frustumVisibility",void 0),e([u()],P.prototype,"objectStates",null),e([u()],P.prototype,"initializePromise",void 0),e([u()],P.prototype,"suspendResumeExtentMode",null),e([u()],P.prototype,"dataExtent",void 0),e([u()],P.prototype,"scaleVisibilitySuspended",null),e([u()],P.prototype,"suspended",null),e([u()],P.prototype,"legendEnabled",null),e([u()],P.prototype,"suspendInfo",null),e([u()],P.prototype,"updating",null),e([u()],P.prototype,"updatingRemaining",null),e([u()],P.prototype,"featureStore",null),e([u()],P.prototype,"view",null),e([u()],P.prototype,"loadedGraphics",null),e([u()],P.prototype,"fullOpacity",null),e([u()],P.prototype,"filter",null),e([u()],P.prototype,"slicePlaneEnabled",null),e([u()],P.prototype,"drapeSourceType",void 0),e([u()],P.prototype,"updatePolicy",null),e([u()],P.prototype,"preferredUpdatePolicy",void 0),e([u({readOnly:!0})],P.prototype,"displayFeatureLimit",null),P=e([h("esri.views.3d.layers.graphics.Graphics3DFeatureProcessor")],P);const F="suspendResumeExtentMode";export{P as Graphics3DFeatureProcessor};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../../Color.js";import"../../../../core/has.js";import{deg2rad as t}from"../../../../core/mathUtils.js";import{f as r,t as o}from"../../../../chunks/mat3.js";import{a}from"../../../../chunks/mat3f64.js";import{d as s,m as n,i}from"../../../../chunks/mat4.js";import{a as l,I as c,b as u}from"../../../../chunks/mat4f64.js";import{s as m,g as h,i as f,j as p,n as d,f as g,b as x}from"../../../../chunks/vec3.js";import{Z as _,O as T,c as y}from"../../../../chunks/vec3f64.js";import{O as b}from"../../../../chunks/vec4f64.js";import{canProjectWithoutEngine as v}from"../../../../geometry/projection.js";import{computeTranslationToOriginAndRotation as C}from"../../../../geometry/projection/computeTranslationToOriginAndRotation.js";import{projectBuffer as w}from"../../../../geometry/projection/projectBuffer.js";import{projectVectorToDehydratedPoint as j}from"../../../../geometry/projection/projectVectorToDehydratedPoint.js";import{create as M,empty as O,expandWithBuffer as P,intersectsClippingArea as R}from"../../../../geometry/support/aaBoundingBox.js";import{newFloatArray as A}from"../../../../geometry/support/FloatArray.js";import{getContinuousIndexArray as E,getZeroIndexArray as I}from"../../../../geometry/support/Indices.js";import N from"../../../../geometry/support/MeshComponent.js";import B from"../../../../geometry/support/MeshMaterialMetallicRoughness.js";import F from"../../../../geometry/support/MeshTextureTransform.js";import{t as S,a as U}from"../../../../chunks/vec32.js";import{project as L}from"../../../../geometry/support/meshUtils/georeference.js";import{transformNormal as $,projectNormalToPCPF as G,transformTangent as V,projectTangentToPCPF as D}from"../../../../geometry/support/meshUtils/projection.js";import{makeDehydratedPoint as k}from"../../../../layers/graphics/dehydratedPoint.js";import{MeshTransformUpdateAction as H}from"../../../../layers/graphics/sources/interfaces.js";import{ViewingMode as q}from"../../../ViewingMode.js";import{isEncodedMeshTexture as W}from"../../glTF/internal/resourceUtils.js";import{getTransformMatrix as z}from"../../glTF/internal/TextureTransformUtils.js";import{perObjectElevationAligner as Y}from"./ElevationAligners.js";import{needsElevationUpdates3D as Z,evaluateElevationInfoAtPoint as J}from"./elevationAlignmentUtils.js";import{Graphics3DMeshObject3DGraphicLayer as K}from"./Graphics3DMeshObject3DGraphicLayer.js";import{Object3DEdgeState as Q}from"./Graphics3DObject3DGraphicLayer.js";import{Graphics3DSymbolLayer as X}from"./Graphics3DSymbolLayer.js";import{MaterialInfoCache as ee,MeshFastUpdateProcessor as te}from"./MeshFastUpdateProcessor.js";import{createMaterial as re}from"../support/edgeUtils.js";import{parseColorMixMode as oe,encodeSymbolColor as ae}from"../support/symbolColorUtils.js";import{debugFlags as se}from"../../support/debugFlags.js";import{Attribute as ne}from"../../webgl-engine/lib/Attribute.js";import{AlphaDiscardMode as ie,CullFaceOptions as le}from"../../webgl-engine/lib/basicInterfaces.js";import{ContentObjectType as ce}from"../../webgl-engine/lib/ContentObjectType.js";import{Geometry as ue}from"../../webgl-engine/lib/Geometry.js";import{Object3D as me}from"../../webgl-engine/lib/Object3D.js";import{Texture as he}from"../../webgl-engine/lib/Texture.js";import{VertexAttribute as fe}from"../../webgl-engine/lib/VertexAttribute.js";import{DefaultMaterial as pe}from"../../webgl-engine/materials/DefaultMaterial.js";import{NativeLineMaterial as de}from"../../webgl-engine/materials/NativeLineMaterial.js";import{useSchematicPBR as ge,defaultSchematicMRRFactors as xe,defaultAdvancedMRRFactors as _e}from"../../webgl-engine/materials/pbrUtils.js";import{TextureWrapMode as Te}from"../../../webgl/enums.js";const ye=["mesh"];class be extends X{constructor(e,t,r,o){super(e,t,r,o),this._materialInfoCache=new ee,this._fastUpdateProcessor=new te,this._textures=new Map,this.ensureDrapedStatus(!1)}async doLoad(){se.DRAW_MESH_GEOMETRY_NORMALS&&(this._debugVertexNormalMaterial=new de({color:[1,0,1,1]}),this._debugFaceNormalMaterial=new de({color:[0,1,1,1]}))}destroy(){super.destroy(),this._textures.forEach((e=>e.unload())),this._context.stage.removeMany(this._materialInfoCache.materials),this._context.stage.removeMany(Array.from(this._textures.values())),this._materialInfoCache.clear(),this._textures.clear(),this._fastUpdateProcessor.destroy(this._context.stage)}get materials(){return this._materialInfoCache.materials}createGraphics3DGraphic(e){const t=e.graphic;if(!this._validateGeometry(t.geometry,ye,"fill on mesh-3d"))return null;const r=this.setGraphicElevationContext(t),o=e.renderingInfo;return this._createAs3DShape(t,o,r,t.uid)}onRemoveGraphic(e){this._fastUpdateProcessor.onRemoveGraphic(e,this._materialInfoCache,this._context)}layerOpacityChanged(e,t){const r=this._getLayerOpacity();this._updateMaterialParameters((e=>{e.material.setParameters({layerOpacity:r});const t=e.material.parameters;this._setMaterialTransparentParameter(t,e),e.material.setParameters({transparent:t.transparent})})),e.forEach((e=>t(e)?.layerOpacityChanged(r,this._context.isAsync)))}layerElevationInfoChanged(e,t){return this.updateGraphics3DGraphicElevationInfo(e,t,Z)}slicePlaneEnabledChanged(e,t){return this._updateMaterialParameters((({material:e})=>{e.setParameters({hasSlicePlane:this._context.slicePlaneEnabled})})),e.forEach((e=>t(e)?.slicePlaneEnabledChanged(this._context.slicePlaneEnabled,this._context.isAsync))),!0}physicalBasedRenderingChanged(){const e=this._usePBR();return this._updateMaterialParameters((({material:t})=>t.setParameters({usePBR:e}))),!0}updateTransform(e,t,r,o){const a=this._context.renderCoordsHelper.spatialReference,s=Ae,{origin:n,transform:i}=r;switch(C(t,m(we,n.x,n.y,n.z??0),s,a),o){case H.EnableFastUpdates:this._fastUpdateProcessor.enable(e,this._materialInfoCache,this._context);break;case H.DisableFastUpdates:this._fastUpdateProcessor.disable(e,this._materialInfoCache,this._context);break;case H.UpdateFastLocalOrigin:e.updateFastLocalOrigin(s,i,this._context.localOriginFactory)}const{elevationContext:l}=e;l.centerPointInElevationSR=this._getCenterPointInElevationSR(s);const{elevationProvider:c,renderCoordsHelper:u}=this._context,h=(e,t)=>J(e,c,l,u,t);return e.alignedSampledElevation=Y(e,l,c.spatialReference,h,u,s),e.updateTransform(s,i,this._context.isAsync),!0}_requiresSymbolVertexColors(){return this._drivenProperties.color||this._drivenProperties.opacity}_colorOrTextureUid(t){return null==t?"-":t instanceof e?t.toHex():t.contentHash}_materialPropertiesDefault(e,t){const r=this._requiresSymbolVertexColors(),o=!!e.vertexAttributes.color,a=!!e.vertexAttributes.tangent;return{hasSymbolVertexColors:r,hasVertexColors:o,hasVertexTangents:a,uid:`vc:${o},vt:${a},vct${t},svc:${r}`}}_textureTransformUid(e){const{offset:t,scale:r,rotation:o}=e??Ne;return`${t[0]},${t[1]},${o},${r[0]},${r[1]}`}_materialProperties(e,t,r){const o=this._materialPropertiesDefault(e,r);if(!t.material)return o;const{color:a,colorTexture:s,colorTextureTransform:n,normalTexture:i,normalTextureTransform:l,doubleSided:c,alphaCutoff:u,alphaMode:m}=t.material,h=this._colorOrTextureUid(a),f=this._colorOrTextureUid(s),p=this._textureTransformUid(n),d=this._colorOrTextureUid(i),g=this._textureTransformUid(l);if(o.color=a,o.colorTexture=s,o.normalTexture=i,o.uid=`${o.uid},cmuid:${h},ctmuid:${f},cttuid:${p},ntmuid:${d},nttuid:${g},ds:${c},ac:${u},am:${m}`,t.material instanceof B){const{metallic:e,roughness:r,metallicRoughnessTexture:a,metallicRoughnessTextureTransform:s,emissiveColor:i,emissiveTexture:c,emissiveTextureTransform:u,occlusionTexture:m,occlusionTextureTransform:h}=t.material,f=this._colorOrTextureUid(a),p=this._textureTransformUid(s),d=this._colorOrTextureUid(i),g=this._colorOrTextureUid(c),x=this._textureTransformUid(u),_=this._colorOrTextureUid(m),T=this._textureTransformUid(h);o.metallic=e,o.roughness=r,o.metallicRoughnessTexture=a,o.emissiveColor=i,o.emissiveTexture=c,o.occlusionTexture=m,o.colorTextureTransform=this._convertTextureTransform(n),o.normalTextureTransform=this._convertTextureTransform(l),o.emissiveTextureTransform=this._convertTextureTransform(u),o.occlusionTextureTransform=this._convertTextureTransform(h),o.metallicRoughnessTextureTransform=this._convertTextureTransform(s),o.uid=`${o.uid},mrm:${e},mrr:${r},mrt:${f},mrtt:${p},emuid:${d},etmuid:${g},ett:${x},otmuid:${_},ott:${T}`}return o}_convertTextureTransform(e){if(!e)return null;const{scale:r,offset:o,rotation:a}=e;return{scale:r,offset:o,rotation:t(a)}}_setInternalColorValueParameters(t,r){r.diffuse=e.toUnitRGB(t),r.opacity=t.a}_getLoadableTextureResource(e){return e.data??e.url}_getInternalTextureId(e){const t=this._getInternalTexture(e,ie.Opaque);return t?.id}_getInternalTexture(e,t){const r=this._getLoadableTextureResource(e);if(!r)return null;const o=`${e.contentHash}/${t}`;let a=this._textures.get(o);if(!a){let s=null;const n=this._context.stage.renderView.renderingContext.parameters.maxMaxAnisotropy,i={wrap:this._castTextureWrap(e.wrap),noUnpackFlip:!0,maxAnisotropy:n,mipmap:n>1};W(r)?(s=r.data,i.preMultiplyAlpha=!1,i.encoding=r.encoding):(s=r,i.preMultiplyAlpha=t!==ie.Opaque,i.downsampleUncompressed=this._context.graphicsCoreOwner.view.qualitySettings.graphics3D.uncompressedTextureDownsamplingEnabled),a=new he(s,i),this._textures.set(o,a),a.load(this._context.stage.renderView.renderingContext),this._context.stage.add(a)}return a}_castTextureWrap(e="repeat"){if("string"==typeof e){const t=this._castTextureWrapIndividual(e);return{s:t,t}}return{s:this._castTextureWrapIndividual(e.horizontal),t:this._castTextureWrapIndividual(e.vertical)}}_castTextureWrapIndividual(e){switch(e){case"clamp":return Te.CLAMP_TO_EDGE;case"mirror":return Te.MIRRORED_REPEAT;default:return Te.REPEAT}}_setInternalMaterialParameters(t,r){if(null!=t.color&&this._setInternalColorValueParameters(t.color,r),null!=t.colorTexture){const e=this._getInternalTexture(t.colorTexture,r.textureAlphaMode);e?(r.textureId=e.id,r.textureAlphaPremultiplied=!!e.parameters.preMultiplyAlpha):r.textureId=void 0}t.normalTexture&&(r.normalTextureId=this._getInternalTextureId(t.normalTexture)),t.emissiveColor&&(r.emissiveFactor=e.toUnitRGB(t.emissiveColor)),t.emissiveTexture&&(r.emissiveTextureId=this._getInternalTextureId(t.emissiveTexture)),t.occlusionTexture&&(r.occlusionTextureId=this._getInternalTextureId(t.occlusionTexture)),t.metallicRoughnessTexture&&(r.metallicRoughnessTextureId=this._getInternalTextureId(t.metallicRoughnessTexture)),r.colorTextureTransformMatrix=z(t.colorTextureTransform),r.normalTextureTransformMatrix=z(t.normalTextureTransform),r.occlusionTextureTransformMatrix=z(t.occlusionTextureTransform),r.emissiveTextureTransformMatrix=z(t.emissiveTextureTransform),r.metallicRoughnessTextureTransformMatrix=z(t.metallicRoughnessTextureTransform)}_setExternalMaterialParameters(t){const r=this._drivenProperties.color;let o=this.symbolLayer.material?.colorMixMode??null;if(r)t.externalColor=b;else{const r=this.symbolLayer.material?.color??null;r?t.externalColor=e.toUnitRGBA(r):(o=null,t.externalColor=b)}o&&(t.colorMixMode=o),t.castShadows=!!this.symbolLayer.castShadows}_hasTransparentVertexColors(e){const t=e.vertexAttributes.color;if(null==t)return!1;for(let r=3;r<t.length;r+=4)if(255!==t[r])return!0;return!1}_getOrCreateMaterial(t,r){const o=r.material?.color,a=r.material?.colorTexture,s=r.material?.alphaMode,n="blend"===s,i=!("opaque"===s)&&(this._hasTransparentVertexColors(t)||null!=o&&o.a<1||a?.transparent||n),l=this._materialProperties(t,r,i),c=this._materialInfoCache.byUid(l.uid);if(c)return c.material;const u={uid:l.uid,material:null,isComponentTransparent:i,alphaMode:r.material?r.material.alphaMode:"opaque"},m=ge({normalTexture:l.normalTexture,metallicRoughnessTexture:l.metallicRoughnessTexture,metallicFactor:l.metallic,roughnessFactor:l.roughness,emissiveTexture:l.emissiveTexture,emissiveFactor:e.toUnitRGB(l.emissiveColor),occlusionTexture:l.occlusionTexture}),h={usePBR:this._usePBR(),isSchematic:m,hasVertexColors:l.hasVertexColors,hasSymbolColors:l.hasSymbolVertexColors,hasVertexTangents:l.hasVertexTangents,ambient:_,diffuse:T,opacity:1,doubleSided:!0,doubleSidedType:"winding-order",cullFace:le.None,layerOpacity:this._getLayerOpacity(),hasSlicePlane:this._context.slicePlaneEnabled,initTextureTransparent:!0};h.mrrFactors=m?[...xe]:[l.metallic,l.roughness,_e[2]],r.material&&(h.doubleSided=r.material.doubleSided,h.cullFace=r.material.doubleSided?le.None:le.Back,h.textureAlphaCutoff=r.material.alphaCutoff),this._setExternalMaterialParameters(h),this._setMaterialTransparentParameter(h,u),this._setInternalMaterialParameters(l,h);const f=new pe(h);return u.material=f,this._materialInfoCache.set(l.uid,u),this._context.stage.add(f),f}_usePBR(){return this._context.physicalBasedRenderingEnabled}_setMaterialTransparentParameter(e,t){e.transparent=this.needsDrivenTransparentPass||t.isComponentTransparent||e.layerOpacity<1||e.opacity<1||e.externalColor&&e.externalColor[3]<1,"auto"===t.alphaMode?e.textureAlphaMode=e.transparent?ie.MaskBlend:ie.Opaque:e.textureAlphaMode="opaque"===t.alphaMode?ie.Opaque:"mask"===t.alphaMode?ie.Mask:ie.Blend}_addDebugNormals(e,t){const r=t.length,o=e.spatialReference.isGeographic?20015077/180:1,a=.1*Math.max(e.extent.width*o,e.extent.height*o,e.extent.zmax-e.extent.zmin),s=[],n=[],i=[],l=[];for(let p=0;p<r;p++){const e=t[p],r=e.attributes.get(fe.POSITION),o=e.attributes.get(fe.NORMAL),c=r.data,u=r.indices,m=o.data,d=o.indices;for(let t=0;t<u.length;t++){const e=3*u[t],r=3*d[t];for(let t=0;t<3;t++)s.push(c[e+t]);for(let t=0;t<3;t++)s.push(c[e+t]+m[r+t]*a);if(n.push(n.length),n.push(n.length),t%3==0){this._calculateFaceNormal(c,u,t,Oe),this._getFaceVertices(c,u,t,we,je,Me),h(we,we,je),h(we,we,Me),f(we,we,1/3);for(let e=0;e<3;e++)i.push(we[e]);for(let e=0;e<3;e++)i.push(we[e]+Oe[e]*a);l.push(l.length),l.push(l.length)}}}const c=t[0].transformation,u=new ue(this._debugVertexNormalMaterial,[[fe.POSITION,new ne(s,n,3,!0)]],null,ce.Line);t.push(u),u.transformation=c;const m=new ue(this._debugFaceNormalMaterial,[[fe.POSITION,new ne(i,l,3,!0)]],null,ce.Line);m.transformation=c,t.push(m)}_createAs3DShape(e,t,r,o){const a=e.geometry;if("mesh"!==a.type)return null;const s=this._createGeometryInfo(a,t,o);if(null==s)return null;const{geometries:n,objectTransformation:i}=s;se.DRAW_MESH_GEOMETRY_NORMALS&&this._addDebugNormals(a,n);const l=new me({geometries:n,layerUid:this._context.layer.uid,graphicUid:o});l.transformation=i;const c=re(this.symbolLayer,{opacity:this._getLayerOpacity()}),u=c?new Q(n[0].material,[c],{mergeGeometries:!0,hasSlicePlane:this._context.slicePlaneEnabled}):null,m=new K(this,l,n,null,null,Y,r,u);this._fastUpdateProcessor.onAddGraphic(),m.needsElevationUpdates=Z(r.mode),m.useObjectOriginAsAttachmentOrigin=!0,r.centerPointInElevationSR=this._getCenterPointInElevationSR(l.transformation);const{elevationProvider:h,renderCoordsHelper:f}=this._context,p=(e,t)=>J(e,h,r,f,t);return m.alignedSampledElevation=Y(m,r,h.spatialReference,p,f),m}_getCenterPointInElevationSR(e){const t=k(0,0,0,null!=this._context.elevationProvider.spatialReference?this._context.elevationProvider.spatialReference:null);return j([e[12],e[13],e[14]],this._context.renderCoordsHelper.spatialReference,t),t}_createComponentNormals(e,t,r,o){switch(r.shading||"flat"){default:case"source":return this._createComponentNormalsSource(e,t,r,o);case"flat":return this._createComponentNormalsFlat(e,o);case"smooth":return this._createComponentNormalsSmooth(e,o)}}_createComponentNormalsSource(e,t,r,o){if(null==t)return this._createComponentNormalsFlat(e,o);let a=!1;if(!r.trustSourceNormals)for(let s=0;s<o.length;s+=3){this._calculateFaceNormal(e,o,s,Oe);for(let e=0;e<3;e++){const r=3*o[s+e];we[0]=t[r],we[1]=t[r+1],we[2]=t[r+2],p(Oe,we)<0&&(t[r]=-t[r],t[r+1]=-t[r+1],t[r+2]=-t[r+2],a=!0)}}return new ve(t,o,a)}_createComponentNormalsFlat(e,t){const r=A(t.length),o=new Array(3*t.length);for(let a=0;a<t.length;a+=3){const s=this._calculateFaceNormal(e,t,a,Oe);for(let e=0;e<3;e++)r[a+e]=s[e],o[a+e]=a/3}return new ve(r,o,!1)}_createComponentNormalsSmooth(e,t){const r={};for(let s=0;s<t.length;s+=3){const o=this._calculateFaceNormal(e,t,s,Oe);for(let e=0;e<3;e++){const a=t[s+e];let n=r[a];n||(n={normal:y(),count:0},r[a]=n),h(n.normal,n.normal,o),n.count++}}const o=A(3*t.length),a=new Array(3*t.length);for(let s=0;s<t.length;s++){const e=r[t[s]];1!==e.count&&(d(e.normal,e.normal),e.count=1);for(let t=0;t<3;t++)o[3*s+t]=e.normal[t];a[s]=s}return new ve(o,a,!1)}_getFaceVertices(e,t,r,o,a,s){const n=3*t[r],i=3*t[r+1],l=3*t[r+2];o[0]=e[n],o[1]=e[n+1],o[2]=e[n+2],a[0]=e[i],a[1]=e[i+1],a[2]=e[i+2],s[0]=e[l],s[1]=e[l+1],s[2]=e[l+2]}_calculateFaceNormal(e,t,r,o){return this._getFaceVertices(e,t,r,we,je,Me),g(je,je,we),g(Me,Me,we),x(we,je,Me),d(o,we),o}_getOrCreateComponents(e){return e.components??Ie}_createPositionBuffer(e,t){let r=e.vertexAttributes.position;const o=t.reprojection===Be.ECEF?t.transformBeforeProject:null;if(o&&(r=S(new Float64Array(r.length),r,o)),t.reprojection===Be.NONE)return t.needsBufferCopy?new Float64Array(r):r;const a=o?r:new Float64Array(r.length);return w(r,e.spatialReference,0,a,this._context.renderCoordsHelper.spatialReference,0,r.length/3),a}_createNormalBuffer(e,t,r){let o=e.vertexAttributes.normal;if(null==o)return null;const a=r.reprojection===Be.ECEF?r.transformBeforeProject:null;a&&(o=$(o,new Float32Array(o.length),a));if("local"===this._context.graphicsCoreOwner.view.viewingMode||r.reprojection===Be.NONE)return r.needsBufferCopy&&e.vertexAttributes.normal===o?new Float32Array(o):o;const s=e.vertexAttributes.position,n=a?o:new Float32Array(o.length);return G(o,s,t,e.spatialReference,n)}_createTangentBuffer(e,t,r){let o=e.vertexAttributes.tangent;if(null==o)return null;const a=r.reprojection===Be.ECEF?r.transformBeforeProject:null;a&&(o=V(o,new Float32Array(o.length),a));if("local"===this._context.graphicsCoreOwner.view.viewingMode||r.reprojection===Be.NONE)return r.needsBufferCopy&&e.vertexAttributes.normal===o?new Float32Array(o):o;const s=e.vertexAttributes.position,n=a?o:new Float32Array(o.length);return D(o,s,t,e.spatialReference,n)}_createColorBuffer(e){return e.vertexAttributes.color}_createSymbolColorBuffer(e){if(this._requiresSymbolVertexColors()){const t=this._getVertexOpacityAndColor(e),r=oe(this.symbolLayer?.material?.colorMixMode),o=new Uint8Array(4);return ae(t,r,o),o}return null}_createBuffers(e,t){const r=e.vertexAttributes&&e.vertexAttributes.position;if(!r)return this.logger.warn("Mesh geometry must contain position vertex attributes"),null;const o=e.vertexAttributes.normal,a=e.vertexAttributes.uv,s=e.vertexAttributes.tangent;if(o&&o.length!==r.length)return this.logger.warn("Mesh normal vertex buffer must contain the same number of elements as the position buffer"),null;if(s&&s.length/4!=r.length/3)return this.logger.warn("Mesh tangent vertex buffer must contain the same number of elements as the position buffer"),null;if(a&&a.length/2!=r.length/3)return this.logger.warn("Mesh uv vertex buffer must contain the same number of elements as the position buffer"),null;const n=this._computeReprojectionInfo(e),i=this._createPositionBuffer(e,n),c=this._createColorBuffer(e),u=this._createSymbolColorBuffer(t),m=this._createNormalBuffer(e,i,n),h=this._createTangentBuffer(e,i,n);return{positionBuffer:i,normalBuffer:m,tangentBuffer:h,uvBuffer:a,colorBuffer:c,symbolColorBuffer:u,objectTransformation:n.reprojection===Be.NONE&&n.objectTransformation?n.objectTransformation:this._transformOriginLocal(e,i,m,h),geometryTransformation:n.reprojection===Be.NONE&&n.geometryTransformation?n.geometryTransformation:l()}}_computeReprojectionInfo(e){const{vertexSpace:t}=e,r=t.isRelative,o=t.isGeoreferenced?this._context.renderCoordsHelper.viewingMode===q.Local?Be.NONE:Be.ECEF:Be.NONE;if(r){const{origin:r}=t,a=l(),i=e.transform?.localMatrix??c;if(o===Be.NONE){C(e.spatialReference,r,a,this._context.renderCoordsHelper.spatialReference);return{reprojection:o,objectTransformation:a,geometryTransformation:u(i),needsBufferCopy:!1}}const m=s(l(),r);return n(m,m,i),{reprojection:o,transformBeforeProject:m,needsBufferCopy:!0}}return{reprojection:o,needsBufferCopy:!0}}_transformOriginLocal(e,t,a,s){const n=this._context.renderCoordsHelper.spatialReference,c=e.anchor;Ce[0]=c.x,Ce[1]=c.y,Ce[2]=c.z??0;const u=l();return C(e.spatialReference,Ce,u,n),i(Pe,u),S(t,t,Pe),(a||s)&&(r(Re,u),o(Re,Re),a&&U(a,a,Re),s&&U(s,s,Re,4)),u}_validateFaces(e,t){const r=e.vertexAttributes.position.length/3,o=t.faces;if(o){let e=-1;for(let t=0;t<o.length;t++){const r=o[t];r>e&&(e=r)}if(r<=e)return this.logger.warn(`Vertex index ${e} is out of bounds of the mesh position buffer`),!1}else if(r%3!=0)return this.logger.warn("Mesh position buffer length must be a multiple of 9 if no component faces are defined (3 values per vertex * 3 vertices per triangle)"),!1;return!0}_getOrCreateFaces(e,t){return t.faces??E(e.vertexAttributes.position.length/3)}_isOutsideClippingArea(e){if(!this._context.clippingExtent)return!1;const t=e.vertexAttributes?.position;if(!t)return!1;const r=this._context.elevationProvider.spatialReference,o=L({positions:t,transform:e.transform,vertexSpace:e.vertexSpace,inSpatialReference:e.spatialReference,outSpatialReference:r??e.spatialReference}),a=o.length/3;return O(Ee),P(Ee,o,0,a),!R(Ee,this._context.clippingExtent)}_createGeometryInfo(e,t,r){if(!v(e.spatialReference,this._context.graphicsCoreOwner.view.spatialReference))return this.logger.warn("Geometry spatial reference is not compatible with the view"),null;if(this._isOutsideClippingArea(e))return null;const o=this._createBuffers(e,t);if(null==o)return null;const{positionBuffer:a,uvBuffer:s,colorBuffer:n,symbolColorBuffer:i,normalBuffer:l,tangentBuffer:c,objectTransformation:u,geometryTransformation:m}=o,h=this._getOrCreateComponents(e),f=new Array;let p=!1;for(const d of h){if(!this._validateFaces(e,d))return null;const t=this._getOrCreateFaces(e,d);if(0===t.length)continue;const o=this._createComponentNormals(a,l,d,t);o.didFlipNormals&&(p=!0);const u=[[fe.POSITION,new ne(a,t,3,!0)],[fe.NORMAL,new ne(o.normals,o.indices,3,!0)]];n&&u.push([fe.COLOR,new ne(n,t,4,!0)]),i&&u.push([fe.SYMBOLCOLOR,new ne(i,I(t.length),4,!0)]),s&&u.push([fe.UV0,new ne(s,t,2,!0)]),c&&u.push([fe.TANGENT,new ne(c,t,4,!0)]);const h=this._context.stage.renderView.getObjectAndLayerIdColor({graphicUid:r,layerUid:this._context.layer.uid}),g=this._getOrCreateMaterial(e,d),x=new ue(g,u,null,ce.Mesh,h);x.transformation=m,f.push(x)}return p&&this.logger.warn("Normals have been automatically flipped to be consistent with the counter clock wise face winding order. It is better to generate mesh geometries that have consistent normals."),{geometries:f,objectTransformation:u}}_updateMaterialParameters(e){this._materialInfoCache.forEachMaterialInfo(e),this._fastUpdateProcessor.forEachMaterialInfo(e),this._fastUpdateProcessor.forEachClonedMaterial(((e,t)=>{t.setParameters(e.parameters)}))}test(){return{...super.test(),materials:this._materialInfoCache.materials}}}class ve{constructor(e,t,r){this.normals=e,this.indices=t,this.didFlipNormals=r}}const Ce=y(),we=y(),je=y(),Me=y(),Oe=y(),Pe=l(),Re=a(),Ae=l(),Ee=M(),Ie=[new N],Ne=new F;var Be;!function(e){e[e.NONE=0]="NONE",e[e.ECEF=1]="ECEF"}(Be||(Be={}));export{be as Graphics3DMeshFillSymbolLayer};
5
+ import e from"../../../../Color.js";import"../../../../core/has.js";import{deg2rad as t}from"../../../../core/mathUtils.js";import{f as r,t as o}from"../../../../chunks/mat3.js";import{a}from"../../../../chunks/mat3f64.js";import{d as s,m as n,i,B as l}from"../../../../chunks/mat4.js";import{a as c,I as u,b as m}from"../../../../chunks/mat4f64.js";import{s as h,g as f,i as p,j as d,n as g,f as x,b as _}from"../../../../chunks/vec3.js";import{Z as T,O as y,c as b}from"../../../../chunks/vec3f64.js";import{O as v}from"../../../../chunks/vec4f64.js";import{canProjectWithoutEngine as C}from"../../../../geometry/projection.js";import{computeTranslationToOriginAndRotation as w}from"../../../../geometry/projection/computeTranslationToOriginAndRotation.js";import{projectBuffer as j}from"../../../../geometry/projection/projectBuffer.js";import{projectVectorToDehydratedPoint as O}from"../../../../geometry/projection/projectVectorToDehydratedPoint.js";import{create as M,empty as P,expandWithBuffer as R,intersectsClippingArea as A}from"../../../../geometry/support/aaBoundingBox.js";import{newFloatArray as E}from"../../../../geometry/support/FloatArray.js";import{getContinuousIndexArray as I,getZeroIndexArray as N}from"../../../../geometry/support/Indices.js";import B from"../../../../geometry/support/MeshComponent.js";import F from"../../../../geometry/support/MeshMaterialMetallicRoughness.js";import S from"../../../../geometry/support/MeshTextureTransform.js";import{t as U,a as L}from"../../../../chunks/vec32.js";import{project as $}from"../../../../geometry/support/meshUtils/georeference.js";import{transformNormal as G,projectNormalToPCPF as V,transformTangent as D,projectTangentToPCPF as k}from"../../../../geometry/support/meshUtils/projection.js";import{makeDehydratedPoint as H}from"../../../../layers/graphics/dehydratedPoint.js";import{MeshTransformUpdateAction as q}from"../../../../layers/graphics/sources/interfaces.js";import{ViewingMode as W}from"../../../ViewingMode.js";import{isEncodedMeshTexture as z}from"../../glTF/internal/resourceUtils.js";import{getTransformMatrix as Y}from"../../glTF/internal/TextureTransformUtils.js";import{perObjectElevationAligner as Z}from"./ElevationAligners.js";import{needsElevationUpdates3D as J,evaluateElevationInfoAtPoint as K}from"./elevationAlignmentUtils.js";import{Graphics3DMeshObject3DGraphicLayer as Q}from"./Graphics3DMeshObject3DGraphicLayer.js";import{Object3DEdgeState as X}from"./Graphics3DObject3DGraphicLayer.js";import{Graphics3DSymbolLayer as ee}from"./Graphics3DSymbolLayer.js";import{MaterialInfoCache as te,MeshFastUpdateProcessor as re}from"./MeshFastUpdateProcessor.js";import{createMaterial as oe}from"../support/edgeUtils.js";import{parseColorMixMode as ae,encodeSymbolColor as se}from"../support/symbolColorUtils.js";import{debugFlags as ne}from"../../support/debugFlags.js";import{Attribute as ie}from"../../webgl-engine/lib/Attribute.js";import{AlphaDiscardMode as le,CullFaceOptions as ce}from"../../webgl-engine/lib/basicInterfaces.js";import{ContentObjectType as ue}from"../../webgl-engine/lib/ContentObjectType.js";import{Geometry as me}from"../../webgl-engine/lib/Geometry.js";import{Object3D as he}from"../../webgl-engine/lib/Object3D.js";import{Texture as fe}from"../../webgl-engine/lib/Texture.js";import{VertexAttribute as pe}from"../../webgl-engine/lib/VertexAttribute.js";import{DefaultMaterial as de}from"../../webgl-engine/materials/DefaultMaterial.js";import{NativeLineMaterial as ge}from"../../webgl-engine/materials/NativeLineMaterial.js";import{useSchematicPBR as xe,defaultSchematicMRRFactors as _e,defaultAdvancedMRRFactors as Te}from"../../webgl-engine/materials/pbrUtils.js";import{TextureWrapMode as ye}from"../../../webgl/enums.js";const be=["mesh"];class ve extends ee{constructor(e,t,r,o){super(e,t,r,o),this._materialInfoCache=new te,this._fastUpdateProcessor=new re,this._textures=new Map,this.ensureDrapedStatus(!1)}async doLoad(){ne.DRAW_MESH_GEOMETRY_NORMALS&&(this._debugVertexNormalMaterial=new ge({color:[1,0,1,1]}),this._debugFaceNormalMaterial=new ge({color:[0,1,1,1]}))}destroy(){super.destroy(),this._textures.forEach((e=>e.unload())),this._context.stage.removeMany(this._materialInfoCache.materials),this._context.stage.removeMany(Array.from(this._textures.values())),this._materialInfoCache.clear(),this._textures.clear(),this._fastUpdateProcessor.destroy(this._context.stage)}get materials(){return this._materialInfoCache.materials}createGraphics3DGraphic(e){const t=e.graphic;if(!this._validateGeometry(t.geometry,be,"fill on mesh-3d"))return null;const r=this.setGraphicElevationContext(t),o=e.renderingInfo;return this._createAs3DShape(t,o,r,t.uid)}onRemoveGraphic(e){this._fastUpdateProcessor.onRemoveGraphic(e,this._materialInfoCache,this._context)}layerOpacityChanged(e,t){const r=this._getLayerOpacity();this._updateMaterialParameters((e=>{e.material.setParameters({layerOpacity:r});const t=e.material.parameters;this._setMaterialTransparentParameter(t,e),e.material.setParameters({transparent:t.transparent})})),e.forEach((e=>t(e)?.layerOpacityChanged(r,this._context.isAsync)))}layerElevationInfoChanged(e,t){return this.updateGraphics3DGraphicElevationInfo(e,t,J)}slicePlaneEnabledChanged(e,t){return this._updateMaterialParameters((({material:e})=>{e.setParameters({hasSlicePlane:this._context.slicePlaneEnabled})})),e.forEach((e=>t(e)?.slicePlaneEnabledChanged(this._context.slicePlaneEnabled,this._context.isAsync))),!0}physicalBasedRenderingChanged(){const e=this._usePBR();return this._updateMaterialParameters((({material:t})=>t.setParameters({usePBR:e}))),!0}updateTransform(e,t,r,o){const a=this._context.renderCoordsHelper.spatialReference,s=Ee,{origin:n,transform:i}=r;switch(w(t,h(je,n.x,n.y,n.z??0),s,a),o){case q.EnableFastUpdates:this._fastUpdateProcessor.enable(e,this._materialInfoCache,this._context);break;case q.DisableFastUpdates:this._fastUpdateProcessor.disable(e,this._materialInfoCache,this._context);break;case q.UpdateFastLocalOrigin:e.updateFastLocalOrigin(s,i,this._context.localOriginFactory)}const{elevationContext:l}=e;l.centerPointInElevationSR=this._getCenterPointInElevationSR(s);const{elevationProvider:c,renderCoordsHelper:u}=this._context,m=(e,t)=>K(e,c,l,u,t);return e.alignedSampledElevation=Z(e,l,c.spatialReference,m,u,s),e.updateTransform(s,i,this._context.isAsync),!0}_requiresSymbolVertexColors(){return this._drivenProperties.color||this._drivenProperties.opacity}_colorOrTextureUid(t){return null==t?"-":t instanceof e?t.toHex():t.contentHash}_materialPropertiesDefault(e,t){const r=this._requiresSymbolVertexColors(),o=!!e.vertexAttributes.color,a=!!e.vertexAttributes.tangent;return{hasSymbolVertexColors:r,hasVertexColors:o,hasVertexTangents:a,uid:`vc:${o},vt:${a},vct${t},svc:${r}`}}_textureTransformUid(e){const{offset:t,scale:r,rotation:o}=e??Be;return`${t[0]},${t[1]},${o},${r[0]},${r[1]}`}_materialProperties(e,t,r){const o=this._materialPropertiesDefault(e,r);if(!t.material)return o;const{color:a,colorTexture:s,colorTextureTransform:n,normalTexture:i,normalTextureTransform:l,doubleSided:c,alphaCutoff:u,alphaMode:m}=t.material,h=this._colorOrTextureUid(a),f=this._colorOrTextureUid(s),p=this._textureTransformUid(n),d=this._colorOrTextureUid(i),g=this._textureTransformUid(l);if(o.color=a,o.colorTexture=s,o.normalTexture=i,o.uid=`${o.uid},cmuid:${h},ctmuid:${f},cttuid:${p},ntmuid:${d},nttuid:${g},ds:${c},ac:${u},am:${m}`,t.material instanceof F){const{metallic:e,roughness:r,metallicRoughnessTexture:a,metallicRoughnessTextureTransform:s,emissiveColor:i,emissiveTexture:c,emissiveTextureTransform:u,occlusionTexture:m,occlusionTextureTransform:h}=t.material,f=this._colorOrTextureUid(a),p=this._textureTransformUid(s),d=this._colorOrTextureUid(i),g=this._colorOrTextureUid(c),x=this._textureTransformUid(u),_=this._colorOrTextureUid(m),T=this._textureTransformUid(h);o.metallic=e,o.roughness=r,o.metallicRoughnessTexture=a,o.emissiveColor=i,o.emissiveTexture=c,o.occlusionTexture=m,o.colorTextureTransform=this._convertTextureTransform(n),o.normalTextureTransform=this._convertTextureTransform(l),o.emissiveTextureTransform=this._convertTextureTransform(u),o.occlusionTextureTransform=this._convertTextureTransform(h),o.metallicRoughnessTextureTransform=this._convertTextureTransform(s),o.uid=`${o.uid},mrm:${e},mrr:${r},mrt:${f},mrtt:${p},emuid:${d},etmuid:${g},ett:${x},otmuid:${_},ott:${T}`}return o}_convertTextureTransform(e){if(!e)return null;const{scale:r,offset:o,rotation:a}=e;return{scale:r,offset:o,rotation:t(a)}}_setInternalColorValueParameters(t,r){r.diffuse=e.toUnitRGB(t),r.opacity=t.a}_getLoadableTextureResource(e){return e.data??e.url}_getInternalTextureId(e){const t=this._getInternalTexture(e,le.Opaque);return t?.id}_getInternalTexture(e,t){const r=this._getLoadableTextureResource(e);if(!r)return null;const o=`${e.contentHash}/${t}`;let a=this._textures.get(o);if(!a){let s=null;const n=this._context.stage.renderView.renderingContext.parameters.maxMaxAnisotropy,i={wrap:this._castTextureWrap(e.wrap),noUnpackFlip:!0,maxAnisotropy:n,mipmap:n>1};z(r)?(s=r.data,i.preMultiplyAlpha=!1,i.encoding=r.encoding):(s=r,i.preMultiplyAlpha=t!==le.Opaque,i.downsampleUncompressed=this._context.graphicsCoreOwner.view.qualitySettings.graphics3D.uncompressedTextureDownsamplingEnabled),a=new fe(s,i),this._textures.set(o,a),a.load(this._context.stage.renderView.renderingContext),this._context.stage.add(a)}return a}_castTextureWrap(e="repeat"){if("string"==typeof e){const t=this._castTextureWrapIndividual(e);return{s:t,t}}return{s:this._castTextureWrapIndividual(e.horizontal),t:this._castTextureWrapIndividual(e.vertical)}}_castTextureWrapIndividual(e){switch(e){case"clamp":return ye.CLAMP_TO_EDGE;case"mirror":return ye.MIRRORED_REPEAT;default:return ye.REPEAT}}_setInternalMaterialParameters(t,r){if(null!=t.color&&this._setInternalColorValueParameters(t.color,r),null!=t.colorTexture){const e=this._getInternalTexture(t.colorTexture,r.textureAlphaMode);e?(r.textureId=e.id,r.textureAlphaPremultiplied=!!e.parameters.preMultiplyAlpha):r.textureId=void 0}t.normalTexture&&(r.normalTextureId=this._getInternalTextureId(t.normalTexture)),t.emissiveColor&&(r.emissiveFactor=e.toUnitRGB(t.emissiveColor)),t.emissiveTexture&&(r.emissiveTextureId=this._getInternalTextureId(t.emissiveTexture)),t.occlusionTexture&&(r.occlusionTextureId=this._getInternalTextureId(t.occlusionTexture)),t.metallicRoughnessTexture&&(r.metallicRoughnessTextureId=this._getInternalTextureId(t.metallicRoughnessTexture)),r.colorTextureTransformMatrix=Y(t.colorTextureTransform),r.normalTextureTransformMatrix=Y(t.normalTextureTransform),r.occlusionTextureTransformMatrix=Y(t.occlusionTextureTransform),r.emissiveTextureTransformMatrix=Y(t.emissiveTextureTransform),r.metallicRoughnessTextureTransformMatrix=Y(t.metallicRoughnessTextureTransform)}_setExternalMaterialParameters(t){const r=this._drivenProperties.color;let o=this.symbolLayer.material?.colorMixMode??null;if(r)t.externalColor=v;else{const r=this.symbolLayer.material?.color??null;r?t.externalColor=e.toUnitRGBA(r):(o=null,t.externalColor=v)}o&&(t.colorMixMode=o),t.castShadows=!!this.symbolLayer.castShadows}_hasTransparentVertexColors(e){const t=e.vertexAttributes.color;if(null==t)return!1;for(let r=3;r<t.length;r+=4)if(255!==t[r])return!0;return!1}_getOrCreateMaterial(t,r){const o=r.material?.color,a=r.material?.colorTexture,s=r.material?.alphaMode,n="blend"===s,i=!("opaque"===s)&&(this._hasTransparentVertexColors(t)||null!=o&&o.a<1||a?.transparent||n),l=this._materialProperties(t,r,i),c=this._materialInfoCache.byUid(l.uid);if(c)return c.material;const u={uid:l.uid,material:null,isComponentTransparent:i,alphaMode:r.material?r.material.alphaMode:"opaque"},m=xe({normalTexture:l.normalTexture,metallicRoughnessTexture:l.metallicRoughnessTexture,metallicFactor:l.metallic,roughnessFactor:l.roughness,emissiveTexture:l.emissiveTexture,emissiveFactor:e.toUnitRGB(l.emissiveColor),occlusionTexture:l.occlusionTexture}),h={usePBR:this._usePBR(),isSchematic:m,hasVertexColors:l.hasVertexColors,hasSymbolColors:l.hasSymbolVertexColors,hasVertexTangents:l.hasVertexTangents,ambient:T,diffuse:y,opacity:1,doubleSided:!0,doubleSidedType:"winding-order",cullFace:ce.None,layerOpacity:this._getLayerOpacity(),hasSlicePlane:this._context.slicePlaneEnabled,initTextureTransparent:!0};h.mrrFactors=m?[..._e]:[l.metallic,l.roughness,Te[2]],r.material&&(h.doubleSided=r.material.doubleSided,h.cullFace=r.material.doubleSided?ce.None:ce.Back,h.textureAlphaCutoff=r.material.alphaCutoff),this._setExternalMaterialParameters(h),this._setMaterialTransparentParameter(h,u),this._setInternalMaterialParameters(l,h);const f=new de(h);return u.material=f,this._materialInfoCache.set(l.uid,u),this._context.stage.add(f),f}_usePBR(){return this._context.physicalBasedRenderingEnabled}_setMaterialTransparentParameter(e,t){e.transparent=this.needsDrivenTransparentPass||t.isComponentTransparent||e.layerOpacity<1||e.opacity<1||e.externalColor&&e.externalColor[3]<1,"auto"===t.alphaMode?e.textureAlphaMode=e.transparent?le.MaskBlend:le.Opaque:e.textureAlphaMode="opaque"===t.alphaMode?le.Opaque:"mask"===t.alphaMode?le.Mask:le.Blend}_addDebugNormals(e,t){const r=t.length,o=e.spatialReference.isGeographic?20015077/180:1,a=.1*Math.max(e.extent.width*o,e.extent.height*o,e.extent.zmax-e.extent.zmin),s=[],n=[],i=[],l=[];for(let h=0;h<r;h++){const e=t[h],r=e.attributes.get(pe.POSITION),o=e.attributes.get(pe.NORMAL),c=r.data,u=r.indices,m=o.data,d=o.indices;for(let t=0;t<u.length;t++){const e=3*u[t],r=3*d[t];for(let t=0;t<3;t++)s.push(c[e+t]);for(let t=0;t<3;t++)s.push(c[e+t]+m[r+t]*a);if(n.push(n.length),n.push(n.length),t%3==0){this._calculateFaceNormal(c,u,t,Pe),this._getFaceVertices(c,u,t,je,Oe,Me),f(je,je,Oe),f(je,je,Me),p(je,je,1/3);for(let e=0;e<3;e++)i.push(je[e]);for(let e=0;e<3;e++)i.push(je[e]+Pe[e]*a);l.push(l.length),l.push(l.length)}}}const c=t[0].transformation,u=new me(this._debugVertexNormalMaterial,[[pe.POSITION,new ie(s,n,3,!0)]],null,ue.Line);t.push(u),u.transformation=c;const m=new me(this._debugFaceNormalMaterial,[[pe.POSITION,new ie(i,l,3,!0)]],null,ue.Line);m.transformation=c,t.push(m)}_createAs3DShape(e,t,r,o){const a=e.geometry;if("mesh"!==a.type)return null;const s=this._createGeometryInfo(a,t,o);if(null==s)return null;const{geometries:n,objectTransformation:i}=s;ne.DRAW_MESH_GEOMETRY_NORMALS&&this._addDebugNormals(a,n);const l=new he({geometries:n,layerUid:this._context.layer.uid,graphicUid:o});l.transformation=i;const c=oe(this.symbolLayer,{opacity:this._getLayerOpacity()}),u=c?new X(n[0].material,[c],{mergeGeometries:!0,hasSlicePlane:this._context.slicePlaneEnabled}):null,m=new Q(this,l,n,null,null,Z,r,u);this._fastUpdateProcessor.onAddGraphic(),m.needsElevationUpdates=J(r.mode),m.useObjectOriginAsAttachmentOrigin=!0,r.centerPointInElevationSR=this._getCenterPointInElevationSR(l.transformation);const{elevationProvider:h,renderCoordsHelper:f}=this._context,p=(e,t)=>K(e,h,r,f,t);return m.alignedSampledElevation=Z(m,r,h.spatialReference,p,f),m}_getCenterPointInElevationSR(e){const t=H(0,0,0,null!=this._context.elevationProvider.spatialReference?this._context.elevationProvider.spatialReference:null);return O([e[12],e[13],e[14]],this._context.renderCoordsHelper.spatialReference,t),t}_createComponentNormals(e,t,r,o){switch(r.shading||"flat"){default:case"source":return this._createComponentNormalsSource(e,t,r,o);case"flat":return this._createComponentNormalsFlat(e,o);case"smooth":return this._createComponentNormalsSmooth(e,o)}}_createComponentNormalsSource(e,t,r,o){if(null==t)return this._createComponentNormalsFlat(e,o);let a=!1;if(!r.trustSourceNormals)for(let s=0;s<o.length;s+=3){this._calculateFaceNormal(e,o,s,Pe);for(let e=0;e<3;e++){const r=3*o[s+e];je[0]=t[r],je[1]=t[r+1],je[2]=t[r+2],d(Pe,je)<0&&(t[r]=-t[r],t[r+1]=-t[r+1],t[r+2]=-t[r+2],a=!0)}}return new Ce(t,o,a)}_createComponentNormalsFlat(e,t){const r=E(t.length),o=new Array(3*t.length);for(let a=0;a<t.length;a+=3){const s=this._calculateFaceNormal(e,t,a,Pe);for(let e=0;e<3;e++)r[a+e]=s[e],o[a+e]=a/3}return new Ce(r,o,!1)}_createComponentNormalsSmooth(e,t){const r={};for(let s=0;s<t.length;s+=3){const o=this._calculateFaceNormal(e,t,s,Pe);for(let e=0;e<3;e++){const a=t[s+e];let n=r[a];n||(n={normal:b(),count:0},r[a]=n),f(n.normal,n.normal,o),n.count++}}const o=E(3*t.length),a=new Array(3*t.length);for(let s=0;s<t.length;s++){const e=r[t[s]];1!==e.count&&(g(e.normal,e.normal),e.count=1);for(let t=0;t<3;t++)o[3*s+t]=e.normal[t];a[s]=s}return new Ce(o,a,!1)}_getFaceVertices(e,t,r,o,a,s){const n=3*t[r],i=3*t[r+1],l=3*t[r+2];o[0]=e[n],o[1]=e[n+1],o[2]=e[n+2],a[0]=e[i],a[1]=e[i+1],a[2]=e[i+2],s[0]=e[l],s[1]=e[l+1],s[2]=e[l+2]}_calculateFaceNormal(e,t,r,o){return this._getFaceVertices(e,t,r,je,Oe,Me),x(Oe,Oe,je),x(Me,Me,je),_(je,Oe,Me),g(o,je),o}_getOrCreateComponents(e){return e.components??Ne}_createPositionBuffer(e,t){let r=e.vertexAttributes.position;const o=t.reprojection===Fe.ECEF?t.transformBeforeProject:null;if(o&&(r=U(new Float64Array(r.length),r,o)),t.reprojection===Fe.NONE)return t.needsBufferCopy?new Float64Array(r):r;const a=o?r:new Float64Array(r.length);return j(r,e.spatialReference,0,a,this._context.renderCoordsHelper.spatialReference,0,r.length/3),a}_createNormalBuffer(e,t,r){let o=e.vertexAttributes.normal;if(null==o)return null;const a=r.reprojection===Fe.ECEF?r.transformBeforeProject:null;a&&(o=G(o,new Float32Array(o.length),a));if("local"===this._context.graphicsCoreOwner.view.viewingMode||r.reprojection===Fe.NONE)return r.needsBufferCopy&&e.vertexAttributes.normal===o?new Float32Array(o):o;const s=e.vertexAttributes.position,n=a?o:new Float32Array(o.length);return V(o,s,t,e.spatialReference,n)}_createTangentBuffer(e,t,r){let o=e.vertexAttributes.tangent;if(null==o)return null;const a=r.reprojection===Fe.ECEF?r.transformBeforeProject:null;a&&(o=D(o,new Float32Array(o.length),a));if("local"===this._context.graphicsCoreOwner.view.viewingMode||r.reprojection===Fe.NONE)return r.needsBufferCopy&&e.vertexAttributes.normal===o?new Float32Array(o):o;const s=e.vertexAttributes.position,n=a?o:new Float32Array(o.length);return k(o,s,t,e.spatialReference,n)}_createColorBuffer(e){return e.vertexAttributes.color}_createSymbolColorBuffer(e){if(this._requiresSymbolVertexColors()){const t=this._getVertexOpacityAndColor(e),r=ae(this.symbolLayer?.material?.colorMixMode),o=new Uint8Array(4);return se(t,r,o),o}return null}_createBuffers(e,t){const r=e.vertexAttributes&&e.vertexAttributes.position;if(!r)return this.logger.warn("Mesh geometry must contain position vertex attributes"),null;const o=e.vertexAttributes.normal,a=e.vertexAttributes.uv,s=e.vertexAttributes.tangent;if(o&&o.length!==r.length)return this.logger.warn("Mesh normal vertex buffer must contain the same number of elements as the position buffer"),null;if(s&&s.length/4!=r.length/3)return this.logger.warn("Mesh tangent vertex buffer must contain the same number of elements as the position buffer"),null;if(a&&a.length/2!=r.length/3)return this.logger.warn("Mesh uv vertex buffer must contain the same number of elements as the position buffer"),null;const n=this._computeReprojectionInfo(e),i=this._createPositionBuffer(e,n),l=this._createColorBuffer(e),u=this._createSymbolColorBuffer(t),m=this._createNormalBuffer(e,i,n),h=this._createTangentBuffer(e,i,n);return{positionBuffer:i,normalBuffer:m,tangentBuffer:h,uvBuffer:a,colorBuffer:l,symbolColorBuffer:u,objectTransformation:n.reprojection===Fe.NONE&&n.objectTransformation?n.objectTransformation:this._transformOriginLocal(e,i,m,h),geometryTransformation:n.reprojection===Fe.NONE&&n.geometryTransformation?n.geometryTransformation:c()}}_computeReprojectionInfo(e){const{vertexSpace:t}=e,r=t.isRelative,o=t.isGeoreferenced?this._context.renderCoordsHelper.viewingMode===W.Local?Fe.NONE:Fe.ECEF:Fe.NONE;if(r){const{origin:r}=t,a=c(),i=e.transform?.localMatrix??u;if(o===Fe.NONE){w(e.spatialReference,r,a,this._context.renderCoordsHelper.spatialReference);return{reprojection:o,objectTransformation:a,geometryTransformation:m(i),needsBufferCopy:!1}}const l=s(c(),r);return n(l,l,i),{reprojection:o,transformBeforeProject:l,needsBufferCopy:!0}}return{reprojection:o,needsBufferCopy:!0}}_transformOriginLocal(e,t,a,s){const n=this._context.renderCoordsHelper.spatialReference,l=e.anchor;we[0]=l.x,we[1]=l.y,we[2]=l.z??0;const u=c();return w(e.spatialReference,we,u,n),i(Re,u),U(t,t,Re),(a||s)&&(r(Ae,u),o(Ae,Ae),a&&L(a,a,Ae),s&&L(s,s,Ae,4)),u}_validateFaces(e,t){const r=e.vertexAttributes.position.length/3,o=t.faces;if(o){let e=-1;for(let t=0;t<o.length;t++){const r=o[t];r>e&&(e=r)}if(r<=e)return this.logger.warn(`Vertex index ${e} is out of bounds of the mesh position buffer`),!1}else if(r%3!=0)return this.logger.warn("Mesh position buffer length must be a multiple of 9 if no component faces are defined (3 values per vertex * 3 vertices per triangle)"),!1;return!0}_getOrCreateFaces(e,t){return t.faces??I(e.vertexAttributes.position.length/3)}_isOutsideClippingArea(e){if(!this._context.clippingExtent)return!1;const t=e.vertexAttributes?.position;if(!t)return!1;const r=this._context.elevationProvider.spatialReference,o=$({positions:t,transform:e.transform,vertexSpace:e.vertexSpace,inSpatialReference:e.spatialReference,outSpatialReference:r??e.spatialReference}),a=o.length/3;return P(Ie),R(Ie,o,0,a),!A(Ie,this._context.clippingExtent)}_createGeometryInfo(e,t,r){if(!C(e.spatialReference,this._context.graphicsCoreOwner.view.spatialReference))return this.logger.warn("Geometry spatial reference is not compatible with the view"),null;if(this._isOutsideClippingArea(e))return null;const o=this._createBuffers(e,t);if(null==o)return null;const{positionBuffer:a,uvBuffer:s,colorBuffer:n,symbolColorBuffer:i,normalBuffer:c,tangentBuffer:u,objectTransformation:m,geometryTransformation:h}=o,f=this._getOrCreateComponents(e),p=new Array;let d=!1;const g=l(je,m),x=this._context.localOriginFactory.getOrigin(g);for(const l of f){if(!this._validateFaces(e,l))return null;const t=this._getOrCreateFaces(e,l);if(0===t.length)continue;const o=this._createComponentNormals(a,c,l,t);o.didFlipNormals&&(d=!0);const m=[[pe.POSITION,new ie(a,t,3,!0)],[pe.NORMAL,new ie(o.normals,o.indices,3,!0)]];n&&m.push([pe.COLOR,new ie(n,t,4,!0)]),i&&m.push([pe.SYMBOLCOLOR,new ie(i,N(t.length),4,!0)]),s&&m.push([pe.UV0,new ie(s,t,2,!0)]),u&&m.push([pe.TANGENT,new ie(u,t,4,!0)]);const f=this._context.stage.renderView.getObjectAndLayerIdColor({graphicUid:r,layerUid:this._context.layer.uid}),g=this._getOrCreateMaterial(e,l),_=new me(g,m,null,ue.Mesh,f);_.transformation=h,_.localOrigin=x,p.push(_)}return d&&this.logger.warn("Normals have been automatically flipped to be consistent with the counter clock wise face winding order. It is better to generate mesh geometries that have consistent normals."),{geometries:p,objectTransformation:m}}_updateMaterialParameters(e){this._materialInfoCache.forEachMaterialInfo(e),this._fastUpdateProcessor.forEachMaterialInfo(e),this._fastUpdateProcessor.forEachClonedMaterial(((e,t)=>{t.setParameters(e.parameters)}))}test(){return{...super.test(),materials:this._materialInfoCache.materials}}}class Ce{constructor(e,t,r){this.normals=e,this.indices=t,this.didFlipNormals=r}}const we=b(),je=b(),Oe=b(),Me=b(),Pe=b(),Re=c(),Ae=a(),Ee=c(),Ie=M(),Ne=[new B],Be=new S;var Fe;!function(e){e[e.NONE=0]="NONE",e[e.ECEF=1]="ECEF"}(Fe||(Fe={}));export{ve as Graphics3DMeshFillSymbolLayer};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- import{B as t,m as e,i as a,h as s,d as r}from"../../../../chunks/mat4.js";import{I as i,a as o}from"../../../../chunks/mat4f64.js";import{i as n}from"../../../../chunks/vec3.js";import{c as m}from"../../../../chunks/vec3f64.js";import{perObjectElevationAligner as f}from"./ElevationAligners.js";import{evaluateElevationInfoAtPoint as l}from"./elevationAlignmentUtils.js";import{setContextFeature as d}from"./featureExpressionInfoUtils.js";import{Graphics3DObject3DGraphicLayer as c}from"./Graphics3DObject3DGraphicLayer.js";class g extends c{constructor(){super(...arguments),this._originalGeometries=[],this._fastTransformUpdatesEnabled=!1}get fastTransformUpdatesEnabled(){return this._fastTransformUpdatesEnabled}enableFastTransformUpdates(e,a){if(this._fastTransformUpdatesEnabled)return;this._fastTransformUpdatesEnabled=!0;const{stageObject:s}=this,r=s.geometries.slice();s.removeAllGeometries();const i=t(h,s.transformation),o=a.getOrigin(i);for(const t of r){const a=e(t.material),r=t.instantiate({material:a});r.localOrigin=o,s.addGeometry(r)}this._originalGeometries=r}disableFastTransformUpdates(t){if(!this._fastTransformUpdatesEnabled)return;this._fastTransformUpdatesEnabled=!1;const{stageObject:e}=this,a=e.geometries.map((e=>t(e.material)));e.removeAllGeometries();for(let s=0;s<this._originalGeometries.length;s++){const t=this._originalGeometries[s],r=a[s];r.setParameters({modelTransformation:null}),r===t.material?e.addGeometry(t):e.addGeometry(t.instantiate({material:r}))}this._originalGeometries.length=0}updateFastLocalOrigin(e,a,s){if(!this._fastTransformUpdatesEnabled)return;const{stageObject:r}=this;if(0===r.geometries.length)return;const o=r.geometries[0].localOrigin,n=t(h,e),m=s.getOrigin(n);if(m===o)return;const f=a?.localMatrix??i;r.shaderTransformation=null,r.transformation=e,r.geometries.forEach((t=>{t.transformation=f,t.localOrigin=m}))}updateTransform(t,s,r){const{stageObject:o}=this,n=s?.localMatrix??i;if(!this._fastTransformUpdatesEnabled)return o.shaderTransformation=null,o.transformation=t,o.geometries.forEach((t=>{t.transformation=n})),void this.resetEdgeObject(r);const m=o.transformation,f=o.geometries[0].transformation,l=t,d=n,c=e(p,m,f),g=e(T,l,d),h=e(E,g,a(E,f));o.shaderTransformation=h,this._setFastMaterialTransformation({matA:c,matB:g}),this._fastUpdateEdgeTransform()||this.resetEdgeObject(r)}alignWithElevation(t,a,r,i){if(!this._fastTransformUpdatesEnabled)return void super.alignWithElevation(t,a,r,i);null!=r&&d(this.elevationContext.featureExpressionInfoContext,r);const o=(e,s)=>l(e,t,this.elevationContext,a,s),{stageObject:n}=this;if(!n.geometries[0].material.parameters.modelTransformation)return;const m=n.transformation,c=n.geometries[0].transformation,g=e(p,m,c),h=n.effectiveTransformation,E=s(u,h);this.alignedSampledElevation=f(this,this.elevationContext,t.spatialReference,o,a,E),n.shaderTransformation=E;const b=n.geometries[0].transformation,_=e(T,E,b);this._setFastMaterialTransformation({matA:g,matB:_}),this._fastUpdateEdgeTransform()||this.resetEdgeObject(i)}_setFastMaterialTransformation({matA:t,matB:s}){const{stageObject:i}=this;if(0===i.geometries.length)return;const o=i.geometries[0].localOrigin,m=r(j,n(h,o.vec3,-1)),f=e(b,m,t),l=e(_,m,s),d=a(b,f),c=e(_,l,d);for(const e of i.geometries)e.material.setParameters({modelTransformation:c})}_fastUpdateEdgeTransform(){return this._stageLayer.stage.renderer.ensureEdgeView().fastUpdateObject3DEdgesTransform(this.stageObject)}}const h=m(),p=o(),T=o(),u=o(),E=o(),b=o(),_=o(),j=o();export{g as Graphics3DMeshObject3DGraphicLayer};
5
+ import{B as t,m as e,i as a,h as s,d as r}from"../../../../chunks/mat4.js";import{I as i,a as o}from"../../../../chunks/mat4f64.js";import{i as n}from"../../../../chunks/vec3.js";import{c as m}from"../../../../chunks/vec3f64.js";import{perObjectElevationAligner as f}from"./ElevationAligners.js";import{evaluateElevationInfoAtPoint as l}from"./elevationAlignmentUtils.js";import{setContextFeature as d}from"./featureExpressionInfoUtils.js";import{Graphics3DObject3DGraphicLayer as c}from"./Graphics3DObject3DGraphicLayer.js";class g extends c{constructor(){super(...arguments),this._originalGeometries=[],this._fastTransformUpdatesEnabled=!1}get fastTransformUpdatesEnabled(){return this._fastTransformUpdatesEnabled}enableFastTransformUpdates(e,a){if(this._fastTransformUpdatesEnabled)return;this._fastTransformUpdatesEnabled=!0;const{stageObject:s}=this,r=s.geometries.slice();s.removeAllGeometries();const i=t(h,s.transformation),o=a.getOrigin(i);for(const t of r){const a=e(t.material),r=t.instantiate({material:a});r.localOrigin=o,s.addGeometry(r)}this._originalGeometries=r}disableFastTransformUpdates(t){if(!this._fastTransformUpdatesEnabled)return;this._fastTransformUpdatesEnabled=!1;const{stageObject:e}=this,a=e.geometries.map((e=>t(e.material)));e.removeAllGeometries();for(let s=0;s<this._originalGeometries.length;s++){const t=this._originalGeometries[s],r=a[s];r.setParameters({modelTransformation:null}),r===t.material?e.addGeometry(t):e.addGeometry(t.instantiate({material:r}))}this._originalGeometries.length=0}updateFastLocalOrigin(e,a,s){if(!this._fastTransformUpdatesEnabled)return;const{stageObject:r}=this;if(0===r.geometries.length)return;const o=r.geometries[0].localOrigin,n=t(h,e),m=s.getOrigin(n);if(m===o)return;const f=a?.localMatrix??i;r.shaderTransformation=null,r.transformation=e,r.geometries.forEach((t=>{t.transformation=f,t.localOrigin=m}))}updateTransform(t,s,r){const{stageObject:o}=this,n=s?.localMatrix??i;if(!this._fastTransformUpdatesEnabled)return o.shaderTransformation=null,o.transformation=t,o.geometries.forEach((t=>{t.transformation=n})),void(this._fastUpdateEdgeTransform()||this.resetEdgeObject(r));const m=o.transformation,f=o.geometries[0].transformation,l=t,d=n,c=e(p,m,f),g=e(T,l,d),h=e(E,g,a(E,f));o.shaderTransformation=h,this._setFastMaterialTransformation({matA:c,matB:g}),this._fastUpdateEdgeTransform()||this.resetEdgeObject(r)}alignWithElevation(t,a,r,i){if(!this._fastTransformUpdatesEnabled)return void super.alignWithElevation(t,a,r,i);null!=r&&d(this.elevationContext.featureExpressionInfoContext,r);const o=(e,s)=>l(e,t,this.elevationContext,a,s),{stageObject:n}=this;if(!n.geometries[0].material.parameters.modelTransformation)return;const m=n.transformation,c=n.geometries[0].transformation,g=e(p,m,c),h=n.effectiveTransformation,E=s(u,h);this.alignedSampledElevation=f(this,this.elevationContext,t.spatialReference,o,a,E),n.shaderTransformation=E;const b=n.geometries[0].transformation,_=e(T,E,b);this._setFastMaterialTransformation({matA:g,matB:_}),this._fastUpdateEdgeTransform()||this.resetEdgeObject(i)}_setFastMaterialTransformation({matA:t,matB:s}){const{stageObject:i}=this;if(0===i.geometries.length)return;const o=i.geometries[0].localOrigin,m=r(j,n(h,o.vec3,-1)),f=e(b,m,t),l=e(_,m,s),d=a(b,f),c=e(_,l,d);for(const e of i.geometries)e.material.setParameters({modelTransformation:c})}_fastUpdateEdgeTransform(){return this._stageLayer.stage.renderer.ensureEdgeView().fastUpdateObject3DEdgesTransform(this.stageObject)}}const h=m(),p=o(),T=o(),u=o(),E=o(),b=o(),_=o(),j=o();export{g as Graphics3DMeshObject3DGraphicLayer};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../chunks/tslib.es6.js";import r from"../../../../core/Accessor.js";import t from"../../../../core/Error.js";import{destroyMaybe as s}from"../../../../core/maybe.js";import{property as n}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 i from"../../../../geometry/Extent.js";import{fallbackObjectIDAttribute as a}from"../../../../layers/LayerConstants.js";import{QueryEngine as u}from"../../../../layers/graphics/data/QueryEngine.js";import y from"../../../../layers/support/FieldsIndex.js";import c from"../../../../rest/support/FeatureSet.js";import p from"../../../../rest/support/Query.js";const l=u;let d=class extends r{get spatialReference(){return this.layerView.view.spatialReference}get layer(){return this.layerView.i3slayer}get defaultQueryJSON(){return new p({outSpatialReference:this.spatialReference}).toJSON()}get _dataQueryEngine(){return this._ensureDataQueryEngine()}constructor(e){super(e)}initialize(){this.addHandles(this.layerView.on("visible-geometry-changed",(()=>this.spatialIndex.events.emit("changed"))))}destroy(){this._dataQueryEngineInstance=s(this._dataQueryEngineInstance),this._set("layerView",null)}async executeQueryForCount(e,r){return this._dataQueryEngine.executeQueryForCount(this._ensureQueryJSON(e),r)}async executeQueryForExtent(e,r){const{count:t,extent:s}=await this._dataQueryEngine.executeQueryForExtent(this._ensureQueryJSON(e),r);return{count:t,extent:i.fromJSON(s)}}async executeQueryForIds(e,r){return this._dataQueryEngine.executeQueryForIds(this._ensureQueryJSON(e),r)}async executeQuery(e,r){const s=this._ensureQueryJSON(e);if(s.returnGeometry)throw new t("feature-store:unsupported-query","returnGeometry is not yet supported for mesh scene layer queries");if(s.returnCentroid)throw new t("feature-store:unsupported-query","returnCentroid is not yet supported for mesh scene layer queries");const n=await this._dataQueryEngine.executeQuery(s,r),o=c.fromJSON(n);return o.features.forEach((e=>{e.geometry=null})),o}_ensureQueryJSON(e){return null==e?this.defaultQueryJSON:e.toJSON()}_ensureDataQueryEngine(){if(this._dataQueryEngineInstance)return this._dataQueryEngineInstance;const e=this.layer.objectIdField||a,r="esriGeometryPolygon",t=this.layer.fieldsIndex?.toJSON()||new y([]),s=this.layerView.view.resourceController.scheduler,n=this.spatialReference.toJSON(),o=this.priority,i=this.spatialIndex;return this._dataQueryEngineInstance=new l({hasZ:!0,hasM:!1,geometryType:r,fieldsIndex:t,timeInfo:null,spatialReference:n,objectIdField:e,featureStore:i,scheduler:s,priority:o}),this._dataQueryEngineInstance}};e([n({constructOnly:!0})],d.prototype,"layerView",void 0),e([n({constructOnly:!0})],d.prototype,"priority",void 0),e([n({constructOnly:!0})],d.prototype,"spatialIndex",void 0),e([n()],d.prototype,"spatialReference",null),e([n()],d.prototype,"layer",null),e([n()],d.prototype,"defaultQueryJSON",null),d=e([o("esri.views.3d.layers.i3s.I3SQueryEngine")],d);export{d as I3SQueryEngine};
5
+ import{_ as e}from"../../../../chunks/tslib.es6.js";import r from"../../../../core/Accessor.js";import t from"../../../../core/Error.js";import{destroyMaybe as s}from"../../../../core/maybe.js";import{property as n}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 i from"../../../../geometry/Extent.js";import{fallbackObjectIDAttribute as a}from"../../../../layers/LayerConstants.js";import{QueryEngine as u}from"../../../../layers/graphics/data/QueryEngine.js";import y from"../../../../layers/support/FieldsIndex.js";import c from"../../../../rest/support/FeatureSet.js";import p from"../../../../rest/support/Query.js";const l=u;let d=class extends r{get spatialReference(){return this.layerView.view.spatialReference}get layer(){return this.layerView.i3slayer}get defaultQueryJSON(){return new p({outSpatialReference:this.spatialReference}).toJSON()}get _dataQueryEngine(){return this._ensureDataQueryEngine()}constructor(e){super(e)}initialize(){this.addHandles(this.layerView.on("visible-geometry-changed",(()=>this.spatialIndex.events.emit("changed"))))}destroy(){this._dataQueryEngineInstance=s(this._dataQueryEngineInstance),this._set("layerView",null)}async executeQueryForCount(e,r){return this._dataQueryEngine.executeQueryForCount(this._ensureQueryJSON(e),r)}async executeQueryForExtent(e,r){const{count:t,extent:s}=await this._dataQueryEngine.executeQueryForExtent(this._ensureQueryJSON(e),r);return{count:t,extent:i.fromJSON(s)}}async executeQueryForIds(e,r){return this._dataQueryEngine.executeQueryForIds(this._ensureQueryJSON(e),r)}async executeQuery(e,r){const s=this._ensureQueryJSON(e);if(s.returnGeometry)throw new t("unsupported-query","returnGeometry is not yet supported for mesh scene layer queries");if(s.returnCentroid)throw new t("unsupported-query","returnCentroid is not yet supported for mesh scene layer queries");const n=await this._dataQueryEngine.executeQuery(s,r),o=c.fromJSON(n);return o.features.forEach((e=>{e.geometry=null})),o}_ensureQueryJSON(e){return null==e?this.defaultQueryJSON:e.toJSON()}_ensureDataQueryEngine(){if(this._dataQueryEngineInstance)return this._dataQueryEngineInstance;const e=this.layer.objectIdField||a,r="esriGeometryPolygon",t=this.layer.fieldsIndex?.toJSON()||new y([]),s=this.layerView.view.resourceController.scheduler,n=this.spatialReference.toJSON(),o=this.priority,i=this.spatialIndex;return this._dataQueryEngineInstance=new l({hasZ:!0,hasM:!1,geometryType:r,fieldsIndex:t,timeInfo:null,spatialReference:n,objectIdField:e,featureStore:i,scheduler:s,priority:o}),this._dataQueryEngineInstance}};e([n({constructOnly:!0})],d.prototype,"layerView",void 0),e([n({constructOnly:!0})],d.prototype,"priority",void 0),e([n({constructOnly:!0})],d.prototype,"spatialIndex",void 0),e([n()],d.prototype,"spatialReference",null),e([n()],d.prototype,"layer",null),e([n()],d.prototype,"defaultQueryJSON",null),d=e([o("esri.views.3d.layers.i3s.I3SQueryEngine")],d);export{d as I3SQueryEngine};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- import{resultOrAbort as e}from"../../../../core/asyncUtils.js";import{clone as t}from"../../../../core/lang.js";import{queryAllJSON as n}from"../../../../layers/support/featureQueryAll.js";const o={setAttribute(){},rollback(){},commit(){}};var r;function i(e,n){const i=n.attributes[e.objectIdField];if(null==i)return o;const s=e.sessions.get(i);if(s)return s;const l=t(n.attributes),a=new Set,u=e.i3sOverrides.createInteractiveEditSession(i),d=new Map,f=(e,t)=>{const n=d.get(e);if(null==n){const n=t.indexOf(i);return d.set(e,n),n}return n};let c=r.EDITING;const I={setAttribute(t,o){if(c!==r.EDITING)return;const i=e.fieldsIndex.get(t);if(!i)return;const s=e.attributeStorageInfo.findIndex((e=>e.name===i.name));if(s<0)return;if(!(t in l))throw new Error(`Attribute "${t}" is not an attribute of the edited feature.`);u.setAttribute(s,o);const d=e.attributeStorageInfo[s];let I=!1;a.add(t),e.forEachNode(((t,r)=>{const i=f(t,r);if(-1===i)return;const s=e.getAttributeData(t.index);if(s){const r=s[d.name];r&&(r[i]=o,e.setAttributeData(t.index,s,n),I=!0)}})),I&&e.clearMemCache()},rollback(){if(c===r.EDITING){for(const e of a)this.setAttribute(e,l[e]);u.remove(),c=r.ROLLED_BACK,e.sessions.delete(i)}},commit(){c===r.EDITING&&(u.remove(),c=r.COMMITTED,e.sessions.delete(i))}};return e.sessions.set(i,I),I}function s(e,t,n){const{gidToFeatureInfo:o,oidToFeatureInfo:r,fieldsIndex:i,objectIdField:s,globalIdField:l,featureOrIdentifierList:a}=n;if(!n.featuresResolved&&null!=a){for(const e of a){const t={feature:null,oid:-1,gid:null};if("attributes"in e){t.feature=e;const n=e.attributes;if(null!=n)for(const e in n){if(-1!==t.oid&&null!=t.gid)break;const o=i.normalizeFieldName(e);o===s&&(t.oid=n[e]??-1),o===l&&(t.gid=n[e])}}else t.oid=e.objectId??-1,t.gid=e.globalId;null!=t.gid&&o.set(t.gid,t),-1!==t.oid&&r.set(t.oid,t)}n.featuresResolved=!0}return(-1!==e?r.get(e):null)??(null!=t?o.get(t):null)}function l(e,t,n,o,r=!0){const i=[],l={gidToFeatureInfo:new Map,oidToFeatureInfo:new Map,featuresResolved:null==n,fieldsIndex:e.fieldsIndex,objectIdField:e.objectIdField,globalIdField:e.globalIdField,featureOrIdentifierList:n};for(const a of t){if(null!=a.error)continue;const e=a.objectId??-1,t=a.globalId,n=(-1===e||r?s(e,t,l):null)??{feature:null,oid:e,gid:t},u={oid:-1===e?n.oid:e,gid:t??n.gid,feature:n.feature,result:a};if(i.push(u),-1===u.oid&&null!=u.gid){let e=o.get(u.gid);null==e&&(e=[],o.set(u.gid,e)),e.push(u)}}return i}async function a(e,t){const n=new Map,o=l(e,t.addedFeatures,t.edits?.addFeatures,n),r=l(e,t.updatedFeatures,t.edits?.updateFeatures,n),i=l(e,t.deletedFeatures,t.edits?.deleteFeatures,n,!1);return n.size>0&&await u(e,n),{adds:o.filter((e=>-1!==e.oid)),updates:r.filter((e=>-1!==e.oid)),deletes:i.filter((e=>-1!==e.oid))}}async function u(t,o){const r=t.i3sOverrides.layer.associatedLayer;if(null==r?.globalIdField)return;const i=r.createQuery(),{objectIdField:s,globalIdField:l}=r;i.where=Array.from(o.keys()).map((e=>`${l}='${e}'`)).join(" OR "),i.returnGeometry=!1,i.outFields=[s,l],i.cacheHint=!1;const a=await e(n(r,i));if(!a.ok)return;const u=a.value.features;for(const e of u){const t=e.attributes[l],n=e.attributes[s];if(null==t||null==n||-1===n)continue;const r=o.get(t);if(null!=r)for(const e of r)e.oid=n}}function d(e,t){const n=new Map,o=t.adds,r=t.updates,i=t.deletes;if(o.length>0)for(const s of o){const e=s.oid,t=s.feature;"mesh"===t?.geometry?.type&&n.set(e,t.geometry)}if(r.length>0)for(const s of r){const e=s.oid,t=s.feature;"mesh"===t?.geometry?.type&&n.set(e,t.geometry)}if(i.length>0)for(const s of i)n.set(s.oid,null);for(const[s,l]of n)e.i3sOverrides.updateGeometry(s,l)}function f(e,t){const n=I(e,t),o=c(e,t);if(0===n.size&&0===o.size)return;const r=new Map;for(let c=0;c<e.attributeStorageInfo.length;c++)r.set(e.attributeStorageInfo[c].name,c);let i=!1;n.forEach(((t,n)=>{const o=e.getAttributeData(n);let s=!1;t.forEach(((t,n)=>{const l=null!=o?o[n]:null,a=r.get(n);for(const{featureIndex:o,value:r,featureId:u}of t)l&&(l[o]=r,s=!0,i=!0),e.i3sOverrides.updateAttributeValue(u,a,r)})),s&&e.setAttributeData(n,o,null)})),i&&e.clearMemCache();const{fieldsIndex:s,i3sOverrides:l,objectIdField:a,globalIdField:u}=e,d=l.layer.associatedLayer?.infoFor3D,f=new Set(d?[...Object.values(d.assetMapFieldRoles),...Object.values(d.transformFieldRoles)]:[]);for(const[c,I]of o){l.featureAdded(c);const{attributes:e}=I;for(const t in e){if(t!==a&&t!==u&&f.has(t))continue;const n=s.normalizeFieldName(t),o=null!=n?r.get(n):null;if(null==o)continue;const i=e[t];l.updateAttributeValue(c,o,i)}}}function c(e,t){const n=new Map,o=t.adds;if(!o||0===o.length||null==e.globalIdField)return n;for(const r of o){const e=r.oid,t=r.feature;"mesh"===t?.geometry?.type&&n.set(e,t)}return n}function I(e,t){const n=t.updates;if(!n||0===n.length)return new p;const o=new p,r=new Map;for(let i=0;i<e.attributeStorageInfo.length;i++)r.set(e.attributeStorageInfo[i].name,i);return e.forEachNode(((t,r)=>{for(const i of n){if(null==i.feature)continue;const n=i.feature,s=i.oid,l=r.indexOf(s);for(const r in n.attributes){const i=e.fieldsIndex.normalizeFieldName(r),a=g(o,t.index,i),u=n.attributes[r];a.push({featureIndex:l,featureId:s,value:u})}}})),o}function g(e,t,n){const o=b(e,t),r=null!=n&&o.get(n);if(r)return r;const i=new Array;return o.set(n,i),i}function b(e,t){const n=e.get(t);if(n)return n;const o=new m;return e.set(t,o),o}!function(e){e[e.EDITING=0]="EDITING",e[e.ROLLED_BACK=1]="ROLLED_BACK",e[e.COMMITTED=2]="COMMITTED"}(r||(r={}));const m=Map,p=Map;export{i as createInteractiveEditSession,a as normalizeEditResultsEvent,f as processAttributeEdits,d as processGeometryEdits};
5
+ import{resultOrAbort as e}from"../../../../core/asyncUtils.js";import{clone as t}from"../../../../core/lang.js";import{queryAllJSON as n}from"../../../../layers/support/featureQueryAll.js";const o={setAttribute(){},rollback(){},commit(){}};var r;function i(e,n){const i=n.attributes[e.objectIdField];if(null==i)return o;const s=e.sessions.get(i);if(s)return s;const l=t(n.attributes),u=new Set,a=e.i3sOverrides.createInteractiveEditSession(i),d=new Map,f=(e,t)=>{const n=d.get(e);if(null==n){const n=t.indexOf(i);return d.set(e,n),n}return n};let c=r.EDITING;const g={setAttribute(t,o){if(c!==r.EDITING)return;const i=e.fieldsIndex.get(t);if(!i)return;const s=e.attributeStorageInfo.findIndex((e=>e.name===i.name));if(s<0)return;if(!(t in l))throw new Error(`Attribute "${t}" is not an attribute of the edited feature.`);a.setAttribute(s,o);const d=e.attributeStorageInfo[s];let g=!1;u.add(t),e.forEachNode(((t,r)=>{const i=f(t,r);if(-1===i)return;const s=e.getAttributeData(t.index);if(s){const r=s[d.name];r&&(r[i]=o,e.setAttributeData(t.index,s,n),g=!0)}})),g&&e.clearMemCache()},rollback(){if(c===r.EDITING){for(const e of u)this.setAttribute(e,l[e]);a.remove(),c=r.ROLLED_BACK,e.sessions.delete(i)}},commit(){c===r.EDITING&&(a.remove(),c=r.COMMITTED,e.sessions.delete(i))}};return e.sessions.set(i,g),g}function s(e,t,n){const{gidToFeatureInfo:o,oidToFeatureInfo:r,fieldsIndex:i,objectIdField:s,globalIdField:l,featureOrIdentifierList:u}=n;if(!n.featuresResolved&&null!=u){for(const e of u){const t={feature:null,oid:-1,gid:null};if("attributes"in e){t.feature=e;const n=e.attributes;if(null!=n)for(const e in n){if(-1!==t.oid&&null!=t.gid)break;const o=i.normalizeFieldName(e);o===s&&(t.oid=n[e]??-1),o===l&&(t.gid=n[e])}}else t.oid=e.objectId??-1,t.gid=e.globalId;null!=t.gid&&o.set(t.gid,t),-1!==t.oid&&r.set(t.oid,t)}n.featuresResolved=!0}return(-1!==e?r.get(e):null)??(null!=t?o.get(t):null)}function l(e,t,n,o,r=null,i=!0){const l=[],u={gidToFeatureInfo:new Map,oidToFeatureInfo:new Map,featuresResolved:null==n,fieldsIndex:e.fieldsIndex,objectIdField:e.objectIdField,globalIdField:e.globalIdField,featureOrIdentifierList:n};for(const a of t){if(null!=a.error)continue;const e=a.objectId??-1,t=a.globalId,n=(-1===e||i?s(e,t,u):null)??{feature:null,oid:e,gid:t},d={oid:-1===e?n.oid:e,gid:t??n.gid,feature:n.feature,result:a};if(l.push(d),-1===d.oid&&null!=d.gid&&null!=r&&(d.oid=r.get(d.gid)??-1),-1===d.oid&&null!=d.gid){let e=o.get(d.gid);null==e&&(e=[],o.set(d.gid,e)),e.push(d)}}return l}async function u(e,t){const n=new Map,o=l(e,t.addedFeatures,t.edits?.addFeatures,n),r=l(e,t.updatedFeatures,t.edits?.updateFeatures,n),i=l(e,t.deletedFeatures,t.edits?.deleteFeatures,n,t.globalIdToObjectId,!1);return n.size>0&&await a(e,n),{adds:o.filter((e=>-1!==e.oid)),updates:r.filter((e=>-1!==e.oid)),deletes:i.filter((e=>-1!==e.oid))}}async function a(t,o){const r=t.i3sOverrides.layer.associatedLayer;if(null==r?.globalIdField)return;const i=r.createQuery(),{objectIdField:s,globalIdField:l}=r;i.where=Array.from(o.keys()).map((e=>`${l}='${e}'`)).join(" OR "),i.returnGeometry=!1,i.outFields=[s,l],i.cacheHint=!1;const u=await e(n(r,i));if(!u.ok)return;const a=u.value.features;for(const e of a){const t=e.attributes[l],n=e.attributes[s];if(null==t||null==n||-1===n)continue;const r=o.get(t);if(null!=r)for(const e of r)e.oid=n}}function d(e,t){const n=new Map,o=t.adds,r=t.updates,i=t.deletes;if(o.length>0)for(const s of o){const e=s.oid,t=s.feature;"mesh"===t?.geometry?.type&&n.set(e,t.geometry)}if(r.length>0)for(const s of r){const e=s.oid,t=s.feature;"mesh"===t?.geometry?.type&&n.set(e,t.geometry)}if(i.length>0)for(const s of i)n.set(s.oid,null);for(const[s,l]of n)e.i3sOverrides.updateGeometry(s,l)}function f(e,t){const n=g(e,t),o=c(e,t);if(0===n.size&&0===o.size)return;const r=new Map;for(let c=0;c<e.attributeStorageInfo.length;c++)r.set(e.attributeStorageInfo[c].name,c);let i=!1;n.forEach(((t,n)=>{const o=e.getAttributeData(n);let s=!1;t.forEach(((t,n)=>{const l=null!=o?o[n]:null,u=r.get(n);for(const{featureIndex:o,value:r,featureId:a}of t)l&&(l[o]=r,s=!0,i=!0),e.i3sOverrides.updateAttributeValue(a,u,r)})),s&&e.setAttributeData(n,o,null)})),i&&e.clearMemCache();const{fieldsIndex:s,i3sOverrides:l,objectIdField:u,globalIdField:a}=e,d=l.layer.associatedLayer?.infoFor3D,f=new Set(d?[...Object.values(d.assetMapFieldRoles),...Object.values(d.transformFieldRoles)]:[]);for(const[c,g]of o){l.featureAdded(c);const{attributes:e}=g;for(const t in e){if(t!==u&&t!==a&&f.has(t))continue;const n=s.normalizeFieldName(t),o=null!=n?r.get(n):null;if(null==o)continue;const i=e[t];l.updateAttributeValue(c,o,i)}}}function c(e,t){const n=new Map,o=t.adds;if(!o||0===o.length||null==e.globalIdField)return n;for(const r of o){const e=r.oid,t=r.feature;"mesh"===t?.geometry?.type&&n.set(e,t)}return n}function g(e,t){const n=t.updates;if(!n||0===n.length)return new p;const o=new p,r=new Map;for(let i=0;i<e.attributeStorageInfo.length;i++)r.set(e.attributeStorageInfo[i].name,i);return e.forEachNode(((t,r)=>{for(const i of n){if(null==i.feature)continue;const n=i.feature,s=i.oid,l=r.indexOf(s);for(const r in n.attributes){const i=e.fieldsIndex.normalizeFieldName(r),u=I(o,t.index,i),a=n.attributes[r];u.push({featureIndex:l,featureId:s,value:a})}}})),o}function I(e,t,n){const o=b(e,t),r=null!=n&&o.get(n);if(r)return r;const i=new Array;return o.set(n,i),i}function b(e,t){const n=e.get(t);if(n)return n;const o=new m;return e.set(t,o),o}!function(e){e[e.EDITING=0]="EDITING",e[e.ROLLED_BACK=1]="ROLLED_BACK",e[e.COMMITTED=2]="COMMITTED"}(r||(r={}));const m=Map,p=Map;export{i as createInteractiveEditSession,u as normalizeEditResultsEvent,f as processAttributeEdits,d as processGeometryEdits};