@arcgis/core 4.25.0-next.20220920 → 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 (460) 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/{8588cbecb8e808f451fe.js → 249e32af1f2d433fae4c.js} +1 -1
  5. package/assets/esri/core/workers/chunks/{5b16b30ac3166f33e81e.js → 26690f4ec1f3cb8099c2.js} +1 -1
  6. package/assets/esri/core/workers/chunks/{be93b0cef85665446944.js → 274b4cdf6c8d77e8a2e6.js} +1 -1
  7. package/assets/esri/core/workers/chunks/{d5650f455ce5ba15ad10.js → 2cae0ec5f60ab42a49aa.js} +1 -1
  8. package/assets/esri/core/workers/chunks/{f436c86f86236ea7ea04.js → 4641e10e0e8e9d257521.js} +1 -1
  9. package/assets/esri/core/workers/chunks/{7a45333de9ded92619c2.js → 466008f793c2e11e854c.js} +1 -1
  10. package/assets/esri/core/workers/chunks/{c9d655675552dcf6cef7.js → 4a699b41072ee88f0956.js} +1 -1
  11. package/assets/esri/core/workers/chunks/{14ea96e398f4842abe4e.js → 4fdd18f5cdaa0d82ebc1.js} +1 -1
  12. package/assets/esri/core/workers/chunks/{9662da3e1e37f3445186.js → 562b9619b8ee13734813.js} +1 -1
  13. package/assets/esri/core/workers/chunks/{8bab21bc6164a593278f.js → 771b92e524802de840ba.js} +1 -1
  14. package/assets/esri/core/workers/chunks/{4969b64dc17378d7781f.js → 7ce250cc6fbe68aef50d.js} +3 -3
  15. package/assets/esri/core/workers/chunks/{2c4938512dd726a177dd.js → 7fab18074b130b71a648.js} +1 -1
  16. package/assets/esri/core/workers/chunks/{f67357b3c6c591c9da5e.js → 872f1cb3596fb80e387f.js} +1 -1
  17. package/assets/esri/core/workers/chunks/{31de71018575457155e5.js → 8ee3da8677255b8c8709.js} +1 -1
  18. package/assets/esri/core/workers/chunks/{2e44aee22e70857b893c.js → 93631b10452b0e0189b3.js} +1 -1
  19. package/assets/esri/core/workers/chunks/{cb2dc84d972469445da6.js → 95cd9edca50ea163d50f.js} +1 -1
  20. package/assets/esri/core/workers/chunks/{d31bbb13af45ce8e45dc.js → acf9f753741b677afb44.js} +1 -1
  21. package/assets/esri/core/workers/chunks/{1455944edeba1560eb07.js → afdafa77f5ca1b9e3acc.js} +1 -1
  22. package/assets/esri/core/workers/chunks/{cf3e1ac63580bc495ea6.js → b4da35f1093f3731f9ac.js} +1 -1
  23. package/assets/esri/core/workers/chunks/bb0d86937faf0cd7d16d.js +1 -0
  24. package/assets/esri/core/workers/chunks/bf3e80023e156d5906c7.js +1 -0
  25. package/assets/esri/core/workers/chunks/{8ba83fee56dd4f306d87.js → c2a6ac7046134f725cf3.js} +1 -1
  26. package/assets/esri/core/workers/chunks/{5d3fabe66e1bce1b30fb.js → cc7569489b572b8b3b53.js} +1 -1
  27. package/assets/esri/core/workers/chunks/{fddd4ea487788e003fb1.js → d09f06eb4157a7c2c8ab.js} +1 -1
  28. package/assets/esri/core/workers/chunks/e064035f959d68e9603f.js +1 -0
  29. package/assets/esri/core/workers/chunks/{d92975e56a1290255252.js → e09df62cf35d636b0975.js} +1 -1
  30. package/assets/esri/core/workers/chunks/{674fa5b93704ef08c9e8.js → e0c763e05feb1c2093ba.js} +1 -1
  31. package/assets/esri/core/workers/chunks/{51289d2f5277af4023e9.js → ed33e019bc7775db2e50.js} +1 -1
  32. package/assets/esri/core/workers/chunks/ef95d6ab7b1c032ab4ad.js +1 -0
  33. package/assets/esri/core/workers/chunks/{169f4354a375db5de121.js → ffcbcb928b6cb8c596ad.js} +1 -1
  34. package/assets/esri/t9n/common_ar.json +1 -1
  35. package/assets/esri/t9n/common_bg.json +1 -1
  36. package/assets/esri/t9n/common_bs.json +1 -1
  37. package/assets/esri/t9n/common_ca.json +1 -1
  38. package/assets/esri/t9n/common_cs.json +1 -1
  39. package/assets/esri/t9n/common_da.json +1 -1
  40. package/assets/esri/t9n/common_de.json +1 -1
  41. package/assets/esri/t9n/common_el.json +1 -1
  42. package/assets/esri/t9n/common_es.json +1 -1
  43. package/assets/esri/t9n/common_et.json +1 -1
  44. package/assets/esri/t9n/common_fi.json +1 -1
  45. package/assets/esri/t9n/common_fr.json +1 -1
  46. package/assets/esri/t9n/common_he.json +1 -1
  47. package/assets/esri/t9n/common_hr.json +1 -1
  48. package/assets/esri/t9n/common_hu.json +1 -1
  49. package/assets/esri/t9n/common_id.json +1 -1
  50. package/assets/esri/t9n/common_it.json +1 -1
  51. package/assets/esri/t9n/common_ja.json +1 -1
  52. package/assets/esri/t9n/common_ko.json +1 -1
  53. package/assets/esri/t9n/common_lt.json +1 -1
  54. package/assets/esri/t9n/common_lv.json +1 -1
  55. package/assets/esri/t9n/common_nb.json +1 -1
  56. package/assets/esri/t9n/common_nl.json +1 -1
  57. package/assets/esri/t9n/common_pl.json +1 -1
  58. package/assets/esri/t9n/common_pt-BR.json +1 -1
  59. package/assets/esri/t9n/common_pt-PT.json +1 -1
  60. package/assets/esri/t9n/common_ro.json +1 -1
  61. package/assets/esri/t9n/common_ru.json +1 -1
  62. package/assets/esri/t9n/common_sk.json +1 -1
  63. package/assets/esri/t9n/common_sl.json +1 -1
  64. package/assets/esri/t9n/common_sr.json +1 -1
  65. package/assets/esri/t9n/common_sv.json +1 -1
  66. package/assets/esri/t9n/common_th.json +1 -1
  67. package/assets/esri/t9n/common_tr.json +1 -1
  68. package/assets/esri/t9n/common_uk.json +1 -1
  69. package/assets/esri/t9n/common_vi.json +1 -1
  70. package/assets/esri/t9n/common_zh-CN.json +1 -1
  71. package/assets/esri/t9n/common_zh-HK.json +1 -1
  72. package/assets/esri/t9n/common_zh-TW.json +1 -1
  73. package/assets/esri/widgets/Feature/t9n/Feature_ar.json +1 -1
  74. package/assets/esri/widgets/Feature/t9n/Feature_bg.json +1 -1
  75. package/assets/esri/widgets/Feature/t9n/Feature_bs.json +1 -1
  76. package/assets/esri/widgets/Feature/t9n/Feature_ca.json +1 -1
  77. package/assets/esri/widgets/Feature/t9n/Feature_cs.json +1 -1
  78. package/assets/esri/widgets/Feature/t9n/Feature_da.json +1 -1
  79. package/assets/esri/widgets/Feature/t9n/Feature_de.json +1 -1
  80. package/assets/esri/widgets/Feature/t9n/Feature_el.json +1 -1
  81. package/assets/esri/widgets/Feature/t9n/Feature_es.json +1 -1
  82. package/assets/esri/widgets/Feature/t9n/Feature_et.json +1 -1
  83. package/assets/esri/widgets/Feature/t9n/Feature_fi.json +1 -1
  84. package/assets/esri/widgets/Feature/t9n/Feature_fr.json +1 -1
  85. package/assets/esri/widgets/Feature/t9n/Feature_he.json +1 -1
  86. package/assets/esri/widgets/Feature/t9n/Feature_hr.json +1 -1
  87. package/assets/esri/widgets/Feature/t9n/Feature_hu.json +1 -1
  88. package/assets/esri/widgets/Feature/t9n/Feature_id.json +1 -1
  89. package/assets/esri/widgets/Feature/t9n/Feature_it.json +1 -1
  90. package/assets/esri/widgets/Feature/t9n/Feature_ja.json +1 -1
  91. package/assets/esri/widgets/Feature/t9n/Feature_ko.json +1 -1
  92. package/assets/esri/widgets/Feature/t9n/Feature_lt.json +1 -1
  93. package/assets/esri/widgets/Feature/t9n/Feature_lv.json +1 -1
  94. package/assets/esri/widgets/Feature/t9n/Feature_nb.json +1 -1
  95. package/assets/esri/widgets/Feature/t9n/Feature_nl.json +1 -1
  96. package/assets/esri/widgets/Feature/t9n/Feature_pl.json +1 -1
  97. package/assets/esri/widgets/Feature/t9n/Feature_pt-BR.json +1 -1
  98. package/assets/esri/widgets/Feature/t9n/Feature_pt-PT.json +1 -1
  99. package/assets/esri/widgets/Feature/t9n/Feature_ro.json +1 -1
  100. package/assets/esri/widgets/Feature/t9n/Feature_ru.json +1 -1
  101. package/assets/esri/widgets/Feature/t9n/Feature_sk.json +1 -1
  102. package/assets/esri/widgets/Feature/t9n/Feature_sl.json +1 -1
  103. package/assets/esri/widgets/Feature/t9n/Feature_sr.json +1 -1
  104. package/assets/esri/widgets/Feature/t9n/Feature_sv.json +1 -1
  105. package/assets/esri/widgets/Feature/t9n/Feature_th.json +1 -1
  106. package/assets/esri/widgets/Feature/t9n/Feature_tr.json +1 -1
  107. package/assets/esri/widgets/Feature/t9n/Feature_uk.json +1 -1
  108. package/assets/esri/widgets/Feature/t9n/Feature_vi.json +1 -1
  109. package/assets/esri/widgets/Feature/t9n/Feature_zh-CN.json +1 -1
  110. package/assets/esri/widgets/Feature/t9n/Feature_zh-HK.json +1 -1
  111. package/assets/esri/widgets/Feature/t9n/Feature_zh-TW.json +1 -1
  112. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ar.json +1 -1
  113. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_bg.json +1 -1
  114. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_bs.json +1 -1
  115. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ca.json +1 -1
  116. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_cs.json +1 -1
  117. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_da.json +1 -1
  118. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_de.json +1 -1
  119. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_el.json +1 -1
  120. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_es.json +1 -1
  121. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_et.json +1 -1
  122. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_fi.json +1 -1
  123. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_fr.json +1 -1
  124. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_he.json +1 -1
  125. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_hr.json +1 -1
  126. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_hu.json +1 -1
  127. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_id.json +1 -1
  128. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_it.json +1 -1
  129. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ja.json +1 -1
  130. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ko.json +1 -1
  131. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_lt.json +1 -1
  132. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_lv.json +1 -1
  133. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_nb.json +1 -1
  134. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_nl.json +1 -1
  135. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_pl.json +1 -1
  136. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_pt-BR.json +1 -1
  137. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_pt-PT.json +1 -1
  138. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ro.json +1 -1
  139. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ru.json +1 -1
  140. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sk.json +1 -1
  141. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sl.json +1 -1
  142. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sr.json +1 -1
  143. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sv.json +1 -1
  144. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_th.json +1 -1
  145. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_tr.json +1 -1
  146. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_uk.json +1 -1
  147. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_vi.json +1 -1
  148. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_zh-CN.json +1 -1
  149. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_zh-HK.json +1 -1
  150. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_zh-TW.json +1 -1
  151. package/assets/esri/widgets/Popup/t9n/Popup_ar.json +1 -1
  152. package/assets/esri/widgets/Popup/t9n/Popup_bg.json +1 -1
  153. package/assets/esri/widgets/Popup/t9n/Popup_bs.json +1 -1
  154. package/assets/esri/widgets/Popup/t9n/Popup_ca.json +1 -1
  155. package/assets/esri/widgets/Popup/t9n/Popup_cs.json +1 -1
  156. package/assets/esri/widgets/Popup/t9n/Popup_da.json +1 -1
  157. package/assets/esri/widgets/Popup/t9n/Popup_de.json +1 -1
  158. package/assets/esri/widgets/Popup/t9n/Popup_el.json +1 -1
  159. package/assets/esri/widgets/Popup/t9n/Popup_es.json +1 -1
  160. package/assets/esri/widgets/Popup/t9n/Popup_et.json +1 -1
  161. package/assets/esri/widgets/Popup/t9n/Popup_fi.json +1 -1
  162. package/assets/esri/widgets/Popup/t9n/Popup_fr.json +1 -1
  163. package/assets/esri/widgets/Popup/t9n/Popup_he.json +1 -1
  164. package/assets/esri/widgets/Popup/t9n/Popup_hr.json +1 -1
  165. package/assets/esri/widgets/Popup/t9n/Popup_hu.json +1 -1
  166. package/assets/esri/widgets/Popup/t9n/Popup_id.json +1 -1
  167. package/assets/esri/widgets/Popup/t9n/Popup_it.json +1 -1
  168. package/assets/esri/widgets/Popup/t9n/Popup_ja.json +1 -1
  169. package/assets/esri/widgets/Popup/t9n/Popup_ko.json +1 -1
  170. package/assets/esri/widgets/Popup/t9n/Popup_lt.json +1 -1
  171. package/assets/esri/widgets/Popup/t9n/Popup_lv.json +1 -1
  172. package/assets/esri/widgets/Popup/t9n/Popup_nb.json +1 -1
  173. package/assets/esri/widgets/Popup/t9n/Popup_nl.json +1 -1
  174. package/assets/esri/widgets/Popup/t9n/Popup_pl.json +1 -1
  175. package/assets/esri/widgets/Popup/t9n/Popup_pt-BR.json +1 -1
  176. package/assets/esri/widgets/Popup/t9n/Popup_pt-PT.json +1 -1
  177. package/assets/esri/widgets/Popup/t9n/Popup_ro.json +1 -1
  178. package/assets/esri/widgets/Popup/t9n/Popup_ru.json +1 -1
  179. package/assets/esri/widgets/Popup/t9n/Popup_sk.json +1 -1
  180. package/assets/esri/widgets/Popup/t9n/Popup_sl.json +1 -1
  181. package/assets/esri/widgets/Popup/t9n/Popup_sr.json +1 -1
  182. package/assets/esri/widgets/Popup/t9n/Popup_sv.json +1 -1
  183. package/assets/esri/widgets/Popup/t9n/Popup_th.json +1 -1
  184. package/assets/esri/widgets/Popup/t9n/Popup_tr.json +1 -1
  185. package/assets/esri/widgets/Popup/t9n/Popup_uk.json +1 -1
  186. package/assets/esri/widgets/Popup/t9n/Popup_vi.json +1 -1
  187. package/assets/esri/widgets/Popup/t9n/Popup_zh-CN.json +1 -1
  188. package/assets/esri/widgets/Popup/t9n/Popup_zh-HK.json +1 -1
  189. package/assets/esri/widgets/Popup/t9n/Popup_zh-TW.json +1 -1
  190. package/assets/esri/widgets/support/t9n/DatePicker_ar.json +1 -1
  191. package/assets/esri/widgets/support/t9n/DatePicker_bg.json +1 -1
  192. package/assets/esri/widgets/support/t9n/DatePicker_bs.json +1 -1
  193. package/assets/esri/widgets/support/t9n/DatePicker_ca.json +1 -1
  194. package/assets/esri/widgets/support/t9n/DatePicker_cs.json +1 -1
  195. package/assets/esri/widgets/support/t9n/DatePicker_da.json +1 -1
  196. package/assets/esri/widgets/support/t9n/DatePicker_de.json +1 -1
  197. package/assets/esri/widgets/support/t9n/DatePicker_el.json +1 -1
  198. package/assets/esri/widgets/support/t9n/DatePicker_es.json +1 -1
  199. package/assets/esri/widgets/support/t9n/DatePicker_et.json +1 -1
  200. package/assets/esri/widgets/support/t9n/DatePicker_fi.json +1 -1
  201. package/assets/esri/widgets/support/t9n/DatePicker_fr.json +1 -1
  202. package/assets/esri/widgets/support/t9n/DatePicker_he.json +1 -1
  203. package/assets/esri/widgets/support/t9n/DatePicker_hr.json +1 -1
  204. package/assets/esri/widgets/support/t9n/DatePicker_hu.json +1 -1
  205. package/assets/esri/widgets/support/t9n/DatePicker_id.json +1 -1
  206. package/assets/esri/widgets/support/t9n/DatePicker_it.json +1 -1
  207. package/assets/esri/widgets/support/t9n/DatePicker_ja.json +1 -1
  208. package/assets/esri/widgets/support/t9n/DatePicker_ko.json +1 -1
  209. package/assets/esri/widgets/support/t9n/DatePicker_lt.json +1 -1
  210. package/assets/esri/widgets/support/t9n/DatePicker_lv.json +1 -1
  211. package/assets/esri/widgets/support/t9n/DatePicker_nb.json +1 -1
  212. package/assets/esri/widgets/support/t9n/DatePicker_nl.json +1 -1
  213. package/assets/esri/widgets/support/t9n/DatePicker_pl.json +1 -1
  214. package/assets/esri/widgets/support/t9n/DatePicker_pt-BR.json +1 -1
  215. package/assets/esri/widgets/support/t9n/DatePicker_pt-PT.json +1 -1
  216. package/assets/esri/widgets/support/t9n/DatePicker_ro.json +1 -1
  217. package/assets/esri/widgets/support/t9n/DatePicker_ru.json +1 -1
  218. package/assets/esri/widgets/support/t9n/DatePicker_sk.json +1 -1
  219. package/assets/esri/widgets/support/t9n/DatePicker_sl.json +1 -1
  220. package/assets/esri/widgets/support/t9n/DatePicker_sr.json +1 -1
  221. package/assets/esri/widgets/support/t9n/DatePicker_sv.json +1 -1
  222. package/assets/esri/widgets/support/t9n/DatePicker_th.json +1 -1
  223. package/assets/esri/widgets/support/t9n/DatePicker_tr.json +1 -1
  224. package/assets/esri/widgets/support/t9n/DatePicker_uk.json +1 -1
  225. package/assets/esri/widgets/support/t9n/DatePicker_vi.json +1 -1
  226. package/assets/esri/widgets/support/t9n/DatePicker_zh-CN.json +1 -1
  227. package/assets/esri/widgets/support/t9n/DatePicker_zh-HK.json +1 -1
  228. package/assets/esri/widgets/support/t9n/DatePicker_zh-TW.json +1 -1
  229. package/assets/esri/widgets/support/t9n/TimePicker_ar.json +1 -1
  230. package/assets/esri/widgets/support/t9n/TimePicker_bg.json +1 -1
  231. package/assets/esri/widgets/support/t9n/TimePicker_bs.json +1 -1
  232. package/assets/esri/widgets/support/t9n/TimePicker_ca.json +1 -1
  233. package/assets/esri/widgets/support/t9n/TimePicker_cs.json +1 -1
  234. package/assets/esri/widgets/support/t9n/TimePicker_da.json +1 -1
  235. package/assets/esri/widgets/support/t9n/TimePicker_de.json +1 -1
  236. package/assets/esri/widgets/support/t9n/TimePicker_el.json +1 -1
  237. package/assets/esri/widgets/support/t9n/TimePicker_es.json +1 -1
  238. package/assets/esri/widgets/support/t9n/TimePicker_et.json +1 -1
  239. package/assets/esri/widgets/support/t9n/TimePicker_fi.json +1 -1
  240. package/assets/esri/widgets/support/t9n/TimePicker_fr.json +1 -1
  241. package/assets/esri/widgets/support/t9n/TimePicker_he.json +1 -1
  242. package/assets/esri/widgets/support/t9n/TimePicker_hr.json +1 -1
  243. package/assets/esri/widgets/support/t9n/TimePicker_hu.json +1 -1
  244. package/assets/esri/widgets/support/t9n/TimePicker_id.json +1 -1
  245. package/assets/esri/widgets/support/t9n/TimePicker_it.json +1 -1
  246. package/assets/esri/widgets/support/t9n/TimePicker_ja.json +1 -1
  247. package/assets/esri/widgets/support/t9n/TimePicker_ko.json +1 -1
  248. package/assets/esri/widgets/support/t9n/TimePicker_lt.json +1 -1
  249. package/assets/esri/widgets/support/t9n/TimePicker_lv.json +1 -1
  250. package/assets/esri/widgets/support/t9n/TimePicker_nb.json +1 -1
  251. package/assets/esri/widgets/support/t9n/TimePicker_nl.json +1 -1
  252. package/assets/esri/widgets/support/t9n/TimePicker_pl.json +1 -1
  253. package/assets/esri/widgets/support/t9n/TimePicker_pt-BR.json +1 -1
  254. package/assets/esri/widgets/support/t9n/TimePicker_pt-PT.json +1 -1
  255. package/assets/esri/widgets/support/t9n/TimePicker_ro.json +1 -1
  256. package/assets/esri/widgets/support/t9n/TimePicker_ru.json +1 -1
  257. package/assets/esri/widgets/support/t9n/TimePicker_sk.json +1 -1
  258. package/assets/esri/widgets/support/t9n/TimePicker_sl.json +1 -1
  259. package/assets/esri/widgets/support/t9n/TimePicker_sr.json +1 -1
  260. package/assets/esri/widgets/support/t9n/TimePicker_sv.json +1 -1
  261. package/assets/esri/widgets/support/t9n/TimePicker_th.json +1 -1
  262. package/assets/esri/widgets/support/t9n/TimePicker_tr.json +1 -1
  263. package/assets/esri/widgets/support/t9n/TimePicker_uk.json +1 -1
  264. package/assets/esri/widgets/support/t9n/TimePicker_vi.json +1 -1
  265. package/assets/esri/widgets/support/t9n/TimePicker_zh-CN.json +1 -1
  266. package/assets/esri/widgets/support/t9n/TimePicker_zh-HK.json +1 -1
  267. package/assets/esri/widgets/support/t9n/TimePicker_zh-TW.json +1 -1
  268. package/chunks/Compositing.glsl.js +4 -19
  269. package/chunks/HUDCompositing.glsl.js +7 -0
  270. package/chunks/Laserlines.glsl.js +5 -5
  271. package/chunks/OITCompositing.glsl.js +13 -0
  272. package/chunks/OverlayCompositing.glsl.js +8 -0
  273. package/chunks/Precipitation.glsl.js +1 -1
  274. package/chunks/ShadowHighlight.glsl.js +1 -1
  275. package/chunks/boundedPlane.js +1 -1
  276. package/chunks/cameraUtilsPlanar.js +1 -1
  277. package/chunks/cameraUtilsSpherical.js +1 -1
  278. package/chunks/mat3.js +1 -1
  279. package/chunks/quat.js +1 -1
  280. package/chunks/quat2.js +1 -1
  281. package/chunks/quatf64.js +1 -1
  282. package/chunks/sphere.js +1 -1
  283. package/chunks/vec3.js +1 -1
  284. package/chunks/vec3f32.js +1 -1
  285. package/chunks/vec4f64.js +1 -1
  286. package/core/VectorStack.js +1 -1
  287. package/core/libs/gl-matrix-2/factories/quatf64.js +1 -1
  288. package/core/libs/gl-matrix-2/factories/vec3f32.js +1 -1
  289. package/core/libs/gl-matrix-2/factories/vec4f64.js +1 -1
  290. package/core/libs/gl-matrix-2/math/mat3.js +1 -1
  291. package/core/libs/gl-matrix-2/math/quat.js +1 -1
  292. package/core/libs/gl-matrix-2/math/vec3.js +1 -1
  293. package/core/perspectiveUtils.js +1 -1
  294. package/geohash/GeohashTree.js +1 -1
  295. package/geometry/support/MeshTransform.js +1 -1
  296. package/geometry/support/axisAngle.js +1 -1
  297. package/geometry/support/axisAngleDegrees.js +1 -1
  298. package/geometry/support/lineSegment.js +1 -1
  299. package/geometry/support/meshUtils/exporters/gltf/gltf.js +1 -1
  300. package/geometry/support/meshUtils/exporters/gltf/node.js +1 -1
  301. package/geometry/support/meshUtils/georeference.js +1 -1
  302. package/geometry/support/meshUtils/loadGLTFMesh.js +1 -1
  303. package/geometry/support/meshUtils/projection.js +1 -1
  304. package/geometry/support/meshUtils/rotate.js +1 -1
  305. package/geometry/support/plane.js +1 -1
  306. package/interfaces.d.ts +70 -0
  307. package/layers/buildingSublayers/BuildingComponentSublayer.js +1 -1
  308. package/layers/graphics/featureConversionUtils.js +1 -1
  309. package/layers/mixins/EditBusLayer.js +1 -1
  310. package/layers/support/AggregateField.js +1 -1
  311. package/layers/support/ControlPointsGeoreference.js +1 -1
  312. package/layers/support/OutStatistic.js +1 -1
  313. package/layers/support/VoxelVolume.js +1 -1
  314. package/layers/support/voxelPlaneUtils.js +1 -1
  315. package/package.json +1 -1
  316. package/rest/support/AggregateFeatureSet.js +5 -0
  317. package/support/revision.js +1 -1
  318. package/views/2d/ViewState.js +1 -1
  319. package/views/2d/engine/flow/FlowDisplayObject.js +1 -1
  320. package/views/2d/engine/imagery/RasterVFTile.js +1 -1
  321. package/views/2d/engine/vectorTiles/VectorTile.js +1 -1
  322. package/views/2d/engine/webgl/OverlayContainer.js +1 -1
  323. package/views/2d/engine/webgl/TiledDisplayObject.js +1 -1
  324. package/views/2d/engine/webgl/WGLTile.js +1 -1
  325. package/views/2d/engine/webgl/WorldExtentClipRenderer.js +1 -1
  326. package/views/2d/layers/FeatureLayerView2D.js +1 -1
  327. package/views/2d/layers/features/controllers/FeatureController2D.js +1 -1
  328. package/views/2d/layers/features/schemaUtils.js +1 -1
  329. package/views/2d/layers/features/support/BinStore.js +1 -1
  330. package/views/2d/layers/features/support/ClusterStore.js +1 -1
  331. package/views/2d/layers/graphics/GraphicBoundsRenderer.js +1 -1
  332. package/views/2d/layers/support/DebugOverlay.js +1 -1
  333. package/views/2d/layers/support/FeatureLayerProxy.js +1 -1
  334. package/views/2d/layers/support/clusterUtils.js +1 -1
  335. package/views/3d/analysis/AreaMeasurement/support/MeasurementData.js +1 -1
  336. package/views/3d/analysis/Dimensioning/LengthDimensionSubTool.js +1 -1
  337. package/views/3d/analysis/Dimensioning/LengthDimensionVisualization.js +1 -1
  338. package/views/3d/analysis/Dimensioning/lengthDimensionUtils.js +1 -1
  339. package/views/3d/analysis/LineOfSight/LineOfSightController.js +1 -1
  340. package/views/3d/analysis/Slice/SliceTool.js +1 -1
  341. package/views/3d/analysis/Slice/sliceToolConfig.js +1 -1
  342. package/views/3d/analysis/Slice/sliceToolUtils.js +1 -1
  343. package/views/3d/camera/constraintUtils/distance.js +1 -1
  344. package/views/3d/camera/constraintUtils/tilt.js +1 -1
  345. package/views/3d/environment/PanoramicAtmosphere.js +1 -1
  346. package/views/3d/environment/SceneViewEnvironmentManager.js +1 -1
  347. package/views/3d/environment/SimpleAtmosphere.js +1 -1
  348. package/views/3d/glTF/internal/Resource.js +1 -1
  349. package/views/3d/interactive/Manipulator3D.js +1 -1
  350. package/views/3d/interactive/editingTools/reshapeGraphic/edgeOffsetUtils.js +1 -1
  351. package/views/3d/interactive/editingTools/settings.js +1 -1
  352. package/views/3d/interactive/editingTools/transformGraphic/ExtentTransformTool.js +1 -1
  353. package/views/3d/interactive/editingTools/transformGraphic/GraphicScaleRotateTransform.js +1 -1
  354. package/views/3d/interactive/manipulatorUtils.js +1 -1
  355. package/views/3d/interactive/visualElements/ExtendedLineVisualElement.js +1 -1
  356. package/views/3d/interactive/visualElements/LineVisualElement.js +1 -1
  357. package/views/3d/interactive/visualElements/ParallelLineVisualElement.js +1 -1
  358. package/views/3d/layers/BuildingComponentSublayerView3D.js +1 -1
  359. package/views/3d/layers/I3SMeshView3D.js +1 -1
  360. package/views/3d/layers/PointCloudLayerView3D.js +1 -1
  361. package/views/3d/layers/PointCloudWorker.js +1 -1
  362. package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
  363. package/views/3d/layers/graphics/Deconflictor.js +1 -1
  364. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  365. package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
  366. package/views/3d/layers/graphics/Graphics3DFeatureProcessor.js +1 -1
  367. package/views/3d/layers/graphics/Graphics3DLodInstanceGraphicLayer.js +1 -1
  368. package/views/3d/layers/graphics/Graphics3DObject3DGraphicLayer.js +1 -1
  369. package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
  370. package/views/3d/layers/graphics/Graphics3DPathSymbolLayer.js +1 -1
  371. package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
  372. package/views/3d/layers/i3s/I3SElevationProvider.js +1 -1
  373. package/views/3d/layers/i3s/I3SIndex.js +1 -1
  374. package/views/3d/layers/i3s/I3SUtil.js +1 -1
  375. package/views/3d/layers/i3s/I3SViewportQueries.js +1 -1
  376. package/views/3d/layers/i3s/PointRenderer.js +1 -1
  377. package/views/3d/layers/support/FeatureTileVisibility3D.js +1 -1
  378. package/views/3d/layers/support/I3STreeDebugger.js +1 -1
  379. package/views/3d/layers/support/edgeUtils.js +1 -1
  380. package/views/3d/layers/support/uvUtils.js +1 -1
  381. package/views/3d/state/Frustum.js +1 -1
  382. package/views/3d/state/controllers/GamepadKeyboardController.js +1 -1
  383. package/views/3d/state/controllers/RotateController.js +1 -1
  384. package/views/3d/state/controllers/global/PinchAndPanController.js +1 -1
  385. package/views/3d/state/controllers/local/PinchAndPanController.js +1 -1
  386. package/views/3d/state/controllers/local/ZoomController.js +1 -1
  387. package/views/3d/state/controllers/momentum/ZoomPlanarMomentumController.js +1 -1
  388. package/views/3d/state/utils/navigationUtils.js +1 -1
  389. package/views/3d/support/FrustumExtentIntersection.js +1 -1
  390. package/views/3d/support/orientedBoundingBox.js +1 -1
  391. package/views/3d/support/pointsOfInterest/CameraOnSurface.js +1 -1
  392. package/views/3d/support/pointsOfInterest/CenterOnSurface.js +1 -1
  393. package/views/3d/support/pointsOfInterest/PointsOfInterest.js +1 -1
  394. package/views/3d/support/sunUtils.js +1 -1
  395. package/views/3d/terrain/OverlayRenderer.js +1 -1
  396. package/views/3d/terrain/PatchRenderData.js +1 -1
  397. package/views/3d/terrain/TerrainSurface.js +1 -1
  398. package/views/3d/terrain/Tile.js +1 -1
  399. package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
  400. package/views/3d/webgl-engine/collections/Component/DepthRange.js +1 -1
  401. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  402. package/views/3d/webgl-engine/core/renderPasses/RenderPassManager.js +1 -1
  403. package/views/3d/webgl-engine/core/shaderLibrary/Slice.glsl.js +1 -1
  404. package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexPosition.glsl.js +2 -2
  405. package/views/3d/webgl-engine/core/shaderTechnique/ShaderTechniqueRepository.js +1 -1
  406. package/views/3d/webgl-engine/core/util/TwoVectorPosition.js +1 -1
  407. package/views/3d/webgl-engine/lib/Camera.js +1 -1
  408. package/views/3d/webgl-engine/lib/CompositingHelper.js +1 -1
  409. package/views/3d/webgl-engine/lib/GeometryRecord.js +1 -1
  410. package/views/3d/webgl-engine/lib/GeometryUtil.js +1 -1
  411. package/views/3d/webgl-engine/lib/Highlight.js +1 -1
  412. package/views/3d/webgl-engine/lib/Intersector.js +1 -1
  413. package/views/3d/webgl-engine/lib/Object3D.js +1 -1
  414. package/views/3d/webgl-engine/lib/ObjectAndLayerIdRenderHelper.js +1 -1
  415. package/views/3d/webgl-engine/lib/OffscreenRendering.js +1 -1
  416. package/views/3d/webgl-engine/lib/RenderGeometry.js +1 -1
  417. package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
  418. package/views/3d/webgl-engine/lib/depthRangeUtils.js +1 -1
  419. package/views/3d/webgl-engine/lib/edgeRendering/EdgeRenderer.js +1 -1
  420. package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
  421. package/views/3d/webgl-engine/lib/edgeRendering/edgePreprocessing.js +1 -1
  422. package/views/3d/webgl-engine/lib/lodRendering/InstanceData.js +1 -1
  423. package/views/3d/webgl-engine/lib/lodRendering/InstanceOctree.js +1 -1
  424. package/views/3d/webgl-engine/lib/lodRendering/LodRenderer.js +1 -1
  425. package/views/3d/webgl-engine/lib/pathGeometryUtils.js +1 -1
  426. package/views/3d/webgl-engine/lib/verticalOffsetUtils.js +1 -1
  427. package/views/3d/webgl-engine/lighting/SphericalHarmonics.js +1 -1
  428. package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
  429. package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
  430. package/views/3d/webgl-engine/materials/MeasurementArrowMaterial.js +1 -1
  431. package/views/3d/webgl-engine/materials/NativeLineMaterial.js +1 -1
  432. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  433. package/views/3d/webgl-engine/shaders/Compositing.glsl.js +1 -1
  434. package/views/3d/webgl-engine/shaders/CompositingTechnique.js +1 -1
  435. package/views/3d/webgl-engine/shaders/CompositingTechniqueConfiguration.js +1 -1
  436. package/views/3d/webgl-engine/shaders/HUDCompositing.glsl.js +5 -0
  437. package/views/3d/webgl-engine/shaders/HUDCompositingTechnique.js +5 -0
  438. package/views/3d/webgl-engine/shaders/OITCompositing.glsl.js +5 -0
  439. package/views/3d/webgl-engine/shaders/OITCompositingTechnique.js +5 -0
  440. package/views/3d/webgl-engine/shaders/OverlayCompositing.glsl.js +5 -0
  441. package/views/3d/webgl-engine/shaders/OverlayCompositingTechnique.js +5 -0
  442. package/views/draw/support/surfaceCoordinateSystems.js +1 -1
  443. package/views/interactive/coordinateHelper.js +1 -1
  444. package/views/interactive/editGeometry/operations/OffsetEdgeVertex.js +1 -1
  445. package/views/interactive/editGeometry/support/editPlaneUtils.js +1 -1
  446. package/views/interactive/snapping/RightAngleSnapper.js +1 -1
  447. package/views/interactive/snapping/featureSources/sceneLayerSource/SceneLayerSnappingSourceWorker.js +1 -1
  448. package/views/layers/FeatureLayerView.js +1 -1
  449. package/views/navigation/PanSphericalMomentumEstimator.js +1 -1
  450. package/views/support/Scheduler.js +1 -1
  451. package/views/support/euclideanAreaMeasurementUtils.js +1 -1
  452. package/views/support/geometry3dUtils.js +1 -1
  453. package/widgets/ElevationProfile/support/ProfileLines3D.js +1 -1
  454. package/widgets/ElevationProfile/support/constants.js +1 -1
  455. package/widgets/Feature/FeatureRelationship/FeatureRelationshipViewModel.js +1 -1
  456. package/widgets/Feature/FeatureRelationship.js +1 -1
  457. package/assets/esri/core/workers/chunks/0059699bf824f851d51c.js +0 -1
  458. package/assets/esri/core/workers/chunks/36dd5654df5c7f00406d.js +0 -1
  459. package/assets/esri/core/workers/chunks/de128d8a643b4297940b.js +0 -1
  460. package/assets/esri/core/workers/chunks/e00327925ca82b63fded.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 has from"../../../../core/has.js";import{deg2rad as o}from"../../../../core/mathUtils.js";import{f as s}from"../../../../chunks/vec3f64.js";import{b as t,f as r}from"../../../../chunks/vec4f64.js";const c=has("mac")?"Meta":"Control",m="Shift",a=2,f=1.15,h=1.15,e=2500,i=.02,p=Math.cos(o(45)),j=Math.cos(o(5)),n=.95,M=.3,k=.7,l=s(1,.5,0),u=2,v=1,b=t([...l,k]),x=[0,0,0,.04],C=t([...l,.5]),S=r(1,1,1,1),U=r(1,.8,.6,1),d=r(1,.93,.86,1),g=t([...l,1]),q=t([...l,1]),w=3,y=11,z=22.5,A=40,B=48,D=2.25,E=t([...l,1]),F=4,G=1,H=.3,I=6,J=4,K=1600,L=.4;export{a as DISPLAY_FOCUS_MULTIPLIER,C as GRID_COLOR,i as INITIAL_DEPTH_OFFSET_FRAC,L as INITIAL_PLANE_HALF_SIZE_VIEW_PROPORTION,x as PLANE_BACKGROUND_COLOR,K as PLANE_MIN_BASIS_SCREEN_LEN2,b as PLANE_OUTLINE_COLOR,v as PLANE_OUTLINE_WIDTH,u as PLANE_PREVIEW_OUTLINE_WIDTH,e as POINTER_MOVE_TIMER_MS,n as PREVIEW_FADE_DOT_THRESHOLD,M as PREVIEW_FADE_DURATION_SECONDS,E as RESIZE_HANDLE_COLOR,I as RESIZE_HANDLE_CORNER_INPUT_RADIUS,F as RESIZE_HANDLE_CORNER_WIDTH,J as RESIZE_HANDLE_EDGE_INPUT_RADIUS,H as RESIZE_HANDLE_EDGE_PADDING_FRAC,G as RESIZE_HANDLE_EDGE_WIDTH,U as SHIFT_RESTART_ARROW_CAP_COLOR,B as SHIFT_RESTART_ARROW_LENGTH,D as SHIFT_RESTART_ARROW_OUTLINE_WIDTH,S as SHIFT_RESTART_ARROW_TIP_COLOR,g as SHIFT_RESTART_CALLOUT_COLOR,A as SHIFT_RESTART_OFFSET_DISTANCE,q as SHIFT_RESTART_OUTLINE_COLOR,h as SHIFT_RESTART_TIP_FOCUS_MULTIPLIER,z as SHIFT_RESTART_TIP_LENGTH,y as SHIFT_RESTART_TIP_RADIUS,d as SHIFT_RESTART_TUBE_COLOR,f as SHIFT_RESTART_TUBE_FOCUS_MULTIPLIER,w as SHIFT_RESTART_TUBE_RADIUS,j as SMALL_ANGLE_DOT_THRESHOLD,p as VERTICAL_DOT_THRESHOLD,c as forceHorizontalModifier,m as forceVerticalModifier};
