@arcgis/core 5.2.0-next.62 → 5.2.0-next.64

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 (530) hide show
  1. package/WebDocument2D.d.ts +17 -1
  2. package/WebDocument2D.js +1 -1
  3. package/WebLinkChart.js +1 -1
  4. package/WebMap.js +1 -1
  5. package/WebScene.js +1 -1
  6. package/arcade/Feature.js +1 -1
  7. package/arcade/ImmutableArray.js +1 -1
  8. package/arcade/ImmutablePathArray.js +1 -1
  9. package/arcade/ImmutablePointArray.js +1 -1
  10. package/arcade/Pixel.js +1 -1
  11. package/arcade/Voxel.js +1 -1
  12. package/arcade/arcadeAsyncRuntime.js +1 -1
  13. package/arcade/arcadeCompiler.js +1 -1
  14. package/arcade/arcadeRuntime.js +1 -1
  15. package/arcade/containerUtils.js +1 -1
  16. package/arcade/debug.js +1 -1
  17. package/arcade/deepClone.js +1 -1
  18. package/arcade/featureset/sources/FeatureLayerDynamic.js +1 -1
  19. package/arcade/functions/convertdirection.js +1 -1
  20. package/arcade/functions/date.js +1 -1
  21. package/arcade/functions/feature.js +1 -1
  22. package/arcade/functions/featuresetbase.js +1 -1
  23. package/arcade/functions/featuresetgeom.js +1 -1
  24. package/arcade/functions/featuresetstats.js +1 -1
  25. package/arcade/functions/featuresetstring.js +1 -1
  26. package/arcade/functions/fieldStats.js +1 -1
  27. package/arcade/functions/geomasync.js +1 -1
  28. package/arcade/functions/geometry.js +1 -1
  29. package/arcade/functions/geomsync.js +1 -1
  30. package/arcade/functions/knowledgegraph.js +1 -1
  31. package/arcade/functions/maths.js +1 -1
  32. package/arcade/functions/stats.js +1 -1
  33. package/arcade/functions/string.js +1 -1
  34. package/arcade/functions/track.js +1 -1
  35. package/arcade/geometry/functions.js +1 -1
  36. package/arcade/languageUtils.js +1 -1
  37. package/arcade.js +1 -1
  38. package/arcgisGlobal.d.ts +14 -0
  39. package/assets/esri/core/workers/RemoteClient.js +1 -1
  40. package/assets/esri/core/workers/chunks/{44e64186318728d1be51.js → 067b00498ae85f635f60.js} +1 -1
  41. package/assets/esri/core/workers/chunks/0977f4d77c36175c2895.js +1 -0
  42. package/assets/esri/core/workers/chunks/09c43bcb09aad02e83a9.js +1 -0
  43. package/assets/esri/core/workers/chunks/0b20f92bae2b4c40d299.js +1 -0
  44. package/assets/esri/core/workers/chunks/0c3c311400ee352187ea.js +1 -0
  45. package/assets/esri/core/workers/chunks/0c582abc8d25249eb530.js +1 -0
  46. package/assets/esri/core/workers/chunks/0d6776055e9b34c14151.js +1 -0
  47. package/assets/esri/core/workers/chunks/0d7d54e74b5639a0be6e.js +1 -0
  48. package/assets/esri/core/workers/chunks/0da5b27b070ab780f8b3.js +1 -0
  49. package/assets/esri/core/workers/chunks/0e6b6fcc55cc43ede1fc.js +1 -0
  50. package/assets/esri/core/workers/chunks/{bcb5017500d144b73908.js → 126f1f6b355723db6c4f.js} +1 -1
  51. package/assets/esri/core/workers/chunks/12a64eca4c571926d9d4.js +1 -0
  52. package/assets/esri/core/workers/chunks/{b2c0262c4a76b8a86200.js → 149284464115981694ff.js} +1 -1
  53. package/assets/esri/core/workers/chunks/1642fa1263d8f4a45101.js +1 -0
  54. package/assets/esri/core/workers/chunks/1840d74ebae777a0200b.js +1 -0
  55. package/assets/esri/core/workers/chunks/19bf6826e7d9a4d52035.js +1 -0
  56. package/assets/esri/core/workers/chunks/1bfbdec791e19f5a2534.js +1 -0
  57. package/assets/esri/core/workers/chunks/1d8280f63a6698e74f20.js +1 -0
  58. package/assets/esri/core/workers/chunks/{1b68b1b724ad30396723.js → 2426601b8cae7f06af4d.js} +1 -1
  59. package/assets/esri/core/workers/chunks/{a12803108c3b12808698.js → 242cad472fbc38b24dbc.js} +2 -2
  60. package/assets/esri/core/workers/chunks/25197ecb324d6f08e03e.js +1 -0
  61. package/assets/esri/core/workers/chunks/253c231b5a52f1d2d3a5.js +1 -0
  62. package/assets/esri/core/workers/chunks/25999b6f96ec305a7679.js +1 -0
  63. package/assets/esri/core/workers/chunks/259bdacfb7b0f866a8d0.js +1 -0
  64. package/assets/esri/core/workers/chunks/28565756f884d0851003.js +1 -0
  65. package/assets/esri/core/workers/chunks/2a5a165848413764381b.js +1 -0
  66. package/assets/esri/core/workers/chunks/2e7a5bb740281ef59199.js +1 -0
  67. package/assets/esri/core/workers/chunks/{285a5bd708f0fe1c620c.js → 2ea3ca68cfa4d34e8f3b.js} +1 -1
  68. package/assets/esri/core/workers/chunks/2f87a49bdd00f899d81d.js +1 -0
  69. package/assets/esri/core/workers/chunks/{37a95f097533bad1b338.js → 302d91b7c480c6c9304b.js} +1 -1
  70. package/assets/esri/core/workers/chunks/{3d6d2b42ba2ad7086d5d.js → 3b493e8043ec1a2a5d96.js} +1 -1
  71. package/assets/esri/core/workers/chunks/40e48b720d89cd067892.js +1 -0
  72. package/assets/esri/core/workers/chunks/{a833fc9250635eb4152f.js → 41f7f3615d3ecb87c59a.js} +1 -1
  73. package/assets/esri/core/workers/chunks/{17acbf40e7c1cb42d9bd.js → 44b1cdf28269b4fa8a39.js} +1 -1
  74. package/assets/esri/core/workers/chunks/44e8cd4b3dad777ab0c9.js +1 -0
  75. package/assets/esri/core/workers/chunks/{95b3b8fe45ef4ac6b277.js → 450bc48a7389607bce1e.js} +1 -1
  76. package/assets/esri/core/workers/chunks/465a050fd838ee8eddf3.js +1 -0
  77. package/assets/esri/core/workers/chunks/46d8a1d6f7341ad20749.js +1 -0
  78. package/assets/esri/core/workers/chunks/4710f21b138a2c9a0345.js +1 -0
  79. package/assets/esri/core/workers/chunks/48a0dfaabb9b4bce4191.js +1 -0
  80. package/assets/esri/core/workers/chunks/49a3888bf9e2481642ac.js +1 -0
  81. package/assets/esri/core/workers/chunks/{4ee900e5dbb130fa0c7b.js → 4a40b894ec89b0a4f9bf.js} +1 -1
  82. package/assets/esri/core/workers/chunks/{d847c3cb2043a983145b.js → 4addea2e35b0c845743e.js} +1 -1
  83. package/assets/esri/core/workers/chunks/{e0a4d0288abd334b0673.js → 4ae626868e14bedd7fc5.js} +1 -1
  84. package/assets/esri/core/workers/chunks/529ee4670940720e888b.js +1 -0
  85. package/assets/esri/core/workers/chunks/{a3c882fe7599dc0f4f27.js → 59d1708ae13c6e7e6e55.js} +1 -1
  86. package/assets/esri/core/workers/chunks/59dd83e5aee2908c7eca.js +1 -0
  87. package/assets/esri/core/workers/chunks/5dbd8ca7e7b8eb9a0bf7.js +1 -0
  88. package/assets/esri/core/workers/chunks/{b8bdacebd4d24ba90f3f.js → 5fde1234c5cccaee6763.js} +1 -1
  89. package/assets/esri/core/workers/chunks/60f9b37dd738d884c48d.js +1 -0
  90. package/assets/esri/core/workers/chunks/6123894e2ae9233cdf89.js +1 -0
  91. package/assets/esri/core/workers/chunks/62c8413f3bbc1378273d.js +1 -0
  92. package/assets/esri/core/workers/chunks/6501ee40bf25f9f75d02.js +1 -0
  93. package/assets/esri/core/workers/chunks/663cf8bff17c894cd5f8.js +1 -0
  94. package/assets/esri/core/workers/chunks/6b536d03b4bef408035b.js +1 -0
  95. package/assets/esri/core/workers/chunks/6c98a64d92c9bca78203.js +1 -0
  96. package/assets/esri/core/workers/chunks/6d1371b521c7f94fd77e.js +1 -0
  97. package/assets/esri/core/workers/chunks/6d5038d4351fe29e2718.js +1 -0
  98. package/assets/esri/core/workers/chunks/6f102c90908c9900cdaa.js +1 -0
  99. package/assets/esri/core/workers/chunks/6f39545710d1b35d922c.js +1 -0
  100. package/assets/esri/core/workers/chunks/7278fdf6bfcdffa10a7f.js +1 -0
  101. package/assets/esri/core/workers/chunks/72eb0ac55026a4f5d6a7.js +1 -0
  102. package/assets/esri/core/workers/chunks/73cb499d7d68c59ba34e.js +1 -0
  103. package/assets/esri/core/workers/chunks/{b8d788e110c212a879ab.js → 73f228d966b89c73c9e9.js} +1 -1
  104. package/assets/esri/core/workers/chunks/{e7402dfd683f82878360.js → 752343d92ed48e674351.js} +1 -1
  105. package/assets/esri/core/workers/chunks/7538a0fe0cec3156769e.js +1 -0
  106. package/assets/esri/core/workers/chunks/76bccc318d7cc33829a7.js +1 -0
  107. package/assets/esri/core/workers/chunks/771ead806efbe9c91fdc.js +1 -0
  108. package/assets/esri/core/workers/chunks/777eafdb86b26b35c803.js +1 -0
  109. package/assets/esri/core/workers/chunks/7821aeba3e414b318a75.js +1 -0
  110. package/assets/esri/core/workers/chunks/78b80da3bbc1b608fe83.js +1 -0
  111. package/assets/esri/core/workers/chunks/7b531feba4fd662575f9.js +1 -0
  112. package/assets/esri/core/workers/chunks/7c57354d026e27e056d4.js +1 -0
  113. package/assets/esri/core/workers/chunks/7d163d9d90393e491ee5.js +1 -0
  114. package/assets/esri/core/workers/chunks/7d4c65311064a5c2e0b1.js +1 -0
  115. package/assets/esri/core/workers/chunks/{0474af7687466d8befd2.js → 7e2794705b4e679fcb3f.js} +1 -1
  116. package/assets/esri/core/workers/chunks/7ebbb90d80600d9ba889.js +1 -0
  117. package/assets/esri/core/workers/chunks/7f125963555dc1ce63ad.js +1 -0
  118. package/assets/esri/core/workers/chunks/{763cbb6716e398436a6d.js → 7f6eee102871769fdf8f.js} +1 -1
  119. package/assets/esri/core/workers/chunks/805c97b875d3066fb8df.js +1 -0
  120. package/assets/esri/core/workers/chunks/8566449c39eba55147f5.js +1 -0
  121. package/assets/esri/core/workers/chunks/86ed75b7169b8ee43025.js +1 -0
  122. package/assets/esri/core/workers/chunks/{9482a6d7baa24bbf5693.js → 89132395eca329b9ab92.js} +1 -1
  123. package/assets/esri/core/workers/chunks/{28bc5e8e82f188b30eb9.js → 894343e415639df88243.js} +1 -1
  124. package/assets/esri/core/workers/chunks/8b4759cef5ae5e43253b.js +1 -0
  125. package/assets/esri/core/workers/chunks/8ba4175f5e9a24ffecf7.js +1 -0
  126. package/assets/esri/core/workers/chunks/8be707044d992ef5f1d8.js +1 -0
  127. package/assets/esri/core/workers/chunks/{bd862382f72ebd446b46.js → 8d2cac1952e817daaf1f.js} +1 -1
  128. package/assets/esri/core/workers/chunks/8e1d4867406753c5483c.js +1 -0
  129. package/assets/esri/core/workers/chunks/8e38c5e63aae42bdf5a4.js +29 -0
  130. package/assets/esri/core/workers/chunks/{02ab09285a5c4ca98066.js → 8f785b722b1a131bf370.js} +1 -1
  131. package/assets/esri/core/workers/chunks/8f9874f42f21a4cb3acd.js +1 -0
  132. package/assets/esri/core/workers/chunks/90f4b81c6034253b70d7.js +1 -0
  133. package/assets/esri/core/workers/chunks/917c11cb40a7742d7f98.js +1 -0
  134. package/assets/esri/core/workers/chunks/93ab247ff34694ac60eb.js +1 -0
  135. package/assets/esri/core/workers/chunks/{6e45d0db97ffa4509177.js → 94bf7f0da6ad3f7ea277.js} +1 -1
  136. package/assets/esri/core/workers/chunks/{580451761cadfe308919.js → 9954149def644c371894.js} +1 -1
  137. package/assets/esri/core/workers/chunks/9c57161ad48d8d546dc7.js +1 -0
  138. package/assets/esri/core/workers/chunks/{33bd9785bd0b6ccef21b.js → 9c5dff4f13102871786e.js} +1 -1
  139. package/assets/esri/core/workers/chunks/9d0bda096cdbd7e22f4b.js +1 -0
  140. package/assets/esri/core/workers/chunks/9dfb7d120195991e9672.js +1 -0
  141. package/assets/esri/core/workers/chunks/9ed5e6b06afea6c85330.js +1 -0
  142. package/assets/esri/core/workers/chunks/9f65cc6d9f7390bb1d5b.js +1 -0
  143. package/assets/esri/core/workers/chunks/{79b857bb301f9c4169d6.js → 9fee8441fbac9f723f77.js} +1 -1
  144. package/assets/esri/core/workers/chunks/a108f276659d5f25352c.js +1 -0
  145. package/assets/esri/core/workers/chunks/a2d8bc0efddd2e13b1ad.js +1 -0
  146. package/assets/esri/core/workers/chunks/{b32ede7805c7c6644e4c.js → a3bf8aa81ee398da5b52.js} +1 -1
  147. package/assets/esri/core/workers/chunks/{5b30231ae0a8f4b8435f.js → a504fa17d83facf1c01f.js} +1 -1
  148. package/assets/esri/core/workers/chunks/{538fe46dfd685a490e23.js → a7f42ada0aa69873a938.js} +1 -1
  149. package/assets/esri/core/workers/chunks/a97e0b9b057664911c14.js +1 -0
  150. package/assets/esri/core/workers/chunks/{cb58aff1ff186fa18345.js → a9f616f22042b0dce8b9.js} +1 -1
  151. package/assets/esri/core/workers/chunks/{128799741dd3c6fc69b9.js → ac4131121230cfc14f21.js} +1 -1
  152. package/assets/esri/core/workers/chunks/afd63c18ce4656271c8e.js +1 -0
  153. package/assets/esri/core/workers/chunks/{f04cb48fc73635d0572f.js → b059dabb1c732829487c.js} +1 -1
  154. package/assets/esri/core/workers/chunks/b13d2da33ec07e9d41ff.js +1 -0
  155. package/assets/esri/core/workers/chunks/b313464b987db8a3987a.js +1 -0
  156. package/assets/esri/core/workers/chunks/b318823aefcefad6fad5.js +1 -0
  157. package/assets/esri/core/workers/chunks/b378e504a5b1afc8d0ce.js +1 -0
  158. package/assets/esri/core/workers/chunks/{9fb87a7dba62b527c0ba.js → b3a1a93c6dc9247cb048.js} +1 -1
  159. package/assets/esri/core/workers/chunks/b5397dc03fa0bd654ba6.js +1 -0
  160. package/assets/esri/core/workers/chunks/b5b698008b8f3f4d5d61.js +1 -0
  161. package/assets/esri/core/workers/chunks/b7bcb31737b01d7736d0.js +1 -0
  162. package/assets/esri/core/workers/chunks/b9a1046ca2cd0cca5da5.js +1 -0
  163. package/assets/esri/core/workers/chunks/{cda04571d7623c17ada2.js → b9c7aa04861f545a559c.js} +1 -1
  164. package/assets/esri/core/workers/chunks/{7df795bc4fa1d433463b.js → ba030767cf935f967454.js} +1 -1
  165. package/assets/esri/core/workers/chunks/{53d165b4f30fd64e5d8a.js → bd311c85437743cf7d2f.js} +1 -1
  166. package/assets/esri/core/workers/chunks/bd88228f781a0399d8bd.js +1 -0
  167. package/assets/esri/core/workers/chunks/bfb626805405646a0419.js +1 -0
  168. package/assets/esri/core/workers/chunks/{61d3fcb419d6bf7e355e.js → c1e45e24f5ef719a714c.js} +18 -18
  169. package/assets/esri/core/workers/chunks/c203df41f9d2e4b80889.js +1 -0
  170. package/assets/esri/core/workers/chunks/{278409028bc5af45b507.js → c4c83b5129c279c3615b.js} +1 -1
  171. package/assets/esri/core/workers/chunks/c53b2be005721591e29b.js +1 -0
  172. package/assets/esri/core/workers/chunks/c6ef0636073e28350c91.js +1 -0
  173. package/assets/esri/core/workers/chunks/c7e391df714839484cd1.js +1 -0
  174. package/assets/esri/core/workers/chunks/{e287113777a94ded8de6.js → c82ab4f0908290e70ee9.js} +1 -1
  175. package/assets/esri/core/workers/chunks/cded485ad893a7dd2948.js +1 -0
  176. package/assets/esri/core/workers/chunks/{1cf8fb704c48ac3d3b15.js → cf360767310fb45660a8.js} +1 -1
  177. package/assets/esri/core/workers/chunks/{8f2fecd8a0a972d68590.js → cf8ce63711488f2e677c.js} +1 -1
  178. package/assets/esri/core/workers/chunks/d214ac457ac970479536.js +1 -0
  179. package/assets/esri/core/workers/chunks/d4058352db1e8255b52e.js +1 -0
  180. package/assets/esri/core/workers/chunks/d456520e4b119a2816b6.js +1 -0
  181. package/assets/esri/core/workers/chunks/d4d385d19e62ef1c286f.js +1 -0
  182. package/assets/esri/core/workers/chunks/d4f005dadba75422b401.js +1 -0
  183. package/assets/esri/core/workers/chunks/{52c4b4dabcb0d162be72.js → d5e15021928e95c11463.js} +1 -1
  184. package/assets/esri/core/workers/chunks/{fc639c730115e07a4a1a.js → d6500f6b2ff115d9eb09.js} +1 -1
  185. package/assets/esri/core/workers/chunks/e02f02040b63d9c2e654.js +1 -0
  186. package/assets/esri/core/workers/chunks/e08c64e4ae5a68eae2be.js +1 -0
  187. package/assets/esri/core/workers/chunks/e1492d2404c3ed82931e.js +1 -0
  188. package/assets/esri/core/workers/chunks/e2ddfc96ddba92302e0c.js +1 -0
  189. package/assets/esri/core/workers/chunks/e34ed3b818b2eb4116c5.js +1 -0
  190. package/assets/esri/core/workers/chunks/e7149d23615fee31ab7e.js +1 -0
  191. package/assets/esri/core/workers/chunks/ec774f5d6ea5c29536e5.js +1 -0
  192. package/assets/esri/core/workers/chunks/{35cbf00f0c37a86517af.js → ed1de8b7406269e217b9.js} +1 -1
  193. package/assets/esri/core/workers/chunks/ed4ac5568dc2815b066d.js +1 -0
  194. package/assets/esri/core/workers/chunks/ed71a4e353715db0a6e9.js +1 -0
  195. package/assets/esri/core/workers/chunks/{f4891345507df63cff3c.js → ef27bf1d7941ae265ca4.js} +3 -3
  196. package/assets/esri/core/workers/chunks/f029c12f1afee0e9b2a1.js +1 -0
  197. package/assets/esri/core/workers/chunks/{1e342d532925569daadb.js → f475672ff4c2ec9367c2.js} +1 -1
  198. package/assets/esri/core/workers/chunks/{cc414fd2e313d89d524d.js → f54eba484f40d5eeb590.js} +1 -1
  199. package/assets/esri/core/workers/chunks/f5c9659fc5d571d501c9.js +1 -0
  200. package/assets/esri/core/workers/chunks/f622b27ebdf1c918fd6d.js +1 -0
  201. package/assets/esri/core/workers/chunks/{dd95f50dac3f33cdb6d2.js → f6a13f07a5f7b781a9a8.js} +1 -1
  202. package/assets/esri/core/workers/chunks/{d849bdaf5bdfdc37531a.js → f6f7d885b4d6080e3f58.js} +1 -1
  203. package/assets/esri/core/workers/chunks/f8b8d3d2710c83acccf3.js +1 -0
  204. package/assets/esri/core/workers/chunks/f95870bb4d8e4e13e69e.js +1 -0
  205. package/assets/esri/core/workers/chunks/fa377112ef3b78f6ed18.js +1 -0
  206. package/assets/esri/core/workers/chunks/fa59f10ed0f182a2a7f3.js +1 -0
  207. package/assets/esri/core/workers/chunks/faa55265020591fd2224.js +1 -0
  208. package/assets/esri/core/workers/chunks/fc827f58db3194922056.js +1 -0
  209. package/chunks/VolumeMask.glsl.js +3 -0
  210. package/chunks/_commonjsHelpers.js +1 -1
  211. package/chunks/aiServices.js +1 -1
  212. package/chunks/array.js +1 -1
  213. package/chunks/languageUtils.js +1 -1
  214. package/chunks/persistableUrlUtils.js +1 -1
  215. package/config.js +1 -1
  216. package/core/Collection.d.ts +42 -6
  217. package/core/Collection.js +1 -1
  218. package/form/ExpressionInfo.d.ts +1 -1
  219. package/form/ExpressionInfo.js +1 -1
  220. package/form/elements/FieldElement.d.ts +3 -2
  221. package/form/elements/inputs/ComboBoxInput.d.ts +4 -15
  222. package/form/elements/inputs/ComboBoxInput.js +1 -1
  223. package/form/elements/inputs/DynamicChoiceInput.d.ts +31 -0
  224. package/form/elements/inputs/DynamicChoiceInput.js +2 -0
  225. package/form/elements/inputs/Input.d.ts +1 -1
  226. package/form/elements/inputs/RadioButtonsInput.d.ts +4 -15
  227. package/form/elements/inputs/RadioButtonsInput.js +1 -1
  228. package/form/elements/inputs/SingleChoiceInput.d.ts +18 -0
  229. package/form/elements/inputs/SingleChoiceInput.js +2 -0
  230. package/form/elements/inputs.d.ts +11 -2
  231. package/form/elements/inputs.js +1 -1
  232. package/geometry/SpatialReference.d.ts +1 -4
  233. package/geometry/support/normalizeUtils.d.ts +1 -1
  234. package/kernel.js +1 -1
  235. package/layers/BaseElevationLayer.js +1 -1
  236. package/layers/ElevationLayer.js +1 -1
  237. package/layers/ImageryTileLayer.d.ts +1 -1
  238. package/layers/IntegratedMesh3DTilesLayer.js +1 -1
  239. package/layers/KnowledgeGraphLayer.js +1 -1
  240. package/layers/Lyr3DWasmPerSceneView.js +1 -1
  241. package/layers/RouteLayer.d.ts +1 -1
  242. package/layers/StreamLayer.js +1 -1
  243. package/layers/VoxelWasmPerSceneView.js +1 -1
  244. package/layers/graphics/sources/connections/createConnection.js +1 -1
  245. package/layers/graphics/sources/parquet/ParquetFileStatistics.js +1 -1
  246. package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
  247. package/layers/graphics/sources/support/QueryTask.js +1 -1
  248. package/layers/mixins/ArcGISImageService.d.ts +24 -24
  249. package/layers/mixins/SceneService.js +1 -1
  250. package/layers/mixins/TiledImagery.d.ts +1 -1
  251. package/layers/orientedImagery/transformations/rectifyMapPoint.js +1 -1
  252. package/layers/raster/datasets/BaseRaster.js +1 -1
  253. package/layers/save/groupLayerUtils.js +1 -1
  254. package/layers/save/mediaLayerUtils.js +1 -1
  255. package/layers/support/ElevationQueryTileCache.js +1 -1
  256. package/layers/video/VideoController.js +1 -1
  257. package/layers/video/types.d.ts +17 -1
  258. package/linkChart/LinkChartProperties.js +1 -1
  259. package/networks/support/CircuitExportJobInfo.d.ts +1 -1
  260. package/networks/support/CircuitVerifyJobInfo.d.ts +1 -1
  261. package/networks/support/TopologyValidationJobInfo.d.ts +1 -1
  262. package/networks/support/TraceJobInfo.d.ts +1 -1
  263. package/package.json +2 -2
  264. package/portal/jsonTypes.d.ts +1 -1
  265. package/portal/support/jsonContext.js +1 -1
  266. package/rest/closestFacility.d.ts +1 -1
  267. package/rest/find.d.ts +1 -1
  268. package/rest/geometryService.d.ts +21 -21
  269. package/rest/geoprocessor.d.ts +2 -2
  270. package/rest/identify.d.ts +1 -1
  271. package/rest/imageService.d.ts +19 -19
  272. package/rest/lastMileDelivery.d.ts +8 -8
  273. package/rest/locator.d.ts +4 -4
  274. package/rest/networkService.d.ts +1 -1
  275. package/rest/networks/queryAssociations.d.ts +1 -1
  276. package/rest/networks/synthesizeAssociationGeometries.d.ts +1 -1
  277. package/rest/networks/trace.d.ts +1 -1
  278. package/rest/networks/traverseAssociations.d.ts +1 -1
  279. package/rest/places.d.ts +3 -3
  280. package/rest/print.d.ts +1 -1
  281. package/rest/query.d.ts +11 -11
  282. package/rest/route.d.ts +1 -1
  283. package/rest/serviceArea.d.ts +1 -1
  284. package/rest/support/JobInfo.d.ts +5 -5
  285. package/rest/symbolService.d.ts +1 -1
  286. package/support/persistableUrlUtils.js +1 -1
  287. package/support/revision.js +1 -1
  288. package/views/2d/layers/features/sources/strategies/AFeatureLoadStrategy.js +1 -1
  289. package/views/2d/layers/features/sources/strategies/FeatureHybridTileLoadStrategy.js +1 -1
  290. package/views/3d/GroundView3D.js +1 -1
  291. package/views/3d/analysis/LineOfSight/LineOfSightReshapeTool3D.js +1 -1
  292. package/views/3d/analysis/LineOfSight/LineOfSightTool.js +1 -1
  293. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillController.js +1 -1
  294. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementShiftTool.js +1 -1
  295. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  296. package/views/3d/layers/graphics/Graphics3DPathSymbolLayer.js +1 -1
  297. package/views/3d/layers/graphics/Graphics3DPathSymbolLayerConstants.js +1 -1
  298. package/views/3d/layers/graphics/defaultSymbolComplexity.js +1 -1
  299. package/views/3d/layers/i3s/I3SIntersectionHandler.js +1 -1
  300. package/views/3d/layers/i3s/PointCloudRenderer.js +1 -1
  301. package/views/3d/layers/support/Tiles3DMeshIntersectionHandler.js +1 -1
  302. package/views/3d/state/helpers/SceneIntersectionHelper.js +1 -1
  303. package/views/3d/support/gaussianSplatting/GaussianSplatHeaderTexture.js +1 -1
  304. package/views/3d/support/gaussianSplatting/GaussianSplatIntersectionHandler.js +1 -1
  305. package/views/3d/support/hitTest.js +1 -1
  306. package/views/3d/support/pointsOfInterest/CameraOnSurface.js +1 -1
  307. package/views/3d/support/pointsOfInterest/PointsOfInterest.js +1 -1
  308. package/views/3d/support/pointsOfInterest/StableSurfaceCenter.js +1 -1
  309. package/views/3d/terrain/TerrainRenderer.js +1 -1
  310. package/views/3d/terrain/TerrainSurface.js +1 -1
  311. package/views/3d/webgl-engine/collections/Component/ComponentObjectElevationAgnosticBVH.js +1 -1
  312. package/views/3d/webgl-engine/collections/Component/ComponentObjectFixedBVH.js +1 -1
  313. package/views/3d/webgl-engine/collections/Component/IntersectionGeometry.js +1 -1
  314. package/views/3d/webgl-engine/core/shaderLibrary/TextureBackedBufferFields.glsl.js +1 -1
  315. package/views/3d/webgl-engine/core/shaderLibrary/attributes/PathEvaluate.glsl.js +49 -32
  316. package/views/3d/webgl-engine/core/shaderLibrary/attributes/PathVertexInfo.glsl.js +5 -5
  317. package/views/3d/webgl-engine/core/shaderLibrary/attributes/PathVertexPosition.glsl.js +23 -23
  318. package/views/3d/webgl-engine/effects/focusArea/FocusAreaMask.js +1 -1
  319. package/views/3d/webgl-engine/lib/CutFillVisualization.js +1 -1
  320. package/views/3d/webgl-engine/lib/GaussianSplatRenderer.js +1 -1
  321. package/views/3d/webgl-engine/lib/Intersector.js +1 -1
  322. package/views/3d/webgl-engine/lib/IntersectorResult.js +1 -1
  323. package/views/3d/webgl-engine/lib/PathBuilder.js +1 -1
  324. package/views/3d/webgl-engine/lib/PathEvaluator.js +1 -1
  325. package/views/3d/webgl-engine/lib/PathExtruder.js +1 -1
  326. package/views/3d/webgl-engine/lib/RayIntersections.js +1 -1
  327. package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
  328. package/views/3d/webgl-engine/lib/SortedRenderGeometryRenderer.js +1 -1
  329. package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBackedBufferFieldCreation.js +1 -1
  330. package/views/3d/webgl-engine/lib/lodRendering/LodResources.js +1 -1
  331. package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
  332. package/views/3d/webgl-engine/materials/HeatmapDensityMaterial.js +1 -1
  333. package/views/3d/webgl-engine/materials/NativeLineMaterial.js +1 -1
  334. package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
  335. package/views/3d/webgl-engine/materials/PathTechniqueConfiguration.js +1 -1
  336. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  337. package/views/3d/webgl-engine/materials/intersectWithPolygonOffset.js +1 -1
  338. package/views/3d/webgl-engine/shaders/ShadowCastMaskTechnique.js +1 -1
  339. package/views/3d/webgl-engine/shaders/{CutFillMask.glsl.js → VolumeMask.glsl.js} +1 -1
  340. package/views/3d/webgl-engine/shaders/VolumeMaskTechnique.js +2 -0
  341. package/views/draw/support/InteractiveHandle.js +1 -1
  342. package/views/draw/support/managers/SurfaceManager.js +1 -1
  343. package/views/interactive/Tooltip.d.ts +3 -3
  344. package/views/interactive/Tooltip.js +1 -1
  345. package/views/interactive/options/ElevationOptions.d.ts +20 -0
  346. package/views/interactive/options/ElevationOptions.js +2 -0
  347. package/views/interactive/options/LabelOptions.d.ts +74 -0
  348. package/views/interactive/options/LabelOptions.js +2 -0
  349. package/views/interactive/options/SnappingOptions.d.ts +157 -0
  350. package/views/interactive/options/SnappingOptions.js +2 -0
  351. package/views/interactive/options/TooltipOptions.d.ts +152 -0
  352. package/views/interactive/options/TooltipOptions.js +2 -0
  353. package/views/interactive/options/TooltipVisibleElements.d.ts +105 -0
  354. package/views/interactive/options/TooltipVisibleElements.js +2 -0
  355. package/views/interactive/options/ValueOptions.d.ts +63 -0
  356. package/views/interactive/options/ValueOptions.js +2 -0
  357. package/views/interactive/sketch/SketchLabelOptions.d.ts +7 -9
  358. package/views/interactive/sketch/SketchLabelOptions.js +1 -1
  359. package/views/interactive/sketch/SketchTooltipElevationOptions.js +1 -1
  360. package/views/interactive/sketch/SketchTooltipOptions.d.ts +8 -50
  361. package/views/interactive/sketch/SketchTooltipOptions.js +1 -1
  362. package/views/interactive/sketch/SketchTooltipVisibleElements.d.ts +10 -95
  363. package/views/interactive/sketch/SketchTooltipVisibleElements.js +1 -1
  364. package/views/interactive/sketch/SketchValueOptions.d.ts +7 -45
  365. package/views/interactive/sketch/SketchValueOptions.js +1 -1
  366. package/views/interactive/sketch/Units.d.ts +10 -29
  367. package/views/interactive/sketch/Units.js +1 -1
  368. package/views/interactive/snapping/SnappingOptions.d.ts +7 -78
  369. package/views/interactive/snapping/SnappingOptions.js +1 -1
  370. package/views/interactive/support/Units.d.ts +33 -0
  371. package/views/interactive/support/Units.js +2 -0
  372. package/views/interactive/support/types.d.ts +33 -0
  373. package/views/interactive/tooltip/types.d.ts +6 -2
  374. package/webdoc/support/resourceUtils.js +1 -1
  375. package/webdoc/support/types.d.ts +2 -0
  376. package/webdoc/support/utils.js +2 -0
  377. package/webdoc/support/webdocLoadUtils.js +1 -1
  378. package/webdoc/support/webdocSaveUtils.js +1 -1
  379. package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
  380. package/widgets/BatchAttributeForm/batchAttributeFormUtils.js +1 -1
  381. package/widgets/BatchAttributeForm/expressions/ArcadeExecutorProvider.js +1 -1
  382. package/widgets/BatchAttributeForm/expressions/ExpressionsManager.js +1 -1
  383. package/widgets/BatchAttributeForm/expressions/ExpressionsModel.js +1 -1
  384. package/widgets/BatchAttributeForm/inputs/AttachmentElementInput.js +1 -1
  385. package/widgets/BatchAttributeForm/inputs/BatchFormInputs.js +1 -1
  386. package/widgets/BatchAttributeForm/inputs/FieldInput.js +1 -1
  387. package/widgets/BatchAttributeForm/inputs/RelationshipElementInput.js +1 -1
  388. package/widgets/BatchAttributeForm/inputs/support/inputUtils.js +1 -1
  389. package/widgets/BatchAttributeForm/rendered-content/RelationshipDetails.js +1 -1
  390. package/widgets/BatchAttributeForm/templates/support/createBatchFormTemplate.js +1 -1
  391. package/widgets/BatchAttributeForm.js +1 -1
  392. package/widgets/Editor/UpdateWorkflow.js +1 -1
  393. package/widgets/Editor.js +1 -1
  394. package/widgets/FeatureForm.js +1 -1
  395. package/widgets/FeatureTable/Grid/Column.d.ts +6 -0
  396. package/widgets/Legend/support/ActiveLayerInfo.js +1 -1
  397. package/widgets/Sketch/SketchViewModel.js +1 -1
  398. package/widgets/support/SelectionList/FeatureItem.d.ts +116 -0
  399. package/widgets/support/SelectionList/GroupLayerItem.d.ts +94 -0
  400. package/widgets/support/SelectionList/ItemBase.d.ts +70 -0
  401. package/widgets/support/SelectionList/LayerItem.d.ts +140 -0
  402. package/widgets/support/SelectionList/LayerItem.js +1 -1
  403. package/widgets/support/SelectionList/SelectionListViewModel.d.ts +265 -0
  404. package/widgets/support/SelectionList/SelectionListViewModel.js +1 -1
  405. package/widgets/support/SelectionList/types.d.ts +42 -0
  406. package/widgets/support/forms/formUtils.js +1 -1
  407. package/assets/esri/core/workers/chunks/003a87b16f8a4b476e14.js +0 -1
  408. package/assets/esri/core/workers/chunks/069b6d8bdb34ee88d437.js +0 -1
  409. package/assets/esri/core/workers/chunks/0790bf0eb276cd9166f6.js +0 -1
  410. package/assets/esri/core/workers/chunks/0a50efb07eee36237e21.js +0 -1
  411. package/assets/esri/core/workers/chunks/0ae0483b72f5e8d00d55.js +0 -1
  412. package/assets/esri/core/workers/chunks/0d1224693a62a26a0e72.js +0 -1
  413. package/assets/esri/core/workers/chunks/10b367563f894ceb9864.js +0 -1
  414. package/assets/esri/core/workers/chunks/11e00ca5ac1b004f4ecc.js +0 -1
  415. package/assets/esri/core/workers/chunks/129fdd1636e67997337c.js +0 -1
  416. package/assets/esri/core/workers/chunks/12e0c5b7cc5c3f9e6f0f.js +0 -1
  417. package/assets/esri/core/workers/chunks/13033178de9f637a2356.js +0 -1
  418. package/assets/esri/core/workers/chunks/13c893e448bedc5c1cef.js +0 -1
  419. package/assets/esri/core/workers/chunks/147a89553188cc6aabf4.js +0 -1
  420. package/assets/esri/core/workers/chunks/15c2d9bec0455fc363a9.js +0 -1
  421. package/assets/esri/core/workers/chunks/246cd372d4184233f48e.js +0 -1
  422. package/assets/esri/core/workers/chunks/268ab65afc3fce775ad2.js +0 -1
  423. package/assets/esri/core/workers/chunks/26a2d4b95cda0a41d980.js +0 -1
  424. package/assets/esri/core/workers/chunks/26f1fd3f2be5102aae1d.js +0 -1
  425. package/assets/esri/core/workers/chunks/279a9a38b04a21cdfd11.js +0 -1
  426. package/assets/esri/core/workers/chunks/3406a01dad6338e3c548.js +0 -1
  427. package/assets/esri/core/workers/chunks/34fbeeeeef4bd01672c6.js +0 -1
  428. package/assets/esri/core/workers/chunks/36781219ca9ba5d7fe52.js +0 -1
  429. package/assets/esri/core/workers/chunks/36999a2e383c8eb3c398.js +0 -1
  430. package/assets/esri/core/workers/chunks/36f8a912842181e1f0aa.js +0 -1
  431. package/assets/esri/core/workers/chunks/36fe6adf6517d8f80125.js +0 -1
  432. package/assets/esri/core/workers/chunks/3f1a7f8a9ead64bf0b7b.js +0 -1
  433. package/assets/esri/core/workers/chunks/403f08e0c1a9203f7fba.js +0 -1
  434. package/assets/esri/core/workers/chunks/461c2de938bf4c9b1442.js +0 -1
  435. package/assets/esri/core/workers/chunks/478540265c86436da05e.js +0 -1
  436. package/assets/esri/core/workers/chunks/479f486ec1797629ec70.js +0 -1
  437. package/assets/esri/core/workers/chunks/484b3e2a220c440ccbb4.js +0 -1
  438. package/assets/esri/core/workers/chunks/4a340836ddbc856993f2.js +0 -1
  439. package/assets/esri/core/workers/chunks/4f2170609742b51bd7b8.js +0 -1
  440. package/assets/esri/core/workers/chunks/4f59357f535f30a6b5cc.js +0 -1
  441. package/assets/esri/core/workers/chunks/5133083222588799493f.js +0 -1
  442. package/assets/esri/core/workers/chunks/52993a9dc0c56e9bda19.js +0 -1
  443. package/assets/esri/core/workers/chunks/57b07448da06d0302a46.js +0 -1
  444. package/assets/esri/core/workers/chunks/5a9ff50fdcc99ae28cce.js +0 -1
  445. package/assets/esri/core/workers/chunks/5dc17b76c6ecc24e7b9a.js +0 -1
  446. package/assets/esri/core/workers/chunks/5e35828216020f33e26b.js +0 -1
  447. package/assets/esri/core/workers/chunks/5eb6f37c74a217772eca.js +0 -1
  448. package/assets/esri/core/workers/chunks/5f0d6c853873a7f32527.js +0 -1
  449. package/assets/esri/core/workers/chunks/6121cd0264b6841a5bac.js +0 -1
  450. package/assets/esri/core/workers/chunks/6210fb6cd31844f23964.js +0 -1
  451. package/assets/esri/core/workers/chunks/638ed1297efdb24f4711.js +0 -1
  452. package/assets/esri/core/workers/chunks/64247e439ef3e1f712e9.js +0 -1
  453. package/assets/esri/core/workers/chunks/661a59133ae34f172174.js +0 -1
  454. package/assets/esri/core/workers/chunks/6823ba1688dfedba0107.js +0 -1
  455. package/assets/esri/core/workers/chunks/6c2b5087a9df65267f4e.js +0 -1
  456. package/assets/esri/core/workers/chunks/6d247ff53421d27628ce.js +0 -1
  457. package/assets/esri/core/workers/chunks/700c08dd2e734c15e621.js +0 -1
  458. package/assets/esri/core/workers/chunks/70452f6d63e9be8d03dd.js +0 -1
  459. package/assets/esri/core/workers/chunks/705d6b108fd121cea887.js +0 -1
  460. package/assets/esri/core/workers/chunks/733b2e181683d5fc7c95.js +0 -1
  461. package/assets/esri/core/workers/chunks/73aa1bfa6e1dc271c9d7.js +0 -1
  462. package/assets/esri/core/workers/chunks/7659391f952d134164cf.js +0 -1
  463. package/assets/esri/core/workers/chunks/7889f4a17cf249f2acc5.js +0 -1
  464. package/assets/esri/core/workers/chunks/7a2dcd57849048c6e00d.js +0 -1
  465. package/assets/esri/core/workers/chunks/7a2dfa42610fe8414ed7.js +0 -1
  466. package/assets/esri/core/workers/chunks/7ce52b850dd785bfa33f.js +0 -1
  467. package/assets/esri/core/workers/chunks/81accb1820e2735fa376.js +0 -1
  468. package/assets/esri/core/workers/chunks/8210fc9e072209e26fa9.js +0 -1
  469. package/assets/esri/core/workers/chunks/825eb845216762a1ed2f.js +0 -1
  470. package/assets/esri/core/workers/chunks/83991475aa54fd5aa008.js +0 -1
  471. package/assets/esri/core/workers/chunks/84fa102a93b2144c28fb.js +0 -1
  472. package/assets/esri/core/workers/chunks/85ce7673d42526a79fd2.js +0 -1
  473. package/assets/esri/core/workers/chunks/8722e2790272e90a1897.js +0 -1
  474. package/assets/esri/core/workers/chunks/88df19742edb0cdc3e67.js +0 -1
  475. package/assets/esri/core/workers/chunks/8977c85aecc7e08ab13c.js +0 -1
  476. package/assets/esri/core/workers/chunks/8a1970e68bc1e833cb7f.js +0 -1
  477. package/assets/esri/core/workers/chunks/8bb20ef549ec1c86b38e.js +0 -1
  478. package/assets/esri/core/workers/chunks/8bdca809dd88eab9e5d8.js +0 -29
  479. package/assets/esri/core/workers/chunks/8c5726c7ce40a92901e6.js +0 -1
  480. package/assets/esri/core/workers/chunks/8c5e65982c3f9295e844.js +0 -1
  481. package/assets/esri/core/workers/chunks/8ce649e55fefc8eca55c.js +0 -1
  482. package/assets/esri/core/workers/chunks/90ae80b797642bff0efa.js +0 -1
  483. package/assets/esri/core/workers/chunks/94e9cf8e729ec36de5be.js +0 -1
  484. package/assets/esri/core/workers/chunks/97c758f736f28c5dab84.js +0 -1
  485. package/assets/esri/core/workers/chunks/98b27cf8acbfa4259758.js +0 -1
  486. package/assets/esri/core/workers/chunks/9a6208ab670ad74e6f7d.js +0 -1
  487. package/assets/esri/core/workers/chunks/a10f63a08d976be058be.js +0 -1
  488. package/assets/esri/core/workers/chunks/a494abeb026d536d9fae.js +0 -1
  489. package/assets/esri/core/workers/chunks/a5f058567419ea70dff6.js +0 -1
  490. package/assets/esri/core/workers/chunks/a8ade34612e73862de6f.js +0 -1
  491. package/assets/esri/core/workers/chunks/a9d391071803b1e9e8a0.js +0 -1
  492. package/assets/esri/core/workers/chunks/aa3abc07de2921ef6ca1.js +0 -1
  493. package/assets/esri/core/workers/chunks/b03f09ee2224f0cc526a.js +0 -1
  494. package/assets/esri/core/workers/chunks/b3f1a442d6b7826e917f.js +0 -1
  495. package/assets/esri/core/workers/chunks/b5c7813495657f844171.js +0 -1
  496. package/assets/esri/core/workers/chunks/b7170816736769d3b7b0.js +0 -1
  497. package/assets/esri/core/workers/chunks/b819a9187426d0c146df.js +0 -1
  498. package/assets/esri/core/workers/chunks/b8e5d7aefddddbd0a10c.js +0 -1
  499. package/assets/esri/core/workers/chunks/b958f87f23f984131d09.js +0 -1
  500. package/assets/esri/core/workers/chunks/b9f40681af1fa00b5bbe.js +0 -1
  501. package/assets/esri/core/workers/chunks/c4c25db769a78e677e33.js +0 -1
  502. package/assets/esri/core/workers/chunks/c85ba0700eafdc8d6f9e.js +0 -1
  503. package/assets/esri/core/workers/chunks/ca118c42c0f609ca7912.js +0 -1
  504. package/assets/esri/core/workers/chunks/cb17cd8aaf77238c0236.js +0 -1
  505. package/assets/esri/core/workers/chunks/d03f427442bb0c287d05.js +0 -1
  506. package/assets/esri/core/workers/chunks/d08d3c6f21e6ba8268ca.js +0 -1
  507. package/assets/esri/core/workers/chunks/d37a72111dffc4c4db70.js +0 -1
  508. package/assets/esri/core/workers/chunks/d41ab2abcfacc87809b5.js +0 -1
  509. package/assets/esri/core/workers/chunks/d4ed094962a41d756c95.js +0 -1
  510. package/assets/esri/core/workers/chunks/d51c41c1944df0cbab3e.js +0 -1
  511. package/assets/esri/core/workers/chunks/dc24e80d061f7b063608.js +0 -1
  512. package/assets/esri/core/workers/chunks/df30053a10d4930924d5.js +0 -1
  513. package/assets/esri/core/workers/chunks/e3623e557ab463580fd2.js +0 -1
  514. package/assets/esri/core/workers/chunks/e5bb7ee670a3ba5ba3fe.js +0 -1
  515. package/assets/esri/core/workers/chunks/e5c75459de85a6dd2f14.js +0 -1
  516. package/assets/esri/core/workers/chunks/e798ca23f02a2dd65bd4.js +0 -1
  517. package/assets/esri/core/workers/chunks/f0225829f7d941914815.js +0 -1
  518. package/assets/esri/core/workers/chunks/f1299b4fc760ccca1518.js +0 -1
  519. package/assets/esri/core/workers/chunks/f65adaaa33d9f3b131f6.js +0 -1
  520. package/assets/esri/core/workers/chunks/f7fa932ade85cb2847b6.js +0 -1
  521. package/assets/esri/core/workers/chunks/f9b654f801cb416e9e17.js +0 -1
  522. package/assets/esri/core/workers/chunks/fb34d6d96c8c0d53fcf6.js +0 -1
  523. package/assets/esri/core/workers/chunks/fdec3a2e100688c42e41.js +0 -1
  524. package/assets/esri/core/workers/chunks/fefbde2c2e527bb716ee.js +0 -1
  525. package/chunks/CutFillMask.glsl.js +0 -3
  526. package/chunks/FocusAreaMask.glsl.js +0 -3
  527. package/views/3d/webgl-engine/effects/focusArea/FocusAreaMask.glsl.js +0 -2
  528. package/views/3d/webgl-engine/effects/focusArea/FocusAreaMaskTechnique.js +0 -2
  529. package/views/3d/webgl-engine/shaders/CutFillMaskTechnique.js +0 -2
  530. /package/assets/esri/core/workers/chunks/{a12803108c3b12808698.js.LICENSE.txt → 242cad472fbc38b24dbc.js.LICENSE.txt} +0 -0
