@arcgis/core 4.27.0-rc.3 → 4.27.0-rc.5

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 (650) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/{0e65e00173b66c7fec2e.js → 09e677ca7532a281d262.js} +1 -1
  3. package/assets/esri/core/workers/chunks/0f51fa430333cf77faf7.js +1 -0
  4. package/assets/esri/core/workers/chunks/{89001ee8d3f69fa03cc1.js → 0f7ddb063ee0664f2fca.js} +1 -1
  5. package/assets/esri/core/workers/chunks/17ab08f60764244b2cf8.js +1 -0
  6. package/assets/esri/core/workers/chunks/2132edadb75a2c6c216d.js +1 -0
  7. package/assets/esri/core/workers/chunks/{2446e336b1f7256d4fde.js → 2c587ed66e2586cccb8d.js} +1 -1
  8. package/assets/esri/core/workers/chunks/{00c7b9fb375c9a934158.js → 38c6452dc9cf18e8bca8.js} +1 -1
  9. package/assets/esri/core/workers/chunks/{16db0bc87d87a7313dc4.js → 4806df402845c717c842.js} +1 -1
  10. package/assets/esri/core/workers/chunks/4884432d80e9af947449.js +1 -0
  11. package/assets/esri/core/workers/chunks/{470e34f5c33185919719.js → 4db447d0f1d865ab6c88.js} +1 -1
  12. package/assets/esri/core/workers/chunks/588cd91d08cec5207be1.js +1 -0
  13. package/assets/esri/core/workers/chunks/{83e3d104886b48f00397.js → 633c00c02a81397fc8df.js} +1 -1
  14. package/assets/esri/core/workers/chunks/{efb96aefe979a0f5c632.js → 640e8ac3498be30c6614.js} +1 -1
  15. package/assets/esri/core/workers/chunks/{33901eb1574e46abd9af.js → 6c213768715c52625855.js} +1 -1
  16. package/assets/esri/core/workers/chunks/{3160af63b860b52db389.js → 6f724f75f85dc3989d60.js} +1 -1
  17. package/assets/esri/core/workers/chunks/85191485a7556d3c99f2.js +1 -0
  18. package/assets/esri/core/workers/chunks/8b05fb365336cc42fecc.js +1 -0
  19. package/assets/esri/core/workers/chunks/8eec6da5e862cc33ea2b.js +1 -0
  20. package/assets/esri/core/workers/chunks/90d8f297d9cb359e071d.js +1 -0
  21. package/assets/esri/core/workers/chunks/{471f6eba213412b82840.js → 927417abea79c955b216.js} +1 -1
  22. package/assets/esri/core/workers/chunks/{5e6471dd2a08e66b47d0.js → 979d9f37c555df0e8fa6.js} +58 -59
  23. package/assets/esri/core/workers/chunks/{adaa9d4239f4e905d011.js → 9d4bd73dd50400e9d328.js} +1 -1
  24. package/assets/esri/core/workers/chunks/a324cc07d486061d0d8e.js +1 -0
  25. package/assets/esri/core/workers/chunks/a40130579791293cefa2.js +1 -0
  26. package/assets/esri/core/workers/chunks/{50f910797c17c3028521.js → a49718c74053314ed741.js} +1 -1
  27. package/assets/esri/core/workers/chunks/ad2891985e0fe45aa8d2.js +1 -0
  28. package/assets/esri/core/workers/chunks/afcba35eea836aea98ca.js +1 -0
  29. package/assets/esri/core/workers/chunks/b3c42e9ba07217a51911.js +1 -0
  30. package/assets/esri/core/workers/chunks/b3d2e397ea74ebef4423.js +1 -0
  31. package/assets/esri/core/workers/chunks/b846d4215210aac9f6ef.js +1 -0
  32. package/assets/esri/core/workers/chunks/c7dc821db8c14fec24a7.js +1 -0
  33. package/assets/esri/core/workers/chunks/c9df9a0a4a45f9a53ce9.js +1 -0
  34. package/assets/esri/core/workers/chunks/{45a4041881e6235d73a2.js → d0a9711f48dfa5fee68a.js} +1 -1
  35. package/assets/esri/core/workers/chunks/e23ec4f867c4735eec20.js +1 -0
  36. package/assets/esri/core/workers/chunks/{ff42585e1b1d0c5497af.js → ea16230a0edfc9f756bd.js} +1 -1
  37. package/assets/esri/core/workers/chunks/ef900614353505afb210.js +1 -0
  38. package/assets/esri/t9n/common_sv.json +1 -1
  39. package/assets/esri/themes/base/_View.scss +2 -5
  40. package/assets/esri/themes/base/widgets/_Feature.scss +12 -4
  41. package/assets/esri/themes/dark/main.css +1 -1
  42. package/assets/esri/themes/light/main.css +1 -1
  43. package/assets/esri/themes/light/view.css +1 -1
  44. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_ar.json +1 -1
  45. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_bg.json +1 -1
  46. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_bs.json +1 -1
  47. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_ca.json +1 -1
  48. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_cs.json +1 -1
  49. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_da.json +1 -1
  50. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_de.json +1 -1
  51. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_el.json +1 -1
  52. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_es.json +1 -1
  53. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_et.json +1 -1
  54. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_fi.json +1 -1
  55. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_fr.json +1 -1
  56. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_he.json +1 -1
  57. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_hr.json +1 -1
  58. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_hu.json +1 -1
  59. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_id.json +1 -1
  60. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_it.json +1 -1
  61. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_ja.json +1 -1
  62. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_ko.json +1 -1
  63. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_lt.json +1 -1
  64. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_lv.json +1 -1
  65. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_nb.json +1 -1
  66. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_nl.json +1 -1
  67. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_pl.json +1 -1
  68. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_pt-BR.json +1 -1
  69. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_pt-PT.json +1 -1
  70. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_ro.json +1 -1
  71. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_ru.json +1 -1
  72. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_sk.json +1 -1
  73. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_sl.json +1 -1
  74. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_sr.json +1 -1
  75. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_sv.json +1 -1
  76. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_th.json +1 -1
  77. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_tr.json +1 -1
  78. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_uk.json +1 -1
  79. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_vi.json +1 -1
  80. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_zh-CN.json +1 -1
  81. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_zh-HK.json +1 -1
  82. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_zh-TW.json +1 -1
  83. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_ar.json +1 -1
  84. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_bg.json +1 -1
  85. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_bs.json +1 -1
  86. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_ca.json +1 -1
  87. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_cs.json +1 -1
  88. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_da.json +1 -1
  89. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_de.json +1 -1
  90. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_el.json +1 -1
  91. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_es.json +1 -1
  92. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_et.json +1 -1
  93. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_fi.json +1 -1
  94. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_fr.json +1 -1
  95. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_he.json +1 -1
  96. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_hr.json +1 -1
  97. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_hu.json +1 -1
  98. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_id.json +1 -1
  99. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_it.json +1 -1
  100. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_ja.json +1 -1
  101. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_ko.json +1 -1
  102. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_lt.json +1 -1
  103. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_lv.json +1 -1
  104. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_nb.json +1 -1
  105. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_nl.json +1 -1
  106. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_pl.json +1 -1
  107. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_pt-BR.json +1 -1
  108. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_pt-PT.json +1 -1
  109. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_ro.json +1 -1
  110. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_ru.json +1 -1
  111. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_sk.json +1 -1
  112. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_sl.json +1 -1
  113. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_sr.json +1 -1
  114. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_sv.json +1 -1
  115. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_th.json +1 -1
  116. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_tr.json +1 -1
  117. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_uk.json +1 -1
  118. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_vi.json +1 -1
  119. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_zh-CN.json +1 -1
  120. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_zh-HK.json +1 -1
  121. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_zh-TW.json +1 -1
  122. package/assets/esri/widgets/CoordinateConversion/t9n/CoordinateConversion_ja.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_es.json +1 -1
  132. package/assets/esri/widgets/Editor/t9n/Editor_et.json +1 -1
  133. package/assets/esri/widgets/Editor/t9n/Editor_fi.json +1 -1
  134. package/assets/esri/widgets/Editor/t9n/Editor_fr.json +1 -1
  135. package/assets/esri/widgets/Editor/t9n/Editor_he.json +1 -1
  136. package/assets/esri/widgets/Editor/t9n/Editor_hr.json +1 -1
  137. package/assets/esri/widgets/Editor/t9n/Editor_hu.json +1 -1
  138. package/assets/esri/widgets/Editor/t9n/Editor_id.json +1 -1
  139. package/assets/esri/widgets/Editor/t9n/Editor_it.json +1 -1
  140. package/assets/esri/widgets/Editor/t9n/Editor_ja.json +1 -1
  141. package/assets/esri/widgets/Editor/t9n/Editor_ko.json +1 -1
  142. package/assets/esri/widgets/Editor/t9n/Editor_lt.json +1 -1
  143. package/assets/esri/widgets/Editor/t9n/Editor_lv.json +1 -1
  144. package/assets/esri/widgets/Editor/t9n/Editor_nb.json +1 -1
  145. package/assets/esri/widgets/Editor/t9n/Editor_nl.json +1 -1
  146. package/assets/esri/widgets/Editor/t9n/Editor_pl.json +1 -1
  147. package/assets/esri/widgets/Editor/t9n/Editor_pt-BR.json +1 -1
  148. package/assets/esri/widgets/Editor/t9n/Editor_pt-PT.json +1 -1
  149. package/assets/esri/widgets/Editor/t9n/Editor_ro.json +1 -1
  150. package/assets/esri/widgets/Editor/t9n/Editor_ru.json +1 -1
  151. package/assets/esri/widgets/Editor/t9n/Editor_sk.json +1 -1
  152. package/assets/esri/widgets/Editor/t9n/Editor_sl.json +1 -1
  153. package/assets/esri/widgets/Editor/t9n/Editor_sr.json +1 -1
  154. package/assets/esri/widgets/Editor/t9n/Editor_sv.json +1 -1
  155. package/assets/esri/widgets/Editor/t9n/Editor_th.json +1 -1
  156. package/assets/esri/widgets/Editor/t9n/Editor_tr.json +1 -1
  157. package/assets/esri/widgets/Editor/t9n/Editor_uk.json +1 -1
  158. package/assets/esri/widgets/Editor/t9n/Editor_vi.json +1 -1
  159. package/assets/esri/widgets/Editor/t9n/Editor_zh-CN.json +1 -1
  160. package/assets/esri/widgets/Editor/t9n/Editor_zh-HK.json +1 -1
  161. package/assets/esri/widgets/Editor/t9n/Editor_zh-TW.json +1 -1
  162. package/assets/esri/widgets/Feature/t9n/Feature_ar.json +1 -1
  163. package/assets/esri/widgets/Feature/t9n/Feature_bg.json +1 -1
  164. package/assets/esri/widgets/Feature/t9n/Feature_bs.json +1 -1
  165. package/assets/esri/widgets/Feature/t9n/Feature_ca.json +1 -1
  166. package/assets/esri/widgets/Feature/t9n/Feature_cs.json +1 -1
  167. package/assets/esri/widgets/Feature/t9n/Feature_da.json +1 -1
  168. package/assets/esri/widgets/Feature/t9n/Feature_de.json +1 -1
  169. package/assets/esri/widgets/Feature/t9n/Feature_el.json +1 -1
  170. package/assets/esri/widgets/Feature/t9n/Feature_es.json +1 -1
  171. package/assets/esri/widgets/Feature/t9n/Feature_et.json +1 -1
  172. package/assets/esri/widgets/Feature/t9n/Feature_fi.json +1 -1
  173. package/assets/esri/widgets/Feature/t9n/Feature_fr.json +1 -1
  174. package/assets/esri/widgets/Feature/t9n/Feature_he.json +1 -1
  175. package/assets/esri/widgets/Feature/t9n/Feature_hr.json +1 -1
  176. package/assets/esri/widgets/Feature/t9n/Feature_hu.json +1 -1
  177. package/assets/esri/widgets/Feature/t9n/Feature_id.json +1 -1
  178. package/assets/esri/widgets/Feature/t9n/Feature_it.json +1 -1
  179. package/assets/esri/widgets/Feature/t9n/Feature_ja.json +1 -1
  180. package/assets/esri/widgets/Feature/t9n/Feature_ko.json +1 -1
  181. package/assets/esri/widgets/Feature/t9n/Feature_lt.json +1 -1
  182. package/assets/esri/widgets/Feature/t9n/Feature_lv.json +1 -1
  183. package/assets/esri/widgets/Feature/t9n/Feature_nb.json +1 -1
  184. package/assets/esri/widgets/Feature/t9n/Feature_nl.json +1 -1
  185. package/assets/esri/widgets/Feature/t9n/Feature_pl.json +1 -1
  186. package/assets/esri/widgets/Feature/t9n/Feature_pt-BR.json +1 -1
  187. package/assets/esri/widgets/Feature/t9n/Feature_pt-PT.json +1 -1
  188. package/assets/esri/widgets/Feature/t9n/Feature_ro.json +1 -1
  189. package/assets/esri/widgets/Feature/t9n/Feature_ru.json +1 -1
  190. package/assets/esri/widgets/Feature/t9n/Feature_sk.json +1 -1
  191. package/assets/esri/widgets/Feature/t9n/Feature_sl.json +1 -1
  192. package/assets/esri/widgets/Feature/t9n/Feature_sr.json +1 -1
  193. package/assets/esri/widgets/Feature/t9n/Feature_sv.json +1 -1
  194. package/assets/esri/widgets/Feature/t9n/Feature_th.json +1 -1
  195. package/assets/esri/widgets/Feature/t9n/Feature_tr.json +1 -1
  196. package/assets/esri/widgets/Feature/t9n/Feature_uk.json +1 -1
  197. package/assets/esri/widgets/Feature/t9n/Feature_vi.json +1 -1
  198. package/assets/esri/widgets/Feature/t9n/Feature_zh-CN.json +1 -1
  199. package/assets/esri/widgets/Feature/t9n/Feature_zh-HK.json +1 -1
  200. package/assets/esri/widgets/Feature/t9n/Feature_zh-TW.json +1 -1
  201. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_ar.json +1 -1
  202. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_bg.json +1 -1
  203. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_bs.json +1 -1
  204. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_ca.json +1 -1
  205. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_cs.json +1 -1
  206. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_da.json +1 -1
  207. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_de.json +1 -1
  208. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_el.json +1 -1
  209. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_es.json +1 -1
  210. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_et.json +1 -1
  211. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_fi.json +1 -1
  212. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_fr.json +1 -1
  213. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_he.json +1 -1
  214. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_hr.json +1 -1
  215. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_hu.json +1 -1
  216. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_id.json +1 -1
  217. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_it.json +1 -1
  218. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_ja.json +1 -1
  219. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_ko.json +1 -1
  220. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_lt.json +1 -1
  221. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_lv.json +1 -1
  222. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_nb.json +1 -1
  223. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_nl.json +1 -1
  224. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_pl.json +1 -1
  225. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_pt-BR.json +1 -1
  226. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_pt-PT.json +1 -1
  227. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_ro.json +1 -1
  228. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_ru.json +1 -1
  229. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_sk.json +1 -1
  230. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_sl.json +1 -1
  231. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_sr.json +1 -1
  232. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_sv.json +1 -1
  233. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_th.json +1 -1
  234. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_tr.json +1 -1
  235. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_uk.json +1 -1
  236. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_vi.json +1 -1
  237. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_zh-CN.json +1 -1
  238. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_zh-HK.json +1 -1
  239. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_zh-TW.json +1 -1
  240. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_ja.json +1 -1
  241. package/assets/esri/widgets/Features/t9n/Features_ar.json +1 -1
  242. package/assets/esri/widgets/Features/t9n/Features_bg.json +1 -1
  243. package/assets/esri/widgets/Features/t9n/Features_bs.json +1 -1
  244. package/assets/esri/widgets/Features/t9n/Features_ca.json +1 -1
  245. package/assets/esri/widgets/Features/t9n/Features_cs.json +1 -1
  246. package/assets/esri/widgets/Features/t9n/Features_da.json +1 -1
  247. package/assets/esri/widgets/Features/t9n/Features_de.json +1 -1
  248. package/assets/esri/widgets/Features/t9n/Features_el.json +1 -1
  249. package/assets/esri/widgets/Features/t9n/Features_es.json +1 -1
  250. package/assets/esri/widgets/Features/t9n/Features_et.json +1 -1
  251. package/assets/esri/widgets/Features/t9n/Features_fi.json +1 -1
  252. package/assets/esri/widgets/Features/t9n/Features_fr.json +1 -1
  253. package/assets/esri/widgets/Features/t9n/Features_he.json +1 -1
  254. package/assets/esri/widgets/Features/t9n/Features_hr.json +1 -1
  255. package/assets/esri/widgets/Features/t9n/Features_hu.json +1 -1
  256. package/assets/esri/widgets/Features/t9n/Features_id.json +1 -1
  257. package/assets/esri/widgets/Features/t9n/Features_it.json +1 -1
  258. package/assets/esri/widgets/Features/t9n/Features_ja.json +1 -1
  259. package/assets/esri/widgets/Features/t9n/Features_ko.json +1 -1
  260. package/assets/esri/widgets/Features/t9n/Features_lt.json +1 -1
  261. package/assets/esri/widgets/Features/t9n/Features_lv.json +1 -1
  262. package/assets/esri/widgets/Features/t9n/Features_nb.json +1 -1
  263. package/assets/esri/widgets/Features/t9n/Features_nl.json +1 -1
  264. package/assets/esri/widgets/Features/t9n/Features_pl.json +1 -1
  265. package/assets/esri/widgets/Features/t9n/Features_pt-BR.json +1 -1
  266. package/assets/esri/widgets/Features/t9n/Features_pt-PT.json +1 -1
  267. package/assets/esri/widgets/Features/t9n/Features_ro.json +1 -1
  268. package/assets/esri/widgets/Features/t9n/Features_ru.json +1 -1
  269. package/assets/esri/widgets/Features/t9n/Features_sk.json +1 -1
  270. package/assets/esri/widgets/Features/t9n/Features_sl.json +1 -1
  271. package/assets/esri/widgets/Features/t9n/Features_sr.json +1 -1
  272. package/assets/esri/widgets/Features/t9n/Features_sv.json +1 -1
  273. package/assets/esri/widgets/Features/t9n/Features_th.json +1 -1
  274. package/assets/esri/widgets/Features/t9n/Features_tr.json +1 -1
  275. package/assets/esri/widgets/Features/t9n/Features_uk.json +1 -1
  276. package/assets/esri/widgets/Features/t9n/Features_vi.json +1 -1
  277. package/assets/esri/widgets/Features/t9n/Features_zh-CN.json +1 -1
  278. package/assets/esri/widgets/Features/t9n/Features_zh-HK.json +1 -1
  279. package/assets/esri/widgets/Features/t9n/Features_zh-TW.json +1 -1
  280. package/assets/esri/widgets/Legend/t9n/Legend_ar.json +1 -1
  281. package/assets/esri/widgets/Legend/t9n/Legend_bg.json +1 -1
  282. package/assets/esri/widgets/Legend/t9n/Legend_bs.json +1 -1
  283. package/assets/esri/widgets/Legend/t9n/Legend_ca.json +1 -1
  284. package/assets/esri/widgets/Legend/t9n/Legend_cs.json +1 -1
  285. package/assets/esri/widgets/Legend/t9n/Legend_da.json +1 -1
  286. package/assets/esri/widgets/Legend/t9n/Legend_de.json +1 -1
  287. package/assets/esri/widgets/Legend/t9n/Legend_el.json +1 -1
  288. package/assets/esri/widgets/Legend/t9n/Legend_es.json +1 -1
  289. package/assets/esri/widgets/Legend/t9n/Legend_et.json +1 -1
  290. package/assets/esri/widgets/Legend/t9n/Legend_fi.json +1 -1
  291. package/assets/esri/widgets/Legend/t9n/Legend_fr.json +1 -1
  292. package/assets/esri/widgets/Legend/t9n/Legend_he.json +1 -1
  293. package/assets/esri/widgets/Legend/t9n/Legend_hr.json +1 -1
  294. package/assets/esri/widgets/Legend/t9n/Legend_hu.json +1 -1
  295. package/assets/esri/widgets/Legend/t9n/Legend_id.json +1 -1
  296. package/assets/esri/widgets/Legend/t9n/Legend_it.json +1 -1
  297. package/assets/esri/widgets/Legend/t9n/Legend_ja.json +1 -1
  298. package/assets/esri/widgets/Legend/t9n/Legend_ko.json +1 -1
  299. package/assets/esri/widgets/Legend/t9n/Legend_lt.json +1 -1
  300. package/assets/esri/widgets/Legend/t9n/Legend_lv.json +1 -1
  301. package/assets/esri/widgets/Legend/t9n/Legend_nb.json +1 -1
  302. package/assets/esri/widgets/Legend/t9n/Legend_nl.json +1 -1
  303. package/assets/esri/widgets/Legend/t9n/Legend_pl.json +1 -1
  304. package/assets/esri/widgets/Legend/t9n/Legend_pt-BR.json +1 -1
  305. package/assets/esri/widgets/Legend/t9n/Legend_pt-PT.json +1 -1
  306. package/assets/esri/widgets/Legend/t9n/Legend_ro.json +1 -1
  307. package/assets/esri/widgets/Legend/t9n/Legend_ru.json +1 -1
  308. package/assets/esri/widgets/Legend/t9n/Legend_sk.json +1 -1
  309. package/assets/esri/widgets/Legend/t9n/Legend_sl.json +1 -1
  310. package/assets/esri/widgets/Legend/t9n/Legend_sr.json +1 -1
  311. package/assets/esri/widgets/Legend/t9n/Legend_sv.json +1 -1
  312. package/assets/esri/widgets/Legend/t9n/Legend_th.json +1 -1
  313. package/assets/esri/widgets/Legend/t9n/Legend_tr.json +1 -1
  314. package/assets/esri/widgets/Legend/t9n/Legend_uk.json +1 -1
  315. package/assets/esri/widgets/Legend/t9n/Legend_vi.json +1 -1
  316. package/assets/esri/widgets/Legend/t9n/Legend_zh-CN.json +1 -1
  317. package/assets/esri/widgets/Legend/t9n/Legend_zh-HK.json +1 -1
  318. package/assets/esri/widgets/Legend/t9n/Legend_zh-TW.json +1 -1
  319. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ar.json +1 -1
  320. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_bg.json +1 -1
  321. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_bs.json +1 -1
  322. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ca.json +1 -1
  323. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_cs.json +1 -1
  324. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_da.json +1 -1
  325. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_de.json +1 -1
  326. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_el.json +1 -1
  327. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_es.json +1 -1
  328. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_et.json +1 -1
  329. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_fi.json +1 -1
  330. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_fr.json +1 -1
  331. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_he.json +1 -1
  332. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_hr.json +1 -1
  333. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_hu.json +1 -1
  334. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_id.json +1 -1
  335. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_it.json +1 -1
  336. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ja.json +1 -1
  337. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ko.json +1 -1
  338. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_lt.json +1 -1
  339. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_lv.json +1 -1
  340. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_nb.json +1 -1
  341. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_nl.json +1 -1
  342. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pl.json +1 -1
  343. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pt-BR.json +1 -1
  344. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pt-PT.json +1 -1
  345. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ro.json +1 -1
  346. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ru.json +1 -1
  347. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sk.json +1 -1
  348. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sl.json +1 -1
  349. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sr.json +1 -1
  350. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sv.json +1 -1
  351. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_th.json +1 -1
  352. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_tr.json +1 -1
  353. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_uk.json +1 -1
  354. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_vi.json +1 -1
  355. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-CN.json +1 -1
  356. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-HK.json +1 -1
  357. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-TW.json +1 -1
  358. package/assets/esri/widgets/Popup/t9n/Popup_ar.json +1 -1
  359. package/assets/esri/widgets/Popup/t9n/Popup_bg.json +1 -1
  360. package/assets/esri/widgets/Popup/t9n/Popup_bs.json +1 -1
  361. package/assets/esri/widgets/Popup/t9n/Popup_ca.json +1 -1
  362. package/assets/esri/widgets/Popup/t9n/Popup_cs.json +1 -1
  363. package/assets/esri/widgets/Popup/t9n/Popup_da.json +1 -1
  364. package/assets/esri/widgets/Popup/t9n/Popup_de.json +1 -1
  365. package/assets/esri/widgets/Popup/t9n/Popup_el.json +1 -1
  366. package/assets/esri/widgets/Popup/t9n/Popup_es.json +1 -1
  367. package/assets/esri/widgets/Popup/t9n/Popup_et.json +1 -1
  368. package/assets/esri/widgets/Popup/t9n/Popup_fi.json +1 -1
  369. package/assets/esri/widgets/Popup/t9n/Popup_fr.json +1 -1
  370. package/assets/esri/widgets/Popup/t9n/Popup_he.json +1 -1
  371. package/assets/esri/widgets/Popup/t9n/Popup_hr.json +1 -1
  372. package/assets/esri/widgets/Popup/t9n/Popup_hu.json +1 -1
  373. package/assets/esri/widgets/Popup/t9n/Popup_id.json +1 -1
  374. package/assets/esri/widgets/Popup/t9n/Popup_it.json +1 -1
  375. package/assets/esri/widgets/Popup/t9n/Popup_ja.json +1 -1
  376. package/assets/esri/widgets/Popup/t9n/Popup_ko.json +1 -1
  377. package/assets/esri/widgets/Popup/t9n/Popup_lt.json +1 -1
  378. package/assets/esri/widgets/Popup/t9n/Popup_lv.json +1 -1
  379. package/assets/esri/widgets/Popup/t9n/Popup_nb.json +1 -1
  380. package/assets/esri/widgets/Popup/t9n/Popup_nl.json +1 -1
  381. package/assets/esri/widgets/Popup/t9n/Popup_pl.json +1 -1
  382. package/assets/esri/widgets/Popup/t9n/Popup_pt-BR.json +1 -1
  383. package/assets/esri/widgets/Popup/t9n/Popup_pt-PT.json +1 -1
  384. package/assets/esri/widgets/Popup/t9n/Popup_ro.json +1 -1
  385. package/assets/esri/widgets/Popup/t9n/Popup_ru.json +1 -1
  386. package/assets/esri/widgets/Popup/t9n/Popup_sk.json +1 -1
  387. package/assets/esri/widgets/Popup/t9n/Popup_sl.json +1 -1
  388. package/assets/esri/widgets/Popup/t9n/Popup_sr.json +1 -1
  389. package/assets/esri/widgets/Popup/t9n/Popup_sv.json +1 -1
  390. package/assets/esri/widgets/Popup/t9n/Popup_th.json +1 -1
  391. package/assets/esri/widgets/Popup/t9n/Popup_tr.json +1 -1
  392. package/assets/esri/widgets/Popup/t9n/Popup_uk.json +1 -1
  393. package/assets/esri/widgets/Popup/t9n/Popup_vi.json +1 -1
  394. package/assets/esri/widgets/Popup/t9n/Popup_zh-CN.json +1 -1
  395. package/assets/esri/widgets/Popup/t9n/Popup_zh-HK.json +1 -1
  396. package/assets/esri/widgets/Popup/t9n/Popup_zh-TW.json +1 -1
  397. package/assets/esri/widgets/Sketch/t9n/Sketch_ar.json +1 -1
  398. package/assets/esri/widgets/Sketch/t9n/Sketch_bg.json +1 -1
  399. package/assets/esri/widgets/Sketch/t9n/Sketch_bs.json +1 -1
  400. package/assets/esri/widgets/Sketch/t9n/Sketch_ca.json +1 -1
  401. package/assets/esri/widgets/Sketch/t9n/Sketch_cs.json +1 -1
  402. package/assets/esri/widgets/Sketch/t9n/Sketch_da.json +1 -1
  403. package/assets/esri/widgets/Sketch/t9n/Sketch_de.json +1 -1
  404. package/assets/esri/widgets/Sketch/t9n/Sketch_el.json +1 -1
  405. package/assets/esri/widgets/Sketch/t9n/Sketch_es.json +1 -1
  406. package/assets/esri/widgets/Sketch/t9n/Sketch_et.json +1 -1
  407. package/assets/esri/widgets/Sketch/t9n/Sketch_fi.json +1 -1
  408. package/assets/esri/widgets/Sketch/t9n/Sketch_fr.json +1 -1
  409. package/assets/esri/widgets/Sketch/t9n/Sketch_he.json +1 -1
  410. package/assets/esri/widgets/Sketch/t9n/Sketch_hr.json +1 -1
  411. package/assets/esri/widgets/Sketch/t9n/Sketch_hu.json +1 -1
  412. package/assets/esri/widgets/Sketch/t9n/Sketch_id.json +1 -1
  413. package/assets/esri/widgets/Sketch/t9n/Sketch_it.json +1 -1
  414. package/assets/esri/widgets/Sketch/t9n/Sketch_ja.json +1 -1
  415. package/assets/esri/widgets/Sketch/t9n/Sketch_ko.json +1 -1
  416. package/assets/esri/widgets/Sketch/t9n/Sketch_lt.json +1 -1
  417. package/assets/esri/widgets/Sketch/t9n/Sketch_lv.json +1 -1
  418. package/assets/esri/widgets/Sketch/t9n/Sketch_nb.json +1 -1
  419. package/assets/esri/widgets/Sketch/t9n/Sketch_nl.json +1 -1
  420. package/assets/esri/widgets/Sketch/t9n/Sketch_pl.json +1 -1
  421. package/assets/esri/widgets/Sketch/t9n/Sketch_pt-BR.json +1 -1
  422. package/assets/esri/widgets/Sketch/t9n/Sketch_pt-PT.json +1 -1
  423. package/assets/esri/widgets/Sketch/t9n/Sketch_ro.json +1 -1
  424. package/assets/esri/widgets/Sketch/t9n/Sketch_ru.json +1 -1
  425. package/assets/esri/widgets/Sketch/t9n/Sketch_sk.json +1 -1
  426. package/assets/esri/widgets/Sketch/t9n/Sketch_sl.json +1 -1
  427. package/assets/esri/widgets/Sketch/t9n/Sketch_sr.json +1 -1
  428. package/assets/esri/widgets/Sketch/t9n/Sketch_sv.json +1 -1
  429. package/assets/esri/widgets/Sketch/t9n/Sketch_th.json +1 -1
  430. package/assets/esri/widgets/Sketch/t9n/Sketch_tr.json +1 -1
  431. package/assets/esri/widgets/Sketch/t9n/Sketch_uk.json +1 -1
  432. package/assets/esri/widgets/Sketch/t9n/Sketch_vi.json +1 -1
  433. package/assets/esri/widgets/Sketch/t9n/Sketch_zh-CN.json +1 -1
  434. package/assets/esri/widgets/Sketch/t9n/Sketch_zh-HK.json +1 -1
  435. package/assets/esri/widgets/Sketch/t9n/Sketch_zh-TW.json +1 -1
  436. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_ar.json +1 -1
  437. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_bg.json +1 -1
  438. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_bs.json +1 -1
  439. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_ca.json +1 -1
  440. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_cs.json +1 -1
  441. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_da.json +1 -1
  442. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_de.json +1 -1
  443. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_el.json +1 -1
  444. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_es.json +1 -1
  445. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_et.json +1 -1
  446. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_fi.json +1 -1
  447. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_fr.json +1 -1
  448. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_he.json +1 -1
  449. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_hr.json +1 -1
  450. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_hu.json +1 -1
  451. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_id.json +1 -1
  452. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_it.json +1 -1
  453. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_ja.json +1 -1
  454. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_ko.json +1 -1
  455. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_lt.json +1 -1
  456. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_lv.json +1 -1
  457. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_nb.json +1 -1
  458. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_nl.json +1 -1
  459. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_pl.json +1 -1
  460. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_pt-BR.json +1 -1
  461. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_pt-PT.json +1 -1
  462. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_ro.json +1 -1
  463. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_ru.json +1 -1
  464. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_sk.json +1 -1
  465. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_sl.json +1 -1
  466. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_sr.json +1 -1
  467. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_sv.json +1 -1
  468. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_th.json +1 -1
  469. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_tr.json +1 -1
  470. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_uk.json +1 -1
  471. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_vi.json +1 -1
  472. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_zh-CN.json +1 -1
  473. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_zh-HK.json +1 -1
  474. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_zh-TW.json +1 -1
  475. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_ar.json +1 -1
  476. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_bg.json +1 -1
  477. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_bs.json +1 -1
  478. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_ca.json +1 -1
  479. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_cs.json +1 -1
  480. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_da.json +1 -1
  481. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_de.json +1 -1
  482. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_el.json +1 -1
  483. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_es.json +1 -1
  484. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_et.json +1 -1
  485. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_fi.json +1 -1
  486. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_fr.json +1 -1
  487. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_he.json +1 -1
  488. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_hr.json +1 -1
  489. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_hu.json +1 -1
  490. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_id.json +1 -1
  491. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_it.json +1 -1
  492. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_ja.json +1 -1
  493. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_ko.json +1 -1
  494. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_lt.json +1 -1
  495. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_lv.json +1 -1
  496. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_nb.json +1 -1
  497. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_nl.json +1 -1
  498. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_pl.json +1 -1
  499. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_pt-BR.json +1 -1
  500. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_pt-PT.json +1 -1
  501. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_ro.json +1 -1
  502. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_ru.json +1 -1
  503. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_sk.json +1 -1
  504. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_sl.json +1 -1
  505. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_sr.json +1 -1
  506. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_sv.json +1 -1
  507. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_th.json +1 -1
  508. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_tr.json +1 -1
  509. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_uk.json +1 -1
  510. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_vi.json +1 -1
  511. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_zh-CN.json +1 -1
  512. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_zh-HK.json +1 -1
  513. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_zh-TW.json +1 -1
  514. package/chunks/AtmosphereCompositing.glsl.js +9 -5
  515. package/chunks/ChapmanAtmosphere.glsl.js +6 -6
  516. package/chunks/DefaultMaterial.glsl.js +42 -42
  517. package/chunks/Fog.glsl.js +2 -2
  518. package/chunks/Terrain.glsl.js +7 -7
  519. package/chunks/vec2.js +1 -1
  520. package/copyright.txt +1 -1
  521. package/core/fontUtils.js +1 -1
  522. package/core/libs/gl-matrix-2/math/vec2.js +1 -1
  523. package/core/libs/gl-matrix-2/vec2.js +1 -1
  524. package/core/workers/workers.js +1 -1
  525. package/geometry/Mesh.js +1 -1
  526. package/geometry/support/meshUtils/bounds.js +1 -1
  527. package/geometry/support/meshUtils/georeference.js +1 -1
  528. package/geometry/support/meshUtils/loadGLTFMesh.js +1 -1
  529. package/interfaces.d.ts +738 -131
  530. package/kernel.js +1 -1
  531. package/layers/OrientedImageryLayer.js +1 -1
  532. package/layers/SceneLayer.js +1 -1
  533. package/layers/VideoLayer.js +1 -1
  534. package/layers/graphics/controllers/I3SOnDemandController.js +1 -1
  535. package/layers/graphics/editingSupport.js +1 -1
  536. package/layers/graphics/sources/FeatureLayerSource.js +1 -1
  537. package/layers/graphics/sources/OGCFeatureSource.js +1 -1
  538. package/layers/graphics/sources/support/clientSideDefaults.js +1 -1
  539. package/layers/graphics/sources/support/uploadAssets.js +1 -1
  540. package/layers/mixins/ArcGISImageService.js +1 -1
  541. package/layers/mixins/ImageryTileMixin.js +1 -1
  542. package/layers/orientedImagery/core/ExposurePoint.js +1 -1
  543. package/layers/orientedImagery/core/bestImageUtils.js +1 -1
  544. package/layers/orientedImagery/core/coverageUtils.js +1 -1
  545. package/layers/orientedImagery/transformations/groundToImageUtils.js +1 -1
  546. package/layers/orientedImagery/transformations/imageToGroundUtils.js +1 -1
  547. package/layers/support/SubtypeSublayer.js +1 -1
  548. package/layers/support/capabilities.js +1 -1
  549. package/layers/support/layerUtils.js +1 -1
  550. package/layers/support/serviceCapabilitiesUtils.js +1 -1
  551. package/layers/video/VideoCameraSensorModel.js +5 -0
  552. package/layers/video/VideoController.js +1 -1
  553. package/layers/video/videoUtils.js +1 -1
  554. package/networks/support/TraceJobInfo.d.ts +4 -0
  555. package/package.json +1 -1
  556. package/portal/PortalItem.js +1 -1
  557. package/renderers/support/colorRampUtils.js +1 -1
  558. package/rest/support/meshFeatureSet.js +1 -1
  559. package/smartMapping/labels/bins.d.ts +4 -0
  560. package/smartMapping/labels/bins.js +5 -0
  561. package/smartMapping/labels/clusters.js +1 -1
  562. package/smartMapping/labels/support/utils.js +5 -0
  563. package/smartMapping/support/binningUtils.js +1 -1
  564. package/support/revision.js +1 -1
  565. package/symbols/cim/CIMSymbolDrawHelper.js +1 -1
  566. package/symbols/cim/CIMSymbolHelper.js +1 -1
  567. package/symbols/cim/CIMSymbolRasterizer.js +1 -1
  568. package/symbols/support/previewCIMSymbol.js +1 -1
  569. package/views/2d/MapViewConstraints.js +1 -1
  570. package/views/2d/layers/features/schemaUtils.js +1 -1
  571. package/views/3d/environment/ChapmanAtmosphere.js +1 -1
  572. package/views/3d/interactive/editingTools/draw/DrawGraphicTool3D.js +1 -1
  573. package/views/3d/layers/I3SMeshView3D.js +1 -1
  574. package/views/3d/layers/I3SMeshViewLabeler.js +1 -1
  575. package/views/3d/layers/I3SMeshWorkerHandle.js +1 -1
  576. package/views/3d/layers/SceneLayerWorker.js +1 -1
  577. package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
  578. package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
  579. package/views/3d/layers/i3s/I3SClientMaterialUtil.js +5 -0
  580. package/views/3d/layers/i3s/I3SClientNodeLoader.js +1 -1
  581. package/views/3d/layers/i3s/I3SGeometryUtil.js +1 -1
  582. package/views/3d/layers/i3s/I3SMeshViewFilter.js +1 -1
  583. package/views/3d/layers/i3s/I3SOverrides.js +1 -1
  584. package/views/3d/layers/i3s/featureEditing.js +1 -1
  585. package/views/3d/support/engineContent/line.js +1 -1
  586. package/views/3d/terrain/TerrainRenderer.js +1 -1
  587. package/views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl.js +19 -20
  588. package/views/3d/webgl-engine/core/shaderLibrary/output/OutputHighlight.glsl.js +3 -3
  589. package/views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl.js +2 -2
  590. package/views/3d/webgl-engine/core/shaderLibrary/terrain/TerrainTexture.glsl.js +9 -9
  591. package/views/3d/webgl-engine/lib/CompositingHelper.js +1 -1
  592. package/views/3d/webgl-engine/lib/PathVertex.js +1 -1
  593. package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
  594. package/views/3d/webgl-engine/shaders/AtmosphereCompositing.glsl.js +1 -1
  595. package/views/3d/webgl-engine/shaders/DefaultMaterial.glsl.js +1 -1
  596. package/views/DOMContainer.js +1 -1
  597. package/views/PopupView.js +1 -1
  598. package/views/interactive/editGeometry/operations/ScaleVertex.js +1 -1
  599. package/views/interactive/editGeometry/support/editPlaneUtils.js +1 -1
  600. package/views/interactive/snapping/RightAngleSnapper.js +1 -1
  601. package/views/support/geometry2dUtils.js +1 -1
  602. package/views/support/geometry3dUtils.js +1 -1
  603. package/views/ui/DefaultUI.js +1 -1
  604. package/views/ui/UI.js +1 -1
  605. package/widgets/BasemapGallery.js +1 -1
  606. package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
  607. package/widgets/Editor/CreateFeaturesWorkflowData.js +1 -1
  608. package/widgets/Editor/EditorViewModel.js +1 -1
  609. package/widgets/Editor/UpdateWorkflow.js +1 -1
  610. package/widgets/Editor/workflowUtils.js +1 -1
  611. package/widgets/Editor.js +1 -1
  612. package/widgets/Feature/FeatureMedia.js +1 -1
  613. package/widgets/Feature/support/featureUtils.js +1 -1
  614. package/widgets/FeatureForm/FormExpressionsManager.js +1 -1
  615. package/widgets/FeatureForm/RelationshipInput.js +1 -1
  616. package/widgets/FeatureForm.js +1 -1
  617. package/widgets/FeatureTemplates/ItemList.js +1 -1
  618. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  619. package/widgets/OrientedImageryViewer.js +1 -1
  620. package/widgets/Popup.js +1 -1
  621. package/widgets/UtilityNetworkTrace/UtilityNetworkTraceViewModel.js +1 -1
  622. package/widgets/UtilityNetworkTrace.js +1 -1
  623. package/widgets/UtilityNetworkValidateTopology/UtilityNetworkValidateTopologyViewModel.js +1 -1
  624. package/widgets/support/chartUtils.js +1 -1
  625. package/widgets/support/chartUtilsAm5.js +1 -1
  626. package/assets/esri/core/workers/chunks/013de5c2955801b329b3.js +0 -1
  627. package/assets/esri/core/workers/chunks/030b43764f945cb1f8b0.js +0 -1
  628. package/assets/esri/core/workers/chunks/0618fb0058f39ecd363f.js +0 -1
  629. package/assets/esri/core/workers/chunks/07163dcbb871f927a580.js +0 -1
  630. package/assets/esri/core/workers/chunks/0e46687004392c493c06.js +0 -1
  631. package/assets/esri/core/workers/chunks/21328f3dd26abe84a10d.js +0 -1
  632. package/assets/esri/core/workers/chunks/2faa8f08f2fdaac3f4af.js +0 -1
  633. package/assets/esri/core/workers/chunks/624521961fe1f2c4f2c5.js +0 -1
  634. package/assets/esri/core/workers/chunks/6f510f28526c73ab453c.js +0 -1
  635. package/assets/esri/core/workers/chunks/7479dc0c790337af7597.js +0 -1
  636. package/assets/esri/core/workers/chunks/a6ddf80eb324c35076e1.js +0 -1
  637. package/assets/esri/core/workers/chunks/a7fd2a95fde197c06828.js +0 -1
  638. package/assets/esri/core/workers/chunks/b8e6c64792a512df4c4d.js +0 -1
  639. package/assets/esri/core/workers/chunks/bf9e1fde9f6b2b4f10c0.js +0 -1
  640. package/assets/esri/core/workers/chunks/c96db6b7ce47bd343fdb.js +0 -1
  641. package/assets/esri/core/workers/chunks/cfa3b2b1e184681e9af4.js +0 -1
  642. package/assets/esri/core/workers/chunks/d95ca50ca7af4c222036.js +0 -1
  643. package/assets/esri/core/workers/chunks/ee5ee03dd2c7dc940272.js +0 -1
  644. package/assets/esri/core/workers/chunks/f6e68befe2812b90b40d.js +0 -1
  645. package/assets/esri/core/workers/chunks/f720967ba8c5486a26a2.js +0 -1
  646. package/layers/orientedImagery/core/Affixes.js +0 -5
  647. package/layers/orientedImagery/core/CameraProperties.js +0 -5
  648. package/layers/orientedImagery/core/ImageProperties.js +0 -5
  649. package/layers/orientedImagery/core/ImageryTypes.js +0 -5
  650. package/layers/orientedImagery/core/imageryUtils.js +0 -5
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../../Color.js";import"../../../../core/has.js";import{deg2rad as t}from"../../../../core/mathUtils.js";import{f as r,t as o}from"../../../../chunks/mat3.js";import{c as a}from"../../../../chunks/mat3f64.js";import{f as n,m as s,a as i}from"../../../../chunks/mat4.js";import{c as l,I as u,b as c}from"../../../../chunks/mat4f64.js";import{s as m,a as h,g as f,e as p,n as d,b as g,f as x}from"../../../../chunks/vec3.js";import{Z as _,O as T,c as b}from"../../../../chunks/vec3f64.js";import{O as y}from"../../../../chunks/vec4f64.js";import{computeTranslationToOriginAndRotation as v,projectVectorToDehydratedPoint as C,projectBuffer as O,canProjectWithoutEngine as w}from"../../../../geometry/projection.js";import{create as M,empty as j,expandWithBuffer as A,intersectsClippingArea as P}from"../../../../geometry/support/aaBoundingBox.js";import{newFloatArray as I}from"../../../../geometry/support/FloatArray.js";import{getContinuousIndexArray as R,getZeroIndexArray as E}from"../../../../geometry/support/Indices.js";import N from"../../../../geometry/support/MeshComponent.js";import F from"../../../../geometry/support/MeshMaterialMetallicRoughness.js";import B from"../../../../geometry/support/MeshTextureTransform.js";import{t as S,a as U}from"../../../../chunks/vec32.js";import{transformNormal as L,projectNormalToPCPF as $,transformTangent as G,projectTangentToPCPF as V}from"../../../../geometry/support/meshUtils/projection.js";import{makeDehydratedPoint as D}from"../../../../layers/graphics/dehydratedFeatures.js";import{MeshTransformUpdateAction as k}from"../../../../layers/graphics/sources/interfaces.js";import{ViewingMode as H}from"../../../ViewingMode.js";import{isEncodedMeshTexture as q}from"../../glTF/internal/resourceUtils.js";import{getTransformMatrix as W}from"../../glTF/internal/TextureTransformUtils.js";import{perObjectElevationAligner as z}from"./ElevationAligners.js";import{needsElevationUpdates3D as Y,evaluateElevationInfoAtPoint as Z}from"./elevationAlignmentUtils.js";import{ElevationContext as J}from"./ElevationContext.js";import{Graphics3DMeshObject3DGraphicLayer as K}from"./Graphics3DMeshObject3DGraphicLayer.js";import{Object3DEdgeState as Q}from"./Graphics3DObject3DGraphicLayer.js";import{Graphics3DSymbolLayer as X}from"./Graphics3DSymbolLayer.js";import{MaterialInfoCache as ee,MeshFastUpdateProcessor as te}from"./MeshFastUpdateProcessor.js";import{createMaterial as re}from"../support/edgeUtils.js";import{parseColorMixMode as oe,encodeSymbolColor as ae}from"../support/symbolColorUtils.js";import ne from"../../support/debugFlags.js";import{Attribute as se}from"../../webgl-engine/lib/Attribute.js";import{AlphaDiscardMode as ie,CullFaceOptions as le}from"../../webgl-engine/lib/basicInterfaces.js";import{ContentObjectType as ue}from"../../webgl-engine/lib/ContentObjectType.js";import{Geometry as ce}from"../../webgl-engine/lib/Geometry.js";import{Object3D as me}from"../../webgl-engine/lib/Object3D.js";import{Texture as he}from"../../webgl-engine/lib/Texture.js";import{VertexAttribute as fe}from"../../webgl-engine/lib/VertexAttribute.js";import{DefaultMaterial as pe}from"../../webgl-engine/materials/DefaultMaterial.js";import{NativeLineMaterial as de}from"../../webgl-engine/materials/NativeLineMaterial.js";import{useSchematicPBR as ge,defaultSchematicMRRFactors as xe,defaultAdvancedMRRFactors as _e}from"../../webgl-engine/materials/pbrUtils.js";import{TextureWrapMode as Te}from"../../../webgl/enums.js";const be=["mesh"];class ye extends X{constructor(e,t,r,o){super(e,t,r,o),this._materialInfoCache=new ee,this._fastUpdateProcessor=new te,this._textures=new Map,this.ensureDrapedStatus(!1)}async doLoad(){ne.DRAW_MESH_GEOMETRY_NORMALS&&(this._debugVertexNormalMaterial=new de({color:[1,0,1,1]}),this._debugFaceNormalMaterial=new de({color:[0,1,1,1]}))}destroy(){super.destroy(),this._context.stage.removeMany(this._materialInfoCache.materials),this._context.stage.removeMany(Array.from(this._textures.values())),this._materialInfoCache.clear(),this._textures.clear(),this._fastUpdateProcessor.destroy(this._context.stage)}createGraphics3DGraphic(e){const t=e.graphic;if(!this._validateGeometry(t.geometry,be,"fill on mesh-3d"))return null;const r=this.setGraphicElevationContext(t,new J),o=e.renderingInfo;return this._createAs3DShape(t,o,r,t.uid)}onRemoveGraphic(e){this._fastUpdateProcessor.onRemoveGraphic(e,this._materialInfoCache,this._context)}layerOpacityChanged(e,t){const r=this._getLayerOpacity();this._updateMaterialParameters((e=>{e.material.setParameters({layerOpacity:r});const t=e.material.parameters;this._setMaterialTransparentParameter(t,e),e.material.setParameters({transparent:t.transparent})})),e.forEach((e=>{const o=t(e);null!=o&&o.layerOpacityChanged(r,this._context.isAsync)}))}layerElevationInfoChanged(e,t){return this.updateGraphics3DGraphicElevationInfo(e,t,Y)}slicePlaneEnabledChanged(e,t){return this._updateMaterialParameters((({material:e})=>{e.setParameters({hasSlicePlane:this._context.slicePlaneEnabled})})),e.forEach((e=>{const r=t(e);null!=r&&r.slicePlaneEnabledChanged(this._context.slicePlaneEnabled,this._context.isAsync)})),!0}physicalBasedRenderingChanged(){const e=this._usePBR();return this._updateMaterialParameters((({material:t})=>t.setParameters({usePBR:e}))),!0}updateTransform(e,t,r,o){const a=this._context.renderCoordsHelper.spatialReference,n=Ie,{origin:s,transform:i}=r;switch(v(t,m(Oe,s.x,s.y,s.z??0),n,a),o){case k.EnableFastUpdates:this._fastUpdateProcessor.enable(e,this._materialInfoCache,this._context);break;case k.DisableFastUpdates:this._fastUpdateProcessor.disable(e,this._materialInfoCache,this._context);break;case k.UpdateFastLocalOrigin:e.updateFastLocalOrigin(n,i,this._context.localOriginFactory)}const{elevationContext:l}=e;l.centerPointInElevationSR=this._getCenterPointInElevationSR(n);const{elevationProvider:u,renderCoordsHelper:c}=this._context,h=(e,t)=>Z(e,u,l,c,t);return e.alignedSampledElevation=z(e,l,u.spatialReference,h,c,n),e.updateTransform(n,i,this._context.isAsync),!0}_requiresSymbolVertexColors(){return this._drivenProperties.color||this._drivenProperties.opacity}_colorOrTextureUid(t){return null==t?"-":t instanceof e?t.toHex():t.contentHash}_materialPropertiesDefault(e,t){const r=this._requiresSymbolVertexColors(),o=!!e.vertexAttributes.color,a=!!e.vertexAttributes.tangent;return{hasSymbolVertexColors:r,hasVertexColors:o,hasVertexTangents:a,uid:`vc:${o},vt:${a},vct${t},svc:${r}`}}_textureTransformUid(e){const{offset:t,scale:r,rotation:o}=e??Ne;return`${t[0]},${t[1]},${o},${r[0]},${r[1]}`}_materialProperties(e,t,r){const o=this._materialPropertiesDefault(e,r);if(!t.material)return o;const{color:a,colorTexture:n,colorTextureTransform:s,normalTexture:i,normalTextureTransform:l,doubleSided:u,alphaCutoff:c,alphaMode:m}=t.material,h=this._colorOrTextureUid(a),f=this._colorOrTextureUid(n),p=this._textureTransformUid(s),d=this._colorOrTextureUid(i),g=this._textureTransformUid(l);if(o.color=a,o.colorTexture=n,o.normalTexture=i,o.uid=`${o.uid},cmuid:${h},ctmuid:${f},cttuid:${p},ntmuid:${d},nttuid:${g},ds:${u},ac:${c},am:${m}`,t.material instanceof F){const{metallic:e,roughness:r,metallicRoughnessTexture:a,metallicRoughnessTextureTransform:n,emissiveColor:i,emissiveTexture:u,emissiveTextureTransform:c,occlusionTexture:m,occlusionTextureTransform:h}=t.material,f=this._colorOrTextureUid(a),p=this._textureTransformUid(n),d=this._colorOrTextureUid(i),g=this._colorOrTextureUid(u),x=this._textureTransformUid(c),_=this._colorOrTextureUid(m),T=this._textureTransformUid(h);o.metallic=e,o.roughness=r,o.metallicRoughnessTexture=a,o.emissiveColor=i,o.emissiveTexture=u,o.occlusionTexture=m,o.colorTextureTransform=this._convertTextureTransform(s),o.normalTextureTransform=this._convertTextureTransform(l),o.emissiveTextureTransform=this._convertTextureTransform(c),o.occlusionTextureTransform=this._convertTextureTransform(h),o.metallicRoughnessTextureTransform=this._convertTextureTransform(n),o.uid=`${o.uid},mrm:${e},mrr:${r},mrt:${f},mrtt:${p},emuid:${d},etmuid:${g},ett:${x},otmuid:${_},ott:${T}`}return o}_convertTextureTransform(e){if(!e)return null;const{scale:r,offset:o,rotation:a}=e;return{scale:r,offset:o,rotation:t(a)}}_setInternalColorValueParameters(t,r){r.diffuse=e.toUnitRGB(t),r.opacity=t.a}_getLoadableTextureResource(e){return e.data?e.data:e.url}_getInternalTextureId(e){const t=this._getInternalTexture(e,ie.Opaque);return null!=t?t.id:null}_getInternalTexture(e,t){const r=this._getLoadableTextureResource(e);if(!r)return null;const o=`${e.contentHash}/${t}`;let a=this._textures.get(o);return a||(a=new he(q(r)?r.data:r,{mipmap:!0,wrap:this._castTextureWrap(e.wrap),noUnpackFlip:!0,preMultiplyAlpha:!q(r)&&t!==ie.Opaque,encoding:q(r)&&null!=r.encoding?r.encoding:void 0}),this._textures.set(o,a),this._context.stage.add(a),this._context.stage.loadImmediate(a)),a}_castTextureWrap(e="repeat"){if("string"==typeof e){const t=this._castTextureWrapIndividual(e);return{s:t,t}}return{s:this._castTextureWrapIndividual(e.horizontal),t:this._castTextureWrapIndividual(e.vertical)}}_castTextureWrapIndividual(e){switch(e){case"clamp":return Te.CLAMP_TO_EDGE;case"mirror":return Te.MIRRORED_REPEAT;default:return Te.REPEAT}}_setInternalMaterialParameters(t,r){if(null!=t.color&&this._setInternalColorValueParameters(t.color,r),null!=t.colorTexture){const e=this._getInternalTexture(t.colorTexture,r.textureAlphaMode);null!=e?(r.textureId=e.id,r.textureAlphaPremultiplied=!!e.parameters.preMultiplyAlpha):r.textureId=void 0}null!=t.normalTexture&&(r.normalTextureId=this._getInternalTextureId(t.normalTexture)),null!=t.emissiveColor&&(r.emissiveFactor=e.toUnitRGB(t.emissiveColor)),null!=t.emissiveTexture&&(r.emissiveTextureId=this._getInternalTextureId(t.emissiveTexture)),null!=t.occlusionTexture&&(r.occlusionTextureId=this._getInternalTextureId(t.occlusionTexture)),null!=t.metallicRoughnessTexture&&(r.metallicRoughnessTextureId=this._getInternalTextureId(t.metallicRoughnessTexture)),r.colorTextureTransformMatrix=W(t.colorTextureTransform),r.normalTextureTransformMatrix=W(t.normalTextureTransform),r.occlusionTextureTransformMatrix=W(t.occlusionTextureTransform),r.emissiveTextureTransformMatrix=W(t.emissiveTextureTransform),r.metallicRoughnessTextureTransformMatrix=W(t.metallicRoughnessTextureTransform)}_setExternalMaterialParameters(t){const r=this._drivenProperties.color;let o=null!=this.symbolLayer.material?this.symbolLayer.material.colorMixMode:null;if(r)t.externalColor=y;else{const r=null!=this.symbolLayer.material?this.symbolLayer.material.color:null;null!=r?t.externalColor=e.toUnitRGBA(r):(o=null,t.externalColor=y)}o&&(t.colorMixMode=o),t.castShadows=!!this.symbolLayer.castShadows}_hasTransparentVertexColors(e){const t=e.vertexAttributes.color;if(null==t)return!1;for(let r=3;r<t.length;r+=4)if(255!==t[r])return!0;return!1}_getOrCreateMaterial(t,r){const o=r.material?.color,a=r.material?.colorTexture,n=r.material?.alphaMode,s="blend"===n,i=!("opaque"===n)&&(this._hasTransparentVertexColors(t)||null!=o&&o.a<1||null!=a&&a.transparent||s),l=this._materialProperties(t,r,i),u=this._materialInfoCache.byUid(l.uid);if(u)return u.material;const c={uid:l.uid,material:null,isComponentTransparent:i,alphaMode:r.material?r.material.alphaMode:"opaque"},m=ge({normalTexture:l.normalTexture,metallicRoughnessTexture:l.metallicRoughnessTexture,metallicFactor:l.metallic,roughnessFactor:l.roughness,emissiveTexture:l.emissiveTexture,emissiveFactor:e.toUnitRGBA(l.emissiveColor),occlusionTexture:l.occlusionTexture}),h={usePBR:this._usePBR(),isSchematic:m,hasVertexColors:l.hasVertexColors,hasSymbolColors:l.hasSymbolVertexColors,hasVertexTangents:l.hasVertexTangents,ambient:_,diffuse:T,opacity:1,doubleSided:!0,doubleSidedType:"winding-order",cullFace:le.None,layerOpacity:this._getLayerOpacity(),hasSlicePlane:this._context.slicePlaneEnabled,initTextureTransparent:!0};h.mrrFactors=m?[...xe]:[l.metallic,l.roughness,_e[2]],r.material&&(h.doubleSided=r.material.doubleSided,h.cullFace=r.material.doubleSided?le.None:le.Back,h.textureAlphaCutoff=r.material.alphaCutoff),this._setExternalMaterialParameters(h),this._setMaterialTransparentParameter(h,c),this._setInternalMaterialParameters(l,h);const f=new pe(h);return c.material=f,this._materialInfoCache.set(l.uid,c),this._context.stage.add(f),f}_usePBR(){return this._context.physicalBasedRenderingEnabled}_setMaterialTransparentParameter(e,t){e.transparent=this.needsDrivenTransparentPass||t.isComponentTransparent||e.layerOpacity<1||e.opacity<1||e.externalColor&&e.externalColor[3]<1,"auto"===t.alphaMode?e.textureAlphaMode=e.transparent?ie.MaskBlend:ie.Opaque:e.textureAlphaMode="opaque"===t.alphaMode?ie.Opaque:"mask"===t.alphaMode?ie.Mask:ie.Blend}_addDebugNormals(e,t){const r=t.length,o=e.spatialReference.isGeographic?20015077/180:1,a=.1*Math.max(e.extent.width*o,e.extent.height*o,e.extent.zmax-e.extent.zmin),n=[],s=[],i=[],l=[];for(let p=0;p<r;p++){const e=t[p],r=e.vertexAttributes.get(fe.POSITION),o=e.vertexAttributes.get(fe.NORMAL),u=e.indices.get(fe.POSITION),c=e.indices.get(fe.NORMAL),m=r.data,d=o.data;for(let t=0;t<u.length;t++){const e=3*u[t],r=3*c[t];for(let t=0;t<3;t++)n.push(m[e+t]);for(let t=0;t<3;t++)n.push(m[e+t]+d[r+t]*a);if(s.push(s.length),s.push(s.length),t%3==0){this._calculateFaceNormal(m,u,t,je),this._getFaceVertices(m,u,t,Oe,we,Me),h(Oe,Oe,we),h(Oe,Oe,Me),f(Oe,Oe,1/3);for(let e=0;e<3;e++)i.push(Oe[e]);for(let e=0;e<3;e++)i.push(Oe[e]+je[e]*a);l.push(l.length),l.push(l.length)}}}const u=t[0].transformation,c=new ce(this._debugVertexNormalMaterial,[[fe.POSITION,new se(n,3,!0)]],[[fe.POSITION,s]],null,ue.Line);t.push(c),c.transformation=u;const m=new ce(this._debugFaceNormalMaterial,[[fe.POSITION,new se(i,3,!0)]],[[fe.POSITION,l]],null,ue.Line);m.transformation=u,t.push(m)}_createAs3DShape(e,t,r,o){const a=e.geometry;if("mesh"!==a.type)return null;const n=this._createGeometryInfo(a,t,o);if(null==n)return null;const{geometries:s,objectTransformation:i}=n;ne.DRAW_MESH_GEOMETRY_NORMALS&&this._addDebugNormals(a,s);const l=new me({geometries:s,layerUid:this._context.layer.uid,graphicUid:o});l.transformation=i;const u=re(this.symbolLayer,{opacity:this._getLayerOpacity()}),c=null!=u?new Q(s[0].material,[u],{mergeGeometries:!0,hasSlicePlane:this._context.slicePlaneEnabled}):null,m=new K(this,l,s,null,null,z,r,c);this._fastUpdateProcessor.onAddGraphic(),m.needsElevationUpdates=Y(r.mode),m.useObjectOriginAsAttachmentOrigin=!0,r.centerPointInElevationSR=this._getCenterPointInElevationSR(l.transformation);const{elevationProvider:h,renderCoordsHelper:f}=this._context,p=(e,t)=>Z(e,h,r,f,t);return m.alignedSampledElevation=z(m,r,h.spatialReference,p,f),m}_getCenterPointInElevationSR(e){const t=D(0,0,0,null!=this._context.elevationProvider.spatialReference?this._context.elevationProvider.spatialReference:null);return C([e[12],e[13],e[14]],this._context.renderCoordsHelper.spatialReference,t),t}_createComponentNormals(e,t,r,o){switch(r.shading||"flat"){default:case"source":return this._createComponentNormalsSource(e,t,r,o);case"flat":return this._createComponentNormalsFlat(e,o);case"smooth":return this._createComponentNormalsSmooth(e,o)}}_createComponentNormalsSource(e,t,r,o){if(null==t)return this._createComponentNormalsFlat(e,o);let a=!1;if(!r.trustSourceNormals)for(let n=0;n<o.length;n+=3){this._calculateFaceNormal(e,o,n,je);for(let e=0;e<3;e++){const r=3*o[n+e];Oe[0]=t[r],Oe[1]=t[r+1],Oe[2]=t[r+2],p(je,Oe)<0&&(t[r]=-t[r],t[r+1]=-t[r+1],t[r+2]=-t[r+2],a=!0)}}return new ve(t,o,a)}_createComponentNormalsFlat(e,t){const r=I(t.length),o=new Array(3*t.length);for(let a=0;a<t.length;a+=3){const n=this._calculateFaceNormal(e,t,a,je);for(let e=0;e<3;e++)r[a+e]=n[e],o[a+e]=a/3}return new ve(r,o,!1)}_createComponentNormalsSmooth(e,t){const r={};for(let n=0;n<t.length;n+=3){const o=this._calculateFaceNormal(e,t,n,je);for(let e=0;e<3;e++){const a=t[n+e];let s=r[a];s||(s={normal:b(),count:0},r[a]=s),h(s.normal,s.normal,o),s.count++}}const o=I(3*t.length),a=new Array(3*t.length);for(let n=0;n<t.length;n++){const e=r[t[n]];1!==e.count&&(d(e.normal,e.normal),e.count=1);for(let t=0;t<3;t++)o[3*n+t]=e.normal[t];a[n]=n}return new ve(o,a,!1)}_getFaceVertices(e,t,r,o,a,n){const s=3*t[r],i=3*t[r+1],l=3*t[r+2];o[0]=e[s],o[1]=e[s+1],o[2]=e[s+2],a[0]=e[i],a[1]=e[i+1],a[2]=e[i+2],n[0]=e[l],n[1]=e[l+1],n[2]=e[l+2]}_calculateFaceNormal(e,t,r,o){return this._getFaceVertices(e,t,r,Oe,we,Me),g(we,we,Oe),g(Me,Me,Oe),x(Oe,we,Me),d(o,Oe),o}_getOrCreateComponents(e){return e.components??Ee}_createPositionBuffer(e,t){let r=e.vertexAttributes.position;const o=t.reprojection===Fe.ECEF?t.transformBeforeProject:null;if(null!=o&&(r=S(new Float64Array(r.length),r,o)),t.reprojection===Fe.NONE)return t.needsBufferCopy?new Float64Array(r):r;const a=null!=o?r:new Float64Array(r.length);return O(r,e.spatialReference,0,a,this._context.renderCoordsHelper.spatialReference,0,r.length/3),a}_createNormalBuffer(e,t,r){let o=e.vertexAttributes.normal;if(null==o)return null;const a=r.reprojection===Fe.ECEF?r.transformBeforeProject:null;null!=a&&(o=L(o,new Float32Array(o.length),a));if("local"===this._context.graphicsCoreOwner.view.viewingMode||r.reprojection===Fe.NONE)return r.needsBufferCopy&&e.vertexAttributes.normal===o?new Float32Array(o):o;const n=e.vertexAttributes.position,s=null!=a?o:new Float32Array(o.length);return $(o,n,t,e.spatialReference,s)}_createTangentBuffer(e,t,r){let o=e.vertexAttributes.tangent;if(null==o)return null;const a=r.reprojection===Fe.ECEF?r.transformBeforeProject:null;null!=a&&(o=G(o,new Float32Array(o.length),a));if("local"===this._context.graphicsCoreOwner.view.viewingMode||r.reprojection===Fe.NONE)return r.needsBufferCopy&&e.vertexAttributes.normal===o?new Float32Array(o):o;const n=e.vertexAttributes.position,s=null!=a?o:new Float32Array(o.length);return V(o,n,t,e.spatialReference,s)}_createColorBuffer(e){return e.vertexAttributes.color}_createSymbolColorBuffer(e){if(this._requiresSymbolVertexColors()){const t=this._getVertexOpacityAndColor(e),r=oe(this.symbolLayer?.material?.colorMixMode),o=new Uint8Array(4);return ae(t,r,o),o}return null}_createBuffers(e,t){const r=e.vertexAttributes&&e.vertexAttributes.position;if(!r)return this.logger.warn("Mesh geometry must contain position vertex attributes"),null;const o=e.vertexAttributes.normal,a=e.vertexAttributes.uv,n=e.vertexAttributes.tangent;if(null!=o&&o.length!==r.length)return this.logger.warn("Mesh normal vertex buffer must contain the same number of elements as the position buffer"),null;if(null!=n&&n.length/4!=r.length/3)return this.logger.warn("Mesh tangent vertex buffer must contain the same number of elements as the position buffer"),null;if(null!=a&&a.length/2!=r.length/3)return this.logger.warn("Mesh uv vertex buffer must contain the same number of elements as the position buffer"),null;const s=this._computeReprojectionInfo(e),i=this._createPositionBuffer(e,s),u=this._createColorBuffer(e),c=this._createSymbolColorBuffer(t),m=this._createNormalBuffer(e,i,s),h=this._createTangentBuffer(e,i,s);return{positionBuffer:i,normalBuffer:m,tangentBuffer:h,uvBuffer:a,colorBuffer:u,symbolColorBuffer:c,objectTransformation:s.reprojection===Fe.NONE&&null!=s.objectTransformation?s.objectTransformation:this._transformOriginLocal(e,i,m,h),geometryTransformation:s.reprojection===Fe.NONE&&null!=s.geometryTransformation?s.geometryTransformation:l()}}_computeReprojectionInfo(e){const{vertexSpace:t}=e,r=t.isRelative,o=t.isGeoreferenced?this._context.renderCoordsHelper.viewingMode===H.Local?Fe.NONE:Fe.ECEF:Fe.NONE;if(r){const{origin:r}=t,a=l(),i=e.transform?.localMatrix??u;if(o===Fe.NONE){v(e.spatialReference,r,a,this._context.renderCoordsHelper.spatialReference);return{reprojection:o,objectTransformation:a,geometryTransformation:c(i),needsBufferCopy:!1}}const m=n(l(),r);return s(m,m,i),{reprojection:o,transformBeforeProject:m,needsBufferCopy:!0}}return{reprojection:o,needsBufferCopy:!0}}_transformOriginLocal(e,t,a,n){const s=this._context.renderCoordsHelper.spatialReference,u=e.anchor;Ce[0]=u.x,Ce[1]=u.y,Ce[2]=u.z??0;const c=l();return v(e.spatialReference,Ce,c,s),i(Ae,c),S(t,t,Ae),null==a&&null==n||(r(Pe,c),o(Pe,Pe),null!=a&&U(a,a,Pe),null!=n&&U(n,n,Pe,4)),c}_validateFaces(e,t){const r=e.vertexAttributes.position.length/3,o=t.faces;if(o){let e=-1;for(let t=0;t<o.length;t++){const r=o[t];r>e&&(e=r)}if(r<=e)return this.logger.warn(`Vertex index ${e} is out of bounds of the mesh position buffer`),!1}else if(r%3!=0)return this.logger.warn("Mesh position buffer length must be a multiple of 9 if no component faces are defined (3 values per vertex * 3 vertices per triangle)"),!1;return!0}_getOrCreateFaces(e,t){return t.faces??R(e.vertexAttributes.position.length/3)}_isOutsideClippingArea(e){if(!this._context.clippingExtent)return!1;const t=e.vertexAttributes&&e.vertexAttributes.position;if(!t)return!1;const r=this._context.elevationProvider.spatialReference;let o;const a=t.length/3;return null==r||e.spatialReference.equals(r)?o=t:(o=new Float64Array(t.length),O(e.vertexAttributes.position,e.spatialReference,0,o,r,0,a)),j(Re),A(Re,o,0,a),!P(Re,this._context.clippingExtent)}_createGeometryInfo(e,t,r){if(!w(e.spatialReference,this._context.graphicsCoreOwner.view.spatialReference))return this.logger.warn("Geometry spatial reference is not compatible with the view"),null;if(this._isOutsideClippingArea(e))return null;const o=this._createBuffers(e,t);if(null==o)return null;const{positionBuffer:a,uvBuffer:n,colorBuffer:s,symbolColorBuffer:i,normalBuffer:l,tangentBuffer:u,objectTransformation:c,geometryTransformation:m}=o,h=this._getOrCreateComponents(e),f=new Array;let p=!1;for(const d of h){if(!this._validateFaces(e,d))return null;const t=this._getOrCreateFaces(e,d);if(0===t.length)continue;const o=this._createComponentNormals(a,l,d,t);o.didFlipNormals&&(p=!0);const c=[[fe.POSITION,new se(a,3,!0)],[fe.NORMAL,new se(o.normals,3,!0)]],h=[[fe.POSITION,t],[fe.NORMAL,o.indices]];null!=s&&(c.push([fe.COLOR,new se(s,4,!0)]),h.push([fe.COLOR,t])),null!=i&&(c.push([fe.SYMBOLCOLOR,new se(i,4,!0)]),h.push([fe.SYMBOLCOLOR,E(t.length)])),null!=n&&(c.push([fe.UV0,new se(n,2,!0)]),h.push([fe.UV0,t])),null!=u&&(c.push([fe.TANGENT,new se(u,4,!0)]),h.push([fe.TANGENT,t]));const g=this._context.stage.renderView.getObjectAndLayerIdColor({graphicUid:r,layerUid:this._context.layer.uid}),x=this._getOrCreateMaterial(e,d),_=new ce(x,c,h,null,ue.Mesh,g);_.transformation=m,f.push(_)}return p&&this.logger.warn("Normals have been automatically flipped to be consistent with the counter clock wise face winding order. It is better to generate mesh geometries that have consistent normals."),{geometries:f,objectTransformation:c}}_updateMaterialParameters(e){this._materialInfoCache.forEachMaterialInfo(e),this._fastUpdateProcessor.forEachMaterialInfo(e),this._fastUpdateProcessor.forEachClonedMaterial(((e,t)=>{t.setParameters(e.parameters)}))}test(){return{...super.test(),materials:this._materialInfoCache.materials}}}class ve{constructor(e,t,r){this.normals=e,this.indices=t,this.didFlipNormals=r}}const Ce=b(),Oe=b(),we=b(),Me=b(),je=b(),Ae=l(),Pe=a(),Ie=l(),Re=M(),Ee=[new N],Ne=new B;var Fe;!function(e){e[e.NONE=0]="NONE",e[e.ECEF=1]="ECEF"}(Fe||(Fe={}));export{ye as Graphics3DMeshFillSymbolLayer};
5
+ import e from"../../../../Color.js";import"../../../../core/has.js";import{deg2rad as t}from"../../../../core/mathUtils.js";import{f as r,t as o}from"../../../../chunks/mat3.js";import{c as a}from"../../../../chunks/mat3f64.js";import{f as n,m as s,a as i}from"../../../../chunks/mat4.js";import{c as l,I as u,b as c}from"../../../../chunks/mat4f64.js";import{s as m,a as h,g as f,e as p,n as d,b as g,f as x}from"../../../../chunks/vec3.js";import{Z as _,O as T,c as b}from"../../../../chunks/vec3f64.js";import{O as y}from"../../../../chunks/vec4f64.js";import{computeTranslationToOriginAndRotation as v,projectVectorToDehydratedPoint as C,projectBuffer as O,canProjectWithoutEngine as w}from"../../../../geometry/projection.js";import{create as M,empty as j,expandWithBuffer as P,intersectsClippingArea as A}from"../../../../geometry/support/aaBoundingBox.js";import{newFloatArray as I}from"../../../../geometry/support/FloatArray.js";import{getContinuousIndexArray as R,getZeroIndexArray as E}from"../../../../geometry/support/Indices.js";import N from"../../../../geometry/support/MeshComponent.js";import F from"../../../../geometry/support/MeshMaterialMetallicRoughness.js";import B from"../../../../geometry/support/MeshTextureTransform.js";import{t as S,a as U}from"../../../../chunks/vec32.js";import{transformNormal as L,projectNormalToPCPF as $,transformTangent as G,projectTangentToPCPF as V}from"../../../../geometry/support/meshUtils/projection.js";import{makeDehydratedPoint as D}from"../../../../layers/graphics/dehydratedFeatures.js";import{MeshTransformUpdateAction as k}from"../../../../layers/graphics/sources/interfaces.js";import{ViewingMode as H}from"../../../ViewingMode.js";import{isEncodedMeshTexture as q}from"../../glTF/internal/resourceUtils.js";import{getTransformMatrix as W}from"../../glTF/internal/TextureTransformUtils.js";import{perObjectElevationAligner as z}from"./ElevationAligners.js";import{needsElevationUpdates3D as Y,evaluateElevationInfoAtPoint as Z}from"./elevationAlignmentUtils.js";import{ElevationContext as J}from"./ElevationContext.js";import{Graphics3DMeshObject3DGraphicLayer as K}from"./Graphics3DMeshObject3DGraphicLayer.js";import{Object3DEdgeState as Q}from"./Graphics3DObject3DGraphicLayer.js";import{Graphics3DSymbolLayer as X}from"./Graphics3DSymbolLayer.js";import{MaterialInfoCache as ee,MeshFastUpdateProcessor as te}from"./MeshFastUpdateProcessor.js";import{createMaterial as re}from"../support/edgeUtils.js";import{parseColorMixMode as oe,encodeSymbolColor as ae}from"../support/symbolColorUtils.js";import ne from"../../support/debugFlags.js";import{Attribute as se}from"../../webgl-engine/lib/Attribute.js";import{AlphaDiscardMode as ie,CullFaceOptions as le}from"../../webgl-engine/lib/basicInterfaces.js";import{ContentObjectType as ue}from"../../webgl-engine/lib/ContentObjectType.js";import{Geometry as ce}from"../../webgl-engine/lib/Geometry.js";import{Object3D as me}from"../../webgl-engine/lib/Object3D.js";import{Texture as he}from"../../webgl-engine/lib/Texture.js";import{VertexAttribute as fe}from"../../webgl-engine/lib/VertexAttribute.js";import{DefaultMaterial as pe}from"../../webgl-engine/materials/DefaultMaterial.js";import{NativeLineMaterial as de}from"../../webgl-engine/materials/NativeLineMaterial.js";import{useSchematicPBR as ge,defaultSchematicMRRFactors as xe,defaultAdvancedMRRFactors as _e}from"../../webgl-engine/materials/pbrUtils.js";import{TextureWrapMode as Te}from"../../../webgl/enums.js";const be=["mesh"];class ye extends X{constructor(e,t,r,o){super(e,t,r,o),this._materialInfoCache=new ee,this._fastUpdateProcessor=new te,this._textures=new Map,this.ensureDrapedStatus(!1)}async doLoad(){ne.DRAW_MESH_GEOMETRY_NORMALS&&(this._debugVertexNormalMaterial=new de({color:[1,0,1,1]}),this._debugFaceNormalMaterial=new de({color:[0,1,1,1]}))}destroy(){super.destroy(),this._context.stage.removeMany(this._materialInfoCache.materials),this._context.stage.removeMany(Array.from(this._textures.values())),this._materialInfoCache.clear(),this._textures.clear(),this._fastUpdateProcessor.destroy(this._context.stage)}createGraphics3DGraphic(e){const t=e.graphic;if(!this._validateGeometry(t.geometry,be,"fill on mesh-3d"))return null;const r=this.setGraphicElevationContext(t,new J),o=e.renderingInfo;return this._createAs3DShape(t,o,r,t.uid)}onRemoveGraphic(e){this._fastUpdateProcessor.onRemoveGraphic(e,this._materialInfoCache,this._context)}layerOpacityChanged(e,t){const r=this._getLayerOpacity();this._updateMaterialParameters((e=>{e.material.setParameters({layerOpacity:r});const t=e.material.parameters;this._setMaterialTransparentParameter(t,e),e.material.setParameters({transparent:t.transparent})})),e.forEach((e=>{const o=t(e);null!=o&&o.layerOpacityChanged(r,this._context.isAsync)}))}layerElevationInfoChanged(e,t){return this.updateGraphics3DGraphicElevationInfo(e,t,Y)}slicePlaneEnabledChanged(e,t){return this._updateMaterialParameters((({material:e})=>{e.setParameters({hasSlicePlane:this._context.slicePlaneEnabled})})),e.forEach((e=>{const r=t(e);null!=r&&r.slicePlaneEnabledChanged(this._context.slicePlaneEnabled,this._context.isAsync)})),!0}physicalBasedRenderingChanged(){const e=this._usePBR();return this._updateMaterialParameters((({material:t})=>t.setParameters({usePBR:e}))),!0}updateTransform(e,t,r,o){const a=this._context.renderCoordsHelper.spatialReference,n=Ie,{origin:s,transform:i}=r;switch(v(t,m(Oe,s.x,s.y,s.z??0),n,a),o){case k.EnableFastUpdates:this._fastUpdateProcessor.enable(e,this._materialInfoCache,this._context);break;case k.DisableFastUpdates:this._fastUpdateProcessor.disable(e,this._materialInfoCache,this._context);break;case k.UpdateFastLocalOrigin:e.updateFastLocalOrigin(n,i,this._context.localOriginFactory)}const{elevationContext:l}=e;l.centerPointInElevationSR=this._getCenterPointInElevationSR(n);const{elevationProvider:u,renderCoordsHelper:c}=this._context,h=(e,t)=>Z(e,u,l,c,t);return e.alignedSampledElevation=z(e,l,u.spatialReference,h,c,n),e.updateTransform(n,i,this._context.isAsync),!0}_requiresSymbolVertexColors(){return this._drivenProperties.color||this._drivenProperties.opacity}_colorOrTextureUid(t){return null==t?"-":t instanceof e?t.toHex():t.contentHash}_materialPropertiesDefault(e,t){const r=this._requiresSymbolVertexColors(),o=!!e.vertexAttributes.color,a=!!e.vertexAttributes.tangent;return{hasSymbolVertexColors:r,hasVertexColors:o,hasVertexTangents:a,uid:`vc:${o},vt:${a},vct${t},svc:${r}`}}_textureTransformUid(e){const{offset:t,scale:r,rotation:o}=e??Ne;return`${t[0]},${t[1]},${o},${r[0]},${r[1]}`}_materialProperties(e,t,r){const o=this._materialPropertiesDefault(e,r);if(!t.material)return o;const{color:a,colorTexture:n,colorTextureTransform:s,normalTexture:i,normalTextureTransform:l,doubleSided:u,alphaCutoff:c,alphaMode:m}=t.material,h=this._colorOrTextureUid(a),f=this._colorOrTextureUid(n),p=this._textureTransformUid(s),d=this._colorOrTextureUid(i),g=this._textureTransformUid(l);if(o.color=a,o.colorTexture=n,o.normalTexture=i,o.uid=`${o.uid},cmuid:${h},ctmuid:${f},cttuid:${p},ntmuid:${d},nttuid:${g},ds:${u},ac:${c},am:${m}`,t.material instanceof F){const{metallic:e,roughness:r,metallicRoughnessTexture:a,metallicRoughnessTextureTransform:n,emissiveColor:i,emissiveTexture:u,emissiveTextureTransform:c,occlusionTexture:m,occlusionTextureTransform:h}=t.material,f=this._colorOrTextureUid(a),p=this._textureTransformUid(n),d=this._colorOrTextureUid(i),g=this._colorOrTextureUid(u),x=this._textureTransformUid(c),_=this._colorOrTextureUid(m),T=this._textureTransformUid(h);o.metallic=e,o.roughness=r,o.metallicRoughnessTexture=a,o.emissiveColor=i,o.emissiveTexture=u,o.occlusionTexture=m,o.colorTextureTransform=this._convertTextureTransform(s),o.normalTextureTransform=this._convertTextureTransform(l),o.emissiveTextureTransform=this._convertTextureTransform(c),o.occlusionTextureTransform=this._convertTextureTransform(h),o.metallicRoughnessTextureTransform=this._convertTextureTransform(n),o.uid=`${o.uid},mrm:${e},mrr:${r},mrt:${f},mrtt:${p},emuid:${d},etmuid:${g},ett:${x},otmuid:${_},ott:${T}`}return o}_convertTextureTransform(e){if(!e)return null;const{scale:r,offset:o,rotation:a}=e;return{scale:r,offset:o,rotation:t(a)}}_setInternalColorValueParameters(t,r){r.diffuse=e.toUnitRGB(t),r.opacity=t.a}_getLoadableTextureResource(e){return e.data?e.data:e.url}_getInternalTextureId(e){const t=this._getInternalTexture(e,ie.Opaque);return null!=t?t.id:null}_getInternalTexture(e,t){const r=this._getLoadableTextureResource(e);if(!r)return null;const o=`${e.contentHash}/${t}`;let a=this._textures.get(o);return a||(a=new he(q(r)?r.data:r,{mipmap:!0,wrap:this._castTextureWrap(e.wrap),noUnpackFlip:!0,preMultiplyAlpha:!q(r)&&t!==ie.Opaque,encoding:q(r)&&null!=r.encoding?r.encoding:void 0}),this._textures.set(o,a),this._context.stage.add(a),this._context.stage.loadImmediate(a)),a}_castTextureWrap(e="repeat"){if("string"==typeof e){const t=this._castTextureWrapIndividual(e);return{s:t,t}}return{s:this._castTextureWrapIndividual(e.horizontal),t:this._castTextureWrapIndividual(e.vertical)}}_castTextureWrapIndividual(e){switch(e){case"clamp":return Te.CLAMP_TO_EDGE;case"mirror":return Te.MIRRORED_REPEAT;default:return Te.REPEAT}}_setInternalMaterialParameters(t,r){if(null!=t.color&&this._setInternalColorValueParameters(t.color,r),null!=t.colorTexture){const e=this._getInternalTexture(t.colorTexture,r.textureAlphaMode);null!=e?(r.textureId=e.id,r.textureAlphaPremultiplied=!!e.parameters.preMultiplyAlpha):r.textureId=void 0}null!=t.normalTexture&&(r.normalTextureId=this._getInternalTextureId(t.normalTexture)),null!=t.emissiveColor&&(r.emissiveFactor=e.toUnitRGB(t.emissiveColor)),null!=t.emissiveTexture&&(r.emissiveTextureId=this._getInternalTextureId(t.emissiveTexture)),null!=t.occlusionTexture&&(r.occlusionTextureId=this._getInternalTextureId(t.occlusionTexture)),null!=t.metallicRoughnessTexture&&(r.metallicRoughnessTextureId=this._getInternalTextureId(t.metallicRoughnessTexture)),r.colorTextureTransformMatrix=W(t.colorTextureTransform),r.normalTextureTransformMatrix=W(t.normalTextureTransform),r.occlusionTextureTransformMatrix=W(t.occlusionTextureTransform),r.emissiveTextureTransformMatrix=W(t.emissiveTextureTransform),r.metallicRoughnessTextureTransformMatrix=W(t.metallicRoughnessTextureTransform)}_setExternalMaterialParameters(t){const r=this._drivenProperties.color;let o=null!=this.symbolLayer.material?this.symbolLayer.material.colorMixMode:null;if(r)t.externalColor=y;else{const r=null!=this.symbolLayer.material?this.symbolLayer.material.color:null;null!=r?t.externalColor=e.toUnitRGBA(r):(o=null,t.externalColor=y)}o&&(t.colorMixMode=o),t.castShadows=!!this.symbolLayer.castShadows}_hasTransparentVertexColors(e){const t=e.vertexAttributes.color;if(null==t)return!1;for(let r=3;r<t.length;r+=4)if(255!==t[r])return!0;return!1}_getOrCreateMaterial(t,r){const o=r.material?.color,a=r.material?.colorTexture,n=r.material?.alphaMode,s="blend"===n,i=!("opaque"===n)&&(this._hasTransparentVertexColors(t)||null!=o&&o.a<1||null!=a&&a.transparent||s),l=this._materialProperties(t,r,i),u=this._materialInfoCache.byUid(l.uid);if(u)return u.material;const c={uid:l.uid,material:null,isComponentTransparent:i,alphaMode:r.material?r.material.alphaMode:"opaque"},m=ge({normalTexture:l.normalTexture,metallicRoughnessTexture:l.metallicRoughnessTexture,metallicFactor:l.metallic,roughnessFactor:l.roughness,emissiveTexture:l.emissiveTexture,emissiveFactor:e.toUnitRGB(l.emissiveColor),occlusionTexture:l.occlusionTexture}),h={usePBR:this._usePBR(),isSchematic:m,hasVertexColors:l.hasVertexColors,hasSymbolColors:l.hasSymbolVertexColors,hasVertexTangents:l.hasVertexTangents,ambient:_,diffuse:T,opacity:1,doubleSided:!0,doubleSidedType:"winding-order",cullFace:le.None,layerOpacity:this._getLayerOpacity(),hasSlicePlane:this._context.slicePlaneEnabled,initTextureTransparent:!0};h.mrrFactors=m?[...xe]:[l.metallic,l.roughness,_e[2]],r.material&&(h.doubleSided=r.material.doubleSided,h.cullFace=r.material.doubleSided?le.None:le.Back,h.textureAlphaCutoff=r.material.alphaCutoff),this._setExternalMaterialParameters(h),this._setMaterialTransparentParameter(h,c),this._setInternalMaterialParameters(l,h);const f=new pe(h);return c.material=f,this._materialInfoCache.set(l.uid,c),this._context.stage.add(f),f}_usePBR(){return this._context.physicalBasedRenderingEnabled}_setMaterialTransparentParameter(e,t){e.transparent=this.needsDrivenTransparentPass||t.isComponentTransparent||e.layerOpacity<1||e.opacity<1||e.externalColor&&e.externalColor[3]<1,"auto"===t.alphaMode?e.textureAlphaMode=e.transparent?ie.MaskBlend:ie.Opaque:e.textureAlphaMode="opaque"===t.alphaMode?ie.Opaque:"mask"===t.alphaMode?ie.Mask:ie.Blend}_addDebugNormals(e,t){const r=t.length,o=e.spatialReference.isGeographic?20015077/180:1,a=.1*Math.max(e.extent.width*o,e.extent.height*o,e.extent.zmax-e.extent.zmin),n=[],s=[],i=[],l=[];for(let p=0;p<r;p++){const e=t[p],r=e.vertexAttributes.get(fe.POSITION),o=e.vertexAttributes.get(fe.NORMAL),u=e.indices.get(fe.POSITION),c=e.indices.get(fe.NORMAL),m=r.data,d=o.data;for(let t=0;t<u.length;t++){const e=3*u[t],r=3*c[t];for(let t=0;t<3;t++)n.push(m[e+t]);for(let t=0;t<3;t++)n.push(m[e+t]+d[r+t]*a);if(s.push(s.length),s.push(s.length),t%3==0){this._calculateFaceNormal(m,u,t,je),this._getFaceVertices(m,u,t,Oe,we,Me),h(Oe,Oe,we),h(Oe,Oe,Me),f(Oe,Oe,1/3);for(let e=0;e<3;e++)i.push(Oe[e]);for(let e=0;e<3;e++)i.push(Oe[e]+je[e]*a);l.push(l.length),l.push(l.length)}}}const u=t[0].transformation,c=new ce(this._debugVertexNormalMaterial,[[fe.POSITION,new se(n,3,!0)]],[[fe.POSITION,s]],null,ue.Line);t.push(c),c.transformation=u;const m=new ce(this._debugFaceNormalMaterial,[[fe.POSITION,new se(i,3,!0)]],[[fe.POSITION,l]],null,ue.Line);m.transformation=u,t.push(m)}_createAs3DShape(e,t,r,o){const a=e.geometry;if("mesh"!==a.type)return null;const n=this._createGeometryInfo(a,t,o);if(null==n)return null;const{geometries:s,objectTransformation:i}=n;ne.DRAW_MESH_GEOMETRY_NORMALS&&this._addDebugNormals(a,s);const l=new me({geometries:s,layerUid:this._context.layer.uid,graphicUid:o});l.transformation=i;const u=re(this.symbolLayer,{opacity:this._getLayerOpacity()}),c=null!=u?new Q(s[0].material,[u],{mergeGeometries:!0,hasSlicePlane:this._context.slicePlaneEnabled}):null,m=new K(this,l,s,null,null,z,r,c);this._fastUpdateProcessor.onAddGraphic(),m.needsElevationUpdates=Y(r.mode),m.useObjectOriginAsAttachmentOrigin=!0,r.centerPointInElevationSR=this._getCenterPointInElevationSR(l.transformation);const{elevationProvider:h,renderCoordsHelper:f}=this._context,p=(e,t)=>Z(e,h,r,f,t);return m.alignedSampledElevation=z(m,r,h.spatialReference,p,f),m}_getCenterPointInElevationSR(e){const t=D(0,0,0,null!=this._context.elevationProvider.spatialReference?this._context.elevationProvider.spatialReference:null);return C([e[12],e[13],e[14]],this._context.renderCoordsHelper.spatialReference,t),t}_createComponentNormals(e,t,r,o){switch(r.shading||"flat"){default:case"source":return this._createComponentNormalsSource(e,t,r,o);case"flat":return this._createComponentNormalsFlat(e,o);case"smooth":return this._createComponentNormalsSmooth(e,o)}}_createComponentNormalsSource(e,t,r,o){if(null==t)return this._createComponentNormalsFlat(e,o);let a=!1;if(!r.trustSourceNormals)for(let n=0;n<o.length;n+=3){this._calculateFaceNormal(e,o,n,je);for(let e=0;e<3;e++){const r=3*o[n+e];Oe[0]=t[r],Oe[1]=t[r+1],Oe[2]=t[r+2],p(je,Oe)<0&&(t[r]=-t[r],t[r+1]=-t[r+1],t[r+2]=-t[r+2],a=!0)}}return new ve(t,o,a)}_createComponentNormalsFlat(e,t){const r=I(t.length),o=new Array(3*t.length);for(let a=0;a<t.length;a+=3){const n=this._calculateFaceNormal(e,t,a,je);for(let e=0;e<3;e++)r[a+e]=n[e],o[a+e]=a/3}return new ve(r,o,!1)}_createComponentNormalsSmooth(e,t){const r={};for(let n=0;n<t.length;n+=3){const o=this._calculateFaceNormal(e,t,n,je);for(let e=0;e<3;e++){const a=t[n+e];let s=r[a];s||(s={normal:b(),count:0},r[a]=s),h(s.normal,s.normal,o),s.count++}}const o=I(3*t.length),a=new Array(3*t.length);for(let n=0;n<t.length;n++){const e=r[t[n]];1!==e.count&&(d(e.normal,e.normal),e.count=1);for(let t=0;t<3;t++)o[3*n+t]=e.normal[t];a[n]=n}return new ve(o,a,!1)}_getFaceVertices(e,t,r,o,a,n){const s=3*t[r],i=3*t[r+1],l=3*t[r+2];o[0]=e[s],o[1]=e[s+1],o[2]=e[s+2],a[0]=e[i],a[1]=e[i+1],a[2]=e[i+2],n[0]=e[l],n[1]=e[l+1],n[2]=e[l+2]}_calculateFaceNormal(e,t,r,o){return this._getFaceVertices(e,t,r,Oe,we,Me),g(we,we,Oe),g(Me,Me,Oe),x(Oe,we,Me),d(o,Oe),o}_getOrCreateComponents(e){return e.components??Ee}_createPositionBuffer(e,t){let r=e.vertexAttributes.position;const o=t.reprojection===Fe.ECEF?t.transformBeforeProject:null;if(null!=o&&(r=S(new Float64Array(r.length),r,o)),t.reprojection===Fe.NONE)return t.needsBufferCopy?new Float64Array(r):r;const a=null!=o?r:new Float64Array(r.length);return O(r,e.spatialReference,0,a,this._context.renderCoordsHelper.spatialReference,0,r.length/3),a}_createNormalBuffer(e,t,r){let o=e.vertexAttributes.normal;if(null==o)return null;const a=r.reprojection===Fe.ECEF?r.transformBeforeProject:null;null!=a&&(o=L(o,new Float32Array(o.length),a));if("local"===this._context.graphicsCoreOwner.view.viewingMode||r.reprojection===Fe.NONE)return r.needsBufferCopy&&e.vertexAttributes.normal===o?new Float32Array(o):o;const n=e.vertexAttributes.position,s=null!=a?o:new Float32Array(o.length);return $(o,n,t,e.spatialReference,s)}_createTangentBuffer(e,t,r){let o=e.vertexAttributes.tangent;if(null==o)return null;const a=r.reprojection===Fe.ECEF?r.transformBeforeProject:null;null!=a&&(o=G(o,new Float32Array(o.length),a));if("local"===this._context.graphicsCoreOwner.view.viewingMode||r.reprojection===Fe.NONE)return r.needsBufferCopy&&e.vertexAttributes.normal===o?new Float32Array(o):o;const n=e.vertexAttributes.position,s=null!=a?o:new Float32Array(o.length);return V(o,n,t,e.spatialReference,s)}_createColorBuffer(e){return e.vertexAttributes.color}_createSymbolColorBuffer(e){if(this._requiresSymbolVertexColors()){const t=this._getVertexOpacityAndColor(e),r=oe(this.symbolLayer?.material?.colorMixMode),o=new Uint8Array(4);return ae(t,r,o),o}return null}_createBuffers(e,t){const r=e.vertexAttributes&&e.vertexAttributes.position;if(!r)return this.logger.warn("Mesh geometry must contain position vertex attributes"),null;const o=e.vertexAttributes.normal,a=e.vertexAttributes.uv,n=e.vertexAttributes.tangent;if(null!=o&&o.length!==r.length)return this.logger.warn("Mesh normal vertex buffer must contain the same number of elements as the position buffer"),null;if(null!=n&&n.length/4!=r.length/3)return this.logger.warn("Mesh tangent vertex buffer must contain the same number of elements as the position buffer"),null;if(null!=a&&a.length/2!=r.length/3)return this.logger.warn("Mesh uv vertex buffer must contain the same number of elements as the position buffer"),null;const s=this._computeReprojectionInfo(e),i=this._createPositionBuffer(e,s),u=this._createColorBuffer(e),c=this._createSymbolColorBuffer(t),m=this._createNormalBuffer(e,i,s),h=this._createTangentBuffer(e,i,s);return{positionBuffer:i,normalBuffer:m,tangentBuffer:h,uvBuffer:a,colorBuffer:u,symbolColorBuffer:c,objectTransformation:s.reprojection===Fe.NONE&&null!=s.objectTransformation?s.objectTransformation:this._transformOriginLocal(e,i,m,h),geometryTransformation:s.reprojection===Fe.NONE&&null!=s.geometryTransformation?s.geometryTransformation:l()}}_computeReprojectionInfo(e){const{vertexSpace:t}=e,r=t.isRelative,o=t.isGeoreferenced?this._context.renderCoordsHelper.viewingMode===H.Local?Fe.NONE:Fe.ECEF:Fe.NONE;if(r){const{origin:r}=t,a=l(),i=e.transform?.localMatrix??u;if(o===Fe.NONE){v(e.spatialReference,r,a,this._context.renderCoordsHelper.spatialReference);return{reprojection:o,objectTransformation:a,geometryTransformation:c(i),needsBufferCopy:!1}}const m=n(l(),r);return s(m,m,i),{reprojection:o,transformBeforeProject:m,needsBufferCopy:!0}}return{reprojection:o,needsBufferCopy:!0}}_transformOriginLocal(e,t,a,n){const s=this._context.renderCoordsHelper.spatialReference,u=e.anchor;Ce[0]=u.x,Ce[1]=u.y,Ce[2]=u.z??0;const c=l();return v(e.spatialReference,Ce,c,s),i(Pe,c),S(t,t,Pe),null==a&&null==n||(r(Ae,c),o(Ae,Ae),null!=a&&U(a,a,Ae),null!=n&&U(n,n,Ae,4)),c}_validateFaces(e,t){const r=e.vertexAttributes.position.length/3,o=t.faces;if(o){let e=-1;for(let t=0;t<o.length;t++){const r=o[t];r>e&&(e=r)}if(r<=e)return this.logger.warn(`Vertex index ${e} is out of bounds of the mesh position buffer`),!1}else if(r%3!=0)return this.logger.warn("Mesh position buffer length must be a multiple of 9 if no component faces are defined (3 values per vertex * 3 vertices per triangle)"),!1;return!0}_getOrCreateFaces(e,t){return t.faces??R(e.vertexAttributes.position.length/3)}_isOutsideClippingArea(e){if(!this._context.clippingExtent)return!1;const t=e.vertexAttributes&&e.vertexAttributes.position;if(!t)return!1;const r=this._context.elevationProvider.spatialReference;let o;const a=t.length/3;return null==r||e.spatialReference.equals(r)?o=t:(o=new Float64Array(t.length),O(e.vertexAttributes.position,e.spatialReference,0,o,r,0,a)),j(Re),P(Re,o,0,a),!A(Re,this._context.clippingExtent)}_createGeometryInfo(e,t,r){if(!w(e.spatialReference,this._context.graphicsCoreOwner.view.spatialReference))return this.logger.warn("Geometry spatial reference is not compatible with the view"),null;if(this._isOutsideClippingArea(e))return null;const o=this._createBuffers(e,t);if(null==o)return null;const{positionBuffer:a,uvBuffer:n,colorBuffer:s,symbolColorBuffer:i,normalBuffer:l,tangentBuffer:u,objectTransformation:c,geometryTransformation:m}=o,h=this._getOrCreateComponents(e),f=new Array;let p=!1;for(const d of h){if(!this._validateFaces(e,d))return null;const t=this._getOrCreateFaces(e,d);if(0===t.length)continue;const o=this._createComponentNormals(a,l,d,t);o.didFlipNormals&&(p=!0);const c=[[fe.POSITION,new se(a,3,!0)],[fe.NORMAL,new se(o.normals,3,!0)]],h=[[fe.POSITION,t],[fe.NORMAL,o.indices]];null!=s&&(c.push([fe.COLOR,new se(s,4,!0)]),h.push([fe.COLOR,t])),null!=i&&(c.push([fe.SYMBOLCOLOR,new se(i,4,!0)]),h.push([fe.SYMBOLCOLOR,E(t.length)])),null!=n&&(c.push([fe.UV0,new se(n,2,!0)]),h.push([fe.UV0,t])),null!=u&&(c.push([fe.TANGENT,new se(u,4,!0)]),h.push([fe.TANGENT,t]));const g=this._context.stage.renderView.getObjectAndLayerIdColor({graphicUid:r,layerUid:this._context.layer.uid}),x=this._getOrCreateMaterial(e,d),_=new ce(x,c,h,null,ue.Mesh,g);_.transformation=m,f.push(_)}return p&&this.logger.warn("Normals have been automatically flipped to be consistent with the counter clock wise face winding order. It is better to generate mesh geometries that have consistent normals."),{geometries:f,objectTransformation:c}}_updateMaterialParameters(e){this._materialInfoCache.forEachMaterialInfo(e),this._fastUpdateProcessor.forEachMaterialInfo(e),this._fastUpdateProcessor.forEachClonedMaterial(((e,t)=>{t.setParameters(e.parameters)}))}test(){return{...super.test(),materials:this._materialInfoCache.materials}}}class ve{constructor(e,t,r){this.normals=e,this.indices=t,this.didFlipNormals=r}}const Ce=b(),Oe=b(),we=b(),Me=b(),je=b(),Pe=l(),Ae=a(),Ie=l(),Re=M(),Ee=[new N],Ne=new B;var Fe;!function(e){e[e.NONE=0]="NONE",e[e.ECEF=1]="ECEF"}(Fe||(Fe={}));export{ye as Graphics3DMeshFillSymbolLayer};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
+ */
5
+ import e from"../../../../Color.js";import t from"../../../../core/Error.js";import{loadImageAsync as o}from"../../../../support/requestUtils.js";import{EncodedMeshTexture as r}from"../../glTF/internal/resourceUtils.js";import{TextureUsage as a,TextureEncoding as s}from"./enums.js";import{CullFaceOptions as n}from"../../webgl-engine/lib/basicInterfaces.js";import{useSchematicPBR as l}from"../../webgl-engine/materials/pbrUtils.js";async function i(t){const o=[],r=[];if(null==t){return{material:{alphaMode:"opaque",alphaCutoff:.1,doubleSided:!0,cullFace:0,normalTextureId:-1,emissiveTextureId:-1,occlusionTextureId:-1,emissiveFactor:[0,0,0],metallicRoughness:{baseColorFactor:[1,1,1,1],baseColorTextureId:-1,metallicRoughnessTextureId:-1,metallicFactor:0,roughnessFactor:.6000000238418579},wrapTextures:!1,hasParametersFromSource:!0},requiredTextures:o,textureData:r}}const s=d(t);"auto"===t.alphaMode&&console.warn('alphaMode "auto" not supported by I3S PBRMaterial - defaulting to "blend".');return{material:{alphaMode:"auto"===t.alphaMode?"blend":t.alphaMode,alphaCutoff:t.alphaCutoff,doubleSided:t.doubleSided,cullFace:t.doubleSided?n.None:n.Back,normalTextureId:await u(t.normalTexture,o,r,a.Normal),emissiveTextureId:s?await u(t.emissiveTexture,o,r,a.Emissive):-1,occlusionTextureId:s?await u(t.occlusionTexture,o,r,a.Occlusion):-1,emissiveFactor:s&&null!=t.emissiveColor?e.toUnitRGB(t.emissiveColor):[0,0,0],metallicRoughness:{baseColorFactor:null!=t.color?e.toUnitRGBA(t.color):[1,1,1,1],baseColorTextureId:await u(t.colorTexture,o,r,a.Color),metallicRoughnessTextureId:s?await u(t.metallicRoughnessTexture,o,r,a.MetallicRoughness):-1,metallicFactor:s?t.metallic:0,roughnessFactor:s?t.roughness:0},wrapTextures:!0,hasParametersFromSource:l({normalTexture:t.normalTexture,emissiveTexture:s?t.emissiveTexture:null,emissiveFactor:s?e.toUnitRGB(t.emissiveColor):null,occlusionTexture:s?t.occlusionTexture:null,metallicRoughnessTexture:s?t.metallicRoughnessTexture:null,metallicFactor:s?t.metallic:null,roughnessFactor:s?t.roughness:null})},requiredTextures:o,textureData:r}}async function u(e,a,n,l){if(null==e)return-1;const i=n.length,u=e.data,d=e.url;if(null!=u){if(u instanceof HTMLImageElement||u instanceof HTMLCanvasElement){const e=c(u);return n.push({id:i,usage:l,data:e,encoding:s.PNG,downsampled:!1}),a.push({id:i,usage:l,encodings:[{name:void 0,encoding:s.PNG}]}),i}if(u instanceof HTMLVideoElement)return-1;if(u instanceof ImageData)throw new t("ImageData textures not supported yet for client side I3S nodes");if(u instanceof r)throw new t("EncodedMeshTexture textures not supported yet for client side I3S nodes")}else if(null!=d){const e=new Image;e.src=d;const t=c(await o(e,e.src,!1,void 0));return n.push({id:i,usage:l,data:t,encoding:s.PNG,downsampled:!1}),a.push({id:i,usage:l,encodings:[{name:void 0,encoding:s.PNG}]}),i}return-1}function c(e){const t=1048576,o=4096,r=2;let a=e.width*e.height;if(a>=o){let o=e.width,s=e.height;do{o=Math.ceil(o/r),s=Math.ceil(s/r),a=o*s}while(a>t);const n=document.createElement("canvas");n.width=o,n.height=s;return n.getContext("2d").drawImage(e,0,0,o,s),n}return e}function d(e){return e.hasOwnProperty("metallicRoughnessTexture")}export{i as convertMeshMaterialToPBRMaterial};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../../Color.js";import t from"../../../../core/Error.js";import{assertIsSome as o}from"../../../../core/maybe.js";import{MIN_PRIORITY as n}from"../../../../core/MemCache.js";import{generateUUID as r}from"../../../../core/uuid.js";import{projectBoundingSphere as s}from"../../../../geometry/projection.js";import{k as a}from"../../../../chunks/sphere.js";import{loadImageAsync as i}from"../../../../support/requestUtils.js";import{EncodedMeshTexture as l}from"../../glTF/internal/resourceUtils.js";import{TextureUsage as u,TextureEncoding as d}from"./enums.js";import{CullFaceOptions as c}from"../../webgl-engine/lib/basicInterfaces.js";import{useSchematicPBR as m}from"../../webgl-engine/materials/pbrUtils.js";class h{constructor(e,t,o,n,r){this._uid=e,this._indexSR=t,this._renderSR=o,this._worker=r,this._id2Meta=new Map,this._oid2Meta=new Map,this._nextMeshNodeId=2,this._memCache=n.newCache(`sl-client-mesh-data-${this._uid}`)}get indexSR(){return this._indexSR}get renderSR(){return this._renderSR}createMeshNodeInfo(e,t){const o="mesh"+this._nextMeshNodeId++,n=e.extent,r=n.spatialReference,a=this._indexSR,i=f(n,e.origin);s(i,r,i,a);return{type:"mesh",id:o,version:b(e),oid:t,mbs:i,componentNodeIds:[],unloadedMesh:e,nodeIndex:null,loadMeshPromise:null}}addMeshNode(e,t){t.nodeIndex=e,this._id2Meta.set(t.id,t),this._oid2Meta.set(t.oid,t)}getMeshNodeIndex(e){const t=this._oid2Meta.get(e);return null==t||"mesh"!==t.type?null:t.nodeIndex}removeNode(e){if(null==e)return;const t=this._id2Meta.get(e);null!=t&&(this._id2Meta.delete(e),"mesh"===t.type&&this._oid2Meta.delete(t.oid))}async loadNodeJSON(e){const o=this._id2Meta.get(e);if(null==o)throw new t(`I3SClientNodeLoader::loadNodeJSON unable to find node ${e}`);switch(o.type){case"mesh":return this._loadMeshNodeJSON(o);case"mesh-component":return this._loadMeshComponentNodeJSON(o);default:throw new t(`I3SClientNodeLoader::loadNodeJSON unable to handle node ${e}`)}}async _loadMeshNodeJSON(e){const t=e.id,o=(await this._getMeshData(e)).loadedMesh;if(null==o.components||0===o.components.length)return{id:t,version:null,mbs:e.mbs,obb:null,sharedResource:null,geometryData:null,attributeData:null,featureData:null,children:null};const n=[],r=o.components;for(let s=0;s<r.length;++s){const o=`${t}-component${s}`,r={type:"mesh-component",id:o,mbs:e.mbs,componentIndex:s,meshNodeInfo:e,textureData:new Map};this._id2Meta.set(r.id,r),e.componentNodeIds.push(o),n.push({id:r.id,href:null,mbs:r.mbs,obb:null})}return{id:t,version:null,mbs:e.mbs,obb:null,sharedResource:null,geometryData:null,attributeData:null,featureData:null,children:n}}updateNodeIndex(e,t,o){if(null==e)return;const n=this._id2Meta.get(e);n&&"mesh"===n.type&&(n.nodeIndex=o)}async _loadMeshComponentNodeJSON(e){return{id:e.id,version:e.meshNodeInfo.version,mbs:e.mbs,obb:null,sharedResource:null,geometryData:null,attributeData:null,featureData:null,children:null,isEmpty:!1}}async loadNodeData(e,n){const r=e.id,s=this._id2Meta.get(r);if(null==s||"mesh-component"!==s.type)throw new t(`Failed to load client node data for node ${e.id} (unexpected node info)`);const a=s.meshNodeInfo,i=await this._getMeshData(a),l=i.loadedMesh,u=a.oid;if(null==l.components)throw new t(`Failed to load client node data for node ${e.id} (unexpected null reference)`);const d=l.components[s.componentIndex],{material:c,requiredTextures:m,textureData:h}=await p(d.material);if(null!=h)for(const t of h)null!=t&&s.textureData.set(t.id,t);const f={params:{material:c},type:"ArrayBufferView"},{vertexSpace:x,origin:g,transform:y}=l,w=[g.x,g.y,g.z??0],b={featureDataPosition:w,featureIds:[],geometries:[f]},I={attributeData:{},loadedAttributes:[]};i.projectionPromise||(o(this._worker,"SceneLayerWorker is needed to project mesh"),i.projectionPromise=this._worker.project({localMatrix:y?.localMatrix,vertexSpace:x.toJSON(),origin:w,position:l.vertexAttributes.position,meshSR:l.spatialReference.toJSON(),indexSR:this._indexSR.toJSON()},n));const[N,S]=await i.projectionPromise;l.vertexAttributes.position=S;const{geometryBuffer:T,geometryDescriptor:_}=M(N,d.faces,l.vertexAttributes.normal,l.vertexAttributes.uv,l.vertexAttributes.color,u);return{geometryData:b,attributeDataInfo:I,geometryBuffer:T,geometryDescriptor:_,requiredTextures:m,textureData:h}}async loadAttributes(e,t,o){const n=e.numFeatures;for(const{field:{name:r}}of t)new Array(n);return{}}async loadTextures(e,t,o){const n=e.id,r=this._id2Meta.get(n);if(null==r||"mesh-component"!==r.type)throw new Error(`Failed to load textures for node ${e.id} (unexpected node info)`);const s=[];for(const a of t)s.push(r.textureData.get(a.id)||null);return s}async _getMeshData(e){const t=e.version,o=this._memCache.get(t);if(null==o){if(null!=e.loadMeshPromise)return e.loadMeshPromise;const o=async(o,r)=>{const s=e.unloadedMesh.clone();try{await s.load()}catch(l){r(l)}const a=s.memoryUsage,i={loadedMesh:s,projectionPromise:null,usedMemoryInBytes:a};this._memCache.put(t,i,a,n),e.loadMeshPromise=null,o(i)};return e.loadMeshPromise=new Promise(((e,t)=>o(e,t))),e.loadMeshPromise}return o}}function f(e,t){const o=[1,-1],n=[.5*e.width,.5*e.height,e.hasZ?.5*(e.zmax-e.zmin):0],r=e.center;let s=0;if(e.hasZ)for(let a=0;a<2;++a)for(let e=0;e<2;++e)for(let i=0;i<2;++i){const l=r.x+o[a]*n[0]-t.x,u=r.y+o[e]*n[1]-t.y,d=r.z+o[i]*n[2]-t.z;s=Math.max(l*l+u*u+d*d,s)}else for(let a=0;a<2;++a)for(let e=0;e<2;++e){const i=r.x+o[a]*n[0]-t.x,l=r.y+o[e]*n[1]-t.y;s=Math.max(i*i+l*l,s)}return a([t.x,t.y,t.z],Math.sqrt(s))}async function p(t){const o=[],n=[];if(null==t){return{material:{alphaMode:"opaque",alphaCutoff:.1,doubleSided:!0,cullFace:0,normalTextureId:-1,emissiveTextureId:-1,occlusionTextureId:-1,emissiveFactor:[0,0,0],metallicRoughness:{baseColorFactor:[1,1,1,1],baseColorTextureId:-1,metallicRoughnessTextureId:-1,metallicFactor:0,roughnessFactor:.6000000238418579},wrapTextures:!1,hasParametersFromSource:!0},requiredTextures:o,textureData:n}}const r=y(t);"auto"===t.alphaMode&&console.warn('alphaMode "auto" not supported by I3S PBRMaterial - defaulting to "blend".');return{material:{alphaMode:"auto"===t.alphaMode?"blend":t.alphaMode,alphaCutoff:t.alphaCutoff,doubleSided:t.doubleSided,cullFace:t.doubleSided?c.None:c.Back,normalTextureId:await x(t.normalTexture,o,n,u.Normal),emissiveTextureId:r?await x(t.emissiveTexture,o,n,u.Emissive):-1,occlusionTextureId:r?await x(t.occlusionTexture,o,n,u.Occlusion):-1,emissiveFactor:r&&null!=t.emissiveColor?e.toUnitRGB(t.emissiveColor):[0,0,0],metallicRoughness:{baseColorFactor:null!=t.color?e.toUnitRGBA(t.color):[1,1,1,1],baseColorTextureId:await x(t.colorTexture,o,n,u.Color),metallicRoughnessTextureId:r?await x(t.metallicRoughnessTexture,o,n,u.MetallicRoughness):-1,metallicFactor:r?t.metallic:0,roughnessFactor:r?t.roughness:0},wrapTextures:!0,hasParametersFromSource:m({normalTexture:t.normalTexture,emissiveTexture:r?t.emissiveTexture:null,emissiveFactor:r?e.toUnitRGBA(t.emissiveColor):null,occlusionTexture:r?t.occlusionTexture:null,metallicRoughnessTexture:r?t.metallicRoughnessTexture:null,metallicFactor:r?t.metallic:null,roughnessFactor:r?t.roughness:null})},requiredTextures:o,textureData:n}}async function x(e,o,n,r){if(null==e)return-1;const s=n.length,a=e.data,u=e.url;if(null!=a){if(a instanceof HTMLImageElement||a instanceof HTMLCanvasElement){const e=g(a);return n.push({id:s,usage:r,data:e,encoding:d.PNG,downsampled:!1}),o.push({id:s,usage:r,encodings:[{name:void 0,encoding:d.PNG}]}),s}if(a instanceof HTMLVideoElement)return-1;if(a instanceof ImageData)throw new t("ImageData textures not supported yet for client side I3S nodes");if(a instanceof l)throw new t("EncodedMeshTexture textures not supported yet for client side I3S nodes")}else if(null!=u){const e=new Image;e.src=u;const t=g(await i(e,e.src,!1,void 0));return n.push({id:s,usage:r,data:t,encoding:d.PNG,downsampled:!1}),o.push({id:s,usage:r,encodings:[{name:void 0,encoding:d.PNG}]}),s}return-1}function g(e){const t=1048576,o=4096,n=2;let r=e.width*e.height;if(r>=o){let o=e.width,s=e.height;do{o=Math.ceil(o/n),s=Math.ceil(s/n),r=o*s}while(r>t);const a=document.createElement("canvas");a.width=o,a.height=s;return a.getContext("2d").drawImage(e,0,0,o,s),a}return e}function y(e){return e.hasOwnProperty("metallicRoughnessTexture")}function M(e,t,o,n,r,s){const a=1,i=t.length/3,l=3*i;let u=0,d=0,c=!1,m=0,h=!1,f=0,p=!1,x=0,g=0,y=0;u+=I,u+=I,d=u,u+=3*l*N,null!=o&&(c=!0,m=u,u+=3*l*N),null!=n&&(h=!0,f=u,u+=2*l*N),null!=r&&(p=!0,x=u,u+=4*l*S),g=u,u+=a*T,y=u,u+=2*a*I;const M=new ArrayBuffer(u),b=new Uint8Array(M);w(b,0,l),w(b,I,a);const _=new Float32Array(M,d),v=null!=o?new Float32Array(M,m):null,D=null!=n?new Float32Array(M,f):null,R=null!=r?new Uint8Array(M,x):null;for(let w=0;w<i;++w){const s=3*w;for(let a=0;a<3;++a){const i=t[s+a],l=3*i,u=9*w+3*a;if(_[u]=e[l],_[u+1]=e[l+1],_[u+2]=e[l+2],null!=v&&(v[u]=o[l],v[u+1]=o[l+1],v[u+2]=o[l+2]),null!=D){const e=2*i,t=6*w+2*a;D[t]=n[e],D[t+1]=n[e+1]}if(null!=R){const e=4*i,t=12*w+4*a;R[t]=r[e],R[t+1]=r[e+1],R[t+2]=r[e+2],R[t+3]=r[e+3]}}}w(b,g,s),w(b,g+I,s/2**32),w(b,y,0),w(b,y+I,i-1);return{geometryBuffer:M,geometryDescriptor:{isDraco:!1,isLegacy:!0,color:p,normal:c,uv0:h,uvRegion:!1,featureIndex:!0}}}function w(e,t,o){e[t]=255&o,e[t+1]=255&o>>8,e[t+2]=255&o>>16,e[t+3]=255&o>>24}function b(e){const t=e.metadata.displaySource?.source;if(null==t||!Array.isArray(t)||!t.length||t[0]instanceof File)return r();const o=t;let n="";for(const r of o)n+=r.makeHash();return n+JSON.stringify(null!=e.transform?e.transform.toJSON():"")}const I=4,N=4,S=1,T=8;export{h as I3SClientNodeLoader,M as createGeometryData};
5
+ import e from"../../../../core/Error.js";import{assertIsSome as t}from"../../../../core/maybe.js";import{MIN_PRIORITY as o}from"../../../../core/MemCache.js";import{throwIfAborted as n}from"../../../../core/promiseUtils.js";import{generateUUID as r}from"../../../../core/uuid.js";import{b as s}from"../../../../chunks/mat3.js";import{c as a}from"../../../../chunks/mat3f64.js";import{k as i}from"../../../../chunks/vec3.js";import{O as l}from"../../../../chunks/vec3f64.js";import{projectBoundingSphere as d}from"../../../../geometry/projection.js";import{k as u}from"../../../../chunks/sphere.js";import{ViewingMode as m}from"../../../ViewingMode.js";import{convertMeshMaterialToPBRMaterial as c}from"./I3SClientMaterialUtil.js";class h{constructor(e,t,o,n,r,s){this._uid=e,this._indexSR=t,this._renderSR=o,this._viewingMode=n,this._worker=s,this._id2Meta=new Map,this._oid2Meta=new Map,this._memCache=r.newCache(`sl-client-mesh-data-${this._uid}`)}get indexSR(){return this._indexSR}get renderSR(){return this._renderSR}createMeshNodeInfo(e,t){const o=`mesh${t}`,n=e.extent,r=n.spatialReference,s=this._indexSR,a=f(n,e.origin);d(a,r,a,s);return{type:"mesh",id:o,version:x(e),oid:t,mbs:a,componentNodeIds:[],unloadedMesh:e,nodeIndex:null,loadMeshPromise:null}}addMeshNode(t,o){if(null!=this.getMeshNodeIndex(o.oid))throw new e(`I3SClientNodeLoader: client side mesh for feature oid=${o.oid} already exists`);o.nodeIndex=t,this._id2Meta.set(o.id,o),this._oid2Meta.set(o.oid,o)}getMeshNodeIndex(e){const t=this._oid2Meta.get(e);return null==t||"mesh"!==t.type?null:t.nodeIndex}removeNode(e){if(null==e)return;const t=this._id2Meta.get(e);null!=t&&(this._id2Meta.delete(e),"mesh"===t.type&&this._oid2Meta.delete(t.oid))}async loadNodeJSON(t){const o=this._id2Meta.get(t);if(null==o)throw new e(`I3SClientNodeLoader::loadNodeJSON unable to find node ${t}`);switch(o.type){case"mesh":return this._loadMeshNodeJSON(o);case"mesh-component":return this._loadMeshComponentNodeJSON(o);default:throw new e(`I3SClientNodeLoader::loadNodeJSON unable to handle node ${t}`)}}async _loadMeshNodeJSON(e){const t=e.id,o=(await this._getMeshData(e)).loadedMesh;if(null==o.components||0===o.components.length)return{id:t,version:null,mbs:e.mbs,obb:null,sharedResource:null,geometryData:null,attributeData:null,featureData:null,children:null};const n=[],r=o.components;for(let s=0;s<r.length;++s){const o=`${t}-component${s}`,r={type:"mesh-component",id:o,mbs:e.mbs,componentIndex:s,meshNodeInfo:e,textureData:new Map};this._id2Meta.set(r.id,r),e.componentNodeIds.push(o),n.push({id:r.id,href:null,mbs:r.mbs,obb:null})}return{id:t,version:null,mbs:e.mbs,obb:null,sharedResource:null,geometryData:null,attributeData:null,featureData:null,children:n}}updateNodeIndex(e,t,o){if(null==e)return;const n=this._id2Meta.get(e);n&&"mesh"===n.type&&(n.nodeIndex=o)}async _loadMeshComponentNodeJSON(e){return{id:e.id,version:e.meshNodeInfo.version,mbs:e.mbs,obb:null,sharedResource:null,geometryData:null,attributeData:null,featureData:null,children:null,isEmpty:!1}}async loadNodeData(o,r){const s=o.id,a=this._id2Meta.get(s);if(null==a||"mesh-component"!==a.type)throw new e(`Failed to load client node data for node ${o.id} (unexpected node info)`);const i=a.meshNodeInfo,l=await this._getMeshData(i),d=l.loadedMesh,u=i.oid;if(null==d.components)throw new e(`Failed to load client node data for node ${o.id} (unexpected null reference)`);const h=d.components[a.componentIndex],{material:f,requiredTextures:M,textureData:x}=await c(h.material);if(null!=x)for(const e of x)null!=e&&a.textureData.set(e.id,e);const g={params:{material:f},type:"ArrayBufferView"},{vertexSpace:w,origin:_,transform:b}=d,N=[_.x,_.y,_.z??0],S={featureDataPosition:N,featureIds:[],geometries:[g]},D={attributeData:{},loadedAttributes:[]};l.projectionPromise||(t(this._worker,"SceneLayerWorker is needed to project mesh"),l.projectionPromise=this._worker.project({positions:d.vertexAttributes.position,localMatrix:b?.localMatrix,vertexSpace:w.toJSON(),origin:N,inSpatialReference:d.spatialReference.toJSON(),outSpatialReference:this._indexSR.toJSON(),local:this._viewingMode===m.Local},r));const{projected:I,original:v}=await l.projectionPromise;d.vertexAttributes.position=v;const{transformed:j,original:A}=await p(h,l,this._worker,r);d.vertexAttributes.normal=A,n(r);const{geometryBuffer:P,geometryDescriptor:R}=y(I,h.faces,j,d.vertexAttributes.uv,d.vertexAttributes.color,u);return{geometryData:S,attributeDataInfo:D,geometryBuffer:P,geometryDescriptor:R,requiredTextures:M,textureData:x}}async loadAttributes(e,t,o){const n=e.numFeatures,r={};for(const{field:{name:s}}of t)r[s]=new Array(n);return r}async loadTextures(e,t,o){const n=e.id,r=this._id2Meta.get(n);if(null==r||"mesh-component"!==r.type)throw new Error(`Failed to load textures for node ${e.id} (unexpected node info)`);const s=[];for(const a of t)s.push(r.textureData.get(a.id)||null);return s}async _getMeshData(e){const t=e.version,n=this._memCache.get(t);if(null==n){if(null!=e.loadMeshPromise)return e.loadMeshPromise;const n=async(n,r)=>{const s=e.unloadedMesh.clone();try{await s.load()}catch(l){r(l)}const a=s.memoryUsage,i={loadedMesh:s,projectionPromise:null,normalsTransformPromise:null,usedMemoryInBytes:a};this._memCache.put(t,i,a,o),e.loadMeshPromise=null,n(i)};return e.loadMeshPromise=new Promise(((e,t)=>n(e,t))),e.loadMeshPromise}return n}}function f(e,t){const o=[1,-1],n=[.5*e.width,.5*e.height,e.hasZ?.5*(e.zmax-e.zmin):0],r=e.center;let s=0;if(e.hasZ)for(let a=0;a<2;++a)for(let e=0;e<2;++e)for(let i=0;i<2;++i){const l=r.x+o[a]*n[0]-t.x,d=r.y+o[e]*n[1]-t.y,u=r.z+o[i]*n[2]-t.z;s=Math.max(l*l+d*d+u*u,s)}else for(let a=0;a<2;++a)for(let e=0;e<2;++e){const i=r.x+o[a]*n[0]-t.x,l=r.y+o[e]*n[1]-t.y;s=Math.max(i*i+l*l,s)}return u([t.x,t.y,t.z],Math.sqrt(s))}async function p(e,o,n,r){const{transform:d,vertexAttributes:u}=o.loadedMesh,m="source"===e.shading?u.normal:null;if(!(null!=m&&null!=d&&(0!==d.rotationAngle||!i(d.scale,l))))return{transformed:m,original:u.normal};if(!o.normalsTransformPromise){t(n,"SceneLayerWorker is needed to transform mesh normals");const e=a();s(e,d.localMatrix),o.normalsTransformPromise=n.transformNormals({normalMatrix:e,normals:m},r)}return o.normalsTransformPromise}function y(e,t,o,n,r,s){const a=1,i=t.length/3,l=3*i;let d=0,u=0,m=!1,c=0,h=!1,f=0,p=!1,y=0,x=0,N=0;d+=g,d+=g,u=d,d+=3*l*w,null!=o&&(m=!0,c=d,d+=3*l*w),null!=n&&(h=!0,f=d,d+=2*l*w),null!=r&&(p=!0,y=d,d+=4*l*_),x=d,d+=a*b,N=d,d+=2*a*g;const S=new ArrayBuffer(d),D=new Uint8Array(S);M(D,0,l),M(D,g,a);const I=new Float32Array(S,u),v=null!=o?new Float32Array(S,c):null,j=null!=n?new Float32Array(S,f):null,A=null!=r?new Uint8Array(S,y):null;for(let M=0;M<i;++M){const s=3*M;for(let a=0;a<3;++a){const i=t[s+a],l=3*i,d=9*M+3*a;if(I[d]=e[l],I[d+1]=e[l+1],I[d+2]=e[l+2],null!=v&&(v[d]=o[l],v[d+1]=o[l+1],v[d+2]=o[l+2]),null!=j){const e=2*i,t=6*M+2*a;j[t]=n[e],j[t+1]=n[e+1]}if(null!=A){const e=4*i,t=12*M+4*a;A[t]=r[e],A[t+1]=r[e+1],A[t+2]=r[e+2],A[t+3]=r[e+3]}}}M(D,x,s),M(D,x+g,s/2**32),M(D,N,0),M(D,N+g,i-1);return{geometryBuffer:S,geometryDescriptor:{isDraco:!1,isLegacy:!0,color:p,normal:m,uv0:h,uvRegion:!1,featureIndex:!0}}}function M(e,t,o){e[t]=255&o,e[t+1]=255&o>>8,e[t+2]=255&o>>16,e[t+3]=255&o>>24}function x(e){const t=e.metadata.displaySource?.source;if(null==t||!Array.isArray(t)||!t.length||t[0]instanceof File)return r();const o=t;let n="";for(const r of o)n+=r.makeHash();return n+JSON.stringify(null!=e.transform?e.transform.toJSON():"")}const g=4,w=4,_=1,b=8;export{h as I3SClientNodeLoader,p as transformNormals};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
4
  */
