@arcgis/core 4.25.0-next.20220919 → 4.25.0-next.20220921

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 (604) hide show
  1. package/AggregateGraphic.js +1 -1
  2. package/assets/esri/core/workers/RemoteClient.js +1 -1
  3. package/assets/esri/core/workers/chunks/{9f31ab2247c9defb882c.js → 01ac91fc0bc6b4d4e3c6.js} +1 -1
  4. package/assets/esri/core/workers/chunks/{d26108352874af0b6762.js → 053564e659222e8f0efb.js} +1 -1
  5. package/assets/esri/core/workers/chunks/1c65fd714f637ac1ee8c.js +1 -0
  6. package/assets/esri/core/workers/chunks/{8588cbecb8e808f451fe.js → 249e32af1f2d433fae4c.js} +1 -1
  7. package/assets/esri/core/workers/chunks/{5b16b30ac3166f33e81e.js → 26690f4ec1f3cb8099c2.js} +1 -1
  8. package/assets/esri/core/workers/chunks/{be93b0cef85665446944.js → 274b4cdf6c8d77e8a2e6.js} +1 -1
  9. package/assets/esri/core/workers/chunks/{52dcfd6b8b1dfa864e44.js → 2cae0ec5f60ab42a49aa.js} +1 -1
  10. package/assets/esri/core/workers/chunks/43e4560d65e5ddeeef6f.js +1 -0
  11. package/assets/esri/core/workers/chunks/{f436c86f86236ea7ea04.js → 4641e10e0e8e9d257521.js} +1 -1
  12. package/assets/esri/core/workers/chunks/{7a45333de9ded92619c2.js → 466008f793c2e11e854c.js} +1 -1
  13. package/assets/esri/core/workers/chunks/{c9d655675552dcf6cef7.js → 4a699b41072ee88f0956.js} +1 -1
  14. package/assets/esri/core/workers/chunks/{14ea96e398f4842abe4e.js → 4fdd18f5cdaa0d82ebc1.js} +1 -1
  15. package/assets/esri/core/workers/chunks/{9662da3e1e37f3445186.js → 562b9619b8ee13734813.js} +1 -1
  16. package/assets/esri/core/workers/chunks/{5c1a5615c865c10209c2.js → 5880fa48bad79a7c93ab.js} +1 -1
  17. package/assets/esri/core/workers/chunks/58824250492b89ec24ea.js +1 -0
  18. package/assets/esri/core/workers/chunks/64a6b837f1d5d7ad7619.js +1 -0
  19. package/assets/esri/core/workers/chunks/{421241543afbc9a619ea.js → 64de93865088bbe0398f.js} +1 -1
  20. package/assets/esri/core/workers/chunks/{99d56a707039d645622c.js → 6a20d8740ec2a5b2c579.js} +1 -1
  21. package/assets/esri/core/workers/chunks/{8bab21bc6164a593278f.js → 771b92e524802de840ba.js} +1 -1
  22. package/assets/esri/core/workers/chunks/{dbb1bf97c85848bb8ce1.js → 7ce250cc6fbe68aef50d.js} +32 -32
  23. package/assets/esri/core/workers/chunks/{2c4938512dd726a177dd.js → 7fab18074b130b71a648.js} +1 -1
  24. package/assets/esri/core/workers/chunks/{f67357b3c6c591c9da5e.js → 872f1cb3596fb80e387f.js} +1 -1
  25. package/assets/esri/core/workers/chunks/{3ee81834b3217720cb48.js → 8874e69378a27d155f9d.js} +1 -1
  26. package/assets/esri/core/workers/chunks/{31de71018575457155e5.js → 8ee3da8677255b8c8709.js} +1 -1
  27. package/assets/esri/core/workers/chunks/{2e44aee22e70857b893c.js → 93631b10452b0e0189b3.js} +1 -1
  28. package/assets/esri/core/workers/chunks/{cb2dc84d972469445da6.js → 95cd9edca50ea163d50f.js} +1 -1
  29. package/assets/esri/core/workers/chunks/{d31bbb13af45ce8e45dc.js → acf9f753741b677afb44.js} +1 -1
  30. package/assets/esri/core/workers/chunks/{1455944edeba1560eb07.js → afdafa77f5ca1b9e3acc.js} +1 -1
  31. package/assets/esri/core/workers/chunks/{cf3e1ac63580bc495ea6.js → b4da35f1093f3731f9ac.js} +1 -1
  32. package/assets/esri/core/workers/chunks/{09f4296dcb80e3ae4b3d.js → b8eba8c9d5424a7ae5f2.js} +1 -1
  33. package/assets/esri/core/workers/chunks/bb0d86937faf0cd7d16d.js +1 -0
  34. package/assets/esri/core/workers/chunks/bf3e80023e156d5906c7.js +1 -0
  35. package/assets/esri/core/workers/chunks/{8ba83fee56dd4f306d87.js → c2a6ac7046134f725cf3.js} +1 -1
  36. package/assets/esri/core/workers/chunks/{5d3fabe66e1bce1b30fb.js → cc7569489b572b8b3b53.js} +1 -1
  37. package/assets/esri/core/workers/chunks/{fddd4ea487788e003fb1.js → d09f06eb4157a7c2c8ab.js} +1 -1
  38. package/assets/esri/core/workers/chunks/d1be3ab7846e3a555b6c.js +1 -0
  39. package/assets/esri/core/workers/chunks/e064035f959d68e9603f.js +1 -0
  40. package/assets/esri/core/workers/chunks/{d92975e56a1290255252.js → e09df62cf35d636b0975.js} +1 -1
  41. package/assets/esri/core/workers/chunks/{674fa5b93704ef08c9e8.js → e0c763e05feb1c2093ba.js} +1 -1
  42. package/assets/esri/core/workers/chunks/e20e99f8f76f5002437e.js +1 -0
  43. package/assets/esri/core/workers/chunks/{51289d2f5277af4023e9.js → ed33e019bc7775db2e50.js} +1 -1
  44. package/assets/esri/core/workers/chunks/ef95d6ab7b1c032ab4ad.js +1 -0
  45. package/assets/esri/core/workers/chunks/{48aa432e1bf60c68de14.js → f0c4b408a0b88adf6576.js} +1 -1
  46. package/assets/esri/core/workers/chunks/{169f4354a375db5de121.js → ffcbcb928b6cb8c596ad.js} +1 -1
  47. package/assets/esri/t9n/common_ar.json +1 -1
  48. package/assets/esri/t9n/common_bg.json +1 -1
  49. package/assets/esri/t9n/common_bs.json +1 -1
  50. package/assets/esri/t9n/common_ca.json +1 -1
  51. package/assets/esri/t9n/common_cs.json +1 -1
  52. package/assets/esri/t9n/common_da.json +1 -1
  53. package/assets/esri/t9n/common_de.json +1 -1
  54. package/assets/esri/t9n/common_el.json +1 -1
  55. package/assets/esri/t9n/common_es.json +1 -1
  56. package/assets/esri/t9n/common_et.json +1 -1
  57. package/assets/esri/t9n/common_fi.json +1 -1
  58. package/assets/esri/t9n/common_fr.json +1 -1
  59. package/assets/esri/t9n/common_he.json +1 -1
  60. package/assets/esri/t9n/common_hr.json +1 -1
  61. package/assets/esri/t9n/common_hu.json +1 -1
  62. package/assets/esri/t9n/common_id.json +1 -1
  63. package/assets/esri/t9n/common_it.json +1 -1
  64. package/assets/esri/t9n/common_ja.json +1 -1
  65. package/assets/esri/t9n/common_ko.json +1 -1
  66. package/assets/esri/t9n/common_lt.json +1 -1
  67. package/assets/esri/t9n/common_lv.json +1 -1
  68. package/assets/esri/t9n/common_nb.json +1 -1
  69. package/assets/esri/t9n/common_nl.json +1 -1
  70. package/assets/esri/t9n/common_pl.json +1 -1
  71. package/assets/esri/t9n/common_pt-BR.json +1 -1
  72. package/assets/esri/t9n/common_pt-PT.json +1 -1
  73. package/assets/esri/t9n/common_ro.json +1 -1
  74. package/assets/esri/t9n/common_ru.json +1 -1
  75. package/assets/esri/t9n/common_sk.json +1 -1
  76. package/assets/esri/t9n/common_sl.json +1 -1
  77. package/assets/esri/t9n/common_sr.json +1 -1
  78. package/assets/esri/t9n/common_sv.json +1 -1
  79. package/assets/esri/t9n/common_th.json +1 -1
  80. package/assets/esri/t9n/common_tr.json +1 -1
  81. package/assets/esri/t9n/common_uk.json +1 -1
  82. package/assets/esri/t9n/common_vi.json +1 -1
  83. package/assets/esri/t9n/common_zh-CN.json +1 -1
  84. package/assets/esri/t9n/common_zh-HK.json +1 -1
  85. package/assets/esri/t9n/common_zh-TW.json +1 -1
  86. package/assets/esri/themes/base/widgets/_Daylight.scss +1 -0
  87. package/assets/esri/themes/base/widgets/_Directions.scss +1 -2
  88. package/assets/esri/themes/dark/main.css +1 -1
  89. package/assets/esri/themes/light/main.css +1 -1
  90. package/assets/esri/themes/light/view.css +1 -1
  91. package/assets/esri/widgets/Feature/t9n/Feature_ar.json +1 -1
  92. package/assets/esri/widgets/Feature/t9n/Feature_bg.json +1 -1
  93. package/assets/esri/widgets/Feature/t9n/Feature_bs.json +1 -1
  94. package/assets/esri/widgets/Feature/t9n/Feature_ca.json +1 -1
  95. package/assets/esri/widgets/Feature/t9n/Feature_cs.json +1 -1
  96. package/assets/esri/widgets/Feature/t9n/Feature_da.json +1 -1
  97. package/assets/esri/widgets/Feature/t9n/Feature_de.json +1 -1
  98. package/assets/esri/widgets/Feature/t9n/Feature_el.json +1 -1
  99. package/assets/esri/widgets/Feature/t9n/Feature_es.json +1 -1
  100. package/assets/esri/widgets/Feature/t9n/Feature_et.json +1 -1
  101. package/assets/esri/widgets/Feature/t9n/Feature_fi.json +1 -1
  102. package/assets/esri/widgets/Feature/t9n/Feature_fr.json +1 -1
  103. package/assets/esri/widgets/Feature/t9n/Feature_he.json +1 -1
  104. package/assets/esri/widgets/Feature/t9n/Feature_hr.json +1 -1
  105. package/assets/esri/widgets/Feature/t9n/Feature_hu.json +1 -1
  106. package/assets/esri/widgets/Feature/t9n/Feature_id.json +1 -1
  107. package/assets/esri/widgets/Feature/t9n/Feature_it.json +1 -1
  108. package/assets/esri/widgets/Feature/t9n/Feature_ja.json +1 -1
  109. package/assets/esri/widgets/Feature/t9n/Feature_ko.json +1 -1
  110. package/assets/esri/widgets/Feature/t9n/Feature_lt.json +1 -1
  111. package/assets/esri/widgets/Feature/t9n/Feature_lv.json +1 -1
  112. package/assets/esri/widgets/Feature/t9n/Feature_nb.json +1 -1
  113. package/assets/esri/widgets/Feature/t9n/Feature_nl.json +1 -1
  114. package/assets/esri/widgets/Feature/t9n/Feature_pl.json +1 -1
  115. package/assets/esri/widgets/Feature/t9n/Feature_pt-BR.json +1 -1
  116. package/assets/esri/widgets/Feature/t9n/Feature_pt-PT.json +1 -1
  117. package/assets/esri/widgets/Feature/t9n/Feature_ro.json +1 -1
  118. package/assets/esri/widgets/Feature/t9n/Feature_ru.json +1 -1
  119. package/assets/esri/widgets/Feature/t9n/Feature_sk.json +1 -1
  120. package/assets/esri/widgets/Feature/t9n/Feature_sl.json +1 -1
  121. package/assets/esri/widgets/Feature/t9n/Feature_sr.json +1 -1
  122. package/assets/esri/widgets/Feature/t9n/Feature_sv.json +1 -1
  123. package/assets/esri/widgets/Feature/t9n/Feature_th.json +1 -1
  124. package/assets/esri/widgets/Feature/t9n/Feature_tr.json +1 -1
  125. package/assets/esri/widgets/Feature/t9n/Feature_uk.json +1 -1
  126. package/assets/esri/widgets/Feature/t9n/Feature_vi.json +1 -1
  127. package/assets/esri/widgets/Feature/t9n/Feature_zh-CN.json +1 -1
  128. package/assets/esri/widgets/Feature/t9n/Feature_zh-HK.json +1 -1
  129. package/assets/esri/widgets/Feature/t9n/Feature_zh-TW.json +1 -1
  130. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ar.json +1 -1
  131. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_bg.json +1 -1
  132. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_bs.json +1 -1
  133. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ca.json +1 -1
  134. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_cs.json +1 -1
  135. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_da.json +1 -1
  136. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_de.json +1 -1
  137. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_el.json +1 -1
  138. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_es.json +1 -1
  139. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_et.json +1 -1
  140. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_fi.json +1 -1
  141. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_fr.json +1 -1
  142. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_he.json +1 -1
  143. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_hr.json +1 -1
  144. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_hu.json +1 -1
  145. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_id.json +1 -1
  146. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_it.json +1 -1
  147. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ja.json +1 -1
  148. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ko.json +1 -1
  149. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_lt.json +1 -1
  150. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_lv.json +1 -1
  151. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_nb.json +1 -1
  152. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_nl.json +1 -1
  153. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_pl.json +1 -1
  154. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_pt-BR.json +1 -1
  155. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_pt-PT.json +1 -1
  156. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ro.json +1 -1
  157. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ru.json +1 -1
  158. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sk.json +1 -1
  159. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sl.json +1 -1
  160. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sr.json +1 -1
  161. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sv.json +1 -1
  162. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_th.json +1 -1
  163. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_tr.json +1 -1
  164. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_uk.json +1 -1
  165. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_vi.json +1 -1
  166. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_zh-CN.json +1 -1
  167. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_zh-HK.json +1 -1
  168. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_zh-TW.json +1 -1
  169. package/assets/esri/widgets/Popup/t9n/Popup_ar.json +1 -1
  170. package/assets/esri/widgets/Popup/t9n/Popup_bg.json +1 -1
  171. package/assets/esri/widgets/Popup/t9n/Popup_bs.json +1 -1
  172. package/assets/esri/widgets/Popup/t9n/Popup_ca.json +1 -1
  173. package/assets/esri/widgets/Popup/t9n/Popup_cs.json +1 -1
  174. package/assets/esri/widgets/Popup/t9n/Popup_da.json +1 -1
  175. package/assets/esri/widgets/Popup/t9n/Popup_de.json +1 -1
  176. package/assets/esri/widgets/Popup/t9n/Popup_el.json +1 -1
  177. package/assets/esri/widgets/Popup/t9n/Popup_es.json +1 -1
  178. package/assets/esri/widgets/Popup/t9n/Popup_et.json +1 -1
  179. package/assets/esri/widgets/Popup/t9n/Popup_fi.json +1 -1
  180. package/assets/esri/widgets/Popup/t9n/Popup_fr.json +1 -1
  181. package/assets/esri/widgets/Popup/t9n/Popup_he.json +1 -1
  182. package/assets/esri/widgets/Popup/t9n/Popup_hr.json +1 -1
  183. package/assets/esri/widgets/Popup/t9n/Popup_hu.json +1 -1
  184. package/assets/esri/widgets/Popup/t9n/Popup_id.json +1 -1
  185. package/assets/esri/widgets/Popup/t9n/Popup_it.json +1 -1
  186. package/assets/esri/widgets/Popup/t9n/Popup_ja.json +1 -1
  187. package/assets/esri/widgets/Popup/t9n/Popup_ko.json +1 -1
  188. package/assets/esri/widgets/Popup/t9n/Popup_lt.json +1 -1
  189. package/assets/esri/widgets/Popup/t9n/Popup_lv.json +1 -1
  190. package/assets/esri/widgets/Popup/t9n/Popup_nb.json +1 -1
  191. package/assets/esri/widgets/Popup/t9n/Popup_nl.json +1 -1
  192. package/assets/esri/widgets/Popup/t9n/Popup_pl.json +1 -1
  193. package/assets/esri/widgets/Popup/t9n/Popup_pt-BR.json +1 -1
  194. package/assets/esri/widgets/Popup/t9n/Popup_pt-PT.json +1 -1
  195. package/assets/esri/widgets/Popup/t9n/Popup_ro.json +1 -1
  196. package/assets/esri/widgets/Popup/t9n/Popup_ru.json +1 -1
  197. package/assets/esri/widgets/Popup/t9n/Popup_sk.json +1 -1
  198. package/assets/esri/widgets/Popup/t9n/Popup_sl.json +1 -1
  199. package/assets/esri/widgets/Popup/t9n/Popup_sr.json +1 -1
  200. package/assets/esri/widgets/Popup/t9n/Popup_sv.json +1 -1
  201. package/assets/esri/widgets/Popup/t9n/Popup_th.json +1 -1
  202. package/assets/esri/widgets/Popup/t9n/Popup_tr.json +1 -1
  203. package/assets/esri/widgets/Popup/t9n/Popup_uk.json +1 -1
  204. package/assets/esri/widgets/Popup/t9n/Popup_vi.json +1 -1
  205. package/assets/esri/widgets/Popup/t9n/Popup_zh-CN.json +1 -1
  206. package/assets/esri/widgets/Popup/t9n/Popup_zh-HK.json +1 -1
  207. package/assets/esri/widgets/Popup/t9n/Popup_zh-TW.json +1 -1
  208. package/assets/esri/widgets/support/t9n/DatePicker_ar.json +1 -1
  209. package/assets/esri/widgets/support/t9n/DatePicker_bg.json +1 -1
  210. package/assets/esri/widgets/support/t9n/DatePicker_bs.json +1 -1
  211. package/assets/esri/widgets/support/t9n/DatePicker_ca.json +1 -1
  212. package/assets/esri/widgets/support/t9n/DatePicker_cs.json +1 -1
  213. package/assets/esri/widgets/support/t9n/DatePicker_da.json +1 -1
  214. package/assets/esri/widgets/support/t9n/DatePicker_de.json +1 -1
  215. package/assets/esri/widgets/support/t9n/DatePicker_el.json +1 -1
  216. package/assets/esri/widgets/support/t9n/DatePicker_es.json +1 -1
  217. package/assets/esri/widgets/support/t9n/DatePicker_et.json +1 -1
  218. package/assets/esri/widgets/support/t9n/DatePicker_fi.json +1 -1
  219. package/assets/esri/widgets/support/t9n/DatePicker_fr.json +1 -1
  220. package/assets/esri/widgets/support/t9n/DatePicker_he.json +1 -1
  221. package/assets/esri/widgets/support/t9n/DatePicker_hr.json +1 -1
  222. package/assets/esri/widgets/support/t9n/DatePicker_hu.json +1 -1
  223. package/assets/esri/widgets/support/t9n/DatePicker_id.json +1 -1
  224. package/assets/esri/widgets/support/t9n/DatePicker_it.json +1 -1
  225. package/assets/esri/widgets/support/t9n/DatePicker_ja.json +1 -1
  226. package/assets/esri/widgets/support/t9n/DatePicker_ko.json +1 -1
  227. package/assets/esri/widgets/support/t9n/DatePicker_lt.json +1 -1
  228. package/assets/esri/widgets/support/t9n/DatePicker_lv.json +1 -1
  229. package/assets/esri/widgets/support/t9n/DatePicker_nb.json +1 -1
  230. package/assets/esri/widgets/support/t9n/DatePicker_nl.json +1 -1
  231. package/assets/esri/widgets/support/t9n/DatePicker_pl.json +1 -1
  232. package/assets/esri/widgets/support/t9n/DatePicker_pt-BR.json +1 -1
  233. package/assets/esri/widgets/support/t9n/DatePicker_pt-PT.json +1 -1
  234. package/assets/esri/widgets/support/t9n/DatePicker_ro.json +1 -1
  235. package/assets/esri/widgets/support/t9n/DatePicker_ru.json +1 -1
  236. package/assets/esri/widgets/support/t9n/DatePicker_sk.json +1 -1
  237. package/assets/esri/widgets/support/t9n/DatePicker_sl.json +1 -1
  238. package/assets/esri/widgets/support/t9n/DatePicker_sr.json +1 -1
  239. package/assets/esri/widgets/support/t9n/DatePicker_sv.json +1 -1
  240. package/assets/esri/widgets/support/t9n/DatePicker_th.json +1 -1
  241. package/assets/esri/widgets/support/t9n/DatePicker_tr.json +1 -1
  242. package/assets/esri/widgets/support/t9n/DatePicker_uk.json +1 -1
  243. package/assets/esri/widgets/support/t9n/DatePicker_vi.json +1 -1
  244. package/assets/esri/widgets/support/t9n/DatePicker_zh-CN.json +1 -1
  245. package/assets/esri/widgets/support/t9n/DatePicker_zh-HK.json +1 -1
  246. package/assets/esri/widgets/support/t9n/DatePicker_zh-TW.json +1 -1
  247. package/assets/esri/widgets/support/t9n/TimePicker_ar.json +1 -1
  248. package/assets/esri/widgets/support/t9n/TimePicker_bg.json +1 -1
  249. package/assets/esri/widgets/support/t9n/TimePicker_bs.json +1 -1
  250. package/assets/esri/widgets/support/t9n/TimePicker_ca.json +1 -1
  251. package/assets/esri/widgets/support/t9n/TimePicker_cs.json +1 -1
  252. package/assets/esri/widgets/support/t9n/TimePicker_da.json +1 -1
  253. package/assets/esri/widgets/support/t9n/TimePicker_de.json +1 -1
  254. package/assets/esri/widgets/support/t9n/TimePicker_el.json +1 -1
  255. package/assets/esri/widgets/support/t9n/TimePicker_es.json +1 -1
  256. package/assets/esri/widgets/support/t9n/TimePicker_et.json +1 -1
  257. package/assets/esri/widgets/support/t9n/TimePicker_fi.json +1 -1
  258. package/assets/esri/widgets/support/t9n/TimePicker_fr.json +1 -1
  259. package/assets/esri/widgets/support/t9n/TimePicker_he.json +1 -1
  260. package/assets/esri/widgets/support/t9n/TimePicker_hr.json +1 -1
  261. package/assets/esri/widgets/support/t9n/TimePicker_hu.json +1 -1
  262. package/assets/esri/widgets/support/t9n/TimePicker_id.json +1 -1
  263. package/assets/esri/widgets/support/t9n/TimePicker_it.json +1 -1
  264. package/assets/esri/widgets/support/t9n/TimePicker_ja.json +1 -1
  265. package/assets/esri/widgets/support/t9n/TimePicker_ko.json +1 -1
  266. package/assets/esri/widgets/support/t9n/TimePicker_lt.json +1 -1
  267. package/assets/esri/widgets/support/t9n/TimePicker_lv.json +1 -1
  268. package/assets/esri/widgets/support/t9n/TimePicker_nb.json +1 -1
  269. package/assets/esri/widgets/support/t9n/TimePicker_nl.json +1 -1
  270. package/assets/esri/widgets/support/t9n/TimePicker_pl.json +1 -1
  271. package/assets/esri/widgets/support/t9n/TimePicker_pt-BR.json +1 -1
  272. package/assets/esri/widgets/support/t9n/TimePicker_pt-PT.json +1 -1
  273. package/assets/esri/widgets/support/t9n/TimePicker_ro.json +1 -1
  274. package/assets/esri/widgets/support/t9n/TimePicker_ru.json +1 -1
  275. package/assets/esri/widgets/support/t9n/TimePicker_sk.json +1 -1
  276. package/assets/esri/widgets/support/t9n/TimePicker_sl.json +1 -1
  277. package/assets/esri/widgets/support/t9n/TimePicker_sr.json +1 -1
  278. package/assets/esri/widgets/support/t9n/TimePicker_sv.json +1 -1
  279. package/assets/esri/widgets/support/t9n/TimePicker_th.json +1 -1
  280. package/assets/esri/widgets/support/t9n/TimePicker_tr.json +1 -1
  281. package/assets/esri/widgets/support/t9n/TimePicker_uk.json +1 -1
  282. package/assets/esri/widgets/support/t9n/TimePicker_vi.json +1 -1
  283. package/assets/esri/widgets/support/t9n/TimePicker_zh-CN.json +1 -1
  284. package/assets/esri/widgets/support/t9n/TimePicker_zh-HK.json +1 -1
  285. package/assets/esri/widgets/support/t9n/TimePicker_zh-TW.json +1 -1
  286. package/chunks/CheckerBoard.glsl.js +3 -3
  287. package/chunks/ColorMaterial.glsl.js +5 -5
  288. package/chunks/ComponentShader.glsl.js +1 -1
  289. package/chunks/Compositing.glsl.js +4 -19
  290. package/chunks/DefaultMaterial.glsl.js +2 -2
  291. package/chunks/HUDCompositing.glsl.js +7 -0
  292. package/chunks/HeatmapDensity.glsl.js +4 -4
  293. package/chunks/ImageMaterial.glsl.js +1 -1
  294. package/chunks/Laserlines.glsl.js +5 -5
  295. package/chunks/LineMarker.glsl.js +1 -1
  296. package/chunks/MeasurementArrow.glsl.js +3 -3
  297. package/chunks/NativeLine.glsl.js +1 -1
  298. package/chunks/OITCompositing.glsl.js +13 -0
  299. package/chunks/OverlayCompositing.glsl.js +8 -0
  300. package/chunks/Path.glsl.js +3 -3
  301. package/chunks/Pattern.glsl.js +1 -1
  302. package/chunks/Precipitation.glsl.js +3 -3
  303. package/chunks/RealisticTree.glsl.js +2 -2
  304. package/chunks/RibbonLine.glsl.js +25 -25
  305. package/chunks/ShadedColorMaterial.glsl.js +1 -1
  306. package/chunks/ShadowHighlight.glsl.js +1 -1
  307. package/chunks/SlicePlaneMaterial.glsl.js +2 -2
  308. package/chunks/Terrain.glsl.js +4 -4
  309. package/chunks/WaterSurface.glsl.js +1 -1
  310. package/chunks/ar.js +1 -1
  311. package/chunks/bg_BG.js +1 -1
  312. package/chunks/boundedPlane.js +1 -1
  313. package/chunks/bs_BA.js +1 -1
  314. package/chunks/ca_ES.js +1 -1
  315. package/chunks/cameraUtilsPlanar.js +1 -1
  316. package/chunks/cameraUtilsSpherical.js +1 -1
  317. package/chunks/cs_CZ.js +1 -1
  318. package/chunks/da_DK.js +1 -1
  319. package/chunks/de_CH.js +1 -1
  320. package/chunks/de_DE.js +1 -1
  321. package/chunks/el_GR.js +1 -1
  322. package/chunks/en_CA.js +1 -1
  323. package/chunks/en_US.js +1 -1
  324. package/chunks/es_ES.js +1 -1
  325. package/chunks/et_EE.js +1 -1
  326. package/chunks/fi_FI.js +1 -1
  327. package/chunks/fr_FR.js +1 -1
  328. package/chunks/he_IL.js +1 -1
  329. package/chunks/hr_HR.js +1 -1
  330. package/chunks/hu_HU.js +1 -1
  331. package/chunks/id_ID.js +1 -1
  332. package/chunks/index.js +1 -1
  333. package/chunks/it_IT.js +1 -1
  334. package/chunks/ja_JP.js +1 -1
  335. package/chunks/ko_KR.js +1 -1
  336. package/chunks/lt_LT.js +1 -1
  337. package/chunks/lv_LV.js +1 -1
  338. package/chunks/mat3.js +1 -1
  339. package/chunks/nb_NO.js +1 -1
  340. package/chunks/nl_NL.js +1 -1
  341. package/chunks/pl_PL.js +1 -1
  342. package/chunks/pt_BR.js +1 -1
  343. package/chunks/pt_PT.js +1 -1
  344. package/chunks/quat.js +1 -1
  345. package/chunks/quat2.js +1 -1
  346. package/chunks/quatf64.js +1 -1
  347. package/chunks/ro_RO.js +1 -1
  348. package/chunks/ru_RU.js +1 -1
  349. package/chunks/sk_SK.js +1 -1
  350. package/chunks/sl_SL.js +1 -1
  351. package/chunks/sphere.js +1 -1
  352. package/chunks/sr_RS.js +1 -1
  353. package/chunks/sv_SE.js +1 -1
  354. package/chunks/th_TH.js +1 -1
  355. package/chunks/tr_TR.js +1 -1
  356. package/chunks/uk_UA.js +1 -1
  357. package/chunks/vec3.js +1 -1
  358. package/chunks/vec3f32.js +1 -1
  359. package/chunks/vec4f64.js +1 -1
  360. package/chunks/vi_VN.js +1 -1
  361. package/chunks/zh_Hans.js +1 -1
  362. package/chunks/zh_Hant.js +1 -1
  363. package/core/VectorStack.js +1 -1
  364. package/core/libs/gl-matrix-2/factories/quatf64.js +1 -1
  365. package/core/libs/gl-matrix-2/factories/vec3f32.js +1 -1
  366. package/core/libs/gl-matrix-2/factories/vec4f64.js +1 -1
  367. package/core/libs/gl-matrix-2/math/mat3.js +1 -1
  368. package/core/libs/gl-matrix-2/math/quat.js +1 -1
  369. package/core/libs/gl-matrix-2/math/vec3.js +1 -1
  370. package/core/perspectiveUtils.js +1 -1
  371. package/core/workers/workerFactory.js +1 -1
  372. package/geohash/GeohashTree.js +1 -1
  373. package/geometry/support/MeshTransform.js +1 -1
  374. package/geometry/support/axisAngle.js +1 -1
  375. package/geometry/support/axisAngleDegrees.js +1 -1
  376. package/geometry/support/lineSegment.js +1 -1
  377. package/geometry/support/meshUtils/exporters/gltf/gltf.js +1 -1
  378. package/geometry/support/meshUtils/exporters/gltf/node.js +1 -1
  379. package/geometry/support/meshUtils/georeference.js +1 -1
  380. package/geometry/support/meshUtils/loadGLTFMesh.js +1 -1
  381. package/geometry/support/meshUtils/projection.js +1 -1
  382. package/geometry/support/meshUtils/rotate.js +1 -1
  383. package/geometry/support/plane.js +1 -1
  384. package/interfaces.d.ts +70 -0
  385. package/layers/VoxelWasmPerSceneView.js +1 -1
  386. package/layers/buildingSublayers/BuildingComponentSublayer.js +1 -1
  387. package/layers/graphics/featureConversionUtils.js +1 -1
  388. package/layers/mixins/EditBusLayer.js +1 -1
  389. package/layers/mixins/OperationalLayer.js +1 -1
  390. package/layers/support/AggregateField.js +1 -1
  391. package/layers/support/ControlPointsGeoreference.js +1 -1
  392. package/layers/support/ExportImageServiceParameters.js +1 -1
  393. package/layers/support/OutStatistic.js +1 -1
  394. package/layers/support/VoxelVolume.js +1 -1
  395. package/layers/support/voxelPlaneUtils.js +1 -1
  396. package/package.json +1 -1
  397. package/rest/support/AggregateFeatureSet.js +5 -0
  398. package/support/revision.js +1 -1
  399. package/views/2d/ViewState.js +1 -1
  400. package/views/2d/engine/flow/FlowDisplayObject.js +1 -1
  401. package/views/2d/engine/imagery/RasterVFTile.js +1 -1
  402. package/views/2d/engine/vectorTiles/VectorTile.js +1 -1
  403. package/views/2d/engine/webgl/OverlayContainer.js +1 -1
  404. package/views/2d/engine/webgl/TiledDisplayObject.js +1 -1
  405. package/views/2d/engine/webgl/WGLTile.js +1 -1
  406. package/views/2d/engine/webgl/WorldExtentClipRenderer.js +1 -1
  407. package/views/2d/layers/FeatureLayerView2D.js +1 -1
  408. package/views/2d/layers/ImageryLayerView2D.js +1 -1
  409. package/views/2d/layers/LayerView2D.js +1 -1
  410. package/views/2d/layers/features/controllers/FeatureController2D.js +1 -1
  411. package/views/2d/layers/features/schemaUtils.js +1 -1
  412. package/views/2d/layers/features/support/BinStore.js +1 -1
  413. package/views/2d/layers/features/support/ClusterStore.js +1 -1
  414. package/views/2d/layers/graphics/GraphicBoundsRenderer.js +1 -1
  415. package/views/2d/layers/imagery/ImageryView2D.js +1 -1
  416. package/views/2d/layers/support/DebugOverlay.js +1 -1
  417. package/views/2d/layers/support/ExportStrategy.js +1 -1
  418. package/views/2d/layers/support/FeatureLayerProxy.js +1 -1
  419. package/views/2d/layers/support/clusterUtils.js +1 -1
  420. package/views/3d/analysis/AreaMeasurement/support/MeasurementData.js +1 -1
  421. package/views/3d/analysis/Dimensioning/DimensioningTool.js +1 -1
  422. package/views/3d/analysis/Dimensioning/LengthDimensionComputation.js +1 -1
  423. package/views/3d/analysis/Dimensioning/LengthDimensionSubTool.js +1 -1
  424. package/views/3d/analysis/Dimensioning/LengthDimensionVisualization.js +1 -1
  425. package/views/3d/analysis/Dimensioning/lengthDimensionUtils.js +1 -1
  426. package/views/3d/analysis/LineOfSight/LineOfSightController.js +1 -1
  427. package/views/3d/analysis/Slice/SliceTool.js +1 -1
  428. package/views/3d/analysis/Slice/sliceToolConfig.js +1 -1
  429. package/views/3d/analysis/Slice/sliceToolUtils.js +1 -1
  430. package/views/3d/camera/constraintUtils/distance.js +1 -1
  431. package/views/3d/camera/constraintUtils/tilt.js +1 -1
  432. package/views/3d/environment/CloudsComposition.js +1 -1
  433. package/views/3d/environment/CloudsCompositionParameters.js +1 -1
  434. package/views/3d/environment/CloudsGenerator.js +1 -1
  435. package/views/3d/environment/CloudsPresets.js +1 -1
  436. package/views/3d/environment/EnvironmentRenderer.js +1 -1
  437. package/views/3d/environment/Fog.js +1 -1
  438. package/views/3d/environment/PanoramicAtmosphere.js +1 -1
  439. package/views/3d/environment/Precipitation.js +1 -1
  440. package/views/3d/environment/SceneViewEnvironmentManager.js +1 -1
  441. package/views/3d/environment/SimpleAtmosphere.js +1 -1
  442. package/views/3d/environment/weatherUtils.js +1 -1
  443. package/views/3d/externalRenderers/ExternalRendererStore.js +1 -1
  444. package/views/3d/externalRenderers/RenderContext.js +1 -1
  445. package/views/3d/glTF/internal/Resource.js +1 -1
  446. package/views/3d/interactive/Manipulator3D.js +1 -1
  447. package/views/3d/interactive/editingTools/reshapeGraphic/edgeOffsetUtils.js +1 -1
  448. package/views/3d/interactive/editingTools/settings.js +1 -1
  449. package/views/3d/interactive/editingTools/transformGraphic/ExtentTransformTool.js +1 -1
  450. package/views/3d/interactive/editingTools/transformGraphic/GraphicScaleRotateTransform.js +1 -1
  451. package/views/3d/interactive/manipulatorUtils.js +1 -1
  452. package/views/3d/interactive/visualElements/ExtendedLineVisualElement.js +1 -1
  453. package/views/3d/interactive/visualElements/LineVisualElement.js +1 -1
  454. package/views/3d/interactive/visualElements/ParallelLineVisualElement.js +1 -1
  455. package/views/3d/layers/BuildingComponentSublayerView3D.js +1 -1
  456. package/views/3d/layers/I3SMeshView3D.js +1 -1
  457. package/views/3d/layers/ImageryLayerView3D.js +1 -1
  458. package/views/3d/layers/PointCloudLayerView3D.js +1 -1
  459. package/views/3d/layers/PointCloudWorker.js +1 -1
  460. package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
  461. package/views/3d/layers/graphics/Deconflictor.js +1 -1
  462. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  463. package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
  464. package/views/3d/layers/graphics/Graphics3DFeatureProcessor.js +1 -1
  465. package/views/3d/layers/graphics/Graphics3DLodInstanceGraphicLayer.js +1 -1
  466. package/views/3d/layers/graphics/Graphics3DObject3DGraphicLayer.js +1 -1
  467. package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
  468. package/views/3d/layers/graphics/Graphics3DPathSymbolLayer.js +1 -1
  469. package/views/3d/layers/graphics/elevationAlignPointsInFeatures.js +1 -1
  470. package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
  471. package/views/3d/layers/i3s/I3SElevationProvider.js +1 -1
  472. package/views/3d/layers/i3s/I3SIndex.js +1 -1
  473. package/views/3d/layers/i3s/I3SUtil.js +1 -1
  474. package/views/3d/layers/i3s/I3SViewportQueries.js +1 -1
  475. package/views/3d/layers/i3s/PointRenderer.js +1 -1
  476. package/views/3d/layers/support/FeatureTileVisibility3D.js +1 -1
  477. package/views/3d/layers/support/I3STreeDebugger.js +1 -1
  478. package/views/3d/layers/support/edgeUtils.js +1 -1
  479. package/views/3d/layers/support/uvUtils.js +1 -1
  480. package/views/3d/state/Frustum.js +1 -1
  481. package/views/3d/state/controllers/GamepadKeyboardController.js +1 -1
  482. package/views/3d/state/controllers/RotateController.js +1 -1
  483. package/views/3d/state/controllers/global/PinchAndPanController.js +1 -1
  484. package/views/3d/state/controllers/local/PinchAndPanController.js +1 -1
  485. package/views/3d/state/controllers/local/ZoomController.js +1 -1
  486. package/views/3d/state/controllers/momentum/ZoomPlanarMomentumController.js +1 -1
  487. package/views/3d/state/utils/navigationUtils.js +1 -1
  488. package/views/3d/support/FrustumExtentIntersection.js +1 -1
  489. package/views/3d/support/orientedBoundingBox.js +1 -1
  490. package/views/3d/support/pointsOfInterest/CameraOnSurface.js +1 -1
  491. package/views/3d/support/pointsOfInterest/CenterOnSurface.js +1 -1
  492. package/views/3d/support/pointsOfInterest/PointsOfInterest.js +1 -1
  493. package/views/3d/support/sunUtils.js +1 -1
  494. package/views/3d/terrain/OverlayManager.js +1 -1
  495. package/views/3d/terrain/OverlayRenderer.js +1 -1
  496. package/views/3d/terrain/PatchRenderData.js +1 -1
  497. package/views/3d/terrain/TerrainRenderer.js +1 -1
  498. package/views/3d/terrain/TerrainSurface.js +1 -1
  499. package/views/3d/terrain/Tile.js +1 -1
  500. package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
  501. package/views/3d/webgl-engine/collections/Component/DepthRange.js +1 -1
  502. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  503. package/views/3d/webgl-engine/core/renderPasses/RenderPassManager.js +1 -1
  504. package/views/3d/webgl-engine/core/shaderLibrary/Slice.glsl.js +1 -1
  505. package/views/3d/webgl-engine/core/shaderLibrary/attributes/InstancedDoublePrecision.glsl.js +1 -1
  506. package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexPosition.glsl.js +2 -2
  507. package/views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl.js +6 -6
  508. package/views/3d/webgl-engine/core/shaderLibrary/hud/HUD.glsl.js +2 -2
  509. package/views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js +13 -13
  510. package/views/3d/webgl-engine/core/shaderLibrary/shading/MainLighting.glsl.js +1 -1
  511. package/views/3d/webgl-engine/core/shaderLibrary/util/CloudsParallaxShading.glsl.js +9 -9
  512. package/views/3d/webgl-engine/core/shaderLibrary/util/View.glsl.js +1 -1
  513. package/views/3d/webgl-engine/core/shaderTechnique/ShaderTechniqueRepository.js +1 -1
  514. package/views/3d/webgl-engine/core/util/TwoVectorPosition.js +1 -1
  515. package/views/3d/webgl-engine/lib/AnimationTimer.js +1 -1
  516. package/views/3d/webgl-engine/lib/BindParameters.js +1 -1
  517. package/views/3d/webgl-engine/lib/Camera.js +1 -1
  518. package/views/3d/webgl-engine/lib/CompositingHelper.js +1 -1
  519. package/views/3d/webgl-engine/lib/GeometryRecord.js +1 -1
  520. package/views/3d/webgl-engine/lib/GeometryUtil.js +1 -1
  521. package/views/3d/webgl-engine/lib/Highlight.js +1 -1
  522. package/views/3d/webgl-engine/lib/Intersector.js +1 -1
  523. package/views/3d/webgl-engine/lib/Object3D.js +1 -1
  524. package/views/3d/webgl-engine/lib/ObjectAndLayerIdRenderHelper.js +1 -1
  525. package/views/3d/webgl-engine/lib/OffscreenRendering.js +1 -1
  526. package/views/3d/webgl-engine/lib/RenderGeometry.js +1 -1
  527. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  528. package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
  529. package/views/3d/webgl-engine/lib/Update.js +5 -0
  530. package/views/3d/webgl-engine/lib/depthRangeUtils.js +1 -1
  531. package/views/3d/webgl-engine/lib/edgeRendering/EdgeRenderer.js +1 -1
  532. package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
  533. package/views/3d/webgl-engine/lib/edgeRendering/edgePreprocessing.js +1 -1
  534. package/views/3d/webgl-engine/lib/lodRendering/InstanceData.js +1 -1
  535. package/views/3d/webgl-engine/lib/lodRendering/InstanceOctree.js +1 -1
  536. package/views/3d/webgl-engine/lib/lodRendering/LodRenderer.js +1 -1
  537. package/views/3d/webgl-engine/lib/pathGeometryUtils.js +1 -1
  538. package/views/3d/webgl-engine/lib/verticalOffsetUtils.js +1 -1
  539. package/views/3d/webgl-engine/lighting/SceneLighting.js +1 -1
  540. package/views/3d/webgl-engine/lighting/SphericalHarmonics.js +1 -1
  541. package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
  542. package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
  543. package/views/3d/webgl-engine/materials/MeasurementArrowMaterial.js +1 -1
  544. package/views/3d/webgl-engine/materials/NativeLineMaterial.js +1 -1
  545. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  546. package/views/3d/webgl-engine/materials/WaterGLMaterial.js +1 -1
  547. package/views/3d/webgl-engine/parts/RenderView.js +1 -1
  548. package/views/3d/webgl-engine/parts/ScreenshotManager.js +1 -1
  549. package/views/3d/webgl-engine/shaders/Compositing.glsl.js +1 -1
  550. package/views/3d/webgl-engine/shaders/CompositingTechnique.js +1 -1
  551. package/views/3d/webgl-engine/shaders/CompositingTechniqueConfiguration.js +1 -1
  552. package/views/3d/webgl-engine/shaders/HUDCompositing.glsl.js +5 -0
  553. package/views/3d/webgl-engine/shaders/HUDCompositingTechnique.js +5 -0
  554. package/views/3d/webgl-engine/shaders/OITCompositing.glsl.js +5 -0
  555. package/views/3d/webgl-engine/shaders/OITCompositingTechnique.js +5 -0
  556. package/views/3d/webgl-engine/shaders/OverlayCompositing.glsl.js +5 -0
  557. package/views/3d/webgl-engine/shaders/OverlayCompositingTechnique.js +5 -0
  558. package/views/3d/webgl-engine/shaders/TerrainTechniqueConfiguration.js +1 -1
  559. package/views/SceneView.js +1 -1
  560. package/views/draw/support/surfaceCoordinateSystems.js +1 -1
  561. package/views/interactive/coordinateHelper.js +1 -1
  562. package/views/interactive/editGeometry/operations/OffsetEdgeVertex.js +1 -1
  563. package/views/interactive/editGeometry/support/editPlaneUtils.js +1 -1
  564. package/views/interactive/snapping/LineSnapper.js +1 -1
  565. package/views/interactive/snapping/ParallelLineSnapper.js +1 -1
  566. package/views/interactive/snapping/RightAngleSnapper.js +1 -1
  567. package/views/interactive/snapping/RightAngleTriangleSnapper.js +1 -1
  568. package/views/interactive/snapping/SnappingAlgorithm.js +1 -1
  569. package/views/interactive/snapping/SnappingManager.js +1 -1
  570. package/views/interactive/snapping/featureSources/FeatureCollectionSnappingSource.js +1 -1
  571. package/views/interactive/snapping/featureSources/FeatureServiceSnappingSource.js +1 -1
  572. package/views/interactive/snapping/featureSources/GraphicsSnappingSource.js +1 -1
  573. package/views/interactive/snapping/featureSources/SnappingCandidateElevationAligner.js +1 -1
  574. package/views/interactive/snapping/featureSources/SnappingResultElevationFilter.js +1 -1
  575. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceSnappingSourceWorker.js +1 -1
  576. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceSnappingSourceWorkerHandle.js +1 -1
  577. package/views/interactive/snapping/featureSources/sceneLayerSource/SceneLayerSnappingSourceWorker.js +1 -1
  578. package/views/interactive/snapping/featureSources/snappingResultElevationUtils.js +5 -0
  579. package/views/interactive/snapping/snappingUtils.js +1 -1
  580. package/views/layers/FeatureLayerView.js +1 -1
  581. package/views/navigation/PanSphericalMomentumEstimator.js +1 -1
  582. package/views/support/Scheduler.js +1 -1
  583. package/views/support/euclideanAreaMeasurementUtils.js +1 -1
  584. package/views/support/geometry3dUtils.js +1 -1
  585. package/widgets/Directions/support/resources.js +1 -1
  586. package/widgets/Directions.js +1 -1
  587. package/widgets/ElevationProfile/support/ProfileLines3D.js +1 -1
  588. package/widgets/ElevationProfile/support/constants.js +1 -1
  589. package/widgets/Feature/FeatureRelationship/FeatureRelationshipViewModel.js +1 -1
  590. package/widgets/Feature/FeatureRelationship.js +1 -1
  591. package/widgets/Legend/LegendViewModel.js +1 -1
  592. package/widgets/Legend/support/ActiveLayerInfo.js +1 -1
  593. package/widgets/Weather/LabeledSlider.js +1 -1
  594. package/widgets/Weather.js +1 -1
  595. package/assets/esri/core/workers/chunks/0059699bf824f851d51c.js +0 -1
  596. package/assets/esri/core/workers/chunks/01a6005569d0820992a0.js +0 -1
  597. package/assets/esri/core/workers/chunks/2eb547a0be305f2c816c.js +0 -1
  598. package/assets/esri/core/workers/chunks/36dd5654df5c7f00406d.js +0 -1
  599. package/assets/esri/core/workers/chunks/36e0a0d5f86b2b4b88f9.js +0 -1
  600. package/assets/esri/core/workers/chunks/8b8a813f5e6d6551a816.js +0 -1
  601. package/assets/esri/core/workers/chunks/bf84189bd9bf3de81df9.js +0 -1
  602. package/assets/esri/core/workers/chunks/cd7f5c3d328166f28f59.js +0 -1
  603. package/assets/esri/core/workers/chunks/de128d8a643b4297940b.js +0 -1
  604. package/assets/esri/core/workers/chunks/e208d9c34f5db4481441.js +0 -1
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.25/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../../Color.js";import has from"../../../../core/has.js";import{isSome as t,get as s,none as r,isNone as a,unwrapOr as i}from"../../../../core/maybe.js";import{pt2px as o}from"../../../../core/screenUtils.js";import{c as n,i as c,k as l,v as h}from"../../../../chunks/mat4.js";import{c as d}from"../../../../chunks/mat4f64.js";import{l as p,o as m,c as u,B as y,a as f,s as _}from"../../../../chunks/vec3.js";import{d as b,O as g,Z as P,f as R,c as v}from"../../../../chunks/vec3f64.js";import{O as x,c as L}from"../../../../chunks/vec4f64.js";import{projectPointToVector as S,computeTranslationToOriginAndRotation as C}from"../../../../geometry/projection.js";import{create as j,size as w,containsPoint as U,center as E}from"../../../../geometry/support/aaBoundingBox.js";import{defaultPrimitive as B}from"../../../../symbols/support/ObjectSymbol3DLayerResource.js";import{objectSymbolLayerPrimitiveBoundingBox as T,objectSymbolLayerSizeWithResourceSize as A}from"../../../../symbols/support/symbolLayerUtils3D.js";import{perLodInstanceElevationAligner as I}from"./ElevationAligners.js";import{needsElevationUpdates3D as O,evaluateElevationInfoAtPoint as G,SampleElevationInfo as D}from"./elevationAlignmentUtils.js";import{ElevationContext as z}from"./ElevationContext.js";import M from"./Graphics3DLodInstanceGraphicLayer.js";import{Graphics3DSymbolLayer as F}from"./Graphics3DSymbolLayer.js";import{validateSymbolLayerSize as V,mixinColorAndOpacity as k,computeObjectScale as W,computeObjectRotation as H}from"./graphicUtils.js";import{ApplyRendererDiffResult as q}from"./interfaces.js";import{LoadStatus as N}from"./Loadable.js";import{makeLodResources as $,fillEstimatedMinScreenSpaceRadius as Z}from"./lodResourceUtils.js";import{fetch as J}from"./objectResourceUtils.js";import{placePointOnGeometry as K,extendPointGraphicElevationContext as Q}from"./pointUtils.js";import{isValidPrimitive as X,primitiveLodResources as Y}from"./primitiveObjectSymbolUtils.js";import{defaultSymbolLayerMemoryComplexity as ee}from"./symbolComplexity.js";import{initFastSymbolUpdatesState as te,updateFastSymbolUpdatesState as se,evaluateModelTransform as re,evaluateModelTransformScale as ae}from"../support/FastSymbolUpdates.js";import{CullFaceOptions as ie}from"../../webgl-engine/lib/basicInterfaces.js";import{VertexAttribute as oe}from"../../webgl-engine/lib/VertexAttribute.js";import{LodRenderer as ne}from"../../webgl-engine/lib/lodRendering/LodRenderer.js";import{materialsFromLodResources as ce,texturesFromLodResources as le,geometriesFromLodResources as he,geometriesFromLodLevelResources as de}from"../../webgl-engine/lib/lodRendering/LodResources.js";import{DefaultMaterial as pe}from"../../webgl-engine/materials/DefaultMaterial.js";class me extends F{constructor(e,t,s,r){super(e,t,s,r),this._resources=null,this._optionalFields=new Array,this._instanceIndexToGraphicUid=new Map,this._hasLoadedPBRTextures=!1,this._disposeResourceHandles=new Array,this.ensureDrapedStatus(!1),this._hasLoadedPBRTextures=s.physicalBasedRenderingEnabled}getCachedSize(){const[e,s,r]=t(this._resources)?this._resources.symbolSize:[1,1,1];return{width:e,depth:s,height:r}}async doLoad(e){if(!this._drivenProperties.size){if(V(this.symbolLayer))throw new Error}const t=this.symbolLayer;if(this._isPrimitive){const s=t.resource?t.resource.primitive:B;this._resources=await this._createResourcesForPrimitive(s,e)}else this._resources=await this._createResourcesForUrl(t.resource.href,e);this.layerOpacityChanged(),this.slicePlaneEnabledChanged(),this.physicalBasedRenderingChanged(),this.complexity=this.computeComplexity()}get extentPadding(){return t(this._resources)?this._resources.extentPadding:0}get _isPrimitive(){return!(this.symbolLayer.resource&&this.symbolLayer.resource.href)}get lodRenderer(){return s(this._resources,"lodRenderer")}_setMaterialTransparencyParams(e,t=s(this.symbolLayer,"material","color")){const r=this._getCombinedOpacity(t),a=r<1||this.needsDrivenTransparentPass;return e.transparent=a,e.opacity=r,e.cullFace=a?ie.None:ie.Back,e}async _createResourcesForPrimitive(s,a){if(!X(s))throw new Error(`Unknown object symbol primitive: ${s}`);const i=this.symbolLayer,n=j(T(s)),c=b(w(n)),l=b(A(c,i)),h=p(l),d=!1,m=!1,u={usePBR:this._context.physicalBasedRenderingEnabled,isSchematic:!0,ambient:g,diffuse:g,hasSlicePlane:this._context.slicePlaneEnabled,hasSliceHighlight:!1,castShadows:this.symbolLayer.castShadows,offsetTransparentBackfaces:!this.symbolLayer.isPrimitive},y=u.usePBR;this._setMaterialTransparencyParams(u);const f=this.symbol;if("point-3d"===f.type&&f.verticalOffset){const{screenLength:e,minWorldLength:s,maxWorldLength:r}=f.verticalOffset;u.verticalOffset={screenLength:o(e),minWorldLength:s||0,maxWorldLength:t(r)?r:1/0},u.castShadows=!1}if(this._context.screenSizePerspectiveEnabled&&(u.screenSizePerspective=this._context.sharedResources.screenSizePerspectiveSettings),this._drivenProperties.color)u.externalColor=x;else{const s=t(i.material)&&i.material.color,r=t(s)?e.toUnitRGBA(s):x;u.externalColor=r}this._fastUpdates=te(this._context.renderer,this._fastVisualVariableConvertOptions(n,l,c,r)),u.instanced=["transformation"],this._fastUpdates.enabled?(Object.assign(u,this._fastUpdates.materialParameters),u.instanced.push("featureAttribute"),this._optionalFields.push("featureAttribute")):this._hasPerInstanceColor()&&(u.instanced.push("color"),this._optionalFields.push("color")),has("enable-feature:objectAndLayerId-rendering")&&(u.instanced.push("objectAndLayerIdColor"),this._optionalFields.push("objectAndLayerIdColor"));const _=new pe(u),P=Y(s,_);if(!P)throw new Error(`Unknown object symbol primitive: ${s}`);const R=ce(P).map((e=>({opacity:1,transparent:e.parameters.transparent}))),v=await this._createStageResources(P,y);return{lodResources:P,lodRenderer:await this._createLodRenderer(P,a),stageResources:v,symbolSize:l,extentPadding:h,isEsriSymbolResource:d,isWosr:m,originalMaterialParameters:R,physicalBasedRenderingEnabled:y,resourceBoundingBox:n,resourceSize:c,pivotOffset:r}}async _createResourcesForUrl(e,a){const i=["transformation"],n={materialParamsMixin:{instanced:i,hasSlicePlane:this._context.slicePlaneEnabled,castShadows:this.symbolLayer.castShadows},streamDataRequester:this._context.streamDataRequester,cache:this._context.sharedResources.objectResourceCache};this._fastUpdates=te(this._context.renderer,this._fastVisualVariableConvertOptions(r,r,r,r)),this._fastUpdates.enabled?(Object.assign(n.materialParamsMixin,this._fastUpdates.materialParameters),i.push("featureAttribute"),this._optionalFields.push("featureAttribute")):this._hasPerInstanceColor()&&(i.push("color"),this._optionalFields.push("color")),has("enable-feature:objectAndLayerId-rendering")&&(i.push("objectAndLayerIdColor"),this._optionalFields.push("objectAndLayerIdColor"));const c=this.symbol;if("point-3d"===c.type&&c.verticalOffset){const{screenLength:e,minWorldLength:s,maxWorldLength:r}=c.verticalOffset;n.materialParamsMixin.verticalOffset={screenLength:o(e),minWorldLength:s||0,maxWorldLength:t(r)?r:1/0},n.materialParamsMixin.castShadows=!1}n.signal=a,n.usePBR=this._context.physicalBasedRenderingEnabled;const l=n.usePBR,h=await J(e,n),d=h.isEsriSymbolResource,m=h.isWosr,u=$(h.lods);Z(u),u.levels.sort(((e,t)=>e.minScreenSpaceRadius-t.minScreenSpaceRadius)),u.levels[0].minScreenSpaceRadius=Math.min(2,u.levels[0].minScreenSpaceRadius);const y=this._context,f=this.symbolLayer.material,_=this._getExternalColorParameters(f),g=s(this.symbolLayer,"material","color"),P=this._getCombinedOpacity(g,{hasIntrinsicColor:!0}),R=this.needsDrivenTransparentPass,v=ce(u),x=ce(u).map((e=>({opacity:e.parameters.opacity||1,transparent:e.parameters.transparent})));v.forEach((e=>{const t=e.parameters;e.setParameters(_);const s=t.opacity*P,r=s<1||R||t.transparent;e.setParameters({opacity:s,transparent:r}),y.screenSizePerspectiveEnabled&&e.setParameters({screenSizePerspective:y.sharedResources.screenSizePerspectiveSettings})}));const L=h.referenceBoundingBox,S=b(w(L)),C=b(u.levels[0].pivotOffset),j=b(A(S,this.symbolLayer)),U=p(j);se(this._fastUpdates,this._context.renderer,this._fastVisualVariableConvertOptions(L,j,S,C))&&v.forEach((e=>e.setParameters(this._fastUpdates.materialParameters)));const E=await this._createStageResources(u,l);return{lodResources:u,lodRenderer:await this._createLodRenderer(u,a),stageResources:E,symbolSize:j,extentPadding:U,isEsriSymbolResource:d,isWosr:m,originalMaterialParameters:x,physicalBasedRenderingEnabled:l,resourceBoundingBox:L,resourceSize:S,pivotOffset:C}}_addDisposeResource(e){this._disposeResourceHandles.push(e)}async _createStageResources(e,t){const s=this._context.stage,r=ce(e);t!==this._context.physicalBasedRenderingEnabled&&this.physicalBasedRenderingChanged(),s.addMany(r),this._addDisposeResource((()=>s.removeMany(r)));const a=le(e);s.addMany(a),this._addDisposeResource((()=>s.removeMany(a))),await s.load(a);const i=he(e);return s.addMany(i),this._addDisposeResource((()=>s.removeMany(i))),{materials:r,textures:a,geometries:i}}async _createLodRenderer(e,t){const s=this._context.stage,r={layerUid:this._context.layer.uid,graphicUid:e=>this._instanceIndexToGraphicUid.get(e),notifyGraphicGeometryChanged:e=>this._context.notifyGraphicGeometryChanged(this._instanceIndexToGraphicUid.get(e)),notifyGraphicVisibilityChanged:e=>this._context.notifyGraphicVisibilityChanged(this._instanceIndexToGraphicUid.get(e))},a=this._fastUpdates.enabled?{applyTransform:(e,t,s)=>{e.getFeatureAttribute(t,_e),n(s,re(this._fastUpdates.materialParameters,_e,s))},scaleFactor:(e,t,s)=>(t.getFeatureAttribute(s,_e),ae(e,this._fastUpdates.materialParameters,_e))}:null,i=new ne(e,this._optionalFields,r,a);return i.slicePlaneEnabled=this._context.slicePlaneEnabled,this._addDisposeResource((()=>{s.removeRenderPlugin(i)})),await s.addRenderPlugin(i.slots,i,t),i}_getExternalColorParameters(s){const r={};return this._drivenProperties.color?r.externalColor=x:t(s)&&t(s.color)?r.externalColor=e.toUnitRGBA(s.color):(r.externalColor=x,r.colorMixMode="ignore"),r}destroy(){super.destroy(),this._cleanupResources()}_cleanupResources(){this._disposeResourceHandles.forEach((e=>e())),this._disposeResourceHandles.length=0,this._resources=null}createGraphics3DGraphic(e){const t=e.graphic;if(!this._validateGeometry(t.geometry))return null;const s=K(t.geometry);if(a(s))return this.logger.warn(`unsupported geometry type for icon symbol: ${t.geometry.type}`),null;const r=this.setGraphicElevationContext(t,new z),i=e.renderingInfo;return this._createAs3DShape(t,s,i,r,t.uid,e.layer.uid)}notifyDestroyGraphicLayer(e){this._instanceIndexToGraphicUid.delete(e.instanceIndex)}graphicLayerToGraphicId(){return 0}layerOpacityChanged(){if(a(this._resources))return!0;const e=this._drivenProperties.opacity,t=!this._isPrimitive,r=this._resources.stageResources.materials,i=this._resources.originalMaterialParameters;for(let a=0;a<r.length;a++){const o=r[a],n=s(this.symbolLayer,"material","color"),c=i[a],l=this._getCombinedOpacity(n,{hasIntrinsicColor:t})*c.opacity,h=l<1||e||c.transparent;o.setParameters({opacity:l,transparent:h}),this._isPrimitive&&o.setParameters({cullFace:h?ie.None:ie.Back})}return!0}layerElevationInfoChanged(e,t){return this.updateGraphics3DGraphicElevationInfo(e,t,O)}slicePlaneEnabledChanged(){if(a(this._resources))return!0;this._resources.lodRenderer.slicePlaneEnabled=this._context.slicePlaneEnabled;for(const e of this._resources.stageResources.materials)e.setParameters({hasSlicePlane:this._context.slicePlaneEnabled});return!0}physicalBasedRenderingChanged(){if(a(this._resources))return!0;const{stageResources:e,isWosr:t}=this._resources;for(const s of e.materials)this._isPrimitive?s.setParameters({usePBR:this._context.physicalBasedRenderingEnabled,isSchematic:!0}):t||s.setParameters({usePBR:this._context.physicalBasedRenderingEnabled,isSchematic:!1});return!1!==this._hasLoadedPBRTextures||!0!==this._context.physicalBasedRenderingEnabled||(this._hasLoadedPBRTextures=!0,!1)}pixelRatioChanged(){return!0}applyRendererDiff(e,t){if(a(this._resources))return q.Recreate_Symbol;const{stageResources:{materials:s},lodRenderer:r,resourceBoundingBox:i,symbolSize:o,resourceSize:n,pivotOffset:c}=this._resources;for(const a in e.diff){if("visualVariables"!==a)return q.Recreate_Symbol;if(!se(this._fastUpdates,t,this._fastVisualVariableConvertOptions(i,o,n,c)))return q.Recreate_Symbol;for(const e of s)e.setParameters(this._fastUpdates.materialParameters);r.notifyShaderTransformationChanged()}return q.Fast_Update}computeComplexity(){if(a(this._resources))return super.computeComplexity();const e=this._resources.lodResources,t=de(e.levels[0]).reduce(((e,t)=>e+t.indices.get(oe.POSITION).length),0)/3,s=e=>Array.from(e.vertexAttributes.values()).reduce(((e,t)=>e+(t.data.buffer?.byteLength??0)),0)+Array.from(e.indices.values()).reduce(((e,t)=>e+(Array.isArray(t)?12*t.length:t.buffer.byteLength)),0),r=le(e).reduce(((e,t)=>e+t.estimatedTexMemRequired),0)+he(e).reduce(((e,t)=>e+s(t)),0);return{primitivesPerFeature:t,primitivesPerCoordinate:0,drawCallsPerFeature:0,estimated:!1,memory:{...ee(this.symbol,this.symbolLayer),resourceBytes:r}}}_hasLodRenderer(){return t(this._resources)}_createAs3DShape(e,s,r,i,o,n){if(!this._hasLodRenderer()||a(this._resources))return null;const c=this.getFastUpdateAttrValues(e),l=!this._fastUpdates.enabled&&this._hasPerInstanceColor()?k(r.color,r.opacity):null,h=this._context.clippingExtent;if(S(s,ue,this._context.elevationProvider.spatialReference),t(h)&&!U(h,ue))return null;const d=this._requiresTerrainElevation(i),p=this._computeGlobalTransform(s,i,fe,be),m=this._computeLocalTransform(this._resources,this.symbolLayer,r,ye),u=this._resources.lodRenderer.instanceData,y=u.addInstance();this._instanceIndexToGraphicUid.set(y,o),u.setLocalTransform(y,m,!1),u.setGlobalTransform(y,p),c&&u.setFeatureAttribute(y,c),l&&u.setColor(y,l),has("enable-feature:objectAndLayerId-rendering")&&u.setObjectAndLayerIdColor(y,this._context.stage.renderView._objectAndLayerIdRenderHelper.getObjectAndLayerIdColor({graphicUid:o,layerUid:n}));const f=new M(this,y,I,i);return d&&(f.alignedSampledElevation=be.sampledElevation),f.needsElevationUpdates=O(i.mode),Q(f,s,this._context.elevationProvider),f}_computeGlobalTransform(e,t,s,r){return G(e,this._context.elevationProvider,t,this._context.renderCoordsHelper,r),ue[0]=e.x,ue[1]=e.y,ue[2]=r.z,C(e.spatialReference,ue,s,this._context.renderCoordsHelper.spatialReference),s}_computeLocalTransform(e,t,s,r){return c(r),this._applyObjectRotation(s,!1,r),this._applyObjectRotation(t,!0,r),this._applyObjectScale(e,s,r),this._applyAnchor(e,t,r),r}_applyObjectScale(e,t,s){if(this._fastUpdates.enabled&&this._fastUpdates.requiresShaderTransformation)return;const r=this._drivenProperties.size&&t.size?t.size:e.symbolSize,a=W(r,e.symbolSize,e.resourceSize,this._context.renderCoordsHelper.unitInMeters);1===a[0]&&1===a[1]&&1===a[2]||l(s,s,a)}prepareSymbolLayerPatch(e){if("partial"!==e.diff.type)return;const t=e.diff.diff;this._preparePatchTransform(e,t),this._preparePatchColor(e,t)}updateGeometry(e,t){if(a(this._resources))return!0;const s=t&&K(t);if(a(s))return!1;const r=this.getGeometryElevationMode(t);return e.elevationContext.mode===r&&(this._computeGlobalTransform(s,e.elevationContext,fe,be),this._requiresTerrainElevation(e.elevationContext)&&(e.alignedSampledElevation=be.sampledElevation),this._resources.lodRenderer.instanceData.setGlobalTransform(e.instanceIndex,fe,!0),Q(e,s,this._context.elevationProvider),!0)}_preparePatchTransform(e,t){if(!(t.heading||t.tilt||t.roll||t.width||t.height||t.depth||t.anchor||t.anchorPosition))return;if(a(this._resources))return;const s=(e,t,s)=>i(null!=e&&"complete"===e.type?e.newValue:t,s),r=s(t.heading,this.symbolLayer.heading,0),o=s(t.tilt,this.symbolLayer.tilt,0),n=s(t.roll,this.symbolLayer.roll,0),c=s(t.width,this.symbolLayer.width,void 0),l=s(t.height,this.symbolLayer.height,void 0),h=s(t.depth,this.symbolLayer.depth,void 0),d=s(t.anchor,this.symbolLayer.anchor,void 0),p=s(t.anchorPosition,this.symbolLayer.anchorPosition,void 0);delete t.heading,delete t.tilt,delete t.roll,delete t.width,delete t.height,delete t.depth,delete t.anchor,delete t.anchorPosition;const m={heading:r,tilt:o,roll:n,anchor:d,anchorPosition:p},u=this._resources;this.loadStatus===N.LOADED&&e.symbolLayerStatePatches.push((()=>{u.symbolSize=b(A(u.resourceSize,{width:c,height:l,depth:h,isPrimitive:this.symbolLayer.isPrimitive}))})),e.graphics3DGraphicPatches.push(((e,t)=>{const s=this._computeLocalTransform(u,m,t,ye),r=e.instanceIndex;u.lodRenderer.instanceData.setLocalTransform(r,s,!0)}))}_preparePatchColor(s,r){if(!r.material||"partial"!==r.material.type)return;const i=r.material.diff;if(!i.color||"complete"!==i.color.type||null==i.color.newValue||null==i.color.oldValue)return;const o=i.color.newValue,n=t(o)?e.toUnitRGBA(o):x;delete i.color;const c=this._resources;a(c)||s.graphics3DGraphicPatches.push((e=>{let t;this._hasPerInstanceColor()?(c.lodRenderer.instanceData.setColor(e.instanceIndex,n),t=this._setMaterialTransparencyParams({},o)):t=this._setMaterialTransparencyParams({externalColor:n},o);for(const s of c.stageResources.materials)s.setParameters(t)}))}_requiresTerrainElevation(e){return"absolute-height"!==e.mode}_applyObjectRotation(e,t,s){if(!(this._fastUpdates.enabled&&this._fastUpdates.requiresShaderTransformation&&t))return H(e.heading,e.tilt,e.roll,s)}_computeAnchor(e,s,r){const a=v();switch(r.anchor){case"center":u(a,E(e)),m(a,a);break;case"top":{const t=E(e);_(a,-t[0],-t[1],-e[5]);break}case"bottom":{const t=E(e);_(a,-t[0],-t[1],-e[2]);break}case"relative":{const t=E(e),s=w(e),i=r.anchorPosition,o=i?R(i.x,i.y,i.z):P;y(a,s,o),f(a,a,t),m(a,a);break}default:t(s)?m(a,s):u(a,P)}return a}_applyAnchor(e,t,s){if(this._fastUpdates.enabled&&this._fastUpdates.requiresShaderTransformation)return;const r=this._computeAnchor(e.resourceBoundingBox,e.pivotOffset,t);r&&h(s,s,r)}_hasPerInstanceColor(){return this._drivenProperties.color||this._drivenProperties.opacity}_fastVisualVariableConvertOptions(e,s,r,a){const i=t(e)?b(w(e)):g,o=t(e)?this._computeAnchor(e,a,this.symbolLayer):P,n=this._context.renderCoordsHelper.unitInMeters,c=W(t(s)?s:void 0,s,r,n),l=R(this.symbolLayer.tilt||0,this.symbolLayer.roll||0,this.symbolLayer.heading||0);return{modelSize:i,symbolSize:t(s)?s:g,unitInMeters:n,transformation:{anchor:o,scale:c,rotation:l}}}}const ue=v(),ye=d(),fe=d(),_e=L(),be=new D;export{me as Graphics3DObjectSymbolLayer};
5
+ import e from"../../../../Color.js";import has from"../../../../core/has.js";import{isSome as t,get as s,none as r,isNone as a,unwrapOr as i}from"../../../../core/maybe.js";import{pt2px as o}from"../../../../core/screenUtils.js";import{c as n,i as c,k as l,v as h}from"../../../../chunks/mat4.js";import{c as d}from"../../../../chunks/mat4f64.js";import{l as p,x as m,c as u,u as y,a as f,s as _}from"../../../../chunks/vec3.js";import{d as b,O as g,Z as P,f as R,c as v}from"../../../../chunks/vec3f64.js";import{O as x,c as L}from"../../../../chunks/vec4f64.js";import{projectPointToVector as S,computeTranslationToOriginAndRotation as C}from"../../../../geometry/projection.js";import{create as j,size as w,containsPoint as U,center as E}from"../../../../geometry/support/aaBoundingBox.js";import{defaultPrimitive as B}from"../../../../symbols/support/ObjectSymbol3DLayerResource.js";import{objectSymbolLayerPrimitiveBoundingBox as T,objectSymbolLayerSizeWithResourceSize as A}from"../../../../symbols/support/symbolLayerUtils3D.js";import{perLodInstanceElevationAligner as I}from"./ElevationAligners.js";import{needsElevationUpdates3D as O,evaluateElevationInfoAtPoint as G,SampleElevationInfo as D}from"./elevationAlignmentUtils.js";import{ElevationContext as z}from"./ElevationContext.js";import M from"./Graphics3DLodInstanceGraphicLayer.js";import{Graphics3DSymbolLayer as F}from"./Graphics3DSymbolLayer.js";import{validateSymbolLayerSize as V,mixinColorAndOpacity as k,computeObjectScale as W,computeObjectRotation as H}from"./graphicUtils.js";import{ApplyRendererDiffResult as q}from"./interfaces.js";import{LoadStatus as N}from"./Loadable.js";import{makeLodResources as $,fillEstimatedMinScreenSpaceRadius as Z}from"./lodResourceUtils.js";import{fetch as J}from"./objectResourceUtils.js";import{placePointOnGeometry as K,extendPointGraphicElevationContext as Q}from"./pointUtils.js";import{isValidPrimitive as X,primitiveLodResources as Y}from"./primitiveObjectSymbolUtils.js";import{defaultSymbolLayerMemoryComplexity as ee}from"./symbolComplexity.js";import{initFastSymbolUpdatesState as te,updateFastSymbolUpdatesState as se,evaluateModelTransform as re,evaluateModelTransformScale as ae}from"../support/FastSymbolUpdates.js";import{CullFaceOptions as ie}from"../../webgl-engine/lib/basicInterfaces.js";import{VertexAttribute as oe}from"../../webgl-engine/lib/VertexAttribute.js";import{LodRenderer as ne}from"../../webgl-engine/lib/lodRendering/LodRenderer.js";import{materialsFromLodResources as ce,texturesFromLodResources as le,geometriesFromLodResources as he,geometriesFromLodLevelResources as de}from"../../webgl-engine/lib/lodRendering/LodResources.js";import{DefaultMaterial as pe}from"../../webgl-engine/materials/DefaultMaterial.js";class me extends F{constructor(e,t,s,r){super(e,t,s,r),this._resources=null,this._optionalFields=new Array,this._instanceIndexToGraphicUid=new Map,this._hasLoadedPBRTextures=!1,this._disposeResourceHandles=new Array,this.ensureDrapedStatus(!1),this._hasLoadedPBRTextures=s.physicalBasedRenderingEnabled}getCachedSize(){const[e,s,r]=t(this._resources)?this._resources.symbolSize:[1,1,1];return{width:e,depth:s,height:r}}async doLoad(e){if(!this._drivenProperties.size){if(V(this.symbolLayer))throw new Error}const t=this.symbolLayer;if(this._isPrimitive){const s=t.resource?t.resource.primitive:B;this._resources=await this._createResourcesForPrimitive(s,e)}else this._resources=await this._createResourcesForUrl(t.resource.href,e);this.layerOpacityChanged(),this.slicePlaneEnabledChanged(),this.physicalBasedRenderingChanged(),this.complexity=this.computeComplexity()}get extentPadding(){return t(this._resources)?this._resources.extentPadding:0}get _isPrimitive(){return!(this.symbolLayer.resource&&this.symbolLayer.resource.href)}get lodRenderer(){return s(this._resources,"lodRenderer")}_setMaterialTransparencyParams(e,t=s(this.symbolLayer,"material","color")){const r=this._getCombinedOpacity(t),a=r<1||this.needsDrivenTransparentPass;return e.transparent=a,e.opacity=r,e.cullFace=a?ie.None:ie.Back,e}async _createResourcesForPrimitive(s,a){if(!X(s))throw new Error(`Unknown object symbol primitive: ${s}`);const i=this.symbolLayer,n=j(T(s)),c=b(w(n)),l=b(A(c,i)),h=p(l),d=!1,m=!1,u={usePBR:this._context.physicalBasedRenderingEnabled,isSchematic:!0,ambient:g,diffuse:g,hasSlicePlane:this._context.slicePlaneEnabled,hasSliceHighlight:!1,castShadows:this.symbolLayer.castShadows,offsetTransparentBackfaces:!this.symbolLayer.isPrimitive},y=u.usePBR;this._setMaterialTransparencyParams(u);const f=this.symbol;if("point-3d"===f.type&&f.verticalOffset){const{screenLength:e,minWorldLength:s,maxWorldLength:r}=f.verticalOffset;u.verticalOffset={screenLength:o(e),minWorldLength:s||0,maxWorldLength:t(r)?r:1/0},u.castShadows=!1}if(this._context.screenSizePerspectiveEnabled&&(u.screenSizePerspective=this._context.sharedResources.screenSizePerspectiveSettings),this._drivenProperties.color)u.externalColor=x;else{const s=t(i.material)&&i.material.color,r=t(s)?e.toUnitRGBA(s):x;u.externalColor=r}this._fastUpdates=te(this._context.renderer,this._fastVisualVariableConvertOptions(n,l,c,r)),u.instanced=["transformation"],this._fastUpdates.enabled?(Object.assign(u,this._fastUpdates.materialParameters),u.instanced.push("featureAttribute"),this._optionalFields.push("featureAttribute")):this._hasPerInstanceColor()&&(u.instanced.push("color"),this._optionalFields.push("color")),has("enable-feature:objectAndLayerId-rendering")&&(u.instanced.push("objectAndLayerIdColor"),this._optionalFields.push("objectAndLayerIdColor"));const _=new pe(u),P=Y(s,_);if(!P)throw new Error(`Unknown object symbol primitive: ${s}`);const R=ce(P).map((e=>({opacity:1,transparent:e.parameters.transparent}))),v=await this._createStageResources(P,y);return{lodResources:P,lodRenderer:await this._createLodRenderer(P,a),stageResources:v,symbolSize:l,extentPadding:h,isEsriSymbolResource:d,isWosr:m,originalMaterialParameters:R,physicalBasedRenderingEnabled:y,resourceBoundingBox:n,resourceSize:c,pivotOffset:r}}async _createResourcesForUrl(e,a){const i=["transformation"],n={materialParamsMixin:{instanced:i,hasSlicePlane:this._context.slicePlaneEnabled,castShadows:this.symbolLayer.castShadows},streamDataRequester:this._context.streamDataRequester,cache:this._context.sharedResources.objectResourceCache};this._fastUpdates=te(this._context.renderer,this._fastVisualVariableConvertOptions(r,r,r,r)),this._fastUpdates.enabled?(Object.assign(n.materialParamsMixin,this._fastUpdates.materialParameters),i.push("featureAttribute"),this._optionalFields.push("featureAttribute")):this._hasPerInstanceColor()&&(i.push("color"),this._optionalFields.push("color")),has("enable-feature:objectAndLayerId-rendering")&&(i.push("objectAndLayerIdColor"),this._optionalFields.push("objectAndLayerIdColor"));const c=this.symbol;if("point-3d"===c.type&&c.verticalOffset){const{screenLength:e,minWorldLength:s,maxWorldLength:r}=c.verticalOffset;n.materialParamsMixin.verticalOffset={screenLength:o(e),minWorldLength:s||0,maxWorldLength:t(r)?r:1/0},n.materialParamsMixin.castShadows=!1}n.signal=a,n.usePBR=this._context.physicalBasedRenderingEnabled;const l=n.usePBR,h=await J(e,n),d=h.isEsriSymbolResource,m=h.isWosr,u=$(h.lods);Z(u),u.levels.sort(((e,t)=>e.minScreenSpaceRadius-t.minScreenSpaceRadius)),u.levels[0].minScreenSpaceRadius=Math.min(2,u.levels[0].minScreenSpaceRadius);const y=this._context,f=this.symbolLayer.material,_=this._getExternalColorParameters(f),g=s(this.symbolLayer,"material","color"),P=this._getCombinedOpacity(g,{hasIntrinsicColor:!0}),R=this.needsDrivenTransparentPass,v=ce(u),x=ce(u).map((e=>({opacity:e.parameters.opacity||1,transparent:e.parameters.transparent})));v.forEach((e=>{const t=e.parameters;e.setParameters(_);const s=t.opacity*P,r=s<1||R||t.transparent;e.setParameters({opacity:s,transparent:r}),y.screenSizePerspectiveEnabled&&e.setParameters({screenSizePerspective:y.sharedResources.screenSizePerspectiveSettings})}));const L=h.referenceBoundingBox,S=b(w(L)),C=b(u.levels[0].pivotOffset),j=b(A(S,this.symbolLayer)),U=p(j);se(this._fastUpdates,this._context.renderer,this._fastVisualVariableConvertOptions(L,j,S,C))&&v.forEach((e=>e.setParameters(this._fastUpdates.materialParameters)));const E=await this._createStageResources(u,l);return{lodResources:u,lodRenderer:await this._createLodRenderer(u,a),stageResources:E,symbolSize:j,extentPadding:U,isEsriSymbolResource:d,isWosr:m,originalMaterialParameters:x,physicalBasedRenderingEnabled:l,resourceBoundingBox:L,resourceSize:S,pivotOffset:C}}_addDisposeResource(e){this._disposeResourceHandles.push(e)}async _createStageResources(e,t){const s=this._context.stage,r=ce(e);t!==this._context.physicalBasedRenderingEnabled&&this.physicalBasedRenderingChanged(),s.addMany(r),this._addDisposeResource((()=>s.removeMany(r)));const a=le(e);s.addMany(a),this._addDisposeResource((()=>s.removeMany(a))),await s.load(a);const i=he(e);return s.addMany(i),this._addDisposeResource((()=>s.removeMany(i))),{materials:r,textures:a,geometries:i}}async _createLodRenderer(e,t){const s=this._context.stage,r={layerUid:this._context.layer.uid,graphicUid:e=>this._instanceIndexToGraphicUid.get(e),notifyGraphicGeometryChanged:e=>this._context.notifyGraphicGeometryChanged(this._instanceIndexToGraphicUid.get(e)),notifyGraphicVisibilityChanged:e=>this._context.notifyGraphicVisibilityChanged(this._instanceIndexToGraphicUid.get(e))},a=this._fastUpdates.enabled?{applyTransform:(e,t,s)=>{e.getFeatureAttribute(t,_e),n(s,re(this._fastUpdates.materialParameters,_e,s))},scaleFactor:(e,t,s)=>(t.getFeatureAttribute(s,_e),ae(e,this._fastUpdates.materialParameters,_e))}:null,i=new ne(e,this._optionalFields,r,a);return i.slicePlaneEnabled=this._context.slicePlaneEnabled,this._addDisposeResource((()=>{s.removeRenderPlugin(i)})),await s.addRenderPlugin(i.slots,i,t),i}_getExternalColorParameters(s){const r={};return this._drivenProperties.color?r.externalColor=x:t(s)&&t(s.color)?r.externalColor=e.toUnitRGBA(s.color):(r.externalColor=x,r.colorMixMode="ignore"),r}destroy(){super.destroy(),this._cleanupResources()}_cleanupResources(){this._disposeResourceHandles.forEach((e=>e())),this._disposeResourceHandles.length=0,this._resources=null}createGraphics3DGraphic(e){const t=e.graphic;if(!this._validateGeometry(t.geometry))return null;const s=K(t.geometry);if(a(s))return this.logger.warn(`unsupported geometry type for icon symbol: ${t.geometry.type}`),null;const r=this.setGraphicElevationContext(t,new z),i=e.renderingInfo;return this._createAs3DShape(t,s,i,r,t.uid,e.layer.uid)}notifyDestroyGraphicLayer(e){this._instanceIndexToGraphicUid.delete(e.instanceIndex)}graphicLayerToGraphicId(){return 0}layerOpacityChanged(){if(a(this._resources))return!0;const e=this._drivenProperties.opacity,t=!this._isPrimitive,r=this._resources.stageResources.materials,i=this._resources.originalMaterialParameters;for(let a=0;a<r.length;a++){const o=r[a],n=s(this.symbolLayer,"material","color"),c=i[a],l=this._getCombinedOpacity(n,{hasIntrinsicColor:t})*c.opacity,h=l<1||e||c.transparent;o.setParameters({opacity:l,transparent:h}),this._isPrimitive&&o.setParameters({cullFace:h?ie.None:ie.Back})}return!0}layerElevationInfoChanged(e,t){return this.updateGraphics3DGraphicElevationInfo(e,t,O)}slicePlaneEnabledChanged(){if(a(this._resources))return!0;this._resources.lodRenderer.slicePlaneEnabled=this._context.slicePlaneEnabled;for(const e of this._resources.stageResources.materials)e.setParameters({hasSlicePlane:this._context.slicePlaneEnabled});return!0}physicalBasedRenderingChanged(){if(a(this._resources))return!0;const{stageResources:e,isWosr:t}=this._resources;for(const s of e.materials)this._isPrimitive?s.setParameters({usePBR:this._context.physicalBasedRenderingEnabled,isSchematic:!0}):t||s.setParameters({usePBR:this._context.physicalBasedRenderingEnabled,isSchematic:!1});return!1!==this._hasLoadedPBRTextures||!0!==this._context.physicalBasedRenderingEnabled||(this._hasLoadedPBRTextures=!0,!1)}pixelRatioChanged(){return!0}applyRendererDiff(e,t){if(a(this._resources))return q.Recreate_Symbol;const{stageResources:{materials:s},lodRenderer:r,resourceBoundingBox:i,symbolSize:o,resourceSize:n,pivotOffset:c}=this._resources;for(const a in e.diff){if("visualVariables"!==a)return q.Recreate_Symbol;if(!se(this._fastUpdates,t,this._fastVisualVariableConvertOptions(i,o,n,c)))return q.Recreate_Symbol;for(const e of s)e.setParameters(this._fastUpdates.materialParameters);r.notifyShaderTransformationChanged()}return q.Fast_Update}computeComplexity(){if(a(this._resources))return super.computeComplexity();const e=this._resources.lodResources,t=de(e.levels[0]).reduce(((e,t)=>e+t.indices.get(oe.POSITION).length),0)/3,s=e=>Array.from(e.vertexAttributes.values()).reduce(((e,t)=>e+(t.data.buffer?.byteLength??0)),0)+Array.from(e.indices.values()).reduce(((e,t)=>e+(Array.isArray(t)?12*t.length:t.buffer.byteLength)),0),r=le(e).reduce(((e,t)=>e+t.estimatedTexMemRequired),0)+he(e).reduce(((e,t)=>e+s(t)),0);return{primitivesPerFeature:t,primitivesPerCoordinate:0,drawCallsPerFeature:0,estimated:!1,memory:{...ee(this.symbol,this.symbolLayer),resourceBytes:r}}}_hasLodRenderer(){return t(this._resources)}_createAs3DShape(e,s,r,i,o,n){if(!this._hasLodRenderer()||a(this._resources))return null;const c=this.getFastUpdateAttrValues(e),l=!this._fastUpdates.enabled&&this._hasPerInstanceColor()?k(r.color,r.opacity):null,h=this._context.clippingExtent;if(S(s,ue,this._context.elevationProvider.spatialReference),t(h)&&!U(h,ue))return null;const d=this._requiresTerrainElevation(i),p=this._computeGlobalTransform(s,i,fe,be),m=this._computeLocalTransform(this._resources,this.symbolLayer,r,ye),u=this._resources.lodRenderer.instanceData,y=u.addInstance();this._instanceIndexToGraphicUid.set(y,o),u.setLocalTransform(y,m,!1),u.setGlobalTransform(y,p),c&&u.setFeatureAttribute(y,c),l&&u.setColor(y,l),has("enable-feature:objectAndLayerId-rendering")&&u.setObjectAndLayerIdColor(y,this._context.stage.renderView._objectAndLayerIdRenderHelper.getObjectAndLayerIdColor({graphicUid:o,layerUid:n}));const f=new M(this,y,I,i);return d&&(f.alignedSampledElevation=be.sampledElevation),f.needsElevationUpdates=O(i.mode),Q(f,s,this._context.elevationProvider),f}_computeGlobalTransform(e,t,s,r){return G(e,this._context.elevationProvider,t,this._context.renderCoordsHelper,r),ue[0]=e.x,ue[1]=e.y,ue[2]=r.z,C(e.spatialReference,ue,s,this._context.renderCoordsHelper.spatialReference),s}_computeLocalTransform(e,t,s,r){return c(r),this._applyObjectRotation(s,!1,r),this._applyObjectRotation(t,!0,r),this._applyObjectScale(e,s,r),this._applyAnchor(e,t,r),r}_applyObjectScale(e,t,s){if(this._fastUpdates.enabled&&this._fastUpdates.requiresShaderTransformation)return;const r=this._drivenProperties.size&&t.size?t.size:e.symbolSize,a=W(r,e.symbolSize,e.resourceSize,this._context.renderCoordsHelper.unitInMeters);1===a[0]&&1===a[1]&&1===a[2]||l(s,s,a)}prepareSymbolLayerPatch(e){if("partial"!==e.diff.type)return;const t=e.diff.diff;this._preparePatchTransform(e,t),this._preparePatchColor(e,t)}updateGeometry(e,t){if(a(this._resources))return!0;const s=t&&K(t);if(a(s))return!1;const r=this.getGeometryElevationMode(t);return e.elevationContext.mode===r&&(this._computeGlobalTransform(s,e.elevationContext,fe,be),this._requiresTerrainElevation(e.elevationContext)&&(e.alignedSampledElevation=be.sampledElevation),this._resources.lodRenderer.instanceData.setGlobalTransform(e.instanceIndex,fe,!0),Q(e,s,this._context.elevationProvider),!0)}_preparePatchTransform(e,t){if(!(t.heading||t.tilt||t.roll||t.width||t.height||t.depth||t.anchor||t.anchorPosition))return;if(a(this._resources))return;const s=(e,t,s)=>i(null!=e&&"complete"===e.type?e.newValue:t,s),r=s(t.heading,this.symbolLayer.heading,0),o=s(t.tilt,this.symbolLayer.tilt,0),n=s(t.roll,this.symbolLayer.roll,0),c=s(t.width,this.symbolLayer.width,void 0),l=s(t.height,this.symbolLayer.height,void 0),h=s(t.depth,this.symbolLayer.depth,void 0),d=s(t.anchor,this.symbolLayer.anchor,void 0),p=s(t.anchorPosition,this.symbolLayer.anchorPosition,void 0);delete t.heading,delete t.tilt,delete t.roll,delete t.width,delete t.height,delete t.depth,delete t.anchor,delete t.anchorPosition;const m={heading:r,tilt:o,roll:n,anchor:d,anchorPosition:p},u=this._resources;this.loadStatus===N.LOADED&&e.symbolLayerStatePatches.push((()=>{u.symbolSize=b(A(u.resourceSize,{width:c,height:l,depth:h,isPrimitive:this.symbolLayer.isPrimitive}))})),e.graphics3DGraphicPatches.push(((e,t)=>{const s=this._computeLocalTransform(u,m,t,ye),r=e.instanceIndex;u.lodRenderer.instanceData.setLocalTransform(r,s,!0)}))}_preparePatchColor(s,r){if(!r.material||"partial"!==r.material.type)return;const i=r.material.diff;if(!i.color||"complete"!==i.color.type||null==i.color.newValue||null==i.color.oldValue)return;const o=i.color.newValue,n=t(o)?e.toUnitRGBA(o):x;delete i.color;const c=this._resources;a(c)||s.graphics3DGraphicPatches.push((e=>{let t;this._hasPerInstanceColor()?(c.lodRenderer.instanceData.setColor(e.instanceIndex,n),t=this._setMaterialTransparencyParams({},o)):t=this._setMaterialTransparencyParams({externalColor:n},o);for(const s of c.stageResources.materials)s.setParameters(t)}))}_requiresTerrainElevation(e){return"absolute-height"!==e.mode}_applyObjectRotation(e,t,s){if(!(this._fastUpdates.enabled&&this._fastUpdates.requiresShaderTransformation&&t))return H(e.heading,e.tilt,e.roll,s)}_computeAnchor(e,s,r){const a=v();switch(r.anchor){case"center":u(a,E(e)),m(a,a);break;case"top":{const t=E(e);_(a,-t[0],-t[1],-e[5]);break}case"bottom":{const t=E(e);_(a,-t[0],-t[1],-e[2]);break}case"relative":{const t=E(e),s=w(e),i=r.anchorPosition,o=i?R(i.x,i.y,i.z):P;y(a,s,o),f(a,a,t),m(a,a);break}default:t(s)?m(a,s):u(a,P)}return a}_applyAnchor(e,t,s){if(this._fastUpdates.enabled&&this._fastUpdates.requiresShaderTransformation)return;const r=this._computeAnchor(e.resourceBoundingBox,e.pivotOffset,t);r&&h(s,s,r)}_hasPerInstanceColor(){return this._drivenProperties.color||this._drivenProperties.opacity}_fastVisualVariableConvertOptions(e,s,r,a){const i=t(e)?b(w(e)):g,o=t(e)?this._computeAnchor(e,a,this.symbolLayer):P,n=this._context.renderCoordsHelper.unitInMeters,c=W(t(s)?s:void 0,s,r,n),l=R(this.symbolLayer.tilt||0,this.symbolLayer.roll||0,this.symbolLayer.heading||0);return{modelSize:i,symbolSize:t(s)?s:g,unitInMeters:n,transformation:{anchor:o,scale:c,rotation:l}}}}const ue=v(),ye=d(),fe=d(),_e=L(),be=new D;export{me as Graphics3DObjectSymbolLayer};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.25/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../../core/Error.js";import{acosClamped as t,reciprocalClamped as r}from"../../../../core/mathUtils.js";import{isSome as i,get as s}from"../../../../core/maybe.js";import{s as a}from"../../../../chunks/mat2.js";import{s as o,b as n}from"../../../../chunks/vec2.js";import{f as l,b as h}from"../../../../chunks/vec2f64.js";import{s as c,a as p,e as m,f as d,g as f,n as u,o as g,b as y}from"../../../../chunks/vec3.js";import{c as _}from"../../../../chunks/vec3f32.js";import{d as b,c as v}from"../../../../chunks/vec3f64.js";import{projectBuffer as x}from"../../../../geometry/projection.js";import{create as w,empty as S,expandWithBuffer as R,intersectsClippingArea as D}from"../../../../geometry/support/aaBoundingBox.js";import{makeDehydratedPoint as P}from"../../../../layers/graphics/dehydratedFeatures.js";import{needsElevationUpdates3D as j,evaluateElevationAlignmentAtPoint as C,SampleElevationInfo as A,evaluateElevationInfoAtPoint as V}from"./elevationAlignmentUtils.js";import{ElevationContext as L}from"./ElevationContext.js";import{Graphics3DObject3DGraphicLayer as z}from"./Graphics3DObject3DGraphicLayer.js";import{Graphics3DSymbolLayer as U,getAttributeValue as E}from"./Graphics3DSymbolLayer.js";import{isValidSize as k}from"./graphicUtils.js";import{ApplyRendererDiffResult as F}from"./interfaces.js";import{initFastSymbolUpdatesState as G,updateFastSymbolUpdatesState as I}from"../support/FastSymbolUpdates.js";import{CullFaceOptions as M}from"../../webgl-engine/lib/basicInterfaces.js";import{Object3D as B}from"../../webgl-engine/lib/Object3D.js";import{PathGeometry as O,isPathGeometry as q}from"../../webgl-engine/lib/PathGeometry.js";import{Profile as H,SimpleExtruder as T,MiterExtruder as N,RoundCapBuilder as W,TriangulationCapBuilder as Z,NoCapBuilder as J,PathVertex as K,Path as Q,Builder as X,FastUpdatePathGeometry as Y,StaticPathGeometry as $,computeMinimumRotationTangentFrame as ee,vertexSpaceToProfileSpace as te}from"../../webgl-engine/lib/pathGeometryUtils.js";import{DefaultMaterial as re}from"../../webgl-engine/materials/DefaultMaterial.js";import{PathMaterial as ie}from"../../webgl-engine/materials/PathMaterial.js";const se=["polyline"];class ae extends U{constructor(e,t,r,i){super(e,t,r,i),this._intrinsicSize=l(1,1),this._upVectorAlignment="path",this._stencilWidth=.1,this.ensureDrapedStatus(!1)}async doLoad(){const t=i(this.symbolLayer.width)?this.symbolLayer.width:this.symbolLayer.height,r=i(this.symbolLayer.height)?this.symbolLayer.height:t;this._vvConvertOptions={modelSize:[1,1,1],symbolSize:[t,1,r],unitInMeters:this._context.renderCoordsHelper.unitInMeters,transformation:{anchor:[0,0,0],scale:[1,1,1],rotation:[0,0,0]},supportedTypes:{size:!0,color:!0,opacity:!0,rotation:!1}},this._context.renderer&&this._context.renderer.visualVariables&&this._context.renderer.visualVariables.length>0?this._fastUpdates=G(this._context.renderer,this._vvConvertOptions):this._fastUpdates={enabled:!1};const a=this.symbolLayer.anchor||"center";this._upVectorAlignment="path","heading"===this.symbolLayer.profileRotation&&(this._upVectorAlignment="world");const l=this.symbolLayer.profile||"circle";switch(l){case"circle":default:this._profile=H.circle(_e);break;case"quad":this._profile=H.rect()}let c=[0,0];"center"!==a&&(c={left:[.5,0],right:[-.5,0],top:[0,-.5],bottom:[0,.5]}[a],this._profile.translate(c[0],c[1]));switch(this.symbolLayer.join||"simple"){case"round":this._extruder=new N(0,ge);break;case"bevel":this._extruder=new N(0,1);break;case"miter":this._extruder=new N(.8*Math.PI,1);break;default:this._extruder=new T}const p=this.symbolLayer.cap||"butt";switch(p){case"none":this._startCap=new J,this._endCap=new J;break;case"butt":default:this._startCap=new Z(this._profile,0),this._endCap=new Z(this._profile,0,!0);break;case"square":this._startCap=new Z(this._profile,-.5),this._endCap=new Z(this._profile,.5,!0);break;case"round":{const e="quad"===l;this._startCap=new W({profile:this._profile,flip:!1,breakNormals:e,subdivisions:ye}),this._endCap=new W({profile:this._profile,flip:!0,breakNormals:e,subdivisions:ye});break}}const m=s(this.symbolLayer,"material","color"),d=this._getCombinedOpacityAndColor(m),f=b(d),u=d[3],g=u<1||this.needsDrivenTransparentPass,y={diffuse:f,ambient:f,opacity:u,transparent:g,hasVertexColors:!1,hasSlicePlane:this._context.slicePlaneEnabled,castShadows:this.symbolLayer.castShadows,cullFace:g||"none"===p?M.None:M.Back,offsetTransparentBackfaces:!0};if(!this._drivenProperties.size&&(o(this._intrinsicSize,t,r),!k(this._intrinsicSize[0])||!k(this._intrinsicSize[1])))throw new e("graphics3dpathsymbollayer:invalid-size","Symbol sizes may not be negative values");if(this._fastUpdates.enabled&&this._fastUpdates.visualVariables.size||n(this._intrinsicSize,this._intrinsicSize,1/this._context.renderCoordsHelper.unitInMeters),this._fastUpdates.enabled){const e={...y,...this._fastUpdates.materialParameters,size:h(this._intrinsicSize)};this._material=new ie(e)}else y.hasVertexColors=this._drivenProperties.color||this._drivenProperties.opacity,this._material=new re(y);this._material.setParameters({usePBR:this._context.physicalBasedRenderingEnabled,isSchematic:!0}),this._context.stage.add(this._material)}destroy(){super.destroy(),this._context.stage.remove(this._material),this._material=null}createGraphics3DGraphic(e){const t=e.graphic;if(!this._validateGeometry(t.geometry,se,this.symbolLayer.type))return null;const r=this.setGraphicElevationContext(t,new L),i=e.renderingInfo;return this._createAs3DShape(t,i,r,t.uid)}layerOpacityChanged(){const e=s(this.symbolLayer,"material","color"),t=this._getCombinedOpacity(e),r=t<1||this.needsDrivenTransparentPass;return this._material.setParameters({opacity:t,transparent:r}),!0}layerElevationInfoChanged(e,t){return this.updateGraphics3DGraphicElevationInfo(e,t,j)}slicePlaneEnabledChanged(){return this._material.setParameters({hasSlicePlane:this._context.slicePlaneEnabled}),!0}physicalBasedRenderingChanged(){return this._material.setParameters({usePBR:this._context.physicalBasedRenderingEnabled,isSchematic:!0}),!0}pixelRatioChanged(){return!0}applyRendererDiff(e,t){for(const r in e.diff){if("visualVariables"!==r)return F.Recreate_Symbol;if(!I(this._fastUpdates,t,this._vvConvertOptions))return F.Recreate_Symbol;this._material.setParameters(this._fastUpdates.materialParameters)}return F.Fast_Update}getVertexData(e){let t=0;const r=e.paths,s=[],a=e.spatialReference,o=this._context.elevationProvider.spatialReference,n=this._context.renderCoordsHelper.spatialReference;for(const i of r)t+=i.length;const l=new Float64Array(3*t),h=new Float64Array(3*t),c=new Float64Array(3*t);let p=0;for(const i of r){s.push({index:p,numVertices:i.length});for(const t of i)l[p++]=t[0],l[p++]=t[1],l[p++]=e.hasZ?t[2]:0}let m=!0;return i(o)&&!a.equals(o)?m=x(l,a,0,h,o,0,t):this._copyVertices(l,0,h,0,t),i(o)&&!o.equals(n)?x(h,o,0,c,n,0,t):this._copyVertices(h,0,c,0,t),{pathVertexDataInfos:s,vertexDataGS:l,vertexDataES:h,vertexDataRS:c,projectionSuccess:m,terrainElevation:0}}_copyVertices(e,t,r,i,s){t*=3,i*=3;for(let a=0;a<s;++a)r[i++]=e[t++],r[i++]=e[t++],r[i++]=e[t++]}_createAs3DShape(e,t,r,s){const a=e.geometry,o=new Array,n=new Array,l=new Array,h=a.spatialReference,p=w(),m=this._context.renderCoordsHelper;pe.spatialReference=h;const d=this.getVertexData(a);if(!d.projectionSuccess)return this.logger.warn("PathSymbol3DLayer geometry failed to be created (failed to project geometry to view spatial reference)"),null;if(d.pathVertexDataInfos.length>0){for(let a=0;a<d.pathVertexDataInfos.length;++a){const f=d.pathVertexDataInfos[a],u=f.index,g=f.numVertices;if(g<2)continue;if(i(this._context.clippingExtent)&&(S(p),R(p,d.vertexDataES,3*u,g),!D(p,this._context.clippingExtent)))continue;const y=[];for(let e=u;e<u+3*g;){const t=e++,i=e++,s=e++,a=new K;c(a.posGS,d.vertexDataGS[t],d.vertexDataGS[i],d.vertexDataGS[s]),c(a.posES,d.vertexDataES[t],d.vertexDataES[i],d.vertexDataES[s]);const o=C(a.posES,this._context.elevationProvider,r,m);c(me,d.vertexDataRS[t],d.vertexDataRS[i],d.vertexDataRS[s]),m.setAltitude(me,o),c(a.pos,me[0],me[1],me[2]),y.push(a)}const _=new Q(y);oe(_,this._upVectorAlignment,this._context.renderCoordsHelper);const b=new X(_,this._profile,this._extruder,this._startCap,this._endCap);let v=null;if(this._fastUpdates.enabled){const t=this._fastUpdates.visualVariables,r=t.size?E(t.size.field,e):0,i=t.color?E(t.color.field,e):0,s=t.opacity?E(t.opacity.field,e):0;v=new Y(b,r,i,s)}else{const e=[this._intrinsicSize[0],this._intrinsicSize[1]];this._drivenProperties.size&&(e[0]*=ne(t.size[0],"symbol-value"===t.size[2]?this.symbolLayer.height||0:t.size[2],this.symbolLayer.width||0),e[1]*=ne(t.size[2],"symbol-value"===t.size[0]?this.symbolLayer.width||0:t.size[0],this.symbolLayer.height||0));let r=null;this._drivenProperties.color&&(r=t.color),this._drivenProperties.opacity&&null!=t.opacity&&(r=r?[r[0],r[1],r[2],t.opacity]:[1,1,1,t.opacity]);const i=new $(b);i.bake(e),r&&i.bakeVertexColors(r),v=i}const{vertexAttributes:x,indices:w}=v.createGeometryData(),P=this._context.stage.renderView._getObjectAndLayerIdColor({graphicUid:s,layerUid:this._context.layer.uid}),j=new O(x,w,v,h,this._upVectorAlignment,this._stencilWidth,P);o.push(j),n.push(this._material),l.push(v.xform)}if(o.length>0){const e={layerUid:this._context.layer.uid,graphicUid:s},t=new B({geometries:o,materials:n,transformations:l,metadata:e}),i=new z(this,t,o,null,null,he,r);return i.alignedSampledElevation=d.terrainElevation,i.needsElevationUpdates=j(r.mode),i}}else 0!==a.paths.length&&a.paths.some((e=>e.length>0))||this.logger.warn("PathSymbol3DLayer geometry failed to be created (no paths were defined)");return null}}function oe(e,i,s){switch(i){case"world":for(const t of e.vertices)p(de,t.pos,e.offset),s.worldUpAtPosition(de,me),t.setFrameFromUpVector(me),t.computeRotationAxisAndAngleFromUpVector();break;case"path":p(de,e.vertices[0].pos,e.offset),s.worldUpAtPosition(de,me),ee(e,me);for(const i of e.vertices){const e=Math.sign(m(i.frame.right,i.vRight));d(i.rotationFrame.up,i.vRight,i.vLeft),f(i.rotationFrame.up,i.rotationFrame.up,e),u(i.rotationFrame.up,i.rotationFrame.up);const s=m(i.rotationFrame.up,i.frame.up),o=m(i.rotationFrame.up,i.frame.right);if(f(de,i.frame.up,-o),f(fe,i.frame.right,s),p(de,de,fe),u(i.rotationFrame.right,de),te(i.rotationRight,i.frame,i.rotationFrame.right),g(de,i.vLeft),i.rotationAngle=-e*(Math.PI-t(m(de,i.vRight))),Math.abs(i.rotationAngle)>0){const e=r(Math.cos(.5*i.rotationAngle));a(i.miterStretch,1+(e-1)*i.rotationRight[0]*i.rotationRight[0],(e-1)*i.rotationRight[0]*i.rotationRight[1],(e-1)*i.rotationRight[0]*i.rotationRight[1],1+(e-1)*i.rotationRight[1]*i.rotationRight[1])}const n=Math.PI-i.rotationAngle;i.maxStretchDistance=Math.abs(Math.min(i.vLeftLength,i.vRightLength)*r(Math.cos(.5*n)))}}}function ne(e,t,r){switch(e){case"symbol-value":return r;case"proportional":return t;default:return e}}function le(e,t,r,i){let s=0;for(const a of e.vertices)V(a.posES,r,t,i,ue),s+=ue.sampledElevation,p(me,a.pos,e.offset),i.setAltitude(me,ue.z),y(a.pos,me,e.offset);return e.updatePathVertexInformation(),s/e.vertices.length}function he(e,t,r,i){const s=e.stageObject,a=s.geometryRecords;let o=0;ce.spatialReference=i.spatialReference;for(const n of a){const e=n.geometry;if(!q(e))continue;const a=e.path,l=a.builder.path,h=e.geometrySR;pe.spatialReference=h,o+=le(l,t,r,i),"world"!==e.upVectorAlignment&&oe(l,e.upVectorAlignment,i),a.onPathChanged(),e.invalidateBoundingInfo(),s.geometryVertexAttrsUpdated(n)}return o/a.length}const ce=P(0,0,0,null),pe=P(0,0,0,null),me=v(),de=_(),fe=_(),ue=new A,ge=3,ye=3,_e=10;export{ae as Graphics3DPathSymbolLayer,_e as NUM_CIRCLE_PROFILE_SUBDIVISIONS,ye as NUM_ROUND_CAP_EXTRUSION_SUBDIVISIONS,ge as NUM_ROUND_JOIN_SUBDIVISIONS};
5
+ import e from"../../../../core/Error.js";import{acosClamped as t,reciprocalClamped as r}from"../../../../core/mathUtils.js";import{isSome as i,get as s}from"../../../../core/maybe.js";import{s as a}from"../../../../chunks/mat2.js";import{s as o,b as n}from"../../../../chunks/vec2.js";import{f as l,b as h}from"../../../../chunks/vec2f64.js";import{s as c,a as p,e as m,f as d,g as f,n as u,x as g,b as y}from"../../../../chunks/vec3.js";import{b as _}from"../../../../chunks/vec3f32.js";import{d as b,c as v}from"../../../../chunks/vec3f64.js";import{projectBuffer as x}from"../../../../geometry/projection.js";import{create as w,empty as S,expandWithBuffer as R,intersectsClippingArea as D}from"../../../../geometry/support/aaBoundingBox.js";import{makeDehydratedPoint as P}from"../../../../layers/graphics/dehydratedFeatures.js";import{needsElevationUpdates3D as j,evaluateElevationAlignmentAtPoint as C,SampleElevationInfo as A,evaluateElevationInfoAtPoint as V}from"./elevationAlignmentUtils.js";import{ElevationContext as L}from"./ElevationContext.js";import{Graphics3DObject3DGraphicLayer as z}from"./Graphics3DObject3DGraphicLayer.js";import{Graphics3DSymbolLayer as U,getAttributeValue as E}from"./Graphics3DSymbolLayer.js";import{isValidSize as k}from"./graphicUtils.js";import{ApplyRendererDiffResult as F}from"./interfaces.js";import{initFastSymbolUpdatesState as G,updateFastSymbolUpdatesState as I}from"../support/FastSymbolUpdates.js";import{CullFaceOptions as M}from"../../webgl-engine/lib/basicInterfaces.js";import{Object3D as B}from"../../webgl-engine/lib/Object3D.js";import{PathGeometry as O,isPathGeometry as q}from"../../webgl-engine/lib/PathGeometry.js";import{Profile as H,SimpleExtruder as T,MiterExtruder as N,RoundCapBuilder as W,TriangulationCapBuilder as Z,NoCapBuilder as J,PathVertex as K,Path as Q,Builder as X,FastUpdatePathGeometry as Y,StaticPathGeometry as $,computeMinimumRotationTangentFrame as ee,vertexSpaceToProfileSpace as te}from"../../webgl-engine/lib/pathGeometryUtils.js";import{DefaultMaterial as re}from"../../webgl-engine/materials/DefaultMaterial.js";import{PathMaterial as ie}from"../../webgl-engine/materials/PathMaterial.js";const se=["polyline"];class ae extends U{constructor(e,t,r,i){super(e,t,r,i),this._intrinsicSize=l(1,1),this._upVectorAlignment="path",this._stencilWidth=.1,this.ensureDrapedStatus(!1)}async doLoad(){const t=i(this.symbolLayer.width)?this.symbolLayer.width:this.symbolLayer.height,r=i(this.symbolLayer.height)?this.symbolLayer.height:t;this._vvConvertOptions={modelSize:[1,1,1],symbolSize:[t,1,r],unitInMeters:this._context.renderCoordsHelper.unitInMeters,transformation:{anchor:[0,0,0],scale:[1,1,1],rotation:[0,0,0]},supportedTypes:{size:!0,color:!0,opacity:!0,rotation:!1}},this._context.renderer&&this._context.renderer.visualVariables&&this._context.renderer.visualVariables.length>0?this._fastUpdates=G(this._context.renderer,this._vvConvertOptions):this._fastUpdates={enabled:!1};const a=this.symbolLayer.anchor||"center";this._upVectorAlignment="path","heading"===this.symbolLayer.profileRotation&&(this._upVectorAlignment="world");const l=this.symbolLayer.profile||"circle";switch(l){case"circle":default:this._profile=H.circle(_e);break;case"quad":this._profile=H.rect()}let c=[0,0];"center"!==a&&(c={left:[.5,0],right:[-.5,0],top:[0,-.5],bottom:[0,.5]}[a],this._profile.translate(c[0],c[1]));switch(this.symbolLayer.join||"simple"){case"round":this._extruder=new N(0,ge);break;case"bevel":this._extruder=new N(0,1);break;case"miter":this._extruder=new N(.8*Math.PI,1);break;default:this._extruder=new T}const p=this.symbolLayer.cap||"butt";switch(p){case"none":this._startCap=new J,this._endCap=new J;break;case"butt":default:this._startCap=new Z(this._profile,0),this._endCap=new Z(this._profile,0,!0);break;case"square":this._startCap=new Z(this._profile,-.5),this._endCap=new Z(this._profile,.5,!0);break;case"round":{const e="quad"===l;this._startCap=new W({profile:this._profile,flip:!1,breakNormals:e,subdivisions:ye}),this._endCap=new W({profile:this._profile,flip:!0,breakNormals:e,subdivisions:ye});break}}const m=s(this.symbolLayer,"material","color"),d=this._getCombinedOpacityAndColor(m),f=b(d),u=d[3],g=u<1||this.needsDrivenTransparentPass,y={diffuse:f,ambient:f,opacity:u,transparent:g,hasVertexColors:!1,hasSlicePlane:this._context.slicePlaneEnabled,castShadows:this.symbolLayer.castShadows,cullFace:g||"none"===p?M.None:M.Back,offsetTransparentBackfaces:!0};if(!this._drivenProperties.size&&(o(this._intrinsicSize,t,r),!k(this._intrinsicSize[0])||!k(this._intrinsicSize[1])))throw new e("graphics3dpathsymbollayer:invalid-size","Symbol sizes may not be negative values");if(this._fastUpdates.enabled&&this._fastUpdates.visualVariables.size||n(this._intrinsicSize,this._intrinsicSize,1/this._context.renderCoordsHelper.unitInMeters),this._fastUpdates.enabled){const e={...y,...this._fastUpdates.materialParameters,size:h(this._intrinsicSize)};this._material=new ie(e)}else y.hasVertexColors=this._drivenProperties.color||this._drivenProperties.opacity,this._material=new re(y);this._material.setParameters({usePBR:this._context.physicalBasedRenderingEnabled,isSchematic:!0}),this._context.stage.add(this._material)}destroy(){super.destroy(),this._context.stage.remove(this._material),this._material=null}createGraphics3DGraphic(e){const t=e.graphic;if(!this._validateGeometry(t.geometry,se,this.symbolLayer.type))return null;const r=this.setGraphicElevationContext(t,new L),i=e.renderingInfo;return this._createAs3DShape(t,i,r,t.uid)}layerOpacityChanged(){const e=s(this.symbolLayer,"material","color"),t=this._getCombinedOpacity(e),r=t<1||this.needsDrivenTransparentPass;return this._material.setParameters({opacity:t,transparent:r}),!0}layerElevationInfoChanged(e,t){return this.updateGraphics3DGraphicElevationInfo(e,t,j)}slicePlaneEnabledChanged(){return this._material.setParameters({hasSlicePlane:this._context.slicePlaneEnabled}),!0}physicalBasedRenderingChanged(){return this._material.setParameters({usePBR:this._context.physicalBasedRenderingEnabled,isSchematic:!0}),!0}pixelRatioChanged(){return!0}applyRendererDiff(e,t){for(const r in e.diff){if("visualVariables"!==r)return F.Recreate_Symbol;if(!I(this._fastUpdates,t,this._vvConvertOptions))return F.Recreate_Symbol;this._material.setParameters(this._fastUpdates.materialParameters)}return F.Fast_Update}getVertexData(e){let t=0;const r=e.paths,s=[],a=e.spatialReference,o=this._context.elevationProvider.spatialReference,n=this._context.renderCoordsHelper.spatialReference;for(const i of r)t+=i.length;const l=new Float64Array(3*t),h=new Float64Array(3*t),c=new Float64Array(3*t);let p=0;for(const i of r){s.push({index:p,numVertices:i.length});for(const t of i)l[p++]=t[0],l[p++]=t[1],l[p++]=e.hasZ?t[2]:0}let m=!0;return i(o)&&!a.equals(o)?m=x(l,a,0,h,o,0,t):this._copyVertices(l,0,h,0,t),i(o)&&!o.equals(n)?x(h,o,0,c,n,0,t):this._copyVertices(h,0,c,0,t),{pathVertexDataInfos:s,vertexDataGS:l,vertexDataES:h,vertexDataRS:c,projectionSuccess:m,terrainElevation:0}}_copyVertices(e,t,r,i,s){t*=3,i*=3;for(let a=0;a<s;++a)r[i++]=e[t++],r[i++]=e[t++],r[i++]=e[t++]}_createAs3DShape(e,t,r,s){const a=e.geometry,o=new Array,n=new Array,l=new Array,h=a.spatialReference,p=w(),m=this._context.renderCoordsHelper;pe.spatialReference=h;const d=this.getVertexData(a);if(!d.projectionSuccess)return this.logger.warn("PathSymbol3DLayer geometry failed to be created (failed to project geometry to view spatial reference)"),null;if(d.pathVertexDataInfos.length>0){for(let a=0;a<d.pathVertexDataInfos.length;++a){const f=d.pathVertexDataInfos[a],u=f.index,g=f.numVertices;if(g<2)continue;if(i(this._context.clippingExtent)&&(S(p),R(p,d.vertexDataES,3*u,g),!D(p,this._context.clippingExtent)))continue;const y=[];for(let e=u;e<u+3*g;){const t=e++,i=e++,s=e++,a=new K;c(a.posGS,d.vertexDataGS[t],d.vertexDataGS[i],d.vertexDataGS[s]),c(a.posES,d.vertexDataES[t],d.vertexDataES[i],d.vertexDataES[s]);const o=C(a.posES,this._context.elevationProvider,r,m);c(me,d.vertexDataRS[t],d.vertexDataRS[i],d.vertexDataRS[s]),m.setAltitude(me,o),c(a.pos,me[0],me[1],me[2]),y.push(a)}const _=new Q(y);oe(_,this._upVectorAlignment,this._context.renderCoordsHelper);const b=new X(_,this._profile,this._extruder,this._startCap,this._endCap);let v=null;if(this._fastUpdates.enabled){const t=this._fastUpdates.visualVariables,r=t.size?E(t.size.field,e):0,i=t.color?E(t.color.field,e):0,s=t.opacity?E(t.opacity.field,e):0;v=new Y(b,r,i,s)}else{const e=[this._intrinsicSize[0],this._intrinsicSize[1]];this._drivenProperties.size&&(e[0]*=ne(t.size[0],"symbol-value"===t.size[2]?this.symbolLayer.height||0:t.size[2],this.symbolLayer.width||0),e[1]*=ne(t.size[2],"symbol-value"===t.size[0]?this.symbolLayer.width||0:t.size[0],this.symbolLayer.height||0));let r=null;this._drivenProperties.color&&(r=t.color),this._drivenProperties.opacity&&null!=t.opacity&&(r=r?[r[0],r[1],r[2],t.opacity]:[1,1,1,t.opacity]);const i=new $(b);i.bake(e),r&&i.bakeVertexColors(r),v=i}const{vertexAttributes:x,indices:w}=v.createGeometryData(),P=this._context.stage.renderView._getObjectAndLayerIdColor({graphicUid:s,layerUid:this._context.layer.uid}),j=new O(x,w,v,h,this._upVectorAlignment,this._stencilWidth,P);o.push(j),n.push(this._material),l.push(v.xform)}if(o.length>0){const e={layerUid:this._context.layer.uid,graphicUid:s},t=new B({geometries:o,materials:n,transformations:l,metadata:e}),i=new z(this,t,o,null,null,he,r);return i.alignedSampledElevation=d.terrainElevation,i.needsElevationUpdates=j(r.mode),i}}else 0!==a.paths.length&&a.paths.some((e=>e.length>0))||this.logger.warn("PathSymbol3DLayer geometry failed to be created (no paths were defined)");return null}}function oe(e,i,s){switch(i){case"world":for(const t of e.vertices)p(de,t.pos,e.offset),s.worldUpAtPosition(de,me),t.setFrameFromUpVector(me),t.computeRotationAxisAndAngleFromUpVector();break;case"path":p(de,e.vertices[0].pos,e.offset),s.worldUpAtPosition(de,me),ee(e,me);for(const i of e.vertices){const e=Math.sign(m(i.frame.right,i.vRight));d(i.rotationFrame.up,i.vRight,i.vLeft),f(i.rotationFrame.up,i.rotationFrame.up,e),u(i.rotationFrame.up,i.rotationFrame.up);const s=m(i.rotationFrame.up,i.frame.up),o=m(i.rotationFrame.up,i.frame.right);if(f(de,i.frame.up,-o),f(fe,i.frame.right,s),p(de,de,fe),u(i.rotationFrame.right,de),te(i.rotationRight,i.frame,i.rotationFrame.right),g(de,i.vLeft),i.rotationAngle=-e*(Math.PI-t(m(de,i.vRight))),Math.abs(i.rotationAngle)>0){const e=r(Math.cos(.5*i.rotationAngle));a(i.miterStretch,1+(e-1)*i.rotationRight[0]*i.rotationRight[0],(e-1)*i.rotationRight[0]*i.rotationRight[1],(e-1)*i.rotationRight[0]*i.rotationRight[1],1+(e-1)*i.rotationRight[1]*i.rotationRight[1])}const n=Math.PI-i.rotationAngle;i.maxStretchDistance=Math.abs(Math.min(i.vLeftLength,i.vRightLength)*r(Math.cos(.5*n)))}}}function ne(e,t,r){switch(e){case"symbol-value":return r;case"proportional":return t;default:return e}}function le(e,t,r,i){let s=0;for(const a of e.vertices)V(a.posES,r,t,i,ue),s+=ue.sampledElevation,p(me,a.pos,e.offset),i.setAltitude(me,ue.z),y(a.pos,me,e.offset);return e.updatePathVertexInformation(),s/e.vertices.length}function he(e,t,r,i){const s=e.stageObject,a=s.geometryRecords;let o=0;ce.spatialReference=i.spatialReference;for(const n of a){const e=n.geometry;if(!q(e))continue;const a=e.path,l=a.builder.path,h=e.geometrySR;pe.spatialReference=h,o+=le(l,t,r,i),"world"!==e.upVectorAlignment&&oe(l,e.upVectorAlignment,i),a.onPathChanged(),e.invalidateBoundingInfo(),s.geometryVertexAttrsUpdated(n)}return o/a.length}const ce=P(0,0,0,null),pe=P(0,0,0,null),me=v(),de=_(),fe=_(),ue=new A,ge=3,ye=3,_e=10;export{ae as Graphics3DPathSymbolLayer,_e as NUM_CIRCLE_PROFILE_SUBDIVISIONS,ye as NUM_ROUND_CAP_EXTRUSION_SUBDIVISIONS,ge as NUM_ROUND_JOIN_SUBDIVISIONS};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.25/esri/copyright.txt for details.
4
4
  */
