@arcgis/core 4.33.0-next.20250508 → 4.33.0-next.20250510

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 (431) hide show
  1. package/applications/SceneViewer/sceneViewerUtils.d.ts +2 -0
  2. package/applications/SceneViewer/sceneViewerUtils.js +1 -1
  3. package/arcade/featureset/support/RecentlyUsedCache.js +1 -1
  4. package/arcade/functions/aiServices.js +1 -1
  5. package/arcade.js +1 -1
  6. package/assets/components/assets/input-time-picker/t9n/messages.ar.json +1 -1
  7. package/assets/components/assets/input-time-picker/t9n/messages.bg.json +1 -1
  8. package/assets/components/assets/input-time-picker/t9n/messages.bs.json +1 -1
  9. package/assets/components/assets/input-time-picker/t9n/messages.ca.json +1 -1
  10. package/assets/components/assets/input-time-picker/t9n/messages.cs.json +1 -1
  11. package/assets/components/assets/input-time-picker/t9n/messages.da.json +1 -1
  12. package/assets/components/assets/input-time-picker/t9n/messages.de.json +1 -1
  13. package/assets/components/assets/input-time-picker/t9n/messages.el.json +1 -1
  14. package/assets/components/assets/input-time-picker/t9n/messages.en.json +1 -1
  15. package/assets/components/assets/input-time-picker/t9n/messages.es.json +1 -1
  16. package/assets/components/assets/input-time-picker/t9n/messages.et.json +1 -1
  17. package/assets/components/assets/input-time-picker/t9n/messages.fi.json +1 -1
  18. package/assets/components/assets/input-time-picker/t9n/messages.fr.json +1 -1
  19. package/assets/components/assets/input-time-picker/t9n/messages.he.json +1 -1
  20. package/assets/components/assets/input-time-picker/t9n/messages.hr.json +1 -1
  21. package/assets/components/assets/input-time-picker/t9n/messages.hu.json +1 -1
  22. package/assets/components/assets/input-time-picker/t9n/messages.id.json +1 -1
  23. package/assets/components/assets/input-time-picker/t9n/messages.it.json +1 -1
  24. package/assets/components/assets/input-time-picker/t9n/messages.ja.json +1 -1
  25. package/assets/components/assets/input-time-picker/t9n/messages.json +1 -1
  26. package/assets/components/assets/input-time-picker/t9n/messages.ko.json +1 -1
  27. package/assets/components/assets/input-time-picker/t9n/messages.lt.json +1 -1
  28. package/assets/components/assets/input-time-picker/t9n/messages.lv.json +1 -1
  29. package/assets/components/assets/input-time-picker/t9n/messages.nl.json +1 -1
  30. package/assets/components/assets/input-time-picker/t9n/messages.no.json +1 -1
  31. package/assets/components/assets/input-time-picker/t9n/messages.pl.json +1 -1
  32. package/assets/components/assets/input-time-picker/t9n/messages.pt-BR.json +1 -1
  33. package/assets/components/assets/input-time-picker/t9n/messages.pt-PT.json +1 -1
  34. package/assets/components/assets/input-time-picker/t9n/messages.ro.json +1 -1
  35. package/assets/components/assets/input-time-picker/t9n/messages.ru.json +1 -1
  36. package/assets/components/assets/input-time-picker/t9n/messages.sk.json +1 -1
  37. package/assets/components/assets/input-time-picker/t9n/messages.sl.json +1 -1
  38. package/assets/components/assets/input-time-picker/t9n/messages.sr.json +1 -1
  39. package/assets/components/assets/input-time-picker/t9n/messages.sv.json +1 -1
  40. package/assets/components/assets/input-time-picker/t9n/messages.th.json +1 -1
  41. package/assets/components/assets/input-time-picker/t9n/messages.tr.json +1 -1
  42. package/assets/components/assets/input-time-picker/t9n/messages.uk.json +1 -1
  43. package/assets/components/assets/input-time-picker/t9n/messages.vi.json +1 -1
  44. package/assets/components/assets/input-time-picker/t9n/messages.zh-CN.json +1 -1
  45. package/assets/components/assets/input-time-picker/t9n/messages.zh-HK.json +1 -1
  46. package/assets/components/assets/input-time-picker/t9n/messages.zh-TW.json +1 -1
  47. package/assets/esri/core/workers/RemoteClient.js +1 -1
  48. package/assets/esri/core/workers/chunks/06eb4832b6c86744e52e.js +1 -0
  49. package/assets/esri/core/workers/chunks/0766ecb677d667e5fb83.js +2 -0
  50. package/assets/esri/core/workers/chunks/{543eb46b55cacd6e1dbc.js.LICENSE.txt → 0766ecb677d667e5fb83.js.LICENSE.txt} +1 -1
  51. package/assets/esri/core/workers/chunks/{c607d618b64d3accecc4.js → 0aca29f7156b2b412f2e.js} +1 -1
  52. package/assets/esri/core/workers/chunks/170c346cf5a18adb25b0.js +1 -0
  53. package/assets/esri/core/workers/chunks/1c6542315390037053a6.js +1 -0
  54. package/assets/esri/core/workers/chunks/218a66d53f7cf4f285aa.js +2 -0
  55. package/assets/esri/core/workers/chunks/{d8dc922f7466300b668f.js.LICENSE.txt → 218a66d53f7cf4f285aa.js.LICENSE.txt} +2 -2
  56. package/assets/esri/core/workers/chunks/{037af6379f3e9278633b.js → 243dc74ec62891ba1ef7.js} +1 -1
  57. package/assets/esri/core/workers/chunks/253bcc3cc7bc4c2dc6ea.js +1 -0
  58. package/assets/esri/core/workers/chunks/{d874d24568b1acedebc4.js → 297d2c0a9d3f1e978318.js} +1 -1
  59. package/assets/esri/core/workers/chunks/{f74b5659b6496a5c4c0c.js → 2e0af748eba93f3ea6cb.js} +1 -1
  60. package/assets/esri/core/workers/chunks/3596540ef49e5330ceb2.js +2 -0
  61. package/assets/esri/core/workers/chunks/{7b4523ab392966624d97.js.LICENSE.txt → 3596540ef49e5330ceb2.js.LICENSE.txt} +1 -7
  62. package/assets/esri/core/workers/chunks/{a22c88b0a525e602dce0.js → 3d0e09ef78dc2fd6957a.js} +1 -1
  63. package/assets/esri/core/workers/chunks/4bd5cbf6e0be2fc7e84d.js +1 -0
  64. package/assets/esri/core/workers/chunks/4feb774f123da26e9f2a.js +1 -0
  65. package/assets/esri/core/workers/chunks/{ee1d104e2bcc5d808fa4.js → 5228fc7fcdf57f44781e.js} +1 -1
  66. package/assets/esri/core/workers/chunks/54f4a1131f99468db076.js +1 -0
  67. package/assets/esri/core/workers/chunks/{49c968e91c3c48aaa110.js → 5583d18032ed8bc17c74.js} +1 -1
  68. package/assets/esri/core/workers/chunks/5e7f35bf1aab93cb1c52.js +1 -0
  69. package/assets/esri/core/workers/chunks/{69f7fe6c58e4931597f6.js → 631205dc4d73d49ec9ed.js} +1 -1
  70. package/assets/esri/core/workers/chunks/6e12900a9f4c3c9941ec.js +1 -0
  71. package/assets/esri/core/workers/chunks/7e8f78b96d43c224c7b6.js +1 -0
  72. package/assets/esri/core/workers/chunks/{e46c05ef7272c7f1f70c.js → 83d6a1b3db7d364d156b.js} +1 -1
  73. package/assets/esri/core/workers/chunks/8a87c181b85d0b86b9bb.js.LICENSE.txt +1 -1
  74. package/assets/esri/core/workers/chunks/90ae15ce22a49bd84876.js +2 -0
  75. package/assets/esri/core/workers/chunks/{ac9c6779771ec855da79.js.LICENSE.txt → 90ae15ce22a49bd84876.js.LICENSE.txt} +3 -3
  76. package/assets/esri/core/workers/chunks/92cbe9af8a6c061bfb57.js +346 -0
  77. package/assets/esri/core/workers/chunks/{9aedd7874da7c63865d6.js → 93cc26e5636040fdc0b8.js} +1 -1
  78. package/assets/esri/core/workers/chunks/{77c7b7c4426c2b1a5b42.js → 9fc35ec8185beba96715.js} +1 -1
  79. package/assets/esri/core/workers/chunks/a1d697e2be1e892a666a.js +1 -0
  80. package/assets/esri/core/workers/chunks/{4f627eb62caee760215a.js → a1f27c4f4b5ef3e359f7.js} +1 -1
  81. package/assets/esri/core/workers/chunks/a31658f544ac6e1801d6.js +1 -0
  82. package/assets/esri/core/workers/chunks/{3a205f87f100832ef9f5.js → a5e746e10239a3bfe237.js} +1 -1
  83. package/assets/esri/core/workers/chunks/a6bcae413e62cd879b46.js +1 -0
  84. package/assets/esri/core/workers/chunks/{59d4c41172e921922cac.js → a8b42d8c0b76c234c09f.js} +100 -62
  85. package/assets/esri/core/workers/chunks/b4f38fe9cc948a39ad87.js +2 -0
  86. package/assets/esri/core/workers/chunks/{ce9de24cb96b56d20562.js.LICENSE.txt → b4f38fe9cc948a39ad87.js.LICENSE.txt} +1 -1
  87. package/assets/esri/core/workers/chunks/{752ef63d910852b7be44.js → c16e0da7a19310c71e8b.js} +1 -1
  88. package/assets/esri/core/workers/chunks/d22f91bc16a7641bcbef.js +1 -0
  89. package/assets/esri/core/workers/chunks/d551f70560a2b1ef5696.js +1 -0
  90. package/assets/esri/core/workers/chunks/d7b640f7a181bd26c7c7.js +1 -0
  91. package/assets/esri/core/workers/chunks/{2bdbf678d4f013543dbb.js → d971571a957de70d5a8d.js} +1 -1
  92. package/assets/esri/core/workers/chunks/dc3a6beb3028009b3c23.js +1 -0
  93. package/assets/esri/core/workers/chunks/e0dc8794343c2a949ffb.js +2 -0
  94. package/assets/esri/core/workers/chunks/{670a66617249f2d15a62.js.LICENSE.txt → e0dc8794343c2a949ffb.js.LICENSE.txt} +1 -1
  95. package/assets/esri/core/workers/chunks/e3c1aea34ece8336dae1.js +1 -0
  96. package/assets/esri/core/workers/chunks/e483d2f169e51a361742.js +1 -0
  97. package/assets/esri/core/workers/chunks/{a50cb1fc8c4c585c0e11.js → ec8e8048b3df2c92008d.js} +1 -1
  98. package/assets/esri/core/workers/chunks/f6a1fec33b0d81acce61.js +1 -0
  99. package/assets/esri/core/workers/chunks/f7ab3511f6627f467796.js +1 -0
  100. package/assets/esri/core/workers/chunks/{1eef9cf19634c038b59b.js → f98689562017583f73ee.js} +1 -1
  101. package/assets/esri/core/workers/chunks/fb2e28e6a87956267d1c.js +66 -0
  102. package/assets/esri/core/workers/chunks/fbcd94f60f92257a7303.js +2 -0
  103. package/assets/esri/core/workers/chunks/{c2594024d72133d3ed7b.js.LICENSE.txt → fbcd94f60f92257a7303.js.LICENSE.txt} +1 -1
  104. package/assets/esri/core/workers/chunks/fda48126f67e80034404.js +1 -0
  105. package/assets/esri/themes/base/widgets/_FeatureTable.scss +1 -0
  106. package/assets/esri/themes/dark/main.css +1 -1
  107. package/assets/esri/themes/light/main.css +1 -1
  108. package/assets/esri/themes/light/view.css +1 -1
  109. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_ar.json +1 -1
  110. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_bg.json +1 -1
  111. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_bs.json +1 -1
  112. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_ca.json +1 -1
  113. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_cs.json +1 -1
  114. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_da.json +1 -1
  115. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_de.json +1 -1
  116. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_el.json +1 -1
  117. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_es.json +1 -1
  118. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_et.json +1 -1
  119. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_fi.json +1 -1
  120. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_fr.json +1 -1
  121. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_he.json +1 -1
  122. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_hr.json +1 -1
  123. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_hu.json +1 -1
  124. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_id.json +1 -1
  125. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_it.json +1 -1
  126. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_ja.json +1 -1
  127. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_ko.json +1 -1
  128. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_lt.json +1 -1
  129. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_lv.json +1 -1
  130. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_nl.json +1 -1
  131. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_no.json +1 -1
  132. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_pl.json +1 -1
  133. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_pt-BR.json +1 -1
  134. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_pt-PT.json +1 -1
  135. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_ro.json +1 -1
  136. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_ru.json +1 -1
  137. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_sk.json +1 -1
  138. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_sl.json +1 -1
  139. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_sr.json +1 -1
  140. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_sv.json +1 -1
  141. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_th.json +1 -1
  142. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_tr.json +1 -1
  143. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_uk.json +1 -1
  144. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_vi.json +1 -1
  145. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_zh-CN.json +1 -1
  146. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_zh-HK.json +1 -1
  147. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_zh-TW.json +1 -1
  148. package/chunks/HUDMaterial.glsl.js +1 -1
  149. package/chunks/Laserlines.glsl.js +2 -2
  150. package/chunks/aiServices.js +1 -1
  151. package/chunks/boundedPlane.js +1 -1
  152. package/chunks/cameraUtilsSpherical.js +1 -1
  153. package/chunks/vec32.js +1 -1
  154. package/core/has.js +1 -1
  155. package/core/libs/gl-matrix-2/math/mat4.js +1 -1
  156. package/core/libs/gl-matrix-2/math/vec3.js +1 -1
  157. package/core/mapCollectionUtils.js +1 -1
  158. package/core/perspectiveUtils.js +1 -1
  159. package/core/sql/StandardizedFunctions.js +1 -1
  160. package/core/sql/WhereGrammar.js +1 -1
  161. package/geometry/support/axisAngleDegrees.js +1 -1
  162. package/geometry/support/curves/bezierCurveUtils.js +1 -1
  163. package/geometry/support/curves/circleUtils.js +1 -1
  164. package/geometry/support/curves/curveExtent.js +5 -0
  165. package/geometry/support/curves/curveLength.js +5 -0
  166. package/geometry/support/curves/densifyCurvedGeometry.js +1 -1
  167. package/geometry/support/curves/ellipticArc4Utils.js +1 -1
  168. package/geometry/support/curves/ellipticArc7Utils.js +1 -1
  169. package/geometry/support/curves/mathUtils.js +1 -1
  170. package/geometry/support/curves/splitCurveAtPoint.js +1 -1
  171. package/geometry/support/frustum.js +1 -1
  172. package/geometry/support/meshUtils/External.js +1 -1
  173. package/geometry/support/meshUtils/exporters/gltf/gltf.js +1 -1
  174. package/geometry/support/meshUtils/loadExternal.js +1 -1
  175. package/geometry/support/meshUtils/primitives.js +1 -1
  176. package/geometry/support/meshUtils/projection.js +1 -1
  177. package/geometry/support/meshUtils/rotate.js +1 -1
  178. package/geometry/support/meshUtils/scale.js +1 -1
  179. package/geometry/support/meshUtils/vertexSpaceConversion.js +1 -1
  180. package/geometry/support/meshVertexSpaceUtils.js +1 -1
  181. package/geometry/support/plane.js +1 -1
  182. package/interfaces.d.ts +401 -17
  183. package/layers/IntegratedMesh3DTilesLayer.js +1 -1
  184. package/layers/LinkChartLayer.js +1 -1
  185. package/layers/SceneLayer.js +1 -1
  186. package/layers/VideoLayer.js +1 -1
  187. package/layers/VoxelWasmPerSceneView.js +1 -1
  188. package/layers/graphics/sources/FeatureLayerSource.js +1 -1
  189. package/layers/graphics/sources/MemorySource.js +1 -1
  190. package/layers/graphics/sources/support/uploadAssets.js +1 -1
  191. package/layers/video/VideoCameraSensorModel.js +1 -1
  192. package/layers/video/VideoController.js +1 -1
  193. package/layers/voxel/VoxelVolume.js +1 -1
  194. package/layers/voxel/voxelPlaneUtils.js +1 -1
  195. package/package.json +1 -1
  196. package/rest/knowledgeGraph/wasmInterface/wasmToUpdateResponseFactories.js +1 -1
  197. package/rest/support/meshFeatureSet.js +1 -1
  198. package/smartMapping/renderers/size.js +1 -1
  199. package/smartMapping/renderers/support/spikeUtils.js +1 -1
  200. package/support/revision.js +1 -1
  201. package/symbols/cim/cimAnalyzer.js +1 -1
  202. package/views/2d/engine/webgl/AFeatureTile.js +1 -1
  203. package/views/2d/engine/webgl/shaderGraph/techniques/fill/ComplexOutlineFillMeshWriter.js +1 -1
  204. package/views/2d/engine/webgl/shaderGraph/techniques/fill/OutlineFillMeshWriter.js +1 -1
  205. package/views/2d/engine/webgl/shaderGraph/techniques/fill/PatternOutlineFillMeshWriter.js +1 -1
  206. package/views/2d/engine/webgl/shaderGraph/techniques/mesh/MeshWriter.js +1 -1
  207. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/OutlineFillShader.js +1 -1
  208. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/constants.js +1 -1
  209. package/views/2d/layers/features/layerAdapters/FeatureLayerAdapter.js +1 -1
  210. package/views/2d/layers/features/layerAdapters/OrientedImageryLayerAdapter.js +1 -1
  211. package/views/2d/layers/features/layerAdapters/SubtypeGroupLayerAdapter.js +1 -1
  212. package/views/2d/layers/features/layerAdapters/featureServiceUtils.js +1 -1
  213. package/views/2d/layers/features/schema/processor/symbols/ComplexSymbolSchema.js +1 -1
  214. package/views/2d/layers/features/schema/processor/symbols/SymbolSchema.js +1 -1
  215. package/views/2d/layers/features/sources/FeatureSource.js +1 -1
  216. package/views/3d/analysis/AreaMeasurement/support/MeasurementData.js +1 -1
  217. package/views/3d/analysis/Dimension/DimensionTool.js +1 -1
  218. package/views/3d/analysis/Dimension/lengthDimensionConstraintUtils.js +1 -1
  219. package/views/3d/analysis/Dimension/lengthDimensionManipulatorUtils.js +1 -1
  220. package/views/3d/analysis/Dimension/lengthDimensionUtils.js +1 -1
  221. package/views/3d/analysis/DimensionAnalysisView3D.js +1 -1
  222. package/views/3d/analysis/LineOfSight/LineOfSightRayIntersector.js +1 -1
  223. package/views/3d/analysis/LineOfSight/LineOfSightTool.js +1 -1
  224. package/views/3d/analysis/Viewshed/ViewshedComputedData.js +1 -1
  225. package/views/3d/analysis/Viewshed/ViewshedTool.js +1 -1
  226. package/views/3d/analysis/Viewshed/ViewshedVisualization.js +1 -1
  227. package/views/3d/analysis/Viewshed/viewshedToolUtils.js +1 -1
  228. package/views/3d/analysis/ViewshedAnalysisView3D.js +1 -1
  229. package/views/3d/animation/pointToPoint/Camera.js +1 -1
  230. package/views/3d/camera/constraintUtils/distance.js +1 -1
  231. package/views/3d/camera/intersectionUtils.js +1 -1
  232. package/views/3d/interactive/Manipulator3D.js +1 -1
  233. package/views/3d/interactive/editingTools/dragEventPipeline3D.js +1 -1
  234. package/views/3d/interactive/editingTools/reshape/edgeOffsetUtils.js +1 -1
  235. package/views/3d/interactive/visualElements/DrapedVisualElementResources.js +1 -1
  236. package/views/3d/interactive/visualElements/ExtendedLineVisualElement.js +1 -1
  237. package/views/3d/interactive/visualElements/ParallelLineVisualElement.js +1 -1
  238. package/views/3d/interactive/visualElements/RightAngleQuadVisualElement.js +1 -1
  239. package/views/3d/layers/DynamicLayerView3D.js +1 -1
  240. package/views/3d/layers/I3SMeshView3D.js +1 -1
  241. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  242. package/views/3d/layers/PointCloudWorker.js +1 -1
  243. package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
  244. package/views/3d/layers/SceneLayerView3D.js +1 -1
  245. package/views/3d/layers/graphics/Deconflictor.js +1 -1
  246. package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
  247. package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
  248. package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
  249. package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
  250. package/views/3d/layers/graphics/Graphics3DTextSymbolLayer.js +1 -1
  251. package/views/3d/layers/graphics/GraphicsDeconflictor.js +1 -1
  252. package/views/3d/layers/graphics/LabelDeconflictor.js +1 -1
  253. package/views/3d/layers/graphics/Labeler.js +1 -1
  254. package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
  255. package/views/3d/layers/graphics/pipeline/Feature3DPipelineWorker.js +1 -1
  256. package/views/3d/layers/graphics/pipeline/rendering/DirectRenderer.js +1 -1
  257. package/views/3d/layers/i3s/I3SClientNodeLoader.js +1 -1
  258. package/views/3d/layers/i3s/I3SGeometryUtil.js +1 -1
  259. package/views/3d/layers/i3s/I3SIntersectionHandler.js +1 -1
  260. package/views/3d/layers/i3s/I3SMeshViewFilter.js +1 -1
  261. package/views/3d/layers/i3s/I3SQueryEngine.js +1 -1
  262. package/views/3d/layers/i3s/I3SQueryFeatureAdapter.js +1 -1
  263. package/views/3d/layers/i3s/I3SQueryResultGeometry.js +5 -0
  264. package/views/3d/layers/i3s/I3SViewportQueries.js +1 -1
  265. package/views/3d/layers/i3s/Intersector.js +1 -1
  266. package/views/3d/layers/i3s/LayerElevationProvider.js +1 -1
  267. package/views/3d/layers/i3s/PointCloudRenderer.js +1 -1
  268. package/views/3d/layers/support/FastSymbolUpdates.js +1 -1
  269. package/views/3d/layers/support/StageLayerElevationProvider.js +1 -1
  270. package/views/3d/layers/support/Tiles3DIntersectionHandler.js +1 -1
  271. package/views/3d/state/Frustum.js +1 -1
  272. package/views/3d/state/controllers/GamepadKeyboardController.js +1 -1
  273. package/views/3d/state/controllers/PinchAndPanControllerGlobal.js +1 -1
  274. package/views/3d/state/controllers/PinchAndPanControllerLocal.js +1 -1
  275. package/views/3d/state/controllers/PointToPointAnimationController.js +1 -1
  276. package/views/3d/state/controllers/ZoomControllerLocal.js +1 -1
  277. package/views/3d/state/controllers/ZoomStepControllerGlobal.js +1 -1
  278. package/views/3d/state/controllers/ZoomStepControllerLocal.js +1 -1
  279. package/views/3d/state/controllers/momentum/ZoomPlanarMomentumController.js +1 -1
  280. package/views/3d/state/helpers/SceneIntersectionHelper.js +1 -1
  281. package/views/3d/support/FrustumExtentIntersection.js +1 -1
  282. package/views/3d/support/hitTest.js +1 -1
  283. package/views/3d/support/orientedBoundingBox.js +1 -1
  284. package/views/3d/support/pointsOfInterest/CameraOnSurface.js +1 -1
  285. package/views/3d/support/pointsOfInterest/CenterOnSurface.js +1 -1
  286. package/views/3d/support/pointsOfInterest/PointsOfInterest.js +1 -1
  287. package/views/3d/support/viewpointUtils.js +1 -1
  288. package/views/3d/terrain/Intersector.js +1 -1
  289. package/views/3d/terrain/OverlayManager.js +1 -1
  290. package/views/3d/terrain/TerrainRenderer.js +1 -1
  291. package/views/3d/terrain/TerrainSurface.js +1 -1
  292. package/views/3d/webgl/ManagedDepthTexture.js +1 -1
  293. package/views/3d/webgl/ManagedFBOResource.js +1 -1
  294. package/views/3d/webgl/RenderCamera.js +1 -1
  295. package/views/3d/webgl-engine/collections/Component/DepthRange.js +1 -1
  296. package/views/3d/webgl-engine/collections/Component/ElevationAgnosticBVH.js +1 -1
  297. package/views/3d/webgl-engine/collections/Component/IntersectionGeometry.js +1 -1
  298. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  299. package/views/3d/webgl-engine/core/FBOCache.js +1 -1
  300. package/views/3d/webgl-engine/core/FBOCacheFormats.js +1 -1
  301. package/views/3d/webgl-engine/effects/bloom/BloomRenderNode.js +1 -1
  302. package/views/3d/webgl-engine/effects/focusArea/FocusAreaColorNode.js +1 -1
  303. package/views/3d/webgl-engine/effects/focusArea/FocusAreaMaskNode.js +1 -1
  304. package/views/3d/webgl-engine/effects/geometry/RenderOccludedRenderNode.js +1 -1
  305. package/views/3d/webgl-engine/effects/laserlines/LaserLineRenderer.js +1 -1
  306. package/views/3d/webgl-engine/effects/laserlines/LaserlinePathTechniqueConfiguration.js +1 -1
  307. package/views/3d/webgl-engine/lib/DefaultVertexAttributeLocations.js +1 -1
  308. package/views/3d/webgl-engine/lib/GPUPointOcclusionQuery.js +1 -1
  309. package/views/3d/webgl-engine/lib/HUDIntersectorResult.js +5 -0
  310. package/views/3d/webgl-engine/lib/Intersector.js +1 -1
  311. package/views/3d/webgl-engine/lib/IntersectorInterfaces.js +1 -1
  312. package/views/3d/webgl-engine/lib/IntersectorResult.js +5 -0
  313. package/views/3d/webgl-engine/lib/IntersectorTarget.js +1 -1
  314. package/views/3d/webgl-engine/lib/IntersectorType.js +5 -0
  315. package/views/3d/webgl-engine/lib/MainFramebuffer.js +1 -1
  316. package/views/3d/webgl-engine/lib/Material.js +1 -1
  317. package/views/3d/webgl-engine/lib/Normals.js +1 -1
  318. package/views/3d/webgl-engine/lib/Object3D.js +1 -1
  319. package/views/3d/webgl-engine/lib/ObjectIntersectorResult.js +5 -0
  320. package/views/3d/webgl-engine/lib/ObjectTarget.js +5 -0
  321. package/views/3d/webgl-engine/lib/PathGeometryData.js +1 -1
  322. package/views/3d/webgl-engine/lib/PathVertex.js +1 -1
  323. package/views/3d/webgl-engine/lib/RayIntersections.js +1 -1
  324. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  325. package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
  326. package/views/3d/webgl-engine/lib/SortedRenderGeometryRenderer.js +1 -1
  327. package/views/3d/webgl-engine/lib/ViewshedShadowMap.js +1 -1
  328. package/views/3d/webgl-engine/lib/edgeRendering/edgePreprocessing.js +1 -1
  329. package/views/3d/webgl-engine/lib/intersectorUtils.js +1 -1
  330. package/views/3d/webgl-engine/lib/intersectorUtilsConversions.js +1 -1
  331. package/views/3d/webgl-engine/lib/lodRendering/Intersector.js +1 -1
  332. package/views/3d/webgl-engine/lib/lodRendering/LodRenderer.js +1 -1
  333. package/views/3d/webgl-engine/lib/lodRendering/LodResources.js +1 -1
  334. package/views/3d/webgl-engine/lighting/SphericalHarmonics.js +1 -1
  335. package/views/3d/webgl-engine/materials/DefaultBufferWriter.js +1 -1
  336. package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
  337. package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
  338. package/views/3d/webgl-engine/materials/HeatmapDensityMaterial.js +1 -1
  339. package/views/3d/webgl-engine/materials/LineCalloutMaterial.js +1 -1
  340. package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
  341. package/views/3d/webgl-engine/materials/MeasurementArrowMaterial.js +1 -1
  342. package/views/3d/webgl-engine/materials/NativeLineMaterial.js +1 -1
  343. package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
  344. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  345. package/views/3d/webgl-engine/materials/ShadedColorMaterial.js +1 -1
  346. package/views/3d/webgl-engine/materials/TriangleMaterial.js +1 -1
  347. package/views/3d/webgl-engine/materials/pbrUtils.js +1 -1
  348. package/views/3d/webgl-engine/shaders/CompositingTechniqueConfiguration.js +1 -1
  349. package/views/FocusArea.js +1 -1
  350. package/views/FocusAreaOutline.js +5 -0
  351. package/views/FocusAreaOutlineItem.js +5 -0
  352. package/views/FocusAreas.js +1 -1
  353. package/views/FocusAreasUtils.js +5 -0
  354. package/views/FocusAreasView.js +5 -0
  355. package/views/SceneView.js +1 -1
  356. package/views/analysis/DimensionAnalysisView.js +1 -1
  357. package/views/draw/support/surfaceCoordinateSystems.js +1 -1
  358. package/views/interactive/ToolIntersector.js +1 -1
  359. package/views/interactive/editGeometry/operations/OffsetEdgeVertex.js +1 -1
  360. package/views/interactive/keybindings.js +1 -1
  361. package/views/interactive/sketch/constraints.js +1 -1
  362. package/views/interactive/snapping/candidates/ParallelLineSnappingCandidate.js +1 -1
  363. package/views/interactive/snapping/hints/IntersectionSnappingHint.js +1 -1
  364. package/views/interactive/snapping/hints/LineSnappingHint.js +1 -1
  365. package/views/interactive/snapping/hints/ParallelSnappingHint.js +1 -1
  366. package/views/interactive/snapping/hints/PointSnappingHint.js +1 -1
  367. package/views/interactive/snapping/hints/RightAngleSnappingHint.js +1 -1
  368. package/views/interactive/tooltip/tooltipCommonUtils.js +1 -1
  369. package/views/layers/DimensionLayerView.js +1 -1
  370. package/views/support/angularMeasurementUtils.js +1 -1
  371. package/views/support/geometry3dUtils.js +1 -1
  372. package/webdoc/IPSInfo.js +1 -1
  373. package/webdoc/ips/AppleIPSProperties.d.ts +4 -0
  374. package/webdoc/ips/AppleIPSProperties.js +5 -0
  375. package/webdoc/ips/Configuration.d.ts +4 -0
  376. package/webdoc/ips/Configuration.js +5 -0
  377. package/webdoc/ips/GNSSProperties.d.ts +4 -0
  378. package/webdoc/ips/GNSSProperties.js +5 -0
  379. package/webdoc/ips/PathSnappingProperties.d.ts +4 -0
  380. package/webdoc/ips/PathSnappingProperties.js +5 -0
  381. package/webdoc/ips/SmoothingProperties.d.ts +4 -0
  382. package/webdoc/ips/SmoothingProperties.js +5 -0
  383. package/widgets/BasemapLayerList.js +1 -1
  384. package/widgets/BatchAttributeForm.js +1 -1
  385. package/widgets/ElevationProfile/ElevationProfileLineView.js +1 -1
  386. package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationSettings.js +1 -1
  387. package/widgets/FeatureForm.js +1 -1
  388. package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
  389. package/widgets/FeatureTable.js +1 -1
  390. package/widgets/Legend/support/sizeRampUtils.js +1 -1
  391. package/widgets/UtilityNetworkTrace/UtilityNetworkTraceFeature.js +1 -1
  392. package/widgets/UtilityNetworkTrace.js +1 -1
  393. package/widgets/UtilityNetworkValidateTopology.js +1 -1
  394. package/widgets/VideoPlayer/components/MetadataSection.js +1 -1
  395. package/widgets/VideoPlayer/components/SettingsButton.js +1 -1
  396. package/widgets/support/FilterBuilder.js +1 -1
  397. package/widgets/support/Selector2D/SelectionOperation.js +1 -1
  398. package/widgets/support/SketchTooltipControls.js +1 -1
  399. package/widgets/support/SnappingControls.js +1 -1
  400. package/assets/esri/core/workers/chunks/094300acbd24085cb063.js +0 -1
  401. package/assets/esri/core/workers/chunks/0c338364cb55afdbd580.js +0 -1
  402. package/assets/esri/core/workers/chunks/2da01fe20200b6d74851.js +0 -1
  403. package/assets/esri/core/workers/chunks/35c996f6fbff165b03f4.js +0 -1
  404. package/assets/esri/core/workers/chunks/3a517393619af3639b83.js +0 -1
  405. package/assets/esri/core/workers/chunks/45d64b72b7e93e9c64d7.js +0 -1
  406. package/assets/esri/core/workers/chunks/46104db7f77952bb6c12.js +0 -1
  407. package/assets/esri/core/workers/chunks/47bbfc10c2a3b9e4bdd6.js +0 -1
  408. package/assets/esri/core/workers/chunks/49f0e53b3c9ba8451442.js +0 -1
  409. package/assets/esri/core/workers/chunks/543eb46b55cacd6e1dbc.js +0 -2
  410. package/assets/esri/core/workers/chunks/5e0118a030cf741f78c6.js +0 -319
  411. package/assets/esri/core/workers/chunks/670a66617249f2d15a62.js +0 -2
  412. package/assets/esri/core/workers/chunks/6b5274d46a155d65dff1.js +0 -39
  413. package/assets/esri/core/workers/chunks/74187c771ee7083d1db7.js +0 -1
  414. package/assets/esri/core/workers/chunks/7b4523ab392966624d97.js +0 -2
  415. package/assets/esri/core/workers/chunks/7c2ec96749972e0b8a13.js +0 -1
  416. package/assets/esri/core/workers/chunks/7ffc1db10b00754398e8.js +0 -1
  417. package/assets/esri/core/workers/chunks/81546c6141d564ed59c9.js +0 -1
  418. package/assets/esri/core/workers/chunks/852dd5af8e704613310a.js +0 -1
  419. package/assets/esri/core/workers/chunks/ac9c6779771ec855da79.js +0 -2
  420. package/assets/esri/core/workers/chunks/bbff052a991a2dc36960.js +0 -1
  421. package/assets/esri/core/workers/chunks/bcab8b9ce2f9d2ebaae7.js +0 -1
  422. package/assets/esri/core/workers/chunks/bf190d672dcbaedc1a41.js +0 -1
  423. package/assets/esri/core/workers/chunks/c255c9279815359fdce5.js +0 -1
  424. package/assets/esri/core/workers/chunks/c2594024d72133d3ed7b.js +0 -2
  425. package/assets/esri/core/workers/chunks/ce9de24cb96b56d20562.js +0 -2
  426. package/assets/esri/core/workers/chunks/d8dc922f7466300b668f.js +0 -2
  427. package/assets/esri/core/workers/chunks/d9948763423784b68c09.js +0 -1
  428. package/assets/esri/core/workers/chunks/dbf6011dd7933f02d41d.js +0 -66
  429. package/assets/esri/core/workers/chunks/e4e9dd635bdef18d0bd5.js +0 -1
  430. package/assets/esri/core/workers/chunks/e69f2e3c2d5e71fbb42f.js +0 -1
  431. package/assets/esri/core/workers/chunks/f61632c06c05b72e7017.js +0 -1
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
+ */
5
+ import{_ as o}from"../../chunks/tslib.es6.js";import r from"../../core/Clonable.js";import e from"../../core/JSONSupport.js";import{property as s}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as t}from"../../core/accessorSupport/decorators/subclass.js";let p=class extends(r.ClonableMixin(e)){constructor(o){super(o),this.enabled=!0}};o([s({type:Boolean,nonNullable:!0,json:{write:!0}})],p.prototype,"enabled",void 0),p=o([t("esri.webdoc.ips.GNSSProperties")],p);const c=p;export{c as default};
@@ -0,0 +1,4 @@
1
+ import "../../interfaces";
2
+
3
+ import PathSnappingProperties = __esri.PathSnappingProperties;
4
+ export default PathSnappingProperties;
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
+ */
5
+ import{_ as o}from"../../chunks/tslib.es6.js";import e from"../../core/Clonable.js";import r from"../../core/JSONSupport.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";let p=class extends(e.ClonableMixin(r)){constructor(o){super(o),this.enabled=!0,this.distance=5,this.units="meter"}};o([t({type:Boolean,nonNullable:!0,json:{write:!0}})],p.prototype,"enabled",void 0),o([t({type:Number,nonNullable:!0,json:{write:!0}})],p.prototype,"distance",void 0),o([t({type:["feet","meter"],nonNullable:!0,json:{write:!0}})],p.prototype,"units",void 0),p=o([s("esri.webdoc.ips.PathSnappingProperties")],p);const i=p;export{i as default};
@@ -0,0 +1,4 @@
1
+ import "../../interfaces";
2
+
3
+ import SmoothingProperties = __esri.SmoothingProperties;
4
+ export default SmoothingProperties;
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
+ */
5
+ import{_ as o}from"../../chunks/tslib.es6.js";import r from"../../core/Clonable.js";import e from"../../core/JSONSupport.js";import{property as s}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as t}from"../../core/accessorSupport/decorators/subclass.js";let p=class extends(r.ClonableMixin(e)){constructor(o){super(o),this.enabled=!0}};o([s({type:Boolean,nonNullable:!0,json:{write:!0}})],p.prototype,"enabled",void 0),p=o([t("esri.webdoc.ips.SmoothingProperties")],p);const c=p;export{c 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.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../chunks/tslib.es6.js";import t from"../core/Collection.js";import i from"../core/Identifiable.js";import s from"../core/ReactiveMap.js";import{on as o,watch as r,initial as l,syncAndInitial as n}from"../core/reactiveUtils.js";import{property as a}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{subclass as c}from"../core/accessorSupport/decorators/subclass.js";import d from"./Widget.js";import p from"./BasemapLayerList/BasemapLayerListViewModel.js";import m from"./BasemapLayerList/BasemapLayerListVisibleElements.js";import{css as h}from"./BasemapLayerList/css.js";import u from"./LayerList/LayerListItem.js";import f from"./LayerList/ListItem.js";import{minFilterItems as y,getItem as g,getLayerType as _,removeDestroyedListItems as b,setFilterPredicate as L,sortLayersToIds as v,sortChildLayersToIds as I}from"./LayerList/support/layerListUtils.js";import{loadCalciteComponents as w}from"./support/componentsUtils.js";import{globalCss as F}from"./support/globalCss.js";import{incrementHeadingLevel as E}from"./support/Heading.js";import{calciteListFilterProps as C}from"./support/listUtils.js";import{setFocus as T}from"./support/widgetUtils.js";import{messageBundle as M}from"./support/decorators/messageBundle.js";import{vmEvent as P}from"./support/decorators/vmEvent.js";import{tsx as O}from"./support/jsxFactory.js";const A=t.ofType(f),R="nested",B=".*\\S+.*",k="data-basemap-layer-type";let j=class extends(i.IdentifiableMixin(d)){constructor(e,i){super(e,i),this._baseListEl=null,this._referenceListEl=null,this._activeItem=null,this._tooltipReferenceMap=new Map,this._editTitleInput=null,this._focusRootFlowItem=!1,this._focusPanelFlowItem=!1,this._focusLayerFlowItem=null,this._focusEditingFlowItem=!1,this._layerListMap=new s,this._lastDragDetail=null,this._selectedDragItemLayerUid=null,this._rootGroupUid=`basemap-${this.uid}`,this._openedLayersController=null,this.catalogLayerList=null,this.catalogOptions=null,this.collapsed=!1,this.dragEnabled=!1,this.editingTitle=!1,this.filterPlaceholder="",this.baseFilterPredicate=null,this.baseFilterText="",this.referenceFilterPredicate=null,this.referenceFilterText="",this.listItemCanGiveFunction=null,this.listItemCanReceiveFunction=null,this.headingLevel=2,this.knowledgeGraphOptions=null,this.layerTablesEnabled=new t(["knowledge-graph"]),this.mapImageOptions=null,this.messages=null,this.messagesCommon=null,this.minFilterItems=y,this.openedLayers=new t,this.openedLayerLists=new t,this.tableList=null,this.selectedItems=new A,this.selectionMode="none",this.tileOptions=null,this.viewModel=new p,this.visibilityAppearance="default",this.visibleElements=new m,this._canMove=({dragEl:e,fromEl:t,toEl:i},s)=>{const o="pull"===s?this.listItemCanGiveFunction:this.listItemCanReceiveFunction,r=g(e);if(!r?.sortable)return!1;const l=g(t),n=_(t),a=g(i),c=_(i),d=!!n&&!!c&&n===c,p={selected:r,from:l,to:a},m=t.group,h=i.group,u=l?.layer?.type??"",f=a?.layer?.type??"",y=new Set(["map-image","catalog","knowledge-graph"]),b="sublayer";return m&&h&&"function"==typeof o?o.call(null,p):d&&!y.has(u)&&!y.has(f)&&r?.layer?.type!==b},this._onSelectedDragItemLayerUidChange=e=>{this._selectedDragItemLayerUid=e},this._onTriggerAction=(e,t)=>{this.triggerAction(e,t)},this._onTooltipReferenceChange=(e,t)=>{t?this._tooltipReferenceMap.set(e,t):this._tooltipReferenceMap.delete(e)},this._onTablesOpen=e=>{this.openedLayers.push(e.layer),this._focusLayerFlowItem=e.layer?.uid},this._onPanelOpen=()=>{this._focusPanelFlowItem=!0},this._onCatalogOpen=e=>{this.openedLayers.push(e.layer?.parent),this._focusLayerFlowItem=e.layer?.uid},this._clearActiveItem=()=>{this._activeItem=null},this._setActiveItem=e=>{if("default"!==this.visibilityAppearance)return;const t=Array.from(e.composedPath()).find((e=>e.classList?.contains(h.item)));this._activeItem=g(t)},this._onCalciteListOrderChange=e=>{const{_lastDragDetail:t}=this,{toEl:i,fromEl:s,dragEl:o,newIndex:r}=e;if(!s||!i||t?.newIndex===r&&t?.dragEl===o&&t?.toEl===i&&t?.fromEl===s)return;this._lastDragDetail=e,this._selectedDragItemLayerUid=o.value;const l=s,n=i;if(l!==n)this._moveLayerFromChildList({toEl:n,fromEl:l,dragEl:o,newIndex:r});else{const e=Array.from(s.children).filter((e=>e?.matches("calcite-list-item"))).map((e=>e.value));this._sortLayers(l,e)}}}initialize(){this.addHandles([o((()=>this.openedLayers),"change",(()=>this._handleOpenedLayersChange()),l),r((()=>[this.viewModel.referenceItems.toArray(),this.viewModel.baseItems.toArray()]),(()=>b(this.selectedItems)),n),r((()=>[this.baseFilterPredicate,this._baseListEl]),(()=>L(this._baseListEl,this.baseFilterPredicate))),r((()=>[this.referenceFilterPredicate,this._referenceListEl]),(()=>L(this._referenceListEl,this.referenceFilterPredicate)))])}loadDependencies(){return w({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),block:()=>import("@esri/calcite-components/dist/components/calcite-block"),label:()=>import("@esri/calcite-components/dist/components/calcite-label"),input:()=>import("@esri/calcite-components/dist/components/calcite-input"),button:()=>import("@esri/calcite-components/dist/components/calcite-button"),flow:()=>import("@esri/calcite-components/dist/components/calcite-flow"),"flow-item":()=>import("@esri/calcite-components/dist/components/calcite-flow-item"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice"),tooltip:()=>import("@esri/calcite-components/dist/components/calcite-tooltip")})}destroy(){this._tooltipReferenceMap.clear(),this._destroyOpenedLayerLists()}get _visibleBaseItems(){return this.baseItems?.filter((e=>!e.hidden&&(this.visibleElements.errors||!e.error)))}get _visibleReferenceItems(){return this.referenceItems?.filter((e=>!e.hidden&&(this.visibleElements.errors||!e.error)))}get _openedPanelItems(){return this._visibleReferenceItems.concat(this._visibleBaseItems).flatten((e=>e.children)).filter((({hidden:e,panel:t})=>!e&&t?.open&&!t.disabled&&t.flowEnabled))}get _totalBaseItems(){return this.viewModel.baseItems.flatten((e=>e.children.filter((e=>"catalog-dynamic-group"!==e.layer?.type)))).length}get _totalReferenceItems(){return this.viewModel.referenceItems.flatten((e=>e.children.filter((e=>"catalog-dynamic-group"!==e.layer?.type)))).length}get _baseFilterEnabled(){return this._totalBaseItems>=this.minFilterItems&&this.visibleElements.filter}get _referenceFilterEnabled(){return this._totalReferenceItems>=this.minFilterItems&&this.visibleElements.filter}get _renderedOpenLayerFlowItems(){const{openedLayers:e}=this;return e.toArray().map(((t,i)=>this._renderLayerFlowItem(t,i===e.length-1)))}get basemapTitle(){return this.viewModel.basemapTitle}set basemapTitle(e){this.viewModel.basemapTitle=e}get baseListItemCreatedFunction(){return this.viewModel.baseListItemCreatedFunction}set baseListItemCreatedFunction(e){this.viewModel.baseListItemCreatedFunction=e}get icon(){return"layers"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get referenceListItemCreatedFunction(){return this.viewModel.referenceListItemCreatedFunction}set referenceListItemCreatedFunction(e){this.viewModel.referenceListItemCreatedFunction=e}get baseItems(){return this.viewModel.baseItems}get referenceItems(){return this.viewModel.referenceItems}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}triggerAction(e,t){return this.viewModel.triggerAction(e,t)}render(){const{state:e}=this.viewModel,t={[F.hidden]:"loading"===e,[F.disabled]:"disabled"===e};return O("div",{class:this.classes(h.base,F.widget,F.panel,t)},this._renderItems())}async _createCatalogLayerList(e){const{default:t}=await import("./CatalogLayerList.js"),{headingLevel:i,catalogOptions:s,view:o,filterPlaceholder:r,minFilterItems:l,selectionMode:n,visibilityAppearance:a,_onCatalogOpen:c,_onTablesOpen:d,layerTablesEnabled:p}=this;return new t({headingLevel:i,view:o,filterPlaceholder:r,minFilterItems:l,selectionMode:n,visibilityAppearance:a,...s,catalogLayer:e,layerTablesEnabled:p,onCatalogOpen:c,onTablesOpen:d})}_getTableListParams(e){switch(e.type){case"knowledge-graph":return{...this.knowledgeGraphOptions,tables:e.tables};case"map-image":return{...this.mapImageOptions,tables:e.subtables};case"tile":return{...this.tileOptions,tables:e.subtables};default:return null}}async _createTableList(e){const{default:t}=await import("./TableList.js"),{headingLevel:i,selectionMode:s,dragEnabled:o}=this;return new t({headingLevel:i,selectionMode:s,dragEnabled:o,...this._getTableListParams(e)})}async _createFlowList(e,t){const{_layerListMap:i}=this,s=i.get(e);if(s)return s;const o="catalog"===e.type?await this._createCatalogLayerList(e):await this._createTableList(e);return t.aborted||i.set(e,o),o}async _handleOpenedLayersChange(){const{_layerListMap:e,openedLayers:t,openedLayerLists:i}=this;this._openedLayersController?.abort();const s=new AbortController,{signal:o}=s;this._openedLayersController=s,e.forEach(((i,s)=>{t.includes(s)||(i.destroy(),e.delete(s))}));const r=await Promise.all(t.map((e=>this._createFlowList(e,o))));if(o.aborted)return;i.removeAll(),i.addMany(r);const l=i.at(-1);l?"catalogLayer"in l?(this._set("catalogLayerList",l),this._set("tableList",null)):(this._set("catalogLayerList",null),this._set("tableList",l)):(this._set("catalogLayerList",null),this._set("tableList",null))}_destroyOpenedLayerLists(){this.openedLayerLists.destroyAll(),this.openedLayers.removeAll(),this._layerListMap.clear()}_renderItemTooltip(e){return e?O("calcite-tooltip",{key:`tooltip-${e.layer?.uid}`,overlayPositioning:"fixed",referenceElement:this._tooltipReferenceMap.get(e.layer?.uid)},this.messages.layerIncompatibleTooltip):null}_renderItemTooltipNodes(e){return e.incompatible?this._renderItemTooltip(e):e.children?.filter((e=>!e.hidden)).toArray().map((e=>this._renderItemTooltipNodes(e)))}_renderItemTooltips(){return this._visibleReferenceItems.concat(this._visibleBaseItems)?.toArray().map((e=>this._renderItemTooltipNodes(e)))}_focusLayerFlowItemNode(e){this._focusLayerFlowItem===e.dataset.layerUid&&(this._focusLayerFlowItem=null,T(e))}_renderPanelFlowItems(){const{_openedPanelItems:e,openedLayers:t}=this;return e.toArray().map((({title:i,panel:s},o)=>{const r=()=>this._handlePanelFlowItemBack(s);return O("calcite-flow-item",{afterCreate:this._focusPanelFlowItemNode,afterUpdate:this._focusPanelFlowItemNode,bind:this,description:i,heading:s.title,headingLevel:this.headingLevel,key:`flow-panel-${s.uid}`,selected:!t.length&&o===e.length-1,onCalciteFlowItemBack:e=>{e.preventDefault(),r()}},s.render(),O("calcite-button",{appearance:"transparent",onclick:r,slot:"footer-actions",width:"full"},this.messagesCommon.back))}))}_handlePanelFlowItemBack(e){e.open=!1,this._focusRootFlowItem=!0}_focusEditingFlowItemNode(e){this._focusEditingFlowItem&&(this._focusEditingFlowItem=!1,T(e))}_focusRootFlowItemNode(e){this._focusRootFlowItem&&(this._focusRootFlowItem=!1,T(e))}_focusPanelFlowItemNode(e){this._focusPanelFlowItem&&(this._focusPanelFlowItem=!1,T(e))}_renderItem(e,t,i,s){return O(u,{activeItem:this._activeItem,canMove:this._canMove,css:h,displayMode:R,dragEnabled:!t&&this.dragEnabled,item:e,key:`layerListItem-${e.layer?.uid}`,layerTablesEnabled:this.layerTablesEnabled,listModeDisabled:this.viewModel.listModeDisabled,messages:this.messages,messagesCommon:this.messagesCommon,parent:i,parentTitles:s,rootGroupUid:this._rootGroupUid,selectedDragItemLayerUid:this._selectedDragItemLayerUid,selectedItems:this.selectedItems,selectionMode:this.selectionMode,visibilityAppearance:this.visibilityAppearance,visibleElements:this.visibleElements,onAction:this._onTriggerAction,onCatalogOpen:this._onCatalogOpen,onPanelOpen:this._onPanelOpen,onSelectedDragItemLayerUidChange:this._onSelectedDragItemLayerUidChange,onTablesOpen:this._onTablesOpen,onTooltipReferenceChange:this._onTooltipReferenceChange})}_moveLayerFromChildList({toEl:e,fromEl:t,dragEl:i,newIndex:s}){const o=g(i),r=g(e),l=g(t),n=D(t),a=D(e);n&&a&&this.viewModel.moveListItem({targetItem:o,fromParentItem:l,toParentItem:r,newIndex:s,from:n,to:a})}_handleCalciteListDragEnd(e){const{fromEl:t,dragEl:i,oldIndex:s}=e;t.insertBefore(i,t.children[s])}_sortLayers(e,t){if(e)if(e===this._referenceListEl||e===this._baseListEl){const i=e===this._referenceListEl?"reference":"base",s="base"===i?this.view?.map?.basemap?.baseLayers:"reference"===i?this.view?.map?.basemap?.referenceLayers:null;v(s,t)}else{const i=g(e);if(!i)return;I(i,t)}}_handleCalciteListChange(e){const{selectionMode:t,selectedItems:i}=this;if("none"===t)return;const s=e.target.selectedItems.map((e=>g(e))).filter(Boolean);i.removeAll(),i.addMany(s)}_renderEditingInput(){const{messages:e}=this,{basemapTitle:t}=this.viewModel;return O("div",{class:h.editing},O("calcite-label",null,e.basemapTitle,O("calcite-input",{afterCreate:e=>this._editTitleInput=e,label:e.basemapTitle,name:"basemaptitle",pattern:B,placeholder:e.basemapTitle,required:!0,title:e.basemapTitle,type:"text",value:t??void 0})))}_renderCancelButton(){const{messagesCommon:{cancel:e}}=this;return O("calcite-button",{appearance:"outline",bind:this,label:e,onclick:this._toggleEditingTitle,slot:"footer",title:e,width:"full"},e)}_renderSubmitButton(){const{messagesCommon:e}=this;return O("calcite-button",{label:e.form.submit,slot:"footer",title:e.form.submit,type:"submit",width:"full"},e.form.ok)}_renderEditingForm(){return this.editingTitle?O("form",{bind:this,class:h.editingForm,onsubmit:this._formSubmit},O("calcite-flow-item",{afterCreate:this._focusEditingFlowItemNode,afterUpdate:this._focusEditingFlowItemNode,bind:this,heading:this.visibleElements.heading?this.messages.basemapTitle:void 0,headingLevel:this.headingLevel,selected:0===this.openedLayers.length&&0===this._openedPanelItems.length,onCalciteFlowItemBack:e=>{e.preventDefault(),this._toggleEditingTitle()}},this._renderEditingInput(),this._renderCancelButton(),this._renderSubmitButton())):null}_renderEditTitleButton(){const{editingTitle:e,visibleElements:t,messagesCommon:i}=this,s=i.edit;return t.editTitleButton&&!e?O("calcite-action",{bind:this,icon:"pencil",onclick:this._toggleEditingTitle,slot:"header-actions-end",text:s,title:s}):null}_renderNoLayersInfoMessage(e){return O("div",{slot:"message"},e)}_renderNoLayersInfo(e,t){return O("div",{class:h.itemMessage},O("calcite-notice",{icon:"information",key:t,kind:"info",open:!0,width:"full"},this._renderNoLayersInfoMessage(e)))}_renderItems(){const{collapsed:e,visible:t,visibleElements:{closeButton:i,collapseButton:s,heading:o,flow:r},messages:l,viewModel:n}=this,a=[O("calcite-flow-item",{afterCreate:this._focusRootFlowItemNode,afterUpdate:this._focusRootFlowItemNode,bind:this,closable:i,closed:!t,collapsed:e,collapsible:s,heading:o?n.basemapTitle??l.widgetLabel:void 0,headingLevel:this.headingLevel,key:"root-flow-item",selected:!this.editingTitle&&0===this.openedLayers.length&&0===this._openedPanelItems.length,onCalciteFlowItemClose:()=>this.visible=!1},this._renderEditTitleButton(),this._renderReferenceSection(),this._renderBaseSection()),this._renderEditingForm(),this._renderPanelFlowItems(),this._renderedOpenLayerFlowItems];return t?[r?O("calcite-flow",{key:"root-flow"},a):a,this._renderItemTooltips()]:null}_renderLayerFlowItem(e,t){const{messages:i,openedLayers:s}=this,o=e.title||this.messages.untitledLayer;return O("calcite-flow-item",{afterCreate:this._focusLayerFlowItemNode,afterUpdate:this._focusLayerFlowItemNode,bind:this,"data-layer-uid":e.uid,description:o,heading:i["catalog"===e.type?"catalogLayers":"tables"],headingLevel:this.headingLevel,key:`flow-layer-list-${e.uid}`,selected:t,onCalciteFlowItemBack:e=>{e.preventDefault(),s.pop();const t=s.at(-1);t?this._focusLayerFlowItem=t.uid:this._focusRootFlowItem=!0}},this._layerListMap.get(e)?.render())}_renderList(e,t,i){const{messages:s,dragEnabled:o,selectionMode:r,filterPlaceholder:l,baseFilterText:n,referenceFilterText:a,_baseFilterEnabled:c,_referenceFilterEnabled:d,_rootGroupUid:p}=this,m="reference"===t?s.noReferenceLayers:s.noBaseLayers,u="reference"===t?d:c;return O("calcite-block",{class:h.section,collapsible:!0,heading:"reference"===t?s.referenceHeading:s.baseHeading,headingLevel:E(this.headingLevel),key:`block-${t}`,open:!0},0===e?.length?this._renderNoLayersInfo(m,t):null,O("calcite-list",{afterCreate:e=>{"reference"===t?this._referenceListEl=e:this._baseListEl=e,e.addEventListener("focusin",this._setActiveItem),e.addEventListener("focusout",this._clearActiveItem)},afterRemoved:e=>{"reference"===t?this._referenceListEl=null:this._baseListEl=null,e.removeEventListener("focusin",this._setActiveItem),e.removeEventListener("focusout",this._clearActiveItem)},canPull:e=>this._canMove(e,"pull"),canPut:e=>this._canMove(e,"put"),displayMode:R,filterProps:C,[k]:t,"data-layer-type":p,dragEnabled:o,filterEnabled:u,filterPlaceholder:l,filterText:u?"reference"===t?a:n:"",group:p,key:`list-${t}`,label:s.widgetLabel,onmouseleave:this._clearActiveItem,onmouseover:this._setActiveItem,selectionAppearance:"border",selectionMode:r,onCalciteListChange:e=>this._handleCalciteListChange(e),onCalciteListDragEnd:e=>this._handleCalciteListDragEnd(e.detail),onCalciteListFilter:e=>this["reference"===t?"referenceFilterText":"baseFilterText"]=e.currentTarget?.filterText??"",onCalciteListOrderChange:e=>this._onCalciteListOrderChange(e.detail)},e?.toArray().map((e=>this._renderItem(e,i))),e?.length&&u?O("div",{class:h.filterNoResults,slot:"filter-no-results"},O("calcite-notice",{kind:"info",open:!0,width:"full"},this._renderNoLayersInfoMessage(m))):null))}_renderBaseSection(){const{_visibleBaseItems:e}=this;return this.visibleElements.baseLayers?this._renderList(e,"base",1===e?.length):null}_renderReferenceSection(){return this.visibleElements.referenceLayers?this._renderList(this._visibleReferenceItems,"reference",!1):null}_toggleEditingTitle(){const{editingTitle:e}=this,t=!e;this.editingTitle=t,t?this._focusEditingFlowItem=!0:this._focusRootFlowItem=!0}_formSubmit(e){e.preventDefault();const t=this._editTitleInput?.value;t?.trim()&&(this.basemapTitle=t),this._toggleEditingTitle()}};function D(e){return e?.closest(`[${k}]`)?.getAttribute(k)}e([a()],j.prototype,"_baseListEl",void 0),e([a()],j.prototype,"_referenceListEl",void 0),e([a()],j.prototype,"_activeItem",void 0),e([a()],j.prototype,"_tooltipReferenceMap",void 0),e([a()],j.prototype,"_focusRootFlowItem",void 0),e([a()],j.prototype,"_focusPanelFlowItem",void 0),e([a()],j.prototype,"_focusLayerFlowItem",void 0),e([a()],j.prototype,"_focusEditingFlowItem",void 0),e([a()],j.prototype,"_layerListMap",void 0),e([a()],j.prototype,"_visibleBaseItems",null),e([a()],j.prototype,"_visibleReferenceItems",null),e([a()],j.prototype,"_openedPanelItems",null),e([a()],j.prototype,"_totalBaseItems",null),e([a()],j.prototype,"_totalReferenceItems",null),e([a()],j.prototype,"_baseFilterEnabled",null),e([a()],j.prototype,"_referenceFilterEnabled",null),e([a()],j.prototype,"_renderedOpenLayerFlowItems",null),e([a()],j.prototype,"basemapTitle",null),e([a({readOnly:!0})],j.prototype,"catalogLayerList",void 0),e([a()],j.prototype,"catalogOptions",void 0),e([a()],j.prototype,"collapsed",void 0),e([a()],j.prototype,"dragEnabled",void 0),e([a()],j.prototype,"editingTitle",void 0),e([a()],j.prototype,"filterPlaceholder",void 0),e([a()],j.prototype,"baseFilterPredicate",void 0),e([a()],j.prototype,"baseFilterText",void 0),e([a()],j.prototype,"referenceFilterPredicate",void 0),e([a()],j.prototype,"referenceFilterText",void 0),e([a()],j.prototype,"listItemCanGiveFunction",void 0),e([a()],j.prototype,"listItemCanReceiveFunction",void 0),e([a()],j.prototype,"baseListItemCreatedFunction",null),e([a()],j.prototype,"headingLevel",void 0),e([a()],j.prototype,"icon",null),e([a()],j.prototype,"knowledgeGraphOptions",void 0),e([a()],j.prototype,"label",null),e([a()],j.prototype,"layerTablesEnabled",void 0),e([a()],j.prototype,"mapImageOptions",void 0),e([a(),M("esri/widgets/BasemapLayerList/t9n/BasemapLayerList")],j.prototype,"messages",void 0),e([a(),M("esri/t9n/common")],j.prototype,"messagesCommon",void 0),e([a()],j.prototype,"minFilterItems",void 0),e([a({readOnly:!0})],j.prototype,"openedLayers",void 0),e([a({readOnly:!0})],j.prototype,"openedLayerLists",void 0),e([a()],j.prototype,"referenceListItemCreatedFunction",null),e([a({readOnly:!0})],j.prototype,"tableList",void 0),e([a({readOnly:!0})],j.prototype,"baseItems",null),e([a({readOnly:!0})],j.prototype,"referenceItems",null),e([a({type:A})],j.prototype,"selectedItems",void 0),e([a()],j.prototype,"selectionMode",void 0),e([a()],j.prototype,"tileOptions",void 0),e([a()],j.prototype,"view",null),e([P("trigger-action"),a({type:p})],j.prototype,"viewModel",void 0),e([a()],j.prototype,"visibilityAppearance",void 0),e([a({type:m,nonNullable:!0})],j.prototype,"visibleElements",void 0),j=e([c("esri.widgets.BasemapLayerList")],j);const x=j;export{x as default};
5
+ import{_ as e}from"../chunks/tslib.es6.js";import t from"../core/Collection.js";import i from"../core/Identifiable.js";import s from"../core/ReactiveMap.js";import{on as o,watch as r,initial as l,syncAndInitial as n}from"../core/reactiveUtils.js";import{property as a}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{subclass as c}from"../core/accessorSupport/decorators/subclass.js";import d from"./Widget.js";import p from"./BasemapLayerList/BasemapLayerListViewModel.js";import m from"./BasemapLayerList/BasemapLayerListVisibleElements.js";import{css as h}from"./BasemapLayerList/css.js";import u from"./LayerList/LayerListItem.js";import f from"./LayerList/ListItem.js";import{minFilterItems as y,getItem as g,getLayerType as _,removeDestroyedListItems as b,setFilterPredicate as L,sortLayersToIds as v,sortChildLayersToIds as I}from"./LayerList/support/layerListUtils.js";import{loadCalciteComponents as w}from"./support/componentsUtils.js";import{globalCss as F}from"./support/globalCss.js";import{incrementHeadingLevel as E}from"./support/Heading.js";import{calciteListFilterProps as C}from"./support/listUtils.js";import{setFocus as T}from"./support/widgetUtils.js";import{messageBundle as M}from"./support/decorators/messageBundle.js";import{vmEvent as P}from"./support/decorators/vmEvent.js";import{tsx as O}from"./support/jsxFactory.js";const A=t.ofType(f),R="nested",B=".*\\S+.*",k="data-basemap-layer-type";let j=class extends(i.IdentifiableMixin(d)){constructor(e,i){super(e,i),this._baseListEl=null,this._referenceListEl=null,this._activeItem=null,this._tooltipReferenceMap=new Map,this._editTitleInput=null,this._focusRootFlowItem=!1,this._focusPanelFlowItem=!1,this._focusLayerFlowItem=null,this._focusEditingFlowItem=!1,this._layerListMap=new s,this._lastDragDetail=null,this._selectedDragItemLayerUid=null,this._rootGroupUid=`basemap-${this.uid}`,this._openedLayersController=null,this.catalogLayerList=null,this.catalogOptions=null,this.collapsed=!1,this.dragEnabled=!1,this.editingTitle=!1,this.filterPlaceholder="",this.baseFilterPredicate=null,this.baseFilterText="",this.referenceFilterPredicate=null,this.referenceFilterText="",this.listItemCanGiveFunction=null,this.listItemCanReceiveFunction=null,this.headingLevel=2,this.knowledgeGraphOptions=null,this.layerTablesEnabled=new t(["knowledge-graph"]),this.mapImageOptions=null,this.messages=null,this.messagesCommon=null,this.minFilterItems=y,this.openedLayers=new t,this.openedLayerLists=new t,this.tableList=null,this.selectedItems=new A,this.selectionMode="none",this.tileOptions=null,this.viewModel=new p,this.visibilityAppearance="default",this.visibleElements=new m,this._canMove=({dragEl:e,fromEl:t,toEl:i},s)=>{const o="pull"===s?this.listItemCanGiveFunction:this.listItemCanReceiveFunction,r=g(e);if(!r?.sortable)return!1;const l=g(t),n=_(t),a=g(i),c=_(i),d=!!n&&!!c&&n===c,p={selected:r,from:l,to:a},m=t.group,h=i.group,u=l?.layer?.type??"",f=a?.layer?.type??"",y=new Set(["map-image","catalog","knowledge-graph"]),b="sublayer";return m&&h&&"function"==typeof o?o.call(null,p):d&&!y.has(u)&&!y.has(f)&&r?.layer?.type!==b},this._onSelectedDragItemLayerUidChange=e=>{this._selectedDragItemLayerUid=e},this._onTriggerAction=(e,t)=>{this.triggerAction(e,t)},this._onTooltipReferenceChange=(e,t)=>{t?this._tooltipReferenceMap.set(e,t):this._tooltipReferenceMap.delete(e)},this._onTablesOpen=e=>{this.openedLayers.push(e.layer),this._focusLayerFlowItem=e.layer?.uid},this._onPanelOpen=()=>{this._focusPanelFlowItem=!0},this._onCatalogOpen=e=>{this.openedLayers.push(e.layer?.parent),this._focusLayerFlowItem=e.layer?.uid},this._clearActiveItem=()=>{this._activeItem=null},this._setActiveItem=e=>{if("default"!==this.visibilityAppearance)return;const t=Array.from(e.composedPath()).find((e=>e.classList?.contains(h.item)));this._activeItem=g(t)},this._onCalciteListOrderChange=e=>{const{_lastDragDetail:t}=this,{toEl:i,fromEl:s,dragEl:o,newIndex:r}=e;if(!s||!i||t?.newIndex===r&&t?.dragEl===o&&t?.toEl===i&&t?.fromEl===s)return;this._lastDragDetail=e,this._selectedDragItemLayerUid=o.value;const l=s,n=i;if(l!==n)this._moveLayerFromChildList({toEl:n,fromEl:l,dragEl:o,newIndex:r});else{const e=Array.from(s.children).filter((e=>e?.matches("calcite-list-item"))).map((e=>e.value));this._sortLayers(l,e)}}}initialize(){this.addHandles([o((()=>this.openedLayers),"change",(()=>this._handleOpenedLayersChange()),l),r((()=>[this.viewModel.referenceItems.toArray(),this.viewModel.baseItems.toArray()]),(()=>b(this.selectedItems)),n),r((()=>[this.baseFilterPredicate,this._baseListEl]),(()=>L(this._baseListEl,this.baseFilterPredicate))),r((()=>[this.referenceFilterPredicate,this._referenceListEl]),(()=>L(this._referenceListEl,this.referenceFilterPredicate)))])}loadDependencies(){return w({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),block:()=>import("@esri/calcite-components/dist/components/calcite-block"),label:()=>import("@esri/calcite-components/dist/components/calcite-label"),input:()=>import("@esri/calcite-components/dist/components/calcite-input"),button:()=>import("@esri/calcite-components/dist/components/calcite-button"),flow:()=>import("@esri/calcite-components/dist/components/calcite-flow"),"flow-item":()=>import("@esri/calcite-components/dist/components/calcite-flow-item"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice"),tooltip:()=>import("@esri/calcite-components/dist/components/calcite-tooltip")})}destroy(){this._tooltipReferenceMap.clear(),this._destroyOpenedLayerLists()}get _visibleBaseItems(){return this.baseItems?.filter((e=>!e.hidden&&(this.visibleElements.errors||!e.error)))}get _visibleReferenceItems(){return this.referenceItems?.filter((e=>!e.hidden&&(this.visibleElements.errors||!e.error)))}get _openedPanelItems(){return this._visibleReferenceItems.concat(this._visibleBaseItems).flatten((e=>e.children)).filter((({hidden:e,panel:t})=>!e&&t?.open&&!t.disabled&&t.flowEnabled))}get _totalBaseItems(){return this.viewModel.baseItems.flatten((e=>e.children.filter((e=>"catalog-dynamic-group"!==e.layer?.type)))).length}get _totalReferenceItems(){return this.viewModel.referenceItems.flatten((e=>e.children.filter((e=>"catalog-dynamic-group"!==e.layer?.type)))).length}get _baseFilterEnabled(){return this._totalBaseItems>=this.minFilterItems&&this.visibleElements.filter}get _referenceFilterEnabled(){return this._totalReferenceItems>=this.minFilterItems&&this.visibleElements.filter}get _renderedOpenLayerFlowItems(){const{openedLayers:e}=this;return e.toArray().map(((t,i)=>this._renderLayerFlowItem(t,i===e.length-1)))}get basemapTitle(){return this.viewModel.basemapTitle}set basemapTitle(e){this.viewModel.basemapTitle=e}get baseListItemCreatedFunction(){return this.viewModel.baseListItemCreatedFunction}set baseListItemCreatedFunction(e){this.viewModel.baseListItemCreatedFunction=e}get icon(){return"layers"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get referenceListItemCreatedFunction(){return this.viewModel.referenceListItemCreatedFunction}set referenceListItemCreatedFunction(e){this.viewModel.referenceListItemCreatedFunction=e}get baseItems(){return this.viewModel.baseItems}get referenceItems(){return this.viewModel.referenceItems}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}triggerAction(e,t){return this.viewModel.triggerAction(e,t)}render(){const{state:e}=this.viewModel,t={[F.hidden]:"loading"===e,[F.disabled]:"disabled"===e};return O("div",{class:this.classes(h.base,F.widget,F.panel,t)},this._renderItems())}async _createCatalogLayerList(e){const{default:t}=await import("./CatalogLayerList.js"),{headingLevel:i,catalogOptions:s,view:o,filterPlaceholder:r,minFilterItems:l,selectionMode:n,visibilityAppearance:a,_onCatalogOpen:c,_onTablesOpen:d,layerTablesEnabled:p}=this;return new t({headingLevel:i,view:o,filterPlaceholder:r,minFilterItems:l,selectionMode:n,visibilityAppearance:a,...s,catalogLayer:e,layerTablesEnabled:p,onCatalogOpen:c,onTablesOpen:d})}_getTableListParams(e){switch(e.type){case"knowledge-graph":return{...this.knowledgeGraphOptions,tables:e.tables};case"map-image":return{...this.mapImageOptions,tables:e.subtables};case"tile":return{...this.tileOptions,tables:e.subtables};default:return null}}async _createTableList(e){const{default:t}=await import("./TableList.js"),{headingLevel:i,selectionMode:s,dragEnabled:o}=this;return new t({headingLevel:i,selectionMode:s,dragEnabled:o,...this._getTableListParams(e)})}async _createFlowList(e,t){const{_layerListMap:i}=this,s=i.get(e);if(s)return s;const o="catalog"===e.type?await this._createCatalogLayerList(e):await this._createTableList(e);return t.aborted||i.set(e,o),o}async _handleOpenedLayersChange(){const{_layerListMap:e,openedLayers:t,openedLayerLists:i}=this;this._openedLayersController?.abort();const s=new AbortController,{signal:o}=s;this._openedLayersController=s,e.forEach(((i,s)=>{t.includes(s)||(i.destroy(),e.delete(s))}));const r=await Promise.all(t.map((e=>this._createFlowList(e,o))));if(o.aborted)return;i.removeAll(),i.addMany(r);const l=i.at(-1);l?"catalogLayer"in l?(this._set("catalogLayerList",l),this._set("tableList",null)):(this._set("catalogLayerList",null),this._set("tableList",l)):(this._set("catalogLayerList",null),this._set("tableList",null))}_destroyOpenedLayerLists(){this.openedLayerLists.destroyAll(),this.openedLayers.removeAll(),this._layerListMap.clear()}_renderItemTooltip(e){return e?O("calcite-tooltip",{key:`tooltip-${e.layer?.uid}`,overlayPositioning:"fixed",referenceElement:this._tooltipReferenceMap.get(e.layer?.uid)},this.messages.layerIncompatibleTooltip):null}_renderItemTooltipNodes(e){return e.incompatible?this._renderItemTooltip(e):e.children?.filter((e=>!e.hidden)).toArray().map((e=>this._renderItemTooltipNodes(e)))}_renderItemTooltips(){return this._visibleReferenceItems.concat(this._visibleBaseItems)?.toArray().map((e=>this._renderItemTooltipNodes(e)))}_focusLayerFlowItemNode(e){this._focusLayerFlowItem===e.dataset.layerUid&&(this._focusLayerFlowItem=null,T(e))}_renderPanelFlowItems(){const{_openedPanelItems:e,openedLayers:t}=this;return e.toArray().map((({title:i,panel:s},o)=>{const r=()=>this._handlePanelFlowItemBack(s);return O("calcite-flow-item",{afterCreate:this._focusPanelFlowItemNode,afterUpdate:this._focusPanelFlowItemNode,bind:this,description:i,heading:s.title,headingLevel:this.headingLevel,key:`flow-panel-${s.uid}`,selected:!t.length&&o===e.length-1,onCalciteFlowItemBack:e=>{e.preventDefault(),r()}},s.render(),O("calcite-button",{appearance:"transparent",onclick:r,slot:"footer-actions",width:"full"},this.messagesCommon.back))}))}_handlePanelFlowItemBack(e){e.open=!1,this._focusRootFlowItem=!0}_focusEditingFlowItemNode(e){this._focusEditingFlowItem&&(this._focusEditingFlowItem=!1,T(e))}_focusRootFlowItemNode(e){this._focusRootFlowItem&&(this._focusRootFlowItem=!1,T(e))}_focusPanelFlowItemNode(e){this._focusPanelFlowItem&&(this._focusPanelFlowItem=!1,T(e))}_renderItem(e,t,i,s){return O(u,{activeItem:this._activeItem,canMove:this._canMove,css:h,displayMode:R,dragEnabled:!t&&this.dragEnabled,item:e,key:`layerListItem-${e.layer?.uid}`,layerTablesEnabled:this.layerTablesEnabled,listModeDisabled:this.viewModel.listModeDisabled,messages:this.messages,messagesCommon:this.messagesCommon,parent:i,parentTitles:s,rootGroupUid:this._rootGroupUid,selectedDragItemLayerUid:this._selectedDragItemLayerUid,selectedItems:this.selectedItems,selectionMode:this.selectionMode,visibilityAppearance:this.visibilityAppearance,visibleElements:this.visibleElements,onAction:this._onTriggerAction,onCatalogOpen:this._onCatalogOpen,onPanelOpen:this._onPanelOpen,onSelectedDragItemLayerUidChange:this._onSelectedDragItemLayerUidChange,onTablesOpen:this._onTablesOpen,onTooltipReferenceChange:this._onTooltipReferenceChange})}_moveLayerFromChildList({toEl:e,fromEl:t,dragEl:i,newIndex:s}){const o=g(i),r=g(e),l=g(t),n=x(t),a=x(e);n&&a&&this.viewModel.moveListItem({targetItem:o,fromParentItem:l,toParentItem:r,newIndex:s,from:n,to:a})}_handleCalciteListDragEnd(e){const{fromEl:t,dragEl:i,oldIndex:s}=e;t.insertBefore(i,t.children[s])}_sortLayers(e,t){if(e)if(e===this._referenceListEl||e===this._baseListEl){const i=e===this._referenceListEl?"reference":"base",s="base"===i?this.view?.map?.basemap?.baseLayers:"reference"===i?this.view?.map?.basemap?.referenceLayers:null;v(s,t)}else{const i=g(e);if(!i)return;I(i,t)}}_handleCalciteListChange(e){const{selectionMode:t,selectedItems:i}=this;if("none"===t)return;const s=e.target.selectedItems.map((e=>g(e))).filter(Boolean);i.removeAll(),i.addMany(s)}_renderEditingInput(){const{messages:e}=this,{basemapTitle:t}=this.viewModel;return O("div",{class:h.editing},O("calcite-label",null,e.basemapTitle,O("calcite-input",{afterCreate:e=>this._editTitleInput=e,label:e.basemapTitle,name:"basemaptitle",pattern:B,placeholder:e.basemapTitle,required:!0,title:e.basemapTitle,type:"text",value:t??void 0})))}_renderCancelButton(){const{messagesCommon:{cancel:e}}=this;return O("calcite-button",{appearance:"outline",bind:this,label:e,onclick:this._toggleEditingTitle,slot:"footer",title:e,width:"full"},e)}_renderSubmitButton(){const{messagesCommon:e}=this;return O("calcite-button",{label:e.form.submit,slot:"footer",title:e.form.submit,type:"submit",width:"full"},e.form.ok)}_renderEditingForm(){return this.editingTitle?O("form",{bind:this,class:h.editingForm,onsubmit:this._formSubmit},O("calcite-flow-item",{afterCreate:this._focusEditingFlowItemNode,afterUpdate:this._focusEditingFlowItemNode,bind:this,heading:this.visibleElements.heading?this.messages.basemapTitle:void 0,headingLevel:this.headingLevel,selected:0===this.openedLayers.length&&0===this._openedPanelItems.length,onCalciteFlowItemBack:e=>{e.preventDefault(),this._toggleEditingTitle()}},this._renderEditingInput(),this._renderCancelButton(),this._renderSubmitButton())):null}_renderEditTitleButton(){const{editingTitle:e,visibleElements:t,messagesCommon:i}=this,s=i.edit;return t.editTitleButton&&!e?O("calcite-action",{bind:this,icon:"pencil",onclick:this._toggleEditingTitle,slot:"header-actions-end",text:s,title:s}):null}_renderNoLayersInfoMessage(e){return O("div",{slot:"message"},e)}_renderNoLayersInfo(e,t){return O("div",{class:h.itemMessage},O("calcite-notice",{icon:"information",key:t,kind:"info",open:!0,width:"full"},this._renderNoLayersInfoMessage(e)))}_renderItems(){const{collapsed:e,visible:t,visibleElements:{closeButton:i,collapseButton:s,heading:o,flow:r},messages:l,viewModel:n}=this,a=[O("calcite-flow-item",{afterCreate:this._focusRootFlowItemNode,afterUpdate:this._focusRootFlowItemNode,bind:this,closable:i,closed:!t,collapsed:e,collapsible:s,heading:o?n.basemapTitle??l.widgetLabel:void 0,headingLevel:this.headingLevel,key:"root-flow-item",selected:!this.editingTitle&&0===this.openedLayers.length&&0===this._openedPanelItems.length,onCalciteFlowItemClose:()=>this.visible=!1},this._renderEditTitleButton(),this._renderReferenceSection(),this._renderBaseSection()),this._renderEditingForm(),this._renderPanelFlowItems(),this._renderedOpenLayerFlowItems];return t?[r?O("calcite-flow",{key:"root-flow"},a):a,this._renderItemTooltips()]:null}_renderLayerFlowItem(e,t){const{messages:i,openedLayers:s}=this,o=e.title||this.messages.untitledLayer;return O("calcite-flow-item",{afterCreate:this._focusLayerFlowItemNode,afterUpdate:this._focusLayerFlowItemNode,bind:this,"data-layer-uid":e.uid,description:o,heading:i["catalog"===e.type?"catalogLayers":"tables"],headingLevel:this.headingLevel,key:`flow-layer-list-${e.uid}`,selected:t,onCalciteFlowItemBack:e=>{e.preventDefault(),s.pop();const t=s.at(-1);t?this._focusLayerFlowItem=t.uid:this._focusRootFlowItem=!0}},this._layerListMap.get(e)?.render())}_renderList(e,t,i){const{messages:s,dragEnabled:o,selectionMode:r,filterPlaceholder:l,baseFilterText:n,referenceFilterText:a,_baseFilterEnabled:c,_referenceFilterEnabled:d,_rootGroupUid:p}=this,m="reference"===t?s.noReferenceLayers:s.noBaseLayers,u="reference"===t?d:c;return O("calcite-block",{class:h.section,collapsible:!0,expanded:!0,heading:"reference"===t?s.referenceHeading:s.baseHeading,headingLevel:E(this.headingLevel),key:`block-${t}`},0===e?.length?this._renderNoLayersInfo(m,t):null,O("calcite-list",{afterCreate:e=>{"reference"===t?this._referenceListEl=e:this._baseListEl=e,e.addEventListener("focusin",this._setActiveItem),e.addEventListener("focusout",this._clearActiveItem)},afterRemoved:e=>{"reference"===t?this._referenceListEl=null:this._baseListEl=null,e.removeEventListener("focusin",this._setActiveItem),e.removeEventListener("focusout",this._clearActiveItem)},canPull:e=>this._canMove(e,"pull"),canPut:e=>this._canMove(e,"put"),displayMode:R,filterProps:C,[k]:t,"data-layer-type":p,dragEnabled:o,filterEnabled:u,filterPlaceholder:l,filterText:u?"reference"===t?a:n:"",group:p,key:`list-${t}`,label:s.widgetLabel,onmouseleave:this._clearActiveItem,onmouseover:this._setActiveItem,selectionAppearance:"border",selectionMode:r,onCalciteListChange:e=>this._handleCalciteListChange(e),onCalciteListDragEnd:e=>this._handleCalciteListDragEnd(e.detail),onCalciteListFilter:e=>this["reference"===t?"referenceFilterText":"baseFilterText"]=e.currentTarget?.filterText??"",onCalciteListOrderChange:e=>this._onCalciteListOrderChange(e.detail)},e?.toArray().map((e=>this._renderItem(e,i))),e?.length&&u?O("div",{class:h.filterNoResults,slot:"filter-no-results"},O("calcite-notice",{kind:"info",open:!0,width:"full"},this._renderNoLayersInfoMessage(m))):null))}_renderBaseSection(){const{_visibleBaseItems:e}=this;return this.visibleElements.baseLayers?this._renderList(e,"base",1===e?.length):null}_renderReferenceSection(){return this.visibleElements.referenceLayers?this._renderList(this._visibleReferenceItems,"reference",!1):null}_toggleEditingTitle(){const{editingTitle:e}=this,t=!e;this.editingTitle=t,t?this._focusEditingFlowItem=!0:this._focusRootFlowItem=!0}_formSubmit(e){e.preventDefault();const t=this._editTitleInput?.value;t?.trim()&&(this.basemapTitle=t),this._toggleEditingTitle()}};function x(e){return e?.closest(`[${k}]`)?.getAttribute(k)}e([a()],j.prototype,"_baseListEl",void 0),e([a()],j.prototype,"_referenceListEl",void 0),e([a()],j.prototype,"_activeItem",void 0),e([a()],j.prototype,"_tooltipReferenceMap",void 0),e([a()],j.prototype,"_focusRootFlowItem",void 0),e([a()],j.prototype,"_focusPanelFlowItem",void 0),e([a()],j.prototype,"_focusLayerFlowItem",void 0),e([a()],j.prototype,"_focusEditingFlowItem",void 0),e([a()],j.prototype,"_layerListMap",void 0),e([a()],j.prototype,"_visibleBaseItems",null),e([a()],j.prototype,"_visibleReferenceItems",null),e([a()],j.prototype,"_openedPanelItems",null),e([a()],j.prototype,"_totalBaseItems",null),e([a()],j.prototype,"_totalReferenceItems",null),e([a()],j.prototype,"_baseFilterEnabled",null),e([a()],j.prototype,"_referenceFilterEnabled",null),e([a()],j.prototype,"_renderedOpenLayerFlowItems",null),e([a()],j.prototype,"basemapTitle",null),e([a({readOnly:!0})],j.prototype,"catalogLayerList",void 0),e([a()],j.prototype,"catalogOptions",void 0),e([a()],j.prototype,"collapsed",void 0),e([a()],j.prototype,"dragEnabled",void 0),e([a()],j.prototype,"editingTitle",void 0),e([a()],j.prototype,"filterPlaceholder",void 0),e([a()],j.prototype,"baseFilterPredicate",void 0),e([a()],j.prototype,"baseFilterText",void 0),e([a()],j.prototype,"referenceFilterPredicate",void 0),e([a()],j.prototype,"referenceFilterText",void 0),e([a()],j.prototype,"listItemCanGiveFunction",void 0),e([a()],j.prototype,"listItemCanReceiveFunction",void 0),e([a()],j.prototype,"baseListItemCreatedFunction",null),e([a()],j.prototype,"headingLevel",void 0),e([a()],j.prototype,"icon",null),e([a()],j.prototype,"knowledgeGraphOptions",void 0),e([a()],j.prototype,"label",null),e([a()],j.prototype,"layerTablesEnabled",void 0),e([a()],j.prototype,"mapImageOptions",void 0),e([a(),M("esri/widgets/BasemapLayerList/t9n/BasemapLayerList")],j.prototype,"messages",void 0),e([a(),M("esri/t9n/common")],j.prototype,"messagesCommon",void 0),e([a()],j.prototype,"minFilterItems",void 0),e([a({readOnly:!0})],j.prototype,"openedLayers",void 0),e([a({readOnly:!0})],j.prototype,"openedLayerLists",void 0),e([a()],j.prototype,"referenceListItemCreatedFunction",null),e([a({readOnly:!0})],j.prototype,"tableList",void 0),e([a({readOnly:!0})],j.prototype,"baseItems",null),e([a({readOnly:!0})],j.prototype,"referenceItems",null),e([a({type:A})],j.prototype,"selectedItems",void 0),e([a()],j.prototype,"selectionMode",void 0),e([a()],j.prototype,"tileOptions",void 0),e([a()],j.prototype,"view",null),e([P("trigger-action"),a({type:p})],j.prototype,"viewModel",void 0),e([a()],j.prototype,"visibilityAppearance",void 0),e([a({type:m,nonNullable:!0})],j.prototype,"visibleElements",void 0),j=e([c("esri.widgets.BasemapLayerList")],j);const D=j;export{D 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.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../chunks/tslib.es6.js";import"../intl.js";import"../core/has.js";import{abortHandle as t}from"../core/handleUtils.js";import{getOrCreateMapValue as i}from"../core/MapUtils.js";import{watch as n,whenOnce as o}from"../core/reactiveUtils.js";import{property as a}from"../core/accessorSupport/decorators/property.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{subclass as s}from"../core/accessorSupport/decorators/subclass.js";import{isIntegerField as r}from"../layers/support/fieldUtils.js";import{isString as l}from"../support/guards.js";import d from"./Widget.js";import{getHiddenFieldsValidationErrorMessage as p,getVisibleFieldInputValidationErrorMessage as u,isElementTemplateWithInputType as c}from"./BatchAttributeForm/batchAttributeFormUtils.js";import m from"./BatchAttributeForm/BatchAttributeFormViewModel.js";import{css as h}from"./BatchAttributeForm/css.js";import{VisibleElements as v}from"./BatchAttributeForm/VisibleElements.js";import{InputVisibilityCode as f,isGroupInput as b,isFieldInput as _,differentValuesString as C}from"./BatchAttributeForm/inputs/support/inputUtils.js";import{loadCalciteComponents as g}from"./support/componentsUtils.js";import{getLabelForDateFieldValue as I,getIntlOptionsForField as y,prepareISOFieldValueForDateComponents as F,prepareUnixFieldValueForDateComponents as w,normalizeTimeOnlyString as x,getISOFieldValueFromDateComponents as k,getUnixFieldValueFromDateComponents as D}from"./support/dateUtils.js";import{globalCss as O}from"./support/globalCss.js";import{setFocus as M}from"./support/widgetUtils.js";import{messageBundle as T}from"./support/decorators/messageBundle.js";import{vmEvent as V}from"./support/decorators/vmEvent.js";import{tsx as S}from"./support/jsxFactory.js";import{isEmptyValue as E}from"./support/forms/formUtils.js";import{substitute as U}from"../intl/substitute.js";const R="data-element-id";let L=class extends d{constructor(e,t){super(e,t),this.headingLevel=2,this.messagesCommon=null,this.messages=null,this.featureFormMessages=null,this.readOnly=!1,this.viewModel=new m,this.visibleElements=new v,this.groupDisplay="all",this._attemptFocusOnNextRender=!1,this._dateComponentMap=new Map,this._touchedInputs=new Set,this._focusedFieldInput=null,this._batchSwitchInputInitialValues=new Map,this._saveInput=this._saveInput.bind(this),this._onFormSubmit=this._onFormSubmit.bind(this),this._onComponentFocus=this._onComponentFocus.bind(this),this._onComponentBlur=this._onComponentBlur.bind(this),this._afterComponentCreateOrUpdate=this._afterComponentCreateOrUpdate.bind(this),this._afterDateComponentCreate=this._afterDateComponentCreate.bind(this),this._afterDateComponentUpdate=this._afterDateComponentUpdate.bind(this),this._afterRadioGroupCreateOrUpdate=this._afterRadioGroupCreateOrUpdate.bind(this)}initialize(){this.addHandles([n((()=>this.features),(()=>{this._dateComponentMap.clear();const e=new AbortController;o((()=>!this.viewModel.updating),e.signal).then((()=>{this._attemptFocusOnNextRender=!0})),this.addHandles(t(e))})),n((()=>this.viewModel.activeForm),(()=>{this._batchSwitchInputInitialValues.clear()}))])}loadDependencies(){return g({input:()=>import("@esri/calcite-components/dist/components/calcite-input"),block:()=>import("@esri/calcite-components/dist/components/calcite-block"),button:()=>import("@esri/calcite-components/dist/components/calcite-button"),combobox:()=>import("@esri/calcite-components/dist/components/calcite-combobox"),"combobox-item":()=>import("@esri/calcite-components/dist/components/calcite-combobox-item"),"combobox-item-group":()=>import("@esri/calcite-components/dist/components/calcite-combobox-item-group"),dropdown:()=>import("@esri/calcite-components/dist/components/calcite-dropdown"),"dropdown-group":()=>import("@esri/calcite-components/dist/components/calcite-dropdown-group"),"dropdown-item":()=>import("@esri/calcite-components/dist/components/calcite-dropdown-item"),"input-date-picker":()=>import("@esri/calcite-components/dist/components/calcite-input-date-picker"),"input-number":()=>import("@esri/calcite-components/dist/components/calcite-input-number"),"input-time-picker":()=>import("@esri/calcite-components/dist/components/calcite-input-time-picker"),"input-time-zone":()=>import("@esri/calcite-components/dist/components/calcite-input-time-zone"),label:()=>import("@esri/calcite-components/dist/components/calcite-label"),"input-message":()=>import("@esri/calcite-components/dist/components/calcite-input-message"),loader:()=>import("@esri/calcite-components/dist/components/calcite-loader"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice"),switch:()=>import("@esri/calcite-components/dist/components/calcite-switch"),"text-area":()=>import("@esri/calcite-components/dist/components/calcite-text-area"),"radio-button":()=>import("@esri/calcite-components/dist/components/calcite-radio-button"),"radio-button-group":()=>import("@esri/calcite-components/dist/components/calcite-radio-button-group")})}get activeFeatureIndex(){return this.viewModel.activeFeatureIndex}set activeFeatureIndex(e){this.viewModel.activeFeatureIndex=e}get disabled(){return this.viewModel.disabled}set disabled(e){this.viewModel.disabled=e}get _effectiveDisabled(){return this.disabled||this.viewModel.updating}get features(){return this.viewModel.features}set features(e){this.viewModel.features=e}get map(){return this.viewModel.map}set map(e){this.viewModel.map=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 icon(){return"edit-attributes"}set icon(e){this._overrideIfSome("icon",e)}goToClosestError(){const e=this.viewModel.getFirstVisibleInvalidFieldInput();if(!e)return;const{groupInput:t}=e;t&&(t.open||(t.open=!0)),setTimeout((()=>{if(!this.domNode)return;const t=this.domNode.querySelector(`[data-element-id="${e.input.template.elementId}"]`);t&&M(t)}),10)}render(){const{status:e}=this.viewModel;return"failed"===e?this._renderErrorNotice(this.messages.formFailedToLoad):this.viewModel.expressionEvaluationFailed?this._renderErrorNotice(this.messages.expressionEvaluationFailed):this.viewModel.hasLayersWithContingentValues?this._renderErrorNotice(this.messages.unsupportedContingentValues):S("div",{class:this.classes(h.base,O.widget,O.panel)},"loaded"===e?this._renderForm():"loading"===e?S("calcite-loader",{key:"loader",label:this.messagesCommon?.loading}):null)}_setDateTimeTimeZoneMap(e){const{datePart:t,elementId:n}=e.dataset,o=this._getCalciteElementFromDateTimeTimeZonePicker(e,t);if(!o)return;const a=i(this._dateComponentMap,`${n}`,(()=>({placeholder:{date:"",time:"",timeZone:""}})));switch(a.placeholder[t]=o.placeholder??"",t){case"date":a.date=e;break;case"time":a.time=e;break;case"timeZone":a.timeZone=e,a.defaultComboboxItemElements=o.selectedItems}"timeZone"===t&&(a.defaultComboboxItemElements=o.selectedItems)}_getCalciteElementFromDateTimeTimeZonePicker(e,t){const i=e.shadowRoot;return i?"timeZone"===t?i.querySelector("calcite-combobox"):i.querySelector("calcite-input-text"):null}_updateDateTimeOrTimeZoneShadowDom(e,t){const{datePart:i,elementId:n}=e.dataset,o=this._dateComponentMap.get(`${n}`);if(!o)return;const a=this._getCalciteElementFromDateTimeTimeZonePicker(e,i);if(a)switch(i){case"date":case"time":a.placeholder=t?this.messages.differentValues:o.placeholder[i];break;case"timeZone":t?(a.value="",a.placeholder=this.messages.differentValues):(!a.selectedItems.length&&o.defaultComboboxItemElements?.length&&(a.selectedItems[0]=o.defaultComboboxItemElements[0]),a.placeholder=o.placeholder[i])}}_renderErrorNotice(e){return S("div",{class:this.classes(h.base,O.widget,O.panel)},S("calcite-notice",{class:h.noticeError,icon:!0,kind:"warning",open:!0},S("div",{slot:"message"},e)))}_renderForm(){return S("form",{onsubmit:this._onFormSubmit},this._renderInvisibleFieldsError(),this._renderContent())}_renderInvisibleFieldsError(){const{viewModel:e}=this,{hasNonActiveInvalidFeatures:t,activeForm:i}=e;let n;if(!e.submitHasBeenAttempted)return null;if(i.invalidHiddenInputs.length>0)if(n=p(i,e.mode,this.messages),"batch"===this.viewModel.mode){const e=i.invalidHiddenInputs.filter((e=>e.effectiveVisibilityCode===f.HIDDEN_GROUP_VISIBILITY_EXPRESSION_ALL||e.visibilityCode===f.HIDDEN_VISIBILITY_EXPRESSION_ALL));e.length>0?n+=` (${e.map((e=>e.label)).join(", ")})`:n=null}else n+=` (${i.invalidHiddenInputs.map((e=>e.label)).join(", ")})`;else if(t)return null;return n?S("calcite-notice",{class:h.noticeError,icon:!0,kind:"danger",open:!0},S("div",{slot:"message"},n)):null}_renderContent(){if(!this.viewModel.hasVisibleInputs)return[S("calcite-notice",{class:h.noticeError,icon:!0,kind:"warning",open:!0},S("div",{slot:"message"},this.messages.noVisibleFields[this.viewModel.noVisibleElementsReason]))];const{inputs:e}=this.viewModel.activeForm;return e.filter((e=>e.visible)).map((e=>this._renderInput(e)))}_renderInput(e){return b(e)?this._renderGroupInput(e):_(e)?this._renderLabeledField(e):void 0}_renderGroupInput(e){const{inputs:t,template:i,open:n}=e,o=t.filter((e=>e.visible)),a=i.label??"";return S("calcite-block",{class:this.classes(h.group,"sequential"===this.groupDisplay?h.groupSequential:null,this.disabled?h.inputDisabled:null),collapsible:!0,description:i.description??void 0,disabled:this._effectiveDisabled,heading:a,headingLevel:this.headingLevel,key:`{${i.elementId}-key}`,label:a,open:n,onCalciteBlockClose:()=>{e.open=!1},onCalciteBlockOpen:()=>{e.open=!0}},o.map((e=>this._renderInput(e))))}_renderLabeledField(e){const{label:t,elementId:i}=e.template,{required:n,dataType:o}=e,a=n?U(this.messages.requiredFieldLabel,{name:t}):t;return S("calcite-label",{"aria-label":a,class:h.label,key:`field--${i}`},S("div",{class:h.labelTextContent,key:"labelTextContainer"},t,n?S("span",{"aria-hidden":"true",title:this.messagesCommon.required},"*"):void 0),"unsupported"!==o?this._renderFieldInput(e):this._renderReadOnlyComponent(e),this._renderAuxiliaryText(e))}_renderFieldInput(e){const t=this.getCommonInputProps(e),{dataType:i}=e;return"date"===i?this._renderDateComponents(e,t):"coded-value"===e.domain?.type?this._renderCodedInputs({input:e,props:t}):"number"===i?this._renderNumberComponent(e,t):this._renderStringComponent(e,t)}_renderAuxiliaryText(e){const{compositeError:t,description:i,submittable:n}=e,o=!n&&t&&(this.viewModel.submitHasBeenAttempted||this._touchedInputs.has(e.template.elementId))?u(e,t,this.messages):null;return o?S("calcite-input-message",{icon:!0,status:"invalid"},o):i?S("calcite-input-message",{class:h.description,icon:!1,status:"idle"},i):null}_renderCodedInputs({input:e,props:t}){const i=e.template.input?.type??null,n=e.codedValueOptions;switch(i){case"switch":return this._renderSwitchField({input:e,props:t});case"radio-buttons":return this._renderRadioButtonGroupComponent({input:e,options:n.flat(),props:t});default:return this._renderComboBoxComponent({options:n,props:t,input:e})}}_renderSwitchField({input:e,props:t}){if((this._batchSwitchInputInitialValues.get(e)===C||e.value===C)&&"batch"===this.viewModel.mode){const i={dropdown:{afterCreate:this._afterComponentCreateOrUpdate,afterUpdate:this._afterComponentCreateOrUpdate,disabled:t.readOnly,open:!1,[R]:t[R]},trigger:{appearance:"transparent",iconEnd:"chevron-down",kind:"neutral",slot:"trigger",label:t.label},group:{mode:"single"}};return this._renderDropdownComponent({buttonValue:e.value,dropdownProps:i,options:[{name:this.messages.differentValues,value:C,disabled:!0},...e.codedValueDomainOptions]})}return this._renderSwitchComponent({input:e,props:t})}_renderSwitchComponent({input:e,props:t}){return S("calcite-switch",{...t,checked:!!c(e.template,"switch")&&e.value===e.template.input.onValue,class:h.inputSwitch,disabled:t.readOnly,onblur:()=>{this._focusedFieldInput=null},onCalciteSwitchChange:({currentTarget:e})=>this._saveInput(e)})}_renderDropdownComponent({buttonValue:e,options:t,dropdownProps:i}){const{trigger:n,dropdown:o,group:a}=i;return S("calcite-dropdown",{...o,onblur:()=>{this._focusedFieldInput=null},onfocus:this._onComponentFocus,onCalciteDropdownSelect:({currentTarget:e})=>this._saveInput(e)},S("calcite-button",{...n},e===C?this.messages.differentValues:e),S("calcite-dropdown-group",{selectionMode:a.mode},t.map((t=>S("calcite-dropdown-item",{disabled:t.disabled,label:String(t.name),selected:e===t.value},t.name)))))}_renderComboBoxComponent({input:e,options:t,props:i}){const n="INSERT"===this.viewModel.editType,o=this._touchedInputs.has(e?.template?.elementId),a=n&&e.showNoValueOptionEnabled&&!o?()=>{}:i.onblur,s={...i,onblur:a};return S("calcite-combobox",{...s,selectionMode:"single",value:i.placeholder===this.messages.differentValues?C:String(i.value),onCalciteComboboxChange:({currentTarget:e})=>{e.value!==C&&this._saveInput(e)}},this.renderComboboxOptionsList({input:e,options:t,props:i}))}renderComboboxOptionsList({input:e,options:t,props:i}){const[n,o]=t.map((e=>e.map((({name:e,value:t})=>S("calcite-combobox-item",{key:`#${t}`,selected:i.value===t,textLabel:e,value:`${t}`}))))),a=[...n];o.length>0&&a.push(S("calcite-combobox-item-group",{key:"unsupported",label:this.featureFormMessages.subtypes.unsupportedDomainGroupTitle},o));const s=i.placeholder===this.messages.differentValues,r=!s&&E(i.value);return e.showNoValueOptionEnabled&&a.unshift(S("calcite-combobox-item",{key:"empty-option",selected:r,textLabel:e.showNoValueLabel||this.messages.empty,value:""})),s&&a.unshift(S("calcite-combobox-item",{key:C,selected:!0,textLabel:this.messages.differentValues,value:C})),a}_renderRadioButtonGroupComponent({input:e,options:t,props:i}){const n=t.map((({name:t,value:n})=>this._renderRadioButtons({label:t,value:n,selected:n===e.value,props:i})));if(e.showNoValueOptionEnabled){const t="",o=e.showNoValueLabel||this.messages.empty,a=E(e.value);n.unshift(this._renderRadioButtons({label:o,value:t,selected:a,props:i}))}return S("calcite-radio-button-group",{afterCreate:this._afterRadioGroupCreateOrUpdate,afterUpdate:this._afterRadioGroupCreateOrUpdate,class:h.inputRadioGroup,disabled:i.readOnly,key:`${i.key}-radio-group`,layout:"vertical",name:i.name,required:i.required},n,i.placeholder===this.messages.differentValues?S("calcite-label",{class:h.placeholderRadio,key:i.label,layout:"inline"},S("calcite-radio-button",{checked:!0,class:h.inputRadio,disabled:!0,name:i.placeholder,value:i.placeholder}),i.placeholder):null)}_renderRadioButtons({value:e,selected:t,label:i,props:n}){return S("calcite-label",{class:h.inputRadioLabel,key:n.label,layout:"inline"},S("calcite-radio-button",{...n,afterCreate:void 0,afterUpdate:void 0,checked:t,class:h.inputRadio,disabled:n.readOnly,name:n.label,onblur:()=>{this._focusedFieldInput=null},value:e,onCalciteRadioButtonChange:({currentTarget:e})=>{e.checked&&this._saveInput(e)}}),i)}_renderStringComponent(e,t){const{template:i}=e;return i.field.editable?i.input&&"text-area"===i.input.type?S("calcite-text-area",{...t,class:this.classes(h.individualElement),resize:"vertical",value:t.value?String(t.value):"",onCalciteTextAreaInput:({currentTarget:e})=>this._saveInput(e)}):S("calcite-input",{...t,class:this.classes(h.individualElement),type:"text",value:t.value?String(t.value):"",onCalciteInputInput:({currentTarget:e})=>this._saveInput(e)}):this._renderReadOnlyComponent(e)}_renderNumberComponent(e,t){const i=r(e.field);return S("calcite-input-number",{...t,integer:i,type:"number",value:i&&""!==t.value?Math.round(parseFloat(String(t.value))).toString():String(t.value),onCalciteInputNumberInput:({currentTarget:e})=>this._saveInput(e)})}_renderReadOnlyComponent(e,t){const i=this.getCommonInputProps(e);return S("calcite-input",{...i,class:this.classes(h.fieldInput,h.inputDisabled,h.individualElement),readOnly:!0,type:"text",value:String(t??i.value??"")})}_renderDateComponents(e,t){const{type:i}=e.field;switch(i){case"date":return this._renderDateFieldComponents(e,t);case"date-only":return this._renderDateOnlyFieldComponent(e,t);case"time-only":return this._renderTimeOnlyFieldComponent(e,t);case"timestamp-offset":return this._renderTimestampOffsetFieldComponents(e,t);default:return this._renderReadOnlyComponent(e,I(e.field,t.value,{timeZone:e.effectiveTimeZone,...y(e.template.field)}))}}_renderDateOnlyFieldComponent(e,t){const{class:i,key:n,readOnly:o}=t,{rawMax:a,rawMin:s}=e.range;return S("calcite-input-date-picker",{afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterDateComponentUpdate,class:i,"data-date-part":"date","data-element-id":t[R],key:`${n}-date-input`,max:l(a)?a:void 0,min:l(s)?s:void 0,onblur:()=>{this._focusedFieldInput=null},onfocus:this._onComponentFocus,overlayPositioning:"fixed",readOnly:o,value:e.value===C?"":e.value?String(e.value):"",onCalciteInputDatePickerChange:t=>this._saveValueFromDateComponent(e,t.currentTarget)})}_renderTimeOnlyFieldComponent(e,t){const{class:i,key:n,readOnly:o}=t;return S("calcite-input-time-picker",{afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterDateComponentUpdate,class:i,"data-date-part":"time","data-element-id":t[R],key:`${n}-time-input`,onblur:()=>{this._focusedFieldInput=null},onfocus:this._onComponentFocus,overlayPositioning:"fixed",readOnly:o,value:e.value===C?"":e.value?String(e.value):"",onCalciteInputTimePickerChange:t=>this._saveValueFromDateComponent(e,t.currentTarget)})}_renderTimestampOffsetFieldComponents(e,t){const{class:i,key:n,readOnly:o}=t,{rawMax:a,rawMin:s}=e.range,r=F(a),l=F(s),d=F(e.value===C?"":e.value),p=e.includeTimeOffset,u={afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterDateComponentUpdate,overlayPositioning:"fixed",readOnly:o,[R]:t[R],onfocus:this._onComponentFocus};return S("div",{class:h.dateInputContainer,key:`${n}-date-time-container`},S("calcite-input-date-picker",{...u,class:i,"data-date-part":"date",key:`${n}-date-input`,max:r?.date??void 0,min:l?.date??void 0,onblur:()=>{this._focusedFieldInput=null},value:d.date??"",onCalciteInputDatePickerChange:t=>this._saveValueFromDateComponent(e,t.target)}),S("calcite-input-time-picker",{...u,class:i,"data-date-part":"time",key:`${n}-time-input`,onblur:()=>{this._focusedFieldInput=null},value:d.time??"",onCalciteInputTimePickerChange:t=>this._saveValueFromDateComponent(e,t.target)}),p?S("calcite-input-time-zone",{...u,class:i,"data-date-part":"timeZone",key:`${n}-timezone-input`,onblur:()=>{this._focusedFieldInput=null},value:d.timeZoneOffset??"0",onCalciteInputTimeZoneChange:t=>this._saveValueFromDateComponent(e,t.target)}):null)}_renderDateFieldComponents(e,t){const{class:i,key:n,readOnly:o,min:a,max:s}=t,r=e.effectiveTimeZone,l=w(e.value===C?"":e.value,r),d=w(s,r),p=w(a,r),u=e.includeTime,c={afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterDateComponentUpdate,overlayPositioning:"fixed",readOnly:o,[R]:t[R],onfocus:this._onComponentFocus};return S("div",{class:h.dateInputContainer,key:`${n}-date-time-container`},S("calcite-input-date-picker",{...c,class:i,"data-date-part":"date",key:`${n}-date-input`,max:d?.date??void 0,min:p?.date??void 0,onblur:()=>{this._focusedFieldInput=null},value:l.date??"",onCalciteInputDatePickerChange:t=>this._saveValueFromDateComponent(e,t.target)}),u?S("calcite-input-time-picker",{...c,"data-date-part":"time",key:`${n}-time-input`,onblur:()=>{this._focusedFieldInput=null},step:1,value:l.time??"",onCalciteInputTimePickerChange:t=>{this._saveValueFromDateComponent(e,t.target)}}):null)}getCommonInputProps(e){const{_effectiveDisabled:t}=this,{template:i,valid:n,value:o,minLength:a,maxLength:s,required:r,fieldName:l,editable:d,userHasChangedValue:p,range:{max:u,min:c}}=e,m=!d||t;let v=i.hint??void 0,f=!1;return o===C&&(v=this.messages.differentValues,f=!0),{afterCreate:this._afterComponentCreateOrUpdate,afterUpdate:this._afterComponentCreateOrUpdate,"aria-invalid":n?"false":"true",class:this.classes(h.fieldInput,m?h.inputDisabled:null),status:!p&&!this.viewModel.submitHasBeenAttempted||n?"idle":"invalid",maxLength:s&&s>-1?s:void 0,minLength:a&&a>-1?a:void 0,key:i.elementId,label:l,name:l,max:null!=u?u:void 0,min:null!=c?c:void 0,readOnly:m,onblur:this._onComponentBlur,required:r,placeholder:v,value:f?"":o??"",[R]:i.elementId,onfocus:this._onComponentFocus}}_onFormSubmit(e){e.preventDefault()}_getFieldInputFromHTMLElement(e){return this.viewModel.findFieldInput(e.getAttribute(R))}_afterRadioGroupCreateOrUpdate(e){const t=e.selectedItem,i=e.querySelector("calcite-radio-button"),n=t||i;n&&this._afterComponentCreateOrUpdate(n)}_onComponentFocus(e){const t=e.target,i=this._getFieldInputFromHTMLElement(t);this._touchedInputs.add(i.template.elementId),this._focusedFieldInput=i}_afterComponentCreateOrUpdate(e){const t=this._getFieldInputFromHTMLElement(e),i=this._focusedFieldInput;this._attemptFocusOnNextRender&&i===t&&(this._attemptFocusOnNextRender=!1,M(e))}_onComponentBlur(){this._focusedFieldInput=null}_parseValue(e,t){if(c(t.template,"switch")){if("calcite-dropdown"===e.localName&&t.domain)for(const i of t.domain.codedValues)if(i.name===e.selectedItems[0].textContent)return i.code;return e.checked?t.template.input.onValue:t.template.input.offValue}const i=e.value;return null==i||""===i?null:"number"===t.dataType?"-0"===i||"-0."===i||"-0,"===i?i:parseFloat(i):"date"===t.field.type?parseFloat(i):i}_saveInput(e){const t=this._getFieldInputFromHTMLElement(e),{elementId:n}=t.template;if(!t)return;const o=t?.value;if(c(t.template,"switch")&&"single"!==this.viewModel.mode){const e=i(this._batchSwitchInputInitialValues,t,(()=>t.value));this._batchSwitchInputInitialValues.set(t,null===e?o:e)}const a=this._parseValue(e,t);a!==o&&this.viewModel.setValue(n,a)}async _afterDateComponentCreate(e){const t=this._getFieldInputFromHTMLElement(e);await e.componentOnReady(),this._setDateTimeTimeZoneMap(e),this._updateDateTimeOrTimeZoneShadowDom(e,t.value===C),this._afterComponentCreateOrUpdate(e)}async _afterDateComponentUpdate(e){const{value:t}=this._getFieldInputFromHTMLElement(e);await e.componentOnReady(),this._updateDateTimeOrTimeZoneShadowDom(e,t===C),this._afterComponentCreateOrUpdate(e)}_saveValueFromDateComponent(e,t){const{elementId:i}=e.template,n=e.field.type,o=this._dateComponentMap.get(`${i}`);if(!o)return;const a=e.effectiveTimeZone;let s=e.value===C?void 0:e.value,r=null;"date-only"===n?r=Array.isArray(t.value)?t.value[0]:t.value:"time-only"===n?(s=x(s),r=x(t.value)):r="timestamp-offset"===n?null!=t.value?k({dateComponent:o.date,timeComponent:o.time,oldValue:s,timeZoneComponent:o.timeZone,defaultTimeZone:a}):null:null!=t.value?D({oldValue:s,dateComponent:o.date,timeZone:a,timeComponent:o.time?.value===C?void 0:o.time}):null,s!==r&&(null!==r&&t.value?this.viewModel.setValue(`${i}`,r):this.viewModel.setValue(`${i}`,null))}};e([a()],L.prototype,"activeFeatureIndex",null),e([a()],L.prototype,"disabled",null),e([a()],L.prototype,"_effectiveDisabled",null),e([a()],L.prototype,"features",null),e([a()],L.prototype,"map",null),e([a()],L.prototype,"spatialReference",null),e([a()],L.prototype,"timeZone",null),e([a()],L.prototype,"headingLevel",void 0),e([a()],L.prototype,"icon",null),e([a(),T("esri/t9n/common")],L.prototype,"messagesCommon",void 0),e([a(),T("esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm")],L.prototype,"messages",void 0),e([a(),T("esri/widgets/FeatureForm/t9n/FeatureForm")],L.prototype,"featureFormMessages",void 0),e([a()],L.prototype,"readOnly",void 0),e([a(),V(["value-change","submit"])],L.prototype,"viewModel",void 0),e([a({type:v,nonNullable:!0})],L.prototype,"visibleElements",void 0),e([a()],L.prototype,"groupDisplay",void 0),L=e([s("esri.widgets.BatchAttributeForm")],L);const j=L;export{j as default};
5
+ import{_ as e}from"../chunks/tslib.es6.js";import"../intl.js";import"../core/has.js";import{abortHandle as t}from"../core/handleUtils.js";import{getOrCreateMapValue as i}from"../core/MapUtils.js";import{watch as n,whenOnce as o}from"../core/reactiveUtils.js";import{property as a}from"../core/accessorSupport/decorators/property.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{subclass as s}from"../core/accessorSupport/decorators/subclass.js";import{isIntegerField as r}from"../layers/support/fieldUtils.js";import{isString as l}from"../support/guards.js";import d from"./Widget.js";import{getHiddenFieldsValidationErrorMessage as p,getVisibleFieldInputValidationErrorMessage as u,isElementTemplateWithInputType as c}from"./BatchAttributeForm/batchAttributeFormUtils.js";import m from"./BatchAttributeForm/BatchAttributeFormViewModel.js";import{css as h}from"./BatchAttributeForm/css.js";import{VisibleElements as v}from"./BatchAttributeForm/VisibleElements.js";import{InputVisibilityCode as f,isGroupInput as b,isFieldInput as _,differentValuesString as C}from"./BatchAttributeForm/inputs/support/inputUtils.js";import{loadCalciteComponents as g}from"./support/componentsUtils.js";import{getLabelForDateFieldValue as I,getIntlOptionsForField as y,prepareISOFieldValueForDateComponents as F,prepareUnixFieldValueForDateComponents as w,normalizeTimeOnlyString as x,getISOFieldValueFromDateComponents as k,getUnixFieldValueFromDateComponents as D}from"./support/dateUtils.js";import{globalCss as O}from"./support/globalCss.js";import{setFocus as M}from"./support/widgetUtils.js";import{messageBundle as T}from"./support/decorators/messageBundle.js";import{vmEvent as V}from"./support/decorators/vmEvent.js";import{tsx as S}from"./support/jsxFactory.js";import{isEmptyValue as E}from"./support/forms/formUtils.js";import{substitute as U}from"../intl/substitute.js";const R="data-element-id";let L=class extends d{constructor(e,t){super(e,t),this.headingLevel=2,this.messagesCommon=null,this.messages=null,this.featureFormMessages=null,this.readOnly=!1,this.viewModel=new m,this.visibleElements=new v,this.groupDisplay="all",this._attemptFocusOnNextRender=!1,this._dateComponentMap=new Map,this._touchedInputs=new Set,this._focusedFieldInput=null,this._batchSwitchInputInitialValues=new Map,this._saveInput=this._saveInput.bind(this),this._onFormSubmit=this._onFormSubmit.bind(this),this._onComponentFocus=this._onComponentFocus.bind(this),this._onComponentBlur=this._onComponentBlur.bind(this),this._afterComponentCreateOrUpdate=this._afterComponentCreateOrUpdate.bind(this),this._afterDateComponentCreate=this._afterDateComponentCreate.bind(this),this._afterDateComponentUpdate=this._afterDateComponentUpdate.bind(this),this._afterRadioGroupCreateOrUpdate=this._afterRadioGroupCreateOrUpdate.bind(this)}initialize(){this.addHandles([n((()=>this.features),(()=>{this._dateComponentMap.clear();const e=new AbortController;o((()=>!this.viewModel.updating),e.signal).then((()=>{this._attemptFocusOnNextRender=!0})),this.addHandles(t(e))})),n((()=>this.viewModel.activeForm),(()=>{this._batchSwitchInputInitialValues.clear()}))])}loadDependencies(){return g({input:()=>import("@esri/calcite-components/dist/components/calcite-input"),block:()=>import("@esri/calcite-components/dist/components/calcite-block"),button:()=>import("@esri/calcite-components/dist/components/calcite-button"),combobox:()=>import("@esri/calcite-components/dist/components/calcite-combobox"),"combobox-item":()=>import("@esri/calcite-components/dist/components/calcite-combobox-item"),"combobox-item-group":()=>import("@esri/calcite-components/dist/components/calcite-combobox-item-group"),dropdown:()=>import("@esri/calcite-components/dist/components/calcite-dropdown"),"dropdown-group":()=>import("@esri/calcite-components/dist/components/calcite-dropdown-group"),"dropdown-item":()=>import("@esri/calcite-components/dist/components/calcite-dropdown-item"),"input-date-picker":()=>import("@esri/calcite-components/dist/components/calcite-input-date-picker"),"input-number":()=>import("@esri/calcite-components/dist/components/calcite-input-number"),"input-time-picker":()=>import("@esri/calcite-components/dist/components/calcite-input-time-picker"),"input-time-zone":()=>import("@esri/calcite-components/dist/components/calcite-input-time-zone"),label:()=>import("@esri/calcite-components/dist/components/calcite-label"),"input-message":()=>import("@esri/calcite-components/dist/components/calcite-input-message"),loader:()=>import("@esri/calcite-components/dist/components/calcite-loader"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice"),switch:()=>import("@esri/calcite-components/dist/components/calcite-switch"),"text-area":()=>import("@esri/calcite-components/dist/components/calcite-text-area"),"radio-button":()=>import("@esri/calcite-components/dist/components/calcite-radio-button"),"radio-button-group":()=>import("@esri/calcite-components/dist/components/calcite-radio-button-group")})}get activeFeatureIndex(){return this.viewModel.activeFeatureIndex}set activeFeatureIndex(e){this.viewModel.activeFeatureIndex=e}get disabled(){return this.viewModel.disabled}set disabled(e){this.viewModel.disabled=e}get _effectiveDisabled(){return this.disabled||this.viewModel.updating}get features(){return this.viewModel.features}set features(e){this.viewModel.features=e}get map(){return this.viewModel.map}set map(e){this.viewModel.map=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 icon(){return"edit-attributes"}set icon(e){this._overrideIfSome("icon",e)}goToClosestError(){const e=this.viewModel.getFirstVisibleInvalidFieldInput();if(!e)return;const{groupInput:t}=e;t&&(t.open||(t.open=!0)),setTimeout((()=>{if(!this.domNode)return;const t=this.domNode.querySelector(`[data-element-id="${e.input.template.elementId}"]`);t&&M(t)}),10)}render(){const{status:e}=this.viewModel;return"failed"===e?this._renderErrorNotice(this.messages.formFailedToLoad):this.viewModel.expressionEvaluationFailed?this._renderErrorNotice(this.messages.expressionEvaluationFailed):this.viewModel.hasLayersWithContingentValues?this._renderErrorNotice(this.messages.unsupportedContingentValues):S("div",{class:this.classes(h.base,O.widget,O.panel)},"loaded"===e?this._renderForm():"loading"===e?S("calcite-loader",{key:"loader",label:this.messagesCommon?.loading}):null)}_setDateTimeTimeZoneMap(e){const{datePart:t,elementId:n}=e.dataset,o=this._getCalciteElementFromDateTimeTimeZonePicker(e,t);if(!o)return;const a=i(this._dateComponentMap,`${n}`,(()=>({placeholder:{date:"",time:"",timeZone:""}})));switch(a.placeholder[t]=o.placeholder??"",t){case"date":a.date=e;break;case"time":a.time=e;break;case"timeZone":a.timeZone=e,a.defaultComboboxItemElements=o.selectedItems}"timeZone"===t&&(a.defaultComboboxItemElements=o.selectedItems)}_getCalciteElementFromDateTimeTimeZonePicker(e,t){const i=e.shadowRoot;return i?"timeZone"===t?i.querySelector("calcite-combobox"):i.querySelector("calcite-input-text"):null}_updateDateTimeOrTimeZoneShadowDom(e,t){const{datePart:i,elementId:n}=e.dataset,o=this._dateComponentMap.get(`${n}`);if(!o)return;const a=this._getCalciteElementFromDateTimeTimeZonePicker(e,i);if(a)switch(i){case"date":case"time":a.placeholder=t?this.messages.differentValues:o.placeholder[i];break;case"timeZone":t?(a.value="",a.placeholder=this.messages.differentValues):(!a.selectedItems.length&&o.defaultComboboxItemElements?.length&&(a.selectedItems[0]=o.defaultComboboxItemElements[0]),a.placeholder=o.placeholder[i])}}_renderErrorNotice(e){return S("div",{class:this.classes(h.base,O.widget,O.panel)},S("calcite-notice",{class:h.noticeError,icon:!0,kind:"warning",open:!0},S("div",{slot:"message"},e)))}_renderForm(){return S("form",{onsubmit:this._onFormSubmit},this._renderInvisibleFieldsError(),this._renderContent())}_renderInvisibleFieldsError(){const{viewModel:e}=this,{hasNonActiveInvalidFeatures:t,activeForm:i}=e;let n;if(!e.submitHasBeenAttempted)return null;if(i.invalidHiddenInputs.length>0)if(n=p(i,e.mode,this.messages),"batch"===this.viewModel.mode){const e=i.invalidHiddenInputs.filter((e=>e.effectiveVisibilityCode===f.HIDDEN_GROUP_VISIBILITY_EXPRESSION_ALL||e.visibilityCode===f.HIDDEN_VISIBILITY_EXPRESSION_ALL));e.length>0?n+=` (${e.map((e=>e.label)).join(", ")})`:n=null}else n+=` (${i.invalidHiddenInputs.map((e=>e.label)).join(", ")})`;else if(t)return null;return n?S("calcite-notice",{class:h.noticeError,icon:!0,kind:"danger",open:!0},S("div",{slot:"message"},n)):null}_renderContent(){if(!this.viewModel.hasVisibleInputs)return[S("calcite-notice",{class:h.noticeError,icon:!0,kind:"warning",open:!0},S("div",{slot:"message"},this.messages.noVisibleFields[this.viewModel.noVisibleElementsReason]))];const{inputs:e}=this.viewModel.activeForm;return e.filter((e=>e.visible)).map((e=>this._renderInput(e)))}_renderInput(e){return b(e)?this._renderGroupInput(e):_(e)?this._renderLabeledField(e):void 0}_renderGroupInput(e){const{inputs:t,template:i,open:n}=e,o=t.filter((e=>e.visible)),a=i.label??"";return S("calcite-block",{class:this.classes(h.group,"sequential"===this.groupDisplay?h.groupSequential:null,this.disabled?h.inputDisabled:null),collapsible:!0,description:i.description??void 0,disabled:this._effectiveDisabled,expanded:n,heading:a,headingLevel:this.headingLevel,key:`{${i.elementId}-key}`,label:a,onCalciteBlockClose:()=>{e.open=!1},onCalciteBlockOpen:()=>{e.open=!0}},o.map((e=>this._renderInput(e))))}_renderLabeledField(e){const{label:t,elementId:i}=e.template,{required:n,dataType:o}=e,a=n?U(this.messages.requiredFieldLabel,{name:t}):t;return S("calcite-label",{"aria-label":a,class:h.label,key:`field--${i}`},S("div",{class:h.labelTextContent,key:"labelTextContainer"},t,n?S("span",{"aria-hidden":"true",title:this.messagesCommon.required},"*"):void 0),"unsupported"!==o?this._renderFieldInput(e):this._renderReadOnlyComponent(e),this._renderAuxiliaryText(e))}_renderFieldInput(e){const t=this.getCommonInputProps(e),{dataType:i}=e;return"date"===i?this._renderDateComponents(e,t):"coded-value"===e.domain?.type?this._renderCodedInputs({input:e,props:t}):"number"===i?this._renderNumberComponent(e,t):this._renderStringComponent(e,t)}_renderAuxiliaryText(e){const{compositeError:t,description:i,submittable:n}=e,o=!n&&t&&(this.viewModel.submitHasBeenAttempted||this._touchedInputs.has(e.template.elementId))?u(e,t,this.messages):null;return o?S("calcite-input-message",{icon:!0,status:"invalid"},o):i?S("calcite-input-message",{class:h.description,icon:!1,status:"idle"},i):null}_renderCodedInputs({input:e,props:t}){const i=e.template.input?.type??null,n=e.codedValueOptions;switch(i){case"switch":return this._renderSwitchField({input:e,props:t});case"radio-buttons":return this._renderRadioButtonGroupComponent({input:e,options:n.flat(),props:t});default:return this._renderComboBoxComponent({options:n,props:t,input:e})}}_renderSwitchField({input:e,props:t}){if((this._batchSwitchInputInitialValues.get(e)===C||e.value===C)&&"batch"===this.viewModel.mode){const i={dropdown:{afterCreate:this._afterComponentCreateOrUpdate,afterUpdate:this._afterComponentCreateOrUpdate,disabled:t.readOnly,open:!1,[R]:t[R]},trigger:{appearance:"transparent",iconEnd:"chevron-down",kind:"neutral",slot:"trigger",label:t.label},group:{mode:"single"}};return this._renderDropdownComponent({buttonValue:e.value,dropdownProps:i,options:[{name:this.messages.differentValues,value:C,disabled:!0},...e.codedValueDomainOptions]})}return this._renderSwitchComponent({input:e,props:t})}_renderSwitchComponent({input:e,props:t}){return S("calcite-switch",{...t,checked:!!c(e.template,"switch")&&e.value===e.template.input.onValue,class:h.inputSwitch,disabled:t.readOnly,onblur:()=>{this._focusedFieldInput=null},onCalciteSwitchChange:({currentTarget:e})=>this._saveInput(e)})}_renderDropdownComponent({buttonValue:e,options:t,dropdownProps:i}){const{trigger:n,dropdown:o,group:a}=i;return S("calcite-dropdown",{...o,onblur:()=>{this._focusedFieldInput=null},onfocus:this._onComponentFocus,onCalciteDropdownSelect:({currentTarget:e})=>this._saveInput(e)},S("calcite-button",{...n},e===C?this.messages.differentValues:e),S("calcite-dropdown-group",{selectionMode:a.mode},t.map((t=>S("calcite-dropdown-item",{disabled:t.disabled,label:String(t.name),selected:e===t.value},t.name)))))}_renderComboBoxComponent({input:e,options:t,props:i}){const n="INSERT"===this.viewModel.editType,o=this._touchedInputs.has(e?.template?.elementId),a=n&&e.showNoValueOptionEnabled&&!o?()=>{}:i.onblur,s={...i,onblur:a};return S("calcite-combobox",{...s,selectionMode:"single",value:i.placeholder===this.messages.differentValues?C:String(i.value),onCalciteComboboxChange:({currentTarget:e})=>{e.value!==C&&this._saveInput(e)}},this.renderComboboxOptionsList({input:e,options:t,props:i}))}renderComboboxOptionsList({input:e,options:t,props:i}){const[n,o]=t.map((e=>e.map((({name:e,value:t})=>S("calcite-combobox-item",{key:`#${t}`,selected:i.value===t,textLabel:e,value:`${t}`}))))),a=[...n];o.length>0&&a.push(S("calcite-combobox-item-group",{key:"unsupported",label:this.featureFormMessages.subtypes.unsupportedDomainGroupTitle},o));const s=i.placeholder===this.messages.differentValues,r=!s&&E(i.value);return e.showNoValueOptionEnabled&&a.unshift(S("calcite-combobox-item",{key:"empty-option",selected:r,textLabel:e.showNoValueLabel||this.messages.empty,value:""})),s&&a.unshift(S("calcite-combobox-item",{key:C,selected:!0,textLabel:this.messages.differentValues,value:C})),a}_renderRadioButtonGroupComponent({input:e,options:t,props:i}){const n=t.map((({name:t,value:n})=>this._renderRadioButtons({label:t,value:n,selected:n===e.value,props:i})));if(e.showNoValueOptionEnabled){const t="",o=e.showNoValueLabel||this.messages.empty,a=E(e.value);n.unshift(this._renderRadioButtons({label:o,value:t,selected:a,props:i}))}return S("calcite-radio-button-group",{afterCreate:this._afterRadioGroupCreateOrUpdate,afterUpdate:this._afterRadioGroupCreateOrUpdate,class:h.inputRadioGroup,disabled:i.readOnly,key:`${i.key}-radio-group`,layout:"vertical",name:i.name,required:i.required},n,i.placeholder===this.messages.differentValues?S("calcite-label",{class:h.placeholderRadio,key:i.label,layout:"inline"},S("calcite-radio-button",{checked:!0,class:h.inputRadio,disabled:!0,name:i.placeholder,value:i.placeholder}),i.placeholder):null)}_renderRadioButtons({value:e,selected:t,label:i,props:n}){return S("calcite-label",{class:h.inputRadioLabel,key:n.label,layout:"inline"},S("calcite-radio-button",{...n,afterCreate:void 0,afterUpdate:void 0,checked:t,class:h.inputRadio,disabled:n.readOnly,name:n.label,onblur:()=>{this._focusedFieldInput=null},value:e,onCalciteRadioButtonChange:({currentTarget:e})=>{e.checked&&this._saveInput(e)}}),i)}_renderStringComponent(e,t){const{template:i}=e;return i.field.editable?i.input&&"text-area"===i.input.type?S("calcite-text-area",{...t,class:this.classes(h.individualElement),resize:"vertical",value:t.value?String(t.value):"",onCalciteTextAreaInput:({currentTarget:e})=>this._saveInput(e)}):S("calcite-input",{...t,class:this.classes(h.individualElement),type:"text",value:t.value?String(t.value):"",onCalciteInputInput:({currentTarget:e})=>this._saveInput(e)}):this._renderReadOnlyComponent(e)}_renderNumberComponent(e,t){const i=r(e.field);return S("calcite-input-number",{...t,integer:i,type:"number",value:i&&""!==t.value?Math.round(parseFloat(String(t.value))).toString():String(t.value),onCalciteInputNumberInput:({currentTarget:e})=>this._saveInput(e)})}_renderReadOnlyComponent(e,t){const i=this.getCommonInputProps(e);return S("calcite-input",{...i,class:this.classes(h.fieldInput,h.inputDisabled,h.individualElement),readOnly:!0,type:"text",value:String(t??i.value??"")})}_renderDateComponents(e,t){const{type:i}=e.field;switch(i){case"date":return this._renderDateFieldComponents(e,t);case"date-only":return this._renderDateOnlyFieldComponent(e,t);case"time-only":return this._renderTimeOnlyFieldComponent(e,t);case"timestamp-offset":return this._renderTimestampOffsetFieldComponents(e,t);default:return this._renderReadOnlyComponent(e,I(e.field,t.value,{timeZone:e.effectiveTimeZone,...y(e.template.field)}))}}_renderDateOnlyFieldComponent(e,t){const{class:i,key:n,readOnly:o}=t,{rawMax:a,rawMin:s}=e.range;return S("calcite-input-date-picker",{afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterDateComponentUpdate,class:i,"data-date-part":"date","data-element-id":t[R],key:`${n}-date-input`,max:l(a)?a:void 0,min:l(s)?s:void 0,onblur:()=>{this._focusedFieldInput=null},onfocus:this._onComponentFocus,overlayPositioning:"fixed",readOnly:o,value:e.value===C?"":e.value?String(e.value):"",onCalciteInputDatePickerChange:t=>this._saveValueFromDateComponent(e,t.currentTarget)})}_renderTimeOnlyFieldComponent(e,t){const{class:i,key:n,readOnly:o}=t;return S("calcite-input-time-picker",{afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterDateComponentUpdate,class:i,"data-date-part":"time","data-element-id":t[R],key:`${n}-time-input`,onblur:()=>{this._focusedFieldInput=null},onfocus:this._onComponentFocus,overlayPositioning:"fixed",readOnly:o,value:e.value===C?"":e.value?String(e.value):"",onCalciteInputTimePickerChange:t=>this._saveValueFromDateComponent(e,t.currentTarget)})}_renderTimestampOffsetFieldComponents(e,t){const{class:i,key:n,readOnly:o}=t,{rawMax:a,rawMin:s}=e.range,r=F(a),l=F(s),d=F(e.value===C?"":e.value),p=e.includeTimeOffset,u={afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterDateComponentUpdate,overlayPositioning:"fixed",readOnly:o,[R]:t[R],onfocus:this._onComponentFocus};return S("div",{class:h.dateInputContainer,key:`${n}-date-time-container`},S("calcite-input-date-picker",{...u,class:i,"data-date-part":"date",key:`${n}-date-input`,max:r?.date??void 0,min:l?.date??void 0,onblur:()=>{this._focusedFieldInput=null},value:d.date??"",onCalciteInputDatePickerChange:t=>this._saveValueFromDateComponent(e,t.target)}),S("calcite-input-time-picker",{...u,class:i,"data-date-part":"time",key:`${n}-time-input`,onblur:()=>{this._focusedFieldInput=null},value:d.time??"",onCalciteInputTimePickerChange:t=>this._saveValueFromDateComponent(e,t.target)}),p?S("calcite-input-time-zone",{...u,class:i,"data-date-part":"timeZone",key:`${n}-timezone-input`,onblur:()=>{this._focusedFieldInput=null},value:d.timeZoneOffset??"0",onCalciteInputTimeZoneChange:t=>this._saveValueFromDateComponent(e,t.target)}):null)}_renderDateFieldComponents(e,t){const{class:i,key:n,readOnly:o,min:a,max:s}=t,r=e.effectiveTimeZone,l=w(e.value===C?"":e.value,r),d=w(s,r),p=w(a,r),u=e.includeTime,c={afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterDateComponentUpdate,overlayPositioning:"fixed",readOnly:o,[R]:t[R],onfocus:this._onComponentFocus};return S("div",{class:h.dateInputContainer,key:`${n}-date-time-container`},S("calcite-input-date-picker",{...c,class:i,"data-date-part":"date",key:`${n}-date-input`,max:d?.date??void 0,min:p?.date??void 0,onblur:()=>{this._focusedFieldInput=null},value:l.date??"",onCalciteInputDatePickerChange:t=>this._saveValueFromDateComponent(e,t.target)}),u?S("calcite-input-time-picker",{...c,"data-date-part":"time",key:`${n}-time-input`,onblur:()=>{this._focusedFieldInput=null},step:1,value:l.time??"",onCalciteInputTimePickerChange:t=>{this._saveValueFromDateComponent(e,t.target)}}):null)}getCommonInputProps(e){const{_effectiveDisabled:t}=this,{template:i,valid:n,value:o,minLength:a,maxLength:s,required:r,fieldName:l,editable:d,userHasChangedValue:p,range:{max:u,min:c}}=e,m=!d||t;let v=i.hint??void 0,f=!1;return o===C&&(v=this.messages.differentValues,f=!0),{afterCreate:this._afterComponentCreateOrUpdate,afterUpdate:this._afterComponentCreateOrUpdate,"aria-invalid":n?"false":"true",class:this.classes(h.fieldInput,m?h.inputDisabled:null),status:!p&&!this.viewModel.submitHasBeenAttempted||n?"idle":"invalid",maxLength:s&&s>-1?s:void 0,minLength:a&&a>-1?a:void 0,key:i.elementId,label:l,name:l,max:null!=u?u:void 0,min:null!=c?c:void 0,readOnly:m,onblur:this._onComponentBlur,required:r,placeholder:v,value:f?"":o??"",[R]:i.elementId,onfocus:this._onComponentFocus}}_onFormSubmit(e){e.preventDefault()}_getFieldInputFromHTMLElement(e){return this.viewModel.findFieldInput(e.getAttribute(R))}_afterRadioGroupCreateOrUpdate(e){const t=e.selectedItem,i=e.querySelector("calcite-radio-button"),n=t||i;n&&this._afterComponentCreateOrUpdate(n)}_onComponentFocus(e){const t=e.target,i=this._getFieldInputFromHTMLElement(t);this._touchedInputs.add(i.template.elementId),this._focusedFieldInput=i}_afterComponentCreateOrUpdate(e){const t=this._getFieldInputFromHTMLElement(e),i=this._focusedFieldInput;this._attemptFocusOnNextRender&&i===t&&(this._attemptFocusOnNextRender=!1,M(e))}_onComponentBlur(){this._focusedFieldInput=null}_parseValue(e,t){if(c(t.template,"switch")){if("calcite-dropdown"===e.localName&&t.domain)for(const i of t.domain.codedValues)if(i.name===e.selectedItems[0].textContent)return i.code;return e.checked?t.template.input.onValue:t.template.input.offValue}const i=e.value;return null==i||""===i?null:"number"===t.dataType?"-0"===i||"-0."===i||"-0,"===i?i:parseFloat(i):"date"===t.field.type?parseFloat(i):i}_saveInput(e){const t=this._getFieldInputFromHTMLElement(e),{elementId:n}=t.template;if(!t)return;const o=t?.value;if(c(t.template,"switch")&&"single"!==this.viewModel.mode){const e=i(this._batchSwitchInputInitialValues,t,(()=>t.value));this._batchSwitchInputInitialValues.set(t,null===e?o:e)}const a=this._parseValue(e,t);a!==o&&this.viewModel.setValue(n,a)}async _afterDateComponentCreate(e){const t=this._getFieldInputFromHTMLElement(e);await e.componentOnReady(),this._setDateTimeTimeZoneMap(e),this._updateDateTimeOrTimeZoneShadowDom(e,t.value===C),this._afterComponentCreateOrUpdate(e)}async _afterDateComponentUpdate(e){const{value:t}=this._getFieldInputFromHTMLElement(e);await e.componentOnReady(),this._updateDateTimeOrTimeZoneShadowDom(e,t===C),this._afterComponentCreateOrUpdate(e)}_saveValueFromDateComponent(e,t){const{elementId:i}=e.template,n=e.field.type,o=this._dateComponentMap.get(`${i}`);if(!o)return;const a=e.effectiveTimeZone;let s=e.value===C?void 0:e.value,r=null;"date-only"===n?r=Array.isArray(t.value)?t.value[0]:t.value:"time-only"===n?(s=x(s),r=x(t.value)):r="timestamp-offset"===n?null!=t.value?k({dateComponent:o.date,timeComponent:o.time,oldValue:s,timeZoneComponent:o.timeZone,defaultTimeZone:a}):null:null!=t.value?D({oldValue:s,dateComponent:o.date,timeZone:a,timeComponent:o.time?.value===C?void 0:o.time}):null,s!==r&&(null!==r&&t.value?this.viewModel.setValue(`${i}`,r):this.viewModel.setValue(`${i}`,null))}};e([a()],L.prototype,"activeFeatureIndex",null),e([a()],L.prototype,"disabled",null),e([a()],L.prototype,"_effectiveDisabled",null),e([a()],L.prototype,"features",null),e([a()],L.prototype,"map",null),e([a()],L.prototype,"spatialReference",null),e([a()],L.prototype,"timeZone",null),e([a()],L.prototype,"headingLevel",void 0),e([a()],L.prototype,"icon",null),e([a(),T("esri/t9n/common")],L.prototype,"messagesCommon",void 0),e([a(),T("esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm")],L.prototype,"messages",void 0),e([a(),T("esri/widgets/FeatureForm/t9n/FeatureForm")],L.prototype,"featureFormMessages",void 0),e([a()],L.prototype,"readOnly",void 0),e([a(),V(["value-change","submit"])],L.prototype,"viewModel",void 0),e([a({type:v,nonNullable:!0})],L.prototype,"visibleElements",void 0),e([a()],L.prototype,"groupDisplay",void 0),L=e([s("esri.widgets.BatchAttributeForm")],L);const j=L;export{j 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.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../Color.js";import{handlesGroup as r}from"../../core/handleUtils.js";import{memoize as i}from"../../core/memoize.js";import{watch as o,on as n}from"../../core/reactiveUtils.js";import{union as s}from"../../core/SetUtils.js";import{getMetersPerVerticalUnitForSR as l}from"../../core/unitUtils.js";import{property as c}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as a}from"../../core/accessorSupport/decorators/subclass.js";import{i as u}from"../../chunks/vec32.js";import{create as p}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as d}from"../../geometry/ellipsoidUtils.js";import{create as m,fromPoints as v}from"../../geometry/support/ray.js";import{GeometryDescriptor as y}from"../../layers/support/ElevationQuery.js";import{externalToInternalIntersectOptions as f}from"../../views/3d/support/hitTest.js";import{newIntersector as h}from"../../views/3d/webgl-engine/lib/Intersector.js";import{StoreResults as w}from"../../views/3d/webgl-engine/lib/IntersectorInterfaces.js";import{toGraphic as _}from"../../views/3d/webgl-engine/lib/intersectorUtilsConversions.js";import g from"./ElevationProfileLine.js";const j=2e5;let b=class extends g{constructor(e){super(e),this.type="view",this.color=new t("#cf4ccf"),this.viewVisualizationEnabled=!0,this.include=null,this.exclude=null,this.numSamplesForPreview=50,this.numSamplesPerChunk=25,this._getQueryElevationDependencies=i(((e,t,r,i,o,n,s)=>({inputGraphicUid:null!=e?x(e):null,visibleLayers:t,maxIntersectionDistance:r,intersectOptions:i,view:o,stationary:n,spatialReference:s}))),this._vecA=p(),this._vecB=p(),this._ray=m()}get minDemResolution(){const e=this._viewModel?.view;if(null==e||"3d"!==e.type)return null;const t=e.pointsOfInterest?.focus?.worldUnitsPerContentPixel;return null==t?null:t*l(e.spatialReference)}get queryElevationDependencies(){const e=this._view;return e?this._getQueryElevationDependencies(this._viewModel?.input,this._visibleLayers,this._maxIntersectionDistance,this._intersectOptions,e,e.stationary,e.spatialReference):null}get _visibleLayers(){return this._view?.map?.allLayers?.filter((e=>e.visible)).toArray()??[]}get _intersectOptions(){const e=this._view;if(null==e||e.destroyed)return{};const t=f(e,{include:this.include,exclude:this.exclude}),r=f(e,{exclude:this._pointCloudLayers});return t.exclude=s(t.exclude,r.exclude),t}get _pointCloudLayers(){const e=this._view;return null==e?[]:e.allLayerViews.toArray().filter((e=>"point-cloud"===e.layer?.type)).map((e=>e.layer))}get _view(){const e=this._viewModel?.view;return null!=e&&"3d"===e.type?e:null}get _maxIntersectionDistance(){const e=this._view;return e?.renderCoordsHelper?d(e.spatialReference).radius/e.renderCoordsHelper.unitInMeters:Number.POSITIVE_INFINITY}get _intersector(){const e=this._view;if(null==e)return null;const t=h(e.state.viewingMode),r=t.options;return r.hud=!1,r.invisibleTerrain=!1,r.backfacesTerrain=!1,r.selectionMode=!1,r.store=w.ALL,t}async queryElevation(e,{noDataValue:t,signal:r}){const i=this.queryElevationDependencies;if(null==i)throw new Error("ElevationProfileLineInput: no dependencies");const o=this._intersector;if(null==o)throw new Error("ElevationProfileLineInput: no view");const{intersectOptions:n,view:s,spatialReference:l}=i,c=s.renderCoordsHelper,a=s.sceneIntersectionHelper,p=this._vecA,d=this._vecA,m=this._vecB,f=this._ray;if(!l)return{geometry:e,noDataValue:t};const h=await y.fromGeometry(e).project(l,r);if(!h)return{geometry:e,noDataValue:t};const w=h.coordinates,_=w.length;for(let y=0;y<_;++y){const e=w[y];u(m,e.x,e.y,e.z??0),c.toRenderCoords(m,l,m),c.setAltitude(p,j,m);const r=v(p,m,f);a.computeIntersection(r,o,n,!0);const s=I(i,o.results.all);s?(s.getIntersectionPoint(d),c.fromRenderCoords(d,d,l),e.z=d[2]):e.z=t}return{geometry:h.export(),noDataValue:t}}attach(e){const t=()=>this._onChange();return r([super.attach(e),o((()=>this.queryElevationDependencies),t),n((()=>e.elevationProvider),"elevation-change",t,{onListenerAdd:t,onListenerRemove:t})])}};function I({view:e,inputGraphicUid:t,maxIntersectionDistance:r},i){for(const o of i){if(!o.withinDistance(r))continue;const i=_(o,e);if(null==i||x(i)!==t)return o}return null}function x(e){if(e.layer&&"objectIdField"in e.layer){const t=e.attributes[e.layer.objectIdField];if(t)return`o-${e.layer.id}-${t}`}return`u-${e.uid}`}e([c({type:t,nonNullable:!0})],b.prototype,"color",void 0),e([c()],b.prototype,"viewVisualizationEnabled",void 0),e([c()],b.prototype,"include",void 0),e([c()],b.prototype,"exclude",void 0),e([c({readOnly:!0})],b.prototype,"minDemResolution",null),e([c()],b.prototype,"queryElevationDependencies",null),e([c()],b.prototype,"_visibleLayers",null),e([c()],b.prototype,"_intersectOptions",null),e([c()],b.prototype,"_pointCloudLayers",null),e([c()],b.prototype,"_view",null),e([c()],b.prototype,"_maxIntersectionDistance",null),e([c()],b.prototype,"_intersector",null),b=e([a("esri.widgets.ElevationProfile.ElevationProfileLineView")],b);const L=b;export{L as default};
5
+ import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../Color.js";import{handlesGroup as r}from"../../core/handleUtils.js";import{memoize as i}from"../../core/memoize.js";import{watch as o,on as n}from"../../core/reactiveUtils.js";import{union as s}from"../../core/SetUtils.js";import{getMetersPerVerticalUnitForSR as l}from"../../core/unitUtils.js";import{property as c}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as a}from"../../core/accessorSupport/decorators/subclass.js";import{i as u}from"../../chunks/vec32.js";import{create as p}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as d}from"../../geometry/ellipsoidUtils.js";import{create as m,fromPoints as v}from"../../geometry/support/ray.js";import{GeometryDescriptor as y}from"../../layers/support/ElevationQuery.js";import{externalToInternalIntersectOptions as f}from"../../views/3d/support/hitTest.js";import{Intersector as h}from"../../views/3d/webgl-engine/lib/Intersector.js";import{StoreResults as w}from"../../views/3d/webgl-engine/lib/IntersectorInterfaces.js";import{toGraphic as _}from"../../views/3d/webgl-engine/lib/intersectorUtilsConversions.js";import g from"./ElevationProfileLine.js";const j=2e5;let b=class extends g{constructor(e){super(e),this.type="view",this.color=new t("#cf4ccf"),this.viewVisualizationEnabled=!0,this.include=null,this.exclude=null,this.numSamplesForPreview=50,this.numSamplesPerChunk=25,this._getQueryElevationDependencies=i(((e,t,r,i,o,n,s)=>({inputGraphicUid:null!=e?x(e):null,visibleLayers:t,maxIntersectionDistance:r,intersectOptions:i,view:o,stationary:n,spatialReference:s}))),this._vecA=p(),this._vecB=p(),this._ray=m()}get minDemResolution(){const e=this._viewModel?.view;if(null==e||"3d"!==e.type)return null;const t=e.pointsOfInterest?.focus?.worldUnitsPerContentPixel;return null==t?null:t*l(e.spatialReference)}get queryElevationDependencies(){const e=this._view;return e?this._getQueryElevationDependencies(this._viewModel?.input,this._visibleLayers,this._maxIntersectionDistance,this._intersectOptions,e,e.stationary,e.spatialReference):null}get _visibleLayers(){return this._view?.map?.allLayers?.filter((e=>e.visible)).toArray()??[]}get _intersectOptions(){const e=this._view;if(null==e||e.destroyed)return{};const t=f(e,{include:this.include,exclude:this.exclude}),r=f(e,{exclude:this._pointCloudLayers});return t.exclude=s(t.exclude,r.exclude),t}get _pointCloudLayers(){const e=this._view;return null==e?[]:e.allLayerViews.toArray().filter((e=>"point-cloud"===e.layer?.type)).map((e=>e.layer))}get _view(){const e=this._viewModel?.view;return null!=e&&"3d"===e.type?e:null}get _maxIntersectionDistance(){const e=this._view;return e?.renderCoordsHelper?d(e.spatialReference).radius/e.renderCoordsHelper.unitInMeters:Number.POSITIVE_INFINITY}get _intersector(){const e=this._view;if(null==e)return null;const t=new h(e.state.viewingMode),r=t.options;return r.hud=!1,r.invisibleTerrain=!1,r.backfacesTerrain=!1,r.selectionMode=!1,r.store=w.ALL,t}async queryElevation(e,{noDataValue:t,signal:r}){const i=this.queryElevationDependencies;if(null==i)throw new Error("ElevationProfileLineInput: no dependencies");const o=this._intersector;if(null==o)throw new Error("ElevationProfileLineInput: no view");const{intersectOptions:n,view:s,spatialReference:l}=i,c=s.renderCoordsHelper,a=s.sceneIntersectionHelper,p=this._vecA,d=this._vecA,m=this._vecB,f=this._ray;if(!l)return{geometry:e,noDataValue:t};const h=await y.fromGeometry(e).project(l,r);if(!h)return{geometry:e,noDataValue:t};const w=h.coordinates,_=w.length;for(let y=0;y<_;++y){const e=w[y];u(m,e.x,e.y,e.z??0),c.toRenderCoords(m,l,m),c.setAltitude(p,j,m);const r=v(p,m,f);a.computeIntersection(r,o,!0,n);const s=I(i,o.results.all);s?(s.getIntersectionPoint(d),c.fromRenderCoords(d,d,l),e.z=d[2]):e.z=t}return{geometry:h.export(),noDataValue:t}}attach(e){const t=()=>this._onChange();return r([super.attach(e),o((()=>this.queryElevationDependencies),t),n((()=>e.elevationProvider),"elevation-change",t,{onListenerAdd:t,onListenerRemove:t})])}};function I({view:e,inputGraphicUid:t,maxIntersectionDistance:r},i){for(const o of i){if(!o.withinDistance(r))continue;const i=_(o,e);if(null==i||x(i)!==t)return o}return null}function x(e){if(e.layer&&"objectIdField"in e.layer){const t=e.attributes[e.layer.objectIdField];if(t)return`o-${e.layer.id}-${t}`}return`u-${e.uid}`}e([c({type:t,nonNullable:!0})],b.prototype,"color",void 0),e([c()],b.prototype,"viewVisualizationEnabled",void 0),e([c()],b.prototype,"include",void 0),e([c()],b.prototype,"exclude",void 0),e([c({readOnly:!0})],b.prototype,"minDemResolution",null),e([c()],b.prototype,"queryElevationDependencies",null),e([c()],b.prototype,"_visibleLayers",null),e([c()],b.prototype,"_intersectOptions",null),e([c()],b.prototype,"_pointCloudLayers",null),e([c()],b.prototype,"_view",null),e([c()],b.prototype,"_maxIntersectionDistance",null),e([c()],b.prototype,"_intersector",null),b=e([a("esri.widgets.ElevationProfile.ElevationProfileLineView")],b);const L=b;export{L 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.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.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 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 c}from"../../support/jsxFactory.js";import{getAssociationTitle as a}from"../../support/UtilityNetworkAssociations/utils/getAssociationTitle.js";import{isFromElement as l}from"../../support/UtilityNetworkAssociations/utils/isFromElement.js";const m="esri-feature-form-utility-network-association-settings",u={base:m,infoContainer:`${m}__info-container`};let d=class extends i{constructor(e,t){super(e,t),this.percentAlong=50,this.headingLevel=5,this.messagesFeature=null,this.messagesCommon=null,this.messagesFeatureForm=null,this.readOnly=!1,this.sourceFeature=null,this.targetFeature=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 association(){return this._get("association")}set association(e){this.percentAlong=e.percentAlong?100*e.percentAlong:50,this._set("association",e)}get associationType(){return this.association.associationType}set associationType(e){this.association.associationType=e,"junction-edge-to-connectivity"!==e&&"junction-edge-from-connectivity"!==e||(this.association.percentAlong=void 0)}render(){return c("div",{class:this.classes(u.base,s.widget)},this._renderFromAssociationEndpoint(),this._renderToAssociationEndpoint(),this._renderAdditionalContent())}_renderFromAssociationEndpoint(){const{associationType:e,association:t,sourceFeature:o,targetFeature:i,messagesFeatureForm:n}=this,s=l(o.feature,t)?o:i,r=s.label,c=a(t,"from",n.associations);switch(e){case"connectivity":case"junction-junction-connectivity":case"junction-edge-midspan-connectivity":case"junction-edge-from-connectivity":case"junction-edge-to-connectivity":return this._renderAssociationEndpoint(r,c,this._renderConnectivityContent(s.feature,t.fromNetworkElement))}return this._renderAssociationEndpoint(r,c)}_renderToAssociationEndpoint(){const{associationType:e,association:t,sourceFeature:o,targetFeature:i,messagesFeatureForm:n}=this,s=l(o.feature,t)?i:o,r=s.label,c=a(t,"to",n.associations);let m;switch(e){case"connectivity":case"junction-junction-connectivity":m=this._renderConnectivityContent(s.feature,t.toNetworkElement);break;case"containment":m=this._isNonspatial(s.feature)?null:this._renderContainmentContent()}return this._renderAssociationEndpoint(r,c,m)}_renderAssociationEndpoint(e,t,o){return c("calcite-block",{description:t,heading:e,open:!0},o)}_renderContainmentContent(){const{messagesFeatureForm:e,association:t}=this,o=t.isContentVisible??!1;return c("calcite-label",{layout:"inline"},e.associations.visible,c("calcite-switch",{checked:o,onCalciteSwitchChange:({currentTarget:e})=>{t.isContentVisible=e.checked}}))}_renderConnectivityContent(e,t){const{messagesFeatureForm:o,utilityNetwork:i}=this,n=i.getTerminalConfiguration(e),s=n?.terminals.map((e=>this._renderComboboxListItemNumber(e.id,t.terminalId,e.name)))||[];return c("calcite-label",null,o.associations.terminal,c("calcite-combobox",{allowCustomValues:!1,clearDisabled:!0,label:o.associations.terminalComboboxLabel,overlayPositioning:"fixed",selectionMode:"single",onCalciteComboboxChange:({currentTarget:e})=>{t.terminalId=parseInt(e.value,10)}},...s))}_renderAdditionalContent(){const{associationType:e}=this;switch(e){case"connectivity":case"junction-junction-connectivity":case"attachment":case"containment":return}const t="junction-edge-midspan-connectivity"===e?e:"junction-edge-from-connectivity",{messagesFeatureForm:o}=this,i=[this._renderComboboxListItemString("junction-edge-midspan-connectivity",t,o.associations.midspanEdge),this._renderComboboxListItemString("junction-edge-from-connectivity",t,o.associations.endpointEdge)];return c("div",{class:u.infoContainer},c("calcite-label",{key:"additional-content"},o.associations.connectTo,c("calcite-combobox",{allowCustomValues:!1,clearDisabled:!0,label:o.associations.edgeConnectionComboboxLabel,overlayPositioning:"fixed",selectionMode:"single",onCalciteComboboxChange:({currentTarget:e})=>{this.associationType=e.value}},...i)),"junction-edge-midspan-connectivity"===t?this._renderMidspanEdgeContent():this._renderEndpointEdgeContent())}_renderMidspanEdgeContent(){const{messagesFeatureForm:e,percentAlong:t,association:o}=this;return o.percentAlong=t/100,c("calcite-label",{key:"midspan-edge"},e.associations.midspanLocation,c("calcite-input-number",{max:100,min:0,numberButtonType:"vertical",suffixText:"%",value:`${t}`,onCalciteInputNumberInput:({currentTarget:e})=>{this.percentAlong=parseFloat(e.value)}}))}_renderEndpointEdgeContent(){const{associationType:e,messagesFeatureForm:t}=this,o="junction-edge-to-connectivity"===e;return c("calcite-label",{key:"endpoint-edge"},t.associations.edgeSide,c("calcite-label",{layout:"inline"},t.associations.fromSide,c("calcite-switch",{checked:o,onCalciteSwitchChange:({currentTarget:e})=>{const t=e.checked?"junction-edge-to-connectivity":"junction-edge-from-connectivity";this.associationType=t}}),t.associations.toSide))}_renderComboboxListItemNumber(e,t,o){return c("calcite-combobox-item",{heading:o,key:`#${e}`,selected:t===e,value:`${e}`})}_renderComboboxListItemString(e,t,o){return c("calcite-combobox-item",{heading:o,key:`#${e}`,selected:t===e,value:`${e}`})}_isNonspatial(e){const{sourceLayer:t}=e;return null!=t&&"geometryType"in t&&null==t.geometryType}};e([t()],d.prototype,"association",null),e([t()],d.prototype,"percentAlong",void 0),e([t()],d.prototype,"associationType",null),e([t()],d.prototype,"headingLevel",void 0),e([t(),r("esri/widgets/Feature/t9n/Feature")],d.prototype,"messagesFeature",void 0),e([t(),r("esri/t9n/common")],d.prototype,"messagesCommon",void 0),e([t(),r("esri/widgets/FeatureForm/t9n/FeatureForm")],d.prototype,"messagesFeatureForm",void 0),e([t()],d.prototype,"readOnly",void 0),e([t()],d.prototype,"sourceFeature",void 0),e([t()],d.prototype,"targetFeature",void 0),e([t()],d.prototype,"utilityNetwork",void 0),d=e([o("esri.widgets.FeatureForm.FeatureFormUtilityNetworkAssociations.UtilityNetworkAssociationSettings")],d);const p=d;export{p as default};
5
+ import{_ as e}from"../../../chunks/tslib.es6.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 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{getAssociationTitle as c}from"../../support/UtilityNetworkAssociations/utils/getAssociationTitle.js";import{isFromElement as l}from"../../support/UtilityNetworkAssociations/utils/isFromElement.js";const m="esri-feature-form-utility-network-association-settings",u={base:m,infoContainer:`${m}__info-container`};let d=class extends i{constructor(e,t){super(e,t),this.percentAlong=50,this.headingLevel=5,this.messagesFeature=null,this.messagesCommon=null,this.messagesFeatureForm=null,this.readOnly=!1,this.sourceFeature=null,this.targetFeature=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 association(){return this._get("association")}set association(e){this.percentAlong=e.percentAlong?100*e.percentAlong:50,this._set("association",e)}get associationType(){return this.association.associationType}set associationType(e){this.association.associationType=e,"junction-edge-to-connectivity"!==e&&"junction-edge-from-connectivity"!==e||(this.association.percentAlong=void 0)}render(){return a("div",{class:this.classes(u.base,s.widget)},this._renderFromAssociationEndpoint(),this._renderToAssociationEndpoint(),this._renderAdditionalContent())}_renderFromAssociationEndpoint(){const{associationType:e,association:t,sourceFeature:o,targetFeature:i,messagesFeatureForm:n}=this,s=l(o.feature,t)?o:i,r=s.label,a=c(t,"from",n.associations);switch(e){case"connectivity":case"junction-junction-connectivity":case"junction-edge-midspan-connectivity":case"junction-edge-from-connectivity":case"junction-edge-to-connectivity":return this._renderAssociationEndpoint(r,a,this._renderConnectivityContent(s.feature,t.fromNetworkElement))}return this._renderAssociationEndpoint(r,a)}_renderToAssociationEndpoint(){const{associationType:e,association:t,sourceFeature:o,targetFeature:i,messagesFeatureForm:n}=this,s=l(o.feature,t)?i:o,r=s.label,a=c(t,"to",n.associations);let m;switch(e){case"connectivity":case"junction-junction-connectivity":m=this._renderConnectivityContent(s.feature,t.toNetworkElement);break;case"containment":m=this._isNonspatial(s.feature)?null:this._renderContainmentContent()}return this._renderAssociationEndpoint(r,a,m)}_renderAssociationEndpoint(e,t,o){return a("calcite-block",{description:t,expanded:!0,heading:e},o)}_renderContainmentContent(){const{messagesFeatureForm:e,association:t}=this,o=t.isContentVisible??!1;return a("calcite-label",{layout:"inline"},e.associations.visible,a("calcite-switch",{checked:o,onCalciteSwitchChange:({currentTarget:e})=>{t.isContentVisible=e.checked}}))}_renderConnectivityContent(e,t){const{messagesFeatureForm:o,utilityNetwork:i}=this,n=i.getTerminalConfiguration(e),s=n?.terminals.map((e=>this._renderComboboxListItemNumber(e.id,t.terminalId,e.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:e})=>{t.terminalId=parseInt(e.value,10)}},...s))}_renderAdditionalContent(){const{associationType:e}=this;switch(e){case"connectivity":case"junction-junction-connectivity":case"attachment":case"containment":return}const t="junction-edge-midspan-connectivity"===e?e:"junction-edge-from-connectivity",{messagesFeatureForm:o}=this,i=[this._renderComboboxListItemString("junction-edge-midspan-connectivity",t,o.associations.midspanEdge),this._renderComboboxListItemString("junction-edge-from-connectivity",t,o.associations.endpointEdge)];return a("div",{class:u.infoContainer},a("calcite-label",{key:"additional-content"},o.associations.connectTo,a("calcite-combobox",{allowCustomValues:!1,clearDisabled:!0,label:o.associations.edgeConnectionComboboxLabel,overlayPositioning:"fixed",selectionMode:"single",onCalciteComboboxChange:({currentTarget:e})=>{this.associationType=e.value}},...i)),"junction-edge-midspan-connectivity"===t?this._renderMidspanEdgeContent():this._renderEndpointEdgeContent())}_renderMidspanEdgeContent(){const{messagesFeatureForm:e,percentAlong:t,association:o}=this;return o.percentAlong=t/100,a("calcite-label",{key:"midspan-edge"},e.associations.midspanLocation,a("calcite-input-number",{max:100,min:0,numberButtonType:"vertical",suffixText:"%",value:`${t}`,onCalciteInputNumberInput:({currentTarget:e})=>{this.percentAlong=parseFloat(e.value)}}))}_renderEndpointEdgeContent(){const{associationType:e,messagesFeatureForm:t}=this,o="junction-edge-to-connectivity"===e;return a("calcite-label",{key:"endpoint-edge"},t.associations.edgeSide,a("calcite-label",{layout:"inline"},t.associations.fromSide,a("calcite-switch",{checked:o,onCalciteSwitchChange:({currentTarget:e})=>{const t=e.checked?"junction-edge-to-connectivity":"junction-edge-from-connectivity";this.associationType=t}}),t.associations.toSide))}_renderComboboxListItemNumber(e,t,o){return a("calcite-combobox-item",{heading:o,key:`#${e}`,selected:t===e,value:`${e}`})}_renderComboboxListItemString(e,t,o){return a("calcite-combobox-item",{heading:o,key:`#${e}`,selected:t===e,value:`${e}`})}_isNonspatial(e){const{sourceLayer:t}=e;return null!=t&&"geometryType"in t&&null==t.geometryType}};e([t()],d.prototype,"association",null),e([t()],d.prototype,"percentAlong",void 0),e([t()],d.prototype,"associationType",null),e([t()],d.prototype,"headingLevel",void 0),e([t(),r("esri/widgets/Feature/t9n/Feature")],d.prototype,"messagesFeature",void 0),e([t(),r("esri/t9n/common")],d.prototype,"messagesCommon",void 0),e([t(),r("esri/widgets/FeatureForm/t9n/FeatureForm")],d.prototype,"messagesFeatureForm",void 0),e([t()],d.prototype,"readOnly",void 0),e([t()],d.prototype,"sourceFeature",void 0),e([t()],d.prototype,"targetFeature",void 0),e([t()],d.prototype,"utilityNetwork",void 0),d=e([o("esri.widgets.FeatureForm.FeatureFormUtilityNetworkAssociations.UtilityNetworkAssociationSettings")],d);const p=d;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.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../chunks/tslib.es6.js";import"../intl.js";import{isSome as t}from"../core/arrayUtils.js";import"../core/has.js";import i from"../core/Logger.js";import{createResolver as o}from"../core/promiseUtils.js";import s from"../core/ReactiveMap.js";import{watch as n,whenOnce as a,initial as r}from"../core/reactiveUtils.js";import{property as l}from"../core/accessorSupport/decorators/property.js";import{subclass as d}from"../core/accessorSupport/decorators/subclass.js";import{isIntegerField as c}from"../layers/support/fieldUtils.js";import{isSubtypeGroupLayer as u,getSubtypesFromLayer as p}from"../layers/support/layerUtils.js";import{isString as m}from"../support/guards.js";import h from"./Widget.js";import{Prompt as v}from"./Editor/components/Prompt.js";import{isRelatableFeatureSupportedLayer as _}from"./Feature/support/featureUtils.js";import{css as g}from"./FeatureForm/css.js";import{isUtilityNetworkAssociationInput as b,isGroupInput as f,isFieldInput as y,isRelationshipInput as C,isTextElementInput as F,flattenInputs as w,isInputInGroupInput as R,isFieldElementWithInputType as k,getErrorMessageForFieldInput as I,getIconForFeature as O,isNumberFieldInput as N,subtypeChangeShouldPrompt as M}from"./FeatureForm/featureFormUtils.js";import L from"./FeatureForm/FeatureFormViewModel.js";import A from"./FeatureForm/VisibleElements.js";import{loadCalciteComponents as T}from"./support/componentsUtils.js";import{getLabelForDateFieldValue as x,getIntlOptionsForField as D,numberingSystem as V,prepareISOFieldValueForDateComponents as S,prepareUnixFieldValueForDateComponents as U,normalizeTimeOnlyString as E,getISOFieldValueFromDateComponents as j,getUnixFieldValueFromDateComponents as $}from"./support/dateUtils.js";import{globalCss as P}from"./support/globalCss.js";import{Heading as H,incrementHeadingLevel as W}from"./support/Heading.js";import{setFocus as Z}from"./support/widgetUtils.js";import{messageBundle as G}from"./support/decorators/messageBundle.js";import{vmEvent as B}from"./support/decorators/vmEvent.js";import{tsx as K}from"./support/jsxFactory.js";import{substitute as q}from"../intl/substitute.js";import{formatNumber as z}from"../intl/number.js";const J="data-field-name";let Q=class extends h{constructor(e,t){super(e,t),this._associationsWidgetsMap=new s,this._attemptFocusOnNextRender=!1,this._dateComponentMap=new Map,this._inputsWithChanges=new Set,this._focusedFieldName=null,this._pendingSubtypeChoice=null,this._listObserverNode=null,this._listObserver=new IntersectionObserver((e=>{e.length&&e[0].isIntersecting&&this._incrementRelatedRecordPage()}),{root:window.document}),this._prompt=null,this._featureFormUNAssociationList=null,this.groupDisplay="all",this.headingLevel=2,this.messages=null,this.messagesCommon=null,this.messagesFeature=null,this.messagesTemplates=null,this.viewModel=new L,this.visibleElements=new A,this._onShowAllRelatedRecordsClick=e=>{const{feature:t,callbacks:i}=this;t&&i?.showAllRelatedRecords&&i.showAllRelatedRecords({parentFeature:t,relationshipId:e})},this._onAddRelatedRecordsClick=(e,t,i)=>{const{feature:o,callbacks:s}=this;let n=i;if(o&&s?.addRelatedRecord){if(u(i)&&e.activeCategory){const t=e.activeCategory.value,o=i.findSublayerForSubtypeCode(t);o&&_(o)&&(n=o)}s.addRelatedRecord({parentFeature:o,relatedLayer:n,relationshipId:t})}},this._onFormKeyDown=this._onFormKeyDown.bind(this),this._onFormSubmit=this._onFormSubmit.bind(this),this._onGroupToggle=this._onGroupToggle.bind(this),this._onComponentBlur=this._onComponentBlur.bind(this),this._onComponentFocus=this._onComponentFocus.bind(this),this._onComponentKeyDown=this._onComponentKeyDown.bind(this),this._afterComponentCreate=this._afterComponentCreate.bind(this),this._afterComponentCreateOrUpdate=this._afterComponentCreateOrUpdate.bind(this),this._afterDateComponentCreate=this._afterDateComponentCreate.bind(this),this._afterDateComponentCreateOrUpdate=this._afterDateComponentCreateOrUpdate.bind(this),this._afterRadioGroupCreateOrUpdate=this._afterRadioGroupCreateOrUpdate.bind(this)}initialize(){this.addHandles([n((()=>this.feature),(()=>{this._inputsWithChanges.clear(),this._dateComponentMap.clear(),a((()=>!this.viewModel.updating)).then((()=>{const e=this._getFocusableInput("forward");this._syncGroupInputStates(),this._focusedFieldName=e?.name||null,this._attemptFocusOnNextRender=!0}))})),n((()=>[this._featureFormUNAssociationList,this.visibleElements.associationDetails]),(([e,t])=>{e&&(e.visibleElements.associationDetails=t)}),r),n((()=>this.groupDisplay),(()=>this._syncGroupInputStates())),this.on("submit",(e=>{if(e.invalid.length>0){const[t]=e.invalid;e.invalid.forEach((e=>this._inputsWithChanges.add(e))),this._focusedFieldName=t,this._attemptFocusOnNextRender=!0,this.scheduleRender()}})),n((()=>[this.viewModel.activeRelationshipInput,this._listObserverNode]),(()=>this._onObserverChange())),n((()=>this.viewModel.activeAssociationInput),(e=>{e&&this._featureFormUNAssociationList&&(this._featureFormUNAssociationList.associationInput=e,this._featureFormUNAssociationList.viewModel=e.viewModel)})),n((()=>this.viewModel.inputs.filter(b)),(async e=>{this._featureFormUNAssociationList||await this._setUpUtilityNetworkAssociationList();for(const t of e)this._associationsWidgetsMap.has(t)||this._associationsWidgetsMap.set(t,await this._makeAssociationsWidget(t))}))])}loadDependencies(){return T({block:()=>import("@esri/calcite-components/dist/components/calcite-block"),button:()=>import("@esri/calcite-components/dist/components/calcite-button"),chip:()=>import("@esri/calcite-components/dist/components/calcite-chip"),combobox:()=>import("@esri/calcite-components/dist/components/calcite-combobox"),"combobox-item":()=>import("@esri/calcite-components/dist/components/calcite-combobox-item"),"combobox-item-group":()=>import("@esri/calcite-components/dist/components/calcite-combobox-item-group"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),input:()=>import("@esri/calcite-components/dist/components/calcite-input"),"input-date-picker":()=>import("@esri/calcite-components/dist/components/calcite-input-date-picker"),"input-message":()=>import("@esri/calcite-components/dist/components/calcite-input-message"),"input-number":()=>import("@esri/calcite-components/dist/components/calcite-input-number"),"input-time-picker":()=>import("@esri/calcite-components/dist/components/calcite-input-time-picker"),"input-time-zone":()=>import("@esri/calcite-components/dist/components/calcite-input-time-zone"),label:()=>import("@esri/calcite-components/dist/components/calcite-label"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),loader:()=>import("@esri/calcite-components/dist/components/calcite-loader"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice"),"radio-button":()=>import("@esri/calcite-components/dist/components/calcite-radio-button"),"radio-button-group":()=>import("@esri/calcite-components/dist/components/calcite-radio-button-group"),switch:()=>import("@esri/calcite-components/dist/components/calcite-switch"),"text-area":()=>import("@esri/calcite-components/dist/components/calcite-text-area")})}destroy(){this._listObserverNode&&this._listObserver.unobserve(this._listObserverNode)}get _relatedRecordsEnabled(){const{callbacks:e}=this;return!(!e||!(e.addRelatedRecord||e.editRelatedRecord||e.showAllRelatedRecords))}get _utilityNetworkAssociationsEnabled(){const{callbacks:e}=this;return!(!e?.viewAssociatedLayers||!e.viewAssociatedFeatures)}get _subtypes(){return p(this.layer)}get associationId(){return this.viewModel.associationId}set associationId(e){this.viewModel.associationId=e}get associatedLayer(){return this.viewModel.associatedLayer}set associatedLayer(e){this.viewModel.associatedLayer=e}get disabled(){return this.viewModel.disabled}set disabled(e){this.viewModel.disabled=e}get feature(){return this.viewModel.feature}set feature(e){this.viewModel.feature=e}get formTemplate(){return this.viewModel.formTemplate}set formTemplate(e){this.viewModel.formTemplate=e}get icon(){return"form-field"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get layer(){return this.viewModel.layer}set layer(e){this.viewModel.layer=e}get map(){return this.viewModel.map}set map(e){this.viewModel.map=e}get callbacks(){return this.viewModel.callbacks}set callbacks(e){this.viewModel.callbacks=e}get relationshipId(){return this.viewModel.relationshipId}set relationshipId(e){this.viewModel.relationshipId=e}get spatialReference(){return this.viewModel.spatialReference}set spatialReference(e){this.viewModel.spatialReference=e}get strict(){return this.viewModel.strict}set strict(e){this.viewModel.strict=e}get timeZone(){return this.viewModel.timeZone}set timeZone(e){this.viewModel.timeZone=e}get showPrompt(){return e=>{this._prompt?.cancel?.(),this._prompt=e}}set showPrompt(e){this._overrideIfSome("showPrompt",e)}get clearPrompt(){return()=>this._prompt=null}set clearPrompt(e){this._overrideIfSome("clearPrompt",e)}getValues(){return this.viewModel.getValues()}submit(){return this.viewModel.submit()}render(){const{state:e}=this.viewModel;return K("div",{class:this.classes(g.base,P.widget,P.panel)},"ready"===e?this._renderForm():null)}_renderForm(){return K("div",null,K("form",{class:g.form,inert:!!this._prompt,novalidate:!0,onkeydown:this._onFormKeyDown,onsubmit:this._onFormSubmit},this._renderHeader(),this._renderContent()),this._prompt?K(v,{...this._prompt,headingLevel:this.headingLevel}):void 0)}_renderHeader(){const e=this.viewModel,{formTitle:t,formDescription:i}=e;if(!e.formHeaderVisible)return;const o=null!=t&&K(H,{key:"title",level:this.headingLevel},t),s=null!=i&&K("p",{class:g.description,key:"description"},i);return K("div",{class:g.formHeader},o,s)}_renderContent(){const{viewModel:e}=this;return e.activeRelationshipInput?this._renderRelationshipInput(e.activeRelationshipInput):e.activeAssociationInput?this._renderFeatureFormUtilityNetworkAssociationList():e.inputs.filter(t).filter((e=>e.visible)).map((e=>this._renderInput(e)))}_renderInput(e){return f(e)?this._renderGroup(e):y(e)?this._renderLabeledField(e):C(e)?this._renderRelationshipInput(e):F(e)?this._renderTextElementInput(e):b(e)?this._renderUtilityNetworkAssociationsElementInput(e):void 0}_renderFeatureFormUtilityNetworkAssociationList(){return this._featureFormUNAssociationList?.render()}_selectAssociatedLayer(e){const{feature:t,callbacks:i}=this;t&&i?.viewAssociatedFeatures&&i.viewAssociatedFeatures({associatedLayer:e.layer})}async _selectAssociatedFeature(e){const{feature:t,callbacks:i}=this;t&&i?.selectAssociatedFeature&&await i.selectAssociatedFeature({parentFeature:t,...e})}_onAddAssociation(e){const{feature:t,callbacks:i}=this;t&&i?.addAssociation&&i.addAssociation(e)}async _setUpUtilityNetworkAssociationList(){if(!this._featureFormUNAssociationList){const e=(await import("./FeatureForm/FeatureFormUtilityNetworkAssociations/FeatureFormUtilityNetworkAssociationList.js")).default;this._featureFormUNAssociationList=new e({onSelectLayer:this._selectAssociatedLayer.bind(this),onSelectFeature:this._selectAssociatedFeature.bind(this),onAddAssociation:this._onAddAssociation.bind(this)})}}async _makeAssociationsWidget(e){return new(0,(await import("./Feature/FeatureUtilityNetworkAssociations.js")).default)({onSelectAssociationType:({viewModel:t,listType:i})=>{t.activeAssociationType=i;const{feature:o,callbacks:s}=this;o&&s?.viewAssociatedLayers&&s.viewAssociatedLayers({associationId:e.uid})},viewModel:e.associationsViewModel})}_renderUtilityNetworkAssociationsElementInput(e){if(this._utilityNetworkAssociationsEnabled)return this._associationsWidgetsMap.get(e)?.render()}_renderDescriptionOrEmpty(e,t){return null==e?null:K("div",{class:this.classes(g.description),id:t},e)}_renderGroup(e){const{disabled:t,formTemplate:i,headingLevel:o}=this,{description:s,id:n,inputs:a,label:r,open:l}=e,d=a.filter((e=>e.visible)),c=this.viewModel.findField(this._focusedFieldName),u=c?.group===e,p="sequential"===this.groupDisplay;return K("calcite-block",{class:this.classes(g.group,p?g.groupSequential:null,u?g.groupActive:null,t?g.inputDisabled:null),collapsible:!0,"data-group":e,description:s||void 0,disabled:t,heading:r??"",headingLevel:i?.title?W(o):o,id:n,key:n,open:l,onCalciteBlockToggle:({currentTarget:t})=>this._onGroupToggle(t,e)},d.map((e=>this._renderInput(e))))}_getFocusableInput(e,t){const i=w(this.viewModel.inputs);let o;if("backward"===e&&i.reverse(),t)if(f(t)){const e=t.inputs.find((e=>e.visible));o=e?i.indexOf(e):0}else{let s;if(R(t)&&!t.group.open){const i=t.group.inputs.filter(y);s="forward"===e?i[i.length-1]:i[0]}else s=t;o=i.indexOf(s)+1}else o=0;for(let s=o;s<i.length;s++){const e=i[s];if(e.visible&&y(e))return e}return null}_renderLabeledField(e){const{dataType:t,feature:i,label:o,layer:s,required:n}=e,a={"aria-label":n?q(this.messages.requiredFieldLabel,{name:o}):o,class:g.label,key:`${s.id}-${i.uid}-${e.name}`},r=[K("div",{class:g.labelTextContent,key:"labelTextContainer"},o,n?K("span",{"aria-hidden":"true",title:this.messagesCommon.required},"*"):void 0),"unsupported"!==t?this._renderFieldInput(e):this._renderReadOnlyComponent(e),this._renderAuxiliaryText(e)];return"date"===t&&"coded-value"!==e.domain?.type?K("label",{...a},r):K("calcite-label",{...a},r)}_renderFieldInput(e){const{dataType:t,domain:i,inputType:o,name:s}=e,n=this.getCommonInputProps(e);if("coded-value"===i?.type){const t=this.viewModel.getFieldValueOptionsForField(s,this.messages.empty);return"switch"!==o||e.hasInvalidSwitchValue?"radio-buttons"===o?this._renderRadioButtonComponents(e,t.flat(),n):this._renderComboBoxComponent(e,t,n):this._renderSwitchComponent(e,n)}return"datetime-picker"===o||"date"===t?this._renderDateComponents(e,n):"number"===t?this._renderNumberComponent(e,n):this._renderStringComponent(e,n)}_renderStringComponent(e,t){return"text-area"===e.inputType?t.readOnly?K("calcite-input",{...t,loading:e.updating,type:"textarea",onCalciteInputInput:e=>this._saveValueFromComponent(e.currentTarget)}):K("calcite-text-area",{...t,resize:"vertical",onCalciteTextAreaInput:e=>this._saveValueFromComponent(e.currentTarget)}):K("calcite-input",{...t,loading:e.updating,type:"text",onCalciteInputInput:e=>this._saveValueFromComponent(e.currentTarget)})}_renderNumberComponent(e,t){const i=c(e.field),o=i&&""!==t.value?Math.round(parseFloat(t.value)).toString():t.value;return K("calcite-input-number",{...t,integer:i,loading:e.updating,type:"number",value:o,onCalciteInputNumberInput:e=>this._saveValueFromComponent(e.currentTarget)})}_renderDateComponents(e,t){const{field:i}=e;switch(i.type){case"date":return this._renderDateFieldComponents(e,t);case"date-only":return this._renderDateOnlyFieldComponent(e,t);case"time-only":return this._renderTimeOnlyFieldComponent(e,t);case"timestamp-offset":return this._renderTimestampOffsetFieldComponents(e,t);default:return this._renderReadOnlyComponent(e,x(i,t.value,{timeZone:this.timeZone,...D(i)}))}}_renderDateOnlyFieldComponent(e,t){const{range:i,valid:o,value:s}=e,{class:n,key:a,readOnly:r}=t,{rawMax:l,rawMin:d}=i;return K("calcite-input-date-picker",{afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterDateComponentCreateOrUpdate,"aria-invalid":!o,class:n,"data-date-part":"date","data-field-name":t[J],key:`${a}-date-input`,max:m(l)?l:void 0,min:m(d)?d:void 0,numberingSystem:V,onblur:e=>{this._focusedFieldName=null,this._saveValueFromDateComponent(e.target)},onfocus:this._onComponentFocus,overlayPositioning:"fixed",readOnly:r,value:null!=s?`${s}`:void 0,onCalciteInputDatePickerChange:e=>this._saveValueFromDateComponent(e.currentTarget)})}_renderTimeOnlyFieldComponent(e,t){const{valid:i,value:o}=e,{class:s,key:n,readOnly:a}=t;return K("calcite-input-time-picker",{afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterDateComponentCreateOrUpdate,"aria-invalid":!i,class:s,"data-date-part":"time","data-field-name":t[J],key:`${n}-time-input`,numberingSystem:V,onblur:e=>{this._focusedFieldName=null,this._saveValueFromDateComponent(e.target)},onfocus:this._onComponentFocus,overlayPositioning:"fixed",readOnly:a,step:e.timeStep,value:null!=o?`${o}`:void 0,onCalciteInputTimePickerChange:e=>this._saveValueFromDateComponent(e.currentTarget)})}_renderTimestampOffsetFieldComponents(e,t){const{name:i,range:o,timeZone:s,valid:n,value:a}=e,{class:r,key:l,readOnly:d}=t,{rawMax:c,rawMin:u}=o,p={afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterDateComponentCreateOrUpdate,"aria-invalid":!n,numberingSystem:V,overlayPositioning:"fixed",readOnly:d,[J]:i,onfocus:this._onComponentFocus},m=S(c,s),h=S(u,s),v=S(a,s);return K("div",{class:g.dateInputContainer,key:`${l}-date-time-container`},K("calcite-input-date-picker",{...p,class:r,"data-date-part":"date",key:`${l}-date-input`,max:m?.date??void 0,min:h?.date??void 0,onblur:e=>{this._focusedFieldName=null,this._saveValueFromDateComponent(e.target)},value:v.date??void 0,onCalciteInputDatePickerChange:e=>this._saveValueFromDateComponent(e.currentTarget)}),K("calcite-input-time-picker",{...p,class:r,"data-date-part":"time",key:`${l}-time-input`,onblur:e=>{this._focusedFieldName=null,this._saveValueFromDateComponent(e.target)},step:e.timeStep,value:v.time??void 0,onCalciteInputTimePickerChange:e=>this._saveValueFromDateComponent(e.currentTarget)}),e.includeTimeOffset?K("calcite-input-time-zone",{...p,class:r,"data-date-part":"timeZone",disabled:d,key:`${l}-timezone-input`,onblur:e=>{this._focusedFieldName=null,this._saveValueFromDateComponent(e.target)},value:v.timeZoneOffset??"0",onCalciteInputTimeZoneChange:e=>this._saveValueFromDateComponent(e.currentTarget)}):null)}_renderDateFieldComponents(e,t){const{includeTime:i,name:o,valid:s,value:n}=e,{class:a,key:r,max:l,min:d,readOnly:c}=t,{timeZone:u}=this,p={afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterDateComponentCreateOrUpdate,"aria-invalid":!s,numberingSystem:V,overlayPositioning:"fixed",readOnly:c,[J]:o,onfocus:this._onComponentFocus},m=U(n,u),h=U(l,u),v=U(d,u);return K("div",{class:g.dateInputContainer,key:`${r}-date-time-container`},K("calcite-input-date-picker",{...p,class:a,"data-date-part":"date",key:`${r}-date-input`,max:h?.date??void 0,min:v?.date??void 0,onblur:e=>{this._focusedFieldName=null,this._saveValueFromDateComponent(e.target)},value:m.date??void 0,onCalciteInputDatePickerChange:e=>this._saveValueFromDateComponent(e.currentTarget)}),i?K("calcite-input-time-picker",{...p,class:a,"data-date-part":"time",key:`${r}-time-input`,onblur:e=>{this._focusedFieldName=null,this._saveValueFromDateComponent(e.target)},step:1,value:m.time??void 0,onCalciteInputTimePickerChange:e=>this._saveValueFromDateComponent(e.currentTarget)}):null)}_renderReadOnlyComponent(e,t){const i=this.getCommonInputProps(e);return K("calcite-input",{...i,class:this.classes(g.fieldInput,g.inputDisabled),readOnly:!0,type:"text",value:null!=t?`${t}`:i.value})}_renderComboBoxComponent(e,t,i){const{value:o,name:s}=e,{viewModel:n,_inputsWithChanges:a}=this,r="INSERT"===n.editType,l=a.has(s),d=null==o&&(!r||l),c=r&&e.showNoValueOptionEnabled&&!l?()=>{}:i.onblur;return K("calcite-combobox",{...i,allowCustomValues:!1,clearDisabled:!0,disabled:i.readOnly,onblur:c,overlayPositioning:"fixed",selectionMode:"single",onCalciteComboboxChange:({currentTarget:t})=>{d&&0===t.selectedItems.length?this._ignoreDeselectionOfNoValueOption(t):e.isSubtypeField&&0===t.selectedItems.length?t.value=`${e.value}`:this._saveValueFromComponent(t)}},this.renderComboboxOptionsList(e,t))}renderComboboxOptionsList(e,t){const{value:i,name:o}=e,{messages:s,messagesTemplates:n,viewModel:a,_inputsWithChanges:r}=this,[l,d,c]=t.map((e=>e.map((({name:e,value:t})=>K("calcite-combobox-item",{key:`#${t}`,selected:i===t,textLabel:e,value:`${t}`}))))),u=[];d.length>0&&u.push(K("calcite-combobox-item-group",{key:"other",label:n.other},d)),c.length>0&&u.push(K("calcite-combobox-item-group",{key:"unsupported",label:s.subtypes.unsupportedDomainGroupTitle},c)),u.length>0?u.unshift(K("calcite-combobox-item-group",{key:"recommended",label:s.recommended},l)):u.push(...l);const p="INSERT"===a.editType,m=r.has(o),h=null==i&&(!p||m);return e.showNoValueOptionEnabled&&u.unshift(K("calcite-combobox-item",{key:"empty-option",selected:h,textLabel:e.showNoValueLabel||s.empty,value:""})),u}_renderRadioButtonComponents(e,t,i){const{name:o,value:s}=e,n=t.map((({name:e,value:t})=>this._renderRadioButtonComponent({key:e,label:e,name:o,value:t,selected:t===s,props:i})));if(e.showNoValueOptionEnabled){const t="",a=e.showNoValueLabel||this.messages.empty,r=s===t||null===s;n.unshift(this._renderRadioButtonComponent({key:"empty-option",label:a,name:o,value:t,selected:r,props:i}))}return K("calcite-radio-button-group",{afterCreate:this._afterRadioGroupCreateOrUpdate,afterUpdate:this._afterRadioGroupCreateOrUpdate,class:g.inputRadioGroup,"data-field-name":i[J],key:`${i.key}-radio-group`,layout:"vertical",name:i.key,required:i.required},n)}_renderSwitchComponent(e,t){const{value:i}=e,o=!!k(e.element,"switch")&&i===e.element.input.onValue;return K("calcite-switch",{...t,checked:o,class:g.inputSwitch,disabled:t.readOnly,onblur:()=>{this._focusedFieldName=null},onCalciteSwitchChange:e=>this._saveValueFromComponent(e.currentTarget)})}_renderRadioButtonComponent({key:e,name:t,value:i,selected:o,label:s,props:n}){return K("calcite-label",{class:g.inputRadioLabel,key:e,layout:"inline"},K("calcite-radio-button",{...n,afterCreate:void 0,afterUpdate:void 0,checked:o,class:g.inputRadio,disabled:n.readOnly,name:t,onblur:()=>{this._focusedFieldName=null},value:i,onCalciteRadioButtonChange:({currentTarget:e})=>{e.checked&&this._saveValueFromComponent(e)}}),s)}_renderAuxiliaryText(e){const t=e.name,i=this._inputsWithChanges.has(t)&&!e.submittable?I(e,this.messages,this.timeZone):null!=this.viewModel.contingencyConstraintViolations.get(t)?this.messages.validationErrors.valuesIncompatible:null!=e.valueExpressionExecutor&&e.valueExpressionExecutor.stale?this.messages.valueExpressionError:null;return null!=i?K("calcite-input-message",{icon:!0,status:"invalid"},i):this._inputsWithChanges.has(t)&&e.valueIsOutOfDomain?K("calcite-input-message",{icon:!0,status:"idle"},this.messages.subtypes.fieldOutOfSubtypeDomainWarning):this._renderDescriptionOrEmpty(e.description)}_renderShowAllRelatedRecordsListItem(e){if(!e.showAllActionVisible||!this.callbacks?.showAllRelatedRecords)return;const t=this.messages;return K("calcite-list-item",{description:q(t.totalCount,{count:e.featureCount}),key:"show-all-related-features",label:t.showAll,value:!0,onCalciteListItemSelect:()=>this._onShowAllRelatedRecordsClick(e.relationshipId)},K("calcite-icon",{icon:"list",scale:"s",slot:"content-end"}))}_renderAddRelatedRecordButton(e){const{canAddRelatedFeature:t,relationshipId:i,relatedLayer:o}=e,{messages:s,callbacks:n}=this;if(t&&n?.addRelatedRecord&&o)return K("calcite-button",{alignment:"center",appearance:"outline-fill",class:g.centeredButton,disabled:e.updating||!e.originHasValidKey,iconStart:"plus",key:`${i}-add-button`,onclick:()=>{!e.updating&&e.originHasValidKey&&this._onAddRelatedRecordsClick(e,i,o)},round:!0,scale:"s",width:"full"},e.relatedLayerIsTable?s.addRecord:s.addFeature)}_renderRelatedRecordListItem(e,t){const{feature:i,description:o,title:s}=e,{feature:n,callbacks:a}=this,{highlightHelper:r}=this.viewModel,l=()=>{r?.removeAll(),a?.editRelatedRecord&&n&&a.editRelatedRecord({parentFeature:n,relationshipId:t,relatedFeature:i})},d=r?()=>r.add(i):void 0,c=r?()=>r.remove(i):void 0;return K("calcite-list-item",{bind:this,description:o,key:`${t}-${i.uid}`,label:s,onclick:l,onmouseenter:d,onmouseleave:c,value:s},K("calcite-icon",{icon:O(i),slot:"content-start"}),K("calcite-icon",{icon:"chevron-right",scale:"s",slot:"content-end"}))}_renderRelationshipInput(e){if(!this._relatedRecordsEnabled||!e.editable)return;const{relationshipId:t,activeCategory:i}=e,o=i?null:this._renderDescriptionOrEmpty(e.description);return K("calcite-label",{class:this.classes(g.label,g.relatedRecordsLabel),key:`relationship-${t}-container`},K("div",null,this._renderRelatedRecordsHeaderContainer(e),o,this._renderRelationshipInputContent(e)),this._renderAddRelatedRecordButton(e))}_renderRelationshipInputContent(e){return e.featureCount>0?this._renderRelatedRecordsList(e):e.activeCategory&&0===e.featureCount?this._renderNoRelatedRecordsNotice():e.allCategories?.length?this._renderCategoryList(e):e.loaded?e.originHasValidKey?this._renderNoRelatedRecordsNotice():this._renderNoValidOriginKeyNotice(e):void 0}_renderCategoryList(e){return K("calcite-list",{displayMode:"flat",label:this.messages.relatedRecordsList,loading:e.updating},e.categories?.map((t=>this._renderCategory(e,t))),this._renderShowAllCategoriesListItem(e))}_renderCategory(e,t){const{count:i,name:o,value:s}=t,n=z(i);return K("calcite-list-item",{key:`${o}-${s}`,label:o,onCalciteListItemSelect:()=>this._selectCategory(e,t)},K("calcite-chip",{label:n,scale:"s",slot:"content-end"},n),K("calcite-icon",{flipRtl:!0,icon:"chevron-left",scale:"s",slot:"content-end"}))}_selectCategory(e,t){this.relationshipId=e.relationshipId,e.activeCategory=t}_renderShowAllCategoriesListItem(e){if(!e.showAllCategoriesVisible)return;const t=this.messages;return K("calcite-list-item",{description:q(t.totalCount,{count:e.allCategories?.length??0}),key:"show-all-categories",label:t.showAll,value:!0,onCalciteListItemSelect:()=>e.showAllEnabled=!0},K("calcite-icon",{icon:"list",scale:"s",slot:"content-end"}))}_renderRelatedRecordsHeaderContainer(e){const t=e.updating||!e.loaded;return K("div",{class:g.relatedRecordsHeader,key:`relationship-${e.relationshipId}-header`},K("span",null,e.label),t?K("calcite-loader",{inline:!0,key:"loader",label:this.messagesCommon?.loading,scale:"s",type:"indeterminate"}):void 0)}_renderRelatedRecordsList(e){const{relationshipId:t}=e;return K("calcite-list",{class:g.relatedRecordsList,label:this.messages?.relatedRecordsList},e.relatedFeatureInfos.map((e=>this._renderRelatedRecordListItem(e,t))),this._renderShowAllRelatedRecordsListItem(e),this._renderObserverNode())}_renderNoValidOriginKeyNotice(e){const{messages:t}=this,i=e.relatedLayerIsTable?t.noOriginKeyRecord:t.noOriginKeyFeature,o=e.relationship?.keyField,s=this.viewModel.findField(o),n=e.layer?.fieldsIndex.get(o),a=s?.label||n?.alias||o,r=q(i,{relatedLayerName:e.relatedLayer?.title,originKeyField:a});return K("calcite-notice",{icon:"information",kind:"brand",open:!0,scale:"s",width:"full"},K("div",{slot:"message"},r))}_renderNoRelatedRecordsNotice(){return K("calcite-notice",{icon:"information",kind:"brand",open:!0,scale:"s",width:"full"},K("div",{slot:"message"},this.messagesFeature.noRelatedFeatures))}_renderObserverNode(){if(this.viewModel.activeRelationshipInput?.showAllEnabled)return K("div",{afterCreate:this._afterListObserverCreated,afterRemoved:this._afterListObserverRemoved,bind:this,class:g.listObserver,key:"feature-observer"})}_renderTextElementInput(e){return K("div",{class:g.textElement,"data-testid":`text-element-${e.label}`,innerHTML:e.text,key:e.id})}getCommonInputProps(e){const{disabled:t}=this,{editable:i,hint:o,label:s,maxLength:n,minLength:a,name:r,range:{max:l,min:d},required:c,valid:u,value:p}=e,m=this._inputsWithChanges.has(r),h=!i||t;return{afterCreate:this._afterComponentCreate,afterUpdate:this._afterComponentCreateOrUpdate,"aria-invalid":u?"false":"true",class:this.classes(g.fieldInput,h?g.inputDisabled:null),status:m&&!u?"invalid":"idle",key:r,label:s,max:null!=l?l:void 0,min:null!=d?d:void 0,maxLength:n>-1?n:void 0,minLength:a>-1?a:void 0,placeholder:o??void 0,readOnly:h,required:c,value:null==p?"":`${p}`,onblur:this._onComponentBlur,onfocus:this._onComponentFocus,onkeydown:this._onComponentKeyDown,[J]:r}}_getFieldInputFromHTMLElement(e){return this.viewModel.findField(e.getAttribute(J))}_afterDateComponentCreate(e){const t=this._getFieldInputFromHTMLElement(e),i=e.dataset.datePart,o=this._dateComponentMap.get(t.name);if("valueAsDate"in e&&null!=e.value&&null!=t.value){const i=new ResizeObserver((()=>{switch(e.value=void 0,t.field.type){case"date":e.value=U(t.value,this.timeZone).date??"";break;case"timestamp-offset":e.value=S(t.value,this.timeZone).date??"";break;default:e.value=`${t.value}`}i.unobserve(e)}));i.observe(e)}if(null!=o)switch(i){case"date":o.date=e;break;case"time":o.time=e;break;case"timeZone":o.timeZone=e}else this._dateComponentMap.set(t.name,{[i]:e});this._afterDateComponentCreateOrUpdate(e)}_afterDateComponentCreateOrUpdate(e){this._afterComponentCreateOrUpdate(e)}_afterComponentCreate(e){const t=this._getFieldInputFromHTMLElement(e);N(t)&&null!=e.value&&"setNumberValue"in e&&e.setNumberValue({committing:!1,value:e.value,origin:"direct"}),this._afterComponentCreateOrUpdate(e)}_afterRadioGroupCreateOrUpdate(e){const t=e.selectedItem,i=e.querySelector("calcite-radio-button"),o=t||i;o&&this._afterComponentCreateOrUpdate(o)}_afterComponentCreateOrUpdate(e){const{viewModel:t}=this,i=this._getFieldInputFromHTMLElement(e),o=t.findField(this._focusedFieldName);this._attemptFocusOnNextRender&&o===i&&(this._attemptFocusOnNextRender=!1,R(i)&&(i.group.open=!0),Z(e))}_onComponentFocus(e){const t=e.target,i=this._getFieldInputFromHTMLElement(t);this._focusedFieldName=i.name}_onComponentBlur(e){const t=e.target;this._focusedFieldName=null;"readOnly"in t&&t.readOnly||this._saveValueFromComponent(t)}_saveValueFromDateComponent(e){const{timeZone:t}=this,i=this._getFieldInputFromHTMLElement(e),o=i.field.type,{name:s,range:n}=i,a=this._dateComponentMap.get(s);if(!a)return;let r=this.viewModel.getValue(s),l=null;"date-only"===o?l=Array.isArray(e.value)?e.value[0]:e.value:"time-only"===o?(r=E(r),l=E(e.value)):l="timestamp-offset"===o?null!=e.value?j({dateComponent:a.date,timeComponent:a.time,timeZoneComponent:a.timeZone,oldValue:r,defaultTimeZone:t}):null:null!=e.value?$({oldValue:r,dateComponent:a.date,timeComponent:a.time,timeZone:t,max:n.max,min:n.min}):null,null!==l&&e.value?r!==l&&this._updateFieldValue(s,l):this._updateFieldValue(s,null)}_saveValueFromComponent(e){const t=this._getFieldInputFromHTMLElement(e),i=this._parseValue(e),o=t.value;t.isSubtypeField&&M(this.layer,o,i)?this._pendingSubtypeChoice||i===o||(this._pendingSubtypeChoice=this._handleSubtypeChoice(t,i)):this._updateFieldValue(t.name,i)}async _handleSubtypeChoice(e,t){const{value:i,name:s}=e,{messages:n,viewModel:a,messagesCommon:r,_subtypes:l}=this;if(this._updateFieldValue(s,t),!l?.length)return;const d=l.find((e=>e.code===t)),c=l.find((e=>e.code===i))?.name??`${i}`;if(!d)return;const u=o();a.pendingSubtypeChoice=u;let p="update-fields";const m=[{label:n.subtypes.useDefaultValuesOption,value:"update-fields"},{label:n.subtypes.keepCurrentValuesOption,value:"keep-existing"}],h={context:"info",title:n.subtypes.changeWarningTitle,message:q(n.subtypes.changeWarning,{originalType:c,newType:d.name}),radios:m,defaultRadioSelection:"update-fields",onRadioSelection:e=>p=e,actions:{primary:{label:r.apply,action:()=>u.resolve(p),type:"positive"},secondary:{label:r.cancel,type:"neutral",action:()=>u.resolve("undo")}},cancel:()=>u.reject()};try{this.showPrompt(h);switch(await u.promise){case"update-fields":a.applySubtypeDefaults(d),this._validateContingenciesForNonNullFields();break;case"keep-existing":this._validateContingenciesForNonNullFields();break;case"undo":this._updateFieldValue(e.name,i)}}finally{a.pendingSubtypeChoice=null,this.clearPrompt(),this._pendingSubtypeChoice=null}}_onComponentKeyDown({key:e,target:t}){const i=this._getFieldInputFromHTMLElement(t);"Enter"===e&&R(i)&&!i.group.open&&(i.group.open=!0)}_updateFieldValue(e,t){const i=this.viewModel.getValue(e);this.viewModel.setValue(e,t),this._inputsWithChanges.add(e);i!==t&&this.viewModel.fieldsWithContingentValues.has(e)&&this._validateContingenciesForNonNullFields()}_validateContingenciesForNonNullFields(){const e=Object.fromEntries(Object.entries(this.getValues()).filter((([e,t])=>null!=t)));this.viewModel.validateContingencyConstraints(e)}_parseValue(e){const t=this._getFieldInputFromHTMLElement(e),i=e.value;return k(t.element,"switch")?e.checked?t.element.input.onValue:t.element.input.offValue:null==i||""===i?null:"number"===t.dataType?"-0"===i||"-0."===i||"-0,"===i?i:parseFloat(i):"date"===t.field.type?parseFloat(i):i}_ignoreDeselectionOfNoValueOption(e){const{firstChild:t,selectedItems:o}=e;0===o.length&&t&&"selected"in t?t.selected=!0:i.getLogger(this).warnOnce("Failed to override user attempt to deselect 'No value' option.")}_onGroupToggle(e,t){e.open?(t.open=!0,this._focusedFieldName=this._getFocusableInput("forward",t)?.name||null,this._attemptFocusOnNextRender=!0,"sequential"===this.groupDisplay&&this.viewModel.allGroupInputs.forEach((e=>{e!==t&&(e.open=!1)}))):t.open=!1,this.scheduleRender()}_onFormSubmit(e){e.preventDefault()}_onFormKeyDown(e){"Enter"===e.key&&this.viewModel.submit()}_afterListObserverCreated(e){this.viewModel.activeRelationshipInput&&(this._listObserverNode=e)}_afterListObserverRemoved(){this._listObserverNode=null}_onObserverChange(){this._listObserverNode&&this._listObserver.unobserve(this._listObserverNode);const e=this.viewModel.activeRelationshipInput;e&&this._listObserverNode&&e.showAllEnabled&&this._listObserver.observe(this._listObserverNode)}_incrementRelatedRecordPage(){const e=this.viewModel.activeRelationshipInput;e?.incrementPage()}_syncGroupInputStates(){if("sequential"!==this.groupDisplay)return;const e=this.viewModel.allGroupInputs;if(!e.length)return;const t=e.filter((e=>e.open));0===t.length?e[0].open=!0:t.length>1&&t.slice(1).forEach((e=>e.open=!1))}get test(){return{inputsWithChanges:this._inputsWithChanges,updateValue:this._saveValueFromComponent.bind(this)}}};e([l()],Q.prototype,"_listObserverNode",void 0),e([l()],Q.prototype,"_relatedRecordsEnabled",null),e([l()],Q.prototype,"_utilityNetworkAssociationsEnabled",null),e([l()],Q.prototype,"_prompt",void 0),e([l()],Q.prototype,"_subtypes",null),e([l()],Q.prototype,"associationId",null),e([l()],Q.prototype,"associatedLayer",null),e([l()],Q.prototype,"disabled",null),e([l()],Q.prototype,"feature",null),e([l()],Q.prototype,"_featureFormUNAssociationList",void 0),e([l()],Q.prototype,"formTemplate",null),e([l()],Q.prototype,"groupDisplay",void 0),e([l()],Q.prototype,"headingLevel",void 0),e([l()],Q.prototype,"icon",null),e([l()],Q.prototype,"label",null),e([l()],Q.prototype,"layer",null),e([l()],Q.prototype,"map",null),e([l(),G("esri/widgets/FeatureForm/t9n/FeatureForm")],Q.prototype,"messages",void 0),e([l(),G("esri/t9n/common")],Q.prototype,"messagesCommon",void 0),e([l(),G("esri/widgets/Feature/t9n/Feature")],Q.prototype,"messagesFeature",void 0),e([l(),G("esri/widgets/FeatureTemplates/t9n/FeatureTemplates")],Q.prototype,"messagesTemplates",void 0),e([l()],Q.prototype,"callbacks",null),e([l()],Q.prototype,"relationshipId",null),e([l()],Q.prototype,"spatialReference",null),e([l()],Q.prototype,"strict",null),e([l()],Q.prototype,"timeZone",null),e([l()],Q.prototype,"showPrompt",null),e([l()],Q.prototype,"clearPrompt",null),e([l(),B(["value-change","submit"])],Q.prototype,"viewModel",void 0),e([l({type:A,nonNullable:!0})],Q.prototype,"visibleElements",void 0),e([l()],Q.prototype,"test",null),Q=e([d("esri.widgets.FeatureForm")],Q);const X=Q;export{X as default};
5
+ import{_ as e}from"../chunks/tslib.es6.js";import"../intl.js";import{isSome as t}from"../core/arrayUtils.js";import"../core/has.js";import i from"../core/Logger.js";import{createResolver as o}from"../core/promiseUtils.js";import s from"../core/ReactiveMap.js";import{watch as n,whenOnce as a,initial as r}from"../core/reactiveUtils.js";import{property as l}from"../core/accessorSupport/decorators/property.js";import{subclass as d}from"../core/accessorSupport/decorators/subclass.js";import{isIntegerField as c}from"../layers/support/fieldUtils.js";import{isSubtypeGroupLayer as u,getSubtypesFromLayer as p}from"../layers/support/layerUtils.js";import{isString as m}from"../support/guards.js";import h from"./Widget.js";import{Prompt as v}from"./Editor/components/Prompt.js";import{isRelatableFeatureSupportedLayer as _}from"./Feature/support/featureUtils.js";import{css as g}from"./FeatureForm/css.js";import{isUtilityNetworkAssociationInput as b,isGroupInput as f,isFieldInput as y,isRelationshipInput as C,isTextElementInput as F,flattenInputs as w,isInputInGroupInput as R,isFieldElementWithInputType as k,getErrorMessageForFieldInput as I,getIconForFeature as O,isNumberFieldInput as N,subtypeChangeShouldPrompt as M}from"./FeatureForm/featureFormUtils.js";import L from"./FeatureForm/FeatureFormViewModel.js";import A from"./FeatureForm/VisibleElements.js";import{loadCalciteComponents as T}from"./support/componentsUtils.js";import{getLabelForDateFieldValue as x,getIntlOptionsForField as D,numberingSystem as V,prepareISOFieldValueForDateComponents as S,prepareUnixFieldValueForDateComponents as U,normalizeTimeOnlyString as E,getISOFieldValueFromDateComponents as j,getUnixFieldValueFromDateComponents as $}from"./support/dateUtils.js";import{globalCss as P}from"./support/globalCss.js";import{Heading as H,incrementHeadingLevel as W}from"./support/Heading.js";import{setFocus as Z}from"./support/widgetUtils.js";import{messageBundle as G}from"./support/decorators/messageBundle.js";import{vmEvent as B}from"./support/decorators/vmEvent.js";import{tsx as K}from"./support/jsxFactory.js";import{substitute as q}from"../intl/substitute.js";import{formatNumber as z}from"../intl/number.js";const J="data-field-name";let Q=class extends h{constructor(e,t){super(e,t),this._associationsWidgetsMap=new s,this._attemptFocusOnNextRender=!1,this._dateComponentMap=new Map,this._inputsWithChanges=new Set,this._focusedFieldName=null,this._pendingSubtypeChoice=null,this._listObserverNode=null,this._listObserver=new IntersectionObserver((e=>{e.length&&e[0].isIntersecting&&this._incrementRelatedRecordPage()}),{root:window.document}),this._prompt=null,this._featureFormUNAssociationList=null,this.groupDisplay="all",this.headingLevel=2,this.messages=null,this.messagesCommon=null,this.messagesFeature=null,this.messagesTemplates=null,this.viewModel=new L,this.visibleElements=new A,this._onShowAllRelatedRecordsClick=e=>{const{feature:t,callbacks:i}=this;t&&i?.showAllRelatedRecords&&i.showAllRelatedRecords({parentFeature:t,relationshipId:e})},this._onAddRelatedRecordsClick=(e,t,i)=>{const{feature:o,callbacks:s}=this;let n=i;if(o&&s?.addRelatedRecord){if(u(i)&&e.activeCategory){const t=e.activeCategory.value,o=i.findSublayerForSubtypeCode(t);o&&_(o)&&(n=o)}s.addRelatedRecord({parentFeature:o,relatedLayer:n,relationshipId:t})}},this._onFormKeyDown=this._onFormKeyDown.bind(this),this._onFormSubmit=this._onFormSubmit.bind(this),this._onGroupToggle=this._onGroupToggle.bind(this),this._onComponentBlur=this._onComponentBlur.bind(this),this._onComponentFocus=this._onComponentFocus.bind(this),this._onComponentKeyDown=this._onComponentKeyDown.bind(this),this._afterComponentCreate=this._afterComponentCreate.bind(this),this._afterComponentCreateOrUpdate=this._afterComponentCreateOrUpdate.bind(this),this._afterDateComponentCreate=this._afterDateComponentCreate.bind(this),this._afterDateComponentCreateOrUpdate=this._afterDateComponentCreateOrUpdate.bind(this),this._afterRadioGroupCreateOrUpdate=this._afterRadioGroupCreateOrUpdate.bind(this)}initialize(){this.addHandles([n((()=>this.feature),(()=>{this._inputsWithChanges.clear(),this._dateComponentMap.clear(),a((()=>!this.viewModel.updating)).then((()=>{const e=this._getFocusableInput("forward");this._syncGroupInputStates(),this._focusedFieldName=e?.name||null,this._attemptFocusOnNextRender=!0}))})),n((()=>[this._featureFormUNAssociationList,this.visibleElements.associationDetails]),(([e,t])=>{e&&(e.visibleElements.associationDetails=t)}),r),n((()=>this.groupDisplay),(()=>this._syncGroupInputStates())),this.on("submit",(e=>{if(e.invalid.length>0){const[t]=e.invalid;e.invalid.forEach((e=>this._inputsWithChanges.add(e))),this._focusedFieldName=t,this._attemptFocusOnNextRender=!0,this.scheduleRender()}})),n((()=>[this.viewModel.activeRelationshipInput,this._listObserverNode]),(()=>this._onObserverChange())),n((()=>this.viewModel.activeAssociationInput),(e=>{e&&this._featureFormUNAssociationList&&(this._featureFormUNAssociationList.associationInput=e,this._featureFormUNAssociationList.viewModel=e.viewModel)})),n((()=>this.viewModel.inputs.filter(b)),(async e=>{this._featureFormUNAssociationList||await this._setUpUtilityNetworkAssociationList();for(const t of e)this._associationsWidgetsMap.has(t)||this._associationsWidgetsMap.set(t,await this._makeAssociationsWidget(t))}))])}loadDependencies(){return T({block:()=>import("@esri/calcite-components/dist/components/calcite-block"),button:()=>import("@esri/calcite-components/dist/components/calcite-button"),chip:()=>import("@esri/calcite-components/dist/components/calcite-chip"),combobox:()=>import("@esri/calcite-components/dist/components/calcite-combobox"),"combobox-item":()=>import("@esri/calcite-components/dist/components/calcite-combobox-item"),"combobox-item-group":()=>import("@esri/calcite-components/dist/components/calcite-combobox-item-group"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),input:()=>import("@esri/calcite-components/dist/components/calcite-input"),"input-date-picker":()=>import("@esri/calcite-components/dist/components/calcite-input-date-picker"),"input-message":()=>import("@esri/calcite-components/dist/components/calcite-input-message"),"input-number":()=>import("@esri/calcite-components/dist/components/calcite-input-number"),"input-time-picker":()=>import("@esri/calcite-components/dist/components/calcite-input-time-picker"),"input-time-zone":()=>import("@esri/calcite-components/dist/components/calcite-input-time-zone"),label:()=>import("@esri/calcite-components/dist/components/calcite-label"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),loader:()=>import("@esri/calcite-components/dist/components/calcite-loader"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice"),"radio-button":()=>import("@esri/calcite-components/dist/components/calcite-radio-button"),"radio-button-group":()=>import("@esri/calcite-components/dist/components/calcite-radio-button-group"),switch:()=>import("@esri/calcite-components/dist/components/calcite-switch"),"text-area":()=>import("@esri/calcite-components/dist/components/calcite-text-area")})}destroy(){this._listObserverNode&&this._listObserver.unobserve(this._listObserverNode)}get _relatedRecordsEnabled(){const{callbacks:e}=this;return!(!e||!(e.addRelatedRecord||e.editRelatedRecord||e.showAllRelatedRecords))}get _utilityNetworkAssociationsEnabled(){const{callbacks:e}=this;return!(!e?.viewAssociatedLayers||!e.viewAssociatedFeatures)}get _subtypes(){return p(this.layer)}get associationId(){return this.viewModel.associationId}set associationId(e){this.viewModel.associationId=e}get associatedLayer(){return this.viewModel.associatedLayer}set associatedLayer(e){this.viewModel.associatedLayer=e}get disabled(){return this.viewModel.disabled}set disabled(e){this.viewModel.disabled=e}get feature(){return this.viewModel.feature}set feature(e){this.viewModel.feature=e}get formTemplate(){return this.viewModel.formTemplate}set formTemplate(e){this.viewModel.formTemplate=e}get icon(){return"form-field"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get layer(){return this.viewModel.layer}set layer(e){this.viewModel.layer=e}get map(){return this.viewModel.map}set map(e){this.viewModel.map=e}get callbacks(){return this.viewModel.callbacks}set callbacks(e){this.viewModel.callbacks=e}get relationshipId(){return this.viewModel.relationshipId}set relationshipId(e){this.viewModel.relationshipId=e}get spatialReference(){return this.viewModel.spatialReference}set spatialReference(e){this.viewModel.spatialReference=e}get strict(){return this.viewModel.strict}set strict(e){this.viewModel.strict=e}get timeZone(){return this.viewModel.timeZone}set timeZone(e){this.viewModel.timeZone=e}get showPrompt(){return e=>{this._prompt?.cancel?.(),this._prompt=e}}set showPrompt(e){this._overrideIfSome("showPrompt",e)}get clearPrompt(){return()=>this._prompt=null}set clearPrompt(e){this._overrideIfSome("clearPrompt",e)}getValues(){return this.viewModel.getValues()}submit(){return this.viewModel.submit()}render(){const{state:e}=this.viewModel;return K("div",{class:this.classes(g.base,P.widget,P.panel)},"ready"===e?this._renderForm():null)}_renderForm(){return K("div",null,K("form",{class:g.form,inert:!!this._prompt,novalidate:!0,onkeydown:this._onFormKeyDown,onsubmit:this._onFormSubmit},this._renderHeader(),this._renderContent()),this._prompt?K(v,{...this._prompt,headingLevel:this.headingLevel}):void 0)}_renderHeader(){const e=this.viewModel,{formTitle:t,formDescription:i}=e;if(!e.formHeaderVisible)return;const o=null!=t&&K(H,{key:"title",level:this.headingLevel},t),s=null!=i&&K("p",{class:g.description,key:"description"},i);return K("div",{class:g.formHeader},o,s)}_renderContent(){const{viewModel:e}=this;return e.activeRelationshipInput?this._renderRelationshipInput(e.activeRelationshipInput):e.activeAssociationInput?this._renderFeatureFormUtilityNetworkAssociationList():e.inputs.filter(t).filter((e=>e.visible)).map((e=>this._renderInput(e)))}_renderInput(e){return f(e)?this._renderGroup(e):y(e)?this._renderLabeledField(e):C(e)?this._renderRelationshipInput(e):F(e)?this._renderTextElementInput(e):b(e)?this._renderUtilityNetworkAssociationsElementInput(e):void 0}_renderFeatureFormUtilityNetworkAssociationList(){return this._featureFormUNAssociationList?.render()}_selectAssociatedLayer(e){const{feature:t,callbacks:i}=this;t&&i?.viewAssociatedFeatures&&i.viewAssociatedFeatures({associatedLayer:e.layer})}async _selectAssociatedFeature(e){const{feature:t,callbacks:i}=this;t&&i?.selectAssociatedFeature&&await i.selectAssociatedFeature({parentFeature:t,...e})}_onAddAssociation(e){const{feature:t,callbacks:i}=this;t&&i?.addAssociation&&i.addAssociation(e)}async _setUpUtilityNetworkAssociationList(){if(!this._featureFormUNAssociationList){const e=(await import("./FeatureForm/FeatureFormUtilityNetworkAssociations/FeatureFormUtilityNetworkAssociationList.js")).default;this._featureFormUNAssociationList=new e({onSelectLayer:this._selectAssociatedLayer.bind(this),onSelectFeature:this._selectAssociatedFeature.bind(this),onAddAssociation:this._onAddAssociation.bind(this)})}}async _makeAssociationsWidget(e){return new(0,(await import("./Feature/FeatureUtilityNetworkAssociations.js")).default)({onSelectAssociationType:({viewModel:t,listType:i})=>{t.activeAssociationType=i;const{feature:o,callbacks:s}=this;o&&s?.viewAssociatedLayers&&s.viewAssociatedLayers({associationId:e.uid})},viewModel:e.associationsViewModel})}_renderUtilityNetworkAssociationsElementInput(e){if(this._utilityNetworkAssociationsEnabled)return this._associationsWidgetsMap.get(e)?.render()}_renderDescriptionOrEmpty(e,t){return null==e?null:K("div",{class:this.classes(g.description),id:t},e)}_renderGroup(e){const{disabled:t,formTemplate:i,headingLevel:o}=this,{description:s,id:n,inputs:a,label:r,open:l}=e,d=a.filter((e=>e.visible)),c=this.viewModel.findField(this._focusedFieldName),u=c?.group===e,p="sequential"===this.groupDisplay;return K("calcite-block",{class:this.classes(g.group,p?g.groupSequential:null,u?g.groupActive:null,t?g.inputDisabled:null),collapsible:!0,"data-group":e,description:s||void 0,disabled:t,expanded:l,heading:r??"",headingLevel:i?.title?W(o):o,id:n,key:n,onCalciteBlockToggle:({currentTarget:t})=>this._onGroupToggle(t,e)},d.map((e=>this._renderInput(e))))}_getFocusableInput(e,t){const i=w(this.viewModel.inputs);let o;if("backward"===e&&i.reverse(),t)if(f(t)){const e=t.inputs.find((e=>e.visible));o=e?i.indexOf(e):0}else{let s;if(R(t)&&!t.group.open){const i=t.group.inputs.filter(y);s="forward"===e?i[i.length-1]:i[0]}else s=t;o=i.indexOf(s)+1}else o=0;for(let s=o;s<i.length;s++){const e=i[s];if(e.visible&&y(e))return e}return null}_renderLabeledField(e){const{dataType:t,feature:i,label:o,layer:s,required:n}=e,a={"aria-label":n?q(this.messages.requiredFieldLabel,{name:o}):o,class:g.label,key:`${s.id}-${i.uid}-${e.name}`},r=[K("div",{class:g.labelTextContent,key:"labelTextContainer"},o,n?K("span",{"aria-hidden":"true",title:this.messagesCommon.required},"*"):void 0),"unsupported"!==t?this._renderFieldInput(e):this._renderReadOnlyComponent(e),this._renderAuxiliaryText(e)];return"date"===t&&"coded-value"!==e.domain?.type?K("label",{...a},r):K("calcite-label",{...a},r)}_renderFieldInput(e){const{dataType:t,domain:i,inputType:o,name:s}=e,n=this.getCommonInputProps(e);if("coded-value"===i?.type){const t=this.viewModel.getFieldValueOptionsForField(s,this.messages.empty);return"switch"!==o||e.hasInvalidSwitchValue?"radio-buttons"===o?this._renderRadioButtonComponents(e,t.flat(),n):this._renderComboBoxComponent(e,t,n):this._renderSwitchComponent(e,n)}return"datetime-picker"===o||"date"===t?this._renderDateComponents(e,n):"number"===t?this._renderNumberComponent(e,n):this._renderStringComponent(e,n)}_renderStringComponent(e,t){return"text-area"===e.inputType?t.readOnly?K("calcite-input",{...t,loading:e.updating,type:"textarea",onCalciteInputInput:e=>this._saveValueFromComponent(e.currentTarget)}):K("calcite-text-area",{...t,resize:"vertical",onCalciteTextAreaInput:e=>this._saveValueFromComponent(e.currentTarget)}):K("calcite-input",{...t,loading:e.updating,type:"text",onCalciteInputInput:e=>this._saveValueFromComponent(e.currentTarget)})}_renderNumberComponent(e,t){const i=c(e.field),o=i&&""!==t.value?Math.round(parseFloat(t.value)).toString():t.value;return K("calcite-input-number",{...t,integer:i,loading:e.updating,type:"number",value:o,onCalciteInputNumberInput:e=>this._saveValueFromComponent(e.currentTarget)})}_renderDateComponents(e,t){const{field:i}=e;switch(i.type){case"date":return this._renderDateFieldComponents(e,t);case"date-only":return this._renderDateOnlyFieldComponent(e,t);case"time-only":return this._renderTimeOnlyFieldComponent(e,t);case"timestamp-offset":return this._renderTimestampOffsetFieldComponents(e,t);default:return this._renderReadOnlyComponent(e,x(i,t.value,{timeZone:this.timeZone,...D(i)}))}}_renderDateOnlyFieldComponent(e,t){const{range:i,valid:o,value:s}=e,{class:n,key:a,readOnly:r}=t,{rawMax:l,rawMin:d}=i;return K("calcite-input-date-picker",{afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterDateComponentCreateOrUpdate,"aria-invalid":!o,class:n,"data-date-part":"date","data-field-name":t[J],key:`${a}-date-input`,max:m(l)?l:void 0,min:m(d)?d:void 0,numberingSystem:V,onblur:e=>{this._focusedFieldName=null,this._saveValueFromDateComponent(e.target)},onfocus:this._onComponentFocus,overlayPositioning:"fixed",readOnly:r,value:null!=s?`${s}`:void 0,onCalciteInputDatePickerChange:e=>this._saveValueFromDateComponent(e.currentTarget)})}_renderTimeOnlyFieldComponent(e,t){const{valid:i,value:o}=e,{class:s,key:n,readOnly:a}=t;return K("calcite-input-time-picker",{afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterDateComponentCreateOrUpdate,"aria-invalid":!i,class:s,"data-date-part":"time","data-field-name":t[J],key:`${n}-time-input`,numberingSystem:V,onblur:e=>{this._focusedFieldName=null,this._saveValueFromDateComponent(e.target)},onfocus:this._onComponentFocus,overlayPositioning:"fixed",readOnly:a,step:e.timeStep,value:null!=o?`${o}`:void 0,onCalciteInputTimePickerChange:e=>this._saveValueFromDateComponent(e.currentTarget)})}_renderTimestampOffsetFieldComponents(e,t){const{name:i,range:o,timeZone:s,valid:n,value:a}=e,{class:r,key:l,readOnly:d}=t,{rawMax:c,rawMin:u}=o,p={afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterDateComponentCreateOrUpdate,"aria-invalid":!n,numberingSystem:V,overlayPositioning:"fixed",readOnly:d,[J]:i,onfocus:this._onComponentFocus},m=S(c,s),h=S(u,s),v=S(a,s);return K("div",{class:g.dateInputContainer,key:`${l}-date-time-container`},K("calcite-input-date-picker",{...p,class:r,"data-date-part":"date",key:`${l}-date-input`,max:m?.date??void 0,min:h?.date??void 0,onblur:e=>{this._focusedFieldName=null,this._saveValueFromDateComponent(e.target)},value:v.date??void 0,onCalciteInputDatePickerChange:e=>this._saveValueFromDateComponent(e.currentTarget)}),K("calcite-input-time-picker",{...p,class:r,"data-date-part":"time",key:`${l}-time-input`,onblur:e=>{this._focusedFieldName=null,this._saveValueFromDateComponent(e.target)},step:e.timeStep,value:v.time??void 0,onCalciteInputTimePickerChange:e=>this._saveValueFromDateComponent(e.currentTarget)}),e.includeTimeOffset?K("calcite-input-time-zone",{...p,class:r,"data-date-part":"timeZone",disabled:d,key:`${l}-timezone-input`,onblur:e=>{this._focusedFieldName=null,this._saveValueFromDateComponent(e.target)},value:v.timeZoneOffset??"0",onCalciteInputTimeZoneChange:e=>this._saveValueFromDateComponent(e.currentTarget)}):null)}_renderDateFieldComponents(e,t){const{includeTime:i,name:o,valid:s,value:n}=e,{class:a,key:r,max:l,min:d,readOnly:c}=t,{timeZone:u}=this,p={afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterDateComponentCreateOrUpdate,"aria-invalid":!s,numberingSystem:V,overlayPositioning:"fixed",readOnly:c,[J]:o,onfocus:this._onComponentFocus},m=U(n,u),h=U(l,u),v=U(d,u);return K("div",{class:g.dateInputContainer,key:`${r}-date-time-container`},K("calcite-input-date-picker",{...p,class:a,"data-date-part":"date",key:`${r}-date-input`,max:h?.date??void 0,min:v?.date??void 0,onblur:e=>{this._focusedFieldName=null,this._saveValueFromDateComponent(e.target)},value:m.date??void 0,onCalciteInputDatePickerChange:e=>this._saveValueFromDateComponent(e.currentTarget)}),i?K("calcite-input-time-picker",{...p,class:a,"data-date-part":"time",key:`${r}-time-input`,onblur:e=>{this._focusedFieldName=null,this._saveValueFromDateComponent(e.target)},step:1,value:m.time??void 0,onCalciteInputTimePickerChange:e=>this._saveValueFromDateComponent(e.currentTarget)}):null)}_renderReadOnlyComponent(e,t){const i=this.getCommonInputProps(e);return K("calcite-input",{...i,class:this.classes(g.fieldInput,g.inputDisabled),readOnly:!0,type:"text",value:null!=t?`${t}`:i.value})}_renderComboBoxComponent(e,t,i){const{value:o,name:s}=e,{viewModel:n,_inputsWithChanges:a}=this,r="INSERT"===n.editType,l=a.has(s),d=null==o&&(!r||l),c=r&&e.showNoValueOptionEnabled&&!l?()=>{}:i.onblur;return K("calcite-combobox",{...i,allowCustomValues:!1,clearDisabled:!0,disabled:i.readOnly,onblur:c,overlayPositioning:"fixed",selectionMode:"single",onCalciteComboboxChange:({currentTarget:t})=>{d&&0===t.selectedItems.length?this._ignoreDeselectionOfNoValueOption(t):e.isSubtypeField&&0===t.selectedItems.length?t.value=`${e.value}`:this._saveValueFromComponent(t)}},this.renderComboboxOptionsList(e,t))}renderComboboxOptionsList(e,t){const{value:i,name:o}=e,{messages:s,messagesTemplates:n,viewModel:a,_inputsWithChanges:r}=this,[l,d,c]=t.map((e=>e.map((({name:e,value:t})=>K("calcite-combobox-item",{key:`#${t}`,selected:i===t,textLabel:e,value:`${t}`}))))),u=[];d.length>0&&u.push(K("calcite-combobox-item-group",{key:"other",label:n.other},d)),c.length>0&&u.push(K("calcite-combobox-item-group",{key:"unsupported",label:s.subtypes.unsupportedDomainGroupTitle},c)),u.length>0?u.unshift(K("calcite-combobox-item-group",{key:"recommended",label:s.recommended},l)):u.push(...l);const p="INSERT"===a.editType,m=r.has(o),h=null==i&&(!p||m);return e.showNoValueOptionEnabled&&u.unshift(K("calcite-combobox-item",{key:"empty-option",selected:h,textLabel:e.showNoValueLabel||s.empty,value:""})),u}_renderRadioButtonComponents(e,t,i){const{name:o,value:s}=e,n=t.map((({name:e,value:t})=>this._renderRadioButtonComponent({key:e,label:e,name:o,value:t,selected:t===s,props:i})));if(e.showNoValueOptionEnabled){const t="",a=e.showNoValueLabel||this.messages.empty,r=s===t||null===s;n.unshift(this._renderRadioButtonComponent({key:"empty-option",label:a,name:o,value:t,selected:r,props:i}))}return K("calcite-radio-button-group",{afterCreate:this._afterRadioGroupCreateOrUpdate,afterUpdate:this._afterRadioGroupCreateOrUpdate,class:g.inputRadioGroup,"data-field-name":i[J],key:`${i.key}-radio-group`,layout:"vertical",name:i.key,required:i.required},n)}_renderSwitchComponent(e,t){const{value:i}=e,o=!!k(e.element,"switch")&&i===e.element.input.onValue;return K("calcite-switch",{...t,checked:o,class:g.inputSwitch,disabled:t.readOnly,onblur:()=>{this._focusedFieldName=null},onCalciteSwitchChange:e=>this._saveValueFromComponent(e.currentTarget)})}_renderRadioButtonComponent({key:e,name:t,value:i,selected:o,label:s,props:n}){return K("calcite-label",{class:g.inputRadioLabel,key:e,layout:"inline"},K("calcite-radio-button",{...n,afterCreate:void 0,afterUpdate:void 0,checked:o,class:g.inputRadio,disabled:n.readOnly,name:t,onblur:()=>{this._focusedFieldName=null},value:i,onCalciteRadioButtonChange:({currentTarget:e})=>{e.checked&&this._saveValueFromComponent(e)}}),s)}_renderAuxiliaryText(e){const t=e.name,i=this._inputsWithChanges.has(t)&&!e.submittable?I(e,this.messages,this.timeZone):null!=this.viewModel.contingencyConstraintViolations.get(t)?this.messages.validationErrors.valuesIncompatible:null!=e.valueExpressionExecutor&&e.valueExpressionExecutor.stale?this.messages.valueExpressionError:null;return null!=i?K("calcite-input-message",{icon:!0,status:"invalid"},i):this._inputsWithChanges.has(t)&&e.valueIsOutOfDomain?K("calcite-input-message",{icon:!0,status:"idle"},this.messages.subtypes.fieldOutOfSubtypeDomainWarning):this._renderDescriptionOrEmpty(e.description)}_renderShowAllRelatedRecordsListItem(e){if(!e.showAllActionVisible||!this.callbacks?.showAllRelatedRecords)return;const t=this.messages;return K("calcite-list-item",{description:q(t.totalCount,{count:e.featureCount}),key:"show-all-related-features",label:t.showAll,value:!0,onCalciteListItemSelect:()=>this._onShowAllRelatedRecordsClick(e.relationshipId)},K("calcite-icon",{icon:"list",scale:"s",slot:"content-end"}))}_renderAddRelatedRecordButton(e){const{canAddRelatedFeature:t,relationshipId:i,relatedLayer:o}=e,{messages:s,callbacks:n}=this;if(t&&n?.addRelatedRecord&&o)return K("calcite-button",{alignment:"center",appearance:"outline-fill",class:g.centeredButton,disabled:e.updating||!e.originHasValidKey,iconStart:"plus",key:`${i}-add-button`,onclick:()=>{!e.updating&&e.originHasValidKey&&this._onAddRelatedRecordsClick(e,i,o)},round:!0,scale:"s",width:"full"},e.relatedLayerIsTable?s.addRecord:s.addFeature)}_renderRelatedRecordListItem(e,t){const{feature:i,description:o,title:s}=e,{feature:n,callbacks:a}=this,{highlightHelper:r}=this.viewModel,l=()=>{r?.removeAll(),a?.editRelatedRecord&&n&&a.editRelatedRecord({parentFeature:n,relationshipId:t,relatedFeature:i})},d=r?()=>r.add(i):void 0,c=r?()=>r.remove(i):void 0;return K("calcite-list-item",{bind:this,description:o,key:`${t}-${i.uid}`,label:s,onclick:l,onmouseenter:d,onmouseleave:c,value:s},K("calcite-icon",{icon:O(i),slot:"content-start"}),K("calcite-icon",{icon:"chevron-right",scale:"s",slot:"content-end"}))}_renderRelationshipInput(e){if(!this._relatedRecordsEnabled||!e.editable)return;const{relationshipId:t,activeCategory:i}=e,o=i?null:this._renderDescriptionOrEmpty(e.description);return K("calcite-label",{class:this.classes(g.label,g.relatedRecordsLabel),key:`relationship-${t}-container`},K("div",null,this._renderRelatedRecordsHeaderContainer(e),o,this._renderRelationshipInputContent(e)),this._renderAddRelatedRecordButton(e))}_renderRelationshipInputContent(e){return e.featureCount>0?this._renderRelatedRecordsList(e):e.activeCategory&&0===e.featureCount?this._renderNoRelatedRecordsNotice():e.allCategories?.length?this._renderCategoryList(e):e.loaded?e.originHasValidKey?this._renderNoRelatedRecordsNotice():this._renderNoValidOriginKeyNotice(e):void 0}_renderCategoryList(e){return K("calcite-list",{displayMode:"flat",label:this.messages.relatedRecordsList,loading:e.updating},e.categories?.map((t=>this._renderCategory(e,t))),this._renderShowAllCategoriesListItem(e))}_renderCategory(e,t){const{count:i,name:o,value:s}=t,n=z(i);return K("calcite-list-item",{key:`${o}-${s}`,label:o,onCalciteListItemSelect:()=>this._selectCategory(e,t)},K("calcite-chip",{label:n,scale:"s",slot:"content-end"},n),K("calcite-icon",{flipRtl:!0,icon:"chevron-left",scale:"s",slot:"content-end"}))}_selectCategory(e,t){this.relationshipId=e.relationshipId,e.activeCategory=t}_renderShowAllCategoriesListItem(e){if(!e.showAllCategoriesVisible)return;const t=this.messages;return K("calcite-list-item",{description:q(t.totalCount,{count:e.allCategories?.length??0}),key:"show-all-categories",label:t.showAll,value:!0,onCalciteListItemSelect:()=>e.showAllEnabled=!0},K("calcite-icon",{icon:"list",scale:"s",slot:"content-end"}))}_renderRelatedRecordsHeaderContainer(e){const t=e.updating||!e.loaded;return K("div",{class:g.relatedRecordsHeader,key:`relationship-${e.relationshipId}-header`},K("span",null,e.label),t?K("calcite-loader",{inline:!0,key:"loader",label:this.messagesCommon?.loading,scale:"s",type:"indeterminate"}):void 0)}_renderRelatedRecordsList(e){const{relationshipId:t}=e;return K("calcite-list",{class:g.relatedRecordsList,label:this.messages?.relatedRecordsList},e.relatedFeatureInfos.map((e=>this._renderRelatedRecordListItem(e,t))),this._renderShowAllRelatedRecordsListItem(e),this._renderObserverNode())}_renderNoValidOriginKeyNotice(e){const{messages:t}=this,i=e.relatedLayerIsTable?t.noOriginKeyRecord:t.noOriginKeyFeature,o=e.relationship?.keyField,s=this.viewModel.findField(o),n=e.layer?.fieldsIndex.get(o),a=s?.label||n?.alias||o,r=q(i,{relatedLayerName:e.relatedLayer?.title,originKeyField:a});return K("calcite-notice",{icon:"information",kind:"brand",open:!0,scale:"s",width:"full"},K("div",{slot:"message"},r))}_renderNoRelatedRecordsNotice(){return K("calcite-notice",{icon:"information",kind:"brand",open:!0,scale:"s",width:"full"},K("div",{slot:"message"},this.messagesFeature.noRelatedFeatures))}_renderObserverNode(){if(this.viewModel.activeRelationshipInput?.showAllEnabled)return K("div",{afterCreate:this._afterListObserverCreated,afterRemoved:this._afterListObserverRemoved,bind:this,class:g.listObserver,key:"feature-observer"})}_renderTextElementInput(e){return K("div",{class:g.textElement,"data-testid":`text-element-${e.label}`,innerHTML:e.text,key:e.id})}getCommonInputProps(e){const{disabled:t}=this,{editable:i,hint:o,label:s,maxLength:n,minLength:a,name:r,range:{max:l,min:d},required:c,valid:u,value:p}=e,m=this._inputsWithChanges.has(r),h=!i||t;return{afterCreate:this._afterComponentCreate,afterUpdate:this._afterComponentCreateOrUpdate,"aria-invalid":u?"false":"true",class:this.classes(g.fieldInput,h?g.inputDisabled:null),status:m&&!u?"invalid":"idle",key:r,label:s,max:null!=l?l:void 0,min:null!=d?d:void 0,maxLength:n>-1?n:void 0,minLength:a>-1?a:void 0,placeholder:o??void 0,readOnly:h,required:c,value:null==p?"":`${p}`,onblur:this._onComponentBlur,onfocus:this._onComponentFocus,onkeydown:this._onComponentKeyDown,[J]:r}}_getFieldInputFromHTMLElement(e){return this.viewModel.findField(e.getAttribute(J))}_afterDateComponentCreate(e){const t=this._getFieldInputFromHTMLElement(e),i=e.dataset.datePart,o=this._dateComponentMap.get(t.name);if("valueAsDate"in e&&null!=e.value&&null!=t.value){const i=new ResizeObserver((()=>{switch(e.value=void 0,t.field.type){case"date":e.value=U(t.value,this.timeZone).date??"";break;case"timestamp-offset":e.value=S(t.value,this.timeZone).date??"";break;default:e.value=`${t.value}`}i.unobserve(e)}));i.observe(e)}if(null!=o)switch(i){case"date":o.date=e;break;case"time":o.time=e;break;case"timeZone":o.timeZone=e}else this._dateComponentMap.set(t.name,{[i]:e});this._afterDateComponentCreateOrUpdate(e)}_afterDateComponentCreateOrUpdate(e){this._afterComponentCreateOrUpdate(e)}_afterComponentCreate(e){const t=this._getFieldInputFromHTMLElement(e);N(t)&&null!=e.value&&"setNumberValue"in e&&e.setNumberValue({committing:!1,value:e.value,origin:"direct"}),this._afterComponentCreateOrUpdate(e)}_afterRadioGroupCreateOrUpdate(e){const t=e.selectedItem,i=e.querySelector("calcite-radio-button"),o=t||i;o&&this._afterComponentCreateOrUpdate(o)}_afterComponentCreateOrUpdate(e){const{viewModel:t}=this,i=this._getFieldInputFromHTMLElement(e),o=t.findField(this._focusedFieldName);this._attemptFocusOnNextRender&&o===i&&(this._attemptFocusOnNextRender=!1,R(i)&&(i.group.open=!0),Z(e))}_onComponentFocus(e){const t=e.target,i=this._getFieldInputFromHTMLElement(t);this._focusedFieldName=i.name}_onComponentBlur(e){const t=e.target;this._focusedFieldName=null;"readOnly"in t&&t.readOnly||this._saveValueFromComponent(t)}_saveValueFromDateComponent(e){const{timeZone:t}=this,i=this._getFieldInputFromHTMLElement(e),o=i.field.type,{name:s,range:n}=i,a=this._dateComponentMap.get(s);if(!a)return;let r=this.viewModel.getValue(s),l=null;"date-only"===o?l=Array.isArray(e.value)?e.value[0]:e.value:"time-only"===o?(r=E(r),l=E(e.value)):l="timestamp-offset"===o?null!=e.value?j({dateComponent:a.date,timeComponent:a.time,timeZoneComponent:a.timeZone,oldValue:r,defaultTimeZone:t}):null:null!=e.value?$({oldValue:r,dateComponent:a.date,timeComponent:a.time,timeZone:t,max:n.max,min:n.min}):null,null!==l&&e.value?r!==l&&this._updateFieldValue(s,l):this._updateFieldValue(s,null)}_saveValueFromComponent(e){const t=this._getFieldInputFromHTMLElement(e),i=this._parseValue(e),o=t.value;t.isSubtypeField&&M(this.layer,o,i)?this._pendingSubtypeChoice||i===o||(this._pendingSubtypeChoice=this._handleSubtypeChoice(t,i)):this._updateFieldValue(t.name,i)}async _handleSubtypeChoice(e,t){const{value:i,name:s}=e,{messages:n,viewModel:a,messagesCommon:r,_subtypes:l}=this;if(this._updateFieldValue(s,t),!l?.length)return;const d=l.find((e=>e.code===t)),c=l.find((e=>e.code===i))?.name??`${i}`;if(!d)return;const u=o();a.pendingSubtypeChoice=u;let p="update-fields";const m=[{label:n.subtypes.useDefaultValuesOption,value:"update-fields"},{label:n.subtypes.keepCurrentValuesOption,value:"keep-existing"}],h={context:"info",title:n.subtypes.changeWarningTitle,message:q(n.subtypes.changeWarning,{originalType:c,newType:d.name}),radios:m,defaultRadioSelection:"update-fields",onRadioSelection:e=>p=e,actions:{primary:{label:r.apply,action:()=>u.resolve(p),type:"positive"},secondary:{label:r.cancel,type:"neutral",action:()=>u.resolve("undo")}},cancel:()=>u.reject()};try{this.showPrompt(h);switch(await u.promise){case"update-fields":a.applySubtypeDefaults(d),this._validateContingenciesForNonNullFields();break;case"keep-existing":this._validateContingenciesForNonNullFields();break;case"undo":this._updateFieldValue(e.name,i)}}finally{a.pendingSubtypeChoice=null,this.clearPrompt(),this._pendingSubtypeChoice=null}}_onComponentKeyDown({key:e,target:t}){const i=this._getFieldInputFromHTMLElement(t);"Enter"===e&&R(i)&&!i.group.open&&(i.group.open=!0)}_updateFieldValue(e,t){const i=this.viewModel.getValue(e);this.viewModel.setValue(e,t),this._inputsWithChanges.add(e);i!==t&&this.viewModel.fieldsWithContingentValues.has(e)&&this._validateContingenciesForNonNullFields()}_validateContingenciesForNonNullFields(){const e=Object.fromEntries(Object.entries(this.getValues()).filter((([e,t])=>null!=t)));this.viewModel.validateContingencyConstraints(e)}_parseValue(e){const t=this._getFieldInputFromHTMLElement(e),i=e.value;return k(t.element,"switch")?e.checked?t.element.input.onValue:t.element.input.offValue:null==i||""===i?null:"number"===t.dataType?"-0"===i||"-0."===i||"-0,"===i?i:parseFloat(i):"date"===t.field.type?parseFloat(i):i}_ignoreDeselectionOfNoValueOption(e){const{firstChild:t,selectedItems:o}=e;0===o.length&&t&&"selected"in t?t.selected=!0:i.getLogger(this).warnOnce("Failed to override user attempt to deselect 'No value' option.")}_onGroupToggle(e,t){e.open?(t.open=!0,this._focusedFieldName=this._getFocusableInput("forward",t)?.name||null,this._attemptFocusOnNextRender=!0,"sequential"===this.groupDisplay&&this.viewModel.allGroupInputs.forEach((e=>{e!==t&&(e.open=!1)}))):t.open=!1,this.scheduleRender()}_onFormSubmit(e){e.preventDefault()}_onFormKeyDown(e){"Enter"===e.key&&this.viewModel.submit()}_afterListObserverCreated(e){this.viewModel.activeRelationshipInput&&(this._listObserverNode=e)}_afterListObserverRemoved(){this._listObserverNode=null}_onObserverChange(){this._listObserverNode&&this._listObserver.unobserve(this._listObserverNode);const e=this.viewModel.activeRelationshipInput;e&&this._listObserverNode&&e.showAllEnabled&&this._listObserver.observe(this._listObserverNode)}_incrementRelatedRecordPage(){const e=this.viewModel.activeRelationshipInput;e?.incrementPage()}_syncGroupInputStates(){if("sequential"!==this.groupDisplay)return;const e=this.viewModel.allGroupInputs;if(!e.length)return;const t=e.filter((e=>e.open));0===t.length?e[0].open=!0:t.length>1&&t.slice(1).forEach((e=>e.open=!1))}get test(){return{inputsWithChanges:this._inputsWithChanges,updateValue:this._saveValueFromComponent.bind(this)}}};e([l()],Q.prototype,"_listObserverNode",void 0),e([l()],Q.prototype,"_relatedRecordsEnabled",null),e([l()],Q.prototype,"_utilityNetworkAssociationsEnabled",null),e([l()],Q.prototype,"_prompt",void 0),e([l()],Q.prototype,"_subtypes",null),e([l()],Q.prototype,"associationId",null),e([l()],Q.prototype,"associatedLayer",null),e([l()],Q.prototype,"disabled",null),e([l()],Q.prototype,"feature",null),e([l()],Q.prototype,"_featureFormUNAssociationList",void 0),e([l()],Q.prototype,"formTemplate",null),e([l()],Q.prototype,"groupDisplay",void 0),e([l()],Q.prototype,"headingLevel",void 0),e([l()],Q.prototype,"icon",null),e([l()],Q.prototype,"label",null),e([l()],Q.prototype,"layer",null),e([l()],Q.prototype,"map",null),e([l(),G("esri/widgets/FeatureForm/t9n/FeatureForm")],Q.prototype,"messages",void 0),e([l(),G("esri/t9n/common")],Q.prototype,"messagesCommon",void 0),e([l(),G("esri/widgets/Feature/t9n/Feature")],Q.prototype,"messagesFeature",void 0),e([l(),G("esri/widgets/FeatureTemplates/t9n/FeatureTemplates")],Q.prototype,"messagesTemplates",void 0),e([l()],Q.prototype,"callbacks",null),e([l()],Q.prototype,"relationshipId",null),e([l()],Q.prototype,"spatialReference",null),e([l()],Q.prototype,"strict",null),e([l()],Q.prototype,"timeZone",null),e([l()],Q.prototype,"showPrompt",null),e([l()],Q.prototype,"clearPrompt",null),e([l(),B(["value-change","submit"])],Q.prototype,"viewModel",void 0),e([l({type:A,nonNullable:!0})],Q.prototype,"visibleElements",void 0),e([l()],Q.prototype,"test",null),Q=e([d("esri.widgets.FeatureForm")],Q);const X=Q;export{X as default};