@arcgis/core 4.34.0-next.1 → 4.34.0-next.10

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 (736) hide show
  1. package/Map.js +1 -1
  2. package/WebScene.js +1 -1
  3. package/analysis/DimensionAnalysis.js +1 -1
  4. package/analysis/LineOfSightAnalysis.js +1 -1
  5. package/analysis/ViewshedAnalysis.js +1 -1
  6. package/applications/ExperienceBuilder/sketchUtils.d.ts +1 -0
  7. package/applications/ExperienceBuilder/sketchUtils.js +1 -1
  8. package/arcade/Voxel.js +1 -1
  9. package/arcade/functions/knowledgegraph.js +1 -1
  10. package/assets/esri/core/workers/RemoteClient.js +1 -1
  11. package/assets/esri/core/workers/chunks/0039dee1337160366112.js +1 -0
  12. package/assets/esri/core/workers/chunks/074498a4d685223ec058.js +1 -0
  13. package/assets/esri/core/workers/chunks/{54ea93f416ab52b413c1.js → 076f830d6d0337dfce9d.js} +1 -1
  14. package/assets/esri/core/workers/chunks/09907c9ff597df9bc954.js +1 -0
  15. package/assets/esri/core/workers/chunks/0dbb350ce651bc236ec8.js +1 -0
  16. package/assets/esri/core/workers/chunks/0ed4ec00ef16aa58a33d.js +1 -0
  17. package/assets/esri/core/workers/chunks/{ead5d4e271effc04def3.js → 1415d4e2f5f3193be004.js} +1 -1
  18. package/assets/esri/core/workers/chunks/{0624ae07d3af8d5f1ac8.js → 15b3eb60f86954783fab.js} +1 -1
  19. package/assets/esri/core/workers/chunks/18011c691e0aca4144dd.js +1 -0
  20. package/assets/esri/core/workers/chunks/1dc1084eb34748a35d35.js +1 -0
  21. package/assets/esri/core/workers/chunks/1f315f0eeb26dad1addd.js +1 -0
  22. package/assets/esri/core/workers/chunks/2254989ca3ff3960f2fe.js +1 -0
  23. package/assets/esri/core/workers/chunks/2dc54925d473a959119c.js +1 -0
  24. package/assets/esri/core/workers/chunks/2e1ceff3f88a6c78dfa2.js +1 -0
  25. package/assets/esri/core/workers/chunks/{847e88e1d6da1e74cdc8.js → 2ecc1057d53e0b4a60b7.js} +1 -1
  26. package/assets/esri/core/workers/chunks/3025e420e13e2bc8c0a1.js +1 -0
  27. package/assets/esri/core/workers/chunks/{ece68a25651ef03fc95d.js → 342f61e784c9364a493b.js} +1 -1
  28. package/assets/esri/core/workers/chunks/{0d23610475c85385fbff.js → 355e6bcdb401ada71f39.js} +1 -1
  29. package/assets/esri/core/workers/chunks/{bba6d7615d8f3862fe70.js → 36f0046ff6b46adce7b7.js} +1 -1
  30. package/assets/esri/core/workers/chunks/{1c86aa3802d9ae0230ae.js → 3916879b9ca8c6979011.js} +1 -1
  31. package/assets/esri/core/workers/chunks/3a74654fa539f78ceb86.js +1 -0
  32. package/assets/esri/core/workers/chunks/3adcf78ed1e7cd82666d.js +1 -0
  33. package/assets/esri/core/workers/chunks/3b63edcd34f832ac7bd8.js +1 -0
  34. package/assets/esri/core/workers/chunks/{b0522dffa5600345c07e.js → 3e85e63148b5e93d3074.js} +1 -1
  35. package/assets/esri/core/workers/chunks/4088f4c25a09932a3eb1.js +1 -0
  36. package/assets/esri/core/workers/chunks/427318722815bef1496b.js +1 -0
  37. package/assets/esri/core/workers/chunks/464c15b2779f9b803a06.js +1 -0
  38. package/assets/esri/core/workers/chunks/49089731ecfe7e8bb2f6.js +1 -0
  39. package/assets/esri/core/workers/chunks/4c3bd6cc0badb78c7112.js +1 -0
  40. package/assets/esri/core/workers/chunks/4e0bae3671fe1c7efa76.js +1 -0
  41. package/assets/esri/core/workers/chunks/500fb5f615f0c1db1b66.js +1 -0
  42. package/assets/esri/core/workers/chunks/52c34d6ecd9d45a33e69.js +1 -0
  43. package/assets/esri/core/workers/chunks/539541dec5fcf3b657aa.js +1 -0
  44. package/assets/esri/core/workers/chunks/{fa63b0f7fa799cb2f81d.js → 562800b0af52a38a311b.js} +1 -1
  45. package/assets/esri/core/workers/chunks/{b87fec1753f164c845c5.js → 58f403f956b7b3467344.js} +1 -1
  46. package/assets/esri/core/workers/chunks/5bfcb3d87380e7f85b08.js +1 -0
  47. package/assets/esri/core/workers/chunks/5d3246b8fc50f9d9e2c4.js +1 -0
  48. package/assets/esri/core/workers/chunks/5e539ce4751bcfa57145.js +1 -0
  49. package/assets/esri/core/workers/chunks/{6ee41e9c92ed8ba4c763.js → 5ef1095842e21090f1f4.js} +1 -1
  50. package/assets/esri/core/workers/chunks/6194636638b0439fccd8.js +1 -0
  51. package/assets/esri/core/workers/chunks/{9fc35ec8185beba96715.js → 632d1a1287dde980479e.js} +1 -1
  52. package/assets/esri/core/workers/chunks/{1d043965dcdc11b3aeaa.js → 63852887b3f07d50f7c9.js} +1 -1
  53. package/assets/esri/core/workers/chunks/6a86fee4e945e61d9639.js +1 -0
  54. package/assets/esri/core/workers/chunks/6b0ae9ccdd1acef5b5b4.js +1 -0
  55. package/assets/esri/core/workers/chunks/6d90887dc605261dd7b3.js +1 -0
  56. package/assets/esri/core/workers/chunks/72ea996b03932c0f004f.js +1 -0
  57. package/assets/esri/core/workers/chunks/7317346ed8d7c5bb859d.js +1 -0
  58. package/assets/esri/core/workers/chunks/74276044cb75b51967f2.js +1 -0
  59. package/assets/esri/core/workers/chunks/766e08d0c56b2b31b63b.js +1 -0
  60. package/assets/esri/core/workers/chunks/{bd7b54db7fd278b15500.js → 7a2189614f2dad49ffcd.js} +1 -1
  61. package/assets/esri/core/workers/chunks/7ae88c141a5d85e5bb88.js +1 -0
  62. package/assets/esri/core/workers/chunks/7aef81778155be373d3e.js +1 -0
  63. package/assets/esri/core/workers/chunks/7e1906d35a764f7f10b0.js +1 -0
  64. package/assets/esri/core/workers/chunks/7fa46d1e9fcd8c0c6302.js +1 -0
  65. package/assets/esri/core/workers/chunks/{06eb4832b6c86744e52e.js → 8008f5479f4d16964088.js} +1 -1
  66. package/assets/esri/core/workers/chunks/80777a9db53bee2ad8a8.js +1 -0
  67. package/assets/esri/core/workers/chunks/81614beb51405d064a6c.js +1 -0
  68. package/assets/esri/core/workers/chunks/83db8bd42f94f97c7cf1.js +1 -0
  69. package/assets/esri/core/workers/chunks/88b1214c284c2ec7d51b.js +1 -0
  70. package/assets/esri/core/workers/chunks/91d484960df25ec9554b.js +1 -0
  71. package/assets/esri/core/workers/chunks/92a5dccb328229a9336b.js +1 -0
  72. package/assets/esri/core/workers/chunks/948c5454881e661c3bdc.js +1 -0
  73. package/assets/esri/core/workers/chunks/{631205dc4d73d49ec9ed.js → 95507ff0a243e451b99e.js} +1 -1
  74. package/assets/esri/core/workers/chunks/9cb242dfc3765b590f51.js +1 -0
  75. package/assets/esri/core/workers/chunks/{1051a5a57b2fb843a555.js → 9cd55043f3d789f41815.js} +1 -1
  76. package/assets/esri/core/workers/chunks/9ddb0b07be31c3747238.js +1 -0
  77. package/assets/esri/core/workers/chunks/9f0f1472f36b42c507d1.js +1 -0
  78. package/assets/esri/core/workers/chunks/{ac2607f1e8cd2e99907c.js → 9f964467f7353039dd9c.js} +3 -3
  79. package/assets/esri/core/workers/chunks/9fe62638dc7dce466612.js +1 -0
  80. package/assets/esri/core/workers/chunks/a2e9141ff4efd13413a1.js +66 -0
  81. package/assets/esri/core/workers/chunks/a693cd3af2e995972252.js +1 -0
  82. package/assets/esri/core/workers/chunks/a6fb75929e456f87f804.js +1 -0
  83. package/assets/esri/core/workers/chunks/aaa564c84ee8ea36fbb4.js +1 -0
  84. package/assets/esri/core/workers/chunks/ad4f65d764654c70a117.js +1 -0
  85. package/assets/esri/core/workers/chunks/adf6982e2d8102669cdf.js +1 -0
  86. package/assets/esri/core/workers/chunks/af0d7a7cbbaad47a49c6.js +1 -0
  87. package/assets/esri/core/workers/chunks/af2f2df3c43b49ad1a70.js +1 -0
  88. package/assets/esri/core/workers/chunks/b09539a4b491a90a6bbe.js +1 -0
  89. package/assets/esri/core/workers/chunks/{d9b2263e0a9f9068ab62.js → b6c3a2d93a59df9a1418.js} +1 -1
  90. package/assets/esri/core/workers/chunks/{d7b640f7a181bd26c7c7.js → bac5e1d50b69f0d94694.js} +1 -1
  91. package/assets/esri/core/workers/chunks/bbbd58b02a3ee8fe595e.js +1 -0
  92. package/assets/esri/core/workers/chunks/{9ca480eb8b2312381ccf.js → bcadcb709e622f2aaaf9.js} +1 -1
  93. package/assets/esri/core/workers/chunks/{6993a59cbb78bc26f029.js → c45a314ace9725aa250e.js} +1 -1
  94. package/assets/esri/core/workers/chunks/{c16e0da7a19310c71e8b.js → c6cd8784a3e222eb2d4a.js} +1 -1
  95. package/assets/esri/core/workers/chunks/{571252c9822d73cf7b01.js → c6fa79ce324122e08dbb.js} +1 -1
  96. package/assets/esri/core/workers/chunks/c8856370bae65d9eeb2b.js +1 -0
  97. package/assets/esri/core/workers/chunks/{97c148adf0347c69a79c.js → c9604f8df909ec4fad46.js} +1 -1
  98. package/assets/esri/core/workers/chunks/c96fed4889712f5a9135.js +1 -0
  99. package/assets/esri/core/workers/chunks/{faa40ef04604c7cce706.js → cb63ea6a53d3c2fc3179.js} +1 -1
  100. package/assets/esri/core/workers/chunks/cc37bfa72c34bc2ef993.js +1 -0
  101. package/assets/esri/core/workers/chunks/cfc5e0ec9b0290407383.js +1 -0
  102. package/assets/esri/core/workers/chunks/{9a06476b834584d00d5c.js → d0372bac0c5f4fbed468.js} +1 -1
  103. package/assets/esri/core/workers/chunks/d28d874c1337b69fedc0.js +1 -0
  104. package/assets/esri/core/workers/chunks/{54f4a1131f99468db076.js → d33a5d79f2163ad62b1d.js} +1 -1
  105. package/assets/esri/core/workers/chunks/{0bbb38f59f37c51c72f0.js → d45a4e5806a80b69ceec.js} +1 -1
  106. package/assets/esri/core/workers/chunks/{7a23dc625a812a562c21.js → d5f770302dc686e55ba7.js} +1 -1
  107. package/assets/esri/core/workers/chunks/d942cb9cf82b1c056979.js +1 -0
  108. package/assets/esri/core/workers/chunks/dc14507cfc052faa5890.js +1 -0
  109. package/assets/esri/core/workers/chunks/{ca60b34c3e1ed2ff5934.js → dd2b316baae02bbdddac.js} +1 -1
  110. package/assets/esri/core/workers/chunks/dea3e131bbd48cc48e1a.js +346 -0
  111. package/assets/esri/core/workers/chunks/df84863cb0600f658541.js +1 -0
  112. package/assets/esri/core/workers/chunks/e0ae33206f519b159b49.js +1 -0
  113. package/assets/esri/core/workers/chunks/e7589c39b13295af8f1d.js +1 -0
  114. package/assets/esri/core/workers/chunks/e7a440476cd1eb4c6547.js +1 -0
  115. package/assets/esri/core/workers/chunks/{e3c1aea34ece8336dae1.js → e9aa1d9ded8a52a40c57.js} +1 -1
  116. package/assets/esri/core/workers/chunks/eb23ce385b0d18959c7c.js +1 -0
  117. package/assets/esri/core/workers/chunks/{80b596496800e8d60eb8.js → ed75e0962358523f4439.js} +1 -1
  118. package/assets/esri/core/workers/chunks/ede9738ac20e7dd5ce63.js +1 -0
  119. package/assets/esri/core/workers/chunks/eec034d88db320880133.js +1 -0
  120. package/assets/esri/core/workers/chunks/f2aa8090827086c62dde.js +1 -0
  121. package/assets/esri/core/workers/chunks/f48eb59b94ba8b7d4d72.js +1 -0
  122. package/assets/esri/core/workers/chunks/f5741d09fd4e1809f580.js +1 -0
  123. package/assets/esri/core/workers/chunks/fe3832107278244dc04d.js +1 -0
  124. package/assets/esri/libs/lyr3d/lyr3DWorker.wasm +0 -0
  125. package/assets/esri/themes/base/widgets/_Directions.scss +1 -1
  126. package/assets/esri/themes/dark/main.css +1 -1
  127. package/assets/esri/themes/light/main.css +1 -1
  128. package/assets/esri/themes/light/view.css +1 -1
  129. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm.json +1 -1
  130. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_en.json +1 -1
  131. package/assets/esri/widgets/Editor/t9n/Editor.json +1 -1
  132. package/assets/esri/widgets/Editor/t9n/Editor_ar.json +1 -1
  133. package/assets/esri/widgets/Editor/t9n/Editor_bg.json +1 -1
  134. package/assets/esri/widgets/Editor/t9n/Editor_bs.json +1 -1
  135. package/assets/esri/widgets/Editor/t9n/Editor_ca.json +1 -1
  136. package/assets/esri/widgets/Editor/t9n/Editor_cs.json +1 -1
  137. package/assets/esri/widgets/Editor/t9n/Editor_da.json +1 -1
  138. package/assets/esri/widgets/Editor/t9n/Editor_de.json +1 -1
  139. package/assets/esri/widgets/Editor/t9n/Editor_el.json +1 -1
  140. package/assets/esri/widgets/Editor/t9n/Editor_en.json +1 -1
  141. package/assets/esri/widgets/Editor/t9n/Editor_es.json +1 -1
  142. package/assets/esri/widgets/Editor/t9n/Editor_et.json +1 -1
  143. package/assets/esri/widgets/Editor/t9n/Editor_fi.json +1 -1
  144. package/assets/esri/widgets/Editor/t9n/Editor_fr.json +1 -1
  145. package/assets/esri/widgets/Editor/t9n/Editor_he.json +1 -1
  146. package/assets/esri/widgets/Editor/t9n/Editor_hr.json +1 -1
  147. package/assets/esri/widgets/Editor/t9n/Editor_hu.json +1 -1
  148. package/assets/esri/widgets/Editor/t9n/Editor_id.json +1 -1
  149. package/assets/esri/widgets/Editor/t9n/Editor_it.json +1 -1
  150. package/assets/esri/widgets/Editor/t9n/Editor_ja.json +1 -1
  151. package/assets/esri/widgets/Editor/t9n/Editor_ko.json +1 -1
  152. package/assets/esri/widgets/Editor/t9n/Editor_lt.json +1 -1
  153. package/assets/esri/widgets/Editor/t9n/Editor_lv.json +1 -1
  154. package/assets/esri/widgets/Editor/t9n/Editor_nl.json +1 -1
  155. package/assets/esri/widgets/Editor/t9n/Editor_no.json +1 -1
  156. package/assets/esri/widgets/Editor/t9n/Editor_pl.json +1 -1
  157. package/assets/esri/widgets/Editor/t9n/Editor_pt-BR.json +1 -1
  158. package/assets/esri/widgets/Editor/t9n/Editor_pt-PT.json +1 -1
  159. package/assets/esri/widgets/Editor/t9n/Editor_ro.json +1 -1
  160. package/assets/esri/widgets/Editor/t9n/Editor_ru.json +1 -1
  161. package/assets/esri/widgets/Editor/t9n/Editor_sk.json +1 -1
  162. package/assets/esri/widgets/Editor/t9n/Editor_sl.json +1 -1
  163. package/assets/esri/widgets/Editor/t9n/Editor_sr.json +1 -1
  164. package/assets/esri/widgets/Editor/t9n/Editor_sv.json +1 -1
  165. package/assets/esri/widgets/Editor/t9n/Editor_th.json +1 -1
  166. package/assets/esri/widgets/Editor/t9n/Editor_tr.json +1 -1
  167. package/assets/esri/widgets/Editor/t9n/Editor_uk.json +1 -1
  168. package/assets/esri/widgets/Editor/t9n/Editor_vi.json +1 -1
  169. package/assets/esri/widgets/Editor/t9n/Editor_zh-CN.json +1 -1
  170. package/assets/esri/widgets/Editor/t9n/Editor_zh-HK.json +1 -1
  171. package/assets/esri/widgets/Editor/t9n/Editor_zh-TW.json +1 -1
  172. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable.json +1 -1
  173. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ar.json +1 -1
  174. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_bg.json +1 -1
  175. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_bs.json +1 -1
  176. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ca.json +1 -1
  177. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_cs.json +1 -1
  178. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_da.json +1 -1
  179. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_de.json +1 -1
  180. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_el.json +1 -1
  181. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_en.json +1 -1
  182. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_es.json +1 -1
  183. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_et.json +1 -1
  184. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_fi.json +1 -1
  185. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_fr.json +1 -1
  186. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_he.json +1 -1
  187. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_hr.json +1 -1
  188. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_hu.json +1 -1
  189. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_id.json +1 -1
  190. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_it.json +1 -1
  191. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ja.json +1 -1
  192. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ko.json +1 -1
  193. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_lt.json +1 -1
  194. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_lv.json +1 -1
  195. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_nl.json +1 -1
  196. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_no.json +1 -1
  197. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_pl.json +1 -1
  198. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_pt-BR.json +1 -1
  199. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_pt-PT.json +1 -1
  200. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ro.json +1 -1
  201. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ru.json +1 -1
  202. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sk.json +1 -1
  203. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sl.json +1 -1
  204. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sr.json +1 -1
  205. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sv.json +1 -1
  206. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_th.json +1 -1
  207. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_tr.json +1 -1
  208. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_uk.json +1 -1
  209. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_vi.json +1 -1
  210. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_zh-CN.json +1 -1
  211. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_zh-HK.json +1 -1
  212. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_zh-TW.json +1 -1
  213. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ar.json +1 -1
  214. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_bg.json +1 -1
  215. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_bs.json +1 -1
  216. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ca.json +1 -1
  217. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_cs.json +1 -1
  218. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_da.json +1 -1
  219. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_de.json +1 -1
  220. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_el.json +1 -1
  221. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_es.json +1 -1
  222. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_et.json +1 -1
  223. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_fi.json +1 -1
  224. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_fr.json +1 -1
  225. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_he.json +1 -1
  226. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_hr.json +1 -1
  227. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_hu.json +1 -1
  228. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_id.json +1 -1
  229. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_it.json +1 -1
  230. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ja.json +1 -1
  231. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ko.json +1 -1
  232. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_lt.json +1 -1
  233. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_lv.json +1 -1
  234. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_nl.json +1 -1
  235. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_no.json +1 -1
  236. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pl.json +1 -1
  237. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pt-BR.json +1 -1
  238. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pt-PT.json +1 -1
  239. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ro.json +1 -1
  240. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ru.json +1 -1
  241. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sk.json +1 -1
  242. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sl.json +1 -1
  243. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sr.json +1 -1
  244. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sv.json +1 -1
  245. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_th.json +1 -1
  246. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_tr.json +1 -1
  247. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_uk.json +1 -1
  248. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_vi.json +1 -1
  249. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-CN.json +1 -1
  250. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-HK.json +1 -1
  251. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-TW.json +1 -1
  252. package/chunks/FocusAreaColor.glsl.js +10 -8
  253. package/chunks/FocusAreaMask.glsl.js +1 -1
  254. package/chunks/Laserlines.glsl.js +2 -2
  255. package/chunks/aiServices.js +1 -1
  256. package/chunks/cameraUtilsSpherical.js +1 -1
  257. package/chunks/persistableUrlUtils.js +1 -1
  258. package/chunks/sphere.js +1 -1
  259. package/chunks/vec42.js +1 -1
  260. package/config.js +1 -1
  261. package/core/accessorSupport/decorators/persistable.js +1 -1
  262. package/core/accessorSupport/ensureType.js +1 -1
  263. package/core/libs/gl-matrix-2/math/quat.js +1 -1
  264. package/core/libs/gl-matrix-2/math/vec4.js +1 -1
  265. package/core/workers/Connection.js +1 -1
  266. package/core/workers/RemoteClient.js +1 -1
  267. package/core/workers/WorkerHandle.js +1 -1
  268. package/effects/FocusArea.d.ts +4 -0
  269. package/effects/FocusArea.js +5 -0
  270. package/effects/FocusAreaOutline.d.ts +4 -0
  271. package/effects/FocusAreaOutline.js +5 -0
  272. package/effects/FocusAreas.d.ts +4 -0
  273. package/effects/FocusAreas.js +5 -0
  274. package/form/elements/GroupElement.js +1 -1
  275. package/form/elements/inputs.js +1 -1
  276. package/form/elements.js +1 -1
  277. package/geometry/projection/projectPointToVector.js +1 -1
  278. package/geometry/projection/projectVectorToPoint.js +1 -1
  279. package/geometry/projection/projectVectorToVector.js +1 -1
  280. package/geometry/projection.js +1 -1
  281. package/geometry/projectionUtils.js +5 -0
  282. package/geometry/support/frustum.js +1 -1
  283. package/geometry/support/meshUtils/elevation.js +1 -1
  284. package/geometry/support/meshUtils/extent.js +1 -1
  285. package/geometry/support/sphere.js +1 -1
  286. package/geometry.js +1 -1
  287. package/interfaces.d.ts +745 -567
  288. package/kernel.js +1 -1
  289. package/layers/BuildingSceneLayer.js +1 -1
  290. package/layers/CatalogLayer.js +1 -1
  291. package/layers/GeoJSONLayer.js +1 -1
  292. package/layers/GroupLayer.js +1 -1
  293. package/layers/ImageryLayer.js +1 -1
  294. package/layers/ImageryTileLayer.js +1 -1
  295. package/layers/MapNotesLayer.js +1 -1
  296. package/layers/OGCFeatureLayer.js +1 -1
  297. package/layers/RouteLayer.js +1 -1
  298. package/layers/VideoLayer.js +1 -1
  299. package/layers/WFSLayer.js +1 -1
  300. package/layers/buildingSublayers/BuildingComponentSublayer.js +1 -1
  301. package/layers/catalog/CatalogFootprintLayer.js +1 -1
  302. package/layers/graphics/applyEditsUtils.js +1 -1
  303. package/layers/graphics/controllers/FeatureTileController3D.js +1 -1
  304. package/layers/graphics/controllers/I3SOnDemandController.js +1 -1
  305. package/layers/graphics/data/QueryEngine.js +1 -1
  306. package/layers/graphics/data/projectionSupport.js +1 -1
  307. package/layers/graphics/data/queryUtils.js +1 -1
  308. package/layers/graphics/editingSupport.js +1 -1
  309. package/layers/graphics/sources/support/CSVSourceWorker.js +1 -1
  310. package/layers/knowledgeGraph/KnowledgeGraphLayerDataManager.js +1 -1
  311. package/layers/knowledgeGraph/KnowledgeGraphSublayer.js +1 -1
  312. package/layers/mixins/ImageryTileMixin.js +1 -1
  313. package/layers/mixins/operationalLayerModuleMap.js +1 -1
  314. package/layers/mixins/operationalLayers.js +1 -1
  315. package/layers/ogc/wfsUtils.js +1 -1
  316. package/layers/orientedImagery/core/coverageUtils.js +1 -1
  317. package/layers/orientedImagery/transformations/imageToWorld.js +1 -1
  318. package/layers/orientedImagery/transformations/updateElevationUtils.js +1 -1
  319. package/layers/orientedImagery/transformations/utils.js +1 -1
  320. package/layers/support/BuildingSummaryStatistics.js +1 -1
  321. package/layers/support/ControlPointsGeoreference.js +1 -1
  322. package/layers/support/CornersGeoreference.js +1 -1
  323. package/layers/support/ElevationQuery.js +1 -1
  324. package/layers/support/ExtentAndRotationGeoreference.js +1 -1
  325. package/layers/support/GeoreferenceBase.js +1 -1
  326. package/layers/support/LocalMediaElementSource.js +1 -1
  327. package/layers/support/MediaElementView.js +1 -1
  328. package/layers/support/PolygonCollection.js +1 -1
  329. package/layers/support/PromiseQueue.js +1 -1
  330. package/layers/support/SceneModification.js +1 -1
  331. package/layers/support/TelemetryDisplay.js +1 -1
  332. package/layers/support/TitleCreator.js +1 -1
  333. package/layers/support/arcgisLayers.js +1 -1
  334. package/layers/support/featurePopupQueryUtils.js +5 -0
  335. package/layers/support/fieldUtils.js +1 -1
  336. package/layers/support/layersCreator.js +1 -1
  337. package/layers/support/multiLayerServiceUtils.js +5 -0
  338. package/layers/support/rasterFunctions/rasterProjectionHelper.js +1 -1
  339. package/layers/video/VideoController.js +1 -1
  340. package/layers/video/videoUtils.js +1 -1
  341. package/networks/CircuitManager.js +1 -1
  342. package/networks/UnitIdentifierManager.js +1 -1
  343. package/networks/UtilityNetwork.js +1 -1
  344. package/networks/support/UNTraceConfiguration.js +1 -1
  345. package/networks/support/typeUtils.js +1 -1
  346. package/package.json +1 -1
  347. package/portal/PortalItem.js +1 -1
  348. package/portal/schemas/definitions.js +1 -1
  349. package/portal/schemas/webScene.js +1 -1
  350. package/portal/support/layersLoader.js +1 -1
  351. package/portal/support/portalItemUtils.js +1 -1
  352. package/portal/support/portalLayers.js +1 -1
  353. package/rasterRenderers.js +1 -1
  354. package/renderers/RasterStretchRenderer.js +1 -1
  355. package/renderers/support/AuthoringInfoVisualVariable.js +1 -1
  356. package/renderers/support/RasterSymbolizer.js +1 -1
  357. package/renderers/support/colorRampUtils.js +1 -1
  358. package/renderers/support/rasterRendererHelper.js +1 -1
  359. package/renderers.js +1 -1
  360. package/rest/featureService/FeatureService.js +1 -1
  361. package/rest/knowledgeGraph/GraphAddFieldIndexResult.js +5 -0
  362. package/rest/knowledgeGraph/GraphAddNamedTypesResult.js +1 -1
  363. package/rest/knowledgeGraph/GraphAddPropertyResult.js +1 -1
  364. package/rest/knowledgeGraph/GraphDataModelOperationResult.js +5 -0
  365. package/rest/knowledgeGraph/GraphDeleteFieldIndexResult.js +5 -0
  366. package/rest/knowledgeGraph/GraphDeleteNamedTypeResult.js +1 -1
  367. package/rest/knowledgeGraph/GraphDeletePropertyResult.js +1 -1
  368. package/rest/knowledgeGraph/GraphUpdateNamedTypesResult.js +1 -1
  369. package/rest/knowledgeGraph/GraphUpdatePropertyResult.js +1 -1
  370. package/rest/knowledgeGraph/GraphUpdateSearchIndexResult.js +1 -1
  371. package/rest/knowledgeGraph/wasmInterface/updateToWasmEncodedFactories.js +1 -1
  372. package/rest/knowledgeGraph/wasmInterface/wasmToDataModelChangeResponseFactories.js +1 -1
  373. package/rest/knowledgeGraphService.js +1 -1
  374. package/rest/locator/locationToAddress.js +1 -1
  375. package/rest/networks/circuits/queryCircuits.js +1 -1
  376. package/rest/networks/circuits/support/QueryCircuitsParameters.js +1 -1
  377. package/rest/networks/queryAssociations.js +1 -1
  378. package/rest/networks/support/CircuitPath.js +5 -0
  379. package/rest/networks/support/CircuitPathConnectivityElement.js +5 -0
  380. package/rest/networks/support/CircuitTraceResult.js +5 -0
  381. package/rest/networks/support/TraceLocation.js +1 -1
  382. package/rest/networks/support/TraceResult.js +1 -1
  383. package/rest/networks/unitIdentifiers/support/{QueryUnitIdentifiersParamters.js → QueryUnitIdentifiersParameters.js} +1 -1
  384. package/rest/support/LocationToAddressParameters.js +1 -1
  385. package/rest/support/geocodeEnums.js +5 -0
  386. package/smartMapping/renderers/pieChart.js +1 -1
  387. package/smartMapping/renderers/predominance.js +1 -1
  388. package/smartMapping/renderers/size.js +1 -1
  389. package/smartMapping/renderers/support/rendererUtils.js +1 -1
  390. package/smartMapping/renderers/support/spikeUtils.d.ts +4 -0
  391. package/smartMapping/renderers/support/spikeUtils.js +1 -1
  392. package/smartMapping/statistics/histogram.js +1 -1
  393. package/smartMapping/statistics/summaryStatistics.js +1 -1
  394. package/support/persistableUrlUtils.js +1 -1
  395. package/support/revision.js +1 -1
  396. package/symbols/cim/animationUtils.js +1 -1
  397. package/symbols/cim/cimAnalyzer.js +1 -1
  398. package/symbols/cim/defaultCIMValues.js +1 -1
  399. package/symbols/cim/effects/EffectEnclosingPolygon.js +1 -1
  400. package/symbols/cim/utils.js +1 -1
  401. package/symbols/support/ElevationInfo.d.ts +4 -0
  402. package/symbols/support/ElevationInfo.js +1 -1
  403. package/symbols/support/FeatureExpressionInfo.d.ts +4 -0
  404. package/symbols/support/FeatureExpressionInfo.js +1 -1
  405. package/symbols/support/cimSymbolUtils.js +1 -1
  406. package/symbols/support/previewCIMSymbol.js +1 -1
  407. package/symbols.js +1 -1
  408. package/undoredo/support/Services.js +1 -1
  409. package/views/2d/ViewStateManager.js +1 -1
  410. package/views/2d/constraints/GeometryConstraint.js +1 -1
  411. package/views/2d/engine/Bitmap.js +1 -1
  412. package/views/2d/engine/flow/styles/Imagery.js +1 -1
  413. package/views/2d/engine/vectorTiles/GlyphMosaic.js +1 -1
  414. package/views/2d/engine/vectorTiles/SpriteMosaic.js +1 -1
  415. package/views/2d/engine/vectorTiles/TileHandler3D.js +1 -1
  416. package/views/2d/engine/vectorTiles/VectorTile.js +1 -1
  417. package/views/2d/engine/vectorTiles/decluttering/SymbolDeclutterer.js +1 -1
  418. package/views/2d/engine/webgl/AttributeStoreView.js +1 -1
  419. package/views/2d/engine/webgl/GlyphMosaic.js +1 -1
  420. package/views/2d/engine/webgl/Overlay.js +1 -1
  421. package/views/2d/engine/webgl/OverlayMultipoint.js +1 -1
  422. package/views/2d/engine/webgl/SpriteMosaic.js +1 -1
  423. package/views/2d/engine/webgl/animations/infos.js +1 -1
  424. package/views/2d/engine/webgl/animations/instructions.js +1 -1
  425. package/views/2d/engine/webgl/animations/utils.js +1 -1
  426. package/views/2d/engine/webgl/brushes/WGLBrushTileDebugInfo.js +1 -1
  427. package/views/2d/engine/webgl/effects/highlight/HighlightGradient.js +1 -1
  428. package/views/2d/engine/webgl/effects/post-processing/Colorize.js +1 -1
  429. package/views/2d/engine/webgl/effects/post-processing/DropShadow.js +1 -1
  430. package/views/2d/engine/webgl/effects/post-processing/Opacity.js +1 -1
  431. package/views/2d/engine/webgl/shaderGraph/techniques/GraphicInstanceStore.js +1 -1
  432. package/views/2d/engine/webgl/shaderGraph/techniques/TechniqueRegistry.js +1 -1
  433. package/views/2d/engine/webgl/shaderGraph/techniques/TechniqueType.js +1 -1
  434. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AAnimatedPolyShader.js +5 -0
  435. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AAnimatedShader.js +5 -0
  436. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedFillShader.js +5 -0
  437. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedLineShader.js +5 -0
  438. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedMarkerMeshWriter.js +1 -1
  439. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedMarkerShader.js +1 -1
  440. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedPolyMeshWriters.js +5 -0
  441. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedTechnique.js +1 -1
  442. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedTechniques.js +5 -0
  443. package/views/2d/engine/webgl/shaderGraph/techniques/animated/ComputedAnimatedParams.js +5 -0
  444. package/views/2d/engine/webgl/shaderGraph/techniques/animated/attributes.js +5 -0
  445. package/views/2d/engine/webgl/shaderGraph/techniques/animated/enums.js +1 -1
  446. package/views/2d/engine/webgl/shaderGraph/techniques/blend/BlendTechnique.js +1 -1
  447. package/views/2d/engine/webgl/shaderGraph/techniques/createGraphicSymbolMeshSchemas.js +1 -1
  448. package/views/2d/engine/webgl/shaderGraph/techniques/dotDensity/DotDensityResources.js +1 -1
  449. package/views/2d/engine/webgl/shaderGraph/techniques/line/LineMeshWriter.js +1 -1
  450. package/views/2d/engine/webgl/shaderGraph/techniques/magnifier/MagnifierTechnique.js +1 -1
  451. package/views/2d/engine/webgl/shaderGraph/techniques/markers/MarkerShader.js +1 -1
  452. package/views/2d/engine/webgl/shaderGraph/techniques/mesh/MeshWriterRegistry.js +1 -1
  453. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/textureUtils.js +1 -1
  454. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/ComplexFillShader.js +1 -1
  455. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/LineShader.js +1 -1
  456. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/hittestUtils.js +1 -1
  457. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/utils.js +1 -1
  458. package/views/2d/grid/GridView2D.js +1 -1
  459. package/views/2d/interactive/editingTools/ControlPointsTransformTool.js +1 -1
  460. package/views/2d/interactive/editingTools/TransformTool.js +1 -1
  461. package/views/2d/layers/KMLLayerView2D.js +1 -1
  462. package/views/2d/layers/MediaLayerView2D.js +1 -1
  463. package/views/2d/layers/TileLayerView2D.js +1 -1
  464. package/views/2d/layers/VideoLayerView2D.js +1 -1
  465. package/views/2d/layers/features/schema/processor/symbols/ComplexSymbolSchema.js +1 -1
  466. package/views/2d/layers/features/schema/processor/symbols/utils.js +1 -1
  467. package/views/2d/viewpointUtils.js +1 -1
  468. package/views/3d/FocusAreasView.js +1 -1
  469. package/views/3d/analysis/AreaMeasurement/support/AreaMeasurementPathHelper.js +1 -1
  470. package/views/3d/analysis/AreaMeasurement/support/MeasurementData.js +1 -1
  471. package/views/3d/analysis/LineOfSight/LineOfSightController.js +1 -1
  472. package/views/3d/analysis/Slice/sliceToolUtils.js +1 -1
  473. package/views/3d/analysis/Viewshed/ViewshedSubTool.js +1 -1
  474. package/views/3d/analysis/ViewshedAnalysisView3D.js +1 -1
  475. package/views/3d/analysis/support/projectionUtils.js +1 -1
  476. package/views/3d/camera/constraintUtils/distance.js +1 -1
  477. package/views/3d/camera/constraintUtils/tilt.js +1 -1
  478. package/views/3d/environment/EnvironmentManager.js +1 -1
  479. package/views/3d/environment/LocalAtmosphere.js +1 -1
  480. package/views/3d/environment/MarsAtmosphere.js +1 -1
  481. package/views/3d/interactive/Manipulator3D.js +1 -1
  482. package/views/3d/interactive/editingTools/dragEventPipeline3D.js +1 -1
  483. package/views/3d/interactive/editingTools/media/MediaElementControllerControlPoints.js +1 -1
  484. package/views/3d/interactive/editingTools/media/MediaElementControllerShape.js +1 -1
  485. package/views/3d/interactive/editingTools/reshape/ReshapeTool3D.js +1 -1
  486. package/views/3d/interactive/editingTools/reshape/edgeOffsetUtils.js +1 -1
  487. package/views/3d/interactive/visualElements/DrapedVisualElementResources.js +1 -1
  488. package/views/3d/interactive/visualElements/support/Segment.js +1 -1
  489. package/views/3d/layers/BuildingComponentSublayerView3D.js +1 -1
  490. package/views/3d/layers/DrapedSubView3D.js +1 -1
  491. package/views/3d/layers/DynamicLayerView3D.js +1 -1
  492. package/views/3d/layers/FeatureLayerView3D.js +1 -1
  493. package/views/3d/layers/FlowSubView3D.js +1 -1
  494. package/views/3d/layers/I3SMeshView3D.js +1 -1
  495. package/views/3d/layers/I3SMeshWorkerHandle.js +1 -1
  496. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  497. package/views/3d/layers/PointCloudLayerView3D.js +1 -1
  498. package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
  499. package/views/3d/layers/SceneLayerWorker.js +1 -1
  500. package/views/3d/layers/SubView3D.js +1 -1
  501. package/views/3d/layers/TileLayerView3D.js +1 -1
  502. package/views/3d/layers/graphics/Deconflictor.js +1 -1
  503. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  504. package/views/3d/layers/graphics/Graphics3DFeatureStore.js +1 -1
  505. package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
  506. package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
  507. package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
  508. package/views/3d/layers/graphics/Graphics3DSymbolCreationContext.js +1 -1
  509. package/views/3d/layers/graphics/Graphics3DTextSymbolLayer.js +1 -1
  510. package/views/3d/layers/graphics/Graphics3DWaterSymbolLayer.js +1 -1
  511. package/views/3d/layers/graphics/focusAreaStyle.js +1 -1
  512. package/views/3d/layers/graphics/graphicUtils.js +1 -1
  513. package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
  514. package/views/3d/layers/graphics/pipeline/Feature3DPipelineWorker.js +1 -1
  515. package/views/3d/layers/i3s/I3SMaterialUtil.js +1 -1
  516. package/views/3d/layers/i3s/I3SMeshViewFilter.js +1 -1
  517. package/views/3d/layers/i3s/I3SUtil.js +1 -1
  518. package/views/3d/layers/support/DefinitionExpressionSceneLayerView.js +1 -1
  519. package/views/3d/layers/support/FeatureVisibilityFilter.js +1 -1
  520. package/views/3d/layers/support/ImageHighlightHelper3D.js +1 -1
  521. package/views/3d/layers/support/PopupSceneLayerView.js +1 -1
  522. package/views/3d/state/NearFarHeuristic.js +1 -1
  523. package/views/3d/state/ViewStateManager.js +1 -1
  524. package/views/3d/state/controllers/GamepadKeyboardController.js +1 -1
  525. package/views/3d/state/utils/navigationUtils.js +1 -1
  526. package/views/3d/support/cameraUtils.js +1 -1
  527. package/views/3d/support/engineContent/marker.js +1 -1
  528. package/views/3d/support/geometryUtils/sphere.js +1 -1
  529. package/views/3d/support/sunUtils.js +1 -1
  530. package/views/3d/support/viewpointUtils.js +1 -1
  531. package/views/3d/terrain/ExtentHelper.js +1 -1
  532. package/views/3d/terrain/OverlayManager.js +1 -1
  533. package/views/3d/terrain/OverlayRenderer.js +1 -1
  534. package/views/3d/terrain/TerrainRenderer.js +1 -1
  535. package/views/3d/terrain/TerrainSurface.js +1 -1
  536. package/views/3d/terrain/TileRenderer.js +1 -1
  537. package/views/3d/webgl/RenderCamera.js +1 -1
  538. package/views/3d/webgl/RenderNode.js +1 -1
  539. package/views/3d/webgl-engine/core/FBOCache.js +1 -1
  540. package/views/3d/webgl-engine/core/renderPasses/AllRenderPasses.js +1 -1
  541. package/views/3d/webgl-engine/core/renderPasses/RenderPassManager.js +1 -1
  542. package/views/3d/webgl-engine/core/shaderLibrary/terrain/Overlay.glsl.js +3 -3
  543. package/views/3d/webgl-engine/effects/focusArea/FocusAreaColorNode.js +1 -1
  544. package/views/3d/webgl-engine/effects/focusArea/FocusAreaEffect.js +5 -0
  545. package/views/3d/webgl-engine/effects/focusArea/FocusAreaMaskNode.js +1 -1
  546. package/views/3d/webgl-engine/effects/focusArea/FocusAreaOutlineItem.js +5 -0
  547. package/views/3d/webgl-engine/effects/laserlines/LaserLineRenderer.js +1 -1
  548. package/views/3d/webgl-engine/effects/laserlines/LaserlinePathTechniqueConfiguration.js +1 -1
  549. package/views/3d/webgl-engine/effects/magnifier/Magnifier.js +1 -1
  550. package/views/3d/webgl-engine/effects/smaa/SMAA.js +1 -1
  551. package/views/3d/webgl-engine/effects/ssao/SSAO.js +1 -1
  552. package/views/3d/webgl-engine/lib/Octree.js +1 -1
  553. package/views/3d/webgl-engine/lib/Texture.js +1 -1
  554. package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
  555. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  556. package/views/3d/webgl-engine/materials/stippleTextureRepository.js +1 -1
  557. package/views/3d/webgl-engine/shaders/CompositingTechniqueConfiguration.js +1 -1
  558. package/views/3d/webgl-engine/shaders/FocusAreaColor.glsl.js +1 -1
  559. package/views/SceneView.js +1 -1
  560. package/views/SelectionManager.js +1 -1
  561. package/views/VideoView.js +1 -1
  562. package/views/View2D.js +1 -1
  563. package/views/draw/support/GraphicMover.js +1 -1
  564. package/views/interactive/GraphicManipulator.js +1 -1
  565. package/views/interactive/dragEventPipeline.js +1 -1
  566. package/views/interactive/snapping/GridSnappingEngine.js +1 -1
  567. package/views/interactive/snapping/SnappingManager.js +1 -1
  568. package/views/interactive/snapping/featureSources/GraphicsSnappingSource.js +1 -1
  569. package/views/layers/CatalogDynamicGroupLayerView.js +1 -1
  570. package/views/layers/CatalogFootprintLayerView.js +1 -1
  571. package/views/layers/FeatureLayerView.js +1 -1
  572. package/views/layers/ImageryLayerView.js +1 -1
  573. package/views/layers/ImageryTileLayerView.js +1 -1
  574. package/views/layers/PointCloudLayerView.js +1 -1
  575. package/views/layers/SceneLayerView.js +1 -1
  576. package/views/support/TextureCompressionTracker.js +5 -0
  577. package/views/support/imageReprojection.js +1 -1
  578. package/views/support/projectionUtils.js +1 -1
  579. package/views/webgl/RenderingContext.js +1 -1
  580. package/views/webgl/Texture.js +1 -1
  581. package/views/webgl/rasterUtils.js +1 -1
  582. package/webdoc/support/writeUtils.js +1 -1
  583. package/webmap/utils.js +1 -1
  584. package/webscene/Slide.js +1 -1
  585. package/widgets/Attachments.js +1 -1
  586. package/widgets/BasemapGallery/BasemapGalleryViewModel.js +1 -1
  587. package/widgets/BasemapToggle/BasemapToggleViewModel.js +1 -1
  588. package/widgets/BatchAttributeForm.js +1 -1
  589. package/widgets/CoordinateConversion/CoordinateConversionViewModel.js +1 -1
  590. package/widgets/CoordinateConversion/support/Format.js +1 -1
  591. package/widgets/Daylight/DaylightViewModel.js +1 -1
  592. package/widgets/Directions/DirectionsVisibleElements.js +1 -1
  593. package/widgets/Directions/css.js +1 -1
  594. package/widgets/Directions.js +1 -1
  595. package/widgets/Editor/AddAssociationWorkflowData.js +1 -1
  596. package/widgets/Editor/EditorViewModel.js +1 -1
  597. package/widgets/Editor/UpdateFeatureWorkflow.js +1 -1
  598. package/widgets/Editor/UpdateFeaturesWorkflow.js +1 -1
  599. package/widgets/Editor/UpdateFeaturesWorkflowData.js +1 -1
  600. package/widgets/Editor/UpdateRecordWorkflowData.js +1 -1
  601. package/widgets/Editor/UpdateWorkflow.js +1 -1
  602. package/widgets/Editor/Upload.js +1 -1
  603. package/widgets/Editor/components/Notices.js +1 -1
  604. package/widgets/Editor/components/UpdateFeaturePanelContent.js +1 -1
  605. package/widgets/Editor/support/SketchController.js +1 -1
  606. package/widgets/Editor/workflowUtils.js +1 -1
  607. package/widgets/Editor.js +1 -1
  608. package/widgets/ElevationProfile/support/geometryUtils.js +1 -1
  609. package/widgets/Expand.js +1 -1
  610. package/widgets/Feature/support/featureUtils.js +1 -1
  611. package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationItemList.js +1 -1
  612. package/widgets/FeatureForm/FeatureFormViewModel.js +1 -1
  613. package/widgets/FeatureForm/VisibleElements.js +1 -1
  614. package/widgets/FeatureForm/featureFormUtils.js +1 -1
  615. package/widgets/FeatureForm.js +1 -1
  616. package/widgets/FeatureTable/FieldColumn.js +1 -1
  617. package/widgets/FeatureTable/Grid/EditorColumn.js +1 -1
  618. package/widgets/FeatureTable/Grid/Grid.js +1 -1
  619. package/widgets/Features/FeaturesViewModel.js +1 -1
  620. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  621. package/widgets/OrientedImageryViewer/adapters/sketch/MeasurementAdapter.js +1 -1
  622. package/widgets/OrientedImageryViewer/adapters/sketch/TriangulatedMeasurementAdapter.js +1 -1
  623. package/widgets/OrientedImageryViewer/adapters/view/SceneViewAdapter.js +1 -1
  624. package/widgets/OrientedImageryViewer/components/OrientedImageryVideoViewModel.js +1 -1
  625. package/widgets/OrientedImageryViewer/components/SequentialNavigationUI.js +1 -1
  626. package/widgets/OrientedImageryViewer/imageMeasurementUtils.js +1 -1
  627. package/widgets/OrientedImageryViewer/navigation/queries.js +1 -1
  628. package/widgets/OrientedImageryViewer/videoViewerUtils.js +5 -0
  629. package/widgets/OrientedImageryViewer.js +1 -1
  630. package/widgets/Search/LocatorSearchSource.js +1 -1
  631. package/widgets/Search/SearchSource.js +1 -1
  632. package/widgets/Search/SearchViewModel.js +1 -1
  633. package/widgets/Search/support/locatorUtils.js +1 -1
  634. package/widgets/ShadowCast/DiscreteOptions.js +1 -1
  635. package/widgets/ShadowCast/DurationOptions.js +1 -1
  636. package/widgets/ShadowCast/ShadowCastViewModel.js +1 -1
  637. package/widgets/ShadowCast/ShadowCastVisibleElements.js +1 -1
  638. package/widgets/ShadowCast/ThresholdOptions.js +1 -1
  639. package/widgets/Sketch/SketchViewModel.js +1 -1
  640. package/widgets/Sketch.js +1 -1
  641. package/widgets/UtilityNetworkTrace/support/GeometryHandler.js +1 -1
  642. package/widgets/VideoPlayer/VideoPlayerViewModel.js +1 -1
  643. package/widgets/VideoPlayer/components/SettingsButton.js +1 -1
  644. package/widgets/VideoPlayer.js +1 -1
  645. package/widgets/support/AnchorElementViewModel.js +1 -1
  646. package/widgets/support/GridControls/GridControlsViewModel.js +1 -1
  647. package/widgets/support/SelectionToolbar/SelectionToolbarViewModel.js +1 -1
  648. package/widgets/support/SelectionToolbar.js +1 -1
  649. package/widgets/support/Selector2D/SelectionOperation.js +1 -1
  650. package/widgets/support/Selector2D/selectorUtils.js +1 -1
  651. package/widgets/support/UtilityNetworkAssociations/utils/isFromElement.js +1 -1
  652. package/widgets/support/tests.js +1 -1
  653. package/assets/esri/core/workers/chunks/003ddb190a5cc56f7925.js +0 -1
  654. package/assets/esri/core/workers/chunks/094e8aae6dada24c8115.js +0 -1
  655. package/assets/esri/core/workers/chunks/0a770f283eb77c8dc97a.js +0 -1
  656. package/assets/esri/core/workers/chunks/0b70b2ee62904318a12c.js +0 -1
  657. package/assets/esri/core/workers/chunks/0c2dccec20c0994366fe.js +0 -1
  658. package/assets/esri/core/workers/chunks/0cf979a093e9744d1e80.js +0 -1
  659. package/assets/esri/core/workers/chunks/0fb5de3f8a4d69b2d514.js +0 -1
  660. package/assets/esri/core/workers/chunks/1d7f2abfccc54659d6f2.js +0 -1
  661. package/assets/esri/core/workers/chunks/1f9c6fbcd4d0eae1e574.js +0 -1
  662. package/assets/esri/core/workers/chunks/24327d01cb2c5c55a4b7.js +0 -1
  663. package/assets/esri/core/workers/chunks/253bcc3cc7bc4c2dc6ea.js +0 -1
  664. package/assets/esri/core/workers/chunks/2b1486a466760d2152f5.js +0 -1
  665. package/assets/esri/core/workers/chunks/2cf82d3645c75d311e99.js +0 -1
  666. package/assets/esri/core/workers/chunks/2d90806faa4269828948.js +0 -1
  667. package/assets/esri/core/workers/chunks/306e262f148b3057b11b.js +0 -1
  668. package/assets/esri/core/workers/chunks/32ee2708edd307954125.js +0 -1
  669. package/assets/esri/core/workers/chunks/36b0d6b4089a96475201.js +0 -1
  670. package/assets/esri/core/workers/chunks/377a7f0f7d304ff9fe5b.js +0 -1
  671. package/assets/esri/core/workers/chunks/3a743653b786b010a57f.js +0 -1
  672. package/assets/esri/core/workers/chunks/3bf1cf6c3cba172e2f6d.js +0 -1
  673. package/assets/esri/core/workers/chunks/3d7eedb787c1e3b9fbfc.js +0 -1
  674. package/assets/esri/core/workers/chunks/3fe7be535affae31de7e.js +0 -1
  675. package/assets/esri/core/workers/chunks/40f54c4f8ae63c6f3df9.js +0 -1
  676. package/assets/esri/core/workers/chunks/417293f00b2c21cc3175.js +0 -1
  677. package/assets/esri/core/workers/chunks/41cbba9b286cf5558a9c.js +0 -1
  678. package/assets/esri/core/workers/chunks/42d9989b2aad3ac28d4d.js +0 -1
  679. package/assets/esri/core/workers/chunks/465f2db4ab8aa9c9f907.js +0 -1
  680. package/assets/esri/core/workers/chunks/4ca0738ed38c15b68a77.js +0 -1
  681. package/assets/esri/core/workers/chunks/515e3295495d0958db7e.js +0 -1
  682. package/assets/esri/core/workers/chunks/51c31e6d014005107d42.js +0 -1
  683. package/assets/esri/core/workers/chunks/523046e04679e301797d.js +0 -1
  684. package/assets/esri/core/workers/chunks/536d7986ebb710a8a452.js +0 -1
  685. package/assets/esri/core/workers/chunks/55f087bca75c3f2a4515.js +0 -1
  686. package/assets/esri/core/workers/chunks/5617532299f73d186968.js +0 -1
  687. package/assets/esri/core/workers/chunks/56d2a20c1b143697aa19.js +0 -1
  688. package/assets/esri/core/workers/chunks/585c7b485c42555ec554.js +0 -346
  689. package/assets/esri/core/workers/chunks/5890740d5a761b038560.js +0 -1
  690. package/assets/esri/core/workers/chunks/5dbd8d81d94cfda5bb32.js +0 -1
  691. package/assets/esri/core/workers/chunks/5e1f7fe6bbc5754efee1.js +0 -1
  692. package/assets/esri/core/workers/chunks/62b2d3720693c93a60f2.js +0 -1
  693. package/assets/esri/core/workers/chunks/66e79aa02b3aa12b3778.js +0 -1
  694. package/assets/esri/core/workers/chunks/67338948e470c1251d8a.js +0 -66
  695. package/assets/esri/core/workers/chunks/6b23ca6570357f9fb724.js +0 -1
  696. package/assets/esri/core/workers/chunks/6d1e1a4fcb90ea8b6848.js +0 -1
  697. package/assets/esri/core/workers/chunks/6ecc3a3737ae8622dfa4.js +0 -1
  698. package/assets/esri/core/workers/chunks/85efb318cda7260221ae.js +0 -1
  699. package/assets/esri/core/workers/chunks/86023cc5ccbc7ac43479.js +0 -1
  700. package/assets/esri/core/workers/chunks/87eca6de502d18d8b7eb.js +0 -1
  701. package/assets/esri/core/workers/chunks/87fc7b6c3e2d4f7775e2.js +0 -1
  702. package/assets/esri/core/workers/chunks/937b653b10e8704b38bf.js +0 -1
  703. package/assets/esri/core/workers/chunks/98ef17d15517368d2383.js +0 -1
  704. package/assets/esri/core/workers/chunks/9cac00d4bfac14aaae12.js +0 -1
  705. package/assets/esri/core/workers/chunks/a036503087baa1f9fd00.js +0 -1
  706. package/assets/esri/core/workers/chunks/a0c35521e677459f6fa3.js +0 -1
  707. package/assets/esri/core/workers/chunks/aaa6d45316a7d3466d0f.js +0 -1
  708. package/assets/esri/core/workers/chunks/ae733c963d61065faa54.js +0 -1
  709. package/assets/esri/core/workers/chunks/b06cb23048c32940f5de.js +0 -1
  710. package/assets/esri/core/workers/chunks/b5d68d8460b7c15001dd.js +0 -1
  711. package/assets/esri/core/workers/chunks/bf3555f91492a1a3b613.js +0 -1
  712. package/assets/esri/core/workers/chunks/bf9b6b74654d303a6dae.js +0 -1
  713. package/assets/esri/core/workers/chunks/c6580fdcdc33153008b0.js +0 -1
  714. package/assets/esri/core/workers/chunks/c779335f5d5455c77a62.js +0 -1
  715. package/assets/esri/core/workers/chunks/c9ab067b07d1eab974d1.js +0 -1
  716. package/assets/esri/core/workers/chunks/d2ebb72a43d995ed368a.js +0 -1
  717. package/assets/esri/core/workers/chunks/d3d98ea5b5e56fc60a31.js +0 -1
  718. package/assets/esri/core/workers/chunks/d52f5214a0330ed2e05e.js +0 -1
  719. package/assets/esri/core/workers/chunks/d839a237d5edc243d645.js +0 -1
  720. package/assets/esri/core/workers/chunks/dbe10c20df7e0e563a0b.js +0 -1
  721. package/assets/esri/core/workers/chunks/df7ca2fe12e22ccfde17.js +0 -1
  722. package/assets/esri/core/workers/chunks/df933eac03dc63064723.js +0 -1
  723. package/assets/esri/core/workers/chunks/e04bcc98a557f77cc6fa.js +0 -1
  724. package/assets/esri/core/workers/chunks/e77371ddbaf4b2d9be8d.js +0 -1
  725. package/assets/esri/core/workers/chunks/e89345c7af9d3d4d8452.js +0 -1
  726. package/assets/esri/core/workers/chunks/ee6240636d04d7d37b7b.js +0 -1
  727. package/assets/esri/core/workers/chunks/f00f8609bf0d14b488b8.js +0 -1
  728. package/assets/esri/core/workers/chunks/fc0a3db3d6d26c763fb9.js +0 -1
  729. package/assets/esri/core/workers/chunks/fc61d02286b6ff5447cc.js +0 -1
  730. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedMarkerTechnique.js +0 -5
  731. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedShader.js +0 -5
  732. package/views/FocusArea.js +0 -5
  733. package/views/FocusAreaOutline.js +0 -5
  734. package/views/FocusAreaOutlineItem.js +0 -5
  735. package/views/FocusAreas.js +0 -5
  736. package/views/support/TextureCompressionHandle.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.34/esri/copyright.txt for details.
