@arcgis/core 4.23.0-next.20220105 → 4.23.0-next.20220123

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 (632) hide show
  1. package/assets/components/assets/calcite-date-picker/nls/bg.json +31 -0
  2. package/assets/components/assets/calcite-icon/centerAlign16.json +1 -0
  3. package/assets/components/assets/calcite-icon/centerAlign24.json +1 -0
  4. package/assets/components/assets/calcite-icon/centerAlign32.json +1 -0
  5. package/assets/components/assets/calcite-icon/checkSquareF16.json +1 -0
  6. package/assets/components/assets/calcite-icon/checkSquareF24.json +1 -0
  7. package/assets/components/assets/calcite-icon/checkSquareF32.json +1 -0
  8. package/assets/components/assets/calcite-icon/convert16.json +1 -0
  9. package/assets/components/assets/calcite-icon/convert24.json +1 -0
  10. package/assets/components/assets/calcite-icon/convert32.json +1 -0
  11. package/assets/components/assets/calcite-icon/explore16.json +1 -0
  12. package/assets/components/assets/calcite-icon/explore24.json +1 -0
  13. package/assets/components/assets/calcite-icon/explore32.json +1 -0
  14. package/assets/components/assets/calcite-icon/formDropdown16.json +1 -0
  15. package/assets/components/assets/calcite-icon/formDropdown24.json +1 -0
  16. package/assets/components/assets/calcite-icon/formDropdown32.json +1 -0
  17. package/assets/components/assets/calcite-icon/language16.json +1 -0
  18. package/assets/components/assets/calcite-icon/language24.json +1 -0
  19. package/assets/components/assets/calcite-icon/language32.json +1 -0
  20. package/assets/components/assets/calcite-icon/languageTranslate16.json +1 -0
  21. package/assets/components/assets/calcite-icon/languageTranslate24.json +1 -0
  22. package/assets/components/assets/calcite-icon/languageTranslate32.json +1 -0
  23. package/assets/components/assets/calcite-icon/leftAlign16.json +1 -0
  24. package/assets/components/assets/calcite-icon/leftAlign24.json +1 -0
  25. package/assets/components/assets/calcite-icon/leftAlign32.json +1 -0
  26. package/assets/components/assets/calcite-icon/lineSolid4.json +1 -0
  27. package/assets/components/assets/calcite-icon/partlyCloudy16.json +1 -0
  28. package/assets/components/assets/calcite-icon/partlyCloudy24.json +1 -0
  29. package/assets/components/assets/calcite-icon/partlyCloudy32.json +1 -0
  30. package/assets/components/assets/calcite-icon/rightAlign16.json +1 -0
  31. package/assets/components/assets/calcite-icon/rightAlign24.json +1 -0
  32. package/assets/components/assets/calcite-icon/rightAlign32.json +1 -0
  33. package/assets/components/assets/calcite-icon/screenshotMode16.json +1 -0
  34. package/assets/components/assets/calcite-icon/screenshotMode24.json +1 -0
  35. package/assets/components/assets/calcite-icon/screenshotMode32.json +1 -0
  36. package/assets/components/assets/calcite-icon/squareF16.json +1 -0
  37. package/assets/components/assets/calcite-icon/squareF24.json +1 -0
  38. package/assets/components/assets/calcite-icon/squareF32.json +1 -0
  39. package/assets/components/assets/calcite-icon/terminal16.json +1 -0
  40. package/assets/components/assets/calcite-icon/terminal24.json +1 -0
  41. package/assets/components/assets/calcite-icon/terminal32.json +1 -0
  42. package/assets/components/assets/calcite-icon/touch16.json +1 -0
  43. package/assets/components/assets/calcite-icon/touch24.json +1 -0
  44. package/assets/components/assets/calcite-icon/touch32.json +1 -0
  45. package/assets/components/assets/calcite-icon/xHexagon16.json +1 -0
  46. package/assets/components/assets/calcite-icon/xHexagon24.json +1 -0
  47. package/assets/components/assets/calcite-icon/xHexagon32.json +1 -0
  48. package/assets/components/assets/calcite-icon/xHexagonF16.json +1 -0
  49. package/assets/components/assets/calcite-icon/xHexagonF24.json +1 -0
  50. package/assets/components/assets/calcite-icon/xHexagonF32.json +1 -0
  51. package/assets/components/assets/calcite-icon/xOctagonF16.json +1 -0
  52. package/assets/components/assets/calcite-icon/xOctagonF24.json +1 -0
  53. package/assets/components/assets/calcite-icon/xOctagonF32.json +1 -0
  54. package/assets/esri/core/workers/RemoteClient.js +1 -1
  55. package/assets/esri/core/workers/chunks/09da224052976e290828.js +1 -0
  56. package/assets/esri/core/workers/chunks/0bf079e752ab79468478.js +1 -0
  57. package/assets/esri/core/workers/chunks/{ce5ca5e95b2378ec55b9.js → 1305ef8717da6e902a55.js} +1 -1
  58. package/assets/esri/core/workers/chunks/199670a3a564ebe3bd79.js +1 -0
  59. package/assets/esri/core/workers/chunks/1e4d37c2b9dc83d20a11.js +1 -0
  60. package/assets/esri/core/workers/chunks/20411bb8e04703962ce6.js +1 -0
  61. package/assets/esri/core/workers/chunks/2416f8bf8bbd2ec786ab.js +1 -0
  62. package/assets/esri/core/workers/chunks/25a3e9bc0b4c7e0d3165.js +1 -0
  63. package/assets/esri/core/workers/chunks/{99f0d896c17dd09cd285.js → 2629adf79e7fd9f25f07.js} +1 -1
  64. package/assets/esri/core/workers/chunks/{9c417740bf3707a0d465.js → 2c607d30ff8ca1b61286.js} +1 -1
  65. package/assets/esri/core/workers/chunks/2e445a8735ea2adb641a.js +1 -0
  66. package/assets/esri/core/workers/chunks/37a7bd30352b1309b8f8.js +1 -0
  67. package/assets/esri/core/workers/chunks/390d9021169e65c10eb8.js +1 -0
  68. package/assets/esri/core/workers/chunks/{3d5169ea9810d10caf0d.js → 3a9740dccda6a733313c.js} +1 -1
  69. package/assets/esri/core/workers/chunks/{8a250ec51097f16feb66.js → 40a1e713f63ec77110c0.js} +1 -1
  70. package/assets/esri/core/workers/chunks/43cdff2418325e163420.js +1 -0
  71. package/assets/esri/core/workers/chunks/4c9084a04948b6924749.js +1 -0
  72. package/assets/esri/core/workers/chunks/{35961690afe9ea1f91b0.js → 5383a8f3e4ec1a8a4fcd.js} +1 -1
  73. package/assets/esri/core/workers/chunks/{4beba242e7540ee3182b.js → 5538639a49c7cc2eca63.js} +1 -1
  74. package/assets/esri/core/workers/chunks/57c67e260267a1dbc5e3.js +1 -0
  75. package/assets/esri/core/workers/chunks/5a4a5585ec8027079f32.js +1 -0
  76. package/assets/esri/core/workers/chunks/5ac4c1d54b94c7d87835.js +1 -0
  77. package/assets/esri/core/workers/chunks/60371c0f750cde87656d.js +1 -0
  78. package/assets/esri/core/workers/chunks/{ba6fdaed6c315dc13981.js → 625d2663daa8e0cf64b0.js} +1 -1
  79. package/assets/esri/core/workers/chunks/{3a2b2dc3e938d53faa30.js → 64276aacaafa4c8a15bd.js} +1 -1
  80. package/assets/esri/core/workers/chunks/{75466e0c8c8da499b150.js → 662d13f68cf3ec92439b.js} +1 -1
  81. package/assets/esri/core/workers/chunks/663ad15b86936eb06b69.js +1 -0
  82. package/assets/esri/core/workers/chunks/67162b3e2cc1b5dc6818.js +1 -0
  83. package/assets/esri/core/workers/chunks/68a59ce98177d8513337.js +1 -0
  84. package/assets/esri/core/workers/chunks/6cdfe175c965918b741b.js +1 -0
  85. package/assets/esri/core/workers/chunks/739e579150bf466d43ae.js +1 -0
  86. package/assets/esri/core/workers/chunks/74df1f3e1e2e524a89d2.js +1 -0
  87. package/assets/esri/core/workers/chunks/76eef4799f6c5fff7e2d.js +1 -0
  88. package/assets/esri/core/workers/chunks/{ea05f870dda27bca4fe8.js → 7a8764ae8a0041e1151d.js} +2 -2
  89. package/assets/esri/core/workers/chunks/{ea05f870dda27bca4fe8.js.LICENSE.txt → 7a8764ae8a0041e1151d.js.LICENSE.txt} +1 -1
  90. package/assets/esri/core/workers/chunks/7baf6b1f3f050aa67ae4.js +1 -0
  91. package/assets/esri/core/workers/chunks/{f52b6d5037e4205b035c.js → 7bc5cc5dbf1b7b70ddac.js} +1 -1
  92. package/assets/esri/core/workers/chunks/85e27fd949475f9a6bbc.js +1 -0
  93. package/assets/esri/core/workers/chunks/8967288145f8fbd20e7d.js +1 -0
  94. package/assets/esri/core/workers/chunks/8cbb04a9065aa3756638.js +1 -0
  95. package/assets/esri/core/workers/chunks/8fa0a14165d43ffe87a5.js +1 -0
  96. package/assets/esri/core/workers/chunks/94b8dbf859df71858d1c.js +1 -0
  97. package/assets/esri/core/workers/chunks/96ab518eb6ba11333dee.js +1 -0
  98. package/assets/esri/core/workers/chunks/99a777693e4539f0b03b.js +1 -0
  99. package/assets/esri/core/workers/chunks/9cb2ae42a8e328b1d98d.js +1 -0
  100. package/assets/esri/core/workers/chunks/9d3c58a0ef634d95b7bd.js +1 -0
  101. package/assets/esri/core/workers/chunks/9d77467aa71d345fc1b6.js +1 -0
  102. package/assets/esri/core/workers/chunks/9f8b7b6b4e95f9a794fc.js +1 -0
  103. package/assets/esri/core/workers/chunks/a78757b9c7e8cbea08fa.js +1 -0
  104. package/assets/esri/core/workers/chunks/{9b7c51ff3d2b42aa62f5.js → a7b1b75643ed31489495.js} +1 -1
  105. package/assets/esri/core/workers/chunks/a8b13fb804bb775e4967.js +1 -0
  106. package/assets/esri/core/workers/chunks/a8c13529367c037cdd94.js +1 -0
  107. package/assets/esri/core/workers/chunks/a96afc176041f698c7a1.js +1 -0
  108. package/assets/esri/core/workers/chunks/aa861b8eae6c85f3dad4.js +1 -0
  109. package/assets/esri/core/workers/chunks/ac8dca61ade28c542ae2.js +1 -0
  110. package/assets/esri/core/workers/chunks/ad081d8e49e7f90c3c26.js +1 -0
  111. package/assets/esri/core/workers/chunks/afa6912454f2a5ffadce.js +1 -0
  112. package/assets/esri/core/workers/chunks/b0b036ad3ad3cd956747.js +1 -0
  113. package/assets/esri/core/workers/chunks/{2a39d520b192b8e552b5.js → b2ae5fc4f787ea568b88.js} +1 -1
  114. package/assets/esri/core/workers/chunks/b2beb6e1fd2ee6503830.js +1 -0
  115. package/assets/esri/core/workers/chunks/{b87bc1481a49b38109f4.js → b9c177524b3e7de1ffd1.js} +1 -1
  116. package/assets/esri/core/workers/chunks/ba615f118a3a8970ef25.js +1 -0
  117. package/assets/esri/core/workers/chunks/{7c1b9ae141112a63b446.js → ba6654a885be4b7a43f0.js} +1 -1
  118. package/assets/esri/core/workers/chunks/bab1cfd0a901181622af.js +1 -0
  119. package/assets/esri/core/workers/chunks/be2b7cce79fd41627931.js +1 -0
  120. package/assets/esri/core/workers/chunks/bf6dda4a2af14c4b7716.js +1 -0
  121. package/assets/esri/core/workers/chunks/{ed0297fc61014e848c18.js → c080114a69fa95b88d22.js} +1 -1
  122. package/assets/esri/core/workers/chunks/c13dfdd548dcb1bdb294.js +1 -0
  123. package/assets/esri/core/workers/chunks/c36f84daa7736878418d.js +1 -0
  124. package/assets/esri/core/workers/chunks/c6f94b92e866b881d9b9.js +1 -0
  125. package/assets/esri/core/workers/chunks/{573dc3064e84ca86844d.js → c959e0d1cf7dce0421b9.js} +1 -1
  126. package/assets/esri/core/workers/chunks/{1fd48459afb58a6cf14f.js → ca2f5faa01d99c21ec14.js} +1 -1
  127. package/assets/esri/core/workers/chunks/cbb291412fd1a5261aa9.js +1 -0
  128. package/assets/esri/core/workers/chunks/{7aa543a97f055cddea99.js → cc146c57bbdac8029fd8.js} +1 -1
  129. package/assets/esri/core/workers/chunks/cd7d83d127e085d52584.js +1 -0
  130. package/assets/esri/core/workers/chunks/cef4af64860ebbfc1c47.js +1 -0
  131. package/assets/esri/core/workers/chunks/d1454155ee1b8a421cbb.js +1 -0
  132. package/assets/esri/core/workers/chunks/{0cd583c3233573cb8468.js → d24c4fbc567486b1188f.js} +1 -1
  133. package/assets/esri/core/workers/chunks/d52108864136c5a8a618.js +1 -0
  134. package/assets/esri/core/workers/chunks/d72488db62fcf39447b6.js +1 -0
  135. package/assets/esri/core/workers/chunks/de03439ca2c9782bf325.js +1 -0
  136. package/assets/esri/core/workers/chunks/de6cff7b6cbbf99b20d1.js +981 -0
  137. package/assets/esri/core/workers/chunks/e079cb1d53aca15b7df2.js +1 -0
  138. package/assets/esri/core/workers/chunks/e59764ee8cf25d4f74e2.js +1 -0
  139. package/assets/esri/core/workers/chunks/e6df9839b551569fbc62.js +1 -0
  140. package/assets/esri/core/workers/chunks/e97e986120aaadad7d4c.js +1 -0
  141. package/assets/esri/core/workers/chunks/{2f66fcb8670b108af549.js → ed0bcc66fb1e0ee75a4b.js} +1 -1
  142. package/assets/esri/core/workers/chunks/f8e7755240a94b499e1f.js +1 -0
  143. package/assets/esri/libs/vxl/vxlLayer.wasm +0 -0
  144. package/assets/esri/themes/base/icons/fonts/CalciteWebCoreIcons.svg +1 -0
  145. package/assets/esri/themes/base/icons/fonts/CalciteWebCoreIcons.ttf +0 -0
  146. package/assets/esri/themes/base/icons/fonts/CalciteWebCoreIcons.woff +0 -0
  147. package/assets/esri/themes/base/icons/selection.json +1 -1
  148. package/assets/esri/themes/base/icons/style.css +4 -0
  149. package/assets/esri/themes/base/icons/style.scss +6 -0
  150. package/assets/esri/themes/base/icons/variables.scss +1 -0
  151. package/assets/esri/themes/base/widgets/_Weather.scss +1 -1
  152. package/assets/esri/themes/dark/main.css +1 -1
  153. package/assets/esri/themes/dark-blue/main.css +1 -1
  154. package/assets/esri/themes/dark-green/main.css +1 -1
  155. package/assets/esri/themes/dark-purple/main.css +1 -1
  156. package/assets/esri/themes/dark-red/main.css +1 -1
  157. package/assets/esri/themes/light/main.css +1 -1
  158. package/assets/esri/themes/light/view.css +1 -1
  159. package/assets/esri/themes/light-blue/main.css +1 -1
  160. package/assets/esri/themes/light-green/main.css +1 -1
  161. package/assets/esri/themes/light-purple/main.css +1 -1
  162. package/assets/esri/themes/light-red/main.css +1 -1
  163. package/assets/esri/widgets/Editor/t9n/Editor_ar.json +1 -1
  164. package/assets/esri/widgets/Editor/t9n/Editor_bg.json +1 -1
  165. package/assets/esri/widgets/Editor/t9n/Editor_bs.json +1 -1
  166. package/assets/esri/widgets/Editor/t9n/Editor_ca.json +1 -1
  167. package/assets/esri/widgets/Editor/t9n/Editor_cs.json +1 -1
  168. package/assets/esri/widgets/Editor/t9n/Editor_da.json +1 -1
  169. package/assets/esri/widgets/Editor/t9n/Editor_de.json +1 -1
  170. package/assets/esri/widgets/Editor/t9n/Editor_el.json +1 -1
  171. package/assets/esri/widgets/Editor/t9n/Editor_es.json +1 -1
  172. package/assets/esri/widgets/Editor/t9n/Editor_et.json +1 -1
  173. package/assets/esri/widgets/Editor/t9n/Editor_fi.json +1 -1
  174. package/assets/esri/widgets/Editor/t9n/Editor_fr.json +1 -1
  175. package/assets/esri/widgets/Editor/t9n/Editor_he.json +1 -1
  176. package/assets/esri/widgets/Editor/t9n/Editor_hr.json +1 -1
  177. package/assets/esri/widgets/Editor/t9n/Editor_hu.json +1 -1
  178. package/assets/esri/widgets/Editor/t9n/Editor_id.json +1 -1
  179. package/assets/esri/widgets/Editor/t9n/Editor_it.json +1 -1
  180. package/assets/esri/widgets/Editor/t9n/Editor_ja.json +1 -1
  181. package/assets/esri/widgets/Editor/t9n/Editor_ko.json +1 -1
  182. package/assets/esri/widgets/Editor/t9n/Editor_lt.json +1 -1
  183. package/assets/esri/widgets/Editor/t9n/Editor_lv.json +1 -1
  184. package/assets/esri/widgets/Editor/t9n/Editor_nb.json +1 -1
  185. package/assets/esri/widgets/Editor/t9n/Editor_nl.json +1 -1
  186. package/assets/esri/widgets/Editor/t9n/Editor_pl.json +1 -1
  187. package/assets/esri/widgets/Editor/t9n/Editor_pt-BR.json +1 -1
  188. package/assets/esri/widgets/Editor/t9n/Editor_pt-PT.json +1 -1
  189. package/assets/esri/widgets/Editor/t9n/Editor_ro.json +1 -1
  190. package/assets/esri/widgets/Editor/t9n/Editor_ru.json +1 -1
  191. package/assets/esri/widgets/Editor/t9n/Editor_sk.json +1 -1
  192. package/assets/esri/widgets/Editor/t9n/Editor_sl.json +1 -1
  193. package/assets/esri/widgets/Editor/t9n/Editor_sr.json +1 -1
  194. package/assets/esri/widgets/Editor/t9n/Editor_sv.json +1 -1
  195. package/assets/esri/widgets/Editor/t9n/Editor_th.json +1 -1
  196. package/assets/esri/widgets/Editor/t9n/Editor_tr.json +1 -1
  197. package/assets/esri/widgets/Editor/t9n/Editor_uk.json +1 -1
  198. package/assets/esri/widgets/Editor/t9n/Editor_vi.json +1 -1
  199. package/assets/esri/widgets/Editor/t9n/Editor_zh-CN.json +1 -1
  200. package/assets/esri/widgets/Editor/t9n/Editor_zh-HK.json +1 -1
  201. package/assets/esri/widgets/Editor/t9n/Editor_zh-TW.json +1 -1
  202. package/assets/esri/widgets/ElevationProfile/t9n/ElevationProfile_ja.json +1 -1
  203. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_ar.json +1 -1
  204. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_bg.json +1 -1
  205. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_bs.json +1 -1
  206. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_ca.json +1 -1
  207. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_cs.json +1 -1
  208. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_da.json +1 -1
  209. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_de.json +1 -1
  210. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_el.json +1 -1
  211. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_es.json +1 -1
  212. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_et.json +1 -1
  213. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_fi.json +1 -1
  214. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_fr.json +1 -1
  215. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_he.json +1 -1
  216. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_hr.json +1 -1
  217. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_hu.json +1 -1
  218. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_id.json +1 -1
  219. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_it.json +1 -1
  220. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_ja.json +1 -1
  221. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_ko.json +1 -1
  222. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_lt.json +1 -1
  223. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_lv.json +1 -1
  224. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_nb.json +1 -1
  225. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_nl.json +1 -1
  226. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_pl.json +1 -1
  227. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_pt-BR.json +1 -1
  228. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_pt-PT.json +1 -1
  229. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_ro.json +1 -1
  230. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_ru.json +1 -1
  231. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_sk.json +1 -1
  232. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_sl.json +1 -1
  233. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_sr.json +1 -1
  234. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_sv.json +1 -1
  235. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_th.json +1 -1
  236. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_tr.json +1 -1
  237. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_uk.json +1 -1
  238. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_vi.json +1 -1
  239. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_zh-CN.json +1 -1
  240. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_zh-HK.json +1 -1
  241. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_zh-TW.json +1 -1
  242. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_cs.json +1 -1
  243. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_el.json +1 -1
  244. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_fr.json +1 -1
  245. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_lv.json +1 -1
  246. package/assets/esri/widgets/Weather/t9n/Weather_ar.json +1 -1
  247. package/assets/esri/widgets/Weather/t9n/Weather_bg.json +1 -1
  248. package/assets/esri/widgets/Weather/t9n/Weather_bs.json +1 -1
  249. package/assets/esri/widgets/Weather/t9n/Weather_ca.json +1 -1
  250. package/assets/esri/widgets/Weather/t9n/Weather_cs.json +1 -1
  251. package/assets/esri/widgets/Weather/t9n/Weather_da.json +1 -1
  252. package/assets/esri/widgets/Weather/t9n/Weather_de.json +1 -1
  253. package/assets/esri/widgets/Weather/t9n/Weather_el.json +1 -1
  254. package/assets/esri/widgets/Weather/t9n/Weather_es.json +1 -1
  255. package/assets/esri/widgets/Weather/t9n/Weather_et.json +1 -1
  256. package/assets/esri/widgets/Weather/t9n/Weather_fi.json +1 -1
  257. package/assets/esri/widgets/Weather/t9n/Weather_fr.json +1 -1
  258. package/assets/esri/widgets/Weather/t9n/Weather_he.json +1 -1
  259. package/assets/esri/widgets/Weather/t9n/Weather_hr.json +1 -1
  260. package/assets/esri/widgets/Weather/t9n/Weather_hu.json +1 -1
  261. package/assets/esri/widgets/Weather/t9n/Weather_id.json +1 -1
  262. package/assets/esri/widgets/Weather/t9n/Weather_it.json +1 -1
  263. package/assets/esri/widgets/Weather/t9n/Weather_ja.json +1 -1
  264. package/assets/esri/widgets/Weather/t9n/Weather_ko.json +1 -1
  265. package/assets/esri/widgets/Weather/t9n/Weather_lt.json +1 -1
  266. package/assets/esri/widgets/Weather/t9n/Weather_lv.json +1 -1
  267. package/assets/esri/widgets/Weather/t9n/Weather_nb.json +1 -1
  268. package/assets/esri/widgets/Weather/t9n/Weather_nl.json +1 -1
  269. package/assets/esri/widgets/Weather/t9n/Weather_pl.json +1 -1
  270. package/assets/esri/widgets/Weather/t9n/Weather_pt-BR.json +1 -1
  271. package/assets/esri/widgets/Weather/t9n/Weather_pt-PT.json +1 -1
  272. package/assets/esri/widgets/Weather/t9n/Weather_ro.json +1 -1
  273. package/assets/esri/widgets/Weather/t9n/Weather_ru.json +1 -1
  274. package/assets/esri/widgets/Weather/t9n/Weather_sk.json +1 -1
  275. package/assets/esri/widgets/Weather/t9n/Weather_sl.json +1 -1
  276. package/assets/esri/widgets/Weather/t9n/Weather_sr.json +1 -1
  277. package/assets/esri/widgets/Weather/t9n/Weather_sv.json +1 -1
  278. package/assets/esri/widgets/Weather/t9n/Weather_th.json +1 -1
  279. package/assets/esri/widgets/Weather/t9n/Weather_tr.json +1 -1
  280. package/assets/esri/widgets/Weather/t9n/Weather_uk.json +1 -1
  281. package/assets/esri/widgets/Weather/t9n/Weather_vi.json +1 -1
  282. package/assets/esri/widgets/Weather/t9n/Weather_zh-CN.json +1 -1
  283. package/assets/esri/widgets/Weather/t9n/Weather_zh-HK.json +1 -1
  284. package/assets/esri/widgets/Weather/t9n/Weather_zh-TW.json +1 -1
  285. package/chunks/Clouds.glsl.js +14 -14
  286. package/chunks/CloudsComposition.glsl.js +4 -4
  287. package/chunks/DefaultMaterial.glsl.js +2 -2
  288. package/chunks/HUDMaterial.glsl.js +22 -21
  289. package/chunks/RibbonLine.glsl.js +10 -14
  290. package/chunks/persistableUrlUtils.js +1 -1
  291. package/chunks/vec32.js +1 -1
  292. package/chunks/vec42.js +1 -1
  293. package/chunks/vxlLayer.js +1 -1
  294. package/core/has.js +1 -1
  295. package/core/urlUtils.js +1 -1
  296. package/core/workers/workerFactory.js +1 -1
  297. package/form/elements/FieldElement.js +1 -1
  298. package/geometry/support/buffer/math/common.js +1 -1
  299. package/geometry/support/heightModelInfoUtils.js +1 -1
  300. package/interfaces.d.ts +372 -126
  301. package/layers/FeatureLayer.js +1 -1
  302. package/layers/RouteLayer.js +1 -1
  303. package/layers/SubtypeGroupLayer.js +1 -1
  304. package/layers/VectorTileLayer.js +1 -1
  305. package/layers/VoxelLayer.js +1 -1
  306. package/layers/VoxelWasmPerScene.js +1 -1
  307. package/layers/WMSLayer.js +1 -1
  308. package/layers/graphics/controllers/FeatureTileController3D.js +1 -1
  309. package/layers/graphics/data/QueryEngineCapabilities.js +1 -1
  310. package/layers/graphics/sources/OGCFeatureSource.js +1 -1
  311. package/layers/mixins/ArcGISImageService.js +1 -1
  312. package/layers/mixins/OperationalLayer.js +1 -1
  313. package/layers/ogc/crsUtils.js +5 -0
  314. package/layers/support/RasterFunction.js +1 -1
  315. package/layers/support/RasterWorker.js +1 -1
  316. package/layers/support/capabilities.js +1 -1
  317. package/layers/support/rasterDatasets/BaseRaster.js +1 -1
  318. package/layers/support/rasterDatasets/WCSRaster.js +1 -1
  319. package/layers/support/rasterDatasets/wcsCoverageParser.js +1 -1
  320. package/layers/support/rasterFunctions/rasterProjectionHelper.js +1 -1
  321. package/layers/support/vectorTileLayerLoader.js +1 -1
  322. package/layers/support/wmsUtils.js +1 -1
  323. package/layers/support/wmtsUtils.js +1 -1
  324. package/libs/vxl/enums.js +1 -1
  325. package/package.json +5 -5
  326. package/portal/schemas/buildingSceneLayerItem.js +1 -1
  327. package/portal/schemas/definitions.js +1 -1
  328. package/portal/schemas/integratedMeshLayerItem.js +1 -1
  329. package/portal/schemas/pointCloudLayerItem.js +1 -1
  330. package/portal/schemas/sceneLayerItem.js +1 -1
  331. package/portal/schemas/webScene.js +1 -1
  332. package/rasterRenderers.js +1 -1
  333. package/renderers/support/RasterSymbolizer.js +1 -1
  334. package/request.js +1 -1
  335. package/rest/find.js +1 -1
  336. package/rest/geometryService/generalize.js +1 -1
  337. package/rest/geometryService/lengths.js +1 -1
  338. package/rest/geometryService/offset.js +1 -1
  339. package/rest/geometryService/relation.js +1 -1
  340. package/rest/geometryService/trimExtend.js +1 -1
  341. package/rest/identify.js +1 -1
  342. package/{tasks → rest}/operations/find.js +0 -0
  343. package/{tasks → rest}/operations/generalize.js +0 -0
  344. package/rest/operations/identify.js +5 -0
  345. package/{tasks → rest}/operations/lengths.js +0 -0
  346. package/{tasks → rest}/operations/offset.js +0 -0
  347. package/{tasks → rest}/operations/relation.js +0 -0
  348. package/{tasks → rest}/operations/trimExtend.js +0 -0
  349. package/{tasks → rest}/operations/urlUtils.js +0 -0
  350. package/rest/print.js +1 -1
  351. package/rest/query/operations/query.js +1 -1
  352. package/rest/query/operations/queryAttachments.js +1 -1
  353. package/rest/query/operations/queryRelatedRecords.js +1 -1
  354. package/rest/query/operations/queryTopFeatures.js +1 -1
  355. package/rest/route/utils.js +1 -1
  356. package/rest/support/ImageIdentifyParameters.js +1 -1
  357. package/rest/support/NetworkServiceDescription.js +1 -1
  358. package/rest/support/RouteInfo.js +1 -1
  359. package/rest/support/RouteParameters.js +1 -1
  360. package/rest/support/RouteSettings.js +5 -0
  361. package/rest/support/StatisticDefinition.js +1 -1
  362. package/rest/support/Stop.js +1 -1
  363. package/rest/support/networkEnums.js +1 -1
  364. package/smartMapping/renderers/univariateColorSize.js +1 -1
  365. package/smartMapping/support/adapters/FeatureLayerAdapter.js +1 -1
  366. package/support/featureFlags.js +1 -1
  367. package/support/revision.js +1 -1
  368. package/symbols/ExtrudeSymbol3DLayer.js +1 -1
  369. package/symbols/Font.js +1 -1
  370. package/symbols/IconSymbol3DLayer.js +1 -1
  371. package/symbols/ObjectSymbol3DLayer.js +1 -1
  372. package/symbols/PathSymbol3DLayer.js +1 -1
  373. package/symbols/TextSymbol.js +1 -1
  374. package/symbols/TextSymbol3DLayer.js +1 -1
  375. package/symbols/cim/placements/PlacementAlongLineSameSize.js +1 -1
  376. package/symbols/support/Symbol3DHalo.js +1 -1
  377. package/symbols/support/Symbol3DMaterial.js +1 -1
  378. package/symbols/support/cimSymbolUtils.js +1 -1
  379. package/symbols/support/textUtils.js +5 -0
  380. package/symbols/support/utils.js +1 -1
  381. package/views/2d/engine/Stage.js +1 -1
  382. package/views/2d/engine/vectorTiles/TileHandler.js +1 -1
  383. package/views/2d/engine/vectorTiles/shaders/VTLMaterialManager.js +1 -1
  384. package/views/2d/engine/vectorTiles/style/VectorTileSource.js +1 -1
  385. package/views/2d/engine/vectorTiles/style/VectorTilesRequestManager.js +5 -0
  386. package/views/2d/engine/webgl/BitBlitRenderer.js +1 -1
  387. package/views/2d/engine/webgl/MaterialManager.js +1 -1
  388. package/views/2d/engine/webgl/alignmentUtils.js +1 -1
  389. package/views/2d/engine/webgl/effects/BlendEffect.js +1 -1
  390. package/views/2d/engine/webgl/materialKey/MaterialKey.js +1 -1
  391. package/views/2d/engine/webgl/mesh/templates/WGLLabelTemplate.js +1 -1
  392. package/views/2d/engine/webgl/shaders/BlendPrograms.js +1 -1
  393. package/views/2d/engine/webgl/shaders/MaterialPrograms.js +1 -1
  394. package/views/2d/layers/BaseLayerView2D.js +1 -1
  395. package/views/2d/layers/BaseLayerViewGL2D.js +1 -1
  396. package/views/2d/layers/GraphicsLayerView2D.js +1 -1
  397. package/views/2d/layers/ImageryLayerView2D.js +1 -1
  398. package/views/2d/layers/ImageryTileLayerView2D.js +1 -1
  399. package/views/2d/layers/LayerView2D.js +1 -1
  400. package/views/2d/layers/MapNotesLayerView2D.js +1 -1
  401. package/views/2d/layers/RouteLayerView2D.js +1 -1
  402. package/views/2d/layers/TileLayerView2D.js +1 -1
  403. package/views/2d/layers/VectorTileLayerView2D.js +1 -1
  404. package/views/2d/layers/WMSLayerView2D.js +1 -1
  405. package/views/2d/layers/WMTSLayerView2D.js +1 -1
  406. package/views/2d/layers/features/sources/BaseFeatureSource.js +1 -1
  407. package/views/2d/layers/features/support/AttributeStore.js +1 -1
  408. package/views/2d/layers/graphics/GraphicBoundsRenderer.js +1 -1
  409. package/views/2d/layers/graphics/GraphicsView2D.js +1 -1
  410. package/views/2d/layers/imagery/BaseImageryTileSubView2D.js +1 -1
  411. package/views/2d/support/engineHelpers.js +1 -1
  412. package/views/3d/analysis/LineOfSight/LineOfSightController.js +1 -1
  413. package/views/3d/environment/CloudsComposition.glsl.js +1 -1
  414. package/views/3d/environment/CloudsComposition.js +1 -1
  415. package/views/3d/environment/CloudsGenerator.js +1 -1
  416. package/views/3d/environment/CloudyWeather.js +1 -1
  417. package/views/3d/environment/Fog.js +1 -1
  418. package/views/3d/environment/FoggyWeather.js +1 -1
  419. package/views/3d/environment/NoiseTextureAtlas.js +1 -1
  420. package/views/3d/environment/RainyWeather.js +1 -1
  421. package/views/3d/environment/Stars.js +1 -1
  422. package/views/3d/layers/BuildingComponentSublayerView3D.js +1 -1
  423. package/views/3d/layers/DynamicLayerView3D.js +1 -1
  424. package/views/3d/layers/FeatureLayerViewBase3D.js +1 -1
  425. package/views/3d/layers/FeatureLikeLayerView3D.js +1 -1
  426. package/views/3d/layers/GraphicsLayerView3D.js +1 -1
  427. package/views/3d/layers/GraphicsView3D.js +1 -1
  428. package/views/3d/layers/I3SMeshView3D.js +1 -1
  429. package/views/3d/layers/ImageryLayerView3D.js +1 -1
  430. package/views/3d/layers/ImageryTileLayerView3D.js +1 -1
  431. package/views/3d/layers/IntegratedMeshLayerView3D.js +1 -1
  432. package/views/3d/layers/MapImageLayerView3D.js +1 -1
  433. package/views/3d/layers/OGCFeatureLayerView3D.js +1 -1
  434. package/views/3d/layers/PointCloudLayerView3D.js +1 -1
  435. package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
  436. package/views/3d/layers/SceneLayerView3D.js +1 -1
  437. package/views/3d/layers/VectorTileLayerView3D.js +1 -1
  438. package/views/3d/layers/VoxelLayerView3D.js +1 -1
  439. package/views/3d/layers/WMSLayerView3D.js +1 -1
  440. package/views/3d/layers/WMTSLayerView3D.js +1 -1
  441. package/views/3d/layers/graphics/Deconflictor.js +1 -1
  442. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  443. package/views/3d/layers/graphics/Graphics3DDrapedGraphicLayer.js +1 -1
  444. package/views/3d/layers/graphics/Graphics3DElevationAlignment.js +1 -1
  445. package/views/3d/layers/graphics/Graphics3DFeatureProcessor.js +5 -0
  446. package/views/3d/layers/graphics/Graphics3DFrustumVisibility.js +1 -1
  447. package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
  448. package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
  449. package/views/3d/layers/graphics/Graphics3DPointSymbol.js +1 -1
  450. package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
  451. package/views/3d/layers/graphics/Graphics3DScaleVisibility.js +1 -1
  452. package/views/3d/layers/graphics/Graphics3DSymbolCreationContext.js +1 -1
  453. package/views/3d/layers/graphics/Graphics3DSymbolLayer.js +1 -1
  454. package/views/3d/layers/graphics/Graphics3DTextSymbolLayer.js +1 -1
  455. package/views/3d/layers/graphics/GraphicsProcessor.js +5 -0
  456. package/views/3d/layers/graphics/IGraphics3DFeatureProcessor.js +4 -0
  457. package/views/3d/layers/graphics/Labeler.js +1 -1
  458. package/views/3d/layers/graphics/QueryEngine.js +1 -1
  459. package/views/3d/layers/support/FeatureTileTree3DDebugger.js +1 -1
  460. package/views/3d/state/controllers/RotateController.js +1 -1
  461. package/views/3d/state/controllers/global/PinchAndPanController.js +1 -1
  462. package/views/3d/state/controllers/global/ZoomController.js +1 -1
  463. package/views/3d/state/controllers/global/ZoomStepController.js +1 -1
  464. package/views/3d/state/controllers/local/PinchAndPanController.js +1 -1
  465. package/views/3d/state/controllers/local/ZoomStepController.js +1 -1
  466. package/views/3d/support/debugFlags.js +1 -1
  467. package/views/3d/support/sunUtils.js +1 -1
  468. package/views/3d/terrain/Overlay.js +1 -1
  469. package/views/3d/terrain/OverlayManager.js +1 -1
  470. package/views/3d/terrain/TerrainSurface.js +1 -1
  471. package/views/3d/webgl-engine/core/shaderLibrary/Transform.glsl.js +7 -1
  472. package/views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl.js +28 -24
  473. package/views/3d/webgl-engine/core/shaderLibrary/shading/LineStipple.glsl.js +19 -14
  474. package/views/3d/webgl-engine/core/shaderLibrary/util/CloudsParallaxShading.glsl.js +12 -14
  475. package/views/3d/webgl-engine/lib/GridLocalOriginFactory.js +1 -1
  476. package/views/3d/webgl-engine/lib/InstanceParameters.js +5 -0
  477. package/views/3d/webgl-engine/lib/{localOrigin.js → LocalOriginFactory.js} +0 -0
  478. package/views/3d/webgl-engine/lib/OffscreenRendering.js +1 -1
  479. package/views/3d/webgl-engine/lib/Program.js +1 -1
  480. package/views/3d/webgl-engine/lib/RenderGeometry.js +1 -1
  481. package/views/3d/webgl-engine/lib/RenderTargetHelper.js +1 -1
  482. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  483. package/views/3d/webgl-engine/lib/RenderingContext.js +1 -1
  484. package/views/3d/webgl-engine/lib/SSAOHelper.js +1 -1
  485. package/views/3d/webgl-engine/lib/TextRenderParameters.js +1 -1
  486. package/views/3d/webgl-engine/lib/TextRenderer.js +1 -1
  487. package/views/3d/webgl-engine/lib/intersectorUtilsConversions.js +1 -1
  488. package/views/3d/webgl-engine/lib/lodRendering/LodRenderer.js +1 -1
  489. package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
  490. package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
  491. package/views/3d/webgl-engine/parts/RenderView.js +1 -1
  492. package/views/3d/webgl-engine/parts/ScreenshotManager.js +1 -1
  493. package/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js +1 -1
  494. package/views/3d/webgl-engine/shaders/HUDMaterialTechnique.js +1 -1
  495. package/views/3d/webgl-engine/shaders/RealisticTreeTechnique.js +1 -1
  496. package/views/3d/webgl-engine/shaders/RibbonLineTechnique.js +1 -1
  497. package/views/LayerViewManager.js +1 -1
  498. package/views/MapView.js +1 -1
  499. package/views/SceneView.js +1 -1
  500. package/views/interactive/snapping/FeatureSnappingEngine.js +1 -1
  501. package/views/interactive/snapping/featureSources/FeatureServiceSnappingSource.js +1 -1
  502. package/views/interactive/snapping/featureSources/GraphicsSnappingSource.js +1 -1
  503. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiledFetcher.js +1 -1
  504. package/views/layers/ImageryTileLayerView.js +1 -1
  505. package/views/layers/LayerView.js +1 -1
  506. package/views/layers/OGCFeatureLayerView.js +1 -1
  507. package/views/layers/RefreshableLayerView.js +1 -1
  508. package/views/overlay/ViewOverlay.js +1 -1
  509. package/views/support/DefaultsFromMap.js +1 -1
  510. package/views/support/WatchUpdatingTracking.js +1 -1
  511. package/views/support/imageReprojection.js +1 -1
  512. package/views/webgl/BufferObject.js +1 -1
  513. package/views/webgl/ContextState.js +1 -1
  514. package/views/webgl/FramebufferObject.js +1 -1
  515. package/views/webgl/Program.js +1 -1
  516. package/views/webgl/ProgramCache.js +1 -1
  517. package/views/webgl/ProgramTemplate.js +1 -1
  518. package/views/webgl/Renderbuffer.js +1 -1
  519. package/views/webgl/RenderingContext.js +1 -1
  520. package/views/webgl/ShaderTranspiler.js +1 -1
  521. package/views/webgl/Texture.js +1 -1
  522. package/views/webgl/UniformBufferLayout.js +5 -0
  523. package/views/webgl/UniformBufferObject.js +5 -0
  524. package/views/webgl/Util.js +1 -1
  525. package/views/webgl/enums.js +1 -1
  526. package/views/webgl/rasterUtils.js +1 -1
  527. package/views/webgl/storageLayouts.js +5 -0
  528. package/views/webgl/testDoublePrecisionArithmetic.js +1 -1
  529. package/views/webgl/testFloatBufferBlend.js +1 -1
  530. package/views/webgl/testSVGPremultipliedAlpha.js +1 -1
  531. package/views/webgl/testSamplerPrecision.js +1 -1
  532. package/views/webgl/tests/SimpleDraw.js +1 -1
  533. package/widgets/BasemapLayerList.js +1 -1
  534. package/widgets/BuildingExplorer/BuildingDisciplinesViewModel.js +1 -1
  535. package/widgets/Editor/BatchCreateWorkflow.js +1 -1
  536. package/widgets/Editor/CreateWorkflow.js +1 -1
  537. package/widgets/Editor/UpdateWorkflow.js +1 -1
  538. package/widgets/Editor/workflowUtils.js +1 -1
  539. package/widgets/ElevationProfile/components/SettingsButton.js +1 -1
  540. package/widgets/ElevationProfile.js +1 -1
  541. package/widgets/Feature/FeatureExpression/FeatureExpressionViewModel.js +1 -1
  542. package/widgets/Feature/FeatureExpression.js +1 -1
  543. package/widgets/Feature/FeatureMedia/FeatureMediaViewModel.js +1 -1
  544. package/widgets/Feature/FeatureMedia.js +1 -1
  545. package/widgets/Feature/FeatureViewModel.js +1 -1
  546. package/widgets/FeatureForm/FeatureFormViewModel.js +1 -1
  547. package/widgets/FeatureForm/InputField.js +1 -1
  548. package/widgets/FeatureForm/InputFieldGroup.js +1 -1
  549. package/widgets/FeatureForm.js +1 -1
  550. package/widgets/FeatureTemplates.js +1 -1
  551. package/widgets/FloorFilter.js +1 -1
  552. package/widgets/LayerList/LayerListViewModel.js +1 -1
  553. package/widgets/LayerList/ListItemPanel.js +1 -1
  554. package/widgets/LayerList/support/layerListUtils.js +1 -1
  555. package/widgets/Legend/support/ActiveLayerInfo.js +1 -1
  556. package/widgets/Popup.js +1 -1
  557. package/widgets/Print.js +1 -1
  558. package/widgets/Search.js +1 -1
  559. package/widgets/Sketch/SketchViewModel.js +1 -1
  560. package/widgets/Weather/CoverageSlider.js +5 -0
  561. package/widgets/Weather/WeatherViewModel.js +1 -1
  562. package/widgets/Weather/css.js +1 -1
  563. package/widgets/Weather.js +1 -1
  564. package/widgets/support/geolocationUtils.js +1 -1
  565. package/assets/esri/core/workers/chunks/0881ce46b10362861f87.js +0 -1
  566. package/assets/esri/core/workers/chunks/0c0a02770eeeb3e28ea1.js +0 -1
  567. package/assets/esri/core/workers/chunks/0d2effbd84a9482eb639.js +0 -1
  568. package/assets/esri/core/workers/chunks/0f04246c1b591a3ac74d.js +0 -1
  569. package/assets/esri/core/workers/chunks/1ac6be0dc25e16c75d06.js +0 -1
  570. package/assets/esri/core/workers/chunks/1f8110ea12d65ca94b55.js +0 -1
  571. package/assets/esri/core/workers/chunks/2025d0fd61a64876c81b.js +0 -1
  572. package/assets/esri/core/workers/chunks/241859d74c0daac62e11.js +0 -1
  573. package/assets/esri/core/workers/chunks/2c9af2ebd72d9b55329b.js +0 -1
  574. package/assets/esri/core/workers/chunks/331be347c1b1ca0be2d2.js +0 -1
  575. package/assets/esri/core/workers/chunks/39af317388ecebb4387d.js +0 -1
  576. package/assets/esri/core/workers/chunks/39be2893a7dbdecfd65a.js +0 -1
  577. package/assets/esri/core/workers/chunks/3a20f66b0b7d08064e34.js +0 -1
  578. package/assets/esri/core/workers/chunks/445099d037affd139ed0.js +0 -1
  579. package/assets/esri/core/workers/chunks/45848fecec88ed2da33d.js +0 -1
  580. package/assets/esri/core/workers/chunks/48d3a3abc53abe6a4017.js +0 -1
  581. package/assets/esri/core/workers/chunks/5005b8c1fdd5cb9a4c19.js +0 -1
  582. package/assets/esri/core/workers/chunks/52e4c367c72ea7cc3457.js +0 -1
  583. package/assets/esri/core/workers/chunks/5d8170f6207dbeb4de1b.js +0 -1
  584. package/assets/esri/core/workers/chunks/615aa2d3ecafe30c80c0.js +0 -1
  585. package/assets/esri/core/workers/chunks/642c38ac00a962f35d44.js +0 -1
  586. package/assets/esri/core/workers/chunks/64459604505647e9c714.js +0 -1
  587. package/assets/esri/core/workers/chunks/653d1550dd1a4867a9fc.js +0 -1
  588. package/assets/esri/core/workers/chunks/65f73fbbc3c7c60c6d3d.js +0 -1
  589. package/assets/esri/core/workers/chunks/6db7081d344bea26ef64.js +0 -1
  590. package/assets/esri/core/workers/chunks/6deac533bb455be4004b.js +0 -1
  591. package/assets/esri/core/workers/chunks/6e13dab8ec43f7494297.js +0 -1
  592. package/assets/esri/core/workers/chunks/722a10c65456844d72b9.js +0 -1
  593. package/assets/esri/core/workers/chunks/7bd4c3ee43fb038b88d8.js +0 -1
  594. package/assets/esri/core/workers/chunks/803de5097a8a2c4b58a8.js +0 -1
  595. package/assets/esri/core/workers/chunks/8298231a0fd0129b0d5c.js +0 -1
  596. package/assets/esri/core/workers/chunks/8500c6c011400af1b7bd.js +0 -1
  597. package/assets/esri/core/workers/chunks/8b322a2a47dfdbb59b45.js +0 -1
  598. package/assets/esri/core/workers/chunks/8f83bebef9174c3f15da.js +0 -1
  599. package/assets/esri/core/workers/chunks/904332faa22bc0e876cb.js +0 -1
  600. package/assets/esri/core/workers/chunks/950565d1e682fc4072e1.js +0 -1
  601. package/assets/esri/core/workers/chunks/9846098704ee38bf6350.js +0 -1
  602. package/assets/esri/core/workers/chunks/a247ddd84245c81112c8.js +0 -1
  603. package/assets/esri/core/workers/chunks/a721342a32541717324d.js +0 -1
  604. package/assets/esri/core/workers/chunks/a9ffa806df20130ecfb6.js +0 -1
  605. package/assets/esri/core/workers/chunks/af13e534e4160636bd3d.js +0 -1
  606. package/assets/esri/core/workers/chunks/b2f62234ebb8b6158baa.js +0 -1
  607. package/assets/esri/core/workers/chunks/b51261a9a9ab62388839.js +0 -971
  608. package/assets/esri/core/workers/chunks/b58eba403bd517a7bb15.js +0 -1
  609. package/assets/esri/core/workers/chunks/b5bb7cfa26b1f0cec67a.js +0 -1
  610. package/assets/esri/core/workers/chunks/b8666d1a4e4fff7a4703.js +0 -1
  611. package/assets/esri/core/workers/chunks/bea1da9e3f878e0e2c83.js +0 -1
  612. package/assets/esri/core/workers/chunks/c1b6c31fa3ec1542f996.js +0 -1
  613. package/assets/esri/core/workers/chunks/c32a4fbdc87225f84019.js +0 -1
  614. package/assets/esri/core/workers/chunks/c67fea81f69a60c0eaef.js +0 -1
  615. package/assets/esri/core/workers/chunks/cb68db7169b9dfd1c3ff.js +0 -1
  616. package/assets/esri/core/workers/chunks/cc96608b2802fbfe7a08.js +0 -1
  617. package/assets/esri/core/workers/chunks/cd02fe27eb07681cb366.js +0 -1
  618. package/assets/esri/core/workers/chunks/d336afd5890dcdbf5341.js +0 -1
  619. package/assets/esri/core/workers/chunks/da69e3e5949fe1716e34.js +0 -1
  620. package/assets/esri/core/workers/chunks/daa9c450b2e2a5371249.js +0 -1
  621. package/assets/esri/core/workers/chunks/dd63ba77b7e4c3c9c594.js +0 -1
  622. package/assets/esri/core/workers/chunks/dfa57982d28c9aeb97b9.js +0 -1
  623. package/assets/esri/core/workers/chunks/e01812116b27874948f0.js +0 -1
  624. package/assets/esri/core/workers/chunks/e5c9d8482b913cf3580a.js +0 -1
  625. package/assets/esri/core/workers/chunks/eeadd92f0bede9fc8745.js +0 -1
  626. package/assets/esri/core/workers/chunks/fbb67cb6224aed2cce16.js +0 -1
  627. package/assets/esri/core/workers/chunks/feeaf61424336e9eac88.js +0 -1
  628. package/assets/esri/core/workers/chunks/ff02295329a8986d0568.js +0 -1
  629. package/tasks/operations/identify.js +0 -5
  630. package/views/2d/engine/webgl/mesh/templates/meshUtils.js +0 -5
  631. package/views/3d/layers/graphics/Graphics3DFeatureLikeLayerView.js +0 -5
  632. package/views/3d/layers/graphics/Graphics3DGraphicLikeLayerView.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.23/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../../Color.js";import"../../../../symbols.js";import{result as t}from"../../../../core/asyncUtils.js";import r from"../../../../core/has.js";import i from"../../../../core/Error.js";import{isSome as s,get as a,isNone as o,releaseMaybe as n,unwrap as l}from"../../../../core/maybe.js";import{throwIfAbortError as c,throwIfAborted as h}from"../../../../core/promiseUtils.js";import{pt2px as m,px2pt as u}from"../../../../core/screenUtils.js";import{dataComponents as d,isSVG as _}from"../../../../core/urlUtils.js";import{c as p}from"../../../../chunks/mat4f64.js";import{f,a as y}from"../../../../chunks/vec2f64.js";import{Z as g,O as b,f as x}from"../../../../chunks/vec3f64.js";import{c as S}from"../../../../chunks/vec4.js";import{f as v,c as z}from"../../../../chunks/vec4f64.js";import{projectPointToVector as P}from"../../../../geometry/projection.js";import{containsPoint as R}from"../../../../geometry/support/aaBoundingBox.js";import{createRendererExpression as M}from"../../../../support/arcadeOnDemand.js";import{defaultPrimitive as w}from"../../../../symbols/support/IconSymbol3DLayerResource.js";import{getIconHref as C}from"../../../../symbols/support/utils.js";import j from"../../../2d/arcade/callExpressionWithFeature.js";import{TRANSPARENT_UNIT as I}from"./constants.js";import{perObjectElevationAligner as E}from"./ElevationAligners.js";import{SymbolUpdateType as O,elevationModeChangeUpdateType as T,needsElevationUpdates2D as L}from"./elevationAlignmentUtils.js";import{ElevationContext as D}from"./ElevationContext.js";import F from"./Graphics3DDrapedGraphicLayer.js";import{Graphics3DObject3DGraphicLayer as G}from"./Graphics3DObject3DGraphicLayer.js";import{Graphics3DSymbolLayer as U}from"./Graphics3DSymbolLayer.js";import{validateSymbolLayerSize as A,namedAnchorToHUDMaterialAnchorPos as V}from"./graphicUtils.js";import{ApplyRendererDiffResult as k}from"./interfaces.js";import{placePointOnGeometry as B,createStageObjectForHUD as N,extendPointGraphicElevationContext as q}from"./pointUtils.js";import{createTriangle as H,createX as W,createCross as Z,createKite as $,createSquare as J,createCircle as K}from"./sdfPrimitives.js";import{initFastSymbolUpdatesState as Q,updateFastSymbolUpdatesState as X,evaluateModelTransform as Y}from"../support/FastSymbolUpdates.js";import{DRAPED_Z as ee}from"../../terrain/OverlayRenderer.js";import{PowerOfTwoResizeMode as te}from"../../webgl-engine/lib/basicInterfaces.js";import re from"../../webgl-engine/lib/GeometryUtil.js";import{RenderGeometry as ie}from"../../webgl-engine/lib/RenderGeometry.js";import{Texture as se}from"../../webgl-engine/lib/Texture.js";import{HUDMaterial as ae}from"../../webgl-engine/materials/HUDMaterial.js";import{TextureWrapMode as oe}from"../../../webgl/enums.js";import ne from"../../../../symbols/CIMSymbol.js";const le=p(),ce=x(0,0,1),he=16,me=1.5,ue=128,de=.5,_e=[de/2,de/2,1-de/2,1-de/2],pe=[ue*de,ue*de];class fe extends U{constructor(e,t,r,i){super(e,t,r,i),this._cimLayers=null,this._cimSymbolMaterials=new Map,this._cimSymbolTextures=new Map,this._cimMaterialParametersInfo=null,this._cimRequiredFields=null,this._cimScaleFactorOrFunction=null,this._size=null,this._symbolTextureRatio=1,this._outlineSize=0,this._elevationOptions={supportsOffsetAdjustment:!0,supportsOnTheGround:!0}}getCachedSize(){return{size:this._getIconSize()}}async doLoad(e){this._validateOrThrow();const t=this._prepareMaterialParameters(),r=this._getPrimitive();if(s(r))this._prepareResourcesPrimitive(t,r);else{const r=C(this.symbol,this.symbolLayer),i=d(r);i&&"application/json"===i.mediaType?await this._prepareResourcesCIM(t,JSON.parse(i.data),e):await this._prepareResourcesHref(t,r,e)}}_validateOrThrow(){if(this._drivenProperties.size)return;const e=A(this._getIconSize());if(e)throw new i("graphics3diconsymbollayer:invalid-size",e)}_getIconSize(){const e=this.symbolLayer,t=Math.round(null!=e.size?m(e.size):he);return this._drivenProperties.size?Math.max(t,64):t}_generateTextureCIM(e){const t=this._getGraphicHash(e);let r=""===t?null:this._cimSymbolTextures.get(t);if(!r){const i={scaleFactor:this._cimScaleFactorOrFunction},s=this._context.sharedResources.cimSymbolRasterizer.rasterizeCIMSymbol(this._cimLayers,e,"esriGeometryPoint",i,null,null);this._cimMaterialParametersInfo.anchorPos=this._getAnchorPos("relative",s.anchorPosition);const a={width:s.imageData.width,height:s.imageData.height,powerOfTwoResizeMode:te.PAD};r=new se(s.imageData,a),this._cimSymbolTextures.set(t,r),this._context.stage.add(r)}return r}_computeSize(e,t){const r=e.width/e.height;return r>1?[t,Math.round(t/r)]:[Math.round(t*r),t]}_prepareMaterialParameters(){const e={anchorPos:this._getAnchorPos(this.symbolLayer.anchor,this.symbolLayer.anchorPosition)},t=this.symbol;if(ye(t)){const{screenLength:r,minWorldLength:i,maxWorldLength:s}=t.verticalOffset;e.verticalOffset={screenLength:m(r),minWorldLength:i||0,maxWorldLength:null!=s?s:1/0}}return this._context.screenSizePerspectiveEnabled&&(e.screenSizePerspective=this._context.sharedResources.screenSizePerspectiveSettings),e.occlusionTest=!0,e.slicePlaneEnabled=this._context.slicePlaneEnabled,e}_prepareResourcesPrimitive(e,t){const r=this._getOutlineSize();if(ge(t)&&0===r)throw new Error("Nothing to render");this._outlineSize=r,e.color=this._getFillColor(),e.outlineColor=this._getOutlineColor(),e.outlineSize=this._outlineSize;const i=this._context.sharedResources.textures.fromData(t,(()=>be(t)));this._texture=i.texture,this._releaseTexture=i,e.textureIsSignedDistanceField=!0,e.distanceFieldBoundingBox=_e,e.textureId=this._texture.id;const s=this._getIconSize();this._size=[s,s],this._symbolTextureRatio=1/de,this._createMaterialAndAddToStage(e,this._context.stage)}async _prepareResourcesHref(e,s,a){if(!r("esri-canvas-svg-support")&&_(s)){throw new i("graphics3diconsymbollayer:unsupported-image-format","IconSymbol3DLayer failed to load (SVG symbols are not supported in IE11)")}this._outlineSize=this._getOutlineSize(),e.color=this._getFillColor(),e.outlineColor=this._getOutlineColor(),e.outlineSize=this._outlineSize,e.textureIsSignedDistanceField=!1;const o=this._getIconSize(),n=o*this._context.layerView.view.pixelRatio,l=await t(this._context.sharedResources.textures.fromUrl(s,n,{signal:a}));if(!1===l.ok){c(l.error);throw new i("graphics3diconsymbollayer:request-failed",`Failed to load (Request for icon resource failed: ${s})`)}this._releaseTexture=l.value;const h=l.value.texture,m=h.params;this._size=this._computeSize(m,o),e.textureId=h.id,this._createMaterialAndAddToStage(e,this._context.stage)}async _prepareResourcesCIM(e,t,r){const i=new ne({data:t});if(!this._context.sharedResources.cimSymbolRasterizer){const e=(await import("../../../../symbols/cim/CIMSymbolRasterizer.js")).CIMSymbolRasterizer;h(r),this._context.sharedResources.cimSymbolRasterizer||(this._context.sharedResources.cimSymbolRasterizer=new e(this._context.renderCoordsHelper.spatialReference,!0))}const s=this._context.layer.fields?this._context.layer.fields.map((e=>e.toJSON())):null;let a,o;if(this._cimLayers=await this._context.sharedResources.cimSymbolRasterizer.analyzeCIMSymbol(i,s,this._context.renderer&&"dictionary"===this._context.renderer.type?this._context.renderer.fieldMap:null,"esriGeometryPoint",{signal:r}),this._context.renderer&&"dictionary"===this._context.renderer.type&&this._context.renderer.scaleExpression){const e=this._context.renderer;if(isNaN(e.scaleExpression)){const t=e.scaleExpression,r=await M(t,this._context.layer.spatialReference,s);o=(e,t,i)=>{const s=j(r,e,{$view:i},"esriGeometryPoint",t);return null!==s?s:1}}else a=Number(e.scaleExpression)}this._cimScaleFactorOrFunction=a||o||1;const n=this._context.renderer?await this._context.renderer.getRequiredFields(this._context.layer.fieldsIndex):[];h(r);const l=this._context.layer.fieldsIndex;this._cimRequiredFields=n.map((e=>l.get(e).name)),this._cimMaterialParametersInfo=e,this._cimMaterialParametersInfo.color=this._getFillColor(),this._cimMaterialParametersInfo.outlineColor=[0,0,0,0],this._cimMaterialParametersInfo.outlineSize=0,this._cimMaterialParametersInfo.textureIsSignedDistanceField=!1}_getPrimitive(){return this.symbolLayer.resource&&this.symbolLayer.resource.href?null:this.symbolLayer.resource&&this.symbolLayer.resource.primitive||w}_getOutlineSize(){let e=0;const t=this.symbolLayer;if(s(t.outline)&&null!=t.outline.size)return Math.max(m(t.outline.size),0);return e=ge(this._getPrimitive())?me:0,Math.max(e,0)}_getOutlineColor(){const t=this._getLayerOpacity(),r=this.symbolLayer,i=a(r,"outline","color");if(s(i)){const r=e.toUnitRGB(i),s=i.a*t;return[r[0],r[1],r[2],s]}return[0,0,0,0]}_getFillColor(){if(ge(this._getPrimitive()))return I;const e=o(this._getPrimitive()),t=a(this.symbolLayer,"material","color");return this._getCombinedOpacityAndColor(t,{hasIntrinsicColor:e})}_getAnchorPos(e,t){return"relative"===e?f((t.x||0)+.5,.5-(t.y||0)):e in V?V[e]:V.center}_createMaterialAndAddToStage(e,t){if(this._cimLayers?this._fastUpdates={enabled:!1}:this._fastUpdates=Q(this._context.renderer,this._fastVisualVariableConvertOptions()),this._fastUpdates.enabled&&Object.assign(e,this._fastUpdates.materialParameters),this._cimLayers){let r=this._cimSymbolMaterials.get(e.textureId);return r||(r=new ae(e),this._cimSymbolMaterials.set(e.textureId,r),t.add(r)),r}return this._material=new ae(e),t.add(this._material),this._material}_setDrapingDependentMaterialParameters(){this.draped&&(this._forEachMaterial((e=>{e.setParameters({verticalOffset:null,screenSizePerspective:null,occlusionTest:!1,slicePlaneEnabled:!1,shaderPolygonOffset:0,isDraped:this.draped})})),this.layerOpacityChanged())}destroy(){super.destroy(),this._forEachMaterial((e=>this._context.stage.remove(e))),this._material=null,this._cimSymbolMaterials.clear(),this._cimSymbolTextures.forEach((e=>this._context.stage.remove(e))),this._cimSymbolTextures.clear(),this._releaseTexture=n(this._releaseTexture)}_getScaleFactor(e,t){if(this._drivenProperties.size&&e.size){for(let t=0;t<3;t++){const r=e.size[t];r&&"symbol-value"!==r&&"proportional"!==r&&(e.size[t]=m(r))}if("symbol-value"===e.size[0])return 1;if(isFinite(+e.size[0]))return+e.size[0]/t;if(isFinite(+e.size[2]))return+e.size[2]/t}return 1}createGraphics3DGraphic(e){const t=e.graphic;if(!this._validateGeometry(t.geometry))return null;let r,i;if(this._cimLayers){if(!this._cimLayers.length)return null;const e=this._generateTextureCIM(t),s={textureId:e.id,...this._cimMaterialParametersInfo};i=this._createMaterialAndAddToStage(s,this._context.stage),r=[e.params.width,e.params.height]}else r=this._size,i=l(this._material);const s=B(t.geometry);if(o(s))return this.logger.warn(`unsupported geometry type for icon symbol: ${t.geometry.type}`),null;const a=e.renderingInfo,n=this._getVertexOpacityAndColor(a);let c=1;if(!this._fastUpdates.enabled||!this._fastUpdates.visualVariables.size){const e=r[0]>r[1]?r[0]:r[1];c=this._getScaleFactor(a,e)}c*=this._symbolTextureRatio;const h=[r[0]*c,r[1]*c],m=this.setGraphicElevationContext(t,new D);return this.ensureDrapedStatus("on-the-ground"===m.mode)&&this._setDrapingDependentMaterialParameters(),this.draped?this._createAsOverlay(t,s,i,n,h,e.layer.uid):this._createAs3DShape(t,s,i,n,h,m,t.uid)}layerOpacityChanged(){const e=this._getFillColor(),t=this._getOutlineColor();return this._forEachMaterial((r=>{r.setParameters({color:e}),r.setParameters({outlineColor:t})})),!0}layerElevationInfoChanged(e,t,r){const i=this._elevationContext.mode,s=T(fe.elevationModeChangeTypes,r,i);if(s!==O.UPDATE)return s;const a=L(i)||"absolute-height"===i;return this.updateGraphics3DGraphicElevationInfo(e,t,(()=>a))}slicePlaneEnabledChanged(){return this.draped||this._forEachMaterial((e=>{e.setParameters({slicePlaneEnabled:this._context.slicePlaneEnabled})})),!0}physicalBasedRenderingChanged(){return!0}pixelRatioChanged(){return!!this._getPrimitive()}applyRendererDiff(e,t){for(const r in e.diff){if("visualVariables"!==r)return k.Recreate_Symbol;if(!X(this._fastUpdates,t,this._fastVisualVariableConvertOptions()))return k.Recreate_Symbol;s(this._material)&&this._material.setParameters(this._fastUpdates.materialParameters)}return k.Fast_Update}_defaultElevationInfoNoZ(){return xe}_createAs3DShape(e,t,r,i,s,a,o){const n=this.getFastUpdateAttrValues(e),l=n?e=>Y(this._fastUpdates.materialParameters,n,e):null,c=[re.createPointGeometry(ce,null,i,s,Se,null,n)],h=N(this._context,t,c,[r],a,this._context.layer.uid,o,l);if(null===h)return null;const m=new G(this,h.object,c,null,null,E,a);return m.alignedSampledElevation=h.sampledElevation,m.needsElevationUpdates=L(a.mode)||"absolute-height"===a.mode,m.getScreenSize=this._createScreenSizeGetter(s,l),m.calculateRelativeScreenBounds=e=>r.calculateRelativeScreenBounds(m.getScreenSize(),1,e),q(m,t,this._context.elevationProvider),m}_createAsOverlay(e,t,r,i,a,o){r.renderPriority=this._renderPriority;const n=z();P(t,n,this._context.overlaySR),n[2]=ee;const l=this._context.clippingExtent;if(s(l)&&!R(l,n))return null;const c=this.getFastUpdateAttrValues(e),h=c?e=>Y(this._fastUpdates.materialParameters,c,e):null,m=re.createPointGeometry(ce,n,i,a,null,null,c),u=new ie(m,r,o,e.uid);n[3]=0,S(u.boundingSphere,n),u.calculateShaderTransformation=h;const d=new F(this,[u],null);return d.getScreenSize=this._createScreenSizeGetter(a,h),d.calculateRelativeScreenBounds=e=>r.calculateRelativeScreenBounds(d.getScreenSize(),1,e),d}_createScreenSizeGetter(e,t){const r=this._outlineSize+2;if(this._fastUpdates.enabled){const i=e[0]/this._symbolTextureRatio,s=e[1]/this._symbolTextureRatio;return(e=y())=>{const a=t(le);return e[0]=a[0]*i+r,e[1]=a[5]*s+r,e}}{const t=e[0]/this._symbolTextureRatio+r,i=e[1]/this._symbolTextureRatio+r;return(e=y())=>(e[0]=t,e[1]=i,e)}}_fastVisualVariableConvertOptions(){const e=this._size[0]>this._size[1]?this._size[0]:this._size[1],t=x(e,e,e),r=u(1),i=e*r;return{modelSize:t,symbolSize:x(i,i,i),unitInMeters:r,transformation:{anchor:g,scale:b,rotation:g}}}_getGraphicHash(e){let t="";for(const r of this._cimRequiredFields)t+=r+e.attributes[r];return t}_forEachMaterial(e){s(this._material)&&e(this._material),this._cimSymbolMaterials.forEach(e)}}function ye(e){return e&&"point-3d"===e.type&&e.hasVisibleVerticalOffset()}function ge(e){return!!s(e)&&("cross"===e||"x"===e)}function be(e){let t;const r=ue,i=r*de;switch(e){case"circle":t=K(r,i);break;case"square":t=J(r,i);break;case"kite":t=$(r,i);break;case"cross":t=Z(r,i);break;case"x":t=W(r,i);break;case"triangle":t=H(r,i)}return new se(t,{mipmap:!1,wrap:{s:oe.CLAMP_TO_EDGE,t:oe.CLAMP_TO_EDGE},width:ue,height:ue,components:4,noUnpackFlip:!0})}fe.PRIMITIVE_SIZE=pe,fe.elevationModeChangeTypes={definedChanged:O.UPDATE,staysOnTheGround:O.NONE,onTheGroundChanged:O.RECREATE};const xe={mode:"relative-to-ground",offset:0},Se=v(0,0,0,1);export{fe as Graphics3DIconSymbolLayer,fe as default};