5
+ import has from"../../../../core/has.js";import{deg2rad as o}from"../../../../core/mathUtils.js";import{f as s}from"../../../../chunks/vec3f64.js";import{a as t,f as r}from"../../../../chunks/vec4f64.js";const a=has("mac")?"Meta":"Control",c="Shift",m=2,f=1.15,h=1.15,e=2500,i=.02,p=Math.cos(o(45)),j=Math.cos(o(5)),n=.95,M=.3,k=.7,l=s(1,.5,0),u=2,v=1,x=t([...l,k]),C=[0,0,0,.04],S=t([...l,.5]),U=r(1,1,1,1),b=r(1,.8,.6,1),d=r(1,.93,.86,1),g=t([...l,1]),q=t([...l,1]),w=3,y=11,z=22.5,A=40,B=48,D=2.25,E=t([...l,1]),F=4,G=1,H=.3,I=6,J=4,K=1600,L=.4;export{m as DISPLAY_FOCUS_MULTIPLIER,S as GRID_COLOR,i as INITIAL_DEPTH_OFFSET_FRAC,L as INITIAL_PLANE_HALF_SIZE_VIEW_PROPORTION,C as PLANE_BACKGROUND_COLOR,K as PLANE_MIN_BASIS_SCREEN_LEN2,x as PLANE_OUTLINE_COLOR,v as PLANE_OUTLINE_WIDTH,u as PLANE_PREVIEW_OUTLINE_WIDTH,e as POINTER_MOVE_TIMER_MS,n as PREVIEW_FADE_DOT_THRESHOLD,M as PREVIEW_FADE_DURATION_SECONDS,E as RESIZE_HANDLE_COLOR,I as RESIZE_HANDLE_CORNER_INPUT_RADIUS,F as RESIZE_HANDLE_CORNER_WIDTH,J as RESIZE_HANDLE_EDGE_INPUT_RADIUS,H as RESIZE_HANDLE_EDGE_PADDING_FRAC,G as RESIZE_HANDLE_EDGE_WIDTH,b as SHIFT_RESTART_ARROW_CAP_COLOR,B as SHIFT_RESTART_ARROW_LENGTH,D as SHIFT_RESTART_ARROW_OUTLINE_WIDTH,U as SHIFT_RESTART_ARROW_TIP_COLOR,g as SHIFT_RESTART_CALLOUT_COLOR,A as SHIFT_RESTART_OFFSET_DISTANCE,q as SHIFT_RESTART_OUTLINE_COLOR,h as SHIFT_RESTART_TIP_FOCUS_MULTIPLIER,z as SHIFT_RESTART_TIP_LENGTH,y as SHIFT_RESTART_TIP_RADIUS,d as SHIFT_RESTART_TUBE_COLOR,f as SHIFT_RESTART_TUBE_FOCUS_MULTIPLIER,w as SHIFT_RESTART_TUBE_RADIUS,j as SMALL_ANGLE_DOT_THRESHOLD,p as VERTICAL_DOT_THRESHOLD,a as forceHorizontalModifier,c as forceVerticalModifier};
@@ -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"../../../../geometry.js";import t from"../../../../analysis/SlicePlane.js";import"../../../../core/has.js";import e from"../../../../core/Logger.js";import{rad2deg as i,deg2rad as n}from"../../../../core/mathUtils.js";import{isNone as r,isSome as s}from"../../../../core/maybe.js";import{castRenderScreenPointArray3 as o}from"../../../../core/screenUtils.js";import{o as a,b as c,k as l,m as u,r as d,i as m,v as p,D as g}from"../../../../chunks/mat4.js";import{c as f}from"../../../../chunks/mat4f64.js";import{r as b}from"../../../../chunks/quat.js";import{g as h,c as T,e as O,f as E,n as I,a as R,l as w,b as j,s as A,p as y,y as M}from"../../../../chunks/vec3.js";import{a as L,c as _,f as C}from"../../../../chunks/vec3f64.js";import{tryProjectWithZConversion as k}from"../../../../geometry/projection.js";import{Axis as N}from"../../../../geometry/support/Axis.js";import{r as P,f as v,i as U,a as V,n as S,u as F}from"../../../../chunks/boundedPlane.js";import{fromVectorsAndPoint as H,fromPositionAndNormal as x}from"../../../../geometry/support/plane.js";import{create as G}from"../../../../geometry/support/ray.js";import{angleAroundAxis as D}from"../../../../geometry/support/vector.js";import{sv3d as X,sm4d as Y,sq4d as Z}from"../../../../geometry/support/vectorStacks.js";import{VERTICAL_DOT_THRESHOLD as W,SMALL_ANGLE_DOT_THRESHOLD as z,PLANE_MIN_BASIS_SCREEN_LEN2 as B,INITIAL_PLANE_HALF_SIZE_VIEW_PROPORTION as q,SHIFT_RESTART_OFFSET_DISTANCE as $,RESIZE_HANDLE_EDGE_PADDING_FRAC as J,SHIFT_RESTART_ARROW_TIP_COLOR as K,SHIFT_RESTART_ARROW_CAP_COLOR as Q,SHIFT_RESTART_TUBE_COLOR as tt,SHIFT_RESTART_OUTLINE_COLOR as et,SHIFT_RESTART_CALLOUT_COLOR as it,SHIFT_RESTART_TIP_RADIUS as nt,PLANE_OUTLINE_COLOR as rt,PLANE_OUTLINE_WIDTH as st,PLANE_BACKGROUND_COLOR as ot,GRID_COLOR as at,RESIZE_HANDLE_CORNER_INPUT_RADIUS as ct,RESIZE_HANDLE_EDGE_INPUT_RADIUS as lt,SHIFT_RESTART_TIP_LENGTH as ut,SHIFT_RESTART_ARROW_LENGTH as dt,SHIFT_RESTART_TUBE_RADIUS as mt,SHIFT_RESTART_TUBE_FOCUS_MULTIPLIER as pt,SHIFT_RESTART_TIP_FOCUS_MULTIPLIER as gt,SHIFT_RESTART_ARROW_OUTLINE_WIDTH as ft,RESIZE_HANDLE_CORNER_WIDTH as bt,RESIZE_HANDLE_EDGE_WIDTH as ht,DISPLAY_FOCUS_MULTIPLIER as Tt,RESIZE_HANDLE_COLOR as Ot}from"./sliceToolConfig.js";import{applyProjectionAndElevationAlignment as Et}from"../support/projectionUtils.js";import{Manipulator3D as It}from"../../interactive/Manipulator3D.js";import{calculateTranslateRotateFromBases as Rt,createRotateManipulator as wt}from"../../interactive/manipulatorUtils.js";import{LineVisualElement as jt}from"../../interactive/visualElements/LineVisualElement.js";import{SlicePlaneVisualElement as At}from"../../interactive/visualElements/SlicePlaneVisualElement.js";import{RenderCoordsHelper as yt}from"../../support/RenderCoordsHelper.js";import{fromRender as Mt}from"../../support/geometryUtils/ray.js";import{CullFaceOptions as Lt}from"../../webgl-engine/lib/basicInterfaces.js";import{createPolylineGeometry as _t,createExtrudedTriangle as Ct,createConeGeometry as kt,createPathExtrusionGeometry as Nt}from"../../webgl-engine/lib/GeometryUtil.js";import{RenderOccludedFlag as Pt}from"../../webgl-engine/lib/Material.js";import{ColorMaterial as vt}from"../../webgl-engine/materials/ColorMaterial.js";import{NativeLineMaterial as Ut}from"../../webgl-engine/materials/NativeLineMaterial.js";import{RibbonLineMaterial as Vt}from"../../webgl-engine/materials/RibbonLineMaterial.js";import{ManipulatorStateCustomFlags as St,ManipulatorStateFlags as Ft}from"../../../interactive/interfaces.js";import Ht from"../../../../geometry/Extent.js";function xt(t,e,i,n,r,s,o,a){return Gt(e,o.worldUpAtPosition(t,X.get()),r,s,a.basis1,a.basis2),h(a.basis1,a.basis1,i),h(a.basis2,a.basis2,n),T(a.origin,t),H(a.basis2,a.basis1,a.origin,a.plane),a}function Gt(t,e,i,n,r,s){const o=O(t,e),a=X.get(),c=X.get();switch(n===Re.HORIZONTAL_OR_VERTICAL?Math.abs(o)>W?Re.HORIZONTAL:Re.VERTICAL:n){case Re.VERTICAL:{const n=Math.abs(o)<=z?t:i.viewUp;E(a,n,e),T(c,e);break}case Re.HORIZONTAL:E(a,i.viewUp,e),E(c,e,a);break;case Re.TILTED:{const n=Math.abs(o)<=z?e:i.viewUp;E(a,n,t),E(c,t,a);break}}const l=E(X.get(),a,c);O(l,i.viewForward)>0&&h(c,c,-1),I(r,a),I(s,c)}function Dt(t,e,i){const n=e.worldUpAtPosition(t.origin,X.get()),r=t.basis1,s=fe(t,n),o=Math.round(s/Ae)*Ae;return P(t,o-s,r,i)}function Xt(t,e,i,n,r,s){const o=T(X.get(),r.origin);R(o,o,h(X.get(),r.basis1,t.direction[0]<0?1:-1)),R(o,o,h(X.get(),r.basis2,t.direction[1]<0?1:-1));const a=w(r.basis1),c=w(r.basis2),l=j(X.get(),i,o),u=j(X.get(),e,o);let d=0,m=0;if(re(t)){const e=ne(r),i=ne(s);d=a-.5*t.direction[0]*O(r.basis1,u)/a,m=c-.5*t.direction[1]*O(r.basis2,u)/c;const n=i/e;d*=n,m*=n}const p=d+.5*t.direction[0]*O(r.basis1,l)/a,g=m+.5*t.direction[1]*O(r.basis2,l)/c,f=h(X.get(),r.basis1,p/a),b=h(X.get(),r.basis2,g/c);(p<=0||ee(s.origin,f,n)<=B)&&T(f,s.basis1),(g<=0||ee(s.origin,b,n)<=B)&&T(b,s.basis2);const E=T(X.get(),o);return R(E,E,h(X.get(),f,t.direction[0]<0?-1:1)),R(E,E,h(X.get(),b,t.direction[1]<0?-1:1)),v(E,f,b,s)}function Yt(t,e){return q*Math.min(e.width,e.height)*e.computeRenderPixelSizeAt(t)}function Zt(t,e,i,n){const r=E(X.get(),e,i);return E(r,r,e),x(t,r,n)}function Wt(t,e){return Rt(t.basis1,t.basis2,t.origin,e)}function zt(t,e,i,n){const r=e.worldUpAtPosition(t.origin,X.get()),s=X.get();switch(i){case Ie.HEADING:T(s,r);break;case Ie.TILT:T(s,t.basis1)}return x(t.origin,s,n)}function Bt(t,e,i,n){const r=te(i,Qt.NEGATIVE_X),s=Y.get();a(s,e,r.edge*Math.PI/2);const c=I(X.get(),r.basis);let l=h(X.get(),c,r.direction*n.computeScreenPixelSizeAt(r.position)*$);R(l,l,r.position);const u=n.projectToRenderScreen(l,o(X.get())),d=qt(n,u);Mt(n,u,je),I(je.direction,je.direction);const m=X.get();!d&&U(i,je,m)&&(l=m),s[12]=0,s[13]=0,s[14]=0,t.modelTransform=s,t.renderLocation=L(l),d?t.state|=we:t.state&=~we}function qt(t,e){const[i,n,r,s]=t.viewport,o=Math.min(r,s)/16;let a=!0;return e[0]<i+o?(e[0]=i+o,a=!1):e[0]>i+r-o&&(e[0]=i+r-o,a=!1),e[1]<n+o?(e[1]=n+o,a=!1):e[1]>n+s-o&&(e[1]=n+s-o,a=!1),a}function $t(t,e,i,n){const r=w(n.basis1),s=w(n.basis2),o=ie(n),a=ne(n),d=A(X.get(),0,0,0);R(d,h(X.get(),n.basis1,e.direction[0]),h(X.get(),n.basis2,e.direction[1])),R(d,n.origin,d);let m=0,p=1;if(re(e))1===e.direction[0]&&-1===e.direction[1]?m=Ae:1===e.direction[0]&&1===e.direction[1]?m=Math.PI:-1===e.direction[0]&&1===e.direction[1]&&(m=3*Math.PI/2),p=a;else{const t=0!==e.direction[0]?1:2;m=1===t?Ae:0,p=(1===t?s:r)-o}const g=c(Y.get(),m);l(g,g,A(X.get(),p,p,p)),u(g,i,g),g[12]=0,g[13]=0,g[14]=0,t.modelTransform=g,t.renderLocation=d}function Jt(t,e,i,n){const r=n.worldUpAtPosition(i.origin,X.get()),s=te(i,Qt.POSITIVE_X),o=c(Y.get(),s.edge*Math.PI/2);d(o,o,-fe(i,r)),u(o,e,o),o[12]=0,o[13]=0,o[14]=0,t.modelTransform=o,t.renderLocation=s.position}function Kt(t,e,i){const n=te(i,Qt.POSITIVE_Y),r=c(Y.get(),n.edge*Math.PI/2);d(r,r,Ae),u(r,e,r),r[12]=0,r[13]=0,r[14]=0,t.modelTransform=r,t.renderLocation=n.position}var Qt;function te(t,e){switch(e){case Qt.POSITIVE_X:return{basis:t.basis1,direction:1,position:R(X.get(),t.origin,t.basis1),edge:e};case Qt.POSITIVE_Y:return{basis:t.basis2,direction:1,position:R(X.get(),t.origin,t.basis2),edge:e};case Qt.NEGATIVE_X:return{basis:t.basis1,direction:-1,position:j(X.get(),t.origin,t.basis1),edge:e};case Qt.NEGATIVE_Y:return{basis:t.basis2,direction:-1,position:j(X.get(),t.origin,t.basis2),edge:e}}}function ee(t,e,i){const n=i.projectToRenderScreen(R(X.get(),t,e),o(X.get())),r=i.projectToRenderScreen(j(X.get(),t,e),o(X.get()));return y(j(n,n,r))}function ie(t){const e=w(t.basis1),i=w(t.basis2);return J*Math.min(e,i)}function ne(t){return ie(t)}function re(t){return 0!==t.direction[0]&&0!==t.direction[1]}function se(t,e=Le.CENTER_ON_ARROW){const i=e===Le.CENTER_ON_CALLOUT?$:0,n=[C(i,0,-dt/2),C(i,0,dt/2)],r=me(n,!0),s=(t,e)=>ue(n,n,{tubeRadius:mt,tipRadius:nt,tipLength:ut,tubeFocusMultiplier:pt,tipFocusMultiplier:gt,padding:t,bothEnds:!0,flat:null,focusTipLength:!0,addCap:e}),o=s(0,!1),a=s(ft,!0),c=new vt({color:K,cullFace:Lt.Back,renderOccluded:Pt.Opaque}),l=new vt({color:Q,cullFace:Lt.Back,renderOccluded:Pt.Opaque}),u=new vt({color:tt,cullFace:Lt.Back,renderOccluded:Pt.Opaque}),d=new vt({color:et,transparent:!0,writeDepth:!1,cullFace:Lt.Front,renderOccluded:Pt.Transparent}),m=_t([[i,0,0],[i-$,0,0]]),p=_t([[i,0,0],[i-$,0,0]]),g=new Ut({color:it,renderOccluded:Pt.OccludeAndTransparent});return new It({view:t,renderObjects:[...o.normal.map((({part:t,geometry:e,transform:i})=>({geometry:e,material:"tip"===t?c:"cap"===t?l:u,transform:i,stateMask:Ft.Unfocused|Ee}))),...a.normal.map((({geometry:t,transform:e})=>({geometry:t,material:d,transform:e,stateMask:Ft.Unfocused|Ee}))),{geometry:m,material:g,stateMask:Ft.Unfocused|Ee|we},...o.focused.map((({part:t,geometry:e,transform:i})=>({geometry:e,material:"tip"===t?c:"cap"===t?l:u,transform:i,stateMask:Ft.Focused|Ee}))),...a.focused.map((({geometry:t,transform:e})=>({geometry:t,material:d,transform:e,stateMask:Ft.Focused|Ee}))),{geometry:p,material:g,stateMask:Ft.Focused|Ee|we}],autoScaleRenderObjects:!1,collisionType:{type:"line",paths:[r]},collisionPriority:1,radius:nt,state:Ee})}function oe(t,e){const i=wt(t,e,Ee);return i.state=Ee,i}function ae(t){const e=[[-1,-1,0],[1,-1,0],[1,1,0],[-1,1,0],[-1,-1,0]];return new jt({view:t,attached:!0,color:rt,width:st,writeDepthEnabled:!1,renderOccluded:Pt.OccludeAndTransparent,geometry:[e]})}function ce(t){return new At({view:t,attached:!0,backgroundColor:[...ot],gridColor:at,gridWidth:4,renderOccluded:Pt.OccludeAndTransparent})}function le(t,e){const i=re(e),n=i?[C(1,0,0),C(0,0,0),C(0,1,0)]:[C(1,0,0),C(-1,0,0)],r=_t(n),s=Ot,o=t=>new Vt({color:s,width:t,renderOccluded:Pt.OccludeAndTransparent}),a=()=>new Ut({color:s,renderOccluded:Pt.OccludeAndTransparent}),c=i?bt:ht,l=c*Tt,u=ht,d=t=>t>1?o(t):a(),m=[{geometry:r,material:d(c),stateMask:Ft.Unfocused|ye},{geometry:r,material:d(l),stateMask:Ft.Focused|ye},{geometry:r,material:d(u),stateMask:Me}],p=new It({view:t,renderObjects:m,collisionType:{type:"line",paths:[n]},autoScaleRenderObjects:!1,worldSized:!0,radius:i?ct:lt});return p.state=ye,p}function ue(t,e,i){const n=n=>{const r=(n?e:t).slice(0),o=j(X.get(),r[0],r[1]);I(o,o);const a=j(X.get(),r[r.length-1],r[r.length-2]);if(I(a,a),i.padding>0){const t=h(_(),a,-i.padding);if(r[r.length-1]=R(t,t,r[r.length-1]),i.bothEnds){const t=h(_(),o,-i.padding);r[0]=R(t,t,r[0])}}const c=n?i.tipFocusMultiplier:1,d=i.tipLength*(i.focusTipLength?c:1),T=i.tipRadius*c,O=m(Y.get());if(i.padding>0){const t=d/4,e=A(X.get(),0,t,0),n=1+i.padding/t;p(O,O,e),l(O,O,A(X.get(),n,n,n)),p(O,O,h(e,e,-1/n))}const E=m(f()),w=C(0,1,0),y=g(f(),b(Z.get(),w,a));y[12]=r[r.length-1][0],y[13]=r[r.length-1][1],y[14]=r[r.length-1][2],u(y,y,O);const M=[{part:"tube",geometry:de(i.tubeRadius*(n?i.tubeFocusMultiplier:1)+i.padding,i.flat,r),transform:E}];let L,k;if(s(i.flat)?L=Ct(d,T,T,i.flat.thickness):(L=kt(d,T,24,!1,!1,!0),k=kt(d,T,24,!1,!0,!1)),M.push({part:"tip",geometry:L,transform:y}),k&&M.push({part:"cap",geometry:k,transform:y}),i.bothEnds){const t=g(f(),b(Z.get(),w,o));t[12]=r[0][0],t[13]=r[0][1],t[14]=r[0][2],u(t,t,O),M.push({part:"tip",geometry:L,transform:t}),k&&M.push({part:"cap",geometry:k,transform:t})}return M};return{normal:n(!1),focused:n(!0)}}function de(t,e,i){const n=[];if(s(e))n.push([t,e.thickness/2],[-t,e.thickness/2],[-t,-e.thickness/2],[t,-e.thickness/2]);else{const e=12;for(let i=0;i<e;i++){const r=i/e*2*Math.PI;n.push([Math.cos(r)*t,Math.sin(r)*t])}}return Nt(n,i,[],[],!1)}function me(t,e){const i=j(_(),t[t.length-1],t[t.length-2]);if(I(i,i),h(i,i,ut),R(i,i,t[t.length-1]),e){const e=j(_(),t[0],t[1]);return I(e,e),h(e,e,ut),R(e,e,t[0]),[e,...t,i]}return[...t,i]}function pe(e,n,s,o=new t){if(r(e))return null;const{renderCoordsHelper:a}=n,c=a.fromRenderCoords(e.origin,n.spatialReference);if(r(c))return null;const l=k(c,s);if(r(l))return null;o.position=l;const u=2*w(e.basis1),d=2*w(e.basis2),m=yt.renderUnitScaleFactor(n.spatialReference,s);o.width=u*m,o.height=d*m;const p=a.worldUpAtPosition(e.origin,X.get());return o.tilt=i(fe(e,p)),o.heading=a.headingAtPosition(e.origin,e.basis1)-90,o}function ge(t,e,i){if(r(t))return null;const n=t.origin,s=X.get(),o=X.get(),a=X.get(),c=X.get();let l,u,d,m,p,g;R(s,n,t.basis1),R(s,s,t.basis2),R(o,n,t.basis1),M(o,o,t.basis2),M(a,n,t.basis1),M(a,a,t.basis2),M(c,n,t.basis1),R(c,c,t.basis2);for(const f of[s,o,a,c]){const t=e.fromRenderCoords(f,f,i);if(r(t))return null;l=null==l?t[0]:Math.min(l,t[0]),u=null==u?t[0]:Math.max(u,t[0]),d=null==d?t[1]:Math.min(d,t[1]),m=null==m?t[1]:Math.max(m,t[1]),p=null==p?t[2]:Math.min(p,t[2]),g=null==g?t[2]:Math.max(g,t[2])}return new Ht({xmin:l,xmax:u,ymin:d,ymax:m,zmin:p,zmax:g,spatialReference:i})}function fe(t,e){return D(e,t.basis2,t.basis1)+Ae}function be(t,i,r,s,o,a,c=V()){return a.toRenderCoords(t,c.origin)?(a.worldBasisAtPosition(c.origin,N.X,c.basis1),a.worldBasisAtPosition(c.origin,N.Y,c.basis2),H(c.basis2,c.basis1,c.origin,c.plane),P(c,-n(i),S(c),c),P(c,n(r),c.basis1,c),h(c.basis1,c.basis1,s/2),h(c.basis2,c.basis2,o/2),F(c),c):(e.getLogger("esri.views.3d.analysis.Slice.sliceToolUtils").error(`Failed to project slice plane position, projection from ${t.spatialReference.wkid} is not supported`),null)}function he(t,e){if(r(t)||r(t.position))return null;const i=Et(t.position,e.spatialReference,e.elevationProvider);if(r(i))return null;const n=yt.renderUnitScaleFactor(t.position.spatialReference,e.spatialReference),s=t.width*n,o=t.height*n;return{position:i,heading:t.heading,tilt:t.tilt,renderWidth:s,renderHeight:o}}function Te(t,e,i,n=V()){const s=he(t,e);return r(s)?null:Oe(s,e,i,n)}function Oe(t,e,i,n=V()){if(r(t))return null;const o=be(t.position,t.heading,t.tilt,t.renderWidth,t.renderHeight,e.renderCoordsHelper,n);return!i.tiltEnabled&&s(o)&&Dt(o,e.renderCoordsHelper,o),o}!function(t){t[t.POSITIVE_X=0]="POSITIVE_X",t[t.POSITIVE_Y=1]="POSITIVE_Y",t[t.NEGATIVE_X=2]="NEGATIVE_X",t[t.NEGATIVE_Y=3]="NEGATIVE_Y"}(Qt||(Qt={}));const Ee=St.Custom1;var Ie,Re;!function(t){t[t.HEADING=1]="HEADING",t[t.TILT=2]="TILT"}(Ie||(Ie={})),function(t){t[t.HORIZONTAL_OR_VERTICAL=0]="HORIZONTAL_OR_VERTICAL",t[t.HORIZONTAL=1]="HORIZONTAL",t[t.VERTICAL=2]="VERTICAL",t[t.TILTED=3]="TILTED"}(Re||(Re={}));const we=St.Custom2,je=G(),Ae=Math.PI/2,ye=St.Custom1,Me=St.Custom2;var Le;function _e(t){const e="building-scene-3d"===t.type?t:null;return s(e)}!function(t){t[t.CENTER_ON_CALLOUT=0]="CENTER_ON_CALLOUT",t[t.CENTER_ON_ARROW=1]="CENTER_ON_ARROW"}(Le||(Le={}));export{Ee as DidPointerMoveRecentlyFlag,we as IsShiftEdgeOnScreenFlag,Le as OffsetMode,Ie as RotationAxis,Re as SliceOrientation,me as addArrowTips,Wt as calculateBoundedPlaneTranslateRotate,ne as calculateDiagonalResizeHandleScale,Yt as calculatePlaneHalfSize,ie as calculateResizeHandlePadding,ee as calculateScreenSpaceBasisLength2,ue as createArrowGeometry,ce as createGridVisualElement,ae as createOutlineVisualElement,xt as createPlane,le as createResizeManipulator,oe as createRotateManipulator,zt as createRotatePlane,se as createShiftManipulator,Zt as createShiftPlane,Dt as forceHorizontalOrVertical,re as isDiagonalResizeHandle,_e as isIBuildingSceneLayerView3D,Gt as normalToBases,ge as planeToExtent,pe as planeToShape,he as projectAndElevationAlignShape,Oe as projectedShapeToPlane,ye as resizeNormal,Me as resizeOutlineOnly,Xt as resizePlane,Te as shapeToPlane,$t as updateResizeHandle,Jt as updateRotateHeadingHandle,Kt as updateRotateTiltHandle,Bt as updateShiftRestartHandle};
5
+ import"../../../../geometry.js";import t from"../../../../analysis/SlicePlane.js";import"../../../../core/has.js";import e from"../../../../core/Logger.js";import{rad2deg as i,deg2rad as n}from"../../../../core/mathUtils.js";import{isNone as r,isSome as s}from"../../../../core/maybe.js";import{castRenderScreenPointArray3 as o}from"../../../../core/screenUtils.js";import{o as a,b as c,k as l,m as u,r as d,i as m,v as p,D as g}from"../../../../chunks/mat4.js";import{c as f}from"../../../../chunks/mat4f64.js";import{r as b}from"../../../../chunks/quat.js";import{g as h,c as T,e as O,f as E,n as I,a as R,l as w,b as j,s as A,z as y,p as M}from"../../../../chunks/vec3.js";import{a as L,c as _,f as C}from"../../../../chunks/vec3f64.js";import{tryProjectWithZConversion as k}from"../../../../geometry/projection.js";import{Axis as N}from"../../../../geometry/support/Axis.js";import{r as P,f as v,i as U,a as V,n as S,u as F}from"../../../../chunks/boundedPlane.js";import{fromVectorsAndPoint as H,fromPositionAndNormal as x}from"../../../../geometry/support/plane.js";import{create as G}from"../../../../geometry/support/ray.js";import{angleAroundAxis as D}from"../../../../geometry/support/vector.js";import{sv3d as X,sm4d as Y,sq4d as Z}from"../../../../geometry/support/vectorStacks.js";import{VERTICAL_DOT_THRESHOLD as z,SMALL_ANGLE_DOT_THRESHOLD as W,PLANE_MIN_BASIS_SCREEN_LEN2 as B,INITIAL_PLANE_HALF_SIZE_VIEW_PROPORTION as q,SHIFT_RESTART_OFFSET_DISTANCE as $,RESIZE_HANDLE_EDGE_PADDING_FRAC as J,SHIFT_RESTART_ARROW_TIP_COLOR as K,SHIFT_RESTART_ARROW_CAP_COLOR as Q,SHIFT_RESTART_TUBE_COLOR as tt,SHIFT_RESTART_OUTLINE_COLOR as et,SHIFT_RESTART_CALLOUT_COLOR as it,SHIFT_RESTART_TIP_RADIUS as nt,PLANE_OUTLINE_COLOR as rt,PLANE_OUTLINE_WIDTH as st,PLANE_BACKGROUND_COLOR as ot,GRID_COLOR as at,RESIZE_HANDLE_CORNER_INPUT_RADIUS as ct,RESIZE_HANDLE_EDGE_INPUT_RADIUS as lt,SHIFT_RESTART_TIP_LENGTH as ut,SHIFT_RESTART_ARROW_LENGTH as dt,SHIFT_RESTART_TUBE_RADIUS as mt,SHIFT_RESTART_TUBE_FOCUS_MULTIPLIER as pt,SHIFT_RESTART_TIP_FOCUS_MULTIPLIER as gt,SHIFT_RESTART_ARROW_OUTLINE_WIDTH as ft,RESIZE_HANDLE_CORNER_WIDTH as bt,RESIZE_HANDLE_EDGE_WIDTH as ht,DISPLAY_FOCUS_MULTIPLIER as Tt,RESIZE_HANDLE_COLOR as Ot}from"./sliceToolConfig.js";import{applyProjectionAndElevationAlignment as Et}from"../support/projectionUtils.js";import{Manipulator3D as It}from"../../interactive/Manipulator3D.js";import{calculateTranslateRotateFromBases as Rt,createRotateManipulator as wt}from"../../interactive/manipulatorUtils.js";import{LineVisualElement as jt}from"../../interactive/visualElements/LineVisualElement.js";import{SlicePlaneVisualElement as At}from"../../interactive/visualElements/SlicePlaneVisualElement.js";import{RenderCoordsHelper as yt}from"../../support/RenderCoordsHelper.js";import{fromRender as Mt}from"../../support/geometryUtils/ray.js";import{CullFaceOptions as Lt}from"../../webgl-engine/lib/basicInterfaces.js";import{createPolylineGeometry as _t,createExtrudedTriangle as Ct,createConeGeometry as kt,createPathExtrusionGeometry as Nt}from"../../webgl-engine/lib/GeometryUtil.js";import{RenderOccludedFlag as Pt}from"../../webgl-engine/lib/Material.js";import{ColorMaterial as vt}from"../../webgl-engine/materials/ColorMaterial.js";import{NativeLineMaterial as Ut}from"../../webgl-engine/materials/NativeLineMaterial.js";import{RibbonLineMaterial as Vt}from"../../webgl-engine/materials/RibbonLineMaterial.js";import{ManipulatorStateCustomFlags as St,ManipulatorStateFlags as Ft}from"../../../interactive/interfaces.js";import Ht from"../../../../geometry/Extent.js";function xt(t,e,i,n,r,s,o,a){return Gt(e,o.worldUpAtPosition(t,X.get()),r,s,a.basis1,a.basis2),h(a.basis1,a.basis1,i),h(a.basis2,a.basis2,n),T(a.origin,t),H(a.basis2,a.basis1,a.origin,a.plane),a}function Gt(t,e,i,n,r,s){const o=O(t,e),a=X.get(),c=X.get();switch(n===Re.HORIZONTAL_OR_VERTICAL?Math.abs(o)>z?Re.HORIZONTAL:Re.VERTICAL:n){case Re.VERTICAL:{const n=Math.abs(o)<=W?t:i.viewUp;E(a,n,e),T(c,e);break}case Re.HORIZONTAL:E(a,i.viewUp,e),E(c,e,a);break;case Re.TILTED:{const n=Math.abs(o)<=W?e:i.viewUp;E(a,n,t),E(c,t,a);break}}const l=E(X.get(),a,c);O(l,i.viewForward)>0&&h(c,c,-1),I(r,a),I(s,c)}function Dt(t,e,i){const n=e.worldUpAtPosition(t.origin,X.get()),r=t.basis1,s=fe(t,n),o=Math.round(s/Ae)*Ae;return P(t,o-s,r,i)}function Xt(t,e,i,n,r,s){const o=T(X.get(),r.origin);R(o,o,h(X.get(),r.basis1,t.direction[0]<0?1:-1)),R(o,o,h(X.get(),r.basis2,t.direction[1]<0?1:-1));const a=w(r.basis1),c=w(r.basis2),l=j(X.get(),i,o),u=j(X.get(),e,o);let d=0,m=0;if(re(t)){const e=ne(r),i=ne(s);d=a-.5*t.direction[0]*O(r.basis1,u)/a,m=c-.5*t.direction[1]*O(r.basis2,u)/c;const n=i/e;d*=n,m*=n}const p=d+.5*t.direction[0]*O(r.basis1,l)/a,g=m+.5*t.direction[1]*O(r.basis2,l)/c,f=h(X.get(),r.basis1,p/a),b=h(X.get(),r.basis2,g/c);(p<=0||ee(s.origin,f,n)<=B)&&T(f,s.basis1),(g<=0||ee(s.origin,b,n)<=B)&&T(b,s.basis2);const E=T(X.get(),o);return R(E,E,h(X.get(),f,t.direction[0]<0?-1:1)),R(E,E,h(X.get(),b,t.direction[1]<0?-1:1)),v(E,f,b,s)}function Yt(t,e){return q*Math.min(e.width,e.height)*e.computeRenderPixelSizeAt(t)}function Zt(t,e,i,n){const r=E(X.get(),e,i);return E(r,r,e),x(t,r,n)}function zt(t,e){return Rt(t.basis1,t.basis2,t.origin,e)}function Wt(t,e,i,n){const r=e.worldUpAtPosition(t.origin,X.get()),s=X.get();switch(i){case Ie.HEADING:T(s,r);break;case Ie.TILT:T(s,t.basis1)}return x(t.origin,s,n)}function Bt(t,e,i,n){const r=te(i,Qt.NEGATIVE_X),s=Y.get();a(s,e,r.edge*Math.PI/2);const c=I(X.get(),r.basis);let l=h(X.get(),c,r.direction*n.computeScreenPixelSizeAt(r.position)*$);R(l,l,r.position);const u=n.projectToRenderScreen(l,o(X.get())),d=qt(n,u);Mt(n,u,je),I(je.direction,je.direction);const m=X.get();!d&&U(i,je,m)&&(l=m),s[12]=0,s[13]=0,s[14]=0,t.modelTransform=s,t.renderLocation=L(l),d?t.state|=we:t.state&=~we}function qt(t,e){const[i,n,r,s]=t.viewport,o=Math.min(r,s)/16;let a=!0;return e[0]<i+o?(e[0]=i+o,a=!1):e[0]>i+r-o&&(e[0]=i+r-o,a=!1),e[1]<n+o?(e[1]=n+o,a=!1):e[1]>n+s-o&&(e[1]=n+s-o,a=!1),a}function $t(t,e,i,n){const r=w(n.basis1),s=w(n.basis2),o=ie(n),a=ne(n),d=A(X.get(),0,0,0);R(d,h(X.get(),n.basis1,e.direction[0]),h(X.get(),n.basis2,e.direction[1])),R(d,n.origin,d);let m=0,p=1;if(re(e))1===e.direction[0]&&-1===e.direction[1]?m=Ae:1===e.direction[0]&&1===e.direction[1]?m=Math.PI:-1===e.direction[0]&&1===e.direction[1]&&(m=3*Math.PI/2),p=a;else{const t=0!==e.direction[0]?1:2;m=1===t?Ae:0,p=(1===t?s:r)-o}const g=c(Y.get(),m);l(g,g,A(X.get(),p,p,p)),u(g,i,g),g[12]=0,g[13]=0,g[14]=0,t.modelTransform=g,t.renderLocation=d}function Jt(t,e,i,n){const r=n.worldUpAtPosition(i.origin,X.get()),s=te(i,Qt.POSITIVE_X),o=c(Y.get(),s.edge*Math.PI/2);d(o,o,-fe(i,r)),u(o,e,o),o[12]=0,o[13]=0,o[14]=0,t.modelTransform=o,t.renderLocation=s.position}function Kt(t,e,i){const n=te(i,Qt.POSITIVE_Y),r=c(Y.get(),n.edge*Math.PI/2);d(r,r,Ae),u(r,e,r),r[12]=0,r[13]=0,r[14]=0,t.modelTransform=r,t.renderLocation=n.position}var Qt;function te(t,e){switch(e){case Qt.POSITIVE_X:return{basis:t.basis1,direction:1,position:R(X.get(),t.origin,t.basis1),edge:e};case Qt.POSITIVE_Y:return{basis:t.basis2,direction:1,position:R(X.get(),t.origin,t.basis2),edge:e};case Qt.NEGATIVE_X:return{basis:t.basis1,direction:-1,position:j(X.get(),t.origin,t.basis1),edge:e};case Qt.NEGATIVE_Y:return{basis:t.basis2,direction:-1,position:j(X.get(),t.origin,t.basis2),edge:e}}}function ee(t,e,i){const n=i.projectToRenderScreen(R(X.get(),t,e),o(X.get())),r=i.projectToRenderScreen(j(X.get(),t,e),o(X.get()));return y(j(n,n,r))}function ie(t){const e=w(t.basis1),i=w(t.basis2);return J*Math.min(e,i)}function ne(t){return ie(t)}function re(t){return 0!==t.direction[0]&&0!==t.direction[1]}function se(t,e=Le.CENTER_ON_ARROW){const i=e===Le.CENTER_ON_CALLOUT?$:0,n=[C(i,0,-dt/2),C(i,0,dt/2)],r=me(n,!0),s=(t,e)=>ue(n,n,{tubeRadius:mt,tipRadius:nt,tipLength:ut,tubeFocusMultiplier:pt,tipFocusMultiplier:gt,padding:t,bothEnds:!0,flat:null,focusTipLength:!0,addCap:e}),o=s(0,!1),a=s(ft,!0),c=new vt({color:K,cullFace:Lt.Back,renderOccluded:Pt.Opaque}),l=new vt({color:Q,cullFace:Lt.Back,renderOccluded:Pt.Opaque}),u=new vt({color:tt,cullFace:Lt.Back,renderOccluded:Pt.Opaque}),d=new vt({color:et,transparent:!0,writeDepth:!1,cullFace:Lt.Front,renderOccluded:Pt.Transparent}),m=_t([[i,0,0],[i-$,0,0]]),p=_t([[i,0,0],[i-$,0,0]]),g=new Ut({color:it,renderOccluded:Pt.OccludeAndTransparent});return new It({view:t,renderObjects:[...o.normal.map((({part:t,geometry:e,transform:i})=>({geometry:e,material:"tip"===t?c:"cap"===t?l:u,transform:i,stateMask:Ft.Unfocused|Ee}))),...a.normal.map((({geometry:t,transform:e})=>({geometry:t,material:d,transform:e,stateMask:Ft.Unfocused|Ee}))),{geometry:m,material:g,stateMask:Ft.Unfocused|Ee|we},...o.focused.map((({part:t,geometry:e,transform:i})=>({geometry:e,material:"tip"===t?c:"cap"===t?l:u,transform:i,stateMask:Ft.Focused|Ee}))),...a.focused.map((({geometry:t,transform:e})=>({geometry:t,material:d,transform:e,stateMask:Ft.Focused|Ee}))),{geometry:p,material:g,stateMask:Ft.Focused|Ee|we}],autoScaleRenderObjects:!1,collisionType:{type:"line",paths:[r]},collisionPriority:1,radius:nt,state:Ee})}function oe(t,e){const i=wt(t,e,Ee);return i.state=Ee,i}function ae(t){const e=[[-1,-1,0],[1,-1,0],[1,1,0],[-1,1,0],[-1,-1,0]];return new jt({view:t,attached:!0,color:rt,width:st,writeDepthEnabled:!1,renderOccluded:Pt.OccludeAndTransparent,geometry:[e]})}function ce(t){return new At({view:t,attached:!0,backgroundColor:[...ot],gridColor:at,gridWidth:4,renderOccluded:Pt.OccludeAndTransparent})}function le(t,e){const i=re(e),n=i?[C(1,0,0),C(0,0,0),C(0,1,0)]:[C(1,0,0),C(-1,0,0)],r=_t(n),s=Ot,o=t=>new Vt({color:s,width:t,renderOccluded:Pt.OccludeAndTransparent}),a=()=>new Ut({color:s,renderOccluded:Pt.OccludeAndTransparent}),c=i?bt:ht,l=c*Tt,u=ht,d=t=>t>1?o(t):a(),m=[{geometry:r,material:d(c),stateMask:Ft.Unfocused|ye},{geometry:r,material:d(l),stateMask:Ft.Focused|ye},{geometry:r,material:d(u),stateMask:Me}],p=new It({view:t,renderObjects:m,collisionType:{type:"line",paths:[n]},autoScaleRenderObjects:!1,worldSized:!0,radius:i?ct:lt});return p.state=ye,p}function ue(t,e,i){const n=n=>{const r=(n?e:t).slice(0),o=j(X.get(),r[0],r[1]);I(o,o);const a=j(X.get(),r[r.length-1],r[r.length-2]);if(I(a,a),i.padding>0){const t=h(_(),a,-i.padding);if(r[r.length-1]=R(t,t,r[r.length-1]),i.bothEnds){const t=h(_(),o,-i.padding);r[0]=R(t,t,r[0])}}const c=n?i.tipFocusMultiplier:1,d=i.tipLength*(i.focusTipLength?c:1),T=i.tipRadius*c,O=m(Y.get());if(i.padding>0){const t=d/4,e=A(X.get(),0,t,0),n=1+i.padding/t;p(O,O,e),l(O,O,A(X.get(),n,n,n)),p(O,O,h(e,e,-1/n))}const E=m(f()),w=C(0,1,0),y=g(f(),b(Z.get(),w,a));y[12]=r[r.length-1][0],y[13]=r[r.length-1][1],y[14]=r[r.length-1][2],u(y,y,O);const M=[{part:"tube",geometry:de(i.tubeRadius*(n?i.tubeFocusMultiplier:1)+i.padding,i.flat,r),transform:E}];let L,k;if(s(i.flat)?L=Ct(d,T,T,i.flat.thickness):(L=kt(d,T,24,!1,!1,!0),k=kt(d,T,24,!1,!0,!1)),M.push({part:"tip",geometry:L,transform:y}),k&&M.push({part:"cap",geometry:k,transform:y}),i.bothEnds){const t=g(f(),b(Z.get(),w,o));t[12]=r[0][0],t[13]=r[0][1],t[14]=r[0][2],u(t,t,O),M.push({part:"tip",geometry:L,transform:t}),k&&M.push({part:"cap",geometry:k,transform:t})}return M};return{normal:n(!1),focused:n(!0)}}function de(t,e,i){const n=[];if(s(e))n.push([t,e.thickness/2],[-t,e.thickness/2],[-t,-e.thickness/2],[t,-e.thickness/2]);else{const e=12;for(let i=0;i<e;i++){const r=i/e*2*Math.PI;n.push([Math.cos(r)*t,Math.sin(r)*t])}}return Nt(n,i,[],[],!1)}function me(t,e){const i=j(_(),t[t.length-1],t[t.length-2]);if(I(i,i),h(i,i,ut),R(i,i,t[t.length-1]),e){const e=j(_(),t[0],t[1]);return I(e,e),h(e,e,ut),R(e,e,t[0]),[e,...t,i]}return[...t,i]}function pe(e,n,s,o=new t){if(r(e))return null;const{renderCoordsHelper:a}=n,c=a.fromRenderCoords(e.origin,n.spatialReference);if(r(c))return null;const l=k(c,s);if(r(l))return null;o.position=l;const u=2*w(e.basis1),d=2*w(e.basis2),m=yt.renderUnitScaleFactor(n.spatialReference,s);o.width=u*m,o.height=d*m;const p=a.worldUpAtPosition(e.origin,X.get());return o.tilt=i(fe(e,p)),o.heading=a.headingAtPosition(e.origin,e.basis1)-90,o}function ge(t,e,i){if(r(t))return null;const n=t.origin,s=X.get(),o=X.get(),a=X.get(),c=X.get();let l,u,d,m,p,g;R(s,n,t.basis1),R(s,s,t.basis2),R(o,n,t.basis1),M(o,o,t.basis2),M(a,n,t.basis1),M(a,a,t.basis2),M(c,n,t.basis1),R(c,c,t.basis2);for(const f of[s,o,a,c]){const t=e.fromRenderCoords(f,f,i);if(r(t))return null;l=null==l?t[0]:Math.min(l,t[0]),u=null==u?t[0]:Math.max(u,t[0]),d=null==d?t[1]:Math.min(d,t[1]),m=null==m?t[1]:Math.max(m,t[1]),p=null==p?t[2]:Math.min(p,t[2]),g=null==g?t[2]:Math.max(g,t[2])}return new Ht({xmin:l,xmax:u,ymin:d,ymax:m,zmin:p,zmax:g,spatialReference:i})}function fe(t,e){return D(e,t.basis2,t.basis1)+Ae}function be(t,i,r,s,o,a,c=V()){return a.toRenderCoords(t,c.origin)?(a.worldBasisAtPosition(c.origin,N.X,c.basis1),a.worldBasisAtPosition(c.origin,N.Y,c.basis2),H(c.basis2,c.basis1,c.origin,c.plane),P(c,-n(i),S(c),c),P(c,n(r),c.basis1,c),h(c.basis1,c.basis1,s/2),h(c.basis2,c.basis2,o/2),F(c),c):(e.getLogger("esri.views.3d.analysis.Slice.sliceToolUtils").error(`Failed to project slice plane position, projection from ${t.spatialReference.wkid} is not supported`),null)}function he(t,e){if(r(t)||r(t.position))return null;const i=Et(t.position,e.spatialReference,e.elevationProvider);if(r(i))return null;const n=yt.renderUnitScaleFactor(t.position.spatialReference,e.spatialReference),s=t.width*n,o=t.height*n;return{position:i,heading:t.heading,tilt:t.tilt,renderWidth:s,renderHeight:o}}function Te(t,e,i,n=V()){const s=he(t,e);return r(s)?null:Oe(s,e,i,n)}function Oe(t,e,i,n=V()){if(r(t))return null;const o=be(t.position,t.heading,t.tilt,t.renderWidth,t.renderHeight,e.renderCoordsHelper,n);return!i.tiltEnabled&&s(o)&&Dt(o,e.renderCoordsHelper,o),o}!function(t){t[t.POSITIVE_X=0]="POSITIVE_X",t[t.POSITIVE_Y=1]="POSITIVE_Y",t[t.NEGATIVE_X=2]="NEGATIVE_X",t[t.NEGATIVE_Y=3]="NEGATIVE_Y"}(Qt||(Qt={}));const Ee=St.Custom1;var Ie,Re;!function(t){t[t.HEADING=1]="HEADING",t[t.TILT=2]="TILT"}(Ie||(Ie={})),function(t){t[t.HORIZONTAL_OR_VERTICAL=0]="HORIZONTAL_OR_VERTICAL",t[t.HORIZONTAL=1]="HORIZONTAL",t[t.VERTICAL=2]="VERTICAL",t[t.TILTED=3]="TILTED"}(Re||(Re={}));const we=St.Custom2,je=G(),Ae=Math.PI/2,ye=St.Custom1,Me=St.Custom2;var Le;function _e(t){const e="building-scene-3d"===t.type?t:null;return s(e)}!function(t){t[t.CENTER_ON_CALLOUT=0]="CENTER_ON_CALLOUT",t[t.CENTER_ON_ARROW=1]="CENTER_ON_ARROW"}(Le||(Le={}));export{Ee as DidPointerMoveRecentlyFlag,we as IsShiftEdgeOnScreenFlag,Le as OffsetMode,Ie as RotationAxis,Re as SliceOrientation,me as addArrowTips,zt as calculateBoundedPlaneTranslateRotate,ne as calculateDiagonalResizeHandleScale,Yt as calculatePlaneHalfSize,ie as calculateResizeHandlePadding,ee as calculateScreenSpaceBasisLength2,ue as createArrowGeometry,ce as createGridVisualElement,ae as createOutlineVisualElement,xt as createPlane,le as createResizeManipulator,oe as createRotateManipulator,Wt as createRotatePlane,se as createShiftManipulator,Zt as createShiftPlane,Dt as forceHorizontalOrVertical,re as isDiagonalResizeHandle,_e as isIBuildingSceneLayerView3D,Gt as normalToBases,ge as planeToExtent,pe as planeToShape,he as projectAndElevationAlignShape,Oe as projectedShapeToPlane,ye as resizeNormal,Me as resizeOutlineOnly,Xt as resizePlane,Te as shapeToPlane,$t as updateResizeHandle,Jt as updateRotateHeadingHandle,Kt as updateRotateTiltHandle,Bt as updateShiftRestartHandle};
@@ -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}from"../../../../core/maybe.js";import{c as r,b as n,a as t,i as o,r as i}from"../../../../chunks/vec3.js";import{c as s}from"../../../../chunks/vec3f64.js";import{wrap as c}from"../../../../geometry/support/ray.js";import{i as a,k as f}from"../../../../chunks/sphere.js";import{defaultConstraintOptions as m,interactionDirectionTowardsConstraintMinimization as u,adjustRangeForInteraction as p}from"./common.js";import{InteractionType as y}from"./InteractionType.js";function d(e,r,n=m){if(!e.state.isLocal)return 0;const t=e.state.constraints.distance;if(!e.pointsOfInterest.surfaceOrigin.renderLocation||t===1/0)return 0;I.min=0,I.max=t,j(e,n,I);const o=g(e,r),i=I.max-o;return i>=-1e-6?0:i}function O(o,i,s=m){const p=d(o,i,s);if(0===p)return!1;const y=o.pointsOfInterest.surfaceOrigin,O=g(o,i)+p,j=r(l,i.eye),I=u(i,s.interactionDirection,x(o,i,k),h);if(!a(f(y.renderLocation,O),c(i.eye,I),C))return!1;i.eye=C;const N=n(L,i.eye,j);i.center=t(C,i.center,N);const b=o.renderCoordsHelper.getAltitude(i.center),v=o.renderCoordsHelper.intersectInfiniteManifold(i.ray,b,C);return e(v)&&(i.center=v),!0}function j(e,r,n){const t=r.interactionType;if(t===y.NONE)return;const{min:o,max:i}=n,{interactionStartCamera:s,interactionFactor:c}=r,a=t===y.ZOOM||t===y.PAN,f=d(e,s),m=0===f?0:g(e,s);n.min=o,n.max=i;p(f,m,a,c,.05*m,n)}function g(e,r){const n=e.pointsOfInterest.surfaceOrigin;return o(r.eye,n.renderLocation)}function x(e,r,n){const t=e.pointsOfInterest.surfaceOrigin;return i(n,r.eye,t.renderLocation)}const I={min:0,max:0},l=s(),L=s(),h=s(),k=s(),C=s();export{O as applyDistanceConstraint,d as getDistanceConstraintError};
5
+ import{isSome as e}from"../../../../core/maybe.js";import{c as n,b as r,a as t,i as o,A as i}from"../../../../chunks/vec3.js";import{c as s}from"../../../../chunks/vec3f64.js";import{wrap as c}from"../../../../geometry/support/ray.js";import{i as a,k as f}from"../../../../chunks/sphere.js";import{defaultConstraintOptions as m,interactionDirectionTowardsConstraintMinimization as u,adjustRangeForInteraction as p}from"./common.js";import{InteractionType as y}from"./InteractionType.js";function d(e,n,r=m){if(!e.state.isLocal)return 0;const t=e.state.constraints.distance;if(!e.pointsOfInterest.surfaceOrigin.renderLocation||t===1/0)return 0;I.min=0,I.max=t,j(e,r,I);const o=g(e,n),i=I.max-o;return i>=-1e-6?0:i}function O(o,i,s=m){const p=d(o,i,s);if(0===p)return!1;const y=o.pointsOfInterest.surfaceOrigin,O=g(o,i)+p,j=n(l,i.eye),I=u(i,s.interactionDirection,x(o,i,k),h);if(!a(f(y.renderLocation,O),c(i.eye,I),A))return!1;i.eye=A;const C=r(L,i.eye,j);i.center=t(A,i.center,C);const N=o.renderCoordsHelper.getAltitude(i.center),b=o.renderCoordsHelper.intersectInfiniteManifold(i.ray,N,A);return e(b)&&(i.center=b),!0}function j(e,n,r){const t=n.interactionType;if(t===y.NONE)return;const{min:o,max:i}=r,{interactionStartCamera:s,interactionFactor:c}=n,a=t===y.ZOOM||t===y.PAN,f=d(e,s),m=0===f?0:g(e,s);r.min=o,r.max=i;p(f,m,a,c,.05*m,r)}function g(e,n){const r=e.pointsOfInterest.surfaceOrigin;return o(n.eye,r.renderLocation)}function x(e,n,r){const t=e.pointsOfInterest.surfaceOrigin;return i(r,n.eye,t.renderLocation)}const I={min:0,max:0},l=s(),L=s(),h=s(),k=s(),A=s();export{O as applyDistanceConstraint,d as getDistanceConstraintError};
@@ -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{neverReached as e}from"../../../../core/compilerUtils.js";import{clamp as t,acosClamped as r,asinClamped as n,deg2rad as i}from"../../../../core/mathUtils.js";import{isSome as s}from"../../../../core/maybe.js";import{d as a}from"../../../../chunks/mat4.js";import{c as o}from"../../../../chunks/mat4f64.js";import{b as c,m as u,g as m,a as l,i as d,e as f,n as p,l as y,p as M}from"../../../../chunks/vec3.js";import{c as h}from"../../../../chunks/vec3f64.js";import{getReferenceEllipsoid as C}from"../../../../geometry/projectionEllipsoid.js";import{b as T,e as I,t as O}from"../../../../chunks/sphere.js";import{defaultConstraintOptions as A,hasConstraintType as D,adjustRangeForInteraction as S}from"./common.js";import{ConstraintTypes as j}from"./ConstraintTypes.js";import{InteractionType as w}from"./InteractionType.js";import{TiltMode as R}from"./TiltMode.js";import{viewAngle as x}from"../../state/utils/viewUtils.js";function P(t,r,n=A,i=!0){W.eyeCenterDistance=0,W.requiresTwoSteps=!1;const s=U(t,r,n,void 0,W);if(0===s)return!1;switch(a(z,-s,r.viewRight),n.tiltMode){case R.LOOK_AROUND:u(_,r.viewForward,z),m(_,_,W.eyeCenterDistance),r.center=l(G,r.eye,_);break;case R.TUMBLE:c(_,r.center,r.eye),u(_,_,z),r.eye=c(G,r.center,_);break;default:e(n.tiltMode)}return r.up=u(G,r.up,z),!W.requiresTwoSteps||!i||P(t,r,n,!1)}function U(e,t,r=A,n=A,i){if(!e.state.constraints.tilt)return 0;const s=t.distance,a=e.state.constraints.tilt(s,Q);return B(e,r,a),n.interactionType===w.TUMBLE&&D(n.selection,j.ALTITUDE)&&K(e,n.interactionStartCamera,a),r.tiltMode===R.LOOK_AROUND||n.tiltMode===R.LOOK_AROUND?L(e,t,a,i):v(e,t,a)}function v(e,r,n){const i=x(e.renderCoordsHelper,r.center,r.eye),s=i-t(i,n.min,n.max);return k(s)?s:0}function L(t,r,n,i){switch(i&&(i.requiresTwoSteps=!1),t.viewingMode){case"global":return q(t,r,n,i);case"local":return b(t,r,n,i);default:return void e(t.viewingMode)}}function b(e,r,n,i){const s=x(e.renderCoordsHelper,r.center,r.eye),a=t(s,n.min,n.max),o=s-a;if(!k(o))return 0;if(i){const t=e.pointsOfInterest.centerOnSurfaceFrequent.estimatedSurfaceAltitude,n=e.renderCoordsHelper.getAltitude(r.eye)-t,s=Math.cos(a);Math.abs(s)>1e-4?i.eyeCenterDistance=n/s:i.eyeCenterDistance=r.distance}return o}function q(e,r,n,i){const s=g(e,r,V),a=t(s.tiltAtCenter,n.min,n.max);if(!k(s.tiltAtCenter-a))return 0;let o,c;return s.centerIsOnSurface?(o=E(s),c=F(s,o)):(o=s.constraints.clampTilt(s.eyeCenterDistance,s.tiltAtCenter),i&&o<Math.PI/2&&(i.requiresTwoSteps=!0,o=Math.PI/2-1e-5),c=N(s,o)),i&&(i.eyeCenterDistance=H(s,o)),c}function g(e,t,n){const i=e.pointsOfInterest.centerOnSurfaceFrequent.estimatedSurfaceAltitude,a=i+C(e.spatialReference).radius,o=e.renderCoordsHelper.intersectManifold(t.ray,i,G);return n.eyeCenterDistance=t.distance,n.centerIsOnSurface=!1,s(o)?(n.eyeCenterDistance=d(t.eye,o),n.tiltAtCenter=x(e.renderCoordsHelper,o,t.eye),n.centerIsOnSurface=!0):e.state.isLocal?n.tiltAtCenter=x(e.renderCoordsHelper,t.center,t.eye):(T(I(O,a),t.ray,G),n.eyeCenterDistance=d(t.eye,G),n.tiltAtCenter=r(-f(t.viewForward,p(G,G)))),n.radius=a,n.eyeRadius=y(t.eye),n.constraints=e.state.constraints,n}function k(e){return Math.abs(e)>1e-9}function E(e){const{constraints:t,eyeCenterDistance:r,tiltAtCenter:n}=e;let i=n,s=t.clampTilt(r,n);const a=H(e,s);if(t.clampTilt(a,n)===s)return s;let o=0;for(;o<10&&k(s-i);){const r=(i+s)/2,n=H(e,r);k(t.clampTilt(n,r)-r)?i=r:s=r,o++}return s}function H(e,r){if(!e.centerIsOnSurface)return e.eyeCenterDistance;const i=Math.PI-t(r,0,Math.PI),s=n(e.radius/e.eyeRadius*Math.sin(i)),a=Math.PI-i-s,o=Math.sin(a)/Math.sin(i);if(e.eyeRadius<e.radius&&o>1){const t=Math.PI-s,r=Math.PI-i-t;return Math.sin(r)/Math.sin(i)*e.eyeRadius}return o*e.eyeRadius}function F(e,t){const r=n(e.radius/e.eyeRadius*Math.sin(e.tiltAtCenter)),i=n(e.radius/e.eyeRadius*Math.sin(t));return e.eyeRadius>e.radius?r-i:i-r}function N(e,t){return e.tiltAtCenter-Math.PI/2-(t-Math.PI/2)}function B(e,t,r){if(t.interactionType===w.NONE)return;const{interactionStartCamera:n,interactionFactor:i}=t,{min:s,max:a}=r,o=U(e,n,A,t),c=0===o?0:x(e.renderCoordsHelper,n.center,n.eye);r.min=s,r.max=a,t.interactionType===w.TUMBLE?(D(t.selection,j.ALTITUDE)&&K(e,n,r),S(o,c,!0,i,J,r)):S(o,c,!1,i,J,r)}function K(e,t,n){if(e.state.isLocal)return;const i=e.state.constraints;if(!i.altitude)return;const s=M(t.center),a=Math.sqrt(s),o=t.distance,c=C(e.spatialReference).radius,u=i.altitude.min+c,m=i.altitude.max+c,l=(u*u-o*o-s)/(-2*a*o),d=(m*m-o*o-s)/(-2*a*o);n.min=Math.max(n.min,Math.min(Math.PI-r(d),n.max)),n.max=Math.min(n.max,Math.PI-r(l))}const _=h(),z=o(),G=h(),J=i(5),Q={min:0,max:0},V={constraints:null,radius:0,eyeRadius:0,centerIsOnSurface:!0,eyeCenterDistance:0,tiltAtCenter:0},W={eyeCenterDistance:0,requiresTwoSteps:!1};export{P as applyTiltConstraint,U as getTiltConstraintError};
5
+ import{neverReached as e}from"../../../../core/compilerUtils.js";import{clamp as t,acosClamped as r,asinClamped as n,deg2rad as i}from"../../../../core/mathUtils.js";import{isSome as s}from"../../../../core/maybe.js";import{d as a}from"../../../../chunks/mat4.js";import{c as o}from"../../../../chunks/mat4f64.js";import{b as c,v as u,g as m,a as l,i as d,e as f,n as p,l as y,z as M}from"../../../../chunks/vec3.js";import{c as h}from"../../../../chunks/vec3f64.js";import{getReferenceEllipsoid as C}from"../../../../geometry/projectionEllipsoid.js";import{b as T,e as I,t as O}from"../../../../chunks/sphere.js";import{defaultConstraintOptions as A,hasConstraintType as D,adjustRangeForInteraction as S}from"./common.js";import{ConstraintTypes as j}from"./ConstraintTypes.js";import{InteractionType as w}from"./InteractionType.js";import{TiltMode as R}from"./TiltMode.js";import{viewAngle as x}from"../../state/utils/viewUtils.js";function v(t,r,n=A,i=!0){W.eyeCenterDistance=0,W.requiresTwoSteps=!1;const s=P(t,r,n,void 0,W);if(0===s)return!1;switch(a(z,-s,r.viewRight),n.tiltMode){case R.LOOK_AROUND:u(_,r.viewForward,z),m(_,_,W.eyeCenterDistance),r.center=l(G,r.eye,_);break;case R.TUMBLE:c(_,r.center,r.eye),u(_,_,z),r.eye=c(G,r.center,_);break;default:e(n.tiltMode)}return r.up=u(G,r.up,z),!W.requiresTwoSteps||!i||v(t,r,n,!1)}function P(e,t,r=A,n=A,i){if(!e.state.constraints.tilt)return 0;const s=t.distance,a=e.state.constraints.tilt(s,Q);return B(e,r,a),n.interactionType===w.TUMBLE&&D(n.selection,j.ALTITUDE)&&K(e,n.interactionStartCamera,a),r.tiltMode===R.LOOK_AROUND||n.tiltMode===R.LOOK_AROUND?L(e,t,a,i):U(e,t,a)}function U(e,r,n){const i=x(e.renderCoordsHelper,r.center,r.eye),s=i-t(i,n.min,n.max);return k(s)?s:0}function L(t,r,n,i){switch(i&&(i.requiresTwoSteps=!1),t.viewingMode){case"global":return q(t,r,n,i);case"local":return b(t,r,n,i);default:return void e(t.viewingMode)}}function b(e,r,n,i){const s=x(e.renderCoordsHelper,r.center,r.eye),a=t(s,n.min,n.max),o=s-a;if(!k(o))return 0;if(i){const t=e.pointsOfInterest.centerOnSurfaceFrequent.estimatedSurfaceAltitude,n=e.renderCoordsHelper.getAltitude(r.eye)-t,s=Math.cos(a);Math.abs(s)>1e-4?i.eyeCenterDistance=n/s:i.eyeCenterDistance=r.distance}return o}function q(e,r,n,i){const s=g(e,r,V),a=t(s.tiltAtCenter,n.min,n.max);if(!k(s.tiltAtCenter-a))return 0;let o,c;return s.centerIsOnSurface?(o=E(s),c=F(s,o)):(o=s.constraints.clampTilt(s.eyeCenterDistance,s.tiltAtCenter),i&&o<Math.PI/2&&(i.requiresTwoSteps=!0,o=Math.PI/2-1e-5),c=N(s,o)),i&&(i.eyeCenterDistance=H(s,o)),c}function g(e,t,n){const i=e.pointsOfInterest.centerOnSurfaceFrequent.estimatedSurfaceAltitude,a=i+C(e.spatialReference).radius,o=e.renderCoordsHelper.intersectManifold(t.ray,i,G);return n.eyeCenterDistance=t.distance,n.centerIsOnSurface=!1,s(o)?(n.eyeCenterDistance=d(t.eye,o),n.tiltAtCenter=x(e.renderCoordsHelper,o,t.eye),n.centerIsOnSurface=!0):e.state.isLocal?n.tiltAtCenter=x(e.renderCoordsHelper,t.center,t.eye):(T(I(O,a),t.ray,G),n.eyeCenterDistance=d(t.eye,G),n.tiltAtCenter=r(-f(t.viewForward,p(G,G)))),n.radius=a,n.eyeRadius=y(t.eye),n.constraints=e.state.constraints,n}function k(e){return Math.abs(e)>1e-9}function E(e){const{constraints:t,eyeCenterDistance:r,tiltAtCenter:n}=e;let i=n,s=t.clampTilt(r,n);const a=H(e,s);if(t.clampTilt(a,n)===s)return s;let o=0;for(;o<10&&k(s-i);){const r=(i+s)/2,n=H(e,r);k(t.clampTilt(n,r)-r)?i=r:s=r,o++}return s}function H(e,r){if(!e.centerIsOnSurface)return e.eyeCenterDistance;const i=Math.PI-t(r,0,Math.PI),s=n(e.radius/e.eyeRadius*Math.sin(i)),a=Math.PI-i-s,o=Math.sin(a)/Math.sin(i);if(e.eyeRadius<e.radius&&o>1){const t=Math.PI-s,r=Math.PI-i-t;return Math.sin(r)/Math.sin(i)*e.eyeRadius}return o*e.eyeRadius}function F(e,t){const r=n(e.radius/e.eyeRadius*Math.sin(e.tiltAtCenter)),i=n(e.radius/e.eyeRadius*Math.sin(t));return e.eyeRadius>e.radius?r-i:i-r}function N(e,t){return e.tiltAtCenter-Math.PI/2-(t-Math.PI/2)}function B(e,t,r){if(t.interactionType===w.NONE)return;const{interactionStartCamera:n,interactionFactor:i}=t,{min:s,max:a}=r,o=P(e,n,A,t),c=0===o?0:x(e.renderCoordsHelper,n.center,n.eye);r.min=s,r.max=a,t.interactionType===w.TUMBLE?(D(t.selection,j.ALTITUDE)&&K(e,n,r),S(o,c,!0,i,J,r)):S(o,c,!1,i,J,r)}function K(e,t,n){if(e.state.isLocal)return;const i=e.state.constraints;if(!i.altitude)return;const s=M(t.center),a=Math.sqrt(s),o=t.distance,c=C(e.spatialReference).radius,u=i.altitude.min+c,m=i.altitude.max+c,l=(u*u-o*o-s)/(-2*a*o),d=(m*m-o*o-s)/(-2*a*o);n.min=Math.max(n.min,Math.min(Math.PI-r(d),n.max)),n.max=Math.min(n.max,Math.PI-r(l))}const _=h(),z=o(),G=h(),J=i(5),Q={min:0,max:0},V={constraints:null,radius:0,eyeRadius:0,centerIsOnSurface:!0,eyeCenterDistance:0,tiltAtCenter:0},W={eyeCenterDistance:0,requiresTwoSteps:!1};export{v as applyTiltConstraint,P as getTiltConstraintError};
@@ -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{disposeMaybe as e,isNone as t}from"../../../core/maybe.js";import{c as r}from"../../../chunks/mat4.js";import{c as i}from"../../../chunks/mat4f64.js";import{AtmosphereType as s}from"./AtmosphereType.js";import{S as o}from"../../../chunks/SimpleAtmosphere.glsl.js";import{SimpleAtmosphereTechnique as a}from"./SimpleAtmosphereTechnique.js";import{SimpleAtmosphereTechniqueConfiguration as n,SimpleAtmosphereGeometry as m}from"./SimpleAtmosphereTechniqueConfiguration.js";import{earthAtmosphereTextureSimple as p}from"./resources/SimpleAtmosphereTexture.js";import{glLayout as h}from"../support/buffer/glUtil.js";import{newLayout as c}from"../support/buffer/InterleavedLayout.js";import{Default3D as u}from"../webgl-engine/lib/DefaultVertexAttributeLocations.js";import{createPolySphereGeometry as f}from"../webgl-engine/lib/GeometryUtil.js";import{VertexArrayObject as l}from"../webgl-engine/lib/VertexArrayObject.js";import{VertexAttribute as b}from"../webgl-engine/lib/VertexAttribute.js";import{BufferObject as g}from"../../webgl/BufferObject.js";import{PixelFormat as _,PixelType as j,TextureWrapMode as x,TextureSamplingMode as d,PrimitiveType as A,Usage as w}from"../../webgl/enums.js";import{Texture as y}from"../../webgl/Texture.js";import{vertexCount as T}from"../../webgl/Util.js";class v{constructor(){this.type=s.Panoramic,this._techniqueConfig=new n,this._passParameters=new o}destroy(){this._passParameters.texture=e(this._passParameters.texture),this._vao=e(this._vao)}initializeRenderContext(e){this._techniqueConfig.geometry=m.Cylinder,this._technique=e.shaderTechniqueRepository.acquire(a,this._techniqueConfig);const t=e.renderContext.rctx;this._vao=this._createVertexArrayObject(t),this._vaoCount=T(this._vao,"geometry"),this._passParameters.texture=new y(t,{pixelFormat:_.RGBA,dataType:j.UNSIGNED_BYTE,wrapMode:x.CLAMP_TO_EDGE,samplingMode:d.LINEAR,flipped:!0,width:1,height:512},p),e.requestRender()}render(e){if(t(this._vao)||t(this._passParameters.texture))return;const r=e.rctx,i=r.bindTechnique(this._technique,this._passParameters,e.bindParameters);P(C,e.bindParameters.camera.viewMatrix),i.setUniformMatrix4fv("view",C),r.bindVAO(this._vao),i.assertCompatibleVertexAttributeLocations(this._vao),r.drawArrays(A.TRIANGLES,0,this._vaoCount)}renderHaze(){return!1}_createVertexArrayObject(e){const t=f(1,2,!1),r=t.indices.get(b.POSITION);for(let a=0;a<r.length;a+=3){const e=r[a];r[a]=r[a+2],r[a+2]=e}const i=t.vertexAttributes.get(b.POSITION).data,s=O.createBuffer(r.length),o=s.position;for(let a=0;a<r.length;++a){const e=3*r[a];o.set(a,0,i[e]),o.set(a,1,i[e+1]),o.set(a,2,i[e+2])}return new l(e,u,{geometry:h(O)},{geometry:g.createVertex(e,w.STATIC_DRAW,s.buffer)})}}function P(e,t){r(e,t),e[12]=0,e[13]=0,e[14]=0,e[15]=1}const C=i(),O=c().vec3f(b.POSITION);export{v as PanoramicAtmosphere};
5
+ import{disposeMaybe as e,isNone as t}from"../../../core/maybe.js";import{c as r}from"../../../chunks/mat4.js";import{c as i}from"../../../chunks/mat4f64.js";import{AtmosphereType as s}from"./AtmosphereType.js";import{S as o}from"../../../chunks/SimpleAtmosphere.glsl.js";import{SimpleAtmosphereTechnique as a}from"./SimpleAtmosphereTechnique.js";import{SimpleAtmosphereTechniqueConfiguration as n,SimpleAtmosphereGeometry as m}from"./SimpleAtmosphereTechniqueConfiguration.js";import{earthAtmosphereTextureSimple as p}from"./resources/SimpleAtmosphereTexture.js";import{glLayout as c}from"../support/buffer/glUtil.js";import{newLayout as h}from"../support/buffer/InterleavedLayout.js";import{Default3D as u}from"../webgl-engine/lib/DefaultVertexAttributeLocations.js";import{createPolySphereGeometry as f}from"../webgl-engine/lib/GeometryUtil.js";import{VertexArrayObject as l}from"../webgl-engine/lib/VertexArrayObject.js";import{VertexAttribute as b}from"../webgl-engine/lib/VertexAttribute.js";import{BufferObject as g}from"../../webgl/BufferObject.js";import{PixelFormat as _,PixelType as j,TextureWrapMode as x,TextureSamplingMode as d,PrimitiveType as A,Usage as w}from"../../webgl/enums.js";import{Texture as y}from"../../webgl/Texture.js";import{vertexCount as T}from"../../webgl/Util.js";class v{constructor(){this.type=s.Panoramic,this._configuration=new n,this._passParameters=new o}destroy(){this._passParameters.texture=e(this._passParameters.texture),this._vao=e(this._vao)}initializeRenderContext(e){this._configuration.geometry=m.Cylinder,this._technique=e.shaderTechniqueRepository.acquire(a,this._configuration);const t=e.renderContext.rctx;this._vao=this._createVertexArrayObject(t),this._vaoCount=T(this._vao,"geometry"),this._passParameters.texture=new y(t,{pixelFormat:_.RGBA,dataType:j.UNSIGNED_BYTE,wrapMode:x.CLAMP_TO_EDGE,samplingMode:d.LINEAR,flipped:!0,width:1,height:512},p),e.requestRender()}render(e){if(t(this._vao)||t(this._passParameters.texture))return;const r=e.rctx,i=r.bindTechnique(this._technique,this._passParameters,e.bindParameters);P(O,e.bindParameters.camera.viewMatrix),i.setUniformMatrix4fv("view",O),r.bindVAO(this._vao),i.assertCompatibleVertexAttributeLocations(this._vao),r.drawArrays(A.TRIANGLES,0,this._vaoCount)}renderHaze(){return!1}_createVertexArrayObject(e){const t=f(1,2,!1),r=t.indices.get(b.POSITION);for(let a=0;a<r.length;a+=3){const e=r[a];r[a]=r[a+2],r[a+2]=e}const i=t.vertexAttributes.get(b.POSITION).data,s=I.createBuffer(r.length),o=s.position;for(let a=0;a<r.length;++a){const e=3*r[a];o.set(a,0,i[e]),o.set(a,1,i[e+1]),o.set(a,2,i[e+2])}return new l(e,u,{geometry:c(I)},{geometry:g.createVertex(e,w.STATIC_DRAW,s.buffer)})}}function P(e,t){r(e,t),e[12]=0,e[13]=0,e[14]=0,e[15]=1}const O=i(),I=h().vec3f(b.POSITION);export{v as PanoramicAtmosphere};
@@ -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"../../../Color.js";import r from"../../../core/Evented.js";import i from"../../../core/Handles.js";import{destroyMaybe as n,isSome as s,isNone as o,mapOr as a}from"../../../core/maybe.js";import{after as h}from"../../../core/promiseUtils.js";import{watch as c,sync as d,syncAndInitial as l}from"../../../core/reactiveUtils.js";import{property as p}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as _}from"../../../core/accessorSupport/decorators/subclass.js";import{s as u,g as m,c as f,h as g}from"../../../chunks/vec3.js";import{c as P,f as v}from"../../../chunks/vec3f64.js";import{b,f as w}from"../../../chunks/vec4f64.js";import{canProjectToWGS84ComparableLonLat as C,projectPointToWGS84ComparableLonLat as y}from"../../../geometry/projection.js";import{isEarth as U}from"../../../geometry/support/spatialReferenceUtils.js";import{ViewingMode as T}from"../../ViewingMode.js";import{EnvironmentRenderer as R}from"./EnvironmentRenderer.js";import{positionToTimezoneInfo as S}from"../support/earthUtils.js";import{computeColorAndIntensity as M,computeVirtualLightDirection as H,ColorAndIntensity as W,computeShadowsEnabled as G}from"../support/sunUtils.js";import{Update as j}from"../webgl-engine/lib/Update.js";import{MainLight as L,AmbientLight as k,FillLight as E}from"../webgl-engine/lighting/Lightsources.js";import Q from"../../../webscene/background/ColorBackground.js";let D=class extends r.EventedAccessor{constructor(){super(),this._referencePointUpdateDelay=200,this._referencePointUpdateInterval=3e3,this._referencePointUpdateDistThreshold=1e6,this._referencePosUpdateQuery=null,this._referencePosMapCoordsRequested=null,this._viewHandles=new i,this._preserveAbsoluteDateTime=!1,this._trackingEnabled=!1,this._referencePosResetPreserveAbsoluteTime=!1,this._referencePosUpdateTimer=null,this._referencePosMapCoords=null,this._mainLight=new L,this._ambientLight=new k,this._moonLight=new E,this.disableQueries=!1,this._disableWeather=!1,this._renderer=null,this._referencePosWGS84Comparable=null,this._resetReferencePosition()}destroy(){this.disconnectView(),this._viewHandles.destroy()}get _view(){return this._renderer?.view}get updating(){return!((this.disableQueries||!this._referencePosUpdateQuery&&!this._referencePosMapCoordsRequested)&&!this._renderer?.updating)}get weatherEnabled(){return this._view?.environment.atmosphereEnabled&&!this._disableWeather&&this._view?.state?.viewingMode===T.Global&&U(this._view.spatialReference)}get weatherVisible(){return this.weatherEnabled&&this._renderer?.weatherVisible}get referencePositionWGS84Comparable(){return this._referencePosWGS84Comparable}connectView(e){if(this._renderer)return;this._renderer=new R({view:e});const t=()=>this._updateRenderParameters(),r=()=>this._cameraHandler();this._viewHandles.add([c((()=>e.environment.lighting),(e=>this._updateLightingHandler(e)),d),c((()=>"virtual"!==e.environment.lighting.type?e.environment.lighting.date:null),(e=>this._lightingDateHandler(e)),d),c((()=>e.stationary),(()=>this._interactingStationaryHandler())),c((()=>e.environment.lighting.directShadowsEnabled),t,d),c((()=>e.environment.lighting.ambientOcclusionEnabled),t,d),c((()=>e.environment.lighting.waterReflectionEnabled),t,d),c((()=>e.environment.background?.color),t,d),c((()=>e.spatialReference),(()=>this._resetReferencePosition(!0)),d),c((()=>e.environment.weather.type),(()=>this._updateLighting(null,j.Faded)),d),c((()=>this.weatherEnabled),(()=>this._updateLighting(null,j.Faded)),d),c((()=>e.viewingMode),(()=>this._resetReferencePosition(!0)),l),c((()=>"virtual"!==e.environment.lighting.type&&e.environment.lighting.cameraTrackingEnabled),(e=>this._updateCameraTracking(e)),l),c((()=>e.state.camera),r,l),c((()=>this.disableQueries),r)]),this._updateRenderParameters(),this._updateLighting(),this._cameraHandler(),this.notifyChange("updating")}disconnectView(){this._viewHandles.removeAll(),this._resetReferencePosition(),this._renderer=n(this._renderer)}_updateLightingHandler(e){this._updateCameraTracking("virtual"!==e.type&&e.cameraTrackingEnabled),this._lightingDateHandler("virtual"!==e.type?e.date:null),this._updateRenderParameters()}_updateCameraTracking(e){if(this._trackingEnabled=e,e)this._cameraHandler();else{const e=this._view.environment.lighting;"virtual"!==e?.type&&(e.positionTimezoneInfo.autoUpdated=!1)}}_lightingDateHandler(e){const t=this._view.environment.lighting;if("virtual"!==t?.type){if(e){if(!t.positionTimezoneInfo.autoUpdated){this._preserveAbsoluteDateTime=!0;const r=this._view.spatialReference;if(!C(r)){const e=this._view.camera.position;if(!this._referencePosMapCoords||!this._referencePosMapCoords.equals(e))return void this._requestReferencePositionUpdate(e)}if(this._preupdateTracking(e),s(this._referencePosWGS84Comparable)){const e=S(this._referencePosWGS84Comparable,V);s(e)&&(t.autoUpdate(null,e),this._trackingEnabled&&(t.positionTimezoneInfo.autoUpdated=!0))}}this._updateLighting(e)}}else this._updateLighting()}_preupdateTracking(e){!this._trackingEnabled&&"virtual"!==this._view.environment.lighting.type&&this._view.environment.lighting.cameraTrackingEnabled&&this._cameraHandler(e)}_cameraHandler(e=null){const t=this._view;if(!t.ready)return;const r=t.stateManager.camera;r&&(this._cameraHandlerClientSide(r,e)||this._cameraHandlerServerSide(r))}_cameraHandlerClientSide(e,t){const r=U(this._view.spatialReference);if(r&&!C(this._view.spatialReference))return"virtual"===this._view.environment.lighting.type&&this._updateLighting(),!1;const i=e.position;return o(this._referencePosWGS84Comparable)&&(this._referencePosWGS84Comparable=P()),r?y(i,this._referencePosWGS84Comparable):u(this._referencePosWGS84Comparable,i.longitude,i.latitude,i.z),this.notifyChange("referencePositionWGS84Comparable"),this._autoUpdateTimezone(this._referencePosWGS84Comparable,t)||this._updateLighting(t),!0}_cameraHandlerServerSide(e){const t=e.position;(!this._referencePosMapCoords||this._referencePosMapCoordsRequested||this._exceedsReferencePosDistThreshold(t))&&this._requestReferencePositionUpdate(t,!0),this._view.mapCoordsHelper&&this._referencePosWGS84Comparable&&(this._referencePosWGS84Comparable[2]=t.z*this._view.mapCoordsHelper.unitInMeters,this._referencePosChanged())}_interactingStationaryHandler(){this._view.stationary&&this._executePendingReferencePositionUpdate()}_updateLighting(e,t=j.Immediate){const r=this._view;e=e||("virtual"===r.environment.lighting.type?null:r.environment.lighting.date);const i=this._referencePosWGS84Comparable,n=s(i)?q:A,o=this.weatherVisible?r.environment.weather.type:"disabled";s(i)?M(e,i,r.state.viewingMode,o,r.state.camera,n):"virtual"===r.environment.lighting.type&&H(r.state.camera,r.state.viewingMode,n.direct.directionToLightSource);const a=this._mainLight,h=n.direct;m(a.intensity,h.color,h.intensity*Math.PI),f(a.direction,h.directionToLightSource),a.specularStrength=n.specularStrength,a.environmentStrength=n.environmentStrength;const c=this._ambientLight;m(c.intensity,n.ambient.color,n.ambient.intensity);const d=this._moonLight;g(d.intensity,z,x,n.globalFactor);const l=(1-.5*n.globalFactor)*(1-.4*n.noonFactor*(1-n.globalFactor));m(d.intensity,d.intensity,l),f(d.direction,h.directionToLightSource),r._stage.renderView.updateLightSources([a,c,d],n.noonFactor,n.globalFactor,t),this._updateRenderParameters()}_autoUpdateTimezone(e,t=null){if("virtual"===this._view.environment.lighting.type||!this._view.environment.lighting.cameraTrackingEnabled||o(e))return!1;const r=I;r.setTime((t||this._view.environment.lighting.date).getTime());const i=S(e,V);if(o(i))return!1;let n=this._view.environment.lighting.positionTimezoneInfo;if(n.autoUpdated){if(n.hours===i.hours&&n.minutes===i.minutes&&n.seconds===i.seconds)return!1}else n=i;const s=r.getUTCHours()-(i.hours-n.hours),a=r.getUTCMinutes()-(i.minutes-n.minutes),h=r.getUTCSeconds()-(i.seconds-n.seconds);return r.setUTCHours(s),r.setUTCMinutes(a),r.setUTCSeconds(h),!t&&this._view.environment.lighting.autoUpdate(r,i)}_updateRenderParameters(){const e=this._view._stage;if(!e)return;const r=a(this._referencePosWGS84Comparable,!0,(e=>G(e[2],this._view.state.viewingMode))),i=this._view.environment.background,n=i instanceof Q?{type:"color",color:b(t.toUnitRGBA(i.color))}:{type:"color",color:w(0,0,0,1)};e.renderView.setRenderParameters({shadowMap:this._view.environment.lighting.directShadowsEnabled&&r,background:n,environment:this._view.environment,weatherVisible:this._view.environmentManager.weatherVisible})}_resetReferencePosition(e=!1){this._cancelReferencePosUpdates(),this._referencePosMapCoords=null,this._referencePosMapCoordsRequested=null,this._referencePosResetPreserveAbsoluteTime=null,this._referencePosWGS84Comparable=null,this.notifyChange("updating"),e&&this._cameraHandler()}_requestReferencePositionUpdate(e,t=!1){if(!this.disableQueries&&(this._referencePosMapCoordsRequested?this._referencePosMapCoordsRequested.copy(e):this._referencePosMapCoordsRequested=e.clone(),this._referencePosResetPreserveAbsoluteTime=!!t,!this._referencePosUpdateQuery&&!this._referencePosUpdateTimer&&this._view.stationary)){const e=this._referencePosUpdateQuery=h(this._referencePointUpdateDelay).then((()=>{if(this._referencePosUpdateQuery===e){const t=()=>this._referencePosUpdateQuery!==e;return this._doReferencePositionUpdateQuery(t)}})).catch((e=>{"mapcoordshelper:missing-geometry-service"===e.name&&(this.disableQueries=!0)})).then((()=>{this._referencePosUpdateQuery===e&&(this._referencePosUpdateQuery=null,this._referencePosUpdateTimer||this._executePendingReferencePositionUpdate(),this.notifyChange("updating"))})),t=this._referencePosUpdateTimer=h(this._referencePointUpdateInterval).then((()=>{this._referencePosUpdateTimer===t&&(this._referencePosUpdateTimer=null,this._referencePosUpdateQuery||this._executePendingReferencePositionUpdate())}));this.notifyChange("updating")}}async _doReferencePositionUpdateQuery(e){this._referencePosResetPreserveAbsoluteTime&&(this._preserveAbsoluteDateTime=!1),this._referencePosMapCoords?this._referencePosMapCoords.copy(this._referencePosMapCoordsRequested):this._referencePosMapCoords=this._referencePosMapCoordsRequested.clone(),this._referencePosResetPreserveAbsoluteTime=null,this._referencePosMapCoordsRequested=null;const t=await this._view.mapCoordsHelper.toGeographic(this._referencePosMapCoords);if(!e()&&!isNaN(t[0])&&!isNaN(t[1])){const e=this._referencePosMapCoords.z*this._view.mapCoordsHelper.unitInMeters;this._referencePosWGS84Comparable?(this._referencePosWGS84Comparable[0]=t[0],this._referencePosWGS84Comparable[1]=t[1],this._referencePosWGS84Comparable[2]=e):this._referencePosWGS84Comparable=[t[0],t[1],e],this._referencePosChanged()}}_executePendingReferencePositionUpdate(){const e=this._referencePosMapCoordsRequested;e&&this._requestReferencePositionUpdate(e,this._referencePosResetPreserveAbsoluteTime)}_referencePosChanged(){this._preserveAbsoluteDateTime?this._updateLighting():this._autoUpdateTimezone(this._referencePosWGS84Comparable)||this._updateLighting(),this.notifyChange("referencePositionWGS84Comparable")}_exceedsReferencePosDistThreshold(e){if(this._referencePosMapCoords){let t=this._referencePosMapCoords.distance(e);return this._view.mapCoordsHelper&&(t*=this._view.mapCoordsHelper.unitInMeters),t>this._referencePointUpdateDistThreshold}return!0}_cancelReferencePosUpdates(){const e=!!this._referencePosUpdateQuery;return this._referencePosUpdateQuery=null,this._referencePosUpdateTimer=null,e}get test(){const e=this;return{get renderer(){return e._renderer},set referencePointUpdateInterval(t){e._referencePointUpdateInterval=t},set referencePointUpdateDistThreshold(t){e._referencePointUpdateDistThreshold=t},set referencePosUpdateTimer(t){e._referencePosUpdateTimer=t},set referencePointUpdateDelay(t){e._referencePointUpdateDelay=t},set disableWeather(t){e._disableWeather=t}}}};e([p({type:Boolean,readOnly:!0})],D.prototype,"updating",null),e([p()],D.prototype,"disableQueries",void 0),e([p()],D.prototype,"_disableWeather",void 0),e([p()],D.prototype,"weatherEnabled",null),e([p()],D.prototype,"weatherVisible",null),e([p()],D.prototype,"referencePositionWGS84Comparable",null),e([p()],D.prototype,"_renderer",void 0),e([p()],D.prototype,"_referencePosWGS84Comparable",void 0),D=e([_("esri.views.3d.environment.SceneViewEnvironmentManager")],D);const q=new W,A=new W,I=new Date,V={hours:0,minutes:0,seconds:0},z=v(.22,.22,.33),x=v(.22,.22,.22);export{D as SceneViewEnvironmentManager};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../Color.js";import r from"../../../core/Evented.js";import i from"../../../core/Handles.js";import{destroyMaybe as n,isSome as s,isNone as o,mapOr as a}from"../../../core/maybe.js";import{after as h}from"../../../core/promiseUtils.js";import{watch as c,sync as d,syncAndInitial as l}from"../../../core/reactiveUtils.js";import{property as p}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as _}from"../../../core/accessorSupport/decorators/subclass.js";import{s as u,g as m,c as f,h as g}from"../../../chunks/vec3.js";import{c as P,f as v}from"../../../chunks/vec3f64.js";import{a as b,f as w}from"../../../chunks/vec4f64.js";import{canProjectToWGS84ComparableLonLat as C,projectPointToWGS84ComparableLonLat as y}from"../../../geometry/projection.js";import{isEarth as U}from"../../../geometry/support/spatialReferenceUtils.js";import{ViewingMode as T}from"../../ViewingMode.js";import{EnvironmentRenderer as R}from"./EnvironmentRenderer.js";import{positionToTimezoneInfo as S}from"../support/earthUtils.js";import{computeColorAndIntensity as M,computeVirtualLightDirection as H,ColorAndIntensity as W,computeShadowsEnabled as G}from"../support/sunUtils.js";import{Update as j}from"../webgl-engine/lib/Update.js";import{MainLight as L,AmbientLight as k,FillLight as E}from"../webgl-engine/lighting/Lightsources.js";import Q from"../../../webscene/background/ColorBackground.js";let D=class extends r.EventedAccessor{constructor(){super(),this._referencePointUpdateDelay=200,this._referencePointUpdateInterval=3e3,this._referencePointUpdateDistThreshold=1e6,this._referencePosUpdateQuery=null,this._referencePosMapCoordsRequested=null,this._viewHandles=new i,this._preserveAbsoluteDateTime=!1,this._trackingEnabled=!1,this._referencePosResetPreserveAbsoluteTime=!1,this._referencePosUpdateTimer=null,this._referencePosMapCoords=null,this._mainLight=new L,this._ambientLight=new k,this._moonLight=new E,this.disableQueries=!1,this._disableWeather=!1,this._renderer=null,this._referencePosWGS84Comparable=null,this._resetReferencePosition()}destroy(){this.disconnectView(),this._viewHandles.destroy()}get _view(){return this._renderer?.view}get updating(){return!((this.disableQueries||!this._referencePosUpdateQuery&&!this._referencePosMapCoordsRequested)&&!this._renderer?.updating)}get weatherEnabled(){return this._view?.environment.atmosphereEnabled&&!this._disableWeather&&this._view?.state?.viewingMode===T.Global&&U(this._view.spatialReference)}get weatherVisible(){return this.weatherEnabled&&this._renderer?.weatherVisible}get referencePositionWGS84Comparable(){return this._referencePosWGS84Comparable}connectView(e){if(this._renderer)return;this._renderer=new R({view:e});const t=()=>this._updateRenderParameters(),r=()=>this._cameraHandler();this._viewHandles.add([c((()=>e.environment.lighting),(e=>this._updateLightingHandler(e)),d),c((()=>"virtual"!==e.environment.lighting.type?e.environment.lighting.date:null),(e=>this._lightingDateHandler(e)),d),c((()=>e.stationary),(()=>this._interactingStationaryHandler())),c((()=>e.environment.lighting.directShadowsEnabled),t,d),c((()=>e.environment.lighting.ambientOcclusionEnabled),t,d),c((()=>e.environment.lighting.waterReflectionEnabled),t,d),c((()=>e.environment.background?.color),t,d),c((()=>e.spatialReference),(()=>this._resetReferencePosition(!0)),d),c((()=>e.environment.weather.type),(()=>this._updateLighting(null,j.Faded)),d),c((()=>this.weatherEnabled),(()=>this._updateLighting(null,j.Faded)),d),c((()=>e.viewingMode),(()=>this._resetReferencePosition(!0)),l),c((()=>"virtual"!==e.environment.lighting.type&&e.environment.lighting.cameraTrackingEnabled),(e=>this._updateCameraTracking(e)),l),c((()=>e.state.camera),r,l),c((()=>this.disableQueries),r)]),this._updateRenderParameters(),this._updateLighting(),this._cameraHandler(),this.notifyChange("updating")}disconnectView(){this._viewHandles.removeAll(),this._resetReferencePosition(),this._renderer=n(this._renderer)}_updateLightingHandler(e){this._updateCameraTracking("virtual"!==e.type&&e.cameraTrackingEnabled),this._lightingDateHandler("virtual"!==e.type?e.date:null),this._updateRenderParameters()}_updateCameraTracking(e){if(this._trackingEnabled=e,e)this._cameraHandler();else{const e=this._view.environment.lighting;"virtual"!==e?.type&&(e.positionTimezoneInfo.autoUpdated=!1)}}_lightingDateHandler(e){const t=this._view.environment.lighting;if("virtual"!==t?.type){if(e){if(!t.positionTimezoneInfo.autoUpdated){this._preserveAbsoluteDateTime=!0;const r=this._view.spatialReference;if(!C(r)){const e=this._view.camera.position;if(!this._referencePosMapCoords||!this._referencePosMapCoords.equals(e))return void this._requestReferencePositionUpdate(e)}if(this._preupdateTracking(e),s(this._referencePosWGS84Comparable)){const e=S(this._referencePosWGS84Comparable,V);s(e)&&(t.autoUpdate(null,e),this._trackingEnabled&&(t.positionTimezoneInfo.autoUpdated=!0))}}this._updateLighting(e)}}else this._updateLighting()}_preupdateTracking(e){!this._trackingEnabled&&"virtual"!==this._view.environment.lighting.type&&this._view.environment.lighting.cameraTrackingEnabled&&this._cameraHandler(e)}_cameraHandler(e=null){const t=this._view;if(!t.ready)return;const r=t.stateManager.camera;r&&(this._cameraHandlerClientSide(r,e)||this._cameraHandlerServerSide(r))}_cameraHandlerClientSide(e,t){const r=U(this._view.spatialReference);if(r&&!C(this._view.spatialReference))return"virtual"===this._view.environment.lighting.type&&this._updateLighting(),!1;const i=e.position;return o(this._referencePosWGS84Comparable)&&(this._referencePosWGS84Comparable=P()),r?y(i,this._referencePosWGS84Comparable):u(this._referencePosWGS84Comparable,i.longitude,i.latitude,i.z),this.notifyChange("referencePositionWGS84Comparable"),this._autoUpdateTimezone(this._referencePosWGS84Comparable,t)||this._updateLighting(t),!0}_cameraHandlerServerSide(e){const t=e.position;(!this._referencePosMapCoords||this._referencePosMapCoordsRequested||this._exceedsReferencePosDistThreshold(t))&&this._requestReferencePositionUpdate(t,!0),this._view.mapCoordsHelper&&this._referencePosWGS84Comparable&&(this._referencePosWGS84Comparable[2]=t.z*this._view.mapCoordsHelper.unitInMeters,this._referencePosChanged())}_interactingStationaryHandler(){this._view.stationary&&this._executePendingReferencePositionUpdate()}_updateLighting(e,t=j.Immediate){const r=this._view;e=e||("virtual"===r.environment.lighting.type?null:r.environment.lighting.date);const i=this._referencePosWGS84Comparable,n=s(i)?q:A,o=this.weatherVisible?r.environment.weather.type:"disabled";s(i)?M(e,i,r.state.viewingMode,o,r.state.camera,n):"virtual"===r.environment.lighting.type&&H(r.state.camera,r.state.viewingMode,n.direct.directionToLightSource);const a=this._mainLight,h=n.direct;m(a.intensity,h.color,h.intensity*Math.PI),f(a.direction,h.directionToLightSource),a.specularStrength=n.specularStrength,a.environmentStrength=n.environmentStrength;const c=this._ambientLight;m(c.intensity,n.ambient.color,n.ambient.intensity);const d=this._moonLight;g(d.intensity,z,x,n.globalFactor);const l=(1-.5*n.globalFactor)*(1-.4*n.noonFactor*(1-n.globalFactor));m(d.intensity,d.intensity,l),f(d.direction,h.directionToLightSource),r._stage.renderView.updateLightSources([a,c,d],n.noonFactor,n.globalFactor,t),this._updateRenderParameters()}_autoUpdateTimezone(e,t=null){if("virtual"===this._view.environment.lighting.type||!this._view.environment.lighting.cameraTrackingEnabled||o(e))return!1;const r=I;r.setTime((t||this._view.environment.lighting.date).getTime());const i=S(e,V);if(o(i))return!1;let n=this._view.environment.lighting.positionTimezoneInfo;if(n.autoUpdated){if(n.hours===i.hours&&n.minutes===i.minutes&&n.seconds===i.seconds)return!1}else n=i;const s=r.getUTCHours()-(i.hours-n.hours),a=r.getUTCMinutes()-(i.minutes-n.minutes),h=r.getUTCSeconds()-(i.seconds-n.seconds);return r.setUTCHours(s),r.setUTCMinutes(a),r.setUTCSeconds(h),!t&&this._view.environment.lighting.autoUpdate(r,i)}_updateRenderParameters(){const e=this._view._stage;if(!e)return;const r=a(this._referencePosWGS84Comparable,!0,(e=>G(e[2],this._view.state.viewingMode))),i=this._view.environment.background,n=i instanceof Q?{type:"color",color:b(t.toUnitRGBA(i.color))}:{type:"color",color:w(0,0,0,1)};e.renderView.setRenderParameters({shadowMap:this._view.environment.lighting.directShadowsEnabled&&r,background:n,environment:this._view.environment,weatherVisible:this._view.environmentManager.weatherVisible})}_resetReferencePosition(e=!1){this._cancelReferencePosUpdates(),this._referencePosMapCoords=null,this._referencePosMapCoordsRequested=null,this._referencePosResetPreserveAbsoluteTime=null,this._referencePosWGS84Comparable=null,this.notifyChange("updating"),e&&this._cameraHandler()}_requestReferencePositionUpdate(e,t=!1){if(!this.disableQueries&&(this._referencePosMapCoordsRequested?this._referencePosMapCoordsRequested.copy(e):this._referencePosMapCoordsRequested=e.clone(),this._referencePosResetPreserveAbsoluteTime=!!t,!this._referencePosUpdateQuery&&!this._referencePosUpdateTimer&&this._view.stationary)){const e=this._referencePosUpdateQuery=h(this._referencePointUpdateDelay).then((()=>{if(this._referencePosUpdateQuery===e){const t=()=>this._referencePosUpdateQuery!==e;return this._doReferencePositionUpdateQuery(t)}})).catch((e=>{"mapcoordshelper:missing-geometry-service"===e.name&&(this.disableQueries=!0)})).then((()=>{this._referencePosUpdateQuery===e&&(this._referencePosUpdateQuery=null,this._referencePosUpdateTimer||this._executePendingReferencePositionUpdate(),this.notifyChange("updating"))})),t=this._referencePosUpdateTimer=h(this._referencePointUpdateInterval).then((()=>{this._referencePosUpdateTimer===t&&(this._referencePosUpdateTimer=null,this._referencePosUpdateQuery||this._executePendingReferencePositionUpdate())}));this.notifyChange("updating")}}async _doReferencePositionUpdateQuery(e){this._referencePosResetPreserveAbsoluteTime&&(this._preserveAbsoluteDateTime=!1),this._referencePosMapCoords?this._referencePosMapCoords.copy(this._referencePosMapCoordsRequested):this._referencePosMapCoords=this._referencePosMapCoordsRequested.clone(),this._referencePosResetPreserveAbsoluteTime=null,this._referencePosMapCoordsRequested=null;const t=await this._view.mapCoordsHelper.toGeographic(this._referencePosMapCoords);if(!e()&&!isNaN(t[0])&&!isNaN(t[1])){const e=this._referencePosMapCoords.z*this._view.mapCoordsHelper.unitInMeters;this._referencePosWGS84Comparable?(this._referencePosWGS84Comparable[0]=t[0],this._referencePosWGS84Comparable[1]=t[1],this._referencePosWGS84Comparable[2]=e):this._referencePosWGS84Comparable=[t[0],t[1],e],this._referencePosChanged()}}_executePendingReferencePositionUpdate(){const e=this._referencePosMapCoordsRequested;e&&this._requestReferencePositionUpdate(e,this._referencePosResetPreserveAbsoluteTime)}_referencePosChanged(){this._preserveAbsoluteDateTime?this._updateLighting():this._autoUpdateTimezone(this._referencePosWGS84Comparable)||this._updateLighting(),this.notifyChange("referencePositionWGS84Comparable")}_exceedsReferencePosDistThreshold(e){if(this._referencePosMapCoords){let t=this._referencePosMapCoords.distance(e);return this._view.mapCoordsHelper&&(t*=this._view.mapCoordsHelper.unitInMeters),t>this._referencePointUpdateDistThreshold}return!0}_cancelReferencePosUpdates(){const e=!!this._referencePosUpdateQuery;return this._referencePosUpdateQuery=null,this._referencePosUpdateTimer=null,e}get test(){const e=this;return{get renderer(){return e._renderer},set referencePointUpdateInterval(t){e._referencePointUpdateInterval=t},set referencePointUpdateDistThreshold(t){e._referencePointUpdateDistThreshold=t},set referencePosUpdateTimer(t){e._referencePosUpdateTimer=t},set referencePointUpdateDelay(t){e._referencePointUpdateDelay=t},set disableWeather(t){e._disableWeather=t}}}};e([p({type:Boolean,readOnly:!0})],D.prototype,"updating",null),e([p()],D.prototype,"disableQueries",void 0),e([p()],D.prototype,"_disableWeather",void 0),e([p()],D.prototype,"weatherEnabled",null),e([p()],D.prototype,"weatherVisible",null),e([p()],D.prototype,"referencePositionWGS84Comparable",null),e([p()],D.prototype,"_renderer",void 0),e([p()],D.prototype,"_referencePosWGS84Comparable",void 0),D=e([_("esri.views.3d.environment.SceneViewEnvironmentManager")],D);const q=new W,A=new W,I=new Date,V={hours:0,minutes:0,seconds:0},z=v(.22,.22,.33),x=v(.22,.22,.22);export{D as SceneViewEnvironmentManager};
@@ -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{lerp as e,clamp as t}from"../../../core/mathUtils.js";import{removeMaybe as s,disposeMaybe as r,isNone as i}from"../../../core/maybe.js";import{watch as a,syncAndInitial as o}from"../../../core/reactiveUtils.js";import{q as n}from"../../../chunks/mat4.js";import{c as h}from"../../../chunks/mat4f64.js";import{s as m}from"../../../chunks/vec2.js";import{l as c,g as u,a as p,i as _,f as d,p as l}from"../../../chunks/vec3.js";import{c as f}from"../../../chunks/vec3f64.js";import{getReferenceEllipsoid as g}from"../../../geometry/projectionEllipsoid.js";import{isMars as R}from"../../../geometry/support/spatialReferenceUtils.js";import{AtmosphereType as x}from"./AtmosphereType.js";import{computeInnerAltitudeFade as j,innerAtmosphereDepth as b}from"./atmosphereUtils.js";import{S as T}from"../../../chunks/SimpleAtmosphere.glsl.js";import{SimpleAtmosphereTechnique as V}from"./SimpleAtmosphereTechnique.js";import{SimpleAtmosphereTechniqueConfiguration as y,SimpleAtmosphereGeometry as q}from"./SimpleAtmosphereTechniqueConfiguration.js";import{marsAtmosphereTextureSimple as A}from"./resources/MarsAtmosphereTexture.js";import{earthAtmosphereTextureSimple as w}from"./resources/SimpleAtmosphereTexture.js";import{makePiecewiseLinearFunction as P}from"../support/mathUtils.js";import{glLayout as v}from"../support/buffer/glUtil.js";import{newLayout as C}from"../support/buffer/InterleavedLayout.js";import{Default3D as S}from"../webgl-engine/lib/DefaultVertexAttributeLocations.js";import{createQuadVAO as F}from"../webgl-engine/lib/glUtil3D.js";import{project as M}from"../webgl-engine/lib/Util.js";import{VertexArrayObject as U}from"../webgl-engine/lib/VertexArrayObject.js";import{VertexAttribute as I}from"../webgl-engine/lib/VertexAttribute.js";import{BufferObject as O}from"../../webgl/BufferObject.js";import{PixelFormat as E,PixelType as W,TextureWrapMode as k,TextureSamplingMode as L,PrimitiveType as N,Usage as D}from"../../webgl/enums.js";import{Texture as G}from"../../webgl/Texture.js";import{vertexCount as B}from"../../webgl/Util.js";const H=128,z=-b,Y=0,J=50,K=()=>1-511/512,Q=P([[50,.1015625],[500,.21875],[5e3,1-250/512],[5e4,.4140625]]);class X{constructor(e){this.view=e,this.type=x.Simple,this._passParameters=new T,this._fadeVaoCount=0,this._texV1=1,this._isOnMars=R(e.spatialReference);const t=g(e.spatialReference);this._planetRadius=t.radius,this._outerRimWidth=t.outerAtmosphereRimWidth,this._innerRimFactor=(this._planetRadius+z)/this._planetRadius,this._middleRimFactor=(this._planetRadius+Y)/this._planetRadius,this._outerRimFactor=(this._planetRadius+this._outerRimWidth)/this._planetRadius,this._texV0=Y/this._outerRimWidth,this._texVScale=this._texV1-this._texV0}destroy(){this._cameraChangeHandle=s(this._cameraChangeHandle),this._passParameters.texture=r(this._passParameters.texture),this._fadeVao=r(this._fadeVao),this._vao=r(this._vao)}async initializeRenderContext(e){this._shaderTechniqueRepository=e.shaderTechniqueRepository;const t=e.renderContext.rctx;this._cameraChangeHandle=a((()=>this.view.state?.camera),(()=>e.requestRender()),o),this._vao=this._createRibbon(t),this._vaoCount=B(this._vao,"geometry"),this._fadeVao=F(t),this._fadeVaoCount=B(this._fadeVao,"geometry");const s=this._isOnMars?A:w;this._passParameters.texture=new G(t,{pixelFormat:E.RGBA,dataType:W.UNSIGNED_BYTE,wrapMode:k.CLAMP_TO_EDGE,samplingMode:L.LINEAR,flipped:!0,width:1,height:512},s),e.requestRender()}get _coneTechnique(){if(i(this._coneTechniqueCached)){const e=new y;e.geometry=q.Cone,this._coneTechniqueCached=this._shaderTechniqueRepository.acquire(V,e)}return this._coneTechniqueCached}get _undergroundTechnique(){if(i(this._undergroundTechniqueCached)){const e=new y;e.geometry=q.Underground,this._undergroundTechniqueCached=this._shaderTechniqueRepository.acquire(V,e)}return this._undergroundTechniqueCached}render(e){if(i(this._vao)||i(this._passParameters.texture))return;const t=e.bindParameters.camera;this._update(t);const s=e.rctx;this._passParameters.undergroundFadeAlpha<1&&(s.bindTechnique(this._coneTechnique,this._passParameters,e.bindParameters),s.bindVAO(this._vao),s.drawArrays(N.TRIANGLES,0,this._vaoCount)),this._passParameters.undergroundFadeAlpha>0&&(s.bindTechnique(this._undergroundTechnique,this._passParameters,e.bindParameters),s.bindVAO(this._fadeVao),s.drawArrays(N.TRIANGLE_STRIP,0,this._fadeVaoCount))}renderHaze(){}_update(s){const r=f(),i=this._planetRadius,a=c(s.eye),o=a-i;if(o<0){const e=Math.min(-o/5e3,1);this._passParameters.undergroundFadeAlpha=e}else this._passParameters.undergroundFadeAlpha=0;const n=Math.max(J,o),h=i+z;this._passParameters.innerScale=se(i+n,i,h)-1,this._passParameters.altitudeFade=j(o),u(r,s.eye,(i+J)/a),Z(r,s.center,s.up,i,this._passParameters.silhouette);const p=this._computeScreenRimWidth(s,r,s.up,this._passParameters.silhouette),_=K(),d=Q(o);let l=this._texV0+_*this._texVScale,g=this._texV0+p*d*this._texVScale;if(o>J){Z(s.eye,s.center,s.up,i,this._passParameters.silhouette);const r=this._computeScreenRimWidth(s,s.eye,s.up,this._passParameters.silhouette),a=t((r-1.5)/(p-1.5),0,1);l=this._texV0+a*_*this._texVScale,g=this._texV0+e(this._texV1,p*d,a)*this._texVScale}m(this._passParameters.texV,l,g)}_createRibbon(e){const t=new Float32Array(3+3*H*3),s=new Uint32Array(3*H*5);t[0]=0,t[1]=0,t[2]=-1;for(let a=0;a<H;a++){const e=9*a+3;t[e+0]=a,t[e+1]=this._innerRimFactor,t[e+2]=-1,t[e+3]=a,t[e+4]=this._middleRimFactor,t[e+5]=0,t[e+6]=a,t[e+7]=this._outerRimFactor,t[e+8]=1;const r=3*a+1,i=a===H-1?1:r+3,o=15*a;s[o+0]=r,s[o+1]=r+1,s[o+2]=i+1,s[o+3]=i+1,s[o+4]=i,s[o+5]=r,s[o+6]=r+1,s[o+7]=r+2,s[o+8]=i+2,s[o+9]=i+2,s[o+10]=i+1,s[o+11]=r+1,s[o+12]=r,s[o+13]=i,s[o+14]=0}const r=re.createBuffer(s.length),i=r.position;for(let a=0;a<s.length;++a){const e=3*s[a];i.set(a,0,t[e]),i.set(a,1,t[e+1]),i.set(a,2,t[e+2])}return new U(e,S,{geometry:v(re)},{geometry:O.createVertex(e,D.STATIC_DRAW,r.buffer)})}_computeScreenRimWidth(e,t,s,r){return p(ee,r.center,r.v2),u(te,ee,this._outerRimFactor),n($,t,ee,s),M(ee,$,e.projectionMatrix,e.viewport),M(te,$,e.projectionMatrix,e.viewport),_(ee,te)/e.height}}function Z(e,t,s,r,i){const a=c(e),o=r*Math.sqrt(a*a-r*r)/a,n=Math.sqrt(r*r-o*o),h=i.v1,m=i.v2;return u(i.center,e,n/a),d(h,e,t),l(h)<1&&d(h,e,s),u(h,h,o/c(h)),d(m,h,e),u(m,m,o/c(m)),o}const $=h(),ee=f(),te=f();function se(e,t,s){return e*e/(Math.sqrt(e*e-t*t)*Math.sqrt(e*e-s*s)+t*s)}const re=C().vec3f(I.POSITION);export{X as default};
5
+ import{lerp as e,clamp as t}from"../../../core/mathUtils.js";import{removeMaybe as s,disposeMaybe as r,isNone as i}from"../../../core/maybe.js";import{watch as a,syncAndInitial as o}from"../../../core/reactiveUtils.js";import{q as n}from"../../../chunks/mat4.js";import{c as h}from"../../../chunks/mat4f64.js";import{s as m}from"../../../chunks/vec2.js";import{l as c,g as u,a as p,i as _,f as d,z as l}from"../../../chunks/vec3.js";import{c as f}from"../../../chunks/vec3f64.js";import{getReferenceEllipsoid as g}from"../../../geometry/projectionEllipsoid.js";import{isMars as R}from"../../../geometry/support/spatialReferenceUtils.js";import{AtmosphereType as x}from"./AtmosphereType.js";import{computeInnerAltitudeFade as j,innerAtmosphereDepth as b}from"./atmosphereUtils.js";import{S as T}from"../../../chunks/SimpleAtmosphere.glsl.js";import{SimpleAtmosphereTechnique as V}from"./SimpleAtmosphereTechnique.js";import{SimpleAtmosphereTechniqueConfiguration as y,SimpleAtmosphereGeometry as q}from"./SimpleAtmosphereTechniqueConfiguration.js";import{marsAtmosphereTextureSimple as A}from"./resources/MarsAtmosphereTexture.js";import{earthAtmosphereTextureSimple as w}from"./resources/SimpleAtmosphereTexture.js";import{makePiecewiseLinearFunction as P}from"../support/mathUtils.js";import{glLayout as v}from"../support/buffer/glUtil.js";import{newLayout as C}from"../support/buffer/InterleavedLayout.js";import{Default3D as S}from"../webgl-engine/lib/DefaultVertexAttributeLocations.js";import{createQuadVAO as F}from"../webgl-engine/lib/glUtil3D.js";import{project as M}from"../webgl-engine/lib/Util.js";import{VertexArrayObject as U}from"../webgl-engine/lib/VertexArrayObject.js";import{VertexAttribute as I}from"../webgl-engine/lib/VertexAttribute.js";import{BufferObject as O}from"../../webgl/BufferObject.js";import{PixelFormat as E,PixelType as W,TextureWrapMode as k,TextureSamplingMode as L,PrimitiveType as N,Usage as D}from"../../webgl/enums.js";import{Texture as G}from"../../webgl/Texture.js";import{vertexCount as B}from"../../webgl/Util.js";const H=128,z=-b,Y=0,J=50,K=()=>1-511/512,Q=P([[50,.1015625],[500,.21875],[5e3,1-250/512],[5e4,.4140625]]);class X{constructor(e){this.view=e,this.type=x.Simple,this._passParameters=new T,this._fadeVaoCount=0,this._texV1=1,this._isOnMars=R(e.spatialReference);const t=g(e.spatialReference);this._planetRadius=t.radius,this._outerRimWidth=t.outerAtmosphereRimWidth,this._innerRimFactor=(this._planetRadius+z)/this._planetRadius,this._middleRimFactor=(this._planetRadius+Y)/this._planetRadius,this._outerRimFactor=(this._planetRadius+this._outerRimWidth)/this._planetRadius,this._texV0=Y/this._outerRimWidth,this._texVScale=this._texV1-this._texV0}destroy(){this._cameraChangeHandle=s(this._cameraChangeHandle),this._passParameters.texture=r(this._passParameters.texture),this._fadeVao=r(this._fadeVao),this._vao=r(this._vao)}async initializeRenderContext(e){this._shaderTechniqueRepository=e.shaderTechniqueRepository;const t=e.renderContext.rctx;this._cameraChangeHandle=a((()=>this.view.state?.camera),(()=>e.requestRender()),o),this._vao=this._createRibbon(t),this._vaoCount=B(this._vao,"geometry"),this._fadeVao=F(t),this._fadeVaoCount=B(this._fadeVao,"geometry");const s=this._isOnMars?A:w;this._passParameters.texture=new G(t,{pixelFormat:E.RGBA,dataType:W.UNSIGNED_BYTE,wrapMode:k.CLAMP_TO_EDGE,samplingMode:L.LINEAR,flipped:!0,width:1,height:512},s),e.requestRender()}get _coneTechnique(){if(i(this._coneTechniqueCached)){const e=new y;e.geometry=q.Cone,this._coneTechniqueCached=this._shaderTechniqueRepository.acquire(V,e)}return this._coneTechniqueCached}get _undergroundTechnique(){if(i(this._undergroundTechniqueCached)){const e=new y;e.geometry=q.Underground,this._undergroundTechniqueCached=this._shaderTechniqueRepository.acquire(V,e)}return this._undergroundTechniqueCached}render(e){if(i(this._vao)||i(this._passParameters.texture))return;const t=e.bindParameters.camera;this._update(t);const s=e.rctx;this._passParameters.undergroundFadeAlpha<1&&(s.bindTechnique(this._coneTechnique,this._passParameters,e.bindParameters),s.bindVAO(this._vao),s.drawArrays(N.TRIANGLES,0,this._vaoCount)),this._passParameters.undergroundFadeAlpha>0&&(s.bindTechnique(this._undergroundTechnique,this._passParameters,e.bindParameters),s.bindVAO(this._fadeVao),s.drawArrays(N.TRIANGLE_STRIP,0,this._fadeVaoCount))}renderHaze(){}_update(s){const r=f(),i=this._planetRadius,a=c(s.eye),o=a-i;if(o<0){const e=Math.min(-o/5e3,1);this._passParameters.undergroundFadeAlpha=e}else this._passParameters.undergroundFadeAlpha=0;const n=Math.max(J,o),h=i+z;this._passParameters.innerScale=se(i+n,i,h)-1,this._passParameters.altitudeFade=j(o),u(r,s.eye,(i+J)/a),Z(r,s.center,s.up,i,this._passParameters.silhouette);const p=this._computeScreenRimWidth(s,r,s.up,this._passParameters.silhouette),_=K(),d=Q(o);let l=this._texV0+_*this._texVScale,g=this._texV0+p*d*this._texVScale;if(o>J){Z(s.eye,s.center,s.up,i,this._passParameters.silhouette);const r=this._computeScreenRimWidth(s,s.eye,s.up,this._passParameters.silhouette),a=t((r-1.5)/(p-1.5),0,1);l=this._texV0+a*_*this._texVScale,g=this._texV0+e(this._texV1,p*d,a)*this._texVScale}m(this._passParameters.texV,l,g)}_createRibbon(e){const t=new Float32Array(3+3*H*3),s=new Uint32Array(3*H*5);t[0]=0,t[1]=0,t[2]=-1;for(let a=0;a<H;a++){const e=9*a+3;t[e+0]=a,t[e+1]=this._innerRimFactor,t[e+2]=-1,t[e+3]=a,t[e+4]=this._middleRimFactor,t[e+5]=0,t[e+6]=a,t[e+7]=this._outerRimFactor,t[e+8]=1;const r=3*a+1,i=a===H-1?1:r+3,o=15*a;s[o+0]=r,s[o+1]=r+1,s[o+2]=i+1,s[o+3]=i+1,s[o+4]=i,s[o+5]=r,s[o+6]=r+1,s[o+7]=r+2,s[o+8]=i+2,s[o+9]=i+2,s[o+10]=i+1,s[o+11]=r+1,s[o+12]=r,s[o+13]=i,s[o+14]=0}const r=re.createBuffer(s.length),i=r.position;for(let a=0;a<s.length;++a){const e=3*s[a];i.set(a,0,t[e]),i.set(a,1,t[e+1]),i.set(a,2,t[e+2])}return new U(e,S,{geometry:v(re)},{geometry:O.createVertex(e,D.STATIC_DRAW,r.buffer)})}_computeScreenRimWidth(e,t,s,r){return p(ee,r.center,r.v2),u(te,ee,this._outerRimFactor),n($,t,ee,s),M(ee,$,e.projectionMatrix,e.viewport),M(te,$,e.projectionMatrix,e.viewport),_(ee,te)/e.height}}function Z(e,t,s,r,i){const a=c(e),o=r*Math.sqrt(a*a-r*r)/a,n=Math.sqrt(r*r-o*o),h=i.v1,m=i.v2;return u(i.center,e,n/a),d(h,e,t),l(h)<1&&d(h,e,s),u(h,h,o/c(h)),d(m,h,e),u(m,m,o/c(m)),o}const $=h(),ee=f(),te=f();function se(e,t,s){return e*e/(Math.sqrt(e*e-t*t)*Math.sqrt(e*e-s*s)+t*s)}const re=C().vec3f(I.POSITION);export{X as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.25/esri/copyright.txt for details.
4
4
  */
5
- import{getOrCreateMapValue as e}from"../../../../core/MapUtils.js";import{eachAlwaysValues as t}from"../../../../core/promiseUtils.js";import{isDataProtocol as r,dataComponents as s,dataToArrayBuffer as n,makeAbsolute as o}from"../../../../core/urlUtils.js";import{Version as a}from"../../../../core/Version.js";import{y as i,m as u,v as c,e as f,k as d}from"../../../../chunks/mat4.js";import{c as p,b as m}from"../../../../chunks/mat4f64.js";import{g as l}from"../../../../chunks/quat.js";import{a as h}from"../../../../chunks/quatf64.js";import{BufferViewUint32 as y,BufferViewUint16 as T,BufferViewUint8 as b,BufferViewVec3f as _,BufferViewVec4f as x,BufferViewVec2f as w,BufferViewVec4u8 as O,BufferViewVec4u16 as N,BufferViewVec3u8 as S,BufferViewVec3u16 as g,BufferViewVec2u32 as C,BufferViewVec2u16 as U,BufferViewVec2i16 as I,BufferViewVec2u8 as L,BufferViewVec2i8 as A}from"../../../../geometry/support/buffer/BufferView.js";import{m as E}from"../../../../chunks/scalar.js";import{BinaryStreamReader as R}from"./BinaryStreamReader.js";import{AttributeType as B}from"./enums.js";import{material as v,textureSampler as D}from"./fillDefaults.js";import{splitURI as G}from"./pathUtils.js";import{DataType as j}from"../../../webgl/enums.js";const M={MAGIC:1179937895,CHUNK_TYPE_JSON:1313821514,CHUNK_TYPE_BIN:5130562,MIN_HEADER_LENGTH:20};class F{constructor(e,t,r,s,n){this._context=e,this._errorContext=t,this.uri=r,this.json=s,this._glbBuffer=n,this._bufferLoaders=new Map,this._textureLoaders=new Map,this._textureCache=new Map,this._materialCache=new Map,this._nodeParentMap=new Map,this._nodeTransformCache=new Map,this._baseUri=G(this.uri).dirPart,this._checkVersionSupported(),this._checkRequiredExtensionsSupported(),t.errorUnsupportedIf(null==s.scenes,"Scenes must be defined."),t.errorUnsupportedIf(null==s.meshes,"Meshes must be defined"),t.errorUnsupportedIf(null==s.nodes,"Nodes must be defined."),this._computeNodeParents()}static async load(e,t,o,a){if(r(o)){const r=s(o);if(r&&"model/gltf-binary"!==r.mediaType)try{const s=JSON.parse(r.isBase64?atob(r.data):r.data);return new F(e,t,o,s)}catch{}const a=n(o);if(F._isGLBData(a))return this._fromGLBData(e,t,o,a)}if(o.endsWith(".gltf")){const r=await e.loadJSON(o,a);return new F(e,t,o,r)}const i=await e.loadBinary(o,a);if(F._isGLBData(i))return this._fromGLBData(e,t,o,i);const u=await e.loadJSON(o,a);return new F(e,t,o,u)}static _isGLBData(e){if(null==e)return!1;const t=new R(e);return t.remainingBytes()>=4&&t.readUint32()===M.MAGIC}static async _fromGLBData(e,t,r,s){const n=await F._parseGLBData(t,s);return new F(e,t,r,n.json,n.binaryData)}static async _parseGLBData(e,t){const r=new R(t);e.assert(r.remainingBytes()>=12,"GLB binary data is insufficiently large.");const s=r.readUint32(),n=r.readUint32(),o=r.readUint32();e.assert(s===M.MAGIC,"Magic first 4 bytes do not fit to expected GLB value."),e.assert(t.byteLength>=o,"GLB binary data is smaller than header specifies."),e.errorUnsupportedIf(2!==n,"An unsupported GLB container version was detected. Only version 2 is supported.");let a,i,u=0;for(;r.remainingBytes()>=8;){const t=r.readUint32(),s=r.readUint32();0===u?(e.assert(s===M.CHUNK_TYPE_JSON,"First GLB chunk must be JSON."),e.assert(t>=0,"No JSON data found."),a=await K(r.readUint8Array(t))):1===u?(e.errorUnsupportedIf(s!==M.CHUNK_TYPE_BIN,"Second GLB chunk expected to be BIN."),i=r.readUint8Array(t)):e.warnUnsupported("More than 2 GLB chunks detected. Skipping."),u+=1}return a||e.error("No GLB JSON chunk detected."),{json:a,binaryData:i}}async getBuffer(e,t){const r=this.json.buffers[e],s=this._errorContext;if(null==r.uri)return s.assert(null!=this._glbBuffer,"GLB buffer not present"),this._glbBuffer;const n=await this._getBufferLoader(e,t);return s.assert(n.byteLength===r.byteLength,"Buffer byte lengths should match."),n}async _getBufferLoader(e,t){const r=this._bufferLoaders.get(e);if(r)return r;const s=this.json.buffers[e].uri,n=this._context.loadBinary(this._resolveUri(s),t).then((e=>new Uint8Array(e)));return this._bufferLoaders.set(e,n),n}async getAccessor(e,t){const r=this._errorContext;r.errorUnsupportedIf(!this.json.accessors,"Accessors missing.");const s=this.json.accessors[e];r.errorUnsupportedIf(null==s?.bufferView,"Some accessor does not specify a bufferView."),r.errorUnsupportedIf(s.type in[B.MAT2,B.MAT3,B.MAT4],`AttributeType ${s.type} is not supported`);const n=this.json.bufferViews[s.bufferView],o=await this.getBuffer(n.buffer,t),a=V[s.type],i=Y[s.componentType],u=a*i,c=n.byteStride||u;return{raw:o.buffer,byteStride:c,byteOffset:o.byteOffset+(n.byteOffset||0)+(s.byteOffset||0),entryCount:s.count,isDenselyPacked:c===u,componentCount:a,componentByteSize:i,componentType:s.componentType,min:s.min,max:s.max,normalized:!!s.normalized}}async getIndexData(e,t){if(null==e.indices)return;const r=await this.getAccessor(e.indices,t);if(r.isDenselyPacked)switch(r.componentType){case j.UNSIGNED_BYTE:return new Uint8Array(r.raw,r.byteOffset,r.entryCount);case j.UNSIGNED_SHORT:return new Uint16Array(r.raw,r.byteOffset,r.entryCount);case j.UNSIGNED_INT:return new Uint32Array(r.raw,r.byteOffset,r.entryCount)}else switch(r.componentType){case j.UNSIGNED_BYTE:return E(this._wrapAccessor(b,r));case j.UNSIGNED_SHORT:return E(this._wrapAccessor(T,r));case j.UNSIGNED_INT:return E(this._wrapAccessor(y,r))}}async getPositionData(e,t){const r=this._errorContext;r.errorUnsupportedIf(null==e.attributes.POSITION,"No POSITION vertex data found.");const s=await this.getAccessor(e.attributes.POSITION,t);return r.errorUnsupportedIf(s.componentType!==j.FLOAT,"Expected type FLOAT for POSITION vertex attribute, but found "+z[s.componentType]),r.errorUnsupportedIf(3!==s.componentCount,"POSITION vertex attribute must have 3 components, but found "+s.componentCount.toFixed()),this._wrapAccessor(_,s)}async getNormalData(e,t){const r=this._errorContext;r.assert(null!=e.attributes.NORMAL,"No NORMAL vertex data found.");const s=await this.getAccessor(e.attributes.NORMAL,t);return r.errorUnsupportedIf(s.componentType!==j.FLOAT,"Expected type FLOAT for NORMAL vertex attribute, but found "+z[s.componentType]),r.errorUnsupportedIf(3!==s.componentCount,"NORMAL vertex attribute must have 3 components, but found "+s.componentCount.toFixed()),this._wrapAccessor(_,s)}async getTangentData(e,t){const r=this._errorContext;r.assert(null!=e.attributes.TANGENT,"No TANGENT vertex data found.");const s=await this.getAccessor(e.attributes.TANGENT,t);return r.errorUnsupportedIf(s.componentType!==j.FLOAT,"Expected type FLOAT for TANGENT vertex attribute, but found "+z[s.componentType]),r.errorUnsupportedIf(4!==s.componentCount,"TANGENT vertex attribute must have 4 components, but found "+s.componentCount.toFixed()),new x(s.raw,s.byteOffset,s.byteStride,s.byteOffset+s.byteStride*s.entryCount)}async getTextureCoordinates(e,t){const r=this._errorContext;r.assert(null!=e.attributes.TEXCOORD_0,"No TEXCOORD_0 vertex data found.");const s=await this.getAccessor(e.attributes.TEXCOORD_0,t);return r.errorUnsupportedIf(2!==s.componentCount,"TEXCOORD_0 vertex attribute must have 2 components, but found "+s.componentCount.toFixed()),s.componentType===j.FLOAT?this._wrapAccessor(w,s):(r.errorUnsupportedIf(!s.normalized,"Integer component types are only supported for a normalized accessor for TEXCOORD_0."),J(s))}async getVertexColors(e,t){const r=this._errorContext;r.assert(null!=e.attributes.COLOR_0,"No COLOR_0 vertex data found.");const s=await this.getAccessor(e.attributes.COLOR_0,t);if(r.errorUnsupportedIf(4!==s.componentCount&&3!==s.componentCount,"COLOR_0 attribute must have 3 or 4 components, but found "+s.componentCount.toFixed()),4===s.componentCount){if(s.componentType===j.FLOAT)return this._wrapAccessor(x,s);if(s.componentType===j.UNSIGNED_BYTE)return this._wrapAccessor(O,s);if(s.componentType===j.UNSIGNED_SHORT)return this._wrapAccessor(N,s)}else if(3===s.componentCount){if(s.componentType===j.FLOAT)return this._wrapAccessor(_,s);if(s.componentType===j.UNSIGNED_BYTE)return this._wrapAccessor(S,s);if(s.componentType===j.UNSIGNED_SHORT)return this._wrapAccessor(g,s)}r.errorUnsupported("Unsupported component type for COLOR_0 attribute: "+z[s.componentType])}hasPositions(e){return void 0!==e.attributes.POSITION}hasNormals(e){return void 0!==e.attributes.NORMAL}hasVertexColors(e){return void 0!==e.attributes.COLOR_0}hasTextureCoordinates(e){return void 0!==e.attributes.TEXCOORD_0}hasTangents(e){return void 0!==e.attributes.TANGENT}async getMaterial(e,t,r){let s=e.material?this._materialCache.get(e.material):void 0;if(!s){const n=null!=e.material?v(this.json.materials[e.material]):v(),o=n.pbrMetallicRoughness,a=this.hasVertexColors(e),i=this.getTexture(o.baseColorTexture,t),u=this.getTexture(n.normalTexture,t),c=r?this.getTexture(n.occlusionTexture,t):void 0,f=r?this.getTexture(n.emissiveTexture,t):void 0,d=r?this.getTexture(o.metallicRoughnessTexture,t):void 0,p=null!=e.material?e.material:-1;s={alphaMode:n.alphaMode,alphaCutoff:n.alphaCutoff,color:o.baseColorFactor,doubleSided:!!n.doubleSided,colorTexture:await i,normalTexture:await u,name:n.name,id:p,occlusionTexture:await c,emissiveTexture:await f,emissiveFactor:n.emissiveFactor,metallicFactor:o.metallicFactor,roughnessFactor:o.roughnessFactor,metallicRoughnessTexture:await d,hasVertexColors:a,ESRI_externalColorMixMode:n.extras.ESRI_externalColorMixMode,colorTextureTransform:o?.baseColorTexture?.extensions?.KHR_texture_transform,normalTextureTransform:n.normalTexture?.extensions?.KHR_texture_transform,occlusionTextureTransform:n.occlusionTexture?.extensions?.KHR_texture_transform,emissiveTextureTransform:n.emissiveTexture?.extensions?.KHR_texture_transform,metallicRoughnessTextureTransform:o?.metallicRoughnessTexture?.extensions?.KHR_texture_transform}}return s}async getTexture(t,r){if(!t)return;this._errorContext.errorUnsupportedIf(0!==(t.texCoord||0),"Only TEXCOORD with index 0 is supported.");const s=t.index,n=this._errorContext,o=this.json.textures[s],a=D(null!=o.sampler?this.json.samplers[o.sampler]:{});n.errorUnsupportedIf(null==o.source,"Source is expected to be defined for a texture.");const i=this.json.images[o.source],u=await this._loadTextureImageData(s,o,r);return e(this._textureCache,s,(()=>{const e=e=>33071===e||33648===e||10497===e,t=e=>(n.error(`Unexpected TextureSampler WrapMode: ${e}. Using default REPEAT(10497).`),10497);return{data:u,wrapS:e(a.wrapS)?a.wrapS:t(a.wrapS),wrapT:e(a.wrapT)?a.wrapT:t(a.wrapT),minFilter:a.minFilter,name:i.name,id:s}}))}getNodeTransform(e){if(void 0===e)return H;let t=this._nodeTransformCache.get(e);if(!t){const r=this.getNodeTransform(this._getNodeParent(e)),s=this.json.nodes[e];s.matrix?t=u(p(),r,s.matrix):s.translation||s.rotation||s.scale?(t=m(r),s.translation&&c(t,t,s.translation),s.rotation&&(k[3]=l(k,s.rotation),f(t,t,k[3],k)),s.scale&&d(t,t,s.scale)):t=r,this._nodeTransformCache.set(e,t)}return t}_wrapAccessor(e,t){return new e(t.raw,t.byteOffset,t.byteStride,t.byteOffset+t.byteStride*(t.entryCount-1)+t.componentByteSize*t.componentCount)}_resolveUri(e){return o(e,this._baseUri)}_getNodeParent(e){return this._nodeParentMap.get(e)}_checkVersionSupported(){const e=a.parse(this.json.asset.version,"glTF");P.validate(e)}_checkRequiredExtensionsSupported(){const e=this.json,t=this._errorContext;e.extensionsRequired&&0!==e.extensionsRequired.length&&t.errorUnsupported("gltf loader was not able to load unsupported feature. Required extensions: "+e.extensionsRequired.join(", "))}_computeNodeParents(){this.json.nodes.forEach(((e,t)=>{e.children&&e.children.forEach((e=>{this._nodeParentMap.set(e,t)}))}))}async _loadTextureImageData(e,t,r){const s=this._textureLoaders.get(e);if(s)return s;const n=this._createTextureLoader(t,r);return this._textureLoaders.set(e,n),n}async _createTextureLoader(e,t){const r=this.json.images[e.source];if(r.uri)return this._context.loadImage(this._resolveUri(r.uri),t);const s=this._errorContext;s.errorUnsupportedIf(null==r.bufferView,"Image bufferView must be defined."),s.errorUnsupportedIf(null==r.mimeType,"Image mimeType must be defined.");const n=this.json.bufferViews[r.bufferView],o=await this.getBuffer(n.buffer,t);return s.errorUnsupportedIf(null!=n.byteStride,"byteStride not supported for image buffer"),q(new Uint8Array(o.buffer,o.byteOffset+(n.byteOffset||0),n.byteLength),r.mimeType)}async getLoadedBuffersSize(){if(this._glbBuffer)return this._glbBuffer.byteLength;const e=await t(Array.from(this._bufferLoaders.values())),r=await t(Array.from(this._textureLoaders.values()));return e.reduce(((e,t)=>e+(t?.byteLength??0)),0)+r.reduce(((e,t)=>e+(t?t.width*t.height*4:0)),0)}}const P=new a(2,0,"glTF"),H=i(p(),Math.PI/2),k=h(),V={SCALAR:1,VEC2:2,VEC3:3,VEC4:4},Y={[j.BYTE]:1,[j.UNSIGNED_BYTE]:1,[j.SHORT]:2,[j.UNSIGNED_SHORT]:2,[j.FLOAT]:4,[j.UNSIGNED_INT]:4};function J(e){switch(e.componentType){case j.BYTE:return new A(e.raw,e.byteOffset,e.byteStride,e.byteOffset+e.byteStride*e.entryCount);case j.UNSIGNED_BYTE:return new L(e.raw,e.byteOffset,e.byteStride,e.byteOffset+e.byteStride*e.entryCount);case j.SHORT:return new I(e.raw,e.byteOffset,e.byteStride,e.byteOffset+e.byteStride*e.entryCount);case j.UNSIGNED_SHORT:return new U(e.raw,e.byteOffset,e.byteStride,e.byteOffset+e.byteStride*e.entryCount);case j.UNSIGNED_INT:return new C(e.raw,e.byteOffset,e.byteStride,e.byteOffset+e.byteStride*e.entryCount);case j.FLOAT:return new w(e.raw,e.byteOffset,e.byteStride,e.byteOffset+e.byteStride*e.entryCount)}}async function K(e){return new Promise(((t,r)=>{const s=new Blob([e]),n=new FileReader;n.onload=()=>{const e=n.result;t(JSON.parse(e))},n.onerror=e=>{r(e)},n.readAsText(s)}))}async function q(e,t){return new Promise(((r,s)=>{const n=new Blob([e],{type:t}),o=URL.createObjectURL(n),a=new Image,i=()=>{URL.revokeObjectURL(o),"decode"in a?a.decode().then((()=>r(a)),(()=>r(a))).then(c):(r(a),c())},u=e=>{URL.revokeObjectURL(o),s(e),c()},c=()=>{a.removeEventListener("load",i),a.removeEventListener("error",u)};a.addEventListener("load",i),a.addEventListener("error",u),a.src=o}))}const z={5120:"BYTE",5121:"UNSIGNED_BYTE",5122:"SHORT",5123:"UNSIGNED_SHORT",5125:"UNSIGNED_INT",5126:"FLOAT"};export{F as Resource};
5
+ import{getOrCreateMapValue as e}from"../../../../core/MapUtils.js";import{eachAlwaysValues as t}from"../../../../core/promiseUtils.js";import{isDataProtocol as r,dataComponents as s,dataToArrayBuffer as n,makeAbsolute as o}from"../../../../core/urlUtils.js";import{Version as a}from"../../../../core/Version.js";import{y as i,m as u,v as c,e as f,k as d}from"../../../../chunks/mat4.js";import{c as p,b as m}from"../../../../chunks/mat4f64.js";import{g as l}from"../../../../chunks/quat.js";import{c as h}from"../../../../chunks/quatf64.js";import{BufferViewUint32 as y,BufferViewUint16 as T,BufferViewUint8 as b,BufferViewVec3f as _,BufferViewVec4f as x,BufferViewVec2f as w,BufferViewVec4u8 as O,BufferViewVec4u16 as N,BufferViewVec3u8 as S,BufferViewVec3u16 as g,BufferViewVec2u32 as C,BufferViewVec2u16 as U,BufferViewVec2i16 as I,BufferViewVec2u8 as L,BufferViewVec2i8 as A}from"../../../../geometry/support/buffer/BufferView.js";import{m as E}from"../../../../chunks/scalar.js";import{BinaryStreamReader as R}from"./BinaryStreamReader.js";import{AttributeType as B}from"./enums.js";import{material as v,textureSampler as D}from"./fillDefaults.js";import{splitURI as G}from"./pathUtils.js";import{DataType as j}from"../../../webgl/enums.js";const M={MAGIC:1179937895,CHUNK_TYPE_JSON:1313821514,CHUNK_TYPE_BIN:5130562,MIN_HEADER_LENGTH:20};class F{constructor(e,t,r,s,n){this._context=e,this._errorContext=t,this.uri=r,this.json=s,this._glbBuffer=n,this._bufferLoaders=new Map,this._textureLoaders=new Map,this._textureCache=new Map,this._materialCache=new Map,this._nodeParentMap=new Map,this._nodeTransformCache=new Map,this._baseUri=G(this.uri).dirPart,this._checkVersionSupported(),this._checkRequiredExtensionsSupported(),t.errorUnsupportedIf(null==s.scenes,"Scenes must be defined."),t.errorUnsupportedIf(null==s.meshes,"Meshes must be defined"),t.errorUnsupportedIf(null==s.nodes,"Nodes must be defined."),this._computeNodeParents()}static async load(e,t,o,a){if(r(o)){const r=s(o);if(r&&"model/gltf-binary"!==r.mediaType)try{const s=JSON.parse(r.isBase64?atob(r.data):r.data);return new F(e,t,o,s)}catch{}const a=n(o);if(F._isGLBData(a))return this._fromGLBData(e,t,o,a)}if(o.endsWith(".gltf")){const r=await e.loadJSON(o,a);return new F(e,t,o,r)}const i=await e.loadBinary(o,a);if(F._isGLBData(i))return this._fromGLBData(e,t,o,i);const u=await e.loadJSON(o,a);return new F(e,t,o,u)}static _isGLBData(e){if(null==e)return!1;const t=new R(e);return t.remainingBytes()>=4&&t.readUint32()===M.MAGIC}static async _fromGLBData(e,t,r,s){const n=await F._parseGLBData(t,s);return new F(e,t,r,n.json,n.binaryData)}static async _parseGLBData(e,t){const r=new R(t);e.assert(r.remainingBytes()>=12,"GLB binary data is insufficiently large.");const s=r.readUint32(),n=r.readUint32(),o=r.readUint32();e.assert(s===M.MAGIC,"Magic first 4 bytes do not fit to expected GLB value."),e.assert(t.byteLength>=o,"GLB binary data is smaller than header specifies."),e.errorUnsupportedIf(2!==n,"An unsupported GLB container version was detected. Only version 2 is supported.");let a,i,u=0;for(;r.remainingBytes()>=8;){const t=r.readUint32(),s=r.readUint32();0===u?(e.assert(s===M.CHUNK_TYPE_JSON,"First GLB chunk must be JSON."),e.assert(t>=0,"No JSON data found."),a=await K(r.readUint8Array(t))):1===u?(e.errorUnsupportedIf(s!==M.CHUNK_TYPE_BIN,"Second GLB chunk expected to be BIN."),i=r.readUint8Array(t)):e.warnUnsupported("More than 2 GLB chunks detected. Skipping."),u+=1}return a||e.error("No GLB JSON chunk detected."),{json:a,binaryData:i}}async getBuffer(e,t){const r=this.json.buffers[e],s=this._errorContext;if(null==r.uri)return s.assert(null!=this._glbBuffer,"GLB buffer not present"),this._glbBuffer;const n=await this._getBufferLoader(e,t);return s.assert(n.byteLength===r.byteLength,"Buffer byte lengths should match."),n}async _getBufferLoader(e,t){const r=this._bufferLoaders.get(e);if(r)return r;const s=this.json.buffers[e].uri,n=this._context.loadBinary(this._resolveUri(s),t).then((e=>new Uint8Array(e)));return this._bufferLoaders.set(e,n),n}async getAccessor(e,t){const r=this._errorContext;r.errorUnsupportedIf(!this.json.accessors,"Accessors missing.");const s=this.json.accessors[e];r.errorUnsupportedIf(null==s?.bufferView,"Some accessor does not specify a bufferView."),r.errorUnsupportedIf(s.type in[B.MAT2,B.MAT3,B.MAT4],`AttributeType ${s.type} is not supported`);const n=this.json.bufferViews[s.bufferView],o=await this.getBuffer(n.buffer,t),a=V[s.type],i=Y[s.componentType],u=a*i,c=n.byteStride||u;return{raw:o.buffer,byteStride:c,byteOffset:o.byteOffset+(n.byteOffset||0)+(s.byteOffset||0),entryCount:s.count,isDenselyPacked:c===u,componentCount:a,componentByteSize:i,componentType:s.componentType,min:s.min,max:s.max,normalized:!!s.normalized}}async getIndexData(e,t){if(null==e.indices)return;const r=await this.getAccessor(e.indices,t);if(r.isDenselyPacked)switch(r.componentType){case j.UNSIGNED_BYTE:return new Uint8Array(r.raw,r.byteOffset,r.entryCount);case j.UNSIGNED_SHORT:return new Uint16Array(r.raw,r.byteOffset,r.entryCount);case j.UNSIGNED_INT:return new Uint32Array(r.raw,r.byteOffset,r.entryCount)}else switch(r.componentType){case j.UNSIGNED_BYTE:return E(this._wrapAccessor(b,r));case j.UNSIGNED_SHORT:return E(this._wrapAccessor(T,r));case j.UNSIGNED_INT:return E(this._wrapAccessor(y,r))}}async getPositionData(e,t){const r=this._errorContext;r.errorUnsupportedIf(null==e.attributes.POSITION,"No POSITION vertex data found.");const s=await this.getAccessor(e.attributes.POSITION,t);return r.errorUnsupportedIf(s.componentType!==j.FLOAT,"Expected type FLOAT for POSITION vertex attribute, but found "+z[s.componentType]),r.errorUnsupportedIf(3!==s.componentCount,"POSITION vertex attribute must have 3 components, but found "+s.componentCount.toFixed()),this._wrapAccessor(_,s)}async getNormalData(e,t){const r=this._errorContext;r.assert(null!=e.attributes.NORMAL,"No NORMAL vertex data found.");const s=await this.getAccessor(e.attributes.NORMAL,t);return r.errorUnsupportedIf(s.componentType!==j.FLOAT,"Expected type FLOAT for NORMAL vertex attribute, but found "+z[s.componentType]),r.errorUnsupportedIf(3!==s.componentCount,"NORMAL vertex attribute must have 3 components, but found "+s.componentCount.toFixed()),this._wrapAccessor(_,s)}async getTangentData(e,t){const r=this._errorContext;r.assert(null!=e.attributes.TANGENT,"No TANGENT vertex data found.");const s=await this.getAccessor(e.attributes.TANGENT,t);return r.errorUnsupportedIf(s.componentType!==j.FLOAT,"Expected type FLOAT for TANGENT vertex attribute, but found "+z[s.componentType]),r.errorUnsupportedIf(4!==s.componentCount,"TANGENT vertex attribute must have 4 components, but found "+s.componentCount.toFixed()),new x(s.raw,s.byteOffset,s.byteStride,s.byteOffset+s.byteStride*s.entryCount)}async getTextureCoordinates(e,t){const r=this._errorContext;r.assert(null!=e.attributes.TEXCOORD_0,"No TEXCOORD_0 vertex data found.");const s=await this.getAccessor(e.attributes.TEXCOORD_0,t);return r.errorUnsupportedIf(2!==s.componentCount,"TEXCOORD_0 vertex attribute must have 2 components, but found "+s.componentCount.toFixed()),s.componentType===j.FLOAT?this._wrapAccessor(w,s):(r.errorUnsupportedIf(!s.normalized,"Integer component types are only supported for a normalized accessor for TEXCOORD_0."),J(s))}async getVertexColors(e,t){const r=this._errorContext;r.assert(null!=e.attributes.COLOR_0,"No COLOR_0 vertex data found.");const s=await this.getAccessor(e.attributes.COLOR_0,t);if(r.errorUnsupportedIf(4!==s.componentCount&&3!==s.componentCount,"COLOR_0 attribute must have 3 or 4 components, but found "+s.componentCount.toFixed()),4===s.componentCount){if(s.componentType===j.FLOAT)return this._wrapAccessor(x,s);if(s.componentType===j.UNSIGNED_BYTE)return this._wrapAccessor(O,s);if(s.componentType===j.UNSIGNED_SHORT)return this._wrapAccessor(N,s)}else if(3===s.componentCount){if(s.componentType===j.FLOAT)return this._wrapAccessor(_,s);if(s.componentType===j.UNSIGNED_BYTE)return this._wrapAccessor(S,s);if(s.componentType===j.UNSIGNED_SHORT)return this._wrapAccessor(g,s)}r.errorUnsupported("Unsupported component type for COLOR_0 attribute: "+z[s.componentType])}hasPositions(e){return void 0!==e.attributes.POSITION}hasNormals(e){return void 0!==e.attributes.NORMAL}hasVertexColors(e){return void 0!==e.attributes.COLOR_0}hasTextureCoordinates(e){return void 0!==e.attributes.TEXCOORD_0}hasTangents(e){return void 0!==e.attributes.TANGENT}async getMaterial(e,t,r){let s=e.material?this._materialCache.get(e.material):void 0;if(!s){const n=null!=e.material?v(this.json.materials[e.material]):v(),o=n.pbrMetallicRoughness,a=this.hasVertexColors(e),i=this.getTexture(o.baseColorTexture,t),u=this.getTexture(n.normalTexture,t),c=r?this.getTexture(n.occlusionTexture,t):void 0,f=r?this.getTexture(n.emissiveTexture,t):void 0,d=r?this.getTexture(o.metallicRoughnessTexture,t):void 0,p=null!=e.material?e.material:-1;s={alphaMode:n.alphaMode,alphaCutoff:n.alphaCutoff,color:o.baseColorFactor,doubleSided:!!n.doubleSided,colorTexture:await i,normalTexture:await u,name:n.name,id:p,occlusionTexture:await c,emissiveTexture:await f,emissiveFactor:n.emissiveFactor,metallicFactor:o.metallicFactor,roughnessFactor:o.roughnessFactor,metallicRoughnessTexture:await d,hasVertexColors:a,ESRI_externalColorMixMode:n.extras.ESRI_externalColorMixMode,colorTextureTransform:o?.baseColorTexture?.extensions?.KHR_texture_transform,normalTextureTransform:n.normalTexture?.extensions?.KHR_texture_transform,occlusionTextureTransform:n.occlusionTexture?.extensions?.KHR_texture_transform,emissiveTextureTransform:n.emissiveTexture?.extensions?.KHR_texture_transform,metallicRoughnessTextureTransform:o?.metallicRoughnessTexture?.extensions?.KHR_texture_transform}}return s}async getTexture(t,r){if(!t)return;this._errorContext.errorUnsupportedIf(0!==(t.texCoord||0),"Only TEXCOORD with index 0 is supported.");const s=t.index,n=this._errorContext,o=this.json.textures[s],a=D(null!=o.sampler?this.json.samplers[o.sampler]:{});n.errorUnsupportedIf(null==o.source,"Source is expected to be defined for a texture.");const i=this.json.images[o.source],u=await this._loadTextureImageData(s,o,r);return e(this._textureCache,s,(()=>{const e=e=>33071===e||33648===e||10497===e,t=e=>(n.error(`Unexpected TextureSampler WrapMode: ${e}. Using default REPEAT(10497).`),10497);return{data:u,wrapS:e(a.wrapS)?a.wrapS:t(a.wrapS),wrapT:e(a.wrapT)?a.wrapT:t(a.wrapT),minFilter:a.minFilter,name:i.name,id:s}}))}getNodeTransform(e){if(void 0===e)return H;let t=this._nodeTransformCache.get(e);if(!t){const r=this.getNodeTransform(this._getNodeParent(e)),s=this.json.nodes[e];s.matrix?t=u(p(),r,s.matrix):s.translation||s.rotation||s.scale?(t=m(r),s.translation&&c(t,t,s.translation),s.rotation&&(k[3]=l(k,s.rotation),f(t,t,k[3],k)),s.scale&&d(t,t,s.scale)):t=r,this._nodeTransformCache.set(e,t)}return t}_wrapAccessor(e,t){return new e(t.raw,t.byteOffset,t.byteStride,t.byteOffset+t.byteStride*(t.entryCount-1)+t.componentByteSize*t.componentCount)}_resolveUri(e){return o(e,this._baseUri)}_getNodeParent(e){return this._nodeParentMap.get(e)}_checkVersionSupported(){const e=a.parse(this.json.asset.version,"glTF");P.validate(e)}_checkRequiredExtensionsSupported(){const e=this.json,t=this._errorContext;e.extensionsRequired&&0!==e.extensionsRequired.length&&t.errorUnsupported("gltf loader was not able to load unsupported feature. Required extensions: "+e.extensionsRequired.join(", "))}_computeNodeParents(){this.json.nodes.forEach(((e,t)=>{e.children&&e.children.forEach((e=>{this._nodeParentMap.set(e,t)}))}))}async _loadTextureImageData(e,t,r){const s=this._textureLoaders.get(e);if(s)return s;const n=this._createTextureLoader(t,r);return this._textureLoaders.set(e,n),n}async _createTextureLoader(e,t){const r=this.json.images[e.source];if(r.uri)return this._context.loadImage(this._resolveUri(r.uri),t);const s=this._errorContext;s.errorUnsupportedIf(null==r.bufferView,"Image bufferView must be defined."),s.errorUnsupportedIf(null==r.mimeType,"Image mimeType must be defined.");const n=this.json.bufferViews[r.bufferView],o=await this.getBuffer(n.buffer,t);return s.errorUnsupportedIf(null!=n.byteStride,"byteStride not supported for image buffer"),q(new Uint8Array(o.buffer,o.byteOffset+(n.byteOffset||0),n.byteLength),r.mimeType)}async getLoadedBuffersSize(){if(this._glbBuffer)return this._glbBuffer.byteLength;const e=await t(Array.from(this._bufferLoaders.values())),r=await t(Array.from(this._textureLoaders.values()));return e.reduce(((e,t)=>e+(t?.byteLength??0)),0)+r.reduce(((e,t)=>e+(t?t.width*t.height*4:0)),0)}}const P=new a(2,0,"glTF"),H=i(p(),Math.PI/2),k=h(),V={SCALAR:1,VEC2:2,VEC3:3,VEC4:4},Y={[j.BYTE]:1,[j.UNSIGNED_BYTE]:1,[j.SHORT]:2,[j.UNSIGNED_SHORT]:2,[j.FLOAT]:4,[j.UNSIGNED_INT]:4};function J(e){switch(e.componentType){case j.BYTE:return new A(e.raw,e.byteOffset,e.byteStride,e.byteOffset+e.byteStride*e.entryCount);case j.UNSIGNED_BYTE:return new L(e.raw,e.byteOffset,e.byteStride,e.byteOffset+e.byteStride*e.entryCount);case j.SHORT:return new I(e.raw,e.byteOffset,e.byteStride,e.byteOffset+e.byteStride*e.entryCount);case j.UNSIGNED_SHORT:return new U(e.raw,e.byteOffset,e.byteStride,e.byteOffset+e.byteStride*e.entryCount);case j.UNSIGNED_INT:return new C(e.raw,e.byteOffset,e.byteStride,e.byteOffset+e.byteStride*e.entryCount);case j.FLOAT:return new w(e.raw,e.byteOffset,e.byteStride,e.byteOffset+e.byteStride*e.entryCount)}}async function K(e){return new Promise(((t,r)=>{const s=new Blob([e]),n=new FileReader;n.onload=()=>{const e=n.result;t(JSON.parse(e))},n.onerror=e=>{r(e)},n.readAsText(s)}))}async function q(e,t){return new Promise(((r,s)=>{const n=new Blob([e],{type:t}),o=URL.createObjectURL(n),a=new Image,i=()=>{URL.revokeObjectURL(o),"decode"in a?a.decode().then((()=>r(a)),(()=>r(a))).then(c):(r(a),c())},u=e=>{URL.revokeObjectURL(o),s(e),c()},c=()=>{a.removeEventListener("load",i),a.removeEventListener("error",u)};a.addEventListener("load",i),a.addEventListener("error",u),a.src=o}))}const z={5120:"BYTE",5121:"UNSIGNED_BYTE",5122:"SHORT",5123:"UNSIGNED_SHORT",5125:"UNSIGNED_INT",5126:"FLOAT"};export{F as Resource};
@@ -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"../../../geometry.js";import{neverReached as e}from"../../../core/compilerUtils.js";import t from"../../../core/Evented.js";import{deg2rad as i}from"../../../core/mathUtils.js";import{isSome as s,isNone as o,unwrapOr as n,unwrap as r}from"../../../core/maybe.js";import{createScreenPointArray as a,createRenderScreenPointArray3 as c,screenPointObjectToArray as l,castRenderScreenPointArray as h}from"../../../core/screenUtils.js";import{once as d}from"../../../core/accessorSupport/utils.js";import{f as _}from"../../../chunks/mat3.js";import{c as u}from"../../../chunks/mat3f64.js";import{c as g,s as m,m as f,i as p}from"../../../chunks/mat4.js";import{c as b}from"../../../chunks/mat4f64.js";import{k as v}from"../../../chunks/vec2.js";import{a as y,t as j,m as L,g as S,c as R,d as w,s as O,b as T}from"../../../chunks/vec3.js";import{c as A,Z as E}from"../../../chunks/vec3f64.js";import{canProjectWithoutEngine as D,projectPoint as F,sphericalPCPFtoLonLatElevation as k,computeENUToSphericalPCPFLocalRotation as z}from"../../../geometry/projection.js";import{getReferenceEllipsoid as I}from"../../../geometry/projectionEllipsoid.js";import{containsPointObject as P}from"../../../geometry/support/aaBoundingRect.js";import{create as M,distance2 as C,fromPoints as x,closestRayDistance2 as B}from"../../../geometry/support/lineSegment.js";import{create as W,fromPositionAndNormal as U,intersectRay as V}from"../../../geometry/support/plane.js";import{create as N}from"../../../geometry/support/ray.js";import{sv3d as G}from"../../../geometry/support/vectorStacks.js";import{clonePoint as H,hydratedSpatialReference as Y}from"../../../layers/graphics/hydratedFeatures.js";import{getElevationAtPoint as Z}from"../support/ElevationProvider.js";import{fromScreen as q}from"../support/geometryUtils/ray.js";import{UpdatePolicy as J}from"../webgl-engine/lib/basicInterfaces.js";import{Camera as K}from"../webgl-engine/lib/Camera.js";import{Object3D as Q}from"../webgl-engine/lib/Object3D.js";import{WebGLLayer as X}from"../webgl-engine/lib/WebGLLayer.js";import{ManipulatorStateCustomFlags as $,ManipulatorStateFlags as ee}from"../../interactive/interfaces.js";import te from"../../../geometry/Point.js";class ie{constructor(e){this._camera=new K,this._elevation={offset:0,override:null},this.collisionType={type:"point"},this.collisionPriority=0,this._renderObjects=[],this.autoScaleRenderObjects=!0,this._available=!0,this._noDisplayCount=0,this._radius=10,this._worldSized=!1,this.focusMultiplier=2,this.touchMultiplier=2.5,this.worldOriented=!1,this._modelTransform=b(),this._worldFrame=null,this._renderLocation=A(),this._renderLocationDirty=!0,this._location=new te({x:0,y:0,z:0}),this._elevationAlignedLocation=new te,this._elevationAlignedLocationDirty=!0,this.interactive=!0,this.selectable=!1,this.grabbable=!0,this.cursor=null,this._grabbing=!1,this.dragging=!1,this._hovering=!1,this._selected=!1,this._state=$.None,this._focused=!1,this.events=new t.EventEmitter,this._screenLocation={screenPointArray:a(),renderScreenPointArray:c(),pixelSize:0},this._screenLocationDirty=!0,this._applyObjectTransform=null,this._engineResourcesAddedToStage=!1,this._engineResources=null,this._attached=!1,this._engineLayer=null,this._materialIdReferences=null,this._location.spatialReference=e.view.spatialReference;for(const t in e)this[t]=e[t];this.view.state&&this.view.state.camera&&this._camera.copyFrom(this.view.state.camera)}destroy(){this._removeResourcesFromStage(),this._engineResources=null,this.view=null,this._camera=null}get elevationInfo(){return this._elevationInfo}set elevationInfo(e){this._elevationInfo=e,this._elevationAlignedLocationDirty=!0,this._renderLocationDirty=!0,this._updateEngineObject()}get renderObjects(){return this._renderObjects}set renderObjects(e){this._removeResourcesFromStage(),this._engineResources=null,this._renderObjects=e.slice(),this._updateEngineObject()}set available(e){e!==this._available&&(this._available=e,this._updateEngineObject())}get available(){return this._available}disableDisplay(){return this._noDisplayCount++,1===this._noDisplayCount&&this._updateEngineObject(),{remove:d((()=>{this._noDisplayCount--,0===this._noDisplayCount&&this._updateEngineObject()}))}}set radius(e){e!==this._radius&&(this._radius=e,this._updateEngineObject())}get radius(){return this._radius}set worldSized(e){e!==this._worldSized&&(this._worldSized=e,this._updateEngineObject())}get worldSized(){return this._worldSized}get modelTransform(){return this._modelTransform}set modelTransform(e){se(e)&&(this._screenLocationDirty=!0),g(this._modelTransform,e),this._updateEngineObject()}get renderLocation(){return this._renderLocationDirty&&(this._renderLocationDirty=!1,this.view.renderCoordsHelper.toRenderCoords(this.elevationAlignedLocation,this._renderLocation),this.worldOriented?(this._worldFrame||(this._worldFrame=b()),oe(this.view,this._renderLocation,this._worldFrame)):this._worldFrame&&(this._worldFrame=null)),this._renderLocation}set renderLocation(e){this.view.renderCoordsHelper.fromRenderCoords(e,this._location),this.elevationAlignedLocation=this._location}get location(){return this._location}set location(e){H(e,this._location),this._renderLocationDirty=!0,this._screenLocationDirty=!0,this._elevationAlignedLocationDirty=!0,this._updateEngineObject(),this.events.emit("location-update",{location:this._location})}get elevationAlignedLocation(){return this._elevationAlignedLocationDirty?(this._evaluateElevationAlignment(),this._updateElevationAlignedLocation(),this._elevationAlignedLocation):this._elevationAlignedLocation}set elevationAlignedLocation(e){H(e,this._location),this._evaluateElevationAlignment(),this._location.z-=this._elevation.offset,this._updateElevationAlignedLocation(),this._updateEngineObject(),this.events.emit("location-update",{location:this._location})}_updateElevationAlignedLocation(){this._elevationAlignedLocation.x=this.location.x,this._elevationAlignedLocation.y=this.location.y;const e=s(this._elevation.override)?this._elevation.override:this.location.z||0;this._elevationAlignedLocation.z=e+this._elevation.offset,this._elevationAlignedLocation.spatialReference=Y(this.location.spatialReference),this._renderLocationDirty=!0,this._screenLocationDirty=!0,this._elevationAlignedLocationDirty=!1}grabbableForEvent(){return!0}get grabbing(){return this._grabbing}set grabbing(e){e!==this._grabbing&&(this._grabbing=e,this._setFocused(this._hovering||this._grabbing),this._updateEngineObject())}get hovering(){return this._hovering}set hovering(e){e!==this._hovering&&(this._hovering=e,this._setFocused(this._hovering||this._grabbing),this._updateEngineObject())}get selected(){return this._selected}set selected(e){e!==this._selected&&(this._selected=e,this._updateEngineObject(),this.events.emit("select-changed",{action:e?"select":"deselect"}))}get state(){return this._state}set state(e){e!==this._state&&(this._state=e,this._updateEngineObject())}updateStateEnabled(e,t){t?this.state|=e:this.state&=~e}_setFocused(e){e!==this._focused&&(this._focused=e,this.events.emit("focus-changed",{action:!0===e?"focus":"unfocus"}))}get focused(){return this._focused}get screenLocation(){return this._ensureScreenLocation(),this._screenLocation}_ensureScreenLocation(){if(!this._screenLocationDirty)return;this._screenLocation.pixelSize=this._camera.computeScreenPixelSizeAt(this.renderLocation),this._screenLocationDirty=!1;let e;if(se(this._modelTransform)){const t=this._calculateModelTransformOffset(pe);e=y(t,t,this.renderLocation)}else e=this.renderLocation;this._camera.projectToRenderScreen(e,this._screenLocation.renderScreenPointArray),this._camera.renderToScreen(this._screenLocation.renderScreenPointArray,this._screenLocation.screenPointArray)}get applyObjectTransform(){return this._applyObjectTransform}set applyObjectTransform(e){this._applyObjectTransform=e,this._screenLocationDirty=!0,this._updateEngineObject()}get attached(){return this._attached}intersectionDistance(t,i){if(!this.available)return null;const s=l(t,ne),n=this._getCollisionRadius(i),r=-1*this.collisionPriority;switch(this.collisionType.type){case"point":if(v(this.screenLocation.screenPointArray,s)<n*n)return this.screenLocation.renderScreenPointArray[2]+r;break;case"line":{const e=this.collisionType.paths,t=this._getWorldToScreenObjectScale(),i=this._calculateObjectTransform(t,he),a=n*this.screenLocation.pixelSize,c=q(this._camera,s,ae);if(o(c))return null;for(const s of e){if(0===s.length)continue;const e=L(_e,s[0],i);for(let t=1;t<s.length;t++){const o=L(ue,s[t],i),n=B(x(e,o,re),c);if(null!=n&&n<a*a){const t=y(G.get(),e,o);S(t,t,.5);const i=h(G.get());return this._camera.projectToRenderScreen(t,i),i[2]+r}R(e,o)}}break}case"disc":{const e=this.collisionType.direction,t=this.collisionType.offset??E,i=this._getWorldToScreenObjectScale(),a=this._calculateObjectTransform(i,he),c=n*this.screenLocation.pixelSize,l=q(this._camera,s,ae);if(o(l))return null;const h=_(ce,a),d=j(me,e,h),u=L(fe,t,a);U(u,d,de);const g=ge;if(V(de,l,g)&&w(g,u)<c*c)return this.screenLocation.renderScreenPointArray[2]+r;break}case"ribbon":{const{paths:e,direction:t}=this.collisionType,i=this._getWorldToScreenObjectScale(),a=this._calculateObjectTransform(i,he),c=n*this._camera.computeScreenPixelSizeAt(this.renderLocation),l=q(this._camera,s,ae);if(o(l))return null;const d=_(ce,a),u=j(me,t,d),g=this._calculateModelTransformPosition(fe);U(g,u,de);const m=ge;if(!V(de,l,m))break;for(const s of e){if(0===s.length)continue;const e=L(_e,s[0],a);for(let t=1;t<s.length;t++){const i=L(ue,s[t],a),o=C(x(e,i,re),m);if(null!=o&&o<c*c){const t=y(G.get(),e,i);S(t,t,.5);const s=h(G.get());return this._camera.projectToRenderScreen(t,s),s[2]+r}R(e,i)}}break}default:e(this.collisionType)}return null}attach(e={manipulator3D:{}}){if(!this.view._stage)return;const t=e.manipulator3D;if(o(t.engineLayerId)){const e=new X({isPickable:!1,updatePolicy:J.SYNC});this.view._stage.add(e),t.engineLayerId=e.id,this._engineLayer=e}else this.view._stage?.getObject&&(this._engineLayer=this.view._stage.getObject(t.engineLayerId));t.engineLayerReferences=(t.engineLayerReferences||0)+1,this._materialIdReferences=t.materialIdReferences,o(this._materialIdReferences)&&(this._materialIdReferences=new Map,t.materialIdReferences=this._materialIdReferences),this._camera.copyFrom(this.view.state.camera),this._attached=!0,this._updateEngineObject(),D(this._location.spatialReference,this.view.spatialReference)||(this.location=new te({x:0,y:0,z:0,spatialReference:this.view.spatialReference}))}detach(e={manipulator3D:{}}){const t=e.manipulator3D;t.engineLayerReferences--;const i=0===t.engineLayerReferences;i&&(t.engineLayerId=null),this._removeResourcesFromStage(i),this._engineResources=null,this._engineLayer=null,this._materialIdReferences=null,this._attached=!1}onViewChange(){this._camera.copyFrom(this.view.state.camera),this._screenLocationDirty=!0,this._updateEngineObject()}onElevationChange(e){F(this.location,be,e.spatialReference),P(e.extent,be)&&(this.location=this._location)}_evaluateElevationAlignment(e=this.location){if(o(this.elevationInfo))return!1;let t=null,i=0;const s=n(this.elevationInfo.offset,0);switch(this.elevationInfo.mode){case"on-the-ground":t=n(Z(this.view.elevationProvider,e,"ground"),0);break;case"relative-to-ground":i=n(Z(this.view.elevationProvider,e,"ground"),0)+s;break;case"relative-to-scene":i=n(Z(this.view.elevationProvider,e,"scene"),0)+s;break;case"absolute-height":i=s}return(i!==this._elevation.offset||t!==this._elevation.override)&&(this._elevation.offset=i,this._elevation.override=t,!0)}_updateEngineObject(){if(!this._attached)return;if(!this.available)return void this._removeResourcesFromStage();const e=this._getWorldToScreenObjectScale(),t=he;if(!0===this.autoScaleRenderObjects){const i=this._getFocusedSize(this._radius,this.focused)*e;this._calculateObjectTransform(i,t)}else this._calculateObjectTransform(e,t);const{objectsByState:i}=this._ensureEngineResources(),s=(this.focused?ee.Focused:ee.Unfocused)|(this.selected?ee.Selected:ee.Unselected),o=this._noDisplayCount>0;for(const{stateMask:n,objects:r}of i){if(o){for(const e of r)e.setVisible(!1);continue}const e=(n&ee.All)!==ee.None,i=(n&$.All)!==$.None,a=!e||(s&n)==(n&ee.All),c=!i||(this.state&n)==(n&$.All);if(a&&c)for(const s of r)s.setVisible(!0),s.transformation=t;else for(const t of r)t.setVisible(!1)}}_ensureEngineResources(){if(o(this._engineResources)){const e=r(this._engineLayer),t=[],i=new Set;this.renderObjects.forEach((({material:e})=>{i.has(e)||(t.push(e),i.add(e))}));const s=(e,t)=>{const{geometry:i,material:s,transform:o}=t;Array.isArray(i)?i.forEach((t=>e.addGeometry(t,s,o))):e.addGeometry(i,s,o)},o=new Map;this._renderObjects.forEach((e=>{const t=new Q({castShadow:!1});s(t,e);const i=e.stateMask||0,n=o.get(i)||[];n.push(t),o.set(i,n)}));const n=[];o.forEach(((e,t)=>n.push({stateMask:t,objects:e}))),this._engineResources={objectsByState:n,layer:e,materials:t}}return this._addResourcesToStage(),this._engineResources}_addResourcesToStage(){if(this._engineResourcesAddedToStage||o(this._engineResources))return;const{objectsByState:e,layer:t,materials:i}=this._engineResources;i.forEach((e=>{const t=r(this._materialIdReferences),i=t.get(e.id)||0;0===i&&this.view._stage.add(e),t.set(e.id,i+1)})),e.forEach((({objects:e})=>{t.addMany(e),this.view._stage.addMany(e)})),this._engineResourcesAddedToStage=!0}_removeResourcesFromStage(e=!1){if(!this._engineResourcesAddedToStage||o(this._engineResources)||!this.view._stage)return;const{objectsByState:t,layer:i,materials:s}=this._engineResources;t.forEach((({objects:e})=>{i.removeMany(e),this.view._stage.removeMany(e)})),s.forEach((e=>{const t=r(this._materialIdReferences),i=t.get(e.id);1===i?(this.view._stage.remove(e),t.delete(e.id)):t.set(e.id,i-1)})),e&&this.view._stage.remove(i),this._engineResourcesAddedToStage=!1}_getCollisionRadius(e){return this._getFocusedSize(this.radius,!0)*("touch"===e?this.touchMultiplier:1)}_getFocusedSize(e,t){return e*(t?this.focusMultiplier:1)}_getWorldToScreenObjectScale(){return this._worldSized?1:this.screenLocation.pixelSize}_calculateModelTransformPosition(e){const t=this._getWorldToScreenObjectScale(),i=this._calculateObjectTransform(t,le);return O(e,i[12],i[13],i[14])}_calculateModelTransformOffset(e){const t=this._calculateModelTransformPosition(e);return T(e,t,this.renderLocation)}_calculateObjectTransform(e,t){return m(t,e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1),this._worldFrame&&f(t,t,this._worldFrame),f(t,t,this._modelTransform),t[12]+=this.renderLocation[0],t[13]+=this.renderLocation[1],t[14]+=this.renderLocation[2],t[15]=1,s(this._applyObjectTransform)&&this._applyObjectTransform(t),t}get test(){let e=!1;if(s(this._engineResources))for(const t in this._engineResources.objectsByState){const i=this._engineResources.objectsByState[t];for(const t of i.objects)if(t.isVisible){e=!0;break}if(e)break}return{areAnyResourcesVisible:e}}}function se(e){return 0!==e[12]||0!==e[13]||0!==e[14]}function oe(e,t,s){switch(e.viewingMode){case"local":return p(s),!0;case"global":{const o=I(e.renderCoordsHelper.spatialReference);return k(t,0,_e,0,o.radius),z(i(_e[0]),i(_e[1]),s),!0}}}const ne=a(),re=M(),ae=N(),ce=u(),le=b(),he=b(),de=W(),_e=A(),ue=A(),ge=A(),me=A(),fe=A(),pe=A(),be=new te({x:0,y:0,z:0,spatialReference:null});export{ie as Manipulator3D};
5
+ import"../../../geometry.js";import{neverReached as e}from"../../../core/compilerUtils.js";import t from"../../../core/Evented.js";import{deg2rad as i}from"../../../core/mathUtils.js";import{isSome as s,isNone as o,unwrapOr as n,unwrap as r}from"../../../core/maybe.js";import{createScreenPointArray as a,createRenderScreenPointArray3 as c,screenPointObjectToArray as l,castRenderScreenPointArray as h}from"../../../core/screenUtils.js";import{once as d}from"../../../core/accessorSupport/utils.js";import{f as _}from"../../../chunks/mat3.js";import{c as u}from"../../../chunks/mat3f64.js";import{c as g,s as m,m as f,i as p}from"../../../chunks/mat4.js";import{c as b}from"../../../chunks/mat4f64.js";import{k as v}from"../../../chunks/vec2.js";import{a as y,t as j,v as L,g as S,c as R,d as w,s as O,b as T}from"../../../chunks/vec3.js";import{c as A,Z as E}from"../../../chunks/vec3f64.js";import{canProjectWithoutEngine as D,projectPoint as F,sphericalPCPFtoLonLatElevation as k,computeENUToSphericalPCPFLocalRotation as z}from"../../../geometry/projection.js";import{getReferenceEllipsoid as I}from"../../../geometry/projectionEllipsoid.js";import{containsPointObject as P}from"../../../geometry/support/aaBoundingRect.js";import{create as M,distance2 as C,fromPoints as x,closestRayDistance2 as B}from"../../../geometry/support/lineSegment.js";import{create as W,fromPositionAndNormal as U,intersectRay as V}from"../../../geometry/support/plane.js";import{create as N}from"../../../geometry/support/ray.js";import{sv3d as G}from"../../../geometry/support/vectorStacks.js";import{clonePoint as H,hydratedSpatialReference as Y}from"../../../layers/graphics/hydratedFeatures.js";import{getElevationAtPoint as Z}from"../support/ElevationProvider.js";import{fromScreen as q}from"../support/geometryUtils/ray.js";import{UpdatePolicy as J}from"../webgl-engine/lib/basicInterfaces.js";import{Camera as K}from"../webgl-engine/lib/Camera.js";import{Object3D as Q}from"../webgl-engine/lib/Object3D.js";import{WebGLLayer as X}from"../webgl-engine/lib/WebGLLayer.js";import{ManipulatorStateCustomFlags as $,ManipulatorStateFlags as ee}from"../../interactive/interfaces.js";import te from"../../../geometry/Point.js";class ie{constructor(e){this._camera=new K,this._elevation={offset:0,override:null},this.collisionType={type:"point"},this.collisionPriority=0,this._renderObjects=[],this.autoScaleRenderObjects=!0,this._available=!0,this._noDisplayCount=0,this._radius=10,this._worldSized=!1,this.focusMultiplier=2,this.touchMultiplier=2.5,this.worldOriented=!1,this._modelTransform=b(),this._worldFrame=null,this._renderLocation=A(),this._renderLocationDirty=!0,this._location=new te({x:0,y:0,z:0}),this._elevationAlignedLocation=new te,this._elevationAlignedLocationDirty=!0,this.interactive=!0,this.selectable=!1,this.grabbable=!0,this.cursor=null,this._grabbing=!1,this.dragging=!1,this._hovering=!1,this._selected=!1,this._state=$.None,this._focused=!1,this.events=new t.EventEmitter,this._screenLocation={screenPointArray:a(),renderScreenPointArray:c(),pixelSize:0},this._screenLocationDirty=!0,this._applyObjectTransform=null,this._engineResourcesAddedToStage=!1,this._engineResources=null,this._attached=!1,this._engineLayer=null,this._materialIdReferences=null,this._location.spatialReference=e.view.spatialReference;for(const t in e)this[t]=e[t];this.view.state&&this.view.state.camera&&this._camera.copyFrom(this.view.state.camera)}destroy(){this._removeResourcesFromStage(),this._engineResources=null,this.view=null,this._camera=null}get elevationInfo(){return this._elevationInfo}set elevationInfo(e){this._elevationInfo=e,this._elevationAlignedLocationDirty=!0,this._renderLocationDirty=!0,this._updateEngineObject()}get renderObjects(){return this._renderObjects}set renderObjects(e){this._removeResourcesFromStage(),this._engineResources=null,this._renderObjects=e.slice(),this._updateEngineObject()}set available(e){e!==this._available&&(this._available=e,this._updateEngineObject())}get available(){return this._available}disableDisplay(){return this._noDisplayCount++,1===this._noDisplayCount&&this._updateEngineObject(),{remove:d((()=>{this._noDisplayCount--,0===this._noDisplayCount&&this._updateEngineObject()}))}}set radius(e){e!==this._radius&&(this._radius=e,this._updateEngineObject())}get radius(){return this._radius}set worldSized(e){e!==this._worldSized&&(this._worldSized=e,this._updateEngineObject())}get worldSized(){return this._worldSized}get modelTransform(){return this._modelTransform}set modelTransform(e){se(e)&&(this._screenLocationDirty=!0),g(this._modelTransform,e),this._updateEngineObject()}get renderLocation(){return this._renderLocationDirty&&(this._renderLocationDirty=!1,this.view.renderCoordsHelper.toRenderCoords(this.elevationAlignedLocation,this._renderLocation),this.worldOriented?(this._worldFrame||(this._worldFrame=b()),oe(this.view,this._renderLocation,this._worldFrame)):this._worldFrame&&(this._worldFrame=null)),this._renderLocation}set renderLocation(e){this.view.renderCoordsHelper.fromRenderCoords(e,this._location),this.elevationAlignedLocation=this._location}get location(){return this._location}set location(e){H(e,this._location),this._renderLocationDirty=!0,this._screenLocationDirty=!0,this._elevationAlignedLocationDirty=!0,this._updateEngineObject(),this.events.emit("location-update",{location:this._location})}get elevationAlignedLocation(){return this._elevationAlignedLocationDirty?(this._evaluateElevationAlignment(),this._updateElevationAlignedLocation(),this._elevationAlignedLocation):this._elevationAlignedLocation}set elevationAlignedLocation(e){H(e,this._location),this._evaluateElevationAlignment(),this._location.z-=this._elevation.offset,this._updateElevationAlignedLocation(),this._updateEngineObject(),this.events.emit("location-update",{location:this._location})}_updateElevationAlignedLocation(){this._elevationAlignedLocation.x=this.location.x,this._elevationAlignedLocation.y=this.location.y;const e=s(this._elevation.override)?this._elevation.override:this.location.z||0;this._elevationAlignedLocation.z=e+this._elevation.offset,this._elevationAlignedLocation.spatialReference=Y(this.location.spatialReference),this._renderLocationDirty=!0,this._screenLocationDirty=!0,this._elevationAlignedLocationDirty=!1}grabbableForEvent(){return!0}get grabbing(){return this._grabbing}set grabbing(e){e!==this._grabbing&&(this._grabbing=e,this._setFocused(this._hovering||this._grabbing),this._updateEngineObject())}get hovering(){return this._hovering}set hovering(e){e!==this._hovering&&(this._hovering=e,this._setFocused(this._hovering||this._grabbing),this._updateEngineObject())}get selected(){return this._selected}set selected(e){e!==this._selected&&(this._selected=e,this._updateEngineObject(),this.events.emit("select-changed",{action:e?"select":"deselect"}))}get state(){return this._state}set state(e){e!==this._state&&(this._state=e,this._updateEngineObject())}updateStateEnabled(e,t){t?this.state|=e:this.state&=~e}_setFocused(e){e!==this._focused&&(this._focused=e,this.events.emit("focus-changed",{action:!0===e?"focus":"unfocus"}))}get focused(){return this._focused}get screenLocation(){return this._ensureScreenLocation(),this._screenLocation}_ensureScreenLocation(){if(!this._screenLocationDirty)return;this._screenLocation.pixelSize=this._camera.computeScreenPixelSizeAt(this.renderLocation),this._screenLocationDirty=!1;let e;if(se(this._modelTransform)){const t=this._calculateModelTransformOffset(pe);e=y(t,t,this.renderLocation)}else e=this.renderLocation;this._camera.projectToRenderScreen(e,this._screenLocation.renderScreenPointArray),this._camera.renderToScreen(this._screenLocation.renderScreenPointArray,this._screenLocation.screenPointArray)}get applyObjectTransform(){return this._applyObjectTransform}set applyObjectTransform(e){this._applyObjectTransform=e,this._screenLocationDirty=!0,this._updateEngineObject()}get attached(){return this._attached}intersectionDistance(t,i){if(!this.available)return null;const s=l(t,ne),n=this._getCollisionRadius(i),r=-1*this.collisionPriority;switch(this.collisionType.type){case"point":if(v(this.screenLocation.screenPointArray,s)<n*n)return this.screenLocation.renderScreenPointArray[2]+r;break;case"line":{const e=this.collisionType.paths,t=this._getWorldToScreenObjectScale(),i=this._calculateObjectTransform(t,he),a=n*this.screenLocation.pixelSize,c=q(this._camera,s,ae);if(o(c))return null;for(const s of e){if(0===s.length)continue;const e=L(_e,s[0],i);for(let t=1;t<s.length;t++){const o=L(ue,s[t],i),n=B(x(e,o,re),c);if(null!=n&&n<a*a){const t=y(G.get(),e,o);S(t,t,.5);const i=h(G.get());return this._camera.projectToRenderScreen(t,i),i[2]+r}R(e,o)}}break}case"disc":{const e=this.collisionType.direction,t=this.collisionType.offset??E,i=this._getWorldToScreenObjectScale(),a=this._calculateObjectTransform(i,he),c=n*this.screenLocation.pixelSize,l=q(this._camera,s,ae);if(o(l))return null;const h=_(ce,a),d=j(me,e,h),u=L(fe,t,a);U(u,d,de);const g=ge;if(V(de,l,g)&&w(g,u)<c*c)return this.screenLocation.renderScreenPointArray[2]+r;break}case"ribbon":{const{paths:e,direction:t}=this.collisionType,i=this._getWorldToScreenObjectScale(),a=this._calculateObjectTransform(i,he),c=n*this._camera.computeScreenPixelSizeAt(this.renderLocation),l=q(this._camera,s,ae);if(o(l))return null;const d=_(ce,a),u=j(me,t,d),g=this._calculateModelTransformPosition(fe);U(g,u,de);const m=ge;if(!V(de,l,m))break;for(const s of e){if(0===s.length)continue;const e=L(_e,s[0],a);for(let t=1;t<s.length;t++){const i=L(ue,s[t],a),o=C(x(e,i,re),m);if(null!=o&&o<c*c){const t=y(G.get(),e,i);S(t,t,.5);const s=h(G.get());return this._camera.projectToRenderScreen(t,s),s[2]+r}R(e,i)}}break}default:e(this.collisionType)}return null}attach(e={manipulator3D:{}}){if(!this.view._stage)return;const t=e.manipulator3D;if(o(t.engineLayerId)){const e=new X({isPickable:!1,updatePolicy:J.SYNC});this.view._stage.add(e),t.engineLayerId=e.id,this._engineLayer=e}else this.view._stage?.getObject&&(this._engineLayer=this.view._stage.getObject(t.engineLayerId));t.engineLayerReferences=(t.engineLayerReferences||0)+1,this._materialIdReferences=t.materialIdReferences,o(this._materialIdReferences)&&(this._materialIdReferences=new Map,t.materialIdReferences=this._materialIdReferences),this._camera.copyFrom(this.view.state.camera),this._attached=!0,this._updateEngineObject(),D(this._location.spatialReference,this.view.spatialReference)||(this.location=new te({x:0,y:0,z:0,spatialReference:this.view.spatialReference}))}detach(e={manipulator3D:{}}){const t=e.manipulator3D;t.engineLayerReferences--;const i=0===t.engineLayerReferences;i&&(t.engineLayerId=null),this._removeResourcesFromStage(i),this._engineResources=null,this._engineLayer=null,this._materialIdReferences=null,this._attached=!1}onViewChange(){this._camera.copyFrom(this.view.state.camera),this._screenLocationDirty=!0,this._updateEngineObject()}onElevationChange(e){F(this.location,be,e.spatialReference),P(e.extent,be)&&(this.location=this._location)}_evaluateElevationAlignment(e=this.location){if(o(this.elevationInfo))return!1;let t=null,i=0;const s=n(this.elevationInfo.offset,0);switch(this.elevationInfo.mode){case"on-the-ground":t=n(Z(this.view.elevationProvider,e,"ground"),0);break;case"relative-to-ground":i=n(Z(this.view.elevationProvider,e,"ground"),0)+s;break;case"relative-to-scene":i=n(Z(this.view.elevationProvider,e,"scene"),0)+s;break;case"absolute-height":i=s}return(i!==this._elevation.offset||t!==this._elevation.override)&&(this._elevation.offset=i,this._elevation.override=t,!0)}_updateEngineObject(){if(!this._attached)return;if(!this.available)return void this._removeResourcesFromStage();const e=this._getWorldToScreenObjectScale(),t=he;if(!0===this.autoScaleRenderObjects){const i=this._getFocusedSize(this._radius,this.focused)*e;this._calculateObjectTransform(i,t)}else this._calculateObjectTransform(e,t);const{objectsByState:i}=this._ensureEngineResources(),s=(this.focused?ee.Focused:ee.Unfocused)|(this.selected?ee.Selected:ee.Unselected),o=this._noDisplayCount>0;for(const{stateMask:n,objects:r}of i){if(o){for(const e of r)e.setVisible(!1);continue}const e=(n&ee.All)!==ee.None,i=(n&$.All)!==$.None,a=!e||(s&n)==(n&ee.All),c=!i||(this.state&n)==(n&$.All);if(a&&c)for(const s of r)s.setVisible(!0),s.transformation=t;else for(const t of r)t.setVisible(!1)}}_ensureEngineResources(){if(o(this._engineResources)){const e=r(this._engineLayer),t=[],i=new Set;this.renderObjects.forEach((({material:e})=>{i.has(e)||(t.push(e),i.add(e))}));const s=(e,t)=>{const{geometry:i,material:s,transform:o}=t;Array.isArray(i)?i.forEach((t=>e.addGeometry(t,s,o))):e.addGeometry(i,s,o)},o=new Map;this._renderObjects.forEach((e=>{const t=new Q({castShadow:!1});s(t,e);const i=e.stateMask||0,n=o.get(i)||[];n.push(t),o.set(i,n)}));const n=[];o.forEach(((e,t)=>n.push({stateMask:t,objects:e}))),this._engineResources={objectsByState:n,layer:e,materials:t}}return this._addResourcesToStage(),this._engineResources}_addResourcesToStage(){if(this._engineResourcesAddedToStage||o(this._engineResources))return;const{objectsByState:e,layer:t,materials:i}=this._engineResources;i.forEach((e=>{const t=r(this._materialIdReferences),i=t.get(e.id)||0;0===i&&this.view._stage.add(e),t.set(e.id,i+1)})),e.forEach((({objects:e})=>{t.addMany(e),this.view._stage.addMany(e)})),this._engineResourcesAddedToStage=!0}_removeResourcesFromStage(e=!1){if(!this._engineResourcesAddedToStage||o(this._engineResources)||!this.view._stage)return;const{objectsByState:t,layer:i,materials:s}=this._engineResources;t.forEach((({objects:e})=>{i.removeMany(e),this.view._stage.removeMany(e)})),s.forEach((e=>{const t=r(this._materialIdReferences),i=t.get(e.id);1===i?(this.view._stage.remove(e),t.delete(e.id)):t.set(e.id,i-1)})),e&&this.view._stage.remove(i),this._engineResourcesAddedToStage=!1}_getCollisionRadius(e){return this._getFocusedSize(this.radius,!0)*("touch"===e?this.touchMultiplier:1)}_getFocusedSize(e,t){return e*(t?this.focusMultiplier:1)}_getWorldToScreenObjectScale(){return this._worldSized?1:this.screenLocation.pixelSize}_calculateModelTransformPosition(e){const t=this._getWorldToScreenObjectScale(),i=this._calculateObjectTransform(t,le);return O(e,i[12],i[13],i[14])}_calculateModelTransformOffset(e){const t=this._calculateModelTransformPosition(e);return T(e,t,this.renderLocation)}_calculateObjectTransform(e,t){return m(t,e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1),this._worldFrame&&f(t,t,this._worldFrame),f(t,t,this._modelTransform),t[12]+=this.renderLocation[0],t[13]+=this.renderLocation[1],t[14]+=this.renderLocation[2],t[15]=1,s(this._applyObjectTransform)&&this._applyObjectTransform(t),t}get test(){let e=!1;if(s(this._engineResources))for(const t in this._engineResources.objectsByState){const i=this._engineResources.objectsByState[t];for(const t of i.objects)if(t.isVisible){e=!0;break}if(e)break}return{areAnyResourcesVisible:e}}}function se(e){return 0!==e[12]||0!==e[13]||0!==e[14]}function oe(e,t,s){switch(e.viewingMode){case"local":return p(s),!0;case"global":{const o=I(e.renderCoordsHelper.spatialReference);return k(t,0,_e,0,o.radius),z(i(_e[0]),i(_e[1]),s),!0}}}const ne=a(),re=M(),ae=N(),ce=u(),le=b(),he=b(),de=W(),_e=A(),ue=A(),ge=A(),me=A(),fe=A(),pe=A(),be=new te({x:0,y:0,z:0,spatialReference:null});export{ie as Manipulator3D};
@@ -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 r}from"../../../../../core/maybe.js";import{createRenderScreenPointArray3 as o}from"../../../../../core/screenUtils.js";import{f as n}from"../../../../../chunks/mat4f64.js";import{f as t,r as s,p as c,b as i}from"../../../../../chunks/vec3.js";import{c as d}from"../../../../../chunks/vec3f64.js";import{normal as f,fromPositionAndNormal as p,create as m}from"../../../../../geometry/support/plane.js";import{makeDehydratedPoint as u}from"../../../../../layers/graphics/dehydratedFeatures.js";import{PlaneType as a,OffsetEdgeVertex as l}from"../../../../interactive/editGeometry/operations/OffsetEdgeVertex.js";function j(e,r,o){const n="on-the-ground"===o.mode?a.XY:a.XYZ;return new l(e,n,r,0)}function h(r,o,n){const s=d();if(!r.renderCoordsHelper.toRenderCoords(o,s))return null;const c=y(r,o,f(n.plane)),i=y(r,o,n.edgeDirection);if(e(c)||e(i))return null;const u=t(d(),c,i);return p(s,u,m())}function y(e,r,o){const n=u(r.x+o[0],r.y+o[1],r.z+o[2],r.spatialReference),t=d(),c=d();return e.renderCoordsHelper.toRenderCoords(r,t)&&e.renderCoordsHelper.toRenderCoords(n,c)?s(c,t,c):null}function C(e,r,o){const c=f(e),i=s(d(),r,o),p=t(d(),i,c),m=t(d(),i,p);return n(i[0],i[1],i[2],0,p[0],p[1],p[2],0,m[0],m[1],m[2],0,0,0,0,1)}function R(e,n,t){const s=t.projectToRenderScreen(e,o()),d=t.projectToRenderScreen(n,o());return r(s)&&r(d)?c(i(s,s,d)):0}export{h as createEdgeOffsetIntersectionPlane,j as createEdgeOffsetOperation,C as edgeOffsetRotationMatrix,R as screenEdgeLengthSquared};
5
+ import{isNone as e,isSome as r}from"../../../../../core/maybe.js";import{createRenderScreenPointArray3 as o}from"../../../../../core/screenUtils.js";import{f as n}from"../../../../../chunks/mat4f64.js";import{f as t,A as s,z as c,b as i}from"../../../../../chunks/vec3.js";import{c as d}from"../../../../../chunks/vec3f64.js";import{normal as f,fromPositionAndNormal as m,create as p}from"../../../../../geometry/support/plane.js";import{makeDehydratedPoint as u}from"../../../../../layers/graphics/dehydratedFeatures.js";import{PlaneType as a,OffsetEdgeVertex as l}from"../../../../interactive/editGeometry/operations/OffsetEdgeVertex.js";function j(e,r,o){const n="on-the-ground"===o.mode?a.XY:a.XYZ;return new l(e,n,r,0)}function h(r,o,n){const s=d();if(!r.renderCoordsHelper.toRenderCoords(o,s))return null;const c=y(r,o,f(n.plane)),i=y(r,o,n.edgeDirection);if(e(c)||e(i))return null;const u=t(d(),c,i);return m(s,u,p())}function y(e,r,o){const n=u(r.x+o[0],r.y+o[1],r.z+o[2],r.spatialReference),t=d(),c=d();return e.renderCoordsHelper.toRenderCoords(r,t)&&e.renderCoordsHelper.toRenderCoords(n,c)?s(c,t,c):null}function C(e,r,o){const c=f(e),i=s(d(),r,o),m=t(d(),i,c),p=t(d(),i,m);return n(i[0],i[1],i[2],0,m[0],m[1],m[2],0,p[0],p[1],p[2],0,0,0,0,1)}function R(e,n,t){const s=t.projectToRenderScreen(e,o()),d=t.projectToRenderScreen(n,o());return r(s)&&r(d)?c(i(s,s,d)):0}export{h as createEdgeOffsetIntersectionPlane,j as createEdgeOffsetOperation,C as edgeOffsetRotationMatrix,R as screenEdgeLengthSquared};
@@ -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 t from"../../../../Color.js";import{toHSV as e,toRGB as i}from"../../../../core/colorUtils.js";import{b as l}from"../../../../chunks/vec4f64.js";import{ExtensionType as o}from"../visualElements/ExtendedLineVisualElement.js";import{RenderOccludedFlag as s}from"../../webgl-engine/lib/Material.js";import{createStipplePatternSimple as n}from"../../webgl-engine/materials/lineStippleUtils.js";const r={main:new t([255,127,0]),selected:new t([255,255,255]),staged:new t([12,207,255]),outline:new t([0,0,0,.5]),selectedOutline:new t([255,255,255])},h=.3;function c(t,e){const i=t.clone();return i.a*=e,i}function a(t,l){const o=t.clone(),s=e(o);s.s*=l;const n=i(s);return o.r=n.r,o.g=n.g,o.b=n.b,o}function d(t,e){if(e)for(const i in e)t[i]=e[i]}class u{constructor(t){this.color=r.main,this.height=90,this.coneHeight=40,this.coneWidth=23,this.width=3,this.renderOccluded=s.Opaque,d(this,t)}}class p{constructor(t){this.size=11,this.outlineSize=1,this.collisionPadding=9,this.color=r.main,this.outlineColor=r.outline,this.renderOccluded=s.Opaque,this.hoverOutlineColor=r.selectedOutline,d(this,t)}apply(t,e){const i=this[t];e.setParameters({color:P(i),transparent:"color"!==t||i.a<1,renderOccluded:this.renderOccluded})}}class g{constructor(t){this.size=40,this.height=.2,this.offset=.25,this.collisionPadding=2,this.color=c(r.main,.5),this.hoverColor=r.main,this.renderOccluded=s.Transparent,this.minSquaredEdgeLength=900,d(this,t)}apply(t,e){const i=this[t];e.setParameters({color:P(i),transparent:i.a<1,renderOccluded:this.renderOccluded})}}class f{constructor(t){this.vertex=new p({color:r.main,outlineColor:r.outline}),this.edge=new p({color:a(c(r.main,2/3),.5),outlineColor:c(r.outline,.5),size:8,collisionPadding:8}),this.selected=new p({color:r.selected,outlineColor:r.outline}),this.edgeOffset=new g,d(this,t)}}class w{constructor(t){this.color=r.selected,this.width=1.5,this.stipplePattern=n(5),this.stippleOffColor=r.outline,this.falloff=0,this.innerWidth=1.5,this.innerColor=r.selected,this.renderOccluded=s.OccludeAndTransparent,d(this,t)}apply(t){t.color=P(this.color),t.width=this.width,t.stipplePattern=this.stipplePattern,t.stippleOffColor=P(this.stippleOffColor),t.falloff=this.falloff,t.innerWidth=this.innerWidth,t.innerColor=P(this.innerColor),t.renderOccluded=this.renderOccluded}}class C{constructor(t){this.color=r.selected,this.size=4,this.outlineSize=1,this.outlineColor=r.outline,this.shape="square",d(this,t)}apply(t){t.color=P(this.color),t.size=this.size,t.outlineSize=this.outlineSize,t.outlineColor=P(this.outlineColor),t.primitive=this.shape}}class m{constructor(t){this.innerColor=r.selected,this.innerWidth=1,this.glowColor=r.main,this.glowWidth=8,this.glowFalloff=8,this.globalAlpha=h,this.globalAlphaContrastBoost=1.5,this.radius=3,this.heightFillColor=r.main,d(this,t)}apply(e,i=1){const l={glowColor:t.toUnitRGB(this.glowColor),glowFalloff:this.glowFalloff,glowWidth:this.glowWidth,innerColor:t.toUnitRGB(this.innerColor),innerWidth:this.innerWidth,globalAlpha:this.globalAlpha*i,globalAlphaContrastBoost:this.globalAlphaContrastBoost,intersectsLineRadius:this.radius};"style"in e?e.style=l:e.laserlineStyle=l}}class O{constructor(t){this.outline=new w({color:r.outline,renderOccluded:s.OccludeAndTransparentStencil,stippleOffColor:r.selected,stipplePattern:n(5),width:1.5,innerWidth:0}),this.staged=new w({color:r.selected,renderOccluded:s.OccludeAndTransparentStencil,innerColor:r.staged,stippleOffColor:r.outline,stipplePattern:n(5),width:1.5}),this.shadowStyle=new m({globalAlpha:h,glowColor:r.main,glowFalloff:8,glowWidth:8,innerColor:r.selected,innerWidth:1}),d(this,t)}}class A{constructor(t){this.outline=new C({color:r.selected,outlineColor:r.outline,outlineSize:1,shape:"circle",size:4}),this.shadowStyle=new m({globalAlpha:h,glowColor:r.main,glowFalloff:1.5,glowWidth:6,innerColor:r.selected,innerWidth:1,radius:2}),d(this,t)}}class W extends w{constructor(t){super(),this.extensionType=o.GROUND_RAY,d(this,t)}}class b{constructor(t){this.lineGraphics=new O,this.pointGraphics=new A,this.heightPlane=new m({globalAlpha:h,glowColor:r.main,glowFalloff:8,glowWidth:8,innerColor:r.selected,innerWidth:1}),this.heightBox=new m({globalAlpha:h,glowColor:r.main,glowFalloff:8,glowWidth:8,innerColor:r.selected,innerWidth:0,heightFillColor:r.main}),this.zVerticalLine=new W({color:c(r.main,5*h/3),falloff:2,innerColor:c(r.selected,0),renderOccluded:s.OccludeAndTransparent,stipplePattern:null,width:5,extensionType:o.GROUND_RAY}),this.laserlineAlphaMultiplier=1.5,this.heightPlaneAngleCutoff=20,d(this,t)}}class z{constructor(t){this.visualElements=new b,this.reshapeManipulators=new f,this.zManipulator=new u,d(this,t)}colorToVec4(t){return P(t)}}function P(e){return l(t.toUnitRGBA(e))}const y=new z;export{p as VertexManipulatorStyle,r as colors,y as settings};
5
+ import t from"../../../../Color.js";import{toHSV as e,toRGB as i}from"../../../../core/colorUtils.js";import{a as l}from"../../../../chunks/vec4f64.js";import{ExtensionType as o}from"../visualElements/ExtendedLineVisualElement.js";import{RenderOccludedFlag as s}from"../../webgl-engine/lib/Material.js";import{createStipplePatternSimple as n}from"../../webgl-engine/materials/lineStippleUtils.js";const r={main:new t([255,127,0]),selected:new t([255,255,255]),staged:new t([12,207,255]),outline:new t([0,0,0,.5]),selectedOutline:new t([255,255,255])},h=.3;function c(t,e){const i=t.clone();return i.a*=e,i}function a(t,l){const o=t.clone(),s=e(o);s.s*=l;const n=i(s);return o.r=n.r,o.g=n.g,o.b=n.b,o}function d(t,e){if(e)for(const i in e)t[i]=e[i]}class u{constructor(t){this.color=r.main,this.height=90,this.coneHeight=40,this.coneWidth=23,this.width=3,this.renderOccluded=s.Opaque,d(this,t)}}class p{constructor(t){this.size=11,this.outlineSize=1,this.collisionPadding=9,this.color=r.main,this.outlineColor=r.outline,this.renderOccluded=s.Opaque,this.hoverOutlineColor=r.selectedOutline,d(this,t)}apply(t,e){const i=this[t];e.setParameters({color:P(i),transparent:"color"!==t||i.a<1,renderOccluded:this.renderOccluded})}}class g{constructor(t){this.size=40,this.height=.2,this.offset=.25,this.collisionPadding=2,this.color=c(r.main,.5),this.hoverColor=r.main,this.renderOccluded=s.Transparent,this.minSquaredEdgeLength=900,d(this,t)}apply(t,e){const i=this[t];e.setParameters({color:P(i),transparent:i.a<1,renderOccluded:this.renderOccluded})}}class f{constructor(t){this.vertex=new p({color:r.main,outlineColor:r.outline}),this.edge=new p({color:a(c(r.main,2/3),.5),outlineColor:c(r.outline,.5),size:8,collisionPadding:8}),this.selected=new p({color:r.selected,outlineColor:r.outline}),this.edgeOffset=new g,d(this,t)}}class w{constructor(t){this.color=r.selected,this.width=1.5,this.stipplePattern=n(5),this.stippleOffColor=r.outline,this.falloff=0,this.innerWidth=1.5,this.innerColor=r.selected,this.renderOccluded=s.OccludeAndTransparent,d(this,t)}apply(t){t.color=P(this.color),t.width=this.width,t.stipplePattern=this.stipplePattern,t.stippleOffColor=P(this.stippleOffColor),t.falloff=this.falloff,t.innerWidth=this.innerWidth,t.innerColor=P(this.innerColor),t.renderOccluded=this.renderOccluded}}class C{constructor(t){this.color=r.selected,this.size=4,this.outlineSize=1,this.outlineColor=r.outline,this.shape="square",d(this,t)}apply(t){t.color=P(this.color),t.size=this.size,t.outlineSize=this.outlineSize,t.outlineColor=P(this.outlineColor),t.primitive=this.shape}}class m{constructor(t){this.innerColor=r.selected,this.innerWidth=1,this.glowColor=r.main,this.glowWidth=8,this.glowFalloff=8,this.globalAlpha=h,this.globalAlphaContrastBoost=1.5,this.radius=3,this.heightFillColor=r.main,d(this,t)}apply(e,i=1){const l={glowColor:t.toUnitRGB(this.glowColor),glowFalloff:this.glowFalloff,glowWidth:this.glowWidth,innerColor:t.toUnitRGB(this.innerColor),innerWidth:this.innerWidth,globalAlpha:this.globalAlpha*i,globalAlphaContrastBoost:this.globalAlphaContrastBoost,intersectsLineRadius:this.radius};"style"in e?e.style=l:e.laserlineStyle=l}}class O{constructor(t){this.outline=new w({color:r.outline,renderOccluded:s.OccludeAndTransparentStencil,stippleOffColor:r.selected,stipplePattern:n(5),width:1.5,innerWidth:0}),this.staged=new w({color:r.selected,renderOccluded:s.OccludeAndTransparentStencil,innerColor:r.staged,stippleOffColor:r.outline,stipplePattern:n(5),width:1.5}),this.shadowStyle=new m({globalAlpha:h,glowColor:r.main,glowFalloff:8,glowWidth:8,innerColor:r.selected,innerWidth:1}),d(this,t)}}class A{constructor(t){this.outline=new C({color:r.selected,outlineColor:r.outline,outlineSize:1,shape:"circle",size:4}),this.shadowStyle=new m({globalAlpha:h,glowColor:r.main,glowFalloff:1.5,glowWidth:6,innerColor:r.selected,innerWidth:1,radius:2}),d(this,t)}}class W extends w{constructor(t){super(),this.extensionType=o.GROUND_RAY,d(this,t)}}class b{constructor(t){this.lineGraphics=new O,this.pointGraphics=new A,this.heightPlane=new m({globalAlpha:h,glowColor:r.main,glowFalloff:8,glowWidth:8,innerColor:r.selected,innerWidth:1}),this.heightBox=new m({globalAlpha:h,glowColor:r.main,glowFalloff:8,glowWidth:8,innerColor:r.selected,innerWidth:0,heightFillColor:r.main}),this.zVerticalLine=new W({color:c(r.main,5*h/3),falloff:2,innerColor:c(r.selected,0),renderOccluded:s.OccludeAndTransparent,stipplePattern:null,width:5,extensionType:o.GROUND_RAY}),this.laserlineAlphaMultiplier=1.5,this.heightPlaneAngleCutoff=20,d(this,t)}}class z{constructor(t){this.visualElements=new b,this.reshapeManipulators=new f,this.zManipulator=new u,d(this,t)}colorToVec4(t){return P(t)}}function P(e){return l(t.toUnitRGBA(e))}const y=new z;export{p as VertexManipulatorStyle,r as colors,y as settings};