5
- import{t,a as e}from"../../../../chunks/vec3.js";import{c as o}from"../../../../chunks/vec3f64.js";import{projectBuffer as r}from"../../../../geometry/projection.js";import{create as n,set as a,NEGATIVE_INFINITY as s,expandWithBuffer as m,ZERO as f}from"../../../../geometry/support/aaBoundingBox.js";import{newDoubleArray as u}from"../../../../geometry/support/DoubleArray.js";function c(o,r,n,a){const s=r.getComponentAabb(n,o,p),m=r.getObjectTransform(n);for(let f=0;f<8;++f)b[0]=1&f?s[0]:s[3],b[1]=2&f?s[1]:s[4],b[2]=4&f?s[2]:s[5],t(b,b,m.rotationScale),e(b,b,m.position),a[3*f]=b[0],a[3*f+1]=b[1],a[3*f+2]=b[2];return a}function i(t,e,o){const n=u(24);return u=>{let i=u.meta.featureExtents;if(null==i){i=new Float64Array(6*u.meta.featureIds.length),u.meta.featureExtents=i;for(let t=0;t<i.length;t+=6)i[t]=Number.POSITIVE_INFINITY}const l=new Float64Array(i.buffer,6*u.index*Float64Array.BYTES_PER_ELEMENT,6);return l[0]===Number.POSITIVE_INFINITY&&(c(u.index,o,u.meta.objectHandle,n),r(n,e,0,n,t,0,8)?(a(l,s),m(l,n,0,8)):a(l,f)),l}}function l(o,r,n,a){const s=r.getComponentAabb(n,o,p),m=r.getObjectTransform(n);a[0]=0,a[1]=0,a[2]=0;for(let f=0;f<8;++f)b[0]=1&f?s[0]:s[3],b[1]=2&f?s[1]:s[4],b[2]=s[5],t(b,b,m.rotationScale),e(b,b,m.position),a[0]+=b[0],a[1]+=b[1],a[2]+=b[2];return a[0]/=8,a[1]/=8,a[2]/=8,a}const p=n(),b=o();export{c as boundingBoxCornerPoints,l as boundingBoxTop,i as createGetFeatureExtent};
5
+ import{t,a as e}from"../../../../chunks/vec3.js";import{c as r}from"../../../../chunks/vec3f64.js";import{projectBuffer as o}from"../../../../geometry/projection.js";import{create as n,set as a,NEGATIVE_INFINITY as m,expandWithBuffer as s,ZERO as u}from"../../../../geometry/support/aaBoundingBox.js";import{newDoubleArray as f}from"../../../../geometry/support/DoubleArray.js";function c(t,e,r){const n=f(24);return f=>{let c=f.meta.featureExtents;if(null==c){c=new Float64Array(6*f.meta.featureIds.length),f.meta.featureExtents=c;for(let t=0;t<c.length;t+=6)c[t]=Number.POSITIVE_INFINITY}const l=new Float64Array(c.buffer,6*f.index*Float64Array.BYTES_PER_ELEMENT,6);return l[0]===Number.POSITIVE_INFINITY&&(i(f.index,r,f.meta.objectHandle,n,0),o(n,e,0,n,t,0,8)?(a(l,m),s(l,n,0,8)):a(l,u)),l}}function i(r,o,n,a,m){const s=o.getComponentAabb(n,r,p),u=o.getObjectTransform(n);for(let f=0;f<8;++f)I[0]=1&f?s[0]:s[3],I[1]=2&f?s[1]:s[4],I[2]=4&f?s[2]:s[5],t(I,I,u.rotationScale),e(I,I,u.position),a[m++]=I[0],a[m++]=I[1],a[m++]=I[2];return a}const l=24,p=n(),I=r();export{l as BOUNDING_BOX_CORNERS_POINTS_STRIDE,i as boundingBoxCornerPoints,c as createGetFeatureExtent};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../chunks/tslib.es6.js";import"../../../../geometry.js";import t from"../../../../core/Accessor.js";import{PositionHint as r,indexOf as i}from"../../../../core/arrayUtils.js";import s from"../../../../core/Logger.js";import{clamp as n}from"../../../../core/mathUtils.js";import{unwrapUpdating as o,updating as a,isUpdating as l}from"../../../../core/maybeUpdating.js";import{whenOnce as c}from"../../../../core/reactiveUtils.js";import{getUnitString as p}from"../../../../core/unitUtils.js";import{property as u}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/accessorSupport/ensureType.js";import"../../../../core/has.js";import{subclass as g}from"../../../../core/accessorSupport/decorators/subclass.js";import{t as m,a as f,s as d}from"../../../../chunks/vec3.js";import{WhereClause as y}from"../../../../core/sql/WhereClause.js";import{projectBoundingSphere as h,load as j,project as S,projectVectorToVector as R}from"../../../../geometry/projection.js";import{create as w}from"../../../../geometry/support/aaBoundingBox.js";import{fromValues as E,expandWithNestedArray as b,expand as v}from"../../../../geometry/support/aaBoundingRect.js";import{doubleArrayFrom as F}from"../../../../geometry/support/DoubleArray.js";import{earth as _}from"../../../../geometry/support/Ellipsoid.js";import{isWGS84 as k,isWebMercator as I}from"../../../../geometry/support/spatialReferenceUtils.js";import{f as M}from"../../../../chunks/sphere.js";import{project as D}from"../../../../geometry/support/webMercatorUtils.js";import T from"../../../../layers/support/FeatureFilter.js";import{objectIdFilter as G,filterInPlace as C}from"./I3SUtil.js";import A from"../../../../geometry/SpatialReference.js";const x="esri.views.3d.layers.i3s.I3SMeshViewFilter",O=s.getLogger(x);let B=class extends t{constructor(e){super(e),this._projectionEngineLoaded=!1}initialize(){c((()=>this.viewFilter?.geometry||null!=this.layerFilter)).then((()=>this.loadAsyncModule(import("../../../../geometry/geometryEngine.js").then((e=>{this.destroyed||(this._geometryEngine=e)})))))}get sortedObjectIds(){if(null==this.viewFilter||null==this.viewFilter.objectIds)return null;const e=F(this.viewFilter.objectIds);return e.sort(),e}get parsedWhereClause(){const e=null!=this.viewFilter?this.viewFilter.where:null;if(null==e||!e)return null;try{return y.create(e,this.layerFieldsIndex)}catch(t){O.error(`Failed to parse filter where clause: ${t}`)}return null}addFilters(e,t,r,i){const s=this.sortedObjectIds;null!=s&&e.push((e=>G(s,!0,e))),this.addSqlFilter(e,this.parsedWhereClause);const n=o(this._layerMaskGeometries),a=this._geometryEngine;if(null!=n&&null!=this.layerFilter&&null!=a){const s=this.layerFilter.spatialRelationship;e.push(((e,o)=>V(a,e,o,i,t,r,n,s)))}const l=o(this._viewMaskGeometries);if(null!=l&&null!=this.viewFilter&&null!=a){const s=this.viewFilter.spatialRelationship;e.push(((e,n)=>V(a,e,n,i,t,r,l,s)))}}isMBSGeometryVisible(e,t,r){const i=o(this._layerMaskGeometries),s=this._geometryEngine;if(null!=i&&null!=this.layerFilter&&null!=s){const n=this.layerFilter.spatialRelationship,o=i[0].spatialReference||t;if(!h(e,r,q,o))return O.warnOnce("SceneLayer.mask geometry is using unsupported SpatialReference, skipping geometry filter for MBS"),!0;return W(s,q,i,o,n)}const n=o(this._viewMaskGeometries);if(null!=n&&null!=this.viewFilter&&null!=s){const i=this.viewFilter.spatialRelationship,o=n[0].spatialReference||t;if(!h(e,r,q,o))return O.warnOnce("SceneLayerView.filter.geometry is using unsupported SpatialReference, skipping geometry filter for MBS"),!0;return W(s,q,n,o,i)}return!0}get parsedGeometry(){const e=o(this._viewMaskGeometries),t=o(this._layerMaskGeometries);return null==e||null==t?e||t:t.concat(e)}get _layerMaskGeometries(){const e=this.layerFilter;return null==e?null:null==this._geometryEngine?a:"disjoint"===e.spatialRelationship?e.geometries.map((e=>({type:"polygon",rings:e.rings,spatialReference:e.spatialReference,cache:{}}))):[e.geometries.reduce(((e,t)=>(e.rings=[...e.rings,...t.rings],e)),{type:"polygon",rings:[],spatialReference:e.geometries[0].spatialReference,cache:{}})]}get _viewMaskGeometries(){if(null==this.viewFilter)return null;const{geometry:e}=this.viewFilter;if(null==e)return null;if(null==this.viewFilter||null==this._geometryEngine)return a;const{distance:t,units:r}=this.viewFilter,i=this.viewFilter.spatialRelationship,s="mesh"===e.type?e.extent:e;if(null==t||0===t)return U(this._geometryEngine,s,i);const n=r||p(s.spatialReference);if(s.spatialReference.isWGS84){const e=this._geometryEngine.geodesicBuffer(s,t,n);return U(this._geometryEngine,e,i)}const o=D(s,A.WGS84);if(null!=o){const e=D(this._geometryEngine.geodesicBuffer(o,t,n),s.spatialReference);return U(this._geometryEngine,e,i)}if(!this._projectionEngineLoaded&&(this.loadAsyncModule(j().then((()=>this._projectionEngineLoaded=!0))),!this._projectionEngineLoaded))return null;let l=null;try{l=S(s,A.WGS84)}catch(c){}if(l)try{l=S(this._geometryEngine.geodesicBuffer(l,t,n),s.spatialReference)}catch(c){l=null}return l||O.error(`Filter by geodesic buffer (distance) unsupported, failed to project input geometry (${s.spatialReference.wkid}) to WGS84.`),U(this._geometryEngine,l,i)}get updating(){return l(this._layerMaskGeometries)||l(this._viewMaskGeometries)}static checkSupport(e){return null!=e&&(e.timeExtent?(O.warn("Filters with a timeExtent are not supported for mesh scene layers"),!1):!!P(e.spatialRelationship)||(O.warn(`Filters with spatialRelationship other than ${L.join(", ")} are not supported for mesh scene layers`),!1))}};e([u()],B.prototype,"layerFilter",void 0),e([u({type:T})],B.prototype,"viewFilter",void 0),e([u()],B.prototype,"layerFieldsIndex",void 0),e([u()],B.prototype,"loadAsyncModule",void 0),e([u()],B.prototype,"addSqlFilter",void 0),e([u({readOnly:!0})],B.prototype,"sortedObjectIds",null),e([u({readOnly:!0})],B.prototype,"parsedWhereClause",null),e([u({readOnly:!0})],B.prototype,"parsedGeometry",null),e([u({readOnly:!0})],B.prototype,"_layerMaskGeometries",null),e([u({readOnly:!0})],B.prototype,"_viewMaskGeometries",null),e([u()],B.prototype,"updating",null),e([u()],B.prototype,"_projectionEngineLoaded",void 0),e([u()],B.prototype,"_geometryEngine",void 0),B=e([g(x)],B);const L=(e=>e)(["contains","intersects","disjoint"]);function P(e){return null!=e&&L.includes(e)}var K;function U(e,t,s){if(null==t)return null;if("disjoint"===s&&"polygon"===t.type){const s=t.rings.length,n=t.spatialReference,o=new Array(s);for(let e=0;e<s;++e){const r=E(1/0,1/0,-1/0,-1/0);b(r,t.rings[e]),o[e]={type:"polygon",rings:[t.rings[e]],spatialReference:n,cache:{},aabr:r}}o.sort(((e,t)=>e.aabr[0]-t.aabr[0]));const a=new Set,l=new r;for(let t=0;t<o.length;++t){const r=o[t],s=r.aabr[0];a.forEach((t=>{if(s>=t.aabr[2])return void a.delete(t);if(r.aabr[1]>t.aabr[3]||r.aabr[3]<t.aabr[1]||!e.intersects(r,t))return;r.rings=r.rings.concat(t.rings),v(r.aabr,t.aabr,r.aabr),r.cache={},a.delete(t);const n=i(o,t,o.length,l);o.splice(n,1)})),a.add(r)}for(const e of o)e.aabr=void 0;return o}return[t]}function W(e,t,r,i,s){const n=$(e,t,i);return r.every((t=>z(e,t,n,s)!==K.DISCARD))}function V(e,t,r,i,s,n,o,a){const l=o[0].spatialReference||s.spatialReference;if(!h(r.node.mbs,n,q,l))return void O.warnOnce("SceneLayerView.filter.geometry is using unsupported SpatialReference, skipping geometry filter");const c=$(e,q,l),p=N(a,s,l,i,r.objectHandle);for(const u of o){if(0===t.length)return;switch(z(e,u,c,a)){case K.DISCARD:return void(t.length=0);case K.KEEP:continue}C(t,r.featureIds,(t=>J(e,u,t,p)))}}!function(e){e[e.KEEP=0]="KEEP",e[e.DISCARD=1]="DISCARD",e[e.TEST=2]="TEST"}(K||(K={}));const q=M(0,0,0,0);function N(e,t,r,i,s){const n=t.renderSpatialReference,o=new Map,a={type:"polygon",rings:[[[0,0,0],[0,0,0],[0,0,0],[0,0,0]]],spatialReference:r};a.rings[0][3]=a.rings[0][0];const l={indices:null,data:null,stride:0,startIndex:0,endIndex:0};let c,p;switch(e){case"intersects":c=(e,t,r)=>e.intersects(t,r)?K.KEEP:K.TEST,p=H;break;case"contains":c=(e,t,r)=>e.contains(t,r)?K.TEST:K.DISCARD,p=H;break;default:c=(e,t,r)=>e.disjoint(t,r)?K.TEST:K.DISCARD,p=Z}return{collection:i,object:s,type:e,maskSR:r,renderSR:n,aabbCache:o,triangle:a,positions:l,triangleTest:c,geometryTest:p}}function $(e,t,r){const i={type:"point",x:t[0],y:t[1],hasZ:!1,hasM:!1,spatialReference:r},s=!k(r)&&!I(r),o=Number.isNaN(t[3])?0:n(t[3],0,2*_.radius),a=s?e.buffer(i,o,1):e.geodesicBuffer(i,o,1);return a.type="polygon",a}function z(e,t,r,i){switch(i){case"intersects":case"contains":return H(e,t,r);case"disjoint":return Z(e,t,r)}}function H(e,t,r){return e.intersects(t,r)?e.contains(t,r)?K.KEEP:K.TEST:K.DISCARD}function Z(e,t,r){return e.intersects(t,r)?e.contains(t,r)?K.DISCARD:K.TEST:K.KEEP}function J(e,t,r,i){const{collection:s,object:n,renderSR:o,maskSR:a,geometryTest:l,aabbCache:c}=i;let p=c.get(r);if(!p){const e=s.getObjectTransform(n);s.getComponentAabb(n,r,Q);const t=[[Q[0],Q[1],0],[Q[0],Q[4],0],[Q[3],Q[4],0],[Q[3],Q[1],0]];for(let r=0;r<4;++r)m(t[r],t[r],e.rotationScale),f(t[r],t[r],e.position),R(t[r],o,t[r],a);p={type:"polygon",rings:[t],spatialReference:a,cache:{}},p.rings[0][4]=p.rings[0][0],c.set(r,p)}switch(l(e,t,p)){case K.DISCARD:return!1;case K.KEEP:return!0}const{triangle:u,triangleTest:g,positions:y}=i,h=u.rings[0][0],j=u.rings[0][1],S=u.rings[0][2],w=s.getObjectTransform(n);s.getComponentPositions(n,r,y);const{indices:E,data:b,stride:v,startIndex:F,endIndex:_}=y;for(let k=F;k<_;k+=3){const r=v*E[k],i=v*E[k+1],s=v*E[k+2];switch(d(h,b[r],b[r+1],b[r+2]),d(j,b[i],b[i+1],b[i+2]),d(S,b[s],b[s+1],b[s+2]),m(h,h,w.rotationScale),m(j,j,w.rotationScale),m(S,S,w.rotationScale),f(h,h,w.position),f(j,j,w.position),f(S,S,w.position),R(h,o,h,a),R(j,o,j,a),R(S,o,S,a),g(e,t,u)){case K.DISCARD:return!1;case K.KEEP:return!0}}return"intersects"!==i.type}const Q=w();export{B as I3SMeshViewFilter};
5
+ import{_ as e}from"../../../../chunks/tslib.es6.js";import"../../../../geometry.js";import t from"../../../../core/Accessor.js";import{PositionHint as r,indexOf as i}from"../../../../core/arrayUtils.js";import s from"../../../../core/Logger.js";import{clamp as n}from"../../../../core/mathUtils.js";import{unwrapUpdating as o,updating as a,isUpdating as l}from"../../../../core/maybeUpdating.js";import{whenOnce as c}from"../../../../core/reactiveUtils.js";import{getUnitString as p}from"../../../../core/unitUtils.js";import{property as u}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/accessorSupport/ensureType.js";import"../../../../core/has.js";import{subclass as g}from"../../../../core/accessorSupport/decorators/subclass.js";import{t as m,a as f,s as d}from"../../../../chunks/vec3.js";import{WhereClause as y}from"../../../../core/sql/WhereClause.js";import{getReferenceEllipsoid as h}from"../../../../geometry/ellipsoidUtils.js";import{projectBoundingSphere as j,load as S,project as R,projectVectorToVector as w}from"../../../../geometry/projection.js";import{create as E}from"../../../../geometry/support/aaBoundingBox.js";import{fromValues as b,expandWithNestedArray as v,expand as F}from"../../../../geometry/support/aaBoundingRect.js";import{doubleArrayFrom as _}from"../../../../geometry/support/DoubleArray.js";import{earth as k}from"../../../../geometry/support/Ellipsoid.js";import{isWGS84 as I,isWebMercator as M}from"../../../../geometry/support/spatialReferenceUtils.js";import{f as D}from"../../../../chunks/sphere.js";import{project as T}from"../../../../geometry/support/webMercatorUtils.js";import G from"../../../../layers/support/FeatureFilter.js";import{objectIdFilter as C,filterInPlace as A}from"./I3SUtil.js";import x from"../../../../geometry/SpatialReference.js";const O="esri.views.3d.layers.i3s.I3SMeshViewFilter",B=s.getLogger(O);let L=class extends t{constructor(e){super(e),this._projectionEngineLoaded=!1}initialize(){c((()=>this.viewFilter?.geometry||null!=this.layerFilter)).then((()=>this.loadAsyncModule(import("../../../../geometry/geometryEngine.js").then((e=>{this.destroyed||(this._geometryEngine=e)})))))}get sortedObjectIds(){if(null==this.viewFilter||null==this.viewFilter.objectIds)return null;const e=_(this.viewFilter.objectIds);return e.sort(),e}get parsedWhereClause(){const e=null!=this.viewFilter?this.viewFilter.where:null;if(null==e||!e)return null;try{return y.create(e,this.layerFieldsIndex)}catch(t){B.error(`Failed to parse filter where clause: ${t}`)}return null}addFilters(e,t,r,i){const s=this.sortedObjectIds;null!=s&&e.push((e=>C(s,!0,e))),this.addSqlFilter(e,this.parsedWhereClause);const n=o(this._layerMaskGeometries),a=this._geometryEngine;if(null!=n&&null!=this.layerFilter&&null!=a){const s=this.layerFilter.spatialRelationship;e.push(((e,o)=>q(a,e,o,i,t,r,n,s)))}const l=o(this._viewMaskGeometries);if(null!=l&&null!=this.viewFilter&&null!=a){const s=this.viewFilter.spatialRelationship;e.push(((e,n)=>q(a,e,n,i,t,r,l,s)))}}isMBSGeometryVisible(e,t,r){const i=o(this._layerMaskGeometries),s=this._geometryEngine;if(null!=i&&null!=this.layerFilter&&null!=s){const n=this.layerFilter.spatialRelationship,o=i[0].spatialReference||t;if(!j(e,r,N,o))return B.warnOnce("SceneLayer.mask geometry is using unsupported SpatialReference, skipping geometry filter for MBS"),!0;return V(s,N,i,o,n)}const n=o(this._viewMaskGeometries);if(null!=n&&null!=this.viewFilter&&null!=s){const i=this.viewFilter.spatialRelationship,o=n[0].spatialReference||t;if(!j(e,r,N,o))return B.warnOnce("SceneLayerView.filter.geometry is using unsupported SpatialReference, skipping geometry filter for MBS"),!0;return V(s,N,n,o,i)}return!0}get parsedGeometry(){const e=o(this._viewMaskGeometries),t=o(this._layerMaskGeometries);return null==e||null==t?e||t:t.concat(e)}get _layerMaskGeometries(){const e=this.layerFilter;return null==e?null:null==this._geometryEngine?a:"disjoint"===e.spatialRelationship?e.geometries.map((e=>({type:"polygon",rings:e.rings,spatialReference:e.spatialReference,cache:{}}))):[e.geometries.reduce(((e,t)=>(e.rings=[...e.rings,...t.rings],e)),{type:"polygon",rings:[],spatialReference:e.geometries[0].spatialReference,cache:{}})]}get _viewMaskGeometries(){if(null==this.viewFilter)return null;const{geometry:e}=this.viewFilter;if(null==e)return null;if(null==this.viewFilter||null==this._geometryEngine)return a;const{distance:t,units:r}=this.viewFilter,i=this.viewFilter.spatialRelationship,s="mesh"===e.type?e.extent:e;if(null==t||0===t)return W(this._geometryEngine,s,i);const n=r||p(s.spatialReference);if(s.spatialReference.isWGS84){const e=this._geometryEngine.geodesicBuffer(s,t,n);return W(this._geometryEngine,e,i)}const o=T(s,x.WGS84);if(null!=o){const e=T(this._geometryEngine.geodesicBuffer(o,t,n),s.spatialReference);return W(this._geometryEngine,e,i)}if(!this._projectionEngineLoaded&&(this.loadAsyncModule(S().then((()=>this._projectionEngineLoaded=!0))),!this._projectionEngineLoaded))return null;let l=null;try{l=R(s,x.WGS84)}catch(c){}if(l)try{l=R(this._geometryEngine.geodesicBuffer(l,t,n),s.spatialReference)}catch(c){l=null}return l||B.error(`Filter by geodesic buffer (distance) unsupported, failed to project input geometry (${s.spatialReference.wkid}) to WGS84.`),W(this._geometryEngine,l,i)}get updating(){return l(this._layerMaskGeometries)||l(this._viewMaskGeometries)}static checkSupport(e){return null!=e&&(e.timeExtent?(B.warn("Filters with a timeExtent are not supported for mesh scene layers"),!1):!!U(e.spatialRelationship)||(B.warn(`Filters with spatialRelationship other than ${P.join(", ")} are not supported for mesh scene layers`),!1))}};e([u()],L.prototype,"layerFilter",void 0),e([u({type:G})],L.prototype,"viewFilter",void 0),e([u()],L.prototype,"layerFieldsIndex",void 0),e([u()],L.prototype,"loadAsyncModule",void 0),e([u()],L.prototype,"addSqlFilter",void 0),e([u({readOnly:!0})],L.prototype,"sortedObjectIds",null),e([u({readOnly:!0})],L.prototype,"parsedWhereClause",null),e([u({readOnly:!0})],L.prototype,"parsedGeometry",null),e([u({readOnly:!0})],L.prototype,"_layerMaskGeometries",null),e([u({readOnly:!0})],L.prototype,"_viewMaskGeometries",null),e([u()],L.prototype,"updating",null),e([u()],L.prototype,"_projectionEngineLoaded",void 0),e([u()],L.prototype,"_geometryEngine",void 0),L=e([g(O)],L);const P=(e=>e)(["contains","intersects","disjoint"]);function U(e){return null!=e&&P.includes(e)}var K;function W(e,t,s){if(null==t)return null;if("disjoint"===s&&"polygon"===t.type){const s=t.rings.length,n=t.spatialReference,o=new Array(s);for(let e=0;e<s;++e){const r=b(1/0,1/0,-1/0,-1/0);v(r,t.rings[e]),o[e]={type:"polygon",rings:[t.rings[e]],spatialReference:n,cache:{},aabr:r}}o.sort(((e,t)=>e.aabr[0]-t.aabr[0]));const a=new Set,l=new r;for(let t=0;t<o.length;++t){const r=o[t],s=r.aabr[0];a.forEach((t=>{if(s>=t.aabr[2])return void a.delete(t);if(r.aabr[1]>t.aabr[3]||r.aabr[3]<t.aabr[1]||!e.intersects(r,t))return;r.rings=r.rings.concat(t.rings),F(r.aabr,t.aabr,r.aabr),r.cache={},a.delete(t);const n=i(o,t,o.length,l);o.splice(n,1)})),a.add(r)}for(const e of o)e.aabr=void 0;return o}return[t]}function V(e,t,r,i,s){if(t[3]>=.5*(t[2]+h(i).radius))return!0;const n=z(e,t,i);return r.every((t=>H(e,t,n,s)!==K.DISCARD))}function q(e,t,r,i,s,n,o,a){const l=o[0].spatialReference||s.spatialReference;if(!j(r.node.mbs,n,N,l))return void B.warnOnce("SceneLayerView.filter.geometry is using unsupported SpatialReference, skipping geometry filter");const c=z(e,N,l),p=$(a,s,l,i,r.objectHandle);for(const u of o){if(0===t.length)return;switch(H(e,u,c,a)){case K.DISCARD:return void(t.length=0);case K.KEEP:continue}A(t,r.featureIds,(t=>Q(e,u,t,p)))}}!function(e){e[e.KEEP=0]="KEEP",e[e.DISCARD=1]="DISCARD",e[e.TEST=2]="TEST"}(K||(K={}));const N=D(0,0,0,0);function $(e,t,r,i,s){const n=t.renderSpatialReference,o=new Map,a={type:"polygon",rings:[[[0,0,0],[0,0,0],[0,0,0],[0,0,0]]],spatialReference:r};a.rings[0][3]=a.rings[0][0];const l={indices:null,data:null,stride:0,startIndex:0,endIndex:0};let c,p;switch(e){case"intersects":c=(e,t,r)=>e.intersects(t,r)?K.KEEP:K.TEST,p=Z;break;case"contains":c=(e,t,r)=>e.contains(t,r)?K.TEST:K.DISCARD,p=Z;break;default:c=(e,t,r)=>e.disjoint(t,r)?K.TEST:K.DISCARD,p=J}return{collection:i,object:s,type:e,maskSR:r,renderSR:n,aabbCache:o,triangle:a,positions:l,triangleTest:c,geometryTest:p}}function z(e,t,r){const i={type:"point",x:t[0],y:t[1],hasZ:!1,hasM:!1,spatialReference:r},s=!I(r)&&!M(r),o=Number.isNaN(t[3])?0:n(t[3],0,2*k.radius),a=s?e.buffer(i,o,1):e.geodesicBuffer(i,o,1);return a.type="polygon",a}function H(e,t,r,i){switch(i){case"intersects":case"contains":return Z(e,t,r);case"disjoint":return J(e,t,r)}}function Z(e,t,r){return e.intersects(t,r)?e.contains(t,r)?K.KEEP:K.TEST:K.DISCARD}function J(e,t,r){return e.intersects(t,r)?e.contains(t,r)?K.DISCARD:K.TEST:K.KEEP}function Q(e,t,r,i){const{collection:s,object:n,renderSR:o,maskSR:a,geometryTest:l,aabbCache:c}=i;let p=c.get(r);if(!p){const e=s.getObjectTransform(n);s.getComponentAabb(n,r,X);const t=[[X[0],X[1],0],[X[0],X[4],0],[X[3],X[4],0],[X[3],X[1],0]];for(let r=0;r<4;++r)m(t[r],t[r],e.rotationScale),f(t[r],t[r],e.position),w(t[r],o,t[r],a);p={type:"polygon",rings:[t],spatialReference:a,cache:{}},p.rings[0][4]=p.rings[0][0],c.set(r,p)}switch(l(e,t,p)){case K.DISCARD:return!1;case K.KEEP:return!0}const{triangle:u,triangleTest:g,positions:y}=i,h=u.rings[0][0],j=u.rings[0][1],S=u.rings[0][2],R=s.getObjectTransform(n);s.getComponentPositions(n,r,y);const{indices:E,data:b,stride:v,startIndex:F,endIndex:_}=y;for(let k=F;k<_;k+=3){const r=v*E[k],i=v*E[k+1],s=v*E[k+2];switch(d(h,b[r],b[r+1],b[r+2]),d(j,b[i],b[i+1],b[i+2]),d(S,b[s],b[s+1],b[s+2]),m(h,h,R.rotationScale),m(j,j,R.rotationScale),m(S,S,R.rotationScale),f(h,h,R.position),f(j,j,R.position),f(S,S,R.position),w(h,o,h,a),w(j,o,j,a),w(S,o,S,a),g(e,t,u)){case K.DISCARD:return!1;case K.KEEP:return!0}}return"intersects"!==i.type}const X=E();export{L as I3SMeshViewFilter};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../chunks/tslib.es6.js";import t from"../../../../request.js";import s from"../../../../core/Accessor.js";import{splitIntoChunks as i}from"../../../../core/arrayUtils.js";import{resultOrAbort as r,result as o}from"../../../../core/asyncUtils.js";import{estimateStringByteSize as n,estimateNumberByteSize as a}from"../../../../core/byteSizeEstimations.js";import d from"../../../../core/Collection.js";import c from"../../../../core/Logger.js";import{destroyMaybe as h,abortMaybe as l}from"../../../../core/maybe.js";import{whenOrAbort as u}from"../../../../core/promiseUtils.js";import m from"../../../../core/ReactiveSet.js";import{watch as p,initial as g}from"../../../../core/reactiveUtils.js";import{property as y}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/accessorSupport/ensureType.js";import"../../../../core/has.js";import{subclass as b}from"../../../../core/accessorSupport/decorators/subclass.js";import{formatNumber as _}from"../../../../intl/number.js";import{getMaximumQuerySize as f,queryAllJSON as O}from"../../../../layers/support/featureQueryAll.js";import{assetMapFromAssetMapsJSON as C,extractMesh as j}from"../../../../rest/support/meshFeatureSet.js";import{direct3DObjectFeatureLayerDisplayEnabled as v,i3sPatchingEnabled as I,sceneLayerEditingEnabled as F}from"../../../../support/featureFlags.js";import{isTimeoutError as A}from"../../../../support/requestUtils.js";import L from"../FeatureLayerView3D.js";const E="esri.views.3d.layers.i3s.I3SOverrides";let w=class extends s{constructor(e){super(e),this._warnMaximumChangedObjectsExceeded=!1,this._maximumNumberOfEditOVerrides=S,this._original3DOFLDefinitionExpression=null,this._interactiveEditingSessions=new d,this.geometryOverrides=new d,this._clientGeometryCache=new Map,this._associatedLayerView=null,this._attributeChangedObjectIds=new m,this._geometryChangedObjectIds=new m,this._pendingFetchChangedObjectIds=null,this._pendingFetchAbortController=new AbortController}initialize(){this._memCache=this.memoryController.newCache(`i3s-attribute-overrides-${this.layer.uid}`),this._pendingFetchChangedObjectIds=this._fetchChangedObjectIds(this._pendingFetchAbortController?.signal),this._pendingFetchChangedObjectIds.finally((()=>{this._pendingFetchAbortController=null,this._pendingFetchChangedObjectIds=null})),this.is3DOFL&&null!=this._associatedLayer&&(v()?this._associatedLayer.load().then((e=>{this.destroyed||(this._original3DOFLDefinitionExpression=e.definitionExpression,this.addHandles(p((()=>this._definitionExpression),(t=>e.definitionExpression=t),g)),this._associatedLayerView=new L({layer:this._associatedLayer,view:this.view}))})):I())}destroy(){this.is3DOFL&&null!=this._associatedLayer&&(v()?null!=this._associatedLayerView&&(this._associatedLayer.definitionExpression=this._original3DOFLDefinitionExpression):I()),this._set("layer",null),this._memCache=h(this._memCache),this._pendingFetchAbortController=l(this._pendingFetchAbortController),this._pendingFetchChangedObjectIds=null}get is3DOFL(){return F()&&null!=this._associatedLayer&&null!=this._associatedLayer.infoFor3D}get sortedGeometryChangedObjectIds(){return this.is3DOFL?[...this._geometryChangedObjectIds].sort(((e,t)=>e-t)):[]}get _associatedLayer(){return null==this.layer?null:this.layer.associatedLayer}get hasGeometryChanges(){return this._geometryChangedObjectIds.size>0}get _definitionExpression(){const e=this.sortedGeometryChangedObjectIds;return 0===e.length?"1 = 0":`OBJECTID IN (${e.join(",")})`}get updating(){if(!this.is3DOFL)return!1;if(v()){return!(null!=this._associatedLayerView)||null!=this._associatedLayerView&&this._associatedLayerView.updating}return I(),!1}get isEmpty(){return null==this._pendingFetchChangedObjectIds&&0===this._attributeChangedObjectIds.size&&0===this._geometryChangedObjectIds.size}featureHasGeometryChanges(e){return this._geometryChangedObjectIds.has(e)}featureHasAttributeChanges(e){return this._attributeChangedObjectIds.has(e)}createInteractiveEditSession(e){this._attributeChangedObjectIds.add(e);const t=F()&&I()&&null!=this.is3DOFL,s=this._interactiveEditingSessions,i=new x(e,{rollback:()=>{s.remove(i)},commit:(s,i)=>{for(const[t,r]of s)this.updateAttributeValue(e,t,r);t&&null!=i&&this.updateGeometry(e,i)}});return s.unshift(i),i}async applyAttributeOverrides(e,t,s){if(null==t)return;const{loadedAttributes:i,attributeData:r}=t;if(null==i||0===i.length||null==r)return;if(this._pendingFetchChangedObjectIds&&await u(this._pendingFetchChangedObjectIds,s),0===this._attributeChangedObjectIds.size)return;const o={loadedAttributes:i,attributeData:r},n=this._getOverridesFromCache(e,o,this._attributeChangedObjectIds),{objectIds:a,fieldNames:d}=n;if(0===a.length||0===d.length)return;const c=await this._queryOverridesFromAssociatedLayer(a,d,!1,s);null!=c&&this._processOverridesFromAssociatedLayer(e,c,d,o)}updateGeometry(e,t){this._geometryChangedObjectIds.add(e);const s=this._clientGeometryCache.get(e);if(null!=s&&(this.geometryOverrides.remove(s),this._clientGeometryCache.delete(e)),null!=t){const s={oid:e,mesh:t};this.geometryOverrides.add(s),this._clientGeometryCache.set(e,s)}}updateAttributeValue(e,t,s){this._attributeChangedObjectIds.add(e),this._cacheAttributeValue(e,t,s)}_cacheAttributeValue(e,t,s){this._memCache.put(this._getAttributeCacheKey(e,t),s,this._memCacheAttributeValueSize(s))}_getOverridesFromCache(e,{loadedAttributes:t,attributeData:s},i){const r=new Set,o=new Array;if(this.is3DOFL&&0===Object.keys(s).length)return{objectIds:Array.from(e),fieldNames:t.map((e=>e.name))};for(const a of t)o[a.index]=s[a.name];const n=new Set;for(let a=0;a<e.length;a++){const s=e[a];if(i.has(s))for(const e of t){const t=this._attributeFromCache(s,e.index);void 0===t?(r.add(s),n.add(e.name)):o[e.index][a]=t}}return{objectIds:Array.from(r),fieldNames:Array.from(n)}}_attributeFromCache(e,t){const s=this._fromInteractiveEditingSession(e,t);if(void 0!==s)return s;const i=this._getAttributeCacheKey(e,t);return this._memCache.get(i)}_fromInteractiveEditingSession(e,t){if(null!=this._interactiveEditingSessions)for(const s of this._interactiveEditingSessions){if(s.objectId!==e)continue;const i=s.getAttribute(t);if(void 0!==i)return i}}_getAttributeCacheKey(e,t){return`${e}-${t}`}async _queryOverridesFromAssociatedLayer(e,t,s,o){if(0===e.length||!1===s&&0===t.length)return null;e=e.sort(((e,t)=>e-t)),this._warnMaximumChangedObjectsExceeded&&(this._warnMaximumChangedObjectsExceeded=!1,this._logMaximumObjectsExceededWarning());const n=this.layer.associatedLayer;if(null==n)return null;const a=s&&this.is3DOFL&&I(),d=[n.objectIdField,...t];a&&null!=n.globalIdField&&d.push(n.globalIdField);const c=n.createQuery();c.where="1=1",c.returnGeometry=s,c.outFields=d,c.cacheHint=!0,c.objectIds=e;const h=f(n),l=e.length>h?i(e,h).map((e=>{const t=c.clone();return t.objectIds=e,r(O(n,t,{signal:o}))})):[r(O(n,c,{signal:o}))],u=await Promise.all(l);if(a&&null!=n.infoFor3D){const e=n.infoFor3D,t=n.spatialReference,s=[];for(const i of u){if(!i.ok)continue;const r=i.value;if(null==r.assetMaps)continue;const o=C(e,r.assetMaps);for(const i of r.features){const n=j(i,r.globalIdFieldName,t,e,o),a=i;null!=n?(a.geometry=n,s.push(a)):a.geometry=null}}return s}return u.reduce(((e,t)=>e.concat(t.ok?t.value.features:[])),[])}_logMaximumObjectsExceededWarning(){let e=`The number of edited objects that are not yet cached in the scene service exceeds the maximum limit. Attribute changes will only be available for the first ${_(this._maximumNumberOfEditOVerrides)} objects. Please consider re-caching the scene service`;const t=this.layer.portalItem;t&&t.loaded?e+=` (${t.portal.url}/home/item.html?id=${t.id}#settings)`:e+=` (${this.layer.parsedUrl.path})`,c.getLogger(E).warn("#queryOverrides()",this.layer.title,`${e}.`)}_processOverridesFromAssociatedLayer(e,t,s,{loadedAttributes:i,attributeData:r}){const o=this._associatedLayer;if(null==o)return;const n=o.objectIdField,a=s.map((t=>(t in r||(r[t]=new Array(e.length)),r[t]))),d=new Map(i.map((e=>[e.name,e.index]))),c=s.map((e=>d.get(e))),h=new Map(Array.from(e,((e,t)=>[e,t])));for(const l of t){const e=l.attributes[n];for(let t=0;t<s.length;t++){const i=c[t],r=h.get(e),o=l.attributes[s[t]];a[t][r]=o,this._cacheAttributeValue(e,i,o)}}}_memCacheAttributeValueSize(e){return"string"==typeof e?n(e):a()}async _fetchChangedObjectIds(e){const s=this.layer;await s.load({signal:e}),this._geometryChangedObjectIds.clear(),this._attributeChangedObjectIds.clear();const{associatedLayer:i}=s;if(null==i||!i.capabilities?.operations?.supportsChangeTracking)return;const r=this._getFetchChangedObjectIdsServerGen();if(null==r)return;const n=i.layerId,a=this.is3DOFL,d={f:"json",returnIdsOnly:!0,layers:`[${n}]`,returnUpdates:!0,returnDeletes:a,returnInserts:a,layerServerGens:JSON.stringify([{id:n,serverGen:r}])};if(a){const e=i.infoFor3D;d.fieldsToCompare=JSON.stringify({fields:[...Object.values(e.transformFieldRoles),e.sourceHashField]})}const h=await o(t(`${i.url}/extractChanges`,{method:"post",query:d,timeout:G,signal:e}));if(!h.ok&&A(h.error)){const e=this.layer.title;c.getLogger(E).warn("extractChanges:timeout",e,`${e} could not obtain edited features that are not cached in the scene service. Display of features may not be up to date with the latest edits. Consider re-caching the scene service.`)}if(h.ok&&1===h.value.data?.edits?.length){const t=h.value.data.edits[0],s=t?.objectIds,r=t?.fieldUpdates,o=s?.adds??[],n=s?.updates??[],d=s?.deletes??[],c=[...o,...n,...d],l=a?[...o,...r??n,...d]:[],u=Math.min(this._maximumNumberOfEditOVerrides,c.length);u<c.length&&(this._warnMaximumChangedObjectsExceeded=!0);const m=c.sort(((e,t)=>e-t));for(let e=0;e<u;++e){const t=m[e];this._attributeChangedObjectIds.add(t)}for(const e of l)this._geometryChangedObjectIds.add(e);if(this.is3DOFL&&I()&&this._geometryChangedObjectIds.size>0){const t=await this._queryOverridesFromAssociatedLayer(Array.from(this._geometryChangedObjectIds),[],!0,e);if(null!=t)for(const e of t)null!=e.geometry&&this.updateGeometry(e.attributes[i.objectIdField],e.geometry)}}}_getFetchChangedObjectIdsServerGen(){const e=this.layer;if(null!=e.serviceUpdateTimeStamp&&null!=e.serviceUpdateTimeStamp.lastUpdate)return e.serviceUpdateTimeStamp.lastUpdate;const t=e.associatedLayer;return null!=t&&null!=t.serverGens&&null!=t.serverGens.minServerGen?t.serverGens.minServerGen:null}get test(){const e=Array.from(this._attributeChangedObjectIds),t=this._pendingFetchChangedObjectIds,s=this;return{changedObjectIds:e,pendingFetchChangedObjectIds:t,get maximumNumberOfEditOVerrides(){return s._maximumNumberOfEditOVerrides},set maximumNumberOfEditOVerrides(e){s._maximumNumberOfEditOVerrides=e}}}};e([y({constructOnly:!0})],w.prototype,"view",void 0),e([y({constructOnly:!0})],w.prototype,"layer",void 0),e([y({readOnly:!0})],w.prototype,"is3DOFL",null),e([y()],w.prototype,"_interactiveEditingSessions",void 0),e([y({readOnly:!0})],w.prototype,"sortedGeometryChangedObjectIds",null),e([y({readOnly:!0})],w.prototype,"geometryOverrides",void 0),e([y()],w.prototype,"_clientGeometryCache",void 0),e([y()],w.prototype,"_associatedLayer",null),e([y()],w.prototype,"_associatedLayerView",void 0),e([y({constructOnly:!0})],w.prototype,"memoryController",void 0),e([y()],w.prototype,"_attributeChangedObjectIds",void 0),e([y()],w.prototype,"_geometryChangedObjectIds",void 0),e([y()],w.prototype,"hasGeometryChanges",null),e([y()],w.prototype,"_pendingFetchChangedObjectIds",void 0),e([y()],w.prototype,"_pendingFetchAbortController",void 0),e([y()],w.prototype,"_definitionExpression",null),e([y()],w.prototype,"updating",null),e([y()],w.prototype,"isEmpty",null),w=e([b(E)],w);class x{constructor(e,t){this.objectId=e,this._options=t,this._updates=new Map,this._updatedGeometry=void 0,this._state=D.ACTIVE}getAttribute(e){return this._updates.get(e)}setAttribute(e,t){this.isActive&&this._updates.set(e,t)}getGeometry(){return this._updatedGeometry}setGeometry(e){this.isActive&&(this._updatedGeometry=e)}rollback(){this.isActive&&(this._state=D.ROLLED_BACK,this._options.rollback(),this._updatedGeometry=void 0)}commit(){this.isActive&&(this._state=D.COMMITTED,this._options.commit(this._updates,this._updatedGeometry),this._updates.clear(),this._updatedGeometry=void 0)}get isActive(){return this._state===D.ACTIVE}}var D;!function(e){e[e.ACTIVE=0]="ACTIVE",e[e.COMMITTED=1]="COMMITTED",e[e.ROLLED_BACK=2]="ROLLED_BACK"}(D||(D={}));const G=1e4,S=5e4;export{w as I3SOverrides};
5
+ import{_ as e}from"../../../../chunks/tslib.es6.js";import t from"../../../../request.js";import s from"../../../../core/Accessor.js";import{splitIntoChunks as r}from"../../../../core/arrayUtils.js";import{resultOrAbort as i,result as o}from"../../../../core/asyncUtils.js";import{estimateStringByteSize as n,estimateNumberByteSize as a}from"../../../../core/byteSizeEstimations.js";import d from"../../../../core/Collection.js";import c from"../../../../core/Logger.js";import{destroyMaybe as h,abortMaybe as l}from"../../../../core/maybe.js";import{whenOrAbort as u,createResolver as m,ignoreAbortErrors as p,throwIfAborted as g}from"../../../../core/promiseUtils.js";import y from"../../../../core/ReactiveSet.js";import{watch as f,initial as _}from"../../../../core/reactiveUtils.js";import{property as b}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/accessorSupport/ensureType.js";import"../../../../core/has.js";import{subclass as O}from"../../../../core/accessorSupport/decorators/subclass.js";import{formatNumber as C}from"../../../../intl/number.js";import{getMaximumQuerySize as j,queryAllJSON as v}from"../../../../layers/support/featureQueryAll.js";import{assetMapFromAssetMapsJSON as I,extractMesh as A}from"../../../../rest/support/meshFeatureSet.js";import{direct3DObjectFeatureLayerDisplayEnabled as F,i3sPatchingEnabled as L,sceneLayerEditingEnabled as w}from"../../../../support/featureFlags.js";import{isTimeoutError as E}from"../../../../support/requestUtils.js";import x from"../FeatureLayerView3D.js";const G="esri.views.3d.layers.i3s.I3SOverrides";let D=class extends s{constructor(e){super(e),this._warnMaximumChangedObjectsExceeded=!1,this._maximumNumberOfEditOVerrides=T,this._original3DOFLDefinitionExpression=null,this._interactiveEditingSessions=new d,this.geometryOverrides=new d,this._clientGeometryCache=new Map,this._associatedLayerView=null,this._attributeChangedObjectIds=new y,this._geometryChangedObjectIds=new y,this._pendingFetchChangedObjectIds=null,this._pendingFetchAbortController=new AbortController,this._pendingAttributeQueriesCache=new Map}initialize(){this._memCache=this.memoryController.newCache(`i3s-attribute-overrides-${this.layer.uid}`),this._pendingFetchChangedObjectIds=this._fetchChangedObjectIds(this._pendingFetchAbortController?.signal),this._pendingFetchChangedObjectIds.finally((()=>{this._pendingFetchAbortController=null,this._pendingFetchChangedObjectIds=null})),this.is3DOFL&&null!=this._associatedLayer&&(F()?this._associatedLayer.load().then((e=>{this.destroyed||(this._original3DOFLDefinitionExpression=e.definitionExpression,this.addHandles(f((()=>this._definitionExpression),(t=>e.definitionExpression=t),_)),this._associatedLayerView=new x({layer:this._associatedLayer,view:this.view}))})):L())}destroy(){this.is3DOFL&&null!=this._associatedLayer&&(F()?null!=this._associatedLayerView&&(this._associatedLayer.definitionExpression=this._original3DOFLDefinitionExpression):L()),this._set("layer",null),this._memCache=h(this._memCache),this._pendingFetchAbortController=l(this._pendingFetchAbortController),this._pendingFetchChangedObjectIds=null,this._pendingAttributeQueriesCache.clear()}get is3DOFL(){return w()&&null!=this._associatedLayer&&null!=this._associatedLayer.infoFor3D}get sortedGeometryChangedObjectIds(){return this.is3DOFL?[...this._geometryChangedObjectIds].sort(((e,t)=>e-t)):[]}get _associatedLayer(){return null==this.layer?null:this.layer.associatedLayer}get hasGeometryChanges(){return this._geometryChangedObjectIds.size>0}get _definitionExpression(){const e=this.sortedGeometryChangedObjectIds;return 0===e.length?"1 = 0":`OBJECTID IN (${e.join(",")})`}get updating(){if(!this.is3DOFL)return!1;if(F()){return!(null!=this._associatedLayerView)||null!=this._associatedLayerView&&this._associatedLayerView.updating}return L(),!1}get isEmpty(){return null==this._pendingFetchChangedObjectIds&&0===this._attributeChangedObjectIds.size&&0===this._geometryChangedObjectIds.size}featureHasGeometryChanges(e){return this._geometryChangedObjectIds.has(e)}featureHasAttributeChanges(e){return this._attributeChangedObjectIds.has(e)}createInteractiveEditSession(e){this._attributeChangedObjectIds.add(e);const t=w()&&L()&&null!=this.is3DOFL,s=this._interactiveEditingSessions,r=new S(e,{rollback:()=>{s.remove(r)},commit:(s,r)=>{for(const[t,i]of s)this.updateAttributeValue(e,t,i);t&&null!=r&&this.updateGeometry(e,r)}});return s.unshift(r),r}async applyAttributeOverrides(e,t,s){if(null==t)return;const{loadedAttributes:r,attributeData:i}=t;if(null==r||0===r.length||null==i)return;if(this._pendingFetchChangedObjectIds&&await u(this._pendingFetchChangedObjectIds,s),0===this._attributeChangedObjectIds.size)return;const o={loadedAttributes:r,attributeData:i},n=this._getOverridesFromCache(e,o,this._attributeChangedObjectIds),{objectIds:a,fieldNames:d}=n;if(0===a.length||0===d.length)return;const c=await this._queryAttributeOverridesFromAssociatedLayer(a,d,s);null!=c&&this._processOverridesFromAssociatedLayer(e,c,d,o)}updateGeometry(e,t){this._geometryChangedObjectIds.add(e);const s=this._clientGeometryCache.get(e);if(null!=s&&(this.geometryOverrides.remove(s),this._clientGeometryCache.delete(e)),null!=t){const s={oid:e,mesh:t};this.geometryOverrides.add(s),this._clientGeometryCache.set(e,s)}}updateAttributeValue(e,t,s){this._attributeChangedObjectIds.add(e),this._cacheAttributeValue(e,t,s)}_cacheAttributeValue(e,t,s){this._memCache.put(this._getAttributeCacheKey(e,t),s,this._memCacheAttributeValueSize(s))}_getOverridesFromCache(e,{loadedAttributes:t,attributeData:s},r){const i=new Set,o=new Array;for(const a of t)o[a.index]=s[a.name];const n=new Set;for(let a=0;a<e.length;a++){const s=e[a];if(r.has(s))for(const e of t){const t=this._attributeFromCache(s,e.index);void 0===t?(i.add(s),n.add(e.name)):o[e.index][a]=t}}return{objectIds:Array.from(i),fieldNames:Array.from(n)}}_attributeFromCache(e,t){const s=this._fromInteractiveEditingSession(e,t);if(void 0!==s)return s;const r=this._getAttributeCacheKey(e,t);return this._memCache.get(r)}_fromInteractiveEditingSession(e,t){if(null!=this._interactiveEditingSessions)for(const s of this._interactiveEditingSessions){if(s.objectId!==e)continue;const r=s.getAttribute(t);if(void 0!==r)return r}}_getAttributeCacheKey(e,t){return`${e}-${t}`}async _queryAttributeOverridesFromAssociatedLayer(e,t,s){if(0===e.length)return null;this._logWarningIfMaximumObjectsExceeded();const{associatedLayer:r}=this.layer;if(null==r)return null;const i=this._pendingAttributeQueriesCache,o=new Array,n=new Map;for(const g of e){const e=i.get(g);if(e)o.push(e);else{const e=m();p(e.promise),n.set(g,e),i.set(g,e.promise)}}const a=Array.from(n.keys()),d=r.createQuery(),{objectIdField:c}=r,h=[c,...t];d.where="1=1",d.returnGeometry=!1,d.outFields=h,d.cacheHint=!0,d.objectIds=a;const[l,u]=await Promise.all([this._executeBatchQuery(r,a,d,s),Promise.all(o)]).then((e=>(g(s),e))).catch((e=>{for(const[t,s]of n)i.delete(t),s.reject(e);throw e})),y=[];for(const m of l)if(m.ok)for(const e of m.value.features){const t=e,s=t.attributes[c];n.get(s)?.resolve(t),i.delete(s),n.delete(s),y.push(t)}for(const m of u)m&&y.push(m);for(const[m,p]of n)i.delete(m),p.resolve(null);return y}async _queryGeometryOverridesFromAssociatedLayer(e,t){if(0===e.length||!this.is3DOFL||!L())return null;this._logWarningIfMaximumObjectsExceeded();const s=this.layer.associatedLayer,{objectIdField:r,globalIdField:i}=s,o=[r,...null!=i?[i]:[]],n=s.createQuery();n.where="1=1",n.returnGeometry=!0,n.outFields=o,n.cacheHint=!0,n.objectIds=e,n.returnZ=s.hasZ,n.returnM=s.hasM;const a=await this._executeBatchQuery(s,e,n,t),d=s.infoFor3D,{spatialReference:c}=s,h=[];for(const l of a){if(!l.ok)continue;const e=l.value,{assetMaps:t,features:s,globalIdFieldName:r}=e;if(null==t)continue;const i=I(d,t);for(const o of s){const e=A(o,r,c,d,i),t=o;null!=e?(t.geometry=e,h.push(t)):t.geometry=null}}return h}_logWarningIfMaximumObjectsExceeded(){if(!this._warnMaximumChangedObjectsExceeded)return;this._warnMaximumChangedObjectsExceeded=!1;let e=`The number of edited objects that are not yet cached in the scene service exceeds the maximum limit. Attribute changes will only be available for the first ${C(this._maximumNumberOfEditOVerrides)} objects. Please consider re-caching the scene service`;const t=this.layer.portalItem;t&&t.loaded?e+=` (${t.portal.url}/home/item.html?id=${t.id}#settings)`:e+=` (${this.layer.parsedUrl.path})`,c.getLogger(G).warn("#queryOverrides()",this.layer.title,`${e}.`)}async _executeBatchQuery(e,t,s,o){if(0===t.length)return[];const n=j(e);t=[...t].sort(((e,t)=>e-t));const a=r(t,n).map((t=>{const r=s.clone();return r.objectIds=t,i(v(e,r,{signal:o}))}));return Promise.all(a)}_processOverridesFromAssociatedLayer(e,t,s,{loadedAttributes:r,attributeData:i}){const o=this._associatedLayer;if(null==o)return;const n=o.objectIdField,a=s.map((t=>(t in i||(i[t]=new Array(e.length)),i[t]))),d=new Map(r.map((e=>[e.name,e.index]))),c=s.map((e=>d.get(e))),h=new Map(Array.from(e,((e,t)=>[e,t])));for(const l of t){const e=l.attributes[n];for(let t=0;t<s.length;t++){const r=c[t],i=h.get(e),o=l.attributes[s[t]];a[t][i]=o,this._cacheAttributeValue(e,r,o)}}}_memCacheAttributeValueSize(e){return"string"==typeof e?n(e):a()}async _fetchChangedObjectIds(e){const s=this.layer;await s.load({signal:e}),this._geometryChangedObjectIds.clear(),this._attributeChangedObjectIds.clear();const{associatedLayer:r}=s;if(null==r||!r.capabilities?.operations?.supportsChangeTracking)return;const i=this._getFetchChangedObjectIdsServerGen();if(null==i)return;const n=r.layerId,a=this.is3DOFL,d={f:"json",returnIdsOnly:!0,layers:`[${n}]`,returnUpdates:!0,returnDeletes:a,returnInserts:a,layerServerGens:JSON.stringify([{id:n,serverGen:i}])};if(a){const e=r.infoFor3D;d.fieldsToCompare=JSON.stringify({fields:[...Object.values(e.transformFieldRoles),e.sourceHashField]})}const h=await o(t(`${r.url}/extractChanges`,{method:"post",query:d,timeout:M,signal:e}));if(!h.ok&&E(h.error)){const e=this.layer.title;c.getLogger(G).warn("extractChanges:timeout",e,`${e} could not obtain edited features that are not cached in the scene service. Display of features may not be up to date with the latest edits. Consider re-caching the scene service.`)}if(h.ok&&1===h.value.data?.edits?.length){const t=h.value.data.edits[0],s=t?.objectIds,i=t?.fieldUpdates,o=s?.adds??[],n=s?.updates??[],d=s?.deletes??[],c=[...o,...n,...d],l=a?[...o,...i??n,...d]:[],u=Math.min(this._maximumNumberOfEditOVerrides,c.length);u<c.length&&(this._warnMaximumChangedObjectsExceeded=!0);const m=c.sort(((e,t)=>e-t));for(let e=0;e<u;++e){const t=m[e];this._attributeChangedObjectIds.add(t)}for(const e of l)this._geometryChangedObjectIds.add(e);if(this.is3DOFL&&L()&&this._geometryChangedObjectIds.size>0){const t=await this._queryGeometryOverridesFromAssociatedLayer(Array.from(this._geometryChangedObjectIds),e);if(null!=t)for(const e of t)null!=e.geometry&&this.updateGeometry(e.attributes[r.objectIdField],e.geometry)}}}_getFetchChangedObjectIdsServerGen(){const e=this.layer;if(null!=e.serviceUpdateTimeStamp&&null!=e.serviceUpdateTimeStamp.lastUpdate)return e.serviceUpdateTimeStamp.lastUpdate;const t=e.associatedLayer;return null!=t&&null!=t.serverGens&&null!=t.serverGens.minServerGen?t.serverGens.minServerGen:null}get test(){const e=Array.from(this._attributeChangedObjectIds),t=this._pendingFetchChangedObjectIds,s=this;return{changedObjectIds:e,pendingFetchChangedObjectIds:t,get maximumNumberOfEditOVerrides(){return s._maximumNumberOfEditOVerrides},set maximumNumberOfEditOVerrides(e){s._maximumNumberOfEditOVerrides=e}}}};e([b({constructOnly:!0})],D.prototype,"view",void 0),e([b({constructOnly:!0})],D.prototype,"layer",void 0),e([b({readOnly:!0})],D.prototype,"is3DOFL",null),e([b()],D.prototype,"_interactiveEditingSessions",void 0),e([b({readOnly:!0})],D.prototype,"sortedGeometryChangedObjectIds",null),e([b({readOnly:!0})],D.prototype,"geometryOverrides",void 0),e([b()],D.prototype,"_clientGeometryCache",void 0),e([b()],D.prototype,"_associatedLayer",null),e([b()],D.prototype,"_associatedLayerView",void 0),e([b({constructOnly:!0})],D.prototype,"memoryController",void 0),e([b()],D.prototype,"_attributeChangedObjectIds",void 0),e([b()],D.prototype,"_geometryChangedObjectIds",void 0),e([b()],D.prototype,"hasGeometryChanges",null),e([b()],D.prototype,"_pendingFetchChangedObjectIds",void 0),e([b()],D.prototype,"_pendingFetchAbortController",void 0),e([b()],D.prototype,"_definitionExpression",null),e([b()],D.prototype,"updating",null),e([b()],D.prototype,"isEmpty",null),D=e([O(G)],D);class S{constructor(e,t){this.objectId=e,this._options=t,this._updates=new Map,this._updatedGeometry=void 0,this._state=V.ACTIVE}getAttribute(e){return this._updates.get(e)}setAttribute(e,t){this.isActive&&this._updates.set(e,t)}getGeometry(){return this._updatedGeometry}setGeometry(e){this.isActive&&(this._updatedGeometry=e)}rollback(){this.isActive&&(this._state=V.ROLLED_BACK,this._options.rollback(),this._updatedGeometry=void 0)}commit(){this.isActive&&(this._state=V.COMMITTED,this._options.commit(this._updates,this._updatedGeometry),this._updates.clear(),this._updatedGeometry=void 0)}get isActive(){return this._state===V.ACTIVE}}var V;!function(e){e[e.ACTIVE=0]="ACTIVE",e[e.COMMITTED=1]="COMMITTED",e[e.ROLLED_BACK=2]="ROLLED_BACK"}(V||(V={}));const M=1e4,T=5e4;export{D as I3SOverrides};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
4
  */
