@arcgis/core 4.25.0-next.20220920 → 4.25.0-next.20220921

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (460) hide show
  1. package/AggregateGraphic.js +1 -1
  2. package/assets/esri/core/workers/RemoteClient.js +1 -1
  3. package/assets/esri/core/workers/chunks/{9f31ab2247c9defb882c.js → 01ac91fc0bc6b4d4e3c6.js} +1 -1
  4. package/assets/esri/core/workers/chunks/{8588cbecb8e808f451fe.js → 249e32af1f2d433fae4c.js} +1 -1
  5. package/assets/esri/core/workers/chunks/{5b16b30ac3166f33e81e.js → 26690f4ec1f3cb8099c2.js} +1 -1
  6. package/assets/esri/core/workers/chunks/{be93b0cef85665446944.js → 274b4cdf6c8d77e8a2e6.js} +1 -1
  7. package/assets/esri/core/workers/chunks/{d5650f455ce5ba15ad10.js → 2cae0ec5f60ab42a49aa.js} +1 -1
  8. package/assets/esri/core/workers/chunks/{f436c86f86236ea7ea04.js → 4641e10e0e8e9d257521.js} +1 -1
  9. package/assets/esri/core/workers/chunks/{7a45333de9ded92619c2.js → 466008f793c2e11e854c.js} +1 -1
  10. package/assets/esri/core/workers/chunks/{c9d655675552dcf6cef7.js → 4a699b41072ee88f0956.js} +1 -1
  11. package/assets/esri/core/workers/chunks/{14ea96e398f4842abe4e.js → 4fdd18f5cdaa0d82ebc1.js} +1 -1
  12. package/assets/esri/core/workers/chunks/{9662da3e1e37f3445186.js → 562b9619b8ee13734813.js} +1 -1
  13. package/assets/esri/core/workers/chunks/{8bab21bc6164a593278f.js → 771b92e524802de840ba.js} +1 -1
  14. package/assets/esri/core/workers/chunks/{4969b64dc17378d7781f.js → 7ce250cc6fbe68aef50d.js} +3 -3
  15. package/assets/esri/core/workers/chunks/{2c4938512dd726a177dd.js → 7fab18074b130b71a648.js} +1 -1
  16. package/assets/esri/core/workers/chunks/{f67357b3c6c591c9da5e.js → 872f1cb3596fb80e387f.js} +1 -1
  17. package/assets/esri/core/workers/chunks/{31de71018575457155e5.js → 8ee3da8677255b8c8709.js} +1 -1
  18. package/assets/esri/core/workers/chunks/{2e44aee22e70857b893c.js → 93631b10452b0e0189b3.js} +1 -1
  19. package/assets/esri/core/workers/chunks/{cb2dc84d972469445da6.js → 95cd9edca50ea163d50f.js} +1 -1
  20. package/assets/esri/core/workers/chunks/{d31bbb13af45ce8e45dc.js → acf9f753741b677afb44.js} +1 -1
  21. package/assets/esri/core/workers/chunks/{1455944edeba1560eb07.js → afdafa77f5ca1b9e3acc.js} +1 -1
  22. package/assets/esri/core/workers/chunks/{cf3e1ac63580bc495ea6.js → b4da35f1093f3731f9ac.js} +1 -1
  23. package/assets/esri/core/workers/chunks/bb0d86937faf0cd7d16d.js +1 -0
  24. package/assets/esri/core/workers/chunks/bf3e80023e156d5906c7.js +1 -0
  25. package/assets/esri/core/workers/chunks/{8ba83fee56dd4f306d87.js → c2a6ac7046134f725cf3.js} +1 -1
  26. package/assets/esri/core/workers/chunks/{5d3fabe66e1bce1b30fb.js → cc7569489b572b8b3b53.js} +1 -1
  27. package/assets/esri/core/workers/chunks/{fddd4ea487788e003fb1.js → d09f06eb4157a7c2c8ab.js} +1 -1
  28. package/assets/esri/core/workers/chunks/e064035f959d68e9603f.js +1 -0
  29. package/assets/esri/core/workers/chunks/{d92975e56a1290255252.js → e09df62cf35d636b0975.js} +1 -1
  30. package/assets/esri/core/workers/chunks/{674fa5b93704ef08c9e8.js → e0c763e05feb1c2093ba.js} +1 -1
  31. package/assets/esri/core/workers/chunks/{51289d2f5277af4023e9.js → ed33e019bc7775db2e50.js} +1 -1
  32. package/assets/esri/core/workers/chunks/ef95d6ab7b1c032ab4ad.js +1 -0
  33. package/assets/esri/core/workers/chunks/{169f4354a375db5de121.js → ffcbcb928b6cb8c596ad.js} +1 -1
  34. package/assets/esri/t9n/common_ar.json +1 -1
  35. package/assets/esri/t9n/common_bg.json +1 -1
  36. package/assets/esri/t9n/common_bs.json +1 -1
  37. package/assets/esri/t9n/common_ca.json +1 -1
  38. package/assets/esri/t9n/common_cs.json +1 -1
  39. package/assets/esri/t9n/common_da.json +1 -1
  40. package/assets/esri/t9n/common_de.json +1 -1
  41. package/assets/esri/t9n/common_el.json +1 -1
  42. package/assets/esri/t9n/common_es.json +1 -1
  43. package/assets/esri/t9n/common_et.json +1 -1
  44. package/assets/esri/t9n/common_fi.json +1 -1
  45. package/assets/esri/t9n/common_fr.json +1 -1
  46. package/assets/esri/t9n/common_he.json +1 -1
  47. package/assets/esri/t9n/common_hr.json +1 -1
  48. package/assets/esri/t9n/common_hu.json +1 -1
  49. package/assets/esri/t9n/common_id.json +1 -1
  50. package/assets/esri/t9n/common_it.json +1 -1
  51. package/assets/esri/t9n/common_ja.json +1 -1
  52. package/assets/esri/t9n/common_ko.json +1 -1
  53. package/assets/esri/t9n/common_lt.json +1 -1
  54. package/assets/esri/t9n/common_lv.json +1 -1
  55. package/assets/esri/t9n/common_nb.json +1 -1
  56. package/assets/esri/t9n/common_nl.json +1 -1
  57. package/assets/esri/t9n/common_pl.json +1 -1
  58. package/assets/esri/t9n/common_pt-BR.json +1 -1
  59. package/assets/esri/t9n/common_pt-PT.json +1 -1
  60. package/assets/esri/t9n/common_ro.json +1 -1
  61. package/assets/esri/t9n/common_ru.json +1 -1
  62. package/assets/esri/t9n/common_sk.json +1 -1
  63. package/assets/esri/t9n/common_sl.json +1 -1
  64. package/assets/esri/t9n/common_sr.json +1 -1
  65. package/assets/esri/t9n/common_sv.json +1 -1
  66. package/assets/esri/t9n/common_th.json +1 -1
  67. package/assets/esri/t9n/common_tr.json +1 -1
  68. package/assets/esri/t9n/common_uk.json +1 -1
  69. package/assets/esri/t9n/common_vi.json +1 -1
  70. package/assets/esri/t9n/common_zh-CN.json +1 -1
  71. package/assets/esri/t9n/common_zh-HK.json +1 -1
  72. package/assets/esri/t9n/common_zh-TW.json +1 -1
  73. package/assets/esri/widgets/Feature/t9n/Feature_ar.json +1 -1
  74. package/assets/esri/widgets/Feature/t9n/Feature_bg.json +1 -1
  75. package/assets/esri/widgets/Feature/t9n/Feature_bs.json +1 -1
  76. package/assets/esri/widgets/Feature/t9n/Feature_ca.json +1 -1
  77. package/assets/esri/widgets/Feature/t9n/Feature_cs.json +1 -1
  78. package/assets/esri/widgets/Feature/t9n/Feature_da.json +1 -1
  79. package/assets/esri/widgets/Feature/t9n/Feature_de.json +1 -1
  80. package/assets/esri/widgets/Feature/t9n/Feature_el.json +1 -1
  81. package/assets/esri/widgets/Feature/t9n/Feature_es.json +1 -1
  82. package/assets/esri/widgets/Feature/t9n/Feature_et.json +1 -1
  83. package/assets/esri/widgets/Feature/t9n/Feature_fi.json +1 -1
  84. package/assets/esri/widgets/Feature/t9n/Feature_fr.json +1 -1
  85. package/assets/esri/widgets/Feature/t9n/Feature_he.json +1 -1
  86. package/assets/esri/widgets/Feature/t9n/Feature_hr.json +1 -1
  87. package/assets/esri/widgets/Feature/t9n/Feature_hu.json +1 -1
  88. package/assets/esri/widgets/Feature/t9n/Feature_id.json +1 -1
  89. package/assets/esri/widgets/Feature/t9n/Feature_it.json +1 -1
  90. package/assets/esri/widgets/Feature/t9n/Feature_ja.json +1 -1
  91. package/assets/esri/widgets/Feature/t9n/Feature_ko.json +1 -1
  92. package/assets/esri/widgets/Feature/t9n/Feature_lt.json +1 -1
  93. package/assets/esri/widgets/Feature/t9n/Feature_lv.json +1 -1
  94. package/assets/esri/widgets/Feature/t9n/Feature_nb.json +1 -1
  95. package/assets/esri/widgets/Feature/t9n/Feature_nl.json +1 -1
  96. package/assets/esri/widgets/Feature/t9n/Feature_pl.json +1 -1
  97. package/assets/esri/widgets/Feature/t9n/Feature_pt-BR.json +1 -1
  98. package/assets/esri/widgets/Feature/t9n/Feature_pt-PT.json +1 -1
  99. package/assets/esri/widgets/Feature/t9n/Feature_ro.json +1 -1
  100. package/assets/esri/widgets/Feature/t9n/Feature_ru.json +1 -1
  101. package/assets/esri/widgets/Feature/t9n/Feature_sk.json +1 -1
  102. package/assets/esri/widgets/Feature/t9n/Feature_sl.json +1 -1
  103. package/assets/esri/widgets/Feature/t9n/Feature_sr.json +1 -1
  104. package/assets/esri/widgets/Feature/t9n/Feature_sv.json +1 -1
  105. package/assets/esri/widgets/Feature/t9n/Feature_th.json +1 -1
  106. package/assets/esri/widgets/Feature/t9n/Feature_tr.json +1 -1
  107. package/assets/esri/widgets/Feature/t9n/Feature_uk.json +1 -1
  108. package/assets/esri/widgets/Feature/t9n/Feature_vi.json +1 -1
  109. package/assets/esri/widgets/Feature/t9n/Feature_zh-CN.json +1 -1
  110. package/assets/esri/widgets/Feature/t9n/Feature_zh-HK.json +1 -1
  111. package/assets/esri/widgets/Feature/t9n/Feature_zh-TW.json +1 -1
  112. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ar.json +1 -1
  113. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_bg.json +1 -1
  114. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_bs.json +1 -1
  115. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ca.json +1 -1
  116. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_cs.json +1 -1
  117. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_da.json +1 -1
  118. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_de.json +1 -1
  119. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_el.json +1 -1
  120. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_es.json +1 -1
  121. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_et.json +1 -1
  122. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_fi.json +1 -1
  123. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_fr.json +1 -1
  124. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_he.json +1 -1
  125. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_hr.json +1 -1
  126. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_hu.json +1 -1
  127. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_id.json +1 -1
  128. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_it.json +1 -1
  129. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ja.json +1 -1
  130. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ko.json +1 -1
  131. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_lt.json +1 -1
  132. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_lv.json +1 -1
  133. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_nb.json +1 -1
  134. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_nl.json +1 -1
  135. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_pl.json +1 -1
  136. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_pt-BR.json +1 -1
  137. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_pt-PT.json +1 -1
  138. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ro.json +1 -1
  139. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ru.json +1 -1
  140. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sk.json +1 -1
  141. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sl.json +1 -1
  142. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sr.json +1 -1
  143. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sv.json +1 -1
  144. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_th.json +1 -1
  145. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_tr.json +1 -1
  146. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_uk.json +1 -1
  147. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_vi.json +1 -1
  148. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_zh-CN.json +1 -1
  149. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_zh-HK.json +1 -1
  150. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_zh-TW.json +1 -1
  151. package/assets/esri/widgets/Popup/t9n/Popup_ar.json +1 -1
  152. package/assets/esri/widgets/Popup/t9n/Popup_bg.json +1 -1
  153. package/assets/esri/widgets/Popup/t9n/Popup_bs.json +1 -1
  154. package/assets/esri/widgets/Popup/t9n/Popup_ca.json +1 -1
  155. package/assets/esri/widgets/Popup/t9n/Popup_cs.json +1 -1
  156. package/assets/esri/widgets/Popup/t9n/Popup_da.json +1 -1
  157. package/assets/esri/widgets/Popup/t9n/Popup_de.json +1 -1
  158. package/assets/esri/widgets/Popup/t9n/Popup_el.json +1 -1
  159. package/assets/esri/widgets/Popup/t9n/Popup_es.json +1 -1
  160. package/assets/esri/widgets/Popup/t9n/Popup_et.json +1 -1
  161. package/assets/esri/widgets/Popup/t9n/Popup_fi.json +1 -1
  162. package/assets/esri/widgets/Popup/t9n/Popup_fr.json +1 -1
  163. package/assets/esri/widgets/Popup/t9n/Popup_he.json +1 -1
  164. package/assets/esri/widgets/Popup/t9n/Popup_hr.json +1 -1
  165. package/assets/esri/widgets/Popup/t9n/Popup_hu.json +1 -1
  166. package/assets/esri/widgets/Popup/t9n/Popup_id.json +1 -1
  167. package/assets/esri/widgets/Popup/t9n/Popup_it.json +1 -1
  168. package/assets/esri/widgets/Popup/t9n/Popup_ja.json +1 -1
  169. package/assets/esri/widgets/Popup/t9n/Popup_ko.json +1 -1
  170. package/assets/esri/widgets/Popup/t9n/Popup_lt.json +1 -1
  171. package/assets/esri/widgets/Popup/t9n/Popup_lv.json +1 -1
  172. package/assets/esri/widgets/Popup/t9n/Popup_nb.json +1 -1
  173. package/assets/esri/widgets/Popup/t9n/Popup_nl.json +1 -1
  174. package/assets/esri/widgets/Popup/t9n/Popup_pl.json +1 -1
  175. package/assets/esri/widgets/Popup/t9n/Popup_pt-BR.json +1 -1
  176. package/assets/esri/widgets/Popup/t9n/Popup_pt-PT.json +1 -1
  177. package/assets/esri/widgets/Popup/t9n/Popup_ro.json +1 -1
  178. package/assets/esri/widgets/Popup/t9n/Popup_ru.json +1 -1
  179. package/assets/esri/widgets/Popup/t9n/Popup_sk.json +1 -1
  180. package/assets/esri/widgets/Popup/t9n/Popup_sl.json +1 -1
  181. package/assets/esri/widgets/Popup/t9n/Popup_sr.json +1 -1
  182. package/assets/esri/widgets/Popup/t9n/Popup_sv.json +1 -1
  183. package/assets/esri/widgets/Popup/t9n/Popup_th.json +1 -1
  184. package/assets/esri/widgets/Popup/t9n/Popup_tr.json +1 -1
  185. package/assets/esri/widgets/Popup/t9n/Popup_uk.json +1 -1
  186. package/assets/esri/widgets/Popup/t9n/Popup_vi.json +1 -1
  187. package/assets/esri/widgets/Popup/t9n/Popup_zh-CN.json +1 -1
  188. package/assets/esri/widgets/Popup/t9n/Popup_zh-HK.json +1 -1
  189. package/assets/esri/widgets/Popup/t9n/Popup_zh-TW.json +1 -1
  190. package/assets/esri/widgets/support/t9n/DatePicker_ar.json +1 -1
  191. package/assets/esri/widgets/support/t9n/DatePicker_bg.json +1 -1
  192. package/assets/esri/widgets/support/t9n/DatePicker_bs.json +1 -1
  193. package/assets/esri/widgets/support/t9n/DatePicker_ca.json +1 -1
  194. package/assets/esri/widgets/support/t9n/DatePicker_cs.json +1 -1
  195. package/assets/esri/widgets/support/t9n/DatePicker_da.json +1 -1
  196. package/assets/esri/widgets/support/t9n/DatePicker_de.json +1 -1
  197. package/assets/esri/widgets/support/t9n/DatePicker_el.json +1 -1
  198. package/assets/esri/widgets/support/t9n/DatePicker_es.json +1 -1
  199. package/assets/esri/widgets/support/t9n/DatePicker_et.json +1 -1
  200. package/assets/esri/widgets/support/t9n/DatePicker_fi.json +1 -1
  201. package/assets/esri/widgets/support/t9n/DatePicker_fr.json +1 -1
  202. package/assets/esri/widgets/support/t9n/DatePicker_he.json +1 -1
  203. package/assets/esri/widgets/support/t9n/DatePicker_hr.json +1 -1
  204. package/assets/esri/widgets/support/t9n/DatePicker_hu.json +1 -1
  205. package/assets/esri/widgets/support/t9n/DatePicker_id.json +1 -1
  206. package/assets/esri/widgets/support/t9n/DatePicker_it.json +1 -1
  207. package/assets/esri/widgets/support/t9n/DatePicker_ja.json +1 -1
  208. package/assets/esri/widgets/support/t9n/DatePicker_ko.json +1 -1
  209. package/assets/esri/widgets/support/t9n/DatePicker_lt.json +1 -1
  210. package/assets/esri/widgets/support/t9n/DatePicker_lv.json +1 -1
  211. package/assets/esri/widgets/support/t9n/DatePicker_nb.json +1 -1
  212. package/assets/esri/widgets/support/t9n/DatePicker_nl.json +1 -1
  213. package/assets/esri/widgets/support/t9n/DatePicker_pl.json +1 -1
  214. package/assets/esri/widgets/support/t9n/DatePicker_pt-BR.json +1 -1
  215. package/assets/esri/widgets/support/t9n/DatePicker_pt-PT.json +1 -1
  216. package/assets/esri/widgets/support/t9n/DatePicker_ro.json +1 -1
  217. package/assets/esri/widgets/support/t9n/DatePicker_ru.json +1 -1
  218. package/assets/esri/widgets/support/t9n/DatePicker_sk.json +1 -1
  219. package/assets/esri/widgets/support/t9n/DatePicker_sl.json +1 -1
  220. package/assets/esri/widgets/support/t9n/DatePicker_sr.json +1 -1
  221. package/assets/esri/widgets/support/t9n/DatePicker_sv.json +1 -1
  222. package/assets/esri/widgets/support/t9n/DatePicker_th.json +1 -1
  223. package/assets/esri/widgets/support/t9n/DatePicker_tr.json +1 -1
  224. package/assets/esri/widgets/support/t9n/DatePicker_uk.json +1 -1
  225. package/assets/esri/widgets/support/t9n/DatePicker_vi.json +1 -1
  226. package/assets/esri/widgets/support/t9n/DatePicker_zh-CN.json +1 -1
  227. package/assets/esri/widgets/support/t9n/DatePicker_zh-HK.json +1 -1
  228. package/assets/esri/widgets/support/t9n/DatePicker_zh-TW.json +1 -1
  229. package/assets/esri/widgets/support/t9n/TimePicker_ar.json +1 -1
  230. package/assets/esri/widgets/support/t9n/TimePicker_bg.json +1 -1
  231. package/assets/esri/widgets/support/t9n/TimePicker_bs.json +1 -1
  232. package/assets/esri/widgets/support/t9n/TimePicker_ca.json +1 -1
  233. package/assets/esri/widgets/support/t9n/TimePicker_cs.json +1 -1
  234. package/assets/esri/widgets/support/t9n/TimePicker_da.json +1 -1
  235. package/assets/esri/widgets/support/t9n/TimePicker_de.json +1 -1
  236. package/assets/esri/widgets/support/t9n/TimePicker_el.json +1 -1
  237. package/assets/esri/widgets/support/t9n/TimePicker_es.json +1 -1
  238. package/assets/esri/widgets/support/t9n/TimePicker_et.json +1 -1
  239. package/assets/esri/widgets/support/t9n/TimePicker_fi.json +1 -1
  240. package/assets/esri/widgets/support/t9n/TimePicker_fr.json +1 -1
  241. package/assets/esri/widgets/support/t9n/TimePicker_he.json +1 -1
  242. package/assets/esri/widgets/support/t9n/TimePicker_hr.json +1 -1
  243. package/assets/esri/widgets/support/t9n/TimePicker_hu.json +1 -1
  244. package/assets/esri/widgets/support/t9n/TimePicker_id.json +1 -1
  245. package/assets/esri/widgets/support/t9n/TimePicker_it.json +1 -1
  246. package/assets/esri/widgets/support/t9n/TimePicker_ja.json +1 -1
  247. package/assets/esri/widgets/support/t9n/TimePicker_ko.json +1 -1
  248. package/assets/esri/widgets/support/t9n/TimePicker_lt.json +1 -1
  249. package/assets/esri/widgets/support/t9n/TimePicker_lv.json +1 -1
  250. package/assets/esri/widgets/support/t9n/TimePicker_nb.json +1 -1
  251. package/assets/esri/widgets/support/t9n/TimePicker_nl.json +1 -1
  252. package/assets/esri/widgets/support/t9n/TimePicker_pl.json +1 -1
  253. package/assets/esri/widgets/support/t9n/TimePicker_pt-BR.json +1 -1
  254. package/assets/esri/widgets/support/t9n/TimePicker_pt-PT.json +1 -1
  255. package/assets/esri/widgets/support/t9n/TimePicker_ro.json +1 -1
  256. package/assets/esri/widgets/support/t9n/TimePicker_ru.json +1 -1
  257. package/assets/esri/widgets/support/t9n/TimePicker_sk.json +1 -1
  258. package/assets/esri/widgets/support/t9n/TimePicker_sl.json +1 -1
  259. package/assets/esri/widgets/support/t9n/TimePicker_sr.json +1 -1
  260. package/assets/esri/widgets/support/t9n/TimePicker_sv.json +1 -1
  261. package/assets/esri/widgets/support/t9n/TimePicker_th.json +1 -1
  262. package/assets/esri/widgets/support/t9n/TimePicker_tr.json +1 -1
  263. package/assets/esri/widgets/support/t9n/TimePicker_uk.json +1 -1
  264. package/assets/esri/widgets/support/t9n/TimePicker_vi.json +1 -1
  265. package/assets/esri/widgets/support/t9n/TimePicker_zh-CN.json +1 -1
  266. package/assets/esri/widgets/support/t9n/TimePicker_zh-HK.json +1 -1
  267. package/assets/esri/widgets/support/t9n/TimePicker_zh-TW.json +1 -1
  268. package/chunks/Compositing.glsl.js +4 -19
  269. package/chunks/HUDCompositing.glsl.js +7 -0
  270. package/chunks/Laserlines.glsl.js +5 -5
  271. package/chunks/OITCompositing.glsl.js +13 -0
  272. package/chunks/OverlayCompositing.glsl.js +8 -0
  273. package/chunks/Precipitation.glsl.js +1 -1
  274. package/chunks/ShadowHighlight.glsl.js +1 -1
  275. package/chunks/boundedPlane.js +1 -1
  276. package/chunks/cameraUtilsPlanar.js +1 -1
  277. package/chunks/cameraUtilsSpherical.js +1 -1
  278. package/chunks/mat3.js +1 -1
  279. package/chunks/quat.js +1 -1
  280. package/chunks/quat2.js +1 -1
  281. package/chunks/quatf64.js +1 -1
  282. package/chunks/sphere.js +1 -1
  283. package/chunks/vec3.js +1 -1
  284. package/chunks/vec3f32.js +1 -1
  285. package/chunks/vec4f64.js +1 -1
  286. package/core/VectorStack.js +1 -1
  287. package/core/libs/gl-matrix-2/factories/quatf64.js +1 -1
  288. package/core/libs/gl-matrix-2/factories/vec3f32.js +1 -1
  289. package/core/libs/gl-matrix-2/factories/vec4f64.js +1 -1
  290. package/core/libs/gl-matrix-2/math/mat3.js +1 -1
  291. package/core/libs/gl-matrix-2/math/quat.js +1 -1
  292. package/core/libs/gl-matrix-2/math/vec3.js +1 -1
  293. package/core/perspectiveUtils.js +1 -1
  294. package/geohash/GeohashTree.js +1 -1
  295. package/geometry/support/MeshTransform.js +1 -1
  296. package/geometry/support/axisAngle.js +1 -1
  297. package/geometry/support/axisAngleDegrees.js +1 -1
  298. package/geometry/support/lineSegment.js +1 -1
  299. package/geometry/support/meshUtils/exporters/gltf/gltf.js +1 -1
  300. package/geometry/support/meshUtils/exporters/gltf/node.js +1 -1
  301. package/geometry/support/meshUtils/georeference.js +1 -1
  302. package/geometry/support/meshUtils/loadGLTFMesh.js +1 -1
  303. package/geometry/support/meshUtils/projection.js +1 -1
  304. package/geometry/support/meshUtils/rotate.js +1 -1
  305. package/geometry/support/plane.js +1 -1
  306. package/interfaces.d.ts +70 -0
  307. package/layers/buildingSublayers/BuildingComponentSublayer.js +1 -1
  308. package/layers/graphics/featureConversionUtils.js +1 -1
  309. package/layers/mixins/EditBusLayer.js +1 -1
  310. package/layers/support/AggregateField.js +1 -1
  311. package/layers/support/ControlPointsGeoreference.js +1 -1
  312. package/layers/support/OutStatistic.js +1 -1
  313. package/layers/support/VoxelVolume.js +1 -1
  314. package/layers/support/voxelPlaneUtils.js +1 -1
  315. package/package.json +1 -1
  316. package/rest/support/AggregateFeatureSet.js +5 -0
  317. package/support/revision.js +1 -1
  318. package/views/2d/ViewState.js +1 -1
  319. package/views/2d/engine/flow/FlowDisplayObject.js +1 -1
  320. package/views/2d/engine/imagery/RasterVFTile.js +1 -1
  321. package/views/2d/engine/vectorTiles/VectorTile.js +1 -1
  322. package/views/2d/engine/webgl/OverlayContainer.js +1 -1
  323. package/views/2d/engine/webgl/TiledDisplayObject.js +1 -1
  324. package/views/2d/engine/webgl/WGLTile.js +1 -1
  325. package/views/2d/engine/webgl/WorldExtentClipRenderer.js +1 -1
  326. package/views/2d/layers/FeatureLayerView2D.js +1 -1
  327. package/views/2d/layers/features/controllers/FeatureController2D.js +1 -1
  328. package/views/2d/layers/features/schemaUtils.js +1 -1
  329. package/views/2d/layers/features/support/BinStore.js +1 -1
  330. package/views/2d/layers/features/support/ClusterStore.js +1 -1
  331. package/views/2d/layers/graphics/GraphicBoundsRenderer.js +1 -1
  332. package/views/2d/layers/support/DebugOverlay.js +1 -1
  333. package/views/2d/layers/support/FeatureLayerProxy.js +1 -1
  334. package/views/2d/layers/support/clusterUtils.js +1 -1
  335. package/views/3d/analysis/AreaMeasurement/support/MeasurementData.js +1 -1
  336. package/views/3d/analysis/Dimensioning/LengthDimensionSubTool.js +1 -1
  337. package/views/3d/analysis/Dimensioning/LengthDimensionVisualization.js +1 -1
  338. package/views/3d/analysis/Dimensioning/lengthDimensionUtils.js +1 -1
  339. package/views/3d/analysis/LineOfSight/LineOfSightController.js +1 -1
  340. package/views/3d/analysis/Slice/SliceTool.js +1 -1
  341. package/views/3d/analysis/Slice/sliceToolConfig.js +1 -1
  342. package/views/3d/analysis/Slice/sliceToolUtils.js +1 -1
  343. package/views/3d/camera/constraintUtils/distance.js +1 -1
  344. package/views/3d/camera/constraintUtils/tilt.js +1 -1
  345. package/views/3d/environment/PanoramicAtmosphere.js +1 -1
  346. package/views/3d/environment/SceneViewEnvironmentManager.js +1 -1
  347. package/views/3d/environment/SimpleAtmosphere.js +1 -1
  348. package/views/3d/glTF/internal/Resource.js +1 -1
  349. package/views/3d/interactive/Manipulator3D.js +1 -1
  350. package/views/3d/interactive/editingTools/reshapeGraphic/edgeOffsetUtils.js +1 -1
  351. package/views/3d/interactive/editingTools/settings.js +1 -1
  352. package/views/3d/interactive/editingTools/transformGraphic/ExtentTransformTool.js +1 -1
  353. package/views/3d/interactive/editingTools/transformGraphic/GraphicScaleRotateTransform.js +1 -1
  354. package/views/3d/interactive/manipulatorUtils.js +1 -1
  355. package/views/3d/interactive/visualElements/ExtendedLineVisualElement.js +1 -1
  356. package/views/3d/interactive/visualElements/LineVisualElement.js +1 -1
  357. package/views/3d/interactive/visualElements/ParallelLineVisualElement.js +1 -1
  358. package/views/3d/layers/BuildingComponentSublayerView3D.js +1 -1
  359. package/views/3d/layers/I3SMeshView3D.js +1 -1
  360. package/views/3d/layers/PointCloudLayerView3D.js +1 -1
  361. package/views/3d/layers/PointCloudWorker.js +1 -1
  362. package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
  363. package/views/3d/layers/graphics/Deconflictor.js +1 -1
  364. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  365. package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
  366. package/views/3d/layers/graphics/Graphics3DFeatureProcessor.js +1 -1
  367. package/views/3d/layers/graphics/Graphics3DLodInstanceGraphicLayer.js +1 -1
  368. package/views/3d/layers/graphics/Graphics3DObject3DGraphicLayer.js +1 -1
  369. package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
  370. package/views/3d/layers/graphics/Graphics3DPathSymbolLayer.js +1 -1
  371. package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
  372. package/views/3d/layers/i3s/I3SElevationProvider.js +1 -1
  373. package/views/3d/layers/i3s/I3SIndex.js +1 -1
  374. package/views/3d/layers/i3s/I3SUtil.js +1 -1
  375. package/views/3d/layers/i3s/I3SViewportQueries.js +1 -1
  376. package/views/3d/layers/i3s/PointRenderer.js +1 -1
  377. package/views/3d/layers/support/FeatureTileVisibility3D.js +1 -1
  378. package/views/3d/layers/support/I3STreeDebugger.js +1 -1
  379. package/views/3d/layers/support/edgeUtils.js +1 -1
  380. package/views/3d/layers/support/uvUtils.js +1 -1
  381. package/views/3d/state/Frustum.js +1 -1
  382. package/views/3d/state/controllers/GamepadKeyboardController.js +1 -1
  383. package/views/3d/state/controllers/RotateController.js +1 -1
  384. package/views/3d/state/controllers/global/PinchAndPanController.js +1 -1
  385. package/views/3d/state/controllers/local/PinchAndPanController.js +1 -1
  386. package/views/3d/state/controllers/local/ZoomController.js +1 -1
  387. package/views/3d/state/controllers/momentum/ZoomPlanarMomentumController.js +1 -1
  388. package/views/3d/state/utils/navigationUtils.js +1 -1
  389. package/views/3d/support/FrustumExtentIntersection.js +1 -1
  390. package/views/3d/support/orientedBoundingBox.js +1 -1
  391. package/views/3d/support/pointsOfInterest/CameraOnSurface.js +1 -1
  392. package/views/3d/support/pointsOfInterest/CenterOnSurface.js +1 -1
  393. package/views/3d/support/pointsOfInterest/PointsOfInterest.js +1 -1
  394. package/views/3d/support/sunUtils.js +1 -1
  395. package/views/3d/terrain/OverlayRenderer.js +1 -1
  396. package/views/3d/terrain/PatchRenderData.js +1 -1
  397. package/views/3d/terrain/TerrainSurface.js +1 -1
  398. package/views/3d/terrain/Tile.js +1 -1
  399. package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
  400. package/views/3d/webgl-engine/collections/Component/DepthRange.js +1 -1
  401. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  402. package/views/3d/webgl-engine/core/renderPasses/RenderPassManager.js +1 -1
  403. package/views/3d/webgl-engine/core/shaderLibrary/Slice.glsl.js +1 -1
  404. package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexPosition.glsl.js +2 -2
  405. package/views/3d/webgl-engine/core/shaderTechnique/ShaderTechniqueRepository.js +1 -1
  406. package/views/3d/webgl-engine/core/util/TwoVectorPosition.js +1 -1
  407. package/views/3d/webgl-engine/lib/Camera.js +1 -1
  408. package/views/3d/webgl-engine/lib/CompositingHelper.js +1 -1
  409. package/views/3d/webgl-engine/lib/GeometryRecord.js +1 -1
  410. package/views/3d/webgl-engine/lib/GeometryUtil.js +1 -1
  411. package/views/3d/webgl-engine/lib/Highlight.js +1 -1
  412. package/views/3d/webgl-engine/lib/Intersector.js +1 -1
  413. package/views/3d/webgl-engine/lib/Object3D.js +1 -1
  414. package/views/3d/webgl-engine/lib/ObjectAndLayerIdRenderHelper.js +1 -1
  415. package/views/3d/webgl-engine/lib/OffscreenRendering.js +1 -1
  416. package/views/3d/webgl-engine/lib/RenderGeometry.js +1 -1
  417. package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
  418. package/views/3d/webgl-engine/lib/depthRangeUtils.js +1 -1
  419. package/views/3d/webgl-engine/lib/edgeRendering/EdgeRenderer.js +1 -1
  420. package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
  421. package/views/3d/webgl-engine/lib/edgeRendering/edgePreprocessing.js +1 -1
  422. package/views/3d/webgl-engine/lib/lodRendering/InstanceData.js +1 -1
  423. package/views/3d/webgl-engine/lib/lodRendering/InstanceOctree.js +1 -1
  424. package/views/3d/webgl-engine/lib/lodRendering/LodRenderer.js +1 -1
  425. package/views/3d/webgl-engine/lib/pathGeometryUtils.js +1 -1
  426. package/views/3d/webgl-engine/lib/verticalOffsetUtils.js +1 -1
  427. package/views/3d/webgl-engine/lighting/SphericalHarmonics.js +1 -1
  428. package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
  429. package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
  430. package/views/3d/webgl-engine/materials/MeasurementArrowMaterial.js +1 -1
  431. package/views/3d/webgl-engine/materials/NativeLineMaterial.js +1 -1
  432. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  433. package/views/3d/webgl-engine/shaders/Compositing.glsl.js +1 -1
  434. package/views/3d/webgl-engine/shaders/CompositingTechnique.js +1 -1
  435. package/views/3d/webgl-engine/shaders/CompositingTechniqueConfiguration.js +1 -1
  436. package/views/3d/webgl-engine/shaders/HUDCompositing.glsl.js +5 -0
  437. package/views/3d/webgl-engine/shaders/HUDCompositingTechnique.js +5 -0
  438. package/views/3d/webgl-engine/shaders/OITCompositing.glsl.js +5 -0
  439. package/views/3d/webgl-engine/shaders/OITCompositingTechnique.js +5 -0
  440. package/views/3d/webgl-engine/shaders/OverlayCompositing.glsl.js +5 -0
  441. package/views/3d/webgl-engine/shaders/OverlayCompositingTechnique.js +5 -0
  442. package/views/draw/support/surfaceCoordinateSystems.js +1 -1
  443. package/views/interactive/coordinateHelper.js +1 -1
  444. package/views/interactive/editGeometry/operations/OffsetEdgeVertex.js +1 -1
  445. package/views/interactive/editGeometry/support/editPlaneUtils.js +1 -1
  446. package/views/interactive/snapping/RightAngleSnapper.js +1 -1
  447. package/views/interactive/snapping/featureSources/sceneLayerSource/SceneLayerSnappingSourceWorker.js +1 -1
  448. package/views/layers/FeatureLayerView.js +1 -1
  449. package/views/navigation/PanSphericalMomentumEstimator.js +1 -1
  450. package/views/support/Scheduler.js +1 -1
  451. package/views/support/euclideanAreaMeasurementUtils.js +1 -1
  452. package/views/support/geometry3dUtils.js +1 -1
  453. package/widgets/ElevationProfile/support/ProfileLines3D.js +1 -1
  454. package/widgets/ElevationProfile/support/constants.js +1 -1
  455. package/widgets/Feature/FeatureRelationship/FeatureRelationshipViewModel.js +1 -1
  456. package/widgets/Feature/FeatureRelationship.js +1 -1
  457. package/assets/esri/core/workers/chunks/0059699bf824f851d51c.js +0 -1
  458. package/assets/esri/core/workers/chunks/36dd5654df5c7f00406d.js +0 -1
  459. package/assets/esri/core/workers/chunks/de128d8a643b4297940b.js +0 -1
  460. package/assets/esri/core/workers/chunks/e00327925ca82b63fded.js +0 -1
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.25/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../chunks/tslib.es6.js";import{JSONSupport as i}from"../../core/JSONSupport.js";import s from"../../core/Logger.js";import{property as r}from"../../core/accessorSupport/decorators/property.js";import"../../core/arrayUtils.js";import"../../core/has.js";import"../../core/accessorSupport/ensureType.js";import{subclass as t}from"../../core/accessorSupport/decorators/subclass.js";import{b as n,C as o,B as a,a as p}from"../../chunks/vec3.js";import{f as l,d as u}from"../../chunks/vec3f64.js";import m from"../../geometry/Point.js";import c from"../../geometry/SpatialReference.js";import{equals as h}from"../../geometry/support/spatialReferenceUtils.js";import g from"./VoxelDimension.js";const d="esri.layers.support.VoxelVolume",y=s.getLogger(d);let f=class extends i{constructor(e){super(e),this.id=0,this.dimensions=null,this.spatialReference=c.WGS84}get zDimension(){if(!this.dimensions)return-1;if(!Array.isArray(this.dimensions))return-1;if(4!==this.dimensions.length)return-1;for(let e=2;e<4;++e)if(this.dimensions[e].size>0)return e;return-1}get isValid(){return!!this.dimensions&&(!!Array.isArray(this.dimensions)&&(4===this.dimensions.length&&(!(this.dimensions[0].size<1||this.dimensions[1].size<1)&&!(-1===this.zDimension||this.dimensions[this.zDimension].size<1))))}get originInLayerSpace3D(){if(!this.isValid||"xyt"===this.volumeType)return[0,0,0];const e=this.dimensions[0].getRange(),i=this.dimensions[1].getRange(),s=this.dimensions[2],r=s.isRegular?s.getRange():[0,s.size];return[e[0],i[0],r[0]]}get voxelSizeInLayerSpaceSigned(){if(!this.isValid||"xyt"===this.volumeType)return[0,0,0];const e=this.dimensions[0].getRange(),i=this.dimensions[1].getRange(),s=this.dimensions[2],r=s.isRegular?s.getRange():[0,s.size],t=[this.sizeInVoxels[0],this.sizeInVoxels[1],this.sizeInVoxels[2]];for(let n=0;n<3;++n)t[n]<2?t[n]=1:t[n]-=1;return s.isRegular&&!s.isPositiveUp&&(t[2]*=-1),[(e[1]-e[0])/t[0],(i[1]-i[0])/t[1],(r[1]-r[0])/t[2]]}get volumeType(){if(this.isValid){const e=this.dimensions[2].size>0,i=this.dimensions[3].size>0;if(!e&&i)return"xyt";if(e&&i)return"xyzt"}return"xyz"}get sizeInVoxels(){if(!this.isValid)return[0,0,0];const e=this.zDimension;return[this.dimensions[0].size,this.dimensions[1].size,this.dimensions[e].size]}computeVoxelSpaceLocation(e){if(!this.isValid)return[0,0,0];if("xyt"===this.volumeType)return y.error("computeVoxelSpacePosition cannot be used with XYT volumes."),[0,0,0];if(!h(this.spatialReference,e.spatialReference))return y.error("pos argument should have the same spatial reference as the VoxelLayer."),[0,0,0];const i=l(e.x,e.y,e.z??0);n(i,i,this.originInLayerSpace3D),o(i,i,this.voxelSizeInLayerSpaceSigned);const s=this.dimensions[this.zDimension];if(!s.isRegular&&Array.isArray(s.irregularSpacing?.values)&&s.irregularSpacing.values.length>1){const r=e.z??0,t=s.irregularSpacing.values,n=s.isPositiveUp?1:-1,o=t.reduce(((e,i)=>Math.abs(n*i-r)<Math.abs(n*e-r)?i:e));for(let e=0;e<t.length;++e)if(t[e]===o){i[2]=e;break}}return[i[0],i[1],i[2]]}computeLayerSpaceLocation(e){if(!this.isValid)return new m({x:0,y:0,spatialReference:this.spatialReference});const i=u(e);if(a(i,i,this.voxelSizeInLayerSpaceSigned),p(i,i,this.originInLayerSpace3D),"xyt"===this.volumeType)return new m({x:i[0],y:i[1],spatialReference:this.spatialReference});const s=this.dimensions[this.zDimension];return s.isRegular||Array.isArray(s.irregularSpacing?.values)&&(e[2]<0?i[2]=s.irregularSpacing.values[0]:e[2]<s.irregularSpacing.values.length?i[2]=s.irregularSpacing.values[e[2]]:i[2]=s.irregularSpacing.values[s.irregularSpacing.values.length-1],s.isPositiveUp||(i[2]*=-1)),new m({x:i[0],y:i[1],z:i[2],spatialReference:this.spatialReference})}};e([r({type:Number,json:{write:{enabled:!0,isRequired:!0}}})],f.prototype,"id",void 0),e([r({type:[g],json:{write:{enabled:!0,isRequired:!0}}})],f.prototype,"dimensions",void 0),e([r({type:c,json:{read:{enabled:!1}}})],f.prototype,"spatialReference",void 0),e([r({type:[Number],json:{read:!1}})],f.prototype,"zDimension",null),e([r({type:[Boolean],json:{read:!1}})],f.prototype,"isValid",null),e([r({type:[Number],json:{read:!1}})],f.prototype,"originInLayerSpace3D",null),e([r({type:[Number],json:{read:!1}})],f.prototype,"voxelSizeInLayerSpaceSigned",null),e([r({type:["xyz","xyzt","xyt"],json:{read:{enabled:!1}}})],f.prototype,"volumeType",null),e([r({type:[Number],json:{read:!1}})],f.prototype,"sizeInVoxels",null),f=e([t(d)],f);const S=f;export{S as default};
5
+ import{_ as e}from"../../chunks/tslib.es6.js";import{JSONSupport as i}from"../../core/JSONSupport.js";import s from"../../core/Logger.js";import{property as r}from"../../core/accessorSupport/decorators/property.js";import"../../core/arrayUtils.js";import"../../core/has.js";import"../../core/accessorSupport/ensureType.js";import{subclass as t}from"../../core/accessorSupport/decorators/subclass.js";import{b as n,C as o,u as a,a as p}from"../../chunks/vec3.js";import{f as l,d as u}from"../../chunks/vec3f64.js";import m from"../../geometry/Point.js";import c from"../../geometry/SpatialReference.js";import{equals as h}from"../../geometry/support/spatialReferenceUtils.js";import g from"./VoxelDimension.js";const d="esri.layers.support.VoxelVolume",y=s.getLogger(d);let f=class extends i{constructor(e){super(e),this.id=0,this.dimensions=null,this.spatialReference=c.WGS84}get zDimension(){if(!this.dimensions)return-1;if(!Array.isArray(this.dimensions))return-1;if(4!==this.dimensions.length)return-1;for(let e=2;e<4;++e)if(this.dimensions[e].size>0)return e;return-1}get isValid(){return!!this.dimensions&&(!!Array.isArray(this.dimensions)&&(4===this.dimensions.length&&(!(this.dimensions[0].size<1||this.dimensions[1].size<1)&&!(-1===this.zDimension||this.dimensions[this.zDimension].size<1))))}get originInLayerSpace3D(){if(!this.isValid||"xyt"===this.volumeType)return[0,0,0];const e=this.dimensions[0].getRange(),i=this.dimensions[1].getRange(),s=this.dimensions[2],r=s.isRegular?s.getRange():[0,s.size];return[e[0],i[0],r[0]]}get voxelSizeInLayerSpaceSigned(){if(!this.isValid||"xyt"===this.volumeType)return[0,0,0];const e=this.dimensions[0].getRange(),i=this.dimensions[1].getRange(),s=this.dimensions[2],r=s.isRegular?s.getRange():[0,s.size],t=[this.sizeInVoxels[0],this.sizeInVoxels[1],this.sizeInVoxels[2]];for(let n=0;n<3;++n)t[n]<2?t[n]=1:t[n]-=1;return s.isRegular&&!s.isPositiveUp&&(t[2]*=-1),[(e[1]-e[0])/t[0],(i[1]-i[0])/t[1],(r[1]-r[0])/t[2]]}get volumeType(){if(this.isValid){const e=this.dimensions[2].size>0,i=this.dimensions[3].size>0;if(!e&&i)return"xyt";if(e&&i)return"xyzt"}return"xyz"}get sizeInVoxels(){if(!this.isValid)return[0,0,0];const e=this.zDimension;return[this.dimensions[0].size,this.dimensions[1].size,this.dimensions[e].size]}computeVoxelSpaceLocation(e){if(!this.isValid)return[0,0,0];if("xyt"===this.volumeType)return y.error("computeVoxelSpacePosition cannot be used with XYT volumes."),[0,0,0];if(!h(this.spatialReference,e.spatialReference))return y.error("pos argument should have the same spatial reference as the VoxelLayer."),[0,0,0];const i=l(e.x,e.y,e.z??0);n(i,i,this.originInLayerSpace3D),o(i,i,this.voxelSizeInLayerSpaceSigned);const s=this.dimensions[this.zDimension];if(!s.isRegular&&Array.isArray(s.irregularSpacing?.values)&&s.irregularSpacing.values.length>1){const r=e.z??0,t=s.irregularSpacing.values,n=s.isPositiveUp?1:-1,o=t.reduce(((e,i)=>Math.abs(n*i-r)<Math.abs(n*e-r)?i:e));for(let e=0;e<t.length;++e)if(t[e]===o){i[2]=e;break}}return[i[0],i[1],i[2]]}computeLayerSpaceLocation(e){if(!this.isValid)return new m({x:0,y:0,spatialReference:this.spatialReference});const i=u(e);if(a(i,i,this.voxelSizeInLayerSpaceSigned),p(i,i,this.originInLayerSpace3D),"xyt"===this.volumeType)return new m({x:i[0],y:i[1],spatialReference:this.spatialReference});const s=this.dimensions[this.zDimension];return s.isRegular||Array.isArray(s.irregularSpacing?.values)&&(e[2]<0?i[2]=s.irregularSpacing.values[0]:e[2]<s.irregularSpacing.values.length?i[2]=s.irregularSpacing.values[e[2]]:i[2]=s.irregularSpacing.values[s.irregularSpacing.values.length-1],s.isPositiveUp||(i[2]*=-1)),new m({x:i[0],y:i[1],z:i[2],spatialReference:this.spatialReference})}};e([r({type:Number,json:{write:{enabled:!0,isRequired:!0}}})],f.prototype,"id",void 0),e([r({type:[g],json:{write:{enabled:!0,isRequired:!0}}})],f.prototype,"dimensions",void 0),e([r({type:c,json:{read:{enabled:!1}}})],f.prototype,"spatialReference",void 0),e([r({type:[Number],json:{read:!1}})],f.prototype,"zDimension",null),e([r({type:[Boolean],json:{read:!1}})],f.prototype,"isValid",null),e([r({type:[Number],json:{read:!1}})],f.prototype,"originInLayerSpace3D",null),e([r({type:[Number],json:{read:!1}})],f.prototype,"voxelSizeInLayerSpaceSigned",null),e([r({type:["xyz","xyzt","xyt"],json:{read:{enabled:!1}}})],f.prototype,"volumeType",null),e([r({type:[Number],json:{read:!1}})],f.prototype,"sizeInVoxels",null),f=e([t(d)],f);const S=f;export{S as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.25/esri/copyright.txt for details.
4
4
  */
5
- import{s as a,m as s}from"../../chunks/quat.js";import{a as t}from"../../chunks/quatf64.js";import{c as n}from"../../chunks/vec3f64.js";import{a as o,t as r}from"../../chunks/common.js";import{c,n as m,q as u}from"../../chunks/vec3.js";const f=n(),e=t(),h=t(),i=t(),p=new Float64Array([0,0,1]),j=new Float64Array([0,1,0]),k=new Float64Array([1,0,0]);function l(s){c(f,s),m(f,f);const n=Math.atan2(f[1],f[0]),r=a(t(),p,-n);u(f,f,r);const e=-1*Math.atan2(f[2],f[0]);return[o(n)+270,o(e)+90]}function q(t,n){return a(h,p,r(t-270)),a(i,j,r(n-90)),s(e,h,i),c(f,k),u(f,f,e),m(f,f),[f[0],f[1],f[2]]}export{q as computeNormalFromOrientationTilt,l as computeOrientationTiltFromNormal};
5
+ import{s as a,m as s}from"../../chunks/quat.js";import{c as t}from"../../chunks/quatf64.js";import{c as n}from"../../chunks/vec3f64.js";import{a as o,t as r}from"../../chunks/common.js";import{c,n as m,k as u}from"../../chunks/vec3.js";const f=n(),e=t(),h=t(),i=t(),k=new Float64Array([0,0,1]),p=new Float64Array([0,1,0]),j=new Float64Array([1,0,0]);function l(s){c(f,s),m(f,f);const n=Math.atan2(f[1],f[0]),r=a(t(),k,-n);u(f,f,r);const e=-1*Math.atan2(f[2],f[0]);return[o(n)+270,o(e)+90]}function w(t,n){return a(h,k,r(t-270)),a(i,p,r(n-90)),s(e,h,i),c(f,j),u(f,f,e),m(f,f),[f[0],f[1],f[2]]}export{w as computeNormalFromOrientationTilt,l as computeOrientationTiltFromNormal};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcgis/core",
3
- "version": "4.25.0-next.20220920",
3
+ "version": "4.25.0-next.20220921",
4
4
  "homepage": "https://js.arcgis.com",
5
5
  "description": "ArcGIS API for JavaScript: A complete 2D and 3D mapping and data visualization API",
6
6
  "keywords": [
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.25/esri/copyright.txt for details.
4
+ */
5
+ import{_ as r}from"../../chunks/tslib.es6.js";import e from"../../AggregateGraphic.js";import{property as s}from"../../core/accessorSupport/decorators/property.js";import"../../core/arrayUtils.js";import"../../core/has.js";import"../../core/accessorSupport/ensureType.js";import{subclass as o}from"../../core/accessorSupport/decorators/subclass.js";import t from"./FeatureSet.js";let p=class extends t{constructor(){super(...arguments),this.features=[]}};r([s({type:[e],json:{write:!0}})],p.prototype,"features",void 0),p=r([o("esri.rest.support.AggregateFeatureSet")],p);const a=p;export{a as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.25/esri/copyright.txt for details.
4
4
  */
5
- const c="20220920",e="5c81dd50107ced74ff94949ba05e5cc0ef3727c0";export{c as buildDate,e as commitHash};
5
+ const a="20220921",c="1a79572a5ba80866fc1356a82d9dc38bc0edd004";export{a as buildDate,c as commitHash};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.25/esri/copyright.txt for details.
4
4
  */
5
- import{_ as t}from"../../chunks/tslib.es6.js";import"../../geometry.js";import s from"../../Viewpoint.js";import{JSONSupport as i}from"../../core/JSONSupport.js";import{property as e}from"../../core/accessorSupport/decorators/property.js";import"../../core/arrayUtils.js";import"../../core/has.js";import"../../core/accessorSupport/ensureType.js";import{subclass as o}from"../../core/accessorSupport/decorators/subclass.js";import{t as r}from"../../chunks/common.js";import{a,r as n,t as p,c as h}from"../../chunks/mat2d.js";import{c}from"../../chunks/mat2df32.js";import{c as m}from"../../chunks/mat2df64.js";import{s as l,g as f,h as u,r as w,m as v}from"../../chunks/mat3.js";import{c as d}from"../../chunks/mat3f32.js";import{c as j,t as y}from"../../chunks/vec2.js";import{f as R}from"../../chunks/vec2f32.js";import{a as _}from"../../chunks/vec2f64.js";import{isVec2 as x}from"../../core/libs/gl-matrix-2/types/vec2.js";import{copy as z,getMatrix as g,getResolution as S,getExtent as k,getTransform as M,getTransformNoRotation as N,getWorldScreenWidth as T}from"./viewpointUtils.js";import D from"../../geometry/Extent.js";import V from"../../geometry/Point.js";var b;const G=[0,0];let O=b=class extends i{constructor(t){super(t),this._viewpoint2D={center:_(),rotation:0,scale:0,spatialReference:null},this.center=[0,0],this.extent=new D,this.id=0,this.inverseTransform=m(),this.resolution=0,this.rotation=0,this.scale=0,this.transform=m(),this.transformNoRotation=m(),this.displayMat3=d(),this.displayViewMat3=d(),this.viewMat3=d(),this.viewMat2d=c(),this.worldScreenWidth=0,this.size=[0,0]}set pixelRatio(t){this._set("pixelRatio",t),this._update()}set size(t){this._set("size",t),this._update()}set viewpoint(t){if(t){const s=this._viewpoint2D,i=t.targetGeometry;s.center[0]=i.x,s.center[1]=i.y,s.rotation=t.rotation,s.scale=t.scale,s.spatialReference=i.spatialReference}this._update()}copy(t){const s=this.size,i=this.viewpoint;return i&&s?(this.viewpoint=z(i,t.viewpoint),this._set("size",j(s,t.size))):(this.viewpoint=t.viewpoint.clone(),this._set("size",[t.size[0],t.size[1]])),this._set("pixelRatio",t.pixelRatio),this}clone(){return new b({size:this.size,viewpoint:this.viewpoint.clone(),pixelRatio:this.pixelRatio})}toMap(t,s,i){return x(s)?y(t,s,this.inverseTransform):(G[0]=s,G[1]=i,y(t,G,this.inverseTransform))}toScreen(t,s,i){return x(s)?y(t,s,this.transform):(G[0]=s,G[1]=i,y(t,G,this.transform))}toScreenNoRotation(t,s,i){return x(s)?y(t,s,this.transformNoRotation):(G[0]=s,G[1]=i,y(t,G,this.transformNoRotation))}getScreenTransform(t,s){const{center:i}=this._viewpoint2D,e=this._get("pixelRatio")||1,o=this._get("size");return g(t,i,o,s,0,e),t}_update(){const{center:t,spatialReference:i,scale:e,rotation:o}=this._viewpoint2D,c=this._get("pixelRatio")||1,m=this._get("size"),d=new s({targetGeometry:new V(t[0],t[1],i),scale:e,rotation:o});if(this._set("viewpoint",d),!m||!i||!e)return;this.resolution=S(d),this.rotation=o,this.scale=e,this.spatialReference=i,j(this.center,t);const y=0!==m[0]?2/m[0]:0,_=0!==m[1]?-2/m[1]:0;l(this.displayMat3,y,0,0,0,_,0,-1,1,1);const x=f(this.viewMat3),z=R(m[0]/2,m[1]/2),g=R(-m[0]/2,-m[1]/2),D=r(o);u(x,x,z),w(x,x,D),u(x,x,g),v(this.displayViewMat3,this.displayMat3,x);const b=a(this.viewMat2d,z);return n(b,b,D),p(b,b,g),k(this.extent,d,m),M(this.transform,d,m,c),h(this.inverseTransform,this.transform),N(this.transformNoRotation,d,m,c),this.worldScreenWidth=T(this.spatialReference,this.resolution),this._set("id",this.id+1),this}};t([e({readOnly:!0})],O.prototype,"id",void 0),t([e({value:1,json:{write:!0}})],O.prototype,"pixelRatio",null),t([e({json:{write:!0}})],O.prototype,"size",null),t([e()],O.prototype,"spatialReference",void 0),t([e({type:s,json:{write:!0}})],O.prototype,"viewpoint",null),O=b=t([o("esri.views.2d.ViewState")],O);const U=O;export{U as default};
5
+ import{_ as t}from"../../chunks/tslib.es6.js";import"../../geometry.js";import s from"../../Viewpoint.js";import{JSONSupport as i}from"../../core/JSONSupport.js";import{property as e}from"../../core/accessorSupport/decorators/property.js";import"../../core/arrayUtils.js";import"../../core/has.js";import"../../core/accessorSupport/ensureType.js";import{subclass as o}from"../../core/accessorSupport/decorators/subclass.js";import{t as r}from"../../chunks/common.js";import{a,r as n,t as p,c as h}from"../../chunks/mat2d.js";import{c}from"../../chunks/mat2df32.js";import{c as m}from"../../chunks/mat2df64.js";import{c as l,g as f,h as u,r as w,m as v}from"../../chunks/mat3.js";import{c as d}from"../../chunks/mat3f32.js";import{c as j,t as y}from"../../chunks/vec2.js";import{f as R}from"../../chunks/vec2f32.js";import{a as _}from"../../chunks/vec2f64.js";import{isVec2 as x}from"../../core/libs/gl-matrix-2/types/vec2.js";import{copy as z,getMatrix as g,getResolution as S,getExtent as k,getTransform as M,getTransformNoRotation as N,getWorldScreenWidth as T}from"./viewpointUtils.js";import D from"../../geometry/Extent.js";import V from"../../geometry/Point.js";var b;const G=[0,0];let O=b=class extends i{constructor(t){super(t),this._viewpoint2D={center:_(),rotation:0,scale:0,spatialReference:null},this.center=[0,0],this.extent=new D,this.id=0,this.inverseTransform=m(),this.resolution=0,this.rotation=0,this.scale=0,this.transform=m(),this.transformNoRotation=m(),this.displayMat3=d(),this.displayViewMat3=d(),this.viewMat3=d(),this.viewMat2d=c(),this.worldScreenWidth=0,this.size=[0,0]}set pixelRatio(t){this._set("pixelRatio",t),this._update()}set size(t){this._set("size",t),this._update()}set viewpoint(t){if(t){const s=this._viewpoint2D,i=t.targetGeometry;s.center[0]=i.x,s.center[1]=i.y,s.rotation=t.rotation,s.scale=t.scale,s.spatialReference=i.spatialReference}this._update()}copy(t){const s=this.size,i=this.viewpoint;return i&&s?(this.viewpoint=z(i,t.viewpoint),this._set("size",j(s,t.size))):(this.viewpoint=t.viewpoint.clone(),this._set("size",[t.size[0],t.size[1]])),this._set("pixelRatio",t.pixelRatio),this}clone(){return new b({size:this.size,viewpoint:this.viewpoint.clone(),pixelRatio:this.pixelRatio})}toMap(t,s,i){return x(s)?y(t,s,this.inverseTransform):(G[0]=s,G[1]=i,y(t,G,this.inverseTransform))}toScreen(t,s,i){return x(s)?y(t,s,this.transform):(G[0]=s,G[1]=i,y(t,G,this.transform))}toScreenNoRotation(t,s,i){return x(s)?y(t,s,this.transformNoRotation):(G[0]=s,G[1]=i,y(t,G,this.transformNoRotation))}getScreenTransform(t,s){const{center:i}=this._viewpoint2D,e=this._get("pixelRatio")||1,o=this._get("size");return g(t,i,o,s,0,e),t}_update(){const{center:t,spatialReference:i,scale:e,rotation:o}=this._viewpoint2D,c=this._get("pixelRatio")||1,m=this._get("size"),d=new s({targetGeometry:new V(t[0],t[1],i),scale:e,rotation:o});if(this._set("viewpoint",d),!m||!i||!e)return;this.resolution=S(d),this.rotation=o,this.scale=e,this.spatialReference=i,j(this.center,t);const y=0!==m[0]?2/m[0]:0,_=0!==m[1]?-2/m[1]:0;l(this.displayMat3,y,0,0,0,_,0,-1,1,1);const x=f(this.viewMat3),z=R(m[0]/2,m[1]/2),g=R(-m[0]/2,-m[1]/2),D=r(o);u(x,x,z),w(x,x,D),u(x,x,g),v(this.displayViewMat3,this.displayMat3,x);const b=a(this.viewMat2d,z);return n(b,b,D),p(b,b,g),k(this.extent,d,m),M(this.transform,d,m,c),h(this.inverseTransform,this.transform),N(this.transformNoRotation,d,m,c),this.worldScreenWidth=T(this.spatialReference,this.resolution),this._set("id",this.id+1),this}};t([e({readOnly:!0})],O.prototype,"id",void 0),t([e({value:1,json:{write:!0}})],O.prototype,"pixelRatio",null),t([e({json:{write:!0}})],O.prototype,"size",null),t([e()],O.prototype,"spatialReference",void 0),t([e({type:s,json:{write:!0}})],O.prototype,"viewpoint",null),O=b=t([o("esri.views.2d.ViewState")],O);const U=O;export{U as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.25/esri/copyright.txt for details.
4
4
  */
5
- import{deg2rad as t}from"../../../../core/mathUtils.js";import{isSome as s,isNone as a}from"../../../../core/maybe.js";import{j as e,e as i,h as r,r as o}from"../../../../chunks/mat3.js";import{c as n}from"../../../../chunks/mat3f32.js";import{DisplayObject as l}from"../DisplayObject.js";class m extends l{constructor(){super(...arguments),this._displayData=null}get displayData(){return this._displayData}set displayData(t){this._displayData=t,this.requestRender()}clear(){s(this._displayData)&&(this._displayData.detach(),this._displayData=null,this.requestRender())}setTransform(s){const{displayData:n}=this;if(a(n))return;const l=n.extent.xmin,m=n.extent.ymax,p=[0,0];s.toScreen(p,[l,m]);const c=(n.extent.xmax-n.extent.xmin)/n.size[0]/s.resolution,d=t(s.rotation),{dvs:h}=this.transforms;e(h,[-1,1,0]),i(h,h,[2/(s.size[0]*s.pixelRatio),-2/(s.size[1]*s.pixelRatio),1]),r(h,h,[p[0],p[1],0]),o(h,h,d),i(h,h,[c*s.pixelRatio,c*s.pixelRatio,1])}_createTransforms(){return{dvs:n()}}}export{m as FlowDisplayObject};
5
+ import{deg2rad as t}from"../../../../core/mathUtils.js";import{isSome as s,isNone as a}from"../../../../core/maybe.js";import{j as e,s as i,h as r,r as o}from"../../../../chunks/mat3.js";import{c as n}from"../../../../chunks/mat3f32.js";import{DisplayObject as l}from"../DisplayObject.js";class m extends l{constructor(){super(...arguments),this._displayData=null}get displayData(){return this._displayData}set displayData(t){this._displayData=t,this.requestRender()}clear(){s(this._displayData)&&(this._displayData.detach(),this._displayData=null,this.requestRender())}setTransform(s){const{displayData:n}=this;if(a(n))return;const l=n.extent.xmin,m=n.extent.ymax,p=[0,0];s.toScreen(p,[l,m]);const c=(n.extent.xmax-n.extent.xmin)/n.size[0]/s.resolution,d=t(s.rotation),{dvs:h}=this.transforms;e(h,[-1,1,0]),i(h,h,[2/(s.size[0]*s.pixelRatio),-2/(s.size[1]*s.pixelRatio),1]),r(h,h,[p[0],p[1],0]),o(h,h,d),i(h,h,[c*s.pixelRatio,c*s.pixelRatio,1])}_createTransforms(){return{dvs:n()}}}export{m as FlowDisplayObject};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.25/esri/copyright.txt for details.
4
4
  */
5
- import{s as t,m as s}from"../../../../chunks/mat3.js";import{c as e}from"../../../../chunks/mat3f32.js";import{RasterVFDisplayObject as a}from"./RasterVFDisplayObject.js";import{TiledDisplayObject as i}from"../webgl/TiledDisplayObject.js";class r extends i{constructor(t,s,e,i,r,o=null){super(t,s,e,i,r),this.tileData=new a(o),this.tileData.coordScale=[i,r],this.tileData.once("isReady",(()=>this.ready()))}destroy(){super.destroy(),this.tileData.destroy(),this.tileData=null,this.stage=null}set stencilRef(t){this.tileData.stencilRef=t}get stencilRef(){return this.tileData.stencilRef}_createTransforms(){return{dvs:e(),tileMat3:e()}}setTransform(e,a){super.setTransform(e,a);const i=a/(e.resolution*e.pixelRatio),r=this.transforms.tileMat3,[o,l]=this.tileData.offset,h=[this.x+o*a,this.y-l*a],[n,f]=e.toScreenNoRotation([0,0],h),{symbolTileSize:m}=this.tileData.symbolizerParameters,c=Math.round((this.width-this.tileData.offset[0])/m)*m,D=Math.round((this.height-this.tileData.offset[1])/m)*m,d=c/this.rangeX*i,u=D/this.rangeY*i;t(r,d,0,0,0,u,0,n,f,1),s(this.transforms.dvs,e.displayViewMat3,r),this.tileData.transforms.dvs=this.transforms.dvs}onAttach(){this.tileData.stage=this.stage}onDetach(){this.tileData.stage=null}}export{r as RasterVFTile};
5
+ import{c as t,m as s}from"../../../../chunks/mat3.js";import{c as e}from"../../../../chunks/mat3f32.js";import{RasterVFDisplayObject as a}from"./RasterVFDisplayObject.js";import{TiledDisplayObject as i}from"../webgl/TiledDisplayObject.js";class r extends i{constructor(t,s,e,i,r,o=null){super(t,s,e,i,r),this.tileData=new a(o),this.tileData.coordScale=[i,r],this.tileData.once("isReady",(()=>this.ready()))}destroy(){super.destroy(),this.tileData.destroy(),this.tileData=null,this.stage=null}set stencilRef(t){this.tileData.stencilRef=t}get stencilRef(){return this.tileData.stencilRef}_createTransforms(){return{dvs:e(),tileMat3:e()}}setTransform(e,a){super.setTransform(e,a);const i=a/(e.resolution*e.pixelRatio),r=this.transforms.tileMat3,[o,l]=this.tileData.offset,h=[this.x+o*a,this.y-l*a],[n,f]=e.toScreenNoRotation([0,0],h),{symbolTileSize:c}=this.tileData.symbolizerParameters,m=Math.round((this.width-this.tileData.offset[0])/c)*c,D=Math.round((this.height-this.tileData.offset[1])/c)*c,d=m/this.rangeX*i,u=D/this.rangeY*i;t(r,d,0,0,0,u,0,n,f,1),s(this.transforms.dvs,e.displayViewMat3,r),this.tileData.transforms.dvs=this.transforms.dvs}onAttach(){this.tileData.stage=this.stage}onDetach(){this.tileData.stage=null}}export{r as RasterVFTile};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.25/esri/copyright.txt for details.
4
4
  */
5
- import{isSome as e}from"../../../../core/maybe.js";import{g as t,h as s,r as a,e as r}from"../../../../chunks/mat3.js";import{c as i}from"../../../../chunks/mat3f32.js";import{BucketType as o}from"./enums.js";import{CircleRenderBucket as h,SymbolRenderBucket as n,LineRenderBucket as l,FillRenderBucket as y}from"./RenderBucket.js";import{FADE_DURATION as c}from"./decluttering/config.js";import{TiledDisplayObject as d}from"../webgl/TiledDisplayObject.js";class m extends d{constructor(e,t,s,a,r,i,o=null){super(e,t,s,a,r,4096,4096),this._memCache=o,this.type="vector-tile",this._referenced=0,this._hasSymbolBuckets=!1,this._memoryUsedByLayerData=0,this.layerData=new Map,this.layerCount=0,this.status="loading",this.allSymbolsFadingOut=!1,this.lastOpacityUpdate=0,this.symbols=new Map,this.isCoverage=!1,this.neededForCoverage=!1,this.decluttered=!1,this.invalidating=!1,this.parentTile=null,this.childrenTiles=new Set,this._processed=!1,this._referenced=1,this.styleRepository=i,this.id=e.id}get hasSymbolBuckets(){return this._hasSymbolBuckets}get isFading(){return this._hasSymbolBuckets&&performance.now()-this.lastOpacityUpdate<c}get isHoldingForFade(){return this._hasSymbolBuckets&&(!this.allSymbolsFadingOut||performance.now()-this.lastOpacityUpdate<c)}get wasRequested(){return"errored"===this.status||"loaded"===this.status||"reloading"===this.status}setData(e){this.changeDataImpl(e),this.requestRender(),this.ready(),this.invalidating=!1,this._processed=!0}deleteLayerData(t){let s=!1;for(const e of t)if(this.layerData.has(e)){const t=this.layerData.get(e);this._memoryUsedByLayerData-=t.memoryUsed,t.type===o.SYMBOL&&this.symbols.has(e)&&(this.symbols.delete(e),s=!0),t.destroy(),this.layerData.delete(e),this.layerCount--}e(this._memCache)&&this._memCache.updateSize(this.key.id,this,this._memoryUsedByLayerData),s&&this.emit("symbols-changed"),this.requestRender()}processed(){return this._processed}hasData(){return this.layerCount>0}dispose(){"unloaded"!==this.status&&(u.delete(this),m._destroyRenderBuckets(this.layerData),this.layerData=null,this.layerCount=0,this._memoryUsedByLayerData=0,this.destroy(),this.status="unloaded")}release(){return 0==--this._referenced&&(this.dispose(),this.stage=null,!0)}retain(){++this._referenced}get referenced(){return this._referenced}get memoryUsage(){return(this._memoryUsedByLayerData+256)/(this._referenced||1)}changeDataImpl(t){let s=!1;if(t){const{bucketsWithData:a,emptyBuckets:r}=t,i=this._createRenderBuckets(a);if(r&&r.byteLength>0){const e=new Uint32Array(r);for(const t of e)this._deleteLayerData(t)}for(const[e,t]of i)this._deleteLayerData(e),t.type===o.SYMBOL&&(this.symbols.set(e,t.symbols),s=!0),this._memoryUsedByLayerData+=t.memoryUsed,this.layerData.set(e,t),this.layerCount++;e(this._memCache)&&this._memCache.updateSize(this.key.id,this,this._memoryUsedByLayerData)}this._hasSymbolBuckets=!1;for(const[e,a]of this.layerData)a.type===o.SYMBOL&&(this._hasSymbolBuckets=!0);s&&this.emit("symbols-changed")}attachWithContext(e){this.stage={context:e,trashDisplayObject(e){e.processDetach()},untrashDisplayObject:()=>!1}}setTransform(e,i){super.setTransform(e,i);const o=i/(e.resolution*e.pixelRatio),h=this.width/this.rangeX*o,n=this.height/this.rangeY*o,l=[0,0];e.toScreen(l,[this.x,this.y]);const y=this.transforms.tileUnitsToPixels;t(y),s(y,y,l),a(y,y,Math.PI*e.rotation/180),r(y,y,[h,n,1])}_createTransforms(){return{dvs:i(),tileMat3:i(),tileUnitsToPixels:i()}}static _destroyRenderBuckets(e){if(!e)return;const t=new Set;e.forEach((e=>{t.has(e)||(e.destroy(),t.add(e))})),e.clear()}_createRenderBuckets(e){const t=new Map,s=new Map;for(const a of e){const e=this._deserializeBucket(a,s);for(const s of e.layerUIDs)t.set(s,e)}return t}_deserializeBucket(e,t){let s=t.get(e);if(s)return s;switch(new Uint32Array(e)[0]){case o.FILL:s=new y(e,this.styleRepository);break;case o.LINE:s=new l(e,this.styleRepository);break;case o.SYMBOL:s=new n(e,this.styleRepository,this);break;case o.CIRCLE:s=new h(e,this.styleRepository)}return t.set(e,s),s}_deleteLayerData(e){if(!this.layerData.has(e))return;const t=this.layerData.get(e);this._memoryUsedByLayerData-=t.memoryUsed,t.destroy(),this.layerData.delete(e),this.layerCount--}}const u=new Map;function p(){u.forEach(((e,t)=>{console.log(`\n${t.key}:`),e[0].forEach((e=>console.log(e))),console.log("========"),e[1].forEach((e=>console.log(e)))}))}export{m as VectorTile,p as printAllocations};
5
+ import{isSome as e}from"../../../../core/maybe.js";import{g as t,h as s,r as a,s as r}from"../../../../chunks/mat3.js";import{c as i}from"../../../../chunks/mat3f32.js";import{BucketType as o}from"./enums.js";import{CircleRenderBucket as h,SymbolRenderBucket as n,LineRenderBucket as l,FillRenderBucket as y}from"./RenderBucket.js";import{FADE_DURATION as c}from"./decluttering/config.js";import{TiledDisplayObject as d}from"../webgl/TiledDisplayObject.js";class m extends d{constructor(e,t,s,a,r,i,o=null){super(e,t,s,a,r,4096,4096),this._memCache=o,this.type="vector-tile",this._referenced=0,this._hasSymbolBuckets=!1,this._memoryUsedByLayerData=0,this.layerData=new Map,this.layerCount=0,this.status="loading",this.allSymbolsFadingOut=!1,this.lastOpacityUpdate=0,this.symbols=new Map,this.isCoverage=!1,this.neededForCoverage=!1,this.decluttered=!1,this.invalidating=!1,this.parentTile=null,this.childrenTiles=new Set,this._processed=!1,this._referenced=1,this.styleRepository=i,this.id=e.id}get hasSymbolBuckets(){return this._hasSymbolBuckets}get isFading(){return this._hasSymbolBuckets&&performance.now()-this.lastOpacityUpdate<c}get isHoldingForFade(){return this._hasSymbolBuckets&&(!this.allSymbolsFadingOut||performance.now()-this.lastOpacityUpdate<c)}get wasRequested(){return"errored"===this.status||"loaded"===this.status||"reloading"===this.status}setData(e){this.changeDataImpl(e),this.requestRender(),this.ready(),this.invalidating=!1,this._processed=!0}deleteLayerData(t){let s=!1;for(const e of t)if(this.layerData.has(e)){const t=this.layerData.get(e);this._memoryUsedByLayerData-=t.memoryUsed,t.type===o.SYMBOL&&this.symbols.has(e)&&(this.symbols.delete(e),s=!0),t.destroy(),this.layerData.delete(e),this.layerCount--}e(this._memCache)&&this._memCache.updateSize(this.key.id,this,this._memoryUsedByLayerData),s&&this.emit("symbols-changed"),this.requestRender()}processed(){return this._processed}hasData(){return this.layerCount>0}dispose(){"unloaded"!==this.status&&(u.delete(this),m._destroyRenderBuckets(this.layerData),this.layerData=null,this.layerCount=0,this._memoryUsedByLayerData=0,this.destroy(),this.status="unloaded")}release(){return 0==--this._referenced&&(this.dispose(),this.stage=null,!0)}retain(){++this._referenced}get referenced(){return this._referenced}get memoryUsage(){return(this._memoryUsedByLayerData+256)/(this._referenced||1)}changeDataImpl(t){let s=!1;if(t){const{bucketsWithData:a,emptyBuckets:r}=t,i=this._createRenderBuckets(a);if(r&&r.byteLength>0){const e=new Uint32Array(r);for(const t of e)this._deleteLayerData(t)}for(const[e,t]of i)this._deleteLayerData(e),t.type===o.SYMBOL&&(this.symbols.set(e,t.symbols),s=!0),this._memoryUsedByLayerData+=t.memoryUsed,this.layerData.set(e,t),this.layerCount++;e(this._memCache)&&this._memCache.updateSize(this.key.id,this,this._memoryUsedByLayerData)}this._hasSymbolBuckets=!1;for(const[e,a]of this.layerData)a.type===o.SYMBOL&&(this._hasSymbolBuckets=!0);s&&this.emit("symbols-changed")}attachWithContext(e){this.stage={context:e,trashDisplayObject(e){e.processDetach()},untrashDisplayObject:()=>!1}}setTransform(e,i){super.setTransform(e,i);const o=i/(e.resolution*e.pixelRatio),h=this.width/this.rangeX*o,n=this.height/this.rangeY*o,l=[0,0];e.toScreen(l,[this.x,this.y]);const y=this.transforms.tileUnitsToPixels;t(y),s(y,y,l),a(y,y,Math.PI*e.rotation/180),r(y,y,[h,n,1])}_createTransforms(){return{dvs:i(),tileMat3:i(),tileUnitsToPixels:i()}}static _destroyRenderBuckets(e){if(!e)return;const t=new Set;e.forEach((e=>{t.has(e)||(e.destroy(),t.add(e))})),e.clear()}_createRenderBuckets(e){const t=new Map,s=new Map;for(const a of e){const e=this._deserializeBucket(a,s);for(const s of e.layerUIDs)t.set(s,e)}return t}_deserializeBucket(e,t){let s=t.get(e);if(s)return s;switch(new Uint32Array(e)[0]){case o.FILL:s=new y(e,this.styleRepository);break;case o.LINE:s=new l(e,this.styleRepository);break;case o.SYMBOL:s=new n(e,this.styleRepository,this);break;case o.CIRCLE:s=new h(e,this.styleRepository)}return t.set(e,s),s}_deleteLayerData(e){if(!this.layerData.has(e))return;const t=this.layerData.get(e);this._memoryUsedByLayerData-=t.memoryUsed,t.destroy(),this.layerData.delete(e),this.layerCount--}}const u=new Map;function p(){u.forEach(((e,t)=>{console.log(`\n${t.key}:`),e[0].forEach((e=>console.log(e))),console.log("========"),e[1].forEach((e=>console.log(e)))}))}export{m as VectorTile,p as printAllocations};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.25/esri/copyright.txt for details.
4
4
  */
5
- import{isNone as t}from"../../../../core/maybe.js";import{createScreenPoint as e}from"../../../../core/screenUtils.js";import{g as s,m as r,h as o,e as a,r as i}from"../../../../chunks/mat3.js";import{c as n}from"../../../../chunks/mat3f32.js";import{f as c}from"../../../../chunks/vec2f32.js";import{f as p}from"../../../../chunks/vec3f32.js";import{normalizeMapX as d}from"../../../../geometry/support/normalizeUtils.js";import{getInfo as h}from"../../../../geometry/support/spatialReferenceUtils.js";import{getWorldWidth as l}from"../../viewpointUtils.js";import{brushes as m}from"../brushes.js";import{WGLDrawPhase as f}from"./enums.js";import u from"./WGLContainer.js";class M extends u{constructor(){super(...arguments),this._localOrigin=e(0,0),this._viewStateId=-1,this._dvsMat3=n(),this.requiresDedicatedFBO=!1}get dvsMat3(){return this._dvsMat3}beforeRender(t){this._updateMatrices(t),this._updateOverlays(t,this.children);for(const e of this.children)e.beforeRender(t)}prepareRenderPasses(t){const e=t.registerRenderPass({name:"overlay",brushes:[m.overlay],target:()=>this.children,drawPhase:f.MAP});return[...super.prepareRenderPasses(t),e]}_updateMatrices(t){const{state:e}=t,{id:n,size:h,pixelRatio:l,resolution:m,rotation:f,viewpoint:u,displayMat3:M}=e;if(this._viewStateId===n)return;const v=Math.PI/180*f,_=l*h[0],w=l*h[1],{x:y,y:g}=u.targetGeometry,j=d(y,e.spatialReference);this._localOrigin.x=j,this._localOrigin.y=g;const b=m*_,R=m*w,O=s(this._dvsMat3);r(O,O,M),o(O,O,c(_/2,w/2)),a(O,O,p(_/b,-w/R,1)),i(O,O,-v),this._viewStateId=n}_updateOverlays(e,s){const{state:r}=e,{rotation:o,spatialReference:a,worldScreenWidth:i,size:n,viewpoint:c}=r,p=this._localOrigin;let d=0;if(a.isWrappable){const e=n[0],m=n[1],f=180/Math.PI*o,u=Math.abs(Math.cos(f)),M=Math.abs(Math.sin(f)),v=Math.round(e*u+m*M),[_,w]=h(a).valid,y=l(a),{x:g,y:j}=c.targetGeometry,b=[g,j],R=[0,0];r.toScreen(R,b);const O=[0,0];let P;P=v>i?.5*i:.5*v;const x=Math.floor((g+.5*y)/y),C=_+x*y,D=w+x*y,I=[R[0]+P,0];r.toMap(O,I),O[0]>D&&(d=y),I[0]=R[0]-P,r.toMap(O,I),O[0]<C&&(d=-y);for(const r of s){const e=r.elementView.bounds;if(t(e))continue;const[s,,o]=e;s<_&&o>_?r.updateDrawCoords(p,y):o>w&&s<w?r.updateDrawCoords(p,-y):r.updateDrawCoords(p,d)}}else for(const t of s)t.updateDrawCoords(p,d)}}export{M as default};
5
+ import{isNone as t}from"../../../../core/maybe.js";import{createScreenPoint as e}from"../../../../core/screenUtils.js";import{g as s,m as r,h as o,s as a,r as i}from"../../../../chunks/mat3.js";import{c as n}from"../../../../chunks/mat3f32.js";import{f as c}from"../../../../chunks/vec2f32.js";import{f as p}from"../../../../chunks/vec3f32.js";import{normalizeMapX as d}from"../../../../geometry/support/normalizeUtils.js";import{getInfo as h}from"../../../../geometry/support/spatialReferenceUtils.js";import{getWorldWidth as l}from"../../viewpointUtils.js";import{brushes as m}from"../brushes.js";import{WGLDrawPhase as f}from"./enums.js";import u from"./WGLContainer.js";class M extends u{constructor(){super(...arguments),this._localOrigin=e(0,0),this._viewStateId=-1,this._dvsMat3=n(),this.requiresDedicatedFBO=!1}get dvsMat3(){return this._dvsMat3}beforeRender(t){this._updateMatrices(t),this._updateOverlays(t,this.children);for(const e of this.children)e.beforeRender(t)}prepareRenderPasses(t){const e=t.registerRenderPass({name:"overlay",brushes:[m.overlay],target:()=>this.children,drawPhase:f.MAP});return[...super.prepareRenderPasses(t),e]}_updateMatrices(t){const{state:e}=t,{id:n,size:h,pixelRatio:l,resolution:m,rotation:f,viewpoint:u,displayMat3:M}=e;if(this._viewStateId===n)return;const v=Math.PI/180*f,_=l*h[0],w=l*h[1],{x:y,y:g}=u.targetGeometry,j=d(y,e.spatialReference);this._localOrigin.x=j,this._localOrigin.y=g;const b=m*_,R=m*w,O=s(this._dvsMat3);r(O,O,M),o(O,O,c(_/2,w/2)),a(O,O,p(_/b,-w/R,1)),i(O,O,-v),this._viewStateId=n}_updateOverlays(e,s){const{state:r}=e,{rotation:o,spatialReference:a,worldScreenWidth:i,size:n,viewpoint:c}=r,p=this._localOrigin;let d=0;if(a.isWrappable){const e=n[0],m=n[1],f=180/Math.PI*o,u=Math.abs(Math.cos(f)),M=Math.abs(Math.sin(f)),v=Math.round(e*u+m*M),[_,w]=h(a).valid,y=l(a),{x:g,y:j}=c.targetGeometry,b=[g,j],R=[0,0];r.toScreen(R,b);const O=[0,0];let P;P=v>i?.5*i:.5*v;const x=Math.floor((g+.5*y)/y),C=_+x*y,D=w+x*y,I=[R[0]+P,0];r.toMap(O,I),O[0]>D&&(d=y),I[0]=R[0]-P,r.toMap(O,I),O[0]<C&&(d=-y);for(const r of s){const e=r.elementView.bounds;if(t(e))continue;const[s,,o]=e;s<_&&o>_?r.updateDrawCoords(p,y):o>w&&s<w?r.updateDrawCoords(p,-y):r.updateDrawCoords(p,d)}}else for(const t of s)t.updateDrawCoords(p,d)}}export{M as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.25/esri/copyright.txt for details.
4
4
  */
5
- import{s as t,m as s}from"../../../../chunks/mat3.js";import{DisplayObject as i}from"../DisplayObject.js";import e from"../../tiling/TileKey.js";class r extends i{constructor(t,s,i,r,h,o=r,n=h){super(),this.triangleCountReportedInDebug=0,this.triangleCount=0,this.texture=null,this.key=new e(t),this.x=s,this.y=i,this.width=r,this.height=h,this.rangeX=o,this.rangeY=n}destroy(){this.texture&&(this.texture.dispose(),this.texture=null)}setTransform(i,e){const r=e/(i.resolution*i.pixelRatio),h=this.transforms.tileMat3,[o,n]=i.toScreenNoRotation([0,0],[this.x,this.y]),a=this.width/this.rangeX*r,l=this.height/this.rangeY*r;t(h,a,0,0,0,l,0,o,n,1),s(this.transforms.dvs,i.displayViewMat3,h)}}export{r as TiledDisplayObject};
5
+ import{c as t,m as s}from"../../../../chunks/mat3.js";import{DisplayObject as i}from"../DisplayObject.js";import e from"../../tiling/TileKey.js";class r extends i{constructor(t,s,i,r,h,o=r,n=h){super(),this.triangleCountReportedInDebug=0,this.triangleCount=0,this.texture=null,this.key=new e(t),this.x=s,this.y=i,this.width=r,this.height=h,this.rangeX=o,this.rangeY=n}destroy(){this.texture&&(this.texture.dispose(),this.texture=null)}setTransform(i,e){const r=e/(i.resolution*i.pixelRatio),h=this.transforms.tileMat3,[o,n]=i.toScreenNoRotation([0,0],[this.x,this.y]),a=this.width/this.rangeX*r,l=this.height/this.rangeY*r;t(h,a,0,0,0,l,0,o,n,1),s(this.transforms.dvs,i.displayViewMat3,h)}}export{r as TiledDisplayObject};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.25/esri/copyright.txt for details.
4
4
  */
5
- import{a as s,m as t}from"../../../../chunks/mat2d.js";import{s as r,m as e}from"../../../../chunks/mat3.js";import{c as a}from"../../../../chunks/mat3f32.js";import{t as o}from"../../../../chunks/vec2.js";import{c as i}from"../../../../chunks/vec2f32.js";import{TILE_SIZE as n}from"./definitions.js";import{TiledDisplayObject as h}from"./TiledDisplayObject.js";class m{acquire(s){return{refCount:1,version:-1,labelMat2d:a(),tileMat3:a(),dvs:a()}}release(s){}}class c extends h{constructor(s,t,r){super(s,t,r,n,n)}destroy(){super.destroy(),this._transforms&&c.TransformCache.release(this.key.hash)}setTransform(a,n){const h=n/(a.resolution*a.pixelRatio),m=this.transforms.tileMat3,[c,f]=a.toScreenNoRotation([0,0],[this.x,this.y]),l=this.width/this.rangeX*h,u=this.height/this.rangeY*h;r(m,l,0,0,0,u,0,c,f,1),e(this.transforms.dvs,a.displayViewMat3,m);const d=this.transforms.labelMat2d,p=a.getScreenTransform(d,n),j=i();o(j,[this.x,this.y],p),s(d,j),t(d,a.viewMat2d,d)}_createTransforms(){return c.TransformCache.acquire(this.key.hash)}}c.TransformCache=new m;export{c as WGLTile};
5
+ import{a as s,m as t}from"../../../../chunks/mat2d.js";import{c as r,m as e}from"../../../../chunks/mat3.js";import{c as a}from"../../../../chunks/mat3f32.js";import{t as o}from"../../../../chunks/vec2.js";import{c as i}from"../../../../chunks/vec2f32.js";import{TILE_SIZE as n}from"./definitions.js";import{TiledDisplayObject as h}from"./TiledDisplayObject.js";class m{acquire(s){return{refCount:1,version:-1,labelMat2d:a(),tileMat3:a(),dvs:a()}}release(s){}}class c extends h{constructor(s,t,r){super(s,t,r,n,n)}destroy(){super.destroy(),this._transforms&&c.TransformCache.release(this.key.hash)}setTransform(a,n){const h=n/(a.resolution*a.pixelRatio),m=this.transforms.tileMat3,[c,f]=a.toScreenNoRotation([0,0],[this.x,this.y]),l=this.width/this.rangeX*h,u=this.height/this.rangeY*h;r(m,l,0,0,0,u,0,c,f,1),e(this.transforms.dvs,a.displayViewMat3,m);const d=this.transforms.labelMat2d,p=a.getScreenTransform(d,n),j=i();o(j,[this.x,this.y],p),s(d,j),t(d,a.viewMat2d,d)}_createTransforms(){return c.TransformCache.acquire(this.key.hash)}}c.TransformCache=new m;export{c as WGLTile};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.25/esri/copyright.txt for details.
4
4
  */
5
- import{disposeMaybe as t}from"../../../../core/maybe.js";import{t as s}from"../../../../chunks/common.js";import{j as i,e,r,h as o}from"../../../../chunks/mat3.js";import{c as a}from"../../../../chunks/mat3f32.js";import{f as n}from"../../../../chunks/vec2f64.js";import{s as h}from"../../../../chunks/vec3.js";import{c as m}from"../../../../chunks/vec3f64.js";import c from"./VertexStream.js";import{stencil as d}from"./shaders/StencilPrograms.js";import{StencilOperation as p,CompareFunction as _}from"../../../webgl/enums.js";import{createProgram as l}from"../../../webgl/ProgramTemplate.js";const u=n(-.5,-.5);class f{constructor(){this._centerNdc=m(),this._pxToNdc=m(),this._worldDimensionsPx=m(),this._mat3=a(),this._initialized=!1}dispose(){this._program=t(this._program),this._quad=t(this._quad)}render(t,s){const{context:i}=t;return!!this._updateGeometry(t,s)&&(this._initialized||this._initialize(i),i.setDepthWriteEnabled(!1),i.setDepthTestEnabled(!1),i.setColorMask(!1,!1,!1,!1),i.setBlendingEnabled(!1),i.setStencilOp(p.KEEP,p.KEEP,p.REPLACE),i.setStencilFunction(_.ALWAYS,1,255),i.setStencilTestEnabled(!0),i.useProgram(this._program),this._program.setUniformMatrix3fv("u_worldExtent",this._mat3),this._quad.draw(),this._quad.unbind(),!0)}_initialize(t){if(this._initialized)return;const s=l(t,d);s&&(this._program=s,this._quad=new c(t,[0,0,1,0,0,1,1,1]),this._initialized=!0)}_updateGeometry(t,a){const{state:n,pixelRatio:m}=t,{size:c,rotation:d}=n,p=Math.round(c[0]*m),_=Math.round(c[1]*m);if(!n.spatialReference.isWrappable)return!1;const l=s(d),f=Math.abs(Math.cos(l)),b=Math.abs(Math.sin(l)),g=Math.round(p*f+_*b),j=Math.round(n.worldScreenWidth);if(g<=j)return!1;const x=p*b+_*f,E=j*m,M=(a.left-a.right)*m/p,w=(a.bottom-a.top)*m/_;h(this._worldDimensionsPx,E,x,1),h(this._pxToNdc,2/p,-2/_,1),h(this._centerNdc,M,w,1);const P=this._mat3;return i(P,this._centerNdc),e(P,P,this._pxToNdc),0!==d&&r(P,P,l),e(P,P,this._worldDimensionsPx),o(P,P,u),!0}}export{f as WorldExtentClipRenderer};
5
+ import{disposeMaybe as t}from"../../../../core/maybe.js";import{t as s}from"../../../../chunks/common.js";import{j as i,s as r,r as e,h as o}from"../../../../chunks/mat3.js";import{c as a}from"../../../../chunks/mat3f32.js";import{f as n}from"../../../../chunks/vec2f64.js";import{s as h}from"../../../../chunks/vec3.js";import{c as m}from"../../../../chunks/vec3f64.js";import c from"./VertexStream.js";import{stencil as d}from"./shaders/StencilPrograms.js";import{StencilOperation as p,CompareFunction as _}from"../../../webgl/enums.js";import{createProgram as l}from"../../../webgl/ProgramTemplate.js";const u=n(-.5,-.5);class f{constructor(){this._centerNdc=m(),this._pxToNdc=m(),this._worldDimensionsPx=m(),this._mat3=a(),this._initialized=!1}dispose(){this._program=t(this._program),this._quad=t(this._quad)}render(t,s){const{context:i}=t;return!!this._updateGeometry(t,s)&&(this._initialized||this._initialize(i),i.setDepthWriteEnabled(!1),i.setDepthTestEnabled(!1),i.setColorMask(!1,!1,!1,!1),i.setBlendingEnabled(!1),i.setStencilOp(p.KEEP,p.KEEP,p.REPLACE),i.setStencilFunction(_.ALWAYS,1,255),i.setStencilTestEnabled(!0),i.useProgram(this._program),this._program.setUniformMatrix3fv("u_worldExtent",this._mat3),this._quad.draw(),this._quad.unbind(),!0)}_initialize(t){if(this._initialized)return;const s=l(t,d);s&&(this._program=s,this._quad=new c(t,[0,0,1,0,0,1,1,1]),this._initialized=!0)}_updateGeometry(t,a){const{state:n,pixelRatio:m}=t,{size:c,rotation:d}=n,p=Math.round(c[0]*m),_=Math.round(c[1]*m);if(!n.spatialReference.isWrappable)return!1;const l=s(d),f=Math.abs(Math.cos(l)),b=Math.abs(Math.sin(l)),g=Math.round(p*f+_*b),j=Math.round(n.worldScreenWidth);if(g<=j)return!1;const x=p*b+_*f,E=j*m,M=(a.left-a.right)*m/p,w=(a.bottom-a.top)*m/_;h(this._worldDimensionsPx,E,x,1),h(this._pxToNdc,2/p,-2/_,1),h(this._centerNdc,M,w,1);const P=this._mat3;return i(P,this._centerNdc),r(P,P,this._pxToNdc),0!==d&&e(P,P,l),r(P,P,this._worldDimensionsPx),o(P,P,u),!0}}export{f as WorldExtentClipRenderer};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.25/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../AggregateGraphic.js";import"../../../geometry.js";import i from"../../../Graphic.js";import r from"../../../core/Collection.js";import s from"../../../core/Error.js";import has from"../../../core/has.js";import{clone as a}from"../../../core/lang.js";import n from"../../../core/Logger.js";import{applySome as o,isSome as l,unwrap as h,isNone as u}from"../../../core/maybe.js";import{debounce as d,isAbortError as p}from"../../../core/promiseUtils.js";import{watch as y,whenOnce as c,initial as f}from"../../../core/reactiveUtils.js";import{property as g}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as m}from"../../../core/accessorSupport/decorators/subclass.js";import _ from"../../../layers/effects/FeatureEffectView.js";import v from"../../../layers/support/FeatureFilter.js";import b from"../../../rest/support/FeatureSet.js";import R from"../../../rest/support/Query.js";import{MAX_FILTERS as S}from"../engine/webgl/definitions.js";import{LayerView2DMixin as w}from"./LayerView2D.js";import{createSchema as x}from"./features/schemaUtils.js";import{createOrReuseTileRenderer as U}from"./features/tileRenderers.js";import{isRendererSupported as C}from"./features/support/rendererUtils.js";import{findSizeVV as F,createClusterCountSizeVariable as I,convertAggregateFieldFromPublic as O,isClusterCompatibleRenderer as E,createClusterRenderer as q}from"./support/clusterUtils.js";import T from"./support/FeatureCommandQueue.js";import V from"./support/FeatureLayerProxy.js";import{toJSONGeometryType as j}from"./support/util.js";import{TileManager as L}from"../tiling/TileManager.js";import N from"../../layers/FeatureLayerView.js";import P from"../../layers/LayerView.js";import k from"../../layers/RefreshableLayerView.js";import{getWebGLCapabilities as z}from"../../webgl/capabilities.js";import H from"../../../geometry/Extent.js";function J(e){return e&&"openPorts"in e}let Q=class extends(N(k(w(P)))){constructor(){super(...arguments),this._pipelineIsUpdating=!0,this._commandsQueue=new T({process:e=>{switch(e.type){case"processed-edit":return this._doEdit(e);case"refresh":return this._doRefresh(e.dataChanged);case"update":return this._doUpdate()}}}),this._visibilityOverrides=new Set,this._highlightIds=new Map,this._updateHighlight=d((async()=>this._proxy.setHighlight(Array.from(this._highlightIds.keys())))),this._uploadsLocked=!1,this._needsClusterSizeUpdate=!1,this.featureEffectView=new _,this._lastDefinitionExpression=null}destroy(){o(this._updateClusterSizeTask,(e=>e.remove())),this._proxy?.destroy(),this._commandsQueue.destroy()}initialize(){this.addResolvingPromise(Promise.all([this._initProxy(),this._initServiceOptions()])),this.handles.add([this.on("valueRangesChanged",(e=>{this._set("_aggregateValueRanges",e.valueRanges)})),y((()=>this.featureEffect),(e=>{this.featureEffectView.featureEffect=e}),{initial:!0,sync:!0})])}async _initProxy(){const e=this.layer;if("isTable"in e&&e.isTable)throw new s("featurelayerview:table-not-supported","table feature layer can't be displayed",{layer:this.layer});const t="feature"===e.type||"subtype-group"===e.type,i="capabilities"in e&&e.capabilities.operations.supportsQuery;if(t&&!i)throw new s("featurelayerview:query-not-supported","layer view requires a layer with query capability",{layer:e});this._proxy&&this._proxy.destroy();const r=this._createClientOptions();return this._set("_proxy",new V({client:r})),this._proxy.when()}async _initServiceOptions(){return this._set("_serviceOptions",await this._createServiceOptions()),this._serviceOptions}get orderByFields(){return"stream"!==this._serviceOptions.type&&this._serviceOptions.orderByFields}get labelsVisible(){const e="subtype-group"===this.layer.type?this.layer.sublayers.items:[this.layer];return!this.suspended&&e.some((e=>e.labelingInfo&&e.labelsVisible))}get queryMode(){return this._serviceOptions.type}get renderingConfigHash(){if(!this.layer)return null;const e=this.availableFields,t=this.layer,i=this.view.floors,{definitionExpression:r}=t,s="subtype-group"!==this.layer.type&&this.layer.labelsVisible&&this.layer.labelingInfo,a="renderer"in t&&t.renderer,n="feature"===t.type?t.gdbVersion:void 0,o="feature"===t.type&&t.historicMoment?t.historicMoment.getTime():void 0,{timeExtent:h}=this,u="customParameters"in t?JSON.stringify(t.customParameters):void 0,d="apiKey"in t?t.apiKey:void 0,p="stream"===t.type?`${JSON.stringify(t.geometryDefinition)}${t.definitionExpression}`:null,y=JSON.stringify(this.clips),c=t.featureReduction&&t.featureReduction.toJSON(),f="orderBy"in this.layer&&JSON.stringify(this.layer.orderBy),g="sublayers"in this.layer&&this.layer.sublayers.items.reduce(((e,t)=>e+`${t.visible?1:0}.${JSON.stringify(t.renderer)}.${t.labelsVisible}\n.${JSON.stringify(t.labelingInfo)}`),""),m="subtypeCode"in this.layer&&this.layer.subtypeCode;return JSON.stringify({orderBy:f,sublayerHash:g,subtypeCode:m,filterHash:l(this.filter)&&this.filter.toJSON(),effectHash:l(this.featureEffect)&&this.featureEffect.toJSON(),streamFilter:p,gdbVersion:n,definitionExpression:r,historicMoment:o,availableFields:e,renderer:a,labelingInfo:s,timeExtent:h,floors:i,clipsHash:y,featureReduction:c,customParameters:u,apiKey:d})}highlight(e){let t;return e instanceof i?t=[e.getObjectId()]:"number"==typeof e||"string"==typeof e?t=[e]:r.isCollection(e)&&e.length>0?t=e.map((e=>e?.getObjectId())).toArray():Array.isArray(e)&&e.length>0&&(t="number"==typeof e[0]||"string"==typeof e[0]?e:e.map((e=>e?.getObjectId()))),t=t?.filter((e=>null!=e)),t&&t.length?(this._addHighlight(t),{remove:()=>this._removeHighlight(t)}):{remove:()=>{}}}hasHighlight(){return!!this._highlightIds.size}async hitTest(e,r){if(!this.tileRenderer)return null;const s=await this.tileRenderer.hitTest(r);if(0===s.length)return null;const{features:a,aggregates:n}=await this._proxy.getFeatures(s);return[...n.map((i=>this._createGraphicHit(e,t.fromJSON(i)))),...a.map((t=>this._createGraphicHit(e,i.fromJSON(t))))]}async queryAggregates(){return(await this._proxy.getAggregates()).map((e=>t.fromJSON(e)))}queryStatistics(){return this._proxy.queryStatistics()}async querySummaryStatistics(e,t,i){const r={...t,scale:this.view.scale};return this._proxy.querySummaryStatistics(this._cleanUpQuery(e),r,i)}async queryUniqueValues(e,t,i){const r={...t,scale:this.view.scale};return this._proxy.queryUniqueValues(this._cleanUpQuery(e),r,i)}async queryClassBreaks(e,t,i){const r={...t,scale:this.view.scale};return this._proxy.queryClassBreaks(this._cleanUpQuery(e),r,i)}async queryHistogram(e,t,i){const r={...t,scale:this.view.scale};return this._proxy.queryHistogram(this._cleanUpQuery(e),r,i)}queryFeatures(e,t){return this.queryFeaturesJSON(e,t).then((e=>{const t=b.fromJSON(e);return t.features.forEach((e=>this._setLayersForFeature(e))),t}))}queryVisibleFeatures(e,t){return this._proxy.queryVisibleFeatures(this._cleanUpQuery(e),t).then((e=>{const t=b.fromJSON(e);return t.features.forEach((e=>this._setLayersForFeature(e))),t}))}queryFeaturesJSON(e,t){return this._proxy.queryFeatures(this._cleanUpQuery(e),t)}queryObjectIds(e,t){return this._proxy.queryObjectIds(this._cleanUpQuery(e),t)}queryFeatureCount(e,t){return this._proxy.queryFeatureCount(this._cleanUpQuery(e),t)}queryExtent(e,t){return this._proxy.queryExtent(this._cleanUpQuery(e),t).then((e=>({count:e.count,extent:H.fromJSON(e.extent)})))}setVisibility(e,t){t?this._visibilityOverrides.delete(e):this._visibilityOverrides.add(e),this._update()}update(e){if(!this._tileStrategy||!this.tileRenderer)return;const{hasMissingTiles:t,added:i,removed:r}=this._tileStrategy.update(e);(i.length||r.length)&&this._proxy.updateTiles({added:i,removed:r}),t&&this.requestUpdate(),this.notifyChange("updating")}attach(){this.view.timeline.record(`${this.layer.title} (FeatureLayer) Attach`),this._tileStrategy=new L({acquireTile:e=>this._acquireTile(e),releaseTile:e=>this._releaseTile(e),tileInfoView:this.view.featuresTilingScheme,buffer:0}),this.handles.add(y((()=>this.renderingConfigHash),(()=>this._update()),f),"attach"),"stream"!==this.layer.type&&this.handles.add(this.layer.on("edits",(e=>this._edit(e))),"attach")}detach(){this._commandsQueue.clear(),this._proxy?.stop(),this.container.removeAllChildren(),this.handles.remove("attach"),this.tileRenderer&&(this.tileRenderer.uninstall(this.container),this.tileRenderer=null),this._tileStrategy&&(this._tileStrategy.destroy(),this._tileStrategy=null),this._tileRendererHash=null}moveStart(){this.requestUpdate()}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}isUpdating(){const e="renderer"in this.layer&&null!=this.layer.renderer,t=this._commandsQueue.updating,i=null!=this._updatingRequiredFieldsPromise,r=!this._proxy||!this._proxy.isReady,s=this._pipelineIsUpdating,a=null==this.tileRenderer||this.tileRenderer?.updating,n=e&&(t||i||r||s||a);return has("esri-2d-log-updating")&&console.log(`Updating FLV2D: ${n}\n -> hasRenderer ${e}\n -> hasPendingCommand ${t}\n -> updatingRequiredFields ${i}\n -> updatingProxy ${r}\n -> updatingPipeline ${s}\n -> updatingTileRenderer ${a}\n`),n}_createClientOptions(){return{setUpdating:e=>{this._set("_pipelineIsUpdating",e)},emitEvent:e=>{this.emit(e.name,e.event)}}}async _detectQueryMode(e){const t="path"in e,i="editingInfo"in this.layer&&this.layer.editingInfo?.lastEditDate,r=!!this.layer.refreshInterval,s=!i&&r;if(t&&("feature"===this.layer.type||"subtype-group"===this.layer.type)&&"point"===this.layer.geometryType&&this.layer.capabilities.query.supportsPagination&&!this.layer.capabilities.operations.supportsEditing&&!s&&has("featurelayer-snapshot-enabled"))try{const e=await this.layer.queryFeatureCount();if(e<=has("featurelayer-snapshot-point-min-threshold"))return{mode:"snapshot",featureCount:e};const t=has("featurelayer-snapshot-point-max-threshold"),i=has("featurelayer-snapshot-point-coverage"),r=this.view.extent,s=h(this.layer.fullExtent),a=s?.clone().intersection(r),n=l(a)?a.width*a.height:0,o=s?.width*s?.height,u=0===o?0:n/o;if(e<=t&&u>=i)return{mode:"snapshot",featureCount:e}}catch(a){n.getLogger(this.declaredClass).warn("mapview-feature-layer","Encountered an error when querying for featureCount",{error:a})}return{mode:"on-demand"}}async _createServiceOptions(){const e=this.layer;if("stream"===e.type)return null;const{capabilities:t,objectIdField:i}=e,r=e.fields.map((e=>e.toJSON())),s=l(e.fullExtent)&&e.fullExtent.toJSON(),n=j(e.geometryType),o=e.timeInfo&&e.timeInfo.toJSON()||null,h=e.spatialReference?e.spatialReference.toJSON():null,u="feature"===e.type?e.globalIdField:null;let d;"ogc-feature"===e.type?d=e.source.getSource():J(e.source)?d=await e.source.openPorts():e.parsedUrl&&(d=a(e.parsedUrl),"dynamicDataSource"in e&&e.dynamicDataSource&&(d.query={layer:JSON.stringify({source:e.dynamicDataSource})}));const p="datesInUnknownTimezone"in this.layer&&this.layer.datesInUnknownTimezone,y=("subtypeField"in this.layer&&this.layer.subtypeField)??null,{mode:c,featureCount:f}=await this._detectQueryMode(d);let g=this.layer.objectIdField;if("feature"===this.layer.type&&l(this.layer.orderBy)&&this.layer.orderBy.length){const e=!this.layer.orderBy[0].valueExpression&&this.layer.orderBy[0].field;e&&(g=e)}return{type:c,timeReferenceUnknownClient:p,subtypeField:y,featureCount:f,globalIdField:u,maxRecordCount:t.query.maxRecordCount,tileMaxRecordCount:t.query.tileMaxRecordCount,capabilities:t,fields:r,fullExtent:s,geometryType:n,objectIdField:i,source:d,timeInfo:o,spatialReference:h,orderByFields:g}}async _createMemoryServiceOptions(e){const t=await e.openPorts();return{...this._createServiceOptions(),type:"memory",source:t}}_cleanUpQuery(e){const t=R.from(e)||this.createQuery();return t.outSpatialReference||(t.outSpatialReference=this.view.spatialReference),t}async _update(){return this._commandsQueue.push({type:"update"})}async _edit(e){if(this.suspended)return void this._clearTiles();return this._validateEdit(e)?this._commandsQueue.push({type:"edit",edits:e}):void 0}async doRefresh(e){if(this._tileStrategy.tileKeys().length)return this.suspended&&e?void this._clearTiles():this._commandsQueue.push({type:"refresh",dataChanged:e})}_clearTiles(){this._tileStrategy.tileKeys().length&&(this._proxy.updateTiles({added:[],removed:this._tileStrategy.tileKeys()}),this._tileStrategy.clear(),this.requestUpdate(),this._commandsQueue.clear(),this._update())}_validateEdit(e){const t="globalIdField"in this.layer&&this.layer.globalIdField,i=e.deletedFeatures.some((e=>-1===e.objectId||!e.objectId)),r=t&&this.availableFields.includes(t);return i&&!r?(n.getLogger(this.declaredClass).error(new s("mapview-apply-edits",`Editing the specified service requires the layer's globalIdField, ${t} to be included the layer's outFields for updates to be reflected on the map`)),null):e}async _doUpdate(){try{if(this.destroyed||!this._hasRequiredSupport(this.layer)||!this._tileStrategy)return;const{featureEffectView:t,filter:i}=this;await this._updateRequiredFields();const{renderer:r}=this._getEffectiveRenderer();this._set("_effectiveRenderer",r);const s=this._createSchemaConfig(),a=this._createConfiguration(s,i,t.filter),o=this._lastDefinitionExpression!==a.schema.source.definitionExpression;this._lastDefinitionExpression=a.schema.source.definitionExpression;const l=a.schema.tileRenderer,h=this._createTileRendererHash(l);if("snapshot"===this._serviceOptions.type&&(a.schema.source.featureCount=this._serviceOptions.featureCount),h!==this._tileRendererHash){await this._initTileRenderer(l,r);const e=this.layer,t="stream"===e.type?await this._initServiceOptions():this._serviceOptions;this.tileRenderer.onConfigUpdate(r),"stream"!==e.type&&J(e.source)&&(t.source=await e.source.openPorts());const i={added:this._tileStrategy.tileKeys(),removed:[]};await this._proxy.startup(this.view.featuresTilingScheme,a,t,i),this.hasHighlight()&&await this._proxy.setHighlight(Array.from(this._highlightIds.keys())),await this._onceTilesUpdated(),this.tileRenderer.onConfigUpdate(r)}else{"snapshot"===this._serviceOptions.type&&o&&(a.schema.source.featureCount=await this.layer.queryFeatureCount());const t=await this._proxy.update(a);(t.mesh||t.targets.aggregate)&&this._lockGPUUploads();try{await this._proxy.applyUpdate(t)}catch(e){p(e)||n.getLogger(this.declaredClass).error(e)}(t.mesh||t.targets.aggregate)&&this._unlockGPUUploads(),this.tileRenderer.onConfigUpdate(r),this._updateClusterSizeVariable(),this._forceAttributeTextureUpload()}this._tileRendererHash=h,this.tileRenderer.invalidateLabels(),this.requestUpdate()}catch(e){}}async _doEdit(e){try{await this._proxy.onEdits(e)}catch(t){p(t),0}}async _doRefresh(e){this._lockGPUUploads();try{await this._proxy.refresh(e)}catch(t){p(t),0}this._unlockGPUUploads(),this.layer?.featureReduction&&this._updateClusterSizeVariable()}_updateClusterSizeVariable(){this._needsClusterSizeUpdate&&(this.tileRenderer.onConfigUpdate(this._effectiveRenderer),this._needsClusterSizeUpdate=!1)}_createUpdateClusterSizeTask(e,t){return y((()=>this._aggregateValueRanges),(i=>{this._updateClusterEffectiveRendererSizeVariable(e,t,i),this._needsClusterSizeUpdate=!0,this._uploadsLocked||this._updateClusterSizeVariable()}))}async _updateClusterEffectiveRendererSizeVariable(e,t,i){if(e.dynamicClusterSize&&"visualVariables"in e&&e.visualVariables){const r=F(e.visualVariables);if(l(r)&&"cluster_count"===r.field){const s=e.visualVariables.indexOf(r);e.visualVariables[s]=I(t,i);const a=e.clone();a.dynamicClusterSize=!0,this._set("_effectiveRenderer",a)}}}_getEffectiveRenderer(){const e="renderer"in this.layer&&this.layer.renderer,t=this.layer.featureReduction;if(l(this._updateClusterSizeTask)&&(this._updateClusterSizeTask.remove(),this._updateClusterSizeTask=null),t&&"renderer"in t&&t.renderer){const e=[];for(const i of t.fields??[])O(e,i);return{renderer:t.renderer,aggregateFields:e,featureReduction:t}}if(t&&"cluster"===t.type&&E(e)){const i=t,r=[],s=q(r,e,i,this._aggregateValueRanges);return o(this._updateClusterSizeTask,(e=>e.remove())),this._updateClusterSizeTask=this._createUpdateClusterSizeTask(s,i),{renderer:s,aggregateFields:r,featureReduction:t}}return{renderer:e,aggregateFields:[],featureReduction:null}}_acquireTile(e){const t=this.tileRenderer.acquireTile(e);return t.once("attach",(()=>{this.requestUpdate()})),t}_releaseTile(e){this.tileRenderer.releaseTile(e)}async _initTileRenderer(e,t){const i=await U(e,{layerView:this,tileInfoView:this.view.featuresTilingScheme,layer:this.layer});return this.tileRenderer&&(this._tileStrategy.clear(),this.tileRenderer.uninstall(this.container),this.tileRenderer.destroy(),this.tileRenderer=null),this.destroyed?null:(this._proxy.tileRenderer=i,this._set("tileRenderer",i),this.tileRenderer.install(this.container),this.tileRenderer.onConfigUpdate(t),this.requestUpdate(),this.tileRenderer)}_createTileRendererHash(e){return`${e.type}`}get hasFilter(){const e=!!("floorInfo"in this.layer&&this.layer.floorInfo&&this.view.floors&&this.view.floors.length);return!!this.filter||e||!!this._visibilityOverrides.size||!!this.timeExtent}_injectOverrides(e){const t=l(e)?e.timeExtent:null,i=l(this.timeExtent)&&l(t)?this.timeExtent.intersection(t):this.timeExtent||t;let r=null;const s="floorInfo"in this.layer&&this.layer.floorInfo;if(s){const t=l(e)&&e.where;r=this._addFloorFilterClause(t)}if(!this._visibilityOverrides.size&&!i&&!s)return l(e)?e.toJSON():null;(e=l(e)&&e.clone()||new v).timeExtent=i,r&&(e.where=r);const a=e.toJSON();return a.hiddenIds=Array.from(this._visibilityOverrides),a}_addFloorFilterClause(e){const t=this.layer;let i=e||"";if("floorInfo"in t&&t.floorInfo){let e=this.view.floors;if(!e||!e.length)return i;t.floorInfo.viewAllLevelIds?.length&&(e=t.floorInfo.viewAllLevelIds);const r=e.filter((e=>""!==e)).map((e=>"'"+e+"'"));r.push("''");const s=t.floorInfo.floorField;let a="("+s+" IN ({ids}) OR "+s+" IS NULL)";if(a=a.replace("{ids}",r.join(", ")),l(i)&&i.includes(s)){let e=new RegExp("AND \\("+s+".*NULL\\)","g");i=i.replace(e,""),e=new RegExp("\\("+s+".*NULL\\)","g"),i=i.replace(e,""),i=i.replace(/\s+/g," ").trim()}i=""!==i?"("+i+") AND "+a:a}return""!==i?i:null}_createConfiguration(e,t,i){const r="feature"===this.layer.type&&this.layer.historicMoment?this.layer.historicMoment.getTime():void 0,s="feature"===this.layer.type?this.layer.gdbVersion:void 0,a=new Array(S),n=this._injectOverrides(t);a[0]=n,a[1]=l(i)?i.toJSON():null;const o=x(e);if(u(o))return null;const h=z("2d");return{availableFields:this.availableFields,gdbVersion:s,historicMoment:r,devicePixelRatio:window.devicePixelRatio||1,filters:a,schema:o,supportsTextureFloat:h.supportsTextureFloat,maxTextureSize:h.maxTextureSize}}_hasRequiredSupport(e){return!("renderer"in e)||C(e.renderer)}_onceTilesUpdated(){return this.requestUpdate(),c((()=>!this._pipelineIsUpdating))}_lockGPUUploads(){this.tileRenderer&&(this._uploadsLocked=!0,this.tileRenderer.lockGPUUploads())}_unlockGPUUploads(){this.tileRenderer&&(this._uploadsLocked=!1,this.tileRenderer.unlockGPUUploads())}_forceAttributeTextureUpload(){this.tileRenderer&&this.tileRenderer.forceAttributeTextureUpload()}_createSchemaConfig(){const e="feature"===this.layer.type?this.layer.historicMoment:null,t="feature"===this.layer.type?this.layer.gdbVersion:null;return{renderer:"renderer"in this.layer&&this.layer.renderer,spatialReference:this.layer.spatialReference,timeExtent:this.layer.timeExtent,definitionExpression:this.layer.definitionExpression,featureReduction:this.layer.featureReduction,fields:this.layer.fields,geometryType:this.layer.geometryType,historicMoment:e,labelsVisible:"labelsVisible"in this.layer&&this.layer.labelsVisible,labelingInfo:"labelingInfo"in this.layer&&this.layer.labelingInfo,availableFields:this.availableFields,featureEffect:this.featureEffect,filter:this.filter,gdbVersion:t,pixelBuffer:0,orderBy:"orderBy"in this.layer&&this.layer.orderBy?this.layer.orderBy:null,customParameters:{..."customParameters"in this.layer?this.layer.customParameters:void 0,token:"apiKey"in this.layer?this.layer.apiKey:void 0},subtypeCode:"subtypeCode"in this.layer?this.layer.subtypeCode:void 0,subtypeField:"subtypeField"in this.layer?this.layer.subtypeField:void 0}}_addHighlight(e){for(const t of e)if(this._highlightIds.has(t)){const e=this._highlightIds.get(t);this._highlightIds.set(t,e+1)}else this._highlightIds.set(t,1);this._updateHighlight().catch((e=>{p(e)||n.getLogger(this.declaredClass).error(e)}))}_removeHighlight(e){for(const t of e)if(this._highlightIds.has(t)){const e=this._highlightIds.get(t)-1;0===e?this._highlightIds.delete(t):this._highlightIds.set(t,e)}this._updateHighlight().catch((e=>{p(e)||n.getLogger(this.declaredClass).error(e)}))}_setLayersForFeature(e){const t=this.layer;e.layer=t,e.sourceLayer=t}_createGraphicHit(e,t){return this._setLayersForFeature(t),l(t.geometry)&&(t.geometry.spatialReference=this.view.spatialReference),{type:"graphic",graphic:t,layer:this.layer,mapPoint:e}}};e([g()],Q.prototype,"_serviceOptions",void 0),e([g()],Q.prototype,"_proxy",void 0),e([g()],Q.prototype,"_pipelineIsUpdating",void 0),e([g()],Q.prototype,"_effectiveRenderer",void 0),e([g()],Q.prototype,"_aggregateValueRanges",void 0),e([g()],Q.prototype,"_commandsQueue",void 0),e([g()],Q.prototype,"featureEffectView",void 0),e([g()],Q.prototype,"labelsVisible",null),e([g({readOnly:!0})],Q.prototype,"queryMode",null),e([g()],Q.prototype,"renderingConfigHash",null),e([g()],Q.prototype,"tileRenderer",void 0),e([g()],Q.prototype,"updating",void 0),Q=e([m("esri.views.2d.layers.FeatureLayerView2D")],Q);const A=Q;export{A as default};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../AggregateGraphic.js";import"../../../geometry.js";import i from"../../../Graphic.js";import r from"../../../core/Collection.js";import s from"../../../core/Error.js";import has from"../../../core/has.js";import{clone as a}from"../../../core/lang.js";import n from"../../../core/Logger.js";import{applySome as o,isSome as l,unwrap as h,isNone as u}from"../../../core/maybe.js";import{debounce as d,isAbortError as p}from"../../../core/promiseUtils.js";import{watch as y,whenOnce as c,initial as f}from"../../../core/reactiveUtils.js";import{property as g}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as m}from"../../../core/accessorSupport/decorators/subclass.js";import _ from"../../../layers/effects/FeatureEffectView.js";import v from"../../../layers/support/FeatureFilter.js";import b from"../../../rest/support/AggregateFeatureSet.js";import R from"../../../rest/support/FeatureSet.js";import S from"../../../rest/support/Query.js";import{MAX_FILTERS as x}from"../engine/webgl/definitions.js";import{LayerView2DMixin as w}from"./LayerView2D.js";import{createSchema as U}from"./features/schemaUtils.js";import{createOrReuseTileRenderer as C}from"./features/tileRenderers.js";import{isRendererSupported as F}from"./features/support/rendererUtils.js";import{findSizeVV as I,createClusterCountSizeVariable as q,isClusterCompatibleRenderer as O,createClusterRenderer as E}from"./support/clusterUtils.js";import T from"./support/FeatureCommandQueue.js";import j from"./support/FeatureLayerProxy.js";import{toJSONGeometryType as V}from"./support/util.js";import{TileManager as L}from"../tiling/TileManager.js";import N from"../../layers/FeatureLayerView.js";import A from"../../layers/LayerView.js";import P from"../../layers/RefreshableLayerView.js";import{getWebGLCapabilities as Q}from"../../webgl/capabilities.js";import k from"../../../geometry/Extent.js";function z(e){return e&&"openPorts"in e}let H=class extends(N(P(w(A)))){constructor(){super(...arguments),this._pipelineIsUpdating=!0,this._commandsQueue=new T({process:e=>{switch(e.type){case"processed-edit":return this._doEdit(e);case"refresh":return this._doRefresh(e.dataChanged);case"update":return this._doUpdate()}}}),this._visibilityOverrides=new Set,this._highlightIds=new Map,this._updateHighlight=d((async()=>this._proxy.setHighlight(Array.from(this._highlightIds.keys())))),this._uploadsLocked=!1,this._needsClusterSizeUpdate=!1,this.featureEffectView=new _,this._lastDefinitionExpression=null}destroy(){o(this._updateClusterSizeTask,(e=>e.remove())),this._proxy?.destroy(),this._commandsQueue.destroy()}initialize(){this.addResolvingPromise(Promise.all([this._initProxy(),this._initServiceOptions()])),this.handles.add([this.on("valueRangesChanged",(e=>{this._set("_aggregateValueRanges",e.valueRanges)})),y((()=>this.featureEffect),(e=>{this.featureEffectView.featureEffect=e}),{initial:!0,sync:!0})])}async _initProxy(){const e=this.layer;if("isTable"in e&&e.isTable)throw new s("featurelayerview:table-not-supported","table feature layer can't be displayed",{layer:this.layer});const t="feature"===e.type||"subtype-group"===e.type,i="capabilities"in e&&e.capabilities.operations.supportsQuery;if(t&&!i)throw new s("featurelayerview:query-not-supported","layer view requires a layer with query capability",{layer:e});this._proxy&&this._proxy.destroy();const r=this._createClientOptions();return this._set("_proxy",new j({client:r})),this._proxy.when()}async _initServiceOptions(){return this._set("_serviceOptions",await this._createServiceOptions()),this._serviceOptions}get orderByFields(){return"stream"!==this._serviceOptions.type&&this._serviceOptions.orderByFields}get labelsVisible(){const e="subtype-group"===this.layer.type?this.layer.sublayers.items:[this.layer];return!this.suspended&&e.some((e=>e.labelingInfo&&e.labelsVisible))}get queryMode(){return this._serviceOptions.type}get renderingConfigHash(){if(!this.layer)return null;const e=this.availableFields,t=this.layer,i=this.view.floors,{definitionExpression:r}=t,s="subtype-group"!==this.layer.type&&this.layer.labelsVisible&&this.layer.labelingInfo,a="renderer"in t&&t.renderer,n="feature"===t.type?t.gdbVersion:void 0,o="feature"===t.type&&t.historicMoment?t.historicMoment.getTime():void 0,{timeExtent:h}=this,u="customParameters"in t?JSON.stringify(t.customParameters):void 0,d="apiKey"in t?t.apiKey:void 0,p="stream"===t.type?`${JSON.stringify(t.geometryDefinition)}${t.definitionExpression}`:null,y=JSON.stringify(this.clips),c=t.featureReduction&&t.featureReduction.toJSON(),f="orderBy"in this.layer&&JSON.stringify(this.layer.orderBy),g="sublayers"in this.layer&&this.layer.sublayers.items.reduce(((e,t)=>e+`${t.visible?1:0}.${JSON.stringify(t.renderer)}.${t.labelsVisible}\n.${JSON.stringify(t.labelingInfo)}`),""),m="subtypeCode"in this.layer&&this.layer.subtypeCode;return JSON.stringify({orderBy:f,sublayerHash:g,subtypeCode:m,filterHash:l(this.filter)&&this.filter.toJSON(),effectHash:l(this.featureEffect)&&this.featureEffect.toJSON(),streamFilter:p,gdbVersion:n,definitionExpression:r,historicMoment:o,availableFields:e,renderer:a,labelingInfo:s,timeExtent:h,floors:i,clipsHash:y,featureReduction:c,customParameters:u,apiKey:d})}highlight(e){let t;return e instanceof i?t=[e.getObjectId()]:"number"==typeof e||"string"==typeof e?t=[e]:r.isCollection(e)&&e.length>0?t=e.map((e=>e?.getObjectId())).toArray():Array.isArray(e)&&e.length>0&&(t="number"==typeof e[0]||"string"==typeof e[0]?e:e.map((e=>e?.getObjectId()))),t=t?.filter((e=>null!=e)),t&&t.length?(this._addHighlight(t),{remove:()=>this._removeHighlight(t)}):{remove:()=>{}}}hasHighlight(){return!!this._highlightIds.size}async hitTest(e,r){if(!this.tileRenderer)return null;const s=await this.tileRenderer.hitTest(r);if(0===s.length)return null;const{features:a,aggregates:n}=await this._proxy.getFeatures(s);return[...n.map((i=>this._createGraphicHit(e,t.fromJSON(i)))),...a.map((t=>this._createGraphicHit(e,i.fromJSON(t))))]}queryStatistics(){return this._proxy.queryStatistics()}async querySummaryStatistics(e,t,i){const r={...t,scale:this.view.scale};return this._proxy.querySummaryStatistics(this._cleanUpQuery(e),r,i)}async queryUniqueValues(e,t,i){const r={...t,scale:this.view.scale};return this._proxy.queryUniqueValues(this._cleanUpQuery(e),r,i)}async queryClassBreaks(e,t,i){const r={...t,scale:this.view.scale};return this._proxy.queryClassBreaks(this._cleanUpQuery(e),r,i)}async queryHistogram(e,t,i){const r={...t,scale:this.view.scale};return this._proxy.queryHistogram(this._cleanUpQuery(e),r,i)}queryFeatures(e,t){return this.queryFeaturesJSON(e,t).then((e=>{const t=R.fromJSON(e);return t.features.forEach((e=>this._setLayersForFeature(e))),t}))}queryVisibleFeatures(e,t){return this._proxy.queryVisibleFeatures(this._cleanUpQuery(e),t).then((e=>{const t=R.fromJSON(e);return t.features.forEach((e=>this._setLayersForFeature(e))),t}))}async queryAggregates(e,t){const i=await this._proxy.queryAggregates(this._cleanUpAggregateQuery(e),t),r=b.fromJSON(i);return r.features.forEach((e=>this._setLayersForFeature(e))),r}queryAggregateIds(e,t){return this._proxy.queryAggregateIds(this._cleanUpAggregateQuery(e),t)}queryAggregateCount(e,t){return this._proxy.queryAggregateCount(this._cleanUpAggregateQuery(e),t)}queryAggregateJSON(e,t){return this._proxy.queryAggregates(this._cleanUpAggregateQuery(e),t)}queryFeaturesJSON(e,t){return this._proxy.queryFeatures(this._cleanUpQuery(e),t)}queryObjectIds(e,t){return this._proxy.queryObjectIds(this._cleanUpQuery(e),t)}queryFeatureCount(e,t){return this._proxy.queryFeatureCount(this._cleanUpQuery(e),t)}queryExtent(e,t){return this._proxy.queryExtent(this._cleanUpQuery(e),t).then((e=>({count:e.count,extent:k.fromJSON(e.extent)})))}setVisibility(e,t){t?this._visibilityOverrides.delete(e):this._visibilityOverrides.add(e),this._update()}update(e){if(!this._tileStrategy||!this.tileRenderer)return;const{hasMissingTiles:t,added:i,removed:r}=this._tileStrategy.update(e);(i.length||r.length)&&this._proxy.updateTiles({added:i,removed:r}),t&&this.requestUpdate(),this.notifyChange("updating")}attach(){this.view.timeline.record(`${this.layer.title} (FeatureLayer) Attach`),this._tileStrategy=new L({acquireTile:e=>this._acquireTile(e),releaseTile:e=>this._releaseTile(e),tileInfoView:this.view.featuresTilingScheme,buffer:0}),this.handles.add(y((()=>this.renderingConfigHash),(()=>this._update()),f),"attach"),"stream"!==this.layer.type&&this.handles.add(this.layer.on("edits",(e=>this._edit(e))),"attach")}detach(){this._commandsQueue.clear(),this._proxy?.stop(),this.container.removeAllChildren(),this.handles.remove("attach"),this.tileRenderer&&(this.tileRenderer.uninstall(this.container),this.tileRenderer=null),this._tileStrategy&&(this._tileStrategy.destroy(),this._tileStrategy=null),this._tileRendererHash=null}moveStart(){this.requestUpdate()}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}isUpdating(){const e="renderer"in this.layer&&null!=this.layer.renderer,t=this._commandsQueue.updating,i=null!=this._updatingRequiredFieldsPromise,r=!this._proxy||!this._proxy.isReady,s=this._pipelineIsUpdating,a=null==this.tileRenderer||this.tileRenderer?.updating,n=e&&(t||i||r||s||a);return has("esri-2d-log-updating")&&console.log(`Updating FLV2D: ${n}\n -> hasRenderer ${e}\n -> hasPendingCommand ${t}\n -> updatingRequiredFields ${i}\n -> updatingProxy ${r}\n -> updatingPipeline ${s}\n -> updatingTileRenderer ${a}\n`),n}_createClientOptions(){return{setUpdating:e=>{this._set("_pipelineIsUpdating",e)},emitEvent:e=>{this.emit(e.name,e.event)}}}async _detectQueryMode(e){const t="path"in e,i="editingInfo"in this.layer&&this.layer.editingInfo?.lastEditDate,r=!!this.layer.refreshInterval,s=!i&&r;if(t&&("feature"===this.layer.type||"subtype-group"===this.layer.type)&&"point"===this.layer.geometryType&&this.layer.capabilities.query.supportsPagination&&!this.layer.capabilities.operations.supportsEditing&&!s&&has("featurelayer-snapshot-enabled"))try{const e=await this.layer.queryFeatureCount();if(e<=has("featurelayer-snapshot-point-min-threshold"))return{mode:"snapshot",featureCount:e};const t=has("featurelayer-snapshot-point-max-threshold"),i=has("featurelayer-snapshot-point-coverage"),r=this.view.extent,s=h(this.layer.fullExtent),a=s?.clone().intersection(r),n=l(a)?a.width*a.height:0,o=s?.width*s?.height,u=0===o?0:n/o;if(e<=t&&u>=i)return{mode:"snapshot",featureCount:e}}catch(a){n.getLogger(this.declaredClass).warn("mapview-feature-layer","Encountered an error when querying for featureCount",{error:a})}return{mode:"on-demand"}}async _createServiceOptions(){const e=this.layer;if("stream"===e.type)return null;const{capabilities:t,objectIdField:i}=e,r=e.fields.map((e=>e.toJSON())),s=l(e.fullExtent)&&e.fullExtent.toJSON(),n=V(e.geometryType),o=e.timeInfo&&e.timeInfo.toJSON()||null,h=e.spatialReference?e.spatialReference.toJSON():null,u="feature"===e.type?e.globalIdField:null;let d;"ogc-feature"===e.type?d=e.source.getSource():z(e.source)?d=await e.source.openPorts():e.parsedUrl&&(d=a(e.parsedUrl),"dynamicDataSource"in e&&e.dynamicDataSource&&(d.query={layer:JSON.stringify({source:e.dynamicDataSource})}));const p="datesInUnknownTimezone"in this.layer&&this.layer.datesInUnknownTimezone,y=("subtypeField"in this.layer&&this.layer.subtypeField)??null,{mode:c,featureCount:f}=await this._detectQueryMode(d);let g=this.layer.objectIdField;if("feature"===this.layer.type&&l(this.layer.orderBy)&&this.layer.orderBy.length){const e=!this.layer.orderBy[0].valueExpression&&this.layer.orderBy[0].field;e&&(g=e)}return{type:c,timeReferenceUnknownClient:p,subtypeField:y,featureCount:f,globalIdField:u,maxRecordCount:t.query.maxRecordCount,tileMaxRecordCount:t.query.tileMaxRecordCount,capabilities:t,fields:r,fullExtent:s,geometryType:n,objectIdField:i,source:d,timeInfo:o,spatialReference:h,orderByFields:g}}async _createMemoryServiceOptions(e){const t=await e.openPorts();return{...this._createServiceOptions(),type:"memory",source:t}}_cleanUpQuery(e){const t=S.from(e)||this.createQuery();return t.outSpatialReference||(t.outSpatialReference=this.view.spatialReference),t}_cleanUpAggregateQuery(e){const t=S.from(e)||this.createAggregateQuery();return t.outSpatialReference||(t.outSpatialReference=this.view.spatialReference),t}async _update(){return this._commandsQueue.push({type:"update"})}async _edit(e){if(this.suspended)return void this._clearTiles();return this._validateEdit(e)?this._commandsQueue.push({type:"edit",edits:e}):void 0}async doRefresh(e){if(this._tileStrategy.tileKeys().length)return this.suspended&&e?void this._clearTiles():this._commandsQueue.push({type:"refresh",dataChanged:e})}_clearTiles(){this._tileStrategy.tileKeys().length&&(this._proxy.updateTiles({added:[],removed:this._tileStrategy.tileKeys()}),this._tileStrategy.clear(),this.requestUpdate(),this._commandsQueue.clear(),this._update())}_validateEdit(e){const t="globalIdField"in this.layer&&this.layer.globalIdField,i=e.deletedFeatures.some((e=>-1===e.objectId||!e.objectId)),r=t&&this.availableFields.includes(t);return i&&!r?(n.getLogger(this.declaredClass).error(new s("mapview-apply-edits",`Editing the specified service requires the layer's globalIdField, ${t} to be included the layer's outFields for updates to be reflected on the map`)),null):e}async _doUpdate(){try{if(this.destroyed||!this._hasRequiredSupport(this.layer)||!this._tileStrategy)return;const{featureEffectView:t,filter:i}=this;await this._updateRequiredFields();const{renderer:r}=this._getEffectiveRenderer();this._set("_effectiveRenderer",r);const s=this._createSchemaConfig(),a=this._createConfiguration(s,i,t.filter),o=this._lastDefinitionExpression!==a.schema.source.definitionExpression;this._lastDefinitionExpression=a.schema.source.definitionExpression;const l=a.schema.tileRenderer,h=this._createTileRendererHash(l);if("snapshot"===this._serviceOptions.type&&(a.schema.source.featureCount=this._serviceOptions.featureCount),h!==this._tileRendererHash){await this._initTileRenderer(l,r);const e=this.layer,t="stream"===e.type?await this._initServiceOptions():this._serviceOptions;this.tileRenderer.onConfigUpdate(r),"stream"!==e.type&&z(e.source)&&(t.source=await e.source.openPorts());const i={added:this._tileStrategy.tileKeys(),removed:[]};await this._proxy.startup(this.view.featuresTilingScheme,a,t,i),this.hasHighlight()&&await this._proxy.setHighlight(Array.from(this._highlightIds.keys())),await this._onceTilesUpdated(),this.tileRenderer.onConfigUpdate(r)}else{"snapshot"===this._serviceOptions.type&&o&&(a.schema.source.featureCount=await this.layer.queryFeatureCount());const t=await this._proxy.update(a);(t.mesh||t.targets.aggregate)&&this._lockGPUUploads();try{await this._proxy.applyUpdate(t)}catch(e){p(e)||n.getLogger(this.declaredClass).error(e)}(t.mesh||t.targets.aggregate)&&this._unlockGPUUploads(),this.tileRenderer.onConfigUpdate(r),this._updateClusterSizeVariable(),this._forceAttributeTextureUpload()}this._tileRendererHash=h,this.tileRenderer.invalidateLabels(),this.requestUpdate()}catch(e){}}async _doEdit(e){try{await this._proxy.onEdits(e)}catch(t){p(t),0}}async _doRefresh(e){this._lockGPUUploads();try{await this._proxy.refresh(e)}catch(t){p(t),0}this._unlockGPUUploads(),this.layer?.featureReduction&&this._updateClusterSizeVariable()}_updateClusterSizeVariable(){this._needsClusterSizeUpdate&&(this.tileRenderer.onConfigUpdate(this._effectiveRenderer),this._needsClusterSizeUpdate=!1)}_createUpdateClusterSizeTask(e,t){return y((()=>this._aggregateValueRanges),(i=>{this._updateClusterEffectiveRendererSizeVariable(e,t,i),this._needsClusterSizeUpdate=!0,this._uploadsLocked||this._updateClusterSizeVariable()}))}async _updateClusterEffectiveRendererSizeVariable(e,t,i){if(e.dynamicClusterSize&&"visualVariables"in e&&e.visualVariables){const r=I(e.visualVariables);if(l(r)&&"cluster_count"===r.field){const s=e.visualVariables.indexOf(r);e.visualVariables[s]=q(t,i);const a=e.clone();a.dynamicClusterSize=!0,this._set("_effectiveRenderer",a)}}}_getEffectiveRenderer(){const e="renderer"in this.layer&&this.layer.renderer,t=this.layer.featureReduction;if(l(this._updateClusterSizeTask)&&(this._updateClusterSizeTask.remove(),this._updateClusterSizeTask=null),t&&"renderer"in t&&t.renderer){const e=t.fields;return{renderer:t.renderer,aggregateFields:e,featureReduction:t}}if(t&&"cluster"===t.type&&O(e)){const i=t,r=[],s=E(r,e,i,this._aggregateValueRanges);return o(this._updateClusterSizeTask,(e=>e.remove())),this._updateClusterSizeTask=this._createUpdateClusterSizeTask(s,i),{renderer:s,aggregateFields:r,featureReduction:t}}return{renderer:e,aggregateFields:[],featureReduction:null}}_acquireTile(e){const t=this.tileRenderer.acquireTile(e);return t.once("attach",(()=>{this.requestUpdate()})),t}_releaseTile(e){this.tileRenderer.releaseTile(e)}async _initTileRenderer(e,t){const i=await C(e,{layerView:this,tileInfoView:this.view.featuresTilingScheme,layer:this.layer});return this.tileRenderer&&(this._tileStrategy.clear(),this.tileRenderer.uninstall(this.container),this.tileRenderer.destroy(),this.tileRenderer=null),this.destroyed?null:(this._proxy.tileRenderer=i,this._set("tileRenderer",i),this.tileRenderer.install(this.container),this.tileRenderer.onConfigUpdate(t),this.requestUpdate(),this.tileRenderer)}_createTileRendererHash(e){return`${e.type}`}get hasFilter(){const e=!!("floorInfo"in this.layer&&this.layer.floorInfo&&this.view.floors&&this.view.floors.length);return!!this.filter||e||!!this._visibilityOverrides.size||!!this.timeExtent}_injectOverrides(e){const t=l(e)?e.timeExtent:null,i=l(this.timeExtent)&&l(t)?this.timeExtent.intersection(t):this.timeExtent||t;let r=null;const s="floorInfo"in this.layer&&this.layer.floorInfo;if(s){const t=l(e)&&e.where;r=this._addFloorFilterClause(t)}if(!this._visibilityOverrides.size&&!i&&!s)return l(e)?e.toJSON():null;(e=l(e)&&e.clone()||new v).timeExtent=i,r&&(e.where=r);const a=e.toJSON();return a.hiddenIds=Array.from(this._visibilityOverrides),a}_addFloorFilterClause(e){const t=this.layer;let i=e||"";if("floorInfo"in t&&t.floorInfo){let e=this.view.floors;if(!e||!e.length)return i;t.floorInfo.viewAllLevelIds?.length&&(e=t.floorInfo.viewAllLevelIds);const r=e.filter((e=>""!==e)).map((e=>"'"+e+"'"));r.push("''");const s=t.floorInfo.floorField;let a="("+s+" IN ({ids}) OR "+s+" IS NULL)";if(a=a.replace("{ids}",r.join(", ")),l(i)&&i.includes(s)){let e=new RegExp("AND \\("+s+".*NULL\\)","g");i=i.replace(e,""),e=new RegExp("\\("+s+".*NULL\\)","g"),i=i.replace(e,""),i=i.replace(/\s+/g," ").trim()}i=""!==i?"("+i+") AND "+a:a}return""!==i?i:null}_createConfiguration(e,t,i){const r="feature"===this.layer.type&&this.layer.historicMoment?this.layer.historicMoment.getTime():void 0,s="feature"===this.layer.type?this.layer.gdbVersion:void 0,a=new Array(x),n=this._injectOverrides(t);a[0]=n,a[1]=l(i)?i.toJSON():null;const o=U(e);if(u(o))return null;const h=Q("2d");return{availableFields:this.availableFields,gdbVersion:s,historicMoment:r,devicePixelRatio:window.devicePixelRatio||1,filters:a,schema:o,supportsTextureFloat:h.supportsTextureFloat,maxTextureSize:h.maxTextureSize}}_hasRequiredSupport(e){return!("renderer"in e)||F(e.renderer)}_onceTilesUpdated(){return this.requestUpdate(),c((()=>!this._pipelineIsUpdating))}_lockGPUUploads(){this.tileRenderer&&(this._uploadsLocked=!0,this.tileRenderer.lockGPUUploads())}_unlockGPUUploads(){this.tileRenderer&&(this._uploadsLocked=!1,this.tileRenderer.unlockGPUUploads())}_forceAttributeTextureUpload(){this.tileRenderer&&this.tileRenderer.forceAttributeTextureUpload()}_createSchemaConfig(){const e="feature"===this.layer.type?this.layer.historicMoment:null,t="feature"===this.layer.type?this.layer.gdbVersion:null;return{renderer:"renderer"in this.layer&&this.layer.renderer,spatialReference:this.layer.spatialReference,timeExtent:this.layer.timeExtent,definitionExpression:this.layer.definitionExpression,featureReduction:this.layer.featureReduction,fields:this.layer.fields,geometryType:this.layer.geometryType,historicMoment:e,labelsVisible:"labelsVisible"in this.layer&&this.layer.labelsVisible,labelingInfo:"labelingInfo"in this.layer&&this.layer.labelingInfo,availableFields:this.availableFields,featureEffect:this.featureEffect,filter:this.filter,gdbVersion:t,pixelBuffer:0,orderBy:"orderBy"in this.layer&&this.layer.orderBy?this.layer.orderBy:null,customParameters:{..."customParameters"in this.layer?this.layer.customParameters:void 0,token:"apiKey"in this.layer?this.layer.apiKey:void 0},subtypeCode:"subtypeCode"in this.layer?this.layer.subtypeCode:void 0,subtypeField:"subtypeField"in this.layer?this.layer.subtypeField:void 0}}_addHighlight(e){for(const t of e)if(this._highlightIds.has(t)){const e=this._highlightIds.get(t);this._highlightIds.set(t,e+1)}else this._highlightIds.set(t,1);this._updateHighlight().catch((e=>{p(e)||n.getLogger(this.declaredClass).error(e)}))}_removeHighlight(e){for(const t of e)if(this._highlightIds.has(t)){const e=this._highlightIds.get(t)-1;0===e?this._highlightIds.delete(t):this._highlightIds.set(t,e)}this._updateHighlight().catch((e=>{p(e)||n.getLogger(this.declaredClass).error(e)}))}_setLayersForFeature(e){const t=this.layer;e.layer=t,e.sourceLayer=t}_createGraphicHit(e,t){return this._setLayersForFeature(t),l(t.geometry)&&(t.geometry.spatialReference=this.view.spatialReference),{type:"graphic",graphic:t,layer:this.layer,mapPoint:e}}};e([g()],H.prototype,"_serviceOptions",void 0),e([g()],H.prototype,"_proxy",void 0),e([g()],H.prototype,"_pipelineIsUpdating",void 0),e([g()],H.prototype,"_effectiveRenderer",void 0),e([g()],H.prototype,"_aggregateValueRanges",void 0),e([g()],H.prototype,"_commandsQueue",void 0),e([g()],H.prototype,"featureEffectView",void 0),e([g()],H.prototype,"labelsVisible",null),e([g({readOnly:!0})],H.prototype,"queryMode",null),e([g()],H.prototype,"renderingConfigHash",null),e([g()],H.prototype,"tileRenderer",void 0),e([g()],H.prototype,"updating",void 0),H=e([m("esri.views.2d.layers.FeatureLayerView2D")],H);const J=H;export{J as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.25/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../../chunks/tslib.es6.js";import{HandleOwner as t}from"../../../../../core/HandleOwner.js";import has from"../../../../../core/has.js";import{isNone as r,applySome as s,isSome as i,filterNones as a}from"../../../../../core/maybe.js";import{ignoreAbortErrors as o,after as n,throwIfAborted as u,throwIfNotAbortError as h,isAbortError as g}from"../../../../../core/promiseUtils.js";import{when as d,whenOnce as c}from"../../../../../core/reactiveUtils.js";import{property as l}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/arrayUtils.js";import"../../../../../core/accessorSupport/ensureType.js";import{subclass as p}from"../../../../../core/accessorSupport/decorators/subclass.js";import{convertToGeometry as f}from"../../../../../layers/graphics/featureConversionUtils.js";import{QueryEngine as y}from"../../../../../layers/graphics/data/QueryEngine.js";import m from"../../../../../layers/support/FieldsIndex.js";import{FeatureStore2D as S}from"../FeatureStore2D.js";import{createSource as _}from"../sources/createSource.js";import v from"../support/AttributeStore.js";import{BinStore as b}from"../support/BinStore.js";import{ClusterStore as I}from"../support/ClusterStore.js";import{ComputedAttributeStorage as w}from"../support/ComputedAttributeStorage.js";import{FeatureSetReaderJSON as C}from"../support/FeatureSetReaderJSON.js";import{UpdateToken as E}from"../support/UpdateToken.js";import{QueueProcessor as j}from"../../../../support/QueueProcessor.js";const F=5e3,T="tileRenderer.featuresView.attributeView.initialize",k="tileRenderer.featuresView.attributeView.requestUpdate",q="tileRenderer.featuresView.requestRender";function R(e){return"worker:port-closed"===e.name}function U(e){if(!g(e)&&!R(e))throw e}function x(e){return"feature"===e.type&&"snapshot"===e.mode}let Q=class extends t{constructor(){super(...arguments),this._storage=new w,this._markedIdsBufId=this._storage.createBitset(),this._lastCleanup=performance.now(),this._cleanupNeeded=!1,this._invalidated=!1,this._tileToResolver=new Map,this._didEdit=!1,this._updateVersion=1,this.tileStore=null,this.config=null,this.processor=null,this.remoteClient=null,this.service=null}initialize(){this._initStores(),this._initSource(),this._updateQueue=new j({concurrency:"geoevent"===this._source.type?1:4,process:(e,t)=>this._onTileMessage(e,{signal:t})}),this.handles.add([this.tileStore.on("update",this.onTileUpdate.bind(this)),d((()=>!this.updating),(()=>this.onIdle()))]),this._checkUpdating=setInterval((()=>this.notifyChange("updating")),300)}_initSource(){const e=this.tileStore.tileScheme,t=()=>this._updateQueue.length<50,r=(e,t)=>(this._invalidated=!0,this._patchTile(e,t));this._source=_(this.service,this.spatialReference,e,r,t,this.featureStore),this._proxyEvents()}_proxyEvents(){if("geoevent"===this._source.type){const e=this._source.events;this.handles.add([e.on("connectionStatus",(e=>this.remoteClient.invoke("setProperty",{propertyName:"connectionStatus",value:e}).catch(U))),e.on("errorString",(e=>this.remoteClient.invoke("setProperty",{propertyName:"errorString",value:e}).catch(U))),e.on("data-received",(e=>this.remoteClient.invoke("emitEvent",{name:"data-received",event:{attributes:e.attributes,centroid:e.centroid,geometry:e.geometry}}).catch(U))),e.on("updateRate",(e=>this.remoteClient.invoke("emitEvent",{name:"update-rate",event:{...e}}).catch(U)))])}}_initAttributeStore(e){this.attributeStore?this.attributeStore.invalidateResources():this.attributeStore=new v({type:"remote",initialize:(e,t)=>o(this.remoteClient.invoke(T,e,{signal:t}).catch(U)),update:(e,t)=>o(this.remoteClient.invoke(k,e,{signal:t}).catch(U)),render:e=>o(this.remoteClient.invoke(q,void 0,{signal:e}).catch(U))},e,(()=>this.notifyChange("updating")))}_initStores(){const e="snapshot"===this.service.type?"snapshot":"on-demand",t={geometryInfo:{geometryType:this.service.geometryType,hasM:!1,hasZ:!1},spatialReference:this.spatialReference,fieldsIndex:this.fieldsIndex,fields:this.service.fields};this.featureStore=new S(t,this._storage,e)}_initQueryEngine(e){const t=this;this.queryEngine?.destroy(),this.queryEngine=new y({definitionExpression:e.schema.source.definitionExpression,fields:this.service.fields,geometryType:this.service.geometryType,objectIdField:this.service.objectIdField,hasM:!1,hasZ:!1,spatialReference:this.spatialReference.toJSON(),cacheSpatialQueries:!0,featureStore:this.featureStore,aggregateAdapter:{getFeatureObjectIds(e){if(r(t.aggregateStore))return[];return t.aggregateStore.getFeatureDisplayIdsForAggregate(e).map((e=>t.getObjectId(e)))}},timeInfo:this.service.timeInfo})}destroy(){this._updateQueue.destroy(),this._source.destroy(),this.queryEngine.destroy(),this.attributeStore&&this.attributeStore.destroy();for(const e of this.tileStore.tiles)this._source.unsubscribe(e);clearInterval(this._checkUpdating)}get fieldsIndex(){return new m(this.service.fields)}get spatialReference(){return this.tileStore.tileScheme.spatialReference}get updating(){return this.isUpdating()}isUpdating(){const e=this._source.updating,t=!!this._updateQueue.length,r=!this.attributeStore||this.attributeStore.isUpdating(),s=e||t||r;return has("esri-2d-log-updating")&&console.log(`Updating FeatureController2D: ${s}\n -> updatingSource ${e}\n -> updateQueue ${t}\n -> updatingAttributeStore ${r}\n`),s}enableEvent(e){this._source.enableEvent(e.name,e.value)}pause(){this._updateQueue.pause(),this._updateQueue.clear()}resume(){this._updateQueue.resume()}pauseStream(){"geoevent"===this._source.type&&this._source.pauseStream()}resumeStream(){"geoevent"===this._source.type&&this._source.resumeStream()}_initAggregateStore(e){const t={geometryInfo:{geometryType:this.service.geometryType,hasM:!1,hasZ:!1},spatialReference:this.spatialReference,fieldsIndex:this.fieldsIndex,fields:this.service.fields},r=e.schema.targets?.aggregate?.type,a=s(this.config,(e=>e.schema.targets?.aggregate?.type));if(a!==r&&(i(this.aggregateStore)&&(this.handles.remove("valueRangesChanged"),this.aggregateStore.destroy(),this.aggregateStore=null),r)){switch(r){case"cluster":this.aggregateStore=new I(t,this.spatialReference,this._storage,this.service),this.handles.add(this.aggregateStore.events.on("valueRangesChanged",(e=>{this.remoteClient.invoke("emitEvent",{name:"valueRangesChanged",event:{valueRanges:e.valueRanges}}).catch(U)})),"valueRangesChanged");break;case"bin":this.aggregateStore=new b(t,this.spatialReference,this._storage,this.service)}this.aggregateStore.onTileUpdate({added:this.tileStore.tiles,removed:[]})}}async update(e,t){this._updateVersion++,this._initQueryEngine(t),this._initAttributeStore(t),this.pause(),await Promise.all([this._source.update(e,t.schema.source),this.featureStore.updateSchema(e,t.schema.targets.feature),this.attributeStore.update(e,t),this.attributeStore.updateFilters(e,t,this)]),this._initAggregateStore(t),i(this.aggregateStore)&&await this.aggregateStore.updateSchema(e,t.schema.targets.aggregate),has("esri-2d-update-debug")&&e.describe(),this._set("config",t)}async applyUpdate(e){e.version=this._updateVersion,has("esri-2d-update-debug")&&console.debug(`Applying update ${e.version}`),e.mesh&&this.clearTiles(),this._updateQueue.resume(),await this._source.applyUpdate(e),this.notifyChange("updating"),await c((()=>!this.updating)),i(this.aggregateStore)&&(await n(10),await c((()=>!this.updating)))}async onEdits({edits:e}){has("esri-2d-update-debug")&&console.debug("Applying Edit:",e),this._didEdit=!0;try{const t=e.removed.map((e=>e.objectId&&-1!==e.objectId?e.objectId:this._lookupObjectIdByGlobalId(e.globalId))),r=e.addOrModified.map((({objectId:e})=>e));this.featureStore.invalidate(),await this._source.edit(r,t),this.clearTiles(),this.notifyChange("updating"),i(this.aggregateStore)&&this.aggregateStore.clear(),await this._source.resend(),await c((()=>!this.updating))}catch(t){}}async refresh(e){if(!e){const e=E.empty();return e.storage.filters=!0,this.applyUpdate(e)}this.featureStore.invalidate(),this.clearTiles(),this._source.refresh(this._updateVersion),this._cleanupNeeded=!0,this.notifyChange("updating"),await c((()=>!this.updating))}clearTiles(){for(const e of this.tileStore.tiles)this.processor.onTileClear(e)}onTileUpdate(e){i(this.aggregateStore)&&this.aggregateStore.onTileUpdate(e);for(const t of e.added)this._source.subscribe(t,this._updateVersion),this._level=t.level;for(const t of e.removed)this._source.unsubscribe(t),this._cleanupNeeded=!0,this._tileToResolver.has(t.id)&&(this._tileToResolver.get(t.id).resolve(),this._tileToResolver.delete(t.id));this.notifyChange("updating")}async onIdle(){this._invalidated&&(this._invalidated=!1,(i(this.aggregateStore)||"heatmap"===this.processor.type)&&await this._repushCurrentLevelTiles()),this._markAndSweep()}async querySummaryStatistics({query:e,params:t}){return this.queryEngine.executeQueryForSummaryStatistics(e,t)}async queryUniqueValues({query:e,params:t}){return this.queryEngine.executeQueryForUniqueValues(e,t)}async queryClassBreaks({query:e,params:t}){return this.queryEngine.executeQueryForClassBreaks(e,t)}async queryHistogram({query:e,params:t}){return this.queryEngine.executeQueryForHistogram(e,t)}queryExtent(e){return this.queryEngine.executeQueryForExtent(e)}queryFeatures(e){return this.queryEngine.executeQuery(e)}async queryVisibleFeatures(e){const t=await this.queryEngine.executeQuery(e),r=t.objectIdFieldName;return t.features=t.features.filter((e=>{const t=e.attributes[r],i=this.getDisplayId(t);return s(i,(e=>this.attributeStore.isVisible(e)))})),t}queryFeatureCount(e){return this.queryEngine.executeQueryForCount(e)}queryLatestObservations(e){return this.queryEngine.executeQueryForLatestObservations(e)}queryObjectIds(e){return this.queryEngine.executeQueryForIds(e)}async queryStatistics(){return this.featureStore.storeStatistics}getObjectId(e){return this.featureStore.lookupObjectId(e,this._storage)}getDisplayId(e){if(i(this.aggregateStore)){const t=this.aggregateStore.getDisplayId(e);if(r(t)){const t=this.featureStore.lookupDisplayId(e);return this.aggregateStore.getDisplayIdForReferenceId(t)}return t}return this.featureStore.lookupDisplayId(e)}getFeatures(e){const t=[],r=[];for(const s of e){const e=i(this.aggregateStore)?this.getAggregate(s):null;if(i(e))if(i(e.referenceId)){const r=this.getFeature(e.referenceId);i(r)&&t.push(r)}else r.push(e);else{const e=this.getFeature(s);i(e)&&t.push(e)}}return{features:t,aggregates:r}}getFeature(e){const t=this.featureStore.lookupFeatureByDisplayId(e,this._storage);if(r(t))return null;const s=t.readHydratedGeometry(),i=f(s,t.geometryType,t.hasZ,t.hasM);return{attributes:t.readAttributes(),geometry:i}}getAggregate(e){return r(this.aggregateStore)?null:this.aggregateStore.getAggregate(e)}getAggregates(){return r(this.aggregateStore)?[]:this.aggregateStore.getAggregates()}async setHighlight(e){const t=a(e.map((e=>this.getDisplayId(e))));return this.attributeStore.setHighlight(e,t)}_lookupObjectIdByGlobalId(e){const t=this.service.globalIdField;if(r(t))throw new Error("Expected globalIdField to be defined");let s=null;if(this.featureStore.forEach((r=>{e===r.readAttribute(t)&&(s=r.getObjectId())})),r(s))throw new Error(`Expected to find a feature with globalId ${e}`);return s}async _repushCurrentLevelTiles(){const e=this.tileStore.tiles.filter((e=>e.level===this._level)).map((async e=>this._patchTile({type:"append",id:e.key.id,addOrUpdate:C.fromOptimizedFeatures([],this.service),remove:[],end:!0,status:E.empty()})));await Promise.all(e)}_maybeForceCleanup(){performance.now()-this._lastCleanup>F&&this._markAndSweep()}_patchTile(e,t){const r=this._updateQueue.push(e,t).then((()=>{this.notifyChange("updating")})).catch((e=>{this.notifyChange("updating")}));return this.notifyChange("updating"),r}async _onTileMessage(e,t){u(t);const s=this.tileStore.get(e.id);if(!s)return;if(e.clear)return this.processor.onTileClear(s);const a=e.status;this._cleanupNeeded=!0;const o=[];for(const r of e.remove){const e=this.featureStore.lookupDisplayId(r);e&&o.push(e)}e.remove=o;try{if(r(e.addOrUpdate))return void this.processor.onTileMessage(s,{...e,addOrUpdate:null},i(this.aggregateStore),t).catch(h);if(e.addOrUpdate.setArcadeSpatialReference(this.spatialReference),this.featureStore.hasInstance(e.addOrUpdate.instance)&&a.targets.feature||(a.targets.feature=!0,this.featureStore.onTileData(s,e)),!a.storage.data||!a.storage.filters){a.storage.data=!0,a.storage.filters=!0,this.attributeStore.onTileData(s,e);"geoevent"===this._source.type||this._didEdit?(await this.attributeStore.sendUpdates(),u(t)):this.attributeStore.sendUpdates()}if(i(this.aggregateStore)&&!a.targets.aggregate){a.targets.aggregate=!0;const t=x(this._source)&&this._source.loading,r=!x(this._source)||t||e.end;if(this.aggregateStore.onTileData(s,e,this._storage,this.attributeStore,r),!r)return;a.mesh||(this.attributeStore.onTileData(s,e),await this.attributeStore.sendUpdates())}a.mesh||(a.mesh=!0,await this.processor.onTileMessage(s,e,i(this.aggregateStore),t),u(t)),this._maybeForceCleanup()}catch(n){h(n)}}_mark(e,t,r){const s=(4294901760&this._storage.getInstanceId(e))>>>16;e&&(t.add(s),r.set(e))}_markAndSweep(){this._lastCleanup=performance.now();if(!(!("feature"===this._source.type&&"snapshot"===this._source.mode)&&("geoevent"===this._source.type||this._cleanupNeeded)))return;this._cleanupNeeded=!1;const e=this._storage.getBitset(this._markedIdsBufId),t=new Set;e.clear();for(const r of this.tileStore.tiles)for(const s of this._source.readers(r.id)){const r=s.getCursor();for(;r.next();){let s=r.getDisplayId();if(!s){const e=r.getObjectId();s=this.featureStore.lookupDisplayId(e)}this._mark(s,t,e)}}"symbol"===this.processor.type&&this.processor.forEachBufferId((r=>{this._mark(r,t,e)})),this._updateQueue.forEach((r=>{for(const s of r.remove){const r=this.featureStore.lookupDisplayId(s);this._mark(r,t,e)}})),i(this.aggregateStore)&&(this.aggregateStore.sweepFeatures(e,this.featureStore),"sweepAggregates"in this.aggregateStore&&this.aggregateStore.sweepAggregates(this._storage,this.attributeStore,this._level)),this.featureStore.sweepFeatures(e,this._storage,this.attributeStore),this.featureStore.sweepFeatureSets(t)}};e([l({constructOnly:!0})],Q.prototype,"tileStore",void 0),e([l()],Q.prototype,"config",void 0),e([l({readOnly:!0})],Q.prototype,"fieldsIndex",null),e([l()],Q.prototype,"processor",void 0),e([l({constructOnly:!0})],Q.prototype,"remoteClient",void 0),e([l({constructOnly:!0})],Q.prototype,"service",void 0),e([l()],Q.prototype,"spatialReference",null),e([l()],Q.prototype,"updating",null),Q=e([p("esri.views.2d.layers.features.controllers.FeatureController2D")],Q);const O=Q;export{O as default};
5
+ import{_ as e}from"../../../../../chunks/tslib.es6.js";import{HandleOwner as t}from"../../../../../core/HandleOwner.js";import has from"../../../../../core/has.js";import{isNone as r,applySome as s,isSome as i,filterNones as a}from"../../../../../core/maybe.js";import{ignoreAbortErrors as o,after as n,throwIfAborted as u,throwIfNotAbortError as h,isAbortError as g}from"../../../../../core/promiseUtils.js";import{when as d,whenOnce as c}from"../../../../../core/reactiveUtils.js";import{property as l}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/arrayUtils.js";import"../../../../../core/accessorSupport/ensureType.js";import{subclass as p}from"../../../../../core/accessorSupport/decorators/subclass.js";import{convertToGeometry as f}from"../../../../../layers/graphics/featureConversionUtils.js";import{QueryEngine as y}from"../../../../../layers/graphics/data/QueryEngine.js";import m from"../../../../../layers/support/FieldsIndex.js";import{FeatureStore2D as S}from"../FeatureStore2D.js";import{createSource as _}from"../sources/createSource.js";import v from"../support/AttributeStore.js";import{BinStore as b}from"../support/BinStore.js";import{ClusterStore as I}from"../support/ClusterStore.js";import{ComputedAttributeStorage as w}from"../support/ComputedAttributeStorage.js";import{FeatureSetReaderJSON as Q}from"../support/FeatureSetReaderJSON.js";import{UpdateToken as E}from"../support/UpdateToken.js";import{QueueProcessor as C}from"../../../../support/QueueProcessor.js";const F=5e3,j="tileRenderer.featuresView.attributeView.initialize",T="tileRenderer.featuresView.attributeView.requestUpdate",k="tileRenderer.featuresView.requestRender";function R(e){return"worker:port-closed"===e.name}function x(e){if(!g(e)&&!R(e))throw e}function A(e){return"feature"===e.type&&"snapshot"===e.mode}let U=class extends t{constructor(){super(...arguments),this._storage=new w,this._markedIdsBufId=this._storage.createBitset(),this._lastCleanup=performance.now(),this._cleanupNeeded=!1,this._invalidated=!1,this._tileToResolver=new Map,this._didEdit=!1,this._updateVersion=1,this.tileStore=null,this.config=null,this.processor=null,this.remoteClient=null,this.service=null}initialize(){this._initStores(),this._initSource(),this._updateQueue=new C({concurrency:"geoevent"===this._source.type?1:4,process:(e,t)=>this._onTileMessage(e,{signal:t})}),this.handles.add([this.tileStore.on("update",this.onTileUpdate.bind(this)),d((()=>!this.updating),(()=>this.onIdle()))]),this._checkUpdating=setInterval((()=>this.notifyChange("updating")),300)}_initSource(){const e=this.tileStore.tileScheme,t=()=>this._updateQueue.length<50,r=(e,t)=>(this._invalidated=!0,this._patchTile(e,t));this._source=_(this.service,this.spatialReference,e,r,t,this.featureStore),this._proxyEvents()}_proxyEvents(){if("geoevent"===this._source.type){const e=this._source.events;this.handles.add([e.on("connectionStatus",(e=>this.remoteClient.invoke("setProperty",{propertyName:"connectionStatus",value:e}).catch(x))),e.on("errorString",(e=>this.remoteClient.invoke("setProperty",{propertyName:"errorString",value:e}).catch(x))),e.on("data-received",(e=>this.remoteClient.invoke("emitEvent",{name:"data-received",event:{attributes:e.attributes,centroid:e.centroid,geometry:e.geometry}}).catch(x))),e.on("updateRate",(e=>this.remoteClient.invoke("emitEvent",{name:"update-rate",event:{...e}}).catch(x)))])}}_initAttributeStore(e){this.attributeStore?this.attributeStore.invalidateResources():this.attributeStore=new v({type:"remote",initialize:(e,t)=>o(this.remoteClient.invoke(j,e,{signal:t}).catch(x)),update:(e,t)=>o(this.remoteClient.invoke(T,e,{signal:t}).catch(x)),render:e=>o(this.remoteClient.invoke(k,void 0,{signal:e}).catch(x))},e,(()=>this.notifyChange("updating")))}_initStores(){const e="snapshot"===this.service.type?"snapshot":"on-demand",t={geometryInfo:{geometryType:this.service.geometryType,hasM:!1,hasZ:!1},spatialReference:this.spatialReference,fieldsIndex:this.fieldsIndex,fields:this.service.fields};this.featureStore=new S(t,this._storage,e)}_initQueryEngine(e){const t=this;this.featureQueryEngine?.destroy(),this.featureQueryEngine=new y({definitionExpression:e.schema.source.definitionExpression,fields:this.service.fields,geometryType:this.service.geometryType,objectIdField:this.service.objectIdField,hasM:!1,hasZ:!1,spatialReference:this.spatialReference.toJSON(),cacheSpatialQueries:!0,featureStore:this.featureStore,aggregateAdapter:{getFeatureObjectIds(e){if(r(t.aggregateStore))return[];return t.aggregateStore.getFeatureDisplayIdsForAggregate(e).map((e=>t.getObjectId(e)))}},timeInfo:this.service.timeInfo})}_initAggregateQueryEngine(e){this.aggregateQueryEngine?.destroy(),r(e)||(this.aggregateQueryEngine=new y({definitionExpression:null,fields:e.fields,geometryType:e.geometryInfo.geometryType,objectIdField:e.objectIdField,hasM:e.geometryInfo.hasM,hasZ:e.geometryInfo.hasZ,spatialReference:this.spatialReference.toJSON(),cacheSpatialQueries:!1,featureStore:e,aggregateAdapter:{getFeatureObjectIds:e=>[]}}))}destroy(){this._updateQueue.destroy(),this._source.destroy(),this.featureQueryEngine?.destroy(),this.aggregateQueryEngine?.destroy(),this.attributeStore?.destroy();for(const e of this.tileStore.tiles)this._source.unsubscribe(e);clearInterval(this._checkUpdating)}get fieldsIndex(){return new m(this.service.fields)}get spatialReference(){return this.tileStore.tileScheme.spatialReference}get updating(){return this.isUpdating()}isUpdating(){const e=this._source.updating,t=!!this._updateQueue.length,r=!this.attributeStore||this.attributeStore.isUpdating(),s=e||t||r;return has("esri-2d-log-updating")&&console.log(`Updating FeatureController2D: ${s}\n -> updatingSource ${e}\n -> updateQueue ${t}\n -> updatingAttributeStore ${r}\n`),s}enableEvent(e){this._source.enableEvent(e.name,e.value)}pause(){this._updateQueue.pause(),this._updateQueue.clear()}resume(){this._updateQueue.resume()}pauseStream(){"geoevent"===this._source.type&&this._source.pauseStream()}resumeStream(){"geoevent"===this._source.type&&this._source.resumeStream()}_initAggregateStore(e){const t=e.schema.targets?.aggregate?.type,r=s(this.config,(e=>e.schema.targets?.aggregate?.type));if(r!==t&&(i(this.aggregateStore)&&(this.handles.remove("valueRangesChanged"),this.aggregateStore.destroy(),this.aggregateStore=null),t)){switch(t){case"cluster":{const e={geometryInfo:{geometryType:"esriGeometryPoint",hasM:!1,hasZ:!1},spatialReference:this.spatialReference,fieldsIndex:this.fieldsIndex,fields:this.service.fields};this.aggregateStore=new I(e,this.spatialReference,this._storage,this.service),this.handles.add(this.aggregateStore.events.on("valueRangesChanged",(e=>{this.remoteClient.invoke("emitEvent",{name:"valueRangesChanged",event:{valueRanges:e.valueRanges}}).catch(x)})),"valueRangesChanged");break}case"bin":{const e={geometryInfo:{geometryType:"esriGeometryPolygon",hasM:!1,hasZ:!1},spatialReference:this.spatialReference,fieldsIndex:this.fieldsIndex,fields:this.service.fields};this.aggregateStore=new b(e,this.spatialReference,this._storage,this.service);break}}this.aggregateStore.onTileUpdate({added:this.tileStore.tiles,removed:[]})}}async update(e,t){this._updateVersion++,this._initQueryEngine(t),this._initAttributeStore(t),this.pause(),await Promise.all([this._source.update(e,t.schema.source),this.featureStore.updateSchema(e,t.schema.targets.feature),this.attributeStore.update(e,t),this.attributeStore.updateFilters(e,t,this)]),this._initAggregateStore(t),this._initAggregateQueryEngine(this.aggregateStore),i(this.aggregateStore)&&await this.aggregateStore.updateSchema(e,t.schema.targets.aggregate),has("esri-2d-update-debug")&&e.describe(),this._set("config",t)}async applyUpdate(e){e.version=this._updateVersion,has("esri-2d-update-debug")&&console.debug(`Applying update ${e.version}`),e.mesh&&this.clearTiles(),this._updateQueue.resume(),await this._source.applyUpdate(e),this.notifyChange("updating"),await c((()=>!this.updating)),i(this.aggregateStore)&&(await n(10),await c((()=>!this.updating)))}async onEdits({edits:e}){has("esri-2d-update-debug")&&console.debug("Applying Edit:",e),this._didEdit=!0;try{const t=e.removed.map((e=>e.objectId&&-1!==e.objectId?e.objectId:this._lookupObjectIdByGlobalId(e.globalId))),r=e.addOrModified.map((({objectId:e})=>e));this.featureStore.invalidate(),await this._source.edit(r,t),this.clearTiles(),this.notifyChange("updating"),i(this.aggregateStore)&&this.aggregateStore.clear(),await this._source.resend(),await c((()=>!this.updating))}catch(t){}}async refresh(e){if(!e){const e=E.empty();return e.storage.filters=!0,this.applyUpdate(e)}this.featureStore.invalidate(),this.clearTiles(),this._source.refresh(this._updateVersion),this._cleanupNeeded=!0,this.notifyChange("updating"),await c((()=>!this.updating))}clearTiles(){for(const e of this.tileStore.tiles)this.processor.onTileClear(e)}onTileUpdate(e){i(this.aggregateStore)&&this.aggregateStore.onTileUpdate(e);for(const t of e.added)this._source.subscribe(t,this._updateVersion),this._level=t.level;for(const t of e.removed)this._source.unsubscribe(t),this._cleanupNeeded=!0,this._tileToResolver.has(t.id)&&(this._tileToResolver.get(t.id).resolve(),this._tileToResolver.delete(t.id));this.notifyChange("updating")}async onIdle(){this._invalidated&&(this._invalidated=!1,(i(this.aggregateStore)||"heatmap"===this.processor.type)&&await this._repushCurrentLevelTiles()),this._markAndSweep()}async querySummaryStatistics({query:e,params:t}){return this.featureQueryEngine.executeQueryForSummaryStatistics(e,t)}async queryUniqueValues({query:e,params:t}){return this.featureQueryEngine.executeQueryForUniqueValues(e,t)}async queryClassBreaks({query:e,params:t}){return this.featureQueryEngine.executeQueryForClassBreaks(e,t)}async queryHistogram({query:e,params:t}){return this.featureQueryEngine.executeQueryForHistogram(e,t)}queryExtent(e){return this.featureQueryEngine.executeQueryForExtent(e)}queryAggregates(e){return this.aggregateQueryEngine.executeQuery(e)}queryAggregateCount(e){return this.aggregateQueryEngine.executeQueryForCount(e)}queryAggregateIds(e){return this.aggregateQueryEngine.executeQueryForIds(e)}queryFeatures(e){return this.featureQueryEngine.executeQuery(e)}async queryVisibleFeatures(e){const t=await this.featureQueryEngine.executeQuery(e),r=t.objectIdFieldName;return t.features=t.features.filter((e=>{const t=e.attributes[r],i=this.getDisplayId(t);return s(i,(e=>this.attributeStore.isVisible(e)))})),t}queryFeatureCount(e){return this.featureQueryEngine.executeQueryForCount(e)}queryLatestObservations(e){return this.featureQueryEngine.executeQueryForLatestObservations(e)}queryObjectIds(e){return this.featureQueryEngine.executeQueryForIds(e)}async queryStatistics(){return this.featureStore.storeStatistics}getObjectId(e){return this.featureStore.lookupObjectId(e,this._storage)}getDisplayId(e){if(i(this.aggregateStore)){const t=this.aggregateStore.getDisplayId(e);if(r(t)){const t=this.featureStore.lookupDisplayId(e);return this.aggregateStore.getDisplayIdForReferenceId(t)}return t}return this.featureStore.lookupDisplayId(e)}getFeatures(e){const t=[],r=[];for(const s of e){const e=i(this.aggregateStore)?this.getAggregate(s):null;if(i(e))if(i(e.attributes.referenceId)){const r=this.getFeature(e.attributes.referenceId);i(r)&&t.push(r)}else r.push(e);else{const e=this.getFeature(s);i(e)&&t.push(e)}}return{features:t,aggregates:r}}getFeature(e){const t=this.featureStore.lookupFeatureByDisplayId(e,this._storage);if(r(t))return null;const s=t.readHydratedGeometry(),i=f(s,t.geometryType,t.hasZ,t.hasM);return{attributes:t.readAttributes(),geometry:i}}getAggregate(e){return r(this.aggregateStore)?null:this.aggregateStore.getAggregate(e)}getAggregates(){return r(this.aggregateStore)?[]:this.aggregateStore.getAggregates()}async setHighlight(e){const t=a(e.map((e=>this.getDisplayId(e))));return this.attributeStore.setHighlight(e,t)}_lookupObjectIdByGlobalId(e){const t=this.service.globalIdField;if(r(t))throw new Error("Expected globalIdField to be defined");let s=null;if(this.featureStore.forEach((r=>{e===r.readAttribute(t)&&(s=r.getObjectId())})),r(s))throw new Error(`Expected to find a feature with globalId ${e}`);return s}async _repushCurrentLevelTiles(){const e=this.tileStore.tiles.filter((e=>e.level===this._level)).map((async e=>this._patchTile({type:"append",id:e.key.id,addOrUpdate:Q.fromOptimizedFeatures([],this.service),remove:[],end:!0,status:E.empty()})));await Promise.all(e)}_maybeForceCleanup(){performance.now()-this._lastCleanup>F&&this._markAndSweep()}_patchTile(e,t){const r=this._updateQueue.push(e,t).then((()=>{this.notifyChange("updating")})).catch((e=>{this.notifyChange("updating")}));return this.notifyChange("updating"),r}async _onTileMessage(e,t){u(t);const s=this.tileStore.get(e.id);if(!s)return;if(e.clear)return this.processor.onTileClear(s);const a=e.status;this._cleanupNeeded=!0;const o=[];for(const r of e.remove){const e=this.featureStore.lookupDisplayId(r);e&&o.push(e)}e.remove=o;try{if(r(e.addOrUpdate))return void this.processor.onTileMessage(s,{...e,addOrUpdate:null},i(this.aggregateStore),t).catch(h);if(e.addOrUpdate.setArcadeSpatialReference(this.spatialReference),this.featureStore.hasInstance(e.addOrUpdate.instance)&&a.targets.feature||(a.targets.feature=!0,this.featureStore.onTileData(s,e)),!a.storage.data||!a.storage.filters){a.storage.data=!0,a.storage.filters=!0,this.attributeStore.onTileData(s,e);"geoevent"===this._source.type||this._didEdit?(await this.attributeStore.sendUpdates(),u(t)):this.attributeStore.sendUpdates()}if(i(this.aggregateStore)&&!a.targets.aggregate){a.targets.aggregate=!0;const t=A(this._source)&&this._source.loading,r=!A(this._source)||t||e.end;if(this.aggregateStore.onTileData(s,e,this._storage,this.attributeStore,r),!r)return;a.mesh||(this.attributeStore.onTileData(s,e),await this.attributeStore.sendUpdates())}a.mesh||(a.mesh=!0,await this.processor.onTileMessage(s,e,i(this.aggregateStore),t),u(t)),this._maybeForceCleanup()}catch(n){h(n)}}_mark(e,t,r){const s=(4294901760&this._storage.getInstanceId(e))>>>16;e&&(t.add(s),r.set(e))}_markAndSweep(){this._lastCleanup=performance.now();if(!(!("feature"===this._source.type&&"snapshot"===this._source.mode)&&("geoevent"===this._source.type||this._cleanupNeeded)))return;this._cleanupNeeded=!1;const e=this._storage.getBitset(this._markedIdsBufId),t=new Set;e.clear();for(const r of this.tileStore.tiles)for(const s of this._source.readers(r.id)){const r=s.getCursor();for(;r.next();){let s=r.getDisplayId();if(!s){const e=r.getObjectId();s=this.featureStore.lookupDisplayId(e)}this._mark(s,t,e)}}"symbol"===this.processor.type&&this.processor.forEachBufferId((r=>{this._mark(r,t,e)})),this._updateQueue.forEach((r=>{for(const s of r.remove){const r=this.featureStore.lookupDisplayId(s);this._mark(r,t,e)}})),i(this.aggregateStore)&&(this.aggregateStore.sweepFeatures(e,this.featureStore),"sweepAggregates"in this.aggregateStore&&this.aggregateStore.sweepAggregates(this._storage,this.attributeStore,this._level)),this.featureStore.sweepFeatures(e,this._storage,this.attributeStore),this.featureStore.sweepFeatureSets(t)}};e([l({constructOnly:!0})],U.prototype,"tileStore",void 0),e([l()],U.prototype,"config",void 0),e([l({readOnly:!0})],U.prototype,"fieldsIndex",null),e([l()],U.prototype,"processor",void 0),e([l({constructOnly:!0})],U.prototype,"remoteClient",void 0),e([l({constructOnly:!0})],U.prototype,"service",void 0),e([l()],U.prototype,"spatialReference",null),e([l()],U.prototype,"updating",null),U=e([p("esri.views.2d.layers.features.controllers.FeatureController2D")],U);const O=U;export{O as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.25/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../../core/Error.js";import has from"../../../../core/has.js";import t from"../../../../core/Logger.js";import{isSome as r,unwrap as i,isNone as l,unwrapOr as n}from"../../../../core/maybe.js";import{pt2px as s}from"../../../../core/screenUtils.js";import{sqlAnd as o}from"../../../../core/sql.js";import{diff as a}from"../../../../core/accessorSupport/diffUtils.js";import{validateLabelingInfo as u}from"../../../../layers/support/labelingInfo.js";import{WGLSymbologyType as f}from"../../engine/webgl/enums.js";import{getVVType as d}from"../../engine/webgl/Utils.js";import{getTechniqueFromRenderer as p}from"../../engine/webgl/techniques/utils.js";import{getVVFlags as c}from"../../engine/webgl/util/vvFlagUtils.js";import{createSymbolSchema as y}from"./createSymbolSchema.js";export{createSymbolSchema}from"./createSymbolSchema.js";import{getPtMaxVVSize as m}from"./support/pixelBuffering.js";import{getSupportedHeatmapRenderer as g,simplifyVisualVariables as b}from"./support/rendererUtils.js";import{convertAggregateFieldFromPublic as x,createClusterRenderer as h}from"../support/clusterUtils.js";import{toJSONGeometryType as v}from"../support/util.js";const T=t.getLogger("esri.views.2d.layers.features.schemaUtils"),S="ValidationError";function E(e){return e}function I(e){let t=0,i=0,l=f.DEFAULT;if(r(e)){if(i=m(e),"visualVariables"in e&&(t=c(e.visualVariables||[]),"dot-density"===e.type&&(l=f.DOT_DENSITY)),"heatmap"===e.type&&(l=f.HEATMAP),"dictionary"===e.type)return{maxVVSize:i,vvFlags:t,symbologyType:f.DEFAULT};if("pie-chart"===e.type)return{maxVVSize:i,vvFlags:t,symbologyType:f.PIE_CHART};if(l!==f.DOT_DENSITY&&l!==f.HEATMAP){const t=e.getSymbols();"backgroundFillSymbol"in e&&e.backgroundFillSymbol&&t.push(e.backgroundFillSymbol);let r=!0,i=!0;for(const e of t)if("cim"===e.type&&(i=!1),"simple-fill"===e.type||"picture-fill"===e.type){const t=e.outline,l=t&&"none"!==t.style&&"solid"!==t.style,n="simple-fill"===e.type&&"none"!==e.style&&"solid"!==e.style,s="picture-fill"===e.type||n||l;l&&(r=!1),s&&(i=!1)}r?l=i?f.OUTLINE_FILL_SIMPLE:f.OUTLINE_FILL:i&&(l=f.SIMPLE)}}return{vvFlags:t,maxVVSize:i,symbologyType:l}}let w=null;function F(e){if(has("esri-2d-update-debug")){const t=V(e,!0);console.debug("Created new schema",t),console.debug("Schema diff",a(w,t)),w=t}return V(e)}function V(e,t=!1){try{const i=P(e,t),l=C(e),n={};i.map((t=>z(n,e,t)));const s=r(e.subtypeCode)?`${e.subtypeField} = ${e.subtypeCode}`:null,a=o(e.definitionExpression,s);return{source:{definitionExpression:a,fields:e.fields.map((e=>e.toJSON())),gdbVersion:e.gdbVersion,historicMoment:e.historicMoment?.getTime(),outFields:e.availableFields,pixelBuffer:e.pixelBuffer,spatialReference:e.spatialReference.toJSON(),timeExtent:e.timeExtent?.toJSON(),customParameters:e.customParameters},attributes:{fields:{},indexCount:0},processors:i,tileRenderer:l,targets:n}}catch(i){if(i.fieldName===S)return T.error(i),null;throw i}}function z(t,r,i){switch(i.target){case"feature":return void j(t,M(r),i);case"aggregate":{if(!("featureReduction"in r))return;const l=r.featureReduction;switch(l.type){case"selection":throw new e(S,"Mapview does not support `selection` reduction type",l);case"binning":return j(t,M(r),i),void O(t,l,i);case"cluster":return j(t,M(r),i),void L(t,l,i)}}}}function N(e,t){for(const r in t){const i=t[r];if(i.target!==e.name)continue;const l=e.attributes[r];l?(l.context.mesh=l.context.mesh||i.context.mesh,l.context.storage=l.context.storage||i.context.storage):e.attributes[r]=i}return e}function M(e){return[i(e.filter)?.toJSON()??null,i(i(e.featureEffect)?.filter)?.toJSON()??null]}function j(e,t,r){return e.feature||(e.feature={name:"feature",input:"source",filters:t,attributes:{}}),N(e.feature,r.attributes.fields),e}function O(e,t,r){return e.aggregate||(e.aggregate={name:"aggregate",type:"bin",filters:null,input:"feature",params:{fixedBinLevel:t.fixedBinLevel},attributes:{}}),N(e.aggregate,r.attributes.fields),e}function L(e,t,r){return e.aggregate||(e.aggregate={name:"aggregate",type:"cluster",input:"feature",filters:null,attributes:{},params:{clusterRadius:s(t.clusterRadius/2),clusterPixelBuffer:64*Math.ceil(s(t.clusterMaxSize)/64),fields:r.aggregateFields}}),N(e.aggregate,r.attributes.fields),e}function R(e,t){return t.field?B(e,{...t,type:"field",field:t.field}):t.valueExpression?B(e,{...t,type:"expression",valueExpression:t.valueExpression}):{field:null,fieldIndex:null}}function B(e,t){switch(t.type){case"expression":{const r=E(t.valueExpression);if(!e.fields[r]){const i=e.indexCount++;e.fields[r]={...t,name:r,fieldIndex:i}}return{fieldIndex:e.fields[r].fieldIndex}}case"label-expression":{const r=E(JSON.stringify(t.label));if(!e.fields[r]){const i=e.indexCount++;e.fields[r]={...t,name:r,fieldIndex:i}}return{fieldIndex:e.fields[r].fieldIndex}}case"field":{const r=t.field;return"aggregate"===t.target&&e.fields[r]||(e.fields[r]={...t,name:r}),{field:r}}case"statistic":return e.fields[t.name]={...t},{field:t.name}}}function P(e,t=!1){const r=new Array;let i=0;return r.push(A(e,i++,t)),r}function k(e,t,r,i,l,n=!1){const s=B(t,{type:"label-expression",target:i,context:{mesh:!0},resultType:"string",label:{labelExpression:r.labelExpression,labelExpressionInfo:r.labelExpressionInfo?{expression:r.labelExpressionInfo.expression}:null,symbol:!!r.symbol,where:r.where}}),{fieldIndex:o}=s,a=I(e);return{...y(r,a,n),fieldIndex:o,target:i,index:l}}function U(t,r,i){const l="featureReduction"in r&&r.featureReduction;if(!l)return{fields:[],labels:[],matcher:null,rendererOverride:null};const n="aggregate",s=[];let o=null,a=v(r.geometryType),f=[],d=null;if(l)switch(l.type){case"selection":throw new e(S,"Mapview does not support `selection` reduction type",l);case"cluster":case"binning":if("cluster"===l.type?a="esriGeometryPoint":"binning"===l.type&&(a="esriGeometryPolygon"),l.renderer){for(const e of l.fields)x(s,e);d=l.renderer,o=$(null,n,l.renderer,i),f=l&&l.labelsVisible&&l.labelingInfo||[]}else if("cluster"===l.type){if(d=h(s,r.renderer,l,null),l.symbol){const e=I(d);o={type:"simple",symbol:y(l.symbol,e,i),symbologyType:e.symbologyType}}f=l&&l.labelsVisible&&l.labelingInfo||[]}}q(t,s);return{labels:u(f,"binning"===l.type?"esriGeometryPolygon":a),matcher:o,fields:s,rendererOverride:d}}function A(t,i,l=!1){const n={indexCount:0,fields:{}},s="featureReduction"in t&&t.featureReduction?"aggregate":"feature";if("sublayers"in t){const i={type:"subtype",subtypeField:t.subtypeField,renderers:{},symbologyType:f.DEFAULT},o={type:"subtype",mapping:{},target:"feature"},a={type:"subtype",classes:{}},u={type:"symbol",target:"feature",aggregateFields:[],attributes:n,storage:o,mesh:{matcher:i,aggregateMatcher:null,labels:a,sortKey:null}},d=new Set;let p=0;for(const{renderer:f,subtypeCode:c,labelingInfo:y,labelsVisible:m}of t.sublayers){const t=$(n,s,f,l),u=J(n,s,f),g=m&&y;if("visualVariables"in f&&f.visualVariables&&f.visualVariables.length)throw new e(S,"Visual variables are currently not supported for subtype layers");if("dictionary"===t.type)throw new e(S,"Dictionary renderer is not supported in subtype layers");if("subtype"===t.type)throw new e(S,"Nested subtype renderers is not supported");if(r(u)&&"subtype"===u.type)throw new e(S,"Nested subtype storage is not supported");if(r(u)&&r(u.attributeMapping))throw new e(S,"Non-visual-variable attributes are not supported in subtype layers");if("heatmap"===t.type)throw new e(S,"Heatmaps are not supported in subtype layers");if("pie-chart"===t.type)throw new e(S,"Pie-charts are not supported in subtype layers");if(d.has(c))throw new e(S,"Subtype codes for sublayers must be unique");d.add(c),i.renderers[c]=t,o.mapping[c]=u,g&&(a.classes[c]=g.map((e=>k(f,n,e,"feature",p++,l))))}return u}if("heatmap"===t.renderer.type&&"raster"===g()){const{radius:e,fieldOffset:r,field:i}=t.renderer;return{type:"heatmap",aggregateFields:[],attributes:n,target:s,storage:null,mesh:{radius:e,fieldOffset:r,field:R(n,{target:s,field:i,resultType:"numeric"}).field}}}const o=U(n,t,l),a=v(t.geometryType),d=o.rendererOverride??t.renderer,p=$(n,s,d,l),c=J(n,s,d),y=D(n,t.orderBy),m=t.labelsVisible&&t.labelingInfo||[],b=u(m,a);let x=0;const h=[...b.map((e=>k(d,n,e,"feature",x++,l))),...o.labels.map((e=>k(d,n,e,"aggregate",x++,l)))];return{type:"symbol",target:s,attributes:n,aggregateFields:o.fields,storage:c,mesh:{matcher:p,labels:{type:"simple",classes:h},aggregateMatcher:o.matcher,sortKey:y}}}function C(e){return"heatmap"===e.renderer?.type&&"raster"===g()?{type:"heatmap"}:{type:"symbol"}}function D(t,r){if(l(r)||!r.length)return null;r.length>1&&T.warn(`Layer rendering currently only supports ordering by 1 orderByInfo, but found ${r.length}. All but the first will be discarded`);const i=r[0],n="ascending"===i.order?"asc":"desc";if(i.field)return{field:i.field,order:n};if(i.valueExpression){return{fieldIndex:B(t,{type:"expression",target:"feature",valueExpression:i.valueExpression,resultType:"numeric"}).fieldIndex,order:n}}return T.error(new e(S,"Expected to find a field or valueExpression for OrderByInfo",i)),null}function q(e,t){const r={mesh:!0,storage:!0};for(const i of t){const{name:t,outStatistic:l}=i,{statisticType:n,onStatisticField:s}=l;let o=null,a=null,u=null;const f="numeric",d="feature";if("onStatisticValueExpression"in l){a=B(e,{type:"expression",target:d,valueExpression:l.onStatisticValueExpression,resultType:f}).fieldIndex}else if("onStatisticNormalizationField"in l){o=B(e,{type:"field",target:d,field:s,resultType:f}).field,u=l.onStatisticNormalizationField}else{o=B(e,{type:"field",target:d,field:s,resultType:f}).field}B(e,{type:"statistic",target:"aggregate",name:t,context:r,inField:o,inNormalizationField:u,inFieldIndex:a,statisticType:n})}}function J(e,t,r){let i;switch(r.type){case"simple":case"class-breaks":case"unique-value":case"dictionary":i={visualVariables:!0,attributes:null};break;default:i=p(r).getStorageSpec(r)}return _(e,t,i,r)}function _(e,t,i,n){if(l(i))return null;const{visualVariables:s,attributes:o}=i;let a=null;s&&"visualVariables"in n&&(a=H(e,t,n.visualVariables));const u=r(a)?4:0;let f=null;return r(o)&&(f=o.map(((r,i)=>{const{field:l,fieldIndex:n}=R(e,{valueExpression:r.valueExpression,field:r.field,resultType:"numeric",target:t});return{binding:i+u,field:l,fieldIndex:n}}))),{type:"simple",target:t,attributeMapping:f,vvMapping:a}}function H(e,t,r){if(!r||!r.length)return[];const i={storage:!0},l="numeric";return b(r).map((r=>{const n=d(r.type),{field:s,fieldIndex:o}=R(e,{target:t,valueExpression:r.valueExpression,field:r.field,context:i,resultType:l});switch(r.type){case"size":return"$view.scale"===r.valueExpression?null:{type:"size",binding:n,field:s,fieldIndex:o,normalizationField:R(e,{target:t,field:r.normalizationField,context:i,resultType:l}).field,valueRepresentation:r.valueRepresentation??null};case"color":return{type:"color",binding:n,field:s,fieldIndex:o,normalizationField:R(e,{target:t,field:r.normalizationField,context:i,resultType:l}).field};case"opacity":return{type:"opacity",binding:n,field:s,fieldIndex:o,normalizationField:R(e,{target:t,field:r.normalizationField,context:i,resultType:l}).field};case"rotation":return{type:"rotation",binding:n,field:s,fieldIndex:o}}})).filter((e=>e))}function $(e,t,r,i=!1){const l=n(e,{indexCount:0,fields:{}});switch(r.type){case"simple":case"dot-density":return G(l,r,i);case"class-breaks":return Y(l,t,r,i);case"unique-value":return Q(l,t,r,i);case"dictionary":return W(l,r,i);case"heatmap":return X(l,r,i);case"pie-chart":return K(l,r,i)}}function G(e,t,r=!1){const i=t.getSymbols(),l=i.length?i[0]:null,n=I(t);return{type:"simple",symbol:y(l,n,r),symbologyType:n.symbologyType}}function K(e,t,r=!1){const i=t.getSymbols(),l=i[0],n=i.length>1?i[1]:null,s=I(t);return{type:"pie-chart",markerSymbol:y(l,s,r),fillSymbol:y(n,s,r),symbologyType:s.symbologyType}}function Y(e,t,r,i=!1){const l={mesh:!0,use:"renderer.field"},n=r.backgroundFillSymbol,{field:s,fieldIndex:o}=R(e,{target:t,field:r.field,valueExpression:r.valueExpression,resultType:"numeric",context:l}),a=r.normalizationType,u="log"===a?"esriNormalizeByLog":"percent-of-total"===a?"esriNormalizeByPercentOfTotal":"field"===a?"esriNormalizeByField":null,f=I(r),d=r.classBreakInfos.map((e=>({symbol:y(e.symbol,f,i),min:e.minValue,max:e.maxValue}))).sort(((e,t)=>e.min-t.min));return{type:"interval",attributes:e.fields,field:s,fieldIndex:o,backgroundFillSymbol:y(n,f,i),defaultSymbol:y(r.defaultSymbol,f,i),intervals:d,normalizationField:r.normalizationField,normalizationTotal:r.normalizationTotal,normalizationType:u,isMaxInclusive:r.isMaxInclusive,symbologyType:f.symbologyType}}function Q(t,r,i,l=!1){const n=[],s=i.backgroundFillSymbol,o={target:r,context:{mesh:!0},resultType:"string"};if(i.field&&"string"!=typeof i.field)throw new e(S,"Expected renderer.field to be a string",i);const{field:a,fieldIndex:u}=R(t,{...o,field:i.field,valueExpression:i.valueExpression}),f=I(i);for(const e of i.uniqueValueInfos)n.push({value:""+e.value,symbol:y(e.symbol,f,l)});return{type:"map",attributes:t.fields,field:a,fieldIndex:u,field2:R(t,{...o,field:i.field2}).field,field3:R(t,{...o,field:i.field3}).field,fieldDelimiter:i.fieldDelimiter,backgroundFillSymbol:y(s,f),defaultSymbol:y(i.defaultSymbol,f),map:n,symbologyType:f.symbologyType}}function W(e,t,r=!1){const i=I(t);return{type:"dictionary",config:t.config,fieldMap:t.fieldMap,scaleExpression:t.scaleExpression,url:t.url,symbolOptions:i,symbologyType:i.symbologyType}}function X(e,t,r=!1){const i=t.getSymbols(),l=i.length?i[0]:null,n=I(t);return{type:"heatmap",symbol:y(l,n,r),symbologyType:n.symbologyType}}export{q as addAggregateFields,$ as createMatcherSchema,R as createRendererAttributeSchema,F as createSchema,I as createSymbolSchemaOptions};
5
+ import e from"../../../../core/Error.js";import has from"../../../../core/has.js";import t from"../../../../core/Logger.js";import{isSome as r,unwrap as i,isNone as l,unwrapOr as n}from"../../../../core/maybe.js";import{pt2px as s}from"../../../../core/screenUtils.js";import{sqlAnd as o}from"../../../../core/sql.js";import{diff as a}from"../../../../core/accessorSupport/diffUtils.js";import{validateLabelingInfo as u}from"../../../../layers/support/labelingInfo.js";import{WGLSymbologyType as f}from"../../engine/webgl/enums.js";import{getVVType as d}from"../../engine/webgl/Utils.js";import{getTechniqueFromRenderer as p}from"../../engine/webgl/techniques/utils.js";import{getVVFlags as c}from"../../engine/webgl/util/vvFlagUtils.js";import{createSymbolSchema as y}from"./createSymbolSchema.js";export{createSymbolSchema}from"./createSymbolSchema.js";import{getPtMaxVVSize as m}from"./support/pixelBuffering.js";import{getSupportedHeatmapRenderer as g,simplifyVisualVariables as b}from"./support/rendererUtils.js";import{createClusterRenderer as x}from"../support/clusterUtils.js";import{toJSONGeometryType as h}from"../support/util.js";const v=t.getLogger("esri.views.2d.layers.features.schemaUtils"),T="ValidationError";function S(e){return e}function E(e){let t=0,i=0,l=f.DEFAULT;if(r(e)){if(i=m(e),"visualVariables"in e&&(t=c(e.visualVariables||[]),"dot-density"===e.type&&(l=f.DOT_DENSITY)),"heatmap"===e.type&&(l=f.HEATMAP),"dictionary"===e.type)return{maxVVSize:i,vvFlags:t,symbologyType:f.DEFAULT};if("pie-chart"===e.type)return{maxVVSize:i,vvFlags:t,symbologyType:f.PIE_CHART};if(l!==f.DOT_DENSITY&&l!==f.HEATMAP){const t=e.getSymbols();"backgroundFillSymbol"in e&&e.backgroundFillSymbol&&t.push(e.backgroundFillSymbol);let r=!0,i=!0;for(const e of t)if("cim"===e.type&&(i=!1),"simple-fill"===e.type||"picture-fill"===e.type){const t=e.outline,l=t&&"none"!==t.style&&"solid"!==t.style,n="simple-fill"===e.type&&"none"!==e.style&&"solid"!==e.style,s="picture-fill"===e.type||n||l;l&&(r=!1),s&&(i=!1)}r?l=i?f.OUTLINE_FILL_SIMPLE:f.OUTLINE_FILL:i&&(l=f.SIMPLE)}}return{vvFlags:t,maxVVSize:i,symbologyType:l}}let I=null;function w(e){if(has("esri-2d-update-debug")){const t=F(e,!0);console.debug("Created new schema",t),console.debug("Schema diff",a(I,t)),I=t}return F(e)}function F(e,t=!1){try{const i=B(e,t),l=A(e),n={};i.map((t=>V(n,e,t)));const s=r(e.subtypeCode)?`${e.subtypeField} = ${e.subtypeCode}`:null,a=o(e.definitionExpression,s);return{source:{definitionExpression:a,fields:e.fields.map((e=>e.toJSON())),gdbVersion:e.gdbVersion,historicMoment:e.historicMoment?.getTime(),outFields:e.availableFields,pixelBuffer:e.pixelBuffer,spatialReference:e.spatialReference.toJSON(),timeExtent:e.timeExtent?.toJSON(),customParameters:e.customParameters},attributes:{fields:{},indexCount:0},processors:i,tileRenderer:l,targets:n}}catch(i){if(i.fieldName===T)return v.error(i),null;throw i}}function V(t,r,i){switch(i.target){case"feature":return void M(t,O(r),i);case"aggregate":{if(!("featureReduction"in r))return;const l=r.featureReduction;switch(l.type){case"selection":throw new e(T,"Mapview does not support `selection` reduction type",l);case"binning":return M(t,O(r),i),void N(t,l,i);case"cluster":return M(t,O(r),i),void j(t,l,i)}}}}function z(e,t){for(const r in t){const i=t[r];if(i.target!==e.name)continue;const l=e.attributes[r];l?(l.context.mesh=l.context.mesh||i.context.mesh,l.context.storage=l.context.storage||i.context.storage):e.attributes[r]=i}return e}function O(e){return[i(e.filter)?.toJSON()??null,i(i(e.featureEffect)?.filter)?.toJSON()??null]}function M(e,t,r){return e.feature||(e.feature={name:"feature",input:"source",filters:t,attributes:{}}),z(e.feature,r.attributes.fields),e}function N(e,t,r){return e.aggregate||(e.aggregate={name:"aggregate",type:"bin",filters:null,input:"feature",params:{fixedBinLevel:t.fixedBinLevel,fields:t.fields.map((e=>e.toJSON()))},attributes:{}}),z(e.aggregate,r.attributes.fields),e}function j(e,t,r){return e.aggregate||(e.aggregate={name:"aggregate",type:"cluster",input:"feature",filters:null,attributes:{},params:{clusterRadius:s(t.clusterRadius/2),clusterPixelBuffer:64*Math.ceil(s(t.clusterMaxSize)/64),fields:r.aggregateFields.map((e=>e.toJSON()))}}),z(e.aggregate,r.attributes.fields),e}function L(e,t){return t.field?R(e,{...t,type:"field",field:t.field}):t.valueExpression?R(e,{...t,type:"expression",valueExpression:t.valueExpression}):{field:null,fieldIndex:null}}function R(e,t){switch(t.type){case"expression":{const r=S(t.valueExpression);if(!e.fields[r]){const i=e.indexCount++;e.fields[r]={...t,name:r,fieldIndex:i}}return{fieldIndex:e.fields[r].fieldIndex}}case"label-expression":{const r=S(JSON.stringify(t.label));if(!e.fields[r]){const i=e.indexCount++;e.fields[r]={...t,name:r,fieldIndex:i}}return{fieldIndex:e.fields[r].fieldIndex}}case"field":{const r=t.field;return"aggregate"===t.target&&e.fields[r]||(e.fields[r]={...t,name:r}),{field:r}}case"statistic":return e.fields[t.name]={...t},{field:t.name}}}function B(e,t=!1){const r=new Array;let i=0;return r.push(U(e,i++,t)),r}function P(e,t,r,i,l,n=!1){const s=R(t,{type:"label-expression",target:i,context:{mesh:!0},resultType:"string",label:{labelExpression:r.labelExpression,labelExpressionInfo:r.labelExpressionInfo?{expression:r.labelExpressionInfo.expression}:null,symbol:!!r.symbol,where:r.where}}),{fieldIndex:o}=s,a=E(e);return{...y(r,a,n),fieldIndex:o,target:i,index:l}}function k(t,r,i){const l="featureReduction"in r&&r.featureReduction;if(!l)return{fields:[],labels:[],matcher:null,rendererOverride:null};const n="aggregate",s=[];let o=null,a=h(r.geometryType),f=[],d=null;if(l)switch(l.type){case"selection":throw new e(T,"Mapview does not support `selection` reduction type",l);case"cluster":case"binning":if(s.push(...l.fields??[]),"cluster"===l.type?a="esriGeometryPoint":"binning"===l.type&&(a="esriGeometryPolygon"),l.renderer)d=l.renderer,o=H(null,n,l.renderer,i),f=l&&l.labelsVisible&&l.labelingInfo||[];else if("cluster"===l.type){if(d=x(s,r.renderer,l,null),l.symbol){const e=E(d);o={type:"simple",symbol:y(l.symbol,e,i),symbologyType:e.symbologyType}}f=l&&l.labelsVisible&&l.labelingInfo||[]}}D(t,s);return{labels:u(f,"binning"===l.type?"esriGeometryPolygon":a),matcher:o,fields:s,rendererOverride:d}}function U(t,i,l=!1){const n={indexCount:0,fields:{}},s="featureReduction"in t&&t.featureReduction?"aggregate":"feature";if("sublayers"in t){const i={type:"subtype",subtypeField:t.subtypeField,renderers:{},symbologyType:f.DEFAULT},o={type:"subtype",mapping:{},target:"feature"},a={type:"subtype",classes:{}},u={type:"symbol",target:"feature",aggregateFields:[],attributes:n,storage:o,mesh:{matcher:i,aggregateMatcher:null,labels:a,sortKey:null}},d=new Set;let p=0;for(const{renderer:f,subtypeCode:c,labelingInfo:y,labelsVisible:m}of t.sublayers){const t=H(n,s,f,l),u=J(n,s,f),g=m&&y;if("visualVariables"in f&&f.visualVariables&&f.visualVariables.length)throw new e(T,"Visual variables are currently not supported for subtype layers");if("dictionary"===t.type)throw new e(T,"Dictionary renderer is not supported in subtype layers");if("subtype"===t.type)throw new e(T,"Nested subtype renderers is not supported");if(r(u)&&"subtype"===u.type)throw new e(T,"Nested subtype storage is not supported");if(r(u)&&r(u.attributeMapping))throw new e(T,"Non-visual-variable attributes are not supported in subtype layers");if("heatmap"===t.type)throw new e(T,"Heatmaps are not supported in subtype layers");if("pie-chart"===t.type)throw new e(T,"Pie-charts are not supported in subtype layers");if(d.has(c))throw new e(T,"Subtype codes for sublayers must be unique");d.add(c),i.renderers[c]=t,o.mapping[c]=u,g&&(a.classes[c]=g.map((e=>P(f,n,e,"feature",p++,l))))}return u}if("heatmap"===t.renderer.type&&"raster"===g()){const{radius:e,fieldOffset:r,field:i}=t.renderer;return{type:"heatmap",aggregateFields:[],attributes:n,target:s,storage:null,mesh:{radius:e,fieldOffset:r,field:L(n,{target:s,field:i,resultType:"numeric"}).field}}}const o=k(n,t,l),a=h(t.geometryType),d=o.rendererOverride??t.renderer,p=H(n,s,d,l),c=J(n,s,d),y=C(n,t.orderBy),m=t.labelsVisible&&t.labelingInfo||[],b=u(m,a);let x=0;const v=[...b.map((e=>P(d,n,e,"feature",x++,l))),...o.labels.map((e=>P(d,n,e,"aggregate",x++,l)))];return{type:"symbol",target:s,attributes:n,aggregateFields:o.fields,storage:c,mesh:{matcher:p,labels:{type:"simple",classes:v},aggregateMatcher:o.matcher,sortKey:y}}}function A(e){return"heatmap"===e.renderer?.type&&"raster"===g()?{type:"heatmap"}:{type:"symbol"}}function C(t,r){if(l(r)||!r.length)return null;r.length>1&&v.warn(`Layer rendering currently only supports ordering by 1 orderByInfo, but found ${r.length}. All but the first will be discarded`);const i=r[0],n="ascending"===i.order?"asc":"desc";if(i.field)return{field:i.field,order:n};if(i.valueExpression){return{fieldIndex:R(t,{type:"expression",target:"feature",valueExpression:i.valueExpression,resultType:"numeric"}).fieldIndex,order:n}}return v.error(new e(T,"Expected to find a field or valueExpression for OrderByInfo",i)),null}function D(e,t){const r={mesh:!0,storage:!0};for(const i of t){const{name:t,outStatistic:l}=i,{statisticType:n,onStatisticField:s}=l;let o=null,a=null;const u="numeric",f="feature";if(l.onStatisticValueExpression){a=R(e,{type:"expression",target:f,valueExpression:l.onStatisticValueExpression,resultType:u}).fieldIndex}else{o=R(e,{type:"field",target:f,field:s,resultType:u}).field}R(e,{type:"statistic",target:"aggregate",name:t,context:r,inField:o,inFieldIndex:a,statisticType:n})}}function J(e,t,r){let i;switch(r.type){case"simple":case"class-breaks":case"unique-value":case"dictionary":i={visualVariables:!0,attributes:null};break;default:i=p(r).getStorageSpec(r)}return q(e,t,i,r)}function q(e,t,i,n){if(l(i))return null;const{visualVariables:s,attributes:o}=i;let a=null;s&&"visualVariables"in n&&(a=_(e,t,n.visualVariables));const u=r(a)?4:0;let f=null;return r(o)&&(f=o.map(((r,i)=>{const{field:l,fieldIndex:n}=L(e,{valueExpression:r.valueExpression,field:r.field,resultType:"numeric",target:t});return{binding:i+u,field:l,fieldIndex:n}}))),{type:"simple",target:t,attributeMapping:f,vvMapping:a}}function _(e,t,r){if(!r||!r.length)return[];const i={storage:!0},l="numeric";return b(r).map((r=>{const n=d(r.type),{field:s,fieldIndex:o}=L(e,{target:t,valueExpression:r.valueExpression,field:r.field,context:i,resultType:l});switch(r.type){case"size":return"$view.scale"===r.valueExpression?null:{type:"size",binding:n,field:s,fieldIndex:o,normalizationField:L(e,{target:t,field:r.normalizationField,context:i,resultType:l}).field,valueRepresentation:r.valueRepresentation??null};case"color":return{type:"color",binding:n,field:s,fieldIndex:o,normalizationField:L(e,{target:t,field:r.normalizationField,context:i,resultType:l}).field};case"opacity":return{type:"opacity",binding:n,field:s,fieldIndex:o,normalizationField:L(e,{target:t,field:r.normalizationField,context:i,resultType:l}).field};case"rotation":return{type:"rotation",binding:n,field:s,fieldIndex:o}}})).filter((e=>e))}function H(e,t,r,i=!1){const l=n(e,{indexCount:0,fields:{}});switch(r.type){case"simple":case"dot-density":return $(l,r,i);case"class-breaks":return K(l,t,r,i);case"unique-value":return Y(l,t,r,i);case"dictionary":return Q(l,r,i);case"heatmap":return W(l,r,i);case"pie-chart":return G(l,r,i)}}function $(e,t,r=!1){const i=t.getSymbols(),l=i.length?i[0]:null,n=E(t);return{type:"simple",symbol:y(l,n,r),symbologyType:n.symbologyType}}function G(e,t,r=!1){const i=t.getSymbols(),l=i[0],n=i.length>1?i[1]:null,s=E(t);return{type:"pie-chart",markerSymbol:y(l,s,r),fillSymbol:y(n,s,r),symbologyType:s.symbologyType}}function K(e,t,r,i=!1){const l={mesh:!0,use:"renderer.field"},n=r.backgroundFillSymbol,{field:s,fieldIndex:o}=L(e,{target:t,field:r.field,valueExpression:r.valueExpression,resultType:"numeric",context:l}),a=r.normalizationType,u="log"===a?"esriNormalizeByLog":"percent-of-total"===a?"esriNormalizeByPercentOfTotal":"field"===a?"esriNormalizeByField":null,f=E(r),d=r.classBreakInfos.map((e=>({symbol:y(e.symbol,f,i),min:e.minValue,max:e.maxValue}))).sort(((e,t)=>e.min-t.min));return{type:"interval",attributes:e.fields,field:s,fieldIndex:o,backgroundFillSymbol:y(n,f,i),defaultSymbol:y(r.defaultSymbol,f,i),intervals:d,normalizationField:r.normalizationField,normalizationTotal:r.normalizationTotal,normalizationType:u,isMaxInclusive:r.isMaxInclusive,symbologyType:f.symbologyType}}function Y(t,r,i,l=!1){const n=[],s=i.backgroundFillSymbol,o={target:r,context:{mesh:!0},resultType:"string"};if(i.field&&"string"!=typeof i.field)throw new e(T,"Expected renderer.field to be a string",i);const{field:a,fieldIndex:u}=L(t,{...o,field:i.field,valueExpression:i.valueExpression}),f=E(i);for(const e of i.uniqueValueInfos)n.push({value:""+e.value,symbol:y(e.symbol,f,l)});return{type:"map",attributes:t.fields,field:a,fieldIndex:u,field2:L(t,{...o,field:i.field2}).field,field3:L(t,{...o,field:i.field3}).field,fieldDelimiter:i.fieldDelimiter,backgroundFillSymbol:y(s,f),defaultSymbol:y(i.defaultSymbol,f),map:n,symbologyType:f.symbologyType}}function Q(e,t,r=!1){const i=E(t);return{type:"dictionary",config:t.config,fieldMap:t.fieldMap,scaleExpression:t.scaleExpression,url:t.url,symbolOptions:i,symbologyType:i.symbologyType}}function W(e,t,r=!1){const i=t.getSymbols(),l=i.length?i[0]:null,n=E(t);return{type:"heatmap",symbol:y(l,n,r),symbologyType:n.symbologyType}}export{D as addAggregateFields,H as createMatcherSchema,L as createRendererAttributeSchema,w as createSchema,E as createSymbolSchemaOptions};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.25/esri/copyright.txt for details.
4
4
  */
5
- import"../../../../../geometry.js";import has from"../../../../../core/has.js";import e from"../../../../../core/Logger.js";import{isNone as t,applySome as s,mapOr as r}from"../../../../../core/maybe.js";import{diff as i,hasDiff as o}from"../../../../../core/accessorSupport/diffUtils.js";import{GeohashTree as a}from"../../../../../geohash/GeohashTree.js";import{setGeohashBuf as h,setGeohashXY as n}from"../../../../../geohash/geohashUtils.js";import{earth as d}from"../../../../../geometry/support/Ellipsoid.js";import{getInfo as g}from"../../../../../geometry/support/spatialReferenceUtils.js";import{convertToGeometry as p,convertFromPolygon as l}from"../../../../../layers/graphics/featureConversionUtils.js";import{OptimizedFeature as c}from"../../../../../layers/graphics/OptimizedFeature.js";import u from"../../../../../layers/graphics/OptimizedGeometry.js";import{checkProjectionSupport as f,project as m}from"../../../../../layers/graphics/data/projectionSupport.js";import{createDisplayId as _}from"../../../engine/webgl/DisplayId.js";import{Store2D as y}from"../Store2D.js";import{FeatureSetReaderJSON as I}from"./FeatureSetReaderJSON.js";import b from"../../../../../geometry/SpatialReference.js";import j from"../../../../../geometry/Polygon.js";import v from"../../../../../geometry/Extent.js";const x=e.getLogger("esri.view.2d.layers.features.support.BinStore"),B=12,G=64,S=5;function L(e){return 57.29577951308232*e}class A extends y{constructor(e,t,s,r){super(e,s),this._geohashLevel=S,this._geohashBuf=[],this._serviceInfo=r,this.geometryInfo=e.geometryInfo,this._spatialReference=t,this._projectionSupportCheck=f(t,b.WGS84),this._bitsets.geohash=s.getBitset(s.createBitset()),this._bitsets.inserted=s.getBitset(s.createBitset())}destroy(){this._tree&&this._tree.destroy()}async updateSchema(e,s){const r=this._schema;try{await super.updateSchema(e,s),await this._projectionSupportCheck}catch(n){}const h=i(r,s);s&&(!t(h)||e.source||e.storage.filters)?((o(h,"params.fields")||o(h,"params")||!this._tree||e.source)&&(this._tree&&this._tree.destroy(),this._tree=new a(this._statisticFields,this._serviceInfo),this._tree.onRelease=e=>e.displayId&&this._storage.releaseDisplayId(e.displayId),this._geohashLevel=this._schema.params.fixedBinLevel,this._rebuildTree(),has("esri-2d-update-debug")&&x.info("Aggregate mesh needs update due to tree changing")),has("esri-2d-update-debug")&&x.info("Aggregate mesh needs update due to tree changing"),e.targets[s.name]=!0,e.mesh=!1):r&&(e.mesh=!0)}clear(){this._rebuildTree()}sweepFeatures(e,t){this._bitsets.inserted.forEachSet((s=>{if(!e.has(s)){const e=t.lookupByDisplayIdUnsafe(s);this._remove(e)}}))}sweepAggregates(e,t,s){}onTileData(e,s,r,i,o=!0){if(!this._schema||t(s.addOrUpdate))return s;const a=this._getTransforms(e,this._spatialReference);{const e=s.addOrUpdate.getCursor();for(;e.next();)this._update(e,i)}if(s.status.mesh||!o)return s;const h=new Array;this._getBinsForTile(h,e,a,r),s.addOrUpdate=I.fromOptimizedFeatures(h,{...this._serviceInfo,geometryType:"esriGeometryPolygon"}),s.addOrUpdate.attachStorage(r),s.clear=!0,s.end=!0;{const t=s.addOrUpdate.getCursor();for(;t.next();){const s=t.getDisplayId();this._bitsets.computed.unset(s),this.setComputedAttributes(r,t,s,e.scale)}}return s}forEach(e){this._tree.forEach(e)}onTileUpdate(e){}getAggregate(e){const t=_(e,!0),r=this._tree.findIf((e=>e.displayId===t));return s(r,(e=>this._toAggregateGraphic(e)))}getAggregates(){return this._tree.findAllIf((e=>e.depth===this._geohashLevel)).map(this._toAggregateGraphic.bind(this))}getDisplayId(e){const t=this._tree.findIf((t=>t.id===e));return s(t,(e=>e.displayId))}getFeatureDisplayIdsForAggregate(e){const t=this._tree.findIf((t=>t.id===e));return r(t,[],(e=>Array.from(e.displayIds)))}getDisplayIdForReferenceId(e){const t=this._tree.findIf((t=>1===t.displayIds.size&&t.displayIds.has(e)));return s(t,(e=>e.displayId))}_toAggregateGraphic(e){const t=this._spatialReference;return{referenceId:null,objectId:e.id,displayId:e.displayId,attributes:e.getAttributes(),geometry:p(e.getGeometry(t),"esriGeometryPolygon",!1,!1),centroid:null}}_rebuildTree(){this._bitsets.computed.clear(),this._bitsets.inserted.clear(),this._tree&&this._tree.clear()}_remove(e){const t=e.getDisplayId(),s=e.getXHydrated(),r=e.getYHydrated(),i=this._geohashBuf[2*t],o=this._geohashBuf[2*t+1];this._bitsets.inserted.has(t)&&(this._bitsets.inserted.unset(t),this._tree.removeCursor(e,s,r,i,o,this._geohashLevel))}_update(e,t){const s=e.getDisplayId(),r=this._bitsets.inserted,i=t.isVisible(s);if(i===r.has(s))return;if(!i)return void this._remove(e);const o=e.getXHydrated(),a=e.getYHydrated();if(!this._setGeohash(s,o,a))return;const h=this._geohashBuf[2*s],n=this._geohashBuf[2*s+1];this._tree.insertCursor(e,s,o,a,h,n,this._geohashLevel),r.set(s)}_setGeohash(e,t,s){if(this._bitsets.geohash.has(e))return!0;const r=this._geohashBuf;if(this._spatialReference.isWebMercator){const i=L(t/d.radius),o=i-360*Math.floor((i+180)/360),a=L(Math.PI/2-2*Math.atan(Math.exp(-s/d.radius)));h(r,e,a,o,B)}else{const i=m({x:t,y:s},this._spatialReference,b.WGS84);if(!i)return!1;h(r,e,i.y,i.x,B)}return this._bitsets.geohash.set(e),!0}_getBinsForTile(e,t,s,r){try{const i=this._getGeohashBounds(t),o=this._tree.getBins(i);for(const t of o){t.displayId||(t.displayId=r.createDisplayId(!0));const i=t.getGeometry(this._spatialReference,s.tile),o=new c(i,t.getAttributes());o.objectId=t.id,o.displayId=t.displayId,e.push(o)}}catch(i){return void x.error("Unable to get bins for tile",t.key.id)}}_getGeohash(e,t,s){const r={geohashX:0,geohashY:0};return n(r,t,e,s),r}_getGeohashBounds(e){const t=this._getGeohashLevel(e.key.level),s=[e.extent.xmin,e.extent.ymin,e.extent.xmax,e.extent.ymax],r=j.fromExtent(v.fromBounds(s,this._spatialReference)),i=m(r,this._spatialReference,b.WGS84,{densificationStep:e.resolution*G}),o=l(new u,i,!1,!1),a=o.coords.filter(((e,t)=>!(t%2))),h=o.coords.filter(((e,t)=>t%2)),n=Math.min(...a),d=Math.min(...h),g=Math.max(...a),p=Math.max(...h),c=this._getGeohash(n,d,t),f=this._getGeohash(g,p,t);return{bounds:s,geohashBounds:{xLL:c.geohashX,yLL:c.geohashY,xTR:f.geohashX,yTR:f.geohashY},level:t}}_getGeohashLevel(e){return this._schema.params.fixedBinLevel}_getTransforms(e,t){const s={originPosition:"upperLeft",scale:[e.resolution,e.resolution],translate:[e.bounds[0],e.bounds[3]]},r=g(t);if(!r)return{tile:s,left:null,right:null};const[i,o]=r.valid;return{tile:s,left:{...s,translate:[o,e.bounds[3]]},right:{...s,translate:[i-o+e.bounds[0],e.bounds[3]]}}}}export{A as BinStore};
5
+ import"../../../../../geometry.js";import e from"../../../../../core/Evented.js";import has from"../../../../../core/has.js";import t from"../../../../../core/Logger.js";import{isNone as s,applySome as r,mapOr as i}from"../../../../../core/maybe.js";import{diff as o,hasDiff as a}from"../../../../../core/accessorSupport/diffUtils.js";import{GeohashTree as h}from"../../../../../geohash/GeohashTree.js";import{setGeohashBuf as n,setGeohashXY as d}from"../../../../../geohash/geohashUtils.js";import{fromRect as g}from"../../../../../geometry/support/aaBoundingBox.js";import{earth as l}from"../../../../../geometry/support/Ellipsoid.js";import{getInfo as p}from"../../../../../geometry/support/spatialReferenceUtils.js";import{getBoundsOptimizedGeometry as c,convertToGeometry as f,convertFromPolygon as u}from"../../../../../layers/graphics/featureConversionUtils.js";import{OptimizedFeature as m}from"../../../../../layers/graphics/OptimizedFeature.js";import _ from"../../../../../layers/graphics/OptimizedGeometry.js";import{checkProjectionSupport as y,project as I}from"../../../../../layers/graphics/data/projectionSupport.js";import{createDisplayId as b}from"../../../engine/webgl/DisplayId.js";import{featureAdapter as j}from"../FeatureStore2D.js";import{Store2D as v}from"../Store2D.js";import{FeatureSetReaderJSON as B}from"./FeatureSetReaderJSON.js";import x from"../../../../../geometry/SpatialReference.js";import S from"../../../../../geometry/Polygon.js";import F from"../../../../../geometry/Extent.js";const G=t.getLogger("esri.view.2d.layers.features.support.BinStore"),L=12,R=64,T=5;function A(e){return 57.29577951308232*e}class D extends v{constructor(t,s,r,i){super(t,r),this.events=new e,this.objectIdField="aggregateId",this.featureAdapter=j,this._geohashLevel=T,this._geohashBuf=[],this._serviceInfo=i,this.geometryInfo=t.geometryInfo,this._spatialReference=s,this._projectionSupportCheck=y(s,x.WGS84),this._bitsets.geohash=r.getBitset(r.createBitset()),this._bitsets.inserted=r.getBitset(r.createBitset())}destroy(){this._tree&&this._tree.destroy()}get featureSpatialReference(){return this._spatialReference}get fields(){return this._fields}async updateSchema(e,t){const r=this._schema;try{await super.updateSchema(e,t),await this._projectionSupportCheck}catch(n){}this._fields=this._schema.params.fields;const i=o(r,t);t&&(!s(i)||e.source||e.storage.filters)?((a(i,"params.fields")||a(i,"params")||!this._tree||e.source)&&(this._tree&&this._tree.destroy(),this._tree=new h(this._statisticFields,this._serviceInfo),this._tree.onRelease=e=>e.displayId&&this._storage.releaseDisplayId(e.displayId),this._geohashLevel=this._schema.params.fixedBinLevel,this._rebuildTree(),has("esri-2d-update-debug")&&G.info("Aggregate mesh needs update due to tree changing")),has("esri-2d-update-debug")&&G.info("Aggregate mesh needs update due to tree changing"),e.targets[t.name]=!0,e.mesh=!1):r&&(e.mesh=!0)}clear(){this._rebuildTree()}sweepFeatures(e,t){this._bitsets.inserted.forEachSet((s=>{if(!e.has(s)){const e=t.lookupByDisplayIdUnsafe(s);this._remove(e)}}))}sweepAggregates(e,t,s){}onTileData(e,t,r,i,o=!0){if(!this._schema||s(t.addOrUpdate))return t;this.events.emit("changed");const a=this._getTransforms(e,this._spatialReference);{const e=t.addOrUpdate.getCursor();for(;e.next();)this._update(e,i)}if(t.status.mesh||!o)return t;const h=new Array;this._getBinsForTile(h,e,a,r),t.addOrUpdate=B.fromOptimizedFeatures(h,{...this._serviceInfo,geometryType:"esriGeometryPolygon"}),t.addOrUpdate.attachStorage(r),t.clear=!0,t.end=!0;{const s=t.addOrUpdate.getCursor();for(;s.next();){const t=s.getDisplayId();this._bitsets.computed.unset(t),this.setComputedAttributes(r,s,t,e.scale)}}return t}forEachBin(e){this._tree.forEach(e)}forEach(e){this._tree.forEach((t=>{if(t.depth!==this._geohashLevel)return;const s=this._toFeatureJSON(t),r=B.fromFeatures([s],{objectIdField:this.objectIdField,globalIdField:null,geometryType:this.geometryInfo.geometryType,fields:this.fields}).getCursor();r.next(),e(r)}))}forEachInBounds(e,t){}forEachBounds(e,t,r){const{hasM:i,hasZ:o}=this.geometryInfo;for(const a of e){const e=c([0,0,0,0],a.readGeometry(),o,i);s(e)||t(g(r,e))}}toArray(){const e=[];return this.forEach((t=>e.push(t))),e}onTileUpdate(e){}getAggregate(e){const t=b(e,!0),s=this._tree.findIf((e=>e.displayId===t));return r(s,(e=>this._toFeatureJSON(e)))}getAggregates(){return this._tree.findAllIf((e=>e.depth===this._geohashLevel)).map(this._toFeatureJSON.bind(this))}getDisplayId(e){const t=this._tree.findIf((t=>t.id===e));return r(t,(e=>e.displayId))}getFeatureDisplayIdsForAggregate(e){const t=this._tree.findIf((t=>t.id===e));return i(t,[],(e=>Array.from(e.displayIds)))}getDisplayIdForReferenceId(e){const t=this._tree.findIf((t=>1===t.displayIds.size&&t.displayIds.has(e)));return r(t,(e=>e.displayId))}_toFeatureJSON(e){const t=this._spatialReference;return{displayId:e.displayId,attributes:e.getAttributes(),geometry:f(e.getGeometry(t),"esriGeometryPolygon",!1,!1),centroid:null}}_rebuildTree(){this._bitsets.computed.clear(),this._bitsets.inserted.clear(),this._tree&&this._tree.clear()}_remove(e){const t=e.getDisplayId(),s=e.getXHydrated(),r=e.getYHydrated(),i=this._geohashBuf[2*t],o=this._geohashBuf[2*t+1];this._bitsets.inserted.has(t)&&(this._bitsets.inserted.unset(t),this._tree.removeCursor(e,s,r,i,o,this._geohashLevel))}_update(e,t){const s=e.getDisplayId(),r=this._bitsets.inserted,i=t.isVisible(s);if(i===r.has(s))return;if(!i)return void this._remove(e);const o=e.getXHydrated(),a=e.getYHydrated();if(!this._setGeohash(s,o,a))return;const h=this._geohashBuf[2*s],n=this._geohashBuf[2*s+1];this._tree.insertCursor(e,s,o,a,h,n,this._geohashLevel),r.set(s)}_setGeohash(e,t,s){if(this._bitsets.geohash.has(e))return!0;const r=this._geohashBuf;if(this._spatialReference.isWebMercator){const i=A(t/l.radius),o=i-360*Math.floor((i+180)/360),a=A(Math.PI/2-2*Math.atan(Math.exp(-s/l.radius)));n(r,e,a,o,L)}else{const i=I({x:t,y:s},this._spatialReference,x.WGS84);if(!i)return!1;n(r,e,i.y,i.x,L)}return this._bitsets.geohash.set(e),!0}_getBinsForTile(e,t,s,r){try{const i=this._getGeohashBounds(t),o=this._tree.getBins(i);for(const t of o){t.displayId||(t.displayId=r.createDisplayId(!0));const i=t.getGeometry(this._spatialReference,s.tile),o=new m(i,t.getAttributes());o.objectId=t.id,o.displayId=t.displayId,e.push(o)}}catch(i){return void G.error("Unable to get bins for tile",t.key.id)}}_getGeohash(e,t,s){const r={geohashX:0,geohashY:0};return d(r,t,e,s),r}_getGeohashBounds(e){const t=this._getGeohashLevel(e.key.level),s=[e.extent.xmin,e.extent.ymin,e.extent.xmax,e.extent.ymax],r=S.fromExtent(F.fromBounds(s,this._spatialReference)),i=I(r,this._spatialReference,x.WGS84,{densificationStep:e.resolution*R}),o=u(new _,i,!1,!1),a=o.coords.filter(((e,t)=>!(t%2))),h=o.coords.filter(((e,t)=>t%2)),n=Math.min(...a),d=Math.min(...h),g=Math.max(...a),l=Math.max(...h),p=this._getGeohash(n,d,t),c=this._getGeohash(g,l,t);return{bounds:s,geohashBounds:{xLL:p.geohashX,yLL:p.geohashY,xTR:c.geohashX,yTR:c.geohashY},level:t}}_getGeohashLevel(e){return this._schema.params.fixedBinLevel}_getTransforms(e,t){const s={originPosition:"upperLeft",scale:[e.resolution,e.resolution],translate:[e.bounds[0],e.bounds[3]]},r=p(t);if(!r)return{tile:s,left:null,right:null};const[i,o]=r.valid;return{tile:s,left:{...s,translate:[o,e.bounds[3]]},right:{...s,translate:[i-o+e.bounds[0],e.bounds[3]]}}}}export{D as BinStore};