@@ -1,13 +1,8 @@
1
- import type Accessor from "../../../core/Accessor.js";
2
- import type Collection from "../../../core/Collection.js";
3
- import type FeatureSnappingLayerSource from "./FeatureSnappingLayerSource.js";
4
- import type { FeatureSnappingLayerSourceProperties } from "./FeatureSnappingLayerSource.js";
5
- import type { ReadonlyArrayOrCollection } from "../../../core/Collection.js";
1
+ import type BaseSnappingOptions from "../options/SnappingOptions.js";
2
+ import type { SnappingOptionsProperties as BaseSnappingOptionsProperties } from "../options/SnappingOptions.js";
6
3
 
7
- export interface SnappingOptionsProperties extends Partial<Pick<SnappingOptions, "attributeRulesEnabled" | "distance" | "enabled" | "featureEnabled" | "gridEnabled" | "selfEnabled">> {
8
- /** List of sources for feature snapping. Please refer to [FeatureSnappingLayerSource](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/snapping/FeatureSnappingLayerSource/) for additional information on what layer sources are supported. */
9
- featureSources?: ReadonlyArrayOrCollection<FeatureSnappingLayerSourceProperties>;
10
- }
4
+ /** @deprecated since 5.2. Use [SnappingOptionsProperties](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/options/SnappingOptions/#SnappingOptionsProperties) instead. */
5
+ export interface SnappingOptionsProperties extends BaseSnappingOptionsProperties {}
11
6
 