5
- import{clone as t}from"../../../../core/lang.js";import{attributeLookup as e}from"../support/attributeUtils.js";const n={setAttribute(){},setGeometry(t){},rollback(){},commit(){}};var r;function o(e,o){const s=o.attributes[e.objectIdField],u=e.sessions.get(s);if(u)return u;const l=t(o.attributes),i=new Set;if(null==s)return n;const a=e.i3sOverrides.createInteractiveEditSession(s),c=new Map,f=(t,e)=>{const n=c.get(t);if(null==n){const n=e.indexOf(s);return c.set(t,n),n}return n};let d=r.EDITING;const I={setAttribute(t,n){if(d!==r.EDITING)return;const s=e.fieldsIndex.get(t);if(!s)return;const u=e.attributeStorageInfo.findIndex((t=>t.name===s.name));if(u<0)return;a.setAttribute(u,n);const l=e.attributeStorageInfo[u];let c=!1;i.add(t),e.forEachNode(((t,r)=>{const s=f(t,r);if(-1===s)return;const u=e.getAttributeData(t.index);if(u){const r=u[l.name];r&&(r[s]=n,e.setAttributeData(t.index,u,o),c=!0)}})),c&&e.clearMemCache()},setGeometry(t){d===r.EDITING&&a.setGeometry(t)},rollback(){if(d===r.EDITING){for(const t of i)this.setAttribute(t,l[t]);a.rollback(),d=r.ROLLED_BACK,e.sessions.delete(s)}},commit(){d===r.EDITING&&(a.commit(),d=r.COMMITTED,e.sessions.delete(s))}};return e.sessions.set(s,I),I}function s(t,n){const r=t.fieldsIndex,o=t.objectIdField,s=t.globalIdField;if(null==s)return;const u=new Map,l=f(n.addedFeatures),i=n.edits.addFeatures,a=d(n.updatedFeatures),I=n.edits.updateFeatures,b=c(r,o,s,n.edits?.deleteFeatures),g=d(n.deletedFeatures,b),m=n.edits.deleteFeatures;if(null!=i&&i.length>0)for(const c of i){const t=e(r,c.attributes,s),n=l.get(t);null!=c.geometry&&"mesh"===c.geometry.type&&null!=n&&u.set(n,c.geometry)}if(null!=I&&I.length>0)for(const c of I){const t=e(r,c.attributes,o);null!=c.geometry&&"mesh"===c.geometry.type&&a.has(t)&&u.set(t,c.geometry)}if(null!=m&&m.length>0)for(const c of m){let t=null;t="attributes"in c?e(r,c.attributes,o):c.objectId,null!=t&&g.has(t)&&u.set(t,null)}for(const[e,c]of u)t.i3sOverrides.updateGeometry(e,c)}function u(t,e){const n=l(t,e);if(0===n.size)return;const r=new Map;for(let s=0;s<t.attributeStorageInfo.length;s++)r.set(t.attributeStorageInfo[s].name,s);let o=!1;n.forEach(((e,n)=>{const s=t.getAttributeData(n);let u=!1;e.forEach(((e,n)=>{const l=null!=s?s[n]:null,i=r.get(n);for(const{featureIndex:r,value:s,featureId:a}of e)l&&(l[r]=s,u=!0,o=!0),t.i3sOverrides.updateAttributeValue(a,i,s)})),u&&t.setAttributeData(n,s,null)})),o&&t.clearMemCache()}function l(t,n){const r=n.edits.updateFeatures;if(!r||0===r.length)return new b;const o=d(n.updatedFeatures),s=new b,u=new Map;for(let e=0;e<t.attributeStorageInfo.length;e++)u.set(t.attributeStorageInfo[e].name,e);const l=t.fieldsIndex,a=t.objectIdField,c=r.filter((t=>{const n=e(l,t.attributes,a);return o.has(n)}));return t.forEachNode(((n,r)=>{const o=new Set(r);for(const u of c){const c=e(l,u.attributes,a);if(!o.has(c))continue;const f=r.indexOf(c);for(const e in u.attributes){const r=t.fieldsIndex.normalizeFieldName(e),o=i(s,n.index,r),l=u.attributes[e];o.push({featureIndex:f,featureId:c,value:l})}}})),s}function i(t,e,n){const r=a(t,e),o=null!=n&&r.get(n);if(o)return o;const s=new Array;return r.set(n,s),s}function a(t,e){const n=t.get(e);if(n)return n;const r=new I;return t.set(e,r),r}function c(t,n,r,o){const s=new Map;if(!o)return s;for(const u of o){let o=null,l=null;"attributes"in u?(o=e(t,u.attributes,n),l=e(t,u.attributes,r)):(o=u.objectId,l=u.globalId),null!=l&&null!=o&&s.set(l,o)}return s}function f(t){const e=new Map;if(!t)return e;for(const n of t)null!=n.globalId&&null!=n.objectId&&null==n.error&&e.set(n.globalId,n.objectId);return e}function d(t,e=null){const n=new Set;if(!t)return n;for(const r of t)if(null==r.error)if(null!=r.objectId&&-1!==r.objectId)n.add(r.objectId);else if(null!=r.globalId&&null!=e){const t=e.get(r.globalId);null!=t&&n.add(t)}return n}!function(t){t[t.EDITING=0]="EDITING",t[t.ROLLED_BACK=1]="ROLLED_BACK",t[t.COMMITTED=2]="COMMITTED"}(r||(r={}));const I=Map,b=Map;export{o as createInteractiveEditSession,u as processAttributeEdits,s as processGeometryEdits};
5
+ import{clone as t}from"../../../../core/lang.js";import{attributeLookup as e}from"../support/attributeUtils.js";const n={setAttribute(){},setGeometry(t){},rollback(){},commit(){}};var r;function o(e,o){const s=o.attributes[e.objectIdField],l=e.sessions.get(s);if(l)return l;const u=t(o.attributes),i=new Set;if(null==s)return n;const a=e.i3sOverrides.createInteractiveEditSession(s),c=new Map,d=(t,e)=>{const n=c.get(t);if(null==n){const n=e.indexOf(s);return c.set(t,n),n}return n};let f=r.EDITING;const b={setAttribute(t,n){if(f!==r.EDITING)return;const s=e.fieldsIndex.get(t);if(!s)return;const l=e.attributeStorageInfo.findIndex((t=>t.name===s.name));if(l<0)return;a.setAttribute(l,n);const u=e.attributeStorageInfo[l];let c=!1;i.add(t),e.forEachNode(((t,r)=>{const s=d(t,r);if(-1===s)return;const l=e.getAttributeData(t.index);if(l){const r=l[u.name];r&&(r[s]=n,e.setAttributeData(t.index,l,o),c=!0)}})),c&&e.clearMemCache()},setGeometry(t){f===r.EDITING&&a.setGeometry(t)},rollback(){if(f===r.EDITING){for(const t of i)this.setAttribute(t,u[t]);a.rollback(),f=r.ROLLED_BACK,e.sessions.delete(s)}},commit(){f===r.EDITING&&(a.commit(),f=r.COMMITTED,e.sessions.delete(s))}};return e.sessions.set(s,b),b}function s(t,n){const r=t.fieldsIndex,o=t.objectIdField,s=t.globalIdField;if(null==s)return;const l=new Map,u=f(n.addedFeatures),i=n.edits.addFeatures,a=b(n.updatedFeatures),c=n.edits.updateFeatures,I=d(r,o,s,n.edits?.deleteFeatures),g=b(n.deletedFeatures,I),m=n.edits.deleteFeatures;if(null!=i&&i.length>0)for(const d of i){const t=e(r,d.attributes,s),n=u.get(t);null!=d.geometry&&"mesh"===d.geometry.type&&null!=n&&l.set(n,d.geometry)}if(null!=c&&c.length>0)for(const d of c){const t=e(r,d.attributes,o);null!=d.geometry&&"mesh"===d.geometry.type&&a.has(t)&&l.set(t,d.geometry)}if(null!=m&&m.length>0)for(const d of m){let t=null;t="attributes"in d?e(r,d.attributes,o):d.objectId,null!=t&&g.has(t)&&l.set(t,null)}for(const[e,d]of l)t.i3sOverrides.updateGeometry(e,d)}function l(t,e){const n=i(t,e),r=u(t,e);if(0===n.size&&0===r.size)return;const o=new Map;for(let u=0;u<t.attributeStorageInfo.length;u++)o.set(t.attributeStorageInfo[u].name,u);let s=!1;n.forEach(((e,n)=>{const r=t.getAttributeData(n);let l=!1;e.forEach(((e,n)=>{const u=null!=r?r[n]:null,i=o.get(n);for(const{featureIndex:r,value:o,featureId:a}of e)u&&(u[r]=o,l=!0,s=!0),t.i3sOverrides.updateAttributeValue(a,i,o)})),l&&t.setAttributeData(n,r,null)})),s&&t.clearMemCache();const{fieldsIndex:l}=t;for(const[u,i]of r){const{attributes:e}=i;for(const n in e){const r=l.normalizeFieldName(n),s=null!=r?o.get(r):null;if(null==s)continue;const i=e[n];t.i3sOverrides.updateAttributeValue(u,s,i)}}}function u(t,{edits:n,addedFeatures:r}){const o=new Map,s=n.addAssetFeatures,{fieldsIndex:l,globalIdField:u}=t;if(!s||0===s.length||null==u)return o;const i=f(r);for(const a of s){const t=e(l,a.attributes,u),n=i.get(t);null!=a.geometry&&"mesh"===a.geometry.type&&null!=n&&o.set(n,a)}return o}function i(t,n){const r=n.edits.updateFeatures;if(!r||0===r.length)return new g;const o=b(n.updatedFeatures),s=new g,l=new Map;for(let e=0;e<t.attributeStorageInfo.length;e++)l.set(t.attributeStorageInfo[e].name,e);const u=t.fieldsIndex,i=t.objectIdField,c=r.filter((t=>{const n=e(u,t.attributes,i);return o.has(n)}));return t.forEachNode(((n,r)=>{const o=new Set(r);for(const l of c){const c=e(u,l.attributes,i);if(!o.has(c))continue;const d=r.indexOf(c);for(const e in l.attributes){const r=t.fieldsIndex.normalizeFieldName(e),o=a(s,n.index,r),u=l.attributes[e];o.push({featureIndex:d,featureId:c,value:u})}}})),s}function a(t,e,n){const r=c(t,e),o=null!=n&&r.get(n);if(o)return o;const s=new Array;return r.set(n,s),s}function c(t,e){const n=t.get(e);if(n)return n;const r=new I;return t.set(e,r),r}function d(t,n,r,o){const s=new Map;if(!o)return s;for(const l of o){let o=null,u=null;"attributes"in l?(o=e(t,l.attributes,n),u=e(t,l.attributes,r)):(o=l.objectId,u=l.globalId),null!=u&&null!=o&&s.set(u,o)}return s}function f(t){const e=new Map;if(!t)return e;for(const n of t)null!=n.globalId&&null!=n.objectId&&null==n.error&&e.set(n.globalId,n.objectId);return e}function b(t,e=null){const n=new Set;if(!t)return n;for(const r of t)if(null==r.error)if(null!=r.objectId&&-1!==r.objectId)n.add(r.objectId);else if(null!=r.globalId&&null!=e){const t=e.get(r.globalId);null!=t&&n.add(t)}return n}!function(t){t[t.EDITING=0]="EDITING",t[t.ROLLED_BACK=1]="ROLLED_BACK",t[t.COMMITTED=2]="COMMITTED"}(r||(r={}));const I=Map,g=Map;export{o as createInteractiveEditSession,l as processAttributeEdits,s as processGeometryEdits};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
4
  */