5
- import{isNone as o}from"../../../../core/maybe.js";import{throwIfAborted as e}from"../../../../core/promiseUtils.js";import{makeDehydratedPoint as r}from"../../../../layers/graphics/dehydratedFeatures.js";import{SampleElevationInfo as t,evaluateElevationInfoAtPoint as n}from"./elevationAlignmentUtils.js";import{ElevationContext as s}from"./ElevationContext.js";import{extractExpressionInfo as i,createContext as f}from"./featureExpressionInfoUtils.js";async function a(a,p,m,l,c){const{elevationProvider:u,renderCoordsHelper:d,spatialReference:j}=a,x=r(0,0,0,j),y=new t,v=new s,{elevationInfo:h}=p,I=i(h,!0),E=await f(I,j,c);e(c),v.setFromElevationInfo(h);const b=[];for(const{objectId:e,points:r}of l){const t="number"==typeof e?m(e):null;if(o(t))for(const o of r)b.push(o[2]);else{v.updateFeatureExpressionInfoContext(E,t.graphic,p);for(const{x:o,y:e,z:t}of r)x.x=o,x.y=e,x.z=t,n(x,u,v,d,y),b.push(y.z)}}return b}export{a as elevationAlignPointsInFeatures};
5
+ import{isNone as e}from"../../../../core/maybe.js";import{throwIfAborted as o}from"../../../../core/promiseUtils.js";import{makeDehydratedPoint as t}from"../../../../layers/graphics/dehydratedFeatures.js";import{SampleElevationInfo as r,evaluateElevationInfoAtPoint as n}from"./elevationAlignmentUtils.js";import{ElevationContext as s}from"./ElevationContext.js";import{extractExpressionInfo as i,createContext as a}from"./featureExpressionInfoUtils.js";async function f(f,p,l,m,c){const{elevationProvider:d,renderCoordsHelper:u,spatialReference:j}=f,v=t(0,0,0,j),x=new r,y=new s,{elevationInfo:I}=p,h=i(I,!0),b=await a(h,j,c);o(c),I&&y.setFromElevationInfo(I);const w=[],E=new Set;for(const{objectId:o,points:t}of m){const r="number"==typeof o?l(o):null;if(e(r)){for(const e of t)w.push(e[2]);E.add(o)}else{y.updateFeatureExpressionInfoContext(b,r.graphic,p);for(const{x:e,y:o,z:r}of t)v.x=e,v.y=o,v.z=r??0,n(v,d,y,u,x),w.push(x.z)}}return{elevations:w,failedObjectIds:E}}export{f as elevationAlignPointsInFeatures};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.25/esri/copyright.txt for details.
4
4
  */
