@arcgis/core 5.2.0-next.66 → 5.2.0-next.68

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 (371) hide show
  1. package/assets/components/assets/combobox/t9n/messages.ar.json +1 -1
  2. package/assets/components/assets/combobox/t9n/messages.bg.json +1 -1
  3. package/assets/components/assets/combobox/t9n/messages.bs.json +1 -1
  4. package/assets/components/assets/combobox/t9n/messages.ca.json +1 -1
  5. package/assets/components/assets/combobox/t9n/messages.cs.json +1 -1
  6. package/assets/components/assets/combobox/t9n/messages.da.json +1 -1
  7. package/assets/components/assets/combobox/t9n/messages.de.json +1 -1
  8. package/assets/components/assets/combobox/t9n/messages.el.json +1 -1
  9. package/assets/components/assets/combobox/t9n/messages.en.json +1 -1
  10. package/assets/components/assets/combobox/t9n/messages.es.json +1 -1
  11. package/assets/components/assets/combobox/t9n/messages.et.json +1 -1
  12. package/assets/components/assets/combobox/t9n/messages.fi.json +1 -1
  13. package/assets/components/assets/combobox/t9n/messages.fr.json +1 -1
  14. package/assets/components/assets/combobox/t9n/messages.he.json +1 -1
  15. package/assets/components/assets/combobox/t9n/messages.hr.json +1 -1
  16. package/assets/components/assets/combobox/t9n/messages.hu.json +1 -1
  17. package/assets/components/assets/combobox/t9n/messages.id.json +1 -1
  18. package/assets/components/assets/combobox/t9n/messages.it.json +1 -1
  19. package/assets/components/assets/combobox/t9n/messages.ja.json +1 -1
  20. package/assets/components/assets/combobox/t9n/messages.json +1 -1
  21. package/assets/components/assets/combobox/t9n/messages.ko.json +1 -1
  22. package/assets/components/assets/combobox/t9n/messages.lt.json +1 -1
  23. package/assets/components/assets/combobox/t9n/messages.lv.json +1 -1
  24. package/assets/components/assets/combobox/t9n/messages.nl.json +1 -1
  25. package/assets/components/assets/combobox/t9n/messages.no.json +1 -1
  26. package/assets/components/assets/combobox/t9n/messages.pl.json +1 -1
  27. package/assets/components/assets/combobox/t9n/messages.pt-BR.json +1 -1
  28. package/assets/components/assets/combobox/t9n/messages.pt-PT.json +1 -1
  29. package/assets/components/assets/combobox/t9n/messages.ro.json +1 -1
  30. package/assets/components/assets/combobox/t9n/messages.ru.json +1 -1
  31. package/assets/components/assets/combobox/t9n/messages.sk.json +1 -1
  32. package/assets/components/assets/combobox/t9n/messages.sl.json +1 -1
  33. package/assets/components/assets/combobox/t9n/messages.sr.json +1 -1
  34. package/assets/components/assets/combobox/t9n/messages.sv.json +1 -1
  35. package/assets/components/assets/combobox/t9n/messages.th.json +1 -1
  36. package/assets/components/assets/combobox/t9n/messages.tr.json +1 -1
  37. package/assets/components/assets/combobox/t9n/messages.uk.json +1 -1
  38. package/assets/components/assets/combobox/t9n/messages.vi.json +1 -1
  39. package/assets/components/assets/combobox/t9n/messages.zh-CN.json +1 -1
  40. package/assets/components/assets/combobox/t9n/messages.zh-HK.json +1 -1
  41. package/assets/components/assets/combobox/t9n/messages.zh-TW.json +1 -1
  42. package/assets/components/assets/icon/arcgisEnterprise16.json +1 -0
  43. package/assets/components/assets/icon/arcgisEnterprise24.json +1 -0
  44. package/assets/components/assets/icon/arcgisEnterprise32.json +1 -0
  45. package/assets/components/assets/icon/buildingIndex16.json +1 -0
  46. package/assets/components/assets/icon/buildingIndex24.json +1 -0
  47. package/assets/components/assets/icon/buildingIndex32.json +1 -0
  48. package/assets/components/assets/icon/fireIndex16.json +1 -0
  49. package/assets/components/assets/icon/fireIndex24.json +1 -0
  50. package/assets/components/assets/icon/fireIndex32.json +1 -0
  51. package/assets/components/assets/icon/geologyIndex16.json +1 -0
  52. package/assets/components/assets/icon/geologyIndex24.json +1 -0
  53. package/assets/components/assets/icon/geologyIndex32.json +1 -0
  54. package/assets/components/assets/icon/orientedImageryFullSuperimpose16.json +1 -0
  55. package/assets/components/assets/icon/orientedImageryFullSuperimpose24.json +1 -0
  56. package/assets/components/assets/icon/orientedImageryFullSuperimpose32.json +1 -0
  57. package/assets/components/assets/icon/orientedImageryHalfSuperimpose16.json +1 -0
  58. package/assets/components/assets/icon/orientedImageryHalfSuperimpose24.json +1 -0
  59. package/assets/components/assets/icon/orientedImageryHalfSuperimpose32.json +1 -0
  60. package/assets/components/assets/icon/orientedImagerySceneOnly16.json +1 -0
  61. package/assets/components/assets/icon/orientedImagerySceneOnly24.json +1 -0
  62. package/assets/components/assets/icon/orientedImagerySceneOnly32.json +1 -0
  63. package/assets/components/assets/icon/parquetFeatureLayer16.json +1 -0
  64. package/assets/components/assets/icon/parquetFeatureLayer24.json +1 -0
  65. package/assets/components/assets/icon/parquetFeatureLayer32.json +1 -0
  66. package/assets/components/assets/icon/publish32.json +1 -1
  67. package/assets/components/assets/icon/radarChart16.json +1 -0
  68. package/assets/components/assets/icon/radarChart24.json +1 -0
  69. package/assets/components/assets/icon/radarChart32.json +1 -0
  70. package/assets/components/assets/icon/returnToDefault16.json +1 -1
  71. package/assets/components/assets/icon/returnToDefault32.json +1 -1
  72. package/assets/components/assets/icon/smartSearch16.json +1 -0
  73. package/assets/components/assets/icon/smartSearch24.json +1 -0
  74. package/assets/components/assets/icon/smartSearch32.json +1 -0
  75. package/assets/components/assets/icon/snowIndex16.json +1 -0
  76. package/assets/components/assets/icon/snowIndex24.json +1 -0
  77. package/assets/components/assets/icon/snowIndex32.json +1 -0
  78. package/assets/components/assets/icon/soilAdjustedVegetationIndex16.json +1 -0
  79. package/assets/components/assets/icon/soilAdjustedVegetationIndex24.json +1 -0
  80. package/assets/components/assets/icon/soilAdjustedVegetationIndex32.json +1 -0
  81. package/assets/components/assets/icon/treeMap16.json +1 -0
  82. package/assets/components/assets/icon/treeMap24.json +1 -0
  83. package/assets/components/assets/icon/treeMap32.json +1 -0
  84. package/assets/components/assets/icon/userSave16.json +1 -0
  85. package/assets/components/assets/icon/userSave24.json +1 -0
  86. package/assets/components/assets/icon/userSave32.json +1 -0
  87. package/assets/components/assets/icon/vegetationIndex16.json +1 -0
  88. package/assets/components/assets/icon/vegetationIndex24.json +1 -0
  89. package/assets/components/assets/icon/vegetationIndex32.json +1 -0
  90. package/assets/components/assets/icon/weatherRadar16.json +1 -0
  91. package/assets/components/assets/icon/weatherRadar24.json +1 -0
  92. package/assets/components/assets/icon/weatherRadar32.json +1 -0
  93. package/assets/components/assets/input/t9n/messages.ar.json +1 -1
  94. package/assets/components/assets/input/t9n/messages.bg.json +1 -1
  95. package/assets/components/assets/input/t9n/messages.bs.json +1 -1
  96. package/assets/components/assets/input/t9n/messages.ca.json +1 -1
  97. package/assets/components/assets/input/t9n/messages.cs.json +1 -1
  98. package/assets/components/assets/input/t9n/messages.da.json +1 -1
  99. package/assets/components/assets/input/t9n/messages.de.json +1 -1
  100. package/assets/components/assets/input/t9n/messages.el.json +1 -1
  101. package/assets/components/assets/input/t9n/messages.en.json +1 -1
  102. package/assets/components/assets/input/t9n/messages.es.json +1 -1
  103. package/assets/components/assets/input/t9n/messages.et.json +1 -1
  104. package/assets/components/assets/input/t9n/messages.fi.json +1 -1
  105. package/assets/components/assets/input/t9n/messages.fr.json +1 -1
  106. package/assets/components/assets/input/t9n/messages.he.json +1 -1
  107. package/assets/components/assets/input/t9n/messages.hr.json +1 -1
  108. package/assets/components/assets/input/t9n/messages.hu.json +1 -1
  109. package/assets/components/assets/input/t9n/messages.id.json +1 -1
  110. package/assets/components/assets/input/t9n/messages.it.json +1 -1
  111. package/assets/components/assets/input/t9n/messages.ja.json +1 -1
  112. package/assets/components/assets/input/t9n/messages.json +1 -1
  113. package/assets/components/assets/input/t9n/messages.ko.json +1 -1
  114. package/assets/components/assets/input/t9n/messages.lt.json +1 -1
  115. package/assets/components/assets/input/t9n/messages.lv.json +1 -1
  116. package/assets/components/assets/input/t9n/messages.nl.json +1 -1
  117. package/assets/components/assets/input/t9n/messages.no.json +1 -1
  118. package/assets/components/assets/input/t9n/messages.pl.json +1 -1
  119. package/assets/components/assets/input/t9n/messages.pt-BR.json +1 -1
  120. package/assets/components/assets/input/t9n/messages.pt-PT.json +1 -1
  121. package/assets/components/assets/input/t9n/messages.ro.json +1 -1
  122. package/assets/components/assets/input/t9n/messages.ru.json +1 -1
  123. package/assets/components/assets/input/t9n/messages.sk.json +1 -1
  124. package/assets/components/assets/input/t9n/messages.sl.json +1 -1
  125. package/assets/components/assets/input/t9n/messages.sr.json +1 -1
  126. package/assets/components/assets/input/t9n/messages.sv.json +1 -1
  127. package/assets/components/assets/input/t9n/messages.th.json +1 -1
  128. package/assets/components/assets/input/t9n/messages.tr.json +1 -1
  129. package/assets/components/assets/input/t9n/messages.uk.json +1 -1
  130. package/assets/components/assets/input/t9n/messages.vi.json +1 -1
  131. package/assets/components/assets/input/t9n/messages.zh-CN.json +1 -1
  132. package/assets/components/assets/input/t9n/messages.zh-HK.json +1 -1
  133. package/assets/components/assets/input/t9n/messages.zh-TW.json +1 -1
  134. package/assets/components/assets/input-date-picker/t9n/messages.ar.json +1 -1
  135. package/assets/components/assets/input-date-picker/t9n/messages.bg.json +1 -1
  136. package/assets/components/assets/input-date-picker/t9n/messages.bs.json +1 -1
  137. package/assets/components/assets/input-date-picker/t9n/messages.ca.json +1 -1
  138. package/assets/components/assets/input-date-picker/t9n/messages.cs.json +1 -1
  139. package/assets/components/assets/input-date-picker/t9n/messages.da.json +1 -1
  140. package/assets/components/assets/input-date-picker/t9n/messages.de.json +1 -1
  141. package/assets/components/assets/input-date-picker/t9n/messages.el.json +1 -1
  142. package/assets/components/assets/input-date-picker/t9n/messages.en.json +1 -1
  143. package/assets/components/assets/input-date-picker/t9n/messages.es.json +1 -1
  144. package/assets/components/assets/input-date-picker/t9n/messages.et.json +1 -1
  145. package/assets/components/assets/input-date-picker/t9n/messages.fi.json +1 -1
  146. package/assets/components/assets/input-date-picker/t9n/messages.fr.json +1 -1
  147. package/assets/components/assets/input-date-picker/t9n/messages.he.json +1 -1
  148. package/assets/components/assets/input-date-picker/t9n/messages.hr.json +1 -1
  149. package/assets/components/assets/input-date-picker/t9n/messages.hu.json +1 -1
  150. package/assets/components/assets/input-date-picker/t9n/messages.id.json +1 -1
  151. package/assets/components/assets/input-date-picker/t9n/messages.it.json +1 -1
  152. package/assets/components/assets/input-date-picker/t9n/messages.ja.json +1 -1
  153. package/assets/components/assets/input-date-picker/t9n/messages.json +1 -1
  154. package/assets/components/assets/input-date-picker/t9n/messages.ko.json +1 -1
  155. package/assets/components/assets/input-date-picker/t9n/messages.lt.json +1 -1
  156. package/assets/components/assets/input-date-picker/t9n/messages.lv.json +1 -1
  157. package/assets/components/assets/input-date-picker/t9n/messages.nl.json +1 -1
  158. package/assets/components/assets/input-date-picker/t9n/messages.no.json +1 -1
  159. package/assets/components/assets/input-date-picker/t9n/messages.pl.json +1 -1
  160. package/assets/components/assets/input-date-picker/t9n/messages.pt-BR.json +1 -1
  161. package/assets/components/assets/input-date-picker/t9n/messages.pt-PT.json +1 -1
  162. package/assets/components/assets/input-date-picker/t9n/messages.ro.json +1 -1
  163. package/assets/components/assets/input-date-picker/t9n/messages.ru.json +1 -1
  164. package/assets/components/assets/input-date-picker/t9n/messages.sk.json +1 -1
  165. package/assets/components/assets/input-date-picker/t9n/messages.sl.json +1 -1
  166. package/assets/components/assets/input-date-picker/t9n/messages.sr.json +1 -1
  167. package/assets/components/assets/input-date-picker/t9n/messages.sv.json +1 -1
  168. package/assets/components/assets/input-date-picker/t9n/messages.th.json +1 -1
  169. package/assets/components/assets/input-date-picker/t9n/messages.tr.json +1 -1
  170. package/assets/components/assets/input-date-picker/t9n/messages.uk.json +1 -1
  171. package/assets/components/assets/input-date-picker/t9n/messages.vi.json +1 -1
  172. package/assets/components/assets/input-date-picker/t9n/messages.zh-CN.json +1 -1
  173. package/assets/components/assets/input-date-picker/t9n/messages.zh-HK.json +1 -1
  174. package/assets/components/assets/input-date-picker/t9n/messages.zh-TW.json +1 -1
  175. package/assets/components/assets/input-number/t9n/messages.ar.json +1 -1
  176. package/assets/components/assets/input-number/t9n/messages.bg.json +1 -1
  177. package/assets/components/assets/input-number/t9n/messages.bs.json +1 -1
  178. package/assets/components/assets/input-number/t9n/messages.ca.json +1 -1
  179. package/assets/components/assets/input-number/t9n/messages.cs.json +1 -1
  180. package/assets/components/assets/input-number/t9n/messages.da.json +1 -1
  181. package/assets/components/assets/input-number/t9n/messages.de.json +1 -1
  182. package/assets/components/assets/input-number/t9n/messages.el.json +1 -1
  183. package/assets/components/assets/input-number/t9n/messages.en.json +1 -1
  184. package/assets/components/assets/input-number/t9n/messages.es.json +1 -1
  185. package/assets/components/assets/input-number/t9n/messages.et.json +1 -1
  186. package/assets/components/assets/input-number/t9n/messages.fi.json +1 -1
  187. package/assets/components/assets/input-number/t9n/messages.fr.json +1 -1
  188. package/assets/components/assets/input-number/t9n/messages.he.json +1 -1
  189. package/assets/components/assets/input-number/t9n/messages.hr.json +1 -1
  190. package/assets/components/assets/input-number/t9n/messages.hu.json +1 -1
  191. package/assets/components/assets/input-number/t9n/messages.id.json +1 -1
  192. package/assets/components/assets/input-number/t9n/messages.it.json +1 -1
  193. package/assets/components/assets/input-number/t9n/messages.ja.json +1 -1
  194. package/assets/components/assets/input-number/t9n/messages.json +1 -1
  195. package/assets/components/assets/input-number/t9n/messages.ko.json +1 -1
  196. package/assets/components/assets/input-number/t9n/messages.lt.json +1 -1
  197. package/assets/components/assets/input-number/t9n/messages.lv.json +1 -1
  198. package/assets/components/assets/input-number/t9n/messages.nl.json +1 -1
  199. package/assets/components/assets/input-number/t9n/messages.no.json +1 -1
  200. package/assets/components/assets/input-number/t9n/messages.pl.json +1 -1
  201. package/assets/components/assets/input-number/t9n/messages.pt-BR.json +1 -1
  202. package/assets/components/assets/input-number/t9n/messages.pt-PT.json +1 -1
  203. package/assets/components/assets/input-number/t9n/messages.ro.json +1 -1
  204. package/assets/components/assets/input-number/t9n/messages.ru.json +1 -1
  205. package/assets/components/assets/input-number/t9n/messages.sk.json +1 -1
  206. package/assets/components/assets/input-number/t9n/messages.sl.json +1 -1
  207. package/assets/components/assets/input-number/t9n/messages.sr.json +1 -1
  208. package/assets/components/assets/input-number/t9n/messages.sv.json +1 -1
  209. package/assets/components/assets/input-number/t9n/messages.th.json +1 -1
  210. package/assets/components/assets/input-number/t9n/messages.tr.json +1 -1
  211. package/assets/components/assets/input-number/t9n/messages.uk.json +1 -1
  212. package/assets/components/assets/input-number/t9n/messages.vi.json +1 -1
  213. package/assets/components/assets/input-number/t9n/messages.zh-CN.json +1 -1
  214. package/assets/components/assets/input-number/t9n/messages.zh-HK.json +1 -1
  215. package/assets/components/assets/input-number/t9n/messages.zh-TW.json +1 -1
  216. package/assets/components/assets/input-text/t9n/messages.ar.json +1 -1
  217. package/assets/components/assets/input-text/t9n/messages.bg.json +1 -1
  218. package/assets/components/assets/input-text/t9n/messages.bs.json +1 -1
  219. package/assets/components/assets/input-text/t9n/messages.ca.json +1 -1
  220. package/assets/components/assets/input-text/t9n/messages.cs.json +1 -1
  221. package/assets/components/assets/input-text/t9n/messages.da.json +1 -1
  222. package/assets/components/assets/input-text/t9n/messages.de.json +1 -1
  223. package/assets/components/assets/input-text/t9n/messages.el.json +1 -1
  224. package/assets/components/assets/input-text/t9n/messages.en.json +1 -1
  225. package/assets/components/assets/input-text/t9n/messages.es.json +1 -1
  226. package/assets/components/assets/input-text/t9n/messages.et.json +1 -1
  227. package/assets/components/assets/input-text/t9n/messages.fi.json +1 -1
  228. package/assets/components/assets/input-text/t9n/messages.fr.json +1 -1
  229. package/assets/components/assets/input-text/t9n/messages.he.json +1 -1
  230. package/assets/components/assets/input-text/t9n/messages.hr.json +1 -1
  231. package/assets/components/assets/input-text/t9n/messages.hu.json +1 -1
  232. package/assets/components/assets/input-text/t9n/messages.id.json +1 -1
  233. package/assets/components/assets/input-text/t9n/messages.it.json +1 -1
  234. package/assets/components/assets/input-text/t9n/messages.ja.json +1 -1
  235. package/assets/components/assets/input-text/t9n/messages.json +1 -1
  236. package/assets/components/assets/input-text/t9n/messages.ko.json +1 -1
  237. package/assets/components/assets/input-text/t9n/messages.lt.json +1 -1
  238. package/assets/components/assets/input-text/t9n/messages.lv.json +1 -1
  239. package/assets/components/assets/input-text/t9n/messages.nl.json +1 -1
  240. package/assets/components/assets/input-text/t9n/messages.no.json +1 -1
  241. package/assets/components/assets/input-text/t9n/messages.pl.json +1 -1
  242. package/assets/components/assets/input-text/t9n/messages.pt-BR.json +1 -1
  243. package/assets/components/assets/input-text/t9n/messages.pt-PT.json +1 -1
  244. package/assets/components/assets/input-text/t9n/messages.ro.json +1 -1
  245. package/assets/components/assets/input-text/t9n/messages.ru.json +1 -1
  246. package/assets/components/assets/input-text/t9n/messages.sk.json +1 -1
  247. package/assets/components/assets/input-text/t9n/messages.sl.json +1 -1
  248. package/assets/components/assets/input-text/t9n/messages.sr.json +1 -1
  249. package/assets/components/assets/input-text/t9n/messages.sv.json +1 -1
  250. package/assets/components/assets/input-text/t9n/messages.th.json +1 -1
  251. package/assets/components/assets/input-text/t9n/messages.tr.json +1 -1
  252. package/assets/components/assets/input-text/t9n/messages.uk.json +1 -1
  253. package/assets/components/assets/input-text/t9n/messages.vi.json +1 -1
  254. package/assets/components/assets/input-text/t9n/messages.zh-CN.json +1 -1
  255. package/assets/components/assets/input-text/t9n/messages.zh-HK.json +1 -1
  256. package/assets/components/assets/input-text/t9n/messages.zh-TW.json +1 -1
  257. package/assets/components/assets/input-time-picker/t9n/messages.ar.json +1 -1
  258. package/assets/components/assets/input-time-picker/t9n/messages.bg.json +1 -1
  259. package/assets/components/assets/input-time-picker/t9n/messages.bs.json +1 -1
  260. package/assets/components/assets/input-time-picker/t9n/messages.ca.json +1 -1
  261. package/assets/components/assets/input-time-picker/t9n/messages.cs.json +1 -1
  262. package/assets/components/assets/input-time-picker/t9n/messages.da.json +1 -1
  263. package/assets/components/assets/input-time-picker/t9n/messages.de.json +1 -1
  264. package/assets/components/assets/input-time-picker/t9n/messages.el.json +1 -1
  265. package/assets/components/assets/input-time-picker/t9n/messages.en.json +1 -1
  266. package/assets/components/assets/input-time-picker/t9n/messages.es.json +1 -1
  267. package/assets/components/assets/input-time-picker/t9n/messages.et.json +1 -1
  268. package/assets/components/assets/input-time-picker/t9n/messages.fi.json +1 -1
  269. package/assets/components/assets/input-time-picker/t9n/messages.fr.json +1 -1
  270. package/assets/components/assets/input-time-picker/t9n/messages.he.json +1 -1
  271. package/assets/components/assets/input-time-picker/t9n/messages.hr.json +1 -1
  272. package/assets/components/assets/input-time-picker/t9n/messages.hu.json +1 -1
  273. package/assets/components/assets/input-time-picker/t9n/messages.id.json +1 -1
  274. package/assets/components/assets/input-time-picker/t9n/messages.it.json +1 -1
  275. package/assets/components/assets/input-time-picker/t9n/messages.ja.json +1 -1
  276. package/assets/components/assets/input-time-picker/t9n/messages.json +1 -1
  277. package/assets/components/assets/input-time-picker/t9n/messages.ko.json +1 -1
  278. package/assets/components/assets/input-time-picker/t9n/messages.lt.json +1 -1
  279. package/assets/components/assets/input-time-picker/t9n/messages.lv.json +1 -1
  280. package/assets/components/assets/input-time-picker/t9n/messages.nl.json +1 -1
  281. package/assets/components/assets/input-time-picker/t9n/messages.no.json +1 -1
  282. package/assets/components/assets/input-time-picker/t9n/messages.pl.json +1 -1
  283. package/assets/components/assets/input-time-picker/t9n/messages.pt-BR.json +1 -1
  284. package/assets/components/assets/input-time-picker/t9n/messages.pt-PT.json +1 -1
  285. package/assets/components/assets/input-time-picker/t9n/messages.ro.json +1 -1
  286. package/assets/components/assets/input-time-picker/t9n/messages.ru.json +1 -1
  287. package/assets/components/assets/input-time-picker/t9n/messages.sk.json +1 -1
  288. package/assets/components/assets/input-time-picker/t9n/messages.sl.json +1 -1
  289. package/assets/components/assets/input-time-picker/t9n/messages.sr.json +1 -1
  290. package/assets/components/assets/input-time-picker/t9n/messages.sv.json +1 -1
  291. package/assets/components/assets/input-time-picker/t9n/messages.th.json +1 -1
  292. package/assets/components/assets/input-time-picker/t9n/messages.tr.json +1 -1
  293. package/assets/components/assets/input-time-picker/t9n/messages.uk.json +1 -1
  294. package/assets/components/assets/input-time-picker/t9n/messages.vi.json +1 -1
  295. package/assets/components/assets/input-time-picker/t9n/messages.zh-CN.json +1 -1
  296. package/assets/components/assets/input-time-picker/t9n/messages.zh-HK.json +1 -1
  297. package/assets/components/assets/input-time-picker/t9n/messages.zh-TW.json +1 -1
  298. package/assets/esri/core/workers/RemoteClient.js +1 -1
  299. package/assets/esri/core/workers/chunks/{6f39545710d1b35d922c.js → 181f330314c1989f642f.js} +1 -1
  300. package/assets/esri/core/workers/chunks/{d4058352db1e8255b52e.js → 1d38a710cf799cb0e5b3.js} +1 -1
  301. package/assets/esri/core/workers/chunks/{59dd83e5aee2908c7eca.js → 3f84ade6285560b692d1.js} +1 -1
  302. package/assets/esri/core/workers/chunks/45de90b78485d9326791.js +1 -0
  303. package/assets/esri/core/workers/chunks/{25197ecb324d6f08e03e.js → 538bdf02c4dfb5ec72fe.js} +1 -1
  304. package/assets/esri/core/workers/chunks/581318d4d3b3152fd93f.js +2 -0
  305. package/assets/esri/core/workers/chunks/{f5c9659fc5d571d501c9.js → 59a795eba31061dc357a.js} +1 -1
  306. package/assets/esri/core/workers/chunks/{7d163d9d90393e491ee5.js → 5fb0e8f89b885e5e3742.js} +1 -1
  307. package/assets/esri/core/workers/chunks/{19bf6826e7d9a4d52035.js → 6cc1120554bcb1b4899b.js} +1 -1
  308. package/assets/esri/core/workers/chunks/7bd3a11d3ade0b948db7.js +1 -0
  309. package/assets/esri/core/workers/chunks/8a12bb50b3ac9e651625.js +1 -0
  310. package/assets/esri/core/workers/chunks/8a9d782aee5ab47ba07f.js +2 -0
  311. package/assets/esri/core/workers/chunks/{a97e0b9b057664911c14.js → 8f8db62f126e4a8c1bf7.js} +1 -1
  312. package/assets/esri/core/workers/chunks/c270b29307e04c4dafae.js +2 -0
  313. package/assets/esri/core/workers/chunks/c97451f75c23be979476.js +1 -0
  314. package/assets/esri/core/workers/chunks/d2a51c797b2966cb95f3.js +2 -0
  315. package/assets/esri/core/workers/chunks/{7d4c65311064a5c2e0b1.js → df89bf05c18f0c8e418b.js} +1 -1
  316. package/assets/esri/core/workers/chunks/f276c6f5cbc1aaec0403.js +1 -0
  317. package/assets/esri/core/workers/chunks/fac8add42aa317f8f514.js +2 -0
  318. package/assets/esri/themes/base/widgets/_SelectionToolbar.scss +1 -0
  319. package/assets/esri/themes/dark/main.css +1 -1
  320. package/assets/esri/themes/light/main.css +1 -1
  321. package/assets/esri/themes/light/view.css +1 -1
  322. package/assets/esri/views/3d/environment/resources/milkyway-band.ktx2 +0 -0
  323. package/chunks/DeepSky.glsl.js +66 -0
  324. package/config.js +1 -1
  325. package/interfaces.d.ts +0 -14
  326. package/kernel.js +1 -1
  327. package/package.json +3 -3
  328. package/popup/FeatureContent.d.ts +17 -96
  329. package/popup/FeatureContentCollection.d.ts +71 -188
  330. package/support/revision.js +1 -1
  331. package/symbols/LabelSymbol3D.js +1 -1
  332. package/symbols/LineSymbol3D.js +1 -1
  333. package/symbols/MeshSymbol3D.js +1 -1
  334. package/symbols/PointSymbol3D.js +1 -1
  335. package/symbols/PolygonSymbol3D.js +1 -1
  336. package/third-party-notices.txt +9 -0
  337. package/views/2d/engine/webgl/AFeatureTile.js +1 -1
  338. package/views/3d/support/gaussianSplatting/GaussianSplatFadeHelper.js +1 -1
  339. package/views/3d/terrain/TerrainSurface.js +1 -1
  340. package/views/3d/webgl-engine/effects/stars/DeepSky.glsl.js +2 -0
  341. package/views/3d/webgl-engine/effects/stars/DeepSkyTechnique.js +2 -0
  342. package/views/3d/webgl-engine/effects/stars/Stars.js +1 -1
  343. package/views/3d/webgl-engine/effects/stars/starsUtils.js +2 -0
  344. package/widgets/BasemapLayerList.js +1 -1
  345. package/widgets/Bookmarks.js +1 -1
  346. package/widgets/Daylight.js +1 -1
  347. package/widgets/FeatureTable/Grid/EditorColumn.js +1 -1
  348. package/widgets/LayerList.js +1 -1
  349. package/widgets/PanoramicVideoViewer.js +1 -1
  350. package/widgets/PanoramicViewer.js +1 -1
  351. package/widgets/Print.js +1 -1
  352. package/widgets/ShadowCast.js +1 -1
  353. package/widgets/Sketch.js +1 -1
  354. package/widgets/TableList.js +1 -1
  355. package/widgets/support/SelectionToolbar.js +1 -1
  356. package/widgets/support/SketchTooltipControls.js +1 -1
  357. package/assets/esri/core/workers/chunks/15de305ac3d6433748e7.js +0 -1
  358. package/assets/esri/core/workers/chunks/242cad472fbc38b24dbc.js +0 -2
  359. package/assets/esri/core/workers/chunks/24c0b3586bb6500eda53.js +0 -2
  360. package/assets/esri/core/workers/chunks/394716bd1ecfd638d708.js +0 -2
  361. package/assets/esri/core/workers/chunks/55af58b6dff52dc040fe.js +0 -2
  362. package/assets/esri/core/workers/chunks/5b18696109fe84a1010a.js +0 -2
  363. package/assets/esri/core/workers/chunks/7f6eee102871769fdf8f.js +0 -1
  364. package/assets/esri/core/workers/chunks/93c0a620a147cbf4a0ba.js +0 -1
  365. package/assets/esri/core/workers/chunks/a27172dacdb85a774c4b.js +0 -1
  366. package/assets/esri/core/workers/chunks/ddafe402f1bc9e8285ef.js +0 -1
  367. /package/assets/esri/core/workers/chunks/{242cad472fbc38b24dbc.js.LICENSE.txt → 581318d4d3b3152fd93f.js.LICENSE.txt} +0 -0
  368. /package/assets/esri/core/workers/chunks/{394716bd1ecfd638d708.js.LICENSE.txt → 8a9d782aee5ab47ba07f.js.LICENSE.txt} +0 -0
  369. /package/assets/esri/core/workers/chunks/{24c0b3586bb6500eda53.js.LICENSE.txt → c270b29307e04c4dafae.js.LICENSE.txt} +0 -0
  370. /package/assets/esri/core/workers/chunks/{5b18696109fe84a1010a.js.LICENSE.txt → d2a51c797b2966cb95f3.js.LICENSE.txt} +0 -0
  371. /package/assets/esri/core/workers/chunks/{55af58b6dff52dc040fe.js.LICENSE.txt → fac8add42aa317f8f514.js.LICENSE.txt} +0 -0
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as t}from"tslib";import o from"../Color.js";import e from"../core/Collection.js";import{clone as r}from"../core/lang.js";import{property as s,subclass as l}from"../core/accessorSupport/decorators.js";import i from"./IconSymbol3DLayer.js";import m from"./ObjectSymbol3DLayer.js";import a from"./Symbol3D.js";import y from"./TextSymbol3DLayer.js";import{hasVisibleCallout as n,hasVisibleVerticalOffset as c,calloutProperty as p}from"./callouts/calloutUtils.js";import f from"./callouts/LineCallout3D.js";import b from"./support/Symbol3DVerticalOffset.js";import{enumeration as u}from"../core/accessorSupport/decorators/enumeration.js";var h;const S=e.ofType({base:null,key:"type",typeMap:{icon:i,object:m,text:y}});let w=h=class extends a{constructor(t){super(t),this.verticalOffset=null,this.callout=null,this.symbolLayers=new S,this.type="point-3d"}supportsCallout(){if((this.symbolLayers?this.symbolLayers.length:0)<1)return!1;for(const t of this.symbolLayers.items)switch(t.type){case"icon":case"text":case"object":continue;default:return!1}return!0}hasVisibleCallout(){return n(this)}hasVisibleVerticalOffset(){return c(this)}clone(){return new h({verticalOffset:r(this.verticalOffset),callout:r(this.callout),styleOrigin:r(this.styleOrigin),symbolLayers:r(this.symbolLayers),thumbnail:r(this.thumbnail)})}static fromSimpleMarkerSymbol(t){return new h({symbolLayers:new e([i.fromSimpleMarkerSymbol(t)])})}static fromPictureMarkerSymbol(t){return new h({symbolLayers:new e([i.fromPictureMarkerSymbol(t)])})}static fromCIMSymbol(t){const r=t.data?.symbol?.type;if("CIMPointSymbol"!==r)return null;const s=t.data.symbol;return new h(s?.callout?{symbolLayers:new e([i.fromCIMSymbol(t)]),callout:new f({size:.5,color:new o([0,0,0])}),verticalOffset:new b({screenLength:40})}:{symbolLayers:new e([i.fromCIMSymbol(t)])})}static fromTextSymbol(t){return new h({symbolLayers:new e([y.fromTextSymbol(t)])})}};t([s({type:b,json:{write:!0}})],w.prototype,"verticalOffset",void 0),t([s(p)],w.prototype,"callout",void 0),t([s({type:S,json:{origins:{"web-scene":{write:!0}}}})],w.prototype,"symbolLayers",void 0),t([u({PointSymbol3D_1:"point-3d"},{readOnly:!0})],w.prototype,"type",void 0),w=h=t([l("esri.symbols.PointSymbol3D")],w);export{w as default};
2
+ import{__decorate as t}from"tslib";import o from"../Color.js";import e from"../core/Collection.js";import{clone as r}from"../core/lang.js";import{property as s,subclass as l}from"../core/accessorSupport/decorators.js";import i from"./IconSymbol3DLayer.js";import m from"./ObjectSymbol3DLayer.js";import a from"./Symbol3D.js";import y from"./TextSymbol3DLayer.js";import{hasVisibleCallout as n,hasVisibleVerticalOffset as c,calloutProperty as p}from"./callouts/calloutUtils.js";import f from"./callouts/LineCallout3D.js";import b from"./support/Symbol3DVerticalOffset.js";import{enumeration as u}from"../core/accessorSupport/decorators/enumeration.js";var h;const S=e.ofType({base:null,key:"type",typeMap:{icon:i,object:m,text:y}});let w=h=class extends a{constructor(t){super(t),this.verticalOffset=null,this.callout=null,this.symbolLayers=new S,this.type="point-3d"}supportsCallout(){if((this.symbolLayers?this.symbolLayers.length:0)<1)return!1;for(const t of this.symbolLayers.items)switch(t.type){case"icon":case"text":case"object":continue;default:return!1}return!0}hasVisibleCallout(){return n(this)}hasVisibleVerticalOffset(){return c(this)}clone(){return new h({verticalOffset:r(this.verticalOffset),callout:r(this.callout),styleOrigin:r(this.styleOrigin),symbolLayers:r(this.symbolLayers),thumbnail:r(this.thumbnail)})}static fromSimpleMarkerSymbol(t){return new h({symbolLayers:new e([i.fromSimpleMarkerSymbol(t)])})}static fromPictureMarkerSymbol(t){return new h({symbolLayers:new e([i.fromPictureMarkerSymbol(t)])})}static fromCIMSymbol(t){const r=t.data?.symbol?.type;if("CIMPointSymbol"!==r)return null;const s=t.data.symbol;return new h(s?.callout?{symbolLayers:new e([i.fromCIMSymbol(t)]),callout:new f({size:.5,color:new o([0,0,0])}),verticalOffset:new b({screenLength:40})}:{symbolLayers:new e([i.fromCIMSymbol(t)])})}static fromTextSymbol(t){return new h({symbolLayers:new e([y.fromTextSymbol(t)])})}};t([s({type:b,json:{write:!0}})],w.prototype,"verticalOffset",void 0),t([s(p)],w.prototype,"callout",void 0),t([s({type:S,json:{origins:{"web-scene":{write:!0}}}})],w.prototype,"symbolLayers",void 0),t([u({PointSymbol3D:"point-3d"},{readOnly:!0})],w.prototype,"type",void 0),w=h=t([l("esri.symbols.PointSymbol3D")],w);export{w as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as o}from"tslib";import r from"../core/Collection.js";import{clone as e}from"../core/lang.js";import{property as t,subclass as s}from"../core/accessorSupport/decorators.js";import m from"./ExtrudeSymbol3DLayer.js";import l from"./FillSymbol3DLayer.js";import y from"./IconSymbol3DLayer.js";import i from"./ObjectSymbol3DLayer.js";import p from"./Symbol3D.js";import a from"./WaterSymbol3DLayer.js";import{enumeration as n}from"../core/accessorSupport/decorators/enumeration.js";var c;const b=r.ofType({base:null,key:"type",typeMap:{extrude:m,fill:l,icon:y,object:i,water:a}});let f=c=class extends p{constructor(o){super(o),this.symbolLayers=new b,this.type="polygon-3d"}clone(){return new c({styleOrigin:e(this.styleOrigin),symbolLayers:e(this.symbolLayers),thumbnail:e(this.thumbnail)})}static fromJSON(o){const r=new c;return r.read(o),r}static fromSimpleFillSymbol(o){return new c({symbolLayers:new r([l.fromSimpleFillSymbol(o)])})}};o([t({type:b,json:{write:!0}})],f.prototype,"symbolLayers",void 0),o([n({PolygonSymbol3D_1:"polygon-3d"},{readOnly:!0})],f.prototype,"type",void 0),f=c=o([s("esri.symbols.PolygonSymbol3D")],f);export{f as default};
2
+ import{__decorate as o}from"tslib";import r from"../core/Collection.js";import{clone as e}from"../core/lang.js";import{property as t,subclass as s}from"../core/accessorSupport/decorators.js";import m from"./ExtrudeSymbol3DLayer.js";import l from"./FillSymbol3DLayer.js";import y from"./IconSymbol3DLayer.js";import i from"./ObjectSymbol3DLayer.js";import p from"./Symbol3D.js";import a from"./WaterSymbol3DLayer.js";import{enumeration as n}from"../core/accessorSupport/decorators/enumeration.js";var c;const b=r.ofType({base:null,key:"type",typeMap:{extrude:m,fill:l,icon:y,object:i,water:a}});let f=c=class extends p{constructor(o){super(o),this.symbolLayers=new b,this.type="polygon-3d"}clone(){return new c({styleOrigin:e(this.styleOrigin),symbolLayers:e(this.symbolLayers),thumbnail:e(this.thumbnail)})}static fromJSON(o){const r=new c;return r.read(o),r}static fromSimpleFillSymbol(o){return new c({symbolLayers:new r([l.fromSimpleFillSymbol(o)])})}};o([t({type:b,json:{write:!0}})],f.prototype,"symbolLayers",void 0),o([n({PolygonSymbol3D:"polygon-3d"},{readOnly:!0})],f.prototype,"type",void 0),f=c=o([s("esri.symbols.PolygonSymbol3D")],f);export{f as default};
@@ -2152,3 +2152,12 @@ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
2152
2152
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
2153
2153
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
2154
2154
  PERFORMANCE OF THIS SOFTWARE.
