@arcgis/core 5.1.0-next.128 → 5.1.0-next.129

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 (424) hide show
  1. package/assets/esri/core/t9n/Units_ar.json +1 -1
  2. package/assets/esri/core/t9n/Units_bg.json +1 -1
  3. package/assets/esri/core/t9n/Units_bs.json +1 -1
  4. package/assets/esri/core/t9n/Units_ca.json +1 -1
  5. package/assets/esri/core/t9n/Units_cs.json +1 -1
  6. package/assets/esri/core/t9n/Units_da.json +1 -1
  7. package/assets/esri/core/t9n/Units_de.json +1 -1
  8. package/assets/esri/core/t9n/Units_el.json +1 -1
  9. package/assets/esri/core/t9n/Units_es.json +1 -1
  10. package/assets/esri/core/t9n/Units_et.json +1 -1
  11. package/assets/esri/core/t9n/Units_fi.json +1 -1
  12. package/assets/esri/core/t9n/Units_fr.json +1 -1
  13. package/assets/esri/core/t9n/Units_he.json +1 -1
  14. package/assets/esri/core/t9n/Units_hr.json +1 -1
  15. package/assets/esri/core/t9n/Units_hu.json +1 -1
  16. package/assets/esri/core/t9n/Units_id.json +1 -1
  17. package/assets/esri/core/t9n/Units_it.json +1 -1
  18. package/assets/esri/core/t9n/Units_ja.json +1 -1
  19. package/assets/esri/core/t9n/Units_ko.json +1 -1
  20. package/assets/esri/core/t9n/Units_lt.json +1 -1
  21. package/assets/esri/core/t9n/Units_lv.json +1 -1
  22. package/assets/esri/core/t9n/Units_nl.json +1 -1
  23. package/assets/esri/core/t9n/Units_no.json +1 -1
  24. package/assets/esri/core/t9n/Units_pl.json +1 -1
  25. package/assets/esri/core/t9n/Units_pt-BR.json +1 -1
  26. package/assets/esri/core/t9n/Units_pt-PT.json +1 -1
  27. package/assets/esri/core/t9n/Units_ro.json +1 -1
  28. package/assets/esri/core/t9n/Units_ru.json +1 -1
  29. package/assets/esri/core/t9n/Units_sk.json +1 -1
  30. package/assets/esri/core/t9n/Units_sl.json +1 -1
  31. package/assets/esri/core/t9n/Units_sr.json +1 -1
  32. package/assets/esri/core/t9n/Units_sv.json +1 -1
  33. package/assets/esri/core/t9n/Units_th.json +1 -1
  34. package/assets/esri/core/t9n/Units_tr.json +1 -1
  35. package/assets/esri/core/t9n/Units_uk.json +1 -1
  36. package/assets/esri/core/t9n/Units_vi.json +1 -1
  37. package/assets/esri/core/t9n/Units_zh-CN.json +1 -1
  38. package/assets/esri/core/t9n/Units_zh-HK.json +1 -1
  39. package/assets/esri/core/t9n/Units_zh-TW.json +1 -1
  40. package/assets/esri/core/workers/RemoteClient.js +1 -1
  41. package/assets/esri/core/workers/chunks/0418b5c9d06f3585c035.js +2 -0
  42. package/assets/esri/core/workers/chunks/0e94786db78770868c63.js +2 -0
  43. package/assets/esri/core/workers/chunks/{81e3bd1a0634ddc2b833.js → 0f10d7d592c36ee2d1ea.js} +1 -1
  44. package/assets/esri/core/workers/chunks/{07ca020796c57cefda62.js → 10b668186063770d63bd.js} +1 -1
  45. package/assets/esri/core/workers/chunks/152193072c9d3487b47a.js +1 -0
  46. package/assets/esri/core/workers/chunks/1d2609ce6220b5af5526.js +1 -0
  47. package/assets/esri/core/workers/chunks/{45b560ca01fb566ba560.js → 2a8d791aef3123e6a3c4.js} +1 -1
  48. package/assets/esri/core/workers/chunks/{0e774f14ba274832f390.js → 2f5970e87e1e77f8362b.js} +1 -1
  49. package/assets/esri/core/workers/chunks/317bf48a4d513a9a2ff3.js +2 -0
  50. package/assets/esri/core/workers/chunks/33838536a7436b1d449e.js +1 -0
  51. package/assets/esri/core/workers/chunks/{6144f59bc0ba153a82d3.js → 395736b49abaaa1c3405.js} +1 -1
  52. package/assets/esri/core/workers/chunks/3b74749db78bcba2bc16.js +1 -0
  53. package/assets/esri/core/workers/chunks/3d4ad7c728e02aa90551.js +1 -0
  54. package/assets/esri/core/workers/chunks/{4a9e34fe9a16b1850876.js → 4d43619c73721946441b.js} +1 -1
  55. package/assets/esri/core/workers/chunks/{0a1037fdc8c7bf8d0e7e.js → 5481af25fd46914498df.js} +1 -1
  56. package/assets/esri/core/workers/chunks/{67bf361d0b5cfd6b53da.js → 609edb4da427ec37bcf7.js} +1 -1
  57. package/assets/esri/core/workers/chunks/60d4a3f770bb1e01cd10.js +1 -0
  58. package/assets/esri/core/workers/chunks/{8570d1c7159b5a84d56c.js → 6a54dddafb6763bf287e.js} +1 -1
  59. package/assets/esri/core/workers/chunks/{9fd61a387bd6603da299.js → 6af021050d5d04be7a20.js} +1 -1
  60. package/assets/esri/core/workers/chunks/{8244b74e9c3a30d8d2f6.js → 7361ca78a605eda41a2f.js} +2 -2
  61. package/assets/esri/core/workers/chunks/{f27c7d5cb0937fe50acf.js → 7a997ac153181a8f71ef.js} +1 -1
  62. package/assets/esri/core/workers/chunks/{f5f9f21c23c51e35ae65.js → 84a0bb53fcbd99b5aa0c.js} +1 -1
  63. package/assets/esri/core/workers/chunks/{f25bb204cf6727f6fdef.js → a0876a52a3c2ad849370.js} +1 -1
  64. package/assets/esri/core/workers/chunks/{0fe57b2d06368d3f68c9.js → a1509e2e7809b6754b4f.js} +1 -1
  65. package/assets/esri/core/workers/chunks/{183b7664c68babd90fc8.js → aac27340f93ab69f3a9c.js} +1 -1
  66. package/assets/esri/core/workers/chunks/{c8460bdf60aca749ed05.js → ac16016964be3b684e98.js} +1 -1
  67. package/assets/esri/core/workers/chunks/{96f58e0157b960f6ee22.js → b076e0ca68ea80bc2559.js} +1 -1
  68. package/assets/esri/core/workers/chunks/{1b07d7656ffcf53cba2b.js → b5017e83a99a8051f212.js} +1 -1
  69. package/assets/esri/core/workers/chunks/bb012e02ae197bd1d9de.js +1 -0
  70. package/assets/esri/core/workers/chunks/bc893c95c0ab7d4bb91e.js +1 -0
  71. package/assets/esri/core/workers/chunks/bf67e0f6064fb9d94ac8.js +1 -0
  72. package/assets/esri/core/workers/chunks/{309fcc46da0b4393960e.js → d2e94ecf08a56dd43311.js} +1 -1
  73. package/assets/esri/core/workers/chunks/{bd36c57dd0cd28dee55f.js → d7acbc2ddff4cee8a465.js} +1 -1
  74. package/assets/esri/core/workers/chunks/{c030cdb4cdb08cb51501.js → d8242cf6fec7c7bb614c.js} +4 -5
  75. package/assets/esri/core/workers/chunks/{d97c0c18202b8c578f8c.js → e5471373f89fd7cb9844.js} +1 -1
  76. package/assets/esri/core/workers/chunks/f321eaf3390ab443b14c.js +1 -0
  77. package/assets/esri/core/workers/chunks/{dada22a4350e9ddaf850.js → f64241d613f56fbcd981.js} +1 -1
  78. package/assets/esri/core/workers/chunks/{ac5032253c752768021b.js → fc4641f3c93f43c8c193.js} +2 -2
  79. package/assets/esri/core/workers/chunks/fc73de97c618ca11eacb.js +1 -0
  80. package/assets/esri/libs/parquet/pkg/bundle_bg.wasm +0 -0
  81. package/assets/esri/themes/base/widgets/_BatchAttributeForm.scss +62 -90
  82. package/assets/esri/themes/base/widgets/_OrientedImageryViewer.scss +0 -2
  83. package/assets/esri/themes/dark/main.css +1 -1
  84. package/assets/esri/themes/light/main.css +1 -1
  85. package/assets/esri/themes/light/view.css +1 -1
  86. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_ar.json +1 -1
  87. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_bg.json +1 -1
  88. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_bs.json +1 -1
  89. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_ca.json +1 -1
  90. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_cs.json +1 -1
  91. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_da.json +1 -1
  92. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_de.json +1 -1
  93. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_el.json +1 -1
  94. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_es.json +1 -1
  95. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_et.json +1 -1
  96. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_fi.json +1 -1
  97. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_fr.json +1 -1
  98. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_he.json +1 -1
  99. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_hr.json +1 -1
  100. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_hu.json +1 -1
  101. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_id.json +1 -1
  102. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_it.json +1 -1
  103. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_ja.json +1 -1
  104. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_ko.json +1 -1
  105. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_lt.json +1 -1
  106. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_lv.json +1 -1
  107. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_nl.json +1 -1
  108. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_no.json +1 -1
  109. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_pl.json +1 -1
  110. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_pt-BR.json +1 -1
  111. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_pt-PT.json +1 -1
  112. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_ro.json +1 -1
  113. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_ru.json +1 -1
  114. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_sk.json +1 -1
  115. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_sl.json +1 -1
  116. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_sr.json +1 -1
  117. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_sv.json +1 -1
  118. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_th.json +1 -1
  119. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_tr.json +1 -1
  120. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_uk.json +1 -1
  121. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_vi.json +1 -1
  122. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_zh-CN.json +1 -1
  123. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_zh-HK.json +1 -1
  124. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_zh-TW.json +1 -1
  125. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_ar.json +1 -1
  126. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_bg.json +1 -1
  127. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_bs.json +1 -1
  128. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_ca.json +1 -1
  129. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_cs.json +1 -1
  130. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_da.json +1 -1
  131. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_de.json +1 -1
  132. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_el.json +1 -1
  133. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_es.json +1 -1
  134. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_et.json +1 -1
  135. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_fi.json +1 -1
  136. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_fr.json +1 -1
  137. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_he.json +1 -1
  138. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_hr.json +1 -1
  139. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_hu.json +1 -1
  140. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_id.json +1 -1
  141. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_it.json +1 -1
  142. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_ja.json +1 -1
  143. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_ko.json +1 -1
  144. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_lt.json +1 -1
  145. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_lv.json +1 -1
  146. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_nl.json +1 -1
  147. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_no.json +1 -1
  148. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_pl.json +1 -1
  149. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_pt-BR.json +1 -1
  150. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_pt-PT.json +1 -1
  151. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_ro.json +1 -1
  152. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_ru.json +1 -1
  153. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_sk.json +1 -1
  154. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_sl.json +1 -1
  155. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_sr.json +1 -1
  156. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_sv.json +1 -1
  157. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_th.json +1 -1
  158. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_tr.json +1 -1
  159. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_uk.json +1 -1
  160. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_vi.json +1 -1
  161. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_zh-CN.json +1 -1
  162. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_zh-HK.json +1 -1
  163. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_zh-TW.json +1 -1
  164. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ar.json +1 -1
  165. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_bg.json +1 -1
  166. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_bs.json +1 -1
  167. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ca.json +1 -1
  168. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_cs.json +1 -1
  169. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_da.json +1 -1
  170. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_de.json +1 -1
  171. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_el.json +1 -1
  172. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_es.json +1 -1
  173. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_et.json +1 -1
  174. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_fi.json +1 -1
  175. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_fr.json +1 -1
  176. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_he.json +1 -1
  177. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_hr.json +1 -1
  178. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_hu.json +1 -1
  179. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_id.json +1 -1
  180. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_it.json +1 -1
  181. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ja.json +1 -1
  182. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ko.json +1 -1
  183. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_lt.json +1 -1
  184. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_lv.json +1 -1
  185. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_nl.json +1 -1
  186. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_no.json +1 -1
  187. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_pl.json +1 -1
  188. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_pt-BR.json +1 -1
  189. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_pt-PT.json +1 -1
  190. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ro.json +1 -1
  191. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ru.json +1 -1
  192. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_sk.json +1 -1
  193. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_sl.json +1 -1
  194. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_sr.json +1 -1
  195. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_sv.json +1 -1
  196. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_th.json +1 -1
  197. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_tr.json +1 -1
  198. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_uk.json +1 -1
  199. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_vi.json +1 -1
  200. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_zh-CN.json +1 -1
  201. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_zh-HK.json +1 -1
  202. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_zh-TW.json +1 -1
  203. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ar.json +1 -1
  204. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_bg.json +1 -1
  205. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_bs.json +1 -1
  206. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ca.json +1 -1
  207. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_cs.json +1 -1
  208. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_da.json +1 -1
  209. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_de.json +1 -1
  210. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_el.json +1 -1
  211. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_es.json +1 -1
  212. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_et.json +1 -1
  213. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_fi.json +1 -1
  214. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_fr.json +1 -1
  215. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_he.json +1 -1
  216. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_hr.json +1 -1
  217. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_hu.json +1 -1
  218. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_id.json +1 -1
  219. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_it.json +1 -1
  220. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ja.json +1 -1
  221. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ko.json +1 -1
  222. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_lt.json +1 -1
  223. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_lv.json +1 -1
  224. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_nl.json +1 -1
  225. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_no.json +1 -1
  226. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_pl.json +1 -1
  227. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_pt-BR.json +1 -1
  228. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_pt-PT.json +1 -1
  229. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ro.json +1 -1
  230. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ru.json +1 -1
  231. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sk.json +1 -1
  232. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sl.json +1 -1
  233. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sr.json +1 -1
  234. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sv.json +1 -1
  235. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_th.json +1 -1
  236. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_tr.json +1 -1
  237. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_uk.json +1 -1
  238. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_vi.json +1 -1
  239. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_zh-CN.json +1 -1
  240. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_zh-HK.json +1 -1
  241. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_zh-TW.json +1 -1
  242. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ar.json +1 -1
  243. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_bg.json +1 -1
  244. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_bs.json +1 -1
  245. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ca.json +1 -1
  246. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_cs.json +1 -1
  247. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_da.json +1 -1
  248. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_de.json +1 -1
  249. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_el.json +1 -1
  250. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_es.json +1 -1
  251. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_et.json +1 -1
  252. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_fi.json +1 -1
  253. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_fr.json +1 -1
  254. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_he.json +1 -1
  255. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_hr.json +1 -1
  256. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_hu.json +1 -1
  257. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_id.json +1 -1
  258. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_it.json +1 -1
  259. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ja.json +1 -1
  260. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ko.json +1 -1
  261. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_lt.json +1 -1
  262. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_lv.json +1 -1
  263. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_nl.json +1 -1
  264. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_no.json +1 -1
  265. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pl.json +1 -1
  266. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pt-BR.json +1 -1
  267. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pt-PT.json +1 -1
  268. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ro.json +1 -1
  269. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ru.json +1 -1
  270. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sk.json +1 -1
  271. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sl.json +1 -1
  272. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sr.json +1 -1
  273. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sv.json +1 -1
  274. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_th.json +1 -1
  275. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_tr.json +1 -1
  276. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_uk.json +1 -1
  277. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_vi.json +1 -1
  278. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-CN.json +1 -1
  279. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-HK.json +1 -1
  280. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-TW.json +1 -1
  281. package/assets/esri/widgets/VideoPlayer/t9n/VideoPlayer_ar.json +1 -1
  282. package/assets/esri/widgets/VideoPlayer/t9n/VideoPlayer_bg.json +1 -1
  283. package/assets/esri/widgets/VideoPlayer/t9n/VideoPlayer_bs.json +1 -1
  284. package/assets/esri/widgets/VideoPlayer/t9n/VideoPlayer_ca.json +1 -1
  285. package/assets/esri/widgets/VideoPlayer/t9n/VideoPlayer_cs.json +1 -1
  286. package/assets/esri/widgets/VideoPlayer/t9n/VideoPlayer_da.json +1 -1
  287. package/assets/esri/widgets/VideoPlayer/t9n/VideoPlayer_de.json +1 -1
  288. package/assets/esri/widgets/VideoPlayer/t9n/VideoPlayer_el.json +1 -1
  289. package/assets/esri/widgets/VideoPlayer/t9n/VideoPlayer_es.json +1 -1
  290. package/assets/esri/widgets/VideoPlayer/t9n/VideoPlayer_et.json +1 -1
  291. package/assets/esri/widgets/VideoPlayer/t9n/VideoPlayer_fi.json +1 -1
  292. package/assets/esri/widgets/VideoPlayer/t9n/VideoPlayer_fr.json +1 -1
  293. package/assets/esri/widgets/VideoPlayer/t9n/VideoPlayer_he.json +1 -1
  294. package/assets/esri/widgets/VideoPlayer/t9n/VideoPlayer_hr.json +1 -1
  295. package/assets/esri/widgets/VideoPlayer/t9n/VideoPlayer_hu.json +1 -1
  296. package/assets/esri/widgets/VideoPlayer/t9n/VideoPlayer_id.json +1 -1
  297. package/assets/esri/widgets/VideoPlayer/t9n/VideoPlayer_it.json +1 -1
  298. package/assets/esri/widgets/VideoPlayer/t9n/VideoPlayer_ja.json +1 -1
  299. package/assets/esri/widgets/VideoPlayer/t9n/VideoPlayer_ko.json +1 -1
  300. package/assets/esri/widgets/VideoPlayer/t9n/VideoPlayer_lt.json +1 -1
  301. package/assets/esri/widgets/VideoPlayer/t9n/VideoPlayer_lv.json +1 -1
  302. package/assets/esri/widgets/VideoPlayer/t9n/VideoPlayer_nl.json +1 -1
  303. package/assets/esri/widgets/VideoPlayer/t9n/VideoPlayer_no.json +1 -1
  304. package/assets/esri/widgets/VideoPlayer/t9n/VideoPlayer_pl.json +1 -1
  305. package/assets/esri/widgets/VideoPlayer/t9n/VideoPlayer_pt-BR.json +1 -1
  306. package/assets/esri/widgets/VideoPlayer/t9n/VideoPlayer_pt-PT.json +1 -1
  307. package/assets/esri/widgets/VideoPlayer/t9n/VideoPlayer_ro.json +1 -1
  308. package/assets/esri/widgets/VideoPlayer/t9n/VideoPlayer_ru.json +1 -1
  309. package/assets/esri/widgets/VideoPlayer/t9n/VideoPlayer_sk.json +1 -1
  310. package/assets/esri/widgets/VideoPlayer/t9n/VideoPlayer_sl.json +1 -1
  311. package/assets/esri/widgets/VideoPlayer/t9n/VideoPlayer_sr.json +1 -1
  312. package/assets/esri/widgets/VideoPlayer/t9n/VideoPlayer_sv.json +1 -1
  313. package/assets/esri/widgets/VideoPlayer/t9n/VideoPlayer_th.json +1 -1
  314. package/assets/esri/widgets/VideoPlayer/t9n/VideoPlayer_tr.json +1 -1
  315. package/assets/esri/widgets/VideoPlayer/t9n/VideoPlayer_uk.json +1 -1
  316. package/assets/esri/widgets/VideoPlayer/t9n/VideoPlayer_vi.json +1 -1
  317. package/assets/esri/widgets/VideoPlayer/t9n/VideoPlayer_zh-CN.json +1 -1
  318. package/assets/esri/widgets/VideoPlayer/t9n/VideoPlayer_zh-HK.json +1 -1
  319. package/assets/esri/widgets/VideoPlayer/t9n/VideoPlayer_zh-TW.json +1 -1
  320. package/chunks/GlowComposition.glsl.js +1 -1
  321. package/chunks/bundle2.js +1 -1
  322. package/chunks/languageUtils.js +1 -1
  323. package/config.js +1 -1
  324. package/core/screenUtils.js +1 -1
  325. package/editing/types.d.ts +2 -2
  326. package/form/elements/UtilityNetworkAssociationsElement.d.ts +0 -1
  327. package/geometry/support/aaBoundingRect.js +1 -1
  328. package/kernel.js +1 -1
  329. package/layers/Lyr3DWasmPerSceneView.js +1 -1
  330. package/layers/graphics/applyEditsUtils.js +1 -1
  331. package/layers/graphics/data/QueryEngine.js +1 -1
  332. package/layers/graphics/sources/parquet/ParquetFileStatistics.js +1 -1
  333. package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
  334. package/layers/graphics/sources/support/parquetIdUtils.js +1 -1
  335. package/layers/support/layerUtils.js +1 -1
  336. package/layers/support/parquetUtils.js +1 -1
  337. package/package.json +2 -2
  338. package/popup/Feature.d.ts +57 -6
  339. package/popup/Features.d.ts +86 -7
  340. package/popup/content/UtilityNetworkAssociationsContent.d.ts +0 -1
  341. package/popup/support/UtilityNetworkAssociationType.d.ts +0 -1
  342. package/support/revision.js +1 -1
  343. package/views/2d/analysis/AreaMeasurement/AreaMeasurementTool.js +1 -1
  344. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  345. package/views/2d/engine/webgl/util/AnnotationMatcher.js +1 -1
  346. package/views/2d/layers/support/annodime/annotationGraphic.js +1 -1
  347. package/views/2d/layers/support/annodime/cimAnnotations.js +1 -1
  348. package/views/2d/layers/support/annodime/utils.js +1 -1
  349. package/views/2d/support/hitTestUtils.js +1 -1
  350. package/views/2d/unitBezier.js +1 -1
  351. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  352. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  353. package/views/3d/layers/graphics/Graphics3DSymbol.js +1 -1
  354. package/views/3d/layers/graphics/SymbolComplexity.js +1 -1
  355. package/views/3d/layers/graphics/defaultSymbolComplexity.js +1 -1
  356. package/views/3d/support/QualityProfile.js +1 -1
  357. package/views/3d/webgl-engine/collections/Component/Material/ComponentTechnique.js +1 -1
  358. package/views/3d/webgl-engine/core/shaderLibrary/ShaderOutput.js +1 -1
  359. package/views/3d/webgl-engine/core/shaderLibrary/attributes/PathEvaluate.glsl.js +14 -6
  360. package/views/3d/webgl-engine/core/shaderLibrary/attributes/PathVertexPosition.glsl.js +2 -1
  361. package/views/3d/webgl-engine/effects/glow/Glow.js +1 -1
  362. package/views/3d/webgl-engine/lib/OrderIndependentTransparency.js +1 -1
  363. package/views/3d/webgl-engine/lib/PathEvaluator.js +1 -1
  364. package/views/3d/webgl-engine/materials/PathTechnique.js +1 -1
  365. package/views/3d/webgl-engine/materials/PolygonOffset.js +1 -1
  366. package/views/3d/webgl-engine/shaders/HUDMaterialTechnique.js +1 -1
  367. package/views/3d/webgl-engine/shaders/OutputColorHighlightOLID.glsl.js +9 -10
  368. package/views/3d/webgl-engine/shaders/ditherNoise.glsl.js +1 -1
  369. package/views/LinkChartView.d.ts +3 -1
  370. package/views/View2D.d.ts +3 -1
  371. package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
  372. package/widgets/BatchAttributeForm/attachmentUtils.d.ts +9 -0
  373. package/widgets/BatchAttributeForm/attachmentUtils.js +1 -1
  374. package/widgets/BatchAttributeForm/css.js +1 -1
  375. package/widgets/BatchAttributeForm/inputs/AttachmentElementInput.js +1 -1
  376. package/widgets/BatchAttributeForm/inputs/FieldInput.js +1 -1
  377. package/widgets/BatchAttributeForm/inputs/InputBase.js +1 -1
  378. package/widgets/BatchAttributeForm/inputs/RelationshipElementInput.js +1 -1
  379. package/widgets/BatchAttributeForm/inputs/support/attachmentValidationCriteriaState.d.ts +1 -1
  380. package/widgets/BatchAttributeForm/types.d.ts +76 -16
  381. package/widgets/BatchAttributeForm.js +1 -1
  382. package/widgets/Editor/Edits.js +1 -1
  383. package/widgets/Editor/UpdateFeatureWorkflow.js +1 -1
  384. package/widgets/Editor/UpdateFeaturesWorkflow.js +1 -1
  385. package/widgets/Editor/support/SketchController.js +1 -1
  386. package/widgets/Editor/workflowUtils.js +1 -1
  387. package/widgets/Feature/FeatureViewModel.d.ts +0 -1
  388. package/widgets/FeatureForm/UtilityNetworkAssociationInput.d.ts +0 -1
  389. package/widgets/Features/FeaturesViewModel.d.ts +0 -1
  390. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  391. package/widgets/OrientedImageryViewer.js +1 -1
  392. package/widgets/Sketch/SketchViewModel.d.ts +10 -1
  393. package/widgets/Sketch/SketchViewModel.js +1 -1
  394. package/assets/components/assets/icon/orientedImageryFullSuperimpose16.json +0 -1
  395. package/assets/components/assets/icon/orientedImageryFullSuperimpose24.json +0 -1
  396. package/assets/components/assets/icon/orientedImageryFullSuperimpose32.json +0 -1
  397. package/assets/components/assets/icon/orientedImageryHalfSuperimpose16.json +0 -1
  398. package/assets/components/assets/icon/orientedImageryHalfSuperimpose24.json +0 -1
  399. package/assets/components/assets/icon/orientedImageryHalfSuperimpose32.json +0 -1
  400. package/assets/components/assets/icon/orientedImagerySceneOnly16.json +0 -1
  401. package/assets/components/assets/icon/orientedImagerySceneOnly24.json +0 -1
  402. package/assets/components/assets/icon/orientedImagerySceneOnly32.json +0 -1
  403. package/assets/components/assets/icon/parquetFeatureLayer16.json +0 -1
  404. package/assets/components/assets/icon/parquetFeatureLayer24.json +0 -1
  405. package/assets/components/assets/icon/parquetFeatureLayer32.json +0 -1
  406. package/assets/esri/core/workers/chunks/02a94efda13d9b683272.js +0 -1
  407. package/assets/esri/core/workers/chunks/0acf8df4e9556d05136c.js +0 -1
  408. package/assets/esri/core/workers/chunks/0ded58ccb83f624f1460.js +0 -1
  409. package/assets/esri/core/workers/chunks/1d91e69483c3ceec3c4d.js +0 -1
  410. package/assets/esri/core/workers/chunks/42e5e00610f281ca8ffa.js +0 -1
  411. package/assets/esri/core/workers/chunks/7a1f65511bce26e6b770.js +0 -1
  412. package/assets/esri/core/workers/chunks/86cad656a6a473982109.js +0 -2
  413. package/assets/esri/core/workers/chunks/a4cdcb0b06242a95722a.js +0 -1
  414. package/assets/esri/core/workers/chunks/be8340d5ae5e662c2671.js +0 -1
  415. package/assets/esri/core/workers/chunks/c216cd5d6b5d4fe4bab3.js +0 -2
  416. package/assets/esri/core/workers/chunks/d1ccc5f2d8892328ab01.js +0 -2
  417. package/assets/esri/core/workers/chunks/d9d0a07245ee5117d2a0.js +0 -1
  418. package/assets/esri/core/workers/chunks/ead719bff4a94816a42e.js +0 -1
  419. package/assets/esri/core/workers/chunks/f116ff0121d28bbf7a23.js +0 -1
  420. /package/assets/esri/core/workers/chunks/{86cad656a6a473982109.js.LICENSE.txt → 0418b5c9d06f3585c035.js.LICENSE.txt} +0 -0
  421. /package/assets/esri/core/workers/chunks/{c216cd5d6b5d4fe4bab3.js.LICENSE.txt → 0e94786db78770868c63.js.LICENSE.txt} +0 -0
  422. /package/assets/esri/core/workers/chunks/{d1ccc5f2d8892328ab01.js.LICENSE.txt → 317bf48a4d513a9a2ff3.js.LICENSE.txt} +0 -0
  423. /package/assets/esri/core/workers/chunks/{8244b74e9c3a30d8d2f6.js.LICENSE.txt → 7361ca78a605eda41a2f.js.LICENSE.txt} +0 -0
  424. /package/assets/esri/core/workers/chunks/{ac5032253c752768021b.js.LICENSE.txt → fc4641f3c93f43c8c193.js.LICENSE.txt} +0 -0