12
7
  /**
13
8
  * The `SnappingOptions` allows users to configure snapping for their editing or drawing experience in both the [Sketch.snappingOptions](https://developers.arcgis.com/javascript/latest/references/core/widgets/Sketch/#snappingOptions) and [Editor.snappingOptions](https://developers.arcgis.com/javascript/latest/references/core/widgets/Editor/#snappingOptions) widgets.
@@ -46,6 +41,7 @@ export interface SnappingOptionsProperties extends Partial<Pick<SnappingOptions,
46
41
  * Extension | Snap to an extension of the current shape | <img alt="Extension" src="https://developers.arcgis.com/javascript/latest/assets/references/core/widgets/sketch/snapping-extension.avif" width="268px"> | <img alt="Extension-2" src="https://developers.arcgis.com/javascript/latest/assets/references/core/widgets/sketch/snapping-extension-2.avif" width="268px"> |
47
42
  * Vertex (as seen when updating geometries)| Snap vertices to an existing vertex | <img alt="Vertex" src="https://developers.arcgis.com/javascript/latest/assets/references/core/widgets/sketch/snapping-vertex-3d.avif" width="143px"> | <img alt="Vertex-2" src="https://developers.arcgis.com/javascript/latest/assets/references/core/widgets/sketch/snapping-vertex-2.avif" width="143px"> |
48
43
  *
44
+ * @deprecated since 5.2. Use [SnappingOptions](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/options/SnappingOptions/) instead.
49
45
  * @since 4.19
50
46
  * @see [FeatureSnappingLayerSource](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/snapping/FeatureSnappingLayerSource/)
51
47
  * @see [Sketch](https://developers.arcgis.com/javascript/latest/references/core/widgets/Sketch/)
@@ -70,74 +66,7 @@ export interface SnappingOptionsProperties extends Partial<Pick<SnappingOptions,
70
66
  * }
71
67
  * });
72
68
  */
73
- export default class SnappingOptions extends Accessor {
69
+ export default class SnappingOptions extends BaseSnappingOptions {
70
+ /** @since 5.2 */
74
71
  constructor(properties?: SnappingOptionsProperties);
75
- /**
76
- * When true, enables support for attribute rule-based snapping.
77
- * When enabled, resources needed for rule-based snapping, including any Utility Networks present
78
- * in the map, will be automatically loaded.
79
- *
80
- * @default false
81
- * @since 4.30
82
- */
83
- accessor attributeRulesEnabled: boolean;
84
- /**
85
- * Snapping distance for snapping in pixels.
86
- *
87
- * @default 5
88
- */
89
- accessor distance: number;
90
- /**
91
- * Global configuration to turn snapping on or off. Note that snapping is
92
- * turned off by default.
93
- *
94
- * @default false
95
- */
96
- accessor enabled: boolean;
97
- /**
98
- * Global configuration option to turn feature snapping on or off.
99
- *
100
- * @default true
101
- */
102
- accessor featureEnabled: boolean;
103
- /** List of sources for feature snapping. Please refer to [FeatureSnappingLayerSource](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/snapping/FeatureSnappingLayerSource/) for additional information on what layer sources are supported. */
104
- get featureSources(): Collection<FeatureSnappingLayerSource>;
105
- set featureSources(value: ReadonlyArrayOrCollection<FeatureSnappingLayerSourceProperties>);
106
- /**
107
- * Turns the grid on or off. The grid is a network of columns and rows used to divide the view into equal-area squares.
108
- * The [GridControls](https://developers.arcgis.com/javascript/latest/references/core/widgets/support/GridControls/) provides a user interface to interact and configure the grid's properties.
109
- *
110
- * > [!WARNING]
111
- * >
112
- * > **Note**
113
- * >
114
- * > It is recommended to wait for the view to be loaded first before setting the `gridEnabled` prop in the [GridControls](https://developers.arcgis.com/javascript/latest/references/core/widgets/support/GridControls/) constructor. The grid is dependent on the view to be loaded first for it to be displayed.
115
- * > - This grid is only supported in a 2D [MapView](https://developers.arcgis.com/javascript/latest/references/core/views/MapView/).
116
- *
117
- * @default false
118
- * @since 4.31
119
- * @see [GridControls](https://developers.arcgis.com/javascript/latest/references/core/widgets/support/GridControls/)
120
- * @example
121
- * // Turn on the grid programmatically for the GridControls.
122
- * // Wait for the view to load first.
123
- * view.when(() => {
124
- * const gridControls = new GridControls({
125
- * view,
126
- * snappingOptions: {
127
- * enabled: true,
128
- * gridEnabled: true
129
- * }
130
- * });
131
- * // Add GridControls to the view
132
- * view.ui.add(gridControls, "top-left");
133
- * });
134
- */
135
- accessor gridEnabled: boolean;
136
- /**
137
- * Global configuration option to turn self snapping (within one feature while
138
- * either drawing or reshaping) on or off.
139
- *
140
- * @default true
141
- */
142
- accessor selfEnabled: boolean;
143
72
  }
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../core/Accessor.js";import{difference as r}from"../../../core/arrayUtils.js";import o from"../../../core/Collection.js";import i from"../../../core/Logger.js";import{property as a,subclass as n}from"../../../core/accessorSupport/decorators.js";import s from"./FeatureSnappingLayerSource.js";import{defaults as l}from"./Settings.js";let u=class extends t{constructor(e){super(e),this.enabled=!1,this.enabledToggled=!1,this.forceDisabled=!1,this.selfEnabled=!0,this.featureEnabled=!0,this.gridEnabled=!1,this.attributeRulesEnabled=!1,this.featureSources=new o,this.distance=l.distance,this.touchSensitivityMultiplier=l.touchSensitivityMultiplier}get effectiveEnabled(){return!this.forceDisabled&&(this.enabledToggled?!this.enabled:this.enabled)}get effectiveGridEnabled(){return this.effectiveEnabled&&this.gridEnabled}get effectiveSelfEnabled(){return this.effectiveEnabled&&this.selfEnabled}get effectiveFeatureEnabled(){return this.effectiveEnabled&&this.featureEnabled}get _effectiveFeatureSources(){const e=this.featureSources;e.some(d)&&i.getLogger(this).warnOnce("Do not configure SubtypeGroupLayer sources in SnappingOptions.featureSources directly. Create a FeatureSnappingLayerSource for each SubtypeSublayer.");const t=e.filter(p),a=this._get("_effectiveFeatureSources")?.filter(d)??new o;for(const r of t){const e=a.find(e=>e.layer===r.layer.parent);if(e)e.sublayerSources.includes(r)||e.sublayerSources.add(r);else if(r.layer.parent){const e=new s({layer:r.layer.parent});e.sublayerSources.add(r),a.add(e)}}for(const r of a){const e=r.sublayerSources.filter(e=>!t.includes(e));r.sublayerSources.removeMany(e)}a.removeMany(a.filter(e=>0===e.sublayerSources.length));const n=e.filter(c),l=this._get("_effectiveFeatureSources")??new o,{added:u,removed:f}=r(l.toArray(),[...n,...a]);return l.removeMany(f),l.addMany(u),l}};function d(e){return"subtype-group"===e.layer.type}function c(e){return"subtype-group"!==e.layer.type}function p(e){return"subtype-sublayer"===e.layer.type}e([a()],u.prototype,"enabled",void 0),e([a()],u.prototype,"enabledToggled",void 0),e([a()],u.prototype,"forceDisabled",void 0),e([a()],u.prototype,"selfEnabled",void 0),e([a()],u.prototype,"featureEnabled",void 0),e([a()],u.prototype,"gridEnabled",void 0),e([a()],u.prototype,"attributeRulesEnabled",void 0),e([a({type:o.ofType(s)})],u.prototype,"featureSources",void 0),e([a()],u.prototype,"distance",void 0),e([a()],u.prototype,"touchSensitivityMultiplier",void 0),e([a({readOnly:!0})],u.prototype,"effectiveEnabled",null),e([a({readOnly:!0})],u.prototype,"effectiveGridEnabled",null),e([a({readOnly:!0})],u.prototype,"effectiveSelfEnabled",null),e([a({readOnly:!0})],u.prototype,"effectiveFeatureEnabled",null),e([a({readOnly:!0})],u.prototype,"_effectiveFeatureSources",null),u=e([n("esri.views.interactive.snapping.SnappingOptions")],u);export{u as default};
2
+ import{__decorate as o}from"tslib";import{subclass as s}from"../../../core/accessorSupport/decorators.js";import r from"../options/SnappingOptions.js";let t=class extends r{constructor(o){super(o)}};t=o([s("esri.views.interactive.snapping.SnappingOptions")],t);export{t as default};
@@ -0,0 +1,33 @@
1
+ import type Accessor from "../../../core/Accessor.js";
2
+ import type { SystemOrAreaUnit, SystemOrLengthUnit } from "../../../core/units.js";
3
+
4
+ /** @since 5.2 */
5
+ export interface UnitsProperties extends Partial<Pick<Units, "area" | "length" | "verticalLength">> {}
6
+
7
+ /**
8
+ * Units used for displaying or interpreting values in the UI while sketching, editing, or placing analyses.
9
+ *
10
+ * @since 5.2
11
+ */
12
+ export default class Units extends Accessor {
13
+ /** @since 5.2 */
14
+ constructor(properties?: UnitsProperties);
15
+ /**
16
+ * Area units.
17
+ *
18
+ * @since 5.2
19
+ */
20
+ accessor area: SystemOrAreaUnit | null | undefined;
21
+ /**
22
+ * Length units.
23
+ *
24
+ * @since 5.2
25
+ */
26
+ accessor length: SystemOrLengthUnit | null | undefined;
27
+ /**
28
+ * Vertical length units.
29
+ *
30
+ * @since 5.2
31
+ */
32
+ accessor verticalLength: SystemOrLengthUnit | null | undefined;
33
+ }
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import{__decorate as t}from"tslib";import o from"../../../core/Accessor.js";import{property as r,subclass as e}from"../../../core/accessorSupport/decorators.js";let s=class extends o{constructor(t){super(t),this.length=null,this.verticalLength=null,this.area=null}};t([r()],s.prototype,"length",void 0),t([r()],s.prototype,"verticalLength",void 0),t([r()],s.prototype,"area",void 0),s=t([e("esri.views.interactive.support.Units")],s);const i=s;export{i as default};
@@ -0,0 +1,33 @@
1
+ /**
2
+ * How direction values are displayed and, in case of input, how they are interpreted.
3
+ *
4
+ * - When set to "relative", the direction (also called deflection) is measured relative to the previous segment.
5
+ * Positive values are measured in a clockwise direction. Negative values are measured in a counterclockwise direction.
6
+ * - When set to "absolute", the direction is measured clockwise from the main axis of the map (typically north).
7
+ *
8
+ * The direction mode can be toggled in the [tooltip's](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/options/TooltipOptions/) UI, provided the input mode is active.
9
+ *
10
+ * @internal
11
+ * @since 5.2
12
+ */
13
+ export type DirectionMode = "relative" | "absolute";
14
+
15
+ /**
16
+ * Controls tooltip placement relative to the cursor while in feedback mode.
17
+ *
18
+ * @internal
19
+ * @since 5.2
20
+ */
21
+ export type Placement = "auto" | "bottom" | "bottom-end" | "bottom-start" | "leading" | "leading-end" | "leading-start" | "top" | "top-end" | "top-start" | "trailing" | "trailing-end" | "trailing-start";
22
+
23
+ /**
24
+ * Controls which fields are shown in the tooltip while drawing polygons and polylines.
25
+ *
26
+ * - In "auto" mode, fields switch based on the number of committed vertices.
27
+ * - In "coordinates" mode, x/longitude and y/latitude fields are shown.
28
+ * - In "direction-distance" mode, direction and distance fields are shown.
29
+ *
30
+ * @internal
31
+ * @since 5.2
32
+ */
33
+ export type XYMode = "auto" | "coordinates" | "direction-distance";
@@ -1,6 +1,7 @@
1
1
  import type { Angle, Area, Length, ScalarQuantity } from "../../../core/quantity.js";
2
2
  import type { AreaUnit, LengthUnit } from "../../../core/units.js";
3
3
  import type { InputUnitInfos } from "../sketch/types.js";
4
+ import type { DirectionMode } from "../support/types.js";
4
5
 
5
6
  /** @since 5.0 */
6
7
  export type TooltipMode = "feedback" | "input";
@@ -8,8 +9,11 @@ export type TooltipMode = "feedback" | "input";
8
9
  /** @internal */
9
10
  export type TooltipFieldName = "area" | "direction" | "distance" | "elevation" | "orientation" | "radius" | "rotation" | "scale" | "size" | "totalLength" | "x" | "y";
10
11
 
11
- /** @since 5.0 */
12
- export type TooltipDirectionMode = "relative" | "absolute";
12
+ /**
13
+ * @deprecated since 5.2, use [DirectionMode](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/support/types/#DirectionMode) instead.
14
+ * @since 5.0
15
+ */
16
+ export type TooltipDirectionMode = DirectionMode;
13
17
 
14
18
  /**
15
19
  * Formatting functions which can be used by fields to format their values into strings.
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import e from"../../core/Error.js";import{allSettledErrors as t,throwIfAborted as r,eachAlways as o}from"../../core/promiseUtils.js";import{generateUUID as s}from"../../core/uuid.js";import{getSiblingOfSameTypeI as a,contentToBlob as c}from"../../portal/support/resourceUtils.js";async function p(e,t,r){const o=await u(e,t,r);await h(o,t,r)}async function n(e,t,r,o,s){const a=await u(r,o,s);await e.update({data:t}),await h(a,o,s)}async function u(o,p,n){if(!p?.resources)return;const u=p.portalItem===o.portalItem?new Set(o.paths):new Set;o.paths.length=0,o.portalItem=p.portalItem;const h=new Set(p.resources.toKeep.map(e=>e.resource.path)),i=new Set,m=[];h.forEach(e=>{u.delete(e),o.paths.push(e)});const f=[],l=[],w=[];for(const e of p.resources.toUpdate)if(u.delete(e.resource.path),h.has(e.resource.path)||i.has(e.resource.path)){const{resource:t,content:r,finish:p}=e,n=a(t,s());o.paths.push(n.path),f.push({resource:n,content:await c(r),compress:e.compress}),p&&w.push(()=>p(n))}else{o.paths.push(e.resource.path),l.push({resource:e.resource,content:await c(e.content),compress:e.compress});const t=e.finish;t&&w.push(()=>t(e.resource)),i.add(e.resource.path)}for(const e of p.resources.toAdd)if(o.paths.push(e.resource.path),u.has(e.resource.path))u.delete(e.resource.path);else{f.push({resource:e.resource,content:await c(e.content),compress:e.compress});const t=e.finish;t&&w.push(()=>t(e.resource))}if(f.length||l.length){const{addOrUpdateResources:e}=await import("../../portal/support/resourceUtils.js");await e(p.portalItem,f,"add",n),await e(p.portalItem,l,"update",n)}if(w.forEach(e=>e()),0===m.length)return u;const d=await t(m);if(r(n),d.length>0)throw new e("save:resources","Failed to save one or more resources",{errors:d});return u}async function h(e,t,r){if(!e||!t.portalItem)return;const s=[];for(const o of e){const e=t.portalItem.resourceFromPath(o);s.push(e.portalItem.removeResource(e,r))}await o(s)}export{p as saveResources,n as updateItemWithResources};
2
+ import e from"../../core/Error.js";import{allSettledErrors as t,throwIfAborted as r,eachAlways as o}from"../../core/promiseUtils.js";import{generateUUID as s}from"../../core/uuid.js";import{getSiblingOfSameTypeI as a,contentToBlob as c}from"../../portal/support/resourceUtils.js";async function p(e,t,r){const o=await u(e,t,r);await h(o,t,r)}async function n(e,t,r,o,s){const a=await u(r,o,s);await e.update({data:t}),await h(a,o,s)}async function u(o,p,n){if(!p?.resources)return;const u=i(o,p)?new Set(o.paths):new Set;o.paths.length=0,o.portalItem=p.portalItem,o.portalItemResourcePath=p.portalItemResourcePath;const h=new Set(p.resources.toKeep.map(e=>e.resource.path)),m=new Set,l=[];h.forEach(e=>{u.delete(e),o.paths.push(e)});const f=[],w=[],d=[];for(const e of p.resources.toUpdate)if(u.delete(e.resource.path),h.has(e.resource.path)||m.has(e.resource.path)){const{resource:t,content:r,finish:p}=e,n=a(t,s());o.paths.push(n.path),f.push({resource:n,content:await c(r),compress:e.compress}),p&&d.push(()=>p(n))}else{o.paths.push(e.resource.path),w.push({resource:e.resource,content:await c(e.content),compress:e.compress});const t=e.finish;t&&d.push(()=>t(e.resource)),m.add(e.resource.path)}for(const e of p.resources.toAdd)if(o.paths.push(e.resource.path),u.has(e.resource.path))u.delete(e.resource.path);else{f.push({resource:e.resource,content:await c(e.content),compress:e.compress});const t=e.finish;t&&d.push(()=>t(e.resource))}if(f.length||w.length){const{addOrUpdateResources:e}=await import("../../portal/support/resourceUtils.js");await e(p.portalItem,f,"add",n),await e(p.portalItem,w,"update",n)}if(d.forEach(e=>e()),0===l.length)return u;const I=await t(l);if(r(n),I.length>0)throw new e("save:resources","Failed to save one or more resources",{errors:I});return u}async function h(e,t,r){if(!e||!t.portalItem)return;const s=[];for(const o of e){const e=t.portalItem.resourceFromPath(o);s.push(e.portalItem.removeResource(e,r))}await o(s)}function i(e,t){const{portalItem:r,portalItemResourcePath:o}=e,{portalItem:s,portalItemResourcePath:a}=t;return r===s&&(!(o||a)||o===a)}export{p as saveResources,n as updateItemWithResources};
@@ -22,6 +22,8 @@ export interface SaveAsOptions extends SaveOptions {
22
22
  * @since 5.0
23
23
  */
24
24
  folder?: PortalFolder;
25
+ /** @internal */
26
+ portalItemResourcePath?: string;
25
27
  }
26
28
 
