@arcgis/core 4.33.0-next.20250521 → 4.33.0-next.20250523

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 (520) hide show
  1. package/Map.js +1 -1
  2. package/WebScene.js +1 -1
  3. package/analysis/DimensionAnalysis.js +1 -1
  4. package/analysis/LineOfSightAnalysis.js +1 -1
  5. package/analysis/ViewshedAnalysis.js +1 -1
  6. package/applications/Components/analysisUtils.d.ts +2 -0
  7. package/applications/Components/analysisUtils.js +1 -1
  8. package/arcade/Voxel.js +1 -1
  9. package/arcade/featureset/actions/GroupBy.js +1 -1
  10. package/arcade/featureset/sources/FeatureLayerDynamic.js +1 -1
  11. package/arcade/functions/knowledgegraph.js +1 -1
  12. package/assets/esri/core/workers/RemoteClient.js +1 -1
  13. package/assets/esri/core/workers/chunks/{253bcc3cc7bc4c2dc6ea.js → 03db109e9b695528c35d.js} +1 -1
  14. package/assets/esri/core/workers/chunks/{f74f8ed3f17713a208c3.js → 07e58dff44fcbb3b3539.js} +1 -1
  15. package/assets/esri/core/workers/chunks/09da6b3085fc84cd69d5.js +1 -0
  16. package/assets/esri/core/workers/chunks/09f76ca9b47b465c934f.js +1 -0
  17. package/assets/esri/core/workers/chunks/0a770f283eb77c8dc97a.js +1 -0
  18. package/assets/esri/core/workers/chunks/0b70b2ee62904318a12c.js +1 -0
  19. package/assets/esri/core/workers/chunks/0dcab04dd1feeb5521cf.js +1 -0
  20. package/assets/esri/core/workers/chunks/{8a2cee726b7843c7408a.js → 0fb5de3f8a4d69b2d514.js} +1 -1
  21. package/assets/esri/core/workers/chunks/0fd826e7f64a37aaaa1e.js +1 -0
  22. package/assets/esri/core/workers/chunks/28b1819bf744ce957dfd.js +2 -0
  23. package/assets/esri/core/workers/chunks/28b1819bf744ce957dfd.js.LICENSE.txt +33 -0
  24. package/assets/esri/core/workers/chunks/{7c819b3e6d69c526f4b2.js → 28e31ac00dc95a1318e9.js} +1 -1
  25. package/assets/esri/core/workers/chunks/{234117cc5cb7c6863313.js → 2d90806faa4269828948.js} +1 -1
  26. package/assets/esri/core/workers/chunks/{b53a7040a71b0f1f3854.js → 330f1996cfc3e9c952cc.js} +1 -1
  27. package/assets/esri/core/workers/chunks/{0d23610475c85385fbff.js → 355e6bcdb401ada71f39.js} +1 -1
  28. package/assets/esri/core/workers/chunks/{bba6d7615d8f3862fe70.js → 36f0046ff6b46adce7b7.js} +1 -1
  29. package/assets/esri/core/workers/chunks/397b15d46f22718c9f38.js +1 -0
  30. package/assets/esri/core/workers/chunks/{b0522dffa5600345c07e.js → 3e85e63148b5e93d3074.js} +1 -1
  31. package/assets/esri/core/workers/chunks/40f54c4f8ae63c6f3df9.js +1 -0
  32. package/assets/esri/core/workers/chunks/4193c52799aa3b6337c9.js +2 -0
  33. package/assets/esri/core/workers/chunks/{9588328d4ed6b0f04166.js.LICENSE.txt → 4193c52799aa3b6337c9.js.LICENSE.txt} +0 -34
  34. package/assets/esri/core/workers/chunks/{14b3c18581b31c93af82.js → 41cbba9b286cf5558a9c.js} +1 -1
  35. package/assets/esri/core/workers/chunks/42bb9bb6fe44a47d9b81.js +1 -0
  36. package/assets/esri/core/workers/chunks/4dd0a5f327fa5fc7249d.js +1 -0
  37. package/assets/esri/core/workers/chunks/{e2cada6644c49b1b6e79.js → 51ba7345c31e6eb79060.js} +1 -1
  38. package/assets/esri/core/workers/chunks/{8a6aac37b3133de74cce.js → 51c31e6d014005107d42.js} +1 -1
  39. package/assets/esri/core/workers/chunks/{66e79aa02b3aa12b3778.js → 5200be8bce60fa831026.js} +1 -1
  40. package/assets/esri/core/workers/chunks/{6b23ca6570357f9fb724.js → 52a57106a41b8c9483d7.js} +1 -1
  41. package/assets/esri/core/workers/chunks/{585c7b485c42555ec554.js → 61f9747c960d959b571b.js} +2 -2
  42. package/assets/esri/core/workers/chunks/{9fc35ec8185beba96715.js → 632d1a1287dde980479e.js} +1 -1
  43. package/assets/esri/core/workers/chunks/{5c8d52b72a3bea4202ac.js → 634a418310e44e2436e0.js} +1 -1
  44. package/assets/esri/core/workers/chunks/{1d043965dcdc11b3aeaa.js → 63852887b3f07d50f7c9.js} +1 -1
  45. package/assets/esri/core/workers/chunks/{c16e0da7a19310c71e8b.js → 677af0281e4fc9f3bd98.js} +1 -1
  46. package/assets/esri/core/workers/chunks/{6ecc3a3737ae8622dfa4.js → 7b12607633bbdc318936.js} +1 -1
  47. package/assets/esri/core/workers/chunks/{83fcc6f770ad084b8ab9.js → 86023cc5ccbc7ac43479.js} +1 -1
  48. package/assets/esri/core/workers/chunks/{d839a237d5edc243d645.js → 8aa8f9986b966ccb64e2.js} +1 -1
  49. package/assets/esri/core/workers/chunks/{12e99071f6582f6caeaf.js → 8b3d1973eb75b81b0fb4.js} +1 -1
  50. package/assets/esri/core/workers/chunks/{67338948e470c1251d8a.js → 8d14e957219364a81d5f.js} +3 -3
  51. package/assets/esri/core/workers/chunks/92a5dccb328229a9336b.js +1 -0
  52. package/assets/esri/core/workers/chunks/{631205dc4d73d49ec9ed.js → 95507ff0a243e451b99e.js} +1 -1
  53. package/assets/esri/core/workers/chunks/{1051a5a57b2fb843a555.js → 9cd55043f3d789f41815.js} +1 -1
  54. package/assets/esri/core/workers/chunks/{2b1486a466760d2152f5.js → a0f2df8ca7cd14bfa013.js} +1 -1
  55. package/assets/esri/core/workers/chunks/{06eb4832b6c86744e52e.js → aba19485b6cdcb70dac6.js} +1 -1
  56. package/assets/esri/core/workers/chunks/{cc4a6f4000cb6680be48.js → ac2607f1e8cd2e99907c.js} +2 -2
  57. package/assets/esri/core/workers/chunks/{9a06476b834584d00d5c.js → b160dcbea6256e0cf689.js} +1 -1
  58. package/assets/esri/core/workers/chunks/b2a6afa0cd537805b4b8.js +1 -0
  59. package/assets/esri/core/workers/chunks/{571252c9822d73cf7b01.js → b845586219f284a215b2.js} +1 -1
  60. package/assets/esri/core/workers/chunks/{97c148adf0347c69a79c.js → c9604f8df909ec4fad46.js} +1 -1
  61. package/assets/esri/core/workers/chunks/{b87fec1753f164c845c5.js → ca76950d81ab4ebb65e1.js} +1 -1
  62. package/assets/esri/core/workers/chunks/{faa40ef04604c7cce706.js → cb63ea6a53d3c2fc3179.js} +1 -1
  63. package/assets/esri/core/workers/chunks/{55f087bca75c3f2a4515.js → d3c0d7799c92c6f0e7d3.js} +1 -1
  64. package/assets/esri/core/workers/chunks/dbe10c20df7e0e563a0b.js +1 -0
  65. package/assets/esri/core/workers/chunks/{ca60b34c3e1ed2ff5934.js → dd2b316baae02bbdddac.js} +1 -1
  66. package/assets/esri/core/workers/chunks/df933eac03dc63064723.js +1 -0
  67. package/assets/esri/core/workers/chunks/e77371ddbaf4b2d9be8d.js +1 -0
  68. package/assets/esri/core/workers/chunks/{80b596496800e8d60eb8.js → ed75e0962358523f4439.js} +1 -1
  69. package/assets/esri/core/workers/chunks/{19a58adc75a34f84b0ef.js → ee6240636d04d7d37b7b.js} +1 -1
  70. package/assets/esri/core/workers/chunks/{0cf979a093e9744d1e80.js → ef7955a2509be0f03ca2.js} +1 -1
  71. package/assets/esri/core/workers/chunks/{b5d68d8460b7c15001dd.js → f1c6df5cf2ccb6ac47a1.js} +1 -1
  72. package/assets/esri/core/workers/chunks/{523046e04679e301797d.js → f3d97a4c4f433adbdab5.js} +1 -1
  73. package/assets/esri/core/workers/chunks/{6c29a768f02dc7ce0ed6.js → fb9e9b9e567e32f37042.js} +1 -1
  74. package/assets/esri/themes/base/widgets/_Editor.scss +41 -2
  75. package/assets/esri/themes/base/widgets/_FeatureForm.scss +4 -0
  76. package/assets/esri/themes/base/widgets/_SelectionList.scss +21 -15
  77. package/assets/esri/themes/base/widgets/_SelectionToolbar.scss +1 -0
  78. package/assets/esri/themes/dark/main.css +1 -1
  79. package/assets/esri/themes/light/main.css +1 -1
  80. package/assets/esri/themes/light/view.css +1 -1
  81. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_no.json +1 -1
  82. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ar.json +1 -1
  83. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_bg.json +1 -1
  84. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_bs.json +1 -1
  85. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ca.json +1 -1
  86. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_cs.json +1 -1
  87. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_da.json +1 -1
  88. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_de.json +1 -1
  89. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_el.json +1 -1
  90. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_es.json +1 -1
  91. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_et.json +1 -1
  92. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_fi.json +1 -1
  93. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_fr.json +1 -1
  94. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_he.json +1 -1
  95. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_hr.json +1 -1
  96. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_hu.json +1 -1
  97. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_id.json +1 -1
  98. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_it.json +1 -1
  99. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ja.json +1 -1
  100. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ko.json +1 -1
  101. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_lt.json +1 -1
  102. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_lv.json +1 -1
  103. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_nl.json +1 -1
  104. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_no.json +1 -1
  105. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_pl.json +1 -1
  106. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_pt-BR.json +1 -1
  107. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_pt-PT.json +1 -1
  108. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ro.json +1 -1
  109. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ru.json +1 -1
  110. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_sk.json +1 -1
  111. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_sl.json +1 -1
  112. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_sr.json +1 -1
  113. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_sv.json +1 -1
  114. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_th.json +1 -1
  115. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_tr.json +1 -1
  116. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_uk.json +1 -1
  117. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_vi.json +1 -1
  118. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_zh-CN.json +1 -1
  119. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_zh-HK.json +1 -1
  120. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_zh-TW.json +1 -1
  121. package/assets/esri/widgets/Directions/t9n/Directions_de.json +1 -1
  122. package/assets/esri/widgets/Editor/t9n/Editor.json +1 -1
  123. package/assets/esri/widgets/Editor/t9n/Editor_ar.json +1 -1
  124. package/assets/esri/widgets/Editor/t9n/Editor_bg.json +1 -1
  125. package/assets/esri/widgets/Editor/t9n/Editor_bs.json +1 -1
  126. package/assets/esri/widgets/Editor/t9n/Editor_ca.json +1 -1
  127. package/assets/esri/widgets/Editor/t9n/Editor_cs.json +1 -1
  128. package/assets/esri/widgets/Editor/t9n/Editor_da.json +1 -1
  129. package/assets/esri/widgets/Editor/t9n/Editor_de.json +1 -1
  130. package/assets/esri/widgets/Editor/t9n/Editor_el.json +1 -1
  131. package/assets/esri/widgets/Editor/t9n/Editor_en.json +1 -1
  132. package/assets/esri/widgets/Editor/t9n/Editor_es.json +1 -1
  133. package/assets/esri/widgets/Editor/t9n/Editor_et.json +1 -1
  134. package/assets/esri/widgets/Editor/t9n/Editor_fi.json +1 -1
  135. package/assets/esri/widgets/Editor/t9n/Editor_fr.json +1 -1
  136. package/assets/esri/widgets/Editor/t9n/Editor_he.json +1 -1
  137. package/assets/esri/widgets/Editor/t9n/Editor_hr.json +1 -1
  138. package/assets/esri/widgets/Editor/t9n/Editor_hu.json +1 -1
  139. package/assets/esri/widgets/Editor/t9n/Editor_id.json +1 -1
  140. package/assets/esri/widgets/Editor/t9n/Editor_it.json +1 -1
  141. package/assets/esri/widgets/Editor/t9n/Editor_ja.json +1 -1
  142. package/assets/esri/widgets/Editor/t9n/Editor_ko.json +1 -1
  143. package/assets/esri/widgets/Editor/t9n/Editor_lt.json +1 -1
  144. package/assets/esri/widgets/Editor/t9n/Editor_lv.json +1 -1
  145. package/assets/esri/widgets/Editor/t9n/Editor_nl.json +1 -1
  146. package/assets/esri/widgets/Editor/t9n/Editor_no.json +1 -1
  147. package/assets/esri/widgets/Editor/t9n/Editor_pl.json +1 -1
  148. package/assets/esri/widgets/Editor/t9n/Editor_pt-BR.json +1 -1
  149. package/assets/esri/widgets/Editor/t9n/Editor_pt-PT.json +1 -1
  150. package/assets/esri/widgets/Editor/t9n/Editor_ro.json +1 -1
  151. package/assets/esri/widgets/Editor/t9n/Editor_ru.json +1 -1
  152. package/assets/esri/widgets/Editor/t9n/Editor_sk.json +1 -1
  153. package/assets/esri/widgets/Editor/t9n/Editor_sl.json +1 -1
  154. package/assets/esri/widgets/Editor/t9n/Editor_sr.json +1 -1
  155. package/assets/esri/widgets/Editor/t9n/Editor_sv.json +1 -1
  156. package/assets/esri/widgets/Editor/t9n/Editor_th.json +1 -1
  157. package/assets/esri/widgets/Editor/t9n/Editor_tr.json +1 -1
  158. package/assets/esri/widgets/Editor/t9n/Editor_uk.json +1 -1
  159. package/assets/esri/widgets/Editor/t9n/Editor_vi.json +1 -1
  160. package/assets/esri/widgets/Editor/t9n/Editor_zh-CN.json +1 -1
  161. package/assets/esri/widgets/Editor/t9n/Editor_zh-HK.json +1 -1
  162. package/assets/esri/widgets/Editor/t9n/Editor_zh-TW.json +1 -1
  163. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm.json +1 -1
  164. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_ar.json +1 -1
  165. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_bg.json +1 -1
  166. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_bs.json +1 -1
  167. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_ca.json +1 -1
  168. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_cs.json +1 -1
  169. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_da.json +1 -1
  170. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_de.json +1 -1
  171. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_el.json +1 -1
  172. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_en.json +1 -1
  173. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_es.json +1 -1
  174. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_et.json +1 -1
  175. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_fi.json +1 -1
  176. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_fr.json +1 -1
  177. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_he.json +1 -1
  178. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_hr.json +1 -1
  179. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_hu.json +1 -1
  180. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_id.json +1 -1
  181. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_it.json +1 -1
  182. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_ja.json +1 -1
  183. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_ko.json +1 -1
  184. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_lt.json +1 -1
  185. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_lv.json +1 -1
  186. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_nl.json +1 -1
  187. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_no.json +1 -1
  188. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_pl.json +1 -1
  189. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_pt-BR.json +1 -1
  190. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_pt-PT.json +1 -1
  191. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_ro.json +1 -1
  192. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_ru.json +1 -1
  193. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_sk.json +1 -1
  194. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_sl.json +1 -1
  195. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_sr.json +1 -1
  196. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_sv.json +1 -1
  197. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_th.json +1 -1
  198. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_tr.json +1 -1
  199. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_uk.json +1 -1
  200. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_vi.json +1 -1
  201. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_zh-CN.json +1 -1
  202. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_zh-HK.json +1 -1
  203. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_zh-TW.json +1 -1
  204. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable.json +1 -1
  205. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_en.json +1 -1
  206. package/assets/esri/widgets/Home/t9n/Home_pt-BR.json +1 -1
  207. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer.json +1 -1
  208. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ar.json +1 -1
  209. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_bg.json +1 -1
  210. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_bs.json +1 -1
  211. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ca.json +1 -1
  212. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_cs.json +1 -1
  213. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_da.json +1 -1
  214. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_de.json +1 -1
  215. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_el.json +1 -1
  216. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_en.json +1 -1
  217. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_es.json +1 -1
  218. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_et.json +1 -1
  219. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_fi.json +1 -1
  220. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_fr.json +1 -1
  221. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_he.json +1 -1
  222. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_hr.json +1 -1
  223. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_hu.json +1 -1
  224. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_id.json +1 -1
  225. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_it.json +1 -1
  226. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ja.json +1 -1
  227. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ko.json +1 -1
  228. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_lt.json +1 -1
  229. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_lv.json +1 -1
  230. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_nl.json +1 -1
  231. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_no.json +1 -1
  232. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pl.json +1 -1
  233. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pt-BR.json +1 -1
  234. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pt-PT.json +1 -1
  235. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ro.json +1 -1
  236. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ru.json +1 -1
  237. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sk.json +1 -1
  238. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sl.json +1 -1
  239. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sr.json +1 -1
  240. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sv.json +1 -1
  241. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_th.json +1 -1
  242. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_tr.json +1 -1
  243. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_uk.json +1 -1
  244. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_vi.json +1 -1
  245. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-CN.json +1 -1
  246. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-HK.json +1 -1
  247. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-TW.json +1 -1
  248. package/chunks/ComponentShader.glsl.js +24 -15
  249. package/chunks/FocusAreaColor.glsl.js +10 -8
  250. package/chunks/persistableUrlUtils.js +1 -1
  251. package/core/accessorSupport/decorators/persistable.js +1 -1
  252. package/core/sanitizerUtils.js +5 -0
  253. package/editing/sharedTemplates/SharedTemplate.js +1 -1
  254. package/editing/sharedTemplates/templateDefinitions/FeatureTemplateDefinition.js +1 -1
  255. package/editing/sharedTemplates/templateDefinitions/GroupTemplateDefinition.js +1 -1
  256. package/editing/sharedTemplates/templateDefinitions/PresetTemplateDefinition.js +1 -1
  257. package/editing/sharedTemplates/templateDefinitions/parts/FeatureTemplateRelationshipPart.js +1 -1
  258. package/editing/sharedTemplates/templateDefinitions/parts/GroupTemplatePart.js +1 -1
  259. package/editing/sharedTemplates/templateDefinitions/parts/PresetTemplatePart.js +1 -1
  260. package/geometry/projection/projectPointToVector.js +1 -1
  261. package/geometry/projection/projectVectorToPoint.js +1 -1
  262. package/geometry/projection/projectVectorToVector.js +1 -1
  263. package/geometry/projection.js +1 -1
  264. package/geometry/projectionUtils.js +5 -0
  265. package/geometry/support/meshUtils/elevation.js +1 -1
  266. package/geometry/support/meshUtils/extent.js +1 -1
  267. package/interfaces.d.ts +436 -80
  268. package/layers/IntegratedMesh3DTilesLayer.js +1 -1
  269. package/layers/IntegratedMeshLayer.js +1 -1
  270. package/layers/MapNotesLayer.js +1 -1
  271. package/layers/OrientedImageryLayer.js +1 -1
  272. package/layers/RouteLayer.js +1 -1
  273. package/layers/VideoLayer.js +1 -1
  274. package/layers/WMSLayer.js +1 -1
  275. package/layers/graphics/applyEditsUtils.js +1 -1
  276. package/layers/graphics/controllers/FeatureTileController3D.js +1 -1
  277. package/layers/graphics/data/QueryEngine.js +1 -1
  278. package/layers/graphics/data/QueryEngineCapabilities.js +1 -1
  279. package/layers/graphics/data/projectionSupport.js +1 -1
  280. package/layers/graphics/data/queryUtils.js +1 -1
  281. package/layers/graphics/sources/OGCFeatureSource.js +1 -1
  282. package/layers/graphics/sources/support/CSVSourceWorker.js +1 -1
  283. package/layers/knowledgeGraph/KnowledgeGraphLayerDataManager.js +1 -1
  284. package/layers/knowledgeGraph/KnowledgeGraphSublayer.js +1 -1
  285. package/layers/mixins/ArcGISImageService.js +1 -1
  286. package/layers/ogc/wfsUtils.js +1 -1
  287. package/layers/orientedImagery/core/ExposurePoint.js +1 -1
  288. package/layers/orientedImagery/core/coverageUtils.js +1 -1
  289. package/layers/orientedImagery/core/utils.js +1 -1
  290. package/layers/orientedImagery/queries.js +1 -1
  291. package/layers/orientedImagery/transformations/updateElevationUtils.js +1 -1
  292. package/layers/orientedImagery/transformations/utils.js +1 -1
  293. package/layers/support/ControlPointsGeoreference.js +1 -1
  294. package/layers/support/CornersGeoreference.js +1 -1
  295. package/layers/support/ElevationQuery.js +1 -1
  296. package/layers/support/ExtentAndRotationGeoreference.js +1 -1
  297. package/layers/support/GeoreferenceBase.js +1 -1
  298. package/layers/support/LocalMediaElementSource.js +1 -1
  299. package/layers/support/MediaElementView.js +1 -1
  300. package/layers/support/PolygonCollection.js +1 -1
  301. package/layers/support/SceneModification.js +1 -1
  302. package/layers/support/Sublayer.js +1 -1
  303. package/layers/support/VideoElement.js +1 -1
  304. package/layers/support/capabilities.js +1 -1
  305. package/layers/support/rasterFunctions/clipUtils.js +1 -1
  306. package/layers/support/rasterFunctions/rasterProjectionHelper.js +1 -1
  307. package/layers/support/serviceCapabilitiesUtils.js +1 -1
  308. package/layers/video/VideoController.js +1 -1
  309. package/libs/maquette/projection.js +1 -1
  310. package/networks/UnitIdentifierManager.js +5 -0
  311. package/networks/support/UNTraceConfiguration.js +1 -1
  312. package/package.json +1 -1
  313. package/portal/schemas/definitions.js +1 -1
  314. package/portal/schemas/webScene.js +1 -1
  315. package/portal/support/portalItemUtils.js +1 -1
  316. package/renderers/support/AuthoringInfoVisualVariable.js +1 -1
  317. package/rest/featureService/FeatureService.js +1 -1
  318. package/rest/knowledgeGraph/GraphAddNamedTypesResult.d.ts +4 -0
  319. package/rest/knowledgeGraph/GraphDeleteNamedTypeResult.d.ts +4 -0
  320. package/rest/knowledgeGraphService.d.ts +2 -0
  321. package/rest/networks/unitIdentifiers/support/UnitQueryResult.js +1 -1
  322. package/rest/query/executeQuery.js +1 -1
  323. package/rest/query/executeQueryJSON.js +1 -1
  324. package/rest/query/executeQueryPBF.js +1 -1
  325. package/rest/query.js +1 -1
  326. package/smartMapping/renderers/size.js +1 -1
  327. package/smartMapping/renderers/support/spikeUtils.d.ts +4 -0
  328. package/smartMapping/renderers/support/spikeUtils.js +1 -1
  329. package/smartMapping/statistics/histogram.js +1 -1
  330. package/smartMapping/statistics/summaryStatistics.js +1 -1
  331. package/support/persistableUrlUtils.js +1 -1
  332. package/support/revision.js +1 -1
  333. package/views/2d/LabelManager.js +1 -1
  334. package/views/2d/ViewStateManager.js +1 -1
  335. package/views/2d/constraints/GeometryConstraint.js +1 -1
  336. package/views/2d/engine/imagery/RasterBitmap.js +1 -1
  337. package/views/2d/engine/vectorTiles/decluttering/SymbolDeclutterer.js +1 -1
  338. package/views/2d/engine/vectorTiles/decluttering/core.js +1 -1
  339. package/views/2d/engine/webgl/FeatureTile.js +1 -1
  340. package/views/2d/engine/webgl/OverlayMultipoint.js +1 -1
  341. package/views/2d/engine/webgl/collisions/LabelMetric.js +1 -1
  342. package/views/2d/engine/webgl/shaderGraph/techniques/labels/LabelMeshWriter.js +1 -1
  343. package/views/2d/engine/webgl/shaderGraph/techniques/raster/RasterColorizerTechnique.js +1 -1
  344. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/ReprojectTechnique.js +1 -1
  345. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/BaseRasterColorizerShader.js +1 -1
  346. package/views/2d/grid/GridView2D.js +1 -1
  347. package/views/2d/interactive/editingTools/ControlPointsTransformTool.js +1 -1
  348. package/views/2d/interactive/editingTools/TransformTool.js +1 -1
  349. package/views/2d/layers/KMLLayerView2D.js +1 -1
  350. package/views/2d/layers/VectorTileLayerView2D.js +1 -1
  351. package/views/2d/layers/VideoLayerView2D.js +1 -1
  352. package/views/2d/layers/features/FeatureContainer.js +1 -1
  353. package/views/2d/layers/imagery/ImageryTileView2D.js +1 -1
  354. package/views/2d/layers/support/vectorTileDebugUtils.js +1 -1
  355. package/views/2d/viewpointUtils.js +1 -1
  356. package/views/3d/FocusAreasView.js +1 -1
  357. package/views/3d/analysis/AreaMeasurement/support/AreaMeasurementPathHelper.js +1 -1
  358. package/views/3d/analysis/AreaMeasurement/support/MeasurementData.js +1 -1
  359. package/views/3d/analysis/LineOfSight/LineOfSightController.js +1 -1
  360. package/views/3d/analysis/Slice/sliceToolUtils.js +1 -1
  361. package/views/3d/analysis/Viewshed/ViewshedSubTool.js +1 -1
  362. package/views/3d/analysis/ViewshedAnalysisView3D.js +1 -1
  363. package/views/3d/analysis/support/projectionUtils.js +1 -1
  364. package/views/3d/environment/EnvironmentManager.js +1 -1
  365. package/views/3d/interactive/Manipulator3D.js +1 -1
  366. package/views/3d/interactive/editingTools/dragEventPipeline3D.js +1 -1
  367. package/views/3d/interactive/editingTools/media/MediaElementControllerControlPoints.js +1 -1
  368. package/views/3d/interactive/editingTools/media/MediaElementControllerShape.js +1 -1
  369. package/views/3d/interactive/editingTools/reshape/edgeOffsetUtils.js +1 -1
  370. package/views/3d/interactive/visualElements/support/Segment.js +1 -1
  371. package/views/3d/layers/FeatureLayerView3D.js +1 -1
  372. package/views/3d/layers/FlowSubView3D.js +1 -1
  373. package/views/3d/layers/I3SMeshView3D.js +1 -1
  374. package/views/3d/layers/I3SMeshWorkerHandle.js +1 -1
  375. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  376. package/views/3d/layers/SceneLayerWorker.js +1 -1
  377. package/views/3d/layers/TileLayerView3D.js +1 -1
  378. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  379. package/views/3d/layers/graphics/Graphics3DFeatureStore.js +1 -1
  380. package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
  381. package/views/3d/layers/graphics/focusAreaStyle.js +1 -1
  382. package/views/3d/layers/graphics/graphicUtils.js +1 -1
  383. package/views/3d/layers/graphics/pipeline/Feature3DPipelineWorker.js +1 -1
  384. package/views/3d/layers/i3s/I3SMaterialUtil.js +1 -1
  385. package/views/3d/layers/i3s/I3SMeshViewFilter.js +1 -1
  386. package/views/3d/layers/i3s/I3SUtil.js +1 -1
  387. package/views/3d/layers/i3s/enums.js +1 -1
  388. package/views/3d/layers/support/FeatureTile.js +1 -1
  389. package/views/3d/layers/support/FeatureTileFetcher3D.js +1 -1
  390. package/views/3d/layers/support/FeatureTileFetcher3DDebugger.js +1 -1
  391. package/views/3d/layers/support/ImageHighlightHelper3D.js +1 -1
  392. package/views/3d/state/ViewStateManager.js +1 -1
  393. package/views/3d/support/cameraUtils.js +1 -1
  394. package/views/3d/support/viewpointUtils.js +1 -1
  395. package/views/3d/terrain/ExtentHelper.js +1 -1
  396. package/views/3d/terrain/TerrainRenderer.js +1 -1
  397. package/views/3d/terrain/TextureFader.js +1 -1
  398. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  399. package/views/3d/webgl-engine/collections/Component/Material/ComponentTechnique.js +1 -1
  400. package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
  401. package/views/3d/webgl-engine/core/FBOCache.js +1 -1
  402. package/views/3d/webgl-engine/core/renderPasses/AllRenderPasses.js +1 -1
  403. package/views/3d/webgl-engine/core/renderPasses/RenderPassManager.js +1 -1
  404. package/views/3d/webgl-engine/effects/focusArea/FocusAreaColorNode.js +1 -1
  405. package/views/3d/webgl-engine/effects/focusArea/FocusAreaEffect.js +5 -0
  406. package/views/3d/webgl-engine/effects/focusArea/FocusAreaMaskNode.js +1 -1
  407. package/views/3d/webgl-engine/effects/geometry/RenderOccludedRenderNode.js +1 -1
  408. package/views/3d/webgl-engine/lib/RenderSlot.js +1 -1
  409. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  410. package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
  411. package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
  412. package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
  413. package/views/3d/webgl-engine/shaders/FocusAreaColor.glsl.js +1 -1
  414. package/views/FocusArea.js +1 -1
  415. package/views/FocusAreaOutline.js +1 -1
  416. package/views/FocusAreas.js +1 -1
  417. package/views/SceneView.js +1 -1
  418. package/views/VideoView.js +1 -1
  419. package/views/View2D.js +1 -1
  420. package/views/interactive/GraphicManipulator.js +1 -1
  421. package/views/interactive/dragEventPipeline.js +1 -1
  422. package/views/interactive/snapping/GridSnappingEngine.js +1 -1
  423. package/views/interactive/snapping/SnappingManager.js +1 -1
  424. package/views/interactive/snapping/featureSources/GraphicsSnappingSource.js +1 -1
  425. package/views/layers/SceneLayerView.js +1 -1
  426. package/views/support/geodesicAreaMeasurementUtils.js +1 -1
  427. package/views/support/projectionUtils.js +1 -1
  428. package/views/ui/UI.js +1 -1
  429. package/views/webgl/FramebufferObject.js +1 -1
  430. package/views/webgl/RenderingContext.js +1 -1
  431. package/views/webgl/Texture.js +1 -1
  432. package/views/webgl/rasterUtils.js +1 -1
  433. package/webscene/Slide.js +1 -1
  434. package/webscene/support/analysisUtils.js +1 -1
  435. package/widgets/AreaMeasurement3D.js +1 -1
  436. package/widgets/BasemapGallery/BasemapGalleryViewModel.js +1 -1
  437. package/widgets/BasemapToggle/BasemapToggleViewModel.js +1 -1
  438. package/widgets/CoordinateConversion/CoordinateConversionViewModel.js +1 -1
  439. package/widgets/CoordinateConversion/support/Format.js +1 -1
  440. package/widgets/DirectLineMeasurement3D/DirectLineMeasurement3DViewModel.js +1 -1
  441. package/widgets/DirectLineMeasurement3D.js +1 -1
  442. package/widgets/DirectionalPad.js +1 -1
  443. package/widgets/Editor/EditorViewModel.js +1 -1
  444. package/widgets/Editor/UpdateFeatureWorkflow.js +1 -1
  445. package/widgets/Editor/UpdateRecordWorkflow.js +1 -1
  446. package/widgets/Editor/UpdateRecordWorkflowData.js +1 -1
  447. package/widgets/Editor/UpdateWorkflow.js +1 -1
  448. package/widgets/Editor/Upload.js +1 -1
  449. package/widgets/Editor/VisibleElements.js +1 -1
  450. package/widgets/Editor/components/FooterActions.js +1 -1
  451. package/widgets/Editor/components/Notices.js +1 -1
  452. package/widgets/Editor/components/UpdateFeaturePanelContent.js +1 -1
  453. package/widgets/Editor/css.js +1 -1
  454. package/widgets/Editor/workflowUtils.js +1 -1
  455. package/widgets/Editor.js +1 -1
  456. package/widgets/ElevationProfile/support/geometryUtils.js +1 -1
  457. package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationItemList.js +1 -1
  458. package/widgets/FeatureForm/TextElementInput.js +1 -1
  459. package/widgets/FeatureForm/css.js +1 -1
  460. package/widgets/FeatureForm.js +1 -1
  461. package/widgets/FeatureTable/AttachmentsColumn.js +1 -1
  462. package/widgets/FeatureTable/FieldColumn.js +1 -1
  463. package/widgets/FeatureTable/Grid/Column.js +1 -1
  464. package/widgets/FeatureTable/Grid/Grid.js +1 -1
  465. package/widgets/FeatureTable/Grid/support/ButtonMenu.js +1 -1
  466. package/widgets/FeatureTable/support/exportUtils.js +1 -1
  467. package/widgets/FeatureTable/support/tableUtils.js +1 -1
  468. package/widgets/FeatureTable.js +1 -1
  469. package/widgets/Features/FeaturesViewModel.js +1 -1
  470. package/widgets/LineOfSight.js +1 -1
  471. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  472. package/widgets/OrientedImageryViewer/OrientedImageryViewerVisibleElements.js +1 -1
  473. package/widgets/OrientedImageryViewer/adapters/sketch/DataCaptureAdapter.js +1 -1
  474. package/widgets/OrientedImageryViewer/adapters/sketch/MeasurementAdapter.js +1 -1
  475. package/widgets/OrientedImageryViewer/adapters/sketch/TriangulatedMeasurementAdapter.js +1 -1
  476. package/widgets/OrientedImageryViewer/adapters/view/MapViewAdapter.js +1 -1
  477. package/widgets/OrientedImageryViewer/adapters/view/SceneViewAdapter.js +1 -1
  478. package/widgets/OrientedImageryViewer/components/ImageViewerViewModel.js +1 -1
  479. package/widgets/OrientedImageryViewer/components/NavigationAction.js +5 -0
  480. package/widgets/OrientedImageryViewer/components/NavigationActions.js +1 -1
  481. package/widgets/OrientedImageryViewer/components/OrientedImageryVideoViewModel.js +5 -0
  482. package/widgets/OrientedImageryViewer/constants.js +1 -1
  483. package/widgets/OrientedImageryViewer/imageMeasurementUtils.js +1 -1
  484. package/widgets/OrientedImageryViewer.js +1 -1
  485. package/widgets/PanoramicViewer/PanoramicViewerViewModel.js +1 -1
  486. package/widgets/ScaleRangeSlider/ScaleRangeSliderViewModel.js +1 -1
  487. package/widgets/Sketch/SketchViewModel.js +1 -1
  488. package/widgets/Sketch.js +1 -1
  489. package/widgets/Slice.js +1 -1
  490. package/widgets/UtilityNetworkTrace/support/GeometryHandler.js +1 -1
  491. package/widgets/support/AnalysisViewModel.js +1 -1
  492. package/widgets/support/AnchorElementViewModel.js +1 -1
  493. package/widgets/support/GridControls/GridControlsViewModel.js +1 -1
  494. package/widgets/support/SelectionList/SelectionListViewModel.js +1 -1
  495. package/widgets/support/SelectionList/VisibleElements.js +1 -1
  496. package/widgets/support/SelectionList.js +1 -1
  497. package/widgets/support/SelectionToolbar/SelectionToolbarViewModel.js +1 -1
  498. package/widgets/support/SelectionToolbar/VisibleElements.js +1 -1
  499. package/widgets/support/SelectionToolbar.js +1 -1
  500. package/widgets/support/Selector2D/SelectionOperation.js +1 -1
  501. package/widgets/support/Selector2D/selectorUtils.js +1 -1
  502. package/widgets/support/tests.js +1 -1
  503. package/widgets/support/widget.js +1 -1
  504. package/widgets/support/widgetUtils.js +1 -1
  505. package/assets/esri/core/workers/chunks/0c50ee1f3cdd30d96479.js +0 -1
  506. package/assets/esri/core/workers/chunks/133e4bde346828d4510b.js +0 -1
  507. package/assets/esri/core/workers/chunks/3a743653b786b010a57f.js +0 -1
  508. package/assets/esri/core/workers/chunks/5228d39c05d660a135b6.js +0 -1
  509. package/assets/esri/core/workers/chunks/5f4ca51b82daf0e51010.js +0 -1
  510. package/assets/esri/core/workers/chunks/6d1e1a4fcb90ea8b6848.js +0 -1
  511. package/assets/esri/core/workers/chunks/7e6141b5baae47682f97.js +0 -1
  512. package/assets/esri/core/workers/chunks/87fc7b6c3e2d4f7775e2.js +0 -1
  513. package/assets/esri/core/workers/chunks/8fda0a5b247385e68dc0.js +0 -1
  514. package/assets/esri/core/workers/chunks/938f1eebc48871be64e9.js +0 -1
  515. package/assets/esri/core/workers/chunks/9588328d4ed6b0f04166.js +0 -2
  516. package/assets/esri/core/workers/chunks/9839309d0cd804fe52c2.js +0 -1
  517. package/assets/esri/core/workers/chunks/9b610fbfcd47c3dde34d.js +0 -1
  518. package/assets/esri/core/workers/chunks/be2c8c0a8b2bce7979b6.js +0 -1
  519. package/assets/esri/core/workers/chunks/f218a190015de1444018.js +0 -1
  520. package/assets/esri/core/workers/chunks/f9567108862629f25c8b.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.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../chunks/tslib.es6.js";import{update as t}from"../../../../core/arrayUtils.js";import{createTask as r}from"../../../../core/asyncUtils.js";import{unitRGBAFromColor as i}from"../../../../core/colorUtils.js";import has from"../../../../core/has.js";import{clamp as s,lerp as a}from"../../../../core/mathUtils.js";import{removeMaybe as n,abortMaybe as h,destroyMaybe as o,releaseMaybe as d}from"../../../../core/maybe.js";import{throwIfAborted as l}from"../../../../core/promiseUtils.js";import{watch as _,syncAndInitial as u,initial as p,sync as c}from"../../../../core/reactiveUtils.js";import{signal as m}from"../../../../core/signal.js";import{Milliseconds as g}from"../../../../core/time.js";import{property as f}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/Logger.js";import{subclass as b}from"../../../../core/accessorSupport/decorators/subclass.js";import{equals as A,invert as T,multiply as E}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{IDENTITY as R,create as P}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{s as S}from"../../../../chunks/vec42.js";import{ZEROS as C}from"../../../../core/libs/gl-matrix-2/factories/vec4f32.js";import{fromValues as w,ZEROS as I}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{pruneIndexArrays as O}from"../../../../geometry/support/Indices.js";import{RenderCategory as D,InternalRenderCategory as N}from"../../webgl.js";import{innerAtmosphereFadeStart as H}from"../../environment/atmosphereUtils.js";import{minNearDistanceInMeters as y}from"../../state/NearFarHeuristic.js";import{debugFlags as x}from"../../support/debugFlags.js";import{FBOCache as L,defaultWebGLFBO as M}from"../core/FBOCache.js";import{DepthFormat as v,ColorFormat as U}from"../core/FBOCacheFormats.js";import{RenderPassManager as F}from"../core/renderPasses/RenderPassManager.js";import{ShaderOutput as G,isColorOrColorEmission as q}from"../core/shaderLibrary/ShaderOutput.js";import{HUDRenderStyle as V}from"../core/shaderLibrary/hud/HUDRenderStyle.js";import{distanceFadeEnd as j}from"../core/shaderLibrary/shading/ScreenSpaceConstants.js";import{RenderNodes as B}from"../effects/RenderNodes.js";import{RenderPluginManager as Q}from"../effects/RenderPluginManager.js";import{Blit as W}from"../effects/blit/Blit.js";import{maxHighlightsPerChannel as k,renderHighlightBuffer as z}from"../effects/highlight/Highlight.js";import{OITBlend as Y}from"../effects/transparency/OITBlend.js";import{AnimationTimer as X}from"./AnimationTimer.js";import{AnimationTimeStep as K}from"./AnimationTimeStep.js";import{RenderRequestType as J}from"./basicInterfaces.js";import{BoundingInfo as Z}from"./BoundingInfo.js";import{DepthRange as $}from"./DepthRange.js";import{depthRangeFromScene as ee,DepthRangeMode as te}from"./depthRangeUtils.js";import{hudFragmentOpacityParameters as re}from"./hudFragmentOpacityParameters.js";import{MainFramebuffer as ie}from"./MainFramebuffer.js";import{RenderOccludedFlag as se}from"./Material.js";import{OITPass as ae}from"./OITPass.js";import{RenderContext as ne,defaultRenderOccludedMask as he}from"./RenderContext.js";import{RendererBase as oe}from"./RendererBase.js";import{RendererTarget as de}from"./rendererUtils.js";import{setupFeatureDefaults as le,RenderFeature as _e}from"./RenderFeature.js";import{RenderPluginInput as ue}from"./RenderPluginInput.js";import{RenderSlot as pe}from"./RenderSlot.js";import{ShadowAccumulator as ce}from"./ShadowAccumulator.js";import{ShadowMap as me,SnapshotSlot as ge}from"./ShadowMap.js";import fe from"./SliceHelper.js";import{Transparency as be}from"./edgeRendering/interfaces.js";import{MergedRenderer as Ae}from"../materials/renderers/MergedRenderer.js";import{RenderSceneResult as Te}from"../parts/renderUtils.js";import{RendererPerformanceInfo as Ee,PerformanceCategory as Re}from"../statistics/RendererPerformanceInfo.js";import{RenderState as Pe}from"../../../support/RenderState.js";import{PixelFormat as Se,PixelType as Ce,FramebufferBit as we,ColorAttachment1 as Ie,ColorAttachment2 as Oe}from"../../../webgl/enums.js";let De=class extends oe{constructor(e,t,r,s,a,n){super({stage:e}),this._techniques=r,this._rctx=s,this._compositingHelper=a,this._requestRender=n,this._pluginsHas={hudElements:!1,water:!1},this.renderPassManager=new F,this._isRendering=!1,this._inGlobeView=!1,this._backgroundColor=w(0,0,0,1),this._sliceHelper=new fe,this._blit=null,this._oitblend=null,this.sceneDepthRange=m($.infinite),this._state=m(Pe.IDLE),this._highQualityTransparencyEnabled=!0,this._ssrEnabled=!1,this._hasAnimations=!1,this._animationTimestep=new K,this._loadEdgeViewTask=null,this._edgeViewCallbacks=[],this._reprojectionMatrixVersion=m(0),this._lastFrameTime=g(0),this._renderHiddenTransparentEdges=()=>{},this._pluginInput=new ue,this._releaseNormals=e=>{e.some((({name:e})=>"normals"===e))&&this._pluginInput.release("normals")},this._debugNeedsDepth=!1,this.fboCache=new L(s),this._renderStateFeatures=m(le(!has("disable-feature:high-quality-idle"),e.view.qualityProfile)),this._framebuffer=new ie(this.fboCache),this.performanceInfo=new Ee(this._rctx),this._shadowMap=new me(this.fboCache,e.viewingMode),this._shadowAccumulator=new ce(this.fboCache,r,e,(e=>{const t=this.shadowsEnabled;this._shadowMap.enabled=!0,this._ensureBindParametersCamera(e.camera,e.contentCamera),this._plugins.prepareRender(),this._shadowMap.enabled=t}),((t,r,i)=>{const s=e.view.qualitySettings.maximumPixelRatio;t.shadowMap.start(t.camera,r,i,!0,s),this._renderShadowCascades(G.Shadow,t.shadowMap),t.shadowMap.finish(),t.camera.setGLViewport(this._rctx),this._ensureBindParametersCamera(t.camera,t.contentCamera)}),n),this._renderContext=new ne(this._rctx,this._shadowMap,r),this._nodes=new B(this._renderContext),this._plugins=new Q({renderContext:this._renderContext,techniques:r,materials:t,requestRender:n,controller:e,fbos:this.fboCache,isFeatureEnabled:e=>this.isFeatureEnabled(e)}),this._plugins.add(this.renderPassManager),this.addHandles([_((()=>e.view.state.camera),(()=>n()),u),_((()=>x.EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES),(e=>{this._renderHiddenTransparentEdges=e?()=>this._renderEdges(be.TRANSPARENT):()=>{},n()}),p),_((()=>e.view.environment.background?.color),(e=>{const t=e?i(e):I;S(this._backgroundColor,t[0]*t[3],t[1]*t[3],t[2]*t[3],t[3]),n()}),u),_((()=>e.view.state.camera.relativeElevation),(e=>this._inGlobeView=(e??1/0)>=j),u),_((()=>this._bindParameters.clouds.fadeFactor),(()=>this._bindParameters.fadeLighting()),c),_((()=>this._bindParameters.clouds.data?.state),(()=>n()),c),_((()=>e.view.state.highlights),(e=>{this._bindParameters.highlights=e,n()}),p)])}destroy(){this._gpuTimerHandle=n(this._gpuTimerHandle),this._nodes.destroy(),this._framebuffer.dispose(),this._shadowMap.dispose(),this._shadowAccumulator.dispose(),this._loadEdgeViewTask=h(this._loadEdgeViewTask),this._edgeView=o(this._edgeView),this.renderPassManager.dispose(),this._releaseFBOs(),this._disposeOffscreenBuffers(),this.fboCache.destroy(),this._plugins.destroy(),this._blit=null,this._oitblend=null,Z.prune(),Ae.prune(),O()}get renderContext(){return this._renderContext}get _bindParameters(){return this._renderContext.bind}get _framebufferSize(){return this._framebuffer.size}updateRenderFeatures(e=null,t=!has("disable-feature:high-quality-idle")){this._renderStateFeatures.value=le(t,e),this._requestRender()}isFeatureEnabled(e,t=this._state.value){return this._renderStateFeatures.value.get(t,e)??!1}setFeatureEnabled(e,t,r){this._renderStateFeatures.mutate((i=>i.set(t,e,r))),this._requestRender()}get _highQualityTransparency(){return this._highQualityTransparencyEnabled||this.isFeatureEnabled(_e.HighQualityTransparency)}get hasReflections(){return this._pluginsHas.water&&(this._ssrEnabled||this.isFeatureEnabled(_e.WaterReflection))}get _hasHighlights(){return this._plugins.produces(G.Highlight,pe.OPAQUE_MATERIAL,pe.TRANSPARENT_MATERIAL,pe.DRAPED_MATERIAL,pe.HUD_MATERIAL,pe.LABEL_MATERIAL)}hasHighlight(e){return this._plugins.hasHighlight(e)}get _hasHUDHighlights(){return this._plugins.produces(G.Highlight,pe.HUD_MATERIAL,pe.LABEL_MATERIAL)}get hasSSAO(){return(this.stage.view.qualitySettings.ambientOcclusion||this.isFeatureEnabled(_e.SSAO))&&!this._inGlobeView}get hasSMAA(){return this.stage.view.qualitySettings.antialiasingEnabled||this.isFeatureEnabled(_e.Antialiasing)}get fullResolutionAtmosphere(){return this.stage.view.qualitySettings.highResolutionAtmosphere||this.isFeatureEnabled(_e.HighResolutionAtmosphere)}_releaseFBOs(){this._bindParameters.ssr.lastFrameColor=d(this._bindParameters.ssr.lastFrameColor),this._bindParameters.terrainDepth=d(this._bindParameters.terrainDepth),this._bindParameters.geometryDepth=d(this._bindParameters.geometryDepth)}_disposeOffscreenBuffers(){this._framebuffer.dispose(),this._disposeBindBuffers()}_disposeBindBuffers(){this._shadowMap.disposeOffscreenBuffers(),this._bindParameters.depth=d(this._bindParameters.depth),this._bindParameters.hudVisibility=d(this._bindParameters.hudVisibility)}get updating(){return this._loadEdgeViewTask&&!this._loadEdgeViewTask.finished||this._edgeView?.updating||this._shadowAccumulator.running||this._plugins.updating||!this.isCameraFinal}loadEdgeView(){return this._loadEdgeViewTask||(this._loadEdgeViewTask=r((async e=>{const{EdgeView:t}=await import("./edgeRendering/EdgeView.js");l(e);const r=this._edgeView=new t({rctx:this._rctx,renderSR:this.stage.view.renderSpatialReference,viewingMode:this.stage.view.stage.viewingMode,techniques:this._techniques,setNeedsRender:()=>this._requestRender(),schedule:Ve(this.stage.view.resourceController)});return this.addHandles(_((()=>r.updating),(()=>this._requestRender()),c)),this._requestRender(),this._edgeViewCallbacks.forEach((e=>e(r))),this._edgeViewCallbacks.length=0,r}))),this._loadEdgeViewTask.promise}withEdgeView(e){this.loadEdgeView(),null==this._edgeView?this._edgeViewCallbacks.push(e):e(this._edgeView)}get edgeView(){return this._edgeView}get isCameraFinal(){return this._reprojectionMatrixVersion.value>=0&&A(this._bindParameters.ssr.reprojectionMatrix,R)}set _reprojectionMatrix(e){t(this._bindParameters.ssr.reprojectionMatrix,e)&&this._reprojectionMatrixVersion.value++}get shadowsEnabled(){return!!this._shadowMap?.enabled}setParameters(e){const{_shadowMap:t,_bindParameters:r}=this;if(void 0!==e.qualitySettings?.reflections&&this._ssrEnabled!==e.qualitySettings.reflections&&(this._ssrEnabled=e.qualitySettings.reflections,this._requestRender()),void 0!==e.shadowMap&&this._shadowMap.enabled!==e.shadowMap&&(this._shadowMap.enabled=e.shadowMap,this._requestRender()),void 0!==e.shadowMapMaxCascades&&t.maxCascades!==e.shadowMapMaxCascades&&(t.maxCascades=e.shadowMapMaxCascades,this._requestRender()),null!=e.environment){if(null!=e.environment.weather){const t=e.environment.weather;this._bindParameters.weather=t,this._bindParameters.snowCover=!!e.weatherVisible&&null!=t&&"snowy"===t.type&&"enabled"===t.snowCover}const t="virtual"!==e.environment.lighting.type;r.enableFillLights!==t&&(r.enableFillLights=t,this._requestRender())}void 0!==e.highQualityTransparency&&this._highQualityTransparencyEnabled!==e.highQualityTransparency&&(this._highQualityTransparencyEnabled=e.highQualityTransparency,this._requestRender()),void 0!==e.shadowCast&&this._shadowAccumulator.setOptions(e.shadowCast)}set slice(e){this._sliceHelper.update(e)&&this._requestRender()}get plugins(){return this._plugins}get _hasOITSupport(){return this._rctx.driverTest.floatBufferBlend.result}get _oitEnabled(){return this._highQualityTransparency&&this._hasOITSupport}commit(e,t){return this._isRendering&&console.warn("Renderer.modify called while rendering"),!!super.commit(e,t,this._plugins.context)&&(this.updateHasFlags(),!0)}rendererAdded(e){this._plugins.add(e)}rendererRemoved(e){this._plugins.remove(e)}get occludedRequiresStencil(){return this.occludedRequiresOccludeeStencil||this.occludedRequiresIntegratedMeshStencil}get occludedRequiresOccludeeStencil(){return this._bindParameters.hasOccludees&&0!==(this.plugins.renderOccludedFlags&se.OccludeAndTransparentStencil)}get occludedRequiresIntegratedMeshStencil(){return this._plugins.produces(G.Color,pe.INTEGRATED_MESH)&&this._plugins.produces(G.Color,pe.OCCLUDED_TERRAIN)}updateHasFlags(){const has=this._pluginsHas;has.hudElements=this._plugins.produces(G.Color,...ve),has.water=this._plugins.produces(G.Normal,pe.DRAPED_WATER),this._bindParameters.hasOccludees=this._plugins.hasOccludees,this._requestRender()}updateAnimation(e,t){this._animationTimer??=new X(e.camera,t),this._animationTimer.advance(e.camera,t,this._animationTimeDilation);const r=this._hasAnimations;return this._hasAnimations=this._plugins.updateAnimation(this._animationTimer),this._hasAnimations=this._nodes.updateAnimation(this._animationTimer)||this._hasAnimations,this._hasAnimations!==r&&(this._gpuTimerHandle=r?n(this._gpuTimerHandle):this.performanceInfo.enableGPUPerformanceInfo()),this._hasAnimations}get animationTimestep(){return this._animationTimestep.value}get _animationTimeDilation(){return this._animationTimestep.timeDilation}resetAnimation(){this._animationTimestep.clear()}tick(){this.fboCache.clean()}render(e,t,r=de.Default,i=!1){try{return this._isRendering=!0,this._render(e,t,r,i)}catch(s){console.error(`Exception during rendering: ${s}`)}finally{this._isRendering=!1}return new Te(this._pluginInput.get(D.FINAL),null)}_updateHUDOccludedFragmentOpacity(e,t){const{idleOpacity:r,navigatingOpacity:i,maxDelta:n,tiltFadeStart:h,tiltFadeEnd:o,altitudeStart:d,altitudeEnd:l}=re,_=this.stage.view,u=_.stateManager.camera,p=_.qualitySettings.fadeDuration,c=e===Pe.IDLE?r:i,m=s((u.tilt-h)/(o-h),0,1),g=s(((u.position.z??0)-d)/(l-d),0,1),f=a(a(1,c,m),1,g),b=this._bindParameters.hudOccludedFragmentOpacity;if(p<=0||b===f||0===this._lastFrameTime||this._lastFrameTime>t)return this._bindParameters.hudOccludedFragmentOpacity=f,void(this._lastFrameTime=t);const A=t-this._lastFrameTime;this._lastFrameTime=t;const T=Math.max(1-r,Math.abs(r-i)),E=Math.min(T*A/p,n);E>=Math.abs(f-b)?this._bindParameters.hudOccludedFragmentOpacity=f:(this._bindParameters.hudOccludedFragmentOpacity=b+Math.sign(f-b)*E,this._requestRender())}_render(e,t,r=de.Default,i){this.performanceInfo.startFrame(),this.fboCache.frameStart(),this.fboCache.interactive=r===de.Default,this._disposeBindBuffers();const{camera:s,contentCamera:a,mode:n,alignPixelEnabled:h}=e;this._state.value=n;const o=this._nodes.produces("magnifier-color"),d=this._nodes.produces(D.FINAL),l=this._nodes.require("emissive",N.TRANSPARENT_ENVIRONMENT,D.COMPOSITE,D.FINAL)>0&&this._plugins.hasEmissions,_=l?G.ColorEmission:G.Color;this._renderContext.time=t,this._renderContext.output=_,this._bindParameters.oitPass=ae.NONE,this._bindParameters.alignPixelEnabled=h,this._bindParameters.decorations=!i,this._bindParameters.mainDepth=null;const u=!i||!this._sliceHelper.isDecoration;this._bindParameters.slicePlane=u?this._sliceHelper.plane:null,this._bindParameters.viewshedEnabled=this._nodes.produces(N.VIEWSHED),this._renderOverlay(t),s.setGLViewport(this._rctx);const p=this._framebuffer,c=p.initialize(s.fullWidth,s.fullHeight,this._backgroundColor,l);this.hasReflections?(c?.setName("last frame color"),this._bindParameters.ssr.lastFrameColor=c):c?.release(),this._ensureBindParametersCamera(s,a),this._updateHUDOccludedFragmentOpacity(n,t),this._plugins.prepareRender(),this._bindParameters.shadowHighlightsVisible=this._needsShadowHighlight&&!i;const m=this._highQualityTransparency&&this._hasTransparentTerrain,g=this._plugins.produces(G.Color,...Le);this._precompilePrepasses(),this.performanceInfo.advance(Re.PREPARE);const f=this._computeShadowDepthRange(s);this._renderShadowMap(s,this._bindParameters.lighting.mainLight.direction,f),this._pluginInput.set("normals",this._renderNormals()),this._renderRemainingGeometryDepth(),this._renderShadowAccumulation(f,s,a),this._ensureBindParametersSSR(t),this._precompileShaders(m,g,_),this._renderContext.output=_,p.bind(),this._bindParameters.mainDepth=p.depth.attachment,this._renderOpaque(m),this._renderTransparent(g,m,_),this._shadowMap.disposeMainBuffer(),this._pluginInput.set(N.FOCUSAREA,this._renderFocusAreaGeometry()),p.update((e=>this._renderNodes(N.TRANSPARENT_ENVIRONMENT,e))),p.update((e=>this._renderNodes(N.VIEWSHED,e))),p.update((e=>this._renderNodes(N.LASERLINES,e))),p.update((e=>this._renderNodes(N.FOCUSAREA_COLOR,e))),this._pluginInput.release(N.FOCUSAREA),p.update((e=>this._renderNodes(N.OCCLUDED,e))),this._pluginInput.set("highlights",this._renderHighlightPrepass()),this._renderHighlightShadowMap(s,this._bindParameters.lighting.mainLight.direction,f);const b=r===de.ObjectAndLayerID?this._renderObjectAndLayerIdColor():null;p.update((e=>this._renderNodes(D.COMPOSITE,e))),this._shadowMap.disposeOffscreenBuffers();const A=!(r!==de.Default||d||o&&!i),T=this._pluginInput.get(D.COMPOSITE),E=A?M:this.fboCache.acquire(T.fbo.width,T.fbo.height,N.ANTIALIASING),R=this._nodes.produces(N.ANTIALIASING)?this._renderNodes(N.ANTIALIASING,E):this._blitFBO(T,E,!1);let P;this._pluginInput.set(N.ANTIALIASING,R),this._hasHUDHighlights?(this._renderHUD(V.NotOccluded,R,_),P=this._renderNodes(N.HIGHLIGHTS,R)):(P=this._renderNodes(N.HIGHLIGHTS,R),this._renderHUD(V.NotOccluded,P,_));const S=this._renderNodes(N.MAGNIFIER,P);return o&&!i&&r===de.Default&&!d&&this._blitFBO(S),d?(S.attachDepth(p.depth),this._blitFBO(this._renderNodes(D.FINAL,S)),S.detachDepth()):this._pluginInput.set(D.FINAL,S),this._pluginInput.release("highlights"),this.onPostRender&&this.onPostRender(),this._releaseFBOs(),p.releaseDepth(),this._renderContext.lastFrameCamera.copyFrom(this._bindParameters.camera),this.fboCache.frameEnd(),this.performanceInfo.finishFrame(),r!==de.Default&&(this._releaseFBOs(),this._disposeOffscreenBuffers()),new Te(this._pluginInput.get(D.FINAL),b)}_precompileShaders(e,t,r){++this._plugins.context.techniques.precompiling,this._renderContext.output=r,this._precompileOpaqueGeometry(),this._nodes.precompile(N.OPAQUE_ENVIRONMENT),this._bindParameters.terrainDepthTest=e,this._bindParameters.cullAboveTerrain=e,this._renderContext.output=G.Depth,this._plugins.precompile(pe.TRANSPARENT_TERRAIN),e&&(this._precompileOpaqueGeometry(),this._precompileTransparentGeometry()),this._renderContext.output=r,this._plugins.precompile(pe.TRANSPARENT_TERRAIN),t&&(this._precompileTransparentGeometry(),this._hasTransparentTerrain&&(this._bindParameters.cullAboveTerrain=!1,this._precompileTransparentGeometry(),this._bindParameters.cullAboveTerrain=e)),this._nodes.precompile(N.FOCUSAREA),this._needsHUDVisibility&&this._plugins.precompile(pe.OCCLUSION_PIXELS),this._plugins.precompile(pe.LINE_CALLOUTS),this._precompileHUD(V.Occluded),this._bindParameters.terrainDepthTest=!1,this._bindParameters.cullAboveTerrain=!1,this._nodes.precompile(N.VIEWSHED,N.LASERLINES,N.FOCUSAREA_COLOR,N.OCCLUDED,N.ANTIALIASING,N.HIGHLIGHTS);const i=this._bindParameters;i.highlightMixTexture=i.highlights.length>1?this._rctx.emptyTexture:null,this._precompileHUD(V.NotOccluded),this._hasHighlights&&(i.highlights.forEach(((e,t)=>{i.highlightLevel=t,this._precompileAllGeometry(G.Highlight)})),i.highlightLevel=null),i.highlightMixTexture=null,this._nodes.precompile(D.COMPOSITE,N.MAGNIFIER),this._shadowAccumulator.precompile(),this._plugins.precompile(pe.TRANSPARENT_MATERIAL_WITHOUT_DEPTH),--this._plugins.context.techniques.precompiling}_renderFocusAreaGeometry(){const e=this._nodes.produce(N.FOCUSAREA,this._pluginInput);return e&&this.performanceInfo.advance(Re.FOCUS_AREA_MASK),e}_renderObjectAndLayerIdColor(){if(!this._nodes.produces("olid"))return null;const e=this._renderContext.output;++this._techniques.precompiling;const t=this._framebufferSize;let r=this.fboCache.acquire(t.width,t.height,"olid");return r.acquireDepth(v.DEPTH24_STENCIL8),r=this._nodes.render(r,this._pluginInput),--this._techniques.precompiling,this.performanceInfo.advance(Re.OBJECT_AND_LAYER_ID_COLOR),this._renderContext.output=e,r}finish(e){this._hasAnimations||this._animationTimestep.clear();const t=this.performanceInfo.gpuSamplingEnabled,r=e===J.BACKGROUND;if(r||t){const e=r?this.performanceInfo.elapsedTime:0;let i=0;t?i=this.performanceInfo.totalGPUTimeSampler.last:this._rctx.gl.finish();const s=Math.max(e,i);this._animationTimestep.frame(s,r)}}readMainDepth(e,t){const{mainDepth:r,camera:i}=this._bindParameters;if(!r)return;const s=this.fboCache.acquire(this._framebufferSize.width,this._framebufferSize.height,"linear-depth");this._rctx.bindFramebuffer(s.fbo),i.setGLViewport(this._rctx),this._rctx.setScissorRect(e[0],e[1],e[2],e[3]),this._rctx.setScissorTestEnabled(!0),this._rctx.clearFramebuffer(I),this._compositingHelper.blitDepthToLinearDepth(this._bindParameters,r),this._rctx.setScissorTestEnabled(!1),this._rctx.setScissorRect(0,0,this._rctx.gl.canvas.width,this._rctx.gl.canvas.width),s.fbo?.readPixels(e[0],e[1],e[2],e[3],Se.RGBA,Ce.UNSIGNED_BYTE,t),s.release()}readHUDVisibility(e,t,r,i,s){this._bindParameters.hudVisibility?.fbo?.readPixels(e,t,r,i,Se.RGBA,Ce.UNSIGNED_BYTE,s)}readAccumulatedShadow(e){return this._shadowAccumulator.readAccumulatedShadow(e[0],e[1])}_renderEdges(e){const t=this._edgeView;if(!t?.shouldRender())return;const r=this._framebufferSize,i=this.fboCache.acquire(r.width,r.height,"edges"),s=()=>t.render(this._bindParameters,e),a=this._bindParameters.geometryDepth;this.renderToTargets(s,i,a??this._framebuffer.depth,I),this._framebuffer.bind(),this._compositingHelper.composite(this._bindParameters,i.getTexture()),i.release(),this.performanceInfo.advance(e===be.OPAQUE?Re.OPAQUE_EDGES:Re.TRANSPARENT_EDGES)}_renderOverlay(e){this._bindParameters.overlay=this.overlay?.render(e),this._bindParameters.overlay&&this.performanceInfo.advance(Re.OVERLAY)}_renderShadowMap(e,t,r){if(!this.shadowsEnabled)return;const{contentCamera:i}=this._bindParameters,s=this._shadowMap;s.start(e,t,r,this.isFeatureEnabled(_e.HighResolutionShadows),this.stage.view.qualitySettings.maximumPixelRatio),this._needsShadowHighlight?(this._renderShadowCascades(G.ShadowExcludeHighlight,this._shadowMap),s.copySnapshot(ge.ExcludeHighlight),this._renderShadowCascades(G.ShadowHighlight,this._shadowMap)):this._renderShadowCascades(G.Shadow),s.finish(),e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,i),this.performanceInfo.advance(Re.SHADOW_MAP)}_renderHighlightShadowMap(e,t,r){if(!this.shadowsEnabled||!this._needsShadowHighlight)return;const{contentCamera:i}=this._bindParameters,s=this._shadowMap;s.start(e,t,r,this.isFeatureEnabled(_e.HighResolutionShadows),this.stage.view.qualitySettings.maximumPixelRatio),this._renderShadowCascades(G.ShadowHighlight,this._shadowMap),s.moveSnapshot(ge.Highlight),s.finish(),e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,i),this.performanceInfo.advance(Re.SHADOW_MAP)}_precompileShadowCascades(e){for(const t of this._shadowMap.cascades)t.camera.setGLViewport(this._rctx),this._ensureBindParametersCamera(t.camera,t.camera),this._precompileAllGeometry(e)}_renderShadowCascades(e,t=this._shadowMap){t.bindFbo();for(const r of t.cascades)r.camera.setGLViewport(this._rctx),this._ensureBindParametersCamera(r.camera,r.camera),this.renderAllGeometry(e)}get _needsDepth(){return this._plugins.consumes(G.Depth)||this._nodes.requireGeometryDepth()||this.hasReflections||this._needsShadowHighlight||this._shadowAccumulator.active||this._debugNeedsDepth}_renderRemainingGeometryDepth(){const e=this._pluginInput.get("normals");e?(this._pluginInput.set(N.SSAO,this._renderSSAO()),this._needsDepth?(this._rctx.bindFramebuffer(e.fbo),this._rctx.clear(we.STENCIL),this._renderGeometryWithoutNormals(G.Depth),d(this._bindParameters.depth),this._bindParameters.depth=e.obtainDepthTexture(),this.performanceInfo.advance(Re.DEPTH)):(e.detachDepth(),this._bindParameters.depth=d(this._bindParameters.depth)),this.hasSSAO&&this._pluginInput.release("normals")):this._renderAllGeometryDepth()}_renderAllGeometryDepth(){if(!this._needsDepth)return void(this._bindParameters.depth=d(this._bindParameters.depth));const e=this._framebufferSize,t=this.fboCache.acquire(e.width,e.height,"depth",v.DEPTH24_STENCIL8);this._rctx.bindFramebuffer(t.fbo),this._rctx.clear(we.DEPTH|we.STENCIL),this.renderAllGeometry(G.Depth),d(this._bindParameters.depth),this._bindParameters.depth=t.obtainDepthTexture(),t.release(),this.performanceInfo.advance(Re.DEPTH)}_renderTerrainDepth(e){if(this._bindParameters.terrainDepthTest=e,this._bindParameters.cullAboveTerrain=e,!e)return void(this._bindParameters.terrainDepth=d(this._bindParameters.terrainDepth));const t=this._renderContext.output;this._renderContext.output=G.Depth;const r=this._framebufferSize,i=this.fboCache.acquire(r.width,r.height,"terrain depth",v.DEPTH24_STENCIL8);this._rctx.bindFramebuffer(i.fbo),this._rctx.clear(we.DEPTH|we.STENCIL),this._renderTransparentTerrain(),d(this._bindParameters.terrainDepth),this._bindParameters.terrainDepth=i.obtainDepthTexture(),this._renderContext.output=t,i.release()}_renderGeometryDepth(e){if(!e)return void(this._bindParameters.geometryDepth=d(this._bindParameters.geometryDepth));const t=this._renderContext.output,{width:r,height:i}=this._framebufferSize,s=this.fboCache.acquire(r,i,"geometry depth",v.DEPTH24_STENCIL8);this._rctx.bindFramebuffer(s.fbo),this._rctx.clear(we.DEPTH|we.STENCIL),this._renderOpaqueAndTransparentGeometry(G.Depth),this._renderContext.output=t,d(this._bindParameters.geometryDepth),this._bindParameters.geometryDepth=s.obtainDepthTexture(),s.release()}get _needsShadowDepthRange(){return this._shadowMap.enabled||this._shadowAccumulator.active}_computeShadowDepthRange(e){if(!this._needsShadowDepthRange)return $.zero;const t=ee(e,this._plugins.plugins,this.stage.layers,te.SHADOW_CASTERS);return t.union(this._plugins.queryDepthRange(e)),t.near=Math.max(e.near,t.near),t.far=Math.min(e.far,t.far),t}updateSceneDepthRange(e){if(!this.stage.view.state.isGlobal)return void(this.sceneDepthRange.value=$.infinite);if((this.stage.view.renderCoordsHelper?.getAltitude(e.eye)??0)<H)return void(this.sceneDepthRange.value=$.infinite);const t=e.clone();t.near=y,t.far=1e10;const r=ee(t,this._plugins.plugins,this.stage.layers,te.FULL_SCENE);r.union(this._plugins.queryDepthRange(t)),this.sceneDepthRange.value.far===r.far&&this.sceneDepthRange.value.near===r.near||(this.sceneDepthRange.value=r)}get _normalsRequired(){const e=this._nodes.require("normals",D.FINAL,D.COMPOSITE,D.OPAQUE,D.TRANSPARENT,N.VIEWSHED,N.LASERLINES);return(this.hasSSAO?1:0)+e}_precompilePrepasses(){this._normalsRequired&&this._precompileAllGeometry(G.Normal),this._needsDepth&&this._precompileAllGeometry(G.Depth),this.shadowsEnabled&&(this._needsShadowHighlight?(this._precompileShadowCascades(G.ShadowHighlight),this._precompileShadowCascades(G.ShadowExcludeHighlight),this._precompileShadowCascades(G.ShadowHighlight)):this._precompileShadowCascades(G.Shadow)),this._shadowAccumulator.active&&this._precompileAllGeometry(G.Shadow)}_renderNormals(){const e=this._normalsRequired;if(0===e)return;const t=this._framebufferSize,r=this.fboCache.acquire(t.width,t.height,"normals",U.RGBA8UNORM);r.acquireDepth(v.DEPTH24_STENCIL8),this._rctx.bindFramebuffer(r.fbo),this._rctx.clearFramebuffer(I,!0,!0),this._renderGeometryWithNormals(G.Normal);const i=this._nodes.optional("normals",D.FINAL,D.COMPOSITE,D.OPAQUE,D.TRANSPARENT,N.VIEWSHED);return r.retain(e+i-1),this.performanceInfo.advance(Re.NORMALS),r}_renderSSAO(){const e=this._pluginInput.get("normals");if(!this.hasSSAO||!e)return;const t=this._nodes.produce(N.SSAO,this._pluginInput);return this._bindParameters.ssao=t,t&&this.performanceInfo.advance(Re.SSAO),t}_precompileAllGeometry(e){const t=this._renderContext.output;this._renderContext.output=e,this._precompileOpaqueGeometry(),this._precompileTransparentGeometry(),this._plugins.precompile(pe.TRANSPARENT_TERRAIN),this._renderContext.output=t}renderAllGeometry(e){this._renderContext.output=e,this._renderOpaqueAndTransparentGeometry(e),this._renderTransparentTerrain()}precompileSlots(e,...t){for(const r of t)this._bindParameters.slot=r,e.precompile(this._renderContext)}precompileOccludedSlots(e,t){for(const r of t)this._renderContext.renderOccludedMask=r,this.precompileSlots(e,...Me);this._renderContext.renderOccludedMask=he}renderSlots(e,...t){for(const r of t)this._bindParameters.slot=r,e.forAll((e=>{const t=e.acquireTechniques(this._renderContext);t&&e.render(this._renderContext,t)}))}renderOccludedSlots(e,t){this._renderContext.renderOccludedMask=t,this.plugins.renderOccludedFlags>se.Occlude&&this._plugins.render(pe.OCCLUDED_TERRAIN),this.renderSlots(e,...Me),this._renderContext.renderOccludedMask=he}renderHUD(e){this._bindParameters.hudRenderStyle=e,this._plugins.render(pe.HUD_MATERIAL)}precompileViewshedShadowMap(){this._precompileAllGeometry(G.ViewshedShadow)}renderViewshedShadowMap(e){const{camera:t,contentCamera:r}=this._bindParameters,i=this._renderContext.output;e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,e),this.renderAllGeometry(G.ViewshedShadow),this._ensureBindParametersCamera(t,r),this._bindParameters.camera.setGLViewport(this._rctx),this._renderContext.output=i}_renderOpaqueAndTransparentGeometry(e){this._renderContext.output=e,this._renderOpaqueGeometry(),this._renderTransparentGeometry()}_renderGeometryWithNormals(e){this._renderContext.output=e,this._plugins.render(...He),this._renderTransparentTerrain()}_renderGeometryWithoutNormals(e){this._renderContext.output=e,this._plugins.render(...ye)}_precompileOpaqueGeometry(){this._plugins.precompile(...xe)}_renderOpaqueGeometry(){this._plugins.render(...xe)}_renderTransparentGeometry(){this._plugins.render(...Le)}get _hasTransparentTerrain(){return this._plugins.produces(G.Color,pe.TRANSPARENT_TERRAIN)}_renderTransparentTerrain(){const e=()=>this._plugins.render(pe.TRANSPARENT_TERRAIN);if(!q(this._renderContext.output))return void e();const t=this._framebufferSize,r=this.fboCache.acquire(t.width,t.height,"transparent terrain");return this.renderToTargets(e,r,this._framebuffer.depth,I),r}get _needsHUDVisibility(){return this._plugins.produces(this._renderContext.output,pe.OCCLUSION_PIXELS)}_renderHUDVisibility(){if(!this._needsHUDVisibility)return void(this._bindParameters.hudVisibility=d(this._bindParameters.hudVisibility));const{width:e,height:t}=this._framebufferSize;let r=this._bindParameters.hudVisibility;r?.fbo?.width===e&&r?.fbo?.height===t||(r?.release(),r=this.fboCache.acquire(e,t,"hud visibility",U.RGBA4UNORM),this._bindParameters.hudVisibility=r);const i=this._bindParameters.geometryDepth;r.attachDepth(i||this._framebuffer.depth),this._rctx.bindFramebuffer(r.fbo),this._rctx.clearFramebuffer([0,1,0,1]),this._plugins.render(pe.OCCLUSION_PIXELS),r.detachDepth(),this._framebuffer.bind(),this.performanceInfo.advance(Re.HUD_VISIBILITY)}_renderLineCallouts(e){if(this._bindParameters.hudRenderStyle=e,e===V.Occluded){const e=()=>this._plugins.render(pe.LINE_CALLOUTS),t=this._framebufferSize,r=this.fboCache.acquireDepth(v.DEPTH16,t.width,t.height,"line callouts");this.renderToTargets(e,this._framebuffer.color,r,void 0,!0,!0),r.release()}else this._plugins.render(pe.LINE_CALLOUTS)}_precompileHUD(e){if(this._precompileHUDOutput(e),this._hasHighlights){const t=this._renderContext.output;this._renderContext.output=G.Highlight,this._precompileHUDOutput(e),this._renderContext.output=t}}_precompileHUDOutput(e){const t=this._bindParameters.hudRenderStyle;this._bindParameters.hudRenderStyle=e,this._oitEnabled&&q(this._renderContext.output)?(this._bindParameters.oitPass=ae.ColorAlpha,this._plugins.precompile(...ve),this._bindParameters.oitPass=ae.FrontFace,this._plugins.precompile(...ve),this._bindParameters.oitPass=ae.NONE):this._plugins.precompile(...ve),this._bindParameters.hudRenderStyle=t}_renderHUD(e,t,r){if(this._pluginsHas.hudElements){if(this._oitEnabled){const i=this._renderOIT(Ne.HUD,r,e);this._rctx.bindFramebuffer(t.fbo),this._compositingHelper.compositePreMultipliedAlpha(this._bindParameters,i.getTexture()),i.release()}else if(this._renderContext.output=r,e===V.Occluded){const t=()=>this._renderHUDElements(e),r=this._framebufferSize,i=this.fboCache.acquireDepth(v.DEPTH16,r.width,r.height,"hud");this.renderToTargets(t,this._framebuffer.color,i,void 0,!0,!0),i.release()}else t.acquireDepth(v.DEPTH16),this._rctx.bindFramebuffer(t.fbo),this._renderHUDElements(e),t.detachDepth();this.performanceInfo.advance(e===V.Occluded?Re.HUD_OCCLUDED:Re.HUD)}}_renderHUDElements(e){this._bindParameters.hudRenderStyle=e,this._plugins.render(...ve)}get _needsShadowHighlight(){return this.shadowsEnabled&&this._plugins.produces(G.ShadowHighlight,pe.OPAQUE_MATERIAL)}_renderHighlightPrepass(){if(!this._hasHighlights)return;const{fboCache:e,_rctx:t,_bindParameters:r}=this,i=this._framebufferSize,{highlights:s}=r,a=e.acquire(i.width,i.height,"highlights",s.length>k?U.RG8UINT:U.R8UINT);a.acquireDepth(v.DEPTH24_STENCIL8),t.bindFramebuffer(a.fbo);const{gl:n}=t;return n.clearBufferuiv(n.COLOR,0,[0,0,0,0]),this._renderContext.output=G.Highlight,t.bindFramebuffer(a.fbo),z(t,e,i,r,(()=>this._renderHighlightGeometries())),this.performanceInfo.advance(Re.HIGHLIGHTS),a}_renderHighlightGeometries(){this._plugins.render(...Ue),this._rctx.clear(we.DEPTH),this._renderHUDElements(V.Both)}_renderShadowAccumulation(e,t,r){this._shadowAccumulator.updateDepthRange(e),this._shadowAccumulator.accumulating&&this._bindParameters.depth&&this._shadowAccumulator.renderAccumulation(this._bindParameters.depth,t,r)&&this.performanceInfo.advance(Re.ACCUMULATED_SHADOWS)}_precompileTransparentGeometry(){this._oitEnabled&&q(this._renderContext.output)?(this._bindParameters.oitPass=ae.ColorAlpha,this._plugins.precompile(...Le),this._bindParameters.oitPass=ae.FrontFace,this._plugins.precompile(...Le),this._bindParameters.oitPass=ae.NONE):this._plugins.precompile(...Le)}_renderOIT(e,t,r=V.Both){const i=e===Ne.HUD,s=this._framebufferSize,a=i?this.fboCache.acquire(s.width,s.height,"oit hud composite"):null,n=i?()=>this._renderHUDElements(r):()=>this._renderTransparentGeometry(),h=this._bindParameters,o=this._renderContext.output;this._renderContext.output=t,h.oitPass=ae.ColorAlpha;const d=a?"oit hud color+alpha":"oit color+alpha",l=this.fboCache.acquire(s.width,s.height,d,U.RGBA16FLOAT),_=t===G.ColorEmission;_&&l.acquireColor(Ie,U.RGBA16FLOAT,"emissive"),l.acquireColor(_?Oe:Ie,U.R16FLOAT),a||l.attachDepth(this._framebuffer.depth),this._rctx.bindFramebuffer(l.fbo),this._rctx.clearFramebuffer([0,0,0,1]),_&&this._rctx.clearBuffer(1,C),n(),l.detachDepth(),h.oitPass=ae.FrontFace;const u=this.fboCache.acquire(s.width,s.height,a?"oit hud front":"oit front");return _&&u.acquireColor(Ie,U.RGBA16FLOAT,"emissive"),a?u.acquireDepth(v.DEPTH16):u.attachDepth(this._framebuffer.depth),this._rctx.bindFramebuffer(u.fbo),this._rctx.clearFramebuffer(I,!!a),n(),u.detachDepth(),h.oitPass=ae.NONE,a?(this._rctx.bindFramebuffer(a.fbo),this._rctx.setClearColor(0,0,0,1e-13),this._rctx.clear(we.COLOR)):this._framebuffer.bind(),this._oitblend??=new Y(this._techniques),this._oitblend.blend(this._rctx,l,u,h,_),a?.detachDepth(),u.release(),l.release(),this._renderContext.output=o,a}_renderOpaque(e){const t=this.plugins.produces(G.Color,...xe);if(t){this._plugins.render(pe.INTEGRATED_MESH,pe.OPAQUE_TERRAIN);const e=this._framebuffer;e.update((e=>this._renderNodes(N.OPAQUE_TERRAIN,e))),e.bind(),this._plugins.render(pe.OPAQUE_MATERIAL,pe.OPAQUE_MATERIAL_WITHOUT_NORMALS)}const r=this._framebuffer;r.update((e=>this._renderNodes(D.OPAQUE,e,t))),this.fboCache.debugCallback?.(D.OPAQUE,r.color.fbo),r.update((e=>this._renderNodes(N.OPAQUE_ENVIRONMENT,e))),this.fboCache.debugCallback?.(N.OPAQUE_ENVIRONMENT,r.color.fbo),this._renderTerrainDepth(e),this._renderEdges(be.OPAQUE)}_renderTransparent(e,t,r){const i=this._framebuffer;i.bind(),this._renderPlugins(pe.VOXEL,Re.VOXEL),this._renderHiddenTransparentEdges(),e&&(this._oitEnabled?this._renderOIT(Ne.Geometry,r):this._renderTransparentGeometry()),i.update((t=>this._renderNodes(D.TRANSPARENT,t,e))),this.fboCache.debugCallback?.(D.TRANSPARENT,i.color.fbo),this._renderGeometryDepth(t),this._renderHUDVisibility(),t||this._plugins.render(pe.LINE_CALLOUTS),this._renderEdges(be.TRANSPARENT);const s=this._hasTransparentTerrain?this._renderTransparentTerrain():null;s&&(this.performanceInfo.advance(Re.TRANSPARENT_TERRAIN),this._bindParameters.hudVisibility&&(t?this._renderLineCallouts(V.Occluded):(this._rctx.bindFramebuffer(this._bindParameters.hudVisibility?.fbo),this._compositingHelper.compositeHUD(this._bindParameters,s.getTexture())),this._renderHUD(V.Occluded,i.color,r))),this._bindParameters.cullAboveTerrain=!1,s&&(i.bind(),this._compositingHelper.compositePreMultipliedAlpha(this._bindParameters,s.getTexture()),s.release(),t&&(this._renderEdges(be.OPAQUE),e&&(this._oitEnabled?this._renderOIT(Ne.Geometry,r):this._renderTransparentGeometry(),this.performanceInfo.advance(Re.TRANSPARENT)),this._renderEdges(be.TRANSPARENT))),this._bindParameters.ssao=d(this._bindParameters.ssao),t&&this._renderLineCallouts(V.NotOccluded),this._bindParameters.terrainDepthTest=!1,this._renderTransparentEnvironment()}_renderTransparentEnvironment(){this._shadowAccumulator.render(this._bindParameters),this.performanceInfo.advance(Re.APPLY_ACCUMULATED_SHADOWS),this._framebuffer.bind(),this._plugins.render(pe.TRANSPARENT_MATERIAL_WITHOUT_DEPTH),this.performanceInfo.advance(Re.TRANSPARENT_MATERIAL_WITHOUT_DEPTH)}_renderPlugins(e,t){this._plugins.produces(this._renderContext.output,e)&&(this._plugins.render(e),this.performanceInfo.advance(t))}_renderNodes(e,t,r=!1){if(t.setName(e),this._pluginInput.set(e,t),!this._nodes.produces(e))return r&&this.performanceInfo.advance(e),t;const i=this._nodes.render(t,this._pluginInput,this._releaseNormals);return this.performanceInfo.advance(e),i}_blitFBO(e,t=M,r=!0){return this._blit??=new W(this._techniques),this._blit.blit(this._rctx,e,t,this._bindParameters),this._pluginInput.set(e.name,t),r&&e.release(),t}_ensureBindParametersCamera(e,t){this._bindParameters.camera=e,this._bindParameters.contentCamera=t}_ensureBindParametersSSR(e){if(this._bindParameters.ssr.lastFrameColor){null==this._ssrEnableTime&&(this._ssrEnableTime=e),this._renderContext.lastFrameCamera.equals(this._bindParameters.camera)?this._reprojectionMatrix=R:(T(Ge,this._bindParameters.camera.viewMatrix),T(Fe,this._bindParameters.camera.projectionMatrix),E(qe,Ge,Fe),E(qe,this._renderContext.lastFrameCamera.viewMatrix,qe),E(qe,this._renderContext.lastFrameCamera.projectionMatrix,qe),this._reprojectionMatrix=qe);const t=this.stage.view.qualitySettings.fadeDuration;this._bindParameters.ssr.fadeFactor=t>0?Math.min(t,e-this._ssrEnableTime)/t:1,this._bindParameters.ssr.fadeFactor<1&&this._requestRender()}else this._reprojectionMatrix=R,this._ssrEnableTime=null}addRenderNode(e){this._nodes.add(e),this._requestRender()}removeRenderNode(e){this._nodes.remove(e),this._requestRender()}updateLighting(e,t,r,i){this._bindParameters.updateLighting(e,t,r,i),this._requestRender(J.UPDATE)}get usedMemory(){return{fbos:this.fboCache.usedMemory,plugins:this._plugins.usedMemory,edges:this.edgeView?.usedMemory??0}}renderToTargets(e,t,r,i,s=!1,a=!1){t.attachDepth(r),this._rctx.bindFramebuffer(t.fbo),this._rctx.clearFramebuffer(i,s,a),e(),t.detachDepth()}get test(){}};var Ne;e([f({readOnly:!0})],De.prototype,"fullResolutionAtmosphere",null),e([f()],De.prototype,"_edgeView",void 0),e([f()],De.prototype,"updating",null),De=e([b("esri.views.3d.webgl-engine.lib.Renderer")],De),function(e){e[e.Geometry=0]="Geometry",e[e.HUD=1]="HUD"}(Ne||(Ne={}));const He=[pe.INTEGRATED_MESH,pe.OPAQUE_TERRAIN,pe.OPAQUE_MATERIAL,pe.TRANSPARENT_MATERIAL],ye=[pe.OPAQUE_MATERIAL_WITHOUT_NORMALS,pe.TRANSPARENT_MATERIAL_WITHOUT_NORMALS],xe=[pe.INTEGRATED_MESH,pe.OPAQUE_TERRAIN,pe.OPAQUE_MATERIAL,pe.OPAQUE_MATERIAL_WITHOUT_NORMALS],Le=[pe.TRANSPARENT_MATERIAL,pe.TRANSPARENT_MATERIAL_WITHOUT_NORMALS],Me=[pe.OPAQUE_MATERIAL,pe.TRANSPARENT_MATERIAL,pe.TRANSPARENT_MATERIAL_WITHOUT_DEPTH],ve=[pe.LINE_CALLOUTS_HUD_DEPTH,pe.HUD_MATERIAL,pe.LABEL_MATERIAL],Ue=[pe.TRANSPARENT_MATERIAL,pe.TRANSPARENT_MATERIAL_WITHOUT_NORMALS,pe.OPAQUE_MATERIAL,pe.OPAQUE_MATERIAL_WITHOUT_NORMALS,pe.TRANSPARENT_TERRAIN,pe.INTEGRATED_MESH,pe.OPAQUE_TERRAIN],Fe=P(),Ge=P(),qe=P();function Ve(e){return t=>e.immediate.schedule(t)}export{De as Renderer};
