@arcgis/core 4.23.0-next.20220104 → 4.23.0-next.20220119

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 (534) hide show
  1. package/assets/components/assets/calcite-date-picker/nls/bg.json +31 -0
  2. package/assets/components/assets/calcite-icon/centerAlign16.json +1 -0
  3. package/assets/components/assets/calcite-icon/centerAlign24.json +1 -0
  4. package/assets/components/assets/calcite-icon/centerAlign32.json +1 -0
  5. package/assets/components/assets/calcite-icon/checkSquareF16.json +1 -0
  6. package/assets/components/assets/calcite-icon/checkSquareF24.json +1 -0
  7. package/assets/components/assets/calcite-icon/checkSquareF32.json +1 -0
  8. package/assets/components/assets/calcite-icon/convert16.json +1 -0
  9. package/assets/components/assets/calcite-icon/convert24.json +1 -0
  10. package/assets/components/assets/calcite-icon/convert32.json +1 -0
  11. package/assets/components/assets/calcite-icon/explore16.json +1 -0
  12. package/assets/components/assets/calcite-icon/explore24.json +1 -0
  13. package/assets/components/assets/calcite-icon/explore32.json +1 -0
  14. package/assets/components/assets/calcite-icon/formDropdown16.json +1 -0
  15. package/assets/components/assets/calcite-icon/formDropdown24.json +1 -0
  16. package/assets/components/assets/calcite-icon/formDropdown32.json +1 -0
  17. package/assets/components/assets/calcite-icon/language16.json +1 -0
  18. package/assets/components/assets/calcite-icon/language24.json +1 -0
  19. package/assets/components/assets/calcite-icon/language32.json +1 -0
  20. package/assets/components/assets/calcite-icon/languageTranslate16.json +1 -0
  21. package/assets/components/assets/calcite-icon/languageTranslate24.json +1 -0
  22. package/assets/components/assets/calcite-icon/languageTranslate32.json +1 -0
  23. package/assets/components/assets/calcite-icon/leftAlign16.json +1 -0
  24. package/assets/components/assets/calcite-icon/leftAlign24.json +1 -0
  25. package/assets/components/assets/calcite-icon/leftAlign32.json +1 -0
  26. package/assets/components/assets/calcite-icon/lineSolid4.json +1 -0
  27. package/assets/components/assets/calcite-icon/partlyCloudy16.json +1 -0
  28. package/assets/components/assets/calcite-icon/partlyCloudy24.json +1 -0
  29. package/assets/components/assets/calcite-icon/partlyCloudy32.json +1 -0
  30. package/assets/components/assets/calcite-icon/rightAlign16.json +1 -0
  31. package/assets/components/assets/calcite-icon/rightAlign24.json +1 -0
  32. package/assets/components/assets/calcite-icon/rightAlign32.json +1 -0
  33. package/assets/components/assets/calcite-icon/screenshotMode16.json +1 -0
  34. package/assets/components/assets/calcite-icon/screenshotMode24.json +1 -0
  35. package/assets/components/assets/calcite-icon/screenshotMode32.json +1 -0
  36. package/assets/components/assets/calcite-icon/squareF16.json +1 -0
  37. package/assets/components/assets/calcite-icon/squareF24.json +1 -0
  38. package/assets/components/assets/calcite-icon/squareF32.json +1 -0
  39. package/assets/components/assets/calcite-icon/terminal16.json +1 -0
  40. package/assets/components/assets/calcite-icon/terminal24.json +1 -0
  41. package/assets/components/assets/calcite-icon/terminal32.json +1 -0
  42. package/assets/components/assets/calcite-icon/touch16.json +1 -0
  43. package/assets/components/assets/calcite-icon/touch24.json +1 -0
  44. package/assets/components/assets/calcite-icon/touch32.json +1 -0
  45. package/assets/components/assets/calcite-icon/xHexagon16.json +1 -0
  46. package/assets/components/assets/calcite-icon/xHexagon24.json +1 -0
  47. package/assets/components/assets/calcite-icon/xHexagon32.json +1 -0
  48. package/assets/components/assets/calcite-icon/xHexagonF16.json +1 -0
  49. package/assets/components/assets/calcite-icon/xHexagonF24.json +1 -0
  50. package/assets/components/assets/calcite-icon/xHexagonF32.json +1 -0
  51. package/assets/components/assets/calcite-icon/xOctagonF16.json +1 -0
  52. package/assets/components/assets/calcite-icon/xOctagonF24.json +1 -0
  53. package/assets/components/assets/calcite-icon/xOctagonF32.json +1 -0
  54. package/assets/esri/core/workers/RemoteClient.js +1 -1
  55. package/assets/esri/core/workers/chunks/01ef8de7f76a8c61b464.js +1 -0
  56. package/assets/esri/core/workers/chunks/05db312a0ca6bd3f014a.js +1 -0
  57. package/assets/esri/core/workers/chunks/09da224052976e290828.js +1 -0
  58. package/assets/esri/core/workers/chunks/{2c9af2ebd72d9b55329b.js → 0f254c3e91e8fee55f28.js} +1 -1
  59. package/assets/esri/core/workers/chunks/{ce5ca5e95b2378ec55b9.js → 1305ef8717da6e902a55.js} +1 -1
  60. package/assets/esri/core/workers/chunks/{1a2e5b267a0cbf8553b7.js → 1b28042fdf3f4dbc8ea5.js} +1 -1
  61. package/assets/esri/core/workers/chunks/20411bb8e04703962ce6.js +1 -0
  62. package/assets/esri/core/workers/chunks/21a77eed1a4ef5b0ff08.js +1 -0
  63. package/assets/esri/core/workers/chunks/2416f8bf8bbd2ec786ab.js +1 -0
  64. package/assets/esri/core/workers/chunks/25a3e9bc0b4c7e0d3165.js +1 -0
  65. package/assets/esri/core/workers/chunks/{9c417740bf3707a0d465.js → 2c607d30ff8ca1b61286.js} +1 -1
  66. package/assets/esri/core/workers/chunks/2e445a8735ea2adb641a.js +1 -0
  67. package/assets/esri/core/workers/chunks/3564e14010953def6df9.js +1 -0
  68. package/assets/esri/core/workers/chunks/37a7bd30352b1309b8f8.js +1 -0
  69. package/assets/esri/core/workers/chunks/390d9021169e65c10eb8.js +1 -0
  70. package/assets/esri/core/workers/chunks/{3d5169ea9810d10caf0d.js → 3a9740dccda6a733313c.js} +1 -1
  71. package/assets/esri/core/workers/chunks/403c7d64f12f00330d88.js +1 -0
  72. package/assets/esri/core/workers/chunks/43cdff2418325e163420.js +1 -0
  73. package/assets/esri/core/workers/chunks/4409d77c9734de4e82a7.js +1 -0
  74. package/assets/esri/core/workers/chunks/{f52b6d5037e4205b035c.js → 47395d225229d237f0ac.js} +1 -1
  75. package/assets/esri/core/workers/chunks/4b69129c0557852d9b3d.js +1 -0
  76. package/assets/esri/core/workers/chunks/57c67e260267a1dbc5e3.js +1 -0
  77. package/assets/esri/core/workers/chunks/5ac4c1d54b94c7d87835.js +1 -0
  78. package/assets/esri/core/workers/chunks/60371c0f750cde87656d.js +1 -0
  79. package/assets/esri/core/workers/chunks/618076e6de605873e433.js +1 -0
  80. package/assets/esri/core/workers/chunks/{ba6fdaed6c315dc13981.js → 625d2663daa8e0cf64b0.js} +1 -1
  81. package/assets/esri/core/workers/chunks/631c5b514bb73782c570.js +1 -0
  82. package/assets/esri/core/workers/chunks/{3a2b2dc3e938d53faa30.js → 64276aacaafa4c8a15bd.js} +1 -1
  83. package/assets/esri/core/workers/chunks/{75466e0c8c8da499b150.js → 662d13f68cf3ec92439b.js} +1 -1
  84. package/assets/esri/core/workers/chunks/67162b3e2cc1b5dc6818.js +1 -0
  85. package/assets/esri/core/workers/chunks/6c1e92ff4c732dfda756.js +1 -0
  86. package/assets/esri/core/workers/chunks/6cdfe175c965918b741b.js +1 -0
  87. package/assets/esri/core/workers/chunks/75d53b28afe732c459b2.js +1 -0
  88. package/assets/esri/core/workers/chunks/76eef4799f6c5fff7e2d.js +1 -0
  89. package/assets/esri/core/workers/chunks/{ea05f870dda27bca4fe8.js → 7a8764ae8a0041e1151d.js} +2 -2
  90. package/assets/esri/core/workers/chunks/{ea05f870dda27bca4fe8.js.LICENSE.txt → 7a8764ae8a0041e1151d.js.LICENSE.txt} +1 -1
  91. package/assets/esri/core/workers/chunks/7e596478507466953e65.js +1 -0
  92. package/assets/esri/core/workers/chunks/85e27fd949475f9a6bbc.js +1 -0
  93. package/assets/esri/core/workers/chunks/8967288145f8fbd20e7d.js +1 -0
  94. package/assets/esri/core/workers/chunks/8cbb04a9065aa3756638.js +1 -0
  95. package/assets/esri/core/workers/chunks/{9846098704ee38bf6350.js → 8fdd5bca3716816d359b.js} +1 -1
  96. package/assets/esri/core/workers/chunks/96ab518eb6ba11333dee.js +1 -0
  97. package/assets/esri/core/workers/chunks/99a777693e4539f0b03b.js +1 -0
  98. package/assets/esri/core/workers/chunks/9d77467aa71d345fc1b6.js +1 -0
  99. package/assets/esri/core/workers/chunks/{4beba242e7540ee3182b.js → 9d9dffc8884d66a258e4.js} +1 -1
  100. package/assets/esri/core/workers/chunks/9f8b7b6b4e95f9a794fc.js +1 -0
  101. package/assets/esri/core/workers/chunks/{a721342a32541717324d.js → a28b53c61bddefb6616e.js} +1 -1
  102. package/assets/esri/core/workers/chunks/{9b7c51ff3d2b42aa62f5.js → a7b1b75643ed31489495.js} +1 -1
  103. package/assets/esri/core/workers/chunks/a8b13fb804bb775e4967.js +1 -0
  104. package/assets/esri/core/workers/chunks/a8c13529367c037cdd94.js +1 -0
  105. package/assets/esri/core/workers/chunks/a960074644c3722be71e.js +1 -0
  106. package/assets/esri/core/workers/chunks/ac8dca61ade28c542ae2.js +1 -0
  107. package/assets/esri/core/workers/chunks/ad081d8e49e7f90c3c26.js +1 -0
  108. package/assets/esri/core/workers/chunks/b10fcbe1393c812fc219.js +1 -0
  109. package/assets/esri/core/workers/chunks/{2a39d520b192b8e552b5.js → b2ae5fc4f787ea568b88.js} +1 -1
  110. package/assets/esri/core/workers/chunks/{b87bc1481a49b38109f4.js → b9c177524b3e7de1ffd1.js} +1 -1
  111. package/assets/esri/core/workers/chunks/b9de831ac379cf1d2969.js +1 -0
  112. package/assets/esri/core/workers/chunks/ba615f118a3a8970ef25.js +1 -0
  113. package/assets/esri/core/workers/chunks/{7c1b9ae141112a63b446.js → ba6654a885be4b7a43f0.js} +1 -1
  114. package/assets/esri/core/workers/chunks/be2b7cce79fd41627931.js +1 -0
  115. package/assets/esri/core/workers/chunks/c13dfdd548dcb1bdb294.js +1 -0
  116. package/assets/esri/core/workers/chunks/c36f84daa7736878418d.js +1 -0
  117. package/assets/esri/core/workers/chunks/{b58eba403bd517a7bb15.js → c3eca92d02958732e141.js} +1 -1
  118. package/assets/esri/core/workers/chunks/c6f94b92e866b881d9b9.js +1 -0
  119. package/assets/esri/core/workers/chunks/{b51261a9a9ab62388839.js → c8f976e53e232e8da9cc.js} +39 -29
  120. package/assets/esri/core/workers/chunks/cbb291412fd1a5261aa9.js +1 -0
  121. package/assets/esri/core/workers/chunks/d1454155ee1b8a421cbb.js +1 -0
  122. package/assets/esri/core/workers/chunks/{0cd583c3233573cb8468.js → d24c4fbc567486b1188f.js} +1 -1
  123. package/assets/esri/core/workers/chunks/d52108864136c5a8a618.js +1 -0
  124. package/assets/esri/core/workers/chunks/dd433c160f7a0c120b82.js +1 -0
  125. package/assets/esri/core/workers/chunks/de03439ca2c9782bf325.js +1 -0
  126. package/assets/esri/core/workers/chunks/e2d68bcd2f99a65387bf.js +1 -0
  127. package/assets/esri/core/workers/chunks/e59764ee8cf25d4f74e2.js +1 -0
  128. package/assets/esri/core/workers/chunks/e6df9839b551569fbc62.js +1 -0
  129. package/assets/esri/core/workers/chunks/{2f66fcb8670b108af549.js → ed0bcc66fb1e0ee75a4b.js} +1 -1
  130. package/assets/esri/core/workers/chunks/{6deac533bb455be4004b.js → ef8b75b92cf549e0507e.js} +1 -1
  131. package/assets/esri/core/workers/chunks/f7fc4c993536e62f7f3e.js +1 -0
  132. package/assets/esri/themes/base/icons/fonts/CalciteWebCoreIcons.svg +1 -0
  133. package/assets/esri/themes/base/icons/fonts/CalciteWebCoreIcons.ttf +0 -0
  134. package/assets/esri/themes/base/icons/fonts/CalciteWebCoreIcons.woff +0 -0
  135. package/assets/esri/themes/base/icons/selection.json +1 -1
  136. package/assets/esri/themes/base/icons/style.css +4 -0
  137. package/assets/esri/themes/base/icons/style.scss +6 -0
  138. package/assets/esri/themes/base/icons/variables.scss +1 -0
  139. package/assets/esri/themes/base/widgets/_Weather.scss +1 -1
  140. package/assets/esri/themes/dark/main.css +1 -1
  141. package/assets/esri/themes/dark-blue/main.css +1 -1
  142. package/assets/esri/themes/dark-green/main.css +1 -1
  143. package/assets/esri/themes/dark-purple/main.css +1 -1
  144. package/assets/esri/themes/dark-red/main.css +1 -1
  145. package/assets/esri/themes/light/main.css +1 -1
  146. package/assets/esri/themes/light/view.css +1 -1
  147. package/assets/esri/themes/light-blue/main.css +1 -1
  148. package/assets/esri/themes/light-green/main.css +1 -1
  149. package/assets/esri/themes/light-purple/main.css +1 -1
  150. package/assets/esri/themes/light-red/main.css +1 -1
  151. package/assets/esri/widgets/Editor/t9n/Editor_ar.json +1 -1
  152. package/assets/esri/widgets/Editor/t9n/Editor_bg.json +1 -1
  153. package/assets/esri/widgets/Editor/t9n/Editor_bs.json +1 -1
  154. package/assets/esri/widgets/Editor/t9n/Editor_ca.json +1 -1
  155. package/assets/esri/widgets/Editor/t9n/Editor_cs.json +1 -1
  156. package/assets/esri/widgets/Editor/t9n/Editor_da.json +1 -1
  157. package/assets/esri/widgets/Editor/t9n/Editor_de.json +1 -1
  158. package/assets/esri/widgets/Editor/t9n/Editor_el.json +1 -1
  159. package/assets/esri/widgets/Editor/t9n/Editor_es.json +1 -1
  160. package/assets/esri/widgets/Editor/t9n/Editor_et.json +1 -1
  161. package/assets/esri/widgets/Editor/t9n/Editor_fi.json +1 -1
  162. package/assets/esri/widgets/Editor/t9n/Editor_fr.json +1 -1
  163. package/assets/esri/widgets/Editor/t9n/Editor_he.json +1 -1
  164. package/assets/esri/widgets/Editor/t9n/Editor_hr.json +1 -1
  165. package/assets/esri/widgets/Editor/t9n/Editor_hu.json +1 -1
  166. package/assets/esri/widgets/Editor/t9n/Editor_id.json +1 -1
  167. package/assets/esri/widgets/Editor/t9n/Editor_it.json +1 -1
  168. package/assets/esri/widgets/Editor/t9n/Editor_ja.json +1 -1
  169. package/assets/esri/widgets/Editor/t9n/Editor_ko.json +1 -1
  170. package/assets/esri/widgets/Editor/t9n/Editor_lt.json +1 -1
  171. package/assets/esri/widgets/Editor/t9n/Editor_lv.json +1 -1
  172. package/assets/esri/widgets/Editor/t9n/Editor_nb.json +1 -1
  173. package/assets/esri/widgets/Editor/t9n/Editor_nl.json +1 -1
  174. package/assets/esri/widgets/Editor/t9n/Editor_pl.json +1 -1
  175. package/assets/esri/widgets/Editor/t9n/Editor_pt-BR.json +1 -1
  176. package/assets/esri/widgets/Editor/t9n/Editor_pt-PT.json +1 -1
  177. package/assets/esri/widgets/Editor/t9n/Editor_ro.json +1 -1
  178. package/assets/esri/widgets/Editor/t9n/Editor_ru.json +1 -1
  179. package/assets/esri/widgets/Editor/t9n/Editor_sk.json +1 -1
  180. package/assets/esri/widgets/Editor/t9n/Editor_sl.json +1 -1
  181. package/assets/esri/widgets/Editor/t9n/Editor_sr.json +1 -1
  182. package/assets/esri/widgets/Editor/t9n/Editor_sv.json +1 -1
  183. package/assets/esri/widgets/Editor/t9n/Editor_th.json +1 -1
  184. package/assets/esri/widgets/Editor/t9n/Editor_tr.json +1 -1
  185. package/assets/esri/widgets/Editor/t9n/Editor_uk.json +1 -1
  186. package/assets/esri/widgets/Editor/t9n/Editor_vi.json +1 -1
  187. package/assets/esri/widgets/Editor/t9n/Editor_zh-CN.json +1 -1
  188. package/assets/esri/widgets/Editor/t9n/Editor_zh-HK.json +1 -1
  189. package/assets/esri/widgets/Editor/t9n/Editor_zh-TW.json +1 -1
  190. package/assets/esri/widgets/ElevationProfile/t9n/ElevationProfile_ja.json +1 -1
  191. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_ar.json +1 -1
  192. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_bg.json +1 -1
  193. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_bs.json +1 -1
  194. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_ca.json +1 -1
  195. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_cs.json +1 -1
  196. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_da.json +1 -1
  197. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_de.json +1 -1
  198. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_el.json +1 -1
  199. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_es.json +1 -1
  200. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_et.json +1 -1
  201. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_fi.json +1 -1
  202. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_fr.json +1 -1
  203. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_he.json +1 -1
  204. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_hr.json +1 -1
  205. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_hu.json +1 -1
  206. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_id.json +1 -1
  207. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_it.json +1 -1
  208. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_ja.json +1 -1
  209. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_ko.json +1 -1
  210. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_lt.json +1 -1
  211. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_lv.json +1 -1
  212. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_nb.json +1 -1
  213. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_nl.json +1 -1
  214. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_pl.json +1 -1
  215. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_pt-BR.json +1 -1
  216. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_pt-PT.json +1 -1
  217. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_ro.json +1 -1
  218. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_ru.json +1 -1
  219. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_sk.json +1 -1
  220. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_sl.json +1 -1
  221. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_sr.json +1 -1
  222. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_sv.json +1 -1
  223. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_th.json +1 -1
  224. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_tr.json +1 -1
  225. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_uk.json +1 -1
  226. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_vi.json +1 -1
  227. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_zh-CN.json +1 -1
  228. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_zh-HK.json +1 -1
  229. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_zh-TW.json +1 -1
  230. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_cs.json +1 -1
  231. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_el.json +1 -1
  232. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_fr.json +1 -1
  233. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_lv.json +1 -1
  234. package/assets/esri/widgets/Weather/t9n/Weather_ar.json +1 -1
  235. package/assets/esri/widgets/Weather/t9n/Weather_bg.json +1 -1
  236. package/assets/esri/widgets/Weather/t9n/Weather_bs.json +1 -1
  237. package/assets/esri/widgets/Weather/t9n/Weather_ca.json +1 -1
  238. package/assets/esri/widgets/Weather/t9n/Weather_cs.json +1 -1
  239. package/assets/esri/widgets/Weather/t9n/Weather_da.json +1 -1
  240. package/assets/esri/widgets/Weather/t9n/Weather_de.json +1 -1
  241. package/assets/esri/widgets/Weather/t9n/Weather_el.json +1 -1
  242. package/assets/esri/widgets/Weather/t9n/Weather_es.json +1 -1
  243. package/assets/esri/widgets/Weather/t9n/Weather_et.json +1 -1
  244. package/assets/esri/widgets/Weather/t9n/Weather_fi.json +1 -1
  245. package/assets/esri/widgets/Weather/t9n/Weather_fr.json +1 -1
  246. package/assets/esri/widgets/Weather/t9n/Weather_he.json +1 -1
  247. package/assets/esri/widgets/Weather/t9n/Weather_hr.json +1 -1
  248. package/assets/esri/widgets/Weather/t9n/Weather_hu.json +1 -1
  249. package/assets/esri/widgets/Weather/t9n/Weather_id.json +1 -1
  250. package/assets/esri/widgets/Weather/t9n/Weather_it.json +1 -1
  251. package/assets/esri/widgets/Weather/t9n/Weather_ja.json +1 -1
  252. package/assets/esri/widgets/Weather/t9n/Weather_ko.json +1 -1
  253. package/assets/esri/widgets/Weather/t9n/Weather_lt.json +1 -1
  254. package/assets/esri/widgets/Weather/t9n/Weather_lv.json +1 -1
  255. package/assets/esri/widgets/Weather/t9n/Weather_nb.json +1 -1
  256. package/assets/esri/widgets/Weather/t9n/Weather_nl.json +1 -1
  257. package/assets/esri/widgets/Weather/t9n/Weather_pl.json +1 -1
  258. package/assets/esri/widgets/Weather/t9n/Weather_pt-BR.json +1 -1
  259. package/assets/esri/widgets/Weather/t9n/Weather_pt-PT.json +1 -1
  260. package/assets/esri/widgets/Weather/t9n/Weather_ro.json +1 -1
  261. package/assets/esri/widgets/Weather/t9n/Weather_ru.json +1 -1
  262. package/assets/esri/widgets/Weather/t9n/Weather_sk.json +1 -1
  263. package/assets/esri/widgets/Weather/t9n/Weather_sl.json +1 -1
  264. package/assets/esri/widgets/Weather/t9n/Weather_sr.json +1 -1
  265. package/assets/esri/widgets/Weather/t9n/Weather_sv.json +1 -1
  266. package/assets/esri/widgets/Weather/t9n/Weather_th.json +1 -1
  267. package/assets/esri/widgets/Weather/t9n/Weather_tr.json +1 -1
  268. package/assets/esri/widgets/Weather/t9n/Weather_uk.json +1 -1
  269. package/assets/esri/widgets/Weather/t9n/Weather_vi.json +1 -1
  270. package/assets/esri/widgets/Weather/t9n/Weather_zh-CN.json +1 -1
  271. package/assets/esri/widgets/Weather/t9n/Weather_zh-HK.json +1 -1
  272. package/assets/esri/widgets/Weather/t9n/Weather_zh-TW.json +1 -1
  273. package/chunks/Clouds.glsl.js +14 -14
  274. package/chunks/DefaultMaterial.glsl.js +2 -2
  275. package/chunks/HUDMaterial.glsl.js +22 -21
  276. package/chunks/RibbonLine.glsl.js +10 -14
  277. package/chunks/persistableUrlUtils.js +1 -1
  278. package/chunks/vec32.js +1 -1
  279. package/chunks/vec42.js +1 -1
  280. package/core/urlUtils.js +1 -1
  281. package/form/elements/FieldElement.js +1 -1
  282. package/geometry/support/buffer/math/common.js +1 -1
  283. package/interfaces.d.ts +100 -57
  284. package/layers/FeatureLayer.js +1 -1
  285. package/layers/SubtypeGroupLayer.js +1 -1
  286. package/layers/VectorTileLayer.js +1 -1
  287. package/layers/WMSLayer.js +1 -1
  288. package/layers/graphics/controllers/FeatureTileController3D.js +1 -1
  289. package/layers/graphics/data/QueryEngineCapabilities.js +1 -1
  290. package/layers/graphics/sources/OGCFeatureSource.js +1 -1
  291. package/layers/mixins/ArcGISImageService.js +1 -1
  292. package/layers/mixins/OperationalLayer.js +1 -1
  293. package/layers/ogc/crsUtils.js +5 -0
  294. package/layers/support/RasterFunction.js +1 -1
  295. package/layers/support/capabilities.js +1 -1
  296. package/layers/support/rasterDatasets/WCSRaster.js +1 -1
  297. package/layers/support/rasterDatasets/wcsCoverageParser.js +1 -1
  298. package/layers/support/vectorTileLayerLoader.js +1 -1
  299. package/layers/support/wmsUtils.js +1 -1
  300. package/layers/support/wmtsUtils.js +1 -1
  301. package/package.json +5 -5
  302. package/rasterRenderers.js +1 -1
  303. package/renderers/support/RasterSymbolizer.js +1 -1
  304. package/renderers/support/rasterRendererHelper.js +1 -1
  305. package/request.js +1 -1
  306. package/rest/print.js +1 -1
  307. package/rest/support/ImageIdentifyParameters.js +1 -1
  308. package/rest/support/StatisticDefinition.js +1 -1
  309. package/smartMapping/raster/renderers/classBreaks.js +1 -1
  310. package/smartMapping/renderers/univariateColorSize.js +1 -1
  311. package/smartMapping/support/adapters/FeatureLayerAdapter.js +1 -1
  312. package/support/featureFlags.js +1 -1
  313. package/support/revision.js +1 -1
  314. package/symbols/ExtrudeSymbol3DLayer.js +1 -1
  315. package/symbols/Font.js +1 -1
  316. package/symbols/IconSymbol3DLayer.js +1 -1
  317. package/symbols/ObjectSymbol3DLayer.js +1 -1
  318. package/symbols/PathSymbol3DLayer.js +1 -1
  319. package/symbols/TextSymbol.js +1 -1
  320. package/symbols/TextSymbol3DLayer.js +1 -1
  321. package/symbols/support/Symbol3DHalo.js +1 -1
  322. package/symbols/support/Symbol3DMaterial.js +1 -1
  323. package/symbols/support/constants.js +5 -0
  324. package/symbols/support/utils.js +1 -1
  325. package/views/2d/engine/Stage.js +1 -1
  326. package/views/2d/engine/vectorTiles/TileHandler.js +1 -1
  327. package/views/2d/engine/vectorTiles/shaders/VTLMaterialManager.js +1 -1
  328. package/views/2d/engine/vectorTiles/style/VectorTileSource.js +1 -1
  329. package/views/2d/engine/vectorTiles/style/VectorTilesRequestManager.js +5 -0
  330. package/views/2d/engine/webgl/BitBlitRenderer.js +1 -1
  331. package/views/2d/engine/webgl/MaterialManager.js +1 -1
  332. package/views/2d/engine/webgl/alignmentUtils.js +1 -1
  333. package/views/2d/engine/webgl/effects/BlendEffect.js +1 -1
  334. package/views/2d/engine/webgl/materialKey/MaterialKey.js +1 -1
  335. package/views/2d/engine/webgl/mesh/templates/WGLLabelTemplate.js +1 -1
  336. package/views/2d/engine/webgl/shaders/BlendPrograms.js +1 -1
  337. package/views/2d/engine/webgl/shaders/MaterialPrograms.js +1 -1
  338. package/views/2d/layers/BaseLayerView2D.js +1 -1
  339. package/views/2d/layers/BaseLayerViewGL2D.js +1 -1
  340. package/views/2d/layers/GraphicsLayerView2D.js +1 -1
  341. package/views/2d/layers/ImageryLayerView2D.js +1 -1
  342. package/views/2d/layers/ImageryTileLayerView2D.js +1 -1
  343. package/views/2d/layers/LayerView2D.js +1 -1
  344. package/views/2d/layers/MapNotesLayerView2D.js +1 -1
  345. package/views/2d/layers/RouteLayerView2D.js +1 -1
  346. package/views/2d/layers/TileLayerView2D.js +1 -1
  347. package/views/2d/layers/VectorTileLayerView2D.js +1 -1
  348. package/views/2d/layers/WMSLayerView2D.js +1 -1
  349. package/views/2d/layers/WMTSLayerView2D.js +1 -1
  350. package/views/2d/layers/features/support/AttributeStore.js +1 -1
  351. package/views/2d/layers/graphics/GraphicBoundsRenderer.js +1 -1
  352. package/views/2d/layers/graphics/GraphicsView2D.js +1 -1
  353. package/views/2d/support/engineHelpers.js +1 -1
  354. package/views/3d/analysis/LineOfSight/LineOfSightController.js +1 -1
  355. package/views/3d/environment/CloudyWeather.js +1 -1
  356. package/views/3d/environment/Fog.js +1 -1
  357. package/views/3d/environment/FoggyWeather.js +1 -1
  358. package/views/3d/environment/NoiseTextureAtlas.js +1 -1
  359. package/views/3d/environment/RainyWeather.js +1 -1
  360. package/views/3d/environment/Stars.js +1 -1
  361. package/views/3d/layers/BuildingComponentSublayerView3D.js +1 -1
  362. package/views/3d/layers/DynamicLayerView3D.js +1 -1
  363. package/views/3d/layers/FeatureLayerViewBase3D.js +1 -1
  364. package/views/3d/layers/FeatureLikeLayerView3D.js +1 -1
  365. package/views/3d/layers/GraphicsLayerView3D.js +1 -1
  366. package/views/3d/layers/GraphicsView3D.js +1 -1
  367. package/views/3d/layers/I3SMeshView3D.js +1 -1
  368. package/views/3d/layers/ImageryLayerView3D.js +1 -1
  369. package/views/3d/layers/ImageryTileLayerView3D.js +1 -1
  370. package/views/3d/layers/IntegratedMeshLayerView3D.js +1 -1
  371. package/views/3d/layers/MapImageLayerView3D.js +1 -1
  372. package/views/3d/layers/OGCFeatureLayerView3D.js +1 -1
  373. package/views/3d/layers/PointCloudLayerView3D.js +1 -1
  374. package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
  375. package/views/3d/layers/SceneLayerView3D.js +1 -1
  376. package/views/3d/layers/VectorTileLayerView3D.js +1 -1
  377. package/views/3d/layers/WMSLayerView3D.js +1 -1
  378. package/views/3d/layers/WMTSLayerView3D.js +1 -1
  379. package/views/3d/layers/graphics/Deconflictor.js +1 -1
  380. package/views/3d/layers/graphics/Graphics3DFeatureLikeLayerView.js +1 -1
  381. package/views/3d/layers/graphics/Graphics3DGraphicLikeLayerView.js +1 -1
  382. package/views/3d/layers/graphics/Graphics3DPointSymbol.js +1 -1
  383. package/views/3d/layers/graphics/Graphics3DTextSymbolLayer.js +1 -1
  384. package/views/3d/layers/graphics/Labeler.js +1 -1
  385. package/views/3d/layers/graphics/QueryEngine.js +1 -1
  386. package/views/3d/layers/support/FeatureTileTree3DDebugger.js +1 -1
  387. package/views/3d/state/controllers/RotateController.js +1 -1
  388. package/views/3d/state/controllers/global/PinchAndPanController.js +1 -1
  389. package/views/3d/state/controllers/global/ZoomController.js +1 -1
  390. package/views/3d/state/controllers/global/ZoomStepController.js +1 -1
  391. package/views/3d/state/controllers/local/PinchAndPanController.js +1 -1
  392. package/views/3d/state/controllers/local/ZoomStepController.js +1 -1
  393. package/views/3d/support/debugFlags.js +1 -1
  394. package/views/3d/support/sunUtils.js +1 -1
  395. package/views/3d/terrain/Overlay.js +1 -1
  396. package/views/3d/terrain/OverlayManager.js +1 -1
  397. package/views/3d/terrain/TerrainSurface.js +1 -1
  398. package/views/3d/webgl-engine/core/shaderLibrary/Transform.glsl.js +7 -1
  399. package/views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl.js +28 -24
  400. package/views/3d/webgl-engine/core/shaderLibrary/shading/LineStipple.glsl.js +19 -14
  401. package/views/3d/webgl-engine/lib/GridLocalOriginFactory.js +1 -1
  402. package/views/3d/webgl-engine/lib/InstanceParameters.js +5 -0
  403. package/views/3d/webgl-engine/lib/{localOrigin.js → LocalOriginFactory.js} +0 -0
  404. package/views/3d/webgl-engine/lib/Program.js +1 -1
  405. package/views/3d/webgl-engine/lib/RenderGeometry.js +1 -1
  406. package/views/3d/webgl-engine/lib/RenderTargetHelper.js +1 -1
  407. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  408. package/views/3d/webgl-engine/lib/RenderingContext.js +1 -1
  409. package/views/3d/webgl-engine/lib/SSAOHelper.js +1 -1
  410. package/views/3d/webgl-engine/lib/TextRenderParameters.js +1 -1
  411. package/views/3d/webgl-engine/lib/TextRenderer.js +1 -1
  412. package/views/3d/webgl-engine/lib/lodRendering/LodRenderer.js +1 -1
  413. package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
  414. package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
  415. package/views/3d/webgl-engine/parts/RenderView.js +1 -1
  416. package/views/3d/webgl-engine/parts/ScreenshotManager.js +1 -1
  417. package/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js +1 -1
  418. package/views/3d/webgl-engine/shaders/HUDMaterialTechnique.js +1 -1
  419. package/views/3d/webgl-engine/shaders/RealisticTreeTechnique.js +1 -1
  420. package/views/3d/webgl-engine/shaders/RibbonLineTechnique.js +1 -1
  421. package/views/LayerViewManager.js +1 -1
  422. package/views/MapView.js +1 -1
  423. package/views/SceneView.js +1 -1
  424. package/views/interactive/snapping/FeatureSnappingEngine.js +1 -1
  425. package/views/interactive/snapping/featureSources/FeatureServiceSnappingSource.js +1 -1
  426. package/views/interactive/snapping/featureSources/GraphicsSnappingSource.js +1 -1
  427. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiledFetcher.js +1 -1
  428. package/views/layers/ImageryTileLayerView.js +1 -1
  429. package/views/layers/LayerView.js +1 -1
  430. package/views/layers/OGCFeatureLayerView.js +1 -1
  431. package/views/layers/RefreshableLayerView.js +1 -1
  432. package/views/overlay/ViewOverlay.js +1 -1
  433. package/views/support/DefaultsFromMap.js +1 -1
  434. package/views/support/WatchUpdatingTracking.js +1 -1
  435. package/views/support/imageReprojection.js +1 -1
  436. package/views/webgl/BufferObject.js +1 -1
  437. package/views/webgl/ContextState.js +1 -1
  438. package/views/webgl/FramebufferObject.js +1 -1
  439. package/views/webgl/Program.js +1 -1
  440. package/views/webgl/ProgramCache.js +1 -1
  441. package/views/webgl/ProgramTemplate.js +1 -1
  442. package/views/webgl/RenderingContext.js +1 -1
  443. package/views/webgl/ShaderTranspiler.js +1 -1
  444. package/views/webgl/UniformBufferLayout.js +5 -0
  445. package/views/webgl/UniformBufferObject.js +5 -0
  446. package/views/webgl/enums.js +1 -1
  447. package/views/webgl/rasterUtils.js +1 -1
  448. package/views/webgl/storageLayouts.js +5 -0
  449. package/views/webgl/testDoublePrecisionArithmetic.js +1 -1
  450. package/views/webgl/testFloatBufferBlend.js +1 -1
  451. package/views/webgl/testSVGPremultipliedAlpha.js +1 -1
  452. package/views/webgl/testSamplerPrecision.js +1 -1
  453. package/views/webgl/tests/SimpleDraw.js +1 -1
  454. package/widgets/BasemapLayerList.js +1 -1
  455. package/widgets/BuildingExplorer/BuildingDisciplinesViewModel.js +1 -1
  456. package/widgets/Editor/BatchCreateWorkflow.js +1 -1
  457. package/widgets/Editor/CreateWorkflow.js +1 -1
  458. package/widgets/Editor/UpdateWorkflow.js +1 -1
  459. package/widgets/Editor/workflowUtils.js +1 -1
  460. package/widgets/ElevationProfile/components/SettingsButton.js +1 -1
  461. package/widgets/ElevationProfile.js +1 -1
  462. package/widgets/Feature/FeatureExpression/FeatureExpressionViewModel.js +1 -1
  463. package/widgets/Feature/FeatureMedia.js +1 -1
  464. package/widgets/FeatureForm/FeatureFormViewModel.js +1 -1
  465. package/widgets/FeatureForm/InputField.js +1 -1
  466. package/widgets/FeatureForm/InputFieldGroup.js +1 -1
  467. package/widgets/FeatureForm.js +1 -1
  468. package/widgets/FeatureTemplates.js +1 -1
  469. package/widgets/FloorFilter.js +1 -1
  470. package/widgets/LayerList/ListItemPanel.js +1 -1
  471. package/widgets/LayerList/support/layerListUtils.js +1 -1
  472. package/widgets/Legend/support/ActiveLayerInfo.js +1 -1
  473. package/widgets/Popup.js +1 -1
  474. package/widgets/Print.js +1 -1
  475. package/widgets/Search.js +1 -1
  476. package/widgets/Sketch/SketchViewModel.js +1 -1
  477. package/widgets/Weather/CoverageSlider.js +5 -0
  478. package/widgets/Weather/WeatherViewModel.js +1 -1
  479. package/widgets/Weather/css.js +1 -1
  480. package/widgets/Weather.js +1 -1
  481. package/assets/esri/core/workers/chunks/0881ce46b10362861f87.js +0 -1
  482. package/assets/esri/core/workers/chunks/0c0a02770eeeb3e28ea1.js +0 -1
  483. package/assets/esri/core/workers/chunks/0d2effbd84a9482eb639.js +0 -1
  484. package/assets/esri/core/workers/chunks/0f04246c1b591a3ac74d.js +0 -1
  485. package/assets/esri/core/workers/chunks/1ac6be0dc25e16c75d06.js +0 -1
  486. package/assets/esri/core/workers/chunks/1f8110ea12d65ca94b55.js +0 -1
  487. package/assets/esri/core/workers/chunks/2025d0fd61a64876c81b.js +0 -1
  488. package/assets/esri/core/workers/chunks/241859d74c0daac62e11.js +0 -1
  489. package/assets/esri/core/workers/chunks/331be347c1b1ca0be2d2.js +0 -1
  490. package/assets/esri/core/workers/chunks/39af317388ecebb4387d.js +0 -1
  491. package/assets/esri/core/workers/chunks/39be2893a7dbdecfd65a.js +0 -1
  492. package/assets/esri/core/workers/chunks/3a20f66b0b7d08064e34.js +0 -1
  493. package/assets/esri/core/workers/chunks/445099d037affd139ed0.js +0 -1
  494. package/assets/esri/core/workers/chunks/45848fecec88ed2da33d.js +0 -1
  495. package/assets/esri/core/workers/chunks/48d3a3abc53abe6a4017.js +0 -1
  496. package/assets/esri/core/workers/chunks/5005b8c1fdd5cb9a4c19.js +0 -1
  497. package/assets/esri/core/workers/chunks/52e4c367c72ea7cc3457.js +0 -1
  498. package/assets/esri/core/workers/chunks/5d8170f6207dbeb4de1b.js +0 -1
  499. package/assets/esri/core/workers/chunks/642c38ac00a962f35d44.js +0 -1
  500. package/assets/esri/core/workers/chunks/64459604505647e9c714.js +0 -1
  501. package/assets/esri/core/workers/chunks/653d1550dd1a4867a9fc.js +0 -1
  502. package/assets/esri/core/workers/chunks/65f73fbbc3c7c60c6d3d.js +0 -1
  503. package/assets/esri/core/workers/chunks/6db7081d344bea26ef64.js +0 -1
  504. package/assets/esri/core/workers/chunks/6e13dab8ec43f7494297.js +0 -1
  505. package/assets/esri/core/workers/chunks/7bd4c3ee43fb038b88d8.js +0 -1
  506. package/assets/esri/core/workers/chunks/803de5097a8a2c4b58a8.js +0 -1
  507. package/assets/esri/core/workers/chunks/8298231a0fd0129b0d5c.js +0 -1
  508. package/assets/esri/core/workers/chunks/8500c6c011400af1b7bd.js +0 -1
  509. package/assets/esri/core/workers/chunks/8b322a2a47dfdbb59b45.js +0 -1
  510. package/assets/esri/core/workers/chunks/8f83bebef9174c3f15da.js +0 -1
  511. package/assets/esri/core/workers/chunks/904332faa22bc0e876cb.js +0 -1
  512. package/assets/esri/core/workers/chunks/950565d1e682fc4072e1.js +0 -1
  513. package/assets/esri/core/workers/chunks/a247ddd84245c81112c8.js +0 -1
  514. package/assets/esri/core/workers/chunks/a9ffa806df20130ecfb6.js +0 -1
  515. package/assets/esri/core/workers/chunks/af13e534e4160636bd3d.js +0 -1
  516. package/assets/esri/core/workers/chunks/b2f62234ebb8b6158baa.js +0 -1
  517. package/assets/esri/core/workers/chunks/b5bb7cfa26b1f0cec67a.js +0 -1
  518. package/assets/esri/core/workers/chunks/b8666d1a4e4fff7a4703.js +0 -1
  519. package/assets/esri/core/workers/chunks/bea1da9e3f878e0e2c83.js +0 -1
  520. package/assets/esri/core/workers/chunks/c1b6c31fa3ec1542f996.js +0 -1
  521. package/assets/esri/core/workers/chunks/c32a4fbdc87225f84019.js +0 -1
  522. package/assets/esri/core/workers/chunks/c67fea81f69a60c0eaef.js +0 -1
  523. package/assets/esri/core/workers/chunks/d336afd5890dcdbf5341.js +0 -1
  524. package/assets/esri/core/workers/chunks/da69e3e5949fe1716e34.js +0 -1
  525. package/assets/esri/core/workers/chunks/daa9c450b2e2a5371249.js +0 -1
  526. package/assets/esri/core/workers/chunks/dd63ba77b7e4c3c9c594.js +0 -1
  527. package/assets/esri/core/workers/chunks/dfa57982d28c9aeb97b9.js +0 -1
  528. package/assets/esri/core/workers/chunks/e01812116b27874948f0.js +0 -1
  529. package/assets/esri/core/workers/chunks/e5c9d8482b913cf3580a.js +0 -1
  530. package/assets/esri/core/workers/chunks/eeadd92f0bede9fc8745.js +0 -1
  531. package/assets/esri/core/workers/chunks/fbb67cb6224aed2cce16.js +0 -1
  532. package/assets/esri/core/workers/chunks/feeaf61424336e9eac88.js +0 -1
  533. package/assets/esri/core/workers/chunks/ff02295329a8986d0568.js +0 -1
  534. package/views/2d/engine/webgl/mesh/templates/meshUtils.js +0 -5
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
4
  */