@@ -41,6 +41,7 @@ ExtrusionFrame frame;
41
41
  vec2 profileVertex;
42
42
  vec2 profileNormal;
43
43
  vec2 rotationRight;
44
+ float maxDistance;
44
45
  float capPositionOffset;
45
46
  float capNormalOffset;
46
47
  bool isCap;
@@ -57,12 +58,12 @@ return vec2(1., 0.);
57
58
  vec2 profileVertex = pathProfileVertices[vertexInfo.sourceIndex];
58
59
  vec2 profileNormal = pathProfileNormals[vertexInfo.sourceIndex];
59
60
  float profileRotation = getProfileRotation();
60
- vec2 pathRotationRight = getPathRotationRight(${f(u,l`frame`)});
61
+ vec2 rotationRight = getPathRotationRight(${f(u,l`frame`)});
61
62
  bool isBevel = abs(profileRotation) >= angleCutoff;
62
63
 
63
64
  // determine if the current profile vertex is on the inside or outside of the rotationAxis
64
65
  // this determines if the geometry folds inwards or is bend outwards
65
- float b = dot(profileVertex, pathRotationRight);
66
+ float b = dot(profileVertex, rotationRight);
66
67
  bool isBend = b * profileRotation >= 0.;
67
68
 
68
69
  bool isBevelBend = isBevel && isBend;