5
+ import{_ as e}from"../../../../chunks/tslib.es6.js";import{update as t}from"../../../../core/arrayUtils.js";import{createTask as r}from"../../../../core/asyncUtils.js";import{unitRGBAFromColor as i}from"../../../../core/colorUtils.js";import has from"../../../../core/has.js";import{clamp as s,lerp as a}from"../../../../core/mathUtils.js";import{removeMaybe as n,abortMaybe as h,destroyMaybe as o,releaseMaybe as d}from"../../../../core/maybe.js";import{throwIfAborted as l}from"../../../../core/promiseUtils.js";import{watch as _,syncAndInitial as u,initial as p,sync as c}from"../../../../core/reactiveUtils.js";import{signal as m}from"../../../../core/signal.js";import{Milliseconds as g}from"../../../../core/time.js";import{property as f}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/Logger.js";import{subclass as b}from"../../../../core/accessorSupport/decorators/subclass.js";import{equals as A,invert as T,multiply as E}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{IDENTITY as R,create as P}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{s as S}from"../../../../chunks/vec42.js";import{ZEROS as C}from"../../../../core/libs/gl-matrix-2/factories/vec4f32.js";import{fromValues as w,ZEROS as I}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{pruneIndexArrays as O}from"../../../../geometry/support/Indices.js";import{RenderCategory as D,InternalRenderCategory as N}from"../../webgl.js";import{innerAtmosphereFadeStart as H}from"../../environment/atmosphereUtils.js";import{minNearDistanceInMeters as y}from"../../state/NearFarHeuristic.js";import{debugFlags as x}from"../../support/debugFlags.js";import{FBOCache as L,defaultWebGLFBO as M}from"../core/FBOCache.js";import{DepthFormat as v,ColorFormat as U}from"../core/FBOCacheFormats.js";import{RenderPassManager as F}from"../core/renderPasses/RenderPassManager.js";import{ShaderOutput as G,isColorOrColorEmission as q}from"../core/shaderLibrary/ShaderOutput.js";import{HUDRenderStyle as V}from"../core/shaderLibrary/hud/HUDRenderStyle.js";import{distanceFadeEnd as j}from"../core/shaderLibrary/shading/ScreenSpaceConstants.js";import{RenderNodes as B}from"../effects/RenderNodes.js";import{RenderPluginManager as Q}from"../effects/RenderPluginManager.js";import{Blit as W}from"../effects/blit/Blit.js";import{maxHighlightsPerChannel as k,renderHighlightBuffer as z}from"../effects/highlight/Highlight.js";import{OITBlend as Y}from"../effects/transparency/OITBlend.js";import{AnimationTimer as X}from"./AnimationTimer.js";import{AnimationTimeStep as K}from"./AnimationTimeStep.js";import{RenderRequestType as J}from"./basicInterfaces.js";import{BoundingInfo as Z}from"./BoundingInfo.js";import{DepthRange as $}from"./DepthRange.js";import{depthRangeFromScene as ee,DepthRangeMode as te}from"./depthRangeUtils.js";import{hudFragmentOpacityParameters as re}from"./hudFragmentOpacityParameters.js";import{MainFramebuffer as ie}from"./MainFramebuffer.js";import{RenderOccludedFlag as se}from"./Material.js";import{OITPass as ae}from"./OITPass.js";import{RenderContext as ne,defaultRenderOccludedMask as he}from"./RenderContext.js";import{RendererBase as oe}from"./RendererBase.js";import{RendererTarget as de}from"./rendererUtils.js";import{setupFeatureDefaults as le,RenderFeature as _e}from"./RenderFeature.js";import{RenderPluginInput as ue}from"./RenderPluginInput.js";import{RenderSlot as pe}from"./RenderSlot.js";import{ShadowAccumulator as ce}from"./ShadowAccumulator.js";import{ShadowMap as me,SnapshotSlot as ge}from"./ShadowMap.js";import fe from"./SliceHelper.js";import{Transparency as be}from"./edgeRendering/interfaces.js";import{MergedRenderer as Ae}from"../materials/renderers/MergedRenderer.js";import{RenderSceneResult as Te}from"../parts/renderUtils.js";import{RendererPerformanceInfo as Ee,PerformanceCategory as Re}from"../statistics/RendererPerformanceInfo.js";import{RenderState as Pe}from"../../../support/RenderState.js";import{PixelFormat as Se,PixelType as Ce,FramebufferBit as we,ColorAttachment1 as Ie,ColorAttachment2 as Oe}from"../../../webgl/enums.js";let De=class extends oe{constructor(e,t,r,s,a,n){super({stage:e}),this._techniques=r,this._rctx=s,this._compositingHelper=a,this._requestRender=n,this._pluginsHas={hudElements:!1,water:!1},this.renderPassManager=new F,this._isRendering=!1,this._inGlobeView=!1,this._backgroundColor=w(0,0,0,1),this._sliceHelper=new fe,this._blit=null,this._oitblend=null,this.sceneDepthRange=m($.infinite),this._state=m(Pe.IDLE),this._highQualityTransparencyEnabled=!0,this._ssrEnabled=!1,this._hasAnimations=!1,this._animationTimestep=new K,this._loadEdgeViewTask=null,this._edgeViewCallbacks=[],this._reprojectionMatrixVersion=m(0),this._lastFrameTime=g(0),this._renderHiddenTransparentEdges=()=>{},this._pluginInput=new ue,this._releaseNormals=e=>{e.some((({name:e})=>"normals"===e))&&this._pluginInput.release("normals")},this._debugNeedsDepth=!1,this.fboCache=new L(s),this._renderStateFeatures=m(le(!has("disable-feature:high-quality-idle"),e.view.qualityProfile)),this._framebuffer=new ie(this.fboCache),this.performanceInfo=new Ee(this._rctx),this._shadowMap=new me(this.fboCache,e.viewingMode),this._shadowAccumulator=new ce(this.fboCache,r,e,(e=>{const t=this.shadowsEnabled;this._shadowMap.enabled=!0,this._ensureBindParametersCamera(e.camera,e.contentCamera),this._plugins.prepareRender(),this._shadowMap.enabled=t}),((t,r,i)=>{const s=e.view.qualitySettings.maximumPixelRatio;t.shadowMap.start(t.camera,r,i,!0,s),this._renderShadowCascades(G.Shadow,t.shadowMap),t.shadowMap.finish(),t.camera.setGLViewport(this._rctx),this._ensureBindParametersCamera(t.camera,t.contentCamera)}),n),this._renderContext=new ne(this._rctx,this._shadowMap,r),this._nodes=new B(this._renderContext),this._plugins=new Q({renderContext:this._renderContext,techniques:r,materials:t,requestRender:n,controller:e,fbos:this.fboCache,isFeatureEnabled:e=>this.isFeatureEnabled(e)}),this._plugins.add(this.renderPassManager),this.addHandles([_((()=>e.view.state.camera),(()=>n()),u),_((()=>x.EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES),(e=>{this._renderHiddenTransparentEdges=e?()=>this._renderEdges(be.TRANSPARENT):()=>{},n()}),p),_((()=>e.view.environment.background?.color),(e=>{const t=e?i(e):I;S(this._backgroundColor,t[0]*t[3],t[1]*t[3],t[2]*t[3],t[3]),n()}),u),_((()=>e.view.state.camera.relativeElevation),(e=>this._inGlobeView=(e??1/0)>=j),u),_((()=>this._bindParameters.clouds.fadeFactor),(()=>this._bindParameters.fadeLighting()),c),_((()=>this._bindParameters.clouds.data?.state),(()=>n()),c),_((()=>e.view.state.highlights),(e=>{this._bindParameters.highlights=e,n()}),p)])}destroy(){this._gpuTimerHandle=n(this._gpuTimerHandle),this._nodes.destroy(),this._framebuffer.dispose(),this._shadowMap.dispose(),this._shadowAccumulator.dispose(),this._loadEdgeViewTask=h(this._loadEdgeViewTask),this._edgeView=o(this._edgeView),this.renderPassManager.dispose(),this._releaseFBOs(),this._disposeOffscreenBuffers(),this.fboCache.destroy(),this._plugins.destroy(),this._blit=null,this._oitblend=null,Z.prune(),Ae.prune(),O()}get renderContext(){return this._renderContext}get _bindParameters(){return this._renderContext.bind}get _framebufferSize(){return this._framebuffer.size}updateRenderFeatures(e=null,t=!has("disable-feature:high-quality-idle")){this._renderStateFeatures.value=le(t,e),this._requestRender()}isFeatureEnabled(e,t=this._state.value){return this._renderStateFeatures.value.get(t,e)??!1}setFeatureEnabled(e,t,r){this._renderStateFeatures.mutate((i=>i.set(t,e,r))),this._requestRender()}get _highQualityTransparency(){return this._highQualityTransparencyEnabled||this.isFeatureEnabled(_e.HighQualityTransparency)}get hasReflections(){return this._pluginsHas.water&&(this._ssrEnabled||this.isFeatureEnabled(_e.WaterReflection))}get _hasHighlights(){return this._plugins.produces(G.Highlight,pe.OPAQUE_MATERIAL,pe.TRANSPARENT_MATERIAL,pe.DRAPED_MATERIAL,pe.HUD_MATERIAL,pe.LABEL_MATERIAL)}hasHighlight(e){return this._plugins.hasHighlight(e)}get _hasHUDHighlights(){return this._plugins.produces(G.Highlight,pe.HUD_MATERIAL,pe.LABEL_MATERIAL)}get hasSSAO(){return(this.stage.view.qualitySettings.ambientOcclusion||this.isFeatureEnabled(_e.SSAO))&&!this._inGlobeView}get hasSMAA(){return this.stage.view.qualitySettings.antialiasingEnabled||this.isFeatureEnabled(_e.Antialiasing)}get fullResolutionAtmosphere(){return this.stage.view.qualitySettings.highResolutionAtmosphere||this.isFeatureEnabled(_e.HighResolutionAtmosphere)}_releaseFBOs(){this._bindParameters.ssr.lastFrameColor=d(this._bindParameters.ssr.lastFrameColor),this._bindParameters.terrainDepth=d(this._bindParameters.terrainDepth),this._bindParameters.geometryDepth=d(this._bindParameters.geometryDepth)}_disposeOffscreenBuffers(){this._framebuffer.dispose(),this._disposeBindBuffers()}_disposeBindBuffers(){this._shadowMap.disposeOffscreenBuffers(),this._bindParameters.depth=d(this._bindParameters.depth),this._bindParameters.hudVisibility=d(this._bindParameters.hudVisibility)}get updating(){return this._loadEdgeViewTask&&!this._loadEdgeViewTask.finished||this._edgeView?.updating||this._shadowAccumulator.running||this._plugins.updating||!this.isCameraFinal}loadEdgeView(){return this._loadEdgeViewTask||(this._loadEdgeViewTask=r((async e=>{const{EdgeView:t}=await import("./edgeRendering/EdgeView.js");l(e);const r=this._edgeView=new t({rctx:this._rctx,renderSR:this.stage.view.renderSpatialReference,viewingMode:this.stage.view.stage.viewingMode,techniques:this._techniques,setNeedsRender:()=>this._requestRender(),schedule:Ve(this.stage.view.resourceController)});return this.addHandles(_((()=>r.updating),(()=>this._requestRender()),c)),this._requestRender(),this._edgeViewCallbacks.forEach((e=>e(r))),this._edgeViewCallbacks.length=0,r}))),this._loadEdgeViewTask.promise}withEdgeView(e){this.loadEdgeView(),null==this._edgeView?this._edgeViewCallbacks.push(e):e(this._edgeView)}get edgeView(){return this._edgeView}get isCameraFinal(){return this._reprojectionMatrixVersion.value>=0&&A(this._bindParameters.ssr.reprojectionMatrix,R)}set _reprojectionMatrix(e){t(this._bindParameters.ssr.reprojectionMatrix,e)&&this._reprojectionMatrixVersion.value++}get shadowsEnabled(){return!!this._shadowMap?.enabled}setParameters(e){const{_shadowMap:t,_bindParameters:r}=this;if(void 0!==e.qualitySettings?.reflections&&this._ssrEnabled!==e.qualitySettings.reflections&&(this._ssrEnabled=e.qualitySettings.reflections,this._requestRender()),void 0!==e.shadowMap&&this._shadowMap.enabled!==e.shadowMap&&(this._shadowMap.enabled=e.shadowMap,this._requestRender()),void 0!==e.shadowMapMaxCascades&&t.maxCascades!==e.shadowMapMaxCascades&&(t.maxCascades=e.shadowMapMaxCascades,this._requestRender()),null!=e.environment){if(null!=e.environment.weather){const t=e.environment.weather;this._bindParameters.weather=t,this._bindParameters.snowCover=!!e.weatherVisible&&null!=t&&"snowy"===t.type&&"enabled"===t.snowCover}const t="virtual"!==e.environment.lighting.type;r.enableFillLights!==t&&(r.enableFillLights=t,this._requestRender())}void 0!==e.highQualityTransparency&&this._highQualityTransparencyEnabled!==e.highQualityTransparency&&(this._highQualityTransparencyEnabled=e.highQualityTransparency,this._requestRender()),void 0!==e.shadowCast&&this._shadowAccumulator.setOptions(e.shadowCast)}set slice(e){this._sliceHelper.update(e)&&this._requestRender()}get plugins(){return this._plugins}get _hasOITSupport(){return this._rctx.driverTest.floatBufferBlend.result}get _oitEnabled(){return this._highQualityTransparency&&this._hasOITSupport}commit(e,t){return this._isRendering&&console.warn("Renderer.modify called while rendering"),!!super.commit(e,t,this._plugins.context)&&(this.updateHasFlags(),!0)}rendererAdded(e){this._plugins.add(e)}rendererRemoved(e){this._plugins.remove(e)}get occludedRequiresStencil(){return this.occludedRequiresOccludeeStencil||this.occludedRequiresIntegratedMeshStencil}get occludedRequiresOccludeeStencil(){return this._bindParameters.hasOccludees&&0!==(this.plugins.renderOccludedFlags&se.OccludeAndTransparentStencil)}get occludedRequiresIntegratedMeshStencil(){return this._plugins.produces(G.Color,pe.INTEGRATED_MESH)&&this._plugins.produces(G.Color,pe.OCCLUDED_GROUND)}updateHasFlags(){const has=this._pluginsHas;has.hudElements=this._plugins.produces(G.Color,...ve),has.water=this._plugins.produces(G.Normal,pe.DRAPED_WATER),this._bindParameters.hasOccludees=this._plugins.hasOccludees,this._requestRender()}updateAnimation(e,t){this._animationTimer??=new X(e.camera,t),this._animationTimer.advance(e.camera,t,this._animationTimeDilation);const r=this._hasAnimations;return this._hasAnimations=this._plugins.updateAnimation(this._animationTimer),this._hasAnimations=this._nodes.updateAnimation(this._animationTimer)||this._hasAnimations,this._hasAnimations!==r&&(this._gpuTimerHandle=r?n(this._gpuTimerHandle):this.performanceInfo.enableGPUPerformanceInfo()),this._hasAnimations}get animationTimestep(){return this._animationTimestep.value}get _animationTimeDilation(){return this._animationTimestep.timeDilation}resetAnimation(){this._animationTimestep.clear()}tick(){this.fboCache.clean()}render(e,t,r=de.Default,i=!1){try{return this._isRendering=!0,this._render(e,t,r,i)}catch(s){console.error(`Exception during rendering: ${s}`)}finally{this._isRendering=!1}return new Te(this._pluginInput.get(D.FINAL),null)}_updateHUDOccludedFragmentOpacity(e,t){const{idleOpacity:r,navigatingOpacity:i,maxDelta:n,tiltFadeStart:h,tiltFadeEnd:o,altitudeStart:d,altitudeEnd:l}=re,_=this.stage.view,u=_.stateManager.camera,p=_.qualitySettings.fadeDuration,c=e===Pe.IDLE?r:i,m=s((u.tilt-h)/(o-h),0,1),g=s(((u.position.z??0)-d)/(l-d),0,1),f=a(a(1,c,m),1,g),b=this._bindParameters.hudOccludedFragmentOpacity;if(p<=0||b===f||0===this._lastFrameTime||this._lastFrameTime>t)return this._bindParameters.hudOccludedFragmentOpacity=f,void(this._lastFrameTime=t);const A=t-this._lastFrameTime;this._lastFrameTime=t;const T=Math.max(1-r,Math.abs(r-i)),E=Math.min(T*A/p,n);E>=Math.abs(f-b)?this._bindParameters.hudOccludedFragmentOpacity=f:(this._bindParameters.hudOccludedFragmentOpacity=b+Math.sign(f-b)*E,this._requestRender())}_render(e,t,r=de.Default,i){this.performanceInfo.startFrame(),this.fboCache.frameStart(),this.fboCache.interactive=r===de.Default,this._disposeBindBuffers();const{camera:s,contentCamera:a,mode:n,alignPixelEnabled:h}=e;this._state.value=n;const o=this._nodes.produces("magnifier-color"),d=this._nodes.produces(D.FINAL),l=this._nodes.require("emissive",N.TRANSPARENT_ENVIRONMENT,D.COMPOSITE,D.FINAL)>0&&this._plugins.hasEmissions,_=l?G.ColorEmission:G.Color;this._renderContext.time=t,this._renderContext.output=_,this._bindParameters.oitPass=ae.NONE,this._bindParameters.alignPixelEnabled=h,this._bindParameters.decorations=!i,this._bindParameters.mainDepth=null;const u=!i||!this._sliceHelper.isDecoration;this._bindParameters.slicePlane=u?this._sliceHelper.plane:null,this._bindParameters.viewshedEnabled=this._nodes.produces(N.VIEWSHED),this._renderOverlay(t),s.setGLViewport(this._rctx);const p=this._framebuffer,c=p.initialize(s.fullWidth,s.fullHeight,this._backgroundColor,l);this.hasReflections?(c?.setName("last frame color"),this._bindParameters.ssr.lastFrameColor=c):c?.release(),this._ensureBindParametersCamera(s,a),this._updateHUDOccludedFragmentOpacity(n,t),this._plugins.prepareRender(),this._bindParameters.shadowHighlightsVisible=this._needsShadowHighlight&&!i;const m=this._highQualityTransparency&&this._hasTransparentTerrain,g=this._plugins.produces(G.Color,...Le);this._precompilePrepasses(),this.performanceInfo.advance(Re.PREPARE);const f=this._computeShadowDepthRange(s);this._renderShadowMap(s,this._bindParameters.lighting.mainLight.direction,f),this._pluginInput.set("normals",this._renderNormals()),this._renderRemainingGeometryDepth(),this._renderShadowAccumulation(f,s,a),this._ensureBindParametersSSR(t),this._precompileShaders(m,g,_),this._renderContext.output=_,p.bind(),this._bindParameters.mainDepth=p.depth.attachment,this._renderOpaque(m),this._renderTransparent(g,m,_),this._shadowMap.disposeMainBuffer(),this._pluginInput.set(N.FOCUSAREA,this._renderFocusAreaGeometry()),p.update((e=>this._renderNodes(N.TRANSPARENT_ENVIRONMENT,e))),p.update((e=>this._renderNodes(N.VIEWSHED,e))),p.update((e=>this._renderNodes(N.LASERLINES,e))),p.update((e=>this._renderNodes(N.FOCUSAREA_COLOR,e))),this._pluginInput.release(N.FOCUSAREA),p.update((e=>this._renderNodes(N.OCCLUDED,e))),this._pluginInput.set("highlights",this._renderHighlightPrepass()),this._renderHighlightShadowMap(s,this._bindParameters.lighting.mainLight.direction,f);const b=r===de.ObjectAndLayerID?this._renderObjectAndLayerIdColor():null;p.update((e=>this._renderNodes(D.COMPOSITE,e))),this._shadowMap.disposeOffscreenBuffers();const A=!(r!==de.Default||d||o&&!i),T=this._pluginInput.get(D.COMPOSITE),E=A?M:this.fboCache.acquire(T.fbo.width,T.fbo.height,N.ANTIALIASING),R=this._nodes.produces(N.ANTIALIASING)?this._renderNodes(N.ANTIALIASING,E):this._blitFBO(T,E,!1);let P;this._pluginInput.set(N.ANTIALIASING,R),this._hasHUDHighlights?(this._renderHUD(V.NotOccluded,R,_),P=this._renderNodes(N.HIGHLIGHTS,R)):(P=this._renderNodes(N.HIGHLIGHTS,R),this._renderHUD(V.NotOccluded,P,_));const S=this._renderNodes(N.MAGNIFIER,P);return o&&!i&&r===de.Default&&!d&&this._blitFBO(S),d?(S.attachDepth(p.depth),this._blitFBO(this._renderNodes(D.FINAL,S)),S.detachDepth()):this._pluginInput.set(D.FINAL,S),this._pluginInput.release("highlights"),this.onPostRender&&this.onPostRender(),this._releaseFBOs(),p.releaseDepth(),this._renderContext.lastFrameCamera.copyFrom(this._bindParameters.camera),this.fboCache.frameEnd(),this.performanceInfo.finishFrame(),r!==de.Default&&(this._releaseFBOs(),this._disposeOffscreenBuffers()),new Te(this._pluginInput.get(D.FINAL),b)}_precompileShaders(e,t,r){++this._plugins.context.techniques.precompiling,this._renderContext.output=r,this._precompileOpaqueGeometry(),this._nodes.precompile(N.OPAQUE_ENVIRONMENT),this._bindParameters.terrainDepthTest=e,this._bindParameters.cullAboveTerrain=e,this._renderContext.output=G.Depth,this._plugins.precompile(pe.TRANSPARENT_TERRAIN),e&&(this._precompileOpaqueGeometry(),this._precompileTransparentGeometry()),this._renderContext.output=r,this._plugins.precompile(pe.TRANSPARENT_TERRAIN),t&&(this._precompileTransparentGeometry(),this._hasTransparentTerrain&&(this._bindParameters.cullAboveTerrain=!1,this._precompileTransparentGeometry(),this._bindParameters.cullAboveTerrain=e)),this._nodes.precompile(N.FOCUSAREA),this._needsHUDVisibility&&this._plugins.precompile(pe.OCCLUSION_PIXELS),this._plugins.precompile(pe.LINE_CALLOUTS),this._precompileHUD(V.Occluded),this._bindParameters.terrainDepthTest=!1,this._bindParameters.cullAboveTerrain=!1,this._nodes.precompile(N.VIEWSHED,N.LASERLINES,N.FOCUSAREA_COLOR,N.OCCLUDED,N.ANTIALIASING,N.HIGHLIGHTS);const i=this._bindParameters;i.highlightMixTexture=i.highlights.length>1?this._rctx.emptyTexture:null,this._precompileHUD(V.NotOccluded),this._hasHighlights&&(i.highlights.forEach(((e,t)=>{i.highlightLevel=t,this._precompileAllGeometry(G.Highlight)})),i.highlightLevel=null),i.highlightMixTexture=null,this._nodes.precompile(D.COMPOSITE,N.MAGNIFIER),this._shadowAccumulator.precompile(),this._plugins.precompile(pe.TRANSPARENT_MATERIAL_WITHOUT_DEPTH),--this._plugins.context.techniques.precompiling}_renderFocusAreaGeometry(){const e=this._nodes.produce(N.FOCUSAREA,this._pluginInput);return e&&this.performanceInfo.advance(Re.FOCUS_AREA_MASK),e}_renderObjectAndLayerIdColor(){if(!this._nodes.produces("olid"))return null;const e=this._renderContext.output;++this._techniques.precompiling;const t=this._framebufferSize;let r=this.fboCache.acquire(t.width,t.height,"olid");return r.acquireDepth(v.DEPTH24_STENCIL8),r=this._nodes.render(r,this._pluginInput),--this._techniques.precompiling,this.performanceInfo.advance(Re.OBJECT_AND_LAYER_ID_COLOR),this._renderContext.output=e,r}finish(e){this._hasAnimations||this._animationTimestep.clear();const t=this.performanceInfo.gpuSamplingEnabled,r=e===J.BACKGROUND;if(r||t){const e=r?this.performanceInfo.elapsedTime:0;let i=0;t?i=this.performanceInfo.totalGPUTimeSampler.last:this._rctx.gl.finish();const s=Math.max(e,i);this._animationTimestep.frame(s,r)}}readMainDepth(e,t){const{mainDepth:r,camera:i}=this._bindParameters;if(!r)return;const s=this.fboCache.acquire(this._framebufferSize.width,this._framebufferSize.height,"linear-depth");this._rctx.bindFramebuffer(s.fbo),i.setGLViewport(this._rctx),this._rctx.setScissorRect(e[0],e[1],e[2],e[3]),this._rctx.setScissorTestEnabled(!0),this._rctx.clearFramebuffer(I),this._compositingHelper.blitDepthToLinearDepth(this._bindParameters,r),this._rctx.setScissorTestEnabled(!1),this._rctx.setScissorRect(0,0,this._rctx.gl.canvas.width,this._rctx.gl.canvas.width),s.fbo?.readPixels(e[0],e[1],e[2],e[3],Se.RGBA,Ce.UNSIGNED_BYTE,t),s.release()}readHUDVisibility(e,t,r,i,s){this._bindParameters.hudVisibility?.fbo?.readPixels(e,t,r,i,Se.RGBA,Ce.UNSIGNED_BYTE,s)}readAccumulatedShadow(e){return this._shadowAccumulator.readAccumulatedShadow(e[0],e[1])}_renderEdges(e){const t=this._edgeView;if(!t?.shouldRender())return;const r=this._framebufferSize,i=this.fboCache.acquire(r.width,r.height,"edges"),s=()=>t.render(this._bindParameters,e),a=this._bindParameters.geometryDepth;this.renderToTargets(s,i,a??this._framebuffer.depth,I),this._framebuffer.bind(),this._compositingHelper.composite(this._bindParameters,i.getTexture()),i.release(),this.performanceInfo.advance(e===be.OPAQUE?Re.OPAQUE_EDGES:Re.TRANSPARENT_EDGES)}_renderOverlay(e){this._bindParameters.overlay=this.overlay?.render(e),this._bindParameters.overlay&&this.performanceInfo.advance(Re.OVERLAY)}_renderShadowMap(e,t,r){if(!this.shadowsEnabled)return;const{contentCamera:i}=this._bindParameters,s=this._shadowMap;s.start(e,t,r,this.isFeatureEnabled(_e.HighResolutionShadows),this.stage.view.qualitySettings.maximumPixelRatio),this._needsShadowHighlight?(this._renderShadowCascades(G.ShadowExcludeHighlight,this._shadowMap),s.copySnapshot(ge.ExcludeHighlight),this._renderShadowCascades(G.ShadowHighlight,this._shadowMap)):this._renderShadowCascades(G.Shadow),s.finish(),e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,i),this.performanceInfo.advance(Re.SHADOW_MAP)}_renderHighlightShadowMap(e,t,r){if(!this.shadowsEnabled||!this._needsShadowHighlight)return;const{contentCamera:i}=this._bindParameters,s=this._shadowMap;s.start(e,t,r,this.isFeatureEnabled(_e.HighResolutionShadows),this.stage.view.qualitySettings.maximumPixelRatio),this._renderShadowCascades(G.ShadowHighlight,this._shadowMap),s.moveSnapshot(ge.Highlight),s.finish(),e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,i),this.performanceInfo.advance(Re.SHADOW_MAP)}_precompileShadowCascades(e){for(const t of this._shadowMap.cascades)t.camera.setGLViewport(this._rctx),this._ensureBindParametersCamera(t.camera,t.camera),this._precompileAllGeometry(e)}_renderShadowCascades(e,t=this._shadowMap){t.bindFbo();for(const r of t.cascades)r.camera.setGLViewport(this._rctx),this._ensureBindParametersCamera(r.camera,r.camera),this.renderAllGeometry(e)}get _needsDepth(){return this._plugins.consumes(G.Depth)||this._nodes.requireGeometryDepth()||this.hasReflections||this._needsShadowHighlight||this._shadowAccumulator.active||this._debugNeedsDepth}_renderRemainingGeometryDepth(){const e=this._pluginInput.get("normals");e?(this._pluginInput.set(N.SSAO,this._renderSSAO()),this._needsDepth?(this._rctx.bindFramebuffer(e.fbo),this._rctx.clear(we.STENCIL),this._renderGeometryWithoutNormals(G.Depth),d(this._bindParameters.depth),this._bindParameters.depth=e.obtainDepthTexture(),this.performanceInfo.advance(Re.DEPTH)):(e.detachDepth(),this._bindParameters.depth=d(this._bindParameters.depth)),this.hasSSAO&&this._pluginInput.release("normals")):this._renderAllGeometryDepth()}_renderAllGeometryDepth(){if(!this._needsDepth)return void(this._bindParameters.depth=d(this._bindParameters.depth));const e=this._framebufferSize,t=this.fboCache.acquire(e.width,e.height,"depth",v.DEPTH24_STENCIL8);this._rctx.bindFramebuffer(t.fbo),this._rctx.clear(we.DEPTH|we.STENCIL),this.renderAllGeometry(G.Depth),d(this._bindParameters.depth),this._bindParameters.depth=t.obtainDepthTexture(),t.release(),this.performanceInfo.advance(Re.DEPTH)}_renderTerrainDepth(e){if(this._bindParameters.terrainDepthTest=e,this._bindParameters.cullAboveTerrain=e,!e)return void(this._bindParameters.terrainDepth=d(this._bindParameters.terrainDepth));const t=this._renderContext.output;this._renderContext.output=G.Depth;const r=this._framebufferSize,i=this.fboCache.acquire(r.width,r.height,"terrain depth",v.DEPTH24_STENCIL8);this._rctx.bindFramebuffer(i.fbo),this._rctx.clear(we.DEPTH|we.STENCIL),this._renderTransparentTerrain(),d(this._bindParameters.terrainDepth),this._bindParameters.terrainDepth=i.obtainDepthTexture(),this._renderContext.output=t,i.release()}_renderGeometryDepth(e){if(!e)return void(this._bindParameters.geometryDepth=d(this._bindParameters.geometryDepth));const t=this._renderContext.output,{width:r,height:i}=this._framebufferSize,s=this.fboCache.acquire(r,i,"geometry depth",v.DEPTH24_STENCIL8);this._rctx.bindFramebuffer(s.fbo),this._rctx.clear(we.DEPTH|we.STENCIL),this._renderOpaqueAndTransparentGeometry(G.Depth),this._renderContext.output=t,d(this._bindParameters.geometryDepth),this._bindParameters.geometryDepth=s.obtainDepthTexture(),s.release()}get _needsShadowDepthRange(){return this._shadowMap.enabled||this._shadowAccumulator.active}_computeShadowDepthRange(e){if(!this._needsShadowDepthRange)return $.zero;const t=ee(e,this._plugins.plugins,this.stage.layers,te.SHADOW_CASTERS);return t.union(this._plugins.queryDepthRange(e)),t.near=Math.max(e.near,t.near),t.far=Math.min(e.far,t.far),t}updateSceneDepthRange(e){if(!this.stage.view.state.isGlobal)return void(this.sceneDepthRange.value=$.infinite);if((this.stage.view.renderCoordsHelper?.getAltitude(e.eye)??0)<H)return void(this.sceneDepthRange.value=$.infinite);const t=e.clone();t.near=y,t.far=1e10;const r=ee(t,this._plugins.plugins,this.stage.layers,te.FULL_SCENE);r.union(this._plugins.queryDepthRange(t)),this.sceneDepthRange.value.far===r.far&&this.sceneDepthRange.value.near===r.near||(this.sceneDepthRange.value=r)}get _normalsRequired(){const e=this._nodes.require("normals",D.FINAL,D.COMPOSITE,D.OPAQUE,D.TRANSPARENT,N.VIEWSHED,N.LASERLINES);return(this.hasSSAO?1:0)+e}_precompilePrepasses(){this._normalsRequired&&this._precompileAllGeometry(G.Normal),this._needsDepth&&this._precompileAllGeometry(G.Depth),this.shadowsEnabled&&(this._needsShadowHighlight?(this._precompileShadowCascades(G.ShadowHighlight),this._precompileShadowCascades(G.ShadowExcludeHighlight),this._precompileShadowCascades(G.ShadowHighlight)):this._precompileShadowCascades(G.Shadow)),this._shadowAccumulator.active&&this._precompileAllGeometry(G.Shadow)}_renderNormals(){const e=this._normalsRequired;if(0===e)return;const t=this._framebufferSize,r=this.fboCache.acquire(t.width,t.height,"normals",U.RGBA8UNORM);r.acquireDepth(v.DEPTH24_STENCIL8),this._rctx.bindFramebuffer(r.fbo),this._rctx.clearFramebuffer(I,!0,!0),this._renderGeometryWithNormals(G.Normal);const i=this._nodes.optional("normals",D.FINAL,D.COMPOSITE,D.OPAQUE,D.TRANSPARENT,N.VIEWSHED);return r.retain(e+i-1),this.performanceInfo.advance(Re.NORMALS),r}_renderSSAO(){const e=this._pluginInput.get("normals");if(!this.hasSSAO||!e)return;const t=this._nodes.produce(N.SSAO,this._pluginInput);return this._bindParameters.ssao=t,t&&this.performanceInfo.advance(Re.SSAO),t}_precompileAllGeometry(e){const t=this._renderContext.output;this._renderContext.output=e,this._precompileOpaqueGeometry(),this._precompileTransparentGeometry(),this._plugins.precompile(pe.TRANSPARENT_TERRAIN),this._renderContext.output=t}renderAllGeometry(e){this._renderContext.output=e,this._renderOpaqueAndTransparentGeometry(e),this._renderTransparentTerrain()}precompileSlots(e,...t){for(const r of t)this._bindParameters.slot=r,e.precompile(this._renderContext)}precompileOccludedSlots(e,t){for(const r of t)this._renderContext.renderOccludedMask=r,this.precompileSlots(e,...Me);this._renderContext.renderOccludedMask=he}renderSlots(e,...t){for(const r of t)this._bindParameters.slot=r,e.forAll((e=>{const t=e.acquireTechniques(this._renderContext);t&&e.render(this._renderContext,t)}))}renderOccludedSlots(e,t){this._renderContext.renderOccludedMask=t,this.plugins.renderOccludedFlags>se.Occlude&&this._plugins.render(pe.OCCLUDED_GROUND),this.renderSlots(e,...Me),this._renderContext.renderOccludedMask=he}renderHUD(e){this._bindParameters.hudRenderStyle=e,this._plugins.render(pe.HUD_MATERIAL)}precompileViewshedShadowMap(){this._precompileAllGeometry(G.ViewshedShadow)}renderViewshedShadowMap(e){const{camera:t,contentCamera:r}=this._bindParameters,i=this._renderContext.output;e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,e),this.renderAllGeometry(G.ViewshedShadow),this._ensureBindParametersCamera(t,r),this._bindParameters.camera.setGLViewport(this._rctx),this._renderContext.output=i}_renderOpaqueAndTransparentGeometry(e){this._renderContext.output=e,this._renderOpaqueGeometry(),this._renderTransparentGeometry()}_renderGeometryWithNormals(e){this._renderContext.output=e,this._plugins.render(...He),this._renderTransparentTerrain()}_renderGeometryWithoutNormals(e){this._renderContext.output=e,this._plugins.render(...ye)}_precompileOpaqueGeometry(){this._plugins.precompile(...xe)}_renderOpaqueGeometry(){this._plugins.render(...xe)}_renderTransparentGeometry(){this._plugins.render(...Le)}get _hasTransparentTerrain(){return this._plugins.produces(G.Color,pe.TRANSPARENT_TERRAIN)}_renderTransparentTerrain(){const e=()=>this._plugins.render(pe.TRANSPARENT_TERRAIN);if(!q(this._renderContext.output))return void e();const t=this._framebufferSize,r=this.fboCache.acquire(t.width,t.height,"transparent terrain");return this.renderToTargets(e,r,this._framebuffer.depth,I),r}get _needsHUDVisibility(){return this._plugins.produces(this._renderContext.output,pe.OCCLUSION_PIXELS)}_renderHUDVisibility(){if(!this._needsHUDVisibility)return void(this._bindParameters.hudVisibility=d(this._bindParameters.hudVisibility));const{width:e,height:t}=this._framebufferSize;let r=this._bindParameters.hudVisibility;r?.fbo?.width===e&&r?.fbo?.height===t||(r?.release(),r=this.fboCache.acquire(e,t,"hud visibility",U.RGBA4UNORM),this._bindParameters.hudVisibility=r);const i=this._bindParameters.geometryDepth;r.attachDepth(i||this._framebuffer.depth),this._rctx.bindFramebuffer(r.fbo),this._rctx.clearFramebuffer([0,1,0,1]),this._plugins.render(pe.OCCLUSION_PIXELS),r.detachDepth(),this._framebuffer.bind(),this.performanceInfo.advance(Re.HUD_VISIBILITY)}_renderLineCallouts(e){if(this._bindParameters.hudRenderStyle=e,e===V.Occluded){const e=()=>this._plugins.render(pe.LINE_CALLOUTS),t=this._framebufferSize,r=this.fboCache.acquireDepth(v.DEPTH16,t.width,t.height,"line callouts");this.renderToTargets(e,this._framebuffer.color,r,void 0,!0,!0),r.release()}else this._plugins.render(pe.LINE_CALLOUTS)}_precompileHUD(e){if(this._precompileHUDOutput(e),this._hasHighlights){const t=this._renderContext.output;this._renderContext.output=G.Highlight,this._precompileHUDOutput(e),this._renderContext.output=t}}_precompileHUDOutput(e){const t=this._bindParameters.hudRenderStyle;this._bindParameters.hudRenderStyle=e,this._oitEnabled&&q(this._renderContext.output)?(this._bindParameters.oitPass=ae.ColorAlpha,this._plugins.precompile(...ve),this._bindParameters.oitPass=ae.FrontFace,this._plugins.precompile(...ve),this._bindParameters.oitPass=ae.NONE):this._plugins.precompile(...ve),this._bindParameters.hudRenderStyle=t}_renderHUD(e,t,r){if(this._pluginsHas.hudElements){if(this._oitEnabled){const i=this._renderOIT(Ne.HUD,r,e);this._rctx.bindFramebuffer(t.fbo),this._compositingHelper.compositePreMultipliedAlpha(this._bindParameters,i.getTexture()),i.release()}else if(this._renderContext.output=r,e===V.Occluded){const t=()=>this._renderHUDElements(e),r=this._framebufferSize,i=this.fboCache.acquireDepth(v.DEPTH16,r.width,r.height,"hud");this.renderToTargets(t,this._framebuffer.color,i,void 0,!0,!0),i.release()}else t.acquireDepth(v.DEPTH16),this._rctx.bindFramebuffer(t.fbo),this._renderHUDElements(e),t.detachDepth();this.performanceInfo.advance(e===V.Occluded?Re.HUD_OCCLUDED:Re.HUD)}}_renderHUDElements(e){this._bindParameters.hudRenderStyle=e,this._plugins.render(...ve)}get _needsShadowHighlight(){return this.shadowsEnabled&&this._plugins.produces(G.ShadowHighlight,pe.OPAQUE_MATERIAL)}_renderHighlightPrepass(){if(!this._hasHighlights)return;const{fboCache:e,_rctx:t,_bindParameters:r}=this,i=this._framebufferSize,{highlights:s}=r,a=e.acquire(i.width,i.height,"highlights",s.length>k?U.RG8UINT:U.R8UINT);a.acquireDepth(v.DEPTH24_STENCIL8),t.bindFramebuffer(a.fbo);const{gl:n}=t;return n.clearBufferuiv(n.COLOR,0,[0,0,0,0]),this._renderContext.output=G.Highlight,t.bindFramebuffer(a.fbo),z(t,e,i,r,(()=>this._renderHighlightGeometries())),this.performanceInfo.advance(Re.HIGHLIGHTS),a}_renderHighlightGeometries(){this._plugins.render(...Ue),this._rctx.clear(we.DEPTH),this._renderHUDElements(V.Both)}_renderShadowAccumulation(e,t,r){this._shadowAccumulator.updateDepthRange(e),this._shadowAccumulator.accumulating&&this._bindParameters.depth&&this._shadowAccumulator.renderAccumulation(this._bindParameters.depth,t,r)&&this.performanceInfo.advance(Re.ACCUMULATED_SHADOWS)}_precompileTransparentGeometry(){this._oitEnabled&&q(this._renderContext.output)?(this._bindParameters.oitPass=ae.ColorAlpha,this._plugins.precompile(...Le),this._bindParameters.oitPass=ae.FrontFace,this._plugins.precompile(...Le),this._bindParameters.oitPass=ae.NONE):this._plugins.precompile(...Le)}_renderOIT(e,t,r=V.Both){const i=e===Ne.HUD,s=this._framebufferSize,a=i?this.fboCache.acquire(s.width,s.height,"oit hud composite"):null,n=i?()=>this._renderHUDElements(r):()=>this._renderTransparentGeometry(),h=this._bindParameters,o=this._renderContext.output;this._renderContext.output=t,h.oitPass=ae.ColorAlpha;const d=a?"oit hud color+alpha":"oit color+alpha",l=this.fboCache.acquire(s.width,s.height,d,U.RGBA16FLOAT),_=t===G.ColorEmission;_&&l.acquireColor(Ie,U.RGBA16FLOAT,"emissive"),l.acquireColor(_?Oe:Ie,U.R16FLOAT),a||l.attachDepth(this._framebuffer.depth),this._rctx.bindFramebuffer(l.fbo),this._rctx.clearFramebuffer([0,0,0,1]),_&&this._rctx.clearBuffer(1,C),n(),l.detachDepth(),h.oitPass=ae.FrontFace;const u=this.fboCache.acquire(s.width,s.height,a?"oit hud front":"oit front");return _&&u.acquireColor(Ie,U.RGBA16FLOAT,"emissive"),a?u.acquireDepth(v.DEPTH16):u.attachDepth(this._framebuffer.depth),this._rctx.bindFramebuffer(u.fbo),this._rctx.clearFramebuffer(I,!!a),n(),u.detachDepth(),h.oitPass=ae.NONE,a?(this._rctx.bindFramebuffer(a.fbo),this._rctx.setClearColor(0,0,0,1e-13),this._rctx.clear(we.COLOR)):this._framebuffer.bind(),this._oitblend??=new Y(this._techniques),this._oitblend.blend(this._rctx,l,u,h,_),a?.detachDepth(),u.release(),l.release(),this._renderContext.output=o,a}_renderOpaque(e){const t=this.plugins.produces(G.Color,...xe);if(t){this._plugins.render(pe.INTEGRATED_MESH,pe.OPAQUE_TERRAIN);const e=this._framebuffer;e.update((e=>this._renderNodes(N.OPAQUE_TERRAIN,e))),e.bind(),this._plugins.render(pe.OPAQUE_MATERIAL,pe.OPAQUE_MATERIAL_WITHOUT_NORMALS)}const r=this._framebuffer;r.update((e=>this._renderNodes(D.OPAQUE,e,t))),this.fboCache.debugCallback?.(D.OPAQUE,r.color.fbo),r.update((e=>this._renderNodes(N.OPAQUE_ENVIRONMENT,e))),this.fboCache.debugCallback?.(N.OPAQUE_ENVIRONMENT,r.color.fbo),this._renderTerrainDepth(e),this._renderEdges(be.OPAQUE)}_renderTransparent(e,t,r){const i=this._framebuffer;i.bind(),this._renderPlugins(pe.VOXEL,Re.VOXEL),this._renderHiddenTransparentEdges(),e&&(this._oitEnabled?this._renderOIT(Ne.Geometry,r):this._renderTransparentGeometry()),i.update((t=>this._renderNodes(D.TRANSPARENT,t,e))),this.fboCache.debugCallback?.(D.TRANSPARENT,i.color.fbo),this._renderGeometryDepth(t),this._renderHUDVisibility(),t||this._plugins.render(pe.LINE_CALLOUTS),this._renderEdges(be.TRANSPARENT);const s=this._hasTransparentTerrain?this._renderTransparentTerrain():null;s&&(this.performanceInfo.advance(Re.TRANSPARENT_TERRAIN),this._bindParameters.hudVisibility&&(t?this._renderLineCallouts(V.Occluded):(this._rctx.bindFramebuffer(this._bindParameters.hudVisibility?.fbo),this._compositingHelper.compositeHUD(this._bindParameters,s.getTexture())),this._renderHUD(V.Occluded,i.color,r))),this._bindParameters.cullAboveTerrain=!1,s&&(i.bind(),this._compositingHelper.compositePreMultipliedAlpha(this._bindParameters,s.getTexture()),s.release(),t&&(this._renderEdges(be.OPAQUE),e&&(this._oitEnabled?this._renderOIT(Ne.Geometry,r):this._renderTransparentGeometry(),this.performanceInfo.advance(Re.TRANSPARENT)),this._renderEdges(be.TRANSPARENT))),this._bindParameters.ssao=d(this._bindParameters.ssao),t&&this._renderLineCallouts(V.NotOccluded),this._bindParameters.terrainDepthTest=!1,this._renderTransparentEnvironment()}_renderTransparentEnvironment(){this._shadowAccumulator.render(this._bindParameters),this.performanceInfo.advance(Re.APPLY_ACCUMULATED_SHADOWS),this._framebuffer.bind(),this._plugins.render(pe.TRANSPARENT_MATERIAL_WITHOUT_DEPTH),this.performanceInfo.advance(Re.TRANSPARENT_MATERIAL_WITHOUT_DEPTH)}_renderPlugins(e,t){this._plugins.produces(this._renderContext.output,e)&&(this._plugins.render(e),this.performanceInfo.advance(t))}_renderNodes(e,t,r=!1){if(t.setName(e),this._pluginInput.set(e,t),!this._nodes.produces(e))return r&&this.performanceInfo.advance(e),t;const i=this._nodes.render(t,this._pluginInput,this._releaseNormals);return this.performanceInfo.advance(e),i}_blitFBO(e,t=M,r=!0){return this._blit??=new W(this._techniques),this._blit.blit(this._rctx,e,t,this._bindParameters),this._pluginInput.set(e.name,t),r&&e.release(),t}_ensureBindParametersCamera(e,t){this._bindParameters.camera=e,this._bindParameters.contentCamera=t}_ensureBindParametersSSR(e){if(this._bindParameters.ssr.lastFrameColor){null==this._ssrEnableTime&&(this._ssrEnableTime=e),this._renderContext.lastFrameCamera.equals(this._bindParameters.camera)?this._reprojectionMatrix=R:(T(Ge,this._bindParameters.camera.viewMatrix),T(Fe,this._bindParameters.camera.projectionMatrix),E(qe,Ge,Fe),E(qe,this._renderContext.lastFrameCamera.viewMatrix,qe),E(qe,this._renderContext.lastFrameCamera.projectionMatrix,qe),this._reprojectionMatrix=qe);const t=this.stage.view.qualitySettings.fadeDuration;this._bindParameters.ssr.fadeFactor=t>0?Math.min(t,e-this._ssrEnableTime)/t:1,this._bindParameters.ssr.fadeFactor<1&&this._requestRender()}else this._reprojectionMatrix=R,this._ssrEnableTime=null}addRenderNode(e){this._nodes.add(e),this._requestRender()}removeRenderNode(e){this._nodes.remove(e),this._requestRender()}updateLighting(e,t,r,i){this._bindParameters.updateLighting(e,t,r,i),this._requestRender(J.UPDATE)}get usedMemory(){return{fbos:this.fboCache.usedMemory,plugins:this._plugins.usedMemory,edges:this.edgeView?.usedMemory??0}}renderToTargets(e,t,r,i,s=!1,a=!1){t.attachDepth(r),this._rctx.bindFramebuffer(t.fbo),this._rctx.clearFramebuffer(i,s,a),e(),t.detachDepth()}get test(){}};var Ne;e([f({readOnly:!0})],De.prototype,"fullResolutionAtmosphere",null),e([f()],De.prototype,"_edgeView",void 0),e([f()],De.prototype,"updating",null),De=e([b("esri.views.3d.webgl-engine.lib.Renderer")],De),function(e){e[e.Geometry=0]="Geometry",e[e.HUD=1]="HUD"}(Ne||(Ne={}));const He=[pe.INTEGRATED_MESH,pe.OPAQUE_TERRAIN,pe.OPAQUE_MATERIAL,pe.TRANSPARENT_MATERIAL],ye=[pe.OPAQUE_MATERIAL_WITHOUT_NORMALS,pe.TRANSPARENT_MATERIAL_WITHOUT_NORMALS],xe=[pe.INTEGRATED_MESH,pe.OPAQUE_TERRAIN,pe.OPAQUE_MATERIAL,pe.OPAQUE_MATERIAL_WITHOUT_NORMALS],Le=[pe.TRANSPARENT_MATERIAL,pe.TRANSPARENT_MATERIAL_WITHOUT_NORMALS],Me=[pe.OPAQUE_MATERIAL,pe.TRANSPARENT_MATERIAL,pe.TRANSPARENT_MATERIAL_WITHOUT_DEPTH],ve=[pe.LINE_CALLOUTS_HUD_DEPTH,pe.HUD_MATERIAL,pe.LABEL_MATERIAL],Ue=[pe.TRANSPARENT_MATERIAL,pe.TRANSPARENT_MATERIAL_WITHOUT_NORMALS,pe.OPAQUE_MATERIAL,pe.OPAQUE_MATERIAL_WITHOUT_NORMALS,pe.TRANSPARENT_TERRAIN,pe.INTEGRATED_MESH,pe.OPAQUE_TERRAIN],Fe=P(),Ge=P(),qe=P();function Ve(e){return t=>e.immediate.schedule(t)}export{De as Renderer};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../chunks/tslib.es6.js";import t from"../../../../core/Accessor.js";import{sliceEquals as r}from"../../../../core/arrayUtils.js";import"../../../../core/has.js";import{smoothstep as i}from"../../../../core/mathUtils.js";import{disposeMaybe as s}from"../../../../core/maybe.js";import{watch as o,syncAndInitial as a,sync as n}from"../../../../core/reactiveUtils.js";import{signal as c}from"../../../../core/signal.js";import{property as h}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/Logger.js";import{subclass as u}from"../../../../core/accessorSupport/decorators/subclass.js";import{c as m,G as l}from"../../../../chunks/vec32.js";import{create as _}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ReadShadowMapPassParameters as p}from"../core/shaderLibrary/shading/ReadShadowMap.glsl.js";import{BindParameters as d}from"./BindParameters.js";import{DepthRange as f}from"./DepthRange.js";import{createQuadVAO as g}from"./glUtil3D.js";import{ShadowCastRenderer as b,shadowCastDisabledElevationThreshold as v,shadowCastDisableElevationMax as S,shadowCastDisableElevationMin as w}from"./ShadowCastRenderer.js";import{ShadowMap as F}from"./ShadowMap.js";import{S as y}from"../../../../chunks/ShadowCastAccumulate.glsl.js";import{ShadowCastAccumulateTechnique as A}from"../shaders/ShadowCastAccumulateTechnique.js";import{ShadowCastAccumulateTechniqueConfiguration as R,ShadowCastAccumulateIndex as x}from"../shaders/ShadowCastAccumulateTechniqueConfiguration.js";import{ShadowCastClearTechnique as C}from"../shaders/ShadowCastClearTechnique.js";import{TaskPriority as j}from"../../../support/Scheduler.js";import{SizedPixelFormat as P,PixelFormat as q,PixelType as D,TextureWrapMode as T,FramebufferBit as E}from"../../../webgl/enums.js";import{FramebufferObject as O}from"../../../webgl/FramebufferObject.js";import{TextureDescriptor as M}from"../../../webgl/TextureDescriptor.js";import{vertexCount as B}from"../../../webgl/Util.js";let L=class extends t{updateDepthRange(e){this._depthRange.equals(e)||(this._depthRange=e)}constructor(e,t,r,i,s,c){super({}),this.fbos=e,this._techniques=t,this._stage=r,this._prepareForShadowMapPass=i,this._renderToShadowMap=s,this._requestRender=c,this._primarySet=new G(new R(x.PRIMARY),(()=>this._requestRenderIfEnabled())),this._contextSet=new G(new R(x.CONTEXT),(()=>this._requestRenderIfEnabled())),this._passParameters=new p,this._depthRange=f.zero,this._previewing=!1,this._cameraForcedForScreenshot=!1,this._shadowAccumulatorKey=Symbol("shadowAccumulator"),this._rctx=e.rctx,this._bindParameters=new d(new F(e,r.viewingMode)),this._bindParameters.shadowMap.enabled=!0,this._vao=g(this._rctx),this._accumulationRenderer=new b(t,this._rctx,this,c);const h=this._stage.view.resourceController.scheduler;this.addHandles([h.registerTask(j.SHADOW_ACCUMULATOR,this),o((()=>r.renderView),(e=>{this.removeHandles(I),null!=e&&this.addHandles(e.events.on("force-camera-for-screenshot",(()=>this._cameraForcedForScreenshot=!0)),I)}),a),o((()=>this._previewing),(()=>this._requestRenderIfEnabled()),n),o((()=>2===this._numActive),(()=>this._numActiveChanged()),n),o((()=>this._depthRange),(()=>this._invalidateAccumulationSets()),n)],this._shadowAccumulatorKey);for(const o of this._accumulationSets())o.precompile(t)}*_accumulationSets(){yield this._primarySet,yield this._contextSet}normalizeCtorArgs(){return{}}dispose(){this._disable(),this.removeHandles(this._shadowAccumulatorKey),this._accumulationRenderer=s(this._accumulationRenderer),this._bindParameters.shadowMap.dispose(),this._fbo=s(this._fbo),this._vao=s(this._vao);for(const e of this._accumulationSets())e.destroy()}get computedSamples(){return[this._primarySet.progress,this._contextSet.progress]}get shadowCastTexture(){return this._fbo?.colorTexture}get accumulating(){return this.active&&this._previewing||this._refining}get _refining(){return this.active&&!this._doneAccumulating&&!this._previewing}get active(){return null!=this._fbo&&[...this._accumulationSets()].some((e=>e.active))}get canAccumulate(){return null!=this._bindParameters.depth&&this._depthRange!==f.zero&&this._opacityFromElevation>v}get _doneAccumulating(){return[...this._accumulationSets()].every((e=>e.doneAccumulating))}get _opacityFromElevation(){return this._accumulationRenderer.opacityFromElevation}set _opacityFromElevation(e){this._accumulationRenderer.opacityFromElevation=e}get _numActive(){return[...this._accumulationSets()].reduce(((e,t)=>e+(t.active?1:0)),0)}get _pixelFormat(){return 2===this._numActive?{pixelFormat:q.RG,internalFormat:P.RG8}:{pixelFormat:q.RED,internalFormat:P.R8}}get running(){return this._refining&&this.canAccumulate&&[...this._accumulationSets()].some((e=>e.running))}runTask(e){this._clearBuffersOnAccumulationStart(),this._prepareForShadowMapPass(this._bindParameters);let t=!1;for(const r of this._accumulationSets())this._runTaskForSet(r,e)&&(t=!0);t&&this._requestRender()}_runTaskForSet(e,t){let r=!1;for(;!t.done&&!e.doneAccumulating;)this._accumulateShadow(e),t.madeProgress(),r=!0;return r}renderAccumulation(e,t,r){if(this._updateCamera(t),this._bindParameters.contentCamera=r,this._bindParameters.depth=e,this._passParameters.origin=this._bindParameters.camera.center,this.notifyChange("canAccumulate"),!this.accumulating||!this.canAccumulate)return!1;this._previewing||this._cameraForcedForScreenshot?(this._clearFramebuffer(),this._reset()):this._clearBuffersOnAccumulationStart();const i=this._accumulateSetsForRenderFrame();return this._cameraForcedForScreenshot=!1,i}_clearBuffersOnAccumulationStart(){if([...this._accumulationSets()].every((e=>0===e.progress)))this._clearFramebuffer();else for(const e of this._accumulationSets())0===e.progress&&this._clearFramebufferForSet(this._fbo,e)}_accumulateSetsForRenderFrame(){let e=!1;for(const t of this._accumulationSets())this._accumulateSetForRenderFrame(t)&&(e=!0);return e&&this._requestRender(),e}_accumulateSetForRenderFrame(e){let t=this._cameraForcedForScreenshot?e.sampleCount:Math.min(U,e.sampleCount);t-=e.progress;for(let r=0;r<t;++r)this._accumulateShadow(e);return t>0}precompile(){this._accumulationRenderer.precompile()}render(e){this._accumulationRenderer.render(e)}setOptions(e){void 0!==e.previewing&&(this._previewing=e.previewing),void 0!==e.lightDirections&&(this._primarySet.lightDirections=e.lightDirections),void 0!==e.lightDirectionsContext&&(this._contextSet.lightDirections=e.lightDirectionsContext),!0===e.enabled?this._enable():!1===e.enabled&&this._disable(),this._accumulationRenderer.setOptions(e)}readAccumulatedShadow(e,t){const r=this._primarySet.progress;return!this.active||!this._fbo||r<1||e<0||e>=this._fbo.width||t<0||t>=this._fbo.height?0:(this._fbo.readPixels(e,t,1,1,q.RGBA,D.UNSIGNED_BYTE,k),k[x.PRIMARY]/r)}_numActiveChanged(){if(!this._fbo)return;const e=2===this._numActive,t=this._createFBO();t.resize(this._fbo.width,this._fbo.height),e&&(this._clearFramebuffer(t),this._contextSet.reset()),this._rctx.blitFramebuffer(this._fbo,t),this._fbo.dispose(),this._fbo=t,this._requestRender()}_enable(){this._fbo||(this._fbo=this._createFBO(),this._invalidateAccumulationSets())}_createFBO(){const{pixelFormat:e,internalFormat:t}=this._pixelFormat,r=new M;return r.pixelFormat=e,r.internalFormat=t,r.wrapMode=T.CLAMP_TO_EDGE,new O(this._rctx,r)}_invalidateAccumulationSets(){for(const e of this._accumulationSets())e.reset();this._requestRenderIfEnabled()}_disable(){this._fbo&&(this._fbo=s(this._fbo),this._requestRender())}_reset(){for(const e of this._accumulationSets())e.reset()}_clearFramebuffer(e=this._fbo){e&&(this._rctx.bindFramebuffer(e),this._rctx.setClearColor(0,0,0,0),this._rctx.clear(E.COLOR))}_clearFramebufferForSet(e,t){if(!e)return;const r=this._techniques.get(C,t.configuration);this._rctx.bindFramebuffer(e),this._rctx.bindTechnique(r,this._bindParameters,this._passParameters),this._rctx.bindVAO(this._vao),this._rctx.drawArrays(r.primitiveType,0,B(this._vao,"geometry"))}_accumulateShadow(e){this._renderToShadowMap(this._bindParameters,e.lightDirections[e.progress++],this._depthRange);const t=this._techniques.get(A,e.configuration);this._rctx.bindFramebuffer(this._fbo),this._rctx.bindTechnique(t,this._bindParameters,this._passParameters),this._rctx.bindVAO(this._vao),this._rctx.drawArrays(t.primitiveType,0,B(this._vao,"geometry"))}_updateCamera(e){const t=this._fbo;if(null==t)return;const r=this._bindParameters.camera;e.equals(r)||r.copyFrom(e),t.resize(e.fullWidth,e.fullHeight),this._opacityFromElevation=1-i(w,S,e.relativeElevation)}_requestRenderIfEnabled(){this._fbo&&this._requestRender()}get test(){}};e([h()],L.prototype,"_fbo",void 0),e([h()],L.prototype,"_depthRange",void 0),e([h()],L.prototype,"_previewing",void 0),e([h()],L.prototype,"_accumulationRenderer",void 0),e([h()],L.prototype,"_refining",null),e([h()],L.prototype,"active",null),e([h()],L.prototype,"canAccumulate",null),e([h()],L.prototype,"_doneAccumulating",null),e([h()],L.prototype,"_opacityFromElevation",null),e([h()],L.prototype,"_numActive",null),e([h()],L.prototype,"_pixelFormat",null),e([h()],L.prototype,"running",null),L=e([u("esri.views.3d.webgl-engine.lib.ShadowAccumulator")],L);const U=6,I="renderView",k=new Uint8Array(4);class G{constructor(e,t){this.configuration=e,this._notifyChange=t,this._cachedLightDirections=[],this._progress=c(0),this._sampleCount=c(0)}get progress(){return this._progress.value}set progress(e){this._progress.value=e}get sampleCount(){return this._sampleCount.value}get doneAccumulating(){return this.progress>=this.sampleCount}get running(){return this.progress>0}get active(){return this.sampleCount>0}get lightDirections(){return this._cachedLightDirections}set lightDirections(e){const t=this._cachedLightDirections,i=Math.min(y,e.length);if(!r(t,0,t.length,e,0,i,l)){t.length=i,this._sampleCount.value=i;for(let r=0;r<i;++r)t[r]=m(t[r]??_(),e[r]);this.reset(),this._notifyChange()}}destroy(){this._cachedLightDirections.length=0,this._sampleCount.value=0}reset(){this.progress=0}precompile(e){e.precompile(A,this.configuration),e.precompile(C,this.configuration)}}export{L as ShadowAccumulator};
5
+ import{_ as e}from"../../../../chunks/tslib.es6.js";import t from"../../../../core/Accessor.js";import{sliceEquals as r}from"../../../../core/arrayUtils.js";import"../../../../core/has.js";import{smoothstep as i}from"../../../../core/mathUtils.js";import{disposeMaybe as s}from"../../../../core/maybe.js";import{watch as o,syncAndInitial as a,sync as n}from"../../../../core/reactiveUtils.js";import{signal as c}from"../../../../core/signal.js";import{property as h}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/Logger.js";import{subclass as u}from"../../../../core/accessorSupport/decorators/subclass.js";import{c as m,G as l}from"../../../../chunks/vec32.js";import{create as _}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ReadShadowMapPassParameters as p}from"../core/shaderLibrary/shading/ReadShadowMap.glsl.js";import{BindParameters as d}from"./BindParameters.js";import{DepthRange as f}from"./DepthRange.js";import{createQuadVAO as g}from"./glUtil3D.js";import{ShadowCastRenderer as b,shadowCastDisabledElevationThreshold as v,shadowCastDisableElevationMax as S,shadowCastDisableElevationMin as w}from"./ShadowCastRenderer.js";import{ShadowMap as F}from"./ShadowMap.js";import{S as y}from"../../../../chunks/ShadowCastAccumulate.glsl.js";import{ShadowCastAccumulateTechnique as A}from"../shaders/ShadowCastAccumulateTechnique.js";import{ShadowCastAccumulateTechniqueConfiguration as R,ShadowCastAccumulateIndex as x}from"../shaders/ShadowCastAccumulateTechniqueConfiguration.js";import{ShadowCastClearTechnique as C}from"../shaders/ShadowCastClearTechnique.js";import{TaskPriority as j}from"../../../support/Scheduler.js";import{SizedPixelFormat as P,PixelFormat as q,PixelType as D,TextureWrapMode as T,FramebufferBit as E}from"../../../webgl/enums.js";import{FramebufferObject as O}from"../../../webgl/FramebufferObject.js";import{TextureDescriptor as M}from"../../../webgl/TextureDescriptor.js";import{vertexCount as B}from"../../../webgl/Util.js";let L=class extends t{updateDepthRange(e){this._depthRange.equals(e)||(this._depthRange=e)}constructor(e,t,r,i,s,c){super({}),this.fbos=e,this._techniques=t,this._stage=r,this._prepareForShadowMapPass=i,this._renderToShadowMap=s,this._requestRender=c,this._primarySet=new G(new R(x.PRIMARY),(()=>this._requestRenderIfEnabled())),this._contextSet=new G(new R(x.CONTEXT),(()=>this._requestRenderIfEnabled())),this._passParameters=new p,this._depthRange=f.zero,this._previewing=!1,this._cameraForcedForScreenshot=!1,this._shadowAccumulatorKey=Symbol("shadowAccumulator"),this._rctx=e.rctx,this._bindParameters=new d(new F(e,r.viewingMode)),this._bindParameters.shadowMap.enabled=!0,this._vao=g(this._rctx),this._accumulationRenderer=new b(t,this._rctx,this,c);const h=this._stage.view.resourceController.scheduler;this.addHandles([h.registerTask(j.SHADOW_ACCUMULATOR,this),o((()=>r.renderView),(e=>{this.removeHandles(I),null!=e&&this.addHandles(e.events.on("force-camera-for-screenshot",(()=>this._cameraForcedForScreenshot=!0)),I)}),a),o((()=>this._previewing),(()=>this._requestRenderIfEnabled()),n),o((()=>2===this._numActive),(()=>this._numActiveChanged()),n),o((()=>this._depthRange),(()=>this._invalidateAccumulationSets()),n)],this._shadowAccumulatorKey);for(const o of this._accumulationSets())o.precompile(t)}*_accumulationSets(){yield this._primarySet,yield this._contextSet}normalizeCtorArgs(){return{}}dispose(){this._disable(),this.removeHandles(this._shadowAccumulatorKey),this._accumulationRenderer=s(this._accumulationRenderer),this._bindParameters.shadowMap.dispose(),this._fbo=s(this._fbo),this._vao=s(this._vao);for(const e of this._accumulationSets())e.destroy()}get computedSamples(){return[this._primarySet.progress,this._contextSet.progress]}get shadowCastTexture(){return this._fbo?.colorTexture}get accumulating(){return this.active&&this._previewing||this._refining}get _refining(){return this.active&&!this._doneAccumulating&&!this._previewing}get active(){return null!=this._fbo&&[...this._accumulationSets()].some((e=>e.active))}get canAccumulate(){return null!=this._bindParameters.depth&&this._depthRange!==f.zero&&this._opacityFromElevation>v}get _doneAccumulating(){return[...this._accumulationSets()].every((e=>e.doneAccumulating))}get _opacityFromElevation(){return this._accumulationRenderer.opacityFromElevation}set _opacityFromElevation(e){this._accumulationRenderer.opacityFromElevation=e}get _numActive(){return[...this._accumulationSets()].reduce(((e,t)=>e+(t.active?1:0)),0)}get _pixelFormat(){return 2===this._numActive?{pixelFormat:q.RG,internalFormat:P.RG8}:{pixelFormat:q.RED,internalFormat:P.R8}}get running(){return this._refining&&this.canAccumulate&&[...this._accumulationSets()].some((e=>e.running))}runTask(e){this._clearBuffersOnAccumulationStart(),this._prepareForShadowMapPass(this._bindParameters);let t=!1;for(const r of this._accumulationSets())this._runTaskForSet(r,e)&&(t=!0);t&&this._requestRender()}_runTaskForSet(e,t){let r=!1;for(;!t.done&&!e.doneAccumulating;)this._accumulateShadow(e),t.madeProgress(),r=!0;return r}renderAccumulation(e,t,r){if(this._updateCamera(t),this._bindParameters.contentCamera=r,this._bindParameters.depth=e,this._passParameters.origin=this._bindParameters.camera.center,this.notifyChange("canAccumulate"),!this.accumulating||!this.canAccumulate)return!1;this._previewing||this._cameraForcedForScreenshot?(this._clearFramebuffer(),this._reset()):this._clearBuffersOnAccumulationStart();const i=this._accumulateSetsForRenderFrame();return this._cameraForcedForScreenshot=!1,i}_clearBuffersOnAccumulationStart(){if([...this._accumulationSets()].every((e=>0===e.progress)))this._clearFramebuffer();else for(const e of this._accumulationSets())0===e.progress&&this._clearFramebufferForSet(this._fbo,e)}_accumulateSetsForRenderFrame(){let e=!1;for(const t of this._accumulationSets())this._accumulateSetForRenderFrame(t)&&(e=!0);return e&&this._requestRender(),e}_accumulateSetForRenderFrame(e){let t=this._cameraForcedForScreenshot?e.sampleCount:Math.min(U,e.sampleCount);t-=e.progress;for(let r=0;r<t;++r)this._accumulateShadow(e);return t>0}precompile(){this._accumulationRenderer.precompile()}render(e){this._accumulationRenderer.render(e)}setOptions(e){void 0!==e.previewing&&(this._previewing=e.previewing),void 0!==e.lightDirections&&(this._primarySet.lightDirections=e.lightDirections),void 0!==e.lightDirectionsContext&&(this._contextSet.lightDirections=e.lightDirectionsContext),!0===e.enabled?this._enable():!1===e.enabled&&this._disable(),this._accumulationRenderer.setOptions(e)}readAccumulatedShadow(e,t){const r=this._primarySet.progress;return!this.active||!this._fbo||r<1||e<0||e>=this._fbo.width||t<0||t>=this._fbo.height?0:(this._fbo.readPixels(e,t,1,1,q.RGBA,D.UNSIGNED_BYTE,k),k[x.PRIMARY]/r)}_numActiveChanged(){if(!this._fbo)return;const e=2===this._numActive,t=this._createFBO();t.resize(this._fbo.width,this._fbo.height),e&&(this._clearFramebuffer(t),this._contextSet.reset()),this._fbo.width&&this._fbo.height&&this._rctx.blitFramebuffer(this._fbo,t),this._fbo.dispose(),this._fbo=t,this._requestRender()}_enable(){this._fbo||(this._fbo=this._createFBO(),this._invalidateAccumulationSets())}_createFBO(){const{pixelFormat:e,internalFormat:t}=this._pixelFormat,r=new M;return r.pixelFormat=e,r.internalFormat=t,r.wrapMode=T.CLAMP_TO_EDGE,new O(this._rctx,r)}_invalidateAccumulationSets(){for(const e of this._accumulationSets())e.reset();this._requestRenderIfEnabled()}_disable(){this._fbo&&(this._fbo=s(this._fbo),this._requestRender())}_reset(){for(const e of this._accumulationSets())e.reset()}_clearFramebuffer(e=this._fbo){e&&e.width&&e.height&&(this._rctx.bindFramebuffer(e),this._rctx.setClearColor(0,0,0,0),this._rctx.clear(E.COLOR))}_clearFramebufferForSet(e,t){if(!e)return;const r=this._techniques.get(C,t.configuration);this._rctx.bindFramebuffer(e),this._rctx.bindTechnique(r,this._bindParameters,this._passParameters),this._rctx.bindVAO(this._vao),this._rctx.drawArrays(r.primitiveType,0,B(this._vao,"geometry"))}_accumulateShadow(e){this._renderToShadowMap(this._bindParameters,e.lightDirections[e.progress++],this._depthRange);const t=this._techniques.get(A,e.configuration);this._rctx.bindFramebuffer(this._fbo),this._rctx.bindTechnique(t,this._bindParameters,this._passParameters),this._rctx.bindVAO(this._vao),this._rctx.drawArrays(t.primitiveType,0,B(this._vao,"geometry"))}_updateCamera(e){const t=this._fbo;if(null==t)return;const r=this._bindParameters.camera;e.equals(r)||r.copyFrom(e),t.resize(e.fullWidth,e.fullHeight),this._opacityFromElevation=1-i(w,S,e.relativeElevation)}_requestRenderIfEnabled(){this._fbo&&this._requestRender()}get test(){}};e([h()],L.prototype,"_fbo",void 0),e([h()],L.prototype,"_depthRange",void 0),e([h()],L.prototype,"_previewing",void 0),e([h()],L.prototype,"_accumulationRenderer",void 0),e([h()],L.prototype,"_refining",null),e([h()],L.prototype,"active",null),e([h()],L.prototype,"canAccumulate",null),e([h()],L.prototype,"_doneAccumulating",null),e([h()],L.prototype,"_opacityFromElevation",null),e([h()],L.prototype,"_numActive",null),e([h()],L.prototype,"_pixelFormat",null),e([h()],L.prototype,"running",null),L=e([u("esri.views.3d.webgl-engine.lib.ShadowAccumulator")],L);const U=6,I="renderView",k=new Uint8Array(4);class G{constructor(e,t){this.configuration=e,this._notifyChange=t,this._cachedLightDirections=[],this._progress=c(0),this._sampleCount=c(0)}get progress(){return this._progress.value}set progress(e){this._progress.value=e}get sampleCount(){return this._sampleCount.value}get doneAccumulating(){return this.progress>=this.sampleCount}get running(){return this.progress>0}get active(){return this.sampleCount>0}get lightDirections(){return this._cachedLightDirections}set lightDirections(e){const t=this._cachedLightDirections,i=Math.min(y,e.length);if(!r(t,0,t.length,e,0,i,l)){t.length=i,this._sampleCount.value=i;for(let r=0;r<i;++r)t[r]=m(t[r]??_(),e[r]);this.reset(),this._notifyChange()}}destroy(){this._cachedLightDirections.length=0,this._sampleCount.value=0}reset(){this.progress=0}precompile(e){e.precompile(A,this.configuration),e.precompile(C,this.configuration)}}export{L as ShadowAccumulator};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{clamp as e,deg2rad as t}from"../../../../core/mathUtils.js";import{fromMat4 as i}from"../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as s}from"../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{invert as r}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as n,rotate as o}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{fromValues as l,create as c}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{i as f,t as u,n as p,d as h,g as m,c as d,l as g,j as O,f as S,a as T,o as b,e as v}from"../../../../chunks/vec32.js";import{create as A,fromValues as E}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromArray as R,create as I,freeze as x}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{isMat4 as F}from"../../../../core/libs/gl-matrix-2/types/mat4.js";import{create as P}from"../../../../geometry/support/aaBoundingRect.js";import{BufferViewVec4u8 as _,BufferViewVec3f as C,BufferViewFloat as y,BufferViewVec2f as D,BufferViewVec4f as L}from"../../../../geometry/support/buffer/BufferView.js";import{evaluateModelTransformScale as N}from"../../layers/support/FastSymbolUpdates.js";import{debugFlags as j}from"../../support/debugFlags.js";import{newLayout as U}from"../../support/buffer/InterleavedLayout.js";import{isColorEmissionHighlightOrOID as z,isColorOrColorEmission as M}from"../core/shaderLibrary/ShaderOutput.js";import{HUDVerticalPixelOffset as w}from"../core/shaderLibrary/hud/HUD.glsl.js";import{olidEnabled as B}from"../effects/geometry/olidUtils.js";import{GLTextureMaterialBindParameters as V,GLTextureMaterial as X}from"../lib/GLTextureMaterial.js";import{Material as q,RenderOccludedFlag as G}from"../lib/Material.js";import{RenderSlot as H}from"../lib/RenderSlot.js";import{applyScaleFactor as W,applyPrecomputedScaleFactor as Y,precomputeScaleFactor as Z}from"../lib/screenSizePerspectiveUtils.js";import{assert as k}from"../lib/Util.js";import{VertexAttribute as J}from"../lib/VertexAttribute.js";import{ScaleInfo as K}from"./ScaleInfo.js";import{writePosition as Q,writeNormal as $,writeColor as ee,writeBufferFloat as te,writeBufferVec4 as ie,writeBufferVec4Zeros as se,writeOlidColor as re}from"./internal/bufferWriterUtils.js";import{verticalOffsetAtDistance as ae}from"./internal/MaterialUtil.js";import{c as ne,f as oe}from"../../../../chunks/HUDMaterial.glsl.js";import{HUDMaterialTechnique as le}from"../shaders/HUDMaterialTechnique.js";import{HUDMaterialTechniqueConfiguration as ce}from"../shaders/HUDMaterialTechniqueConfiguration.js";import{alphaCutoff as fe}from"../../../../webscene/support/AlphaCutoff.js";class ue extends q{constructor(e,t){super(e,Me),this.produces=new Map([[H.HUD_MATERIAL,e=>z(e)&&!this.parameters.drawAsLabel],[H.LABEL_MATERIAL,e=>z(e)&&this.parameters.drawAsLabel],[H.OCCLUSION_PIXELS,()=>this.parameters.occlusionTest],[H.DRAPED_MATERIAL,e=>this.parameters.draped&&z(e)]]),this._visible=!0,this._configuration=new ce(t)}getConfiguration(e,t){const i=this.parameters.draped;return super.getConfiguration(e,t,this._configuration),this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasVerticalOffset=!!this.parameters.verticalOffset,this._configuration.hasScreenSizePerspective=!!this.parameters.screenSizePerspective,this._configuration.screenCenterOffsetUnitsEnabled="screen"===this.parameters.centerOffsetUnits,this._configuration.hasPolygonOffset=this.parameters.polygonOffset,this._configuration.draped=i,this._configuration.occlusionTestEnabled=this.parameters.occlusionTest,this._configuration.pixelSnappingEnabled=this.parameters.pixelSnappingEnabled,this._configuration.signedDistanceFieldEnabled=this.parameters.textureIsSignedDistanceField,this._configuration.sampleSignedDistanceFieldTexelCenter=this.parameters.sampleSignedDistanceFieldTexelCenter,this._configuration.hasRotation=this.parameters.hasRotation,this._configuration.vvSize=!!this.parameters.vvSize,this._configuration.vvColor=!!this.parameters.vvColor,this._configuration.occlusionPass=t.slot===H.OCCLUSION_PIXELS,this._configuration.occludedFragmentFade=!i&&this.parameters.occludedFragmentFade,this._configuration.horizonCullingEnabled=this.parameters.horizonCullingEnabled,this._configuration.isFocused=this.parameters.isFocused,this._configuration.depthTestEnabled=this.parameters.depthEnabled||t.slot===H.OCCLUSION_PIXELS,M(e)&&(this._configuration.debugDrawLabelBorder=!!j.LABELS_SHOW_BORDER),this._configuration.oitPass=t.oitPass,this._configuration.terrainDepthTest=t.terrainDepthTest,this._configuration.cullAboveTerrain=t.cullAboveTerrain,this._configuration}intersect(e,t,s,a,n,o){const{options:{selectionMode:l,hud:c,excludeLabels:S},point:T,camera:b}=s,{parameters:v}=this;if(!l||!c||S&&v.isLabel||!e.visible||!T||!b)return;const E=e.attributes.get(J.FEATUREATTRIBUTE),I=null==E?null:R(E.data,ye),{scaleX:x,scaleY:F}=Xe(I,v,b.pixelRatio);i(Ie,t),e.attributes.has(J.FEATUREATTRIBUTE)&&de(Ie);const P=e.attributes.get(J.POSITION),_=e.attributes.get(J.SIZE),C=e.attributes.get(J.NORMAL),y=e.attributes.get(J.ROTATION),D=e.attributes.get(J.CENTEROFFSETANDDISTANCE);k(P.size>=3);const L=ne(v),N="screen"===this.parameters.centerOffsetUnits;for(let i=0;i<P.data.length/P.size;i++){const e=i*P.size;f(Se,P.data[e],P.data[e+1],P.data[e+2]),u(Se,Se,t),u(Se,Se,b.viewMatrix);const a=i*D.size;if(f(_e,D.data[a],D.data[a+1],D.data[a+2]),!N&&(Se[0]+=_e[0],Se[1]+=_e[1],0!==_e[2])){const e=_e[2];p(_e,Se),h(Se,Se,m(_e,_e,e))}const n=i*C.size;if(f(Te,C.data[n],C.data[n+1],C.data[n+2]),me(Te,Ie,b,De),qe(this.parameters,Se,De,b,Oe),b.applyProjection(Se,be),be[0]>-1){N&&(_e[0]||_e[1])&&(be[0]+=_e[0]*b.pixelRatio,0!==_e[1]&&(be[1]+=W(_e[1],Oe.factorAlignment)*b.pixelRatio),b.unapplyProjection(be,Se)),be[0]+=this.parameters.screenOffset[0]*b.pixelRatio,be[1]+=this.parameters.screenOffset[1]*b.pixelRatio,be[0]=Math.floor(be[0]),be[1]=Math.floor(be[1]);const e=i*_.size;je[0]=_.data[e],je[1]=_.data[e+1],Y(je,Oe.factor,je);const t=Le*b.pixelRatio;let a=0;if(v.textureIsSignedDistanceField){a=Math.min(v.outlineSize,.5*je[0])*b.pixelRatio/2}je[0]*=x,je[1]*=F;const n=i*y.size,l=v.rotation+y.data[n];if(ge(T,be[0],be[1],je,t,a,l,v,L)){const e=s.ray;if(u(Ae,Se,r(Fe,b.viewMatrix)),be[0]=T[0],be[1]=T[1],b.unprojectFromRenderScreen(be,Se)){const t=A();d(t,e.direction);const i=1/g(t);m(t,t,i);o(O(e.origin,Se)*i,t,-1,Ae)}}}}}intersectDraped(e,t,i,s,r){const a=e.attributes.get(J.POSITION),n=e.attributes.get(J.SIZE),o=e.attributes.get(J.ROTATION),l=this.parameters,c=ne(l),f=e.attributes.get(J.FEATUREATTRIBUTE),u=null==f?null:R(f.data,ye),{scaleX:p,scaleY:h}=Xe(u,l,e.screenToWorldRatio),m=Ne*e.screenToWorldRatio;for(let d=0;d<a.data.length/a.size;d++){const t=d*a.size,f=a.data[t],u=a.data[t+1],g=d*n.size;je[0]=n.data[g],je[1]=n.data[g+1];let O=0;if(l.textureIsSignedDistanceField){O=Math.min(l.outlineSize,.5*je[0])*e.screenToWorldRatio/2}je[0]*=p,je[1]*=h;const S=d*o.size,T=l.rotation+o.data[S];ge(i,f,u,je,m,O,T,l,c)&&s(r.distance,r.normal,-1)}}createBufferWriter(){return new Ve}applyShaderOffsetsView(e,t,i,s,r,a,n){const o=me(t,i,r,De);return this._applyVerticalGroundOffsetView(e,o,r,n),qe(this.parameters,n,o,r,a),this._applyPolygonOffsetView(n,o,s[3],r,n),this._applyCenterOffsetView(n,s,n),n}applyShaderOffsetsNDC(e,t,i,s,r){return this._applyCenterOffsetNDC(e,t,i,s),null!=r&&d(r,s),this._applyPolygonOffsetNDC(s,t,i,s),s}_applyPolygonOffsetView(t,i,s,r,a){const n=r.aboveGround?1:-1;let o=Math.sign(s);0===o&&(o=n);const l=n*o;if(this.parameters.shaderPolygonOffset<=0)return d(a,t);const c=e(Math.abs(i.cosAngle),.01,1),f=1-Math.sqrt(1-c*c)/c/r.viewport[2];return m(a,t,l>0?f:1/f),a}_applyVerticalGroundOffsetView(e,t,i,s){const r=g(e),a=i.aboveGround?1:-1,n=i.computeRenderPixelSizeAtDist(r)*w,o=m(Se,t.normal,a*n);return S(s,e,o),s}_applyCenterOffsetView(e,t,i){const s="screen"!==this.parameters.centerOffsetUnits;return i!==e&&d(i,e),s&&(i[0]+=t[0],i[1]+=t[1],t[2]&&(p(Te,i),T(i,i,m(Te,Te,t[2])))),i}_applyCenterOffsetNDC(e,t,i,s){const r="screen"!==this.parameters.centerOffsetUnits;return s!==e&&d(s,e),r||(s[0]+=t[0]/i.fullWidth*2,s[1]+=t[1]/i.fullHeight*2),s}_applyPolygonOffsetNDC(e,t,i,s){const r=this.parameters.shaderPolygonOffset;if(e!==s&&d(s,e),r){const e=i.aboveGround?1:-1,a=e*Math.sign(t[3]);s[2]-=(a||e)*r}return s}set visible(e){this._visible=e}get visible(){const{color:e,outlineSize:t,outlineColor:i}=this.parameters,s=e[3]>=fe||t>=fe&&i[3]>=fe;return this._visible&&s}createGLMaterial(e){return new pe(e)}calculateRelativeScreenBounds(e,t,i=P()){return he(this.parameters,e,t,i),i[2]=i[0]+e[0],i[3]=i[1]+e[1],i}}class pe extends X{constructor(e){super({...e,...e.material.parameters})}beginSlot(e){return this.updateTexture(this._material.parameters.textureId),this._material.setParameters(this.textureBindParameters),this.getTechnique(le,e)}}function he(e,t,i,s){s[0]=e.anchorPosition[0]*-t[0]+e.screenOffset[0]*i,s[1]=e.anchorPosition[1]*-t[1]+e.screenOffset[1]*i}function me(e,t,s,r){return F(t)&&(t=i(xe,t)),b(r.normal,e,t),u(r.normal,r.normal,s.viewInverseTransposeMatrix),r.cosAngle=v(ve,ze),r}function de(e){const t=e[0],i=e[1],s=e[2],r=e[3],a=e[4],n=e[5],o=e[6],l=e[7],c=e[8],f=1/Math.sqrt(t*t+i*i+s*s),u=1/Math.sqrt(r*r+a*a+n*n),p=1/Math.sqrt(o*o+l*l+c*c);return e[0]=t*f,e[1]=i*f,e[2]=s*f,e[3]=r*u,e[4]=a*u,e[5]=n*u,e[6]=o*p,e[7]=l*p,e[8]=c*p,e}function ge(e,i,s,r,a,l,c,f,u){let p=i-a-r[0]*u[0],h=p+r[0]+2*a,m=s-a-r[1]*u[1],d=m+r[1]+2*a;const g=f.distanceFieldBoundingBox;return f.textureIsSignedDistanceField&&null!=g&&(p+=r[0]*g[0],m+=r[1]*g[1],h-=r[0]*(1-g[2]),d-=r[1]*(1-g[3]),p-=l,h+=l,m-=l,d+=l),n(Re,i,s),o(Ee,e,Re,t(c)),Ee[0]>p&&Ee[0]<h&&Ee[1]>m&&Ee[1]<d}const Oe=new K,Se=A(),Te=A(),be=I(),ve=A(),Ae=A(),Ee=c(),Re=c(),Ie=s(),xe=s(),Fe=a(),Pe=I(),_e=A(),Ce=A(),ye=I(),De={normal:ve,cosAngle:0},Le=1,Ne=2,je=l(0,0),Ue=6,ze=E(0,0,1);class Me extends V{constructor(){super(...arguments),this.renderOccluded=G.Occlude,this.isDecoration=!1,this.color=x(1,1,1,1),this.polygonOffset=!1,this.anchorPosition=l(.5,.5),this.screenOffset=[0,0],this.shaderPolygonOffset=1e-5,this.textureIsSignedDistanceField=!1,this.sampleSignedDistanceFieldTexelCenter=!1,this.outlineColor=x(1,1,1,1),this.outlineSize=0,this.distanceFieldBoundingBox=I(),this.rotation=0,this.hasRotation=!1,this.vvSizeEnabled=!1,this.vvSize=null,this.vvColor=null,this.vvOpacity=null,this.vvSymbolAnchor=null,this.vvSymbolRotationMatrix=null,this.hasSlicePlane=!1,this.pixelSnappingEnabled=!0,this.occlusionTest=!0,this.occludedFragmentFade=!1,this.horizonCullingEnabled=!1,this.centerOffsetUnits="world",this.drawAsLabel=!1,this.depthEnabled=!0,this.isFocused=!0,this.focusStyle="none",this.draped=!1,this.isLabel=!1}}const we=U().vec3f(J.POSITION).vec3f(J.NORMAL).vec2i16(J.UVI).vec4u8(J.COLOR).vec2f(J.SIZE).f32(J.ROTATION).vec4f(J.CENTEROFFSETANDDISTANCE).vec4f(J.FEATUREATTRIBUTE),Be=we.clone().vec4u8(J.OLIDCOLOR);class Ve{constructor(){this.vertexBufferLayout=B()?Be:we}elementCount(e){return e.get(J.POSITION).indices.length*Ue}write(e,t,i,s,r,a){const{position:n,normal:o,uvi:l,color:c,size:f,rotation:u,centerOffsetAndDistance:p,featureAttribute:h}=r;Q(i.get(J.POSITION),e,n,a,Ue),$(i.get(J.NORMAL),t,o,a,Ue);const m=i.get(J.UVI)?.data;let d=0,g=0,O=-1-oe,S=-1-oe;m&&m.length>=4&&(d=m[0],g=m[1],O=-1-m[2],S=-1-m[3]);let T=i.get(J.POSITION).indices.length,b=a;for(let E=0;E<T;++E)l.set(b,0,d),l.set(b,1,g),b++,l.set(b,0,O),l.set(b,1,g),b++,l.set(b,0,O),l.set(b,1,S),b++,l.set(b,0,O),l.set(b,1,S),b++,l.set(b,0,d),l.set(b,1,S),b++,l.set(b,0,d),l.set(b,1,g),b++;ee(i.get(J.COLOR),4,c,a,Ue);const{data:v,indices:A}=i.get(J.SIZE);T=A.length,b=a;for(let E=0;E<T;++E){const e=v[2*A[E]],t=v[2*A[E]+1];for(let i=0;i<Ue;++i)f.set(b,0,e),f.set(b,1,t),b++}if(te(i.get(J.ROTATION),u,a,Ue),i.get(J.CENTEROFFSETANDDISTANCE)?ie(i.get(J.CENTEROFFSETANDDISTANCE),p,a,Ue):se(p,a,T*Ue),i.get(J.FEATUREATTRIBUTE)?ie(i.get(J.FEATUREATTRIBUTE),h,a,Ue):se(h,a,T*Ue),null!=s){const e=i.get(J.POSITION)?.indices;if(e){const t=e.length,i=r.getField(J.OLIDCOLOR,_);re(s,i,t,a,Ue)}}return{numVerticesPerItem:Ue,numItems:T}}intersect(e,t,i,s,a,n,o){const{options:{selectionMode:l,hud:c,excludeLabels:T},point:b,camera:v}=s;if(!l||!c||T&&t.isLabel||!b)return;const E=this.vertexBufferLayout.createView(e),R=E.getField(J.POSITION,C),I=E.getField(J.NORMAL,C),x=E.getField(J.ROTATION,y),F=E.getField(J.SIZE,D),P=E.getField(J.FEATUREATTRIBUTE,L),_=E.getField(J.CENTEROFFSETANDDISTANCE,L),N="screen"===t.centerOffsetUnits,j=ne(t);if(null==R||null==I||null==x||null==F||null==_||null==v)return;const U=null==P?null:P.getVec(0,ye),{scaleX:z,scaleY:M}=Xe(U,t,v.pixelRatio),w=R.count/Ue;for(let C=0;C<w;C++){const e=C*Ue;if(R.getVec(e,Se),null!=i&&S(Se,Se,i),u(Se,Se,v.viewMatrix),_.getVec(e,Pe),f(_e,Pe[0],Pe[1],Pe[2]),!N&&(Se[0]+=_e[0],Se[1]+=_e[1],0!==_e[2])){const e=_e[2];p(_e,Se),h(Se,Se,m(_e,_e,e))}if(I.getVec(e,Te),me(Te,Ie,v,De),qe(t,Se,De,v,Oe),v.applyProjection(Se,be),be[0]>-1){N&&(_e[0]||_e[1])&&(be[0]+=_e[0]*v.pixelRatio,0!==_e[1]&&(be[1]+=W(_e[1],Oe.factorAlignment)*v.pixelRatio),v.unapplyProjection(be,Se)),be[0]+=t.screenOffset[0]*v.pixelRatio,be[1]+=t.screenOffset[1]*v.pixelRatio,be[0]=Math.floor(be[0]),be[1]=Math.floor(be[1]),F.getVec(e,je),Y(je,Oe.factor,je);const i=Le*v.pixelRatio;let a=0;if(t.textureIsSignedDistanceField){a=Math.min(t.outlineSize,.5*je[0])*v.pixelRatio/2}je[0]*=z,je[1]*=M;const n=x.get(e),l=t.rotation+n;if(ge(b,be[0],be[1],je,i,a,l,t,j)){const e=s.ray;if(u(Ae,Se,r(Fe,v.viewMatrix)),be[0]=b[0],be[1]=b[1],v.unprojectFromRenderScreen(be,Se)){const t=A();d(t,e.direction);const i=1/g(t);m(t,t,i);o(O(e.origin,Se)*i,t,C,Ae)}}}}}}function Xe(e,t,i){return null==e||null==t.vvSize?{scaleX:i,scaleY:i}:(N(Ce,t,e),{scaleX:Ce[0]*i,scaleY:Ce[1]*i})}function qe(e,t,i,s,r){if(!e.verticalOffset?.screenLength){if(e.screenSizePerspective||e.screenSizePerspectiveAlignment){Ge(e,r,g(t),i.cosAngle)}else r.factor.scale=1,r.factorAlignment.scale=1;return t}const a=g(t),n=e.screenSizePerspectiveAlignment??e.screenSizePerspective,o=ae(s,a,e.verticalOffset,i.cosAngle,n);return Ge(e,r,a,i.cosAngle),m(i.normal,i.normal,o),S(t,t,i.normal)}function Ge(e,t,i,s){null!=e.screenSizePerspective?Z(s,i,e.screenSizePerspective,t.factor):(t.factor.scale=1,t.factor.factor=0,t.factor.minScaleFactor=0),null!=e.screenSizePerspectiveAlignment?Z(s,i,e.screenSizePerspectiveAlignment,t.factorAlignment):(t.factorAlignment.factor=t.factor.factor,t.factorAlignment.scale=t.factor.scale,t.factorAlignment.minScaleFactor=t.factor.minScaleFactor)}export{ue as HUDMaterial,Me as Parameters};
5
+ import{clamp as e,deg2rad as t}from"../../../../core/mathUtils.js";import{fromMat4 as i}from"../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as s}from"../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{invert as r}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as n,rotate as o}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{fromValues as l,create as c}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{i as f,t as u,n as p,d as h,g as m,c as d,l as g,j as O,f as S,a as T,o as b,e as v}from"../../../../chunks/vec32.js";import{create as A,fromValues as E}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromArray as R,create as I,freeze as x}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{isMat4 as F}from"../../../../core/libs/gl-matrix-2/types/mat4.js";import{create as P}from"../../../../geometry/support/aaBoundingRect.js";import{BufferViewVec4u8 as _,BufferViewVec3f as C,BufferViewFloat as y,BufferViewVec2f as D,BufferViewVec4f as L}from"../../../../geometry/support/buffer/BufferView.js";import{evaluateModelTransformScale as N}from"../../layers/support/FastSymbolUpdates.js";import{debugFlags as j}from"../../support/debugFlags.js";import{newLayout as U}from"../../support/buffer/InterleavedLayout.js";import{isColorEmissionHighlightOrOID as z,isColorOrColorEmission as M}from"../core/shaderLibrary/ShaderOutput.js";import{HUDVerticalPixelOffset as w}from"../core/shaderLibrary/hud/HUD.glsl.js";import{olidEnabled as B}from"../effects/geometry/olidUtils.js";import{GLTextureMaterialBindParameters as V,GLTextureMaterial as X}from"../lib/GLTextureMaterial.js";import{Material as q,RenderOccludedFlag as G}from"../lib/Material.js";import{RenderSlot as H}from"../lib/RenderSlot.js";import{applyScaleFactor as W,applyPrecomputedScaleFactor as Y,precomputeScaleFactor as Z}from"../lib/screenSizePerspectiveUtils.js";import{assert as k}from"../lib/Util.js";import{VertexAttribute as J}from"../lib/VertexAttribute.js";import{ScaleInfo as K}from"./ScaleInfo.js";import{writePosition as Q,writeNormal as $,writeColor as ee,writeBufferFloat as te,writeBufferVec4 as ie,writeBufferVec4Zeros as se,writeOlidColor as re}from"./internal/bufferWriterUtils.js";import{verticalOffsetAtDistance as ae}from"./internal/MaterialUtil.js";import{c as ne,f as oe}from"../../../../chunks/HUDMaterial.glsl.js";import{HUDMaterialTechnique as le}from"../shaders/HUDMaterialTechnique.js";import{HUDMaterialTechniqueConfiguration as ce}from"../shaders/HUDMaterialTechniqueConfiguration.js";import{alphaCutoff as fe}from"../../../../webscene/support/AlphaCutoff.js";class ue extends q{constructor(e,t){super(e,Me),this.produces=new Map([[H.HUD_MATERIAL,e=>z(e)&&!this.parameters.drawAsLabel],[H.LABEL_MATERIAL,e=>z(e)&&this.parameters.drawAsLabel],[H.OCCLUSION_PIXELS,()=>this.parameters.occlusionTest],[H.DRAPED_MATERIAL,e=>this.parameters.draped&&z(e)]]),this._visible=!0,this._configuration=new ce(t)}getConfiguration(e,t){const i=this.parameters.draped;return super.getConfiguration(e,t,this._configuration),this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasVerticalOffset=!!this.parameters.verticalOffset,this._configuration.hasScreenSizePerspective=!!this.parameters.screenSizePerspective,this._configuration.screenCenterOffsetUnitsEnabled="screen"===this.parameters.centerOffsetUnits,this._configuration.hasPolygonOffset=this.parameters.polygonOffset,this._configuration.draped=i,this._configuration.occlusionTestEnabled=this.parameters.occlusionTest,this._configuration.pixelSnappingEnabled=this.parameters.pixelSnappingEnabled,this._configuration.signedDistanceFieldEnabled=this.parameters.textureIsSignedDistanceField,this._configuration.sampleSignedDistanceFieldTexelCenter=this.parameters.sampleSignedDistanceFieldTexelCenter,this._configuration.hasRotation=this.parameters.hasRotation,this._configuration.vvSize=!!this.parameters.vvSize,this._configuration.vvColor=!!this.parameters.vvColor,this._configuration.occlusionPass=t.slot===H.OCCLUSION_PIXELS,this._configuration.occludedFragmentFade=!i&&this.parameters.occludedFragmentFade,this._configuration.horizonCullingEnabled=this.parameters.horizonCullingEnabled,this._configuration.isFocused=this.parameters.isFocused,this._configuration.depthTestEnabled=this.parameters.depthEnabled||t.slot===H.OCCLUSION_PIXELS,M(e)&&(this._configuration.debugDrawLabelBorder=!!j.LABELS_SHOW_BORDER),this._configuration.oitPass=t.oitPass,this._configuration.terrainDepthTest=t.terrainDepthTest,this._configuration.cullAboveTerrain=t.cullAboveTerrain,this._configuration}intersect(e,t,s,a,n,o){const{options:{selectionMode:l,hud:c,excludeLabels:S},point:T,camera:b}=s,{parameters:v}=this;if(!l||!c||S&&v.isLabel||!e.visible||!T||!b)return;const E=e.attributes.get(J.FEATUREATTRIBUTE),I=null==E?null:R(E.data,ye),{scaleX:x,scaleY:F}=Xe(I,v,b.pixelRatio);i(Ie,t),e.attributes.has(J.FEATUREATTRIBUTE)&&de(Ie);const P=e.attributes.get(J.POSITION),_=e.attributes.get(J.SIZE),C=e.attributes.get(J.NORMAL),y=e.attributes.get(J.ROTATION),D=e.attributes.get(J.CENTEROFFSETANDDISTANCE);k(P.size>=3);const L=ne(v),N="screen"===this.parameters.centerOffsetUnits;for(let i=0;i<P.data.length/P.size;i++){const e=i*P.size;f(Se,P.data[e],P.data[e+1],P.data[e+2]),u(Se,Se,t),u(Se,Se,b.viewMatrix);const a=i*D.size;if(f(_e,D.data[a],D.data[a+1],D.data[a+2]),!N&&(Se[0]+=_e[0],Se[1]+=_e[1],0!==_e[2])){const e=_e[2];p(_e,Se),h(Se,Se,m(_e,_e,e))}const n=i*C.size;if(f(Te,C.data[n],C.data[n+1],C.data[n+2]),me(Te,Ie,b,De),qe(this.parameters,Se,De,b,Oe),b.applyProjection(Se,be),be[0]>-1){N&&(_e[0]||_e[1])&&(be[0]+=_e[0]*b.pixelRatio,0!==_e[1]&&(be[1]+=W(_e[1],Oe.factorAlignment)*b.pixelRatio),b.unapplyProjection(be,Se)),be[0]+=this.parameters.screenOffset[0]*b.pixelRatio,be[1]+=this.parameters.screenOffset[1]*b.pixelRatio,be[0]=Math.floor(be[0]),be[1]=Math.floor(be[1]);const e=i*_.size;je[0]=_.data[e],je[1]=_.data[e+1],Y(je,Oe.factor,je);const t=Le*b.pixelRatio;let a=0;if(v.textureIsSignedDistanceField){a=Math.min(v.outlineSize,.5*je[0])*b.pixelRatio/2}je[0]*=x,je[1]*=F;const n=i*y.size,l=v.rotation+y.data[n];if(ge(T,be[0],be[1],je,t,a,l,v,L)){const e=s.ray;if(u(Ae,Se,r(Fe,b.viewMatrix)),be[0]=T[0],be[1]=T[1],b.unprojectFromRenderScreen(be,Se)){const t=A();d(t,e.direction);const i=1/g(t);m(t,t,i);o(O(e.origin,Se)*i,t,-1,Ae)}}}}}intersectDraped(e,t,i,s,r){const a=e.attributes.get(J.POSITION),n=e.attributes.get(J.SIZE),o=e.attributes.get(J.ROTATION),l=this.parameters,c=ne(l),f=e.attributes.get(J.FEATUREATTRIBUTE),u=null==f?null:R(f.data,ye),{scaleX:p,scaleY:h}=Xe(u,l,e.screenToWorldRatio),m=Ne*e.screenToWorldRatio;for(let d=0;d<a.data.length/a.size;d++){const t=d*a.size,f=a.data[t],u=a.data[t+1],g=d*n.size;je[0]=n.data[g],je[1]=n.data[g+1];let O=0;if(l.textureIsSignedDistanceField){O=Math.min(l.outlineSize,.5*je[0])*e.screenToWorldRatio/2}je[0]*=p,je[1]*=h;const S=d*o.size,T=l.rotation+o.data[S];ge(i,f,u,je,m,O,T,l,c)&&s(r.distance,r.normal,-1)}}createBufferWriter(){return new Ve}applyShaderOffsetsView(e,t,i,s,r,a,n){const o=me(t,i,r,De);return this._applyVerticalGroundOffsetView(e,o,r,n),qe(this.parameters,n,o,r,a),this._applyPolygonOffsetView(n,o,s[3],r,n),this._applyCenterOffsetView(n,s,n),n}applyShaderOffsetsNDC(e,t,i,s,r){return this._applyCenterOffsetNDC(e,t,i,s),null!=r&&d(r,s),this._applyPolygonOffsetNDC(s,t,i,s),s}_applyPolygonOffsetView(t,i,s,r,a){const n=r.aboveGround?1:-1;let o=Math.sign(s);0===o&&(o=n);const l=n*o;if(this.parameters.shaderPolygonOffset<=0)return d(a,t);const c=e(Math.abs(i.cosAngle),.01,1),f=1-Math.sqrt(1-c*c)/c/r.viewport[2];return m(a,t,l>0?f:1/f),a}_applyVerticalGroundOffsetView(e,t,i,s){const r=g(e),a=i.aboveGround?1:-1,n=i.computeRenderPixelSizeAtDist(r)*w,o=m(Se,t.normal,a*n);return S(s,e,o),s}_applyCenterOffsetView(e,t,i){const s="screen"!==this.parameters.centerOffsetUnits;return i!==e&&d(i,e),s&&(i[0]+=t[0],i[1]+=t[1],t[2]&&(p(Te,i),T(i,i,m(Te,Te,t[2])))),i}_applyCenterOffsetNDC(e,t,i,s){const r="screen"!==this.parameters.centerOffsetUnits;return s!==e&&d(s,e),r||(s[0]+=t[0]/i.fullWidth*2,s[1]+=t[1]/i.fullHeight*2),s}_applyPolygonOffsetNDC(e,t,i,s){const r=this.parameters.shaderPolygonOffset;if(e!==s&&d(s,e),r){const e=i.aboveGround?1:-1,a=e*Math.sign(t[3]);s[2]-=(a||e)*r}return s}set visible(e){this._visible=e}get visible(){const{color:e,outlineSize:t,outlineColor:i}=this.parameters,s=e[3]>=fe||t>=fe&&i[3]>=fe;return this._visible&&s}createGLMaterial(e){return new pe(e)}calculateRelativeScreenBounds(e,t,i=P()){return he(this.parameters,e,t,i),i[2]=i[0]+e[0],i[3]=i[1]+e[1],i}}class pe extends X{constructor(e){super({...e,...e.material.parameters})}beginSlot(e){return this.updateTexture(this._material.parameters.textureId),this._material.setParameters(this.textureBindParameters),this.getTechnique(le,e)}}function he(e,t,i,s){s[0]=e.anchorPosition[0]*-t[0]+e.screenOffset[0]*i,s[1]=e.anchorPosition[1]*-t[1]+e.screenOffset[1]*i}function me(e,t,s,r){return F(t)&&(t=i(xe,t)),b(r.normal,e,t),u(r.normal,r.normal,s.viewInverseTransposeMatrix),r.cosAngle=v(ve,ze),r}function de(e){const t=e[0],i=e[1],s=e[2],r=e[3],a=e[4],n=e[5],o=e[6],l=e[7],c=e[8],f=1/Math.sqrt(t*t+i*i+s*s),u=1/Math.sqrt(r*r+a*a+n*n),p=1/Math.sqrt(o*o+l*l+c*c);return e[0]=t*f,e[1]=i*f,e[2]=s*f,e[3]=r*u,e[4]=a*u,e[5]=n*u,e[6]=o*p,e[7]=l*p,e[8]=c*p,e}function ge(e,i,s,r,a,l,c,f,u){let p=i-a-r[0]*u[0],h=p+r[0]+2*a,m=s-a-r[1]*u[1],d=m+r[1]+2*a;const g=f.distanceFieldBoundingBox;return f.textureIsSignedDistanceField&&null!=g&&(p+=r[0]*g[0],m+=r[1]*g[1],h-=r[0]*(1-g[2]),d-=r[1]*(1-g[3]),p-=l,h+=l,m-=l,d+=l),n(Re,i,s),o(Ee,e,Re,t(c)),Ee[0]>p&&Ee[0]<h&&Ee[1]>m&&Ee[1]<d}const Oe=new K,Se=A(),Te=A(),be=I(),ve=A(),Ae=A(),Ee=c(),Re=c(),Ie=s(),xe=s(),Fe=a(),Pe=I(),_e=A(),Ce=A(),ye=I(),De={normal:ve,cosAngle:0},Le=1,Ne=2,je=l(0,0),Ue=6,ze=E(0,0,1);class Me extends V{constructor(){super(...arguments),this.renderOccluded=G.Occlude,this.isDecoration=!1,this.color=x(1,1,1,1),this.polygonOffset=!1,this.anchorPosition=l(.5,.5),this.screenOffset=[0,0],this.shaderPolygonOffset=1e-5,this.textureIsSignedDistanceField=!1,this.sampleSignedDistanceFieldTexelCenter=!1,this.outlineColor=x(1,1,1,1),this.outlineSize=0,this.distanceFieldBoundingBox=I(),this.rotation=0,this.hasRotation=!1,this.vvSizeEnabled=!1,this.vvSize=null,this.vvColor=null,this.vvOpacity=null,this.vvSymbolAnchor=null,this.vvSymbolRotationMatrix=null,this.hasSlicePlane=!1,this.pixelSnappingEnabled=!0,this.occlusionTest=!0,this.occludedFragmentFade=!1,this.horizonCullingEnabled=!1,this.centerOffsetUnits="world",this.drawAsLabel=!1,this.depthEnabled=!0,this.isFocused=!0,this.focusStyle="bright",this.draped=!1,this.isLabel=!1}}const we=U().vec3f(J.POSITION).vec3f(J.NORMAL).vec2i16(J.UVI).vec4u8(J.COLOR).vec2f(J.SIZE).f32(J.ROTATION).vec4f(J.CENTEROFFSETANDDISTANCE).vec4f(J.FEATUREATTRIBUTE),Be=we.clone().vec4u8(J.OLIDCOLOR);class Ve{constructor(){this.vertexBufferLayout=B()?Be:we}elementCount(e){return e.get(J.POSITION).indices.length*Ue}write(e,t,i,s,r,a){const{position:n,normal:o,uvi:l,color:c,size:f,rotation:u,centerOffsetAndDistance:p,featureAttribute:h}=r;Q(i.get(J.POSITION),e,n,a,Ue),$(i.get(J.NORMAL),t,o,a,Ue);const m=i.get(J.UVI)?.data;let d=0,g=0,O=-1-oe,S=-1-oe;m&&m.length>=4&&(d=m[0],g=m[1],O=-1-m[2],S=-1-m[3]);let T=i.get(J.POSITION).indices.length,b=a;for(let E=0;E<T;++E)l.set(b,0,d),l.set(b,1,g),b++,l.set(b,0,O),l.set(b,1,g),b++,l.set(b,0,O),l.set(b,1,S),b++,l.set(b,0,O),l.set(b,1,S),b++,l.set(b,0,d),l.set(b,1,S),b++,l.set(b,0,d),l.set(b,1,g),b++;ee(i.get(J.COLOR),4,c,a,Ue);const{data:v,indices:A}=i.get(J.SIZE);T=A.length,b=a;for(let E=0;E<T;++E){const e=v[2*A[E]],t=v[2*A[E]+1];for(let i=0;i<Ue;++i)f.set(b,0,e),f.set(b,1,t),b++}if(te(i.get(J.ROTATION),u,a,Ue),i.get(J.CENTEROFFSETANDDISTANCE)?ie(i.get(J.CENTEROFFSETANDDISTANCE),p,a,Ue):se(p,a,T*Ue),i.get(J.FEATUREATTRIBUTE)?ie(i.get(J.FEATUREATTRIBUTE),h,a,Ue):se(h,a,T*Ue),null!=s){const e=i.get(J.POSITION)?.indices;if(e){const t=e.length,i=r.getField(J.OLIDCOLOR,_);re(s,i,t,a,Ue)}}return{numVerticesPerItem:Ue,numItems:T}}intersect(e,t,i,s,a,n,o){const{options:{selectionMode:l,hud:c,excludeLabels:T},point:b,camera:v}=s;if(!l||!c||T&&t.isLabel||!b)return;const E=this.vertexBufferLayout.createView(e),R=E.getField(J.POSITION,C),I=E.getField(J.NORMAL,C),x=E.getField(J.ROTATION,y),F=E.getField(J.SIZE,D),P=E.getField(J.FEATUREATTRIBUTE,L),_=E.getField(J.CENTEROFFSETANDDISTANCE,L),N="screen"===t.centerOffsetUnits,j=ne(t);if(null==R||null==I||null==x||null==F||null==_||null==v)return;const U=null==P?null:P.getVec(0,ye),{scaleX:z,scaleY:M}=Xe(U,t,v.pixelRatio),w=R.count/Ue;for(let C=0;C<w;C++){const e=C*Ue;if(R.getVec(e,Se),null!=i&&S(Se,Se,i),u(Se,Se,v.viewMatrix),_.getVec(e,Pe),f(_e,Pe[0],Pe[1],Pe[2]),!N&&(Se[0]+=_e[0],Se[1]+=_e[1],0!==_e[2])){const e=_e[2];p(_e,Se),h(Se,Se,m(_e,_e,e))}if(I.getVec(e,Te),me(Te,Ie,v,De),qe(t,Se,De,v,Oe),v.applyProjection(Se,be),be[0]>-1){N&&(_e[0]||_e[1])&&(be[0]+=_e[0]*v.pixelRatio,0!==_e[1]&&(be[1]+=W(_e[1],Oe.factorAlignment)*v.pixelRatio),v.unapplyProjection(be,Se)),be[0]+=t.screenOffset[0]*v.pixelRatio,be[1]+=t.screenOffset[1]*v.pixelRatio,be[0]=Math.floor(be[0]),be[1]=Math.floor(be[1]),F.getVec(e,je),Y(je,Oe.factor,je);const i=Le*v.pixelRatio;let a=0;if(t.textureIsSignedDistanceField){a=Math.min(t.outlineSize,.5*je[0])*v.pixelRatio/2}je[0]*=z,je[1]*=M;const n=x.get(e),l=t.rotation+n;if(ge(b,be[0],be[1],je,i,a,l,t,j)){const e=s.ray;if(u(Ae,Se,r(Fe,v.viewMatrix)),be[0]=b[0],be[1]=b[1],v.unprojectFromRenderScreen(be,Se)){const t=A();d(t,e.direction);const i=1/g(t);m(t,t,i);o(O(e.origin,Se)*i,t,C,Ae)}}}}}}function Xe(e,t,i){return null==e||null==t.vvSize?{scaleX:i,scaleY:i}:(N(Ce,t,e),{scaleX:Ce[0]*i,scaleY:Ce[1]*i})}function qe(e,t,i,s,r){if(!e.verticalOffset?.screenLength){if(e.screenSizePerspective||e.screenSizePerspectiveAlignment){Ge(e,r,g(t),i.cosAngle)}else r.factor.scale=1,r.factorAlignment.scale=1;return t}const a=g(t),n=e.screenSizePerspectiveAlignment??e.screenSizePerspective,o=ae(s,a,e.verticalOffset,i.cosAngle,n);return Ge(e,r,a,i.cosAngle),m(i.normal,i.normal,o),S(t,t,i.normal)}function Ge(e,t,i,s){null!=e.screenSizePerspective?Z(s,i,e.screenSizePerspective,t.factor):(t.factor.scale=1,t.factor.factor=0,t.factor.minScaleFactor=0),null!=e.screenSizePerspectiveAlignment?Z(s,i,e.screenSizePerspectiveAlignment,t.factorAlignment):(t.factorAlignment.factor=t.factor.factor,t.factorAlignment.scale=t.factor.scale,t.factorAlignment.minScaleFactor=t.factor.minScaleFactor)}export{ue as HUDMaterial,Me as Parameters};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{clamp as t}from"../../../../core/mathUtils.js";import{clone as e}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{fromValues as i}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as r}from"../../../../geometry/support/aaBoundingBox.js";import{newLayout as s}from"../../support/buffer/InterleavedLayout.js";import{isShadowRelatedOutput as o,is3DGeometryOutputMRT as a,isColorOrColorEmission as n,isColorEmission as h,ShaderOutput as c}from"../core/shaderLibrary/ShaderOutput.js";import{EmissionSource as p}from"../core/shaderLibrary/output/Emissions.glsl.js";import{NormalsDoubleSidedMode as u}from"../core/shaderLibrary/shading/Normals.glsl.js";import{PBRMode as m}from"../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import{olidEnabled as l}from"../effects/geometry/olidUtils.js";import f from"../lib/GLMaterial.js";import{Material as d}from"../lib/Material.js";import{isPathGeometry as b}from"../lib/PathGeometry.js";import{MeshIntersectionOptions as g,intersectAabbInvDir as v}from"../lib/RayIntersections.js";import{RenderSlot as S}from"../lib/RenderSlot.js";import{VertexAttribute as _}from"../lib/VertexAttribute.js";import{DefaultBufferWriter as T}from"./DefaultBufferWriter.js";import{vertexAttributeLocations as A,PathPassParameters as O,PathTechnique as R}from"./PathTechnique.js";import{PathTechniqueConfiguration as y}from"./PathTechniqueConfiguration.js";import{alphaCutoff as E}from"../../../../webscene/support/AlphaCutoff.js";class P extends d{constructor(t,e){super(t,I),this.vertexAttributeLocations=A,this.supportsEdges=!0,this._pp0=i(0,0,1),this._pp1=i(0,0,0),this.produces=new Map([[S.OPAQUE_MATERIAL,t=>(this.parameters.castShadows&&o(t)||a(t))&&!this.transparent],[S.TRANSPARENT_MATERIAL,t=>(this.parameters.castShadows&&o(t)||a(t))&&this.transparent]]),this._configuration=new y(e.spherical)}get hasEmissions(){return this.parameters.emissiveStrength>0}getConfiguration(t,e){return super.getConfiguration(t,e,this._configuration),this._configuration.vvSize=!!this.parameters.vvSize,this._configuration.vvColor=!!this.parameters.vvColor,this._configuration.vvOpacity=!!this.parameters.vvOpacity,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.transparent=this.transparent,this._configuration.hasOccludees=e.hasOccludees,n(t)?(this._configuration.doubleSidedMode=this.parameters.doubleSided&&"normal"===this.parameters.doubleSidedType?u.View:this.parameters.doubleSided&&"winding-order"===this.parameters.doubleSidedType?u.WindingOrder:u.None,this._configuration.receiveShadows=e.shadowMap.enabled,this._configuration.receiveAmbientOcclusion=null!=e.ssao):this._configuration.receiveShadows=this._configuration.receiveAmbientOcclusion=!1,this._configuration.pbrMode=this.parameters.usePBR?m.Schematic:m.Disabled,this._configuration.emissionSource=this.parameters.usePBR?p.SymbolColor:p.None,this._configuration.hasBloom=h(t),this._configuration.oitPass=e.oitPass,this._configuration.terrainDepthTest=e.terrainDepthTest,this._configuration.cullAboveTerrain=e.cullAboveTerrain,this._configuration.snowCover=e.snowCover,this._configuration}isVisibleForOutput(t){return t!==c.Shadow&&t!==c.ShadowExcludeHighlight&&t!==c.ShadowHighlight||this.parameters.castShadows}get visible(){return this.parameters.opacity>=E}intersect(t,e,i,r,s,o){this._intersect(t,i,r,s,o)}intersectDraped(t,e,i,r){return this._pp0[0]=this._pp1[0]=i[0],this._pp0[1]=this._pp1[1]=i[1],this._intersect(t,e,this._pp0,this._pp1,r)}_intersect(i,s,o,a,n){const h=i;if(!b(h))return;const c=h.path,p=e(this.parameters.size);if(this.parameters.vvSize){const{offset:e,factor:i,minSize:r,maxSize:s,fallback:o}=this.parameters.vvSize,a=c.sizeAttributeValue;Number.isNaN(a)?(p[0]*=o[0],p[1]*=o[2]):(p[0]*=t(e[0]+a*i[0],r[0],s[0]),p[1]*=t(e[2]+a*i[2],r[2],s[2]))}const u=new g(!1,s.options.normalRequired),m=Math.max(p[0],p[1]),l=i.boundingInfo;if(null==l)return void w(c,p,o,a,u,n);const f=r(l.bbMin[0]-m,l.bbMin[1]-m,l.bbMin[2]-m,l.bbMax[0]+m,l.bbMax[1]+m,l.bbMax[2]+m),d=[a[0]-o[0],a[1]-o[1],a[2]-o[2]],S=Math.sqrt(d[0]*d[0]+d[1]*d[1]+d[2]*d[2]),_=[S/d[0],S/d[1],S/d[2]];v(f,o,_,s.tolerance)&&w(c,p,o,a,u,n)}createBufferWriter(){return new T(this._layout)}get _layout(){const t=s().vec3f(_.POSITION).vec4f16(_.PROFILEVERTEXANDNORMAL).vec3f16(_.PROFILEAUXDATA).vec2i16(_.PROFILERIGHT,{glNormalized:!0}).vec2i16(_.PROFILEUP,{glNormalized:!0});return this.parameters.vvSize&&t.f32(_.SIZEFEATUREATTRIBUTE),this.parameters.vvColor&&t.f16(_.COLORFEATUREATTRIBUTE),this.parameters.vvOpacity&&t.f16(_.OPACITYFEATUREATTRIBUTE),l()&&t.vec4u8(_.OLIDCOLOR),t}createGLMaterial(t){return new j(t)}get transparent(){const{parameters:t}=this;return t.drivenOpacity||t.opacity<1}}class j extends f{beginSlot(t){return this.getTechnique(R,t)}}function w(t,e,i,r,s,o){t.baked.size&&t.baked.size[0]===e[0]&&t.baked.size[1]===e[1]||t.baked.bake(e),t.baked.intersect(i,r,s,o)}class I extends O{constructor(){super(...arguments),this.doubleSided=!1,this.doubleSidedType="normal",this.castShadows=!0,this.hasSlicePlane=!1,this.drivenOpacity=!1,this.usePBR=!1}}export{I as Parameters,P as PathMaterial};
5
+ import{clamp as t}from"../../../../core/mathUtils.js";import{clone as e}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{fromValues as i}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as r}from"../../../../geometry/support/aaBoundingBox.js";import{newLayout as s}from"../../support/buffer/InterleavedLayout.js";import{isShadowRelatedOutput as o,is3DGeometryOutputMRT as a,isColorOrColorEmission as n,isColorEmission as h,ShaderOutput as c}from"../core/shaderLibrary/ShaderOutput.js";import{EmissionSource as p}from"../core/shaderLibrary/output/Emissions.glsl.js";import{NormalsDoubleSidedMode as u}from"../core/shaderLibrary/shading/Normals.glsl.js";import{PBRMode as m}from"../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import{olidEnabled as l}from"../effects/geometry/olidUtils.js";import f from"../lib/GLMaterial.js";import{Material as d}from"../lib/Material.js";import{isPathGeometry as b}from"../lib/PathGeometry.js";import{MeshIntersectionOptions as g,intersectAabbInvDir as v}from"../lib/RayIntersections.js";import{RenderSlot as S}from"../lib/RenderSlot.js";import{VertexAttribute as _}from"../lib/VertexAttribute.js";import{DefaultBufferWriter as T}from"./DefaultBufferWriter.js";import{vertexAttributeLocations as A,PathPassParameters as O,PathTechnique as R}from"./PathTechnique.js";import{PathTechniqueConfiguration as y}from"./PathTechniqueConfiguration.js";import{alphaCutoff as E}from"../../../../webscene/support/AlphaCutoff.js";class P extends d{constructor(t,e){super(t,I),this.vertexAttributeLocations=A,this.supportsEdges=!0,this._pp0=i(0,0,1),this._pp1=i(0,0,0),this.produces=new Map([[S.OPAQUE_MATERIAL,t=>(this.parameters.castShadows&&o(t)||a(t))&&!this.transparent],[S.TRANSPARENT_MATERIAL,t=>(this.parameters.castShadows&&o(t)||a(t))&&this.transparent]]),this._configuration=new y(e.spherical)}get hasEmissions(){return this.parameters.emissiveStrength>0}getConfiguration(t,e){return super.getConfiguration(t,e,this._configuration),this._configuration.vvSize=!!this.parameters.vvSize,this._configuration.vvColor=!!this.parameters.vvColor,this._configuration.vvOpacity=!!this.parameters.vvOpacity,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.transparent=this.transparent,this._configuration.hasOccludees=e.hasOccludees,n(t)?(this._configuration.doubleSidedMode=this.parameters.doubleSided&&"normal"===this.parameters.doubleSidedType?u.View:this.parameters.doubleSided&&"winding-order"===this.parameters.doubleSidedType?u.WindingOrder:u.None,this._configuration.receiveShadows=e.shadowMap.enabled,this._configuration.receiveAmbientOcclusion=null!=e.ssao):this._configuration.receiveShadows=this._configuration.receiveAmbientOcclusion=!1,this._configuration.pbrMode=this.parameters.usePBR?m.Schematic:m.Disabled,this._configuration.emissionSource=this.parameters.usePBR?p.SymbolColor:p.None,this._configuration.hasBloom=h(t),this._configuration.oitPass=e.oitPass,this._configuration.terrainDepthTest=e.terrainDepthTest,this._configuration.cullAboveTerrain=e.cullAboveTerrain,this._configuration.snowCover=e.snowCover,this._configuration}isVisibleForOutput(t){return t!==c.Shadow&&t!==c.ShadowExcludeHighlight&&t!==c.ShadowHighlight||this.parameters.castShadows}get visible(){return this.parameters.opacity>=E}intersect(t,e,i,r,s,o){this._intersect(t,i,r,s,o)}intersectDraped(t,e,i,r){return this._pp0[0]=this._pp1[0]=i[0],this._pp0[1]=this._pp1[1]=i[1],this._intersect(t,e,this._pp0,this._pp1,r)}_intersect(i,s,o,a,n){const h=i;if(!b(h))return;const c=h.path,p=e(this.parameters.size);if(this.parameters.vvSize){const{offset:e,factor:i,minSize:r,maxSize:s,fallback:o}=this.parameters.vvSize,a=c.sizeAttributeValue;Number.isNaN(a)?(p[0]*=o[0],p[1]*=o[2]):(p[0]*=t(e[0]+a*i[0],r[0],s[0]),p[1]*=t(e[2]+a*i[2],r[2],s[2]))}const u=new g(!1,s.options.normalRequired),m=Math.max(p[0],p[1]),l=i.boundingInfo;if(null==l)return void w(c,p,o,a,u,n);const f=r(l.bbMin[0]-m,l.bbMin[1]-m,l.bbMin[2]-m,l.bbMax[0]+m,l.bbMax[1]+m,l.bbMax[2]+m),d=[a[0]-o[0],a[1]-o[1],a[2]-o[2]],S=Math.sqrt(d[0]*d[0]+d[1]*d[1]+d[2]*d[2]),_=[S/d[0],S/d[1],S/d[2]];v(f,o,_,s.tolerance)&&w(c,p,o,a,u,n)}createBufferWriter(){return new T(this._layout)}get _layout(){const t=s().vec3f(_.POSITION).vec4f16(_.PROFILEVERTEXANDNORMAL).vec2i16(_.PROFILERIGHT,{glNormalized:!0}).vec2i16(_.PROFILEUP,{glNormalized:!0});return this.parameters.vvSize&&t.f32(_.SIZEFEATUREATTRIBUTE),t.vec3f16(_.PROFILEAUXDATA),this.parameters.vvColor&&t.f16(_.COLORFEATUREATTRIBUTE),this.parameters.vvOpacity&&t.f16(_.OPACITYFEATUREATTRIBUTE),l()&&t.vec4u8(_.OLIDCOLOR),t}createGLMaterial(t){return new j(t)}get transparent(){const{parameters:t}=this;return t.drivenOpacity||t.opacity<1}}class j extends f{beginSlot(t){return this.getTechnique(R,t)}}function w(t,e,i,r,s,o){t.baked.size&&t.baked.size[0]===e[0]&&t.baked.size[1]===e[1]||t.baked.bake(e),t.baked.intersect(i,r,s,o)}class I extends O{constructor(){super(...arguments),this.doubleSided=!1,this.doubleSidedType="normal",this.castShadows=!0,this.hasSlicePlane=!1,this.drivenOpacity=!1,this.usePBR=!1}}export{I as Parameters,P as PathMaterial};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import"../core/shaderLibrary/ScreenSpacePass.glsl.js";import"../core/shaderModules/glsl.js";import"../core/shaderModules/IntegerPassUniform.js";import"../core/shaderModules/Texture2DPassUniform.js";import"../../../webgl/NoParameters.js";import"../../../webgl/ShaderBuilder.js";export{F as FocusAreaColorPassParameters,b as build}from"../../../../chunks/FocusAreaColor.glsl.js";
5
+ import"../core/shaderLibrary/ScreenSpacePass.glsl.js";import"../core/shaderModules/glsl.js";import"../core/shaderModules/IntegerPassUniform.js";import"../core/shaderModules/Texture2DPassUniform.js";import"../effects/focusArea/FocusAreaEffect.js";import"../../../webgl/NoParameters.js";import"../../../webgl/ShaderBuilder.js";export{F as FocusAreaColorPassParameters,b as build}from"../../../../chunks/FocusAreaColor.glsl.js";
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as o}from"../chunks/tslib.es6.js";import r from"../core/Accessor.js";import e from"../core/Collection.js";import{property as t}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{subclass as s}from"../core/accessorSupport/decorators/subclass.js";import{FocusAreaOutline as i}from"./FocusAreaOutline.js";let p=class extends r{constructor(o){super(o),this.id=`focusarea-${Date.now().toString(16)}`,this.enabled=!0,this.geometries=new e}};o([t()],p.prototype,"id",void 0),o([t()],p.prototype,"title",void 0),o([t()],p.prototype,"enabled",void 0),o([t()],p.prototype,"geometries",void 0),o([t({type:i})],p.prototype,"outline",void 0),p=o([s("esri.views.FocusArea")],p);export{p as FocusArea};
5
+ import{_ as e}from"../chunks/tslib.es6.js";import o from"../request.js";import r from"../core/Clonable.js";import s from"../core/JSONSupport.js";import t from"../core/Promise.js";import{on as i,sync as p}from"../core/reactiveUtils.js";import{generateUUID as a}from"../core/uuid.js";import{property as m}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{reader as n}from"../core/accessorSupport/decorators/reader.js";import{subclass as c}from"../core/accessorSupport/decorators/subclass.js";import{persistable as l}from"../core/accessorSupport/decorators/persistable.js";import d from"../layers/support/PolygonCollection.js";import{f as u}from"../chunks/persistableUrlUtils.js";import{FocusAreaOutline as j}from"./FocusAreaOutline.js";let f=class extends(t.EsriPromiseMixin(s.JSONSupportMixin(r))){constructor(e){super(e),this.id=`focusarea-${a()}`,this.enabled=!0,this.geometries=new d}initialize(){this.addHandles(i((()=>this.geometries),"after-changes",(()=>this.geometries=this.geometries),p))}readGeometries(e,o,r){Array.isArray(e)?this.geometries=d.fromJSON(e,r):r.hooks?.onAfterLoad?.((()=>this._loadGeometries(u(e,r),r)))}async _loadGeometries(e,r){const s=await o(e,{responseType:"json"});this.geometries=d.fromJSON(s.data,r)}};e([m({type:String,nonNullable:!0,json:{write:!0,origins:{"web-scene":{write:{isRequired:!0}}}}}),m()],f.prototype,"id",void 0),e([m({type:String,json:{write:!0}})],f.prototype,"title",void 0),e([m({type:Boolean,nonNullable:!0,json:{write:!0,origins:{"web-scene":{write:{isRequired:!0}}}}})],f.prototype,"enabled",void 0),e([m({type:j,json:{write:!0}})],f.prototype,"outline",void 0),e([m({type:d,nonNullable:!0,json:{write:!0,origins:{"web-scene":{write:{isRequired:!0}}}},clonable:e=>new d(e.items.map((e=>e.clone())))}),l({origins:["web-scene","portal-item"],type:"resource",prefix:"geometries",contentAddressed:!0})],f.prototype,"geometries",void 0),e([n(["web-scene","portal-item"],"geometries")],f.prototype,"readGeometries",null),f=e([c("esri.views.FocusArea")],f);const g=f;export{g 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.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as o}from"../chunks/tslib.es6.js";import r from"../Color.js";import s from"../core/Accessor.js";import{property as e}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{subclass as t}from"../core/accessorSupport/decorators/subclass.js";let c=class extends s{constructor(o){super(o),this.color=null}};o([e({type:r})],c.prototype,"color",void 0),c=o([t("esri.views.FocusAreaOutline")],c);export{c as FocusAreaOutline};
5
+ import{_ as o}from"../chunks/tslib.es6.js";import r from"../Color.js";import s from"../core/Clonable.js";import e from"../core/JSONSupport.js";import{property as t}from"../core/accessorSupport/decorators/property.js";import{Integer as p}from"../core/accessorSupport/ensureType.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as c}from"../core/accessorSupport/decorators/subclass.js";let i=class extends(s.ClonableMixin(e)){constructor(o){super(o),this.color=null}};o([t({type:r,json:{type:[p],write:!0}})],i.prototype,"color",void 0),i=o([c("esri.views.FocusAreaOutline")],i);export{i as FocusAreaOutline};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as r}from"../chunks/tslib.es6.js";import o from"../core/Accessor.js";import s from"../core/Collection.js";import{property as e}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{subclass as a}from"../core/accessorSupport/decorators/subclass.js";let t=class extends o{constructor(){super(...arguments),this.areas=new s,this.style="dark"}add(r){this.areas.add(r)}addMany(r){this.areas.addMany(r)}remove(r){this.areas.remove(r)}removeMany(r){this.areas.removeMany(r)}removeAll(){this.areas.removeAll()}};r([e()],t.prototype,"areas",void 0),r([e()],t.prototype,"style",void 0),t=r([a("esri.views.FocusAreas")],t);export{t as FocusAreas};
5
+ import{_ as o}from"../chunks/tslib.es6.js";import r from"../core/Clonable.js";import e from"../core/Collection.js";import s from"../core/JSONSupport.js";import{property as t}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{subclass as i}from"../core/accessorSupport/decorators/subclass.js";import p from"./FocusArea.js";let c=class extends(s.JSONSupportMixin(r)){constructor(o){super(o),this.areas=new e,this.style="bright"}};o([t({type:e.ofType(p),nonNullable:!0,json:{write:!0,origins:{"web-scene":{write:{isRequired:!0}}}},clonable:o=>new e(o.items.map((o=>o.clone())))})],c.prototype,"areas",void 0),o([t({type:["bright","dark"],nonNullable:!0,json:{write:!0}})],c.prototype,"style",void 0),c=o([i("esri.views.FocusAreas")],c);export{c as FocusAreas};