5
- import t from"../../../../../core/Error.js";import{WGLVVFlag as e,WGLVVTarget as i,WGLGeometryType as s}from"../enums.js";import{isMapAligned as a}from"../mesh/templates/meshUtils.js";function r(t,s){const a=e.SIZE_FIELD_STOPS|e.SIZE_MINMAX_VALUE|e.SIZE_SCALE_STOPS|e.SIZE_UNIT_VALUE,r=(t&(i.FIELD_TARGETS_OUTLINE|i.MINMAX_TARGETS_OUTLINE|i.SCALE_TARGETS_OUTLINE|i.UNIT_TARGETS_OUTLINE))>>>4;return s.isOutline||s.isOutlinedFill?a&r:a&~r}const n=0,v=8,o=7,l=8,h=11,S=11,u=12,d=13,V=14,c=15,p=15,g=16,z=17,m=18,y=19,E=20,T=21,M=22;function L(t,e){switch(t){case s.FILL:return x.from(e);case s.LINE:return B.from(e);case s.MARKER:return U.from(e);case s.TEXT:return R.from(e);case s.LABEL:return b.from(e);default:throw new Error(`Unable to createMaterialKey for unknown geometryType ${t}`)}}function F(t){switch(_.load(t).geometryType){case s.MARKER:return new U(t);case s.FILL:return new x(t);case s.LINE:return new B(t);case s.TEXT:return new R(t);case s.LABEL:return new b(t)}}class _{constructor(t){this._data=0,this._data=t}static load(t){const e=this.shared;return e.data=t,e}set data(t){this._data=t}get data(){return this._data}get geometryType(){return this.bits(l,h)}set geometryType(t){this.setBits(t,l,h)}get mapAligned(){return!!this.bit(E)}set mapAligned(t){this.setBit(E,t)}get sdf(){return!!this.bit(S)}set sdf(t){this.setBit(S,t)}get pattern(){return!!this.bit(u)}set pattern(t){this.setBit(u,t)}get textureBinding(){return this.bits(n,v)}set textureBinding(t){this.setBits(t,n,v)}get geometryTypeString(){switch(this.geometryType){case s.FILL:return"fill";case s.MARKER:return"marker";case s.LINE:return"line";case s.TEXT:return"text";case s.LABEL:return"label";default:throw new t(`Unable to handle unknown geometryType: ${this.geometryType}`)}}setBit(t,e){const i=1<<t;e?this._data|=i:this._data&=~i}bit(t){return(this._data&1<<t)>>t}setBits(t,e,i){for(let s=e,a=0;s<i;s++,a++)this.setBit(s,0!=(t&1<<a))}bits(t,e){let i=0;for(let s=t,a=0;s<e;s++,a++)i|=this.bit(s)<<a;return i}hasVV(){return!1}setVV(t,e){}getVariation(){return{mapAligned:this.mapAligned,pattern:this.pattern,sdf:this.sdf}}getVariationHash(){return this._data&~(o&this.textureBinding)}}_.shared=new _(0);const I=t=>class extends t{get vvSizeMinMaxValue(){return 0!==this.bit(g)}set vvSizeMinMaxValue(t){this.setBit(g,t)}get vvSizeScaleStops(){return 0!==this.bit(z)}set vvSizeScaleStops(t){this.setBit(z,t)}get vvSizeFieldStops(){return 0!==this.bit(m)}set vvSizeFieldStops(t){this.setBit(m,t)}get vvSizeUnitValue(){return 0!==this.bit(y)}set vvSizeUnitValue(t){this.setBit(y,t)}hasVV(){return super.hasVV()||this.vvSizeMinMaxValue||this.vvSizeScaleStops||this.vvSizeFieldStops||this.vvSizeUnitValue}setVV(t,i){super.setVV(t,i);const s=r(t,i)&t;this.vvSizeMinMaxValue=!!(s&e.SIZE_MINMAX_VALUE),this.vvSizeFieldStops=!!(s&e.SIZE_FIELD_STOPS),this.vvSizeUnitValue=!!(s&e.SIZE_UNIT_VALUE),this.vvSizeScaleStops=!!(s&e.SIZE_SCALE_STOPS)}},O=t=>class extends t{get vvRotation(){return 0!==this.bit(c)}set vvRotation(t){this.setBit(c,t)}hasVV(){return super.hasVV()||this.vvRotation}setVV(t,i){super.setVV(t,i),this.vvRotation=!i.isOutline&&!!(t&e.ROTATION)}},A=t=>class extends t{get vvColor(){return 0!==this.bit(d)}set vvColor(t){this.setBit(d,t)}hasVV(){return super.hasVV()||this.vvColor}setVV(t,i){super.setVV(t,i),this.vvColor=!i.isOutline&&!!(t&e.COLOR)}},f=t=>class extends t{get vvOpacity(){return 0!==this.bit(V)}set vvOpacity(t){this.setBit(V,t)}hasVV(){return super.hasVV()||this.vvOpacity}setVV(t,i){super.setVV(t,i),this.vvOpacity=!i.isOutline&&!!(t&e.OPACITY)}};class x extends(A(f(I(_)))){static load(t){const e=this.shared;return e.data=t,e}static from(t){const e=this.load(0);return e.geometryType=s.FILL,e.dotDensity="dot-density"===t.stride.fill,e.simple="simple"===t.stride.fill,e.outlinedFill=t.isOutlinedFill,e.dotDensity||e.setVV(t.vvFlags,t),e.data}getVariation(){return{...super.getVariation(),dotDensity:this.dotDensity,outlinedFill:this.outlinedFill,simple:this.simple,vvColor:this.vvColor,vvOpacity:this.vvOpacity,vvSizeFieldStops:this.vvSizeFieldStops,vvSizeMinMaxValue:this.vvSizeMinMaxValue,vvSizeScaleStops:this.vvSizeScaleStops,vvSizeUnitValue:this.vvSizeUnitValue}}get dotDensity(){return!!this.bit(p)}set dotDensity(t){this.setBit(p,t)}get simple(){return!!this.bit(M)}set simple(t){this.setBit(M,t)}get outlinedFill(){return!!this.bit(T)}set outlinedFill(t){this.setBit(T,t)}}x.shared=new x(0);class U extends(A(f(O(I(_))))){static load(t){const e=this.shared;return e.data=t,e}static from(t){const e=this.load(0);return e.geometryType=s.MARKER,e.setVV(t.vvFlags,t),e.data}getVariation(){return{...super.getVariation(),vvColor:this.vvColor,vvRotation:this.vvRotation,vvOpacity:this.vvOpacity,vvSizeFieldStops:this.vvSizeFieldStops,vvSizeMinMaxValue:this.vvSizeMinMaxValue,vvSizeScaleStops:this.vvSizeScaleStops,vvSizeUnitValue:this.vvSizeUnitValue}}}U.shared=new U(0);class B extends(A(f(I(_)))){static load(t){const e=this.shared;return e.data=t,e}static from(t){const e=this.load(0);return e.geometryType=s.LINE,e.setVV(t.vvFlags,t),e.data}getVariation(){return{...super.getVariation(),vvColor:this.vvColor,vvOpacity:this.vvOpacity,vvSizeFieldStops:this.vvSizeFieldStops,vvSizeMinMaxValue:this.vvSizeMinMaxValue,vvSizeScaleStops:this.vvSizeScaleStops,vvSizeUnitValue:this.vvSizeUnitValue}}}B.shared=new B(0);class R extends(A(f(O(I(_))))){static load(t){const e=this.shared;return e.data=t,e}static from(t){const e=this.load(0);return e.geometryType=s.TEXT,e.setVV(t.vvFlags,t),e.data}getVariation(){return{...super.getVariation(),vvColor:this.vvColor,vvOpacity:this.vvOpacity,vvRotation:this.vvRotation,vvSizeFieldStops:this.vvSizeFieldStops,vvSizeMinMaxValue:this.vvSizeMinMaxValue,vvSizeScaleStops:this.vvSizeScaleStops,vvSizeUnitValue:this.vvSizeUnitValue}}}R.shared=new R(0);class b extends(I(_)){static load(t){const e=this.shared;return e.data=t,e}static from(t){const e=this.load(0);return e.geometryType=s.LABEL,e.setVV(t.vvFlags,t),e.mapAligned=a(t.placement),e.data}getVariation(){return{...super.getVariation(),vvSizeFieldStops:this.vvSizeFieldStops,vvSizeMinMaxValue:this.vvSizeMinMaxValue,vvSizeScaleStops:this.vvSizeScaleStops,vvSizeUnitValue:this.vvSizeUnitValue}}}b.shared=new b(0);export{x as FillMaterialKey,b as LabelMaterialKey,B as LineMaterialKey,U as MarkerMaterialKey,_ as MaterialKeyBase,R as TextMaterialKey,L as createMaterialKey,r as getSizeFlagsMask,F as hydrateMaterialKey};
5
+ import t from"../../../../../core/Error.js";import{isMapAligned as e}from"../alignmentUtils.js";import{WGLVVFlag as i,WGLVVTarget as s,WGLGeometryType as a}from"../enums.js";function r(t,e){const a=i.SIZE_FIELD_STOPS|i.SIZE_MINMAX_VALUE|i.SIZE_SCALE_STOPS|i.SIZE_UNIT_VALUE,r=(t&(s.FIELD_TARGETS_OUTLINE|s.MINMAX_TARGETS_OUTLINE|s.SCALE_TARGETS_OUTLINE|s.UNIT_TARGETS_OUTLINE))>>>4;return e.isOutline||e.isOutlinedFill?a&r:a&~r}const n=0,v=8,o=7,l=8,h=11,S=11,u=12,d=13,V=14,c=15,p=15,g=16,z=17,y=18,m=19,E=20,T=21,M=22;function L(t,e){switch(t){case a.FILL:return x.from(e);case a.LINE:return B.from(e);case a.MARKER:return U.from(e);case a.TEXT:return R.from(e);case a.LABEL:return b.from(e);default:throw new Error(`Unable to createMaterialKey for unknown geometryType ${t}`)}}function F(t){switch(_.load(t).geometryType){case a.MARKER:return new U(t);case a.FILL:return new x(t);case a.LINE:return new B(t);case a.TEXT:return new R(t);case a.LABEL:return new b(t)}}class _{constructor(t){this._data=0,this._data=t}static load(t){const e=this.shared;return e.data=t,e}set data(t){this._data=t}get data(){return this._data}get geometryType(){return this.bits(l,h)}set geometryType(t){this.setBits(t,l,h)}get mapAligned(){return!!this.bit(E)}set mapAligned(t){this.setBit(E,t)}get sdf(){return!!this.bit(S)}set sdf(t){this.setBit(S,t)}get pattern(){return!!this.bit(u)}set pattern(t){this.setBit(u,t)}get textureBinding(){return this.bits(n,v)}set textureBinding(t){this.setBits(t,n,v)}get geometryTypeString(){switch(this.geometryType){case a.FILL:return"fill";case a.MARKER:return"marker";case a.LINE:return"line";case a.TEXT:return"text";case a.LABEL:return"label";default:throw new t(`Unable to handle unknown geometryType: ${this.geometryType}`)}}setBit(t,e){const i=1<<t;e?this._data|=i:this._data&=~i}bit(t){return(this._data&1<<t)>>t}setBits(t,e,i){for(let s=e,a=0;s<i;s++,a++)this.setBit(s,0!=(t&1<<a))}bits(t,e){let i=0;for(let s=t,a=0;s<e;s++,a++)i|=this.bit(s)<<a;return i}hasVV(){return!1}setVV(t,e){}getVariation(){return{mapAligned:this.mapAligned,pattern:this.pattern,sdf:this.sdf}}getVariationHash(){return this._data&~(o&this.textureBinding)}}_.shared=new _(0);const I=t=>class extends t{get vvSizeMinMaxValue(){return 0!==this.bit(g)}set vvSizeMinMaxValue(t){this.setBit(g,t)}get vvSizeScaleStops(){return 0!==this.bit(z)}set vvSizeScaleStops(t){this.setBit(z,t)}get vvSizeFieldStops(){return 0!==this.bit(y)}set vvSizeFieldStops(t){this.setBit(y,t)}get vvSizeUnitValue(){return 0!==this.bit(m)}set vvSizeUnitValue(t){this.setBit(m,t)}hasVV(){return super.hasVV()||this.vvSizeMinMaxValue||this.vvSizeScaleStops||this.vvSizeFieldStops||this.vvSizeUnitValue}setVV(t,e){super.setVV(t,e);const s=r(t,e)&t;this.vvSizeMinMaxValue=!!(s&i.SIZE_MINMAX_VALUE),this.vvSizeFieldStops=!!(s&i.SIZE_FIELD_STOPS),this.vvSizeUnitValue=!!(s&i.SIZE_UNIT_VALUE),this.vvSizeScaleStops=!!(s&i.SIZE_SCALE_STOPS)}},O=t=>class extends t{get vvRotation(){return 0!==this.bit(c)}set vvRotation(t){this.setBit(c,t)}hasVV(){return super.hasVV()||this.vvRotation}setVV(t,e){super.setVV(t,e),this.vvRotation=!e.isOutline&&!!(t&i.ROTATION)}},A=t=>class extends t{get vvColor(){return 0!==this.bit(d)}set vvColor(t){this.setBit(d,t)}hasVV(){return super.hasVV()||this.vvColor}setVV(t,e){super.setVV(t,e),this.vvColor=!e.isOutline&&!!(t&i.COLOR)}},f=t=>class extends t{get vvOpacity(){return 0!==this.bit(V)}set vvOpacity(t){this.setBit(V,t)}hasVV(){return super.hasVV()||this.vvOpacity}setVV(t,e){super.setVV(t,e),this.vvOpacity=!e.isOutline&&!!(t&i.OPACITY)}};class x extends(A(f(I(_)))){static load(t){const e=this.shared;return e.data=t,e}static from(t){const e=this.load(0);return e.geometryType=a.FILL,e.dotDensity="dot-density"===t.stride.fill,e.simple="simple"===t.stride.fill,e.outlinedFill=t.isOutlinedFill,e.dotDensity||e.setVV(t.vvFlags,t),e.data}getVariation(){return{...super.getVariation(),dotDensity:this.dotDensity,outlinedFill:this.outlinedFill,simple:this.simple,vvColor:this.vvColor,vvOpacity:this.vvOpacity,vvSizeFieldStops:this.vvSizeFieldStops,vvSizeMinMaxValue:this.vvSizeMinMaxValue,vvSizeScaleStops:this.vvSizeScaleStops,vvSizeUnitValue:this.vvSizeUnitValue}}get dotDensity(){return!!this.bit(p)}set dotDensity(t){this.setBit(p,t)}get simple(){return!!this.bit(M)}set simple(t){this.setBit(M,t)}get outlinedFill(){return!!this.bit(T)}set outlinedFill(t){this.setBit(T,t)}}x.shared=new x(0);class U extends(A(f(O(I(_))))){static load(t){const e=this.shared;return e.data=t,e}static from(t){const e=this.load(0);return e.geometryType=a.MARKER,e.setVV(t.vvFlags,t),e.data}getVariation(){return{...super.getVariation(),vvColor:this.vvColor,vvRotation:this.vvRotation,vvOpacity:this.vvOpacity,vvSizeFieldStops:this.vvSizeFieldStops,vvSizeMinMaxValue:this.vvSizeMinMaxValue,vvSizeScaleStops:this.vvSizeScaleStops,vvSizeUnitValue:this.vvSizeUnitValue}}}U.shared=new U(0);class B extends(A(f(I(_)))){static load(t){const e=this.shared;return e.data=t,e}static from(t){const e=this.load(0);return e.geometryType=a.LINE,e.setVV(t.vvFlags,t),e.data}getVariation(){return{...super.getVariation(),vvColor:this.vvColor,vvOpacity:this.vvOpacity,vvSizeFieldStops:this.vvSizeFieldStops,vvSizeMinMaxValue:this.vvSizeMinMaxValue,vvSizeScaleStops:this.vvSizeScaleStops,vvSizeUnitValue:this.vvSizeUnitValue}}}B.shared=new B(0);class R extends(A(f(O(I(_))))){static load(t){const e=this.shared;return e.data=t,e}static from(t){const e=this.load(0);return e.geometryType=a.TEXT,e.setVV(t.vvFlags,t),e.data}getVariation(){return{...super.getVariation(),vvColor:this.vvColor,vvOpacity:this.vvOpacity,vvRotation:this.vvRotation,vvSizeFieldStops:this.vvSizeFieldStops,vvSizeMinMaxValue:this.vvSizeMinMaxValue,vvSizeScaleStops:this.vvSizeScaleStops,vvSizeUnitValue:this.vvSizeUnitValue}}}R.shared=new R(0);class b extends(I(_)){static load(t){const e=this.shared;return e.data=t,e}static from(t){const i=this.load(0);return i.geometryType=a.LABEL,i.setVV(t.vvFlags,t),i.mapAligned=e(t.placement),i.data}getVariation(){return{...super.getVariation(),vvSizeFieldStops:this.vvSizeFieldStops,vvSizeMinMaxValue:this.vvSizeMinMaxValue,vvSizeScaleStops:this.vvSizeScaleStops,vvSizeUnitValue:this.vvSizeUnitValue}}}b.shared=new b(0);export{x as FillMaterialKey,b as LabelMaterialKey,B as LineMaterialKey,U as MarkerMaterialKey,_ as MaterialKeyBase,R as TextMaterialKey,L as createMaterialKey,r as getSizeFlagsMask,F as hydrateMaterialKey};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../../../../core/Error.js";import t from"../../../../../../core/Logger.js";import{clamp as i}from"../../../../../../core/mathUtils.js";import{unwrap as o,isNone as n}from"../../../../../../core/maybe.js";import{pt2px as s}from"../../../../../../core/screenUtils.js";import{Alignment as r}from"../../../../../../symbols/cim/enums.js";import{getAlignmentFromPlacement as a,getXDirection as l,getYDirection as h}from"../../alignmentUtils.js";import{premultiplyAlphaRGBAArray as c}from"../../color.js";import{TEXT_PLACEMENT_PADDING as m}from"../../definitions.js";import{WGLGeometryType as f}from"../../enums.js";import{i8888to32 as _}from"../../number.js";import{LabelMaterialKey as p}from"../../materialKey/MaterialKey.js";import{isMapAligned as g}from"./meshUtils.js";import{smoothPaths as u,pathDivide as d}from"./segmentUtils.js";import x from"./WGLTextTemplate.js";const y=t.getLogger("esri.views.2d.engine.webgl.WGLLabelTemplate"),b=(t,i="mapview-labeling")=>y.error(new e(i,t)),L=1,P=0,S=4;function v(e,t){const o=!!e.minScale&&t.scaleToZoom(e.minScale)||0;return i(o,0,25.5)}function w(e,t){const o=!!e.maxScale&&t.scaleToZoom(e.maxScale)||255;return i(o,0,25.5)}function M(e){const t=new Map;return i=>(t.has(i)||t.set(i,e(i)),t.get(i))}const Z=M((e=>{let t=0;if(0===e)return 1/0;for(;!(e%2);)t++,e/=2;return t})),A=e=>Math.floor(127*e+127),O=e=>Math.floor(10*e),z=e=>Math.round(e*(254/360));class I extends x{constructor(e,t,i,o){var n,l,h;super(e,i.font.size,i.haloSize||0,i.font.size,i.color&&c(i.color)||0,i.haloColor&&c(i.haloColor)||0,i.horizontalAlignment,i.verticalAlignment,g(t.labelPlacement)?r.MAP:r.SCREEN,i.font.decoration,!1,i.angle||0,i.xoffset,i.yoffset,i.lineWidth,i.lineHeight,null,null,null,null,null),this._outLineLabelAngle=0,this._refPlacementPadding=0,this._refPlacementDirX=0,this._refPlacementDirY=0,this._refOffsetX=0,this._refOffsetY=0,this._zoomLevel=0,this.geometryType=f.LABEL,this._allowOverrun=null!=(n=t.allowOverrun)&&n,this._repeatLabel=null==(l=t.repeatLabel)||l,this._labelPosition=null!=(h=t.labelPosition)?h:"curved";const _=v(t,o),u=w(t,o),d=t.labelPlacement,[x,y]=a(d);this._xAlignD=x,this._yAlignD=y,this._minZoom=_,this._maxZoom=u,this._refPlacementPadding=s(i.haloSize)+m,this._repeatLabelDistance=t.repeatLabelDistance?s(t.repeatLabelDistance):128;const b=p.load(e);b.sdf=!0,this._materialKey=b.data}static fromLabelClass(e,t){if("esriServerLinePlacementCenterAlong"===e.labelPlacement){const t=e.symbol;t.xoffset=0,t.yoffset=0,t.angle=0,t.font.decoration="none"}return new I(e.materialKey,e,e.symbol,t)}get _shapedBox(){return o(this._shapingInfo).bounds}setZoomLevel(e){this._zoomLevel=e}bindReferenceTemplate(e){let t=l(this._xAlignD),i=h(this._yAlignD);if(this._refOffsetX=0,this._refOffsetY=0,n(e))return void(this._refSymbolAndPlacementOffset=_(0,0,A(t),A(i)));if("circle"===e.boundsType&&(t||i)){const e=Math.sqrt(t*t+i*i);t/=e,i/=e}const o=Math.max(e.height,e.width),s=this._refPlacementPadding*S;this._refSymbolAndPlacementOffset=_(s,o,A(t),A(i)),this._referenceSize=o,this._refPlacementDirX=t,this._refPlacementDirY=i,this._refOffsetX=e.xOffset,this._refOffsetY=e.yOffset}_write(e,t){if(n(this._shapingInfo))return;const i=this._shapingInfo,o=t.getDisplayId(),s="esriGeometryPolygon"===t.geometryType?t.readLegacyCentroid():t.readLegacyGeometry();if(s)switch(this.current={out:e,inId:o,inShaping:i,zoomLevel:this._zoomLevel},t.geometryType){case"esriGeometryPolyline":this._placeLineLabels(s);break;case"esriGeometryPoint":case"esriGeometryPolygon":this._placePointLabels(s);break;default:b("mapview-labeling",`Geometry of type ${t.geometryType} is not supported`)}}_isVisible(e,t){const i=O(this.current.zoomLevel);return O(e)<=i&&i<=O(t)}_placePointLabels(e){const{out:t,inId:i,inShaping:o}=this.current;this._writeGlyphs(t,i,e,o)}_placeLineLabels(e){const t=u(e.paths,this.current.inShaping.bounds.width),i=this._placeSubdivGlyphs.bind(this),o=(this._shapedBox.width+this._repeatLabelDistance)/(1<<L);for(const n of t)d(n,o,i,this._repeatLabel)}_placeSubdivGlyphs(e,t,i,o){const n=Z(t),s=this._shapedBox.width/(1<<L),r=Math.sqrt(this._repeatLabelDistance)/(1<<L),a=Math.min(i,o-i),l=Math.log2(a/(r+s/2)),h=0===t?l:Math.min(n,l),c=Math.max(this._minZoom,this.current.zoomLevel+L-h),m=this.current.zoomLevel-c,f=this._shapedBox.width/2*2**m;this.current.inShaping.isMultiline?0===t&&this._placeStraight(e,c):this._allowOverrun&&m<0?this._placeStraightAlong(e,this._minZoom):"parallel"===this._labelPosition?this._placeStraightAlong(e,c):"curved"===this._labelPosition&&this._placeCurved(e,c,f)}_placeStraight(e,t){const{out:i,inId:o,inShaping:n}=this.current;this._writeGlyphs(i,o,e,n,t)}_placeCurved(e,t,i){const{out:o,inId:n}=this.current;o.metricStart(n,t,e.x,e.y,0,0,0,0);const s=e.clone(),r=e.angle*(180/Math.PI)%360,a=(e.angle*(180/Math.PI)+180)%360;this._outLineLabelAngle=z(r),this._placeFirst(s,t,1),this._placeBack(e,s,t,i,1),this._placeForward(e,s,t,i,1),this._outLineLabelAngle=z(a),this._placeFirst(s,t,0),this._placeBack(e,s,t,i,0),this._placeForward(e,s,t,i,0),o.metricEnd()}_placeStraightAlong(e,t){const{out:i,inId:o}=this.current;i.metricStart(o,t,e.x,e.y,0,0,0,0);const n=e.clone(),s=e.angle*(180/Math.PI)%360,r=(e.angle*(180/Math.PI)+180)%360;this._outLineLabelAngle=z(s),this._placeFirst(n,t,1,!0),this._outLineLabelAngle=z(r),this._placeFirst(n,t,0,!0),i.metricEnd()}_placeBack(e,t,i,o,n){const s=e.clone();let r=e.backwardLength+P;for(;s.prev()&&!(r>=o);)this._placeOnSegment(s,t,r,i,-1,n),r+=s.length+P}_placeForward(e,t,i,o,n){const s=e.clone();let r=e.remainingLength+P;for(;s.next()&&!(r>=o);)this._placeOnSegment(s,t,r,i,1,n),r+=s.length+P}_placeFirst(e,t,i,o=!1){const n=e,s=this.current.inShaping,r=s.glyphs,a=this.current.zoomLevel,{out:l,inId:h}=this.current;for(const c of r){const r=c.x>s.bounds.x?i:1-i,m=r*e.remainingLength+(1-r)*e.backwardLength,f=Math.abs(c.x+c.width/2-s.bounds.x),_=Math.max(0,a+Math.log2(f/(m+P))),p=Math.max(t,o?0:_);if(c.maxZoom=25,c.angle=e.angle+(1-i)*Math.PI,c.minZoom=p,this._writeGlyph(l,h,n.x,n.y,c),i&&this._isVisible(c.minZoom,c.maxZoom)){const e=c.bounds;l.metricBoxWrite(e.center[0],e.center[1],e.width,e.height)}}}_placeOnSegment(e,t,i,o,n,s){const r=this.current.inShaping.glyphs,{out:a,inId:l}=this.current,h=this.current.inShaping,c=this.current.zoomLevel,m=e.dx/e.length,f=e.dy/e.length,_={x:e.x+i*-n*m,y:e.y+i*-n*f};for(const p of r){const r=p.x>h.bounds.x?s:1-s;if(!(r&&1===n||!r&&-1===n))continue;const m=Math.abs(p.x+p.width/2-h.bounds.x),f=Math.max(0,c+Math.log2(m/i)-.1),g=Math.max(o,c+Math.log2(m/(i+e.length+P)));if(0!==f&&(p.angle=e.angle+(1-s)*Math.PI,p.minZoom=g,p.maxZoom=f,this._writeGlyph(a,l,_.x,_.y,p),s&&this._isVisible(p.minZoom,p.maxZoom))){const i=p.bounds,o=e.x-t.x,n=e.y-t.y;a.metricBoxWrite(i.center[0]+o,i.center[1]+n,i.width,i.height)}}}_writeGlyphs(e,t,i,o,n=this._minZoom){if(i.x<0||i.x>=512||i.y<0||i.y>=512)return;const s=i.x+this._refOffsetX,r=i.y-this._refOffsetY;for(const c of o.glyphs)c.minZoom=n,c.maxZoom=this._maxZoom,this._writeGlyph(e,t,s,r,c);const a=this._refPlacementDirX,l=this._refPlacementDirY,h=o.boundsT;e.metricStart(t,n,s,r,a,l,this._referenceSize,this._materialKey),e.metricBoxWrite(h.center[0],h.center[1],h.width,h.height),e.metricEnd()}_writeVertexCommon(e,t,i,o){const n=this._color,s=this._haloColor,r=_(0,0,this._size,this._haloSize),a=Math.max(o.minZoom,this._minZoom),l=Math.min(o.maxZoom,this._maxZoom),h=_(O(a),O(l),this._outLineLabelAngle,0);e.vertexWrite(i),e.vertexWrite(t),e.vertexWrite(n),e.vertexWrite(s),e.vertexWrite(r),e.vertexWrite(this._refSymbolAndPlacementOffset),e.vertexWrite(h)}}export{I as default};
5
+ import e from"../../../../../../core/Error.js";import t from"../../../../../../core/Logger.js";import{clamp as i}from"../../../../../../core/mathUtils.js";import{unwrap as o,isNone as n}from"../../../../../../core/maybe.js";import{pt2px as s}from"../../../../../../core/screenUtils.js";import{Alignment as r}from"../../../../../../symbols/cim/enums.js";import{isMapAligned as a,getAlignmentFromPlacement as l,getXDirection as h,getYDirection as c}from"../../alignmentUtils.js";import{premultiplyAlphaRGBAArray as m}from"../../color.js";import{TEXT_PLACEMENT_PADDING as f}from"../../definitions.js";import{WGLGeometryType as _}from"../../enums.js";import{i8888to32 as p}from"../../number.js";import{LabelMaterialKey as g}from"../../materialKey/MaterialKey.js";import{smoothPaths as u,pathDivide as d}from"./segmentUtils.js";import x from"./WGLTextTemplate.js";const y=t.getLogger("esri.views.2d.engine.webgl.WGLLabelTemplate"),b=(t,i="mapview-labeling")=>y.error(new e(i,t)),L=1,P=0,S=4;function v(e,t){const o=!!e.minScale&&t.scaleToZoom(e.minScale)||0;return i(o,0,25.5)}function w(e,t){const o=!!e.maxScale&&t.scaleToZoom(e.maxScale)||255;return i(o,0,25.5)}function M(e){const t=new Map;return i=>(t.has(i)||t.set(i,e(i)),t.get(i))}const Z=M((e=>{let t=0;if(0===e)return 1/0;for(;!(e%2);)t++,e/=2;return t})),A=e=>Math.floor(127*e+127),O=e=>Math.floor(10*e),z=e=>Math.round(e*(254/360));class I extends x{constructor(e,t,i,o){var n,h,c;super(e,i.font.size,i.haloSize||0,i.font.size,i.color&&m(i.color)||0,i.haloColor&&m(i.haloColor)||0,i.horizontalAlignment,i.verticalAlignment,a(t.labelPlacement)?r.MAP:r.SCREEN,i.font.decoration,!1,i.angle||0,i.xoffset,i.yoffset,i.lineWidth,i.lineHeight,null,null,null,null,null),this._outLineLabelAngle=0,this._refPlacementPadding=0,this._refPlacementDirX=0,this._refPlacementDirY=0,this._refOffsetX=0,this._refOffsetY=0,this._zoomLevel=0,this.geometryType=_.LABEL,this._allowOverrun=null!=(n=t.allowOverrun)&&n,this._repeatLabel=null==(h=t.repeatLabel)||h,this._labelPosition=null!=(c=t.labelPosition)?c:"curved";const p=v(t,o),u=w(t,o),d=t.labelPlacement,[x,y]=l(d);this._xAlignD=x,this._yAlignD=y,this._minZoom=p,this._maxZoom=u,this._refPlacementPadding=s(i.haloSize)+f,this._repeatLabelDistance=t.repeatLabelDistance?s(t.repeatLabelDistance):128;const b=g.load(e);b.sdf=!0,this._materialKey=b.data}static fromLabelClass(e,t){if("esriServerLinePlacementCenterAlong"===e.labelPlacement){const t=e.symbol;t.xoffset=0,t.yoffset=0,t.angle=0,t.font.decoration="none"}return new I(e.materialKey,e,e.symbol,t)}get _shapedBox(){return o(this._shapingInfo).bounds}setZoomLevel(e){this._zoomLevel=e}bindReferenceTemplate(e){let t=h(this._xAlignD),i=c(this._yAlignD);if(this._refOffsetX=0,this._refOffsetY=0,n(e))return void(this._refSymbolAndPlacementOffset=p(0,0,A(t),A(i)));if("circle"===e.boundsType&&(t||i)){const e=Math.sqrt(t*t+i*i);t/=e,i/=e}const o=Math.max(e.height,e.width),s=this._refPlacementPadding*S;this._refSymbolAndPlacementOffset=p(s,o,A(t),A(i)),this._referenceSize=o,this._refPlacementDirX=t,this._refPlacementDirY=i,this._refOffsetX=e.xOffset,this._refOffsetY=e.yOffset}_write(e,t){if(n(this._shapingInfo))return;const i=this._shapingInfo,o=t.getDisplayId(),s="esriGeometryPolygon"===t.geometryType?t.readLegacyCentroid():t.readLegacyGeometry();if(s)switch(this.current={out:e,inId:o,inShaping:i,zoomLevel:this._zoomLevel},t.geometryType){case"esriGeometryPolyline":this._placeLineLabels(s);break;case"esriGeometryPoint":case"esriGeometryPolygon":this._placePointLabels(s);break;default:b("mapview-labeling",`Geometry of type ${t.geometryType} is not supported`)}}_isVisible(e,t){const i=O(this.current.zoomLevel);return O(e)<=i&&i<=O(t)}_placePointLabels(e){const{out:t,inId:i,inShaping:o}=this.current;this._writeGlyphs(t,i,e,o)}_placeLineLabels(e){const t=u(e.paths,this.current.inShaping.bounds.width),i=this._placeSubdivGlyphs.bind(this),o=(this._shapedBox.width+this._repeatLabelDistance)/(1<<L);for(const n of t)d(n,o,i,this._repeatLabel)}_placeSubdivGlyphs(e,t,i,o){const n=Z(t),s=this._shapedBox.width/(1<<L),r=Math.sqrt(this._repeatLabelDistance)/(1<<L),a=Math.min(i,o-i),l=Math.log2(a/(r+s/2)),h=0===t?l:Math.min(n,l),c=Math.max(this._minZoom,this.current.zoomLevel+L-h),m=this.current.zoomLevel-c,f=this._shapedBox.width/2*2**m;this.current.inShaping.isMultiline?0===t&&this._placeStraight(e,c):this._allowOverrun&&m<0?this._placeStraightAlong(e,this._minZoom):"parallel"===this._labelPosition?this._placeStraightAlong(e,c):"curved"===this._labelPosition&&this._placeCurved(e,c,f)}_placeStraight(e,t){const{out:i,inId:o,inShaping:n}=this.current;this._writeGlyphs(i,o,e,n,t)}_placeCurved(e,t,i){const{out:o,inId:n}=this.current;o.metricStart(n,t,e.x,e.y,0,0,0,0);const s=e.clone(),r=e.angle*(180/Math.PI)%360,a=(e.angle*(180/Math.PI)+180)%360;this._outLineLabelAngle=z(r),this._placeFirst(s,t,1),this._placeBack(e,s,t,i,1),this._placeForward(e,s,t,i,1),this._outLineLabelAngle=z(a),this._placeFirst(s,t,0),this._placeBack(e,s,t,i,0),this._placeForward(e,s,t,i,0),o.metricEnd()}_placeStraightAlong(e,t){const{out:i,inId:o}=this.current;i.metricStart(o,t,e.x,e.y,0,0,0,0);const n=e.clone(),s=e.angle*(180/Math.PI)%360,r=(e.angle*(180/Math.PI)+180)%360;this._outLineLabelAngle=z(s),this._placeFirst(n,t,1,!0),this._outLineLabelAngle=z(r),this._placeFirst(n,t,0,!0),i.metricEnd()}_placeBack(e,t,i,o,n){const s=e.clone();let r=e.backwardLength+P;for(;s.prev()&&!(r>=o);)this._placeOnSegment(s,t,r,i,-1,n),r+=s.length+P}_placeForward(e,t,i,o,n){const s=e.clone();let r=e.remainingLength+P;for(;s.next()&&!(r>=o);)this._placeOnSegment(s,t,r,i,1,n),r+=s.length+P}_placeFirst(e,t,i,o=!1){const n=e,s=this.current.inShaping,r=s.glyphs,a=this.current.zoomLevel,{out:l,inId:h}=this.current;for(const c of r){const r=c.x>s.bounds.x?i:1-i,m=r*e.remainingLength+(1-r)*e.backwardLength,f=Math.abs(c.x+c.width/2-s.bounds.x),_=Math.max(0,a+Math.log2(f/(m+P))),p=Math.max(t,o?0:_);if(c.maxZoom=25,c.angle=e.angle+(1-i)*Math.PI,c.minZoom=p,this._writeGlyph(l,h,n.x,n.y,c),i&&this._isVisible(c.minZoom,c.maxZoom)){const e=c.bounds;l.metricBoxWrite(e.center[0],e.center[1],e.width,e.height)}}}_placeOnSegment(e,t,i,o,n,s){const r=this.current.inShaping.glyphs,{out:a,inId:l}=this.current,h=this.current.inShaping,c=this.current.zoomLevel,m=e.dx/e.length,f=e.dy/e.length,_={x:e.x+i*-n*m,y:e.y+i*-n*f};for(const p of r){const r=p.x>h.bounds.x?s:1-s;if(!(r&&1===n||!r&&-1===n))continue;const m=Math.abs(p.x+p.width/2-h.bounds.x),f=Math.max(0,c+Math.log2(m/i)-.1),g=Math.max(o,c+Math.log2(m/(i+e.length+P)));if(0!==f&&(p.angle=e.angle+(1-s)*Math.PI,p.minZoom=g,p.maxZoom=f,this._writeGlyph(a,l,_.x,_.y,p),s&&this._isVisible(p.minZoom,p.maxZoom))){const i=p.bounds,o=e.x-t.x,n=e.y-t.y;a.metricBoxWrite(i.center[0]+o,i.center[1]+n,i.width,i.height)}}}_writeGlyphs(e,t,i,o,n=this._minZoom){if(i.x<0||i.x>=512||i.y<0||i.y>=512)return;const s=i.x+this._refOffsetX,r=i.y-this._refOffsetY;for(const c of o.glyphs)c.minZoom=n,c.maxZoom=this._maxZoom,this._writeGlyph(e,t,s,r,c);const a=this._refPlacementDirX,l=this._refPlacementDirY,h=o.boundsT;e.metricStart(t,n,s,r,a,l,this._referenceSize,this._materialKey),e.metricBoxWrite(h.center[0],h.center[1],h.width,h.height),e.metricEnd()}_writeVertexCommon(e,t,i,o){const n=this._color,s=this._haloColor,r=p(0,0,this._size,this._haloSize),a=Math.max(o.minZoom,this._minZoom),l=Math.min(o.maxZoom,this._maxZoom),h=p(O(a),O(l),this._outLineLabelAngle,0);e.vertexWrite(i),e.vertexWrite(t),e.vertexWrite(n),e.vertexWrite(s),e.vertexWrite(r),e.vertexWrite(this._refSymbolAndPlacementOffset),e.vertexWrite(h)}}export{I as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
4
  */
5
- import{resolveIncludes as e}from"./sources/resolver.js";const r=e=>e.replace("-","_").toUpperCase(),a=e=>`#define ${r(e)}\n`,t={attributes:new Map([["a_pos",0],["a_tex",1]]),shaders:r=>({vertexShader:a(r)+e("blend/blend.vert"),fragmentShader:a(r)+e("blend/blend.frag")})};export{t as blend};
5
+ import{resolveIncludes as e}from"./sources/resolver.js";const r=e=>e.replace("-","_").toUpperCase(),t=e=>`#define ${r(e)}\n`;function n(r){return{attributes:new Map([["a_pos",0],["a_tex",1]]),shaders:{vertexShader:t(r)+e("blend/blend.vert"),fragmentShader:t(r)+e("blend/blend.frag")}}}export{n as createProgramTemplate};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
4
  */
5
- import{resolveIncludes as r}from"./sources/resolver.js";import{glslifyDefineMap as t}from"../../../../webgl/programUtils.js";const e=r=>{let t="";t+=r[0].toUpperCase();for(let e=1;e<r.length;e++){const s=r[e];s===s.toUpperCase()?(t+="_",t+=s):t+=s.toUpperCase()}return t},s=r=>{const s={};for(const t in r){s[e(t)]=r[t]}return t(s)},o=(t,e,o)=>{const n=t+t.substring(t.lastIndexOf("/")),a=e+e.substring(e.lastIndexOf("/"));return{attributes:o,shaders:t=>({vertexShader:s(t)+r(`${n}.vert`),fragmentShader:s(t)+r(`${a}.frag`)})}};export{o as createProgramTemplate};
5
+ import{resolveIncludes as r}from"./sources/resolver.js";import{glslifyDefineMap as t}from"../../../../webgl/programUtils.js";const e=r=>{let t="";t+=r[0].toUpperCase();for(let e=1;e<r.length;e++){const s=r[e];s===s.toUpperCase()?(t+="_",t+=s):t+=s.toUpperCase()}return t},s=r=>{const s={};for(const t in r){s[e(t)]=r[t]}return t(s)},o=(t,e,o,n)=>{const a=t+t.substring(t.lastIndexOf("/")),p=e+e.substring(e.lastIndexOf("/"));return{attributes:o,shaders:{vertexShader:s(n)+r(`${a}.vert`),fragmentShader:s(n)+r(`${p}.frag`)}}};export{o as createProgramTemplate};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import{property as t}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as s}from"../../../core/accessorSupport/decorators/subclass.js";import{create as o}from"../../../geometry/support/aaBoundingRect.js";import"../tiling/PagedTileQueue.js";import r from"../tiling/TileInfoView.js";import"../tiling/TileKey.js";import"../tiling/TileQueue.js";import"../tiling/TileStrategy.js";import{LayerView2DMixin as i}from"./LayerView2D.js";import{Display as l}from"./support/Display.js";import n from"../../layers/LayerView.js";import{RefreshableLayerView as a}from"../../layers/RefreshableLayerView.js";const p=new Set,c=[],h=[];class u{constructor(e,t,s,r,i,l,n,a=[0,0],p=o()){this.id=e,this.level=t,this.row=s,this.col=r,this.world=i,this.resolution=l,this.scale=n,this.coords=a,this.bounds=p}}let d=class extends(a(i(n))){constructor(e){super(e),this._tileMap=new Map,this.container=new l(this),this.layer=null,this.tiles=[]}get _tileInfoView(){const e=this.layer&&this.layer.tileInfo;return e?new r(e):null}attach(){}detach(){}requestRender(){this.container.requestRender()}tilesChanged(e,t){}async doRefresh(){}isUpdating(){return!1}update(e){const t=this._tileInfoView,s=this.tiles;if(t){const o=t.getTileCoverage(e.state,0),{spans:r,lodInfo:i}=o,{level:l}=i;if(r.length)for(const{row:e,colFrom:t,colTo:n}of r)for(let o=t;o<=n;o++){const t=i.normalizeCol(o),r=i.getWorldForColumn(o),n=`${l}/${e}/${t}/${r}`;if(!this._tileMap.has(n)){const o=new u(n,l,e,t,r,i.resolution,i.scale);i.getTileCoords(o.coords,o,!1),i.getTileBounds(o.bounds,o,!0),this._tileMap.set(n,o),s.push(o),c.push(o)}p.add(n)}}for(let o=s.length-1;o>=0;o--){const e=s[o];p.has(e.id)||(s.splice(o,1),h.push(e),this._tileMap.delete(e.id))}(c.length||h.length)&&(this.tilesChanged(c,h),c.length=h.length=0),p.clear(),this.requestRender()}moveStart(){}viewChange(){this.requestUpdate()}moveEnd(){}};e([t()],d.prototype,"_tileInfoView",null),e([t()],d.prototype,"layer",void 0),d=e([s("esri.views.2d.layers.BaseLayerView2D")],d);const m=d;export{m as default};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import{property as t}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as s}from"../../../core/accessorSupport/decorators/subclass.js";import{create as o}from"../../../geometry/support/aaBoundingRect.js";import"../tiling/PagedTileQueue.js";import r from"../tiling/TileInfoView.js";import"../tiling/TileKey.js";import"../tiling/TileQueue.js";import"../tiling/TileStrategy.js";import{LayerView2DMixin as i}from"./LayerView2D.js";import{Display as l}from"./support/Display.js";import n from"../../layers/LayerView.js";import{RefreshableLayerView as a}from"../../layers/RefreshableLayerView.js";const p=new Set,c=[],h=[];class u{constructor(e,t,s,r,i,l,n,a=[0,0],p=o()){this.id=e,this.level=t,this.row=s,this.col=r,this.world=i,this.resolution=l,this.scale=n,this.coords=a,this.bounds=p}}let d=class extends(a(i(n))){constructor(e){super(e),this._tileMap=new Map,this.container=new l(this),this.layer=null,this.tiles=[]}get _tileInfoView(){const e=this.layer&&this.layer.tileInfo;return e?new r(e):null}attach(){}detach(){}requestRender(){this.container.requestRender()}tilesChanged(e,t){}supportsSpatialReference(e){var t;const s=null==(t=this.layer)?void 0:t.tileInfo;if(s){const t=s.spatialReference;return e.equals(t)}return!0}async doRefresh(){}isUpdating(){return!1}update(e){const t=this._tileInfoView,s=this.tiles;if(t){const o=t.getTileCoverage(e.state,0),{spans:r,lodInfo:i}=o,{level:l}=i;if(r.length)for(const{row:e,colFrom:t,colTo:n}of r)for(let o=t;o<=n;o++){const t=i.normalizeCol(o),r=i.getWorldForColumn(o),n=`${l}/${e}/${t}/${r}`;if(!this._tileMap.has(n)){const o=new u(n,l,e,t,r,i.resolution,i.scale);i.getTileCoords(o.coords,o,!1),i.getTileBounds(o.bounds,o,!0),this._tileMap.set(n,o),s.push(o),c.push(o)}p.add(n)}}for(let o=s.length-1;o>=0;o--){const e=s[o];p.has(e.id)||(s.splice(o,1),h.push(e),this._tileMap.delete(e.id))}(c.length||h.length)&&(this.tilesChanged(c,h),c.length=h.length=0),p.clear(),this.requestRender()}moveStart(){}viewChange(){this.requestUpdate()}moveEnd(){}};e([t()],d.prototype,"_tileInfoView",null),e([t()],d.prototype,"layer",void 0),d=e([s("esri.views.2d.layers.BaseLayerView2D")],d);const m=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.23/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import{property as t}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as s}from"../../../core/accessorSupport/decorators/subclass.js";import{e as r}from"../../../chunks/earcut.js";import{create as o}from"../../../geometry/support/aaBoundingRect.js";import{closeRings as i}from"../../../geometry/support/coordsUtils.js";import{normalizeCentralMeridianSync as n}from"../../../geometry/support/normalizeUtilsSync.js";import{checkProjectionSupport as a,project as c}from"../../../layers/graphics/data/projectionSupport.js";import"../tiling/PagedTileQueue.js";import l from"../tiling/TileInfoView.js";import"../tiling/TileKey.js";import"../tiling/TileQueue.js";import"../tiling/TileStrategy.js";import{THIN_LINE_HALF_WIDTH_THRESHOLD as p}from"../engine/webgl/definitions.js";import{LineTessellation as h}from"../engine/webgl/TurboLine.js";import{LayerView2DMixin as f}from"./LayerView2D.js";import{DisplayGL as d}from"./support/DisplayGL.js";import{analyzeRings as u}from"./support/util.js";import m from"../../layers/LayerView.js";import{RefreshableLayerView as y}from"../../layers/RefreshableLayerView.js";const x=new Set,g=[],v=[];class T{constructor(e,t,s,r,i,n,a,c=[0,0],l=o()){this.id=e,this.level=t,this.row=s,this.col=r,this.world=i,this.resolution=n,this.scale=a,this.coords=c,this.bounds=l}}let w=class extends(y(f(m))){constructor(e){super(e),this._tileMap=new Map,this.container=new d(this),this.layer=null,this.tiles=[],this._renderTarget={framebuffer:null,viewport:[0,0,0,0]}}get _tileInfoView(){const e=this.layer&&this.layer.tileInfo;return e?new l(e):null}get context(){return this.view._stage.context.gl}attach(){}detach(){}requestRender(){this.container.requestRender()}tilesChanged(e,t){}async doRefresh(){}isUpdating(){return!1}update(e){const t=this._tileInfoView,s=this.tiles;if(t){const r=t.getTileCoverage(e.state,0),{spans:o,lodInfo:i}=r,{level:n}=i;if(o.length)for(const{row:e,colFrom:t,colTo:a}of o)for(let r=t;r<=a;r++){const t=i.normalizeCol(r),o=i.getWorldForColumn(r),a=`${n}/${e}/${t}/${o}`;if(!this._tileMap.has(a)){const r=new T(a,n,e,t,o,i.resolution,i.scale);i.getTileCoords(r.coords,r,!1),i.getTileBounds(r.bounds,r,!0),this._tileMap.set(a,r),s.push(r),g.push(r)}x.add(a)}}for(let r=s.length-1;r>=0;r--){const e=s[r];x.has(e.id)||(s.splice(r,1),v.push(e),this._tileMap.delete(e.id))}(g.length||v.length)&&(this.tilesChanged(g,v),g.length=v.length=0),x.clear(),this.requestRender()}moveStart(){}viewChange(){this.requestUpdate()}moveEnd(){}bindRenderTarget(){this.context.bindFramebuffer(this.context.FRAMEBUFFER,this._renderTarget.framebuffer),this.context.viewport(this._renderTarget.viewport[0],this._renderTarget.viewport[1],this._renderTarget.viewport[2],this._renderTarget.viewport[3])}getRenderTarget(){return this._renderTarget}async tessellateExtent(e){const t={vertices:[],indices:[]},s=await this._projectAndNormalizeGeometry(e),r=t.vertices.length;return t.vertices.push({x:s.xmin,y:s.ymin,xOffset:0,yOffset:0,uTexcoord:0,vTexcoord:0,distance:0}),t.vertices.push({x:s.xmax,y:s.ymin,xOffset:0,yOffset:0,uTexcoord:1,vTexcoord:0,distance:0}),t.vertices.push({x:s.xmin,y:s.ymax,xOffset:0,yOffset:0,uTexcoord:0,vTexcoord:1,distance:0}),t.vertices.push({x:s.xmax,y:s.ymax,xOffset:0,yOffset:0,uTexcoord:1,vTexcoord:1,distance:0}),t.indices.push(r+0,r+1,r+2,r+1,r+3,r+2),t}async tessellatePoint(e,t){const s=await this._projectAndNormalizeGeometry(e);return this._tessellatePoints([s],t)}async tessellateMultipoint(e,t){const s=await this._projectAndNormalizeGeometry(e),r=s.points.map((e=>({x:e[0],y:e[1],spatialReference:s.spatialReference})));return this._tessellatePoints(r,t)}async _tessellatePoints(e,t){const s={vertices:[],indices:[]};for(const r of e){const e=s.vertices.length;s.vertices.push({x:r.x,y:r.y,xOffset:t.x,yOffset:t.y+t.height,uTexcoord:0,vTexcoord:0,distance:0}),s.vertices.push({x:r.x,y:r.y,xOffset:t.x+t.width,yOffset:t.y+t.height,uTexcoord:1,vTexcoord:0,distance:0}),s.vertices.push({x:r.x,y:r.y,xOffset:t.x,yOffset:t.y,uTexcoord:0,vTexcoord:1,distance:0}),s.vertices.push({x:r.x,y:r.y,xOffset:t.x+t.width,yOffset:t.y,uTexcoord:1,vTexcoord:1,distance:0}),s.indices.push(e+0,e+1,e+2,e+1,e+3,e+2)}return s}async tessellatePolyline(e,t){const s={vertices:[],indices:[]},r=(await this._projectAndNormalizeGeometry(e)).paths;if(!r||!r.length)return s;let o;const i=new h(((e,r,i,n,a,c,l,p,h,f,d)=>{const u=s.vertices.length;return s.vertices.push({x:e,y:-r,xOffset:l*t/2,yOffset:p*t/2,uTexcoord:d/o,vTexcoord:(f+1)/2,distance:d}),u}),((e,t,r)=>{s.indices.push(e,t,r)}),!0);for(const n of r){o=0;for(let t=1;t<n.length;++t){const e=n[t][0]-n[t-1][0],s=n[t][1]-n[t-1][1];o+=Math.sqrt(e*e+s*s)}const e=n.map((e=>({x:e[0],y:-e[1]})));i.tessellate(e,j)}return s}async tessellatePolygon(e){const t={vertices:[],indices:[]},s=await this._projectAndNormalizeGeometry(e),r=s.rings;if(!r||!r.length)return t;i(s);for(const i of s.rings)for(const e of i)e[1]=-e[1];let o=1/0,n=1/0,a=-1/0,c=-1/0;return u(s.rings,(()=>{}),((e,t,s)=>{for(let r=e;r<t;r+=2)o=Math.min(o,s[r]),n=Math.min(n,s[r+1]),a=Math.max(a,s[r]),c=Math.max(c,s[r+1])})),u(s.rings,(()=>{}),((e,s,r,i)=>{this._invokeEarcut(t,e,s,r,i,[o,n,a,c])})),t}_invokeEarcut(e,t,s,o,i,n){const a=o.slice(t,s),c=r(a,i,2),l=e.vertices.length;for(let r=0;r<a.length;r+=2){const t=a[r],s=a[r+1];e.vertices.push({x:t,y:-s,xOffset:0,yOffset:0,uTexcoord:(t-n[0])/(n[2]-n[0]),vTexcoord:1-(s-n[1])/(n[3]-n[1]),distance:0})}for(let r=0;r<c.length;++r)e.indices.push(l+c[r])}async _projectAndNormalizeGeometry(e){await a(e.spatialReference,this.view.spatialReference);const t=n(e);return c(t,e.spatialReference,this.view.spatialReference)}};e([t()],w.prototype,"_tileInfoView",null),e([t()],w.prototype,"layer",void 0),e([t()],w.prototype,"context",null),w=e([s("esri.views.2d.layers.BaseLayerViewGL2D")],w);const j={pixelCoordRatio:1,wrapDistance:1e11,halfWidth:p+1,initialDistance:0,textured:!0,offset:0},_=w;export{_ as default};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import{property as t}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as s}from"../../../core/accessorSupport/decorators/subclass.js";import{e as r}from"../../../chunks/earcut.js";import{create as o}from"../../../geometry/support/aaBoundingRect.js";import{closeRings as i}from"../../../geometry/support/coordsUtils.js";import{normalizeCentralMeridianSync as n}from"../../../geometry/support/normalizeUtilsSync.js";import{checkProjectionSupport as a,project as c}from"../../../layers/graphics/data/projectionSupport.js";import"../tiling/PagedTileQueue.js";import l from"../tiling/TileInfoView.js";import"../tiling/TileKey.js";import"../tiling/TileQueue.js";import"../tiling/TileStrategy.js";import{THIN_LINE_HALF_WIDTH_THRESHOLD as p}from"../engine/webgl/definitions.js";import{LineTessellation as f}from"../engine/webgl/TurboLine.js";import{LayerView2DMixin as h}from"./LayerView2D.js";import{DisplayGL as d}from"./support/DisplayGL.js";import{analyzeRings as u}from"./support/util.js";import m from"../../layers/LayerView.js";import{RefreshableLayerView as y}from"../../layers/RefreshableLayerView.js";const x=new Set,g=[],v=[];class T{constructor(e,t,s,r,i,n,a,c=[0,0],l=o()){this.id=e,this.level=t,this.row=s,this.col=r,this.world=i,this.resolution=n,this.scale=a,this.coords=c,this.bounds=l}}let w=class extends(y(h(m))){constructor(e){super(e),this._tileMap=new Map,this.container=new d(this),this.layer=null,this.tiles=[],this._renderTarget={framebuffer:null,viewport:[0,0,0,0]}}get _tileInfoView(){const e=this.layer&&this.layer.tileInfo;return e?new l(e):null}get context(){return this.view._stage.context.gl}attach(){}detach(){}requestRender(){this.container.requestRender()}tilesChanged(e,t){}supportsSpatialReference(e){var t;const s=null==(t=this.layer)?void 0:t.tileInfo;if(s){const t=s.spatialReference;return e.equals(t)}return!0}async doRefresh(){}isUpdating(){return!1}update(e){const t=this._tileInfoView,s=this.tiles;if(t){const r=t.getTileCoverage(e.state,0),{spans:o,lodInfo:i}=r,{level:n}=i;if(o.length)for(const{row:e,colFrom:t,colTo:a}of o)for(let r=t;r<=a;r++){const t=i.normalizeCol(r),o=i.getWorldForColumn(r),a=`${n}/${e}/${t}/${o}`;if(!this._tileMap.has(a)){const r=new T(a,n,e,t,o,i.resolution,i.scale);i.getTileCoords(r.coords,r,!1),i.getTileBounds(r.bounds,r,!0),this._tileMap.set(a,r),s.push(r),g.push(r)}x.add(a)}}for(let r=s.length-1;r>=0;r--){const e=s[r];x.has(e.id)||(s.splice(r,1),v.push(e),this._tileMap.delete(e.id))}(g.length||v.length)&&(this.tilesChanged(g,v),g.length=v.length=0),x.clear(),this.requestRender()}moveStart(){}viewChange(){this.requestUpdate()}moveEnd(){}bindRenderTarget(){this.context.bindFramebuffer(this.context.FRAMEBUFFER,this._renderTarget.framebuffer),this.context.viewport(this._renderTarget.viewport[0],this._renderTarget.viewport[1],this._renderTarget.viewport[2],this._renderTarget.viewport[3])}getRenderTarget(){return this._renderTarget}async tessellateExtent(e){const t={vertices:[],indices:[]},s=await this._projectAndNormalizeGeometry(e),r=t.vertices.length;return t.vertices.push({x:s.xmin,y:s.ymin,xOffset:0,yOffset:0,uTexcoord:0,vTexcoord:0,distance:0}),t.vertices.push({x:s.xmax,y:s.ymin,xOffset:0,yOffset:0,uTexcoord:1,vTexcoord:0,distance:0}),t.vertices.push({x:s.xmin,y:s.ymax,xOffset:0,yOffset:0,uTexcoord:0,vTexcoord:1,distance:0}),t.vertices.push({x:s.xmax,y:s.ymax,xOffset:0,yOffset:0,uTexcoord:1,vTexcoord:1,distance:0}),t.indices.push(r+0,r+1,r+2,r+1,r+3,r+2),t}async tessellatePoint(e,t){const s=await this._projectAndNormalizeGeometry(e);return this._tessellatePoints([s],t)}async tessellateMultipoint(e,t){const s=await this._projectAndNormalizeGeometry(e),r=s.points.map((e=>({x:e[0],y:e[1],spatialReference:s.spatialReference})));return this._tessellatePoints(r,t)}async _tessellatePoints(e,t){const s={vertices:[],indices:[]};for(const r of e){const e=s.vertices.length;s.vertices.push({x:r.x,y:r.y,xOffset:t.x,yOffset:t.y+t.height,uTexcoord:0,vTexcoord:0,distance:0}),s.vertices.push({x:r.x,y:r.y,xOffset:t.x+t.width,yOffset:t.y+t.height,uTexcoord:1,vTexcoord:0,distance:0}),s.vertices.push({x:r.x,y:r.y,xOffset:t.x,yOffset:t.y,uTexcoord:0,vTexcoord:1,distance:0}),s.vertices.push({x:r.x,y:r.y,xOffset:t.x+t.width,yOffset:t.y,uTexcoord:1,vTexcoord:1,distance:0}),s.indices.push(e+0,e+1,e+2,e+1,e+3,e+2)}return s}async tessellatePolyline(e,t){const s={vertices:[],indices:[]},r=(await this._projectAndNormalizeGeometry(e)).paths;if(!r||!r.length)return s;let o;const i=new f(((e,r,i,n,a,c,l,p,f,h,d)=>{const u=s.vertices.length;return s.vertices.push({x:e,y:-r,xOffset:l*t/2,yOffset:p*t/2,uTexcoord:d/o,vTexcoord:(h+1)/2,distance:d}),u}),((e,t,r)=>{s.indices.push(e,t,r)}),!0);for(const n of r){o=0;for(let t=1;t<n.length;++t){const e=n[t][0]-n[t-1][0],s=n[t][1]-n[t-1][1];o+=Math.sqrt(e*e+s*s)}const e=n.map((e=>({x:e[0],y:-e[1]})));i.tessellate(e,j)}return s}async tessellatePolygon(e){const t={vertices:[],indices:[]},s=await this._projectAndNormalizeGeometry(e),r=s.rings;if(!r||!r.length)return t;i(s);for(const i of s.rings)for(const e of i)e[1]=-e[1];let o=1/0,n=1/0,a=-1/0,c=-1/0;return u(s.rings,(()=>{}),((e,t,s)=>{for(let r=e;r<t;r+=2)o=Math.min(o,s[r]),n=Math.min(n,s[r+1]),a=Math.max(a,s[r]),c=Math.max(c,s[r+1])})),u(s.rings,(()=>{}),((e,s,r,i)=>{this._invokeEarcut(t,e,s,r,i,[o,n,a,c])})),t}_invokeEarcut(e,t,s,o,i,n){const a=o.slice(t,s),c=r(a,i,2),l=e.vertices.length;for(let r=0;r<a.length;r+=2){const t=a[r],s=a[r+1];e.vertices.push({x:t,y:-s,xOffset:0,yOffset:0,uTexcoord:(t-n[0])/(n[2]-n[0]),vTexcoord:1-(s-n[1])/(n[3]-n[1]),distance:0})}for(let r=0;r<c.length;++r)e.indices.push(l+c[r])}async _projectAndNormalizeGeometry(e){await a(e.spatialReference,this.view.spatialReference);const t=n(e);return c(t,e.spatialReference,this.view.spatialReference)}};e([t()],w.prototype,"_tileInfoView",null),e([t()],w.prototype,"layer",void 0),e([t()],w.prototype,"context",null),w=e([s("esri.views.2d.layers.BaseLayerViewGL2D")],w);const j={pixelCoordRatio:1,wrapDistance:1e11,halfWidth:p+1,initialDistance:0,textured:!0,offset:0},_=w;export{_ as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import i from"../../../Graphic.js";import r from"../../../core/Collection.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 t}from"../../../core/accessorSupport/decorators/subclass.js";import{LayerView2DMixin as a}from"./LayerView2D.js";import h from"./graphics/GraphicContainer.js";import p from"./graphics/GraphicsView2D.js";import o from"../../layers/LayerView.js";const c={remove(){},pause(){},resume(){}};let n=class extends(a(o)){initialize(){this.graphicsView=new p({requestUpdateCallback:()=>this.requestUpdate(),view:this.view,graphics:this.layer.graphics,container:new h(this.view.featuresTilingScheme)})}attach(){this.container.addChild(this.graphicsView.container),this.handles.add(this.layer.on("graphic-update",this.graphicsView.graphicUpdateHandler),"graphicslayerview2d")}detach(){this.container.removeAllChildren(),this.graphicsView.destroy(),this.handles.remove("graphicslayerview2d")}async hitTest(e){return this.graphicsView?this.graphicsView.hitTest(e):null}async fetchPopupFeatures(e){if(this.graphicsView)return this.graphicsView.hitTest(e).filter((e=>!!e.popupTemplate))}update(e){this.graphicsView.processUpdate(e)}moveStart(){}viewChange(){this.graphicsView.viewChange()}moveEnd(){}isUpdating(){return!this.graphicsView||this.graphicsView.updating}highlight(e){var s;let t;return"number"==typeof e?t=[e]:e instanceof i?t=[e.uid]:Array.isArray(e)&&e.length>0?t="number"==typeof e[0]?e:e.map((e=>e&&e.uid)):r.isCollection(e)&&e.length>0&&(t=e.map((e=>e&&e.uid)).toArray()),t=null==(s=t)?void 0:s.filter((e=>null!=e)),t.length?(this.graphicsView.addHighlight(t),{remove:()=>this.graphicsView.removeHighlight(t)}):c}queryGraphics(){return Promise.resolve(this.graphicsView.graphics)}};e([s()],n.prototype,"graphicsView",void 0),n=e([t("esri.views.2d.layers.GraphicsLayerView2D")],n);const l=n;export{l as default};
5
+ import{_ as i}from"../../../chunks/tslib.es6.js";import t from"../../../Graphic.js";import e from"../../../core/Collection.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 h}from"../../../core/accessorSupport/decorators/subclass.js";import{LayerView2DMixin as r}from"./LayerView2D.js";import a from"./graphics/GraphicContainer.js";import o from"./graphics/GraphicsView2D.js";import p from"../../layers/LayerView.js";const g={remove(){},pause(){},resume(){}};let c=class extends(r(p)){constructor(){super(...arguments),this._highlightIds=new Map}attach(){this.graphicsView=new o({requestUpdateCallback:()=>this.requestUpdate(),view:this.view,graphics:this.layer.graphics,container:new a(this.view.featuresTilingScheme)}),this._updateHighlight(),this.container.addChild(this.graphicsView.container),this.handles.add(this.layer.on("graphic-update",this.graphicsView.graphicUpdateHandler),"graphicslayerview2d")}detach(){this.container.removeAllChildren(),this.graphicsView.destroy(),this.graphicsView=null,this.handles.remove("graphicslayerview2d")}async hitTest(i){return this.graphicsView?this.graphicsView.hitTest(i):null}async fetchPopupFeatures(i){if(this.graphicsView)return this.graphicsView.hitTest(i).filter((i=>!!i.popupTemplate))}update(i){this.graphicsView.processUpdate(i)}moveStart(){}viewChange(){this.graphicsView.viewChange()}moveEnd(){}isUpdating(){return!this.graphicsView||this.graphicsView.updating}highlight(i){var s;let h;return"number"==typeof i?h=[i]:i instanceof t?h=[i.uid]:Array.isArray(i)&&i.length>0?h="number"==typeof i[0]?i:i.map((i=>i&&i.uid)):e.isCollection(i)&&i.length>0&&(h=i.map((i=>i&&i.uid)).toArray()),h=null==(s=h)?void 0:s.filter((i=>null!=i)),h.length?(this._addHighlight(h),{remove:()=>this._removeHighlight(h)}):g}_addHighlight(i){for(const t of i)if(this._highlightIds.has(t)){const i=this._highlightIds.get(t);this._highlightIds.set(t,i+1)}else this._highlightIds.set(t,1);this._updateHighlight()}_removeHighlight(i){for(const t of i)if(this._highlightIds.has(t)){const i=this._highlightIds.get(t)-1;0===i?this._highlightIds.delete(t):this._highlightIds.set(t,i)}this._updateHighlight()}_updateHighlight(){var i;null==(i=this.graphicsView)||i.setHighlight(Array.from(this._highlightIds.keys()))}};i([s()],c.prototype,"graphicsView",void 0),c=i([h("esri.views.2d.layers.GraphicsLayerView2D")],c);const l=c;export{l as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import i from"../../../Graphic.js";import t from"../../../core/Collection.js";import{init as s,watch as r}from"../../../core/watchUtils.js";import{property as a}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as h}from"../../../core/accessorSupport/decorators/subclass.js";import{GraphicsCollection as o}from"../../../support/GraphicsCollection.js";import n from"../engine/flow/AnimatedFlowView2D.js";import{LayerView2DMixin as l}from"./LayerView2D.js";import p from"./graphics/GraphicsView2D.js";import u from"./graphics/HighlightGraphicContainer.js";import c from"./imagery/ImageryGraphicsView2D.js";import w from"./imagery/ImageryView2D.js";import{ImageryLayerView as d}from"../../layers/ImageryLayerView.js";import m from"../../layers/LayerView.js";import{RefreshableLayerView as y}from"../../layers/RefreshableLayerView.js";let g=class extends(d(y(l(m)))){constructor(){super(...arguments),this._exportImageVersion=-1}initialize(){this.handles.add([s(this,["layer.blendMode","layer.effects"],(e=>{this.subview&&(this.subview.container.blendMode=e)}),!0),s(this,"layer.effect",(e=>{this.subview&&(this.subview.container.effect=e)}),!0)])}get pixelData(){return this.updating?null:"getPixelData"in this.subview?this.subview.getPixelData():null}get updating(){return!!(!this.subview||"updating"in this.subview&&this.subview.updating)}async hitTest(e,i){return this.subview?[this.subview.hitTest(e)]:null}update(e){var i;null==(i=this.subview)||i.update(e)}attach(){this.layer.increaseRasterJobHandlerUsage(),this._setSubView(),this.handles.add([s(this,"layer.exportImageServiceParameters.version",(e=>{this._exportImageVersion!==e&&(this._exportImageVersion=e,this.requestUpdate())})),this.watch("timeExtent",(()=>{"timeExtent"in this.subview&&(this.subview.timeExtent=this.timeExtent),this.requestUpdate()})),this.layer.on("redraw",(()=>{"redraw"in this.subview?this.subview.redraw():this.subview.redrawOrRefetch()})),r(this.layer,"renderer",(()=>this._setSubView()))],"imagerylayerview-update")}detach(){var e,i;this.layer.decreaseRasterJobHandlerUsage(),this.subview.destroy(),null==(e=this._highlightGraphics)||e.destroy(),null==(i=this._highlightView)||i.destroy(),this.handles.remove("imagerylayerview-update"),this._exportImageVersion=-1}moveStart(){}viewChange(){}moveEnd(){this.requestUpdate()}highlight(e,s){if(!((Array.isArray(e)?e[0]:t.isCollection(e)?e.getItemAt(0):e)instanceof i))return{remove:()=>{}};let r=[];return Array.isArray(e)||t.isCollection(e)?r=e.map((e=>e.clone())):e instanceof i&&(r=[e.clone()]),this._highlightGraphics.addMany(r),{remove:()=>{this._highlightGraphics.removeMany(r)}}}async doRefresh(){this.requestUpdate()}isUpdating(){return!this.subview||!this.suspended&&this.subview.updating}_setSubView(){var e,i;let t="Imagery";"vector-field"===(null==(e=this.layer.renderer)?void 0:e.type)&&"lerc"===this.layer.format&&(t="Graphics");var s,r,a;("animated-flow"===(null==(i=this.layer.renderer)?void 0:i.type)&&(t="Flow"),this.subview&&this.subview.type===t)||(null==(s=this.subview)||s.uninstall(this.container),null==(r=this.subview)||r.destroy(),null==(a=this._highlightGraphics)||a.destroy(),this._highlightView&&(this._highlightView.destroy(),this.container.removeChild(this._highlightView.container)),this.subview="Imagery"===t?new w({layer:this.layer,view:this.view,timeExtent:this.timeExtent}):"Graphics"===t?new c({layer:this.layer,view:this.view,timeExtent:this.timeExtent}):new n({layer:this.layer,layerView:this}),this.subview.attach(),this.subview.install(this.container),this.subview.container.blendMode=this.layer.blendMode,this.subview.container.effect=this.layer.effect);this._highlightGraphics=new o,this._highlightView=new p({view:this.view,graphics:this._highlightGraphics,requestUpdateCallback:()=>this.requestUpdate(),container:new u(this.view.featuresTilingScheme)}),this.container.addChild(this._highlightView.container),this.requestUpdate()}};e([a()],g.prototype,"pixelData",null),e([a({readOnly:!0})],g.prototype,"updating",null),e([a()],g.prototype,"subview",void 0),g=e([h("esri.views.2d.layers.ImageryLayerView2D")],g);const v=g;export{v as default};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import i from"../../../Graphic.js";import t from"../../../core/Collection.js";import{watch as r,syncAndInitial as s,sync as a}from"../../../core/reactiveUtils.js";import{property as h}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as o}from"../../../core/accessorSupport/decorators/subclass.js";import{GraphicsCollection as l}from"../../../support/GraphicsCollection.js";import n from"../engine/flow/AnimatedFlowView2D.js";import{LayerView2DMixin as u}from"./LayerView2D.js";import p from"./graphics/GraphicsView2D.js";import w from"./graphics/HighlightGraphicContainer.js";import c from"./imagery/ImageryGraphicsView2D.js";import d from"./imagery/ImageryView2D.js";import{ImageryLayerView as m}from"../../layers/ImageryLayerView.js";import v from"../../layers/LayerView.js";import{RefreshableLayerView as y}from"../../layers/RefreshableLayerView.js";let g=class extends(m(y(u(v)))){constructor(){super(...arguments),this._exportImageVersion=-1}get pixelData(){return this.updating?null:"getPixelData"in this.subview?this.subview.getPixelData():null}get updating(){return!!(!this.subview||"updating"in this.subview&&this.subview.updating)}async hitTest(e,i){return this.subview?[this.subview.hitTest(e)]:null}update(e){var i;null==(i=this.subview)||i.update(e)}attach(){this.layer.increaseRasterJobHandlerUsage(),this._setSubView(),this.handles.add([r((()=>{var e,i;return this.subview&&null!=(e=null==(i=this.layer)?void 0:i.blendMode)?e:"normal"}),(e=>{this.subview&&(this.subview.container.blendMode=e)}),s),r((()=>{var e,i;return this.subview&&null!=(e=null==(i=this.layer)?void 0:i.effect)?e:null}),(e=>{this.subview&&(this.subview.container.effect=e)}),s),r((()=>{var e,i;return null==(e=this.layer)||null==(i=e.exportImageServiceParameters)?void 0:i.version}),(e=>{e&&this._exportImageVersion!==e&&(this._exportImageVersion=e,this.requestUpdate())}),a),r((()=>this.layer.timeExtent),(e=>{"timeExtent"in this.subview&&(this.subview.timeExtent=e),this.requestUpdate()})),this.layer.on("redraw",(()=>{"redraw"in this.subview?this.subview.redraw():this.subview.redrawOrRefetch()})),r((()=>this.layer.renderer),(()=>this._setSubView()))],"imagerylayerview-update")}detach(){var e,i;this.layer.decreaseRasterJobHandlerUsage(),this.subview.destroy(),null==(e=this._highlightGraphics)||e.destroy(),null==(i=this._highlightView)||i.destroy(),this.handles.remove("imagerylayerview-update"),this._exportImageVersion=-1}moveStart(){}viewChange(){}moveEnd(){this.requestUpdate()}highlight(e,r){if(!((Array.isArray(e)?e[0]:t.isCollection(e)?e.getItemAt(0):e)instanceof i))return{remove:()=>{}};let s=[];return Array.isArray(e)||t.isCollection(e)?s=e.map((e=>e.clone())):e instanceof i&&(s=[e.clone()]),this._highlightGraphics.addMany(s),{remove:()=>{this._highlightGraphics.removeMany(s)}}}async doRefresh(){this.requestUpdate()}isUpdating(){return!this.subview||!this.suspended&&this.subview.updating}_setSubView(){var e,i;let t="Imagery";"vector-field"===(null==(e=this.layer.renderer)?void 0:e.type)&&"lerc"===this.layer.format&&(t="Graphics");var r,s,a;("animated-flow"===(null==(i=this.layer.renderer)?void 0:i.type)&&(t="Flow"),this.subview&&this.subview.type===t)||(null==(r=this.subview)||r.uninstall(this.container),null==(s=this.subview)||s.destroy(),null==(a=this._highlightGraphics)||a.destroy(),this._highlightView&&(this._highlightView.destroy(),this.container.removeChild(this._highlightView.container)),this.subview="Imagery"===t?new d({layer:this.layer,view:this.view,timeExtent:this.timeExtent}):"Graphics"===t?new c({layer:this.layer,view:this.view,timeExtent:this.timeExtent}):new n({layer:this.layer,layerView:this}),this.subview.attach(),this.subview.install(this.container),this.subview.container.blendMode=this.layer.blendMode,this.subview.container.effect=this.layer.effect);this._highlightGraphics=new l,this._highlightView=new p({view:this.view,graphics:this._highlightGraphics,requestUpdateCallback:()=>this.requestUpdate(),container:new w(this.view.featuresTilingScheme)}),this.container.addChild(this._highlightView.container),this.requestUpdate()}};e([h()],g.prototype,"pixelData",null),e([h({readOnly:!0})],g.prototype,"updating",null),e([h()],g.prototype,"subview",void 0),g=e([o("esri.views.2d.layers.ImageryLayerView2D")],g);const b=g;export{b as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import s from"../../../Graphic.js";import r from"../../../core/Logger.js";import{isAbortError as i}from"../../../core/promiseUtils.js";import{watch as t,init as o}from"../../../core/watchUtils.js";import{property as a}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as n}from"../../../core/accessorSupport/decorators/subclass.js";import u from"../engine/flow/AnimatedFlowView2D.js";import{LayerView2DMixin as h}from"./LayerView2D.js";import l from"./imagery/ImageryTileView2D.js";import p from"./imagery/VectorFieldTileView2D.js";import{canUseMajorityInterpolationOnDataSource as c}from"./support/util.js";import{ImageryTileLayerView as d}from"../../layers/ImageryTileLayerView.js";import m from"../../layers/LayerView.js";import{RefreshableLayerView as w}from"../../layers/RefreshableLayerView.js";const v=r.getLogger("esri.views.2d.layers.ImageryTileLayerView2D");let b=class extends(d(w(h(m)))){constructor(){super(...arguments),this._useWebGLForProcessing=!0,this._useProgressiveUpdate=!0,this.subview=null}initialize(){const e=this.updateFullExtent();this.addResolvingPromise(e)}get useWebGLForProcessing(){return this._useWebGLForProcessing}set useWebGLForProcessing(e){this._useWebGLForProcessing=e,this.subview&&"useWebGLForProcessing"in this.subview&&(this.subview.useWebGLForProcessing=e)}get useProgressiveUpdate(){return this._useWebGLForProcessing}set useProgressiveUpdate(e){this._useProgressiveUpdate=e,this.subview&&"useProgressiveUpdate"in this.subview&&(this.subview.useProgressiveUpdate=e)}update(e){this.subview.update(e),this.notifyChange("updating")}isUpdating(){return!this.subview||this.subview.updating}attach(){this.layer.increaseRasterJobHandlerUsage(),this._updateSubview(),this.handles.add([t(this.layer,["bandIds","renderer","interpolation","multidimensionalDefinition"],((e,s,r)=>{const t="multidimensionalDefinition"===r,o="interpolation"===r&&("majority"===e||"majority"===s)&&c(this.layer),a="renderer"===r&&s.type!==e.type;a&&this._updateSubview();const n=t||o||a;this.subview.redrawOrRefetch(n).catch((e=>{i(e)||v.error(e)})),this.notifyChange("updating")})),o(this,["layer.blendMode"],(e=>{this.subview&&(this.subview.container.blendMode=e)}),!0),o(this,["layer.effect"],(e=>{this.subview&&(this.subview.container.effect=e)}),!0),o(this,"timeExtent",(()=>{this.subview.redrawOrRefetch(!0).catch((e=>{i(e)||v.error(e)}))}))],"attach")}detach(){this.handles.remove("attach"),this.layer.decreaseRasterJobHandlerUsage(),this.subview.uninstall()}moveStart(){this.requestUpdate()}viewChange(){this.requestUpdate()}moveEnd(){this.subview.moveEnd()}async hitTest(e,r){return[new s({attributes:{},geometry:e.clone()})]}doRefresh(){return this.subview.doRefresh()}_updateSubview(){const e="vector-field"===this.layer.renderer.type?"rasterVF":"animated-flow"===this.layer.renderer.type?"rasterAnimatedFlow":"raster";if(this.subview){if(this.subview.type===e)return;this.subview.uninstall()}const{layer:s}=this;let r;r="rasterVF"===e?new p({layer:s,layerView:this}):"rasterAnimatedFlow"===e?new u({layer:s,layerView:this}):new l({layer:s,layerView:this}),"useWebGLForProcessing"in r&&(r.useWebGLForProcessing=this._useWebGLForProcessing),"useProgressiveUpdate"in r&&(r.useProgressiveUpdate=this._useProgressiveUpdate),"previousLOD"in r&&(r.previousLOD=this.subview&&"previousLOD"in this.subview&&this.subview.previousLOD),r.attach(),r.install(this.container),r.container.blendMode=s.blendMode,r.container.effect=s.effect,this.subview=r,this.requestUpdate()}};e([a()],b.prototype,"subview",void 0),e([a()],b.prototype,"useWebGLForProcessing",null),e([a()],b.prototype,"useProgressiveUpdate",null),b=e([n("esri.views.2d.layers.ImageryTileLayerView2D")],b);const y=b;export{y as default};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import s from"../../../Graphic.js";import r from"../../../core/Logger.js";import{isAbortError as i}from"../../../core/promiseUtils.js";import{watch as t,syncAndInitial as o,initial as a}from"../../../core/reactiveUtils.js";import{watch as n}from"../../../core/watchUtils.js";import{property as u}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as h}from"../../../core/accessorSupport/decorators/subclass.js";import l from"../engine/flow/AnimatedFlowView2D.js";import{LayerView2DMixin as p}from"./LayerView2D.js";import c from"./imagery/ImageryTileView2D.js";import d from"./imagery/VectorFieldTileView2D.js";import{canUseMajorityInterpolationOnDataSource as v}from"./support/util.js";import{ImageryTileLayerView as w}from"../../layers/ImageryTileLayerView.js";import m from"../../layers/LayerView.js";import{RefreshableLayerView as b}from"../../layers/RefreshableLayerView.js";const y=r.getLogger("esri.views.2d.layers.ImageryTileLayerView2D");let g=class extends(w(b(p(m)))){constructor(){super(...arguments),this._useWebGLForProcessing=!0,this._useProgressiveUpdate=!0,this.subview=null}get useWebGLForProcessing(){return this._useWebGLForProcessing}set useWebGLForProcessing(e){this._useWebGLForProcessing=e,this.subview&&"useWebGLForProcessing"in this.subview&&(this.subview.useWebGLForProcessing=e)}get useProgressiveUpdate(){return this._useWebGLForProcessing}set useProgressiveUpdate(e){this._useProgressiveUpdate=e,this.subview&&"useProgressiveUpdate"in this.subview&&(this.subview.useProgressiveUpdate=e)}update(e){this.subview.update(e),this.notifyChange("updating")}isUpdating(){return!this.subview||this.subview.updating}attach(){this.layer.increaseRasterJobHandlerUsage(),this._updateSubview(),this.handles.add([n(this.layer,["bandIds","renderer","interpolation","multidimensionalDefinition"],((e,s,r)=>{const t="multidimensionalDefinition"===r,o="interpolation"===r&&("majority"===e||"majority"===s)&&v(this.layer),a="renderer"===r&&s.type!==e.type;a&&this._updateSubview();const n=t||o||a;this.subview.redrawOrRefetch(n).catch((e=>{i(e)||y.error(e)})),this.notifyChange("updating")})),t((()=>{var e,s;return this.subview&&null!=(e=null==(s=this.layer)?void 0:s.blendMode)?e:"normal"}),(e=>{this.subview&&(this.subview.container.blendMode=e)}),o),t((()=>{var e,s;return this.subview&&null!=(e=null==(s=this.layer)?void 0:s.effect)?e:null}),(e=>{this.subview&&(this.subview.container.effect=e)}),o),t((()=>this.timeExtent),(()=>{this.subview.redrawOrRefetch(!0).catch((e=>{i(e)||y.error(e)}))}),a)],"attach")}detach(){this.handles.remove("attach"),this.layer.decreaseRasterJobHandlerUsage(),this.subview.uninstall()}moveStart(){this.requestUpdate()}viewChange(){this.requestUpdate()}moveEnd(){this.subview.moveEnd()}async hitTest(e,r){return[new s({attributes:{},geometry:e.clone()})]}doRefresh(){return this.subview.doRefresh()}_updateSubview(){const e="vector-field"===this.layer.renderer.type?"rasterVF":"animated-flow"===this.layer.renderer.type?"rasterAnimatedFlow":"raster";if(this.subview){if(this.subview.type===e)return;this.subview.uninstall()}const{layer:s}=this;let r;r="rasterVF"===e?new d({layer:s,layerView:this}):"rasterAnimatedFlow"===e?new l({layer:s,layerView:this}):new c({layer:s,layerView:this}),"useWebGLForProcessing"in r&&(r.useWebGLForProcessing=this._useWebGLForProcessing),"useProgressiveUpdate"in r&&(r.useProgressiveUpdate=this._useProgressiveUpdate),"previousLOD"in r&&(r.previousLOD=this.subview&&"previousLOD"in this.subview&&this.subview.previousLOD),r.attach(),r.install(this.container),r.container.blendMode=s.blendMode,r.container.effect=s.effect,this.subview=r,this.requestUpdate()}};e([u()],g.prototype,"subview",void 0),e([u()],g.prototype,"useWebGLForProcessing",null),e([u()],g.prototype,"useProgressiveUpdate",null),g=e([h("esri.views.2d.layers.ImageryTileLayerView2D")],g);const f=g;export{f as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
4
  */
5
- import{_ as t}from"../../../chunks/tslib.es6.js";import e from"../../../core/Collection.js";import{referenceSetter as s}from"../../../core/collectionUtils.js";import{init as i}from"../../../core/watchUtils.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 a}from"../../../core/accessorSupport/decorators/subclass.js";import{Container as o}from"../engine/Container.js";import p from"../../layers/support/ClipArea.js";import h from"../../layers/support/ClipRect.js";import n from"../../layers/support/Geometry.js";import d from"../../layers/support/Path.js";const c=e.ofType({key:"type",base:p,typeMap:{rect:h,path:d,geometry:n}}),l=e=>{let p=class extends e{constructor(){super(...arguments),this.clips=new c,this.moving=!1,this.attached=!1,this.lastUpdateId=-1,this.updateRequested=!1}initialize(){var t;this.container||(this.container=new o),this.container.fadeTransitionEnabled=!0,this.container.opacity=0,this.container.clips=this.clips,this.handles.add([i(this,"suspended",(t=>{this.container&&(this.container.visible=!t),this.view&&!t&&this.updateRequested&&this.view.requestUpdate()}),!0),i(this,["layer.opacity","container"],(()=>{var t,e;this.container&&(this.container.opacity=null!=(t=null==(e=this.layer)?void 0:e.opacity)?t:1)}),!0),i(this,["layer.blendMode"],(t=>{this.container&&(this.container.blendMode=t)}),!0),i(this,["layer.effect"],(t=>{this.container&&(this.container.effect=t)}),!0),this.clips.on("change",(()=>{this.container.clips=this.clips,this.notifyChange("clips")}))]),null!=(t=this.view)&&t.whenLayerView?this.view.whenLayerView(this.layer).then((t=>{t!==this||this.attached||this.destroyed||(this.attach(),this.requestUpdate(),this.attached=!0)}),(()=>{})):this.when().then((()=>{this.attached||this.destroyed||(this.attach(),this.requestUpdate(),this.attached=!0)}),(()=>{}))}destroy(){this.attached&&(this.detach(),this.attached=!1),this.handles.remove("initialize"),this.updateRequested=!1}get updating(){return!this.attached||!this.suspended&&(this.updateRequested||this.isUpdating())||!(!this.updatingHandles||!this.updatingHandles.updating)}isVisibleAtScale(t){let e=!0;const s=this.layer,i=s.minScale,r=s.maxScale;if(null!=i&&null!=r){let s=!i,a=!r;!s&&t<=i&&(s=!0),!a&&t>=r&&(a=!0),e=s&&a}return e}requestUpdate(){this.destroyed||this.updateRequested||(this.updateRequested=!0,this.suspended||this.view.requestUpdate())}processUpdate(t){!this.isFulfilled()||this.isResolved()?(this._set("updateParameters",t),this.updateRequested&&!this.suspended&&(this.updateRequested=!1,this.update(t))):this.updateRequested=!1}hitTest(t,e){return Promise.resolve(null)}isUpdating(){return!1}isRendering(){return!1}canResume(){return!!super.canResume()&&this.isVisibleAtScale(this.view.scale)}};return t([r({type:c,set(t){const e=s(t,this._get("clips"),c);this._set("clips",e)}})],p.prototype,"clips",void 0),t([r()],p.prototype,"moving",void 0),t([r()],p.prototype,"attached",void 0),t([r()],p.prototype,"container",void 0),t([r()],p.prototype,"suspended",void 0),t([r({readOnly:!0})],p.prototype,"updateParameters",void 0),t([r()],p.prototype,"updateRequested",void 0),t([r()],p.prototype,"updating",null),t([r()],p.prototype,"view",void 0),p=t([a("esri.views.2d.layers.LayerView2D")],p),p};export{l as LayerView2DMixin};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Collection.js";import{referenceSetter as s}from"../../../core/collectionUtils.js";import i from"../../../core/Error.js";import{watch as r,syncAndInitial as a,on as o}from"../../../core/reactiveUtils.js";import{property as n}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as p}from"../../../core/accessorSupport/decorators/subclass.js";import{Container as l}from"../engine/Container.js";import h from"../../layers/support/ClipArea.js";import c from"../../layers/support/ClipRect.js";import d from"../../layers/support/Geometry.js";import u from"../../layers/support/Path.js";const y=t.ofType({key:"type",base:h,typeMap:{rect:c,path:u,geometry:d}}),m=t=>{let h=class extends t{constructor(){super(...arguments),this.attached=!1,this.clips=new y,this.lastUpdateId=-1,this.moving=!1,this.updateRequested=!1}initialize(){var e,t,s,n;const p=null==(e=null==(t=this.view)?void 0:t.spatialReferenceLocked)||e;(null==(s=this.view)?void 0:s.spatialReference)&&p&&!this.spatialReferenceSupported?this.addResolvingPromise(Promise.reject(new i("layerview:spatial-reference-incompatible","The spatial reference of this layer does not meet the requirements of the view",{layer:this.layer}))):(this.container||(this.container=new l),this.container.fadeTransitionEnabled=!0,this.container.opacity=0,this.container.clips=this.clips,this.handles.add([r((()=>this.suspended),(e=>{this.container&&(this.container.visible=!e),this.view&&!e&&this.updateRequested&&this.view.requestUpdate()}),a),r((()=>{var e,t;return null!=(e=null==(t=this.layer)?void 0:t.opacity)?e:1}),(e=>{this.container&&(this.container.opacity=e)}),a),r((()=>this.layer&&"blendMode"in this.layer?this.layer.blendMode:"normal"),(e=>{this.container&&(this.container.blendMode=e)}),a),r((()=>this.layer&&"effect"in this.layer?this.layer.effect:null),(e=>{this.container&&(this.container.effect=e)}),a),o((()=>this.clips),"change",(()=>{this.container&&(this.container.clips=this.clips)}))]),null!=(n=this.view)&&n.whenLayerView?this.view.whenLayerView(this.layer).then((e=>{e!==this||this.attached||this.destroyed||(this.attach(),this.requestUpdate(),this.attached=!0)}),(()=>{})):this.when().then((()=>{this.attached||this.destroyed||(this.attach(),this.requestUpdate(),this.attached=!0)}),(()=>{})))}destroy(){this.attached&&(this.detach(),this.attached=!1),this.updateRequested=!1}get spatialReferenceSupported(){var e;const t=null==(e=this.view)?void 0:e.spatialReference;return null==t||this.supportsSpatialReference(t)}get updating(){var e;return!this.attached||!this.suspended&&(this.updateRequested||this.isUpdating())||!(null==(e=this.updatingHandles)||!e.updating)}get visibleAtCurrentScale(){return this.isVisibleAtScale(this.view.scale)}isVisibleAtScale(e){const t=this.layer&&"effectiveScaleRange"in this.layer?this.layer.effectiveScaleRange:null;if(!t)return!0;const{minScale:s,maxScale:i}=t;return(0===s||e<=s)&&(0===i||e>=i)}requestUpdate(){this.destroyed||this.updateRequested||(this.updateRequested=!0,this.suspended||this.view.requestUpdate())}processUpdate(e){!this.isFulfilled()||this.isResolved()?(this._set("updateParameters",e),this.updateRequested&&!this.suspended&&(this.updateRequested=!1,this.update(e))):this.updateRequested=!1}hitTest(e,t){return Promise.resolve(null)}supportsSpatialReference(e){return!0}isUpdating(){return!1}canResume(){return!!this.spatialReferenceSupported&&(!!super.canResume()&&this.visibleAtCurrentScale)}getSuspendInfo(){const e=super.getSuspendInfo(),t=!this.spatialReferenceSupported,s=this.visibleAtCurrentScale;return t&&(e.spatialReferenceNotSupported=t),s&&(e.outsideScaleRange=s),e}};return e([n()],h.prototype,"attached",void 0),e([n({type:y,set(e){const t=s(e,this._get("clips"),y);this._set("clips",t)}})],h.prototype,"clips",void 0),e([n()],h.prototype,"container",void 0),e([n()],h.prototype,"moving",void 0),e([n({readOnly:!0})],h.prototype,"spatialReferenceSupported",null),e([n({readOnly:!0})],h.prototype,"updateParameters",void 0),e([n()],h.prototype,"updateRequested",void 0),e([n()],h.prototype,"updating",null),e([n()],h.prototype,"view",void 0),e([n({readOnly:!0})],h.prototype,"visibleAtCurrentScale",null),h=e([p("esri.views.2d.layers.LayerView2D")],h),h};export{m as LayerView2DMixin};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import s from"../../../Graphic.js";import i from"../../../core/Collection.js";import{isSome as t,isNone as r}from"../../../core/maybe.js";import{init as a,on as o}from"../../../core/watchUtils.js";import"../../../core/Logger.js";import"../../../core/accessorSupport/ensureType.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/set.js";import{subclass as h}from"../../../core/accessorSupport/decorators/subclass.js";import{LayerView2DMixin as c}from"./LayerView2D.js";import p from"./graphics/GraphicContainer.js";import n from"./graphics/GraphicsView2D.js";import l from"../../layers/LayerView.js";const u="sublayers",d="layerView",f=Object.freeze({remove(){},pause(){},resume(){}});let g=class extends(c(l)){async fetchPopupFeatures(e){return Array.from(this.graphicsViews(),(s=>s.hitTest(e).filter((e=>!!e.popupTemplate)))).flat()}*graphicsViews(){t(this._graphicsViewsFeatureCollectionMap)?yield*this._graphicsViewsFeatureCollectionMap.keys():t(this._graphicsViews)?yield*this._graphicsViews:yield*[]}async hitTest(e,s){const i=Array.from(this.graphicsViews(),(async s=>{const i=await s.hitTest(e);if(t(this._graphicsViewsFeatureCollectionMap)){const e=this._graphicsViewsFeatureCollectionMap.get(s);for(const s of i)!s.popupTemplate&&e.popupTemplate&&(s.popupTemplate=e.popupTemplate)}return i}));return(await Promise.all(i)).flat()}highlight(e){let t;if("number"==typeof e?t=[e]:e instanceof s?t=[e.uid]:Array.isArray(e)&&e.length>0?t="number"==typeof e[0]?e:e.map((e=>e&&e.uid)):i.isCollection(e)&&(t=e.map((e=>e&&e.uid)).toArray()),t=t.filter((e=>null!=e)),!t.length)return f;for(const s of this.graphicsViews())s.addHighlight(t);return{remove:()=>{for(const e of this.graphicsViews())e.removeHighlight(t)}}}update(e){for(const s of this.graphicsViews())s.processUpdate(e)}attach(){const e=this.view,s=()=>this.requestUpdate(),i=this.layer.featureCollections;if(t(i)&&i.length){this._graphicsViewsFeatureCollectionMap=new Map;for(const t of i){const i=new p(this.view.featuresTilingScheme);i.fadeTransitionEnabled=!0;const r=new n({view:e,graphics:t.source,renderer:t.renderer,requestUpdateCallback:s,container:i});this._graphicsViewsFeatureCollectionMap.set(r,t),this.container.addChild(r.container),this.handles.add([a(t,"visible",(e=>r.container.visible=e)),a(r,"updating",(()=>this.notifyChange("updating")))],d)}}else t(this.layer.sublayers)&&this.handles.add(o(this.layer,"sublayers","change",(()=>this._createGraphicsViews()),(()=>this._createGraphicsViews()),(()=>this._destroyGraphicsViews())),u)}detach(){this._destroyGraphicsViews(),this.handles.remove(u)}moveStart(){}moveEnd(){}viewChange(){for(const e of this.graphicsViews())e.viewChange()}isUpdating(){for(const e of this.graphicsViews())if(e.updating)return!0;return!1}_destroyGraphicsViews(){this.container.removeAllChildren(),this.handles.remove(d);for(const e of this.graphicsViews())e.destroy();this._graphicsViews=null,this._graphicsViewsFeatureCollectionMap=null}_createGraphicsViews(){if(this._destroyGraphicsViews(),r(this.layer.sublayers))return;const e=[],s=this.view,i=()=>this.requestUpdate();for(const t of this.layer.sublayers){const r=new p(this.view.featuresTilingScheme);r.fadeTransitionEnabled=!0;const o=new n({view:s,graphics:t.graphics,requestUpdateCallback:i,container:r});this.handles.add([t.on("graphic-update",o.graphicUpdateHandler),a(t,"visible",(e=>o.container.visible=e)),a(o,"updating",(()=>this.notifyChange("updating")))],d),this.container.addChild(o.container),e.push(o)}this._graphicsViews=e}};g=e([h("esri.views.2d.layers.MapNotesLayerView2D")],g);const m=g;export{m as default};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import i from"../../../Graphic.js";import s from"../../../core/Collection.js";import{isSome as t,isNone as r}from"../../../core/maybe.js";import{init as h,on as a}from"../../../core/watchUtils.js";import"../../../core/Logger.js";import"../../../core/accessorSupport/ensureType.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/set.js";import{subclass as o}from"../../../core/accessorSupport/decorators/subclass.js";import{LayerView2DMixin as c}from"./LayerView2D.js";import p from"./graphics/GraphicContainer.js";import n from"./graphics/GraphicsView2D.js";import l from"../../layers/LayerView.js";const g="sublayers",d="layerView",u=Object.freeze({remove(){},pause(){},resume(){}});let f=class extends(c(l)){constructor(){super(...arguments),this._highlightIds=new Map}async fetchPopupFeatures(e){return Array.from(this.graphicsViews(),(i=>i.hitTest(e).filter((e=>!!e.popupTemplate)))).flat()}*graphicsViews(){t(this._graphicsViewsFeatureCollectionMap)?yield*this._graphicsViewsFeatureCollectionMap.keys():t(this._graphicsViews)?yield*this._graphicsViews:yield*[]}async hitTest(e,i){const s=Array.from(this.graphicsViews(),(async i=>{const s=await i.hitTest(e);if(t(this._graphicsViewsFeatureCollectionMap)){const e=this._graphicsViewsFeatureCollectionMap.get(i);for(const i of s)!i.popupTemplate&&e.popupTemplate&&(i.popupTemplate=e.popupTemplate)}return s}));return(await Promise.all(s)).flat()}highlight(e){let t;return"number"==typeof e?t=[e]:e instanceof i?t=[e.uid]:Array.isArray(e)&&e.length>0?t="number"==typeof e[0]?e:e.map((e=>e&&e.uid)):s.isCollection(e)&&(t=e.map((e=>e&&e.uid)).toArray()),t=t.filter((e=>null!=e)),t.length?(this._addHighlight(t),{remove:()=>{this._removeHighlight(t)}}):u}update(e){for(const i of this.graphicsViews())i.processUpdate(e)}attach(){const e=this.view,i=()=>this.requestUpdate(),s=this.layer.featureCollections;if(t(s)&&s.length){this._graphicsViewsFeatureCollectionMap=new Map;for(const t of s){const s=new p(this.view.featuresTilingScheme);s.fadeTransitionEnabled=!0;const r=new n({view:e,graphics:t.source,renderer:t.renderer,requestUpdateCallback:i,container:s});this._graphicsViewsFeatureCollectionMap.set(r,t),this.container.addChild(r.container),this.handles.add([h(t,"visible",(e=>r.container.visible=e)),h(r,"updating",(()=>this.notifyChange("updating")))],d)}this._updateHighlight()}else t(this.layer.sublayers)&&this.handles.add(a(this.layer,"sublayers","change",(()=>this._createGraphicsViews()),(()=>this._createGraphicsViews()),(()=>this._destroyGraphicsViews())),g)}detach(){this._destroyGraphicsViews(),this.handles.remove(g)}moveStart(){}moveEnd(){}viewChange(){for(const e of this.graphicsViews())e.viewChange()}isUpdating(){for(const e of this.graphicsViews())if(e.updating)return!0;return!1}_destroyGraphicsViews(){this.container.removeAllChildren(),this.handles.remove(d);for(const e of this.graphicsViews())e.destroy();this._graphicsViews=null,this._graphicsViewsFeatureCollectionMap=null}_createGraphicsViews(){if(this._destroyGraphicsViews(),r(this.layer.sublayers))return;const e=[],i=this.view,s=()=>this.requestUpdate();for(const t of this.layer.sublayers){const r=new p(this.view.featuresTilingScheme);r.fadeTransitionEnabled=!0;const a=new n({view:i,graphics:t.graphics,requestUpdateCallback:s,container:r});this.handles.add([t.on("graphic-update",a.graphicUpdateHandler),h(t,"visible",(e=>a.container.visible=e)),h(a,"updating",(()=>this.notifyChange("updating")))],d),this.container.addChild(a.container),e.push(a)}this._graphicsViews=e,this._updateHighlight()}_addHighlight(e){for(const i of e)if(this._highlightIds.has(i)){const e=this._highlightIds.get(i);this._highlightIds.set(i,e+1)}else this._highlightIds.set(i,1);this._updateHighlight()}_removeHighlight(e){for(const i of e)if(this._highlightIds.has(i)){const e=this._highlightIds.get(i)-1;0===e?this._highlightIds.delete(i):this._highlightIds.set(i,e)}this._updateHighlight()}_updateHighlight(){const e=Array.from(this._highlightIds.keys());for(const i of this.graphicsViews())i.setHighlight(e)}};f=e([o("esri.views.2d.layers.MapNotesLayerView2D")],f);const m=f;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.23/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import s from"../../../Graphic.js";import r from"../../../core/Collection.js";import{isSome as i,unwrap as t}from"../../../core/maybe.js";import{watch as o}from"../../../core/reactiveUtils.js";import"../../../core/Logger.js";import"../../../core/accessorSupport/ensureType.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/set.js";import{subclass as a}from"../../../core/accessorSupport/decorators/subclass.js";import{LayerView2DMixin as h}from"./LayerView2D.js";import n from"./graphics/GraphicContainer.js";import c from"./graphics/GraphicsView2D.js";import p from"../../layers/LayerView.js";const l=["routeInfo","directionLines","directionPoints","polygonBarriers","polylineBarriers","pointBarriers","stops"],m=Object.freeze({remove(){},pause(){},resume(){}});let u=class extends(h(p)){constructor(){super(...arguments),this._graphicsViews=new Map}attach(){for(const e of l)this.handles.add(o((()=>i(this.layer[e])?"routeInfo"===e?[t(this.layer[e])]:t(this.layer[e]).items:null),(s=>this._createGraphicsView(e,s)),{initial:!0}),e)}detach(){this._destroyGraphicsViews()}highlight(e){let i;if("number"==typeof e?i=[e]:e instanceof s?i=[e.uid]:Array.isArray(e)&&e.length>0?i="number"==typeof e[0]?e:e.map((e=>e&&e.uid)):r.isCollection(e)&&(i=e.map((e=>e&&e.uid)).toArray()),i=i.filter((e=>null!=e)),!i.length)return m;for(const s of this._graphicsViews.values())s.addHighlight(i);return{remove:()=>{for(const e of this._graphicsViews.values())e.removeHighlight(i)}}}async hitTest(e,s){if(this.suspended||!this._graphicsViews.size)return Promise.resolve(null);const r=Array.from(this._graphicsViews.values()).reverse().map((s=>s.hitTest(e))).flat().filter((e=>!!e));for(const i of r)i.layer=this.layer,i.sourceLayer=this.layer;return r}moveStart(){}moveEnd(){}update(e){for(const s of this._graphicsViews.values())s.processUpdate(e)}viewChange(){for(const e of this._graphicsViews.values())e.viewChange()}isUpdating(){for(const e of this._graphicsViews.values())if(e.updating)return!0;return!1}_createGraphicsView(e,t){this._destroyGraphicsView(e);const a=this.view,h=()=>this.requestUpdate(),p=new r(i(t)?t.map((e=>{const{attributes:r,geometry:i,symbol:t,popupInfo:o}=e.toPortalJSON();return s.fromJSON({attributes:r,geometry:i,symbol:t,popupTemplate:o})})):[]),m=new n(a.featuresTilingScheme),u=new c({container:m,graphics:p,requestUpdateCallback:h,view:a});this._graphicsViews.set(e,u),this.container.addChildAt(m,l.indexOf(e)),this.handles.add([o((()=>u.updating),(()=>this.notifyChange("updating")),{initial:!0})],`updating-${e}`)}_destroyGraphicsView(e){if(!this._graphicsViews.has(e))return;const s=this._graphicsViews.get(e);this.container.removeChild(s.container),s.destroy(),this.handles.remove(`updating-${e}`),this._graphicsViews.delete(e)}_destroyGraphicsViews(){this.container.removeAllChildren();for(const[e,s]of this._graphicsViews.entries())this.handles.remove(e),s.destroy();this._graphicsViews.clear()}};u=e([a("esri.views.2d.layers.RouteLayerView2D")],u);const d=u;export{d as default};
5
+ import{_ as i}from"../../../chunks/tslib.es6.js";import e from"../../../Graphic.js";import s from"../../../core/Collection.js";import{isSome as t,unwrap as r}from"../../../core/maybe.js";import{watch as h}from"../../../core/reactiveUtils.js";import"../../../core/Logger.js";import"../../../core/accessorSupport/ensureType.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/set.js";import{subclass as o}from"../../../core/accessorSupport/decorators/subclass.js";import{LayerView2DMixin as a}from"./LayerView2D.js";import n from"./graphics/GraphicContainer.js";import c from"./graphics/GraphicsView2D.js";import p from"../../layers/LayerView.js";const l=["routeInfo","directionLines","directionPoints","polygonBarriers","polylineBarriers","pointBarriers","stops"],g=Object.freeze({remove(){},pause(){},resume(){}});let d=class extends(a(p)){constructor(){super(...arguments),this._graphicsViews=new Map,this._highlightIds=new Map}attach(){for(const i of l)this.handles.add(h((()=>t(this.layer[i])?"routeInfo"===i?[r(this.layer[i])]:r(this.layer[i]).items:null),(e=>this._createGraphicsView(i,e)),{initial:!0}),i)}detach(){this._destroyGraphicsViews()}highlight(i){let t;return"number"==typeof i?t=[i]:i instanceof e?t=[i.uid]:Array.isArray(i)&&i.length>0?t="number"==typeof i[0]?i:i.map((i=>i&&i.uid)):s.isCollection(i)&&(t=i.map((i=>i&&i.uid)).toArray()),t=t.filter((i=>null!=i)),t.length?(this._addHighlight(t),{remove:()=>this._removeHighlight(t)}):g}async hitTest(i,e){if(this.suspended||!this._graphicsViews.size)return Promise.resolve(null);const s=Array.from(this._graphicsViews.values()).reverse().map((e=>e.hitTest(i))).flat().filter((i=>!!i));for(const t of s)t.layer=this.layer,t.sourceLayer=this.layer;return s}moveStart(){}moveEnd(){}update(i){for(const e of this._graphicsViews.values())e.processUpdate(i)}viewChange(){for(const i of this._graphicsViews.values())i.viewChange()}isUpdating(){for(const i of this._graphicsViews.values())if(i.updating)return!0;return!1}_createGraphicsView(i,r){this._destroyGraphicsView(i);const o=this.view,a=()=>this.requestUpdate(),p=new s(t(r)?r.map((i=>{const{attributes:s,geometry:t,symbol:r,popupInfo:h}=i.toPortalJSON();return e.fromJSON({attributes:s,geometry:t,symbol:r,popupTemplate:h})})):[]),g=new n(o.featuresTilingScheme),d=new c({container:g,graphics:p,requestUpdateCallback:a,view:o});this._graphicsViews.set(i,d),this.container.addChildAt(g,l.indexOf(i)),this._updateHighlight(),this.handles.add([h((()=>d.updating),(()=>this.notifyChange("updating")),{initial:!0})],`updating-${i}`)}_destroyGraphicsView(i){if(!this._graphicsViews.has(i))return;const e=this._graphicsViews.get(i);this.container.removeChild(e.container),e.destroy(),this.handles.remove(`updating-${i}`),this._graphicsViews.delete(i)}_destroyGraphicsViews(){this.container.removeAllChildren();for(const[i,e]of this._graphicsViews.entries())this.handles.remove(i),e.destroy();this._graphicsViews.clear()}_addHighlight(i){for(const e of i)if(this._highlightIds.has(e)){const i=this._highlightIds.get(e);this._highlightIds.set(e,i+1)}else this._highlightIds.set(e,1);this._updateHighlight()}_removeHighlight(i){for(const e of i)if(this._highlightIds.has(e)){const i=this._highlightIds.get(e)-1;0===i?this._highlightIds.delete(e):this._highlightIds.set(e,i)}this._updateHighlight()}_updateHighlight(){const i=Array.from(this._highlightIds.keys());for(const e of this._graphicsViews.values())e.setHighlight(i)}};d=i([o("esri.views.2d.layers.RouteLayerView2D")],d);const m=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.23/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Error.js";import i from"../../../core/Logger.js";import{isAbortError as s}from"../../../core/promiseUtils.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 a}from"../../../core/accessorSupport/decorators/subclass.js";import{BitmapTileLayerView2D as l}from"./BitmapTileLayerView2D.js";import{LayerView2DMixin as o}from"./LayerView2D.js";import{createBlankImage as h,resampleImage as n}from"./support/imageUtils.js";import c from"../tiling/TileInfoView.js";import u from"../tiling/TileKey.js";import p from"../tiling/TileQueue.js";import f from"../tiling/TileStrategy.js";import m from"../../layers/LayerView.js";import{RefreshableLayerView as y}from"../../layers/RefreshableLayerView.js";import{TileLayerView as w}from"../../layers/TileLayerView.js";import{createQueryGeometry as g}from"../../support/drapedUtils.js";const d=i.getLogger("esri.views.2d.layers.TileLayerView2D"),_=[0,0];let I=class extends(w(y(l(o(m))))){constructor(){super(...arguments),this._tileStrategy=null,this._fetchQueue=null,this.layer=null}initialize(){const e=this.layer.tileInfo,i=e&&e.spatialReference;let s;i||(s=new t("layerview:tiling-information-missing","The layer doesn't provide tiling information",{layer:this.layer})),i.equals(this.view.spatialReference)||(s=new t("layerview:spatial-reference-incompatible","The spatial reference of this layer does not meet the requirements of the view",{layer:this.layer})),this.watch("resampling",(()=>{this.doRefresh()})),s&&this.addResolvingPromise(Promise.reject(s))}get resampling(){return!("resampling"in this.layer)||!1!==this.layer.resampling}update(e){this._fetchQueue.pause(),this._fetchQueue.state=e.state,this._tileStrategy.update(e),this._fetchQueue.resume(),this.notifyChange("updating")}attach(){const e="tileServers"in this.layer?this.layer.tileServers:null;this._tileInfoView=new c(this.layer.tileInfo,this.layer.fullExtent),this._fetchQueue=new p({tileInfoView:this._tileInfoView,concurrency:e&&10*e.length||10,process:(e,t)=>this.fetchTile(e,t)}),this._tileStrategy=new f({cachePolicy:"keep",resampling:this.resampling,acquireTile:e=>this.acquireTile(e),releaseTile:e=>this.releaseTile(e),tileInfoView:this._tileInfoView}),this.requestUpdate(),this.container.requestRender(),super.attach()}detach(){super.detach(),this._tileStrategy.destroy(),this._fetchQueue.clear(),this.container.removeAllChildren(),this._fetchQueue=this._tileStrategy=this._tileInfoView=null}moveStart(){this.requestUpdate()}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}createFetchPopupFeaturesQueryGeometry(e,t){return g(e,t,this.view)}async doRefresh(){this.updateRequested||this.suspended||(this._fetchQueue.reset(),this._tileStrategy.tiles.forEach((e=>this._enqueueTileFetch(e))),this.notifyChange("updating"))}isUpdating(){var e;return(null==(e=this._fetchQueue)?void 0:e.length)>0}acquireTile(e){const t=this._bitmapView.createTile(e),i=t.bitmap;return[i.x,i.y]=this._tileInfoView.getTileCoords(_,t.key),i.resolution=this._tileInfoView.getTileResolution(t.key),[i.width,i.height]=this._tileInfoView.tileInfo.size,this._enqueueTileFetch(t),this._bitmapView.addChild(t),this.requestUpdate(),t}releaseTile(e){this._fetchQueue.abort(e.key.id),this._bitmapView.removeChild(e),e.once("detach",(()=>e.destroy())),this.requestUpdate()}async fetchTile(e,t={}){const i="tilemapCache"in this.layer?this.layer.tilemapCache:null,{signal:r,resamplingLevel:a=0}=t;if(!i)try{return await this._fetchImage(e,r)}catch(c){if(!s(c)&&!this.resampling)return h(this._tileInfoView.tileInfo.size);if(a<3){const i=this._tileInfoView.getTileParentId(e.id);if(i){const s=new u(i),r=await this.fetchTile(s,{...t,resamplingLevel:a+1});return n(this._tileInfoView,r,s,e)}}throw c}const l=new u(0,0,0,0);let o;try{if(await i.fetchAvailabilityUpsample(e.level,e.row,e.col,l,{signal:r}),l.level!==e.level&&!this.resampling)return h(this._tileInfoView.tileInfo.size);o=await this._fetchImage(l,r)}catch(c){if(s(c))throw c;o=await this._fetchImage(e,r)}return this.resampling?n(this._tileInfoView,o,l,e):o}async _enqueueTileFetch(e){if(!this._fetchQueue.has(e.key.id)){try{const t=await this._fetchQueue.push(e.key);e.bitmap.source=t,e.bitmap.width=this._tileInfoView.tileInfo.size[0],e.bitmap.height=this._tileInfoView.tileInfo.size[1],e.once("attach",(()=>this.requestUpdate()))}catch(t){s(t)||d.error(t)}this.requestUpdate()}}async _fetchImage(e,t){return this.layer.fetchTile(e.level,e.row,e.col,{signal:t})}};e([r()],I.prototype,"resampling",null),I=e([a("esri.views.2d.layers.TileLayerView2D")],I);const T=I;export{T as default};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Logger.js";import{isAbortError as i}from"../../../core/promiseUtils.js";import{watch as s}from"../../../core/reactiveUtils.js";import{property as r}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as l}from"../../../core/accessorSupport/decorators/subclass.js";import{BitmapTileLayerView2D as a}from"./BitmapTileLayerView2D.js";import{LayerView2DMixin as h}from"./LayerView2D.js";import{createBlankImage as o,resampleImage as n}from"./support/imageUtils.js";import c from"../tiling/TileInfoView.js";import u from"../tiling/TileKey.js";import p from"../tiling/TileQueue.js";import f from"../tiling/TileStrategy.js";import m from"../../layers/LayerView.js";import{RefreshableLayerView as y}from"../../layers/RefreshableLayerView.js";import{TileLayerView as d}from"../../layers/TileLayerView.js";import{createQueryGeometry as g}from"../../support/drapedUtils.js";const w=[0,0];let _=class extends(d(y(a(h(m))))){constructor(){super(...arguments),this._tileStrategy=null,this._fetchQueue=null,this.layer=null}get resampling(){return!("resampling"in this.layer)||!1!==this.layer.resampling}update(e){this._fetchQueue.pause(),this._fetchQueue.state=e.state,this._tileStrategy.update(e),this._fetchQueue.resume(),this.notifyChange("updating")}attach(){const e="tileServers"in this.layer?this.layer.tileServers:null;this._tileInfoView=new c(this.layer.tileInfo,this.layer.fullExtent),this._fetchQueue=new p({tileInfoView:this._tileInfoView,concurrency:e&&10*e.length||10,process:(e,t)=>this.fetchTile(e,t)}),this._tileStrategy=new f({cachePolicy:"keep",resampling:this.resampling,acquireTile:e=>this.acquireTile(e),releaseTile:e=>this.releaseTile(e),tileInfoView:this._tileInfoView}),this.requestUpdate(),this.container.requestRender(),this.handles.add(s((()=>this.resampling),(()=>{this.doRefresh()}))),super.attach()}detach(){super.detach(),this._tileStrategy.destroy(),this._fetchQueue.clear(),this.container.removeAllChildren(),this._fetchQueue=this._tileStrategy=this._tileInfoView=null}moveStart(){this.requestUpdate()}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}supportsSpatialReference(e){var t;const i=null==(t=this.layer.tileInfo)?void 0:t.spatialReference;return e.equals(i)}createFetchPopupFeaturesQueryGeometry(e,t){return g(e,t,this.view)}async doRefresh(){this.updateRequested||this.suspended||(this._fetchQueue.reset(),this._tileStrategy.tiles.forEach((e=>this._enqueueTileFetch(e))),this.notifyChange("updating"))}isUpdating(){var e;return(null==(e=this._fetchQueue)?void 0:e.length)>0}acquireTile(e){const t=this._bitmapView.createTile(e),i=t.bitmap;return[i.x,i.y]=this._tileInfoView.getTileCoords(w,t.key),i.resolution=this._tileInfoView.getTileResolution(t.key),[i.width,i.height]=this._tileInfoView.tileInfo.size,this._enqueueTileFetch(t),this._bitmapView.addChild(t),this.requestUpdate(),t}releaseTile(e){this._fetchQueue.abort(e.key.id),this._bitmapView.removeChild(e),e.once("detach",(()=>e.destroy())),this.requestUpdate()}async fetchTile(e,t={}){const s="tilemapCache"in this.layer?this.layer.tilemapCache:null,{signal:r,resamplingLevel:l=0}=t;if(!s)try{return await this._fetchImage(e,r)}catch(c){if(!i(c)&&!this.resampling)return o(this._tileInfoView.tileInfo.size);if(l<3){const i=this._tileInfoView.getTileParentId(e.id);if(i){const s=new u(i),r=await this.fetchTile(s,{...t,resamplingLevel:l+1});return n(this._tileInfoView,r,s,e)}}throw c}const a=new u(0,0,0,0);let h;try{if(await s.fetchAvailabilityUpsample(e.level,e.row,e.col,a,{signal:r}),a.level!==e.level&&!this.resampling)return o(this._tileInfoView.tileInfo.size);h=await this._fetchImage(a,r)}catch(c){if(i(c))throw c;h=await this._fetchImage(e,r)}return this.resampling?n(this._tileInfoView,h,a,e):h}async _enqueueTileFetch(e){if(!this._fetchQueue.has(e.key.id)){try{const t=await this._fetchQueue.push(e.key);e.bitmap.source=t,e.bitmap.width=this._tileInfoView.tileInfo.size[0],e.bitmap.height=this._tileInfoView.tileInfo.size[1],e.once("attach",(()=>this.requestUpdate()))}catch(s){i(s)||t.getLogger(this.declaredClass).error(s)}this.requestUpdate()}}async _fetchImage(e,t){return this.layer.fetchTile(e.level,e.row,e.col,{signal:t})}};e([r()],_.prototype,"resampling",null),_=e([l("esri.views.2d.layers.TileLayerView2D")],_);const I=_;export{I as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../Graphic.js";import i from"../../../core/Error.js";import{clone as s}from"../../../core/lang.js";import r from"../../../core/Logger.js";import{isNone as a}from"../../../core/maybe.js";import{isAbortError as l}from"../../../core/promiseUtils.js";import{init as o}from"../../../core/watchUtils.js";import{property as n}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as h}from"../../../core/accessorSupport/decorators/subclass.js";import{diff as u,hasDiff as c}from"../../../core/accessorSupport/diffUtils.js";import{create as y}from"../../../geometry/support/aaBoundingRect.js";import{StyleUpdateType as d}from"../engine/vectorTiles/enums.js";import{TileHandler as p}from"../engine/vectorTiles/TileHandler.js";import{TileManager as _}from"../engine/vectorTiles/TileManager.js";import{VectorTile as f}from"../engine/vectorTiles/VectorTile.js";import{VectorTileContainer as g}from"../engine/vectorTiles/VectorTileContainer.js";import{drawColliders as m}from"../engine/vectorTiles/decluttering/debugging.js";import{StyleLayerType as T}from"../engine/vectorTiles/style/StyleDefinition.js";import C from"../engine/vectorTiles/style/StyleRepository.js";import{LayerView2DMixin as v}from"./LayerView2D.js";import{Display as R}from"./support/Display.js";import w from"../tiling/TileInfoViewPOT.js";import H from"../tiling/TileQueue.js";import Q from"../../layers/LayerView.js";const D=r.getLogger("esri.views.2d.layers.VectorTileLayerView2D");let b=class extends(v(Q)){constructor(){super(...arguments),this._styleChanges=[],this._fetchQueue=null,this._parseQueue=null,this._isTileHandlerReady=!1,this.fading=!1}initialize(){const e=this.layer.tileInfo;if(!(e&&e.spatialReference).equals(this.view.spatialReference))return void this.addResolvingPromise(Promise.reject(new i("layerview:spatial-reference-incompatible","The spatial reference of this layer does not meet the requirements of the view",{layer:this.layer})));const{style:t}=this.layer.currentStyleInfo;this._styleRepository=new C(t),this._tileInfoView=new w(this.layer.tileInfo,this.layer.fullExtent),this._vectorTileContainer=new g(this._tileInfoView),this._tileHandler=new p(this.layer,this._styleRepository,window.devicePixelRatio||1),this.container.addChild(this._vectorTileContainer),this.handles.add([this._vectorTileContainer.on("fade-start",(()=>{this.fading=!0,this.notifyChange("updating"),this.requestUpdate()})),this._vectorTileContainer.on("fade-complete",(()=>{this._collisionBoxesDisplay&&this._collisionBoxesDisplay.requestRender(),this.fading=!1,this.notifyChange("updating"),this.requestUpdate()})),o(this.layer,"symbolCollisionBoxesVisible",(e=>{e?(this._collisionBoxesDisplay=new R({render:e=>this._renderCollisionBoxes(e.context)}),this.container.addChild(this._collisionBoxesDisplay)):(this.container.removeChild(this._collisionBoxesDisplay),this._collisionBoxesDisplay=null)}))])}destroy(){var e;this._stop(),this.container.removeAllChildren(),this._vectorTileContainer&&(this._vectorTileContainer.destroy(),this._vectorTileContainer=null),null==(e=this._tileHandler)||e.destroy(),this._tileHandler=null}async hitTest(e,i){if(!this._tileHandlerPromise)return null;await this._tileHandlerPromise;const s=await this._vectorTileContainer.hitTest(i);if(!s||0===s.length)return null;const r=s[0]-1,a=this._styleRepository,l=a.getStyleLayerByUID(r);if(!l)return null;const o=a.getStyleLayerIndex(l.id),n=new t({attributes:{layerId:o,layerName:l.id,layerUID:r}});return n.layer=this.layer,n.sourceLayer=this.layer,[n]}update(e){if(this._tileHandlerPromise&&this._isTileHandlerReady)return e.pixelRatio!==this._tileHandler.devicePixelRatio?(this._start(),void(this._tileHandler.devicePixelRatio=e.pixelRatio)):void(this._styleChanges.length>0?this._tileHandlerPromise=this._applyStyleChanges():(this._fetchQueue.pause(),this._parseQueue.pause(),this._fetchQueue.state=e.state,this._parseQueue.state=e.state,this._tileManager.update(e)||this.requestUpdate(),this._parseQueue.resume(),this._fetchQueue.resume()))}attach(){this._start(),this.handles.add([this.layer.on("paint-change",(e=>{if(e.isDataDriven)this._styleChanges.push({type:d.PAINTER_CHANGED,data:e}),this.notifyChange("updating"),this.requestUpdate();else{const t=this._styleRepository,i=t.getLayerById(e.layer);if(!i)return;const s=i.type===T.SYMBOL;t.setPaintProperties(e.layer,e.paint),s&&this._vectorTileContainer.restartDeclutter(),this._vectorTileContainer.requestRender()}})),this.layer.on("layout-change",(e=>{const t=this._styleRepository,i=t.getLayerById(e.layer);if(!i)return;const s=u(i.layout,e.layout);if(!a(s)){if(c(s,"visibility")&&1===j(s))return t.setLayoutProperties(e.layer,e.layout),i.type===T.SYMBOL&&this._vectorTileContainer.restartDeclutter(),void this._vectorTileContainer.requestRender();this._styleChanges.push({type:d.LAYOUT_CHANGED,data:e}),this.notifyChange("updating"),this.requestUpdate()}})),this.layer.on("style-layer-visibility-change",(e=>{const t=this._styleRepository,i=t.getLayerById(e.layer);i&&(t.setStyleLayerVisibility(e.layer,e.visibility),i.type===T.SYMBOL&&this._vectorTileContainer.restartDeclutter(),this._vectorTileContainer.requestRender())})),this.layer.on("style-layer-change",(e=>{this._styleChanges.push({type:d.LAYER_CHANGED,data:e}),this.notifyChange("updating"),this.requestUpdate()})),this.layer.on("delete-style-layer",(e=>{this._styleChanges.push({type:d.LAYER_REMOVED,data:e}),this.notifyChange("updating"),this.requestUpdate()})),this.layer.on("load-style",(()=>this._loadStyle()))],this.declaredClass)}detach(){this._stop(),this.handles.remove(this.declaredClass)}moveStart(){this.requestUpdate()}viewChange(){this.requestUpdate()}moveEnd(){this._collisionBoxesDisplay&&this._vectorTileContainer.restartDeclutter(),this.requestUpdate()}canResume(){let e=super.canResume();const t=this.layer;if(e&&t.currentStyleInfo){const i=this.view.scale,s=t.currentStyleInfo;if(s&&s.layerDefinition){const t=s.layerDefinition;t.minScale&&t.minScale<i&&(e=!1),t.maxScale&&t.maxScale>i&&(e=!1)}}return e}isUpdating(){const e=this._vectorTileContainer.children;return!this._isTileHandlerReady||!this._fetchQueue||!this._parseQueue||this._fetchQueue.updating||this._parseQueue.updating||e.length>0&&e.filter((e=>e.invalidating)).length>0||this.fading}acquireTile(e){const t=this._createVectorTile(e);return this._tileHandlerPromise.then((()=>{this._fetchQueue.push(t.key).then((e=>this._parseQueue.push({key:t.key,data:e}))).then((e=>{t.once("attach",(()=>this.requestUpdate())),t.setData(e),this.requestUpdate(),this.notifyChange("updating")})).catch((e=>{this.notifyChange("updating"),l(e)||D.error(e)}))})),t}releaseTile(e){const t=e.key.id;this._fetchQueue.abort(t),this._parseQueue.abort(t),this.requestUpdate()}_start(){if(this._stop(),this._tileManager=new _({acquireTile:e=>this.acquireTile(e),releaseTile:e=>this.releaseTile(e),tileInfoView:this._tileInfoView},this._vectorTileContainer),!this.layer.currentStyleInfo)return;const e=new AbortController,t=this._tileHandler.start({signal:e.signal}).then((()=>{this._fetchQueue=new H({tileInfoView:this._tileInfoView,process:(e,t)=>this._getTileData(e,t),concurrency:15}),this._parseQueue=new H({tileInfoView:this._tileInfoView,process:(e,t)=>this._parseTileData(e,t),concurrency:8}),this.requestUpdate(),this._isTileHandlerReady=!0}));this._tileHandler.spriteMosaic.then((e=>{this._vectorTileContainer.setStyleResources(e,this._tileHandler.glyphMosaic,this._styleRepository),this.requestUpdate()})),this._tileHandlerAbortController=e,this._tileHandlerPromise=t}_stop(){if(!this._tileHandlerAbortController||!this._vectorTileContainer)return;const e=this._tileHandlerAbortController;e&&e.abort(),this._tileHandlerPromise=null,this._isTileHandlerReady=!1,this._fetchQueue&&(this._fetchQueue.destroy(),this._fetchQueue=null),this._parseQueue&&(this._parseQueue.destroy(),this._parseQueue=null),this._tileManager&&(this._tileManager.destroy(),this._tileManager=null),this._vectorTileContainer.removeAllChildren()}async _getTileData(e,t){const i=await this._tileHandler.fetchTileData(e,t);return this.notifyChange("updating"),i}async _parseTileData(e,t){return this._tileHandler.parseTileData(e,t)}async _applyStyleChanges(){this._isTileHandlerReady=!1,this._fetchQueue.pause(),this._parseQueue.pause(),this._fetchQueue.clear(),this._parseQueue.clear(),this._tileManager.clearCache();const e=this._styleChanges;try{await this._tileHandler.updateStyle(e)}catch(l){D.error("error applying vector-tiles style update",l.message),this._fetchQueue.resume(),this._parseQueue.resume(),this._isTileHandlerReady=!0}const t=this._styleRepository,i=[];e.forEach((e=>{if(e.type!==d.LAYER_REMOVED)return;const s=e.data,r=t.getLayerById(s.layer);r&&i.push(r.uid)}));const s=[];let r;e.forEach((e=>{const i=e.type,a=e.data;switch(i){case d.PAINTER_CHANGED:t.setPaintProperties(a.layer,a.paint),r=a.layer;break;case d.LAYOUT_CHANGED:t.setLayoutProperties(a.layer,a.layout),r=a.layer;break;case d.LAYER_REMOVED:return void t.deleteStyleLayer(a.layer);case d.LAYER_CHANGED:t.setStyleLayer(a.layer,a.index),r=a.layer.id}const l=t.getLayerById(r);l&&s.push(l.uid)}));const a=this._vectorTileContainer.children;if(i.length>0){this._vectorTileContainer.deleteStyleLayers(i);for(const e of a)e.deleteLayerData(i)}if(this._fetchQueue.resume(),this._parseQueue.resume(),s.length>0){const e=[];for(const t of a){const i=this._fetchQueue.push(t.key).then((e=>this._parseQueue.push({key:t.key,data:e,styleLayerUIDs:s}))).then((e=>t.setData(e)));e.push(i)}await Promise.all(e)}this._styleChanges=[],this._isTileHandlerReady=!0,this.notifyChange("updating"),this.requestUpdate()}async _loadStyle(){const{style:e}=this.layer.currentStyleInfo,t=s(e);this._isTileHandlerReady=!1,this._fetchQueue.pause(),this._parseQueue.pause(),this._fetchQueue.clear(),this._parseQueue.clear(),this.notifyChange("updating"),this._styleRepository=new C(t),this._vectorTileContainer.destroy(),this._tileManager.clear(),this._tileHandlerAbortController.abort(),this._tileHandlerAbortController=new AbortController;const{signal:i}=this._tileHandlerAbortController;try{this._tileHandlerPromise=this._tileHandler.setStyle(this._styleRepository,t),await this._tileHandlerPromise}catch(a){if(!l(a))throw a}if(i.aborted)return this._fetchQueue.resume(),this._parseQueue.resume(),this._isTileHandlerReady=!0,this.notifyChange("updating"),void this.requestUpdate();const r=await this._tileHandler.spriteMosaic;this._vectorTileContainer.setStyleResources(r,this._tileHandler.glyphMosaic,this._styleRepository),this._fetchQueue.resume(),this._parseQueue.resume(),this._isTileHandlerReady=!0,this.notifyChange("updating"),this.requestUpdate()}_createVectorTile(e){const t=this._tileInfoView.getTileBounds(y(),e);return new f(e,t[0],t[3],512,512,this._styleRepository)}_renderCollisionBoxes(e){for(const t of this._vectorTileContainer.children)if(t.symbols){const i=[];for(const[e,s]of t.symbols)i.push(...s);m(e,i)}}};function j(e){if(a(e))return 0;switch(e.type){case"partial":return Object.keys(e.diff).length;case"complete":return Math.max(Object.keys(e.oldValue).length,Object.keys(e.newValue).length);case"collection":return Object.keys(e.added).length+Object.keys(e.changed).length+Object.keys(e.removed).length}}e([n()],b.prototype,"_fetchQueue",void 0),e([n()],b.prototype,"_parseQueue",void 0),e([n()],b.prototype,"_isTileHandlerReady",void 0),e([n()],b.prototype,"fading",void 0),b=e([h("esri.views.2d.layers.VectorTileLayerView2D")],b);const S=b;export{S as default};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../Graphic.js";import{clone as i}from"../../../core/lang.js";import s from"../../../core/Logger.js";import{isNone as r}from"../../../core/maybe.js";import{isAbortError as a}from"../../../core/promiseUtils.js";import{watch as l,initial as n}from"../../../core/reactiveUtils.js";import{property as o}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as h}from"../../../core/accessorSupport/decorators/subclass.js";import{diff as u,hasDiff as c}from"../../../core/accessorSupport/diffUtils.js";import{create as y}from"../../../geometry/support/aaBoundingRect.js";import{StyleUpdateType as d}from"../engine/vectorTiles/enums.js";import{TileHandler as p}from"../engine/vectorTiles/TileHandler.js";import{TileManager as _}from"../engine/vectorTiles/TileManager.js";import{VectorTile as f}from"../engine/vectorTiles/VectorTile.js";import{VectorTileContainer as g}from"../engine/vectorTiles/VectorTileContainer.js";import{drawColliders as m}from"../engine/vectorTiles/decluttering/debugging.js";import{StyleLayerType as T}from"../engine/vectorTiles/style/StyleDefinition.js";import C from"../engine/vectorTiles/style/StyleRepository.js";import{LayerView2DMixin as v}from"./LayerView2D.js";import{Display as R}from"./support/Display.js";import H from"../tiling/TileInfoViewPOT.js";import Q from"../tiling/TileQueue.js";import w from"../../layers/LayerView.js";const D=s.getLogger("esri.views.2d.layers.VectorTileLayerView2D");let b=class extends(v(w)){constructor(){super(...arguments),this._styleChanges=[],this._fetchQueue=null,this._parseQueue=null,this._isTileHandlerReady=!1,this.fading=!1}async hitTest(e,i){if(!this._tileHandlerPromise)return null;await this._tileHandlerPromise;const s=await this._vectorTileContainer.hitTest(i);if(!s||0===s.length)return null;const r=s[0]-1,a=this._styleRepository,l=a.getStyleLayerByUID(r);if(!l)return null;const n=a.getStyleLayerIndex(l.id),o=new t({attributes:{layerId:n,layerName:l.id,layerUID:r}});return o.layer=this.layer,o.sourceLayer=this.layer,[o]}update(e){if(this._tileHandlerPromise&&this._isTileHandlerReady)return e.pixelRatio!==this._tileHandler.devicePixelRatio?(this._start(),void(this._tileHandler.devicePixelRatio=e.pixelRatio)):void(this._styleChanges.length>0?this._tileHandlerPromise=this._applyStyleChanges():(this._fetchQueue.pause(),this._parseQueue.pause(),this._fetchQueue.state=e.state,this._parseQueue.state=e.state,this._tileManager.update(e)||this.requestUpdate(),this._parseQueue.resume(),this._fetchQueue.resume()))}attach(){const{style:e}=this.layer.currentStyleInfo;this._styleRepository=new C(e),this._tileInfoView=new H(this.layer.tileInfo,this.layer.fullExtent),this._vectorTileContainer=new g(this._tileInfoView),this._tileHandler=new p(this.layer,this._styleRepository,window.devicePixelRatio||1),this.container.addChild(this._vectorTileContainer),this._start(),this.handles.add([this._vectorTileContainer.on("fade-start",(()=>{this.fading=!0,this.notifyChange("updating"),this.requestUpdate()})),this._vectorTileContainer.on("fade-complete",(()=>{var e;null==(e=this._collisionBoxesDisplay)||e.requestRender(),this.fading=!1,this.notifyChange("updating"),this.requestUpdate()})),l((()=>this.layer.symbolCollisionBoxesVisible),(e=>{e?(this._collisionBoxesDisplay=new R({render:e=>this._renderCollisionBoxes(e.context)}),this.container.addChild(this._collisionBoxesDisplay)):(this.container.removeChild(this._collisionBoxesDisplay),this._collisionBoxesDisplay=null)}),n),this.layer.on("paint-change",(e=>{if(e.isDataDriven)this._styleChanges.push({type:d.PAINTER_CHANGED,data:e}),this.notifyChange("updating"),this.requestUpdate();else{const t=this._styleRepository,i=t.getLayerById(e.layer);if(!i)return;const s=i.type===T.SYMBOL;t.setPaintProperties(e.layer,e.paint),s&&this._vectorTileContainer.restartDeclutter(),this._vectorTileContainer.requestRender()}})),this.layer.on("layout-change",(e=>{const t=this._styleRepository,i=t.getLayerById(e.layer);if(!i)return;const s=u(i.layout,e.layout);if(!r(s)){if(c(s,"visibility")&&1===L(s))return t.setLayoutProperties(e.layer,e.layout),i.type===T.SYMBOL&&this._vectorTileContainer.restartDeclutter(),void this._vectorTileContainer.requestRender();this._styleChanges.push({type:d.LAYOUT_CHANGED,data:e}),this.notifyChange("updating"),this.requestUpdate()}})),this.layer.on("style-layer-visibility-change",(e=>{const t=this._styleRepository,i=t.getLayerById(e.layer);i&&(t.setStyleLayerVisibility(e.layer,e.visibility),i.type===T.SYMBOL&&this._vectorTileContainer.restartDeclutter(),this._vectorTileContainer.requestRender())})),this.layer.on("style-layer-change",(e=>{this._styleChanges.push({type:d.LAYER_CHANGED,data:e}),this.notifyChange("updating"),this.requestUpdate()})),this.layer.on("delete-style-layer",(e=>{this._styleChanges.push({type:d.LAYER_REMOVED,data:e}),this.notifyChange("updating"),this.requestUpdate()})),this.layer.on("load-style",(()=>this._loadStyle()))],this.declaredClass)}detach(){var e,t;this._stop(),this.container.removeAllChildren(),null==(e=this._vectorTileContainer)||e.destroy(),this._vectorTileContainer=null,null==(t=this._tileHandler)||t.destroy(),this._tileHandler=null,this.handles.remove(this.declaredClass)}moveStart(){this.requestUpdate()}viewChange(){this.requestUpdate()}moveEnd(){this._collisionBoxesDisplay&&this._vectorTileContainer.restartDeclutter(),this.requestUpdate()}supportsSpatialReference(e){var t;const i=null==(t=this.layer.tileInfo)?void 0:t.spatialReference;return e.equals(i)}canResume(){let e=super.canResume();const{currentStyleInfo:t}=this.layer;if(e&&null!=t&&t.layerDefinition){const i=this.view.scale,{minScale:s,maxScale:r}=t.layerDefinition;t&&t.layerDefinition&&(s&&s<i&&(e=!1),r&&r>i&&(e=!1))}return e}isUpdating(){const e=this._vectorTileContainer.children;return!this._isTileHandlerReady||!this._fetchQueue||!this._parseQueue||this._fetchQueue.updating||this._parseQueue.updating||e.length>0&&e.filter((e=>e.invalidating)).length>0||this.fading}acquireTile(e){const t=this._createVectorTile(e);return this._tileHandlerPromise.then((()=>{this._fetchQueue.push(t.key).then((e=>this._parseQueue.push({key:t.key,data:e}))).then((e=>{t.once("attach",(()=>this.requestUpdate())),t.setData(e),this.requestUpdate(),this.notifyChange("updating")})).catch((e=>{this.notifyChange("updating"),a(e)||D.error(e)}))})),t}releaseTile(e){const t=e.key.id;this._fetchQueue.abort(t),this._parseQueue.abort(t),this.requestUpdate()}_start(){if(this._stop(),this._tileManager=new _({acquireTile:e=>this.acquireTile(e),releaseTile:e=>this.releaseTile(e),tileInfoView:this._tileInfoView},this._vectorTileContainer),!this.layer.currentStyleInfo)return;const e=new AbortController,t=this._tileHandler.start({signal:e.signal}).then((()=>{this._fetchQueue=new Q({tileInfoView:this._tileInfoView,process:(e,t)=>this._getTileData(e,t),concurrency:15}),this._parseQueue=new Q({tileInfoView:this._tileInfoView,process:(e,t)=>this._parseTileData(e,t),concurrency:8}),this.requestUpdate(),this._isTileHandlerReady=!0}));this._tileHandler.spriteMosaic.then((e=>{this._vectorTileContainer.setStyleResources(e,this._tileHandler.glyphMosaic,this._styleRepository),this.requestUpdate()})),this._tileHandlerAbortController=e,this._tileHandlerPromise=t}_stop(){if(!this._tileHandlerAbortController||!this._vectorTileContainer)return;const e=this._tileHandlerAbortController;e&&e.abort(),this._tileHandlerPromise=null,this._isTileHandlerReady=!1,this._fetchQueue&&(this._fetchQueue.destroy(),this._fetchQueue=null),this._parseQueue&&(this._parseQueue.destroy(),this._parseQueue=null),this._tileManager&&(this._tileManager.destroy(),this._tileManager=null),this._vectorTileContainer.removeAllChildren()}async _getTileData(e,t){const i=await this._tileHandler.fetchTileData(e,t);return this.notifyChange("updating"),i}async _parseTileData(e,t){return this._tileHandler.parseTileData(e,t)}async _applyStyleChanges(){this._isTileHandlerReady=!1,this._fetchQueue.pause(),this._parseQueue.pause(),this._fetchQueue.clear(),this._parseQueue.clear(),this._tileManager.clearCache();const e=this._styleChanges;try{await this._tileHandler.updateStyle(e)}catch(l){D.error("error applying vector-tiles style update",l.message),this._fetchQueue.resume(),this._parseQueue.resume(),this._isTileHandlerReady=!0}const t=this._styleRepository,i=[];e.forEach((e=>{if(e.type!==d.LAYER_REMOVED)return;const s=e.data,r=t.getLayerById(s.layer);r&&i.push(r.uid)}));const s=[];let r;e.forEach((e=>{const i=e.type,a=e.data;switch(i){case d.PAINTER_CHANGED:t.setPaintProperties(a.layer,a.paint),r=a.layer;break;case d.LAYOUT_CHANGED:t.setLayoutProperties(a.layer,a.layout),r=a.layer;break;case d.LAYER_REMOVED:return void t.deleteStyleLayer(a.layer);case d.LAYER_CHANGED:t.setStyleLayer(a.layer,a.index),r=a.layer.id}const l=t.getLayerById(r);l&&s.push(l.uid)}));const a=this._vectorTileContainer.children;if(i.length>0){this._vectorTileContainer.deleteStyleLayers(i);for(const e of a)e.deleteLayerData(i)}if(this._fetchQueue.resume(),this._parseQueue.resume(),s.length>0){const e=[];for(const t of a){const i=this._fetchQueue.push(t.key).then((e=>this._parseQueue.push({key:t.key,data:e,styleLayerUIDs:s}))).then((e=>t.setData(e)));e.push(i)}await Promise.all(e)}this._styleChanges=[],this._isTileHandlerReady=!0,this.notifyChange("updating"),this.requestUpdate()}async _loadStyle(){const{style:e}=this.layer.currentStyleInfo,t=i(e);this._isTileHandlerReady=!1,this._fetchQueue.pause(),this._parseQueue.pause(),this._fetchQueue.clear(),this._parseQueue.clear(),this.notifyChange("updating"),this._styleRepository=new C(t),this._vectorTileContainer.destroy(),this._tileManager.clear(),this._tileHandlerAbortController.abort(),this._tileHandlerAbortController=new AbortController;const{signal:s}=this._tileHandlerAbortController;try{this._tileHandlerPromise=this._tileHandler.setStyle(this._styleRepository,t),await this._tileHandlerPromise}catch(l){if(!a(l))throw l}if(s.aborted)return this._fetchQueue.resume(),this._parseQueue.resume(),this._isTileHandlerReady=!0,this.notifyChange("updating"),void this.requestUpdate();const r=await this._tileHandler.spriteMosaic;this._vectorTileContainer.setStyleResources(r,this._tileHandler.glyphMosaic,this._styleRepository),this._fetchQueue.resume(),this._parseQueue.resume(),this._isTileHandlerReady=!0,this.notifyChange("updating"),this.requestUpdate()}_createVectorTile(e){const t=this._tileInfoView.getTileBounds(y(),e);return new f(e,t[0],t[3],512,512,this._styleRepository)}_renderCollisionBoxes(e){for(const t of this._vectorTileContainer.children)if(t.symbols){const i=[];for(const[e,s]of t.symbols)i.push(...s);m(e,i)}}};function L(e){if(r(e))return 0;switch(e.type){case"partial":return Object.keys(e.diff).length;case"complete":return Math.max(Object.keys(e.oldValue).length,Object.keys(e.newValue).length);case"collection":return Object.keys(e.added).length+Object.keys(e.changed).length+Object.keys(e.removed).length}}e([o()],b.prototype,"_fetchQueue",void 0),e([o()],b.prototype,"_parseQueue",void 0),e([o()],b.prototype,"_isTileHandlerReady",void 0),e([o()],b.prototype,"fading",void 0),b=e([h("esri.views.2d.layers.VectorTileLayerView2D")],b);const j=b;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.23/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Error.js";import r from"../../../core/Logger.js";import{isAbortError as i}from"../../../core/promiseUtils.js";import{property as s}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as a}from"../../../core/accessorSupport/decorators/subclass.js";import o from"../../../geometry/Extent.js";import{BitmapContainer as n}from"../engine/BitmapContainer.js";import{LayerView2DMixin as p}from"./LayerView2D.js";import m from"./support/ExportStrategy.js";import h from"../../layers/LayerView.js";import{RefreshableLayerView as c}from"../../layers/RefreshableLayerView.js";import{WMSLayerView as d}from"../../layers/WMSLayerView.js";const l=r.getLogger("esri.views.2d.layers.WMSLayerView2D");let y=class extends(d(c(p(h)))){initialize(){const{layer:e,view:r}=this;e.supportsSpatialReference(r.spatialReference)||this.addResolvingPromise(Promise.reject(new t("layerview:spatial-reference-incompatible","The spatial references supported by this WMS layer are incompatible with the spatial reference of the view",{layer:e})))}update(e){this.strategy.update(e).catch((e=>{i(e)||l.error(e)}))}attach(){const{layer:e}=this,{imageMaxHeight:t,imageMaxWidth:r}=e;this._bitmapContainer=new n,this.container.addChild(this._bitmapContainer),this.strategy=new m({container:this._bitmapContainer,fetchSource:this.fetchImage.bind(this),requestUpdate:this.requestUpdate.bind(this),imageMaxHeight:t,imageMaxWidth:r,imageRotationSupported:!1,imageNormalizationSupported:!1,hidpi:!1}),this.handles.add(this.watch("exportImageVersion",(()=>this.requestUpdate())),"exportImageVersion")}detach(){this.handles.remove("exportImageVersion"),this.strategy.destroy(),this.container.removeChild(this._bitmapContainer),this._bitmapContainer.removeAllChildren()}moveStart(){}viewChange(){}moveEnd(){this.requestUpdate()}createFetchPopupFeaturesQuery(e){const{view:t}=this,r=this._bitmapContainer,{x:i,y:s}=e,{spatialReference:a}=t;let n=null,p=0,m=0;if(r.children.some((e=>{const{width:t,height:r,resolution:h,x:c,y:d}=e,l=c+h*t,y=d-h*r;return i>=c&&i<=l&&s<=d&&s>=y&&(n=new o({xmin:c,ymin:y,xmax:l,ymax:d,spatialReference:a}),p=t,m=r,!0)})),!n)return null;const h=n.width/p,c=Math.round((i-n.xmin)/h),d=Math.round((n.ymax-s)/h);return{extent:n,width:p,height:m,x:c,y:d}}async doRefresh(){this.requestUpdate()}isUpdating(){return this.strategy.updating||this.updateRequested}fetchImage(e,t,r,i){return this.layer.fetchImage(e,t,r,{timeExtent:this.timeExtent,...i})}};e([s()],y.prototype,"strategy",void 0),e([s()],y.prototype,"updating",void 0),y=e([a("esri.views.2d.layers.WMSLayerView2D")],y);const u=y;export{u as default};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Logger.js";import{isAbortError as r}from"../../../core/promiseUtils.js";import{property as i}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as s}from"../../../core/accessorSupport/decorators/subclass.js";import a from"../../../geometry/Extent.js";import{BitmapContainer as o}from"../engine/BitmapContainer.js";import{LayerView2DMixin as n}from"./LayerView2D.js";import p from"./support/ExportStrategy.js";import m from"../../layers/LayerView.js";import{RefreshableLayerView as h}from"../../layers/RefreshableLayerView.js";import{WMSLayerView as d}from"../../layers/WMSLayerView.js";const c=t.getLogger("esri.views.2d.layers.WMSLayerView2D");let u=class extends(d(h(n(m)))){supportsSpatialReference(e){return this.layer.supportsSpatialReference(e)}update(e){this.strategy.update(e).catch((e=>{r(e)||c.error(e)}))}attach(){const{layer:e}=this,{imageMaxHeight:t,imageMaxWidth:r}=e;this._bitmapContainer=new o,this.container.addChild(this._bitmapContainer),this.strategy=new p({container:this._bitmapContainer,fetchSource:this.fetchImage.bind(this),requestUpdate:this.requestUpdate.bind(this),imageMaxHeight:t,imageMaxWidth:r,imageRotationSupported:!1,imageNormalizationSupported:!1,hidpi:!1}),this.handles.add(this.watch("exportImageVersion",(()=>this.requestUpdate())),"exportImageVersion")}detach(){this.handles.remove("exportImageVersion"),this.strategy.destroy(),this.container.removeChild(this._bitmapContainer),this._bitmapContainer.removeAllChildren()}moveStart(){}viewChange(){}moveEnd(){this.requestUpdate()}createFetchPopupFeaturesQuery(e){const{view:t}=this,r=this._bitmapContainer,{x:i,y:s}=e,{spatialReference:o}=t;let n=null,p=0,m=0;if(r.children.some((e=>{const{width:t,height:r,resolution:h,x:d,y:c}=e,u=d+h*t,l=c-h*r;return i>=d&&i<=u&&s<=c&&s>=l&&(n=new a({xmin:d,ymin:l,xmax:u,ymax:c,spatialReference:o}),p=t,m=r,!0)})),!n)return null;const h=n.width/p,d=Math.round((i-n.xmin)/h),c=Math.round((n.ymax-s)/h);return{extent:n,width:p,height:m,x:d,y:c}}async doRefresh(){this.requestUpdate()}isUpdating(){return this.strategy.updating||this.updateRequested}fetchImage(e,t,r,i){return this.layer.fetchImage(e,t,r,{timeExtent:this.timeExtent,...i})}};e([i()],u.prototype,"strategy",void 0),e([i()],u.prototype,"updating",void 0),u=e([s("esri.views.2d.layers.WMSLayerView2D")],u);const l=u;export{l as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Logger.js";import{isAbortError as i}from"../../../core/promiseUtils.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 r}from"../../../core/accessorSupport/decorators/subclass.js";import{BitmapTileLayerView2D as a}from"./BitmapTileLayerView2D.js";import{LayerView2DMixin as l}from"./LayerView2D.js";import{resampleImage as h}from"./support/imageUtils.js";import o from"../tiling/TileInfoView.js";import n from"../tiling/TileKey.js";import c from"../tiling/TileQueue.js";import u from"../tiling/TileStrategy.js";import f from"../../layers/LayerView.js";import{RefreshableLayerView as p}from"../../layers/RefreshableLayerView.js";const d=[102113,102100,3857,3785,900913],y=[0,0],m=t.getLogger("esri.views.2d.layers.WMTSLayerView2D");let w=class extends(p(a(l(f)))){constructor(){super(...arguments),this._tileStrategy=null,this._fetchQueue=null,this._tileRequests=new Map,this.layer=null}get tileMatrixSet(){if(this.layer.activeLayer.tileMatrixSetId)return this.layer.activeLayer.tileMatrixSet;const e=this._getTileMatrixSetBySpatialReference(this.layer.activeLayer);return e?(this.layer.activeLayer.tileMatrixSetId=e.id,e):null}update(e){this._fetchQueue.pause(),this._fetchQueue.state=e.state,this._tileStrategy.update(e),this._fetchQueue.resume(),this.notifyChange("updating")}attach(){if(!this.tileMatrixSet)return;const{tileInfo:e}=this.tileMatrixSet;this._tileInfoView=new o(e),this._fetchQueue=new c({tileInfoView:this._tileInfoView,concurrency:16,process:(e,t)=>this.fetchTile(e,t)}),this._tileStrategy=new u({cachePolicy:"keep",resampling:!0,acquireTile:e=>this.acquireTile(e),releaseTile:e=>this.releaseTile(e),tileInfoView:this._tileInfoView}),this.handles.add(this.watch(["layer.activeLayer.styleId","tileMatrixSet"],(()=>this._refresh())),this.declaredClass),super.attach()}detach(){var e,t;super.detach(),this.handles.remove(this.declaredClass),null==(e=this._tileStrategy)||e.destroy(),null==(t=this._fetchQueue)||t.destroy(),this._fetchQueue=this._tileStrategy=this._tileInfoView=null}moveStart(){this.requestUpdate()}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}releaseTile(e){this._fetchQueue.abort(e.key.id),this._bitmapView.removeChild(e),e.once("detach",(()=>e.destroy())),this.requestUpdate()}acquireTile(e){const t=this._bitmapView.createTile(e),i=t.bitmap;return[i.x,i.y]=this._tileInfoView.getTileCoords(y,t.key),i.resolution=this._tileInfoView.getTileResolution(t.key),[i.width,i.height]=this._tileInfoView.tileInfo.size,this._enqueueTileFetch(t),this._bitmapView.addChild(t),this.requestUpdate(),t}async doRefresh(){this.updateRequested||this.suspended||this._refresh()}isUpdating(){return this._fetchQueue.length>0}async fetchTile(e,t={}){const s="tilemapCache"in this.layer?this.layer.tilemapCache:null,{signal:r,resamplingLevel:a=0}=t;if(!s)return this._fetchImage(e,r);const l=new n(0,0,0,0);let o;try{await s.fetchAvailabilityUpsample(e.level,e.row,e.col,l,{signal:r}),o=await this._fetchImage(l,r)}catch(c){if(i(c))throw c;if(a<3){const i=this._tileInfoView.getTileParentId(e.id);if(i){const s=new n(i),r=await this.fetchTile(s,{...t,resamplingLevel:a+1});return h(this._tileInfoView,r,s,e)}}throw c}return h(this._tileInfoView,o,l,e)}canResume(){const e=super.canResume();return e?null!==this.tileMatrixSet:e}async _enqueueTileFetch(e){if(!this._fetchQueue.has(e.key.id)){try{const t=await this._fetchQueue.push(e.key);e.bitmap.source=t,e.bitmap.width=this._tileInfoView.tileInfo.size[0],e.bitmap.height=this._tileInfoView.tileInfo.size[1],e.once("attach",(()=>this.requestUpdate()))}catch(t){i(t)||m.error(t)}this.requestUpdate()}}async _fetchImage(e,t){return this.layer.fetchTile(e.level,e.row,e.col,{signal:t})}_refresh(){this._fetchQueue.reset(),this._tileStrategy.tiles.forEach((e=>{if(!e.bitmap.source)return;const t={id:e.key.id,fulfilled:!1,promise:this._fetchQueue.push(e.key).then((t=>{e.bitmap.source=t})).catch((t=>{i(t)||(e.bitmap.source=null)})).finally((()=>{e.requestRender(),this.notifyChange("updating"),t.fulfilled=!0}))};this._tileRequests.set(e,t)})),this.notifyChange("updating")}_getTileMatrixSetBySpatialReference(e){const t=this.view.spatialReference;if(!e.tileMatrixSets)return null;let i=e.tileMatrixSets.find((e=>e.tileInfo.spatialReference.wkid===t.wkid));return!i&&t.isWebMercator&&(i=e.tileMatrixSets.find((e=>d.indexOf(e.tileInfo.spatialReference.wkid)>-1))),i}};e([s()],w.prototype,"suspended",void 0),e([s({readOnly:!0})],w.prototype,"tileMatrixSet",null),w=e([r("esri.views.2d.layers.WMTSLayerView2D")],w);const _=w;export{_ as default};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Logger.js";import{isAbortError as i}from"../../../core/promiseUtils.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 r}from"../../../core/accessorSupport/decorators/subclass.js";import{BitmapTileLayerView2D as a}from"./BitmapTileLayerView2D.js";import{LayerView2DMixin as l}from"./LayerView2D.js";import{resampleImage as h}from"./support/imageUtils.js";import o from"../tiling/TileInfoView.js";import n from"../tiling/TileKey.js";import c from"../tiling/TileQueue.js";import u from"../tiling/TileStrategy.js";import f from"../../layers/LayerView.js";import{RefreshableLayerView as p}from"../../layers/RefreshableLayerView.js";const d=[102113,102100,3857,3785,900913],y=[0,0],m=t.getLogger("esri.views.2d.layers.WMTSLayerView2D");let w=class extends(p(a(l(f)))){constructor(){super(...arguments),this._tileStrategy=null,this._fetchQueue=null,this._tileRequests=new Map,this.layer=null}get tileMatrixSet(){if(this.layer.activeLayer.tileMatrixSetId)return this.layer.activeLayer.tileMatrixSet;const e=this._getTileMatrixSetBySpatialReference(this.layer.activeLayer);return e?(this.layer.activeLayer.tileMatrixSetId=e.id,e):null}update(e){this._fetchQueue.pause(),this._fetchQueue.state=e.state,this._tileStrategy.update(e),this._fetchQueue.resume(),this.notifyChange("updating")}attach(){if(!this.tileMatrixSet)return;const{tileInfo:e}=this.tileMatrixSet;this._tileInfoView=new o(e),this._fetchQueue=new c({tileInfoView:this._tileInfoView,concurrency:16,process:(e,t)=>this.fetchTile(e,t)}),this._tileStrategy=new u({cachePolicy:"keep",resampling:!0,acquireTile:e=>this.acquireTile(e),releaseTile:e=>this.releaseTile(e),tileInfoView:this._tileInfoView}),this.handles.add(this.watch(["layer.activeLayer.styleId","tileMatrixSet"],(()=>this._refresh())),this.declaredClass),super.attach()}detach(){var e,t;super.detach(),this.handles.remove(this.declaredClass),null==(e=this._tileStrategy)||e.destroy(),null==(t=this._fetchQueue)||t.destroy(),this._fetchQueue=this._tileStrategy=this._tileInfoView=null}moveStart(){this.requestUpdate()}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}releaseTile(e){this._fetchQueue.abort(e.key.id),this._bitmapView.removeChild(e),e.once("detach",(()=>e.destroy())),this.requestUpdate()}acquireTile(e){const t=this._bitmapView.createTile(e),i=t.bitmap;return[i.x,i.y]=this._tileInfoView.getTileCoords(y,t.key),i.resolution=this._tileInfoView.getTileResolution(t.key),[i.width,i.height]=this._tileInfoView.tileInfo.size,this._enqueueTileFetch(t),this._bitmapView.addChild(t),this.requestUpdate(),t}async doRefresh(){this.updateRequested||this.suspended||this._refresh()}isUpdating(){return this._fetchQueue.length>0}async fetchTile(e,t={}){const s="tilemapCache"in this.layer?this.layer.tilemapCache:null,{signal:r,resamplingLevel:a=0}=t;if(!s)return this._fetchImage(e,r);const l=new n(0,0,0,0);let o;try{await s.fetchAvailabilityUpsample(e.level,e.row,e.col,l,{signal:r}),o=await this._fetchImage(l,r)}catch(c){if(i(c))throw c;if(a<3){const i=this._tileInfoView.getTileParentId(e.id);if(i){const s=new n(i),r=await this.fetchTile(s,{...t,resamplingLevel:a+1});return h(this._tileInfoView,r,s,e)}}throw c}return h(this._tileInfoView,o,l,e)}canResume(){const e=super.canResume();return e?null!==this.tileMatrixSet:e}async _enqueueTileFetch(e){if(!this._fetchQueue.has(e.key.id)){try{const t=await this._fetchQueue.push(e.key);e.bitmap.source=t,e.bitmap.width=this._tileInfoView.tileInfo.size[0],e.bitmap.height=this._tileInfoView.tileInfo.size[1],e.once("attach",(()=>this.requestUpdate()))}catch(t){i(t)||m.error(t)}this.requestUpdate()}}async _fetchImage(e,t){return this.layer.fetchTile(e.level,e.row,e.col,{signal:t})}_refresh(){this._fetchQueue.reset(),this._tileStrategy.tiles.forEach((e=>{if(!e.bitmap.source)return;const t={id:e.key.id,fulfilled:!1,promise:this._fetchQueue.push(e.key).then((t=>{e.bitmap.source=t})).catch((t=>{i(t)||(e.bitmap.source=null)})).finally((()=>{e.requestRender(),this.notifyChange("updating"),t.fulfilled=!0}))};this._tileRequests.set(e,t)})),this.notifyChange("updating")}_getTileMatrixSetBySpatialReference(e){const t=this.view.spatialReference;if(!e.tileMatrixSets)return null;let i=e.tileMatrixSets.find((e=>e.tileInfo.spatialReference.wkid===t.wkid));return!i&&t.isWebMercator&&(i=e.tileMatrixSets.find((e=>d.indexOf(e.tileInfo.spatialReference.wkid)>-1))),i}};e([s({readOnly:!0})],w.prototype,"tileMatrixSet",null),w=e([r("esri.views.2d.layers.WMTSLayerView2D")],w);const _=w;export{_ as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
4
  */