5
- import{adjustStaticAGOUrl as e}from"../../../../core/devEnvironmentUtils.js";import{get as t,isSome as r,isNone as s}from"../../../../core/maybe.js";import{b as o}from"../../../../chunks/mat3.js";import{c as i}from"../../../../chunks/mat3f64.js";import{a}from"../../../../chunks/mat4.js";import{c as u}from"../../../../chunks/mat4f64.js";import{m as n,b as l,C as c,l as m,n as f,h as d}from"../../../../chunks/vec3.js";import{c as x}from"../../../../chunks/vec3f64.js";import{empty as p,expandWithVec3 as g}from"../../../../geometry/support/aaBoundingBox.js";import{BufferViewVec3f as h,BufferViewVec4f as b,BufferViewVec2f as T,BufferViewVec4u8 as R,BufferViewVec4u16 as v,BufferViewVec3u8 as M,BufferViewVec3u16 as B}from"../../../../geometry/support/buffer/BufferView.js";import{t as w,a as y,s as j}from"../../../../chunks/vec32.js";import{t as O,s as C}from"../../../../chunks/vec42.js";import{createBuffer as E}from"../../../../geometry/support/buffer/utils.js";import{DefaultLoadingContext as S}from"../../glTF/DefaultLoadingContext.js";import{load as A}from"../../glTF/loader.js";import{triangleFanToTriangles as N,triangleStripToTriangles as I,trianglesToTriangles as L}from"../../glTF/internal/indexUtils.js";import{getTransformMatrix as F}from"../../glTF/internal/TextureTransformUtils.js";import{load as k,processLoadResult as P}from"./wosrLoader.js";import{AlphaDiscardMode as V,DepthTestFunction as _,CullFaceOptions as G}from"../../webgl-engine/lib/basicInterfaces.js";import{Geometry as D}from"../../webgl-engine/lib/Geometry.js";import{Texture as z}from"../../webgl-engine/lib/Texture.js";import{VertexAttribute as U}from"../../webgl-engine/lib/VertexAttribute.js";import{DefaultMaterial as q}from"../../webgl-engine/materials/DefaultMaterial.js";import{COLOR_GAMMA as W}from"../../webgl-engine/materials/DefaultMaterial_COLOR_GAMMA.js";import{PrimitiveType as $}from"../../../webgl/enums.js";import{n as K}from"../../../../chunks/vec22.js";import{c as Q,f as H}from"../../../../chunks/vec43.js";import{c as J}from"../../../../chunks/vec33.js";async function X(s,o){const i=Y(e(s));if("wosr"===i.fileType){const e=await(o.cache?o.cache.loadWOSR(i.url,o):k(i.url,o)),t=P(e,o);return{lods:[t],referenceBoundingBox:t.boundingBox,isEsriSymbolResource:!1,isWosr:!0}}const a=await(o.cache?o.cache.loadGLTF(i.url,o,o.usePBR):A(new S(o.streamDataRequester),i.url,o,o.usePBR)),u=t(a.model.meta,"ESRI_proxyEllipsoid"),n=a.meta.isEsriSymbolResource&&r(u)&&a.meta.uri.includes("/RealisticTrees/");n&&!a.customMeta.esriTreeRendering&&(a.customMeta.esriTreeRendering=!0,re(a,u));const l=a.meta.isEsriSymbolResource?{usePBR:o.usePBR,isSchematic:!1,treeRendering:n,mrrFactors:[0,1,.2]}:{usePBR:o.usePBR,isSchematic:!1,treeRendering:!1,mrrFactors:[0,1,.5]},c={...o.materialParamsMixin,treeRendering:n};if(null!=i.specifiedLodIndex){const e=Z(a,l,c,i.specifiedLodIndex);let t=e[0].boundingBox;if(0!==i.specifiedLodIndex){t=Z(a,l,c,0)[0].boundingBox}return{lods:e,referenceBoundingBox:t,isEsriSymbolResource:a.meta.isEsriSymbolResource,isWosr:!1}}const m=Z(a,l,c);return{lods:m,referenceBoundingBox:m[0].boundingBox,isEsriSymbolResource:a.meta.isEsriSymbolResource,isWosr:!1}}function Y(e){const t=e.match(/(.*\.(gltf|glb))(\?lod=([0-9]+))?$/);if(t)return{fileType:"gltf",url:t[1],specifiedLodIndex:null!=t[4]?Number(t[4]):null};return e.match(/(.*\.(json|json\.gz))$/)?{fileType:"wosr",url:e,specifiedLodIndex:null}:{fileType:"unknown",url:e,specifiedLodIndex:null}}function Z(e,t,s,a){const u=e.model,n=i(),l=new Array,c=new Map,m=new Map;return u.lods.forEach(((e,i)=>{if(void 0!==a&&i!==a)return;const f={name:e.name,stageResources:{textures:new Array,materials:new Array,geometries:new Array},lodThreshold:r(e.lodThreshold)?e.lodThreshold:null,pivotOffset:[0,0,0],numberOfVertices:0,boundingBox:p()};l.push(f),e.parts.forEach((e=>{const i=e.material+(e.attributes.normal?"_normal":"")+(e.attributes.color?"_color":"")+(e.attributes.texCoord0?"_texCoord0":"")+(e.attributes.tangent?"_tangent":""),a=u.materials.get(e.material),l=r(e.attributes.texCoord0),d=r(e.attributes.normal),x=ee(a.alphaMode);if(!c.has(i)){if(l){if(r(a.textureColor)&&!m.has(a.textureColor)){const e=u.textures.get(a.textureColor),t={...e.parameters,preMultiplyAlpha:x!==V.Opaque};m.set(a.textureColor,new z(e.data,t))}if(r(a.textureNormal)&&!m.has(a.textureNormal)){const e=u.textures.get(a.textureNormal);m.set(a.textureNormal,new z(e.data,e.parameters))}if(r(a.textureOcclusion)&&!m.has(a.textureOcclusion)){const e=u.textures.get(a.textureOcclusion);m.set(a.textureOcclusion,new z(e.data,e.parameters))}if(r(a.textureEmissive)&&!m.has(a.textureEmissive)){const e=u.textures.get(a.textureEmissive);m.set(a.textureEmissive,new z(e.data,e.parameters))}if(r(a.textureMetallicRoughness)&&!m.has(a.textureMetallicRoughness)){const e=u.textures.get(a.textureMetallicRoughness);m.set(a.textureMetallicRoughness,new z(e.data,e.parameters))}}const o=a.color[0]**(1/W),n=a.color[1]**(1/W),f=a.color[2]**(1/W),p=a.emissiveFactor[0]**(1/W),g=a.emissiveFactor[1]**(1/W),h=a.emissiveFactor[2]**(1/W),b=r(a.textureColor)&&l?m.get(a.textureColor):null;c.set(i,new q({...t,transparent:x===V.Blend,customDepthTest:_.Lequal,textureAlphaMode:x,textureAlphaCutoff:a.alphaCutoff,diffuse:[o,n,f],ambient:[o,n,f],opacity:a.opacity,doubleSided:a.doubleSided,doubleSidedType:"winding-order",cullFace:a.doubleSided?G.None:G.Back,hasVertexColors:!!e.attributes.color,hasVertexTangents:!!e.attributes.tangent,normals:d?"default":"screenDerivative",castShadows:!0,receiveSSAO:!0,textureId:r(b)?b.id:void 0,colorMixMode:a.colorMixMode,normalTextureId:r(a.textureNormal)&&l?m.get(a.textureNormal).id:void 0,textureAlphaPremultiplied:r(b)&&!!b.params.preMultiplyAlpha,occlusionTextureId:r(a.textureOcclusion)&&l?m.get(a.textureOcclusion).id:void 0,emissiveTextureId:r(a.textureEmissive)&&l?m.get(a.textureEmissive).id:void 0,metallicRoughnessTextureId:r(a.textureMetallicRoughness)&&l?m.get(a.textureMetallicRoughness).id:void 0,emissiveFactor:[p,g,h],mrrFactors:[a.metallicFactor,a.roughnessFactor,t.mrrFactors[2]],isSchematic:!1,colorTextureTransformMatrix:F(a.colorTextureTransform),normalTextureTransformMatrix:F(a.normalTextureTransform),occlusionTextureTransformMatrix:F(a.occlusionTextureTransform),emissiveTextureTransformMatrix:F(a.emissiveTextureTransform),metallicRoughnessTextureTransformMatrix:F(a.metallicRoughnessTextureTransform),...s}))}const p=te(e.indices||e.attributes.position.count,e.primitiveType),S=e.attributes.position.count,A=E(h,S);w(A,e.attributes.position,e.transform);const N=[[U.POSITION,{data:A.typedBuffer,size:A.elementCount,exclusive:!0}]],I=[[U.POSITION,p]];if(r(e.attributes.normal)){const t=E(h,S);o(n,e.transform),y(t,e.attributes.normal,n),N.push([U.NORMAL,{data:t.typedBuffer,size:t.elementCount,exclusive:!0}]),I.push([U.NORMAL,p])}if(r(e.attributes.tangent)){const t=E(b,S);o(n,e.transform),O(t,e.attributes.tangent,n),N.push([U.TANGENT,{data:t.typedBuffer,size:t.elementCount,exclusive:!0}]),I.push([U.TANGENT,p])}if(r(e.attributes.texCoord0)){const t=E(T,S);K(t,e.attributes.texCoord0),N.push([U.UV0,{data:t.typedBuffer,size:t.elementCount,exclusive:!0}]),I.push([U.UV0,p])}if(r(e.attributes.color)){const t=E(R,S);if(4===e.attributes.color.elementCount)e.attributes.color instanceof b?C(t,e.attributes.color,255):e.attributes.color instanceof R?Q(t,e.attributes.color):e.attributes.color instanceof v&&C(t,e.attributes.color,1/256);else{H(t,255,255,255,255);const r=new M(t.buffer,0,4);e.attributes.color instanceof h?j(r,e.attributes.color,255):e.attributes.color instanceof M?J(r,e.attributes.color):e.attributes.color instanceof B&&j(r,e.attributes.color,1/256)}N.push([U.COLOR,{data:t.typedBuffer,size:t.elementCount,exclusive:!0}]),I.push([U.COLOR,p])}const L=new D(N,I);f.stageResources.geometries.push(L),f.stageResources.materials.push(c.get(i)),l&&(r(a.textureColor)&&f.stageResources.textures.push(m.get(a.textureColor)),r(a.textureNormal)&&f.stageResources.textures.push(m.get(a.textureNormal)),r(a.textureOcclusion)&&f.stageResources.textures.push(m.get(a.textureOcclusion)),r(a.textureEmissive)&&f.stageResources.textures.push(m.get(a.textureEmissive)),r(a.textureMetallicRoughness)&&f.stageResources.textures.push(m.get(a.textureMetallicRoughness))),f.numberOfVertices+=S;const k=L.boundingInfo;r(k)&&(g(f.boundingBox,k.getBBMin()),g(f.boundingBox,k.getBBMax()))}))})),l}function ee(e){switch(e){case"BLEND":return V.Blend;case"MASK":return V.Mask;case"OPAQUE":case null:case void 0:return V.Opaque}}function te(e,t){switch(t){case $.TRIANGLES:return L(e);case $.TRIANGLE_STRIP:return I(e);case $.TRIANGLE_FAN:return N(e)}}function re(e,t){for(let r=0;r<e.model.lods.length;++r){const o=e.model.lods[r];for(const i of o.parts){const o=i.attributes.normal;if(s(o))return;const p=i.attributes.position,g=p.count,b=x(),T=x(),v=x(),M=E(R,g),B=E(h,g),w=a(u(),i.transform);for(let s=0;s<g;s++){p.getVec(s,T),o.getVec(s,b),n(T,T,i.transform),l(v,T,t.center),c(v,v,t.radius);const a=v[2],u=m(v),x=Math.min(.45+.55*u*u,1);c(v,v,t.radius),n(v,v,w),f(v,v),r+1!==e.model.lods.length&&e.model.lods.length>1&&d(v,v,b,a>-1?.2:Math.min(-4*a-3.8,1)),B.setVec(s,v),M.set(s,0,255*x),M.set(s,1,255*x),M.set(s,2,255*x),M.set(s,3,255)}i.attributes.normal=B,i.attributes.color=M}}}export{X as fetch,Z as gltfToEngineResources,Y as parseUrl};
5
+ import{adjustStaticAGOUrl as e}from"../../../../core/devEnvironmentUtils.js";import{get as t,isSome as r,isNone as s}from"../../../../core/maybe.js";import{d as o}from"../../../../chunks/mat3.js";import{c as i}from"../../../../chunks/mat3f64.js";import{a}from"../../../../chunks/mat4.js";import{c as u}from"../../../../chunks/mat4f64.js";import{v as n,b as l,C as c,l as m,n as f,h as d}from"../../../../chunks/vec3.js";import{c as x}from"../../../../chunks/vec3f64.js";import{empty as p,expandWithVec3 as g}from"../../../../geometry/support/aaBoundingBox.js";import{BufferViewVec3f as h,BufferViewVec4f as b,BufferViewVec2f as T,BufferViewVec4u8 as R,BufferViewVec4u16 as v,BufferViewVec3u8 as M,BufferViewVec3u16 as B}from"../../../../geometry/support/buffer/BufferView.js";import{t as w,a as y,s as j}from"../../../../chunks/vec32.js";import{t as O,s as C}from"../../../../chunks/vec42.js";import{createBuffer as E}from"../../../../geometry/support/buffer/utils.js";import{DefaultLoadingContext as S}from"../../glTF/DefaultLoadingContext.js";import{load as A}from"../../glTF/loader.js";import{triangleFanToTriangles as N,triangleStripToTriangles as I,trianglesToTriangles as L}from"../../glTF/internal/indexUtils.js";import{getTransformMatrix as F}from"../../glTF/internal/TextureTransformUtils.js";import{load as k,processLoadResult as P}from"./wosrLoader.js";import{AlphaDiscardMode as V,DepthTestFunction as _,CullFaceOptions as G}from"../../webgl-engine/lib/basicInterfaces.js";import{Geometry as D}from"../../webgl-engine/lib/Geometry.js";import{Texture as z}from"../../webgl-engine/lib/Texture.js";import{VertexAttribute as U}from"../../webgl-engine/lib/VertexAttribute.js";import{DefaultMaterial as q}from"../../webgl-engine/materials/DefaultMaterial.js";import{COLOR_GAMMA as W}from"../../webgl-engine/materials/DefaultMaterial_COLOR_GAMMA.js";import{PrimitiveType as $}from"../../../webgl/enums.js";import{n as K}from"../../../../chunks/vec22.js";import{c as Q,f as H}from"../../../../chunks/vec43.js";import{c as J}from"../../../../chunks/vec33.js";async function X(s,o){const i=Y(e(s));if("wosr"===i.fileType){const e=await(o.cache?o.cache.loadWOSR(i.url,o):k(i.url,o)),t=P(e,o);return{lods:[t],referenceBoundingBox:t.boundingBox,isEsriSymbolResource:!1,isWosr:!0}}const a=await(o.cache?o.cache.loadGLTF(i.url,o,o.usePBR):A(new S(o.streamDataRequester),i.url,o,o.usePBR)),u=t(a.model.meta,"ESRI_proxyEllipsoid"),n=a.meta.isEsriSymbolResource&&r(u)&&a.meta.uri.includes("/RealisticTrees/");n&&!a.customMeta.esriTreeRendering&&(a.customMeta.esriTreeRendering=!0,re(a,u));const l=a.meta.isEsriSymbolResource?{usePBR:o.usePBR,isSchematic:!1,treeRendering:n,mrrFactors:[0,1,.2]}:{usePBR:o.usePBR,isSchematic:!1,treeRendering:!1,mrrFactors:[0,1,.5]},c={...o.materialParamsMixin,treeRendering:n};if(null!=i.specifiedLodIndex){const e=Z(a,l,c,i.specifiedLodIndex);let t=e[0].boundingBox;if(0!==i.specifiedLodIndex){t=Z(a,l,c,0)[0].boundingBox}return{lods:e,referenceBoundingBox:t,isEsriSymbolResource:a.meta.isEsriSymbolResource,isWosr:!1}}const m=Z(a,l,c);return{lods:m,referenceBoundingBox:m[0].boundingBox,isEsriSymbolResource:a.meta.isEsriSymbolResource,isWosr:!1}}function Y(e){const t=e.match(/(.*\.(gltf|glb))(\?lod=([0-9]+))?$/);if(t)return{fileType:"gltf",url:t[1],specifiedLodIndex:null!=t[4]?Number(t[4]):null};return e.match(/(.*\.(json|json\.gz))$/)?{fileType:"wosr",url:e,specifiedLodIndex:null}:{fileType:"unknown",url:e,specifiedLodIndex:null}}function Z(e,t,s,a){const u=e.model,n=i(),l=new Array,c=new Map,m=new Map;return u.lods.forEach(((e,i)=>{if(void 0!==a&&i!==a)return;const f={name:e.name,stageResources:{textures:new Array,materials:new Array,geometries:new Array},lodThreshold:r(e.lodThreshold)?e.lodThreshold:null,pivotOffset:[0,0,0],numberOfVertices:0,boundingBox:p()};l.push(f),e.parts.forEach((e=>{const i=e.material+(e.attributes.normal?"_normal":"")+(e.attributes.color?"_color":"")+(e.attributes.texCoord0?"_texCoord0":"")+(e.attributes.tangent?"_tangent":""),a=u.materials.get(e.material),l=r(e.attributes.texCoord0),d=r(e.attributes.normal),x=ee(a.alphaMode);if(!c.has(i)){if(l){if(r(a.textureColor)&&!m.has(a.textureColor)){const e=u.textures.get(a.textureColor),t={...e.parameters,preMultiplyAlpha:x!==V.Opaque};m.set(a.textureColor,new z(e.data,t))}if(r(a.textureNormal)&&!m.has(a.textureNormal)){const e=u.textures.get(a.textureNormal);m.set(a.textureNormal,new z(e.data,e.parameters))}if(r(a.textureOcclusion)&&!m.has(a.textureOcclusion)){const e=u.textures.get(a.textureOcclusion);m.set(a.textureOcclusion,new z(e.data,e.parameters))}if(r(a.textureEmissive)&&!m.has(a.textureEmissive)){const e=u.textures.get(a.textureEmissive);m.set(a.textureEmissive,new z(e.data,e.parameters))}if(r(a.textureMetallicRoughness)&&!m.has(a.textureMetallicRoughness)){const e=u.textures.get(a.textureMetallicRoughness);m.set(a.textureMetallicRoughness,new z(e.data,e.parameters))}}const o=a.color[0]**(1/W),n=a.color[1]**(1/W),f=a.color[2]**(1/W),p=a.emissiveFactor[0]**(1/W),g=a.emissiveFactor[1]**(1/W),h=a.emissiveFactor[2]**(1/W),b=r(a.textureColor)&&l?m.get(a.textureColor):null;c.set(i,new q({...t,transparent:x===V.Blend,customDepthTest:_.Lequal,textureAlphaMode:x,textureAlphaCutoff:a.alphaCutoff,diffuse:[o,n,f],ambient:[o,n,f],opacity:a.opacity,doubleSided:a.doubleSided,doubleSidedType:"winding-order",cullFace:a.doubleSided?G.None:G.Back,hasVertexColors:!!e.attributes.color,hasVertexTangents:!!e.attributes.tangent,normals:d?"default":"screenDerivative",castShadows:!0,receiveSSAO:!0,textureId:r(b)?b.id:void 0,colorMixMode:a.colorMixMode,normalTextureId:r(a.textureNormal)&&l?m.get(a.textureNormal).id:void 0,textureAlphaPremultiplied:r(b)&&!!b.params.preMultiplyAlpha,occlusionTextureId:r(a.textureOcclusion)&&l?m.get(a.textureOcclusion).id:void 0,emissiveTextureId:r(a.textureEmissive)&&l?m.get(a.textureEmissive).id:void 0,metallicRoughnessTextureId:r(a.textureMetallicRoughness)&&l?m.get(a.textureMetallicRoughness).id:void 0,emissiveFactor:[p,g,h],mrrFactors:[a.metallicFactor,a.roughnessFactor,t.mrrFactors[2]],isSchematic:!1,colorTextureTransformMatrix:F(a.colorTextureTransform),normalTextureTransformMatrix:F(a.normalTextureTransform),occlusionTextureTransformMatrix:F(a.occlusionTextureTransform),emissiveTextureTransformMatrix:F(a.emissiveTextureTransform),metallicRoughnessTextureTransformMatrix:F(a.metallicRoughnessTextureTransform),...s}))}const p=te(e.indices||e.attributes.position.count,e.primitiveType),S=e.attributes.position.count,A=E(h,S);w(A,e.attributes.position,e.transform);const N=[[U.POSITION,{data:A.typedBuffer,size:A.elementCount,exclusive:!0}]],I=[[U.POSITION,p]];if(r(e.attributes.normal)){const t=E(h,S);o(n,e.transform),y(t,e.attributes.normal,n),N.push([U.NORMAL,{data:t.typedBuffer,size:t.elementCount,exclusive:!0}]),I.push([U.NORMAL,p])}if(r(e.attributes.tangent)){const t=E(b,S);o(n,e.transform),O(t,e.attributes.tangent,n),N.push([U.TANGENT,{data:t.typedBuffer,size:t.elementCount,exclusive:!0}]),I.push([U.TANGENT,p])}if(r(e.attributes.texCoord0)){const t=E(T,S);K(t,e.attributes.texCoord0),N.push([U.UV0,{data:t.typedBuffer,size:t.elementCount,exclusive:!0}]),I.push([U.UV0,p])}if(r(e.attributes.color)){const t=E(R,S);if(4===e.attributes.color.elementCount)e.attributes.color instanceof b?C(t,e.attributes.color,255):e.attributes.color instanceof R?Q(t,e.attributes.color):e.attributes.color instanceof v&&C(t,e.attributes.color,1/256);else{H(t,255,255,255,255);const r=new M(t.buffer,0,4);e.attributes.color instanceof h?j(r,e.attributes.color,255):e.attributes.color instanceof M?J(r,e.attributes.color):e.attributes.color instanceof B&&j(r,e.attributes.color,1/256)}N.push([U.COLOR,{data:t.typedBuffer,size:t.elementCount,exclusive:!0}]),I.push([U.COLOR,p])}const L=new D(N,I);f.stageResources.geometries.push(L),f.stageResources.materials.push(c.get(i)),l&&(r(a.textureColor)&&f.stageResources.textures.push(m.get(a.textureColor)),r(a.textureNormal)&&f.stageResources.textures.push(m.get(a.textureNormal)),r(a.textureOcclusion)&&f.stageResources.textures.push(m.get(a.textureOcclusion)),r(a.textureEmissive)&&f.stageResources.textures.push(m.get(a.textureEmissive)),r(a.textureMetallicRoughness)&&f.stageResources.textures.push(m.get(a.textureMetallicRoughness))),f.numberOfVertices+=S;const k=L.boundingInfo;r(k)&&(g(f.boundingBox,k.getBBMin()),g(f.boundingBox,k.getBBMax()))}))})),l}function ee(e){switch(e){case"BLEND":return V.Blend;case"MASK":return V.Mask;case"OPAQUE":case null:case void 0:return V.Opaque}}function te(e,t){switch(t){case $.TRIANGLES:return L(e);case $.TRIANGLE_STRIP:return I(e);case $.TRIANGLE_FAN:return N(e)}}function re(e,t){for(let r=0;r<e.model.lods.length;++r){const o=e.model.lods[r];for(const i of o.parts){const o=i.attributes.normal;if(s(o))return;const p=i.attributes.position,g=p.count,b=x(),T=x(),v=x(),M=E(R,g),B=E(h,g),w=a(u(),i.transform);for(let s=0;s<g;s++){p.getVec(s,T),o.getVec(s,b),n(T,T,i.transform),l(v,T,t.center),c(v,v,t.radius);const a=v[2],u=m(v),x=Math.min(.45+.55*u*u,1);c(v,v,t.radius),n(v,v,w),f(v,v),r+1!==e.model.lods.length&&e.model.lods.length>1&&d(v,v,b,a>-1?.2:Math.min(-4*a-3.8,1)),B.setVec(s,v),M.set(s,0,255*x),M.set(s,1,255*x),M.set(s,2,255*x),M.set(s,3,255)}i.attributes.normal=B,i.attributes.color=M}}}export{X as fetch,Z as gltfToEngineResources,Y as parseUrl};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.25/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../chunks/tslib.es6.js";import t from"../../../../core/Accessor.js";import r from"../../../../core/Evented.js";import s from"../../../../core/Logger.js";import{isNone as i,isSome as o}from"../../../../core/maybe.js";import{property as n}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/arrayUtils.js";import"../../../../core/has.js";import"../../../../core/accessorSupport/ensureType.js";import{subclass as c}from"../../../../core/accessorSupport/decorators/subclass.js";import{D as a}from"../../../../chunks/mat4.js";import{c as l}from"../../../../chunks/mat4f64.js";import{m as p,c as h}from"../../../../chunks/vec3.js";import{c as m}from"../../../../chunks/vec3f64.js";import{empty as d,expand as f}from"../../../../geometry/support/aaBoundingRect.js";import{a as u,g as v}from"../../../../chunks/sphere.js";import{newIntersector as _}from"../../webgl-engine/lib/Intersector.js";import{StoreResults as g}from"../../webgl-engine/lib/IntersectorInterfaces.js";const x=d(),y=l(),j=m(),E=m(),b=m();let R=class extends(r.EventedMixin(t)){constructor(e){super(e),this._tmpEvent={spatialReference:null,extent:x,context:"scene"}}get spatialReference(){return this.view?.elevationProvider?.spatialReference}initialize(){this.view=this.layerView.view,this._renderCoordsHelper=this.view.renderCoordsHelper,this._intersector=_(this.view.state.viewingMode),this._intersector.options.store=g.MIN;const e=this.layerView.i3slayer.fullExtent;i(e)?s.getLogger(this.declaredClass).error("I3SElevationProvider expected fullExtent on I3SLayer."):(this._zmin=e.zmin,this._zmax=e.zmax),this._tmpEvent.context=this.intersectionHandler.isGround?"ground":"scene"}getElevation(e,t,r,i){if(j[0]=e,j[1]=t,j[2]=r,!this._renderCoordsHelper.toRenderCoords(j,i,j))return s.getLogger(this.declaredClass).error("could not project point to compute elevation"),null;const o=this.layerView.elevationOffset,n=this._zmin+o,c=this._zmax+o;return this._renderCoordsHelper.setAltitude(E,c,j),this._renderCoordsHelper.setAltitude(b,n,j),this._intersector.reset(E,b,null),this.intersectionHandler.intersect(this._intersector,null,E,b),this._intersector.results.min.getIntersectionPoint(j)?this._renderCoordsHelper.getAltitude(j):null}layerChanged(){this.spatialReference&&(this._tmpEvent.extent=this._computeLayerExtent(),this._tmpEvent.spatialReference=this.spatialReference,this.emit("elevation-change",this._tmpEvent))}objectChanged(e){this.spatialReference&&(this._tmpEvent.extent=this._computeObjectExtent(e),this._tmpEvent.spatialReference=this.spatialReference,this.emit("elevation-change",this._tmpEvent))}_computeObjectExtent(e){return d(x),this._expandExtent(e,x),x}_computeLayerExtent(){d(x);for(const e of this.layerView.getVisibleNodes())this._expandExtent(e,x);return x}_expandExtent(e,t){const r=this.spatialReference;if(i(r))return;const s=e.visibilityObb||e.serviceObbInRenderSR;if(o(s)){a(y,s.quaternion),y[12]=s.center[0],y[13]=s.center[1],y[14]=s.center[2];for(let e=0;e<8;++e)j[0]=1&e?s.halfSize[0]:-s.halfSize[0],j[1]=2&e?s.halfSize[1]:-s.halfSize[1],j[2]=4&e?s.halfSize[2]:-s.halfSize[2],p(j,j,y),this._renderCoordsHelper.fromRenderCoords(j,j,r),f(t,j,t)}else{const s=u(e.renderMbs),i=h(E,v(e.renderMbs));i[0]-=s,i[1]-=s,i[2]-=s;const o=h(b,v(e.renderMbs));o[0]+=s,o[1]+=s,o[2]+=s;for(let e=0;e<8;++e)j[0]=1&e?i[0]:o[0],j[1]=2&e?i[1]:o[1],j[2]=4&e?i[2]:o[2],this._renderCoordsHelper.fromRenderCoords(j,j,r),f(t,j,t)}}};e([n({constructOnly:!0})],R.prototype,"layerView",void 0),e([n({constructOnly:!0})],R.prototype,"intersectionHandler",void 0),e([n()],R.prototype,"view",void 0),e([n()],R.prototype,"spatialReference",null),R=e([c("esri.views.3d.layers.i3s.I3SElevationProvider")],R);const w=R;export{w as default};
5
+ import{_ as e}from"../../../../chunks/tslib.es6.js";import t from"../../../../core/Accessor.js";import r from"../../../../core/Evented.js";import s from"../../../../core/Logger.js";import{isNone as i,isSome as o}from"../../../../core/maybe.js";import{property as n}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/arrayUtils.js";import"../../../../core/has.js";import"../../../../core/accessorSupport/ensureType.js";import{subclass as c}from"../../../../core/accessorSupport/decorators/subclass.js";import{D as a}from"../../../../chunks/mat4.js";import{c as l}from"../../../../chunks/mat4f64.js";import{v as p,c as h}from"../../../../chunks/vec3.js";import{c as d}from"../../../../chunks/vec3f64.js";import{empty as m,expand as f}from"../../../../geometry/support/aaBoundingRect.js";import{a as u,g as v}from"../../../../chunks/sphere.js";import{newIntersector as _}from"../../webgl-engine/lib/Intersector.js";import{StoreResults as g}from"../../webgl-engine/lib/IntersectorInterfaces.js";const x=m(),y=l(),j=d(),E=d(),b=d();let R=class extends(r.EventedMixin(t)){constructor(e){super(e),this._tmpEvent={spatialReference:null,extent:x,context:"scene"}}get spatialReference(){return this.view?.elevationProvider?.spatialReference}initialize(){this.view=this.layerView.view,this._renderCoordsHelper=this.view.renderCoordsHelper,this._intersector=_(this.view.state.viewingMode),this._intersector.options.store=g.MIN;const e=this.layerView.i3slayer.fullExtent;i(e)?s.getLogger(this.declaredClass).error("I3SElevationProvider expected fullExtent on I3SLayer."):(this._zmin=e.zmin,this._zmax=e.zmax),this._tmpEvent.context=this.intersectionHandler.isGround?"ground":"scene"}getElevation(e,t,r,i){if(j[0]=e,j[1]=t,j[2]=r,!this._renderCoordsHelper.toRenderCoords(j,i,j))return s.getLogger(this.declaredClass).error("could not project point to compute elevation"),null;const o=this.layerView.elevationOffset,n=this._zmin+o,c=this._zmax+o;return this._renderCoordsHelper.setAltitude(E,c,j),this._renderCoordsHelper.setAltitude(b,n,j),this._intersector.reset(E,b,null),this.intersectionHandler.intersect(this._intersector,null,E,b),this._intersector.results.min.getIntersectionPoint(j)?this._renderCoordsHelper.getAltitude(j):null}layerChanged(){this.spatialReference&&(this._tmpEvent.extent=this._computeLayerExtent(),this._tmpEvent.spatialReference=this.spatialReference,this.emit("elevation-change",this._tmpEvent))}objectChanged(e){this.spatialReference&&(this._tmpEvent.extent=this._computeObjectExtent(e),this._tmpEvent.spatialReference=this.spatialReference,this.emit("elevation-change",this._tmpEvent))}_computeObjectExtent(e){return m(x),this._expandExtent(e,x),x}_computeLayerExtent(){m(x);for(const e of this.layerView.getVisibleNodes())this._expandExtent(e,x);return x}_expandExtent(e,t){const r=this.spatialReference;if(i(r))return;const s=e.visibilityObb||e.serviceObbInRenderSR;if(o(s)){a(y,s.quaternion),y[12]=s.center[0],y[13]=s.center[1],y[14]=s.center[2];for(let e=0;e<8;++e)j[0]=1&e?s.halfSize[0]:-s.halfSize[0],j[1]=2&e?s.halfSize[1]:-s.halfSize[1],j[2]=4&e?s.halfSize[2]:-s.halfSize[2],p(j,j,y),this._renderCoordsHelper.fromRenderCoords(j,j,r),f(t,j,t)}else{const s=u(e.renderMbs),i=h(E,v(e.renderMbs));i[0]-=s,i[1]-=s,i[2]-=s;const o=h(b,v(e.renderMbs));o[0]+=s,o[1]+=s,o[2]+=s;for(let e=0;e<8;++e)j[0]=1&e?i[0]:o[0],j[1]=2&e?i[1]:o[1],j[2]=4&e?i[2]:o[2],this._renderCoordsHelper.fromRenderCoords(j,j,r),f(t,j,t)}}};e([n({constructOnly:!0})],R.prototype,"layerView",void 0),e([n({constructOnly:!0})],R.prototype,"intersectionHandler",void 0),e([n()],R.prototype,"view",void 0),e([n()],R.prototype,"spatialReference",null),R=e([c("esri.views.3d.layers.i3s.I3SElevationProvider")],R);const w=R;export{w as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.25/esri/copyright.txt for details.
4
4
  */