27
29
  /** @since 5.0 */
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ const e="Knowledge Studio Project",t=new Set(["Web Link Chart","Web Map","Web Scene"]);function n(e){return!!e.type&&t.has(e.type)}function o(t){return t.type===e}export{n as hasWebDocumentAsPrimaryContent,o as hasWebDocumentAsResource};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import e from"../../Viewpoint.js";import t from"../../core/Error.js";import r from"../../core/Logger.js";import{geographicToWebMercator as o}from"../../geometry/support/webMercatorUtils.js";import n from"../../portal/Portal.js";import{createForItemRead as i}from"../../portal/support/jsonContext.js";import{project as a}from"../../rest/geometryService/project.js";import s from"../../rest/support/ProjectParameters.js";function p(e,t){return t.resourceInfo?l(t,t.resourceInfo,{origin:e.origin}):t.portalItem?.id?c(e,t,t.portalItem):Promise.resolve()}function l(e,t,r){const o={context:{...r,layerContainerType:"operational-layers"}};return e.portalItem&&(o.context.portal=e.portalItem.portal||n.getDefault()),import("../../layers/support/layersCreator.js").then(({populateOperationalLayers:r})=>{const n=[],i=t.operationalLayers;i?.length&&n.push(r(e.layers,i,o));const a={...o,context:{...o.context,layerContainerType:"tables"},defaultLayerType:"ArcGISFeatureLayer"},s=t.tables;return s?.length&&n.push(r(e.tables,s,a)),Promise.allSettled(n).then(()=>{})})}async function c(e,o,n){if(await n.load().catch(r=>{throw new t(`${e.name}:load-portal-item`,"Failed to load portal item",{error:r})}),n.type!==e.itemType)throw new t(`${e.name}:invalid-portal-item`,`Invalid portal item type '${n.type}', expected '${e.itemType}'`,{type:n.type});const a=await n.fetchData();o.resourceInfo=a;const s=i(n,e.origin);await m(e,o,a,s),o.resourceReferences={portalItem:n,paths:s.readResourcePaths};const p=await f(o.initialViewProperties,n,r.getLogger(o));if(p){const t=o.initialViewProperties?.clone()??e.createInitialViewProperties();t.viewpoint=p,o.initialViewProperties=t}}function m(e,t,r,o){const n=u(e,r);return t.read(n,o),l(t,n,o)}function u(e,t){const r=e.parseVersion(t.version||"",e.name);return e.currentVersion.validate(r),t.version=`${r.major}.${r.minor}`,t}async function f(t,r,o){const n=t?.viewpoint?.targetGeometry;if(n)return null;const i=await y(t,r,o);if(!i)return null;return new e({targetGeometry:i})}async function y(e,t,r){const n=e?.spatialReference,i=t?.extent;if(!n||!i)return null;if(n.isWGS84)return i.clone();if(n.isWebMercator)return o(i);const{getGeometryServiceURL:p}=await import("../../portal/support/geometryServiceUtils.js");try{const e=await p(t),r=new s({geometries:[i],outSpatialReference:n});return(await a(e,r))[0]}catch(l){r.error("Error projecting item's extent:",l)}return null}export{p as loadFromSource};
2
+ import e from"../../Viewpoint.js";import t from"../../core/Error.js";import r from"../../core/Logger.js";import{geographicToWebMercator as o}from"../../geometry/support/webMercatorUtils.js";import a from"../../portal/Portal.js";import{createForItemRead as i}from"../../portal/support/jsonContext.js";import{project as n}from"../../rest/geometryService/project.js";import s from"../../rest/support/ProjectParameters.js";import{hasWebDocumentAsPrimaryContent as p}from"./utils.js";function l(e,t){return t.resourceInfo?c(t,t.resourceInfo,{origin:e.origin}):t.portalItem?.id?m(e,t,t.portalItem):Promise.resolve()}function c(e,t,r){const o={context:{...r,layerContainerType:"operational-layers"}};return e.portalItem&&(o.context.portal=e.portalItem.portal||a.getDefault()),import("../../layers/support/layersCreator.js").then(({populateOperationalLayers:r})=>{const a=[],i=t.operationalLayers;i?.length&&a.push(r(e.layers,i,o));const n={...o,context:{...o.context,layerContainerType:"tables"},defaultLayerType:"ArcGISFeatureLayer"},s=t.tables;return s?.length&&a.push(r(e.tables,s,n)),Promise.allSettled(a).then(()=>{})})}async function m(e,o,a){await a.load().catch(r=>{throw new t(`${e.name}:load-portal-item`,"Failed to load portal item",{error:r})});const n=a.type,s=e.supportedItemTypes;if(!n||!s.has(n))throw new t(`${e.name}:invalid-portal-item`,`Invalid portal item type '${n}', expected one of: '${Array.from(s).join("', '")}'`,{type:n});let l;const{portalItemResourcePath:c}=o;if(p(a)){if(c)throw new t(`${e.name}:portal-item-resource-path-not-supported`,`'portalItemResourcePath' is not supported when loading a map from '${n}' item`);l=await a.fetchData()}else{if(!c)throw new t(`${e.name}:missing-portal-item-resource-path`,`'portalItemResourcePath' is required to load a map from '${n}' item`);const r=a.resourceFromPath(c);l=await r.fetch()}o.resourceInfo=l;const m=i(a,e.origin);await u(e,o,l,m),o.resourceReferences={portalItem:a,portalItemResourcePath:c,paths:m.readResourcePaths};const f=await w(o.initialViewProperties,a,r.getLogger(o));if(f){const t=o.initialViewProperties?.clone()??e.createInitialViewProperties();t.viewpoint=f,o.initialViewProperties=t}}function u(e,t,r,o){const a=f(e,r);return t.read(a,o),c(t,a,o)}function f(e,t){const r=e.parseVersion(t.version||"",e.name);return e.currentVersion.validate(r),t.version=`${r.major}.${r.minor}`,t}async function w(t,r,o){const a=t?.viewpoint?.targetGeometry;if(a)return null;const i=await y(t,r,o);if(!i)return null;return new e({targetGeometry:i})}async function y(e,t,r){const a=e?.spatialReference,i=t?.extent;if(!a||!i)return null;if(a.isWGS84)return i.clone();if(a.isWebMercator)return o(i);const{getGeometryServiceURL:p}=await import("../../portal/support/geometryServiceUtils.js");try{const e=await p(t),r=new s({geometries:[i],outSpatialReference:a});return(await n(e,r))[0]}catch(l){r.error("Error projecting item's extent:",l)}return null}export{l as loadFromSource};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import e from"../../core/Error.js";import{MultiOriginJSONSupport as t}from"../../core/MultiOriginJSONSupport.js";import{whenOnce as r}from"../../core/reactiveUtils.js";import{hasSameCanonicalPortal as o,urlToObject as a}from"../../core/urlUtils.js";import{updateOrigins as i}from"../../core/accessorSupport/originUtils.js";import n from"../../geometry/SpatialReference.js";import{webMercatorToGeographic as s}from"../../geometry/support/webMercatorUtils.js";import{isServerOrServicesAGOLUrl as l}from"../../layers/support/arcgisLayerUrl.js";import{isLayerWithFeatureLayerSource as p,isFeatureCollectionLayer as c}from"../../layers/support/layerUtils.js";import m from"../../portal/Portal.js";import u from"../../portal/PortalItem.js";import{createForItemWrite as d}from"../../portal/support/jsonContext.js";import{removeTypeKeyword as f,addTypeKeyword as y,typeKeyword as w,toggleTypeKeyword as g,hasTypeKeyword as h}from"../../portal/support/portalItemUtils.js";import{project as _}from"../../rest/geometryService/project.js";import b from"../../rest/support/ProjectParameters.js";import{hasDeveloperBasemapLayer as j,isDeveloperBasemapLayer as v}from"../../support/basemapUtils.js";import{saveResources as R}from"./resourceUtils.js";import{beforeSave as S,evaluateWriteErrors as W,hasCharts as I}from"./saveUtils.js";const P=["NatGeo_World_Map","Ocean_Basemap","USA_Topo_Maps","World_Imagery","World_Street_Map","World_Terrain_Base","World_Topo_Map","World_Hillshade","Canvas/World_Light_Gray_Base","Canvas/World_Light_Gray_Reference","Canvas/World_Dark_Gray_Base","Canvas/World_Dark_Gray_Reference","Ocean/World_Ocean_Base","Ocean/World_Ocean_Reference","Reference/World_Boundaries_and_Places","Reference/World_Reference_Overlay","Reference/World_Transportation"].map(e=>e.toLowerCase());async function A(e,t,o){o??={},U(e,t),await r(()=>!t.updatingFromView),await t.load(),await D(t),await S(t),await M(e,t);const a=t.portalItem,{json:i,jsonContext:n}=await O(t,a,e.origin);return W(n,{errorName:`${e.name}:save`},o),await k(t,a),await me(e,t,a,i,n),await Promise.all([t.updateItemThumbnail(),R(t.resourceReferences,n)]),a}async function O(e,t,r){const o=d(t,r,!0),a=e.write({},o);return await Promise.all(o.resources.pendingOperations),{json:a,jsonContext:o}}async function T(e,t,o,a){a??={};const i=t.portalItem,n=E(e,o);await r(()=>!t.updatingFromView),await t.load(),await D(t),await S(t),await M(e,t);const{json:s,jsonContext:l}=await O(t,n,e.origin);W(l,{errorName:`${e.name}:save`},a),await Y(t,n);const p=t.getThumbnailState();return await ue(e,t,n,s,l,a)&&(t.resourceReferences.portalItem=n),t.restoreThumbnailFromState(p),await Promise.all([t.updateItemThumbnail(i),R(t.resourceReferences,l)]),n}function U(t,r){if(!r.portalItem)throw new e(`${t.name}:portal-item-not-set`,"Portal item to save to has not been set on the WebMap");C(t,r.portalItem)}function C(t,r){if(r.type!==t.itemType)throw new e(`${t.name}:portal-item-wrong-type`,`Portal item needs to have type "${t.itemType}"`)}async function M(t,r){if("linkchart"!==t.name&&!r.basemap?.baseLayers.length)throw new e(`${t.name}:save`,"Map does not have a valid basemap with a base layer.")}function E(e,t){let r=u.from(t);return r.id&&(r=r.clone(),r.id=null),r.type||(r.type=e.itemType),r.portal||(r.portal=m.getDefault()),C(e,r),r}function D(e){const t=[];return e.basemap&&t.push(e.basemap.load()),e.ground&&t.push(e.ground.load()),Promise.allSettled(t).then(()=>{})}async function k(e,t){t.extent=await ae(e.portalItem,e.initialViewProperties.viewpoint.targetGeometry),await Z(e,t)}const x=w.JSAPI,G="CollectorDisabled",L="Collector",N="Data Editing",V="OfflineDisabled",B="Offline",$="Workforce Project",F="Workforce Worker",H="Workforce Dispatcher",K="Offline Map Areas",J="FieldMapsDisabled",q=w.DEVELOPER_BASEMAP,z="UtilityNetwork",Q="ParcelFabric",X="IPS";async function Y(e,t){f(t,G),f(t,J),f(t,w.METADATA),f(t,V),f(t,K),f(t,H),f(t,$),f(t,F),await k(e,t)}async function Z(e,t){y(t,x),await ee(e),g(t,L,!h(t,G)&&!h(t,$)&&!h(t,F)&&!h(t,H)&&re(e)),g(t,N,re(e)),g(t,B,!h(t,V)&&oe(e)),g(t,q,j(e.basemap)),g(t,z,!!e.utilityNetworks?.length),g(t,Q,!!e.parcelFabric),g(t,X,!!e.ipsInfo),g(t,w.CHARTS,I(e)),t.typeKeywords&&(t.typeKeywords=t.typeKeywords.filter((e,t,r)=>r.indexOf(e)===t))}function ee(e){const t=te(e).map(e=>e.load()).toArray();return Promise.allSettled(t).then(()=>{})}function te(e){return e.allLayers.concat(e.allTables)}function re(e){return te(e).some(e=>e.loaded&&p(e)&&e.capabilities.operations.supportsEditing&&"editingEnabled"in e&&e.editingEnabled&&("subtype-group"!==e.type||e.sublayers.some(e=>e.editingEnabled)))}function oe(e){return te(e).filter(e=>"group"!==e.type).every(t=>t.loaded&&se(e,t))}async function ae(e,t){const r=t.clone().normalize();let o;if(r.length>1)for(const a of r)o?a.width>o.width&&(o=a):o=a;else o=r[0];return ie(e,o)}async function ie(e,t){const r=t.spatialReference;if(r.isWGS84)return t.clone();if(r.isWebMercator)return s(t);const{getGeometryServiceURL:o}=await import("../../portal/support/geometryServiceUtils.js"),a=await o(e),i=new b({geometries:[t],outSpatialReference:n.WGS84});return(await _(a,i))[0]}function ne(e){return c(e)||"map-notes"===e.type||"route"===e.type}function se(e,t){return p(t)&&t.capabilities.operations.supportsSync||ne(t)&&!t.portalItem||le(t)&&!pe(t)&&t.spatialReference.equals(e.initialViewProperties.spatialReference)}function le(e){return"imagery-tile"===e.type?e.supportsExportMapTiles():("tile"===e.type||"vector-tile"===e.type)&&(e.capabilities.operations.supportsExportTiles||ce(e)||v(e))}function pe(e){return"vector-tile"===e.type&&Object.keys(e.sourceNameToSource).length>1}function ce(e){return"tile"===e.type&&(l(e.url)&&P.some(t=>e.url?.toLowerCase().includes("/"+t+"/")))}async function me(e,t,r,o,a){await r.update({data:o}),ye(e,t,r,o,a)}async function ue(t,r,o,a,i,n){const s=r.portalItem,l={item:s,authenticated:!(!s?.id||!s.portal.user)},p=o.portal;await p.signIn();const{copyAllowed:c,itemReloaded:m}=await de(l,p);if(l.authenticated||=m,!c)throw new e(`${t.name}:save-as-copy-not-allowed`,"Owner of this map does not allow others to save a copy");const u=await fe(o,l,a,n);return r.portalItem=o,ye(t,r,o,a,i),u}async function de(e,t){const{item:r,authenticated:o}=e;return r?.id&&r.typeKeywords?.includes("useOnly")?r.portal.portalHostname!==t.portalHostname?{copyAllowed:!1,itemReloaded:!1}:(o||await r.reload(),{copyAllowed:"admin"===r.itemControl||"update"===r.itemControl,itemReloaded:!0}):{copyAllowed:!0,itemReloaded:!1}}async function fe(e,t,r,a){const i=e.portal,{item:n}=t,{folder:s,copyAllResources:l}=a;let p=!1;if(l&&n?.id&&o(n.portal.url,i.url)&&parseInt(n.portal.currentVersion,10)>=2023){const{total:e}=await n.fetchResources();p=!!e}if(p){const t=await n.copy({copyResources:"all",folder:s});e.id=t.id,e.portal=t.portal;const o=e.toJSON();await e.load(),e.read(o),await e.update({data:r})}else await i.user.addItem({item:e,folder:s,data:r});return p}function ye(e,r,o,n,s){t.prototype.read.call(r,{version:n.version,authoringApp:n.authoringApp,authoringAppVersion:n.authoringAppVersion},{origin:e.origin,ignoreDefaults:!0,url:o.itemUrl?a(o.itemUrl):void 0}),i(s),r.resourceInfo=n}export{O as createJSON,fe as initializeNewItem,de as isCopyAllowed,A as save,T as saveAs};
2
+ import e from"../../core/Error.js";import{MultiOriginJSONSupport as t}from"../../core/MultiOriginJSONSupport.js";import{whenOnce as r}from"../../core/reactiveUtils.js";import{hasSameCanonicalPortal as o,urlToObject as a}from"../../core/urlUtils.js";import{updateOrigins as i}from"../../core/accessorSupport/originUtils.js";import n from"../../geometry/SpatialReference.js";import{webMercatorToGeographic as s}from"../../geometry/support/webMercatorUtils.js";import{isServerOrServicesAGOLUrl as l}from"../../layers/support/arcgisLayerUrl.js";import{isLayerWithFeatureLayerSource as p,isFeatureCollectionLayer as c}from"../../layers/support/layerUtils.js";import u from"../../portal/Portal.js";import m from"../../portal/PortalItem.js";import{createForItemWrite as d}from"../../portal/support/jsonContext.js";import{removeTypeKeyword as f,addTypeKeyword as w,typeKeyword as y,toggleTypeKeyword as h,hasTypeKeyword as g}from"../../portal/support/portalItemUtils.js";import{project as I}from"../../rest/geometryService/project.js";import R from"../../rest/support/ProjectParameters.js";import{hasDeveloperBasemapLayer as P,isDeveloperBasemapLayer as _}from"../../support/basemapUtils.js";import{saveResources as b}from"./resourceUtils.js";import{beforeSave as j,evaluateWriteErrors as v,hasCharts as S}from"./saveUtils.js";import{hasWebDocumentAsPrimaryContent as W,hasWebDocumentAsResource as A}from"./utils.js";const O=["NatGeo_World_Map","Ocean_Basemap","USA_Topo_Maps","World_Imagery","World_Street_Map","World_Terrain_Base","World_Topo_Map","World_Hillshade","Canvas/World_Light_Gray_Base","Canvas/World_Light_Gray_Reference","Canvas/World_Dark_Gray_Base","Canvas/World_Dark_Gray_Reference","Ocean/World_Ocean_Base","Ocean/World_Ocean_Reference","Reference/World_Boundaries_and_Places","Reference/World_Reference_Overlay","Reference/World_Transportation"].map(e=>e.toLowerCase());async function T(e,t,o){o??={},M(e,t),await r(()=>!t.updatingFromView),await t.load(),await k(t),await j(t),await $(e,t);const a=t.portalItem,{json:i,jsonContext:n}=await C(t,a,e.origin,t.portalItemResourcePath);return v(n,{errorName:`${e.name}:save`},o),await x(t,a),await de(e,t,a,i,n),await Promise.all([W(a)?t.updateItemThumbnail():null,b(t.resourceReferences,n)]),a}async function C(e,t,r,o){const a=A(t),i=a&&t.id===e.portalItem?.id&&o!==e.portalItemResourcePath,n=d(t,r,{withResources:!0,forceNewItemContext:i});n.portalItemResourcePath=a?o:null;const s=e.write({},n);return await Promise.all(n.resources.pendingOperations),{json:s,jsonContext:n}}async function U(e,t,o,a){a??={};const i=t.portalItem,n=await D(e,t,o,a);await r(()=>!t.updatingFromView),await t.load(),await k(t),await j(t),await $(e,t);const{json:s,jsonContext:l}=await C(t,n,e.origin,a.portalItemResourcePath);let p;v(l,{errorName:`${e.name}:save`},a),await ee(t,n);const c=W(n);c&&(p=t.getThumbnailState());return await fe(e,t,n,s,l,a)&&(t.resourceReferences.portalItem=n),p&&t.restoreThumbnailFromState(p),await Promise.all([c?t.updateItemThumbnail(i):null,b(t.resourceReferences,l)]),n}function M(t,r){if(!r.portalItem)throw new e(`${t.name}:portal-item-not-set`,"Portal item to save to has not been set on the WebMap");E(t,r.portalItem)}function E(t,r){const o=r.type,a=t.supportedItemTypes;if(!o||!a.has(o))throw new e(`${t.name}:portal-item-wrong-type`,`Portal item needs to have one of these types: '${Array.from(a).join("', '")}'`)}async function $(t,r){if("linkchart"!==t.name&&!r.basemap?.baseLayers.length)throw new e(`${t.name}:save`,"Map does not have a valid basemap with a base layer.")}async function D(t,r,o,a){let i=m.from(o);i.id&&await i.load();const{portalItemResourcePath:n}=a,{name:s,primaryItemType:l}=t;if(A(i)){if(!n)throw new e(`${s}:missing-portal-item-resource-path`,`'portalItemResourcePath' is required to save a map to '${i.type}' item`);if(n===r.portalItemResourcePath&&i.id===r.portalItem?.id)throw new e(`${s}:invalid-portal-item-resource-path`,`Target 'portalItemResourcePath' should be different from '${s}.portalItemResourcePath'`);return i}if(n)throw new e(`${s}:portal-item-resource-path-not-supported`,`'portalItemResourcePath' is not supported when saving a map to '${l}' item`);return i.id&&(i=i.clone(),i.id=null),i.type||(i.type=l),i.portal||(i.portal=u.getDefault()),E(t,i),i}function k(e){const t=[];return e.basemap&&t.push(e.basemap.load()),e.ground&&t.push(e.ground.load()),Promise.allSettled(t).then(()=>{})}async function x(e,t){A(t)||(t.extent=await ne(e.portalItem,e.initialViewProperties.viewpoint.targetGeometry),await te(e,t))}const N=y.JSAPI,G="CollectorDisabled",L="Collector",B="Data Editing",F="OfflineDisabled",V="Offline",H="Workforce Project",J="Workforce Worker",K="Workforce Dispatcher",q="Offline Map Areas",z="FieldMapsDisabled",Q=y.DEVELOPER_BASEMAP,X="UtilityNetwork",Y="ParcelFabric",Z="IPS";async function ee(e,t){A(t)||(f(t,G),f(t,z),f(t,y.METADATA),f(t,F),f(t,q),f(t,K),f(t,H),f(t,J),await x(e,t))}async function te(e,t){w(t,N),await re(e),h(t,L,!g(t,G)&&!g(t,H)&&!g(t,J)&&!g(t,K)&&ae(e)),h(t,B,ae(e)),h(t,V,!g(t,F)&&ie(e)),h(t,Q,P(e.basemap)),h(t,X,!!e.utilityNetworks?.length),h(t,Y,!!e.parcelFabric),h(t,Z,!!e.ipsInfo),h(t,y.CHARTS,S(e)),t.typeKeywords&&(t.typeKeywords=t.typeKeywords.filter((e,t,r)=>r.indexOf(e)===t))}function re(e){const t=oe(e).map(e=>e.load()).toArray();return Promise.allSettled(t).then(()=>{})}function oe(e){return e.allLayers.concat(e.allTables)}function ae(e){return oe(e).some(e=>e.loaded&&p(e)&&e.capabilities.operations.supportsEditing&&"editingEnabled"in e&&e.editingEnabled&&("subtype-group"!==e.type||e.sublayers.some(e=>e.editingEnabled)))}function ie(e){return oe(e).filter(e=>"group"!==e.type).every(t=>t.loaded&&pe(e,t))}async function ne(e,t){const r=t.clone().normalize();let o;if(r.length>1)for(const a of r)o?a.width>o.width&&(o=a):o=a;else o=r[0];return se(e,o)}async function se(e,t){const r=t.spatialReference;if(r.isWGS84)return t.clone();if(r.isWebMercator)return s(t);const{getGeometryServiceURL:o}=await import("../../portal/support/geometryServiceUtils.js"),a=await o(e),i=new R({geometries:[t],outSpatialReference:n.WGS84});return(await I(a,i))[0]}function le(e){return c(e)||"map-notes"===e.type||"route"===e.type}function pe(e,t){return p(t)&&t.capabilities.operations.supportsSync||le(t)&&!t.portalItem||ce(t)&&!ue(t)&&t.spatialReference.equals(e.initialViewProperties.spatialReference)}function ce(e){return"imagery-tile"===e.type?e.supportsExportMapTiles():("tile"===e.type||"vector-tile"===e.type)&&(e.capabilities.operations.supportsExportTiles||me(e)||_(e))}function ue(e){return"vector-tile"===e.type&&Object.keys(e.sourceNameToSource).length>1}function me(e){return"tile"===e.type&&(l(e.url)&&O.some(t=>e.url?.toLowerCase().includes("/"+t+"/")))}async function de(e,t,r,o,a){if(W(r))await r.update({data:o});else{await r.portal.signIn();const e=r.resourceFromPath(t.portalItemResourcePath);await e.update(ge(o))}he(e,t,r,o,a)}async function fe(t,r,o,a,i,n){const s=r.portalItem,l={item:s,authenticated:!(!s?.id||!s.portal.user)},p=o.portal;await p.signIn();const{copyAllowed:c,itemReloaded:u}=await we(l,p);if(l.authenticated||=u,!c)throw new e(`${t.name}:save-as-copy-not-allowed`,"Owner of this map does not allow others to save a copy");let m=!1;if(W(o))m=await ye(o,l,a,n);else{const e=o.resourceFromPath(n.portalItemResourcePath);await o.addResource(e,ge(a))}return r.portalItem=o,r.portalItemResourcePath=n.portalItemResourcePath,he(t,r,o,a,i),m}async function we(e,t){const{item:r,authenticated:o}=e;return r&&W(r)&&r.id&&r.typeKeywords?.includes("useOnly")?r.portal.portalHostname!==t.portalHostname?{copyAllowed:!1,itemReloaded:!1}:(o||await r.reload(),{copyAllowed:"admin"===r.itemControl||"update"===r.itemControl,itemReloaded:!0}):{copyAllowed:!0,itemReloaded:!1}}async function ye(e,t,r,a){const i=e.portal,{item:n}=t,{folder:s,copyAllResources:l}=a;let p=!1;if(l&&n?.id&&n.type===e.type&&o(n.portal.url,i.url)&&parseInt(n.portal.currentVersion,10)>=2023){const{total:e}=await n.fetchResources();p=!!e}if(p){const t=await n.copy({copyResources:"all",folder:s});e.id=t.id,e.portal=t.portal;const o=e.toJSON();await e.load(),e.read(o),await e.update({data:r})}else await i.user.addItem({item:e,folder:s,data:r});return p}function he(e,r,o,n,s){t.prototype.read.call(r,{version:n.version,authoringApp:n.authoringApp,authoringAppVersion:n.authoringAppVersion},{origin:e.origin,ignoreDefaults:!0,url:o.itemUrl?a(o.itemUrl):void 0}),i(s),r.resourceInfo=n}function ge(e){return new Blob([JSON.stringify(e)],{type:"application/json"})}export{C as createJSON,ye as initializeNewItem,we as isCopyAllowed,T as save,U as saveAs};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{pushIfSome as t}from"../../core/arrayUtils.js";import{createTask as s}from"../../core/asyncUtils.js";import a from"../../core/Collection.js";import i from"../../core/Error.js";import{EventedAccessor as n}from"../../core/Evented.js";import r from"../../core/Logger.js";import{getOrCreateMapValue as o}from"../../core/MapUtils.js";import{destroyMaybe as l,abortMaybe as h}from"../../core/maybe.js";import{throwIfAborted as c,whenOrAbort as p,ignoreAbortErrors as u,isAbortError as m}from"../../core/promiseUtils.js";import d from"../../core/ReactiveMap.js";import{on as g,sync as y,watch as f,syncAndInitial as v,initial as _,whenOnce as A}from"../../core/reactiveUtils.js";import{property as F,subclass as I}from"../../core/accessorSupport/decorators.js";import{UpdatingHandles as w}from"../../core/support/UpdatingHandles.js";import E from"../../geometry/SpatialReference.js";import{getGraphicLayer as x}from"../../graphic/graphicOriginUtils.js";import{isSubtypeGroupLayer as C,isSubtypeSublayer as T,isFeatureLayer as M,getSubtypesFromLayer as k}from"../../layers/support/layerUtils.js";import{system as b}from"../../time/constants.js";import{getAttachmentKey as V}from"./attachmentUtils.js";import{getLayerTimeZone as S,getEffectiveTimeZone as L,createReactiveGraphic as R,isAttributeFormSupportedLayerWithAttachments as H,layerSupportsAttachments as P,queryAttachmentsForElements as j}from"./batchAttributeFormUtils.js";import{ReactiveContingentValuesManager as U}from"./ReactiveContingentValuesManager.js";import{parseFormTemplateString as O}from"./stringUtils.js";import{ValueChangeTransaction as G}from"./ValueChangeTransaction.js";import{ArcadeExecutorProvider as B}from"./expressions/ArcadeExecutorProvider.js";import{ExpressionsManager as D}from"./expressions/ExpressionsManager.js";import{ExpressionsModel as N}from"./expressions/ExpressionsModel.js";import W from"./inputs/BatchFormInputs.js";import{createBatchFormInputsFromBatchFormTemplate as Z,mergeBatchFormInputsFromNewTemplate as $}from"./inputs/support/createBatchFormInputs.js";import{isGroupInput as K,isFieldInput as z}from"./inputs/support/inputUtils.js";import q from"./templates/BatchFormTemplate.js";import{createBatchFormTemplate as J}from"./templates/support/createBatchFormTemplate.js";import{isExcludedFromSharedForm as Q,isGroupElementTemplate as X}from"./templates/support/templateUtils.js";import{ContingentValuesManager as Y,isLayerWithContingentValues as ee}from"../support/ContingentValuesManager.js";import{isEmptyValue as te}from"../support/forms/formUtils.js";function se(e,t){return e?.find(e=>e.layer===t)}let ae=class extends n{constructor(e){super(e),this._attachmentCache=new d,this.activeFeatureIndex=-1,this.attachmentsEnabled=!1,this.callbacks=null,this.disabled=!1,this.editType="NA",this.features=new a,this._hasAsyncArcadeExpressions=!1,this.highlightHelper=null,this.maximumFeatureCount=2e3,this.maximumFeatureCountWithComplexForms=50,this.map=null,this.pageStack=[],this.readOnly=!1,this.pendingSubtypeChoice=null,this.spatialReference=null,this.submitHasBeenAttempted=!1,this.timeZone=null,this.userHasChangedValues=!1,this.layerInfos=null,this._arcadeExecutorProvider=new B,this._activeAssociation=null,this._activeAssociationsInput=null,this._activeRelationshipInput=null,this._ownContingentValuesManager=null,this._activeFormInputsByElementId=new Map,this._emptyForm=new W({inputs:[]}),this._emptyFormTemplate=new q({elements:[]}),this._featureFormMap=new d,this._prepareTask=null,this._layerTemplateUpdateTask=null,this._syncAttachmentsTask=null,this._reactiveGraphicLookup=new d,this._updatingHandles=new w,this._submitTask=null,this._layerTemplateMap=new d,this._workingFeatures=new a,this._expressionsManager=new D({arcadeContext:{editType:"NA",spatialReference:null,map:null,timeZone:b}}),this._getExternalErrorForFeature=(e,t)=>this._reactiveContingentValuesManager.getViolationTypeForField(e,t),this._getFieldValueOptionsForFeature=e=>this._reactiveContingentValuesManager.getAndWatchFieldValueOptions(e),this.sharedForm=this._emptyForm,this.sharedFormTemplate=this._emptyFormTemplate}initialize(){this.contingentValuesManager||(this.contingentValuesManager=this._ownContingentValuesManager=new Y),this.addHandles([g(()=>this.features,"after-changes",()=>{this.goHome(),this.notifyChange("layers"),this._prepare()},y),f(()=>[this.attachmentsEnabled,this.features,this.map,this.timeZone,this.editType],()=>this._prepare(),y),f(()=>this.activeForm,()=>{this.goHome(),this._activeFormInputsByElementId.clear(),this._syncAttachments()},y),f(()=>this.activeFeature,()=>{this.goHome()},y),f(()=>this.page,e=>{const t=[...this.pageStack];if(t.includes(e))for(;t.length&&t.at(-1)!==e;)t.pop();else t.push(e);this.pageStack=t},v),f(()=>this.contingentValuesManager,e=>{l(this._reactiveContingentValuesManager),this._reactiveContingentValuesManager=new U({manager:e})},_)]),this._prepare()}destroy(){this._prepareTask=h(this._prepareTask),this.pendingSubtypeChoice?.reject(),this._layerTemplateUpdateTask=h(this._layerTemplateUpdateTask),this._syncAttachmentsTask=h(this._syncAttachmentsTask),this._workingFeatures.destroyAll(),l(this._expressionsManager),l(this._reactiveContingentValuesManager),this._updatingHandles.destroy(),this._reactiveGraphicLookup=new d,this._emptyForm.destroy(),this._emptyFormTemplate.destroy(),this._ownContingentValuesManager=l(this._ownContingentValuesManager),this.highlightHelper?.removeAll()}get activeFeature(){const e=this.activeFeatureIndex;return e<0?null:this.features.at(e)}get activeForm(){if("batch"===this.mode)return this.sharedForm;const e=this._workingFeatures.at(this.activeFeatureIndex);if(!e)return this._emptyForm;const t=this._featureFormMap.get(e);if(t)return t;const s=this._makeBatchFormInputsForFeature(e);return s!==this._emptyForm&&this._featureFormMap.set(e,s),s}get activeLayer(){const{activeFeature:e}=this;if(!e)return null;return x(e)??null}get activeAssociation(){return this._activeAssociation}get activeAssociationsInput(){return this._activeAssociationsInput}get activeAssociationType(){return this.activeAssociationsInput?.activeAssociationType}get activeRelationshipInput(){return this._activeRelationshipInput}get calculating(){return this._expressionsManager.calculating}get expressionsManager(){return this._expressionsManager}get canGoBack(){return this.pageStack.length>1}get expressionEvaluationFailed(){return this._expressionsManager.expressionEvaluationFailed}get hasNonActiveInvalidFeatures(){if("batch"===this.mode)return!1;const{activeFeature:e}=this;return this.invalidFeatures.some(t=>t!==e)}get hasAsyncArcadeExpressions(){return this._hasAsyncArcadeExpressions}get hasTooManyFeatures(){return this._workingFeatures.length>this.maximumFeatureCount}get hasTooManyComplexFeatures(){return this._workingFeatures.length>this.maximumFeatureCountWithComplexForms&&this.hasAsyncArcadeExpressions}get invalidFeatures(){return this.sharedForm.invalidFeatures}get hasVisibleInputs(){return this.visibleInputs.length>0}get hasLayersWithContingentValues(){const e=this.contingentValuesManager;for(const t of this.layers)if(e.getFieldsWithContingentValues(t).size>0)return!0;return!1}get formDescription(){return this._computeFormHeaderField(this.activeForm?.description)}get formTitle(){return this._computeFormHeaderField(this.activeForm?.title)}get effectiveTimeZone(){const{activeLayer:e,timeZone:t}=this;if(!e)return t??"system";const s=S(e);return L(t,s)}get visibleInputs(){return this.activeForm.inputs.filter(e=>e.visible)}get noVisibleElementsReason(){if(this.hasVisibleInputs)return null;if(0===this.activeForm.inputs.length)return"noElements";const e=new Set;for(const t of this.activeForm.inputs)switch(t.visibilityCode){case"hidden:not-in-all-layers":case"hidden:no-domain-in-common":e.add("noElementsInCommon");break;case"hidden:field-definition":case"hidden:group-visibility-expression:all-features":case"hidden:visibility-expression:all-features":e.add("allElementsHidden");break;case"hidden:group-visibility-expression:some-features":case"hidden:visibility-expression:some-features":return"elementsHiddenInSome"}return e.has("allElementsHidden")?"allElementsHidden":"noElementsInCommon"}get page(){return this.showingSelectedAttachmentReplacePage&&this.selectedAttachmentDetails?"replacing-attachment":this.selectedAttachmentDetails?"viewing-attachment-details":this.selectedAttachmentAddInput?"adding-attachments":this.selectedAttachmentListInput?"viewing-attachments":this.activeAssociationsInput?.associatedLayer?"viewing-associated-features":this.activeAssociationsInput?"viewing-associated-layers":this.activeRelationshipInput?.showAllRelatedRecords?"viewing-related-records":this.activeRelationshipInput?.showAllCategories?"viewing-related-categories":"default"}get subtypes(){const e=this.activeLayer;return C(e)||T(e)||M(e)?k(e):[]}get status(){const e=this._prepareTask;return null==e?"not-loaded":e.finished?null!=e.error?"failed":"loaded":"loading"}get updating(){return this._updatingHandles.updating||this.calculating}get valid(){return this.sharedForm.valid&&Array.from(this._featureFormMap.values()).every(e=>e.valid)}get layers(){return Array.from(this._layersSet)}get mode(){return this.activeFeatureIndex>-1?"single":"batch"}submit(){if(this.submitHasBeenAttempted=!0,this.validateContingentValues(this._workingFeatures),!this._hasPendingAttachmentHydration)return this._emitSubmit(),Promise.resolve();if(this._submitTask)return this._submitTask.promise;const e=s(async()=>{await Promise.all(this._allAttachmentInputs.map(e=>e.waitForPendingAttachmentUpdateData())),this._emitSubmit()});return this._submitTask=e,e.promise.finally(()=>{this._submitTask===e&&(this._submitTask=null)}),e.promise}get selectedAttachment(){return this._get("selectedAttachment")??null}set selectedAttachment(e){this.showingSelectedAttachmentReplacePage=!1,this._set("selectedAttachment",e),null!=e&&(this.selectedAttachmentAddElementId=null)}get selectedAttachmentAddElementId(){return this._get("selectedAttachmentAddElementId")??null}set selectedAttachmentAddElementId(e){this.showingSelectedAttachmentReplacePage=!1,this._set("selectedAttachmentAddElementId",e),null!=e&&(this.selectedAttachment=null,this.selectedAttachmentListElementId=null)}get selectedAttachmentListElementId(){return this._get("selectedAttachmentListElementId")??null}set selectedAttachmentListElementId(e){this._set("selectedAttachmentListElementId",e),null!=e&&(this.selectedAttachment=null,this.selectedAttachmentAddElementId=null)}get selectedAttachmentListInput(){const e=this.selectedAttachmentListElementId,t=this.activeForm;return e&&t&&t.allAttachmentElementInputs.find(t=>t.template.elementId===e)||null}get showingSelectedAttachmentReplacePage(){return this._get("showingSelectedAttachmentReplacePage")??!1}set showingSelectedAttachmentReplacePage(e){this._set("showingSelectedAttachmentReplacePage",e&&null!=this.selectedAttachmentDetails)}get selectedAttachmentAddInput(){const e=this.selectedAttachmentAddElementId,t=this.activeForm;return e&&t&&t.allAttachmentElementInputs.find(t=>t.template.elementId===e)||null}get selectedAttachmentDetails(){const e=this.selectedAttachment,t=this.activeForm;if(!e||!t)return null;const s=t.allAttachmentElementInputs.find(t=>t.template.elementId===e.elementId);if(!s)return null;const a=s.attachments.findIndex(t=>V(t)===e.attachmentKey);if(-1===a)return null;return{attachment:s.attachments[a],input:s}}get _allAttachmentInputs(){const e=[...this.sharedForm.allAttachmentElementInputs];for(const t of this._featureFormMap.values())e.push(...t.allAttachmentElementInputs);return e}get _hasPendingAttachmentHydration(){return this._allAttachmentInputs.some(e=>e.hasPendingAttachmentUpdateData)}get _layersSet(){const e=new Set;for(const t of this._workingFeatures){const s=x(t.plainGraphic);s&&e.add(s)}return e}applyStashedAttachmentEdits(e){const t=this._allAttachmentInputs;for(const s of e){const e=t.find(e=>e.label===s.label&&e.attachmentKeyword===s.keywords);e&&e.applyStashedEdits(s)}}findFieldInput(e){if(null==e)return;const t=this._activeFormInputsByElementId;if(t.has(e))return t.get(e);const s=this.activeForm.allFieldInputs.find(t=>t.template.elementId===e);return void 0!==s?(t.set(e,s),s):void 0}getFirstVisibleInvalidFieldInput(){if(this.hasVisibleInputs&&!this.activeForm.valid)for(const e of this.visibleInputs){if(K(e)){const t=e.inputs.find(e=>z(e)&&!e.valid);if(t)return{input:t,groupInput:e}}if(z(e)&&!e.valid)return{input:e}}}getFieldInputValue(e){return this.findFieldInput(e)?.value}getValues(e){const t=this._reactiveGraphicLookup.get(e);if(!t)throw new i("feature-not-found","The given feature is not present in the BatchAttributeForm");return{...t.attributes}}async goBack(){switch(this.page){case"replacing-attachment":return void this.setShowingSelectedAttachmentReplacePage(!1);case"viewing-attachment-details":return void this.setSelectedAttachment(null);case"adding-attachments":return void this.setSelectedAttachmentAddElementId(null);case"viewing-attachments":return void this.setSelectedAttachmentListElementId(null);case"viewing-associated-features":return void this.setActiveAssociationsLayer(null);case"viewing-associated-layers":return void this.setActiveAssociationsInput(null);case"viewing-related-categories":case"viewing-related-records":return void this.clearActiveRelationshipCategoryOrInput();default:return}}async goHome(){this.setShowingSelectedAttachmentReplacePage(!1),this.setSelectedAttachment(null),this.setSelectedAttachmentAddElementId(null),this.setSelectedAttachmentListElementId(null),this.setActiveAssociationsLayer(null),this.setActiveAssociationsInput(null),this.clearAllRelationshipSettings()}notifyGeometriesChanged(e){const t=[];for(const s of e){const e=this._reactiveGraphicLookup.get(s);e&&(t.push(e),e.geometry=s.geometry)}this._updatingHandles.consumePromise(this._valueChangeTransaction(async e=>this._expressionsManager.runGeometryDependentExpressions(t,e),"user"))}async overrideOriginalFeature(e,t){await(this._prepareTask?.promise);const s=this._reactiveGraphicLookup.get(e);s&&(s.original=t,this._updatingHandles.consumePromise(this._valueChangeTransaction(e=>this._expressionsManager.runOriginalFeatureDependentExpressions(s,e),"expression")))}async setFieldInputValue(e,t){const{fieldName:s}=e;await this._updatingHandles.addPromise(this._valueChangeTransaction(async a=>{for(const i of e.features)a.setValue(i,s,t)},"user",e))}async setFieldInputValuePerFeature(e,t){await this._updatingHandles.addPromise(this._valueChangeTransaction(async s=>{for(const[a,i]of t)s.setValue(a,e.fieldName,i);s.hasChanges&&(e.userHasChangedValue=!0)},"user",e))}async setValueForFieldName(e,t,s){await this._updatingHandles.addPromise(this._valueChangeTransaction(async a=>{for(const i of s){const s=this._reactiveGraphicLookup.get(i);s&&a.setValue(s,e,t)}},"user",e))}async setValuePerFeatureForFieldName(e,t){await this._updatingHandles.addPromise(this._valueChangeTransaction(async s=>{for(const[a,i]of t){const t=this._reactiveGraphicLookup.get(a);t&&s.setValue(t,e,i)}},"user",e))}async setFieldValue(e,t){const s=this.activeForm.allFieldInputs.find(t=>t.fieldName===e);if(null==s)throw new i("no-field-input-found",`Cannot set the value of FieldInput with field name: ${e} because none was found in the active form`);await this.setFieldInputValue(s,t)}async setValue(e,t){const s=this.findFieldInput(e);if(null==s)throw new i("no-FieldInput-found",`Cannot set the value of FieldInput with ID: ${e} because none was found in the active form`);await this.setFieldInputValue(s,t)}async applySubtypeDefaults(e){const{defaultValues:t}=e,{allFieldInputs:s}=this.activeForm;await this._updatingHandles.addPromise(this._valueChangeTransaction(async e=>{for(const a of s){const{fieldName:s}=a,i=t[s];if(null!=i)for(const t of a.features)e.setValue(t,s,i)}},"user"))}async handleSubtypeChanged(e){const t=this._workingFeatures.at(e);if(t)return this._updatingHandles.addPromise(this._handleSubtypeChanged(t))}async stageAddAttachments(e,t){if(0===t.length)return[];const s=this._findAttachmentInput(e);if(!s)return[];const a=await this._updatingHandles.addPromise(s.stageAddAttachments(t,this._expressionsManager.arcadeContext));return 0===a.length||(this.userHasChangedValues=!0,this._emitAttachmentsChange(s)),a}stageDeleteAttachment(e,t){const s=this._findAttachmentInput(e);if(!s)return;const a=this._findAttachment(s,t);a&&(s.stageDeleteAttachment(a),this.userHasChangedValues=!0,this._emitAttachmentsChange(s))}async stageRenameAttachment(e,t,s){const a=this._findAttachmentInput(e);if(!a)return;const i=this._findAttachment(a,t);i&&(a.stageRenameAttachment(i,s.trim()),this.userHasChangedValues=!0,await a.ensureStagedUpdateData(i),this._emitAttachmentsChange(a))}async stageReplaceAttachment(e,t,s){const a=this._findAttachmentInput(e);if(!a)return!1;const i=this._findAttachment(a,t);if(!i)return!1;return!!await this._updatingHandles.addPromise(a.stageReplaceAttachment(i,s,this._expressionsManager.arcadeContext))&&(this.userHasChangedValues=!0,this._emitAttachmentsChange(a),!0)}clearAttachmentChanges(e){const t=this._findAttachmentInput(e);t&&(t.clearAttachmentChanges(),this._emitAttachmentsChange(t))}setActiveAssociation(e){this._activeAssociation=e}setActiveAssociationsInput(e){this._activeAssociationsInput=e}setActiveAssociationsLayer(e){this._activeAssociationsInput?.setAssociatedLayer(e)}setActiveAssociationType(e){this._activeAssociationsInput?.setActiveAssociationType(e)}setActiveRelationshipInput(e){e||this._activeRelationshipInput?.setActiveCategory(null),this._activeRelationshipInput=e}setActiveRelationshipCategory(e,t){t.setActiveCategory(e),this.setActiveRelationshipInput(t)}clearAllRelationshipSettings(){const e=this.activeRelationshipInput;e&&(e.setActiveCategory(null),e.setShowAllCategories(!1),e.setShowAllRelatedRecords(!1),this._activeRelationshipInput=null)}clearActiveRelationshipCategoryOrInput(){const e=this.activeRelationshipInput;e&&(e.showAllRelatedRecords?e.showAllCategories?e.setActiveCategory(null):this.setActiveRelationshipInput(null):e.showAllCategories&&(e.setShowAllCategories(!1),this.setActiveRelationshipInput(null)))}resetAttachmentChanges(e,t){const s=this._findAttachmentInput(e);if(!s||!s.editable)return;const a=this._findAttachment(s,t);a&&(s.discardStagedEdits(a),this._emitAttachmentsChange(s))}setSelectedAttachment(e){this.selectedAttachment=e??null}setShowingSelectedAttachmentReplacePage(e){this.showingSelectedAttachmentReplacePage=e}setSelectedAttachmentAddElementId(e){this.selectedAttachmentAddElementId=e??null}setSelectedAttachmentListElementId(e){this.selectedAttachmentListElementId=e??null}userChangesHaveMadeFeatureInvalid(e){return!!this._reactiveGraphicLookup.get(e)?.userChangesHaveMadeInvalid}validate(){return!1}validateContingentValues(e,t=!1){if(t&&!this.submitHasBeenAttempted)for(const s of e)this._reactiveContingentValuesManager.validateContingenciesForNonNullFields(s);else for(const s of e)this._reactiveContingentValuesManager.validateContingencyConstraints(s,{includeIncompleteViolations:!0})}_makeBatchFormInputsForFeature(e){const t=this._layerTemplateMap.get(e.layer);return t?Z(t,{allFeatures:new a([e]),expressionsManager:this._expressionsManager,getExternalErrorForFeature:this._getExternalErrorForFeature,getFieldValueOptionsForFeature:this._getFieldValueOptionsForFeature,map:this.map}):this._emptyForm}async _ensureLayerTemplate(e,t){const{_layersSet:s,contingentValuesManager:a}=this,i=e.layer;let n=!1;for(const r of this._layerTemplateMap.keys())s.has(r)||(this._layerTemplateMap.delete(r),this._expressionsManager.layerExpressionsModelMap.delete(r),a.resetOptionsForLayer(r),ee(r)&&a.resetViolationsForLayer(r),n=!0);this._layerTemplateMap.has(i)||(await this._prepareLayer(i,t),c(t),a.layers.add(i),n=!0),n&&(this._prepareSharedFormTemplate(),$(this.sharedForm,this.sharedFormTemplate,{allFeatures:this._workingFeatures,expressionsManager:this._expressionsManager,getFieldValueOptionsForFeature:this._getFieldValueOptionsForFeature,map:this.map}),this._recomputeHasAsyncArcadeExpressions(),await A(()=>!a.updating,t))}_recomputeHasAsyncArcadeExpressions(){this._hasAsyncArcadeExpressions=!1;for(const e of this._expressionsManager.layerExpressionsModelMap.values())for(const t of e.arcadeExecutorUses.keys())if(t.isAsync)return void(this._hasAsyncArcadeExpressions=!0)}_computeFormHeaderField(e){const{activeFeature:t,activeLayer:s}=this;return e&&s&&t?O({attributes:t?.attributes,label:e,layer:s,timeZone:this.effectiveTimeZone}):null}_makeSubmitResults(){const e=new Map;for(const[s,a]of this._reactiveGraphicLookup){const i=[],n=[],r=this._featureFormMap.get(a)?.allAttachmentElementInputs??[];for(const e of r)t(i,e.toSubmitEdits()),e.valid||n.push(e.template.elementId);e.set(s,{feature:s,values:{...a.attributes},invalidFields:[],attachmentEdits:i,invalidAttachmentElementIds:n})}for(const t of this.sharedForm.allFieldInputs)for(const s of t.invalidFeatures)e.get(s)?.invalidFields.push(t.fieldName);return Array.from(e.values())}async _handleSubtypeChanged(e){const t=e.layer;if(this.contingentValuesManager.resetOptionsForFeature(t,e.plainGraphic),ee(t)&&this.contingentValuesManager.resetViolationsForFeature(t,e.plainGraphic),!T(t))return;const a=t.parent?.findSublayerForFeature(e.plainGraphic);if(!a)return;this._layerTemplateUpdateTask=h(this._layerTemplateUpdateTask);const i=s(async t=>{c(t),e.source.sourceLayer=a,e.source.origin=a.graphicOrigin,await this._ensureLayerTemplate(e,t),c(t),this._featureFormMap.get(e)?.destroy(),this._featureFormMap.set(e,this._makeBatchFormInputsForFeature(e)),await p(this._valueChangeTransaction(t=>this._expressionsManager.runAllExpressions([e],t),"user"),t),c(t)});this._layerTemplateUpdateTask=i,await u(this._updatingHandles.addPromise(i.promise))}_emitSubmit(){this.emit("submit",{name:"submit",results:this._makeSubmitResults(),valid:this.valid})}_findAttachmentInput(e){const t=this.activeForm.allAttachmentElementInputs.find(t=>t.template.elementId===e);return t||r.getLogger(this).error(`Attachment input not found for elementId '${e}'`),t}_findAttachment(e,t){const s=e.findAttachment(t);return s||r.getLogger(this).error(`Attachment '${t}' not found for attachment element '${e.template.elementId}'`),s}_makeAttachmentEdits(e){const s=[];for(const a of e.allAttachmentElementInputs)t(s,a.toSubmitEdits());return s}_emitAttachmentsChange(e){const t=e.single.feature;if(!t)return;const s=this._featureFormMap.get(t);this.emit("attachments-change",{name:"attachments-change",feature:t.source,attachmentEdits:this._makeAttachmentEdits(s??this.activeForm),valid:this.valid})}async _valueChangeTransaction(e,t,s){const a=new G(this,t,"string"==typeof s?s:s?.fieldName);if(await e(a),"user"===t&&await this._expressionsManager.runExpressionsDependentOnChangedFields(a),await a.close(),a.hasChanges&&s){const e="string"==typeof s?this.activeForm.allFieldInputs.find(e=>e.fieldName===s):s;e&&(e.userHasChangedValue=!0)}}_prepare(){this.pendingSubtypeChoice?.reject(),this._hasAsyncArcadeExpressions=!1,this._prepareTask=h(this._prepareTask),this._layerTemplateUpdateTask=h(this._layerTemplateUpdateTask),this._layerTemplateMap.clear(),this._updateWorkingFeatures(),l(this._expressionsManager),this.userHasChangedValues=!1,this._expressionsManager=new D({arcadeContext:{editType:this.editType,spatialReference:this.spatialReference??E.WebMercator,map:this.map,timeZone:this.timeZone||"system"}});const{layers:e}=this;if(0===e.length)return;const t=s(async t=>{try{c(t),this._updateWorkingFeatures(),this.contingentValuesManager.layers.addMany(e),await Promise.all(e.map(e=>e.load()));for(const s of e)await this._prepareLayer(s,t);if(this.hasTooManyComplexFeatures)throw new i("too-many-features-with-complex-forms","There are too many features to load into the form with the configured complexity");if(this.hasTooManyFeatures)throw new i("too-many-features","There are too many features to load into the form.");this._prepareSharedFormTemplate(),this.sharedForm=Z(this.sharedFormTemplate,{allFeatures:this._workingFeatures,expressionsManager:this._expressionsManager,getExternalErrorForFeature:this._getExternalErrorForFeature,getFieldValueOptionsForFeature:this._getFieldValueOptionsForFeature,map:this.map}),await this._valueChangeTransaction(async e=>await this._expressionsManager.runAllExpressions(this._workingFeatures.toArray(),e),"expression"),await A(()=>!this.contingentValuesManager.updating)}catch(s){throw m(s)||r.getLogger(this).error("Failed preparing form",s),s}});this._updatingHandles.consumePromise(t.promise),this._prepareTask=t}async _prepareLayer(e,t){const s=se(this.layerInfos,e),a=await J(e,{arcadeExecutorProvider:this._arcadeExecutorProvider,formTimeZone:this.timeZone,attachmentsEnabled:this.attachmentsEnabled},s?.formTemplate);c(t),this._layerTemplateMap.set(e,a);const i=a.getExpressionExecutorsForLayer(e);if(this._expressionsManager.layerExpressionsModelMap.set(e,new N({preserveFieldValuesWhenHidden:a.preserveFieldValuesWhenHidden,executorMap:i})),!this._hasAsyncArcadeExpressions)for(const n of i.values())if(n&&(this._hasAsyncArcadeExpressions=!0===(n.editableExpression?.isAsync||n.requiredExpression?.isAsync||n.valueExpression?.isAsync||n.visibilityExpression?.isAsync),this._hasAsyncArcadeExpressions))break}_prepareSharedFormTemplate(){const e=new Map;for(const t of this._layerTemplateMap.values())for(const s of t.elements){if(Q(s))continue;const t=s.clone();X(t)&&(t.elements=t.elements.filter(e=>!Q(e)));const{elementId:a}=t;e.has(a)?e.get(a).foldIn(t):e.set(a,t)}this.sharedFormTemplate=new q({elements:Array.from(e.values())})}_updateWorkingFeatures(){this._workingFeatures.destroyAll(),this._reactiveContingentValuesManager.reset();for(const t of this._featureFormMap.values())t.destroy();this._featureFormMap.clear(),this._attachmentCache.clear();const{features:e}=this;if(this._reactiveGraphicLookup=new d,0!==e.length){this._workingFeatures.addMany(e.map(R));for(const e of this._workingFeatures)this._reactiveGraphicLookup.set(e.source,e)}}async _syncAttachments(){const{activeFeature:e,activeLayer:t,activeForm:a}=this;if(!(e&&a&&H(t)&&P(t)))return;const i=e.getObjectId();if(null==i)return;const n=this._attachmentCache.get(t),r=a.allAttachmentElementInputs;if(!r.length)return;const l=s(async e=>{let s;if(n){const e=n.get(i);e&&(s=e)}if(!s){s=await j(t,i,r,e);o(this._attachmentCache,t,()=>new d).set(i,s)}for(const t of r)t.applyFetchedAttachments(oe(t,s))});this._syncAttachmentsTask=l,await u(l.promise)}get test(){return{expressionsManager:this._expressionsManager,reactiveGraphicLookup:this._reactiveGraphicLookup,syncAttachmentsTask:this._syncAttachmentsTask}}};e([F()],ae.prototype,"_attachmentCache",void 0),e([F({readOnly:!0})],ae.prototype,"activeFeature",null),e([F()],ae.prototype,"activeFeatureIndex",void 0),e([F({readOnly:!0})],ae.prototype,"activeForm",null),e([F({readOnly:!0})],ae.prototype,"activeLayer",null),e([F()],ae.prototype,"activeAssociation",null),e([F()],ae.prototype,"activeAssociationsInput",null),e([F()],ae.prototype,"activeAssociationType",null),e([F()],ae.prototype,"activeRelationshipInput",null),e([F()],ae.prototype,"attachmentsEnabled",void 0),e([F()],ae.prototype,"callbacks",void 0),e([F()],ae.prototype,"disabled",void 0),e([F()],ae.prototype,"calculating",null),e([F()],ae.prototype,"canGoBack",null),e([F()],ae.prototype,"contingentValuesManager",void 0),e([F()],ae.prototype,"editType",void 0),e([F()],ae.prototype,"features",void 0),e([F()],ae.prototype,"expressionEvaluationFailed",null),e([F()],ae.prototype,"hasNonActiveInvalidFeatures",null),e([F()],ae.prototype,"hasAsyncArcadeExpressions",null),e([F()],ae.prototype,"_hasAsyncArcadeExpressions",void 0),e([F()],ae.prototype,"invalidFeatures",null),e([F()],ae.prototype,"hasVisibleInputs",null),e([F()],ae.prototype,"hasLayersWithContingentValues",null),e([F()],ae.prototype,"formDescription",null),e([F()],ae.prototype,"formTitle",null),e([F()],ae.prototype,"effectiveTimeZone",null),e([F()],ae.prototype,"highlightHelper",void 0),e([F()],ae.prototype,"maximumFeatureCount",void 0),e([F()],ae.prototype,"maximumFeatureCountWithComplexForms",void 0),e([F()],ae.prototype,"visibleInputs",null),e([F()],ae.prototype,"map",void 0),e([F()],ae.prototype,"noVisibleElementsReason",null),e([F()],ae.prototype,"page",null),e([F()],ae.prototype,"pageStack",void 0),e([F()],ae.prototype,"readOnly",void 0),e([F()],ae.prototype,"pendingSubtypeChoice",void 0),e([F()],ae.prototype,"subtypes",null),e([F()],ae.prototype,"spatialReference",void 0),e([F()],ae.prototype,"submitHasBeenAttempted",void 0),e([F()],ae.prototype,"timeZone",void 0),e([F()],ae.prototype,"updating",null),e([F()],ae.prototype,"valid",null),e([F()],ae.prototype,"layers",null),e([F()],ae.prototype,"mode",null),e([F()],ae.prototype,"sharedForm",void 0),e([F()],ae.prototype,"sharedFormTemplate",void 0),e([F()],ae.prototype,"selectedAttachment",null),e([F()],ae.prototype,"selectedAttachmentAddElementId",null),e([F()],ae.prototype,"selectedAttachmentListElementId",null),e([F()],ae.prototype,"selectedAttachmentListInput",null),e([F()],ae.prototype,"showingSelectedAttachmentReplacePage",null),e([F()],ae.prototype,"selectedAttachmentAddInput",null),e([F()],ae.prototype,"selectedAttachmentDetails",null),e([F()],ae.prototype,"userHasChangedValues",void 0),e([F()],ae.prototype,"layerInfos",void 0),e([F()],ae.prototype,"_arcadeExecutorProvider",void 0),e([F()],ae.prototype,"_activeAssociation",void 0),e([F()],ae.prototype,"_activeAssociationsInput",void 0),e([F()],ae.prototype,"_activeRelationshipInput",void 0),e([F()],ae.prototype,"_prepareTask",void 0),e([F()],ae.prototype,"_reactiveGraphicLookup",void 0),e([F()],ae.prototype,"_allAttachmentInputs",null),e([F()],ae.prototype,"_hasPendingAttachmentHydration",null),e([F()],ae.prototype,"_layerTemplateMap",void 0),e([F()],ae.prototype,"_layersSet",null),e([F()],ae.prototype,"_workingFeatures",void 0),e([F()],ae.prototype,"_expressionsManager",void 0),ae=e([I("esri.widgets.BatchAttributeForm.BatchAttributeFormViewModel")],ae);const ie=ae;function ne(e){return null!=e&&e.trim().length>0}function re(e,t){const s=e.keywords;return ne(s)&&s.toLowerCase()===t}function oe(e,t){const s="attachment"===e.input?.type?e.input.attachmentAssociationType:"exact",a=e.attachmentKeyword;if("any"===s)return t;if("exactOrNone"===s){if(te(a))return t.filter(e=>!ne(e.keywords));const e=a.toLowerCase();return t.filter(t=>!ne(t.keywords)||re(t,e))}if(te(a))return t;const i=a.toLowerCase();return t.filter(e=>re(e,i))}export{ie as default};
2
+ import{__decorate as e}from"tslib";import{pushIfSome as t}from"../../core/arrayUtils.js";import{createTask as s}from"../../core/asyncUtils.js";import a from"../../core/Collection.js";import i from"../../core/Error.js";import{EventedAccessor as n}from"../../core/Evented.js";import r from"../../core/Logger.js";import{getOrCreateMapValue as o}from"../../core/MapUtils.js";import{destroyMaybe as l,abortMaybe as h}from"../../core/maybe.js";import{throwIfAborted as c,whenOrAbort as p,ignoreAbortErrors as u,isAbortError as m}from"../../core/promiseUtils.js";import d from"../../core/ReactiveMap.js";import{on as g,sync as y,watch as f,syncAndInitial as v,initial as _,whenOnce as A}from"../../core/reactiveUtils.js";import{property as F,subclass as I}from"../../core/accessorSupport/decorators.js";import{UpdatingHandles as w}from"../../core/support/UpdatingHandles.js";import E from"../../geometry/SpatialReference.js";import{getGraphicLayer as x}from"../../graphic/graphicOriginUtils.js";import{isSubtypeGroupLayer as C,isSubtypeSublayer as T,isFeatureLayer as M,getSubtypesFromLayer as k}from"../../layers/support/layerUtils.js";import{system as b}from"../../time/constants.js";import{getAttachmentKey as V}from"./attachmentUtils.js";import{getLayerTimeZone as S,getEffectiveTimeZone as L,createReactiveGraphic as R,isAttributeFormSupportedLayerWithAttachments as H,layerSupportsAttachments as P,queryAttachmentsForElements as j}from"./batchAttributeFormUtils.js";import{ReactiveContingentValuesManager as U}from"./ReactiveContingentValuesManager.js";import{parseFormTemplateString as O}from"./stringUtils.js";import{ValueChangeTransaction as G}from"./ValueChangeTransaction.js";import{ArcadeExecutorProvider as B}from"./expressions/ArcadeExecutorProvider.js";import{ExpressionsManager as D}from"./expressions/ExpressionsManager.js";import{ExpressionsModel as N}from"./expressions/ExpressionsModel.js";import W from"./inputs/BatchFormInputs.js";import{createBatchFormInputsFromBatchFormTemplate as Z,mergeBatchFormInputsFromNewTemplate as $}from"./inputs/support/createBatchFormInputs.js";import{isGroupInput as K,isFieldInput as z}from"./inputs/support/inputUtils.js";import q from"./templates/BatchFormTemplate.js";import{createBatchFormTemplate as J}from"./templates/support/createBatchFormTemplate.js";import{isExcludedFromSharedForm as Q,isGroupElementTemplate as X}from"./templates/support/templateUtils.js";import{ContingentValuesManager as Y,isLayerWithContingentValues as ee}from"../support/ContingentValuesManager.js";import{isEmptyValue as te}from"../support/forms/formUtils.js";function se(e,t){return e?.find(e=>e.layer===t)}let ae=class extends n{constructor(e){super(e),this._attachmentCache=new d,this.activeFeatureIndex=-1,this.attachmentsEnabled=!1,this.callbacks=null,this.disabled=!1,this.editType="NA",this.features=new a,this._hasAsyncArcadeExpressions=!1,this.highlightHelper=null,this.maximumFeatureCount=2e3,this.maximumFeatureCountWithComplexForms=50,this.map=null,this.pageStack=[],this.readOnly=!1,this.pendingSubtypeChoice=null,this.spatialReference=null,this.submitHasBeenAttempted=!1,this.timeZone=null,this.userHasChangedValues=!1,this.layerInfos=null,this._arcadeExecutorProvider=new B,this._activeAssociation=null,this._activeAssociationsInput=null,this._activeRelationshipInput=null,this._ownContingentValuesManager=null,this._activeFormInputsByElementId=new Map,this._emptyForm=new W({inputs:[]}),this._emptyFormTemplate=new q({elements:[]}),this._featureFormMap=new d,this._prepareTask=null,this._layerTemplateUpdateTask=null,this._syncAttachmentsTask=null,this._reactiveGraphicLookup=new d,this._updatingHandles=new w,this._submitTask=null,this._layerTemplateMap=new d,this._workingFeatures=new a,this._expressionsManager=new D({arcadeContext:{editType:"NA",spatialReference:null,map:null,timeZone:b}}),this._getExternalErrorForFeature=(e,t)=>this._reactiveContingentValuesManager.getViolationTypeForField(e,t),this._getFieldValueOptionsForFeature=e=>this._reactiveContingentValuesManager.getAndWatchFieldValueOptions(e),this.sharedForm=this._emptyForm,this.sharedFormTemplate=this._emptyFormTemplate}initialize(){this.contingentValuesManager||(this.contingentValuesManager=this._ownContingentValuesManager=new Y),this.addHandles([g(()=>this.features,"after-changes",()=>{this.goHome(),this.notifyChange("layers"),this._prepare()},y),f(()=>[this.attachmentsEnabled,this.features,this.map,this.timeZone,this.editType],()=>this._prepare(),y),f(()=>this.activeForm,()=>{this.goHome(),this._activeFormInputsByElementId.clear(),this._syncAttachments()},y),f(()=>this.activeFeature,()=>{this.goHome()},y),f(()=>this.page,e=>{const t=[...this.pageStack];if(t.includes(e))for(;t.length&&t.at(-1)!==e;)t.pop();else t.push(e);this.pageStack=t},v),f(()=>this.contingentValuesManager,e=>{l(this._reactiveContingentValuesManager),this._reactiveContingentValuesManager=new U({manager:e})},_)]),this._prepare()}destroy(){this._prepareTask=h(this._prepareTask),this.pendingSubtypeChoice?.reject(),this._layerTemplateUpdateTask=h(this._layerTemplateUpdateTask),this._syncAttachmentsTask=h(this._syncAttachmentsTask),this._workingFeatures.destroyAll(),l(this._expressionsManager),l(this._reactiveContingentValuesManager),this._updatingHandles.destroy(),this._reactiveGraphicLookup=new d,this._emptyForm.destroy(),this._emptyFormTemplate.destroy(),this._ownContingentValuesManager=l(this._ownContingentValuesManager),this.highlightHelper?.removeAll()}get activeFeature(){const e=this.activeFeatureIndex;return e<0?null:this.features.at(e)}get activeForm(){if("batch"===this.mode)return this.sharedForm;const e=this._workingFeatures.at(this.activeFeatureIndex);if(!e)return this._emptyForm;const t=this._featureFormMap.get(e);if(t)return t;const s=this._makeBatchFormInputsForFeature(e);return s!==this._emptyForm&&this._featureFormMap.set(e,s),s}get activeLayer(){const{activeFeature:e}=this;if(!e)return null;return x(e)??null}get activeAssociation(){return this._activeAssociation}get activeAssociationsInput(){return this._activeAssociationsInput}get activeAssociationType(){return this.activeAssociationsInput?.activeAssociationType}get activeRelationshipInput(){return this._activeRelationshipInput}get calculating(){return this._expressionsManager.calculating}get expressionsManager(){return this._expressionsManager}get canGoBack(){return this.pageStack.length>1}get expressionEvaluationFailed(){return this._expressionsManager.expressionEvaluationFailed}get hasNonActiveInvalidFeatures(){if("batch"===this.mode)return!1;const{activeFeature:e}=this;return this.invalidFeatures.some(t=>t!==e)}get hasAsyncArcadeExpressions(){return this._hasAsyncArcadeExpressions}get hasTooManyFeatures(){return this._workingFeatures.length>this.maximumFeatureCount}get hasTooManyComplexFeatures(){return this._workingFeatures.length>this.maximumFeatureCountWithComplexForms&&this.hasAsyncArcadeExpressions}get invalidFeatures(){return this.sharedForm.invalidFeatures}get hasVisibleInputs(){return this.visibleInputs.length>0}get hasLayersWithContingentValues(){const e=this.contingentValuesManager;for(const t of this.layers)if(e.getFieldsWithContingentValues(t).size>0)return!0;return!1}get formDescription(){return this._computeFormHeaderField(this.activeForm?.description)}get formTitle(){return this._computeFormHeaderField(this.activeForm?.title)}get effectiveTimeZone(){const{activeLayer:e,timeZone:t}=this;if(!e)return t??"system";const s=S(e);return L(t,s)}get visibleInputs(){return this.activeForm.inputs.filter(e=>e.visible)}get noVisibleElementsReason(){if(this.hasVisibleInputs)return null;if(0===this.activeForm.inputs.length)return"noElements";const e=new Set;for(const t of this.activeForm.inputs)switch(t.visibilityCode){case"hidden:not-in-all-layers":case"hidden:no-domain-in-common":e.add("noElementsInCommon");break;case"hidden:field-definition":case"hidden:group-visibility-expression:all-features":case"hidden:visibility-expression:all-features":e.add("allElementsHidden");break;case"hidden:group-visibility-expression:some-features":case"hidden:visibility-expression:some-features":return"elementsHiddenInSome"}return e.has("allElementsHidden")?"allElementsHidden":"noElementsInCommon"}get page(){return this.showingSelectedAttachmentReplacePage&&this.selectedAttachmentDetails?"replacing-attachment":this.selectedAttachmentDetails?"viewing-attachment-details":this.selectedAttachmentAddInput?"adding-attachments":this.selectedAttachmentListInput?"viewing-attachments":this.activeAssociationsInput?.associatedLayer?"viewing-associated-features":this.activeAssociationsInput?"viewing-associated-layers":this.activeRelationshipInput?.showAllRelatedRecords?"viewing-related-records":this.activeRelationshipInput?.showAllCategories?"viewing-related-categories":"default"}get subtypes(){const e=this.activeLayer;return C(e)||T(e)||M(e)?k(e):[]}get status(){const e=this._prepareTask;return null==e?"not-loaded":e.finished?null!=e.error?"failed":"loaded":"loading"}get updating(){return this._updatingHandles.updating||this.calculating}get valid(){return this.sharedForm.valid&&Array.from(this._featureFormMap.values()).every(e=>e.valid)}get layers(){return Array.from(this._layersSet)}get mode(){return this.activeFeatureIndex>-1?"single":"batch"}submit(){if(this.submitHasBeenAttempted=!0,this.validateContingentValues(this._workingFeatures),!this._hasPendingAttachmentHydration)return this._emitSubmit(),Promise.resolve();if(this._submitTask)return this._submitTask.promise;const e=s(async()=>{await Promise.all(this._allAttachmentInputs.map(e=>e.waitForPendingAttachmentUpdateData())),this._emitSubmit()});return this._submitTask=e,e.promise.finally(()=>{this._submitTask===e&&(this._submitTask=null)}),e.promise}get selectedAttachment(){return this._get("selectedAttachment")??null}set selectedAttachment(e){this.showingSelectedAttachmentReplacePage=!1,this._set("selectedAttachment",e),null!=e&&(this.selectedAttachmentAddElementId=null)}get selectedAttachmentAddElementId(){return this._get("selectedAttachmentAddElementId")??null}set selectedAttachmentAddElementId(e){this.showingSelectedAttachmentReplacePage=!1,this._set("selectedAttachmentAddElementId",e),null!=e&&(this.selectedAttachment=null,this.selectedAttachmentListElementId=null)}get selectedAttachmentListElementId(){return this._get("selectedAttachmentListElementId")??null}set selectedAttachmentListElementId(e){this._set("selectedAttachmentListElementId",e),null!=e&&(this.selectedAttachment=null,this.selectedAttachmentAddElementId=null)}get selectedAttachmentListInput(){const e=this.selectedAttachmentListElementId,t=this.activeForm;if(!e||!t)return null;const s=t.allAttachmentElementInputs.find(t=>t.template.elementId===e)||null;return s?.attachments.length?s:null}get showingSelectedAttachmentReplacePage(){return this._get("showingSelectedAttachmentReplacePage")??!1}set showingSelectedAttachmentReplacePage(e){this._set("showingSelectedAttachmentReplacePage",e&&null!=this.selectedAttachmentDetails)}get selectedAttachmentAddInput(){const e=this.selectedAttachmentAddElementId,t=this.activeForm;return e&&t&&t.allAttachmentElementInputs.find(t=>t.template.elementId===e)||null}get selectedAttachmentDetails(){const e=this.selectedAttachment,t=this.activeForm;if(!e||!t)return null;const s=t.allAttachmentElementInputs.find(t=>t.template.elementId===e.elementId);if(!s)return null;const a=s.attachments.findIndex(t=>V(t)===e.attachmentKey);if(-1===a)return null;return{attachment:s.attachments[a],input:s}}get _allAttachmentInputs(){const e=[...this.sharedForm.allAttachmentElementInputs];for(const t of this._featureFormMap.values())e.push(...t.allAttachmentElementInputs);return e}get _hasPendingAttachmentHydration(){return this._allAttachmentInputs.some(e=>e.hasPendingAttachmentUpdateData)}get _layersSet(){const e=new Set;for(const t of this._workingFeatures){const s=x(t.plainGraphic);s&&e.add(s)}return e}applyStashedAttachmentEdits(e){const t=this._allAttachmentInputs;for(const s of e){const e=t.find(e=>e.label===s.label&&e.attachmentKeyword===s.keywords);e&&e.applyStashedEdits(s)}}findFieldInput(e){if(null==e)return;const t=this._activeFormInputsByElementId;if(t.has(e))return t.get(e);const s=this.activeForm.allFieldInputs.find(t=>t.template.elementId===e);return void 0!==s?(t.set(e,s),s):void 0}getFirstVisibleInvalidFieldInput(){if(this.hasVisibleInputs&&!this.activeForm.valid)for(const e of this.visibleInputs){if(K(e)){const t=e.inputs.find(e=>z(e)&&!e.valid);if(t)return{input:t,groupInput:e}}if(z(e)&&!e.valid)return{input:e}}}getFieldInputValue(e){return this.findFieldInput(e)?.value}getValues(e){const t=this._reactiveGraphicLookup.get(e);if(!t)throw new i("feature-not-found","The given feature is not present in the BatchAttributeForm");return{...t.attributes}}async goBack(){switch(this.page){case"replacing-attachment":return void this.setShowingSelectedAttachmentReplacePage(!1);case"viewing-attachment-details":return void this.setSelectedAttachment(null);case"adding-attachments":return void this.setSelectedAttachmentAddElementId(null);case"viewing-attachments":return void this.setSelectedAttachmentListElementId(null);case"viewing-associated-features":return void this.setActiveAssociationsLayer(null);case"viewing-associated-layers":return void this.setActiveAssociationsInput(null);case"viewing-related-categories":case"viewing-related-records":return void this.clearActiveRelationshipCategoryOrInput();default:return}}async goHome(){this.setShowingSelectedAttachmentReplacePage(!1),this.setSelectedAttachment(null),this.setSelectedAttachmentAddElementId(null),this.setSelectedAttachmentListElementId(null),this.setActiveAssociationsLayer(null),this.setActiveAssociationsInput(null),this.clearAllRelationshipSettings()}notifyGeometriesChanged(e){const t=[];for(const s of e){const e=this._reactiveGraphicLookup.get(s);e&&(t.push(e),e.geometry=s.geometry)}this._updatingHandles.consumePromise(this._valueChangeTransaction(async e=>this._expressionsManager.runGeometryDependentExpressions(t,e),"user"))}async overrideOriginalFeature(e,t){await(this._prepareTask?.promise);const s=this._reactiveGraphicLookup.get(e);s&&(s.original=t,this._updatingHandles.consumePromise(this._valueChangeTransaction(e=>this._expressionsManager.runOriginalFeatureDependentExpressions(s,e),"expression")))}async setFieldInputValue(e,t){const{fieldName:s}=e;await this._updatingHandles.addPromise(this._valueChangeTransaction(async a=>{for(const i of e.features)a.setValue(i,s,t)},"user",e))}async setFieldInputValuePerFeature(e,t){await this._updatingHandles.addPromise(this._valueChangeTransaction(async s=>{for(const[a,i]of t)s.setValue(a,e.fieldName,i);s.hasChanges&&(e.userHasChangedValue=!0)},"user",e))}async setValueForFieldName(e,t,s){await this._updatingHandles.addPromise(this._valueChangeTransaction(async a=>{for(const i of s){const s=this._reactiveGraphicLookup.get(i);s&&a.setValue(s,e,t)}},"user",e))}async setValuePerFeatureForFieldName(e,t){await this._updatingHandles.addPromise(this._valueChangeTransaction(async s=>{for(const[a,i]of t){const t=this._reactiveGraphicLookup.get(a);t&&s.setValue(t,e,i)}},"user",e))}async setFieldValue(e,t){const s=this.activeForm.allFieldInputs.find(t=>t.fieldName===e);if(null==s)throw new i("no-field-input-found",`Cannot set the value of FieldInput with field name: ${e} because none was found in the active form`);await this.setFieldInputValue(s,t)}async setValue(e,t){const s=this.findFieldInput(e);if(null==s)throw new i("no-FieldInput-found",`Cannot set the value of FieldInput with ID: ${e} because none was found in the active form`);await this.setFieldInputValue(s,t)}async applySubtypeDefaults(e){const{defaultValues:t}=e,{allFieldInputs:s}=this.activeForm;await this._updatingHandles.addPromise(this._valueChangeTransaction(async e=>{for(const a of s){const{fieldName:s}=a,i=t[s];if(null!=i)for(const t of a.features)e.setValue(t,s,i)}},"user"))}async handleSubtypeChanged(e){const t=this._workingFeatures.at(e);if(t)return this._updatingHandles.addPromise(this._handleSubtypeChanged(t))}async stageAddAttachments(e,t){if(0===t.length)return[];const s=this._findAttachmentInput(e);if(!s)return[];const a=await this._updatingHandles.addPromise(s.stageAddAttachments(t,this._expressionsManager.arcadeContext));return 0===a.length||(this.userHasChangedValues=!0,this._emitAttachmentsChange(s)),a}stageDeleteAttachment(e,t){const s=this._findAttachmentInput(e);if(!s)return;const a=this._findAttachment(s,t);a&&(s.stageDeleteAttachment(a),this.userHasChangedValues=!0,this._emitAttachmentsChange(s))}async stageRenameAttachment(e,t,s){const a=this._findAttachmentInput(e);if(!a)return;const i=this._findAttachment(a,t);i&&(a.stageRenameAttachment(i,s.trim()),this.userHasChangedValues=!0,await a.ensureStagedUpdateData(i),this._emitAttachmentsChange(a))}async stageReplaceAttachment(e,t,s){const a=this._findAttachmentInput(e);if(!a)return!1;const i=this._findAttachment(a,t);if(!i)return!1;return!!await this._updatingHandles.addPromise(a.stageReplaceAttachment(i,s,this._expressionsManager.arcadeContext))&&(this.userHasChangedValues=!0,this._emitAttachmentsChange(a),!0)}clearAttachmentChanges(e){const t=this._findAttachmentInput(e);t&&(t.clearAttachmentChanges(),this._emitAttachmentsChange(t))}setActiveAssociation(e){this._activeAssociation=e}setActiveAssociationsInput(e){this._activeAssociationsInput=e}setActiveAssociationsLayer(e){this._activeAssociationsInput?.setAssociatedLayer(e)}setActiveAssociationType(e){this._activeAssociationsInput?.setActiveAssociationType(e)}setActiveRelationshipInput(e){e||this._activeRelationshipInput?.setActiveCategory(null),this._activeRelationshipInput=e}setActiveRelationshipCategory(e,t){t.setActiveCategory(e),this.setActiveRelationshipInput(t)}clearAllRelationshipSettings(){const e=this.activeRelationshipInput;e&&(e.setActiveCategory(null),e.setShowAllCategories(!1),e.setShowAllRelatedRecords(!1),this._activeRelationshipInput=null)}clearActiveRelationshipCategoryOrInput(){const e=this.activeRelationshipInput;e&&(e.showAllRelatedRecords?e.showAllCategories?e.setActiveCategory(null):this.setActiveRelationshipInput(null):e.showAllCategories&&(e.setShowAllCategories(!1),this.setActiveRelationshipInput(null)))}resetAttachmentChanges(e,t){const s=this._findAttachmentInput(e);if(!s||!s.editable)return;const a=this._findAttachment(s,t);a&&(s.discardStagedEdits(a),this._emitAttachmentsChange(s))}setSelectedAttachment(e){this.selectedAttachment=e??null}setShowingSelectedAttachmentReplacePage(e){this.showingSelectedAttachmentReplacePage=e}setSelectedAttachmentAddElementId(e){this.selectedAttachmentAddElementId=e??null}setSelectedAttachmentListElementId(e){this.selectedAttachmentListElementId=e??null}userChangesHaveMadeFeatureInvalid(e){return!!this._reactiveGraphicLookup.get(e)?.userChangesHaveMadeInvalid}validate(){return!1}validateContingentValues(e,t=!1){if(t&&!this.submitHasBeenAttempted)for(const s of e)this._reactiveContingentValuesManager.validateContingenciesForNonNullFields(s);else for(const s of e)this._reactiveContingentValuesManager.validateContingencyConstraints(s,{includeIncompleteViolations:!0})}_makeBatchFormInputsForFeature(e){const t=this._layerTemplateMap.get(e.layer);return t?Z(t,{allFeatures:new a([e]),expressionsManager:this._expressionsManager,getExternalErrorForFeature:this._getExternalErrorForFeature,getFieldValueOptionsForFeature:this._getFieldValueOptionsForFeature,map:this.map}):this._emptyForm}async _ensureLayerTemplate(e,t){const{_layersSet:s,contingentValuesManager:a}=this,i=e.layer;let n=!1;for(const r of this._layerTemplateMap.keys())s.has(r)||(this._layerTemplateMap.delete(r),this._expressionsManager.layerExpressionsModelMap.delete(r),a.resetOptionsForLayer(r),ee(r)&&a.resetViolationsForLayer(r),n=!0);this._layerTemplateMap.has(i)||(await this._prepareLayer(i,t),c(t),a.layers.add(i),n=!0),n&&(this._prepareSharedFormTemplate(),$(this.sharedForm,this.sharedFormTemplate,{allFeatures:this._workingFeatures,expressionsManager:this._expressionsManager,getFieldValueOptionsForFeature:this._getFieldValueOptionsForFeature,map:this.map}),this._recomputeHasAsyncArcadeExpressions(),await A(()=>!a.updating,t))}_recomputeHasAsyncArcadeExpressions(){this._hasAsyncArcadeExpressions=!1;for(const e of this._expressionsManager.layerExpressionsModelMap.values())for(const t of e.arcadeExecutorUses.keys())if(t.isAsync)return void(this._hasAsyncArcadeExpressions=!0)}_computeFormHeaderField(e){const{activeFeature:t,activeLayer:s}=this;return e&&s&&t?O({attributes:t?.attributes,label:e,layer:s,timeZone:this.effectiveTimeZone}):null}_makeSubmitResults(){const e=new Map;for(const[s,a]of this._reactiveGraphicLookup){const i=[],n=[],r=this._featureFormMap.get(a)?.allAttachmentElementInputs??[];for(const e of r)t(i,e.toSubmitEdits()),e.valid||n.push(e.template.elementId);e.set(s,{feature:s,values:{...a.attributes},invalidFields:[],attachmentEdits:i,invalidAttachmentElementIds:n})}for(const t of this.sharedForm.allFieldInputs)for(const s of t.invalidFeatures)e.get(s)?.invalidFields.push(t.fieldName);return Array.from(e.values())}async _handleSubtypeChanged(e){const t=e.layer;if(this.contingentValuesManager.resetOptionsForFeature(t,e.plainGraphic),ee(t)&&this.contingentValuesManager.resetViolationsForFeature(t,e.plainGraphic),!T(t))return;const a=t.parent?.findSublayerForFeature(e.plainGraphic);if(!a)return;this._layerTemplateUpdateTask=h(this._layerTemplateUpdateTask);const i=s(async t=>{c(t),e.source.sourceLayer=a,e.source.origin=a.graphicOrigin,await this._ensureLayerTemplate(e,t),c(t),this._featureFormMap.get(e)?.destroy(),this._featureFormMap.set(e,this._makeBatchFormInputsForFeature(e)),await p(this._valueChangeTransaction(t=>this._expressionsManager.runAllExpressions([e],t),"user"),t),c(t)});this._layerTemplateUpdateTask=i,await u(this._updatingHandles.addPromise(i.promise))}_emitSubmit(){this.emit("submit",{name:"submit",results:this._makeSubmitResults(),valid:this.valid})}_findAttachmentInput(e){const t=this.activeForm.allAttachmentElementInputs.find(t=>t.template.elementId===e);return t||r.getLogger(this).error(`Attachment input not found for elementId '${e}'`),t}_findAttachment(e,t){const s=e.findAttachment(t);return s||r.getLogger(this).error(`Attachment '${t}' not found for attachment element '${e.template.elementId}'`),s}_makeAttachmentEdits(e){const s=[];for(const a of e.allAttachmentElementInputs)t(s,a.toSubmitEdits());return s}_emitAttachmentsChange(e){const t=e.single.feature;if(!t)return;const s=this._featureFormMap.get(t);this.emit("attachments-change",{name:"attachments-change",feature:t.source,attachmentEdits:this._makeAttachmentEdits(s??this.activeForm),valid:this.valid})}async _valueChangeTransaction(e,t,s){const a=new G(this,t,"string"==typeof s?s:s?.fieldName);if(await e(a),"user"===t&&await this._expressionsManager.runExpressionsDependentOnChangedFields(a),await a.close(),a.hasChanges&&s){const e="string"==typeof s?this.activeForm.allFieldInputs.find(e=>e.fieldName===s):s;e&&(e.userHasChangedValue=!0)}}_prepare(){this.pendingSubtypeChoice?.reject(),this._hasAsyncArcadeExpressions=!1,this._prepareTask=h(this._prepareTask),this._layerTemplateUpdateTask=h(this._layerTemplateUpdateTask),this._layerTemplateMap.clear(),this._updateWorkingFeatures(),l(this._expressionsManager),this.userHasChangedValues=!1,this._expressionsManager=new D({arcadeContext:{editType:this.editType,spatialReference:this.spatialReference??E.WebMercator,map:this.map,timeZone:this.timeZone||"system"}});const{layers:e}=this;if(0===e.length)return;const t=s(async t=>{try{c(t),this._updateWorkingFeatures(),this.contingentValuesManager.layers.addMany(e),await Promise.all(e.map(e=>e.load()));for(const s of e)await this._prepareLayer(s,t);if(this.hasTooManyComplexFeatures)throw new i("too-many-features-with-complex-forms","There are too many features to load into the form with the configured complexity");if(this.hasTooManyFeatures)throw new i("too-many-features","There are too many features to load into the form.");this._prepareSharedFormTemplate(),this.sharedForm=Z(this.sharedFormTemplate,{allFeatures:this._workingFeatures,expressionsManager:this._expressionsManager,getExternalErrorForFeature:this._getExternalErrorForFeature,getFieldValueOptionsForFeature:this._getFieldValueOptionsForFeature,map:this.map}),await this._valueChangeTransaction(async e=>await this._expressionsManager.runAllExpressions(this._workingFeatures.toArray(),e),"expression"),await A(()=>!this.contingentValuesManager.updating)}catch(s){throw m(s)||r.getLogger(this).error("Failed preparing form",s),s}});this._updatingHandles.consumePromise(t.promise),this._prepareTask=t}async _prepareLayer(e,t){const s=se(this.layerInfos,e),a=await J(e,{arcadeExecutorProvider:this._arcadeExecutorProvider,formTimeZone:this.timeZone,attachmentsEnabled:this.attachmentsEnabled},s?.formTemplate);c(t),this._layerTemplateMap.set(e,a);const i=a.getExpressionExecutorsForLayer(e);if(this._expressionsManager.layerExpressionsModelMap.set(e,new N({preserveFieldValuesWhenHidden:a.preserveFieldValuesWhenHidden,executorMap:i})),!this._hasAsyncArcadeExpressions)for(const n of i.values())if(n&&(this._hasAsyncArcadeExpressions=!0===(n.editableExpression?.isAsync||n.requiredExpression?.isAsync||n.valueExpression?.isAsync||n.visibilityExpression?.isAsync),this._hasAsyncArcadeExpressions))break}_prepareSharedFormTemplate(){const e=new Map;for(const t of this._layerTemplateMap.values())for(const s of t.elements){if(Q(s))continue;const t=s.clone();X(t)&&(t.elements=t.elements.filter(e=>!Q(e)));const{elementId:a}=t;e.has(a)?e.get(a).foldIn(t):e.set(a,t)}this.sharedFormTemplate=new q({elements:Array.from(e.values())})}_updateWorkingFeatures(){this._workingFeatures.destroyAll(),this._reactiveContingentValuesManager.reset();for(const t of this._featureFormMap.values())t.destroy();this._featureFormMap.clear(),this._attachmentCache.clear();const{features:e}=this;if(this._reactiveGraphicLookup=new d,0!==e.length){this._workingFeatures.addMany(e.map(R));for(const e of this._workingFeatures)this._reactiveGraphicLookup.set(e.source,e)}}async _syncAttachments(){const{activeFeature:e,activeLayer:t,activeForm:a}=this;if(!(e&&a&&H(t)&&P(t)))return;const i=e.getObjectId();if(null==i)return;const n=this._attachmentCache.get(t),r=a.allAttachmentElementInputs;if(!r.length)return;const l=s(async e=>{let s;if(n){const e=n.get(i);e&&(s=e)}if(!s){s=await j(t,i,r,e);o(this._attachmentCache,t,()=>new d).set(i,s)}for(const t of r)t.applyFetchedAttachments(oe(t,s))});this._syncAttachmentsTask=l,await u(l.promise)}get test(){return{expressionsManager:this._expressionsManager,reactiveGraphicLookup:this._reactiveGraphicLookup,syncAttachmentsTask:this._syncAttachmentsTask}}};e([F()],ae.prototype,"_attachmentCache",void 0),e([F({readOnly:!0})],ae.prototype,"activeFeature",null),e([F()],ae.prototype,"activeFeatureIndex",void 0),e([F({readOnly:!0})],ae.prototype,"activeForm",null),e([F({readOnly:!0})],ae.prototype,"activeLayer",null),e([F()],ae.prototype,"activeAssociation",null),e([F()],ae.prototype,"activeAssociationsInput",null),e([F()],ae.prototype,"activeAssociationType",null),e([F()],ae.prototype,"activeRelationshipInput",null),e([F()],ae.prototype,"attachmentsEnabled",void 0),e([F()],ae.prototype,"callbacks",void 0),e([F()],ae.prototype,"disabled",void 0),e([F()],ae.prototype,"calculating",null),e([F()],ae.prototype,"canGoBack",null),e([F()],ae.prototype,"contingentValuesManager",void 0),e([F()],ae.prototype,"editType",void 0),e([F()],ae.prototype,"features",void 0),e([F()],ae.prototype,"expressionEvaluationFailed",null),e([F()],ae.prototype,"hasNonActiveInvalidFeatures",null),e([F()],ae.prototype,"hasAsyncArcadeExpressions",null),e([F()],ae.prototype,"_hasAsyncArcadeExpressions",void 0),e([F()],ae.prototype,"invalidFeatures",null),e([F()],ae.prototype,"hasVisibleInputs",null),e([F()],ae.prototype,"hasLayersWithContingentValues",null),e([F()],ae.prototype,"formDescription",null),e([F()],ae.prototype,"formTitle",null),e([F()],ae.prototype,"effectiveTimeZone",null),e([F()],ae.prototype,"highlightHelper",void 0),e([F()],ae.prototype,"maximumFeatureCount",void 0),e([F()],ae.prototype,"maximumFeatureCountWithComplexForms",void 0),e([F()],ae.prototype,"visibleInputs",null),e([F()],ae.prototype,"map",void 0),e([F()],ae.prototype,"noVisibleElementsReason",null),e([F()],ae.prototype,"page",null),e([F()],ae.prototype,"pageStack",void 0),e([F()],ae.prototype,"readOnly",void 0),e([F()],ae.prototype,"pendingSubtypeChoice",void 0),e([F()],ae.prototype,"subtypes",null),e([F()],ae.prototype,"spatialReference",void 0),e([F()],ae.prototype,"submitHasBeenAttempted",void 0),e([F()],ae.prototype,"timeZone",void 0),e([F()],ae.prototype,"updating",null),e([F()],ae.prototype,"valid",null),e([F()],ae.prototype,"layers",null),e([F()],ae.prototype,"mode",null),e([F()],ae.prototype,"sharedForm",void 0),e([F()],ae.prototype,"sharedFormTemplate",void 0),e([F()],ae.prototype,"selectedAttachment",null),e([F()],ae.prototype,"selectedAttachmentAddElementId",null),e([F()],ae.prototype,"selectedAttachmentListElementId",null),e([F()],ae.prototype,"selectedAttachmentListInput",null),e([F()],ae.prototype,"showingSelectedAttachmentReplacePage",null),e([F()],ae.prototype,"selectedAttachmentAddInput",null),e([F()],ae.prototype,"selectedAttachmentDetails",null),e([F()],ae.prototype,"userHasChangedValues",void 0),e([F()],ae.prototype,"layerInfos",void 0),e([F()],ae.prototype,"_arcadeExecutorProvider",void 0),e([F()],ae.prototype,"_activeAssociation",void 0),e([F()],ae.prototype,"_activeAssociationsInput",void 0),e([F()],ae.prototype,"_activeRelationshipInput",void 0),e([F()],ae.prototype,"_prepareTask",void 0),e([F()],ae.prototype,"_reactiveGraphicLookup",void 0),e([F()],ae.prototype,"_allAttachmentInputs",null),e([F()],ae.prototype,"_hasPendingAttachmentHydration",null),e([F()],ae.prototype,"_layerTemplateMap",void 0),e([F()],ae.prototype,"_layersSet",null),e([F()],ae.prototype,"_workingFeatures",void 0),e([F()],ae.prototype,"_expressionsManager",void 0),ae=e([I("esri.widgets.BatchAttributeForm.BatchAttributeFormViewModel")],ae);const ie=ae;function ne(e){return null!=e&&e.trim().length>0}function re(e,t){const s=e.keywords;return ne(s)&&s.toLowerCase()===t}function oe(e,t){const s="attachment"===e.input?.type?e.input.attachmentAssociationType:"exact",a=e.attachmentKeyword;if("any"===s)return t;if("exactOrNone"===s){if(te(a))return t.filter(e=>!ne(e.keywords));const e=a.toLowerCase();return t.filter(t=>!ne(t.keywords)||re(t,e))}if(te(a))return t;const i=a.toLowerCase();return t.filter(e=>re(e,i))}export{ie as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{substitute as e}from"../../intl.js";import{equalsShallow as t}from"../../core/lang.js";import{throwIfAborted as i}from"../../core/promiseUtils.js";import{isLayerWithHistoricMoment as n}from"../../layers/mixins/EditBusLayer.js";import{isSubtypeSublayer as o,getSubtypesFromLayer as r}from"../../layers/support/layerUtils.js";import a from"../../rest/support/AttachmentQuery.js";import{unknown as s,utc as l}from"../../time/constants.js";import{ReactiveGraphic as u}from"./ReactiveGraphic.js";import{isMultipleChoiceFieldInput as c,isGroupInput as d}from"./inputs/support/inputUtils.js";import{getIntlOptionsForField as p}from"../support/dateUtils.js";import{isEmptyValue as m,getRangeErrorMessage as f,shouldUseScientificNotation as y,scientificNumberFormatOptions as v,numberFormatOptions as h}from"../support/forms/formUtils.js";const b=(e,t)=>null!=e&&e.input?.type===t;function g(e){return new u({source:e})}function j(t,i,n,o){const{dataType:r,minLength:a}=t,s=n?.validationErrors;if(!s||!i)return null;if("batch-attribute-form-validation::features-have-different-errors"===i)return s.invalidBatchFormType;if("input-validation-error::cannot-be-empty"===i)return s.cannotBeNull;if("domain-validation-error::value-out-of-range"===i||"numeric-range-validation-error::out-of-range"===i){const{field:i,range:n}=t,a={type:"date",intlOptions:{timeZone:"date"===i.type&&o?o:void 0,...p(i)}},l=f(n,s);return e(l,n,{format:{max:"date"===r?a:null!=n.max&&y(n.max)?v:h,min:"date"===r?a:null!=n.min&&y(n.min)?v:h}})}return"domain-validation-error::invalid-coded-value"===i?s.invalidCodedValue:"type-validation-error::invalid-type"===i?s.invalidType:"length-validation-error::too-short"===i?e(s.tooShort,{min:a}):"multiple-choice-validation-error::too-few-selected-choices"===i&&c(t)?e(s.tooFewSelectedChoices,{min:t.input.minimumChoices}):"multiple-choice-validation-error::too-many-selected-choices"===i&&c(t)?e(s.tooManySelectedChoices,{max:t.input.maximumChoices}):"length-validation-error::too-long"===i?null:"contingent-values-validation-error::contingency-violation-warning"===i||"contingent-values-validation-error::contingency-violation-error"===i?s.valuesIncompatible:null}function w(e,t,i){const n=i?.validationErrors;if(!n)return null;let o=null;for(const r of e.invalidHiddenInputs)switch(r.effectiveVisibilityCode){case"hidden:visibility-expression:all-features":case"hidden:group-visibility-expression:all-features":case"hidden:field-definition":return"single"===t?n.nonVisibleError_changeValues:n.nonVisibleError_checkIndividualFeatures;case"hidden:no-domain-in-common":case"hidden:visibility-expression:some-features":case"hidden:group-visibility-expression:some-features":case"hidden:not-in-all-layers":o=n.nonVisibleError_checkIndividualFeatures;break;case"visible":continue;default:r.effectiveVisibilityCode}return o}function x(e){return null!=e&&"object"==typeof e&&"type"in e&&("feature"===e.type||"geojson"===e.type||"knowledge-graph-sublayer"===e.type||"oriented-imagery"===e.type||"scene"===e.type||"subtype-sublayer"===e.type)}function I(e){return!!x(e)||!!(null!=e&&"object"==typeof e&&"type"in e&&e.type&&"id"in e&&e.id&&"fields"in e&&e.fields&&"fieldsIndex"in e&&e.fieldsIndex&&"objectIdField"in e&&e.objectIdField&&"capabilities"in e&&"getField"in e&&e.getField)}function T(e){return I(e)&&"queryAttachments"in e}function V(e){return null!=e&&"object"==typeof e&&"type"in e&&("feature"===e.type||"subtype-sublayer"===e.type)}function k(e){if(!T(e))return!1;const t=e?.effectiveCapabilities??e?.capabilities;return!!t?.data?.supportsAttachment}async function C(e,t,r,s){const l=new Set;let u=!1;for(const i of r){if("attachment"===i.input?.type&&("any"===i.input.attachmentAssociationType||"exactOrNone"===i.input.attachmentAssociationType)){u=!0;break}if(m(i.attachmentKeyword)){u=!0;break}l.add(i.attachmentKeyword)}const c=l.size&&!u?Array.from(l):void 0,d=new a({objectIds:[t],returnMetadata:!0,keywords:c}),p=o(e)?e.parent:e;n(p)&&p.historicMoment&&(d.historicMoment=p.historicMoment);const f=await e.queryAttachments(d,{signal:s});return i(s),f[t]??[]}function F(e,i,n){const o=r(e),a=o?.find(e=>e.code===n);if(!a)return!1;const s=o?.find(e=>e.code===i);return!t(a.defaultValues,s?.defaultValues)&&Object.values(a.defaultValues).some(e=>null!=e)}function A(e){return e.reduce((e,t)=>d(t)?[...e,...t.inputs]:[...e,t],[])}function U(e){return o(e)&&e.parent&&(e=e.parent),e&&"datesInUnknownTimezone"in e&&e.datesInUnknownTimezone?s:e&&"preferredTimeZone"in e&&e.preferredTimeZone?e.preferredTimeZone:null}function E(e,t){return e||t?t===s?l:e&&e!==s?e:t??"system":"system"}export{g as createReactiveGraphic,A as flattenInputs,E as getEffectiveTimeZone,w as getHiddenFieldsValidationErrorMessage,U as getLayerTimeZone,j as getVisibleFieldInputValidationErrorMessage,V as isAssociationsLayerUnion,I as isAttributeFormSupportedLayer,x as isAttributeFormSupportedLayerUnion,T as isAttributeFormSupportedLayerWithAttachments,b as isElementTemplateWithInputType,k as layerSupportsAttachments,C as queryAttachmentsForElements,F as subtypeChangeShouldPrompt};
2
+ import{substitute as e}from"../../intl.js";import{equalsShallow as t}from"../../core/lang.js";import{throwIfAborted as i}from"../../core/promiseUtils.js";import{isLayerWithHistoricMoment as n}from"../../layers/mixins/EditBusLayer.js";import{isSubtypeSublayer as r,getSubtypesFromLayer as o}from"../../layers/support/layerUtils.js";import a from"../../rest/support/AttachmentQuery.js";import{unknown as s,utc as l}from"../../time/constants.js";import{ReactiveGraphic as u}from"./ReactiveGraphic.js";import{isMultipleChoiceFieldInput as c,isGroupInput as d}from"./inputs/support/inputUtils.js";import{getIntlOptionsForField as p}from"../support/dateUtils.js";import{isEmptyValue as f,getRangeErrorMessage as m,shouldUseScientificNotation as y,scientificNumberFormatOptions as v,numberFormatOptions as h}from"../support/forms/formUtils.js";const b=(e,t)=>null!=e&&e.input?.type===t;function g(e){return new u({source:e})}function j(t,i,n,r){const{dataType:o,minLength:a}=t,s=n?.validationErrors;if(!s||!i)return null;if("batch-attribute-form-validation::features-have-different-errors"===i)return s.invalidBatchFormType;if("input-validation-error::cannot-be-empty"===i)return s.cannotBeNull;if("domain-validation-error::value-out-of-range"===i||"numeric-range-validation-error::out-of-range"===i){const{field:i,range:n}=t,a={type:"date",intlOptions:{timeZone:"date"===i.type&&r?r:void 0,...p(i)}},l=m(n,s);return e(l,n,{format:{max:"date"===o?a:null!=n.max&&y(n.max)?v:h,min:"date"===o?a:null!=n.min&&y(n.min)?v:h}})}if("domain-validation-error::invalid-coded-value"===i)return s.invalidCodedValue;if("type-validation-error::invalid-type"===i)return s.invalidType;if("length-validation-error::too-short"===i)return e(s.tooShort,{min:a});if(c(t)){if("multiple-choice-validation-error::too-few-selected-choices"===i)return e(s.tooFewSelectedChoices,{min:t.input.minimumChoices});if("multiple-choice-validation-error::too-many-selected-choices"===i)return e(s.tooManySelectedChoices,{max:t.input.maximumChoices})}return"length-validation-error::too-long"===i?null:"contingent-values-validation-error::contingency-violation-warning"===i||"contingent-values-validation-error::contingency-violation-error"===i?s.valuesIncompatible:null}function w(e,t,i){const n=i?.validationErrors;if(!n)return null;let r=null;for(const o of e.invalidHiddenInputs)switch(o.effectiveVisibilityCode){case"hidden:visibility-expression:all-features":case"hidden:group-visibility-expression:all-features":case"hidden:field-definition":return"single"===t?n.nonVisibleError_changeValues:n.nonVisibleError_checkIndividualFeatures;case"hidden:no-domain-in-common":case"hidden:visibility-expression:some-features":case"hidden:group-visibility-expression:some-features":case"hidden:not-in-all-layers":r=n.nonVisibleError_checkIndividualFeatures;break;case"visible":continue;default:o.effectiveVisibilityCode}return r}function x(e){return null!=e&&"object"==typeof e&&"type"in e&&("feature"===e.type||"geojson"===e.type||"knowledge-graph-sublayer"===e.type||"oriented-imagery"===e.type||"scene"===e.type||"subtype-sublayer"===e.type)}function I(e){return!!x(e)||!!(null!=e&&"object"==typeof e&&"type"in e&&e.type&&"id"in e&&e.id&&"fields"in e&&e.fields&&"fieldsIndex"in e&&e.fieldsIndex&&"objectIdField"in e&&e.objectIdField&&"capabilities"in e&&"getField"in e&&e.getField)}function T(e){return I(e)&&"queryAttachments"in e}function V(e){return null!=e&&"object"==typeof e&&"type"in e&&("feature"===e.type||"subtype-sublayer"===e.type)}function k(e){if(!T(e))return!1;const t=e?.effectiveCapabilities??e?.capabilities;return!!t?.data?.supportsAttachment}async function C(e,t,o,s){const l=new Set;let u=!1;for(const i of o){if("attachment"===i.input?.type&&("any"===i.input.attachmentAssociationType||"exactOrNone"===i.input.attachmentAssociationType)){u=!0;break}if(f(i.attachmentKeyword)){u=!0;break}l.add(i.attachmentKeyword)}const c=l.size&&!u?Array.from(l):void 0,d=new a({objectIds:[t],returnMetadata:!0,keywords:c}),p=r(e)?e.parent:e;n(p)&&p.historicMoment&&(d.historicMoment=p.historicMoment);const m=await e.queryAttachments(d,{signal:s});return i(s),m[t]??[]}function F(e,i,n){const r=o(e),a=r?.find(e=>e.code===n);if(!a)return!1;const s=r?.find(e=>e.code===i);return!t(a.defaultValues,s?.defaultValues)&&Object.values(a.defaultValues).some(e=>null!=e)}function A(e){return e.reduce((e,t)=>d(t)?[...e,...t.inputs]:[...e,t],[])}function U(e){return r(e)&&e.parent&&(e=e.parent),e&&"datesInUnknownTimezone"in e&&e.datesInUnknownTimezone?s:e&&"preferredTimeZone"in e&&e.preferredTimeZone?e.preferredTimeZone:null}function E(e,t){return e||t?t===s?l:e&&e!==s?e:t??"system":"system"}export{g as createReactiveGraphic,A as flattenInputs,E as getEffectiveTimeZone,w as getHiddenFieldsValidationErrorMessage,U as getLayerTimeZone,j as getVisibleFieldInputValidationErrorMessage,V as isAssociationsLayerUnion,I as isAttributeFormSupportedLayer,x as isAttributeFormSupportedLayerUnion,T as isAttributeFormSupportedLayerWithAttachments,b as isElementTemplateWithInputType,k as layerSupportsAttachments,C as queryAttachmentsForElements,F as subtypeChangeShouldPrompt};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{createArcadeProfile as e,createArcadeExecutor as t}from"../../../arcade.js";const s=e("form-calculation");class r{constructor(){this._executors=new Map,this._executorPromises=new Map}async getArcadeExecutor(e){return this._executors.has(e)?this._executors.get(e):this._executorPromises.has(e)?this._executorPromises.get(e):this._createExecutor(e)}async _createExecutor(e){try{const r=t(e,s);this._executorPromises.set(e,r);const o=await r;return this._executors.set(e,o),o}finally{this._executorPromises.delete(e)}}}export{r as ArcadeExecutorProvider};
2
+ import{createArcadeProfile as e,createArcadeExecutor as t}from"../../../arcade.js";import r from"../../../core/Logger.js";const s=()=>r.getLogger("esri.widgets.BatchAttributeForm.expressions.ExpressionsManager"),o=e("form-calculation");class c{constructor(){this._executors=new Map,this._executorPromises=new Map}async getArcadeExecutor(e){return this._executors.has(e)?this._executors.get(e):this._executorPromises.has(e)?this._executorPromises.get(e):this._createExecutor(e)}async _createExecutor(e){try{const r=t(e,o);this._executorPromises.set(e,r);const s=await r;return this._executors.set(e,s),s}catch(r){return void s().error("Arcade expression failed to compile.",r,{expression:e})}finally{this._executorPromises.delete(e)}}}export{c as ArcadeExecutorProvider};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../core/Accessor.js";import r from"../../../core/Error.js";import s from"../../../core/Logger.js";import{getOrCreateMapValue as o}from"../../../core/MapUtils.js";import{whenOrAbort as a}from"../../../core/promiseUtils.js";import n from"../../../core/ReactiveMap.js";import{property as i,subclass as l}from"../../../core/accessorSupport/decorators.js";import{DateOnly as u}from"../../../core/sql/DateOnly.js";import{TimeOnly as c}from"../../../core/sql/TimeOnly.js";import{makeUseId as p}from"../inputs/support/inputUtils.js";import{isFieldElementTemplate as d,isGroupElementTemplate as f}from"../templates/support/templateUtils.js";let h=null;const m=()=>s.getLogger("esri.widgets.BatchAttributeForm.expressions.ExpressionsManager");let g=class extends t{constructor(e){super(e),this.calculating=!1,this.arcadeContext=null,this._abortController=new AbortController,this.layerExpressionsModelMap=new Map,this.evaluatedExpressions=new n,this.expressionEvaluationFailed=!1}destroy(){this.abort()}abort(){this._abortController.abort()}async runAllExpressions(e,t){return this._evaluateSpecifiedComponentsForEachFeature(e,v,t)}async runGeometryDependentExpressions(e,t){return this._evaluateSpecifiedComponentsForEachFeature(e,b,t)}async runOriginalFeatureDependentExpressions(e,t){return this._evaluateSpecifiedComponentsForEachFeature([e],w,t)}async runExpressionsDependentOnChangedFields(e){try{this.calculating=!0;const t=Array.from(e.changes).map(([t,r])=>this.runExpressionsDependentOnChangedFieldsForFeature([...r.keys()],t,e));S(await Promise.allSettled(t))}catch(t){m().error(t),this.expressionEvaluationFailed=!0}finally{this.calculating=!1}}async runExpressionsDependentOnChangedFieldsForFeature(e,t,r){if(this._abortController.signal.aborted)return;const s=this.layerExpressionsModelMap.get(t.layer);if(!s||0===s.components.length)return;const o=new Set,a=new Set(e),n=new Set;for(;a.size>0;){const[e]=a;if(a.delete(e),o.has(e))continue;o.add(e);const i=s.fieldReferencesMap.get(e.toLowerCase());if(!i)continue;for(const t of i)n.has(t)&&i.delete(t);if(0===i.size)continue;const l=new Set;await this.evaluateAffectedComponents([...i],t,s,r,l);for(const t of i)n.add(t);for(const t of l)o.has(t)||a.add(t)}}async evaluateAffectedComponents(e,t,r,s,o){const i=new Map;for(const a of e)i.has(a)||i.set(a,this.createSccEvaluator(a,t,i,r));if(0===i.size)return;const l=[...i.values()],u={transaction:s,changedFields:o,previousOutcomes:new n},c=l.map(e=>e.evaluate(u));S(await a(Promise.allSettled(c),this._abortController))}createSccEvaluator(e,t,r,s){const a=new y(e,t,this.arcadeContext,s,this.evaluatedExpressions,this._abortController);for(const n of e.adjacencyList)a.dependentEvaluators.push(o(r,n,()=>this.createSccEvaluator(n,t,r,s)));return a}async _evaluateSpecifiedComponentsForEachFeature(e,t,r){this.calculating=!0;try{const s=[];for(const o of e){const e=this.layerExpressionsModelMap.get(o.layer);if(!e||0===e.components.length)continue;const a=new Set;s.push(this.evaluateAffectedComponents(t(e),o,e,r,a))}S(await a(Promise.allSettled(s),this._abortController))}catch(s){m().error(s),this.expressionEvaluationFailed=!0}finally{this.calculating=!1}}};e([i()],g.prototype,"calculating",void 0),e([i({constructOnly:!0})],g.prototype,"arcadeContext",void 0),e([i()],g.prototype,"_abortController",void 0),e([i()],g.prototype,"layerExpressionsModelMap",void 0),e([i()],g.prototype,"evaluatedExpressions",void 0),e([i()],g.prototype,"expressionEvaluationFailed",void 0),g=e([l("esri.widgets.BatchAttributeForm.expressions.ExpressionsManager")],g);class y{constructor(e,t,r,s,o,a){this.scc=e,this.feature=t,this.arcadeContextInfo=r,this.expressionsModel=s,this.evaluatedExpressions=o,this._abortController=a,this.dependentEvaluators=[],this._evaluatorPromise=null}get baseContext(){const{editType:e,map:t,spatialReference:r,timeZone:s}=this.arcadeContextInfo,o=this.feature.layer,a="scene"===o?.type&&null!=o.associatedLayer?o.associatedLayer:o;return{variables:{$originalfeature:this.feature.original,$editcontext:{editType:e},$layer:a,$featureset:a,$datastore:a?.url,$feature:this.feature.plainGraphic,$map:t},executeContext:{rawOutput:!0,spatialReference:r??void 0,timeZone:s,abortSignal:this._abortController.signal}}}evaluate(e){return null==this._evaluatorPromise&&(this._evaluatorPromise=this._evaluate(e)),this._evaluatorPromise}async _evaluate(e){null===h&&(h=await import("../../../arcade/languageUtils.js"));const t=[],s=this.dependentEvaluators.map(t=>t.evaluate(e));S(await a(Promise.allSettled(s),this._abortController));for(const a of this.scc.executors){const s=this.baseContext;if(this._abortController.signal.aborted)break;const l=this.expressionsModel.arcadeExecutorUses.get(a)??[],u=o(this.evaluatedExpressions,this.feature,()=>new n);let c=null,d=null;try{c=a.isAsync?await a.executeAsync(s.variables,s.executeContext):a.execute(s.variables,s.executeContext),d={result:c,status:"success"}}catch(i){d={error:i,status:"error"}}const{transaction:f,changedFields:h,previousOutcomes:m}=e;for(const t of l){const r=p(t),s=u.get(r);s&&m.set(r,s);const o=this.expressionsModel.elementTemplateMap.get(t.elementId);switch(t.executorPurpose){case"editable":case"required":case"text":u.set(p(t),d);break;case"value":{if("error"===d?.status)continue;const e=o.getExpressionExecutorsForLayer(this.feature.layer);let t=!0;if(e?.editableExpression&&(t=!1===u.get(p({elementId:o.elementId,executorPurpose:"editable"}))?.result),t){const e=this.feature.getAttribute(o.fieldName)??null,t=x(d.result,this.feature,o.fieldName,this.arcadeContextInfo.timeZone);t!==e&&(f.setValue(this.feature,o.fieldName,t),h.add(o.fieldName))}}break;case"visibility":u.set(p(t),d),this.expressionsModel.preserveFieldValuesWhenHidden||!0!==s?.result||!1!==d.result||"user"!==f.originActor||C(o,this.feature,u,e)}}if("error"===d?.status){const e=new Set;for(const t of l){const r=this.expressionsModel.elementTemplateMap.get(t.elementId);if(r)switch(t.executorPurpose){case"editable":e.add(r.label+" - Editable expression");break;case"required":e.add(r.label+" - Required expression");break;case"value":e.add(r.label+" - Value expression");break;case"visibility":e.add(r.label+" - Visibility expression")}}t.push(e.size>0?new r("expression-evaluation-failed","Arcade evaluation failed ("+[...e].join(",")+")"):new r("expression-evaluation-failed","Arcade evaluation failed "))}}if(t.length>0)throw E(t)}}function x(e,t,s,o){if(null===e)return null;const a=t.layer.fieldsIndex.get(s);if(!a)throw new r("field-not-found","Unable set field value as the field cannot be found. ("+s+")");switch(a.type){case"big-integer":case"integer":case"long":case"oid":case"small-integer":case"single":case"double":return h.toNumber(e);case"global-id":case"guid":case"string":return h.toString(e);case"date":{if(h.isDate(e))return e.getTime();const t=h.toDate(e,o);if(!t)throw new r("unsupported-value-type","Arcade return type is not a supported field type. ("+s+")");return t.getTime()}case"date-only":{if(h.isDateOnly(e))return e.toStorageFormat();if(h.isDate(e))return u.fromDateTime(e.toDateTime()).toStorageFormat();const t=u.fromString(h.toString(e));if(!t)throw new r("unsupported-value-type","Arcade return type is not a supported field type.");return t.toStorageFormat()}case"time-only":{if(h.isTime(e))return e.toStorageString();if(h.isDate(e)){return c.fromDateTime(e.toDateTime()).toStorageString()}const t=c.fromString(h.toString(e));if(!t)throw new r("unsupported-value-type","Arcade return type is not a supported field type.");return t.toStorageString()}case"timestamp-offset":{if(h.isDate(e))return e.toISOString(!1);const t=h.toDate(e,o);if(!t)throw new r("unsupported-value-type","Arcade return type is not a supported field type. ("+s+")");return t.toISOString(!1)}}throw new r("unsupported-value-type","Arcade return type is not a supported field type. ("+s+")")}function v(e){return e.components}function b(e){return Array.from(e.geometryReferences)}function w(e){return Array.from(e.originalFeatureReferences)}function E(e){return new AggregateError(e,`One or more expression executions failed. First error message: ${e[0].message}`)}function S(e){const t=[],r=new Set;for(const s of e){if("fulfilled"===s.status)continue;const e=s.reason instanceof AggregateError?s.reason.errors:[s.reason];for(const s of e)r.has(s)||(r.add(s),t.push(s))}if(t.length>0)throw E(t)}function C(e,t,r,s){d(e)?F(e,t,r,s):f(e)&&A(e,t,r,s)}function F(e,t,r,s){const{group:o}=e;o&&!_(o,r,s.previousOutcomes)||M(t,e,s)}function A(e,t,r,s){for(const o of e.elements)d(o)&&_(o,r,s.previousOutcomes)&&M(t,o,s)}function M(e,{fieldName:t},r){null!==e.getAttribute(t)&&r.changedFields.add(t),r.transaction.setValue(e,t,null)}function _(e,t,r){const s=p({elementId:e.elementId,executorPurpose:"visibility"}),o=r.get(s)??t.get(s);return!o||!!o.result}export{g as ExpressionsManager};
2
+ import{__decorate as e}from"tslib";import t from"../../../core/Accessor.js";import r from"../../../core/Error.js";import o from"../../../core/Logger.js";import{getOrCreateMapValue as s}from"../../../core/MapUtils.js";import{whenOrAbort as a}from"../../../core/promiseUtils.js";import n from"../../../core/ReactiveMap.js";import{property as i,subclass as l}from"../../../core/accessorSupport/decorators.js";import{DateOnly as u}from"../../../core/sql/DateOnly.js";import{TimeOnly as c}from"../../../core/sql/TimeOnly.js";import{makeUseId as d}from"../inputs/support/inputUtils.js";import{isFieldElementTemplate as p,isGroupElementTemplate as f}from"../templates/support/templateUtils.js";let h=null;const m=()=>o.getLogger("esri.widgets.BatchAttributeForm.expressions.ExpressionsManager");let g=class extends t{constructor(e){super(e),this.calculating=!1,this.arcadeContext=null,this._abortController=new AbortController,this.layerExpressionsModelMap=new Map,this.evaluatedExpressions=new n,this.expressionEvaluationFailed=!1}destroy(){this.abort()}abort(){this._abortController.abort()}async runAllExpressions(e,t){return this._evaluateSpecifiedComponentsForEachFeature(e,w,t)}async runGeometryDependentExpressions(e,t){return this._evaluateSpecifiedComponentsForEachFeature(e,E,t)}async runOriginalFeatureDependentExpressions(e,t){return this._evaluateSpecifiedComponentsForEachFeature([e],C,t)}async runExpressionsDependentOnChangedFields(e){try{this.calculating=!0;const t=Array.from(e.changes).map(([t,r])=>this.runExpressionsDependentOnChangedFieldsForFeature([...r.keys()],t,e));F(await Promise.allSettled(t))}catch(t){m().error(t),this.expressionEvaluationFailed=!0}finally{this.calculating=!1}}async runExpressionsDependentOnChangedFieldsForFeature(e,t,r){if(this._abortController.signal.aborted)return;const o=this.layerExpressionsModelMap.get(t.layer);if(!o||0===o.components.length)return;const s=new Set,a=new Set(e),n=new Set;for(;a.size>0;){const[e]=a;if(a.delete(e),s.has(e))continue;s.add(e);const i=o.fieldReferencesMap.get(e.toLowerCase());if(!i)continue;for(const t of i)n.has(t)&&i.delete(t);if(0===i.size)continue;const l=new Set;await this.evaluateAffectedComponents([...i],t,o,r,l);for(const t of i)n.add(t);for(const t of l)s.has(t)||a.add(t)}}async evaluateAffectedComponents(e,t,r,o,s){const i=new Map;for(const a of e)i.has(a)||i.set(a,this.createSccEvaluator(a,t,i,r));if(0===i.size)return;const l=[...i.values()],u={transaction:o,changedFields:s,previousOutcomes:new n},c=l.map(e=>e.evaluate(u));F(await a(Promise.allSettled(c),this._abortController))}createSccEvaluator(e,t,r,o){const a=new v(e,t,this.arcadeContext,o,this.evaluatedExpressions,this._abortController);for(const n of e.adjacencyList)a.dependentEvaluators.push(s(r,n,()=>this.createSccEvaluator(n,t,r,o)));return a}async _evaluateSpecifiedComponentsForEachFeature(e,t,r){this.calculating=!0;try{const o=[];for(const s of e){const e=this.layerExpressionsModelMap.get(s.layer);if(!e||0===e.components.length)continue;const a=new Set;o.push(this.evaluateAffectedComponents(t(e),s,e,r,a))}F(await a(Promise.allSettled(o),this._abortController))}catch(o){m().error(o),this.expressionEvaluationFailed=!0}finally{this.calculating=!1}}};e([i()],g.prototype,"calculating",void 0),e([i({constructOnly:!0})],g.prototype,"arcadeContext",void 0),e([i()],g.prototype,"_abortController",void 0),e([i()],g.prototype,"layerExpressionsModelMap",void 0),e([i()],g.prototype,"evaluatedExpressions",void 0),e([i()],g.prototype,"expressionEvaluationFailed",void 0),g=e([l("esri.widgets.BatchAttributeForm.expressions.ExpressionsManager")],g);class v{constructor(e,t,r,o,s,a){this.scc=e,this.feature=t,this.arcadeContextInfo=r,this.expressionsModel=o,this.evaluatedExpressions=s,this._abortController=a,this.dependentEvaluators=[],this._evaluatorPromise=null}get baseContext(){const{editType:e,map:t,spatialReference:r,timeZone:o}=this.arcadeContextInfo,s=this.feature.layer,a="scene"===s?.type&&null!=s.associatedLayer?s.associatedLayer:s;return{variables:{$originalfeature:this.feature.original,$editcontext:{editType:e},$layer:a,$featureset:a,$datastore:a?.url,$feature:this.feature.plainGraphic,$map:t},executeContext:{rawOutput:!0,spatialReference:r??void 0,timeZone:o,abortSignal:this._abortController.signal}}}evaluate(e){return null==this._evaluatorPromise&&(this._evaluatorPromise=this._evaluate(e)),this._evaluatorPromise}async _evaluate(e){null===h&&(h=await import("../../../arcade/languageUtils.js"));const t=[],o=this.dependentEvaluators.map(t=>t.evaluate(e));F(await a(Promise.allSettled(o),this._abortController));for(const a of this.scc.executors){const o=this.baseContext;if(this._abortController.signal.aborted)break;const u=this.expressionsModel.arcadeExecutorUses.get(a)??[],c=s(this.evaluatedExpressions,this.feature,()=>new n);let p=null,f=null;try{p=a.isAsync?await a.executeAsync(o.variables,o.executeContext):a.execute(o.variables,o.executeContext),f={result:p,status:"success"}}catch(i){f={error:i,status:"error"}}const{transaction:h,changedFields:g,previousOutcomes:v}=e;for(const t of u){const r=d(t),o=c.get(r);o&&v.set(r,o);const s=this.expressionsModel.elementTemplateMap.get(t.elementId);switch(t.executorPurpose){case"editable":case"required":case"text":c.set(d(t),f);break;case"value":{if("error"===f?.status)continue;const e=s.getExpressionExecutorsForLayer(this.feature.layer);let t=!0;if(e?.editableExpression&&(t=!1===c.get(d({elementId:s.elementId,executorPurpose:"editable"}))?.result),t){const e=s.fieldName,t=this.feature.getAttribute(e)??null;try{const r=y(f.result,this.feature,e,this.arcadeContextInfo.timeZone);r!==t&&(h.setValue(this.feature,e,r),g.add(e))}catch(l){m().error(`Failed to set calculated value for field '${e}'`,l)}}}break;case"visibility":c.set(d(t),f),this.expressionsModel.preserveFieldValuesWhenHidden||!0!==o?.result||!1!==f.result||"user"!==h.originActor||M(s,this.feature,c,e)}}if("error"===f?.status){const e=new Set;for(const t of u){const r=this.expressionsModel.elementTemplateMap.get(t.elementId);if(r)switch(t.executorPurpose){case"editable":e.add(r.label+" - Editable expression");break;case"required":e.add(r.label+" - Required expression");break;case"value":e.add(r.label+" - Value expression");break;case"visibility":e.add(r.label+" - Visibility expression")}}t.push(e.size>0?new r("expression-evaluation-failed","Arcade evaluation failed ("+[...e].join(",")+")"):new r("expression-evaluation-failed","Arcade evaluation failed "))}}if(t.length>0)throw S(t)}}function y(e,t,o,s){if(null===e)return null;const a=t.layer.fieldsIndex.get(o);if(!a)throw new r("field-not-found",`Field '${o}' not found on layer.`);switch(a.type){case"big-integer":case"integer":case"long":case"oid":case"small-integer":{const t=x(e);return null==t?null:Math.floor(t)}case"single":case"double":return x(e);case"global-id":case"guid":case"string":return h.toString(e);case"date":{const t=b(e,s);if(t)return t.getTime();const o=x(e);if(null!==o&&!isNaN(o)&&Number.isInteger(o))return o;throw new r("unsupported-value-type",`Unable to convert value ${e} to a date`)}case"date-only":{if(h.isDateOnly(e))return e.toStorageFormat();const t=b(e,s);if(!t)throw new r("unsupported-value-type",`Unable to convert value ${e} to a date-only string`);return u.fromDateTime(t.toDateTime()).toStorageFormat()}case"time-only":{if(h.isTime(e))return e.toStorageString();if(h.isDate(e)){return c.fromDateTime(e.toDateTime()).toStorageString()}const t=c.fromString(h.toString(e));if(!t)throw new r("unsupported-value-type",`Unable to convert value ${e} to a time-only string`);return t.toStorageString()}case"timestamp-offset":{const t=b(e,s);if(!t)throw new r("unsupported-value-type",`Unable to convert value ${e} to a timestamp-offset string`);return t.toISOString(!1)}}throw new r("unsupported-value-type",`Unable to convert value ${e} to a value matching field type`)}function x(e){if(""===e)return null;const t=h.toNumber(e);return Number.isNaN(t)?null:t}function b(e,t){if(h.isDate(e))return e;if(h.isDateOnly(e))return e.toArcadeDate();const r=h.toString(e),o=h.toDate(r,t);return o&&/\d{4}-\d{2}-\d{2}/.test(r)?o:null}function w(e){return e.components}function E(e){return Array.from(e.geometryReferences)}function C(e){return Array.from(e.originalFeatureReferences)}function S(e){return new AggregateError(e,`One or more expression executions failed. First error message: ${e[0].message}`)}function F(e){const t=[],r=new Set;for(const o of e){if("fulfilled"===o.status)continue;const e=o.reason instanceof AggregateError?o.reason.errors:[o.reason];for(const o of e)r.has(o)||(r.add(o),t.push(o))}if(t.length>0)throw S(t)}function M(e,t,r,o){p(e)?A(e,t,r,o):f(e)&&_(e,t,r,o)}function A(e,t,r,o){const{group:s}=e;s&&!O(s,r,o.previousOutcomes)||D(t,e,o)}function _(e,t,r,o){for(const s of e.elements)p(s)&&O(s,r,o.previousOutcomes)&&D(t,s,o)}function D(e,{fieldName:t},r){null!==e.getAttribute(t)&&r.changedFields.add(t),r.transaction.setValue(e,t,null)}function O(e,t,r){const o=d({elementId:e.elementId,executorPurpose:"visibility"}),s=r.get(o)??t.get(o);return!s||!!s.result}export{g as ExpressionsManager};