5
+ import e from"../../../../Color.js";import"../../../../symbols.js";import{result as t}from"../../../../core/asyncUtils.js";import r from"../../../../core/has.js";import i from"../../../../core/Error.js";import{isSome as s,get as a,isNone as o,releaseMaybe as n,unwrap as l}from"../../../../core/maybe.js";import{throwIfAbortError as c,throwIfAborted as h}from"../../../../core/promiseUtils.js";import{pt2px as m,px2pt as u}from"../../../../core/screenUtils.js";import{dataComponents as d,isSVG as _}from"../../../../core/urlUtils.js";import{c as p}from"../../../../chunks/mat4f64.js";import{f,a as y}from"../../../../chunks/vec2f64.js";import{Z as g,O as b,f as x}from"../../../../chunks/vec3f64.js";import{c as S}from"../../../../chunks/vec4.js";import{f as v,c as z}from"../../../../chunks/vec4f64.js";import{projectPointToVector as P}from"../../../../geometry/projection.js";import{containsPoint as R}from"../../../../geometry/support/aaBoundingBox.js";import{createRendererExpression as M}from"../../../../support/arcadeOnDemand.js";import{defaultPrimitive as C}from"../../../../symbols/support/IconSymbol3DLayerResource.js";import{getIconHref as w}from"../../../../symbols/support/utils.js";import j from"../../../2d/arcade/callExpressionWithFeature.js";import{TRANSPARENT_UNIT as I}from"./constants.js";import{perObjectElevationAligner as E}from"./ElevationAligners.js";import{SymbolUpdateType as O,elevationModeChangeUpdateType as T,needsElevationUpdates2D as L}from"./elevationAlignmentUtils.js";import{ElevationContext as D}from"./ElevationContext.js";import F from"./Graphics3DDrapedGraphicLayer.js";import{Graphics3DObject3DGraphicLayer as G}from"./Graphics3DObject3DGraphicLayer.js";import{Graphics3DSymbolLayer as U}from"./Graphics3DSymbolLayer.js";import{validateSymbolLayerSize as A,namedAnchorToHUDMaterialAnchorPos as V}from"./graphicUtils.js";import{ApplyRendererDiffResult as k}from"./interfaces.js";import{placePointOnGeometry as B,createStageObjectForHUD as N,extendPointGraphicElevationContext as q}from"./pointUtils.js";import{createTriangle as H,createX as W,createCross as Z,createKite as $,createSquare as J,createCircle as K}from"./sdfPrimitives.js";import{initFastSymbolUpdatesState as Q,updateFastSymbolUpdatesState as X,evaluateModelTransform as Y}from"../support/FastSymbolUpdates.js";import{DRAPED_Z as ee}from"../../terrain/OverlayRenderer.js";import{PowerOfTwoResizeMode as te}from"../../webgl-engine/lib/basicInterfaces.js";import re from"../../webgl-engine/lib/GeometryUtil.js";import{RenderGeometry as ie}from"../../webgl-engine/lib/RenderGeometry.js";import{Texture as se}from"../../webgl-engine/lib/Texture.js";import{HUDMaterial as ae}from"../../webgl-engine/materials/HUDMaterial.js";import{TextureWrapMode as oe}from"../../../webgl/enums.js";import ne from"../../../../symbols/CIMSymbol.js";const le=p(),ce=x(0,0,1),he=16,me=1.5,ue=128,de=.5,_e=[de/2,de/2,1-de/2,1-de/2],pe=[ue*de,ue*de];class fe extends U{constructor(e,t,r,i){super(e,t,r,i),this._cimLayers=null,this._cimSymbolMaterials=new Map,this._cimSymbolTextures=new Map,this._cimMaterialParametersInfo=null,this._cimRequiredFields=null,this._cimScaleFactorOrFunction=null,this._size=null,this._symbolTextureRatio=1,this._outlineSize=0,this._elevationOptions={supportsOffsetAdjustment:!0,supportsOnTheGround:!0}}getCachedSize(){return{size:this._getIconSize()}}async doLoad(e){this._validateOrThrow();const t=this._prepareMaterialParameters(),r=this._getPrimitive();if(s(r))this._prepareResourcesPrimitive(t,r);else{const r=w(this.symbol,this.symbolLayer),i=d(r);i&&"application/json"===i.mediaType?await this._prepareResourcesCIM(t,JSON.parse(i.data),e):await this._prepareResourcesHref(t,r,e)}}_validateOrThrow(){if(this._drivenProperties.size)return;const e=A(this._getIconSize());if(e)throw new i("graphics3diconsymbollayer:invalid-size",e)}_getIconSize(){const e=this.symbolLayer,t=Math.round(null!=e.size?m(e.size):he);return this._drivenProperties.size?Math.max(t,64):t}_generateTextureCIM(e){const t=this._getGraphicHash(e);let r=""===t?null:this._cimSymbolTextures.get(t);if(!r){const i={scaleFactor:this._cimScaleFactorOrFunction},s=this._context.sharedResources.cimSymbolRasterizer.rasterizeCIMSymbol(this._cimLayers,e,"esriGeometryPoint",i,null,null);this._cimMaterialParametersInfo.anchorPos=this._getAnchorPos("relative",s.anchorPosition);const a={width:s.imageData.width,height:s.imageData.height,powerOfTwoResizeMode:te.PAD};r=new se(s.imageData,a),this._cimSymbolTextures.set(t,r),this._context.stage.add(r)}return r}_computeSize(e,t){const r=e.width/e.height;return r>1?[t,Math.round(t/r)]:[Math.round(t*r),t]}_prepareMaterialParameters(){const e={anchorPos:this._getAnchorPos(this.symbolLayer.anchor,this.symbolLayer.anchorPosition)},t=this.symbol;if(ye(t)){const{screenLength:r,minWorldLength:i,maxWorldLength:s}=t.verticalOffset;e.verticalOffset={screenLength:m(r),minWorldLength:i||0,maxWorldLength:null!=s?s:1/0}}return this._context.screenSizePerspectiveEnabled&&(e.screenSizePerspective=this._context.sharedResources.screenSizePerspectiveSettings),e.occlusionTest=!0,e.slicePlaneEnabled=this._context.slicePlaneEnabled,e}_prepareResourcesPrimitive(e,t){const r=this._getOutlineSize();if(ge(t)&&0===r)throw new Error("Nothing to render");this._outlineSize=r,e.color=this._getFillColor(),e.outlineColor=this._getOutlineColor(),e.outlineSize=this._outlineSize;const i=this._context.sharedResources.textures.fromData(t,(()=>be(t)));this._texture=i.texture,this._releaseTexture=i,e.textureIsSignedDistanceField=!0,e.distanceFieldBoundingBox=_e,e.textureId=this._texture.id;const s=this._getIconSize();this._size=[s,s],this._symbolTextureRatio=1/de,this._createMaterialAndAddToStage(e,this._context.stage)}async _prepareResourcesHref(e,s,a){if(!r("esri-canvas-svg-support")&&_(s)){throw new i("graphics3diconsymbollayer:unsupported-image-format","IconSymbol3DLayer failed to load (SVG symbols are not supported in IE11)")}this._outlineSize=this._getOutlineSize(),e.color=this._getFillColor(),e.outlineColor=this._getOutlineColor(),e.outlineSize=this._outlineSize,e.textureIsSignedDistanceField=!1;const o=this._getIconSize(),n=o*this._context.graphicsCoreOwner.view.pixelRatio,l=await t(this._context.sharedResources.textures.fromUrl(s,n,{signal:a}));if(!1===l.ok){c(l.error);throw new i("graphics3diconsymbollayer:request-failed",`Failed to load (Request for icon resource failed: ${s})`)}this._releaseTexture=l.value;const h=l.value.texture,m=h.params;this._size=this._computeSize(m,o),e.textureId=h.id,this._createMaterialAndAddToStage(e,this._context.stage)}async _prepareResourcesCIM(e,t,r){const i=new ne({data:t});if(!this._context.sharedResources.cimSymbolRasterizer){const e=(await import("../../../../symbols/cim/CIMSymbolRasterizer.js")).CIMSymbolRasterizer;h(r),this._context.sharedResources.cimSymbolRasterizer||(this._context.sharedResources.cimSymbolRasterizer=new e(this._context.renderCoordsHelper.spatialReference,!0))}const s=this._context.layer.fields?this._context.layer.fields.map((e=>e.toJSON())):null;let a,o;if(this._cimLayers=await this._context.sharedResources.cimSymbolRasterizer.analyzeCIMSymbol(i,s,this._context.renderer&&"dictionary"===this._context.renderer.type?this._context.renderer.fieldMap:null,"esriGeometryPoint",{signal:r}),this._context.renderer&&"dictionary"===this._context.renderer.type&&this._context.renderer.scaleExpression){const e=this._context.renderer;if(isNaN(e.scaleExpression)){const t=e.scaleExpression,r=await M(t,this._context.layer.spatialReference,s);o=(e,t,i)=>{const s=j(r,e,{$view:i},"esriGeometryPoint",t);return null!==s?s:1}}else a=Number(e.scaleExpression)}this._cimScaleFactorOrFunction=a||o||1;const n=this._context.renderer?await this._context.renderer.getRequiredFields(this._context.layer.fieldsIndex):[];h(r);const l=this._context.layer.fieldsIndex;this._cimRequiredFields=n.map((e=>l.get(e).name)),this._cimMaterialParametersInfo=e,this._cimMaterialParametersInfo.color=this._getFillColor(),this._cimMaterialParametersInfo.outlineColor=[0,0,0,0],this._cimMaterialParametersInfo.outlineSize=0,this._cimMaterialParametersInfo.textureIsSignedDistanceField=!1}_getPrimitive(){return this.symbolLayer.resource&&this.symbolLayer.resource.href?null:this.symbolLayer.resource&&this.symbolLayer.resource.primitive||C}_getOutlineSize(){let e=0;const t=this.symbolLayer;if(s(t.outline)&&null!=t.outline.size)return Math.max(m(t.outline.size),0);return e=ge(this._getPrimitive())?me:0,Math.max(e,0)}_getOutlineColor(){const t=this._getLayerOpacity(),r=this.symbolLayer,i=a(r,"outline","color");if(s(i)){const r=e.toUnitRGB(i),s=i.a*t;return[r[0],r[1],r[2],s]}return[0,0,0,0]}_getFillColor(){if(ge(this._getPrimitive()))return I;const e=o(this._getPrimitive()),t=a(this.symbolLayer,"material","color");return this._getCombinedOpacityAndColor(t,{hasIntrinsicColor:e})}_getAnchorPos(e,t){return"relative"===e?f((t.x||0)+.5,.5-(t.y||0)):e in V?V[e]:V.center}_createMaterialAndAddToStage(e,t){if(this._cimLayers?this._fastUpdates={enabled:!1}:this._fastUpdates=Q(this._context.renderer,this._fastVisualVariableConvertOptions()),this._fastUpdates.enabled&&Object.assign(e,this._fastUpdates.materialParameters),this._cimLayers){let r=this._cimSymbolMaterials.get(e.textureId);return r||(r=new ae(e),this._cimSymbolMaterials.set(e.textureId,r),t.add(r)),r}return this._material=new ae(e),t.add(this._material),this._material}_setDrapingDependentMaterialParameters(){this.draped&&(this._forEachMaterial((e=>{e.setParameters({verticalOffset:null,screenSizePerspective:null,occlusionTest:!1,slicePlaneEnabled:!1,shaderPolygonOffset:0,isDraped:this.draped})})),this.layerOpacityChanged())}destroy(){super.destroy(),this._forEachMaterial((e=>this._context.stage.remove(e))),this._material=null,this._cimSymbolMaterials.clear(),this._cimSymbolTextures.forEach((e=>this._context.stage.remove(e))),this._cimSymbolTextures.clear(),this._releaseTexture=n(this._releaseTexture)}_getScaleFactor(e,t){if(this._drivenProperties.size&&e.size){for(let t=0;t<3;t++){const r=e.size[t];r&&"symbol-value"!==r&&"proportional"!==r&&(e.size[t]=m(r))}if("symbol-value"===e.size[0])return 1;if(isFinite(+e.size[0]))return+e.size[0]/t;if(isFinite(+e.size[2]))return+e.size[2]/t}return 1}createGraphics3DGraphic(e){const t=e.graphic;if(!this._validateGeometry(t.geometry))return null;let r,i;if(this._cimLayers){if(!this._cimLayers.length)return null;const e=this._generateTextureCIM(t),s={textureId:e.id,...this._cimMaterialParametersInfo};i=this._createMaterialAndAddToStage(s,this._context.stage),r=[e.params.width,e.params.height]}else r=this._size,i=l(this._material);const s=B(t.geometry);if(o(s))return this.logger.warn(`unsupported geometry type for icon symbol: ${t.geometry.type}`),null;const a=e.renderingInfo,n=this._getVertexOpacityAndColor(a);let c=1;if(!this._fastUpdates.enabled||!this._fastUpdates.visualVariables.size){const e=r[0]>r[1]?r[0]:r[1];c=this._getScaleFactor(a,e)}c*=this._symbolTextureRatio;const h=[r[0]*c,r[1]*c],m=this.setGraphicElevationContext(t,new D);return this.ensureDrapedStatus("on-the-ground"===m.mode)&&this._setDrapingDependentMaterialParameters(),this.draped?this._createAsOverlay(t,s,i,n,h,e.layer.uid):this._createAs3DShape(t,s,i,n,h,m,t.uid)}layerOpacityChanged(){const e=this._getFillColor(),t=this._getOutlineColor();return this._forEachMaterial((r=>{r.setParameters({color:e}),r.setParameters({outlineColor:t})})),!0}layerElevationInfoChanged(e,t,r){const i=this._elevationContext.mode,s=T(fe.elevationModeChangeTypes,r,i);if(s!==O.UPDATE)return s;const a=L(i)||"absolute-height"===i;return this.updateGraphics3DGraphicElevationInfo(e,t,(()=>a))}slicePlaneEnabledChanged(){return this.draped||this._forEachMaterial((e=>{e.setParameters({slicePlaneEnabled:this._context.slicePlaneEnabled})})),!0}physicalBasedRenderingChanged(){return!0}pixelRatioChanged(){return!!this._getPrimitive()}applyRendererDiff(e,t){for(const r in e.diff){if("visualVariables"!==r)return k.Recreate_Symbol;if(!X(this._fastUpdates,t,this._fastVisualVariableConvertOptions()))return k.Recreate_Symbol;s(this._material)&&this._material.setParameters(this._fastUpdates.materialParameters)}return k.Fast_Update}_defaultElevationInfoNoZ(){return xe}_createAs3DShape(e,t,r,i,s,a,o){const n=this.getFastUpdateAttrValues(e),l=n?e=>Y(this._fastUpdates.materialParameters,n,e):null,c=[re.createPointGeometry(ce,null,i,s,Se,null,n)],h=N(this._context,t,c,[r],a,this._context.layer.uid,o,l);if(null===h)return null;const m=new G(this,h.object,c,null,null,E,a);return m.alignedSampledElevation=h.sampledElevation,m.needsElevationUpdates=L(a.mode)||"absolute-height"===a.mode,m.getScreenSize=this._createScreenSizeGetter(s,l),m.calculateRelativeScreenBounds=e=>r.calculateRelativeScreenBounds(m.getScreenSize(),1,e),q(m,t,this._context.elevationProvider),m}_createAsOverlay(e,t,r,i,a,o){r.renderPriority=this._renderPriority;const n=z();P(t,n,this._context.overlaySR),n[2]=ee;const l=this._context.clippingExtent;if(s(l)&&!R(l,n))return null;const c=this.getFastUpdateAttrValues(e),h=c?e=>Y(this._fastUpdates.materialParameters,c,e):null,m=re.createPointGeometry(ce,n,i,a,null,null,c),u=new ie(m,r,o,e.uid);n[3]=0,S(u.boundingSphere,n),u.calculateShaderTransformation=h;const d=new F(this,[u],null);return d.getScreenSize=this._createScreenSizeGetter(a,h),d.calculateRelativeScreenBounds=e=>r.calculateRelativeScreenBounds(d.getScreenSize(),1,e),d}_createScreenSizeGetter(e,t){const r=this._outlineSize+2;if(this._fastUpdates.enabled){const i=e[0]/this._symbolTextureRatio,s=e[1]/this._symbolTextureRatio;return(e=y())=>{const a=t(le);return e[0]=a[0]*i+r,e[1]=a[5]*s+r,e}}{const t=e[0]/this._symbolTextureRatio+r,i=e[1]/this._symbolTextureRatio+r;return(e=y())=>(e[0]=t,e[1]=i,e)}}_fastVisualVariableConvertOptions(){const e=this._size[0]>this._size[1]?this._size[0]:this._size[1],t=x(e,e,e),r=u(1),i=e*r;return{modelSize:t,symbolSize:x(i,i,i),unitInMeters:r,transformation:{anchor:g,scale:b,rotation:g}}}_getGraphicHash(e){let t="";for(const r of this._cimRequiredFields)t+=r+e.attributes[r];return t}_forEachMaterial(e){s(this._material)&&e(this._material),this._cimSymbolMaterials.forEach(e)}}function ye(e){return e&&"point-3d"===e.type&&e.hasVisibleVerticalOffset()}function ge(e){return!!s(e)&&("cross"===e||"x"===e)}function be(e){let t;const r=ue,i=r*de;switch(e){case"circle":t=K(r,i);break;case"square":t=J(r,i);break;case"kite":t=$(r,i);break;case"cross":t=Z(r,i);break;case"x":t=W(r,i);break;case"triangle":t=H(r,i)}return new se(t,{mipmap:!1,wrap:{s:oe.CLAMP_TO_EDGE,t:oe.CLAMP_TO_EDGE},width:ue,height:ue,components:4,noUnpackFlip:!0})}fe.PRIMITIVE_SIZE=pe,fe.elevationModeChangeTypes={definedChanged:O.UPDATE,staysOnTheGround:O.NONE,onTheGroundChanged:O.RECREATE};const xe={mode:"relative-to-ground",offset:0},Se=v(0,0,0,1);export{fe as Graphics3DIconSymbolLayer,fe as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../../Color.js";import"../../../../core/has.js";import{isSome as t,isNone as r,unwrapOr as a,get as o}from"../../../../core/maybe.js";import{f as s,t as n}from"../../../../chunks/mat3.js";import{c as i}from"../../../../chunks/mat3f64.js";import{f as l,m as c,a as u}from"../../../../chunks/mat4.js";import{b as m,c as h}from"../../../../chunks/mat4f64.js";import{b as f,a as p,d,n as g,f as x,c as _}from"../../../../chunks/vec3.js";import{Z as y,O as b,c as v}from"../../../../chunks/vec3f64.js";import{O as T}from"../../../../chunks/vec4f64.js";import{projectVectorToDehydratedPoint as C,projectBuffer as O,computeTranslationToOriginAndRotation as A,canProjectWithoutEngine as M}from"../../../../geometry/projection.js";import{create as E,empty as w,expandWithBuffer as N,intersectsClippingArea as j}from"../../../../geometry/support/aaBoundingBox.js";import R from"../../../../geometry/support/MeshComponent.js";import P from"../../../../geometry/support/MeshMaterialMetallicRoughness.js";import{BufferViewVec3f64 as I,BufferViewVec3f as B}from"../../../../geometry/support/buffer/BufferView.js";import{t as F,a as S}from"../../../../chunks/vec32.js";import{transformPosition as L,transformNormal as U,projectNormalToPCPF as V,transformTangent as G,projectTangentToPCPF as $}from"../../../../geometry/support/meshUtils/projection.js";import{makeDehydratedPoint as D}from"../../../../layers/graphics/dehydratedFeatures.js";import{ViewingMode as k}from"../../../ViewingMode.js";import{perObjectElevationAligner as z}from"./ElevationAligners.js";import{needsElevationUpdates3D as q}from"./elevationAlignmentUtils.js";import{ElevationContext as H}from"./ElevationContext.js";import{Graphics3DObject3DGraphicLayer as W}from"./Graphics3DObject3DGraphicLayer.js";import{Graphics3DSymbolLayer as Y}from"./Graphics3DSymbolLayer.js";import{createMaterial as Z}from"../support/edgeUtils.js";import{parseColorMixMode as J,encodeSymbolColor as K}from"../support/symbolColorUtils.js";import Q from"../../support/debugFlags.js";import{AlphaDiscardMode as X,CullFaceOptions as ee,VertexAttribute as te,PrimitiveType as re}from"../../webgl-engine/lib/basicInterfaces.js";import{Geometry as ae}from"../../webgl-engine/lib/Geometry.js";import{generateDefaultIndexArray as oe}from"../../webgl-engine/lib/geometryDataUtils.js";import{Object3D as se}from"../../webgl-engine/lib/Object3D.js";import{Texture as ne}from"../../webgl-engine/lib/Texture.js";import{DefaultMaterial as ie}from"../../webgl-engine/materials/DefaultMaterial.js";import{NativeLineMaterial as le}from"../../webgl-engine/materials/NativeLineMaterial.js";import{TextureWrapMode as ce}from"../../../webgl/enums.js";const ue=["mesh"];class me extends Y{constructor(e,t,r,a){super(e,t,r,a),this._materials=new Map,this._textures=new Map,this.ensureDrapedStatus(!1)}async doLoad(){Q.DRAW_MESH_GEOMETRY_NORMALS&&(this._debugVertexNormalMaterial=new le({color:[1,0,1,1]}),this._debugFaceNormalMaterial=new le({color:[0,1,1,1]}))}destroy(){super.destroy(),this._context.stage.removeMany(Array.from(this._materials.values(),(e=>e.material))),this._context.stage.removeMany(Array.from(this._textures.values())),this._materials.clear(),this._textures.clear()}createGraphics3DGraphic(e){const t=e.graphic;if(!this._validateGeometry(t.geometry,ue,"fill on mesh-3d"))return null;const r=this.setGraphicElevationContext(t,new H),a=e.renderingInfo;return this._createAs3DShape(t,a,r,t.uid)}layerOpacityChanged(e,r){const a=this._getLayerOpacity();return this._materials.forEach((e=>{e.material.setParameters({layerOpacity:a});const t=e.material.parameters;this._setMaterialTransparentParameter(t,e),e.material.setParameters({transparent:t.transparent})})),e.forEach((e=>{const o=r(e);t(o)&&o.layerOpacityChanged(a,this._context.isAsync)})),!0}layerElevationInfoChanged(e,t){return this.updateGraphics3DGraphicElevationInfo(e,t,q)}slicePlaneEnabledChanged(e,r){return this._materials.forEach((e=>{e.material.setParameters({slicePlaneEnabled:this._context.slicePlaneEnabled})})),e.forEach((e=>{const a=r(e);t(a)&&a.slicePlaneEnabledChanged(this._context.slicePlaneEnabled,this._context.isAsync)})),!0}physicalBasedRenderingChanged(){const e=this._usePBR();return this._materials.forEach((t=>t.material.setParameters({usePBR:e}))),!0}pixelRatioChanged(){return!0}_requiresSymbolVertexColors(){return this._drivenProperties.color||this._drivenProperties.opacity}_colorOrTextureUid(t){return r(t)?"-":t instanceof e?t.toHex():t.contentHash}_materialPropertiesDefault(e,t){const r=this._requiresSymbolVertexColors(),a=!!e.vertexAttributes.color,o=!!e.vertexAttributes.tangent;return{hasSymbolVertexColors:r,hasVertexColors:a,hasVertexTangents:o,uid:`vc:${a},vt:${o},vct${t},svc:${r}`}}_materialProperties(e,t,r){const a=this._materialPropertiesDefault(e,r);if(!t.material)return a;const{color:o,colorTexture:s,normalTexture:n,doubleSided:i,alphaCutoff:l,alphaMode:c}=t.material,u=this._colorOrTextureUid(o),m=this._colorOrTextureUid(s),h=this._colorOrTextureUid(n);if(a.color=o,a.colorTexture=s,a.normalTexture=n,a.uid=`${a.uid},cmuid:${u},ctmuid:${m},ntmuid:${h},ds:${i},ac:${l},am:${c}`,t.material instanceof P){const{metallic:e,roughness:r,metallicRoughnessTexture:o,emissiveColor:s,emissiveTexture:n,occlusionTexture:i}=t.material,l=this._colorOrTextureUid(o),c=this._colorOrTextureUid(s),u=this._colorOrTextureUid(n),m=this._colorOrTextureUid(i);a.metallic=e,a.roughness=r,a.metallicRoughnessTexture=o,a.emissiveColor=s,a.emissiveTexture=n,a.occlusionTexture=i,a.uid=`${a.uid},mrm:${e},mrr:${r},mrt:${l},emuid:${c},etmuid:${u},otmuid:${m}`}return 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 r=this._getInternalTexture(e,X.Opaque);return t(r)?r.id:null}_getInternalTexture(e,t){const r=this._getLoadableTextureResource(e);if(!r)return null;const a=`${e.contentHash}/${t}`;let o=this._textures.get(a);return o||(o=new ne(r,{mipmap:!0,wrap:this._castTextureWrap(e.wrap),noUnpackFlip:!0,preMultiplyAlpha:t!==X.Opaque}),this._textures.set(a,o),this._context.stage.add(o),this._context.stage.loadImmediate(o)),o}_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 ce.CLAMP_TO_EDGE;case"mirror":return ce.MIRRORED_REPEAT;default:return ce.REPEAT}}_setInternalMaterialParameters(r,a){if(t(r.color)&&this._setInternalColorValueParameters(r.color,a),t(r.colorTexture)){const e=this._getInternalTexture(r.colorTexture,a.textureAlphaMode);t(e)?(a.textureId=e.id,a.textureAlphaPremultiplied=!!e.params.preMultiplyAlpha):a.textureId=void 0}t(r.normalTexture)&&(a.normalTextureId=this._getInternalTextureId(r.normalTexture)),t(r.emissiveColor)&&(a.emissiveFactor=e.toUnitRGB(r.emissiveColor)),t(r.emissiveTexture)&&(a.emissiveTextureId=this._getInternalTextureId(r.emissiveTexture)),t(r.occlusionTexture)&&(a.occlusionTextureId=this._getInternalTextureId(r.occlusionTexture)),t(r.metallicRoughnessTexture)&&(a.metallicRoughnessTextureId=this._getInternalTextureId(r.metallicRoughnessTexture))}_setExternalMaterialParameters(r){const a=this._drivenProperties.color;let o=t(this.symbolLayer.material)?this.symbolLayer.material.colorMixMode:null;if(a)r.externalColor=T;else{const a=t(this.symbolLayer.material)?this.symbolLayer.material.color:null;t(a)?r.externalColor=e.toUnitRGBA(a):(o=null,r.externalColor=T)}o&&(r.colorMixMode=o),r.castShadows=!!this.symbolLayer.castShadows}_hasTransparentVertexColors(e){const t=e.vertexAttributes.color;if(r(t))return!1;for(let r=3;r<t.length;r+=4)if(255!==t[r])return!0;return!1}_getOrCreateMaterial(e,r){var a,o,s;const n=null==(a=r.material)?void 0:a.color,i=null==(o=r.material)?void 0:o.colorTexture,l=null==(s=r.material)?void 0:s.alphaMode,c="blend"===l,u=!("opaque"===l)&&(this._hasTransparentVertexColors(e)||t(n)&&n.a<1||t(i)&&i.transparent||c),m=this._materialProperties(e,r,u),h=this._materials.get(m.uid);if(h)return h.material;const f={material:null,isComponentTransparent:u,alphaMode:r.material?r.material.alphaMode:"opaque"},p=null==m.metallicRoughnessTexture&&null==m.metallic&&null==m.roughness,d={usePBR:this._usePBR(),isSchematic:p,vertexColors:m.hasVertexColors,symbolColors:m.hasSymbolVertexColors,vertexTangents:m.hasVertexTangents,ambient:y,diffuse:b,opacity:1,doubleSided:!0,doubleSidedType:"winding-order",cullFace:ee.None,layerOpacity:this._getLayerOpacity(),slicePlaneEnabled:this._context.slicePlaneEnabled,initTextureTransparent:!0};p||(d.mrrFactors=[null!=m.metallic?m.metallic:1,null!=m.roughness?m.roughness:1,.5]),r.material&&(d.doubleSided=r.material.doubleSided,d.cullFace=r.material.doubleSided?ee.None:ee.Back,d.textureAlphaCutoff=r.material.alphaCutoff),this._setExternalMaterialParameters(d),this._setMaterialTransparentParameter(d,f),this._setInternalMaterialParameters(m,d);const g=new ie(d);return f.material=g,this._materials.set(m.uid,f),this._context.stage.add(g),g}_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?X.MaskBlend:X.Opaque:e.textureAlphaMode="opaque"===t.alphaMode?X.Opaque:"mask"===t.alphaMode?X.Mask:X.Blend}_addDebugNormals(e,t,r,a){const o=t.length,s=e.spatialReference.isGeographic?20015077/180:1,n=.1*Math.max(e.extent.width*s,e.extent.height*s,e.extent.zmax-e.extent.zmin),i=[],l=[],c=[],u=[];for(let m=0;m<o;m++){const e=t[m],r=e.vertexAttributes.get(te.POSITION),a=e.vertexAttributes.get(te.NORMAL),o=e.indices.get(te.POSITION),s=e.indices.get(te.NORMAL),h=r.data,d=a.data;for(let t=0;t<o.length;t++){const e=3*o[t],r=3*s[t];for(let t=0;t<3;t++)i.push(h[e+t]);for(let t=0;t<3;t++)i.push(h[e+t]+d[r+t]*n);if(l.push(l.length),l.push(l.length),t%3==0){this._calculateFaceNormal(h,o,t,ge),this._getFaceVertices(h,o,t,fe,pe,de),f(fe,fe,pe),f(fe,fe,de),p(fe,fe,1/3);for(let e=0;e<3;e++)c.push(fe[e]);for(let e=0;e<3;e++)c.push(fe[e]+ge[e]*n);u.push(u.length),u.push(u.length)}}}const h=new ae([[te.POSITION,{data:i,size:3,exclusive:!0}]],[[te.POSITION,new Uint32Array(l)]],re.Line);t.push(h),r.push(this._debugVertexNormalMaterial),a.push(m(a[0]));const d=new ae([[te.POSITION,{data:c,size:3,exclusive:!0}]],[[te.POSITION,new Uint32Array(u)]],re.Line);t.push(d),r.push(this._debugFaceNormalMaterial),a.push(m(a[0]))}_createAs3DShape(e,r,a,o){const s=e.geometry;if("mesh"!==s.type)return null;const n=this._createGeometryInfo(s,r);if(!n)return null;const{geometries:i,materials:l,transformations:c,objectTransformation:u}=n;Q.DRAW_MESH_GEOMETRY_NORMALS&&this._addDebugNormals(s,i,l,c);const m=new se({geometries:i,materials:l,transformations:c,metadata:{layerUid:this._context.layer.uid,graphicUid:o}});m.transformation=u;const h=this._createEdgeMaterial(),f=t(h)?{baseMaterial:l[0],edgeMaterials:[h],properties:{mergeGeometries:!0,slicePlaneEnabled:this._context.slicePlaneEnabled}}:null,p=new W(this,m,i,null,null,z,a,f);return p.needsElevationUpdates=q(a.mode),p.useObjectOriginAsAttachmentOrigin=!0,p.elevationContext.centerPointInElevationSR=this._getCenterPointInElevationSR(m),p.alignedSampledElevation=z(p,p.elevationContext,this._context.elevationProvider,this._context.renderCoordsHelper),p}_getCenterPointInElevationSR(e){const t=D(0,0,0,this._context.elevationProvider.spatialReference);return C([e.transformation[12],e.transformation[13],e.transformation[14]],this._context.renderCoordsHelper.spatialReference,t),t}_createComponentNormals(e,t,r,a){switch(r.shading||"flat"){case"source":return this._createComponentNormalsSource(e,t,r,a);case"flat":return this._createComponentNormalsFlat(e,a);case"smooth":return this._createComponentNormalsSmooth(e,a);default:return}}_createComponentNormalsSource(e,t,a,o){if(r(t))return this._createComponentNormalsFlat(e,o);let s=!1;if(!a.trustSourceNormals)for(let r=0;r<o.length;r+=3){this._calculateFaceNormal(e,o,r,ge);for(let e=0;e<3;e++){const a=3*o[r+e];fe[0]=t[a+0],fe[1]=t[a+1],fe[2]=t[a+2],d(ge,fe)<0&&(t[a+0]=-t[a+0],t[a+1]=-t[a+1],t[a+2]=-t[a+2],s=!0)}}return{normals:t,indices:o,didFlipNormals:s}}_createComponentNormalsFlat(e,t){const r=new Float32Array(t.length),a=new Uint32Array(3*t.length);for(let o=0;o<t.length;o+=3){const s=this._calculateFaceNormal(e,t,o,ge);for(let e=0;e<3;e++)r[o+e]=s[e],a[o+e]=o/3}return{normals:r,indices:a,didFlipNormals:!1}}_createComponentNormalsSmooth(e,t){const r={};for(let s=0;s<t.length;s+=3){const a=this._calculateFaceNormal(e,t,s,ge);for(let e=0;e<3;e++){const o=t[s+e];let n=r[o];n||(n={normal:v(),count:0},r[o]=n),f(n.normal,n.normal,a),n.count++}}const a=new Float32Array(3*t.length),o=new Uint32Array(3*t.length);for(let s=0;s<t.length;s++){const e=r[t[s]];1!==e.count&&(g(e.normal,e.normal),e.count=1);for(let t=0;t<3;t++)a[3*s+t]=e.normal[t];o[s]=s}return{normals:a,indices:o,didFlipNormals:!1}}_getFaceVertices(e,t,r,a,o,s){const n=3*t[r+0],i=3*t[r+1],l=3*t[r+2];a[0]=e[n+0],a[1]=e[n+1],a[2]=e[n+2],o[0]=e[i+0],o[1]=e[i+1],o[2]=e[i+2],s[0]=e[l+0],s[1]=e[l+1],s[2]=e[l+2]}_calculateFaceNormal(e,t,r,a){return this._getFaceVertices(e,t,r,fe,pe,de),x(pe,pe,fe),x(de,de,fe),_(fe,pe,de),g(a,fe),a}_getOrCreateComponents(e){return a(e.components,be)}_createPositionBuffer(e,r){let a=e.vertexAttributes.position;const o=r.reprojection===ve.ECEF?r.transformBeforeProject:null;if(t(o)&&(a=L(a,new Float64Array(a.length),o)),r.reprojection===ve.NONE)return r.needsBufferCopy?new Float64Array(a):a;const s=t(o)?a:new Float64Array(a.length);return O(a,e.spatialReference,0,s,this._context.renderCoordsHelper.spatialReference,0,a.length/3),s}_createNormalBuffer(e,a,o){let s=e.vertexAttributes.normal;if(r(s))return null;const n=o.reprojection===ve.ECEF?o.transformBeforeProject:null;t(n)&&(s=U(s,new Float32Array(s.length),n));if("local"===this._context.layerView.view.viewingMode||o.reprojection===ve.NONE)return o.needsBufferCopy&&e.vertexAttributes.normal===s?new Float32Array(s):s;const i=e.vertexAttributes.position,l=t(n)?s:new Float32Array(s.length);return V(s,i,a,e.spatialReference,l)}_createTangentBuffer(e,a,o){let s=e.vertexAttributes.tangent;if(r(s))return null;const n=o.reprojection===ve.ECEF?o.transformBeforeProject:null;t(n)&&(s=G(s,new Float32Array(s.length),n));if("local"===this._context.layerView.view.viewingMode||o.reprojection===ve.NONE)return o.needsBufferCopy&&e.vertexAttributes.normal===s?new Float32Array(s):s;const i=e.vertexAttributes.position,l=t(n)?s:new Float32Array(s.length);return $(s,i,a,e.spatialReference,l)}_createColorBuffer(e){return e.vertexAttributes.color}_createSymbolColorBuffer(e){if(this._requiresSymbolVertexColors()){const t=this._getVertexOpacityAndColor(e),r=J(o(this.symbolLayer,"material","colorMixMode")),a=new Uint8Array(4);return K(t,r,a),a}return null}_createBuffers(e,r){const a=e.vertexAttributes&&e.vertexAttributes.position;if(!a)return this.logger.warn("Mesh geometry must contain position vertex attributes"),null;const o=e.vertexAttributes.normal,s=e.vertexAttributes.uv,n=e.vertexAttributes.tangent;if(t(o)&&o.length!==a.length)return this.logger.warn("Mesh normal vertex buffer must contain the same number of elements as the position buffer"),null;if(t(n)&&n.length/4!=a.length/3)return this.logger.warn("Mesh tangent vertex buffer must contain the same number of elements as the position buffer"),null;if(t(s)&&s.length/2!=a.length/3)return this.logger.warn("Mesh uv vertex buffer must contain the same number of elements as the position buffer"),null;const i=this._computeReprojectionInfo(e),l=this._createPositionBuffer(e,i),c=this._createColorBuffer(e),u=this._createSymbolColorBuffer(r),m=this._createNormalBuffer(e,l,i),f=this._createTangentBuffer(e,l,i);return{positionBuffer:l,normalBuffer:m,tangentBuffer:f,uvBuffer:s,colorBuffer:c,symbolColorBuffer:u,objectTransformation:i.reprojection===ve.NONE&&t(i.objectTransformation)?i.objectTransformation:this._transformOriginLocal(e,l,m,f),geometryTransformation:i.reprojection===ve.NONE&&t(i.geometryTransformation)?i.geometryTransformation:h()}}_computeReprojectionInfo(e){const r=t(e.transform),a=r&&e.transform.geographic||this._context.renderCoordsHelper.viewingMode===k.Local?ve.NONE:ve.ECEF;if(r){if(a===ve.NONE){const t=h();A(e.spatialReference,e.transform.origin,t,this._context.renderCoordsHelper.spatialReference);return{reprojection:a,objectTransformation:t,geometryTransformation:m(e.transform.localMatrix),needsBufferCopy:!1}}const t=l(h(),e.transform.origin);return c(t,t,e.transform.localMatrix),{reprojection:a,transformBeforeProject:t,needsBufferCopy:!0}}return{reprojection:a,needsBufferCopy:!0}}_transformOriginLocal(e,r,a,o){const i=this._context.renderCoordsHelper.spatialReference,l=e.anchor;he[0]=l.x,he[1]=l.y,he[2]=l.z;const c=h();A(e.spatialReference,he,c,i);const m=I.fromTypedArray(r);if(u(xe,c),F(m,m,xe),t(a)||t(o)){if(s(_e,c),n(_e,_e),t(a)){const e=B.fromTypedArray(a);S(e,e,_e)}if(t(o)){const e=B.fromTypedArray(o,4*o.BYTES_PER_ELEMENT);S(e,e,_e)}}return c}_validateFaces(e,t){const r=e.vertexAttributes.position.length/3,a=t.faces;if(a){let e=-1;for(let t=0;t<a.length;t++){const r=a[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?t.faces:oe(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 a;const o=t.length/3;return e.spatialReference.equals(r)?a=t:(a=new Float64Array(t.length),O(e.vertexAttributes.position,e.spatialReference,0,a,r,0,o)),w(ye),N(ye,a,0,o),!j(ye,this._context.clippingExtent)}_createGeometryInfo(e,a){if(!M(e.spatialReference,this._context.layerView.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,a);if(r(o))return null;const{positionBuffer:s,uvBuffer:n,colorBuffer:i,symbolColorBuffer:l,normalBuffer:c,tangentBuffer:u,objectTransformation:m,geometryTransformation:h}=o,f=this._getOrCreateComponents(e),p=[],d=[],g=[];let x=!1;for(const r of f){if(!this._validateFaces(e,r))return null;const a=this._getOrCreateFaces(e,r);if(0===a.length)continue;const o=this._createComponentNormals(s,c,r,a);o.didFlipNormals&&(x=!0);const m=[[te.POSITION,{size:3,data:s,exclusive:!0}],[te.NORMAL,{size:3,data:o.normals,exclusive:!0}]],f=[[te.POSITION,a],[te.NORMAL,o.indices]];t(i)&&(m.push([te.COLOR,{size:4,data:i,exclusive:!0}]),f.push([te.COLOR,a])),t(l)&&(m.push([te.SYMBOLCOLOR,{size:4,data:l,exclusive:!0}]),f.push([te.SYMBOLCOLOR,new Uint16Array(a.length)])),t(n)&&(m.push([te.UV0,{size:2,data:n,exclusive:!0}]),f.push([te.UV0,a])),t(u)&&(m.push([te.TANGENT,{size:4,data:u,exclusive:!0}]),f.push([te.TANGENT,a]));const _=new ae(m,f);p.push(_),d.push(h),g.push(this._getOrCreateMaterial(e,r))}return x&&this.logger.warn("Normals have been automatically flipped to be consistent with the counter clock wise face winding order. It is better to generate mesh geometries that have consistent normals."),{geometries:p,transformations:d,materials:g,objectTransformation:m}}_createEdgeMaterial(){const e={opacity:this._getLayerOpacity()};return Z(this.symbolLayer,e)}}const he=v(),fe=v(),pe=v(),de=v(),ge=v(),xe=h(),_e=i(),ye=E(),be=[new R];var ve;!function(e){e[e.NONE=0]="NONE",e[e.ECEF=1]="ECEF"}(ve||(ve={}));export{me as Graphics3DMeshFillSymbolLayer,me as default};
5
+ import e from"../../../../Color.js";import"../../../../core/has.js";import{isSome as t,isNone as r,unwrapOr as a,get as o}from"../../../../core/maybe.js";import{f as s,t as n}from"../../../../chunks/mat3.js";import{c as i}from"../../../../chunks/mat3f64.js";import{f as l,m as c,a as u}from"../../../../chunks/mat4.js";import{b as m,c as h}from"../../../../chunks/mat4f64.js";import{b as p,a as f,d,n as g,f as x,c as _}from"../../../../chunks/vec3.js";import{Z as y,O as b,c as v}from"../../../../chunks/vec3f64.js";import{O as T}from"../../../../chunks/vec4f64.js";import{projectVectorToDehydratedPoint as C,projectBuffer as O,computeTranslationToOriginAndRotation as A,canProjectWithoutEngine as M}from"../../../../geometry/projection.js";import{create as E,empty as w,expandWithBuffer as N,intersectsClippingArea as j}from"../../../../geometry/support/aaBoundingBox.js";import R from"../../../../geometry/support/MeshComponent.js";import P from"../../../../geometry/support/MeshMaterialMetallicRoughness.js";import{BufferViewVec3f64 as I,BufferViewVec3f as B}from"../../../../geometry/support/buffer/BufferView.js";import{t as F,a as S}from"../../../../chunks/vec32.js";import{transformPosition as L,transformNormal as U,projectNormalToPCPF as V,transformTangent as G,projectTangentToPCPF as $}from"../../../../geometry/support/meshUtils/projection.js";import{makeDehydratedPoint as D}from"../../../../layers/graphics/dehydratedFeatures.js";import{ViewingMode as k}from"../../../ViewingMode.js";import{perObjectElevationAligner as z}from"./ElevationAligners.js";import{needsElevationUpdates3D as q}from"./elevationAlignmentUtils.js";import{ElevationContext as H}from"./ElevationContext.js";import{Graphics3DObject3DGraphicLayer as W}from"./Graphics3DObject3DGraphicLayer.js";import{Graphics3DSymbolLayer as Y}from"./Graphics3DSymbolLayer.js";import{createMaterial as Z}from"../support/edgeUtils.js";import{parseColorMixMode as J,encodeSymbolColor as K}from"../support/symbolColorUtils.js";import Q from"../../support/debugFlags.js";import{AlphaDiscardMode as X,CullFaceOptions as ee,VertexAttribute as te,PrimitiveType as re}from"../../webgl-engine/lib/basicInterfaces.js";import{Geometry as ae}from"../../webgl-engine/lib/Geometry.js";import{generateDefaultIndexArray as oe}from"../../webgl-engine/lib/geometryDataUtils.js";import{Object3D as se}from"../../webgl-engine/lib/Object3D.js";import{Texture as ne}from"../../webgl-engine/lib/Texture.js";import{DefaultMaterial as ie}from"../../webgl-engine/materials/DefaultMaterial.js";import{NativeLineMaterial as le}from"../../webgl-engine/materials/NativeLineMaterial.js";import{TextureWrapMode as ce}from"../../../webgl/enums.js";const ue=["mesh"];class me extends Y{constructor(e,t,r,a){super(e,t,r,a),this._materials=new Map,this._textures=new Map,this.ensureDrapedStatus(!1)}async doLoad(){Q.DRAW_MESH_GEOMETRY_NORMALS&&(this._debugVertexNormalMaterial=new le({color:[1,0,1,1]}),this._debugFaceNormalMaterial=new le({color:[0,1,1,1]}))}destroy(){super.destroy(),this._context.stage.removeMany(Array.from(this._materials.values(),(e=>e.material))),this._context.stage.removeMany(Array.from(this._textures.values())),this._materials.clear(),this._textures.clear()}createGraphics3DGraphic(e){const t=e.graphic;if(!this._validateGeometry(t.geometry,ue,"fill on mesh-3d"))return null;const r=this.setGraphicElevationContext(t,new H),a=e.renderingInfo;return this._createAs3DShape(t,a,r,t.uid)}layerOpacityChanged(e,r){const a=this._getLayerOpacity();return this._materials.forEach((e=>{e.material.setParameters({layerOpacity:a});const t=e.material.parameters;this._setMaterialTransparentParameter(t,e),e.material.setParameters({transparent:t.transparent})})),e.forEach((e=>{const o=r(e);t(o)&&o.layerOpacityChanged(a,this._context.isAsync)})),!0}layerElevationInfoChanged(e,t){return this.updateGraphics3DGraphicElevationInfo(e,t,q)}slicePlaneEnabledChanged(e,r){return this._materials.forEach((e=>{e.material.setParameters({slicePlaneEnabled:this._context.slicePlaneEnabled})})),e.forEach((e=>{const a=r(e);t(a)&&a.slicePlaneEnabledChanged(this._context.slicePlaneEnabled,this._context.isAsync)})),!0}physicalBasedRenderingChanged(){const e=this._usePBR();return this._materials.forEach((t=>t.material.setParameters({usePBR:e}))),!0}pixelRatioChanged(){return!0}_requiresSymbolVertexColors(){return this._drivenProperties.color||this._drivenProperties.opacity}_colorOrTextureUid(t){return r(t)?"-":t instanceof e?t.toHex():t.contentHash}_materialPropertiesDefault(e,t){const r=this._requiresSymbolVertexColors(),a=!!e.vertexAttributes.color,o=!!e.vertexAttributes.tangent;return{hasSymbolVertexColors:r,hasVertexColors:a,hasVertexTangents:o,uid:`vc:${a},vt:${o},vct${t},svc:${r}`}}_materialProperties(e,t,r){const a=this._materialPropertiesDefault(e,r);if(!t.material)return a;const{color:o,colorTexture:s,normalTexture:n,doubleSided:i,alphaCutoff:l,alphaMode:c}=t.material,u=this._colorOrTextureUid(o),m=this._colorOrTextureUid(s),h=this._colorOrTextureUid(n);if(a.color=o,a.colorTexture=s,a.normalTexture=n,a.uid=`${a.uid},cmuid:${u},ctmuid:${m},ntmuid:${h},ds:${i},ac:${l},am:${c}`,t.material instanceof P){const{metallic:e,roughness:r,metallicRoughnessTexture:o,emissiveColor:s,emissiveTexture:n,occlusionTexture:i}=t.material,l=this._colorOrTextureUid(o),c=this._colorOrTextureUid(s),u=this._colorOrTextureUid(n),m=this._colorOrTextureUid(i);a.metallic=e,a.roughness=r,a.metallicRoughnessTexture=o,a.emissiveColor=s,a.emissiveTexture=n,a.occlusionTexture=i,a.uid=`${a.uid},mrm:${e},mrr:${r},mrt:${l},emuid:${c},etmuid:${u},otmuid:${m}`}return 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 r=this._getInternalTexture(e,X.Opaque);return t(r)?r.id:null}_getInternalTexture(e,t){const r=this._getLoadableTextureResource(e);if(!r)return null;const a=`${e.contentHash}/${t}`;let o=this._textures.get(a);return o||(o=new ne(r,{mipmap:!0,wrap:this._castTextureWrap(e.wrap),noUnpackFlip:!0,preMultiplyAlpha:t!==X.Opaque}),this._textures.set(a,o),this._context.stage.add(o),this._context.stage.loadImmediate(o)),o}_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 ce.CLAMP_TO_EDGE;case"mirror":return ce.MIRRORED_REPEAT;default:return ce.REPEAT}}_setInternalMaterialParameters(r,a){if(t(r.color)&&this._setInternalColorValueParameters(r.color,a),t(r.colorTexture)){const e=this._getInternalTexture(r.colorTexture,a.textureAlphaMode);t(e)?(a.textureId=e.id,a.textureAlphaPremultiplied=!!e.params.preMultiplyAlpha):a.textureId=void 0}t(r.normalTexture)&&(a.normalTextureId=this._getInternalTextureId(r.normalTexture)),t(r.emissiveColor)&&(a.emissiveFactor=e.toUnitRGB(r.emissiveColor)),t(r.emissiveTexture)&&(a.emissiveTextureId=this._getInternalTextureId(r.emissiveTexture)),t(r.occlusionTexture)&&(a.occlusionTextureId=this._getInternalTextureId(r.occlusionTexture)),t(r.metallicRoughnessTexture)&&(a.metallicRoughnessTextureId=this._getInternalTextureId(r.metallicRoughnessTexture))}_setExternalMaterialParameters(r){const a=this._drivenProperties.color;let o=t(this.symbolLayer.material)?this.symbolLayer.material.colorMixMode:null;if(a)r.externalColor=T;else{const a=t(this.symbolLayer.material)?this.symbolLayer.material.color:null;t(a)?r.externalColor=e.toUnitRGBA(a):(o=null,r.externalColor=T)}o&&(r.colorMixMode=o),r.castShadows=!!this.symbolLayer.castShadows}_hasTransparentVertexColors(e){const t=e.vertexAttributes.color;if(r(t))return!1;for(let r=3;r<t.length;r+=4)if(255!==t[r])return!0;return!1}_getOrCreateMaterial(e,r){var a,o,s;const n=null==(a=r.material)?void 0:a.color,i=null==(o=r.material)?void 0:o.colorTexture,l=null==(s=r.material)?void 0:s.alphaMode,c="blend"===l,u=!("opaque"===l)&&(this._hasTransparentVertexColors(e)||t(n)&&n.a<1||t(i)&&i.transparent||c),m=this._materialProperties(e,r,u),h=this._materials.get(m.uid);if(h)return h.material;const p={material:null,isComponentTransparent:u,alphaMode:r.material?r.material.alphaMode:"opaque"},f=null==m.metallicRoughnessTexture&&null==m.metallic&&null==m.roughness,d={usePBR:this._usePBR(),isSchematic:f,vertexColors:m.hasVertexColors,symbolColors:m.hasSymbolVertexColors,vertexTangents:m.hasVertexTangents,ambient:y,diffuse:b,opacity:1,doubleSided:!0,doubleSidedType:"winding-order",cullFace:ee.None,layerOpacity:this._getLayerOpacity(),slicePlaneEnabled:this._context.slicePlaneEnabled,initTextureTransparent:!0};f||(d.mrrFactors=[null!=m.metallic?m.metallic:1,null!=m.roughness?m.roughness:1,.5]),r.material&&(d.doubleSided=r.material.doubleSided,d.cullFace=r.material.doubleSided?ee.None:ee.Back,d.textureAlphaCutoff=r.material.alphaCutoff),this._setExternalMaterialParameters(d),this._setMaterialTransparentParameter(d,p),this._setInternalMaterialParameters(m,d);const g=new ie(d);return p.material=g,this._materials.set(m.uid,p),this._context.stage.add(g),g}_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?X.MaskBlend:X.Opaque:e.textureAlphaMode="opaque"===t.alphaMode?X.Opaque:"mask"===t.alphaMode?X.Mask:X.Blend}_addDebugNormals(e,t,r,a){const o=t.length,s=e.spatialReference.isGeographic?20015077/180:1,n=.1*Math.max(e.extent.width*s,e.extent.height*s,e.extent.zmax-e.extent.zmin),i=[],l=[],c=[],u=[];for(let m=0;m<o;m++){const e=t[m],r=e.vertexAttributes.get(te.POSITION),a=e.vertexAttributes.get(te.NORMAL),o=e.indices.get(te.POSITION),s=e.indices.get(te.NORMAL),h=r.data,d=a.data;for(let t=0;t<o.length;t++){const e=3*o[t],r=3*s[t];for(let t=0;t<3;t++)i.push(h[e+t]);for(let t=0;t<3;t++)i.push(h[e+t]+d[r+t]*n);if(l.push(l.length),l.push(l.length),t%3==0){this._calculateFaceNormal(h,o,t,ge),this._getFaceVertices(h,o,t,pe,fe,de),p(pe,pe,fe),p(pe,pe,de),f(pe,pe,1/3);for(let e=0;e<3;e++)c.push(pe[e]);for(let e=0;e<3;e++)c.push(pe[e]+ge[e]*n);u.push(u.length),u.push(u.length)}}}const h=new ae([[te.POSITION,{data:i,size:3,exclusive:!0}]],[[te.POSITION,new Uint32Array(l)]],re.Line);t.push(h),r.push(this._debugVertexNormalMaterial),a.push(m(a[0]));const d=new ae([[te.POSITION,{data:c,size:3,exclusive:!0}]],[[te.POSITION,new Uint32Array(u)]],re.Line);t.push(d),r.push(this._debugFaceNormalMaterial),a.push(m(a[0]))}_createAs3DShape(e,r,a,o){const s=e.geometry;if("mesh"!==s.type)return null;const n=this._createGeometryInfo(s,r);if(!n)return null;const{geometries:i,materials:l,transformations:c,objectTransformation:u}=n;Q.DRAW_MESH_GEOMETRY_NORMALS&&this._addDebugNormals(s,i,l,c);const m=new se({geometries:i,materials:l,transformations:c,metadata:{layerUid:this._context.layer.uid,graphicUid:o}});m.transformation=u;const h=this._createEdgeMaterial(),p=t(h)?{baseMaterial:l[0],edgeMaterials:[h],properties:{mergeGeometries:!0,slicePlaneEnabled:this._context.slicePlaneEnabled}}:null,f=new W(this,m,i,null,null,z,a,p);return f.needsElevationUpdates=q(a.mode),f.useObjectOriginAsAttachmentOrigin=!0,f.elevationContext.centerPointInElevationSR=this._getCenterPointInElevationSR(m),f.alignedSampledElevation=z(f,f.elevationContext,this._context.elevationProvider,this._context.renderCoordsHelper),f}_getCenterPointInElevationSR(e){const t=D(0,0,0,this._context.elevationProvider.spatialReference);return C([e.transformation[12],e.transformation[13],e.transformation[14]],this._context.renderCoordsHelper.spatialReference,t),t}_createComponentNormals(e,t,r,a){switch(r.shading||"flat"){case"source":return this._createComponentNormalsSource(e,t,r,a);case"flat":return this._createComponentNormalsFlat(e,a);case"smooth":return this._createComponentNormalsSmooth(e,a);default:return}}_createComponentNormalsSource(e,t,a,o){if(r(t))return this._createComponentNormalsFlat(e,o);let s=!1;if(!a.trustSourceNormals)for(let r=0;r<o.length;r+=3){this._calculateFaceNormal(e,o,r,ge);for(let e=0;e<3;e++){const a=3*o[r+e];pe[0]=t[a+0],pe[1]=t[a+1],pe[2]=t[a+2],d(ge,pe)<0&&(t[a+0]=-t[a+0],t[a+1]=-t[a+1],t[a+2]=-t[a+2],s=!0)}}return{normals:t,indices:o,didFlipNormals:s}}_createComponentNormalsFlat(e,t){const r=new Float32Array(t.length),a=new Uint32Array(3*t.length);for(let o=0;o<t.length;o+=3){const s=this._calculateFaceNormal(e,t,o,ge);for(let e=0;e<3;e++)r[o+e]=s[e],a[o+e]=o/3}return{normals:r,indices:a,didFlipNormals:!1}}_createComponentNormalsSmooth(e,t){const r={};for(let s=0;s<t.length;s+=3){const a=this._calculateFaceNormal(e,t,s,ge);for(let e=0;e<3;e++){const o=t[s+e];let n=r[o];n||(n={normal:v(),count:0},r[o]=n),p(n.normal,n.normal,a),n.count++}}const a=new Float32Array(3*t.length),o=new Uint32Array(3*t.length);for(let s=0;s<t.length;s++){const e=r[t[s]];1!==e.count&&(g(e.normal,e.normal),e.count=1);for(let t=0;t<3;t++)a[3*s+t]=e.normal[t];o[s]=s}return{normals:a,indices:o,didFlipNormals:!1}}_getFaceVertices(e,t,r,a,o,s){const n=3*t[r+0],i=3*t[r+1],l=3*t[r+2];a[0]=e[n+0],a[1]=e[n+1],a[2]=e[n+2],o[0]=e[i+0],o[1]=e[i+1],o[2]=e[i+2],s[0]=e[l+0],s[1]=e[l+1],s[2]=e[l+2]}_calculateFaceNormal(e,t,r,a){return this._getFaceVertices(e,t,r,pe,fe,de),x(fe,fe,pe),x(de,de,pe),_(pe,fe,de),g(a,pe),a}_getOrCreateComponents(e){return a(e.components,be)}_createPositionBuffer(e,r){let a=e.vertexAttributes.position;const o=r.reprojection===ve.ECEF?r.transformBeforeProject:null;if(t(o)&&(a=L(a,new Float64Array(a.length),o)),r.reprojection===ve.NONE)return r.needsBufferCopy?new Float64Array(a):a;const s=t(o)?a:new Float64Array(a.length);return O(a,e.spatialReference,0,s,this._context.renderCoordsHelper.spatialReference,0,a.length/3),s}_createNormalBuffer(e,a,o){let s=e.vertexAttributes.normal;if(r(s))return null;const n=o.reprojection===ve.ECEF?o.transformBeforeProject:null;t(n)&&(s=U(s,new Float32Array(s.length),n));if("local"===this._context.graphicsCoreOwner.view.viewingMode||o.reprojection===ve.NONE)return o.needsBufferCopy&&e.vertexAttributes.normal===s?new Float32Array(s):s;const i=e.vertexAttributes.position,l=t(n)?s:new Float32Array(s.length);return V(s,i,a,e.spatialReference,l)}_createTangentBuffer(e,a,o){let s=e.vertexAttributes.tangent;if(r(s))return null;const n=o.reprojection===ve.ECEF?o.transformBeforeProject:null;t(n)&&(s=G(s,new Float32Array(s.length),n));if("local"===this._context.graphicsCoreOwner.view.viewingMode||o.reprojection===ve.NONE)return o.needsBufferCopy&&e.vertexAttributes.normal===s?new Float32Array(s):s;const i=e.vertexAttributes.position,l=t(n)?s:new Float32Array(s.length);return $(s,i,a,e.spatialReference,l)}_createColorBuffer(e){return e.vertexAttributes.color}_createSymbolColorBuffer(e){if(this._requiresSymbolVertexColors()){const t=this._getVertexOpacityAndColor(e),r=J(o(this.symbolLayer,"material","colorMixMode")),a=new Uint8Array(4);return K(t,r,a),a}return null}_createBuffers(e,r){const a=e.vertexAttributes&&e.vertexAttributes.position;if(!a)return this.logger.warn("Mesh geometry must contain position vertex attributes"),null;const o=e.vertexAttributes.normal,s=e.vertexAttributes.uv,n=e.vertexAttributes.tangent;if(t(o)&&o.length!==a.length)return this.logger.warn("Mesh normal vertex buffer must contain the same number of elements as the position buffer"),null;if(t(n)&&n.length/4!=a.length/3)return this.logger.warn("Mesh tangent vertex buffer must contain the same number of elements as the position buffer"),null;if(t(s)&&s.length/2!=a.length/3)return this.logger.warn("Mesh uv vertex buffer must contain the same number of elements as the position buffer"),null;const i=this._computeReprojectionInfo(e),l=this._createPositionBuffer(e,i),c=this._createColorBuffer(e),u=this._createSymbolColorBuffer(r),m=this._createNormalBuffer(e,l,i),p=this._createTangentBuffer(e,l,i);return{positionBuffer:l,normalBuffer:m,tangentBuffer:p,uvBuffer:s,colorBuffer:c,symbolColorBuffer:u,objectTransformation:i.reprojection===ve.NONE&&t(i.objectTransformation)?i.objectTransformation:this._transformOriginLocal(e,l,m,p),geometryTransformation:i.reprojection===ve.NONE&&t(i.geometryTransformation)?i.geometryTransformation:h()}}_computeReprojectionInfo(e){const r=t(e.transform),a=r&&e.transform.geographic||this._context.renderCoordsHelper.viewingMode===k.Local?ve.NONE:ve.ECEF;if(r){if(a===ve.NONE){const t=h();A(e.spatialReference,e.transform.origin,t,this._context.renderCoordsHelper.spatialReference);return{reprojection:a,objectTransformation:t,geometryTransformation:m(e.transform.localMatrix),needsBufferCopy:!1}}const t=l(h(),e.transform.origin);return c(t,t,e.transform.localMatrix),{reprojection:a,transformBeforeProject:t,needsBufferCopy:!0}}return{reprojection:a,needsBufferCopy:!0}}_transformOriginLocal(e,r,a,o){const i=this._context.renderCoordsHelper.spatialReference,l=e.anchor;he[0]=l.x,he[1]=l.y,he[2]=l.z;const c=h();A(e.spatialReference,he,c,i);const m=I.fromTypedArray(r);if(u(xe,c),F(m,m,xe),t(a)||t(o)){if(s(_e,c),n(_e,_e),t(a)){const e=B.fromTypedArray(a);S(e,e,_e)}if(t(o)){const e=B.fromTypedArray(o,4*o.BYTES_PER_ELEMENT);S(e,e,_e)}}return c}_validateFaces(e,t){const r=e.vertexAttributes.position.length/3,a=t.faces;if(a){let e=-1;for(let t=0;t<a.length;t++){const r=a[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?t.faces:oe(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 a;const o=t.length/3;return e.spatialReference.equals(r)?a=t:(a=new Float64Array(t.length),O(e.vertexAttributes.position,e.spatialReference,0,a,r,0,o)),w(ye),N(ye,a,0,o),!j(ye,this._context.clippingExtent)}_createGeometryInfo(e,a){if(!M(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,a);if(r(o))return null;const{positionBuffer:s,uvBuffer:n,colorBuffer:i,symbolColorBuffer:l,normalBuffer:c,tangentBuffer:u,objectTransformation:m,geometryTransformation:h}=o,p=this._getOrCreateComponents(e),f=[],d=[],g=[];let x=!1;for(const r of p){if(!this._validateFaces(e,r))return null;const a=this._getOrCreateFaces(e,r);if(0===a.length)continue;const o=this._createComponentNormals(s,c,r,a);o.didFlipNormals&&(x=!0);const m=[[te.POSITION,{size:3,data:s,exclusive:!0}],[te.NORMAL,{size:3,data:o.normals,exclusive:!0}]],p=[[te.POSITION,a],[te.NORMAL,o.indices]];t(i)&&(m.push([te.COLOR,{size:4,data:i,exclusive:!0}]),p.push([te.COLOR,a])),t(l)&&(m.push([te.SYMBOLCOLOR,{size:4,data:l,exclusive:!0}]),p.push([te.SYMBOLCOLOR,new Uint16Array(a.length)])),t(n)&&(m.push([te.UV0,{size:2,data:n,exclusive:!0}]),p.push([te.UV0,a])),t(u)&&(m.push([te.TANGENT,{size:4,data:u,exclusive:!0}]),p.push([te.TANGENT,a]));const _=new ae(m,p);f.push(_),d.push(h),g.push(this._getOrCreateMaterial(e,r))}return x&&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,transformations:d,materials:g,objectTransformation:m}}_createEdgeMaterial(){const e={opacity:this._getLayerOpacity()};return Z(this.symbolLayer,e)}}const he=v(),pe=v(),fe=v(),de=v(),ge=v(),xe=h(),_e=i(),ye=E(),be=[new R];var ve;!function(e){e[e.NONE=0]="NONE",e[e.ECEF=1]="ECEF"}(ve||(ve={}));export{me as Graphics3DMeshFillSymbolLayer,me as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
4
  */
5
- import{result as r}from"../../../../core/asyncUtils.js";import{destroyMaybe as t}from"../../../../core/maybe.js";import{throwIfAborted as a}from"../../../../core/promiseUtils.js";import{make as e}from"./Graphics3DCalloutSymbolLayerFactory.js";import o from"./Graphics3DSymbol.js";class l extends o{constructor(r,t,a){super(r,t,a),this.calloutSymbolLayer=null,this.symbol.hasVisibleCallout()&&(this.calloutSymbolLayer=e(this.symbol,t))}async doLoad(t){const e=this.calloutSymbolLayer?r(this.calloutSymbolLayer.load()):null;try{await super.doLoad(t),a(t)}catch(l){var o;throw null==(o=this.calloutSymbolLayer)||o.abortLoad(),l}e&&await e}destroy(){super.destroy(),this.calloutSymbolLayer=t(this.calloutSymbolLayer)}createGraphics3DGraphic(r,t){const a=super.createGraphics3DGraphic(r,t);if(this.calloutSymbolLayer){const t=this._createCalloutGraphic(r);t&&a.addAuxiliaryGraphic(t)}return a}globalPropertyChanged(r,t){return!!super.globalPropertyChanged(r,t)&&(!this.calloutSymbolLayer||this.calloutSymbolLayer.globalPropertyChanged(r,t,(r=>this._getCalloutGraphicLayer(r))))}updateGeometry(r,t){const a=super.updateGeometry(r,t);if(a&&this.calloutSymbolLayer){const a=this._getCalloutGraphicLayer(r);if(a)return this.calloutSymbolLayer.updateGeometry(a,t)}return a}_createCalloutGraphic(r){const t=r.renderingInfo,a={renderer:t.renderer,symbol:t.symbol,translation:[0,0,0],centerOffset:[0,0,0,0],screenOffset:[0,0],centerOffsetUnits:"world",elevationOffset:0,materialCollection:null};return r.renderingInfo=a,this.calloutSymbolLayer.createGraphics3DGraphic(r)}_getCalloutGraphicLayer(r){for(const t of r._auxiliaryGraphics)if(t.graphics3DSymbolLayer===this.calloutSymbolLayer)return t}}export{l as default};
5
+ import{result as r}from"../../../../core/asyncUtils.js";import{destroyMaybe as t,isSome as a}from"../../../../core/maybe.js";import{throwIfAborted as e}from"../../../../core/promiseUtils.js";import{make as o}from"./Graphics3DCalloutSymbolLayerFactory.js";import l from"./Graphics3DSymbol.js";class s extends l{constructor(r,t,a){super(r,t,a),this.calloutSymbolLayer=null,this.symbol.hasVisibleCallout()&&(this.calloutSymbolLayer=o(this.symbol,t))}async doLoad(t){const a=this.calloutSymbolLayer?r(this.calloutSymbolLayer.load()):null;try{await super.doLoad(t),e(t)}catch(l){var o;throw null==(o=this.calloutSymbolLayer)||o.abortLoad(),l}a&&await a}destroy(){super.destroy(),this.calloutSymbolLayer=t(this.calloutSymbolLayer)}createGraphics3DGraphic(r,t){const e=super.createGraphics3DGraphic(r,t);if(a(this.calloutSymbolLayer)&&a(e)){const t=this._createCalloutGraphic(r);a(t)&&e.addAuxiliaryGraphic(t)}return e}globalPropertyChanged(r,t){return!!super.globalPropertyChanged(r,t)&&(!this.calloutSymbolLayer||this.calloutSymbolLayer.globalPropertyChanged(r,t,(r=>this._getCalloutGraphicLayer(r))))}updateGeometry(r,t){const a=super.updateGeometry(r,t);if(a&&this.calloutSymbolLayer){const a=this._getCalloutGraphicLayer(r);if(a)return this.calloutSymbolLayer.updateGeometry(a,t)}return a}_createCalloutGraphic(r){const t=r.renderingInfo,a={renderer:t.renderer,symbol:t.symbol,translation:[0,0,0],centerOffset:[0,0,0,0],screenOffset:[0,0],centerOffsetUnits:"world",elevationOffset:0,materialCollection:null};return r.renderingInfo=a,this.calloutSymbolLayer.createGraphics3DGraphic(r)}_getCalloutGraphicLayer(r){for(const t of r._auxiliaryGraphics)if(t.graphics3DSymbolLayer===this.calloutSymbolLayer)return t}}export{s as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../../Color.js";import{isSome as t,get as i,isNone as r,unwrap as n}from"../../../../core/maybe.js";import{pt2px as o}from"../../../../core/screenUtils.js";import{e as a}from"../../../../chunks/earcut.js";import{I as s}from"../../../../chunks/mat4f64.js";import{s as l}from"../../../../chunks/vec4.js";import{create as u,empty as c,expandWithBuffer as p,intersectsClippingArea as h,expandWithAABB as d}from"../../../../geometry/support/aaBoundingBox.js";import{BufferViewMat3f64 as m,BufferViewVec3f64 as _,BufferViewVec4f as y}from"../../../../geometry/support/buffer/BufferView.js";import{SymbolUpdateType as g,elevationModeChangeUpdateType as f,needsElevationUpdates2D as b}from"./elevationAlignmentUtils.js";import{ElevationContext as v}from"./ElevationContext.js";import E from"./Graphics3DDrapedGraphicLayer.js";import{Graphics3DObject3DGraphicLayer as M}from"./Graphics3DObject3DGraphicLayer.js";import{Graphics3DSymbolLayer as x}from"./Graphics3DSymbolLayer.js";import{mixinColorAndOpacity as D}from"./graphicUtils.js";import{parseCapType as O,createGeometry as S,RemoveDuplicateStartEnd as A}from"./lineUtils.js";import{geometryAsPolygon as P,geometryToRenderInfo as C,createColorGeometry as U,geometryToRenderInfoDraped as w}from"./polygonUtils.js";import{createMaterial as G,uvElevationAligner as T}from"../support/patternUtils.js";import{createMapSpaceUVCoords as j,createMapSpaceUVCoordsDraped as R}from"../support/uvUtils.js";import{VertexAttribute as B}from"../../webgl-engine/lib/basicInterfaces.js";import{Object3D as L}from"../../webgl-engine/lib/Object3D.js";import{RenderGeometry as N}from"../../webgl-engine/lib/RenderGeometry.js";import{getStipplePatternForLinePattern as V}from"../../webgl-engine/materials/lineStippleUtils.js";import{PatternMaterial as F}from"../../webgl-engine/materials/PatternMaterial.js";import{RibbonLineMaterial as I}from"../../webgl-engine/materials/RibbonLineMaterial.js";const H=["polyline","polygon","extent"];class W extends x{constructor(e,t,i,r){super(e,t,i,r),this._needsUV=!1,this._hasOutline=!1}async doLoad(){}_ensureMaterials(){this._ensureFillMaterial(),this._ensureOutlineMaterial()}_ensureFillMaterial(){if(t(this._material))return;const e=i(this.symbolLayer,"material","color"),r=this._getCombinedOpacityAndColor(e);this._material=G(this.symbolLayer,{color:r,transparent:r[3]<1||this.needsDrivenTransparentPass,polygonOffset:!1,vertexColors:!0,writeLinearDepth:!0,slicePlaneEnabled:this._context.slicePlaneEnabled},{isDraped:this.draped}),this._needsUV=this._material instanceof F,this._context.stage.add(this._material)}_ensureOutlineMaterial(){const e=this.symbolLayer.outline;if(t(this._outlineMaterial)||!this._isValidOutline(e))return;this._hasOutline=!0;const i=t=>{const i=V(e.pattern);return new I({width:t,color:this._getOutlineColor(),polygonOffset:!0,slicePlaneEnabled:this._context.slicePlaneEnabled,isClosed:!0,stipplePattern:i,stippleScaleWithLineWidth:!0,cap:O(e.patternCap||"butt")})};this._outlineMaterial=i(o(e.size)),this._context.stage.add(this._outlineMaterial)}_isValidOutline(e){return t(e)&&e.size&&e.size>0&&t(e.color)&&(r(e.pattern)||"style"!==e.pattern.type||"none"!==e.pattern.style)}destroy(){super.destroy(),this._context.stage.remove(this._material),this._material=null,this._context.stage.remove(this._outlineMaterial),this._outlineMaterial=null}createGraphics3DGraphic(e){const t=e.graphic;if(!this._validateGeometry(t.geometry,H,this.symbolLayer.type))return null;const i=this._getVertexOpacityAndColor(e.renderingInfo,255),r=this.setGraphicElevationContext(t,new v);return this.ensureDrapedStatus("on-the-ground"===r.mode),this._ensureMaterials(),this.draped?this._createAsOverlay(t,i):this._createAs3DShape(t,i,r)}layerOpacityChanged(){if(t(this._material)){const e=this._material.parameters.color,t=i(this.symbolLayer,"material","color"),r=this._getCombinedOpacity(t);this._material.setParameters({color:[e[0],e[1],e[2],r],transparent:r<1||this.needsDrivenTransparentPass})}if(t(this._outlineMaterial)){const e=this._outlineMaterial.parameters.color;this._outlineMaterial.setParameters({color:[e[0],e[1],e[2],this._getOutlineOpacity()]})}return!0}layerElevationInfoChanged(e,t,i){const r=this._elevationContext.mode,n=f(W.elevationModeChangeTypes,i,r);if(n!==g.UPDATE)return n;const o=b(r);return this.updateGraphics3DGraphicElevationInfo(e,t,(()=>o))}slicePlaneEnabledChanged(){if(t(this._material)&&this._material.setParameters({slicePlaneEnabled:this._context.slicePlaneEnabled}),t(this._outlineMaterial)){const e={slicePlaneEnabled:this._context.slicePlaneEnabled};this._outlineMaterial.setParameters(e)}return!0}physicalBasedRenderingChanged(){return!0}pixelRatioChanged(){return!0}_createAs3DShape(e,t,i){const n=P(e.geometry);if(r(n))return null;z.renderData=C(n,this._context.elevationProvider,this._context.renderCoordsHelper,i),z.color=t;const o=z.renderData.position.length/3;if(this._needsUV&&(z.uvMapSpace=new Float32Array(4*o),z.boundingRect=new Float64Array(9*o)),z.outNum=0,z.outGeometries=[],z.outTransforms=[],z.outMaterials=[],this._createAs3DShapeFill(z),this._hasOutline&&this._createAs3DShapeOutline(z),this._logGeometryCreationWarnings(z.renderData,n.rings,"rings","FillSymbol3DLayer"),0===z.outNum)return null;this._needsUV&&j(y.fromTypedArray(z.uvMapSpace),_.fromTypedArray(z.renderData.position),this._context.renderCoordsHelper,m.fromTypedArray(z.boundingRect));const a=new L({geometries:z.outGeometries,materials:z.outMaterials,transformations:z.outTransforms,castShadow:!1,metadata:{layerUid:this._context.layer.uid,graphicUid:e.uid}}),s=new M(this,a,z.outGeometries,null,null,T,i);return s.alignedSampledElevation=z.renderData.sampledElevation,s.needsElevationUpdates=b(i.mode),s}_createAs3DShapeFill(e){const i=e.renderData.polygons;for(const{position:r,mapPosition:o,holeIndices:l,index:u,count:d}of i){if(t(this._context.clippingExtent)&&(c(k),p(k,o),!h(k,this._context.clippingExtent)))continue;const i=a(o,l,3);if(0===i.length)continue;const m=new Uint32Array(i),_=U({indices:m,attributeData:{position:r,color:e.color,mapPosition:o,uvMapSpace:this._needsUV?new Float32Array(e.uvMapSpace.buffer,4*u*e.uvMapSpace.BYTES_PER_ELEMENT,4*d):null,boundingRect:this._needsUV?new Float64Array(e.boundingRect.buffer,9*u*e.boundingRect.BYTES_PER_ELEMENT,9*d):null}});e.outGeometries.push(_),e.outMaterials.push(n(this._material)),e.outTransforms.push(s),e.outNum++}}_createAs3DShapeOutline(e){if(!this._hasOutline)return;const i=e.renderData.outlines;for(let r=0;r<i.length;++r){const{mapPosition:o,position:a}=i[r];if(t(this._context.clippingExtent)&&(c(k),p(k,o),!h(k,this._context.clippingExtent)))continue;const l=S({overlayInfo:null,removeDuplicateStartEnd:A.REMOVE,attributeData:{position:a,mapPosition:o}}),u=l.vertexAttributes.get(B.POSITION);u.data===a&&(u.data=new Float64Array(a)),e.outGeometries.push(l),e.outMaterials.push(n(this._outlineMaterial)),e.outTransforms.push(s),e.outNum++}}_createAsOverlay(e,i){const o=P(e.geometry);if(r(o))return null;n(this._material).renderPriority=this._renderPriority+this._renderPriorityStep/2,t(this._outlineMaterial)&&(this._outlineMaterial.renderPriority=this._renderPriority),Y.renderData=w(o,this._context.overlaySR),Y.color=i;const a=Y.renderData.position.length/3;return this._needsUV&&(Y.uvMapSpace=new Float32Array(4*a)),Y.outNum=0,Y.outGeometries=[],Y.outBoundingBox=c(),Y.layerUid=this._context.layer.uid,Y.graphicsUid=e.uid,this._createAsOverlayFill(Y),this._hasOutline&&this._createAsOverlayOutline(Y),this._logGeometryCreationWarnings(Y.renderData,o.rings,"rings","FillSymbol3DLayer"),0===Y.outNum?null:(this._needsUV&&R(y.fromTypedArray(Y.uvMapSpace),_.fromTypedArray(Y.renderData.position),this._context.overlaySR,this._context.layerView.view.state.viewingMode),Y.outNum>0?new E(this,Y.outGeometries,Y.outBoundingBox):null)}_createAsOverlayFill(e){const t=e.renderData.polygons;for(const{position:i,holeIndices:r,index:o,count:s}of t){if(c(k),p(k,i),!h(k,this._context.clippingExtent))continue;const t=a(i,r,3);if(0===t.length)continue;d(e.outBoundingBox,k);const u=new Uint32Array(t),m=U({indices:u,attributeData:{position:i,color:e.color,uvMapSpace:this._needsUV?new Float32Array(e.uvMapSpace.buffer,4*o*e.uvMapSpace.BYTES_PER_ELEMENT,4*s):null}}),_=new N(m,n(this._material),e.layerUid,e.graphicsUid),y=k;l(_.boundingSphere,.5*(y[0]+y[3]),.5*(y[1]+y[4]),0,.5*Math.sqrt((y[3]-y[0])*(y[3]-y[0])+(y[4]-y[1])*(y[4]-y[1]))),e.outGeometries.push(_),e.outNum++}}_createAsOverlayOutline(e){if(!this._hasOutline)return;const t=e.renderData.outlines;for(let i=0;i<t.length;++i){const{position:r}=t[i];if(c(k),p(k,r),!h(k,this._context.clippingExtent))continue;d(e.outBoundingBox,k);const o=S({overlayInfo:{spatialReference:this._context.overlaySR,renderCoordsHelper:this._context.renderCoordsHelper},removeDuplicateStartEnd:A.REMOVE,attributeData:{position:r}}),a=new N(o,n(this._outlineMaterial),e.layerUid,e.graphicsUid),s=k;l(a.boundingSphere,.5*(s[0]+s[3]),.5*(s[1]+s[4]),0,.5*Math.sqrt((s[3]-s[0])*(s[3]-s[0])+(s[4]-s[1])*(s[4]-s[1]))),e.outGeometries.push(a),e.outNum++}}_getOutlineOpacity(){const e=i(this.symbolLayer,"outline","color");return(this.draped?1:this._getLayerOpacity())*(t(e)?e.a:0)}_getOutlineColor(){const r=i(this.symbolLayer,"outline","color"),n=this._getOutlineOpacity();return D(t(r)?e.toUnitRGB(r):null,n)}get test(){return{createAsOverlay:(e,t)=>this._createAsOverlay(e,t),createAs3DShape:(e,t,i)=>this._createAs3DShape(e,t,i)}}}W.elevationModeChangeTypes={definedChanged:g.RECREATE,staysOnTheGround:g.NONE,onTheGroundChanged:g.RECREATE};const k=u(),z={renderData:null,color:null,uvMapSpace:null,boundingRect:null,outNum:0,outBoundingBox:null,outGeometries:null,outMaterials:null,outTransforms:null},Y={renderData:null,color:null,uvMapSpace:null,outNum:0,outBoundingBox:null,outGeometries:null,outMaterials:null,outTransforms:null};export{W as Graphics3DPolygonFillSymbolLayer,W as default};
5
+ import e from"../../../../Color.js";import{isSome as t,get as i,isNone as r,unwrap as n}from"../../../../core/maybe.js";import{pt2px as o}from"../../../../core/screenUtils.js";import{e as a}from"../../../../chunks/earcut.js";import{I as s}from"../../../../chunks/mat4f64.js";import{s as l}from"../../../../chunks/vec4.js";import{create as u,empty as c,expandWithBuffer as p,intersectsClippingArea as h,expandWithAABB as d}from"../../../../geometry/support/aaBoundingBox.js";import{BufferViewMat3f64 as m,BufferViewVec3f64 as _,BufferViewVec4f as y}from"../../../../geometry/support/buffer/BufferView.js";import{SymbolUpdateType as g,elevationModeChangeUpdateType as f,needsElevationUpdates2D as b}from"./elevationAlignmentUtils.js";import{ElevationContext as v}from"./ElevationContext.js";import E from"./Graphics3DDrapedGraphicLayer.js";import{Graphics3DObject3DGraphicLayer as M}from"./Graphics3DObject3DGraphicLayer.js";import{Graphics3DSymbolLayer as x}from"./Graphics3DSymbolLayer.js";import{mixinColorAndOpacity as O}from"./graphicUtils.js";import{parseCapType as D,createGeometry as S,RemoveDuplicateStartEnd as A}from"./lineUtils.js";import{geometryAsPolygon as P,geometryToRenderInfo as C,createColorGeometry as U,geometryToRenderInfoDraped as w}from"./polygonUtils.js";import{createMaterial as G,uvElevationAligner as T}from"../support/patternUtils.js";import{createMapSpaceUVCoords as j,createMapSpaceUVCoordsDraped as R}from"../support/uvUtils.js";import{VertexAttribute as B}from"../../webgl-engine/lib/basicInterfaces.js";import{Object3D as L}from"../../webgl-engine/lib/Object3D.js";import{RenderGeometry as N}from"../../webgl-engine/lib/RenderGeometry.js";import{getStipplePatternForLinePattern as F}from"../../webgl-engine/materials/lineStippleUtils.js";import{PatternMaterial as V}from"../../webgl-engine/materials/PatternMaterial.js";import{RibbonLineMaterial as I}from"../../webgl-engine/materials/RibbonLineMaterial.js";const H=["polyline","polygon","extent"];class W extends x{constructor(e,t,i,r){super(e,t,i,r),this._needsUV=!1,this._hasOutline=!1}async doLoad(){}_ensureMaterials(){this._ensureFillMaterial(),this._ensureOutlineMaterial()}_ensureFillMaterial(){if(t(this._material))return;const e=i(this.symbolLayer,"material","color"),r=this._getCombinedOpacityAndColor(e);this._material=G(this.symbolLayer,{color:r,transparent:r[3]<1||this.needsDrivenTransparentPass,polygonOffset:!1,vertexColors:!0,writeLinearDepth:!0,slicePlaneEnabled:this._context.slicePlaneEnabled},{isDraped:this.draped}),this._needsUV=this._material instanceof V,this._context.stage.add(this._material)}_ensureOutlineMaterial(){const e=this.symbolLayer.outline;if(t(this._outlineMaterial)||!this._isValidOutline(e))return;this._hasOutline=!0;const i=t=>{const i=F(e.pattern);return new I({width:t,color:this._getOutlineColor(),polygonOffset:!0,slicePlaneEnabled:this._context.slicePlaneEnabled,isClosed:!0,stipplePattern:i,stippleScaleWithLineWidth:!0,cap:D(e.patternCap||"butt")})};this._outlineMaterial=i(o(e.size)),this._context.stage.add(this._outlineMaterial)}_isValidOutline(e){return t(e)&&e.size&&e.size>0&&t(e.color)&&(r(e.pattern)||"style"!==e.pattern.type||"none"!==e.pattern.style)}destroy(){super.destroy(),this._context.stage.remove(this._material),this._material=null,this._context.stage.remove(this._outlineMaterial),this._outlineMaterial=null}createGraphics3DGraphic(e){const t=e.graphic;if(!this._validateGeometry(t.geometry,H,this.symbolLayer.type))return null;const i=this._getVertexOpacityAndColor(e.renderingInfo,255),r=this.setGraphicElevationContext(t,new v);return this.ensureDrapedStatus("on-the-ground"===r.mode),this._ensureMaterials(),this.draped?this._createAsOverlay(t,i):this._createAs3DShape(t,i,r)}layerOpacityChanged(){if(t(this._material)){const e=this._material.parameters.color,t=i(this.symbolLayer,"material","color"),r=this._getCombinedOpacity(t);this._material.setParameters({color:[e[0],e[1],e[2],r],transparent:r<1||this.needsDrivenTransparentPass})}if(t(this._outlineMaterial)){const e=this._outlineMaterial.parameters.color;this._outlineMaterial.setParameters({color:[e[0],e[1],e[2],this._getOutlineOpacity()]})}return!0}layerElevationInfoChanged(e,t,i){const r=this._elevationContext.mode,n=f(W.elevationModeChangeTypes,i,r);if(n!==g.UPDATE)return n;const o=b(r);return this.updateGraphics3DGraphicElevationInfo(e,t,(()=>o))}slicePlaneEnabledChanged(){if(t(this._material)&&this._material.setParameters({slicePlaneEnabled:this._context.slicePlaneEnabled}),t(this._outlineMaterial)){const e={slicePlaneEnabled:this._context.slicePlaneEnabled};this._outlineMaterial.setParameters(e)}return!0}physicalBasedRenderingChanged(){return!0}pixelRatioChanged(){return!0}_createAs3DShape(e,t,i){const n=P(e.geometry);if(r(n))return null;z.renderData=C(n,this._context.elevationProvider,this._context.renderCoordsHelper,i),z.color=t;const o=z.renderData.position.length/3;if(this._needsUV&&(z.uvMapSpace=new Float32Array(4*o),z.boundingRect=new Float64Array(9*o)),z.outNum=0,z.outGeometries=[],z.outTransforms=[],z.outMaterials=[],this._createAs3DShapeFill(z),this._hasOutline&&this._createAs3DShapeOutline(z),this._logGeometryCreationWarnings(z.renderData,n.rings,"rings","FillSymbol3DLayer"),0===z.outNum)return null;this._needsUV&&j(y.fromTypedArray(z.uvMapSpace),_.fromTypedArray(z.renderData.position),this._context.renderCoordsHelper,m.fromTypedArray(z.boundingRect));const a=new L({geometries:z.outGeometries,materials:z.outMaterials,transformations:z.outTransforms,castShadow:!1,metadata:{layerUid:this._context.layer.uid,graphicUid:e.uid}}),s=new M(this,a,z.outGeometries,null,null,T,i);return s.alignedSampledElevation=z.renderData.sampledElevation,s.needsElevationUpdates=b(i.mode),s}_createAs3DShapeFill(e){const i=e.renderData.polygons;for(const{position:r,mapPosition:o,holeIndices:l,index:u,count:d}of i){if(t(this._context.clippingExtent)&&(c(k),p(k,o),!h(k,this._context.clippingExtent)))continue;const i=a(o,l,3);if(0===i.length)continue;const m=new Uint32Array(i),_=U({indices:m,attributeData:{position:r,color:e.color,mapPosition:o,uvMapSpace:this._needsUV?new Float32Array(e.uvMapSpace.buffer,4*u*e.uvMapSpace.BYTES_PER_ELEMENT,4*d):null,boundingRect:this._needsUV?new Float64Array(e.boundingRect.buffer,9*u*e.boundingRect.BYTES_PER_ELEMENT,9*d):null}});e.outGeometries.push(_),e.outMaterials.push(n(this._material)),e.outTransforms.push(s),e.outNum++}}_createAs3DShapeOutline(e){if(!this._hasOutline)return;const i=e.renderData.outlines;for(let r=0;r<i.length;++r){const{mapPosition:o,position:a}=i[r];if(t(this._context.clippingExtent)&&(c(k),p(k,o),!h(k,this._context.clippingExtent)))continue;const l=S({overlayInfo:null,removeDuplicateStartEnd:A.REMOVE,attributeData:{position:a,mapPosition:o}}),u=l.vertexAttributes.get(B.POSITION);u.data===a&&(u.data=new Float64Array(a)),e.outGeometries.push(l),e.outMaterials.push(n(this._outlineMaterial)),e.outTransforms.push(s),e.outNum++}}_createAsOverlay(e,i){const o=P(e.geometry);if(r(o))return null;n(this._material).renderPriority=this._renderPriority+this._renderPriorityStep/2,t(this._outlineMaterial)&&(this._outlineMaterial.renderPriority=this._renderPriority),Y.renderData=w(o,this._context.overlaySR),Y.color=i;const a=Y.renderData.position.length/3;return this._needsUV&&(Y.uvMapSpace=new Float32Array(4*a)),Y.outNum=0,Y.outGeometries=[],Y.outBoundingBox=c(),Y.layerUid=this._context.layer.uid,Y.graphicsUid=e.uid,this._createAsOverlayFill(Y),this._hasOutline&&this._createAsOverlayOutline(Y),this._logGeometryCreationWarnings(Y.renderData,o.rings,"rings","FillSymbol3DLayer"),0===Y.outNum?null:(this._needsUV&&R(y.fromTypedArray(Y.uvMapSpace),_.fromTypedArray(Y.renderData.position),this._context.overlaySR,this._context.graphicsCoreOwner.view.state.viewingMode),Y.outNum>0?new E(this,Y.outGeometries,Y.outBoundingBox):null)}_createAsOverlayFill(e){const t=e.renderData.polygons;for(const{position:i,holeIndices:r,index:o,count:s}of t){if(c(k),p(k,i),!h(k,this._context.clippingExtent))continue;const t=a(i,r,3);if(0===t.length)continue;d(e.outBoundingBox,k);const u=new Uint32Array(t),m=U({indices:u,attributeData:{position:i,color:e.color,uvMapSpace:this._needsUV?new Float32Array(e.uvMapSpace.buffer,4*o*e.uvMapSpace.BYTES_PER_ELEMENT,4*s):null}}),_=new N(m,n(this._material),e.layerUid,e.graphicsUid),y=k;l(_.boundingSphere,.5*(y[0]+y[3]),.5*(y[1]+y[4]),0,.5*Math.sqrt((y[3]-y[0])*(y[3]-y[0])+(y[4]-y[1])*(y[4]-y[1]))),e.outGeometries.push(_),e.outNum++}}_createAsOverlayOutline(e){if(!this._hasOutline)return;const t=e.renderData.outlines;for(let i=0;i<t.length;++i){const{position:r}=t[i];if(c(k),p(k,r),!h(k,this._context.clippingExtent))continue;d(e.outBoundingBox,k);const o=S({overlayInfo:{spatialReference:this._context.overlaySR,renderCoordsHelper:this._context.renderCoordsHelper},removeDuplicateStartEnd:A.REMOVE,attributeData:{position:r}}),a=new N(o,n(this._outlineMaterial),e.layerUid,e.graphicsUid),s=k;l(a.boundingSphere,.5*(s[0]+s[3]),.5*(s[1]+s[4]),0,.5*Math.sqrt((s[3]-s[0])*(s[3]-s[0])+(s[4]-s[1])*(s[4]-s[1]))),e.outGeometries.push(a),e.outNum++}}_getOutlineOpacity(){const e=i(this.symbolLayer,"outline","color");return(this.draped?1:this._getLayerOpacity())*(t(e)?e.a:0)}_getOutlineColor(){const r=i(this.symbolLayer,"outline","color"),n=this._getOutlineOpacity();return O(t(r)?e.toUnitRGB(r):null,n)}get test(){return{createAsOverlay:(e,t)=>this._createAsOverlay(e,t),createAs3DShape:(e,t,i)=>this._createAs3DShape(e,t,i)}}}W.elevationModeChangeTypes={definedChanged:g.RECREATE,staysOnTheGround:g.NONE,onTheGroundChanged:g.RECREATE};const k=u(),z={renderData:null,color:null,uvMapSpace:null,boundingRect:null,outNum:0,outBoundingBox:null,outGeometries:null,outMaterials:null,outTransforms:null},Y={renderData:null,color:null,uvMapSpace:null,outNum:0,outBoundingBox:null,outGeometries:null,outMaterials:null,outTransforms:null};export{W as Graphics3DPolygonFillSymbolLayer,W as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../chunks/tslib.es6.js";import i from"../../../../core/Accessor.js";import t from"../../../../core/Handles.js";import{isSome as s,isNone as a}from"../../../../core/maybe.js";import{property as r}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/arrayUtils.js";import"../../../../core/has.js";import"../../../../core/accessorSupport/ensureType.js";import{subclass as l}from"../../../../core/accessorSupport/decorators/subclass.js";import{VisibilityFlag as n,VisibilityGroup as c}from"./enums.js";import{scaleBoundsPredicate as h}from"../../../support/layerViewUtils.js";import{TaskPriority as o}from"../../../support/Scheduler.js";let p=class extends i{constructor(){super(...arguments),this._scaleRangeActive=!1,this.layerScaleRangeVisibilityQuery=!1,this.handles=new t,this.layerView=null,this.layer=null,this.queryGraphicUIDsInExtent=null,this.extent=null,this.graphicsCore=null,this.basemapTerrain=null,this.layerScaleEnabled=!0,this.suspended=!1,this.updating=!0}setup(e,i,t,s,a){this.layerView=e,this.layer=i,this.queryGraphicUIDsInExtent=t,this.graphicsCore=s,this.basemapTerrain=a,this.updateScaleRangeActive();const r=this.layerView.view.resourceController.scheduler;this.handles.add(r.registerTask(o.SCALE_VISIBILITY,this))}destroy(){this.handles.destroy(),this.handles=null,this.layerView=null,this.extent=null,this.queryGraphicUIDsInExtent=null,this.graphicsCore=null}_setDirty(){this.updating||this._set("updating",!0)}setExtent(e){this.extent=e,this._setDirty()}scaleRangeActive(){return this._scaleRangeActive}updateScaleRangeActive(){const e=this.layer,i=e.effectiveScaleRange;let t=this.layerScaleEnabled&&y(i.minScale,i.maxScale);e.labelingInfo&&!t&&(t=e.labelingInfo.some((e=>e&&y(e.minScale,e.maxScale))));const s=this._scaleRangeActive!==t;return this._scaleRangeActive=t,t&&!this.handles.has(u)&&this.basemapTerrain?(this.handles.add(this.basemapTerrain.on("scale-change",(e=>this._scaleUpdateHandler(e))),u),this.layerScaleEnabled&&this.handles.add(this.basemapTerrain.on("tiles-visibility-changed",(()=>this._setDirty())),u)):!t&&this.handles.has(u)&&this.handles.remove(u),s}get running(){return!(!this.layerView.view.basemapTerrain||!this.updating)}runTask(){const e=this.layerView.view.basemapTerrain;if(this.extent&&e&&e.ready&&this._scaleRangeActive&&this.layerScaleEnabled){if(!this.layerScaleRangeVisibilityQuery){this.layerScaleRangeVisibilityQuery=!0;const i=this.layer.effectiveScaleRange;e.queryVisibleScaleRange(this.extent,i.minScale,i.maxScale,(e=>this._finishUpdate(e)))}}else this._finishUpdate(!0)}_finishUpdate(e){this.layerScaleRangeVisibilityQuery=!1,this._set("suspended",!e),this._set("updating",!1)}_visibleAtLayerScale(e){const i=this.layer.effectiveScaleRange;return!this.layerScaleEnabled||h(e,i.minScale||0,i.maxScale||0)}_visibleAtLabelScale(e,i){return h(e,i.minScale||0,i.maxScale||0)}_graphicScale(e){let i;if(s(e.centroid)?i=e.centroid:s(e.graphic.geometry)&&"point"===e.graphic.geometry.type&&(i=e.graphic.geometry),i){return this.layerView.view.basemapTerrain?this.layerView.view.basemapTerrain.getScale(i):1}return null}_graphicVisible(e){if(!this.layerScaleEnabled)return!0;const i=this._graphicScale(e);return this._visibleAtLayerScale(i)}updateVisibility(e){if(this._scaleRangeActive){const i=this._graphicVisible(e);return e.setVisibilityFlag(n.SCALE_RANGE,i,c.GRAPHIC)}return!1}updateGraphicLabelScaleVisibility(e){if(!this._scaleRangeActive)return!1;if(!e.labelGraphics||0===e.labelGraphics.length)return!1;const i=this._graphicScale(e),t=this._updateLabelScaleVisibility(e,i);return t&&(this.layerView.view.deconflictor.setDirty(),this.layerView.view.labeler.setDirty()),t}_updateLabelScaleVisibility(e,i){if(!e.labelGraphics||0===e.labelGraphics.length)return!1;const t=e.labelGraphics[0]._labelClass;if(t&&null!=t.minScale&&null!=t.maxScale){const s=this._visibleAtLabelScale(i,t);if(e.setVisibilityFlag(n.SCALE_RANGE,s,c.LABEL))return!0}return!1}_scaleUpdateHandler(e){if(this._setDirty(),this.layerView.suspended)return;const i=e.extent,t=e.scale,r=this._visibleAtLayerScale(t);let l=!1;this.queryGraphicUIDsInExtent(i,e.spatialReference,(e=>{const h=this.graphicsCore.getGraphics3DGraphicById(e);if(a(h))return;const o=h.centroid;s(o)&&(i[0]>o.x||i[1]>o.y||i[2]<o.x||i[3]<o.y)||(h.setVisibilityFlag(n.SCALE_RANGE,r,c.GRAPHIC)&&(l=!0),this._updateLabelScaleVisibility(h,t)&&(l=!0))})),l&&(this.layerView.view.deconflictor.setDirty(),this.layerView.view.labeler.setDirty())}layerMinMaxScaleChangeHandler(){this.updateScaleRangeActive()&&!this._scaleRangeActive?this.graphicsCore.modifyGraphics3DGraphicVisibilities((e=>e.clearVisibilityFlag(n.SCALE_RANGE))):this._scaleRangeActive&&this.graphicsCore.updateAllGraphicsVisibility(),this._setDirty()}};function y(e,i){return e>0||i>0}e([r({constructOnly:!0})],p.prototype,"layerScaleEnabled",void 0),e([r({readOnly:!0})],p.prototype,"suspended",void 0),e([r({readOnly:!0})],p.prototype,"updating",void 0),p=e([l("esri.views.3d.layers.graphics.Graphics3DScaleVisibility")],p);const u="terrain-events",d=p;export{d as default};
5
+ import{_ as e}from"../../../../chunks/tslib.es6.js";import i from"../../../../core/Accessor.js";import t from"../../../../core/Handles.js";import{isSome as s,isNone as a}from"../../../../core/maybe.js";import{property as r}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/arrayUtils.js";import"../../../../core/has.js";import"../../../../core/accessorSupport/ensureType.js";import{subclass as l}from"../../../../core/accessorSupport/decorators/subclass.js";import{VisibilityFlag as n,VisibilityGroup as c}from"./enums.js";import{scaleBoundsPredicate as h}from"../../../support/layerViewUtils.js";import{TaskPriority as o}from"../../../support/Scheduler.js";let p=class extends i{constructor(){super(...arguments),this._scaleRangeActive=!1,this.layerScaleRangeVisibilityQuery=!1,this.handles=new t,this.graphicsCoreOwner=null,this.layer=null,this.queryGraphicUIDsInExtent=null,this.extent=null,this.graphicsCore=null,this.basemapTerrain=null,this.layerScaleEnabled=!0,this.suspended=!1,this.updating=!0}setup(e,i,t,s,a){this.graphicsCoreOwner=e,this.layer=i,this.queryGraphicUIDsInExtent=t,this.graphicsCore=s,this.basemapTerrain=a,this.updateScaleRangeActive();const r=this.graphicsCoreOwner.view.resourceController.scheduler;this.handles.add(r.registerTask(o.SCALE_VISIBILITY,this))}destroy(){this.handles.destroy(),this.handles=null,this.graphicsCoreOwner=null,this.extent=null,this.queryGraphicUIDsInExtent=null,this.graphicsCore=null}_setDirty(){this.updating||this._set("updating",!0)}setExtent(e){this.extent=e,this._setDirty()}scaleRangeActive(){return this._scaleRangeActive}updateScaleRangeActive(){const e=this.layer,i=e.effectiveScaleRange;let t=this.layerScaleEnabled&&u(i.minScale,i.maxScale);e.labelingInfo&&!t&&(t=e.labelingInfo.some((e=>e&&u(e.minScale,e.maxScale))));const s=this._scaleRangeActive!==t;return this._scaleRangeActive=t,t&&!this.handles.has(d)&&this.basemapTerrain?(this.handles.add(this.basemapTerrain.on("scale-change",(e=>this._scaleUpdateHandler(e))),d),this.layerScaleEnabled&&this.handles.add(this.basemapTerrain.on("tiles-visibility-changed",(()=>this._setDirty())),d)):!t&&this.handles.has(d)&&this.handles.remove(d),s}get running(){return!(!this.graphicsCoreOwner.view.basemapTerrain||!this.updating)}runTask(){const e=this.graphicsCoreOwner.view.basemapTerrain;if(this.extent&&e&&e.ready&&this._scaleRangeActive&&this.layerScaleEnabled){if(!this.layerScaleRangeVisibilityQuery){this.layerScaleRangeVisibilityQuery=!0;const i=this.layer.effectiveScaleRange;e.queryVisibleScaleRange(this.extent,i.minScale,i.maxScale,(e=>this._finishUpdate(e)))}}else this._finishUpdate(!0)}_finishUpdate(e){this.layerScaleRangeVisibilityQuery=!1,this._set("suspended",!e),this._set("updating",!1)}_visibleAtLayerScale(e){const i=this.layer.effectiveScaleRange;return!this.layerScaleEnabled||h(e,i.minScale||0,i.maxScale||0)}_visibleAtLabelScale(e,i){return h(e,i.minScale||0,i.maxScale||0)}_graphicScale(e){let i;if(s(e.centroid)?i=e.centroid:s(e.graphic.geometry)&&"point"===e.graphic.geometry.type&&(i=e.graphic.geometry),i){return this.graphicsCoreOwner.view.basemapTerrain?this.graphicsCoreOwner.view.basemapTerrain.getScale(i):1}return null}_graphicVisible(e){if(!this.layerScaleEnabled)return!0;const i=this._graphicScale(e);return this._visibleAtLayerScale(i)}updateVisibility(e){if(this._scaleRangeActive){const i=this._graphicVisible(e);return e.setVisibilityFlag(n.SCALE_RANGE,i,c.GRAPHIC)}return!1}updateGraphicLabelScaleVisibility(e){if(!this._scaleRangeActive)return!1;if(!e.labelGraphics||0===e.labelGraphics.length)return!1;const i=this._graphicScale(e),t=this._updateLabelScaleVisibility(e,i);return t&&(this.graphicsCoreOwner.view.deconflictor.setDirty(),this.graphicsCoreOwner.view.labeler.setDirty()),t}_updateLabelScaleVisibility(e,i){if(!e.labelGraphics||0===e.labelGraphics.length)return!1;const t=e.labelGraphics[0]._labelClass;if(t&&null!=t.minScale&&null!=t.maxScale){const s=this._visibleAtLabelScale(i,t);if(e.setVisibilityFlag(n.SCALE_RANGE,s,c.LABEL))return!0}return!1}_scaleUpdateHandler(e){if(this._setDirty(),this.graphicsCoreOwner.suspended)return;const i=e.extent,t=e.scale,r=this._visibleAtLayerScale(t);let l=!1;this.queryGraphicUIDsInExtent(i,e.spatialReference,(e=>{const h=this.graphicsCore.getGraphics3DGraphicById(e);if(a(h))return;const o=h.centroid;s(o)&&(i[0]>o.x||i[1]>o.y||i[2]<o.x||i[3]<o.y)||(h.setVisibilityFlag(n.SCALE_RANGE,r,c.GRAPHIC)&&(l=!0),this._updateLabelScaleVisibility(h,t)&&(l=!0))})),l&&(this.graphicsCoreOwner.view.deconflictor.setDirty(),this.graphicsCoreOwner.view.labeler.setDirty())}layerMinMaxScaleChangeHandler(){this.updateScaleRangeActive()&&!this._scaleRangeActive?this.graphicsCore.modifyGraphics3DGraphicVisibilities((e=>e.clearVisibilityFlag(n.SCALE_RANGE))):this._scaleRangeActive&&this.graphicsCore.updateAllGraphicsVisibility(),this._setDirty()}};function u(e,i){return e>0||i>0}e([r({constructOnly:!0})],p.prototype,"layerScaleEnabled",void 0),e([r({readOnly:!0})],p.prototype,"suspended",void 0),e([r({readOnly:!0})],p.prototype,"updating",void 0),p=e([l("esri.views.3d.layers.graphics.Graphics3DScaleVisibility")],p);const d="terrain-events",y=p;export{y as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
4
  */
5
- class e{constructor(e){this.schedule=e,this.sharedResources=null,this.streamDataRequester=null,this.elevationProvider=null,this.renderer=null,this.stage=null,this.clippingExtent=null,this.renderCoordsHelper=null,this.overlaySR=null,this.layer=null,this.layerView=null,this.localOriginFactory=null,this.featureExpressionInfoContext=null,this.screenSizePerspectiveEnabled=!0,this.slicePlaneEnabled=!1,this.physicalBasedRenderingEnabled=!1,this.isAsync=!1}}class l{}export{e as Graphics3DSymbolCreationContext,l as Graphics3DSymbolLayerCreationContext};
5
+ class e{constructor(e){this.schedule=e,this.sharedResources=null,this.streamDataRequester=null,this.elevationProvider=null,this.renderer=null,this.stage=null,this.clippingExtent=null,this.renderCoordsHelper=null,this.overlaySR=null,this.layer=null,this.graphicsCoreOwner=null,this.localOriginFactory=null,this.featureExpressionInfoContext=null,this.screenSizePerspectiveEnabled=!0,this.slicePlaneEnabled=!1,this.physicalBasedRenderingEnabled=!1,this.isAsync=!1}}class l{}export{e as Graphics3DSymbolCreationContext,l as Graphics3DSymbolLayerCreationContext};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../../Color.js";import"../../../../core/has.js";import t from"../../../../core/Logger.js";import{isSome as o,unwrap as i,unwrapOr as r}from"../../../../core/maybe.js";import{O as n}from"../../../../chunks/vec3f64.js";import{f as s}from"../../../../chunks/vec4f64.js";import{SymbolUpdateType as a}from"./elevationAlignmentUtils.js";import{ElevationContext as l}from"./ElevationContext.js";import{zeroContext as p}from"./featureExpressionInfoUtils.js";import{mixinColorAndOpacity as d}from"./graphicUtils.js";import{ApplyRendererDiffResult as c}from"./interfaces.js";import{Loadable as u}from"./Loadable.js";import{defaultSymbolLayerComplexity as h}from"./symbolComplexity.js";const f=t.getLogger("esri.views.3d.layers.graphics.Graphics3DSymbolLayer");class y extends u{constructor(e,t,o,i){super(o.schedule),this._context=o,this._elevationInfoOverride=null,this.complexity=null,this.logger=f,this._elevationOptions={supportsOffsetAdjustment:!1,supportsOnTheGround:!0},this.symbol=e,this.symbolLayer=t,this._renderPriority=i.renderPriority,this._renderPriorityStep=i.renderPriorityStep,this._elevationContext=new l,this.complexity=this.computeComplexity(),this._updateDrivenProperties(i.ignoreDrivers),this._updateElevationContext()}getCachedSize(){return null}get extentPadding(){return 0}get needsDrivenTransparentPass(){return this._drivenProperties.opacity&&!this._drivenProperties.opacityAlwaysOpaque}_logGeometryCreationWarnings(e,t,o,i){const r=e.projectionSuccess,n="polygons"in e?e.polygons:null,s=`${i} geometry failed to be created`;let a=null;r?!t.length||1===t.length&&!t[0].length?a=`${s} (no ${o} were defined)`:Array.isArray(t)&&Array.isArray(t[0])?n&&0===n.length&&"rings"===o&&t.length>0&&t[0].length>2&&(a=`${s} (filled rings should use clockwise winding - try reversing the order of vertices)`):a=`${s} (${o} should be defined as a 2D array)`:a=`${s} (failed to project geometry to view spatial reference)`,a&&f.warnOncePerTick(a)}_validateGeometry(e,t=null,i=null){if(o(t)&&!t.includes(e.type))return this.logger.warn("unsupported geometry type for "+i+` symbol: ${e.type}`),!1;if("point"===e.type){const t=e;if(!isFinite(t.x)||!isFinite(t.y))return f.warn("point coordinate is not a valid number, graphic skipped"),!1}return!0}_defaultElevationInfoNoZ(){return m}_defaultElevationInfoZ(){return g}_updateElevationContext(){o(this._elevationInfoOverride)?(this._elevationContext.setFromElevationInfo(this._elevationInfoOverride),this._elevationContext.updateFeatureExpressionInfoContext(null)):this._context.layer.elevationInfo?(this._elevationContext.setFromElevationInfo(this._context.layer.elevationInfo),this._elevationContext.updateFeatureExpressionInfoContext(this._context.featureExpressionInfoContext)):this._elevationContext.reset()}getDefaultElevationInfo(e){return e.hasZ?this._defaultElevationInfoZ():this._defaultElevationInfoNoZ()}getGeometryElevationMode(e,t=this.getDefaultElevationInfo(e)){return this._elevationContext.mode||t.mode}setElevationInfoOverride(e){this._elevationInfoOverride=e,this._updateElevationContext()}setGraphicElevationContext(e,t){const o=i(e.geometry),n=this.getDefaultElevationInfo(o);t.unit=null!=this._elevationContext.unit?this._elevationContext.unit:n.unit,t.mode=this.getGeometryElevationMode(o,n),t.offsetMeters=r(this._elevationContext.meterUnitOffset,r(n.offset,0));const s=!this._elevationOptions.supportsOnTheGround&&"on-the-ground"===t.mode;s&&(t.mode="relative-to-ground",t.offsetMeters=0);const a=s?p:this._elevationContext.featureExpressionInfoContext;return t.updateFeatureExpressionInfoContext(a,e,this._context.layer),t}prepareSymbolLayerPatch(e){}updateGeometry(e,t){return!1}onRemoveGraphic(e){}_updateDrivenProperties(e){const t={color:!1,opacity:!1,opacityAlwaysOpaque:!0,size:!1};if(e)return void(this._drivenProperties=t);const o=this._context.renderer;o&&"visualVariables"in o&&o.visualVariables&&o.visualVariables.forEach((e=>{switch(e.type){case"color":if(t.color=!0,e.stops)for(let o=0;o<e.stops.length;o++){const i=e.stops[o].color;i&&(t.opacity=!0,i.a<1&&(t.opacityAlwaysOpaque=!1))}break;case"opacity":t.opacity=!0,t.opacityAlwaysOpaque=!1;break;case"size":t.size=!0}})),this._drivenProperties=t}_getLayerOpacity(){if(this._context.layerView&&"fullOpacity"in this._context.layerView)return this._context.layerView.fullOpacity;const e=this._context.layer.opacity;return null==e?1:e}_getCombinedOpacity(e,t=_){let i=1;return this.draped||(i*=this._getLayerOpacity()),this._drivenProperties.opacity||(o(e)?i*=e.a:t.hasIntrinsicColor||(i=0)),i}_getCombinedOpacityAndColor(t,i=_){const r=this._getCombinedOpacity(t,i);if(this._drivenProperties.color)return d(null,r);const s=o(t)?e.toUnitRGB(t):n;return d(s,r)}_getVertexOpacityAndColor(e,t=null){const i=this._drivenProperties.color?e.color:null,r=this._drivenProperties.opacity?e.opacity:null,n=d(i,r);return o(t)&&(n[0]*=t,n[1]*=t,n[2]*=t,n[3]*=t),n}isFastUpdatesEnabled(){return this._fastUpdates&&this._fastUpdates.enabled}computeComplexity(){return h(this.symbol,this.symbolLayer)}globalPropertyChanged(e,t,o){switch(e){case"opacity":return this.layerOpacityChanged(t,o);case"elevationInfo":{const e=this._elevationContext.mode;this._updateElevationContext();return this.layerElevationInfoChanged(t,o,e)!==a.RECREATE}case"slicePlaneEnabled":return this.slicePlaneEnabledChanged(t,o);case"physicalBasedRenderingEnabled":return this.physicalBasedRenderingChanged();case"pixelRatio":return this.pixelRatioChanged();default:return!1}}updateGraphics3DGraphicElevationInfo(e,t,i){let r=a.UPDATE;return e.forEach((e=>{const n=t(e);if(o(n)){const t=e.graphic;this.setGraphicElevationContext(t,n.elevationContext),n.needsElevationUpdates=i(n.elevationContext.mode)}else r=a.RECREATE})),r}applyRendererDiff(e,t){return c.Recreate_Symbol}getFastUpdateAttrValues(e){if(!this._fastUpdates.enabled)return null;const t=this._fastUpdates.visualVariables,o=t.size?v(t.size.field,e):0,i=t.color?v(t.color.field,e):0,r=t.opacity?v(t.opacity.field,e):0;return s(o,i,r,0)}get draped(){return this._draped}ensureDrapedStatus(e){return null==this._draped?(this._draped=e,!0):(e!==this.draped&&f.warnOnce("A symbol can only produce either draped or non-draped visualizations. Use two separate symbol instances for draped and non-draped graphics if necessary."),!1)}}function v(e,t){const o=null!=e?t.attributes[e]:0;return null!=o&&isFinite(o)?o:0}const m={mode:"on-the-ground",offset:0,unit:"meters"},g={mode:"absolute-height",offset:0,unit:"meters"},_={hasIntrinsicColor:!1};export{y as Graphics3DSymbolLayer,y as default,v as getAttributeValue};
5
+ import e from"../../../../Color.js";import"../../../../core/has.js";import t from"../../../../core/Logger.js";import{isSome as o,unwrap as i,unwrapOr as r}from"../../../../core/maybe.js";import{O as n}from"../../../../chunks/vec3f64.js";import{f as s}from"../../../../chunks/vec4f64.js";import{SymbolUpdateType as a}from"./elevationAlignmentUtils.js";import{ElevationContext as l}from"./ElevationContext.js";import{zeroContext as p}from"./featureExpressionInfoUtils.js";import{mixinColorAndOpacity as d}from"./graphicUtils.js";import{ApplyRendererDiffResult as c}from"./interfaces.js";import{Loadable as u}from"./Loadable.js";import{defaultSymbolLayerComplexity as h}from"./symbolComplexity.js";const f=t.getLogger("esri.views.3d.layers.graphics.Graphics3DSymbolLayer");class y extends u{constructor(e,t,o,i){super(o.schedule),this._context=o,this._elevationInfoOverride=null,this.complexity=null,this.logger=f,this._elevationOptions={supportsOffsetAdjustment:!1,supportsOnTheGround:!0},this.symbol=e,this.symbolLayer=t,this._renderPriority=i.renderPriority,this._renderPriorityStep=i.renderPriorityStep,this._elevationContext=new l,this.complexity=this.computeComplexity(),this._updateDrivenProperties(i.ignoreDrivers),this._updateElevationContext()}getCachedSize(){return null}get extentPadding(){return 0}get needsDrivenTransparentPass(){return this._drivenProperties.opacity&&!this._drivenProperties.opacityAlwaysOpaque}_logGeometryCreationWarnings(e,t,o,i){const r=e.projectionSuccess,n="polygons"in e?e.polygons:null,s=`${i} geometry failed to be created`;let a=null;r?!t.length||1===t.length&&!t[0].length?a=`${s} (no ${o} were defined)`:Array.isArray(t)&&Array.isArray(t[0])?n&&0===n.length&&"rings"===o&&t.length>0&&t[0].length>2&&(a=`${s} (filled rings should use clockwise winding - try reversing the order of vertices)`):a=`${s} (${o} should be defined as a 2D array)`:a=`${s} (failed to project geometry to view spatial reference)`,a&&f.warnOncePerTick(a)}_validateGeometry(e,t=null,i=null){if(o(t)&&!t.includes(e.type))return this.logger.warn("unsupported geometry type for "+i+` symbol: ${e.type}`),!1;if("point"===e.type){const t=e;if(!isFinite(t.x)||!isFinite(t.y))return f.warn("point coordinate is not a valid number, graphic skipped"),!1}return!0}_defaultElevationInfoNoZ(){return m}_defaultElevationInfoZ(){return g}_updateElevationContext(){o(this._elevationInfoOverride)?(this._elevationContext.setFromElevationInfo(this._elevationInfoOverride),this._elevationContext.updateFeatureExpressionInfoContext(null)):this._context.layer.elevationInfo?(this._elevationContext.setFromElevationInfo(this._context.layer.elevationInfo),this._elevationContext.updateFeatureExpressionInfoContext(this._context.featureExpressionInfoContext)):this._elevationContext.reset()}getDefaultElevationInfo(e){return e.hasZ?this._defaultElevationInfoZ():this._defaultElevationInfoNoZ()}getGeometryElevationMode(e,t=this.getDefaultElevationInfo(e)){return this._elevationContext.mode||t.mode}setElevationInfoOverride(e){this._elevationInfoOverride=e,this._updateElevationContext()}setGraphicElevationContext(e,t){const o=i(e.geometry),n=this.getDefaultElevationInfo(o);t.unit=null!=this._elevationContext.unit?this._elevationContext.unit:n.unit,t.mode=this.getGeometryElevationMode(o,n),t.offsetMeters=r(this._elevationContext.meterUnitOffset,r(n.offset,0));const s=!this._elevationOptions.supportsOnTheGround&&"on-the-ground"===t.mode;s&&(t.mode="relative-to-ground",t.offsetMeters=0);const a=s?p:this._elevationContext.featureExpressionInfoContext;return t.updateFeatureExpressionInfoContext(a,e,this._context.layer),t}prepareSymbolLayerPatch(e){}updateGeometry(e,t){return!1}onRemoveGraphic(e){}_updateDrivenProperties(e){const t={color:!1,opacity:!1,opacityAlwaysOpaque:!0,size:!1};if(e)return void(this._drivenProperties=t);const o=this._context.renderer;o&&"visualVariables"in o&&o.visualVariables&&o.visualVariables.forEach((e=>{switch(e.type){case"color":if(t.color=!0,e.stops)for(let o=0;o<e.stops.length;o++){const i=e.stops[o].color;i&&(t.opacity=!0,i.a<1&&(t.opacityAlwaysOpaque=!1))}break;case"opacity":t.opacity=!0,t.opacityAlwaysOpaque=!1;break;case"size":t.size=!0}})),this._drivenProperties=t}_getLayerOpacity(){if(this._context.graphicsCoreOwner&&"fullOpacity"in this._context.graphicsCoreOwner)return this._context.graphicsCoreOwner.fullOpacity;const e=this._context.layer.opacity;return null==e?1:e}_getCombinedOpacity(e,t=_){let i=1;return this.draped||(i*=this._getLayerOpacity()),this._drivenProperties.opacity||(o(e)?i*=e.a:t.hasIntrinsicColor||(i=0)),i}_getCombinedOpacityAndColor(t,i=_){const r=this._getCombinedOpacity(t,i);if(this._drivenProperties.color)return d(null,r);const s=o(t)?e.toUnitRGB(t):n;return d(s,r)}_getVertexOpacityAndColor(e,t=null){const i=this._drivenProperties.color?e.color:null,r=this._drivenProperties.opacity?e.opacity:null,n=d(i,r);return o(t)&&(n[0]*=t,n[1]*=t,n[2]*=t,n[3]*=t),n}isFastUpdatesEnabled(){return this._fastUpdates&&this._fastUpdates.enabled}computeComplexity(){return h(this.symbol,this.symbolLayer)}globalPropertyChanged(e,t,o){switch(e){case"opacity":return this.layerOpacityChanged(t,o);case"elevationInfo":{const e=this._elevationContext.mode;this._updateElevationContext();return this.layerElevationInfoChanged(t,o,e)!==a.RECREATE}case"slicePlaneEnabled":return this.slicePlaneEnabledChanged(t,o);case"physicalBasedRenderingEnabled":return this.physicalBasedRenderingChanged();case"pixelRatio":return this.pixelRatioChanged();default:return!1}}updateGraphics3DGraphicElevationInfo(e,t,i){let r=a.UPDATE;return e.forEach((e=>{const n=t(e);if(o(n)){const t=e.graphic;this.setGraphicElevationContext(t,n.elevationContext),n.needsElevationUpdates=i(n.elevationContext.mode)}else r=a.RECREATE})),r}applyRendererDiff(e,t){return c.Recreate_Symbol}getFastUpdateAttrValues(e){if(!this._fastUpdates.enabled)return null;const t=this._fastUpdates.visualVariables,o=t.size?v(t.size.field,e):0,i=t.color?v(t.color.field,e):0,r=t.opacity?v(t.opacity.field,e):0;return s(o,i,r,0)}get draped(){return this._draped}ensureDrapedStatus(e){return null==this._draped?(this._draped=e,!0):(e!==this.draped&&f.warnOnce("A symbol can only produce either draped or non-draped visualizations. Use two separate symbol instances for draped and non-draped graphics if necessary."),!1)}}function v(e,t){const o=null!=e?t.attributes[e]:0;return null!=o&&isFinite(o)?o:0}const m={mode:"on-the-ground",offset:0,unit:"meters"},g={mode:"absolute-height",offset:0,unit:"meters"},_={hasIntrinsicColor:!1};export{y as Graphics3DSymbolLayer,y as default,v as getAttributeValue};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../../core/Error.js";import{isNone as t,get as r,isSome as n}from"../../../../core/maybe.js";import{pt2px as s}from"../../../../core/screenUtils.js";import{a as i}from"../../../../chunks/vec2f64.js";import{isCalloutSupport as o}from"../../../../symbols/callouts/calloutUtils.js";import{perObjectElevationAligner as a}from"./ElevationAligners.js";import{SymbolUpdateType as l,needsElevationUpdates2D as c}from"./elevationAlignmentUtils.js";import{ElevationContext as d}from"./ElevationContext.js";import{Graphics3DObject3DGraphicLayer as h}from"./Graphics3DObject3DGraphicLayer.js";import{Graphics3DSymbolLayer as f}from"./Graphics3DSymbolLayer.js";import{validateSymbolLayerSize as m,namedAnchorToHUDMaterialAnchorPos as p}from"./graphicUtils.js";import{placePointOnGeometry as u,createStageObjectForHUD as g,extendPointGraphicElevationContext as y}from"./pointUtils.js";import x from"../../webgl-engine/lib/GeometryUtil.js";import{TextRenderParameters as v}from"../../webgl-engine/lib/TextRenderParameters.js";import b from"../../webgl-engine/lib/TextTexture.js";import{HUDMaterial as O}from"../../webgl-engine/materials/HUDMaterial.js";const P=[0,0,1];class E extends f{constructor(e,t,r,n){super(e,t,r,n),this._elevationOptions={supportsOffsetAdjustment:!0,supportsOnTheGround:!1},this.ensureDrapedStatus(!1)}async doLoad(){if(!this._drivenProperties.size){const t=m(this.symbolLayer.size);if(t)throw new e("graphics3dtextsymbollayer:invalid-size",t)}this._createTextRenderParameters()}_createTextRenderParameters(){const e=this._context.layerView.view.pixelRatio;this._textRenderParameters=v.fromSymbol(this.symbolLayer,e)}destroy(){super.destroy()}createGraphics3DGraphic(e){const r=e.graphic,n=u(r.geometry);if(t(n))return this.logger.warn(`unsupported geometry type for text symbol: ${r.geometry.type}`),null;const s=this.symbolLayer.text;if(!s)return null;const i=o(this.symbol)&&this.symbol.hasVisibleVerticalOffset()?this.symbol:null;return this._createAs3DShape(r,n,s,i)}createLabel(e,r,n,s){const i=e.graphic,o=u(i.geometry);if(t(o))return this.logger.warn(`unsupported geometry type for label: ${i.geometry.type}`),null;const a=r.text;return!a||/^\s+$/.test(a)?null:this._createAs3DShape(i,o,a,r,r,n,s)}setGraphicElevationContext(e,t,r=0){const n=super.setGraphicElevationContext(e,t);return n.addOffsetRenderUnits(r),n}layerOpacityChanged(){return this.logger.warn("layer opacity change not yet implemented in Graphics3DTextSymbolLayer"),!1}layerElevationInfoChanged(e,t){return S(e,t,((e,t)=>{this.updateGraphicElevationContext(t,e)})),l.UPDATE}slicePlaneEnabledChanged(e,t){return S(e,t,(e=>{for(const t of e.stageObject.geometryRecords)t.material.setParameters({slicePlaneEnabled:this._context.slicePlaneEnabled})})),!0}physicalBasedRenderingChanged(){return!0}pixelRatioChanged(){return!1}updateGraphicElevationContext(e,t){this.setGraphicElevationContext(e,t.elevationContext,t.metadata.elevationOffset),t.needsElevationUpdates=c(t.elevationContext.mode)||"absolute-height"===t.elevationContext.mode}_defaultElevationInfoNoZ(){return w}_createAs3DShape(e,o,l,f,m=j,u,v){const E=this.setGraphicElevationContext(e,new d,m.elevationOffset),S="polyline"===r(e.geometry,"type"),w=e.uid,_=this._context.stage.renderView.renderingContext,C=m.anchor in p?m.anchor:"center",G=p[C],L=t(v)?new b(_,l,this._textRenderParameters):null,D={occlusionTest:!0,screenOffset:m.screenOffset,anchorPos:G,polygonOffset:!0,color:[1,1,1,1],centerOffsetUnits:m.centerOffsetUnits,debugDrawBorder:m.debugDrawBorder,drawInSecondSlot:!0};if(n(L)&&(D.textureId=L.id,D.texCoordScale=L.texcoordScale),n(v)&&(D.textureId=v.id),n(f)&&n(f.verticalOffset)){const{screenLength:e,minWorldLength:t,maxWorldLength:r}=f.verticalOffset;D.verticalOffset={screenLength:s(e),minWorldLength:t||0,maxWorldLength:null!=r?r:1/0}}if(this._context.screenSizePerspectiveEnabled){const{screenSizePerspectiveSettings:e,screenSizePerspectiveSettingsLabels:t}=this._context.sharedResources;D.screenSizePerspective=t.overridePadding(this._textRenderParameters.haloSize),D.screenSizePerspectiveAlignment=e}let U;if(S&&(D.shaderPolygonOffset=1e-4),D.slicePlaneEnabled=this._context.slicePlaneEnabled,n(u)){const e=JSON.stringify(D);U=u.get(e),t(U)&&(U=new O(D),u.add(e,U))}else U=new O(D);const R=[U],z=m.translation,T=n(L)?[L.displayWidth,L.displayHeight]:[0,0],A=m.centerOffset,W=P,I=[0,0],B=[x.createPointGeometry(W,z,null,T,A,I,null)],H=this._context.layer.uid,V=g(this._context,o,B,R,E,H,w);if(null===V)return null;const $=new h(this,V.object,B,t(u)?R:null,n(L)?[L]:null,a,E);$.alignedSampledElevation=V.sampledElevation,$.needsElevationUpdates=c(E.mode)||"absolute-height"===E.mode;const{displayWidth:N,displayHeight:k}=n(L)?L:m;$.getScreenSize=(e=i())=>(e[0]=N,e[1]=k,e);const J={labelText:l,elevationOffset:m.elevationOffset};return $.metadata=J,y($,o,this._context.elevationProvider),$}}function S(e,t,r){e&&e.forEach((e=>{const s=t(e);n(s)&&r(s,e.graphic)}))}const w={mode:"relative-to-ground",offset:0},j={text:null,translation:[0,0,0],elevationOffset:0,centerOffset:[0,0,0,1],screenOffset:[0,0],anchor:"center",verticalOffset:null,centerOffsetUnits:null,debugDrawBorder:!1,displayWidth:0,displayHeight:0};export{E as Graphics3DTextSymbolLayer,E as default};
5
+ import e from"../../../../core/Error.js";import{isNone as t,get as r,isSome as n}from"../../../../core/maybe.js";import{pt2px as s}from"../../../../core/screenUtils.js";import{a as o}from"../../../../chunks/vec2f64.js";import{isCalloutSupport as i}from"../../../../symbols/callouts/calloutUtils.js";import{perObjectElevationAligner as a}from"./ElevationAligners.js";import{SymbolUpdateType as l,needsElevationUpdates2D as c}from"./elevationAlignmentUtils.js";import{ElevationContext as h}from"./ElevationContext.js";import{Graphics3DObject3DGraphicLayer as d}from"./Graphics3DObject3DGraphicLayer.js";import{Graphics3DSymbolLayer as m}from"./Graphics3DSymbolLayer.js";import{validateSymbolLayerSize as f,namedAnchorToHUDMaterialAnchorPos as p}from"./graphicUtils.js";import{placePointOnGeometry as g,createStageObjectForHUD as u,extendPointGraphicElevationContext as y}from"./pointUtils.js";import b from"../../webgl-engine/lib/GeometryUtil.js";import{TextRenderParameters as x}from"../../webgl-engine/lib/TextRenderParameters.js";import v from"../../webgl-engine/lib/TextTexture.js";import{HUDMaterial as O}from"../../webgl-engine/materials/HUDMaterial.js";const w=[0,0,1];class P extends m{constructor(e,t,r,n){super(e,t,r,n),this._elevationOptions={supportsOffsetAdjustment:!0,supportsOnTheGround:!1},this.ensureDrapedStatus(!1)}async doLoad(){if(!this._drivenProperties.size){const t=f(this.symbolLayer.size);if(t)throw new e("graphics3dtextsymbollayer:invalid-size",t)}await this._createTextRenderParameters()}async _createTextRenderParameters(){const e=this._context.graphicsCoreOwner.view.pixelRatio;this._textRenderParameters=await x.fromSymbol(this.symbolLayer,e)}destroy(){super.destroy()}createGraphics3DGraphic(e){const r=e.graphic,n=g(r.geometry);if(t(n))return this.logger.warn(`unsupported geometry type for text symbol: ${r.geometry.type}`),null;const s=this.symbolLayer.text;if(t(s)||""===s)return null;const o=i(this.symbol)&&this.symbol.hasVisibleVerticalOffset()?this.symbol:null,a={..._,anchor:this._anchorFromAlignment(this.symbolLayer.horizontalAlignment,this.symbolLayer.verticalAlignment)};return this._createAs3DShape(r,n,s,o,a)}createLabel(e,r,n,s){const o=e.graphic,i=g(o.geometry);if(t(i))return this.logger.warn(`unsupported geometry type for label: ${o.geometry.type}`),null;const a=r.text;return!a||/^\s+$/.test(a)?null:this._createAs3DShape(o,i,a,r,r,n,s)}setGraphicElevationContext(e,t,r=0){const n=super.setGraphicElevationContext(e,t);return n.addOffsetRenderUnits(r),n}layerOpacityChanged(){return this.logger.warn("layer opacity change not yet implemented in Graphics3DTextSymbolLayer"),!1}layerElevationInfoChanged(e,t){return E(e,t,((e,t)=>{this.updateGraphicElevationContext(t,e)})),l.UPDATE}slicePlaneEnabledChanged(e,t){return E(e,t,(e=>{for(const t of e.stageObject.geometryRecords)t.material.setParameters({slicePlaneEnabled:this._context.slicePlaneEnabled})})),!0}physicalBasedRenderingChanged(){return!0}pixelRatioChanged(){return!1}updateGraphicElevationContext(e,t){this.setGraphicElevationContext(e,t.elevationContext,t.metadata.elevationOffset),t.needsElevationUpdates=c(t.elevationContext.mode)||"absolute-height"===t.elevationContext.mode}_defaultElevationInfoNoZ(){return S}_createAs3DShape(e,i,l,m,f=_,g,x){const P=this.setGraphicElevationContext(e,new h,f.elevationOffset),E="polyline"===r(e.geometry,"type"),S=e.uid,j=this._context.stage.renderView.renderingContext,L=f.anchor in p?f.anchor:"center",C=p[L],G=t(x)?new v(j,l,this._textRenderParameters):null,D={occlusionTest:!0,screenOffset:f.screenOffset,anchorPos:C,polygonOffset:!0,color:[1,1,1,1],centerOffsetUnits:f.centerOffsetUnits,debugDrawLabelBorder:f.debugDrawLabelBorder,drawInSecondSlot:!0};if(n(G)&&(D.textureId=G.id,D.texCoordScale=G.texcoordScale),n(x)&&(D.textureId=x.id),n(m)&&n(m.verticalOffset)){const{screenLength:e,minWorldLength:t,maxWorldLength:r}=m.verticalOffset;D.verticalOffset={screenLength:s(e),minWorldLength:t||0,maxWorldLength:null!=r?r:1/0}}if(this._context.screenSizePerspectiveEnabled){const{screenSizePerspectiveSettings:e,screenSizePerspectiveSettingsLabels:t}=this._context.sharedResources;D.screenSizePerspective=t.overridePadding(this._textRenderParameters.haloSize),D.screenSizePerspectiveAlignment=e}let U;if(E&&(D.shaderPolygonOffset=1e-4),D.slicePlaneEnabled=this._context.slicePlaneEnabled,n(g)){const e=JSON.stringify(D);U=g.get(e),t(U)&&(U=new O(D),g.add(e,U))}else U=new O(D);const A=[U],R=f.translation,z=n(G)?[G.displayWidth,G.displayHeight]:[0,0],T=f.centerOffset,W=w,I=[0,0],B=[b.createPointGeometry(W,R,null,z,T,I,null)],H=this._context.layer.uid,V=u(this._context,i,B,A,P,H,S);if(null===V)return null;const $=new d(this,V.object,B,t(g)?A:null,n(G)?[G]:null,a,P);$.alignedSampledElevation=V.sampledElevation,$.needsElevationUpdates=c(P.mode)||"absolute-height"===P.mode;const{displayWidth:F,displayHeight:N}=n(G)?G:f;$.getScreenSize=(e=o())=>(e[0]=F,e[1]=N,e);const k={labelText:l,elevationOffset:f.elevationOffset};return $.metadata=k,y($,i,this._context.elevationProvider),$}_anchorFromAlignment(e,t){switch(t){case"bottom":return"left"===e?"bottom-left":"right"===e?"bottom-right":"bottom";case"baseline":case"middle":return"justify"===e?"center":e;case"top":return"left"===e?"top-left":"right"===e?"top-right":"top"}}}function E(e,t,r){e&&e.forEach((e=>{const s=t(e);n(s)&&r(s,e.graphic)}))}const S={mode:"relative-to-ground",offset:0},_={text:null,translation:[0,0,0],elevationOffset:0,centerOffset:[0,0,0,1],screenOffset:[0,0],anchor:"center",verticalOffset:null,centerOffsetUnits:null,debugDrawLabelBorder:!1,displayWidth:0,displayHeight:0};export{P as Graphics3DTextSymbolLayer,P as default};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
+ */
5
+ import{_ as t}from"../../../../chunks/tslib.es6.js";import e from"../../../../Graphic.js";import i from"../../../../core/Accessor.js";import s from"../../../../core/Collection.js";import r from"../../../../core/Handles.js";import{isSome as a,destroyMaybe as o,isNone as n}from"../../../../core/maybe.js";import{isAbortError as c}from"../../../../core/promiseUtils.js";import{init as p}from"../../../../core/watchUtils.js";import{property as h}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/arrayUtils.js";import"../../../../core/has.js";import"../../../../core/accessorSupport/ensureType.js";import{subclass as l}from"../../../../core/accessorSupport/decorators/subclass.js";import{diff as d}from"../../../../core/accessorSupport/diffUtils.js";import u from"../../../../layers/Layer.js";import{hydrateGraphic as g}from"../../../../layers/graphics/hydratedFeatures.js";import m from"../../../../rest/support/Query.js";import{SUSPEND_RESUME_EXTENT_OPTIMISM as y}from"./constants.js";import{Graphics3DCore as f}from"./Graphics3DCore.js";import b from"./Graphics3DElevationAlignment.js";import{Graphics3DObjectStates as j}from"./Graphics3DObjectStates.js";import w from"./Graphics3DScaleVisibility.js";import{enlargeExtent as C}from"./graphicUtils.js";import{UpdatePolicy as S,Object3DState as v}from"../../webgl-engine/lib/basicInterfaces.js";import{WatchUpdatingTracking as x}from"../../../support/WatchUpdatingTracking.js";let E=class extends i{constructor(t){super(t),this.type="graphics-3d",this.graphicsCore=null,this.elevationAlignment=new b,this.watchUpdatingTracking=new x,this.handles=new r,this.suspendResumeExtent=null}normalizeCtorArgs(t){let e=null;t.scaleVisibilityEnabled&&(delete(t={...t}).scaleVisibilityEnabled,e=new w);const i=new f({owner:t.owner,layer:t.layer,preferredUpdatePolicy:S.SYNC,graphicSymbolSupported:!0});return{...t,graphicsCore:i,scaleVisibility:e}}initialize(){const{layer:t,scaleVisibility:e}=this;a(e)&&"graphics"===t.type&&this.watchUpdatingTracking.add((()=>t.effectiveScaleRange),(()=>e.layerMinMaxScaleChangeHandler())),"graphics"===t.type&&this.watchUpdatingTracking.add((()=>t.elevationInfo),((t,e)=>{d(t,e)&&this.watchUpdatingTracking.addPromise(this.graphicsCore.elevationInfoChange())}))}async setup(){const t=(t,e,i)=>this.graphicsCore.spatialIndex.queryGraphicUIDsInExtent(t,e,i);if(this.elevationAlignment.setup(this.owner,t,this.graphicsCore,this.view.elevationProvider),a(this.scaleVisibility)&&"effectiveScaleRange"in this.layer){const e=this.owner.view.basemapTerrain;this.scaleVisibility.setup(this.owner,this.layer,t,this.graphicsCore,e)}this._set("objectStates",new j(this.graphicsCore));try{await this.graphicsCore.setup({elevationAlignment:this.elevationAlignment,scaleVisibility:this.scaleVisibility,objectStates:this.objectStates})}catch(e){if(c(e))return;throw e}this.destroyed||(this.handles.add(this.view.watch("clippingArea",(()=>this._updateClippingExtent()),!0)),this._updateClippingExtent(),this._setupSuspendResumeExtent(),this.graphicsCore.startCreateGraphics())}destroy(){this.handles=o(this.handles),this.watchUpdatingTracking.destroy(),this._set("elevationAlignment",o(this.elevationAlignment)),this._set("scaleVisibility",o(this.scaleVisibility)),this._set("objectStates",o(this.objectStates)),this._set("graphicsCore",o(this.graphicsCore))}get suspended(){return!(!a(this.scaleVisibility)||!this.scaleVisibility.suspended)}get updating(){var t,e;return!!(null!=(t=this.graphicsCore)&&t.updating||a(this.scaleVisibility)&&this.scaleVisibility.updating||null!=(e=this.watchUpdatingTracking)&&e.updating)}getGraphicFromGraphicUid(t){if(this.owner.loadedGraphics){const e=this.owner.loadedGraphics.find((e=>e.uid===t));if(e){const t=this.layer instanceof u?this.layer:null;return g(e,t)}}}whenGraphicBounds(t,e){return this.graphicsCore?this.graphicsCore.whenGraphicBounds(t,e):Promise.reject()}computeAttachmentOrigin(t,e){return this.graphicsCore?this.graphicsCore.computeAttachmentOrigin(t,e):null}getSymbolLayerSize(t,e){return this.graphicsCore?this.graphicsCore.getSymbolLayerSize(t,e):null}maskOccludee(t){const{set:e,handle:i}=this.objectStates.acquireSet(v.MaskOccludee,null);return this.objectStates.setUid(e,t.uid),i}highlight(t){if(t instanceof m)return V;if("number"==typeof t)return this.highlight([t]);if(t instanceof e)return this.highlight([t]);if(t instanceof s&&(t=t.toArray()),Array.isArray(t)&&t.length>0){if(t[0]instanceof e){const e=t.map((t=>t.uid)),{set:i,handle:s}=this.objectStates.acquireSet(v.Highlight,null);return this.objectStates.setUids(i,e),s}if("number"==typeof t[0]){const e=t,{set:i,handle:s}=this.objectStates.acquireSet(v.Highlight,null);return this.objectStates.setObjectIds(i,e),s}}return V}_updateClippingExtent(){const t=this.view.clippingArea;this.graphicsCore.setClippingExtent(t,this.view.spatialReference)&&this.graphicsCore.recreateAllGraphics()}_updateSuspendResumeExtent(){n(this.scaleVisibility)||(this.suspendResumeExtent=C(this.graphicsCore.computedExtent,this.suspendResumeExtent,y,this.graphicsCore.extentPadding),this.scaleVisibility.setExtent(this.suspendResumeExtent))}_setupSuspendResumeExtent(){n(this.scaleVisibility)||(p(this.graphicsCore,"computedExtent",(t=>this._updateSuspendResumeExtent()),!0),this.graphicsCore.watch("extentPadding",(t=>this._updateSuspendResumeExtent())))}};t([h()],E.prototype,"type",void 0),t([h({constructOnly:!0})],E.prototype,"owner",void 0),t([h({constructOnly:!0})],E.prototype,"layer",void 0),t([h({readOnly:!0,aliasOf:"owner.view"})],E.prototype,"view",void 0),t([h({constructOnly:!0})],E.prototype,"graphicsCore",void 0),t([h({constructOnly:!0})],E.prototype,"scaleVisibility",void 0),t([h({readOnly:!0})],E.prototype,"elevationAlignment",void 0),t([h({readOnly:!0})],E.prototype,"objectStates",void 0),t([h({readOnly:!0})],E.prototype,"watchUpdatingTracking",void 0),t([h({readOnly:!0})],E.prototype,"suspended",null),t([h({readOnly:!0})],E.prototype,"updating",null),E=t([l("esri.views.3d.layers.graphics.GraphicsProcessor")],E);const V={remove(){},pause(){},resume(){}},A=E;export{A as default};
@@ -0,0 +1,4 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
+ */
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../chunks/tslib.es6.js";import t from"../../../../core/Accessor.js";import{forEach as s,result as l}from"../../../../core/asyncUtils.js";import a from"../../../../core/Handles.js";import i from"../../../../core/Logger.js";import{someMap as r}from"../../../../core/MapUtils.js";import{destroyMaybe as o,disposeMaybe as n,isNone as c,unwrap as h}from"../../../../core/maybe.js";import{throwIfAborted as b,isAbortError as d}from"../../../../core/promiseUtils.js";import{property as p}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/arrayUtils.js";import"../../../../core/has.js";import"../../../../core/accessorSupport/ensureType.js";import{subclass as u}from"../../../../core/accessorSupport/decorators/subclass.js";import{hydrateGraphic as g}from"../../../../layers/graphics/hydratedFeatures.js";import{createLabelFunction as y}from"../../../../layers/support/labelFormatUtils.js";import{areLabelsVisible as f}from"../../../../layers/support/layerUtils.js";import{isCalloutSupport as _}from"../../../../symbols/callouts/calloutUtils.js";import{VisibilityFlag as m,VisibilityGroup as C}from"./enums.js";import{make as x}from"./Graphics3DCalloutSymbolLayerFactory.js";import v from"./Graphics3DGraphicCreationContext.js";import{getGraphics3DSymbol as T}from"./graphicSymbolUtils.js";import{get as L}from"./labelPlacement.js";import G from"../../support/debugFlags.js";import{MaterialCollection as D}from"../../webgl-engine/lib/MaterialCollection.js";import{TextRenderer as R}from"../../webgl-engine/lib/TextRenderer.js";import{TextRenderParameters as A}from"../../webgl-engine/lib/TextRenderParameters.js";import w from"../../webgl-engine/lib/TextTextureAtlas.js";import{WebGLLayer as S}from"../../webgl-engine/lib/WebGLLayer.js";import{TaskPriority as I}from"../../../support/Scheduler.js";const O=i.getLogger("esri.views.3d.layers.graphics.Labeler");let j=class extends t{constructor(){super(...arguments),this._dirty=!1,this._labels=new Map,this._labelsToAdd=new Map,this._labelsToRemove=new Map,this._labelingContexts=new Array}setup(){this.dispose(),this._handles=new a,this._handles.add([this.view.watch("state.camera",(()=>this.setDirty())),this.view.watch("pixelRatio",(()=>this._resetAllLabels())),this.view.resourceController.scheduler.registerTask(I.LABELER,this)]),this._textTextureAtlas=new w({view:this.view}),this._hudMaterialCollection=new D(this.view._stage),this._calloutMaterialCollection=new D(this.view._stage)}dispose(){this._handles=o(this._handles),this._textTextureAtlas=n(this._textTextureAtlas),this._hudMaterialCollection=n(this._hudMaterialCollection),this._calloutMaterialCollection=n(this._calloutMaterialCollection),this._labelingContexts.length=0,this._labels.clear(),this._labelsToAdd.clear(),this._labelsToRemove.clear()}_activateLabelingContext(e){e.labels.forEach(((e,t)=>{this._labels.set(t,e),e.graphics3DGraphic.setVisibilityFlag(m.USER_SETTING,!0,C.LABEL)})),e.active=!0}_deactivateLabelingContext(e){e.labels.forEach(((e,t)=>{e.graphics3DGraphic.setVisibilityFlag(m.USER_SETTING,!1,C.LABEL),this.setLabelGraphicVisibility(e.graphics3DGraphic,!1),this._labels.delete(t)})),e.active=!1}_addLabelTextureToAtlas(e){for(const t of e.graphics3DGraphic.labelGraphics){if(!t._labelClass)continue;const s=e.textRenderers[t._labelIndex];s&&this._textTextureAtlas.addTextTexture(s,t.stageObject)}e.rendered=!0}_removeLabelTextureFromAtlas(e){for(const t of e.graphics3DGraphic.labelGraphics){if(!t._labelClass)continue;const s=e.textRenderers[t._labelIndex];s&&this._textTextureAtlas.removeTextTexture(s,t.stageObject)}e.rendered=!1}get running(){var e;return this.view.ready&&(this._dirty||(null==(e=this._textTextureAtlas)?void 0:e.updating)||this.deconflictor.running)}runTask(e){this._updateLabels(e),!this._dirty&&this.deconflictor.running&&this.deconflictor.runTask(e)}_updateLabels(e){if(this._dirty){this._dirty=!1;for(const t of this._labelingContexts)if(E(t)){if(!V(t)){if(F(t)){this._deactivateLabelingContext(t);continue}if(this._createLabelClassContext(t),P(t)){this._dirty=!0;continue}if(!V(t))continue}r(t.labelsToInitialize,((s,l)=>(this._ensureGraphics3DResources(s)&&(this._labels.set(l,s),this.deconflictor.setDirty(),e.madeProgress()),(s.visible&&s.hasTextTextureResources||!s.visible&&s.hasGraphics3DResources)&&(t.labelsToInitialize.delete(l),e.madeProgress()),e.done)))&&(this._dirty=!0)}this._labelsToRemove.forEach((e=>this._removeLabelTextureFromAtlas(e))),this._labelsToAdd.forEach((e=>this._addLabelTextureToAtlas(e))),this._labelsToRemove.clear(),this._labelsToAdd.clear(),this._dirty||this.notifyChange("updating")}}async _createLabelClassContextAsync(e){const t=e.labelClassAbortController.signal;await e.layer.when(),b(t),e.scaleVisibility&&e.scaleVisibility.updateScaleRangeActive();const a=e.graphics3DCore,i=a.layer,r=i.labelingInfo&&i.labelingInfo.filter((e=>!!e.symbol));if(!r||0===r.length)return;const o=new Array(r.length);let n=!1;await s(r,(async(s,i)=>{const r=s.symbol,h=T(a.getOrCreateGraphics3DSymbol(r));if(c(h))return void O.error("Failed to create Graphics3DSymbol for label");await h.load(),b(t);let d=null;_(r)&&r.hasVisibleCallout()&&(d=x(r,a.symbolCreationContext),await d.load(),b(t));const p=await l(y(s,e.layer.fieldsIndex,this.view.spatialReference));b(t),!0===p.ok?o[i]={labelClass:s,labelFunction:p.value,graphics3DSymbol:h,graphics3DCalloutSymbolLayer:d,calloutSymbolLayerIndex:0,textRenderParameters:this._createTextRenderParameters(h.symbol)}:(O.error(`Label expression failed to evaluate: ${p.error}`),n=!0)})),b(t),n||(e.labelClassContexts=o)}async _createLabelClassContext(e){return e.labelClassPromise||(e.labelClassPromise=this._createLabelClassContextAsync(e).catch((t=>{if(d(t))throw t;e.labelClassContexts=null})).then((()=>{e.labelClassAbortController=null,this.notifyChange("updating")})).catch((()=>{})),this.notifyChange("updating")),e.labelClassPromise}_createTextRenderParameters(e){const t=e.symbolLayers.getItemAt(0);return t&&"text"===t.type?A.fromSymbol(t,this.view.pixelRatio):null}_destroyLabelClassContext(e){for(const s of e.labelClassContexts)--s.graphics3DSymbol.referenced,s.graphics3DSymbol=null;const t=e.labelClassAbortController;e.labelClassAbortController=new AbortController,t&&t.abort(),e.labelClassContexts=[],e.labelClassPromise=null,this.notifyChange("updating")}_createTextSymbolGraphic(e,t,s,l,a){const i={text:e.text,centerOffset:s.centerOffset,translation:s.translation,elevationOffset:s.elevationOffset,screenOffset:s.screenOffset,anchor:s.anchor,centerOffsetUnits:s.centerOffsetUnits,verticalOffset:s.verticalOffset,debugDrawBorder:G.LABELS_SHOW_BORDER,displayWidth:e.displayWidth,displayHeight:e.displayHeight};return M.graphic=t,M.renderingInfo=null,M.layer=l,a.createLabel(M,i,this._hudMaterialCollection,this._textTextureAtlas)}_createLineCalloutGraphic(e,t,s,l,a){const i={symbol:t,translation:l.translation,elevationOffset:l.elevationOffset,screenOffset:l.screenOffset,centerOffset:l.centerOffset,centerOffsetUnits:l.centerOffsetUnits,materialCollection:this._calloutMaterialCollection};return M.graphic=e,M.renderingInfo=i,M.layer=a,s.createGraphics3DGraphic(M)}_ensureGraphics3DResources(e){if(e.hasGraphics3DResources)return!1;const t=e.graphics3DGraphic;if(t.destroyed)return!1;this._ensureTextTextureResources(e);const s=e.labelingContext,l=s.labelClassContexts;if(!l||0===l.length||!s.emptySymbolLabelSupported&&0===t.graphics.length)return!1;let a=!1;const i=t.graphic,r=s.layer,o=f(s.layer),n=this.view._stage;for(let h=0;h<l.length;h++){const b=e.textRenderers[h];if(!b)continue;const d=l[h],p=d.graphics3DSymbol;let u=null;p.symbol&&"label-3d"===p.symbol.type&&(u=p.symbol);const g=p.symbolLayers[0];if(!g)continue;const y=d.labelClass,f=s.disablePlacement,_=L({graphics3DGraphic:t,labelSymbol:u,labelClass:y,disablePlacement:f});if(c(_))continue;g.setElevationInfoOverride(s.elevationInfoOverride);const x=this._createTextSymbolGraphic(b,i,_,r,g);if(!x)return!1;x._labelClass=y,x._labelIndex=h,t.addLabelGraphic(x,n,s.stageLayer),t.setVisibilityFlag(m.USER_SETTING,o,C.LABEL),t.clearVisibilityFlag(m.SCALE_RANGE,C.LABEL),t.setVisibilityFlag(m.DECONFLICTION,!1,C.LABEL),a=!0;const v=d.graphics3DCalloutSymbolLayer;if(v&&_.hasLabelVerticalOffset){v.setElevationInfoOverride(s.elevationInfoOverride);const e=this._createLineCalloutGraphic(i,u,v,_,r);e&&(d.calloutSymbolLayerIndex=t.labelGraphics.length,t.addLabelGraphic(e,n,s.stageLayer))}break}return s.scaleVisibility&&a&&s.scaleVisibility.updateGraphicLabelScaleVisibility(t),e.hasGraphics3DResources=!0,!0}_destroyGraphics3DResources(e){const t=e.labelingContext.labelClassContexts;for(const s of e.graphics3DGraphic.labelGraphics){if(null==s._labelClass)continue;const e=t[s._labelIndex].graphics3DSymbol.symbolLayers[0];null!=e&&e.onRemoveGraphic(s)}e.graphics3DGraphic.clearLabelGraphics(),e.hasGraphics3DResources=!1}_ensureTextTextureResources(e){if(e.hasTextTextureResources)return;const t=e.labelingContext,s=t.labelClassContexts;if(!s||0===s.length)return;const l=e.graphics3DGraphic.graphic;for(let i=0;i<s.length;i++){const r=s[i];if(e.textRenderers[i]=null,!r.textRenderParameters)continue;const o=r.labelFunction;let n;if("arcade"===o.type)try{const e=o.needsHydrationToEvaluate()?g(l,t.layer):l;n=o.evaluate(e)}catch(a){n=null}else n=o.evaluate(l);c(n)||""===n||/^\s+$/.test(n)||(e.textRenderers[i]=new R(n,r.textRenderParameters))}e.hasTextTextureResources=!0}_destroyTextTextureResources(e){e.textRenderers=[],e.hasTextTextureResources=!1}_addGraphic(e,t){const s={hasGraphics3DResources:!1,hasTextTextureResources:!1,visible:!1,rendered:!1,labelingContext:e,graphics3DGraphic:t,textRenderers:[]},l=t.graphic.uid;e.labels.set(l,s),e.labelsToInitialize.set(l,s),this.setDirty(),this.deconflictor.setDirty()}_removeGraphic(e,t){const s=t.graphic.uid,l=e.labels.get(s);l&&(this._destroyGraphic(l,s),e.labels.delete(s),e.labelsToInitialize.delete(s),this.setDirty(),this.deconflictor.setDirty())}_destroyGraphic(e,t){this._labels.has(t)&&(this._labels.delete(t),this._labelsToAdd.delete(t),this._labelsToRemove.delete(t)),e.hasTextTextureResources&&(this._removeLabelTextureFromAtlas(e),this._destroyTextTextureResources(e)),e.hasGraphics3DResources&&this._destroyGraphics3DResources(e)}async _labelingInfoChange(e,t){if(!t)return this._visibilityInfoChange(e),this._resetLabels(e),this._createLabelClassContext(e);for(const s of t){const t=e.labels.get(s);t&&(this._removeGraphic(e,t.graphics3DGraphic),this._addGraphic(e,t.graphics3DGraphic))}}_globalPropertyChanged(e,t){for(const s of t.labelClassContexts){const l=new Map;t.labels.forEach((e=>{const t=e.graphics3DGraphic;l.set(t.graphic.uid,t)}));const a=e=>e.labelGraphics[0];if(h(s.graphics3DSymbol.symbolLayers[0]).globalPropertyChanged(e,l,a),s.graphics3DCalloutSymbolLayer){const t=e=>e.labelGraphics[s.calloutSymbolLayerIndex];s.graphics3DCalloutSymbolLayer.globalPropertyChanged(e,l,t)}}}_visibilityInfoChange(e){const t=e.layer.labelsVisible;t&&!e.active&&this._activateLabelingContext(e),!t&&e.active&&this._deactivateLabelingContext(e),this.setDirty()}_resetAllLabels(){for(const e of this._labelingContexts)this._resetLabels(e)}_resetLabels(e){e.labels.forEach(((t,s)=>{this._destroyGraphic(t,s),t.visible=!1,t.rendered=!1,e.labelsToInitialize.set(s,t)})),this._destroyLabelClassContext(e),this.setDirty(),this.deconflictor.setDirty()}_findLabelingContext(e){for(const t of this._labelingContexts)if(t.graphics3DCore===e)return t;return null}addGraphicsOwner(e,t,s){const l=s&&s.emptySymbolLabelSupported||!1,a=s&&s.elevationInfoOverride||null,i=s&&s.disablePlacement||null;if(this._findLabelingContext(e))return;const r=e.layer,o={graphics3DCore:e,layer:r,scaleVisibility:t,emptySymbolLabelSupported:l,elevationInfoOverride:a,disablePlacement:i,active:r.labelsVisible,labelClassPromise:null,labelClassAbortController:new AbortController,labelClassContexts:[],labels:new Map,labelsToInitialize:new Map,stageLayer:new S({isPickable:!0},r.uid)};return this.view._stage.add(o.stageLayer),this._labelingContexts.push(o),this.setDirty(),{addGraphic:e=>this._addGraphic(o,e),removeGraphic:e=>this._removeGraphic(o,e),featureReductionChange:()=>{},layerLabelsEnabled:()=>f(o.layer),labelingInfoChange:e=>this._labelingInfoChange(o,e),elevationInfoChange:()=>this._globalPropertyChanged("elevationInfo",o),slicePlaneEnabledChange:()=>this._globalPropertyChanged("slicePlaneEnabled",o),visibilityInfoChange:()=>this._visibilityInfoChange(o),reset:()=>this._resetLabels(o),clear:()=>{}}}removeGraphicsOwner(e){const t=this._findLabelingContext(e);if(!t)return;const s=this._labelingContexts.indexOf(t);this._labelingContexts.splice(s,1),t.labels.forEach((e=>this._removeGraphic(t,e.graphics3DGraphic))),this.view._stage.remove(t.stageLayer),t.stageLayer=null,this.setDirty()}setLabelGraphicVisibility(e,t){const s=e.graphic.uid,l=this._labels.get(s);l&&l.visible!==t&&(t&&!l.rendered?(this._labelsToAdd.set(s,l),this._labelsToRemove.delete(s),l.hasTextTextureResources||l.labelingContext.labelsToInitialize.set(s,l)):!t&&l.rendered&&(this._labelsToRemove.set(s,l),this._labelsToAdd.delete(s)),l.visible=t,this.setDirty())}setDirty(){!this._dirty&&this._labelingContexts.length>0&&(this._dirty=!0,this.notifyChange("updating"))}get updating(){var e;return this._dirty||(null==(e=this._textTextureAtlas)?void 0:e.updating)||this.deconflictor.updating||this._labelingContexts.some((e=>P(e)))}get updatingProgress(){if(!this.updating||!this._textTextureAtlas)return 1;const e=this._labelingContexts.length>0?this._labelingContexts.reduce(((e,t)=>e+(P(t)?0:1)),0)/this._labelingContexts.length:1;return(this._dirty?0:.3)+(this._textTextureAtlas.updating?0:.1)+.1*e+.5*this.deconflictor.updatingProgress}get test(){return{textTextureAtlas:this._textTextureAtlas,resetAllLabels:()=>this._resetAllLabels()}}};function E(e){return e.active&&f(e.layer)}function P(e){return e.labelClassPromise&&!!e.labelClassAbortController}function V(e){return e.labelClassContexts&&e.labelClassContexts.length}function F(e){return null===e.labelClassContexts}e([p({constructOnly:!0})],j.prototype,"view",void 0),e([p({constructOnly:!0})],j.prototype,"deconflictor",void 0),e([p()],j.prototype,"_textTextureAtlas",void 0),e([p({type:Boolean,readOnly:!0})],j.prototype,"updating",null),j=e([u("esri.views.3d.layers.graphics.Labeler")],j);const M=new v(null,null,null);export{j as Labeler};
5
+ import{_ as e}from"../../../../chunks/tslib.es6.js";import t from"../../../../core/Accessor.js";import{forEach as s,result as l}from"../../../../core/asyncUtils.js";import a from"../../../../core/Handles.js";import i from"../../../../core/Logger.js";import{someMap as r}from"../../../../core/MapUtils.js";import{destroyMaybe as o,disposeMaybe as n,isNone as c,isSome as h,unwrap as b}from"../../../../core/maybe.js";import{throwIfAborted as d,isAbortError as p}from"../../../../core/promiseUtils.js";import{property as u}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/arrayUtils.js";import"../../../../core/has.js";import"../../../../core/accessorSupport/ensureType.js";import{subclass as g}from"../../../../core/accessorSupport/decorators/subclass.js";import{hydrateGraphic as y}from"../../../../layers/graphics/hydratedFeatures.js";import{createLabelFunction as f}from"../../../../layers/support/labelFormatUtils.js";import{areLabelsVisible as _}from"../../../../layers/support/layerUtils.js";import{isCalloutSupport as m}from"../../../../symbols/callouts/calloutUtils.js";import{VisibilityFlag as C,VisibilityGroup as x}from"./enums.js";import{make as v}from"./Graphics3DCalloutSymbolLayerFactory.js";import T from"./Graphics3DGraphicCreationContext.js";import{getGraphics3DSymbol as L}from"./graphicSymbolUtils.js";import{get as G}from"./labelPlacement.js";import D from"../../support/debugFlags.js";import{MaterialCollection as R}from"../../webgl-engine/lib/MaterialCollection.js";import{TextRenderer as A}from"../../webgl-engine/lib/TextRenderer.js";import{TextRenderParameters as w}from"../../webgl-engine/lib/TextRenderParameters.js";import S from"../../webgl-engine/lib/TextTextureAtlas.js";import{WebGLLayer as I}from"../../webgl-engine/lib/WebGLLayer.js";import{TaskPriority as O}from"../../../support/Scheduler.js";const j=i.getLogger("esri.views.3d.layers.graphics.Labeler");let E=class extends t{constructor(){super(...arguments),this._dirty=!1,this._labels=new Map,this._labelsToAdd=new Map,this._labelsToRemove=new Map,this._labelingContexts=new Array}setup(){this.dispose(),this._handles=new a,this._handles.add([this.view.watch("state.camera",(()=>this.setDirty())),this.view.watch("pixelRatio",(()=>this._resetAllLabels())),this.view.resourceController.scheduler.registerTask(O.LABELER,this)]),this._textTextureAtlas=new S({view:this.view}),this._hudMaterialCollection=new R(this.view._stage),this._calloutMaterialCollection=new R(this.view._stage)}dispose(){this._handles=o(this._handles),this._textTextureAtlas=n(this._textTextureAtlas),this._hudMaterialCollection=n(this._hudMaterialCollection),this._calloutMaterialCollection=n(this._calloutMaterialCollection),this._labelingContexts.length=0,this._labels.clear(),this._labelsToAdd.clear(),this._labelsToRemove.clear()}_activateLabelingContext(e){e.labels.forEach(((e,t)=>{this._labels.set(t,e),e.graphics3DGraphic.setVisibilityFlag(C.USER_SETTING,!0,x.LABEL)})),e.active=!0}_deactivateLabelingContext(e){e.labels.forEach(((e,t)=>{e.graphics3DGraphic.setVisibilityFlag(C.USER_SETTING,!1,x.LABEL),this.setLabelGraphicVisibility(e.graphics3DGraphic,!1),this._labels.delete(t)})),e.active=!1}_addLabelTextureToAtlas(e){for(const t of e.graphics3DGraphic.labelGraphics){if(!t._labelClass)continue;const s=e.textRenderers[t._labelIndex];s&&this._textTextureAtlas.addTextTexture(s,t.stageObject)}e.rendered=!0}_removeLabelTextureFromAtlas(e){for(const t of e.graphics3DGraphic.labelGraphics){if(!t._labelClass)continue;const s=e.textRenderers[t._labelIndex];s&&this._textTextureAtlas.removeTextTexture(s,t.stageObject)}e.rendered=!1}get running(){var e;return this.view.ready&&(this._dirty||(null==(e=this._textTextureAtlas)?void 0:e.updating)||this.deconflictor.running)}runTask(e){this._updateLabels(e),!this._dirty&&this.deconflictor.running&&this.deconflictor.runTask(e)}_updateLabels(e){if(this._dirty){this._dirty=!1;for(const t of this._labelingContexts)if(P(t)){if(!F(t)){if(M(t)){this._deactivateLabelingContext(t);continue}if(this._createLabelClassContext(t),V(t)){this._dirty=!0;continue}if(!F(t))continue}r(t.labelsToInitialize,((s,l)=>(this._ensureGraphics3DResources(s)&&(this._labels.set(l,s),this.deconflictor.setDirty(),e.madeProgress()),(s.visible&&s.hasTextTextureResources||!s.visible&&s.hasGraphics3DResources)&&(t.labelsToInitialize.delete(l),e.madeProgress()),e.done)))&&(this._dirty=!0)}this._labelsToRemove.forEach((e=>this._removeLabelTextureFromAtlas(e))),this._labelsToAdd.forEach((e=>this._addLabelTextureToAtlas(e))),this._labelsToRemove.clear(),this._labelsToAdd.clear(),this._dirty||this.notifyChange("updating")}}async _createLabelClassContextAsync(e){const t=e.labelClassAbortController.signal;await e.layer.when(),d(t),e.scaleVisibility&&e.scaleVisibility.updateScaleRangeActive();const a=e.graphics3DCore,i=a.layer,r=i.labelingInfo&&i.labelingInfo.filter((e=>!!e.symbol));if(!r||0===r.length)return;const o=new Array(r.length);let n=!1;await s(r,(async(s,i)=>{const r=s.symbol,h=L(a.getOrCreateGraphics3DSymbol(r));if(c(h))return void j.error("Failed to create Graphics3DSymbol for label");await h.load(),d(t);let b=null;m(r)&&r.hasVisibleCallout()&&(b=v(r,a.symbolCreationContext),await b.load(),d(t));const p=await l(f(s,e.layer.fieldsIndex,this.view.spatialReference));if(d(t),!0===p.ok){const e=await this._createTextRenderParameters(h.symbol);d(t),o[i]={labelClass:s,labelFunction:p.value,graphics3DSymbol:h,graphics3DCalloutSymbolLayer:b,calloutSymbolLayerIndex:0,textRenderParameters:e}}else j.error(`Label expression failed to evaluate: ${p.error}`),n=!0})),d(t),n||(e.labelClassContexts=o)}async _createLabelClassContext(e){return e.labelClassPromise||(e.labelClassPromise=this._createLabelClassContextAsync(e).catch((t=>{if(p(t))throw t;e.labelClassContexts=null})).then((()=>{e.labelClassAbortController=null,this.notifyChange("updating")})).catch((()=>{})),this.notifyChange("updating")),e.labelClassPromise}async _createTextRenderParameters(e){const t=e.symbolLayers.getItemAt(0);return t&&"text"===t.type?w.fromSymbol(t,this.view.pixelRatio):null}_destroyLabelClassContext(e){for(const s of e.labelClassContexts)--s.graphics3DSymbol.referenced,s.graphics3DSymbol=null;const t=e.labelClassAbortController;e.labelClassAbortController=new AbortController,t&&t.abort(),e.labelClassContexts=[],e.labelClassPromise=null,this.notifyChange("updating")}_createTextSymbolGraphic(e,t,s,l,a){const i={text:e.text,centerOffset:s.centerOffset,translation:s.translation,elevationOffset:s.elevationOffset,screenOffset:s.screenOffset,anchor:s.anchor,centerOffsetUnits:s.centerOffsetUnits,verticalOffset:s.verticalOffset,debugDrawLabelBorder:D.LABELS_SHOW_BORDER,displayWidth:e.displayWidth,displayHeight:e.displayHeight};return U.graphic=t,U.renderingInfo=null,U.layer=l,a.createLabel(U,i,this._hudMaterialCollection,this._textTextureAtlas)}_createLineCalloutGraphic(e,t,s,l,a){const i={symbol:t,translation:l.translation,elevationOffset:l.elevationOffset,screenOffset:l.screenOffset,centerOffset:l.centerOffset,centerOffsetUnits:l.centerOffsetUnits,materialCollection:this._calloutMaterialCollection};return U.graphic=e,U.renderingInfo=i,U.layer=a,s.createGraphics3DGraphic(U)}_ensureGraphics3DResources(e){if(e.hasGraphics3DResources)return!1;const t=e.graphics3DGraphic;if(t.destroyed)return!1;this._ensureTextTextureResources(e);const s=e.labelingContext,l=s.labelClassContexts;if(!l||0===l.length||!s.emptySymbolLabelSupported&&0===t.graphics.length)return!1;let a=!1;const i=t.graphic,r=s.layer,o=_(s.layer),n=this.view._stage;for(let b=0;b<l.length;b++){const d=e.textRenderers[b];if(!d)continue;const p=l[b],u=p.graphics3DSymbol;let g=null;u.symbol&&"label-3d"===u.symbol.type&&(g=u.symbol);const y=u.symbolLayers[0];if(!y)continue;const f=p.labelClass,_=s.disablePlacement,m=G({graphics3DGraphic:t,labelSymbol:g,labelClass:f,disablePlacement:_});if(c(m))continue;y.setElevationInfoOverride(s.elevationInfoOverride);const v=this._createTextSymbolGraphic(d,i,m,r,y);if(!v)return!1;v._labelClass=f,v._labelIndex=b,t.addLabelGraphic(v,n,s.stageLayer),t.setVisibilityFlag(C.USER_SETTING,o,x.LABEL),t.clearVisibilityFlag(C.SCALE_RANGE,x.LABEL),t.setVisibilityFlag(C.DECONFLICTION,!1,x.LABEL),a=!0;const T=p.graphics3DCalloutSymbolLayer;if(T&&m.hasLabelVerticalOffset){T.setElevationInfoOverride(s.elevationInfoOverride);const e=this._createLineCalloutGraphic(i,g,T,m,r);h(e)&&(p.calloutSymbolLayerIndex=t.labelGraphics.length,t.addLabelGraphic(e,n,s.stageLayer))}break}return s.scaleVisibility&&a&&s.scaleVisibility.updateGraphicLabelScaleVisibility(t),e.hasGraphics3DResources=!0,!0}_destroyGraphics3DResources(e){const t=e.labelingContext.labelClassContexts;for(const s of e.graphics3DGraphic.labelGraphics){if(null==s._labelClass)continue;const e=t[s._labelIndex].graphics3DSymbol.symbolLayers[0];null!=e&&e.onRemoveGraphic(s)}e.graphics3DGraphic.clearLabelGraphics(),e.hasGraphics3DResources=!1}_ensureTextTextureResources(e){if(e.hasTextTextureResources)return;const t=e.labelingContext,s=t.labelClassContexts;if(!s||0===s.length)return;const l=e.graphics3DGraphic.graphic;for(let i=0;i<s.length;i++){const r=s[i];if(e.textRenderers[i]=null,!r.textRenderParameters)continue;const o=r.labelFunction;let n;if("arcade"===o.type)try{const e=o.needsHydrationToEvaluate()?y(l,t.layer):l;n=o.evaluate(e)}catch(a){n=null}else n=o.evaluate(l);c(n)||""===n||/^\s+$/.test(n)||(e.textRenderers[i]=new A(n,r.textRenderParameters))}e.hasTextTextureResources=!0}_destroyTextTextureResources(e){e.textRenderers=[],e.hasTextTextureResources=!1}_addGraphic(e,t){const s={hasGraphics3DResources:!1,hasTextTextureResources:!1,visible:!1,rendered:!1,labelingContext:e,graphics3DGraphic:t,textRenderers:[]},l=t.graphic.uid;e.labels.set(l,s),e.labelsToInitialize.set(l,s),this.setDirty(),this.deconflictor.setDirty()}_removeGraphic(e,t){const s=t.graphic.uid,l=e.labels.get(s);l&&(this._destroyGraphic(l,s),e.labels.delete(s),e.labelsToInitialize.delete(s),this.setDirty(),this.deconflictor.setDirty())}_destroyGraphic(e,t){this._labels.has(t)&&(this._labels.delete(t),this._labelsToAdd.delete(t),this._labelsToRemove.delete(t)),e.hasTextTextureResources&&(this._removeLabelTextureFromAtlas(e),this._destroyTextTextureResources(e)),e.hasGraphics3DResources&&this._destroyGraphics3DResources(e)}async _labelingInfoChange(e,t){if(!t)return this._visibilityInfoChange(e),this._resetLabels(e),this._createLabelClassContext(e);for(const s of t){const t=e.labels.get(s);t&&(this._removeGraphic(e,t.graphics3DGraphic),this._addGraphic(e,t.graphics3DGraphic))}}_globalPropertyChanged(e,t){for(const s of t.labelClassContexts){const l=new Map;t.labels.forEach((e=>{const t=e.graphics3DGraphic;l.set(t.graphic.uid,t)}));const a=e=>e.labelGraphics[0];if(b(s.graphics3DSymbol.symbolLayers[0]).globalPropertyChanged(e,l,a),s.graphics3DCalloutSymbolLayer){const t=e=>e.labelGraphics[s.calloutSymbolLayerIndex];s.graphics3DCalloutSymbolLayer.globalPropertyChanged(e,l,t)}}}_visibilityInfoChange(e){const t=e.layer.labelsVisible;t&&!e.active&&this._activateLabelingContext(e),!t&&e.active&&this._deactivateLabelingContext(e),this.setDirty()}_resetAllLabels(){for(const e of this._labelingContexts)this._resetLabels(e)}_resetLabels(e){e.labels.forEach(((t,s)=>{this._destroyGraphic(t,s),t.visible=!1,t.rendered=!1,e.labelsToInitialize.set(s,t)})),this._destroyLabelClassContext(e),this.setDirty(),this.deconflictor.setDirty()}_findLabelingContext(e){for(const t of this._labelingContexts)if(t.graphics3DCore===e)return t;return null}addGraphicsOwner(e,t,s){const l=s&&s.emptySymbolLabelSupported||!1,a=s&&s.elevationInfoOverride||null,i=s&&s.disablePlacement||null;if(this._findLabelingContext(e))return;const r=e.layer,o={graphics3DCore:e,layer:r,scaleVisibility:t,emptySymbolLabelSupported:l,elevationInfoOverride:a,disablePlacement:i,active:r.labelsVisible,labelClassPromise:null,labelClassAbortController:new AbortController,labelClassContexts:[],labels:new Map,labelsToInitialize:new Map,stageLayer:new I({isPickable:!0},r.uid)};return this.view._stage.add(o.stageLayer),this._labelingContexts.push(o),this.setDirty(),{addGraphic:e=>this._addGraphic(o,e),removeGraphic:e=>this._removeGraphic(o,e),featureReductionChange:()=>{},layerLabelsEnabled:()=>_(o.layer),labelingInfoChange:e=>this._labelingInfoChange(o,e),elevationInfoChange:()=>this._globalPropertyChanged("elevationInfo",o),slicePlaneEnabledChange:()=>this._globalPropertyChanged("slicePlaneEnabled",o),visibilityInfoChange:()=>this._visibilityInfoChange(o),reset:()=>this._resetLabels(o),clear:()=>{}}}removeGraphicsOwner(e){const t=this._findLabelingContext(e);if(!t)return;const s=this._labelingContexts.indexOf(t);this._labelingContexts.splice(s,1),t.labels.forEach((e=>this._removeGraphic(t,e.graphics3DGraphic))),this.view._stage.remove(t.stageLayer),t.stageLayer=null,this.setDirty()}setLabelGraphicVisibility(e,t){const s=e.graphic.uid,l=this._labels.get(s);l&&l.visible!==t&&(t&&!l.rendered?(this._labelsToAdd.set(s,l),this._labelsToRemove.delete(s),l.hasTextTextureResources||l.labelingContext.labelsToInitialize.set(s,l)):!t&&l.rendered&&(this._labelsToRemove.set(s,l),this._labelsToAdd.delete(s)),l.visible=t,this.setDirty())}setDirty(){!this._dirty&&this._labelingContexts.length>0&&(this._dirty=!0,this.notifyChange("updating"))}get updating(){var e;return this._dirty||(null==(e=this._textTextureAtlas)?void 0:e.updating)||this.deconflictor.updating||this._labelingContexts.some((e=>V(e)))}get updatingProgress(){if(!this.updating||!this._textTextureAtlas)return 1;const e=this._labelingContexts.length>0?this._labelingContexts.reduce(((e,t)=>e+(V(t)?0:1)),0)/this._labelingContexts.length:1;return(this._dirty?0:.3)+(this._textTextureAtlas.updating?0:.1)+.1*e+.5*this.deconflictor.updatingProgress}get test(){return{textTextureAtlas:this._textTextureAtlas,resetAllLabels:()=>this._resetAllLabels()}}};function P(e){return e.active&&_(e.layer)}function V(e){return e.labelClassPromise&&!!e.labelClassAbortController}function F(e){return e.labelClassContexts&&e.labelClassContexts.length}function M(e){return null===e.labelClassContexts}e([u({constructOnly:!0})],E.prototype,"view",void 0),e([u({constructOnly:!0})],E.prototype,"deconflictor",void 0),e([u()],E.prototype,"_textTextureAtlas",void 0),e([u({type:Boolean,readOnly:!0})],E.prototype,"updating",null),E=e([g("esri.views.3d.layers.graphics.Labeler")],E);const U=new T(null,null,null);export{E as Labeler};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../chunks/tslib.es6.js";import"../../../../geometry.js";import r from"../../../../core/Accessor.js";import{isNone as t}from"../../../../core/maybe.js";import{property as s}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/arrayUtils.js";import"../../../../core/has.js";import"../../../../core/accessorSupport/ensureType.js";import{subclass as a}from"../../../../core/accessorSupport/decorators/subclass.js";import n from"../../../../geometry/Extent.js";import o from"../../../../layers/graphics/data/QueryEngine.js";import i from"../../../../rest/support/FeatureSet.js";import u from"../../../../rest/support/Query.js";import{featureGeometryTypeKebabDictionary as y}from"../../../../geometry/support/typeUtils.js";const c=o;let l=class extends r{constructor(e){super(e),this._dataQueryEngineInstance=null}get queryGeometryType(){switch(this.layer.geometryType){case"multipoint":case"point":case"polygon":case"polyline":return this.layer.geometryType;case"mesh":return"polygon";default:return}}get defaultQueryJSON(){return new u({outSpatialReference:this.spatialReference}).toJSON()}get dataQueryEngine(){return this._ensureDataQueryEngine()}destroy(){this.clear()}clear(){return!!this._dataQueryEngineInstance&&(this._dataQueryEngineInstance.destroy(),this._dataQueryEngineInstance=null,!0)}async executeQueryForIdSet(e,r){return this.dataQueryEngine.executeQueryForIdSet(this._ensureQueryJSON(e),r)}async executeQueryForCount(e,r){return this.dataQueryEngine.executeQueryForCount(this._ensureQueryJSON(e),r)}async executeQueryForExtent(e,r){const{count:t,extent:s}=await this.dataQueryEngine.executeQueryForExtent(this._ensureQueryJSON(e),r);return{count:t,extent:n.fromJSON(s)}}async executeQueryForIds(e,r){return this.dataQueryEngine.executeQueryForIds(this._ensureQueryJSON(e),r)}async executeQueryForLatestObservations(e,r){const t=await this.dataQueryEngine.executeQueryForLatestObservations(this._ensureQueryJSON(e),r),s=i.fromJSON(t);return s.features.forEach((e=>{e.layer=this.layer,e.sourceLayer=this.layer})),s}async executeQuery(e,r){const t=await this.dataQueryEngine.executeQuery(this._ensureQueryJSON(e),r),s=i.fromJSON(t);return s.features.forEach((e=>{e.layer=this.layer,e.sourceLayer=this.layer})),s}_ensureQueryJSON(e){return t(e)?this.defaultQueryJSON:("outSpatialReference"in e&&!e.outSpatialReference&&(e.outSpatialReference=this.spatialReference),e.toJSON())}_ensureDataQueryEngine(){if(this._dataQueryEngineInstance)return this._dataQueryEngineInstance;const e="timeInfo"in this.layer&&this.layer.timeInfo&&this.layer.timeInfo.toJSON()||null,r=this.layer.objectIdField,t=y.toJSON(this.queryGeometryType),s=this.layer.fields.map((e=>e.toJSON())),a=this.layerView.view.resourceController.scheduler,n=this.priority,o=this.spatialReference.toJSON(),i=this.layerView.graphics3d.graphicsCore.featureStore,{hasZ:u,hasM:l}=this.layerView;return this._dataQueryEngineInstance=new c({hasZ:u,hasM:l,geometryType:t,fields:s,timeInfo:e,spatialReference:o,objectIdField:r,featureStore:i,scheduler:a,priority:n}),this._dataQueryEngineInstance}};e([s({constructOnly:!0})],l.prototype,"layerView",void 0),e([s({constructOnly:!0})],l.prototype,"priority",void 0),e([s({readOnly:!0,aliasOf:"layerView.view.spatialReference"})],l.prototype,"spatialReference",void 0),e([s({readOnly:!0,aliasOf:"layerView.layer"})],l.prototype,"layer",void 0),e([s({readOnly:!0})],l.prototype,"queryGeometryType",null),e([s({readOnly:!0})],l.prototype,"defaultQueryJSON",null),l=e([a("esri.views.3d.layers.graphics.QueryEngine")],l);const p=l;export{l as QueryEngine,p as default};
5
+ import{_ as e}from"../../../../chunks/tslib.es6.js";import"../../../../geometry.js";import r from"../../../../core/Accessor.js";import{isNone as t}from"../../../../core/maybe.js";import{property as s}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/arrayUtils.js";import"../../../../core/has.js";import"../../../../core/accessorSupport/ensureType.js";import{subclass as a}from"../../../../core/accessorSupport/decorators/subclass.js";import n from"../../../../geometry/Extent.js";import o from"../../../../layers/graphics/data/QueryEngine.js";import i from"../../../../rest/support/FeatureSet.js";import u from"../../../../rest/support/Query.js";import{featureGeometryTypeKebabDictionary as y}from"../../../../geometry/support/typeUtils.js";const c=o;let l=class extends r{constructor(e){super(e),this._dataQueryEngineInstance=null}get queryGeometryType(){switch(this.layer.geometryType){case"multipoint":case"point":case"polygon":case"polyline":return this.layer.geometryType;case"mesh":return"polygon";default:return}}get defaultQueryJSON(){return new u({outSpatialReference:this.spatialReference}).toJSON()}get dataQueryEngine(){return this._ensureDataQueryEngine()}destroy(){this.clear()}clear(){return!!this._dataQueryEngineInstance&&(this._dataQueryEngineInstance.destroy(),this._dataQueryEngineInstance=null,!0)}async executeQueryForIdSet(e,r){return this.dataQueryEngine.executeQueryForIdSet(this._ensureQueryJSON(e),r)}async executeQueryForCount(e,r){return this.dataQueryEngine.executeQueryForCount(this._ensureQueryJSON(e),r)}async executeQueryForExtent(e,r){const{count:t,extent:s}=await this.dataQueryEngine.executeQueryForExtent(this._ensureQueryJSON(e),r);return{count:t,extent:n.fromJSON(s)}}async executeQueryForIds(e,r){return this.dataQueryEngine.executeQueryForIds(this._ensureQueryJSON(e),r)}async executeQueryForLatestObservations(e,r){const t=await this.dataQueryEngine.executeQueryForLatestObservations(this._ensureQueryJSON(e),r),s=i.fromJSON(t);return s.features.forEach((e=>{e.layer=this.layer,e.sourceLayer=this.layer})),s}async executeQuery(e,r){const t=await this.dataQueryEngine.executeQuery(this._ensureQueryJSON(e),r),s=i.fromJSON(t);return s.features.forEach((e=>{e.layer=this.layer,e.sourceLayer=this.layer})),s}_ensureQueryJSON(e){return t(e)?this.defaultQueryJSON:("outSpatialReference"in e&&!e.outSpatialReference&&(e.outSpatialReference=this.spatialReference),e.toJSON())}_ensureDataQueryEngine(){if(this._dataQueryEngineInstance)return this._dataQueryEngineInstance;const e="timeInfo"in this.layer&&this.layer.timeInfo&&this.layer.timeInfo.toJSON()||null,r=this.layer.objectIdField,t=y.toJSON(this.queryGeometryType),s=this.layer.fields.map((e=>e.toJSON())),a=this.layerView.view.resourceController.scheduler,n=this.priority,o=this.spatialReference.toJSON(),i=this.layerView.processor.featureStore,{hasZ:u,hasM:l}=this.layerView;return this._dataQueryEngineInstance=new c({hasZ:u,hasM:l,geometryType:t,fields:s,timeInfo:e,spatialReference:o,objectIdField:r,featureStore:i,scheduler:a,priority:n}),this._dataQueryEngineInstance}};e([s({constructOnly:!0})],l.prototype,"layerView",void 0),e([s({constructOnly:!0})],l.prototype,"priority",void 0),e([s({readOnly:!0,aliasOf:"layerView.view.spatialReference"})],l.prototype,"spatialReference",void 0),e([s({readOnly:!0,aliasOf:"layerView.layer"})],l.prototype,"layer",void 0),e([s({readOnly:!0})],l.prototype,"queryGeometryType",null),e([s({readOnly:!0})],l.prototype,"defaultQueryJSON",null),l=e([a("esri.views.3d.layers.graphics.QueryEngine")],l);const p=l;export{l as QueryEngine,p as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
4
  */
5
- import{_ as t}from"../../../../chunks/tslib.es6.js";import"../../../../geometry.js";import e from"../../../../core/Handles.js";import{property as r}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/arrayUtils.js";import"../../../../core/has.js";import"../../../../core/accessorSupport/ensureType.js";import{subclass as s}from"../../../../core/accessorSupport/decorators/subclass.js";import{TileTreeDebugger as i}from"../../../support/TileTreeDebugger.js";import{WatchUpdatingTracking as o,WatchFlags as a}from"../../../support/WatchUpdatingTracking.js";import n from"../../../../geometry/Polygon.js";let p=class extends i{constructor(t){super(t),this.watchUpdatingTracking=new o,this.handles=new e}initialize(){this.handles.add(this.view.featureTiles.addClient()),this.watchUpdatingTracking.addOnCollectionPropertyChange(this.view.featureTiles,"tiles",(()=>this.update()),a.INIT)}destroy(){this.handles&&(this.handles.destroy(),this.handles=null),this.watchUpdatingTracking.destroy()}getTiles(){const t=t=>{const[e,r,s]=t.lij;return n.fromExtent(this.view.featureTiles.tilingScheme.getExtentGeometry(e,r,s))};return this.view.featureTiles.tiles.toArray().sort(((t,e)=>t.loadPriority-e.loadPriority)).map((e=>({...e,geometry:t(e)})))}};t([r({readOnly:!0})],p.prototype,"watchUpdatingTracking",void 0),t([r({readOnly:!0,aliasOf:"watchUpdatingTracking.updating"})],p.prototype,"updating",void 0),p=t([s("esri.views.3d.layers.support.FeatureTileTree3DDebugger")],p);const c=p;export{p as FeatureTileTree3DDebugger,c as default};
5
+ import{_ as t}from"../../../../chunks/tslib.es6.js";import"../../../../geometry.js";import e from"../../../../core/Handles.js";import{initial as r}from"../../../../core/reactiveUtils.js";import{property as o}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/arrayUtils.js";import"../../../../core/has.js";import"../../../../core/accessorSupport/ensureType.js";import{subclass as s}from"../../../../core/accessorSupport/decorators/subclass.js";import{TileTreeDebugger as i}from"../../../support/TileTreeDebugger.js";import{WatchUpdatingTracking as a}from"../../../support/WatchUpdatingTracking.js";import n from"../../../../geometry/Polygon.js";let p=class extends i{constructor(t){super(t),this.watchUpdatingTracking=new a,this.handles=new e}initialize(){const{featureTiles:t}=this.view;this.handles.add(t.addClient()),this.watchUpdatingTracking.addOnCollectionChange((()=>null==t?void 0:t.tiles),(()=>this.update()),r)}destroy(){this.handles&&(this.handles.destroy(),this.handles=null),this.watchUpdatingTracking.destroy()}getTiles(){const t=t=>{const[e,r,o]=t.lij;return n.fromExtent(this.view.featureTiles.tilingScheme.getExtentGeometry(e,r,o))};return this.view.featureTiles.tiles.toArray().sort(((t,e)=>t.loadPriority-e.loadPriority)).map((e=>({...e,geometry:t(e)})))}};t([o({readOnly:!0})],p.prototype,"watchUpdatingTracking",void 0),t([o({readOnly:!0,aliasOf:"watchUpdatingTracking.updating"})],p.prototype,"updating",void 0),t([o()],p.prototype,"view",void 0),p=t([s("esri.views.3d.layers.support.FeatureTileTree3DDebugger")],p);const c=p;export{p as FeatureTileTree3DDebugger,c as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
4
  */
5
- import{_ as t}from"../../../../chunks/tslib.es6.js";import i from"../../../../core/has.js";import{acosClamped as s,clamp as o}from"../../../../core/mathUtils.js";import{createScreenPointArray as e}from"../../../../core/screenUtils.js";import{property as r}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/arrayUtils.js";import"../../../../core/accessorSupport/ensureType.js";import{subclass as a}from"../../../../core/accessorSupport/decorators/subclass.js";import{d as n,e as h}from"../../../../chunks/mat4.js";import{c as p}from"../../../../chunks/mat4f64.js";import{c}from"../../../../chunks/vec2.js";import{a as m}from"../../../../chunks/vec2f64.js";import{g as l,f as v,l as u,n as f,b as C,a as P,d as E,c as d,m as w}from"../../../../chunks/vec3.js";import{c as R}from"../../../../chunks/vec3f64.js";import{getReferenceEllipsoid as T}from"../../../../geometry/projectionEllipsoid.js";import{applyAll as j}from"../../camera/constraintUtils.js";import{ConstraintTypes as y,InteractionType as O,TiltMode as U}from"../../camera/constraintUtils/common.js";import{TiltDefault as M}from"../Constraints.js";import{InteractiveController as g}from"./InteractiveController.js";import{normalizeCoordinate as x,decideNavigationMode as D,NavigationMode as V}from"../utils/navigationUtils.js";var N;!function(t){t[t.CENTER=0]="CENTER",t[t.EYE=1]="EYE"}(N||(N={}));const A=7,S=90;let k=class extends g{constructor(t){super(t),this.view=null,this.pivot=N.CENTER,this.lastPoint=m(),this.tmpWorldUp=R(),this.tmpViewDir=R(),this.tmpRotCurPoint=m(),this.tmpTransf=p(),this.tmpAxis=R(),this.tmpPivotPoint=R(),this.pivotPos=R(),this.constraintOptions={selection:y.ALL,interactionType:O.TUMBLE,interactionFactor:0,interactionStartCamera:null,interactionDirection:null,tiltMode:U.TUMBLE}}get intersectionHelper(){return this.view.sceneIntersectionHelper}initialize(){this.rotScale=this.pivot===N.CENTER?3:1.5}begin(t){if(this.active){switch(this.pivot){case N.EYE:l(this.pivotPos,this.startCamera.eye),this.constraintOptions.interactionType=O.LOOK_AROUND,this.constraintOptions.tiltMode=U.LOOK_AROUND,this.constraintOptions.selection=y.NONE;break;case N.CENTER:this.intersectionHelper.intersectRayFreePointFallback(this.startCamera.ray,this.pivotPos)||l(this.pivotPos,this.startCamera.center),i("disable-feature:context-navigation")||this._constrainPivotPoint(t),this.startCamera.center=this.pivotPos,this.constraintOptions.interactionType=O.TUMBLE,this.constraintOptions.tiltMode=U.TUMBLE,this.constraintOptions.selection=y.ALL&~y.DISTANCE}this.constraintOptions.interactionStartCamera=this.startCamera,x(this.startCamera,t,this.lastPoint)}}_constrainPivotPoint(t){const i=this.startCamera,s=R();v(s,this.pivotPos,i.eye);let o=u(s);this.view.camera.position.hasZ&&(o=Math.min(o,A*Math.abs(this.view.camera.position.z)));const r=T(this.view.spatialReference),a=e(i.width/i.pixelRatio*.5,i.height/i.pixelRatio*.5),n=D(this.startCamera,a,!0,r);let h=this.view._stage.renderView.getMinimalDepthForArea(this.view.getVoxelWasmPerSceneView(),i.fullWidth/i.pixelRatio*.5,i.fullHeight/i.pixelRatio*.5,i,2.5*S,S),p=this.view._stage.renderView.getMinimalDepthForArea(this.view.getVoxelWasmPerSceneView(),t[0],t[1],i,S);void 0===h&&void 0===p||(h=void 0===h?p:h,p=void 0===p||n===V.Horizontal?h:p,o=h>p?p:h),f(s,s),l(this.pivotPos,C(this.tmpPivotPoint,i.eye,P(this.tmpPivotPoint,s,o)))}update(t){if(this.active){switch(this.pivot){case N.EYE:this.currentCamera.center=this._applyRotation(this.currentCamera,t,this.currentCamera.center,this.pivotPos);break;case N.CENTER:this.currentCamera.center=this.pivotPos,this.currentCamera.eye=this._applyRotation(this.currentCamera,t,this.currentCamera.eye,this.pivotPos)}j(this.view,this.currentCamera,this.constraintOptions)}}end(){this.active&&this.finishController()}_applyRotation(t,i,e,r){this.view.renderCoordsHelper.worldUpAtPosition(r,this.tmpWorldUp),x(t,i,this.tmpRotCurPoint);let a=(this.lastPoint[1]-this.tmpRotCurPoint[1])*this.rotScale,p=(this.tmpRotCurPoint[0]-this.lastPoint[0])*this.rotScale;v(this.tmpViewDir,e,r);const m=u(this.tmpViewDir),l=s(E(this.tmpViewDir,this.tmpWorldUp)/m);if(this.pivot===N.EYE){a*=-.5;const t=.5*Math.PI-l,i=.5*Math.PI*.99;a=t-Math.max(-i,Math.min(i,t+a))}return a=o(a+l,M.min,M.max)-l,d(this.tmpAxis,t.up,this.tmpViewDir),this.pivot===N.CENTER&&(p=-p),n(this.tmpTransf,p,this.tmpWorldUp),h(this.tmpTransf,this.tmpTransf,a,this.tmpAxis),w(this.tmpViewDir,this.tmpViewDir,this.tmpTransf),t.up=w(L,t.up,this.tmpTransf),C(L,r,this.tmpViewDir),c(this.lastPoint,this.tmpRotCurPoint),L}};t([r({constructOnly:!0})],k.prototype,"view",void 0),t([r()],k.prototype,"pivot",void 0),k=t([a("esri.views.3d.state.controllers.RotateController")],k);const L=R();export{N as PivotPoint,k as RotateController};
5
+ import{_ as t}from"../../../../chunks/tslib.es6.js";import{acosClamped as i,clamp as s}from"../../../../core/mathUtils.js";import{createScreenPointArray as o}from"../../../../core/screenUtils.js";import{property as e}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/arrayUtils.js";import"../../../../core/has.js";import"../../../../core/accessorSupport/ensureType.js";import{subclass as r}from"../../../../core/accessorSupport/decorators/subclass.js";import{d as a,e as n}from"../../../../chunks/mat4.js";import{c as h}from"../../../../chunks/mat4f64.js";import{c as p}from"../../../../chunks/vec2.js";import{a as c}from"../../../../chunks/vec2f64.js";import{g as m,f as l,l as v,n as u,b as C,a as P,d as f,c as E,m as d}from"../../../../chunks/vec3.js";import{c as w}from"../../../../chunks/vec3f64.js";import{getReferenceEllipsoid as R}from"../../../../geometry/projectionEllipsoid.js";import{applyAll as T}from"../../camera/constraintUtils.js";import{ConstraintTypes as j,InteractionType as y,TiltMode as O}from"../../camera/constraintUtils/common.js";import{TiltDefault as U}from"../Constraints.js";import{InteractiveController as M}from"./InteractiveController.js";import{normalizeCoordinate as D,decideNavigationMode as V,NavigationMode as g}from"../utils/navigationUtils.js";var x;!function(t){t[t.CENTER=0]="CENTER",t[t.EYE=1]="EYE"}(x||(x={}));const N=7,A=90;let S=class extends M{constructor(t){super(t),this.view=null,this.pivot=x.CENTER,this.lastPoint=c(),this.tmpWorldUp=w(),this.tmpViewDir=w(),this.tmpRotCurPoint=c(),this.tmpTransf=h(),this.tmpAxis=w(),this.tmpPivotPoint=w(),this.pivotPos=w(),this.constraintOptions={selection:j.ALL,interactionType:y.TUMBLE,interactionFactor:0,interactionStartCamera:null,interactionDirection:null,tiltMode:O.TUMBLE}}get intersectionHelper(){return this.view.sceneIntersectionHelper}initialize(){this.rotScale=this.pivot===x.CENTER?3:1.5}begin(t){if(this.active){switch(this.pivot){case x.EYE:m(this.pivotPos,this.startCamera.eye),this.constraintOptions.interactionType=y.LOOK_AROUND,this.constraintOptions.tiltMode=O.LOOK_AROUND,this.constraintOptions.selection=j.NONE;break;case x.CENTER:this.intersectionHelper.intersectRayFreePointFallback(this.startCamera.ray,this.pivotPos)||m(this.pivotPos,this.startCamera.center),this._constrainPivotPoint(t),this.startCamera.center=this.pivotPos,this.constraintOptions.interactionType=y.TUMBLE,this.constraintOptions.tiltMode=O.TUMBLE,this.constraintOptions.selection=j.ALL&~j.DISTANCE}this.constraintOptions.interactionStartCamera=this.startCamera,D(this.startCamera,t,this.lastPoint)}}_constrainPivotPoint(t){const i=this.startCamera,s=w();l(s,this.pivotPos,i.eye);let e=v(s);this.view.camera.position.hasZ&&(e=Math.min(e,N*Math.abs(this.view.camera.position.z)));const r=R(this.view.spatialReference),a=o(i.width/i.pixelRatio*.5,i.height/i.pixelRatio*.5),n=V(this.startCamera,a,!0,r);let h=this.view._stage.renderView.getMinimalDepthForArea(this.view.getVoxelWasmPerSceneView(),i.fullWidth/i.pixelRatio*.5,i.fullHeight/i.pixelRatio*.5,i,2.5*A,A),p=this.view._stage.renderView.getMinimalDepthForArea(this.view.getVoxelWasmPerSceneView(),t[0],t[1],i,A);void 0===h&&void 0===p||(h=void 0===h?p:h,p=void 0===p||n===g.Horizontal?h:p,e=h>p?p:h),u(s,s),m(this.pivotPos,C(this.tmpPivotPoint,i.eye,P(this.tmpPivotPoint,s,e)))}update(t){if(this.active){switch(this.pivot){case x.EYE:this.currentCamera.center=this._applyRotation(this.currentCamera,t,this.currentCamera.center,this.pivotPos);break;case x.CENTER:this.currentCamera.center=this.pivotPos,this.currentCamera.eye=this._applyRotation(this.currentCamera,t,this.currentCamera.eye,this.pivotPos)}T(this.view,this.currentCamera,this.constraintOptions)}}end(){this.active&&this.finishController()}_applyRotation(t,o,e,r){this.view.renderCoordsHelper.worldUpAtPosition(r,this.tmpWorldUp),D(t,o,this.tmpRotCurPoint);let h=(this.lastPoint[1]-this.tmpRotCurPoint[1])*this.rotScale,c=(this.tmpRotCurPoint[0]-this.lastPoint[0])*this.rotScale;l(this.tmpViewDir,e,r);const m=v(this.tmpViewDir),u=i(f(this.tmpViewDir,this.tmpWorldUp)/m);if(this.pivot===x.EYE){h*=-.5;const t=.5*Math.PI-u,i=.5*Math.PI*.99;h=t-Math.max(-i,Math.min(i,t+h))}return h=s(h+u,U.min,U.max)-u,E(this.tmpAxis,t.up,this.tmpViewDir),this.pivot===x.CENTER&&(c=-c),a(this.tmpTransf,c,this.tmpWorldUp),n(this.tmpTransf,this.tmpTransf,h,this.tmpAxis),d(this.tmpViewDir,this.tmpViewDir,this.tmpTransf),t.up=d(k,t.up,this.tmpTransf),C(k,r,this.tmpViewDir),p(this.lastPoint,this.tmpRotCurPoint),k}};t([e({constructOnly:!0})],S.prototype,"view",void 0),t([e()],S.prototype,"pivot",void 0),S=t([r("esri.views.3d.state.controllers.RotateController")],S);const k=w();export{x as PivotPoint,S as RotateController};