5
- import{isSome as e,isNone as t,unwrap as i}from"../../../../core/maybe.js";import s from"../../../../core/PooledArray.js";import{isAbortError as n}from"../../../../core/promiseUtils.js";import{l as r}from"../../../../chunks/vec3.js";import{b as o}from"../../../../chunks/vec4f64.js";import{LodMetric as a,NodeBase as d,Node as l,ElevationRange as h,NodeFilterImpact as u,NodeIMModificationImpact as c,NodeTraversalState as _}from"./I3SNode.js";import{invalidateMbs as g,invalidateObb as m,addWraparound as f}from"./I3SUtil.js";import{clone as v}from"../../support/orientedBoundingBox.js";class b{constructor(e,t,i,s,n){this.childOffset=e,this.childCount=t,this.visibilityCache=i,this.ref=s,this.node=n,this.useAsHole=0,this.filterImpact=u.NotChecked}}class p{constructor(e,t,i,n,r,o,d,l,h,u,c,_,g,m){this._streamDataController=i,this._viewportQueries=n,this._logger=r,this.holeFilling=o,this._isLoaded=d,this._isReloading=l,this._isSelected=h,this._enable=u,this._needsUpdate=c,this._canRequest=_,this._computeVisibilityObb=g,this._computeNodeFiltering=m,this._dirty=!0,this._nodePages=[],this._nodeCount=0,this._nodesPerPage=0,this._rootIndex=0,this._lodMetric=a.None,this._lodConversion=e=>e,this._urlPrefix="",this._loading=new Set,this._failedNodes=new Set,this._failedPages=new Set,this._indexMissing=1,this._maxUnloadedPrio=Number.NEGATIVE_INFINITY,this._maxProcessingPrio=Number.POSITIVE_INFINITY,this._nodeTraversalState=new Map,this._version=I(0),this._visibilityCacheVersion=I(0),this._maxLevel=1,this._featureEstimate={estimate:0,leavesReached:!1},this._unloadedMemoryEstimate=0,this._missing=new s({deallocator:null}),this._prefetch=new s({deallocator:null}),this._updates=new N(this._missing),this._imModificationUncategorized=new s({deallocator:null}),this.ignoreServiceObb=!1,this.progressiveLoadPenalty=0,this._pageQueue=[],this.needNodeElevationRange=!1,this.layerHasModifications=!1,this._layerHasFilter=!1,this._logLayer=e,e.serviceUpdateTimeStamp&&e.serviceUpdateTimeStamp.lastUpdate&&(this._lastUpdate=`${e.serviceUpdateTimeStamp.lastUpdate}`),this._maxLodLevel=this._viewportQueries?this._viewportQueries.maxLodLevel:1,this._init(t)}_init(e){if("page"===e.type){switch(this._urlPrefix=e.urlPrefix,this._nodesPerPage=e.pageSize,this._rootIndex=e.rootIndex,e.lodMetric){case"maxScreenThreshold":this._lodMetric=a.MaxScreenThreshold;break;case"maxScreenThresholdSQ":this._lodMetric=a.MaxScreenThreshold,this._lodConversion=V}this._addPage(S(this._rootIndex,this._nodesPerPage),e.rootPage),this._updateParentsAndLevel()}else if("node"===e.type){this._urlPrefix=e.urlPrefix,this._nodePages.push({nodes:[],children:[],parents:[]}),this._makeRefNode(new d(e.rootNode.id,null),-1);const t=this._validateNode(e.rootNode.id,e.rootNode);t&&this._addNode(t,0)}}_loadPage(e){this._loading.add(e);const t=this._urlPrefix+e;this._streamDataController.request(t,"json").then((t=>{this._pageQueue.push({pageIndex:e,page:t})})).catch((t=>{this._loading.delete(e),n(t)||(this._failedPages.add(e),this._logger.error("#loadPage()",this._logLayer,`Error when loading page ${e}`,t))}))}_addQueuedPages(e){for(;this._pageQueue.length>0&&!e.done;){const{pageIndex:t,page:i}=this._pageQueue.shift();this._addPage(t,i),this._loading.delete(t),e.madeProgress()}this._updateParentsAndLevel()}_addPage(e,t){for(let r=this._nodePages.length;r<e;r++)this._nodePages[r]=null;const i=[],s=[],n=t.nodes.map(((t,n)=>{const a=i.length,d=t.children?t.children.length:0;s.push(-1);for(let e=0;e<d;e++)i.push(t.children[e]);const h=`${t.index}`,u=v(t.obb),c=o([u.center[0],u.center[1],u.center[2],r(u.halfSize)]),_=t.mesh&&t.mesh.attribute,g=t.mesh&&t.mesh.geometry,m=t.mesh&&t.mesh.material,f={hasSharedResource:!1,hasFeatureData:!!g,attributes:_&&null!=_.resource?`${_.resource}`:null,geometry:g&&null!=g.resource?`${g.resource}`:null,texture:m&&null!=m.resource?`${m.resource}`:null,geometryDefinition:g?g.definition:-1,materialDefinition:m?m.definition:-1},p=new l(h,e*this._nodesPerPage+n,c,d,0,f,this._lastUpdate,this._lodMetric,this._lodConversion(t.lodThreshold),g?g.featureCount:null);return p.serviceObb=u,p.visibilityObb=this._computeVisibilityObb(p),p.vertexCount=g?g.vertexCount:0,new b(a,d,x(this._visibilityCacheVersion),null,p)}));this._nodePages[e]={nodes:n,children:i,parents:s},this._nodeCount+=n.length}_updateParentsAndLevel(){const t=new Array,i=(i,s,n)=>{const r=this._getPage(i);if(e(r)){const o=R(i,this._nodesPerPage);r.parents[o]=s;const a=r.nodes[o].node;e(a)&&(a.level=n,t.push(i))}};for(i(this._rootIndex,-1,0);t.length;){const s=t.pop(),n=this.getNode(s);if(e(n))for(let e=0;e<n.childCount;e++){i(this.getChildIndex(n.index,e),s,n.level+1),this._maxLevel=Math.max(this._maxLevel,n.level+1)}}}_getPage(e){return this._nodePages[S(e,this._nodesPerPage)]}_getNodeInternal(e){const i=this._getPage(e);return t(i)?null:i.nodes[R(e,this._nodesPerPage)]}_addNode(t,s){null!=t.children&&this.populateChildren(s,t.children);const n=this.getParent(s),r=e(n)?n.level+1:0;this._maxLevel=Math.max(this._maxLevel,t.children?r+1:r);const{lodMetric:a,maxError:d}=E(t.lodSelection),h=i(this._getNodeInternal(s));return h.node=new l(t.id,s,o(t.mbs),h.childCount,r,t.resources,t.version,a,d,t.numFeatures),t.obb&&(h.node.serviceObb=v(t.obb)),h.node.visibilityObb=this._computeVisibilityObb(h.node),e(h.ref)&&(null==h.ref.mbs&&(h.ref.mbs=t.mbs),h.node.renderMbs=h.ref.renderMbs,h.node.serviceObbInRenderSR=h.ref.serviceObbInRenderSR,h.ref.visibilityObb=h.node.visibilityObb),h.node}_makeRefNode(e,t){const i=this._nodePages[0],s=i.nodes.length;return i.nodes.push(new b(0,0,x(this._visibilityCacheVersion),e,null)),this._nodeCount++,i.parents.push(t),g(e.renderMbs),m(e.serviceObbInRenderSR),s}populateChildren(e,t){const s=i(this._getNodeInternal(e)),n=i(this._getPage(e));s.childOffset=n.children.length,s.childCount=t.length;for(let i=0;i<t.length;i++){const s=this._makeRefNode(t[i],e);n.children.push(s)}}getNode(t){const i=this._getNodeInternal(t);return e(i)?i.node:null}getIndexById(t){let i;return this._forAllNodes(((s,n)=>{(e(s.node)&&s.node.id===t||e(s.ref)&&s.ref.id===t)&&(i=n)})),i}getNodeById(e){const t=this.getIndexById(e);return t>=0?this.getNode(t):null}getChildIndex(e,i){const s=this._getPage(e);if(t(s))return-1;const n=s.nodes[R(e,this._nodesPerPage)];return s.children[n.childOffset+i]}getParentIndex(t){const i=this._getPage(t);return e(i)?i.parents[R(t,this._nodesPerPage)]:-1}getParent(e){return(e=this.getParentIndex(e))>=0?this.getNode(e):null}isLeaf(t){const i=this._getNodeInternal(t);return e(i)&&0===i.childCount}get rootNode(){return this.getNode(this._rootIndex)}get size(){return this._nodeCount}removeAllGeometryObbs(){this._forAllNodes((t=>{e(t.node)&&(t.node.geometryObb=null)}))}invalidateVisibilityCache(){this._visibilityCacheVersion=I(this._visibilityCacheVersion)}invalidateNodeVisibilityCache(t){const i=this._getNodeInternal(t);e(i)&&this.invalidateNodeVisibilityCacheInternal(i)}invalidateNodeVisibilityCacheInternal(e){e.visibilityCache=x(this._visibilityCacheVersion)}invalidateBoundingVolumeCache(t){const i=this._getNodeInternal(t);e(i)&&(P(i),this.invalidateNodeVisibilityCacheInternal(i))}updateElevationChanged(i){const s=this._getNodeInternal(i);if(t(s))return;if(!this.needNodeElevationRange)return void this.invalidateBoundingVolumeCache(i);const n=e(s.node)?s.node:s.ref;if(t(n))return;const r=n.elevationRange;t(r)||(r.valid=!1)}invalidateGeometryVisibility(t){const i=this._getNodeInternal(t);e(i)&&e(i.node)&&(i.node.geometryObb=null,g(i.node.renderMbs),m(i.node.serviceObbInRenderSR))}invalidateVisibilityObbs(){t(this.rootNode)||this.traverse(this.rootNode,(e=>(e.visibilityObb=this._computeVisibilityObb(e),e.geometryObb=null,!0)))}_updateElevationRange(i){const s=this._getNodeInternal(i);if(t(s))return null;const n=e(s.node)?s.node:s.ref;if(t(n))return null;const r=n.elevationRange;if(e(r)&&r.valid)return r;const o=new h;let a=!1;for(let e=0;e<s.childCount;e++){const s=this._updateElevationRange(this.getChildIndex(i,e));t(s)?a=!0:(o.min=Math.min(o.min,s.min),o.max=Math.max(o.max,s.max))}if(0===s.childCount||a&&e(s.node)&&s.node.resources.geometry){const t=this._viewportQueries.getElevationRange(n);e(t)&&(o.min=Math.min(o.min,t.min),o.max=Math.max(o.max,t.max))}return e(r)&&r.min===o.min&&r.max===o.max?(r.valid=!0,r):(o.valid=!0,n.elevationRange=o,this.invalidateBoundingVolumeCache(i),o)}isNodeVisible(i){const s=this._getNodeInternal(i);if(t(s)||e(s.ref)&&!s.ref.mbs)return!0;if(this.needNodeElevationRange&&this._updateElevationRange(i),!w(s.visibilityCache,this._visibilityCacheVersion)){const i=s.node,n=e(i)&&(t(s.ref)||e(i.visibilityObb))?i:e(s.ref)?s.ref:null;if(this._layerHasFilter&&this._computeNodeFiltering&&(e(i)||e(s.ref))&&s.filterImpact===u.NotChecked){const t=e(i)?i.mbs:e(s.ref)?s.ref.mbs:null;s.filterImpact=null!=t?this._computeNodeFiltering(t):u.Unmodified}const r=e(i)&&s.filterImpact===u.Culled,o=!(e(i)&&i.imModificationImpact===c.Culled)&&(!n||this._viewportQueries.isNodeVisible(n))&&!r;return s.visibilityCache=C(o,this._visibilityCacheVersion),o}return M(s.visibilityCache)}isGeometryVisible(t){if(!this.isNodeVisible(t))return!1;const i=this._getNodeInternal(t);return!(e(i)&&e(i.node)&&e(i.node.geometryObb)&&(!this.layerHasModifications||i.node.imModificationImpact!==c.NotChecked))||this._viewportQueries.isGeometryVisible(i.node)}_traverseCoverage(s,n,r,o,a){const d=this._getPage(s);if(t(d)||0===n.childCount)return;const l=n.childOffset+n.childCount,h=new Array;for(let t=n.childOffset;t<l;++t){const i=d.children[t],s=this._getNodeInternal(i);e(s)&&e(s.node)&&this.isGeometryVisible(i)&&h.push(s)}o/=h.length;for(const e of h){const t=i(e.node).index;this._isLoaded(t)||this._isReloading(t)?(a.delta=Math.max(a.delta,r),a.coverage+=o):this._traverseCoverage(t,e,r+1,o,a)}}useNodeAsHole(e){if("off"===this.holeFilling)return!1;const i=this._getNodeInternal(e);if(t(i))return!1;if("always"===this.holeFilling)return!0;if(w(i.useAsHole,this._version))return M(i.useAsHole);const s={delta:0,coverage:0};this._traverseCoverage(e,i,0,1,s);const n=s.delta*s.coverage<=.5;return i.useAsHole=C(n,this._version),n}get maxLevel(){return this._maxLevel}get dirty(){return this._dirty}destroy(){this._updates.add.prune(),this._updates.update.prune()}requestUpdate(){this._dirty=!0,this._indexMissing=1,this._version=I(this._version)}imModificationsChanged(t){this.layerHasModifications=t,this._forAllNodes((({node:t})=>{e(t)&&(t.imModificationImpact=c.NotChecked,t.visibilityObb=this._computeVisibilityObb(t),t.hasModifications&&this.invalidateGeometryVisibility(t.index))})),this.invalidateVisibilityCache()}layerFilterChanged(t){this._layerHasFilter=t,this._forAllNodes((t=>{if(e(t)){t.filterImpact=u.NotChecked;const i=t.node;e(i)&&this.invalidateNodeVisibilityCache(i.index)}})),this.invalidateVisibilityCache()}update(s,n,r){if(!this._dirty)return;this._pageQueue.length>0&&this._addQueuedPages(n),this._maxUnloadedPrio=Number.NEGATIVE_INFINITY,this._maxProcessingPrio=Number.NEGATIVE_INFINITY,this._missing.clear(),this._prefetch.clear(),this._updates.reset(s),y.clear();let o=!0;const a=new O,d=new O,l=this._imModificationUncategorized;l.clear();const h=new Set,u=(u,_,g)=>{if(t(_)){let e=this._entryPriority(u);e===1/0&&(e=this._entryPriority(g));const t=S(u,this._nodesPerPage);return y.set(t,Math.max(e,y.get(t)||0)),this._loading.has(t)||this._failedPages.has(t)||this._missing.push(t),void(this._maxProcessingPrio=Math.max(this._maxProcessingPrio,e))}const m=_.node;if(this._updateNodeFeatureEstimate(m,d),t(m)){const e=this._entryPriority(u);return this._loading.has(u)||this._failedNodes.has(u)||(this._missing.push(u),y.set(u,e)),void(this._maxProcessingPrio=Math.max(this._maxProcessingPrio,e))}const f=i(this._getPage(u));if(0===this._missing.length&&0===this._nodesPerPage)for(let t=0;t<_.childCount;t++){const i=f.children[_.childOffset+t],s=this._getNodeInternal(i);!e(s)||s.node||this._loading.has(i)||this._failedNodes.has(i)||(y.set(i,this._entryPriority(i)),this._prefetch.push(i))}if(m.failed||!m.resources.hasFeatureData)return void(o&&_.childCount>0&&this._isSelected(m)&&(o=!1));if(h.add(m.id),this._isLoaded(u)){if(a.known+=m.memory,++a.knownNodes,this._isSelected(m)?_.childCount>0&&(o=!1):(a.unremoved+=m.memory,o=!1),this._needsUpdate(m)){const e=this._entryPriority(u);y.set(u,e),this._maxProcessingPrio=Math.max(this._maxProcessingPrio,e),this._updates.update.push(u)}return}if(m.memory&&(a.known+=m.memory,++a.knownNodes),!this._isSelected(m))return void(this._isReloading(u)&&this._updates.remove.push(u));if(_.childCount>0&&(o=!1),m.memory?(a.missing+=m.memory,a.known+=m.memory,++a.knownNodes):++a.missingNodes,s.includes(m.index))return this._maxProcessingPrio=Math.max(this._maxProcessingPrio,this._entryPriority(u)),void(this._updates.cancel=this._updates.cancel.filter((e=>e!==m.index)));if(!n.done&&this._enable(m))return void n.madeProgress();const v=this._entryPriority(u);y.set(u,v),this._maxProcessingPrio=Math.max(this._maxProcessingPrio,v),this._updates.add.push(u),this.layerHasModifications&&r&&e(m)&&m.imModificationImpact===c.NotChecked&&l.push(u)};this.traverseVisible(u);const _=this._updates.add;_.length>0&&this.layerHasModifications&&(l.length>0&&r(l),_.filterInPlace((e=>{const i=this._getNodeInternal(e),s=t(i)||t(i.node)||i.node.imModificationImpact!==c.Culled;return s||this.invalidateNodeVisibilityCache(e),s}))),this._unloadedMemoryEstimate=a.missing-a.unremoved,a.knownNodes>3&&a.missingNodes>0&&(this._unloadedMemoryEstimate+=a.known/a.knownNodes*a.missingNodes),this._unloadedMemoryEstimate=.8*Math.max(0,this._unloadedMemoryEstimate),this._featureEstimate.estimate=this._computeFeatureEstimate(d),this._featureEstimate.leavesReached=o,this._missing.sort(((e,t)=>e-t)),this._missing.filterInPlace(((e,t)=>t<1||this._missing.data[t-1]!==e)),this._missing.sort(((e,t)=>y.get(e)-y.get(t))),this._missing.length>0&&(this._maxUnloadedPrio=y.get(this._missing.back()),this._prefetch.clear()),this._updates.add.filterInPlace((e=>y.get(e)>=this._maxUnloadedPrio)).sort(((e,t)=>y.get(e)-y.get(t))),this._updates.update.sort(((e,t)=>y.get(e)-y.get(t))),this._indexMissing=this._loading.size+this._missing.length,this._dirty=this._indexMissing>0,y.clear()}checkFeatureTarget(e,t){const i=this._viewportQueries.updateScreenSpaceErrorBias(t);let s=t,n=t,r=i,o=10;for(;o--;){const i=new O;this._updateFeatureEstimate(s,i);if(this._computeFeatureEstimate(i)<=e){if(s>=t||i.missingNodes>0||0===o)break;r=s,s=.5*(s+n)}else n=s,s=.5*(s+r)}return this._version=I(this._version),this._viewportQueries.updateScreenSpaceErrorBias(i),Math.min(t,s)}_updateFeatureEstimate(t,i){this._version=I(this._version),this._viewportQueries.updateScreenSpaceErrorBias(t),this.traverseVisible(((t,s)=>this._updateNodeFeatureEstimate(e(s)&&s.node,i)))}_updateNodeFeatureEstimate(i,s){if(!(t(i)||i.failed||t(i.numFeatures)))return this._isLoaded(i.index)?(s.known+=i.numFeatures,++s.knownNodes,void(this._isSelected(i)||(s.unremoved+=i.numFeatures))):void(this._isSelected(i)&&(e(i.numFeatures)?(s.missing+=i.numFeatures,s.known+=i.numFeatures,++s.knownNodes):++s.missingNodes))}_computeFeatureEstimate(e){let t=e.known-e.unremoved;return e.knownNodes>3&&e.missingNodes>0&&(t+=e.known/e.knownNodes*e.missingNodes),Math.max(0,t)}load(){return this._load(this._missing)}prefetch(){return this._prefetch.sort(((e,t)=>y.get(e)-y.get(t))),this._load(this._prefetch)}_load(e){if(0===e.length||!this._canRequest())return!1;for(;e.length>0&&this._canRequest();)0===this._nodesPerPage?this._loadNode(e.pop()):this._loadPage(e.pop());return!0}get isLoading(){return this._indexMissing>0}get isPrefetching(){return this._prefetch.length>0}get indexLoading(){return this._loading.size}get indexMissing(){return this._indexMissing}get unloadedMemoryEstimate(){return this._unloadedMemoryEstimate}get updates(){return this._updates}get featureEstimate(){return this._featureEstimate}get maxPriority(){return Math.max(this._maxProcessingPrio,this._maxUnloadedPrio)}nodeTraversalState(e){if(t(e))return null;let i=this._nodeTraversalState.get(e.index);if(i&&w(i.version,this._version))return i;const s=this._viewportQueries.getLodLevel(e),n=this._viewportQueries.hasLOD(e);let r=!0;if(n){const t=this.getParentIndex(e.index);if(t>=0){const e=this._nodeTraversalState.get(t);r=e&&s>e.lodLevel}else r=s>0}else r=0===e.childCount;return i?(i.lodLevel=s,i.isChosen=r,i.version=C(!0,this._version),i):(i=new _(n,r,s,C(!0,this._version)),this._nodeTraversalState.set(e.index,i),i)}_loadNode(e){this._loading.add(e);const s=i(this._getNodeInternal(e)).ref;if(t(s))return void this._failedNodes.add(e);const r=s.id,o=this._urlPrefix+r,a=()=>{this._loading.delete(e),0===this._missing.length&&0===this._loading.size&&this.requestUpdate()};this._streamDataController.request(o,"json").then((t=>{a();const i=this._validateNode(r,t);if(null==i)return;i.obb&&this.invalidateNodeVisibilityCache(e);const s=this._addNode(i,e);this.nodeTraversalState(s)}),(t=>{a(),n(t)||(this._logger.error("#loadNode()",this._logLayer,"Error loading node: "+o),this._failedNodes.add(e))}))}_validateNode(e,t){if(null==t||"object"!=typeof t||t.id!==e)return this._logger.error("#validateNode()",this._logLayer,`Invalid node. Wrong type or wrong id "${e}"`),null;if(!Array.isArray(t.mbs))return this._logger.error("#validateNode()",this._logLayer,`Invalid bounding volume on node ${e}.`),null;t.sharedResource&&"./shared"!==t.sharedResource.href&&"./shared/"!==t.sharedResource.href&&this._logger.warn("#validateNode()",this._logLayer,`Invalid shared resource href on node "${e}"`),null==t.geometryData||Array.isArray(t.geometryData)&&1===t.geometryData.length&&"./geometries/0"===t.geometryData[0].href||this._logger.warn("#validateNode()",this._logLayer,`Invalid geometry data on node "${e}"`),null==t.attributeData||Array.isArray(t.attributeData)&&!t.attributeData.some(((e,t)=>e.href!==`./attributes/f_${t}/0`))||this._logger.warn("#validateNode()",this._logLayer,`Invalid attribute data on node "${e}"`),t.featureData&&t.featureData.length>1&&this._logger.warn("#validateNode()",this._logLayer,`Node ${e} has ${t.featureData.length} bundles. Only the first bundle will be loaded.`);const i=t.hasOwnProperty("obb")&&!this.ignoreServiceObb?t.obb:null,s=t.featureData&&1===t.featureData.length&&t.featureData[0].featureRange?t.featureData[0].featureRange[1]-t.featureData[0].featureRange[0]+1:null,n=t=>{if(null==t)return null;const i=t=>this._logger.error("#validateNode()",this._logLayer,`Invalid node reference on node ${e}: ${t}`);if("number"==typeof t.id)i(`id ${t.id} is a number instead of a string.`);else if("string"!=typeof t.id||!Array.isArray(t.mbs))return i("Missing or invalid id."),null;if(!Array.isArray(t.mbs))return i(`Invalid bounding volume on reference ${t.id}.`),null;t.href&&t.href!=="../"+t.id&&this._logger.error("#validateNode()",this._logLayer,`Invalid node href on node "${e}"`);const s=t.hasOwnProperty("obb")&&!this.ignoreServiceObb?t.obb:null,n=new d(`${t.id}`,t.mbs);return n.serviceObb=s,n.visibilityObb=this._computeVisibilityObb(n),n},r=Array.isArray(t.children)?t.children.map(n).filter((e=>null!=e)):null;return{id:e,mbs:t.mbs,obb:i,children:r,resources:{hasFeatureData:t.featureData&&t.featureData.length>0,hasSharedResource:null!=t.sharedResource,attributes:t.attributeData?e:null,texture:t.textureData&&t.textureData.length>0?e:null,geometry:null!=t.geometryData?e:null},version:"string"==typeof t.version?t.version:null,lodSelection:Array.isArray(t.lodSelection)?t.lodSelection:null,numFeatures:s}}resetFailedNodes(){this._failedNodes.clear(),this._failedPages.clear(),this._forAllNodes((t=>{e(t.node)&&(t.node.failed=!1)}))}_entryPriority(i){const s=this._getNodeInternal(i),n=this.getParentIndex(i);if(t(s)||n<0&&null==s.node)return n<0?1/0:this._entryPriority(n);let r=0;if(s.node&&n>=0){const e=this._nodeTraversalState.get(n);null!=e&&(r=e.lodLevel)}let o=this.progressiveLoadPenalty;for(let e=i;e>=0;e=this.getParentIndex(e))if(this._isLoaded(e)){o=0;break}const a=e(s.ref)?this._viewportQueries.distToPOI(s.ref):e(s.node)?this._viewportQueries.distToPOI(s.node):0;return-a-r*(a+this.progressiveLoadPenalty)+o}traverseVisible(e){const i=this._getNodeInternal(this._rootIndex);t(i)?e(this._rootIndex,null,null):this._traverseVisible(this._rootIndex,-1,i,e)}_traverseVisible(t,s,n,r){if(n.node&&0===n.childCount)return void(this.isGeometryVisible(t)&&r(t,n,s));if(!this.isNodeVisible(t))return;if(r(t,n,s),null==n.node)return;const o=this.nodeTraversalState(n.node);if(o.nodeHasLOD&&o.lodLevel===this._maxLodLevel)return;const a=i(this._getPage(t));for(let i=0;i<n.childCount;i++){const s=a.children[n.childOffset+i],o=this._getNodeInternal(s);e(o)?this._traverseVisible(s,t,o,r):r(s,null,t)}}traverse(e,t){t(e)&&this.traverseChildren(e,t)}traverseChildren(t,i){const s=t.index,n=this._getNodeInternal(s);e(n)&&this._traverseChildren(s,n,i)}_traverseChildren(i,s,n){const r=this._getPage(i);if(t(r))return;const o=s.childOffset+s.childCount;for(let t=s.childOffset;t<o;++t){const i=r.children[t],s=this._getNodeInternal(i);e(s)&&e(s.node)&&n(s.node)&&this._traverseChildren(i,s,n)}}updateChildrenLoaded(t,i){let s=this.getNode(t);for(;e(s);)s.childrenLoaded+=i,s=this.getParent(s.index)}checkChildrenLoadedInvariant(){if(t(this.rootNode))return!0;const e=[],i=t=>{let s=this._isLoaded(t.index)||this._isReloading(t.index)?1:0;return this.traverseChildren(t,(e=>(s+=i(e),!1))),t.childrenLoaded!==s&&e.push(t.index),s};return i(this.rootNode),e.length&&this._logger.error("childrenLoaded invariant broken at following nodes: "+e.join(",")),e.length>0}updateStats(e){if(this._updates.add.length>0&&(e.nodes+=" + "+this._updates.add.length),(this._indexMissing||this._prefetch.length>0)&&(e.index+=" + "+this._indexMissing||this._prefetch.length),e.prio=this._maxProcessingPrio,this._featureEstimate.estimate){const t=this._featureEstimate.estimate-e.features;t>0?e.features+=" + "+t:t<0&&(e.features+=" - "+-t)}}updateElevationInfo(e,t){this.needNodeElevationRange=t&&e&&("relative-to-ground"===e.mode||"on-the-ground"===e.mode),this._viewportQueries.updateElevationInfo(e),this.invalidateAllElevationRanges()}invalidateAllElevationRanges(){this._forAllNodes((t=>{P(t),e(t.node)&&(t.node.elevationRange=null),e(t.ref)&&(t.ref.elevationRange=null)}))}_forAllNodes(e){for(let t=0;t<this._nodePages.length;t++){const i=this._nodePages[t];if(i){const s=t*this._nodesPerPage;for(let t=0;t<i.nodes.length;t++)e(i.nodes[t],s+t)}}}get test(){return{addNode:(e,t)=>this._addNode(e,t)}}}const y=new Map;class N{constructor(e){this.missing=e,this.update=new s({deallocator:null}),this.add=new s({deallocator:null}),this.remove=new s({deallocator:null}),this.cancel=[]}reset(e){this.add.clear(),this.update.clear(),this.cancel=e}}function P(t){e(t.node)&&(g(t.node.renderMbs),m(t.node.serviceObbInRenderSR)),e(t.ref)&&(g(t.ref.renderMbs),m(t.ref.serviceObbInRenderSR))}function x(e){return f(e,-2)}function I(e){return f(e,2)}function C(e,t){return t+(e?1:0)}function w(e,t){return(-2&e)===t}function M(e){return 1==(1&e)}function S(e,t){return 0===t?0:e/t|0}function R(e,t){return 0===t?e:e%t}const L=[["maxScreenThreshold",a.MaxScreenThreshold],["screenSpaceRelative",a.ScreenSpaceRelative],["removedFeatureDiameter",a.RemovedFeatureDiameter],["distanceRangeFromDefaultCamera",a.DistanceRangeFromDefaultCamera]];function E(e){if(e)for(let t=0;t<e.length;t++)for(const i of L)if(i[0]===e[t].metricType)return{lodMetric:i[1],maxError:e[t].maxError};return{lodMetric:a.None,maxError:0}}class O{constructor(){this.known=0,this.knownNodes=0,this.missing=0,this.missingNodes=0,this.unremoved=0}}function V(e){return Math.sqrt(e*(4/Math.PI))}export{p as I3SIndex,E as selectErrorMetric};
5
+ import{isSome as e,isNone as t,unwrap as i}from"../../../../core/maybe.js";import s from"../../../../core/PooledArray.js";import{isAbortError as n}from"../../../../core/promiseUtils.js";import{l as r}from"../../../../chunks/vec3.js";import{a as o}from"../../../../chunks/vec4f64.js";import{LodMetric as a,NodeBase as d,Node as l,ElevationRange as h,NodeFilterImpact as u,NodeIMModificationImpact as c,NodeTraversalState as _}from"./I3SNode.js";import{invalidateMbs as g,invalidateObb as m,addWraparound as f}from"./I3SUtil.js";import{clone as v}from"../../support/orientedBoundingBox.js";class b{constructor(e,t,i,s,n){this.childOffset=e,this.childCount=t,this.visibilityCache=i,this.ref=s,this.node=n,this.useAsHole=0,this.filterImpact=u.NotChecked}}class p{constructor(e,t,i,n,r,o,d,l,h,u,c,_,g,m){this._streamDataController=i,this._viewportQueries=n,this._logger=r,this.holeFilling=o,this._isLoaded=d,this._isReloading=l,this._isSelected=h,this._enable=u,this._needsUpdate=c,this._canRequest=_,this._computeVisibilityObb=g,this._computeNodeFiltering=m,this._dirty=!0,this._nodePages=[],this._nodeCount=0,this._nodesPerPage=0,this._rootIndex=0,this._lodMetric=a.None,this._lodConversion=e=>e,this._urlPrefix="",this._loading=new Set,this._failedNodes=new Set,this._failedPages=new Set,this._indexMissing=1,this._maxUnloadedPrio=Number.NEGATIVE_INFINITY,this._maxProcessingPrio=Number.POSITIVE_INFINITY,this._nodeTraversalState=new Map,this._version=I(0),this._visibilityCacheVersion=I(0),this._maxLevel=1,this._featureEstimate={estimate:0,leavesReached:!1},this._unloadedMemoryEstimate=0,this._missing=new s({deallocator:null}),this._prefetch=new s({deallocator:null}),this._updates=new N(this._missing),this._imModificationUncategorized=new s({deallocator:null}),this.ignoreServiceObb=!1,this.progressiveLoadPenalty=0,this._pageQueue=[],this.needNodeElevationRange=!1,this.layerHasModifications=!1,this._layerHasFilter=!1,this._logLayer=e,e.serviceUpdateTimeStamp&&e.serviceUpdateTimeStamp.lastUpdate&&(this._lastUpdate=`${e.serviceUpdateTimeStamp.lastUpdate}`),this._maxLodLevel=this._viewportQueries?this._viewportQueries.maxLodLevel:1,this._init(t)}_init(e){if("page"===e.type){switch(this._urlPrefix=e.urlPrefix,this._nodesPerPage=e.pageSize,this._rootIndex=e.rootIndex,e.lodMetric){case"maxScreenThreshold":this._lodMetric=a.MaxScreenThreshold;break;case"maxScreenThresholdSQ":this._lodMetric=a.MaxScreenThreshold,this._lodConversion=V}this._addPage(S(this._rootIndex,this._nodesPerPage),e.rootPage),this._updateParentsAndLevel()}else if("node"===e.type){this._urlPrefix=e.urlPrefix,this._nodePages.push({nodes:[],children:[],parents:[]}),this._makeRefNode(new d(e.rootNode.id,null),-1);const t=this._validateNode(e.rootNode.id,e.rootNode);t&&this._addNode(t,0)}}_loadPage(e){this._loading.add(e);const t=this._urlPrefix+e;this._streamDataController.request(t,"json").then((t=>{this._pageQueue.push({pageIndex:e,page:t})})).catch((t=>{this._loading.delete(e),n(t)||(this._failedPages.add(e),this._logger.error("#loadPage()",this._logLayer,`Error when loading page ${e}`,t))}))}_addQueuedPages(e){for(;this._pageQueue.length>0&&!e.done;){const{pageIndex:t,page:i}=this._pageQueue.shift();this._addPage(t,i),this._loading.delete(t),e.madeProgress()}this._updateParentsAndLevel()}_addPage(e,t){for(let r=this._nodePages.length;r<e;r++)this._nodePages[r]=null;const i=[],s=[],n=t.nodes.map(((t,n)=>{const a=i.length,d=t.children?t.children.length:0;s.push(-1);for(let e=0;e<d;e++)i.push(t.children[e]);const h=`${t.index}`,u=v(t.obb),c=o([u.center[0],u.center[1],u.center[2],r(u.halfSize)]),_=t.mesh&&t.mesh.attribute,g=t.mesh&&t.mesh.geometry,m=t.mesh&&t.mesh.material,f={hasSharedResource:!1,hasFeatureData:!!g,attributes:_&&null!=_.resource?`${_.resource}`:null,geometry:g&&null!=g.resource?`${g.resource}`:null,texture:m&&null!=m.resource?`${m.resource}`:null,geometryDefinition:g?g.definition:-1,materialDefinition:m?m.definition:-1},p=new l(h,e*this._nodesPerPage+n,c,d,0,f,this._lastUpdate,this._lodMetric,this._lodConversion(t.lodThreshold),g?g.featureCount:null);return p.serviceObb=u,p.visibilityObb=this._computeVisibilityObb(p),p.vertexCount=g?g.vertexCount:0,new b(a,d,x(this._visibilityCacheVersion),null,p)}));this._nodePages[e]={nodes:n,children:i,parents:s},this._nodeCount+=n.length}_updateParentsAndLevel(){const t=new Array,i=(i,s,n)=>{const r=this._getPage(i);if(e(r)){const o=R(i,this._nodesPerPage);r.parents[o]=s;const a=r.nodes[o].node;e(a)&&(a.level=n,t.push(i))}};for(i(this._rootIndex,-1,0);t.length;){const s=t.pop(),n=this.getNode(s);if(e(n))for(let e=0;e<n.childCount;e++){i(this.getChildIndex(n.index,e),s,n.level+1),this._maxLevel=Math.max(this._maxLevel,n.level+1)}}}_getPage(e){return this._nodePages[S(e,this._nodesPerPage)]}_getNodeInternal(e){const i=this._getPage(e);return t(i)?null:i.nodes[R(e,this._nodesPerPage)]}_addNode(t,s){null!=t.children&&this.populateChildren(s,t.children);const n=this.getParent(s),r=e(n)?n.level+1:0;this._maxLevel=Math.max(this._maxLevel,t.children?r+1:r);const{lodMetric:a,maxError:d}=E(t.lodSelection),h=i(this._getNodeInternal(s));return h.node=new l(t.id,s,o(t.mbs),h.childCount,r,t.resources,t.version,a,d,t.numFeatures),t.obb&&(h.node.serviceObb=v(t.obb)),h.node.visibilityObb=this._computeVisibilityObb(h.node),e(h.ref)&&(null==h.ref.mbs&&(h.ref.mbs=t.mbs),h.node.renderMbs=h.ref.renderMbs,h.node.serviceObbInRenderSR=h.ref.serviceObbInRenderSR,h.ref.visibilityObb=h.node.visibilityObb),h.node}_makeRefNode(e,t){const i=this._nodePages[0],s=i.nodes.length;return i.nodes.push(new b(0,0,x(this._visibilityCacheVersion),e,null)),this._nodeCount++,i.parents.push(t),g(e.renderMbs),m(e.serviceObbInRenderSR),s}populateChildren(e,t){const s=i(this._getNodeInternal(e)),n=i(this._getPage(e));s.childOffset=n.children.length,s.childCount=t.length;for(let i=0;i<t.length;i++){const s=this._makeRefNode(t[i],e);n.children.push(s)}}getNode(t){const i=this._getNodeInternal(t);return e(i)?i.node:null}getIndexById(t){let i;return this._forAllNodes(((s,n)=>{(e(s.node)&&s.node.id===t||e(s.ref)&&s.ref.id===t)&&(i=n)})),i}getNodeById(e){const t=this.getIndexById(e);return t>=0?this.getNode(t):null}getChildIndex(e,i){const s=this._getPage(e);if(t(s))return-1;const n=s.nodes[R(e,this._nodesPerPage)];return s.children[n.childOffset+i]}getParentIndex(t){const i=this._getPage(t);return e(i)?i.parents[R(t,this._nodesPerPage)]:-1}getParent(e){return(e=this.getParentIndex(e))>=0?this.getNode(e):null}isLeaf(t){const i=this._getNodeInternal(t);return e(i)&&0===i.childCount}get rootNode(){return this.getNode(this._rootIndex)}get size(){return this._nodeCount}removeAllGeometryObbs(){this._forAllNodes((t=>{e(t.node)&&(t.node.geometryObb=null)}))}invalidateVisibilityCache(){this._visibilityCacheVersion=I(this._visibilityCacheVersion)}invalidateNodeVisibilityCache(t){const i=this._getNodeInternal(t);e(i)&&this.invalidateNodeVisibilityCacheInternal(i)}invalidateNodeVisibilityCacheInternal(e){e.visibilityCache=x(this._visibilityCacheVersion)}invalidateBoundingVolumeCache(t){const i=this._getNodeInternal(t);e(i)&&(P(i),this.invalidateNodeVisibilityCacheInternal(i))}updateElevationChanged(i){const s=this._getNodeInternal(i);if(t(s))return;if(!this.needNodeElevationRange)return void this.invalidateBoundingVolumeCache(i);const n=e(s.node)?s.node:s.ref;if(t(n))return;const r=n.elevationRange;t(r)||(r.valid=!1)}invalidateGeometryVisibility(t){const i=this._getNodeInternal(t);e(i)&&e(i.node)&&(i.node.geometryObb=null,g(i.node.renderMbs),m(i.node.serviceObbInRenderSR))}invalidateVisibilityObbs(){t(this.rootNode)||this.traverse(this.rootNode,(e=>(e.visibilityObb=this._computeVisibilityObb(e),e.geometryObb=null,!0)))}_updateElevationRange(i){const s=this._getNodeInternal(i);if(t(s))return null;const n=e(s.node)?s.node:s.ref;if(t(n))return null;const r=n.elevationRange;if(e(r)&&r.valid)return r;const o=new h;let a=!1;for(let e=0;e<s.childCount;e++){const s=this._updateElevationRange(this.getChildIndex(i,e));t(s)?a=!0:(o.min=Math.min(o.min,s.min),o.max=Math.max(o.max,s.max))}if(0===s.childCount||a&&e(s.node)&&s.node.resources.geometry){const t=this._viewportQueries.getElevationRange(n);e(t)&&(o.min=Math.min(o.min,t.min),o.max=Math.max(o.max,t.max))}return e(r)&&r.min===o.min&&r.max===o.max?(r.valid=!0,r):(o.valid=!0,n.elevationRange=o,this.invalidateBoundingVolumeCache(i),o)}isNodeVisible(i){const s=this._getNodeInternal(i);if(t(s)||e(s.ref)&&!s.ref.mbs)return!0;if(this.needNodeElevationRange&&this._updateElevationRange(i),!w(s.visibilityCache,this._visibilityCacheVersion)){const i=s.node,n=e(i)&&(t(s.ref)||e(i.visibilityObb))?i:e(s.ref)?s.ref:null;if(this._layerHasFilter&&this._computeNodeFiltering&&(e(i)||e(s.ref))&&s.filterImpact===u.NotChecked){const t=e(i)?i.mbs:e(s.ref)?s.ref.mbs:null;s.filterImpact=null!=t?this._computeNodeFiltering(t):u.Unmodified}const r=e(i)&&s.filterImpact===u.Culled,o=!(e(i)&&i.imModificationImpact===c.Culled)&&(!n||this._viewportQueries.isNodeVisible(n))&&!r;return s.visibilityCache=C(o,this._visibilityCacheVersion),o}return M(s.visibilityCache)}isGeometryVisible(t){if(!this.isNodeVisible(t))return!1;const i=this._getNodeInternal(t);return!(e(i)&&e(i.node)&&e(i.node.geometryObb)&&(!this.layerHasModifications||i.node.imModificationImpact!==c.NotChecked))||this._viewportQueries.isGeometryVisible(i.node)}_traverseCoverage(s,n,r,o,a){const d=this._getPage(s);if(t(d)||0===n.childCount)return;const l=n.childOffset+n.childCount,h=new Array;for(let t=n.childOffset;t<l;++t){const i=d.children[t],s=this._getNodeInternal(i);e(s)&&e(s.node)&&this.isGeometryVisible(i)&&h.push(s)}o/=h.length;for(const e of h){const t=i(e.node).index;this._isLoaded(t)||this._isReloading(t)?(a.delta=Math.max(a.delta,r),a.coverage+=o):this._traverseCoverage(t,e,r+1,o,a)}}useNodeAsHole(e){if("off"===this.holeFilling)return!1;const i=this._getNodeInternal(e);if(t(i))return!1;if("always"===this.holeFilling)return!0;if(w(i.useAsHole,this._version))return M(i.useAsHole);const s={delta:0,coverage:0};this._traverseCoverage(e,i,0,1,s);const n=s.delta*s.coverage<=.5;return i.useAsHole=C(n,this._version),n}get maxLevel(){return this._maxLevel}get dirty(){return this._dirty}destroy(){this._updates.add.prune(),this._updates.update.prune()}requestUpdate(){this._dirty=!0,this._indexMissing=1,this._version=I(this._version)}imModificationsChanged(t){this.layerHasModifications=t,this._forAllNodes((({node:t})=>{e(t)&&(t.imModificationImpact=c.NotChecked,t.visibilityObb=this._computeVisibilityObb(t),t.hasModifications&&this.invalidateGeometryVisibility(t.index))})),this.invalidateVisibilityCache()}layerFilterChanged(t){this._layerHasFilter=t,this._forAllNodes((t=>{if(e(t)){t.filterImpact=u.NotChecked;const i=t.node;e(i)&&this.invalidateNodeVisibilityCache(i.index)}})),this.invalidateVisibilityCache()}update(s,n,r){if(!this._dirty)return;this._pageQueue.length>0&&this._addQueuedPages(n),this._maxUnloadedPrio=Number.NEGATIVE_INFINITY,this._maxProcessingPrio=Number.NEGATIVE_INFINITY,this._missing.clear(),this._prefetch.clear(),this._updates.reset(s),y.clear();let o=!0;const a=new O,d=new O,l=this._imModificationUncategorized;l.clear();const h=new Set,u=(u,_,g)=>{if(t(_)){let e=this._entryPriority(u);e===1/0&&(e=this._entryPriority(g));const t=S(u,this._nodesPerPage);return y.set(t,Math.max(e,y.get(t)||0)),this._loading.has(t)||this._failedPages.has(t)||this._missing.push(t),void(this._maxProcessingPrio=Math.max(this._maxProcessingPrio,e))}const m=_.node;if(this._updateNodeFeatureEstimate(m,d),t(m)){const e=this._entryPriority(u);return this._loading.has(u)||this._failedNodes.has(u)||(this._missing.push(u),y.set(u,e)),void(this._maxProcessingPrio=Math.max(this._maxProcessingPrio,e))}const f=i(this._getPage(u));if(0===this._missing.length&&0===this._nodesPerPage)for(let t=0;t<_.childCount;t++){const i=f.children[_.childOffset+t],s=this._getNodeInternal(i);!e(s)||s.node||this._loading.has(i)||this._failedNodes.has(i)||(y.set(i,this._entryPriority(i)),this._prefetch.push(i))}if(m.failed||!m.resources.hasFeatureData)return void(o&&_.childCount>0&&this._isSelected(m)&&(o=!1));if(h.add(m.id),this._isLoaded(u)){if(a.known+=m.memory,++a.knownNodes,this._isSelected(m)?_.childCount>0&&(o=!1):(a.unremoved+=m.memory,o=!1),this._needsUpdate(m)){const e=this._entryPriority(u);y.set(u,e),this._maxProcessingPrio=Math.max(this._maxProcessingPrio,e),this._updates.update.push(u)}return}if(m.memory&&(a.known+=m.memory,++a.knownNodes),!this._isSelected(m))return void(this._isReloading(u)&&this._updates.remove.push(u));if(_.childCount>0&&(o=!1),m.memory?(a.missing+=m.memory,a.known+=m.memory,++a.knownNodes):++a.missingNodes,s.includes(m.index))return this._maxProcessingPrio=Math.max(this._maxProcessingPrio,this._entryPriority(u)),void(this._updates.cancel=this._updates.cancel.filter((e=>e!==m.index)));if(!n.done&&this._enable(m))return void n.madeProgress();const v=this._entryPriority(u);y.set(u,v),this._maxProcessingPrio=Math.max(this._maxProcessingPrio,v),this._updates.add.push(u),this.layerHasModifications&&r&&e(m)&&m.imModificationImpact===c.NotChecked&&l.push(u)};this.traverseVisible(u);const _=this._updates.add;_.length>0&&this.layerHasModifications&&(l.length>0&&r(l),_.filterInPlace((e=>{const i=this._getNodeInternal(e),s=t(i)||t(i.node)||i.node.imModificationImpact!==c.Culled;return s||this.invalidateNodeVisibilityCache(e),s}))),this._unloadedMemoryEstimate=a.missing-a.unremoved,a.knownNodes>3&&a.missingNodes>0&&(this._unloadedMemoryEstimate+=a.known/a.knownNodes*a.missingNodes),this._unloadedMemoryEstimate=.8*Math.max(0,this._unloadedMemoryEstimate),this._featureEstimate.estimate=this._computeFeatureEstimate(d),this._featureEstimate.leavesReached=o,this._missing.sort(((e,t)=>e-t)),this._missing.filterInPlace(((e,t)=>t<1||this._missing.data[t-1]!==e)),this._missing.sort(((e,t)=>y.get(e)-y.get(t))),this._missing.length>0&&(this._maxUnloadedPrio=y.get(this._missing.back()),this._prefetch.clear()),this._updates.add.filterInPlace((e=>y.get(e)>=this._maxUnloadedPrio)).sort(((e,t)=>y.get(e)-y.get(t))),this._updates.update.sort(((e,t)=>y.get(e)-y.get(t))),this._indexMissing=this._loading.size+this._missing.length,this._dirty=this._indexMissing>0,y.clear()}checkFeatureTarget(e,t){const i=this._viewportQueries.updateScreenSpaceErrorBias(t);let s=t,n=t,r=i,o=10;for(;o--;){const i=new O;this._updateFeatureEstimate(s,i);if(this._computeFeatureEstimate(i)<=e){if(s>=t||i.missingNodes>0||0===o)break;r=s,s=.5*(s+n)}else n=s,s=.5*(s+r)}return this._version=I(this._version),this._viewportQueries.updateScreenSpaceErrorBias(i),Math.min(t,s)}_updateFeatureEstimate(t,i){this._version=I(this._version),this._viewportQueries.updateScreenSpaceErrorBias(t),this.traverseVisible(((t,s)=>this._updateNodeFeatureEstimate(e(s)&&s.node,i)))}_updateNodeFeatureEstimate(i,s){if(!(t(i)||i.failed||t(i.numFeatures)))return this._isLoaded(i.index)?(s.known+=i.numFeatures,++s.knownNodes,void(this._isSelected(i)||(s.unremoved+=i.numFeatures))):void(this._isSelected(i)&&(e(i.numFeatures)?(s.missing+=i.numFeatures,s.known+=i.numFeatures,++s.knownNodes):++s.missingNodes))}_computeFeatureEstimate(e){let t=e.known-e.unremoved;return e.knownNodes>3&&e.missingNodes>0&&(t+=e.known/e.knownNodes*e.missingNodes),Math.max(0,t)}load(){return this._load(this._missing)}prefetch(){return this._prefetch.sort(((e,t)=>y.get(e)-y.get(t))),this._load(this._prefetch)}_load(e){if(0===e.length||!this._canRequest())return!1;for(;e.length>0&&this._canRequest();)0===this._nodesPerPage?this._loadNode(e.pop()):this._loadPage(e.pop());return!0}get isLoading(){return this._indexMissing>0}get isPrefetching(){return this._prefetch.length>0}get indexLoading(){return this._loading.size}get indexMissing(){return this._indexMissing}get unloadedMemoryEstimate(){return this._unloadedMemoryEstimate}get updates(){return this._updates}get featureEstimate(){return this._featureEstimate}get maxPriority(){return Math.max(this._maxProcessingPrio,this._maxUnloadedPrio)}nodeTraversalState(e){if(t(e))return null;let i=this._nodeTraversalState.get(e.index);if(i&&w(i.version,this._version))return i;const s=this._viewportQueries.getLodLevel(e),n=this._viewportQueries.hasLOD(e);let r=!0;if(n){const t=this.getParentIndex(e.index);if(t>=0){const e=this._nodeTraversalState.get(t);r=e&&s>e.lodLevel}else r=s>0}else r=0===e.childCount;return i?(i.lodLevel=s,i.isChosen=r,i.version=C(!0,this._version),i):(i=new _(n,r,s,C(!0,this._version)),this._nodeTraversalState.set(e.index,i),i)}_loadNode(e){this._loading.add(e);const s=i(this._getNodeInternal(e)).ref;if(t(s))return void this._failedNodes.add(e);const r=s.id,o=this._urlPrefix+r,a=()=>{this._loading.delete(e),0===this._missing.length&&0===this._loading.size&&this.requestUpdate()};this._streamDataController.request(o,"json").then((t=>{a();const i=this._validateNode(r,t);if(null==i)return;i.obb&&this.invalidateNodeVisibilityCache(e);const s=this._addNode(i,e);this.nodeTraversalState(s)}),(t=>{a(),n(t)||(this._logger.error("#loadNode()",this._logLayer,"Error loading node: "+o),this._failedNodes.add(e))}))}_validateNode(e,t){if(null==t||"object"!=typeof t||t.id!==e)return this._logger.error("#validateNode()",this._logLayer,`Invalid node. Wrong type or wrong id "${e}"`),null;if(!Array.isArray(t.mbs))return this._logger.error("#validateNode()",this._logLayer,`Invalid bounding volume on node ${e}.`),null;t.sharedResource&&"./shared"!==t.sharedResource.href&&"./shared/"!==t.sharedResource.href&&this._logger.warn("#validateNode()",this._logLayer,`Invalid shared resource href on node "${e}"`),null==t.geometryData||Array.isArray(t.geometryData)&&1===t.geometryData.length&&"./geometries/0"===t.geometryData[0].href||this._logger.warn("#validateNode()",this._logLayer,`Invalid geometry data on node "${e}"`),null==t.attributeData||Array.isArray(t.attributeData)&&!t.attributeData.some(((e,t)=>e.href!==`./attributes/f_${t}/0`))||this._logger.warn("#validateNode()",this._logLayer,`Invalid attribute data on node "${e}"`),t.featureData&&t.featureData.length>1&&this._logger.warn("#validateNode()",this._logLayer,`Node ${e} has ${t.featureData.length} bundles. Only the first bundle will be loaded.`);const i=t.hasOwnProperty("obb")&&!this.ignoreServiceObb?t.obb:null,s=t.featureData&&1===t.featureData.length&&t.featureData[0].featureRange?t.featureData[0].featureRange[1]-t.featureData[0].featureRange[0]+1:null,n=t=>{if(null==t)return null;const i=t=>this._logger.error("#validateNode()",this._logLayer,`Invalid node reference on node ${e}: ${t}`);if("number"==typeof t.id)i(`id ${t.id} is a number instead of a string.`);else if("string"!=typeof t.id||!Array.isArray(t.mbs))return i("Missing or invalid id."),null;if(!Array.isArray(t.mbs))return i(`Invalid bounding volume on reference ${t.id}.`),null;t.href&&t.href!=="../"+t.id&&this._logger.error("#validateNode()",this._logLayer,`Invalid node href on node "${e}"`);const s=t.hasOwnProperty("obb")&&!this.ignoreServiceObb?t.obb:null,n=new d(`${t.id}`,t.mbs);return n.serviceObb=s,n.visibilityObb=this._computeVisibilityObb(n),n},r=Array.isArray(t.children)?t.children.map(n).filter((e=>null!=e)):null;return{id:e,mbs:t.mbs,obb:i,children:r,resources:{hasFeatureData:t.featureData&&t.featureData.length>0,hasSharedResource:null!=t.sharedResource,attributes:t.attributeData?e:null,texture:t.textureData&&t.textureData.length>0?e:null,geometry:null!=t.geometryData?e:null},version:"string"==typeof t.version?t.version:null,lodSelection:Array.isArray(t.lodSelection)?t.lodSelection:null,numFeatures:s}}resetFailedNodes(){this._failedNodes.clear(),this._failedPages.clear(),this._forAllNodes((t=>{e(t.node)&&(t.node.failed=!1)}))}_entryPriority(i){const s=this._getNodeInternal(i),n=this.getParentIndex(i);if(t(s)||n<0&&null==s.node)return n<0?1/0:this._entryPriority(n);let r=0;if(s.node&&n>=0){const e=this._nodeTraversalState.get(n);null!=e&&(r=e.lodLevel)}let o=this.progressiveLoadPenalty;for(let e=i;e>=0;e=this.getParentIndex(e))if(this._isLoaded(e)){o=0;break}const a=e(s.ref)?this._viewportQueries.distToPOI(s.ref):e(s.node)?this._viewportQueries.distToPOI(s.node):0;return-a-r*(a+this.progressiveLoadPenalty)+o}traverseVisible(e){const i=this._getNodeInternal(this._rootIndex);t(i)?e(this._rootIndex,null,null):this._traverseVisible(this._rootIndex,-1,i,e)}_traverseVisible(t,s,n,r){if(n.node&&0===n.childCount)return void(this.isGeometryVisible(t)&&r(t,n,s));if(!this.isNodeVisible(t))return;if(r(t,n,s),null==n.node)return;const o=this.nodeTraversalState(n.node);if(o.nodeHasLOD&&o.lodLevel===this._maxLodLevel)return;const a=i(this._getPage(t));for(let i=0;i<n.childCount;i++){const s=a.children[n.childOffset+i],o=this._getNodeInternal(s);e(o)?this._traverseVisible(s,t,o,r):r(s,null,t)}}traverse(e,t){t(e)&&this.traverseChildren(e,t)}traverseChildren(t,i){const s=t.index,n=this._getNodeInternal(s);e(n)&&this._traverseChildren(s,n,i)}_traverseChildren(i,s,n){const r=this._getPage(i);if(t(r))return;const o=s.childOffset+s.childCount;for(let t=s.childOffset;t<o;++t){const i=r.children[t],s=this._getNodeInternal(i);e(s)&&e(s.node)&&n(s.node)&&this._traverseChildren(i,s,n)}}updateChildrenLoaded(t,i){let s=this.getNode(t);for(;e(s);)s.childrenLoaded+=i,s=this.getParent(s.index)}checkChildrenLoadedInvariant(){if(t(this.rootNode))return!0;const e=[],i=t=>{let s=this._isLoaded(t.index)||this._isReloading(t.index)?1:0;return this.traverseChildren(t,(e=>(s+=i(e),!1))),t.childrenLoaded!==s&&e.push(t.index),s};return i(this.rootNode),e.length&&this._logger.error("childrenLoaded invariant broken at following nodes: "+e.join(",")),e.length>0}updateStats(e){if(this._updates.add.length>0&&(e.nodes+=" + "+this._updates.add.length),(this._indexMissing||this._prefetch.length>0)&&(e.index+=" + "+this._indexMissing||this._prefetch.length),e.prio=this._maxProcessingPrio,this._featureEstimate.estimate){const t=this._featureEstimate.estimate-e.features;t>0?e.features+=" + "+t:t<0&&(e.features+=" - "+-t)}}updateElevationInfo(e,t){this.needNodeElevationRange=t&&e&&("relative-to-ground"===e.mode||"on-the-ground"===e.mode),this._viewportQueries.updateElevationInfo(e),this.invalidateAllElevationRanges()}invalidateAllElevationRanges(){this._forAllNodes((t=>{P(t),e(t.node)&&(t.node.elevationRange=null),e(t.ref)&&(t.ref.elevationRange=null)}))}_forAllNodes(e){for(let t=0;t<this._nodePages.length;t++){const i=this._nodePages[t];if(i){const s=t*this._nodesPerPage;for(let t=0;t<i.nodes.length;t++)e(i.nodes[t],s+t)}}}get test(){return{addNode:(e,t)=>this._addNode(e,t)}}}const y=new Map;class N{constructor(e){this.missing=e,this.update=new s({deallocator:null}),this.add=new s({deallocator:null}),this.remove=new s({deallocator:null}),this.cancel=[]}reset(e){this.add.clear(),this.update.clear(),this.cancel=e}}function P(t){e(t.node)&&(g(t.node.renderMbs),m(t.node.serviceObbInRenderSR)),e(t.ref)&&(g(t.ref.renderMbs),m(t.ref.serviceObbInRenderSR))}function x(e){return f(e,-2)}function I(e){return f(e,2)}function C(e,t){return t+(e?1:0)}function w(e,t){return(-2&e)===t}function M(e){return 1==(1&e)}function S(e,t){return 0===t?0:e/t|0}function R(e,t){return 0===t?e:e%t}const L=[["maxScreenThreshold",a.MaxScreenThreshold],["screenSpaceRelative",a.ScreenSpaceRelative],["removedFeatureDiameter",a.RemovedFeatureDiameter],["distanceRangeFromDefaultCamera",a.DistanceRangeFromDefaultCamera]];function E(e){if(e)for(let t=0;t<e.length;t++)for(const i of L)if(i[0]===e[t].metricType)return{lodMetric:i[1],maxError:e[t].maxError};return{lodMetric:a.None,maxError:0}}class O{constructor(){this.known=0,this.knownNodes=0,this.missing=0,this.missingNodes=0,this.unremoved=0}}function V(e){return Math.sqrt(e*(4/Math.PI))}export{p as I3SIndex,E as selectErrorMetric};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.25/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../../request.js";import{binaryIndexOf as t,splitIntoChunks as r}from"../../../../core/arrayUtils.js";import n from"../../../../core/Error.js";import has from"../../../../core/has.js";import{isSome as o,isNone as a}from"../../../../core/maybe.js";import{eachAlways as i}from"../../../../core/promiseUtils.js";import{isInt16Array as s,isInt32Array as c}from"../../../../core/typedArrayUtil.js";import{d as l}from"../../../../chunks/mat3.js";import{c as f}from"../../../../chunks/mat3f64.js";import{a as u}from"../../../../chunks/mat4.js";import{c as p}from"../../../../chunks/mat4f64.js";import{a as h,c as m,m as d}from"../../../../chunks/quat.js";import{c as y}from"../../../../chunks/quatf32.js";import{a as S}from"../../../../chunks/quatf64.js";import{s as g,c as b,q as w,w as T,x as E,y as M,l as v,a as I,g as R,z as j,A as x,B as q,m as z}from"../../../../chunks/vec3.js";import{c as k}from"../../../../chunks/vec3f64.js";import{canProjectWithoutEngine as C,projectBuffer as N,computeTranslationToOriginAndRotation as U,projectVectorToVector as W}from"../../../../geometry/projection.js";import{getSphericalPCPF as A,getReferenceEllipsoid as D}from"../../../../geometry/projectionEllipsoid.js";import F from"../../../../geometry/SpatialReference.js";import{create as _,empty as O,expandPointInPlace as G,intersects as K}from"../../../../geometry/support/aaBoundingRect.js";import{isPlateCarree as L}from"../../../../geometry/support/spatialReferenceUtils.js";import B from"../../../../rest/support/Query.js";import{ViewingMode as P}from"../../../ViewingMode.js";import{readBinaryAttribute as $}from"./I3SBinaryReader.js";import{computeGlobalTransformation as Q}from"./I3SProjectionUtil.js";import{createSolidEdgeMaterial as V,createMaterialFromEdges as Z}from"../support/edgeUtils.js";import{parseColorMixMode as H,ColorMixModeEnum as J}from"../support/symbolColorUtils.js";import{create as X,compute as Y,corners as ee}from"../../support/orientedBoundingBox.js";function te(e){return e&&parseInt(e.substring(e.lastIndexOf("/")+1,e.length),10)}function re(e){if(has("disable-feature:i3s-draco")||!e)return!1;for(const t of e)for(const e of t.geometryBuffers)if("draco"===e.compressedAttributes?.encoding)return!0;return!1}function ne(e,t,r,n){r.traverse(t,(t=>{const r=t.mbs;return le(e,r)!==ce.OUTSIDE&&(n(t),!0)}))}function oe(e,t,r){let n=0,o=0;for(let a=0;a<t.length&&n<e.length;a++)e[n]===t[a]&&(r(a)&&(e[o]=e[n],o++),n++);e.length=o}function ae(e,r,n){let o=0,a=0;for(;o<n.length;){t(e,n[o])>=0===r&&(n[a]=n[o],a++),o++}n.length=a}const ie=_();function se(e,t){if(0===t.rotationScale[1]&&0===t.rotationScale[2]&&0===t.rotationScale[3]&&0===t.rotationScale[5]&&0===t.rotationScale[6]&&0===t.rotationScale[7])return ie[0]=(e[0]-t.position[0])/t.rotationScale[0],ie[1]=(e[1]-t.position[1])/t.rotationScale[4],ie[2]=(e[2]-t.position[0])/t.rotationScale[0],ie[3]=(e[3]-t.position[1])/t.rotationScale[4],ie}var ce;function le(e,t){const r=t[0],n=t[1],o=t[3],a=e[0]-r,i=r-e[2],s=e[1]-n,c=n-e[3],l=Math.max(a,i,0),f=Math.max(s,c,0),u=l*l+f*f;if(u>o*o)return ce.OUTSIDE;if(u>0)return ce.INTERSECTS_CENTER_OUTSIDE;return-Math.max(a,i,s,c)>o?ce.INSIDE:ce.INTERSECTS_CENTER_INSIDE}function fe(e,t,r){const n=[],o=r&&r.missingFields,a=r&&r.originalFields;for(const i of e){const e=i.toLowerCase();let r=!1;for(const o of t)if(e===o.name.toLowerCase()){n.push(o.name),r=!0,a&&a.push(i);break}!r&&o&&o.push(i)}return n}async function ue(e,t,r,i,s){if(0===t.length)return[];const c=e.attributeStorageInfo;if(o(e.associatedLayer))try{return await he(e.associatedLayer,t,r,i)}catch(l){if(e.associatedLayer.loaded)throw l}if(c){const o=pe(t,r,s);if(a(o))throw new n("scenelayer:features-not-loaded","Tried to query attributes for unloaded features");const l=e.parsedUrl.path;return(await Promise.all(o.map((e=>de(l,c,e.node,e.indices,i).then((t=>{for(let r=0;r<e.graphics.length;r++){const n=e.graphics[r],o=t[r];if(n.attributes)for(const e in n.attributes)e in o||(o[e]=n.attributes[e]);n.attributes=o}return e.graphics})))))).flat()}throw new n("scenelayer:no-attribute-source","This scene layer does not have a source for attributes available")}function pe(e,t,r){const n=new Map,o=[],a=r();for(const i of e){const e=i.attributes[t];for(let t=0;t<a.length;t++){const r=a[t],s=r.featureIds.indexOf(e);if(s>=0){let e=n.get(r.node);e||(e={node:r.node,indices:[],graphics:[]},o.push(e),n.set(r.node,e)),e.indices.push(s),e.graphics.push(i);for(let r=t;r>0;r--)a[r]=a[r-1];a[0]=r;break}}}return o}async function he(e,t,r,n){t.sort(((e,t)=>e.attributes[r]-t.attributes[r]));const o=t.map((e=>e.attributes[r])),a=[],i=fe(n,e.fields,{originalFields:a}),s=await me(e,o,i);for(let c=0;c<t.length;c++){const e=t[c],r=s[c],n={};if(e.attributes)for(const t in e.attributes)n[t]=e.attributes[t];for(let t=0;t<a.length;t++)n[a[t]]=r[i[t]];e.attributes=n}return t}function me(e,t,o){const a=e.capabilities.query.maxRecordCount;if(null!=a&&t.length>a){const n=r(t,a);return Promise.all(n.map((t=>me(e,t,o)))).then((e=>e.flat()))}const i=new B({objectIds:t,outFields:o,orderByFields:[e.objectIdField]});return e.queryFeatures(i).then((e=>{if(e&&e.features&&e.features.length===t.length)return e.features.map((e=>e.attributes));throw new n("scenelayer:feature-not-in-associated-layer","Feature not found in associated feature layer")}))}function de(e,t,r,n,o){return ye(e,t,r.resources.attributes,n,o)}function ye(t,r,n,o,a){const s=[];for(const e of r)if(e&&a.includes(e.name)){const r=`${t}/nodes/${n}/attributes/${e.key}/0`;s.push({url:r,storageInfo:e})}return i(s.map((t=>e(t.url,{responseType:"array-buffer"}).then((e=>$(t.storageInfo,e.data)))))).then((e=>{const t=[];for(const r of o){const n={};for(let t=0;t<e.length;t++)null!=e[t].value&&(n[s[t].storageInfo.name]=be(e[t].value,r));t.push(n)}return t}))}!function(e){e[e.OUTSIDE=0]="OUTSIDE",e[e.INTERSECTS_CENTER_OUTSIDE=1]="INTERSECTS_CENTER_OUTSIDE",e[e.INTERSECTS_CENTER_INSIDE=2]="INTERSECTS_CENTER_INSIDE",e[e.INSIDE=3]="INSIDE"}(ce||(ce={}));const Se=-32768,ge=-(2**31);function be(e,t){if(!e)return null;const r=e[t];if(s(e))return r===Se?null:r;if(c(e))return r===ge?null:r;return r!=r?null:r}function we(e){const t=e.store.indexCRS||e.store.geographicCRS,r=void 0===t?e.store.indexWKT:void 0;if(r){if(!e.spatialReference)throw new n("layerview:no-store-spatial-reference-wkt-index-and-no-layer-spatial-reference","Found indeWKT in the scene layer store but no layer spatial reference",{});if(r!==e.spatialReference.wkt)throw new n("layerview:store-spatial-reference-wkt-index-incompatible","The indeWKT of the scene layer store does not match the WKT of the layer spatial reference",{})}const o=t?new F(te(t)):e.spatialReference;return o.equals(e.spatialReference)?e.spatialReference:o}function Te(e){const t=e.store.vertexCRS||e.store.projectedCRS,r=void 0===t?e.store.vertexWKT:void 0;if(r){if(!e.spatialReference)throw new n("layerview:no-store-spatial-reference-wkt-vertex-and-no-layer-spatial-reference","Found vertexWKT in the scene layer store but no layer spatial reference",{});if(r!==e.spatialReference.wkt)throw new n("layerview:store-spatial-reference-wkt-vertex-incompatible","The vertexWKT of the scene layer store does not match the WKT of the layer spatial reference",{})}const o=t?new F(te(t)):e.spatialReference;return o.equals(e.spatialReference)?e.spatialReference:o}function Ee(e,t){return a(t)?"@null":t===A(t)?"@ECEF":e.equals(t)?"":null!=t.wkid?"@"+t.wkid:null}function Me(e,t,r){if(!C(e,t))throw new n("layerview:spatial-reference-incompatible","The spatial reference of this scene layer is incompatible with the spatial reference of the view",{});if("local"===r&&!ve(e,t))throw new n("layerview:spatial-reference-incompatible","The spatial reference of this scene layer is incompatible with the spatial reference of the view",{})}function ve(e,t){return e.equals(t)||e.isWGS84&&t.isWebMercator||e.isWebMercator&&t.isWGS84}function Ie(e,t,r){const n=we(e),o=Te(e);Me(n,t,r),Me(o,t,r)}function Re(e){return(null==e.geometryType||"triangles"===e.geometryType)&&((null==e.topology||"PerAttributeArray"===e.topology)&&(null!=e.vertexAttributes&&null!=e.vertexAttributes.position))}function je(e){if(null==e.store||null==e.store.defaultGeometrySchema||!Re(e.store.defaultGeometrySchema))throw new n("scenelayer:unsupported-geometry-schema","The geometry schema of this scene layer is not supported.",{url:e.parsedUrl.path})}function xe(e,t){Ie(e,t.spatialReference,t.viewingMode)}function qe(e){return null!=e.geometryType&&"points"===e.geometryType&&((null==e.topology||"PerAttributeArray"===e.topology)&&((null==e.encoding||""===e.encoding||"lepcc-xyz"===e.encoding)&&(null!=e.vertexAttributes&&null!=e.vertexAttributes.position)))}function ze(e){if(null==e.store||null==e.store.defaultGeometrySchema||!qe(e.store.defaultGeometrySchema))throw new n("pointcloud:unsupported-geometry-schema","The geometry schema of this point cloud scene layer is not supported.",{})}function ke(e,t){Me(e.spatialReference,t.spatialReference,t.viewingMode)}function Ce(e){return"simple"===e.type||"class-breaks"===e.type||"unique-value"===e.type}function Ne(e){return"mesh-3d"===e.type}function Ue(e){if(null==e||!Ce(e))return!0;if(("unique-value"===e.type||"class-breaks"===e.type)&&null==e.defaultSymbol)return!0;const t=e.getSymbols();if(0===t.length)return!0;for(const r of t){if(!Ne(r)||0===r.symbolLayers.length)return!0;for(const e of r.symbolLayers.items)if("fill"!==e.type||a(e.material)||a(e.material.color)||"replace"!==e.material.colorMixMode)return!0}return!1}const We=V({color:[0,0,0,0],opacity:0});class Ae{constructor(){this.edgeMaterial=null,this.material=null,this.castShadows=!0}}function De(e){const t=new Ae;let r=!1,n=!1;for(const a of e.symbolLayers.items)if("fill"===a.type&&a.enabled){const e=a.material,i=a.edges;if(o(e)&&!r){const n=e.color,i=H(e.colorMixMode);o(n)?t.material={color:[n.r/255,n.g/255,n.b/255],alpha:n.a,colorMixMode:i}:t.material={color:[1,1,1],alpha:1,colorMixMode:J.Multiply},t.castShadows=a.castShadows,r=!0}o(i)&&!n&&(t.edgeMaterial=Z(i,{}),n=!0)}return t.material||(t.material={color:[1,1,1],alpha:1,colorMixMode:J.Multiply}),t}function Fe(e,t){return(0|e)+(0|t)|0}function _e(e,t,r,n,o=0){n===A(n)?t.isGeographic?et(e,r,t,o):Ye(e,r,t,o):t.isWGS84&&(n.isWebMercator||L(n))?Pe(t,e,n,r,o):t.isWebMercator&&L(n)?Je(t,e,n,r,o):e===r?(r.center[2]+=o,N(r.center,t,0,r.center,n,0,1)):(g(r.center,e.center[0],e.center[1],e.center[2]+o),N(r.center,t,0,r.center,n,0,1),h(r.quaternion,e.quaternion),b(r.halfSize,e.halfSize))}function Oe(e,t,r,n,o){if(h(o.quaternion,e.quaternion),n===P.Global){m(Be,e.quaternion),w(Ge,e.center,Be),T(Ke,Ge),E(Le,Ke,e.halfSize),M(Le,Ke,Le);const n=v(Le);I(Le,Ke,e.halfSize);const a=v(Le);if(n<r)b(o.center,e.center),g(Ge,r,r,r),I(o.halfSize,e.halfSize,Ge);else{const i=a>0?1+t/a:1,s=n>0?1+r/n:1,c=(s+i)/2,l=(s-i)/2;R(o.halfSize,Ke,l),j(o.halfSize,o.halfSize,e.halfSize,c),R(o.center,Ke,c),j(o.center,o.center,e.halfSize,l),x(Ge,Ge),q(o.center,o.center,Ge),w(o.center,o.center,o.quaternion)}}else{const n=g(Ge,0,0,1);j(o.center,e.center,n,(r+t)/2),m(Be,e.quaternion),w(n,n,Be),T(n,n),j(o.halfSize,e.halfSize,n,(r-t)/2)}return o}const Ge=k(),Ke=k(),Le=k(),Be=S();function Pe(e,t,r,n,o){b(Ze,t.center),Ze[2]+=o;const a=A(r);N(Ze,e,0,Ze,a,0,1),Xe(a,t,Ze,r,n)}const $e=new Float64Array(24),Qe={data:$e,size:3},Ve=k(),Ze=k(),He=f();function Je(e,t,r,n,o){b(Ze,t.center),Ze[2]+=o,Xe(e,t,Ze,r,n)}function Xe(e,t,r,n,o){const a=l(He,t.quaternion);for(let i=0;i<8;++i){for(let e=0;e<3;++e)Ve[e]=t.halfSize[e]*(0!=(i&1<<e)?-1:1);for(let e=0;e<3;++e){let t=r[e];for(let r=0;r<3;++r)t+=Ve[r]*a[3*r+e];$e[3*i+e]=t}}N($e,e,0,$e,n,0,8),Y(Qe,o)}function Ye(e,t,r,n){ee(e,ct),g(t.center,e.center[0],e.center[1],e.center[2]+n),U(r,t.center,it,A(r)),g(t.center,it[12],it[13],it[14]);const o=2*Math.sqrt(1+it[0]+it[5]+it[10]);st[0]=(it[6]-it[9])/o,st[1]=(it[8]-it[2])/o,st[2]=(it[1]-it[4])/o,st[3]=.25*o,d(t.quaternion,st,e.quaternion),m(st,t.quaternion);let a=0,i=0,s=0;for(const c of ct)c[2]+=n,N(c,r,0,c,A(r),0,1),M(pt,c,t.center),w(pt,pt,st),a=Math.max(a,Math.abs(pt[0])),i=Math.max(i,Math.abs(pt[1])),s=Math.max(s,Math.abs(pt[2]));g(t.halfSize,a,i,s)}function et(e,t,r,n){const o=D(r),a=1+Math.max(0,n)/(o.radius+e.center[2]);g(t.center,e.center[0],e.center[1],e.center[2]+n),N(t.center,r,0,t.center,A(r),0,1),h(t.quaternion,e.quaternion),m(st,e.quaternion),g(pt,0,0,1),w(pt,pt,st),g(pt,e.halfSize[0]*Math.abs(pt[0]),e.halfSize[1]*Math.abs(pt[1]),e.halfSize[2]*Math.abs(pt[2])),R(pt,pt,o.inverseFlattening),I(t.halfSize,e.halfSize,pt),R(t.halfSize,t.halfSize,a)}function tt(e,t,r,n,i,s){if(!s||0===s.length||a(t))return null;const c=Q(e.mbs,i,r,t);let l;u(mt,c);const f=()=>{if(!l)if(l=ct,O(ft),o(e.serviceObb)){_e(e.serviceObb,r,ut,t,i),ee(ut,l);for(const e of l)z(e,e,mt),G(ft,e)}else{const n=e.mbs,o=n[3];W(n,r,pt,t),z(pt,pt,mt),pt[2]+=i;for(let e=0;e<8;++e){const t=1&e?o:-o,r=2&e?o:-o,n=4&e?o:-o,a=l[e];b(a,[pt[0]+t,pt[1]+r,pt[2]+n]),G(ft,a)}}};let p=1/0,h=-1/0;const m=e=>{if("replace"!==e.type)return;const r=e.geometry;if(!r.hasZ)return;O(lt);const o=r.spatialReference||n,a=r.rings.reduce(((e,r)=>r.reduce(((e,r)=>(W(r,o,pt,t),z(pt,pt,mt),G(lt,pt),Math.min(pt[2],e))),e)),1/0);f(),K(ft,lt)&&(p=Math.min(p,a),h=Math.max(h,a))};if(s.forEach((e=>m(e))),p===1/0)return null;const d=(e,t,r)=>{z(pt,r,c),e[t+0]=pt[0],e[t+1]=pt[1],e[t+2]=pt[2],t+=24,r[2]=p,z(pt,r,c),e[t+0]=pt[0],e[t+1]=pt[1],e[t+2]=pt[2],t+=24,r[2]=h,z(pt,r,c),e[t+0]=pt[0],e[t+1]=pt[1],e[t+2]=pt[2]};for(let o=0;o<8;++o)d(ht.data,3*o,l[o]);return Y(ht)}function rt(e){return o(e)&&e.halfSize[0]>=0}function nt(e){return e[3]>=0}function ot(e){o(e)&&(e.halfSize[0]=-1)}function at(e){o(e)&&(e[3]=-1)}const it=p(),st=y(),ct=[[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0]],lt=_(),ft=_(),ut=X(),pt=[0,0,0],ht={data:new Array(72),size:3},mt=p();export{ce as MbsIntersectResult,Ae as SymbolInfo,Fe as addWraparound,ke as checkPointCloudLayerCompatibleWithView,ze as checkPointCloudLayerValid,xe as checkSceneLayerCompatibleWithView,je as checkSceneLayerValid,Me as checkSpatialReference,Ie as checkSpatialReferences,Oe as computeOffsetObb,tt as computeVisibilityObb,re as containsDraco,te as extractWkid,oe as filterInPlace,fe as findFieldsCaseInsensitive,ne as findIntersectingNodes,Ee as getCacheKeySuffix,be as getCachedAttributeValue,se as getClipRect,we as getIndexCrs,De as getSymbolInfo,Te as getVertexCrs,le as intersectBoundingRectWithMbs,at as invalidateMbs,ot as invalidateObb,ve as isSupportedLocalModeProjection,nt as isValidMbs,rt as isValidObb,ae as objectIdFilter,ye as queryAttributesFromCachedAttributesId,Ue as rendererNeedsTextures,_e as transformObb,We as transparentEdgeMaterial,ue as whenGraphicAttributes};
5
+ import e from"../../../../request.js";import{binaryIndexOf as t,splitIntoChunks as r}from"../../../../core/arrayUtils.js";import n from"../../../../core/Error.js";import has from"../../../../core/has.js";import{isSome as o,isNone as a}from"../../../../core/maybe.js";import{eachAlways as i}from"../../../../core/promiseUtils.js";import{isInt16Array as s,isInt32Array as c}from"../../../../core/typedArrayUtil.js";import{a as l}from"../../../../chunks/mat3.js";import{c as f}from"../../../../chunks/mat3f64.js";import{a as u}from"../../../../chunks/mat4.js";import{c as p}from"../../../../chunks/mat4f64.js";import{c as h,a as m,m as d}from"../../../../chunks/quat.js";import{c as y}from"../../../../chunks/quatf32.js";import{c as S}from"../../../../chunks/quatf64.js";import{s as g,c as b,k as w,m as T,o as E,p as M,l as v,a as I,g as R,q as j,r as x,u as q,v as z}from"../../../../chunks/vec3.js";import{c as k}from"../../../../chunks/vec3f64.js";import{canProjectWithoutEngine as C,projectBuffer as N,computeTranslationToOriginAndRotation as U,projectVectorToVector as W}from"../../../../geometry/projection.js";import{getSphericalPCPF as D,getReferenceEllipsoid as F}from"../../../../geometry/projectionEllipsoid.js";import A from"../../../../geometry/SpatialReference.js";import{create as _,empty as O,expandPointInPlace as G,intersects as K}from"../../../../geometry/support/aaBoundingRect.js";import{isPlateCarree as L}from"../../../../geometry/support/spatialReferenceUtils.js";import B from"../../../../rest/support/Query.js";import{ViewingMode as P}from"../../../ViewingMode.js";import{readBinaryAttribute as $}from"./I3SBinaryReader.js";import{computeGlobalTransformation as Q}from"./I3SProjectionUtil.js";import{createSolidEdgeMaterial as V,createMaterialFromEdges as Z}from"../support/edgeUtils.js";import{parseColorMixMode as H,ColorMixModeEnum as J}from"../support/symbolColorUtils.js";import{create as X,compute as Y,corners as ee}from"../../support/orientedBoundingBox.js";function te(e){return e&&parseInt(e.substring(e.lastIndexOf("/")+1,e.length),10)}function re(e){if(has("disable-feature:i3s-draco")||!e)return!1;for(const t of e)for(const e of t.geometryBuffers)if("draco"===e.compressedAttributes?.encoding)return!0;return!1}function ne(e,t,r,n){r.traverse(t,(t=>{const r=t.mbs;return le(e,r)!==ce.OUTSIDE&&(n(t),!0)}))}function oe(e,t,r){let n=0,o=0;for(let a=0;a<t.length&&n<e.length;a++)e[n]===t[a]&&(r(a)&&(e[o]=e[n],o++),n++);e.length=o}function ae(e,r,n){let o=0,a=0;for(;o<n.length;){t(e,n[o])>=0===r&&(n[a]=n[o],a++),o++}n.length=a}const ie=_();function se(e,t){if(0===t.rotationScale[1]&&0===t.rotationScale[2]&&0===t.rotationScale[3]&&0===t.rotationScale[5]&&0===t.rotationScale[6]&&0===t.rotationScale[7])return ie[0]=(e[0]-t.position[0])/t.rotationScale[0],ie[1]=(e[1]-t.position[1])/t.rotationScale[4],ie[2]=(e[2]-t.position[0])/t.rotationScale[0],ie[3]=(e[3]-t.position[1])/t.rotationScale[4],ie}var ce;function le(e,t){const r=t[0],n=t[1],o=t[3],a=e[0]-r,i=r-e[2],s=e[1]-n,c=n-e[3],l=Math.max(a,i,0),f=Math.max(s,c,0),u=l*l+f*f;if(u>o*o)return ce.OUTSIDE;if(u>0)return ce.INTERSECTS_CENTER_OUTSIDE;return-Math.max(a,i,s,c)>o?ce.INSIDE:ce.INTERSECTS_CENTER_INSIDE}function fe(e,t,r){const n=[],o=r&&r.missingFields,a=r&&r.originalFields;for(const i of e){const e=i.toLowerCase();let r=!1;for(const o of t)if(e===o.name.toLowerCase()){n.push(o.name),r=!0,a&&a.push(i);break}!r&&o&&o.push(i)}return n}async function ue(e,t,r,i,s){if(0===t.length)return[];const c=e.attributeStorageInfo;if(o(e.associatedLayer))try{return await he(e.associatedLayer,t,r,i)}catch(l){if(e.associatedLayer.loaded)throw l}if(c){const o=pe(t,r,s);if(a(o))throw new n("scenelayer:features-not-loaded","Tried to query attributes for unloaded features");const l=e.parsedUrl.path;return(await Promise.all(o.map((e=>de(l,c,e.node,e.indices,i).then((t=>{for(let r=0;r<e.graphics.length;r++){const n=e.graphics[r],o=t[r];if(n.attributes)for(const e in n.attributes)e in o||(o[e]=n.attributes[e]);n.attributes=o}return e.graphics})))))).flat()}throw new n("scenelayer:no-attribute-source","This scene layer does not have a source for attributes available")}function pe(e,t,r){const n=new Map,o=[],a=r();for(const i of e){const e=i.attributes[t];for(let t=0;t<a.length;t++){const r=a[t],s=r.featureIds.indexOf(e);if(s>=0){let e=n.get(r.node);e||(e={node:r.node,indices:[],graphics:[]},o.push(e),n.set(r.node,e)),e.indices.push(s),e.graphics.push(i);for(let r=t;r>0;r--)a[r]=a[r-1];a[0]=r;break}}}return o}async function he(e,t,r,n){t.sort(((e,t)=>e.attributes[r]-t.attributes[r]));const o=t.map((e=>e.attributes[r])),a=[],i=fe(n,e.fields,{originalFields:a}),s=await me(e,o,i);for(let c=0;c<t.length;c++){const e=t[c],r=s[c],n={};if(e.attributes)for(const t in e.attributes)n[t]=e.attributes[t];for(let t=0;t<a.length;t++)n[a[t]]=r[i[t]];e.attributes=n}return t}function me(e,t,o){const a=e.capabilities.query.maxRecordCount;if(null!=a&&t.length>a){const n=r(t,a);return Promise.all(n.map((t=>me(e,t,o)))).then((e=>e.flat()))}const i=new B({objectIds:t,outFields:o,orderByFields:[e.objectIdField]});return e.queryFeatures(i).then((e=>{if(e&&e.features&&e.features.length===t.length)return e.features.map((e=>e.attributes));throw new n("scenelayer:feature-not-in-associated-layer","Feature not found in associated feature layer")}))}function de(e,t,r,n,o){return ye(e,t,r.resources.attributes,n,o)}function ye(t,r,n,o,a){const s=[];for(const e of r)if(e&&a.includes(e.name)){const r=`${t}/nodes/${n}/attributes/${e.key}/0`;s.push({url:r,storageInfo:e})}return i(s.map((t=>e(t.url,{responseType:"array-buffer"}).then((e=>$(t.storageInfo,e.data)))))).then((e=>{const t=[];for(const r of o){const n={};for(let t=0;t<e.length;t++)null!=e[t].value&&(n[s[t].storageInfo.name]=be(e[t].value,r));t.push(n)}return t}))}!function(e){e[e.OUTSIDE=0]="OUTSIDE",e[e.INTERSECTS_CENTER_OUTSIDE=1]="INTERSECTS_CENTER_OUTSIDE",e[e.INTERSECTS_CENTER_INSIDE=2]="INTERSECTS_CENTER_INSIDE",e[e.INSIDE=3]="INSIDE"}(ce||(ce={}));const Se=-32768,ge=-(2**31);function be(e,t){if(!e)return null;const r=e[t];if(s(e))return r===Se?null:r;if(c(e))return r===ge?null:r;return r!=r?null:r}function we(e){const t=e.store.indexCRS||e.store.geographicCRS,r=void 0===t?e.store.indexWKT:void 0;if(r){if(!e.spatialReference)throw new n("layerview:no-store-spatial-reference-wkt-index-and-no-layer-spatial-reference","Found indeWKT in the scene layer store but no layer spatial reference",{});if(r!==e.spatialReference.wkt)throw new n("layerview:store-spatial-reference-wkt-index-incompatible","The indeWKT of the scene layer store does not match the WKT of the layer spatial reference",{})}const o=t?new A(te(t)):e.spatialReference;return o.equals(e.spatialReference)?e.spatialReference:o}function Te(e){const t=e.store.vertexCRS||e.store.projectedCRS,r=void 0===t?e.store.vertexWKT:void 0;if(r){if(!e.spatialReference)throw new n("layerview:no-store-spatial-reference-wkt-vertex-and-no-layer-spatial-reference","Found vertexWKT in the scene layer store but no layer spatial reference",{});if(r!==e.spatialReference.wkt)throw new n("layerview:store-spatial-reference-wkt-vertex-incompatible","The vertexWKT of the scene layer store does not match the WKT of the layer spatial reference",{})}const o=t?new A(te(t)):e.spatialReference;return o.equals(e.spatialReference)?e.spatialReference:o}function Ee(e,t){return a(t)?"@null":t===D(t)?"@ECEF":e.equals(t)?"":null!=t.wkid?"@"+t.wkid:null}function Me(e,t,r){if(!C(e,t))throw new n("layerview:spatial-reference-incompatible","The spatial reference of this scene layer is incompatible with the spatial reference of the view",{});if("local"===r&&!ve(e,t))throw new n("layerview:spatial-reference-incompatible","The spatial reference of this scene layer is incompatible with the spatial reference of the view",{})}function ve(e,t){return e.equals(t)||e.isWGS84&&t.isWebMercator||e.isWebMercator&&t.isWGS84}function Ie(e,t,r){const n=we(e),o=Te(e);Me(n,t,r),Me(o,t,r)}function Re(e){return(null==e.geometryType||"triangles"===e.geometryType)&&((null==e.topology||"PerAttributeArray"===e.topology)&&(null!=e.vertexAttributes&&null!=e.vertexAttributes.position))}function je(e){if(null==e.store||null==e.store.defaultGeometrySchema||!Re(e.store.defaultGeometrySchema))throw new n("scenelayer:unsupported-geometry-schema","The geometry schema of this scene layer is not supported.",{url:e.parsedUrl.path})}function xe(e,t){Ie(e,t.spatialReference,t.viewingMode)}function qe(e){return null!=e.geometryType&&"points"===e.geometryType&&((null==e.topology||"PerAttributeArray"===e.topology)&&((null==e.encoding||""===e.encoding||"lepcc-xyz"===e.encoding)&&(null!=e.vertexAttributes&&null!=e.vertexAttributes.position)))}function ze(e){if(null==e.store||null==e.store.defaultGeometrySchema||!qe(e.store.defaultGeometrySchema))throw new n("pointcloud:unsupported-geometry-schema","The geometry schema of this point cloud scene layer is not supported.",{})}function ke(e,t){Me(e.spatialReference,t.spatialReference,t.viewingMode)}function Ce(e){return"simple"===e.type||"class-breaks"===e.type||"unique-value"===e.type}function Ne(e){return"mesh-3d"===e.type}function Ue(e){if(null==e||!Ce(e))return!0;if(("unique-value"===e.type||"class-breaks"===e.type)&&null==e.defaultSymbol)return!0;const t=e.getSymbols();if(0===t.length)return!0;for(const r of t){if(!Ne(r)||0===r.symbolLayers.length)return!0;for(const e of r.symbolLayers.items)if("fill"!==e.type||a(e.material)||a(e.material.color)||"replace"!==e.material.colorMixMode)return!0}return!1}const We=V({color:[0,0,0,0],opacity:0});class De{constructor(){this.edgeMaterial=null,this.material=null,this.castShadows=!0}}function Fe(e){const t=new De;let r=!1,n=!1;for(const a of e.symbolLayers.items)if("fill"===a.type&&a.enabled){const e=a.material,i=a.edges;if(o(e)&&!r){const n=e.color,i=H(e.colorMixMode);o(n)?t.material={color:[n.r/255,n.g/255,n.b/255],alpha:n.a,colorMixMode:i}:t.material={color:[1,1,1],alpha:1,colorMixMode:J.Multiply},t.castShadows=a.castShadows,r=!0}o(i)&&!n&&(t.edgeMaterial=Z(i,{}),n=!0)}return t.material||(t.material={color:[1,1,1],alpha:1,colorMixMode:J.Multiply}),t}function Ae(e,t){return(0|e)+(0|t)|0}function _e(e,t,r,n,o=0){n===D(n)?t.isGeographic?et(e,r,t,o):Ye(e,r,t,o):t.isWGS84&&(n.isWebMercator||L(n))?Pe(t,e,n,r,o):t.isWebMercator&&L(n)?Je(t,e,n,r,o):e===r?(r.center[2]+=o,N(r.center,t,0,r.center,n,0,1)):(g(r.center,e.center[0],e.center[1],e.center[2]+o),N(r.center,t,0,r.center,n,0,1),h(r.quaternion,e.quaternion),b(r.halfSize,e.halfSize))}function Oe(e,t,r,n,o){if(h(o.quaternion,e.quaternion),n===P.Global){m(Be,e.quaternion),w(Ge,e.center,Be),T(Ke,Ge),E(Le,Ke,e.halfSize),M(Le,Ke,Le);const n=v(Le);I(Le,Ke,e.halfSize);const a=v(Le);if(n<r)b(o.center,e.center),g(Ge,r,r,r),I(o.halfSize,e.halfSize,Ge);else{const i=a>0?1+t/a:1,s=n>0?1+r/n:1,c=(s+i)/2,l=(s-i)/2;R(o.halfSize,Ke,l),j(o.halfSize,o.halfSize,e.halfSize,c),R(o.center,Ke,c),j(o.center,o.center,e.halfSize,l),x(Ge,Ge),q(o.center,o.center,Ge),w(o.center,o.center,o.quaternion)}}else{const n=g(Ge,0,0,1);j(o.center,e.center,n,(r+t)/2),m(Be,e.quaternion),w(n,n,Be),T(n,n),j(o.halfSize,e.halfSize,n,(r-t)/2)}return o}const Ge=k(),Ke=k(),Le=k(),Be=S();function Pe(e,t,r,n,o){b(Ze,t.center),Ze[2]+=o;const a=D(r);N(Ze,e,0,Ze,a,0,1),Xe(a,t,Ze,r,n)}const $e=new Float64Array(24),Qe={data:$e,size:3},Ve=k(),Ze=k(),He=f();function Je(e,t,r,n,o){b(Ze,t.center),Ze[2]+=o,Xe(e,t,Ze,r,n)}function Xe(e,t,r,n,o){const a=l(He,t.quaternion);for(let i=0;i<8;++i){for(let e=0;e<3;++e)Ve[e]=t.halfSize[e]*(0!=(i&1<<e)?-1:1);for(let e=0;e<3;++e){let t=r[e];for(let r=0;r<3;++r)t+=Ve[r]*a[3*r+e];$e[3*i+e]=t}}N($e,e,0,$e,n,0,8),Y(Qe,o)}function Ye(e,t,r,n){ee(e,ct),g(t.center,e.center[0],e.center[1],e.center[2]+n),U(r,t.center,it,D(r)),g(t.center,it[12],it[13],it[14]);const o=2*Math.sqrt(1+it[0]+it[5]+it[10]);st[0]=(it[6]-it[9])/o,st[1]=(it[8]-it[2])/o,st[2]=(it[1]-it[4])/o,st[3]=.25*o,d(t.quaternion,st,e.quaternion),m(st,t.quaternion);let a=0,i=0,s=0;for(const c of ct)c[2]+=n,N(c,r,0,c,D(r),0,1),M(pt,c,t.center),w(pt,pt,st),a=Math.max(a,Math.abs(pt[0])),i=Math.max(i,Math.abs(pt[1])),s=Math.max(s,Math.abs(pt[2]));g(t.halfSize,a,i,s)}function et(e,t,r,n){const o=F(r),a=1+Math.max(0,n)/(o.radius+e.center[2]);g(t.center,e.center[0],e.center[1],e.center[2]+n),N(t.center,r,0,t.center,D(r),0,1),h(t.quaternion,e.quaternion),m(st,e.quaternion),g(pt,0,0,1),w(pt,pt,st),g(pt,e.halfSize[0]*Math.abs(pt[0]),e.halfSize[1]*Math.abs(pt[1]),e.halfSize[2]*Math.abs(pt[2])),R(pt,pt,o.inverseFlattening),I(t.halfSize,e.halfSize,pt),R(t.halfSize,t.halfSize,a)}function tt(e,t,r,n,i,s){if(!s||0===s.length||a(t))return null;const c=Q(e.mbs,i,r,t);let l;u(mt,c);const f=()=>{if(!l)if(l=ct,O(ft),o(e.serviceObb)){_e(e.serviceObb,r,ut,t,i),ee(ut,l);for(const e of l)z(e,e,mt),G(ft,e)}else{const n=e.mbs,o=n[3];W(n,r,pt,t),z(pt,pt,mt),pt[2]+=i;for(let e=0;e<8;++e){const t=1&e?o:-o,r=2&e?o:-o,n=4&e?o:-o,a=l[e];b(a,[pt[0]+t,pt[1]+r,pt[2]+n]),G(ft,a)}}};let p=1/0,h=-1/0;const m=e=>{if("replace"!==e.type)return;const r=e.geometry;if(!r.hasZ)return;O(lt);const o=r.spatialReference||n,a=r.rings.reduce(((e,r)=>r.reduce(((e,r)=>(W(r,o,pt,t),z(pt,pt,mt),G(lt,pt),Math.min(pt[2],e))),e)),1/0);f(),K(ft,lt)&&(p=Math.min(p,a),h=Math.max(h,a))};if(s.forEach((e=>m(e))),p===1/0)return null;const d=(e,t,r)=>{z(pt,r,c),e[t+0]=pt[0],e[t+1]=pt[1],e[t+2]=pt[2],t+=24,r[2]=p,z(pt,r,c),e[t+0]=pt[0],e[t+1]=pt[1],e[t+2]=pt[2],t+=24,r[2]=h,z(pt,r,c),e[t+0]=pt[0],e[t+1]=pt[1],e[t+2]=pt[2]};for(let o=0;o<8;++o)d(ht.data,3*o,l[o]);return Y(ht)}function rt(e){return o(e)&&e.halfSize[0]>=0}function nt(e){return e[3]>=0}function ot(e){o(e)&&(e.halfSize[0]=-1)}function at(e){o(e)&&(e[3]=-1)}const it=p(),st=y(),ct=[[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0]],lt=_(),ft=_(),ut=X(),pt=[0,0,0],ht={data:new Array(72),size:3},mt=p();export{ce as MbsIntersectResult,De as SymbolInfo,Ae as addWraparound,ke as checkPointCloudLayerCompatibleWithView,ze as checkPointCloudLayerValid,xe as checkSceneLayerCompatibleWithView,je as checkSceneLayerValid,Me as checkSpatialReference,Ie as checkSpatialReferences,Oe as computeOffsetObb,tt as computeVisibilityObb,re as containsDraco,te as extractWkid,oe as filterInPlace,fe as findFieldsCaseInsensitive,ne as findIntersectingNodes,Ee as getCacheKeySuffix,be as getCachedAttributeValue,se as getClipRect,we as getIndexCrs,Fe as getSymbolInfo,Te as getVertexCrs,le as intersectBoundingRectWithMbs,at as invalidateMbs,ot as invalidateObb,ve as isSupportedLocalModeProjection,nt as isValidMbs,rt as isValidObb,ae as objectIdFilter,ye as queryAttributesFromCachedAttributesId,Ue as rendererNeedsTextures,_e as transformObb,We as transparentEdgeMaterial,ue as whenGraphicAttributes};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.25/esri/copyright.txt for details.
4
4
  */