2155
+
2156
+ -----------------------------------------------------------------
2157
+
2158
+ esri/views/3d/environment/resources/milkyway-band.ktx2
2159
+
2160
+ Image credit: NASA/Goddard Space Flight Center Scientific Visualization Studio. Gaia DR2: ESA/Gaia/DPAC. Constellation
2161
+ figures based on those developed for the IAU by Alan MacRobert of Sky and Telescope magazine (Roger Sinnott and Rick
2162
+ Fienberg).
2163
+ https://svs.gsfc.nasa.gov/4851/
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{set as t,multiply as s,identity as i,translate as r,rotate as e,scale as o,invert as n}from"../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/mat3f32.js";import{set as h,transformMat3 as c}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as l}from"../../../../core/libs/gl-matrix-2/factories/vec3f32.js";import{segmentIntersects as m}from"../../../../geometry/support/intersectsBase.js";import{tileSize as f}from"./definitions.js";import{TiledDisplayObject as p}from"./TiledDisplayObject.js";const u=a(),g=l();class d extends p{constructor(t,s,i,r){super(t,s,i,r,f,f)}setTransform(n){const a=this.resolution/n.resolution,h=this.transforms.tileMat3,[c,l]=n.toScreenNoRotation([0,0],[this.x,this.y]),m=this.width/this.rangeX*a,f=this.height/this.rangeY*a;t(h,m,0,0,0,f,0,c,l,1),s(this.transforms.displayViewScreenMat3,n.displayViewMat3,h);const p=[0,0];n.toScreen(p,[this.x,this.y]);const u=this.transforms.tileUnitsToPixels;i(u),r(u,u,p),e(u,u,Math.PI*n.rotation/180),o(u,u,[m,f,1])}_createTransforms(){return{tileMat3:a(),displayViewScreenMat3:a(),tileUnitsToPixels:a()}}containsScreenPoint(t,i,r){const e=s(u,t.viewMat3,this.transforms.tileMat3),o=n(u,e);if(null==o)return!0;h(g,...i,1);const a=c(g,g,o),l=r*(this.resolution/t.resolution);return a[0]>=-l&&a[0]<this.width+l&&a[1]>=-l&&a[1]<this.height+l}containsScreenRect(t,i){const r=i[0],e=i[1],o=i[2],n=i[3],f=[[r,e],[r,n],[o,e],[o,n]];if(f.some(s=>this.containsScreenPoint(t,[s[0],s[1]],0)))return!0;const p=s(a(),t.viewMat3,this.transforms.tileMat3),u=[[0,0],[this.width,0],[this.width,this.height],[0,this.height]],g=[],d=l();for(const[s,a]of u)h(d,s,a,1),c(d,d,p),g.push([d[0],d[1]]);const x=g.length,M=f.length;for(let s=0;s<x;s++){const t=g[s],i=g[(s+1)%x];for(let s=0;s<M;s++){const r=f[s],e=f[(s+1)%M];if(m(t,i,r,e))return!0}}return!1}}export{d as AFeatureTile};
2
+ import{set as t,multiply as s,identity as i,translate as r,rotate as e,scale as o,invert as n}from"../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/mat3f32.js";import{set as h,transformMat3 as c}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as l}from"../../../../core/libs/gl-matrix-2/factories/vec3f32.js";import{segmentIntersects as m}from"../../../../geometry/support/intersectsBase.js";import{tileSize as f}from"./definitions.js";import{TiledDisplayObject as p}from"./TiledDisplayObject.js";const u=a(),g=l();class d extends p{constructor(t,s,i,r){super(t,s,i,r,f,f)}setTransform(n){const a=this.resolution/n.resolution,h=this.transforms.tileMat3,[c,l]=n.toScreenNoRotation([0,0],[this.x,this.y]),m=this.width/this.rangeX*a,f=this.height/this.rangeY*a;t(h,m,0,0,0,f,0,c,l,1),s(this.transforms.displayViewScreenMat3,n.displayViewMat3,h);const p=[0,0];n.toScreen(p,[this.x,this.y]);const u=this.transforms.tileUnitsToPixels;i(u),r(u,u,p),e(u,u,Math.PI*n.rotation/180),o(u,u,[m,f,1])}_createTransforms(){return{tileMat3:a(),displayViewScreenMat3:a(),tileUnitsToPixels:a()}}containsScreenPoint(t,i,r){const e=s(u,t.viewMat3,this.transforms.tileMat3),o=n(u,e);if(null==o)return!0;h(g,...i,1);const a=c(g,g,o),l=r*(this.resolution/t.resolution);return a[0]>=-l&&a[0]<this.width+l&&a[1]>=-l&&a[1]<this.height+l}containsScreenRect(t,i){const r=i[0],e=i[1],o=i[2],n=i[3],f=[[r,e],[o,e],[o,n],[r,n]];if(f.some(s=>this.containsScreenPoint(t,[s[0],s[1]],0)))return!0;const p=s(a(),t.viewMat3,this.transforms.tileMat3),u=[[0,0],[this.width,0],[this.width,this.height],[0,this.height]],g=[],d=l();for(const[s,a]of u)h(d,s,a,1),c(d,d,p),g.push([d[0],d[1]]);const x=g.length,M=f.length;for(let s=0;s<x;s++){const t=g[s],i=g[(s+1)%x];for(let s=0;s<M;s++){const r=f[s],e=f[(s+1)%M];if(m(t,i,r,e))return!0}}return!1}}export{d as AFeatureTile};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{signal as i}from"../../../../core/signal.js";import{Milliseconds as e}from"../../../../core/time.js";import{getGaussianSplatAlphaCutoffValue as t}from"../../webgl-engine/shaders/GaussianSplatTechniqueConfiguration.js";class a{static{this.fadeInEase=i=>i*(2-i)}static{this.fadeOutEase=i=>i*i}static{this.inverseFadeInEase=i=>1-Math.sqrt(1-i)}static{this.inverseFadeOutEase=i=>Math.sqrt(1-i)}static{this.minimumFadeDuration=e(80)}static{this.resetFadeDurationInterval=e(1e3)}constructor(t){this._view=t,this._numFadingTiles=i(0),this._tmpFullyFadedOutTiles=new Array,this._previousNumFadingTiles=0,this._lastStoppedFading=e(0),this._currentFadeDuration=this.baseFadeDuration}get numFadingTiles(){return this._numFadingTiles.value}updateForFrame(i){if(i!==this._lastUpdatedFrameStart){if(this._lastUpdatedFrameStart=i,0===this.numFadingTiles)this._previousFrameStart=null;else{const t=e(null==this._previousFrameStart?0:i-this._previousFrameStart);this.updateAllTileFading(t),this._previousFrameStart=i}this._view.updateFadingTexture()}}fadeTile(i,e,t){const a=this._getTargetOpacity(e);if(i.fadeDirection=e,!this.fadingEnabled)return void this._instantTileFading(i,a);const s=i.opacityModifier;if(s!==a){const a=this._getFadeProgressFromOpacity(s,e);this._startTileFading(i,a,t)}else this._stopTileFading(i)}updateAllTileFading(i){const e=this._tmpFullyFadedOutTiles;e.length=0,this._view.tileHandles.forEach(t=>{this._updateTileFading(t,i)&&e.push(t)});e.length>0&&(this._view.notifyTileObbsChanged(e),0===this._numFadingTiles.value&&this._view.updateGaussians()),this._numFadingTiles.value>0&&this._view.view.stage?.renderView.requestRender(2)}onFadeDurationChanged(i){0===i&&this.numFadingTiles>0&&this._instantlyFullyFadeAllTiles()}isTileFadingOut(i){return null!=i.fadeProgress&&1===i.fadeDirection}onTileDiscarded(i){null!=i.fadeProgress&&(this._numFadingTiles.value--,0===this._numFadingTiles.value&&(this._lastStoppedFading=e(performance.now())))}updateFadeDuration(){if(this.numFadingTiles&&this.numFadingTiles>=this._previousNumFadingTiles){const i=.95*this._currentFadeDuration;this._currentFadeDuration=e(Math.max(i,a.minimumFadeDuration))}else 0===this.numFadingTiles&&performance.now()-this._lastStoppedFading>a.resetFadeDurationInterval&&(this._currentFadeDuration=this.baseFadeDuration);return this._previousNumFadingTiles=this.numFadingTiles,this._currentFadeDuration}get updating(){return this._numFadingTiles.value>0}get baseFadeDuration(){return this._view.view.qualitySettings.fadeDuration}get fadingEnabled(){return 0!==this.baseFadeDuration}_startTileFading(i,e,t){null==i.fadeProgress&&this._numFadingTiles.value++,i.fadeDuration=t,i.fadeProgress=e}_stopTileFading(i){null!=i.fadeProgress&&(1===i.fadeDirection&&this._onTileFullyFadedOut(i),this._numFadingTiles.value--,0===this._numFadingTiles.value&&(this._lastStoppedFading=e(performance.now())),i.fadeDuration=null,i.fadeProgress=null)}_updateTileFading(i,e){const{fadeProgress:t,fadeDirection:s}=i;if(null==t)return!1;const n=this._fadeDirectionToSign(s),r=i.fadeDuration,d=this._getTargetOpacity(s),u=e/Math.abs(r||1),l=Math.min(t+u,1),o=d-n*(1-(0===s?a.fadeInEase:a.fadeOutEase)(l)),h=1===l||this._tileReachedFadeOutCutoff(i,o);if(i.opacityModifier=h?d:o,h){const e=1===s;return this._stopTileFading(i),this._updateOpacityModifier(i),e}return i.fadeProgress=l,this._updateOpacityModifier(i),!1}_updateOpacityModifier(i){for(let e=0;e<i.pageIds.length;e++){const t=i.pageIds[e];this._view.data.fadingTexture.updateBuffer(i.opacityModifier,t)}}_tileReachedFadeOutCutoff(i,e){if(1!==i.fadeDirection)return!1;const a=t(this._view.view.qualitySettings.gaussianSplat.nonIdleMinimumOpacity);return e*i.maxGaussianOpacity<=a}_instantTileFading(i,e){i.fadeDuration=null,i.fadeProgress=null,i.opacityModifier=e,this._updateOpacityModifier(i),1===i.fadeDirection&&this._onTileFullyFadedOut(i)}_instantlyFullyFadeAllTiles(){const i=this._tmpFullyFadedOutTiles;i.length=0,this._view.tileHandles.forEach(e=>{if(null!=e.fadeProgress){const t=1===e.fadeDirection;this._instantTileFading(e,this._getTargetOpacity(e.fadeDirection)),t&&i.push(e)}});i.length>0&&(this._view.updateGaussians(),this._view.notifyTileObbsChanged(i)),this._numFadingTiles.value=0}_onTileFullyFadedOut(i){i.lifecycleState=0,this._view.moveTileToCache(i)}_fadeDirectionToSign(i){return 0===i?1:-1}_getTargetOpacity(i){return 0===i?1:0}_getFadeProgressFromOpacity(i,e){const t=Math.max(0,Math.min(i,1));return 0===e?a.inverseFadeInEase(t):a.inverseFadeOutEase(t)}}export{a as GaussianSplatFadeHelper};
2
+ import{signal as i}from"../../../../core/signal.js";import{Milliseconds as e}from"../../../../core/time.js";import{getGaussianSplatAlphaCutoffValue as t}from"../../webgl-engine/shaders/GaussianSplatTechniqueConfiguration.js";class a{static{this.fadeInEase=i=>i*(2-i)}static{this.fadeOutEase=i=>i*i}static{this.inverseFadeInEase=i=>1-Math.sqrt(1-i)}static{this.inverseFadeOutEase=i=>Math.sqrt(1-i)}static{this.minimumFadeDuration=e(80)}static{this.resetFadeDurationInterval=e(1e3)}constructor(t){this._view=t,this._numFadingTiles=i(0),this._tmpFullyFadedOutTiles=new Array,this._visibilityUpdatePending=!1,this._previousNumFadingTiles=0,this._lastStoppedFading=e(0),this._currentFadeDuration=this.baseFadeDuration}get numFadingTiles(){return this._numFadingTiles.value}updateForFrame(i){if(i!==this._lastUpdatedFrameStart){if(this._lastUpdatedFrameStart=i,0===this.numFadingTiles)this._previousFrameStart=null;else{const t=e(null==this._previousFrameStart?0:i-this._previousFrameStart);this.updateAllTileFading(t),this._previousFrameStart=i}this._view.updateFadingTexture()}}fadeTile(i,e,t){const a=this._getTargetOpacity(e);if(i.fadeDirection=e,!this.fadingEnabled)return void this._instantTileFading(i,a);const s=i.opacityModifier;if(s!==a){const a=this._getFadeProgressFromOpacity(s,e);this._startTileFading(i,a,t)}else this._stopTileFading(i)}updateAllTileFading(i){const e=this._tmpFullyFadedOutTiles;e.length=0,this._view.tileHandles.forEach(t=>{this._updateTileFading(t,i)&&e.push(t)});e.length>0&&(this._view.notifyTileObbsChanged(e),this._visibilityUpdatePending=!0),0===this._numFadingTiles.value&&this._visibilityUpdatePending&&(this._visibilityUpdatePending=!1,this._view.updateGaussians()),this._numFadingTiles.value>0&&this._view.view.stage?.renderView.requestRender(2)}onFadeDurationChanged(i){0===i&&this.numFadingTiles>0&&this._instantlyFullyFadeAllTiles()}isTileFadingOut(i){return null!=i.fadeProgress&&1===i.fadeDirection}onTileDiscarded(i){null!=i.fadeProgress&&(this._numFadingTiles.value--,0===this._numFadingTiles.value&&(this._lastStoppedFading=e(performance.now())))}updateFadeDuration(){if(this.numFadingTiles&&this.numFadingTiles>=this._previousNumFadingTiles){const i=.95*this._currentFadeDuration;this._currentFadeDuration=e(Math.max(i,a.minimumFadeDuration))}else 0===this.numFadingTiles&&performance.now()-this._lastStoppedFading>a.resetFadeDurationInterval&&(this._currentFadeDuration=this.baseFadeDuration);return this._previousNumFadingTiles=this.numFadingTiles,this._currentFadeDuration}get updating(){return this._numFadingTiles.value>0}get baseFadeDuration(){return this._view.view.qualitySettings.fadeDuration}get fadingEnabled(){return 0!==this.baseFadeDuration}_startTileFading(i,e,t){null==i.fadeProgress&&this._numFadingTiles.value++,i.fadeDuration=t,i.fadeProgress=e}_stopTileFading(i){null!=i.fadeProgress&&(1===i.fadeDirection&&this._onTileFullyFadedOut(i),this._numFadingTiles.value--,0===this._numFadingTiles.value&&(this._lastStoppedFading=e(performance.now())),i.fadeDuration=null,i.fadeProgress=null)}_updateTileFading(i,e){const{fadeProgress:t,fadeDirection:s}=i;if(null==t)return!1;const n=this._fadeDirectionToSign(s),d=i.fadeDuration,r=this._getTargetOpacity(s),l=e/Math.abs(d||1),u=Math.min(t+l,1),o=r-n*(1-(0===s?a.fadeInEase:a.fadeOutEase)(u)),h=1===u||this._tileReachedFadeOutCutoff(i,o);if(i.opacityModifier=h?r:o,h){const e=1===s;return this._stopTileFading(i),this._updateOpacityModifier(i),e}return i.fadeProgress=u,this._updateOpacityModifier(i),!1}_updateOpacityModifier(i){for(let e=0;e<i.pageIds.length;e++){const t=i.pageIds[e];this._view.data.fadingTexture.updateBuffer(i.opacityModifier,t)}}_tileReachedFadeOutCutoff(i,e){if(1!==i.fadeDirection)return!1;const a=t(this._view.view.qualitySettings.gaussianSplat.nonIdleMinimumOpacity);return e*i.maxGaussianOpacity<=a}_instantTileFading(i,e){i.fadeDuration=null,i.fadeProgress=null,i.opacityModifier=e,this._updateOpacityModifier(i),1===i.fadeDirection&&this._onTileFullyFadedOut(i)}_instantlyFullyFadeAllTiles(){const i=this._tmpFullyFadedOutTiles;i.length=0,this._view.tileHandles.forEach(e=>{if(null!=e.fadeProgress){const t=1===e.fadeDirection;this._instantTileFading(e,this._getTargetOpacity(e.fadeDirection)),t&&i.push(e)}});const e=i.length>0;e&&(this._visibilityUpdatePending=!0),this._numFadingTiles.value=0,this._visibilityUpdatePending&&(this._visibilityUpdatePending=!1,this._view.updateGaussians()),e&&this._view.notifyTileObbsChanged(i)}_onTileFullyFadedOut(i){i.lifecycleState=0,this._view.moveTileToCache(i)}_fadeDirectionToSign(i){return 0===i?1:-1}_getTargetOpacity(i){return 0===i?1:0}_getFadeProgressFromOpacity(i,e){const t=Math.max(0,Math.min(i,1));return 0===e?a.inverseFadeInEase(t):a.inverseFadeOutEase(t)}}export{a as GaussianSplatFadeHelper};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../Color.js";import{filterInPlace as i,difference as r}from"../../../core/arrayUtils.js";import s from"../../../core/CollectionFlattener.js";import{toConst as a}from"../../../core/compilerUtils.js";import{EventedAccessor as n}from"../../../core/Evented.js";import"../../../core/has.js";import l from"../../../core/Logger.js";import{clamp as o}from"../../../core/mathUtils.js";import{destroyMaybe as h}from"../../../core/maybe.js";import{MemCachePool as d}from"../../../core/MemCachePool.js";import p from"../../../core/ObjectPool.js";import u from"../../../core/PooledArray.js";import{throwIfAborted as c,isAbortError as g,isAborted as m}from"../../../core/promiseUtils.js";import{watch as _,syncAndInitial as y,sync as f,initial as T}from"../../../core/reactiveUtils.js";import{getMetersPerUnitForSR as v}from"../../../core/units.js";import{property as w,subclass as S}from"../../../core/accessorSupport/decorators.js";import{exactEquals as C,set as b,copy as E}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{create as x}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{UpdatingHandles as U}from"../../../core/support/UpdatingHandles.js";import{getReferenceEllipsoid as L,radiusModifier as P}from"../../../geometry/ellipsoidUtils.js";import R from"../../../geometry/SpatialReference.js";import{getProjector as M}from"../../../geometry/projection/projectors.js";import{projectPointToVector as D}from"../../../geometry/projection/projectPointToVector.js";import{projectVectorToVector as j}from"../../../geometry/projection/projectVectorToVector.js";import{create as I,equals as k,intersection as V,intersectsSphere as A}from"../../../geometry/support/aaBoundingRect.js";import{copy as B,create as G}from"../../../geometry/support/frustum.js";import{createSpatialReferenceCyclical as O}from"../../../geometry/support/normalizeUtils.js";import{isPlateCarree as q}from"../../../geometry/support/spatialReferenceUtils.js";import{Sphere as N}from"../../../geometry/support/sphere.js";import{ElevationQueryTileCache as F}from"../../../layers/support/ElevationQueryTileCache.js";import{isBaseLayer as W}from"../../../layers/support/layerUtils.js";import{queueHighPriority as H}from"../../../request/queue.js";import{debugFlags as $}from"../support/debugFlags.js";import{ElevationRange as Q}from"../support/ElevationRange.js";import{ElevationUpdateEvent as z}from"../support/ElevationUpdateEvent.js";import{calculateElevationUpdateExtents as Y}from"../support/elevationUpdateExtentUtils.js";import{toBoundingRect as X}from"../support/extentUtils.js";import{updatingProgress as K}from"../support/updatingProperties.js";import{ElevationBounds as J}from"./ElevationBounds.js";import{ElevationData as Z,sampleElevation as ee}from"./ElevationData.js";import{create as te}from"./ExtentHelper.js";import{LayerClasses as ie}from"./LayerClass.js";import{OverlayManager as re}from"./OverlayManager.js";import{PlanarPatch as se}from"./PlanarPatch.js";import{Queue as ae}from"./Queue.js";import{ScaleRangeQueries as ne}from"./ScaleRangeQueries.js";import{SphericalPatch as le}from"./SphericalPatch.js";import{SplitLimits as oe}from"./SplitLimits.js";import{maxRootTiles as he,tooManyRootTilesAfterChangeError as de,tooManyRootTilesForLayerError as pe,maxTileNeighborLevelDelta as ue,maxMemoryLodBias as ce}from"./TerrainConst.js";import{TerrainRenderer as ge}from"./TerrainRenderer.js";import me from"./TerrainSurfacePerformanceInfo.js";import{weakAssert as _e,isVectorTileLayerView as ye,neighborEdgeIndices as fe,internalAssert as Te,oppositeEdge as ve,isSurfaceLayerView as we,isGroupLayerView as Se,isMapTileLayerView as Ce,isBlendableLayerView as be,isElevationLayerView as Ee,releaseTerrainData as xe,enableTerrainInternalChecks as Ue,oppositeCorner as Le,enableWaterproofTests as Pe,enableInternalTerrainChecks as Re,enableTerrainWaterproofChecks as Me,neighborCornerIndices as De}from"./terrainUtils.js";import{Tile as je,lijEquals as Ie}from"./Tile.js";import{printAllocations as ke}from"./TilePerLayerInfo.js";import{sortTiles as Ve,IteratorPreorder as Ae,IteratorPostorder as Be,compareTilesByLij as Ge,hasLoadableSiblings as Oe,sortTilesByPOI as qe,traverseTilesPreorder as Ne}from"./tileUtils.js";import{TilingSchemeLogic as Fe}from"./TilingSchemeLogic.js";import{UpsampleInfo as We}from"./UpsampleInfo.js";import{isCompositeBlendMode as He,blendModeFromString as $e}from"../webgl-engine/core/shaderLibrary/output/BlendOptions.js";import{hasLayerBasedScaleVisibility as Qe}from"../../support/layerViewUtils.js";import{ImmediateTask as ze,TaskPriority as Ye,noBudget as Xe}from"../../support/Scheduler.js";import{TextureCompressionTracker as Ke}from"../../support/TextureCompressionTracker.js";import{Yield as Je}from"../../support/Yield.js";var Ze;let et=class extends n{static{Ze=this}get allTilesCreated(){return this._allTilesCreated}get allTiles(){return a(this._allTiles)}get renderedTiles(){return Ve(i(this._allTiles.toArray(),e=>e.visible&&e.rendered))}get demResolution(){const{_allTiles:e,tilingScheme:t}=this;if(0===e.length)return{min:1,max:1};const i=v(t.spatialReference);let r=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY;for(const a of e){const e=t.resolutionAtLevel(a.level)*i;r=Math.min(r,e),s=Math.max(s,e)}return{min:r,max:s}}constructor(e){super(e),this.terrainTextureCompressionTracker=new Ke,this._iteratorPool=new p(()=>new Ae,e=>e.remove=()=>this._iteratorPool.release(e)),this._postorderIterator=new Be,this._hasPendingUpdates=!1,this._pendingUpdates=0,this._asyncWorkItems=0,this._allTilesDirty=!0,this._allTilesSorted=!0,this._allTilesCreated=!1,this._usedMemory=null,this._performanceInfo=new me,this._viewChanged=!1,this.heading=0,this._inFrameTask=!1,this._viewChangeUpdateDirty=!1,this._eyePosRenderSR=x(),this._eyePosSurfaceSR=x(),this._splitLimits=new oe,this._layerViews=[new Array,new Array],this._layerIndexByUid=[new Map,new Map],this._basemapLayerViewHandles=new Map,this._watchUpdatingTracking=new U,this._frameTask=ze,this._allTiles=new u,this._upsampleInfoPool=new p(()=>new We),this._shouldEmitChangeEvent=!1,this._rootTilesExtent=I(),this.updatingProgress=.5,this._maxNumUpdating=1,this.maxTextureScale=1.2,this._spatialReference=R.WebMercator,this._elevationProjectorCache=new Map,this.visibleElevationRange=new Q(1/0,-1/0),this._rootTileElevationRange=new Q(1/0,-1/0),this._projectorCache=new Map,this._tilingSchemeSpatialReference=null,this._updatingRootTiles=!1,this._pendingTilesForElevationUpdateEvent=new Set,this._pendingTilesToUpdate=new Set,this.totalGeometryUpdates=0,this.totalTileUpdates=0,this._oneBatchPerFrameTask=!0,this._layerViewsDirty=!1,this.unloadedMemory=0,this.ignoresMemoryFactor=!1,this._isWebMercator=!1,this._isWebMercatorOnPlateCarree=!1,this.enabled=!0;const{view:t}=e;this.overlayManager=new re({...e,terrainSurface:this}),this._isGlobal=!t.state?.isLocal,this._isGeographic=this._spatialReference?.isGeographic??!1,this._tileConstructor=this._isGlobal?le:se,this._ellipsoid=L(t.spatialReference),this._renderer=new ge(this.overlayManager.renderer,t.stage,this._allTiles,this.terrainTextureCompressionTracker,t.resourceController.memoryController),Qe()||(this._scaleRangeQueries=new ne)}initialize(){const{view:e}=this,{resourceController:t}=e,{memoryController:i}=t;this._tileCache=new d((e,t)=>i.newCache(e,t),"terrain-tile"),this._upsampleMapCache=i.newCache("terrain-upsample",({tile:e})=>e.unloadMapData()),this._elevationQueryCache=new F(i.newCache("elevation-query"));const r=this.overlayManager;this.addHandles([_(()=>r.renderer.isEmpty,()=>this._evaluateTransparency()),_(()=>this.renderer.visible,e=>this.suspended=!e),_(()=>this.heading,e=>{this._renderer.updateHeading(e),this._updateTileTextures(0)},y),_(()=>({heading:e.camera?.heading,state:e.state?.mode}),({heading:e,state:t})=>{if(null==e)return;if(this.isGlobal&&this.isGeographic||this.isWebMercatorOnPlateCarree)return void(this.heading=90*Math.round(e/90)%360);const i=Math.round(e)%360,r=Math.abs(i-this.heading);(2===t||Math.min(r,360-r)>=30)&&(this.heading=i)})],"overlayManager"),this.addHandles([_(()=>this.baseOpacity,()=>{this._handleLayerViewChanges(),this._updateTileTextures(this._evaluateTransparency()?1:2)},y),_(()=>this.hasCompositeBlendMode,()=>this._updateTileTextures(this._evaluateTransparency()?1:2),y),_(()=>this.backgroundColor,(e,t)=>{e?.equals(t)||(this._handleLayerViewChanges(),this._renderer.updateTileBackground(e))},f),_(()=>this.snapLevel,()=>this._viewChanged=!0,f),_(()=>this.view.pointsOfInterest,e=>{this._renderer.pointsOfInterest=e,this._watchUpdatingTracking.removeAll(),e&&this._watchUpdatingTracking.add(()=>e.focus?.renderLocation,()=>this._allTilesSorted=!1,{equals:C})}),_(()=>$.TERRAIN_TILE_TREE_SHOW_TILES,t=>{t&&!this._treeDebugger?import("../layers/support/TerrainTileTree3DDebugger.js").then(({TerrainTileTree3DDebugger:t})=>{!this._treeDebugger&&$.TERRAIN_TILE_TREE_SHOW_TILES&&(this._treeDebugger=new t({view:e}))}):t||(this._treeDebugger=h(this._treeDebugger))},T)]);const{spatialReference:a}=e;this._extentHelper=te(this.viewingMode,{layers:e.map.allLayers,layerViews:e.allLayerViews,viewSpatialReference:a});const n=new s({getCollections:()=>e.defaultsFromMap?.mapCollections?.map(({layers:e})=>e),getChildrenFunction:e=>e&&"layers"in e?e.layers:null}),l=new Fe({layers:n,extentHelper:this._extentHelper,viewingMode:this.viewingMode,viewSpatialReference:a});this._set("tilingSchemeLogic",l),this._updateTilingScheme();const o=t.scheduler;this._frameTask=o.registerTask(Ye.TERRAIN_SURFACE,this),this.addHandles([_(()=>this._extentHelper.stencilEnabledExtents,e=>this._renderer.setStencilEnabledLayerExtents(e),T),_(()=>this.tilingSchemeLogic.tilingScheme,()=>this._updateTilingScheme(),f),_(()=>this.groundExtent,()=>this._updateRootTiles(),T),e.on("resize",()=>this._viewChangeUpdate()),_(()=>{const t=e.state;return[this._lodBias,this.lodSnappingEnabled,e.quality,t.camera,t.contentCamera,t.fixedContentCamera]},()=>this._viewChangeUpdate(),y),_(()=>e.qualitySettings?.fadeDuration,e=>this._renderer.textureFadingEnabled=e>0,T),_(()=>e.qualitySettings?.physicallyBasedRenderingEnabled,e=>this._renderer.pbrMode=e?5:0,T),_(()=>e.qualitySettings?.tiledSurface.elevationLevelDelta,()=>this._updateAllTileGeometries()),_(()=>this.userClippingExtent,()=>this._updateClippingExtent(),f)]),this.addHandles(e.allLayerViews.on("after-changes",()=>this._layerViewsDirty=!0)),this._layerViewsDirty=!0,this._handleLayerViewChanges(),this._renderer.updateTileBackground(this.backgroundColor)}clearHandles(){this._watchUpdatingTracking?.removeAll(),this.removeAllHandles(),this._basemapLayerViewHandles.forEach((e,t)=>this._unregisterTiledLayerView(t)),this._basemapLayerViewHandles.clear()}destroy(){this._frameTask.remove(),this._frameTask=ze,this._watchUpdatingTracking?.destroy(),this._removeAllTiles(),this._set("tilingSchemeLogic",h(this.tilingSchemeLogic)),this._basemapLayerViewHandles.forEach((e,t)=>this._unregisterTiledLayerView(t)),this._basemapLayerViewHandles.clear(),this._set("overlayManager",h(this.overlayManager)),this._tileCache=h(this._tileCache),this._allTiles.prune(),je.prune(),this._treeDebugger=h(this._treeDebugger),this._renderer.destroyed||this._renderer.destroy(),this._renderer=null,this._iteratorPool=h(this._iteratorPool),this._upsampleMapCache=h(this._upsampleMapCache),this._elevationQueryCache=h(this._elevationQueryCache),this._set("view",null),this._extentHelper=h(this._extentHelper),this._upsampleInfoPool=h(this._upsampleInfoPool),ke(),this._layerViews.forEach(e=>e.length=0),this._performanceInfo=null}get renderer(){return this._renderer}get frustum(){return this.view.state.camera.frustum}get snapLevel(){return this.lodSnappingEnabled?this.view.terrainLevel:null}get lodSnappingEnabled(){return this.view.qualitySettings.tiledSurface.reduceTileLevelDifferences}get upsampleInfoPool(){return this._upsampleInfoPool}get upsampleMapCache(){return this._upsampleMapCache}get elevationQueryCache(){return this._elevationQueryCache}get hasStencilEnabledExtents(){return this._extentHelper.stencilEnabledExtents.length>0}get userClippingExtent(){const{spatialReference:e}=this,t=this.view?.clippingArea;if(null==t||null==e)return null;const i=I(),r=X(t,i,e)?i:null,s=this._get("userClippingExtent");return k(r,s)?s:r}get rootTilesExtent(){return this._rootTilesExtent}get groundExtent(){const e=V(this.fullGroundExtent,this.userClippingExtent,I()),t=this._get("groundExtent");return k(e,t)?t:e}get fullGroundExtent(){return null!=this._tilingSchemeExtent?this._tilingSchemeExtent:this._rootTilesExtent}get _tilingSchemeExtent(){return this.tilingSchemeLogic?.extent}get updating(){return this._hasPendingUpdates||(this._maxNumUpdating=1),this.enabled&&!!((this.readyToRun||this._watchUpdatingTracking?.updating||this._asyncWorkItems>0)&&this.ready&&!this.suspended||this.overlayManager?.updating||this.terrainTextureCompressionTracker.compressing)}get readyToRun(){return this.enabled&&(this._hasPendingUpdates||this._viewChanged||this._allTilesDirty||!this._allTilesSorted||this._hasElevationSourceUpdates||this._layerViewsDirty||this._scaleRangeQueries?.updating||this._frameTask.updating)&&this.ready&&!this.suspended}get _hasElevationSourceUpdates(){return this._allTiles.some(e=>e.needsElevationSourceUpdate())}get updatingProgressValue(){return this._maxNumUpdating=Math.max(this._pendingUpdates,this._maxNumUpdating),1-this._pendingUpdates/this._maxNumUpdating}get baseOpacity(){return this.view?.map?.ground?.opacity??1}set baseOpacity(e){this.view.map.ground.opacity=e}get viewingMode(){return this.view.state.viewingMode}get ready(){return!this.enabled||null!=this._rootTiles}get rootTiles(){return this._rootTiles}get spatialReference(){return this.tilingScheme?.spatialReference??null}get backgroundColor(){return this.view?.map?.ground?.surfaceColor}set backgroundColor(e){this.view.map.ground.surfaceColor=e}set slicePlaneEnabled(e){this._renderer.slicePlaneEnabled=e,this._set("slicePlaneEnabled",e),this._evaluateTransparency()}get tilingSchemeLocked(){return this.tilingSchemeLogic?.tilingSchemeLocked??!1}get wireframe(){return this._renderer?.wireframe}set wireframe(e){e!==this._renderer.wireframe&&(this._renderer.wireframe=e,this._updateAllTileGeometries())}get opaque(){return 0===this._renderer.transparency}get invisible(){return 3===this._renderer.transparency}set suspended(e){this._set("suspended",e),this._viewChangeUpdate()}get fadeDuration(){return this.view.qualitySettings.fadeDuration??0}intersect(e,t,i,r){this._renderer.intersectRay(e,t,i,r)}getElevationLevelDelta(e){return e<4?3:this.view.qualitySettings.tiledSurface.elevationLevelDelta}get _xNormalizer(){return O(this._spatialReference)}getElevation(e,t,i,r){const s=this._rootTiles;if(!s?.length||!this.enabled)return null;if(0===s[0].layerInfo[0].length)return null;let a=this._elevationProjectorCache.get(r);if(void 0===a&&(a=M(r,this._spatialReference)??null,this._elevationProjectorCache.set(r,a)),null==a)return l.getLogger(this).error("TerrainSurface.getElevation(): could not project given point to tiling scheme coordinate system"),null;const n=b(it,e,t,i);a(n,0,n,0);return lt(s,this._xNormalizer?.normalize(n[0])??n[0],n[1])}getElevations(e,t,i){const r=this._rootTiles,s=r?r[0].layerInfo[0].length:0;if(r?.length&&0!==s&&this.enabled)for(let a=0;a<t;++a){const t=3*a;i(a,lt(r,e[t],e[t+1]))}else for(let a=0;a<t;++a)i(a,null)}getLayerIndexByUID(e,t){return this._layerIndexByUid[e].get(t)}getScale(e){if(!this.tilingScheme)return null;if(!D(e,it,this.spatialReference))return l.getLogger(this).error("TerrainSurface.getScale(): could not project given point to tiling scheme coordinate system"),null;const t=this._rootTiles;if(null!=t)for(const i of t)if(i?.containsPoint(it)){let e=i;for(;e.children[0]&&!e.rendered;){const t=e.children[0].extent;let i=0;it[0]>t[2]&&(i+=1),it[1]<t[1]&&(i+=2),e=e.children[i]}return this._getLodBiasCorrectedScale(e.level)}return 1/0}_ensureProjector(e){const t=this._projectorCache.get(e);if(t)return t;const i=M(e,this._tilingSchemeSpatialReference)??null;return this._projectorCache.set(e,i),i}getSphereElevationRange(e,t){if(!this.enabled||null==this._rootTiles)return null;const i=this._ensureProjector(t);if(null==i)return l.getLogger(this).error("TerrainSurface.getSphereElevationRange(): could not project given point to tiling scheme coordinate system"),null;rt.copyFrom(e),i(rt.center,0,rt.center,0);const r=new Q,s=this._rootTiles;if(null!=s){const e=[];for(const i of s)e.push(i);let t=0;for(;t<e.length;){const i=e[t];if(++t,!A(i.extent,rt))continue;const s=i.children;if(null==s[0]||i.rendered)r.expandElevationRangeValues(i.elevationBoundsMin,i.elevationBoundsMax);else for(const t of s)e.push(t)}}return r}getRootElevationRange(){return this.enabled&&null!=this._rootTiles?new Q(this._rootTileElevationRange.minElevation,this._rootTileElevationRange.maxElevation):null}getLowerBoundRadius(){const e=(this._ellipsoid.radius+this.visibleElevationRange.minElevation)*P;return Math.min(e,this._ellipsoid.radius)}getSphereScale(e,t){if(!this.tilingScheme)return null;if(!D(e,rt.center,this.spatialReference))return l.getLogger(this).error("TerrainSurface.getSphereScale(): could not project given point to tiling scheme coordinate system"),null;rt.radius=t;let i=null;const r=e=>{if(e&&A(e.extent,rt)){const t=e.children;if(t[0]&&!e.rendered)for(const e of t)r(e);else{const t=this._getLodBiasCorrectedScale(e.level);i=null==i?t:Math.min(i,t)}}},s=this._rootTiles;if(null!=s)for(const a of s)r(a);return i}queryVisibleScaleRange(e,t,i,r){if(!this._scaleRangeQueries)return;const s=t?this.tilingScheme.levelAtScale(t):0,a=i?this.tilingScheme.levelAtScale(i):1/0,n=this._lodBias;this._scaleRangeQueries.queryVisibleLevelRange(e,s+n,a+n,r)}_evaluateTransparency(){const e=this.baseOpacity,t=this.overlayManager.renderer.isEmpty,i=this._renderer.transparency,r=this._isFullyTransparent?t?3:2:e>=1&&!this.hasCompositeBlendMode&&!this._renderer.slicePlaneEnabled?0:1;return this._renderer.transparency=r,i!==r&&(this.notifyChange("opaque"),this.notifyChange("invisible"),!0)}_updateTilingScheme(){const{tilingScheme:e}=this.tilingSchemeLogic;if(!(e!==this.tilingScheme))return;_e(!!e,"tiling scheme cannot be reset to undefined"),this._isGlobal=!this.view?.state?.isLocal,this.tilingScheme&&this._removeAllTiles();const t=e?.spatialReference??R.WebMercator;this._spatialReference=t,this._isWebMercator=!!t?.isWebMercator,this._isWebMercatorOnPlateCarree=this._isWebMercator&&q(this.view?.renderSpatialReference),this._isGeographic=t?.isGeographic??!1,this._set("tilingScheme",e),this._tilingSchemeSpatialReference=this.tilingScheme?.spatialReference,this._projectorCache.clear(),this._updateClippingExtent(),e&&(this._updateTiledLayers(),this._renderer.tileSize=e.pixelSize,this.overlayManager.spatialReference=e.spatialReference,this._updateRootTiles())}static{this._tileMemcacheKey="TerrainTileMemcache"}_acquireTile(e,t,i,r){const s=this._tileCache.pop(Ze._tileMemcacheKey);return s?(s.init(e,t,i,r,this),s):new this._tileConstructor(e,t,i,r,this)}get updatingRootTiles(){return this._updatingRootTiles}_updateRootTiles(){const{groundExtent:e,tilingScheme:t}=this;if(!t)return;if(!this.enabled)return void this._setRootTiles(null);const i=st;let s=t.rootTilesInExtent(e,i,5*he);if(null!=this._rootTiles){if(s.length>he)return void l.getLogger(this).warn(de);const e=this._rootTiles.map(e=>e.lij),t=r(e,s,Ie);if(this._updatingRootTiles=!0,t.removed.length>0||t.added.length>0){const e=this._rootTiles.filter(e=>!(t.removed.findIndex(t=>Ie(t,e.lij))>-1)||(this._purgeTile(e),!1));t.added.forEach(t=>e.push(this._newRootTile(t))),this._setRootTiles(e)}}else this._updatingRootTiles=!0,s.length>he&&(l.getLogger(this).warn(pe),s=t.rootTilesInExtent(e,i,he)),this._setRootTiles(s.map(e=>this._newRootTile(e)));k(i,this._rootTilesExtent)||(this._rootTilesExtent=I(i)),this.renderer.visible=!0,this._viewChangeUpdate(),this.overlayManager.setPlacementDirty(),this.notifyChange("ready"),this._updateAllTileGeometries(),this._updatingRootTiles=!1,this.checkAllTilesWaterproofness()}_updateAllTileGeometries(){const e=this._allTiles.filter(e=>this._canUpdateTileGeometry(e));0!==e.length?(e.sort(Ge),e.forEach(e=>this._renderer.updateTileGeometryState(e)),e.forEach(e=>e.renderData.updateNeighborData()),this._updateTilesGeometries(e),this._pendingTilesToUpdate.clear()):this._pendingTilesToUpdate.clear()}_updateTilesGeometries(e){const t=e.filter(e=>this._canUpdateTileGeometry(e));if(0===t.length)return;const i=this.renderer;for(const r of t)i.updateGeometryIfNeeded(r);for(const r of t)this._pendingTilesForElevationUpdateEvent.add(r)}_canUpdateTileGeometry(e){return e.loaded&&e.intersectsClippingArea&&e.hasGeometryState}_shouldSplit(e){return 1===e.shouldSplit(this._splitLimits,this._eyePosRenderSR,this.snapLevel)}_newRootTile(e){const t=this._acquireTile(0,e[1],e[2],null);return this._shouldSplit(t)&&t.setPendingUpdate(1),this._loadTile(t),this._markTileToUpdate(t),this._updateRootTileElevationRange(),t}_setRootTiles(e){if(this._rootTiles=e,this._allTiles.clear(),null!=e){const t=this._iteratorPool.acquire();for(t.reset(e);!t.done;)this._allTiles.push(t.next());t.remove()}this._renderer.setRootTiles(this._rootTiles),this._updateTilesVisibility(e),this.notifyChange("demResolution"),this.emit("tiles-changed",{allTiles:this.allTiles})}_runViewChangeUpdateIfDirty(){this._viewChangeUpdateDirty&&(this._viewChangeUpdateDirty=!1,this._viewChangeUpdate())}_viewChangeUpdate(){this.view&&!this.suspended&&this.tilingScheme&&this.renderer.visible&&(this._inFrameTask?this._viewChangeUpdateDirty=!0:(this._viewChangeUpdateDirty=!1,this._updateViewDependentParameters(),this._updateTilesVisibility(this._rootTiles)))}_updateClippingStatus(e){e.updateClippingStatus(this.groundExtent)&&e.resetPendingUpdate(8)&&this._updateTileGeometryState(e)}_updateTilesVisibility(e){if(null==e)return;const t=Oe(e),i=this.visibleElevationRange;let r=t?i.minElevation:1/0,s=t?i.maxElevation:-1/0;const a=this.groundExtent,n=this.view.state.contentCamera.viewProjectionMatrix;this.setTileTreeDirty(!1);const l=this._iteratorPool.acquire();for(l.reset(e);!l.done;){const e=l.next();e.updateClippingStatus(a)&&e.resetPendingUpdate(8)&&this._updateTileGeometryState(e),e.computeVisibility(),e.updateScreenDepth(n),e.renderData&&(r=Math.min(e.elevationBoundsMin,r),s=Math.max(e.elevationBoundsMax,s))}l.remove(),this._viewChanged=!0,this._allTilesDirty=!0,this._updatePendingTileGeometries(),isFinite(r)&&isFinite(s)&&(i.minElevation!==r||i.maxElevation!==s)&&(this.visibleElevationRange=new J(r,s))}_updateRootTileElevationRange(){let e=1/0,t=-1/0;const i=this._rootTiles;null!=i&&i.forEach(({elevationBoundsMin:i,elevationBoundsMax:r})=>{e=Math.min(e,i),t=Math.max(t,r)});const r=this._rootTileElevationRange;r.minElevation===e&&r.maxElevation===t||(this._rootTileElevationRange=new J(e,t))}_updateViewDependentParameters(){const{camera:e,contentCamera:t}=this.view.state,i=Math.tan(.5*t.fovX),r=Math.tan(.5*t.fovY),s=this.tilingScheme.pixelSize,a=2**-this._lodBias*e.pixelRatio;this._splitLimits.aboveGround=e.aboveGround,this._splitLimits.fovX=i,this._splitLimits.fovY=r,this._splitLimits.relativeWidthLimit=s/e.width*this.maxTextureScale*a,this._splitLimits.relativeHeightLimit=s/e.height*this.maxTextureScale*a,this._splitLimits.maxLod=this.tilingScheme.getMaxLod(),this._splitLimits.angledSplitBias=this.view.qualitySettings.tiledSurface.angledSplitBias,this.view.state.fixedContentCamera?this._splitLimits.frustum=B(this._splitLimits.frustum??G(),t.frustum):this._splitLimits.frustum=null,E(this._eyePosRenderSR,t.eye),j(e.eye,this.view.renderSpatialReference,this._eyePosSurfaceSR,this.spatialReference)}_updateTileGeometryState(e){e.updateVisibility();const t=this._renderer.updateTileGeometryState(e);e.needsElevationSourceUpdate()&&(e.updateAgents(0),e.markElevationSourceUpdateRequested(),this.requestUpdate()),t&&this._markTileToUpdate(e),this.setMemoryDirty()}_markAllTileNeighborsForUpdate(e){e.forEachLoadedNeighbor(e=>{this._layerViews[1].some(ye)&&e.setPendingUpdate(32),this._pendingTilesToUpdate.add(e)})}_updateTileTexture(e,t){const i=e.resetPendingUpdate(32)?32:!!e.resetPendingUpdate(16)&&16;i&&(this._renderer.updateTileTexture(e,i),this._usedMemory=null,t.madeProgress())}_emitElevationUpdateEventForTiles(){if(!this._shouldEmitChangeEvent)return;const e=this._pendingTilesForElevationUpdateEvent;if(e.size>0){const t=new Float64Array(4*e.size);let i=0;for(const r of e)t.set(r.extent,4*i),++i;e.clear();for(const e of Y(t,this.spatialReference)){const t=new z(this.spatialReference,e,"ground");this.emit("elevation-change",t)}}this._shouldEmitChangeEvent=!1}runTask(e){this._handleLayerViewChanges(e),this._frameTask.processQueue(e),this.renderer.processScaleRangeQueries(this._scaleRangeQueries,e),this._inFrameTask=!0,this._pendingUpdates=0,this._hasPendingUpdates=!1,this._updateAllTilesStatus(e),this._sortTiles(e);const t=!this.view.state.fixedContentCamera;this._mergeAndSplit(e,t),this._updateElevation(e),this._updateElevationSources(e),this._updateTextures(e),t||this._mergeAndSplit(e,!0),this._inFrameTask=!1,this._runViewChangeUpdateIfDirty();const i=this._pendingTilesToUpdate.size>0,r=i&&this._hasPendingGeometryWithoutIndices();if(e.done&&!r||this._updatePendingTileGeometries(),this._emitElevationUpdateEventForTiles(),e.done&&(e.hasProgressed||i&&!r)&&this.requestUpdate(),this.notifyChange("updatingProgressValue"),Ue&&this._checkTileInvariant(),!e.hasProgressed)return Je}_checkTileInvariant(){const e=new Map;this._allTiles.forAll(t=>e.set(t,new Set)),this._allTiles.forAll(t=>{if(_e(t.rendered===t.leaf,` rendered ${t.rendered} != ${t.leaf} leaf`),!t.leaf){const e=e=>0===e.unmergableChildCount&&0===e.maxLevelDeltaNeighborCount,i=t.children.reduce((t,i)=>t+(e(i)?0:1),0);if(_e(t.unmergableChildCount===i,` Tile[${t.lij.toString()}] unmergeable child count mismatch: actual ${t.unmergableChildCount} vs ${i}`),t.hasPendingUpdate(4)){_e(!t.hasPendingUpdate(1),"Tile can be both split and merge at the same time");for(const e of t.children)_e(e.leaf||e.hasPendingUpdate(4),"Child of tile to merge must also merge")}}for(let i=0;i<4;++i){if(t.rendered){const e=t.renderData?.geometryState.edgePeerNeighbors[i];if(null!=e){{const r=t.level-e.level<=ue;r||(console.log(`tile level delta [${t.lij.toString()}] vs [${e.lij.toString()}] > ${ue} (edge[${i}])`),_e(r,`tile level delta [${t.level}] vs [${e.level}] > ${ue}`))}_e(t.level-e.level<=ue,`Max tile lod delta exceeded: [${t.lij.toString()}] vs [${e.lij.toString()}]`)}}const r=t.level-ue,s=e=>e.leaf||e.level===t.level,a=t.findNeighborTile(fe[i],s);if(null!=a){if(t.leaf&&t.level>=ue){let i=a;for(;t.level-i.level<ue;)i=i.parent;const s=[r,t.lij[1]>>ue,t.lij[2]>>ue];if(!Ie(s,i.lij)){const r=e.get(i);_e(!r.has(t),"Cannot already have neighbor"),r.add(t)}}_e(a.rendered||a.level===t.level,"Non-same-level-neighbor of rendered must be rendered"),_e(t.level-a.level<=ue,`Tile level delta [${t.level}] vs [${a.level}] > ${ue}`)}}}),this._allTiles.forAll(t=>{const i=t.maxLevelDeltaNeighborCount,r=e.get(t);_e(i===r.size,`Tile[${t.lij.toString()}] merge-blocker mismatch: actual ${i} vs ${r.size}`)})}_updateAllTilesStatus(e){if(!this._viewChanged||!this._rootTiles||e.done)return;this._viewChanged=!1;let t=!1;const i=new ae(this._allTiles.length);i.pushAll(this._rootTiles);const r=this.snapLevel,s=this._splitLimits,a=this._eyePosRenderSR;this._allTiles.forAll(e=>{e.maxLevelDeltaNeighborCount=0,e.unmergableChildCount=0});const n=this.view.state.contentCamera.viewProjectionMatrix;for(;!i.empty;){const e=i.pop(),l=e.parent,o=l?.hasPendingUpdate(4),h=o?4:e.shouldSplit(s,a,r),d=1===h;e.leaf?ot(e,d):i.pushAll(e.children),o?(e.resetPendingUpdate(1),e.leaf||(e.setPendingUpdate(4),t=!0),this._updateClippingStatus(e),e.updateVisibility(),e.updateScreenDepth(n)):d?(e.resetPendingUpdate(4),e.leaf&&(e.setPendingUpdate(1),t=!0)):(e.resetPendingUpdate(1)&&e.updateAgentSuspension(),2===h&&e.updateAgents(0),e.leaf||(e.setPendingUpdate(4),e.resetPendingUpdate(1),t=!0))}this._allTilesDirty=t,this.requestUpdate(),(this._shortBatches||!this._oneBatchPerFrameTask)&&this._updatePendingTileGeometries(),e.madeProgress()}_sortTiles(e){e.done||this._allTilesSorted||!this.view.pointsOfInterest?.focus||(qe(this._allTiles,this.view.pointsOfInterest.focus.renderLocation),this._allTilesSorted=!0,this._treeDebugger?.update(),e.madeProgress())}_markTileToUpdate(e){Te(e.loaded),e.intersectsClippingArea&&(this._pendingTilesToUpdate.add(e),this._markAllTileNeighborsForUpdate(e))}_hasPendingGeometryWithoutIndices(){for(const e of this._pendingTilesToUpdate)if(e.loaded&&e.intersectsClippingArea&&null==e.renderData?.vao?.indexBuffer)return!0;return!1}_updatePendingTileGeometries(){const e=this._pendingTilesToUpdate,t=[];if(e.forEach(e=>{this._canUpdateTileGeometry(e)&&t.push(e)}),0===t.length)return void e.clear();const i=(i,r)=>{!r||!this._canUpdateTileGeometry(r)||r.level<i.level||e.has(r)||(e.add(r),t.push(r),r.renderData.updateNeighborData())};t.sort(Ge);const r=t.length;for(let s=0;s<r;++s){const r=t[s];Te(r.loaded),Te(r.intersectsClippingArea);const a=r.renderData;if(!a?.geometryState)continue;a.updateNeighborData();const n=a.dirtyEdgeResolutions,l=a.geometryState,o=e=>{const t=De[e];i(r,l.cornerPeerNeighbors[e]?.findCorner(Le(t),e=>e.loaded))};for(let t=0;t<4;++t)if(n&1<<t){const s=a.geometryState.edgePeerNeighbors[t];s&&s?.level>=r.level&&s.forAllSubtreeOnSide(ve(fe[t]),t=>!!this._canUpdateTileGeometry(t)&&(Te(e.has(t)||Ge(r,t)<0),i(r,t),!0)),o((t+1)%4),o(t)}}e.clear(),this._updateTilesGeometries(t),this._shouldEmitChangeEvent=!0,Ue&&Pe&&this.checkAllTilesWaterproofness()}_mergeAndSplit(e,t){if(this.suspended||e.done||!this._allTilesDirty)return;this._allTilesDirty=!1,this.requestUpdate();let i=!1;const r=this.view.state.fixedContentCamera;let s=!1;for(;!e.done;){s=!0;let a=!1;const n=!this._allTiles.some(s=>{if(!i&&!r&&!s.visible)return e.done;let n=s;if(s.hasPendingUpdate(4)){if(!t||s.unmergableChildCount>0)return e.done;for(s.resetPendingUpdate(4);null!=n.parent&&0===n.parent.unmergableChildCount&&n.parent.resetPendingUpdate(4);)n=n.parent;this._mergeTile(n),a=!0,e.madeProgress()}else if(s.resetPendingUpdate(1)){let t=!0;const i=s.level;if(i>=ue){const e=e=>e.leaf||i-e.level<ue;for(let r=0;r<4;++r){const a=s.findNeighborTile(fe[r],e);null!=a&&i-a.level===ue&&(t=!1,Ue&&(Te(a.leaf),Te(a.hasPendingUpdate(1))))}}t?(this._splitTile(s),e.madeProgress(),a=!0):s.setPendingUpdate(1)}return e.done});if(a&&(this._allTilesSorted=!1,this._allTilesDirty=!0,!this._oneBatchPerFrameTask&&this._updatePendingTileGeometries()),n){if(!i){i=!0;continue}if(!a)break}else this._allTilesDirty=!0}s?e.madeProgress():this._allTilesDirty=!0,!this._oneBatchPerFrameTask&&this._updatePendingTileGeometries(),this._allTilesCreated=!this.allTiles.some(e=>e.hasPendingUpdate(1)||e.hasPendingUpdate(4)&&0===e.unmergableChildCount),this._sortTiles(e)}_updateElevation(e){e.done||(this._allTiles.some(t=>(t.resetPendingUpdate(8)&&(this._updateTileGeometryState(t),e.madeProgress()),e.done)),!this._oneBatchPerFrameTask&&this._updatePendingTileGeometries())}_updateElevationSources(e){e.done||this._allTiles.some(t=>(t.needsElevationSourceUpdate()&&(t.updateAgents(0),t.markElevationSourceUpdateRequested(),e.madeProgress()),e.done))}_updateTextures(e){e.done||this._allTiles.some(t=>(this._updateTileTexture(t,e),e.done))}_updateClippingExtent(){this.spatialReference&&(this.updateOverlayParameters(),this.requestRender(1),this.overlayManager.setPlacementDirty(),this._updateRootTiles())}get _lodBias(){return this.view.qualitySettings.tiledSurface.lodBias-(1-this.view.quality)*ce}_getLodBiasCorrectedScale(e){const t=this.tilingScheme.levels,i=o(e-this._lodBias,0,t.length-1),r=i-Math.floor(i);return t[Math.floor(i)].scale*(1-r)+t[Math.ceil(i)].scale*r}_removeAllTiles(){this._pendingTilesToUpdate.clear(),this._pendingTilesForElevationUpdateEvent.clear(),null!=this._rootTiles&&(this._rootTiles.forEach(e=>this._purgeTile(e)),this._setRootTiles(null),this.notifyChange("ready")),this._allTiles.clear(),this.notifyChange("demResolution"),this.emit("tiles-changed",{allTiles:this.allTiles}),this.renderer.visible=!1}_purgeSubtree(e){const t=e.children;t[0]&&(this._purgeTile(t[0]),this._purgeTile(t[1]),this._purgeTile(t[2]),this._purgeTile(t[3]),e.clearChildren())}_purgeTile(e){e.leaf?dt(e):this._purgeSubtree(e),this._allTiles.removeUnordered(e),this._unloadTile(e),e.dispose(),this._tileCache.put(Ze._tileMemcacheKey,e),this.notifyChange("demResolution"),this.emit("tiles-changed",{allTiles:this.allTiles})}_unloadTile(e){this._pendingTilesToUpdate.delete(e),this._pendingTilesForElevationUpdateEvent.delete(e),e.unload()}_splitTile(e){_e(e.leaf,"Tile that is already split should not be split again!"),_e(e.rendered,"Tile marked to split is not rendered"),dt(e);const t=e.createChildren();this._allTiles.pushArray(t),this.notifyChange("demResolution"),this.emit("tiles-changed",{allTiles:this.allTiles}),e.updateAgentSuspension(),_e(e.rendered,"parent should be rendered"),t.forEach(e=>this._loadTile(e)),t.forEach(e=>this._pendingTilesToUpdate.add(e)),this._unloadTile(e),this._markAllTileNeighborsForUpdate(e),this._emitTileScaleChange(e,e.level+1),this._allTilesDirty=!0,this._shortBatches&&this._updatePendingTileGeometries(),t.forEach(e=>ot(e,e.hasPendingUpdate(1))),++this._performanceInfo.numSplit}_emitTileScaleChange(e,t=e.level){nt.spatialReference=this.spatialReference,nt.extent=e.extent,nt.scale=this._getLodBiasCorrectedScale(t),this.emit("scale-change",nt)}createTile(e,t,i,r){_e(!!r,"createTile sanity check");const s=this._acquireTile(e,t,i,r);return s.updateClippingStatus(this.groundExtent),s.updateScreenDepth(this.view.state.contentCamera.viewProjectionMatrix),this._shouldSplit(s)&&s.setPendingUpdate(1),s}get _shortBatches(){return 2!==this.view.state.mode}_mergeTile(e){_e(!e.hasPendingUpdate(1),"_mergeTile sanity check"),_e(!e.leaf,"Cannot merge a leaf"),e.leaf||(this._purgeSubtree(e),_e(!e.renderData,"Merging tile with existing render data?"),this._loadTile(e),this._markTileToUpdate(e),this._emitTileScaleChange(e),this._shortBatches&&this._updatePendingTileGeometries(),ot(e,!1),this._allTilesDirty=!0,++this._performanceInfo.numMerged)}_loadTile(e){e.load(),this.requestUpdate(),this._allTilesDirty=!0,this.overlayManager?.hasOverlays&&e.updateOverlayParameters(this.overlayManager)}_handleLayerViewChanges(e=Xe){if(!this._layerViewsDirty)return;this._layerViewsDirty=!1;let t=!1;const i=new Set;let r=-1;for(let s=this.view.allLayerViews.length-1;s>=0;s--){const e=this.view.allLayerViews.items[s];if(i.add(e.uid),we(e)||Se(e))if(this._basemapLayerViewHandles.has(e.uid)&&!Se(e)){const i=this._layerClassFromLayerView(e),s=this.getLayerIndexByUID(i,e.uid);null!=s&&((s<r||null==r)&&(t=!0),r=s)}else this._registerTiledLayerView(e),e.layer.loaded&&(t=!0)}this._basemapLayerViewHandles.forEach((e,r)=>{i.has(r)||(this._unregisterTiledLayerView(r),t=!0)}),t&&this._updateTiledLayers(),this.hasCompositeBlendMode=this._hasCompositeBlendMode(),this._evaluateTransparency(),e.madeProgress()}get _isFullyTransparent(){if(this.view.map?.ground?.opacity>0)return!1;for(const e of this.view.allLayerViews.items)if(Ce(e)&&!W(e.layer)&&0!==e.fullOpacity)return!1;return!0}_hasCompositeBlendMode(){for(const e of this.view.allLayerViews.items)if((be(e)||Se(e))&&He($e[e.layer.blendMode]))return!0;return!1}_layerClassFromLayerView(e){return Ee(e)?0:1}_registerTiledLayerView(e){const t=[];if((be(e)||Se(e))&&t.push(_(()=>e.layer.blendMode,()=>{this.hasCompositeBlendMode=this._hasCompositeBlendMode(),this._updateTileTextures(2)})),!Se(e)){const i=this._layerClassFromLayerView(e);t.push(_(()=>!e.destroyed&&e.suspended,()=>this._updateTiledLayers())),t.push(_(()=>!e.destroyed&&e.fullOpacity,()=>this._updateTileTextures(2)));const{layer:r}=e;"effectiveScaleRange"in r&&t.push(_(()=>!e.destroyed&&r.effectiveScaleRange,()=>this._restartAllAgents(i))),t.push(e.on("data-changed",()=>{const t=this.getLayerIndexByUID(i,e.uid);null!=t&&this._invalidateLayerData(t,i)}))}this._unregisterTiledLayerView(e.uid),this._basemapLayerViewHandles.set(e.uid,t)}_unregisterTiledLayerView(e){const t=this._basemapLayerViewHandles.get(e);if(t){for(const e of t)e.remove();this._basemapLayerViewHandles.delete(e)}}_updateTiledLayers(){if(!this.tilingScheme||this.view.suspended)return;const e=this.view.allLayerViews,t=[[],[]];let i=null;e.forEach(e=>{if(!e.layer||e.suspended||!we(e)||!e.fullExtent)return;const r=this._layerClassFromLayerView(e);if(1===r){const t=e.displayLevelRange.maxLevel;t!==1/0&&(null===i||t>i)&&(i=t)}t[r].push(e)});for(const r of ie){const e=this._layerViews[r],i=t[r];i.reverse();const s=i.length;let a=e.length!==s;const n=new Array(s),l=new Array(e.length);this._layerIndexByUid[r].clear();for(let t=0;t<s;t++){const s=i[t].uid;this._layerIndexByUid[r].set(s,t);const o=e.indexOf(i[t]);n[t]=o,t!==o&&(a=!0),o>-1&&(l[o]=t)}if(a){const e=this._postorderIterator;for(e.reset(this._rootTiles);!e.done;)e.next().modifyLayers(l,n,r);this._layerViews[r]=i,this._restartAllAgents(r),this._updateTilesVisibility(this._rootTiles)}}this.tilingScheme.ensureMaxLod(i)&&(this._viewChangeUpdate(),this.notifyChange("tilingScheme"))}_restartAllAgents(e){const t=this._postorderIterator;for(t.reset(this._rootTiles);!t.done;){const i=t.next();i.restartAgents(e),0===e&&i.computeElevationBounds()}this._updateRootTileElevationRange()}layerViewByIndex(e,t){return this._layerViews[t][e]}numLayers(e){return this._layerViews[e].length}_updateTileTextures(e){this._allTiles.forAll(t=>{t.updateAgents(1),1===e?this.renderer.updateTileTexture(t,16):t.updateRenderData(1,e)}),this._evaluateTransparency()}_invalidateLayerData(e,t){null!=this._rootTiles&&(Ne(this._rootTiles,i=>i.removeLayerAgent(e,t)),Ne(this._rootTiles,i=>{i.invalidateLayerData(e,t),i.restartAgents(t)}))}setTileTreeDirty(e){this._allTilesDirty=!0,e&&(this._allTilesCreated=!1)}requestRender(e=1){this.renderer.setNeedsRender(e)}requestUpdate(){1===++this._pendingUpdates&&(this._hasPendingUpdates=!0)}requestTileData(e,t,i,r){const s=this.layerViewByIndex(t,i),a=s.layer;return!a.tilemapCache||ye(s)?this._requestTileData(e,i,s,r):(++this._asyncWorkItems,a.tilemapCache.fetchAvailability(e.level,e.lij[1],e.lij[2],{...r,timeout:6e3}).catch(t=>{throw c(r),g(t)||this._dataMissing(e,i,s),t}).then(()=>this._frameTask.schedule(()=>this._requestTileData(e,i,s,r),r.signal)).finally(()=>--this._asyncWorkItems))}_requestTileData(e,t,i,r){if(this.destroying)return Promise.resolve();return 0===t?Ee(i)?this._requestElevationTileData(e,i,r):Promise.reject():Ce(i)?this._requestMapTileData(e,i,r):Promise.reject()}_requestElevationTileData(e,t,i){++this._asyncWorkItems;const r=r=>{!m(i)&&r&&(this.setMemoryDirty(),this.requestUpdate(),this._elevationDataArrived(e,t,r))},s=i=>{g(i)||(l.getLogger(this).error(`Tile ${e.lij.toString()} layer 0/${t.uid} error ${i}`),this._dataMissing(e,0,t),this.requestUpdate())};return t.fetchElevationTile(e,{...H,...i}).then(e=>this._frameTask.schedule(()=>r(e)),s).finally(()=>--this._asyncWorkItems)}_elevationDataArrived(e,t,i){const r=this._layerIndexByUid[0].get(t.uid);if(null==r)return void l.getLogger(this).warn("TerrainSurface: received data from unknown layer %d %s",0,e.lij.toString());const s=new Z(e.lij,e.extent,i);e.dataArrived(r,0,s),this.emit("tile-data-changed",{tile:e,layerIndex:r,layerClass:0});const a=[e],n=e.level,o=this._iteratorPool.acquire();for(o.reset(a);!o.done;){const e=o.next();e.findElevationBoundsForLayer(r,n),e.computeElevationBounds()}0===n&&this._updateRootTileElevationRange(),o.remove(),this._updateTilesVisibility(a)}_requestMapTileData(e,t,i){++this._asyncWorkItems;const r=(r,s)=>{xe(s),m(i)||(console.error(`Tile ${e.lij.toString()} layer 1/${t.uid} error ${r}`),this._dataMissing(e,1,t),this.requestUpdate())},s=e=>t=>r(t,e),a=r=>this._frameTask.schedule(()=>{this.requestUpdate(),m(i)?xe(r):this._mapTileDataArrived(e,t,r)},i.signal,s(r)).catch(s(r)),n=(e,t=null)=>this._frameTask.schedule(()=>r(e,t));return t.fetchTile(e.lij,i).then(a,n).finally(()=>--this._asyncWorkItems)}_mapTileDataArrived(e,t,i){const r=this.getLayerIndexByUID(1,t.uid);if(null==r)return xe(i),void l.getLogger(this).warn("TerrainSurface: received data from unknown layer");e.dataArrived(r,1,i),this.emit("tile-data-changed",{tile:e,layerIndex:r,layerClass:1})}_dataMissing(e,t,i){const r=this.getLayerIndexByUID(t,i.uid);null!=r?(e.dataMissing(r,t),this.emit("tile-data-changed",{tile:e,layerIndex:r,layerClass:t})):l.getLogger(this).warn("TerrainSurface: received data from unknown layer")}get performanceInfo(){const e=this._performanceInfo;return e.numNodes=this._allTiles.length,e.numLeaves=e.numVisible=e.numRendered=e.numLoadedPerLevel.length=e.numRenderedPerLevel.length=0,this._allTiles.forAll(t=>{t.leaf&&e.numLeaves++;const i=t.level;t.renderData&&(e.numLoadedPerLevel[i]=(e.numLoadedPerLevel[i]||0)+1),t.visible&&(e.numVisible++,t.rendered&&(e.numRenderedPerLevel[i]=(e.numRenderedPerLevel[i]||0)+1,e.numRendered++))}),e}setMemoryDirty(){this._usedMemory=null}get usedMemory(){return this.tilingScheme?(null==this._usedMemory&&(this._usedMemory=this._recalculateUsedMemory()),this._usedMemory??0):0}_recalculateUsedMemory(){return this.tilingScheme?Math.round(this._allTiles.reduce((e,t)=>e+t.usedMemory,0)):null}getUsedMemoryForLayerView(e){let t=0;const i=this._layerClassFromLayerView(e),r=this.getLayerIndexByUID(i,e.uid);return null!=r&&this._allTiles.forAll(e=>t+=e.getUsedMemoryForLayer(i,r)),t}get renderPatchBorders(){return this._renderer.renderPatchBorders}set renderPatchBorders(e){this._renderer.renderPatchBorders=e}get renderingDisabled(){return this._renderer.renderingDisabled}set renderingDisabled(e){this._renderer.renderingDisabled=e}get test(){}checkAllTilesWaterproofness(){if(!Pe)return;const e=this._rootTiles;if(null==e)return;const t=e=>e?.renderData?.geometry?.indices?.length>0,i=(e,i)=>{t(e)&&console.error("Tile[",e.lij,"] has geometry although parent[",i.lij,"] has geom")},r=e=>{if(e.intersectsClippingArea)if(e.renderData&&!e.renderData.geometryState&&console.error("Tile[",e.lij,"] has renderData but not geometryState"),e.renderData&&!e.renderData.geometry&&console.error("Tile[",e.lij,"] has renderData but not geometryInfo"),!e.renderData?.geometry||(e.renderData.geometry.indices?.length??0)>0||console.error("Tile[",e.lij,"] has renderData but no indices - geometryInfo: ",e.renderData.geometry),t(e)){e.checkGeometryWaterproofness();for(const t of e.children)i(t,e)}else if(e.leaf)console.error("Tile[",e.lij,"] has no geometry and no children, from root to leaf");else for(const t of e.children)r(t)},s=e=>{const t=e.parent?.visible??!0,i=e.visible;e.computeVisibility();const r=e.visible;if(i!==r&&t&&console.error(" Tile[",e.lij,"] has out of date visibility: ",i," instead of ",r),!e.leaf)for(const a of e.children)s(a)};for(const a of e)r(a),s(a)}get isGlobal(){return this._isGlobal}get isGeographic(){return this._isGeographic}get isWebMercator(){return this._isWebMercator}get isWebMercatorOnPlateCarree(){return this._isWebMercatorOnPlateCarree}isEastEndWrap(e){return this._isGlobal&&e[2]===this.lijEastEnd(e[0])-1}isWestEndWrap(e){return this._isGlobal&&0===e[2]}lijEastEnd(e){return 1<<e+(this._isGeographic?1:0)}wrapEastWest(e){const t=this.lijEastEnd(e[0]),i=e[2];if(0<=i&&i<t)return e;if(!this._isGlobal)return null;const r=(i+(i<0?t:0))%t;return[e[0],e[1],r]}enableInternalChecks(e){Re(e)}enableWaterproofnessChecks(e){Me(e)}static cleanupTerrainSurface(){at.prune()}enable(e){e!==this.enabled&&(this._set("enabled",e),e?(this._updateRootTiles(),this.suspended=!1,this.view.elevationProvider.register(0,this)):(this.view.elevationProvider.unregister(this),this.suspended=!0,this._removeAllTiles(),this._setRootTiles(null)),this.notifyChange("ready"))}updateOverlayParameters(){const{overlayManager:e}=this;this.allTiles.forAll(t=>t.updateOverlayParameters(e))}};e([w()],et.prototype,"_renderer",void 0),e([w({constructOnly:!0})],et.prototype,"_scaleRangeQueries",void 0),e([w({constructOnly:!0})],et.prototype,"view",void 0),e([w({constructOnly:!0})],et.prototype,"overlayManager",void 0),e([w({constructOnly:!0})],et.prototype,"terrainTextureCompressionTracker",void 0),e([w()],et.prototype,"_hasPendingUpdates",void 0),e([w()],et.prototype,"_asyncWorkItems",void 0),e([w()],et.prototype,"_allTilesDirty",void 0),e([w()],et.prototype,"_allTilesSorted",void 0),e([w()],et.prototype,"allTilesCreated",null),e([w()],et.prototype,"_allTilesCreated",void 0),e([w()],et.prototype,"_viewChanged",void 0),e([w({type:Number})],et.prototype,"heading",void 0),e([w()],et.prototype,"_splitLimits",void 0),e([w({readOnly:!0})],et.prototype,"_watchUpdatingTracking",void 0),e([w()],et.prototype,"_frameTask",void 0),e([w()],et.prototype,"demResolution",null),e([w({readOnly:!0})],et.prototype,"snapLevel",null),e([w({readOnly:!0})],et.prototype,"lodSnappingEnabled",null),e([w({readOnly:!0})],et.prototype,"userClippingExtent",null),e([w()],et.prototype,"_rootTilesExtent",void 0),e([w({readOnly:!0})],et.prototype,"groundExtent",null),e([w({readOnly:!0})],et.prototype,"fullGroundExtent",null),e([w({readOnly:!0})],et.prototype,"_tilingSchemeExtent",null),e([w({readOnly:!0})],et.prototype,"updating",null),e([w({readOnly:!0})],et.prototype,"readyToRun",null),e([w(K)],et.prototype,"updatingProgress",void 0),e([w({readOnly:!0})],et.prototype,"updatingProgressValue",null),e([w()],et.prototype,"_maxNumUpdating",void 0),e([w()],et.prototype,"baseOpacity",null),e([w()],et.prototype,"hasCompositeBlendMode",void 0),e([w({readOnly:!0})],et.prototype,"viewingMode",null),e([w()],et.prototype,"maxTextureScale",void 0),e([w({readOnly:!0})],et.prototype,"ready",null),e([w({readOnly:!0})],et.prototype,"rootTiles",null),e([w()],et.prototype,"_rootTiles",void 0),e([w({readOnly:!0})],et.prototype,"spatialReference",null),e([w({type:t})],et.prototype,"backgroundColor",null),e([w({value:!1})],et.prototype,"slicePlaneEnabled",null),e([w({readOnly:!0})],et.prototype,"tilingScheme",void 0),e([w({readOnly:!0})],et.prototype,"tilingSchemeLocked",null),e([w({readOnly:!0})],et.prototype,"tilingSchemeLogic",void 0),e([w()],et.prototype,"wireframe",null),e([w()],et.prototype,"opaque",null),e([w()],et.prototype,"invisible",null),e([w({value:!1})],et.prototype,"suspended",null),e([w()],et.prototype,"fadeDuration",null),e([w()],et.prototype,"_xNormalizer",null),e([w()],et.prototype,"visibleElevationRange",void 0),e([w()],et.prototype,"_rootTileElevationRange",void 0),e([w()],et.prototype,"_layerViewsDirty",void 0),e([w()],et.prototype,"renderPatchBorders",null),e([w()],et.prototype,"renderingDisabled",null),e([w({readOnly:!0})],et.prototype,"enabled",void 0),et=Ze=e([S("esri.views.3d.terrain.TerrainSurface")],et);const tt=et,it=x(),rt=new N,st=I(),at=new u,nt={spatialReference:null,extent:null,scale:0};function lt(e,t,i){for(const r of e){if(!r.containsPointXY(t,i))continue;let e=r;for(;e&&!e.renderData;){const r=(t>e.extentMidX?1:0)+(i<e.extentMidY?2:0);e=e.children[r]}const s=e?.renderData?.geometryState.samplerData??null;return ee(t,i,s)}return null}function ot(e,t){!e.leaf||e.level<ue||ut(e,e=>{t&&ht(e);const i=pt(e);if(e.maxLevelDeltaNeighborCount++,i){let t=e.parent;for(;t;){const e=pt(t);if(t.unmergableChildCount++,!e)break;t=t.parent}}})}function ht(e){if(e.hasPendingUpdate(1))return;let t=e.parent;for(;t?.resetPendingUpdate(4);)t=t.parent;e.resetPendingUpdate(4),e.leaf&&e.setPendingUpdate(1),e.level<ue||ut(e,e=>{ht(e)})}function dt(e){e.level<ue||ut(e,e=>{if(e.maxLevelDeltaNeighborCount--,0===e.maxLevelDeltaNeighborCount&&0===e.unmergableChildCount){let t=e.parent;for(;t&&(t.unmergableChildCount--,pt(t));)t=t.parent}})}function pt(e){return 0===e.maxLevelDeltaNeighborCount&&0===e.unmergableChildCount}function ut(e,t){if(e.level<ue)return;const i=e.level-ue,r=e.lij[1]>>ue,s=e.lij[2]>>ue,a=e=>e.leaf||e.level===i;for(let n=0;n<4;++n){const l=e.findNeighborTile(fe[n],a);if(!l||l.level!==i)continue;const o=l.lij;o[1]===r&&o[2]===s||t(l)}}export{tt as default};
2
+ import{__decorate as e}from"tslib";import t from"../../../Color.js";import{filterInPlace as i,difference as r}from"../../../core/arrayUtils.js";import s from"../../../core/CollectionFlattener.js";import{toConst as a}from"../../../core/compilerUtils.js";import{EventedAccessor as n}from"../../../core/Evented.js";import"../../../core/has.js";import l from"../../../core/Logger.js";import{clamp as o}from"../../../core/mathUtils.js";import{removeMaybe as h,destroyMaybe as d}from"../../../core/maybe.js";import{MemCachePool as p}from"../../../core/MemCachePool.js";import u from"../../../core/ObjectPool.js";import c from"../../../core/PooledArray.js";import{throwIfAborted as g,isAbortError as m,isAborted as _}from"../../../core/promiseUtils.js";import{watch as f,syncAndInitial as y,initial as T,sync as v}from"../../../core/reactiveUtils.js";import{getMetersPerUnitForSR as w}from"../../../core/units.js";import{property as S,subclass as C}from"../../../core/accessorSupport/decorators.js";import{exactEquals as b,set as E,copy as x}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{create as U}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{UpdatingHandles as L}from"../../../core/support/UpdatingHandles.js";import{getReferenceEllipsoid as P,radiusModifier as R}from"../../../geometry/ellipsoidUtils.js";import M from"../../../geometry/SpatialReference.js";import{getProjector as D}from"../../../geometry/projection/projectors.js";import{projectPointToVector as j}from"../../../geometry/projection/projectPointToVector.js";import{projectVectorToVector as I}from"../../../geometry/projection/projectVectorToVector.js";import{create as V,equals as A,intersection as k,intersectsSphere as B}from"../../../geometry/support/aaBoundingRect.js";import{copy as G,create as O}from"../../../geometry/support/frustum.js";import{createSpatialReferenceCyclical as q}from"../../../geometry/support/normalizeUtils.js";import{isPlateCarree as N}from"../../../geometry/support/spatialReferenceUtils.js";import{Sphere as F}from"../../../geometry/support/sphere.js";import{ElevationQueryTileCache as W}from"../../../layers/support/ElevationQueryTileCache.js";import{isBaseLayer as H}from"../../../layers/support/layerUtils.js";import{queueHighPriority as $}from"../../../request/queue.js";import{debugFlags as Q}from"../support/debugFlags.js";import{ElevationRange as z}from"../support/ElevationRange.js";import{ElevationUpdateEvent as Y}from"../support/ElevationUpdateEvent.js";import{calculateElevationUpdateExtents as X}from"../support/elevationUpdateExtentUtils.js";import{toBoundingRect as K}from"../support/extentUtils.js";import{updatingProgress as J}from"../support/updatingProperties.js";import{ElevationBounds as Z}from"./ElevationBounds.js";import{ElevationData as ee,sampleElevation as te}from"./ElevationData.js";import{create as ie}from"./ExtentHelper.js";import{LayerClasses as re}from"./LayerClass.js";import{OverlayManager as se}from"./OverlayManager.js";import{PlanarPatch as ae}from"./PlanarPatch.js";import{Queue as ne}from"./Queue.js";import{ScaleRangeQueries as le}from"./ScaleRangeQueries.js";import{SphericalPatch as oe}from"./SphericalPatch.js";import{SplitLimits as he}from"./SplitLimits.js";import{maxRootTiles as de,tooManyRootTilesAfterChangeError as pe,tooManyRootTilesForLayerError as ue,maxTileNeighborLevelDelta as ce,maxMemoryLodBias as ge}from"./TerrainConst.js";import{TerrainRenderer as me}from"./TerrainRenderer.js";import _e from"./TerrainSurfacePerformanceInfo.js";import{weakAssert as fe,isVectorTileLayerView as ye,neighborEdgeIndices as Te,internalAssert as ve,oppositeEdge as we,isSurfaceLayerView as Se,isGroupLayerView as Ce,isMapTileLayerView as be,isBlendableLayerView as Ee,isElevationLayerView as xe,releaseTerrainData as Ue,enableTerrainInternalChecks as Le,oppositeCorner as Pe,enableWaterproofTests as Re,enableInternalTerrainChecks as Me,enableTerrainWaterproofChecks as De,neighborCornerIndices as je}from"./terrainUtils.js";import{Tile as Ie,lijEquals as Ve}from"./Tile.js";import{printAllocations as Ae}from"./TilePerLayerInfo.js";import{sortTiles as ke,IteratorPreorder as Be,IteratorPostorder as Ge,compareTilesByLij as Oe,hasLoadableSiblings as qe,sortTilesByPOI as Ne,traverseTilesPreorder as Fe}from"./tileUtils.js";import{TilingSchemeLogic as We}from"./TilingSchemeLogic.js";import{UpsampleInfo as He}from"./UpsampleInfo.js";import{isCompositeBlendMode as $e,blendModeFromString as Qe}from"../webgl-engine/core/shaderLibrary/output/BlendOptions.js";import{hasLayerBasedScaleVisibility as ze}from"../../support/layerViewUtils.js";import{ImmediateTask as Ye,TaskPriority as Xe,noBudget as Ke}from"../../support/Scheduler.js";import{TextureCompressionTracker as Je}from"../../support/TextureCompressionTracker.js";import{Yield as Ze}from"../../support/Yield.js";var et;let tt=class extends n{static{et=this}get allTilesCreated(){return this._allTilesCreated}get allTiles(){return a(this._allTiles)}get renderedTiles(){return ke(i(this._allTiles.toArray(),e=>e.visible&&e.rendered))}get demResolution(){const{_allTiles:e,tilingScheme:t}=this;if(0===e.length)return{min:1,max:1};const i=w(t.spatialReference);let r=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY;for(const a of e){const e=t.resolutionAtLevel(a.level)*i;r=Math.min(r,e),s=Math.max(s,e)}return{min:r,max:s}}constructor(e){super(e),this.terrainTextureCompressionTracker=new Je,this._iteratorPool=new u(()=>new Be,e=>e.remove=()=>this._iteratorPool.release(e)),this._postorderIterator=new Ge,this._hasPendingUpdates=!1,this._pendingUpdates=0,this._asyncWorkItems=0,this._allTilesDirty=!0,this._allTilesSorted=!0,this._allTilesCreated=!1,this._usedMemory=null,this._performanceInfo=new _e,this._viewChanged=!1,this.heading=0,this._inFrameTask=!1,this._viewChangeUpdateDirty=!1,this._eyePosRenderSR=U(),this._eyePosSurfaceSR=U(),this._splitLimits=new he,this._layerViews=[new Array,new Array],this._layerIndexByUid=[new Map,new Map],this._basemapLayerViewHandles=new Map,this._updatingHandles=new L,this._poiWatchHandle=null,this._frameTask=Ye,this._allTiles=new c,this._upsampleInfoPool=new u(()=>new He),this._shouldEmitChangeEvent=!1,this._rootTilesExtent=V(),this.updatingProgress=.5,this._maxNumUpdating=1,this.maxTextureScale=1.2,this._spatialReference=M.WebMercator,this._elevationProjectorCache=new Map,this.visibleElevationRange=new z(1/0,-1/0),this._rootTileElevationRange=new z(1/0,-1/0),this._projectorCache=new Map,this._tilingSchemeSpatialReference=null,this._updatingRootTiles=!1,this._pendingTilesForElevationUpdateEvent=new Set,this._pendingTilesToUpdate=new Set,this.totalGeometryUpdates=0,this.totalTileUpdates=0,this._oneBatchPerFrameTask=!0,this._layerViewsDirty=!1,this.unloadedMemory=0,this.ignoresMemoryFactor=!1,this._isWebMercator=!1,this._isWebMercatorOnPlateCarree=!1,this.enabled=!0;const{view:t}=e;this.overlayManager=new se({...e,terrainSurface:this}),this._isGlobal=!t.state?.isLocal,this._isGeographic=this._spatialReference?.isGeographic??!1,this._tileConstructor=this._isGlobal?oe:ae,this._ellipsoid=P(t.spatialReference),this._renderer=new me(this.overlayManager.renderer,t.stage,this._allTiles,this.terrainTextureCompressionTracker,t.resourceController.memoryController),ze()||(this._scaleRangeQueries=new le)}initialize(){const{view:e}=this,{resourceController:t}=e,{memoryController:i}=t;this._tileCache=new p((e,t)=>i.newCache(e,t),"terrain-tile"),this._upsampleMapCache=i.newCache("terrain-upsample",({tile:e})=>e.unloadMapData()),this._elevationQueryCache=new W(i.newCache("elevation-query"));const r=this.overlayManager;this.addHandles([f(()=>r.renderer.isEmpty,()=>this._evaluateTransparency()),f(()=>this.renderer.visible,e=>this.suspended=!e),f(()=>this.heading,e=>{this._renderer.updateHeading(e),this._updateTileTextures(0)},y)],"overlayManager"),this._updatingHandles.add(()=>({heading:e.camera?.heading,state:e.state?.mode}),({heading:e,state:t})=>{if(null==e)return;if(this.isGlobal&&this.isGeographic||this.isWebMercatorOnPlateCarree)return void(this.heading=90*Math.round(e/90)%360);const i=Math.round(e)%360,r=Math.abs(i-this.heading);(2===t||Math.min(r,360-r)>=30)&&(this.heading=i)},T),this.addHandles([f(()=>this.baseOpacity,()=>{this._handleLayerViewChanges(),this._updateTileTextures(this._evaluateTransparency()?1:2)},y),f(()=>this.hasCompositeBlendMode,()=>this._updateTileTextures(this._evaluateTransparency()?1:2),y),f(()=>this.backgroundColor,(e,t)=>{e?.equals(t)||(this._handleLayerViewChanges(),this._renderer.updateTileBackground(e))},v),f(()=>this.snapLevel,()=>this._viewChanged=!0,v),f(()=>this.view.pointsOfInterest,e=>{this._renderer.pointsOfInterest=e,this._poiWatchHandle=h(this._poiWatchHandle),e&&(this._poiWatchHandle=this._updatingHandles.add(()=>e.focus?.renderLocation,()=>this._allTilesSorted=!1,{equals:b}))}),f(()=>Q.TERRAIN_TILE_TREE_SHOW_TILES,t=>{t&&!this._treeDebugger?import("../layers/support/TerrainTileTree3DDebugger.js").then(({TerrainTileTree3DDebugger:t})=>{!this._treeDebugger&&Q.TERRAIN_TILE_TREE_SHOW_TILES&&(this._treeDebugger=new t({view:e}))}):t||(this._treeDebugger=d(this._treeDebugger))},T)]);const{spatialReference:a}=e;this._extentHelper=ie(this.viewingMode,{layers:e.map.allLayers,layerViews:e.allLayerViews,viewSpatialReference:a});const n=new s({getCollections:()=>e.defaultsFromMap?.mapCollections?.map(({layers:e})=>e),getChildrenFunction:e=>e&&"layers"in e?e.layers:null}),l=new We({layers:n,extentHelper:this._extentHelper,viewingMode:this.viewingMode,viewSpatialReference:a});this._set("tilingSchemeLogic",l),this._updateTilingScheme();const o=t.scheduler;this._frameTask=o.registerTask(Xe.TERRAIN_SURFACE,this),this.addHandles([f(()=>this._extentHelper.stencilEnabledExtents,e=>this._renderer.setStencilEnabledLayerExtents(e),T),f(()=>this.tilingSchemeLogic.tilingScheme,()=>this._updateTilingScheme(),v),f(()=>this.groundExtent,()=>this._updateRootTiles(),T),e.on("resize",()=>this._viewChangeUpdate()),f(()=>{const t=e.state;return[this._lodBias,this.lodSnappingEnabled,e.quality,t.camera,t.contentCamera,t.fixedContentCamera]},()=>this._viewChangeUpdate(),y),f(()=>e.qualitySettings?.fadeDuration,e=>this._renderer.textureFadingEnabled=e>0,T),f(()=>e.qualitySettings?.physicallyBasedRenderingEnabled,e=>this._renderer.pbrMode=e?5:0,T),f(()=>e.qualitySettings?.tiledSurface.elevationLevelDelta,()=>this._updateAllTileGeometries()),f(()=>this.userClippingExtent,()=>this._updateClippingExtent(),v)]),this.addHandles(e.allLayerViews.on("after-changes",()=>this._layerViewsDirty=!0)),this._layerViewsDirty=!0,this._handleLayerViewChanges(),this._renderer.updateTileBackground(this.backgroundColor)}clearHandles(){this._updatingHandles?.removeAll(),this.removeAllHandles(),this._basemapLayerViewHandles.forEach((e,t)=>this._unregisterTiledLayerView(t)),this._basemapLayerViewHandles.clear()}destroy(){this._frameTask.remove(),this._frameTask=Ye,this._updatingHandles?.destroy(),this._removeAllTiles(),this._set("tilingSchemeLogic",d(this.tilingSchemeLogic)),this._basemapLayerViewHandles.forEach((e,t)=>this._unregisterTiledLayerView(t)),this._basemapLayerViewHandles.clear(),this._set("overlayManager",d(this.overlayManager)),this._tileCache=d(this._tileCache),this._allTiles.prune(),Ie.prune(),this._treeDebugger=d(this._treeDebugger),this._renderer.destroyed||this._renderer.destroy(),this._renderer=null,this._iteratorPool=d(this._iteratorPool),this._upsampleMapCache=d(this._upsampleMapCache),this._elevationQueryCache=d(this._elevationQueryCache),this._set("view",null),this._extentHelper=d(this._extentHelper),this._upsampleInfoPool=d(this._upsampleInfoPool),Ae(),this._layerViews.forEach(e=>e.length=0),this._performanceInfo=null}get renderer(){return this._renderer}get frustum(){return this.view.state.camera.frustum}get snapLevel(){return this.lodSnappingEnabled?this.view.terrainLevel:null}get lodSnappingEnabled(){return this.view.qualitySettings.tiledSurface.reduceTileLevelDifferences}get upsampleInfoPool(){return this._upsampleInfoPool}get upsampleMapCache(){return this._upsampleMapCache}get elevationQueryCache(){return this._elevationQueryCache}get hasStencilEnabledExtents(){return this._extentHelper.stencilEnabledExtents.length>0}get userClippingExtent(){const{spatialReference:e}=this,t=this.view?.clippingArea;if(null==t||null==e)return null;const i=V(),r=K(t,i,e)?i:null,s=this._get("userClippingExtent");return A(r,s)?s:r}get rootTilesExtent(){return this._rootTilesExtent}get groundExtent(){const e=k(this.fullGroundExtent,this.userClippingExtent,V()),t=this._get("groundExtent");return A(e,t)?t:e}get fullGroundExtent(){return null!=this._tilingSchemeExtent?this._tilingSchemeExtent:this._rootTilesExtent}get _tilingSchemeExtent(){return this.tilingSchemeLogic?.extent}get updating(){return this._hasPendingUpdates||(this._maxNumUpdating=1),this.enabled&&!!((this.readyToRun||this._updatingHandles?.updating||this._asyncWorkItems>0)&&this.ready&&!this.suspended||this.overlayManager?.updating||this.terrainTextureCompressionTracker.compressing)}get readyToRun(){return this.enabled&&(this._hasPendingUpdates||this._viewChanged||this._allTilesDirty||!this._allTilesSorted||this._hasElevationSourceUpdates||this._layerViewsDirty||this._scaleRangeQueries?.updating||this._frameTask.updating)&&this.ready&&!this.suspended}get _hasElevationSourceUpdates(){return this._allTiles.some(e=>e.needsElevationSourceUpdate())}get updatingProgressValue(){return this._maxNumUpdating=Math.max(this._pendingUpdates,this._maxNumUpdating),1-this._pendingUpdates/this._maxNumUpdating}get baseOpacity(){return this.view?.map?.ground?.opacity??1}set baseOpacity(e){this.view.map.ground.opacity=e}get viewingMode(){return this.view.state.viewingMode}get ready(){return!this.enabled||null!=this._rootTiles}get rootTiles(){return this._rootTiles}get spatialReference(){return this.tilingScheme?.spatialReference??null}get backgroundColor(){return this.view?.map?.ground?.surfaceColor}set backgroundColor(e){this.view.map.ground.surfaceColor=e}set slicePlaneEnabled(e){this._renderer.slicePlaneEnabled=e,this._set("slicePlaneEnabled",e),this._evaluateTransparency()}get tilingSchemeLocked(){return this.tilingSchemeLogic?.tilingSchemeLocked??!1}get wireframe(){return this._renderer?.wireframe}set wireframe(e){e!==this._renderer.wireframe&&(this._renderer.wireframe=e,this._updateAllTileGeometries())}get opaque(){return 0===this._renderer.transparency}get invisible(){return 3===this._renderer.transparency}set suspended(e){this._set("suspended",e),this._viewChangeUpdate()}get fadeDuration(){return this.view.qualitySettings.fadeDuration??0}intersect(e,t,i,r){this._renderer.intersectRay(e,t,i,r)}getElevationLevelDelta(e){return e<4?3:this.view.qualitySettings.tiledSurface.elevationLevelDelta}get _xNormalizer(){return q(this._spatialReference)}getElevation(e,t,i,r){const s=this._rootTiles;if(!s?.length||!this.enabled)return null;if(0===s[0].layerInfo[0].length)return null;let a=this._elevationProjectorCache.get(r);if(void 0===a&&(a=D(r,this._spatialReference)??null,this._elevationProjectorCache.set(r,a)),null==a)return l.getLogger(this).error("TerrainSurface.getElevation(): could not project given point to tiling scheme coordinate system"),null;const n=E(rt,e,t,i);a(n,0,n,0);return ot(s,this._xNormalizer?.normalize(n[0])??n[0],n[1])}getElevations(e,t,i){const r=this._rootTiles,s=r?r[0].layerInfo[0].length:0;if(r?.length&&0!==s&&this.enabled)for(let a=0;a<t;++a){const t=3*a;i(a,ot(r,e[t],e[t+1]))}else for(let a=0;a<t;++a)i(a,null)}getLayerIndexByUID(e,t){return this._layerIndexByUid[e].get(t)}getScale(e){if(!this.tilingScheme)return null;if(!j(e,rt,this.spatialReference))return l.getLogger(this).error("TerrainSurface.getScale(): could not project given point to tiling scheme coordinate system"),null;const t=this._rootTiles;if(null!=t)for(const i of t)if(i?.containsPoint(rt)){let e=i;for(;e.children[0]&&!e.rendered;){const t=e.children[0].extent;let i=0;rt[0]>t[2]&&(i+=1),rt[1]<t[1]&&(i+=2),e=e.children[i]}return this._getLodBiasCorrectedScale(e.level)}return 1/0}_ensureProjector(e){const t=this._projectorCache.get(e);if(t)return t;const i=D(e,this._tilingSchemeSpatialReference)??null;return this._projectorCache.set(e,i),i}getSphereElevationRange(e,t){if(!this.enabled||null==this._rootTiles)return null;const i=this._ensureProjector(t);if(null==i)return l.getLogger(this).error("TerrainSurface.getSphereElevationRange(): could not project given point to tiling scheme coordinate system"),null;st.copyFrom(e),i(st.center,0,st.center,0);const r=new z,s=this._rootTiles;if(null!=s){const e=[];for(const i of s)e.push(i);let t=0;for(;t<e.length;){const i=e[t];if(++t,!B(i.extent,st))continue;const s=i.children;if(null==s[0]||i.rendered)r.expandElevationRangeValues(i.elevationBoundsMin,i.elevationBoundsMax);else for(const t of s)e.push(t)}}return r}getRootElevationRange(){return this.enabled&&null!=this._rootTiles?new z(this._rootTileElevationRange.minElevation,this._rootTileElevationRange.maxElevation):null}getLowerBoundRadius(){const e=(this._ellipsoid.radius+this.visibleElevationRange.minElevation)*R;return Math.min(e,this._ellipsoid.radius)}getSphereScale(e,t){if(!this.tilingScheme)return null;if(!j(e,st.center,this.spatialReference))return l.getLogger(this).error("TerrainSurface.getSphereScale(): could not project given point to tiling scheme coordinate system"),null;st.radius=t;let i=null;const r=e=>{if(e&&B(e.extent,st)){const t=e.children;if(t[0]&&!e.rendered)for(const e of t)r(e);else{const t=this._getLodBiasCorrectedScale(e.level);i=null==i?t:Math.min(i,t)}}},s=this._rootTiles;if(null!=s)for(const a of s)r(a);return i}queryVisibleScaleRange(e,t,i,r){if(!this._scaleRangeQueries)return;const s=t?this.tilingScheme.levelAtScale(t):0,a=i?this.tilingScheme.levelAtScale(i):1/0,n=this._lodBias;this._scaleRangeQueries.queryVisibleLevelRange(e,s+n,a+n,r)}_evaluateTransparency(){const e=this.baseOpacity,t=this.overlayManager.renderer.isEmpty,i=this._renderer.transparency,r=this._isFullyTransparent?t?3:2:e>=1&&!this.hasCompositeBlendMode&&!this._renderer.slicePlaneEnabled?0:1;return this._renderer.transparency=r,i!==r&&(this.notifyChange("opaque"),this.notifyChange("invisible"),!0)}_updateTilingScheme(){const{tilingScheme:e}=this.tilingSchemeLogic;if(!(e!==this.tilingScheme))return;fe(!!e,"tiling scheme cannot be reset to undefined"),this._isGlobal=!this.view?.state?.isLocal,this.tilingScheme&&this._removeAllTiles();const t=e?.spatialReference??M.WebMercator;this._spatialReference=t,this._isWebMercator=!!t?.isWebMercator,this._isWebMercatorOnPlateCarree=this._isWebMercator&&N(this.view?.renderSpatialReference),this._isGeographic=t?.isGeographic??!1,this._set("tilingScheme",e),this._tilingSchemeSpatialReference=this.tilingScheme?.spatialReference,this._projectorCache.clear(),this._updateClippingExtent(),e&&(this._updateTiledLayers(),this._renderer.tileSize=e.pixelSize,this.overlayManager.spatialReference=e.spatialReference,this._updateRootTiles())}static{this._tileMemcacheKey="TerrainTileMemcache"}_acquireTile(e,t,i,r){const s=this._tileCache.pop(et._tileMemcacheKey);return s?(s.init(e,t,i,r,this),s):new this._tileConstructor(e,t,i,r,this)}get updatingRootTiles(){return this._updatingRootTiles}_updateRootTiles(){const{groundExtent:e,tilingScheme:t}=this;if(!t)return;if(!this.enabled)return void this._setRootTiles(null);const i=at;let s=t.rootTilesInExtent(e,i,5*de);if(null!=this._rootTiles){if(s.length>de)return void l.getLogger(this).warn(pe);const e=this._rootTiles.map(e=>e.lij),t=r(e,s,Ve);if(this._updatingRootTiles=!0,t.removed.length>0||t.added.length>0){const e=this._rootTiles.filter(e=>!(t.removed.findIndex(t=>Ve(t,e.lij))>-1)||(this._purgeTile(e),!1));t.added.forEach(t=>e.push(this._newRootTile(t))),this._setRootTiles(e)}}else this._updatingRootTiles=!0,s.length>de&&(l.getLogger(this).warn(ue),s=t.rootTilesInExtent(e,i,de)),this._setRootTiles(s.map(e=>this._newRootTile(e)));A(i,this._rootTilesExtent)||(this._rootTilesExtent=V(i)),this.renderer.visible=!0,this._viewChangeUpdate(),this.overlayManager.setPlacementDirty(),this.notifyChange("ready"),this._updateAllTileGeometries(),this._updatingRootTiles=!1,this.checkAllTilesWaterproofness()}_updateAllTileGeometries(){const e=this._allTiles.filter(e=>this._canUpdateTileGeometry(e));0!==e.length?(e.sort(Oe),e.forEach(e=>this._renderer.updateTileGeometryState(e)),e.forEach(e=>e.renderData.updateNeighborData()),this._updateTilesGeometries(e),this._pendingTilesToUpdate.clear()):this._pendingTilesToUpdate.clear()}_updateTilesGeometries(e){const t=e.filter(e=>this._canUpdateTileGeometry(e));if(0===t.length)return;const i=this.renderer;for(const r of t)i.updateGeometryIfNeeded(r);for(const r of t)this._pendingTilesForElevationUpdateEvent.add(r)}_canUpdateTileGeometry(e){return e.loaded&&e.intersectsClippingArea&&e.hasGeometryState}_shouldSplit(e){return 1===e.shouldSplit(this._splitLimits,this._eyePosRenderSR,this.snapLevel)}_newRootTile(e){const t=this._acquireTile(0,e[1],e[2],null);return this._shouldSplit(t)&&t.setPendingUpdate(1),this._loadTile(t),this._markTileToUpdate(t),this._updateRootTileElevationRange(),t}_setRootTiles(e){if(this._rootTiles=e,this._allTiles.clear(),null!=e){const t=this._iteratorPool.acquire();for(t.reset(e);!t.done;)this._allTiles.push(t.next());t.remove()}this._renderer.setRootTiles(this._rootTiles),this._updateTilesVisibility(e),this.notifyChange("demResolution"),this.emit("tiles-changed",{allTiles:this.allTiles})}_runViewChangeUpdateIfDirty(){this._viewChangeUpdateDirty&&(this._viewChangeUpdateDirty=!1,this._viewChangeUpdate())}_viewChangeUpdate(){this.view&&!this.suspended&&this.tilingScheme&&this.renderer.visible&&(this._inFrameTask?this._viewChangeUpdateDirty=!0:(this._viewChangeUpdateDirty=!1,this._updateViewDependentParameters(),this._updateTilesVisibility(this._rootTiles)))}_updateClippingStatus(e){e.updateClippingStatus(this.groundExtent)&&e.resetPendingUpdate(8)&&this._updateTileGeometryState(e)}_updateTilesVisibility(e){if(null==e)return;const t=qe(e),i=this.visibleElevationRange;let r=t?i.minElevation:1/0,s=t?i.maxElevation:-1/0;const a=this.groundExtent,n=this.view.state.contentCamera.viewProjectionMatrix;this.setTileTreeDirty(!1);const l=this._iteratorPool.acquire();for(l.reset(e);!l.done;){const e=l.next();e.updateClippingStatus(a)&&e.resetPendingUpdate(8)&&this._updateTileGeometryState(e),e.computeVisibility(),e.updateScreenDepth(n),e.renderData&&(r=Math.min(e.elevationBoundsMin,r),s=Math.max(e.elevationBoundsMax,s))}l.remove(),this._viewChanged=!0,this._allTilesDirty=!0,this._updatePendingTileGeometries(),isFinite(r)&&isFinite(s)&&(i.minElevation!==r||i.maxElevation!==s)&&(this.visibleElevationRange=new Z(r,s))}_updateRootTileElevationRange(){let e=1/0,t=-1/0;const i=this._rootTiles;null!=i&&i.forEach(({elevationBoundsMin:i,elevationBoundsMax:r})=>{e=Math.min(e,i),t=Math.max(t,r)});const r=this._rootTileElevationRange;r.minElevation===e&&r.maxElevation===t||(this._rootTileElevationRange=new Z(e,t))}_updateViewDependentParameters(){const{camera:e,contentCamera:t}=this.view.state,i=Math.tan(.5*t.fovX),r=Math.tan(.5*t.fovY),s=this.tilingScheme.pixelSize,a=2**-this._lodBias*e.pixelRatio;this._splitLimits.aboveGround=e.aboveGround,this._splitLimits.fovX=i,this._splitLimits.fovY=r,this._splitLimits.relativeWidthLimit=s/e.width*this.maxTextureScale*a,this._splitLimits.relativeHeightLimit=s/e.height*this.maxTextureScale*a,this._splitLimits.maxLod=this.tilingScheme.getMaxLod(),this._splitLimits.angledSplitBias=this.view.qualitySettings.tiledSurface.angledSplitBias,this.view.state.fixedContentCamera?this._splitLimits.frustum=G(this._splitLimits.frustum??O(),t.frustum):this._splitLimits.frustum=null,x(this._eyePosRenderSR,t.eye),I(e.eye,this.view.renderSpatialReference,this._eyePosSurfaceSR,this.spatialReference)}_updateTileGeometryState(e){e.updateVisibility();const t=this._renderer.updateTileGeometryState(e);e.needsElevationSourceUpdate()&&(e.updateAgents(0),e.markElevationSourceUpdateRequested(),this.requestUpdate()),t&&this._markTileToUpdate(e),this.setMemoryDirty()}_markAllTileNeighborsForUpdate(e){e.forEachLoadedNeighbor(e=>{this._layerViews[1].some(ye)&&e.setPendingUpdate(32),this._pendingTilesToUpdate.add(e)})}_updateTileTexture(e,t){const i=e.resetPendingUpdate(32)?32:!!e.resetPendingUpdate(16)&&16;i&&(this._renderer.updateTileTexture(e,i),this._usedMemory=null,t.madeProgress())}_emitElevationUpdateEventForTiles(){if(!this._shouldEmitChangeEvent)return;const e=this._pendingTilesForElevationUpdateEvent;if(e.size>0){const t=new Float64Array(4*e.size);let i=0;for(const r of e)t.set(r.extent,4*i),++i;e.clear();for(const e of X(t,this.spatialReference)){const t=new Y(this.spatialReference,e,"ground");this.emit("elevation-change",t)}}this._shouldEmitChangeEvent=!1}runTask(e){this._handleLayerViewChanges(e),this._frameTask.processQueue(e),this.renderer.processScaleRangeQueries(this._scaleRangeQueries,e),this._inFrameTask=!0,this._pendingUpdates=0,this._hasPendingUpdates=!1,this._updateAllTilesStatus(e),this._sortTiles(e);const t=!this.view.state.fixedContentCamera;this._mergeAndSplit(e,t),this._updateElevation(e),this._updateElevationSources(e),this._updateTextures(e),t||this._mergeAndSplit(e,!0),this._inFrameTask=!1,this._runViewChangeUpdateIfDirty();const i=this._pendingTilesToUpdate.size>0,r=i&&this._hasPendingGeometryWithoutIndices();if(e.done&&!r||this._updatePendingTileGeometries(),this._emitElevationUpdateEventForTiles(),e.done&&(e.hasProgressed||i&&!r)&&this.requestUpdate(),this.notifyChange("updatingProgressValue"),Le&&this._checkTileInvariant(),!e.hasProgressed)return Ze}_checkTileInvariant(){const e=new Map;this._allTiles.forAll(t=>e.set(t,new Set)),this._allTiles.forAll(t=>{if(fe(t.rendered===t.leaf,` rendered ${t.rendered} != ${t.leaf} leaf`),!t.leaf){const e=e=>0===e.unmergableChildCount&&0===e.maxLevelDeltaNeighborCount,i=t.children.reduce((t,i)=>t+(e(i)?0:1),0);if(fe(t.unmergableChildCount===i,` Tile[${t.lij.toString()}] unmergeable child count mismatch: actual ${t.unmergableChildCount} vs ${i}`),t.hasPendingUpdate(4)){fe(!t.hasPendingUpdate(1),"Tile can be both split and merge at the same time");for(const e of t.children)fe(e.leaf||e.hasPendingUpdate(4),"Child of tile to merge must also merge")}}for(let i=0;i<4;++i){if(t.rendered){const e=t.renderData?.geometryState.edgePeerNeighbors[i];if(null!=e){{const r=t.level-e.level<=ce;r||(console.log(`tile level delta [${t.lij.toString()}] vs [${e.lij.toString()}] > ${ce} (edge[${i}])`),fe(r,`tile level delta [${t.level}] vs [${e.level}] > ${ce}`))}fe(t.level-e.level<=ce,`Max tile lod delta exceeded: [${t.lij.toString()}] vs [${e.lij.toString()}]`)}}const r=t.level-ce,s=e=>e.leaf||e.level===t.level,a=t.findNeighborTile(Te[i],s);if(null!=a){if(t.leaf&&t.level>=ce){let i=a;for(;t.level-i.level<ce;)i=i.parent;const s=[r,t.lij[1]>>ce,t.lij[2]>>ce];if(!Ve(s,i.lij)){const r=e.get(i);fe(!r.has(t),"Cannot already have neighbor"),r.add(t)}}fe(a.rendered||a.level===t.level,"Non-same-level-neighbor of rendered must be rendered"),fe(t.level-a.level<=ce,`Tile level delta [${t.level}] vs [${a.level}] > ${ce}`)}}}),this._allTiles.forAll(t=>{const i=t.maxLevelDeltaNeighborCount,r=e.get(t);fe(i===r.size,`Tile[${t.lij.toString()}] merge-blocker mismatch: actual ${i} vs ${r.size}`)})}_updateAllTilesStatus(e){if(!this._viewChanged||!this._rootTiles||e.done)return;this._viewChanged=!1;let t=!1;const i=new ne(this._allTiles.length);i.pushAll(this._rootTiles);const r=this.snapLevel,s=this._splitLimits,a=this._eyePosRenderSR;this._allTiles.forAll(e=>{e.maxLevelDeltaNeighborCount=0,e.unmergableChildCount=0});const n=this.view.state.contentCamera.viewProjectionMatrix;for(;!i.empty;){const e=i.pop(),l=e.parent,o=l?.hasPendingUpdate(4),h=o?4:e.shouldSplit(s,a,r),d=1===h;e.leaf?ht(e,d):i.pushAll(e.children),o?(e.resetPendingUpdate(1),e.leaf||(e.setPendingUpdate(4),t=!0),this._updateClippingStatus(e),e.updateVisibility(),e.updateScreenDepth(n)):d?(e.resetPendingUpdate(4),e.leaf&&(e.setPendingUpdate(1),t=!0)):(e.resetPendingUpdate(1)&&e.updateAgentSuspension(),2===h&&e.updateAgents(0),e.leaf||(e.setPendingUpdate(4),e.resetPendingUpdate(1),t=!0))}this._allTilesDirty=t,this.requestUpdate(),(this._shortBatches||!this._oneBatchPerFrameTask)&&this._updatePendingTileGeometries(),e.madeProgress()}_sortTiles(e){e.done||this._allTilesSorted||!this.view.pointsOfInterest?.focus||(Ne(this._allTiles,this.view.pointsOfInterest.focus.renderLocation),this._allTilesSorted=!0,this._treeDebugger?.update(),e.madeProgress())}_markTileToUpdate(e){ve(e.loaded),e.intersectsClippingArea&&(this._pendingTilesToUpdate.add(e),this._markAllTileNeighborsForUpdate(e))}_hasPendingGeometryWithoutIndices(){for(const e of this._pendingTilesToUpdate)if(e.loaded&&e.intersectsClippingArea&&null==e.renderData?.vao?.indexBuffer)return!0;return!1}_updatePendingTileGeometries(){const e=this._pendingTilesToUpdate,t=[];if(e.forEach(e=>{this._canUpdateTileGeometry(e)&&t.push(e)}),0===t.length)return void e.clear();const i=(i,r)=>{!r||!this._canUpdateTileGeometry(r)||r.level<i.level||e.has(r)||(e.add(r),t.push(r),r.renderData.updateNeighborData())};t.sort(Oe);const r=t.length;for(let s=0;s<r;++s){const r=t[s];ve(r.loaded),ve(r.intersectsClippingArea);const a=r.renderData;if(!a?.geometryState)continue;a.updateNeighborData();const n=a.dirtyEdgeResolutions,l=a.geometryState,o=e=>{const t=je[e];i(r,l.cornerPeerNeighbors[e]?.findCorner(Pe(t),e=>e.loaded))};for(let t=0;t<4;++t)if(n&1<<t){const s=a.geometryState.edgePeerNeighbors[t];s&&s?.level>=r.level&&s.forAllSubtreeOnSide(we(Te[t]),t=>!!this._canUpdateTileGeometry(t)&&(ve(e.has(t)||Oe(r,t)<0),i(r,t),!0)),o((t+1)%4),o(t)}}e.clear(),this._updateTilesGeometries(t),this._shouldEmitChangeEvent=!0,Le&&Re&&this.checkAllTilesWaterproofness()}_mergeAndSplit(e,t){if(this.suspended||e.done||!this._allTilesDirty)return;this._allTilesDirty=!1,this.requestUpdate();let i=!1;const r=this.view.state.fixedContentCamera;let s=!1;for(;!e.done;){s=!0;let a=!1;const n=!this._allTiles.some(s=>{if(!i&&!r&&!s.visible)return e.done;let n=s;if(s.hasPendingUpdate(4)){if(!t||s.unmergableChildCount>0)return e.done;for(s.resetPendingUpdate(4);null!=n.parent&&0===n.parent.unmergableChildCount&&n.parent.resetPendingUpdate(4);)n=n.parent;this._mergeTile(n),a=!0,e.madeProgress()}else if(s.resetPendingUpdate(1)){let t=!0;const i=s.level;if(i>=ce){const e=e=>e.leaf||i-e.level<ce;for(let r=0;r<4;++r){const a=s.findNeighborTile(Te[r],e);null!=a&&i-a.level===ce&&(t=!1,Le&&(ve(a.leaf),ve(a.hasPendingUpdate(1))))}}t?(this._splitTile(s),e.madeProgress(),a=!0):s.setPendingUpdate(1)}return e.done});if(a&&(this._allTilesSorted=!1,this._allTilesDirty=!0,!this._oneBatchPerFrameTask&&this._updatePendingTileGeometries()),n){if(!i){i=!0;continue}if(!a)break}else this._allTilesDirty=!0}s?e.madeProgress():this._allTilesDirty=!0,!this._oneBatchPerFrameTask&&this._updatePendingTileGeometries(),this._allTilesCreated=!this.allTiles.some(e=>e.hasPendingUpdate(1)||e.hasPendingUpdate(4)&&0===e.unmergableChildCount),this._sortTiles(e)}_updateElevation(e){e.done||(this._allTiles.some(t=>(t.resetPendingUpdate(8)&&(this._updateTileGeometryState(t),e.madeProgress()),e.done)),!this._oneBatchPerFrameTask&&this._updatePendingTileGeometries())}_updateElevationSources(e){e.done||this._allTiles.some(t=>(t.needsElevationSourceUpdate()&&(t.updateAgents(0),t.markElevationSourceUpdateRequested(),e.madeProgress()),e.done))}_updateTextures(e){e.done||this._allTiles.some(t=>(this._updateTileTexture(t,e),e.done))}_updateClippingExtent(){this.spatialReference&&(this.updateOverlayParameters(),this.requestRender(1),this.overlayManager.setPlacementDirty(),this._updateRootTiles())}get _lodBias(){return this.view.qualitySettings.tiledSurface.lodBias-(1-this.view.quality)*ge}_getLodBiasCorrectedScale(e){const t=this.tilingScheme.levels,i=o(e-this._lodBias,0,t.length-1),r=i-Math.floor(i);return t[Math.floor(i)].scale*(1-r)+t[Math.ceil(i)].scale*r}_removeAllTiles(){this._pendingTilesToUpdate.clear(),this._pendingTilesForElevationUpdateEvent.clear(),null!=this._rootTiles&&(this._rootTiles.forEach(e=>this._purgeTile(e)),this._setRootTiles(null),this.notifyChange("ready")),this._allTiles.clear(),this.notifyChange("demResolution"),this.emit("tiles-changed",{allTiles:this.allTiles}),this.renderer.visible=!1}_purgeSubtree(e){const t=e.children;t[0]&&(this._purgeTile(t[0]),this._purgeTile(t[1]),this._purgeTile(t[2]),this._purgeTile(t[3]),e.clearChildren())}_purgeTile(e){e.leaf?pt(e):this._purgeSubtree(e),this._allTiles.removeUnordered(e),this._unloadTile(e),e.dispose(),this._tileCache.put(et._tileMemcacheKey,e),this.notifyChange("demResolution"),this.emit("tiles-changed",{allTiles:this.allTiles})}_unloadTile(e){this._pendingTilesToUpdate.delete(e),this._pendingTilesForElevationUpdateEvent.delete(e),e.unload()}_splitTile(e){fe(e.leaf,"Tile that is already split should not be split again!"),fe(e.rendered,"Tile marked to split is not rendered"),pt(e);const t=e.createChildren();this._allTiles.pushArray(t),this.notifyChange("demResolution"),this.emit("tiles-changed",{allTiles:this.allTiles}),e.updateAgentSuspension(),fe(e.rendered,"parent should be rendered"),t.forEach(e=>this._loadTile(e)),t.forEach(e=>this._pendingTilesToUpdate.add(e)),this._unloadTile(e),this._markAllTileNeighborsForUpdate(e),this._emitTileScaleChange(e,e.level+1),this._allTilesDirty=!0,this._shortBatches&&this._updatePendingTileGeometries(),t.forEach(e=>ht(e,e.hasPendingUpdate(1))),++this._performanceInfo.numSplit}_emitTileScaleChange(e,t=e.level){lt.spatialReference=this.spatialReference,lt.extent=e.extent,lt.scale=this._getLodBiasCorrectedScale(t),this.emit("scale-change",lt)}createTile(e,t,i,r){fe(!!r,"createTile sanity check");const s=this._acquireTile(e,t,i,r);return s.updateClippingStatus(this.groundExtent),s.updateScreenDepth(this.view.state.contentCamera.viewProjectionMatrix),this._shouldSplit(s)&&s.setPendingUpdate(1),s}get _shortBatches(){return 2!==this.view.state.mode}_mergeTile(e){fe(!e.hasPendingUpdate(1),"_mergeTile sanity check"),fe(!e.leaf,"Cannot merge a leaf"),e.leaf||(this._purgeSubtree(e),fe(!e.renderData,"Merging tile with existing render data?"),this._loadTile(e),this._markTileToUpdate(e),this._emitTileScaleChange(e),this._shortBatches&&this._updatePendingTileGeometries(),ht(e,!1),this._allTilesDirty=!0,++this._performanceInfo.numMerged)}_loadTile(e){e.load(),this.requestUpdate(),this._allTilesDirty=!0,this.overlayManager?.hasOverlays&&e.updateOverlayParameters(this.overlayManager)}_handleLayerViewChanges(e=Ke){if(!this._layerViewsDirty)return;this._layerViewsDirty=!1;let t=!1;const i=new Set;let r=-1;for(let s=this.view.allLayerViews.length-1;s>=0;s--){const e=this.view.allLayerViews.items[s];if(i.add(e.uid),Se(e)||Ce(e))if(this._basemapLayerViewHandles.has(e.uid)&&!Ce(e)){const i=this._layerClassFromLayerView(e),s=this.getLayerIndexByUID(i,e.uid);null!=s&&((s<r||null==r)&&(t=!0),r=s)}else this._registerTiledLayerView(e),e.layer.loaded&&(t=!0)}this._basemapLayerViewHandles.forEach((e,r)=>{i.has(r)||(this._unregisterTiledLayerView(r),t=!0)}),t&&this._updateTiledLayers(),this.hasCompositeBlendMode=this._hasCompositeBlendMode(),this._evaluateTransparency(),e.madeProgress()}get _isFullyTransparent(){if(this.view.map?.ground?.opacity>0)return!1;for(const e of this.view.allLayerViews.items)if(be(e)&&!H(e.layer)&&0!==e.fullOpacity)return!1;return!0}_hasCompositeBlendMode(){for(const e of this.view.allLayerViews.items)if((Ee(e)||Ce(e))&&$e(Qe[e.layer.blendMode]))return!0;return!1}_layerClassFromLayerView(e){return xe(e)?0:1}_registerTiledLayerView(e){const t=[];if((Ee(e)||Ce(e))&&t.push(f(()=>e.layer.blendMode,()=>{this.hasCompositeBlendMode=this._hasCompositeBlendMode(),this._updateTileTextures(2)})),!Ce(e)){const i=this._layerClassFromLayerView(e);t.push(f(()=>!e.destroyed&&e.suspended,()=>this._updateTiledLayers())),t.push(f(()=>!e.destroyed&&e.fullOpacity,()=>this._updateTileTextures(2)));const{layer:r}=e;"effectiveScaleRange"in r&&t.push(f(()=>!e.destroyed&&r.effectiveScaleRange,()=>this._restartAllAgents(i))),t.push(e.on("data-changed",()=>{const t=this.getLayerIndexByUID(i,e.uid);null!=t&&this._invalidateLayerData(t,i)}))}this._unregisterTiledLayerView(e.uid),this._basemapLayerViewHandles.set(e.uid,t)}_unregisterTiledLayerView(e){const t=this._basemapLayerViewHandles.get(e);if(t){for(const e of t)e.remove();this._basemapLayerViewHandles.delete(e)}}_updateTiledLayers(){if(!this.tilingScheme||this.view.suspended)return;const e=this.view.allLayerViews,t=[[],[]];let i=null;e.forEach(e=>{if(!e.layer||e.suspended||!Se(e)||!e.fullExtent)return;const r=this._layerClassFromLayerView(e);if(1===r){const t=e.displayLevelRange.maxLevel;t!==1/0&&(null===i||t>i)&&(i=t)}t[r].push(e)});for(const r of re){const e=this._layerViews[r],i=t[r];i.reverse();const s=i.length;let a=e.length!==s;const n=new Array(s),l=new Array(e.length);this._layerIndexByUid[r].clear();for(let t=0;t<s;t++){const s=i[t].uid;this._layerIndexByUid[r].set(s,t);const o=e.indexOf(i[t]);n[t]=o,t!==o&&(a=!0),o>-1&&(l[o]=t)}if(a){const e=this._postorderIterator;for(e.reset(this._rootTiles);!e.done;)e.next().modifyLayers(l,n,r);this._layerViews[r]=i,this._restartAllAgents(r),this._updateTilesVisibility(this._rootTiles)}}this.tilingScheme.ensureMaxLod(i)&&(this._viewChangeUpdate(),this.notifyChange("tilingScheme"))}_restartAllAgents(e){const t=this._postorderIterator;for(t.reset(this._rootTiles);!t.done;){const i=t.next();i.restartAgents(e),0===e&&i.computeElevationBounds()}this._updateRootTileElevationRange()}layerViewByIndex(e,t){return this._layerViews[t][e]}numLayers(e){return this._layerViews[e].length}_updateTileTextures(e){this._allTiles.forAll(t=>{t.updateAgents(1),1===e?this.renderer.updateTileTexture(t,16):t.updateRenderData(1,e)}),this._evaluateTransparency()}_invalidateLayerData(e,t){null!=this._rootTiles&&(Fe(this._rootTiles,i=>i.removeLayerAgent(e,t)),Fe(this._rootTiles,i=>{i.invalidateLayerData(e,t),i.restartAgents(t)}))}setTileTreeDirty(e){this._allTilesDirty=!0,e&&(this._allTilesCreated=!1)}requestRender(e=1){this.renderer.setNeedsRender(e)}requestUpdate(){1===++this._pendingUpdates&&(this._hasPendingUpdates=!0)}requestTileData(e,t,i,r){const s=this.layerViewByIndex(t,i),a=s.layer;return!a.tilemapCache||ye(s)?this._requestTileData(e,i,s,r):(++this._asyncWorkItems,a.tilemapCache.fetchAvailability(e.level,e.lij[1],e.lij[2],{...r,timeout:6e3}).catch(t=>{throw g(r),m(t)||this._dataMissing(e,i,s),t}).then(()=>this._frameTask.schedule(()=>this._requestTileData(e,i,s,r),r.signal)).finally(()=>--this._asyncWorkItems))}_requestTileData(e,t,i,r){if(this.destroying)return Promise.resolve();return 0===t?xe(i)?this._requestElevationTileData(e,i,r):Promise.reject():be(i)?this._requestMapTileData(e,i,r):Promise.reject()}_requestElevationTileData(e,t,i){++this._asyncWorkItems;const r=r=>{!_(i)&&r&&(this.setMemoryDirty(),this.requestUpdate(),this._elevationDataArrived(e,t,r))},s=i=>{m(i)||(l.getLogger(this).error(`Tile ${e.lij.toString()} layer 0/${t.uid} error ${i}`),this._dataMissing(e,0,t),this.requestUpdate())};return t.fetchElevationTile(e,{...$,...i}).then(e=>this._frameTask.schedule(()=>r(e)),s).finally(()=>--this._asyncWorkItems)}_elevationDataArrived(e,t,i){const r=this._layerIndexByUid[0].get(t.uid);if(null==r)return void l.getLogger(this).warn("TerrainSurface: received data from unknown layer %d %s",0,e.lij.toString());const s=new ee(e.lij,e.extent,i);e.dataArrived(r,0,s),this.emit("tile-data-changed",{tile:e,layerIndex:r,layerClass:0});const a=[e],n=e.level,o=this._iteratorPool.acquire();for(o.reset(a);!o.done;){const e=o.next();e.findElevationBoundsForLayer(r,n),e.computeElevationBounds()}0===n&&this._updateRootTileElevationRange(),o.remove(),this._updateTilesVisibility(a)}_requestMapTileData(e,t,i){++this._asyncWorkItems;const r=(r,s)=>{Ue(s),_(i)||(console.error(`Tile ${e.lij.toString()} layer 1/${t.uid} error ${r}`),this._dataMissing(e,1,t),this.requestUpdate())},s=e=>t=>r(t,e),a=r=>this._frameTask.schedule(()=>{this.requestUpdate(),_(i)?Ue(r):this._mapTileDataArrived(e,t,r)},i.signal,s(r)).catch(s(r)),n=(e,t=null)=>this._frameTask.schedule(()=>r(e,t));return t.fetchTile(e.lij,i).then(a,n).finally(()=>--this._asyncWorkItems)}_mapTileDataArrived(e,t,i){const r=this.getLayerIndexByUID(1,t.uid);if(null==r)return Ue(i),void l.getLogger(this).warn("TerrainSurface: received data from unknown layer");e.dataArrived(r,1,i),this.emit("tile-data-changed",{tile:e,layerIndex:r,layerClass:1})}_dataMissing(e,t,i){const r=this.getLayerIndexByUID(t,i.uid);null!=r?(e.dataMissing(r,t),this.emit("tile-data-changed",{tile:e,layerIndex:r,layerClass:t})):l.getLogger(this).warn("TerrainSurface: received data from unknown layer")}get performanceInfo(){const e=this._performanceInfo;return e.numNodes=this._allTiles.length,e.numLeaves=e.numVisible=e.numRendered=e.numLoadedPerLevel.length=e.numRenderedPerLevel.length=0,this._allTiles.forAll(t=>{t.leaf&&e.numLeaves++;const i=t.level;t.renderData&&(e.numLoadedPerLevel[i]=(e.numLoadedPerLevel[i]||0)+1),t.visible&&(e.numVisible++,t.rendered&&(e.numRenderedPerLevel[i]=(e.numRenderedPerLevel[i]||0)+1,e.numRendered++))}),e}setMemoryDirty(){this._usedMemory=null}get usedMemory(){return this.tilingScheme?(null==this._usedMemory&&(this._usedMemory=this._recalculateUsedMemory()),this._usedMemory??0):0}_recalculateUsedMemory(){return this.tilingScheme?Math.round(this._allTiles.reduce((e,t)=>e+t.usedMemory,0)):null}getUsedMemoryForLayerView(e){let t=0;const i=this._layerClassFromLayerView(e),r=this.getLayerIndexByUID(i,e.uid);return null!=r&&this._allTiles.forAll(e=>t+=e.getUsedMemoryForLayer(i,r)),t}get renderPatchBorders(){return this._renderer.renderPatchBorders}set renderPatchBorders(e){this._renderer.renderPatchBorders=e}get renderingDisabled(){return this._renderer.renderingDisabled}set renderingDisabled(e){this._renderer.renderingDisabled=e}get test(){}checkAllTilesWaterproofness(){if(!Re)return;const e=this._rootTiles;if(null==e)return;const t=e=>e?.renderData?.geometry?.indices?.length>0,i=(e,i)=>{t(e)&&console.error("Tile[",e.lij,"] has geometry although parent[",i.lij,"] has geom")},r=e=>{if(e.intersectsClippingArea)if(e.renderData&&!e.renderData.geometryState&&console.error("Tile[",e.lij,"] has renderData but not geometryState"),e.renderData&&!e.renderData.geometry&&console.error("Tile[",e.lij,"] has renderData but not geometryInfo"),!e.renderData?.geometry||(e.renderData.geometry.indices?.length??0)>0||console.error("Tile[",e.lij,"] has renderData but no indices - geometryInfo: ",e.renderData.geometry),t(e)){e.checkGeometryWaterproofness();for(const t of e.children)i(t,e)}else if(e.leaf)console.error("Tile[",e.lij,"] has no geometry and no children, from root to leaf");else for(const t of e.children)r(t)},s=e=>{const t=e.parent?.visible??!0,i=e.visible;e.computeVisibility();const r=e.visible;if(i!==r&&t&&console.error(" Tile[",e.lij,"] has out of date visibility: ",i," instead of ",r),!e.leaf)for(const a of e.children)s(a)};for(const a of e)r(a),s(a)}get isGlobal(){return this._isGlobal}get isGeographic(){return this._isGeographic}get isWebMercator(){return this._isWebMercator}get isWebMercatorOnPlateCarree(){return this._isWebMercatorOnPlateCarree}isEastEndWrap(e){return this._isGlobal&&e[2]===this.lijEastEnd(e[0])-1}isWestEndWrap(e){return this._isGlobal&&0===e[2]}lijEastEnd(e){return 1<<e+(this._isGeographic?1:0)}wrapEastWest(e){const t=this.lijEastEnd(e[0]),i=e[2];if(0<=i&&i<t)return e;if(!this._isGlobal)return null;const r=(i+(i<0?t:0))%t;return[e[0],e[1],r]}enableInternalChecks(e){Me(e)}enableWaterproofnessChecks(e){De(e)}static cleanupTerrainSurface(){nt.prune()}enable(e){e!==this.enabled&&(this._set("enabled",e),e?(this._updateRootTiles(),this.suspended=!1,this.view.elevationProvider.register(0,this)):(this.view.elevationProvider.unregister(this),this.suspended=!0,this._removeAllTiles(),this._setRootTiles(null)),this.notifyChange("ready"))}updateOverlayParameters(){const{overlayManager:e}=this;this.allTiles.forAll(t=>t.updateOverlayParameters(e))}};e([S()],tt.prototype,"_renderer",void 0),e([S({constructOnly:!0})],tt.prototype,"_scaleRangeQueries",void 0),e([S({constructOnly:!0})],tt.prototype,"view",void 0),e([S({constructOnly:!0})],tt.prototype,"overlayManager",void 0),e([S({constructOnly:!0})],tt.prototype,"terrainTextureCompressionTracker",void 0),e([S()],tt.prototype,"_hasPendingUpdates",void 0),e([S()],tt.prototype,"_asyncWorkItems",void 0),e([S()],tt.prototype,"_allTilesDirty",void 0),e([S()],tt.prototype,"_allTilesSorted",void 0),e([S()],tt.prototype,"allTilesCreated",null),e([S()],tt.prototype,"_allTilesCreated",void 0),e([S()],tt.prototype,"_viewChanged",void 0),e([S({type:Number})],tt.prototype,"heading",void 0),e([S()],tt.prototype,"_splitLimits",void 0),e([S()],tt.prototype,"_frameTask",void 0),e([S()],tt.prototype,"demResolution",null),e([S({readOnly:!0})],tt.prototype,"snapLevel",null),e([S({readOnly:!0})],tt.prototype,"lodSnappingEnabled",null),e([S({readOnly:!0})],tt.prototype,"userClippingExtent",null),e([S()],tt.prototype,"_rootTilesExtent",void 0),e([S({readOnly:!0})],tt.prototype,"groundExtent",null),e([S({readOnly:!0})],tt.prototype,"fullGroundExtent",null),e([S({readOnly:!0})],tt.prototype,"_tilingSchemeExtent",null),e([S({readOnly:!0})],tt.prototype,"updating",null),e([S({readOnly:!0})],tt.prototype,"readyToRun",null),e([S(J)],tt.prototype,"updatingProgress",void 0),e([S({readOnly:!0})],tt.prototype,"updatingProgressValue",null),e([S()],tt.prototype,"_maxNumUpdating",void 0),e([S()],tt.prototype,"baseOpacity",null),e([S()],tt.prototype,"hasCompositeBlendMode",void 0),e([S({readOnly:!0})],tt.prototype,"viewingMode",null),e([S()],tt.prototype,"maxTextureScale",void 0),e([S({readOnly:!0})],tt.prototype,"ready",null),e([S({readOnly:!0})],tt.prototype,"rootTiles",null),e([S()],tt.prototype,"_rootTiles",void 0),e([S({readOnly:!0})],tt.prototype,"spatialReference",null),e([S({type:t})],tt.prototype,"backgroundColor",null),e([S({value:!1})],tt.prototype,"slicePlaneEnabled",null),e([S({readOnly:!0})],tt.prototype,"tilingScheme",void 0),e([S({readOnly:!0})],tt.prototype,"tilingSchemeLocked",null),e([S({readOnly:!0})],tt.prototype,"tilingSchemeLogic",void 0),e([S()],tt.prototype,"wireframe",null),e([S()],tt.prototype,"opaque",null),e([S()],tt.prototype,"invisible",null),e([S({value:!1})],tt.prototype,"suspended",null),e([S()],tt.prototype,"fadeDuration",null),e([S()],tt.prototype,"_xNormalizer",null),e([S()],tt.prototype,"visibleElevationRange",void 0),e([S()],tt.prototype,"_rootTileElevationRange",void 0),e([S()],tt.prototype,"_layerViewsDirty",void 0),e([S()],tt.prototype,"renderPatchBorders",null),e([S()],tt.prototype,"renderingDisabled",null),e([S({readOnly:!0})],tt.prototype,"enabled",void 0),tt=et=e([C("esri.views.3d.terrain.TerrainSurface")],tt);const it=tt,rt=U(),st=new F,at=V(),nt=new c,lt={spatialReference:null,extent:null,scale:0};function ot(e,t,i){for(const r of e){if(!r.containsPointXY(t,i))continue;let e=r;for(;e&&!e.renderData;){const r=(t>e.extentMidX?1:0)+(i<e.extentMidY?2:0);e=e.children[r]}const s=e?.renderData?.geometryState.samplerData??null;return te(t,i,s)}return null}function ht(e,t){!e.leaf||e.level<ce||ct(e,e=>{t&&dt(e);const i=ut(e);if(e.maxLevelDeltaNeighborCount++,i){let t=e.parent;for(;t;){const e=ut(t);if(t.unmergableChildCount++,!e)break;t=t.parent}}})}function dt(e){if(e.hasPendingUpdate(1))return;let t=e.parent;for(;t?.resetPendingUpdate(4);)t=t.parent;e.resetPendingUpdate(4),e.leaf&&e.setPendingUpdate(1),e.level<ce||ct(e,e=>{dt(e)})}function pt(e){e.level<ce||ct(e,e=>{if(e.maxLevelDeltaNeighborCount--,0===e.maxLevelDeltaNeighborCount&&0===e.unmergableChildCount){let t=e.parent;for(;t&&(t.unmergableChildCount--,ut(t));)t=t.parent}})}function ut(e){return 0===e.maxLevelDeltaNeighborCount&&0===e.unmergableChildCount}function ct(e,t){if(e.level<ce)return;const i=e.level-ce,r=e.lij[1]>>ce,s=e.lij[2]>>ce,a=e=>e.leaf||e.level===i;for(let n=0;n<4;++n){const l=e.findNeighborTile(Te[n],a);if(!l||l.level!==i)continue;const o=l.lij;o[1]===r&&o[2]===s||t(l)}}export{it as default};
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import"../../../../../core/libs/gl-matrix-2/math/mat4.js";import"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import"../../core/shaderLibrary/shading/Gamma.glsl.js";import"../../core/shaderModules/glsl.js";import"../../core/shaderModules/Matrix4BindUniform.js";import"../../core/shaderModules/Matrix4PassUniform.js";import"../../core/shaderModules/Texture2DPassUniform.js";import"../../../../webgl/ShaderBuilder.js";export{b as build}from"../../../../../chunks/DeepSky.glsl.js";
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import{__decorate as e}from"tslib";import{subclass as r}from"../../../../../core/accessorSupport/decorators.js";import{create as s}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{ReloadableShader as t}from"../../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as o}from"../../core/shaderTechnique/ShaderTechnique.js";import{D as i}from"../../../../../chunks/DeepSky.glsl.js";import{NoParameters as a}from"../../../../webgl/NoParameters.js";import{makePipelineState as c,defaultColorWrite as l,unpremultipliedAlphaToPremultipliedAlpha as n}from"../../../../webgl/renderState.js";class m extends a{constructor(){super(...arguments),this.inverseModelMatrix=s(),this.bandTexture=null}}let p=class extends o{constructor(){super(...arguments),this.shader=new t(i,()=>import("./DeepSky.glsl.js"))}initializePipeline(){return c({blending:n,depthTest:{func:515},colorWrite:l})}};p=e([r("esri.views.3d.webgl-engine.effects.stars.DeepSkyTechnique")],p);export{m as DeepSkyPassParameters,p as DeepSkyTechnique};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as t}from"tslib";import{fetchAsset as e}from"../../../../../assets.js";import{createTask as s}from"../../../../../core/asyncUtils.js";import r from"../../../../../core/Error.js";import a from"../../../../../core/Logger.js";import{abortMaybe as i,disposeMaybe as n}from"../../../../../core/maybe.js";import{isAbortError as o}from"../../../../../core/promiseUtils.js";import{watch as f,initial as c,syncAndInitial as m}from"../../../../../core/reactiveUtils.js";import{subclass as h}from"../../../../../core/accessorSupport/decorators.js";import{copy as u,rotateZ as d,multiply as l}from"../../../../../core/libs/gl-matrix-2/math/mat4.js";import{fromValues as p}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{InternalRenderCategory as b}from"../../../webgl.js";import{glLayout as _}from"../../../support/buffer/glUtil.js";import{OpaqueEnvironment as g}from"../OpaqueEnvironment.js";import{StarPassParameters as w,StarsTechnique as v,layout as j}from"./StarsTechnique.js";import{VertexArrayObject as P}from"../../lib/VertexArrayObject.js";import{ColorAttachment0 as D,PrimitiveType as y}from"../../../../webgl/enums.js";import{VertexBuffer as T}from"../../../../webgl/VertexBuffer.js";let M=class extends g{constructor(){super(...arguments),this._numPoints=0,this._passParameters=new w}initialize(){this.addHandles([f(()=>this.view.environment.starsEnabled,t=>t?this._enable():this._disable(),c),f(()=>"virtual"===this.view.environment.lighting.type?null:this.view.environment.lighting.date,t=>this._update(t),m)])}_enable(){super._enable(),this._loadDataTask=this._createLoadDataTask()}get loading(){return!!this._loadDataTask&&!this._loadDataTask.finished}destroy(){this._loadDataTask=i(this._loadDataTask),this._numPoints=0,this._vao=n(this._vao),this._starData=null}render(t){const e=t.find(({name:t})=>t===b.OPAQUE_ENVIRONMENT),s=this.techniques.getCompiled(v);if(this.loading||!s)return this.requestRender(1),e;if(!this._starData)return e;this._vao??=this._ensureResources(this._starData);const r=this.renderingContext;return r.bindTechnique(s,this.bindParameters,this._passParameters),r.setDrawBuffers([D]),r.bindVAO(this._vao),r.drawArrays(y.POINTS,0,this._numPoints),e}_ensureResources(t){this._numPoints=t.byteLength/R;const e=new Float32Array(t,0,2*this._numPoints),s=new Uint8Array(t,2*this._numPoints*4,this._numPoints);return x(this.renderingContext,e,s,this._numPoints)}_update(t){if(!t)return;const e=(t.getHours()/12+t.getMinutes()/60*(2/24)+t.getSeconds()/60*(2/1440)-.9972222)%2,s=2*k(t),r=u(this._passParameters.modelMatrix,O);d(r,r,-s*Math.PI),l(r,L,r),d(r,r,-e*Math.PI),this.requestRender(1)}_createLoadDataTask(){if(this._starData)return null;const t=s(async t=>{const{data:s}=await e("esri/views/3d/environment/resources/stars.wsv",{responseType:"array-buffer",signal:t});q(s),this._starData=s});return t.promise.catch(t=>{o(t)||a.getLogger(this).error(t)}).then(()=>{this.destroyed||this.requestRender(1)}),t}};function x(t,e,s,r){const a=j.createBuffer(r),i=a.position,n=a.color,o=a.size;for(let f=0;f<r;f++){const t=e[2*f],r=e[2*f+1];i.set(f,0,-Math.cos(t)*Math.sin(r)),i.set(f,1,-Math.sin(t)*Math.sin(r)),i.set(f,2,-Math.cos(r));const a=A(s[f]),c=I(E[a[1]]);n.set(f,0,c[0]),n.set(f,1,c[1]),n.set(f,2,c[2]),n.set(f,3,255),o.set(f,a[0])}return new P(t,new T(t,_(j),a.buffer))}function k(t){const e=t,s=new Date(t.getFullYear(),0,1,11,58,56);return(+e-+s)/(+new Date(t.getFullYear()+1,0,1,11,58,55)-+s)}function q(t){if(!t)throw new r("stars:no-data-received","Failed to create stars because star catalogue is missing");const e=t.byteLength/R;if(e%1!=0||e>5e4||e<5e3)throw new r("stars:invalid-data","Failed to create stars because star catalogue data is invalid")}function I(t){return[parseInt(t.slice(0,2),16),parseInt(t.slice(2,4),16),parseInt(t.slice(4,6),16)]}function A(t){return t>=192?[2.9,t-192]:t>=160?[2.5,t-160]:t>=128?[2,t-128]:t>=96?[1.5,t-96]:t>=64?[1,t-64]:t>=32?[.7,t-32]:[.4,t]}M=t([h("esri.views.3d.webgl-engine.effects.stars.Stars")],M);const E=["9bb2ff","9eb5ff","aabfff","bbccff","ccd8ff ","dae2ff","e4e9ff","eeefff","f8f6ff","fff9fb","fff5ef","fff1e5","ffeddb","ffe9d2","ffe6ca","ffe3c3","ffe0bb","ffddb4","ffdaad","ffd6a5","ffd29c","ffcc8f","ffc178","ffa94b","ff7b00"],L=p(1,0,0,0,0,.9174771405229186,.39778850739794974,0,0,-.39778850739794974,.9174771405229186,0,0,0,0,1),O=p(1,0,0,0,0,.9174771405229186,-.39778850739794974,0,0,.39778850739794974,.9174771405229186,0,0,0,0,1),R=9;export{M as Stars};
2
+ import{__decorate as e}from"tslib";import{fetchAsset as t}from"../../../../../assets.js";import{createTask as s}from"../../../../../core/asyncUtils.js";import r from"../../../../../core/Error.js";import a from"../../../../../core/Logger.js";import{abortMaybe as i,disposeMaybe as n}from"../../../../../core/maybe.js";import{isAbortError as o,throwIfAborted as f}from"../../../../../core/promiseUtils.js";import{watch as d,initial as h,syncAndInitial as c}from"../../../../../core/reactiveUtils.js";import{subclass as u}from"../../../../../core/accessorSupport/decorators.js";import{copy as m,rotateZ as l,multiply as b,invertOrIdentity as p}from"../../../../../core/libs/gl-matrix-2/math/mat4.js";import{InternalRenderCategory as _}from"../../../webgl.js";import{glLayout as T}from"../../../support/buffer/glUtil.js";import{OpaqueEnvironment as g}from"../OpaqueEnvironment.js";import{DeepSkyPassParameters as w,DeepSkyTechnique as x}from"./DeepSkyTechnique.js";import{StarPassParameters as y,StarsTechnique as P,layout as v}from"./StarsTechnique.js";import{getDailyRotationCoefficient as k,computeDayDuration as j,eq2ec as D,ec2eq as M}from"./starsUtils.js";import{createTextureKTX2 as q}from"../../lib/BasisUtil.js";import{VertexArrayObject as L}from"../../lib/VertexArrayObject.js";import{ColorAttachment0 as S,PrimitiveType as U}from"../../../../webgl/enums.js";import{TextureDescriptor as A}from"../../../../webgl/TextureDescriptor.js";import{VertexBuffer as B}from"../../../../webgl/VertexBuffer.js";let I=class extends g{constructor(){super(...arguments),this._numPoints=0,this._passParameters=new y,this._deepSkyPassParameters=new w}initialize(){this.addHandles([d(()=>this.view.environment.starsEnabled,e=>e?this._enable():this._disable(),h),d(()=>"virtual"===this.view.environment.lighting.type?null:this.view.environment.lighting.date,e=>this._update(e),c)])}_enable(){super._enable(),this._bandTextureTask=this._createLoadBandTextureTask(),this._loadDataTask=this._createLoadDataTask()}get loading(){return!!this._loadDataTask&&!this._loadDataTask.finished||!!this._bandTextureTask&&!this._bandTextureTask.finished}destroy(){this._bandTextureTask=i(this._bandTextureTask),this._bandTexture=n(this._bandTexture),this._loadDataTask=i(this._loadDataTask),this._numPoints=0,this._vao=n(this._vao),this._starData=null}render(e){const t=e.find(({name:e})=>e===_.OPAQUE_ENVIRONMENT),s=this.techniques.getCompiled(P),r=this.techniques.getCompiled(x);if(this.loading||!s||!r)return this.requestRender(1),t;const a=this.renderingContext;return this._bandTexture&&(this._deepSkyPassParameters.bandTexture=this._bandTexture,a.bindTechnique(r,this.bindParameters,this._deepSkyPassParameters),a.setDrawBuffers([S]),a.screen.draw()),this._starData&&(this._vao??=this._ensureResources(this._starData),a.bindTechnique(s,this.bindParameters,this._passParameters),a.setDrawBuffers([S]),a.bindVAO(this._vao),a.drawArrays(U.POINTS,0,this._numPoints)),t}_ensureResources(e){this._numPoints=e.byteLength/z;const t=new Float32Array(e,0,2*this._numPoints),s=new Uint8Array(e,2*this._numPoints*4,this._numPoints);return R(this.renderingContext,t,s,this._numPoints)}_update(e){if(!e)return;const t=k(e),s=2*j(e),r=m(this._passParameters.modelMatrix,D);l(r,r,-s*Math.PI),b(r,M,r),l(r,r,-t*Math.PI),p(this._deepSkyPassParameters.inverseModelMatrix,r),this.requestRender(1)}_createLoadDataTask(){if(this._starData)return null;const e=s(async e=>{const{data:s}=await t(F,{responseType:"array-buffer",signal:e});E(s),this._starData=s});return e.promise.catch(e=>{o(e)||a.getLogger(this).error(e)}).then(()=>{this.destroyed||this.requestRender(1)}),e}_createLoadBandTextureTask(){if(this._bandTexture)return null;const e=s(async e=>{const{data:s}=await t(N,{responseType:"array-buffer",signal:e});f(e);const a=new A;a.wrapMode=33071,a.hasMipmap=!0,a.maxAnisotropy=8;const i=await q(this.renderingContext,a,s);if(e.aborted&&(i?.dispose(),f(e)),!i)throw new r("stars:invalid-band-texture","Failed to transcode Milky Way band texture.");this._bandTexture=i});return e.promise.catch(e=>{o(e)||a.getLogger(this).warn("Failed to load Milky Way band texture.",e)}).then(()=>{this.destroyed||this.requestRender(1)}),e}};function R(e,t,s,r){const a=v.createBuffer(r),i=a.position,n=a.color,o=a.size;for(let f=0;f<r;f++){const e=t[2*f],r=t[2*f+1];i.set(f,0,-Math.cos(e)*Math.sin(r)),i.set(f,1,-Math.sin(e)*Math.sin(r)),i.set(f,2,-Math.cos(r));const a=C(s[f]),d=O(V[a[1]]);n.set(f,0,d[0]),n.set(f,1,d[1]),n.set(f,2,d[2]),n.set(f,3,255),o.set(f,a[0])}return new L(e,new B(e,T(v),a.buffer))}function E(e){if(!e)throw new r("stars:no-data-received","Failed to create stars because star catalogue is missing");const t=e.byteLength/z;if(t%1!=0||t>5e4||t<5e3)throw new r("stars:invalid-data","Failed to create stars because star catalogue data is invalid")}function O(e){return[parseInt(e.slice(0,2),16),parseInt(e.slice(2,4),16),parseInt(e.slice(4,6),16)]}function C(e){return e>=192?[2.9,e-192]:e>=160?[2.5,e-160]:e>=128?[2,e-128]:e>=96?[1.5,e-96]:e>=64?[1,e-64]:e>=32?[.7,e-32]:[.4,e]}I=e([u("esri.views.3d.webgl-engine.effects.stars.Stars")],I);const F="esri/views/3d/environment/resources/stars.wsv",N="esri/views/3d/environment/resources/milkyway-band.ktx2",V=["9bb2ff","9eb5ff","aabfff","bbccff","ccd8ff ","dae2ff","e4e9ff","eeefff","f8f6ff","fff9fb","fff5ef","fff1e5","ffeddb","ffe9d2","ffe6ca","ffe3c3","ffe0bb","ffddb4","ffdaad","ffd6a5","ffd29c","ffcc8f","ffc178","ffa94b","ff7b00"],z=9;export{I as Stars};
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import{fromValues as t}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";function e(t){return(t.getHours()/12+t.getMinutes()/60*(2/24)+t.getSeconds()/60*(2/1440)-.9972222)%2}function r(t){const e=t,r=new Date(t.getFullYear(),0,1,11,58,56);return(+e-+r)/(+new Date(t.getFullYear()+1,0,1,11,58,55)-+r)}const n=t(1,0,0,0,0,.9174771405229186,.39778850739794974,0,0,-.39778850739794974,.9174771405229186,0,0,0,0,1),o=t(1,0,0,0,0,.9174771405229186,-.39778850739794974,0,0,.39778850739794974,.9174771405229186,0,0,0,0,1);export{r as computeDayDuration,n as ec2eq,o as eq2ec,e as getDailyRotationCoefficient};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../core/Collection.js";import{deprecateWidget as i}from"../core/deprecate.js";import{IdentifiableMixin as s}from"../core/Identifiable.js";import o from"../core/Logger.js";import r from"../core/ReactiveMap.js";import{on as l,initial as a,watch as n,syncAndInitial as d}from"../core/reactiveUtils.js";import{property as c,subclass as p}from"../core/accessorSupport/decorators.js";import m from"./Widget.js";import h from"./BasemapLayerList/BasemapLayerListViewModel.js";import u from"./BasemapLayerList/BasemapLayerListVisibleElements.js";import{css as g}from"./BasemapLayerList/css.js";import f from"./LayerList/LayerListItem.js";import y from"./LayerList/ListItem.js";import{minFilterItems as _,getItem as b,getLayerType as L,removeDestroyedListItems as v,setFilterPredicate as I,sortLayersToIds as w,sortChildLayersToIds as F}from"./LayerList/support/layerListUtils.js";import{loadCalciteComponents as E}from"./support/componentsUtils.js";import{globalCss as C}from"./support/globalCss.js";import{incrementHeadingLevel as T}from"./support/Heading.js";import{calciteListFilterProps as M}from"./support/listUtils.js";import{tsx as P,messageBundle as O,vmEvent as A}from"./support/widget.js";import{setFocus as B}from"./support/widgetUtils.js";const R=t.ofType(y),k="nested",D=".*\\S+.*",j="data-basemap-layer-type";let x=class extends(s(m)){constructor(e,s){super(e,s),this._baseListEl=null,this._referenceListEl=null,this._activeItem=null,this._tooltipReferenceMap=new Map,this._editTitleInput=null,this._focusRootFlowItem=!1,this._focusPanelFlowItem=!1,this._focusLayerFlowItem=null,this._focusEditingFlowItem=!1,this._layerListMap=new r,this._lastDragDetail=null,this._selectedDragItemLayerUid=null,this._rootGroupUid=`basemap-${this.uid}`,this._openedLayersController=null,this.catalogLayerList=null,this.catalogOptions=null,this.collapsed=!1,this.dragEnabled=!1,this.editingTitle=!1,this.filterPlaceholder="",this.baseFilterPredicate=null,this.baseFilterText="",this.referenceFilterPredicate=null,this.referenceFilterText="",this.listItemCanGiveFunction=null,this.listItemCanReceiveFunction=null,this.headingLevel=2,this.knowledgeGraphOptions=null,this.layerTablesEnabled=new t(["knowledge-graph"]),this.mapImageOptions=null,this.messages=null,this.messagesCommon=null,this.minFilterItems=_,this.openedLayers=new t,this.openedLayerLists=new t,this.tableList=null,this.selectedItems=new R,this.selectionMode="none",this.tileOptions=null,this.viewModel=new h,this.visibilityAppearance="default",this.visibleElements=new u,this._canMove=({dragEl:e,fromEl:t,toEl:i},s)=>{const o="pull"===s?this.listItemCanGiveFunction:this.listItemCanReceiveFunction,r=b(e);if(!r?.sortable)return!1;const l=b(t),a=L(t),n=b(i),d=L(i),c=!!a&&!!d&&a===d,p={selected:r,from:l,to:n},m=t.group,h=i.group,u=l?.layer?.type??"",g=n?.layer?.type??"",f=new Set(["map-image","catalog","knowledge-graph"]),y="sublayer";return m&&h&&"function"==typeof o?o.call(null,p):c&&!f.has(u)&&!f.has(g)&&r?.layer?.type!==y},this._onSelectedDragItemLayerUidChange=e=>{this._selectedDragItemLayerUid=e},this._onTriggerAction=(e,t)=>{this.triggerAction(e,t)},this._onTooltipReferenceChange=(e,t)=>{t?this._tooltipReferenceMap.set(e,t):this._tooltipReferenceMap.delete(e)},this._onTablesOpen=e=>{this.openedLayers.push(e.layer),this._focusLayerFlowItem=e.layer?.uid},this._onPanelOpen=()=>{this._focusPanelFlowItem=!0},this._onCatalogOpen=e=>{this.openedLayers.push(e.layer?.parent),this._focusLayerFlowItem=e.layer?.uid},this._clearActiveItem=()=>{this._activeItem=null},this._setActiveItem=e=>{if("default"!==this.visibilityAppearance)return;const t=Array.from(e.composedPath()).find(e=>e.classList?.contains(g.item));this._activeItem=b(t)},this._onCalciteListOrderChange=e=>{const{_lastDragDetail:t}=this,{toEl:i,fromEl:s,dragEl:o,newIndex:r}=e;if(!s||!i||t?.newIndex===r&&t?.dragEl===o&&t?.toEl===i&&t?.fromEl===s)return;this._lastDragDetail=e,this._selectedDragItemLayerUid=o.value;const l=s,a=i;if(l===a){const e=Array.from(s.children).filter(e=>e?.matches("calcite-list-item")).map(e=>e.value);return void this._sortLayers(l,e)}this._moveLayerFromChildList({toEl:a,fromEl:l,dragEl:o,newIndex:r})},this.announceDeprecation=()=>{i(o.getLogger(this),"Basemap Layer List","arcgis-basemap-layer-list",{version:"5.0"})}}initialize(){this.addHandles([l(()=>this.openedLayers,"change",()=>this._handleOpenedLayersChange(),a),n(()=>[this.viewModel.referenceItems.toArray(),this.viewModel.baseItems.toArray()],()=>v(this.selectedItems),d),n(()=>[this.baseFilterPredicate,this._baseListEl],()=>I(this._baseListEl,this.baseFilterPredicate)),n(()=>[this.referenceFilterPredicate,this._referenceListEl],()=>I(this._referenceListEl,this.referenceFilterPredicate))])}loadDependencies(){return E({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),block:()=>import("@esri/calcite-components/dist/components/calcite-block"),label:()=>import("@esri/calcite-components/dist/components/calcite-label"),input:()=>import("@esri/calcite-components/dist/components/calcite-input"),button:()=>import("@esri/calcite-components/dist/components/calcite-button"),flow:()=>import("@esri/calcite-components/dist/components/calcite-flow"),"flow-item":()=>import("@esri/calcite-components/dist/components/calcite-flow-item"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice"),tooltip:()=>import("@esri/calcite-components/dist/components/calcite-tooltip")})}destroy(){this._tooltipReferenceMap.clear(),this._destroyOpenedLayerLists()}get _visibleBaseItems(){return this.baseItems?.filter(e=>!e.hidden&&(this.visibleElements.errors||!e.error))}get _visibleReferenceItems(){return this.referenceItems?.filter(e=>!e.hidden&&(this.visibleElements.errors||!e.error))}get _openedPanelItems(){return this._visibleReferenceItems.concat(this._visibleBaseItems).flatten(e=>e.children).filter(({hidden:e,panel:t})=>!e&&t?.open&&!t.disabled&&t.flowEnabled)}get _totalBaseItems(){return this.viewModel.baseItems.flatten(e=>e.children.filter(e=>"catalog-dynamic-group"!==e.layer?.type)).length}get _totalReferenceItems(){return this.viewModel.referenceItems.flatten(e=>e.children.filter(e=>"catalog-dynamic-group"!==e.layer?.type)).length}get _baseFilterEnabled(){return this._totalBaseItems>=this.minFilterItems&&this.visibleElements.filter}get _referenceFilterEnabled(){return this._totalReferenceItems>=this.minFilterItems&&this.visibleElements.filter}get _renderedOpenLayerFlowItems(){const{openedLayers:e}=this;return e.toArray().map((t,i)=>this._renderLayerFlowItem(t,i===e.length-1))}get basemapTitle(){return this.viewModel.basemapTitle}set basemapTitle(e){this.viewModel.basemapTitle=e}get baseListItemCreatedFunction(){return this.viewModel.baseListItemCreatedFunction}set baseListItemCreatedFunction(e){this.viewModel.baseListItemCreatedFunction=e}get icon(){return"layers"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get referenceListItemCreatedFunction(){return this.viewModel.referenceListItemCreatedFunction}set referenceListItemCreatedFunction(e){this.viewModel.referenceListItemCreatedFunction=e}get baseItems(){return this.viewModel.baseItems}get referenceItems(){return this.viewModel.referenceItems}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}triggerAction(e,t){return this.viewModel.triggerAction(e,t)}render(){const{state:e}=this.viewModel,t={[C.hidden]:"loading"===e,[C.disabled]:"disabled"===e};return P("div",{class:this.classes(g.base,C.widget,C.panel,t)},this._renderItems())}async _createCatalogLayerList(e){const{default:t}=await import("./CatalogLayerList.js"),{headingLevel:i,catalogOptions:s,view:o,filterPlaceholder:r,minFilterItems:l,selectionMode:a,visibilityAppearance:n,_onCatalogOpen:d,_onTablesOpen:c,layerTablesEnabled:p}=this;return new t({headingLevel:i,view:o,filterPlaceholder:r,minFilterItems:l,selectionMode:a,visibilityAppearance:n,...s,catalogLayer:e,layerTablesEnabled:p,onCatalogOpen:d,onTablesOpen:c})}_getTableListParams(e){switch(e.type){case"knowledge-graph":return{...this.knowledgeGraphOptions,tables:e.tables};case"map-image":return{...this.mapImageOptions,tables:e.subtables};case"tile":return{...this.tileOptions,tables:e.subtables};default:return null}}async _createTableList(e){const{default:t}=await import("./TableList.js"),{headingLevel:i,selectionMode:s,dragEnabled:o}=this;return new t({headingLevel:i,selectionMode:s,dragEnabled:o,...this._getTableListParams(e)})}async _createFlowList(e,t){const{_layerListMap:i}=this,s=i.get(e);if(s)return s;const o="catalog"===e.type?await this._createCatalogLayerList(e):await this._createTableList(e);return t.aborted||i.set(e,o),o}async _handleOpenedLayersChange(){const{_layerListMap:e,openedLayers:t,openedLayerLists:i}=this;this._openedLayersController?.abort();const s=new AbortController,{signal:o}=s;this._openedLayersController=s,e.forEach((i,s)=>{t.includes(s)||(i.destroy(),e.delete(s))});const r=await Promise.all(t.map(e=>this._createFlowList(e,o)));if(o.aborted)return;i.removeAll(),i.addMany(r);const l=i.at(-1);l?"catalogLayer"in l?(this._set("catalogLayerList",l),this._set("tableList",null)):(this._set("catalogLayerList",null),this._set("tableList",l)):(this._set("catalogLayerList",null),this._set("tableList",null))}_destroyOpenedLayerLists(){this.openedLayerLists.destroyAll(),this.openedLayers.removeAll(),this._layerListMap.clear()}_renderItemTooltip(e){return e?P("calcite-tooltip",{key:`tooltip-${e.layer?.uid}`,overlayPositioning:"fixed",referenceElement:this._tooltipReferenceMap.get(e.layer?.uid),topLayerDisabled:this.topLayerDisabled},this.messages.layerIncompatibleTooltip):null}_renderItemTooltipNodes(e){return e.incompatible?this._renderItemTooltip(e):e.children?.filter(e=>!e.hidden).toArray().map(e=>this._renderItemTooltipNodes(e))}_renderItemTooltips(){return this._visibleReferenceItems.concat(this._visibleBaseItems)?.toArray().map(e=>this._renderItemTooltipNodes(e))}_focusLayerFlowItemNode(e){this._focusLayerFlowItem===e.dataset.layerUid&&(this._focusLayerFlowItem=null,B(e))}_renderPanelFlowItems(){const{_openedPanelItems:e,openedLayers:t}=this;return e.toArray().map(({title:i,panel:s},o)=>{const r=()=>this._handlePanelFlowItemBack(s);return P("calcite-flow-item",{afterCreate:this._focusPanelFlowItemNode,afterUpdate:this._focusPanelFlowItemNode,bind:this,description:i,heading:s.title,headingLevel:this.headingLevel,key:`flow-panel-${s.uid}`,selected:!t.length&&o===e.length-1,onCalciteFlowItemBack:e=>{e.preventDefault(),r()}},s.render(),P("calcite-button",{appearance:"transparent",slot:"footer-start",width:"full",onclick:r},this.messagesCommon.back))})}_handlePanelFlowItemBack(e){e.open=!1,this._focusRootFlowItem=!0}_focusEditingFlowItemNode(e){this._focusEditingFlowItem&&(this._focusEditingFlowItem=!1,B(e))}_focusRootFlowItemNode(e){this._focusRootFlowItem&&(this._focusRootFlowItem=!1,B(e))}_focusPanelFlowItemNode(e){this._focusPanelFlowItem&&(this._focusPanelFlowItem=!1,B(e))}_renderItem(e,t,i,s){return P(f,{activeItem:this._activeItem,canMove:this._canMove,css:g,displayMode:k,dragDisabled:t,dragEnabled:this.dragEnabled,item:e,key:`layerListItem-${e.layer?.uid}`,layerTablesEnabled:this.layerTablesEnabled,listModeDisabled:this.viewModel.listModeDisabled,messages:this.messages,messagesCommon:this.messagesCommon,parent:i,parentTitles:s,rootGroupUid:this._rootGroupUid,selectedDragItemLayerUid:this._selectedDragItemLayerUid,selectedItems:this.selectedItems,selectionMode:this.selectionMode,visibilityAppearance:this.visibilityAppearance,visibleElements:this.visibleElements,onAction:this._onTriggerAction,onCatalogOpen:this._onCatalogOpen,onPanelOpen:this._onPanelOpen,onSelectedDragItemLayerUidChange:this._onSelectedDragItemLayerUidChange,onTablesOpen:this._onTablesOpen,onTooltipReferenceChange:this._onTooltipReferenceChange})}_moveLayerFromChildList({toEl:e,fromEl:t,dragEl:i,newIndex:s}){const o=b(i),r=b(e),l=b(t),a=N(t),n=N(e);a&&n&&this.viewModel.moveListItem({targetItem:o,fromParentItem:l,toParentItem:r,newIndex:s,from:a,to:n})}_handleCalciteListDragEnd(e){const{fromEl:t,dragEl:i,oldIndex:s}=e;t.insertBefore(i,t.children[s])}_sortLayers(e,t){if(e)if(e===this._referenceListEl||e===this._baseListEl){const i=e===this._referenceListEl?"reference":"base",s="base"===i?this.view?.map?.basemap?.baseLayers:"reference"===i?this.view?.map?.basemap?.referenceLayers:null;w(s,t)}else{const i=b(e);if(!i)return;F(i,t)}}_handleCalciteListChange(e){const{selectionMode:t,selectedItems:i}=this;if("none"===t)return;const s=e.target.selectedItems.map(e=>b(e)).filter(Boolean);i.removeAll(),i.addMany(s)}_renderEditingInput(){const{messages:e}=this,{basemapTitle:t}=this.viewModel;return P("div",{class:g.editing},P("calcite-label",null,e.basemapTitle,P("calcite-input",{afterCreate:e=>this._editTitleInput=e,label:e.basemapTitle,name:"basemaptitle",pattern:D,placeholder:e.basemapTitle,required:!0,title:e.basemapTitle,type:"text",value:t??void 0})))}_renderCancelButton(){const{messagesCommon:{cancel:e}}=this;return P("calcite-button",{appearance:"outline",bind:this,label:e,slot:"footer",title:e,width:"full",onclick:this._toggleEditingTitle},e)}_renderSubmitButton(){const{messagesCommon:e}=this;return P("calcite-button",{label:e.form.submit,slot:"footer",title:e.form.submit,type:"submit",width:"full"},e.form.ok)}_renderEditingForm(){return this.editingTitle?P("form",{bind:this,class:g.editingForm,onsubmit:this._formSubmit},P("calcite-flow-item",{afterCreate:this._focusEditingFlowItemNode,afterUpdate:this._focusEditingFlowItemNode,bind:this,heading:this.visibleElements.heading?this.messages.basemapTitle:void 0,headingLevel:this.headingLevel,selected:0===this.openedLayers.length&&0===this._openedPanelItems.length,onCalciteFlowItemBack:e=>{e.preventDefault(),this._toggleEditingTitle()}},this._renderEditingInput(),this._renderCancelButton(),this._renderSubmitButton())):null}_renderEditTitleButton(){const{editingTitle:e,visibleElements:t,messagesCommon:i}=this,s=i.edit;return t.editTitleButton&&!e?P("calcite-action",{bind:this,icon:"pencil",slot:"header-actions-end",text:s,title:s,onclick:this._toggleEditingTitle}):null}_renderNoLayersInfoMessage(e){return P("div",{slot:"message"},e)}_renderNoLayersInfo(e,t){return P("div",{class:g.itemMessage},P("calcite-notice",{icon:"information",key:t,kind:"info",open:!0,width:"full"},this._renderNoLayersInfoMessage(e)))}_renderItems(){const{collapsed:e,visible:t,visibleElements:{closeButton:i,collapseButton:s,heading:o,flow:r},messages:l,viewModel:a}=this,n=[P("calcite-flow-item",{afterCreate:this._focusRootFlowItemNode,afterUpdate:this._focusRootFlowItemNode,bind:this,closable:i,closed:!t,collapsed:e,collapsible:s,heading:o?a.basemapTitle??l.widgetLabel:void 0,headingLevel:this.headingLevel,key:"root-flow-item",selected:!this.editingTitle&&0===this.openedLayers.length&&0===this._openedPanelItems.length,onCalciteFlowItemClose:()=>this.visible=!1},this._renderEditTitleButton(),this._renderReferenceSection(),this._renderBaseSection()),this._renderEditingForm(),this._renderPanelFlowItems(),this._renderedOpenLayerFlowItems];return t?[r?P("calcite-flow",{key:"root-flow"},n):n,this._renderItemTooltips()]:null}_renderLayerFlowItem(e,t){const{messages:i,openedLayers:s}=this,o=e.title||this.messages.untitledLayer;return P("calcite-flow-item",{afterCreate:this._focusLayerFlowItemNode,afterUpdate:this._focusLayerFlowItemNode,bind:this,"data-layer-uid":e.uid,description:o,heading:i["catalog"===e.type?"catalogLayers":"tables"],headingLevel:this.headingLevel,key:`flow-layer-list-${e.uid}`,selected:t,onCalciteFlowItemBack:e=>{e.preventDefault(),s.pop();const t=s.at(-1);t?this._focusLayerFlowItem=t.uid:this._focusRootFlowItem=!0}},this._layerListMap.get(e)?.render())}_renderList(e,t,i){const{messages:s,dragEnabled:o,selectionMode:r,filterPlaceholder:l,baseFilterText:a,referenceFilterText:n,_baseFilterEnabled:d,_referenceFilterEnabled:c,_rootGroupUid:p}=this,m="reference"===t?s.noReferenceLayers:s.noBaseLayers,h="reference"===t?c:d;return P("calcite-block",{class:g.section,collapsible:!0,expanded:!0,heading:"reference"===t?s.referenceHeading:s.baseHeading,headingLevel:T(this.headingLevel),key:`block-${t}`},e?.length?null:this._renderNoLayersInfo(m,t),P("calcite-list",{afterCreate:e=>{"reference"===t?this._referenceListEl=e:this._baseListEl=e,e.addEventListener("focusin",this._setActiveItem),e.addEventListener("focusout",this._clearActiveItem)},afterRemoved:e=>{"reference"===t?this._referenceListEl=null:this._baseListEl=null,e.removeEventListener("focusin",this._setActiveItem),e.removeEventListener("focusout",this._clearActiveItem)},canPull:e=>this._canMove(e,"pull"),canPut:e=>this._canMove(e,"put"),displayMode:k,filterProps:M,[j]:t,"data-layer-type":p,dragEnabled:o,filterEnabled:h,filterPlaceholder:l,filterText:h?"reference"===t?n:a:"",group:p,key:`list-${t}`,label:s.widgetLabel,selectionAppearance:"border",selectionMode:r,onCalciteListChange:e=>this._handleCalciteListChange(e),onCalciteListDragEnd:e=>this._handleCalciteListDragEnd(e.detail),onCalciteListFilter:e=>this["reference"===t?"referenceFilterText":"baseFilterText"]=e.currentTarget?.filterText??"",onCalciteListOrderChange:e=>this._onCalciteListOrderChange(e.detail),onmouseleave:this._clearActiveItem,onmouseover:this._setActiveItem},e?.toArray().map(e=>this._renderItem(e,i)),h?P("div",{class:g.filterNoResults,slot:"filter-no-results"},P("calcite-notice",{kind:"info",open:!0,width:"full"},this._renderNoLayersInfoMessage(m))):null))}_renderBaseSection(){const{_visibleBaseItems:e}=this;return this.visibleElements.baseLayers?this._renderList(e,"base",1===e?.length):null}_renderReferenceSection(){return this.visibleElements.referenceLayers?this._renderList(this._visibleReferenceItems,"reference",!1):null}_toggleEditingTitle(){const{editingTitle:e}=this,t=!e;this.editingTitle=t,t?this._focusEditingFlowItem=!0:this._focusRootFlowItem=!0}_formSubmit(e){e.preventDefault();const t=this._editTitleInput?.value;t?.trim()&&(this.basemapTitle=t),this._toggleEditingTitle()}};function N(e){return e?.closest(`[${j}]`)?.getAttribute(j)}e([c()],x.prototype,"_baseListEl",void 0),e([c()],x.prototype,"_referenceListEl",void 0),e([c()],x.prototype,"_activeItem",void 0),e([c()],x.prototype,"_tooltipReferenceMap",void 0),e([c()],x.prototype,"_focusRootFlowItem",void 0),e([c()],x.prototype,"_focusPanelFlowItem",void 0),e([c()],x.prototype,"_focusLayerFlowItem",void 0),e([c()],x.prototype,"_focusEditingFlowItem",void 0),e([c()],x.prototype,"_layerListMap",void 0),e([c()],x.prototype,"_visibleBaseItems",null),e([c()],x.prototype,"_visibleReferenceItems",null),e([c()],x.prototype,"_openedPanelItems",null),e([c()],x.prototype,"_totalBaseItems",null),e([c()],x.prototype,"_totalReferenceItems",null),e([c()],x.prototype,"_baseFilterEnabled",null),e([c()],x.prototype,"_referenceFilterEnabled",null),e([c()],x.prototype,"_renderedOpenLayerFlowItems",null),e([c()],x.prototype,"basemapTitle",null),e([c({readOnly:!0})],x.prototype,"catalogLayerList",void 0),e([c()],x.prototype,"catalogOptions",void 0),e([c()],x.prototype,"collapsed",void 0),e([c()],x.prototype,"dragEnabled",void 0),e([c()],x.prototype,"editingTitle",void 0),e([c()],x.prototype,"filterPlaceholder",void 0),e([c()],x.prototype,"baseFilterPredicate",void 0),e([c()],x.prototype,"baseFilterText",void 0),e([c()],x.prototype,"referenceFilterPredicate",void 0),e([c()],x.prototype,"referenceFilterText",void 0),e([c()],x.prototype,"listItemCanGiveFunction",void 0),e([c()],x.prototype,"listItemCanReceiveFunction",void 0),e([c()],x.prototype,"baseListItemCreatedFunction",null),e([c()],x.prototype,"headingLevel",void 0),e([c()],x.prototype,"icon",null),e([c()],x.prototype,"knowledgeGraphOptions",void 0),e([c()],x.prototype,"label",null),e([c()],x.prototype,"layerTablesEnabled",void 0),e([c()],x.prototype,"mapImageOptions",void 0),e([c(),O("esri/widgets/BasemapLayerList/t9n/BasemapLayerList")],x.prototype,"messages",void 0),e([c(),O("esri/t9n/common")],x.prototype,"messagesCommon",void 0),e([c()],x.prototype,"minFilterItems",void 0),e([c({readOnly:!0})],x.prototype,"openedLayers",void 0),e([c({readOnly:!0})],x.prototype,"openedLayerLists",void 0),e([c()],x.prototype,"referenceListItemCreatedFunction",null),e([c({readOnly:!0})],x.prototype,"tableList",void 0),e([c({readOnly:!0})],x.prototype,"baseItems",null),e([c({readOnly:!0})],x.prototype,"referenceItems",null),e([c({type:R})],x.prototype,"selectedItems",void 0),e([c()],x.prototype,"selectionMode",void 0),e([c()],x.prototype,"tileOptions",void 0),e([c()],x.prototype,"view",null),e([A("trigger-action"),c({type:h})],x.prototype,"viewModel",void 0),e([c()],x.prototype,"visibilityAppearance",void 0),e([c({type:u,nonNullable:!0})],x.prototype,"visibleElements",void 0),x=e([p("esri.widgets.BasemapLayerList")],x);const U=x;export{U as default};
2
+ import{__decorate as e}from"tslib";import t from"../core/Collection.js";import{deprecateWidget as i}from"../core/deprecate.js";import{IdentifiableMixin as s}from"../core/Identifiable.js";import o from"../core/Logger.js";import l from"../core/ReactiveMap.js";import{on as r,initial as a,watch as n,syncAndInitial as d}from"../core/reactiveUtils.js";import{property as c,subclass as p}from"../core/accessorSupport/decorators.js";import m from"./Widget.js";import h from"./BasemapLayerList/BasemapLayerListViewModel.js";import u from"./BasemapLayerList/BasemapLayerListVisibleElements.js";import{css as g}from"./BasemapLayerList/css.js";import f from"./LayerList/LayerListItem.js";import y from"./LayerList/ListItem.js";import{minFilterItems as _,getItem as b,getLayerType as L,removeDestroyedListItems as v,setFilterPredicate as I,sortLayersToIds as w,sortChildLayersToIds as F}from"./LayerList/support/layerListUtils.js";import{loadCalciteComponents as E}from"./support/componentsUtils.js";import{globalCss as C}from"./support/globalCss.js";import{incrementHeadingLevel as T}from"./support/Heading.js";import{calciteListFilterProps as M}from"./support/listUtils.js";import{tsx as P,messageBundle as O,vmEvent as A}from"./support/widget.js";import{setFocus as B}from"./support/widgetUtils.js";const R=t.ofType(y),k="nested",D=".*\\S+.*",j="data-basemap-layer-type";let x=class extends(s(m)){constructor(e,s){super(e,s),this._baseListEl=null,this._referenceListEl=null,this._activeItem=null,this._tooltipReferenceMap=new Map,this._editTitleInput=null,this._focusRootFlowItem=!1,this._focusPanelFlowItem=!1,this._focusLayerFlowItem=null,this._focusEditingFlowItem=!1,this._layerListMap=new l,this._lastDragDetail=null,this._selectedDragItemLayerUid=null,this._rootGroupUid=`basemap-${this.uid}`,this._openedLayersController=null,this.catalogLayerList=null,this.catalogOptions=null,this.collapsed=!1,this.dragEnabled=!1,this.editingTitle=!1,this.filterPlaceholder="",this.baseFilterPredicate=null,this.baseFilterText="",this.referenceFilterPredicate=null,this.referenceFilterText="",this.listItemCanGiveFunction=null,this.listItemCanReceiveFunction=null,this.headingLevel=2,this.knowledgeGraphOptions=null,this.layerTablesEnabled=new t(["knowledge-graph"]),this.mapImageOptions=null,this.messages=null,this.messagesCommon=null,this.minFilterItems=_,this.openedLayers=new t,this.openedLayerLists=new t,this.tableList=null,this.selectedItems=new R,this.selectionMode="none",this.tileOptions=null,this.viewModel=new h,this.visibilityAppearance="default",this.visibleElements=new u,this._canMove=({dragEl:e,fromEl:t,toEl:i},s)=>{const o="pull"===s?this.listItemCanGiveFunction:this.listItemCanReceiveFunction,l=b(e);if(!l?.sortable)return!1;const r=b(t),a=L(t),n=b(i),d=L(i),c=!!a&&!!d&&a===d,p={selected:l,from:r,to:n},m=t.group,h=i.group,u=r?.layer?.type??"",g=n?.layer?.type??"",f=new Set(["map-image","catalog","knowledge-graph"]),y="sublayer";return m&&h&&"function"==typeof o?o.call(null,p):c&&!f.has(u)&&!f.has(g)&&l?.layer?.type!==y},this._onSelectedDragItemLayerUidChange=e=>{this._selectedDragItemLayerUid=e},this._onTriggerAction=(e,t)=>{this.triggerAction(e,t)},this._onTooltipReferenceChange=(e,t)=>{t?this._tooltipReferenceMap.set(e,t):this._tooltipReferenceMap.delete(e)},this._onTablesOpen=e=>{this.openedLayers.push(e.layer),this._focusLayerFlowItem=e.layer?.uid},this._onPanelOpen=()=>{this._focusPanelFlowItem=!0},this._onCatalogOpen=e=>{this.openedLayers.push(e.layer?.parent),this._focusLayerFlowItem=e.layer?.uid},this._clearActiveItem=()=>{this._activeItem=null},this._setActiveItem=e=>{if("default"!==this.visibilityAppearance)return;const t=Array.from(e.composedPath()).find(e=>e.classList?.contains(g.item));this._activeItem=b(t)},this._onCalciteListOrderChange=e=>{const{_lastDragDetail:t}=this,{toEl:i,fromEl:s,dragEl:o,newIndex:l}=e;if(!s||!i||t?.newIndex===l&&t?.dragEl===o&&t?.toEl===i&&t?.fromEl===s)return;this._lastDragDetail=e,this._selectedDragItemLayerUid=o.value;const r=s,a=i;if(r===a){const e=Array.from(s.children).filter(e=>e?.matches("calcite-list-item")).map(e=>e.value);return void this._sortLayers(r,e)}null!=l&&this._moveLayerFromChildList({toEl:a,fromEl:r,dragEl:o,newIndex:l})},this.announceDeprecation=()=>{i(o.getLogger(this),"Basemap Layer List","arcgis-basemap-layer-list",{version:"5.0"})}}initialize(){this.addHandles([r(()=>this.openedLayers,"change",()=>this._handleOpenedLayersChange(),a),n(()=>[this.viewModel.referenceItems.toArray(),this.viewModel.baseItems.toArray()],()=>v(this.selectedItems),d),n(()=>[this.baseFilterPredicate,this._baseListEl],()=>I(this._baseListEl,this.baseFilterPredicate)),n(()=>[this.referenceFilterPredicate,this._referenceListEl],()=>I(this._referenceListEl,this.referenceFilterPredicate))])}loadDependencies(){return E({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),block:()=>import("@esri/calcite-components/dist/components/calcite-block"),label:()=>import("@esri/calcite-components/dist/components/calcite-label"),input:()=>import("@esri/calcite-components/dist/components/calcite-input"),button:()=>import("@esri/calcite-components/dist/components/calcite-button"),flow:()=>import("@esri/calcite-components/dist/components/calcite-flow"),"flow-item":()=>import("@esri/calcite-components/dist/components/calcite-flow-item"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice"),tooltip:()=>import("@esri/calcite-components/dist/components/calcite-tooltip")})}destroy(){this._tooltipReferenceMap.clear(),this._destroyOpenedLayerLists()}get _visibleBaseItems(){return this.baseItems?.filter(e=>!e.hidden&&(this.visibleElements.errors||!e.error))}get _visibleReferenceItems(){return this.referenceItems?.filter(e=>!e.hidden&&(this.visibleElements.errors||!e.error))}get _openedPanelItems(){return this._visibleReferenceItems.concat(this._visibleBaseItems).flatten(e=>e.children).filter(({hidden:e,panel:t})=>!e&&t?.open&&!t.disabled&&t.flowEnabled)}get _totalBaseItems(){return this.viewModel.baseItems.flatten(e=>e.children.filter(e=>"catalog-dynamic-group"!==e.layer?.type)).length}get _totalReferenceItems(){return this.viewModel.referenceItems.flatten(e=>e.children.filter(e=>"catalog-dynamic-group"!==e.layer?.type)).length}get _baseFilterEnabled(){return this._totalBaseItems>=this.minFilterItems&&this.visibleElements.filter}get _referenceFilterEnabled(){return this._totalReferenceItems>=this.minFilterItems&&this.visibleElements.filter}get _renderedOpenLayerFlowItems(){const{openedLayers:e}=this;return e.toArray().map((t,i)=>this._renderLayerFlowItem(t,i===e.length-1))}get basemapTitle(){return this.viewModel.basemapTitle}set basemapTitle(e){this.viewModel.basemapTitle=e}get baseListItemCreatedFunction(){return this.viewModel.baseListItemCreatedFunction}set baseListItemCreatedFunction(e){this.viewModel.baseListItemCreatedFunction=e}get icon(){return"layers"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get referenceListItemCreatedFunction(){return this.viewModel.referenceListItemCreatedFunction}set referenceListItemCreatedFunction(e){this.viewModel.referenceListItemCreatedFunction=e}get baseItems(){return this.viewModel.baseItems}get referenceItems(){return this.viewModel.referenceItems}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}triggerAction(e,t){return this.viewModel.triggerAction(e,t)}render(){const{state:e}=this.viewModel,t={[C.hidden]:"loading"===e,[C.disabled]:"disabled"===e};return P("div",{class:this.classes(g.base,C.widget,C.panel,t)},this._renderItems())}async _createCatalogLayerList(e){const{default:t}=await import("./CatalogLayerList.js"),{headingLevel:i,catalogOptions:s,view:o,filterPlaceholder:l,minFilterItems:r,selectionMode:a,visibilityAppearance:n,_onCatalogOpen:d,_onTablesOpen:c,layerTablesEnabled:p}=this;return new t({headingLevel:i,view:o,filterPlaceholder:l,minFilterItems:r,selectionMode:a,visibilityAppearance:n,...s,catalogLayer:e,layerTablesEnabled:p,onCatalogOpen:d,onTablesOpen:c})}_getTableListParams(e){switch(e.type){case"knowledge-graph":return{...this.knowledgeGraphOptions,tables:e.tables};case"map-image":return{...this.mapImageOptions,tables:e.subtables};case"tile":return{...this.tileOptions,tables:e.subtables};default:return null}}async _createTableList(e){const{default:t}=await import("./TableList.js"),{headingLevel:i,selectionMode:s,dragEnabled:o}=this;return new t({headingLevel:i,selectionMode:s,dragEnabled:o,...this._getTableListParams(e)})}async _createFlowList(e,t){const{_layerListMap:i}=this,s=i.get(e);if(s)return s;const o="catalog"===e.type?await this._createCatalogLayerList(e):await this._createTableList(e);return t.aborted||i.set(e,o),o}async _handleOpenedLayersChange(){const{_layerListMap:e,openedLayers:t,openedLayerLists:i}=this;this._openedLayersController?.abort();const s=new AbortController,{signal:o}=s;this._openedLayersController=s,e.forEach((i,s)=>{t.includes(s)||(i.destroy(),e.delete(s))});const l=await Promise.all(t.map(e=>this._createFlowList(e,o)));if(o.aborted)return;i.removeAll(),i.addMany(l);const r=i.at(-1);r?"catalogLayer"in r?(this._set("catalogLayerList",r),this._set("tableList",null)):(this._set("catalogLayerList",null),this._set("tableList",r)):(this._set("catalogLayerList",null),this._set("tableList",null))}_destroyOpenedLayerLists(){this.openedLayerLists.destroyAll(),this.openedLayers.removeAll(),this._layerListMap.clear()}_renderItemTooltip(e){return e?P("calcite-tooltip",{key:`tooltip-${e.layer?.uid}`,overlayPositioning:"fixed",referenceElement:this._tooltipReferenceMap.get(e.layer?.uid),topLayerDisabled:this.topLayerDisabled},this.messages.layerIncompatibleTooltip):null}_renderItemTooltipNodes(e){return e.incompatible?this._renderItemTooltip(e):e.children?.filter(e=>!e.hidden).toArray().map(e=>this._renderItemTooltipNodes(e))}_renderItemTooltips(){return this._visibleReferenceItems.concat(this._visibleBaseItems)?.toArray().map(e=>this._renderItemTooltipNodes(e))}_focusLayerFlowItemNode(e){this._focusLayerFlowItem===e.dataset.layerUid&&(this._focusLayerFlowItem=null,B(e))}_renderPanelFlowItems(){const{_openedPanelItems:e,openedLayers:t}=this;return e.toArray().map(({title:i,panel:s},o)=>{const l=()=>this._handlePanelFlowItemBack(s);return P("calcite-flow-item",{afterCreate:this._focusPanelFlowItemNode,afterUpdate:this._focusPanelFlowItemNode,bind:this,description:i,heading:s.title,headingLevel:this.headingLevel,key:`flow-panel-${s.uid}`,selected:!t.length&&o===e.length-1,onCalciteFlowItemBack:e=>{e.preventDefault(),l()}},s.render(),P("calcite-button",{appearance:"transparent",slot:"footer-start",width:"full",onclick:l},this.messagesCommon.back))})}_handlePanelFlowItemBack(e){e.open=!1,this._focusRootFlowItem=!0}_focusEditingFlowItemNode(e){this._focusEditingFlowItem&&(this._focusEditingFlowItem=!1,B(e))}_focusRootFlowItemNode(e){this._focusRootFlowItem&&(this._focusRootFlowItem=!1,B(e))}_focusPanelFlowItemNode(e){this._focusPanelFlowItem&&(this._focusPanelFlowItem=!1,B(e))}_renderItem(e,t,i,s){return P(f,{activeItem:this._activeItem,canMove:this._canMove,css:g,displayMode:k,dragDisabled:t,dragEnabled:this.dragEnabled,item:e,key:`layerListItem-${e.layer?.uid}`,layerTablesEnabled:this.layerTablesEnabled,listModeDisabled:this.viewModel.listModeDisabled,messages:this.messages,messagesCommon:this.messagesCommon,parent:i,parentTitles:s,rootGroupUid:this._rootGroupUid,selectedDragItemLayerUid:this._selectedDragItemLayerUid,selectedItems:this.selectedItems,selectionMode:this.selectionMode,visibilityAppearance:this.visibilityAppearance,visibleElements:this.visibleElements,onAction:this._onTriggerAction,onCatalogOpen:this._onCatalogOpen,onPanelOpen:this._onPanelOpen,onSelectedDragItemLayerUidChange:this._onSelectedDragItemLayerUidChange,onTablesOpen:this._onTablesOpen,onTooltipReferenceChange:this._onTooltipReferenceChange})}_moveLayerFromChildList({toEl:e,fromEl:t,dragEl:i,newIndex:s}){const o=b(i),l=b(e),r=b(t),a=N(t),n=N(e);a&&n&&this.viewModel.moveListItem({targetItem:o,fromParentItem:r,toParentItem:l,newIndex:s,from:a,to:n})}_handleCalciteListDragEnd({fromEl:e,dragEl:t,oldIndex:i}){null!=i&&e.insertBefore(t,e.children[i])}_sortLayers(e,t){if(e)if(e===this._referenceListEl||e===this._baseListEl){const i=e===this._referenceListEl?"reference":"base",s="base"===i?this.view?.map?.basemap?.baseLayers:"reference"===i?this.view?.map?.basemap?.referenceLayers:null;w(s,t)}else{const i=b(e);if(!i)return;F(i,t)}}_handleCalciteListChange(e){const{selectionMode:t,selectedItems:i}=this;if("none"===t)return;const s=e.target.selectedItems.map(e=>b(e)).filter(Boolean);i.removeAll(),i.addMany(s)}_renderEditingInput(){const{messages:e}=this,{basemapTitle:t}=this.viewModel;return P("div",{class:g.editing},P("calcite-label",null,e.basemapTitle,P("calcite-input",{afterCreate:e=>this._editTitleInput=e,label:e.basemapTitle,name:"basemaptitle",pattern:D,placeholder:e.basemapTitle,required:!0,title:e.basemapTitle,type:"text",value:t??void 0})))}_renderCancelButton(){const{messagesCommon:{cancel:e}}=this;return P("calcite-button",{appearance:"outline",bind:this,label:e,slot:"footer",title:e,width:"full",onclick:this._toggleEditingTitle},e)}_renderSubmitButton(){const{messagesCommon:e}=this;return P("calcite-button",{label:e.form.submit,slot:"footer",title:e.form.submit,type:"submit",width:"full"},e.form.ok)}_renderEditingForm(){return this.editingTitle?P("form",{bind:this,class:g.editingForm,onsubmit:this._formSubmit},P("calcite-flow-item",{afterCreate:this._focusEditingFlowItemNode,afterUpdate:this._focusEditingFlowItemNode,bind:this,heading:this.visibleElements.heading?this.messages.basemapTitle:void 0,headingLevel:this.headingLevel,selected:0===this.openedLayers.length&&0===this._openedPanelItems.length,onCalciteFlowItemBack:e=>{e.preventDefault(),this._toggleEditingTitle()}},this._renderEditingInput(),this._renderCancelButton(),this._renderSubmitButton())):null}_renderEditTitleButton(){const{editingTitle:e,visibleElements:t,messagesCommon:i}=this,s=i.edit;return t.editTitleButton&&!e?P("calcite-action",{bind:this,icon:"pencil",slot:"header-actions-end",text:s,title:s,onclick:this._toggleEditingTitle}):null}_renderNoLayersInfoMessage(e){return P("div",{slot:"message"},e)}_renderNoLayersInfo(e,t){return P("div",{class:g.itemMessage},P("calcite-notice",{icon:"information",key:t,kind:"info",open:!0,width:"full"},this._renderNoLayersInfoMessage(e)))}_renderItems(){const{collapsed:e,visible:t,visibleElements:{closeButton:i,collapseButton:s,heading:o,flow:l},messages:r,viewModel:a}=this,n=[P("calcite-flow-item",{afterCreate:this._focusRootFlowItemNode,afterUpdate:this._focusRootFlowItemNode,bind:this,closable:i,closed:!t,collapsed:e,collapsible:s,heading:o?a.basemapTitle??r.widgetLabel:void 0,headingLevel:this.headingLevel,key:"root-flow-item",selected:!this.editingTitle&&0===this.openedLayers.length&&0===this._openedPanelItems.length,onCalciteFlowItemClose:()=>this.visible=!1},this._renderEditTitleButton(),this._renderReferenceSection(),this._renderBaseSection()),this._renderEditingForm(),this._renderPanelFlowItems(),this._renderedOpenLayerFlowItems];return t?[l?P("calcite-flow",{key:"root-flow"},n):n,this._renderItemTooltips()]:null}_renderLayerFlowItem(e,t){const{messages:i,openedLayers:s}=this,o=e.title||this.messages.untitledLayer;return P("calcite-flow-item",{afterCreate:this._focusLayerFlowItemNode,afterUpdate:this._focusLayerFlowItemNode,bind:this,"data-layer-uid":e.uid,description:o,heading:i["catalog"===e.type?"catalogLayers":"tables"],headingLevel:this.headingLevel,key:`flow-layer-list-${e.uid}`,selected:t,onCalciteFlowItemBack:e=>{e.preventDefault(),s.pop();const t=s.at(-1);t?this._focusLayerFlowItem=t.uid:this._focusRootFlowItem=!0}},this._layerListMap.get(e)?.render())}_renderList(e,t,i){const{messages:s,dragEnabled:o,selectionMode:l,filterPlaceholder:r,baseFilterText:a,referenceFilterText:n,_baseFilterEnabled:d,_referenceFilterEnabled:c,_rootGroupUid:p}=this,m="reference"===t?s.noReferenceLayers:s.noBaseLayers,h="reference"===t?c:d;return P("calcite-block",{class:g.section,collapsible:!0,expanded:!0,heading:"reference"===t?s.referenceHeading:s.baseHeading,headingLevel:T(this.headingLevel),key:`block-${t}`},e?.length?null:this._renderNoLayersInfo(m,t),P("calcite-list",{afterCreate:e=>{"reference"===t?this._referenceListEl=e:this._baseListEl=e,e.addEventListener("focusin",this._setActiveItem),e.addEventListener("focusout",this._clearActiveItem)},afterRemoved:e=>{"reference"===t?this._referenceListEl=null:this._baseListEl=null,e.removeEventListener("focusin",this._setActiveItem),e.removeEventListener("focusout",this._clearActiveItem)},canPull:e=>this._canMove(e,"pull"),canPut:e=>this._canMove(e,"put"),displayMode:k,filterProps:M,[j]:t,"data-layer-type":p,dragEnabled:o,filterEnabled:h,filterPlaceholder:r,filterText:h?"reference"===t?n:a:"",group:p,key:`list-${t}`,label:s.widgetLabel,selectionAppearance:"border",selectionMode:l,onCalciteListChange:e=>this._handleCalciteListChange(e),onCalciteListDragEnd:e=>this._handleCalciteListDragEnd(e.detail),onCalciteListFilter:e=>this["reference"===t?"referenceFilterText":"baseFilterText"]=e.currentTarget?.filterText??"",onCalciteListOrderChange:e=>this._onCalciteListOrderChange(e.detail),onmouseleave:this._clearActiveItem,onmouseover:this._setActiveItem},e?.toArray().map(e=>this._renderItem(e,i)),h?P("div",{class:g.filterNoResults,slot:"filter-no-results"},P("calcite-notice",{kind:"info",open:!0,width:"full"},this._renderNoLayersInfoMessage(m))):null))}_renderBaseSection(){const{_visibleBaseItems:e}=this;return this.visibleElements.baseLayers?this._renderList(e,"base",1===e?.length):null}_renderReferenceSection(){return this.visibleElements.referenceLayers?this._renderList(this._visibleReferenceItems,"reference",!1):null}_toggleEditingTitle(){const{editingTitle:e}=this,t=!e;this.editingTitle=t,t?this._focusEditingFlowItem=!0:this._focusRootFlowItem=!0}_formSubmit(e){e.preventDefault();const t=this._editTitleInput?.value;t?.trim()&&(this.basemapTitle=t),this._toggleEditingTitle()}};function N(e){return e?.closest(`[${j}]`)?.getAttribute(j)}e([c()],x.prototype,"_baseListEl",void 0),e([c()],x.prototype,"_referenceListEl",void 0),e([c()],x.prototype,"_activeItem",void 0),e([c()],x.prototype,"_tooltipReferenceMap",void 0),e([c()],x.prototype,"_focusRootFlowItem",void 0),e([c()],x.prototype,"_focusPanelFlowItem",void 0),e([c()],x.prototype,"_focusLayerFlowItem",void 0),e([c()],x.prototype,"_focusEditingFlowItem",void 0),e([c()],x.prototype,"_layerListMap",void 0),e([c()],x.prototype,"_visibleBaseItems",null),e([c()],x.prototype,"_visibleReferenceItems",null),e([c()],x.prototype,"_openedPanelItems",null),e([c()],x.prototype,"_totalBaseItems",null),e([c()],x.prototype,"_totalReferenceItems",null),e([c()],x.prototype,"_baseFilterEnabled",null),e([c()],x.prototype,"_referenceFilterEnabled",null),e([c()],x.prototype,"_renderedOpenLayerFlowItems",null),e([c()],x.prototype,"basemapTitle",null),e([c({readOnly:!0})],x.prototype,"catalogLayerList",void 0),e([c()],x.prototype,"catalogOptions",void 0),e([c()],x.prototype,"collapsed",void 0),e([c()],x.prototype,"dragEnabled",void 0),e([c()],x.prototype,"editingTitle",void 0),e([c()],x.prototype,"filterPlaceholder",void 0),e([c()],x.prototype,"baseFilterPredicate",void 0),e([c()],x.prototype,"baseFilterText",void 0),e([c()],x.prototype,"referenceFilterPredicate",void 0),e([c()],x.prototype,"referenceFilterText",void 0),e([c()],x.prototype,"listItemCanGiveFunction",void 0),e([c()],x.prototype,"listItemCanReceiveFunction",void 0),e([c()],x.prototype,"baseListItemCreatedFunction",null),e([c()],x.prototype,"headingLevel",void 0),e([c()],x.prototype,"icon",null),e([c()],x.prototype,"knowledgeGraphOptions",void 0),e([c()],x.prototype,"label",null),e([c()],x.prototype,"layerTablesEnabled",void 0),e([c()],x.prototype,"mapImageOptions",void 0),e([c(),O("esri/widgets/BasemapLayerList/t9n/BasemapLayerList")],x.prototype,"messages",void 0),e([c(),O("esri/t9n/common")],x.prototype,"messagesCommon",void 0),e([c()],x.prototype,"minFilterItems",void 0),e([c({readOnly:!0})],x.prototype,"openedLayers",void 0),e([c({readOnly:!0})],x.prototype,"openedLayerLists",void 0),e([c()],x.prototype,"referenceListItemCreatedFunction",null),e([c({readOnly:!0})],x.prototype,"tableList",void 0),e([c({readOnly:!0})],x.prototype,"baseItems",null),e([c({readOnly:!0})],x.prototype,"referenceItems",null),e([c({type:R})],x.prototype,"selectedItems",void 0),e([c()],x.prototype,"selectionMode",void 0),e([c()],x.prototype,"tileOptions",void 0),e([c()],x.prototype,"view",null),e([A("trigger-action"),c({type:h})],x.prototype,"viewModel",void 0),e([c()],x.prototype,"visibilityAppearance",void 0),e([c({type:u,nonNullable:!0})],x.prototype,"visibleElements",void 0),x=e([p("esri.widgets.BasemapLayerList")],x);const U=x;export{U as default};