@arcgis/core 5.2.0-next.40 → 5.2.0-next.41

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 (544) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/002356e675769d20e5c0.js +1 -0
  3. package/assets/esri/core/workers/chunks/02ab09285a5c4ca98066.js +1 -0
  4. package/assets/esri/core/workers/chunks/0646524250bb9fe82935.js +1 -0
  5. package/assets/esri/core/workers/chunks/06e71d52773eb656a4bf.js +261 -0
  6. package/assets/esri/core/workers/chunks/0a50efb07eee36237e21.js +1 -0
  7. package/assets/esri/core/workers/chunks/0a98a13418f53082ca7a.js +1 -0
  8. package/assets/esri/core/workers/chunks/0ae0483b72f5e8d00d55.js +1 -0
  9. package/assets/esri/core/workers/chunks/0ae35b02dda9b9662560.js +1 -0
  10. package/assets/esri/core/workers/chunks/0d1224693a62a26a0e72.js +1 -0
  11. package/assets/esri/core/workers/chunks/{542d8a6c415098b9857c.js → 0da4816c11b45b4a6289.js} +1 -1
  12. package/assets/esri/core/workers/chunks/{8a39dd585742960d3ca2.js → 0dcfd82a2669df6eb5a0.js} +1 -1
  13. package/assets/esri/core/workers/chunks/0f19bc532be24ca64755.js +1 -0
  14. package/assets/esri/core/workers/chunks/0f674c625f24ac73e25a.js +1 -0
  15. package/assets/esri/core/workers/chunks/11a3aa43fb940c21f148.js +1 -0
  16. package/assets/esri/core/workers/chunks/11e00ca5ac1b004f4ecc.js +1 -0
  17. package/assets/esri/core/workers/chunks/1276df03201c1b855fee.js +1 -0
  18. package/assets/esri/core/workers/chunks/13c893e448bedc5c1cef.js +1 -0
  19. package/assets/esri/core/workers/chunks/15c2d9bec0455fc363a9.js +1 -0
  20. package/assets/esri/core/workers/chunks/15de305ac3d6433748e7.js +1 -0
  21. package/assets/esri/core/workers/chunks/18d874739ee9ffad7480.js +1 -0
  22. package/assets/esri/core/workers/chunks/1dc1bfb3425665f560e4.js +1 -0
  23. package/assets/esri/core/workers/chunks/{1cd8dff4373494b01ad4.js → 1e342d532925569daadb.js} +1 -1
  24. package/assets/esri/core/workers/chunks/1f118d85d8271ad7690b.js +1 -0
  25. package/assets/esri/core/workers/chunks/1fece9757de7c10d1e9f.js +1 -0
  26. package/assets/esri/core/workers/chunks/{a2e754df3215e8b00a8f.js → 2015f4def2ef201bdab8.js} +1 -1
  27. package/assets/esri/core/workers/chunks/23570397304969f724b3.js +1 -0
  28. package/assets/esri/core/workers/chunks/24c0b3586bb6500eda53.js +2 -0
  29. package/assets/esri/core/workers/chunks/26e7884d8639df4d994b.js +1 -0
  30. package/assets/esri/core/workers/chunks/26fdc8382e009672924e.js +1 -0
  31. package/assets/esri/core/workers/chunks/{96860b6035e0b06672dd.js → 272c8ab189217240d05f.js} +1 -1
  32. package/assets/esri/core/workers/chunks/2791f3fe16ca5ee2f39a.js +1 -0
  33. package/assets/esri/core/workers/chunks/279a9a38b04a21cdfd11.js +1 -0
  34. package/assets/esri/core/workers/chunks/284e88805184334396fe.js +1 -0
  35. package/assets/esri/core/workers/chunks/28bc5e8e82f188b30eb9.js +1 -0
  36. package/assets/esri/core/workers/chunks/2a4868acd546312aa6d8.js +1 -0
  37. package/assets/esri/core/workers/chunks/2b8909a488cf3b231eec.js +1398 -0
  38. package/assets/esri/core/workers/chunks/2d7cfc68a38dabd8898a.js +1 -0
  39. package/assets/esri/core/workers/chunks/2da337d7fd9295f6b967.js +1 -0
  40. package/assets/esri/core/workers/chunks/2e79fb1b8445b2091cdb.js +1 -0
  41. package/assets/esri/core/workers/chunks/2f29f08cddd5add9388e.js +1 -0
  42. package/assets/esri/core/workers/chunks/30c53a7e1ad5aa52f2f3.js +1 -0
  43. package/assets/esri/core/workers/chunks/31c4db1eac8f765bb93f.js +1 -0
  44. package/assets/esri/core/workers/chunks/32fb597aef66c444758f.js +1 -0
  45. package/assets/esri/core/workers/chunks/34fcb776e4de1d870bbd.js +30 -0
  46. package/assets/esri/core/workers/chunks/352d144d7651da8a29c9.js +1 -0
  47. package/assets/esri/core/workers/chunks/354199a41de44902de84.js +1 -0
  48. package/assets/esri/core/workers/chunks/36781219ca9ba5d7fe52.js +1 -0
  49. package/assets/esri/core/workers/chunks/36999a2e383c8eb3c398.js +1 -0
  50. package/assets/esri/core/workers/chunks/36f8a912842181e1f0aa.js +1 -0
  51. package/assets/esri/core/workers/chunks/{ed1d4ebf487c7dcd5c33.js → 37a8cfec11057947b45f.js} +1 -1
  52. package/assets/esri/core/workers/chunks/{2b2b042a6d6949b06127.js → 381790e1f3df05c7eb68.js} +1 -1
  53. package/assets/esri/core/workers/chunks/383304d33b496c5d8baa.js +1 -0
  54. package/assets/esri/core/workers/chunks/{4e28f49d0be20ea50fd7.js → 383392c63202ac044b6c.js} +1 -1
  55. package/assets/esri/core/workers/chunks/394716bd1ecfd638d708.js +2 -0
  56. package/assets/esri/core/workers/chunks/3aacb935d632834d4154.js +1 -0
  57. package/assets/esri/core/workers/chunks/3c8e98cf23ad8ef12fcb.js +1 -0
  58. package/assets/esri/core/workers/chunks/4056659d5c7698265129.js +1 -0
  59. package/assets/esri/core/workers/chunks/4129b27fcd4103cdc499.js +1 -0
  60. package/assets/esri/core/workers/chunks/44e64186318728d1be51.js +1 -0
  61. package/assets/esri/core/workers/chunks/474ea8c97d101e41b3f5.js +1 -0
  62. package/assets/esri/core/workers/chunks/475c60ed8785d07911c6.js +1 -0
  63. package/assets/esri/core/workers/chunks/{c7662455252b48531da1.js → 484b3e2a220c440ccbb4.js} +1 -1
  64. package/assets/esri/core/workers/chunks/4d4710d57c72ec75cccc.js +1 -0
  65. package/assets/esri/core/workers/chunks/4e1b087453fc5e20e961.js +1 -0
  66. package/assets/esri/core/workers/chunks/4e94793aab42ebd251ca.js +1 -0
  67. package/assets/esri/core/workers/chunks/4f2a61dfae6ca8ed1ec8.js +1 -0
  68. package/assets/esri/core/workers/chunks/4f59357f535f30a6b5cc.js +1 -0
  69. package/assets/esri/core/workers/chunks/509cfac9e5d86a8ee449.js +1 -0
  70. package/assets/esri/core/workers/chunks/510acf2e8781be9b0dba.js +1 -0
  71. package/assets/esri/core/workers/chunks/52c4b4dabcb0d162be72.js +1 -0
  72. package/assets/esri/core/workers/chunks/{697e0ce10d77b90d4fee.js → 538fe46dfd685a490e23.js} +1 -1
  73. package/assets/esri/core/workers/chunks/5441f96cdd0660229efe.js +1 -0
  74. package/assets/esri/core/workers/chunks/551d0c5432f7a08dea77.js +1 -0
  75. package/assets/esri/core/workers/chunks/55924fb0de05e727f5e3.js +1 -0
  76. package/assets/esri/core/workers/chunks/55af58b6dff52dc040fe.js +2 -0
  77. package/assets/esri/core/workers/chunks/56bbde1dff96b423fbb9.js +1 -0
  78. package/assets/esri/core/workers/chunks/57824ecc10b25e3ad794.js +1 -0
  79. package/assets/esri/core/workers/chunks/{9ba705a6ddabca0f77b1.js → 580451761cadfe308919.js} +1 -1
  80. package/assets/esri/core/workers/chunks/5923ebadd4f75be2c9cc.js +1 -0
  81. package/assets/esri/core/workers/chunks/5b18696109fe84a1010a.js +2 -0
  82. package/assets/esri/core/workers/chunks/{db96a0c66578b2d1b715.js → 5b30231ae0a8f4b8435f.js} +1 -1
  83. package/assets/esri/core/workers/chunks/{77a4f6f224d7ca4b69f4.js → 5bf4ab72b9634b06cc5d.js} +1 -1
  84. package/assets/esri/core/workers/chunks/5ce168ae45ab7e7a71d1.js +1 -0
  85. package/assets/esri/core/workers/chunks/{7b1678dcf62481469544.js → 5dc17b76c6ecc24e7b9a.js} +1 -1
  86. package/assets/esri/core/workers/chunks/5e35828216020f33e26b.js +1 -0
  87. package/assets/esri/core/workers/chunks/5f0d6c853873a7f32527.js +1 -0
  88. package/assets/esri/core/workers/chunks/5fe9eea35ddb428efd8b.js +1 -0
  89. package/assets/esri/core/workers/chunks/6010b7be978698a642d0.js +1 -0
  90. package/assets/esri/core/workers/chunks/613e799377bdb767c955.js +1 -0
  91. package/assets/esri/core/workers/chunks/6210fb6cd31844f23964.js +1 -0
  92. package/assets/esri/core/workers/chunks/632ab11cdd4b0d9a5cc5.js +1 -0
  93. package/assets/esri/core/workers/chunks/64247e439ef3e1f712e9.js +1 -0
  94. package/assets/esri/core/workers/chunks/661a59133ae34f172174.js +1 -0
  95. package/assets/esri/core/workers/chunks/6b0acd1a7dd74a7367e0.js +1 -0
  96. package/assets/esri/core/workers/chunks/6d247ff53421d27628ce.js +1 -0
  97. package/assets/esri/core/workers/chunks/6e45d0db97ffa4509177.js +1 -0
  98. package/assets/esri/core/workers/chunks/6f408397e2c8a2ea9805.js +1 -0
  99. package/assets/esri/core/workers/chunks/700c08dd2e734c15e621.js +1 -0
  100. package/assets/esri/core/workers/chunks/705d6b108fd121cea887.js +1 -0
  101. package/assets/esri/core/workers/chunks/71ce1009dadcae8f8094.js +1 -0
  102. package/assets/esri/core/workers/chunks/72fe7fb03c156f26a589.js +1 -0
  103. package/assets/esri/core/workers/chunks/733b2e181683d5fc7c95.js +1 -0
  104. package/assets/esri/core/workers/chunks/79b857bb301f9c4169d6.js +1 -0
  105. package/assets/esri/core/workers/chunks/79c0a966f7d11d3c217f.js +1 -0
  106. package/assets/esri/core/workers/chunks/7a818499c1079906c2d7.js +1 -0
  107. package/assets/esri/core/workers/chunks/7ac47a9ad244100bc3b1.js +1 -0
  108. package/assets/esri/core/workers/chunks/7b862a074816c099b9ff.js +1 -0
  109. package/assets/esri/core/workers/chunks/7baa363b3b0a442a63d2.js +1 -0
  110. package/assets/esri/core/workers/chunks/7cc729b57a6a52c8ac68.js +1 -0
  111. package/assets/esri/core/workers/chunks/{4abe820bbe4f7ffccc09.js → 7df795bc4fa1d433463b.js} +1 -1
  112. package/assets/esri/core/workers/chunks/7ea65aa6d3e684e12082.js +1 -0
  113. package/assets/esri/core/workers/chunks/7f7a76f5fef25049fbf8.js +1 -0
  114. package/assets/esri/core/workers/chunks/7fa9dc39bf0a7a6fdc1f.js +1 -0
  115. package/assets/esri/core/workers/chunks/821176ee3be724621bb0.js +1 -0
  116. package/assets/esri/core/workers/chunks/825eb845216762a1ed2f.js +1 -0
  117. package/assets/esri/core/workers/chunks/82f4aa0533db009b11d8.js +2 -0
  118. package/assets/esri/core/workers/chunks/{2a344bca6837ca3b5c41.js.LICENSE.txt → 82f4aa0533db009b11d8.js.LICENSE.txt} +0 -6
  119. package/assets/esri/core/workers/chunks/830d1a7dee43422507ab.js +1 -0
  120. package/assets/esri/core/workers/chunks/835643f716f7058a2722.js +1 -0
  121. package/assets/esri/core/workers/chunks/84fa102a93b2144c28fb.js +1 -0
  122. package/assets/esri/core/workers/chunks/85ce7673d42526a79fd2.js +1 -0
  123. package/assets/esri/core/workers/chunks/893ffc38e1a43de5b63d.js +1 -0
  124. package/assets/esri/core/workers/chunks/{93df864c2e829f0fd5ce.js → 8a1970e68bc1e833cb7f.js} +1 -1
  125. package/assets/esri/core/workers/chunks/{684c9b4bd9590d2db12f.js → 8a410edcdf74ba957159.js} +1 -1
  126. package/assets/esri/core/workers/chunks/8b73694d5a97638a3a61.js +1 -0
  127. package/assets/esri/core/workers/chunks/8bb20ef549ec1c86b38e.js +1 -0
  128. package/assets/esri/core/workers/chunks/{6ef3b8d67b498d655a99.js → 8c5e65982c3f9295e844.js} +1 -1
  129. package/assets/esri/core/workers/chunks/8cb2fe91d1d8f49c14f8.js +1 -0
  130. package/assets/esri/core/workers/chunks/{1961b59756933e0a82f2.js → 8dcc6c19d5b3a5ac5512.js} +1 -1
  131. package/assets/esri/core/workers/chunks/8dee03779b569f233daf.js +1 -0
  132. package/assets/esri/core/workers/chunks/8ec5e470583b75fceae1.js +1 -0
  133. package/assets/esri/core/workers/chunks/8f2fecd8a0a972d68590.js +1 -0
  134. package/assets/esri/core/workers/chunks/9073b0f0ec93d6e243b9.js +1 -0
  135. package/assets/esri/core/workers/chunks/90ace5f9b4af1beea6bf.js +1 -0
  136. package/assets/esri/core/workers/chunks/94719ac469dadc4c05dc.js +1 -0
  137. package/assets/esri/core/workers/chunks/94e9cf8e729ec36de5be.js +1 -0
  138. package/assets/esri/core/workers/chunks/96d5fed0235558c0e348.js +1 -0
  139. package/assets/esri/core/workers/chunks/98b27cf8acbfa4259758.js +1 -0
  140. package/assets/esri/core/workers/chunks/9902fcd2070c8eb6d043.js +1 -0
  141. package/assets/esri/core/workers/chunks/99772ce7e628364434fa.js +1 -0
  142. package/assets/esri/core/workers/chunks/{b1a0eb6598309e11337f.js → 99e3aa4832ed87474ab4.js} +1 -1
  143. package/assets/esri/core/workers/chunks/9a6208ab670ad74e6f7d.js +1 -0
  144. package/assets/esri/core/workers/chunks/9a97f6cda2f36941efae.js +1 -0
  145. package/assets/esri/core/workers/chunks/9b1199104a6822ab7340.js +1 -0
  146. package/assets/esri/core/workers/chunks/9ceeae787dc7c194d60e.js +1 -0
  147. package/assets/esri/core/workers/chunks/9ebc98746b1f085b82b7.js +1 -0
  148. package/assets/esri/core/workers/chunks/9ee3741eef73f3edb18b.js +1 -0
  149. package/assets/esri/core/workers/chunks/9fb87a7dba62b527c0ba.js +1 -0
  150. package/assets/esri/core/workers/chunks/a10f63a08d976be058be.js +1 -0
  151. package/assets/esri/core/workers/chunks/a183b77854f5b42c1a86.js +1 -0
  152. package/assets/esri/core/workers/chunks/a23f4d8e7c372f5fb6d7.js +1 -0
  153. package/assets/esri/core/workers/chunks/a25f51d2d3ff6b9af7ca.js +1 -0
  154. package/assets/esri/core/workers/chunks/a27172dacdb85a774c4b.js +1 -0
  155. package/assets/esri/core/workers/chunks/a27cdf4c29dd50a6dab1.js +1 -0
  156. package/assets/esri/core/workers/chunks/a294dd12b5c708ce04af.js +1 -0
  157. package/assets/esri/core/workers/chunks/a3c882fe7599dc0f4f27.js +1 -0
  158. package/assets/esri/core/workers/chunks/a90f7b1c6c69b6033b4c.js +1 -0
  159. package/assets/esri/core/workers/chunks/a9c641bcdef161c754bf.js +1 -0
  160. package/assets/esri/core/workers/chunks/a9d391071803b1e9e8a0.js +1 -0
  161. package/assets/esri/core/workers/chunks/{757982a73174aa7ab0d1.js → aa0fb77c62a2d4eb20a5.js} +1 -1
  162. package/assets/esri/core/workers/chunks/aaa66a04b882b0ba2961.js +1 -0
  163. package/assets/esri/core/workers/chunks/ae50b2d5e63f62c088d2.js +1 -0
  164. package/assets/esri/core/workers/chunks/af3ac4bed43e901b59c7.js +1 -0
  165. package/assets/esri/core/workers/chunks/af97e19516dbbcfb5286.js +1 -0
  166. package/assets/esri/core/workers/chunks/aff0e7761276036e029d.js +1 -0
  167. package/assets/esri/core/workers/chunks/b23d1e10fc4161d1f3eb.js +1 -0
  168. package/assets/esri/core/workers/chunks/b32bdf5730953c2fb16b.js +1 -0
  169. package/assets/esri/core/workers/chunks/b3f1a442d6b7826e917f.js +1 -0
  170. package/assets/esri/core/workers/chunks/b4047333265a2665aef9.js +1 -0
  171. package/assets/esri/core/workers/chunks/b45a013039bbd2614525.js +680 -0
  172. package/assets/esri/core/workers/chunks/b7170816736769d3b7b0.js +1 -0
  173. package/assets/esri/core/workers/chunks/{5c63b38160c7d063b8af.js → b780514be87a22b49b01.js} +1 -1
  174. package/assets/esri/core/workers/chunks/b792857a178da2dd77d6.js +1 -0
  175. package/assets/esri/core/workers/chunks/b819a9187426d0c146df.js +1 -0
  176. package/assets/esri/core/workers/chunks/{1d92da90fbbc3f98b201.js → b8d788e110c212a879ab.js} +1 -1
  177. package/assets/esri/core/workers/chunks/b94cd7eac5ff4a78dd5b.js +1 -0
  178. package/assets/esri/core/workers/chunks/b9d6f89f9b8e9d1bc787.js +1 -0
  179. package/assets/esri/core/workers/chunks/b9f40681af1fa00b5bbe.js +1 -0
  180. package/assets/esri/core/workers/chunks/{bc547cf814d6703cef59.js → bb95922cd4631d6f17fb.js} +1 -1
  181. package/assets/esri/core/workers/chunks/bcb5017500d144b73908.js +1 -0
  182. package/assets/esri/core/workers/chunks/bd862382f72ebd446b46.js +1 -0
  183. package/assets/esri/core/workers/chunks/bdd19dab276d20d5381a.js +1 -0
  184. package/assets/esri/core/workers/chunks/bee5e738ecf8680909c4.js +1 -0
  185. package/assets/esri/core/workers/chunks/{9be4438ce2c7180adadf.js → bf287f0e2ecb4532dc00.js} +1 -1
  186. package/assets/esri/core/workers/chunks/{5115059b012ef84407cf.js → bfb6566c27c09deb0929.js} +1 -1
  187. package/assets/esri/core/workers/chunks/c055c16379f5bb56e930.js +1 -0
  188. package/assets/esri/core/workers/chunks/c13e55b9efb0b532f7ee.js +1 -0
  189. package/assets/esri/core/workers/chunks/c369d4266f38e9ea6592.js +1 -0
  190. package/assets/esri/core/workers/chunks/c3fae4f4522604a9c17e.js +1 -0
  191. package/assets/esri/core/workers/chunks/c4c25db769a78e677e33.js +1 -0
  192. package/assets/esri/core/workers/chunks/c50e4e8c6188e64e7d45.js +1 -0
  193. package/assets/esri/core/workers/chunks/c838cc1c786368b78598.js +1 -0
  194. package/assets/esri/core/workers/chunks/c8db0a4fb5bc982dc9fc.js +1 -0
  195. package/assets/esri/core/workers/chunks/{82adfa2dbd40e1becaf4.js → c97451f75c23be979476.js} +1 -1
  196. package/assets/esri/core/workers/chunks/ca118c42c0f609ca7912.js +1 -0
  197. package/assets/esri/core/workers/chunks/ca419858910af5505d3d.js +1 -0
  198. package/assets/esri/core/workers/chunks/cb17cd8aaf77238c0236.js +1 -0
  199. package/assets/esri/core/workers/chunks/{034dd8ee5152a12412cd.js → cba3316910ff088f4d77.js} +1 -1
  200. package/assets/esri/core/workers/chunks/cc414fd2e313d89d524d.js +1 -0
  201. package/assets/esri/core/workers/chunks/{7b8466f892a38a53c600.js → cce83896093279c70449.js} +1 -1
  202. package/assets/esri/core/workers/chunks/cda04571d7623c17ada2.js +1 -0
  203. package/assets/esri/core/workers/chunks/cea4b18e7f83c02922b1.js +1 -0
  204. package/assets/esri/core/workers/chunks/cf03d391d50a4c7aca4f.js +1 -0
  205. package/assets/esri/core/workers/chunks/d03f427442bb0c287d05.js +1 -0
  206. package/assets/esri/core/workers/chunks/d082de5dd83bd73d209b.js +1 -0
  207. package/assets/esri/core/workers/chunks/d08d3c6f21e6ba8268ca.js +1 -0
  208. package/assets/esri/core/workers/chunks/d36f17d32c654b1ac7fa.js +1 -0
  209. package/assets/esri/core/workers/chunks/d36fba71c52ea4e71546.js +1 -0
  210. package/assets/esri/core/workers/chunks/{18f980465db5a86153d1.js → d37a72111dffc4c4db70.js} +1 -1
  211. package/assets/esri/core/workers/chunks/d41ab2abcfacc87809b5.js +1 -0
  212. package/assets/esri/core/workers/chunks/d4ed094962a41d756c95.js +1 -0
  213. package/assets/esri/core/workers/chunks/d5561dff043789494845.js +1 -0
  214. package/assets/esri/core/workers/chunks/d79ce047afbc034f6008.js +1 -0
  215. package/assets/esri/core/workers/chunks/d847c3cb2043a983145b.js +1 -0
  216. package/assets/esri/core/workers/chunks/d849bdaf5bdfdc37531a.js +1 -0
  217. package/assets/esri/core/workers/chunks/da6134c7883531f21afe.js +1 -0
  218. package/assets/esri/core/workers/chunks/{c48dfda8dcb9551606fb.js → dad39ddf0f8dfb0bef47.js} +1 -1
  219. package/assets/esri/core/workers/chunks/dadefe369f49e89a2610.js +1 -0
  220. package/assets/esri/core/workers/chunks/dccb46c7dce68528c72b.js +1 -0
  221. package/assets/esri/core/workers/chunks/dd65c32ae55fcf1282fe.js +1 -0
  222. package/assets/esri/core/workers/chunks/ddafe402f1bc9e8285ef.js +1 -0
  223. package/assets/esri/core/workers/chunks/de9573871f64c01e9f01.js +1 -0
  224. package/assets/esri/core/workers/chunks/dedf678490572c500a19.js +30 -0
  225. package/assets/esri/core/workers/chunks/df174346a7e9b629a392.js +1 -0
  226. package/assets/esri/core/workers/chunks/df30053a10d4930924d5.js +1 -0
  227. package/assets/esri/core/workers/chunks/dfbdc72c7ea137e3841d.js +1 -0
  228. package/assets/esri/core/workers/chunks/e21b3490bfce75405e55.js +1 -0
  229. package/assets/esri/core/workers/chunks/e2c9393bec747f7876bb.js +1 -0
  230. package/assets/esri/core/workers/chunks/e3e966777f18164afcd8.js +1 -0
  231. package/assets/esri/core/workers/chunks/e4a2eefffe16cd5bb20f.js +1 -0
  232. package/assets/esri/core/workers/chunks/{d0983cc19d19c19c3478.js → e4aacfc1617ccf60bd5a.js} +1 -1
  233. package/assets/esri/core/workers/chunks/{3a526e1d18490b99332f.js → e5bb7ee670a3ba5ba3fe.js} +1 -1
  234. package/assets/esri/core/workers/chunks/e5c75459de85a6dd2f14.js +1 -0
  235. package/assets/esri/core/workers/chunks/e798ca23f02a2dd65bd4.js +1 -0
  236. package/assets/esri/core/workers/chunks/e94f2d6037fba042dc6e.js +1 -0
  237. package/assets/esri/core/workers/chunks/e9511627418c6864148a.js +1 -0
  238. package/assets/esri/core/workers/chunks/ea8f224da4c5c95a3547.js +1 -0
  239. package/assets/esri/core/workers/chunks/ec1a2e68957fae48e60b.js +30 -0
  240. package/assets/esri/core/workers/chunks/ec2e0b2e31fd53b81d0a.js +1 -0
  241. package/assets/esri/core/workers/chunks/ed552941eca621a51f16.js +1 -0
  242. package/assets/esri/core/workers/chunks/ee58f4bbc0a1f7d03df0.js +1 -0
  243. package/assets/esri/core/workers/chunks/f04cb48fc73635d0572f.js +1 -0
  244. package/assets/esri/core/workers/chunks/f06f591680c9e93e69f6.js +1 -0
  245. package/assets/esri/core/workers/chunks/f1d3cf674b6bea89e122.js +1 -0
  246. package/assets/esri/core/workers/chunks/f2ab8e49c7f17f488aa8.js +1 -0
  247. package/assets/esri/core/workers/chunks/{6a51499c6623ddce5f00.js → f2adf1227a795604d3b8.js} +1 -1
  248. package/assets/esri/core/workers/chunks/f30578843f4faefd53b4.js +1 -0
  249. package/assets/esri/core/workers/chunks/{57c003c6745d450558a7.js → f4aed2b6e92bd0474069.js} +1 -1
  250. package/assets/esri/core/workers/chunks/f5d7f69047e1b1116202.js +1 -0
  251. package/assets/esri/core/workers/chunks/f5d809d30cbb56be852d.js +1 -0
  252. package/assets/esri/core/workers/chunks/{2d92f0042facb55edcff.js → f65adaaa33d9f3b131f6.js} +1 -1
  253. package/assets/esri/core/workers/chunks/f9b654f801cb416e9e17.js +1 -0
  254. package/assets/esri/core/workers/chunks/fb34d6d96c8c0d53fcf6.js +1 -0
  255. package/assets/esri/core/workers/chunks/fb51f823b25c827c6b29.js +1 -0
  256. package/assets/esri/core/workers/chunks/fba8065a3a6fbd877e23.js +1 -0
  257. package/assets/esri/core/workers/chunks/fd47ee8598e37fea03fe.js +1 -0
  258. package/assets/esri/core/workers/chunks/fefbde2c2e527bb716ee.js +1 -0
  259. package/assets/esri/core/workers/chunks/ff089723a27859fe18d1.js +1 -0
  260. package/assets/esri/layers/raster/formats/lerc-wasm.wasm +0 -0
  261. package/assets/esri/rest/knowledgeGraph/wasmInterface/arcgis-knowledge-client-core-simd.wasm +0 -0
  262. package/assets/esri/rest/knowledgeGraph/wasmInterface/arcgis-knowledge-client-core.wasm +0 -0
  263. package/chunks/arcgis-knowledge-client-core-simd.js +1 -1
  264. package/chunks/arcgis-knowledge-client-core.js +1 -1
  265. package/config.js +1 -1
  266. package/geometry/support/sphere.js +1 -1
  267. package/interfaces.d.ts +5 -0
  268. package/kernel.js +1 -1
  269. package/layers/AnnotationFeatureLayer.d.ts +13 -3
  270. package/layers/DimensionFeatureLayer.d.ts +10 -3
  271. package/layers/raster/formats/ImageCanvasDecoder.js +1 -1
  272. package/layers/raster/formats/RasterCodec.js +1 -1
  273. package/package.json +3 -3
  274. package/support/revision.js +1 -1
  275. package/views/2d/engine/webgl/definitions.js +1 -1
  276. package/views/2d/engine/webgl/effects/HittestEffect.js +1 -1
  277. package/views/2d/engine/webgl/mesh/templates/segmentUtils.js +1 -1
  278. package/views/2d/engine/webgl/shaderGraph/techniques/text/TextMeshWriter.js +1 -1
  279. package/views/2d/engine/webgl/shaderGraph/techniques/text/TextShader.js +1 -1
  280. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  281. package/views/2d/layers/features/FeatureContainer.js +1 -1
  282. package/views/3d/layers/GaussianSplatLayerView3D.js +1 -1
  283. package/views/3d/layers/I3SMeshView3D.js +1 -1
  284. package/views/3d/layers/SceneLayerWorker.js +1 -1
  285. package/views/3d/layers/SceneLayerWorkerHandle.js +1 -1
  286. package/views/3d/state/helpers/SceneIntersectionHelper.js +1 -1
  287. package/views/3d/support/gaussianSplatting/GaussianSplatFadeHelper.js +1 -1
  288. package/views/3d/support/gaussianSplatting/GaussianTile.js +1 -1
  289. package/views/3d/webgl/RenderCamera.js +1 -1
  290. package/views/3d/webgl-engine/effects/WeatherFader.js +1 -1
  291. package/views/3d/webgl-engine/effects/clouds/CloudsParameters.js +1 -1
  292. package/views/3d/webgl-engine/lib/Intersector.js +1 -1
  293. package/views/3d/webgl-engine/lib/Octree.js +1 -1
  294. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  295. package/views/3d/webgl-engine/lib/screenPolygonTriangleIntersections.js +1 -1
  296. package/views/3d/webgl-engine/materials/DefaultBufferWriter.js +1 -1
  297. package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
  298. package/views/3d/webgl-engine/materials/HeatmapDensityMaterial.js +1 -1
  299. package/views/3d/webgl-engine/materials/ImageMaterial.js +1 -1
  300. package/views/3d/webgl-engine/materials/LineCalloutMaterial.js +1 -1
  301. package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
  302. package/views/3d/webgl-engine/materials/MeasurementArrowMaterial.js +1 -1
  303. package/views/3d/webgl-engine/materials/NativeLineMaterial.js +1 -1
  304. package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
  305. package/views/3d/webgl-engine/materials/PatternMaterial.js +1 -1
  306. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  307. package/views/3d/webgl-engine/materials/ShadedColorMaterial.js +1 -1
  308. package/views/3d/webgl-engine/materials/renderers/BufferRange.js +1 -1
  309. package/views/3d/webgl-engine/materials/renderers/VaoWriter.js +1 -1
  310. package/views/3d/webgl-engine/shaders/ScreenSpacePassAtmosphere.glsl.js +1 -1
  311. package/views/Viewport2DMixin.js +1 -1
  312. package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
  313. package/widgets/BatchAttributeForm/batchAttributeFormUtils.js +1 -1
  314. package/widgets/BatchAttributeForm/expressions/ExpressionsManager.js +1 -1
  315. package/widgets/BatchAttributeForm/expressions/ExpressionsModel.js +1 -1
  316. package/widgets/BatchAttributeForm/templates/support/createBatchFormTemplate.js +1 -1
  317. package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
  318. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  319. package/widgets/Sketch.js +1 -1
  320. package/assets/esri/core/workers/chunks/02b043a3c5fa8bcb4c5b.js +0 -1
  321. package/assets/esri/core/workers/chunks/03437a8ef35c200dbf17.js +0 -1
  322. package/assets/esri/core/workers/chunks/0603cbd938ab619c706b.js +0 -1
  323. package/assets/esri/core/workers/chunks/08405116b5feb2d00101.js +0 -1
  324. package/assets/esri/core/workers/chunks/0a6e03263ab0906d8bcf.js +0 -1
  325. package/assets/esri/core/workers/chunks/0af6b87a3d77bb93b893.js +0 -1
  326. package/assets/esri/core/workers/chunks/0edd250159ec259601b3.js +0 -1
  327. package/assets/esri/core/workers/chunks/0f10d7d592c36ee2d1ea.js +0 -1
  328. package/assets/esri/core/workers/chunks/0f8fcbd0650b6a924f75.js +0 -1
  329. package/assets/esri/core/workers/chunks/0f976bfb7db98c2c0e05.js +0 -1
  330. package/assets/esri/core/workers/chunks/1040bce57ea63a6dbca4.js +0 -2
  331. package/assets/esri/core/workers/chunks/10510f76f8538c2dfb84.js +0 -1
  332. package/assets/esri/core/workers/chunks/1079914101d69a40b3eb.js +0 -1
  333. package/assets/esri/core/workers/chunks/11af659688cf963ea6cd.js +0 -1
  334. package/assets/esri/core/workers/chunks/15081b361fc42f40b865.js +0 -1
  335. package/assets/esri/core/workers/chunks/1599dc5309a4e60017ce.js +0 -261
  336. package/assets/esri/core/workers/chunks/181e98399732f425305d.js +0 -1
  337. package/assets/esri/core/workers/chunks/1837f97f720d255a1694.js +0 -1
  338. package/assets/esri/core/workers/chunks/18c4c437ded8bfbd3305.js +0 -1
  339. package/assets/esri/core/workers/chunks/18f4b2099299942aaf97.js +0 -1
  340. package/assets/esri/core/workers/chunks/1958facb000b6c16bfe4.js +0 -1
  341. package/assets/esri/core/workers/chunks/196e7515a43bd0026f49.js +0 -1
  342. package/assets/esri/core/workers/chunks/1a0903b1d2d5101977c6.js +0 -1
  343. package/assets/esri/core/workers/chunks/1aa7496a7dc95aae11ac.js +0 -1
  344. package/assets/esri/core/workers/chunks/1bd49e8d2657c72bf3f9.js +0 -1
  345. package/assets/esri/core/workers/chunks/1c263ffb7144e171a64f.js +0 -1
  346. package/assets/esri/core/workers/chunks/1d524690c4b66289bd20.js +0 -1
  347. package/assets/esri/core/workers/chunks/20fa2c3d4360afa5e136.js +0 -1
  348. package/assets/esri/core/workers/chunks/210ffc448c73a7bf63aa.js +0 -1
  349. package/assets/esri/core/workers/chunks/23f81f4a3d7a983eef23.js +0 -1
  350. package/assets/esri/core/workers/chunks/2540beb53f1443a070d7.js +0 -1
  351. package/assets/esri/core/workers/chunks/25c1f5e2561986330b80.js +0 -1
  352. package/assets/esri/core/workers/chunks/2757c4bf0280e27f3484.js +0 -1
  353. package/assets/esri/core/workers/chunks/294537e1ac43e8dfeaea.js +0 -1
  354. package/assets/esri/core/workers/chunks/29a1d0659bbc5a039864.js +0 -1
  355. package/assets/esri/core/workers/chunks/29df3f829006719b2680.js +0 -1
  356. package/assets/esri/core/workers/chunks/2a344bca6837ca3b5c41.js +0 -2
  357. package/assets/esri/core/workers/chunks/2a5dbed88bbd96cfac9f.js +0 -1
  358. package/assets/esri/core/workers/chunks/2b044c8fab2055a8818d.js +0 -1
  359. package/assets/esri/core/workers/chunks/2d956dacb26d71d1c174.js +0 -1
  360. package/assets/esri/core/workers/chunks/2da797ae5af9d2ede42d.js +0 -1
  361. package/assets/esri/core/workers/chunks/2dbcdfdf000226bfe746.js +0 -1
  362. package/assets/esri/core/workers/chunks/2e495a28494c2351837b.js +0 -1
  363. package/assets/esri/core/workers/chunks/2ef80e003b4f0393ac2e.js +0 -1
  364. package/assets/esri/core/workers/chunks/2fc3e43b64300014dddc.js +0 -1
  365. package/assets/esri/core/workers/chunks/30cf84a47ebefd180bb7.js +0 -1
  366. package/assets/esri/core/workers/chunks/314bc1b356d43bfa72a8.js +0 -1
  367. package/assets/esri/core/workers/chunks/34a024eda22d228e1fbe.js +0 -1
  368. package/assets/esri/core/workers/chunks/37e823202424c11076cb.js +0 -1
  369. package/assets/esri/core/workers/chunks/38a76bc4ef5c10ab0488.js +0 -1
  370. package/assets/esri/core/workers/chunks/390f2beee8e3f2a302e4.js +0 -1
  371. package/assets/esri/core/workers/chunks/3a76fffa2016c16d7989.js +0 -1398
  372. package/assets/esri/core/workers/chunks/3c2eb386c0165150e039.js +0 -1
  373. package/assets/esri/core/workers/chunks/3e4b379a6a197b9c4e6b.js +0 -1
  374. package/assets/esri/core/workers/chunks/3ec91474658eae87b832.js +0 -1
  375. package/assets/esri/core/workers/chunks/3eee32db0e9a5086b9a8.js +0 -1
  376. package/assets/esri/core/workers/chunks/406c7723e8db470822bf.js +0 -1
  377. package/assets/esri/core/workers/chunks/41aca863324387576cf8.js +0 -1
  378. package/assets/esri/core/workers/chunks/442424200e7475e9a08f.js +0 -1
  379. package/assets/esri/core/workers/chunks/4452fd0c59431904d533.js +0 -1
  380. package/assets/esri/core/workers/chunks/448e0596005cba9a4225.js +0 -1
  381. package/assets/esri/core/workers/chunks/4545cf12ad0824ce6b41.js +0 -1
  382. package/assets/esri/core/workers/chunks/45530a49fa1f09d1682e.js +0 -1
  383. package/assets/esri/core/workers/chunks/459e89d1b94a3b204d20.js +0 -30
  384. package/assets/esri/core/workers/chunks/45b2e58051f42ebd236e.js +0 -1
  385. package/assets/esri/core/workers/chunks/4611cf051c3c396fdf96.js +0 -1
  386. package/assets/esri/core/workers/chunks/46e3d33e44e5398221e2.js +0 -1
  387. package/assets/esri/core/workers/chunks/47656ec12401e53f4bd3.js +0 -1
  388. package/assets/esri/core/workers/chunks/47948c72bc01bd173c20.js +0 -2
  389. package/assets/esri/core/workers/chunks/48f1c3a7c9f16d6896f6.js +0 -1
  390. package/assets/esri/core/workers/chunks/49713dfa4c8b788079d1.js +0 -1
  391. package/assets/esri/core/workers/chunks/4a8201e09bc3ad5cc00b.js +0 -1
  392. package/assets/esri/core/workers/chunks/4ad86d6b1be07c97b6f6.js +0 -1
  393. package/assets/esri/core/workers/chunks/4be0c64bbf2449d57ea5.js +0 -1
  394. package/assets/esri/core/workers/chunks/4d57c771af4137f74bfb.js +0 -1
  395. package/assets/esri/core/workers/chunks/4f25aac84d9eb10cac83.js +0 -1
  396. package/assets/esri/core/workers/chunks/50b34e246f8eef2f6e07.js +0 -1
  397. package/assets/esri/core/workers/chunks/514ab968c0d75062e6ab.js +0 -1
  398. package/assets/esri/core/workers/chunks/51838d55d8ec4ce70398.js +0 -1
  399. package/assets/esri/core/workers/chunks/557300ec03bae84d8afc.js +0 -1
  400. package/assets/esri/core/workers/chunks/57abf838fcff0f0e2c5e.js +0 -1
  401. package/assets/esri/core/workers/chunks/57dd017fed2943d24e3d.js +0 -1
  402. package/assets/esri/core/workers/chunks/59801b2ccaaf4b394e02.js +0 -1
  403. package/assets/esri/core/workers/chunks/5a2d2dcdfa8d958f277d.js +0 -1
  404. package/assets/esri/core/workers/chunks/5a62c9f64db4fcae5e52.js +0 -1
  405. package/assets/esri/core/workers/chunks/5aebecb5c2b3e7887127.js +0 -1
  406. package/assets/esri/core/workers/chunks/5e68b74fd548c7cdba36.js +0 -1
  407. package/assets/esri/core/workers/chunks/5f360492560ae07083a6.js +0 -1
  408. package/assets/esri/core/workers/chunks/6022f43ebd58e21c737a.js +0 -1
  409. package/assets/esri/core/workers/chunks/6048c89fc4dcd2e9988d.js +0 -1
  410. package/assets/esri/core/workers/chunks/61efc7f5fab1c2b1f764.js +0 -1
  411. package/assets/esri/core/workers/chunks/62b137a795e487fa06a1.js +0 -1
  412. package/assets/esri/core/workers/chunks/632de34ebd2f44b4423d.js +0 -1
  413. package/assets/esri/core/workers/chunks/63ca17f569407c89bde1.js +0 -30
  414. package/assets/esri/core/workers/chunks/643c7506f8fe8e06acd2.js +0 -1
  415. package/assets/esri/core/workers/chunks/6596b12bb286a0b45a68.js +0 -1
  416. package/assets/esri/core/workers/chunks/65cc9a48ac95523f7aa8.js +0 -1
  417. package/assets/esri/core/workers/chunks/661f50cb97604453f942.js +0 -1
  418. package/assets/esri/core/workers/chunks/686c1a1b794ebe1a0341.js +0 -1
  419. package/assets/esri/core/workers/chunks/6896a6dd36fa91a27151.js +0 -1
  420. package/assets/esri/core/workers/chunks/68bc674affe2f7269c40.js +0 -1
  421. package/assets/esri/core/workers/chunks/6c02493a1c1deff49c7e.js +0 -1
  422. package/assets/esri/core/workers/chunks/6cdf1db30793133294dd.js +0 -1
  423. package/assets/esri/core/workers/chunks/6ff6783f89ecd3a5e752.js +0 -1
  424. package/assets/esri/core/workers/chunks/70763c7b68d8abe8d5fe.js +0 -1
  425. package/assets/esri/core/workers/chunks/716b1f073e3cd807abd3.js +0 -1
  426. package/assets/esri/core/workers/chunks/71a3f05cb86ae2920f8d.js +0 -1
  427. package/assets/esri/core/workers/chunks/71b672259bac2befd9c7.js +0 -1
  428. package/assets/esri/core/workers/chunks/71c996e1ae84d9daddf2.js +0 -1
  429. package/assets/esri/core/workers/chunks/723bb56de2324b41df4e.js +0 -1
  430. package/assets/esri/core/workers/chunks/73f61107cb7e6d30bf03.js +0 -1
  431. package/assets/esri/core/workers/chunks/752c34cee981862add89.js +0 -1
  432. package/assets/esri/core/workers/chunks/75915f81caaf9e5345a9.js +0 -1
  433. package/assets/esri/core/workers/chunks/75baf6dff6e7658b17b3.js +0 -1
  434. package/assets/esri/core/workers/chunks/760dfd585b6c2c1937ce.js +0 -1
  435. package/assets/esri/core/workers/chunks/76449e50222111ba0eb1.js +0 -1
  436. package/assets/esri/core/workers/chunks/76789f46b2c65d219cf9.js +0 -1
  437. package/assets/esri/core/workers/chunks/76bed5497f42f23a27ed.js +0 -1
  438. package/assets/esri/core/workers/chunks/7849cf0352c0a604e164.js +0 -1
  439. package/assets/esri/core/workers/chunks/7908aed639521cf572e8.js +0 -1
  440. package/assets/esri/core/workers/chunks/7d65a8ec5e1f871b9321.js +0 -1
  441. package/assets/esri/core/workers/chunks/7e4093f42795ba2f8cfd.js +0 -1
  442. package/assets/esri/core/workers/chunks/7f849c8255140be6097f.js +0 -1
  443. package/assets/esri/core/workers/chunks/804c31973f7d116523cb.js +0 -1
  444. package/assets/esri/core/workers/chunks/81726d997a2d34449bb2.js +0 -1
  445. package/assets/esri/core/workers/chunks/81883bca8a79ee2ddb00.js +0 -1
  446. package/assets/esri/core/workers/chunks/832ecc1f7d45774c4726.js +0 -1
  447. package/assets/esri/core/workers/chunks/8461f50e9875db4ccfec.js +0 -1
  448. package/assets/esri/core/workers/chunks/8598997340682113a2a5.js +0 -1
  449. package/assets/esri/core/workers/chunks/860a0f9d20f53db1caf4.js +0 -1
  450. package/assets/esri/core/workers/chunks/867e39bb444947c93586.js +0 -1
  451. package/assets/esri/core/workers/chunks/88ec63501fa2f6fdadca.js +0 -1
  452. package/assets/esri/core/workers/chunks/8980767c5b626e4dc3b9.js +0 -1
  453. package/assets/esri/core/workers/chunks/89dd1b1acb0d69264c93.js +0 -1
  454. package/assets/esri/core/workers/chunks/8a66a3e8391206f7d8aa.js +0 -1
  455. package/assets/esri/core/workers/chunks/8a8b7ac6693bdfbebf07.js +0 -1
  456. package/assets/esri/core/workers/chunks/8ad5e80e911419c1685a.js +0 -1
  457. package/assets/esri/core/workers/chunks/8b526ca2dd6fc6a7e921.js +0 -1
  458. package/assets/esri/core/workers/chunks/8e80441eddef1b5be8b9.js +0 -1
  459. package/assets/esri/core/workers/chunks/8f16a358ed83d2264415.js +0 -1
  460. package/assets/esri/core/workers/chunks/8fce15ce4cfdccf407f3.js +0 -1
  461. package/assets/esri/core/workers/chunks/8fd63cb38036f331a803.js +0 -1
  462. package/assets/esri/core/workers/chunks/91c5205d1274c7f190d5.js +0 -1
  463. package/assets/esri/core/workers/chunks/92341f36a8b15f34bcca.js +0 -1
  464. package/assets/esri/core/workers/chunks/937cf55b3b9d324eea73.js +0 -1
  465. package/assets/esri/core/workers/chunks/93d4bda22bde33fafa57.js +0 -1
  466. package/assets/esri/core/workers/chunks/9639b1dd27ccc17ee21e.js +0 -1
  467. package/assets/esri/core/workers/chunks/966d002acec8c72be56a.js +0 -1
  468. package/assets/esri/core/workers/chunks/986d8c3907aeeb18c4f6.js +0 -1
  469. package/assets/esri/core/workers/chunks/98e489c2b85feded7776.js +0 -1
  470. package/assets/esri/core/workers/chunks/9aef0b87f471626abd66.js +0 -1
  471. package/assets/esri/core/workers/chunks/9ba9a3705623679bc305.js +0 -1
  472. package/assets/esri/core/workers/chunks/a188d0767825d322f96d.js +0 -1
  473. package/assets/esri/core/workers/chunks/a4d3cbc02dc1186a9a6d.js +0 -1
  474. package/assets/esri/core/workers/chunks/a638de0102c3990403d1.js +0 -1
  475. package/assets/esri/core/workers/chunks/a6bda5f17fb1c03f7e4b.js +0 -1
  476. package/assets/esri/core/workers/chunks/a6dc01847f39413f78b8.js +0 -1
  477. package/assets/esri/core/workers/chunks/acc733b4881c3e4e503e.js +0 -1
  478. package/assets/esri/core/workers/chunks/b022debf9e0bc2bff0e2.js +0 -1
  479. package/assets/esri/core/workers/chunks/b09935d0105d50a0971b.js +0 -1
  480. package/assets/esri/core/workers/chunks/b12fc1b5a9da97346684.js +0 -1
  481. package/assets/esri/core/workers/chunks/b4323e69e624c6b51754.js +0 -1
  482. package/assets/esri/core/workers/chunks/b45e91249a8ea1559a2b.js +0 -1
  483. package/assets/esri/core/workers/chunks/b50a42a9f96515beb929.js +0 -1
  484. package/assets/esri/core/workers/chunks/b5141f240ca79729686d.js +0 -1
  485. package/assets/esri/core/workers/chunks/b549a4d4b1a34bee8beb.js +0 -1
  486. package/assets/esri/core/workers/chunks/bb89b6fd93513c61b2d3.js +0 -1
  487. package/assets/esri/core/workers/chunks/bc553ecc8cbcc1b02717.js +0 -1
  488. package/assets/esri/core/workers/chunks/bcba02f61cf0abcb5600.js +0 -1
  489. package/assets/esri/core/workers/chunks/bccc199af4e2e49f7acd.js +0 -1
  490. package/assets/esri/core/workers/chunks/bd0f488e228a75fbefb3.js +0 -30
  491. package/assets/esri/core/workers/chunks/bd155794e9bc16dd0474.js +0 -1
  492. package/assets/esri/core/workers/chunks/bf6ae205fbfbfcd1a0ee.js +0 -1
  493. package/assets/esri/core/workers/chunks/c148ad0ea9258046ac1f.js +0 -1
  494. package/assets/esri/core/workers/chunks/c228b058dd91bf0e1102.js +0 -1
  495. package/assets/esri/core/workers/chunks/c4e44fde4bc4ff89e2bc.js +0 -1
  496. package/assets/esri/core/workers/chunks/c4fc85281ca83af7abaf.js +0 -1
  497. package/assets/esri/core/workers/chunks/c610ccbfdb1c5b06c217.js +0 -1
  498. package/assets/esri/core/workers/chunks/c660a5a1086870a3a6b9.js +0 -1
  499. package/assets/esri/core/workers/chunks/c8b7ffc5cb3f1493129e.js +0 -1
  500. package/assets/esri/core/workers/chunks/c9057b0ad2c2bae4a8ce.js +0 -1
  501. package/assets/esri/core/workers/chunks/c93a68618674b38b932e.js +0 -1
  502. package/assets/esri/core/workers/chunks/c961aff385e38b081204.js +0 -1
  503. package/assets/esri/core/workers/chunks/cc0efa716b8414a44398.js +0 -1
  504. package/assets/esri/core/workers/chunks/cd66bd30f654fe571e57.js +0 -1
  505. package/assets/esri/core/workers/chunks/cd88e6f02bc2e5b67abf.js +0 -1
  506. package/assets/esri/core/workers/chunks/cf826787ab8d4b27ad80.js +0 -1
  507. package/assets/esri/core/workers/chunks/cfbbfa5edffa57bd3a8e.js +0 -1
  508. package/assets/esri/core/workers/chunks/d0217187aed8bb7038f4.js +0 -1
  509. package/assets/esri/core/workers/chunks/d1928a8c86a8966e5582.js +0 -1
  510. package/assets/esri/core/workers/chunks/d2745886ba5a86fd5c4c.js +0 -680
  511. package/assets/esri/core/workers/chunks/d4c341b15d9244276fb9.js +0 -1
  512. package/assets/esri/core/workers/chunks/d5faab9799891e5da5a8.js +0 -1
  513. package/assets/esri/core/workers/chunks/d811924acc9c0be95bba.js +0 -1
  514. package/assets/esri/core/workers/chunks/db90fb8ac96579259566.js +0 -1
  515. package/assets/esri/core/workers/chunks/dd0acd0f8b96839b4f24.js +0 -2
  516. package/assets/esri/core/workers/chunks/dd785e595cd08b2d6284.js +0 -1
  517. package/assets/esri/core/workers/chunks/e0b47b08ae2c36c76fa2.js +0 -1
  518. package/assets/esri/core/workers/chunks/e1ddb8e4977b317fd40c.js +0 -1
  519. package/assets/esri/core/workers/chunks/e4015870412edd69453c.js +0 -1
  520. package/assets/esri/core/workers/chunks/e7cb1b72f0b54e845741.js +0 -1
  521. package/assets/esri/core/workers/chunks/e7e7c7cbfd8542bd7a46.js +0 -1
  522. package/assets/esri/core/workers/chunks/e80376832050a4b6d28a.js +0 -1
  523. package/assets/esri/core/workers/chunks/e8a885b576da3ec145d3.js +0 -1
  524. package/assets/esri/core/workers/chunks/e95ee94027c1934086d8.js +0 -1
  525. package/assets/esri/core/workers/chunks/e961c6140c39921816a8.js +0 -1
  526. package/assets/esri/core/workers/chunks/eb7daa0f6610983ff8db.js +0 -1
  527. package/assets/esri/core/workers/chunks/eb842cf470ce28a73187.js +0 -1
  528. package/assets/esri/core/workers/chunks/eeea5710275c967e8d51.js +0 -1
  529. package/assets/esri/core/workers/chunks/ef32e454012f3b0e3f77.js +0 -1
  530. package/assets/esri/core/workers/chunks/f31a8e76f1dde23c0900.js +0 -1
  531. package/assets/esri/core/workers/chunks/f50bba74ae72c07e131a.js +0 -1
  532. package/assets/esri/core/workers/chunks/f58ddf37dee066a5c0d8.js +0 -1
  533. package/assets/esri/core/workers/chunks/f80cadcc2a588da63b38.js +0 -1
  534. package/assets/esri/core/workers/chunks/f83e3ad67b60744afd6d.js +0 -1
  535. package/assets/esri/core/workers/chunks/f859c53432f258af77e3.js +0 -2
  536. package/assets/esri/core/workers/chunks/f8bbb52b865a0a242140.js +0 -1
  537. package/assets/esri/core/workers/chunks/f8f3579d0c1b65762902.js +0 -1
  538. package/assets/esri/core/workers/chunks/f9592bcdd9988199a7ea.js +0 -1
  539. package/assets/esri/core/workers/chunks/fedbeb488d5d7c07c7dc.js +0 -1
  540. package/assets/esri/core/workers/chunks/ff7e1eb2366d4301d288.js +0 -1
  541. /package/assets/esri/core/workers/chunks/{47948c72bc01bd173c20.js.LICENSE.txt → 24c0b3586bb6500eda53.js.LICENSE.txt} +0 -0
  542. /package/assets/esri/core/workers/chunks/{f859c53432f258af77e3.js.LICENSE.txt → 394716bd1ecfd638d708.js.LICENSE.txt} +0 -0
  543. /package/assets/esri/core/workers/chunks/{1040bce57ea63a6dbca4.js.LICENSE.txt → 55af58b6dff52dc040fe.js.LICENSE.txt} +0 -0
  544. /package/assets/esri/core/workers/chunks/{dd0acd0f8b96839b4f24.js.LICENSE.txt → 5b18696109fe84a1010a.js.LICENSE.txt} +0 -0
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{fromValues as t}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as e}from"../../../../geometry/support/aaBoundingBox.js";import{BufferViewUint32 as i,BufferViewVec3f as r,BufferViewVec2Snorm16 as s,BufferViewSnorm16 as o,BufferViewFloat16 as a,BufferViewFloat as n,BufferViewVec2f as h,BufferViewVec4Unorm8 as c,BufferViewUnorm8 as p}from"../../../../geometry/support/buffer/BufferView.js";import{maxPathFrameIndex as u}from"../../layers/graphics/Graphics3DPathSymbolLayerConstants.js";import{isShadowLike as f,is3DGeometry as l,isColor as g}from"../core/shaderLibrary/ShaderOutput.js";import{olidEnabled as m}from"../effects/geometry/olidUtils.js";import d from"../lib/GLMaterial.js";import{isPathGeometry as b}from"../lib/PathGeometry.js";import{offsetPathVertexInfoFrameIndex as y}from"../lib/PathVertexInfo.js";import{MeshIntersectionOptions as _,intersectAabbInvDir as S}from"../lib/RayIntersections.js";import{assert as F}from"../lib/Util.js";import{applyPolygonOffsetToHit as P}from"./intersectWithPolygonOffset.js";import{getLayout as x,getTextureLayout as V}from"./PathLayouts.js";import{PathPassParameters as w,PathTechnique as R}from"./PathTechnique.js";import{PathTechniqueConfiguration as j}from"./PathTechniqueConfiguration.js";import{TriangleMaterial as C}from"./TriangleMaterial.js";import{writeAttributes as z,writePosition as M,writeBufferVec2 as O,writeBufferInt16 as v,writeBufferFloat16 as A,writeBufferFloat as B,writeColor as T,writeBufferUint8 as I,writeOlidColor as U}from"./internal/bufferWriterUtils.js";import{hasShadowHighlights as q}from"../shaders/ReceiveShadowsConfiguration.js";import{alphaCutoff as L}from"../../../../webscene/support/AlphaCutoff.js";class D extends C{constructor(e,i){super(e,W),this.supportsEdges=!0,this._pp0=t(0,0,1),this._pp1=t(0,0,0),this.produces=new Map([[2,t=>(this.parameters.castShadows&&f(t)||l(t))&&!this.transparent],[4,t=>(this.parameters.castShadows&&f(t)||l(t))&&this.transparent]]),this._configuration=new j(i.spherical)}get emissions(){return this.parameters.emissiveStrength>0?this.transparent?2:1:0}updateConfiguration(t){super.updateConfiguration(t),this._configuration.hasVVSize=this.parameters.hasVVSize,this._configuration.hasVVColor=this.parameters.hasVVColor,this._configuration.hasVVOpacity=this.parameters.hasVVOpacity,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.transparent=this.transparent,this._configuration.hasOccludees=t.hasOccludees,this._configuration.cullFace=this.parameters.hasSlicePlane?0:this.parameters.cullFace,this._configuration.offsetBackfaces=this.transparent,g(t.output)?(this._configuration.receiveShadows=t.shadowMap.enabled,this._configuration.hasShadowHighlights=q(this._configuration,t),this._configuration.receiveAmbientOcclusion=null!=t.ssao):this._configuration.receiveShadows=this._configuration.hasShadowHighlights=this._configuration.receiveAmbientOcclusion=!1,this._configuration.pbrMode=this.parameters.usePBR?2:0,this._configuration.emissionSource=this.parameters.usePBR?1:0,this._configuration.snowCover=t.snowCover>0,this._configuration.upVectorAlignment=this.parameters.upVectorAlignment,this._configuration.pathCapType=this.parameters.pathCapType,this._configuration.pathProfileType=this.parameters.profile.type,this._configuration.hasPathSize=this.parameters.hasPathSize,this._configuration.hasPathColor=this.parameters.hasPathColor,this._configuration.hasPathOpacity=this.parameters.hasPathOpacity}isVisibleForOutput(t){return 5!==t&&7!==t&&6!==t||this.parameters.castShadows}get visible(){return this.parameters.opacity>=L}intersectRay(t,e,i,r,s,o){this._intersectRay(t,i,r,s,o)}intersectRayDraped(t,e,i,r){return this._pp0[0]=this._pp1[0]=i[0],this._pp0[1]=this._pp1[1]=i[1],this._intersectRay(t,e,this._pp0,this._pp1,r)}intersectScreenPolygon(t,e,i,r){return b(t)?P(t.intersectScreenPolygon(i,e,r),this._configuration,i.camera.eye):null}_intersectRay(t,i,r,s,o){if(!b(t))return;const a=new _(i.tolerance,!1,i.options.normalRequired),n=t.boundingInfo;if(null==n)return void t.intersectRay(r,s,a,o);const h=e(n.bbMin[0],n.bbMin[1],n.bbMin[2],n.bbMax[0],n.bbMax[1],n.bbMax[2]),c=[s[0]-r[0],s[1]-r[1],s[2]-r[2]],p=Math.sqrt(c[0]*c[0]+c[1]*c[1]+c[2]*c[2]),u=[p/c[0],p/c[1],p/c[2]];S(h,r,u,i.tolerance)&&t.intersectRay(r,s,a,o)}createBufferWriter(){return new H(x(),V(this.parameters))}createGLMaterial(t){return new G(t)}get transparent(){const{parameters:t}=this;return t.drivenOpacity||t.opacity<1}}class G extends d{beginSlot(t){return this.getTechnique(R,t)}}class W extends w{constructor(){super(...arguments),this.polygonOffset=0,this.castShadows=!0,this.hasSlicePlane=!1,this.drivenOpacity=!1,this.usePBR=!1,this.upVectorAlignment=0,this.pathCapType=1,this.cullFace=2}}class H{constructor(t,e){this.layout=t,this.textureBufferLayout=e,this.maxTextureBufferItemIndex=u}elementCount(t){return t.get("pathVertexInfo")?.indices.length??0}elementCountTextureBuffer(t){return t.get("position")?.indices.length??0}write(t,e,u,f,l,g){F(null!=g,"Texture buffer is required for path material"),z(u,f,this.layout,t,e,l);const d=g.offset,b=g.textureBufferRange.from,_=l.buffer.getField("pathVertexInfo",i),S=u.get("pathVertexInfo");if(_&&S){F(1===S.size);const{data:t,stride:e,indices:i}=S;for(let r=0;r<i.length;++r){const s=t[e*i[r]];_.set(l.offset+r,y(s,b))}}const P=g.buffer.getField("position",r),x=u.get("position");P&&x&&(F(3===x.size),M(x,t,P,d));const V=g.buffer.getField("profileRight",s),w=u.get("profileRight");V&&w&&(F(2===w.size),O(w,V,d));const R=g.buffer.getField("profileUp",s),j=u.get("profileUp");R&&j&&(F(2===j.size),O(j,R,d));const C=g.buffer.getField("profileRotation",o),q=u.get("profileRotation");C&&q&&(F(1===q.size),v(q,C,d));const L=g.buffer.getField("pathRotationUp",s),D=u.get("pathRotationUp");L&&D&&(F(2===D.size),O(D,L,d));const G=g.buffer.getField("pathMaxStretchDistance",a),W=u.get("pathMaxStretchDistance");G&&W&&(F(1===W.size),A(W,G,d));const H=g.buffer.getField("sizeFeatureAttribute",n),k=u.get("sizeFeatureAttribute");H&&k&&B(k,H,d);const E=g.buffer.getField("size",h),J=u.get("size");E&&J&&(F(2===J.size),O(J,E,d));const K=g.buffer.getField("colorFeatureAttribute",n),N=u.get("colorFeatureAttribute");K&&N&&B(N,K,d);const Q=g.buffer.getField("color",c),X=u.get("color");Q&&X&&T(X,4,Q,d);const Y=g.buffer.getField("opacityFeatureAttribute",n),Z=u.get("opacityFeatureAttribute");Y&&Z&&B(Z,Y,d);const $=g.buffer.getField("opacity",p),tt=u.get("opacity");if($&&tt&&(F(1===tt.size),I(tt,$,d)),m()){const t=g.buffer.getField("olidColor",c),e=x?.indices.length??0;f&&t&&e&&U(f,t,e,d)}}}export{W as Parameters,H as PathBufferWriter,D as PathMaterial};
2
+ import{fromValues as t}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as e}from"../../../../geometry/support/aaBoundingBox.js";import{BufferViewUint32 as i,BufferViewVec3f as r,BufferViewVec2Snorm16 as s,BufferViewSnorm16 as o,BufferViewFloat16 as a,BufferViewFloat as n,BufferViewVec2f as h,BufferViewVec4Unorm8 as c,BufferViewUnorm8 as p}from"../../../../geometry/support/buffer/BufferView.js";import{maxPathFrameIndex as u}from"../../layers/graphics/Graphics3DPathSymbolLayerConstants.js";import{isShadowLike as f,is3DGeometry as l,isColor as g}from"../core/shaderLibrary/ShaderOutput.js";import{olidEnabled as m}from"../effects/geometry/olidUtils.js";import d from"../lib/GLMaterial.js";import{isPathGeometry as b}from"../lib/PathGeometry.js";import{offsetPathVertexInfoFrameIndex as y}from"../lib/PathVertexInfo.js";import{MeshIntersectionOptions as _,intersectAabbInvDir as S}from"../lib/RayIntersections.js";import{assert as w}from"../lib/Util.js";import{applyPolygonOffsetToHit as x}from"./intersectWithPolygonOffset.js";import{getLayout as F,getTextureLayout as V}from"./PathLayouts.js";import{PathPassParameters as P,PathTechnique as j}from"./PathTechnique.js";import{PathTechniqueConfiguration as R}from"./PathTechniqueConfiguration.js";import{TriangleMaterial as C}from"./TriangleMaterial.js";import{writeAttributes as z,writePosition as B,writeBufferVec2 as M,writeBufferInt16 as O,writeBufferFloat16 as v,writeBufferFloat as A,writeColor as T,writeBufferUint8 as I,writeOlidColor as U}from"./internal/bufferWriterUtils.js";import{hasShadowHighlights as L}from"../shaders/ReceiveShadowsConfiguration.js";import{alphaCutoff as q}from"../../../../webscene/support/AlphaCutoff.js";class D extends C{constructor(e,i){super(e,W),this.supportsEdges=!0,this._pp0=t(0,0,1),this._pp1=t(0,0,0),this.produces=new Map([[2,t=>(this.parameters.castShadows&&f(t)||l(t))&&!this.transparent],[4,t=>(this.parameters.castShadows&&f(t)||l(t))&&this.transparent]]),this._configuration=new R(i.spherical)}get emissions(){return this.parameters.emissiveStrength>0?this.transparent?2:1:0}updateConfiguration(t){super.updateConfiguration(t),this._configuration.hasVVSize=this.parameters.hasVVSize,this._configuration.hasVVColor=this.parameters.hasVVColor,this._configuration.hasVVOpacity=this.parameters.hasVVOpacity,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.transparent=this.transparent,this._configuration.hasOccludees=t.hasOccludees,this._configuration.cullFace=this.parameters.hasSlicePlane?0:this.parameters.cullFace,this._configuration.offsetBackfaces=this.transparent,g(t.output)?(this._configuration.receiveShadows=t.shadowMap.enabled,this._configuration.hasShadowHighlights=L(this._configuration,t),this._configuration.receiveAmbientOcclusion=null!=t.ssao):this._configuration.receiveShadows=this._configuration.hasShadowHighlights=this._configuration.receiveAmbientOcclusion=!1,this._configuration.pbrMode=this.parameters.usePBR?2:0,this._configuration.emissionSource=this.parameters.usePBR?1:0,this._configuration.snowCover=t.snowCover>0,this._configuration.upVectorAlignment=this.parameters.upVectorAlignment,this._configuration.pathCapType=this.parameters.pathCapType,this._configuration.pathProfileType=this.parameters.profile.type,this._configuration.hasPathSize=this.parameters.hasPathSize,this._configuration.hasPathColor=this.parameters.hasPathColor,this._configuration.hasPathOpacity=this.parameters.hasPathOpacity}isVisibleForOutput(t){return 5!==t&&7!==t&&6!==t||this.parameters.castShadows}get visible(){return this.parameters.opacity>=q}intersectRay(t,e,i,r,s,o){this._intersectRay(t,i,r,s,o)}intersectRayDraped(t,e,i,r){return this._pp0[0]=this._pp1[0]=i[0],this._pp0[1]=this._pp1[1]=i[1],this._intersectRay(t,e,this._pp0,this._pp1,r)}intersectScreenPolygon(t,e,i,r){return b(t)?x(t.intersectScreenPolygon(i,e,r),this._configuration,i.camera.eye):null}_intersectRay(t,i,r,s,o){if(!b(t))return;const a=new _(i.tolerance,!1,i.options.normalRequired),n=t.boundingInfo;if(null==n)return void t.intersectRay(r,s,a,o);const h=e(n.bbMin[0],n.bbMin[1],n.bbMin[2],n.bbMax[0],n.bbMax[1],n.bbMax[2]),c=[s[0]-r[0],s[1]-r[1],s[2]-r[2]],p=Math.sqrt(c[0]*c[0]+c[1]*c[1]+c[2]*c[2]),u=[p/c[0],p/c[1],p/c[2]];S(h,r,u,i.tolerance)&&t.intersectRay(r,s,a,o)}createBufferWriter(){return new H(F(),V(this.parameters))}createGLMaterial(t){return new G(t)}get transparent(){const{parameters:t}=this;return t.drivenOpacity||t.opacity<1}}class G extends d{beginSlot(t){return this.getTechnique(j,t)}}class W extends P{constructor(){super(...arguments),this.polygonOffset=0,this.castShadows=!0,this.hasSlicePlane=!1,this.drivenOpacity=!1,this.usePBR=!1,this.upVectorAlignment=0,this.pathCapType=1,this.cullFace=2}}class H{constructor(t,e){this.layout=t,this.textureBufferLayout=e,this.maxTextureBufferItemIndex=u}elementCount(t){return t.get("pathVertexInfo")?.indices.length??0}elementCountTextureBuffer(t){return t.get("position")?.indices.length??0}write(t,e,i,r,s,o,a){null!=s&&this._writeVertexBuffer(t,e,i,s,o),null!=a&&this._writeTextureBuffer(t,i,r,a)}_writeVertexBuffer(t,e,r,s,o){z(r,null,this.layout,t,e,s);const a=o?.from??0,n=s.buffer.getField("pathVertexInfo",i),h=r.get("pathVertexInfo");if(n&&h){w(1===h.size);const{data:t,stride:e,indices:i}=h;for(let r=0;r<i.length;++r){const o=t[e*i[r]];n.set(s.offset+r,y(o,a))}}}_writeTextureBuffer(t,e,i,u){const f=u.offset,l=u.buffer.getField("position",r),g=e.get("position");l&&g&&(w(3===g.size),B(g,t,l,f));const d=u.buffer.getField("profileRight",s),b=e.get("profileRight");d&&b&&(w(2===b.size),M(b,d,f));const y=u.buffer.getField("profileUp",s),_=e.get("profileUp");y&&_&&(w(2===_.size),M(_,y,f));const S=u.buffer.getField("profileRotation",o),x=e.get("profileRotation");S&&x&&(w(1===x.size),O(x,S,f));const F=u.buffer.getField("pathRotationUp",s),V=e.get("pathRotationUp");F&&V&&(w(2===V.size),M(V,F,f));const P=u.buffer.getField("pathMaxStretchDistance",a),j=e.get("pathMaxStretchDistance");P&&j&&(w(1===j.size),v(j,P,f));const R=u.buffer.getField("sizeFeatureAttribute",n),C=e.get("sizeFeatureAttribute");R&&C&&A(C,R,f);const z=u.buffer.getField("size",h),L=e.get("size");z&&L&&(w(2===L.size),M(L,z,f));const q=u.buffer.getField("colorFeatureAttribute",n),D=e.get("colorFeatureAttribute");q&&D&&A(D,q,f);const G=u.buffer.getField("color",c),W=e.get("color");G&&W&&T(W,4,G,f);const H=u.buffer.getField("opacityFeatureAttribute",n),k=e.get("opacityFeatureAttribute");H&&k&&A(k,H,f);const E=u.buffer.getField("opacity",p),J=e.get("opacity");if(E&&J&&(w(1===J.size),I(J,E,f)),m()){const t=u.buffer.getField("olidColor",c),e=g?.indices.length??0;i&&t&&e&&U(i,t,e,f)}}}export{W as Parameters,H as PathBufferWriter,D as PathMaterial};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{IDENTITY as e}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{fromValues as t}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{BufferViewVec4f as r,BufferViewUint32 as s,BufferViewMat3f as i,BufferViewVec4u8 as o,BufferViewFloat as n}from"../../../../geometry/support/buffer/BufferView.js";import{isHighlightOrOLID as a,isColor as u,isDepth as f,isColorHighlightOrOLID as l}from"../core/shaderLibrary/ShaderOutput.js";import c from"../lib/GLMaterial.js";import{assert as h}from"../lib/Util.js";import{DefaultBufferWriter as p}from"./DefaultBufferWriter.js";import{TriangleMaterial as m}from"./TriangleMaterial.js";import{VisualVariablePassParameters as d}from"./VisualVariablePassParameters.js";import{writeAttributes as g,writeBufferVec4 as x,writeTextureElementIndex as b,writeConstTextureElementIndex as y,writeColor as j,writeVVFeatureAttribute as B}from"./internal/bufferWriterUtils.js";import{getLayout as w,getTextureLayout as C}from"../shaders/PatternLayouts.js";import{PatternTechnique as v}from"../shaders/PatternTechnique.js";import{PatternTechniqueConfiguration as F}from"../shaders/PatternTechniqueConfiguration.js";import{alphaCutoff as S}from"../../../../webscene/support/AlphaCutoff.js";class _ extends m{constructor(e){super(e,T),this._configuration=new F,this.supportsEdges=!0,this.transparent=!0,this.produces=new Map([[2,e=>a(e)],[4,e=>u(e)],[5,e=>f(e)],[18,e=>this.parameters.draped&&l(e)]])}updateConfiguration(e){super.updateConfiguration(e),this._configuration.cullFace=this.parameters.cullFace,this._configuration.hasVertexColors=this.parameters.hasVertexColors&&!this.parameters.vvColor,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.style=this.parameters.style,this._configuration.draped=this.parameters.draped,this._configuration.hasVVColor=!!this.parameters.vvColor,this._configuration.emissionSource=this.emissions?1:0}get visible(){return this.parameters.color[3]>=S}get emissions(){return this.parameters.emissiveStrength>0?2:0}createGLMaterial(e){return new P(e)}createBufferWriter(){return new V(w(this.parameters),C(this.parameters))}}class P extends c{beginSlot(e){return this.getTechnique(v,e)}}class V extends p{constructor(e,t){super(e),this.textureBufferLayout=t}elementCountTextureBuffer(e){return e.get("boundingRect")?.indices.length??0}write(e,t,i,o,n,a){const{buffer:u,offset:f}=n,l=a?.textureBufferRange;g(i,o,this.layout,e,t,n);for(const s of this.layout.fields.keys()){const e=i.get(s),t=e?.indices;if(e&&t)switch(s){case"uvMapSpace":{h(4===e.size);const t=u.getField(s,r);t&&x(e,t,f);break}}}const{textureBufferLayout:c}=this;if(null==c)return;h(null!=l,"Using a texture layout, but the texture range for this instance was not provided");const p=l.from,m=u.getField("textureElementIndex",s);h(null!=m,"Missing component index field");const d=i.get("position")?.indices.length??0,j=i.get("textureElementIndex");null!=j?b(j,m,f,p):y(m,f,p,d),this._writeTextureBuffer(e,i,a)}_writeTextureBuffer(t,r,s){const{textureBufferLayout:a}=this;if(null==a||null==s)return;const{buffer:u,offset:f}=s,l=u.getField("boundingRect",i),c=r.get("boundingRect");l&&c&&(h(9===c.size),L(c,t??e,l,f));const p=u.getField("color",o),m=r.get("color");p&&m&&(h(3===m.size||4===m.size),j(m,m.size,p,f));const d=u.getField("colorFeatureAttribute",n),g=r.get("colorFeatureAttribute");d&&g&&(h(1===g.size),B(g,d,f))}}function L(e,t,r,s){const{data:i,indices:o}=e,n=t,a=r.typedBuffer,u=r.typedBufferStride,f=o.length;s*=u;for(let l=0;l<f;++l){const e=9*o[l],t=i[e],r=i[e+1],f=i[e+2];a[s]=n[0]*t+n[4]*r+n[8]*f+n[12],a[s+1]=n[1]*t+n[5]*r+n[9]*f+n[13],a[s+2]=n[2]*t+n[6]*r+n[10]*f+n[14];for(let o=3;o<9;++o)a[s+o]=i[e+o];s+=u}}class T extends d{constructor(){super(...arguments),this.color=t(1,1,1,1),this.emissiveStrength=0,this.hasVertexColors=!1,this.polygonOffset=0,this.hasSlicePlane=!1,this.cullFace=0,this.hasOccludees=!1,this.style=2,this.draped=!0,this.useIndexing=!0}}export{T as Parameters,_ as PatternMaterial};
2
+ import{IDENTITY as e}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{fromValues as t}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{BufferViewVec4f as r,BufferViewUint32 as s,BufferViewMat3f as i,BufferViewVec4u8 as o,BufferViewFloat as n}from"../../../../geometry/support/buffer/BufferView.js";import{isHighlightOrOLID as a,isColor as u,isDepth as f,isColorHighlightOrOLID as l}from"../core/shaderLibrary/ShaderOutput.js";import c from"../lib/GLMaterial.js";import{assert as h}from"../lib/Util.js";import{DefaultBufferWriter as m}from"./DefaultBufferWriter.js";import{TriangleMaterial as p}from"./TriangleMaterial.js";import{VisualVariablePassParameters as d}from"./VisualVariablePassParameters.js";import{writeAttributes as g,writeBufferVec4 as x,writeTextureElementIndex as b,writeConstTextureElementIndex as y,writeColor as j,writeVVFeatureAttribute as B}from"./internal/bufferWriterUtils.js";import{getLayout as w,getTextureLayout as _}from"../shaders/PatternLayouts.js";import{PatternTechnique as C}from"../shaders/PatternTechnique.js";import{PatternTechniqueConfiguration as F}from"../shaders/PatternTechniqueConfiguration.js";import{alphaCutoff as S}from"../../../../webscene/support/AlphaCutoff.js";class V extends p{constructor(e){super(e,T),this._configuration=new F,this.supportsEdges=!0,this.transparent=!0,this.produces=new Map([[2,e=>a(e)],[4,e=>u(e)],[5,e=>f(e)],[18,e=>this.parameters.draped&&l(e)]])}updateConfiguration(e){super.updateConfiguration(e),this._configuration.cullFace=this.parameters.cullFace,this._configuration.hasVertexColors=this.parameters.hasVertexColors&&!this.parameters.vvColor,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.style=this.parameters.style,this._configuration.draped=this.parameters.draped,this._configuration.hasVVColor=!!this.parameters.vvColor,this._configuration.emissionSource=this.emissions?1:0}get visible(){return this.parameters.color[3]>=S}get emissions(){return this.parameters.emissiveStrength>0?2:0}createGLMaterial(e){return new v(e)}createBufferWriter(){return new P(w(this.parameters),_(this.parameters))}}class v extends c{beginSlot(e){return this.getTechnique(C,e)}}class P extends m{constructor(e,t){super(e),this.textureBufferLayout=t}elementCountTextureBuffer(e){return e.get("boundingRect")?.indices.length??0}write(e,t,r,s,i,o,n){null!=i&&this._writeVertexBuffer(e,t,r,s,i,o),null!=n&&this._writeTextureBuffer(e,r,n)}_writeVertexBuffer(e,t,i,o,n,a){const{buffer:u,offset:f}=n;g(i,o,this.layout,e,t,n);for(const s of this.layout.fields.keys()){const e=i.get(s),t=e?.indices;if(e&&t)switch(s){case"uvMapSpace":{h(4===e.size);const t=u.getField(s,r);t&&x(e,t,f);break}}}const{textureBufferLayout:l}=this;if(null!=l&&null!=a){const e=a.from,t=u.getField("textureElementIndex",s);h(null!=t,"Missing component index field");const r=i.get("position")?.indices.length??0,o=i.get("textureElementIndex");null!=o?b(o,t,f,e):y(t,f,e,r)}}_writeTextureBuffer(t,r,s){const{textureBufferLayout:a}=this;if(null==a)return;const{buffer:u,offset:f}=s,l=u.getField("boundingRect",i),c=r.get("boundingRect");l&&c&&(h(9===c.size),L(c,t??e,l,f));const m=u.getField("color",o),p=r.get("color");m&&p&&(h(3===p.size||4===p.size),j(p,p.size,m,f));const d=u.getField("colorFeatureAttribute",n),g=r.get("colorFeatureAttribute");d&&g&&(h(1===g.size),B(g,d,f))}}function L(e,t,r,s){const{data:i,indices:o}=e,n=t,a=r.typedBuffer,u=r.typedBufferStride,f=o.length;s*=u;for(let l=0;l<f;++l){const e=9*o[l],t=i[e],r=i[e+1],f=i[e+2];a[s]=n[0]*t+n[4]*r+n[8]*f+n[12],a[s+1]=n[1]*t+n[5]*r+n[9]*f+n[13],a[s+2]=n[2]*t+n[6]*r+n[10]*f+n[14];for(let o=3;o<9;++o)a[s+o]=i[e+o];s+=u}}class T extends d{constructor(){super(...arguments),this.color=t(1,1,1,1),this.emissiveStrength=0,this.hasVertexColors=!1,this.polygonOffset=0,this.hasSlicePlane=!1,this.cullFace=0,this.hasOccludees=!1,this.style=2,this.draped=!0,this.useIndexing=!0}}export{T as Parameters,V as PatternMaterial};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import e from"../../../../core/Logger.js";import{clamp as t}from"../../../../core/mathUtils.js";import{createRenderScreenPointArray3 as r,createScreenPointArray as i}from"../../../../core/screenUtils.js";import{secondsFromMilliseconds as s,Seconds as a}from"../../../../core/time.js";import{copy as n}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{set as o,subtract as l,dot as p,scale as c,add as m,copy as h,length as u,distance as f,lerp as d,transformMat4 as g,normalize as b}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as S}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{set as _}from"../../../../core/libs/gl-matrix-2/math/vec4.js";import{ONES as v,create as y}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{makeFloat16Array as P}from"../../../../geometry/support/float16.js";import{fromPoints as E,distance2 as x,closestLineSegmentPoint as w,projectPoint as z,projectPointFraction as j,create as T}from"../../../../geometry/support/lineSegment.js";import{fromPoints as L,signedDistance as A,getNormal as M,create as R}from"../../../../geometry/support/plane.js";import{BufferViewUint32 as C,BufferViewVec3f as O}from"../../../../geometry/support/buffer/BufferView.js";import{isHighlightOrOLID as V,isColor as F,isDepth as B,isColorHighlightOLIDOrDepth as U,is2DGeometryOutput as N}from"../core/shaderLibrary/ShaderOutput.js";import{olidEnabled as I}from"../effects/geometry/olidUtils.js";import k from"../lib/GLMaterial.js";import{Material as W}from"../lib/Material.js";import{projectWorldLineSegmentToRenderScreen as D,screenPolygonIntersectsBufferedSegment as Y}from"../lib/screenPolygonOverlapUtils.js";import{Hit as J}from"../lib/screenPolygonTriangleIntersections.js";import{ScreenSizePerspectiveEvaluator as q}from"../lib/screenSizePerspectiveUtils.js";import{isTranslationMatrix as X,assert as G}from"../lib/Util.js";import{isImagePattern as H}from"./lineStippleUtils.js";import{VisualVariablePassParameters as K}from"./VisualVariablePassParameters.js";import{r as Q}from"../../../../chunks/RibbonLine.glsl.js";import{getLayout as Z,getTextureBufferLayout as $}from"../shaders/RibbonLineLayouts.js";import{RibbonLineTechnique as ee}from"../shaders/RibbonLineTechnique.js";import{RibbonLineTechniqueConfiguration as te}from"../shaders/RibbonLineTechniqueConfiguration.js";import{alphaCutoff as re}from"../../../../webscene/support/AlphaCutoff.js";class ie extends W{constructor(e,t){super(e,ae),this.produces=new Map([[2,e=>V(e)||F(e)&&8===this.parameters.renderOccluded],[3,e=>B(e)],[10,e=>U(e)&&8===this.parameters.renderOccluded],[11,e=>U(e)&&8===this.parameters.renderOccluded],[4,e=>F(e)&&this.parameters.writeDepth&&8!==this.parameters.renderOccluded],[8,e=>F(e)&&!this.parameters.writeDepth&&8!==this.parameters.renderOccluded],[18,e=>N(e)]]),this._configuration=new te(t)}updateConfiguration(e){super.updateConfiguration(e);const t=18===e.slot,r=null!=this.parameters.stipplePattern&&null!=this.parameters.stippleTexture&&10!==e.output,i=r&&t&&this.parameters.isImagePattern();this._configuration.draped=t,this._configuration.polygonOffset=this.parameters.polygonOffset,this._configuration.stippleEnabled=r,this._configuration.stippleOffColorEnabled=r&&null!=this.parameters.stippleOffColor,this._configuration.stipplePreferContinuous=r&&this.parameters.stipplePreferContinuous,this._configuration.numJoinSubdivisions=ce(this.parameters.join,r),this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.roundJoins="round"===this.parameters.join,this._configuration.capType=this.parameters.cap,this._configuration.applyMarkerOffset=null!=this.parameters.markerParameters&&pe(this.parameters.markerParameters),this._configuration.polygonOffsetIndex=this.parameters.polygonOffsetIndex,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.hasVVSize=this.parameters.hasVVSize,this._configuration.hasVVColor=this.parameters.hasVVColor,this._configuration.hasVVOpacity=this.parameters.hasVVOpacity,this._configuration.innerColorEnabled=this.parameters.innerWidth>0&&null!=this.parameters.innerColor,this._configuration.falloffEnabled=this.parameters.falloff>0,this._configuration.hasOccludees=e.hasOccludees,this._configuration.occluder=8===this.parameters.renderOccluded,this._configuration.wireframe=this.parameters.wireframe,this._configuration.animation=this.parameters.animation,this._configuration.emissionSource=this.emissions?1:0,this._configuration.hasScreenSizePerspective=!!this.parameters.screenSizePerspective&&!i,this._configuration.worldSizedImagePattern=i}get visible(){return this.parameters.color[3]>=re||null!=this.parameters.stipplePattern&&(this.parameters.stippleOffColor?.[3]??0)>re}get emissions(){return this.parameters.emissiveStrength>0?8!==this.parameters.renderOccluded?2:1:0}setParameters(e,t){e.animation=this.parameters.animation,super.setParameters(e,t)}intersectRayDraped({attributes:e,screenToWorldRatio:r},i,s,a,n){if(!i.options.selectionMode)return;const o=e.get("size");let l=this.parameters.width;if(this.parameters.vvSize){const r=e.get("sizeFeatureAttribute").data[0];Number.isNaN(r)?l*=this.parameters.vvSize.fallback[0]:l*=t(this.parameters.vvSize.offset[0]+r*this.parameters.vvSize.factor[0],this.parameters.vvSize.minSize[0],this.parameters.vvSize.maxSize[0])}else o&&(l*=o.data[0]);const p=s[0],c=s[1],m=(l/2+Ue)*r;let h=Number.MAX_VALUE,u=0;const f=e.get("position").data,d=le(this.parameters,e)?f.length-2:f.length-5;for(let g=0;g<d;g+=3){const e=f[g],r=f[g+1],i=(g+3)%f.length,s=p-e,a=c-r,n=f[i]-e,o=f[i+1]-r,l=t((n*s+o*a)/(n*n+o*o),0,1),m=n*l-s,d=o*l-a,b=m*m+d*d;b<h&&(h=b,u=g/3)}h<m*m&&a(n.distance,n.normal,u)}intersectRay(t,r,i,s,a,d){const{options:g,camera:b,rayBegin:S,rayEnd:_}=i;if(!g.selectionMode||!t.visible||!b)return;if(!X(r))return void e.getLogger("esri.views.3d.webgl-engine.materials.RibbonLineMaterial").error("intersection assumes a translation-only matrix");const v=t.attributes,y=v.get("position").data,P=this._getLineSize(v),z=_e;n(z,i.point);const j=P*b.pixelRatio,T=Ue*b.pixelRatio,R=j/2+T;o(Re[0],z[0]-R,z[1]+R,0),o(Re[1],z[0]+R,z[1]+R,0),o(Re[2],z[0]+R,z[1]-R,0),o(Re[3],z[0]-R,z[1]-R,0);for(let e=0;e<4;e++)if(!b.unprojectFromRenderScreen(Re[e],Ce[e]))return;L(b.eye,Ce[0],Ce[1],Oe),L(b.eye,Ce[1],Ce[2],Ve),L(b.eye,Ce[2],Ce[3],Fe),L(b.eye,Ce[3],Ce[0],Be);let C=Number.MAX_VALUE,O=0;for(const e of this._forEachTransformedLineSegment(he,ue,y,r,le(this.parameters,v))){if(A(Oe,he)<0&&A(Oe,ue)<0||A(Ve,he)<0&&A(Ve,ue)<0||A(Fe,he)<0&&A(Fe,ue)<0||A(Be,he)<0&&A(Be,ue)<0)continue;const t=b.projectToRenderScreen(he,ve),r=b.projectToRenderScreen(ue,ye);if(null==t||null==r)continue;if(t[2]<0&&r[2]>0){l(be,he,ue);const e=b.frustum,r=-A(e[4],he)/p(be,M(e[4]));if(c(be,be,r),m(he,he,be),!b.projectToRenderScreen(he,t))continue}else if(t[2]>0&&r[2]<0){l(be,ue,he);const e=b.frustum,t=-A(e[4],ue)/p(be,M(e[4]));if(c(be,be,t),m(ue,ue,be),!b.projectToRenderScreen(ue,r))continue}else if(t[2]<0&&r[2]<0)continue;t[2]=0,r[2]=0;const i=E(t,r,ze),s=x(i,z);if(!(s>=C)){if(this.parameters.screenSizePerspective){const e=this.computeScreenSizePerspectiveWidth(i,he,ue,z,b,P,T);if(s>=e*e)continue}C=s,h(xe,he),h(we,ue),O=e}}if(C<R*R){let e=Number.MAX_VALUE;if(w(E(xe,we,ze),E(S,_,je),Se)){l(Se,Se,S);const t=u(Se);c(Se,Se,1/t),e=t/f(S,_)}d(e,Se,O)}}intersectScreenPolygon(t,r,i,s){const{options:a,camera:n,screenPolygonPrimitiveProcessor:o}=i;if(!a.selectionMode||!t.visible)return null;if(!X(r))return e.getLogger("esri.views.3d.webgl-engine.materials.RibbonLineMaterial").error("intersection assumes a translation-only matrix"),null;const l=t.attributes,p=l.get("position").data,c=this._getLineSize(l),m=Ue,h=m*n.pixelRatio,u=new J;for(const e of this._forEachTransformedLineSegment(he,ue,p,r,le(this.parameters,l)))for(const[t,r]of o.processLineSegment(Ne,he,ue)){if(!D(n,t,r,ve,ye))continue;const i=E(ve,ye,ze);let a=c/2+m;this.parameters.screenSizePerspective&&(d(_e,ve,ye,.5),a=Math.max(a,this.computeScreenSizePerspectiveWidth(i,t,r,_e,n,c,h)/n.pixelRatio)),n.renderToScreen(ve,Pe),n.renderToScreen(ye,Ee),Y(s,Pe,Ee,a)&&(z(E(t,r,je),n.eye,fe),u.updateIfCloserFromValues(f(n.eye,fe),e,fe,null))}return u}createBufferWriter(){return new ne(Z(this.parameters),$(this.parameters),this.parameters)}createGLMaterial(e){return new se(e)}validateParameters(e){"miter"!==e.join&&(e.miterLimit=0),null!=e.markerParameters&&(e.markerScale=e.markerParameters.width/e.width)}update(e){return!!this.parameters.hasAnimation&&(this.setParameters({timeElapsed:s(e.time)},!1),0!==e.dt)}computeScreenSizePerspectiveWidth(e,t,r,i,s,a,n){const o=j(e,i);d(fe,t,r,o),g(de,fe,s.viewMatrix);const l=u(de),p=this.computeCameraAbsCosAngle(fe,s,this._configuration.spherical);me.update(p,l,this.parameters.screenSizePerspective,this.parameters.screenSizePerspectiveMinPixelReferenceSize);return me.apply(a)*s.pixelRatio/2+n}computeCameraAbsCosAngle(e,t,r){return r?b(Se,e):o(Se,0,0,1),l(ge,e,t.eye),b(ge,ge),Math.abs(p(Se,ge))}_getLineSize(e,r=!1){let i=this.parameters.width;if(this.parameters.vvSize){const s=e.get("sizeFeatureAttribute").data[0];Number.isNaN(s)?r&&(i*=this.parameters.vvSize.fallback[0]):i*=t(this.parameters.vvSize.offset[0]+s*this.parameters.vvSize.factor[0],this.parameters.vvSize.minSize[0],this.parameters.vvSize.maxSize[0])}else e.has("size")&&(i*=e.get("size").data[0]);return i}*_forEachTransformedLineSegment(e,t,r,i,s){const a=s?r.length-2:r.length-5;for(let n=0;n<a;n+=3){e[0]=r[n]+i[12],e[1]=r[n+1]+i[13],e[2]=r[n+2]+i[14];const s=(n+3)%r.length;t[0]=r[s]+i[12],t[1]=r[s+1]+i[13],t[2]=r[s+2]+i[14],yield n/3}}}class se extends k{constructor(){super(...arguments),this._stipplePattern=null}dispose(){super.dispose(),this._stippleTextures?.release(this._stipplePattern),this._stipplePattern=null}beginSlot(e){const{stipplePattern:t}=this._material.parameters;return this._stipplePattern!==t&&(this._material.setParameters({stippleTexture:this._stippleTextures.swap(t,this._stipplePattern)}),this._stipplePattern=t),this.getTechnique(ee,e)}}class ae extends K{constructor(){super(...arguments),this._width=0,this.color=v,this.join="miter",this.cap=0,this.miterLimit=5,this.writeDepth=!0,this.polygonOffset=0,this.polygonOffsetIndex=0,this.stippleTexture=null,this.stipplePreferContinuous=!0,this.markerParameters=null,this.markerScale=1,this.hasSlicePlane=!1,this.vvFastUpdate=!1,this.isClosed=!1,this.falloff=0,this.innerWidth=0,this.wireframe=!1,this.timeElapsed=a(0),this.animation=0,this.animationSpeed=1,this.trailLength=1,this.startTime=a(0),this.endTime=a(1/0),this.emissiveStrength=0}get width(){return this.isImagePattern()?this.stipplePattern.width:this._width}set width(e){this._width=e}get transparent(){return this.color[3]<1||this.hasAnimation||null!=this.stipplePattern&&(this.stippleOffColor?.[3]??0)<1}get hasAnimation(){return 0!==this.animation}isImagePattern(){return H(this.stipplePattern)&&null!=this.stippleTexture}}class ne{constructor(e,t,r){this.layout=e,this.textureBufferLayout=t,this._parameters=r,this.numJoinSubdivisions=ce(this._parameters.join,null!=this._parameters.stipplePattern)}_isClosed(e){return le(this._parameters,e)}allocate(e){return this.layout.createBuffer(e)}elementCountTextureBuffer(e){return e.get("position").data.length/3+2}elementCount(e){const t=2,r=e.get("position").indices.length/2+1,i=this._isClosed(e);let s=i?2:2*t;return s+=((i?r:r-1)-(i?0:1))*(2*this.numJoinSubdivisions+4),s+=2,this._parameters.wireframe&&(s=2+4*(s-2)),s}write(e,t,r,i,s,a){const{buffer:n,offset:l}=s,{layout:p,textureBufferLayout:c}=this,m=r.get("position"),u=m.indices,d=m.data.length/3,b=d+2,S=r.get("distanceToStart")?.data;u&&u.length!==2*(d-1)&&console.warn("RibbonLineMaterial does not support indices");const v=n.getField("textureElementIndex",C);G(null!=v,"Missing texture buffer index field"),G(null!==a,"Expected texture buffer target"),G(null!==c,"Expected valid textureBufferLayout");const{textureBufferRange:y,offset:E}=a;G(null!=y,"Using a texture layout, but the texture range for this instance was not provided");const x=y.from;G(y.numElements===b,"Expected number of elements in TextureBuffer to equal number of points");const{buffer:w}=a,z=w.getField("position",O);G(null!==z,"Expected valid position field in texture buffer");const j=p.fields.has("sizeFeatureAttribute");let T=1,L=null;if(j){const e=r.get("sizeFeatureAttribute");1===e.data.length?T=e.data[0]:L=e.data}else T=r.get("size")?.data[0]??1;let A=[1,1,1,1],M=0,R=null;const V=p.fields.has("colorFeatureAttribute");if(V){const e=r.get("colorFeatureAttribute");1===e.data.length?M=e.data[0]:R=e.data}else A=r.get("color")?.data??A;const F=r.get("timeStamps")?.data,B=F&&p.fields.has("timeStamps"),U=p.fields.has("opacityFeatureAttribute");let N=0,k=null;if(U){const e=r.get("opacityFeatureAttribute");1===e.data.length?N=e.data[0]:k=e.data}const W=new Float32Array(n.buffer),D=P(n.buffer),Y=new Uint8Array(n.buffer),J=new Uint32Array(n.buffer),q=p.stride/4;let X=l*q;const H=X;let K=0;const Q=W.BYTES_PER_ELEMENT/D.BYTES_PER_ELEMENT,Z=I(),$=this._isClosed(r),ee=(t,r)=>{const i=3*r;o(t,m.data[i+0],m.data[i+1],m.data[i+2]),e&&g(t,t,e)};for(let o=0;o<d;++o)ee(Le,o),z.setVec(E+o+1,Le);$?(w.copyItem(E+b-2,E+0),w.copyItem(E+1,E+b-1)):(w.copyItem(E+1,E+0),w.copyItem(E+b-2,E+b-1));const te=(e,t,r,s,a,n,o,l)=>{const p=o+1;J[X]=x+p,X++,W[X++]=l;let c=X*Q;if(D[c++]=a,D[c++]=n,X=Math.ceil(c/Q),V)W[X]=R?.[o]??M;else{const e=Math.min(4*o,A.length-4),t=4*X;Y[t]=255*A[e],Y[t+1]=255*A[e+1],Y[t+2]=255*A[e+2],Y[t+3]=255*A[e+3]}if(X++,W[X++]=L?.[o]??T,U&&(W[X++]=k?.[o]??N),Z){let e=4*X;i?(Y[e++]=i[0],Y[e++]=i[1],Y[e++]=i[2],Y[e++]=i[3]):(Y[e++]=0,Y[e++]=0,Y[e++]=0,Y[e++]=0),X=Math.ceil(.25*e)}B&&(c=X*Q,D[c++]=s[0],D[c++]=s[1],D[c++]=s[2],D[c++]=s[3],X=Math.ceil(c/Q))},re=()=>{h(Te,Le),h(Le,Ae)},ie=e=>{if(B){const t=4*e;_(Me,F[t+0],F[t+1],F[t+2],F[t+3])}},se=(e,t,r)=>{null!=S?K=S[r]:K+=f(e,t)};X+=q,ee(Le,0),ie(0);let ae=0,ne=0;$?(ee(Te,d-1),ae=0,ne=d):(ee(Ae,1),te(Le,Le,Ae,Me,1,-4,0,0),te(Le,Le,Ae,Me,1,4,0,0),re(),ie(1),ae=1,ne=d-1);for(let o=ae;o<ne;o++){ee(Ae,(o+1)%d),se(Te,Le,o),te(Te,Le,Ae,Me,0,-1,o,K),te(Te,Le,Ae,Me,0,1,o,K);const e=this.numJoinSubdivisions;for(let t=0;t<e;++t){const r=(t+1)/(e+1);te(Te,Le,Ae,Me,r,-1,o,K),te(Te,Le,Ae,Me,r,1,o,K)}te(Te,Le,Ae,Me,1,-2,o,K),te(Te,Le,Ae,Me,1,2,o,K),re(),ie((o+1)%d)}se(Te,Le,ne),$?(ee(Ae,1),te(Te,Le,Ae,Me,0,-1,ae,K),te(Te,Le,Ae,Me,0,1,ae,K)):(te(Te,Le,Le,Me,0,-5,ne,K),te(Te,Le,Le,Me,0,5,ne,K)),oe(W,H+q,W,H,q);X=oe(W,X-q,W,X,q),this._parameters.wireframe&&this._addWireframeVertices(n,H,X,q)}_addWireframeVertices(e,t,r,i){const s=new Uint8Array(e.buffer,r*Float32Array.BYTES_PER_ELEMENT),a=new Uint8Array(e.buffer,t*Float32Array.BYTES_PER_ELEMENT,(r-t)*Float32Array.BYTES_PER_ELEMENT),n=i*Float32Array.BYTES_PER_ELEMENT;let o=0;const l=e=>o=oe(a,e,s,o,n);for(let p=0;p<=a.length-4*n;p+=2*n)l(p),l(p+2*n),l(p+1*n),l(p+2*n),l(p+1*n),l(p+3*n)}}function oe(e,t,r,i,s){for(let a=0;a<s;a++)r[i++]=e[t++];return i}function le(e,t){if(!e.isClosed)return!1;return t.get("position").indices.length>2}function pe(e){return 1===e.anchor&&e.hideOnShortSegments&&"begin-end"===e.placement&&e.worldSpace}function ce(e,t){const r=t?1:0;switch(e){case"miter":case"bevel":return r;case"round":return Q+r}}const me=new q,he=S(),ue=S(),fe=S(),de=S(),ge=S(),be=S(),Se=S(),_e=S(),ve=r(),ye=r(),Pe=i(),Ee=i(),xe=S(),we=S(),ze=T(),je=T(),Te=S(),Le=S(),Ae=S(),Me=y(),Re=[r(),r(),r(),r()],Ce=[S(),S(),S(),S()],Oe=R(),Ve=R(),Fe=R(),Be=R(),Ue=4,Ne=[S(),S()];export{ae as Parameters,ie as RibbonLineMaterial};
2
+ import e from"../../../../core/Logger.js";import{clamp as t}from"../../../../core/mathUtils.js";import{createRenderScreenPointArray3 as i,createScreenPointArray as r}from"../../../../core/screenUtils.js";import{secondsFromMilliseconds as s,Seconds as a}from"../../../../core/time.js";import{copy as n}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{set as o,subtract as l,dot as p,scale as m,add as c,copy as h,length as u,distance as f,lerp as d,transformMat4 as g,normalize as _}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as b}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{set as S}from"../../../../core/libs/gl-matrix-2/math/vec4.js";import{ONES as P,create as v}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{makeFloat16Array as y}from"../../../../geometry/support/float16.js";import{fromPoints as w,distance2 as E,closestLineSegmentPoint as T,projectPoint as x,projectPointFraction as z,create as j}from"../../../../geometry/support/lineSegment.js";import{fromPoints as L,signedDistance as A,getNormal as M,create as C}from"../../../../geometry/support/plane.js";import{BufferViewVec3f as R,BufferViewUint32 as O}from"../../../../geometry/support/buffer/BufferView.js";import{isHighlightOrOLID as V,isColor as F,isDepth as B,isColorHighlightOLIDOrDepth as U,is2DGeometryOutput as N}from"../core/shaderLibrary/ShaderOutput.js";import{olidEnabled as I}from"../effects/geometry/olidUtils.js";import k from"../lib/GLMaterial.js";import{Material as W}from"../lib/Material.js";import{projectWorldLineSegmentToRenderScreen as D,screenPolygonIntersectsBufferedSegment as Y}from"../lib/screenPolygonOverlapUtils.js";import{Hit as J}from"../lib/screenPolygonTriangleIntersections.js";import{ScreenSizePerspectiveEvaluator as q}from"../lib/screenSizePerspectiveUtils.js";import{isTranslationMatrix as X,assert as G}from"../lib/Util.js";import{isImagePattern as H}from"./lineStippleUtils.js";import{VisualVariablePassParameters as K}from"./VisualVariablePassParameters.js";import{r as Q}from"../../../../chunks/RibbonLine.glsl.js";import{getLayout as Z,getTextureBufferLayout as $}from"../shaders/RibbonLineLayouts.js";import{RibbonLineTechnique as ee}from"../shaders/RibbonLineTechnique.js";import{RibbonLineTechniqueConfiguration as te}from"../shaders/RibbonLineTechniqueConfiguration.js";import{alphaCutoff as ie}from"../../../../webscene/support/AlphaCutoff.js";class re extends W{constructor(e,t){super(e,ae),this.produces=new Map([[2,e=>V(e)||F(e)&&8===this.parameters.renderOccluded],[3,e=>B(e)],[10,e=>U(e)&&8===this.parameters.renderOccluded],[11,e=>U(e)&&8===this.parameters.renderOccluded],[4,e=>F(e)&&this.parameters.writeDepth&&8!==this.parameters.renderOccluded],[8,e=>F(e)&&!this.parameters.writeDepth&&8!==this.parameters.renderOccluded],[18,e=>N(e)]]),this._configuration=new te(t)}updateConfiguration(e){super.updateConfiguration(e);const t=18===e.slot,i=null!=this.parameters.stipplePattern&&null!=this.parameters.stippleTexture&&10!==e.output,r=i&&t&&this.parameters.isImagePattern();this._configuration.draped=t,this._configuration.polygonOffset=this.parameters.polygonOffset,this._configuration.stippleEnabled=i,this._configuration.stippleOffColorEnabled=i&&null!=this.parameters.stippleOffColor,this._configuration.stipplePreferContinuous=i&&this.parameters.stipplePreferContinuous,this._configuration.numJoinSubdivisions=me(this.parameters.join,i),this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.roundJoins="round"===this.parameters.join,this._configuration.capType=this.parameters.cap,this._configuration.applyMarkerOffset=null!=this.parameters.markerParameters&&pe(this.parameters.markerParameters),this._configuration.polygonOffsetIndex=this.parameters.polygonOffsetIndex,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.hasVVSize=this.parameters.hasVVSize,this._configuration.hasVVColor=this.parameters.hasVVColor,this._configuration.hasVVOpacity=this.parameters.hasVVOpacity,this._configuration.innerColorEnabled=this.parameters.innerWidth>0&&null!=this.parameters.innerColor,this._configuration.falloffEnabled=this.parameters.falloff>0,this._configuration.hasOccludees=e.hasOccludees,this._configuration.occluder=8===this.parameters.renderOccluded,this._configuration.wireframe=this.parameters.wireframe,this._configuration.animation=this.parameters.animation,this._configuration.emissionSource=this.emissions?1:0,this._configuration.hasScreenSizePerspective=!!this.parameters.screenSizePerspective&&!r,this._configuration.worldSizedImagePattern=r}get visible(){return this.parameters.color[3]>=ie||null!=this.parameters.stipplePattern&&(this.parameters.stippleOffColor?.[3]??0)>ie}get emissions(){return this.parameters.emissiveStrength>0?8!==this.parameters.renderOccluded?2:1:0}setParameters(e,t){e.animation=this.parameters.animation,super.setParameters(e,t)}intersectRayDraped({attributes:e,screenToWorldRatio:i},r,s,a,n){if(!r.options.selectionMode)return;const o=e.get("size");let l=this.parameters.width;if(this.parameters.vvSize){const i=e.get("sizeFeatureAttribute").data[0];Number.isNaN(i)?l*=this.parameters.vvSize.fallback[0]:l*=t(this.parameters.vvSize.offset[0]+i*this.parameters.vvSize.factor[0],this.parameters.vvSize.minSize[0],this.parameters.vvSize.maxSize[0])}else o&&(l*=o.data[0]);const p=s[0],m=s[1],c=(l/2+Ue)*i;let h=Number.MAX_VALUE,u=0;const f=e.get("position").data,d=le(this.parameters,e)?f.length-2:f.length-5;for(let g=0;g<d;g+=3){const e=f[g],i=f[g+1],r=(g+3)%f.length,s=p-e,a=m-i,n=f[r]-e,o=f[r+1]-i,l=t((n*s+o*a)/(n*n+o*o),0,1),c=n*l-s,d=o*l-a,_=c*c+d*d;_<h&&(h=_,u=g/3)}h<c*c&&a(n.distance,n.normal,u)}intersectRay(t,i,r,s,a,d){const{options:g,camera:_,rayBegin:b,rayEnd:S}=r;if(!g.selectionMode||!t.visible||!_)return;if(!X(i))return void e.getLogger("esri.views.3d.webgl-engine.materials.RibbonLineMaterial").error("intersection assumes a translation-only matrix");const P=t.attributes,v=P.get("position").data,y=this._getLineSize(P),x=Se;n(x,r.point);const z=y*_.pixelRatio,j=Ue*_.pixelRatio,C=z/2+j;o(Ce[0],x[0]-C,x[1]+C,0),o(Ce[1],x[0]+C,x[1]+C,0),o(Ce[2],x[0]+C,x[1]-C,0),o(Ce[3],x[0]-C,x[1]-C,0);for(let e=0;e<4;e++)if(!_.unprojectFromRenderScreen(Ce[e],Re[e]))return;L(_.eye,Re[0],Re[1],Oe),L(_.eye,Re[1],Re[2],Ve),L(_.eye,Re[2],Re[3],Fe),L(_.eye,Re[3],Re[0],Be);let R=Number.MAX_VALUE,O=0;for(const e of this._forEachTransformedLineSegment(he,ue,v,i,le(this.parameters,P))){if(A(Oe,he)<0&&A(Oe,ue)<0||A(Ve,he)<0&&A(Ve,ue)<0||A(Fe,he)<0&&A(Fe,ue)<0||A(Be,he)<0&&A(Be,ue)<0)continue;const t=_.projectToRenderScreen(he,Pe),i=_.projectToRenderScreen(ue,ve);if(null==t||null==i)continue;if(t[2]<0&&i[2]>0){l(_e,he,ue);const e=_.frustum,i=-A(e[4],he)/p(_e,M(e[4]));if(m(_e,_e,i),c(he,he,_e),!_.projectToRenderScreen(he,t))continue}else if(t[2]>0&&i[2]<0){l(_e,ue,he);const e=_.frustum,t=-A(e[4],ue)/p(_e,M(e[4]));if(m(_e,_e,t),c(ue,ue,_e),!_.projectToRenderScreen(ue,i))continue}else if(t[2]<0&&i[2]<0)continue;t[2]=0,i[2]=0;const r=w(t,i,xe),s=E(r,x);if(!(s>=R)){if(this.parameters.screenSizePerspective){const e=this.computeScreenSizePerspectiveWidth(r,he,ue,x,_,y,j);if(s>=e*e)continue}R=s,h(Ee,he),h(Te,ue),O=e}}if(R<C*C){let e=Number.MAX_VALUE;if(T(w(Ee,Te,xe),w(b,S,ze),be)){l(be,be,b);const t=u(be);m(be,be,1/t),e=t/f(b,S)}d(e,be,O)}}intersectScreenPolygon(t,i,r,s){const{options:a,camera:n,screenPolygonPrimitiveProcessor:o}=r;if(!a.selectionMode||!t.visible)return null;if(!X(i))return e.getLogger("esri.views.3d.webgl-engine.materials.RibbonLineMaterial").error("intersection assumes a translation-only matrix"),null;const l=t.attributes,p=l.get("position").data,m=this._getLineSize(l),c=Ue,h=c*n.pixelRatio,u=new J(4);for(const e of this._forEachTransformedLineSegment(he,ue,p,i,le(this.parameters,l)))for(const[t,i]of o.processLineSegment(Ne,he,ue)){if(!D(n,t,i,Pe,ve))continue;const r=w(Pe,ve,xe);let a=m/2+c;this.parameters.screenSizePerspective&&(d(Se,Pe,ve,.5),a=Math.max(a,this.computeScreenSizePerspectiveWidth(r,t,i,Se,n,m,h)/n.pixelRatio)),n.renderToScreen(Pe,ye),n.renderToScreen(ve,we),Y(s,ye,we,a)&&(x(w(t,i,ze),n.eye,fe),u.updateIfCloserFromValues(f(n.eye,fe),e,fe,null))}return u}createBufferWriter(){return new ne(Z(this.parameters),$(this.parameters),this.parameters)}createGLMaterial(e){return new se(e)}validateParameters(e){"miter"!==e.join&&(e.miterLimit=0),null!=e.markerParameters&&(e.markerScale=e.markerParameters.width/e.width)}update(e){return!!this.parameters.hasAnimation&&(this.setParameters({timeElapsed:s(e.time)},!1),0!==e.dt)}computeScreenSizePerspectiveWidth(e,t,i,r,s,a,n){const o=z(e,r);d(fe,t,i,o),g(de,fe,s.viewMatrix);const l=u(de),p=this.computeCameraAbsCosAngle(fe,s,this._configuration.spherical);ce.update(p,l,this.parameters.screenSizePerspective,this.parameters.screenSizePerspectiveMinPixelReferenceSize);return ce.apply(a)*s.pixelRatio/2+n}computeCameraAbsCosAngle(e,t,i){return i?_(be,e):o(be,0,0,1),l(ge,e,t.eye),_(ge,ge),Math.abs(p(be,ge))}_getLineSize(e,i=!1){let r=this.parameters.width;if(this.parameters.vvSize){const s=e.get("sizeFeatureAttribute").data[0];Number.isNaN(s)?i&&(r*=this.parameters.vvSize.fallback[0]):r*=t(this.parameters.vvSize.offset[0]+s*this.parameters.vvSize.factor[0],this.parameters.vvSize.minSize[0],this.parameters.vvSize.maxSize[0])}else e.has("size")&&(r*=e.get("size").data[0]);return r}*_forEachTransformedLineSegment(e,t,i,r,s){const a=s?i.length-2:i.length-5;for(let n=0;n<a;n+=3){e[0]=i[n]+r[12],e[1]=i[n+1]+r[13],e[2]=i[n+2]+r[14];const s=(n+3)%i.length;t[0]=i[s]+r[12],t[1]=i[s+1]+r[13],t[2]=i[s+2]+r[14],yield n/3}}}class se extends k{constructor(){super(...arguments),this._stipplePattern=null}dispose(){super.dispose(),this._stippleTextures?.release(this._stipplePattern),this._stipplePattern=null}beginSlot(e){const{stipplePattern:t}=this._material.parameters;return this._stipplePattern!==t&&(this._material.setParameters({stippleTexture:this._stippleTextures.swap(t,this._stipplePattern)}),this._stipplePattern=t),this.getTechnique(ee,e)}}class ae extends K{constructor(){super(...arguments),this._width=0,this.color=P,this.join="miter",this.cap=0,this.miterLimit=5,this.writeDepth=!0,this.polygonOffset=0,this.polygonOffsetIndex=0,this.stippleTexture=null,this.stipplePreferContinuous=!0,this.markerParameters=null,this.markerScale=1,this.hasSlicePlane=!1,this.vvFastUpdate=!1,this.isClosed=!1,this.falloff=0,this.innerWidth=0,this.wireframe=!1,this.timeElapsed=a(0),this.animation=0,this.animationSpeed=1,this.trailLength=1,this.startTime=a(0),this.endTime=a(1/0),this.emissiveStrength=0}get width(){return this.isImagePattern()?this.stipplePattern.width:this._width}set width(e){this._width=e}get transparent(){return this.color[3]<1||this.hasAnimation||null!=this.stipplePattern&&(this.stippleOffColor?.[3]??0)<1}get hasAnimation(){return 0!==this.animation}isImagePattern(){return H(this.stipplePattern)&&null!=this.stippleTexture}}class ne{constructor(e,t,i){this.layout=e,this.textureBufferLayout=t,this._parameters=i,this.numJoinSubdivisions=me(this._parameters.join,null!=this._parameters.stipplePattern)}_isClosed(e){return le(this._parameters,e)}allocate(e){return this.layout.createBuffer(e)}elementCountTextureBuffer(e){return e.get("position").data.length/3+2}elementCount(e){const t=2,i=e.get("position").indices.length/2+1,r=this._isClosed(e);let s=r?2:2*t;return s+=((r?i:i-1)-(r?0:1))*(2*this.numJoinSubdivisions+4),s+=2,this._parameters.wireframe&&(s=2+4*(s-2)),s}write(e,t,i,r,s,a,n){null!=n&&this._writeTextureBuffer(e,i,n),null!=s&&this._writeVertexBuffer(e,i,r,s,a)}_writeTextureBuffer(e,t,i){const r=t.get("position"),s=r.data.length/3,a=s+2,n=this._isClosed(t),{buffer:o,offset:l}=i,p=o.getField("position",R);G(null!==p,"Expected valid position field in texture buffer");for(let m=0;m<s;++m)this._getTransformedPosition(Le,r.data,m,e),p.setVec(l+m+1,Le);n?(o.copyItem(l+a-2,l+0),o.copyItem(l+1,l+a-1)):(o.copyItem(l+1,l+0),o.copyItem(l+a-2,l+a-1))}_writeVertexBuffer(e,t,i,r,s){const{buffer:a,offset:n}=r,{layout:o}=this,l=t.get("position"),p=l.indices,m=l.data.length/3,c=m+2,u=t.get("distanceToStart")?.data;p&&p.length!==2*(m-1)&&console.warn("RibbonLineMaterial does not support indices");const d=a.getField("textureElementIndex",O);G(null!=d,"Missing texture buffer index field"),G(null!=s,"Using a texture layout, but the texture range for this instance was not provided");const g=s.from;G(s.numElements===c,"Expected number of elements in TextureBuffer to equal number of points");const _=o.fields.has("sizeFeatureAttribute");let b=1,P=null;if(_){const e=t.get("sizeFeatureAttribute");1===e.data.length?b=e.data[0]:P=e.data}else b=t.get("size")?.data[0]??1;let v=[1,1,1,1],w=0,E=null;const T=o.fields.has("colorFeatureAttribute");if(T){const e=t.get("colorFeatureAttribute");1===e.data.length?w=e.data[0]:E=e.data}else v=t.get("color")?.data??v;const x=t.get("timeStamps")?.data,z=x&&o.fields.has("timeStamps"),j=o.fields.has("opacityFeatureAttribute");let L=0,A=null;if(j){const e=t.get("opacityFeatureAttribute");1===e.data.length?L=e.data[0]:A=e.data}const M=new Float32Array(a.buffer),C=y(a.buffer),R=new Uint8Array(a.buffer),V=new Uint32Array(a.buffer),F=o.stride/4;let B=n*F;const U=B;let N=0;const k=M.BYTES_PER_ELEMENT/C.BYTES_PER_ELEMENT,W=I(),D=this._isClosed(t),Y=(e,t,r,s,a,n,o,l)=>{const p=o+1;V[B]=g+p,B++,M[B++]=l;let m=B*k;if(C[m++]=a,C[m++]=n,B=Math.ceil(m/k),T)M[B]=E?.[o]??w;else{const e=Math.min(4*o,v.length-4),t=4*B;R[t]=255*v[e],R[t+1]=255*v[e+1],R[t+2]=255*v[e+2],R[t+3]=255*v[e+3]}if(B++,M[B++]=P?.[o]??b,j&&(M[B++]=A?.[o]??L),W){let e=4*B;i?(R[e++]=i[0],R[e++]=i[1],R[e++]=i[2],R[e++]=i[3]):(R[e++]=0,R[e++]=0,R[e++]=0,R[e++]=0),B=Math.ceil(.25*e)}z&&(m=B*k,C[m++]=s[0],C[m++]=s[1],C[m++]=s[2],C[m++]=s[3],B=Math.ceil(m/k))},J=()=>{h(je,Le),h(Le,Ae)},q=e=>{if(z){const t=4*e;S(Me,x[t+0],x[t+1],x[t+2],x[t+3])}},X=(e,t,i)=>{null!=u?N=u[i]:N+=f(e,t)};B+=F,this._getTransformedPosition(Le,l.data,0,e),q(0);let H=0,K=0;D?(this._getTransformedPosition(je,l.data,m-1,e),H=0,K=m):(this._getTransformedPosition(Ae,l.data,1,e),Y(Le,Le,Ae,Me,1,-4,0,0),Y(Le,Le,Ae,Me,1,4,0,0),J(),q(1),H=1,K=m-1);for(let h=H;h<K;h++){this._getTransformedPosition(Ae,l.data,(h+1)%m,e),X(je,Le,h),Y(je,Le,Ae,Me,0,-1,h,N),Y(je,Le,Ae,Me,0,1,h,N);const t=this.numJoinSubdivisions;for(let e=0;e<t;++e){const i=(e+1)/(t+1);Y(je,Le,Ae,Me,i,-1,h,N),Y(je,Le,Ae,Me,i,1,h,N)}Y(je,Le,Ae,Me,1,-2,h,N),Y(je,Le,Ae,Me,1,2,h,N),J(),q((h+1)%m)}X(je,Le,K),D?(this._getTransformedPosition(Ae,l.data,1,e),Y(je,Le,Ae,Me,0,-1,H,N),Y(je,Le,Ae,Me,0,1,H,N)):(Y(je,Le,Le,Me,0,-5,K,N),Y(je,Le,Le,Me,0,5,K,N)),oe(M,U+F,M,U,F);B=oe(M,B-F,M,B,F),this._parameters.wireframe&&this._addWireframeVertices(a,U,B,F)}_getTransformedPosition(e,t,i,r){const s=3*i;o(e,t[s+0],t[s+1],t[s+2]),r&&g(e,e,r)}_addWireframeVertices(e,t,i,r){const s=new Uint8Array(e.buffer,i*Float32Array.BYTES_PER_ELEMENT),a=new Uint8Array(e.buffer,t*Float32Array.BYTES_PER_ELEMENT,(i-t)*Float32Array.BYTES_PER_ELEMENT),n=r*Float32Array.BYTES_PER_ELEMENT;let o=0;const l=e=>o=oe(a,e,s,o,n);for(let p=0;p<=a.length-4*n;p+=2*n)l(p),l(p+2*n),l(p+1*n),l(p+2*n),l(p+1*n),l(p+3*n)}}function oe(e,t,i,r,s){for(let a=0;a<s;a++)i[r++]=e[t++];return r}function le(e,t){if(!e.isClosed)return!1;return t.get("position").indices.length>2}function pe(e){return 1===e.anchor&&e.hideOnShortSegments&&"begin-end"===e.placement&&e.worldSpace}function me(e,t){const i=t?1:0;switch(e){case"miter":case"bevel":return i;case"round":return Q+i}}const ce=new q,he=b(),ue=b(),fe=b(),de=b(),ge=b(),_e=b(),be=b(),Se=b(),Pe=i(),ve=i(),ye=r(),we=r(),Ee=b(),Te=b(),xe=j(),ze=j(),je=b(),Le=b(),Ae=b(),Me=v(),Ce=[i(),i(),i(),i()],Re=[b(),b(),b(),b()],Oe=C(),Ve=C(),Fe=C(),Be=C(),Ue=4,Ne=[b(),b()];export{ae as Parameters,re as RibbonLineMaterial};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{set as e,scale as t,add as r,normalize as s}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{fromValues as i,create as a}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as n}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{center as o,scale as c}from"../../../../geometry/support/aaBoundingBox.js";import{BufferViewVec3f as p}from"../../../../geometry/support/buffer/BufferView.js";import{isColorOrOLID as h}from"../core/shaderLibrary/ShaderOutput.js";import l from"../lib/GLMaterial.js";import{Material as m,MaterialParameters as f}from"../lib/Material.js";import{intersectTriangleGeometry as u}from"../lib/RayIntersections.js";import{intersectTriangleGeometryScreenPolygon as g}from"../lib/screenPolygonTriangleIntersections.js";import{assert as d}from"../lib/Util.js";import{applyPolygonOffsetToHit as b,intersectWithPolygonOffset as _}from"./intersectWithPolygonOffset.js";import{writeAttributes as S,writePosition as y}from"./internal/bufferWriterUtils.js";import{getLayout as j,ShadedColorMaterialTechnique as x}from"../shaders/ShadedColorMaterialTechnique.js";import{ShadedColorMaterialTechniqueConfiguration as w}from"../shaders/ShadedColorMaterialTechniqueConfiguration.js";import{alphaCutoff as z}from"../../../../webscene/support/AlphaCutoff.js";class D extends m{constructor(e){super(e,E),this._configuration=new w,this.supportsEdges=!0,this._pp0=i(0,0,1),this._pp1=i(0,0,0),this.produces=new Map([[2,e=>10===e||h(e)&&!this.parameters.transparent],[4,e=>h(e)&&this.parameters.transparent&&this.parameters.writeDepth],[8,e=>h(e)&&this.parameters.transparent&&!this.parameters.writeDepth]])}updateConfiguration(e){super.updateConfiguration(e),this._configuration.cullFace=this.parameters.cullFace,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.transparent=this.parameters.transparent,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.screenSizeEnabled=this.parameters.screenSizeEnabled,this._configuration.shadingEnabled=this.parameters.shadingEnabled}get visible(){return this.parameters.color[3]>=z}intersectRay(e,t,r,s,i,a){this._intersectRay(e,r,s,i,a)}intersectRayDraped(e,t,r,s){return this._pp0[0]=this._pp1[0]=r[0],this._pp0[1]=this._pp1[1]=r[1],this._intersectRay(e,t,this._pp0,this._pp1,s)}intersectScreenPolygon(e,t,r,s){return b(g(e,r,t,s,this._createVertexDisplacement(e,r)),this._configuration,r.camera.eye)}_intersectRay(e,t,r,s,i){const a=_(i,this._configuration,r,s);u(e,t,r,s,this._createVertexDisplacement(e,t),a)}_createVertexDisplacement(s,i){if(!this.parameters.screenSizeEnabled)return;const a=s.attributes.get("offset").data;return{applyToVertex:(s,n,o,c,p)=>{const h=e(P,a[3*p],a[3*p+1],a[3*p+2]);e(s,n,o,c);const l=this.parameters.screenSizeScale*(i.camera?.computeScreenPixelSizeAt(h)??1);return t(h,h,l),r(s,s,h),s},applyToAabb:e=>{const t=o(e,P);return c(e,this.parameters.screenSizeScale*(i.camera?.computeScreenPixelSizeAt(t)??1))}}}createGLMaterial(e){return new T(e)}createBufferWriter(){return new M(j(this.parameters))}}class T extends l{beginSlot(e){return this.getTechnique(x,e)}}class E extends f{constructor(){super(...arguments),this.color=n(1,1,1,1),this.shadingTint=n(0,0,0,.25),this.shadingDirection=s(a(),[.5,-.5,-.5]),this.screenSizeScale=14,this.forceTransparentMode=!1,this.writeDepth=!0,this.hasSlicePlane=!1,this.cullFace=0,this.screenSizeEnabled=!1,this.shadingEnabled=!0}get transparent(){return this.color[3]<1||this.forceTransparentMode}}class M{constructor(e){this.layout=e}elementCount(e){return e.get("position").indices.length}write(e,t,r,s,i){const{buffer:a,offset:n}=i;S(r,s,this.layout,e,t,i);const o=a.getField("offset",p);if(o&&r.has("offset")){const e=r.get("offset");d(3===e.size),y(e,t,o,n)}}}const P=a();export{E as Parameters,D as ShadedColorMaterial};
2
+ import{set as e,scale as t,add as r,normalize as s}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{fromValues as i,create as a}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as n}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{center as o,scale as c}from"../../../../geometry/support/aaBoundingBox.js";import{BufferViewVec3f as p}from"../../../../geometry/support/buffer/BufferView.js";import{isColorOrOLID as h}from"../core/shaderLibrary/ShaderOutput.js";import l from"../lib/GLMaterial.js";import{Material as m,MaterialParameters as f}from"../lib/Material.js";import{intersectTriangleGeometry as u}from"../lib/RayIntersections.js";import{intersectTriangleGeometryScreenPolygon as g}from"../lib/screenPolygonTriangleIntersections.js";import{assert as d}from"../lib/Util.js";import{applyPolygonOffsetToHit as b,intersectWithPolygonOffset as _}from"./intersectWithPolygonOffset.js";import{writeAttributes as S,writePosition as y}from"./internal/bufferWriterUtils.js";import{getLayout as j,ShadedColorMaterialTechnique as x}from"../shaders/ShadedColorMaterialTechnique.js";import{ShadedColorMaterialTechniqueConfiguration as w}from"../shaders/ShadedColorMaterialTechniqueConfiguration.js";import{alphaCutoff as z}from"../../../../webscene/support/AlphaCutoff.js";class D extends m{constructor(e){super(e,E),this._configuration=new w,this.supportsEdges=!0,this._pp0=i(0,0,1),this._pp1=i(0,0,0),this.produces=new Map([[2,e=>10===e||h(e)&&!this.parameters.transparent],[4,e=>h(e)&&this.parameters.transparent&&this.parameters.writeDepth],[8,e=>h(e)&&this.parameters.transparent&&!this.parameters.writeDepth]])}updateConfiguration(e){super.updateConfiguration(e),this._configuration.cullFace=this.parameters.cullFace,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.transparent=this.parameters.transparent,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.screenSizeEnabled=this.parameters.screenSizeEnabled,this._configuration.shadingEnabled=this.parameters.shadingEnabled}get visible(){return this.parameters.color[3]>=z}intersectRay(e,t,r,s,i,a){this._intersectRay(e,r,s,i,a)}intersectRayDraped(e,t,r,s){return this._pp0[0]=this._pp1[0]=r[0],this._pp0[1]=this._pp1[1]=r[1],this._intersectRay(e,t,this._pp0,this._pp1,s)}intersectScreenPolygon(e,t,r,s){return b(g(e,r,t,s,this._createVertexDisplacement(e,r)),this._configuration,r.camera.eye)}_intersectRay(e,t,r,s,i){const a=_(i,this._configuration,r,s);u(e,t,r,s,this._createVertexDisplacement(e,t),a)}_createVertexDisplacement(s,i){if(!this.parameters.screenSizeEnabled)return;const a=s.attributes.get("offset").data;return{applyToVertex:(s,n,o,c,p)=>{const h=e(P,a[3*p],a[3*p+1],a[3*p+2]);e(s,n,o,c);const l=this.parameters.screenSizeScale*(i.camera?.computeScreenPixelSizeAt(h)??1);return t(h,h,l),r(s,s,h),s},applyToAabb:e=>{const t=o(e,P);return c(e,this.parameters.screenSizeScale*(i.camera?.computeScreenPixelSizeAt(t)??1))}}}createGLMaterial(e){return new T(e)}createBufferWriter(){return new M(j(this.parameters))}}class T extends l{beginSlot(e){return this.getTechnique(x,e)}}class E extends f{constructor(){super(...arguments),this.color=n(1,1,1,1),this.shadingTint=n(0,0,0,.25),this.shadingDirection=s(a(),[.5,-.5,-.5]),this.screenSizeScale=14,this.forceTransparentMode=!1,this.writeDepth=!0,this.hasSlicePlane=!1,this.cullFace=0,this.screenSizeEnabled=!1,this.shadingEnabled=!0}get transparent(){return this.color[3]<1||this.forceTransparentMode}}class M{constructor(e){this.layout=e}elementCount(e){return e.get("position").indices.length}write(e,t,r,s,i){if(null==i)return;const{buffer:a,offset:n}=i;S(r,s,this.layout,e,t,i);const o=a.getField("offset",p);if(o&&r.has("offset")){const e=r.get("offset");d(3===e.size),y(e,t,o,n)}}}const P=a();export{E as Parameters,D as ShadedColorMaterial};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{removeUnordered as o}from"../../../../../core/arrayUtils.js";import t from"../../../../../core/ObjectPool.js";class r{constructor(o=0,t=0){this.from=o,this.to=t}get numElements(){return this.to-this.from}}function e(t,r=s){if(t.length<2)return;const e=new Map;for(const o of t)e.set(o.from,o);let n=!0;for(;n;){n=!1;for(const s of t){const f=e.get(s.to);f&&(s.to=f.to,e.delete(f.from),o(t,f),n=!0,r.release(f))}}}const s=new t(()=>new r,(o,t=0,r=0)=>{o.from=t,o.to=r},()=>{});export{r as BufferRange,s as bufferRangePool,e as mergeAdjacentRanges};
2
+ import{removeUnordered as o}from"../../../../../core/arrayUtils.js";import t from"../../../../../core/ObjectPool.js";class r{constructor(o=0,t=0){this.from=o,this.to=t}get numElements(){return this.to-this.from}}function e(o,t){return o.from<t.to&&t.from<o.to}function n(t,r=s){if(t.length<2)return;const e=new Map;for(const o of t)e.set(o.from,o);let n=!0;for(;n;){n=!1;for(const s of t){const f=e.get(s.to);f&&(s.to=f.to,e.delete(f.from),o(t,f),n=!0,r.release(f))}}}const s=new t(()=>new r,(o,t=0,r=0)=>{o.from=t,o.to=r},()=>{});export{r as BufferRange,s as bufferRangePool,n as mergeAdjacentRanges,e as rangesIntersect};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{nextHighestPowerOfTwo as e,roundUpToNearest as t}from"../../../../../core/mathUtils.js";import{maxUint32 as r}from"../../../../../core/typedArrayUtil.js";import{copy as s,invert as o,transpose as n}from"../../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as a}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{glLayout as i}from"../../../support/buffer/glUtil.js";import{assert as f}from"../../lib/Util.js";import{VertexArrayObject as u}from"../../lib/VertexArrayObject.js";import{getMaxItemCount as c,getMaxByteSize as l}from"../../lib/TextureBackedBuffer/TextureBackedBufferUtils.js";import{bufferRangePool as h}from"./BufferRange.js";import{DrawCommand as g}from"./DrawCommand.js";import{getIndexLayoutForMaxIndex as m,getIndexLayoutForDataType as d}from"./IndexLayout.js";import{BaseInstanceData as y}from"./PerBaseInstanceData.js";import{VertexBuffer as x}from"../../../../webgl/VertexBuffer.js";class _{constructor(e,t){this._rctx=t,this._vaoCacheValue=null,this._instanceVboCacheValue=null,this._textureBufferCacheValue=null,this._vboCacheValue=null;const r=e.createBufferWriter();this._bufferWriter=r;const s=["geometry"],o="textureBufferLayout"in r&&null!=r.textureBufferLayout;this.useTextureBuffer=o,o&&s.push("texture"),this.useIndexing=e.useIndexing,this.useIndexing&&s.push("index"),this.targetBuffers=s}get _vaoCache(){return this._vaoCacheValue??=this._rctx.getVaoCache(i(this._bufferWriter.layout)),this._vaoCacheValue}get _instanceVboCache(){return this._instanceVboCacheValue??=this._rctx.getVboCache(i(this._bufferWriter.layout,1)),this._instanceVboCacheValue}get _textureBufferCache(){return this.useTextureBuffer?(this._textureBufferCacheValue??=this._rctx.getTextureBufferCache(this._bufferWriter.textureBufferLayout),this._textureBufferCacheValue):null}get _vboCache(){return this._vboCacheValue??=this._rctx.getVboCache(i(this._bufferWriter.layout)),this._vboCacheValue}maxElements(e){if("texture"===e){const e=this._targetLayout("texture");return null==e?0:c(this._rctx,e,this._bufferWriter.maxTextureBufferItemIndex??r)}const t=Math.floor(T/this._targetStrideBytes("geometry"));if("index"===e){const e=m(t-1).dataType;return Math.floor(T/this._targetStrideBytes("index",e))}return t}_targetStrideBytes(e,t){return this._targetLayout(e,t)?.stride??0}_targetLayout(e,t){return"geometry"===e?this._bufferWriter.layout:"baseInstance"===e?this._bufferWriter.baseInstanceLayout:"index"===e?d(t):this._bufferWriter.textureBufferLayout}evaluateBufferAllocation(e,t,r,s){const o=this._targetStrideBytes("geometry"),n=t.reduce((e,{geometry:t})=>e+this.vertexElementCount(t),0),a=r.reduce((e,{geometry:t})=>e+this.vertexElementCount(t),0),i=Math.min((e+n-a)*o,T),f=s.vao?.buffer("geometry"),u=f?.sizeBytes??0;return i>v&&i<u/2?0:i>u?1:2}deleteBuffer(e){e.isInstanced?(e.instancedCommandVAOs?.dispose(),this._instanceVboCache.deleteVbo(e.vao?.mutableBuffer("geometry")),e.vao?.disposeVAOOnly()):this.useIndexing?(this._vboCache.deleteVbo(e.vao?.mutableBuffer("geometry")),this._rctx.indexBufferCache.deleteIndexBuffer(e.vao?.indexBuffer),e.vao?.disposeVAOOnly()):this._vaoCache.deleteVao(e.vao),this._textureBufferCache?.deleteTextureBuffer(e.textureBuffer),e.vao=null,e.textureBuffer=null,e.endElements.geometry=0,e.endElements.texture=0,e.endElements.index=0}createBaseInstanceData(e){const{_bufferWriter:t}=this;if(null==e||null==t.baseInstanceLayout||null==t.writeBaseInstance||null==t.elementCountBaseInstance)return null;const r=this._targetLayout("baseInstance"),s=t.elementCountBaseInstance(e.attributes),o=s*r.stride,n=new x(this._rctx,i(r));n.setSize(Math.ceil(o));const a=S(o),f=r.createView(a.buffer);t.writeBaseInstance(e.attributes,f),n.setSubData(a,0,0,o);const u=new g;return u.first=0,u.count=s,new y(e,n,u)}reallocateBuffer(e,t,r){if(this.deleteBuffer(t),null!=e){f(!this.useIndexing,"Instanced indexed rendering is not supported");const s=e.baseInstanceBuffer,o=r.geometry*this._targetStrideBytes("geometry"),n=this._instanceVboCache.newVbo(M(o));t.vao=new u(this._rctx,new Map([["baseInstance",s],["geometry",n]]))}else if(this.useIndexing){const e=r.geometry*this._targetStrideBytes("geometry"),s=this._vboCache.newVbo(M(e)),o=Math.floor(s.sizeBytes/this._bufferWriter.layout.stride)-1,n=m(o),a=r.index*n.stride,i=Math.ceil(M(a)/n.stride),f=this._rctx.indexBufferCache.newIndexBuffer(i,n.dataType);t.vao=new u(this._rctx,s,f)}else{const e=r.geometry*this._targetStrideBytes("geometry");t.vao=this._vaoCache.newVao(M(e))}const s=this._targetLayout("texture"),o=this._textureBufferCache;if(null!=s&&null!=o){const e=M(r.texture*s.stride),n=Math.min(Math.ceil(e/s.stride),this.maxElements("texture"));t.textureBuffer=o.newTextureBuffer(n)}t.endElements.geometry=Math.floor((t.vao?.getByteLength("geometry")??0)/this._targetStrideBytes("geometry")),t.endElements.texture=t.textureBuffer?.itemCount??0,t.endElements.index=t.vao?.indexBuffer?.size??0}elementCount(e,t){const{attributes:r}=e;switch(t){case"geometry":return this._bufferWriter.elementCount(r);case"baseInstance":return this._bufferWriter.elementCountBaseInstance?.(r)??0;case"index":return e.drawIndices?.length??0;case"texture":return this._bufferWriter.elementCountTextureBuffer?.(r)??0;default:throw new Error(`Unhandled target: ${t}`)}}vertexElementCount(e){return this._bufferWriter.elementCount(e.attributes)}canGrow(e,t){const r=this.targetBuffers.map(r=>this._evaluateTargetBufferGrowth(r,e,t));return r.every(({canGrow:e})=>e)&&r.some(({needsToGrow:e})=>e)}_evaluateTargetBufferGrowth(e,t,s){const o=this._targetLayout(e,t.indexType),n=t.getTargetBuffer(e);if(null==o||null==n)return{needsToGrow:null!=o,canGrow:!0};return{needsToGrow:s[e]*o.stride>n.sizeBytes,canGrow:"geometry"===e||"index"===e?n.sizeBytes<M(T-v):n.sizeBytes<l(this._rctx,o,this._bufferWriter.maxTextureBufferItemIndex??r)}}clearHoles(e,t){const{indexType:r}=t;for(const s of this.targetBuffers){const o=this._targetStrideBytes(s,r),n=e[s],a=n.reduce((e,t)=>Math.max(e,t.numElements),0)*o,i=S(a);i.fill(this._getTargetClearValue(t,s),0,a);for(const e of n)this._setTargetSubData(s,t,o,e,i)}}clearHolesMetal(e,t,r){const{indexType:s}=r,{targetBuffers:o}=this,n={},a={};let i=0;for(const c of o){const e=t[c].numElements*this._targetStrideBytes(c,s);n[c]=e,a[c]=i,i+=E(e)}const f=S(i);for(const c of o)f.fill(this._getTargetClearValue(r,c),a[c],a[c]+n[c]);const u={};for(const c of o)u[c]=this._targetLayout(c,s)?.createView(f.buffer,a[c]);for(const c of e){const e=c.targetRanges.geometry;if(!(e.from>=t.geometry.from&&e.to<=t.geometry.to))continue;const r={};for(const s of o)r[s]=c.targetRanges[s].from-t[s].from;this._writeGeometry(c.geometry,u,r,c.targetRanges)}for(const c of o)this._setTargetSubData(c,r,this._targetStrideBytes(c,s),t[c],f,a[c])}writeRandomInstances(e,t,r){const{indexType:s}=r,{targetBuffers:o}=this,n={},a={},i={},f={};let u=0;for(const g of o)n[g]=e[g]*this._targetStrideBytes(g,s),a[g]=u,i[g]=0,f[g]=h.acquire(0,0),u+=E(n[g]);const c=S(u),l={};for(const h of o)l[h]=this._targetLayout(h,s)?.createView(c.buffer,a[h]);for(const h of t){for(const e of o){const t=h.targetRanges[e],o=f[e];o.to===t.from||(o.numElements>0&&this._setTargetSubData(e,r,this._targetStrideBytes(e,s),f[e],c,a[e]),o.from=t.from,i[e]=0)}this._writeGeometry(h.geometry,l,i,h.targetRanges);for(const e of o){const t=h.targetRanges[e];i[e]+=t.numElements,f[e].to=t.to}}for(const g of o){const e=f[g];e.numElements>0&&this._setTargetSubData(g,r,this._targetStrideBytes(g,s),e,c,a[g]),h.release(f[g])}}writeInstanceRangeMetal(e,t,r){const{indexType:s}=r,{targetBuffers:o}=this,n={},a={};let i=0;for(const c of o)n[c]=e[c].numElements*this._targetStrideBytes(c,s),a[c]=i,i+=E(n[c]);const f=S(i),u={};for(const c of o)u[c]=this._targetLayout(c,s)?.createView(f.buffer,a[c]);for(const c of o)f.fill(this._getTargetClearValue(r,c),a[c],a[c]+n[c]);for(const c of t){const t=c.targetRanges.geometry;if(!(t.from>=e.geometry.from&&t.to<=e.geometry.to))continue;const r={},s={};for(const n of o){const t=c.targetRanges[n];r[n]=t.from-e[n].from,s[n]=t}this._writeGeometry(c.geometry,u,r,s)}for(const c of o)e[c].numElements>0&&this._setTargetSubData(c,r,this._targetStrideBytes(c,s),e[c],f,a[c])}rebuildInstances(e,t,r){const{indexType:s}=r,{targetBuffers:o}=this,n={},a={},i={};let f=0;for(const l of o)n[l]=e[l]*this._targetStrideBytes(l,s),a[l]=f,f+=E(n[l]),i[l]=0;const u=S(f),c={};for(const l of o)c[l]=this._targetLayout(l,s)?.createView(u.buffer,a[l]);for(const l of t){const e={},t={};for(const r of o){e[r]=i[r],i[r]+=this.elementCount(l.geometry.geometry,r);const s=l.targetRanges[r];s.from=e[r],s.to=i[r],t[r]=s}this._writeGeometry(l.geometry,c,e,t)}for(const l of o){const e=h.acquire(0,i[l]);this._setTargetSubData(l,r,this._targetStrideBytes(l,s),e,u,a[l]),h.release(e)}return i}updateInstance(e,t){const{indexType:r}=t,{targetBuffers:s}=this,o={},n={};let a=0;for(const c of s){const t=this._targetStrideBytes(c,r);o[c]=this.elementCount(e.geometry.geometry,c)*t,n[c]=a,a+=E(o[c])}const i=S(a),f={},u={};for(const c of s)u[c]=0,f[c]=this._targetLayout(c,r)?.createView(i.buffer,n[c]);this._writeGeometry(e.geometry,f,u,e.targetRanges);for(const c of s)this._setTargetSubData(c,t,this._targetStrideBytes(c,r),e.targetRanges[c],i,n[c])}updateInstancesMetal(e){const{targetBuffers:t}=this;for(const[r,s]of e){const e={};for(const r of t)e[r]=h.acquire(1/0,-1/0);for(const r of s)for(const s of t){const t=e[s],o=r.targetRanges[s];t.from=Math.min(t.from,o.from),t.to=Math.max(t.to,o.to)}this.writeInstanceRangeMetal(e,r.instances.values(),r);for(const r of t)h.release(e[r])}}_writeGeometry(e,t,r,a){const{_bufferWriter:i}=this;if(null==i)return;s(b,e.transformation),b[12]-=e.localOrigin.vec3[0],b[13]-=e.localOrigin.vec3[1],b[14]-=e.localOrigin.vec3[2],o(w,b),n(w,w);const u={buffer:t.geometry,offset:r.geometry},c=null!=t.texture?{buffer:t.texture,offset:r.texture,textureBufferRange:a.texture}:null;if(i.write(b,w,e.geometry.attributes,e.geometry.olidColor,u,c),this.useIndexing){const s=e.geometry.drawIndices;f(null!=t.index,"Should have an indexed view when using indexing"),f(null!=s,"Material requires vertex indices"),this._writeIndexBuffer(a.geometry,t.index,r,s)}}_writeIndexBuffer(e,t,r,s){const o=e.from,n=t,a=r.index;for(let i=0;i<s.length;++i)n[a+i]=s[i]+o}_setTargetSubData(e,t,r,s,o,n=0){if("geometry"===e){const a=t.getTargetBuffer(e);a?.setSubData(o,s.from*r,n,n+s.numElements*r)}else if("texture"===e){const r=t.getTargetBuffer(e);r?.setSubData(o.buffer,s.from,n,s.numElements)}else if("index"===e){const a=t.getTargetBuffer(e);a?.setSubData(o,s.from*r,n,n+s.numElements*r)}}_getTargetClearValue(e,t){if("index"!==t)return 0;const r=e.vao.indexBuffer?.indexType;return d(r).primitiveRestart}static prune(){I=new Uint8Array(v)}}function B(e=p,t=C){return T=e,v=t,{[Symbol.dispose]:()=>{T=p,v=C}}}const b=a(),w=a(),C=262144,V=1024,p=16777216;let v=C,T=p,I=new Uint8Array(v);function S(e){return I.byteLength<e&&(I=new Uint8Array(e)),I}function E(e){return t(e,4)}function M(t){return t<=V?V:t<v?e(t):Math.max(Math.min(Math.ceil(1.5*t/v)*v,T),t)}export{_ as VaoWriter,B as withVaoWriterSizes};
2
+ import{nextHighestPowerOfTwo as e,roundUpToNearest as t}from"../../../../../core/mathUtils.js";import{maxUint32 as r}from"../../../../../core/typedArrayUtil.js";import{copy as s,invert as n,transpose as o}from"../../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as a}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{glLayout as i}from"../../../support/buffer/glUtil.js";import{assert as f}from"../../lib/Util.js";import{VertexArrayObject as u}from"../../lib/VertexArrayObject.js";import{getMaxItemCount as c,getMaxByteSize as l}from"../../lib/TextureBackedBuffer/TextureBackedBufferUtils.js";import{bufferRangePool as h,rangesIntersect as g}from"./BufferRange.js";import{DrawCommand as m}from"./DrawCommand.js";import{getIndexLayoutForMaxIndex as d,getIndexLayoutForDataType as y}from"./IndexLayout.js";import{BaseInstanceData as x}from"./PerBaseInstanceData.js";import{VertexBuffer as _}from"../../../../webgl/VertexBuffer.js";class B{constructor(e,t){this._rctx=t,this._vaoCacheValue=null,this._instanceVboCacheValue=null,this._textureBufferCacheValue=null,this._vboCacheValue=null;const r=e.createBufferWriter();this._bufferWriter=r;const s=["geometry"],n="textureBufferLayout"in r&&null!=r.textureBufferLayout;this.useTextureBuffer=n,n&&s.push("texture"),this.useIndexing=e.useIndexing,this.useIndexing&&s.push("index"),this.targetBuffers=s}get _vaoCache(){return this._vaoCacheValue??=this._rctx.getVaoCache(i(this._bufferWriter.layout)),this._vaoCacheValue}get _instanceVboCache(){return this._instanceVboCacheValue??=this._rctx.getVboCache(i(this._bufferWriter.layout,1)),this._instanceVboCacheValue}get _textureBufferCache(){return this.useTextureBuffer?(this._textureBufferCacheValue??=this._rctx.getTextureBufferCache(this._bufferWriter.textureBufferLayout),this._textureBufferCacheValue):null}get _vboCache(){return this._vboCacheValue??=this._rctx.getVboCache(i(this._bufferWriter.layout)),this._vboCacheValue}maxElements(e){if("texture"===e){const e=this._targetLayout("texture");return null==e?0:c(this._rctx,e,this._bufferWriter.maxTextureBufferItemIndex??r)}const t=Math.floor(v/this._targetStrideBytes("geometry"));if("index"===e){const e=d(t-1).dataType;return Math.floor(v/this._targetStrideBytes("index",e))}return t}_targetStrideBytes(e,t){return this._targetLayout(e,t)?.stride??0}_targetLayout(e,t){return"geometry"===e?this._bufferWriter.layout:"baseInstance"===e?this._bufferWriter.baseInstanceLayout:"index"===e?y(t):this._bufferWriter.textureBufferLayout}evaluateBufferAllocation(e,t,r,s){const n=this._targetStrideBytes("geometry"),o=t.reduce((e,{geometry:t})=>e+this.vertexElementCount(t),0),a=r.reduce((e,{geometry:t})=>e+this.vertexElementCount(t),0),i=Math.min((e+o-a)*n,v),f=s.vao?.buffer("geometry"),u=f?.sizeBytes??0;return i>p&&i<u/2?0:i>u?1:2}deleteBuffer(e){e.isInstanced?(e.instancedCommandVAOs?.dispose(),this._instanceVboCache.deleteVbo(e.vao?.mutableBuffer("geometry")),e.vao?.disposeVAOOnly()):this.useIndexing?(this._vboCache.deleteVbo(e.vao?.mutableBuffer("geometry")),this._rctx.indexBufferCache.deleteIndexBuffer(e.vao?.indexBuffer),e.vao?.disposeVAOOnly()):this._vaoCache.deleteVao(e.vao),this._textureBufferCache?.deleteTextureBuffer(e.textureBuffer),e.vao=null,e.textureBuffer=null,e.endElements.geometry=0,e.endElements.texture=0,e.endElements.index=0}createBaseInstanceData(e){const{_bufferWriter:t}=this;if(null==e||null==t.baseInstanceLayout||null==t.writeBaseInstance||null==t.elementCountBaseInstance)return null;const r=this._targetLayout("baseInstance"),s=t.elementCountBaseInstance(e.attributes),n=s*r.stride,o=new _(this._rctx,i(r));o.setSize(Math.ceil(n));const a=E(n),f=r.createView(a.buffer);t.writeBaseInstance(e.attributes,f),o.setSubData(a,0,0,n);const u=new m;return u.first=0,u.count=s,new x(e,o,u)}reallocateBuffer(e,t,r){if(this.deleteBuffer(t),null!=e){f(!this.useIndexing,"Instanced indexed rendering is not supported");const s=e.baseInstanceBuffer,n=r.geometry*this._targetStrideBytes("geometry"),o=this._instanceVboCache.newVbo(L(n));t.vao=new u(this._rctx,new Map([["baseInstance",s],["geometry",o]]))}else if(this.useIndexing){const e=r.geometry*this._targetStrideBytes("geometry"),s=this._vboCache.newVbo(L(e)),n=Math.floor(s.sizeBytes/this._bufferWriter.layout.stride)-1,o=d(n),a=r.index*o.stride,i=Math.ceil(L(a)/o.stride),f=this._rctx.indexBufferCache.newIndexBuffer(i,o.dataType);t.vao=new u(this._rctx,s,f)}else{const e=r.geometry*this._targetStrideBytes("geometry");t.vao=this._vaoCache.newVao(L(e))}const s=this._targetLayout("texture"),n=this._textureBufferCache;if(null!=s&&null!=n){const e=L(r.texture*s.stride),o=Math.min(Math.ceil(e/s.stride),this.maxElements("texture"));t.textureBuffer=n.newTextureBuffer(o)}t.endElements.geometry=Math.floor((t.vao?.getByteLength("geometry")??0)/this._targetStrideBytes("geometry")),t.endElements.texture=t.textureBuffer?.itemCount??0,t.endElements.index=t.vao?.indexBuffer?.size??0}elementCount(e,t){const{attributes:r}=e;switch(t){case"geometry":return this._bufferWriter.elementCount(r);case"baseInstance":return this._bufferWriter.elementCountBaseInstance?.(r)??0;case"index":return e.drawIndices?.length??0;case"texture":return this._bufferWriter.elementCountTextureBuffer?.(r)??0;default:throw new Error(`Unhandled target: ${t}`)}}vertexElementCount(e){return this._bufferWriter.elementCount(e.attributes)}canGrow(e,t){const r=this.targetBuffers.map(r=>this._evaluateTargetBufferGrowth(r,e,t));return r.every(({canGrow:e})=>e)&&r.some(({needsToGrow:e})=>e)}_evaluateTargetBufferGrowth(e,t,s){const n=this._targetLayout(e,t.indexType),o=t.getTargetBuffer(e);if(null==n||null==o)return{needsToGrow:null!=n,canGrow:!0};return{needsToGrow:s[e]*n.stride>o.sizeBytes,canGrow:"geometry"===e||"index"===e?o.sizeBytes<L(v-p):o.sizeBytes<l(this._rctx,n,this._bufferWriter.maxTextureBufferItemIndex??r)}}clearHoles(e,t){const{indexType:r}=t;for(const s of this.targetBuffers){const n=this._targetStrideBytes(s,r),o=e[s],a=o.reduce((e,t)=>Math.max(e,t.numElements),0)*n,i=E(a);i.fill(this._getTargetClearValue(t,s),0,a);for(const e of o)this._setTargetSubData(s,t,n,e,i)}}clearHolesMetal(e,t,r){const{indexType:s}=r,{targetBuffers:n}=this,o={},a={};let i=0;for(const c of n){const e=t[c].numElements*this._targetStrideBytes(c,s);o[c]=e,a[c]=i,i+=M(e)}const f=E(i);for(const c of n)f.fill(this._getTargetClearValue(r,c),a[c],a[c]+o[c]);const u={};for(const c of n)u[c]=this._targetLayout(c,s)?.createView(f.buffer,a[c]);for(const c of e)this._writeIntersectingInstanceTargets(c,u,t);for(const c of n)this._setTargetSubData(c,r,this._targetStrideBytes(c,s),t[c],f,a[c])}writeRandomInstances(e,t,r){const{indexType:s}=r,{targetBuffers:n}=this,o={},a={},i={},f={};let u=0;for(const g of n)o[g]=e[g]*this._targetStrideBytes(g,s),a[g]=u,i[g]=0,f[g]=h.acquire(0,0),u+=M(o[g]);const c=E(u),l={};for(const h of n)l[h]=this._targetLayout(h,s)?.createView(c.buffer,a[h]);for(const h of t){for(const e of n){const t=h.targetRanges[e],n=f[e];n.to===t.from||(n.numElements>0&&this._setTargetSubData(e,r,this._targetStrideBytes(e,s),f[e],c,a[e]),n.from=t.from,i[e]=0)}this._writeGeometry(h.geometry,l,i,h.targetRanges);for(const e of n){const t=h.targetRanges[e];i[e]+=t.numElements,f[e].to=t.to}}for(const g of n){const e=f[g];e.numElements>0&&this._setTargetSubData(g,r,this._targetStrideBytes(g,s),e,c,a[g]),h.release(f[g])}}writeInstanceRangeMetal(e,t,r){const{indexType:s}=r,{targetBuffers:n}=this,o={},a={};let i=0;for(const c of n)o[c]=e[c].numElements*this._targetStrideBytes(c,s),a[c]=i,i+=M(o[c]);const f=E(i),u={};for(const c of n)u[c]=this._targetLayout(c,s)?.createView(f.buffer,a[c]);for(const c of n)f.fill(this._getTargetClearValue(r,c),a[c],a[c]+o[c]);for(const c of t)this._writeIntersectingInstanceTargets(c,u,e);for(const c of n)e[c].numElements>0&&this._setTargetSubData(c,r,this._targetStrideBytes(c,s),e[c],f,a[c])}rebuildInstances(e,t,r){const{indexType:s}=r,{targetBuffers:n}=this,o={},a={},i={};let f=0;for(const l of n)o[l]=e[l]*this._targetStrideBytes(l,s),a[l]=f,f+=M(o[l]),i[l]=0;const u=E(f),c={};for(const l of n)c[l]=this._targetLayout(l,s)?.createView(u.buffer,a[l]);for(const l of t){const e={},t={};for(const r of n){e[r]=i[r],i[r]+=this.elementCount(l.geometry.geometry,r);const s=l.targetRanges[r];s.from=e[r],s.to=i[r],t[r]=s}this._writeGeometry(l.geometry,c,e,t)}for(const l of n){const e=h.acquire(0,i[l]);this._setTargetSubData(l,r,this._targetStrideBytes(l,s),e,u,a[l]),h.release(e)}return i}updateInstance(e,t){const{indexType:r}=t,{targetBuffers:s}=this,n={},o={};let a=0;for(const c of s){const t=this._targetStrideBytes(c,r);n[c]=this.elementCount(e.geometry.geometry,c)*t,o[c]=a,a+=M(n[c])}const i=E(a),f={},u={};for(const c of s)u[c]=0,f[c]=this._targetLayout(c,r)?.createView(i.buffer,o[c]);this._writeGeometry(e.geometry,f,u,e.targetRanges);for(const c of s)this._setTargetSubData(c,t,this._targetStrideBytes(c,r),e.targetRanges[c],i,o[c])}updateInstancesMetal(e){const{targetBuffers:t}=this;for(const[r,s]of e){const e={};for(const r of t)e[r]=h.acquire(1/0,-1/0);for(const r of s)for(const s of t){const t=e[s],n=r.targetRanges[s];t.from=Math.min(t.from,n.from),t.to=Math.max(t.to,n.to)}this.writeInstanceRangeMetal(e,r.instances.values(),r);for(const r of t)h.release(e[r])}}_writeIntersectingInstanceTargets(e,t,r){const s={},n={};let o=!1;for(const a of this.targetBuffers){const i=e.targetRanges[a],f=r[a],u=g(i,f);n[a]=u?t[a]:null,s[a]=u?i.from-f.from:0,o||=u}o&&this._writeGeometry(e.geometry,n,s,e.targetRanges)}_writeGeometry(e,t,r,a){const{_bufferWriter:i}=this;if(null==i)return;s(w,e.transformation),w[12]-=e.localOrigin.vec3[0],w[13]-=e.localOrigin.vec3[1],w[14]-=e.localOrigin.vec3[2],n(C,w),o(C,C);const u=null!=t.geometry?{buffer:t.geometry,offset:r.geometry}:null,c=null!=t.texture?{buffer:t.texture,offset:r.texture}:null;if(i.write(w,C,e.geometry.attributes,e.geometry.olidColor,u,a.texture,c),this.useIndexing&&null!=t.index){const s=e.geometry.drawIndices;f(null!=s,"Material requires vertex indices"),this._writeIndexBuffer(a.geometry,t.index,r,s)}}_writeIndexBuffer(e,t,r,s){const n=e.from,o=t,a=r.index;for(let i=0;i<s.length;++i)o[a+i]=s[i]+n}_setTargetSubData(e,t,r,s,n,o=0){if("geometry"===e){const a=t.getTargetBuffer(e);a?.setSubData(n,s.from*r,o,o+s.numElements*r)}else if("texture"===e){const r=t.getTargetBuffer(e);r?.setSubData(n.buffer,s.from,o,s.numElements)}else if("index"===e){const a=t.getTargetBuffer(e);a?.setSubData(n,s.from*r,o,o+s.numElements*r)}}_getTargetClearValue(e,t){if("index"!==t)return 0;const r=e.vao.indexBuffer?.indexType;return y(r).primitiveRestart}static prune(){S=new Uint8Array(p)}}function b(e=V,t=I){return v=e,p=t,{[Symbol.dispose]:()=>{v=V,p=I}}}const w=a(),C=a(),I=262144,T=1024,V=16777216;let p=I,v=V,S=new Uint8Array(p);function E(e){return S.byteLength<e&&(S=new Uint8Array(e)),S}function M(e){return t(e,4)}function L(t){return t<=T?T:t<p?e(t):Math.max(Math.min(Math.ceil(1.5*t/p)*p,v),t)}export{B as VaoWriter,b as withVaoWriterSizes};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{invertOrIdentity as e}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as i}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{Matrix4BindUniform as r}from"../core/shaderModules/Matrix4BindUniform.js";function o(i,o={needUVs:!0,needEyeDirection:!0}){i.attributes.add("position","vec2"),i.varyings.add("worldRay","vec3");const{needUVs:a,needEyeDirection:t}=o;i.vertex.uniforms.add(new r("inverseProjectionMatrix",e=>e.camera.inverseProjectionMatrix),new r("inverseViewMatrix",i=>e(n,i.camera.viewMatrix))).main.add("\n gl_Position = vec4(position, 1, 1);\n\n vec3 posViewNear = (inverseProjectionMatrix * vec4(position, -1.0, 1.0)).xyz;\n worldRay = (inverseViewMatrix * vec4(posViewNear, 0)).xyz;\n "),a&&(i.varyings.add("uv","vec2"),i.vertex.main.add("uv = position * 0.5 + vec2(0.5);")),t&&(i.varyings.add("eyeDir","vec3"),i.vertex.main.add("eyeDir = posViewNear;"))}const n=i();export{o as ScreenSpacePassAtmosphere};
2
+ import{Matrix4BindUniform as e}from"../core/shaderModules/Matrix4BindUniform.js";function i(i,r={needUVs:!0,needEyeDirection:!0}){i.attributes.add("position","vec2"),i.varyings.add("worldRay","vec3");const{needUVs:n,needEyeDirection:a}=r;i.vertex.uniforms.add(new e("inverseProjectionMatrix",e=>e.camera.inverseProjectionMatrix),new e("inverseViewMatrix",e=>e.camera.inverseViewMatrix)).main.add("\n gl_Position = vec4(position, 1, 1);\n\n vec3 posViewNear = (inverseProjectionMatrix * vec4(position, -1.0, 1.0)).xyz;\n worldRay = (inverseViewMatrix * vec4(posViewNear, 0)).xyz;\n "),n&&(i.varyings.add("uv","vec2"),i.vertex.main.add("uv = position * 0.5 + vec2(0.5);")),a&&(i.varyings.add("eyeDir","vec3"),i.vertex.main.add("eyeDir = posViewNear;"))}export{i as ScreenSpacePassAtmosphere};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as t}from"tslib";import{property as r,subclass as e}from"../core/accessorSupport/decorators.js";import{GoToManager as n}from"./2d/GoToManager.js";import i from"./2d/input/MapViewInputManager.js";import{isSupportedScreenPointEvent as s,createScreenPointFromSupportedEvent as o}from"./support/screenUtils.js";const a=a=>{const p=a;let g=class extends p{constructor(...t){super(...t),this.goToManager=new n({view:this}),this.inputManager=new i({view:this}),this.addHandles([this.on("resize",t=>this.stateManager.resize(t.width,t.height))])}get interacting(){return this.navigating}get stationary(){return!this.animation&&!this.navigating&&!this.resizing&&this.stationaryManager.stationary}on(t,r,e,n){const i=this.viewEvents.on(t,r,e,n);return i||super.on(t,r)}hasEventListener(t){return super.hasEventListener(t)||this.viewEvents.hasHandler(t)}goTo(t,r){return this.goToManager.goTo(t,r)}toMap(t){if(!this.ready)return null;const r=s(t)?o(this,t):t;return this.stateManager.toMap(r)}};return t([r()],g.prototype,"goToManager",void 0),t([r({readOnly:!0})],g.prototype,"interacting",null),t([r()],g.prototype,"stationary",null),t([r({readOnly:!0})],g.prototype,"inputManager",void 0),g=t([e("esri.views.Viewport2DMixin")],g),g};export{a as Viewport2DMixin};
2
+ import{__decorate as t}from"tslib";import{property as r,subclass as e}from"../core/accessorSupport/decorators.js";import{GoToManager as n}from"./2d/GoToManager.js";import i from"./2d/input/MapViewInputManager.js";import{isSupportedScreenPointEvent as s,createScreenPointFromSupportedEvent as o}from"./support/screenUtils.js";const a=a=>{const p=a;let g=class extends p{constructor(...t){super(...t),this.goToManager=new n({view:this}),this.inputManager=new i({view:this}),this.addHandles([this.on("resize",t=>this.stateManager.resize(t.width,t.height))])}get interacting(){return this.navigating}get stationary(){return!this.animation&&!this.navigating&&!this.resizing&&this.stationaryManager?.stationary}on(t,r,e,n){const i=this.viewEvents.on(t,r,e,n);return i||super.on(t,r)}hasEventListener(t){return super.hasEventListener(t)||this.viewEvents.hasHandler(t)}goTo(t,r){return this.goToManager.goTo(t,r)}toMap(t){if(!this.ready)return null;const r=s(t)?o(this,t):t;return this.stateManager.toMap(r)}};return t([r()],g.prototype,"goToManager",void 0),t([r({readOnly:!0})],g.prototype,"interacting",null),t([r()],g.prototype,"stationary",null),t([r({readOnly:!0})],g.prototype,"inputManager",void 0),g=t([e("esri.views.Viewport2DMixin")],g),g};export{a as Viewport2DMixin};
@@ -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 d}from"../../core/promiseUtils.js";import m 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 M,isFeatureLayer as T,getSubtypesFromLayer as b}from"../../layers/support/layerUtils.js";import{system as k}from"../../time/constants.js";import{getAttachmentKey as V}from"./attachmentUtils.js";import{getLayerTimeZone as S,getEffectiveTimeZone as L,createReactiveGraphic as R,isAttributeFormSupportedLayerWithAttachments as H,layerSupportsQueryAttachments 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 m,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 m,this._prepareTask=null,this._layerTemplateUpdateTask=null,this._reactiveGraphicLookup=new m,this._updatingHandles=new w,this._submitTask=null,this._layerTemplateMap=new m,this._workingFeatures=new a,this._expressionsManager=new D({arcadeContext:{editType:"NA",spatialReference:null,map:null,timeZone:k}}),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._workingFeatures.destroyAll(),l(this._expressionsManager),l(this._reactiveContingentValuesManager),this._updatingHandles.destroy(),this._reactiveGraphicLookup=new m,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)||M(e)||T(e)?b(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),!M(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 d(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 m,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:s}=this;if(!(e&&s&&H(t)&&P(t)))return;const a=e.getObjectId();if(null==a)return;const i=this._attachmentCache.get(t),n=s.allAttachmentElementInputs;if(!n.length)return;let r;if(i){const e=i.get(a);e&&(r=e)}if(!r){r=await j(t,a,n);o(this._attachmentCache,t,()=>new m).set(a,r)}for(const o of n)o.applyFetchedAttachments(oe(o,r))}get test(){return{expressionsManager:this._expressionsManager,reactiveGraphicLookup:this._reactiveGraphicLookup}}};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;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};
@@ -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{isLayerWithHistoricMoment as n}from"../../layers/mixins/EditBusLayer.js";import{isSubtypeSublayer as i,getSubtypesFromLayer as r}from"../../layers/support/layerUtils.js";import o from"../../rest/support/AttachmentQuery.js";import{unknown as a,utc as s}from"../../time/constants.js";import{ReactiveGraphic as l}from"./ReactiveGraphic.js";import{isMultipleChoiceFieldInput as u,isGroupInput as c}from"./inputs/support/inputUtils.js";import{getIntlOptionsForField as d}from"../support/dateUtils.js";import{isEmptyValue as p,getRangeErrorMessage as f,shouldUseScientificNotation as m,scientificNumberFormatOptions as y,numberFormatOptions as h}from"../support/forms/formUtils.js";const v=(e,t)=>null!=e&&e.input?.type===t;function b(e){return new l({source:e})}function g(t,n,i,r){const{dataType:o,minLength:a}=t,s=i?.validationErrors;if(!s||!n)return null;if("batch-attribute-form-validation::features-have-different-errors"===n)return s.invalidBatchFormType;if("input-validation-error::cannot-be-empty"===n)return s.cannotBeNull;if("domain-validation-error::value-out-of-range"===n||"numeric-range-validation-error::out-of-range"===n){const{field:n,range:i}=t,a={type:"date",intlOptions:{timeZone:"date"===n.type&&r?r:void 0,...d(n)}},l=f(i,s);return e(l,i,{format:{max:"date"===o?a:null!=i.max&&m(i.max)?y:h,min:"date"===o?a:null!=i.min&&m(i.min)?y:h}})}return"domain-validation-error::invalid-coded-value"===n?s.invalidCodedValue:"type-validation-error::invalid-type"===n?s.invalidType:"length-validation-error::too-short"===n?e(s.tooShort,{min:a}):"multiple-choice-validation-error::too-few-selected-choices"===n&&u(t)?e(s.tooFewSelectedChoices,{min:t.input.minimumChoices}):"multiple-choice-validation-error::too-many-selected-choices"===n&&u(t)?e(s.tooManySelectedChoices,{max:t.input.maximumChoices}):"length-validation-error::too-long"===n?null:"contingent-values-validation-error::contingency-violation-warning"===n||"contingent-values-validation-error::contingency-violation-error"===n?s.valuesIncompatible:null}function w(e,t,n){const i=n?.validationErrors;if(!i)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?i.nonVisibleError_changeValues:i.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=i.nonVisibleError_checkIndividualFeatures;break;case"visible":continue;default:o.effectiveVisibilityCode}return r}function j(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 x(e){return!!j(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 I(e){return x(e)&&"queryAttachments"in e}function k(e){return null!=e&&"object"==typeof e&&"type"in e&&("feature"===e.type||"subtype-sublayer"===e.type)}function C(e){if(!I(e))return!1;const t=e?.effectiveCapabilities??e?.capabilities;return!(!t?.data?.supportsAttachment||!t.operations.supportsQueryAttachments)}async function T(e,t,r){const a=new Set;let s=!1;for(const n of r){if("attachment"===n.input?.type&&("any"===n.input.attachmentAssociationType||"exactOrNone"===n.input.attachmentAssociationType)){s=!0;break}if(p(n.attachmentKeyword)){s=!0;break}a.add(n.attachmentKeyword)}const l=a.size&&!s?Array.from(a):void 0,u=new o({objectIds:[t],where:"1=1",returnMetadata:!0,keywords:l}),c=i(e)?e.parent:e;n(c)&&c.historicMoment&&(u.historicMoment=c.historicMoment);return(await e.queryAttachments(u))[t]??[]}function V(e,t,n,i){const r=e.get(t)?.get(n)??[];if(!i?.length)return r;const o=new Set(i.map(e=>e.toLowerCase()));return r.filter(e=>o.has(e.keywords.toLowerCase()))}function A(e,n,i){const o=r(e),a=o?.find(e=>e.code===i);if(!a)return!1;const s=o?.find(e=>e.code===n);return!t(a.defaultValues,s?.defaultValues)&&Object.values(a.defaultValues).some(e=>null!=e)}function F(e){return e.reduce((e,t)=>c(t)?[...e,...t.inputs]:[...e,t],[])}function E(e){return i(e)&&e.parent&&(e=e.parent),e&&"datesInUnknownTimezone"in e&&e.datesInUnknownTimezone?a:e&&"preferredTimeZone"in e&&e.preferredTimeZone?e.preferredTimeZone:null}function U(e,t){return e||t?t===a?s:e&&e!==a?e:t??"system":"system"}export{b as createReactiveGraphic,F as flattenInputs,V as getAttachmentsForKeywords,U as getEffectiveTimeZone,w as getHiddenFieldsValidationErrorMessage,E as getLayerTimeZone,g as getVisibleFieldInputValidationErrorMessage,k as isAssociationsLayerUnion,x as isAttributeFormSupportedLayer,j as isAttributeFormSupportedLayerUnion,I as isAttributeFormSupportedLayerWithAttachments,v as isElementTemplateWithInputType,C as layerSupportsQueryAttachments,T as queryAttachmentsForElements,A 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 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 h,numberFormatOptions as v}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)?h:v,min:"date"===r?a:null!=n.min&&y(n.min)?h:v}})}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 k(e){return I(e)&&"queryAttachments"in e}function C(e){return null!=e&&"object"==typeof e&&"type"in e&&("feature"===e.type||"subtype-sublayer"===e.type)}function T(e){if(!k(e))return!1;const t=e?.effectiveCapabilities??e?.capabilities;return!!t?.data?.supportsAttachment}async function V(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,t,i,n){const o=e.get(t)?.get(i)??[];if(!n?.length)return o;const r=new Set(n.map(e=>e.toLowerCase()));return o.filter(e=>r.has(e.keywords.toLowerCase()))}function A(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 U(e){return e.reduce((e,t)=>d(t)?[...e,...t.inputs]:[...e,t],[])}function E(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 M(e,t){return e||t?t===s?l:e&&e!==s?e:t??"system":"system"}export{g as createReactiveGraphic,U as flattenInputs,F as getAttachmentsForKeywords,M as getEffectiveTimeZone,w as getHiddenFieldsValidationErrorMessage,E as getLayerTimeZone,j as getVisibleFieldInputValidationErrorMessage,C as isAssociationsLayerUnion,I as isAttributeFormSupportedLayer,x as isAttributeFormSupportedLayerUnion,k as isAttributeFormSupportedLayerWithAttachments,b as isElementTemplateWithInputType,T as layerSupportsAttachments,V as queryAttachmentsForElements,A as subtypeChangeShouldPrompt};
@@ -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 a}from"../../../core/MapUtils.js";import{whenOrAbort as o}from"../../../core/promiseUtils.js";import i from"../../../core/ReactiveMap.js";import{property as n,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{isGroupElementTemplate as d,isFieldElementTemplate as f}from"../templates/support/templateUtils.js";let h=null,m=class extends t{constructor(e){super(e),this.calculating=!1,this.arcadeContext=null,this._abortController=new AbortController,this.layerExpressionsModelMap=new Map,this.evaluatedExpressions=new i,this.expressionEvaluationFailed=!1}destroy(){this.abort()}abort(){this._abortController.abort()}async runAllExpressions(e,t){return this._evaluateSpecifiedComponentsForEachFeature(e,x,t)}async runGeometryDependentExpressions(e,t){return this._evaluateSpecifiedComponentsForEachFeature(e,v,t)}async runOriginalFeatureDependentExpressions(e,t){return this._evaluateSpecifiedComponentsForEachFeature([e],b,t)}async runExpressionsDependentOnChangedFields(e){try{this.calculating=!0;const t=Array.from(e.changes).map(([t,r])=>this.runExpressionsDependentOnChangedFieldsForFeature([...r.keys()],t,e));await Promise.all(t)}catch(t){s.getLogger(this).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 a=new Set,o=new Set(e),i=new Set;for(;o.size>0;){const[e]=o;if(o.delete(e),a.has(e))continue;a.add(e);const n=s.fieldReferencesMap.get(e.toLowerCase());if(!n)continue;for(const t of n)i.has(t)&&n.delete(t);if(0===n.size)continue;const l=new Set;await this.evaluateAffectedComponents([...n],t,s,r,l);for(const t of n)i.add(t);for(const t of l)a.has(t)||o.add(t)}}async evaluateAffectedComponents(e,t,r,s,a){const o=new Map;for(const n of e)o.has(n)||o.set(n,this.createSccEvaluator(n,t,o,r));if(0===o.size)return;const i=[...o.values()].map(e=>e.evaluate(s,a));await Promise.all(i)}createSccEvaluator(e,t,r,s){const o=new g(e,t,this.arcadeContext,s,this.evaluatedExpressions,this._abortController);for(const i of e.adjacencyList)o.dependentEvaluators.push(a(r,i,()=>this.createSccEvaluator(i,t,r,s)));return o}async _evaluateSpecifiedComponentsForEachFeature(e,t,r){this.calculating=!0;try{const s=[];for(const a of e){const e=this.layerExpressionsModelMap.get(a.layer);if(!e||0===e.components.length)continue;const o=new Set;s.push(this.evaluateAffectedComponents(t(e),a,e,r,o))}await o(Promise.all(s),this._abortController)}catch(a){s.getLogger(this).error(a),this.expressionEvaluationFailed=!0}finally{this.calculating=!1}}};e([n()],m.prototype,"calculating",void 0),e([n({constructOnly:!0})],m.prototype,"arcadeContext",void 0),e([n()],m.prototype,"_abortController",void 0),e([n()],m.prototype,"layerExpressionsModelMap",void 0),e([n()],m.prototype,"evaluatedExpressions",void 0),e([n()],m.prototype,"expressionEvaluationFailed",void 0),m=e([l("esri.widgets.BatchAttributeForm.expressions.ExpressionsManager")],m);class g{constructor(e,t,r,s,a,o){this.scc=e,this.feature=t,this.arcadeContextInfo=r,this.expressionsModel=s,this.evaluatedExpressions=a,this._abortController=o,this.dependentEvaluators=[],this._evaluatorPromise=null}get baseContext(){const{editType:e,map:t,spatialReference:r,timeZone:s}=this.arcadeContextInfo,a=this.feature.layer,o="scene"===a?.type&&null!=a.associatedLayer?a.associatedLayer:a;return{variables:{$originalfeature:this.feature.original,$editcontext:{editType:e},$layer:o,$featureset:o,$datastore:o?.url,$feature:this.feature.plainGraphic,$map:t},executeContext:{rawOutput:!0,spatialReference:r??void 0,timeZone:s,abortSignal:this._abortController.signal}}}evaluate(e,t){return null==this._evaluatorPromise&&(this._evaluatorPromise=this._evaluate(e,t)),this._evaluatorPromise}async _evaluate(e,t){null===h&&(h=await import("../../../arcade/languageUtils.js"));const s=this.dependentEvaluators.map(r=>r.evaluate(e,t));await o(Promise.all(s),this._abortController);for(const o of this.scc.executors){const s=this.baseContext;if(this._abortController.signal.aborted)break;const l=this.expressionsModel.arcadeExecutorUses.get(o)??[],u=a(this.evaluatedExpressions,this.feature,()=>new i);let c=null,h=null;try{c=o.isAsync?await o.executeAsync(s.variables,s.executeContext):o.execute(s.variables,s.executeContext),h={result:c,status:"success"}}catch(n){h={error:n,status:"error"}}for(const r of l){const s=this.expressionsModel.elementTemplateMap.get(r.elementId);switch(r.executorPurpose){case"editable":case"required":case"text":u.set(p(r),h);break;case"value":{if("error"===h?.status)continue;const r=s.getExpressionExecutorsForLayer(this.feature.layer);let a=!0;if(r?.editableExpression&&(a=!1===u.get(p({elementId:s.elementId,executorPurpose:"editable"}))?.result),a){const r=this.feature.getAttribute(s.fieldName)??null,a=y(h.result,this.feature,s.fieldName,this.arcadeContextInfo.timeZone);a!==r&&(e.setValue(this.feature,s.fieldName,a),t.add(s.fieldName))}}break;case"visibility":if(u.set(p(r),h),!this.expressionsModel.preserveFieldValuesWhenHidden&&!1===h.result&&"user"===e.originActor)if(d(s)){for(const r of s.elements)if(f(r)){null!==this.feature.getAttribute(r.fieldName)&&t.add(r.fieldName),e.setValue(this.feature,r.fieldName,null)}}else if(f(s)){null!==this.feature.getAttribute(s.fieldName)&&t.add(s.fieldName),e.setValue(this.feature,s.fieldName,null)}}}if("error"===h?.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")}}if(e.size>0)throw new r("expression-evaluation-failed","Arcade evaluation failed ("+[...e].join(",")+")");throw new r("expression-evaluation-failed","Arcade evaluation failed ")}}}}function y(e,t,s,a){if(null===e)return null;const o=t.layer.fieldsIndex.get(s);if(!o)throw new r("field-not-found","Unable set field value as the field cannot be found. ("+s+")");switch(o.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,a);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,a);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 x(e){return e.components}function v(e){return Array.from(e.geometryReferences)}function b(e){return Array.from(e.originalFeatureReferences)}export{m as ExpressionsManager};
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,m=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,x,t)}async runOriginalFeatureDependentExpressions(e,t){return this._evaluateSpecifiedComponentsForEachFeature([e],b,t)}async runExpressionsDependentOnChangedFields(e){try{this.calculating=!0;const t=Array.from(e.changes).map(([t,r])=>this.runExpressionsDependentOnChangedFieldsForFeature([...r.keys()],t,e));await Promise.all(t)}catch(t){s.getLogger(this).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 a=new Map;for(const n of e)a.has(n)||a.set(n,this.createSccEvaluator(n,t,a,r));if(0===a.size)return;const i=[...a.values()],l={transaction:s,changedFields:o,previousOutcomes:new n},u=i.map(e=>e.evaluate(l));await Promise.all(u)}createSccEvaluator(e,t,r,s){const a=new g(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))}await a(Promise.all(s),this._abortController)}catch(o){s.getLogger(this).error(o),this.expressionEvaluationFailed=!0}finally{this.calculating=!1}}};e([i()],m.prototype,"calculating",void 0),e([i({constructOnly:!0})],m.prototype,"arcadeContext",void 0),e([i()],m.prototype,"_abortController",void 0),e([i()],m.prototype,"layerExpressionsModelMap",void 0),e([i()],m.prototype,"evaluatedExpressions",void 0),e([i()],m.prototype,"expressionEvaluationFailed",void 0),m=e([l("esri.widgets.BatchAttributeForm.expressions.ExpressionsManager")],m);class g{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=this.dependentEvaluators.map(t=>t.evaluate(e));await a(Promise.all(t),this._abortController);for(const a of this.scc.executors){const t=this.baseContext;if(this._abortController.signal.aborted)break;const i=this.expressionsModel.arcadeExecutorUses.get(a)??[],l=o(this.evaluatedExpressions,this.feature,()=>new n);let u=null,c=null;try{u=a.isAsync?await a.executeAsync(t.variables,t.executeContext):a.execute(t.variables,t.executeContext),c={result:u,status:"success"}}catch(s){c={error:s,status:"error"}}const{transaction:d,changedFields:f,previousOutcomes:h}=e;for(const r of i){const t=p(r),s=l.get(t);s&&h.set(t,s);const o=this.expressionsModel.elementTemplateMap.get(r.elementId);switch(r.executorPurpose){case"editable":case"required":case"text":l.set(p(r),c);break;case"value":{if("error"===c?.status)continue;const e=o.getExpressionExecutorsForLayer(this.feature.layer);let t=!0;if(e?.editableExpression&&(t=!1===l.get(p({elementId:o.elementId,executorPurpose:"editable"}))?.result),t){const e=this.feature.getAttribute(o.fieldName)??null,t=y(c.result,this.feature,o.fieldName,this.arcadeContextInfo.timeZone);t!==e&&(d.setValue(this.feature,o.fieldName,t),f.add(o.fieldName))}}break;case"visibility":l.set(p(r),c),this.expressionsModel.preserveFieldValuesWhenHidden||!0!==s?.result||!1!==c.result||"user"!==d.originActor||w(o,this.feature,l,e)}}if("error"===c?.status){const e=new Set;for(const t of i){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")}}if(e.size>0)throw new r("expression-evaluation-failed","Arcade evaluation failed ("+[...e].join(",")+")");throw new r("expression-evaluation-failed","Arcade evaluation failed ")}}}}function y(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 x(e){return Array.from(e.geometryReferences)}function b(e){return Array.from(e.originalFeatureReferences)}function w(e,t,r,s){d(e)?E(e,t,r,s):f(e)&&C(e,t,r,s)}function E(e,t,r,s){const{group:o}=e;o&&!F(o,r,s.previousOutcomes)||S(t,e,s)}function C(e,t,r,s){for(const o of e.elements)d(o)&&F(o,r,s.previousOutcomes)&&S(t,o,s)}function S(e,{fieldName:t},r){null!==e.getAttribute(t)&&r.changedFields.add(t),r.transaction.setValue(e,t,null)}function F(e,t,r){const s=p({elementId:e.elementId,executorPurpose:"visibility"}),o=r.get(s)??t.get(s);return!o||!!o.result}export{m as ExpressionsManager};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{isSome as e,addMany as t,pushIfSome as n}from"../../../core/arrayUtils.js";import{getOrCreateMapValue as o}from"../../../core/MapUtils.js";import s from"../../../core/Queue.js";import{addMany as r,last as i}from"../../../core/SetUtils.js";import{isFieldElementTemplate as a}from"../templates/support/templateUtils.js";let c=0;class l{constructor(e){this.arcadeExecutorUses=new Map,this.components=[],this.preserveFieldValuesWhenHidden=!1,this.executorMap=e.executorMap,this.preserveFieldValuesWhenHidden=!0===e.preserveFieldValuesWhenHidden,this.elementTemplateMap=new Map;for(const t of this.executorMap.keys())this.elementTemplateMap.set(t.elementId,t);this._buildDependencyGraph()}_buildDependencyGraph(){const e=x(this.executorMap),t={components:[],arcadeExecutorUses:this.arcadeExecutorUses,elementTemplatesById:new Map([...this.executorMap.keys()].map(e=>[e.elementId,e])),executorMap:this.executorMap,fieldElementTemplateMap:f(this.executorMap),fieldReferencesMap:new Map,geometryReferences:new Set,originalFeatureReferences:new Set,nextIndex:0,nodeInfoMap:e,nodeStack:new s(i),shouldConsiderVisibility:!this.preserveFieldValuesWhenHidden};for(const n of this.executorMap.keys()){const e=this.executorMap.get(n);e.editableExpression&&o(this.arcadeExecutorUses,e.editableExpression,()=>[]).push({elementId:n.elementId,executorPurpose:"editable"}),e.valueExpression&&o(this.arcadeExecutorUses,e.valueExpression,()=>[]).push({elementId:n.elementId,executorPurpose:"value"}),e.visibilityExpression&&o(this.arcadeExecutorUses,e.visibilityExpression,()=>[]).push({elementId:n.elementId,executorPurpose:"visibility"}),e.requiredExpression&&o(this.arcadeExecutorUses,e.requiredExpression,()=>[]).push({elementId:n.elementId,executorPurpose:"required"}),e.textExpressions&&e.textExpressions.forEach((e,t)=>{o(this.arcadeExecutorUses,e,()=>[]).push({elementId:n.elementId,executorPurpose:"text",textExpressionIndex:t})})}for(const n of this.arcadeExecutorUses.values())n.sort(e=>"editable"===e.executorPurpose?-1:1);for(const n of e.values())-1===n.index&&p(n,t);this.dependencyGraphComponents=m(e),this.fieldReferencesMap=h(t),this.geometryReferences=M(t.geometryReferences,e),this.originalFeatureReferences=M(t.originalFeatureReferences,e),this.components=t.components}}function p(e,t){e.index=e.lowlink=t.nextIndex++,t.nodeStack.push(e);for(const n of d(e,t))-1===n.index?(p(n,t),e.lowlink=Math.min(e.lowlink,n.lowlink)):n.index<e.index&&t.nodeStack.contains(n)&&(e.lowlink=Math.min(e.lowlink,n.index)),t.nodeStack.contains(n)||e.crossLinkNeighbors.add(n);if(e.lowlink===e.index){const n=E();for(t.components.push(n);w(t.nodeStack)>=e.index;){const e=t.nodeStack.pop();if(null!=e){e.component=n,n.executors.add(e.executor);for(const t of e.crossLinkNeighbors)null!=t.component&&n.adjacencyList.add(t.component)}}}}function d({executor:t},n){const s=new Set;for(const e of t.fieldsUsed){const i=e.toLowerCase();o(n.fieldReferencesMap,i,()=>new Set).add(t),r(s,u(i,n))}t.geometryUsed&&n.geometryReferences.add(t),t.variablesUsed.includes("$originalfeature")&&n.originalFeatureReferences.add(t);const i=n.arcadeExecutorUses.get(t)?.filter(e=>"value"===e.executorPurpose)??[];for(const e of i){const o=n.executorMap.get(n.elementTemplatesById.get(e.elementId));o?.editableExpression&&o.editableExpression!==t&&s.add(o.editableExpression)}return Array.from(s).map(e=>n.nodeInfoMap.get(e)).filter(e)}function u(e,{executorMap:t,fieldElementTemplateMap:o,shouldConsiderVisibility:s}){const r=[],i=o.get(e);if(null==i)return r;const a=t.get(i);if(null==a)return r;if(n(r,a.editableExpression),n(r,a.valueExpression),s){n(r,a.visibilityExpression);const{group:e}=i;if(null!=e){const o=t.get(e)?.visibilityExpression;n(r,o)}}return r}function f(e){const t=new Map;for(const n of e.keys())a(n)&&t.set(n.fieldName.toLowerCase(),n);return t}function x(n){const o=Array.from(n.values()).filter(e),s=new Set(o.flatMap(e=>{const{textExpressions:n,...o}=e,s=[];return n?.length&&t(s,n),t(s,Object.values(o)),s})),r=Array.from(s).map(e=>({component:null,crossLinkNeighbors:new Set,executor:e,index:-1,lowlink:-1,onStack:!1}));return new Map(r.map(e=>[e.executor,e]))}function m(e){return new Map([...e.values()].map(({component:e,executor:t})=>[t,e]))}function h({fieldReferencesMap:e,nodeInfoMap:t}){const n=new Map;for(const[o,s]of e.entries())n.set(o,M(s,t));return n}function M(e,t){const n=new Set;for(const o of e){const e=t.get(o);e?.component&&n.add(e.component)}return n}function E(){c++;const e=c.toString();return{executors:new Set,adjacencyList:new Set,componentId:e}}function w(e){return e.peek()?.index??-1}export{l as ExpressionsModel,d as getDirectDependencies};
2
+ import{isSome as e,addMany as t,pushIfSome as n}from"../../../core/arrayUtils.js";import{getOrCreateMapValue as s}from"../../../core/MapUtils.js";import o from"../../../core/Queue.js";import{addMany as r,last as i}from"../../../core/SetUtils.js";import{isFieldElementTemplate as a}from"../templates/support/templateUtils.js";let c=0;class l{constructor(e){this.arcadeExecutorUses=new Map,this.components=[],this.preserveFieldValuesWhenHidden=!1,this.executorMap=e.executorMap,this.preserveFieldValuesWhenHidden=!0===e.preserveFieldValuesWhenHidden,this.elementTemplateMap=new Map;for(const t of this.executorMap.keys())this.elementTemplateMap.set(t.elementId,t);this._buildDependencyGraph()}_buildDependencyGraph(){const e=f(this.executorMap),t={components:[],arcadeExecutorUses:this.arcadeExecutorUses,elementTemplatesById:new Map([...this.executorMap.keys()].map(e=>[e.elementId,e])),executorMap:this.executorMap,fieldElementTemplateMap:x(this.executorMap),fieldReferencesMap:new Map,geometryReferences:new Set,originalFeatureReferences:new Set,nextIndex:0,nodeInfoMap:e,nodeStack:new o(i),shouldConsiderVisibility:!this.preserveFieldValuesWhenHidden};for(const n of this.executorMap.keys()){const e=this.executorMap.get(n);null!=e&&(e.editableExpression&&s(this.arcadeExecutorUses,e.editableExpression,()=>[]).push({elementId:n.elementId,executorPurpose:"editable"}),e.valueExpression&&s(this.arcadeExecutorUses,e.valueExpression,()=>[]).push({elementId:n.elementId,executorPurpose:"value"}),e.visibilityExpression&&s(this.arcadeExecutorUses,e.visibilityExpression,()=>[]).push({elementId:n.elementId,executorPurpose:"visibility"}),e.requiredExpression&&s(this.arcadeExecutorUses,e.requiredExpression,()=>[]).push({elementId:n.elementId,executorPurpose:"required"}),e.textExpressions&&e.textExpressions.forEach((e,t)=>{s(this.arcadeExecutorUses,e,()=>[]).push({elementId:n.elementId,executorPurpose:"text",textExpressionIndex:t})}))}for(const n of this.arcadeExecutorUses.values())n.sort(e=>"editable"===e.executorPurpose?-1:1);for(const n of e.values())-1===n.index&&p(n,t);this.dependencyGraphComponents=m(e),this.fieldReferencesMap=h(t),this.geometryReferences=M(t.geometryReferences,e),this.originalFeatureReferences=M(t.originalFeatureReferences,e),this.components=t.components}}function p(e,t){e.index=e.lowlink=t.nextIndex++,t.nodeStack.push(e);for(const n of d(e,t))-1===n.index?(p(n,t),e.lowlink=Math.min(e.lowlink,n.lowlink)):n.index<e.index&&t.nodeStack.contains(n)&&(e.lowlink=Math.min(e.lowlink,n.index)),t.nodeStack.contains(n)||e.crossLinkNeighbors.add(n);if(e.lowlink===e.index){const n=E();for(t.components.push(n);y(t.nodeStack)>=e.index;){const e=t.nodeStack.pop();if(null!=e){e.component=n,n.executors.add(e.executor);for(const t of e.crossLinkNeighbors)null!=t.component&&n.adjacencyList.add(t.component)}}}}function d({executor:t},n){const o=new Set;for(const e of t.fieldsUsed){const i=e.toLowerCase();s(n.fieldReferencesMap,i,()=>new Set).add(t),r(o,u(i,n))}t.geometryUsed&&n.geometryReferences.add(t),t.variablesUsed.includes("$originalfeature")&&n.originalFeatureReferences.add(t);const i=n.arcadeExecutorUses.get(t)??[];for(const e of i)switch(e.executorPurpose){case"value":{const s=n.executorMap.get(n.elementTemplatesById.get(e.elementId));s?.editableExpression&&s.editableExpression!==t&&o.add(s.editableExpression);break}case"visibility":{const t=n.elementTemplatesById.get(e.elementId);if(n.shouldConsiderVisibility&&t&&a(t)){const e=t.group,s=e?n.executorMap.get(e):null;s?.visibilityExpression&&o.add(s.visibilityExpression)}break}}return Array.from(o).map(e=>n.nodeInfoMap.get(e)).filter(e)}function u(e,{executorMap:t,fieldElementTemplateMap:s,shouldConsiderVisibility:o}){const r=[],i=s.get(e);if(null==i)return r;const a=t.get(i);if(null==a)return r;if(n(r,a.editableExpression),n(r,a.valueExpression),o){n(r,a.visibilityExpression);const{group:e}=i;if(null!=e){const s=t.get(e)?.visibilityExpression;n(r,s)}}return r}function x(e){const t=new Map;for(const n of e.keys())a(n)&&t.set(n.fieldName.toLowerCase(),n);return t}function f(n){const s=Array.from(n.values()).filter(e),o=new Set(s.flatMap(e=>{const{textExpressions:n,...s}=e,o=[];return n?.length&&t(o,n),t(o,Object.values(s)),o})),r=Array.from(o).map(e=>({component:null,crossLinkNeighbors:new Set,executor:e,index:-1,lowlink:-1,onStack:!1}));return new Map(r.map(e=>[e.executor,e]))}function m(e){return new Map([...e.values()].map(({component:e,executor:t})=>[t,e]))}function h({fieldReferencesMap:e,nodeInfoMap:t}){const n=new Map;for(const[s,o]of e.entries())n.set(s,M(o,t));return n}function M(e,t){const n=new Set;for(const s of e){const e=t.get(s);e?.component&&n.add(e.component)}return n}function E(){c++;const e=c.toString();return{executors:new Set,adjacencyList:new Set,componentId:e}}function y(e){return e.peek()?.index??-1}export{l as ExpressionsModel,d as getDirectDependencies};