5
- import{isNone as e,isSome as t}from"../../../../core/maybe.js";import{d as i,i as s,l as r,g as n,e as o,p as a,b as h,a as c}from"../../../../chunks/vec3.js";import{c as m}from"../../../../chunks/vec3f64.js";import{c as p}from"../../../../chunks/vec4.js";import{projectBoundingSphere as l}from"../../../../geometry/projection.js";import{getReferenceEllipsoid as _,getSphericalPCPF as u}from"../../../../geometry/projectionEllipsoid.js";import{create as d,fromMatrix as g,intersectsSphere as b}from"../../../../geometry/support/frustum.js";import{isPlateCarree as v}from"../../../../geometry/support/spatialReferenceUtils.js";import{w as x}from"../../../../chunks/sphere.js";import{makeDehydratedPoint as f}from"../../../../layers/graphics/dehydratedFeatures.js";import{evaluateElevationAlignmentAtPoint as M}from"../graphics/elevationAlignmentUtils.js";import{ElevationContext as R}from"../graphics/ElevationContext.js";import{createContextWithoutExpressionSupport as D,extractExpressionInfo as S}from"../graphics/featureExpressionInfoUtils.js";import{LodMetric as C}from"./I3SNode.js";import{isValidMbs as E,isValidObb as P,transformObb as O,computeOffsetObb as L,intersectBoundingRectWithMbs as j,MbsIntersectResult as F}from"./I3SUtil.js";import{create as B,isVisible as y}from"../../support/orientedBoundingBox.js";const I=1e5;class A{constructor(e,t,i,s,r,n,o,a,h={}){this._indexSR=e,this._renderCoordsHelper=t,this._clippingArea=r,this._elevationProvider=n,this._viewingMode=o,this._options=h,this._frustum=d(),this._useFrustumCulling=!1,this._poi=m(),this.minDistance=1/0,this.maxDistance=0,this.maxLodLevel=2,this._tmpObb=B(),this._tmp1=m(),this._tmp2=m(),this._tmp3=m(),this._tmp0=m(),this._screenspaceErrorBias=h.screenspaceErrorBias||1,this._progressiveLoadFactor=h.progressiveLoadFactor||1,this.updateCamera(i,s),this.engineSR=this._renderCoordsHelper.spatialReference,this.updateElevationInfo(a),this._tmpPoint=f(0,0,0,e),this._isECEFOBBInLocalMode=this._indexSR.isWGS84&&(this.engineSR.isWebMercator||v(this.engineSR)),this._indexSREllipsoidRadius=_(this._indexSR).radius}updateElevationInfo(e){null!=e?(this._elevationContext=R.fromElevationInfo(e),this._elevationContext.updateFeatureExpressionInfoContext(D(S(e,!1)))):this._elevationContext=null}updateCamera(e,t){this._useFrustumCulling=t,t&&g(e.viewMatrix,e.projectionMatrix,this._frustum),this._screenSizeFactor=1/(e.perScreenPixelRatio/2),this._camPos=e.eye,this.minDistance=1/0,this.maxDistance=0}setPointOfInterest(e){this._poi=e}updateScreenSpaceErrorBias(e){const t=this._screenspaceErrorBias;return this._screenspaceErrorBias=e,t}updateClippingArea(e){this._clippingArea=e}getElevationRange(i){if(e(this._elevationContext))return null;const s=i.mbs[0],r=i.mbs[1],n=i.mbs[2],o=i.mbs[3],a="relative-to-scene"===this._elevationContext.mode?"scene":"ground";if(this._elevationProvider.getSphereElevationBounds)return this._elevationProvider.getSphereElevationBounds(s,r,n,o,this._indexSR,a);const h=this._elevationProvider.getElevation(s,r,n,this._indexSR,a);return t(h)?{min:h,max:h}:null}getRenderMbs(e){const t=e.renderMbs;return E(t)||(p(t,e.mbs),this._elevationContext&&t[3]<I&&(this._tmpPoint.x=t[0],this._tmpPoint.y=t[1],this._tmpPoint.z=t[2],t[2]=M(this._tmpPoint,this._elevationProvider,this._elevationContext,this._renderCoordsHelper)),l(t,this._indexSR,t,this.engineSR)),t}getVisibilityObb(i){if(t(i.visibilityObb))return i.visibilityObb;const s=i.serviceObb,r=.01*this._indexSREllipsoidRadius;return e(s)||!P(s)||this._isECEFOBBInLocalMode&&s.halfSize.some((e=>e>r))?null:(i.serviceObbInRenderSR=this._computeRenderObb(s,i.serviceObbInRenderSR,i.mbs[3],i.elevationRange),i.serviceObbInRenderSR)}_computeRenderObb(i,s,r,n){if(e(s))s=B();else if(P(s))return s;let o=0,a=0;if(this._elevationContext&&t(n)&&Number.isFinite(n.min))switch(this._elevationContext.mode){case"relative-to-ground":o=this._elevationContext.geometryZWithOffset(i.center[2],this._renderCoordsHelper)+n.min-i.center[2],a=n.max-n.min;break;case"on-the-ground":o=n.min-i.center[2],a=n.max-n.min}else this._elevationContext&&r<I&&(this._tmpPoint.x=i.center[0],this._tmpPoint.y=i.center[1],this._tmpPoint.z=i.center[2],o=M(this._tmpPoint,this._elevationProvider,this._elevationContext,this._renderCoordsHelper)-i.center[2]);return a>0?(O(i,this._indexSR,this._tmpObb,this.engineSR,o),L(this._tmpObb,0,a,this._viewingMode,s)):O(i,this._indexSR,s,this.engineSR,o),s}isNodeVisible(e){const i=this.getRenderMbs(e);if(!this._isMBSinClippingArea(i))return!1;if(!this._useFrustumCulling)return!0;const s=this.getVisibilityObb(e);return t(s)?y(s,this._frustum):b(this._frustum,x(i))}isGeometryVisible(e){if(!this._useFrustumCulling)return!0;const i=e.geometryObb;return t(i)?y(i,this._frustum):this.isNodeVisible(e)}_isMBSinClippingArea(t){return!!e(this._clippingArea)||j(this._clippingArea,t)!==F.OUTSIDE}_screenSpaceDiameterMbs(e,t){const s=this.getRenderMbs(e),r=Math.sqrt(i(s,this._camPos)),n=r-s[3];return this._updateMinMaxDistance(r),n<0?.5*Number.MAX_VALUE:t/n*this._screenSizeFactor}calcCameraDistance(e){return this.calcCameraDistanceToCenter(e)-this.getRenderMbs(e)[3]}calcCameraDistanceToCenter(e){const t=this.getRenderMbs(e),i=s(t,this._camPos);return this._updateMinMaxDistance(i),i}calcAngleDependentLoD(e){const t=this.getRenderMbs(e),i=t[3],n=(Math.abs(t[0]*(t[0]-this._camPos[0])+t[1]*(t[1]-this._camPos[1])+t[2]*(t[2]-this._camPos[2]))/r(t)+i)/s(t,this._camPos);return Math.min(1,n)}hasLOD(e){return e.lodMetric!==C.None}_getDistancePlanarMode(e,t){const i=e[0]-t[0],s=e[1]-t[1],r=e[2]-t[2],n=i*i+s*s,o=t[3];if(n<=o*o)return Math.abs(r);const a=Math.sqrt(n)-o;return Math.sqrt(r*r+a*a)}_getDistanceGlobeMode(e,t){const m=r(t),p=r(e)-m;n(this._tmp0,e,o(e,t)/a(e));const l=i(t,this._tmp0),_=t[3];if(l<=_*_)return Math.abs(p);{const i=n(this._tmp0,t,1/m),a=m,l=_*_/2/a,u=n(this._tmp1,i,a-l),d=e,g=h(this._tmp2,d,u),b=h(this._tmp2,g,n(this._tmp3,i,o(i,g))),v=c(this._tmp2,u,n(this._tmp2,b,_/r(b)));let x=s(d,v);if(p>=2e5){const e=h(this._tmp1,d,v);let t=o(e,i)/r(e);t<.08&&(t=1e-4),x/=t}return x}}_getDistance(e,t){return this.engineSR===u(this.engineSR)?this._getDistanceGlobeMode(e,t):this._getDistancePlanarMode(e,t)}_updateMinMaxDistance(e){e>0?(this.minDistance=Math.min(this.minDistance,e),this.maxDistance=Math.max(this.maxDistance,e)):(this.minDistance=0,this.maxDistance=Math.max(this.maxDistance,-e))}getLodLevel(e){if(e.lodMetric===C.None)return 0;if(0===e.childCount)return this.maxLodLevel;if(this._useFrustumCulling&&this._progressiveLoadFactor<1){const t=this._progressiveLoadFactor*this._screenspaceErrorBias,i=this._screenspaceErrorBias;return this.evaluateLODmetric(e,t)?this.evaluateLODmetric(e,i)?2:1:0}return this.evaluateLODmetric(e,this._screenspaceErrorBias)?this.maxLodLevel:0}evaluateLODmetric(e,t){switch(e.lodMetric){case C.ScreenSpaceRelative:{const i=this.getRenderMbs(e),s=this._getDistance(this._camPos,i),r=2*s/this._screenSizeFactor,n=s+i[3];return this._updateMinMaxDistance(n),e.maxError*t<=r}case C.MaxScreenThreshold:{let i=this._screenSpaceDiameterMbs(e,e.mbs[3]*t);return this._options.angleDependentLoD&&(i*=this.calcAngleDependentLoD(e)),i<e.maxError}case C.RemovedFeatureDiameter:return this._screenSpaceDiameterMbs(e,e.maxError)*t<10;case C.DistanceRangeFromDefaultCamera:return this.calcCameraDistance(e)>e.maxError*t}return!1}distToPOI(e){const t=this.getRenderMbs(e);return s(t,this._poi)-t[3]}distCameraToPOI(){return s(this._camPos,this._poi)}}export{A as default};
5
+ import{isNone as e,isSome as t}from"../../../../core/maybe.js";import{d as i,i as s,l as r,g as n,e as o,z as a,b as h,a as c}from"../../../../chunks/vec3.js";import{c as m}from"../../../../chunks/vec3f64.js";import{c as l}from"../../../../chunks/vec4.js";import{projectBoundingSphere as p}from"../../../../geometry/projection.js";import{getReferenceEllipsoid as _,getSphericalPCPF as u}from"../../../../geometry/projectionEllipsoid.js";import{create as d,fromMatrix as g,intersectsSphere as b}from"../../../../geometry/support/frustum.js";import{isPlateCarree as v}from"../../../../geometry/support/spatialReferenceUtils.js";import{w as x}from"../../../../chunks/sphere.js";import{makeDehydratedPoint as f}from"../../../../layers/graphics/dehydratedFeatures.js";import{evaluateElevationAlignmentAtPoint as M}from"../graphics/elevationAlignmentUtils.js";import{ElevationContext as R}from"../graphics/ElevationContext.js";import{createContextWithoutExpressionSupport as D,extractExpressionInfo as S}from"../graphics/featureExpressionInfoUtils.js";import{LodMetric as C}from"./I3SNode.js";import{isValidMbs as E,isValidObb as P,transformObb as O,computeOffsetObb as L,intersectBoundingRectWithMbs as j,MbsIntersectResult as F}from"./I3SUtil.js";import{create as B,isVisible as y}from"../../support/orientedBoundingBox.js";const I=1e5;class A{constructor(e,t,i,s,r,n,o,a,h={}){this._indexSR=e,this._renderCoordsHelper=t,this._clippingArea=r,this._elevationProvider=n,this._viewingMode=o,this._options=h,this._frustum=d(),this._useFrustumCulling=!1,this._poi=m(),this.minDistance=1/0,this.maxDistance=0,this.maxLodLevel=2,this._tmpObb=B(),this._tmp1=m(),this._tmp2=m(),this._tmp3=m(),this._tmp0=m(),this._screenspaceErrorBias=h.screenspaceErrorBias||1,this._progressiveLoadFactor=h.progressiveLoadFactor||1,this.updateCamera(i,s),this.engineSR=this._renderCoordsHelper.spatialReference,this.updateElevationInfo(a),this._tmpPoint=f(0,0,0,e),this._isECEFOBBInLocalMode=this._indexSR.isWGS84&&(this.engineSR.isWebMercator||v(this.engineSR)),this._indexSREllipsoidRadius=_(this._indexSR).radius}updateElevationInfo(e){null!=e?(this._elevationContext=R.fromElevationInfo(e),this._elevationContext.updateFeatureExpressionInfoContext(D(S(e,!1)))):this._elevationContext=null}updateCamera(e,t){this._useFrustumCulling=t,t&&g(e.viewMatrix,e.projectionMatrix,this._frustum),this._screenSizeFactor=1/(e.perScreenPixelRatio/2),this._camPos=e.eye,this.minDistance=1/0,this.maxDistance=0}setPointOfInterest(e){this._poi=e}updateScreenSpaceErrorBias(e){const t=this._screenspaceErrorBias;return this._screenspaceErrorBias=e,t}updateClippingArea(e){this._clippingArea=e}getElevationRange(i){if(e(this._elevationContext))return null;const s=i.mbs[0],r=i.mbs[1],n=i.mbs[2],o=i.mbs[3],a="relative-to-scene"===this._elevationContext.mode?"scene":"ground";if(this._elevationProvider.getSphereElevationBounds)return this._elevationProvider.getSphereElevationBounds(s,r,n,o,this._indexSR,a);const h=this._elevationProvider.getElevation(s,r,n,this._indexSR,a);return t(h)?{min:h,max:h}:null}getRenderMbs(e){const t=e.renderMbs;return E(t)||(l(t,e.mbs),this._elevationContext&&t[3]<I&&(this._tmpPoint.x=t[0],this._tmpPoint.y=t[1],this._tmpPoint.z=t[2],t[2]=M(this._tmpPoint,this._elevationProvider,this._elevationContext,this._renderCoordsHelper)),p(t,this._indexSR,t,this.engineSR)),t}getVisibilityObb(i){if(t(i.visibilityObb))return i.visibilityObb;const s=i.serviceObb,r=.01*this._indexSREllipsoidRadius;return e(s)||!P(s)||this._isECEFOBBInLocalMode&&s.halfSize.some((e=>e>r))?null:(i.serviceObbInRenderSR=this._computeRenderObb(s,i.serviceObbInRenderSR,i.mbs[3],i.elevationRange),i.serviceObbInRenderSR)}_computeRenderObb(i,s,r,n){if(e(s))s=B();else if(P(s))return s;let o=0,a=0;if(this._elevationContext&&t(n)&&Number.isFinite(n.min))switch(this._elevationContext.mode){case"relative-to-ground":o=this._elevationContext.geometryZWithOffset(i.center[2],this._renderCoordsHelper)+n.min-i.center[2],a=n.max-n.min;break;case"on-the-ground":o=n.min-i.center[2],a=n.max-n.min}else this._elevationContext&&r<I&&(this._tmpPoint.x=i.center[0],this._tmpPoint.y=i.center[1],this._tmpPoint.z=i.center[2],o=M(this._tmpPoint,this._elevationProvider,this._elevationContext,this._renderCoordsHelper)-i.center[2]);return a>0?(O(i,this._indexSR,this._tmpObb,this.engineSR,o),L(this._tmpObb,0,a,this._viewingMode,s)):O(i,this._indexSR,s,this.engineSR,o),s}isNodeVisible(e){const i=this.getRenderMbs(e);if(!this._isMBSinClippingArea(i))return!1;if(!this._useFrustumCulling)return!0;const s=this.getVisibilityObb(e);return t(s)?y(s,this._frustum):b(this._frustum,x(i))}isGeometryVisible(e){if(!this._useFrustumCulling)return!0;const i=e.geometryObb;return t(i)?y(i,this._frustum):this.isNodeVisible(e)}_isMBSinClippingArea(t){return!!e(this._clippingArea)||j(this._clippingArea,t)!==F.OUTSIDE}_screenSpaceDiameterMbs(e,t){const s=this.getRenderMbs(e),r=Math.sqrt(i(s,this._camPos)),n=r-s[3];return this._updateMinMaxDistance(r),n<0?.5*Number.MAX_VALUE:t/n*this._screenSizeFactor}calcCameraDistance(e){return this.calcCameraDistanceToCenter(e)-this.getRenderMbs(e)[3]}calcCameraDistanceToCenter(e){const t=this.getRenderMbs(e),i=s(t,this._camPos);return this._updateMinMaxDistance(i),i}calcAngleDependentLoD(e){const t=this.getRenderMbs(e),i=t[3],n=(Math.abs(t[0]*(t[0]-this._camPos[0])+t[1]*(t[1]-this._camPos[1])+t[2]*(t[2]-this._camPos[2]))/r(t)+i)/s(t,this._camPos);return Math.min(1,n)}hasLOD(e){return e.lodMetric!==C.None}_getDistancePlanarMode(e,t){const i=e[0]-t[0],s=e[1]-t[1],r=e[2]-t[2],n=i*i+s*s,o=t[3];if(n<=o*o)return Math.abs(r);const a=Math.sqrt(n)-o;return Math.sqrt(r*r+a*a)}_getDistanceGlobeMode(e,t){const m=r(t),l=r(e)-m;n(this._tmp0,e,o(e,t)/a(e));const p=i(t,this._tmp0),_=t[3];if(p<=_*_)return Math.abs(l);{const i=n(this._tmp0,t,1/m),a=m,p=_*_/2/a,u=n(this._tmp1,i,a-p),d=e,g=h(this._tmp2,d,u),b=h(this._tmp2,g,n(this._tmp3,i,o(i,g))),v=c(this._tmp2,u,n(this._tmp2,b,_/r(b)));let x=s(d,v);if(l>=2e5){const e=h(this._tmp1,d,v);let t=o(e,i)/r(e);t<.08&&(t=1e-4),x/=t}return x}}_getDistance(e,t){return this.engineSR===u(this.engineSR)?this._getDistanceGlobeMode(e,t):this._getDistancePlanarMode(e,t)}_updateMinMaxDistance(e){e>0?(this.minDistance=Math.min(this.minDistance,e),this.maxDistance=Math.max(this.maxDistance,e)):(this.minDistance=0,this.maxDistance=Math.max(this.maxDistance,-e))}getLodLevel(e){if(e.lodMetric===C.None)return 0;if(0===e.childCount)return this.maxLodLevel;if(this._useFrustumCulling&&this._progressiveLoadFactor<1){const t=this._progressiveLoadFactor*this._screenspaceErrorBias,i=this._screenspaceErrorBias;return this.evaluateLODmetric(e,t)?this.evaluateLODmetric(e,i)?2:1:0}return this.evaluateLODmetric(e,this._screenspaceErrorBias)?this.maxLodLevel:0}evaluateLODmetric(e,t){switch(e.lodMetric){case C.ScreenSpaceRelative:{const i=this.getRenderMbs(e),s=this._getDistance(this._camPos,i),r=2*s/this._screenSizeFactor,n=s+i[3];return this._updateMinMaxDistance(n),e.maxError*t<=r}case C.MaxScreenThreshold:{let i=this._screenSpaceDiameterMbs(e,e.mbs[3]*t);return this._options.angleDependentLoD&&(i*=this.calcAngleDependentLoD(e)),i<e.maxError}case C.RemovedFeatureDiameter:return this._screenSpaceDiameterMbs(e,e.maxError)*t<10;case C.DistanceRangeFromDefaultCamera:return this.calcCameraDistance(e)>e.maxError*t}return!1}distToPOI(e){const t=this.getRenderMbs(e);return s(t,this._poi)-t[3]}distCameraToPOI(){return s(this._camPos,this._poi)}}export{A as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.25/esri/copyright.txt for details.
4
4
  */
5
- import{isNone as e,unwrap as t,disposeMaybe as s,isSome as i}from"../../../../core/maybe.js";import r from"../../../../core/PooledArray.js";import{b as n,l as o,g as a,o as h,e as l,p as c}from"../../../../chunks/vec3.js";import{c as d}from"../../../../chunks/vec3f64.js";import{s as u}from"../../../../chunks/vec4.js";import{create as p,offset as g,contains as m,containsPoint as _,set as f,POSITIVE_INFINITY as P,equals as b}from"../../../../geometry/support/aaBoundingBox.js";import{create as S}from"../../../../geometry/support/plane.js";import{fromPoints as x}from"../../../../geometry/support/ray.js";import{PointHighlights as z}from"./PointHighlights.js";import{minimumDistancePlane as R,maximumDistancePlane as q,intersectLine as w,toAaBoundingBox as y}from"../../support/orientedBoundingBox.js";import{ShaderOutput as A}from"../../webgl-engine/core/shaderLibrary/ShaderOutput.js";import{Default3D as j}from"../../webgl-engine/lib/DefaultVertexAttributeLocations.js";import{newIntersectorResult as I}from"../../webgl-engine/lib/Intersector.js";import{IntersectorType as F,StoreResults as v}from"../../webgl-engine/lib/IntersectorInterfaces.js";import{VertexArrayObject as C}from"../../webgl-engine/lib/VertexArrayObject.js";import{VertexAttribute as E}from"../../webgl-engine/lib/VertexAttribute.js";import{P as H,a as N,g as O}from"../../../../chunks/PointRenderer.glsl.js";import{PointRendererTechnique as T}from"../../webgl-engine/shaders/PointRendererTechnique.js";import{PointRendererTechniqueConfiguration as L}from"../../webgl-engine/shaders/PointRendererTechniqueConfiguration.js";import{BufferObject as B}from"../../../webgl/BufferObject.js";import{DataType as D,PrimitiveType as M,Usage as U}from"../../../webgl/enums.js";import{VertexElementDescriptor as V}from"../../../webgl/VertexElementDescriptor.js";const W={positions:[new V(E.POSITION,3,D.FLOAT,0,12)],colors:[new V(E.COLOR,3,D.UNSIGNED_BYTE,0,3,!0)]};class k{constructor(e){this._params=e,this.type=F.PCL,this.isGround=!1,this._passParameters=new H,this._highlights=new z({forEachNode:e=>this.forEachNode(e),addHighlight:(e,t,s)=>this._addHighlight(e,t,s),removeHighlight:(e,t)=>this._removeHighlight(e,t)}),this.canRender=!0,this.layerUid="",this._slicePlaneEnabled=!1,this._techniqueConfig=new L,this._nodes=new r}get needsHighlight(){return this._highlights.hasHighlights}initializeRenderContext(e){this._context=e,this._techniqueRep=this._context.shaderTechniqueRepository,e.requestRender()}uninitializeRenderContext(){}intersect(e,t,s,i){const r=d(),f=d(),P=d(),b=d(),z=S(),A=e.camera.perScreenPixelRatio/2,j=e.camera.near;n(f,i,s);const F=1/o(f);a(f,f,F),h(P,f),u(z,f[0],f[1],f[2],-l(f,s));const C=new ee,E=new ee,H=new Array,N=p(),O=p(this._passParameters.clipBox);g(O,-s[0],-s[1],-s[2],O),this._nodes.forAll((o=>{const a=o.splatSize*this._passParameters.scaleFactor;let h=R(o.obb,z),d=q(o.obb,z);h-=K(a,h+j,this._passParameters,A,o.isLeaf),d-=K(a,d+j,this._passParameters,A,o.isLeaf);const u=d<0,p=null!=C.dist&&null!=E.dist&&C.dist<h*F&&E.dist>d*F;if(u||p)return;const S=J(a,d+j,this._passParameters,A,o.isLeaf);if(!w(o.obb,s,f,S))return;const x=S*S;y(o.obb,N),g(N,-s[0],-s[1],-s[2],N);const I=!m(O,N);n(b,o.origin,s);const T=o.coordinates.length/3;for(let n=0;n<T;n++){if(r[0]=b[0]+o.coordinates[3*n],r[1]=b[1]+o.coordinates[3*n+1],r[2]=b[2]+o.coordinates[3*n+2],I&&!_(O,r))continue;const h=l(r,f),d=c(r)-h*h;if(d>x)continue;let u=h+j;const p=K(a,u,this._passParameters,A,o.isLeaf);if(h-p<0)continue;u-=p;const g=J(a,u,this._passParameters,A,o.isLeaf);if(d>g*g)continue;const m=(h-p)*F,S=e=>(e.point=Q(o,n,e.point),e.dist=m,e.normal=P,e.node=o,e.pointId=n,e.layerUid=this.layerUid,e);if((null==C.dist||m<C.dist)&&(null==t||t(s,i,m))&&S(C),e.options.store!==v.MIN&&(null==E.dist||m>E.dist)&&(null==t||t(s,i,m))&&S(E),e.options.store===v.ALL&&(null==t||t(s,i,m))){const e=new ee;H.push(S(e))}}}));const T=e=>{const{layerUid:t,node:s,pointId:i}=e;return{point:e.point,layerUid:t,graphicUid:i,createGraphic:()=>this._params.createGraphic(s,i,e.point)}},L=(e,t)=>{const s=T(t);e.set(this.type,s,t.dist,t.normal)};if(te(C)){const t=e.results.min;(null==t.dist||C.dist<t.dist)&&L(t,C)}if(te(E)&&e.options.store!==v.MIN){const t=e.results.max;(null==t.dist||E.dist>t.dist)&&L(t,E)}if(e.options.store===v.ALL){const t=x(s,i);for(const s of H){const i=I(t);L(i,s),e.results.all.push(i)}}}prepareTechnique(e){return 0===this._nodes.length||e.output!==A.Color&&e.output!==A.Depth&&e.output!==A.Highlight?null:(this._nodes.forAll((t=>{null==t.vao&&this._initNode(e,t)})),this._techniqueConfig.drawScreenSize=this._passParameters.drawScreenSpace,this._techniqueConfig.useFixedSizes=this._passParameters.useFixedSizes,this._techniqueConfig.hasSlicePlane=this._slicePlaneEnabled,this._techniqueConfig.hasOccludees=e.bindParameters.hasOccludees,this._techniqueConfig.clippingEnabled=this._clippingEnabled,this._techniqueConfig.output=e.output===A.Depth?A.Depth:e.output===A.Highlight?A.Highlight:A.Color,this._techniqueRep.releaseAndAcquire(T,this._techniqueConfig,this._technique))}render(e,t){const s=e.rctx,i=s.bindTechnique(t,this._passParameters,e.bindParameters),r=e.output===A.Highlight;this._nodes.forAll((t=>{0===t.coordinates.length||r&&!t.highlights||(i.bindDraw(t,e.bindParameters,this._passParameters),s.bindVAO(t.vao),r?this._renderHighlightFragments(s,t):s.drawArrays(M.POINTS,0,t.coordinates.length/3))}))}_renderHighlightFragments(s,i){const r=i.highlights;if(e(r))return;let n=t(r[0].component),o=n+1;for(let e=1;e<r.length;e++){const i=t(r[e].component);if(i!==o){const e=o-n;e>0&&s.drawArrays(M.POINTS,n,e),n=i}o=i+1}const a=o-n;a>0&&s.drawArrays(M.POINTS,n,a)}set useFixedSizes(e){this._passParameters.useFixedSizes!==e&&(this._passParameters.useFixedSizes=e,this._requestRender())}get useFixedSizes(){return this._passParameters.useFixedSizes}set scaleFactor(e){this._passParameters.scaleFactor!==e&&(this._passParameters.scaleFactor=e,this._requestRender())}get scaleFactor(){return this._passParameters.scaleFactor}set minSizePx(e){this._passParameters.minSizePx!==e&&(this._passParameters.minSizePx=e,this._requestRender())}get minSizePx(){return this._passParameters.minSizePx}set useRealWorldSymbolSizes(e){this._passParameters.useRealWorldSymbolSizes!==e&&(this._passParameters.useRealWorldSymbolSizes=e,this._requestRender())}get useRealWorldSymbolSizes(){return this._passParameters.useRealWorldSymbolSizes}set size(e){this._passParameters.size!==e&&(this._passParameters.size=e,this._requestRender())}get size(){return this._passParameters.size}set sizePx(e){this._passParameters.sizePx!==e&&(this._passParameters.sizePx=e,this._requestRender())}get sizePx(){return this._passParameters.sizePx}set clippingBox(e){f(this._passParameters.clipBox,e||P)}get _clippingEnabled(){return!b(this._passParameters.clipBox,P,((e,t)=>e===t))}get slicePlaneEnabled(){return this._slicePlaneEnabled}set slicePlaneEnabled(e){this._slicePlaneEnabled!==e&&(this._slicePlaneEnabled=e,this._requestRender())}addNode(e){this._nodes.push(e),this._highlights.nodeAdded(e),this._requestRender()}removeNode(e){let t=null;return this._nodes.filterInPlace((i=>i.id!==e||(t=i,i.vao=s(i.vao),this._highlights.nodeRemoved(i),!1))),this._requestRender(),t}forEachNode(e){this._nodes.forAll(e)}removeAll(){this._nodes.forAll((e=>e.vao=s(e.vao))),this._highlights.removeAll(),this._nodes.clear(),this._requestRender()}highlight(e){return this._highlights.add(e)}_addHighlight(e,t,s){e.highlights=Z(e.highlights,t,s),this._requestRender()}_removeHighlight(e,t){e.highlights=$(e.highlights,t),this._requestRender()}_initNode(e,t){const s=e.rctx;t.vao=new C(s,j,W,{positions:B.createVertex(s,U.STATIC_DRAW,t.coordinates),colors:B.createVertex(s,U.STATIC_DRAW,t.rgb)})}_requestRender(){this._context&&this._context.requestRender()}}class G extends N{constructor(e,t,s,i,r,n,o,a,h=null,l=null){super(s,r,t),this.id=e,this.obb=i,this.coordinates=n,this.rgb=o,this.attributes=a,this.pointIdFilterMap=h,this.highlights=l}}function Y(e){return e.hasOwnProperty("splatSize")}function J(e,t,s,i,r){if(s.drawScreenSpace)return s.fixedSize*t*i;const n=O(r)*t*i;return s.useFixedSizes?Math.min(s.fixedSize/2,n):s.screenMinSize>0?Math.min(Math.max(s.screenMinSize*t*i,e/2),n):Math.min(e/2,n)}function K(e,t,s,i,r){return s.drawScreenSpace?0:J(e,t,s,i,r)}function Q(t,s,i){return e(i)&&(i=d()),i[0]=t.origin[0]+t.coordinates[3*s],i[1]=t.origin[1]+t.coordinates[3*s+1],i[2]=t.origin[2]+t.coordinates[3*s+2],i}function X(e){return i(e.component)?e.component:-1}function Z(t,s,i){e(t)&&(t=[]);const r={component:s,id:i};t.push(r);const n=X(r);let o=t.length-1;for(;o>0&&n<X(t[o-1]);)[t[o-1],t[o]]=[t[o],t[o-1]],--o;return t}function $(t,s){if(e(t))return t;const i=t.filter((e=>e.id!==s));return 0===i.length?null:i}class ee{constructor(){this.node=null,this.pointId=null,this.point=null,this.dist=null,this.normal=null,this.layerUid=""}}function te(e){return i(e.dist)&&i(e.point)&&i(e.pointId)&&i(e.node)}export{k as PointRenderer,G as PointRendererNode,Y as isInstanceOfNode};
5
+ import{isNone as e,unwrap as t,disposeMaybe as s,isSome as i}from"../../../../core/maybe.js";import r from"../../../../core/PooledArray.js";import{b as n,l as o,g as a,x as h,e as l,z as c}from"../../../../chunks/vec3.js";import{c as d}from"../../../../chunks/vec3f64.js";import{s as u}from"../../../../chunks/vec4.js";import{create as p,offset as g,contains as m,containsPoint as _,set as f,POSITIVE_INFINITY as P,equals as b}from"../../../../geometry/support/aaBoundingBox.js";import{create as S}from"../../../../geometry/support/plane.js";import{fromPoints as x}from"../../../../geometry/support/ray.js";import{PointHighlights as z}from"./PointHighlights.js";import{minimumDistancePlane as R,maximumDistancePlane as q,intersectLine as w,toAaBoundingBox as y}from"../../support/orientedBoundingBox.js";import{ShaderOutput as A}from"../../webgl-engine/core/shaderLibrary/ShaderOutput.js";import{Default3D as j}from"../../webgl-engine/lib/DefaultVertexAttributeLocations.js";import{newIntersectorResult as I}from"../../webgl-engine/lib/Intersector.js";import{IntersectorType as F,StoreResults as v}from"../../webgl-engine/lib/IntersectorInterfaces.js";import{VertexArrayObject as C}from"../../webgl-engine/lib/VertexArrayObject.js";import{VertexAttribute as E}from"../../webgl-engine/lib/VertexAttribute.js";import{P as H,a as N,g as O}from"../../../../chunks/PointRenderer.glsl.js";import{PointRendererTechnique as T}from"../../webgl-engine/shaders/PointRendererTechnique.js";import{PointRendererTechniqueConfiguration as L}from"../../webgl-engine/shaders/PointRendererTechniqueConfiguration.js";import{BufferObject as B}from"../../../webgl/BufferObject.js";import{DataType as D,PrimitiveType as M,Usage as U}from"../../../webgl/enums.js";import{VertexElementDescriptor as V}from"../../../webgl/VertexElementDescriptor.js";const W={positions:[new V(E.POSITION,3,D.FLOAT,0,12)],colors:[new V(E.COLOR,3,D.UNSIGNED_BYTE,0,3,!0)]};class k{constructor(e){this._params=e,this.type=F.PCL,this.isGround=!1,this._passParameters=new H,this._highlights=new z({forEachNode:e=>this.forEachNode(e),addHighlight:(e,t,s)=>this._addHighlight(e,t,s),removeHighlight:(e,t)=>this._removeHighlight(e,t)}),this.canRender=!0,this.layerUid="",this._slicePlaneEnabled=!1,this._techniqueConfig=new L,this._nodes=new r}get needsHighlight(){return this._highlights.hasHighlights}initializeRenderContext(e){this._context=e,this._techniqueRep=this._context.shaderTechniqueRepository,e.requestRender()}uninitializeRenderContext(){}intersect(e,t,s,i){const r=d(),f=d(),P=d(),b=d(),z=S(),A=e.camera.perScreenPixelRatio/2,j=e.camera.near;n(f,i,s);const F=1/o(f);a(f,f,F),h(P,f),u(z,f[0],f[1],f[2],-l(f,s));const C=new ee,E=new ee,H=new Array,N=p(),O=p(this._passParameters.clipBox);g(O,-s[0],-s[1],-s[2],O),this._nodes.forAll((o=>{const a=o.splatSize*this._passParameters.scaleFactor;let h=R(o.obb,z),d=q(o.obb,z);h-=K(a,h+j,this._passParameters,A,o.isLeaf),d-=K(a,d+j,this._passParameters,A,o.isLeaf);const u=d<0,p=null!=C.dist&&null!=E.dist&&C.dist<h*F&&E.dist>d*F;if(u||p)return;const S=J(a,d+j,this._passParameters,A,o.isLeaf);if(!w(o.obb,s,f,S))return;const x=S*S;y(o.obb,N),g(N,-s[0],-s[1],-s[2],N);const I=!m(O,N);n(b,o.origin,s);const T=o.coordinates.length/3;for(let n=0;n<T;n++){if(r[0]=b[0]+o.coordinates[3*n],r[1]=b[1]+o.coordinates[3*n+1],r[2]=b[2]+o.coordinates[3*n+2],I&&!_(O,r))continue;const h=l(r,f),d=c(r)-h*h;if(d>x)continue;let u=h+j;const p=K(a,u,this._passParameters,A,o.isLeaf);if(h-p<0)continue;u-=p;const g=J(a,u,this._passParameters,A,o.isLeaf);if(d>g*g)continue;const m=(h-p)*F,S=e=>(e.point=Q(o,n,e.point),e.dist=m,e.normal=P,e.node=o,e.pointId=n,e.layerUid=this.layerUid,e);if((null==C.dist||m<C.dist)&&(null==t||t(s,i,m))&&S(C),e.options.store!==v.MIN&&(null==E.dist||m>E.dist)&&(null==t||t(s,i,m))&&S(E),e.options.store===v.ALL&&(null==t||t(s,i,m))){const e=new ee;H.push(S(e))}}}));const T=e=>{const{layerUid:t,node:s,pointId:i}=e;return{point:e.point,layerUid:t,graphicUid:i,createGraphic:()=>this._params.createGraphic(s,i,e.point)}},L=(e,t)=>{const s=T(t);e.set(this.type,s,t.dist,t.normal)};if(te(C)){const t=e.results.min;(null==t.dist||C.dist<t.dist)&&L(t,C)}if(te(E)&&e.options.store!==v.MIN){const t=e.results.max;(null==t.dist||E.dist>t.dist)&&L(t,E)}if(e.options.store===v.ALL){const t=x(s,i);for(const s of H){const i=I(t);L(i,s),e.results.all.push(i)}}}prepareTechnique(e){return 0===this._nodes.length||e.output!==A.Color&&e.output!==A.Depth&&e.output!==A.Highlight?null:(this._nodes.forAll((t=>{null==t.vao&&this._initNode(e,t)})),this._techniqueConfig.drawScreenSize=this._passParameters.drawScreenSpace,this._techniqueConfig.useFixedSizes=this._passParameters.useFixedSizes,this._techniqueConfig.hasSlicePlane=this._slicePlaneEnabled,this._techniqueConfig.hasOccludees=e.bindParameters.hasOccludees,this._techniqueConfig.clippingEnabled=this._clippingEnabled,this._techniqueConfig.output=e.output===A.Depth?A.Depth:e.output===A.Highlight?A.Highlight:A.Color,this._techniqueRep.releaseAndAcquire(T,this._techniqueConfig,this._technique))}render(e,t){const s=e.rctx,i=s.bindTechnique(t,this._passParameters,e.bindParameters),r=e.output===A.Highlight;this._nodes.forAll((t=>{0===t.coordinates.length||r&&!t.highlights||(i.bindDraw(t,e.bindParameters,this._passParameters),s.bindVAO(t.vao),r?this._renderHighlightFragments(s,t):s.drawArrays(M.POINTS,0,t.coordinates.length/3))}))}_renderHighlightFragments(s,i){const r=i.highlights;if(e(r))return;let n=t(r[0].component),o=n+1;for(let e=1;e<r.length;e++){const i=t(r[e].component);if(i!==o){const e=o-n;e>0&&s.drawArrays(M.POINTS,n,e),n=i}o=i+1}const a=o-n;a>0&&s.drawArrays(M.POINTS,n,a)}set useFixedSizes(e){this._passParameters.useFixedSizes!==e&&(this._passParameters.useFixedSizes=e,this._requestRender())}get useFixedSizes(){return this._passParameters.useFixedSizes}set scaleFactor(e){this._passParameters.scaleFactor!==e&&(this._passParameters.scaleFactor=e,this._requestRender())}get scaleFactor(){return this._passParameters.scaleFactor}set minSizePx(e){this._passParameters.minSizePx!==e&&(this._passParameters.minSizePx=e,this._requestRender())}get minSizePx(){return this._passParameters.minSizePx}set useRealWorldSymbolSizes(e){this._passParameters.useRealWorldSymbolSizes!==e&&(this._passParameters.useRealWorldSymbolSizes=e,this._requestRender())}get useRealWorldSymbolSizes(){return this._passParameters.useRealWorldSymbolSizes}set size(e){this._passParameters.size!==e&&(this._passParameters.size=e,this._requestRender())}get size(){return this._passParameters.size}set sizePx(e){this._passParameters.sizePx!==e&&(this._passParameters.sizePx=e,this._requestRender())}get sizePx(){return this._passParameters.sizePx}set clippingBox(e){f(this._passParameters.clipBox,e||P)}get _clippingEnabled(){return!b(this._passParameters.clipBox,P,((e,t)=>e===t))}get slicePlaneEnabled(){return this._slicePlaneEnabled}set slicePlaneEnabled(e){this._slicePlaneEnabled!==e&&(this._slicePlaneEnabled=e,this._requestRender())}addNode(e){this._nodes.push(e),this._highlights.nodeAdded(e),this._requestRender()}removeNode(e){let t=null;return this._nodes.filterInPlace((i=>i.id!==e||(t=i,i.vao=s(i.vao),this._highlights.nodeRemoved(i),!1))),this._requestRender(),t}forEachNode(e){this._nodes.forAll(e)}removeAll(){this._nodes.forAll((e=>e.vao=s(e.vao))),this._highlights.removeAll(),this._nodes.clear(),this._requestRender()}highlight(e){return this._highlights.add(e)}_addHighlight(e,t,s){e.highlights=Z(e.highlights,t,s),this._requestRender()}_removeHighlight(e,t){e.highlights=$(e.highlights,t),this._requestRender()}_initNode(e,t){const s=e.rctx;t.vao=new C(s,j,W,{positions:B.createVertex(s,U.STATIC_DRAW,t.coordinates),colors:B.createVertex(s,U.STATIC_DRAW,t.rgb)})}_requestRender(){this._context&&this._context.requestRender()}}class G extends N{constructor(e,t,s,i,r,n,o,a,h=null,l=null){super(s,r,t),this.id=e,this.obb=i,this.coordinates=n,this.rgb=o,this.attributes=a,this.pointIdFilterMap=h,this.highlights=l}}function Y(e){return e.hasOwnProperty("splatSize")}function J(e,t,s,i,r){if(s.drawScreenSpace)return s.fixedSize*t*i;const n=O(r)*t*i;return s.useFixedSizes?Math.min(s.fixedSize/2,n):s.screenMinSize>0?Math.min(Math.max(s.screenMinSize*t*i,e/2),n):Math.min(e/2,n)}function K(e,t,s,i,r){return s.drawScreenSpace?0:J(e,t,s,i,r)}function Q(t,s,i){return e(i)&&(i=d()),i[0]=t.origin[0]+t.coordinates[3*s],i[1]=t.origin[1]+t.coordinates[3*s+1],i[2]=t.origin[2]+t.coordinates[3*s+2],i}function X(e){return i(e.component)?e.component:-1}function Z(t,s,i){e(t)&&(t=[]);const r={component:s,id:i};t.push(r);const n=X(r);let o=t.length-1;for(;o>0&&n<X(t[o-1]);)[t[o-1],t[o]]=[t[o],t[o-1]],--o;return t}function $(t,s){if(e(t))return t;const i=t.filter((e=>e.id!==s));return 0===i.length?null:i}class ee{constructor(){this.node=null,this.pointId=null,this.point=null,this.dist=null,this.normal=null,this.layerUid=""}}function te(e){return i(e.dist)&&i(e.point)&&i(e.pointId)&&i(e.node)}export{k as PointRenderer,G as PointRendererNode,Y as isInstanceOfNode};