4
4
  */
5
- import{_ as t}from"../../chunks/tslib.es6.js";import e from"../../core/Accessor.js";import o from"../../core/Evented.js";import{watch as i,sync as s}from"../../core/reactiveUtils.js";import{screenPointObjectToArray as r,pt2px as l,createScreenPointArray as n}from"../../core/screenUtils.js";import{property as a}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as c}from"../../core/accessorSupport/decorators/subclass.js";import{squaredDistance as h}from"../../core/libs/gl-matrix-2/math/vec2.js";import{j as p}from"../../chunks/vec32.js";import{create as m}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{canProjectWithoutEngine as u,project as y}from"../../geometry/projection.js";import{projectPointToVector as g}from"../../geometry/projection/projectPointToVector.js";import{getGraphicEffectiveElevationMode as b}from"../../support/elevationInfoUtils.js";import{getDefaultSymbol2D as d}from"../../symbols/support/defaults.js";import f from"../../symbols/support/ElevationInfo.js";import{getSymbolInfo as _}from"./support/utils.js";import{intersectsDrapedGeometry as v}from"../support/drapedUtils.js";let S=class extends e{set graphic(t){this._circleCollisionCache=null,this._originalSymbol=t.symbol,this._set("graphic",t),this.attachSymbolChanged()}get elevationInfo(){const{layer:t}=this.graphic,e=t&&"elevationInfo"in t?t.elevationInfo:null,o=b(this.graphic),i=e?e.offset:0;return new f({mode:o,offset:i})}set focusedSymbol(t){t!==this._get("focusedSymbol")&&(this._set("focusedSymbol",t),this._updateGraphicSymbol(),this._circleCollisionCache=null)}grabbableForEvent(){return!0}set grabbing(t){t!==this._get("grabbing")&&(this._set("grabbing",t),this._updateGraphicSymbol())}set hovering(t){t!==this._get("hovering")&&(this._set("hovering",t),this._updateGraphicSymbol())}set selected(t){t!==this._get("selected")&&(this._set("selected",t),this._updateGraphicSymbol(),this.events.emit("select-changed",{action:t?"select":"deselect"}))}get _focused(){return this._get("hovering")||this._get("grabbing")}constructor(t){super(t),this.layer=null,this.interactive=!0,this.selectable=!1,this.grabbable=!0,this.dragging=!1,this.cursor=null,this.consumesClicks=!0,this.events=new o.EventEmitter,this._circleCollisionCache=null,this._graphicSymbolChangedHandle=null,this._originalSymbol=null}destroy(){this.detachSymbolChanged(),this._resetGraphicSymbol(),this._set("view",null)}intersectionDistance(t){const e=this.graphic;if(!1===e.visible)return null;const o=e.geometry;if(null==o)return null;const i=this._get("focusedSymbol"),s=null!=i?i:e.symbol;return"2d"===this.view.type?this._intersectDistance2D(this.view,t,o,s):this._intersectDistance3D(this.view,t,e)}attach(){this.attachSymbolChanged(),null!=this.layer&&this.layer.add(this.graphic)}detach(){this.detachSymbolChanged(),this._resetGraphicSymbol(),null!=this.layer&&this.layer.remove(this.graphic)}attachSymbolChanged(){this.detachSymbolChanged(),this._graphicSymbolChangedHandle=i((()=>this.graphic?.symbol),(t=>{null!=t&&t!==this.focusedSymbol&&t!==this._originalSymbol&&(this._originalSymbol=t,this._focused&&null!=this.focusedSymbol&&(this.graphic.symbol=this.focusedSymbol))}),s)}detachSymbolChanged(){null!=this._graphicSymbolChangedHandle&&(this._graphicSymbolChangedHandle.remove(),this._graphicSymbolChangedHandle=null)}onElevationChange(){}onViewChange(){}_updateGraphicSymbol(){this.graphic.symbol=this._focused&&null!=this.focusedSymbol?this.focusedSymbol:this._originalSymbol}_resetGraphicSymbol(){this.graphic.symbol=this._originalSymbol}_intersectDistance2D(t,e,o,i){if(null==(i=i||d(o)))return null;const s=1;let n=this._circleCollisionCache;if("point"===o.type&&"cim"===i.type&&"CIMPointSymbol"===i.data.symbol?.type&&i.data.symbol.symbolLayers){const{offsetX:l,offsetY:n,size:a}=_(i),c=r(e,j),p=a/2,m=t.toScreen(o),u=m.x+l,y=m.y+n;return h(c,[u,y])<p*p?s:null}if("point"!==o.type||"simple-marker"!==i.type)return v(e,o,t)?s:null;if(null==n||!n.originalPoint.equals(o)){const e=o,s=t.spatialReference;if(u(e.spatialReference,s)){const t=y(e,s);n={originalPoint:e.clone(),mapPoint:t,radiusPx:l(i.size)},this._circleCollisionCache=n}}if(null!=n){const o=r(e,j),a=t.toScreen?.(n.mapPoint);if(!a)return null;const c=n.radiusPx,p=a.x+l(i.xoffset),m=a.y-l(i.yoffset);return h(o,[p,m])<c*c?s:null}return null}_intersectDistance3D(t,e,o){const i=t.toMap(e,{include:[o]});return i&&g(i,C,t.renderSpatialReference)?p(C,t.state.camera.eye):null}};t([a({constructOnly:!0,nonNullable:!0})],S.prototype,"graphic",null),t([a()],S.prototype,"elevationInfo",null),t([a({constructOnly:!0,nonNullable:!0})],S.prototype,"view",void 0),t([a({value:null})],S.prototype,"focusedSymbol",null),t([a({constructOnly:!0})],S.prototype,"layer",void 0),t([a()],S.prototype,"interactive",void 0),t([a()],S.prototype,"selectable",void 0),t([a()],S.prototype,"grabbable",void 0),t([a({value:!1})],S.prototype,"grabbing",null),t([a()],S.prototype,"dragging",void 0),t([a()],S.prototype,"hovering",null),t([a({value:!1})],S.prototype,"selected",null),t([a()],S.prototype,"cursor",void 0),S=t([c("esri.views.interactive.GraphicManipulator")],S);const C=m(),j=n();export{S as GraphicManipulator};
5
+ import{_ as t}from"../../chunks/tslib.es6.js";import e from"../../core/Accessor.js";import o from"../../core/Evented.js";import{watch as i,sync as s}from"../../core/reactiveUtils.js";import{screenPointObjectToArray as r,pt2px as l,createScreenPointArray as n}from"../../core/screenUtils.js";import{property as a}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as c}from"../../core/accessorSupport/decorators/subclass.js";import{squaredDistance as h}from"../../core/libs/gl-matrix-2/math/vec2.js";import{j as p}from"../../chunks/vec32.js";import{create as m}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{canProjectWithoutEngine as u,project as y}from"../../geometry/projectionUtils.js";import{projectPointToVector as g}from"../../geometry/projection/projectPointToVector.js";import{getGraphicEffectiveElevationMode as b}from"../../support/elevationInfoUtils.js";import{getDefaultSymbol2D as d}from"../../symbols/support/defaults.js";import f from"../../symbols/support/ElevationInfo.js";import{getSymbolInfo as _}from"./support/utils.js";import{intersectsDrapedGeometry as v}from"../support/drapedUtils.js";let S=class extends e{set graphic(t){this._circleCollisionCache=null,this._originalSymbol=t.symbol,this._set("graphic",t),this.attachSymbolChanged()}get elevationInfo(){const{layer:t}=this.graphic,e=t&&"elevationInfo"in t?t.elevationInfo:null,o=b(this.graphic),i=e?e.offset:0;return new f({mode:o,offset:i})}set focusedSymbol(t){t!==this._get("focusedSymbol")&&(this._set("focusedSymbol",t),this._updateGraphicSymbol(),this._circleCollisionCache=null)}grabbableForEvent(){return!0}set grabbing(t){t!==this._get("grabbing")&&(this._set("grabbing",t),this._updateGraphicSymbol())}set hovering(t){t!==this._get("hovering")&&(this._set("hovering",t),this._updateGraphicSymbol())}set selected(t){t!==this._get("selected")&&(this._set("selected",t),this._updateGraphicSymbol(),this.events.emit("select-changed",{action:t?"select":"deselect"}))}get _focused(){return this._get("hovering")||this._get("grabbing")}constructor(t){super(t),this.layer=null,this.interactive=!0,this.selectable=!1,this.grabbable=!0,this.dragging=!1,this.cursor=null,this.consumesClicks=!0,this.events=new o.EventEmitter,this._circleCollisionCache=null,this._graphicSymbolChangedHandle=null,this._originalSymbol=null}destroy(){this.detachSymbolChanged(),this._resetGraphicSymbol(),this._set("view",null)}intersectionDistance(t){const e=this.graphic;if(!1===e.visible)return null;const o=e.geometry;if(null==o)return null;const i=this._get("focusedSymbol"),s=null!=i?i:e.symbol;return"2d"===this.view.type?this._intersectDistance2D(this.view,t,o,s):this._intersectDistance3D(this.view,t,e)}attach(){this.attachSymbolChanged(),null!=this.layer&&this.layer.add(this.graphic)}detach(){this.detachSymbolChanged(),this._resetGraphicSymbol(),null!=this.layer&&this.layer.remove(this.graphic)}attachSymbolChanged(){this.detachSymbolChanged(),this._graphicSymbolChangedHandle=i((()=>this.graphic?.symbol),(t=>{null!=t&&t!==this.focusedSymbol&&t!==this._originalSymbol&&(this._originalSymbol=t,this._focused&&null!=this.focusedSymbol&&(this.graphic.symbol=this.focusedSymbol))}),s)}detachSymbolChanged(){null!=this._graphicSymbolChangedHandle&&(this._graphicSymbolChangedHandle.remove(),this._graphicSymbolChangedHandle=null)}onElevationChange(){}onViewChange(){}_updateGraphicSymbol(){this.graphic.symbol=this._focused&&null!=this.focusedSymbol?this.focusedSymbol:this._originalSymbol}_resetGraphicSymbol(){this.graphic.symbol=this._originalSymbol}_intersectDistance2D(t,e,o,i){if(null==(i=i||d(o)))return null;const s=1;let n=this._circleCollisionCache;if("point"===o.type&&"cim"===i.type&&"CIMPointSymbol"===i.data.symbol?.type&&i.data.symbol.symbolLayers){const{offsetX:l,offsetY:n,size:a}=_(i),c=r(e,j),p=a/2,m=t.toScreen(o),u=m.x+l,y=m.y+n;return h(c,[u,y])<p*p?s:null}if("point"!==o.type||"simple-marker"!==i.type)return v(e,o,t)?s:null;if(null==n||!n.originalPoint.equals(o)){const e=o,s=t.spatialReference;if(u(e.spatialReference,s)){const t=y(e,s);n={originalPoint:e.clone(),mapPoint:t,radiusPx:l(i.size)},this._circleCollisionCache=n}}if(null!=n){const o=r(e,j),a=t.toScreen?.(n.mapPoint);if(!a)return null;const c=n.radiusPx,p=a.x+l(i.xoffset),m=a.y-l(i.yoffset);return h(o,[p,m])<c*c?s:null}return null}_intersectDistance3D(t,e,o){const i=t.toMap(e,{include:[o]});return i&&g(i,C,t.renderSpatialReference)?p(C,t.state.camera.eye):null}};t([a({constructOnly:!0,nonNullable:!0})],S.prototype,"graphic",null),t([a()],S.prototype,"elevationInfo",null),t([a({constructOnly:!0,nonNullable:!0})],S.prototype,"view",void 0),t([a({value:null})],S.prototype,"focusedSymbol",null),t([a({constructOnly:!0})],S.prototype,"layer",void 0),t([a()],S.prototype,"interactive",void 0),t([a()],S.prototype,"selectable",void 0),t([a()],S.prototype,"grabbable",void 0),t([a({value:!1})],S.prototype,"grabbing",null),t([a()],S.prototype,"dragging",void 0),t([a()],S.prototype,"hovering",null),t([a({value:!1})],S.prototype,"selected",null),t([a()],S.prototype,"cursor",void 0),S=t([c("esri.views.interactive.GraphicManipulator")],S);const C=m(),j=n();export{S as GraphicManipulator};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{isSome as t}from"../../core/arrayUtils.js";import"../../core/has.js";import{clone as n}from"../../core/lang.js";import{clamp as e}from"../../core/mathUtils.js";import{createScreenPoint as r}from"../../core/screenUtils.js";import{project as a}from"../../geometry/projection.js";import{isMeshWithRelativeVertexSpace as o}from"../../geometry/support/meshVertexSpaceUtils.js";import{clonePoint as l,hydratedSpatialReference as c}from"../../layers/graphics/hydratedFeatures.js";import{getZForElevationMode as s}from"../../support/elevationInfoUtils.js";import{EditGeometryOperations as u}from"./editGeometry/EditGeometryOperations.js";function i(t,n){let e=null,r=null;return a=>{if("cancel"===a.action)return void(null!=r&&(r.execute({action:"cancel"}),e=null,r=null));const o={action:a.action,screenStart:a.start,screenEnd:a.screenPoint};"start"===a.action&&null==e&&(e=new w,r=new w,n(t,e,r,a.pointerType,o)),null!=e&&e.execute(o),"end"===a.action&&null!=e&&(e=null,r=null)}}function p(t,n){return t.events.on("drag",i(t,n))}function m(t,n){const e=[t.x,t.y,t.z??0],r=n,a=[Math.cos(r),Math.sin(r)],o=Math.sqrt(a[0]*a[0]+a[1]*a[1]);if(0===o)return null;a[0]/=o,a[1]/=o;const l=t=>{const n=(t.x-e[0])*a[0]+(t.y-e[1])*a[1];t.x=e[0]+n*a[0],t.y=e[1]+n*a[1]};return t=>(l(t.mapStart),l(t.mapEnd),{...t,axis:a})}function f(t){let n=null;return e=>{if("start"===e.action&&(n=y(t,e.mapStart.spatialReference)),null==n)return null;const r=e.mapEnd.x-e.mapStart.x,a=e.mapEnd.y-e.mapStart.y,o=(e.mapEnd.z??0)-(e.mapStart.z??0);return n.move(r,a,o,e.action),{...e,translationX:r,translationY:a,translationZ:o}}}function d(t,n){return null==t?null:t.spatialReference.equals(n)?t.clone():a(t,n)}function y(t,n){const e=t.operations;if(!e)return null;const r=e.data.geometry,l=c(n);if(r.spatialReference.equals(l))return x(t,e,(()=>{}));if("mesh"!==r.type){const n=d(r,l);if(null==n)return null;const o=r.spatialReference;return x(t,u.fromGeometry(n,e.viewingMode),(()=>{const t=a(r,o);e.trySetGeometry(t)}))}if(o(r)){const n=d(r.origin,l);if(!n)return null;const o=r.spatialReference,c=u.fromGeometry(n,e.viewingMode);return x(t,e,(()=>{const t=a(c.data.geometry,o),n=t.x-r.origin.x,l=t.y-r.origin.y,s=(t.z??0)-(r.origin.z??0);e.move(n,l,s)}))}return null}function x(t,n,e){let r=0,a=0,o=0;return{move:(l,c,s,u)=>{"start"===u&&(r=0,a=0,o=0);const i=l-r,p=c-a,m=s-o;n.move(i,p,m),r+=i,a+=p,o+=m,e(),"end"===u&&t.endInteraction?.()}}}function E(t,n=null,e){let r=null;const o=null==n||t.spatialReference?.equals(n)?t=>t:t=>null!=t?a(t,n):t,l={exclude:[],...e};return n=>{if("start"===n.action&&(r=o(t.toMap(n.screenStart,l))),null==r)return null;const e=o(t.toMap(n.screenEnd,l));return null!=e?{...n,mapStart:r,mapEnd:e}:null}}function S(n){const e=n.map((t=>f(t))).filter(t);return t=>{const n=t.mapEnd.x-t.mapStart.x,r=t.mapEnd.y-t.mapStart.y,a=t.mapEnd.z-t.mapStart.z;return e.forEach((n=>n(t))),{...t,translationX:n,translationY:r,translationZ:a}}}function h(t,e){const r=new Map;for(const a of e)r.set(a,n(t[a]));return n=>(r.forEach(((n,e)=>{t[e]=n})),n)}function g(t){const n=t.operations?.createResetState();return t=>(n?.remove(),t)}function z(t){const n=t.map((t=>g(t))).filter((t=>null!=t));return t=>(n.forEach((n=>n(t))),t)}function v(){let t=0,n=0,e=0;return r=>{"start"===r.action&&(t=r.mapStart.x,n=r.mapStart.y,e=r.mapStart.z);const a=r.mapEnd.x-t,o=r.mapEnd.y-n,l=r.mapEnd.z-e;return t=r.mapEnd.x,n=r.mapEnd.y,e=r.mapEnd.z,{...r,mapDeltaX:a,mapDeltaY:o,mapDeltaZ:l,mapDeltaSpatialReference:r.mapStart.spatialReference}}}function j(){let t=0,n=0;return e=>{"start"===e.action&&(t=e.screenStart.x,n=e.screenStart.y);const r=e.screenEnd.x-t,a=e.screenEnd.y-n;return t=e.screenEnd.x,n=e.screenEnd.y,{...e,screenDeltaX:r,screenDeltaY:a}}}function M(t,n){let a=null,o=0,l=0;return c=>{if("start"===c.action&&(a=t.toScreen?.(n),null!=a&&(a.x<0||a.x>t.width||a.y<0||a.y>t.height?a=null:(o=c.screenStart.x-a.x,l=c.screenStart.y-a.y))),null==a)return null;const s=e(c.screenEnd.x-o,0,t.width),u=e(c.screenEnd.y-l,0,t.height),i=r(s,u);return c.screenStart=a,c.screenEnd=i,c}}const R=()=>{};class w{constructor(){this.execute=R}next(t,n=new w){return null!=t&&(this.execute=e=>{const r=t(e);null!=r&&n.execute(r)}),n}}function D(t,n,e=[]){if("2d"===t.type)return t=>t;let r=null;return a=>{"start"===a.action&&(r=t.toMap(a.screenStart,{exclude:e}),null!=r&&(r.z=s(r,t,n)));const o=t.toMap(a.screenEnd,{exclude:e});null!=o&&(o.z=s(o,t,n));const l=null!=r&&null!=o?{sceneStart:r,sceneEnd:o}:null;return{...a,scenePoints:l}}}function G(t,n,e){const r=n.elevationProvider.getElevation(t.x,t.y,t.z??0,t.spatialReference,"scene")??0,a=l(t);return a.z=r,a.hasZ=!0,a.z=s(a,n,e),a}function U(t,n){if("2d"===t.type)return t=>t;let e=null;return r=>{"start"===r.action&&(e=G(r.mapStart,t,n));const a=G(r.mapEnd,t,n),o=null!=e&&null!=a?{sceneStart:e,sceneEnd:a}:null;return{...r,scenePoints:o}}}export{w as EventPipeline,v as addMapDelta,j as addScreenDelta,m as constrainToMapAxis,i as createDragEventPipelineCallback,p as createManipulatorDragEventPipeline,M as dragAtLocation,f as dragManipulatedObject,S as dragManipulatedObjectMany,g as resetManipulatedObject,z as resetManipulatedObjectMany,h as resetProperties,D as sceneSnappingAtLocation,U as sceneSnappingAtProjectedLocation,E as screenToMap};
5
+ import{isSome as t}from"../../core/arrayUtils.js";import"../../core/has.js";import{clone as n}from"../../core/lang.js";import{clamp as e}from"../../core/mathUtils.js";import{createScreenPoint as r}from"../../core/screenUtils.js";import{project as a}from"../../geometry/projectionUtils.js";import{isMeshWithRelativeVertexSpace as o}from"../../geometry/support/meshVertexSpaceUtils.js";import{clonePoint as l,hydratedSpatialReference as c}from"../../layers/graphics/hydratedFeatures.js";import{getZForElevationMode as s}from"../../support/elevationInfoUtils.js";import{EditGeometryOperations as u}from"./editGeometry/EditGeometryOperations.js";function i(t,n){let e=null,r=null;return a=>{if("cancel"===a.action)return void(null!=r&&(r.execute({action:"cancel"}),e=null,r=null));const o={action:a.action,screenStart:a.start,screenEnd:a.screenPoint};"start"===a.action&&null==e&&(e=new w,r=new w,n(t,e,r,a.pointerType,o)),null!=e&&e.execute(o),"end"===a.action&&null!=e&&(e=null,r=null)}}function p(t,n){return t.events.on("drag",i(t,n))}function m(t,n){const e=[t.x,t.y,t.z??0],r=n,a=[Math.cos(r),Math.sin(r)],o=Math.sqrt(a[0]*a[0]+a[1]*a[1]);if(0===o)return null;a[0]/=o,a[1]/=o;const l=t=>{const n=(t.x-e[0])*a[0]+(t.y-e[1])*a[1];t.x=e[0]+n*a[0],t.y=e[1]+n*a[1]};return t=>(l(t.mapStart),l(t.mapEnd),{...t,axis:a})}function f(t){let n=null;return e=>{if("start"===e.action&&(n=y(t,e.mapStart.spatialReference)),null==n)return null;const r=e.mapEnd.x-e.mapStart.x,a=e.mapEnd.y-e.mapStart.y,o=(e.mapEnd.z??0)-(e.mapStart.z??0);return n.move(r,a,o,e.action),{...e,translationX:r,translationY:a,translationZ:o}}}function d(t,n){return null==t?null:t.spatialReference.equals(n)?t.clone():a(t,n)}function y(t,n){const e=t.operations;if(!e)return null;const r=e.data.geometry,l=c(n);if(r.spatialReference.equals(l))return x(t,e,(()=>{}));if("mesh"!==r.type){const n=d(r,l);if(null==n)return null;const o=r.spatialReference;return x(t,u.fromGeometry(n,e.viewingMode),(()=>{const t=a(r,o);e.trySetGeometry(t)}))}if(o(r)){const n=d(r.origin,l);if(!n)return null;const o=r.spatialReference,c=u.fromGeometry(n,e.viewingMode);return x(t,e,(()=>{const t=a(c.data.geometry,o),n=t.x-r.origin.x,l=t.y-r.origin.y,s=(t.z??0)-(r.origin.z??0);e.move(n,l,s)}))}return null}function x(t,n,e){let r=0,a=0,o=0;return{move:(l,c,s,u)=>{"start"===u&&(r=0,a=0,o=0);const i=l-r,p=c-a,m=s-o;n.move(i,p,m),r+=i,a+=p,o+=m,e(),"end"===u&&t.endInteraction?.()}}}function E(t,n=null,e){let r=null;const o=null==n||t.spatialReference?.equals(n)?t=>t:t=>null!=t?a(t,n):t,l={exclude:[],...e};return n=>{if("start"===n.action&&(r=o(t.toMap(n.screenStart,l))),null==r)return null;const e=o(t.toMap(n.screenEnd,l));return null!=e?{...n,mapStart:r,mapEnd:e}:null}}function S(n){const e=n.map((t=>f(t))).filter(t);return t=>{const n=t.mapEnd.x-t.mapStart.x,r=t.mapEnd.y-t.mapStart.y,a=t.mapEnd.z-t.mapStart.z;return e.forEach((n=>n(t))),{...t,translationX:n,translationY:r,translationZ:a}}}function h(t,e){const r=new Map;for(const a of e)r.set(a,n(t[a]));return n=>(r.forEach(((n,e)=>{t[e]=n})),n)}function g(t){const n=t.operations?.createResetState();return t=>(n?.remove(),t)}function z(t){const n=t.map((t=>g(t))).filter((t=>null!=t));return t=>(n.forEach((n=>n(t))),t)}function v(){let t=0,n=0,e=0;return r=>{"start"===r.action&&(t=r.mapStart.x,n=r.mapStart.y,e=r.mapStart.z);const a=r.mapEnd.x-t,o=r.mapEnd.y-n,l=r.mapEnd.z-e;return t=r.mapEnd.x,n=r.mapEnd.y,e=r.mapEnd.z,{...r,mapDeltaX:a,mapDeltaY:o,mapDeltaZ:l,mapDeltaSpatialReference:r.mapStart.spatialReference}}}function j(){let t=0,n=0;return e=>{"start"===e.action&&(t=e.screenStart.x,n=e.screenStart.y);const r=e.screenEnd.x-t,a=e.screenEnd.y-n;return t=e.screenEnd.x,n=e.screenEnd.y,{...e,screenDeltaX:r,screenDeltaY:a}}}function M(t,n){let a=null,o=0,l=0;return c=>{if("start"===c.action&&(a=t.toScreen?.(n),null!=a&&(a.x<0||a.x>t.width||a.y<0||a.y>t.height?a=null:(o=c.screenStart.x-a.x,l=c.screenStart.y-a.y))),null==a)return null;const s=e(c.screenEnd.x-o,0,t.width),u=e(c.screenEnd.y-l,0,t.height),i=r(s,u);return c.screenStart=a,c.screenEnd=i,c}}const R=()=>{};class w{constructor(){this.execute=R}next(t,n=new w){return null!=t&&(this.execute=e=>{const r=t(e);null!=r&&n.execute(r)}),n}}function D(t,n,e=[]){if("2d"===t.type)return t=>t;let r=null;return a=>{"start"===a.action&&(r=t.toMap(a.screenStart,{exclude:e}),null!=r&&(r.z=s(r,t,n)));const o=t.toMap(a.screenEnd,{exclude:e});null!=o&&(o.z=s(o,t,n));const l=null!=r&&null!=o?{sceneStart:r,sceneEnd:o}:null;return{...a,scenePoints:l}}}function U(t,n,e){const r=n.elevationProvider.getElevation(t.x,t.y,t.z??0,t.spatialReference,"scene")??0,a=l(t);return a.z=r,a.hasZ=!0,a.z=s(a,n,e),a}function G(t,n){if("2d"===t.type)return t=>t;let e=null;return r=>{"start"===r.action&&(e=U(r.mapStart,t,n));const a=U(r.mapEnd,t,n),o=null!=e&&null!=a?{sceneStart:e,sceneEnd:a}:null;return{...r,scenePoints:o}}}export{w as EventPipeline,v as addMapDelta,j as addScreenDelta,m as constrainToMapAxis,i as createDragEventPipelineCallback,p as createManipulatorDragEventPipeline,M as dragAtLocation,f as dragManipulatedObject,S as dragManipulatedObjectMany,g as resetManipulatedObject,z as resetManipulatedObjectMany,h as resetProperties,D as sceneSnappingAtLocation,G as sceneSnappingAtProjectedLocation,E as screenToMap};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Accessor.js";import r from"../../../core/Logger.js";import{deg2rad as i}from"../../../core/mathUtils.js";import{convertUnit as n}from"../../../core/unitUtils.js";import{property as o}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/RandomLCG.js";import{subclass as s}from"../../../core/accessorSupport/decorators/subclass.js";import{K as a}from"../../../chunks/vec32.js";import{isLoadedOrLoadFor as p,project as l}from"../../../geometry/projection.js";import{getClosestDenormalizedXToReference as c}from"../../../geometry/support/normalizeUtils.js";import{getResolutionForScale as u}from"../../../geometry/support/scaleUtils.js";import{minimumPixelsPerStrideForDisplayWhenScalingOff as d}from"../../2d/grid/constants.js";import{getScaleFactor as g,measureMetersPerUnitAtReferencePoint as f}from"../../2d/grid/gridUtils.js";import{create as h,createWritable as m}from"../sketch/normalizedPoint.js";import{gridPlacementGraphicSymbol as S}from"./snappingUtils.js";import{IntersectionSnappingCandidate as y}from"./candidates/IntersectionSnappingCandidate.js";import{LineSnappingCandidate as v}from"./candidates/LineSnappingCandidate.js";let w=class extends t{constructor(e){super(e),this.options=null}destroy(){this._set("options",null)}get grid(){return this.view.grid}get effectiveViewRotation(){return this.grid?.rotateWithMap?0:i(this.view.rotation??0)}get gridRotation(){return i(this.grid?.rotation??0)}get gridCenter(){const{spatialReference:e,grid:t}=this;if(!t||!e||!p(t.center.spatialReference,e))return null;try{const r=l(t.center,e),i=e.isWrappable&&null!=this.view?.center?c(r.x,this.view.center.x,e):r.x;return h(i,r.y,r.z)}catch(i){return r.getLogger(this).errorOnce("Grid Snapping - Failed to project grid center.",i),null}}get offsetScaleFactor(){const{pixelsPerStride:e,grid:t}=this;if(!t||!e)return 1;const{majorLineInterval:r,dynamicScaling:i}=t;return r<1?null:g(r,e,i)}get spatialReference(){return this.view.spatialReference}get gridMetersPerStride(){const{grid:e}=this;return e?n(e.spacing,e.units,"meters"):null}get viewMetersPerPixel(){const{viewMetersPerSRUnit:e}=this;return null==e?null:e*u(this.view.scale,this.view.spatialReference)}get viewMetersPerSRUnit(){const{spatialReference:e}=this.view;return this.gridCenter?f(this.gridCenter[0],this.gridCenter[1],e):null}get pixelsPerStride(){const{gridMetersPerStride:e,viewMetersPerPixel:t}=this;return t&&e?e/t:null}get updating(){return null!=this.grid&&null!=this.spatialReference&&null==this.viewMetersPerSRUnit}async fetchCandidates(e,t,r){const{options:i,view:n}=this;if(!i?.effectiveGridEnabled||!n.grid||r.feature?.attributes&&S in r.feature.attributes)return[];const o=r.coordinateHelper.arrayToPoint(e),s=i.distance*("touch"===r.pointer?i.touchSensitivityMultiplier:1);return this.fetchCandidatesSync(o,s)}fetchCandidatesSync(e,t){const r=[],{grid:i,effectiveViewRotation:n,gridRotation:o,gridCenter:s,viewMetersPerPixel:a,viewMetersPerSRUnit:c,offsetScaleFactor:u,spatialReference:g,gridMetersPerStride:f,pixelsPerStride:m}=this;if(!(i&&a&&c&&s&&g&&u&&f&&m))return r;if(!i.dynamicScaling&&m<d)return r;if(!p(e.spatialReference,g))return r;const S=l(e,g),w=h(S.x,S.y,S.z),x=P(w,-o,s,-n),C=f/c*u,U=j(x,C,s),{shouldSnapX:b,shouldSnapY:L}=R(U,x,t,a,c);if(!b&&!L)return[];const z=h((b?U:x)[0],(L?U:x)[1]),E=P(z,o,s,n),F=P(U,o,s,n);if(L){const e=M(U,x,C,"y"),t=P(e,o,s,n);r.push(new v({lineStart:F,lineEnd:t,targetPoint:E,isDraped:!1}))}if(b){const e=M(U,x,C,"x"),t=P(e,o,s,n);r.push(new v({lineStart:F,lineEnd:t,targetPoint:E,isDraped:!1}))}return b&&L&&r.push(new y(E,r[0],r[1],!1)),r}};e([o({constructOnly:!0})],w.prototype,"view",void 0),e([o()],w.prototype,"options",void 0),e([o()],w.prototype,"grid",null),e([o()],w.prototype,"effectiveViewRotation",null),e([o()],w.prototype,"gridRotation",null),e([o()],w.prototype,"gridCenter",null),e([o()],w.prototype,"offsetScaleFactor",null),e([o()],w.prototype,"spatialReference",null),e([o()],w.prototype,"gridMetersPerStride",null),e([o()],w.prototype,"viewMetersPerPixel",null),e([o()],w.prototype,"viewMetersPerSRUnit",null),e([o()],w.prototype,"pixelsPerStride",null),e([o()],w.prototype,"updating",null),w=e([s("esri.views.interactive.snapping.GridSnappingEngine")],w);const P=(e,t,r,i)=>{const n=m(e[0],e[1],e[2]);return a(n,a(n,n,r,t),r,i)},j=(e,t,r)=>{const i=(e[0]-r[0])/t,n=(e[1]-r[1])/t,o=Math.trunc(i),s=Math.trunc(n),a=Math.round(i%1),p=Math.round(n%1),l=r[0]+(o+a)*t,c=r[1]+(s+p)*t;return h(l,c)},R=(e,t,r,i,n)=>{if(i<=0)return{shouldSnapX:!1,shouldSnapY:!1};const o=(e[0]-t[0])/i,s=(e[1]-t[1])/i;return{shouldSnapX:Math.abs(o*n)<r,shouldSnapY:Math.abs(s*n)<r}},M=(e,t,r,i)=>{if("y"===i){const i=t[0]>e[0]?1:-1;return h(e[0]+r*i,e[1])}const n=t[1]>e[1]?1:-1;return h(e[0],e[1]+r*n)};export{w as GridSnappingEngine};
5
+ import{_ as t}from"../../../chunks/tslib.es6.js";import e from"../../../core/Accessor.js";import r from"../../../core/Logger.js";import{deg2rad as i}from"../../../core/mathUtils.js";import{convertUnit as n}from"../../../core/unitUtils.js";import{property as o}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/RandomLCG.js";import{subclass as s}from"../../../core/accessorSupport/decorators/subclass.js";import{K as a}from"../../../chunks/vec32.js";import{isLoadedOrLoadFor as p,project as l}from"../../../geometry/projectionUtils.js";import{getClosestDenormalizedXToReference as c}from"../../../geometry/support/normalizeUtils.js";import{getResolutionForScale as u}from"../../../geometry/support/scaleUtils.js";import{minimumPixelsPerStrideForDisplayWhenScalingOff as d}from"../../2d/grid/constants.js";import{getScaleFactor as g,measureMetersPerUnitAtReferencePoint as f}from"../../2d/grid/gridUtils.js";import{create as h,createWritable as m}from"../sketch/normalizedPoint.js";import{gridPlacementGraphicSymbol as S}from"./snappingUtils.js";import{IntersectionSnappingCandidate as y}from"./candidates/IntersectionSnappingCandidate.js";import{LineSnappingCandidate as v}from"./candidates/LineSnappingCandidate.js";let w=class extends e{constructor(t){super(t),this.options=null}destroy(){this._set("options",null)}get grid(){return this.view.grid}get effectiveViewRotation(){return this.grid?.rotateWithMap?0:i(this.view.rotation??0)}get gridRotation(){return i(this.grid?.rotation??0)}get gridCenter(){const{spatialReference:t,grid:e}=this;if(!e||!t||!p(e.center.spatialReference,t))return null;try{const r=l(e.center,t),i=t.isWrappable&&null!=this.view?.center?c(r.x,this.view.center.x,t):r.x;return h(i,r.y,r.z)}catch(i){return r.getLogger(this).errorOnce("Grid Snapping - Failed to project grid center.",i),null}}get offsetScaleFactor(){const{pixelsPerStride:t,grid:e}=this;if(!e||!t)return 1;const{majorLineInterval:r,dynamicScaling:i}=e;return r<1?null:g(r,t,i)}get spatialReference(){return this.view.spatialReference}get gridMetersPerStride(){const{grid:t}=this;return t?n(t.spacing,t.units,"meters"):null}get viewMetersPerPixel(){const{viewMetersPerSRUnit:t}=this;return null==t?null:t*u(this.view.scale,this.view.spatialReference)}get viewMetersPerSRUnit(){const{spatialReference:t}=this.view;return this.gridCenter?f(this.gridCenter[0],this.gridCenter[1],t):null}get pixelsPerStride(){const{gridMetersPerStride:t,viewMetersPerPixel:e}=this;return e&&t?t/e:null}get updating(){return null!=this.grid&&null!=this.spatialReference&&null==this.viewMetersPerSRUnit}async fetchCandidates(t,e,r){const{options:i,view:n}=this;if(!i?.effectiveGridEnabled||!n.grid||r.feature?.attributes&&S in r.feature.attributes)return[];const o=r.coordinateHelper.arrayToPoint(t),s=i.distance*("touch"===r.pointer?i.touchSensitivityMultiplier:1);return this.fetchCandidatesSync(o,s)}fetchCandidatesSync(t,e){const r=[],{grid:i,effectiveViewRotation:n,gridRotation:o,gridCenter:s,viewMetersPerPixel:a,viewMetersPerSRUnit:c,offsetScaleFactor:u,spatialReference:g,gridMetersPerStride:f,pixelsPerStride:m}=this;if(!(i&&a&&c&&s&&g&&u&&f&&m))return r;if(!i.dynamicScaling&&m<d)return r;if(!p(t.spatialReference,g))return r;const S=l(t,g),w=h(S.x,S.y,S.z),x=P(w,-o,s,-n),C=f/c*u,U=j(x,C,s),{shouldSnapX:b,shouldSnapY:L}=R(U,x,e,a,c);if(!b&&!L)return[];const z=h((b?U:x)[0],(L?U:x)[1]),E=P(z,o,s,n),F=P(U,o,s,n);if(L){const t=M(U,x,C,"y"),e=P(t,o,s,n);r.push(new v({lineStart:F,lineEnd:e,targetPoint:E,isDraped:!1}))}if(b){const t=M(U,x,C,"x"),e=P(t,o,s,n);r.push(new v({lineStart:F,lineEnd:e,targetPoint:E,isDraped:!1}))}return b&&L&&r.push(new y(E,r[0],r[1],!1)),r}};t([o({constructOnly:!0})],w.prototype,"view",void 0),t([o()],w.prototype,"options",void 0),t([o()],w.prototype,"grid",null),t([o()],w.prototype,"effectiveViewRotation",null),t([o()],w.prototype,"gridRotation",null),t([o()],w.prototype,"gridCenter",null),t([o()],w.prototype,"offsetScaleFactor",null),t([o()],w.prototype,"spatialReference",null),t([o()],w.prototype,"gridMetersPerStride",null),t([o()],w.prototype,"viewMetersPerPixel",null),t([o()],w.prototype,"viewMetersPerSRUnit",null),t([o()],w.prototype,"pixelsPerStride",null),t([o()],w.prototype,"updating",null),w=t([s("esri.views.interactive.snapping.GridSnappingEngine")],w);const P=(t,e,r,i)=>{const n=m(t[0],t[1],t[2]);return a(n,a(n,n,r,e),r,i)},j=(t,e,r)=>{const i=(t[0]-r[0])/e,n=(t[1]-r[1])/e,o=Math.trunc(i),s=Math.trunc(n),a=Math.round(i%1),p=Math.round(n%1),l=r[0]+(o+a)*e,c=r[1]+(s+p)*e;return h(l,c)},R=(t,e,r,i,n)=>{if(i<=0)return{shouldSnapX:!1,shouldSnapY:!1};const o=(t[0]-e[0])/i,s=(t[1]-e[1])/i;return{shouldSnapX:Math.abs(o*n)<r,shouldSnapY:Math.abs(s*n)<r}},M=(t,e,r,i)=>{if("y"===i){const i=e[0]>t[0]?1:-1;return h(t[0]+r*i,t[1])}const n=e[1]>t[1]?1:-1;return h(t[0],t[1]+r*n)};export{w as GridSnappingEngine};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Accessor.js";import{createTask as n}from"../../../core/asyncUtils.js";import i from"../../../core/Evented.js";import"../../../core/has.js";import{throwIfAborted as s,isAborted as a}from"../../../core/promiseUtils.js";import{watch as r,syncAndInitial as o,sync as p}from"../../../core/reactiveUtils.js";import{property as d}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as c}from"../../../core/accessorSupport/decorators/subclass.js";import{project as h,initializeProjection as l}from"../../../geometry/projection.js";import{absoluteHeightElevationInfo as u}from"../../../support/elevationInfoUtils.js";import{fromPoint as f,markAsTarget as g,toElevationAlignedDehydratedPoint as _}from"../sketch/normalizedPoint.js";import{defaults as S}from"./Settings.js";import{SnappingDomain as m}from"./SnappingDomain.js";import v from"./SnappingOptions.js";import{sortCandidatesInPlace as y,squaredScreenDistance as C}from"./snappingUtils.js";import{DrapedEdgeSnappingCandidate as w}from"./candidates/DrapedEdgeSnappingCandidate.js";import{EdgeSnappingCandidate as E}from"./candidates/EdgeSnappingCandidate.js";import{IntersectionSnappingCandidate as P}from"./candidates/IntersectionSnappingCandidate.js";import{LineSnappingCandidate as T}from"./candidates/LineSnappingCandidate.js";import{ParallelLineSnappingCandidate as j}from"./candidates/ParallelLineSnappingCandidate.js";import{RightAngleSnappingCandidate as M,SelfSnappingRightAngleType as R}from"./candidates/RightAngleSnappingCandidate.js";import{RightAngleTriangleSnappingCandidate as q}from"./candidates/RightAngleTriangleSnappingCandidate.js";import{vectorToScreenPoint as A}from"../support/viewUtils.js";import{loadGeodesicLengthMeasurementUtils as I}from"../../support/geodesicLengthMeasurementUtils.js";let x=class extends(i.EventedMixin(t)){constructor(e){super(e),this.options=new v,this._engineCache=new Map,this._loadTask=null,this._engines=[],this._currentMainCandidate=null,this._currentOtherActiveCandidates=[],this._currentSnappedType=b.MAIN}initialize(){this.addHandles([r((()=>{const{distance:e,touchSensitivityMultiplier:t,effectiveSelfEnabled:n,effectiveFeatureEnabled:i,effectiveGridEnabled:s}=this.options;return{selfEnabled:n,featureEnabled:i,gridEnabled:"2d"===this.view.type&&s,viewReady:this.view.ready,viewSpatialReference:this.view.spatialReference,distance:e,touchSensitivityMultiplier:t}}),((e,t)=>{t&&(this.doneSnapping(),this.emit("changed")),this._loadTask?.abort(),this._loadTask=n((n=>this._updateEngines(e,t,n)))}),o),r((()=>this.options),(e=>{for(const t of this._engines)t.options=e}),p)])}destroy(){this._loadTask?.abort(),this._destroyEngines()}get updating(){return this._engines.some((e=>e.updating))||!this._loadTask?.finished}_destroyEngines(){this._engineCache.forEach((e=>e.destroy())),this._engineCache.clear(),this._engines=[]}async _updateEngines(e,t,n){if(!e.viewReady)return void this._destroyEngines();t?.viewSpatialReference!==e.viewSpatialReference&&this._destroyEngines();const i=this._engineCache,s=await Promise.allSettled([e.featureEnabled&&!i.has("feature")?this._createFeatureSnappingEngine(n):void 0,e.selfEnabled&&!i.has("self")?this._createSelfSnappingEngine(n):void 0,e.gridEnabled&&!i.has("grid")?this._createGridSnappingEngine(n):void 0]);if(n.aborted)for(const a of s)"fulfilled"===a.status&&a.value?.engine.destroy();else{for(const e of s)"fulfilled"===e.status&&e.value&&i.set(e.value.type,e.value.engine);this._engines=Array.from(i.values())}}async _createSelfSnappingEngine(e){const[{SelfSnappingEngine:t},n]=await Promise.all([import("./SelfSnappingEngine.js"),I()]);return s(e),{type:"self",engine:new t({view:this.view,options:this.options,geodesicLengthMeasurementUtils:n})}}async _createGridSnappingEngine(e){const{view:t}=this;if("2d"!==t.type)return;const{GridSnappingEngine:n}=await import("./GridSnappingEngine.js");return s(e),{type:"grid",engine:new n({view:t,options:this.options})}}async _createFeatureSnappingEngine(e){const{FeatureSnappingEngine:t}=await import("./FeatureSnappingEngine.js");s(e);const{view:n,options:i}=this,{spatialReference:a}=n;return{type:"feature",engine:new t({view:n,options:i,spatialReference:a})}}get _squaredMouseProximityThreshold(){return this.options.distance*this.options.distance}get _squaredTouchProximityThreshold(){const{distance:e,touchSensitivityMultiplier:t}=this.options,n=e*t;return n*n}snap(e){return k(e)?this._snapMultiPoint(e):this._snapSinglePoint(e)}update(e){const{point:t,context:n}=e;this._removeVisualization();const i=this._currentMainCandidate;if(null==i)return t;const s=this._selectUpdateInput(e);if(null==s)return t;const{spatialReference:a}=n,r=h(s,a);if(null==r)return t;const{view:o}=this,{elevationInfo:p,visualizer:d}=n,c=[],l=f(r,o,p),u=i.constraint.closestTo(l);if(!this._arePointsWithinScreenThreshold(l,u,n)||!N(i,n.drawConstraints))return this._resetSnappingState(),t;i.targetPoint=g(u),c.push(...i.hints);for(const h of this._currentOtherActiveCandidates)N(h,n.drawConstraints)&&(h.targetPoint=g(u),c.push(...h.hints));return null!=d&&this.addHandles(d.draw(c,{spatialReference:a,elevationInfo:H(n),view:o,selfSnappingZ:n.selfSnappingZ}),z),_(u,o,t,n)}doneSnapping(){this._removeVisualization(),this._resetSnappingState()}_selectUpdateInput({point:e,scenePoint:t}){switch(this._currentSnappedType){case b.MAIN:return e;case b.SCENE:return t}}_resetSnappingState(){this._currentMainCandidate=null,this._currentOtherActiveCandidates=[],this._currentSnappedType=b.MAIN}_removeVisualization(){this.removeHandles(z)}async _snapSinglePoint({point:e,context:t,signal:n}){const{view:i}=this,{elevationInfo:s}=t,a=f(e,i,s),r=await this._fetchCandidates(a,m.ALL,t,n);return this._createSnapResult(a,b.MAIN,r,i,e,t,n)}async _snapMultiPoint({point:e,scenePoint:t,context:n,signal:i}){const{view:s}=this,{coordinateHelper:a,elevationInfo:r,spatialReference:o}=n;await l(t.spatialReference,o);const p=h(t,o),d=f(p,s,r),c=await this._fetchCandidates(d,m.FEATURE,n,i);if(c.length>0){const e=await this._fetchCandidates(d,m.SELF,n,i);return this._createSnapResult(d,b.SCENE,[...c,...e],s,p,n,i)}const u=f(e,s,r),g=await this._fetchCandidates(u,m.SELF,n,i);return this._createSnapResult(u,b.MAIN,g,s,{z:a.hasZ()&&e.hasZ?e.z??0:void 0,m:a.hasM()&&e.hasM?e.m??0:void 0},n,i)}async _fetchCandidates(e,t,n,i){return(await Promise.all(this._engines.map((s=>s.fetchCandidates(e,t,n,i))))).flat()}_createSnapResult(e,t,n,i,s,r,o){return{get valid(){return!a(o)},apply:()=>{const{spatialReference:a}=r,{snappedPoint:o,hints:p}=this._processCandidates(e,t,n,r);return this._removeVisualization(),null!=r.visualizer&&this.addHandles(r.visualizer.draw(p,{spatialReference:a,elevationInfo:u,view:i,selfSnappingZ:r.selfSnappingZ}),z),_(o,i,s,r)}}}_processCandidates(e,t,n,i){if(n.length<1)return this.doneSnapping(),{snappedPoint:e,hints:[]};this._currentSnappedType!==t&&this._resetSnappingState(),y(e,n);const s=this._currentMainCandidate;if(null!=s){const a=U(s,n);if(a>=0){if(!(n[a]instanceof P))return this._intersectWithOtherCandidates(a,n,e,t,i);if(this._arePointsWithinScreenThreshold(e,s.targetPoint,i))return this._updateSnappingCandidate(s,t,n,i)}}return this._intersectWithOtherCandidates(0,n,e,t,i)}_intersectWithOtherCandidates(e,t,n,i,s){const{coordinateHelper:a}=s,r=t[e],o=[];for(let p=0;p<t.length;++p){if(p===e)continue;const i=t[p],s=r.constraint.intersect(i.constraint);if(s)for(const e of s.closestPoints(r.targetPoint))o.push([new P(g(e),r,i,i.isDraped),this._squaredScreenDistance(n,e,a)])}return o.length>0&&(o.sort(((e,t)=>e[1]-t[1])),o[0][1]<this._squaredPointProximityThreshold(s.pointer))?this._updateSnappingCandidate(o[0][0],i,t,s):N(r,s.drawConstraints)?this._updateSnappingCandidate(r,i,t,s):{snappedPoint:n,hints:[]}}_updateSnappingCandidate(e,t,n,i){this.doneSnapping(),this._currentMainCandidate=e,this._currentSnappedType=t;const s=this._currentMainCandidate.targetPoint,a=[];a.push(...e.hints);for(const r of n){if(e instanceof P){if(r.constraint.equals(e.first.constraint)||r.constraint.equals(e.second.constraint))continue}else if(r.constraint.equals(e.constraint))continue;const t=r.constraint.closestTo(s);this._squaredScreenDistance(t,s,i.coordinateHelper)<L()&&(r.targetPoint=s,this._currentOtherActiveCandidates.push(r),a.push(...r.hints))}return{snappedPoint:s,hints:a}}_squaredPointProximityThreshold(e){return"touch"===e?this._squaredTouchProximityThreshold:this._squaredMouseProximityThreshold}_arePointsWithinScreenThreshold(e,t,n){return this._squaredScreenDistance(e,t,n.coordinateHelper)<this._squaredPointProximityThreshold(n.pointer)}_squaredScreenDistance(e,t,n){return C(this._toScreen(e,n),this._toScreen(t,n))}_toScreen(e,t){return A(e,t.spatialReference,u,this.view)}get test(){}};var b;e([d({constructOnly:!0})],x.prototype,"view",void 0),e([d()],x.prototype,"options",void 0),e([d({readOnly:!0})],x.prototype,"updating",null),e([d()],x.prototype,"_loadTask",void 0),e([d()],x.prototype,"_engines",void 0),e([d()],x.prototype,"_squaredMouseProximityThreshold",null),e([d()],x.prototype,"_squaredTouchProximityThreshold",null),x=e([c("esri.views.interactive.snapping.SnappingManager")],x),function(e){e[e.MAIN=0]="MAIN",e[e.SCENE=1]="SCENE"}(b||(b={}));const z="visualization-handle";function L(){return S.satisfiesConstraintScreenThreshold*S.satisfiesConstraintScreenThreshold}function N(e,t){return!t||null==t.direction&&null==t.distance||!(e instanceof w||e instanceof E||e instanceof T||e instanceof j||e instanceof q)&&(!(e instanceof M)||null==t.direction&&e.selfSnappingType===R.LastVertex)}function U(e,t){return e instanceof P?O(t,e.first)>=0&&O(t,e.second)>=0?0:-1:O(t,e)}function O(e,t){let n=-1;for(let i=0;i<e.length;++i)if(t.constraint.equals(e[i].constraint)){n=i;break}return n}function k(e){return null!=e.scenePoint}function H({coordinateHelper:e,elevationInfo:t}){return e.hasZ()?u:t}export{x as SnappingManager};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Accessor.js";import{createTask as n}from"../../../core/asyncUtils.js";import i from"../../../core/Evented.js";import"../../../core/has.js";import{throwIfAborted as s,isAborted as a}from"../../../core/promiseUtils.js";import{watch as r,syncAndInitial as o,sync as p}from"../../../core/reactiveUtils.js";import{property as d}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as c}from"../../../core/accessorSupport/decorators/subclass.js";import{project as h,initializeProjection as l}from"../../../geometry/projectionUtils.js";import{absoluteHeightElevationInfo as u}from"../../../support/elevationInfoUtils.js";import{fromPoint as f,markAsTarget as g,toElevationAlignedDehydratedPoint as _}from"../sketch/normalizedPoint.js";import{defaults as S}from"./Settings.js";import{SnappingDomain as m}from"./SnappingDomain.js";import v from"./SnappingOptions.js";import{sortCandidatesInPlace as y,squaredScreenDistance as C}from"./snappingUtils.js";import{DrapedEdgeSnappingCandidate as w}from"./candidates/DrapedEdgeSnappingCandidate.js";import{EdgeSnappingCandidate as E}from"./candidates/EdgeSnappingCandidate.js";import{IntersectionSnappingCandidate as P}from"./candidates/IntersectionSnappingCandidate.js";import{LineSnappingCandidate as T}from"./candidates/LineSnappingCandidate.js";import{ParallelLineSnappingCandidate as j}from"./candidates/ParallelLineSnappingCandidate.js";import{RightAngleSnappingCandidate as M,SelfSnappingRightAngleType as R}from"./candidates/RightAngleSnappingCandidate.js";import{RightAngleTriangleSnappingCandidate as q}from"./candidates/RightAngleTriangleSnappingCandidate.js";import{vectorToScreenPoint as A}from"../support/viewUtils.js";import{loadGeodesicLengthMeasurementUtils as I}from"../../support/geodesicLengthMeasurementUtils.js";let x=class extends(i.EventedMixin(t)){constructor(e){super(e),this.options=new v,this._engineCache=new Map,this._loadTask=null,this._engines=[],this._currentMainCandidate=null,this._currentOtherActiveCandidates=[],this._currentSnappedType=b.MAIN}initialize(){this.addHandles([r((()=>{const{distance:e,touchSensitivityMultiplier:t,effectiveSelfEnabled:n,effectiveFeatureEnabled:i,effectiveGridEnabled:s}=this.options;return{selfEnabled:n,featureEnabled:i,gridEnabled:"2d"===this.view.type&&s,viewReady:this.view.ready,viewSpatialReference:this.view.spatialReference,distance:e,touchSensitivityMultiplier:t}}),((e,t)=>{t&&(this.doneSnapping(),this.emit("changed")),this._loadTask?.abort(),this._loadTask=n((n=>this._updateEngines(e,t,n)))}),o),r((()=>this.options),(e=>{for(const t of this._engines)t.options=e}),p)])}destroy(){this._loadTask?.abort(),this._destroyEngines()}get updating(){return this._engines.some((e=>e.updating))||!this._loadTask?.finished}_destroyEngines(){this._engineCache.forEach((e=>e.destroy())),this._engineCache.clear(),this._engines=[]}async _updateEngines(e,t,n){if(!e.viewReady)return void this._destroyEngines();t?.viewSpatialReference!==e.viewSpatialReference&&this._destroyEngines();const i=this._engineCache,s=await Promise.allSettled([e.featureEnabled&&!i.has("feature")?this._createFeatureSnappingEngine(n):void 0,e.selfEnabled&&!i.has("self")?this._createSelfSnappingEngine(n):void 0,e.gridEnabled&&!i.has("grid")?this._createGridSnappingEngine(n):void 0]);if(n.aborted)for(const a of s)"fulfilled"===a.status&&a.value?.engine.destroy();else{for(const e of s)"fulfilled"===e.status&&e.value&&i.set(e.value.type,e.value.engine);this._engines=Array.from(i.values())}}async _createSelfSnappingEngine(e){const[{SelfSnappingEngine:t},n]=await Promise.all([import("./SelfSnappingEngine.js"),I()]);return s(e),{type:"self",engine:new t({view:this.view,options:this.options,geodesicLengthMeasurementUtils:n})}}async _createGridSnappingEngine(e){const{view:t}=this;if("2d"!==t.type)return;const{GridSnappingEngine:n}=await import("./GridSnappingEngine.js");return s(e),{type:"grid",engine:new n({view:t,options:this.options})}}async _createFeatureSnappingEngine(e){const{FeatureSnappingEngine:t}=await import("./FeatureSnappingEngine.js");s(e);const{view:n,options:i}=this,{spatialReference:a}=n;return{type:"feature",engine:new t({view:n,options:i,spatialReference:a})}}get _squaredMouseProximityThreshold(){return this.options.distance*this.options.distance}get _squaredTouchProximityThreshold(){const{distance:e,touchSensitivityMultiplier:t}=this.options,n=e*t;return n*n}snap(e){return k(e)?this._snapMultiPoint(e):this._snapSinglePoint(e)}update(e){const{point:t,context:n}=e;this._removeVisualization();const i=this._currentMainCandidate;if(null==i)return t;const s=this._selectUpdateInput(e);if(null==s)return t;const{spatialReference:a}=n,r=h(s,a);if(null==r)return t;const{view:o}=this,{elevationInfo:p,visualizer:d}=n,c=[],l=f(r,o,p),u=i.constraint.closestTo(l);if(!this._arePointsWithinScreenThreshold(l,u,n)||!L(i,n.drawConstraints))return this._resetSnappingState(),t;i.targetPoint=g(u),c.push(...i.hints);for(const h of this._currentOtherActiveCandidates)L(h,n.drawConstraints)&&(h.targetPoint=g(u),c.push(...h.hints));return null!=d&&this.addHandles(d.draw(c,{spatialReference:a,elevationInfo:H(n),view:o,selfSnappingZ:n.selfSnappingZ}),z),_(u,o,t,n)}doneSnapping(){this._removeVisualization(),this._resetSnappingState()}_selectUpdateInput({point:e,scenePoint:t}){switch(this._currentSnappedType){case b.MAIN:return e;case b.SCENE:return t}}_resetSnappingState(){this._currentMainCandidate=null,this._currentOtherActiveCandidates=[],this._currentSnappedType=b.MAIN}_removeVisualization(){this.removeHandles(z)}async _snapSinglePoint({point:e,context:t,signal:n}){const{view:i}=this,{elevationInfo:s}=t,a=f(e,i,s),r=await this._fetchCandidates(a,m.ALL,t,n);return this._createSnapResult(a,b.MAIN,r,i,e,t,n)}async _snapMultiPoint({point:e,scenePoint:t,context:n,signal:i}){const{view:s}=this,{coordinateHelper:a,elevationInfo:r,spatialReference:o}=n;await l(t.spatialReference,o);const p=h(t,o),d=f(p,s,r),c=await this._fetchCandidates(d,m.FEATURE,n,i);if(c.length>0){const e=await this._fetchCandidates(d,m.SELF,n,i);return this._createSnapResult(d,b.SCENE,[...c,...e],s,p,n,i)}const u=f(e,s,r),g=await this._fetchCandidates(u,m.SELF,n,i);return this._createSnapResult(u,b.MAIN,g,s,{z:a.hasZ()&&e.hasZ?e.z??0:void 0,m:a.hasM()&&e.hasM?e.m??0:void 0},n,i)}async _fetchCandidates(e,t,n,i){return(await Promise.all(this._engines.map((s=>s.fetchCandidates(e,t,n,i))))).flat()}_createSnapResult(e,t,n,i,s,r,o){return{get valid(){return!a(o)},apply:()=>{const{spatialReference:a}=r,{snappedPoint:o,hints:p}=this._processCandidates(e,t,n,r);return this._removeVisualization(),null!=r.visualizer&&this.addHandles(r.visualizer.draw(p,{spatialReference:a,elevationInfo:u,view:i,selfSnappingZ:r.selfSnappingZ}),z),_(o,i,s,r)}}}_processCandidates(e,t,n,i){if(n.length<1)return this.doneSnapping(),{snappedPoint:e,hints:[]};this._currentSnappedType!==t&&this._resetSnappingState(),y(e,n);const s=this._currentMainCandidate;if(null!=s){const a=N(s,n);if(a>=0){if(!(n[a]instanceof P))return this._intersectWithOtherCandidates(a,n,e,t,i);if(this._arePointsWithinScreenThreshold(e,s.targetPoint,i))return this._updateSnappingCandidate(s,t,n,i)}}return this._intersectWithOtherCandidates(0,n,e,t,i)}_intersectWithOtherCandidates(e,t,n,i,s){const{coordinateHelper:a}=s,r=t[e],o=[];for(let p=0;p<t.length;++p){if(p===e)continue;const i=t[p],s=r.constraint.intersect(i.constraint);if(s)for(const e of s.closestPoints(r.targetPoint))o.push([new P(g(e),r,i,i.isDraped),this._squaredScreenDistance(n,e,a)])}return o.length>0&&(o.sort(((e,t)=>e[1]-t[1])),o[0][1]<this._squaredPointProximityThreshold(s.pointer))?this._updateSnappingCandidate(o[0][0],i,t,s):L(r,s.drawConstraints)?this._updateSnappingCandidate(r,i,t,s):{snappedPoint:n,hints:[]}}_updateSnappingCandidate(e,t,n,i){this.doneSnapping(),this._currentMainCandidate=e,this._currentSnappedType=t;const s=this._currentMainCandidate.targetPoint,a=[];a.push(...e.hints);for(const r of n){if(e instanceof P){if(r.constraint.equals(e.first.constraint)||r.constraint.equals(e.second.constraint))continue}else if(r.constraint.equals(e.constraint))continue;const t=r.constraint.closestTo(s);this._squaredScreenDistance(t,s,i.coordinateHelper)<U()&&(r.targetPoint=s,this._currentOtherActiveCandidates.push(r),a.push(...r.hints))}return{snappedPoint:s,hints:a}}_squaredPointProximityThreshold(e){return"touch"===e?this._squaredTouchProximityThreshold:this._squaredMouseProximityThreshold}_arePointsWithinScreenThreshold(e,t,n){return this._squaredScreenDistance(e,t,n.coordinateHelper)<this._squaredPointProximityThreshold(n.pointer)}_squaredScreenDistance(e,t,n){return C(this._toScreen(e,n),this._toScreen(t,n))}_toScreen(e,t){return A(e,t.spatialReference,u,this.view)}get test(){}};var b;e([d({constructOnly:!0})],x.prototype,"view",void 0),e([d()],x.prototype,"options",void 0),e([d({readOnly:!0})],x.prototype,"updating",null),e([d()],x.prototype,"_loadTask",void 0),e([d()],x.prototype,"_engines",void 0),e([d()],x.prototype,"_squaredMouseProximityThreshold",null),e([d()],x.prototype,"_squaredTouchProximityThreshold",null),x=e([c("esri.views.interactive.snapping.SnappingManager")],x),function(e){e[e.MAIN=0]="MAIN",e[e.SCENE=1]="SCENE"}(b||(b={}));const z="visualization-handle";function U(){return S.satisfiesConstraintScreenThreshold*S.satisfiesConstraintScreenThreshold}function L(e,t){return!t||null==t.direction&&null==t.distance||!(e instanceof w||e instanceof E||e instanceof T||e instanceof j||e instanceof q)&&(!(e instanceof M)||null==t.direction&&e.selfSnappingType===R.LastVertex)}function N(e,t){return e instanceof P?O(t,e.first)>=0&&O(t,e.second)>=0?0:-1:O(t,e)}function O(e,t){let n=-1;for(let i=0;i<e.length;++i)if(t.constraint.equals(e[i].constraint)){n=i;break}return n}function k(e){return null!=e.scenePoint}function H({coordinateHelper:e,elevationInfo:t}){return e.hasZ()?u:t}export{x as SnappingManager};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../chunks/tslib.es6.js";import t from"../../../../core/Accessor.js";import{removeUnordered as o}from"../../../../core/arrayUtils.js";import{createTask as r}from"../../../../core/asyncUtils.js";import{memoize as s}from"../../../../core/memoize.js";import{throwIfAborted as i,allSettledValues as n,whenOrAbort as a}from"../../../../core/promiseUtils.js";import{initial as p,watch as l,on as d}from"../../../../core/reactiveUtils.js";import{property as c}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import{subclass as u}from"../../../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as h}from"../../../../core/support/UpdatingHandles.js";import y from"../../../../geometry/Polygon.js";import{initializeProjection as m,canProjectWithoutEngine as g,project as f}from"../../../../geometry/projection.js";import{normalizeCentralMeridianForDisplay as _}from"../../../../geometry/support/normalizeUtilsSync.js";import{featureGeometryTypeKebabDictionary as v}from"../../../../geometry/support/typeUtils.js";import{convertFromGeometry as S}from"../../../../layers/graphics/featureConversionUtils.js";import{OptimizedFeature as w}from"../../../../layers/graphics/OptimizedFeature.js";import{executeQueryForSnapping as j}from"../../../../layers/graphics/data/executeQueryForSnapping.js";import b from"../../../../layers/graphics/data/FeatureStore.js";import{QueryEngine as E}from"../../../../layers/graphics/data/QueryEngine.js";import k from"../../../../layers/support/FieldsIndex.js";import{elevationContextAffectsAlignment as C}from"../../../../support/elevationInfoUtils.js";import{symbolHasExtrudeSymbolLayer as F}from"../../../../symbols/support/utils.js";import{sortCandidatesInPlace as A,makeSnappingQuery as I}from"../snappingUtils.js";import{convertSnappingCandidate as P,makeGetGroundElevation as G}from"./queryEngineUtils.js";import{getSnappingCandidateElevationAligner as H}from"./snappingCandidateElevationAlignment.js";import{getSnappingCandidateElevationFilter as R}from"./snappingCandidateElevationFilter.js";import{getSymbologySnappingCandidatesFetcher as x}from"./symbologySnappingCandidates.js";import{TaskPriority as z}from"../../../support/Scheduler.js";const O="graphics-collections";let U=class extends t{get updating(){return this._updatingHandles.updating}get _hasZ(){const e=this.view;return null!=e&&"3d"===e.type&&"map-notes"!==this.layerSource.layer.type}get _snappingElevationAligner(){const{view:e}=this,{layer:t}=this.layerSource,o=null!=e&&"3d"===e.type;if(!o||"map-notes"===t.type)return H();const r=async(o,r)=>(await a(e.whenLayerView(t),r)).elevationAlignPointsInFeatures(o,r);return H(o,{elevationInfo:t.elevationInfo,alignPointsInFeatures:r})}get _snappingElevationFilter(){const{view:e}=this,t=null!=e&&"3d"===e.type&&"map-notes"!==this.layerSource.layer.type;return R(t)}get _symbologySnappingFetcher(){const{view:e}=this,{layer:t}=this.layerSource,o=null!=e&&"3d"===e.type,r=this._extrudedPolygonSymbolsCount>0;return o&&"map-notes"!==t.type&&r?x(r,(async(o,r)=>{const s=await e.whenLayerView(t);return i(r),s.queryForSymbologySnapping({candidates:o,spatialReference:e.spatialReference},r)})):x()}constructor(e){super(e),this.availability=1,this._sources={multipoint:null,point:null,polygon:null,polyline:null},this._loadedWkids=new Set,this._loadedWkts=new Set,this._pendingAdds=[],this._extrudedPolygonSymbolsCount=0,this._updatingHandles=new h,this._memoizedMakeGetGroundElevation=s(G)}destroy(){for(const e of this._pendingAdds)e.task.abort();this._pendingAdds.length=0,this._mapSources((e=>this._destroySource(e))),this._updatingHandles.destroy()}initialize(){this._updatingHandles.add((()=>this.getGraphicsLayers()),(e=>{this._updatingHandles.removeHandles(O);for(const t of e)this._addMany(t.graphics.toArray()),this.addHandles([t.on("graphic-update",(e=>this._onGraphicUpdate(e))),this._updatingHandles.addOnCollectionChange((()=>t.graphics),(e=>this._onGraphicsChanged(e)))],O)}),p);const{view:e}=this,{layer:t}=this.layerSource;null!=e&&"3d"===e.type&&"map-notes"!==t.type&&e.elevationProvider&&this.addHandles([e.elevationProvider.on("elevation-change",(({context:e})=>{C(e,t.elevationInfo)&&this._snappingElevationAligner.notifyElevationSourceChange()})),l((()=>t.elevationInfo),(()=>this._snappingElevationAligner.notifyElevationSourceChange()),p),d((()=>t),["edits","apply-edits","graphic-update"],(()=>this._symbologySnappingFetcher.notifySymbologyChange()))])}async fetchCandidates(e,t){const{point:o,coordinateHelper:{spatialReference:r}}=e,s=await n(this._mapSources((o=>this._fetchCandidatesForSource(o,e,t))));i(t);const a=this._memoizedMakeGetGroundElevation(this.view,r),p=s.flat().map((e=>P(e,a)));return A(o,p),p}async _fetchCandidatesForSource(e,t,o){const r=I({parameters:t,mode:this.view?.type??"2d"}),s=await j(e.queryEngine,r,o);i(o);const n=await this._snappingElevationAligner.alignCandidates(s.candidates,t.coordinateHelper.spatialReference,o);i(o);const a=await this._symbologySnappingFetcher.fetch(n,o);i(o);const p=0===a.length?n:[...n,...a];return this._snappingElevationFilter.filter(r,p)}refresh(){}_onGraphicUpdate(e){if(this.getGraphicsLayers().some((t=>t.graphics.includes(e.graphic))))switch(e.property){case"geometry":case"visible":this._remove(e.graphic),this._addMany([e.graphic])}}_onGraphicsChanged(e){for(const t of e.removed)this._remove(t);this._addMany(e.added)}_addMany(e){const t=[],o=new Map;for(const r of e)null!=r.geometry&&(this._needsInitializeProjection(r.geometry.spatialReference)?(t.push(r.geometry.spatialReference),o.set(r.uid,r)):this._add(r));this._createPendingAdd(t,o)}_createPendingAdd(e,t){if(!e.length)return;const s=r((async o=>{await m(e.map((e=>({source:e,dest:this.spatialReference}))),{signal:o}),this._markLoadedSpatialReferences(e);for(const e of t.values())this._add(e)}));this._updatingHandles.addPromise(s.promise);const i={task:s,graphics:t},n=()=>o(this._pendingAdds,i);s.promise.then(n,n),this._pendingAdds.push(i)}_markLoadedSpatialReferences(e){for(const t of e){null!=t.wkid&&this._loadedWkids.add(t.wkid);const e=t.wkt2||t.wkt;e&&this._loadedWkts.add(e)}}_add(e){if(null==e.geometry||!e.visible)return;let t=e.geometry;if("mesh"===t.type)return;"extent"===t.type&&(t=y.fromExtent(t));const o=this._ensureSource(t.type);if(null==o)return;const r=this._createOptimizedFeature(e.uid,t);null!=r&&(o.featureStore.add(r),F(e.symbol)&&this._extrudedPolygonSymbolsCount++)}_needsInitializeProjection(e){if(null!=e.wkid&&this._loadedWkids.has(e.wkid))return!1;const t=e.wkt2||e.wkt;return(!t||!this._loadedWkts.has(t))&&!g(e,this.spatialReference)}_createOptimizedFeature(e,t){const o=f(_(t),this.spatialReference);if(!o)return null;const r=this._ensureGeometryHasZ(o),s=S(r,this._hasZ,!1);return new w(s,{[Z]:e},null,e)}_ensureGeometryHasZ(e){if(!this._hasZ)return e;const t=e=>{for(;e.length<3;)e.push(0)},o=e.clone();switch(o.hasZ=!0,o.type){case"point":o.z=o.z??0;break;case"multipoint":o.points.forEach(t);break;case"polyline":o.paths.forEach((e=>e.forEach(t)));break;case"polygon":o.rings.forEach((e=>e.forEach(t)))}return o}_ensureSource(e){const t=this._sources[e];if(null!=t)return t;const o=this._createSource(e);return this._sources[e]=o,o}_createSource(e){const t=v.toJSON(e),o=this._hasZ,r=new b({geometryType:t,hasZ:o,hasM:!1});return{featureStore:r,queryEngine:new E({featureStore:r,fieldsIndex:k.fromLayerJSON({fields:[{name:Z,type:"esriFieldTypeOID",alias:Z}]}),geometryType:t,hasM:!1,hasZ:o,featureIdInfo:{type:"object-id",fieldName:Z},spatialReference:this.spatialReference,priority:z.SNAPPING,scheduler:null!=this.view&&"3d"===this.view.type?this.view.resourceController.scheduler:null}),type:e}}_remove(e){this._mapSources((t=>this._removeFromSource(t,e)));for(const t of this._pendingAdds)t.graphics.delete(e.uid),0===t.graphics.size&&t.task.abort()}_removeFromSource(e,t){const o=t.uid;e.featureStore.has(o)&&(e.featureStore.removeById(t.uid),F(t.symbol)&&this._extrudedPolygonSymbolsCount--)}_destroySource(e){e.queryEngine.destroy(),this._sources[e.type]=null}_mapSources(e){const{point:t,polygon:o,polyline:r,multipoint:s}=this._sources,i=[];return null!=t&&i.push(e(t)),null!=o&&i.push(e(o)),null!=r&&i.push(e(r)),null!=s&&i.push(e(s)),i}};e([c()],U.prototype,"getGraphicsLayers",void 0),e([c({constructOnly:!0})],U.prototype,"layerSource",void 0),e([c({constructOnly:!0})],U.prototype,"spatialReference",void 0),e([c({constructOnly:!0})],U.prototype,"view",void 0),e([c({readOnly:!0})],U.prototype,"updating",null),e([c({readOnly:!0})],U.prototype,"availability",void 0),e([c()],U.prototype,"_hasZ",null),e([c()],U.prototype,"_snappingElevationAligner",null),e([c()],U.prototype,"_snappingElevationFilter",null),e([c()],U.prototype,"_symbologySnappingFetcher",null),e([c()],U.prototype,"_extrudedPolygonSymbolsCount",void 0),U=e([u("esri.views.interactive.snapping.featureSources.GraphicsSnappingSource")],U);const Z="OBJECTID";export{U as GraphicsSnappingSource};
5
+ import{_ as e}from"../../../../chunks/tslib.es6.js";import t from"../../../../core/Accessor.js";import{removeUnordered as o}from"../../../../core/arrayUtils.js";import{createTask as r}from"../../../../core/asyncUtils.js";import{memoize as s}from"../../../../core/memoize.js";import{throwIfAborted as i,allSettledValues as n,whenOrAbort as a}from"../../../../core/promiseUtils.js";import{initial as p,watch as l,on as d}from"../../../../core/reactiveUtils.js";import{property as c}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import{subclass as u}from"../../../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as h}from"../../../../core/support/UpdatingHandles.js";import y from"../../../../geometry/Polygon.js";import{initializeProjection as m,canProjectWithoutEngine as g,project as f}from"../../../../geometry/projectionUtils.js";import{normalizeCentralMeridianForDisplay as _}from"../../../../geometry/support/normalizeUtilsSync.js";import{featureGeometryTypeKebabDictionary as v}from"../../../../geometry/support/typeUtils.js";import{convertFromGeometry as S}from"../../../../layers/graphics/featureConversionUtils.js";import{OptimizedFeature as w}from"../../../../layers/graphics/OptimizedFeature.js";import{executeQueryForSnapping as j}from"../../../../layers/graphics/data/executeQueryForSnapping.js";import b from"../../../../layers/graphics/data/FeatureStore.js";import{QueryEngine as E}from"../../../../layers/graphics/data/QueryEngine.js";import k from"../../../../layers/support/FieldsIndex.js";import{elevationContextAffectsAlignment as C}from"../../../../support/elevationInfoUtils.js";import{symbolHasExtrudeSymbolLayer as F}from"../../../../symbols/support/utils.js";import{sortCandidatesInPlace as A,makeSnappingQuery as I}from"../snappingUtils.js";import{convertSnappingCandidate as P,makeGetGroundElevation as G}from"./queryEngineUtils.js";import{getSnappingCandidateElevationAligner as H}from"./snappingCandidateElevationAlignment.js";import{getSnappingCandidateElevationFilter as R}from"./snappingCandidateElevationFilter.js";import{getSymbologySnappingCandidatesFetcher as U}from"./symbologySnappingCandidates.js";import{TaskPriority as x}from"../../../support/Scheduler.js";const z="graphics-collections";let O=class extends t{get updating(){return this._updatingHandles.updating}get _hasZ(){const e=this.view;return null!=e&&"3d"===e.type&&"map-notes"!==this.layerSource.layer.type}get _snappingElevationAligner(){const{view:e}=this,{layer:t}=this.layerSource,o=null!=e&&"3d"===e.type;if(!o||"map-notes"===t.type)return H();const r=async(o,r)=>(await a(e.whenLayerView(t),r)).elevationAlignPointsInFeatures(o,r);return H(o,{elevationInfo:t.elevationInfo,alignPointsInFeatures:r})}get _snappingElevationFilter(){const{view:e}=this,t=null!=e&&"3d"===e.type&&"map-notes"!==this.layerSource.layer.type;return R(t)}get _symbologySnappingFetcher(){const{view:e}=this,{layer:t}=this.layerSource,o=null!=e&&"3d"===e.type,r=this._extrudedPolygonSymbolsCount>0;return o&&"map-notes"!==t.type&&r?U(r,(async(o,r)=>{const s=await e.whenLayerView(t);return i(r),s.queryForSymbologySnapping({candidates:o,spatialReference:e.spatialReference},r)})):U()}constructor(e){super(e),this.availability=1,this._sources={multipoint:null,point:null,polygon:null,polyline:null},this._loadedWkids=new Set,this._loadedWkts=new Set,this._pendingAdds=[],this._extrudedPolygonSymbolsCount=0,this._updatingHandles=new h,this._memoizedMakeGetGroundElevation=s(G)}destroy(){for(const e of this._pendingAdds)e.task.abort();this._pendingAdds.length=0,this._mapSources((e=>this._destroySource(e))),this._updatingHandles.destroy()}initialize(){this._updatingHandles.add((()=>this.getGraphicsLayers()),(e=>{this._updatingHandles.removeHandles(z);for(const t of e)this._addMany(t.graphics.toArray()),this.addHandles([t.on("graphic-update",(e=>this._onGraphicUpdate(e))),this._updatingHandles.addOnCollectionChange((()=>t.graphics),(e=>this._onGraphicsChanged(e)))],z)}),p);const{view:e}=this,{layer:t}=this.layerSource;null!=e&&"3d"===e.type&&"map-notes"!==t.type&&e.elevationProvider&&this.addHandles([e.elevationProvider.on("elevation-change",(({context:e})=>{C(e,t.elevationInfo)&&this._snappingElevationAligner.notifyElevationSourceChange()})),l((()=>t.elevationInfo),(()=>this._snappingElevationAligner.notifyElevationSourceChange()),p),d((()=>t),["edits","apply-edits","graphic-update"],(()=>this._symbologySnappingFetcher.notifySymbologyChange()))])}async fetchCandidates(e,t){const{point:o,coordinateHelper:{spatialReference:r}}=e,s=await n(this._mapSources((o=>this._fetchCandidatesForSource(o,e,t))));i(t);const a=this._memoizedMakeGetGroundElevation(this.view,r),p=s.flat().map((e=>P(e,a)));return A(o,p),p}async _fetchCandidatesForSource(e,t,o){const r=I({parameters:t,mode:this.view?.type??"2d"}),s=await j(e.queryEngine,r,o);i(o);const n=await this._snappingElevationAligner.alignCandidates(s.candidates,t.coordinateHelper.spatialReference,o);i(o);const a=await this._symbologySnappingFetcher.fetch(n,o);i(o);const p=0===a.length?n:[...n,...a];return this._snappingElevationFilter.filter(r,p)}refresh(){}_onGraphicUpdate(e){if(this.getGraphicsLayers().some((t=>t.graphics.includes(e.graphic))))switch(e.property){case"geometry":case"visible":this._remove(e.graphic),this._addMany([e.graphic])}}_onGraphicsChanged(e){for(const t of e.removed)this._remove(t);this._addMany(e.added)}_addMany(e){const t=[],o=new Map;for(const r of e)null!=r.geometry&&(this._needsInitializeProjection(r.geometry.spatialReference)?(t.push(r.geometry.spatialReference),o.set(r.uid,r)):this._add(r));this._createPendingAdd(t,o)}_createPendingAdd(e,t){if(!e.length)return;const s=r((async o=>{await m(e.map((e=>({source:e,dest:this.spatialReference}))),{signal:o}),this._markLoadedSpatialReferences(e);for(const e of t.values())this._add(e)}));this._updatingHandles.addPromise(s.promise);const i={task:s,graphics:t},n=()=>o(this._pendingAdds,i);s.promise.then(n,n),this._pendingAdds.push(i)}_markLoadedSpatialReferences(e){for(const t of e){null!=t.wkid&&this._loadedWkids.add(t.wkid);const e=t.wkt2||t.wkt;e&&this._loadedWkts.add(e)}}_add(e){if(null==e.geometry||!e.visible)return;let t=e.geometry;if("mesh"===t.type)return;"extent"===t.type&&(t=y.fromExtent(t));const o=this._ensureSource(t.type);if(null==o)return;const r=this._createOptimizedFeature(e.uid,t);null!=r&&(o.featureStore.add(r),F(e.symbol)&&this._extrudedPolygonSymbolsCount++)}_needsInitializeProjection(e){if(null!=e.wkid&&this._loadedWkids.has(e.wkid))return!1;const t=e.wkt2||e.wkt;return(!t||!this._loadedWkts.has(t))&&!g(e,this.spatialReference)}_createOptimizedFeature(e,t){const o=f(_(t),this.spatialReference);if(!o)return null;const r=this._ensureGeometryHasZ(o),s=S(r,this._hasZ,!1);return new w(s,{[Z]:e},null,e)}_ensureGeometryHasZ(e){if(!this._hasZ)return e;const t=e=>{for(;e.length<3;)e.push(0)},o=e.clone();switch(o.hasZ=!0,o.type){case"point":o.z=o.z??0;break;case"multipoint":o.points.forEach(t);break;case"polyline":o.paths.forEach((e=>e.forEach(t)));break;case"polygon":o.rings.forEach((e=>e.forEach(t)))}return o}_ensureSource(e){const t=this._sources[e];if(null!=t)return t;const o=this._createSource(e);return this._sources[e]=o,o}_createSource(e){const t=v.toJSON(e),o=this._hasZ,r=new b({geometryType:t,hasZ:o,hasM:!1});return{featureStore:r,queryEngine:new E({featureStore:r,fieldsIndex:k.fromLayerJSON({fields:[{name:Z,type:"esriFieldTypeOID",alias:Z}]}),geometryType:t,hasM:!1,hasZ:o,featureIdInfo:{type:"object-id",fieldName:Z},spatialReference:this.spatialReference,priority:x.SNAPPING,scheduler:null!=this.view&&"3d"===this.view.type?this.view.resourceController.scheduler:null}),type:e}}_remove(e){this._mapSources((t=>this._removeFromSource(t,e)));for(const t of this._pendingAdds)t.graphics.delete(e.uid),0===t.graphics.size&&t.task.abort()}_removeFromSource(e,t){const o=t.uid;e.featureStore.has(o)&&(e.featureStore.removeById(t.uid),F(t.symbol)&&this._extrudedPolygonSymbolsCount--)}_destroySource(e){e.queryEngine.destroy(),this._sources[e.type]=null}_mapSources(e){const{point:t,polygon:o,polyline:r,multipoint:s}=this._sources,i=[];return null!=t&&i.push(e(t)),null!=o&&i.push(e(o)),null!=r&&i.push(e(r)),null!=s&&i.push(e(s)),i}};e([c()],O.prototype,"getGraphicsLayers",void 0),e([c({constructOnly:!0})],O.prototype,"layerSource",void 0),e([c({constructOnly:!0})],O.prototype,"spatialReference",void 0),e([c({constructOnly:!0})],O.prototype,"view",void 0),e([c({readOnly:!0})],O.prototype,"updating",null),e([c({readOnly:!0})],O.prototype,"availability",void 0),e([c()],O.prototype,"_hasZ",null),e([c()],O.prototype,"_snappingElevationAligner",null),e([c()],O.prototype,"_snappingElevationFilter",null),e([c()],O.prototype,"_symbologySnappingFetcher",null),e([c()],O.prototype,"_extrudedPolygonSymbolsCount",void 0),O=e([u("esri.views.interactive.snapping.featureSources.GraphicsSnappingSource")],O);const Z="OBJECTID";export{O as GraphicsSnappingSource};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../chunks/tslib.es6.js";import r from"../../core/Collection.js";import{handlesGroup as t,makeHandle as s}from"../../core/handleUtils.js";import i from"../../core/Logger.js";import{debounce as a,ignoreAbortErrors as o}from"../../core/promiseUtils.js";import{sqlAnd as n}from"../../core/sql.js";import{property as d}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{subclass as p}from"../../core/accessorSupport/decorators/subclass.js";const l=Symbol(),u=u=>{let y=class extends u{constructor(){super(...arguments),this.layerViews=new r,this._debouncedUpdate=a((async()=>{const{layer:e,parent:r}=this,t=r?.footprintLayerView;let s=[];const i=this._createQuery();if(i&&t){const{features:r}=await t.queryFeatures(i);this.suspended||(s=r.map((r=>e.acquireLayer(r))))}this.removeHandles(l),this.addHandles(s,l)}))}get creatingLayerViews(){return this.view?.layerViewManager.isCreatingLayerViewsForLayer(this.layer)??!1}isUpdating(){return this.creatingLayerViews||this.layer.updating||this.layerViews.some((e=>e.updating))}enableLayerUpdates(){return t([this._updatingHandles.addWhen((()=>!1===this.parent?.footprintLayerView?.dataUpdating),(()=>this.updateLayers())),this._updatingHandles.add((()=>[this.layer.maximumVisibleSublayers,this.layer.parent?.orderBy,this.parent?.footprintLayerView?.filter,this.parent?.footprintLayerView?.timeExtent,this.suspended]),(()=>this.updateLayers())),s((()=>this.removeHandles(l)))])}updateLayers(){this.suspended?this.removeHandles(l):this._updatingHandles.addPromise(o(this._debouncedUpdate()).catch((e=>{i.getLogger(this).error(e)})))}_createQuery(){const e=this.parent?.footprintLayerView,r=this.layer?.parent;if(!e||!r||r.destroyed)return null;const{layer:{maximumVisibleSublayers:t},view:{scale:s}}=this;if(!t)return null;const{itemTypeField:i,itemSourceField:a,itemNameField:o,minScaleField:d,maxScaleField:p,objectIdField:l,orderBy:u}=r,y=n(`${d} IS NULL OR ${s} <= ${d} OR ${d} = 0`,`${p} IS NULL OR ${s} >= ${p}`),c=u?.find((e=>e.field&&!e.valueExpression)),m=e.createQuery();if(m.returnGeometry=!1,m.num=t,m.outFields=[l,a,o],m.where=n(m.where,y),null!=this.unsupportedItemTypes){const e=`${i} NOT IN (${this.unsupportedItemTypes.map((e=>`'${e}'`))})`;m.where=n(m.where,e)}return c?.field&&(m.orderByFields=[`${c.field} ${"descending"===c.order?"DESC":"ASC"}`],m.outFields.push(c.field)),m}};return e([d({readOnly:!0})],y.prototype,"creatingLayerViews",null),e([d()],y.prototype,"layer",void 0),e([d()],y.prototype,"layerViews",void 0),e([d({readOnly:!0})],y.prototype,"unsupportedItemTypes",void 0),e([d()],y.prototype,"parent",void 0),e([d({readOnly:!0})],y.prototype,"isUpdating",null),y=e([p("esri.views.layers.CatalogDynamicGroupLayerView")],y),y};export{u as default};
5
+ import{_ as e}from"../../chunks/tslib.es6.js";import r from"../../core/Collection.js";import{handlesGroup as t,makeHandle as s}from"../../core/handleUtils.js";import i from"../../core/Logger.js";import{debounce as a,ignoreAbortErrors as o}from"../../core/promiseUtils.js";import{sqlAnd as n}from"../../core/sql.js";import{property as d}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{subclass as p}from"../../core/accessorSupport/decorators/subclass.js";const l=Symbol(),u=u=>{let y=class extends u{constructor(...e){super(...e),this.layerViews=new r,this._debouncedUpdate=a((async()=>{const{layer:e,parent:r}=this,t=r?.footprintLayerView;let s=[];const i=this._createQuery();if(i&&t){const{features:r}=await t.queryFeatures(i);this.suspended||(s=r.map((r=>e.acquireLayer(r))))}this.removeHandles(l),this.addHandles(s,l)}))}get creatingLayerViews(){return this.view?.layerViewManager.isCreatingLayerViewsForLayer(this.layer)??!1}isUpdating(){return this.creatingLayerViews||this.layer.updating||this.layerViews.some((e=>e.updating))}enableLayerUpdates(){return t([this._updatingHandles.addWhen((()=>!1===this.parent?.footprintLayerView?.dataUpdating),(()=>this.updateLayers())),this._updatingHandles.add((()=>[this.layer.maximumVisibleSublayers,this.layer.parent?.orderBy,this.parent?.footprintLayerView?.filter,this.parent?.footprintLayerView?.timeExtent,this.suspended]),(()=>this.updateLayers())),s((()=>this.removeHandles(l)))])}updateLayers(){this.suspended?this.removeHandles(l):this._updatingHandles.addPromise(o(this._debouncedUpdate()).catch((e=>{i.getLogger(this).error(e)})))}_createQuery(){const e=this.parent?.footprintLayerView,r=this.layer?.parent;if(!e||!r||r.destroyed)return null;const{layer:{maximumVisibleSublayers:t},view:{scale:s}}=this;if(!t)return null;const{itemTypeField:i,itemSourceField:a,itemNameField:o,minScaleField:d,maxScaleField:p,objectIdField:l,orderBy:u}=r,y=n(`${d} IS NULL OR ${s} <= ${d} OR ${d} = 0`,`${p} IS NULL OR ${s} >= ${p}`),c=u?.find((e=>e.field&&!e.valueExpression)),m=e.createQuery();if(m.returnGeometry=!1,m.num=t,m.outFields=[l,a,o],m.where=n(m.where,y),null!=this.unsupportedItemTypes){const e=`${i} NOT IN (${this.unsupportedItemTypes.map((e=>`'${e}'`))})`;m.where=n(m.where,e)}return c?.field&&(m.orderByFields=[`${c.field} ${"descending"===c.order?"DESC":"ASC"}`],m.outFields.push(c.field)),m}};return e([d({readOnly:!0})],y.prototype,"creatingLayerViews",null),e([d()],y.prototype,"layer",void 0),e([d()],y.prototype,"layerViews",void 0),e([d({readOnly:!0})],y.prototype,"unsupportedItemTypes",void 0),e([d()],y.prototype,"parent",void 0),e([d({readOnly:!0})],y.prototype,"isUpdating",null),y=e([p("esri.views.layers.CatalogDynamicGroupLayerView")],y),y};export{u as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../chunks/tslib.es6.js";import{property as r}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as o}from"../../core/accessorSupport/decorators/subclass.js";const t=t=>{let s=class extends t{constructor(...e){super(...e)}get updateSuspended(){const e=this.parent?.dynamicGroupLayerView;return this.suspended&&(!e||!0===e.suspended)}queryAttributeBins(){throw new Error("Not implemented")}queryAggregates(){throw new Error("Not implemented")}};return e([r()],s.prototype,"layer",void 0),e([r()],s.prototype,"parent",void 0),e([r()],s.prototype,"highlightOptions",void 0),e([r()],s.prototype,"updateSuspended",null),s=e([o("esri.views.layers.CatalogFootprintLayerView")],s),s};export{t as default};
5
+ import{_ as e}from"../../chunks/tslib.es6.js";import{property as r}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as o}from"../../core/accessorSupport/decorators/subclass.js";const t=t=>{let s=class extends t{constructor(...e){super(...e)}get updateSuspended(){const e=this.parent?.dynamicGroupLayerView;return this.suspended&&(!e||!0===e.suspended)}queryAggregates(){throw new Error("Not implemented")}};return e([r()],s.prototype,"layer",void 0),e([r()],s.prototype,"parent",void 0),e([r()],s.prototype,"highlightOptions",void 0),e([r()],s.prototype,"updateSuspended",null),s=e([o("esri.views.layers.CatalogFootprintLayerView")],s),s};export{t 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.34/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../chunks/tslib.es6.js";import"../../core/has.js";import t from"../../core/Logger.js";import{throwIfAborted as i}from"../../core/promiseUtils.js";import{watch as r,on as s,syncAndInitial as l}from"../../core/reactiveUtils.js";import{sqlAnd as o}from"../../core/sql.js";import{property as n}from"../../core/accessorSupport/decorators/property.js";import"../../core/RandomLCG.js";import{subclass as a}from"../../core/accessorSupport/decorators/subclass.js";import{getFeatureIdInfoFieldNames as u}from"../../layers/graphics/data/FeatureIdInfo.js";import{systemIsSpatialFieldName as d}from"../../layers/knowledgeGraph/constants.js";import{getEffectiveDisplayFilter as p}from"../../layers/support/displayFilterUtils.js";import f from"../../layers/support/FeatureEffect.js";import y from"../../layers/support/FeatureFilter.js";import{getSignedInUser as c}from"../../layers/support/featureLayerUtils.js";import{fixFields as h,unpackFieldNames as m,collectLabelingFields as F,collectElevationFields as g,collectFilterFields as I,collectFeatureReductionFields as b,collectOrderByInfos as w,collectFields as v,collectTrackInfoFields as E,collectDisplayFilterFields as x,collectField as q,featureHasFields as j}from"../../layers/support/fieldUtils.js";import{getFloorFilterClause as R}from"../../layers/support/floorFilterUtils.js";import{getUtilityNetworkFields as _}from"../../networks/support/networkFieldUtils.js";import O from"../../rest/support/Query.js";import{loadArcade as C}from"../../support/loadArcade.js";import{createFeatureIdInfo as k}from"../2d/layers/features/layerAdapters/featureServiceUtils.js";import{getRequiredFields as P,getFetchPopupTemplate as U}from"./support/popupUtils.js";import{WhereClauseVisitor as T}from"./support/WhereClauseVisitor.js";const A=A=>{let L=class extends A{constructor(...e){super(...e),this._updatingRequiredPromise=null,this.filter=null,this.layer=null,this.requiresCurrentUser=!1,this.requiredFields=[],this.view=null}initialize(){this.addHandles([r((()=>{const e=this.layer,t=this.view;return[e&&"elevationInfo"in e?e.elevationInfo?.featureExpressionInfo:null,e&&"displayField"in e?e.displayField:null,e&&"timeInfo"in e&&e.timeInfo,e&&"renderer"in e&&e.renderer,e&&"labelingInfo"in e&&e.labelingInfo,e&&"floorInfo"in e&&e.floorInfo,t?.requiredFieldsOptions?.featureTitleFields&&e&&"featureTitleFields"in e&&e.featureTitleFields,t?.requiredFieldsOptions?.utilityNetworkFields&&_(t,e),e.displayFilterInfo,this.displayFilterEnabled,this.filter,this.featureEffect,this.timeExtent,"knowledge-graph-sublayer"===e?.type&&"link-chart"===e.parentCompositeLayer.type&&e.parentCompositeLayer.linkChart?.linkChartProperties.nonspatialDataDisplay?.mode,"parquet"===e?.type&&e.popupTemplate]}),(()=>this._handleChange()),l),s((()=>this.view?.floors),"change",(()=>this._handleChange())),s((()=>this.layer.displayFilterInfo?.filters),"change",(()=>this._handleChange())),s((()=>this.layer&&"sublayers"in this.layer?this.layer.sublayers:null),"change",(()=>this._handleChange()))])}get availableFields(){if(!this.layer)return[];const{layer:e,layer:{fieldsIndex:t},requiredFields:i}=this;return"outFields"in e&&e.outFields?h(t,[...m(t,e.outFields),...i]):h(t,i)}get displayFilterEnabled(){return(this.view?.displayFilterEnabled??!0)&&(!("displayFilterEnabled"in this.layer)||(this.layer?.displayFilterEnabled??!0))}get effectiveDisplayFilter(){const e=this.layer;return this.displayFilterEnabled&&e.displayFilterInfo?p(e.displayFilterInfo,this.view):null}get featureEffect(){return this.layer&&"featureEffect"in this.layer?this.layer.featureEffect:null}set featureEffect(e){this._override("featureEffect",e)}get maximumNumberOfFeatures(){return 0}set maximumNumberOfFeatures(e){t.getLogger(this).error("#maximumNumberOfFeatures=","Setting maximum number of features is not supported")}get maximumNumberOfFeaturesExceeded(){return!1}get signedInUser(){return this.layer?.url?c(this.layer.url):Promise.resolve(null)}highlight(e,t){throw new Error("missing implementation")}createQuery(){const e={outFields:["*"],returnGeometry:!0,outSpatialReference:this.view.spatialReference},t=null!=this.filter?this.filter.createQuery(e):new O(e);return"floorInfo"in this.layer&&this.layer.floorInfo&&(t.where=o(t.where,R(this))),this.displayFilterEnabled&&(t.where=o(t.where,this.effectiveDisplayFilter?.where)),null!=this.timeExtent&&(t.timeExtent=null!=t.timeExtent?t.timeExtent.intersection(this.timeExtent):this.timeExtent.clone()),t}createAggregateQuery(){const e={outFields:["*"],returnGeometry:!0,outSpatialReference:this.view.spatialReference};return new O(e)}queryFeatures(e,t){throw new Error("missing implementation")}queryObjectIds(e,t){throw new Error("missing implementation")}queryFeatureCount(e,t){throw new Error("missing implementation")}queryExtent(e,t){throw new Error("missing implementation")}async fetchPopupFeaturesFromGraphics(e,t){return this._fetchPopupFeatures(e,t)}_loadArcadeModules(e){return e.expressionInfos?.length||Array.isArray(e.content)&&e.content.some((e=>"expression"===e.type))?C():Promise.resolve()}_handleChange(){const e=Promise.all([this._updateRequiredFields(),this._updateClientWhereClauseRequirements()]).then((()=>{}));return this._set("_updatingRequiredPromise",e),e.then((()=>{this._updatingRequiredPromise===e&&this._set("_updatingRequiredPromise",null)})),e}async _updateClientWhereClauseRequirements(){if(!this.layer||!this.view)return;const{layer:e}=this,i=new T(e.fieldsIndex);if(i.visitFilter(this.filter),"featureReduction"in e&&i.visitFeatureReduction(e.featureReduction),"labelingInfo"in e&&i.visitLabelingInfo(e.labelsVisible,e.labelingInfo),"trackInfo"in e&&i.visitTrackInfo(e.trackInfo),"2d"===this.view.type&&(i.visitFilter(this.featureEffect?.filter),i.visitDisplayFilter(this.displayFilterEnabled,e.displayFilterInfo),"featureReduction"in e&&i.visitFeatureReduction(e.featureReduction)),"subtype-group"===e.type)for(const t of e.sublayers)i.visitLabelingInfo(t.labelsVisible,t.labelingInfo);try{const e=await i.finish();this._set("requiresCurrentUser",e.requiresCurrentUser)}catch(r){t.getLogger(this).error(r)}}async _updateRequiredFields(){if(!this.layer||!this.view)return;const e="3d"===this.view.type,{layer:i,layer:{fieldsIndex:r}}=this,s="renderer"in i&&i.renderer,l="orderBy"in i&&i.orderBy,o="featureReduction"in i?i.featureReduction:null,n=new Set,a=[s?s.collectRequiredFields(n,r):null,F(n,i),e&&"elevationInfo"in i?g(n,i):null,null!=this.filter?I(n,i,this.filter):null,e||null==this.featureEffect?null:I(n,i,this.featureEffect.filter),!e&&o?b(n,i,o):null,!e&&l?w(n,i,l):null];if("timeInfo"in i&&i.timeInfo&&this.timeExtent&&v(n,i.fieldsIndex,[i.timeInfo.startField,i.timeInfo.endField]),"timeInfo"in i&&i.timeInfo&&"trackInfo"in i&&i.trackInfo){const{trackInfo:e}=i;v(n,i.fieldsIndex,[i.timeInfo.trackIdField]),"feature"!==i.type&&"startTimeField"!==e.timeField||v(n,i.fieldsIndex,[i.timeInfo.startField]),"endTimeField"===e.timeField&&v(n,i.fieldsIndex,[i.timeInfo.endField]),await E(n,i)}if("floorInfo"in i&&i.floorInfo&&v(n,i.fieldsIndex,[i.floorInfo.floorField]),"featureTitleFields"in i&&this.view?.requiredFieldsOptions?.featureTitleFields&&i.featureTitleFields&&v(n,i.fieldsIndex,i.featureTitleFields),"feature"===i.type&&i.globalIdField&&this.view?.requiredFieldsOptions?.globalIdField&&v(n,i.fieldsIndex,[i.globalIdField]),this.displayFilterEnabled&&a.push(x(n,i,i.displayFilterInfo)),"feature"===i.type&&e&&null!=i.infoFor3D&&(null==i.globalIdField&&t.getLogger(this).error("globalIdField missing on 3DObjectFeatureLayer"),v(n,i.fieldsIndex,[i.globalIdField])),"subtype-group"===i.type){q(n,r,i.subtypeField);const e=i.sublayers.map((e=>Promise.all([e.renderer?.collectRequiredFields(n,r),F(n,e)])));a.push(Promise.all(e))}if("catalog-footprint"===i.type&&i.parent){const e=i.parent;v(n,r,[e.itemNameField,e.itemSourceField,e.itemTypeField,e.maxScaleField,e.minScaleField])}"knowledge-graph-sublayer"===i.type&&"link-chart"===i.parentCompositeLayer.type&&q(n,r,d),"parquet"===i.type&&a.push(P(i,i.popupTemplate).then((e=>{for(const t of e)n.add(t)})));const p=await Promise.allSettled(a);if(e)q(n,r,i.objectIdField);else for(const t of u(k(i)))q(n,r,t);e&&"displayField"in i&&i.displayField&&q(n,r,i.displayField);for(const u of p)"rejected"===u.status&&t.getLogger(this).error(u.reason);const f=Array.from(n).sort();this._set("requiredFields",f)}_popupFeatureHasRequiredFields(e,t){return j(t,e)}async _fetchPopupFeatures(e,t){const r=new Array(e.length),s=new Map,l=new Map,n=await this._createPopupQuery(e.map((e=>e.origin?.layer??e.layer)),t);for(let o=0;o<e.length;o++){const a=e[o];if(a.isAggregate){r[o]=a;continue}const u=a.origin?.layer??a.layer;if(!u||!("popupEnabled"in u)||!u.popupEnabled)continue;const d=m(this.layer.fieldsIndex,n.outFields),p=U(u,t);if(null==p)continue;const f=await this._loadArcadeModules(p);i(t);if(f&&f.arcadeUtils.hasGeometryOperations(p)||!this._popupFeatureHasRequiredFields(a,d)){const e=a.getObjectId();if(null!=e){s.set(e,{graphic:a,index:o});continue}const t=a.getGlobalId();if(null!=t){l.set(t,{graphic:a,index:o});continue}}r[o]=a}if("stream"===this.layer.type||"parquet"===this.layer.type||0===s.size&&0===l.size)return r.filter(Boolean);const a=[];if(s.size>0){const e=n.clone();"uniqueIdFields"in this.layer&&this.layer.uniqueIdFields?.length&&(e.outFields??=[],e.outFields.push(...this.layer.uniqueIdFields)),e.objectIds=Array.from(s.keys()),a.push({type:"object-id",query:e,map:s})}const u="globalIdField"in this.layer?this.layer.globalIdField:null;if(null!=u&&l.size>0){const e=n.clone();e.outFields??=[],e.outFields.push(u);const t=Array.from(l.keys());e.where=o(n.where,`${u} IN (${t.map((e=>`'${e}'`)).join(",")})`),a.push({type:"global-id",query:e,map:l})}for(const{type:i,query:o,map:d}of a)try{const e=await this.layer.queryFeatures(o,t);for(const t of e.features){const e="object-id"===i?t.getObjectId():t.getGlobalId();if(null==e)continue;const s=d.get(e);if(!s)continue;const{graphic:{geometry:l,origin:o},index:n}=s;t.geometry||=l,t.origin=o,r[n]=t}}catch{}return r.filter(Boolean)}async _createPopupQuery(e,t){const r=this.layer.createQuery(),s=new Set;let l=!1;const n=e??[this.layer];for(const o of n){if(!("popupEnabled"in o))continue;const e=U(o,t);if(null==e)continue;const r=await this._loadArcadeModules(e);i(t);const n=r&&r.arcadeUtils.hasGeometryOperations(e);l=!("point"!==this.layer.geometryType&&!n);const a=await P(this.layer,e);i(t);for(const t of a)s.add(t)}return r.returnGeometry=l,r.returnZ=l,r.returnM=l,r.outFields=Array.from(s),r.outSpatialReference=this.view.spatialReference,"floorInfo"in this.layer&&this.layer.floorInfo&&(r.where=o(r.where,R(this))),r}canResume(){return!!super.canResume()&&(null==this.timeExtent||!this.timeExtent.isEmpty)}getTest(){}get test(){}};return e([n()],L.prototype,"_updatingRequiredPromise",void 0),e([n({readOnly:!0})],L.prototype,"availableFields",null),e([n({readOnly:!0})],L.prototype,"displayFilterEnabled",null),e([n({readOnly:!0})],L.prototype,"effectiveDisplayFilter",null),e([n({type:f})],L.prototype,"featureEffect",null),e([n({type:y})],L.prototype,"filter",void 0),e([n()],L.prototype,"layer",void 0),e([n({type:Number})],L.prototype,"maximumNumberOfFeatures",null),e([n({readOnly:!0,type:Boolean})],L.prototype,"maximumNumberOfFeaturesExceeded",null),e([n()],L.prototype,"requiresCurrentUser",void 0),e([n({readOnly:!0})],L.prototype,"requiredFields",void 0),e([n({readOnly:!0})],L.prototype,"signedInUser",null),e([n()],L.prototype,"suspended",void 0),e([n()],L.prototype,"view",void 0),L=e([a("esri.views.layers.FeatureLayerView")],L),L};export{A as default};
5
+ import{_ as e}from"../../chunks/tslib.es6.js";import"../../core/has.js";import t from"../../core/Logger.js";import{throwIfAborted as r}from"../../core/promiseUtils.js";import{watch as i,on as l,syncAndInitial as s}from"../../core/reactiveUtils.js";import{sqlAnd as o}from"../../core/sql.js";import{property as n}from"../../core/accessorSupport/decorators/property.js";import"../../core/RandomLCG.js";import{subclass as a}from"../../core/accessorSupport/decorators/subclass.js";import{getFeatureIdInfoFieldNames as u}from"../../layers/graphics/data/FeatureIdInfo.js";import{systemIsSpatialFieldName as d}from"../../layers/knowledgeGraph/constants.js";import{getEffectiveDisplayFilter as p}from"../../layers/support/displayFilterUtils.js";import f from"../../layers/support/FeatureEffect.js";import y from"../../layers/support/FeatureFilter.js";import{getSignedInUser as m}from"../../layers/support/featureLayerUtils.js";import{fetchFeaturePopupFeatures as h,loadFeaturePopupArcadeModules as c}from"../../layers/support/featurePopupQueryUtils.js";import{fixFields as F,unpackFieldNames as g,collectLabelingFields as I,collectElevationFields as b,collectFilterFields as w,collectFeatureReductionFields as E,collectOrderByInfos as v,collectFields as x,collectTrackInfoFields as q,collectDisplayFilterFields as R,collectField as j,featureHasFields as _}from"../../layers/support/fieldUtils.js";import{getFloorFilterClause as C}from"../../layers/support/floorFilterUtils.js";import{getUtilityNetworkFields as O}from"../../networks/support/networkFieldUtils.js";import k from"../../rest/support/Query.js";import{createFeatureIdInfo as U}from"../2d/layers/features/layerAdapters/featureServiceUtils.js";import{getRequiredFields as P,getFetchPopupTemplate as T}from"./support/popupUtils.js";import{WhereClauseVisitor as L}from"./support/WhereClauseVisitor.js";const S=S=>{let N=class extends S{constructor(...e){super(...e),this._updatingRequiredPromise=null,this.filter=null,this.layer=null,this.requiresCurrentUser=!1,this.requiredFields=[],this.view=null}initialize(){this.addHandles([i((()=>{const e=this.layer,t=this.view;return[e&&"elevationInfo"in e?e.elevationInfo?.featureExpressionInfo:null,e&&"displayField"in e?e.displayField:null,e&&"timeInfo"in e&&e.timeInfo,e&&"renderer"in e&&e.renderer,e&&"labelingInfo"in e&&e.labelingInfo,e&&"floorInfo"in e&&e.floorInfo,t?.requiredFieldsOptions?.featureTitleFields&&e&&"featureTitleFields"in e&&e.featureTitleFields,t?.requiredFieldsOptions?.utilityNetworkFields&&O(t,e),e.displayFilterInfo,this.displayFilterEnabled,this.filter,this.featureEffect,this.timeExtent,"knowledge-graph-sublayer"===e?.type&&"link-chart"===e.parentCompositeLayer.type&&e.parentCompositeLayer.linkChart?.linkChartProperties.nonspatialDataDisplay?.mode,"parquet"===e?.type&&e.popupTemplate]}),(()=>this._handleChange()),s),l((()=>this.view?.floors),"change",(()=>this._handleChange())),l((()=>this.layer.displayFilterInfo?.filters),"change",(()=>this._handleChange())),l((()=>this.layer&&"sublayers"in this.layer?this.layer.sublayers:null),"change",(()=>this._handleChange()))])}get availableFields(){if(!this.layer)return[];const{layer:e,layer:{fieldsIndex:t},requiredFields:r}=this;return"outFields"in e&&e.outFields?F(t,[...g(t,e.outFields),...r]):F(t,r)}get displayFilterEnabled(){return(this.view?.displayFilterEnabled??!0)&&(!("displayFilterEnabled"in this.layer)||(this.layer?.displayFilterEnabled??!0))}get effectiveDisplayFilter(){const e=this.layer;return this.displayFilterEnabled&&e.displayFilterInfo?p(e.displayFilterInfo,this.view):null}get featureEffect(){return this.layer&&"featureEffect"in this.layer?this.layer.featureEffect:null}set featureEffect(e){this._override("featureEffect",e)}get maximumNumberOfFeatures(){return 0}set maximumNumberOfFeatures(e){t.getLogger(this).error("#maximumNumberOfFeatures=","Setting maximum number of features is not supported")}get maximumNumberOfFeaturesExceeded(){return!1}get signedInUser(){return this.layer?.url?m(this.layer.url):Promise.resolve(null)}highlight(e,t){throw new Error("missing implementation")}createQuery(){const e={outFields:["*"],returnGeometry:!0,outSpatialReference:this.view.spatialReference},t=null!=this.filter?this.filter.createQuery(e):new k(e);return"floorInfo"in this.layer&&this.layer.floorInfo&&(t.where=o(t.where,C(this))),this.displayFilterEnabled&&(t.where=o(t.where,this.effectiveDisplayFilter?.where)),null!=this.timeExtent&&(t.timeExtent=null!=t.timeExtent?t.timeExtent.intersection(this.timeExtent):this.timeExtent.clone()),t}createAggregateQuery(){const e={outFields:["*"],returnGeometry:!0,outSpatialReference:this.view.spatialReference};return new k(e)}queryFeatures(e,t){throw new Error("missing implementation")}queryObjectIds(e,t){throw new Error("missing implementation")}queryFeatureCount(e,t){throw new Error("missing implementation")}queryExtent(e,t){throw new Error("missing implementation")}async fetchPopupFeaturesFromGraphics(e,t){const r=await this._createPopupQuery(e.map((e=>e.origin?.layer??e.layer)),t);return await h(this.layer,e,r,{getPopupTemplate:e=>e&&"popupEnabled"in e&&e.popupEnabled?T(e,t):null,hasRequiredFields:(e,t)=>this._popupFeatureHasRequiredFields(e,t),...t})}_handleChange(){const e=Promise.all([this._updateRequiredFields(),this._updateClientWhereClauseRequirements()]).then((()=>{}));return this._set("_updatingRequiredPromise",e),e.then((()=>{this._updatingRequiredPromise===e&&this._set("_updatingRequiredPromise",null)})),e}async _updateClientWhereClauseRequirements(){if(!this.layer||!this.view)return;const{layer:e}=this,r=new L(e.fieldsIndex);if(r.visitFilter(this.filter),"featureReduction"in e&&r.visitFeatureReduction(e.featureReduction),"labelingInfo"in e&&r.visitLabelingInfo(e.labelsVisible,e.labelingInfo),"trackInfo"in e&&r.visitTrackInfo(e.trackInfo),"2d"===this.view.type&&(r.visitFilter(this.featureEffect?.filter),r.visitDisplayFilter(this.displayFilterEnabled,e.displayFilterInfo),"featureReduction"in e&&r.visitFeatureReduction(e.featureReduction)),"subtype-group"===e.type)for(const t of e.sublayers)r.visitLabelingInfo(t.labelsVisible,t.labelingInfo);try{const e=await r.finish();this._set("requiresCurrentUser",e.requiresCurrentUser)}catch(i){t.getLogger(this).error(i)}}async _updateRequiredFields(){if(!this.layer||!this.view)return;const e="3d"===this.view.type,{layer:r,layer:{fieldsIndex:i}}=this,l="renderer"in r&&r.renderer,s="orderBy"in r&&r.orderBy,o="featureReduction"in r?r.featureReduction:null,n=new Set,a=[l?l.collectRequiredFields(n,i):null,I(n,r),e&&"elevationInfo"in r?b(n,r):null,null!=this.filter?w(n,r,this.filter):null,e||null==this.featureEffect?null:w(n,r,this.featureEffect.filter),!e&&o?E(n,r,o):null,!e&&s?v(n,r,s):null];if("timeInfo"in r&&r.timeInfo&&this.timeExtent&&x(n,r.fieldsIndex,[r.timeInfo.startField,r.timeInfo.endField]),"timeInfo"in r&&r.timeInfo&&"trackInfo"in r&&r.trackInfo){const{trackInfo:e}=r;x(n,r.fieldsIndex,[r.timeInfo.trackIdField]),"feature"!==r.type&&"startTimeField"!==e.timeField||x(n,r.fieldsIndex,[r.timeInfo.startField]),"endTimeField"===e.timeField&&x(n,r.fieldsIndex,[r.timeInfo.endField]),await q(n,r)}if("floorInfo"in r&&r.floorInfo&&x(n,r.fieldsIndex,[r.floorInfo.floorField]),"featureTitleFields"in r&&this.view?.requiredFieldsOptions?.featureTitleFields&&r.featureTitleFields&&x(n,r.fieldsIndex,r.featureTitleFields),"feature"===r.type&&r.globalIdField&&this.view?.requiredFieldsOptions?.globalIdField&&x(n,r.fieldsIndex,[r.globalIdField]),this.displayFilterEnabled&&a.push(R(n,r,r.displayFilterInfo)),"feature"===r.type&&e&&null!=r.infoFor3D&&(null==r.globalIdField&&t.getLogger(this).error("globalIdField missing on 3DObjectFeatureLayer"),x(n,r.fieldsIndex,[r.globalIdField])),"subtype-group"===r.type){j(n,i,r.subtypeField);const e=r.sublayers.map((e=>Promise.all([e.renderer?.collectRequiredFields(n,i),I(n,e)])));a.push(Promise.all(e))}if("catalog-footprint"===r.type&&r.parent){const e=r.parent;x(n,i,[e.itemNameField,e.itemSourceField,e.itemTypeField,e.maxScaleField,e.minScaleField])}"knowledge-graph-sublayer"===r.type&&"link-chart"===r.parentCompositeLayer.type&&j(n,i,d),"parquet"===r.type&&a.push(P(r,r.popupTemplate).then((e=>{for(const t of e)n.add(t)})));const p=await Promise.allSettled(a);if(e)j(n,i,r.objectIdField);else for(const t of u(U(r)))j(n,i,t);e&&"displayField"in r&&r.displayField&&j(n,i,r.displayField);for(const u of p)"rejected"===u.status&&t.getLogger(this).error(u.reason);const f=Array.from(n).sort();this._set("requiredFields",f)}_popupFeatureHasRequiredFields(e,t){return _(e,t)}async _createPopupQuery(e,t){const i=this.layer.createQuery(),l=new Set;let s=!1;const n=e??[this.layer];for(const o of n){if(!("popupEnabled"in o))continue;const e=T(o,t);if(null==e)continue;const i=await c(e);r(t);const n=i&&i.arcadeUtils.hasGeometryOperations(e);s=!("point"!==this.layer.geometryType&&!n);const a=await P(this.layer,e);r(t);for(const t of a)l.add(t)}return i.returnGeometry=s,i.returnZ=s,i.returnM=s,i.outFields=Array.from(l),i.outSpatialReference=this.view.spatialReference,"floorInfo"in this.layer&&this.layer.floorInfo&&(i.where=o(i.where,C(this))),i}canResume(){return!!super.canResume()&&(null==this.timeExtent||!this.timeExtent.isEmpty)}getTest(){}get test(){}};return e([n()],N.prototype,"_updatingRequiredPromise",void 0),e([n({readOnly:!0})],N.prototype,"availableFields",null),e([n({readOnly:!0})],N.prototype,"displayFilterEnabled",null),e([n({readOnly:!0})],N.prototype,"effectiveDisplayFilter",null),e([n({type:f})],N.prototype,"featureEffect",null),e([n({type:y})],N.prototype,"filter",void 0),e([n()],N.prototype,"layer",void 0),e([n({type:Number})],N.prototype,"maximumNumberOfFeatures",null),e([n({readOnly:!0,type:Boolean})],N.prototype,"maximumNumberOfFeaturesExceeded",null),e([n()],N.prototype,"requiresCurrentUser",void 0),e([n({readOnly:!0})],N.prototype,"requiredFields",void 0),e([n({readOnly:!0})],N.prototype,"signedInUser",null),e([n()],N.prototype,"suspended",void 0),e([n()],N.prototype,"view",void 0),N=e([a("esri.views.layers.FeatureLayerView")],N),N};export{S as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../core/Error.js";import{throwIfAborted as r}from"../../core/promiseUtils.js";import{property as o}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as s}from"../../core/accessorSupport/decorators/subclass.js";import i from"../../geometry/Point.js";import{combineTimeExtent as a}from"../../layers/support/timeSupport.js";import{load as p,getSourceScale as n}from"../../layers/support/rasterFunctions/rasterProjectionHelper.js";import u from"../../rest/support/Query.js";import{getFetchPopupTemplate as c}from"./support/popupUtils.js";const m=m=>{let l=class extends m{constructor(){super(...arguments),this.view=null}get timeExtent(){return a(this.layer,this.view?.timeExtent,this._get("timeExtent"))}async fetchPopupFeaturesAtLocation(e,o){const{layer:s}=this;if(!e)throw new t("imagerylayerview:fetchPopupFeatures","Nothing to fetch without area",{layer:s});const{popupEnabled:a}=s,p=c(s,o);if(!a||null==p)return[];const n=await p.getRequiredFields();r(o);const m=new u;m.timeExtent=this.timeExtent,m.geometry=e,m.outFields=n,m.outSpatialReference=e.spatialReference;const{resolution:l,spatialReference:y}=this.view,h="2d"===this.view.type?new i(l,l,y):new i(.5*l,.5*l,y),{returnTopmostRaster:f,showNoDataRecords:w}=p.layerOptions||{returnTopmostRaster:!0,showNoDataRecords:!1},d={returnDomainValues:!0,returnTopmostRaster:f,pixelSize:h,showNoDataRecords:w,signal:o?.signal};return s.queryVisibleRasters(m,d).then((e=>e))}async getSourceScale(){return await p(),await this.layer.load(),n(this.layer.serviceRasterInfo,this.view.spatialReference)}canResume(){return!!super.canResume()&&!this.timeExtent?.isEmpty}};return e([o()],l.prototype,"layer",void 0),e([o()],l.prototype,"suspended",void 0),e([o({readOnly:!0})],l.prototype,"timeExtent",null),e([o()],l.prototype,"view",void 0),l=e([s("esri.views.layers.ImageryLayerView")],l),l};export{m as default};
5
+ import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../core/Error.js";import{throwIfAborted as r}from"../../core/promiseUtils.js";import{property as o}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as s}from"../../core/accessorSupport/decorators/subclass.js";import i from"../../geometry/Point.js";import{combineTimeExtent as a}from"../../layers/support/timeSupport.js";import{load as p,getSourceScale as n}from"../../layers/support/rasterFunctions/rasterProjectionHelper.js";import u from"../../rest/support/Query.js";import{getFetchPopupTemplate as c}from"./support/popupUtils.js";const m=m=>{let l=class extends m{constructor(...e){super(...e),this.view=null}get timeExtent(){return a(this.layer,this.view?.timeExtent,this._get("timeExtent"))}async fetchPopupFeaturesAtLocation(e,o){const{layer:s}=this;if(!e)throw new t("imagerylayerview:fetchPopupFeatures","Nothing to fetch without area",{layer:s});const{popupEnabled:a}=s,p=c(s,o);if(!a||null==p)return[];const n=await p.getRequiredFields();r(o);const m=new u;m.timeExtent=this.timeExtent,m.geometry=e,m.outFields=n,m.outSpatialReference=e.spatialReference;const{resolution:l,spatialReference:y}=this.view,h="2d"===this.view.type?new i(l,l,y):new i(.5*l,.5*l,y),{returnTopmostRaster:f,showNoDataRecords:w}=p.layerOptions||{returnTopmostRaster:!0,showNoDataRecords:!1},d={returnDomainValues:!0,returnTopmostRaster:f,pixelSize:h,showNoDataRecords:w,signal:o?.signal};return s.queryVisibleRasters(m,d).then((e=>e))}async getSourceScale(){return await p(),await this.layer.load(),n(this.layer.serviceRasterInfo,this.view.spatialReference)}canResume(){return!!super.canResume()&&!this.timeExtent?.isEmpty}};return e([o()],l.prototype,"layer",void 0),e([o()],l.prototype,"suspended",void 0),e([o({readOnly:!0})],l.prototype,"timeExtent",null),e([o()],l.prototype,"view",void 0),l=e([s("esri.views.layers.ImageryLayerView")],l),l};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.34/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../Graphic.js";import r from"../../core/Error.js";import{property as s}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as i}from"../../core/accessorSupport/decorators/subclass.js";import{addMultidimensionalFieldValues as a,commonRasterFieldNames as o,rasterFieldPrefix as n}from"../../layers/support/rasterFieldUtils.js";import{combineTimeExtent as l}from"../../layers/support/timeSupport.js";import{isFunctionRaster as u}from"../../layers/support/rasterDatasets/datasetUtils.js";import{getDefaultDatumTransformationForDataset as p,projectDatasetExtent as c,getSourceScale as m}from"../../layers/support/rasterFunctions/rasterProjectionHelper.js";import{getFetchPopupTemplate as y}from"./support/popupUtils.js";const f=f=>{let d=class extends f{constructor(){super(...arguments),this.layer=null,this.tileInfo=null}get fullExtent(){try{return this.layer.loaded?this._getFullExtent():null}catch{return null}}get timeExtent(){return l(this.layer,this.view?.timeExtent,this._get("timeExtent"))}get hasTilingEffects(){return!!(this.layer.renderer&&"dynamicRangeAdjustment"in this.layer.renderer&&this.layer.renderer.dynamicRangeAdjustment)}get datumTransformation(){try{return this.layer.loaded?p(this.layer.fullExtent,this.view.spatialReference,!0):null}catch{return null}}supportsSpatialReference(e){try{return!this.layer.loaded||!!c(this.layer.serviceRasterInfo,e)}catch{return!1}}async fetchPopupFeaturesAtLocation(e,s){const{layer:i}=this;if(!e)throw new r("imageryTileLayerView:fetchPopupFeatures","Nothing to fetch without area",{layer:i});const{popupEnabled:l}=i,p=y(i,s);if(!l||null==p)return[];const c=[],{value:m,magdirValue:f,processedValue:d}=await i.identify(e,{timeExtent:this.timeExtent,signal:s?.signal});let h="";if(m?.length){h="imagery-tile"===i.type&&i.hasStandardTime()&&null!=m[0]?m.map((e=>i.getStandardTimeValue(e))).join(", "):m.join(", ");const e={ObjectId:0};e[o.servicePixelValue]="imagery-tile"===i.type&&u(i.raster)?d?.join(", "):h,e[o.rawServicePixelValue]=h;const r=i.raster?.rasterInfo??i.serviceRasterInfo,s=r?.attributeTable;if(null!=s){const{fields:t,features:r}=s,i=t.find((({name:e})=>"value"===e.toLowerCase())),a=e[o.servicePixelValue],l=i?r.find((e=>String(e.attributes[i.name])===a)):null;if(l)for(const s in l.attributes)if(l.attributes.hasOwnProperty(s)){e[n+s]=l.attributes[s]}}const l=r?.dataType;"vector-magdir"!==l&&"vector-uv"!==l||(e[o.magnitude]=f?.[0],e[o.direction]=f?.[1]);const{multidimensionalDefinition:p}=this.layer.normalizeRasterFetchOptions({timeExtent:this.timeExtent});a(i.rasterFields,e,p);const y=new t({geometry:this.fullExtent?.clone(),attributes:e,layer:i,sourceLayer:i});c.push(y)}return c}async getSourceScale(){return await this.layer.load(),m(this.layer.serviceRasterInfo,this.view.spatialReference)}_getFullExtent(){return c(this.layer.serviceRasterInfo,this.view.spatialReference)}};return e([s()],d.prototype,"fullExtent",null),e([s()],d.prototype,"layer",void 0),e([s({readOnly:!0})],d.prototype,"timeExtent",null),e([s()],d.prototype,"tileInfo",void 0),e([s({readOnly:!0})],d.prototype,"hasTilingEffects",null),e([s()],d.prototype,"datumTransformation",null),d=e([i("esri.views.layers.ImageryTileLayerView")],d),d};export{f as default};
5
+ import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../Graphic.js";import r from"../../core/Error.js";import{property as s}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as i}from"../../core/accessorSupport/decorators/subclass.js";import{addMultidimensionalFieldValues as a,commonRasterFieldNames as o,rasterFieldPrefix as n}from"../../layers/support/rasterFieldUtils.js";import{combineTimeExtent as l}from"../../layers/support/timeSupport.js";import{isFunctionRaster as u}from"../../layers/support/rasterDatasets/datasetUtils.js";import{getDefaultDatumTransformationForDataset as p,projectDatasetExtent as c,getSourceScale as m}from"../../layers/support/rasterFunctions/rasterProjectionHelper.js";import{getFetchPopupTemplate as y}from"./support/popupUtils.js";const f=f=>{let d=class extends f{constructor(...e){super(...e),this.layer=null,this.tileInfo=null}get fullExtent(){try{return this.layer.loaded?this._getFullExtent():null}catch{return null}}get timeExtent(){return l(this.layer,this.view?.timeExtent,this._get("timeExtent"))}get hasTilingEffects(){return!!(this.layer.renderer&&"dynamicRangeAdjustment"in this.layer.renderer&&this.layer.renderer.dynamicRangeAdjustment)}get datumTransformation(){try{return this.layer.loaded?p(this.layer.fullExtent,this.view.spatialReference,!0):null}catch{return null}}supportsSpatialReference(e){try{return!this.layer.loaded||!!c(this.layer.serviceRasterInfo,e)}catch{return!1}}async fetchPopupFeaturesAtLocation(e,s){const{layer:i}=this;if(!e)throw new r("imageryTileLayerView:fetchPopupFeatures","Nothing to fetch without area",{layer:i});const{popupEnabled:l}=i,p=y(i,s);if(!l||null==p)return[];const c=[],{value:m,magdirValue:f,processedValue:d}=await i.identify(e,{timeExtent:this.timeExtent,signal:s?.signal});let h="";if(m?.length){h="imagery-tile"===i.type&&i.hasStandardTime()&&null!=m[0]?m.map((e=>i.getStandardTimeValue(e))).join(", "):m.join(", ");const e={ObjectId:0};e[o.servicePixelValue]="imagery-tile"===i.type&&u(i.raster)?d?.join(", "):h,e[o.rawServicePixelValue]=h;const r=i.raster?.rasterInfo??i.serviceRasterInfo,s=r?.attributeTable;if(null!=s){const{fields:t,features:r}=s,i=t.find((({name:e})=>"value"===e.toLowerCase())),a=e[o.servicePixelValue],l=i?r.find((e=>String(e.attributes[i.name])===a)):null;if(l)for(const s in l.attributes)if(l.attributes.hasOwnProperty(s)){e[n+s]=l.attributes[s]}}const l=r?.dataType;"vector-magdir"!==l&&"vector-uv"!==l||(e[o.magnitude]=f?.[0],e[o.direction]=f?.[1]);const{multidimensionalDefinition:p}=this.layer.normalizeRasterFetchOptions({timeExtent:this.timeExtent});a(i.rasterFields,e,p);const y=new t({geometry:this.fullExtent?.clone(),attributes:e,layer:i,sourceLayer:i});c.push(y)}return c}async getSourceScale(){return await this.layer.load(),m(this.layer.serviceRasterInfo,this.view.spatialReference)}_getFullExtent(){return c(this.layer.serviceRasterInfo,this.view.spatialReference)}};return e([s()],d.prototype,"fullExtent",null),e([s()],d.prototype,"layer",void 0),e([s({readOnly:!0})],d.prototype,"timeExtent",null),e([s()],d.prototype,"tileInfo",void 0),e([s({readOnly:!0})],d.prototype,"hasTilingEffects",null),e([s()],d.prototype,"datumTransformation",null),d=e([i("esri.views.layers.ImageryTileLayerView")],d),d};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.34/esri/copyright.txt for details.
4
4
  */
5
- import{_ as r}from"../../chunks/tslib.es6.js";import{property as e}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as o}from"../../core/accessorSupport/decorators/subclass.js";const t=t=>{let s=class extends t{constructor(){super(...arguments),this.layer=null}get availableFields(){return[]}highlight(){throw new Error("Not implemented")}queryFeatures(){throw new Error("Not implemented")}queryFeatureCount(){throw new Error("Not implemented")}createQuery(){throw new Error("Not implemented")}queryExtent(){throw new Error("Not implemented")}};return r([e()],s.prototype,"layer",void 0),r([e()],s.prototype,"availableFields",null),s=r([o("esri.views.layers.PointCloudLayerView")],s),s};export{t as default};
5
+ import{_ as r}from"../../chunks/tslib.es6.js";import{property as e}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as o}from"../../core/accessorSupport/decorators/subclass.js";const t=t=>{let s=class extends t{constructor(...r){super(...r),this.layer=null}get availableFields(){return[]}highlight(){throw new Error("Not implemented")}queryFeatures(){throw new Error("Not implemented")}queryFeatureCount(){throw new Error("Not implemented")}createQuery(){throw new Error("Not implemented")}queryExtent(){throw new Error("Not implemented")}};return r([e()],s.prototype,"layer",void 0),r([e()],s.prototype,"availableFields",null),s=r([o("esri.views.layers.PointCloudLayerView")],s),s};export{t 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.34/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../chunks/tslib.es6.js";import{isSome as t}from"../../core/arrayUtils.js";import r from"../../core/Logger.js";import{abortMaybe as o}from"../../core/maybe.js";import{unwrapUpdating as i,updating as n,isUpdating as l}from"../../core/maybeUpdating.js";import{throwIfAbortError as s,throwIfNotAbortError as a}from"../../core/promiseUtils.js";import{whenOnce as m}from"../../core/reactiveUtils.js";import{property as p}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import{subclass as c}from"../../core/accessorSupport/decorators/subclass.js";import{project as u,canProjectWithoutEngine as g,isLoaded as y,load as h}from"../../geometry/projection.js";import d from"./LayerView.js";let f=class extends d{constructor(){super(...arguments),this.layer=null,this.filter=null,this._geometryEngine=null,this._projectionEngineLoaded=!1,this._abortController=new AbortController}get availableFields(){return[]}get maximumNumberOfFeatures(){return 0}set maximumNumberOfFeatures(e){throw new Error("Not implemented")}get maximumNumberOfFeaturesExceeded(){return!1}get layerFilter(){return i(this._layerFilter)}get _layerFilter(){const e=this.layer?.filter;if(null==e||e.geometries.length<1)return null;const o=this._geometryEngine;if(null==o||!this._projectionEngineLoaded&&this._filterNeedsProjectionEngine)return n;const i=e.geometries.at(0).spatialReference,l=e.geometries.toArray().map((e=>{try{e=o.simplify(e)}catch(t){return r.getLogger(this).warnOncePerTick("Failed to simplify scene filter mask polygon. Polygon will be ignored."),null}if(null==e)return null;if(e.spatialReference.equals(i))return e;try{return u(e,i)}catch(t){return r.getLogger(this).warnOncePerTick("Failed to project scene filter mask polygon. Polygon will be ignored."),null}})).filter(t).sort(((e,t)=>e.extent.xmin-t.extent.xmin)),s=new Set,a=new Array,m=new Array;for(let t of l){const e=t.extent.xmin;if(a.length=0,s.forEach((r=>{if(e>=r.extent.xmax)return m.push(r),void s.delete(r);t.extent.ymin<=r.extent.ymax&&t.extent.ymax>=r.extent.ymin&&o.intersects(t,r)&&a.push(r)})),a.length>0){a.push(t);try{t=o.union(a)}catch(p){r.getLogger(this).warnOncePerTick("Failed to unify filter mask polygons. Polygon will be ignored.");continue}a.pop(),a.forEach((e=>s.delete(e)))}s.add(t)}return s.forEach((e=>m.push(e))),m.length>0?{spatialRelationship:e.spatialRelationship,geometries:m}:null}get _filterNeedsProjectionEngine(){const e=this.layer.filter;if(null==e||e.geometries.length<=1)return!1;const t=e.geometries.at(0).spatialReference;return e.geometries.some((({spatialReference:e})=>!e.equals(t)&&!g(e,t)))}get layerFilterUpdating(){return l(this._layerFilter)}initialize(){const{signal:e}=this._abortController;m((()=>this.destroyed||!this._geometryEngine&&this.layer?.filter?.geometries?.length),e).then((async()=>{s(e),this._geometryEngine=await import("../../geometry/geometryEngine.js")})).catch(a),this._projectionEngineLoaded=y(),m((()=>this.destroyed||!this._projectionEngineLoaded&&this._filterNeedsProjectionEngine),e).then((async()=>{s(e),await h(),this._projectionEngineLoaded=!0})).catch(a)}destroy(){this._abortController=o(this._abortController)}highlight(e){throw new Error("Not implemented")}queryFeatures(e,t){throw new Error("Not implemented")}queryObjectIds(e,t){throw new Error("Not implemented")}queryFeatureCount(e,t){throw new Error("Not implemented")}createQuery(){throw new Error("Not implemented")}queryExtent(e,t){throw new Error("Not implemented")}};e([p()],f.prototype,"layer",void 0),e([p()],f.prototype,"availableFields",null),e([p()],f.prototype,"maximumNumberOfFeatures",null),e([p({readOnly:!0})],f.prototype,"maximumNumberOfFeaturesExceeded",null),e([p()],f.prototype,"filter",void 0),e([p({readOnly:!0})],f.prototype,"layerFilter",null),e([p({readOnly:!0})],f.prototype,"_layerFilter",null),e([p()],f.prototype,"_geometryEngine",void 0),e([p()],f.prototype,"_projectionEngineLoaded",void 0),e([p()],f.prototype,"_filterNeedsProjectionEngine",null),e([p()],f.prototype,"layerFilterUpdating",null),f=e([c("esri.views.layers.SceneLayerView")],f);export{f as default};
5
+ import{_ as e}from"../../chunks/tslib.es6.js";import{isSome as t}from"../../core/arrayUtils.js";import r from"../../core/Logger.js";import{abortMaybe as o}from"../../core/maybe.js";import{unwrapUpdating as i,updating as n,isUpdating as l}from"../../core/maybeUpdating.js";import{throwIfAbortError as s,throwIfNotAbortError as a}from"../../core/promiseUtils.js";import{whenOnce as m}from"../../core/reactiveUtils.js";import{property as p}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import{subclass as c}from"../../core/accessorSupport/decorators/subclass.js";import{project as u,canProjectWithoutEngine as g,isLoaded as y,load as h}from"../../geometry/projectionUtils.js";import d from"./LayerView.js";let f=class extends d{constructor(){super(...arguments),this.layer=null,this.filter=null,this._geometryEngine=null,this._projectionEngineLoaded=!1,this._abortController=new AbortController}get availableFields(){return[]}get maximumNumberOfFeatures(){return 0}set maximumNumberOfFeatures(e){throw new Error("Not implemented")}get maximumNumberOfFeaturesExceeded(){return!1}get layerFilter(){return i(this._layerFilter)}get _layerFilter(){const e=this.layer?.filter;if(null==e||e.geometries.length<1)return null;const o=this._geometryEngine;if(null==o||!this._projectionEngineLoaded&&this._filterNeedsProjectionEngine)return n;const i=e.geometries.at(0).spatialReference,l=e.geometries.toArray().map((e=>{try{e=o.simplify(e)}catch(t){return r.getLogger(this).warnOncePerTick("Failed to simplify scene filter mask polygon. Polygon will be ignored."),null}if(null==e)return null;if(e.spatialReference.equals(i))return e;try{return u(e,i)}catch(t){return r.getLogger(this).warnOncePerTick("Failed to project scene filter mask polygon. Polygon will be ignored."),null}})).filter(t).sort(((e,t)=>e.extent.xmin-t.extent.xmin)),s=new Set,a=new Array,m=new Array;for(let t of l){const e=t.extent.xmin;if(a.length=0,s.forEach((r=>{if(e>=r.extent.xmax)return m.push(r),void s.delete(r);t.extent.ymin<=r.extent.ymax&&t.extent.ymax>=r.extent.ymin&&o.intersects(t,r)&&a.push(r)})),a.length>0){a.push(t);try{t=o.union(a)}catch(p){r.getLogger(this).warnOncePerTick("Failed to unify filter mask polygons. Polygon will be ignored.");continue}a.pop(),a.forEach((e=>s.delete(e)))}s.add(t)}return s.forEach((e=>m.push(e))),m.length>0?{spatialRelationship:e.spatialRelationship,geometries:m}:null}get _filterNeedsProjectionEngine(){const e=this.layer.filter;if(null==e||e.geometries.length<=1)return!1;const t=e.geometries.at(0).spatialReference;return e.geometries.some((({spatialReference:e})=>!e.equals(t)&&!g(e,t)))}get layerFilterUpdating(){return l(this._layerFilter)}initialize(){const{signal:e}=this._abortController;m((()=>this.destroyed||!this._geometryEngine&&this.layer?.filter?.geometries?.length),e).then((async()=>{s(e),this._geometryEngine=await import("../../geometry/geometryEngine.js")})).catch(a),this._projectionEngineLoaded=y(),m((()=>this.destroyed||!this._projectionEngineLoaded&&this._filterNeedsProjectionEngine),e).then((async()=>{s(e),await h(),this._projectionEngineLoaded=!0})).catch(a)}destroy(){this._abortController=o(this._abortController)}highlight(e){throw new Error("Not implemented")}queryFeatures(e,t){throw new Error("Not implemented")}queryObjectIds(e,t){throw new Error("Not implemented")}queryFeatureCount(e,t){throw new Error("Not implemented")}createQuery(){throw new Error("Not implemented")}queryExtent(e,t){throw new Error("Not implemented")}};e([p()],f.prototype,"layer",void 0),e([p()],f.prototype,"availableFields",null),e([p()],f.prototype,"maximumNumberOfFeatures",null),e([p({readOnly:!0})],f.prototype,"maximumNumberOfFeaturesExceeded",null),e([p()],f.prototype,"filter",void 0),e([p({readOnly:!0})],f.prototype,"layerFilter",null),e([p({readOnly:!0})],f.prototype,"_layerFilter",null),e([p()],f.prototype,"_geometryEngine",void 0),e([p()],f.prototype,"_projectionEngineLoaded",void 0),e([p()],f.prototype,"_filterNeedsProjectionEngine",null),e([p()],f.prototype,"layerFilterUpdating",null),f=e([c("esri.views.layers.SceneLayerView")],f);export{f as default};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
+ */
5
+ import{signal as s}from"../../core/signal.js";class e{constructor(){this._pendingCompressionTasks=s(0)}get compressing(){return!!this._pendingCompressionTasks.value}increment(){this._pendingCompressionTasks.value++}decrement(){this._pendingCompressionTasks.value--}}export{e as TextureCompressionTracker};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import t from"../../request.js";import e from"../../geometry/Point.js";import{execute as r}from"../../geometry/operators/projectOperator.js";import{projectResolution as i,getProjectionOffsetGrid as a}from"../../layers/support/rasterFunctions/rasterProjectionHelper.js";import{isImageSource as s,rasterize as n}from"../2d/engine/Bitmap.js";import o from"../2d/engine/webgl/VertexStream.js";import{createProgramTemplate as m}from"../2d/engine/webgl/shaders/MaterialPrograms.js";import{TextureWrapMode as c,PixelFormat as p,PixelType as h}from"../webgl/enums.js";import{FramebufferObject as x}from"../webgl/FramebufferObject.js";import{createTransformTexture as u}from"../webgl/rasterUtils.js";import{RenderingContext as d}from"../webgl/RenderingContext.js";import{Texture as g}from"../webgl/Texture.js";import{TextureDescriptor as _}from"../webgl/TextureDescriptor.js";class f{static{this._instanceRefCount=0}constructor(t){if(this._ownsRctx=!1,t)this._ownsRctx=!1,this._rctx=t;else{if(f._instance)return f._instanceRefCount++,f._instance;f._instanceRefCount=1,f._instance=this,this._ownsRctx=!0;const t=document.createElement("canvas").getContext("webgl2");t.getExtension("OES_texture_float"),this._rctx=new d(t,{})}const e={applyProjection:!0,bilinear:!1,bicubic:!1},r=m("raster/reproject","raster/reproject",new Map([["a_position",0]]),e);this._program=this._rctx.programCache.acquire(r.shaders.vertexShader,r.shaders.fragmentShader,r.attributes),this._rctx.useProgram(this._program),this._program.setUniform1f("u_opacity",1),this._program.setUniform1i("u_image",0),this._program.setUniform1i("u_flipY",0),this._program.setUniform1i("u_transformGrid",1),this._quad=new o(this._rctx,[0,0,1,0,0,1,1,1])}reprojectTexture(t,s,n=!1){const o=r(t.extent,s),m=new e({x:(t.extent.xmax-t.extent.xmin)/t.texture.descriptor.width,y:(t.extent.ymax-t.extent.ymin)/t.texture.descriptor.height,spatialReference:t.extent.spatialReference}),{x:d,y:g}=i(m,s,t.extent);let f=(d+g)/2;const l=Math.round((o.xmax-o.xmin)/f),w=Math.round((o.ymax-o.ymin)/f);f=(o.width/l+o.height/w)/2;const b=new e({x:f,y:f,spatialReference:o.spatialReference}),j=a({projectedExtent:o,srcBufferExtent:t.extent,pixelSize:b,hasWrapAround:!0,spacing:[16,16]}),D=u(this._rctx,j),R=new _(l,w);R.wrapMode=c.CLAMP_TO_EDGE;const y=new x(this._rctx,R);this._rctx.bindFramebuffer(y),this._rctx.setViewport(0,0,l,w),this._rctx.useProgram(this._program),this._rctx.bindTexture(t.texture,0),this._rctx.bindTexture(D,1),this._quad.bind();const{width:C=0,height:E=0}=t.texture.descriptor;if(this._program.setUniform2f("u_srcImageSize",C,E),this._program.setUniform2fv("u_transformSpacing",j.spacing),this._program.setUniform2fv("u_transformGridSize",j.size),this._program.setUniform2f("u_targetImageSize",l,w),this._quad.draw(),this._quad.unbind(),this._rctx.useProgram(null),this._rctx.bindFramebuffer(null),D.dispose(),n){const{width:t,height:e}=y,r=new ImageData(t??0,e??0);y.readPixels(0,0,t??0,e??0,p.RGBA,h.UNSIGNED_BYTE,r.data);const i=y.detachColorTexture();return y.dispose(),{texture:i,extent:o,imageData:r}}const T=y.detachColorTexture();return y.dispose(),{texture:T,extent:o}}reprojectBitmapData(t,e){const r=s(t.bitmapData)?n(t.bitmapData):t.bitmapData,i=new _;i.wrapMode=c.CLAMP_TO_EDGE,i.width=t.bitmapData.width,i.height=t.bitmapData.height;const a=new g(this._rctx,i,r),o=this.reprojectTexture({texture:a,extent:t.extent},e,!0);o.texture.dispose();const m=document.createElement("canvas"),p=o.imageData;m.width=p.width,m.height=p.height;return m.getContext("2d").putImageData(p,0,0),{bitmapData:m,extent:o.extent}}async loadAndReprojectBitmapData(e,r,i){const a=(await t(e,{responseType:"image"})).data,s=document.createElement("canvas");s.width=a.width,s.height=a.height;const n=s.getContext("2d");n.drawImage(a,0,0);const o=n.getImageData(0,0,s.width,s.height);if(r.spatialReference.equals(i))return{bitmapData:o,extent:r};const m=this.reprojectBitmapData({bitmapData:o,extent:r},i);return{bitmapData:m.bitmapData,extent:m.extent}}destroy(){this._ownsRctx?(f._instanceRefCount--,0===f._instanceRefCount&&(this._quad.dispose(),this._program.dispose(),this._rctx.dispose(),f._instance=null)):(this._quad.dispose(),this._program.dispose())}}export{f as ImageReprojector};
5
+ import t from"../../request.js";import e from"../../geometry/Point.js";import{execute as r}from"../../geometry/operators/projectOperator.js";import{projectResolution as i,getProjectionOffsetGrid as a}from"../../layers/support/rasterFunctions/rasterProjectionHelper.js";import{isImageSource as s,rasterize as n}from"../2d/engine/Bitmap.js";import o from"../2d/engine/webgl/VertexStream.js";import{createProgramTemplate as m}from"../2d/engine/webgl/shaders/MaterialPrograms.js";import{TextureWrapMode as c,PixelFormat as p,PixelType as h}from"../webgl/enums.js";import{FramebufferObject as x}from"../webgl/FramebufferObject.js";import{createTransformTexture as u}from"../webgl/rasterUtils.js";import{RenderingContext as d}from"../webgl/RenderingContext.js";import{Texture as g}from"../webgl/Texture.js";import{TextureDescriptor as _}from"../webgl/TextureDescriptor.js";class f{static{this._instanceRefCount=0}constructor(t){if(this._ownsRctx=!1,t)this._ownsRctx=!1,this._rctx=t;else{if(f._instance)return f._instanceRefCount++,f._instance;f._instanceRefCount=1,f._instance=this,this._ownsRctx=!0;const t=document.createElement("canvas").getContext("webgl2");t.getExtension("OES_texture_float"),this._rctx=new d(t,{})}const e={applyProjection:!0,bilinear:!1,bicubic:!1},r=m("raster/reproject","raster/reproject",new Map([["a_position",0]]),e);this._program=this._rctx.programCache.acquire(r.shaders.vertexShader,r.shaders.fragmentShader,r.attributes),this._rctx.useProgram(this._program),this._program.setUniform1f("u_opacity",1),this._program.setUniform1i("u_image",0),this._program.setUniform1i("u_flipY",0),this._program.setUniform1i("u_transformGrid",1),this._quad=new o(this._rctx,[0,0,1,0,0,1,1,1])}reprojectTexture(t,s,n=!1){const o=r(t.extent,s),m=new e({x:(t.extent.xmax-t.extent.xmin)/t.texture.descriptor.width,y:(t.extent.ymax-t.extent.ymin)/t.texture.descriptor.height,spatialReference:t.extent.spatialReference}),{x:d,y:g}=i(m,s,t.extent);let f=(d+g)/2;const l=Math.round((o.xmax-o.xmin)/f),w=Math.round((o.ymax-o.ymin)/f);f=(o.width/l+o.height/w)/2;const b=new e({x:f,y:f,spatialReference:o.spatialReference}),j=a({projectedExtent:o,srcBufferExtent:t.extent,pixelSize:b,hasWrapAround:!0,spacing:[16,16]}),D=u(this._rctx,j),R=new _(l,w);R.wrapMode=c.CLAMP_TO_EDGE;const y=new x(this._rctx,R);this._rctx.bindFramebuffer(y),this._rctx.setViewport(0,0,l,w),this._rctx.useProgram(this._program),this._rctx.bindTexture(t.texture,0),this._rctx.bindTexture(D,1),this._quad.bind();const{width:C=0,height:E=0}=t.texture.descriptor;if(this._program.setUniform2f("u_srcImageSize",C,E),this._program.setUniform2fv("u_transformSpacing",j.spacing),this._program.setUniform2fv("u_transformGridSize",j.size),this._program.setUniform2f("u_targetImageSize",l,w),this._quad.draw(),this._quad.unbind(),this._rctx.useProgram(null),this._rctx.bindFramebuffer(null),D.dispose(),n){const{width:t,height:e}=y,r=new ImageData(t??0,e??0);y.readPixels(0,0,t??0,e??0,p.RGBA,h.UNSIGNED_BYTE,r.data);const i=y.detachColorTexture();return y.dispose(),{texture:i,extent:o,imageData:r}}const T=y.detachColorTexture();return y.dispose(),{texture:T,extent:o}}reprojectBitmapData(t,e){const r=s(t.bitmapData)?n(t.bitmapData):t.bitmapData,i=new _(t.bitmapData.width,t.bitmapData.height);i.wrapMode=c.CLAMP_TO_EDGE;const a=new g(this._rctx,i,r),o=this.reprojectTexture({texture:a,extent:t.extent},e,!0);o.texture.dispose();const m=document.createElement("canvas"),p=o.imageData;m.width=p.width,m.height=p.height;return m.getContext("2d").putImageData(p,0,0),{bitmapData:m,extent:o.extent}}async loadAndReprojectBitmapData(e,r,i){const a=(await t(e,{responseType:"image"})).data,s=document.createElement("canvas");s.width=a.width,s.height=a.height;const n=s.getContext("2d");n.drawImage(a,0,0);const o=n.getImageData(0,0,s.width,s.height);if(r.spatialReference.equals(i))return{bitmapData:o,extent:r};const m=this.reprojectBitmapData({bitmapData:o,extent:r},i);return{bitmapData:m.bitmapData,extent:m.extent}}destroy(){this._ownsRctx?(f._instanceRefCount--,0===f._instanceRefCount&&(this._quad.dispose(),this._program.dispose(),this._rctx.dispose(),f._instance=null)):(this._quad.dispose(),this._program.dispose())}}export{f as ImageReprojector};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{throwIfAborted as t}from"../../core/promiseUtils.js";import{isLoaded as e,canProjectWithoutEngine as r,project as n,load as o,projectWithZConversion as i}from"../../geometry/projection.js";let a,c=null;async function l(e){c||(c=import("../../portal/support/geometryServiceUtils.js").then((t=>a=t))),await c,t(e)}async function s(t,i,c,p){if(!t)return null;const u=t.spatialReference;return e()||r(u,i)?n(t,i):a?a.projectGeometry(t,i,c,p):(await Promise.race([l(p),o(p)]),s(t,i,c,p))}async function p(t,e){try{return t?.spatialReference?await i(t,e):null}catch{return null}}export{s as projectWithEngineOrService,p as projectWithZConversionSilent};
5
+ import{throwIfAborted as t}from"../../core/promiseUtils.js";import{isLoaded as e,canProjectWithoutEngine as r,project as n,load as o,projectWithZConversion as i}from"../../geometry/projectionUtils.js";let a,c=null;async function l(e){c||(c=import("../../portal/support/geometryServiceUtils.js").then((t=>a=t))),await c,t(e)}async function s(t,i,c,p){if(!t)return null;const u=t.spatialReference;return e()||r(u,i)?n(t,i):a?a.projectGeometry(t,i,c,p):(await Promise.race([l(p),o(p)]),s(t,i,c,p))}async function p(t,e){try{return t?.spatialReference?await i(t,e):null}catch{return null}}export{s as projectWithEngineOrService,p as projectWithZConversionSilent};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import has from"../../core/has.js";import{disposeMaybe as t}from"../../core/maybe.js";import{after as e}from"../../core/promiseUtils.js";import{Milliseconds as s}from"../../core/time.js";import{webglDebugEnabled as i,checkWebGLError as a}from"./checkWebGLError.js";import{ContextState as r}from"./ContextState.js";import{SpecialDrawBuffers as n,ColorAttachment0 as l,BufferType as h,Face as f,baseTextureUnit as o,FramebufferBit as u,BufferContent as c,FramebufferTarget as _,TextureSamplingMode as d,SyncCondition as b,ResourceType as F,ClientWaitSyncStatus as g,BlendFactor as B,BlendOperation as p,CullMode as m,CompareFunction as E,StencilOperation as R,TextureType as T,PrimitiveType as A}from"./enums.js";import{InstanceCounter as O}from"./InstanceCounter.js";import{Parameters as C}from"./Parameters.js";import{ProgramCache as x}from"./ProgramCache.js";import{StateTracker as U}from"./renderState.js";import{Texture as k}from"./Texture.js";import{getErrorString as w}from"./Util.js";import{WebGLDriverTest as S}from"./WebGLDriverTest.js";import{Capabilities as y}from"./capabilities/Capabilities.js";let v=class{constructor(t,e){this.gl=t,this.instanceCounter=new O,this.programCache=new x(this),this._transformFeedbackRequestInfo=null,this._state=new r,this._numOfDrawCalls=0,this._numOfTriangles=0,this.configure(e)}configure(e){this._capabilities=new y(this.gl,e),this._parameters=new C(this.gl,this._capabilities,e),k.TEXTURE_UNIT_FOR_UPDATES=this._parameters.maxTextureImageUnits-1;const s=this.gl.getParameter(this.gl.VIEWPORT);this._state=new r,this._state.viewport={x:s[0],y:s[1],width:s[2],height:s[3]},this._stateTracker=new U({setBlending:t=>{if(t){this.setBlendingEnabled(!0),this.setBlendEquationSeparate(t.opRgb,t.opAlpha),this.setBlendFunctionSeparate(t.srcRgb,t.dstRgb,t.srcAlpha,t.dstAlpha);const e=t.color;this.setBlendColor(e.r,e.g,e.b,e.a)}else this.setBlendingEnabled(!1)},setCulling:t=>{t?(this.setFaceCullingEnabled(!0),this.setCullFace(t.face),this.setFrontFace(t.mode)):this.setFaceCullingEnabled(!1)},setPolygonOffset:t=>{t?(this.setPolygonOffsetFillEnabled(!0),this.setPolygonOffset(t.factor,t.units)):this.setPolygonOffsetFillEnabled(!1)},setDepthTest:t=>{t?(this.setDepthTestEnabled(!0),this.setDepthFunction(t.func)):this.setDepthTestEnabled(!1)},setStencilTest:t=>{if(t){this.setStencilTestEnabled(!0);const e=t.function;this.setStencilFunction(e.func,e.ref,e.mask);const s=t.operation;this.setStencilOp(s.fail,s.zFail,s.zPass)}else this.setStencilTestEnabled(!1)},setDepthWrite:t=>{t?(this.setDepthWriteEnabled(!0),this.setDepthRange(t.zNear,t.zFar)):this.setDepthWriteEnabled(!1)},setColorWrite:t=>{t?this.setColorMask(t.r,t.g,t.b,t.a):this.setColorMask(!1,!1,!1,!1)},setStencilWrite:t=>{t?this.setStencilWriteMask(t.mask):this.setStencilWriteMask(0)},setDrawBuffers:t=>{if(t)this.setDrawBuffers(t.buffers);else{const{drawFramebuffer:t}=this._state;null===t?this.setDrawBuffers([n.BACK]):0===t.colorAttachments.length?this.setDrawBuffers([n.NONE]):this.setDrawBuffers([l])}}}),this.enforceState(),t(this._driverTest),this._driverTest=new S(this)}updateOptions(t){this._parameters=new C(this.gl,this._capabilities,t)}dispose(){t(this._driverTest),this.programCache.dispose(),this.bindVAO(null),this.unbindBuffer(h.ARRAY_BUFFER),this.unbindBuffer(h.ELEMENT_ARRAY_BUFFER),this.unbindBuffer(h.UNIFORM_BUFFER),this._state.uniformBufferBindingPoints.length=0,this.unbindBuffer(h.PIXEL_PACK_BUFFER),this.unbindBuffer(h.PIXEL_UNPACK_BUFFER),this.unbindBuffer(h.COPY_READ_BUFFER),this.unbindBuffer(h.COPY_WRITE_BUFFER),this._state.textureUnitMap.length=0,i()&&console.log(this.instanceCounter.resourceInformation)}get driverTest(){return this._driverTest}get contextAttributes(){return this.gl.getContextAttributes()}get parameters(){return this._parameters}setPipelineState(t){this._stateTracker.setPipeline(t)}setBlendingEnabled(t){this._state.blend!==t&&(!0===t?this.gl.enable(this.gl.BLEND):this.gl.disable(this.gl.BLEND),this._state.blend=t,this._stateTracker.invalidateBlending())}externalProgramUpdate(){this._state.program?.stop(),this._state.program=null}externalTextureUnitUpdate(t,e){for(let s=0;s<t.length;++s)this._state.textureUnitMap[t[s]]=null;e>=0&&(this._state.activeTexture=e)}externalVertexArrayObjectUpdate(){this.gl.bindVertexArray(null),this._state.vertexArrayObject=null,this._state.vertexBuffer=null,this._state.indexBuffer=null}externalVertexBufferUpdate(){this._state.vertexBuffer=null}externalIndexBufferUpdate(){this._state.indexBuffer=null}setBlendColor(t,e,s,i){t===this._state.blendColor.r&&e===this._state.blendColor.g&&s===this._state.blendColor.b&&i===this._state.blendColor.a||(this.gl.blendColor(t,e,s,i),this._state.blendColor.r=t,this._state.blendColor.g=e,this._state.blendColor.b=s,this._state.blendColor.a=i,this._stateTracker.invalidateBlending())}setBlendFunction(t,e){t===this._state.blendFunction.srcRGB&&e===this._state.blendFunction.dstRGB||(this.gl.blendFunc(t,e),this._state.blendFunction.srcRGB=t,this._state.blendFunction.srcAlpha=t,this._state.blendFunction.dstRGB=e,this._state.blendFunction.dstAlpha=e,this._stateTracker.invalidateBlending())}setBlendFunctionSeparate(t,e,s,i){this._state.blendFunction.srcRGB===t&&this._state.blendFunction.srcAlpha===s&&this._state.blendFunction.dstRGB===e&&this._state.blendFunction.dstAlpha===i||(this.gl.blendFuncSeparate(t,e,s,i),this._state.blendFunction.srcRGB=t,this._state.blendFunction.srcAlpha=s,this._state.blendFunction.dstRGB=e,this._state.blendFunction.dstAlpha=i,this._stateTracker.invalidateBlending())}setBlendEquation(t){this._state.blendEquation.mode!==t&&(this.gl.blendEquation(t),this._state.blendEquation.mode=t,this._state.blendEquation.modeAlpha=t,this._stateTracker.invalidateBlending())}setBlendEquationSeparate(t,e){this._state.blendEquation.mode===t&&this._state.blendEquation.modeAlpha===e||(this.gl.blendEquationSeparate(t,e),this._state.blendEquation.mode=t,this._state.blendEquation.modeAlpha=e,this._stateTracker.invalidateBlending())}setColorMask(t,e,s,i){this._state.colorMask.r===t&&this._state.colorMask.g===e&&this._state.colorMask.b===s&&this._state.colorMask.a===i||(this.gl.colorMask(t,e,s,i),this._state.colorMask.r=t,this._state.colorMask.g=e,this._state.colorMask.b=s,this._state.colorMask.a=i,this._stateTracker.invalidateColorWrite())}setClearColor(t,e,s,i){this._state.clearColor.r===t&&this._state.clearColor.g===e&&this._state.clearColor.b===s&&this._state.clearColor.a===i||(this.gl.clearColor(t,e,s,i),this._state.clearColor.r=t,this._state.clearColor.g=e,this._state.clearColor.b=s,this._state.clearColor.a=i)}setFaceCullingEnabled(t){this._state.faceCulling!==t&&(!0===t?this.gl.enable(this.gl.CULL_FACE):this.gl.disable(this.gl.CULL_FACE),this._state.faceCulling=t,this._stateTracker.invalidateCulling())}setPolygonOffsetFillEnabled(t){this._state.polygonOffsetFill!==t&&(!0===t?this.gl.enable(this.gl.POLYGON_OFFSET_FILL):this.gl.disable(this.gl.POLYGON_OFFSET_FILL),this._state.polygonOffsetFill=t,this._stateTracker.invalidatePolygonOffset())}setPolygonOffset(t,e){this._state.polygonOffset[0]===t&&this._state.polygonOffset[1]===e||(this._state.polygonOffset[0]=t,this._state.polygonOffset[1]=e,this.gl.polygonOffset(t,e),this._stateTracker.invalidatePolygonOffset())}setCullFace(t){this._state.cullFace!==t&&(this.gl.cullFace(t),this._state.cullFace=t,this._stateTracker.invalidateCulling())}setFrontFace(t){this._state.frontFace!==t&&(this.gl.frontFace(t),this._state.frontFace=t,this._stateTracker.invalidateCulling())}setScissorTestEnabled(t){this._state.scissorTest!==t&&(!0===t?this.gl.enable(this.gl.SCISSOR_TEST):this.gl.disable(this.gl.SCISSOR_TEST),this._state.scissorTest=t)}setScissorRect(t,e,s,i){this._state.scissorRect.x===t&&this._state.scissorRect.y===e&&this._state.scissorRect.width===s&&this._state.scissorRect.height===i||(this.gl.scissor(t,e,s,i),this._state.scissorRect.x=t,this._state.scissorRect.y=e,this._state.scissorRect.width=s,this._state.scissorRect.height=i)}setDepthTestEnabled(t){this._state.depthTest!==t&&(!0===t?this.gl.enable(this.gl.DEPTH_TEST):this.gl.disable(this.gl.DEPTH_TEST),this._state.depthTest=t,this._stateTracker.invalidateDepthTest())}setClearDepth(t){this._state.clearDepth!==t&&(this.gl.clearDepth(t),this._state.clearDepth=t)}setDepthFunction(t){this._state.depthFunction!==t&&(this.gl.depthFunc(t),this._state.depthFunction=t,this._stateTracker.invalidateDepthTest())}setDepthWriteEnabled(t){this._state.depthWrite!==t&&(this.gl.depthMask(t),this._state.depthWrite=t,this._stateTracker.invalidateDepthWrite())}setDepthRange(t,e){this._state.depthRange.zNear===t&&this._state.depthRange.zFar===e||(this.gl.depthRange(t,e),this._state.depthRange.zNear=t,this._state.depthRange.zFar=e,this._stateTracker.invalidateDepthWrite())}setStencilTestEnabled(t){this._state.stencilTest!==t&&(!0===t?this.gl.enable(this.gl.STENCIL_TEST):this.gl.disable(this.gl.STENCIL_TEST),this._state.stencilTest=t,this._stateTracker.invalidateStencilTest())}setClearStencil(t){t!==this._state.clearStencil&&(this.gl.clearStencil(t),this._state.clearStencil=t)}setStencilFunction(t,e,s){this._state.stencilFunction.func===t&&this._state.stencilFunction.ref===e&&this._state.stencilFunction.mask===s||(this.gl.stencilFunc(t,e,s),this._state.stencilFunction.face=f.FRONT_AND_BACK,this._state.stencilFunction.func=t,this._state.stencilFunction.ref=e,this._state.stencilFunction.mask=s,this._stateTracker.invalidateStencilTest())}setStencilFunctionSeparate(t,e,s,i){this._state.stencilFunction.face===t&&this._state.stencilFunction.func===e&&this._state.stencilFunction.ref===s&&this._state.stencilFunction.mask===i||(this.gl.stencilFuncSeparate(t,e,s,i),this._state.stencilFunction.face=t,this._state.stencilFunction.func=e,this._state.stencilFunction.ref=s,this._state.stencilFunction.mask=i,this._stateTracker.invalidateStencilTest())}setStencilWriteMask(t){this._state.stencilWriteMask!==t&&(this.gl.stencilMask(t),this._state.stencilWriteMask=t,this._stateTracker.invalidateStencilWrite())}setStencilOp(t,e,s){this._state.stencilOperation.face===f.FRONT_AND_BACK&&this._state.stencilOperation.fail===t&&this._state.stencilOperation.zFail===e&&this._state.stencilOperation.zPass===s||(this.gl.stencilOp(t,e,s),this._state.stencilOperation.face=f.FRONT_AND_BACK,this._state.stencilOperation.fail=t,this._state.stencilOperation.zFail=e,this._state.stencilOperation.zPass=s,this._stateTracker.invalidateStencilTest())}setStencilOpSeparate(t,e,s,i){this._state.stencilOperation.face===t&&this._state.stencilOperation.fail===e&&this._state.stencilOperation.zFail===s&&this._state.stencilOperation.zPass===i||(this.gl.stencilOpSeparate(t,e,s,i),this._state.stencilOperation.face=t,this._state.stencilOperation.fail=e,this._state.stencilOperation.zFail=s,this._state.stencilOperation.zPass=i,this._stateTracker.invalidateStencilTest())}setActiveTexture(t,e=!1){const s=this._state.activeTexture;return t>=0&&(e||t!==this._state.activeTexture)&&(this.gl.activeTexture(o+t),this._state.activeTexture=t),s}setDrawBuffers(t){const{drawFramebuffer:e}=this._state,s=null===e,i=s?this._state.drawBuffers.defaultFramebuffer:this._state.drawBuffers.fbos.get(e);if(i?.length!==t.length||!i.every(((e,s)=>e===t[s])))if(t.length>this.parameters.maxDrawBuffers)console.error("Setting more active draw buffers than GL.MAX_DRAW_BUFFERS allows.");else{if(s){if(t.length>1)return void console.error("The default framebuffer can only have one active draw buffer.");if(t[0]!==n.BACK&&t[0]!==n.NONE)return void console.error("The default framebuffer can only use the constants GL.BACK or GL.NONE as draw buffers.")}s||!t.includes(n.BACK)?(this.gl.drawBuffers(t),s?this._state.drawBuffers.defaultFramebuffer=t:this._state.drawBuffers.fbos.set(e,t),this._stateTracker.invalidateDrawBuffers()):console.error("A framebuffer object can only use the constants GL.COLOR_ATTACHMENTi or GL.NONE as draw buffers.")}}clear(t,e=255){if(t){if(t&u.COLOR){const t=this._state.drawFramebuffer?.colorAttachments;t&&this.setDrawBuffers(t),this.setColorMask(!0,!0,!0,!0)}t&u.DEPTH&&this.setDepthWriteEnabled(!0),t&u.STENCIL&&this.setStencilWriteMask(e),this.gl.clear(t)}}clearFramebuffer(t,e=!1,s=!1){let i=0;if(t){const e=1e-13,s=Math.max(e,t[3]);this.setClearColor(t[0],t[1],t[2],s),i|=u.COLOR}e&&(i|=u.DEPTH),!1===s?s=0:(!0===s&&(s=255),i|=u.STENCIL),i&&this.clear(i,s)}clearBuffer(t,e,s=c.COLOR,i=void 0){this.gl.clearBufferfv(s,t,e,i)}clearBufferInteger(t,e,s=c.COLOR,i=void 0){this.gl.clearBufferiv(s,t,e,i)}clearBufferUnsignedInteger(t,e,s=c.COLOR,i=void 0){this.gl.clearBufferuiv(s,t,e,i)}drawArrays(t,e,s){if(this._transformFeedbackRequestInfo){if(t!==this._transformFeedbackRequestInfo.primitiveType)throw new Error("DrawArrays called during transform feedback, but primitiveType does not match that of the current transform feedback request");if(null==this._state.program?.hasTransformFeedbackVaryings)throw new Error("DrawArrays called during transform feedback, but the shader program was not linked with a transform feedback varying")}if(i()&&(this._numOfDrawCalls++,this._numOfTriangles+=D(t,s),has("enable-feature:webgl-debug:textureReadWrite"))){const t=this._state.textureUnitMap;for(let e=0;e<t.length;e++){const s=t[e];if(null!=s&&s===this._state.drawFramebuffer?.colorTexture)throw new Error(`Detected readWrite. Texture already bound at index ${e}`)}}this.gl.drawArrays(t,e,s),a(this.gl)}drawArraysInstanced(t,e,s,i){this.gl.drawArraysInstanced(t,e,s,i),a(this.gl)}drawElements(t,e,s,a){if(this._transformFeedbackRequestInfo)throw new Error("Cannot called drawElements during a transform feedback request");if(i()&&(this._numOfDrawCalls++,this._numOfTriangles+=D(t,e)),this.gl.drawElements(t,e,s,a),i()){const i=w(this);if(i){const r=this.getBoundVAO(),n=r?.indexBuffer,l=r?.vertexBuffers,h={indexBuffer:n,vertexBuffers:l},f={mode:t,count:e,type:s,offset:a},o=n?.size??0,u=a+e,c=o<u?`. Buffer is too small. Attempted to draw index ${u} of ${o}`:"";console.error(`drawElements: ${i}${c}`,{args:f,vao:h})}}}drawElementsInstanced(t,e,s,i,r){this.gl.drawElementsInstanced(t,e,s,i,r),a(this.gl)}logInfo(){i()&&console.log(`DrawCalls: ${this._numOfDrawCalls}, Triangles: ${this._numOfTriangles}`)}resetInfo(){i()&&(this._numOfDrawCalls=0,this._numOfTriangles=0)}get capabilities(){return this._capabilities}setViewport(t,e,s,i){s=Math.max(Math.round(s),1),i=Math.max(Math.round(i),1);const a=this._state.viewport;a.x===t&&a.y===e&&a.width===s&&a.height===i||(a.x=t,a.y=e,a.width=s,a.height=i,this.gl.viewport(t,e,s,i))}setViewport4fv(t){this.setViewport(t[0],t[1],t[2],t[3])}restoreViewport({x:t,y:e,width:s,height:i}){this.setViewport(t,e,s,i)}getViewport(){const t=this._state.viewport;return{x:t.x,y:t.y,width:t.width,height:t.height}}useProgram(t){this._state.program!==t&&(this._state.program?.stop(),this._state.program=t,this.gl.useProgram(t?.glName??null))}bindTexture(t,e,s=!1){(e>=this.parameters.maxTextureImageUnits||e<0)&&console.error("Input texture unit is out of range of available units!");const i=this._state.textureUnitMap[e];return null==t?.glName?(null!=i&&(this.setActiveTexture(e,s),this.gl.bindTexture(i.descriptor.target,null)),this._state.textureUnitMap[e]=null,i):s||i!==t?(this.setActiveTexture(e,s),this.gl.bindTexture(t.descriptor.target,t.glName),t.applyChanges(),this._state.textureUnitMap[e]=t,i):(t.isDirty&&(this.setActiveTexture(e,s),t.applyChanges()),i)}unbindTexture(t){if(null!=t)for(let e=0;e<this.parameters.maxTextureImageUnits;e++)this._state.textureUnitMap[e]===t&&(this.bindTexture(null,e),this._state.textureUnitMap[e]=null)}bindFramebuffer(t,e=!1){if(e||this._state.readFramebuffer!==t||this._state.drawFramebuffer!==t){if(this._stateTracker.invalidateDrawBuffers(),null==t)return this.gl.bindFramebuffer(_.FRAMEBUFFER,null),void(this._state.readFramebuffer=this._state.drawFramebuffer=null);t.initializeAndBind(_.FRAMEBUFFER),this._state.readFramebuffer=t,this._state.drawFramebuffer=t}}bindFramebufferSeparate(t,e,s=!1){const i=e===_.READ_FRAMEBUFFER,a=i?this._state.readFramebuffer:this._state.drawFramebuffer;(s||a!==t)&&(null==t?this.gl.bindFramebuffer(e,null):t.initializeAndBind(e),i?this._state.readFramebuffer=t??null:(this._stateTracker.invalidateDrawBuffers(),this._state.drawFramebuffer=t??null))}blitFramebuffer(t,e,s=u.COLOR,i=d.NEAREST,a=0,r=0,n=t.width,l=t.height,h=0,f=0,o=e.width,c=e.height){this.bindFramebufferSeparate(t,_.READ_FRAMEBUFFER,!0),this.bindFramebufferSeparate(e,_.DRAW_FRAMEBUFFER,!0),this.gl.blitFramebuffer(a,r,n,l,h,f,o,c,s,i)}bindBuffer(t,e){if(t)switch(e??=t.bufferType,e){case h.ARRAY_BUFFER:this._state.vertexBuffer=N(this.gl,t,e,this._state.vertexBuffer);break;case h.ELEMENT_ARRAY_BUFFER:this._state.indexBuffer=N(this.gl,t,e,this._state.indexBuffer);break;case h.UNIFORM_BUFFER:this._state.uniformBuffer=N(this.gl,t,e,this._state.uniformBuffer);break;case h.PIXEL_PACK_BUFFER:this._state.pixelPackBuffer=N(this.gl,t,e,this._state.pixelPackBuffer);break;case h.PIXEL_UNPACK_BUFFER:this._state.pixelUnpackBuffer=N(this.gl,t,e,this._state.pixelUnpackBuffer);break;case h.COPY_READ_BUFFER:this._state.copyReadBuffer=N(this.gl,t,e,this._state.copyReadBuffer);break;case h.COPY_WRITE_BUFFER:this._state.copyWriteBuffer=N(this.gl,t,e,this._state.copyWriteBuffer);break;case h.TRANSFORM_FEEDBACK_BUFFER:this._state.transformFeedbackBuffer=N(this.gl,t,e,this._state.transformFeedbackBuffer)}}bindRenderbuffer(t){const e=this.gl;t||(e.bindRenderbuffer(e.RENDERBUFFER,null),this._state.renderbuffer=null),this._state.renderbuffer!==t&&(e.bindRenderbuffer(e.RENDERBUFFER,t.glName),this._state.renderbuffer=t)}_getBufferBinding(t,e){if(e>=this.parameters.maxUniformBufferBindings||e<0)return console.error("Uniform buffer binding point is out of range!"),null;const s=t===h.UNIFORM_BUFFER?this._state.uniformBufferBindingPoints:this._state.transformBufferBindingPoints;let i=s[e];return null==i&&(i={buffer:null,offset:0,size:0},s[e]=i),i}bindBufferBase(t,e,s){const i=this._getBufferBinding(t,e);null!=i&&(i.buffer===s&&0===i.offset&&0===i.size||(this.gl.bindBufferBase(t,e,s?s.glName:null),i.buffer=s,i.offset=0,i.size=0))}bindBufferRange(t,e,s,i,a){const r=this._getBufferBinding(t,e);null!=r&&(r.buffer===s&&r.offset===i&&r.size===a||(i%this._parameters.uniformBufferOffsetAlignment===0?(this.gl.bindBufferRange(t,e,s.glName,i,a),r.buffer=s,r.offset=i,r.size=a):console.error("Uniform buffer binding offset is not a multiple of the context offset alignment")))}bindUBO(t,e,s,a){null!=e?(i()&&(a??e.byteLength)>this._parameters.maxUniformBlockSize&&console.error("Attempting to bind more data than the maximum uniform block size"),e.initialize(),void 0!==s&&void 0!==a?this.bindBufferRange(h.UNIFORM_BUFFER,t,e.buffer,s,a):this.bindBufferBase(h.UNIFORM_BUFFER,t,e.buffer)):this.bindBufferBase(h.UNIFORM_BUFFER,t,null)}unbindUBO(t){for(let e=0,s=this._state.uniformBufferBindingPoints.length;e<s;e++){const s=this._state.uniformBufferBindingPoints[e];null!=s&&s.buffer===t.buffer&&this.bindBufferBase(h.UNIFORM_BUFFER,e,null)}}unbindBuffer(t){switch(t){case h.ARRAY_BUFFER:this._state.vertexBuffer=N(this.gl,null,t,this._state.vertexBuffer);break;case h.ELEMENT_ARRAY_BUFFER:this._state.indexBuffer=N(this.gl,null,t,this._state.indexBuffer);break;case h.UNIFORM_BUFFER:this._state.uniformBuffer=N(this.gl,null,t,this._state.uniformBuffer);break;case h.PIXEL_PACK_BUFFER:this._state.pixelPackBuffer=N(this.gl,null,t,this._state.pixelPackBuffer);break;case h.PIXEL_UNPACK_BUFFER:this._state.pixelUnpackBuffer=N(this.gl,null,t,this._state.pixelUnpackBuffer);break;case h.COPY_READ_BUFFER:this._state.copyReadBuffer=N(this.gl,null,t,this._state.copyReadBuffer);break;case h.COPY_WRITE_BUFFER:this._state.copyWriteBuffer=N(this.gl,null,t,this._state.copyWriteBuffer)}}bindVAO(t=null){null!=t?this._state.vertexArrayObject!==t&&(t.bind(),this._state.vertexArrayObject=t):this._state.vertexArrayObject&&(this._state.vertexArrayObject.unbind(),this._state.vertexArrayObject=null)}bindTransformFeedback(t){const{gl:e}=this;e.bindTransformFeedback(e.TRANSFORM_FEEDBACK,t.glName)}beginTransformFeedback(t,e){if(this._transformFeedbackRequestInfo)throw new Error("Already in a transform feedback request");const{gl:s}=this;s.bindTransformFeedback(s.TRANSFORM_FEEDBACK,t.glName),s.beginTransformFeedback(e),this._transformFeedbackRequestInfo={primitiveType:e}}endTransformFeedback(){if(!this._transformFeedbackRequestInfo)throw new Error("Not in a transform feedback request");const{gl:t}=this;t.endTransformFeedback(),t.bindTransformFeedback(t.TRANSFORM_FEEDBACK,null),this._transformFeedbackRequestInfo=null}async clientWaitAsync(t=s(10)){const{gl:i}=this,a=i.fenceSync(b.SYNC_GPU_COMMANDS_COMPLETE,0);if(!a)throw new Error("Client wait failed, could not create sync object");let r;this.instanceCounter.increment(F.Sync,a),i.flush();do{await e(t),r=i.clientWaitSync(a,0,0)}while(r===g.TIMEOUT_EXPIRED);if(this.instanceCounter.decrement(F.Sync,a),i.deleteSync(a),r===g.WAIT_FAILED)throw new Error("Client wait failed")}getBoundFramebufferObject(t=_.FRAMEBUFFER){return t===_.READ_FRAMEBUFFER?this._state.readFramebuffer:this._state.drawFramebuffer}temporaryBindFramebufferObject(t,e,s=!1){const i=this.getBoundFramebufferObject();try{t&&this.bindFramebuffer(t,s),e()}finally{this.bindFramebuffer(i,s)}}getBoundVAO(){return this._state.vertexArrayObject}resetState(){this.useProgram(null),this.bindVAO(null),this.bindFramebuffer(null,!0),this.unbindBuffer(h.ARRAY_BUFFER),this.unbindBuffer(h.ELEMENT_ARRAY_BUFFER),this.unbindBuffer(h.UNIFORM_BUFFER),this._state.uniformBufferBindingPoints.length=0,this.unbindBuffer(h.PIXEL_PACK_BUFFER),this.unbindBuffer(h.PIXEL_UNPACK_BUFFER),this.unbindBuffer(h.COPY_READ_BUFFER),this.unbindBuffer(h.COPY_WRITE_BUFFER);for(let t=0;t<this.parameters.maxTextureImageUnits;++t)this.bindTexture(null,t);this.setBlendingEnabled(!1),this.setBlendFunction(B.ONE,B.ZERO),this.setBlendEquation(p.ADD),this.setBlendColor(0,0,0,0),this.setFaceCullingEnabled(!1),this.setCullFace(f.BACK),this.setFrontFace(m.CCW),this.setPolygonOffsetFillEnabled(!1),this.setPolygonOffset(0,0),this.setScissorTestEnabled(!1),this.setScissorRect(0,0,this.gl.canvas.width,this.gl.canvas.height),this.setDepthTestEnabled(!1),this.setDepthFunction(E.LESS),this.setDepthRange(0,1),this.setStencilTestEnabled(!1),this.setStencilFunction(E.ALWAYS,0,0),this.setStencilOp(R.KEEP,R.KEEP,R.KEEP),this.setClearColor(0,0,0,0),this.setClearDepth(1),this.setClearStencil(0),this.setColorMask(!0,!0,!0,!0),this.setStencilWriteMask(4294967295),this.setDepthWriteEnabled(!0),this.setDrawBuffers([n.BACK]),this.setViewport(0,0,this.gl.canvas.width,this.gl.canvas.height)}enforceState(){const{gl:t}=this;t.bindVertexArray(null);for(let s=0;s<this.parameters.maxVertexAttributes;s++)t.disableVertexAttribArray(s);this._state.vertexBuffer?t.bindBuffer(this._state.vertexBuffer.bufferType,this._state.vertexBuffer.glName):t.bindBuffer(h.ARRAY_BUFFER,null),this._state.indexBuffer?t.bindBuffer(this._state.indexBuffer.bufferType,this._state.indexBuffer.glName):t.bindBuffer(h.ELEMENT_ARRAY_BUFFER,null),this._state.uniformBuffer?t.bindBuffer(this._state.uniformBuffer.bufferType,this._state.uniformBuffer.glName):t.bindBuffer(h.UNIFORM_BUFFER,null);for(let s=0;s<this._parameters.maxUniformBufferBindings;s++){const e=this._state.uniformBufferBindingPoints[s];if(null!=e){const{buffer:i,offset:a,size:r}=e;null!==i?0===a&&0===r?t.bindBufferBase(h.UNIFORM_BUFFER,s,i.glName):t.bindBufferRange(h.UNIFORM_BUFFER,s,i.glName,a,r):t.bindBufferBase(h.UNIFORM_BUFFER,s,null)}}if(this._state.pixelPackBuffer?t.bindBuffer(this._state.pixelPackBuffer.bufferType,this._state.pixelPackBuffer.glName):t.bindBuffer(h.PIXEL_PACK_BUFFER,null),this._state.pixelUnpackBuffer?t.bindBuffer(this._state.pixelUnpackBuffer.bufferType,this._state.pixelUnpackBuffer.glName):t.bindBuffer(h.PIXEL_UNPACK_BUFFER,null),this._state.copyReadBuffer?t.bindBuffer(this._state.copyReadBuffer.bufferType,this._state.copyReadBuffer.glName):t.bindBuffer(h.COPY_READ_BUFFER,null),this._state.copyWriteBuffer?t.bindBuffer(this._state.copyWriteBuffer.bufferType,this._state.copyWriteBuffer.glName):t.bindBuffer(h.COPY_WRITE_BUFFER,null),t.bindFramebuffer(_.READ_FRAMEBUFFER,null),t.readBuffer(t.BACK),this._state.readFramebuffer&&(t.bindFramebuffer(_.READ_FRAMEBUFFER,this._state.readFramebuffer.glName),t.readBuffer(l)),t.bindFramebuffer(_.DRAW_FRAMEBUFFER,this._state.drawFramebuffer?.glName??null),null===this._state.drawFramebuffer){const e=this._state.drawBuffers.defaultFramebuffer;t.drawBuffers(e??[n.BACK])}else{const e=this._state.drawBuffers.fbos.get(this._state.drawFramebuffer);t.drawBuffers(e??[l])}if(this._state.vertexArrayObject){const t=this._state.vertexArrayObject;this._state.vertexArrayObject&&(this._state.vertexArrayObject.unbind(),this._state.vertexArrayObject=null),this.bindVAO(t)}t.useProgram(this._state.program?.glName??null),t.blendColor(this._state.blendColor.r,this._state.blendColor.g,this._state.blendColor.b,this._state.blendColor.a),t.bindRenderbuffer(t.RENDERBUFFER,this._state.renderbuffer?.glName??null),!0===this._state.blend?t.enable(this.gl.BLEND):t.disable(this.gl.BLEND),t.blendEquationSeparate(this._state.blendEquation.mode,this._state.blendEquation.modeAlpha),t.blendFuncSeparate(this._state.blendFunction.srcRGB,this._state.blendFunction.dstRGB,this._state.blendFunction.srcAlpha,this._state.blendFunction.dstAlpha),t.clearColor(this._state.clearColor.r,this._state.clearColor.g,this._state.clearColor.b,this._state.clearColor.a),t.clearDepth(this._state.clearDepth),t.clearStencil(this._state.clearStencil),t.colorMask(this._state.colorMask.r,this._state.colorMask.g,this._state.colorMask.b,this._state.colorMask.a),t.cullFace(this._state.cullFace),t.depthFunc(this._state.depthFunction),t.depthRange(this._state.depthRange.zNear,this._state.depthRange.zFar),!0===this._state.depthTest?t.enable(t.DEPTH_TEST):t.disable(t.DEPTH_TEST),t.depthMask(this._state.depthWrite),t.frontFace(this._state.frontFace),t.lineWidth(1),!0===this._state.faceCulling?t.enable(t.CULL_FACE):t.disable(t.CULL_FACE),t.polygonOffset(this._state.polygonOffset[0],this._state.polygonOffset[1]),!0===this._state.polygonOffsetFill?t.enable(t.POLYGON_OFFSET_FILL):t.disable(t.POLYGON_OFFSET_FILL),t.scissor(this._state.scissorRect.x,this._state.scissorRect.y,this._state.scissorRect.width,this._state.scissorRect.height),!0===this._state.scissorTest?t.enable(t.SCISSOR_TEST):t.disable(t.SCISSOR_TEST),t.stencilFunc(this._state.stencilFunction.func,this._state.stencilFunction.ref,this._state.stencilFunction.mask),t.stencilOpSeparate(this._state.stencilOperation.face,this._state.stencilOperation.fail,this._state.stencilOperation.zFail,this._state.stencilOperation.zPass),!0===this._state.stencilTest?t.enable(t.STENCIL_TEST):t.disable(t.STENCIL_TEST),t.stencilMask(this._state.stencilWriteMask);for(let s=0;s<this.parameters.maxTextureImageUnits;s++){t.activeTexture(o+s),t.bindTexture(T.TEXTURE_2D,null),t.bindTexture(T.TEXTURE_CUBE_MAP,null),t.bindTexture(T.TEXTURE_3D,null),t.bindTexture(T.TEXTURE_2D_ARRAY,null);const e=this._state.textureUnitMap[s];null!=e&&t.bindTexture(e.descriptor.target,e.glName)}t.activeTexture(o+this._state.activeTexture);const e=this._state.viewport;t.viewport(e.x,e.y,e.width,e.height),this.resetInfo()}};function N(t,e,s,i){return e?i!==e&&t.bindBuffer(s,e.glName):t.bindBuffer(s,null),e}function D(t,e){switch(t){case A.POINTS:return 2*e;case A.TRIANGLES:return e/3;case A.TRIANGLE_STRIP:case A.TRIANGLE_FAN:return e-2;default:return 0}}export{v as RenderingContext};
5
+ import has from"../../core/has.js";import{disposeMaybe as t}from"../../core/maybe.js";import{after as e}from"../../core/promiseUtils.js";import{Milliseconds as s}from"../../core/time.js";import{webglDebugEnabled as i,checkWebGLError as a}from"./checkWebGLError.js";import{ContextState as r}from"./ContextState.js";import{SpecialDrawBuffers as n,ColorAttachment0 as l,BufferType as h,Face as f,baseTextureUnit as o,FramebufferBit as u,BufferContent as c,FramebufferTarget as _,TextureSamplingMode as d,SyncCondition as b,ResourceType as F,ClientWaitSyncStatus as g,BlendFactor as B,BlendOperation as p,CullMode as m,CompareFunction as E,StencilOperation as R,TextureType as T,PrimitiveType as A}from"./enums.js";import{InstanceCounter as O}from"./InstanceCounter.js";import{Parameters as C}from"./Parameters.js";import{ProgramCache as x}from"./ProgramCache.js";import{StateTracker as U}from"./renderState.js";import{Texture as k}from"./Texture.js";import{getErrorString as w}from"./Util.js";import{WebGLDriverTest as S}from"./WebGLDriverTest.js";import{Capabilities as y}from"./capabilities/Capabilities.js";let v=class{constructor(t,e){this.gl=t,this.instanceCounter=new O,this.programCache=new x(this),this._transformFeedbackRequestInfo=null,this._state=new r,this._numOfDrawCalls=0,this._numOfTriangles=0,this.configure(e)}configure(e){this._capabilities=new y(this.gl,e),this._parameters=new C(this.gl,this._capabilities,e),k.TEXTURE_UNIT_FOR_UPDATES=this._parameters.maxTextureImageUnits-1;const s=this.gl.getParameter(this.gl.VIEWPORT);this._state=new r,this._state.viewport={x:s[0],y:s[1],width:s[2],height:s[3]},this._stateTracker=new U({setBlending:t=>{if(t){this.setBlendingEnabled(!0),this.setBlendEquationSeparate(t.opRgb,t.opAlpha),this.setBlendFunctionSeparate(t.srcRgb,t.dstRgb,t.srcAlpha,t.dstAlpha);const e=t.color;this.setBlendColor(e.r,e.g,e.b,e.a)}else this.setBlendingEnabled(!1)},setCulling:t=>{t?(this.setFaceCullingEnabled(!0),this.setCullFace(t.face),this.setFrontFace(t.mode)):this.setFaceCullingEnabled(!1)},setPolygonOffset:t=>{t?(this.setPolygonOffsetFillEnabled(!0),this.setPolygonOffset(t.factor,t.units)):this.setPolygonOffsetFillEnabled(!1)},setDepthTest:t=>{t?(this.setDepthTestEnabled(!0),this.setDepthFunction(t.func)):this.setDepthTestEnabled(!1)},setStencilTest:t=>{if(t){this.setStencilTestEnabled(!0);const e=t.function;this.setStencilFunction(e.func,e.ref,e.mask);const s=t.operation;this.setStencilOp(s.fail,s.zFail,s.zPass)}else this.setStencilTestEnabled(!1)},setDepthWrite:t=>{t?(this.setDepthWriteEnabled(!0),this.setDepthRange(t.zNear,t.zFar)):this.setDepthWriteEnabled(!1)},setColorWrite:t=>{t?this.setColorMask(t.r,t.g,t.b,t.a):this.setColorMask(!1,!1,!1,!1)},setStencilWrite:t=>{t?this.setStencilWriteMask(t.mask):this.setStencilWriteMask(0)},setDrawBuffers:t=>{if(t)this.setDrawBuffers(t.buffers);else{const{drawFramebuffer:t}=this._state;null===t?this.setDrawBuffers([n.BACK]):0===t.colorAttachments.length?this.setDrawBuffers([n.NONE]):this.setDrawBuffers([l])}}}),this.enforceState(),t(this._driverTest),this._driverTest=new S(this)}updateOptions(t){this._parameters=new C(this.gl,this._capabilities,t)}dispose(){t(this._driverTest),this.programCache.dispose(),this.bindVAO(null),this.unbindBuffer(h.ARRAY_BUFFER),this.unbindBuffer(h.ELEMENT_ARRAY_BUFFER),this.unbindBuffer(h.UNIFORM_BUFFER),this._state.uniformBufferBindingPoints.length=0,this.unbindBuffer(h.PIXEL_PACK_BUFFER),this.unbindBuffer(h.PIXEL_UNPACK_BUFFER),this.unbindBuffer(h.COPY_READ_BUFFER),this.unbindBuffer(h.COPY_WRITE_BUFFER),this._state.textureUnitMap.length=0,i()&&console.log(this.instanceCounter.resourceInformation)}get driverTest(){return this._driverTest}get contextAttributes(){return this.gl.getContextAttributes()}get parameters(){return this._parameters}setPipelineState(t){this._stateTracker.setPipeline(t)}setBlendingEnabled(t){this._state.blend!==t&&(!0===t?this.gl.enable(this.gl.BLEND):this.gl.disable(this.gl.BLEND),this._state.blend=t,this._stateTracker.invalidateBlending())}externalProgramUpdate(){this._state.program?.stop(),this._state.program=null}externalTextureUnitUpdate(t,e){for(let s=0;s<t.length;++s)this._state.textureUnitMap[t[s]]=null;e>=0&&(this._state.activeTexture=e)}externalVertexArrayObjectUpdate(){this.gl.bindVertexArray(null),this._state.vertexArrayObject=null,this._state.vertexBuffer=null,this._state.indexBuffer=null}externalVertexBufferUpdate(){this._state.vertexBuffer=null}externalIndexBufferUpdate(){this._state.indexBuffer=null}setBlendColor(t,e,s,i){t===this._state.blendColor.r&&e===this._state.blendColor.g&&s===this._state.blendColor.b&&i===this._state.blendColor.a||(this.gl.blendColor(t,e,s,i),this._state.blendColor.r=t,this._state.blendColor.g=e,this._state.blendColor.b=s,this._state.blendColor.a=i,this._stateTracker.invalidateBlending())}setBlendFunction(t,e){t===this._state.blendFunction.srcRGB&&e===this._state.blendFunction.dstRGB||(this.gl.blendFunc(t,e),this._state.blendFunction.srcRGB=t,this._state.blendFunction.srcAlpha=t,this._state.blendFunction.dstRGB=e,this._state.blendFunction.dstAlpha=e,this._stateTracker.invalidateBlending())}setBlendFunctionSeparate(t,e,s,i){this._state.blendFunction.srcRGB===t&&this._state.blendFunction.srcAlpha===s&&this._state.blendFunction.dstRGB===e&&this._state.blendFunction.dstAlpha===i||(this.gl.blendFuncSeparate(t,e,s,i),this._state.blendFunction.srcRGB=t,this._state.blendFunction.srcAlpha=s,this._state.blendFunction.dstRGB=e,this._state.blendFunction.dstAlpha=i,this._stateTracker.invalidateBlending())}setBlendEquation(t){this._state.blendEquation.mode!==t&&(this.gl.blendEquation(t),this._state.blendEquation.mode=t,this._state.blendEquation.modeAlpha=t,this._stateTracker.invalidateBlending())}setBlendEquationSeparate(t,e){this._state.blendEquation.mode===t&&this._state.blendEquation.modeAlpha===e||(this.gl.blendEquationSeparate(t,e),this._state.blendEquation.mode=t,this._state.blendEquation.modeAlpha=e,this._stateTracker.invalidateBlending())}setColorMask(t,e,s,i){this._state.colorMask.r===t&&this._state.colorMask.g===e&&this._state.colorMask.b===s&&this._state.colorMask.a===i||(this.gl.colorMask(t,e,s,i),this._state.colorMask.r=t,this._state.colorMask.g=e,this._state.colorMask.b=s,this._state.colorMask.a=i,this._stateTracker.invalidateColorWrite())}setClearColor(t,e,s,i){this._state.clearColor.r===t&&this._state.clearColor.g===e&&this._state.clearColor.b===s&&this._state.clearColor.a===i||(this.gl.clearColor(t,e,s,i),this._state.clearColor.r=t,this._state.clearColor.g=e,this._state.clearColor.b=s,this._state.clearColor.a=i)}setFaceCullingEnabled(t){this._state.faceCulling!==t&&(!0===t?this.gl.enable(this.gl.CULL_FACE):this.gl.disable(this.gl.CULL_FACE),this._state.faceCulling=t,this._stateTracker.invalidateCulling())}setPolygonOffsetFillEnabled(t){this._state.polygonOffsetFill!==t&&(!0===t?this.gl.enable(this.gl.POLYGON_OFFSET_FILL):this.gl.disable(this.gl.POLYGON_OFFSET_FILL),this._state.polygonOffsetFill=t,this._stateTracker.invalidatePolygonOffset())}setPolygonOffset(t,e){this._state.polygonOffset[0]===t&&this._state.polygonOffset[1]===e||(this._state.polygonOffset[0]=t,this._state.polygonOffset[1]=e,this.gl.polygonOffset(t,e),this._stateTracker.invalidatePolygonOffset())}setCullFace(t){this._state.cullFace!==t&&(this.gl.cullFace(t),this._state.cullFace=t,this._stateTracker.invalidateCulling())}setFrontFace(t){this._state.frontFace!==t&&(this.gl.frontFace(t),this._state.frontFace=t,this._stateTracker.invalidateCulling())}setScissorTestEnabled(t){this._state.scissorTest!==t&&(!0===t?this.gl.enable(this.gl.SCISSOR_TEST):this.gl.disable(this.gl.SCISSOR_TEST),this._state.scissorTest=t)}setScissorRect(t,e,s,i){this._state.scissorRect.x===t&&this._state.scissorRect.y===e&&this._state.scissorRect.width===s&&this._state.scissorRect.height===i||(this.gl.scissor(t,e,s,i),this._state.scissorRect.x=t,this._state.scissorRect.y=e,this._state.scissorRect.width=s,this._state.scissorRect.height=i)}setDepthTestEnabled(t){this._state.depthTest!==t&&(!0===t?this.gl.enable(this.gl.DEPTH_TEST):this.gl.disable(this.gl.DEPTH_TEST),this._state.depthTest=t,this._stateTracker.invalidateDepthTest())}setClearDepth(t){this._state.clearDepth!==t&&(this.gl.clearDepth(t),this._state.clearDepth=t)}setDepthFunction(t){this._state.depthFunction!==t&&(this.gl.depthFunc(t),this._state.depthFunction=t,this._stateTracker.invalidateDepthTest())}setDepthWriteEnabled(t){this._state.depthWrite!==t&&(this.gl.depthMask(t),this._state.depthWrite=t,this._stateTracker.invalidateDepthWrite())}setDepthRange(t,e){this._state.depthRange.zNear===t&&this._state.depthRange.zFar===e||(this.gl.depthRange(t,e),this._state.depthRange.zNear=t,this._state.depthRange.zFar=e,this._stateTracker.invalidateDepthWrite())}setStencilTestEnabled(t){this._state.stencilTest!==t&&(!0===t?this.gl.enable(this.gl.STENCIL_TEST):this.gl.disable(this.gl.STENCIL_TEST),this._state.stencilTest=t,this._stateTracker.invalidateStencilTest())}setClearStencil(t){t!==this._state.clearStencil&&(this.gl.clearStencil(t),this._state.clearStencil=t)}setStencilFunction(t,e,s){this._state.stencilFunction.func===t&&this._state.stencilFunction.ref===e&&this._state.stencilFunction.mask===s||(this.gl.stencilFunc(t,e,s),this._state.stencilFunction.face=f.FRONT_AND_BACK,this._state.stencilFunction.func=t,this._state.stencilFunction.ref=e,this._state.stencilFunction.mask=s,this._stateTracker.invalidateStencilTest())}setStencilFunctionSeparate(t,e,s,i){this._state.stencilFunction.face===t&&this._state.stencilFunction.func===e&&this._state.stencilFunction.ref===s&&this._state.stencilFunction.mask===i||(this.gl.stencilFuncSeparate(t,e,s,i),this._state.stencilFunction.face=t,this._state.stencilFunction.func=e,this._state.stencilFunction.ref=s,this._state.stencilFunction.mask=i,this._stateTracker.invalidateStencilTest())}setStencilWriteMask(t){this._state.stencilWriteMask!==t&&(this.gl.stencilMask(t),this._state.stencilWriteMask=t,this._stateTracker.invalidateStencilWrite())}setStencilOp(t,e,s){this._state.stencilOperation.face===f.FRONT_AND_BACK&&this._state.stencilOperation.fail===t&&this._state.stencilOperation.zFail===e&&this._state.stencilOperation.zPass===s||(this.gl.stencilOp(t,e,s),this._state.stencilOperation.face=f.FRONT_AND_BACK,this._state.stencilOperation.fail=t,this._state.stencilOperation.zFail=e,this._state.stencilOperation.zPass=s,this._stateTracker.invalidateStencilTest())}setStencilOpSeparate(t,e,s,i){this._state.stencilOperation.face===t&&this._state.stencilOperation.fail===e&&this._state.stencilOperation.zFail===s&&this._state.stencilOperation.zPass===i||(this.gl.stencilOpSeparate(t,e,s,i),this._state.stencilOperation.face=t,this._state.stencilOperation.fail=e,this._state.stencilOperation.zFail=s,this._state.stencilOperation.zPass=i,this._stateTracker.invalidateStencilTest())}setActiveTexture(t,e=!1){const s=this._state.activeTexture;return t>=0&&(e||t!==this._state.activeTexture)&&(this.gl.activeTexture(o+t),this._state.activeTexture=t),s}setDrawBuffers(t){const{drawFramebuffer:e}=this._state,s=null===e,i=s?this._state.drawBuffers.defaultFramebuffer:this._state.drawBuffers.fbos.get(e);if(i?.length!==t.length||!i.every(((e,s)=>e===t[s])))if(t.length>this.parameters.maxDrawBuffers)console.error("Setting more active draw buffers than GL.MAX_DRAW_BUFFERS allows.");else{if(s){if(t.length>1)return void console.error("The default framebuffer can only have one active draw buffer.");if(t[0]!==n.BACK&&t[0]!==n.NONE)return void console.error("The default framebuffer can only use the constants GL.BACK or GL.NONE as draw buffers.")}s||!t.includes(n.BACK)?(this.gl.drawBuffers(t),s?this._state.drawBuffers.defaultFramebuffer=t:this._state.drawBuffers.fbos.set(e,t),this._stateTracker.invalidateDrawBuffers()):console.error("A framebuffer object can only use the constants GL.COLOR_ATTACHMENTi or GL.NONE as draw buffers.")}}clear(t,e=255){if(t){if(t&u.COLOR){const t=this._state.drawFramebuffer?.colorAttachments;t&&this.setDrawBuffers(t),this.setColorMask(!0,!0,!0,!0)}t&u.DEPTH&&this.setDepthWriteEnabled(!0),t&u.STENCIL&&this.setStencilWriteMask(e),this.gl.clear(t)}}clearFramebuffer(t,e=!1,s=!1){let i=0;if(t){const e=1e-13,s=Math.max(e,t[3]);this.setClearColor(t[0],t[1],t[2],s),i|=u.COLOR}e&&(i|=u.DEPTH),!1===s?s=0:(!0===s&&(s=255),i|=u.STENCIL),i&&this.clear(i,s)}clearBuffer(t,e,s=c.COLOR,i=void 0){this.gl.clearBufferfv(s,t,e,i)}clearBufferInteger(t,e,s=c.COLOR,i=void 0){this.gl.clearBufferiv(s,t,e,i)}clearBufferUnsignedInteger(t,e,s=c.COLOR,i=void 0){this.gl.clearBufferuiv(s,t,e,i)}drawArrays(t,e,s){if(this._transformFeedbackRequestInfo){if(t!==this._transformFeedbackRequestInfo.primitiveType)throw new Error("DrawArrays called during transform feedback, but primitiveType does not match that of the current transform feedback request");if(null==this._state.program?.hasTransformFeedbackVaryings)throw new Error("DrawArrays called during transform feedback, but the shader program was not linked with a transform feedback varying")}if(i()&&(this._numOfDrawCalls++,this._numOfTriangles+=D(t,s),has("enable-feature:webgl-debug:textureReadWrite"))){const t=this._state.textureUnitMap;for(let e=0;e<t.length;e++){const s=t[e];if(null!=s&&s===this._state.drawFramebuffer?.colorTexture)throw new Error(`Detected readWrite. Texture already bound at index ${e}`)}}this.gl.drawArrays(t,e,s),a(this.gl)}drawArraysInstanced(t,e,s,i){this.gl.drawArraysInstanced(t,e,s,i),a(this.gl)}drawElements(t,e,s,a){if(this._transformFeedbackRequestInfo)throw new Error("Cannot called drawElements during a transform feedback request");if(i()&&(this._numOfDrawCalls++,this._numOfTriangles+=D(t,e)),this.gl.drawElements(t,e,s,a),i()){const i=w(this);if(i){const r=this.getBoundVAO(),n=r?.indexBuffer,l=r?.vertexBuffers,h={indexBuffer:n,vertexBuffers:l},f={mode:t,count:e,type:s,offset:a},o=n?.size??0,u=a+e,c=o<u?`. Buffer is too small. Attempted to draw index ${u} of ${o}`:"";console.error(`drawElements: ${i}${c}`,{args:f,vao:h})}}}drawElementsInstanced(t,e,s,i,r){this.gl.drawElementsInstanced(t,e,s,i,r),a(this.gl)}logInfo(){i()&&console.log(`DrawCalls: ${this._numOfDrawCalls}, Triangles: ${this._numOfTriangles}`)}resetInfo(){i()&&(this._numOfDrawCalls=0,this._numOfTriangles=0)}get capabilities(){return this._capabilities}setViewport(t,e,s,i){s=Math.max(Math.round(s),1),i=Math.max(Math.round(i),1);const a=this._state.viewport;a.x===t&&a.y===e&&a.width===s&&a.height===i||(a.x=t,a.y=e,a.width=s,a.height=i,this.gl.viewport(t,e,s,i))}setViewport4fv(t){this.setViewport(t[0],t[1],t[2],t[3])}restoreViewport({x:t,y:e,width:s,height:i}){this.setViewport(t,e,s,i)}getViewport(){const t=this._state.viewport;return{x:t.x,y:t.y,width:t.width,height:t.height}}useProgram(t){this._state.program!==t&&(this._state.program?.stop(),this._state.program=t,this.gl.useProgram(t?.glName??null))}bindTexture(t,e,s=!1){(e>=this.parameters.maxTextureImageUnits||e<0)&&console.error("Input texture unit is out of range of available units!");const i=this._state.textureUnitMap[e];return null==t?.glName?(null!=i&&(this.setActiveTexture(e,s),this.gl.bindTexture(i.descriptor.target,null)),this._state.textureUnitMap[e]=null,i):s||i!==t?(this.setActiveTexture(e,s),this.gl.bindTexture(t.descriptor.target,t.glName),t.applyChanges(),this._state.textureUnitMap[e]=t,i):(t.isDirty&&(this.setActiveTexture(e,s),t.applyChanges()),i)}unbindTexture(t){if(null!=t)for(let e=0;e<this.parameters.maxTextureImageUnits;e++)this._state.textureUnitMap[e]===t&&(this.bindTexture(null,e),this._state.textureUnitMap[e]=null)}bindFramebuffer(t,e=!1){if(e||this._state.readFramebuffer!==t||this._state.drawFramebuffer!==t){if(this._stateTracker.invalidateDrawBuffers(),null==t)return this.gl.bindFramebuffer(_.FRAMEBUFFER,null),void(this._state.readFramebuffer=this._state.drawFramebuffer=null);t.initializeAndBind(_.FRAMEBUFFER),this._state.readFramebuffer=t,this._state.drawFramebuffer=t}}bindFramebufferSeparate(t,e,s=!1){const i=e===_.READ_FRAMEBUFFER,a=i?this._state.readFramebuffer:this._state.drawFramebuffer;(s||a!==t)&&(null==t?this.gl.bindFramebuffer(e,null):t.initializeAndBind(e),i?this._state.readFramebuffer=t??null:(this._stateTracker.invalidateDrawBuffers(),this._state.drawFramebuffer=t??null))}blitFramebuffer(t,e,s=u.COLOR,i=d.NEAREST,a=0,r=0,n=t.width,l=t.height,h=0,f=0,o=e.width,c=e.height){this.bindFramebufferSeparate(t,_.READ_FRAMEBUFFER,!0),this.bindFramebufferSeparate(e,_.DRAW_FRAMEBUFFER,!0),this.gl.blitFramebuffer(a,r,n,l,h,f,o,c,s,i)}bindBuffer(t,e){if(t)switch(e??=t.bufferType,e){case h.ARRAY_BUFFER:this._state.vertexBuffer=N(this.gl,t,e,this._state.vertexBuffer);break;case h.ELEMENT_ARRAY_BUFFER:this._state.indexBuffer=N(this.gl,t,e,this._state.indexBuffer);break;case h.UNIFORM_BUFFER:this._state.uniformBuffer=N(this.gl,t,e,this._state.uniformBuffer);break;case h.PIXEL_PACK_BUFFER:this._state.pixelPackBuffer=N(this.gl,t,e,this._state.pixelPackBuffer);break;case h.PIXEL_UNPACK_BUFFER:this._state.pixelUnpackBuffer=N(this.gl,t,e,this._state.pixelUnpackBuffer);break;case h.COPY_READ_BUFFER:this._state.copyReadBuffer=N(this.gl,t,e,this._state.copyReadBuffer);break;case h.COPY_WRITE_BUFFER:this._state.copyWriteBuffer=N(this.gl,t,e,this._state.copyWriteBuffer);break;case h.TRANSFORM_FEEDBACK_BUFFER:this._state.transformFeedbackBuffer=N(this.gl,t,e,this._state.transformFeedbackBuffer)}}bindRenderbuffer(t){const e=this.gl;t||(e.bindRenderbuffer(e.RENDERBUFFER,null),this._state.renderbuffer=null),this._state.renderbuffer!==t&&(e.bindRenderbuffer(e.RENDERBUFFER,t.glName),this._state.renderbuffer=t)}_getBufferBinding(t,e){if(e>=this.parameters.maxUniformBufferBindings||e<0)return console.error("Uniform buffer binding point is out of range!"),null;const s=t===h.UNIFORM_BUFFER?this._state.uniformBufferBindingPoints:this._state.transformBufferBindingPoints;let i=s[e];return null==i&&(i={buffer:null,offset:0,size:0},s[e]=i),i}bindBufferBase(t,e,s){const i=this._getBufferBinding(t,e);null!=i&&(i.buffer===s&&0===i.offset&&0===i.size||(this.gl.bindBufferBase(t,e,s?s.glName:null),i.buffer=s,i.offset=0,i.size=0))}bindBufferRange(t,e,s,i,a){const r=this._getBufferBinding(t,e);null!=r&&(r.buffer===s&&r.offset===i&&r.size===a||(i%this._parameters.uniformBufferOffsetAlignment===0?(this.gl.bindBufferRange(t,e,s.glName,i,a),r.buffer=s,r.offset=i,r.size=a):console.error("Uniform buffer binding offset is not a multiple of the context offset alignment")))}bindUBO(t,e,s,a){null!=e?(i()&&(a??e.byteLength)>this._parameters.maxUniformBlockSize&&console.error("Attempting to bind more data than the maximum uniform block size"),e.initialize(),void 0!==s&&void 0!==a?this.bindBufferRange(h.UNIFORM_BUFFER,t,e.buffer,s,a):this.bindBufferBase(h.UNIFORM_BUFFER,t,e.buffer)):this.bindBufferBase(h.UNIFORM_BUFFER,t,null)}unbindUBO(t){for(let e=0,s=this._state.uniformBufferBindingPoints.length;e<s;e++){const s=this._state.uniformBufferBindingPoints[e];null!=s&&s.buffer===t.buffer&&this.bindBufferBase(h.UNIFORM_BUFFER,e,null)}}unbindBuffer(t){switch(t){case h.ARRAY_BUFFER:this._state.vertexBuffer=N(this.gl,null,t,this._state.vertexBuffer);break;case h.ELEMENT_ARRAY_BUFFER:this._state.indexBuffer=N(this.gl,null,t,this._state.indexBuffer);break;case h.UNIFORM_BUFFER:this._state.uniformBuffer=N(this.gl,null,t,this._state.uniformBuffer);break;case h.PIXEL_PACK_BUFFER:this._state.pixelPackBuffer=N(this.gl,null,t,this._state.pixelPackBuffer);break;case h.PIXEL_UNPACK_BUFFER:this._state.pixelUnpackBuffer=N(this.gl,null,t,this._state.pixelUnpackBuffer);break;case h.COPY_READ_BUFFER:this._state.copyReadBuffer=N(this.gl,null,t,this._state.copyReadBuffer);break;case h.COPY_WRITE_BUFFER:this._state.copyWriteBuffer=N(this.gl,null,t,this._state.copyWriteBuffer)}}bindVAO(t=null){null!=t?this._state.vertexArrayObject!==t&&(t.bind(),this._state.vertexArrayObject=t):this._state.vertexArrayObject&&(this._state.vertexArrayObject.unbind(),this._state.vertexArrayObject=null)}bindTransformFeedback(t){const{gl:e}=this;e.bindTransformFeedback(e.TRANSFORM_FEEDBACK,t.glName)}beginTransformFeedback(t,e){if(this._transformFeedbackRequestInfo)throw new Error("Already in a transform feedback request");const{gl:s}=this;s.bindTransformFeedback(s.TRANSFORM_FEEDBACK,t.glName),s.beginTransformFeedback(e),this._transformFeedbackRequestInfo={primitiveType:e}}endTransformFeedback(){if(!this._transformFeedbackRequestInfo)throw new Error("Not in a transform feedback request");const{gl:t}=this;t.endTransformFeedback(),t.bindTransformFeedback(t.TRANSFORM_FEEDBACK,null),this._transformFeedbackRequestInfo=null}async clientWaitAsync(t=s(10)){const{gl:i}=this,a=i.fenceSync(b.SYNC_GPU_COMMANDS_COMPLETE,0);if(!a)throw new Error("Client wait failed, could not create sync object");let r;this.instanceCounter.increment(F.Sync,a),i.flush();do{await e(t),r=i.clientWaitSync(a,0,0)}while(r===g.TIMEOUT_EXPIRED);if(this.instanceCounter.decrement(F.Sync,a),i.deleteSync(a),r===g.WAIT_FAILED)throw new Error("Client wait failed")}getBoundFramebufferObject(t=_.FRAMEBUFFER){return t===_.READ_FRAMEBUFFER?this._state.readFramebuffer:this._state.drawFramebuffer}temporaryBindFramebufferObject(t,e,s=!1){const i=this.getBoundFramebufferObject();try{this.bindFramebuffer(t,s),e()}finally{this.bindFramebuffer(i,s)}}getBoundVAO(){return this._state.vertexArrayObject}resetState(){this.useProgram(null),this.bindVAO(null),this.bindFramebuffer(null,!0),this.unbindBuffer(h.ARRAY_BUFFER),this.unbindBuffer(h.ELEMENT_ARRAY_BUFFER),this.unbindBuffer(h.UNIFORM_BUFFER),this._state.uniformBufferBindingPoints.length=0,this.unbindBuffer(h.PIXEL_PACK_BUFFER),this.unbindBuffer(h.PIXEL_UNPACK_BUFFER),this.unbindBuffer(h.COPY_READ_BUFFER),this.unbindBuffer(h.COPY_WRITE_BUFFER);for(let t=0;t<this.parameters.maxTextureImageUnits;++t)this.bindTexture(null,t);this.setBlendingEnabled(!1),this.setBlendFunction(B.ONE,B.ZERO),this.setBlendEquation(p.ADD),this.setBlendColor(0,0,0,0),this.setFaceCullingEnabled(!1),this.setCullFace(f.BACK),this.setFrontFace(m.CCW),this.setPolygonOffsetFillEnabled(!1),this.setPolygonOffset(0,0),this.setScissorTestEnabled(!1),this.setScissorRect(0,0,this.gl.canvas.width,this.gl.canvas.height),this.setDepthTestEnabled(!1),this.setDepthFunction(E.LESS),this.setDepthRange(0,1),this.setStencilTestEnabled(!1),this.setStencilFunction(E.ALWAYS,0,0),this.setStencilOp(R.KEEP,R.KEEP,R.KEEP),this.setClearColor(0,0,0,0),this.setClearDepth(1),this.setClearStencil(0),this.setColorMask(!0,!0,!0,!0),this.setStencilWriteMask(4294967295),this.setDepthWriteEnabled(!0),this.setDrawBuffers([n.BACK]),this.setViewport(0,0,this.gl.canvas.width,this.gl.canvas.height)}enforceState(){const{gl:t}=this;t.bindVertexArray(null);for(let s=0;s<this.parameters.maxVertexAttributes;s++)t.disableVertexAttribArray(s);this._state.vertexBuffer?t.bindBuffer(this._state.vertexBuffer.bufferType,this._state.vertexBuffer.glName):t.bindBuffer(h.ARRAY_BUFFER,null),this._state.indexBuffer?t.bindBuffer(this._state.indexBuffer.bufferType,this._state.indexBuffer.glName):t.bindBuffer(h.ELEMENT_ARRAY_BUFFER,null),this._state.uniformBuffer?t.bindBuffer(this._state.uniformBuffer.bufferType,this._state.uniformBuffer.glName):t.bindBuffer(h.UNIFORM_BUFFER,null);for(let s=0;s<this._parameters.maxUniformBufferBindings;s++){const e=this._state.uniformBufferBindingPoints[s];if(null!=e){const{buffer:i,offset:a,size:r}=e;null!==i?0===a&&0===r?t.bindBufferBase(h.UNIFORM_BUFFER,s,i.glName):t.bindBufferRange(h.UNIFORM_BUFFER,s,i.glName,a,r):t.bindBufferBase(h.UNIFORM_BUFFER,s,null)}}if(this._state.pixelPackBuffer?t.bindBuffer(this._state.pixelPackBuffer.bufferType,this._state.pixelPackBuffer.glName):t.bindBuffer(h.PIXEL_PACK_BUFFER,null),this._state.pixelUnpackBuffer?t.bindBuffer(this._state.pixelUnpackBuffer.bufferType,this._state.pixelUnpackBuffer.glName):t.bindBuffer(h.PIXEL_UNPACK_BUFFER,null),this._state.copyReadBuffer?t.bindBuffer(this._state.copyReadBuffer.bufferType,this._state.copyReadBuffer.glName):t.bindBuffer(h.COPY_READ_BUFFER,null),this._state.copyWriteBuffer?t.bindBuffer(this._state.copyWriteBuffer.bufferType,this._state.copyWriteBuffer.glName):t.bindBuffer(h.COPY_WRITE_BUFFER,null),t.bindFramebuffer(_.READ_FRAMEBUFFER,null),t.readBuffer(t.BACK),this._state.readFramebuffer&&(t.bindFramebuffer(_.READ_FRAMEBUFFER,this._state.readFramebuffer.glName),t.readBuffer(l)),t.bindFramebuffer(_.DRAW_FRAMEBUFFER,this._state.drawFramebuffer?.glName??null),null===this._state.drawFramebuffer){const e=this._state.drawBuffers.defaultFramebuffer;t.drawBuffers(e??[n.BACK])}else{const e=this._state.drawBuffers.fbos.get(this._state.drawFramebuffer);t.drawBuffers(e??[l])}if(this._state.vertexArrayObject){const t=this._state.vertexArrayObject;this._state.vertexArrayObject&&(this._state.vertexArrayObject.unbind(),this._state.vertexArrayObject=null),this.bindVAO(t)}t.useProgram(this._state.program?.glName??null),t.blendColor(this._state.blendColor.r,this._state.blendColor.g,this._state.blendColor.b,this._state.blendColor.a),t.bindRenderbuffer(t.RENDERBUFFER,this._state.renderbuffer?.glName??null),!0===this._state.blend?t.enable(this.gl.BLEND):t.disable(this.gl.BLEND),t.blendEquationSeparate(this._state.blendEquation.mode,this._state.blendEquation.modeAlpha),t.blendFuncSeparate(this._state.blendFunction.srcRGB,this._state.blendFunction.dstRGB,this._state.blendFunction.srcAlpha,this._state.blendFunction.dstAlpha),t.clearColor(this._state.clearColor.r,this._state.clearColor.g,this._state.clearColor.b,this._state.clearColor.a),t.clearDepth(this._state.clearDepth),t.clearStencil(this._state.clearStencil),t.colorMask(this._state.colorMask.r,this._state.colorMask.g,this._state.colorMask.b,this._state.colorMask.a),t.cullFace(this._state.cullFace),t.depthFunc(this._state.depthFunction),t.depthRange(this._state.depthRange.zNear,this._state.depthRange.zFar),!0===this._state.depthTest?t.enable(t.DEPTH_TEST):t.disable(t.DEPTH_TEST),t.depthMask(this._state.depthWrite),t.frontFace(this._state.frontFace),t.lineWidth(1),!0===this._state.faceCulling?t.enable(t.CULL_FACE):t.disable(t.CULL_FACE),t.polygonOffset(this._state.polygonOffset[0],this._state.polygonOffset[1]),!0===this._state.polygonOffsetFill?t.enable(t.POLYGON_OFFSET_FILL):t.disable(t.POLYGON_OFFSET_FILL),t.scissor(this._state.scissorRect.x,this._state.scissorRect.y,this._state.scissorRect.width,this._state.scissorRect.height),!0===this._state.scissorTest?t.enable(t.SCISSOR_TEST):t.disable(t.SCISSOR_TEST),t.stencilFunc(this._state.stencilFunction.func,this._state.stencilFunction.ref,this._state.stencilFunction.mask),t.stencilOpSeparate(this._state.stencilOperation.face,this._state.stencilOperation.fail,this._state.stencilOperation.zFail,this._state.stencilOperation.zPass),!0===this._state.stencilTest?t.enable(t.STENCIL_TEST):t.disable(t.STENCIL_TEST),t.stencilMask(this._state.stencilWriteMask);for(let s=0;s<this.parameters.maxTextureImageUnits;s++){t.activeTexture(o+s),t.bindTexture(T.TEXTURE_2D,null),t.bindTexture(T.TEXTURE_CUBE_MAP,null),t.bindTexture(T.TEXTURE_3D,null),t.bindTexture(T.TEXTURE_2D_ARRAY,null);const e=this._state.textureUnitMap[s];null!=e&&t.bindTexture(e.descriptor.target,e.glName)}t.activeTexture(o+this._state.activeTexture);const e=this._state.viewport;t.viewport(e.x,e.y,e.width,e.height),this.resetInfo()}};function N(t,e,s,i){return e?i!==e&&t.bindBuffer(s,e.glName):t.bindBuffer(s,null),e}function D(t,e){switch(t){case A.POINTS:return 2*e;case A.TRIANGLES:return e/3;case A.TRIANGLE_STRIP:case A.TRIANGLE_FAN:return e-2;default:return 0}}export{v as RenderingContext};