@@ -82,19 +83,21 @@ return vec2(1., 0.);
82
83
  profileVertex = applyMiterStretch(
83
84
  profileVertex,
84
85
  profileRotation${f(u,l`,
85
- pathRotationRight`)}
86
+ rotationRight`)}
86
87
  );
87
88
  }
88
89
 
89
- vec2 rotationRight = isBend
90
- ? vec2(0.)
91
- : pathRotationRight * getMaxStretchDistance();
90
+ rotationRight = isBend ? vec2(0.) : rotationRight;
91
+ float maxDistance = isBend
92
+ ? 0.
93
+ : getMaxStretchDistance();
92
94
 
93
95
  return ExtrudedVertex(
94
96
  frame,
95
97
  profileVertex,
96
98
  profileNormal,
97
99
  rotationRight,
100
+ maxDistance,
98
101
  0.,
99
102
  0.,
100
103
  false
@@ -112,6 +115,7 @@ return vec2(1., 0.);
112
115
  profileVertex,
113
116
  profileNormal,
114
117
  vec2(0.),
118
+ 0.,
115
119
  profilePlaneVertexOffset,
116
120
  0.,
117
121
  true
@@ -130,6 +134,7 @@ return vec2(1., 0.);
130
134
  profileVertex,
131
135
  normal,
132
136
  vec2(0.),
137
+ 0.,
133
138
  profilePlaneOffset,
134
139
  normalOffset,
135
140
  true
@@ -149,6 +154,7 @@ frame,
149
154
  polePosition,
150
155
  poleNormal,
151
156
  vec2(0.),
157
+ 0.,
152
158
  offsetScale,
153
159
  normalOffset,
154
160
  true
@@ -179,6 +185,7 @@ frame,
179
185
  poleVertex,
180
186
  profileNormal,
181
187
  vec2(0.),
188
+ 0.,
182
189
  offsetScale * t2,
183
190
  normalOffset,
184
191
  true
@@ -218,6 +225,7 @@ true
218
225
  vec2(0.),
219
226
  0.,
220
227
  0.,
228
+ 0.,
221
229
  false
222
230
  );
223
231
  }
@@ -101,7 +101,8 @@ vec3 offset = right * profileVertex.x + up * profileVertex.y + forward * positio
101
101
  return origin + offset;
102
102
  }
103
103
  vec2 rotationRight = extrudedVertex.rotationRight;
104
- float maxDistance = length(rotationRight);`),h.code.add(u`rotationRight = maxDistance > 0.0 ? normalize(rotationRight) : vec2(0, 0);
104
+ float maxDistance = extrudedVertex.maxDistance;`),h.code.add(u`rotationRight *= size;
105
+ rotationRight = length(rotationRight) > 0.0 ? normalize(rotationRight) : vec2(0, 0);
105
106
  float rx = dot(profileVertex, rotationRight);
106
107
  if (abs(rx) > maxDistance) {
107
108
  vec2 rotationUp = vec2(-rotationRight.y, rotationRight.x);
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{releaseMaybe as t}from"../../../../../core/maybe.js";import{watch as r,syncAndInitial as i}from"../../../../../core/reactiveUtils.js";import{property as s,subclass as o}from"../../../../../core/accessorSupport/decorators.js";import{set as a}from"../../../../../core/libs/gl-matrix-2/math/vec2.js";import{length as n}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{ZEROS as l}from"../../../../../core/libs/gl-matrix-2/factories/vec4f32.js";import{getReferenceEllipsoid as h}from"../../../../../geometry/ellipsoidUtils.js";import{InternalRenderCategory as m}from"../../../webgl.js";import{TransparentEnvironment as c}from"../TransparentEnvironment.js";import{G as u}from"../../../../../chunks/GlowBlur.glsl.js";import{GlowBlurTechnique as p}from"./GlowBlurTechnique.js";import{GlowBlurTechniqueConfiguration as _}from"./GlowBlurTechniqueConfiguration.js";import{G as d,a as g,m as b}from"../../../../../chunks/GlowComposition.glsl.js";import{GlowCompositionTechnique as f}from"./GlowCompositionTechnique.js";import{GlowCompositionTechniqueConfiguration as P}from"./GlowCompositionTechniqueConfiguration.js";import{floatBlendReductionFactor as w}from"../../shaders/oitResolution.glsl.js";import{ColorAttachment1 as C,DepthStencilAttachment as T}from"../../../../webgl/enums.js";let v=class extends c{constructor(e){super(e),this.consumes={required:[m.TRANSPARENT_ENVIRONMENT,"emissive"]},this.produces=m.TRANSPARENT_ENVIRONMENT,this._scatteringFactors={realistic:new d([.8,.12,.05,.02,.01,0],1),cartographicMin:new d([.4,.18,.25,.12,.05,0],1),cartographicDefault:new d([1.17,1.08,.78,.4,.26,.11],4),cartographicMax:new d([3.59,3.9,2.46,1.4,.93,.44],13)},this._blurHorizontalConfiguration=new _,this._blurVerticalConfiguration=new _,this._compositeConfiguration=new P,this._compositionParameters=new g,this._blurParameters=new u,this._blurScalePerLod=3.06,this._logicalBlurRadius=.0037;const t=h(e.view.spatialReference);this._atmosphereRadius=t.radius+t.atmosphereHeight,this._blurVerticalConfiguration.glowStage=1}initialize(){this.addHandles([r(()=>this._updateParameters(),()=>{},i)])}_updateParameters(){this._compositionParameters.minDisperse.preset=this._preset,this.requestRender(1)}render(e){const r=e.find(({name:e})=>e===m.TRANSPARENT_ENVIRONMENT),i=r.getAttachment(C);if(!i?.attachment)return r;const s=r.getTexture(),o=r.getAttachment(T),a=this.fboCache,{fullWidth:l,fullHeight:h}=this.bindParameters.camera,c=this.renderingContext;this._compositeConfiguration.useFloatBlend=this._blurHorizontalConfiguration.useFloatBlend=this._blurVerticalConfiguration.useFloatBlend=this.bindParameters.useFloatBlend.value,this._compositionParameters.fogOpacity=this.view.stage.renderView.fog?.strength??0,this._compositionParameters.color=s,this._compositionParameters.emission=i.attachment,this._compositeConfiguration.blurEnabled=2!==this._mode;const u=this.techniques.getCompiled(p,this._blurHorizontalConfiguration),_=this.techniques.getCompiled(p,this._blurVerticalConfiguration),d=this.techniques.getCompiled(f,this._compositeConfiguration);if(!u||!_||!d)return this.requestRender(1),r;if(!this._compositeConfiguration.blurEnabled){const e=a.acquire(s.descriptor.width,s.descriptor.height,this.produces);return this._setupFBO(e,l,h),c.bindTechnique(d,this.bindParameters,this._compositionParameters),c.screen.draw(),e.attachDepth(o),e.attachColor(i,C),e}const g=this.camera,b=n(g.eye);this._compositionParameters.atmosphereC=b**2-this._atmosphereRadius**2,this._renderGlowMipMap(u,_);const P=a.acquire(s.descriptor.width,s.descriptor.height,this.produces);return P.acquireColor(C,this.bindParameters.useFloatBlend.value?8:5,"emissive glow"),this._setupFBO(P,l,h,!0),c.bindTechnique(d,this.bindParameters,this._compositionParameters),c.screen.draw(),this._compositionParameters.lodTexture=t(this._compositionParameters.lodTexture),P.attachDepth(o),P}_renderGlowMipMap(e,t){const r=this.fboCache,{fullWidth:i,fullHeight:s}=this.camera,o=this.renderingContext,n=5;this._blurParameters.input=this._compositionParameters.emission,this._blurParameters.inputScale=w,this._blurParameters.level=0,this._blurParameters.blurRadius=this._logicalBlurRadius,a(this._blurParameters.size,.5*i,.5*s);let l=Math.floor(this._blurParameters.size[0]),h=Math.floor(this._blurParameters.size[1]);const m=r.acquire(l,h,"glow horizontal",8);for(this._compositionParameters.lodTexture=r.acquire(l,h,"glow mipmap",9);l>1&&h>1&&this._blurParameters.level<n;)this._setupFBO(m,l,h),o.bindTechnique(e,this.bindParameters,this._blurParameters),o.screen.draw(),r.debugCallback?.(`glow horizontal ${this._blurParameters.level}`,m.fbo),this._blurParameters.inputScale=1,this._blurParameters.input=m.getTexture(),this._setupFBO(this._compositionParameters.lodTexture,l,h,!1,this._blurParameters.level),o.bindTechnique(t,this.bindParameters,this._blurParameters),o.screen.draw(),r.debugCallback?.(this._compositionParameters.lodTexture.name,this._compositionParameters.lodTexture.fbo),a(this._blurParameters.size,.5*l,.5*h),l=Math.floor(this._blurParameters.size[0]),h=Math.floor(this._blurParameters.size[1]),this._blurParameters.input=this._compositionParameters.lodTexture.getTexture(),this._blurParameters.blurRadius*=this._blurScalePerLod,++this._blurParameters.level;m.release(),this._compositionParameters.lodTexture.fbo.level=0}get _preset(){return 0===this._mode?this._scatteringFactors.realistic.preset:this._intensity<=.5?b(this._scatteringFactors.cartographicMin.preset,this._scatteringFactors.cartographicDefault.preset,2*this._intensity):b(this._scatteringFactors.cartographicDefault.preset,this._scatteringFactors.cartographicMax.preset,2*(this._intensity-.5))}get _mode(){return null==this.view.environment.lighting.glow?this.view.environment.atmosphereEnabled?0:2:1}get _intensity(){return this.view.environment.lighting.glow?.intensity??0}_setupFBO(e,t,r,i=!1,s=0){e.fbo.level=s;const o=this.renderingContext;o.bindFramebuffer(e.fbo),o.setViewport(0,0,t,r),o.setClearColor(0,0,0,0),o.clear(16384),i&&o.clearBuffer(1,l)}get test(){return{compositionParameters:this._compositionParameters,blurParameters:this._blurParameters,preset:this._preset,setMinDisperse:(e,t)=>{0===this._mode?this._scatteringFactors.realistic.preset[e]=t:(this._scatteringFactors.cartographicMin.preset[e]=t,this._scatteringFactors.cartographicMax.preset[e]=t)}}}};e([s()],v.prototype,"consumes",void 0),e([s()],v.prototype,"produces",void 0),v=e([o("esri.views.3d.webgl-engine.effects.glow.Glow")],v);export{v as Glow};
2
+ import{__decorate as t}from"tslib";import{releaseMaybe as e}from"../../../../../core/maybe.js";import{watch as i,syncAndInitial as r}from"../../../../../core/reactiveUtils.js";import{property as s,subclass as o}from"../../../../../core/accessorSupport/decorators.js";import{set as a}from"../../../../../core/libs/gl-matrix-2/math/vec2.js";import{length as n}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{ZEROS as h}from"../../../../../core/libs/gl-matrix-2/factories/vec4f32.js";import{getReferenceEllipsoid as l}from"../../../../../geometry/ellipsoidUtils.js";import{InternalRenderCategory as c}from"../../../webgl.js";import{TransparentEnvironment as m}from"../TransparentEnvironment.js";import{G as u}from"../../../../../chunks/GlowBlur.glsl.js";import{GlowBlurTechnique as p}from"./GlowBlurTechnique.js";import{GlowBlurTechniqueConfiguration as _}from"./GlowBlurTechniqueConfiguration.js";import{G as g,a as d,m as b}from"../../../../../chunks/GlowComposition.glsl.js";import{GlowCompositionTechnique as f}from"./GlowCompositionTechnique.js";import{GlowCompositionTechniqueConfiguration as P}from"./GlowCompositionTechniqueConfiguration.js";import{floatBlendReductionFactor as w}from"../../shaders/oitResolution.glsl.js";import{ColorAttachment1 as C,DepthStencilAttachment as T}from"../../../../webgl/enums.js";let v=class extends m{constructor(t){super(t),this.consumes={required:[c.TRANSPARENT_ENVIRONMENT,"emissive"]},this.produces=c.TRANSPARENT_ENVIRONMENT,this._scatteringFactors={realistic:new g([.8,.12,.05,.02,.01,0],1),cartographicMin:new g([.4,.18,.25,.12,.05,0],1),cartographicDefault:new g([1.17,1.08,.78,.4,.26,.11],4),cartographicMax:new g([3.59,3.9,2.46,1.4,.93,.44],13)},this._blurHorizontalConfiguration=new _,this._blurVerticalConfiguration=new _,this._compositeConfiguration=new P,this._compositionParameters=new d,this._blurParameters=new u,this._blurScalePerLod=3.06,this._logicalBlurRadius=.0037;const e=l(t.view.spatialReference);this._atmosphereRadius=e.radius+e.atmosphereHeight,this._blurVerticalConfiguration.glowStage=1}initialize(){this.addHandles([i(()=>this._updateParameters(),()=>{},r)])}_updateParameters(){this._compositionParameters.minDisperse.preset=this._preset,this.requestRender(1)}_updateConfigurations(){this._compositeConfiguration.useFloatBlend=this._blurHorizontalConfiguration.useFloatBlend=this._blurVerticalConfiguration.useFloatBlend=this.bindParameters.useFloatBlend.value,this._compositeConfiguration.blurEnabled=2!==this._mode}precompile(){this._updateConfigurations(),this._compositeConfiguration.blurEnabled&&(this.techniques.precompile(p,this._blurHorizontalConfiguration),this.techniques.precompile(p,this._blurVerticalConfiguration)),this.techniques.precompile(f,this._compositeConfiguration)}render(t){const i=t.find(({name:t})=>t===c.TRANSPARENT_ENVIRONMENT),r=i.getAttachment(C);if(!r?.attachment)return i;const s=i.getTexture(),o=i.getAttachment(T),a=this.fboCache,{fullWidth:h,fullHeight:l}=this.bindParameters.camera,m=this.renderingContext;if(this._updateConfigurations(),this._compositionParameters.fogOpacity=this.view.stage.renderView.fog?.strength??0,this._compositionParameters.color=s,this._compositionParameters.emission=r.attachment,!this._compositeConfiguration.blurEnabled){const t=a.acquire(s.descriptor.width,s.descriptor.height,this.produces);this._setupFBO(t,h,l);const e=this.techniques.get(f,this._compositeConfiguration);return m.bindTechnique(e,this.bindParameters,this._compositionParameters),m.screen.draw(),t.attachDepth(o),t.attachColor(r,C),t}const u=this.camera,p=n(u.eye);this._compositionParameters.atmosphereC=p**2-this._atmosphereRadius**2,this._renderGlowMipMap();const _=a.acquire(s.descriptor.width,s.descriptor.height,this.produces);_.acquireColor(C,this.bindParameters.useFloatBlend.value?8:5,"emissive glow"),this._setupFBO(_,h,l,!0);const g=this.techniques.get(f,this._compositeConfiguration);return m.bindTechnique(g,this.bindParameters,this._compositionParameters),m.screen.draw(),this._compositionParameters.lodTexture=e(this._compositionParameters.lodTexture),_.attachDepth(o),_}_renderGlowMipMap(){const t=this.fboCache,{fullWidth:e,fullHeight:i}=this.camera,r=this.renderingContext,s=5,o=this.techniques.get(p,this._blurHorizontalConfiguration),n=this.techniques.get(p,this._blurVerticalConfiguration);this._blurParameters.input=this._compositionParameters.emission,this._blurParameters.inputScale=w,this._blurParameters.level=0,this._blurParameters.blurRadius=this._logicalBlurRadius,a(this._blurParameters.size,.5*e,.5*i);let h=Math.floor(this._blurParameters.size[0]),l=Math.floor(this._blurParameters.size[1]);const c=t.acquire(h,l,"glow horizontal",8);for(this._compositionParameters.lodTexture=t.acquire(h,l,"glow mipmap",9);h>1&&l>1&&this._blurParameters.level<s;)this._setupFBO(c,h,l),r.bindTechnique(o,this.bindParameters,this._blurParameters),r.screen.draw(),t.debugCallback?.(`glow horizontal ${this._blurParameters.level}`,c.fbo),this._blurParameters.inputScale=1,this._blurParameters.input=c.getTexture(),this._setupFBO(this._compositionParameters.lodTexture,h,l,!1,this._blurParameters.level),r.bindTechnique(n,this.bindParameters,this._blurParameters),r.screen.draw(),t.debugCallback?.(this._compositionParameters.lodTexture.name,this._compositionParameters.lodTexture.fbo),a(this._blurParameters.size,.5*h,.5*l),h=Math.floor(this._blurParameters.size[0]),l=Math.floor(this._blurParameters.size[1]),this._blurParameters.input=this._compositionParameters.lodTexture.getTexture(),this._blurParameters.blurRadius*=this._blurScalePerLod,++this._blurParameters.level;c.release(),this._compositionParameters.lodTexture.fbo.level=0}get _preset(){return 0===this._mode?this._scatteringFactors.realistic.preset:this._intensity<=.5?b(this._scatteringFactors.cartographicMin.preset,this._scatteringFactors.cartographicDefault.preset,2*this._intensity):b(this._scatteringFactors.cartographicDefault.preset,this._scatteringFactors.cartographicMax.preset,2*(this._intensity-.5))}get _mode(){return null==this.view.environment.lighting.glow?this.view.environment.atmosphereEnabled?0:2:1}get _intensity(){return this.view.environment.lighting.glow?.intensity??0}_setupFBO(t,e,i,r=!1,s=0){t.fbo.level=s;const o=this.renderingContext;o.bindFramebuffer(t.fbo),o.setViewport(0,0,e,i),o.setClearColor(0,0,0,0),o.clear(16384),r&&o.clearBuffer(1,h)}get test(){return{compositionParameters:this._compositionParameters,blurParameters:this._blurParameters,preset:this._preset,setMinDisperse:(t,e)=>{0===this._mode?this._scatteringFactors.realistic.preset[t]=e:(this._scatteringFactors.cartographicMin.preset[t]=e,this._scatteringFactors.cartographicMax.preset[t]=e)}}}};t([s()],v.prototype,"consumes",void 0),t([s()],v.prototype,"produces",void 0),v=t([o("esri.views.3d.webgl-engine.effects.glow.Glow")],v);export{v as Glow};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{isOITColor as r}from"../core/shaderLibrary/ShaderOutput.js";import{defaultDepthWrite as t,modulateDestination as e,premultipliedAlpha as u,unpremultipliedAlphaToPremultipliedAlpha as n,separateBlendingParams as c}from"../../../webgl/renderState.js";const a=c(1,0,1,771);function i(r,t=!1,c=!1){if(c)return e;switch(r){case 0:return t?u:n;case 1:return a;default:return null}}function l(r){if(r.draped)return null;switch(r.output){case 0:case 2:default:return r.writeDepth?t:null;case 1:return null}}function o(t,e=513){return{func:r(t)?515:e}}export{i as blending,a as blendingColorAlpha,o as depthTest,l as depthWrite};
2
+ import{isOITColorAlpha as r}from"../core/shaderLibrary/ShaderOutput.js";import{defaultDepthWrite as t,modulateDestination as e,premultipliedAlpha as u,unpremultipliedAlphaToPremultipliedAlpha as n,separateBlendingParams as c}from"../../../webgl/renderState.js";const a=c(1,0,1,771);function i(r,t=!1,c=!1){if(c)return e;switch(r){case 0:return t?u:n;case 1:return a;default:return null}}function l(r){if(r.draped)return null;switch(r.output){case 0:case 2:default:return r.writeDepth?t:null;case 1:return null}}function o(t,e=513){return{func:r(t)?515:e}}export{i as blending,a as blendingColorAlpha,o as depthTest,l as depthWrite};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{reciprocalClamped as e}from"../../../../core/mathUtils.js";import{set as t}from"../../../../core/libs/gl-matrix-2/math/mat2.js";import{create as r}from"../../../../core/libs/gl-matrix-2/factories/mat2f64.js";import{setAxisAngle as o}from"../../../../core/libs/gl-matrix-2/math/quat.js";import{create as s}from"../../../../core/libs/gl-matrix-2/factories/quatf64.js";import{multiply as i,copy as a,length as c,normalize as f,dot as n,set as p,scale as l,add as m,subtract as h,transformMat2 as u}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{ZEROS as x,UNIT_X as d,create as g}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{cross as b,set as N,transformQuat as V,dot as O,scale as v,add as I,normalize as P}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as j}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{pathNumRoundCapExtrusionSubdivisions as M}from"../../layers/graphics/Graphics3DPathSymbolLayerConstants.js";import{compressNormal as C,decodeInt16 as y,decompressNormal as A}from"./Normals.js";import{PathFrame2D as k}from"./PathFrame2D.js";import{decodePathVertexInfo as R}from"./PathVertexInfo.js";class S{constructor(e,t,r,o,s,i){this.builder=e,this.profile=t,this.numJoinSubdivisions=r,this.capType=o,this.miterCutoffAngle=s,this.upVectorAlignment=i}evaluateBakedVertices(e,t,r){const{numVerticesTotal:o,framePositionIndices:s,vertexFrameIndices:h,positions:u}=this.builder;for(let x=0;x<o;++x){const o=W;this._evaluateExtrudedVertex(o,x);const d=B;let g=0,V=0;const O=h[x],v=o.frame.right,I=o.frame.up,P=3*s[O],j=i(G,o.profileVertex,r);if(o.isCap)b(d,I,v),g=o.capPositionOffset*r[0],V=o.capNormalOffset;else{const e=L,t=H;a(e,o.rotationRight);const r=c(e);f(e,e);const s=n(j,e);if(Math.abs(s)>r){p(t,-e[1],e[0]);const o=n(j,t);l(e,e,r*Math.sign(s)),l(t,t,o),m(j,e,t)}N(d,0,0,0)}const M=v[0]*j[0]+I[0]*j[1],y=v[1]*j[0]+I[1]*j[1],A=v[2]*j[0]+I[2]*j[1],k=3*x;e[k]=u[P]+M+d[0]*g,e[k+1]=u[P+1]+y+d[1]*g,e[k+2]=u[P+2]+A+d[2]*g;const R=o.profileNormal[0],S=o.profileNormal[1];C(t,x,v[0]*R+I[0]*S+d[0]*V,v[1]*R+I[1]*S+d[1]*V,v[2]*R+I[2]*S+d[2]*V)}}_evaluateExtrudedVertex(e,t){const{profileRotations:r,profileUpAxes:s,profileRightAxes:i,profileRotationFrameUpAxes:c,pathMaxStretchDistances:p,pathVertexInfos:u,vertexFrameIndices:g}=this.builder,{miterCutoffAngle:b,profile:N,upVectorAlignment:O}=this,v=F[O],I=1===this.upVectorAlignment,P=R(u[t]),j=g[t],C=y(r[j])*Math.PI,k=p[j];switch(A(e.frame.right,i,j),A(e.frame.up,s,j),P.type){case 0:{e.isCap=!1;const t=N.vertices[P.sourceIndex],r=N.normals[P.sourceIndex],s=Math.abs(C)>=b,i=I?A(K,c,j):e.frame.up,f=null!=c?w(J,e.frame,i):d,p=n(t,f)*C>=0;if(s&&p){a(e.profileVertex,t);const r=.5*-C+P.subdivision*C/this.numJoinSubdivisions;0!==r&&(o(Q,i,r),I&&V(e.frame.up,e.frame.up,Q),V(e.frame.right,e.frame.right,Q))}else{const r=v(q,t,C,f);a(e.profileVertex,r)}a(e.profileNormal,r),p?a(e.rotationRight,x):l(e.rotationRight,f,k);break}case 1:{e.isCap=!0;const t=N.vertices[P.sourceIndex],r=N.normals[P.sourceIndex];switch(a(e.profileVertex,t),a(e.profileNormal,r),this.capType){case 0:case 1:case 3:e.capPositionOffset=0,e.capNormalOffset=0;break;case 2:e.capPositionOffset=T(P)?.5:-.5,e.capNormalOffset=0}break}case 2:{e.isCap=!0;const t=N.vertices[P.sourceIndex],r=T(P),o=r?1:-1,s=2===this.capType?r?.5:-.5:0,i=x;a(e.profileVertex,t),a(e.profileNormal,i),e.capPositionOffset=s,e.capNormalOffset=o;break}case 3:{e.isCap=!0;const t=T(P)?1:-1,r=.5*t,o=N.poles[P.sourceIndex],s=o.position,i=o.normal;i?(a(e.profileVertex,s),a(e.profileNormal,i),e.capPositionOffset=r,e.capNormalOffset=0):(a(e.profileVertex,s),a(e.profileNormal,x),e.capPositionOffset=r,e.capNormalOffset=t);break}case 4:{e.isCap=!0;const t=T(P)?1:-1,r=.5*t,o=(1-(P.subdivision+1)/M)*Math.PI*.5,s=Math.sin(o),i=Math.cos(o),c=N.poleIndices[P.sourceIndex],n=N.poles[c],p=n.position,u=n.normal,x=N.vertices[P.sourceIndex];h(q,x,p),l(q,q,s),u?(m(q,q,p),a(e.profileVertex,q),a(e.profileNormal,u),e.capPositionOffset=r*i,e.capNormalOffset=0):(f(U,q),l(U,U,s),m(q,q,p),a(e.profileVertex,q),a(e.profileNormal,U),e.capPositionOffset=r*i,e.capNormalOffset=t*i);break}default:P.type}}}const F={0:(t,r,o)=>{if(Math.abs(o)<=0)return r;const s=e(Math.cos(.5*o));return p(t,(s-1+1)*r[0],r[1])},1:(r,o,s,i)=>{if(0===Math.abs(s))return o;const a=e(Math.cos(.5*s)),c=t(E,1+(a-1)*i[0]*i[0],(a-1)*i[0]*i[1],(a-1)*i[0]*i[1],1+(a-1)*i[1]*i[1]);return u(r,o,c)}};function T(e){return 1===e.capSide}function w(e,t,r){const o=O(r,t.up),s=O(r,t.right);return v(_,t.up,-s),v(z,t.right,o),I(_,_,z),P(_,_),D(e,t,_),e}function D(e,t,r){p(e,O(r,t.right),O(r,t.up))}const U=g(),q=g(),E=r(),J=g(),_=j(),z=j(),B=j(),G=g(),L=g(),H=g(),K=j(),Q=s(),W={profileVertex:g(),profileNormal:g(),rotationRight:g(),capPositionOffset:0,capNormalOffset:0,isCap:!1,frame:new k};export{S as PathEvaluator};
2
+ import{reciprocalClamped as e}from"../../../../core/mathUtils.js";import{set as t}from"../../../../core/libs/gl-matrix-2/math/mat2.js";import{create as r}from"../../../../core/libs/gl-matrix-2/factories/mat2f64.js";import{setAxisAngle as o}from"../../../../core/libs/gl-matrix-2/math/quat.js";import{create as s}from"../../../../core/libs/gl-matrix-2/factories/quatf64.js";import{multiply as i,copy as a,length as c,scale as f,set as n,dot as p,add as m,subtract as l,normalize as h,transformMat2 as u}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{ZEROS as x,UNIT_X as d,create as b}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{cross as g,set as N,transformQuat as V,dot as O,scale as v,add as I,normalize as P}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as j}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{pathNumRoundCapExtrusionSubdivisions as M}from"../../layers/graphics/Graphics3DPathSymbolLayerConstants.js";import{compressNormal as C,decodeInt16 as y,decompressNormal as A}from"./Normals.js";import{PathFrame2D as k}from"./PathFrame2D.js";import{decodePathVertexInfo as D}from"./PathVertexInfo.js";class R{constructor(e,t,r,o,s,i){this.builder=e,this.profile=t,this.numJoinSubdivisions=r,this.capType=o,this.miterCutoffAngle=s,this.upVectorAlignment=i}evaluateBakedVertices(e,t,r){const{numVerticesTotal:o,framePositionIndices:s,vertexFrameIndices:l,positions:h}=this.builder;for(let u=0;u<o;++u){const o=W;this._evaluateExtrudedVertex(o,u);const x=B;let d=0,b=0;const V=l[u],O=o.frame.right,v=o.frame.up,I=3*s[V],P=i(G,o.profileVertex,r);if(o.isCap)g(x,v,O),d=o.capPositionOffset*r[0],b=o.capNormalOffset;else{const e=L,t=H;a(e,o.rotationRight);const s=o.maxDistance;i(e,e,r);const l=c(e);l>0?f(e,e,1/l):n(e,0,0);const h=p(P,e);if(Math.abs(h)>s){n(t,-e[1],e[0]);const r=p(P,t);f(e,e,s*Math.sign(h)),f(t,t,r),m(P,e,t)}N(x,0,0,0)}const j=O[0]*P[0]+v[0]*P[1],M=O[1]*P[0]+v[1]*P[1],y=O[2]*P[0]+v[2]*P[1],A=3*u;e[A]=h[I]+j+x[0]*d,e[A+1]=h[I+1]+M+x[1]*d,e[A+2]=h[I+2]+y+x[2]*d;const k=o.profileNormal[0],D=o.profileNormal[1];C(t,u,O[0]*k+v[0]*D+x[0]*b,O[1]*k+v[1]*D+x[1]*b,O[2]*k+v[2]*D+x[2]*b)}}_evaluateExtrudedVertex(e,t){const{profileRotations:r,profileUpAxes:s,profileRightAxes:i,profileRotationFrameUpAxes:c,pathMaxStretchDistances:n,pathVertexInfos:u,vertexFrameIndices:b}=this.builder,{miterCutoffAngle:g,profile:N,upVectorAlignment:O}=this,v=S[O],I=1===this.upVectorAlignment,P=D(u[t]),j=b[t],C=y(r[j])*Math.PI,k=n[j];switch(A(e.frame.right,i,j),A(e.frame.up,s,j),e.maxDistance=0,P.type){case 0:{e.isCap=!1;const t=N.vertices[P.sourceIndex],r=N.normals[P.sourceIndex],s=Math.abs(C)>=g,i=I?A(K,c,j):e.frame.up,f=null!=c?T(J,e.frame,i):d,n=p(t,f)*C>=0;if(s&&n){a(e.profileVertex,t);const r=.5*-C+P.subdivision*C/this.numJoinSubdivisions;0!==r&&(o(Q,i,r),I&&V(e.frame.up,e.frame.up,Q),V(e.frame.right,e.frame.right,Q))}else{const r=v(q,t,C,f);a(e.profileVertex,r)}a(e.profileNormal,r),a(e.rotationRight,n?x:f),e.maxDistance=n?0:k;break}case 1:{e.isCap=!0;const t=N.vertices[P.sourceIndex],r=N.normals[P.sourceIndex];switch(a(e.profileVertex,t),a(e.profileNormal,r),this.capType){case 0:case 1:case 3:e.capPositionOffset=0,e.capNormalOffset=0;break;case 2:e.capPositionOffset=F(P)?.5:-.5,e.capNormalOffset=0}break}case 2:{e.isCap=!0;const t=N.vertices[P.sourceIndex],r=F(P),o=r?1:-1,s=2===this.capType?r?.5:-.5:0,i=x;a(e.profileVertex,t),a(e.profileNormal,i),e.capPositionOffset=s,e.capNormalOffset=o;break}case 3:{e.isCap=!0;const t=F(P)?1:-1,r=.5*t,o=N.poles[P.sourceIndex],s=o.position,i=o.normal;i?(a(e.profileVertex,s),a(e.profileNormal,i),e.capPositionOffset=r,e.capNormalOffset=0):(a(e.profileVertex,s),a(e.profileNormal,x),e.capPositionOffset=r,e.capNormalOffset=t);break}case 4:{e.isCap=!0;const t=F(P)?1:-1,r=.5*t,o=(1-(P.subdivision+1)/M)*Math.PI*.5,s=Math.sin(o),i=Math.cos(o),c=N.poleIndices[P.sourceIndex],n=N.poles[c],p=n.position,u=n.normal,x=N.vertices[P.sourceIndex];l(q,x,p),f(q,q,s),u?(m(q,q,p),a(e.profileVertex,q),a(e.profileNormal,u),e.capPositionOffset=r*i,e.capNormalOffset=0):(h(U,q),f(U,U,s),m(q,q,p),a(e.profileVertex,q),a(e.profileNormal,U),e.capPositionOffset=r*i,e.capNormalOffset=t*i);break}default:P.type}}}const S={0:(t,r,o)=>{if(Math.abs(o)<=0)return r;const s=e(Math.cos(.5*o));return n(t,(s-1+1)*r[0],r[1])},1:(r,o,s,i)=>{if(0===Math.abs(s))return o;const a=e(Math.cos(.5*s)),c=t(E,1+(a-1)*i[0]*i[0],(a-1)*i[0]*i[1],(a-1)*i[0]*i[1],1+(a-1)*i[1]*i[1]);return u(r,o,c)}};function F(e){return 1===e.capSide}function T(e,t,r){const o=O(r,t.up),s=O(r,t.right);return v(_,t.up,-s),v(z,t.right,o),I(_,_,z),P(_,_),w(e,t,_),e}function w(e,t,r){n(e,O(r,t.right),O(r,t.up))}const U=b(),q=b(),E=r(),J=b(),_=j(),z=j(),B=j(),G=b(),L=b(),H=b(),K=j(),Q=s(),W={profileVertex:b(),profileNormal:b(),rotationRight:b(),maxDistance:0,capPositionOffset:0,capNormalOffset:0,isCap:!1,frame:new k};export{R as PathEvaluator};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{subclass as r}from"../../../../core/accessorSupport/decorators.js";import{freeze as t,create as i,ZEROS as s}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{glLayout as o}from"../../support/buffer/glUtil.js";import{isOITColor as l}from"../core/shaderLibrary/ShaderOutput.js";import{PathVertexPositionPassParameters as n}from"../core/shaderLibrary/attributes/PathVertexPosition.glsl.js";import{ReloadableShader as a}from"../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as m}from"../core/shaderTechnique/ShaderTechnique.js";import{depthTest as p,blending as c}from"../lib/OrderIndependentTransparency.js";import{stencilToolMaskBase as h,stencilBaseAllZeros as u,stencilWriteMaskOn as f}from"../lib/StencilUtils.js";import{P as d}from"../../../../chunks/Path.glsl.js";import{getLayout as g}from"./PathLayouts.js";import{advancedMRRFactors as b}from"./pbrUtils.js";import{polygonOffset as j}from"./PolygonOffset.js";import{isCullingRequired as P}from"../shaders/DefaultMaterialTechnique.js";import{makePipelineState as S,defaultColorWrite as y,defaultDepthWrite as T,cullingParams as v}from"../../../webgl/renderState.js";class q extends n{constructor(){super(...arguments),this.ambient=t(.2,.2,.2),this.diffuse=t(.8,.8,.8),this.opacity=1,this.origin=i(),this.modelTransformation=null,this.mrrFactors=b,this.emissiveStrengthFromSymbol=0,this.emissiveSource=1,this.emissiveBaseColor=s}get emissiveStrength(){return this.emissiveStrengthFromSymbol}}let x=class extends m{constructor(e,r){super(e,r,o(g())),this.shader=new a(d,()=>import("./Path.glsl.js"))}initializePipeline(e){return this._occludeePipelineState=this._makePipeline(e,!0),this._makePipeline(e,!1)}_makePipeline(e,r){const{output:t,transparent:i,cullFace:s,hasOccludees:o}=e,n=!l(t);return S({blending:i?c(t):null,culling:P(e)?v(s):null,depthTest:p(t),depthWrite:n?T:null,colorWrite:y,stencilWrite:o?f:null,stencilTest:o?r?h:u:null,polygonOffset:j(e)})}getPipeline(e,r,t){return t?this._occludeePipelineState:super.getPipeline(e,r,t)}};x=e([r("esri.views.3d.webgl-engine.materials.PathTechnique")],x);export{q as PathPassParameters,x as PathTechnique};
2
+ import{__decorate as e}from"tslib";import{subclass as r}from"../../../../core/accessorSupport/decorators.js";import{freeze as t,create as i,ZEROS as s}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{glLayout as o}from"../../support/buffer/glUtil.js";import{isOITColorAlpha as l}from"../core/shaderLibrary/ShaderOutput.js";import{PathVertexPositionPassParameters as n}from"../core/shaderLibrary/attributes/PathVertexPosition.glsl.js";import{ReloadableShader as a}from"../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as m}from"../core/shaderTechnique/ShaderTechnique.js";import{depthTest as p,blending as c}from"../lib/OrderIndependentTransparency.js";import{stencilToolMaskBase as h,stencilBaseAllZeros as u,stencilWriteMaskOn as f}from"../lib/StencilUtils.js";import{P as d}from"../../../../chunks/Path.glsl.js";import{getLayout as g}from"./PathLayouts.js";import{advancedMRRFactors as b}from"./pbrUtils.js";import{polygonOffset as j}from"./PolygonOffset.js";import{isCullingRequired as P}from"../shaders/DefaultMaterialTechnique.js";import{makePipelineState as S,defaultColorWrite as y,defaultDepthWrite as T,cullingParams as v}from"../../../webgl/renderState.js";class q extends n{constructor(){super(...arguments),this.ambient=t(.2,.2,.2),this.diffuse=t(.8,.8,.8),this.opacity=1,this.origin=i(),this.modelTransformation=null,this.mrrFactors=b,this.emissiveStrengthFromSymbol=0,this.emissiveSource=1,this.emissiveBaseColor=s}get emissiveStrength(){return this.emissiveStrengthFromSymbol}}let x=class extends m{constructor(e,r){super(e,r,o(g())),this.shader=new a(d,()=>import("./Path.glsl.js"))}initializePipeline(e){return this._occludeePipelineState=this._makePipeline(e,!0),this._makePipeline(e,!1)}_makePipeline(e,r){const{output:t,transparent:i,cullFace:s,hasOccludees:o}=e,n=!l(t);return S({blending:i?c(t):null,culling:P(e)?v(s):null,depthTest:p(t),depthWrite:n?T:null,colorWrite:y,stencilWrite:o?f:null,stencilTest:o?r?h:u:null,polygonOffset:j(e)})}getPipeline(e,r,t){return t?this._occludeePipelineState:super.getPipeline(e,r,t)}};x=e([r("esri.views.3d.webgl-engine.materials.PathTechnique")],x);export{q as PathPassParameters,x as PathTechnique};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{normalize as t,sub as r,dot as n}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as o}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{isOITColor as f}from"../core/shaderLibrary/ShaderOutput.js";const s=2,c=1,e=O(-1),u=O(1),i=e,a=new Array;a[0]=null,a[1]=u,a[2]=e,a[3]=O(-2),a[4]=O(-3);const l=a.map(t=>p(i,t));function m({output:t,enableOITOffset:r,polygonOffset:n}){return f(t)&&r?l[n]:a[n]}function p(t,r){return r?{factor:t.factor+r.factor,units:t.units+r.units}:t}function O(t){return{factor:c*t,units:s*t}}function b(o,f,s,c){const e=m(f);if(!e)return o;const u=x*e.units,i=t(y,r(y,c,s));return(t,r,f)=>{const s=(r?1-Math.abs(n(i,r)):0)*e.factor*g+u;return o(t+s,r,f)}}a[1]=u;const g=5e-5,x=5e-6,y=o();function d(t){const r=m(t)??{factor:0,units:0};return{factor:r.factor+e.factor*t.polygonOffsetIndex,units:r.units+e.units*t.polygonOffsetIndex}}export{d as getRibbonLineLayerPolygonOffset,b as intersectWithPolygonOffset,m as polygonOffset};
2
+ import{normalize as t,sub as r,dot as n}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as o}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{isOITColorAlpha as f}from"../core/shaderLibrary/ShaderOutput.js";const s=2,c=1,e=O(-1),u=O(1),i=e,a=new Array;a[0]=null,a[1]=u,a[2]=e,a[3]=O(-2),a[4]=O(-3);const l=a.map(t=>p(i,t));function m({output:t,enableOITOffset:r,polygonOffset:n}){return f(t)&&r?l[n]:a[n]}function p(t,r){return r?{factor:t.factor+r.factor,units:t.units+r.units}:t}function O(t){return{factor:c*t,units:s*t}}function b(o,f,s,c){const e=m(f);if(!e)return o;const u=x*e.units,i=t(y,r(y,c,s));return(t,r,f)=>{const s=(r?1-Math.abs(n(i,r)):0)*e.factor*g+u;return o(t+s,r,f)}}a[1]=u;const g=5e-5,x=5e-6,y=o();function d(t){const r=m(t)??{factor:0,units:0};return{factor:r.factor+e.factor*t.polygonOffsetIndex,units:r.units+e.units*t.polygonOffsetIndex}}export{d as getRibbonLineLayerPolygonOffset,b as intersectWithPolygonOffset,m as polygonOffset};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{subclass as r}from"../../../../core/accessorSupport/decorators.js";import{glLayout as t}from"../../support/buffer/glUtil.js";import{newLayout as o}from"../../support/buffer/InterleavedLayout.js";import{isOITColor as i}from"../core/shaderLibrary/ShaderOutput.js";import{ReloadableShader as s}from"../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as a}from"../core/shaderTechnique/ShaderTechnique.js";import{olidEnabled as n}from"../effects/geometry/olidUtils.js";import{blending as l}from"../lib/OrderIndependentTransparency.js";import{polygonOffset as f}from"../materials/PolygonOffset.js";import{H as c}from"../../../../chunks/HUDMaterial.glsl.js";import{PrimitiveType as p}from"../../../webgl/enums.js";import{makePipelineState as m,defaultColorWrite as u,defaultDepthWrite as d}from"../../../webgl/renderState.js";let h=class extends a{constructor(e,r){super(e,r,t(g).concat(t(v(r)))),this.shader=new s(c,()=>import("./HUDMaterial.glsl.js")),this.ignoreUnused=!0,this.primitiveType=p.TRIANGLE_STRIP}initializePipeline(e){const{draped:r,output:t,depthTestEnabled:o}=e,s=i(t),a=o&&!r&&!s&&!(10===t);return m({blending:l(t,!0),depthTest:o&&!r?{func:515}:null,depthWrite:a?d:null,colorWrite:u,polygonOffset:f(e)})}};h=e([r("esri.views.3d.webgl-engine.shaders.HUDMaterialTechnique")],h);const g=o().vec2u8("uv0",{glNormalized:!0});function v(e){let r=o().vec3f("position").vec3f("normal").f32("groundDistance");return e.hasVertexCenterOffset&&(r=r.vec3f("centerOffset")),e.hasVertexColor&&(r=r.vec4u8("color",{glNormalized:!0})),e.hasVertexSize&&(r=r.vec2f("size")),e.hasVertexRotation&&(r=r.f32("rotation")),(e.hasVVColor||e.hasVVSize)&&(r=r.vec4f("featureAttribute")),e.hasVertexUVi&&(r=r.vec4i16("uvi")),n()?r.vec4u8("olidColor"):r}export{h as HUDMaterialTechnique,g as baseLayout,v as getInstanceLayout};
2
+ import{__decorate as e}from"tslib";import{subclass as r}from"../../../../core/accessorSupport/decorators.js";import{glLayout as t}from"../../support/buffer/glUtil.js";import{newLayout as o}from"../../support/buffer/InterleavedLayout.js";import{isOITColorAlpha as i}from"../core/shaderLibrary/ShaderOutput.js";import{ReloadableShader as s}from"../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as a}from"../core/shaderTechnique/ShaderTechnique.js";import{olidEnabled as n}from"../effects/geometry/olidUtils.js";import{blending as l}from"../lib/OrderIndependentTransparency.js";import{polygonOffset as f}from"../materials/PolygonOffset.js";import{H as c}from"../../../../chunks/HUDMaterial.glsl.js";import{PrimitiveType as p}from"../../../webgl/enums.js";import{makePipelineState as m,defaultColorWrite as u,defaultDepthWrite as d}from"../../../webgl/renderState.js";let h=class extends a{constructor(e,r){super(e,r,t(g).concat(t(v(r)))),this.shader=new s(c,()=>import("./HUDMaterial.glsl.js")),this.ignoreUnused=!0,this.primitiveType=p.TRIANGLE_STRIP}initializePipeline(e){const{draped:r,output:t,depthTestEnabled:o}=e,s=i(t),a=o&&!r&&!s&&!(10===t);return m({blending:l(t,!0),depthTest:o&&!r?{func:515}:null,depthWrite:a?d:null,colorWrite:u,polygonOffset:f(e)})}};h=e([r("esri.views.3d.webgl-engine.shaders.HUDMaterialTechnique")],h);const g=o().vec2u8("uv0",{glNormalized:!0});function v(e){let r=o().vec3f("position").vec3f("normal").f32("groundDistance");return e.hasVertexCenterOffset&&(r=r.vec3f("centerOffset")),e.hasVertexColor&&(r=r.vec4u8("color",{glNormalized:!0})),e.hasVertexSize&&(r=r.vec2f("size")),e.hasVertexRotation&&(r=r.f32("rotation")),(e.hasVVColor||e.hasVVSize)&&(r=r.vec4f("featureAttribute")),e.hasVertexUVi&&(r=r.vec4i16("uvi")),n()?r.vec4u8("olidColor"):r}export{h as HUDMaterialTechnique,g as baseLayout,v as getInstanceLayout};
@@ -1,15 +1,14 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{isColor as o,isOITColor as l,isOITFrontFace as i}from"../core/shaderLibrary/ShaderOutput.js";import{Emissions as r}from"../core/shaderLibrary/output/Emissions.glsl.js";import{OutputHighlight as a}from"../core/shaderLibrary/output/OutputHighlight.glsl.js";import{ColorConversion as s}from"../core/shaderLibrary/util/ColorConversion.glsl.js";import{emissionDimming as e}from"../core/shaderLibrary/util/EmissionDimming.glsl.js";import{If as t,glsl as n}from"../core/shaderModules/glsl.js";import{alphaCutoff as f}from"./alphaCutoff.glsl.js";import{ditherNoise as m}from"./ditherNoise.glsl.js";import{oitResolution as u}from"./oitResolution.glsl.js";function d(d,g){d.include(a,g),d.include(r,g);const{fragment:p,outputs:c}=d,{output:C,hasEmission:h,discardInvisibleFragments:v,oitPremultipliedAlpha:b,snowCover:A,useFloatBlend:$,emissionDimmingPass:y}=g,E=11===C,j=l(C),O=i(C),L=o(C)&&!j;let S=0;(L||j)&&c.add("fragColor","vec4",S++),j&&c.add("fragAlpha","float",S++),h&&c.add("fragEmission","vec4",S++),p.include(s),p.include(f),p.include(u,g),p.include(m,g),y&&p.include(e,g),p.code.add(n`
3
- void outputColorHighlightOLID(vec4 finalColor, vec3 emissiveSymbolColor ${t(A,", float snow")}) {
4
- ${t(E,"finalColor.a = 1.0;")}
5
- ${t(v,"if (finalColor.a < alphaCutoff) { discard; }")}
6
- ${t(j||h,"float noise = ditherNoise(finalColor);")}
2
+ import{isColor as o,isOITColorAlpha as l,isOITFrontFace as i}from"../core/shaderLibrary/ShaderOutput.js";import{Emissions as r}from"../core/shaderLibrary/output/Emissions.glsl.js";import{OutputHighlight as a}from"../core/shaderLibrary/output/OutputHighlight.glsl.js";import{ColorConversion as s}from"../core/shaderLibrary/util/ColorConversion.glsl.js";import{emissionDimming as e}from"../core/shaderLibrary/util/EmissionDimming.glsl.js";import{If as n,glsl as t}from"../core/shaderModules/glsl.js";import{alphaCutoff as f}from"./alphaCutoff.glsl.js";import{ditherNoise as m}from"./ditherNoise.glsl.js";import{oitResolution as u}from"./oitResolution.glsl.js";function d(d,g){d.include(a,g),d.include(r,g);const{fragment:p,outputs:c}=d,{output:h,hasEmission:C,discardInvisibleFragments:v,oitPremultipliedAlpha:b,snowCover:A,useFloatBlend:E,emissionDimmingPass:y}=g,$=11===h,j=l(h),O=i(h),L=o(h)&&!j;let S=0;(L||j)&&c.add("fragColor","vec4",S++),j&&c.add("fragAlpha","float",S++),C&&c.add("fragEmission","vec4",S++),p.include(s),p.include(f),p.include(u,g),p.include(m,g),y&&p.include(e,g),p.code.add(t`
3
+ void outputColorHighlightOLID(vec4 finalColor, vec3 emissiveSymbolColor ${n(A,", float snow")}) {
4
+ ${n($,"finalColor.a = 1.0;")}
5
+ ${n(v,"if (finalColor.a < alphaCutoff) { discard; }")}
7
6
 
8
- ${t(j,`fragColor = ${t(b,"finalColor","premultiplyAlpha(finalColor)")};\n fragColor = vec4(fragColor.rgb * floatBlendOutputScale + noise, fragColor.a);\n float scaledAlpha = finalColor.a * floatBlendOutputScale;\n fragAlpha = scaledAlpha + noise;\n ${t(!$,"fragAlpha = fragAlpha < alphaCutoff ? scaledAlpha : fragAlpha;")}`)}
9
- ${t(O&&b&&v,"finalColor.rgb /= finalColor.a;")}
10
- ${t(L,"fragColor = finalColor;")}
11
- ${t(h,y?"fragEmission = vec4(emissionDimming(premultiplyAlpha(finalColor).rgb, 1.0 - finalColor.a), 0.0);":`fragEmission = ${t(A,"mix(finalColor.a * getEmissions(emissiveSymbolColor), vec4(0.0), snow);","finalColor.a * getEmissions(emissiveSymbolColor);")}\n fragEmission = vec4(fragEmission.rgb * floatBlendOutputScale + noise, fragEmission.a);`)}
7
+ ${n(j,`float noise = ditherNoise(finalColor);\n fragColor = ${n(b,"finalColor","premultiplyAlpha(finalColor)")};\n fragColor = vec4(fragColor.rgb * floatBlendOutputScale + noise, fragColor.a);\n float scaledAlpha = finalColor.a * floatBlendOutputScale;\n fragAlpha = scaledAlpha + noise;\n ${n(!E,"fragAlpha = fragAlpha < alphaCutoff ? scaledAlpha : fragAlpha;")}`)}
8
+ ${n(O&&b&&v,"finalColor.rgb /= finalColor.a;")}
9
+ ${n(L,"fragColor = finalColor;")}
10
+ ${n(C,y?"fragEmission = vec4(emissionDimming(premultiplyAlpha(finalColor).rgb, 1.0 - finalColor.a), 0.0);":`fragEmission = ${n(A,"mix(finalColor.a * getEmissions(emissiveSymbolColor), vec4(0.0), snow);","finalColor.a * getEmissions(emissiveSymbolColor);")}\n float emissionNoise = ditherNoise(fragEmission);\n fragEmission = vec4(fragEmission.rgb * floatBlendOutputScale + emissionNoise, fragEmission.a);`)}
12
11
  calculateOcclusionAndOutputHighlight();
13
- ${t(E,"outputObjectAndLayerIdColor();")}
12
+ ${n($,"outputObjectAndLayerIdColor();")}
14
13
  }
15
14
  `)}export{d as outputColorHighlightOLID};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{glsl as o}from"../core/shaderModules/glsl.js";function e(e,r){r.useFloatBlend?e.code.add(o`float ditherNoise(vec4 color) { return 0.0; }`):e.code.add("\n float ditherNoise(vec4 color) {\n vec2 seed = color.rg + color.ba + gl_FragCoord.xy + gl_FragCoord.z;\n return (fract(52.9829189 * fract(dot(seed, vec2(0.06711056, 0.00583715)))) - 0.5) / 255.0;\n }")}export{e as ditherNoise};
2
+ function o(o,e){e.useFloatBlend?o.code.add("float ditherNoise(vec4 color) { return 0.0; }"):o.code.add("\n float ditherNoise(vec4 color) {\n vec2 seed = color.rg + color.ba + gl_FragCoord.xy + gl_FragCoord.z;\n return (fract(52.9829189 * fract(dot(seed, vec2(0.06711056, 0.00583715)))) - 0.5) / 255.0;\n }")}export{o as ditherNoise};
@@ -92,7 +92,9 @@ export default class LinkChartView extends View2D {
92
92
  * @param options - Options to specify what is included in or excluded from the hitTest. Supported since 4.16.
93
93
  * @returns When resolved, returns an array of objects containing different [result types](https://developers.arcgis.com/javascript/latest/references/core/views/types/#ViewHit).
94
94
  * @see [Sample: Access features with hitTest](https://developers.arcgis.com/javascript/latest/sample-code/map-component-hittest/)
95
- * @see [Sample: Access features with hitTest](https://developers.arcgis.com/javascript/latest/sample-code/map-component-hittest/)
95
+ * @see [Sample - Access features with hitTest](https://developers.arcgis.com/javascript/latest/sample-code/map-component-hittest/)
96
+ * @see [Sample - Hit test features by screen rectangle](https://developers.arcgis.com/javascript/latest/sample-code/map-hittest-screen-rectangle/)
97
+ * @see [Sample - VectorTileLayer hitTest](https://developers.arcgis.com/javascript/latest/sample-code/layers-vectortilelayer-hittest/)
96
98
  * @example
97
99
  * // Get the screen point from the view's click event
98
100
  * view.on("click", async (event) => {
package/views/View2D.d.ts CHANGED
@@ -908,7 +908,9 @@ export default abstract class View2D extends View2DSuperclass {
908
908
  * @param hitTarget - The screen point, screen rectangle, or native mouse event identifying where to perform the hit test.
909
909
  * @param options - Options to specify what is included in or excluded from the hitTest. Supported since 4.16.
910
910
  * @returns When resolved, returns an array of objects containing different [result types](https://developers.arcgis.com/javascript/latest/references/core/views/types/#ViewHit).
911
- * @see [Sample: Access features with hitTest](https://developers.arcgis.com/javascript/latest/sample-code/map-component-hittest/)
911
+ * @see [Sample - Access features with hitTest](https://developers.arcgis.com/javascript/latest/sample-code/map-component-hittest/)
912
+ * @see [Sample - Hit test features by screen rectangle](https://developers.arcgis.com/javascript/latest/sample-code/map-hittest-screen-rectangle/)
913
+ * @see [Sample - VectorTileLayer hitTest](https://developers.arcgis.com/javascript/latest/sample-code/layers-vectortilelayer-hittest/)
912
914
  * @example
913
915
  * // Get the screen point from the view's click event
914
916
  * view.on("click", async (event) => {
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as t}from"tslib";import{pushIfSome as e}from"../../core/arrayUtils.js";import{createTask as s}from"../../core/asyncUtils.js";import i from"../../core/Collection.js";import a 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 c}from"../../core/maybe.js";import{throwIfAborted as h,isAbortError as u}from"../../core/promiseUtils.js";import p from"../../core/ReactiveMap.js";import{on as m,sync as d,watch as g,syncAndInitial as f,initial as v,whenOnce as A}from"../../core/reactiveUtils.js";import{property as y,subclass as _}from"../../core/accessorSupport/decorators.js";import{UpdatingHandles as F}from"../../core/support/UpdatingHandles.js";import I from"../../geometry/SpatialReference.js";import{getGraphicLayer as w}from"../../graphic/graphicOriginUtils.js";import{system as E}from"../../time/constants.js";import{getAttachmentKey as C}from"./attachmentUtils.js";import{getLayerTimeZone as x,getEffectiveTimeZone as M,createReactiveGraphic as b,isAttributeFormSupportedLayerWithAttachments as V,layerSupportsQueryAttachments as k,queryAttachmentsForElements as T}from"./batchAttributeFormUtils.js";import{ReactiveContingentValuesManager as R}from"./ReactiveContingentValuesManager.js";import{parseFormTemplateString as L}from"./stringUtils.js";import{ValueChangeTransaction as S}from"./ValueChangeTransaction.js";import{ArcadeExecutorProvider as H}from"./expressions/ArcadeExecutorProvider.js";import{ExpressionsManager as P}from"./expressions/ExpressionsManager.js";import{ExpressionsModel as j}from"./expressions/ExpressionsModel.js";import B from"./inputs/BatchFormInputs.js";import{createBatchFormInputsFromBatchFormTemplate as O}from"./inputs/support/createBatchFormInputs.js";import{isGroupInput as G,isFieldInput as D}from"./inputs/support/inputUtils.js";import U from"./templates/BatchFormTemplate.js";import{createBatchFormTemplate as N}from"./templates/support/createBatchFormTemplate.js";import{isExcludedFromSharedForm as Z,isGroupElementTemplate as W}from"./templates/support/templateUtils.js";import{ContingentValuesManager as $}from"../support/ContingentValuesManager.js";import{isEmptyValue as z}from"../support/forms/formUtils.js";function K(t,e){return t?.find(t=>t.layer===e)}let q=class extends n{constructor(t){super(t),this._attachmentCache=new p,this.activeFeatureIndex=-1,this.attachmentsEnabled=!1,this.callbacks=null,this.disabled=!1,this.editType="NA",this.features=new i,this._hasAsyncArcadeExpressions=!1,this.highlightHelper=null,this.maximumFeatureCount=2e3,this.maximumFeatureCountWithComplexForms=50,this.map=null,this.pageStack=[],this.readOnly=!1,this.spatialReference=null,this.submitHasBeenAttempted=!1,this.timeZone=null,this.userHasChangedValues=!1,this.layerInfos=null,this._arcadeExecutorProvider=new H,this._activeAssociation=null,this._activeAssociationsInput=null,this._activeRelationshipInput=null,this._ownContingentValuesManager=null,this._activeFormInputsByElementId=new Map,this._emptyForm=new B({inputs:[]}),this._emptyFormTemplate=new U({elements:[]}),this._featureFormMap=new Map,this._prepareTask=null,this._reactiveGraphicLookup=new p,this._updatingHandles=new F,this._submitTask=null,this._layerTemplateMap=new p,this._workingFeatures=new i,this._expressionsManager=new P({arcadeContext:{editType:"NA",spatialReference:null,map:null,timeZone:E}}),this._getExternalErrorForFeature=(t,e)=>this._reactiveContingentValuesManager.getViolationTypeForField(t,e),this._getFieldValueOptionsForFeature=t=>this._reactiveContingentValuesManager.getAndWatchFieldValueOptions(t),this.sharedForm=this._emptyForm,this.sharedFormTemplate=this._emptyFormTemplate}initialize(){this.contingentValuesManager||(this.contingentValuesManager=this._ownContingentValuesManager=new $),this.addHandles([m(()=>this.features,"after-changes",()=>{this.goHome(),this.notifyChange("layers"),this._prepare()},d),g(()=>[this.attachmentsEnabled,this.features,this.map,this.timeZone,this.editType],()=>this._prepare(),d),g(()=>this.activeForm,()=>{this.goHome(),this._activeFormInputsByElementId.clear(),this._syncAttachments()},d),g(()=>this.activeFeature,()=>{this.goHome()},d),g(()=>this.page,t=>{const e=[...this.pageStack];if(e.includes(t))for(;e.length&&e.at(-1)!==t;)e.pop();else e.push(t);this.pageStack=e},f),g(()=>this.contingentValuesManager,t=>{l(this._reactiveContingentValuesManager),this._reactiveContingentValuesManager=new R({manager:t})},v)]),this._prepare()}destroy(){this._prepareTask=c(this._prepareTask),this._workingFeatures.destroyAll(),l(this._expressionsManager),l(this._reactiveContingentValuesManager),this._updatingHandles.destroy(),this._reactiveGraphicLookup=new p,this._emptyForm.destroy(),this._emptyFormTemplate.destroy(),this._ownContingentValuesManager=l(this._ownContingentValuesManager),this.highlightHelper?.removeAll()}get activeFeature(){const t=this.activeFeatureIndex;return t<0?null:this.features.at(t)}get activeForm(){if("batch"===this.mode)return this.sharedForm;const t=this._workingFeatures.at(this.activeFeatureIndex);if(!t)return this._emptyForm;const e=this._featureFormMap.get(t);if(e)return e;const s=this._makeBatchFormInputsForFeature(t);return s!==this._emptyForm&&this._featureFormMap.set(t,s),s}get activeLayer(){const{activeFeature:t}=this;if(!t)return null;return w(t)??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:t}=this;return this.invalidFeatures.some(e=>e!==t)}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 t=this.contingentValuesManager;for(const e of this.layers)if(t.getFieldsWithContingentValues(e).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:t,timeZone:e}=this;if(!t)return e??"system";const s=x(t);return M(e,s)}get visibleInputs(){return this.activeForm.inputs.filter(t=>t.visible)}get noVisibleElementsReason(){if(this.hasVisibleInputs)return null;if(0===this.activeForm.inputs.length)return"noElements";const t=new Set;for(const e of this.activeForm.inputs)switch(e.visibilityCode){case"hidden:not-in-all-layers":case"hidden:no-domain-in-common":t.add("noElementsInCommon");break;case"hidden:field-definition":case"hidden:group-visibility-expression:all-features":case"hidden:visibility-expression:all-features":t.add("allElementsHidden");break;case"hidden:group-visibility-expression:some-features":case"hidden:visibility-expression:some-features":return"elementsHiddenInSome"}return t.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 status(){const t=this._prepareTask;return null==t?"not-loaded":t.finished?null!=t.error?"failed":"loaded":"loading"}get updating(){return this._updatingHandles.updating||this.calculating}get valid(){return this.sharedForm.valid&&Array.from(this._featureFormMap.values()).every(t=>t.valid)}get layers(){const t=new Set;return this.features.forEach(e=>{const s=w(e);s&&t.add(s)}),Array.from(t)}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 t=s(async()=>{await Promise.all(this._allAttachmentInputs.map(t=>t.waitForPendingAttachmentUpdateData())),this._emitSubmit()});return this._submitTask=t,t.promise.finally(()=>{this._submitTask===t&&(this._submitTask=null)}),t.promise}get selectedAttachment(){return this._get("selectedAttachment")??null}set selectedAttachment(t){this.showingSelectedAttachmentReplacePage=!1,this._set("selectedAttachment",t),null!=t&&(this.selectedAttachmentAddElementId=null)}get selectedAttachmentAddElementId(){return this._get("selectedAttachmentAddElementId")??null}set selectedAttachmentAddElementId(t){this.showingSelectedAttachmentReplacePage=!1,this._set("selectedAttachmentAddElementId",t),null!=t&&(this.selectedAttachment=null,this.selectedAttachmentListElementId=null)}get selectedAttachmentListElementId(){return this._get("selectedAttachmentListElementId")??null}set selectedAttachmentListElementId(t){this._set("selectedAttachmentListElementId",t),null!=t&&(this.selectedAttachment=null,this.selectedAttachmentAddElementId=null)}get selectedAttachmentListInput(){const t=this.selectedAttachmentListElementId,e=this.activeForm;return t&&e&&e.allAttachmentElementInputs.find(e=>e.template.elementId===t)||null}get showingSelectedAttachmentReplacePage(){return this._get("showingSelectedAttachmentReplacePage")??!1}set showingSelectedAttachmentReplacePage(t){this._set("showingSelectedAttachmentReplacePage",t&&null!=this.selectedAttachmentDetails)}get selectedAttachmentAddInput(){const t=this.selectedAttachmentAddElementId,e=this.activeForm;return t&&e&&e.allAttachmentElementInputs.find(e=>e.template.elementId===t)||null}get selectedAttachmentDetails(){const t=this.selectedAttachment,e=this.activeForm;if(!t||!e)return null;const s=e.allAttachmentElementInputs.find(e=>e.template.elementId===t.elementId);if(!s)return null;const i=s.attachments.findIndex(e=>C(e)===t.attachmentKey);if(-1===i)return null;return{attachment:s.attachments[i],input:s}}get _allAttachmentInputs(){const t=[...this.sharedForm.allAttachmentElementInputs];for(const e of this._featureFormMap.values())t.push(...e.allAttachmentElementInputs);return t}get _hasPendingAttachmentHydration(){return this._allAttachmentInputs.some(t=>t.hasPendingAttachmentUpdateData)}findFieldInput(t){if(null==t)return;const e=this._activeFormInputsByElementId;if(e.has(t))return e.get(t);const s=this.activeForm.allFieldInputs.find(e=>e.template.elementId===t);return void 0!==s?(e.set(t,s),s):void 0}getFirstVisibleInvalidFieldInput(){if(this.hasVisibleInputs&&!this.activeForm.valid)for(const t of this.visibleInputs){if(G(t)){const e=t.inputs.find(t=>D(t)&&!t.valid);if(e)return{input:e,groupInput:t}}if(D(t)&&!t.valid)return{input:t}}}getFieldInputValue(t){return this.findFieldInput(t)?.value}getValues(t){const e=this._reactiveGraphicLookup.get(t);if(!e)throw new a("feature-not-found","The given feature is not present in the BatchAttributeForm");return{...e.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(t){const e=[];for(const s of t){const t=this._reactiveGraphicLookup.get(s);t&&(e.push(t),t.geometry=s.geometry)}this._updatingHandles.consumePromise(this._valueChangeTransaction(async t=>this._expressionsManager.runGeometryDependentExpressions(e,t),"user"))}async overrideOriginalFeature(t,e){await(this._prepareTask?.promise);const s=this._reactiveGraphicLookup.get(t);s&&(s.original=e,this._updatingHandles.consumePromise(this._valueChangeTransaction(t=>this._expressionsManager.runOriginalFeatureDependentExpressions(s,t),"expression")))}async setFieldInputValue(t,e){const{fieldName:s}=t;await this._updatingHandles.addPromise(this._valueChangeTransaction(async i=>{for(const a of t.features)i.setValue(a,s,e)},"user",t))}async setFieldInputValuePerFeature(t,e){await this._updatingHandles.addPromise(this._valueChangeTransaction(async s=>{for(const[i,a]of e)s.setValue(i,t.fieldName,a);s.hasChanges&&(t.userHasChangedValue=!0)},"user",t))}async setValueForFieldName(t,e,s){await this._updatingHandles.addPromise(this._valueChangeTransaction(async i=>{for(const a of s){const s=this._reactiveGraphicLookup.get(a);s&&i.setValue(s,t,e)}},"user",t))}async setValuePerFeatureForFieldName(t,e){await this._updatingHandles.addPromise(this._valueChangeTransaction(async s=>{for(const[i,a]of e){const e=this._reactiveGraphicLookup.get(i);e&&s.setValue(e,t,a)}},"user",t))}async setFieldValue(t,e){const s=this.activeForm.allFieldInputs.find(e=>e.fieldName===t);if(null==s)throw new a("no-field-input-found",`Cannot set the value of FieldInput with field name: ${t} because none was found in the active form`);await this.setFieldInputValue(s,e)}async setValue(t,e){const s=this.findFieldInput(t);if(null==s)throw new a("no-FieldInput-found",`Cannot set the value of FieldInput with ID: ${t} because none was found in the active form`);await this.setFieldInputValue(s,e)}async stageAddAttachments(t,e){if(0===e.length)return[];const s=this._findAttachmentInput(t);if(!s)return[];const i=await s.stageAddAttachments(e,this._expressionsManager.arcadeContext);return 0===i.length||(this.userHasChangedValues=!0,this._emitAttachmentsChange(s)),i}stageDeleteAttachment(t,e){const s=this._findAttachmentInput(t);if(!s)return;const i=this._findAttachment(s,e);i&&(s.stageDeleteAttachment(i),this.userHasChangedValues=!0,this._emitAttachmentsChange(s))}async stageRenameAttachment(t,e,s){const i=this._findAttachmentInput(t);if(!i)return;const a=this._findAttachment(i,e);a&&0!==s.trim().length&&(i.stageRenameAttachment(a,s.trim()),this.userHasChangedValues=!0,await i.ensureStagedUpdateData(a),this._emitAttachmentsChange(i))}async stageReplaceAttachment(t,e,s){const i=this._findAttachmentInput(t);if(!i)return!1;const a=this._findAttachment(i,e);if(!a)return!1;return!!await i.stageReplaceAttachment(a,s,this._expressionsManager.arcadeContext)&&(this.userHasChangedValues=!0,this._emitAttachmentsChange(i),!0)}clearAttachmentChanges(t){const e=this._findAttachmentInput(t);e&&(e.clearAttachmentChanges(),this._emitAttachmentsChange(e))}setActiveAssociation(t){this._activeAssociation=t}setActiveAssociationsInput(t){this._activeAssociationsInput=t}setActiveAssociationsLayer(t){this._activeAssociationsInput?.setAssociatedLayer(t)}setActiveAssociationType(t){this._activeAssociationsInput?.setActiveAssociationType(t)}setActiveRelationshipInput(t){t||this._activeRelationshipInput?.setActiveCategory(null),this._activeRelationshipInput=t}setActiveRelationshipCategory(t,e){e.setActiveCategory(t),this.setActiveRelationshipInput(e)}clearAllRelationshipSettings(){const t=this.activeRelationshipInput;t&&(t.setActiveCategory(null),t.setShowAllCategories(!1),t.setShowAllRelatedRecords(!1),this._activeRelationshipInput=null)}clearActiveRelationshipCategoryOrInput(){const t=this.activeRelationshipInput;t&&(t.showAllRelatedRecords?t.showAllCategories?t.setActiveCategory(null):this.setActiveRelationshipInput(null):t.showAllCategories&&(t.setShowAllCategories(!1),this.setActiveRelationshipInput(null)))}resetAttachmentChanges(t,e){const s=this._findAttachmentInput(t);if(!s)return;const i=this._findAttachment(s,e);i&&(s.discardStagedEdits(i),this._emitAttachmentsChange(s))}setSelectedAttachment(t){this.selectedAttachment=t??null}setShowingSelectedAttachmentReplacePage(t){this.showingSelectedAttachmentReplacePage=t}setSelectedAttachmentAddElementId(t){this.selectedAttachmentAddElementId=t??null}setSelectedAttachmentListElementId(t){this.selectedAttachmentListElementId=t??null}userChangesHaveMadeFeatureInvalid(t){return!!this._reactiveGraphicLookup.get(t)?.userChangesHaveMadeInvalid}validate(){return!1}validateContingentValues(t,e=!1){if(e&&!this.submitHasBeenAttempted)for(const s of t)this._reactiveContingentValuesManager.validateContingenciesForNonNullFields(s);else for(const s of t)this._reactiveContingentValuesManager.validateContingencyConstraints(s,{includeIncompleteViolations:!0})}_makeBatchFormInputsForFeature(t){const e=this._layerTemplateMap.get(t.layer);return e?O(e,{allFeatures:new i([t]),expressionsManager:this._expressionsManager,getExternalErrorForFeature:this._getExternalErrorForFeature,getFieldValueOptionsForFeature:this._getFieldValueOptionsForFeature,map:this.map}):this._emptyForm}_computeFormHeaderField(t){const{activeFeature:e,activeLayer:s}=this;return t&&s&&e?L({attributes:e?.attributes,label:t,layer:s,timeZone:this.effectiveTimeZone}):null}_makeSubmitResults(){const t=new Map;for(const[s,i]of this._reactiveGraphicLookup){const a=[],n=[],r=this._featureFormMap.get(i)?.allAttachmentElementInputs??[];for(const t of r)e(a,t.toSubmitEdits()),t.valid||n.push(t.template.elementId);t.set(s,{feature:s,values:{...i.attributes},invalidFields:[],attachmentEdits:a,invalidAttachmentElementIds:n})}for(const e of this.sharedForm.allFieldInputs)for(const s of e.invalidFeatures)t.get(s)?.invalidFields.push(e.fieldName);return Array.from(t.values())}_emitSubmit(){this.emit("submit",{name:"submit",results:this._makeSubmitResults(),valid:this.valid})}_findAttachmentInput(t){const e=this.activeForm.allAttachmentElementInputs.find(e=>e.template.elementId===t);return e||r.getLogger(this).error(`Attachment input not found for elementId '${t}'`),e}_findAttachment(t,e){const s=t.findAttachment(e);return s||r.getLogger(this).error(`Attachment '${e}' not found for attachment element '${t.template.elementId}'`),s}_makeAttachmentEdits(t){const s=[];for(const i of t.allAttachmentElementInputs)e(s,i.toSubmitEdits());return s}_emitAttachmentsChange(t){const e=t.single.feature;if(!e)return;const s=this._featureFormMap.get(e);this.emit("attachments-change",{name:"attachments-change",feature:e.source,attachmentEdits:this._makeAttachmentEdits(s??this.activeForm),valid:this.valid})}async _valueChangeTransaction(t,e,s){const i=new S(this,e,"string"==typeof s?s:s?.fieldName);if(await t(i),"user"===e&&await this._expressionsManager.runExpressionsDependentOnChangedFields(i),await i.close(),i.hasChanges&&s){const t="string"==typeof s?this.activeForm.allFieldInputs.find(t=>t.fieldName===s):s;t&&(t.userHasChangedValue=!0)}}_prepare(){this._hasAsyncArcadeExpressions=!1,this._prepareTask=c(this._prepareTask),l(this._expressionsManager),this.userHasChangedValues=!1,this._expressionsManager=new P({arcadeContext:{editType:this.editType,spatialReference:this.spatialReference??I.WebMercator,map:this.map,timeZone:this.timeZone||"system"}});const{attachmentsEnabled:t,layers:e}=this;if(0===e.length)return;const i=s(async s=>{try{h(s),this._updateWorkingFeatures(),this.contingentValuesManager.layers.addMany(e);const i=new Map;await Promise.all(e.map(t=>t.load()));for(const a of e){const e=K(this.layerInfos,a),n=await N(a,{arcadeExecutorProvider:this._arcadeExecutorProvider,formTimeZone:this.timeZone,attachmentsEnabled:t},e?.formTemplate);h(s),this._layerTemplateMap.set(a,n);const r=n.getExpressionExecutorsForLayer(a);if(this._expressionsManager.layerExpressionsModelMap.set(a,new j({preserveFieldValuesWhenHidden:n.preserveFieldValuesWhenHidden,executorMap:r})),!this._hasAsyncArcadeExpressions)for(const t of r.keys()){const e=r.get(t);if(this._hasAsyncArcadeExpressions=!0===(e.editableExpression?.isAsync||e.requiredExpression?.isAsync||e.valueExpression?.isAsync||e.visibilityExpression?.isAsync),this._hasAsyncArcadeExpressions)break}for(const t of n.elements){if(Z(t))continue;const e=t.clone();W(e)&&(e.elements=e.elements.filter(t=>!Z(t)));const{elementId:s}=e;i.has(s)?i.get(s).foldIn(e):i.set(s,e)}}if(this.hasTooManyComplexFeatures)throw new a("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 a("too-many-features","There are too many features to load into the form.");const n=new U({elements:Array.from(i.values())});this.sharedFormTemplate=n,this.sharedForm=O(n,{allFeatures:this._workingFeatures,expressionsManager:this._expressionsManager,getExternalErrorForFeature:this._getExternalErrorForFeature,getFieldValueOptionsForFeature:this._getFieldValueOptionsForFeature,map:this.map}),await this._valueChangeTransaction(async t=>await this._expressionsManager.runAllExpressions(this._workingFeatures.toArray(),t),"expression"),await A(()=>!this.contingentValuesManager.updating)}catch(i){throw u(i)||r.getLogger(this).error("Failed preparing form",i),i}});this._updatingHandles.consumePromise(i.promise),this._prepareTask=i}_updateWorkingFeatures(){this._workingFeatures.destroyAll(),this._reactiveContingentValuesManager.reset();for(const e of this._featureFormMap.values())e.destroy();this._featureFormMap.clear(),this._attachmentCache.clear();const{features:t}=this;if(this._reactiveGraphicLookup=new p,0!==t.length){this._workingFeatures.addMany(t.map(b));for(const t of this._workingFeatures)this._reactiveGraphicLookup.set(t.source,t)}}async _syncAttachments(){const{activeFeature:t,activeLayer:e,activeForm:s}=this;if(!(t&&s&&V(e)&&k(e)))return;const i=t.getObjectId();if(null==i)return;const a=this._attachmentCache.get(e),n=s.allAttachmentElementInputs;if(!n.length)return;let r;if(a){const t=a.get(i);t&&(r=t)}if(!r){r=await T(e,i,n);o(this._attachmentCache,e,()=>new p).set(i,r)}for(const o of n)o.applyFetchedAttachments(Y(o,r))}get test(){return{expressionsManager:this._expressionsManager,reactiveGraphicLookup:this._reactiveGraphicLookup}}};t([y()],q.prototype,"_attachmentCache",void 0),t([y({readOnly:!0})],q.prototype,"activeFeature",null),t([y()],q.prototype,"activeFeatureIndex",void 0),t([y({readOnly:!0})],q.prototype,"activeForm",null),t([y({readOnly:!0})],q.prototype,"activeLayer",null),t([y()],q.prototype,"activeAssociation",null),t([y()],q.prototype,"activeAssociationsInput",null),t([y()],q.prototype,"activeAssociationType",null),t([y()],q.prototype,"activeRelationshipInput",null),t([y()],q.prototype,"attachmentsEnabled",void 0),t([y()],q.prototype,"callbacks",void 0),t([y()],q.prototype,"disabled",void 0),t([y()],q.prototype,"calculating",null),t([y()],q.prototype,"canGoBack",null),t([y()],q.prototype,"contingentValuesManager",void 0),t([y()],q.prototype,"editType",void 0),t([y()],q.prototype,"features",void 0),t([y()],q.prototype,"expressionEvaluationFailed",null),t([y()],q.prototype,"hasNonActiveInvalidFeatures",null),t([y()],q.prototype,"hasAsyncArcadeExpressions",null),t([y()],q.prototype,"_hasAsyncArcadeExpressions",void 0),t([y()],q.prototype,"invalidFeatures",null),t([y()],q.prototype,"hasVisibleInputs",null),t([y()],q.prototype,"hasLayersWithContingentValues",null),t([y()],q.prototype,"formDescription",null),t([y()],q.prototype,"formTitle",null),t([y()],q.prototype,"effectiveTimeZone",null),t([y()],q.prototype,"highlightHelper",void 0),t([y()],q.prototype,"maximumFeatureCount",void 0),t([y()],q.prototype,"maximumFeatureCountWithComplexForms",void 0),t([y()],q.prototype,"visibleInputs",null),t([y()],q.prototype,"map",void 0),t([y()],q.prototype,"noVisibleElementsReason",null),t([y()],q.prototype,"page",null),t([y()],q.prototype,"pageStack",void 0),t([y()],q.prototype,"readOnly",void 0),t([y()],q.prototype,"spatialReference",void 0),t([y()],q.prototype,"submitHasBeenAttempted",void 0),t([y()],q.prototype,"timeZone",void 0),t([y()],q.prototype,"updating",null),t([y()],q.prototype,"valid",null),t([y()],q.prototype,"layers",null),t([y()],q.prototype,"mode",null),t([y()],q.prototype,"sharedForm",void 0),t([y()],q.prototype,"sharedFormTemplate",void 0),t([y()],q.prototype,"selectedAttachment",null),t([y()],q.prototype,"selectedAttachmentAddElementId",null),t([y()],q.prototype,"selectedAttachmentListElementId",null),t([y()],q.prototype,"selectedAttachmentListInput",null),t([y()],q.prototype,"showingSelectedAttachmentReplacePage",null),t([y()],q.prototype,"selectedAttachmentAddInput",null),t([y()],q.prototype,"selectedAttachmentDetails",null),t([y()],q.prototype,"userHasChangedValues",void 0),t([y()],q.prototype,"layerInfos",void 0),t([y()],q.prototype,"_arcadeExecutorProvider",void 0),t([y()],q.prototype,"_activeAssociation",void 0),t([y()],q.prototype,"_activeAssociationsInput",void 0),t([y()],q.prototype,"_activeRelationshipInput",void 0),t([y()],q.prototype,"_prepareTask",void 0),t([y()],q.prototype,"_reactiveGraphicLookup",void 0),t([y()],q.prototype,"_allAttachmentInputs",null),t([y()],q.prototype,"_hasPendingAttachmentHydration",null),t([y()],q.prototype,"_layerTemplateMap",void 0),t([y()],q.prototype,"_workingFeatures",void 0),t([y()],q.prototype,"_expressionsManager",void 0),q=t([_("esri.widgets.BatchAttributeForm.BatchAttributeFormViewModel")],q);const J=q;function Q(t){return null!=t&&t.trim().length>0}function X(t,e){const s=t.keywords;return Q(s)&&s.toLowerCase()===e}function Y(t,e){const s="attachment"===t.input?.type?t.input.attachmentAssociationType:"exact",i=t.attachmentKeyword;if("any"===s)return e;if("exactOrNone"===s){if(z(i))return e.filter(t=>!Q(t.keywords));const t=i.toLowerCase();return e.filter(e=>!Q(e.keywords)||X(e,t))}if(z(i))return e;const a=i.toLowerCase();return e.filter(t=>X(t,a))}export{J as default};
2
+ import{__decorate as t}from"tslib";import{pushIfSome as e}from"../../core/arrayUtils.js";import{createTask as s}from"../../core/asyncUtils.js";import i from"../../core/Collection.js";import a 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 c}from"../../core/maybe.js";import{throwIfAborted as h,isAbortError as u}from"../../core/promiseUtils.js";import p from"../../core/ReactiveMap.js";import{on as m,sync as d,watch as g,syncAndInitial as f,initial as v,whenOnce as A}from"../../core/reactiveUtils.js";import{property as y,subclass as _}from"../../core/accessorSupport/decorators.js";import{UpdatingHandles as F}from"../../core/support/UpdatingHandles.js";import I from"../../geometry/SpatialReference.js";import{getGraphicLayer as w}from"../../graphic/graphicOriginUtils.js";import{system as E}from"../../time/constants.js";import{getAttachmentKey as C}from"./attachmentUtils.js";import{getLayerTimeZone as x,getEffectiveTimeZone as M,createReactiveGraphic as b,isAttributeFormSupportedLayerWithAttachments as V,layerSupportsQueryAttachments as k,queryAttachmentsForElements as T}from"./batchAttributeFormUtils.js";import{ReactiveContingentValuesManager as R}from"./ReactiveContingentValuesManager.js";import{parseFormTemplateString as L}from"./stringUtils.js";import{ValueChangeTransaction as S}from"./ValueChangeTransaction.js";import{ArcadeExecutorProvider as H}from"./expressions/ArcadeExecutorProvider.js";import{ExpressionsManager as P}from"./expressions/ExpressionsManager.js";import{ExpressionsModel as j}from"./expressions/ExpressionsModel.js";import B from"./inputs/BatchFormInputs.js";import{createBatchFormInputsFromBatchFormTemplate as O}from"./inputs/support/createBatchFormInputs.js";import{isGroupInput as G,isFieldInput as D}from"./inputs/support/inputUtils.js";import U from"./templates/BatchFormTemplate.js";import{createBatchFormTemplate as N}from"./templates/support/createBatchFormTemplate.js";import{isExcludedFromSharedForm as Z,isGroupElementTemplate as W}from"./templates/support/templateUtils.js";import{ContingentValuesManager as $}from"../support/ContingentValuesManager.js";import{isEmptyValue as z}from"../support/forms/formUtils.js";function K(t,e){return t?.find(t=>t.layer===e)}let q=class extends n{constructor(t){super(t),this._attachmentCache=new p,this.activeFeatureIndex=-1,this.attachmentsEnabled=!1,this.callbacks=null,this.disabled=!1,this.editType="NA",this.features=new i,this._hasAsyncArcadeExpressions=!1,this.highlightHelper=null,this.maximumFeatureCount=2e3,this.maximumFeatureCountWithComplexForms=50,this.map=null,this.pageStack=[],this.readOnly=!1,this.spatialReference=null,this.submitHasBeenAttempted=!1,this.timeZone=null,this.userHasChangedValues=!1,this.layerInfos=null,this._arcadeExecutorProvider=new H,this._activeAssociation=null,this._activeAssociationsInput=null,this._activeRelationshipInput=null,this._ownContingentValuesManager=null,this._activeFormInputsByElementId=new Map,this._emptyForm=new B({inputs:[]}),this._emptyFormTemplate=new U({elements:[]}),this._featureFormMap=new Map,this._prepareTask=null,this._reactiveGraphicLookup=new p,this._updatingHandles=new F,this._submitTask=null,this._layerTemplateMap=new p,this._workingFeatures=new i,this._expressionsManager=new P({arcadeContext:{editType:"NA",spatialReference:null,map:null,timeZone:E}}),this._getExternalErrorForFeature=(t,e)=>this._reactiveContingentValuesManager.getViolationTypeForField(t,e),this._getFieldValueOptionsForFeature=t=>this._reactiveContingentValuesManager.getAndWatchFieldValueOptions(t),this.sharedForm=this._emptyForm,this.sharedFormTemplate=this._emptyFormTemplate}initialize(){this.contingentValuesManager||(this.contingentValuesManager=this._ownContingentValuesManager=new $),this.addHandles([m(()=>this.features,"after-changes",()=>{this.goHome(),this.notifyChange("layers"),this._prepare()},d),g(()=>[this.attachmentsEnabled,this.features,this.map,this.timeZone,this.editType],()=>this._prepare(),d),g(()=>this.activeForm,()=>{this.goHome(),this._activeFormInputsByElementId.clear(),this._syncAttachments()},d),g(()=>this.activeFeature,()=>{this.goHome()},d),g(()=>this.page,t=>{const e=[...this.pageStack];if(e.includes(t))for(;e.length&&e.at(-1)!==t;)e.pop();else e.push(t);this.pageStack=e},f),g(()=>this.contingentValuesManager,t=>{l(this._reactiveContingentValuesManager),this._reactiveContingentValuesManager=new R({manager:t})},v)]),this._prepare()}destroy(){this._prepareTask=c(this._prepareTask),this._workingFeatures.destroyAll(),l(this._expressionsManager),l(this._reactiveContingentValuesManager),this._updatingHandles.destroy(),this._reactiveGraphicLookup=new p,this._emptyForm.destroy(),this._emptyFormTemplate.destroy(),this._ownContingentValuesManager=l(this._ownContingentValuesManager),this.highlightHelper?.removeAll()}get activeFeature(){const t=this.activeFeatureIndex;return t<0?null:this.features.at(t)}get activeForm(){if("batch"===this.mode)return this.sharedForm;const t=this._workingFeatures.at(this.activeFeatureIndex);if(!t)return this._emptyForm;const e=this._featureFormMap.get(t);if(e)return e;const s=this._makeBatchFormInputsForFeature(t);return s!==this._emptyForm&&this._featureFormMap.set(t,s),s}get activeLayer(){const{activeFeature:t}=this;if(!t)return null;return w(t)??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:t}=this;return this.invalidFeatures.some(e=>e!==t)}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 t=this.contingentValuesManager;for(const e of this.layers)if(t.getFieldsWithContingentValues(e).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:t,timeZone:e}=this;if(!t)return e??"system";const s=x(t);return M(e,s)}get visibleInputs(){return this.activeForm.inputs.filter(t=>t.visible)}get noVisibleElementsReason(){if(this.hasVisibleInputs)return null;if(0===this.activeForm.inputs.length)return"noElements";const t=new Set;for(const e of this.activeForm.inputs)switch(e.visibilityCode){case"hidden:not-in-all-layers":case"hidden:no-domain-in-common":t.add("noElementsInCommon");break;case"hidden:field-definition":case"hidden:group-visibility-expression:all-features":case"hidden:visibility-expression:all-features":t.add("allElementsHidden");break;case"hidden:group-visibility-expression:some-features":case"hidden:visibility-expression:some-features":return"elementsHiddenInSome"}return t.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 status(){const t=this._prepareTask;return null==t?"not-loaded":t.finished?null!=t.error?"failed":"loaded":"loading"}get updating(){return this._updatingHandles.updating||this.calculating}get valid(){return this.sharedForm.valid&&Array.from(this._featureFormMap.values()).every(t=>t.valid)}get layers(){const t=new Set;return this.features.forEach(e=>{const s=w(e);s&&t.add(s)}),Array.from(t)}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 t=s(async()=>{await Promise.all(this._allAttachmentInputs.map(t=>t.waitForPendingAttachmentUpdateData())),this._emitSubmit()});return this._submitTask=t,t.promise.finally(()=>{this._submitTask===t&&(this._submitTask=null)}),t.promise}get selectedAttachment(){return this._get("selectedAttachment")??null}set selectedAttachment(t){this.showingSelectedAttachmentReplacePage=!1,this._set("selectedAttachment",t),null!=t&&(this.selectedAttachmentAddElementId=null)}get selectedAttachmentAddElementId(){return this._get("selectedAttachmentAddElementId")??null}set selectedAttachmentAddElementId(t){this.showingSelectedAttachmentReplacePage=!1,this._set("selectedAttachmentAddElementId",t),null!=t&&(this.selectedAttachment=null,this.selectedAttachmentListElementId=null)}get selectedAttachmentListElementId(){return this._get("selectedAttachmentListElementId")??null}set selectedAttachmentListElementId(t){this._set("selectedAttachmentListElementId",t),null!=t&&(this.selectedAttachment=null,this.selectedAttachmentAddElementId=null)}get selectedAttachmentListInput(){const t=this.selectedAttachmentListElementId,e=this.activeForm;return t&&e&&e.allAttachmentElementInputs.find(e=>e.template.elementId===t)||null}get showingSelectedAttachmentReplacePage(){return this._get("showingSelectedAttachmentReplacePage")??!1}set showingSelectedAttachmentReplacePage(t){this._set("showingSelectedAttachmentReplacePage",t&&null!=this.selectedAttachmentDetails)}get selectedAttachmentAddInput(){const t=this.selectedAttachmentAddElementId,e=this.activeForm;return t&&e&&e.allAttachmentElementInputs.find(e=>e.template.elementId===t)||null}get selectedAttachmentDetails(){const t=this.selectedAttachment,e=this.activeForm;if(!t||!e)return null;const s=e.allAttachmentElementInputs.find(e=>e.template.elementId===t.elementId);if(!s)return null;const i=s.attachments.findIndex(e=>C(e)===t.attachmentKey);if(-1===i)return null;return{attachment:s.attachments[i],input:s}}get _allAttachmentInputs(){const t=[...this.sharedForm.allAttachmentElementInputs];for(const e of this._featureFormMap.values())t.push(...e.allAttachmentElementInputs);return t}get _hasPendingAttachmentHydration(){return this._allAttachmentInputs.some(t=>t.hasPendingAttachmentUpdateData)}findFieldInput(t){if(null==t)return;const e=this._activeFormInputsByElementId;if(e.has(t))return e.get(t);const s=this.activeForm.allFieldInputs.find(e=>e.template.elementId===t);return void 0!==s?(e.set(t,s),s):void 0}getFirstVisibleInvalidFieldInput(){if(this.hasVisibleInputs&&!this.activeForm.valid)for(const t of this.visibleInputs){if(G(t)){const e=t.inputs.find(t=>D(t)&&!t.valid);if(e)return{input:e,groupInput:t}}if(D(t)&&!t.valid)return{input:t}}}getFieldInputValue(t){return this.findFieldInput(t)?.value}getValues(t){const e=this._reactiveGraphicLookup.get(t);if(!e)throw new a("feature-not-found","The given feature is not present in the BatchAttributeForm");return{...e.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(t){const e=[];for(const s of t){const t=this._reactiveGraphicLookup.get(s);t&&(e.push(t),t.geometry=s.geometry)}this._updatingHandles.consumePromise(this._valueChangeTransaction(async t=>this._expressionsManager.runGeometryDependentExpressions(e,t),"user"))}async overrideOriginalFeature(t,e){await(this._prepareTask?.promise);const s=this._reactiveGraphicLookup.get(t);s&&(s.original=e,this._updatingHandles.consumePromise(this._valueChangeTransaction(t=>this._expressionsManager.runOriginalFeatureDependentExpressions(s,t),"expression")))}async setFieldInputValue(t,e){const{fieldName:s}=t;await this._updatingHandles.addPromise(this._valueChangeTransaction(async i=>{for(const a of t.features)i.setValue(a,s,e)},"user",t))}async setFieldInputValuePerFeature(t,e){await this._updatingHandles.addPromise(this._valueChangeTransaction(async s=>{for(const[i,a]of e)s.setValue(i,t.fieldName,a);s.hasChanges&&(t.userHasChangedValue=!0)},"user",t))}async setValueForFieldName(t,e,s){await this._updatingHandles.addPromise(this._valueChangeTransaction(async i=>{for(const a of s){const s=this._reactiveGraphicLookup.get(a);s&&i.setValue(s,t,e)}},"user",t))}async setValuePerFeatureForFieldName(t,e){await this._updatingHandles.addPromise(this._valueChangeTransaction(async s=>{for(const[i,a]of e){const e=this._reactiveGraphicLookup.get(i);e&&s.setValue(e,t,a)}},"user",t))}async setFieldValue(t,e){const s=this.activeForm.allFieldInputs.find(e=>e.fieldName===t);if(null==s)throw new a("no-field-input-found",`Cannot set the value of FieldInput with field name: ${t} because none was found in the active form`);await this.setFieldInputValue(s,e)}async setValue(t,e){const s=this.findFieldInput(t);if(null==s)throw new a("no-FieldInput-found",`Cannot set the value of FieldInput with ID: ${t} because none was found in the active form`);await this.setFieldInputValue(s,e)}async stageAddAttachments(t,e){if(0===e.length)return[];const s=this._findAttachmentInput(t);if(!s)return[];const i=await s.stageAddAttachments(e,this._expressionsManager.arcadeContext);return 0===i.length||(this.userHasChangedValues=!0,this._emitAttachmentsChange(s)),i}stageDeleteAttachment(t,e){const s=this._findAttachmentInput(t);if(!s)return;const i=this._findAttachment(s,e);i&&(s.stageDeleteAttachment(i),this.userHasChangedValues=!0,this._emitAttachmentsChange(s))}async stageRenameAttachment(t,e,s){const i=this._findAttachmentInput(t);if(!i)return;const a=this._findAttachment(i,e);a&&(i.stageRenameAttachment(a,s.trim()),this.userHasChangedValues=!0,await i.ensureStagedUpdateData(a),this._emitAttachmentsChange(i))}async stageReplaceAttachment(t,e,s){const i=this._findAttachmentInput(t);if(!i)return!1;const a=this._findAttachment(i,e);if(!a)return!1;return!!await i.stageReplaceAttachment(a,s,this._expressionsManager.arcadeContext)&&(this.userHasChangedValues=!0,this._emitAttachmentsChange(i),!0)}clearAttachmentChanges(t){const e=this._findAttachmentInput(t);e&&(e.clearAttachmentChanges(),this._emitAttachmentsChange(e))}setActiveAssociation(t){this._activeAssociation=t}setActiveAssociationsInput(t){this._activeAssociationsInput=t}setActiveAssociationsLayer(t){this._activeAssociationsInput?.setAssociatedLayer(t)}setActiveAssociationType(t){this._activeAssociationsInput?.setActiveAssociationType(t)}setActiveRelationshipInput(t){t||this._activeRelationshipInput?.setActiveCategory(null),this._activeRelationshipInput=t}setActiveRelationshipCategory(t,e){e.setActiveCategory(t),this.setActiveRelationshipInput(e)}clearAllRelationshipSettings(){const t=this.activeRelationshipInput;t&&(t.setActiveCategory(null),t.setShowAllCategories(!1),t.setShowAllRelatedRecords(!1),this._activeRelationshipInput=null)}clearActiveRelationshipCategoryOrInput(){const t=this.activeRelationshipInput;t&&(t.showAllRelatedRecords?t.showAllCategories?t.setActiveCategory(null):this.setActiveRelationshipInput(null):t.showAllCategories&&(t.setShowAllCategories(!1),this.setActiveRelationshipInput(null)))}resetAttachmentChanges(t,e){const s=this._findAttachmentInput(t);if(!s)return;const i=this._findAttachment(s,e);i&&(s.discardStagedEdits(i),this._emitAttachmentsChange(s))}setSelectedAttachment(t){this.selectedAttachment=t??null}setShowingSelectedAttachmentReplacePage(t){this.showingSelectedAttachmentReplacePage=t}setSelectedAttachmentAddElementId(t){this.selectedAttachmentAddElementId=t??null}setSelectedAttachmentListElementId(t){this.selectedAttachmentListElementId=t??null}userChangesHaveMadeFeatureInvalid(t){return!!this._reactiveGraphicLookup.get(t)?.userChangesHaveMadeInvalid}validate(){return!1}validateContingentValues(t,e=!1){if(e&&!this.submitHasBeenAttempted)for(const s of t)this._reactiveContingentValuesManager.validateContingenciesForNonNullFields(s);else for(const s of t)this._reactiveContingentValuesManager.validateContingencyConstraints(s,{includeIncompleteViolations:!0})}_makeBatchFormInputsForFeature(t){const e=this._layerTemplateMap.get(t.layer);return e?O(e,{allFeatures:new i([t]),expressionsManager:this._expressionsManager,getExternalErrorForFeature:this._getExternalErrorForFeature,getFieldValueOptionsForFeature:this._getFieldValueOptionsForFeature,map:this.map}):this._emptyForm}_computeFormHeaderField(t){const{activeFeature:e,activeLayer:s}=this;return t&&s&&e?L({attributes:e?.attributes,label:t,layer:s,timeZone:this.effectiveTimeZone}):null}_makeSubmitResults(){const t=new Map;for(const[s,i]of this._reactiveGraphicLookup){const a=[],n=[],r=this._featureFormMap.get(i)?.allAttachmentElementInputs??[];for(const t of r)e(a,t.toSubmitEdits()),t.valid||n.push(t.template.elementId);t.set(s,{feature:s,values:{...i.attributes},invalidFields:[],attachmentEdits:a,invalidAttachmentElementIds:n})}for(const e of this.sharedForm.allFieldInputs)for(const s of e.invalidFeatures)t.get(s)?.invalidFields.push(e.fieldName);return Array.from(t.values())}_emitSubmit(){this.emit("submit",{name:"submit",results:this._makeSubmitResults(),valid:this.valid})}_findAttachmentInput(t){const e=this.activeForm.allAttachmentElementInputs.find(e=>e.template.elementId===t);return e||r.getLogger(this).error(`Attachment input not found for elementId '${t}'`),e}_findAttachment(t,e){const s=t.findAttachment(e);return s||r.getLogger(this).error(`Attachment '${e}' not found for attachment element '${t.template.elementId}'`),s}_makeAttachmentEdits(t){const s=[];for(const i of t.allAttachmentElementInputs)e(s,i.toSubmitEdits());return s}_emitAttachmentsChange(t){const e=t.single.feature;if(!e)return;const s=this._featureFormMap.get(e);this.emit("attachments-change",{name:"attachments-change",feature:e.source,attachmentEdits:this._makeAttachmentEdits(s??this.activeForm),valid:this.valid})}async _valueChangeTransaction(t,e,s){const i=new S(this,e,"string"==typeof s?s:s?.fieldName);if(await t(i),"user"===e&&await this._expressionsManager.runExpressionsDependentOnChangedFields(i),await i.close(),i.hasChanges&&s){const t="string"==typeof s?this.activeForm.allFieldInputs.find(t=>t.fieldName===s):s;t&&(t.userHasChangedValue=!0)}}_prepare(){this._hasAsyncArcadeExpressions=!1,this._prepareTask=c(this._prepareTask),l(this._expressionsManager),this.userHasChangedValues=!1,this._expressionsManager=new P({arcadeContext:{editType:this.editType,spatialReference:this.spatialReference??I.WebMercator,map:this.map,timeZone:this.timeZone||"system"}});const{attachmentsEnabled:t,layers:e}=this;if(0===e.length)return;const i=s(async s=>{try{h(s),this._updateWorkingFeatures(),this.contingentValuesManager.layers.addMany(e);const i=new Map;await Promise.all(e.map(t=>t.load()));for(const a of e){const e=K(this.layerInfos,a),n=await N(a,{arcadeExecutorProvider:this._arcadeExecutorProvider,formTimeZone:this.timeZone,attachmentsEnabled:t},e?.formTemplate);h(s),this._layerTemplateMap.set(a,n);const r=n.getExpressionExecutorsForLayer(a);if(this._expressionsManager.layerExpressionsModelMap.set(a,new j({preserveFieldValuesWhenHidden:n.preserveFieldValuesWhenHidden,executorMap:r})),!this._hasAsyncArcadeExpressions)for(const t of r.keys()){const e=r.get(t);if(this._hasAsyncArcadeExpressions=!0===(e.editableExpression?.isAsync||e.requiredExpression?.isAsync||e.valueExpression?.isAsync||e.visibilityExpression?.isAsync),this._hasAsyncArcadeExpressions)break}for(const t of n.elements){if(Z(t))continue;const e=t.clone();W(e)&&(e.elements=e.elements.filter(t=>!Z(t)));const{elementId:s}=e;i.has(s)?i.get(s).foldIn(e):i.set(s,e)}}if(this.hasTooManyComplexFeatures)throw new a("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 a("too-many-features","There are too many features to load into the form.");const n=new U({elements:Array.from(i.values())});this.sharedFormTemplate=n,this.sharedForm=O(n,{allFeatures:this._workingFeatures,expressionsManager:this._expressionsManager,getExternalErrorForFeature:this._getExternalErrorForFeature,getFieldValueOptionsForFeature:this._getFieldValueOptionsForFeature,map:this.map}),await this._valueChangeTransaction(async t=>await this._expressionsManager.runAllExpressions(this._workingFeatures.toArray(),t),"expression"),await A(()=>!this.contingentValuesManager.updating)}catch(i){throw u(i)||r.getLogger(this).error("Failed preparing form",i),i}});this._updatingHandles.consumePromise(i.promise),this._prepareTask=i}_updateWorkingFeatures(){this._workingFeatures.destroyAll(),this._reactiveContingentValuesManager.reset();for(const e of this._featureFormMap.values())e.destroy();this._featureFormMap.clear(),this._attachmentCache.clear();const{features:t}=this;if(this._reactiveGraphicLookup=new p,0!==t.length){this._workingFeatures.addMany(t.map(b));for(const t of this._workingFeatures)this._reactiveGraphicLookup.set(t.source,t)}}async _syncAttachments(){const{activeFeature:t,activeLayer:e,activeForm:s}=this;if(!(t&&s&&V(e)&&k(e)))return;const i=t.getObjectId();if(null==i)return;const a=this._attachmentCache.get(e),n=s.allAttachmentElementInputs;if(!n.length)return;let r;if(a){const t=a.get(i);t&&(r=t)}if(!r){r=await T(e,i,n);o(this._attachmentCache,e,()=>new p).set(i,r)}for(const o of n)o.applyFetchedAttachments(Y(o,r))}get test(){return{expressionsManager:this._expressionsManager,reactiveGraphicLookup:this._reactiveGraphicLookup}}};t([y()],q.prototype,"_attachmentCache",void 0),t([y({readOnly:!0})],q.prototype,"activeFeature",null),t([y()],q.prototype,"activeFeatureIndex",void 0),t([y({readOnly:!0})],q.prototype,"activeForm",null),t([y({readOnly:!0})],q.prototype,"activeLayer",null),t([y()],q.prototype,"activeAssociation",null),t([y()],q.prototype,"activeAssociationsInput",null),t([y()],q.prototype,"activeAssociationType",null),t([y()],q.prototype,"activeRelationshipInput",null),t([y()],q.prototype,"attachmentsEnabled",void 0),t([y()],q.prototype,"callbacks",void 0),t([y()],q.prototype,"disabled",void 0),t([y()],q.prototype,"calculating",null),t([y()],q.prototype,"canGoBack",null),t([y()],q.prototype,"contingentValuesManager",void 0),t([y()],q.prototype,"editType",void 0),t([y()],q.prototype,"features",void 0),t([y()],q.prototype,"expressionEvaluationFailed",null),t([y()],q.prototype,"hasNonActiveInvalidFeatures",null),t([y()],q.prototype,"hasAsyncArcadeExpressions",null),t([y()],q.prototype,"_hasAsyncArcadeExpressions",void 0),t([y()],q.prototype,"invalidFeatures",null),t([y()],q.prototype,"hasVisibleInputs",null),t([y()],q.prototype,"hasLayersWithContingentValues",null),t([y()],q.prototype,"formDescription",null),t([y()],q.prototype,"formTitle",null),t([y()],q.prototype,"effectiveTimeZone",null),t([y()],q.prototype,"highlightHelper",void 0),t([y()],q.prototype,"maximumFeatureCount",void 0),t([y()],q.prototype,"maximumFeatureCountWithComplexForms",void 0),t([y()],q.prototype,"visibleInputs",null),t([y()],q.prototype,"map",void 0),t([y()],q.prototype,"noVisibleElementsReason",null),t([y()],q.prototype,"page",null),t([y()],q.prototype,"pageStack",void 0),t([y()],q.prototype,"readOnly",void 0),t([y()],q.prototype,"spatialReference",void 0),t([y()],q.prototype,"submitHasBeenAttempted",void 0),t([y()],q.prototype,"timeZone",void 0),t([y()],q.prototype,"updating",null),t([y()],q.prototype,"valid",null),t([y()],q.prototype,"layers",null),t([y()],q.prototype,"mode",null),t([y()],q.prototype,"sharedForm",void 0),t([y()],q.prototype,"sharedFormTemplate",void 0),t([y()],q.prototype,"selectedAttachment",null),t([y()],q.prototype,"selectedAttachmentAddElementId",null),t([y()],q.prototype,"selectedAttachmentListElementId",null),t([y()],q.prototype,"selectedAttachmentListInput",null),t([y()],q.prototype,"showingSelectedAttachmentReplacePage",null),t([y()],q.prototype,"selectedAttachmentAddInput",null),t([y()],q.prototype,"selectedAttachmentDetails",null),t([y()],q.prototype,"userHasChangedValues",void 0),t([y()],q.prototype,"layerInfos",void 0),t([y()],q.prototype,"_arcadeExecutorProvider",void 0),t([y()],q.prototype,"_activeAssociation",void 0),t([y()],q.prototype,"_activeAssociationsInput",void 0),t([y()],q.prototype,"_activeRelationshipInput",void 0),t([y()],q.prototype,"_prepareTask",void 0),t([y()],q.prototype,"_reactiveGraphicLookup",void 0),t([y()],q.prototype,"_allAttachmentInputs",null),t([y()],q.prototype,"_hasPendingAttachmentHydration",null),t([y()],q.prototype,"_layerTemplateMap",void 0),t([y()],q.prototype,"_workingFeatures",void 0),t([y()],q.prototype,"_expressionsManager",void 0),q=t([_("esri.widgets.BatchAttributeForm.BatchAttributeFormViewModel")],q);const J=q;function Q(t){return null!=t&&t.trim().length>0}function X(t,e){const s=t.keywords;return Q(s)&&s.toLowerCase()===e}function Y(t,e){const s="attachment"===t.input?.type?t.input.attachmentAssociationType:"exact",i=t.attachmentKeyword;if("any"===s)return e;if("exactOrNone"===s){if(z(i))return e.filter(t=>!Q(t.keywords));const t=i.toLowerCase();return e.filter(e=>!Q(e.keywords)||X(e,t))}if(z(i))return e;const a=i.toLowerCase();return e.filter(t=>X(t,a))}export{J as default};
@@ -7,6 +7,15 @@ import type { NestableAttachmentInputUnion } from "../../form/elements/inputs/at
7
7
  */
8
8
  export function getMediaDurationInSeconds(file: Blob | File, mediaType: "audio" | "video"): Promise<number | null>;
9
9
 
10
+ /**
11
+ * @param file - The Blob or File whose intrinsic dimensions should be read.
12
+ * @internal
13
+ */
14
+ export function getImageDimensionsInPixels(file: Blob | File): Promise<{
15
+ width: number;
16
+ height: number;
17
+ } | null>;
18
+
10
19
  /**
11
20
  * @param inputType - The attachment input type to categorize.
12
21
  * @internal
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{isBlobProtocol as e}from"../../core/urlUtils.js";import{isString as t}from"../../support/guards.js";import{isSupportedImage as n}from"../Attachments/support/attachmentUtils.js";function o(e){return String(e.globalId||e.id||e.name)}function r(e){const n=t(e)?e:"",o=n.lastIndexOf(".");return o<=0||o===n.length-1?{baseName:n,extension:""}:{baseName:n.slice(0,o),extension:n.slice(o)}}function a(e,n){const{extension:o}=r(e);if(!o)return n;const a=n.toLowerCase(),u=o.toLowerCase(),i=a.endsWith(u)&&n.length>o.length?n.slice(0,-o.length):n;return i.trim().length?`${i}${o}`:t(e)?e:n}function u(n,o,r){const{size:a,url:u}=n;if(!t(u)||!u.length)return null;if(e(u))return u;const i=[];return o&&null!=r&&i.push(`w=${r}`),null==a||Number.isNaN(a)||i.push(`s=${a}`),i.length?`${u}${u.includes("?")?"&":"?"}${i.join("&")}`:u}function i(e){return n(e.contentType)}function s(e,t){const{capture:n,recordAudio:o,takePhoto:r,takeVideo:a}=e;return"image"===t?r||n:"video"===t?a||n:"audio"===t&&o||n}async function c(e,t){const n=document.createElement(t),o=URL.createObjectURL(e);return await new Promise(e=>{const t=()=>{n.onloadedmetadata=null,n.onerror=null,n.removeAttribute("src"),n.load(),URL.revokeObjectURL(o)};n.preload="metadata",n.onloadedmetadata=()=>{const o=Number.isFinite(n.duration)?n.duration:null;t(),e(o)},n.onerror=()=>{t(),e(null)},n.src=o})}function l(e){switch(e){case"audio":return"audio";case"document":default:return"document";case"image":case"signature":return"image";case"video":return"video"}}const d={getAttachmentCategoryForInputType:l,getMediaDurationInSeconds:c};export{d as attachmentValidationUtils,l as getAttachmentCategoryForInputType,r as getAttachmentFilenameParts,o as getAttachmentKey,u as getAttachmentUrl,s as getCaptureButtonLabel,c as getMediaDurationInSeconds,i as isImageAttachment,a as preserveAttachmentFilenameExtension};
2
+ import{isBlobProtocol as e}from"../../core/urlUtils.js";import{isString as t}from"../../support/guards.js";import{isSupportedImage as n}from"../Attachments/support/attachmentUtils.js";function r(e){return String(e.globalId||e.id||e.name)}function o(e){const n=t(e)?e:"",r=n.lastIndexOf(".");return r<=0||r===n.length-1?{baseName:n,extension:""}:{baseName:n.slice(0,r),extension:n.slice(r)}}function i(e,t){const{extension:n}=o(e);if(!n)return t;const r=t.toLowerCase(),i=n.toLowerCase(),a=r.endsWith(i)&&t.length>n.length?t.slice(0,-n.length):t;return a.trim().length?`${a}${n}`:t}function a(n,r,o){const{size:i,url:a}=n;if(!t(a)||!a.length)return null;if(e(a))return a;const u=[];return r&&null!=o&&u.push(`w=${o}`),null==i||Number.isNaN(i)||u.push(`s=${i}`),u.length?`${a}${a.includes("?")?"&":"?"}${u.join("&")}`:a}function u(e){return n(e.contentType)}function s(e,t){const{capture:n,recordAudio:r,takePhoto:o,takeVideo:i}=e;return"image"===t?o||n:"video"===t?i||n:"audio"===t&&r||n}async function c(e,t){const n=document.createElement(t),r=URL.createObjectURL(e);return await new Promise(e=>{const t=()=>{n.onloadedmetadata=null,n.onerror=null,n.removeAttribute("src"),n.load(),URL.revokeObjectURL(r)};n.preload="metadata",n.onloadedmetadata=()=>{const r=Number.isFinite(n.duration)?n.duration:null;t(),e(r)},n.onerror=()=>{t(),e(null)},n.src=r})}async function l(e){const t=document.createElement("img"),n=URL.createObjectURL(e);return await new Promise(e=>{const r=()=>{t.onload=null,t.onerror=null,t.removeAttribute("src"),URL.revokeObjectURL(n)};t.onload=()=>{const{naturalWidth:n,naturalHeight:o}=t;r(),e(Number.isFinite(n)&&Number.isFinite(o)?{width:n,height:o}:null)},t.onerror=()=>{r(),e(null)},t.src=n})}function d(e){switch(e){case"audio":return"audio";case"document":default:return"document";case"image":case"signature":return"image";case"video":return"video"}}const m={getAttachmentCategoryForInputType:d,getImageDimensionsInPixels:l,getMediaDurationInSeconds:c};export{m as attachmentValidationUtils,d as getAttachmentCategoryForInputType,o as getAttachmentFilenameParts,r as getAttachmentKey,a as getAttachmentUrl,s as getCaptureButtonLabel,l as getImageDimensionsInPixels,c as getMediaDurationInSeconds,u as isImageAttachment,i as preserveAttachmentFilenameExtension};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- const t="esri-batch-attribute-form",e=`${t}__group`,a=`${t}__input`,n=`${t}__attachment-element`,i=`${t}__relationship-element-input`,l=`${t}__multiple-choice-input`,m={base:t,form:`${t}__form`,formHeader:`${t}__form-header`,noticeError:`${t}__notice-error`,disabledNotice:`${t}__disabled-notice`,label:`${t}__label`,labelTextContent:`${t}__label-text-content`,fieldInput:`${a}`,inputRadio:`${a}--radio`,placeholderRadio:`${a}--radio-placeholder`,inputRadioGroup:`${a}--radio-group`,inputRadioLabel:`${a}--radio-label`,inputDisabled:`${a}--disabled`,inputSwitch:`${a}--switch`,dateInputContainer:`${`${t}__date`}-input-container`,textElementInput:`${t}__text-element-input`,attachmentElementInput:`${n}-input`,attachmentElementLabel:`${n}-label`,attachmentElementList:`${n}-list`,attachmentElementListItem:`${n}-list-item`,attachmentElementListItemStart:`${n}-list-item-start`,attachmentElementListItemStagedIndicator:`${n}-list-item-staged-indicator`,attachmentElementListItemThumb:`${n}-list-item-thumb`,attachmentElementListItemIcon:`${n}-list-item-icon`,attachmentElementEmptyState:`${n}-empty-state`,attachmentElementAddActions:`${n}-add-actions`,attachmentElementEmptyAction:`${n}-empty-action`,attachmentElementEmptyActionHint:`${n}-empty-action-hint`,attachmentElementEmptyActionHintValue:`${n}-empty-action-hint-value`,attachmentElementAllPanel:`${n}-all-panel`,attachmentElementAddPanel:`${n}-add-panel`,attachmentElementFileInput:`${n}-file-input`,attachmentElementAddDropzone:`${n}-add-dropzone`,attachmentElementAddDropzoneIcon:`${n}-add-dropzone-icon`,attachmentElementAddDropzoneHeading:`${n}-add-dropzone-heading`,attachmentElementAddDropzoneDetail:`${n}-add-dropzone-detail`,attachmentElementCaptureNotice:`${n}-capture-notice`,attachmentElementValidationCriteria:`${n}-validation-criteria`,attachmentElementDetail:`${n}-detail`,attachmentElementDetailPreview:`${n}-detail-preview`,attachmentElementDetailPreviewImage:`${n}-detail-preview-image`,attachmentElementDetailPreviewIcon:`${n}-detail-preview-icon`,attachmentElementDetailActions:`${n}-detail-actions`,attachmentElementDetailMetadata:`${n}-detail-metadata`,attachmentElementDetailMetadataGroup:`${n}-detail-metadata-group`,attachmentElementDetailFileNameRow:`${n}-detail-file-name-row`,attachmentElementDetailFileNameInput:`${n}-detail-file-name-input`,attachmentElementDetailMetadataLabel:`${n}-detail-metadata-label`,attachmentElementDetailMetadataValue:`${n}-detail-metadata-value`,relationshipElementInput:`${i}`,relationshipElementInputShowingAll:`${i}_showing-all`,relatedRecordsHeader:`${i}_header`,relatedRecordsDescription:`${i}_description`,relatedRecordsList:`${i}_list`,relatedRecordsListObserver:`${i}_list-observer`,relatedRecordsAddButton:`${i}_add-button`,utilityNetworkAssociationsElementInput:`${t}__utility-network-associations-element-input`,centeredButton:`${t}__centered-button`,description:`${t}__description-text`,block:`${t}__block`,group:e,groupSequential:`${e}--sequential`,individualElement:`${e}__individual-element`,multipleChoiceInput:`${l}`,multipleChoiceSelectAll:`${l}__select-all`,multipleChoiceOtherChoice:`${l}__other-choice`,multipleChoiceOtherChoiceWithSelectAll:`${l}__other-choice--with-select-all`};export{m as css};
2
+ const t="esri-batch-attribute-form",e=`${t}__group`,a=`${t}__input`,i=`${t}__attachment-element`,n=`${t}__relationship-element-input`,l=`${t}__multiple-choice-input`,m={base:t,form:`${t}__form`,formHeader:`${t}__form-header`,noticeError:`${t}__notice-error`,disabledNotice:`${t}__disabled-notice`,label:`${t}__label`,labelTextContent:`${t}__label-text-content`,fieldInput:`${a}`,inputRadio:`${a}--radio`,placeholderRadio:`${a}--radio-placeholder`,inputRadioGroup:`${a}--radio-group`,inputRadioLabel:`${a}--radio-label`,inputDisabled:`${a}--disabled`,inputSwitch:`${a}--switch`,dateInputContainer:`${`${t}__date`}-input-container`,textElementInput:`${t}__text-element-input`,attachmentElementInput:`${i}-input`,attachmentElementLabel:`${i}-label`,attachmentElementList:`${i}-list`,attachmentElementListItem:`${i}-list-item`,attachmentElementListItemStart:`${i}-list-item-start`,attachmentElementListItemStagedIndicator:`${i}-list-item-staged-indicator`,attachmentElementListItemThumb:`${i}-list-item-thumb`,attachmentElementListItemIcon:`${i}-list-item-icon`,attachmentElementEmptyState:`${i}-empty-state`,attachmentElementAddActions:`${i}-add-actions`,attachmentElementEmptyActionHint:`${i}-empty-action-hint`,attachmentElementEmptyActionHintValue:`${i}-empty-action-hint-value`,attachmentElementAllPanel:`${i}-all-panel`,attachmentElementAddPanel:`${i}-add-panel`,attachmentElementFileInput:`${i}-file-input`,attachmentElementAddDropzone:`${i}-add-dropzone`,attachmentElementAddDropzoneIcon:`${i}-add-dropzone-icon`,attachmentElementAddDropzoneHeading:`${i}-add-dropzone-heading`,attachmentElementAddDropzoneDetail:`${i}-add-dropzone-detail`,attachmentElementCaptureNotice:`${i}-capture-notice`,attachmentElementValidationCriteria:`${i}-validation-criteria`,attachmentElementDetail:`${i}-detail`,attachmentElementDetailPreview:`${i}-detail-preview`,attachmentElementDetailPreviewImage:`${i}-detail-preview-image`,attachmentElementDetailPreviewIcon:`${i}-detail-preview-icon`,attachmentElementDetailActions:`${i}-detail-actions`,attachmentElementDetailMetadata:`${i}-detail-metadata`,attachmentElementDetailMetadataGroup:`${i}-detail-metadata-group`,attachmentElementDetailFileNameRow:`${i}-detail-file-name-row`,attachmentElementDetailFileNameInput:`${i}-detail-file-name-input`,attachmentElementDetailMetadataLabel:`${i}-detail-metadata-label`,attachmentElementDetailMetadataValue:`${i}-detail-metadata-value`,relationshipElementInput:`${n}`,relationshipElementInputShowingAll:`${n}_showing-all`,relatedRecordsHeader:`${n}_header`,relatedRecordsDescription:`${n}_description`,relatedRecordsList:`${n}_list`,relatedRecordsListObserver:`${n}_list-observer`,relatedRecordsAddButton:`${n}_add-button`,utilityNetworkAssociationsElementInput:`${t}__utility-network-associations-element-input`,centeredButton:`${t}__centered-button`,description:`${t}__description-text`,group:e,groupSequential:`${e}--sequential`,individualElement:`${e}__individual-element`,multipleChoiceInput:`${l}`,multipleChoiceSelectAll:`${l}__select-all`,multipleChoiceOtherChoice:`${l}__other-choice`,multipleChoiceOtherChoiceWithSelectAll:`${l}__other-choice--with-select-all`};export{m as css};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as t}from"tslib";import e from"../../../request.js";import a from"../../../core/Collection.js";import n from"../../../core/Logger.js";import{isAbortError as i}from"../../../core/promiseUtils.js";import s from"../../../core/ReactiveMap.js";import r from"../../../core/ReactiveSet.js";import{generateBracedUUID as o}from"../../../core/uuid.js";import{property as l,subclass as d}from"../../../core/accessorSupport/decorators.js";import{getEffectiveLayerCapabilities as h}from"../../../layers/support/layerUtils.js";import c from"../../../rest/query/support/AttachmentInfo.js";import{getAttachmentCategoryForFile as p,getAttachmentCategoryForAttachment as m}from"../../Attachments/support/attachmentUtils.js";import{getAttachmentKey as u,getAttachmentUrl as g,preserveAttachmentFilenameExtension as y,attachmentValidationUtils as _}from"../attachmentUtils.js";import{isAttributeFormSupportedLayer as f}from"../batchAttributeFormUtils.js";import A from"./EditableInput.js";import U from"./SingleFeatureInputAdapter.js";let v=-1;const S=["maximum-audio-length","maximum-file-size","minimum-number-of-files","maximum-number-of-files","maximum-video-length"];let C=class extends A{constructor(t){super(t),this.attachments=[],this.displayCount=3,this.group=null,this.single=new U({input:this}),this.type="attachment",this._initialAttachments=[],this._stagedAdds=new a,this._stagedDeletes=new r,this._stagedUpdates=new s,this._failedStagedUpdateHydrations=new r,this._pendingStagedUpdateHydrations=new s,this._temporaryAttachmentUrls=new s,this._validationCriterionStates=new s,this._hasUnsupportedFileTypeValidationError=!1}get allowUserRename(){return this.template.allowUserRename}get addDisabled(){const t=this.maxAttachmentCount,e=this.effectiveAttachmentCount;return null!=t&&e>=t}get effectiveAttachmentCount(){return this._initialAttachments.length-this._stagedDeletes.size+this._stagedAdds.length}get accept(){const{categories:t}=this;if(!t.size)return;const e=[];return t.has("image")&&e.push("image/*"),t.has("audio")&&e.push("audio/*"),t.has("video")&&e.push("video/*"),t.has("document")&&e.push("text/*","application/*","model/*"),e.length>0?e.join(","):void 0}get categories(){const t=new Set;for(const e of this._nestableInputs)F(t,e.type);return t}get _nestableInputs(){const{input:t}=this;return null==t?[]:"attachment"===t.type?t.inputTypes??[]:[t]}get attachmentKeyword(){return this.template.attachmentKeyword?.trim()}get displayFilename(){return this.template.displayFilename}get allAttachmentsVisibleOnDefaultPage(){return this.defaultPageAttachments.length===this.attachments.length}get canUploadFiles(){const t=this._nestableInputs;return!t.length||t.some(x)}get hasCaptureInputs(){return this._nestableInputs.some(w)}get captureMediaType(){const t=new Set;for(const e of this._nestableInputs)if(w(e))switch(e.type){case"audio":t.add("audio");break;case"video":t.add("video");break;case"image":case"signature":t.add("image")}return 1===t.size?Array.from(t)[0]:null}get isCaptureOnly(){const t=this._nestableInputs;return!!t.length&&t.every(T)}get defaultPageAttachments(){return this.attachments.slice(0,this.displayCount)}get feature(){return this.single.feature}get hasAttachmentChanges(){return this._stagedAdds.length>0||this._stagedUpdates.size>0||this._stagedDeletes.size>0}get attachmentCount(){return this.attachments.length}get hasMinimumAttachmentCountNotMet(){const t=this.minAttachmentCount,e=this.effectiveAttachmentCount;return null!=t&&e<t}get hasReachedAttachmentLimit(){const t=this.maxAttachmentCount,e=this.effectiveAttachmentCount;return null!=t&&e===t}get hasExceededAttachmentLimit(){const t=this.maxAttachmentCount,e=this.effectiveAttachmentCount;return null!=t&&e>t}get hasPendingAttachmentUpdateData(){return this._pendingStagedUpdateHydrations.size>0}get input(){return this.template.input}get layer(){return this.single.layer}get maxAttachmentCount(){return this.template.maxAttachmentCount}get minAttachmentCount(){return this.template.minAttachmentCount}get supportsResize(){const{layer:t}=this;if(!t)return!1;const e=h(t);return!!e&&("attachment"in e&&!!e.attachment?.supportsResize)}get useOriginalFilename(){return this.template.useOriginalFilename}get valid(){const t=this.effectiveAttachmentCount,e=this.minAttachmentCount??-1/0,a=this.maxAttachmentCount??1/0,n=this.hasAttachmentChanges;return!(this._failedStagedUpdateHydrations.size>0)&&(!(t<e||t>a)||!n)}get _expressionLayer(){const t=this.layer;if(t)return"scene"===t.type&&"associatedLayer"in t&&null!=t.associatedLayer?t.associatedLayer:"feature"===t.type?t:void 0}destroy(){this._clearTemporaryAttachmentUrls()}applyFetchedAttachments(t){for(const e of t)this._normalizeAttachmentName(e);this._initialAttachments=t,this._failedStagedUpdateHydrations.clear(),this._recomputeAttachments()}clearAttachmentChanges(){this.clearValidationCriteriaState(),this._clearTemporaryAttachmentUrls(),this._stagedAdds.removeAll(),this._stagedUpdates.clear(),this._stagedDeletes.clear(),this._failedStagedUpdateHydrations.clear(),this._pendingStagedUpdateHydrations.clear(),this._recomputeAttachments()}clearValidationCriteriaState(){this._validationCriterionStates.clear(),this._hasUnsupportedFileTypeValidationError=!1}get hasInvalidValidationCriteria(){for(const t of this._validationCriterionStates.values())if("danger"===t)return!0;return!1}get hasUnsupportedFileTypeValidationError(){return this._hasUnsupportedFileTypeValidationError}get validationCriterionStates(){return this._validationCriterionStates}getValidationCriterionState(t){return this._validationCriterionStates.get(t)??null}stageAddAttachment(t){const{contentType:e,data:a,name:n}=t,i=t.globalId??o(),s=a instanceof Blob?a.size:void 0,r=n.trim(),l=new c({contentType:e??void 0,globalId:i,id:v--,keywords:this.attachmentKeyword??void 0,name:r,size:s});return this._setTemporaryAttachmentUrl(i,a),this._stagedAdds.add({key:i,globalId:i,info:l,data:a}),this._recomputeAttachments(),l}async stageAddAttachments(t,e){this.clearValidationCriteriaState();const a=t.filter(t=>this.isFileAllowed(t));if(this._setUnsupportedFileTypeValidationError(a.length!==t.length),0===a.length)return[];const n=[],i=new Map,s=Date.now(),r={},o=this.attachmentCount,l=o+a.length;null!=this.minAttachmentCount&&this.minAttachmentCount>0&&this._setValidationCriterionState(r,"minimum-number-of-files",l>=this.minAttachmentCount?"success":"danger");for(let d=0;d<a.length;d++){const t=a[d];if(!await this._validateAttachmentFile(t,o+n.length+1,r))continue;const l=t instanceof File?t.name:`attachment-${s}_${d+1}`,h=await this._resolveAttachmentFilename(l,e),c=this._makeUniqueFilenameForOperation(i,h);n.push(this.stageAddAttachment({contentType:t.type,data:t,name:c}))}return this._setValidationCriteriaState(r),n}findAttachment(t){if(t)return this.attachments.find(e=>u(e)===t)}getAttachmentEditState(t){const e=this._getAttachmentKey(t),a=e?this._initialAttachments.find(t=>this._getAttachmentKey(t)===e):void 0,n=a?.name??null,i=e?this._stagedUpdates.get(e):void 0,s=i?.name??t.name??null;return{initialName:n,isDeleted:!!e&&this._stagedDeletes.has(e),isRenamed:null!=s&&null!=n&&s!==n,isReplaced:!!i?.data}}getAttachmentPreviewUrl(t,e){const a=this._getAttachmentKey(t);return(a?this._temporaryAttachmentUrls.get(a):void 0)??g(t,this.supportsResize,e)}async ensureStagedUpdateData(t){const e=this._getAttachmentKey(t);if(!e)return!1;const a=this._stagedUpdates.get(e);if(!a||a.data||this._stagedDeletes.has(e))return this._failedStagedUpdateHydrations.delete(e),!1;const n=this._pendingStagedUpdateHydrations.get(e);if(n)return await n;const i=this._hydrateStagedUpdateData(t);this._pendingStagedUpdateHydrations.set(e,i);try{return await i}finally{this._pendingStagedUpdateHydrations.get(e)===i&&this._pendingStagedUpdateHydrations.delete(e)}}async waitForPendingAttachmentUpdateData(){await Promise.allSettled(Array.from(this._pendingStagedUpdateHydrations.values()))}discardStagedEdits(t){const e=this._getAttachmentKey(t);if(!e)return;const a=this._stagedAdds.findIndex(t=>t.key===e);if(a>-1)return this._clearTemporaryAttachmentUrl(e),this._stagedAdds.removeAt(a),this._failedStagedUpdateHydrations.delete(e),this._pendingStagedUpdateHydrations.delete(e),void this._recomputeAttachments();this._clearTemporaryAttachmentUrl(e),this._stagedDeletes.delete(e),this._clearStagedUpdateTracking(e),this._recomputeAttachments()}isFileAllowed(t){const{categories:e}=this;if(!e.size)return!0;const a=p(t);return null!=a&&e.has(a)}isStagedAttachmentAddition(t){return"number"==typeof t.id&&t.id<0}stageDeleteAttachment(t){const e=this._getAttachmentKey(t);if(!e)return;const a=this._stagedAdds.findIndex(t=>t.key===e);if(a>-1)return this._clearTemporaryAttachmentUrl(e),this._stagedAdds.removeAt(a),this._failedStagedUpdateHydrations.delete(e),this._pendingStagedUpdateHydrations.delete(e),void this._recomputeAttachments();this._clearTemporaryAttachmentUrl(e),this._stagedDeletes.add(e),this._clearStagedUpdateTracking(e),this._recomputeAttachments()}stageRenameAttachment(t,e){const a=this._getAttachmentKey(t);if(!a)return;const n=y(t.name,e),i=this._stagedAdds.find(t=>t.key===a);if(i)return i.info.name=n,void this._recomputeAttachments();const s=this._stagedUpdates.get(a),r=this._getInitialAttachment(a)?.name??null,o=null!=r&&n===r;if(o&&null==s?.data&&null==s?.contentType&&null==s?.size)return this._stagedUpdates.delete(a),this._failedStagedUpdateHydrations.delete(a),this._pendingStagedUpdateHydrations.delete(a),void this._recomputeAttachments();const l={key:a,...s,info:t};o?delete l.name:l.name=n,this._stagedUpdates.set(a,l),this._recomputeAttachments(),this.ensureStagedUpdateData(t)}async stageReplaceAttachment(t,e,a){if(this.clearValidationCriteriaState(),!this._isReplacementFileAllowed(t,e))return this._setUnsupportedFileTypeValidationError(!0),!1;const n={},i=await this._validateAttachmentFile(e,void 0,n);if(this._setValidationCriteriaState(n),!i)return!1;const s=e instanceof File?e.name:t.name,r=await this._resolveAttachmentFilename(s,a);return this._stageReplaceAttachment(t,e,r),!0}toSubmitEdits(){const t=[],e=[],a=Array.from(this._stagedDeletes,t=>this._toPendingDeleteAttachment(t));if(0===this._stagedAdds.length&&0===this._stagedUpdates.size&&0===a.length)return null;const i=this._featureIdentifier;if(!i)return n.getLogger(this).error("Unable to build attachment edits without a valid feature and layer."),null;for(const n of this._stagedAdds)t.push({feature:i,attachment:{globalId:n.globalId,contentType:n.info.contentType,data:n.data,name:n.info.name}});for(const[,n]of this._stagedUpdates)this._canSubmitStagedUpdate(n)&&e.push({feature:i,attachment:{info:n.info,contentType:n.contentType,data:n.data,name:n.name}});return 0===t.length&&0===e.length&&0===a.length?null:{label:this.template.label,attachmentKeyword:this.attachmentKeyword,add:t,delete:a,update:e}}_recomputeAttachments(){const t=[];for(const e of this._stagedAdds)t.push(e.info);for(const e of this._initialAttachments){const a=this._getAttachmentKey(e);if(a&&this._stagedUpdates.has(a)){const n=this._stagedUpdates.get(a),i=e.clone();null!=n.name&&(i.name=n.name),null!=n.contentType&&(i.contentType=n.contentType),null!=n.size&&(i.size=n.size),t.push(i);continue}t.push(e)}this.attachments=t}get _featureIdentifier(){const t=this.single.feature,e=this.layer;if(!t||!f(e))return null;const a=e.objectIdField,n="globalIdField"in e?e.globalIdField:null,i=t.getGlobalId()??(n?t.getAttribute(n):void 0);if(i)return{globalId:i};const s=t.getObjectId()??t.getAttribute(a),r=Number(s);return null==s||isNaN(r)?null:{objectId:r}}async _computeAttachmentFilename(t,e){const a=this.template.filenameExpressionExecutor;if(!a)return t;const s=this.single.feature,r=s?.plainGraphic,o=this._expressionLayer,{attachmentKeyword:l,description:d,label:h}=this.template,c={$originalfeature:s?.original,$editcontext:{editType:e.editType},$layer:o,$featureset:o,$datastore:o?.url,$feature:r,$map:e.map,$formElement:{attachmentKeyword:l,description:d,label:h}},p={rawOutput:!0,spatialReference:e.spatialReference,timeZone:e.timeZone};try{const t=a.isAsync?await a.executeAsync(c,p):a.execute(c,p);if("string"==typeof t&&t.trim().length>0)return t.trim()}catch(m){i(m)||n.getLogger(this).error("Failed evaluating attachment filename expression",m)}return t}async _resolveAttachmentFilename(t,e){return!1===this.useOriginalFilename?await this._computeAttachmentFilename(t,e):t}_makeUniqueFilenameForOperation(t,e){const a=e.toLowerCase(),n=t.get(a)??0;if(t.set(a,n+1),0===n)return e;const i=e.lastIndexOf(".");return`${i>0?e.slice(0,i):e}_${n}${i>0?e.slice(i):""}`}_setValidationCriteriaState(t){this._validationCriterionStates.clear();for(const e of S){const a=t[e];a&&this._validationCriterionStates.set(e,a)}}_setUnsupportedFileTypeValidationError(t){this._hasUnsupportedFileTypeValidationError!==t&&(this._hasUnsupportedFileTypeValidationError=t)}_setValidationCriterionState(t,e,a){"danger"!==t[e]&&(t[e]=a)}_isReplacementFileAllowed(t,e){const a=p(e);if(!this.isFileAllowed(e))return!1;const n=m(t);return null==n||n===a}async _validateAttachmentFile(t,e,a){let n=!0;const i=p(t);for(const s of this._nestableInputs){const e=_.getAttachmentCategoryForInputType(s.type);if(null==i||e===i){if("document"===s.type&&null!=s.maxFileSize){const e=t.size<=1048576*s.maxFileSize;this._setValidationCriterionState(a,"maximum-file-size",e?"success":"danger"),n=n&&e}if(("audio"===s.type||"video"===s.type)&&null!=s.maxDuration){const e=await _.getMediaDurationInSeconds(t,s.type),i=null!=e&&e<=s.maxDuration;this._setValidationCriterionState(a,"audio"===s.type?"maximum-audio-length":"maximum-video-length",i?"success":"danger"),n=n&&i}}}if(null!=e&&null!=this.maxAttachmentCount){const t=e<=this.maxAttachmentCount;this._setValidationCriterionState(a,"maximum-number-of-files",t?"success":"danger"),n=n&&t}return n}_stageReplaceAttachment(t,e,a){const n=this._getAttachmentKey(t);if(!n)return;const i=this._stagedAdds.find(t=>t.key===n);if(i)return i.data=e,i.info.name=a,i.info.contentType=e.type,i.info.size=e.size,this._setTemporaryAttachmentUrl(n,e),void this._recomputeAttachments();const s=this._stagedUpdates.get(n);this._setTemporaryAttachmentUrl(n,e),this._failedStagedUpdateHydrations.delete(n),this._pendingStagedUpdateHydrations.delete(n),this._stagedUpdates.set(n,{...s,key:n,info:t,contentType:e.type||s?.contentType||t.contentType,data:e,name:a,size:e.size}),this._recomputeAttachments()}_getInitialAttachment(t){return this._initialAttachments.find(e=>this._getAttachmentKey(e)===t)}_canSubmitStagedUpdate(t){return null!=t.data}_normalizeAttachmentName(t){const{name:e}=t;"string"==typeof e&&(t.name=e.trim())}_getAttachmentKey(t){return u(t)}_clearStagedUpdateTracking(t){this._stagedUpdates.delete(t),this._failedStagedUpdateHydrations.delete(t),this._pendingStagedUpdateHydrations.delete(t)}_toPendingDeleteAttachment(t){const e=this._initialAttachments.find(e=>this._getAttachmentKey(e)===t);if(e)return e;const a=Number(t);return Number.isNaN(a)?new c({globalId:t}):new c({id:a})}async _hydrateStagedUpdateData(t){const a=this._getAttachmentKey(t),s=t.url;if(!a||!s)return!1;try{const{data:n}=await e(s,{responseType:"blob"});this._failedStagedUpdateHydrations.delete(a);const i=this._stagedUpdates.get(a);return!(!i||i.data||this._stagedDeletes.has(a))&&(this._stagedUpdates.set(a,{...i,info:t,contentType:i.contentType??t.contentType??n.type,data:n}),!0)}catch(r){const t=this._stagedUpdates.get(a);return!t||t.data||this._stagedDeletes.has(a)||this._failedStagedUpdateHydrations.add(a),i(r)||n.getLogger(this).error("Failed to fetch attachment data for staged update",r),!1}}_setTemporaryAttachmentUrl(t,e){if(this._clearTemporaryAttachmentUrl(t),!(e instanceof Blob))return;const a=URL.createObjectURL(e);return this._temporaryAttachmentUrls.set(t,a),a}_clearTemporaryAttachmentUrl(t){const e=this._temporaryAttachmentUrls.get(t);e&&(URL.revokeObjectURL(e),this._temporaryAttachmentUrls.delete(t))}_clearTemporaryAttachmentUrls(){for(const t of this._temporaryAttachmentUrls.values())URL.revokeObjectURL(t);this._temporaryAttachmentUrls.clear()}};t([l()],C.prototype,"allowUserRename",null),t([l()],C.prototype,"addDisabled",null),t([l()],C.prototype,"effectiveAttachmentCount",null),t([l()],C.prototype,"accept",null),t([l()],C.prototype,"categories",null),t([l()],C.prototype,"attachmentKeyword",null),t([l()],C.prototype,"attachments",void 0),t([l()],C.prototype,"displayFilename",null),t([l({readOnly:!0})],C.prototype,"allAttachmentsVisibleOnDefaultPage",null),t([l()],C.prototype,"canUploadFiles",null),t([l()],C.prototype,"hasCaptureInputs",null),t([l()],C.prototype,"captureMediaType",null),t([l()],C.prototype,"isCaptureOnly",null),t([l({readOnly:!0})],C.prototype,"defaultPageAttachments",null),t([l()],C.prototype,"displayCount",void 0),t([l()],C.prototype,"feature",null),t([l()],C.prototype,"group",void 0),t([l({readOnly:!0})],C.prototype,"hasAttachmentChanges",null),t([l()],C.prototype,"attachmentCount",null),t([l()],C.prototype,"hasMinimumAttachmentCountNotMet",null),t([l()],C.prototype,"hasReachedAttachmentLimit",null),t([l()],C.prototype,"hasExceededAttachmentLimit",null),t([l({readOnly:!0})],C.prototype,"hasPendingAttachmentUpdateData",null),t([l()],C.prototype,"input",null),t([l()],C.prototype,"layer",null),t([l()],C.prototype,"maxAttachmentCount",null),t([l()],C.prototype,"minAttachmentCount",null),t([l({readOnly:!0})],C.prototype,"single",void 0),t([l({readOnly:!0})],C.prototype,"type",void 0),t([l({readOnly:!0})],C.prototype,"supportsResize",null),t([l()],C.prototype,"useOriginalFilename",null),t([l({readOnly:!0})],C.prototype,"valid",null),t([l()],C.prototype,"_initialAttachments",void 0),t([l()],C.prototype,"_expressionLayer",null),t([l()],C.prototype,"_stagedAdds",void 0),t([l()],C.prototype,"_stagedDeletes",void 0),t([l()],C.prototype,"_stagedUpdates",void 0),t([l()],C.prototype,"_failedStagedUpdateHydrations",void 0),t([l()],C.prototype,"_pendingStagedUpdateHydrations",void 0),t([l()],C.prototype,"_temporaryAttachmentUrls",void 0),t([l()],C.prototype,"_hasUnsupportedFileTypeValidationError",void 0),t([l()],C.prototype,"hasInvalidValidationCriteria",null),t([l()],C.prototype,"hasUnsupportedFileTypeValidationError",null),t([l()],C.prototype,"validationCriterionStates",null),t([l()],C.prototype,"_featureIdentifier",null),C=t([d("esri.widgets.BatchAttributeForm.inputs.AttachmentElementInput")],C);const b=C;function F(t,e){switch(e){case"audio":t.add("audio");break;case"document":t.add("document");break;case"image":case"signature":t.add("image");break;case"video":t.add("video")}}function T(t){return"document"!==t.type&&"capture"===t.inputMethod}function w(t){return T(t)}function x(t){return"document"===t.type||"capture"!==t.inputMethod}export{b as default};
2
+ import{__decorate as t}from"tslib";import e from"../../../request.js";import a from"../../../core/Collection.js";import n from"../../../core/Logger.js";import{isAbortError as i}from"../../../core/promiseUtils.js";import s from"../../../core/ReactiveMap.js";import r from"../../../core/ReactiveSet.js";import{generateBracedUUID as o}from"../../../core/uuid.js";import{property as l,subclass as d}from"../../../core/accessorSupport/decorators.js";import{getEffectiveLayerCapabilities as h}from"../../../layers/support/layerUtils.js";import c from"../../../rest/query/support/AttachmentInfo.js";import{getAttachmentCategoryForFile as m,getAttachmentCategoryForAttachment as p}from"../../Attachments/support/attachmentUtils.js";import{getAttachmentKey as u,getAttachmentUrl as g,preserveAttachmentFilenameExtension as y,attachmentValidationUtils as f}from"../attachmentUtils.js";import{isAttributeFormSupportedLayer as _}from"../batchAttributeFormUtils.js";import A from"./EditableInput.js";import U from"./SingleFeatureInputAdapter.js";let v=-1;const S=["maximum-audio-length","maximum-file-size","maximum-image-size","minimum-number-of-files","maximum-number-of-files","maximum-video-length"];let C=class extends A{constructor(t){super(t),this.attachments=[],this.displayCount=3,this.group=null,this.single=new U({input:this}),this.type="attachment",this._initialAttachments=[],this._stagedAdds=new a,this._stagedDeletes=new r,this._stagedUpdates=new s,this._failedStagedUpdateHydrations=new r,this._pendingStagedUpdateHydrations=new s,this._temporaryAttachmentUrls=new s,this._validationCriterionStates=new s,this._hasUnsupportedFileTypeValidationError=!1}get allowUserRename(){return this.template.allowUserRename}get addDisabled(){const t=this.maxAttachmentCount,e=this.effectiveAttachmentCount;return null!=t&&e>=t}get effectiveAttachmentCount(){return this._initialAttachments.length-this._stagedDeletes.size+this._stagedAdds.length}get accept(){const{categories:t}=this;if(!t.size)return;const e=[];return t.has("image")&&e.push("image/*"),t.has("audio")&&e.push("audio/*"),t.has("video")&&e.push("video/*"),t.has("document")&&e.push("text/*","application/*","model/*"),e.length>0?e.join(","):void 0}get categories(){const t=new Set;for(const e of this._nestableInputs)w(t,e.type);return t}get _nestableInputs(){const{input:t}=this;return null==t?[]:"attachment"===t.type?t.inputTypes??[]:[t]}get attachmentKeyword(){return this.template.attachmentKeyword?.trim()}get displayFilename(){return this.template.displayFilename}get allAttachmentsVisibleOnDefaultPage(){return this.defaultPageAttachments.length===this.attachments.length}get canUploadFiles(){const t=this._nestableInputs;return!t.length||t.some(x)}get hasCaptureInputs(){return this._nestableInputs.some(F)}get captureMediaType(){const t=new Set;for(const e of this._nestableInputs)if(F(e))switch(e.type){case"audio":t.add("audio");break;case"video":t.add("video");break;case"image":case"signature":t.add("image")}return 1===t.size?Array.from(t)[0]:null}get isCaptureOnly(){const t=this._nestableInputs;return!!t.length&&t.every(T)}get defaultPageAttachments(){return this.attachments.slice(0,this.displayCount)}get feature(){return this.single.feature}get hasAttachmentChanges(){return this._stagedAdds.length>0||this._stagedUpdates.size>0||this._stagedDeletes.size>0}get hasInvalidAttachmentName(){return!!this.allowUserRename&&this.attachments.some(t=>0===t.name.trim().length)}get attachmentCount(){return this.attachments.length}get hasMinimumAttachmentCountNotMet(){const t=this.minAttachmentCount,e=this.effectiveAttachmentCount;return null!=t&&e<t}get hasReachedAttachmentLimit(){const t=this.maxAttachmentCount,e=this.effectiveAttachmentCount;return null!=t&&e===t}get hasExceededAttachmentLimit(){const t=this.maxAttachmentCount,e=this.effectiveAttachmentCount;return null!=t&&e>t}get hasPendingAttachmentUpdateData(){return this._pendingStagedUpdateHydrations.size>0}get input(){return this.template.input}get layer(){return this.single.layer}get maxAttachmentCount(){return this.template.maxAttachmentCount}get minAttachmentCount(){return this.template.minAttachmentCount}get supportsResize(){const{layer:t}=this;if(!t)return!1;const e=h(t);return!!e&&("attachment"in e&&!!e.attachment?.supportsResize)}get useOriginalFilename(){return this.template.useOriginalFilename}get valid(){const t=this.effectiveAttachmentCount,e=this.minAttachmentCount??-1/0,a=this.maxAttachmentCount??1/0,n=this.hasAttachmentChanges;return!(this._failedStagedUpdateHydrations.size>0||this.hasInvalidAttachmentName)&&(!(t<e||t>a)||!n)}get _expressionLayer(){const t=this.layer;if(t)return"scene"===t.type&&"associatedLayer"in t&&null!=t.associatedLayer?t.associatedLayer:"feature"===t.type?t:void 0}destroy(){this._clearTemporaryAttachmentUrls()}applyFetchedAttachments(t){for(const e of t)this._normalizeAttachmentName(e);this._initialAttachments=t,this._failedStagedUpdateHydrations.clear(),this._recomputeAttachments()}clearAttachmentChanges(){this.clearValidationCriteriaState(),this._clearTemporaryAttachmentUrls(),this._stagedAdds.removeAll(),this._stagedUpdates.clear(),this._stagedDeletes.clear(),this._failedStagedUpdateHydrations.clear(),this._pendingStagedUpdateHydrations.clear(),this._recomputeAttachments()}clearValidationCriteriaState(){this._validationCriterionStates.clear(),this._hasUnsupportedFileTypeValidationError=!1}get hasInvalidValidationCriteria(){for(const t of this._validationCriterionStates.values())if("danger"===t)return!0;return!1}get hasUnsupportedFileTypeValidationError(){return this._hasUnsupportedFileTypeValidationError}get validationCriterionStates(){return this._validationCriterionStates}getValidationCriterionState(t){return this._validationCriterionStates.get(t)??null}stageAddAttachment(t){const{contentType:e,data:a,name:n}=t,i=t.globalId??o(),s=a instanceof Blob?a.size:void 0,r=n.trim(),l=new c({contentType:e??void 0,globalId:i,id:v--,keywords:this.attachmentKeyword??void 0,name:r,size:s});return this._setTemporaryAttachmentUrl(i,a),this._stagedAdds.add({key:i,globalId:i,info:l,data:a}),this._recomputeAttachments(),l}async stageAddAttachments(t,e){this.clearValidationCriteriaState();const a=t.filter(t=>this.isFileAllowed(t));if(this._setUnsupportedFileTypeValidationError(a.length!==t.length),0===a.length)return[];const n=[],i=new Map,s=Date.now(),r={},o=this.attachmentCount,l=o+a.length;if(null!=this.minAttachmentCount&&this.minAttachmentCount>0&&this._setValidationCriterionState(r,"minimum-number-of-files",l>=this.minAttachmentCount?"success":"danger"),null!=this.maxAttachmentCount){const t=l<=this.maxAttachmentCount;if(this._setValidationCriterionState(r,"maximum-number-of-files",t?"success":"danger"),!t)return this._setValidationCriteriaState(r),[]}for(let d=0;d<a.length;d++){const t=a[d];if(!await this._validateAttachmentFile(t,o+n.length+1,r))continue;const l=t instanceof File?t.name:`attachment-${s}_${d+1}`,h=await this._resolveAttachmentFilename(l,e),c=this._makeUniqueFilenameForOperation(i,h);n.push(this.stageAddAttachment({contentType:t.type,data:t,name:c}))}return this._setValidationCriteriaState(r),n}findAttachment(t){if(t)return this.attachments.find(e=>u(e)===t)}getAttachmentEditState(t){const e=this._getAttachmentKey(t),a=e?this._initialAttachments.find(t=>this._getAttachmentKey(t)===e):void 0,n=a?.name??null,i=e?this._stagedUpdates.get(e):void 0,s=i?.name??t.name??null;return{initialName:n,isDeleted:!!e&&this._stagedDeletes.has(e),isRenamed:null!=s&&null!=n&&s!==n,isReplaced:!0===i?.isReplacement}}getAttachmentPreviewUrl(t,e){const a=this._getAttachmentKey(t);return(a?this._temporaryAttachmentUrls.get(a):void 0)??g(t,this.supportsResize,e)}async ensureStagedUpdateData(t){const e=this._getAttachmentKey(t);if(!e)return!1;const a=this._stagedUpdates.get(e);if(!a||a.data||this._stagedDeletes.has(e))return this._failedStagedUpdateHydrations.delete(e),!1;const n=this._pendingStagedUpdateHydrations.get(e);if(n)return await n;const i=this._hydrateStagedUpdateData(t);this._pendingStagedUpdateHydrations.set(e,i);try{return await i}finally{this._pendingStagedUpdateHydrations.get(e)===i&&this._pendingStagedUpdateHydrations.delete(e)}}async waitForPendingAttachmentUpdateData(){await Promise.allSettled(Array.from(this._pendingStagedUpdateHydrations.values()))}discardStagedEdits(t){const e=this._getAttachmentKey(t);if(!e)return;const a=this._stagedAdds.findIndex(t=>t.key===e);if(a>-1)return this._clearTemporaryAttachmentUrl(e),this._stagedAdds.removeAt(a),this._failedStagedUpdateHydrations.delete(e),this._pendingStagedUpdateHydrations.delete(e),void this._recomputeAttachments();this._clearTemporaryAttachmentUrl(e),this._stagedDeletes.delete(e),this._clearStagedUpdateTracking(e),this._recomputeAttachments()}isFileAllowed(t){const{categories:e}=this;if(!e.size)return!0;const a=m(t);return null!=a&&e.has(a)}isStagedAttachmentAddition(t){return"number"==typeof t.id&&t.id<0}stageDeleteAttachment(t){const e=this._getAttachmentKey(t);if(!e)return;const a=this._stagedAdds.findIndex(t=>t.key===e);if(a>-1)return this._clearTemporaryAttachmentUrl(e),this._stagedAdds.removeAt(a),this._failedStagedUpdateHydrations.delete(e),this._pendingStagedUpdateHydrations.delete(e),void this._recomputeAttachments();this._clearTemporaryAttachmentUrl(e),this._stagedDeletes.add(e),this._clearStagedUpdateTracking(e),this._recomputeAttachments()}stageRenameAttachment(t,e){const a=this._getAttachmentKey(t);if(!a)return;const n=this._stagedAdds.find(t=>t.key===a);if(n){const a=y(t.name,e);return n.info.name=a,void this._recomputeAttachments()}const i=this._stagedUpdates.get(a),s=this._getInitialAttachment(a)?.name??null,r=0===t.name.trim().length?s??t.name:t.name,o=y(r,e),l=null!=s&&o===s;if(l&&!0!==i?.isReplacement)return this._stagedUpdates.delete(a),this._failedStagedUpdateHydrations.delete(a),this._pendingStagedUpdateHydrations.delete(a),void this._recomputeAttachments();const d={key:a,...i,info:t};l?delete d.name:d.name=o,this._stagedUpdates.set(a,d),this._recomputeAttachments(),this.ensureStagedUpdateData(t)}async stageReplaceAttachment(t,e,a){if(this.clearValidationCriteriaState(),!this._isReplacementFileAllowed(t,e))return this._setUnsupportedFileTypeValidationError(!0),!1;const n={},i=await this._validateAttachmentFile(e,void 0,n);if(this._setValidationCriteriaState(n),!i)return!1;const s=e instanceof File?e.name:t.name,r=await this._resolveAttachmentFilename(s,a);return this._stageReplaceAttachment(t,e,r),!0}toSubmitEdits(){const t=[],e=[],a=[];if(0===this._stagedAdds.length&&0===this._stagedUpdates.size&&0===this._stagedDeletes.size)return null;const i=this._featureIdentifier;if(!i)return n.getLogger(this).error("Unable to build attachment edits without a valid feature and layer."),null;for(const n of this._stagedAdds)null!=n.data&&t.push({feature:i,contentType:n.info.contentType,data:n.data,info:n.info,keywords:this.attachmentKeyword,name:n.info.name});for(const n of this._stagedUpdates.values()){const t=null==n.name||n.name.trim().length>0;null!=n.data&&t&&e.push({feature:i,contentType:n.contentType,data:n.data,globalId:n.info.globalId,id:n.info.id,info:n.info,keywords:this.attachmentKeyword,name:n.name})}for(const n of this._stagedDeletes.values()){const t=this._getInitialAttachment(n);t&&a.push({feature:i,contentType:t.contentType,globalId:t.globalId,id:t.id,info:t,keywords:this.attachmentKeyword,name:t.name})}return 0===t.length&&0===e.length&&0===a.length?null:{label:this.template.label,attachmentKeyword:this.attachmentKeyword,adds:t,deletes:a,updates:e}}_recomputeAttachments(){const t=[];for(const e of this._stagedAdds)t.push(e.info);for(const e of this._initialAttachments){const a=this._getAttachmentKey(e);if(a&&this._stagedUpdates.has(a)){const n=this._stagedUpdates.get(a),i=e.clone();null!=n.name&&(i.name=n.name),null!=n.contentType&&(i.contentType=n.contentType),null!=n.size&&(i.size=n.size),t.push(i);continue}t.push(e)}this.attachments=t}get _featureIdentifier(){const t=this.single.feature,e=this.layer;if(!t||!_(e))return null;const a=e.objectIdField,n="globalIdField"in e?e.globalIdField:null,i=t.getGlobalId()??(n?t.getAttribute(n):void 0);if(i)return{globalId:i};const s=t.getObjectId()??t.getAttribute(a),r=Number(s);return null==s||isNaN(r)?null:{objectId:r}}async _computeAttachmentFilename(t,e){const a=this.template.filenameExpressionExecutor;if(!a)return t;const s=this.single.feature,r=s?.plainGraphic,o=this._expressionLayer,{attachmentKeyword:l,description:d,label:h}=this.template,c={$originalfeature:s?.original,$editcontext:{editType:e.editType},$layer:o,$featureset:o,$datastore:o?.url,$feature:r,$map:e.map,$formElement:{attachmentKeyword:l,description:d,label:h}},m={rawOutput:!0,spatialReference:e.spatialReference,timeZone:e.timeZone};try{const t=a.isAsync?await a.executeAsync(c,m):a.execute(c,m);if("string"==typeof t&&t.trim().length>0)return t.trim()}catch(p){i(p)||n.getLogger(this).error("Failed evaluating attachment filename expression",p)}return t}async _resolveAttachmentFilename(t,e){return!1===this.useOriginalFilename?await this._computeAttachmentFilename(t,e):t}_makeUniqueFilenameForOperation(t,e){const a=e.toLowerCase(),n=t.get(a)??0;if(t.set(a,n+1),0===n)return e;const i=e.lastIndexOf(".");return`${i>0?e.slice(0,i):e}_${n}${i>0?e.slice(i):""}`}_setValidationCriteriaState(t){this._validationCriterionStates.clear();for(const e of S){const a=t[e];a&&this._validationCriterionStates.set(e,a)}}_setUnsupportedFileTypeValidationError(t){this._hasUnsupportedFileTypeValidationError!==t&&(this._hasUnsupportedFileTypeValidationError=t)}_setValidationCriterionState(t,e,a){"danger"!==t[e]&&(t[e]=a)}_isReplacementFileAllowed(t,e){const a=m(e);if(!this.isFileAllowed(e))return!1;const n=p(t);return null==n||n===a}async _validateAttachmentFile(t,e,a){let n=!0;const i=m(t);for(const s of this._nestableInputs){const e=f.getAttachmentCategoryForInputType(s.type);if(null==i||e===i){if("document"===s.type&&null!=s.maxFileSize){const e=t.size<=1048576*s.maxFileSize;this._setValidationCriterionState(a,"maximum-file-size",e?"success":"danger"),n=n&&e}if(("audio"===s.type||"video"===s.type)&&null!=s.maxDuration){const e=await f.getMediaDurationInSeconds(t,s.type),i=null!=e&&e<=s.maxDuration;this._setValidationCriterionState(a,"audio"===s.type?"maximum-audio-length":"maximum-video-length",i?"success":"danger"),n=n&&i}if("image"===s.type&&null!=s.maxImageSize){const e=await f.getImageDimensionsInPixels(t),i=e?Math.max(e.width,e.height):null,r=null==i||i<=s.maxImageSize;this._setValidationCriterionState(a,"maximum-image-size",r?"success":"danger"),n=n&&r}}}if(null!=e&&null!=this.maxAttachmentCount){const t=e<=this.maxAttachmentCount;this._setValidationCriterionState(a,"maximum-number-of-files",t?"success":"danger"),n=n&&t}return n}_stageReplaceAttachment(t,e,a){const n=this._getAttachmentKey(t);if(!n)return;const i=this._stagedAdds.find(t=>t.key===n);if(i)return i.data=e,i.info.name=a,i.info.contentType=e.type,i.info.size=e.size,this._setTemporaryAttachmentUrl(n,e),void this._recomputeAttachments();const s=this._stagedUpdates.get(n);this._setTemporaryAttachmentUrl(n,e),this._failedStagedUpdateHydrations.delete(n),this._pendingStagedUpdateHydrations.delete(n),this._stagedUpdates.set(n,{...s,key:n,info:t,isReplacement:!0,contentType:e.type||s?.contentType||t.contentType,data:e,name:a,size:e.size}),this._recomputeAttachments()}_getInitialAttachment(t){return this._initialAttachments.find(e=>this._getAttachmentKey(e)===t)}_normalizeAttachmentName(t){const{name:e}=t;"string"==typeof e&&(t.name=e.trim())}_getAttachmentKey(t){return u(t)}_clearStagedUpdateTracking(t){this._stagedUpdates.delete(t),this._failedStagedUpdateHydrations.delete(t),this._pendingStagedUpdateHydrations.delete(t)}async _hydrateStagedUpdateData(t){const a=this._getAttachmentKey(t),s=t.url;if(!a||!s)return!1;try{const{data:n}=await e(s,{responseType:"blob"});this._failedStagedUpdateHydrations.delete(a);const i=this._stagedUpdates.get(a);return!(!i||i.data||this._stagedDeletes.has(a))&&(this._stagedUpdates.set(a,{...i,info:t,isReplacement:i.isReplacement??!1,contentType:i.contentType??t.contentType??n.type,data:n}),!0)}catch(r){const t=this._stagedUpdates.get(a);return!t||t.data||this._stagedDeletes.has(a)||this._failedStagedUpdateHydrations.add(a),i(r)||n.getLogger(this).error("Failed to fetch attachment data for staged update",r),!1}}_setTemporaryAttachmentUrl(t,e){if(this._clearTemporaryAttachmentUrl(t),!(e instanceof Blob))return;const a=URL.createObjectURL(e);return this._temporaryAttachmentUrls.set(t,a),a}_clearTemporaryAttachmentUrl(t){const e=this._temporaryAttachmentUrls.get(t);e&&(URL.revokeObjectURL(e),this._temporaryAttachmentUrls.delete(t))}_clearTemporaryAttachmentUrls(){for(const t of this._temporaryAttachmentUrls.values())URL.revokeObjectURL(t);this._temporaryAttachmentUrls.clear()}};t([l()],C.prototype,"allowUserRename",null),t([l()],C.prototype,"addDisabled",null),t([l()],C.prototype,"effectiveAttachmentCount",null),t([l()],C.prototype,"accept",null),t([l()],C.prototype,"categories",null),t([l()],C.prototype,"attachmentKeyword",null),t([l()],C.prototype,"attachments",void 0),t([l()],C.prototype,"displayFilename",null),t([l({readOnly:!0})],C.prototype,"allAttachmentsVisibleOnDefaultPage",null),t([l()],C.prototype,"canUploadFiles",null),t([l()],C.prototype,"hasCaptureInputs",null),t([l()],C.prototype,"captureMediaType",null),t([l()],C.prototype,"isCaptureOnly",null),t([l({readOnly:!0})],C.prototype,"defaultPageAttachments",null),t([l()],C.prototype,"displayCount",void 0),t([l()],C.prototype,"feature",null),t([l()],C.prototype,"group",void 0),t([l()],C.prototype,"hasAttachmentChanges",null),t([l()],C.prototype,"hasInvalidAttachmentName",null),t([l()],C.prototype,"attachmentCount",null),t([l()],C.prototype,"hasMinimumAttachmentCountNotMet",null),t([l()],C.prototype,"hasReachedAttachmentLimit",null),t([l()],C.prototype,"hasExceededAttachmentLimit",null),t([l({readOnly:!0})],C.prototype,"hasPendingAttachmentUpdateData",null),t([l()],C.prototype,"input",null),t([l()],C.prototype,"layer",null),t([l()],C.prototype,"maxAttachmentCount",null),t([l()],C.prototype,"minAttachmentCount",null),t([l({readOnly:!0})],C.prototype,"single",void 0),t([l({readOnly:!0})],C.prototype,"type",void 0),t([l({readOnly:!0})],C.prototype,"supportsResize",null),t([l()],C.prototype,"useOriginalFilename",null),t([l({readOnly:!0})],C.prototype,"valid",null),t([l()],C.prototype,"_initialAttachments",void 0),t([l()],C.prototype,"_expressionLayer",null),t([l()],C.prototype,"_stagedAdds",void 0),t([l()],C.prototype,"_stagedDeletes",void 0),t([l()],C.prototype,"_stagedUpdates",void 0),t([l()],C.prototype,"_failedStagedUpdateHydrations",void 0),t([l()],C.prototype,"_pendingStagedUpdateHydrations",void 0),t([l()],C.prototype,"_temporaryAttachmentUrls",void 0),t([l()],C.prototype,"_hasUnsupportedFileTypeValidationError",void 0),t([l()],C.prototype,"hasInvalidValidationCriteria",null),t([l()],C.prototype,"hasUnsupportedFileTypeValidationError",null),t([l()],C.prototype,"validationCriterionStates",null),t([l()],C.prototype,"_featureIdentifier",null),C=t([d("esri.widgets.BatchAttributeForm.inputs.AttachmentElementInput")],C);const b=C;function w(t,e){switch(e){case"audio":t.add("audio");break;case"document":t.add("document");break;case"image":case"signature":t.add("image");break;case"video":t.add("video")}}function T(t){return"document"!==t.type&&"capture"===t.inputMethod}function F(t){return T(t)}function x(t){return"document"===t.type||"capture"!==t.inputMethod}export{b as default};