@arcgis/core 4.32.0-next.20250130 → 4.32.0-next.20250201

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 (531) hide show
  1. package/WebScene.js +1 -1
  2. package/arcade/featureset/support/shared.js +1 -1
  3. package/arcade/geometry/unitConversion.js +1 -1
  4. package/assets/esri/core/workers/RemoteClient.js +1 -1
  5. package/assets/esri/core/workers/chunks/{4696278d033907a067c7.js → 085462ba3da7849fc296.js} +1 -1
  6. package/assets/esri/core/workers/chunks/0a19e1aec6a5502e391a.js +1 -0
  7. package/assets/esri/core/workers/chunks/25c8cc30faade043c8dc.js.LICENSE.txt +1 -1
  8. package/assets/esri/core/workers/chunks/308ec51ff4a66f7fcb0d.js.LICENSE.txt +1 -1
  9. package/assets/esri/core/workers/chunks/34d464dacee52739c98c.js +1 -0
  10. package/assets/esri/core/workers/chunks/39e38aab86dcee3f79be.js +1 -0
  11. package/assets/esri/core/workers/chunks/{149bad940feb0764b350.js → 613db14d698741886753.js} +1 -1
  12. package/assets/esri/core/workers/chunks/6e8905f20101c1f4509d.js.LICENSE.txt +1 -1
  13. package/assets/esri/core/workers/chunks/6ec108bd955e064256b5.js +1 -0
  14. package/assets/esri/core/workers/chunks/72cf9192292e5c85c6df.js.LICENSE.txt +1 -1
  15. package/assets/esri/core/workers/chunks/{9011704b258ecbfb6d9b.js → 7d3a441d2eb18d709ef9.js} +2 -2
  16. package/assets/esri/core/workers/chunks/{9011704b258ecbfb6d9b.js.LICENSE.txt → 7d3a441d2eb18d709ef9.js.LICENSE.txt} +1 -1
  17. package/assets/esri/core/workers/chunks/{0ebdf0d1fd2034b24519.js → af2a70d33afb12bb536f.js} +7 -7
  18. package/assets/esri/core/workers/chunks/b21b152fa15896577242.js.LICENSE.txt +1 -1
  19. package/assets/esri/core/workers/chunks/bf9bc52a3c559108c19a.js.LICENSE.txt +1 -1
  20. package/assets/esri/core/workers/chunks/c032bcd25e2e7a57ad43.js +1 -0
  21. package/assets/esri/core/workers/chunks/c4b0e3f7dcad6c7ea620.js +314 -0
  22. package/assets/esri/core/workers/chunks/c94ec324ecad77c53a87.js +1 -0
  23. package/assets/esri/core/workers/chunks/{c80507443f896dbfaba6.js → e4b80c8f4c45fd78bde1.js} +1 -1
  24. package/assets/esri/core/workers/chunks/{d4760e583dfac95dc8a1.js → ffa2b9d70830aed03a8f.js} +1 -1
  25. package/assets/esri/themes/base/_core.scss +4 -0
  26. package/assets/esri/themes/base/widgets/_BatchAttributeForm.scss +7 -2
  27. package/assets/esri/themes/base/widgets/_Editor.scss +31 -0
  28. package/assets/esri/themes/base/widgets/_FilterBuilder.scss +24 -0
  29. package/assets/esri/themes/base/widgets/_FilterCondition.scss +12 -0
  30. package/assets/esri/themes/base/widgets/_OrientedImageryViewer.scss +1 -1
  31. package/assets/esri/themes/dark/main.css +1 -1
  32. package/assets/esri/themes/light/main.css +1 -1
  33. package/assets/esri/themes/light/view.css +1 -1
  34. package/assets/esri/views/interactive/tooltip/t9n/Tooltip.json +1 -1
  35. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_ar.json +1 -1
  36. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_bg.json +1 -1
  37. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_bs.json +1 -1
  38. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_ca.json +1 -1
  39. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_cs.json +1 -1
  40. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_da.json +1 -1
  41. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_de.json +1 -1
  42. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_el.json +1 -1
  43. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_en.json +1 -1
  44. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_es.json +1 -1
  45. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_et.json +1 -1
  46. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_fi.json +1 -1
  47. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_fr.json +1 -1
  48. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_he.json +1 -1
  49. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_hr.json +1 -1
  50. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_hu.json +1 -1
  51. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_id.json +1 -1
  52. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_it.json +1 -1
  53. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_ja.json +1 -1
  54. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_ko.json +1 -1
  55. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_lt.json +1 -1
  56. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_lv.json +1 -1
  57. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_nl.json +1 -1
  58. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_no.json +1 -1
  59. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_pl.json +1 -1
  60. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_pt-BR.json +1 -1
  61. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_pt-PT.json +1 -1
  62. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_ro.json +1 -1
  63. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_ru.json +1 -1
  64. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_sk.json +1 -1
  65. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_sl.json +1 -1
  66. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_sr.json +1 -1
  67. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_sv.json +1 -1
  68. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_th.json +1 -1
  69. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_tr.json +1 -1
  70. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_uk.json +1 -1
  71. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_vi.json +1 -1
  72. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_zh-CN.json +1 -1
  73. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_zh-HK.json +1 -1
  74. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_zh-TW.json +1 -1
  75. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm.json +1 -1
  76. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ar.json +1 -1
  77. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_bg.json +1 -1
  78. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_bs.json +1 -1
  79. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ca.json +1 -1
  80. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_cs.json +1 -1
  81. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_da.json +1 -1
  82. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_de.json +1 -1
  83. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_el.json +1 -1
  84. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_en.json +1 -1
  85. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_es.json +1 -1
  86. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_et.json +1 -1
  87. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_fi.json +1 -1
  88. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_fr.json +1 -1
  89. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_he.json +1 -1
  90. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_hr.json +1 -1
  91. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_hu.json +1 -1
  92. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_id.json +1 -1
  93. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_it.json +1 -1
  94. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ja.json +1 -1
  95. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ko.json +1 -1
  96. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_lt.json +1 -1
  97. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_lv.json +1 -1
  98. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_nl.json +1 -1
  99. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_no.json +1 -1
  100. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_pl.json +1 -1
  101. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_pt-BR.json +1 -1
  102. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_pt-PT.json +1 -1
  103. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ro.json +1 -1
  104. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ru.json +1 -1
  105. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_sk.json +1 -1
  106. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_sl.json +1 -1
  107. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_sr.json +1 -1
  108. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_sv.json +1 -1
  109. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_th.json +1 -1
  110. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_tr.json +1 -1
  111. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_uk.json +1 -1
  112. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_vi.json +1 -1
  113. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_zh-CN.json +1 -1
  114. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_zh-HK.json +1 -1
  115. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_zh-TW.json +1 -1
  116. package/assets/esri/widgets/Directions/t9n/Directions.json +1 -1
  117. package/assets/esri/widgets/Directions/t9n/Directions_ar.json +1 -1
  118. package/assets/esri/widgets/Directions/t9n/Directions_bg.json +1 -1
  119. package/assets/esri/widgets/Directions/t9n/Directions_bs.json +1 -1
  120. package/assets/esri/widgets/Directions/t9n/Directions_ca.json +1 -1
  121. package/assets/esri/widgets/Directions/t9n/Directions_cs.json +1 -1
  122. package/assets/esri/widgets/Directions/t9n/Directions_da.json +1 -1
  123. package/assets/esri/widgets/Directions/t9n/Directions_de.json +1 -1
  124. package/assets/esri/widgets/Directions/t9n/Directions_el.json +1 -1
  125. package/assets/esri/widgets/Directions/t9n/Directions_en.json +1 -1
  126. package/assets/esri/widgets/Directions/t9n/Directions_es.json +1 -1
  127. package/assets/esri/widgets/Directions/t9n/Directions_et.json +1 -1
  128. package/assets/esri/widgets/Directions/t9n/Directions_fi.json +1 -1
  129. package/assets/esri/widgets/Directions/t9n/Directions_fr.json +1 -1
  130. package/assets/esri/widgets/Directions/t9n/Directions_he.json +1 -1
  131. package/assets/esri/widgets/Directions/t9n/Directions_hr.json +1 -1
  132. package/assets/esri/widgets/Directions/t9n/Directions_hu.json +1 -1
  133. package/assets/esri/widgets/Directions/t9n/Directions_id.json +1 -1
  134. package/assets/esri/widgets/Directions/t9n/Directions_it.json +1 -1
  135. package/assets/esri/widgets/Directions/t9n/Directions_ja.json +1 -1
  136. package/assets/esri/widgets/Directions/t9n/Directions_ko.json +1 -1
  137. package/assets/esri/widgets/Directions/t9n/Directions_lt.json +1 -1
  138. package/assets/esri/widgets/Directions/t9n/Directions_lv.json +1 -1
  139. package/assets/esri/widgets/Directions/t9n/Directions_nl.json +1 -1
  140. package/assets/esri/widgets/Directions/t9n/Directions_no.json +1 -1
  141. package/assets/esri/widgets/Directions/t9n/Directions_pl.json +1 -1
  142. package/assets/esri/widgets/Directions/t9n/Directions_pt-BR.json +1 -1
  143. package/assets/esri/widgets/Directions/t9n/Directions_pt-PT.json +1 -1
  144. package/assets/esri/widgets/Directions/t9n/Directions_ro.json +1 -1
  145. package/assets/esri/widgets/Directions/t9n/Directions_ru.json +1 -1
  146. package/assets/esri/widgets/Directions/t9n/Directions_sk.json +1 -1
  147. package/assets/esri/widgets/Directions/t9n/Directions_sl.json +1 -1
  148. package/assets/esri/widgets/Directions/t9n/Directions_sr.json +1 -1
  149. package/assets/esri/widgets/Directions/t9n/Directions_sv.json +1 -1
  150. package/assets/esri/widgets/Directions/t9n/Directions_th.json +1 -1
  151. package/assets/esri/widgets/Directions/t9n/Directions_tr.json +1 -1
  152. package/assets/esri/widgets/Directions/t9n/Directions_uk.json +1 -1
  153. package/assets/esri/widgets/Directions/t9n/Directions_vi.json +1 -1
  154. package/assets/esri/widgets/Directions/t9n/Directions_zh-CN.json +1 -1
  155. package/assets/esri/widgets/Directions/t9n/Directions_zh-HK.json +1 -1
  156. package/assets/esri/widgets/Directions/t9n/Directions_zh-TW.json +1 -1
  157. package/assets/esri/widgets/Editor/t9n/Editor.json +1 -1
  158. package/assets/esri/widgets/Editor/t9n/Editor_ar.json +1 -1
  159. package/assets/esri/widgets/Editor/t9n/Editor_bg.json +1 -1
  160. package/assets/esri/widgets/Editor/t9n/Editor_bs.json +1 -1
  161. package/assets/esri/widgets/Editor/t9n/Editor_ca.json +1 -1
  162. package/assets/esri/widgets/Editor/t9n/Editor_cs.json +1 -1
  163. package/assets/esri/widgets/Editor/t9n/Editor_da.json +1 -1
  164. package/assets/esri/widgets/Editor/t9n/Editor_de.json +1 -1
  165. package/assets/esri/widgets/Editor/t9n/Editor_el.json +1 -1
  166. package/assets/esri/widgets/Editor/t9n/Editor_en.json +1 -1
  167. package/assets/esri/widgets/Editor/t9n/Editor_es.json +1 -1
  168. package/assets/esri/widgets/Editor/t9n/Editor_et.json +1 -1
  169. package/assets/esri/widgets/Editor/t9n/Editor_fi.json +1 -1
  170. package/assets/esri/widgets/Editor/t9n/Editor_fr.json +1 -1
  171. package/assets/esri/widgets/Editor/t9n/Editor_he.json +1 -1
  172. package/assets/esri/widgets/Editor/t9n/Editor_hr.json +1 -1
  173. package/assets/esri/widgets/Editor/t9n/Editor_hu.json +1 -1
  174. package/assets/esri/widgets/Editor/t9n/Editor_id.json +1 -1
  175. package/assets/esri/widgets/Editor/t9n/Editor_it.json +1 -1
  176. package/assets/esri/widgets/Editor/t9n/Editor_ja.json +1 -1
  177. package/assets/esri/widgets/Editor/t9n/Editor_ko.json +1 -1
  178. package/assets/esri/widgets/Editor/t9n/Editor_lt.json +1 -1
  179. package/assets/esri/widgets/Editor/t9n/Editor_lv.json +1 -1
  180. package/assets/esri/widgets/Editor/t9n/Editor_nl.json +1 -1
  181. package/assets/esri/widgets/Editor/t9n/Editor_no.json +1 -1
  182. package/assets/esri/widgets/Editor/t9n/Editor_pl.json +1 -1
  183. package/assets/esri/widgets/Editor/t9n/Editor_pt-BR.json +1 -1
  184. package/assets/esri/widgets/Editor/t9n/Editor_pt-PT.json +1 -1
  185. package/assets/esri/widgets/Editor/t9n/Editor_ro.json +1 -1
  186. package/assets/esri/widgets/Editor/t9n/Editor_ru.json +1 -1
  187. package/assets/esri/widgets/Editor/t9n/Editor_sk.json +1 -1
  188. package/assets/esri/widgets/Editor/t9n/Editor_sl.json +1 -1
  189. package/assets/esri/widgets/Editor/t9n/Editor_sr.json +1 -1
  190. package/assets/esri/widgets/Editor/t9n/Editor_sv.json +1 -1
  191. package/assets/esri/widgets/Editor/t9n/Editor_th.json +1 -1
  192. package/assets/esri/widgets/Editor/t9n/Editor_tr.json +1 -1
  193. package/assets/esri/widgets/Editor/t9n/Editor_uk.json +1 -1
  194. package/assets/esri/widgets/Editor/t9n/Editor_vi.json +1 -1
  195. package/assets/esri/widgets/Editor/t9n/Editor_zh-CN.json +1 -1
  196. package/assets/esri/widgets/Editor/t9n/Editor_zh-HK.json +1 -1
  197. package/assets/esri/widgets/Editor/t9n/Editor_zh-TW.json +1 -1
  198. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm.json +1 -1
  199. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_ar.json +1 -1
  200. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_bg.json +1 -1
  201. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_bs.json +1 -1
  202. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_ca.json +1 -1
  203. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_cs.json +1 -1
  204. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_da.json +1 -1
  205. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_de.json +1 -1
  206. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_el.json +1 -1
  207. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_en.json +1 -1
  208. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_es.json +1 -1
  209. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_et.json +1 -1
  210. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_fi.json +1 -1
  211. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_fr.json +1 -1
  212. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_he.json +1 -1
  213. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_hr.json +1 -1
  214. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_hu.json +1 -1
  215. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_id.json +1 -1
  216. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_it.json +1 -1
  217. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_ja.json +1 -1
  218. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_ko.json +1 -1
  219. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_lt.json +1 -1
  220. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_lv.json +1 -1
  221. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_nl.json +1 -1
  222. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_no.json +1 -1
  223. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_pl.json +1 -1
  224. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_pt-BR.json +1 -1
  225. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_pt-PT.json +1 -1
  226. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_ro.json +1 -1
  227. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_ru.json +1 -1
  228. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_sk.json +1 -1
  229. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_sl.json +1 -1
  230. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_sr.json +1 -1
  231. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_sv.json +1 -1
  232. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_th.json +1 -1
  233. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_tr.json +1 -1
  234. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_uk.json +1 -1
  235. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_vi.json +1 -1
  236. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_zh-CN.json +1 -1
  237. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_zh-HK.json +1 -1
  238. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_zh-TW.json +1 -1
  239. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer.json +1 -1
  240. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ar.json +1 -1
  241. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_bg.json +1 -1
  242. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_bs.json +1 -1
  243. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ca.json +1 -1
  244. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_cs.json +1 -1
  245. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_da.json +1 -1
  246. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_de.json +1 -1
  247. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_el.json +1 -1
  248. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_en.json +1 -1
  249. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_es.json +1 -1
  250. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_et.json +1 -1
  251. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_fi.json +1 -1
  252. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_fr.json +1 -1
  253. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_he.json +1 -1
  254. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_hr.json +1 -1
  255. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_hu.json +1 -1
  256. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_id.json +1 -1
  257. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_it.json +1 -1
  258. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ja.json +1 -1
  259. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ko.json +1 -1
  260. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_lt.json +1 -1
  261. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_lv.json +1 -1
  262. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_nl.json +1 -1
  263. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_no.json +1 -1
  264. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pl.json +1 -1
  265. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pt-BR.json +1 -1
  266. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pt-PT.json +1 -1
  267. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ro.json +1 -1
  268. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ru.json +1 -1
  269. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sk.json +1 -1
  270. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sl.json +1 -1
  271. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sr.json +1 -1
  272. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sv.json +1 -1
  273. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_th.json +1 -1
  274. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_tr.json +1 -1
  275. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_uk.json +1 -1
  276. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_vi.json +1 -1
  277. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-CN.json +1 -1
  278. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-HK.json +1 -1
  279. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-TW.json +1 -1
  280. package/assets/esri/widgets/support/FilterBuilder/t9n/FilterBuilder.json +1 -0
  281. package/assets/esri/widgets/support/FilterBuilder/t9n/FilterBuilder_en.json +1 -0
  282. package/assets/esri/widgets/support/FilterCondition/t9n/FilterCondition.json +1 -0
  283. package/assets/esri/widgets/support/FilterCondition/t9n/FilterCondition_en.json +1 -0
  284. package/form/elements/inputs.d.ts +10 -0
  285. package/form/elements.d.ts +6 -0
  286. package/geometry/support/typeUtils.js +1 -1
  287. package/geometry.d.ts +6 -0
  288. package/interfaces.d.ts +262 -62
  289. package/layers/FeatureLayer.js +1 -1
  290. package/layers/graphics/OptimizedGeometry.js +1 -1
  291. package/layers/graphics/dehydratedFeatures.js +1 -1
  292. package/layers/graphics/sources/ParquetSource.js +1 -1
  293. package/layers/orientedImagery/transformations/utils.js +1 -1
  294. package/layers/support/domainUtils.js +1 -1
  295. package/layers/support/parquetLayerUtils.js +1 -1
  296. package/layers/support/rasterFieldUtils.js +1 -1
  297. package/package.json +3 -3
  298. package/pointCloudRenderers.d.ts +4 -0
  299. package/popup/content.d.ts +8 -0
  300. package/popup/support/UtilityNetworkAssociationType.js +1 -1
  301. package/rasterRenderers.d.ts +7 -0
  302. package/renderers.d.ts +7 -0
  303. package/smartMapping/support/adapters/FeatureLayerAdapter.js +1 -1
  304. package/smartMapping/support/utils.js +1 -1
  305. package/support/basemapDefinitions.js +1 -1
  306. package/support/revision.js +1 -1
  307. package/symbols/cim/animationUtils.js +1 -1
  308. package/symbols/cim/defaultCIMValues.js +1 -1
  309. package/symbols.d.ts +22 -0
  310. package/tables/elements.d.ts +4 -0
  311. package/views/2d/engine/webgl/animations/utils.js +1 -1
  312. package/views/2d/layers/FeatureLayerView2D.js +1 -1
  313. package/views/2d/layers/features/layerAdapters/ParquetLayerAdapter.js +1 -1
  314. package/views/2d/layers/features/layerAdapters/SubtypeGroupLayerAdapter.js +1 -1
  315. package/views/2d/layers/features/layerAdapters/geometryUtils.js +1 -1
  316. package/views/2d/layers/features/support/FeatureSetReaderIndirect.js +1 -1
  317. package/views/2d/layers/features/support/FeatureSetReaderParquet.js +1 -1
  318. package/views/3d/environment/ChapmanAtmosphere.js +1 -1
  319. package/views/3d/environment/ChapmanAtmosphereTechnique.js +1 -1
  320. package/views/3d/environment/CloudsComposition.js +1 -1
  321. package/views/3d/environment/CloudsCompositionTechnique.js +1 -1
  322. package/views/3d/environment/CloudsRenderer.js +1 -1
  323. package/views/3d/environment/CloudsTechnique.js +1 -1
  324. package/views/3d/environment/Fog.js +1 -1
  325. package/views/3d/environment/FogTechnique.js +1 -1
  326. package/views/3d/environment/LocalAtmosphere.js +1 -1
  327. package/views/3d/environment/MarsAtmosphere.js +1 -1
  328. package/views/3d/environment/NoiseTextureAtlas.js +1 -1
  329. package/views/3d/environment/NoiseTextureAtlasTechnique.js +1 -1
  330. package/views/3d/environment/Precipitation.js +1 -1
  331. package/views/3d/environment/PrecipitationTechnique.js +1 -1
  332. package/views/3d/environment/SimpleAtmosphereTechnique.js +1 -1
  333. package/views/3d/interactive/editingTools/media/ControlPointOperations.js +1 -1
  334. package/views/3d/layers/i3s/PointCloudRenderer.js +1 -1
  335. package/views/3d/layers/support/FeatureTileTree3D.js +1 -1
  336. package/views/3d/layers/support/FeatureTileVisibility3D.js +1 -1
  337. package/views/3d/layers/support/MediaLayerInteraction.js +1 -1
  338. package/views/3d/layers/support/MediaLayerInteractionOptions.js +1 -1
  339. package/views/3d/terrain/BlendLayersTechnique.js +1 -1
  340. package/views/3d/terrain/OverlayRenderer.js +1 -1
  341. package/views/3d/terrain/RasterColorizerTechnique.js +1 -1
  342. package/views/3d/terrain/TerrainRenderer.js +1 -1
  343. package/views/3d/terrain/TileCompositor.js +1 -1
  344. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  345. package/views/3d/webgl-engine/collections/Component/Material/ComponentTechnique.js +1 -1
  346. package/views/3d/webgl-engine/core/renderPasses/RenderPassManager.js +1 -1
  347. package/views/3d/webgl-engine/core/shaderTechnique/ShaderTechnique.js +1 -1
  348. package/views/3d/webgl-engine/core/shaderTechnique/ShaderTechniqueRepository.js +1 -1
  349. package/views/3d/webgl-engine/effects/RenderPlugin.js +1 -1
  350. package/views/3d/webgl-engine/effects/RenderPluginManager.js +1 -1
  351. package/views/3d/webgl-engine/effects/blit/Blit.js +1 -1
  352. package/views/3d/webgl-engine/effects/bloom/BloomBlurTechnique.js +1 -1
  353. package/views/3d/webgl-engine/effects/bloom/BloomCompositionTechnique.js +1 -1
  354. package/views/3d/webgl-engine/effects/bloom/BloomDepthAdjustTechnique.js +1 -1
  355. package/views/3d/webgl-engine/effects/bloom/BloomRenderNode.js +1 -1
  356. package/views/3d/webgl-engine/effects/focusArea/FocusAreaColorNode.js +1 -1
  357. package/views/3d/webgl-engine/effects/focusArea/FocusAreaColorTechnique.js +1 -1
  358. package/views/3d/webgl-engine/effects/focusArea/FocusAreaMaskNode.js +1 -1
  359. package/views/3d/webgl-engine/effects/focusArea/FocusAreaMaskTechnique.js +1 -1
  360. package/views/3d/webgl-engine/effects/geometry/RenderOccludedRenderNode.js +1 -1
  361. package/views/3d/webgl-engine/effects/haze/Haze.js +1 -1
  362. package/views/3d/webgl-engine/effects/haze/HazeCompositingTechnique.js +1 -1
  363. package/views/3d/webgl-engine/effects/haze/HazeTechnique.js +1 -1
  364. package/views/3d/webgl-engine/effects/highlight/Highlight.js +1 -1
  365. package/views/3d/webgl-engine/effects/highlight/HighlightApplyTechnique.js +1 -1
  366. package/views/3d/webgl-engine/effects/highlight/HighlightDownsampleTechnique.js +1 -1
  367. package/views/3d/webgl-engine/effects/highlight/HighlightToSingleTechnique.js +1 -1
  368. package/views/3d/webgl-engine/effects/highlight/ShadowHighlight.js +1 -1
  369. package/views/3d/webgl-engine/effects/highlight/ShadowHighlightTechnique.js +1 -1
  370. package/views/3d/webgl-engine/effects/highlight/SingleHighlightApplyTechnique.js +1 -1
  371. package/views/3d/webgl-engine/effects/highlight/SingleHighlightBlurTechnique.js +1 -1
  372. package/views/3d/webgl-engine/effects/laserlines/LaserLineRenderer.js +1 -1
  373. package/views/3d/webgl-engine/effects/laserlines/LaserlinePathTechnique.js +1 -1
  374. package/views/3d/webgl-engine/effects/laserlines/LaserlineTechnique.js +1 -1
  375. package/views/3d/webgl-engine/effects/magnifier/Magnifier.js +1 -1
  376. package/views/3d/webgl-engine/effects/magnifier/MagnifierTechnique.js +1 -1
  377. package/views/3d/webgl-engine/effects/smaa/SMAA.js +1 -1
  378. package/views/3d/webgl-engine/effects/smaa/SMAABlendWeightsTechnique.js +1 -1
  379. package/views/3d/webgl-engine/effects/smaa/SMAABlurTechnique.js +1 -1
  380. package/views/3d/webgl-engine/effects/smaa/SMAAEdgeDetectTechnique.js +1 -1
  381. package/views/3d/webgl-engine/effects/ssao/SSAO.js +1 -1
  382. package/views/3d/webgl-engine/effects/ssao/SSAOBlurTechnique.js +1 -1
  383. package/views/3d/webgl-engine/effects/ssao/SSAOTechnique.js +1 -1
  384. package/views/3d/webgl-engine/effects/stars/Stars.js +1 -1
  385. package/views/3d/webgl-engine/effects/stars/StarsTechnique.js +1 -1
  386. package/views/3d/webgl-engine/effects/transparency/OITBlend.js +1 -1
  387. package/views/3d/webgl-engine/effects/transparency/OITBlendTechnique.js +1 -1
  388. package/views/3d/webgl-engine/lib/CompositingHelper.js +1 -1
  389. package/views/3d/webgl-engine/lib/DrapedHeatmapRenderer.js +1 -1
  390. package/views/3d/webgl-engine/lib/GLMaterial.js +1 -1
  391. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  392. package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
  393. package/views/3d/webgl-engine/lib/ShadowCastRenderer.js +1 -1
  394. package/views/3d/webgl-engine/lib/SortedRenderGeometryRenderer.js +1 -1
  395. package/views/3d/webgl-engine/lib/TextureRepository.js +1 -1
  396. package/views/3d/webgl-engine/lib/TextureTechnique.js +1 -1
  397. package/views/3d/webgl-engine/lib/Viewshed.js +1 -1
  398. package/views/3d/webgl-engine/lib/edgeRendering/EdgeRenderer.js +1 -1
  399. package/views/3d/webgl-engine/lib/edgeRendering/EdgeShaderTechnique.js +1 -1
  400. package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
  401. package/views/3d/webgl-engine/materials/CheckerBoardMaterial.js +1 -1
  402. package/views/3d/webgl-engine/materials/ColorMaterial.js +1 -1
  403. package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
  404. package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
  405. package/views/3d/webgl-engine/materials/HeatmapDensityMaterial.js +1 -1
  406. package/views/3d/webgl-engine/materials/ImageMaterial.js +1 -1
  407. package/views/3d/webgl-engine/materials/LineCalloutMaterial.js +1 -1
  408. package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
  409. package/views/3d/webgl-engine/materials/MeasurementArrowMaterial.js +1 -1
  410. package/views/3d/webgl-engine/materials/NativeLineMaterial.js +1 -1
  411. package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
  412. package/views/3d/webgl-engine/materials/PathTechnique.js +1 -1
  413. package/views/3d/webgl-engine/materials/PatternMaterial.js +1 -1
  414. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  415. package/views/3d/webgl-engine/materials/ShadedColorMaterial.js +1 -1
  416. package/views/3d/webgl-engine/materials/SlicePlaneMaterial.js +1 -1
  417. package/views/3d/webgl-engine/materials/WaterGLMaterial.js +1 -1
  418. package/views/3d/webgl-engine/materials/WaterTechnique.js +1 -1
  419. package/views/3d/webgl-engine/shaders/AtmosphereCompositingTechnique.js +1 -1
  420. package/views/3d/webgl-engine/shaders/CheckerBoardTechnique.js +1 -1
  421. package/views/3d/webgl-engine/shaders/ColorMaterialTechnique.js +1 -1
  422. package/views/3d/webgl-engine/shaders/CompositingTechnique.js +1 -1
  423. package/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js +1 -1
  424. package/views/3d/webgl-engine/shaders/HUDCompositingTechnique.js +1 -1
  425. package/views/3d/webgl-engine/shaders/HUDMaterialTechnique.js +1 -1
  426. package/views/3d/webgl-engine/shaders/HeatmapDensityTechnique.js +1 -1
  427. package/views/3d/webgl-engine/shaders/HeatmapTechnique.js +1 -1
  428. package/views/3d/webgl-engine/shaders/ImageMaterialTechnique.js +1 -1
  429. package/views/3d/webgl-engine/shaders/LineCalloutTechnique.js +1 -1
  430. package/views/3d/webgl-engine/shaders/LineMarkerTechnique.js +1 -1
  431. package/views/3d/webgl-engine/shaders/MeasurementArrowTechnique.js +1 -1
  432. package/views/3d/webgl-engine/shaders/NativeLineTechnique.js +1 -1
  433. package/views/3d/webgl-engine/shaders/OverlayCompositingTechnique.js +1 -1
  434. package/views/3d/webgl-engine/shaders/PatternTechnique.js +1 -1
  435. package/views/3d/webgl-engine/shaders/PointRendererTechnique.js +1 -1
  436. package/views/3d/webgl-engine/shaders/RealisticTreeTechnique.js +1 -1
  437. package/views/3d/webgl-engine/shaders/RibbonLineTechnique.js +1 -1
  438. package/views/3d/webgl-engine/shaders/ShadedColorMaterialTechnique.js +1 -1
  439. package/views/3d/webgl-engine/shaders/ShadowCastAccumulateTechnique.js +1 -1
  440. package/views/3d/webgl-engine/shaders/ShadowCastVisualizeTechnique.js +1 -1
  441. package/views/3d/webgl-engine/shaders/SlicePlaneMaterialTechnique.js +1 -1
  442. package/views/3d/webgl-engine/shaders/TerrainTechnique.js +1 -1
  443. package/views/3d/webgl-engine/shaders/ViewshedTechnique.js +1 -1
  444. package/views/3d/webgl.js +1 -1
  445. package/views/FocusAreas.js +1 -1
  446. package/views/draw/DrawGraphicTool.js +1 -1
  447. package/views/draw/DrawOperation.js +1 -1
  448. package/views/draw/support/Box.js +1 -1
  449. package/views/draw/support/helpMessageUtils.js +1 -1
  450. package/views/draw/support/tooltipUtils.js +1 -1
  451. package/views/interactive/keybindings.js +1 -1
  452. package/views/interactive/snapping/featureSources/FeatureCollectionSnappingSource.js +1 -1
  453. package/views/interactive/snapping/featureSources/FeatureServiceSnappingSource.js +1 -1
  454. package/views/interactive/snapping/snappingUtils.js +1 -1
  455. package/views/interactive/tooltip/content/tooltipContentFactory.js +1 -1
  456. package/views/interactive/tooltip/infos/DrawCircleTooltipInfo.js +1 -1
  457. package/views/interactive/tooltip/infos/DrawMultipointTooltipInfo.js +5 -0
  458. package/views/interactive/tooltip/infos/DrawRectangleTooltipInfo.js +1 -1
  459. package/views/layers/FeatureLayerView.js +1 -1
  460. package/views/layers/MediaLayerView.js +1 -1
  461. package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
  462. package/widgets/BatchAttributeForm/batchAttributeFormUtils.js +1 -1
  463. package/widgets/BatchAttributeForm/expressions/ExpressionsManager.js +1 -1
  464. package/widgets/BatchAttributeForm/expressions/ExpressionsModel.js +1 -1
  465. package/widgets/BatchAttributeForm/inputs/EditableInput.js +1 -1
  466. package/widgets/BatchAttributeForm/inputs/FieldInput.js +1 -1
  467. package/widgets/BatchAttributeForm/inputs/GroupInput.js +1 -1
  468. package/widgets/BatchAttributeForm/inputs/InputBase.js +1 -1
  469. package/widgets/BatchAttributeForm/inputs/support/createBatchFormInputs.js +1 -1
  470. package/widgets/BatchAttributeForm/inputs/support/inputUtils.js +1 -1
  471. package/widgets/BatchAttributeForm/templates/BatchFormTemplate.js +1 -1
  472. package/widgets/BatchAttributeForm/templates/FieldElementTemplate.js +1 -1
  473. package/widgets/BatchAttributeForm/templates/GroupElementTemplate.js +1 -1
  474. package/widgets/BatchAttributeForm/templates/support/createBatchFormTemplate.js +1 -1
  475. package/widgets/BatchAttributeForm/templates/support/hashElementTemplate.js +1 -1
  476. package/widgets/BatchAttributeForm.js +1 -1
  477. package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
  478. package/widgets/Editor/CreateFeaturesWorkflowData.js +1 -1
  479. package/widgets/Editor/EditorViewModel.js +1 -1
  480. package/widgets/Editor/Edits.js +1 -1
  481. package/widgets/Editor/UpdateWorkflow.js +1 -1
  482. package/widgets/Editor/VisibleElements.js +1 -1
  483. package/widgets/Editor/components/CreateFeaturesPanelContent.js +1 -1
  484. package/widgets/Editor/components/PanelToolbar.js +1 -1
  485. package/widgets/Editor/components/PendingFeatureList.js +5 -0
  486. package/widgets/Editor/components/UpdateFeaturePanelContent.js +1 -1
  487. package/widgets/Editor/css.js +1 -1
  488. package/widgets/Editor/workflowUtils.js +1 -1
  489. package/widgets/Editor.js +1 -1
  490. package/widgets/Feature.js +1 -1
  491. package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/AssociationDetails.js +5 -0
  492. package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/FeatureFormUtilityNetworkAssociationList.js +1 -1
  493. package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/FeatureFormUtilityNetworkAssociationSettings.js +1 -1
  494. package/widgets/FeatureForm/FeatureFormViewModel.js +1 -1
  495. package/widgets/FeatureForm/FieldInput.js +1 -1
  496. package/widgets/FeatureForm/UtilityNetworkAssociationInput.js +1 -1
  497. package/widgets/FeatureForm.js +1 -1
  498. package/widgets/LinkChartLayoutSwitcher/LinkChartLayoutSwitcherViewModel.d.ts +4 -0
  499. package/widgets/LinkChartLayoutSwitcher/LinkChartLayoutSwitcherViewModel.js +1 -1
  500. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  501. package/widgets/OrientedImageryViewer/adapters/sketch/MeasurementAdapter.js +1 -1
  502. package/widgets/OrientedImageryViewer/components/ImageLocationWidget.js +5 -0
  503. package/widgets/OrientedImageryViewer/components/ImageOverlays.js +1 -1
  504. package/widgets/OrientedImageryViewer/imageMeasurementUtils.js +1 -1
  505. package/widgets/OrientedImageryViewer/mixins/ImageMeasurementMixin.js +1 -1
  506. package/widgets/OrientedImageryViewer/mixins/SketchHandlerMixin.js +1 -1
  507. package/widgets/OrientedImageryViewer.js +1 -1
  508. package/widgets/PanoramicViewer/PanoramicViewerViewModel.js +1 -1
  509. package/widgets/Search.js +1 -1
  510. package/widgets/ShadowCast/ShadowCastViewModel.js +1 -1
  511. package/widgets/Sketch/SketchViewModel.js +1 -1
  512. package/widgets/Sketch/VisibleElements.js +1 -1
  513. package/widgets/Sketch.js +1 -1
  514. package/widgets/Swipe/SwipeViewModel.js +1 -1
  515. package/widgets/UtilityNetworkTrace.js +1 -1
  516. package/widgets/support/FilterBuilder/FilterBuilderViewModel.js +5 -0
  517. package/widgets/support/FilterBuilder.js +5 -0
  518. package/widgets/support/FilterCondition/FilterConditionViewModel.js +5 -0
  519. package/widgets/support/FilterCondition/conditionUtils.js +5 -0
  520. package/widgets/support/FilterCondition.js +5 -0
  521. package/widgets/support/ItemList.js +1 -1
  522. package/widgets/support/UtilityNetworkAssociations/UtilityNetworkAssociationsViewModel.js +1 -1
  523. package/widgets/support/UtilityNetworkAssociations/utilityNetworkUtils.js +1 -1
  524. package/widgets/support/widget.d.ts +9 -0
  525. package/assets/esri/core/workers/chunks/0bafa546602b776caf2f.js +0 -1
  526. package/assets/esri/core/workers/chunks/1891c9aa162c5df1d27c.js +0 -1
  527. package/assets/esri/core/workers/chunks/69ab4b780f7223cfd7dd.js +0 -1
  528. package/assets/esri/core/workers/chunks/6f796f2836f949ab7359.js +0 -1
  529. package/assets/esri/core/workers/chunks/83edac97a52b26ead1ea.js +0 -314
  530. package/assets/esri/core/workers/chunks/97310e6eec87eeaf58f0.js +0 -1
  531. package/assets/esri/core/workers/chunks/9ffa27d0517bad84572e.js +0 -1
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.32/esri/copyright.txt for details.
4
4
  */