5
- import{p as t}from"../../../../chunks/vec2.js";import{s as e}from"../../../../chunks/vec3.js";import{c as r}from"../../../../chunks/vec3f64.js";import{O as o}from"../../../../chunks/vec4f64.js";import{getReferenceEllipsoid as n}from"../../../../geometry/ellipsoidUtils.js";import{lonLatToWebMercatorComparable as i}from"../../../../geometry/projection.js";import{newDoubleArray as a}from"../../../../geometry/support/DoubleArray.js";import{newFloatArray as u}from"../../../../geometry/support/FloatArray.js";import{getZeroIndexArray as s}from"../../../../geometry/support/Indices.js";import{ViewingMode as l}from"../../../ViewingMode.js";import{Attribute as p}from"../../webgl-engine/lib/Attribute.js";import{ContentObjectType as c}from"../../webgl-engine/lib/ContentObjectType.js";import{Geometry as f}from"../../webgl-engine/lib/Geometry.js";import{VertexAttribute as m}from"../../webgl-engine/lib/VertexAttribute.js";function h(t,e,r=null){const o=[],n=[],i=e.mapPositions;T(e,n,o);const a=n[0][1].data,u=o[0][1].length,l=s(u);return b(e,n,o,l),A(e,n,o,l),g(e,n,o,l),E(e,n,o,l),I(e,n,o,l),O(e,n,o,l),R(e,n,o,a),new f(t,n,o,i,c.Line,r)}function T(t,e,r){const{attributeData:{position:o},removeDuplicateStartEnd:n}=t,i=D(o)&&n,a=o.length/3-(i?1:0),u=new Array(2*(a-1)),s=i?o.slice(0,o.length-3):o;let l=0;for(let p=0;p<a-1;p++)u[l++]=p,u[l++]=p+1;e.push([m.POSITION,new p(s,3,i)]),r.push([m.POSITION,u])}function b(t,e,r,n){if(null!=t.attributeData.colorFeature)return;const i=t.attributeData.color;e.push([m.COLOR,new p(i??o,4)]),r.push([m.COLOR,n])}function g(t,e,r,o){if(null==t.attributeData.normal)return;const n=t.attributeData.normal;e.push([m.NORMAL,new p(n,3)]),r.push([m.NORMAL,o])}function E(t,e,r,o){null!=t.attributeData.colorFeature&&(e.push([m.COLORFEATUREATTRIBUTE,new p([t.attributeData.colorFeature],1,!0)]),r.push([m.COLOR,o]))}function A(t,e,r,o){null==t.attributeData.sizeFeature&&(e.push([m.SIZE,new p([t.attributeData.size??1],1,!0)]),r.push([m.SIZE,o]))}function I(t,e,r,o){null!=t.attributeData.sizeFeature&&(e.push([m.SIZEFEATUREATTRIBUTE,new p([t.attributeData.sizeFeature],1,!0)]),r.push([m.SIZEFEATUREATTRIBUTE,o]))}function O(t,e,r,o){const n=t.attributeData.opacityFeature;null!=n&&(e.push([m.OPACITYFEATUREATTRIBUTE,new p([n],1,!0)]),r.push([m.OPACITYFEATUREATTRIBUTE,o]))}function R(r,o,s,c){if(null==r.overlayInfo||r.overlayInfo.renderCoordsHelper.viewingMode!==l.Global||!r.overlayInfo.spatialReference.isGeographic)return;const f=a(c.length),h=n(r.overlayInfo.spatialReference);for(let t=0;t<f.length;t+=3)i(c,t,f,t,h);const T=c.length/3,b=u(T+1);let g=j,E=w,A=0,I=0;e(g,f[I++],f[I++],f[I++]),b[0]=0;for(let n=1;n<T+1;++n)n===T&&(I=0),e(E,f[I++],f[I++],f[I++]),A+=t(g,E),b[n]=A,[g,E]=[E,g];o.push([m.DISTANCETOSTART,new p(b,1,!0)]),s.push([m.DISTANCETOSTART,s[0][1]])}function D(t){const e=t.length;return t[0]===t[e-3]&&t[1]===t[e-2]&&t[2]===t[e-1]}const j=r(),w=r();function y(t,e){if(null==t||0===t.length)return[];const r=[];return t.forEach((t=>{const o=t.length,n=a(3*o);t.forEach(((t,e)=>{n[3*e]=t[0],n[3*e+1]=t[1],n[3*e+2]=t[2]}));const i={attributeData:{position:n,normal:e},removeDuplicateStartEnd:!1};r.push(i)})),r}export{h as createGeometry,y as lineStripsToParameters};
5
+ import{u as t}from"../../../../chunks/vec2.js";import{s as e}from"../../../../chunks/vec3.js";import{c as r}from"../../../../chunks/vec3f64.js";import{O as o}from"../../../../chunks/vec4f64.js";import{getReferenceEllipsoid as n}from"../../../../geometry/ellipsoidUtils.js";import{lonLatToWebMercatorComparable as i}from"../../../../geometry/projection.js";import{newDoubleArray as a}from"../../../../geometry/support/DoubleArray.js";import{newFloatArray as u}from"../../../../geometry/support/FloatArray.js";import{getZeroIndexArray as s}from"../../../../geometry/support/Indices.js";import{ViewingMode as l}from"../../../ViewingMode.js";import{Attribute as p}from"../../webgl-engine/lib/Attribute.js";import{ContentObjectType as c}from"../../webgl-engine/lib/ContentObjectType.js";import{Geometry as f}from"../../webgl-engine/lib/Geometry.js";import{VertexAttribute as m}from"../../webgl-engine/lib/VertexAttribute.js";function h(t,e,r=null){const o=[],n=[],i=e.mapPositions;T(e,n,o);const a=n[0][1].data,u=o[0][1].length,l=s(u);return b(e,n,o,l),A(e,n,o,l),g(e,n,o,l),E(e,n,o,l),I(e,n,o,l),O(e,n,o,l),R(e,n,o,a),new f(t,n,o,i,c.Line,r)}function T(t,e,r){const{attributeData:{position:o},removeDuplicateStartEnd:n}=t,i=D(o)&&n,a=o.length/3-(i?1:0),u=new Array(2*(a-1)),s=i?o.slice(0,o.length-3):o;let l=0;for(let p=0;p<a-1;p++)u[l++]=p,u[l++]=p+1;e.push([m.POSITION,new p(s,3,i)]),r.push([m.POSITION,u])}function b(t,e,r,n){if(null!=t.attributeData.colorFeature)return;const i=t.attributeData.color;e.push([m.COLOR,new p(i??o,4)]),r.push([m.COLOR,n])}function g(t,e,r,o){if(null==t.attributeData.normal)return;const n=t.attributeData.normal;e.push([m.NORMAL,new p(n,3)]),r.push([m.NORMAL,o])}function E(t,e,r,o){null!=t.attributeData.colorFeature&&(e.push([m.COLORFEATUREATTRIBUTE,new p([t.attributeData.colorFeature],1,!0)]),r.push([m.COLOR,o]))}function A(t,e,r,o){null==t.attributeData.sizeFeature&&(e.push([m.SIZE,new p([t.attributeData.size??1],1,!0)]),r.push([m.SIZE,o]))}function I(t,e,r,o){null!=t.attributeData.sizeFeature&&(e.push([m.SIZEFEATUREATTRIBUTE,new p([t.attributeData.sizeFeature],1,!0)]),r.push([m.SIZEFEATUREATTRIBUTE,o]))}function O(t,e,r,o){const n=t.attributeData.opacityFeature;null!=n&&(e.push([m.OPACITYFEATUREATTRIBUTE,new p([n],1,!0)]),r.push([m.OPACITYFEATUREATTRIBUTE,o]))}function R(r,o,s,c){if(null==r.overlayInfo||r.overlayInfo.renderCoordsHelper.viewingMode!==l.Global||!r.overlayInfo.spatialReference.isGeographic)return;const f=a(c.length),h=n(r.overlayInfo.spatialReference);for(let t=0;t<f.length;t+=3)i(c,t,f,t,h);const T=c.length/3,b=u(T+1);let g=j,E=w,A=0,I=0;e(g,f[I++],f[I++],f[I++]),b[0]=0;for(let n=1;n<T+1;++n)n===T&&(I=0),e(E,f[I++],f[I++],f[I++]),A+=t(g,E),b[n]=A,[g,E]=[E,g];o.push([m.DISTANCETOSTART,new p(b,1,!0)]),s.push([m.DISTANCETOSTART,s[0][1]])}function D(t){const e=t.length;return t[0]===t[e-3]&&t[1]===t[e-2]&&t[2]===t[e-1]}const j=r(),w=r();function y(t,e){if(null==t||0===t.length)return[];const r=[];return t.forEach((t=>{const o=t.length,n=a(3*o);t.forEach(((t,e)=>{n[3*e]=t[0],n[3*e+1]=t[1],n[3*e+2]=t[2]}));const i={attributeData:{position:n,normal:e},removeDuplicateStartEnd:!1};r.push(i)})),r}export{h as createGeometry,y as lineStripsToParameters};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../Color.js";import r from"../../../core/Accessor.js";import{disposeMaybe as i}from"../../../core/maybe.js";import s from"../../../core/ObjectPool.js";import{property as n}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import{subclass as o}from"../../../core/accessorSupport/decorators/subclass.js";import{I as a}from"../../../chunks/mat4f64.js";import{b as l,s as h,e as c}from"../../../chunks/vec3.js";import{Z as u,f as d,c as p}from"../../../chunks/vec3f64.js";import{Z as f}from"../../../chunks/vec4f64.js";import{create as _,set as m}from"../../../geometry/support/aaBoundingBox.js";import{BufferViewVec3f as g}from"../../../geometry/support/buffer/BufferView.js";import{ViewingMode as b}from"../../ViewingMode.js";import{TextureUpdate as y}from"./interfaces.js";import{LayerClass as T}from"./LayerClass.js";import{OverlaySource as R}from"./Overlay.js";import{overlayRenderOccludedFlag as O}from"./OverlayRenderer.js";import{clearCaches as x}from"./PatchGeometry.js";import{PatchRenderData as C}from"./PatchRenderData.js";import{RenderOrder as v}from"./RenderOrder.js";import{ENABLE_TERRAIN_INTERNAL_CHECKS as D}from"./terrainUtils.js";import{TileRenderer as P}from"./TileRenderer.js";import{TileUpdate as S}from"./TileUpdate.js";import{IteratorPreorder as E,sortTiles as q,compareTiles as A}from"./tileUtils.js";import{componentMinimalSizeForIntersectionData as w,ComponentIntersectionData as N}from"../webgl-engine/collections/Component/ComponentIntersectionData.js";import{ShaderOutput as j}from"../webgl-engine/core/shaderLibrary/ShaderOutput.js";import{OverlayMode as G}from"../webgl-engine/core/shaderLibrary/terrain/Overlay.glsl.js";import{T as I}from"../../../chunks/Terrain.glsl.js";import{TileBlendInput as L}from"../webgl-engine/core/shaderLibrary/terrain/TileBlendInput.js";import{Attribute as F}from"../webgl-engine/lib/Attribute.js";import{RenderRequestType as U}from"../webgl-engine/lib/basicInterfaces.js";import{createEmptyTexture as k}from"../webgl-engine/lib/glUtil3D.js";import{newIntersectorResult as B}from"../webgl-engine/lib/Intersector.js";import{IntersectorType as M,StoreResults as z}from"../webgl-engine/lib/IntersectorInterfaces.js";import{RenderOccludedFlag as H}from"../webgl-engine/lib/Material.js";import{RenderSlot as V}from"../webgl-engine/lib/RenderSlot.js";import{getSettings as W}from"../webgl-engine/lib/screenSizePerspectiveUtils.js";import{VertexAttribute as Y}from"../webgl-engine/lib/VertexAttribute.js";import{TERRAIN_ID as Q,getVerticalOffsetTerrain as X}from"../webgl-engine/lib/verticalOffsetUtils.js";import{DrawParameters as Z}from"../webgl-engine/materials/DrawParameters.js";import{intersectAabbInvDirBefore as K,intersectTriangles as J}from"../webgl-engine/materials/internal/MaterialUtil.js";import{TerrainTechnique as $}from"../webgl-engine/shaders/TerrainTechnique.js";import{TerrainTechniqueConfiguration as ee}from"../webgl-engine/shaders/TerrainTechniqueConfiguration.js";import{PrimitiveType as te}from"../../webgl/enums.js";const re=7,ie=10,se=_();var ne;!function(e){e[e.Opaque=0]="Opaque",e[e.Semitransparent=1]="Semitransparent",e[e.TransparentWithDraped=2]="TransparentWithDraped",e[e.Empty=3]="Empty"}(ne||(ne={}));let oe=class extends r{get _isGlobal(){return this._stage.viewingMode===b.Global}constructor(e){super(e),this.type=M.TERRAIN,this.isGround=!0,this._tileSize=256,this._techniqueConfiguration=new ee,this._passParameters=new I,this._rctx=null,this._renderDataPool=new s(C),this._patchGroups=new Map,this._patchGroupsDirty=!0,this._patchSortingDirty=!0,this._tileIterator=new E,this._highestVisibleLODTile=null,this._visible=!0,this._transparencyState=ne.Opaque,this._castShadows=!0,this._emptyTex=null,this._tileRenderer=null,this._stencilEnabledLayerExtents=new Array,this._numTilesRendered=0,this._numTilesCulled=0,this._numOriginsRendered=0,this.needsHighlight=!1,this.renderOccludedFlags=H.Occlude}initialize(){const e=[V.OPAQUE_TERRAIN,V.TRANSPARENT_TERRAIN,V.OCCLUDED_TERRAIN];this._stage.addRenderPlugin(e,this)}destroy(){this._stage.removeRenderPlugin(this),x()}get canRender(){return this._visible&&!!this._rootTiles&&!this.renderingDisabled}set renderingDisabled(e){this._set("renderingDisabled",!!e),this.setDirty()}set transparency(e){this._transparencyState!==e&&(this._techniqueConfiguration.invisible=e===ne.TransparentWithDraped||e===ne.Empty,this._transparencyState=e,this.setNeedsRender())}get transparency(){return this._transparencyState}get needsLinearDepth(){return this._overlayRenderer.hasWater}get renderPatchBorders(){return!!this._techniqueConfiguration.tileBorders}set renderPatchBorders(e){this._techniqueConfiguration.tileBorders!==e&&(this._techniqueConfiguration.tileBorders=e,this.setNeedsRender(),this.notifyChange("renderPatchBorders"))}get visualizeNormals(){return!!this._techniqueConfiguration.visualizeNormals}set visualizeNormals(e){this._techniqueConfiguration.visualizeNormals!==e&&(this._techniqueConfiguration.visualizeNormals=e,this.setNeedsRender(),this.notifyChange("visualizeNormals"))}get cullBackFaces(){return this._techniqueConfiguration.backfaceCullingEnabled}set cullBackFaces(e){this._techniqueConfiguration.backfaceCullingEnabled!==e&&(this._techniqueConfiguration.backfaceCullingEnabled=e,this.notifyChange("cullBackFaces"),this.setNeedsRender())}set renderOrder(e){this._set("renderOrder",e),this._setSortingDirty()}get layerUid(){return Q}get slicePlaneEnabled(){return this._techniqueConfiguration.hasSlicePlane}set slicePlaneEnabled(e){this._techniqueConfiguration.hasSlicePlane!==e&&(this._techniqueConfiguration.hasSlicePlane=e,this.setNeedsRender())}set textureFadingEnabled(e){this._techniqueConfiguration.textureFadingEnabled!==e&&(this._techniqueConfiguration.textureFadingEnabled=e,this.setNeedsRender())}set pbrMode(e){this._techniqueConfiguration.pbrMode!==e&&(this._techniqueConfiguration.pbrMode=e,this.setNeedsRender())}setDebugScreenSizePerspective(e){this._techniqueConfiguration.screenSizePerspective!==e&&(this._techniqueConfiguration.screenSizePerspective=e,this.setNeedsRender())}setRootTiles(e){this._rootTiles=e,this.setDirty()}setNeedsHighlight(e){this.needsHighlight=e,this.setNeedsRender()}setRenderOccludedOverlay(e){this.renderOccludedFlags=e?O:H.Occlude,this.setNeedsRender()}setStencilEnabledLayerExtents(e){this._stencilEnabledLayerExtents=e,this._setSortingDirty()}setTileSize(e){this._tileSize=e,null!=this._tileRenderer&&(this._tileRenderer.tileSize=e),this.setDirty()}_prepareTileForLoading(e){e.renderData||(e.renderData=this._renderDataPool.acquire(),e.renderData.init(e),e.renderData.localOrigin=this._getLocalOriginOfTile(e))}loadTile(e){this._prepareTileForLoading(e),this.updateTileGeometryState(e),this.updateTileTexture(e,S.TEXTURE_FADING)}updateTileTexture(e,t){null!=this._tileRenderer&&(this._tileRenderer.updateTileTexture(e,t===S.TEXTURE_FADING?y.FADING:y.UNFADED),this.setNeedsRender(),e.resetPendingUpdate(t))}updateTileGeometryState(e){for(const r of e.layerInfo[T.ELEVATION])r.pendingUpdates&=~S.GEOMETRY;e.resetPendingUpdate(S.GEOMETRY);const t=e.renderData.updateGeometryState();return t&&this.setDirty(),t}updateGeometryIfNeeded(e){e.isLoaded&&e.renderData.updateGeometryIfNeeded(this._rctx)}unloadTile(e){const t=e.renderData;t&&(t.releaseGeometry(),this._renderDataPool.release(t),t.clear(),e.renderData=null,e.setMemoryDirty(),this.setDirty())}_getLocalOriginOfTile(e){const t=ie-re,r=Math.max(0,Math.floor((e.level-t)/re)*re);if(this._isGlobal&&0===r)return u;for(;e.parent&&e.level>r;)e=e.parent;return e.centerAtSeaLevel}setVisibility(e){this._visible=e,this.setDirty()}getStats(){return{numTilesRendered:this._numTilesRendered,numTilesCulled:this._numTilesCulled,numOriginsRendered:this._numOriginsRendered}}set wireframe(e){this._get("wireframe")!==e&&(this._set("wireframe",e),this.setNeedsRender())}setDirty(e=U.UPDATE){this._patchGroupsDirty=!0,this._context.requestRender(e)}_setSortingDirty(e=U.UPDATE){this._patchSortingDirty=!0,this._context.requestRender(e)}setNeedsRender(e=U.UPDATE){this._context.requestRender(e)}initializeRenderContext(e){this._context=e,this._rctx=e.renderContext.rctx,this._techniqueRepository=e.techniqueRepository,this._tileRenderer=new P(this._rctx,this._tileSize,this._techniqueRepository),this.updateTileBackground(),this._emptyTex=k(this._rctx)}uninitializeRenderContext(){this._emptyTex=i(this._emptyTex),this._tileRenderer=i(this._tileRenderer)}intersect(e,t,r,i){if(!this._rootTiles||e.options.selectOpaqueTerrainOnly&&e.options.selectionMode&&this.transparency!==ne.Opaque)return;const s=ae,n=le;l(s,i,r),h(n,1/s[0],1/s[1],1/s[2]);const o=e.results.min,u=e.results.max,d=e.results.ground,p=e.options.store===z.MIN,f=!!e.results.ground.target,_=X(e.verticalOffset),b=e.tolerance;let y,T=p&&null!=o.dist?o.dist:1/0;const R=h=>{const f=h.renderData;if(!f?.vao)return;const R=f.geometry;m(se,R.boundingBox);const O=f.localOrigin;null!=_&&(_.localOrigin=O,_.applyToAabb(se));const x=se;if(he[0]=r[0]-O[0],he[1]=r[1]-O[1],he[2]=r[2]-O[2],!K(x,he,n,b,T))return;const C=(e,t,r)=>{e.set(this.type,h,t,r,a),T=p&&null!=o.dist?o.dist:1/0},v=(n,a)=>{if(null!=a&&n>=0&&(e.options.backfacesTerrain||c(a,s)<0)&&(e.options.invisibleTerrain||!e.options.selectionMode||null==t||t(r,i,n))){if((null==d.dist||n<d.dist)&&C(d,n,a),e.options.isFiltered)return;e.options.store===z.ALL&&(null==y?(y=B(e.ray),C(y,n,a),e.results.all.push(y)):n<y.dist&&C(y,n,a)),(null==o.dist||n<o.dist)&&C(o,n,a),e.options.store!==z.MIN&&(null==u.dist||n>u.dist)&&C(u,n,a)}},D=ce;l(D,i,O);const P=R.indices,S=R.vertexAttributes,E=S.getField(Y.POSITION,g),q=new F(E.typedBuffer,3,!1,S.stride/4),A=R.indexCount/3;if(!_&&A>w){const e=h.renderData;null==e.intersectionData&&(e.intersectionData=new N(P,0,A,q)),e.intersectionData.intersectRay({r0:he,r1:D},v)}else J(he,D,0,A,P,q,null,_,v)},O=this._rootTiles;if(null!=O){(()=>{const t=this._tileIterator;t.reset(O);const i=e.options.invisibleTerrain;for(let e=t.next();e;e=t.next())!(e.visible||i&&e.intersectsClippingArea)||null==_&&!e.intersectsRay(r,s,b,T)||f&&this._useStencilForTile(e)?t.skipSubtree():R(e)})()}}processScaleRangeQueries(e,t){if(!t.done)for(this._updatePatchGroups();e.updating&&!t.done;){e.prepare();for(const t of this._patchGroups.values())for(const r of t)null!=r.renderData?.textureReference&&e.queriesForTile(r);e.process(),t.madeProgress()}}prepareTechnique(e){if(e.bindParameters.slot===V.OCCLUDED_TERRAIN){if(0==(e.renderOccludedMask&O))return null}else{const t=this.transparency===ne.Opaque?V.OPAQUE_TERRAIN:V.TRANSPARENT_TERRAIN;if(e.bindParameters.slot!==t)return null}switch(e.output){case j.Color:return this.transparency===ne.Empty?null:(this._techniqueConfiguration.hasScreenSpaceReflections=e.bindParameters.ssr.enabled,this._techniqueConfiguration.hasCloudsReflections=null!=e.bindParameters.cloudsFade.data,this._techniqueConfiguration.receiveShadows=e.bindParameters.shadowMap.ready,this._techniqueConfiguration.receiveAmbientOcclusion=e.bindParameters.ssaoHelper.active,this._techniqueConfiguration.overlayMode=this._overlayRenderer.isEmpty?G.Disabled:this._overlayRenderer.hasWater?G.EnabledWithWater:G.Enabled,this._updateTechnique(j.Color,e.bindParameters.slot===V.OCCLUDED_TERRAIN));case j.Shadow:case j.ShadowExcludeHighlight:return this._castShadows&&1===e.bindParameters.lighting.globalFactor?(this._techniqueConfiguration.receiveShadows=this._techniqueConfiguration.receiveAmbientOcclusion=!1,this._updateTechnique(j.Shadow,!1)):null;case j.Depth:return this.transparency===ne.Empty?null:(this._techniqueConfiguration.receiveShadows=this._techniqueConfiguration.receiveAmbientOcclusion=!1,this._updateTechnique(j.Depth,!1));case j.Normal:return this.transparency===ne.Empty?null:(this._techniqueConfiguration.receiveShadows=this._techniqueConfiguration.receiveAmbientOcclusion=!1,this._updateTechnique(j.Normal,!1));case j.ObjectAndLayerIdColor:return this.transparency===ne.Empty?null:this._updateTechnique(j.ObjectAndLayerIdColor,!1);case j.Highlight:return this.transparency!==ne.Empty&&this.needsHighlight?(this._techniqueConfiguration.receiveShadows=this._techniqueConfiguration.receiveAmbientOcclusion=!1,this._updateTechnique(j.Highlight,!1)):null}return null}render(e,t){const r=1===e.bindParameters.lighting.globalFactor;switch(this._updatePatchGroups(),t.useStencil=!1,e.output){case j.Color:{const r=e.bindParameters.slot===V.OCCLUDED_TERRAIN?R.Occluded:R.ColorAndWater;this.transparency===ne.Opaque?this._renderMaterialPass(e,t,r):e.offscreenRenderingHelper.renderToTargets((()=>this._renderMaterialPass(e,t,r)),e.offscreenRenderingHelper.tmpColor,e.offscreenRenderingHelper.mainDepth,[0,0,0,0]);break}case j.Depth:case j.Normal:this._renderAuxiliaryPass(e,t,R.None);break;case j.Highlight:this.needsHighlight&&this._renderAuxiliaryPass(e,t,R.Highlight);break;case j.Shadow:case j.ShadowExcludeHighlight:this._castShadows&&r&&this._renderAuxiliaryPass(e,t,R.None);break;case j.ObjectAndLayerIdColor:this._renderAuxiliaryPass(e,t,R.ObjectAndLayerIdColor)}}_renderMaterialPass(e,t,r){const{rctx:i}=e;this._passParameters.overlaySource=r,i.bindTechnique(t,this._passParameters,e.bindParameters),this._numTilesRendered=0,this._numTilesCulled=0,this._numOriginsRendered=0,this._renderPatchGroups(e,t,r)}_renderAuxiliaryPass(e,t,r){const i=e.rctx;this._passParameters.overlaySource=r,i.bindTechnique(t,this._passParameters,e.bindParameters),this._renderPatchGroupsAuxiliary(e,t,r)}updateTileBackground(e=null){if(null==this._tileRenderer)return;const r=this._tileRenderer;let i=null;if(null!=e){const r=t.toUnitRGBA(e);i=d(r[0]||0,r[1]||0,r[2]||0)}r.setBackground(i),this._allTiles.forAll((e=>r.updateTileTexture(e,y.FADING))),this._techniqueConfiguration.tileBlendInput=r.backgroundIsGrid?L.GridComposite:null!=r.backgroundColor?L.ColorComposite:L.LayerOnly,this.setNeedsRender()}_updatePatchGroups(){if(this._patchGroupsDirty&&(this._highestVisibleLODTile=null,this._rebuildPatchGroups(),this._patchGroupsDirty=!1,this._patchSortingDirty=!0),this._patchSortingDirty&&this.renderOrder!==v.NONE){const e=Array.from(this._patchGroups.values()),t=this._stencilEnabledLayerExtents;for(const r of e)q(this.renderOrder,r,t);e.sort(((e,t)=>A(e[0],t[0],this.renderOrder))),this._patchGroups=new Map(e.map((e=>[e[0].renderData.localOrigin,e]))),this._patchSortingDirty=!1}}_rebuildPatchGroups(){const e=this._rootTiles;if(null!=e){e[0]?.surface.checkAllTilesWaterproofness(),this._patchGroups.clear();for(const t of e)this._rebuildPatchGroupsForRootTile(t)}}_rebuildPatchGroupsForRootTile(e){const t=this._tileIterator;for(t.resetOne(e);!t.done;){const e=t.next(),r=e.renderData;if(!r){this._numTilesCulled++;continue}if(!e.visible){this._numTilesCulled++,t.skipSubtree();continue}const i=r.localOrigin;let s=this._patchGroups.get(i);s||(s=new Array,this._patchGroups.set(i,s)),s.push(e),(!this._highestVisibleLODTile||e.elevationLevel>this._highestVisibleLODTile.elevationLevel)&&(this._highestVisibleLODTile=e),t.skipSubtree()}}_useStencilForTile(e){for(const t of this._stencilEnabledLayerExtents)if(e.intersectsExtent(t))return!0;return!1}_renderPatchGroupsAuxiliary(e,t,r){const i=this._stencilEnabledLayerExtents.length>0;this._patchGroups.forEach((s=>{const n=s[0].renderData.localOrigin;t.program.bindDraw(new Z(n),e.bindParameters,this._passParameters);for(let o=0;o<s.length;o++)this._renderPatch(e,t,s[o],te.TRIANGLES,i,r)})),e.rctx.bindVAO(null)}_renderPatchGroups(e,t,r){const i=e.bindParameters.camera,s=t.program;if(this._techniqueConfiguration.screenSizePerspective&&this.pointsOfInterest){const e=W(this._stage.viewingMode,this._ellipsoidRadius),t=this.pointsOfInterest.centerOnSurfaceFrequent.distance;e.update({distance:t,fovY:i.fovY})}const n=this._stencilEnabledLayerExtents.length>0,o=r===R.Occluded;o&&(s.bindTexture("tex",this._emptyTex),s.setUniform3fv("textureOpacities",u),s.setUniform4fv("texOffsetAndScale",f));const a=null!=this._tileRenderer&&null!=this._tileRenderer.backgroundColor?this._tileRenderer.backgroundColor:u;this._techniqueConfiguration.tileBlendInput===L.ColorComposite&&s.setUniform3fv("backgroundColor",a);const l=this.wireframe?te.LINES:te.TRIANGLES;this._techniqueConfiguration.textureFadingEnabled&&s.bindTexture("texNext",this._emptyTex);const h=this._patchGroups;for(const c of h.values()){const i=c[0].renderData.localOrigin;t.program.bindDraw(new Z(i),e.bindParameters,this._passParameters),this._numOriginsRendered++;for(const a of c){const i=a.renderData,h=i.textureReference;if(null!=h){if(!o){s.setUniform4fv("texOffsetAndScale",h.offsetAndScale),s.bindTexture("tex",h.texture.texture);const e=i.textureFadeFactor,t=e<1?i.nextTextureReference:null;this._techniqueConfiguration.textureFadingEnabled&&null!=t&&e<1?(s.setUniform1f("fadeFactor",e),s.setUniform4fv("nextTexOffsetAndScale",t.offsetAndScale),s.setUniform3fv("nextTexOpacities",t.opacities),s.bindTexture("texNext",t.texture.texture)):s.setUniform1f("fadeFactor",1),i.textureIsFading&&this.setNeedsRender(),s.setUniform3fv("textureOpacities",h.opacities)}this._renderPatch(e,t,a,l,n,r),a.renderOrder=this._numTilesRendered,this._numTilesRendered++}}}e.rctx.bindVAO(null)}_renderPatch(e,t,r,i,s,n){const o=r.renderData,a=o.vao,l=a.indexBuffer;if(null==l)return void(D&&console.error("Rendered tile with no indices: ",r.lij," : ",o));const h=t.program;n===R.None||this._overlayRenderer.isEmpty||this._bindOverlayPatchData(h,o.overlay),s&&(t.useStencil=this._useStencilForTile(r),t.bindPipelineState(e.rctx,e.bindParameters.slot));const c=o.geometry.indexCount;e.rctx.bindVAO(a),h.assertCompatibleVertexAttributeLocations(a),e.rctx.drawElements(i,c,l.indexType,0)}_bindOverlayPatchData(e,t){e.setUniform4fv("overlayTexOffset",t.offsets),e.setUniform4fv("overlayTexScale",t.scales)}_updateTechnique(e,t){return this._techniqueConfiguration.output=e,this._techniqueConfiguration.renderOccluded=t,this._shaderTechnique=this._techniqueRepository.releaseAndAcquire($,this._techniqueConfiguration,this._shaderTechnique),this._shaderTechnique}get test(){return{tileRenderer:this._tileRenderer}}};e([n({constructOnly:!0})],oe.prototype,"_overlayRenderer",void 0),e([n({constructOnly:!0})],oe.prototype,"_stage",void 0),e([n({readOnly:!0})],oe.prototype,"_isGlobal",null),e([n({constructOnly:!0})],oe.prototype,"_allTiles",void 0),e([n({constructOnly:!0})],oe.prototype,"_ellipsoidRadius",void 0),e([n({value:!1})],oe.prototype,"renderingDisabled",null),e([n()],oe.prototype,"renderPatchBorders",null),e([n()],oe.prototype,"visualizeNormals",null),e([n()],oe.prototype,"cullBackFaces",null),e([n({value:v.FRONT_TO_BACK})],oe.prototype,"renderOrder",null),e([n()],oe.prototype,"wireframe",null),oe=e([o("esri.views.3d.terrain.TerrainRenderer")],oe);const ae=p(),le=p(),he=p(),ce=p();export{oe as TerrainRenderer,ne as TransparencyMode};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../Color.js";import r from"../../../core/Accessor.js";import{disposeMaybe as i}from"../../../core/maybe.js";import s from"../../../core/ObjectPool.js";import{property as n}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import{subclass as o}from"../../../core/accessorSupport/decorators/subclass.js";import{I as a}from"../../../chunks/mat4f64.js";import{b as l,s as h,e as c}from"../../../chunks/vec3.js";import{Z as u,f as d,c as p}from"../../../chunks/vec3f64.js";import{Z as f}from"../../../chunks/vec4f64.js";import{create as _,set as m}from"../../../geometry/support/aaBoundingBox.js";import{BufferViewVec3f as g}from"../../../geometry/support/buffer/BufferView.js";import{ViewingMode as b}from"../../ViewingMode.js";import{TextureUpdate as y}from"./interfaces.js";import{LayerClass as T}from"./LayerClass.js";import{OverlaySource as R}from"./Overlay.js";import{overlayRenderOccludedFlag as O}from"./OverlayRenderer.js";import{clearCaches as x}from"./PatchGeometry.js";import{PatchRenderData as C}from"./PatchRenderData.js";import{RenderOrder as v}from"./RenderOrder.js";import{ENABLE_TERRAIN_INTERNAL_CHECKS as D}from"./terrainUtils.js";import{TileRenderer as P}from"./TileRenderer.js";import{TileUpdate as S}from"./TileUpdate.js";import{IteratorPreorder as E,sortTiles as q,compareTiles as A}from"./tileUtils.js";import{componentMinimalSizeForIntersectionData as w,ComponentIntersectionData as N}from"../webgl-engine/collections/Component/ComponentIntersectionData.js";import{ShaderOutput as j}from"../webgl-engine/core/shaderLibrary/ShaderOutput.js";import{OverlayMode as G}from"../webgl-engine/core/shaderLibrary/terrain/Overlay.glsl.js";import{T as I}from"../../../chunks/Terrain.glsl.js";import{TileBlendInput as L}from"../webgl-engine/core/shaderLibrary/terrain/TileBlendInput.js";import{Attribute as F}from"../webgl-engine/lib/Attribute.js";import{RenderRequestType as U}from"../webgl-engine/lib/basicInterfaces.js";import{createEmptyTexture as k}from"../webgl-engine/lib/glUtil3D.js";import{newIntersectorResult as B}from"../webgl-engine/lib/Intersector.js";import{IntersectorType as M,StoreResults as z}from"../webgl-engine/lib/IntersectorInterfaces.js";import{RenderOccludedFlag as H}from"../webgl-engine/lib/Material.js";import{RenderSlot as V}from"../webgl-engine/lib/RenderSlot.js";import{getSettings as W}from"../webgl-engine/lib/screenSizePerspectiveUtils.js";import{VertexAttribute as Y}from"../webgl-engine/lib/VertexAttribute.js";import{TERRAIN_ID as Q,getVerticalOffsetTerrain as X}from"../webgl-engine/lib/verticalOffsetUtils.js";import{DrawParameters as Z}from"../webgl-engine/materials/DrawParameters.js";import{intersectAabbInvDirBefore as K,intersectTriangles as J}from"../webgl-engine/materials/internal/MaterialUtil.js";import{TerrainTechnique as $}from"../webgl-engine/shaders/TerrainTechnique.js";import{TerrainTechniqueConfiguration as ee}from"../webgl-engine/shaders/TerrainTechniqueConfiguration.js";import{PrimitiveType as te}from"../../webgl/enums.js";const re=7,ie=10,se=_();var ne;!function(e){e[e.Opaque=0]="Opaque",e[e.Semitransparent=1]="Semitransparent",e[e.TransparentWithDraped=2]="TransparentWithDraped",e[e.Empty=3]="Empty"}(ne||(ne={}));let oe=class extends r{get _isGlobal(){return this._stage.viewingMode===b.Global}constructor(e){super(e),this.type=M.TERRAIN,this.isGround=!0,this._tileSize=256,this._techniqueConfiguration=new ee,this._passParameters=new I,this._rctx=null,this._renderDataPool=new s(C),this._patchGroups=new Map,this._patchGroupsDirty=!0,this._patchSortingDirty=!0,this._tileIterator=new E,this._highestVisibleLODTile=null,this._visible=!0,this._transparencyState=ne.Opaque,this._castShadows=!0,this._emptyTex=null,this._tileRenderer=null,this._stencilEnabledLayerExtents=new Array,this._numTilesRendered=0,this._numTilesCulled=0,this._numOriginsRendered=0,this.needsHighlight=!1,this.renderOccludedFlags=H.Occlude}initialize(){const e=[V.OPAQUE_TERRAIN,V.TRANSPARENT_TERRAIN,V.OCCLUDED_TERRAIN];this._stage.addRenderPlugin(e,this)}destroy(){this._stage.removeRenderPlugin(this),x()}get canRender(){return this._visible&&!!this._rootTiles&&!this.renderingDisabled}set renderingDisabled(e){this._set("renderingDisabled",!!e),this.setDirty()}set transparency(e){this._transparencyState!==e&&(this._techniqueConfiguration.invisible=e===ne.TransparentWithDraped||e===ne.Empty,this._transparencyState=e,this.setNeedsRender())}get transparency(){return this._transparencyState}get needsLinearDepth(){return this._overlayRenderer.hasWater}get renderPatchBorders(){return!!this._techniqueConfiguration.tileBorders}set renderPatchBorders(e){this._techniqueConfiguration.tileBorders!==e&&(this._techniqueConfiguration.tileBorders=e,this.setNeedsRender(),this.notifyChange("renderPatchBorders"))}get visualizeNormals(){return!!this._techniqueConfiguration.visualizeNormals}set visualizeNormals(e){this._techniqueConfiguration.visualizeNormals!==e&&(this._techniqueConfiguration.visualizeNormals=e,this.setNeedsRender(),this.notifyChange("visualizeNormals"))}get cullBackFaces(){return this._techniqueConfiguration.backfaceCullingEnabled}set cullBackFaces(e){this._techniqueConfiguration.backfaceCullingEnabled!==e&&(this._techniqueConfiguration.backfaceCullingEnabled=e,this.notifyChange("cullBackFaces"),this.setNeedsRender())}set renderOrder(e){this._set("renderOrder",e),this._setSortingDirty()}get layerUid(){return Q}get slicePlaneEnabled(){return this._techniqueConfiguration.hasSlicePlane}set slicePlaneEnabled(e){this._techniqueConfiguration.hasSlicePlane!==e&&(this._techniqueConfiguration.hasSlicePlane=e,this.setNeedsRender())}set textureFadingEnabled(e){this._techniqueConfiguration.textureFadingEnabled!==e&&(this._techniqueConfiguration.textureFadingEnabled=e,this.setNeedsRender())}set pbrMode(e){this._techniqueConfiguration.pbrMode!==e&&(this._techniqueConfiguration.pbrMode=e,this.setNeedsRender())}setDebugScreenSizePerspective(e){this._techniqueConfiguration.screenSizePerspective!==e&&(this._techniqueConfiguration.screenSizePerspective=e,this.setNeedsRender())}setRootTiles(e){this._rootTiles=e,this.setDirty()}setNeedsHighlight(e){this.needsHighlight=e,this.setNeedsRender()}setRenderOccludedOverlay(e){this.renderOccludedFlags=e?O:H.Occlude,this.setNeedsRender()}setStencilEnabledLayerExtents(e){this._stencilEnabledLayerExtents=e,this._setSortingDirty()}setTileSize(e){this._tileSize=e,null!=this._tileRenderer&&(this._tileRenderer.tileSize=e),this.setDirty()}_prepareTileForLoading(e){e.renderData||(e.renderData=this._renderDataPool.acquire(),e.renderData.init(e),e.renderData.localOrigin=this._getLocalOriginOfTile(e))}loadTile(e){this._prepareTileForLoading(e),this.updateTileGeometryState(e),this.updateTileTexture(e,S.TEXTURE_FADING)}updateTileTexture(e,t){null!=this._tileRenderer&&(this._tileRenderer.updateTileTexture(e,t===S.TEXTURE_FADING?y.FADING:y.UNFADED),this.setNeedsRender(),e.resetPendingUpdate(t))}updateTileGeometryState(e){for(const r of e.layerInfo[T.ELEVATION])r.pendingUpdates&=~S.GEOMETRY;e.resetPendingUpdate(S.GEOMETRY);const t=e.renderData.updateGeometryState();return t&&this.setDirty(),t}updateGeometryIfNeeded(e){e.isLoaded&&e.renderData.updateGeometryIfNeeded(this._rctx)}unloadTile(e){const t=e.renderData;t&&(t.releaseGeometry(),this._renderDataPool.release(t),t.clear(),e.renderData=null,e.setMemoryDirty(),this.setDirty())}_getLocalOriginOfTile(e){const t=ie-re,r=Math.max(0,Math.floor((e.level-t)/re)*re);if(this._isGlobal&&0===r)return u;for(;e.parent&&e.level>r;)e=e.parent;return e.centerAtSeaLevel}setVisibility(e){this._visible=e,this.setDirty()}getStats(){return{numTilesRendered:this._numTilesRendered,numTilesCulled:this._numTilesCulled,numOriginsRendered:this._numOriginsRendered}}set wireframe(e){this._get("wireframe")!==e&&(this._set("wireframe",e),this.setNeedsRender())}setDirty(e=U.UPDATE){this._patchGroupsDirty=!0,this._context.requestRender(e)}_setSortingDirty(e=U.UPDATE){this._patchSortingDirty=!0,this._context.requestRender(e)}setNeedsRender(e=U.UPDATE){this._context.requestRender(e)}initializeRenderContext(e){this._context=e,this._rctx=e.renderContext.rctx,this._techniqueRepository=e.techniqueRepository,this._tileRenderer=new P(this._rctx,this._tileSize,this._techniqueRepository),this.updateTileBackground(),this._emptyTex=k(this._rctx)}uninitializeRenderContext(){this._emptyTex=i(this._emptyTex),this._tileRenderer=i(this._tileRenderer)}intersect(e,t,r,i){if(!this._rootTiles||e.options.selectOpaqueTerrainOnly&&e.options.selectionMode&&this.transparency!==ne.Opaque)return;const s=ae,n=le;l(s,i,r),h(n,1/s[0],1/s[1],1/s[2]);const o=e.results.min,u=e.results.max,d=e.results.ground,p=e.options.store===z.MIN,f=!!e.results.ground.target,_=X(e.verticalOffset),b=e.tolerance;let y,T=p&&null!=o.dist?o.dist:1/0;const R=h=>{const f=h.renderData;if(!f?.vao)return;const R=f.geometry;m(se,R.boundingBox);const O=f.localOrigin;null!=_&&(_.localOrigin=O,_.applyToAabb(se));const x=se;if(he[0]=r[0]-O[0],he[1]=r[1]-O[1],he[2]=r[2]-O[2],!K(x,he,n,b,T))return;const C=(e,t,r)=>{e.set(this.type,h,t,r,a),T=p&&null!=o.dist?o.dist:1/0},v=(n,a)=>{if(null!=a&&n>=0&&(e.options.backfacesTerrain||c(a,s)<0)&&(e.options.invisibleTerrain||!e.options.selectionMode||null==t||t(r,i,n))){if((null==d.dist||n<d.dist)&&C(d,n,a),e.options.isFiltered)return;e.options.store===z.ALL&&(null==y?(y=B(e.ray),C(y,n,a),e.results.all.push(y)):n<y.dist&&C(y,n,a)),(null==o.dist||n<o.dist)&&C(o,n,a),e.options.store!==z.MIN&&(null==u.dist||n>u.dist)&&C(u,n,a)}},D=ce;l(D,i,O);const P=R.indices,S=R.vertexAttributes,E=S.getField(Y.POSITION,g),q=new F(E.typedBuffer,3,!1,S.stride/4),A=R.indexCount/3;if(!_&&A>w){const e=h.renderData;null==e.intersectionData&&(e.intersectionData=new N(P,0,A,q)),e.intersectionData.intersectRay({r0:he,r1:D},v)}else J(he,D,0,A,P,q,null,_,v)},O=this._rootTiles;if(null!=O){(()=>{const t=this._tileIterator;t.reset(O);const i=e.options.invisibleTerrain;for(let e=t.next();e;e=t.next())!(e.visible||i&&e.intersectsClippingArea)||null==_&&!e.intersectsRay(r,s,b,T)||f&&this._useStencilForTile(e)?t.skipSubtree():R(e)})()}}processScaleRangeQueries(e,t){if(!t.done)for(this._updatePatchGroups();e.updating&&!t.done;){e.prepare();for(const t of this._patchGroups.values())for(const r of t)null!=r.renderData?.textureReference&&e.queriesForTile(r);e.process(),t.madeProgress()}}prepareTechnique(e){if(e.bindParameters.slot===V.OCCLUDED_TERRAIN){if(0==(e.renderOccludedMask&O))return null}else{const t=this.transparency===ne.Opaque?V.OPAQUE_TERRAIN:V.TRANSPARENT_TERRAIN;if(e.bindParameters.slot!==t)return null}switch(e.output){case j.Color:return this.transparency===ne.Empty?null:(this._techniqueConfiguration.hasScreenSpaceReflections=e.bindParameters.ssr.enabled,this._techniqueConfiguration.hasCloudsReflections=null!=e.bindParameters.cloudsFade.data,this._techniqueConfiguration.receiveShadows=e.bindParameters.shadowMap.ready,this._techniqueConfiguration.receiveAmbientOcclusion=e.bindParameters.ssaoHelper.active,this._techniqueConfiguration.overlayMode=this._overlayRenderer.isEmpty?G.Disabled:this._overlayRenderer.hasWater?G.EnabledWithWater:G.Enabled,this._updateTechnique(j.Color,e.bindParameters.slot===V.OCCLUDED_TERRAIN));case j.Shadow:case j.ShadowExcludeHighlight:return this._castShadows&&1===e.bindParameters.lighting.globalFactor?(this._techniqueConfiguration.receiveShadows=this._techniqueConfiguration.receiveAmbientOcclusion=!1,this._updateTechnique(j.Shadow,!1)):null;case j.Depth:return this.transparency===ne.Empty?null:(this._techniqueConfiguration.receiveShadows=this._techniqueConfiguration.receiveAmbientOcclusion=!1,this._updateTechnique(j.Depth,!1));case j.Normal:return this.transparency===ne.Empty?null:(this._techniqueConfiguration.receiveShadows=this._techniqueConfiguration.receiveAmbientOcclusion=!1,this._updateTechnique(j.Normal,!1));case j.ObjectAndLayerIdColor:return this.transparency===ne.Empty?null:this._updateTechnique(j.ObjectAndLayerIdColor,!1);case j.Highlight:return this.transparency!==ne.Empty&&this.needsHighlight?(this._techniqueConfiguration.receiveShadows=this._techniqueConfiguration.receiveAmbientOcclusion=!1,this._updateTechnique(j.Highlight,!1)):null}return null}render(e,t){const r=1===e.bindParameters.lighting.globalFactor;switch(this._updatePatchGroups(),t.useStencil=!1,e.output){case j.Color:{const r=e.bindParameters.slot===V.OCCLUDED_TERRAIN?R.Occluded:R.ColorAndWater;this.transparency===ne.Opaque?this._renderMaterialPass(e,t,r):e.offscreenRenderingHelper.renderToTargets((()=>this._renderMaterialPass(e,t,r)),e.offscreenRenderingHelper.tmpColor,e.offscreenRenderingHelper.mainDepth,[0,0,0,0]);break}case j.Depth:case j.Normal:this._renderAuxiliaryPass(e,t,R.ColorAndWater);break;case j.Highlight:this.needsHighlight&&this._renderAuxiliaryPass(e,t,R.Highlight);break;case j.Shadow:case j.ShadowExcludeHighlight:this._castShadows&&r&&this._renderAuxiliaryPass(e,t,R.None);break;case j.ObjectAndLayerIdColor:this._renderAuxiliaryPass(e,t,R.ObjectAndLayerIdColor)}}_renderMaterialPass(e,t,r){const{rctx:i}=e;this._passParameters.overlaySource=r,i.bindTechnique(t,this._passParameters,e.bindParameters),this._numTilesRendered=0,this._numTilesCulled=0,this._numOriginsRendered=0,this._renderPatchGroups(e,t,r)}_renderAuxiliaryPass(e,t,r){const i=e.rctx;this._passParameters.overlaySource=r,i.bindTechnique(t,this._passParameters,e.bindParameters),this._renderPatchGroupsAuxiliary(e,t,r)}updateTileBackground(e=null){if(null==this._tileRenderer)return;const r=this._tileRenderer;let i=null;if(null!=e){const r=t.toUnitRGBA(e);i=d(r[0]||0,r[1]||0,r[2]||0)}r.setBackground(i),this._allTiles.forAll((e=>r.updateTileTexture(e,y.FADING))),this._techniqueConfiguration.tileBlendInput=r.backgroundIsGrid?L.GridComposite:null!=r.backgroundColor?L.ColorComposite:L.LayerOnly,this.setNeedsRender()}_updatePatchGroups(){if(this._patchGroupsDirty&&(this._highestVisibleLODTile=null,this._rebuildPatchGroups(),this._patchGroupsDirty=!1,this._patchSortingDirty=!0),this._patchSortingDirty&&this.renderOrder!==v.NONE){const e=Array.from(this._patchGroups.values()),t=this._stencilEnabledLayerExtents;for(const r of e)q(this.renderOrder,r,t);e.sort(((e,t)=>A(e[0],t[0],this.renderOrder))),this._patchGroups=new Map(e.map((e=>[e[0].renderData.localOrigin,e]))),this._patchSortingDirty=!1}}_rebuildPatchGroups(){const e=this._rootTiles;if(null!=e){e[0]?.surface.checkAllTilesWaterproofness(),this._patchGroups.clear();for(const t of e)this._rebuildPatchGroupsForRootTile(t)}}_rebuildPatchGroupsForRootTile(e){const t=this._tileIterator;for(t.resetOne(e);!t.done;){const e=t.next(),r=e.renderData;if(!r){this._numTilesCulled++;continue}if(!e.visible){this._numTilesCulled++,t.skipSubtree();continue}const i=r.localOrigin;let s=this._patchGroups.get(i);s||(s=new Array,this._patchGroups.set(i,s)),s.push(e),(!this._highestVisibleLODTile||e.elevationLevel>this._highestVisibleLODTile.elevationLevel)&&(this._highestVisibleLODTile=e),t.skipSubtree()}}_useStencilForTile(e){for(const t of this._stencilEnabledLayerExtents)if(e.intersectsExtent(t))return!0;return!1}_renderPatchGroupsAuxiliary(e,t,r){const i=this._stencilEnabledLayerExtents.length>0;this._patchGroups.forEach((s=>{const n=s[0].renderData.localOrigin;t.program.bindDraw(new Z(n),e.bindParameters,this._passParameters);for(let o=0;o<s.length;o++)this._renderPatch(e,t,s[o],te.TRIANGLES,i,r)})),e.rctx.bindVAO(null)}_renderPatchGroups(e,t,r){const i=e.bindParameters.camera,s=t.program;if(this._techniqueConfiguration.screenSizePerspective&&this.pointsOfInterest){const e=W(this._stage.viewingMode,this._ellipsoidRadius),t=this.pointsOfInterest.centerOnSurfaceFrequent.distance;e.update({distance:t,fovY:i.fovY})}const n=this._stencilEnabledLayerExtents.length>0,o=r===R.Occluded;o&&(s.bindTexture("tex",this._emptyTex),s.setUniform3fv("textureOpacities",u),s.setUniform4fv("texOffsetAndScale",f));const a=null!=this._tileRenderer&&null!=this._tileRenderer.backgroundColor?this._tileRenderer.backgroundColor:u;this._techniqueConfiguration.tileBlendInput===L.ColorComposite&&s.setUniform3fv("backgroundColor",a);const l=this.wireframe?te.LINES:te.TRIANGLES;this._techniqueConfiguration.textureFadingEnabled&&s.bindTexture("texNext",this._emptyTex);const h=this._patchGroups;for(const c of h.values()){const i=c[0].renderData.localOrigin;t.program.bindDraw(new Z(i),e.bindParameters,this._passParameters),this._numOriginsRendered++;for(const a of c){const i=a.renderData,h=i.textureReference;if(null!=h){if(!o){s.setUniform4fv("texOffsetAndScale",h.offsetAndScale),s.bindTexture("tex",h.texture.texture);const e=i.textureFadeFactor,t=e<1?i.nextTextureReference:null;this._techniqueConfiguration.textureFadingEnabled&&null!=t&&e<1?(s.setUniform1f("fadeFactor",e),s.setUniform4fv("nextTexOffsetAndScale",t.offsetAndScale),s.setUniform3fv("nextTexOpacities",t.opacities),s.bindTexture("texNext",t.texture.texture)):s.setUniform1f("fadeFactor",1),i.textureIsFading&&this.setNeedsRender(),s.setUniform3fv("textureOpacities",h.opacities)}this._renderPatch(e,t,a,l,n,r),a.renderOrder=this._numTilesRendered,this._numTilesRendered++}}}e.rctx.bindVAO(null)}_renderPatch(e,t,r,i,s,n){const o=r.renderData,a=o.vao,l=a.indexBuffer;if(null==l)return void(D&&console.error("Rendered tile with no indices: ",r.lij," : ",o));const h=t.program;n===R.None||this._overlayRenderer.isEmpty||this._bindOverlayPatchData(h,o.overlay),s&&(t.useStencil=this._useStencilForTile(r),t.bindPipelineState(e.rctx,e.bindParameters.slot));const c=o.geometry.indexCount;e.rctx.bindVAO(a),h.assertCompatibleVertexAttributeLocations(a),e.rctx.drawElements(i,c,l.indexType,0)}_bindOverlayPatchData(e,t){e.setUniform4fv("overlayTexOffset",t.offsets),e.setUniform4fv("overlayTexScale",t.scales)}_updateTechnique(e,t){return this._techniqueConfiguration.output=e,this._techniqueConfiguration.renderOccluded=t,this._shaderTechnique=this._techniqueRepository.releaseAndAcquire($,this._techniqueConfiguration,this._shaderTechnique),this._shaderTechnique}get test(){return{tileRenderer:this._tileRenderer}}};e([n({constructOnly:!0})],oe.prototype,"_overlayRenderer",void 0),e([n({constructOnly:!0})],oe.prototype,"_stage",void 0),e([n({readOnly:!0})],oe.prototype,"_isGlobal",null),e([n({constructOnly:!0})],oe.prototype,"_allTiles",void 0),e([n({constructOnly:!0})],oe.prototype,"_ellipsoidRadius",void 0),e([n({value:!1})],oe.prototype,"renderingDisabled",null),e([n()],oe.prototype,"renderPatchBorders",null),e([n()],oe.prototype,"visualizeNormals",null),e([n()],oe.prototype,"cullBackFaces",null),e([n({value:v.FRONT_TO_BACK})],oe.prototype,"renderOrder",null),e([n()],oe.prototype,"wireframe",null),oe=e([o("esri.views.3d.terrain.TerrainRenderer")],oe);const ae=p(),le=p(),he=p(),ce=p();export{oe as TerrainRenderer,ne as TransparencyMode};