5
- import t from"../../../../../core/Error.js";import e from"../../../../../core/has.js";import i from"../../../../../core/Logger.js";import{clamp as s}from"../../../../../core/mathUtils.js";import{isNone as r,isSome as a,mapMany as o,forEachSome as n,andThen as l,unwrap as h}from"../../../../../core/maybe.js";import{createResolver as c,isAbortError as u}from"../../../../../core/promiseUtils.js";import{diff as d}from"../../../../../core/accessorSupport/diffUtils.js";import p from"../../../../../layers/support/FieldsIndex.js";import{MAX_FILTERS as _,HIGHLIGHT_FLAG as g,ATTRIBUTE_DATA_VV as f,NAN_MAGIC_NUMBER as m,ATTRIBUTE_DATA_ANIMATION as y}from"../../../engine/webgl/definitions.js";import{DISPLAY_ID_TYPE_AGGREGATE as x,DISPLAY_ID_TYPE_FEATURE as b,getDisplayIdTexel as T,getDisplayIdType as z,getDisplayIdFilterMask as S}from"../../../engine/webgl/DisplayId.js";import{getPixelArrayCtor as w}from"../../../engine/webgl/Utils.js";import{createDebugLogger as A,DEBUG_ATTR_UPDATES as E}from"../../../engine/webgl/util/debug.js";import{getVisualVariableSizeValueRepresentationRatio as D}from"../tileRenderers/support/visualVariablesUtils.js";import{PixelType as k}from"../../../../webgl/enums.js";const U=i.getLogger("esri.views.layers.2d.features.support.AttributeStore"),F=A(E,U),B={sharedArrayBuffer:e("esri-shared-array-buffer"),atomics:e("esri-atomics")};function C(t,e){return i=>e(t(i))}class R{constructor(t,e,i,s){this.size=0,this.texelSize=4;const{pixelType:r,layout:a,textureOnly:o}=s;this.textureOnly=o||!1,this.pixelType=r,this._ctype=e,this.layout=a,this._resetRange(),this._shared=t,this.size=i,o||(this.data=this._initData(r,i,t,e))}get buffer(){return l(this.data,(t=>t.buffer))}unsetComponentAllTexels(t,e){const i=h(this.data);for(let s=0;s<this.size*this.size;s++)i[s*this.texelSize+t]&=~e;this.dirtyStart=0,this.dirtyEnd=this.size*this.size-1}setComponentAllTexels(t,e){const i=h(this.data);for(let s=0;s<this.size*this.size;s++)i[s*this.texelSize+t]|=255&e;this.dirtyStart=0,this.dirtyEnd=this.size*this.size-1}setComponent(t,e,i){const s=h(this.data);for(const r of i)s[r*this.texelSize+t]|=e,this.dirtyStart=Math.min(this.dirtyStart,r),this.dirtyEnd=Math.max(this.dirtyEnd,r)}setComponentTexel(t,e,i){h(this.data)[i*this.texelSize+t]|=e,this.dirtyStart=Math.min(this.dirtyStart,i),this.dirtyEnd=Math.max(this.dirtyEnd,i)}unsetComponentTexel(t,e,i){h(this.data)[i*this.texelSize+t]&=~e,this.dirtyStart=Math.min(this.dirtyStart,i),this.dirtyEnd=Math.max(this.dirtyEnd,i)}getData(t,e){const i=T(t);return h(this.data)[i*this.texelSize+e]}setData(t,e,i){const s=T(t),r=1<<e;0!=(this.layout&r)?(this.data[s*this.texelSize+e]=i,this.dirtyStart=Math.min(this.dirtyStart,s),this.dirtyEnd=Math.max(this.dirtyEnd,s)):U.error("mapview-attributes-store","Tried to set a value for a texel's readonly component")}lock(){this.pixelType===k.UNSIGNED_BYTE&&this._shared&&B.atomics&&"local"!==this._ctype&&Atomics.store(this.data,0,1)}unlock(){this.pixelType===k.UNSIGNED_BYTE&&this._shared&&B.atomics&&"local"!==this._ctype&&Atomics.store(this.data,0,0)}expand(t){if(this.size=t,!this.textureOnly){const e=this._initData(this.pixelType,t,this._shared,this._ctype),i=h(this.data);e.set(i),this.data=e}}toMessage(){const t=this.dirtyStart,e=this.dirtyEnd,i=this.texelSize;if(t>e)return null;this._resetRange();const s=!(this._shared||"local"===this._ctype),r=this.pixelType,a=this.layout,o=h(this.data);return{start:t,end:e,data:s&&o.slice(t*i,(e+1)*i)||null,pixelType:r,layout:a}}_initData(t,e,i,s){const r=i&&"local"!==s?SharedArrayBuffer:ArrayBuffer,a=w(t),o=new a(new r(e*e*4*a.BYTES_PER_ELEMENT));for(let n=0;n<o.length;n+=4)o[n+1]=255;return o}_resetRange(){this.dirtyStart=2147483647,this.dirtyEnd=0}}class M{constructor(t,e){this._client=t,this.config=e,this._attributeComputeMap=new Map,this._blocks=new Array,this._filters=new Array(_),this._targetType=0,this._abortController=new AbortController,this._hasScaleExpr=!1,this._size=32,this._idsToHighlight=new Set;const i=e.supportsTextureFloat?k.FLOAT:k.UNSIGNED_BYTE;F(`Creating AttributeStore ${B.sharedArrayBuffer?"with":"without"} shared memory`),this._blockDescriptors=[{pixelType:k.UNSIGNED_BYTE,layout:1},{pixelType:k.UNSIGNED_BYTE,layout:15,textureOnly:!0},{pixelType:i,layout:15},{pixelType:i,layout:15}],this._blocks=this._blockDescriptors.map((()=>null))}destroy(){this._abortController.abort()}get hasScaleExpr(){return this._hasScaleExpr}get _signal(){return this._abortController.signal}update(t,i){this.config=i;const s=i.schema.processors[0].storage,o=d(this._schema,s);if((t.targets.feature||t.targets.aggregate)&&(t.storage.data=!0),o&&(e("esri-2d-update-debug")&&console.debug("Applying Update - AttributeStore:",o),t.storage.data=!0,this._schema=s,this._attributeComputeMap.clear(),!r(s))){switch(s.target){case"feature":this._targetType=b;break;case"aggregate":this._targetType=x}if("subtype"===s.type)for(const t in s.mapping){const e=s.mapping[t];if(a(e))for(const t of e.mapping)this._bindAttribute(t)}else for(const t of s.mapping)this._bindAttribute(t)}}onTileData(t,e){if(r(e.addOrUpdate))return;const i=e.addOrUpdate.getCursor();for(;i.next();){const t=i.getDisplayId();this.setAttributeData(t,i)}}invalidateResources(){this._createResourcesPromise=null,this._abortController.abort(),this._abortController=new AbortController}async setHighlight(t,e){const i=1,s=this._getBlock(0),r=e.map((t=>T(t)));s.lock(),s.unsetComponentAllTexels(0,i),s.setComponent(0,i,r),s.unlock(),this._idsToHighlight.clear();for(const a of t)this._idsToHighlight.add(a);await this.sendUpdates()}async updateFilters(t,i){const{config:s,service:r,spatialReference:a}=i,{filters:o}=s,n=o.map(((t,e)=>this._updateFilter(t,e,r,a)));(await Promise.all(n)).some((t=>t))&&(t.storage.filters=!0,e("esri-2d-update-debug")&&console.debug("Applying Update - AttributeStore:","Filters changed"))}setData(t,e,i,s){const r=T(t);this._ensureSizeForTexel(r),this._getBlock(e).setData(t,i,s)}getData(t,e,i){return this._getBlock(e).getData(t,i)}getHighlightFlag(t){return this._idsToHighlight.has(t)?g:0}unsetAttributeData(t){const e=T(t);this._getBlock(0).setData(e,0,0)}setAttributeData(t,e){const i=T(t);if(this._ensureSizeForTexel(i),this._getBlock(0).setData(i,0,this.getFilterFlags(e)),this._targetType!==z(t))return;const r=this._attributeComputeMap,a=this.config.supportsTextureFloat?1:2,o=4;r.size&&r.forEach(((t,r)=>{const n=r*a%o,l=Math.floor(r*a/o),h=this._getBlock(l+f),c=t(e);if(this.config.supportsTextureFloat)h.setData(i,n,c);else if(c===m)h.setData(i,n,255),h.setData(i,n+1,255);else{const t=s(Math.round(c),-32767,32766)+32768,e=255&t,r=(65280&t)>>8;h.setData(i,n,e),h.setData(i,n+1,r)}}))}sendUpdates(){if(this._nextUpdate)return this._nextUpdate.promise;if(this._currUpdate)return this._nextUpdate=c(),this._nextUpdate.promise;const e={blocks:this._blocks.map((t=>a(t)?t.toMessage():null))};return this._currUpdate=this._createResources().then((()=>{const t=()=>{if(this._currUpdate=null,this._nextUpdate){const t=this._nextUpdate;this._nextUpdate=null,this.sendUpdates().then((()=>t.resolve()))}},i=this._client.update(e,this._signal).then(t).catch(t);return this._client.render(this._signal),i})).catch((e=>u(e)?(this._createResourcesPromise=null,this._createResources()):(U.error(new t("mapview-attribute-store","Encountered an error during client update",e)),Promise.resolve()))),this._currUpdate}_ensureSizeForTexel(t){for(;t>=this._size*this._size;)if(this._expand())return}_bindAttribute(t){function e(){return t.normalizationField?e=>{const i=e.readAttribute(t.normalizationField);if(!i)return null;return e.readAttribute(t.field)/i}:e=>e.readAttribute(t.field)}function i(){return t.normalizationField&&U.warn("mapview-arcade","Ignoring normalizationField specified with an arcade expression which is not supported."),e=>e.getComputedNumericAtIndex(t.fieldIndex)}let s;if(null!=t.fieldIndex)s=i();else{if(!t.field)return;s=e()}if(t.valueRepresentation){s=C(s,(e=>D(e,t.valueRepresentation)))}const r=t=>null===t||isNaN(t)||t===1/0?m:t;this._attributeComputeMap.set(t.binding,C(s,r))}_createResources(){if(a(this._createResourcesPromise))return this._createResourcesPromise;this._getBlock(y),F("Initializing AttributeStore");const e={shared:B.sharedArrayBuffer&&!("local"===this._client.type),size:this._size,blocks:o(this._blocks,(t=>({textureOnly:t.textureOnly,buffer:t.buffer,pixelType:t.pixelType})))},i=this._client.initialize(e,this._signal).catch((e=>{u(e)?this._createResourcesPromise=null:U.error(new t("mapview-attribute-store","Encountered an error during client initialization",e))}));return this._createResourcesPromise=i,i.then((()=>r(this._createResourcesPromise)?this._createResources():void 0)),i}_getBlock(t){const e=this._blocks[t];if(a(e))return e;F(`Initializing AttributeBlock at index ${t}`);const i=B.sharedArrayBuffer,s=this._client.type,r=new R(i,s,this._size,this._blockDescriptors[t]);return this._blocks[t]=r,this._createResourcesPromise=null,r}_expand(){if(this._size<this.config.maxTextureSize){const t=this._size<<=1;return F("Expanding block size to",t,this._blocks),n(this._blocks,(e=>e.expand(t))),this._createResourcesPromise=null,this._size=t,0}return U.error(new t("mapview-limitations","Maximum number of onscreen features exceeded.")),-1}async _updateFilter(t,e,i,s){const o=this._filters[e],n=a(o)&&o.hash;if(!o&&!t)return!1;if(n===JSON.stringify(t))return!1;if(r(t)){if(!o)return!1;const t=1<<e+1,i=this._getBlock(0);return this._filters[e]=null,i.setComponentAllTexels(0,t),this.sendUpdates(),!0}const l=await this._getFilter(e,i);return await l.update(t,s),!0}async _getFilter(t,e){const i=this._filters[t];if(a(i))return i;const{default:s}=await import("./FeatureFilter.js"),r=new s({geometryType:e.geometryType,hasM:!1,hasZ:!1,timeInfo:e.timeInfo,fieldsIndex:new p(e.fields)});return this._filters[t]=r,r}isVisible(t){return!!(2&this._getBlock(0).getData(t,0))}getFilterFlags(t){let e=0;const i=S(t.getDisplayId());for(let a=0;a<this._filters.length;a++){const s=!!(i&1<<a),o=this._filters[a];e|=(!s||r(o)||o.check(t)?1:0)<<a}let s=0;if(this._idsToHighlight.size){const e=t.getObjectId();s=this.getHighlightFlag(e)}return e<<1|s}}export{M as default};
5
+ import t from"../../../../../core/Error.js";import e from"../../../../../core/has.js";import i from"../../../../../core/Logger.js";import{clamp as s}from"../../../../../core/mathUtils.js";import{isNone as r,isSome as a,mapMany as o,forEachSome as n,andThen as l,unwrap as h}from"../../../../../core/maybe.js";import{createResolver as c,isAbortError as u}from"../../../../../core/promiseUtils.js";import{diff as d}from"../../../../../core/accessorSupport/diffUtils.js";import p from"../../../../../layers/support/FieldsIndex.js";import{MAX_FILTERS as _,HIGHLIGHT_FLAG as g,ATTRIBUTE_DATA_VV as f,NAN_MAGIC_NUMBER as m,ATTRIBUTE_DATA_ANIMATION as y}from"../../../engine/webgl/definitions.js";import{DISPLAY_ID_TYPE_AGGREGATE as x,DISPLAY_ID_TYPE_FEATURE as b,getDisplayIdTexel as T,getDisplayIdType as z,getDisplayIdFilterMask as S}from"../../../engine/webgl/DisplayId.js";import{getPixelArrayCtor as w}from"../../../engine/webgl/Utils.js";import{createDebugLogger as A,DEBUG_ATTR_UPDATES as E}from"../../../engine/webgl/util/debug.js";import{getVisualVariableSizeValueRepresentationRatio as D}from"../tileRenderers/support/visualVariablesUtils.js";import{PixelType as k}from"../../../../webgl/enums.js";const U=i.getLogger("esri.views.layers.2d.features.support.AttributeStore"),F=A(E,U),B={sharedArrayBuffer:e("esri-shared-array-buffer"),atomics:e("esri-atomics")};function C(t,e){return i=>e(t(i))}class R{constructor(t,e,i,s){this.size=0,this.texelSize=4;const{pixelType:r,layout:a,textureOnly:o}=s;this.textureOnly=o||!1,this.pixelType=r,this._ctype=e,this.layout=a,this._resetRange(),this._shared=t,this.size=i,o||(this.data=this._initData(r,i,t,e))}get buffer(){return l(this.data,(t=>t.buffer))}unsetComponentAllTexels(t,e){const i=h(this.data);for(let s=0;s<this.size*this.size;s++)i[s*this.texelSize+t]&=~e;this.dirtyStart=0,this.dirtyEnd=this.size*this.size-1}setComponentAllTexels(t,e){const i=h(this.data);for(let s=0;s<this.size*this.size;s++)i[s*this.texelSize+t]|=255&e;this.dirtyStart=0,this.dirtyEnd=this.size*this.size-1}setComponent(t,e,i){const s=h(this.data);for(const r of i)s[r*this.texelSize+t]|=e,this.dirtyStart=Math.min(this.dirtyStart,r),this.dirtyEnd=Math.max(this.dirtyEnd,r)}setComponentTexel(t,e,i){h(this.data)[i*this.texelSize+t]|=e,this.dirtyStart=Math.min(this.dirtyStart,i),this.dirtyEnd=Math.max(this.dirtyEnd,i)}unsetComponentTexel(t,e,i){h(this.data)[i*this.texelSize+t]&=~e,this.dirtyStart=Math.min(this.dirtyStart,i),this.dirtyEnd=Math.max(this.dirtyEnd,i)}getData(t,e){const i=T(t);return h(this.data)[i*this.texelSize+e]}setData(t,e,i){const s=T(t),r=1<<e;0!=(this.layout&r)?(this.data[s*this.texelSize+e]=i,this.dirtyStart=Math.min(this.dirtyStart,s),this.dirtyEnd=Math.max(this.dirtyEnd,s)):U.error("mapview-attributes-store","Tried to set a value for a texel's readonly component")}lock(){this.pixelType===k.UNSIGNED_BYTE&&this._shared&&B.atomics&&"local"!==this._ctype&&Atomics.store(this.data,0,1)}unlock(){this.pixelType===k.UNSIGNED_BYTE&&this._shared&&B.atomics&&"local"!==this._ctype&&Atomics.store(this.data,0,0)}expand(t){if(this.size=t,!this.textureOnly){const e=this._initData(this.pixelType,t,this._shared,this._ctype),i=h(this.data);e.set(i),this.data=e}}toMessage(){const t=this.dirtyStart,e=this.dirtyEnd,i=this.texelSize;if(t>e)return null;this._resetRange();const s=!(this._shared||"local"===this._ctype),r=this.pixelType,a=this.layout,o=h(this.data);return{start:t,end:e,data:s&&o.slice(t*i,(e+1)*i)||null,pixelType:r,layout:a}}_initData(t,e,i,s){const r=i&&"local"!==s?SharedArrayBuffer:ArrayBuffer,a=w(t),o=new a(new r(e*e*4*a.BYTES_PER_ELEMENT));for(let n=0;n<o.length;n+=4)o[n+1]=255;return o}_resetRange(){this.dirtyStart=2147483647,this.dirtyEnd=0}}class M{constructor(t,e){this._client=t,this.config=e,this._attributeComputeMap=new Map,this._blocks=new Array,this._filters=new Array(_),this._targetType=0,this._abortController=new AbortController,this._hasScaleExpr=!1,this._size=32,this._idsToHighlight=new Set;const i=e.supportsTextureFloat?k.FLOAT:k.UNSIGNED_BYTE;F(`Creating AttributeStore ${B.sharedArrayBuffer?"with":"without"} shared memory`),this._blockDescriptors=[{pixelType:k.UNSIGNED_BYTE,layout:1},{pixelType:k.UNSIGNED_BYTE,layout:15,textureOnly:!0},{pixelType:i,layout:15},{pixelType:i,layout:15}],this._blocks=this._blockDescriptors.map((()=>null))}destroy(){this._abortController.abort()}get hasScaleExpr(){return this._hasScaleExpr}get _signal(){return this._abortController.signal}get hasHighlight(){return this._idsToHighlight.size>0}update(t,i){this.config=i;const s=i.schema.processors[0].storage,o=d(this._schema,s);if((t.targets.feature||t.targets.aggregate)&&(t.storage.data=!0),o&&(e("esri-2d-update-debug")&&console.debug("Applying Update - AttributeStore:",o),t.storage.data=!0,this._schema=s,this._attributeComputeMap.clear(),!r(s))){switch(s.target){case"feature":this._targetType=b;break;case"aggregate":this._targetType=x}if("subtype"===s.type)for(const t in s.mapping){const e=s.mapping[t];if(a(e))for(const t of e.mapping)this._bindAttribute(t)}else for(const t of s.mapping)this._bindAttribute(t)}}onTileData(t,e){if(r(e.addOrUpdate))return;const i=e.addOrUpdate.getCursor();for(;i.next();){const t=i.getDisplayId();this.setAttributeData(t,i)}}invalidateResources(){this._createResourcesPromise=null,this._abortController.abort(),this._abortController=new AbortController}async setHighlight(t,e){const i=1,s=this._getBlock(0),r=e.map((t=>T(t)));s.lock(),s.unsetComponentAllTexels(0,i),s.setComponent(0,i,r),s.unlock(),this._idsToHighlight.clear();for(const a of t)this._idsToHighlight.add(a);await this.sendUpdates()}async updateFilters(t,i){const{config:s,service:r,spatialReference:a}=i,{filters:o}=s,n=o.map(((t,e)=>this._updateFilter(t,e,r,a)));(await Promise.all(n)).some((t=>t))&&(t.storage.filters=!0,e("esri-2d-update-debug")&&console.debug("Applying Update - AttributeStore:","Filters changed"))}setData(t,e,i,s){const r=T(t);this._ensureSizeForTexel(r),this._getBlock(e).setData(t,i,s)}getData(t,e,i){return this._getBlock(e).getData(t,i)}getHighlightFlag(t){return this._idsToHighlight.has(t)?g:0}unsetAttributeData(t){const e=T(t);this._getBlock(0).setData(e,0,0)}setAttributeData(t,e){const i=T(t);if(this._ensureSizeForTexel(i),this._getBlock(0).setData(i,0,this.getFilterFlags(e)),this._targetType!==z(t))return;const r=this._attributeComputeMap,a=this.config.supportsTextureFloat?1:2,o=4;r.size&&r.forEach(((t,r)=>{const n=r*a%o,l=Math.floor(r*a/o),h=this._getBlock(l+f),c=t(e);if(this.config.supportsTextureFloat)h.setData(i,n,c);else if(c===m)h.setData(i,n,255),h.setData(i,n+1,255);else{const t=s(Math.round(c),-32767,32766)+32768,e=255&t,r=(65280&t)>>8;h.setData(i,n,e),h.setData(i,n+1,r)}}))}sendUpdates(){if(this._nextUpdate)return this._nextUpdate.promise;if(this._currUpdate)return this._nextUpdate=c(),this._nextUpdate.promise;const e={blocks:this._blocks.map((t=>a(t)?t.toMessage():null))};return this._currUpdate=this._createResources().then((()=>{const t=()=>{if(this._currUpdate=null,this._nextUpdate){const t=this._nextUpdate;this._nextUpdate=null,this.sendUpdates().then((()=>t.resolve()))}},i=this._client.update(e,this._signal).then(t).catch(t);return this._client.render(this._signal),i})).catch((e=>u(e)?(this._createResourcesPromise=null,this._createResources()):(U.error(new t("mapview-attribute-store","Encountered an error during client update",e)),Promise.resolve()))),this._currUpdate}_ensureSizeForTexel(t){for(;t>=this._size*this._size;)if(this._expand())return}_bindAttribute(t){function e(){return t.normalizationField?e=>{const i=e.readAttribute(t.normalizationField);if(!i)return null;return e.readAttribute(t.field)/i}:e=>e.readAttribute(t.field)}function i(){return t.normalizationField&&U.warn("mapview-arcade","Ignoring normalizationField specified with an arcade expression which is not supported."),e=>e.getComputedNumericAtIndex(t.fieldIndex)}let s;if(null!=t.fieldIndex)s=i();else{if(!t.field)return;s=e()}if(t.valueRepresentation){s=C(s,(e=>D(e,t.valueRepresentation)))}const r=t=>null===t||isNaN(t)||t===1/0?m:t;this._attributeComputeMap.set(t.binding,C(s,r))}_createResources(){if(a(this._createResourcesPromise))return this._createResourcesPromise;this._getBlock(y),F("Initializing AttributeStore");const e={shared:B.sharedArrayBuffer&&!("local"===this._client.type),size:this._size,blocks:o(this._blocks,(t=>({textureOnly:t.textureOnly,buffer:t.buffer,pixelType:t.pixelType})))},i=this._client.initialize(e,this._signal).catch((e=>{u(e)?this._createResourcesPromise=null:U.error(new t("mapview-attribute-store","Encountered an error during client initialization",e))}));return this._createResourcesPromise=i,i.then((()=>r(this._createResourcesPromise)?this._createResources():void 0)),i}_getBlock(t){const e=this._blocks[t];if(a(e))return e;F(`Initializing AttributeBlock at index ${t}`);const i=B.sharedArrayBuffer,s=this._client.type,r=new R(i,s,this._size,this._blockDescriptors[t]);return this._blocks[t]=r,this._createResourcesPromise=null,r}_expand(){if(this._size<this.config.maxTextureSize){const t=this._size<<=1;return F("Expanding block size to",t,this._blocks),n(this._blocks,(e=>e.expand(t))),this._createResourcesPromise=null,this._size=t,0}return U.error(new t("mapview-limitations","Maximum number of onscreen features exceeded.")),-1}async _updateFilter(t,e,i,s){const o=this._filters[e],n=a(o)&&o.hash;if(!o&&!t)return!1;if(n===JSON.stringify(t))return!1;if(r(t)){if(!o)return!1;const t=1<<e+1,i=this._getBlock(0);return this._filters[e]=null,i.setComponentAllTexels(0,t),this.sendUpdates(),!0}const l=await this._getFilter(e,i);return await l.update(t,s),!0}async _getFilter(t,e){const i=this._filters[t];if(a(i))return i;const{default:s}=await import("./FeatureFilter.js"),r=new s({geometryType:e.geometryType,hasM:!1,hasZ:!1,timeInfo:e.timeInfo,fieldsIndex:new p(e.fields)});return this._filters[t]=r,r}isVisible(t){return!!(2&this._getBlock(0).getData(t,0))}getFilterFlags(t){let e=0;const i=S(t.getDisplayId());for(let a=0;a<this._filters.length;a++){const s=!!(i&1<<a),o=this._filters[a];e|=(!s||r(o)||o.check(t)?1:0)<<a}let s=0;if(this._idsToHighlight.size){const e=t.getObjectId();s=this.getHighlightFlag(e)}return e<<1|s}}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.23/esri/copyright.txt for details.
4
4
  */