5
- const e="esri-editor",t={base:e,helpMessage:`${e}__help-message`,updateActions:`${e}__update-actions`,updateActionsList:`${e}__update-actions-list`,featureTemplatesContainer:`${e}__feature-templates-container`,templateItemContentEnd:`${e}__template-item-content-end`};export{t as css};
5
+ const e="esri-editor",t={base:e,helpMessage:`${e}__help-message`,updateActions:`${e}__update-actions`,updateActionsList:`${e}__update-actions-list`,featureTemplatesContainer:`${e}__feature-templates-container`,templateItemContentEnd:`${e}__template-item-content-end`,sketchContainer:`${e}__sketch-container`,pendingFeatureListIcon:`${e}__pending-feature-list-icon`};export{t as css};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.32/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../Graphic.js";import{addMany as t}from"../../core/arrayUtils.js";import{createTask as r}from"../../core/asyncUtils.js";import"../../core/has.js";import i from"../../core/Error.js";import{makeHandle as a,handlesGroup as n,abortHandle as s}from"../../core/handleUtils.js";import{clone as l}from"../../core/lang.js";import{whenOrAbort as o,throwIfAborted as c,debounce as u}from"../../core/promiseUtils.js";import{watch as p,whenOnce as y}from"../../core/reactiveUtils.js";import{px2pt as f}from"../../core/screenUtils.js";import{diff as d}from"../../core/accessorSupport/diffUtils.js";import{isSharedTemplateOrMetadata as m,getAllStandardFeatureTemplatesForLayer as g}from"../../editing/templateUtils.js";import{featureHasFields as h,fixFields as b,getDisplayFieldName as w}from"../../layers/support/fieldUtils.js";import{calculateTolerance as v}from"../../renderers/support/clickToleranceUtils.js";import{meterIn as S}from"../../renderers/support/lengthUtils.js";import{getTransformationType as I,TransformationType as j}from"../../renderers/visualVariables/support/sizeVariableUtils.js";import{getRotationAngle as U,getSize as V}from"../../renderers/visualVariables/support/visualVariableUtils.js";import{to3D as T}from"../../symbols/support/symbolConversion.js";import{getDisplayedSymbol as z}from"../../symbols/support/symbolUtils.js";import{GraphicState as F}from"../../views/3d/layers/graphics/GraphicState.js";import{createQueryGeometry as L}from"../../views/support/drapedUtils.js";import{hitTestSelectSimilarDistance as x,filterGraphicHits as k}from"../../views/support/hitTestSelectUtils.js";function A(e){return"update"===e.type}function E(e){const t=e.sourceLayer;if(!t||"feature"!==t.type||!G(t.renderer))return{rotation:null,size:null};let r=null,i=null;const a=t.renderer.getVisualVariablesForType("rotation").filter((t=>(!t.axis||"heading"===t.axis)&&t.field&&!t.valueExpression&&null!=U(t,e)));1===a.length&&(r=P(a[0],t));const n=t.renderer.getVisualVariablesForType("size").filter((t=>t.field&&!t.useSymbolValue&&!t.valueExpression&&I(t)===j.RealWorldSize&&null!=V(t,e)));return 1===n.length&&(i=R(n[0],t)),{rotation:r,size:i}}function P(e,t){const r="heading"===(e.axis||"heading")&&"arithmetic"===e.rotationType?-1:1,i=e.field,a=t.fields&&t.fields.filter((e=>e.name===i)),n=a&&1===a.length?a[0].type:"double",s={initial:0,current:0};return{field:i,fieldType:n,getDefault:()=>Promise.resolve(0),getValue:e=>(s.current=s.initial-r*e,O((s.current+360)%360,n)),setInitialValue:e=>{s.initial=e,s.current=0},isUpdatingInteractively:!1,rotationType:e.rotationType??"geographic"}}function C(e,t){switch(t){case"width":return e[0];case"depth":return e[1];case"height":return e[2];default:return e[2]||e[1]||e[0]}}async function M(e,t,r){if(null==t)return 0;const{symbol:i}=T(t);if(null==i||"web-style"===i.type||"cim"===i.type)return 0;const a=i.symbolLayers.at(0);if(!a)return 0;switch(a.type){case"icon":{const{computeIconLayerResourceSize:e}=await import("../../symbols/support/symbolLayerUtils.js");return a.size||Math.min(se.icon,(await e(a,se.icon))[0])||se.icon}case"text":return a.size||se.text;case"line":return a.size||se.line;case"object":{const{computeObjectLayerResourceSize:t}=await import("../../symbols/support/symbolLayerUtils.js");return C(await t(a,e.scale/se.viewScaleSizeFactor),r)}case"path":return(null!=a.width?a.width:a.height)||e.scale/se.viewScaleSizeFactor;case"extrude":return a.size||e.scale/se.viewScaleSizeFactor;default:return 0}}function R(e,t){const r=e.field,i=e.axis,a=t.fields&&t.fields.filter((e=>e.name===r)),n=a&&1===a.length?a[0].type:"double",s={initial:0,current:0},l=S[e.valueUnit]??1;let o;return o="area"===e.valueRepresentation?e=>(e*l/2)**2*Math.PI:"radius"===e.valueRepresentation||"distance"===e.valueRepresentation?e=>e*l/2:e=>e*l,{field:r,fieldType:n,getDefault:async(e,t)=>O(o(await M(t,e,i)),n),getValue:(e,t)=>(s.initial||(s.initial=t.pixelSizeAt(t.center)),s.current=s.initial*e,O(s.current,n)),setInitialValue:e=>{s.initial=e,s.current=0},isUpdatingInteractively:!1,displayUnit:ce(e.valueUnit),axis:e.axis}}function O(e,t){switch(t){case"small-integer":case"integer":case"long":return Math.round(e);case"double":case"single":return e;default:return 0}}function G(e){switch(e?.type){case"class-breaks":case"simple":case"unique-value":case"dot-density":case"dictionary":case"pie-chart":return!0;default:return!1}}async function D(e,t,r){const i=await z(e,{useSourceLayer:!0,ignoreGraphicSymbol:!0,webStyleCache:t,scale:r});null!=d(e.symbol,i)&&(e.symbol=i)}function Z(e){if(!e)throw new Error("no geometry type");return"multipatch"===e?"mesh":e}async function q(e,t,r){const i=t.layer,n=Q(t);let s=null;const{view:l}=e,o="2d"===l?.type;if(await B(e,i,n,r,o?l.scale:null),o){const t=u((t=>B(e,i,n,r,t)));s=p((()=>l.scale),(e=>t(e)))}const{data:c,editing:y}=i.capabilities;return e.layer.elevationInfo=i.elevationInfo,null==t.geometryToPlace?await e.create(Z(i.geometryType),{graphicProperties:{attributes:n,sourceLayer:i},hasZ:c.supportsZ,defaultZ:(o?y.zDefault:null)??e.defaultCreateOptions.defaultZ}):await e.place(t.geometryToPlace,{graphicProperties:{attributes:n,sourceLayer:i}}),s??a()}function Q(e){const{template:t}=e;if(t&&m(t))throw new i("Shared templates are not yet supported");return{...t?.prototype.attributes,...e.attributeOverrides}}async function B(t,r,i,a,n){const s=new e({sourceLayer:r,attributes:i}),{rotation:l,size:o}=E(s);let c=await z(s,{useSourceLayer:!0,webStyleCache:a,scale:n}),u=!1;for(const e of[o,l]){if(null==e)continue;null==i[e.field]&&(i[e.field]=await e.getDefault(c,t.view),u=!0)}switch(u&&(c=await z(s,{useSourceLayer:!0,webStyleCache:a,scale:n})),c?.type){case"simple-fill":case"polygon-3d":t.polygonSymbol=c;break;case"simple-line":case"line-3d":t.polylineSymbol=c;break;case"simple-marker":case"picture-marker":case"point-3d":case"cim":t.pointSymbol=c;break;case"mesh-3d":t.meshSymbol=c}W(t.tooltipOptions,o,l)}function W(e,t,r){e.visualVariables=null!=t||null!=r?{size:null!=t?{unit:t.displayUnit,axis:t.axis,valueType:t.fieldType}:null,rotation:null!=r?{valueType:r.fieldType,rotationType:r.rotationType??"geographic"}:null}:null}function H(e,t){return e?.find((e=>e.layer===t))}async function J(e,t,r,i){switch(t.type){case"3d":return K(e,t,r,i);case"2d":return N(e,t,r,i)}}async function K(e,r,i,a){if(0===e.length)return[];const{updatable:n,graphicsByLayer:s}=await i.async((async()=>{const{results:t}=await o(x(r,i),a),n=new Map,s=e=>{const t=e.layer,r=n.get(t);if(!r){const e=new Array;return n.set(t,e),e}return r};k(t).forEach((({graphic:e})=>s(e).push(e)));const l=e.filter((({capabilities:e,layer:t})=>e.update.enabled&&n.has(t)));return 0!==l.length&&i.stopPropagation(),{updatable:l,graphicsByLayer:n}}));return o(Promise.allSettled(n.map((async({layer:e})=>{const r=s.get(e),i=X(e);if(r.every((e=>h(i,e))))return r;const n=[];for(const a of r){n.push(a.getObjectId());const e=Object.keys(a.attributes);t(i,e)}const l=e.createQuery();return l.returnGeometry=!1,l.objectIds=n,l.outFields=b(e.fieldsIndex,i),e.queryFeatures(l,{signal:a}).then((({features:e})=>e))}))),a)}async function N(e,t,r,i){if(0===e.length)return[];const{mapPoint:a}=r;if(null==a)return[];let n=null;const s=await r.async((async()=>{const{results:a}=await o(t.hitTest(r),i);if(0===a.length)return[];const s=new Set;n=k(a),n.forEach((({graphic:e})=>e&&s.add(e.layer)));const l=e.filter((e=>s.has(e.layer)&&e.supportsUpdateWorkflow));return l.length>0&&r.stopPropagation(),l}));return o(Promise.allSettled(s.map((async({layer:e})=>{const s=e.createQuery();s.returnGeometry=!1,s.outFields=X(e);const l="renderer"in e?v({renderer:e.renderer,pointerType:r.pointerType}):0;s.geometry=L(a,l,t),s.outSpatialReference=t.spatialReference;const{features:o}=await e.queryFeatures(s,{signal:i});return n?.forEach((({graphic:t})=>{t.layer!==e||o.some((e=>e.getObjectId()===t.getObjectId()))||o.push(t)})),o}))),i)}function X(e){return b(e.fieldsIndex,[e.objectIdField,w({displayField:"displayField"in e?e.displayField:null,fields:e.fields})])}async function Y(e,t,r){const{sourceLayer:i}=e,a=i.createQuery();a.objectIds=[e.getAttribute(i.objectIdField)],a.outFields=["*"],a.returnM=i.capabilities.data.supportsM,a.returnZ=i.capabilities.data.supportsZ,"scene"===i.type&&null!=i.infoFor3D||(a.outSpatialReference=t);const n=await i.queryFeatures(a,{signal:r});c(r);return n.features[0]}async function $(e){const{graphic:t,sketchViewModel:r,sourceLayer:i,visualVariables:a,webStyleCache:n}=e;let s=!1;const{rotation:l,size:o}=a;if([l,o].forEach((async e=>{if(null==e)return;const i=t.getAttribute(e.field);if(null!=i)e.setInitialValue(i);else{const i=await e.getDefault(t.symbol,r.view);e.setInitialValue(i),t.setAttribute(e.field,i),s=!0}})),s){const e="2d"===r.view?.type?r.view.scale:null;await D(t,n,e)}const c={multipleSelectionEnabled:!1};return"point"===i.geometryType&&(c.enableRotation=null!=l,c.enableScaling=null!=o),W(r.tooltipOptions,o,l),r.layer.elevationInfo=i.elevationInfo,r.update(t,c)}function _(e){return null==e||"rotate-start"!==e.type&&"rotate"!==e.type&&"rotate-stop"!==e.type?null:e}function ee(e){return null==e||"scale-start"!==e.type&&"scale"!==e.type&&"scale-stop"!==e.type?null:e}async function te(e,t,r,i,a){if(null==t.geometry||"point"!==t.geometry?.type)return;const n=i.rotation,s=_(r.toolEventInfo);if(null!=n&&null!=s){const{field:r,getValue:i}=n;"rotate-stop"===s.type?(n.isUpdatingInteractively=!1,n.setInitialValue(t.getAttribute(r))):(n.isUpdatingInteractively=!0,t.setAttribute(r,i(s.angle,e)))}const l=i.size,o=ee(r.toolEventInfo);if(null!=l&&null!=o){const{field:r,getValue:i}=l;"scale-stop"===o.type?(l.isUpdatingInteractively=!1,l.setInitialValue(t.getAttribute(r))):(l.isUpdatingInteractively=!0,t.setAttribute(r,i(o.xScale,e)))}await D(t,a,"2d"===e.type?e.scale:null)}async function re({feature:e,featureClone:t,visualVariableAttributes:r,sketchViewModel:i,view:l,onUpdate:o,webStyleCache:c,addUpdatingPromise:f,addHandle:d}){await D(t,c,"2d"===l.type?l.scale:null);let m=null;if("2d"===i?.view?.type){const e=u((e=>D(t,c,e)));m=p((()=>i?.view?.scale),(t=>e(t)))}const g=t.sourceLayer,h=ye(l,g);await $({graphic:t,sketchViewModel:i,sourceLayer:g,visualVariables:r,webStyleCache:c});let b=null;h.then((e=>b=e)).catch((()=>{}));const w=r.size,v=r.rotation,S=p((()=>e.attributes),(async e=>{let r=!1;for(const i in e){const a=e[i];a!==t.getAttribute(i)&&(t.setAttribute(i,a),null==w||w.isUpdatingInteractively||w.field!==i||w.setInitialValue(a),null==v||v.isUpdatingInteractively||v.field!==i||v.setInitialValue(a),(null==b||b.requiredFields.includes(i))&&(r=!0))}r&&await D(t,c,"2d"===l.type?l.scale:null)})),I=i.on("update",(async e=>{const t=e.graphics[0],a={graphic:t,sketchViewModel:i,sourceLayer:g,visualVariables:r,webStyleCache:c};if("complete"===e.state){if(null===l.activeTool)return $(a);const e=new AbortController,t=s(e);return d(t),f(y((()=>null===l.activeTool),e.signal).then((()=>(e.abort(),$(a)))))}await te(l,t,e,r,c),o(de(t),e)})),j=i.on(["undo","redo"],(async e=>{o(de(e.graphics[0]),e)}));return n([j,I,a((()=>i.cancel())),S,m])}async function ie(e,t,i){const s=e.view;e.layer.add(i);const l=t.sourceLayer,o=t.layer,u=t.getAttribute(o.objectIdField);let p=null;function f(e){p?.abort(),p=r((async t=>{const r=await ye(s,l);c(t),r.setVisibility?.(u,e)}))}return await ne(s,i),f(!1),n([ae(s,i,(e=>f(!e))),a((async()=>{f(!0);try{const e=await ye(s,l);await y((()=>!e.updating))}finally{e.layer.remove(i)}}))])}function ae(e,t,r){if("3d"===e.type){const i=new F({graphic:t});return n([e.trackGraphicState(i),p((()=>i.displaying),r)])}return p((()=>t.visible),r)}async function ne(e,t){if("3d"===e.type){const r=new F({graphic:t}),i=e.trackGraphicState(r);await y((()=>r.displaying||r.error)),i.remove()}else await y((()=>t.visible))}const se={icon:f(24),text:f(12),line:f(1),viewScaleSizeFactor:100};function le(e,t,r){let i=!1;return e.filter((e=>!!i||(i=e===t,i))).map((e=>r[e]()))}function oe(e,t){e.viewModel.syncFeatureTemplates();const r=e.creationInfo;if("awaiting-feature-creation-info"===t[0].id&&r){const e=r.layer,i=g(e);1===i.length&&"scene"!==e.type&&(r.template=i[0],t.shift())}return t}function ce(e){return"unknown"===e?null:e}function ue(e){e.filesEnabled=!0,e.mode="view",e.capabilities={editing:!0,operations:{add:!0,update:!0,delete:!0}}}const pe=e=>/-stop/.test(e)||/vertex-/.test(e),ye=(e,t)=>{const r="subtype-sublayer"===t.type?t.parent:t;return e.whenLayerView(r)};function fe(e){return"createInteractiveEditSession"in e}function de(e){const t=e.geometry;if("mesh"===t?.type){const r=e.cloneShallow();return r.attributes=l(e.attributes),r.geometry=t.cloneShallow(),r.geometry.transform=t.transform?.clone()??null,r}return e.clone()}function me(e){const t=e.cursor;return e.cursor="progress",a((()=>e.cursor=t))}export{oe as avoidFeatureTemplateSelectionWithOnlyOneItem,fe as canCreateInteractiveEditSession,de as cloneGraphicExceptMesh,le as createWorkflowSteps,J as fetchCandidates,Y as fetchFullFeature,H as findLayerInfo,Q as getCreationAttributes,E as getVisualVariableAttributes,pe as isTerminalUpdateEventType,A as isUpdateWorkflow,ue as prepareAttachmentsForCreateFeaturesWorkflow,re as setUpGeometryUpdate,me as showProgressCursor,se as sizeDefaults,ce as sizeVariableUnitToLengthUnit,q as startCreatingNewFeature,$ as startUpdatingFeature,ie as swapForEditingSession,D as updateGraphicSymbolWhenRequired,te as visualVariableInteractiveUpdate,ye as whenEditorLayerView,ne as whenGraphicDisplayed};
5
+ import e from"../../Graphic.js";import{addMany as t}from"../../core/arrayUtils.js";import{createTask as r}from"../../core/asyncUtils.js";import"../../core/has.js";import i from"../../core/Error.js";import{makeHandle as n,handlesGroup as a,abortHandle as o}from"../../core/handleUtils.js";import{clone as l}from"../../core/lang.js";import{whenOrAbort as s,throwIfAborted as c,debounce as u}from"../../core/promiseUtils.js";import{watch as p,whenOnce as y}from"../../core/reactiveUtils.js";import{px2pt as d}from"../../core/screenUtils.js";import{diff as f}from"../../core/accessorSupport/diffUtils.js";import{isSharedTemplateOrMetadata as m,getAllStandardFeatureTemplatesForLayer as g}from"../../editing/templateUtils.js";import{featureHasFields as h,fixFields as b,getDisplayFieldName as w}from"../../layers/support/fieldUtils.js";import{calculateTolerance as v}from"../../renderers/support/clickToleranceUtils.js";import{meterIn as S}from"../../renderers/support/lengthUtils.js";import{getTransformationType as j,TransformationType as I}from"../../renderers/visualVariables/support/sizeVariableUtils.js";import{getRotationAngle as U,getSize as V}from"../../renderers/visualVariables/support/visualVariableUtils.js";import{to3D as T}from"../../symbols/support/symbolConversion.js";import{getDisplayedSymbol as O}from"../../symbols/support/symbolUtils.js";import{GraphicState as z}from"../../views/3d/layers/graphics/GraphicState.js";import{defaultDrawingMode as F}from"../../views/draw/DrawingMode.js";import{createQueryGeometry as L}from"../../views/support/drapedUtils.js";import{hitTestSelectSimilarDistance as x,filterGraphicHits as P}from"../../views/support/hitTestSelectUtils.js";function A(e){return"update"===e.type}function k(e){const t=e.sourceLayer;if(!t||"feature"!==t.type||!G(t.renderer))return{rotation:null,size:null};let r=null,i=null;const n=t.renderer.getVisualVariablesForType("rotation").filter((t=>(!t.axis||"heading"===t.axis)&&t.field&&!t.valueExpression&&null!=U(t,e)));1===n.length&&(r=R(n[0],t));const a=t.renderer.getVisualVariablesForType("size").filter((t=>t.field&&!t.useSymbolValue&&!t.valueExpression&&j(t)===I.RealWorldSize&&null!=V(t,e)));return 1===a.length&&(i=C(a[0],t)),{rotation:r,size:i}}function R(e,t){const r="heading"===(e.axis||"heading")&&"arithmetic"===e.rotationType?-1:1,i=e.field,n=t.fields&&t.fields.filter((e=>e.name===i)),a=n&&1===n.length?n[0].type:"double",o={initial:0,current:0};return{field:i,fieldType:a,getDefault:()=>Promise.resolve(0),getValue:e=>(o.current=o.initial-r*e,D((o.current+360)%360,a)),setInitialValue:e=>{o.initial=e,o.current=0},isUpdatingInteractively:!1,rotationType:e.rotationType??"geographic"}}function E(e,t){switch(t){case"width":return e[0];case"depth":return e[1];case"height":return e[2];default:return e[2]||e[1]||e[0]}}async function M(e,t,r){if(null==t)return 0;const{symbol:i}=T(t);if(null==i||"web-style"===i.type||"cim"===i.type)return 0;const n=i.symbolLayers.at(0);if(!n)return 0;switch(n.type){case"icon":{const{computeIconLayerResourceSize:e}=await import("../../symbols/support/symbolLayerUtils.js");return n.size||Math.min(le.icon,(await e(n,le.icon))[0])||le.icon}case"text":return n.size||le.text;case"line":return n.size||le.line;case"object":{const{computeObjectLayerResourceSize:t}=await import("../../symbols/support/symbolLayerUtils.js");return E(await t(n,e.scale/le.viewScaleSizeFactor),r)}case"path":return(null!=n.width?n.width:n.height)||e.scale/le.viewScaleSizeFactor;case"extrude":return n.size||e.scale/le.viewScaleSizeFactor;default:return 0}}function C(e,t){const r=e.field,i=e.axis,n=t.fields&&t.fields.filter((e=>e.name===r)),a=n&&1===n.length?n[0].type:"double",o={initial:0,current:0},l=S[e.valueUnit]??1;let s;return s="area"===e.valueRepresentation?e=>(e*l/2)**2*Math.PI:"radius"===e.valueRepresentation||"distance"===e.valueRepresentation?e=>e*l/2:e=>e*l,{field:r,fieldType:a,getDefault:async(e,t)=>D(s(await M(t,e,i)),a),getValue:(e,t)=>(o.initial||(o.initial=t.pixelSizeAt(t.center)),o.current=o.initial*e,D(o.current,a)),setInitialValue:e=>{o.initial=e,o.current=0},isUpdatingInteractively:!1,displayUnit:ue(e.valueUnit),axis:e.axis}}function D(e,t){switch(t){case"small-integer":case"integer":case"long":return Math.round(e);case"double":case"single":return e;default:return 0}}function G(e){switch(e?.type){case"class-breaks":case"simple":case"unique-value":case"dot-density":case"dictionary":case"pie-chart":return!0;default:return!1}}async function Z(e,t,r){const i=await O(e,{useSourceLayer:!0,ignoreGraphicSymbol:!0,webStyleCache:t,scale:r});null!=f(e.symbol,i)&&(e.symbol=i)}function q(e,t){if(!e||!t)throw new Error("no geometry type");if("multipatch"===e)return{tool:"mesh",createOptions:{mode:"hybrid"}};if(m(t)){switch(t.defaultTool){case"freehand":case"line":case"stream-line":return{tool:"polyline"===e?"freehandPolyline":"freehandPolygon",createOptions:{mode:"freehand"}};case"autocomplete-freehand-polygons":case"stream-polygon":return{tool:"freehandPolygon",createOptions:{mode:"freehand"}};case"autocomplete-polygons":case"difference-polygon":case"create-structures":case"polygon":case"trace":return{tool:"polygon"===e?"polygon":"polyline",createOptions:{mode:F}};case"circle":return{tool:"circle",createOptions:{mode:F,preserveAspectRatio:!0}};case"ellipse":return{tool:"circle",createOptions:{mode:F,preserveAspectRatio:!1}};case"create-points-along-line":case"multipoint":return{tool:"multipoint",createOptions:{mode:F}};case"radial-line":case"right-angle-line":case"split":case"two-point-line":return{tool:"polyline",createOptions:{mode:F}};case"rectangle":case"regular-polygon":case"right-angle-polygon":return{tool:"rectangle",createOptions:{mode:F}};case"elevation-point-from-contour":case"elevation-point-from-dem":case"parcel-seed":case"point-and-rotation":case"point-at-end-of-line":return{tool:"point",createOptions:{mode:F}}}}else{const r=t.drawingTool;if("circle"===r||"ellipse"===r){const e=new Map;return e.set("circle",{preserveAspectRatio:"circle"===r}),{tool:"circle",createOptions:{mode:F,optionsPerTool:e}}}if("rectangle"===r)return{tool:"rectangle",createOptions:{mode:F}};if("freehand"===r)return{tool:"polygon"===e?"freehandPolygon":"freehandPolyline",createOptions:{mode:F}}}return{tool:e,createOptions:{mode:F}}}async function Q(e,t,r){const i=r.layer,a=B(r);let o=null;const{view:l}=e,s="2d"===l?.type;if(await W(e,i,a,t,s?l.scale:null),s){const r=u((r=>W(e,i,a,t,r)));o=p((()=>l.scale),(e=>r(e)))}const{data:c,editing:y}=i.capabilities;e.layer.elevationInfo=i.elevationInfo;const d=q(i.geometryType,r.template);return e.defaultCreateOptions={graphicProperties:{attributes:a,sourceLayer:i},mode:d.createOptions.mode,optionsPerTool:d.createOptions.optionsPerTool,preserveAspectRatio:d.createOptions.preserveAspectRatio,hasZ:c.supportsZ,defaultZ:(s?y.zDefault:null)??e.defaultCreateOptions.defaultZ},null==r.geometryToPlace?await e.create(d.tool):await e.place(r.geometryToPlace,{graphicProperties:{attributes:a,sourceLayer:i}}),o??n()}function B(e){const{template:t}=e;if(t&&m(t))throw new i("Shared templates are not yet supported");return{...t?.prototype.attributes,...e.attributeOverrides}}async function W(t,r,i,n,a){const o=new e({sourceLayer:r,attributes:i}),{rotation:l,size:s}=k(o);let c=await O(o,{useSourceLayer:!0,webStyleCache:n,scale:a}),u=!1;for(const e of[s,l]){if(null==e)continue;null==i[e.field]&&(i[e.field]=await e.getDefault(c,t.view),u=!0)}switch(u&&(c=await O(o,{useSourceLayer:!0,webStyleCache:n,scale:a})),c?.type){case"simple-fill":case"polygon-3d":t.polygonSymbol=c;break;case"simple-line":case"line-3d":t.polylineSymbol=c;break;case"simple-marker":case"picture-marker":case"point-3d":case"cim":t.pointSymbol=c;break;case"mesh-3d":t.meshSymbol=c}H(t.tooltipOptions,s,l)}function H(e,t,r){e.visualVariables=null!=t||null!=r?{size:null!=t?{unit:t.displayUnit,axis:t.axis,valueType:t.fieldType}:null,rotation:null!=r?{valueType:r.fieldType,rotationType:r.rotationType??"geographic"}:null}:null}function J(e,t){return e?.find((e=>e.layer===t))}async function K(e,t,r,i){switch(t.type){case"3d":return N(e,t,r,i);case"2d":return X(e,t,r,i)}}async function N(e,r,i,n){if(0===e.length)return[];const{updatable:a,graphicsByLayer:o}=await i.async((async()=>{const{results:t}=await s(x(r,i),n),a=new Map,o=e=>{const t=e.layer,r=a.get(t);if(!r){const e=new Array;return a.set(t,e),e}return r};P(t).forEach((({graphic:e})=>o(e).push(e)));const l=e.filter((({capabilities:e,layer:t})=>e.update.enabled&&a.has(t)));return 0!==l.length&&i.stopPropagation(),{updatable:l,graphicsByLayer:a}}));return s(Promise.allSettled(a.map((async({layer:e})=>{const r=o.get(e),i=Y(e);if(r.every((e=>h(i,e))))return r;const a=[];for(const n of r){a.push(n.getObjectId());const e=Object.keys(n.attributes);t(i,e)}const l=e.createQuery();return l.returnGeometry=!1,l.objectIds=a,l.outFields=b(e.fieldsIndex,i),e.queryFeatures(l,{signal:n}).then((({features:e})=>e))}))),n)}async function X(e,t,r,i){if(0===e.length)return[];const{mapPoint:n}=r;if(null==n)return[];let a=null;const o=await r.async((async()=>{const{results:n}=await s(t.hitTest(r),i);if(0===n.length)return[];const o=new Set;a=P(n),a.forEach((({graphic:e})=>e&&o.add(e.layer)));const l=e.filter((e=>o.has(e.layer)&&e.supportsUpdateWorkflow));return l.length>0&&r.stopPropagation(),l}));return s(Promise.allSettled(o.map((async({layer:e})=>{const o=e.createQuery();o.returnGeometry=!1,o.outFields=Y(e);const l="renderer"in e?v({renderer:e.renderer,pointerType:r.pointerType}):0;o.geometry=L(n,l,t),o.outSpatialReference=t.spatialReference;const{features:s}=await e.queryFeatures(o,{signal:i});return a?.forEach((({graphic:t})=>{t.layer!==e||s.some((e=>e.getObjectId()===t.getObjectId()))||s.push(t)})),s}))),i)}function Y(e){return b(e.fieldsIndex,[e.objectIdField,w({displayField:"displayField"in e?e.displayField:null,fields:e.fields})])}async function $(e,t,r){const{sourceLayer:i}=e,n=i.createQuery();n.objectIds=[e.getAttribute(i.objectIdField)],n.outFields=["*"],n.returnM=i.capabilities.data.supportsM,n.returnZ=i.capabilities.data.supportsZ,"scene"===i.type&&null!=i.infoFor3D||(n.outSpatialReference=t);const a=await i.queryFeatures(n,{signal:r});c(r);return a.features[0]}async function _(e){const{graphic:t,sketchViewModel:r,sourceLayer:i,visualVariables:n,webStyleCache:a}=e;let o=!1;const{rotation:l,size:s}=n;if([l,s].forEach((async e=>{if(null==e)return;const i=t.getAttribute(e.field);if(null!=i)e.setInitialValue(i);else{const i=await e.getDefault(t.symbol,r.view);e.setInitialValue(i),t.setAttribute(e.field,i),o=!0}})),o){const e="2d"===r.view?.type?r.view.scale:null;await Z(t,a,e)}const c={multipleSelectionEnabled:!1};return"point"===i.geometryType&&(c.enableRotation=null!=l,c.enableScaling=null!=s),H(r.tooltipOptions,s,l),r.layer.elevationInfo=i.elevationInfo,r.update(t,c)}function ee(e){return null==e||"rotate-start"!==e.type&&"rotate"!==e.type&&"rotate-stop"!==e.type?null:e}function te(e){return null==e||"scale-start"!==e.type&&"scale"!==e.type&&"scale-stop"!==e.type?null:e}async function re(e,t,r,i,n){if(null==t.geometry||"point"!==t.geometry?.type)return;const a=i.rotation,o=ee(r.toolEventInfo);if(null!=a&&null!=o){const{field:r,getValue:i}=a;"rotate-stop"===o.type?(a.isUpdatingInteractively=!1,a.setInitialValue(t.getAttribute(r))):(a.isUpdatingInteractively=!0,t.setAttribute(r,i(o.angle,e)))}const l=i.size,s=te(r.toolEventInfo);if(null!=l&&null!=s){const{field:r,getValue:i}=l;"scale-stop"===s.type?(l.isUpdatingInteractively=!1,l.setInitialValue(t.getAttribute(r))):(l.isUpdatingInteractively=!0,t.setAttribute(r,i(s.xScale,e)))}await Z(t,n,"2d"===e.type?e.scale:null)}async function ie({feature:e,featureClone:t,visualVariableAttributes:r,sketchViewModel:i,view:l,onUpdate:s,webStyleCache:c,addUpdatingPromise:d,addHandle:f}){await Z(t,c,"2d"===l.type?l.scale:null);let m=null;if("2d"===i?.view?.type){const e=u((e=>Z(t,c,e)));m=p((()=>i?.view?.scale),(t=>e(t)))}const g=t.sourceLayer,h=de(l,g);await _({graphic:t,sketchViewModel:i,sourceLayer:g,visualVariables:r,webStyleCache:c});let b=null;h.then((e=>b=e)).catch((()=>{}));const w=r.size,v=r.rotation,S=p((()=>e.attributes),(async e=>{let r=!1;for(const i in e){const n=e[i];n!==t.getAttribute(i)&&(t.setAttribute(i,n),null==w||w.isUpdatingInteractively||w.field!==i||w.setInitialValue(n),null==v||v.isUpdatingInteractively||v.field!==i||v.setInitialValue(n),(null==b||b.requiredFields.includes(i))&&(r=!0))}r&&await Z(t,c,"2d"===l.type?l.scale:null)})),j=i.on("update",(async e=>{const t=e.graphics[0],n={graphic:t,sketchViewModel:i,sourceLayer:g,visualVariables:r,webStyleCache:c};if("complete"===e.state){if(null===l.activeTool)return _(n);const e=new AbortController,t=o(e);return f(t),d(y((()=>null===l.activeTool),e.signal).then((()=>(e.abort(),_(n)))))}await re(l,t,e,r,c),s(me(t),e)})),I=i.on(["undo","redo"],(async e=>{s(me(e.graphics[0]),e)}));return a([I,j,n((()=>i.cancel())),S,m])}async function ne(e,t,i){const o=e.view;e.layer.add(i);const l=t.sourceLayer,s=t.layer,u=t.getAttribute(s.objectIdField);let p=null;function d(e){p?.abort(),p=r((async t=>{const r=await de(o,l);c(t),r.setVisibility?.(u,e)}))}return await oe(o,i),d(!1),a([ae(o,i,(e=>d(!e))),n((async()=>{d(!0);try{const e=await de(o,l);await y((()=>!e.updating))}finally{e.layer.remove(i)}}))])}function ae(e,t,r){if("3d"===e.type){const i=new z({graphic:t});return a([e.trackGraphicState(i),p((()=>i.displaying),r)])}return p((()=>t.visible),r)}async function oe(e,t){if("3d"===e.type){const r=new z({graphic:t}),i=e.trackGraphicState(r);await y((()=>r.displaying||r.error)),i.remove()}else await y((()=>t.visible))}const le={icon:d(24),text:d(12),line:d(1),viewScaleSizeFactor:100};function se(e,t,r){let i=!1;return e.filter((e=>!!i||(i=e===t,i))).map((e=>r[e]()))}function ce(e,t){e.viewModel.syncFeatureTemplates();const r=e.creationInfo;if("awaiting-feature-creation-info"===t[0].id&&r){const e=r.layer,i=g(e);1===i.length&&"scene"!==e.type&&(r.template=i[0],t.shift())}return t}function ue(e){return"unknown"===e?null:e}function pe(e){e.filesEnabled=!0,e.mode="view",e.capabilities={editing:!0,operations:{add:!0,update:!0,delete:!0}}}const ye=e=>/-stop/.test(e)||/vertex-/.test(e),de=(e,t)=>{const r="subtype-sublayer"===t.type?t.parent:t;return e.whenLayerView(r)};function fe(e){return"createInteractiveEditSession"in e}function me(e){const t=e.geometry;if("mesh"===t?.type){const r=e.cloneShallow();return r.attributes=l(e.attributes),r.geometry=t.cloneShallow(),r.geometry.transform=t.transform?.clone()??null,r}return e.clone()}function ge(e){const t=e.cursor;return e.cursor="progress",n((()=>e.cursor=t))}export{ce as avoidFeatureTemplateSelectionWithOnlyOneItem,fe as canCreateInteractiveEditSession,me as cloneGraphicExceptMesh,se as createWorkflowSteps,K as fetchCandidates,$ as fetchFullFeature,J as findLayerInfo,B as getCreationAttributes,k as getVisualVariableAttributes,ye as isTerminalUpdateEventType,A as isUpdateWorkflow,pe as prepareAttachmentsForCreateFeaturesWorkflow,ie as setUpGeometryUpdate,ge as showProgressCursor,le as sizeDefaults,ue as sizeVariableUnitToLengthUnit,Q as startCreatingNewFeature,_ as startUpdatingFeatureGeometry,ne as swapForEditingSession,Z as updateGraphicSymbolWhenRequired,re as visualVariableInteractiveUpdate,de as whenEditorLayerView,oe as whenGraphicDisplayed};
package/widgets/Editor.js CHANGED
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.32/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../chunks/tslib.es6.js";import"../intl.js";import{mappedFind as t}from"../core/maybe.js";import{createResolver as s}from"../core/promiseUtils.js";import{watch as o,initial as i,on as r,when as a}from"../core/reactiveUtils.js";import{property as n}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{subclass as l}from"../core/accessorSupport/decorators/subclass.js";import d from"../views/interactive/sketch/SketchValueOptions.js";import c from"./Attachments.js";import m from"./FeatureForm.js";import p from"./FeatureTemplates.js";import h from"./Spinner.js";import u from"./Widget.js";import{css as g}from"./Editor/css.js";import w from"./Editor/EditorViewModel.js";import{isModelUpload as f}from"./Editor/modelUploadUtils.js";import v from"./Editor/VisibleElements.js";import{loadCreateFeaturesPanelContentComponents as _,CreateFeaturesPanelContent as y}from"./Editor/components/CreateFeaturesPanelContent.js";import{loadFeatureListComponents as F,FeatureList as k}from"./Editor/components/FeatureList.js";import{loadFooterActionsComponents as M,FooterActions as A}from"./Editor/components/FooterActions.js";import{loadNoticesComponents as b,Notice as C}from"./Editor/components/Notices.js";import{loadPanelContentComponents as E,PanelContent as W,PanelContentSection as P,PanelContentMessage as T}from"./Editor/components/PanelContent.js";import{PanelToolbar as L,loadPanelToolbarComponents as j}from"./Editor/components/PanelToolbar.js";import{loadPromptComponents as I,Prompt as U}from"./Editor/components/Prompt.js";import{loadUpdateFeaturePanelContentComponents as D,UpdateFeaturePanelContent as S}from"./Editor/components/UpdateFeaturePanelContent.js";import{loadUploadDetailsComponents as O,UploadDetails as V}from"./Editor/components/UploadDetails.js";import{loadCalciteComponents as x}from"./support/componentsUtils.js";import{globalCss as B}from"./support/globalCss.js";import{incrementHeadingLevel as G,Heading as R}from"./support/Heading.js";import{renderItem as q}from"./support/ItemList.js";import{connectDelayedLoading as H}from"./support/loaderUtils.js";import"./support/widgetUtils.js";import{messageBundle as N}from"./support/decorators/messageBundle.js";import{vmEvent as z}from"./support/decorators/vmEvent.js";import{tsx as $}from"./support/jsxFactory.js";import{substitute as J}from"../intl/substitute.js";let K=class extends u{constructor(e,t){super(e,t),this._featureForm=new m,this._attachments=new c({visibleElements:{addSubmitButton:!1,cancelAddButton:!1,cancelUpdateButton:!1,deleteButton:!1,errorMessage:!1,progressBar:!1,updateButton:!1}}),this._featureTemplates=new p({enableListScroll:!1,renderItemContentEnd:e=>e.supportsUpload?$("calcite-icon",{class:g.templateItemContentEnd,icon:"upload-to",key:"upload-icon"}):null,renderItemLabel:e=>e.label,renderCustomGroupContent:e=>this._renderCustomTemplateGroupContent(e)}),this._filterText="",this._prompt=null,this._spinner=new h,this._loading=!1,this.headingLevel=4,this.messages=null,this.messagesCommon=null,this.messagesTemplates=null,this.messagesFeature=null,this.supportingWidgetDefaults=null,this.viewModel=new w,this.visibleElements=new v,this._renderAttachments=()=>this._attachments.render(),this._renderFeatureForm=()=>this._featureForm.render(),this._renderFeatureTemplates=()=>this._featureTemplates.render(),this._renderSelectIcon=()=>$("calcite-icon",{icon:"cursor",slot:"content-start"}),this.EditorPanel=({heading:e,key:t,selected:s},...o)=>{const{visibleElements:i}=this;return $("calcite-flow-item",{closable:!1,heading:e,headingLevel:this.headingLevel,key:t,loading:this._loading,selected:s,onCalciteFlowItemBack:this._onBack},i.settingsMenu?$(L,{editorViewModel:this.viewModel,messagesCommon:this.messagesCommon,visibleElements:i}):null,...o)},this._showDiscardEditsPrompt=()=>{const{messages:e,activeWorkflow:t}=this,s={title:e.cancelEditTitle,message:e.cancelEditWarningMessage,yesLabel:e.discardEdits,noLabel:e.continueEditing};return"create-features"===t?.type&&f(t.data.creationInfo)?this._showPromptAndWait("success"===t.data.upload?.state?e.modelUploads.cancelPlacementPrompt:e.modelUploads.cancelUploadPrompt):"update"===t?.type&&t.activeFeatureFormViewModel?.activeAssociation?this._showPromptAndWait({...s,message:e.cancelAssociationEditWarning}):this._showPromptAndWait(s)},this._showGenericCancelPrompt=()=>{const{messages:e,messagesCommon:t}=this;return this._showPromptAndWait({title:e.cancelRequestTitle,message:e.cancelRequestWarningMessage,yesLabel:t.form.yes,noLabel:t.form.no})},this._showPrompt=e=>{this._prompt?.cancel?.(),this._prompt=e},this._clearPrompt=()=>{this._prompt=null},this._onSave=()=>{this.viewModel.saveWorkflow()},this._onDelete=()=>{const{messages:e,messagesCommon:t}=this;this._showPrompt({title:e.deleteWarningTitle,message:e.deleteWarningMessage,context:"danger",actions:{primary:{label:t.delete,action:()=>{this.deleteFeatureFromWorkflow(),this._clearPrompt()}},secondary:{label:e.keepFeature,action:this._clearPrompt}}})},this._onDeleteAssociation=()=>{const{messages:e,messagesCommon:t}=this;this._showPrompt({title:e.deleteAssociationTitle,message:e.deleteAssociationMessage,context:"danger",actions:{primary:{label:t.delete,action:()=>{this.deleteAssociationFromWorkflow(),this._clearPrompt()}},secondary:{label:e.keepAssociation,action:this._clearPrompt}}})},this._onToggleUpdateWorkflow=()=>this.viewModel.toggleUpdateWorkflow(),this._onBack=e=>(e?.stopPropagation(),this.viewModel.back()),this._onAttachmentAdd=()=>{const{activeWorkflow:e}=this.viewModel;e&&("create-features"===e.type||"update"===e.type&&"create-features"===e.activeWorkflow?.type?(this._attachments.addFile(),e.back()):this._attachments.addAttachment().then((()=>e.back())))},this._onAttachmentUpdate=()=>{const{activeWorkflow:e}=this.viewModel;e&&("create-features"===e.type?(this._attachments.updateFile(),e.back()):this._attachments.updateAttachment().then((()=>e.back())))},this._onAttachmentDelete=()=>{const{messages:e,messagesCommon:t}=this;this._showPrompt({title:e.deleteAttachmentWarningTitle,message:e.deleteAttachmentWarningMessage,context:"danger",actions:{primary:{label:t.delete,action:this._onAttachmentDeleteConfirm},secondary:{label:e.keepAttachment,action:this._clearPrompt}}})},this._onAttachmentDeleteConfirm=async()=>{const e=this._attachments,{activeWorkflow:t}=this.viewModel;t&&("create-features"===t.type?e.deleteFile():(await e.deleteAttachment(e.viewModel.activeAttachmentInfo),this._clearPrompt()),await t.back(),this._clearPrompt())},this._onAttachmentsError=e=>{this._showPrompt({title:this.messages.errorWarningTitle,message:e.message,context:"warning",actions:{primary:{label:this.messagesCommon.form.ok,action:this._clearPrompt}}})}}initialize(){this._featureForm.showPrompt=this._showPrompt,this._featureForm.clearPrompt=this._clearPrompt,this.addHandles([o((()=>G(this.headingLevel)),(e=>{this._featureForm.headingLevel=e,this._featureTemplates.headingLevel=e}),i),r((()=>this.viewModel.activeWorkflow),"cancel-request",(({controller:e})=>{(this.viewModel.hasPendingEdits?this._showDiscardEditsPrompt():this._showGenericCancelPrompt()).then((t=>t?e.allow():e.deny()))})),a((()=>this.viewModel.featureFormViewModel),(e=>{this._featureForm.viewModel=e}),i),o((()=>this.viewModel),(e=>{this._attachments.viewModel=e?.attachmentsViewModel??null,this._featureTemplates.viewModel=e?.featureTemplatesViewModel??null,this._spinner.viewModel=e?.spinnerViewModel??null,e.showDiscardEditsPrompt=this._showDiscardEditsPrompt}),i),o((()=>this.view),((e,t)=>{const s=`editor-${this.id}-spinner`;t?.ui.remove(this._spinner,s),e?.ui.add(this._spinner,{key:s,position:"manual"})}),i),o((()=>[this.supportingWidgetDefaults,this.viewModel.sketchViewModel]),(([e])=>{e&&(this._featureForm.set(e.featureForm),this._attachments.set(e.attachments),this._featureTemplates.set(e.featureTemplates),this.viewModel.sketchViewModel?.set(e.sketch))}),i),a((()=>this._attachments?.error),(e=>this._onAttachmentsError(e))),a((()=>this.viewModel?.failures),(e=>{const{messages:t}=this,[{error:s,retry:o,cancel:i}]=e;this._showPrompt({title:t.errorWarningTitle,message:J(t.errorWarningMessageTemplate,{errorMessage:s.message}),context:"warning",actions:{primary:{label:t.retry,action:()=>{o(),this._clearPrompt()}},secondary:{label:t.ignore,action:()=>{i(),this._clearPrompt()}}}})})),o((()=>this.viewModel?.state),(e=>{switch(e){case"awaiting-feature-to-update":case"ready":case"disabled":this._filterText="",this._featureTemplates.filterText=""}})),o((()=>this.viewModel.featureFormDisabled),(e=>this._featureForm.disabled=e)),H({getLoading:()=>{const{viewModel:e}=this;return e.syncing||e.updating||this._attachments.submitting},setEffectiveLoading:e=>{this._loading=e}})])}destroy(){this._attachments.destroy(),this._featureForm.destroy(),this._featureTemplates.destroy()}loadDependencies(){return Promise.all([x({flow:()=>import("@esri/calcite-components/dist/components/calcite-flow"),"flow-item":()=>import("@esri/calcite-components/dist/components/calcite-flow-item"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),list:()=>import("@esri/calcite-components/dist/components/calcite-list")}),_(),F(),M(),b(),E(),j(),I(),D(),O()])}get _deleteButtonCommonInfo(){return{appearance:"outline",kind:"danger"}}get activeWorkflow(){return this.viewModel.activeWorkflow}get hideTemplatesForInactiveLayers(){return this.viewModel.hideTemplatesForInactiveLayers}set hideTemplatesForInactiveLayers(e){this.viewModel.hideTemplatesForInactiveLayers=e}get icon(){return"pencil"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get labelOptions(){return this.viewModel.labelOptions}set labelOptions(e){this.viewModel.labelOptions=e}get layerInfos(){return this.viewModel.layerInfos}set layerInfos(e){this.viewModel.layerInfos=e}get snappingOptions(){return this.viewModel.snappingOptions}set snappingOptions(e){this.viewModel.snappingOptions=e}get tooltipOptions(){return this.viewModel.tooltipOptions}set tooltipOptions(e){this.viewModel.tooltipOptions=e}get valueOptions(){return this.viewModel.valueOptions}set valueOptions(e){this.viewModel.valueOptions=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}startCreateFeaturesWorkflowAtFeatureTypeSelection(){return this.viewModel.startCreateFeaturesWorkflowAtFeatureTypeSelection()}startCreateFeaturesWorkflowAtFeatureCreation(e){return this.viewModel.startCreateFeaturesWorkflowAtFeatureCreation(e)}startCreateFeaturesWorkflowAtFeatureEdit(e){return this.viewModel.startCreateFeaturesWorkflowAtFeatureEdit(e)}startUpdateWorkflowAtFeatureSelection(){return this.viewModel.startUpdateWorkflowAtFeatureSelection()}startUpdateWorkflowAtMultipleFeatureSelection(e){return this.viewModel.startUpdateWorkflowAtMultipleFeatureSelection(e)}startUpdateWorkflowAtFeatureEdit(e){return this.viewModel.startUpdateWorkflowAtFeatureEdit(e)}deleteFeatureFromWorkflow(){return this.viewModel.deleteFeatureFromWorkflow()}deleteAssociationFromWorkflow(){return this.viewModel.deleteAssociationFromWorkflow()}cancelWorkflow(e){return this.viewModel.cancelWorkflow(e)}render(){const{visibleElements:e,viewModel:t}=this,s=this.classes(g.base,B.widget,B.panel);if(!t)return $("div",{class:s,key:"empty"});const{pageStack:o}=t,i=o.length-1,r=o.map(((e,t)=>this._renderPage(e,t===i)));return $("div",{class:s,key:"base"},e.flow?$("calcite-flow",{key:"flow"},r):r,this._prompt?$(U,{...this._prompt,headingLevel:this.headingLevel}):void 0)}_renderPage(e,t){const s={selected:t};switch(e){case"disabled":break;case"ready":return this._renderReady(s);case"awaiting-feature-creation-info":return this._renderAwaitingFeatureCreationInfo(s);case"creating-features-upload-details":return this._renderUploadDetails(s);case"creating-features":return this._renderCreatingFeatures(s);case"editing-existing-feature":case"editing-attributes":return this._renderUpdateFeature(s);case"awaiting-update-feature-candidate":return this._renderFeatureList(s);case"adding-attachment":return this._renderAttachmentAdding(s);case"editing-attachment":return this._renderAttachmentEditing(s);case"viewing-associated-layers":case"viewing-associated-features":return this._renderViewAssociatedLayers(s)}return $("div",{key:"empty-page"})}_renderAwaitingFeatureCreationInfo(e){const{EditorPanel:t,messages:s}=this;return $(t,{heading:s.selectTemplate,key:"templates-panel",...e},$(W,{key:"feature-templates"},$(P,null,this._renderFeatureTemplates())))}_renderUploadDetails(e){const{EditorPanel:t,activeWorkflow:s,messages:o}=this;if("create-features"!==s?.type)return null;const i=s.data.upload;return i?$(t,{heading:o.createFeatures,key:"upload-details-panel",...e},$(V,{helpMessage:this._helpMessage,messages:o,upload:i})):null}_renderCreatingFeatures(e){const{EditorPanel:t,activeWorkflow:s,messages:o,messagesCommon:i,headingLevel:r,viewModel:a}=this;if(!s)return null;const n="create-features"===s.type&&s.numPendingFeatures>0||"update"===s.type&&"create-features"===s?.activeWorkflow?.type&&s.activeWorkflow?.numPendingFeatures>0;return $(t,{heading:o.createFeatures,key:"create-features-panel",...e},n?$(S,{editorViewModel:a,headingLevel:r,messages:o,messagesCommon:i,renderAttachments:this._renderAttachments,renderFeatureForm:this._renderFeatureForm,onDelete:this._onDelete,onDeleteAssociation:this._onDeleteAssociation,onSave:this._onSave}):$(y,{helpMessage:this._helpMessage}))}_renderUpdateFeature(e){const{EditorPanel:t,messages:s,messagesCommon:o,headingLevel:i,viewModel:r}=this;return $(t,{heading:s.editFeature,key:"update-feature-panel",...e},$(S,{editorViewModel:r,headingLevel:i,messages:s,messagesCommon:o,renderAttachments:this._renderAttachments,renderFeatureForm:this._renderFeatureForm,onDelete:this._onDelete,onDeleteAssociation:this._onDeleteAssociation,onSave:this._onSave}))}_getAssociationTypeTitle(e){if(!e)return null;if(e.title)return e.title;const{messagesFeature:t}=this;switch(e.type){case"attachment":return t.associationsAttachments;case"connectivity":return t.associationsConnectivity;case"structure":return t.associationsStructure;case"content":return t.associationsContents;case"container":return t.associationsContainer}}_renderViewAssociatedLayers(e){const{EditorPanel:t,messages:s,messagesCommon:o,headingLevel:i,viewModel:r}=this,a=r.featureFormViewModel?.activeAssociationInput?.activeAssociationType,n=this._getAssociationTypeTitle(a)??s.editFeature;return $(t,{heading:n,key:"viewing-associated-layers-panel",...e},$(S,{editorViewModel:r,headingLevel:i,messages:s,messagesCommon:o,renderAttachments:this._renderAttachments,renderFeatureForm:this._renderFeatureForm,onDelete:this._onDelete,onDeleteAssociation:this._onDeleteAssociation,onSave:this._onSave}))}_renderCustomTemplateGroupContent(e){const{messages:s,viewModel:o}=this,i=t(e.group.items,(e=>o.itemHasInvalidFormTemplate(e)?s.formFieldCreateError:void 0));return i?$(C,{kind:"warning",message:i}):null}_renderAttachmentAdding(e){const{EditorPanel:t,_attachments:s,messages:o,messagesCommon:i}=this;return $(t,{heading:o.addAttachment,key:"attachment-adding-panel",...e},$(W,{key:"attachments"},this._renderAttachments()),$(A,{buttons:[{label:s.submitting?i.cancel:i.add,disabled:s.submitting||!s.selectedFile,onClick:this._onAttachmentAdd,type:"button"}]}))}_renderAttachmentEditing(e){const{EditorPanel:t,_attachments:s,activeWorkflow:o,messages:i,messagesCommon:r}=this;return o?$(t,{heading:i.editAttachment,key:"attachment-editing-panel",...e},$(W,{key:"attachments"},this._renderAttachments()),o.shouldAllowAttachmentEditing?$(A,{buttons:[{label:r.update,disabled:s.submitting||!s.selectedFile,onClick:this._onAttachmentUpdate,type:"button"},{...this._deleteButtonCommonInfo,onClick:this._onAttachmentDelete,disabled:s.submitting,label:r.delete,type:"button"}]}):void 0):null}_renderReady(e){const{EditorPanel:t,messages:s,viewModel:o,visibleElements:i}=this,r=this._helpMessage;return $(t,{heading:s.widgetLabel,key:"landing-panel",...e},$(W,{key:"landing-content"},o.editorItems.length?[i.editFeaturesSection?$(P,{key:"edit-actions"},this._renderUpdateActions()):null,i.createFeaturesSection&&o.canCreateVisible?$(P,{key:"create-actions"},this._renderCreateActions()):null]:$(T,{key:"no-content"},s.noEditableLayers)),r?$("div",{class:g.helpMessage,key:"footer-actions",slot:"footer"},r):void 0)}get _helpMessage(){const{activeWorkflow:e,messages:t,view:s}=this,o=e?.helpMessage;return o?t["3d"===s?.type?"helpMessages3d":"helpMessages2d"]?.[o]:void 0}_renderUpdateActions(){const{messages:e,messagesCommon:t,viewModel:s}=this,o={id:"select",label:t.select};return $("div",{class:g.updateActions,key:"update-actions"},$(R,{level:G(this.headingLevel)},e.editFeatures),$("calcite-list",{class:g.updateActionsList,label:e.editFeaturesList,selectionAppearance:"border",selectionMode:"single"},q({disabled:!s.canUpdateVisible,grouped:!1,item:o,selectedItem:"awaiting-feature-to-update"===s.activeWorkflow?.stepId?o:void 0,renderIcon:this._renderSelectIcon,onItemSelect:this._onToggleUpdateWorkflow})))}_renderCreateActions(){return $("div",{key:"create-actions"},$(R,{level:G(this.headingLevel)},this.messages.createFeatures),$("div",{class:g.featureTemplatesContainer,key:"templates"},this._renderFeatureTemplates()))}_renderFeatureList(e){const{EditorPanel:t,viewModel:s}=this,{activeWorkflow:o}=s;if("update"!==o?.type)return null;const i=o.data.candidates,r=J(this.messages.multipleFeaturesTemplate,{total:i.length});return $(t,{heading:r,key:"feature-list",...e},$(k,{editorItems:s.editorItems,filterText:this._filterText,id:this.id,messagesTemplates:this.messagesTemplates,workflow:o,onFilterTextChange:e=>this._filterText=e,onSelectFeature:(e,t)=>s.selectFeature(e,t)}))}_showPromptAndWait({title:e,message:t,yesLabel:o,noLabel:i}){const r=s(),{view:a}=this,n=a?.focused;return this._showPrompt({title:e,message:t,context:"danger",actions:{primary:{label:o,action:()=>r.resolve(!0)},secondary:{label:i,action:()=>r.resolve(!1)}}}),r.promise.finally((()=>{this._clearPrompt(),n&&a?.focus()}))}};e([n()],K.prototype,"_featureForm",void 0),e([n()],K.prototype,"_attachments",void 0),e([n()],K.prototype,"_featureTemplates",void 0),e([n()],K.prototype,"_filterText",void 0),e([n()],K.prototype,"_prompt",void 0),e([n()],K.prototype,"_spinner",void 0),e([n()],K.prototype,"_deleteButtonCommonInfo",null),e([n()],K.prototype,"_loading",void 0),e([n({readOnly:!0})],K.prototype,"activeWorkflow",null),e([n()],K.prototype,"headingLevel",void 0),e([n()],K.prototype,"hideTemplatesForInactiveLayers",null),e([n()],K.prototype,"icon",null),e([n()],K.prototype,"label",null),e([n()],K.prototype,"labelOptions",null),e([n()],K.prototype,"layerInfos",null),e([n(),N("esri/widgets/Editor/t9n/Editor")],K.prototype,"messages",void 0),e([n(),N("esri/t9n/common")],K.prototype,"messagesCommon",void 0),e([n(),N("esri/widgets/FeatureTemplates/t9n/FeatureTemplates")],K.prototype,"messagesTemplates",void 0),e([n(),N("esri/widgets/Feature/t9n/Feature")],K.prototype,"messagesFeature",void 0),e([n()],K.prototype,"snappingOptions",null),e([n()],K.prototype,"tooltipOptions",null),e([n()],K.prototype,"supportingWidgetDefaults",void 0),e([n({type:d,nonNullable:!0})],K.prototype,"valueOptions",null),e([n()],K.prototype,"view",null),e([n(),z(["sketch-create","sketch-delete","sketch-update","workflow-cancel","workflow-commit"])],K.prototype,"viewModel",void 0),e([n({type:v,nonNullable:!0})],K.prototype,"visibleElements",void 0),e([n()],K.prototype,"_helpMessage",null),K=e([l("esri.widgets.Editor")],K);const Q=K;export{Q as default};
5
+ import{_ as e}from"../chunks/tslib.es6.js";import"../intl.js";import{mappedFind as t,abortMaybe as s,destroyMaybe as o}from"../core/maybe.js";import{createResolver as i}from"../core/promiseUtils.js";import{watch as r,initial as a,on as n,when as l}from"../core/reactiveUtils.js";import{property as d}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{subclass as c}from"../core/accessorSupport/decorators/subclass.js";import m from"../views/interactive/sketch/SketchValueOptions.js";import h from"./Attachments.js";import p from"./FeatureForm.js";import u from"./FeatureTemplates.js";import g from"./Spinner.js";import w from"./Widget.js";import{css as v}from"./Editor/css.js";import _ from"./Editor/EditorViewModel.js";import{isModelUpload as f}from"./Editor/modelUploadUtils.js";import k from"./Editor/VisibleElements.js";import{loadCreateFeaturesPanelContentComponents as y,CreateFeaturesPanelContent as b}from"./Editor/components/CreateFeaturesPanelContent.js";import{loadFeatureListComponents as F,FeatureList as M}from"./Editor/components/FeatureList.js";import{loadFooterActionsComponents as A,FooterActions as T}from"./Editor/components/FooterActions.js";import{loadNoticesComponents as C,Notice as E}from"./Editor/components/Notices.js";import{loadPanelContentComponents as P,PanelContent as W,PanelContentSection as L,PanelContentMessage as j}from"./Editor/components/PanelContent.js";import{PanelToolbar as S,loadPanelToolbarComponents as I}from"./Editor/components/PanelToolbar.js";import{loadPromptComponents as U,Prompt as D}from"./Editor/components/Prompt.js";import{loadUpdateFeaturePanelContentComponents as O,UpdateFeaturePanelContent as V}from"./Editor/components/UpdateFeaturePanelContent.js";import{loadUploadDetailsComponents as x,UploadDetails as B}from"./Editor/components/UploadDetails.js";import{VisibleElements as R,CreateToolVisibilityMap as G}from"./Sketch/VisibleElements.js";import{loadCalciteComponents as z}from"./support/componentsUtils.js";import{globalCss as H}from"./support/globalCss.js";import{incrementHeadingLevel as q,Heading as N}from"./support/Heading.js";import{renderItem as K}from"./support/ItemList.js";import{connectDelayedLoading as $}from"./support/loaderUtils.js";import"./support/widgetUtils.js";import{messageBundle as J}from"./support/decorators/messageBundle.js";import{vmEvent as Q}from"./support/decorators/vmEvent.js";import{tsx as X}from"./support/jsxFactory.js";import{substitute as Y}from"../intl/substitute.js";const Z=Symbol("sketch-setup-handles");let ee=class extends w{constructor(e,t){super(e,t),this._featureForm=new p,this._sketchToolbar=null,this._attachments=new h({visibleElements:{addSubmitButton:!1,cancelAddButton:!1,cancelUpdateButton:!1,deleteButton:!1,errorMessage:!1,progressBar:!1,updateButton:!1}}),this._featureTemplates=new u({enableListScroll:!1,renderItemContentEnd:e=>e.supportsUpload?X("calcite-icon",{class:v.templateItemContentEnd,icon:"upload-to",key:"upload-icon"}):null,renderItemLabel:e=>e.label,renderCustomGroupContent:e=>this._renderCustomTemplateGroupContent(e)}),this._filterText="",this._prompt=null,this._spinner=new g,this._loading=!1,this.headingLevel=4,this.messages=null,this.messagesCommon=null,this.messagesTemplates=null,this.messagesFeature=null,this.supportingWidgetDefaults=null,this.viewModel=new _,this.visibleElements=new k,this._renderAttachments=()=>this._attachments.render(),this._renderFeatureForm=()=>this._featureForm.render(),this._renderFeatureTemplates=()=>this._featureTemplates.render(),this._renderSketch=()=>this._sketchToolbar?X("div",{class:v.sketchContainer,key:"editor-sketch-container"},this._sketchToolbar?.render()):void 0,this._renderSelectIcon=()=>X("calcite-icon",{icon:"cursor",slot:"content-start"}),this.EditorPanel=({heading:e,key:t,selected:s},...o)=>{const{visibleElements:i}=this;return X("calcite-flow-item",{closable:!1,heading:e,headingLevel:this.headingLevel,key:t,loading:this._loading,selected:s,onCalciteFlowItemBack:this._onBack},i.settingsMenu?X(S,{editorViewModel:this.viewModel,messagesCommon:this.messagesCommon,visibleElements:i}):null,...o)},this._showDiscardEditsPrompt=()=>{const{messages:e,activeWorkflow:t}=this,s={title:e.cancelEditTitle,message:e.cancelEditWarningMessage,yesLabel:e.discardEdits,noLabel:e.continueEditing};return"create-features"===t?.type&&f(t.data.creationInfo)?this._showPromptAndWait("success"===t.data.upload?.state?e.modelUploads.cancelPlacementPrompt:e.modelUploads.cancelUploadPrompt):"update"===t?.type&&t.activeFeatureFormViewModel?.activeAssociation?this._showPromptAndWait({...s,message:e.cancelAssociationEditWarning}):this._showPromptAndWait(s)},this._showGenericCancelPrompt=()=>{const{messages:e,messagesCommon:t}=this;return this._showPromptAndWait({title:e.cancelRequestTitle,message:e.cancelRequestWarningMessage,yesLabel:t.form.yes,noLabel:t.form.no})},this._showPrompt=e=>{this._prompt?.cancel?.(),this._prompt=e},this._clearPrompt=()=>{this._prompt=null},this._onSave=()=>{this.viewModel.saveWorkflow()},this._onDelete=()=>{const{messages:e,messagesCommon:t}=this;this._showPrompt({title:e.deleteWarningTitle,message:e.deleteWarningMessage,context:"danger",actions:{primary:{label:t.delete,action:()=>{this.deleteFeatureFromWorkflow(),this._clearPrompt()}},secondary:{label:e.keepFeature,action:this._clearPrompt}}})},this._onDeleteAssociation=()=>{const{messages:e,messagesCommon:t}=this;this._showPrompt({title:e.deleteAssociationTitle,message:e.deleteAssociationMessage,context:"danger",actions:{primary:{label:t.delete,action:()=>{this.deleteAssociationFromWorkflow(),this._clearPrompt()}},secondary:{label:e.keepAssociation,action:this._clearPrompt}}})},this._onToggleUpdateWorkflow=()=>this.viewModel.toggleUpdateWorkflow(),this._onBack=e=>(e?.stopPropagation(),this.viewModel.back()),this._onAttachmentAdd=()=>{const{activeWorkflow:e}=this.viewModel;e&&("create-features"===e.type||"update"===e.type&&"create-features"===e.activeWorkflow?.type?(this._attachments.addFile(),e.back()):this._attachments.addAttachment().then((()=>e.back())))},this._onAttachmentUpdate=()=>{const{activeWorkflow:e}=this.viewModel;e&&("create-features"===e.type?(this._attachments.updateFile(),e.back()):this._attachments.updateAttachment().then((()=>e.back())))},this._onAttachmentDelete=()=>{const{messages:e,messagesCommon:t}=this;this._showPrompt({title:e.deleteAttachmentWarningTitle,message:e.deleteAttachmentWarningMessage,context:"danger",actions:{primary:{label:t.delete,action:this._onAttachmentDeleteConfirm},secondary:{label:e.keepAttachment,action:this._clearPrompt}}})},this._onAttachmentDeleteConfirm=async()=>{const e=this._attachments,{activeWorkflow:t}=this.viewModel;t&&("create-features"===t.type?e.deleteFile():(await e.deleteAttachment(e.viewModel.activeAttachmentInfo),this._clearPrompt()),await t.back(),this._clearPrompt())},this._onAttachmentsError=e=>{this._showPrompt({title:this.messages.errorWarningTitle,message:e.message,context:"warning",actions:{primary:{label:this.messagesCommon.form.ok,action:this._clearPrompt}}})}}initialize(){this._featureForm.showPrompt=this._showPrompt,this._featureForm.clearPrompt=this._clearPrompt,this.addHandles([r((()=>q(this.headingLevel)),(e=>{this._featureForm.headingLevel=e,this._featureTemplates.headingLevel=e}),a),n((()=>this.viewModel.activeWorkflow),"cancel-request",(({controller:e})=>{(this.viewModel.hasPendingEdits?this._showDiscardEditsPrompt():this._showGenericCancelPrompt()).then((t=>t?e.allow():e.deny()))})),l((()=>this.viewModel.featureFormViewModel),(e=>{this._featureForm.viewModel=e}),a),r((()=>this.viewModel),(e=>{this._attachments.viewModel=e?.attachmentsViewModel??null,this._featureTemplates.viewModel=e?.featureTemplatesViewModel??null,this._spinner.viewModel=e?.spinnerViewModel??null,e.showDiscardEditsPrompt=this._showDiscardEditsPrompt}),a),r((()=>this.view),((e,t)=>{const s=`editor-${this.id}-spinner`;t?.ui.remove(this._spinner,s),e?.ui.add(this._spinner,{key:s,position:"manual"})}),a),r((()=>[this.supportingWidgetDefaults,this.viewModel.sketchViewModel]),(([e])=>{e&&(this._featureForm.set(e.featureForm),this._attachments.set(e.attachments),this._featureTemplates.set(e.featureTemplates),this.viewModel.sketchViewModel?.set(e.sketch))}),a),l((()=>this._attachments?.error),(e=>this._onAttachmentsError(e))),l((()=>this.viewModel?.failures),(e=>{const{messages:t}=this,[{error:s,retry:o,cancel:i}]=e;this._showPrompt({title:t.errorWarningTitle,message:Y(t.errorWarningMessageTemplate,{errorMessage:s.message}),context:"warning",actions:{primary:{label:t.retry,action:()=>{o(),this._clearPrompt()}},secondary:{label:t.ignore,action:()=>{i(),this._clearPrompt()}}}})})),r((()=>this.viewModel?.state),(e=>{switch(e){case"awaiting-feature-to-update":case"ready":case"disabled":this._filterText="",this._featureTemplates.filterText=""}})),r((()=>this.viewModel.featureFormDisabled),(e=>this._featureForm.disabled=e)),r((()=>this.visibleElements.sketch),(()=>this._setupSketch()),a),$({getLoading:()=>{const{viewModel:e}=this;return e.syncing||e.updating||this._attachments.submitting},setEffectiveLoading:e=>{this._loading=e}})])}destroy(){this._attachments.destroy(),this._featureForm.destroy(),this._featureTemplates.destroy()}loadDependencies(){return Promise.all([z({flow:()=>import("@esri/calcite-components/dist/components/calcite-flow"),"flow-item":()=>import("@esri/calcite-components/dist/components/calcite-flow-item"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),list:()=>import("@esri/calcite-components/dist/components/calcite-list")}),y(),F(),A(),C(),P(),I(),U(),O(),x()])}get _deleteButtonCommonInfo(){return{appearance:"outline",kind:"danger"}}get activeWorkflow(){return this.viewModel.activeWorkflow}get hideTemplatesForInactiveLayers(){return this.viewModel.hideTemplatesForInactiveLayers}set hideTemplatesForInactiveLayers(e){this.viewModel.hideTemplatesForInactiveLayers=e}get icon(){return"pencil"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get labelOptions(){return this.viewModel.labelOptions}set labelOptions(e){this.viewModel.labelOptions=e}get layerInfos(){return this.viewModel.layerInfos}set layerInfos(e){this.viewModel.layerInfos=e}get snappingOptions(){return this.viewModel.snappingOptions}set snappingOptions(e){this.viewModel.snappingOptions=e}get tooltipOptions(){return this.viewModel.tooltipOptions}set tooltipOptions(e){this.viewModel.tooltipOptions=e}get valueOptions(){return this.viewModel.valueOptions}set valueOptions(e){this.viewModel.valueOptions=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}startCreateFeaturesWorkflowAtFeatureTypeSelection(){return this.viewModel.startCreateFeaturesWorkflowAtFeatureTypeSelection()}startCreateFeaturesWorkflowAtFeatureCreation(e){return this.viewModel.startCreateFeaturesWorkflowAtFeatureCreation(e)}startCreateFeaturesWorkflowAtFeatureEdit(e){return this.viewModel.startCreateFeaturesWorkflowAtFeatureEdit(e)}startUpdateWorkflowAtFeatureSelection(){return this.viewModel.startUpdateWorkflowAtFeatureSelection()}startUpdateWorkflowAtMultipleFeatureSelection(e){return this.viewModel.startUpdateWorkflowAtMultipleFeatureSelection(e)}startUpdateWorkflowAtFeatureEdit(e){return this.viewModel.startUpdateWorkflowAtFeatureEdit(e)}deleteFeatureFromWorkflow(){return this.viewModel.deleteFeatureFromWorkflow()}deleteAssociationFromWorkflow(){return this.viewModel.deleteAssociationFromWorkflow()}cancelWorkflow(e){return this.viewModel.cancelWorkflow(e)}render(){const{visibleElements:e,viewModel:t}=this,s=this.classes(v.base,H.widget,H.panel);if(!t)return X("div",{class:s,key:"empty"});const{pageStack:o}=t,i=o.length-1,r=o.map(((e,t)=>this._renderPage(e,t===i)));return X("div",{class:s,key:"base"},e.flow?X("calcite-flow",{key:"flow"},r):r,this._prompt?X(D,{...this._prompt,headingLevel:this.headingLevel}):void 0)}_renderPage(e,t){const s={selected:t};switch(e){case"disabled":break;case"ready":return this._renderReady(s);case"awaiting-feature-creation-info":return this._renderAwaitingFeatureCreationInfo(s);case"creating-features-upload-details":return this._renderUploadDetails(s);case"creating-features":return this._renderCreatingFeatures(s);case"editing-existing-feature":case"editing-attributes":return this._renderUpdateFeature(s);case"awaiting-update-feature-candidate":return this._renderFeatureList(s);case"adding-attachment":return this._renderAttachmentAdding(s);case"editing-attachment":return this._renderAttachmentEditing(s);case"viewing-associated-layers":case"viewing-associated-features":return this._renderViewAssociatedLayers(s)}return X("div",{key:"empty-page"})}_renderAwaitingFeatureCreationInfo(e){const{EditorPanel:t,messages:s}=this;return X(t,{heading:s.selectTemplate,key:"templates-panel",...e},X(W,{key:"feature-templates"},X(L,null,this._renderFeatureTemplates())))}_renderUploadDetails(e){const{EditorPanel:t,activeWorkflow:s,messages:o}=this;if("create-features"!==s?.type)return null;const i=s.data.upload;return i?X(t,{heading:o.createFeatures,key:"upload-details-panel",...e},X(B,{helpMessage:this._helpMessage,messages:o,upload:i})):null}_renderCreatingFeatures(e){const{EditorPanel:t,activeWorkflow:s,messages:o,messagesCommon:i,headingLevel:r,viewModel:a}=this;if(!s)return null;const n="create-features"===s.type&&s.numPendingFeatures>0||"update"===s.type&&"create-features"===s?.activeWorkflow?.type&&s.activeWorkflow?.numPendingFeatures>0;return X(t,{heading:o.createFeatures,key:"create-features-panel",...e},n?X(V,{editorViewModel:a,headingLevel:r,messages:o,messagesCommon:i,renderAttachments:this._renderAttachments,renderFeatureForm:this._renderFeatureForm,renderSketchToolbar:this._renderSketch,onDelete:this._onDelete,onDeleteAssociation:this._onDeleteAssociation,onSave:this._onSave}):X(b,{helpMessage:this._helpMessage,renderSketchToolbar:this._renderSketch}))}_renderUpdateFeature(e){const{EditorPanel:t,messages:s,messagesCommon:o,headingLevel:i,viewModel:r}=this;return X(t,{heading:s.editFeature,key:"update-feature-panel",...e},X(V,{editorViewModel:r,headingLevel:i,messages:s,messagesCommon:o,renderAttachments:this._renderAttachments,renderFeatureForm:this._renderFeatureForm,renderSketchToolbar:this._renderSketch,onDelete:this._onDelete,onDeleteAssociation:this._onDeleteAssociation,onSave:this._onSave}))}_getAssociationTypeTitle(e){if(!e)return null;if(e.title)return e.title;const{messagesFeature:t}=this;switch(e.type){case"attachment":return t.associationsAttachments;case"connectivity":return t.associationsConnectivity;case"structure":return t.associationsStructure;case"content":return t.associationsContents;case"container":return t.associationsContainer}}_renderViewAssociatedLayers(e){const{EditorPanel:t,messages:s,messagesCommon:o,headingLevel:i,viewModel:r}=this,a=r.featureFormViewModel?.activeAssociationInput?.activeAssociationType,n=this._getAssociationTypeTitle(a)??s.editFeature;return X(t,{heading:n,key:"viewing-associated-layers-panel",...e},X(V,{editorViewModel:r,headingLevel:i,messages:s,messagesCommon:o,renderAttachments:this._renderAttachments,renderFeatureForm:this._renderFeatureForm,renderSketchToolbar:this._renderSketch,onDelete:this._onDelete,onDeleteAssociation:this._onDeleteAssociation,onSave:this._onSave}))}_renderCustomTemplateGroupContent(e){const{messages:s,viewModel:o}=this,i=t(e.group.items,(e=>o.itemHasInvalidFormTemplate(e)?s.formFieldCreateError:void 0));return i?X(E,{kind:"warning",message:i}):null}_renderAttachmentAdding(e){const{EditorPanel:t,_attachments:s,messages:o,messagesCommon:i}=this;return X(t,{heading:o.addAttachment,key:"attachment-adding-panel",...e},X(W,{key:"attachments"},this._renderAttachments()),X(T,{buttons:[{label:s.submitting?i.cancel:i.add,disabled:s.submitting||!s.selectedFile,onClick:this._onAttachmentAdd,type:"button"}]}))}_renderAttachmentEditing(e){const{EditorPanel:t,_attachments:s,activeWorkflow:o,messages:i,messagesCommon:r}=this;return o?X(t,{heading:i.editAttachment,key:"attachment-editing-panel",...e},X(W,{key:"attachments"},this._renderAttachments()),o.shouldAllowAttachmentEditing?X(T,{buttons:[{label:r.update,disabled:s.submitting||!s.selectedFile,onClick:this._onAttachmentUpdate,type:"button"},{...this._deleteButtonCommonInfo,onClick:this._onAttachmentDelete,disabled:s.submitting,label:r.delete,type:"button"}]}):void 0):null}_renderReady(e){const{EditorPanel:t,messages:s,viewModel:o,visibleElements:i}=this,r=this._helpMessage;return X(t,{heading:s.widgetLabel,key:"landing-panel",...e},X(W,{key:"landing-content"},o.editorItems.length?[i.editFeaturesSection?X(L,{key:"edit-actions"},this._renderUpdateActions()):null,i.createFeaturesSection&&o.canCreateVisible?X(L,{key:"create-actions"},this._renderCreateActions()):null]:X(j,{key:"no-content"},s.noEditableLayers)),r?X("div",{class:v.helpMessage,key:"footer-actions",slot:"footer"},r):void 0)}get _helpMessage(){const{activeWorkflow:e,messages:t,view:s}=this,o=e?.helpMessage;return o?t["3d"===s?.type?"helpMessages3d":"helpMessages2d"]?.[o]:void 0}_renderUpdateActions(){const{messages:e,messagesCommon:t,viewModel:s}=this,o={id:"select",label:t.select};return X("div",{class:v.updateActions,key:"update-actions"},X(N,{level:q(this.headingLevel)},e.editFeatures),X("calcite-list",{class:v.updateActionsList,label:e.editFeaturesList,selectionAppearance:"border",selectionMode:"single"},K({disabled:!s.canUpdateVisible,grouped:!1,item:o,selectedItem:"awaiting-feature-to-update"===s.activeWorkflow?.stepId?o:void 0,renderIcon:this._renderSelectIcon,onItemSelect:this._onToggleUpdateWorkflow})))}_renderCreateActions(){return X("div",{key:"create-actions"},X(N,{level:q(this.headingLevel)},this.messages.createFeatures),X("div",{class:v.featureTemplatesContainer,key:"templates"},this._renderFeatureTemplates()))}_renderFeatureList(e){const{EditorPanel:t,viewModel:s}=this,{activeWorkflow:o}=s;if("update"!==o?.type)return null;const i=o.data.candidates,r=Y(this.messages.multipleFeaturesTemplate,{total:i.length});return X(t,{heading:r,key:"feature-list",...e},X(M,{editorItems:s.editorItems,filterText:this._filterText,id:this.id,messagesTemplates:this.messagesTemplates,workflow:o,onFilterTextChange:e=>this._filterText=e,onSelectFeature:(e,t)=>s.selectFeature(e,t)}))}_showPromptAndWait({title:e,message:t,yesLabel:s,noLabel:o}){const r=i(),{view:a}=this,n=a?.focused;return this._showPrompt({title:e,message:t,context:"danger",actions:{primary:{label:s,action:()=>r.resolve(!0)},secondary:{label:o,action:()=>r.resolve(!1)}}}),r.promise.finally((()=>{this._clearPrompt(),n&&a?.focus()}))}async _setupSketch(){if(!!!this.visibleElements.sketch)return this._sketchImportAbortController=s(this._sketchImportAbortController),this._sketchToolbar=o(this._sketchToolbar),void this.removeHandles(Z);if(this._sketchImportAbortController)return;const e=new AbortController;this._sketchImportAbortController=e;const t=await import("./Sketch.js");if(!e.signal.aborted)try{this._sketchToolbar=new t.default({toolbarKind:"docked",contextualToolLocation:"inline-end",scale:"s",visibleElements:new R({deleteButton:!1,settingsMenu:!1,directionModePicker:!1,selectionCountLabel:!1,duplicateButton:!1,createTools:new G({freehandPolygon:!0,freehandPolyline:!0})})}),this.addHandles([r((()=>this.viewModel.activeLeafWorkflow?.availableCreateTools),(e=>{this._sketchToolbar&&(this._sketchToolbar.availableCreateTools=e)}),a),r((()=>this.visibleElements.undoRedoButtons),(e=>{this._sketchToolbar&&(this._sketchToolbar.visibleElements.undoRedoMenu=e)}),a),l((()=>this.viewModel?.sketchViewModel),(e=>{this._sketchToolbar&&(this._sketchToolbar.viewModel=e)}),a),l((()=>!!this.messages),(()=>{this._sketchToolbar&&(this._sketchToolbar.customActions=[{icon:"zoom-to-object",text:this.messages.zoomTo,onclick:()=>this.viewModel.zoomTo(),id:"editor-custom-zoom-to",position:"before-selection-set"}])}),{once:!0,initial:!0})],Z)}finally{this._sketchImportAbortController=null}}};e([d()],ee.prototype,"_featureForm",void 0),e([d()],ee.prototype,"_sketchToolbar",void 0),e([d()],ee.prototype,"_attachments",void 0),e([d()],ee.prototype,"_featureTemplates",void 0),e([d()],ee.prototype,"_filterText",void 0),e([d()],ee.prototype,"_prompt",void 0),e([d()],ee.prototype,"_spinner",void 0),e([d()],ee.prototype,"_deleteButtonCommonInfo",null),e([d()],ee.prototype,"_loading",void 0),e([d({readOnly:!0})],ee.prototype,"activeWorkflow",null),e([d()],ee.prototype,"headingLevel",void 0),e([d()],ee.prototype,"hideTemplatesForInactiveLayers",null),e([d()],ee.prototype,"icon",null),e([d()],ee.prototype,"label",null),e([d()],ee.prototype,"labelOptions",null),e([d()],ee.prototype,"layerInfos",null),e([d(),J("esri/widgets/Editor/t9n/Editor")],ee.prototype,"messages",void 0),e([d(),J("esri/t9n/common")],ee.prototype,"messagesCommon",void 0),e([d(),J("esri/widgets/FeatureTemplates/t9n/FeatureTemplates")],ee.prototype,"messagesTemplates",void 0),e([d(),J("esri/widgets/Feature/t9n/Feature")],ee.prototype,"messagesFeature",void 0),e([d()],ee.prototype,"snappingOptions",null),e([d()],ee.prototype,"tooltipOptions",null),e([d()],ee.prototype,"supportingWidgetDefaults",void 0),e([d({type:m,nonNullable:!0})],ee.prototype,"valueOptions",null),e([d()],ee.prototype,"view",null),e([d(),Q(["sketch-create","sketch-delete","sketch-update","workflow-cancel","workflow-commit"])],ee.prototype,"viewModel",void 0),e([d({type:k,nonNullable:!0})],ee.prototype,"visibleElements",void 0),e([d()],ee.prototype,"_helpMessage",null),ee=e([c("esri.widgets.Editor")],ee);const te=ee;export{te as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.32/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../chunks/tslib.es6.js";import"../intl.js";import{watch as t,initial as s}from"../core/reactiveUtils.js";import{property as i}from"../core/accessorSupport/decorators/property.js";import{cast as n}from"../core/accessorSupport/decorators/cast.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as o}from"../core/accessorSupport/decorators/subclass.js";import r from"./Widget.js";import l from"./Feature/FeatureAttachments.js";import d from"./Feature/FeatureContent.js";import a from"./Feature/FeatureExpression.js";import c from"./Feature/FeatureFields.js";import p from"./Feature/FeatureMedia.js";import u from"./Feature/FeatureRelationship.js";import m from"./Feature/FeatureUtilityNetworkAssociationList.js";import h from"./Feature/FeatureUtilityNetworkAssociations.js";import y from"./Feature/FeatureViewModel.js";import{css as v}from"./Feature/resources.js";import{FeatureContentMixin as w}from"./Feature/support/FeatureContentMixin.js";import{loadCalciteComponents as g}from"./support/componentsUtils.js";import{globalCss as f}from"./support/globalCss.js";import{Heading as _}from"./support/Heading.js";import"./support/widgetUtils.js";import{messageBundle as M}from"./support/decorators/messageBundle.js";import{tsx as E}from"./support/jsxFactory.js";import{substitute as b}from"../intl/substitute.js";const F={title:!0,content:!0,lastEditedInfo:!0};let j=class extends(w(r)){constructor(e,t){super(e,t),this._contentWidgets=[],this.flowType="feature",this.flowItems=null,this.headingLevel=2,this.messages=null,this.messagesCommon=null,this.visibleElements={...F},this.viewModel=new y}initialize(){this.addHandles(t((()=>this.viewModel?.contentViewModels),(()=>this._setupContentWidgets()),s))}loadDependencies(){return g({notice:()=>import("@esri/calcite-components/dist/components/calcite-notice"),loader:()=>import("@esri/calcite-components/dist/components/calcite-loader")})}destroy(){this._destroyContentWidgets()}get graphic(){return this.viewModel.graphic}set graphic(e){this.viewModel.graphic=e}get defaultPopupTemplateEnabled(){return this.viewModel.defaultPopupTemplateEnabled}set defaultPopupTemplateEnabled(e){this.viewModel.defaultPopupTemplateEnabled=e}get isTable(){return this.viewModel.isTable}get icon(){return"polygon"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get location(){return this.viewModel.location}set location(e){this.viewModel.location=e}get spatialReference(){return this.viewModel.spatialReference}set spatialReference(e){this.viewModel.spatialReference=e}get timeZone(){return this.viewModel.timeZone}set timeZone(e){this.viewModel.timeZone=e}get title(){return this.viewModel.title}castVisibleElements(e){return{...F,...e}}get map(){return this.viewModel.map}set map(e){this.viewModel.map=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}setActiveMedia(e,t){return this.viewModel.setActiveMedia(e,t)}nextMedia(e){return this.viewModel.nextMedia(e)}previousMedia(e){return this.viewModel.previousMedia(e)}render(){const{state:e}=this.viewModel,t=E("div",{class:v.container,key:"container"},this._renderTitle(),"error"===e?this._renderError():"loading"===e?this._renderLoading():this._renderContentContainer());return E("div",{class:this.classes(v.base,f.widget)},t)}_renderError(){const{messagesCommon:e,messages:t,visibleElements:s}=this;return E("calcite-notice",{icon:"exclamation-mark-circle",kind:"danger",open:!0,scale:"s"},s.title?E("div",{key:"error-title",slot:"title"},e.errorMessage):null,E("div",{key:"error-message",slot:"message"},t.loadingError))}_renderLoading(){return E("div",{class:v.loadingSpinnerContainer,key:"loading-container"},E("calcite-loader",{inline:!0,label:""}))}_renderContentContainer(){const{visibleElements:e}=this;return e.content?E("div",{class:v.main},[this._renderContent(),this._renderLastEditInfo()]):null}_renderTitle(){const{visibleElements:e,title:t}=this;return e.title?E(_,{class:v.title,innerHTML:t,level:this.headingLevel}):null}_renderContent(){const e=this.viewModel.content,t="content";if(!e)return null;if(Array.isArray(e))return e.length?E("div",{class:v.contentNode,key:`${t}-content-elements`},e.map(this._renderContentElement,this)):null;if("string"==typeof e){const e=this._contentWidgets[0];return!e||e.destroyed?null:E("div",{class:this.classes(v.contentNode,v.contentNodeText),key:`${t}-content`},e.render())}return this.renderNodeContent(e)}_renderContentElement(e,t){const{visibleElements:s}=this;if("boolean"!=typeof s.content&&!s.content?.[e.type])return null;switch(e.type){case"attachments":return this._renderAttachments(t);case"custom":return this._renderCustom(e,t);case"fields":return this._renderFields(t);case"media":return this._renderMedia(t);case"text":return this._renderText(e,t);case"expression":return this._renderExpression(t);case"relationship":return this._renderRelationship(t);case"utility-network-associations":return this._renderAssociation(t);default:return null}}_renderAttachments(e){const t=this._contentWidgets[e];if(!t||t.destroyed)return null;const{state:s,attachmentInfos:i}=t.viewModel;return"loading"===s||i.length>0?E("div",{class:this.classes(v.contentElement),key:this._buildKey("attachments-element",e)},t.render()):null}_renderRelationship(e){const t=this._contentWidgets[e];return t&&!t.destroyed&&this.flowItems?E("div",{class:v.contentElement,key:this._buildKey("relationship-element",e)},t.render()):null}_renderAssociation(e){const t=this._contentWidgets[e];return t&&!t.destroyed&&this.flowItems?E("div",{class:v.contentElement,key:this._buildKey("utility-network-association-element",e)},t.render()):null}_renderExpression(e){const t=this._contentWidgets[e];return t&&!t.destroyed&&t.viewModel.contentElement?E("div",{class:v.contentElement,key:this._buildKey("expression-element",e)},t.render()):null}_renderCustom(e,t){const{creator:s}=e,i=this._contentWidgets[t];return!i||i.destroyed?null:s?E("div",{class:v.contentElement,key:this._buildKey("custom-element",t)},i.render()):null}_renderFields(e){const t=this._contentWidgets[e];return!t||t.destroyed?null:E("div",{class:v.contentElement,key:this._buildKey("fields-element",e)},t.render())}_renderMedia(e){const t=this._contentWidgets[e];return!t||t.destroyed?null:E("div",{class:v.contentElement,key:this._buildKey("media-element",e)},t.render())}_renderLastEditInfo(){const{visibleElements:e,messages:t}=this,{lastEditInfo:s}=this.viewModel;if(!s||!e.lastEditedInfo)return null;const{date:i,user:n}=s,o="edit"===s.type?n?t.lastEditedByUser:t.lastEdited:n?t.lastCreatedByUser:t.lastCreated,r=b(o,{date:i,user:n});return E("div",{class:this.classes(v.lastEditedInfo,v.contentElement),key:"edit-info-element"},r)}_renderText(e,t){const s=e.text,i=this._contentWidgets[t];return!i||i.destroyed?null:s?E("div",{class:this.classes(v.contentElement,v.text),key:this._buildKey("text-element",t)},i.render()):null}_buildKey(e,...t){return`${e}__${this.viewModel?.graphic?.uid||"0"}-${t.join("-")}`}_destroyContentWidget(e){e&&(e.viewModel=null,!e.destroyed&&e.destroy())}_destroyContentWidgets(){this._contentWidgets.forEach((e=>this._destroyContentWidget(e))),this._contentWidgets=[]}_setupContentWidgets(){this._destroyContentWidgets();const{headingLevel:e,visibleElements:t,flowItems:s,viewModel:i}=this,n=i?.content,{contentViewModels:o}=i;if(Array.isArray(n))n.forEach(((n,r)=>{if("attachments"===n.type&&(this._contentWidgets[r]=new l({displayType:n.displayType,headingLevel:t.title&&e<6?e+1:e,viewModel:o[r]})),"fields"===n.type&&(this._contentWidgets[r]=new c({viewModel:o[r]})),"media"===n.type&&(this._contentWidgets[r]=new p({viewModel:o[r]})),"text"===n.type&&(this._contentWidgets[r]=new d({viewModel:o[r]})),"custom"===n.type&&(this._contentWidgets[r]=new d({viewModel:o[r]})),"expression"===n.type&&(this._contentWidgets[r]=new a({viewModel:o[r]})),"relationship"===n.type){const e=new u({flowItems:s,featureVisibleElements:t,viewModel:o[r]});this._contentWidgets[r]=e}if("utility-network-associations"===n.type){const e=e=>{const{viewModel:n,listType:o,title:r}=e;if(!s)return;const{associationTypes:l}=n;l.forEach((e=>{e.type===o?.type?e.open=!0:e.open=!1}));const d=new m({viewModel:n,parentFeatureViewModel:i,listType:o,title:r,featureVisibleElements:t,description:i.title,flowItems:s});s.push(d)},n=new h({flowItems:s,onSelectAssociationType:e,parentFeatureViewModel:i,featureVisibleElements:t,viewModel:o[r]});this._contentWidgets[r]=n}}),this);else{const e=o[0];e&&!e.destroyed&&(this._contentWidgets[0]=new d({viewModel:e}))}this.scheduleRender()}};e([i()],j.prototype,"flowType",void 0),e([i()],j.prototype,"graphic",null),e([i()],j.prototype,"defaultPopupTemplateEnabled",null),e([i()],j.prototype,"flowItems",void 0),e([i()],j.prototype,"headingLevel",void 0),e([i({readOnly:!0})],j.prototype,"isTable",null),e([i()],j.prototype,"icon",null),e([i()],j.prototype,"label",null),e([i()],j.prototype,"location",null),e([i(),M("esri/widgets/Feature/t9n/Feature")],j.prototype,"messages",void 0),e([i(),M("esri/t9n/common")],j.prototype,"messagesCommon",void 0),e([i()],j.prototype,"spatialReference",null),e([i()],j.prototype,"timeZone",null),e([i({readOnly:!0})],j.prototype,"title",null),e([i()],j.prototype,"visibleElements",void 0),e([n("visibleElements")],j.prototype,"castVisibleElements",null),e([i()],j.prototype,"map",null),e([i()],j.prototype,"view",null),e([i({type:y})],j.prototype,"viewModel",void 0),j=e([o("esri.widgets.Feature")],j);const W=j;export{W as default};
5
+ import{_ as e}from"../chunks/tslib.es6.js";import"../intl.js";import{watch as t,initial as s}from"../core/reactiveUtils.js";import{property as i}from"../core/accessorSupport/decorators/property.js";import{cast as n}from"../core/accessorSupport/decorators/cast.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as o}from"../core/accessorSupport/decorators/subclass.js";import r from"./Widget.js";import l from"./Feature/FeatureAttachments.js";import d from"./Feature/FeatureContent.js";import a from"./Feature/FeatureExpression.js";import c from"./Feature/FeatureFields.js";import p from"./Feature/FeatureMedia.js";import u from"./Feature/FeatureRelationship.js";import m from"./Feature/FeatureUtilityNetworkAssociationList.js";import h from"./Feature/FeatureUtilityNetworkAssociations.js";import y from"./Feature/FeatureViewModel.js";import{css as v}from"./Feature/resources.js";import{FeatureContentMixin as w}from"./Feature/support/FeatureContentMixin.js";import{loadCalciteComponents as g}from"./support/componentsUtils.js";import{globalCss as f}from"./support/globalCss.js";import{Heading as _}from"./support/Heading.js";import"./support/widgetUtils.js";import{messageBundle as M}from"./support/decorators/messageBundle.js";import{tsx as E}from"./support/jsxFactory.js";import{substitute as b}from"../intl/substitute.js";const F={title:!0,content:!0,lastEditedInfo:!0};let j=class extends(w(r)){constructor(e,t){super(e,t),this._contentWidgets=[],this.flowType="feature",this.flowItems=null,this.headingLevel=2,this.messages=null,this.messagesCommon=null,this.visibleElements={...F},this.viewModel=new y}initialize(){this.addHandles(t((()=>this.viewModel?.contentViewModels),(()=>this._setupContentWidgets()),s))}loadDependencies(){return g({notice:()=>import("@esri/calcite-components/dist/components/calcite-notice"),loader:()=>import("@esri/calcite-components/dist/components/calcite-loader")})}destroy(){this._destroyContentWidgets()}get graphic(){return this.viewModel.graphic}set graphic(e){this.viewModel.graphic=e}get defaultPopupTemplateEnabled(){return this.viewModel.defaultPopupTemplateEnabled}set defaultPopupTemplateEnabled(e){this.viewModel.defaultPopupTemplateEnabled=e}get isTable(){return this.viewModel.isTable}get icon(){return"polygon"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get location(){return this.viewModel.location}set location(e){this.viewModel.location=e}get spatialReference(){return this.viewModel.spatialReference}set spatialReference(e){this.viewModel.spatialReference=e}get timeZone(){return this.viewModel.timeZone}set timeZone(e){this.viewModel.timeZone=e}get title(){return this.viewModel.title}castVisibleElements(e){return{...F,...e}}get map(){return this.viewModel.map}set map(e){this.viewModel.map=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}setActiveMedia(e,t){return this.viewModel.setActiveMedia(e,t)}nextMedia(e){return this.viewModel.nextMedia(e)}previousMedia(e){return this.viewModel.previousMedia(e)}render(){const{state:e}=this.viewModel,t=E("div",{class:v.container,key:"container"},this._renderTitle(),"error"===e?this._renderError():"loading"===e?this._renderLoading():this._renderContentContainer());return E("div",{class:this.classes(v.base,f.widget)},t)}_renderError(){const{messagesCommon:e,messages:t,visibleElements:s}=this;return E("calcite-notice",{icon:"exclamation-mark-circle",kind:"danger",open:!0,scale:"s"},s.title?E("div",{key:"error-title",slot:"title"},e.errorMessage):null,E("div",{key:"error-message",slot:"message"},t.loadingError))}_renderLoading(){return E("div",{class:v.loadingSpinnerContainer,key:"loading-container"},E("calcite-loader",{inline:!0,label:""}))}_renderContentContainer(){const{visibleElements:e}=this;return e.content?E("div",{class:v.main},[this._renderContent(),this._renderLastEditInfo()]):null}_renderTitle(){const{visibleElements:e,title:t}=this;return e.title?E(_,{class:v.title,innerHTML:t,level:this.headingLevel}):null}_renderContent(){const e=this.viewModel.content,t="content";if(!e)return null;if(Array.isArray(e))return e.length?E("div",{class:v.contentNode,key:`${t}-content-elements`},e.map(this._renderContentElement,this)):null;if("string"==typeof e){const e=this._contentWidgets[0];return!e||e.destroyed?null:E("div",{class:this.classes(v.contentNode,v.contentNodeText),key:`${t}-content`},e.render())}return this.renderNodeContent(e)}_renderContentElement(e,t){const{visibleElements:s}=this;if("boolean"!=typeof s.content&&!s.content?.[e.type])return null;switch(e.type){case"attachments":return this._renderAttachments(t);case"custom":return this._renderCustom(e,t);case"fields":return this._renderFields(t);case"media":return this._renderMedia(t);case"text":return this._renderText(e,t);case"expression":return this._renderExpression(t);case"relationship":return this._renderRelationship(t);case"utility-network-associations":return this._renderAssociation(t);default:return null}}_renderAttachments(e){const t=this._contentWidgets[e];if(!t||t.destroyed)return null;const{state:s,attachmentInfos:i}=t.viewModel;return"loading"===s||i.length>0?E("div",{class:this.classes(v.contentElement),key:this._buildKey("attachments-element",e)},t.render()):null}_renderRelationship(e){const t=this._contentWidgets[e];return t&&!t.destroyed&&this.flowItems?E("div",{class:v.contentElement,key:this._buildKey("relationship-element",e)},t.render()):null}_renderAssociation(e){const t=this._contentWidgets[e];return t&&!t.destroyed&&this.flowItems?E("div",{class:v.contentElement,key:this._buildKey("utility-network-association-element",e)},t.render()):null}_renderExpression(e){const t=this._contentWidgets[e];return t&&!t.destroyed&&t.viewModel.contentElement?E("div",{class:v.contentElement,key:this._buildKey("expression-element",e)},t.render()):null}_renderCustom(e,t){const{creator:s}=e,i=this._contentWidgets[t];return!i||i.destroyed?null:s?E("div",{class:v.contentElement,key:this._buildKey("custom-element",t)},i.render()):null}_renderFields(e){const t=this._contentWidgets[e];return!t||t.destroyed?null:E("div",{class:v.contentElement,key:this._buildKey("fields-element",e)},t.render())}_renderMedia(e){const t=this._contentWidgets[e];return!t||t.destroyed?null:E("div",{class:v.contentElement,key:this._buildKey("media-element",e)},t.render())}_renderLastEditInfo(){const{visibleElements:e,messages:t}=this,{lastEditInfo:s}=this.viewModel;if(!s||!e.lastEditedInfo)return null;const{date:i,user:n}=s,o="edit"===s.type?n?t.lastEditedByUser:t.lastEdited:n?t.lastCreatedByUser:t.lastCreated,r=b(o,{date:i,user:n});return E("div",{class:this.classes(v.lastEditedInfo,v.contentElement),key:"edit-info-element"},r)}_renderText(e,t){const s=e.text,i=this._contentWidgets[t];return!i||i.destroyed?null:s?E("div",{class:this.classes(v.contentElement,v.text),key:this._buildKey("text-element",t)},i.render()):null}_buildKey(e,...t){return`${e}__${this.viewModel?.graphic?.uid||"0"}-${t.join("-")}`}_destroyContentWidget(e){e&&(e.viewModel=null,!e.destroyed&&e.destroy())}_destroyContentWidgets(){this._contentWidgets.forEach((e=>this._destroyContentWidget(e))),this._contentWidgets=[]}_setupContentWidgets(){this._destroyContentWidgets();const{headingLevel:e,visibleElements:t,flowItems:s,viewModel:i}=this,n=i?.content,{contentViewModels:o}=i;if(Array.isArray(n))n.forEach(((n,r)=>{if("attachments"===n.type&&(this._contentWidgets[r]=new l({displayType:n.displayType,headingLevel:t.title&&e<6?e+1:e,viewModel:o[r]})),"fields"===n.type&&(this._contentWidgets[r]=new c({viewModel:o[r]})),"media"===n.type&&(this._contentWidgets[r]=new p({viewModel:o[r]})),"text"===n.type&&(this._contentWidgets[r]=new d({viewModel:o[r]})),"custom"===n.type&&(this._contentWidgets[r]=new d({viewModel:o[r]})),"expression"===n.type&&(this._contentWidgets[r]=new a({viewModel:o[r]})),"relationship"===n.type){const e=new u({flowItems:s,featureVisibleElements:t,viewModel:o[r]});this._contentWidgets[r]=e}if("utility-network-associations"===n.type){const e=e=>{const{viewModel:n,listType:o,title:r}=e;if(!s)return;n.activeAssociationType=o;const l=new m({viewModel:n,parentFeatureViewModel:i,listType:o,title:r,featureVisibleElements:t,description:i.title,flowItems:s});s.push(l)},n=new h({flowItems:s,onSelectAssociationType:e,parentFeatureViewModel:i,featureVisibleElements:t,viewModel:o[r]});this._contentWidgets[r]=n}}),this);else{const e=o[0];e&&!e.destroyed&&(this._contentWidgets[0]=new d({viewModel:e}))}this.scheduleRender()}};e([i()],j.prototype,"flowType",void 0),e([i()],j.prototype,"graphic",null),e([i()],j.prototype,"defaultPopupTemplateEnabled",null),e([i()],j.prototype,"flowItems",void 0),e([i()],j.prototype,"headingLevel",void 0),e([i({readOnly:!0})],j.prototype,"isTable",null),e([i()],j.prototype,"icon",null),e([i()],j.prototype,"label",null),e([i()],j.prototype,"location",null),e([i(),M("esri/widgets/Feature/t9n/Feature")],j.prototype,"messages",void 0),e([i(),M("esri/t9n/common")],j.prototype,"messagesCommon",void 0),e([i()],j.prototype,"spatialReference",null),e([i()],j.prototype,"timeZone",null),e([i({readOnly:!0})],j.prototype,"title",null),e([i()],j.prototype,"visibleElements",void 0),e([n("visibleElements")],j.prototype,"castVisibleElements",null),e([i()],j.prototype,"map",null),e([i()],j.prototype,"view",null),e([i({type:y})],j.prototype,"viewModel",void 0),j=e([o("esri.widgets.Feature")],j);const W=j;export{W as default};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.32/esri/copyright.txt for details.
4
+ */
5
+ import"../../support/widgetUtils.js";import{tsx as t}from"../../support/jsxFactory.js";import{getFeatureTitle as e,getAssociationTitle as r}from"../../support/UtilityNetworkAssociations/utilityNetworkUtils.js";function o(t){const{feature:e,association:o,associationType:n,messages:i}=t,{attachment:s,connectivity:c,container:a,content:u,structure:l}=i,p=e.sourceLayer;if(!o&&!n)return;if(!o)switch(n){case"attachment":return s;case"container":return a;case"connectivity":return c;case"content":return u;case"structure":return l}if(!p)return;const f=e.attributes[p.globalIdField]===o.fromNetworkElement.globalId?"from":"to";return r(o,f,i)}function n(r){const{feature:n}=r,i=e(n),s=o(r)??"";return t("calcite-block",{description:s,heading:i})}export{n as AssociationDetails};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.32/esri/copyright.txt for details.
4
4
  */
5
- import{_ as t}from"../../../chunks/tslib.es6.js";import"../../../intl.js";import{property as e}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as s}from"../../../core/accessorSupport/decorators/subclass.js";import{getFeatureFormTitle as i}from"../featureFormUtils.js";import o from"../UtilityNetworkAssociationInput.js";import{loadCalciteComponents as r}from"../../support/componentsUtils.js";import{globalCss as a}from"../../support/globalCss.js";import{Heading as n}from"../../support/Heading.js";import"../../support/widgetUtils.js";import{messageBundle as c}from"../../support/decorators/messageBundle.js";import{tsx as l,tsxFragment as p}from"../../support/jsxFactory.js";import d from"../../support/UtilityNetworkAssociations/UtilityNetworkAssociationList.js";import u from"../../support/UtilityNetworkAssociations/UtilityNetworkAssociationsViewModel.js";import{isConnectivity as m,isConnectivityMidspan as h,formatPercentAlong as y}from"../../support/UtilityNetworkAssociations/utilityNetworkUtils.js";import{substitute as g}from"../../../intl/substitute.js";const F="esri-feature-form-utility-network-association-list",f={base:F,header:`${F}__header`,headingContent:`${F}__heading-content`,listContainer:`${F}__list-container`};let _=class extends d{constructor(t,e){super(t,e),this.associationInput=null,this.headingLevel=5,this.listType=null,this.messagesFeatureForm=null,this.onSelectLayer=()=>{},this.onSelectFeature=()=>{},this.viewModel=new u}initialize(){this.setUpObserver()}loadDependencies(){return r({chip:()=>import("@esri/calcite-components/dist/components/calcite-chip"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),tooltip:()=>import("@esri/calcite-components/dist/components/calcite-tooltip")})}get associatedFeatureCount(){const{associationInput:t}=this;if(!t)return 0;const{associatedFeatureInfos:e,associatedLayer:s}=t,i=s?e.get(s):null;return i?i.length:0}render(){const{associationInput:t}=this;if(!t)return l("div",{class:this.classes(f.base,a.widget)});const{associatedLayer:e}=t,{state:s}=this.viewModel;return l("div",{class:this.classes(f.base,a.widget)},"loading"===s||"querying"===s||"refreshing"===s?this.renderLoading():e?this._renderFeatureList(t,e):this._renderLayerList(t))}_renderLayerList(t){const{associatedFeatureInfos:e}=t;return l("div",{class:f.listContainer},l("calcite-list",{label:this.messagesFeatureForm?.associations.associatedLayers},Array.from(e.keys(),(e=>this._renderLayerItem(t,e)))))}_renderFeatureList(t,e){return l(p,null,this._renderHeader(t,e),l("div",{class:f.listContainer},this.renderFeatureCountWarning(),l("calcite-list",{label:this.messagesFeatureForm?.associations.associatedFeatures},this._renderAssociatedFeatureListPage(t,e),this.renderFeatureObserver())))}_renderLayerTitle(t){return t.title?l(n,{key:"title",level:this.headingLevel},l("div",{class:f.headingContent},l("calcite-icon",{icon:"layer"}),t.title)):null}_renderTotal(t,e){const{messagesFeature:s}=this,{associatedFeatureInfos:i}=t,o=i.get(e),r=g(s?.numberRecords,{number:o?.length??"0"});return l("div",{key:e.id},r)}_renderHeader(t,e){return l("div",{class:f.header,key:"filter"},this._renderLayerTitle(e),this.renderFilter(),this._renderTotal(t,e))}_renderAssociatedFeatureListPage(t,e){const{filterText:s,endIndex:o}=this,r=t.associatedFeatureInfos.get(e)?.filter((t=>i(t).toLowerCase().includes(s))).slice(0,o).toArray()??[];return[...this._renderTooltips(r),...this._renderAssociatedFeatureList(r)]}_renderItemTooltip(t){const{tooltipReferenceMap:e}=this,s=t.feature.uid.toString();return m(t.association)?l("calcite-tooltip",{key:`tooltip-${s}`,overlayPositioning:"fixed",referenceElement:e.get(s)},this.getConnectivityTooltip(t.association.associationType)):null}_renderAssociatedFeature(t){const e=i(t),s=t.feature.uid.toString();return l("calcite-list-item",{description:t.terminalName??"",key:`associated-feature-type-${s}`,label:e,onCalciteListItemSelect:()=>this._selectAssociation(t)},m(t.association)?this.renderConnectivityIcon(t.association.associationType,s):null,h(t.association)?l("calcite-chip",{label:y(t.association),scale:"s",slot:"content-end"},y(t.association)):null,l("calcite-icon",{flipRtl:!0,icon:"chevron-right",scale:"s",slot:"content-end"}))}_renderTooltips(t){return t.map((t=>this._renderItemTooltip(t)))}_renderAssociatedFeatureList(t){return t.map((t=>this._renderAssociatedFeature(t)))}_renderLayerItem(t,e){const{associatedFeatureInfos:s}=t,i=s.get(e)?.length??0;return l("calcite-list-item",{key:`${e.id}-show-all`,label:e.title??this.messagesCommon.untitled,open:!0,value:e.id,onCalciteListItemSelect:()=>this._showAllAssociations(e)},l("calcite-chip",{label:i.toString(),scale:"s",slot:"content-end"},i),l("calcite-icon",{flipRtl:!0,icon:"chevron-right",scale:"s",slot:"content-end"}))}_selectAssociation(t){this.onSelectFeature({feature:t.feature,association:t.association})}_showAllAssociations(t){this.onSelectLayer({layer:t,associationInput:this.associationInput})}};t([e()],_.prototype,"associatedFeatureCount",null),t([e({type:o})],_.prototype,"associationInput",void 0),t([e()],_.prototype,"headingLevel",void 0),t([e()],_.prototype,"listType",void 0),t([e(),c("esri/widgets/FeatureForm/t9n/FeatureForm")],_.prototype,"messagesFeatureForm",void 0),t([e({constructOnly:!0})],_.prototype,"onSelectLayer",void 0),t([e({constructOnly:!0})],_.prototype,"onSelectFeature",void 0),t([e({type:u})],_.prototype,"viewModel",void 0),_=t([s("esri.widgets.FeatureForm.FeatureFormUtilityNetworkAssociations.FeatureFormUtilityNetworkAssociationList")],_);const L=_;export{L as default};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import"../../../intl.js";import{property as t}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as s}from"../../../core/accessorSupport/decorators/subclass.js";import{getFeatureFormTitle as i}from"../featureFormUtils.js";import o from"../UtilityNetworkAssociationInput.js";import{AssociationDetails as r}from"./AssociationDetails.js";import{loadCalciteComponents as a}from"../../support/componentsUtils.js";import{globalCss as n}from"../../support/globalCss.js";import{Heading as c}from"../../support/Heading.js";import"../../support/widgetUtils.js";import{messageBundle as l}from"../../support/decorators/messageBundle.js";import{tsx as p,tsxFragment as d}from"../../support/jsxFactory.js";import u from"../../support/UtilityNetworkAssociations/UtilityNetworkAssociationList.js";import m from"../../support/UtilityNetworkAssociations/UtilityNetworkAssociationsViewModel.js";import{isConnectivity as h,isConnectivityMidspan as y,formatPercentAlong as g}from"../../support/UtilityNetworkAssociations/utilityNetworkUtils.js";import{substitute as F}from"../../../intl/substitute.js";const f="esri-feature-form-utility-network-association-list",_={base:f,header:`${f}__header`,headingContent:`${f}__heading-content`,listContainer:`${f}__list-container`};let L=class extends u{constructor(e,t){super(e,t),this.associationInput=null,this.headingLevel=5,this.messagesFeatureForm=null,this.onSelectLayer=()=>{},this.onSelectFeature=()=>{},this.viewModel=new m}initialize(){this.setUpObserver()}loadDependencies(){return a({chip:()=>import("@esri/calcite-components/dist/components/calcite-chip"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),tooltip:()=>import("@esri/calcite-components/dist/components/calcite-tooltip")})}get associatedFeatureCount(){const{associationInput:e}=this;if(!e)return 0;const{associatedFeatureInfos:t,associatedLayer:s}=e,i=s?t.get(s):null;return i?i.length:0}render(){const{associationInput:e}=this;if(!e)return p("div",{class:this.classes(_.base,n.widget)});const{associatedLayer:t}=e,{state:s}=this.viewModel;return p("div",{class:this.classes(_.base,n.widget)},"loading"===s||"querying"===s||"refreshing"===s?this.renderLoading():t?this._renderFeatureList(e,t):this._renderLayerList(e))}_renderLayerList(e){const{associatedFeatureInfos:t}=e;return p("div",{class:_.listContainer},p("calcite-list",{label:this.messagesFeatureForm?.associations.associatedLayers},Array.from(t.keys(),(t=>this._renderLayerItem(e,t)))))}_renderFeatureList(e,t){return p(d,null,this._renderHeader(e,t),p("div",{class:_.listContainer},this.renderFeatureCountWarning(),p("calcite-list",{label:this.messagesFeatureForm?.associations.associatedFeatures},this._renderAssociatedFeatureListPage(e,t),this.renderFeatureObserver())))}_renderLayerTitle(e){return e.title?p(c,{key:"title",level:this.headingLevel},p("div",{class:_.headingContent},p("calcite-icon",{icon:"layer"}),e.title)):null}_renderTotal(e,t){const{messagesFeature:s}=this,{associatedFeatureInfos:i}=e,o=i.get(t),r=F(s?.numberRecords,{number:o?.length??"0"});return p("div",{key:t.id},r)}_renderHeader(e,t){const{messagesFeatureForm:s}=this,{activeAssociationType:i,feature:o}=e;return p("div",{class:_.header,key:"filter"},p(r,{associationType:i?.type,feature:o,messages:s.associations}),this._renderLayerTitle(t),this.renderFilter(),this._renderTotal(e,t))}_renderAssociatedFeatureListPage(e,t){const{filterText:s,endIndex:o}=this,r=e.associatedFeatureInfos.get(t)?.filter((e=>i(e).toLowerCase().includes(s))).slice(0,o).toArray()??[];return[...this._renderTooltips(r),...this._renderAssociatedFeatureList(r)]}_renderItemTooltip(e){const{tooltipReferenceMap:t}=this,s=e.feature.uid.toString();return h(e.association)?p("calcite-tooltip",{key:`tooltip-${s}`,overlayPositioning:"fixed",referenceElement:t.get(s)},this.getConnectivityTooltip(e.association.associationType)):null}_renderAssociatedFeature(e){const t=i(e),s=e.feature.uid.toString();return p("calcite-list-item",{description:e.terminalName??"",key:`associated-feature-type-${s}`,label:t,onCalciteListItemSelect:()=>this._selectAssociation(e)},h(e.association)?this.renderConnectivityIcon(e.association.associationType,s):null,y(e.association)?p("calcite-chip",{label:g(e.association),scale:"s",slot:"content-end"},g(e.association)):null,p("calcite-icon",{flipRtl:!0,icon:"chevron-right",scale:"s",slot:"content-end"}))}_renderTooltips(e){return e.map((e=>this._renderItemTooltip(e)))}_renderAssociatedFeatureList(e){return e.map((e=>this._renderAssociatedFeature(e)))}_renderLayerItem(e,t){const{associatedFeatureInfos:s}=e,i=s.get(t)?.length??0;return p("calcite-list-item",{key:`${t.id}-show-all`,label:t.title??this.messagesCommon.untitled,open:!0,value:t.id,onCalciteListItemSelect:()=>this._showAllAssociations(t)},p("calcite-chip",{label:i.toString(),scale:"s",slot:"content-end"},i),p("calcite-icon",{flipRtl:!0,icon:"chevron-right",scale:"s",slot:"content-end"}))}_selectAssociation(e){this.onSelectFeature({feature:e.feature,association:e.association})}_showAllAssociations(e){this.onSelectLayer({layer:e,associationInput:this.associationInput})}};e([t()],L.prototype,"associatedFeatureCount",null),e([t({type:o})],L.prototype,"associationInput",void 0),e([t()],L.prototype,"headingLevel",void 0),e([t(),l("esri/widgets/FeatureForm/t9n/FeatureForm")],L.prototype,"messagesFeatureForm",void 0),e([t({constructOnly:!0})],L.prototype,"onSelectLayer",void 0),e([t({constructOnly:!0})],L.prototype,"onSelectFeature",void 0),e([t({type:m})],L.prototype,"viewModel",void 0),L=e([s("esri.widgets.FeatureForm.FeatureFormUtilityNetworkAssociations.FeatureFormUtilityNetworkAssociationList")],L);const v=L;export{v as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.32/esri/copyright.txt for details.
4
4
  */
5
- import{_ as t}from"../../../chunks/tslib.es6.js";import{property as e}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as o}from"../../../core/accessorSupport/decorators/subclass.js";import i from"../../Widget.js";import{loadCalciteComponents as n}from"../../support/componentsUtils.js";import{globalCss as s}from"../../support/globalCss.js";import"../../support/widgetUtils.js";import{messageBundle as c}from"../../support/decorators/messageBundle.js";import{tsx as a}from"../../support/jsxFactory.js";import{getFeatureTitle as r}from"../../support/UtilityNetworkAssociations/utilityNetworkUtils.js";const l="esri-feature-form-utility-network-association-settings",m={base:l,header:`${l}__header`,headingContent:`${l}__heading-content`,listContainer:`${l}__list-container`};let d=class extends i{constructor(t,e){super(t,e),this.association=null,this.editedAssociation=null,this.fromFeature=null,this.headingLevel=5,this.messagesFeature=null,this.messagesCommon=null,this.messagesFeatureForm=null,this.readOnly=!1,this.toFeature=null,this.utilityNetwork=null}loadDependencies(){return n({block:()=>import("@esri/calcite-components/dist/components/calcite-block"),combobox:()=>import("@esri/calcite-components/dist/components/calcite-combobox"),"combobox-item":()=>import("@esri/calcite-components/dist/components/calcite-combobox-item"),"input-number":()=>import("@esri/calcite-components/dist/components/calcite-input-number"),label:()=>import("@esri/calcite-components/dist/components/calcite-label"),switch:()=>import("@esri/calcite-components/dist/components/calcite-switch")})}get associationType(){return this.association.associationType}set associationType(t){this.association.associationType=t}render(){return a("div",{class:this.classes(m.base,s.widget)},this._renderFromAssociationEndpoint(),this._renderToAssociationEndpoint(),this._renderAdditionalContent())}_getAssociationTitle(t,e){const{messagesFeatureForm:o}=this,{associationType:i}=t;switch(i){case"attachment":return"to"===e?o.associations.attachment:o.associations.structure;case"containment":return"to"===e?o.associations.content:o.associations.container;case"junction-edge-from-connectivity":case"junction-edge-midspan-connectivity":case"junction-junction-connectivity":case"connectivity":return o.associations.connectivity}return""}_renderFromAssociationEndpoint(){const{associationType:t,association:e,fromFeature:o}=this,i=r(o),n=this._getAssociationTitle(e,"from");switch(t){case"connectivity":case"junction-junction-connectivity":return this._renderAssociationEndpoint(i,n,this._renderConnectivityContent(o,e.fromNetworkElement))}return this._renderAssociationEndpoint(i,n)}_renderToAssociationEndpoint(){const{associationType:t,association:e,toFeature:o}=this,i=r(o),n=this._getAssociationTitle(e,"to");switch(t){case"connectivity":case"junction-junction-connectivity":return this._renderAssociationEndpoint(i,n,this._renderConnectivityContent(o,e.toNetworkElement));case"containment":return this._renderAssociationEndpoint(i,n,this._renderContainmentContent())}return this._renderAssociationEndpoint(i,n)}_renderAssociationEndpoint(t,e,o){return a("calcite-block",{description:e,heading:t},o)}_renderContainmentContent(){const{messagesFeatureForm:t,association:e}=this,o=e.isContentVisible??!1;return a("calcite-label",{layout:"inline"},t.associations.visible,a("calcite-switch",{checked:o,onCalciteSwitchChange:({currentTarget:t})=>{e.isContentVisible=t.checked}}))}_renderConnectivityContent(t,e){const{messagesFeatureForm:o,utilityNetwork:i}=this,n=i.getTerminalConfiguration(t),s=n?.terminals.map((t=>this._renderComboboxListItemNumber(t.id,e.terminalId,t.name)))||[];return a("calcite-label",null,o.associations.terminal,a("calcite-combobox",{allowCustomValues:!1,clearDisabled:!0,label:o.associations.terminalComboboxLabel,overlayPositioning:"fixed",selectionMode:"single",onCalciteComboboxChange:({currentTarget:t})=>{e.terminalId=parseInt(t.value,10)}},...s))}_renderAdditionalContent(){const{associationType:t,association:e}=this;switch(t){case"connectivity":case"junction-junction-connectivity":case"attachment":case"containment":return}const o="junction-edge-midspan-connectivity"===t?t:"junction-edge-to-connectivity",{messagesFeatureForm:i}=this,n=[this._renderComboboxListItemString("junction-edge-midspan-connectivity",o,i.associations.midspanEdge),this._renderComboboxListItemString("junction-edge-to-connectivity",o,i.associations.endpointEdge)];return a("div",null,a("label",null,i.associations.connectTo,a("calcite-combobox",{allowCustomValues:!1,clearDisabled:!0,label:i.associations.edgeConnectionComboboxLabel,overlayPositioning:"fixed",selectionMode:"single",onCalciteComboboxChange:({currentTarget:t})=>{const o="1"===t.value?"junction-edge-midspan-connectivity":"junction-edge-from-connectivity";e.associationType=o}},...n)),"junction-edge-midspan-connectivity"===o?this._renderMidspanEdgeContent():this._renderEndpointEdgeContent())}_renderMidspanEdgeContent(){const{association:t,messagesFeatureForm:e}=this;return a("calcite-label",null,e.associations.midspanLocation,a("calcite-input-number",{numberButtonType:"vertical",value:`${t.percentAlong}`,onCalciteInputNumberInput:({currentTarget:e})=>{t.percentAlong=parseFloat(e.value)}}))}_renderEndpointEdgeContent(){const{association:t,associationType:e,messagesFeatureForm:o}=this,i="junction-edge-to-connectivity"===e;return a("calcite-label",null,o.associations.edgeSide,a("calcite-label",{layout:"inline"},o.associations.fromSide,a("calcite-switch",{checked:i,onCalciteSwitchChange:({currentTarget:e})=>{const o=e.checked?"junction-edge-to-connectivity":"junction-edge-from-connectivity";t.associationType=o}}),o.associations.toSide))}_renderComboboxListItemNumber(t,e,o){return a("calcite-combobox-item",{heading:o,key:`#${t}`,selected:e===t,value:`${t}`})}_renderComboboxListItemString(t,e,o){return a("calcite-combobox-item",{heading:o,key:`#${t}`,selected:e===t,value:`${t}`})}};t([e()],d.prototype,"association",void 0),t([e()],d.prototype,"associationType",null),t([e()],d.prototype,"editedAssociation",void 0),t([e()],d.prototype,"fromFeature",void 0),t([e()],d.prototype,"headingLevel",void 0),t([e(),c("esri/widgets/Feature/t9n/Feature")],d.prototype,"messagesFeature",void 0),t([e(),c("esri/t9n/common")],d.prototype,"messagesCommon",void 0),t([e(),c("esri/widgets/FeatureForm/t9n/FeatureForm")],d.prototype,"messagesFeatureForm",void 0),t([e()],d.prototype,"readOnly",void 0),t([e()],d.prototype,"toFeature",void 0),t([e()],d.prototype,"utilityNetwork",void 0),d=t([o("esri.widgets.FeatureForm.FeatureFormUtilityNetworkAssociations.FeatureFormUtilityNetworkAssociationSettings")],d);const u=d;export{u as default};
5
+ import{_ as t}from"../../../chunks/tslib.es6.js";import{property as e}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as o}from"../../../core/accessorSupport/decorators/subclass.js";import i from"../../Widget.js";import{loadCalciteComponents as n}from"../../support/componentsUtils.js";import{globalCss as s}from"../../support/globalCss.js";import"../../support/widgetUtils.js";import{messageBundle as r}from"../../support/decorators/messageBundle.js";import{tsx as a}from"../../support/jsxFactory.js";import{getFeatureTitle as c,getAssociationTitle as l}from"../../support/UtilityNetworkAssociations/utilityNetworkUtils.js";const m="esri-feature-form-utility-network-association-settings",d={base:m,header:`${m}__header`,headingContent:`${m}__heading-content`,listContainer:`${m}__list-container`};let u=class extends i{constructor(t,e){super(t,e),this.association=null,this.editedAssociation=null,this.fromFeature=null,this.headingLevel=5,this.messagesFeature=null,this.messagesCommon=null,this.messagesFeatureForm=null,this.readOnly=!1,this.toFeature=null,this.utilityNetwork=null}loadDependencies(){return n({block:()=>import("@esri/calcite-components/dist/components/calcite-block"),combobox:()=>import("@esri/calcite-components/dist/components/calcite-combobox"),"combobox-item":()=>import("@esri/calcite-components/dist/components/calcite-combobox-item"),"input-number":()=>import("@esri/calcite-components/dist/components/calcite-input-number"),label:()=>import("@esri/calcite-components/dist/components/calcite-label"),switch:()=>import("@esri/calcite-components/dist/components/calcite-switch")})}get associationType(){return this.association.associationType}set associationType(t){this.association.associationType=t}render(){return a("div",{class:this.classes(d.base,s.widget)},this._renderFromAssociationEndpoint(),this._renderToAssociationEndpoint(),this._renderAdditionalContent())}_renderFromAssociationEndpoint(){const{associationType:t,association:e,fromFeature:o,messagesFeatureForm:i}=this,n=c(o),s=l(e,"from",i.associations);switch(t){case"connectivity":case"junction-junction-connectivity":return this._renderAssociationEndpoint(n,s,this._renderConnectivityContent(o,e.fromNetworkElement))}return this._renderAssociationEndpoint(n,s)}_renderToAssociationEndpoint(){const{associationType:t,association:e,toFeature:o,messagesFeatureForm:i}=this,n=c(o),s=l(e,"to",i.associations);switch(t){case"connectivity":case"junction-junction-connectivity":return this._renderAssociationEndpoint(n,s,this._renderConnectivityContent(o,e.toNetworkElement));case"containment":return this._renderAssociationEndpoint(n,s,this._renderContainmentContent())}return this._renderAssociationEndpoint(n,s)}_renderAssociationEndpoint(t,e,o){return a("calcite-block",{description:e,heading:t},o)}_renderContainmentContent(){const{messagesFeatureForm:t,association:e}=this,o=e.isContentVisible??!1;return a("calcite-label",{layout:"inline"},t.associations.visible,a("calcite-switch",{checked:o,onCalciteSwitchChange:({currentTarget:t})=>{e.isContentVisible=t.checked}}))}_renderConnectivityContent(t,e){const{messagesFeatureForm:o,utilityNetwork:i}=this,n=i.getTerminalConfiguration(t),s=n?.terminals.map((t=>this._renderComboboxListItemNumber(t.id,e.terminalId,t.name)))||[];return a("calcite-label",null,o.associations.terminal,a("calcite-combobox",{allowCustomValues:!1,clearDisabled:!0,label:o.associations.terminalComboboxLabel,overlayPositioning:"fixed",selectionMode:"single",onCalciteComboboxChange:({currentTarget:t})=>{e.terminalId=parseInt(t.value,10)}},...s))}_renderAdditionalContent(){const{associationType:t,association:e}=this;switch(t){case"connectivity":case"junction-junction-connectivity":case"attachment":case"containment":return}const o="junction-edge-midspan-connectivity"===t?t:"junction-edge-to-connectivity",{messagesFeatureForm:i}=this,n=[this._renderComboboxListItemString("junction-edge-midspan-connectivity",o,i.associations.midspanEdge),this._renderComboboxListItemString("junction-edge-to-connectivity",o,i.associations.endpointEdge)];return a("div",null,a("label",null,i.associations.connectTo,a("calcite-combobox",{allowCustomValues:!1,clearDisabled:!0,label:i.associations.edgeConnectionComboboxLabel,overlayPositioning:"fixed",selectionMode:"single",onCalciteComboboxChange:({currentTarget:t})=>{const o="1"===t.value?"junction-edge-midspan-connectivity":"junction-edge-from-connectivity";e.associationType=o}},...n)),"junction-edge-midspan-connectivity"===o?this._renderMidspanEdgeContent():this._renderEndpointEdgeContent())}_renderMidspanEdgeContent(){const{association:t,messagesFeatureForm:e}=this;return a("calcite-label",null,e.associations.midspanLocation,a("calcite-input-number",{numberButtonType:"vertical",value:`${t.percentAlong}`,onCalciteInputNumberInput:({currentTarget:e})=>{t.percentAlong=parseFloat(e.value)}}))}_renderEndpointEdgeContent(){const{association:t,associationType:e,messagesFeatureForm:o}=this,i="junction-edge-to-connectivity"===e;return a("calcite-label",null,o.associations.edgeSide,a("calcite-label",{layout:"inline"},o.associations.fromSide,a("calcite-switch",{checked:i,onCalciteSwitchChange:({currentTarget:e})=>{const o=e.checked?"junction-edge-to-connectivity":"junction-edge-from-connectivity";t.associationType=o}}),o.associations.toSide))}_renderComboboxListItemNumber(t,e,o){return a("calcite-combobox-item",{heading:o,key:`#${t}`,selected:e===t,value:`${t}`})}_renderComboboxListItemString(t,e,o){return a("calcite-combobox-item",{heading:o,key:`#${t}`,selected:e===t,value:`${t}`})}};t([e()],u.prototype,"association",void 0),t([e()],u.prototype,"associationType",null),t([e()],u.prototype,"editedAssociation",void 0),t([e()],u.prototype,"fromFeature",void 0),t([e()],u.prototype,"headingLevel",void 0),t([e(),r("esri/widgets/Feature/t9n/Feature")],u.prototype,"messagesFeature",void 0),t([e(),r("esri/t9n/common")],u.prototype,"messagesCommon",void 0),t([e(),r("esri/widgets/FeatureForm/t9n/FeatureForm")],u.prototype,"messagesFeatureForm",void 0),t([e()],u.prototype,"readOnly",void 0),t([e()],u.prototype,"toFeature",void 0),t([e()],u.prototype,"utilityNetwork",void 0),u=t([o("esri.widgets.FeatureForm.FeatureFormUtilityNetworkAssociations.FeatureFormUtilityNetworkAssociationSettings")],u);const p=u;export{p as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.32/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../Graphic.js";import{neverReached as n}from"../../core/compilerUtils.js";import s from"../../core/Evented.js";import i from"../../core/Logger.js";import{destroyMaybe as o}from"../../core/maybe.js";import r from"../../core/Promise.js";import{watch as a,whenOnce as l,on as u}from"../../core/reactiveUtils.js";import{templateHasKey as p}from"../../core/string.js";import{property as c}from"../../core/accessorSupport/decorators/property.js";import"../../core/RandomLCG.js";import{subclass as d}from"../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as h}from"../../core/support/UpdatingHandles.js";import f from"../../form/FormTemplate.js";import{isUtilityNetworkAssociationsElement as m,isGroupElement as g,isFieldElement as y,isRelationshipElement as _,isTextElement as v}from"../../form/support/formUtils.js";import I from"../../layers/support/ContingentValue.js";import{isEditableLayer as x}from"../../layers/support/editableLayers.js";import E from"../../layers/support/LayerContingentValuesCache.js";import{utc as C,unknown as F,system as b}from"../../time/timeZoneUtils.js";import{flattenAssociationInputs as V,flattenFieldInputs as w,isGroupInput as A,flattenRelationshipInputs as j,parseFormTemplateString as T,isRelationshipInput as M,isFieldInput as N,isTextElementInput as k,getNormalizedFeatureTypeInfo as L,valueIsValidContingentValue as R}from"./featureFormUtils.js";import S from"./FieldInput.js";import{FormExpressionsManager as H}from"./FormExpressionsManager.js";import U from"./GroupInput.js";import Z from"./RelationshipInput.js";import P from"./TextElementInput.js";import O from"./UtilityNetworkAssociationInput.js";import{createFormExpressionArcadeExecutor as W}from"../support/forms/expressions/FormExpressionArcadeExecutor.js";const G=new t({attributes:{}}),$={field:["editableExpression","requiredExpression","valueExpression","visibilityExpression"],group:["visibilityExpression"],relationship:["editableExpression","visibilityExpression"],text:["visibilityExpression"],utilityNetworkAssociations:["editableExpression","visibilityExpression"]},D="#JSAPI_CONTINGENT_VALUE_EMPTY_HASH",z="#JSAPI_CONTINGENT_VALUE_ANY_HASH",J="#JSAPI_CONTINGENT_VALUE_NULL_HASH",B="esri.widgets.FeatureForm.FeatureFormViewModel",K=()=>i.getLogger(B);let q=class extends(r.EsriPromiseMixin(s.EventedAccessor)){constructor(e){super(e),this._expressionExecutorsInUse=new Set,this._expressionExecutorLookup=new Map,this._expressionsManager=null,this._contingentValuesCache=null,this._featureClone=G.clone(),this._initialFeature=G.clone(),this._timeZone=null,this._updatingHandles=new h,this.activeAssociation=null,this.arcadeEditType="NA",this.contingencyConstraintViolations=new Map,this.disabled=!1,this.highlightHelper=null,this.inputs=[],this.map=null,this.callbacks=null,this.strict=!1,this.hasPendingSubtypeChoice=!1}initialize(){const e=a((()=>[this.layer,!!this.layer?.loaded,this.formTemplate,this.feature,this.timeZone,this.arcadeEditType]),(async([e,t])=>{null!=e&&(t?this._updatingHandles.addPromise(this._updateInputs()):e.load().catch((()=>{})))}),{equals:([e,t,n,s,i,o],[r,a,l,u,p,c])=>e===r&&t===a&&n===l&&s===u&&i===p&&o===c,initial:!0}),t=a((()=>this._arcadeContextInfo),(e=>{null!=this._expressionsManager&&(this._expressionsManager.arcadeContextInfo=e,this._updatingHandles.addPromise(this._expressionsManager.evaluateAll().finally((()=>this._afterExpressionsEvaluated()))))})),n=a((()=>this.layer),(e=>{const t="subtype-sublayer"===e?.type?e.parent:"feature"===e?.type?e:null;t&&this.addResolvingPromise(E.createLoadedLayerContingentValuesCache(t).then((e=>{this._contingentValuesCache=e,this.notifyChange("fieldsWithContingentValues")})))}),{initial:!0});this.addHandles([e,t,n])}destroy(){this.feature=null,this.layer=null,this._contingentValuesCache=o(this._contingentValuesCache),this.highlightHelper?.removeAll(),this._updatingHandles.destroy()}get _expressionInfosLookup(){return new Map(this.formTemplate?.expressionInfos?.map((e=>[e.name,e])))}get activeAssociationInput(){return this.allAssociationInputs.find((e=>e.uid===this.associationId))}get activeRelationshipInput(){return this.allRelationshipInputs.find((e=>e.relationshipId===this.relationshipId))}get _arcadeContextInfo(){const{_initialFeature:e,arcadeEditType:t,layer:n,map:s,spatialReference:i,timeZone:o}=this;return{layer:x(n)?n:null,originalFeature:e,editType:t,map:s,spatialReference:i,timeZone:o}}get associationId(){return this._get("associationId")}set associationId(e){null==e&&this.activeAssociationInput?.viewModel?.associationTypes.forEach((e=>{e.open=!1})),this._set("associationId",e)}get associatedLayer(){return this.activeAssociationInput?.associatedLayer}set associatedLayer(e){this.activeAssociationInput&&(this.activeAssociationInput.associatedLayer=e)}get allAssociationInputs(){return V(this.inputs)}get allFieldInputs(){return w(this.inputs)}get allGroupInputs(){return this.inputs.filter(A)}get allRelationshipInputs(){return j(this.inputs)}get _layerFieldsByName(){return new Map(this.layer?.fields.map((e=>[e.name,e])))}get feature(){return this._get("feature")}set feature(e){const t=this._get("feature");this._featureClone=e?e.clone():G.clone(),this._initialFeature=this._featureClone.clone(),this._expressionsManager&&(this._expressionsManager.feature=this._featureClone),e?(this._resetFieldInputValues(this._featureClone),this.allRelationshipInputs.forEach((t=>t.feature=e))):(this.inputs.forEach((e=>e.destroy())),this.inputs.length=0),t!==e&&(this.hasPendingSubtypeChoice=!1),this.contingencyConstraintViolations.clear(),this._set("feature",e)}get fieldsWithContingentValues(){if(null==this._contingentValuesCache)return new Set;const e=this._contingentValuesCache.fieldGroups.flatMap((e=>e.fields));return new Set(e)}get formTemplate(){return this.layer&&"formTemplate"in this.layer?this.layer.formTemplate:null}set formTemplate(e){void 0===e?this._clearOverride("formTemplate"):this._override("formTemplate",e)}get formDescription(){const{formTemplate:e,layer:t}=this;return e?.description&&t?T({label:e.description,attributes:this.getValues(),fieldsIndex:t.fieldsIndex,timeZone:this.timeZone}):null}get formTitle(){const{formTemplate:e,layer:t}=this;return e?.title&&t?T({label:e.title,attributes:this.getValues(),fieldsIndex:t.fieldsIndex,timeZone:this.timeZone}):null}get formHeaderVisible(){const{activeRelationshipInput:e,activeAssociationInput:t,formDescription:n,formTitle:s}=this;return!(e||t||!n&&!s)}get joinedContingentValues(){return this._joinContingentValues()}get layer(){return this.feature?.sourceLayer&&"applyEdits"in this.feature.sourceLayer?this.feature.sourceLayer:null}set layer(e){this._override("layer",e)}get relationshipId(){return this._get("relationshipId")}set relationshipId(e){const t=this.allRelationshipInputs;if(null!=e&&e===this.relationshipId||t.forEach((e=>e.showAllEnabled=!1)),null!=e){const n=t.find((t=>t.relationshipId===e));n&&(n.showAllEnabled=!0)}this._set("relationshipId",e)}get spatialReference(){return this.layer?.spatialReference??null}set spatialReference(e){this._override("spatialReference",e)}get state(){return this.layer?.loaded?"ready":"disabled"}get submittable(){return!!this.valid||this.allFieldInputs.filter((e=>!e.valid)).every((({submittable:e})=>e))}get timeZone(){const{layer:e}=this;if(e&&"datesInUnknownTimezone"in e&&e.datesInUnknownTimezone)return C;const t=e&&"preferredTimeZone"in e&&e.preferredTimeZone;return this._timeZone===F?t||C:this._timeZone||b}set timeZone(e){this._timeZone=e}get updating(){return this._updatingHandles.updating}get valid(){const e=this.allFieldInputs;return e.length>0&&e.every((({valid:e})=>e))}findField(e){return this.allFieldInputs.find((t=>t.name===e))}getFieldValueOptionsForField(e,t){const n=this.findField(e);if(!n)return[[],[],[]];const s="coded-value"===n.domain?.type?n.domain.codedValues.map((({name:e,code:t})=>({name:e,value:t}))):[],i=null==n.value||s.some((e=>e.value===n.value))?[]:[{name:`${n.value}`,value:n.value}],o=this.fieldsWithContingentValues.has(e)?this._getContingentValueOptionsForField(e,t):[];if(o.length>0){const e=new Set(o.map((e=>e.value)));return[o,s.filter((t=>!e.has(t.value))),i]}return[s,[],i]}getValue(e){const t=this.layer?.getField(e);if(null!=t)return this._featureClone.getAttribute(t.name)??null}setValue(e,t){const{_featureClone:n,strict:s}=this,i=this.findField(e);t=""===t?null:t,i&&n.getAttribute(e)!==t&&(i.value=t,s&&!i.valid||(this._afterValueChange(i),null!=this._expressionsManager&&this._updatingHandles.addPromise(this._expressionsManager.evaluateInvalidated([i.name]).finally((()=>this._afterExpressionsEvaluated())))))}getValues(){return{...this._featureClone.attributes}}overrideInitialFeature(e){this._initialFeature=e}submit(){const e=this.allFieldInputs,t=new Set(e.filter((e=>e.valid)).map((({name:e})=>e))),n=e.filter((e=>!e.valid)).map((({name:e})=>e)),s=this.getValues();if(this.validateContingencyConstraints(s,{includeIncompleteViolations:!0}).length>0)for(const[i,o]of this.contingencyConstraintViolations.entries())"error"===o.type&&(t.delete(i),n.push(i));this.emit("submit",{valid:[...t],invalid:n,values:s})}validateContingencyConstraints(e,t){const{_contingentValuesCache:n}=this,s=new Map;if(this.contingencyConstraintViolations=s,null==n)return[];const{invalid:i,incomplete:o}=n.validateContingencyConstraints(e),r=[...i,...t?.includeIncompleteViolations?o:[]];for(const a of r)for(const e of a.fieldGroup.fields)s.set(e,a);return r}notifyFeatureGeometryChanged(){const{_expressionsManager:e,feature:t,_featureClone:n}=this;t&&(n.geometry=t.geometry,null!=e&&this._updatingHandles.addPromise(e.evaluateInvalidatedByGeometry().finally((()=>this._afterExpressionsEvaluated()))))}applySubtypeDefaults(e){const{defaultValues:t}=e,{allFieldInputs:n}=this;for(const{name:s}of n){const e=t[s];null!=e&&this.setValue(s,e)}}_emitChangeEvent({name:e,valid:t,value:n}){this.emit("value-change",{layer:this.layer,feature:this.feature,fieldName:e,value:n,valid:t})}async _updateInputs(){this._stopExpressions();const{_featureClone:e,_initialFeature:t,arcadeEditType:n,formTemplate:s,inputs:i,layer:o,timeZone:r}=this;if(!o)return;const a={arcadeEditType:n,feature:e,initialFeature:t,layer:o,timeZone:r},l=i.slice(),u=s?.elements&&s.elements.length>0?await this._updateInputsUsingFormElements(l,s.elements,a):this._updateInputsUsingLayerFields(l,o?.fields,a);this.inputs=u,await this._startExpressions()}async _updateInputsUsingFormElements(e,t,n){const s=new Map;for(const r of e)if(A(r)){s.set(r.element,r);for(const e of r.inputs)e.element&&s.set(e.element,e)}else r.element&&s.set(r.element,r);const i=new Map,o=await this._updateInputsUsingFormElementsRecursive({existingInputsByElement:s,updatedElements:t.filter(Y),sharedInitializationProperties:n,group:null,newExpressionExecutorPromises:i});for(const[r,a]of s.entries())s.delete(r),a.destroy();return await Promise.all(Array.from(i.values())),o}async _updateInputsUsingFormElementsRecursive(e){const{existingInputsByElement:t,updatedElements:n,sharedInitializationProperties:s,group:i,newExpressionExecutorPromises:o}=e,r=[];for(const a of n){const e=t.has(a),n=e?t.get(a):this._makeInputFromElement(a,s,i);if(n){if(r.push(n),await l((()=>!n.updating)),this._assignExpressionExecutors(n,a,o),e)if(t.delete(a),A(n)){const{feature:e,timeZone:t}=s;n.set({feature:e,timeZone:t})}else if(M(n)){const e=this.relationshipId===a.relationshipId;n.set(s),n.set({map:this.map,showAllEnabled:e})}else m(n)?(n.set(s),n.set({map:this.map})):n.set(s);if(g(a)){const e=a.elements.filter((e=>Y(e)));n.inputs=await this._updateInputsUsingFormElementsRecursive({existingInputsByElement:t,updatedElements:e,sharedInitializationProperties:s,group:n,newExpressionExecutorPromises:o})}}}return r}_updateInputsUsingLayerFields(e,t,n){if(!Array.isArray(t))return K().warn(this.declaredClass,"No attribute fields found."),[];const s=new Map;for(const o of e)if(A(o)){for(const e of o.inputs)e.destroy();o.inputs.length=0,o.destroy()}else M(o)?o.destroy():N(o)&&(null!==o.element?o.destroy():s.set(o.field,o));const i=[];for(const o of t){const e=n.feature?.getAttribute(o.name)??null,t=s.get(o)??new S({field:o,preservesValueWhenHidden:this.formTemplate?.preserveFieldValuesWhenHidden});i.push(t.set({...n,value:e})),s.delete(o)}for(const[o,r]of s.entries())s.delete(o),r.destroy();return i}_resetFieldInputValues(e){for(const t of this.allFieldInputs)t.value=e.getAttribute(t.name)}_makeInputFromElement(e,t,s){return g(e)?Q(e,t):y(e)?this._makeFieldInputFromElement(e,t,s):_(e)?this._makeRelationshipInputFromElement(e,t,s):m(e)?this._makeUtilityNetworkAssociationInputFromElement(e,t,s):v(e)?X(e,t):m(e)?this._makeUtilityNetworkAssociationInputFromElement(e,t,s):n()}_makeFieldInputFromElement(e,t,n){const{arcadeEditType:s,feature:i,initialFeature:o,layer:r,timeZone:a}=t,{fieldName:l}=e,u=l&&this._layerFieldsByName.get(l);return u?new S({arcadeEditType:s,element:e,field:u,value:i?.getAttribute(e.fieldName)??null,feature:i,initialFeature:o,layer:r,group:n,preservesValueWhenHidden:this.formTemplate?.preserveFieldValuesWhenHidden,timeZone:a}):null}_makeRelationshipInputFromElement(e,t,n=null){const{map:s}=this,{feature:i,layer:o,timeZone:r}=t,a=new Z({element:e,feature:i,group:n,layer:o,map:s,timeZone:r});return a.addHandles(u((()=>a.relatedLayer),"edits",(()=>this._expressionsManager?.evaluateAsyncExpressions()))),a}_makeUtilityNetworkAssociationInputFromElement(e,t,n=null){const{map:s}=this,{feature:i,layer:o,timeZone:r}=t;return new O({element:e,feature:i,group:n,layer:o,map:s,timeZone:r})}_assignExpressionExecutors(e,t,n){const s=$[t.type],i=[];for(const o of s){const s=`${o}Executor`;if(e[s]){this._useExecutor(e[s]);continue}const r=t[o];if(null!=r&&""!==r){const t=this._expressionInfosLookup.get(r)?.expression??r;i.push(this._getOrCreateExecutorForExpression(t,n).then((t=>{e[s]=this._useExecutor(t)})))}}return k(e)&&i.push(...this._assignTextElementExpressionExecutors(e,n)),i}_assignTextElementExpressionExecutors(e,t){const{_expressionInfosLookup:n}=this,s=[];for(const o of e.expressionsUsed){const r=n.get(o);null!=r?s.push(this._getOrCreateExecutorForExpression(r.expression,t).then((t=>e.setExpressionExecutor(o,this._useExecutor(t))))):i.getLogger(this).error("feature-form:expression-not-found",`Could not find expressionInfo object with name '${o}'`)}for(const i of e.fieldsUsed){const n=`return $feature['${i}'];`;s.push(this._getOrCreateExecutorForExpression(n,t).then((t=>e.setFieldExecutor(i,this._useExecutor(t)))))}return s}async _getOrCreateExecutorForExpression(e,t){const{_expressionExecutorLookup:n}=this;if(n.has(e))return n.get(e);if(t.has(e))return t.get(e);const s=W(e,this.layer);t.set(e,s);const i=await s;return n.set(e,i),i}_createExpressionsManager(e){const{_arcadeContextInfo:t,_featureClone:n,allFieldInputs:s,formTemplate:i}=this;this._expressionsManager=new H({executors:e,feature:n,arcadeContextInfo:t,fieldInputs:s,preserveFieldValuesWhenHidden:!0===i?.preserveFieldValuesWhenHidden})}async _startExpressions(){if(0===this._expressionExecutorsInUse.size)return;const e=Array.from(this._expressionExecutorsInUse);this._createExpressionsManager(e),await this._expressionsManager.evaluateAll().finally((()=>this._afterExpressionsEvaluated()))}_stopExpressions(){this._expressionsManager=o(this._expressionsManager),this._expressionExecutorsInUse.clear()}_useExecutor(e){return this._expressionExecutorsInUse.add(e),e}_afterValueChange(e){const{name:t,value:n}=e,{_featureClone:s,formTemplate:i,layer:o}=this;if(!o)return;const r=s.getAttribute(t);s.setAttribute(t,n);const{typeFieldName:a,types:l}=L(o);if((e.isSubtypeField||t===a)&&n!==r){if("subtype-sublayer"===o.type){const e=o.parent?.findSublayerForFeature(s);this.feature&&(this.feature.sourceLayer=e),s.sourceLayer=e}const e=new Set;for(const t of l)if(t.domains&&"object"==typeof t.domains)for(const n of Object.keys(t.domains))e.add(n);for(const t of e){const e=this.findField(t);e&&e.notifyChange("domain")}this.notifyChange("joinedContingentValues")}if(null!=i){const{description:e,title:n}=i;n&&p(n,t)&&this.notifyChange("formTitle"),e&&p(e,t)&&this.notifyChange("formDescription")}this._emitChangeEvent(e)}_afterExpressionsEvaluated(){const{_featureClone:e}=this;for(const t of this.allFieldInputs)t.value!==e.getAttribute(t.name)&&this._afterValueChange(t)}_joinContingentValues(){const e=this._contingentValuesCache;if(null==e)return[];const{typeFieldName:t}=L(this.layer),n=t?this.getValue(t):null,s=[];for(const r of e.fieldGroups){const{contingencies:e,fields:t,name:i}=r,o=[];for(const s of e)s.isRetired||null!=s.subtype&&s.subtype.code!==n||o.push({values:s.values});o.length>0&&s.push({name:i,fields:t,contingencies:o})}const[i,o]=this._generateJoinPlan(s);return[...i.flatMap((e=>this._joinFieldGroupContingencies(e))),...o.flatMap((e=>e.contingencies))]}_generateJoinPlan(e){const t=new Map,n=[],s=new Set;for(const l of e)for(const e of l.fields)if(t.has(e)){const i=t.get(e),o=l,r=[i.name,o.name].sort().join("|");if(s.has(r))continue;n.push([i,o]),s.add(r),t.set(e,o)}else t.set(e,l);const i=new Set(n.flat()),o=new Set(e);for(const l of i)o.delete(l);const r=new Map,a=new Map;for(const l of new Set(n.flat())){const e=Symbol(l.name);r.set(e,new Set([l])),a.set(l,e)}for(const[l,u]of n){const e=a.get(l),t=a.get(u);if(e===t)continue;const n=r.get(e),s=r.get(t);for(const i of s)n.add(i),a.set(i,e);r.delete(t)}return[[...r.values()].map((e=>[...e])),[...o]]}_joinFieldGroupContingencies(e){const t=e.slice(),n=t.shift();let s=t.shift(),i=this._generateJoinKey(n.fields,s.fields),o=new Set([...n.fields,...s.fields]),r=new Map;for(const l of n.contingencies){const[e]=this._hashContingency(l,i.codedValueFields,!0);r.has(e)?r.get(e)?.push(l):r.set(e,[l])}for(;t.length>0;){const e=new Map,n=t.shift(),a=this._generateJoinKey(o,n.fields);for(const t of s.contingencies){const[n,s]=this._hashContingency(t,i.codedValueFields),o=s?this._findMatchingContingenciesWithAnyHashMask(r,n):r.get(n);if(r.has(z)&&o?.push(...this._findMatchingContingenciesContainingAny(t,r.get(z),i.codedValueFields)),null!=o)for(const r of o){const n=i.rangeFields.length>0?this._joinContingenciesWithRangeDomains(r,t,i.rangeFields):this._joinContingencies(r,t);if(null==n)break;const[s]=this._hashContingency(n,a.codedValueFields,!0);e.has(s)?e.get(s)?.push(n):e.set(s,[n])}}r=e,s=n,i=a,o=new Set([...o,...s.fields])}const a=[];for(const l of s.contingencies){const[e,t]=this._hashContingency(l,i.codedValueFields),n=t?this._findMatchingContingenciesWithAnyHashMask(r,e):r.get(e);if(r.has(z)&&n.push(...this._findMatchingContingenciesContainingAny(l,r.get(z),i.codedValueFields)),null!=n)for(const s of n){const e=i.rangeFields.length>0?this._joinContingenciesWithRangeDomains(s,l,i.rangeFields):this._joinContingencies(s,l);null!=e&&a.push(e)}}return a}_joinContingencies(e,t){const n={values:{...e.values,...t.values}};for(const[s,i]of Object.entries(n.values))"any"===i.objectType&&null!=e.values[s]&&(n.values[s]=e.values[s]);return n}_joinContingenciesWithRangeDomains(e,t,n){const s=this._joinContingencies(e,t);for(const i of n){const n=e.values[i],o=t.values[i],{leftIsNull:r,rightIsNull:a,bothAreNull:l,leftIsAny:u,rightIsAny:p,bothAreAny:c,leftIsRange:d,rightIsRange:h}=this._compareObjectTypes(n.objectType,o.objectType);if(l||c)continue;if(r&&p||a&&u){s.values[i]=new I({objectType:"null"});continue}if(r&&h||a&&d)return null;u?(n.minValue=-1/0,n.maxValue=1/0):p&&(o.minValue=-1/0,o.maxValue=1/0);const f=Math.max(n.minValue,o.minValue),m=Math.min(n.maxValue,o.maxValue);if(f>m)return null;s.values[i]=new I({objectType:"range",minValue:f,maxValue:m})}return s}_findMatchingContingenciesContainingAny(e,t,n){return t.filter((t=>n.every((n=>{const s=t.values[n],i=e.values[n];return"any"===s.objectType||"any"===i.objectType||s.codedValue?.code===i.codedValue?.code}))))}_findMatchingContingenciesWithAnyHashMask(e,t){const n=RegExp(`${t}$`),s=[];for(const[i,o]of e){if(i===z)break;n.test(i)&&s.push(...o)}return s}_generateJoinKey(e,t){const n=Array.isArray(e)?new Set(e):e,s=Array.isArray(t)?new Set(t):t,i=n.size<s.size?n:s,o=i===n?s:n,{feature:r}=this,a=new Set,l=new Set;for(const u of i)if(o.has(u)){const e=this.layer?.getFieldDomain(u,{feature:r??void 0,excludeImpliedDomains:!0});if(null==e)continue;switch(e.type){case"coded-value":a.add(u);break;case"range":l.add(u)}}return{codedValueFields:[...a],rangeFields:[...l]}}_contingencyIsValid(e,t){const n={};for(const{name:s,value:i}of this.allFieldInputs)this.fieldsWithContingentValues.has(s)&&null!=i&&s!==e&&(n[s]=i);return Object.entries(n).every((([e,n])=>!t.values.hasOwnProperty(e)||R(n,t.values[e])))}_getContingentValueOptionsForField(e,t){const n=this.joinedContingentValues.slice(),s=new Map,i={code:"",name:t??"No value"};for(const o of n){const t=o.values[e];if("code"===t?.objectType||"null"===t?.objectType){const{code:n,name:r}=t.codedValue&&"null"!==t.objectType?t.codedValue:i;!s.has(n)&&this._contingencyIsValid(e,o)&&s.set(n,{name:r,value:n})}}return[...s.values()]}_hashContingency(e,t,n=!1){if(t.length<1)return[D,!1];const s=[];let i=!1;for(const o of t){const t=e.values[o];if("any"===t.objectType){if(n)return[z,!0];i=!0,s.push(`${o}:.*`)}else"null"===t.objectType?s.push(`${o}:${J}`):s.push(`${o}:${t.codedValue?.code}`)}return[s.sort().join("&"),i]}_compareObjectTypes(e,t){return{leftIsNull:"null"===e,rightIsNull:"null"===t,bothAreNull:"null"===e&&"null"===t,leftIsAny:"any"===e,rightIsAny:"any"===t,bothAreAny:"any"===e&&"any"===t,leftIsRange:"range"===e,rightIsRange:"range"===t}}get test(){return{featureClone:this._featureClone}}};function Y(e){return"field"===e.type||"group"===e.type||"relationship"===e.type||"text"===e.type||"utilityNetworkAssociations"===e.type||(K().warn("form-info::unsupported-element-type","Only element types 'field', 'group' and 'relationship' are supported",`Element ${e.label} has unsupported type '${e.type}'`),!1)}function Q(e,t){const{feature:n,layer:s}=t;return new U({element:e,inputs:[],feature:n,layer:s})}function X(e,t,n=null){const{feature:s,layer:i,timeZone:o}=t;return new P({element:e,feature:s,group:n,layer:i,timeZone:o})}e([c()],q.prototype,"_expressionInfosLookup",null),e([c()],q.prototype,"_featureClone",void 0),e([c()],q.prototype,"_timeZone",void 0),e([c()],q.prototype,"activeAssociation",void 0),e([c()],q.prototype,"activeAssociationInput",null),e([c()],q.prototype,"activeRelationshipInput",null),e([c()],q.prototype,"_arcadeContextInfo",null),e([c()],q.prototype,"associationId",null),e([c()],q.prototype,"associatedLayer",null),e([c()],q.prototype,"allAssociationInputs",null),e([c()],q.prototype,"allFieldInputs",null),e([c()],q.prototype,"allGroupInputs",null),e([c()],q.prototype,"allRelationshipInputs",null),e([c()],q.prototype,"_layerFieldsByName",null),e([c()],q.prototype,"arcadeEditType",void 0),e([c()],q.prototype,"contingencyConstraintViolations",void 0),e([c()],q.prototype,"disabled",void 0),e([c()],q.prototype,"feature",null),e([c()],q.prototype,"fieldsWithContingentValues",null),e([c({type:f})],q.prototype,"formTemplate",null),e([c()],q.prototype,"formDescription",null),e([c()],q.prototype,"formTitle",null),e([c()],q.prototype,"formHeaderVisible",null),e([c()],q.prototype,"highlightHelper",void 0),e([c()],q.prototype,"inputs",void 0),e([c()],q.prototype,"joinedContingentValues",null),e([c()],q.prototype,"layer",null),e([c()],q.prototype,"map",void 0),e([c()],q.prototype,"callbacks",void 0),e([c()],q.prototype,"relationshipId",null),e([c()],q.prototype,"spatialReference",null),e([c()],q.prototype,"state",null),e([c()],q.prototype,"strict",void 0),e([c()],q.prototype,"submittable",null),e([c()],q.prototype,"timeZone",null),e([c()],q.prototype,"updating",null),e([c()],q.prototype,"valid",null),e([c()],q.prototype,"hasPendingSubtypeChoice",void 0),e([c()],q.prototype,"getValues",null),e([c()],q.prototype,"submit",null),e([c()],q.prototype,"test",null),q=e([d(B)],q);const ee=q;export{ee as default};
5
+ import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../Graphic.js";import{neverReached as n}from"../../core/compilerUtils.js";import s from"../../core/Evented.js";import i from"../../core/Logger.js";import{destroyMaybe as o}from"../../core/maybe.js";import r from"../../core/Promise.js";import{watch as a,whenOnce as l,on as u}from"../../core/reactiveUtils.js";import{templateHasKey as p}from"../../core/string.js";import{property as c}from"../../core/accessorSupport/decorators/property.js";import"../../core/RandomLCG.js";import{subclass as d}from"../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as h}from"../../core/support/UpdatingHandles.js";import f from"../../form/FormTemplate.js";import{isUtilityNetworkAssociationsElement as m,isGroupElement as g,isFieldElement as y,isRelationshipElement as _,isTextElement as v}from"../../form/support/formUtils.js";import I from"../../layers/support/ContingentValue.js";import{isEditableLayer as x}from"../../layers/support/editableLayers.js";import E from"../../layers/support/LayerContingentValuesCache.js";import{utc as C,unknown as F,system as b}from"../../time/timeZoneUtils.js";import{flattenAssociationInputs as V,flattenFieldInputs as w,isGroupInput as A,flattenRelationshipInputs as j,parseFormTemplateString as T,isRelationshipInput as M,isFieldInput as N,isTextElementInput as k,getNormalizedFeatureTypeInfo as L,valueIsValidContingentValue as R}from"./featureFormUtils.js";import S from"./FieldInput.js";import{FormExpressionsManager as H}from"./FormExpressionsManager.js";import U from"./GroupInput.js";import Z from"./RelationshipInput.js";import P from"./TextElementInput.js";import O from"./UtilityNetworkAssociationInput.js";import{createFormExpressionArcadeExecutor as W}from"../support/forms/expressions/FormExpressionArcadeExecutor.js";const G=new t({attributes:{}}),$={field:["editableExpression","requiredExpression","valueExpression","visibilityExpression"],group:["visibilityExpression"],relationship:["editableExpression","visibilityExpression"],text:["visibilityExpression"],utilityNetworkAssociations:["editableExpression","visibilityExpression"]},D="#JSAPI_CONTINGENT_VALUE_EMPTY_HASH",z="#JSAPI_CONTINGENT_VALUE_ANY_HASH",J="#JSAPI_CONTINGENT_VALUE_NULL_HASH",B="esri.widgets.FeatureForm.FeatureFormViewModel",K=()=>i.getLogger(B);let q=class extends(r.EsriPromiseMixin(s.EventedAccessor)){constructor(e){super(e),this._expressionExecutorsInUse=new Set,this._expressionExecutorLookup=new Map,this._expressionsManager=null,this._contingentValuesCache=null,this._featureClone=G.clone(),this._initialFeature=G.clone(),this._timeZone=null,this._updatingHandles=new h,this.activeAssociation=null,this.arcadeEditType="NA",this.contingencyConstraintViolations=new Map,this.disabled=!1,this.highlightHelper=null,this.inputs=[],this.map=null,this.callbacks=null,this.strict=!1,this.pendingSubtypeChoice=null}initialize(){const e=a((()=>[this.layer,!!this.layer?.loaded,this.formTemplate,this.feature,this.timeZone,this.arcadeEditType]),(async([e,t])=>{null!=e&&(t?this._updatingHandles.addPromise(this._updateInputs()):e.load().catch((()=>{})))}),{equals:([e,t,n,s,i,o],[r,a,l,u,p,c])=>e===r&&t===a&&n===l&&s===u&&i===p&&o===c,initial:!0}),t=a((()=>this._arcadeContextInfo),(e=>{null!=this._expressionsManager&&(this._expressionsManager.arcadeContextInfo=e,this._updatingHandles.addPromise(this._expressionsManager.evaluateAll().finally((()=>this._afterExpressionsEvaluated()))))})),n=a((()=>this.layer),(e=>{const t="subtype-sublayer"===e?.type?e.parent:"feature"===e?.type?e:null;t&&this.addResolvingPromise(E.createLoadedLayerContingentValuesCache(t).then((e=>{this._contingentValuesCache=e,this.notifyChange("fieldsWithContingentValues")})))}),{initial:!0});this.addHandles([e,t,n])}destroy(){this.feature=null,this.layer=null,this._contingentValuesCache=o(this._contingentValuesCache),this.highlightHelper?.removeAll(),this._updatingHandles.destroy()}get _expressionInfosLookup(){return new Map(this.formTemplate?.expressionInfos?.map((e=>[e.name,e])))}get activeAssociationInput(){return this.allAssociationInputs.find((e=>e.uid===this.associationId))}get activeRelationshipInput(){return this.allRelationshipInputs.find((e=>e.relationshipId===this.relationshipId))}get _arcadeContextInfo(){const{_initialFeature:e,arcadeEditType:t,layer:n,map:s,spatialReference:i,timeZone:o}=this;return{layer:x(n)?n:null,originalFeature:e,editType:t,map:s,spatialReference:i,timeZone:o}}get associationId(){return this._get("associationId")}set associationId(e){null==e&&this.activeAssociationInput?.viewModel&&(this.activeAssociationInput.viewModel.activeAssociationType=null),this._set("associationId",e)}get associatedLayer(){return this.activeAssociationInput?.associatedLayer}set associatedLayer(e){this.activeAssociationInput&&(this.activeAssociationInput.associatedLayer=e)}get allAssociationInputs(){return V(this.inputs)}get allFieldInputs(){return w(this.inputs)}get allGroupInputs(){return this.inputs.filter(A)}get allRelationshipInputs(){return j(this.inputs)}get _layerFieldsByName(){return new Map(this.layer?.fields.map((e=>[e.name,e])))}get feature(){return this._get("feature")}set feature(e){const t=this._get("feature");this._featureClone=e?e.clone():G.clone(),this._initialFeature=this._featureClone.clone(),this._expressionsManager&&(this._expressionsManager.feature=this._featureClone),e?(this._resetFieldInputValues(this._featureClone),this.allRelationshipInputs.forEach((t=>t.feature=e))):(this.inputs.forEach((e=>e.destroy())),this.inputs.length=0),t!==e&&(this.pendingSubtypeChoice=null),this.contingencyConstraintViolations.clear(),this._set("feature",e)}get fieldsWithContingentValues(){if(null==this._contingentValuesCache)return new Set;const e=this._contingentValuesCache.fieldGroups.flatMap((e=>e.fields));return new Set(e)}get formTemplate(){return this.layer&&"formTemplate"in this.layer?this.layer.formTemplate:null}set formTemplate(e){void 0===e?this._clearOverride("formTemplate"):this._override("formTemplate",e)}get formDescription(){const{formTemplate:e,layer:t}=this;return e?.description&&t?T({label:e.description,attributes:this.getValues(),fieldsIndex:t.fieldsIndex,timeZone:this.timeZone}):null}get formTitle(){const{formTemplate:e,layer:t}=this;return e?.title&&t?T({label:e.title,attributes:this.getValues(),fieldsIndex:t.fieldsIndex,timeZone:this.timeZone}):null}get formHeaderVisible(){const{activeRelationshipInput:e,activeAssociationInput:t,formDescription:n,formTitle:s}=this;return!(e||t||!n&&!s)}get joinedContingentValues(){return this._joinContingentValues()}get layer(){return this.feature?.sourceLayer&&"applyEdits"in this.feature.sourceLayer?this.feature.sourceLayer:null}set layer(e){this._override("layer",e)}get relationshipId(){return this._get("relationshipId")}set relationshipId(e){const t=this.allRelationshipInputs;if(null!=e&&e===this.relationshipId||t.forEach((e=>e.showAllEnabled=!1)),null!=e){const n=t.find((t=>t.relationshipId===e));n&&(n.showAllEnabled=!0)}this._set("relationshipId",e)}get spatialReference(){return this.layer?.spatialReference??null}set spatialReference(e){this._override("spatialReference",e)}get state(){return this.layer?.loaded?"ready":"disabled"}get submittable(){return!!this.valid||this.allFieldInputs.filter((e=>!e.valid)).every((({submittable:e})=>e))}get timeZone(){const{layer:e}=this;if(e&&"datesInUnknownTimezone"in e&&e.datesInUnknownTimezone)return C;const t=e&&"preferredTimeZone"in e&&e.preferredTimeZone;return this._timeZone===F?t||C:this._timeZone||b}set timeZone(e){this._timeZone=e}get updating(){return this._updatingHandles.updating}get valid(){const e=this.allFieldInputs;return e.length>0&&e.every((({valid:e})=>e))}findField(e){return this.allFieldInputs.find((t=>t.name===e))}getFieldValueOptionsForField(e,t){const n=this.findField(e);if(!n)return[[],[],[]];const s="coded-value"===n.domain?.type?n.domain.codedValues.map((({name:e,code:t})=>({name:e,value:t}))):[],i=null==n.value||s.some((e=>e.value===n.value))?[]:[{name:`${n.value}`,value:n.value}],o=this.fieldsWithContingentValues.has(e)?this._getContingentValueOptionsForField(e,t):[];if(o.length>0){const e=new Set(o.map((e=>e.value)));return[o,s.filter((t=>!e.has(t.value))),i]}return[s,[],i]}getValue(e){const t=this.layer?.getField(e);if(null!=t)return this._featureClone.getAttribute(t.name)??null}setValue(e,t){const{_featureClone:n,strict:s}=this,i=this.findField(e);t=""===t?null:t,i&&n.getAttribute(e)!==t&&(i.value=t,s&&!i.valid||(this._afterValueChange(i),null!=this._expressionsManager&&this._updatingHandles.addPromise(this._expressionsManager.evaluateInvalidated([i.name]).finally((()=>this._afterExpressionsEvaluated())))))}getValues(){return{...this._featureClone.attributes}}overrideInitialFeature(e){this._initialFeature=e}submit(){const e=this.allFieldInputs,t=new Set(e.filter((e=>e.valid)).map((({name:e})=>e))),n=e.filter((e=>!e.valid)).map((({name:e})=>e)),s=this.getValues();if(this.validateContingencyConstraints(s,{includeIncompleteViolations:!0}).length>0)for(const[i,o]of this.contingencyConstraintViolations.entries())"error"===o.type&&(t.delete(i),n.push(i));this.notifyChange("submittable"),this.notifyChange("valid"),this.emit("submit",{valid:[...t],invalid:n,values:s})}validateContingencyConstraints(e,t){const{_contingentValuesCache:n}=this,s=new Map;if(this.contingencyConstraintViolations=s,null==n)return[];const{invalid:i,incomplete:o}=n.validateContingencyConstraints(e),r=[...i,...t?.includeIncompleteViolations?o:[]];for(const a of r)for(const e of a.fieldGroup.fields)s.set(e,a);return r}notifyFeatureGeometryChanged(){const{_expressionsManager:e,feature:t,_featureClone:n}=this;t&&(n.geometry=t.geometry,null!=e&&this._updatingHandles.addPromise(e.evaluateInvalidatedByGeometry().finally((()=>this._afterExpressionsEvaluated()))))}applySubtypeDefaults(e){const{defaultValues:t}=e,{allFieldInputs:n}=this;for(const{name:s}of n){const e=t[s];null!=e&&this.setValue(s,e)}}_emitChangeEvent({name:e,valid:t,value:n}){this.emit("value-change",{layer:this.layer,feature:this.feature,fieldName:e,value:n,valid:t})}async _updateInputs(){this._stopExpressions();const{_featureClone:e,_initialFeature:t,arcadeEditType:n,formTemplate:s,inputs:i,layer:o,timeZone:r}=this;if(!o)return;const a={arcadeEditType:n,feature:e,initialFeature:t,layer:o,timeZone:r},l=i.slice(),u=s?.elements&&s.elements.length>0?await this._updateInputsUsingFormElements(l,s.elements,a):this._updateInputsUsingLayerFields(l,o?.fields,a);this.inputs=u,await this._startExpressions()}async _updateInputsUsingFormElements(e,t,n){const s=new Map;for(const r of e)if(A(r)){s.set(r.element,r);for(const e of r.inputs)e.element&&s.set(e.element,e)}else r.element&&s.set(r.element,r);const i=new Map,o=await this._updateInputsUsingFormElementsRecursive({existingInputsByElement:s,updatedElements:t.filter(Y),sharedInitializationProperties:n,group:null,newExpressionExecutorPromises:i});for(const[r,a]of s.entries())s.delete(r),a.destroy();return await Promise.all(Array.from(i.values())),o}async _updateInputsUsingFormElementsRecursive(e){const{existingInputsByElement:t,updatedElements:n,sharedInitializationProperties:s,group:i,newExpressionExecutorPromises:o}=e,r=[];for(const a of n){const e=t.has(a),n=e?t.get(a):this._makeInputFromElement(a,s,i);if(n){if(r.push(n),await l((()=>!n.updating)),this._assignExpressionExecutors(n,a,o),e)if(t.delete(a),A(n)){const{feature:e,timeZone:t}=s;n.set({feature:e,timeZone:t})}else if(M(n)){const e=this.relationshipId===a.relationshipId;n.set(s),n.set({map:this.map,showAllEnabled:e})}else m(n)?(n.set(s),n.set({map:this.map})):n.set(s);if(g(a)){const e=a.elements.filter((e=>Y(e)));n.inputs=await this._updateInputsUsingFormElementsRecursive({existingInputsByElement:t,updatedElements:e,sharedInitializationProperties:s,group:n,newExpressionExecutorPromises:o})}}}return r}_updateInputsUsingLayerFields(e,t,n){if(!Array.isArray(t))return K().warn(this.declaredClass,"No attribute fields found."),[];const s=new Map;for(const o of e)if(A(o)){for(const e of o.inputs)e.destroy();o.inputs.length=0,o.destroy()}else M(o)?o.destroy():N(o)&&(null!==o.element?o.destroy():s.set(o.field,o));const i=[];for(const o of t){const e=n.feature?.getAttribute(o.name)??null,t=s.get(o)??new S({field:o,preservesValueWhenHidden:this.formTemplate?.preserveFieldValuesWhenHidden});i.push(t.set({...n,value:e})),s.delete(o)}for(const[o,r]of s.entries())s.delete(o),r.destroy();return i}_resetFieldInputValues(e){for(const t of this.allFieldInputs)t.value=e.getAttribute(t.name)}_makeInputFromElement(e,t,s){return g(e)?Q(e,t):y(e)?this._makeFieldInputFromElement(e,t,s):_(e)?this._makeRelationshipInputFromElement(e,t,s):m(e)?this._makeUtilityNetworkAssociationInputFromElement(e,t,s):v(e)?X(e,t):m(e)?this._makeUtilityNetworkAssociationInputFromElement(e,t,s):n()}_makeFieldInputFromElement(e,t,n){const{arcadeEditType:s,feature:i,initialFeature:o,layer:r,timeZone:a}=t,{fieldName:l}=e,u=l&&this._layerFieldsByName.get(l);return u?new S({arcadeEditType:s,element:e,field:u,value:i?.getAttribute(e.fieldName)??null,feature:i,initialFeature:o,layer:r,group:n,preservesValueWhenHidden:this.formTemplate?.preserveFieldValuesWhenHidden,timeZone:a}):null}_makeRelationshipInputFromElement(e,t,n=null){const{map:s}=this,{feature:i,layer:o,timeZone:r}=t,a=new Z({element:e,feature:i,group:n,layer:o,map:s,timeZone:r});return a.addHandles(u((()=>a.relatedLayer),"edits",(()=>this._expressionsManager?.evaluateAsyncExpressions()))),a}_makeUtilityNetworkAssociationInputFromElement(e,t,n=null){const{map:s}=this,{feature:i,layer:o,timeZone:r}=t;return new O({element:e,feature:i,group:n,layer:o,map:s,timeZone:r})}_assignExpressionExecutors(e,t,n){const s=$[t.type],i=[];for(const o of s){const s=`${o}Executor`;if(e[s]){this._useExecutor(e[s]);continue}const r=t[o];if(null!=r&&""!==r){const t=this._expressionInfosLookup.get(r)?.expression??r;i.push(this._getOrCreateExecutorForExpression(t,n).then((t=>{e[s]=this._useExecutor(t)})))}}return k(e)&&i.push(...this._assignTextElementExpressionExecutors(e,n)),i}_assignTextElementExpressionExecutors(e,t){const{_expressionInfosLookup:n}=this,s=[];for(const o of e.expressionsUsed){const r=n.get(o);null!=r?s.push(this._getOrCreateExecutorForExpression(r.expression,t).then((t=>e.setExpressionExecutor(o,this._useExecutor(t))))):i.getLogger(this).error("feature-form:expression-not-found",`Could not find expressionInfo object with name '${o}'`)}for(const i of e.fieldsUsed){const n=`return $feature['${i}'];`;s.push(this._getOrCreateExecutorForExpression(n,t).then((t=>e.setFieldExecutor(i,this._useExecutor(t)))))}return s}async _getOrCreateExecutorForExpression(e,t){const{_expressionExecutorLookup:n}=this;if(n.has(e))return n.get(e);if(t.has(e))return t.get(e);const s=W(e,this.layer);t.set(e,s);const i=await s;return n.set(e,i),i}_createExpressionsManager(e){const{_arcadeContextInfo:t,_featureClone:n,allFieldInputs:s,formTemplate:i}=this;this._expressionsManager=new H({executors:e,feature:n,arcadeContextInfo:t,fieldInputs:s,preserveFieldValuesWhenHidden:!0===i?.preserveFieldValuesWhenHidden})}async _startExpressions(){if(0===this._expressionExecutorsInUse.size)return;const e=Array.from(this._expressionExecutorsInUse);this._createExpressionsManager(e),await this._expressionsManager.evaluateAll().finally((()=>this._afterExpressionsEvaluated()))}_stopExpressions(){this._expressionsManager=o(this._expressionsManager),this._expressionExecutorsInUse.clear()}_useExecutor(e){return this._expressionExecutorsInUse.add(e),e}_afterValueChange(e){const{name:t,value:n}=e,{_featureClone:s,formTemplate:i,layer:o}=this;if(!o)return;const r=s.getAttribute(t);s.setAttribute(t,n);const{typeFieldName:a,types:l}=L(o);if((e.isSubtypeField||t===a)&&n!==r){if("subtype-sublayer"===o.type){const e=o.parent?.findSublayerForFeature(s);this.feature&&(this.feature.sourceLayer=e),s.sourceLayer=e}const e=new Set;for(const t of l)if(t.domains&&"object"==typeof t.domains)for(const n of Object.keys(t.domains))e.add(n);for(const t of e){const e=this.findField(t);e&&e.notifyChange("domain")}this.notifyChange("joinedContingentValues")}if(null!=i){const{description:e,title:n}=i;n&&p(n,t)&&this.notifyChange("formTitle"),e&&p(e,t)&&this.notifyChange("formDescription")}this._emitChangeEvent(e)}_afterExpressionsEvaluated(){const{_featureClone:e}=this;for(const t of this.allFieldInputs)t.value!==e.getAttribute(t.name)&&this._afterValueChange(t)}_joinContingentValues(){const e=this._contingentValuesCache;if(null==e)return[];const{typeFieldName:t}=L(this.layer),n=t?this.getValue(t):null,s=[];for(const r of e.fieldGroups){const{contingencies:e,fields:t,name:i}=r,o=[];for(const s of e)s.isRetired||null!=s.subtype&&s.subtype.code!==n||o.push({values:s.values});o.length>0&&s.push({name:i,fields:t,contingencies:o})}const[i,o]=this._generateJoinPlan(s);return[...i.flatMap((e=>this._joinFieldGroupContingencies(e))),...o.flatMap((e=>e.contingencies))]}_generateJoinPlan(e){const t=new Map,n=[],s=new Set;for(const l of e)for(const e of l.fields)if(t.has(e)){const i=t.get(e),o=l,r=[i.name,o.name].sort().join("|");if(s.has(r))continue;n.push([i,o]),s.add(r),t.set(e,o)}else t.set(e,l);const i=new Set(n.flat()),o=new Set(e);for(const l of i)o.delete(l);const r=new Map,a=new Map;for(const l of new Set(n.flat())){const e=Symbol(l.name);r.set(e,new Set([l])),a.set(l,e)}for(const[l,u]of n){const e=a.get(l),t=a.get(u);if(e===t)continue;const n=r.get(e),s=r.get(t);for(const i of s)n.add(i),a.set(i,e);r.delete(t)}return[[...r.values()].map((e=>[...e])),[...o]]}_joinFieldGroupContingencies(e){const t=e.slice(),n=t.shift();let s=t.shift(),i=this._generateJoinKey(n.fields,s.fields),o=new Set([...n.fields,...s.fields]),r=new Map;for(const l of n.contingencies){const[e]=this._hashContingency(l,i.codedValueFields,!0);r.has(e)?r.get(e)?.push(l):r.set(e,[l])}for(;t.length>0;){const e=new Map,n=t.shift(),a=this._generateJoinKey(o,n.fields);for(const t of s.contingencies){const[n,s]=this._hashContingency(t,i.codedValueFields),o=s?this._findMatchingContingenciesWithAnyHashMask(r,n):r.get(n);if(r.has(z)&&o?.push(...this._findMatchingContingenciesContainingAny(t,r.get(z),i.codedValueFields)),null!=o)for(const r of o){const n=i.rangeFields.length>0?this._joinContingenciesWithRangeDomains(r,t,i.rangeFields):this._joinContingencies(r,t);if(null==n)break;const[s]=this._hashContingency(n,a.codedValueFields,!0);e.has(s)?e.get(s)?.push(n):e.set(s,[n])}}r=e,s=n,i=a,o=new Set([...o,...s.fields])}const a=[];for(const l of s.contingencies){const[e,t]=this._hashContingency(l,i.codedValueFields),n=t?this._findMatchingContingenciesWithAnyHashMask(r,e):r.get(e);if(r.has(z)&&n.push(...this._findMatchingContingenciesContainingAny(l,r.get(z),i.codedValueFields)),null!=n)for(const s of n){const e=i.rangeFields.length>0?this._joinContingenciesWithRangeDomains(s,l,i.rangeFields):this._joinContingencies(s,l);null!=e&&a.push(e)}}return a}_joinContingencies(e,t){const n={values:{...e.values,...t.values}};for(const[s,i]of Object.entries(n.values))"any"===i.objectType&&null!=e.values[s]&&(n.values[s]=e.values[s]);return n}_joinContingenciesWithRangeDomains(e,t,n){const s=this._joinContingencies(e,t);for(const i of n){const n=e.values[i],o=t.values[i],{leftIsNull:r,rightIsNull:a,bothAreNull:l,leftIsAny:u,rightIsAny:p,bothAreAny:c,leftIsRange:d,rightIsRange:h}=this._compareObjectTypes(n.objectType,o.objectType);if(l||c)continue;if(r&&p||a&&u){s.values[i]=new I({objectType:"null"});continue}if(r&&h||a&&d)return null;u?(n.minValue=-1/0,n.maxValue=1/0):p&&(o.minValue=-1/0,o.maxValue=1/0);const f=Math.max(n.minValue,o.minValue),m=Math.min(n.maxValue,o.maxValue);if(f>m)return null;s.values[i]=new I({objectType:"range",minValue:f,maxValue:m})}return s}_findMatchingContingenciesContainingAny(e,t,n){return t.filter((t=>n.every((n=>{const s=t.values[n],i=e.values[n];return"any"===s.objectType||"any"===i.objectType||s.codedValue?.code===i.codedValue?.code}))))}_findMatchingContingenciesWithAnyHashMask(e,t){const n=RegExp(`${t}$`),s=[];for(const[i,o]of e){if(i===z)break;n.test(i)&&s.push(...o)}return s}_generateJoinKey(e,t){const n=Array.isArray(e)?new Set(e):e,s=Array.isArray(t)?new Set(t):t,i=n.size<s.size?n:s,o=i===n?s:n,{feature:r}=this,a=new Set,l=new Set;for(const u of i)if(o.has(u)){const e=this.layer?.getFieldDomain(u,{feature:r??void 0,excludeImpliedDomains:!0});if(null==e)continue;switch(e.type){case"coded-value":a.add(u);break;case"range":l.add(u)}}return{codedValueFields:[...a],rangeFields:[...l]}}_contingencyIsValid(e,t){const n={};for(const{name:s,value:i}of this.allFieldInputs)this.fieldsWithContingentValues.has(s)&&null!=i&&s!==e&&(n[s]=i);return Object.entries(n).every((([e,n])=>!t.values.hasOwnProperty(e)||R(n,t.values[e])))}_getContingentValueOptionsForField(e,t){const n=this.joinedContingentValues.slice(),s=new Map,i={code:"",name:t??"No value"};for(const o of n){const t=o.values[e];if("code"===t?.objectType||"null"===t?.objectType){const{code:n,name:r}=t.codedValue&&"null"!==t.objectType?t.codedValue:i;!s.has(n)&&this._contingencyIsValid(e,o)&&s.set(n,{name:r,value:n})}}return[...s.values()]}_hashContingency(e,t,n=!1){if(t.length<1)return[D,!1];const s=[];let i=!1;for(const o of t){const t=e.values[o];if("any"===t.objectType){if(n)return[z,!0];i=!0,s.push(`${o}:.*`)}else"null"===t.objectType?s.push(`${o}:${J}`):s.push(`${o}:${t.codedValue?.code}`)}return[s.sort().join("&"),i]}_compareObjectTypes(e,t){return{leftIsNull:"null"===e,rightIsNull:"null"===t,bothAreNull:"null"===e&&"null"===t,leftIsAny:"any"===e,rightIsAny:"any"===t,bothAreAny:"any"===e&&"any"===t,leftIsRange:"range"===e,rightIsRange:"range"===t}}get test(){return{featureClone:this._featureClone}}};function Y(e){return"field"===e.type||"group"===e.type||"relationship"===e.type||"text"===e.type||"utilityNetworkAssociations"===e.type||(K().warn("form-info::unsupported-element-type","Only element types 'field', 'group' and 'relationship' are supported",`Element ${e.label} has unsupported type '${e.type}'`),!1)}function Q(e,t){const{feature:n,layer:s}=t;return new U({element:e,inputs:[],feature:n,layer:s})}function X(e,t,n=null){const{feature:s,layer:i,timeZone:o}=t;return new P({element:e,feature:s,group:n,layer:i,timeZone:o})}e([c()],q.prototype,"_expressionInfosLookup",null),e([c()],q.prototype,"_featureClone",void 0),e([c()],q.prototype,"_timeZone",void 0),e([c()],q.prototype,"activeAssociation",void 0),e([c()],q.prototype,"activeAssociationInput",null),e([c()],q.prototype,"activeRelationshipInput",null),e([c()],q.prototype,"_arcadeContextInfo",null),e([c()],q.prototype,"associationId",null),e([c()],q.prototype,"associatedLayer",null),e([c()],q.prototype,"allAssociationInputs",null),e([c()],q.prototype,"allFieldInputs",null),e([c()],q.prototype,"allGroupInputs",null),e([c()],q.prototype,"allRelationshipInputs",null),e([c()],q.prototype,"_layerFieldsByName",null),e([c()],q.prototype,"arcadeEditType",void 0),e([c()],q.prototype,"contingencyConstraintViolations",void 0),e([c()],q.prototype,"disabled",void 0),e([c()],q.prototype,"feature",null),e([c()],q.prototype,"fieldsWithContingentValues",null),e([c({type:f})],q.prototype,"formTemplate",null),e([c()],q.prototype,"formDescription",null),e([c()],q.prototype,"formTitle",null),e([c()],q.prototype,"formHeaderVisible",null),e([c()],q.prototype,"highlightHelper",void 0),e([c()],q.prototype,"inputs",void 0),e([c()],q.prototype,"joinedContingentValues",null),e([c()],q.prototype,"layer",null),e([c()],q.prototype,"map",void 0),e([c()],q.prototype,"callbacks",void 0),e([c()],q.prototype,"relationshipId",null),e([c()],q.prototype,"spatialReference",null),e([c()],q.prototype,"state",null),e([c()],q.prototype,"strict",void 0),e([c()],q.prototype,"submittable",null),e([c()],q.prototype,"timeZone",null),e([c()],q.prototype,"updating",null),e([c()],q.prototype,"valid",null),e([c()],q.prototype,"pendingSubtypeChoice",void 0),e([c()],q.prototype,"getValues",null),e([c()],q.prototype,"submit",null),e([c()],q.prototype,"test",null),q=e([d(B)],q);const ee=q;export{ee as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.32/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../core/Error.js";import{watch as i,sync as l}from"../../core/reactiveUtils.js";import{property as n}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as r}from"../../core/accessorSupport/decorators/subclass.js";import{getDomainRange as s,dateTimeFieldValuesToNumericRange as u,validateDomainValue as a}from"../../layers/support/domainUtils.js";import{isFieldVisibleByDefault as o,getLowerCaseEditTrackingFields as p,isNumericField as d,isStringField as m,isTimeOnlyField as h,getFieldRange as f}from"../../layers/support/fieldUtils.js";import{isAnyDateField as y}from"../../smartMapping/support/utils.js";import{isNumber as c}from"../../support/guards.js";import{isRelatableFeatureSupportedLayer as g}from"../Feature/support/featureUtils.js";import x from"./EditableInput.js";import{isFieldElementWithInputType as v,valueIsInvalidSwitchValue as E,isFieldElementWithShowNoValueOptionInput as b}from"./featureFormUtils.js";import{timeResolutionToStepMap as _,isArcadeDate as V,arcadeDateToFieldValue as w}from"../support/dateUtils.js";import{dateIsValid as T,FieldInputDataTypes as F,getMaxLength as D,getMinLength as L,validateFormValue as j}from"../support/forms/formUtils.js";let M=class extends x{constructor(e){super(e),this._storedValue=null,this.error=null,this.preservesValueWhenHidden=!0,this.field=null,this.group=null,this.requiredExpressionExecutor=null,this.type="field",this._fieldInputWasVisibleDuringLifetime=!1,this.valueExpressionExecutor=null}initialize(){this.addHandles(i((()=>this.feature),(()=>this._fieldInputWasVisibleDuringLifetime=!1),l))}get _dateFormRange(){const{element:e,field:t}=this;if("date"!==this.dataType)return{};const i=e?.domain?s(t,e.domain):null;if(!e?.input)return i??{};const l=e.input,{type:n}=l;let r={};if("date-picker"!==n&&"time-picker"!==n&&"datetimeoffset-picker"!==n||(r=u(t,l.max,l.min)),"datetime-picker"===n){const{max:e,min:t}=l;r={max:null!=e&&T(e)?e.getTime():null,min:null!=t&&T(t)?t.getTime():null}}const{max:a,min:o}=r;if(i){const{max:e,min:t}=i,l=c(e)&&(null==a||null!=a&&e<a),n=c(t)&&(null==o||null!=o&&t>o);return{max:l?e:a??null,min:n?t:o??null,rawMax:l?i.rawMax:r?.rawMax??null,rawMin:n?i.rawMin:r?.rawMin??null}}return{min:o,max:a,rawMax:r?.rawMax??null,rawMin:r?.rawMin??null}}get _dateRange(){const{_dateFormRange:e,field:t}=this;if("date"!==this.dataType)return{};const i=s(t);if(!i)return e;const{max:l,min:n,rawMax:r,rawMin:u}=e;if("date"===t.type){const{max:e,min:t}=i;return{max:c(l)&&(null===e||null!=e&&l<e)?l:e??null,min:c(n)&&(null===t||null!=t&&n>t)?n:t??null}}if("date-only"===t.type||"time-only"===t.type||"timestamp-offset"===t.type){const{max:e,min:t,rawMax:s,rawMin:a}=i,o=c(l)&&r&&(null==e||l<e);return{max:o?l:e,min:c(n)&&u&&(null==t||n>t)?n:t,rawMax:o?r:s,rawMin:o?u:a}}return{max:null,min:null}}get _configAllowsEdits(){const{element:e,layer:t,name:i}=this;if(null!=e)return e.editableExpression?!!this.evaluatedEditableExpression:!1!==e.editable;if(t?.userHasUpdateItemPrivileges)return!0;const l=t&&"popupTemplate"in t?t?.popupTemplate?.fieldInfos?.find((({fieldName:e})=>e===i)):null;return l?.isEditable??!0}get _layerAndFieldAllowEdits(){return this.layerAllowsEdits&&this.field?.editable}get _isVisibleByDefault(){const{field:e,layer:t}=this;return!!e?.visible&&o(e,t)}get _isEditTrackingField(){return p(this.layer).includes(this.name?.toLowerCase())}get _shouldUseValueExpression(){return this._layerAndFieldAllowEdits&&!this._configAllowsEdits&&null!=this.valueExpressionExecutor&&this.valueExpressionExecutor.initialExecutionComplete}get isSubtypeField(){const{layer:e}=this;if(e&&"subtypeField"in e){const{subtypeField:t,fieldsIndex:i}=e;return(i.get(t)?.name??t)===this.name}return!1}get valueIsOutOfDomain(){const{domain:e,value:t,field:i}=this;return!(!e||null==t)&&null!==a(i,t,e)}get dataType(){const{field:e}=this;return d(e)?F.Number:m(e)?F.Text:y(e)||h(e)?F.Date:F.Unsupported}get dateDataType(){if(this.dataType===F.Date)return"date"!==this.field.type?"string":"number"}get domain(){const{layer:e,feature:t,name:i,element:l}=this,n=l?.domain;return null!=n&&this._isDomainCompatible(n)?n:e.getFieldDomain(i,{feature:t})}get editable(){return!!this._layerAndFieldAllowEdits&&(this.evaluatedEditableExpression??this._configAllowsEdits)}get evaluatedRequiredExpression(){const{requiredExpressionExecutor:e}=this;return null!=e?!!e.lastEvaluatedValue:null}get evaluatedValueExpression(){const{valueExpressionExecutor:e}=this;return null!=e?e.lastEvaluatedValue:null}get hint(){return this.element?.hint}get includeDate(){return!(this.dataType!==F.Date||"time-only"===this.field.type)}get includeTime(){const{element:e,field:t}=this;if(this.dataType!==F.Date)return!1;if("time-only"===t.type)return!0;if("date-only"===t.type)return!1;const i="datetime-picker"===e?.input?.type?e.input.includeTime:void 0;return void 0===i||i}get includeTimeOffset(){if("timestamp-offset"!==this.field.type)return!1;const e=this.element?.input;return!e||"datetimeoffset-picker"===e.type&&e.includeTimeOffset}set initialFeature(e){this._set("initialFeature",e),this.notifyChange("valid")}get inputType(){return this.element?.input?.type}get hasInvalidSwitchValue(){const{element:e}=this,t=v(e,"switch")?e.input:null;return!t||E(this.value,t)}get isRelationshipKeyField(){const{field:e,layer:t}=this;return g(t)&&!!t.relationships?.some((t=>t.keyField===e.name))}get label(){const{field:e}=this;return this.getFormattedLabel(this.element?.label)??e.alias??e.name}get maxLength(){return D({dataType:this.dataType,field:this.field,input:this.element?.input})}get minLength(){return L({dataType:this.dataType,field:this.field,input:this.element?.input})}get name(){return this.field?.name}get range(){const{domain:e,element:t,field:i}=this;if("date"===this.dataType)return this._dateRange;const l=s(i,e)||f(i,e),n=l?.max===Number.MAX_VALUE?null:l?.max??null,r=l?.min===-Number.MAX_VALUE?null:l?.min??null;if(!t?.domain||"range"!==t.domain.type)return{max:n,min:r};const{max:u,min:a}=s(i)||{};return{max:null!=u&&(null===n||null!=n&&u<n)?u:n,min:null!=a&&(null===r||null!=r&&a>r)?a:r}}get required(){const{editable:e,evaluatedRequiredExpression:t,field:i,visible:l,isSubtypeField:n}=this;if(!e)return!1;if(!1===i?.nullable)return!0;if(n)return!0;return!(!l||!1===this.group?.visible||null==t)&&t}set required(e){this._overrideIfSome("required",e)}get showNoValueOptionEnabled(){const{element:e}=this;return!this.required&&(!b(e)||e.input.showNoValueOption)}get showNoValueLabel(){const{element:e}=this;return b(e)?e.input.noValueOptionLabel:null}get submittable(){const{field:e,required:t,valid:i,value:l}=this;return(!t||null!=l)&&(!!i||this.initialFeature.getAttribute(e.name)===l)}get timeResolution(){const e=this.element?.input;if(e&&("datetimeoffset-picker"===e.type||"time-picker"===e.type))return e.timeResolution??"minutes"}get timeStep(){return null!=this.timeResolution?_.get(this.timeResolution):void 0}get updating(){const{editableExpressionExecutor:e,valueExpressionExecutor:t,visibilityExpressionExecutor:i,preservesValueWhenHidden:l}=this;return null!=t&&t.updating||null!=e&&e.updating||!1===l&&null!=i&&i.updating}get valid(){const e=this.editable?this._validate():null;return this._set("error",e),null===e}get value(){if(this._fieldInputWasVisibleDuringLifetime=this._fieldInputWasVisibleDuringLifetime||this.visible&&!1!==this.group?.visible,!1===this.preservesValueWhenHidden&&this._fieldInputWasVisibleDuringLifetime&&(!1===this.visibilityExpressionExecutor?.lastEvaluatedValue||!1===this.group?.visibilityExpressionExecutor?.lastEvaluatedValue))return null!==this._storedValue&&this.set("_storedValue",null),null;if(this._shouldUseValueExpression){const e=this.evaluatedValueExpression;return this.dataType===F.Date?this._arcadeOutputToDateFieldValue(e):null!=e&&"object"==typeof e?`${e}`:e}return this._storedValue}set value(e){this.notifyChange("evaluatedVisibilityExpression"),this.set("_storedValue",e)}get visible(){return!this._isEditTrackingField&&(null!=this.evaluatedVisibilityExpression?this.evaluatedVisibilityExpression:null!=this.element&&!1!==this.field?.visible||this._isVisibleByDefault)}_arcadeOutputToDateFieldValue(e){const i=this.field.type;try{if("object"==typeof e){if(null===e)throw new t("feature-form:invalid-date-value");if(V(e))return w(e,i);if("getTime"in e&&"function"==typeof e.getTime&&"date"===i)return parseInt(e.getTime(),10);if("date-only"===i||"time-only"===i||"timestamp-offset"===i)return e.toString()}else{if("string"==typeof e)return"date"===i?parseInt(e,10):e;if("number"==typeof e&&"date"===i)return e}throw new t("feature-form:invalid-date-value")}catch{return"date"===i?NaN:""}}_isDomainCompatible(e){const{field:t}=this;if("coded-value"===e?.type){const i=typeof e.codedValues[0].code;if("string"===i&&m(t)||"number"===i&&d(t))return!0}return!!("range"===e?.type&&d(t)||y(t)||h(t))}_validate(){const{dataType:e,domain:t,field:i,minLength:l,range:n,required:r,value:s,maxLength:u}=this;return j(s,{dataType:e,domain:t,field:i,maxLength:u,minLength:l,range:n,required:r})}};e([n()],M.prototype,"_dateFormRange",null),e([n()],M.prototype,"_dateRange",null),e([n()],M.prototype,"_storedValue",void 0),e([n()],M.prototype,"_configAllowsEdits",null),e([n()],M.prototype,"_layerAndFieldAllowEdits",null),e([n()],M.prototype,"_isVisibleByDefault",null),e([n()],M.prototype,"_isEditTrackingField",null),e([n()],M.prototype,"_shouldUseValueExpression",null),e([n()],M.prototype,"isSubtypeField",null),e([n()],M.prototype,"valueIsOutOfDomain",null),e([n()],M.prototype,"dataType",null),e([n()],M.prototype,"dateDataType",null),e([n()],M.prototype,"domain",null),e([n()],M.prototype,"editable",null),e([n({readOnly:!0})],M.prototype,"error",void 0),e([n({constructOnly:!0})],M.prototype,"preservesValueWhenHidden",void 0),e([n()],M.prototype,"evaluatedRequiredExpression",null),e([n()],M.prototype,"evaluatedValueExpression",null),e([n()],M.prototype,"field",void 0),e([n()],M.prototype,"group",void 0),e([n({readOnly:!0})],M.prototype,"hint",null),e([n()],M.prototype,"includeDate",null),e([n()],M.prototype,"includeTime",null),e([n()],M.prototype,"includeTimeOffset",null),e([n()],M.prototype,"initialFeature",null),e([n({readOnly:!0})],M.prototype,"inputType",null),e([n()],M.prototype,"hasInvalidSwitchValue",null),e([n()],M.prototype,"isRelationshipKeyField",null),e([n()],M.prototype,"label",null),e([n()],M.prototype,"maxLength",null),e([n()],M.prototype,"minLength",null),e([n({readOnly:!0})],M.prototype,"name",null),e([n()],M.prototype,"range",null),e([n()],M.prototype,"required",null),e([n()],M.prototype,"requiredExpressionExecutor",void 0),e([n()],M.prototype,"showNoValueOptionEnabled",null),e([n()],M.prototype,"submittable",null),e([n()],M.prototype,"timeResolution",null),e([n()],M.prototype,"timeStep",null),e([n({readOnly:!0})],M.prototype,"type",void 0),e([n()],M.prototype,"updating",null),e([n()],M.prototype,"valid",null),e([n({value:null})],M.prototype,"value",null),e([n()],M.prototype,"valueExpressionExecutor",void 0),e([n()],M.prototype,"visible",null),M=e([r("esri.widgets.FeatureForm.FieldInput")],M);const O=M;export{O as default};
5
+ import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../core/Error.js";import{watch as i,sync as l}from"../../core/reactiveUtils.js";import{property as n}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as r}from"../../core/accessorSupport/decorators/subclass.js";import{getDomainRange as s,dateTimeFieldValuesToNumericRange as u,validateDomainValue as a}from"../../layers/support/domainUtils.js";import{isFieldVisibleByDefault as o,getLowerCaseEditTrackingFields as p,isNumericField as d,isStringField as m,isTimeOnlyField as h,getFieldRange as f}from"../../layers/support/fieldUtils.js";import{isAnyDateField as y}from"../../smartMapping/support/utils.js";import{isNumber as c}from"../../support/guards.js";import{isRelatableFeatureSupportedLayer as g}from"../Feature/support/featureUtils.js";import x from"./EditableInput.js";import{isFieldElementWithInputType as v,valueIsInvalidSwitchValue as E,isFieldElementWithShowNoValueOptionInput as b}from"./featureFormUtils.js";import{timeResolutionToStepMap as _,isArcadeDate as V,arcadeDateToFieldValue as w}from"../support/dateUtils.js";import{dateIsValid as T,FieldInputDataTypes as F,getMaxLength as D,getMinLength as L,validateFormValue as j}from"../support/forms/formUtils.js";let M=class extends x{constructor(e){super(e),this._storedValue=null,this.error=null,this.preservesValueWhenHidden=!0,this.field=null,this.group=null,this.requiredExpressionExecutor=null,this.type="field",this._fieldInputWasVisibleDuringLifetime=!1,this.valueExpressionExecutor=null}initialize(){this.addHandles(i((()=>this.feature),(()=>this._fieldInputWasVisibleDuringLifetime=!1),l))}get _dateFormRange(){const{element:e,field:t}=this;if("date"!==this.dataType)return{};const i=e?.domain?s(t,e.domain):null;if(!e?.input)return i??{};const l=e.input,{type:n}=l;let r={};if("date-picker"!==n&&"time-picker"!==n&&"datetimeoffset-picker"!==n||(r=u(t,l.max,l.min)),"datetime-picker"===n){const{max:e,min:t}=l;r={max:null!=e&&T(e)?e.getTime():null,min:null!=t&&T(t)?t.getTime():null}}const{max:a,min:o}=r;if(i){const{max:e,min:t}=i,l=c(e)&&(null==a||null!=a&&e<a),n=c(t)&&(null==o||null!=o&&t>o);return{max:l?e:a??null,min:n?t:o??null,rawMax:l?i.rawMax:r?.rawMax??null,rawMin:n?i.rawMin:r?.rawMin??null}}return{min:o,max:a,rawMax:r?.rawMax??null,rawMin:r?.rawMin??null}}get _dateRange(){const{_dateFormRange:e,field:t}=this;if("date"!==this.dataType)return{};const i=s(t);if(!i)return e;const{max:l,min:n,rawMax:r,rawMin:u}=e;if("date"===t.type){const{max:e,min:t}=i;return{max:c(l)&&(null===e||null!=e&&l<e)?l:e??null,min:c(n)&&(null===t||null!=t&&n>t)?n:t??null}}if("date-only"===t.type||"time-only"===t.type||"timestamp-offset"===t.type){const{max:e,min:t,rawMax:s,rawMin:a}=i,o=c(l)&&r&&(null==e||l<e),p=c(n)&&u&&(null==t||n>t);return{max:o?l:e,min:p?n:t,rawMax:o?r:s,rawMin:p?u:a}}return{max:null,min:null}}get _configAllowsEdits(){const{element:e,layer:t,name:i}=this;if(null!=e)return e.editableExpression?!!this.evaluatedEditableExpression:!1!==e.editable;if(t?.userHasUpdateItemPrivileges)return!0;const l=t&&"popupTemplate"in t?t?.popupTemplate?.fieldInfos?.find((({fieldName:e})=>e===i)):null;return l?.isEditable??!0}get _layerAndFieldAllowEdits(){return this.layerAllowsEdits&&this.field?.editable}get _isVisibleByDefault(){const{field:e,layer:t}=this;return!!e?.visible&&o(e,t)}get _isEditTrackingField(){return p(this.layer).includes(this.name?.toLowerCase())}get _shouldUseValueExpression(){return this._layerAndFieldAllowEdits&&!this._configAllowsEdits&&null!=this.valueExpressionExecutor&&this.valueExpressionExecutor.initialExecutionComplete}get isSubtypeField(){const{layer:e}=this;if(e&&"subtypeField"in e){const{subtypeField:t,fieldsIndex:i}=e;return(i.get(t)?.name??t)===this.name}return!1}get valueIsOutOfDomain(){const{domain:e,value:t,field:i}=this;return!(!e||null==t)&&null!==a(i,t,e)}get dataType(){const{field:e}=this;return d(e)?F.Number:m(e)?F.Text:y(e)||h(e)?F.Date:F.Unsupported}get dateDataType(){if(this.dataType===F.Date)return"date"!==this.field.type?"string":"number"}get domain(){const{layer:e,feature:t,name:i,element:l}=this,n=l?.domain;return null!=n&&this._isDomainCompatible(n)?n:e.getFieldDomain(i,{feature:t})}get editable(){return!!this._layerAndFieldAllowEdits&&(this.evaluatedEditableExpression??this._configAllowsEdits)}get evaluatedRequiredExpression(){const{requiredExpressionExecutor:e}=this;return null!=e?!!e.lastEvaluatedValue:null}get evaluatedValueExpression(){const{valueExpressionExecutor:e}=this;return null!=e?e.lastEvaluatedValue:null}get hint(){return this.element?.hint}get includeDate(){return!(this.dataType!==F.Date||"time-only"===this.field.type)}get includeTime(){const{element:e,field:t}=this;if(this.dataType!==F.Date)return!1;if("time-only"===t.type)return!0;if("date-only"===t.type)return!1;const i="datetime-picker"===e?.input?.type?e.input.includeTime:void 0;return void 0===i||i}get includeTimeOffset(){if("timestamp-offset"!==this.field.type)return!1;const e=this.element?.input;return!e||"datetimeoffset-picker"===e.type&&e.includeTimeOffset}set initialFeature(e){this._set("initialFeature",e),this.notifyChange("valid")}get inputType(){return this.element?.input?.type}get hasInvalidSwitchValue(){const{element:e}=this,t=v(e,"switch")?e.input:null;return!t||E(this.value,t)}get isRelationshipKeyField(){const{field:e,layer:t}=this;return g(t)&&!!t.relationships?.some((t=>t.keyField===e.name))}get label(){const{field:e}=this;return this.getFormattedLabel(this.element?.label)??e.alias??e.name}get maxLength(){return D({dataType:this.dataType,field:this.field,input:this.element?.input})}get minLength(){return L({dataType:this.dataType,field:this.field,input:this.element?.input})}get name(){return this.field?.name}get range(){const{domain:e,element:t,field:i}=this;if("date"===this.dataType)return this._dateRange;const l=s(i,e)||f(i,e),n=l?.max===Number.MAX_VALUE?null:l?.max??null,r=l?.min===-Number.MAX_VALUE?null:l?.min??null;if(!t?.domain||"range"!==t.domain.type)return{max:n,min:r};const{max:u,min:a}=s(i)||{};return{max:null!=u&&(null===n||null!=n&&u<n)?u:n,min:null!=a&&(null===r||null!=r&&a>r)?a:r}}get required(){const{editable:e,evaluatedRequiredExpression:t,field:i,visible:l,isSubtypeField:n}=this;if(!e)return!1;if(!1===i?.nullable)return!0;if(n)return!0;return!(!l||!1===this.group?.visible||null==t)&&t}set required(e){this._overrideIfSome("required",e)}get showNoValueOptionEnabled(){const{element:e}=this;return!this.required&&(!b(e)||e.input.showNoValueOption)}get showNoValueLabel(){const{element:e}=this;return b(e)?e.input.noValueOptionLabel:null}get submittable(){const{field:e,required:t,valid:i,value:l}=this;return(!t||null!=l)&&(!!i||this.initialFeature.getAttribute(e.name)===l)}get timeResolution(){const e=this.element?.input;if(e&&("datetimeoffset-picker"===e.type||"time-picker"===e.type))return e.timeResolution??"minutes"}get timeStep(){return null!=this.timeResolution?_.get(this.timeResolution):void 0}get updating(){const{editableExpressionExecutor:e,valueExpressionExecutor:t,visibilityExpressionExecutor:i,preservesValueWhenHidden:l}=this;return null!=t&&t.updating||null!=e&&e.updating||!1===l&&null!=i&&i.updating}get valid(){const e=this.editable?this._validate():null;return this._set("error",e),null===e}get value(){if(this._fieldInputWasVisibleDuringLifetime=this._fieldInputWasVisibleDuringLifetime||this.visible&&!1!==this.group?.visible,!1===this.preservesValueWhenHidden&&this._fieldInputWasVisibleDuringLifetime&&(!1===this.visibilityExpressionExecutor?.lastEvaluatedValue||!1===this.group?.visibilityExpressionExecutor?.lastEvaluatedValue))return null!==this._storedValue&&this.set("_storedValue",null),null;if(this._shouldUseValueExpression){const e=this.evaluatedValueExpression;return this.dataType===F.Date?this._arcadeOutputToDateFieldValue(e):null!=e&&"object"==typeof e?`${e}`:e}return this._storedValue}set value(e){this.notifyChange("evaluatedVisibilityExpression"),this.set("_storedValue",e),this.notifyChange("value"),this.notifyChange("valid")}get visible(){return!this._isEditTrackingField&&(null!=this.evaluatedVisibilityExpression?this.evaluatedVisibilityExpression:null!=this.element&&!1!==this.field?.visible||this._isVisibleByDefault)}_arcadeOutputToDateFieldValue(e){const i=this.field.type;try{if("object"==typeof e){if(null===e)throw new t("feature-form:invalid-date-value");if(V(e))return w(e,i);if("getTime"in e&&"function"==typeof e.getTime&&"date"===i)return parseInt(e.getTime(),10);if("date-only"===i||"time-only"===i||"timestamp-offset"===i)return e.toString()}else{if("string"==typeof e)return"date"===i?parseInt(e,10):e;if("number"==typeof e&&"date"===i)return e}throw new t("feature-form:invalid-date-value")}catch{return"date"===i?NaN:""}}_isDomainCompatible(e){const{field:t}=this;if("coded-value"===e?.type){const i=typeof e.codedValues[0].code;if("string"===i&&m(t)||"number"===i&&d(t))return!0}return!!("range"===e?.type&&d(t)||y(t)||h(t))}_validate(){const{dataType:e,domain:t,field:i,minLength:l,range:n,required:r,value:s,maxLength:u}=this;return j(s,{dataType:e,domain:t,field:i,maxLength:u,minLength:l,range:n,required:r})}};e([n()],M.prototype,"_dateFormRange",null),e([n()],M.prototype,"_dateRange",null),e([n()],M.prototype,"_storedValue",void 0),e([n()],M.prototype,"_configAllowsEdits",null),e([n()],M.prototype,"_layerAndFieldAllowEdits",null),e([n()],M.prototype,"_isVisibleByDefault",null),e([n()],M.prototype,"_isEditTrackingField",null),e([n()],M.prototype,"_shouldUseValueExpression",null),e([n()],M.prototype,"isSubtypeField",null),e([n()],M.prototype,"valueIsOutOfDomain",null),e([n()],M.prototype,"dataType",null),e([n()],M.prototype,"dateDataType",null),e([n()],M.prototype,"domain",null),e([n()],M.prototype,"editable",null),e([n({readOnly:!0})],M.prototype,"error",void 0),e([n({constructOnly:!0})],M.prototype,"preservesValueWhenHidden",void 0),e([n()],M.prototype,"evaluatedRequiredExpression",null),e([n()],M.prototype,"evaluatedValueExpression",null),e([n()],M.prototype,"field",void 0),e([n()],M.prototype,"group",void 0),e([n({readOnly:!0})],M.prototype,"hint",null),e([n()],M.prototype,"includeDate",null),e([n()],M.prototype,"includeTime",null),e([n()],M.prototype,"includeTimeOffset",null),e([n()],M.prototype,"initialFeature",null),e([n({readOnly:!0})],M.prototype,"inputType",null),e([n()],M.prototype,"hasInvalidSwitchValue",null),e([n()],M.prototype,"isRelationshipKeyField",null),e([n()],M.prototype,"label",null),e([n()],M.prototype,"maxLength",null),e([n()],M.prototype,"minLength",null),e([n({readOnly:!0})],M.prototype,"name",null),e([n()],M.prototype,"range",null),e([n()],M.prototype,"required",null),e([n()],M.prototype,"requiredExpressionExecutor",void 0),e([n()],M.prototype,"showNoValueOptionEnabled",null),e([n()],M.prototype,"submittable",null),e([n()],M.prototype,"timeResolution",null),e([n()],M.prototype,"timeStep",null),e([n({readOnly:!0})],M.prototype,"type",void 0),e([n()],M.prototype,"updating",null),e([n()],M.prototype,"valid",null),e([n({value:null})],M.prototype,"value",null),e([n()],M.prototype,"valueExpressionExecutor",void 0),e([n()],M.prototype,"visible",null),M=e([r("esri.widgets.FeatureForm.FieldInput")],M);const O=M;export{O as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.32/esri/copyright.txt for details.
4
4
  */
5
- import{_ as t}from"../../chunks/tslib.es6.js";import e from"../../core/Identifiable.js";import{ignoreAbortErrors as s}from"../../core/promiseUtils.js";import{watch as i,on as o,initial as a}from"../../core/reactiveUtils.js";import{property as r}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as n}from"../../core/accessorSupport/decorators/subclass.js";import{isAssociatedFeatureSupportedLayer as l}from"../Feature/support/featureUtils.js";import p from"./EditableInput.js";import{parseFormTemplateString as c}from"./featureFormUtils.js";import u from"../support/UtilityNetworkAssociations/UtilityNetworkAssociationsViewModel.js";let d=class extends(e.IdentifiableMixin(p)){constructor(t){super(t),this.group=null,this.type="utilityNetworkAssociations",this.addHandles([i((()=>({feature:this.feature,element:this.element,layer:this.layer})),(t=>this._createAssociationVM(t)),a),i((()=>this.associatedLayer),((t,e)=>this._updateLayerEditHandle(t,e)),a)])}destroy(){this._associationsVM?.destroy()}get activeAssociationType(){return this._associationsVM?.associationTypes.find((t=>t.open))}get associatedFeatures(){const{associatedLayer:t}=this;if(t)return this.associatedFeatureInfos.get(t)}get associatedFeatureInfos(){const{_associationsVM:t,timeZone:e}=this;if(!t?.associationFeatures?.size||!t?.utilityNetwork)return new Map;const{associationFeatures:s}=t,i=new Map;return s.forEach(((t,s)=>{const o=t.map((t=>{const i=s&&"formTemplate"in s&&s.formTemplate?s.formTemplate.title:void 0,o=i?c({label:i,attributes:t.feature.attributes,fieldsIndex:s.fieldsIndex,timeZone:e}):void 0;return{...t,title:o}}));i.set(s,o)})),i}get associatedLayer(){return this._get("associatedLayer")}set associatedLayer(t){this._associationsVM.showAllEnabled=null!=t,this._set("associatedLayer",t)}get associationsViewModel(){return this._associationsVM}get canAddAssociation(){const{editable:t,utilityNetwork:e}=this;return!(!e||!this.loaded)&&t}get editable(){return this.evaluatedEditableExpression??!0}get featureCount(){return this._associationsVM?.featureCount??0}get viewModel(){return this._associationsVM}get loaded(){return"loading"!==this._associationsVM?.state}get map(){return this._get("map")}set map(t){t&&this._associationsVM?.set("map",t),this._set("map",t)}get utilityNetwork(){return this._associationsVM?.utilityNetwork}get associationTypes(){return this._associationsVM?.associationTypes??this.element.associationTypes}get visible(){const{utilityNetwork:t}=this;return!!t&&(null!=this.evaluatedVisibilityExpression?this.evaluatedVisibilityExpression:null!=this.element)}get updating(){return"loading"===this._associationsVM?.state||"querying"===this._associationsVM?.state}async refresh(){await s(this._associationsVM.refresh())}_updateLayerEditHandle(t,e){e&&"layerId"in e&&this.removeHandles(e?.layerId),l(t)&&this.addHandles(o((()=>t),"edits",(()=>this.refresh())),t.layerId)}_createAssociationVM(t){const{feature:e,element:s,layer:i}=t;if(this._associationsVM?.destroy(),!e||!s||!i)return;const{map:o,associationTypes:a}=this;l(i)&&(this._associationsVM=new u({graphic:e,layer:i,map:o,associationTypes:a,source:"featureForm",title:this.label,description:this.description}))}};t([r()],d.prototype,"_associationsVM",void 0),t([r()],d.prototype,"activeAssociationType",null),t([r()],d.prototype,"associatedFeatures",null),t([r()],d.prototype,"associatedFeatureInfos",null),t([r()],d.prototype,"associatedLayer",null),t([r()],d.prototype,"associationsViewModel",null),t([r()],d.prototype,"canAddAssociation",null),t([r()],d.prototype,"editable",null),t([r()],d.prototype,"featureCount",null),t([r()],d.prototype,"viewModel",null),t([r()],d.prototype,"group",void 0),t([r()],d.prototype,"loaded",null),t([r()],d.prototype,"map",null),t([r()],d.prototype,"utilityNetwork",null),t([r()],d.prototype,"associationTypes",null),t([r({readOnly:!0})],d.prototype,"type",void 0),t([r()],d.prototype,"visible",null),t([r()],d.prototype,"updating",null),d=t([n("esri.widgets.FeatureForm.UtilityNetworkAssociationInput")],d);const y=d;export{y as default};
5
+ import{_ as t}from"../../chunks/tslib.es6.js";import e from"../../core/Identifiable.js";import{ignoreAbortErrors as s}from"../../core/promiseUtils.js";import{watch as i,on as o,initial as a}from"../../core/reactiveUtils.js";import{property as r}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as n}from"../../core/accessorSupport/decorators/subclass.js";import{isAssociatedFeatureSupportedLayer as l}from"../Feature/support/featureUtils.js";import p from"./EditableInput.js";import{parseFormTemplateString as c}from"./featureFormUtils.js";import u from"../support/UtilityNetworkAssociations/UtilityNetworkAssociationsViewModel.js";let d=class extends(e.IdentifiableMixin(p)){constructor(t){super(t),this.group=null,this.type="utilityNetworkAssociations",this.addHandles([i((()=>({feature:this.feature,element:this.element,layer:this.layer})),(t=>this._createAssociationVM(t)),a),i((()=>this.associatedLayer),((t,e)=>this._updateLayerEditHandle(t,e)),a)])}destroy(){this._associationsVM?.destroy()}get activeAssociationType(){return this._associationsVM?.activeAssociationType}get associatedFeatures(){const{associatedLayer:t}=this;if(t)return this.associatedFeatureInfos.get(t)}get associatedFeatureInfos(){const{_associationsVM:t,timeZone:e}=this;if(!t?.associationFeatures?.size||!t?.utilityNetwork)return new Map;const{associationFeatures:s}=t,i=new Map;return s.forEach(((t,s)=>{const o=t.map((t=>{const i=s&&"formTemplate"in s&&s.formTemplate?s.formTemplate.title:void 0,o=i?c({label:i,attributes:t.feature.attributes,fieldsIndex:s.fieldsIndex,timeZone:e}):void 0;return{...t,title:o}}));i.set(s,o)})),i}get associatedLayer(){return this._get("associatedLayer")}set associatedLayer(t){this._associationsVM.showAllEnabled=null!=t,this._set("associatedLayer",t)}get associationsViewModel(){return this._associationsVM}get canAddAssociation(){const{editable:t,utilityNetwork:e}=this;return!(!e||!this.loaded)&&t}get editable(){return this.evaluatedEditableExpression??!0}get featureCount(){return this._associationsVM?.featureCount??0}get viewModel(){return this._associationsVM}get loaded(){return"loading"!==this._associationsVM?.state}get map(){return this._get("map")}set map(t){t&&this._associationsVM?.set("map",t),this._set("map",t)}get utilityNetwork(){return this._associationsVM?.utilityNetwork}get associationTypes(){return this._associationsVM?.associationTypes??this.element.associationTypes}get visible(){const{utilityNetwork:t}=this;return!!t&&(null!=this.evaluatedVisibilityExpression?this.evaluatedVisibilityExpression:null!=this.element)}get updating(){return"loading"===this._associationsVM?.state||"querying"===this._associationsVM?.state}async refresh(){await s(this._associationsVM.refresh())}_updateLayerEditHandle(t,e){e&&"layerId"in e&&this.removeHandles(e?.layerId),l(t)&&this.addHandles(o((()=>t),"edits",(()=>this.refresh())),t.layerId)}_createAssociationVM(t){const{feature:e,element:s,layer:i}=t;if(this._associationsVM?.destroy(),!e||!s||!i)return;const{map:o,associationTypes:a}=this;l(i)&&(this._associationsVM=new u({graphic:e,layer:i,map:o,associationTypes:a,source:"featureForm",title:this.label,description:this.description}))}};t([r()],d.prototype,"_associationsVM",void 0),t([r()],d.prototype,"activeAssociationType",null),t([r()],d.prototype,"associatedFeatures",null),t([r()],d.prototype,"associatedFeatureInfos",null),t([r()],d.prototype,"associatedLayer",null),t([r()],d.prototype,"associationsViewModel",null),t([r()],d.prototype,"canAddAssociation",null),t([r()],d.prototype,"editable",null),t([r()],d.prototype,"featureCount",null),t([r()],d.prototype,"viewModel",null),t([r()],d.prototype,"group",void 0),t([r()],d.prototype,"loaded",null),t([r()],d.prototype,"map",null),t([r()],d.prototype,"utilityNetwork",null),t([r()],d.prototype,"associationTypes",null),t([r({readOnly:!0})],d.prototype,"type",void 0),t([r()],d.prototype,"visible",null),t([r()],d.prototype,"updating",null),d=t([n("esri.widgets.FeatureForm.UtilityNetworkAssociationInput")],d);const y=d;export{y as default};