5
- import{b as t,m as e,c as s,d as r,r as i}from"../../../../chunks/mat3.js";import{c as o}from"../../../../chunks/mat3f32.js";import{f as a}from"../../../../chunks/vec2f32.js";import{f as n}from"../../../../chunks/vec3f32.js";import{normalizeMapX as f}from"../../../../geometry/support/normalizeUtils.js";import{DisplayObject as l}from"../../engine/DisplayObject.js";import{createProgramDescriptor as m}from"../../engine/webgl/Utils.js";import{BufferObject as u}from"../../../webgl/BufferObject.js";import{BlendFactor as _,PrimitiveType as c,DataType as h,Usage as d}from"../../../webgl/enums.js";import{Program as p}from"../../../webgl/Program.js";import{VertexArrayObject as g}from"../../../webgl/VertexArrayObject.js";const v=Math.PI/180,x=4;class b extends l{constructor(t){super(),this._dvsMat3=o(),this._localOrigin={x:0,y:0},this._getBounds=t}destroy(){this._vao&&(this._vao.dispose(!0),this._vao=null,this._vertexBuffer=null,this._indexBuffer=null),this._program&&(this._program.dispose(),this._program=null)}doRender(t){const{context:e}=t,s=this._getBounds();if(s.length<1)return;this._createShaderProgram(e),this._updateMatricesAndLocalOrigin(t),this._updateBufferData(e,s),e.setBlendingEnabled(!0),e.setDepthTestEnabled(!1),e.setStencilWriteMask(0),e.setStencilTestEnabled(!1),e.setBlendFunction(_.ONE,_.ONE_MINUS_SRC_ALPHA),e.setColorMask(!0,!0,!0,!0);const r=this._program;e.bindVAO(this._vao),e.useProgram(r),r.setUniformMatrix3fv("u_dvsMat3",this._dvsMat3),e.gl.lineWidth(1),e.drawElements(c.LINES,8*s.length,h.UNSIGNED_INT,0),e.bindVAO()}_createTransforms(){return{dvs:o()}}_createShaderProgram(t){if(this._program)return;const e="precision highp float;\n uniform mat3 u_dvsMat3;\n\n attribute vec2 a_position;\n\n void main() {\n mediump vec3 pos = u_dvsMat3 * vec3(a_position, 1.0);\n gl_Position = vec4(pos.xy, 0.0, 1.0);\n }",s="precision mediump float;\n void main() {\n gl_FragColor = vec4(0.75, 0.0, 0.0, 0.75);\n }";this._program=new p(t,e,s,y().attributes)}_updateMatricesAndLocalOrigin(o){const{state:l}=o,{displayMat3:m,size:u,resolution:_,pixelRatio:c,rotation:h,viewpoint:d}=l,p=v*h,{x:g,y:x}=d.targetGeometry,b=f(g,l.spatialReference);this._localOrigin.x=b,this._localOrigin.y=x;const y=c*u[0],B=c*u[1],M=_*y,j=_*B,A=t(this._dvsMat3);e(A,A,m),s(A,A,a(y/2,B/2)),r(A,A,n(u[0]/M,-B/j,1)),i(A,A,-p)}_updateBufferData(t,e){const{x:s,y:r}=this._localOrigin,i=2*x*e.length,o=new Float32Array(i),a=new Uint32Array(8*e.length);let n=0,f=0;for(const l of e)l&&(o[2*n+0]=l[0]-s,o[2*n+1]=l[1]-r,o[2*n+2]=l[0]-s,o[2*n+3]=l[3]-r,o[2*n+4]=l[2]-s,o[2*n+5]=l[3]-r,o[2*n+6]=l[2]-s,o[2*n+7]=l[1]-r,a[f+0]=n+0,a[f+1]=n+3,a[f+2]=n+3,a[f+3]=n+2,a[f+4]=n+2,a[f+5]=n+1,a[f+6]=n+1,a[f+7]=n+0,n+=4,f+=8);if(this._vertexBuffer?this._vertexBuffer.setData(o.buffer):this._vertexBuffer=u.createVertex(t,d.DYNAMIC_DRAW,o.buffer),this._indexBuffer?this._indexBuffer.setData(a):this._indexBuffer=u.createIndex(t,d.DYNAMIC_DRAW,a),!this._vao){const e=y();this._vao=new g(t,e.attributes,e.bufferLayouts,{geometry:this._vertexBuffer},this._indexBuffer)}}}const y=()=>m("bounds",{geometry:[{location:0,name:"a_position",count:2,type:h.FLOAT}]});export{b as default};
5
+ import{b as t,m as e,c as s,d as r,r as i}from"../../../../chunks/mat3.js";import{c as o}from"../../../../chunks/mat3f32.js";import{f as a}from"../../../../chunks/vec2f32.js";import{f as n}from"../../../../chunks/vec3f32.js";import{normalizeMapX as f}from"../../../../geometry/support/normalizeUtils.js";import{DisplayObject as l}from"../../engine/DisplayObject.js";import{createProgramDescriptor as u}from"../../engine/webgl/Utils.js";import{BufferObject as c}from"../../../webgl/BufferObject.js";import{BlendFactor as _,PrimitiveType as m,DataType as h,Usage as d}from"../../../webgl/enums.js";import{VertexArrayObject as p}from"../../../webgl/VertexArrayObject.js";const g=Math.PI/180,v=4;class x extends l{constructor(t){super(),this._dvsMat3=o(),this._localOrigin={x:0,y:0},this._getBounds=t}destroy(){this._vao&&(this._vao.dispose(!0),this._vao=null,this._vertexBuffer=null,this._indexBuffer=null),this._program&&(this._program.dispose(),this._program=null)}doRender(t){const{context:e}=t,s=this._getBounds();if(s.length<1)return;this._createShaderProgram(e),this._updateMatricesAndLocalOrigin(t),this._updateBufferData(e,s),e.setBlendingEnabled(!0),e.setDepthTestEnabled(!1),e.setStencilWriteMask(0),e.setStencilTestEnabled(!1),e.setBlendFunction(_.ONE,_.ONE_MINUS_SRC_ALPHA),e.setColorMask(!0,!0,!0,!0);const r=this._program;e.bindVAO(this._vao),e.useProgram(r),r.setUniformMatrix3fv("u_dvsMat3",this._dvsMat3),e.gl.lineWidth(1),e.drawElements(m.LINES,8*s.length,h.UNSIGNED_INT,0),e.bindVAO()}_createTransforms(){return{dvs:o()}}_createShaderProgram(t){if(this._program)return;const e="precision highp float;\n uniform mat3 u_dvsMat3;\n\n attribute vec2 a_position;\n\n void main() {\n mediump vec3 pos = u_dvsMat3 * vec3(a_position, 1.0);\n gl_Position = vec4(pos.xy, 0.0, 1.0);\n }",s="precision mediump float;\n void main() {\n gl_FragColor = vec4(0.75, 0.0, 0.0, 0.75);\n }";this._program=t.programCache.acquire(e,s,b().attributes)}_updateMatricesAndLocalOrigin(o){const{state:l}=o,{displayMat3:u,size:c,resolution:_,pixelRatio:m,rotation:h,viewpoint:d}=l,p=g*h,{x:v,y:x}=d.targetGeometry,b=f(v,l.spatialReference);this._localOrigin.x=b,this._localOrigin.y=x;const y=m*c[0],B=m*c[1],M=_*y,A=_*B,O=t(this._dvsMat3);e(O,O,u),s(O,O,a(y/2,B/2)),r(O,O,n(c[0]/M,-B/A,1)),i(O,O,-p)}_updateBufferData(t,e){const{x:s,y:r}=this._localOrigin,i=2*v*e.length,o=new Float32Array(i),a=new Uint32Array(8*e.length);let n=0,f=0;for(const l of e)l&&(o[2*n+0]=l[0]-s,o[2*n+1]=l[1]-r,o[2*n+2]=l[0]-s,o[2*n+3]=l[3]-r,o[2*n+4]=l[2]-s,o[2*n+5]=l[3]-r,o[2*n+6]=l[2]-s,o[2*n+7]=l[1]-r,a[f+0]=n+0,a[f+1]=n+3,a[f+2]=n+3,a[f+3]=n+2,a[f+4]=n+2,a[f+5]=n+1,a[f+6]=n+1,a[f+7]=n+0,n+=4,f+=8);if(this._vertexBuffer?this._vertexBuffer.setData(o.buffer):this._vertexBuffer=c.createVertex(t,d.DYNAMIC_DRAW,o.buffer),this._indexBuffer?this._indexBuffer.setData(a):this._indexBuffer=c.createIndex(t,d.DYNAMIC_DRAW,a),!this._vao){const e=b();this._vao=new p(t,e.attributes,e.bufferLayouts,{geometry:this._vertexBuffer},this._indexBuffer)}}}const b=()=>u("bounds",{geometry:[{location:0,name:"a_position",count:2,type:h.FLOAT}]});export{x as default};