@arcgis/core 5.0.0-next.45 → 5.0.0-next.47

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 (332) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/063045ac5553e91c0c4c.js +1 -0
  3. package/assets/esri/core/workers/chunks/{20ad34f9d45c64392022.js → 08c1ea29678da27136f3.js} +1 -1
  4. package/assets/esri/core/workers/chunks/{5dc2f2e28c30386efadf.js → 10094eb2b94e98dd4a8a.js} +1 -1
  5. package/assets/esri/core/workers/chunks/108675a17e432a02cf66.js +1 -0
  6. package/assets/esri/core/workers/chunks/169be08394c5e7703628.js +1 -0
  7. package/assets/esri/core/workers/chunks/19270a2de33f2662005b.js +1 -0
  8. package/assets/esri/core/workers/chunks/1a6f3531ef3d671e0289.js +1 -0
  9. package/assets/esri/core/workers/chunks/{b809d499ff050976d9ed.js → 1c58064ea80e6a4a4a3b.js} +1 -1
  10. package/assets/esri/core/workers/chunks/1c816aff8613d1e4bf38.js +1 -0
  11. package/assets/esri/core/workers/chunks/{ee67c8a7c1f8b482cd99.js → 1ced78750c61600b2d4e.js} +1 -1
  12. package/assets/esri/core/workers/chunks/{c5d6b416baf24e74b9ba.js → 1dfa949cc4f4c18ed4cf.js} +1 -1
  13. package/assets/esri/core/workers/chunks/{98175b454e807b1a3c5f.js → 1e152a34e368bd810a0f.js} +1 -1
  14. package/assets/esri/core/workers/chunks/1e17ad6cdffa5016a3db.js +1 -0
  15. package/assets/esri/core/workers/chunks/1e2d42e9984ed3437ba2.js +1 -0
  16. package/assets/esri/core/workers/chunks/2008b22f76071a2dde4e.js +1 -0
  17. package/assets/esri/core/workers/chunks/2107c93d1fe87f3b8dfa.js +1 -0
  18. package/assets/esri/core/workers/chunks/2209550b6510e25da375.js +1 -0
  19. package/assets/esri/core/workers/chunks/229e1ed4282005aa0b83.js +1 -0
  20. package/assets/esri/core/workers/chunks/22b8eaa6afab0e5ffc47.js +1 -0
  21. package/assets/esri/core/workers/chunks/{1c0fb4795a52204882a8.js → 2550d2ba935cfdf30236.js} +1 -1
  22. package/assets/esri/core/workers/chunks/{49e6219dd08cb6c27023.js → 273ac1066095d63d6a6f.js} +1 -1
  23. package/assets/esri/core/workers/chunks/2e2867bc66c94aba7dc7.js +1 -0
  24. package/assets/esri/core/workers/chunks/{cda5c95fd49b8901f7d4.js → 3298e96d3f2e49e338d2.js} +1 -1
  25. package/assets/esri/core/workers/chunks/34613b288cf174983f8b.js +1 -0
  26. package/assets/esri/core/workers/chunks/{e5baa30944061418cb13.js → 35f086a2ae0585348ae6.js} +1 -1
  27. package/assets/esri/core/workers/chunks/{f441fc74451330384fb0.js → 37ea150dec5e491f691e.js} +1 -1
  28. package/assets/esri/core/workers/chunks/3c94db7ecdcd38eeb1b1.js +1 -0
  29. package/assets/esri/core/workers/chunks/3f7749f06ae54a4437d9.js +1 -0
  30. package/assets/esri/core/workers/chunks/404229f10aef5ac23c87.js +1 -0
  31. package/assets/esri/core/workers/chunks/40a722933af28823953b.js +1 -0
  32. package/assets/esri/core/workers/chunks/{7aa730e5ac7b268e3c98.js → 424daef7b5dec1b99aba.js} +1 -1
  33. package/assets/esri/core/workers/chunks/456684b1c1417ed0e611.js +1 -0
  34. package/assets/esri/core/workers/chunks/{d14e75b160aa432233c6.js → 461093ce28ceadd7853d.js} +1 -1
  35. package/assets/esri/core/workers/chunks/46b63a65484b102e9ccb.js +1 -0
  36. package/assets/esri/core/workers/chunks/4a48b8ec5f3f2fd139b5.js +1 -0
  37. package/assets/esri/core/workers/chunks/4b084f985bc4100e7aec.js +1 -0
  38. package/assets/esri/core/workers/chunks/4b1de1fcd13677b615a8.js +1 -0
  39. package/assets/esri/core/workers/chunks/{31186e83fe009aa0fd36.js → 4d933de84afb2e3b7d18.js} +1 -1
  40. package/assets/esri/core/workers/chunks/{83aa39fbb1fad3b9d143.js → 4ff771942531fb2755c4.js} +1 -1
  41. package/assets/esri/core/workers/chunks/{e0017c6739d2532793e6.js → 513a4ef960e27500f986.js} +1 -1
  42. package/assets/esri/core/workers/chunks/56b693baa376bb990925.js +1 -0
  43. package/assets/esri/core/workers/chunks/{1d4ea8db272655c0608c.js → 57fd5e1260269002d18a.js} +1 -1
  44. package/assets/esri/core/workers/chunks/5fe40bb0e9ab333f6854.js +1 -0
  45. package/assets/esri/core/workers/chunks/{9f6c63a580b28ab715bd.js → 5ffeb8fb58d59bad68c3.js} +1 -1
  46. package/assets/esri/core/workers/chunks/{b56c07c0b43cb1999070.js → 60362c5651ef41fa7e5f.js} +1 -1
  47. package/assets/esri/core/workers/chunks/{e8a9971c8354569cb81d.js → 609919428305d8c8c243.js} +1 -1
  48. package/assets/esri/core/workers/chunks/{ab88577987cf2fe1cb32.js → 61373d2fa7e7638d3395.js} +1 -1
  49. package/assets/esri/core/workers/chunks/6202922b1c2637e9aaa5.js +1 -0
  50. package/assets/esri/core/workers/chunks/633368ae6fbb46373328.js +1 -0
  51. package/assets/esri/core/workers/chunks/657602e6a84e8b4576fb.js +1 -0
  52. package/assets/esri/core/workers/chunks/6d3ae7969ea86a2e0b13.js +1 -0
  53. package/assets/esri/core/workers/chunks/6d702cb26cef46a76963.js +1 -0
  54. package/assets/esri/core/workers/chunks/{35272810c2ed04eb403d.js → 6f3943bebe2d5f4994f7.js} +1 -1
  55. package/assets/esri/core/workers/chunks/708aba69a1870ea41a61.js +1 -0
  56. package/assets/esri/core/workers/chunks/{7ba13b52fce1060fbb2a.js → 7147fc7502b385b302b2.js} +1 -1
  57. package/assets/esri/core/workers/chunks/{9ba8a2e1c0fb4e1efc7c.js → 7364fb5e99933533890d.js} +1 -1
  58. package/assets/esri/core/workers/chunks/74b1028e95f7cfff387b.js +1 -0
  59. package/assets/esri/core/workers/chunks/75d8244b725a2aee2003.js +1 -0
  60. package/assets/esri/core/workers/chunks/78fccea3445fb2f9120a.js +1 -0
  61. package/assets/esri/core/workers/chunks/7ba31425caa404f86424.js +1 -0
  62. package/assets/esri/core/workers/chunks/{a4f492aa5444e6381063.js → 7d631ebf8f79225cf0f6.js} +1 -1
  63. package/assets/esri/core/workers/chunks/{040f3d8e1099c4843390.js → 81a60dfa600b690098f9.js} +1 -1
  64. package/assets/esri/core/workers/chunks/833fd2bc42c5cb459084.js +1 -0
  65. package/assets/esri/core/workers/chunks/{75643711d9585ee26a15.js → 83c8e5a92d8d6193cb32.js} +1 -1
  66. package/assets/esri/core/workers/chunks/{e537e1d37f3fcb14fce2.js → 870022661376442411e4.js} +1 -1
  67. package/assets/esri/core/workers/chunks/898ab7db220e81e921c6.js +1 -0
  68. package/assets/esri/core/workers/chunks/{31b074ae2162a3508d2a.js → 8b578ffc3a83089aa782.js} +1 -1
  69. package/assets/esri/core/workers/chunks/{48c8ef4170e803a564d6.js → 8b75861196d1ce5cba63.js} +1 -1
  70. package/assets/esri/core/workers/chunks/8be61e13530fd0dc2fd1.js +1 -0
  71. package/assets/esri/core/workers/chunks/90b8ccee883738917a6d.js +1 -0
  72. package/assets/esri/core/workers/chunks/90bc9c299ae0e8b8b5e5.js +1 -0
  73. package/assets/esri/core/workers/chunks/91d9ade78854f40a962d.js +1 -0
  74. package/assets/esri/core/workers/chunks/9319d57494482668ab19.js +1 -0
  75. package/assets/esri/core/workers/chunks/{74881340e040bfd0580f.js → 934bc1028b287f8df4aa.js} +1 -1
  76. package/assets/esri/core/workers/chunks/96055de47831e59a28bf.js +1 -0
  77. package/assets/esri/core/workers/chunks/963ba863e0f87abfca25.js +1 -0
  78. package/assets/esri/core/workers/chunks/9aa8d60483ad905fe13b.js +1 -0
  79. package/assets/esri/core/workers/chunks/9fed9946241bb2a5cfa4.js +1 -0
  80. package/assets/esri/core/workers/chunks/a2662e98857f0abf8e82.js +1 -0
  81. package/assets/esri/core/workers/chunks/a5a9b0a35849b9f2e86d.js +1 -0
  82. package/assets/esri/core/workers/chunks/a60006c9ccf6817fc0d2.js +1 -0
  83. package/assets/esri/core/workers/chunks/a627b7eb94b7fca33210.js +1 -0
  84. package/assets/esri/core/workers/chunks/a651dc3b8f1fc1ab34cc.js +1 -0
  85. package/assets/esri/core/workers/chunks/{bf5f9da0837ed09729c6.js → aab93e885b6c7c6aa76e.js} +1 -1
  86. package/assets/esri/core/workers/chunks/adfe28c1c1619cdd3ca1.js +1019 -0
  87. package/assets/esri/core/workers/chunks/b88dc7d8ae105747e6a4.js +1 -0
  88. package/assets/esri/core/workers/chunks/b90c786dd474ea1a409c.js +1 -0
  89. package/assets/esri/core/workers/chunks/b92e9e5df8154a128982.js +1 -0
  90. package/assets/esri/core/workers/chunks/{9a855a10798348a21bab.js → bff814d34b38ec80c44d.js} +1 -1
  91. package/assets/esri/core/workers/chunks/c36d699a75b6e8fb93eb.js +1 -0
  92. package/assets/esri/core/workers/chunks/c50fdf723f2d4316862e.js +1 -0
  93. package/assets/esri/core/workers/chunks/{9461cc37ab3397265270.js → c5e8ff4721b15ac3c6eb.js} +1 -1
  94. package/assets/esri/core/workers/chunks/{4cda42b94e9cb58dd372.js → ca61077e0a598654f33f.js} +1 -1
  95. package/assets/esri/core/workers/chunks/{61a9ffd4cf07d8bb7a9b.js → ca81be5bdb88ef557bf3.js} +1 -1
  96. package/assets/esri/core/workers/chunks/{ca1c65eb7f5900c60170.js → cd8fec3500e6503ae020.js} +1 -1
  97. package/assets/esri/core/workers/chunks/ce90e8489143228262e7.js +1 -0
  98. package/assets/esri/core/workers/chunks/d0320ca67abca4f8b0d2.js +1 -0
  99. package/assets/esri/core/workers/chunks/{4b6a44c6265c8959abd8.js → d3db7244fac7398cc700.js} +1 -1
  100. package/assets/esri/core/workers/chunks/{19820cddba13a3585c0b.js → d561624ddb9388732b25.js} +1 -1
  101. package/assets/esri/core/workers/chunks/d65ca3b8fccae8c3c3fa.js +1 -0
  102. package/assets/esri/core/workers/chunks/{630eba99f48ea79a9560.js → d705410c369bd03b1875.js} +1 -1
  103. package/assets/esri/core/workers/chunks/{9c7682b300b877f60095.js → d76513a6260d9ec4ea25.js} +1 -1
  104. package/assets/esri/core/workers/chunks/d82e17522ed946c2d809.js +1 -0
  105. package/assets/esri/core/workers/chunks/d8dc130ea559be1f68c6.js +1 -0
  106. package/assets/esri/core/workers/chunks/dae715b2b0094641e42f.js +1 -0
  107. package/assets/esri/core/workers/chunks/{768ae52b4e5c3e571ef5.js → dc29cb16704e2e4d0a46.js} +1 -1
  108. package/assets/esri/core/workers/chunks/e8c2e2fbe9cef4c8a8c6.js +1 -0
  109. package/assets/esri/core/workers/chunks/ecb4c223c0278971cdc9.js +1 -0
  110. package/assets/esri/core/workers/chunks/{3f33708eb39c7169a226.js → f2ba50eb29f93df885d6.js} +1 -1
  111. package/assets/esri/core/workers/chunks/{6e5d41f51572e3e7cf92.js → f7163048146ddaedfc36.js} +1 -1
  112. package/assets/esri/core/workers/chunks/f92a78ce5510e0d0d0f7.js +1 -0
  113. package/assets/esri/core/workers/chunks/fa92a7c11befbad8739f.js +1 -0
  114. package/assets/esri/core/workers/chunks/fdaa10a588db394e2f65.js +1 -0
  115. package/chunks/Laserlines.glsl.js +1 -1
  116. package/chunks/boundedPlane.js +1 -1
  117. package/chunks/cameraUtilsSpherical.js +1 -1
  118. package/chunks/vec32.js +1 -1
  119. package/config.js +1 -1
  120. package/core/libs/gl-matrix-2/math/quat.js +1 -1
  121. package/core/libs/gl-matrix-2/math/vec3.js +1 -1
  122. package/geometry/FlatGeometry.js +1 -1
  123. package/geometry/operators/support/apiConverter.js +1 -1
  124. package/geometry/operators/support/jsonConverter.js +1 -1
  125. package/geometry/support/curves/circleUtils.js +1 -1
  126. package/geometry/support/lineSegment.js +1 -1
  127. package/geometry/support/meshUtils/loadGLTFMesh.js +1 -1
  128. package/geometry/support/meshUtils/merge.js +1 -1
  129. package/geometry/support/sphere.js +1 -1
  130. package/interfaces.d.ts +179 -71
  131. package/kernel.js +1 -1
  132. package/layers/ParquetLayer.js +1 -1
  133. package/layers/VoxelWasmPerSceneView.js +1 -1
  134. package/layers/graphics/sources/ParquetSource.js +1 -1
  135. package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
  136. package/layers/orientedImagery/transformations/worldToImage.js +1 -1
  137. package/layers/support/{ParquetEncodingBase.js → ParquetGeometryEncodingBase.js} +1 -1
  138. package/layers/support/ParquetGeometryEncodingLocation.d.ts +4 -0
  139. package/layers/support/ParquetGeometryEncodingLocation.js +5 -0
  140. package/layers/support/ParquetGeometryEncodingWkb.d.ts +4 -0
  141. package/layers/support/ParquetGeometryEncodingWkb.js +5 -0
  142. package/layers/support/parquetEncodingUtils.js +1 -1
  143. package/layers/support/parquetUtils.js +1 -1
  144. package/layers/support/tiles3DUtils.js +1 -1
  145. package/layers/voxel/VoxelVolume.js +1 -1
  146. package/libs/parquet/parquet.js +1 -1
  147. package/package.json +2 -2
  148. package/support/revision.js +1 -1
  149. package/symbols/cim/effects/EffectSuppress.js +1 -1
  150. package/views/2d/engine/vectorTiles/shaders/sources/shaderRepository.js +1 -1
  151. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  152. package/views/2d/interactive/SegmentLabels2D.js +1 -1
  153. package/views/2d/layers/features/layerAdapters/ParquetLayerAdapter.js +1 -1
  154. package/views/3d/analysis/AreaMeasurement/support/MeasurementData.js +1 -1
  155. package/views/3d/analysis/Dimension/lengthDimensionConstraintUtils.js +1 -1
  156. package/views/3d/analysis/Dimension/lengthDimensionUtils.js +1 -1
  157. package/views/3d/analysis/LineOfSight/LineOfSightController.js +1 -1
  158. package/views/3d/analysis/LineOfSight/LineOfSightIntersectionResult.js +1 -1
  159. package/views/3d/analysis/Slice/sliceToolUtils.js +1 -1
  160. package/views/3d/analysis/Viewshed/ViewshedScaleOrientManipulation.js +1 -1
  161. package/views/3d/analysis/Viewshed/ViewshedSubTool.js +1 -1
  162. package/views/3d/analysis/Viewshed/ViewshedSubVisualization.js +1 -1
  163. package/views/3d/analysis/Viewshed/ViewshedTool.js +1 -1
  164. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillController.js +1 -1
  165. package/views/3d/animation/pointToPoint/Camera.js +1 -1
  166. package/views/3d/camera/constraintUtils/distance.js +1 -1
  167. package/views/3d/camera/constraintUtils/tilt.js +1 -1
  168. package/views/3d/environment/ChapmanAtmosphere.js +1 -1
  169. package/views/3d/environment/CloudsParameters.js +1 -1
  170. package/views/3d/environment/EnvironmentManager.js +1 -1
  171. package/views/3d/environment/MarsAtmosphere.js +1 -1
  172. package/views/3d/glTF/internal/Resource.js +1 -1
  173. package/views/3d/glTF/loader.js +1 -1
  174. package/views/3d/interactive/SegmentLabels3D.js +1 -1
  175. package/views/3d/interactive/editingTools/manipulations/MoveZManipulation.js +1 -1
  176. package/views/3d/interactive/editingTools/media/MediaElementManipulator3D.js +1 -1
  177. package/views/3d/interactive/editingTools/reshape/edgeOffsetUtils.js +1 -1
  178. package/views/3d/interactive/visualElements/MeasurementArrowVisualElement.js +1 -1
  179. package/views/3d/interactive/visualElements/RightAngleQuadVisualElement.js +1 -1
  180. package/views/3d/layers/I3SMeshView3D.js +1 -1
  181. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  182. package/views/3d/layers/graphics/Graphics3DFrustumVisibility.js +1 -1
  183. package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
  184. package/views/3d/layers/graphics/ObjectResourceCache.js +1 -1
  185. package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
  186. package/views/3d/layers/i3s/I3SMaterialUtil.js +1 -1
  187. package/views/3d/layers/i3s/I3SViewportQueries.js +1 -1
  188. package/views/3d/layers/i3s/PointCloudRenderer.js +1 -1
  189. package/views/3d/layers/support/FeatureTileMeasurements3D.js +1 -1
  190. package/views/3d/layers/support/FeatureTileVisibility3D.js +1 -1
  191. package/views/3d/state/Frustum.js +1 -1
  192. package/views/3d/state/controllers/FovController.js +1 -1
  193. package/views/3d/state/controllers/GamepadKeyboardController.js +1 -1
  194. package/views/3d/state/controllers/momentum/ZoomPlanarMomentumController.js +1 -1
  195. package/views/3d/support/FrustumExtentIntersection.js +1 -1
  196. package/views/3d/support/cameraUtils.js +1 -1
  197. package/views/3d/support/intersectionUtils.js +1 -1
  198. package/views/3d/support/orientedBoundingBox.js +1 -1
  199. package/views/3d/support/pointsOfInterest/CameraOnSurface.js +1 -1
  200. package/views/3d/support/pointsOfInterest/CenterOnSurface.js +1 -1
  201. package/views/3d/support/pointsOfInterest/Focus.js +1 -1
  202. package/views/3d/support/viewpointUtils.js +1 -1
  203. package/views/3d/terrain/OverlayManager.js +1 -1
  204. package/views/3d/terrain/PatchRenderData.js +1 -1
  205. package/views/3d/terrain/SphericalPatch.js +1 -1
  206. package/views/3d/terrain/Tile.js +1 -1
  207. package/views/3d/webgl/RenderCamera.js +1 -1
  208. package/views/3d/webgl-engine/core/FBOCache.js +1 -1
  209. package/views/3d/webgl-engine/effects/haze/Haze.js +1 -1
  210. package/views/3d/webgl-engine/lib/CutFillDepth.js +1 -1
  211. package/views/3d/webgl-engine/lib/GaussianSplatRenderNode.js +1 -1
  212. package/views/3d/webgl-engine/lib/Object3D.js +1 -1
  213. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  214. package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
  215. package/views/3d/webgl-engine/lib/Viewshed.js +1 -1
  216. package/views/3d/webgl-engine/lib/edgeRendering/edgePreprocessing.js +1 -1
  217. package/views/3d/webgl-engine/lib/geometryDataUtils.js +1 -1
  218. package/views/3d/webgl-engine/lib/triangleIntersectionUtils.js +1 -1
  219. package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
  220. package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
  221. package/views/3d/webgl-engine/materials/MeasurementArrowMaterial.js +1 -1
  222. package/views/3d/webgl-engine/materials/NativeLineMaterial.js +1 -1
  223. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  224. package/views/3d/webgl-engine/materials/pbrUtils.js +1 -1
  225. package/views/3d/webgl-engine/shaders/SphereDepthInterpolate.glsl.js +1 -1
  226. package/views/SelectionManager.js +1 -1
  227. package/views/draw/support/Reshape.js +1 -1
  228. package/views/interactive/GraphicManipulator.js +1 -1
  229. package/views/interactive/coordinateHelper.js +1 -1
  230. package/views/interactive/editGeometry/operations/OffsetEdgeVertex.js +1 -1
  231. package/views/interactive/sketch/constraints.js +1 -1
  232. package/views/interactive/snapping/featureSources/sceneLayerSource/SceneLayerSnappingSourceWorker.js +1 -1
  233. package/views/interactive/snapping/featureSources/sceneLayerSource/sceneLayerSnappingUtils.js +1 -1
  234. package/views/interactive/snapping/hints/LineSnappingHint.js +1 -1
  235. package/views/interactive/tooltip/tooltipCommonUtils.js +1 -1
  236. package/views/navigation/PanSphericalMomentumEstimator.js +1 -1
  237. package/views/support/euclideanAreaMeasurementUtils.js +1 -1
  238. package/views/support/euclideanLengthMeasurementUtils.js +1 -1
  239. package/views/support/geometry3dUtils.js +1 -1
  240. package/views/support/selectionUtils.js +1 -1
  241. package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
  242. package/widgets/BatchAttributeForm/css.js +1 -1
  243. package/widgets/BatchAttributeForm/inputs/SingleFeatureInput.d.ts +4 -0
  244. package/widgets/BatchAttributeForm/inputs/SingleFeatureInput.js +5 -0
  245. package/widgets/BatchAttributeForm/inputs/TextElementInput.d.ts +4 -0
  246. package/widgets/BatchAttributeForm/inputs/TextElementInput.js +5 -0
  247. package/widgets/BatchAttributeForm/inputs/support/createBatchFormInputs.js +1 -1
  248. package/widgets/BatchAttributeForm/inputs/support/inputUtils.js +1 -1
  249. package/widgets/BatchAttributeForm/templates/GroupElementTemplate.js +1 -1
  250. package/widgets/BatchAttributeForm/templates/TextElementTemplate.js +5 -0
  251. package/widgets/BatchAttributeForm/templates/support/createBatchFormTemplate.js +1 -1
  252. package/widgets/BatchAttributeForm/templates/support/hashElementTemplate.js +1 -1
  253. package/widgets/BatchAttributeForm/templates/support/templateUtils.js +1 -1
  254. package/widgets/BatchAttributeForm.js +1 -1
  255. package/widgets/Editor/support/SketchController.js +1 -1
  256. package/widgets/FeatureForm/TextElementInput.d.ts +2 -2
  257. package/widgets/FeatureForm/TextElementInput.js +1 -1
  258. package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
  259. package/widgets/FeatureTemplates/FeatureTemplatesViewModel.js +1 -1
  260. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  261. package/widgets/OrientedImageryViewer.js +1 -1
  262. package/widgets/PanoramicViewer/PanoramicVideoViewerViewModel.js +1 -1
  263. package/widgets/PanoramicViewer/PanoramicViewerViewModel.js +1 -1
  264. package/widgets/PanoramicViewer/PanoramicZoomManager.js +1 -1
  265. package/widgets/PanoramicViewer/support/PanoramicMedia.js +5 -0
  266. package/widgets/PanoramicViewer/support/PanoramicMediaCollection.js +5 -0
  267. package/widgets/PanoramicViewer/support/PanoramicMediaError.js +5 -0
  268. package/widgets/PanoramicViewer/utils.js +1 -1
  269. package/widgets/PanoramicViewer.js +1 -1
  270. package/widgets/Search/SearchViewModel.js +1 -1
  271. package/widgets/Search.js +1 -1
  272. package/widgets/Sketch.js +1 -1
  273. package/widgets/support/SelectionList/SelectionListViewModel.js +1 -1
  274. package/widgets/support/Selector2D/selectorUtils.js +1 -1
  275. package/assets/esri/core/workers/chunks/024104997daea0d74b38.js +0 -1
  276. package/assets/esri/core/workers/chunks/04a0685ee53ef74883aa.js +0 -1
  277. package/assets/esri/core/workers/chunks/08ef90e3fcfd4eda4301.js +0 -1
  278. package/assets/esri/core/workers/chunks/1e0e7cef7ef947894bbe.js +0 -1019
  279. package/assets/esri/core/workers/chunks/20988e116f3723228f36.js +0 -1
  280. package/assets/esri/core/workers/chunks/2613e482450b57f2d4f5.js +0 -1
  281. package/assets/esri/core/workers/chunks/274f2b5e6dbc58505142.js +0 -1
  282. package/assets/esri/core/workers/chunks/27dfbe3d903b95d4c67a.js +0 -1
  283. package/assets/esri/core/workers/chunks/28a5a7c6b3d6902146f6.js +0 -1
  284. package/assets/esri/core/workers/chunks/2c4218306747f5d15575.js +0 -1
  285. package/assets/esri/core/workers/chunks/2d3ae187f8aa3495d4ae.js +0 -1
  286. package/assets/esri/core/workers/chunks/2db7a7607657f1d669f7.js +0 -1
  287. package/assets/esri/core/workers/chunks/2f8cf7d9ff1f4de19a4c.js +0 -1
  288. package/assets/esri/core/workers/chunks/338570424337be05cef5.js +0 -1
  289. package/assets/esri/core/workers/chunks/36130910ba141f34531b.js +0 -1
  290. package/assets/esri/core/workers/chunks/3767617c0dfc7d801441.js +0 -1
  291. package/assets/esri/core/workers/chunks/44b6b7418cbf7f778bef.js +0 -1
  292. package/assets/esri/core/workers/chunks/4675ed3ca3e0104d00bf.js +0 -1
  293. package/assets/esri/core/workers/chunks/4df7cc3477bc46fc39af.js +0 -1
  294. package/assets/esri/core/workers/chunks/538ddb267aa328814865.js +0 -1
  295. package/assets/esri/core/workers/chunks/555a0ea44ba77819d493.js +0 -1
  296. package/assets/esri/core/workers/chunks/55818fe7a7aa1e5c8bbd.js +0 -1
  297. package/assets/esri/core/workers/chunks/59889855d23baec1adf9.js +0 -1
  298. package/assets/esri/core/workers/chunks/5f781ef46ce7c4048c2f.js +0 -1
  299. package/assets/esri/core/workers/chunks/60f2de8dd8876bfd715a.js +0 -1
  300. package/assets/esri/core/workers/chunks/679088064420a906aa7f.js +0 -1
  301. package/assets/esri/core/workers/chunks/706423d801fa9cbf2e90.js +0 -1
  302. package/assets/esri/core/workers/chunks/71dd80231ea656a6380c.js +0 -1
  303. package/assets/esri/core/workers/chunks/725819839434c59102f3.js +0 -1
  304. package/assets/esri/core/workers/chunks/72cebf18da5ec5eeb666.js +0 -1
  305. package/assets/esri/core/workers/chunks/768d9b6eaba7bfa18dde.js +0 -1
  306. package/assets/esri/core/workers/chunks/77b45957cfe42523c1c8.js +0 -1
  307. package/assets/esri/core/workers/chunks/852de585a72d902344a6.js +0 -1
  308. package/assets/esri/core/workers/chunks/871dd5e1f016a04b8d98.js +0 -1
  309. package/assets/esri/core/workers/chunks/892c417f5130b003889d.js +0 -1
  310. package/assets/esri/core/workers/chunks/8d4cc5f1d07b4aa3aea0.js +0 -1
  311. package/assets/esri/core/workers/chunks/907083c427d7fb4354e9.js +0 -1
  312. package/assets/esri/core/workers/chunks/93c5f097bb7b380bb175.js +0 -1
  313. package/assets/esri/core/workers/chunks/9f0172b83f25ef5f8d40.js +0 -1
  314. package/assets/esri/core/workers/chunks/a00bba1c7cbf8cd7892c.js +0 -1
  315. package/assets/esri/core/workers/chunks/a34a14fd989dbbd3c2d0.js +0 -1
  316. package/assets/esri/core/workers/chunks/ae793d814cf32db9fbde.js +0 -1
  317. package/assets/esri/core/workers/chunks/b21cf62652ca772108c8.js +0 -1
  318. package/assets/esri/core/workers/chunks/c5c02ace54fe4ab9214b.js +0 -1
  319. package/assets/esri/core/workers/chunks/c82a974c8448407885e6.js +0 -1
  320. package/assets/esri/core/workers/chunks/d0014b4a8c013f59b113.js +0 -1
  321. package/assets/esri/core/workers/chunks/d08ee45c501102deea20.js +0 -1
  322. package/assets/esri/core/workers/chunks/d239a4ef60e348cfb05a.js +0 -1
  323. package/assets/esri/core/workers/chunks/da2ba40bc017bff0fe49.js +0 -1
  324. package/assets/esri/core/workers/chunks/dc3a4ad62bc041a4f899.js +0 -1
  325. package/assets/esri/core/workers/chunks/e093e745708f722bc1b9.js +0 -1
  326. package/assets/esri/core/workers/chunks/e501d68a1464805c4b4e.js +0 -1
  327. package/assets/esri/core/workers/chunks/e6784251bbb8b71ead93.js +0 -1
  328. package/assets/esri/core/workers/chunks/f3c232fc56a29d51196a.js +0 -1
  329. package/layers/support/ParquetEncodingLocation.d.ts +0 -4
  330. package/layers/support/ParquetEncodingLocation.js +0 -5
  331. package/layers/support/ParquetEncodingWkb.d.ts +0 -4
  332. package/layers/support/ParquetEncodingWkb.js +0 -5
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{throwIfAborted as t}from"../../../../../core/promiseUtils.js";import{generateUID as o}from"../../../../../core/uid.js";import{subclass as s}from"../../../../../core/accessorSupport/decorators.js";import{i as n,C as i}from"../../../../../chunks/vec32.js";import{create as r,clone as c}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as d,fromPoints as a,projectPoint as m}from"../../../../../geometry/support/lineSegment.js";import{Sphere as p}from"../../../../../geometry/support/sphere.js";import{Octree as h}from"../../../../3d/webgl-engine/lib/Octree.js";import{extractComponentsEdgeLocationsLayout as u}from"../../../../3d/webgl-engine/lib/edgeRendering/edgeProcessing.js";import{maxCandidateCount as g,boundsFromEdge as l}from"./sceneLayerSnappingUtils.js";import{SnappingCandidateEdge as f,SnappingCandidateVertex as _}from"./SnappingCandidate.js";let b=class{constructor(){this._idToComponent=new Map,this._components=new h(e=>e.bounds),this._edges=new h(e=>e.bounds),this._tmpLineSegment=d(),this._tmpP1=r(),this._tmpP2=r(),this._tmpP3=r(),this.remoteClient=null}async fetchCandidates(e,o){await Promise.resolve(),t(o);const s=e;s.mbs=new p(e.mbsJSON),await this._ensureEdgeLocations(s,o);const n=[];return this._edges.forEachNeighbor(e=>(this._addCandidates(s,e,n),n.length<g),s.mbs),{result:{candidates:n}}}async _ensureEdgeLocations(e,t){const o=[];if(this._components.forEachNeighbor(e=>{if(null==e.info){const{id:t,uid:s}=e;o.push({id:t,uid:s})}return!0},e.mbs),!o.length)return;const s={components:o},n=await this.remoteClient.invoke("fetchAllEdgeLocations",s,t??{});for(const i of n.components)this._setFetchEdgeLocations(i)}async add(e){const t=new C(e.id,new p(e.bounds));return this._idToComponent.set(t.id,t),this._components.add([t]),{result:{}}}async remove(e){const t=this._idToComponent.get(e.id);if(t){const e=[];this._edges.forEachNeighbor(o=>(o.component===t&&e.push(o),!0),t.bounds),this._edges.remove(e),this._components.remove([t]),this._idToComponent.delete(t.id)}return{result:{}}}_setFetchEdgeLocations(e){const t=this._idToComponent.get(e.id);if(null==t||e.uid!==t.uid)return;const o=u.createView(e.locations),s=new Array(o.count),n=r(),i=r();for(let r=0;r<o.count;r++){o.position0.getVec(r,n),o.position1.getVec(r,i);const c=l(n,i,e.origin),d=new S(t,r,c);s[r]=d}this._edges.add(s);const{objectIds:c,origin:d}=e;t.info={locations:o,objectIds:c,origin:d}}_addCandidates(e,t,o){const{info:s}=t.component,{origin:i,objectIds:r}=s,c=s.locations,d=c.position0.getVec(t.index,this._tmpP1),a=c.position1.getVec(t.index,this._tmpP2);n(d,d,i),n(a,a,i);const m=r[c.componentIndex.get(t.index)];this._addEdgeCandidate(e,m,d,a,o),j(e,m,d,o),j(e,m,a,o)}_addEdgeCandidate(e,t,o,s,n){if(!e.returnEdge)return;const r=e.mbs.center,d=a(o,s,this._tmpLineSegment),p=m(d,r,this._tmpP3);e.mbs.contains(p)&&n.push(new f(t,c(p),i(r,p),c(o),c(s)))}};b=e([s("esri.views.interactive.snapping.featureSources.sceneLayerSource.SceneLayerSnappingSourceWorker")],b);const w=b;function j(e,t,o,s){e.returnVertex&&e.mbs.contains(o)&&s.push(new _(t,c(o),i(e.mbs.center,o)))}class C{constructor(e,t){this.id=e,this.bounds=t,this.info=null,this.uid=o()}}class S{constructor(e,t,o){this.component=e,this.index=t,this.bounds=o}}export{w as default};
5
+ import{__decorate as e}from"tslib";import{throwIfAborted as t}from"../../../../../core/promiseUtils.js";import{generateUID as o}from"../../../../../core/uid.js";import{subclass as s}from"../../../../../core/accessorSupport/decorators.js";import{i as n,D as i}from"../../../../../chunks/vec32.js";import{create as r,clone as c}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as d,fromPoints as a,projectPoint as m}from"../../../../../geometry/support/lineSegment.js";import{Sphere as p}from"../../../../../geometry/support/sphere.js";import{Octree as h}from"../../../../3d/webgl-engine/lib/Octree.js";import{extractComponentsEdgeLocationsLayout as u}from"../../../../3d/webgl-engine/lib/edgeRendering/edgeProcessing.js";import{maxCandidateCount as g,boundsFromEdge as l}from"./sceneLayerSnappingUtils.js";import{SnappingCandidateEdge as f,SnappingCandidateVertex as _}from"./SnappingCandidate.js";let b=class{constructor(){this._idToComponent=new Map,this._components=new h(e=>e.bounds),this._edges=new h(e=>e.bounds),this._tmpLineSegment=d(),this._tmpP1=r(),this._tmpP2=r(),this._tmpP3=r(),this.remoteClient=null}async fetchCandidates(e,o){await Promise.resolve(),t(o);const s=e;s.mbs=new p(e.mbsJSON),await this._ensureEdgeLocations(s,o);const n=[];return this._edges.forEachNeighbor(e=>(this._addCandidates(s,e,n),n.length<g),s.mbs),{result:{candidates:n}}}async _ensureEdgeLocations(e,t){const o=[];if(this._components.forEachNeighbor(e=>{if(null==e.info){const{id:t,uid:s}=e;o.push({id:t,uid:s})}return!0},e.mbs),!o.length)return;const s={components:o},n=await this.remoteClient.invoke("fetchAllEdgeLocations",s,t??{});for(const i of n.components)this._setFetchEdgeLocations(i)}async add(e){const t=new C(e.id,new p(e.bounds));return this._idToComponent.set(t.id,t),this._components.add([t]),{result:{}}}async remove(e){const t=this._idToComponent.get(e.id);if(t){const e=[];this._edges.forEachNeighbor(o=>(o.component===t&&e.push(o),!0),t.bounds),this._edges.remove(e),this._components.remove([t]),this._idToComponent.delete(t.id)}return{result:{}}}_setFetchEdgeLocations(e){const t=this._idToComponent.get(e.id);if(null==t||e.uid!==t.uid)return;const o=u.createView(e.locations),s=new Array(o.count),n=r(),i=r();for(let r=0;r<o.count;r++){o.position0.getVec(r,n),o.position1.getVec(r,i);const c=l(n,i,e.origin),d=new S(t,r,c);s[r]=d}this._edges.add(s);const{objectIds:c,origin:d}=e;t.info={locations:o,objectIds:c,origin:d}}_addCandidates(e,t,o){const{info:s}=t.component,{origin:i,objectIds:r}=s,c=s.locations,d=c.position0.getVec(t.index,this._tmpP1),a=c.position1.getVec(t.index,this._tmpP2);n(d,d,i),n(a,a,i);const m=r[c.componentIndex.get(t.index)];this._addEdgeCandidate(e,m,d,a,o),j(e,m,d,o),j(e,m,a,o)}_addEdgeCandidate(e,t,o,s,n){if(!e.returnEdge)return;const r=e.mbs.center,d=a(o,s,this._tmpLineSegment),p=m(d,r,this._tmpP3);e.mbs.contains(p)&&n.push(new f(t,c(p),i(r,p),c(o),c(s)))}};b=e([s("esri.views.interactive.snapping.featureSources.sceneLayerSource.SceneLayerSnappingSourceWorker")],b);const w=b;function j(e,t,o,s){e.returnVertex&&e.mbs.contains(o)&&s.push(new _(t,c(o),i(e.mbs.center,o)))}class C{constructor(e,t){this.id=e,this.bounds=t,this.info=null,this.uid=o()}}class S{constructor(e,t,o){this.component=e,this.index=t,this.bounds=o}}export{w 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/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{j as e,c as r,C as t,i as n}from"../../../../../chunks/vec32.js";import{Sphere as c}from"../../../../../geometry/support/sphere.js";const s=1e3;function o(s,o,p){const a=new c;return e(a.center,s,.5),r(a.center,a.center,o,.5),a.radius=t(a.center,s),n(a.center,a.center,p),a}export{o as boundsFromEdge,s as maxCandidateCount};
5
+ import{j as e,c as r,D as t,i as n}from"../../../../../chunks/vec32.js";import{Sphere as c}from"../../../../../geometry/support/sphere.js";const s=1e3;function o(s,o,p){const a=new c;return e(a.center,s,.5),r(a.center,a.center,o,.5),a.radius=t(a.center,s),n(a.center,a.center,p),a}export{o as boundsFromEdge,s as maxCandidateCount};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{m as t,C as e}from"../../../../chunks/vec32.js";import{SnappingHint as i}from"./SnappingHint.js";class s extends i{constructor(t,e,i,s,n=3,h=!0,a=!0){super(s,n),this.type=t,this.lineStart=e,this.lineEnd=i,this.fadeLeft=h,this.fadeRight=a}equals(e){return e instanceof s&&(this.type===e.type&&t(this.lineStart,e.lineStart)&&t(this.lineEnd,e.lineEnd)&&this.fadeLeft===e.fadeLeft&&this.fadeRight===e.fadeRight)}get length(){return e(this.lineStart,this.lineEnd)}}export{s as LineSnappingHint};
5
+ import{m as t,D as e}from"../../../../chunks/vec32.js";import{SnappingHint as i}from"./SnappingHint.js";class s extends i{constructor(t,e,i,s,n=3,h=!0,a=!0){super(s,n),this.type=t,this.lineStart=e,this.lineEnd=i,this.fadeLeft=h,this.fadeRight=a}equals(e){return e instanceof s&&(this.type===e.type&&t(this.lineStart,e.lineStart)&&t(this.lineEnd,e.lineEnd)&&this.fadeLeft===e.fadeLeft&&this.fadeRight===e.fadeRight)}get length(){return e(this.lineStart,this.lineEnd)}}export{s as LineSnappingHint};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{createTask as t}from"../../../core/asyncUtils.js";import{handlesGroup as o,makeHandle as e}from"../../../core/handleUtils.js";import{floatEqualUlp as n}from"../../../core/mathUtils.js";import{createAngle as r,createScalar as i,valueInUnit as a}from"../../../core/quantity.js";import{watch as l}from"../../../core/reactiveUtils.js";import{verticalLengthUnitFromSpatialReference as s}from"../../../core/units.js";import{q as u,j as c,F as p}from"../../../chunks/vec32.js";import{UNIT_Z as f,create as m,clone as d,ONES as g}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{isLoaded as y,load as v}from"../../../geometry/coordinateFormatter.js";import j from"../../../geometry/support/MeshTransform.js";import{isRelativeVertexSpace as x}from"../../../geometry/support/meshVertexSpaceUtils.js";import{isWebMercator as b}from"../../../geometry/support/spatialReferenceUtils.js";import{lngLatToXY as h}from"../../../geometry/support/webMercatorUtils.js";import{tooltipKeys as S}from"../keybindings.js";import U from"../Tooltip.js";import{parseLatitudeLongitude as w,parseXY as A}from"./fields/parsingAndFormattingUtils.js";import{getDegreesArithmetic as M,getDegreesGeographic as k}from"../../support/angularMeasurementUtils.js";function R(t){const o=new U(t());return o.addHandles(l(()=>t(),({view:t,options:e,info:n})=>{o.view=t,void 0!==e&&(o.options=e),void 0!==n&&(o.info=n)})),o}function V(t,o){const e=x(o.vertexSpace),{scale:n,orientation:a}=t,{transform:l}=o,s=I(l);e&&null!=s?(a.actual=r(s,"degrees","arithmetic"),a.visible=!0):(a.actual=null,a.visible=!1),e?(n.actual=i(H(l)),n.visible=!0):(n.actual=null,n.visible=!1)}function z(t,o,e){if(!o||!x(o.vertexSpace))return;const n=o.transform??=new j;D(t,n,e),F(t,n,e)}function D(t,o,e){const r=M(t.orientation.actual),i=T(o.rotationAxis);if(null==r||null==i)return;const a=r-90,l=o.rotationAngle,s=a*i,u=s-l;n(l,s)||(e?.onRotateStart(0),o.rotationAngle=s,e?.onRotate(u),e?.onRotateStop(u))}function F(t,o,e){const n=t.scale.actual?.value,r=H(o);if(null==n||n===r)return;const{scale:i}=o;let a;if(0===r)a=d(g);else{const t=n/r;a=c(m(),i,t)}e?.onScaleStart(i[0],i[1],i[2]),o.scale=a,e?.onScale(a[0],a[1],a[2]),e?.onScaleStop(a[0],a[1],a[2])}function P(t,o){const{x:e,y:r,z:i}=o,{x:a,y:l,z:s}=q(t,o.spatialReference);return{dx:null==a||n(a,e)?0:a-e,dy:null==l||n(l,r)?0:l-r,dz:null==s||null==i||n(s,i)?0:s-i}}function q(t,o){let e,n;t.geographic?(e=k(t.longitude.actual),n=k(t.latitude.actual),b(o)&&(null!=e&&null!=n?[e,n]=h(e,n,E):null!=e?e=h(e,0,E)[0]:null!=n&&(n=h(0,n,E)[1]))):(e=t.x.actual?.value,n=t.y.actual?.value);const r=t.elevation.actual,i=s(o);return{x:e,y:n,z:null!=i&&null!=r?a(r,i):void 0}}const E=[0,0];function I(t){const o=90;if(!t)return o;const e=T(t.rotationAxis)??1;return null!=e?o+e*t.rotationAngle:null}function T(t){return p(t,f)?1:p(t,B)?-1:null}const B=u(m(),f);function H(t){return t?Math.max(...t.scale):1}function O(t,o){return!("key-down"!==t.type||t.key!==S.enterInputMode||!o||!C(o.info))&&(o.enterInputMode(),t.preventDefault(),t.stopPropagation(),!0)}function C(t){const o=t?.sketchOptions;if(!o)return!1;const{inputEnabled:e,visibleElements:n}=o.tooltips;return e&&!0===t.editableFields.some(({name:t})=>"x"===t||"y"===t?n.coordinates:n[t])}function G(n,r){let i=null;return o([n.on("paste",o=>{i?.abort(),i=t(async()=>{y()||await v(),J(o,n.info,r)})}),t(()=>v()),e(()=>i?.abort())])}function J(t,o,e){if(!o||!("geographic"in o))return;const n=t.clipboardData?.getData("text");if(!n)return;const r=o=>{t.stopPropagation(),t.preventDefault(),e?.onBeforePaste(),o(),e?.onAfterPaste()};if(o.geographic){const t=w(n);t&&r(()=>{o.longitude.applyValue(t.longitude),o.latitude.applyValue(t.latitude)})}else{const t=A(n);t&&r(()=>{o.x.applyValue(t.x),o.y.applyValue(t.y)})}}export{G as connectPasteEvent,O as enterInputModeIfAvailable,P as getXYZDeltasFromTooltipInfo,R as makeTooltip,J as pasteLocation,z as updateMeshTransformFromTooltipInfo,V as updateTooltipInfoFromMeshTransform};
5
+ import{createTask as t}from"../../../core/asyncUtils.js";import{handlesGroup as o,makeHandle as e}from"../../../core/handleUtils.js";import{floatEqualUlp as n}from"../../../core/mathUtils.js";import{createAngle as r,createScalar as i,valueInUnit as a}from"../../../core/quantity.js";import{watch as l}from"../../../core/reactiveUtils.js";import{verticalLengthUnitFromSpatialReference as s}from"../../../core/units.js";import{q as u,j as c,G as p}from"../../../chunks/vec32.js";import{UNIT_Z as f,create as m,clone as d,ONES as g}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{isLoaded as y,load as v}from"../../../geometry/coordinateFormatter.js";import j from"../../../geometry/support/MeshTransform.js";import{isRelativeVertexSpace as x}from"../../../geometry/support/meshVertexSpaceUtils.js";import{isWebMercator as b}from"../../../geometry/support/spatialReferenceUtils.js";import{lngLatToXY as h}from"../../../geometry/support/webMercatorUtils.js";import{tooltipKeys as S}from"../keybindings.js";import U from"../Tooltip.js";import{parseLatitudeLongitude as w,parseXY as A}from"./fields/parsingAndFormattingUtils.js";import{getDegreesArithmetic as M,getDegreesGeographic as k}from"../../support/angularMeasurementUtils.js";function R(t){const o=new U(t());return o.addHandles(l(()=>t(),({view:t,options:e,info:n})=>{o.view=t,void 0!==e&&(o.options=e),void 0!==n&&(o.info=n)})),o}function V(t,o){const e=x(o.vertexSpace),{scale:n,orientation:a}=t,{transform:l}=o,s=I(l);e&&null!=s?(a.actual=r(s,"degrees","arithmetic"),a.visible=!0):(a.actual=null,a.visible=!1),e?(n.actual=i(G(l)),n.visible=!0):(n.actual=null,n.visible=!1)}function z(t,o,e){if(!o||!x(o.vertexSpace))return;const n=o.transform??=new j;D(t,n,e),P(t,n,e)}function D(t,o,e){const r=M(t.orientation.actual),i=T(o.rotationAxis);if(null==r||null==i)return;const a=r-90,l=o.rotationAngle,s=a*i,u=s-l;n(l,s)||(e?.onRotateStart(0),o.rotationAngle=s,e?.onRotate(u),e?.onRotateStop(u))}function P(t,o,e){const n=t.scale.actual?.value,r=G(o);if(null==n||n===r)return;const{scale:i}=o;let a;if(0===r)a=d(g);else{const t=n/r;a=c(m(),i,t)}e?.onScaleStart(i[0],i[1],i[2]),o.scale=a,e?.onScale(a[0],a[1],a[2]),e?.onScaleStop(a[0],a[1],a[2])}function F(t,o){const{x:e,y:r,z:i}=o,{x:a,y:l,z:s}=q(t,o.spatialReference);return{dx:null==a||n(a,e)?0:a-e,dy:null==l||n(l,r)?0:l-r,dz:null==s||null==i||n(s,i)?0:s-i}}function q(t,o){let e,n;t.geographic?(e=k(t.longitude.actual),n=k(t.latitude.actual),b(o)&&(null!=e&&null!=n?[e,n]=h(e,n,E):null!=e?e=h(e,0,E)[0]:null!=n&&(n=h(0,n,E)[1]))):(e=t.x.actual?.value,n=t.y.actual?.value);const r=t.elevation.actual,i=s(o);return{x:e,y:n,z:null!=i&&null!=r?a(r,i):void 0}}const E=[0,0];function I(t){const o=90;if(!t)return o;const e=T(t.rotationAxis)??1;return null!=e?o+e*t.rotationAngle:null}function T(t){return p(t,f)?1:p(t,B)?-1:null}const B=u(m(),f);function G(t){return t?Math.max(...t.scale):1}function H(t,o){return!("key-down"!==t.type||t.key!==S.enterInputMode||!o||!O(o.info))&&(o.enterInputMode(),t.preventDefault(),t.stopPropagation(),!0)}function O(t){const o=t?.sketchOptions;if(!o)return!1;const{inputEnabled:e,visibleElements:n}=o.tooltips;return e&&!0===t.editableFields.some(({name:t})=>"x"===t||"y"===t?n.coordinates:n[t])}function C(n,r){let i=null;return o([n.on("paste",o=>{i?.abort(),i=t(async()=>{y()||await v(),J(o,n.info,r)})}),t(()=>v()),e(()=>i?.abort())])}function J(t,o,e){if(!o||!("geographic"in o))return;const n=t.clipboardData?.getData("text");if(!n)return;const r=o=>{t.stopPropagation(),t.preventDefault(),e?.onBeforePaste(),o(),e?.onAfterPaste()};if(o.geographic){const t=w(n);t&&r(()=>{o.longitude.applyValue(t.longitude),o.latitude.applyValue(t.latitude)})}else{const t=A(n);t&&r(()=>{o.x.applyValue(t.x),o.y.applyValue(t.y)})}}export{C as connectPasteEvent,H as enterInputModeIfAvailable,F as getXYZDeltasFromTooltipInfo,R as makeTooltip,J as pasteLocation,z as updateMeshTransformFromTooltipInfo,V as updateTooltipInfoFromMeshTransform};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{create as t}from"../../core/libs/gl-matrix-2/factories/vec2f64.js";import{E as e,n as i,d as s}from"../../chunks/vec32.js";import{create as a}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{rotationAngleAndAxisDirectRotation as l,rotationAnglesAndAxesHeadingPreserving as n}from"../3d/state/utils/navigationUtils.js";import{FilteredFiniteDifference as r}from"./FilteredFiniteDifference.js";import{FilteredValue as h}from"./FilteredValue.js";import{Momentum as _}from"./Momentum.js";const m=1e-5;class u extends _{constructor(t,e,i,s,a,l=0,n){super(t,e,i),this._angularVelocity1=s,this.axis1=a,this.angularVelocity2=l,this.axis2=n}value1(t){return super.valueFromInitialVelocity(this._angularVelocity1,t)}value2(t){return super.valueFromInitialVelocity(this.angularVelocity2,t)}}class o{constructor(e=300,i=12,s=.84){this._minimumInitialVelocity=e,this._stopVelocity=i,this._friction=s,this.enabled=!0,this._tmpAxis1=a(),this._tmpAxis2=a(),this._tmpAngles=t(),this._time=new r(.3),this._screen=[new r(.4),new r(.4)],this._angle1=new h(.6),this._angle2=new h(.6),this._axis1=a(),this._axis2=a(),this._lastScene=a()}addMomentumDirectRotation(t,a,n,r,h,_){if(this.enabled){if(this._time.hasLastValue()){if(this._time.computeDelta(n)<.01)return;let t=l(this._lastScene,a,this._tmpAxis2,r,h,_);this._angle2.update(0),e(this._tmpAxis2)<m?t=0:i(this._axis1,this._tmpAxis2),this._angle1.update(t),s(this._lastScene,a)}this._screen[0].update(t[0]),this._screen[1].update(t[1]),this._time.update(n)}}addMomentumPreserveHeading(t,a,l,r,h,_,u){if(this.enabled){if(this._time.hasLastValue()){if(this._time.computeDelta(l)<.01)return;n(this._lastScene,a,this._tmpAxis2,this._tmpAxis1,this._tmpAngles,r,h,_,u,!1),e(this._tmpAxis2)<m?(this._angle1.update(0),this._angle2.update(0)):(this._angle1.update(this._tmpAngles[1]),this._angle2.update(this._tmpAngles[0]),i(this._axis1,this._tmpAxis1),i(this._axis2,this._tmpAxis2)),s(this._lastScene,a)}this._screen[0].update(t[0]),this._screen[1].update(t[1]),this._time.update(l)}}reset(){this._screen[0].reset(),this._screen[1].reset(),this._angle1.reset(),this._angle2.reset(),this._time.reset()}evaluateMomentum(){if(!this.enabled||!this._screen[0].hasFilteredDelta())return null;const t=this._screen[0].filteredDelta,e=this._screen[1].filteredDelta,i=null==t||null==e?null:Math.sqrt(t*t+e*e),s=this._time.filteredDelta,a=null==i||null==s?0:i/s;return Math.abs(a)<this._minimumInitialVelocity?null:this.createMomentum(a,this._stopVelocity,this._friction)}createMomentum(t,e,i){const s=this._time.filteredDelta,a=this._angle1.filteredValue,l=this._angle2.filteredValue,n=null==s||null==l?0:l/s;return new u(t,e,i,null==s||null==a?0:a/s,this._axis1,n,this._axis2)}}export{u as PanSphericalMomentum,o as PanSphericalMomentumEstimator};
5
+ import{create as t}from"../../core/libs/gl-matrix-2/factories/vec2f64.js";import{F as e,n as i,d as s}from"../../chunks/vec32.js";import{create as a}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{rotationAngleAndAxisDirectRotation as l,rotationAnglesAndAxesHeadingPreserving as n}from"../3d/state/utils/navigationUtils.js";import{FilteredFiniteDifference as r}from"./FilteredFiniteDifference.js";import{FilteredValue as h}from"./FilteredValue.js";import{Momentum as _}from"./Momentum.js";const m=1e-5;class u extends _{constructor(t,e,i,s,a,l=0,n){super(t,e,i),this._angularVelocity1=s,this.axis1=a,this.angularVelocity2=l,this.axis2=n}value1(t){return super.valueFromInitialVelocity(this._angularVelocity1,t)}value2(t){return super.valueFromInitialVelocity(this.angularVelocity2,t)}}class o{constructor(e=300,i=12,s=.84){this._minimumInitialVelocity=e,this._stopVelocity=i,this._friction=s,this.enabled=!0,this._tmpAxis1=a(),this._tmpAxis2=a(),this._tmpAngles=t(),this._time=new r(.3),this._screen=[new r(.4),new r(.4)],this._angle1=new h(.6),this._angle2=new h(.6),this._axis1=a(),this._axis2=a(),this._lastScene=a()}addMomentumDirectRotation(t,a,n,r,h,_){if(this.enabled){if(this._time.hasLastValue()){if(this._time.computeDelta(n)<.01)return;let t=l(this._lastScene,a,this._tmpAxis2,r,h,_);this._angle2.update(0),e(this._tmpAxis2)<m?t=0:i(this._axis1,this._tmpAxis2),this._angle1.update(t),s(this._lastScene,a)}this._screen[0].update(t[0]),this._screen[1].update(t[1]),this._time.update(n)}}addMomentumPreserveHeading(t,a,l,r,h,_,u){if(this.enabled){if(this._time.hasLastValue()){if(this._time.computeDelta(l)<.01)return;n(this._lastScene,a,this._tmpAxis2,this._tmpAxis1,this._tmpAngles,r,h,_,u,!1),e(this._tmpAxis2)<m?(this._angle1.update(0),this._angle2.update(0)):(this._angle1.update(this._tmpAngles[1]),this._angle2.update(this._tmpAngles[0]),i(this._axis1,this._tmpAxis1),i(this._axis2,this._tmpAxis2)),s(this._lastScene,a)}this._screen[0].update(t[0]),this._screen[1].update(t[1]),this._time.update(l)}}reset(){this._screen[0].reset(),this._screen[1].reset(),this._angle1.reset(),this._angle2.reset(),this._time.reset()}evaluateMomentum(){if(!this.enabled||!this._screen[0].hasFilteredDelta())return null;const t=this._screen[0].filteredDelta,e=this._screen[1].filteredDelta,i=null==t||null==e?null:Math.sqrt(t*t+e*e),s=this._time.filteredDelta,a=null==i||null==s?0:i/s;return Math.abs(a)<this._minimumInitialVelocity?null:this.createMomentum(a,this._stopVelocity,this._friction)}createMomentum(t,e,i){const s=this._time.filteredDelta,a=this._angle1.filteredValue,l=this._angle2.filteredValue,n=null==s||null==l?0:l/s;return new u(t,e,i,null==s||null==a?0:a/s,this._axis1,n,this._axis2)}}export{u as PanSphericalMomentum,o as PanSphericalMomentumEstimator};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{createArea as t}from"../../core/quantity.js";import{areaUnitFromSpatialReference as o}from"../../core/units.js";import{e as r}from"../../chunks/earcut.js";import{h as n,c as e,E as s}from"../../chunks/vec32.js";import{create as i}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{projectVectorToVector as c}from"../../geometry/projection/projectVectorToVector.js";import{fromPoints as f,wrap as u,getNormal as l,projectPointLocal as m}from"../../geometry/support/plane.js";import{areaPoints2d as p}from"../../geometry/support/triangle.js";import{computeEuclideanMeasurementSR as a}from"./measurementUtils.js";function g(t,o=k()){return j(t,o)}function h(t,o=k()){return j(t,o,!1)}function j(r,g,h=r.hasZ){const j=a(r.spatialReference),k=o(j);if(null==k)return null;const x=(t,o)=>!(o.length<2)&&(n(t,o[0],o[1],h&&o[2]||0),!0);let C=0;for(const t of r.rings){const o=t.length;if(o<3)continue;const{positionsWorldCoords:a}=g;for(;a.length<o;)a.push(i());const h=y,k=n(d,0,0,0),R=1/o;for(let n=0;n<o;n++){if(!x(h,t[n]))return null;if(!c(h,r.spatialReference,a[n],j))return null;e(k,k,a[n],R)}const V=f(a[0],a[1],k,u());if(0===s(l(V)))continue;for(let t=0;t<o;t++)m(V,k,a[t],a[t]);const W=v(a);for(let t=0;t<W.length;t+=3)C+=p(a[W[t]],a[W[t+1]],a[W[t+2]])}return t(C,k)}const y=i(),d=i();function k(){return{positionsWorldCoords:[]}}function v(t){return r(x(t),[],2)}function x(t){const o=new Float64Array(2*t.length);for(let r=0;r<t.length;++r){const n=t[r],e=2*r;o[e]=n[0],o[e+1]=n[1]}return o}export{j as computeEuclideanPlanarArea,k as createEuclideanPlanarAreaCache,h as euclideanHorizontalPlanarArea,g as euclideanPlanarArea,v as triangulate};
5
+ import{createArea as t}from"../../core/quantity.js";import{areaUnitFromSpatialReference as o}from"../../core/units.js";import{e as r}from"../../chunks/earcut.js";import{h as n,c as e,F as s}from"../../chunks/vec32.js";import{create as i}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{projectVectorToVector as c}from"../../geometry/projection/projectVectorToVector.js";import{fromPoints as f,wrap as u,getNormal as l,projectPointLocal as m}from"../../geometry/support/plane.js";import{areaPoints2d as p}from"../../geometry/support/triangle.js";import{computeEuclideanMeasurementSR as a}from"./measurementUtils.js";function g(t,o=k()){return j(t,o)}function h(t,o=k()){return j(t,o,!1)}function j(r,g,h=r.hasZ){const j=a(r.spatialReference),k=o(j);if(null==k)return null;const x=(t,o)=>!(o.length<2)&&(n(t,o[0],o[1],h&&o[2]||0),!0);let C=0;for(const t of r.rings){const o=t.length;if(o<3)continue;const{positionsWorldCoords:a}=g;for(;a.length<o;)a.push(i());const h=y,k=n(d,0,0,0),F=1/o;for(let n=0;n<o;n++){if(!x(h,t[n]))return null;if(!c(h,r.spatialReference,a[n],j))return null;e(k,k,a[n],F)}const R=f(a[0],a[1],k,u());if(0===s(l(R)))continue;for(let t=0;t<o;t++)m(R,k,a[t],a[t]);const V=v(a);for(let t=0;t<V.length;t+=3)C+=p(a[V[t]],a[V[t+1]],a[V[t+2]])}return t(C,k)}const y=i(),d=i();function k(){return{positionsWorldCoords:[]}}function v(t){return r(x(t),[],2)}function x(t){const o=new Float64Array(2*t.length);for(let r=0;r<t.length;++r){const n=t[r],e=2*r;o[e]=n[0],o[e+1]=n[1]}return o}export{j as computeEuclideanPlanarArea,k as createEuclideanPlanarAreaCache,h as euclideanHorizontalPlanarArea,g as euclideanPlanarArea,v as triangulate};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{createLength as n}from"../../core/quantity.js";import{verticalLengthUnitFromSpatialReference as t,lengthUnitFromSpatialReference as e}from"../../core/units.js";import{C as r,h as l}from"../../chunks/vec32.js";import{create as u}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{projectVectorToVector as i}from"../../geometry/projection/projectVectorToVector.js";import{equals as o}from"../../geometry/support/spatialReferenceUtils.js";import{computeEuclideanMeasurementSR as c}from"./measurementUtils.js";function s(n){return f(n,0)}function a(n){return f(n,1)}function f(t,r){const{hasZ:l,spatialReference:u}=t,i=c(u);let o=0;const s=e(i);if(null==s)return null;const a=0===r?Z:j;for(const n of t.paths){if(n.length<2)continue;const t=n.length-1;for(let e=0;e<t;++e){const t=n[e];b[0]=t[0],b[1]=t[1],b[2]=l?t[2]:0;const r=n[e+1];S[0]=r[0],S[1]=r[1],S[2]=l?r[2]:0;const i=a(b,S,u);if(null==i)return null;o+=i.value}}return n(o,s)}function p(n,t){const{spatialReference:e}=n;return o(e,t.spatialReference)?(b[0]=n.x,b[1]=n.y,b[2]=n.hasZ?n.z:0,S[0]=t.x,S[1]=t.y,S[2]=t.hasZ?t.z:0,x(b,S,e)):null}function h(n,t){const{spatialReference:e}=n;return o(e,t.spatialReference)?(b[0]=n.x,b[1]=n.y,b[2]=n.hasZ?n.z:0,S[0]=t.x,S[1]=t.y,S[2]=t.hasZ?t.z:0,Z(b,S,e)):null}function m(n,t){const{spatialReference:e}=n;return o(e,t.spatialReference)?(b[0]=n.x,b[1]=n.y,b[2]=n.hasZ?n.z:0,S[0]=t.x,S[1]=t.y,S[2]=t.hasZ?t.z:0,j(b,S,e)):null}function z(n,t){const{spatialReference:e}=n;return o(e,t.spatialReference)?(b[0]=n.x,b[1]=n.y,b[2]=n.hasZ?n.z:0,S[0]=t.x,S[1]=t.y,S[2]=t.hasZ?t.z:0,d(b,S,e)):null}function y(n){return null!=n?R(n.hasZ?n.z:0,n.spatialReference):null}function R(e,r){const l=t(r);return null!=l?n(e??0,l):null}function x(t,e,r){const l=g(t,e,r);return null!=l?{direct:n(l.direct,l.unit),horizontal:n(l.horizontal,l.unit),vertical:n(l.vertical,l.unit)}:null}function Z(t,e,r){const l=g(t,e,r,0);return null!=l?n(l.direct,l.unit):null}function j(t,e,r){const l=g(t,e,r,1);return null!=l?n(l.horizontal,l.unit):null}function v(t,e,r){const l=g(t,e,r,2);return null!=l?n(Math.abs(l.verticalSigned),l.unit):null}function d(t,e,r){const l=g(t,e,r,2);return null!=l?n(l.verticalSigned,l.unit):null}function g(n,t,u,o){const s=c(u),a=e(s);if(null==a)return null;const f=t[2]-n[2];if(2===o)return{verticalSigned:f,unit:a};if(!i(n,u,M,s)||!i(t,u,U,s))return null;if(0===o){return{direct:r(U,M),unit:a}}if(l(V,n[0],n[1],t[2]),!i(V,u,V,s))return null;const p=r(V,U);if(1===o)return{horizontal:p,unit:a};return{direct:r(U,M),horizontal:p,vertical:Math.abs(f),unit:a}}const b=u(),S=u(),M=u(),U=u(),V=u();export{y as elevationFromPoint,R as elevationFromZ,Z as euclideanDirectDistance,h as euclideanDirectDistanceBetweenPoints,x as euclideanDistance,p as euclideanDistanceBetweenPoints,j as euclideanHorizontalDistance,m as euclideanHorizontalDistanceBetweenPoints,a as euclideanHorizontalLength,s as euclideanLength,v as verticalDistance,d as verticalSignedDistance,z as verticalSignedDistanceBetweenPoints};
5
+ import{createLength as n}from"../../core/quantity.js";import{verticalLengthUnitFromSpatialReference as t,lengthUnitFromSpatialReference as e}from"../../core/units.js";import{D as r,h as l}from"../../chunks/vec32.js";import{create as u}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{projectVectorToVector as i}from"../../geometry/projection/projectVectorToVector.js";import{equals as o}from"../../geometry/support/spatialReferenceUtils.js";import{computeEuclideanMeasurementSR as c}from"./measurementUtils.js";function s(n){return f(n,0)}function a(n){return f(n,1)}function f(t,r){const{hasZ:l,spatialReference:u}=t,i=c(u);let o=0;const s=e(i);if(null==s)return null;const a=0===r?Z:j;for(const n of t.paths){if(n.length<2)continue;const t=n.length-1;for(let e=0;e<t;++e){const t=n[e];b[0]=t[0],b[1]=t[1],b[2]=l?t[2]:0;const r=n[e+1];S[0]=r[0],S[1]=r[1],S[2]=l?r[2]:0;const i=a(b,S,u);if(null==i)return null;o+=i.value}}return n(o,s)}function p(n,t){const{spatialReference:e}=n;return o(e,t.spatialReference)?(b[0]=n.x,b[1]=n.y,b[2]=n.hasZ?n.z:0,S[0]=t.x,S[1]=t.y,S[2]=t.hasZ?t.z:0,x(b,S,e)):null}function h(n,t){const{spatialReference:e}=n;return o(e,t.spatialReference)?(b[0]=n.x,b[1]=n.y,b[2]=n.hasZ?n.z:0,S[0]=t.x,S[1]=t.y,S[2]=t.hasZ?t.z:0,Z(b,S,e)):null}function m(n,t){const{spatialReference:e}=n;return o(e,t.spatialReference)?(b[0]=n.x,b[1]=n.y,b[2]=n.hasZ?n.z:0,S[0]=t.x,S[1]=t.y,S[2]=t.hasZ?t.z:0,j(b,S,e)):null}function z(n,t){const{spatialReference:e}=n;return o(e,t.spatialReference)?(b[0]=n.x,b[1]=n.y,b[2]=n.hasZ?n.z:0,S[0]=t.x,S[1]=t.y,S[2]=t.hasZ?t.z:0,d(b,S,e)):null}function y(n){return null!=n?R(n.hasZ?n.z:0,n.spatialReference):null}function R(e,r){const l=t(r);return null!=l?n(e??0,l):null}function x(t,e,r){const l=g(t,e,r);return null!=l?{direct:n(l.direct,l.unit),horizontal:n(l.horizontal,l.unit),vertical:n(l.vertical,l.unit)}:null}function Z(t,e,r){const l=g(t,e,r,0);return null!=l?n(l.direct,l.unit):null}function j(t,e,r){const l=g(t,e,r,1);return null!=l?n(l.horizontal,l.unit):null}function v(t,e,r){const l=g(t,e,r,2);return null!=l?n(Math.abs(l.verticalSigned),l.unit):null}function d(t,e,r){const l=g(t,e,r,2);return null!=l?n(l.verticalSigned,l.unit):null}function g(n,t,u,o){const s=c(u),a=e(s);if(null==a)return null;const f=t[2]-n[2];if(2===o)return{verticalSigned:f,unit:a};if(!i(n,u,M,s)||!i(t,u,U,s))return null;if(0===o){return{direct:r(U,M),unit:a}}if(l(V,n[0],n[1],t[2]),!i(V,u,V,s))return null;const p=r(V,U);if(1===o)return{horizontal:p,unit:a};return{direct:r(U,M),horizontal:p,vertical:Math.abs(f),unit:a}}const b=u(),S=u(),M=u(),U=u(),V=u();export{y as elevationFromPoint,R as elevationFromZ,Z as euclideanDirectDistance,h as euclideanDirectDistanceBetweenPoints,x as euclideanDistance,p as euclideanDistanceBetweenPoints,j as euclideanHorizontalDistance,m as euclideanHorizontalDistanceBetweenPoints,a as euclideanHorizontalLength,s as euclideanLength,v as verticalDistance,d as verticalSignedDistance,z as verticalSignedDistanceBetweenPoints};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{floatEqualAbsolute as t}from"../../core/mathUtils.js";import{subtract as n,length as r,scaleAndAdd as s,sub as e,dot as o,squaredLength as c,lerp as i,set as u,distance as a,squaredDistance as f}from"../../core/libs/gl-matrix-2/math/vec2.js";import{create as p,fromValues as m,ZEROS as h}from"../../core/libs/gl-matrix-2/factories/vec2f64.js";import{a as d,g as l,c as y,h as b,f as j,w as M,e as g,d as x,C as q,H as v}from"../../chunks/vec32.js";import{create as U,clone as k}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getEpsilon as w}from"../../core/libs/gl-matrix-2/math/common.js";import{fromPositionAndNormal as C,create as L,distance as A,intersectLine as H,isPointInside as P}from"../../geometry/support/plane.js";import{tangentFrame as z}from"../3d/support/mathUtils.js";import{intersectLineLikeAndCircle as B}from"./geometry2dUtils.js";function D({start:t,end:r,type:e},i,u){const a=[],f=n(rt,r,t),m=n(st,t,i),h=c(f),d=2*o(f,m),l=d*d-4*h*(c(m)-u*u);if(0===l){const n=-d/(2*h);(0===e||n>=0)&&a.push(s(p(),t,f,n))}else if(l>0){const n=Math.sqrt(l),r=(-d+n)/(2*h);(0===e||r>=0)&&a.push(s(p(),t,f,r));const o=(-d-n)/(2*h);(0===e||o>=0)&&a.push(s(p(),t,f,o))}return a}function E(t,r){const s=t.start,c=t.end,i=n(rt,c,s),u=b(ot,-i[1],i[0],0),a=r.start,f=r.end,p=d(ct,f,a),m=l(p,u),h=b(it,s[0],s[1],0),j=d(ut,h,a),M=l(j,u),g=w();if(Math.abs(m)<g)return Math.abs(M),[];const x=y(at,a,p,M/m);if(0===r.type){const t=d(ft,x,a);if(l(t,p)<-g)return[]}if(1===t.type){const t=e(st,x,s);if(o(t,i)<-g)return[]}return[k(x)]}function F(t,n){return V(Y(mt,n[2],t),n)}function G(t,n){const r=0;return T(Y(mt,r,t),Y(ht,r,n)).map(([t,n])=>m(t,n))}function I(t,n,r){return O(t,Y(mt,t[2],n),r)}function J(t,n){return Q(Y(mt,t[2],n),t)}function K(t,e,o,c=U()){const i=n(rt,t,e),u=r(i);return s(c,e,i,0===u?1:o/u),c[2]=t[2],c}function N(t,n,r){return a(t,n)-r}function O(t,{start:n,end:r,type:s},e=U()){const o=d(et,t,n),c=d(ot,r,n),i=l(o,c)/l(c,c);return y(e,n,c,0===s?Math.max(i,0):i)}function Q({start:t,end:n,type:r},s){const e=d(et,s,t),o=d(ot,n,t);if(0===r&&l(o,e)<-w())return q(t,s);const c=j(ct,o,e);return v(c)/v(o)}const R=(()=>{const t=U(),n=U(),r=U();return({start:s,end:e},{center:o,radius:c,normal:i,slicePlane:a})=>{const f=C(o,i,pt);if($(A(f,s),0)&&$(A(f,e),0)){z(i,t,n);const f=(s,e)=>(g(r,e,o),u(s,l(r,t),l(r,n)),s),p=B({start:f(rt,s),end:f(st,e),type:1},h,c),m=[];for(const[r,s]of p){const e=x(U(),o);y(e,e,t,r),y(e,e,n,s),a&&!tt(a,e)||m.push(e)}return m}const p=U();return H(f,s,e,p)?!$(q(p,o),c)||a&&!tt(a,p)?[]:[p]:[]}})();function S({start:t,end:r,type:s},e,i){const u=[],a=g(et,r,t),f=n(st,t,e),p=c(a),m=2*o(a,f),h=m*m-4*p*(c(f)-i*i);if(0===h){const n=-m/(2*p);(1===s||n>=0)&&u.push(y(U(),t,a,n))}else if(h>0){const n=Math.sqrt(h),r=(-m+n)/(2*p);(1===s||r>=0)&&u.push(y(U(),t,a,r));const e=(-m-n)/(2*p);(1===s||e>=0)&&u.push(y(U(),t,a,e))}return u}function T(t,n){const r=t.start,s=t.end,e=n.start,o=n.end,c=d(et,s,r),i=d(ot,o,e),u=d(ct,e,r),a=j(it,c,i);if(!$(l(u,a),0))return[];const f=M(a);if($(f,0))return[];const p=j(ut,u,i),m=l(p,a)/f,h=y(at,r,c,m);if(0===t.type){const t=d(ft,h,r);if(l(c,t)<-w())return[]}if(0===n.type){const t=d(ft,h,e);if(l(i,t)<-w())return[]}return[k(h)]}function V({start:t,end:n,type:r},s){const e=d(et,s,t),o=d(ot,n,t),c=j(ct,o,e),i=M(c)/M(o),u=w();if(i<u)switch(r){case 1:return[k(s)];case 0:return l(o,e)<-u?[]:[k(s)]}return[]}function W(t,n,r){return $(f(r,t),n*n)?[k(r)]:[]}function X(t,n,r,s){const[e,o]=t,[c,u]=r,a=c-e,f=u-o,p=a*a+f*f,h=Math.sqrt(p);if(h>n+s)return[];if(h<Math.abs(n-s))return[];if($(h,0)&&$(n,s))return[];const d=(n*n-s*s+p)/(2*h),l=Math.sqrt(n*n-d*d),y=l*f/h,b=l*a/h,[j,M]=i(rt,t,r,d/h);return $(y,b)?[m(j,M)]:[m(j+y,M-b),m(j-y,M+b)]}function Y(t,n,{start:r,end:s,type:e}){return b(t.start,r[0],r[1],n),b(t.end,s[0],s[1],n),t.type=nt[e],t}function Z(t,n){return $(t[2],n[2])}function $(n,r){return t(Math.abs(n-r),0,w())}function _(t,n){return n.filter(n=>tt(t,n))}function tt(t,n){return P(t,n)}const nt={0:1,1:0},rt=p(),st=p(),et=U(),ot=U(),ct=U(),it=U(),ut=U(),at=U(),ft=U(),pt=L(),mt={start:U(),end:U(),type:1},ht={start:U(),end:U(),type:1};export{V as intersectLineAndPoint,R as intersectLineLikeAndCircle,S as intersectLineLikeAndVerticalCylinder,T as intersectLineLikes,W as intersectVerticalCylinderAndPoint,X as intersectVerticalCylinders,E as intersectVerticalPlaneAndLineLike,F as intersectVerticalPlaneAndPoint,D as intersectVerticalPlaneAndVerticalCylinder,G as intersectVerticalPlanes,$ as isClose,tt as isPointInsidePlane,Q as pointToLineLikeDistance,N as pointToVerticalCylinderDistance,J as pointToVerticalPlaneDistance,_ as pointsInsidePlane,O as projectPointToLineLike,K as projectPointToVerticalCylinder,I as projectPointToVerticalPlane,Z as vectorsHaveCloseZ};
5
+ import{floatEqualAbsolute as t}from"../../core/mathUtils.js";import{subtract as n,length as r,scaleAndAdd as s,sub as e,dot as o,squaredLength as c,lerp as i,set as u,distance as a,squaredDistance as f}from"../../core/libs/gl-matrix-2/math/vec2.js";import{create as p,fromValues as m,ZEROS as h}from"../../core/libs/gl-matrix-2/factories/vec2f64.js";import{a as d,g as l,c as y,h as b,f as j,x as M,e as g,d as x,D as q,u as v}from"../../chunks/vec32.js";import{create as U,clone as k}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getEpsilon as L}from"../../core/libs/gl-matrix-2/math/common.js";import{fromPositionAndNormal as w,create as A,distance as C,intersectLine as D,isPointInside as P}from"../../geometry/support/plane.js";import{tangentFrame as z}from"../3d/support/mathUtils.js";import{intersectLineLikeAndCircle as B}from"./geometry2dUtils.js";function E({start:t,end:r,type:e},i,u){const a=[],f=n(rt,r,t),m=n(st,t,i),h=c(f),d=2*o(f,m),l=d*d-4*h*(c(m)-u*u);if(0===l){const n=-d/(2*h);(0===e||n>=0)&&a.push(s(p(),t,f,n))}else if(l>0){const n=Math.sqrt(l),r=(-d+n)/(2*h);(0===e||r>=0)&&a.push(s(p(),t,f,r));const o=(-d-n)/(2*h);(0===e||o>=0)&&a.push(s(p(),t,f,o))}return a}function F(t,r){const s=t.start,c=t.end,i=n(rt,c,s),u=b(ot,-i[1],i[0],0),a=r.start,f=r.end,p=d(ct,f,a),m=l(p,u),h=b(it,s[0],s[1],0),j=d(ut,h,a),M=l(j,u),g=L();if(Math.abs(m)<g)return Math.abs(M),[];const x=y(at,a,p,M/m);if(0===r.type){const t=d(ft,x,a);if(l(t,p)<-g)return[]}if(1===t.type){const t=e(st,x,s);if(o(t,i)<-g)return[]}return[k(x)]}function G(t,n){return V(Y(mt,n[2],t),n)}function H(t,n){const r=0;return T(Y(mt,r,t),Y(ht,r,n)).map(([t,n])=>m(t,n))}function I(t,n,r){return O(t,Y(mt,t[2],n),r)}function J(t,n){return Q(Y(mt,t[2],n),t)}function K(t,e,o,c=U()){const i=n(rt,t,e),u=r(i);return s(c,e,i,0===u?1:o/u),c[2]=t[2],c}function N(t,n,r){return a(t,n)-r}function O(t,{start:n,end:r,type:s},e=U()){const o=d(et,t,n),c=d(ot,r,n),i=l(o,c)/l(c,c);return y(e,n,c,0===s?Math.max(i,0):i)}function Q({start:t,end:n,type:r},s){const e=d(et,s,t),o=d(ot,n,t);if(0===r&&l(o,e)<-L())return q(t,s);const c=j(ct,o,e);return v(c)/v(o)}const R=(()=>{const t=U(),n=U(),r=U();return({start:s,end:e},{center:o,radius:c,normal:i,slicePlane:a})=>{const f=w(o,i,pt);if($(C(f,s),0)&&$(C(f,e),0)){z(i,t,n);const f=(s,e)=>(g(r,e,o),u(s,l(r,t),l(r,n)),s),p=B({start:f(rt,s),end:f(st,e),type:1},h,c),m=[];for(const[r,s]of p){const e=x(U(),o);y(e,e,t,r),y(e,e,n,s),a&&!tt(a,e)||m.push(e)}return m}const p=U();return D(f,s,e,p)?!$(q(p,o),c)||a&&!tt(a,p)?[]:[p]:[]}})();function S({start:t,end:r,type:s},e,i){const u=[],a=g(et,r,t),f=n(st,t,e),p=c(a),m=2*o(a,f),h=m*m-4*p*(c(f)-i*i);if(0===h){const n=-m/(2*p);(1===s||n>=0)&&u.push(y(U(),t,a,n))}else if(h>0){const n=Math.sqrt(h),r=(-m+n)/(2*p);(1===s||r>=0)&&u.push(y(U(),t,a,r));const e=(-m-n)/(2*p);(1===s||e>=0)&&u.push(y(U(),t,a,e))}return u}function T(t,n){const r=t.start,s=t.end,e=n.start,o=n.end,c=d(et,s,r),i=d(ot,o,e),u=d(ct,e,r),a=j(it,c,i);if(!$(l(u,a),0))return[];const f=M(a);if($(f,0))return[];const p=j(ut,u,i),m=l(p,a)/f,h=y(at,r,c,m);if(0===t.type){const t=d(ft,h,r);if(l(c,t)<-L())return[]}if(0===n.type){const t=d(ft,h,e);if(l(i,t)<-L())return[]}return[k(h)]}function V({start:t,end:n,type:r},s){const e=d(et,s,t),o=d(ot,n,t),c=j(ct,o,e),i=M(c)/M(o),u=L();if(i<u)switch(r){case 1:return[k(s)];case 0:return l(o,e)<-u?[]:[k(s)]}return[]}function W(t,n,r){return $(f(r,t),n*n)?[k(r)]:[]}function X(t,n,r,s){const[e,o]=t,[c,u]=r,a=c-e,f=u-o,p=a*a+f*f,h=Math.sqrt(p);if(h>n+s)return[];if(h<Math.abs(n-s))return[];if($(h,0)&&$(n,s))return[];const d=(n*n-s*s+p)/(2*h),l=Math.sqrt(n*n-d*d),y=l*f/h,b=l*a/h,[j,M]=i(rt,t,r,d/h);return $(y,b)?[m(j,M)]:[m(j+y,M-b),m(j-y,M+b)]}function Y(t,n,{start:r,end:s,type:e}){return b(t.start,r[0],r[1],n),b(t.end,s[0],s[1],n),t.type=nt[e],t}function Z(t,n){return $(t[2],n[2])}function $(n,r){return t(Math.abs(n-r),0,L())}function _(t,n){return n.filter(n=>tt(t,n))}function tt(t,n){return P(t,n)}const nt={0:1,1:0},rt=p(),st=p(),et=U(),ot=U(),ct=U(),it=U(),ut=U(),at=U(),ft=U(),pt=A(),mt={start:U(),end:U(),type:1},ht={start:U(),end:U(),type:1};export{V as intersectLineAndPoint,R as intersectLineLikeAndCircle,S as intersectLineLikeAndVerticalCylinder,T as intersectLineLikes,W as intersectVerticalCylinderAndPoint,X as intersectVerticalCylinders,F as intersectVerticalPlaneAndLineLike,G as intersectVerticalPlaneAndPoint,E as intersectVerticalPlaneAndVerticalCylinder,H as intersectVerticalPlanes,$ as isClose,tt as isPointInsidePlane,Q as pointToLineLikeDistance,N as pointToVerticalCylinderDistance,J as pointToVerticalPlaneDistance,_ as pointsInsidePlane,O as projectPointToLineLike,K as projectPointToVerticalCylinder,I as projectPointToVerticalPlane,Z as vectorsHaveCloseZ};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- function e(e){return!(null==e||"object"!=typeof e||!("createQuery"in e)||!e.createQuery)}export{e as isISelectableLayer};
5
+ function n(n){return!(null==n||"object"!=typeof n||!("id"in n)||!("type"in n))}function e(e){return!!(n(e)&&"on"in e&&e.on)}function r(e){return!!(n(e)&&"graphics"in e&&e.graphics)}function i(e){return!!(n(e)&&"fields"in e&&"fieldsIndex"in e&&"objectIdField"in e&&"createQuery"in e&&e.createQuery&&"queryFeatures"in e&&e.queryFeatures)}function t(n){return i(n)}function u(e){return!!(null!=e&&"object"==typeof e&&"layer"in e&&e.layer&&n(e.layer)&&"view"in e)}function c(n){return!(!u(n)||!("queryGraphics"in n))}function o(n){return!!(u(n)&&"highlight"in n&&n.highlight)}function a(n){return!!(u(n)&&"createQuery"in n&&n.createQuery&&"queryFeatures"in n&&n.queryFeatures)}function f(n){return a(n)}function y(n){return!!n.isTable}export{t as isISelectableLayer,n as isISelectableLayerBase,e as isISelectableLayerBaseWithEditing,f as isISelectableLayerView,u as isISelectableLayerViewBase,c as isISelectableLayerViewWithGraphics,o as isISelectableLayerViewWithHighlights,a as isISelectableLayerViewWithObjectIds,r as isISelectableLayerWithGraphics,i as isISelectableLayerWithObjectIds,y as isTableLayer};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{createTask as t}from"../../core/asyncUtils.js";import s from"../../core/Collection.js";import r from"../../core/Error.js";import{EventedAccessor as i}from"../../core/Evented.js";import a from"../../core/Logger.js";import{abortMaybe as o}from"../../core/maybe.js";import{throwIfAborted as n}from"../../core/promiseUtils.js";import p from"../../core/ReactiveMap.js";import{on as l,watch as u,sync as h,whenOnce as m}from"../../core/reactiveUtils.js";import{property as d,subclass as c}from"../../core/accessorSupport/decorators.js";import{UpdatingHandles as f}from"../../core/support/UpdatingHandles.js";import y from"../../geometry/SpatialReference.js";import{system as v}from"../../time/constants.js";import{createReactiveGraphic as g}from"./batchAttributeFormUtils.js";import{ArcadeExecutorProvider as F}from"./expressions/ArcadeExecutorProvider.js";import{ExpressionsManager as _}from"./expressions/ExpressionsManager.js";import{ExpressionsModel as x}from"./expressions/ExpressionsModel.js";import w from"./inputs/BatchFormInputs.js";import{createBatchFormInputsFromBatchFormTemplate as I}from"./inputs/support/createBatchFormInputs.js";import{isGroupInput as b,isFieldInput as M}from"./inputs/support/inputUtils.js";import A from"./templates/BatchFormTemplate.js";import{getLayerContingentValuesMetaData as E}from"./templates/support/contingentValuesUtils.js";import{createBatchFormTemplate as k}from"./templates/support/createBatchFormTemplate.js";function T(e,t){return e?.find(e=>e.layer===t)}let C=class extends i{constructor(e){super(e),this.activeFeatureIndex=-1,this.disabled=!1,this.editType="NA",this.features=new s,this._hasAsyncArcadeExpressions=!1,this.maximumFeatureCount=2e3,this.maximumFeatureCountWithComplexForms=50,this.map=null,this.readOnly=!1,this.spatialReference=null,this.submitHasBeenAttempted=!1,this.timeZone=null,this.userHasChangedValues=!1,this.layerInfos=null,this._arcadeExecutorProvider=new F,this._activeFormInputsByElementId=new Map,this._emptyForm=new w({inputs:[]}),this._emptyFormTemplate=new A({elements:[]}),this._featureFormMap=new Map,this._prepareTask=null,this._reactiveGraphicLookup=new p,this._updatingHandles=new f,this._layerTemplateMap=new p,this._layerContingentValuesMap=new p,this._workingFeatures=new s,this._expressionsManager=new _({arcadeContext:{editType:"NA",spatialReference:null,map:null,timeZone:v}}),this.sharedForm=this._emptyForm,this.sharedFormTemplate=this._emptyFormTemplate}initialize(){this.addHandles([l(()=>this.features,"after-changes",()=>this._prepare(),{sync:!0}),u(()=>[this.features,this.map,this.timeZone,this.editType],()=>this._prepare(),h),u(()=>this.activeForm,()=>this._activeFormInputsByElementId.clear(),h)]),this._prepare()}destroy(){this._prepareTask=o(this._prepareTask),this._workingFeatures.destroyAll(),this._expressionsManager&&this._expressionsManager.abort(),this._reactiveGraphicLookup=new p,this._emptyForm.destroy(),this._emptyFormTemplate.destroy()}get _effectiveTimeZone(){return this.timeZone??"system"}get activeFeature(){const e=this.activeFeatureIndex;return e<0?null:this.features.at(e)}get activeForm(){if("batch"===this.mode)return this.sharedForm;const e=this._workingFeatures.at(this.activeFeatureIndex);if(!e)return this._emptyForm;const t=this._featureFormMap.get(e);if(t)return t;const s=this._makeBatchFormInputsForFeature(e);return s!==this._emptyForm&&this._featureFormMap.set(e,s),s}get calculating(){return this._expressionsManager.calculating}get expressionEvaluationFailed(){return this._expressionsManager.expressionEvaluationFailed}get hasNonActiveInvalidFeatures(){if("batch"===this.mode)return!1;const{activeFeature:e}=this;return this.invalidFeatures.some(t=>t!==e)}get hasAsyncArcadeExpressions(){return this._hasAsyncArcadeExpressions}get hasTooManyFeatures(){return this._workingFeatures.length>this.maximumFeatureCount}get hasTooManyComplexFeatures(){return this._workingFeatures.length>this.maximumFeatureCountWithComplexForms&&this.hasAsyncArcadeExpressions}get invalidFeatures(){return this.sharedForm.invalidFeatures}get hasVisibleInputs(){return this.visibleInputs.length>0}get hasLayersWithContingentValues(){for(const e of this.layers){const t=this._layerContingentValuesMap.get(e);if(t&&t.size>0)return!0}return!1}get visibleInputs(){return this.activeForm.inputs.filter(e=>e.visible)}get noVisibleElementsReason(){if(this.hasVisibleInputs)return null;if(0===this.activeForm.inputs.length)return"noElements";const e=new Set;for(const t of this.activeForm.inputs)switch(t.visibilityCode){case"hidden:not-in-all-layers":case"hidden:no-domain-in-common":e.add("noElementsInCommon");break;case"hidden:field-definition":case"hidden:group-visibility-expression:all-features":case"hidden:visibility-expression:all-features":e.add("allElementsHidden");break;case"hidden:group-visibility-expression:some-features":case"hidden:visibility-expression:some-features":return"elementsHiddenInSome"}return e.has("allElementsHidden")?"allElementsHidden":"noElementsInCommon"}get status(){const e=this._prepareTask;return null==e?"not-loaded":e.finished?null!=e.error?"failed":"loaded":"loading"}get submittable(){return this.valid,!0}get updating(){return this._updatingHandles.updating||this.calculating}get valid(){return this.sharedForm.valid}get layers(){const e=new Set;return this.features.forEach(t=>{const s=t.sourceLayer??t.layer;e.add(s)}),Array.from(e)}get mode(){return this.activeFeatureIndex>-1?"single":"batch"}submit(){this.submitHasBeenAttempted=!0,this.emit("submit",{name:"submit",results:this._makeSubmitResults(),valid:this.valid})}findFieldInput(e){if(null==e)return;const t=this._activeFormInputsByElementId;if(t.has(e))return t.get(e);const s=this.activeForm.allFieldInputs.find(t=>t.template.elementId===e);return void 0!==s?(t.set(e,s),s):void 0}getFirstVisibleInvalidFieldInput(){if(this.hasVisibleInputs&&!this.activeForm.valid)for(const e of this.visibleInputs){if(b(e)){const t=e.inputs.find(e=>!e.valid);if(t)return{input:t,groupInput:e}}if(M(e)&&!e.valid)return{input:e}}}getFieldInputValue(e){return this.findFieldInput(e)?.value}getValues(e){const t=this._reactiveGraphicLookup.get(e);if(!t)throw new r("feature-not-found","The given feature is not present in the BatchAttributeForm");return{...t.attributes}}notifyGeometriesChanged(e){const t=[];for(const s of e){const e=this._reactiveGraphicLookup.get(s);e&&(t.push(e),e.geometry=s.geometry)}this._expressionsManager.runGeometryDependentExpressions(t)}async setFieldInputValue(e,t){const s=new Set(this.invalidFeatures);await e.setValueFromUser(t),this.userHasChangedValues=!0,this._trackValidityChange(s),this.emit("value-change",{features:e.features.toArray().map(e=>e.source),fieldName:e.fieldName,name:"value-change",value:t})}async setValue(e,t){const s=this.findFieldInput(e);if(null==s)throw new r("no-FieldInput-found",`Cannot set the value of FieldInput with ID: ${e} because none was found in the active form`);await this.setFieldInputValue(s,t)}userChangesHaveMadeFeatureInvalid(e){return!!this._reactiveGraphicLookup.get(e)?.userChangesHaveMadeInvalid}async _trackValidityChange(e){await m(()=>!1===this.calculating);const t=this.invalidFeatures;for(const s of t)!1===e.has(s)&&this._reactiveGraphicLookup.has(s)&&(this._reactiveGraphicLookup.get(s).userChangesHaveMadeInvalid=!0)}validate(){return!1}_makeBatchFormInputsForFeature(e){const t=this._layerTemplateMap.get(e.layer);return t?I(t,new s([e]),this._expressionsManager):this._emptyForm}_makeSubmitResults(){const e=new Map;for(const[t,s]of this._reactiveGraphicLookup)e.set(t,{feature:t,values:{...s.attributes},invalidFields:[]});for(const t of this.sharedForm.allFieldInputs)for(const s of t.invalidFeatures)e.get(s)?.invalidFields.push(t.fieldName);return Array.from(e.values())}_prepare(){this._hasAsyncArcadeExpressions=!1,this._prepareTask=o(this._prepareTask),this._updateWorkingFeatures(),o(this._expressionsManager),this.userHasChangedValues=!1,this._expressionsManager=new _({arcadeContext:{editType:this.editType,spatialReference:this.spatialReference??y.WebMercator,map:this.map,timeZone:this._effectiveTimeZone}});const{layers:e}=this;if(0===e.length)return;const s=t(async t=>{try{n(t);const s=new Map;for(const t of e){const e=await E(t);if(e){const s=e.fieldGroups.flatMap(e=>e.fields);this._layerContingentValuesMap.set(t,new Set(s))}else this._layerContingentValuesMap.set(t,new Set);const r=T(this.layerInfos,t),i=await k(t,{arcadeExecutorProvider:this._arcadeExecutorProvider,formTimeZone:this._effectiveTimeZone},r?.formTemplate);this._layerTemplateMap.set(t,i);const a=i.getExpressionExecutorsForLayer(t);if(this._expressionsManager.layerExpressionsModelMap.set(t,new x({preserveFieldValuesWhenHidden:i.preserveFieldValuesWhenHidden,executorMap:a})),!this._hasAsyncArcadeExpressions)for(const t of a.keys()){const e=a.get(t);if(this._hasAsyncArcadeExpressions=!0===(e.editableExpression?.isAsync||e.requiredExpression?.isAsync||e.valueExpression?.isAsync||e.visibilityExpression?.isAsync),this._hasAsyncArcadeExpressions)break}for(const t of i.elements){const{elementId:e}=t;s.has(e)?s.get(e).foldIn(t):s.set(e,t.clone())}}if(this.hasTooManyComplexFeatures)throw new r("too-many-features-with-complex-forms","There are too many features to load into the form with the configured complexity");if(this.hasTooManyFeatures)throw new r("too-many-features","There are too many features to load into the form.");const i=new A({elements:Array.from(s.values())});this.sharedFormTemplate=i,this.sharedForm=I(i,this._workingFeatures,this._expressionsManager),await this._expressionsManager.runAllExpressions(this._workingFeatures.toArray())}catch(s){throw a.getLogger(this).error("Failed preparing form",s),s}});this._updatingHandles.addPromise(s.promise),this._prepareTask=s}_updateWorkingFeatures(){this._workingFeatures.destroyAll();const{features:e}=this;if(this._reactiveGraphicLookup=new p,0!==e.length){this._workingFeatures.addMany(e.map(g));for(const e of this._workingFeatures)this._reactiveGraphicLookup.set(e.source,e)}}};e([d()],C.prototype,"_effectiveTimeZone",null),e([d({readOnly:!0})],C.prototype,"activeFeature",null),e([d()],C.prototype,"activeFeatureIndex",void 0),e([d({readOnly:!0})],C.prototype,"activeForm",null),e([d()],C.prototype,"disabled",void 0),e([d()],C.prototype,"calculating",null),e([d()],C.prototype,"editType",void 0),e([d()],C.prototype,"features",void 0),e([d()],C.prototype,"expressionEvaluationFailed",null),e([d()],C.prototype,"hasNonActiveInvalidFeatures",null),e([d()],C.prototype,"hasAsyncArcadeExpressions",null),e([d()],C.prototype,"_hasAsyncArcadeExpressions",void 0),e([d()],C.prototype,"invalidFeatures",null),e([d()],C.prototype,"hasVisibleInputs",null),e([d()],C.prototype,"hasLayersWithContingentValues",null),e([d()],C.prototype,"maximumFeatureCount",void 0),e([d()],C.prototype,"maximumFeatureCountWithComplexForms",void 0),e([d()],C.prototype,"visibleInputs",null),e([d()],C.prototype,"map",void 0),e([d()],C.prototype,"noVisibleElementsReason",null),e([d()],C.prototype,"readOnly",void 0),e([d()],C.prototype,"spatialReference",void 0),e([d()],C.prototype,"submitHasBeenAttempted",void 0),e([d()],C.prototype,"timeZone",void 0),e([d()],C.prototype,"updating",null),e([d()],C.prototype,"valid",null),e([d()],C.prototype,"layers",null),e([d()],C.prototype,"mode",null),e([d()],C.prototype,"sharedForm",void 0),e([d()],C.prototype,"sharedFormTemplate",void 0),e([d()],C.prototype,"userHasChangedValues",void 0),e([d()],C.prototype,"layerInfos",void 0),e([d()],C.prototype,"_arcadeExecutorProvider",void 0),e([d()],C.prototype,"_prepareTask",void 0),e([d()],C.prototype,"_reactiveGraphicLookup",void 0),e([d()],C.prototype,"_layerTemplateMap",void 0),e([d()],C.prototype,"_layerContingentValuesMap",void 0),e([d()],C.prototype,"_workingFeatures",void 0),e([d()],C.prototype,"_expressionsManager",void 0),C=e([c("esri.widgets.BatchAttributeForm.BatchAttributeFormViewModel")],C);const V=C;export{V as default};
5
+ import{__decorate as e}from"tslib";import{createTask as t}from"../../core/asyncUtils.js";import s from"../../core/Collection.js";import r from"../../core/Error.js";import{EventedAccessor as i}from"../../core/Evented.js";import a from"../../core/Logger.js";import{abortMaybe as o}from"../../core/maybe.js";import{throwIfAborted as n}from"../../core/promiseUtils.js";import p from"../../core/ReactiveMap.js";import{on as l,watch as u,sync as h,whenOnce as m}from"../../core/reactiveUtils.js";import{property as d,subclass as c}from"../../core/accessorSupport/decorators.js";import{UpdatingHandles as f}from"../../core/support/UpdatingHandles.js";import y from"../../geometry/SpatialReference.js";import{system as v}from"../../time/constants.js";import{createReactiveGraphic as g}from"./batchAttributeFormUtils.js";import{ArcadeExecutorProvider as F}from"./expressions/ArcadeExecutorProvider.js";import{ExpressionsManager as _}from"./expressions/ExpressionsManager.js";import{ExpressionsModel as x}from"./expressions/ExpressionsModel.js";import w from"./inputs/BatchFormInputs.js";import{createBatchFormInputsFromBatchFormTemplate as I}from"./inputs/support/createBatchFormInputs.js";import{isGroupInput as b,isFieldInput as M}from"./inputs/support/inputUtils.js";import A from"./templates/BatchFormTemplate.js";import{getLayerContingentValuesMetaData as E}from"./templates/support/contingentValuesUtils.js";import{createBatchFormTemplate as k}from"./templates/support/createBatchFormTemplate.js";import{isExcludedFromSharedForm as T,isGroupElementTemplate as C}from"./templates/support/templateUtils.js";function V(e,t){return e?.find(e=>e.layer===t)}let j=class extends i{constructor(e){super(e),this.activeFeatureIndex=-1,this.disabled=!1,this.editType="NA",this.features=new s,this._hasAsyncArcadeExpressions=!1,this.maximumFeatureCount=2e3,this.maximumFeatureCountWithComplexForms=50,this.map=null,this.readOnly=!1,this.spatialReference=null,this.submitHasBeenAttempted=!1,this.timeZone=null,this.userHasChangedValues=!1,this.layerInfos=null,this._arcadeExecutorProvider=new F,this._activeFormInputsByElementId=new Map,this._emptyForm=new w({inputs:[]}),this._emptyFormTemplate=new A({elements:[]}),this._featureFormMap=new Map,this._prepareTask=null,this._reactiveGraphicLookup=new p,this._updatingHandles=new f,this._layerTemplateMap=new p,this._layerContingentValuesMap=new p,this._workingFeatures=new s,this._expressionsManager=new _({arcadeContext:{editType:"NA",spatialReference:null,map:null,timeZone:v}}),this.sharedForm=this._emptyForm,this.sharedFormTemplate=this._emptyFormTemplate}initialize(){this.addHandles([l(()=>this.features,"after-changes",()=>this._prepare(),{sync:!0}),u(()=>[this.features,this.map,this.timeZone,this.editType],()=>this._prepare(),h),u(()=>this.activeForm,()=>this._activeFormInputsByElementId.clear(),h)]),this._prepare()}destroy(){this._prepareTask=o(this._prepareTask),this._workingFeatures.destroyAll(),this._expressionsManager&&this._expressionsManager.abort(),this._updatingHandles.destroy(),this._reactiveGraphicLookup=new p,this._emptyForm.destroy(),this._emptyFormTemplate.destroy()}get _effectiveTimeZone(){return this.timeZone??"system"}get activeFeature(){const e=this.activeFeatureIndex;return e<0?null:this.features.at(e)}get activeForm(){if("batch"===this.mode)return this.sharedForm;const e=this._workingFeatures.at(this.activeFeatureIndex);if(!e)return this._emptyForm;const t=this._featureFormMap.get(e);if(t)return t;const s=this._makeBatchFormInputsForFeature(e);return s!==this._emptyForm&&this._featureFormMap.set(e,s),s}get calculating(){return this._expressionsManager.calculating}get expressionEvaluationFailed(){return this._expressionsManager.expressionEvaluationFailed}get hasNonActiveInvalidFeatures(){if("batch"===this.mode)return!1;const{activeFeature:e}=this;return this.invalidFeatures.some(t=>t!==e)}get hasAsyncArcadeExpressions(){return this._hasAsyncArcadeExpressions}get hasTooManyFeatures(){return this._workingFeatures.length>this.maximumFeatureCount}get hasTooManyComplexFeatures(){return this._workingFeatures.length>this.maximumFeatureCountWithComplexForms&&this.hasAsyncArcadeExpressions}get invalidFeatures(){return this.sharedForm.invalidFeatures}get hasVisibleInputs(){return this.visibleInputs.length>0}get hasLayersWithContingentValues(){for(const e of this.layers){const t=this._layerContingentValuesMap.get(e);if(t&&t.size>0)return!0}return!1}get visibleInputs(){return this.activeForm.inputs.filter(e=>e.visible)}get noVisibleElementsReason(){if(this.hasVisibleInputs)return null;if(0===this.activeForm.inputs.length)return"noElements";const e=new Set;for(const t of this.activeForm.inputs)switch(t.visibilityCode){case"hidden:not-in-all-layers":case"hidden:no-domain-in-common":e.add("noElementsInCommon");break;case"hidden:field-definition":case"hidden:group-visibility-expression:all-features":case"hidden:visibility-expression:all-features":e.add("allElementsHidden");break;case"hidden:group-visibility-expression:some-features":case"hidden:visibility-expression:some-features":return"elementsHiddenInSome"}return e.has("allElementsHidden")?"allElementsHidden":"noElementsInCommon"}get status(){const e=this._prepareTask;return null==e?"not-loaded":e.finished?null!=e.error?"failed":"loaded":"loading"}get submittable(){return this.valid,!0}get updating(){return this._updatingHandles.updating||this.calculating}get valid(){return this.sharedForm.valid}get layers(){const e=new Set;return this.features.forEach(t=>{const s=t.sourceLayer??t.layer;e.add(s)}),Array.from(e)}get mode(){return this.activeFeatureIndex>-1?"single":"batch"}submit(){this.submitHasBeenAttempted=!0,this.emit("submit",{name:"submit",results:this._makeSubmitResults(),valid:this.valid})}findFieldInput(e){if(null==e)return;const t=this._activeFormInputsByElementId;if(t.has(e))return t.get(e);const s=this.activeForm.allFieldInputs.find(t=>t.template.elementId===e);return void 0!==s?(t.set(e,s),s):void 0}getFirstVisibleInvalidFieldInput(){if(this.hasVisibleInputs&&!this.activeForm.valid)for(const e of this.visibleInputs){if(b(e)){const t=e.inputs.find(e=>M(e)&&!e.valid);if(t)return{input:t,groupInput:e}}if(M(e)&&!e.valid)return{input:e}}}getFieldInputValue(e){return this.findFieldInput(e)?.value}getValues(e){const t=this._reactiveGraphicLookup.get(e);if(!t)throw new r("feature-not-found","The given feature is not present in the BatchAttributeForm");return{...t.attributes}}notifyGeometriesChanged(e){const t=[];for(const s of e){const e=this._reactiveGraphicLookup.get(s);e&&(t.push(e),e.geometry=s.geometry)}this._expressionsManager.runGeometryDependentExpressions(t)}async setFieldInputValue(e,t){const s=new Set(this.invalidFeatures);await e.setValueFromUser(t),this.userHasChangedValues=!0,this._trackValidityChange(s),this.emit("value-change",{features:e.features.toArray().map(e=>e.source),fieldName:e.fieldName,name:"value-change",value:t})}async setValue(e,t){const s=this.findFieldInput(e);if(null==s)throw new r("no-FieldInput-found",`Cannot set the value of FieldInput with ID: ${e} because none was found in the active form`);await this.setFieldInputValue(s,t)}userChangesHaveMadeFeatureInvalid(e){return!!this._reactiveGraphicLookup.get(e)?.userChangesHaveMadeInvalid}async _trackValidityChange(e){await m(()=>!1===this.calculating);const t=this.invalidFeatures;for(const s of t)!1===e.has(s)&&this._reactiveGraphicLookup.has(s)&&(this._reactiveGraphicLookup.get(s).userChangesHaveMadeInvalid=!0)}validate(){return!1}_makeBatchFormInputsForFeature(e){const t=this._layerTemplateMap.get(e.layer);return t?I(t,new s([e]),this._expressionsManager):this._emptyForm}_makeSubmitResults(){const e=new Map;for(const[t,s]of this._reactiveGraphicLookup)e.set(t,{feature:t,values:{...s.attributes},invalidFields:[]});for(const t of this.sharedForm.allFieldInputs)for(const s of t.invalidFeatures)e.get(s)?.invalidFields.push(t.fieldName);return Array.from(e.values())}_prepare(){this._hasAsyncArcadeExpressions=!1,this._prepareTask=o(this._prepareTask),this._updateWorkingFeatures(),o(this._expressionsManager),this.userHasChangedValues=!1,this._expressionsManager=new _({arcadeContext:{editType:this.editType,spatialReference:this.spatialReference??y.WebMercator,map:this.map,timeZone:this._effectiveTimeZone}});const{layers:e}=this;if(0===e.length)return;const s=t(async t=>{try{n(t);const s=new Map;for(const t of e){const e=await E(t);if(e){const s=e.fieldGroups.flatMap(e=>e.fields);this._layerContingentValuesMap.set(t,new Set(s))}else this._layerContingentValuesMap.set(t,new Set);const r=V(this.layerInfos,t),i=await k(t,{arcadeExecutorProvider:this._arcadeExecutorProvider,formTimeZone:this._effectiveTimeZone},r?.formTemplate);this._layerTemplateMap.set(t,i);const a=i.getExpressionExecutorsForLayer(t);if(this._expressionsManager.layerExpressionsModelMap.set(t,new x({preserveFieldValuesWhenHidden:i.preserveFieldValuesWhenHidden,executorMap:a})),!this._hasAsyncArcadeExpressions)for(const t of a.keys()){const e=a.get(t);if(this._hasAsyncArcadeExpressions=!0===(e.editableExpression?.isAsync||e.requiredExpression?.isAsync||e.valueExpression?.isAsync||e.visibilityExpression?.isAsync),this._hasAsyncArcadeExpressions)break}for(const t of i.elements){if(T(t))continue;const e=t.clone();C(e)&&(e.elements=e.elements.filter(e=>!T(e)));const{elementId:r}=e;s.has(r)?s.get(r).foldIn(e):s.set(r,e)}}if(this.hasTooManyComplexFeatures)throw new r("too-many-features-with-complex-forms","There are too many features to load into the form with the configured complexity");if(this.hasTooManyFeatures)throw new r("too-many-features","There are too many features to load into the form.");const i=new A({elements:Array.from(s.values())});this.sharedFormTemplate=i,this.sharedForm=I(i,this._workingFeatures,this._expressionsManager),await this._expressionsManager.runAllExpressions(this._workingFeatures.toArray())}catch(s){throw a.getLogger(this).error("Failed preparing form",s),s}});this._updatingHandles.addPromise(s.promise),this._prepareTask=s}_updateWorkingFeatures(){this._workingFeatures.destroyAll();const{features:e}=this;if(this._reactiveGraphicLookup=new p,0!==e.length){this._workingFeatures.addMany(e.map(g));for(const e of this._workingFeatures)this._reactiveGraphicLookup.set(e.source,e)}}};e([d()],j.prototype,"_effectiveTimeZone",null),e([d({readOnly:!0})],j.prototype,"activeFeature",null),e([d()],j.prototype,"activeFeatureIndex",void 0),e([d({readOnly:!0})],j.prototype,"activeForm",null),e([d()],j.prototype,"disabled",void 0),e([d()],j.prototype,"calculating",null),e([d()],j.prototype,"editType",void 0),e([d()],j.prototype,"features",void 0),e([d()],j.prototype,"expressionEvaluationFailed",null),e([d()],j.prototype,"hasNonActiveInvalidFeatures",null),e([d()],j.prototype,"hasAsyncArcadeExpressions",null),e([d()],j.prototype,"_hasAsyncArcadeExpressions",void 0),e([d()],j.prototype,"invalidFeatures",null),e([d()],j.prototype,"hasVisibleInputs",null),e([d()],j.prototype,"hasLayersWithContingentValues",null),e([d()],j.prototype,"maximumFeatureCount",void 0),e([d()],j.prototype,"maximumFeatureCountWithComplexForms",void 0),e([d()],j.prototype,"visibleInputs",null),e([d()],j.prototype,"map",void 0),e([d()],j.prototype,"noVisibleElementsReason",null),e([d()],j.prototype,"readOnly",void 0),e([d()],j.prototype,"spatialReference",void 0),e([d()],j.prototype,"submitHasBeenAttempted",void 0),e([d()],j.prototype,"timeZone",void 0),e([d()],j.prototype,"updating",null),e([d()],j.prototype,"valid",null),e([d()],j.prototype,"layers",null),e([d()],j.prototype,"mode",null),e([d()],j.prototype,"sharedForm",void 0),e([d()],j.prototype,"sharedFormTemplate",void 0),e([d()],j.prototype,"userHasChangedValues",void 0),e([d()],j.prototype,"layerInfos",void 0),e([d()],j.prototype,"_arcadeExecutorProvider",void 0),e([d()],j.prototype,"_prepareTask",void 0),e([d()],j.prototype,"_reactiveGraphicLookup",void 0),e([d()],j.prototype,"_layerTemplateMap",void 0),e([d()],j.prototype,"_layerContingentValuesMap",void 0),e([d()],j.prototype,"_workingFeatures",void 0),e([d()],j.prototype,"_expressionsManager",void 0),j=e([c("esri.widgets.BatchAttributeForm.BatchAttributeFormViewModel")],j);const H=j;export{H 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/5.0/esri/copyright.txt for details.
4
4
  */
5
- const e="esri-batch-attribute-form",t=`${e}__group`,i=`${e}__input`,o={base:e,form:`${e}__form`,formHeader:`${e}__form-header`,noticeError:`${e}__notice-error`,label:`${e}__label`,labelTextContent:`${e}__label-text-content`,fieldInput:`${i}`,inputRadio:`${i}--radio`,placeholderRadio:`${i}--radio-placeholder`,inputRadioGroup:`${i}--radio-group`,inputRadioLabel:`${i}--radio-label`,inputDisabled:`${i}--disabled`,inputSwitch:`${i}--switch`,centeredButton:`${e}__centered-button`,description:`${e}__description-text`,dateInputContainer:`${`${e}__date`}-input-container`,block:`${e}__block`,group:t,groupSequential:`${t}--sequential`,individualElement:`${t}__individual-element`};export{o as css};
5
+ const e="esri-batch-attribute-form",t=`${e}__group`,i=`${e}__input`,n={base:e,form:`${e}__form`,formHeader:`${e}__form-header`,noticeError:`${e}__notice-error`,label:`${e}__label`,labelTextContent:`${e}__label-text-content`,fieldInput:`${i}`,textElementInput:`${e}__text-element-input`,inputRadio:`${i}--radio`,placeholderRadio:`${i}--radio-placeholder`,inputRadioGroup:`${i}--radio-group`,inputRadioLabel:`${i}--radio-label`,inputDisabled:`${i}--disabled`,inputSwitch:`${i}--switch`,centeredButton:`${e}__centered-button`,description:`${e}__description-text`,dateInputContainer:`${`${e}__date`}-input-container`,block:`${e}__block`,group:t,groupSequential:`${t}--sequential`,individualElement:`${t}__individual-element`};export{n as css};
@@ -0,0 +1,4 @@
1
+ import "../../../interfaces";
2
+
3
+ import SingleFeatureInput = __esri.SingleFeatureInput;
4
+ export default SingleFeatureInput;
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
+ */
5
+ import{__decorate as e}from"tslib";import r from"../../../core/Logger.js";import{property as t}from"../../../core/accessorSupport/decorators.js";import o from"./InputBase.js";class s extends o{get feature(){const e=this.features;if(1===e.length)return e.at(0);r.getLogger(this).warn("Invalid number of features")}get layer(){const e=this.layers;if(1===e.length)return e.at(0);r.getLogger(this).warn("Invalid number of layers")}}e([t()],s.prototype,"feature",null),e([t()],s.prototype,"layer",null);export{s as default};
@@ -0,0 +1,4 @@
1
+ import "../../../interfaces";
2
+
3
+ import TextElementInput = __esri.TextElementInput;
4
+ export default TextElementInput;
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
+ */
5
+ import{__decorate as t}from"tslib";import{property as e,subclass as o}from"../../../core/accessorSupport/decorators.js";import r from"./SingleFeatureInput.js";let p=class extends r{constructor(t){super(t),this.group=null,this.type="text"}get text(){return"hello i'm some placeholder text!"}};t([e()],p.prototype,"group",void 0),t([e()],p.prototype,"text",null),t([e()],p.prototype,"type",void 0),p=t([o("esri.widgets.BatchAttributeForm.inputs.TextElementInput")],p);const s=p;export{s 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/5.0/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../../core/Error.js";import t from"../BatchFormInputs.js";import r from"../FieldInput.js";import s from"../GroupInput.js";import{isFieldElementTemplate as n,isGroupElementTemplate as o}from"../../templates/support/templateUtils.js";function p(e,r,s){const n=e.elements.map(e=>m(e,r,s));return new t({inputs:n,template:e})}function m(t,p,a){const l=new Set(t.layers),i=p.filter(e=>l.has(e.layer)),u=i.length===p.length;if(n(t))return new r({existsInAllLayers:u,features:i,template:t,expressionsManager:a});if(o(t)){const e=t.elements.map(e=>m(e,p,a));return new s({existsInAllLayers:u,features:i,inputs:e,template:t,expressionsManager:a})}throw new e("batch-attribute-form:unsupported-element-template","The type of form element template provided is not supported")}export{p as createBatchFormInputsFromBatchFormTemplate};
5
+ import e from"../../../../core/Error.js";import t from"../BatchFormInputs.js";import r from"../FieldInput.js";import s from"../GroupInput.js";import n from"../TextElementInput.js";import{isFieldElementTemplate as p,isGroupElementTemplate as o,isTextElementTemplate as m}from"../../templates/support/templateUtils.js";function a(e,r,s){const n=e.elements.map(e=>l(e,r,s));return new t({inputs:n,template:e})}function l(t,a,i){const u=new Set(t.layers),f=a.filter(e=>u.has(e.layer)),c=f.length===a.length;if(p(t))return new r({existsInAllLayers:c,features:f,template:t,expressionsManager:i});if(o(t)){const e=t.elements.map(e=>l(e,a,i));return new s({existsInAllLayers:c,features:f,inputs:e,template:t,expressionsManager:i})}if(m(t))return new n({existsInAllLayers:c,features:f,template:t,expressionsManager:i});throw new e("batch-attribute-form:unsupported-element-template","The type of form element template provided is not supported")}export{a as createBatchFormInputsFromBatchFormTemplate};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- const t="esri_BatchAttributeForm_different_values";function n(t){return"visible"===t}function r(t){return"field"===t.type}function e(t){return"group"===t.type}function o(t,n){return`${t}:${n}`}const u=t=>null!=t&&(i(t,"combo-box")||i(t,"radio-buttons"));function i(t,n){return t?.type===n}export{t as differentValuesString,r as isFieldInput,u as isFieldInputWithShowNoValueOptionInput,e as isGroupInput,i as isInputWithInputType,o as makeUseId,n as visibilityCodeToBoolean};
5
+ const t="esri_BatchAttributeForm_different_values";function n(t){return"visible"===t}function e(t){return"field"===t.type}function r(t){return"group"===t.type}function u(t){return"text"===t.type}function o(t,n){return`${t}:${n}`}const i=t=>null!=t&&(c(t,"combo-box")||c(t,"radio-buttons"));function c(t,n){return t?.type===n}export{t as differentValuesString,e as isFieldInput,i as isFieldInputWithShowNoValueOptionInput,r as isGroupInput,c as isInputWithInputType,u as isTextElementInput,o as makeUseId,n as visibilityCodeToBoolean};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../../../core/Error.js";import{property as o,subclass as r}from"../../../core/accessorSupport/decorators.js";import{ElementTemplateBase as s}from"./ElementTemplateBase.js";let i=class extends s{constructor(e){super(e),this.initialState="expanded",this.type="group"}initialize(){for(const e of this.elements)e.group=this}foldIn(e){const{elements:o}=this,r=e.elements;if(o.length!==r.length)throw new t("unable-to-fold-in","Unable to fold in the given GroupElementTemplate because it has a different number of child elements");for(const t of e.layers){this.addLayer(t,e.getExpressionExecutorsForLayer(t));for(let e=0;e<o.length;e++)o.at(e).foldIn(r.at(e))}}};e([o()],i.prototype,"initialState",void 0),e([o({constructOnly:!0})],i.prototype,"elements",void 0),e([o()],i.prototype,"type",void 0),i=e([r("esri.widgets.BatchAttributeForm.templates.GroupElementTemplate")],i);export{i as GroupElementTemplate};
5
+ import{__decorate as e}from"tslib";import t from"../../../core/Error.js";import{property as o,subclass as r}from"../../../core/accessorSupport/decorators.js";import{ElementTemplateBase as s}from"./ElementTemplateBase.js";import{isFieldElementTemplate as i}from"./support/templateUtils.js";let l=class extends s{constructor(e){super(e),this.initialState="expanded",this.type="group"}initialize(){for(const e of this.elements)e.group=this}foldIn(e){const{elements:o}=this,r=e.elements;if(o.length!==r.length)throw new t("unable-to-fold-in","Unable to fold in the given GroupElementTemplate because it has a different number of child elements");for(const t of e.layers){this.addLayer(t,e.getExpressionExecutorsForLayer(t));for(let e=0;e<o.length;e++){const t=o.at(e),s=r.at(e);i(t)&&i(s)&&t.foldIn(s)}}}};e([o()],l.prototype,"initialState",void 0),e([o()],l.prototype,"elements",void 0),e([o()],l.prototype,"type",void 0),l=e([r("esri.widgets.BatchAttributeForm.templates.GroupElementTemplate")],l);export{l as GroupElementTemplate};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
+ */
5
+ import{__decorate as t}from"tslib";import{property as e,subclass as o}from"../../../core/accessorSupport/decorators.js";import{ElementTemplateBase as r}from"./ElementTemplateBase.js";let p=class extends r{constructor(t){super(t),this.group=null,this.text=null,this.type="text"}};t([e({clonable:!1})],p.prototype,"group",void 0),t([e()],p.prototype,"text",void 0),t([e()],p.prototype,"type",void 0),p=t([o("esri.widgets.BatchAttributeForm.templates.TextElementTemplate")],p);export{p as TextElementTemplate};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../../core/Error.js";import r from"../../../../core/Logger.js";import{getEffectiveFieldAlias as t}from"../../../../editing/fieldUtils.js";import n from"../../../../form/ExpressionInfo.js";import{isFieldElement as o,isGroupElement as i}from"../../../../form/support/formUtils.js";import{getLowerCaseEditTrackingFields as s,isFieldVisibleByDefault as a}from"../../../../layers/support/fieldUtils.js";import{isSubtypeSublayer as l,isSubtypeGroupLayer as m}from"../../../../layers/support/layerUtils.js";import{unknown as d}from"../../../../time/constants.js";import{makeExpressionInfosMap as p,makeExecutorSetForFormElement as f}from"../../expressions/expressionUtils.js";import c from"../BatchFormTemplate.js";import{FieldElementTemplate as u}from"../FieldElementTemplate.js";import{GroupElementTemplate as y}from"../GroupElementTemplate.js";const w="expression/dea57012-47ca4b55a000-8df62742ed0c",x=()=>r.getLogger("esri.widgets.BatchAttributeForm.templates.templateUtils");async function b(e,r,t=e.formTemplate){return t?.elements&&t.elements.length>0?h(t,e,r):E(e,r)}async function E(e,{arcadeExecutorProvider:r,formTimeZone:t}){const n=new Set(s(e)),o={arcadeExecutorProvider:r,formTimeZone:t,layer:e},i=[];for(const s of e.fields)j(s,e,n)&&i.push(Z(s,o));const a=await Promise.all(i);return new c({elements:a,preserveFieldValuesWhenHidden:!0})}function T(e,r){for(const t of e??[])if("group"!==t.type){if("field"===t.type){if(!1===t.editable&&!t.editableExpression)return!0;if(r.subtypeField&&(l(r)||m(r))&&t.fieldName?.toLowerCase()===r.subtypeField.toLowerCase())return!0}}else if(T(t.elements??[],r))return!0;return!1}async function h(e,r,t){let o=null;T(e.elements??[],r)&&(o=new n({title:"",name:w,expression:"false"}));const i=p(o?[...e.expressionInfos??[],o]:e.expressionInfos),s={description:e.description,elements:new Array,title:e.title,preserveFieldValuesWhenHidden:e.preserveFieldValuesWhenHidden},{elements:a}=e;if(!a)return new c(s);const{arcadeExecutorProvider:l,formTimeZone:m}=t;for(const n of a){const e=await v(n,{arcadeExecutorProvider:l,expressionInfos:i,layer:r,formTimeZone:m});e&&s.elements.push(e)}return new c(s)}async function v(r,t){return o(r)?F(r,t):i(r)?g(r,t):(x().warn(new e("batch-attribute-form:unsupported-element-type",`Form elements of type ${r.type} are not supported`)),null)}async function F(r,{arcadeExecutorProvider:t,expressionInfos:n,layer:o,formTimeZone:i}){const{fieldsIndex:s}=o,{description:a,domain:d,fieldName:p,hint:c,input:y,label:b}=r;if(null==p||!s.has(p))return x().warn(new e("batch-attribute-form:invalid-form-element-field",`Field element with label '${b}' does not refer to a valid field`)),null;const E={description:a,domain:d,field:s.get(p),hint:c,input:y,formTimeZone:i,layerTimeZone:I(o),label:b};!1!==r.editable||r.editableExpression||((r=r.clone()).editableExpression=w),o.subtypeField&&(l(o)||m(o))&&r.fieldName?.toLowerCase()===o.subtypeField.toLowerCase()&&((r=r.clone()).editableExpression=w);const T=new u(E),h=await f({element:r,expressionInfos:n,provider:t});return T.addLayer(o,h),T}async function g(e,r){const{arcadeExecutorProvider:t,expressionInfos:n,layer:o}=r,{description:i,label:s,initialState:a}=e,l={description:i,elements:[],label:s,initialState:a??"expanded"};for(const p of e.elements){const e=await v(p,r);e&&l.elements.push(e)}const m=new y(l),d=await f({element:e,expressionInfos:n,provider:t});return m.addLayer(o,d),m}async function Z(e,{arcadeExecutorProvider:r,layer:n,formTimeZone:o}){const i=t(e,n)||e.name,s=new u({field:e,label:i,formTimeZone:o,layerTimeZone:I(n)}),a={},d=(m(n)||l(n))&&n.subtypeField&&n.subtypeField.toLowerCase()===e.name.toLowerCase();return!d&&e.editable&&n.userHasUpdateItemPrivileges&&(a.editableExpression=await r.getArcadeExecutor("true")),d&&(a.editableExpression=await r.getArcadeExecutor("false")),s.addLayer(n,a),s}function j(e,r,t){return!t.has(e.name.toLowerCase())&&a(e,r)}function I(e){return l(e)&&e.parent&&(e=e.parent),e&&"datesInUnknownTimezone"in e&&e.datesInUnknownTimezone?d:e&&"preferredTimeZone"in e&&e.preferredTimeZone?e.preferredTimeZone:null}export{b as createBatchFormTemplate,E as createBatchFormTemplateFromFields};
5
+ import e from"../../../../core/Error.js";import r from"../../../../core/Logger.js";import{getEffectiveFieldAlias as t}from"../../../../editing/fieldUtils.js";import n from"../../../../form/ExpressionInfo.js";import{isFieldElement as o,isGroupElement as i,isTextElement as s}from"../../../../form/support/formUtils.js";import{getLowerCaseEditTrackingFields as a,isFieldVisibleByDefault as l}from"../../../../layers/support/fieldUtils.js";import{isSubtypeSublayer as m,isSubtypeGroupLayer as d}from"../../../../layers/support/layerUtils.js";import{unknown as p}from"../../../../time/constants.js";import{makeExpressionInfosMap as f,makeExecutorSetForFormElement as c}from"../../expressions/expressionUtils.js";import u from"../BatchFormTemplate.js";import{FieldElementTemplate as x}from"../FieldElementTemplate.js";import{GroupElementTemplate as y}from"../GroupElementTemplate.js";import{TextElementTemplate as w}from"../TextElementTemplate.js";const b="expression/dea57012-47ca4b55a000-8df62742ed0c",E=()=>r.getLogger("esri.widgets.BatchAttributeForm.templates.templateUtils");async function T(e,r,t=e.formTemplate){return t?.elements&&t.elements.length>0?F(t,e,r):v(e,r)}async function v(e,{arcadeExecutorProvider:r,formTimeZone:t}){const n=new Set(a(e)),o={arcadeExecutorProvider:r,formTimeZone:t,layer:e},i=[];for(const a of e.fields)P(a,e,n)&&i.push(Z(a,o));const s=await Promise.all(i);return new u({elements:s,preserveFieldValuesWhenHidden:!0})}function h(e,r){for(const t of e??[])if("group"!==t.type){if("field"===t.type){if(!1===t.editable&&!t.editableExpression)return!0;if(r.subtypeField&&(m(r)||d(r))&&t.fieldName?.toLowerCase()===r.subtypeField.toLowerCase())return!0}}else if(h(t.elements??[],r))return!0;return!1}async function F(e,r,t){let o=null;h(e.elements??[],r)&&(o=new n({title:"",name:b,expression:"false"}));const i=f(o?[...e.expressionInfos??[],o]:e.expressionInfos),s={description:e.description,elements:new Array,title:e.title,preserveFieldValuesWhenHidden:e.preserveFieldValuesWhenHidden},{elements:a}=e;if(!a)return new u(s);const{arcadeExecutorProvider:l,formTimeZone:m}=t;for(const n of a){const e=await I(n,{arcadeExecutorProvider:l,expressionInfos:i,layer:r,formTimeZone:m});e&&s.elements.push(e)}return new u(s)}async function I(r,t){return o(r)?g(r,t):i(r)?j(r,t):s(r)?L(r,t):(E().warn(new e("batch-attribute-form:unsupported-element-type",`Form elements of type ${r.type} are not supported`)),null)}async function g(r,{arcadeExecutorProvider:t,expressionInfos:n,layer:o,formTimeZone:i}){const{fieldsIndex:s}=o,{description:a,domain:l,fieldName:p,hint:f,input:u,label:y}=r;if(null==p||!s.has(p))return E().warn(new e("batch-attribute-form:invalid-form-element-field",`Field element with label '${y}' does not refer to a valid field`)),null;const w={description:a,domain:l,field:s.get(p),hint:f,input:u,formTimeZone:i,layerTimeZone:U(o),label:y};!1!==r.editable||r.editableExpression||((r=r.clone()).editableExpression=b),o.subtypeField&&(m(o)||d(o))&&r.fieldName?.toLowerCase()===o.subtypeField.toLowerCase()&&((r=r.clone()).editableExpression=b);const T=new x(w),v=await c({element:r,expressionInfos:n,provider:t});return T.addLayer(o,v),T}async function j(e,r){const{arcadeExecutorProvider:t,expressionInfos:n,layer:o}=r,{description:i,label:s,initialState:a}=e,l={description:i,elements:[],label:s,initialState:a??"expanded"};for(const p of e.elements){const e=await I(p,r);e&&l.elements.push(e)}const m=new y(l),d=await c({element:e,expressionInfos:n,provider:t});return m.addLayer(o,d),m}async function L(e,{arcadeExecutorProvider:r,expressionInfos:t,layer:n}){const{description:o,label:i,text:s}=e,a=new w({description:o,label:i,text:s}),l=await c({element:e,expressionInfos:t,provider:r});return a.addLayer(n,l),a}async function Z(e,{arcadeExecutorProvider:r,layer:n,formTimeZone:o}){const i=t(e,n)||e.name,s=new x({field:e,label:i,formTimeZone:o,layerTimeZone:U(n)}),a={},l=(d(n)||m(n))&&n.subtypeField&&n.subtypeField.toLowerCase()===e.name.toLowerCase();return!l&&e.editable&&n.userHasUpdateItemPrivileges&&(a.editableExpression=await r.getArcadeExecutor("true")),l&&(a.editableExpression=await r.getArcadeExecutor("false")),s.addLayer(n,a),s}function P(e,r,t){return!t.has(e.name.toLowerCase())&&l(e,r)}function U(e){return m(e)&&e.parent&&(e=e.parent),e&&"datesInUnknownTimezone"in e&&e.datesInUnknownTimezone?p:e&&"preferredTimeZone"in e&&e.preferredTimeZone?e.preferredTimeZone:null}export{T as createBatchFormTemplate,v as createBatchFormTemplateFromFields};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import"../../../../core/has.js";import{numericHash as t}from"../../../../core/string.js";import{isBarcodeScannerInput as n,isComboBoxInput as e,isRadioButtonsInput as i,isDatePickerInput as r,isDateTimePickerInput as o,isDateTimeOffsetPickerInput as $,isSwitchInput as u,isTextAreaInput as f,isTextBoxInput as s,isTimePickerInput as l}from"../../../../form/elements/inputs/inputUtils.js";import{isFieldElementTemplate as c,isGroupElementTemplate as m}from"./templateUtils.js";const a="",p="num:";function g(n){return c(n)?t(d(n)).toString():m(n)?t(y(n)).toString():t(JSON.stringify(n)).toString()}function d(t){return`${S(t)}.${h(t.field)}.${O(t.domain)}.${t.hint??a}.${V(t.input)}.${t.layerTimeZone??""}`}function y(t){const n=S(t)+`.${t.initialState}`;let e=a;for(const i of t.elements)e+="."+g(i).toString();return`${n}${e}`}function S(t){return`${t.label??a}.${t.description??a}`}function V(t){if(!t)return a;const{type:c}=t;if(n(t))return c??a;if(e(t)||i(t)){const{showNoValueOption:n}=t;return`${c}.${n}.${t.noValueOptionLabel??a}`}if(r(t))return`${c}.${b(t)}`;if(o(t)){const n=t.min?.getTime(),e=t.max?.getTime(),{includeTime:i}=t;return`${c}.${n}.${e}.${i}`}if($(t)){const n=b(t),{includeTimeOffset:e,timeResolution:i}=t;return`${c}.${n}.${e}.${i}`}if(u(t)){const{offValue:n,onValue:e}=t;return`${c}.${x(n)}.${x(e)}`}if(f(t)||s(t)){return`${c}.${t.minLength?.toString()??a}.${t.maxLength?.toString()??a}`}if(l(t)){const n=b(t),{timeResolution:e}=t;return`${c}.${n}.${e}`}return JSON.stringify(t)}function b(t){return`${t.min??a}.${t.max??a}`}function h(t){const n=t.name,e=t.alias??a;return`${n}.${e===n?a:e}.${t.nullable}.${t.type}.${t.length??a}.${t.defaultValue??a}.${t.description??a}.${t.editable}.${t.visible}`}function O(t){return t?"coded-value"===t.type?j(t):"range"===t.type?T(t):JSON.stringify(t):a}function j(t){const{type:n}=t;return`${n}.${t.codedValues.map(({code:t,name:n})=>`${x(t)}.${n}`).sort().join(".")}`}function x(t){return"number"==typeof t?`${p}${t}`:t}function T(t){const{maxValue:n,minValue:e,type:i}=t;return`${i}.${e}.${n}`}export{g as hashElementTemplate};
5
+ import"../../../../core/has.js";import{numericHash as t}from"../../../../core/string.js";import{isBarcodeScannerInput as n,isComboBoxInput as e,isRadioButtonsInput as i,isDatePickerInput as r,isDateTimePickerInput as o,isDateTimeOffsetPickerInput as $,isSwitchInput as u,isTextAreaInput as f,isTextBoxInput as s,isTimePickerInput as l}from"../../../../form/elements/inputs/inputUtils.js";import{isFieldElementTemplate as c,isGroupElementTemplate as m,isExcludedFromSharedForm as a}from"./templateUtils.js";const p="",g="num:";function d(n){return c(n)?t(y(n)).toString():m(n)?t(S(n)).toString():t(JSON.stringify(n)).toString()}function y(t){return`${V(t)}.${O(t.field)}.${j(t.domain)}.${t.hint??p}.${b(t.input)}.${t.layerTimeZone??""}`}function S(t){const n=V(t)+`.${t.initialState}`;let e=p;for(const i of t.elements)a(i)||(e+="."+d(i).toString());return`${n}${e}`}function V(t){return`${t.label??p}.${t.description??p}`}function b(t){if(!t)return p;const{type:c}=t;if(n(t))return c??p;if(e(t)||i(t)){const{showNoValueOption:n}=t;return`${c}.${n}.${t.noValueOptionLabel??p}`}if(r(t))return`${c}.${h(t)}`;if(o(t)){const n=t.min?.getTime(),e=t.max?.getTime(),{includeTime:i}=t;return`${c}.${n}.${e}.${i}`}if($(t)){const n=h(t),{includeTimeOffset:e,timeResolution:i}=t;return`${c}.${n}.${e}.${i}`}if(u(t)){const{offValue:n,onValue:e}=t;return`${c}.${T(n)}.${T(e)}`}if(f(t)||s(t)){return`${c}.${t.minLength?.toString()??p}.${t.maxLength?.toString()??p}`}if(l(t)){const n=h(t),{timeResolution:e}=t;return`${c}.${n}.${e}`}return JSON.stringify(t)}function h(t){return`${t.min??p}.${t.max??p}`}function O(t){const n=t.name,e=t.alias??p;return`${n}.${e===n?p:e}.${t.nullable}.${t.type}.${t.length??p}.${t.defaultValue??p}.${t.description??p}.${t.editable}.${t.visible}`}function j(t){return t?"coded-value"===t.type?x(t):"range"===t.type?N(t):JSON.stringify(t):p}function x(t){const{type:n}=t;return`${n}.${t.codedValues.map(({code:t,name:n})=>`${T(t)}.${n}`).sort().join(".")}`}function T(t){return"number"==typeof t?`${g}${t}`:t}function N(t){const{maxValue:n,minValue:e,type:i}=t;return`${i}.${e}.${n}`}export{d as hashElementTemplate};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- function t(t){return"field"===t.type}function e(t){return"group"===t.type}export{t as isFieldElementTemplate,e as isGroupElementTemplate};
5
+ function t(t){return"field"===t.type}function n(t){return"group"===t.type}function e(t){return"text"===t.type}function r(t){return e(t)}export{r as isExcludedFromSharedForm,t as isFieldElementTemplate,n as isGroupElementTemplate,e as isTextElementTemplate};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{substitute as t}from"../intl.js";import"../core/has.js";import{getOrCreateMapValue as i}from"../core/MapUtils.js";import{watch as o,on as n}from"../core/reactiveUtils.js";import{property as a,subclass as s}from"../core/accessorSupport/decorators.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 m}from"./BatchAttributeForm/batchAttributeFormUtils.js";import c from"./BatchAttributeForm/BatchAttributeFormViewModel.js";import{css as h}from"./BatchAttributeForm/css.js";import{VisibleElements as v}from"./BatchAttributeForm/VisibleElements.js";import{isGroupInput as b,isFieldInput as f,differentValuesString as C}from"./BatchAttributeForm/inputs/support/inputUtils.js";import{loadCalciteComponents as g}from"./support/componentsUtils.js";import{getLabelForDateFieldValue as _,getIntlOptionsForField as y,prepareISOFieldValueForDateComponents as F,prepareUnixFieldValueForDateComponents as w,normalizeTimeOnlyString as I,getISOFieldValueFromDateComponents as x,getUnixFieldValueFromDateComponents as M}from"./support/dateUtils.js";import{globalCss as k}from"./support/globalCss.js";import{messageBundle as O,vmEvent as T,tsx as V}from"./support/widget.js";import{setFocus as D}from"./support/widgetUtils.js";import{isEmptyValue as U}from"./support/forms/formUtils.js";const S="data-element-id";let E=class extends d{constructor(e,t){super(e,t),this.headingLevel=2,this.messagesCommon=null,this.messages=null,this.featureFormMessages=null,this.viewModel=new c,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._afterRadioGroupCreateOrUpdate=this._afterRadioGroupCreateOrUpdate.bind(this)}initialize(){this.addHandles([o(()=>this.features,()=>{this._dateComponentMap.clear()}),o(()=>this.viewModel.activeForm,()=>{this._batchSwitchInputInitialValues.clear()}),n(()=>this.viewModel,"submit",()=>{this.valid||this.goToClosestError()})])}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 maximumFeatureCount(){return this.viewModel.maximumFeatureCount}set maximumFeatureCount(e){this.viewModel.maximumFeatureCount=e}get maximumFeatureCountWithComplexForms(){return this.viewModel.maximumFeatureCountWithComplexForms}set maximumFeatureCountWithComplexForms(e){this.viewModel.maximumFeatureCountWithComplexForms=e}get spatialReference(){return this.viewModel.spatialReference}set spatialReference(e){this.viewModel.spatialReference=e}get layerInfos(){return this.viewModel.layerInfos}set layerInfos(e){this.viewModel.layerInfos=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)}get readOnly(){return this.viewModel.readOnly}set readOnly(e){this.viewModel.readOnly=e}get valid(){return this.viewModel.valid}goToClosestError(){const e=this.viewModel.getFirstVisibleInvalidFieldInput();if(!e)return;const{groupInput:t}=e;t&&(t.open||(t.open=!0)),this._focusedFieldInput=e.input,this._attemptFocusOnNextRender=!0,this.scheduleRender()}render(){const{status:e}=this.viewModel;return"failed"===e?this.viewModel.hasTooManyComplexFeatures?this._renderErrorNotice(t(this.messages.formFailedToLoadTooManyComplexFeatures,{num:this.viewModel.maximumFeatureCountWithComplexForms})):this.viewModel.hasTooManyFeatures?this._renderErrorNotice(t(this.messages.formFailedToLoadTooManyFeatures,{num:this.viewModel.maximumFeatureCount})):this._renderErrorNotice(this.messages.formFailedToLoad):this.viewModel.expressionEvaluationFailed?this._renderErrorNotice(this.messages.expressionEvaluationFailed):this.viewModel.hasLayersWithContingentValues?this._renderErrorNotice(this.messages.unsupportedContingentValues):V("div",{class:this.classes(h.base,k.widget,k.panel)},"loaded"===e?this._renderForm():"loading"===e&&this.visibleElements.loadingIndicator?V("calcite-loader",{key:"loader",label:this.messagesCommon?.loading}):null)}submit(){this.viewModel.submit()}_setDateTimeTimeZoneMap(e){const{datePart:t,elementId:o}=e.dataset,n=i(this._dateComponentMap,`${o}`,()=>({}));switch(t){case"date":n.date=e;break;case"time":n.time=e;break;case"timeZone":n.timeZone=e}}_renderErrorNotice(e){return V("div",{class:this.classes(h.base,k.widget,k.panel)},V("calcite-notice",{class:h.noticeError,icon:!0,kind:"warning",open:!0},V("div",{slot:"message"},e)))}_renderForm(){return V("form",{onsubmit:this._onFormSubmit},this._renderInvisibleFieldsError(),this._renderContent())}_renderInvisibleFieldsError(){const{viewModel:e}=this,{hasNonActiveInvalidFeatures:t,activeForm:i}=e;let o;if(!e.submitHasBeenAttempted)return null;if(i.invalidHiddenInputs.length>0)if(o=p(i,e.mode,this.messages),"batch"===this.viewModel.mode){const e=i.invalidHiddenInputs.filter(e=>"hidden:group-visibility-expression:all-features"===e.effectiveVisibilityCode||"hidden:visibility-expression:all-features"===e.visibilityCode);e.length>0?o+=` (${e.map(e=>e.label).join(", ")})`:o=null}else o+=` (${i.invalidHiddenInputs.map(e=>e.label).join(", ")})`;else if(t)return null;return o?V("calcite-notice",{class:h.noticeError,icon:!0,kind:"danger",open:!0},V("div",{slot:"message"},o)):null}_renderContent(){if(!this.viewModel.hasVisibleInputs)return[V("calcite-notice",{class:h.noticeError,icon:!0,kind:"warning",open:!0},V("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):f(e)?this._renderLabeledField(e):void 0}_renderGroupInput(e){const{inputs:t,template:i,open:o}=e,n=t.filter(e=>e.visible),a=i.label??"";return V("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:o,heading:a,headingLevel:this.headingLevel,key:`{${i.elementId}-key}`,label:a,onCalciteBlockClose:()=>{e.open=!1},onCalciteBlockOpen:()=>{e.open=!0}},n.map(e=>this._renderInput(e)))}_renderLabeledField(e){const{elementId:i}=e.template,{label:o,required:n,dataType:a}=e,s=n?t(this.messages.requiredFieldLabel,{name:o}):o;return V("calcite-label",{"aria-label":s,class:h.label,key:`field--${i}`},V("div",{class:h.labelTextContent,key:"labelTextContainer"},o,n?V("span",{"aria-hidden":"true",title:this.messagesCommon.required},"*"):void 0),"unsupported"!==a?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:o}=e,n=!o&&t&&(this.viewModel.submitHasBeenAttempted||this._touchedInputs.has(e.template.elementId))?u(e,t,this.messages):null;return n?V("calcite-input-message",{icon:!0,status:"invalid"},n):i?V("calcite-input-message",{class:h.description,icon:!1,status:"idle"},i):null}_renderCodedInputs({input:e,props:t}){const i=e.template.input?.type??null,o=e.codedValueOptions;switch(i){case"switch":return this._renderSwitchField({input:e,props:t});case"radio-buttons":return this._renderRadioButtonGroupComponent({input:e,options:o.flat(),props:t});default:return this._renderComboBoxComponent({options:o,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,[S]:t[S]},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.differentValuesPlaceholder,value:C,disabled:!0},...e.codedValueDomainOptions]})}return this._renderSwitchComponent({input:e,props:t})}_renderSwitchComponent({input:e,props:t}){return V("calcite-switch",{...t,checked:!!m(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:o,dropdown:n,group:a}=i;return V("calcite-dropdown",{...n,onblur:()=>{this._focusedFieldInput=null},onfocus:this._onComponentFocus,onCalciteDropdownSelect:({currentTarget:e})=>this._saveInput(e)},V("calcite-button",{...o},e===C?this.messages.differentValuesPlaceholder:e),V("calcite-dropdown-group",{selectionMode:a.mode},t.map(t=>V("calcite-dropdown-item",{disabled:t.disabled,label:String(t.name),selected:e===t.value},t.name))))}_renderComboBoxComponent({input:e,options:t,props:i}){const o="INSERT"===this.viewModel.editType,n=this._touchedInputs.has(e?.template?.elementId),a=o&&e.showNoValueOptionEnabled&&!n?()=>{}:i.onblur,s={...i,onblur:a};return V("calcite-combobox",{...s,selectionMode:"single",value:i.placeholder===this.messages.differentValuesPlaceholder?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[o,n]=t.map(e=>e.map(({name:e,value:t})=>V("calcite-combobox-item",{key:`#${t}`,selected:i.value===t,textLabel:e,value:`${t}`}))),a=[...o];n.length>0&&a.push(V("calcite-combobox-item-group",{key:"unsupported",label:this.featureFormMessages.subtypes.unsupportedDomainGroupTitle},n));const s=i.placeholder===this.messages.differentValuesPlaceholder,r=!s&&U(i.value);return e.showNoValueOptionEnabled&&a.unshift(V("calcite-combobox-item",{key:"empty-option",selected:r,textLabel:e.showNoValueLabel||this.messages.empty,value:""})),s&&a.unshift(V("calcite-combobox-item",{key:C,selected:!0,textLabel:this.messages.differentValuesPlaceholder,value:C})),a}_renderRadioButtonGroupComponent({input:e,options:t,props:i}){const o=t.map(({name:t,value:o})=>this._renderRadioButtons({label:t,value:o,selected:o===e.value,props:i}));if(e.showNoValueOptionEnabled){const t="",n=e.showNoValueLabel||this.messages.empty,a=U(e.value);o.unshift(this._renderRadioButtons({label:n,value:t,selected:a,props:i}))}return V("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},o,i.placeholder===this.messages.differentValuesPlaceholder?V("calcite-label",{class:h.placeholderRadio,key:i.label,layout:"inline"},V("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:o}){return V("calcite-label",{class:h.inputRadioLabel,key:o.label,layout:"inline"},V("calcite-radio-button",{...o,afterCreate:void 0,afterUpdate:void 0,checked:t,class:h.inputRadio,disabled:o.readOnly,name:o.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||this.readOnly?this._renderReadOnlyComponent(e):"text-area"===i.input?.type?V("calcite-text-area",{...t,class:this.classes(h.individualElement),resize:"vertical",value:t.value?String(t.value):"",onCalciteTextAreaInput:({currentTarget:e})=>this._saveInput(e)}):V("calcite-input",{...t,class:this.classes(h.individualElement),type:"text",value:t.value?String(t.value):"",onCalciteInputInput:({currentTarget:e})=>this._saveInput(e)})}_renderNumberComponent(e,t){const i=r(e.field);return V("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 V("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{field:i}=e;let o;switch(i.type){case"date":o=this._renderDateFieldComponents(e,t);break;case"date-only":o=this._renderDateOnlyFieldComponent(e,t);break;case"time-only":o=this._renderTimeOnlyFieldComponent(e,t);break;case"timestamp-offset":o=this._renderTimestampOffsetFieldComponents(e,t);break;default:o=this._renderReadOnlyComponent(e,_(i,t.value,{timeZone:e.effectiveTimeZone,...y(e.template.field)}))}return e.value===C?[o,V("calcite-input-message",{icon:"information",key:"diff-values-message",status:"idle"},this.messages.differentValues)]:o}_renderDateOnlyFieldComponent(e,t){const{class:i,key:o,readOnly:n}=t,{rawMax:a,rawMin:s}=e.range;return V("calcite-input-date-picker",{afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterComponentCreateOrUpdate,class:i,"data-date-part":"date","data-element-id":t[S],key:`${o}-date-input`,max:l(a)?a:void 0,min:l(s)?s:void 0,onblur:()=>{this._focusedFieldInput=null},onfocus:this._onComponentFocus,overlayPositioning:"fixed",readOnly:n,value:e.value===C?"":e.value?String(e.value):"",onCalciteInputDatePickerChange:t=>this._saveValueFromDateComponent(e,t.currentTarget)})}_renderTimeOnlyFieldComponent(e,t){const{class:i,key:o,readOnly:n}=t;return V("calcite-input-time-picker",{afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterComponentCreateOrUpdate,class:i,"data-date-part":"time","data-element-id":t[S],key:`${o}-time-input`,onblur:()=>{this._focusedFieldInput=null},onfocus:this._onComponentFocus,overlayPositioning:"fixed",readOnly:n,value:e.value===C?"":e.value?String(e.value):"",onCalciteInputTimePickerChange:t=>this._saveValueFromDateComponent(e,t.currentTarget)})}_renderTimestampOffsetFieldComponents(e,t){const{class:i,key:o,readOnly:n}=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._afterComponentCreateOrUpdate,overlayPositioning:"fixed",readOnly:n,[S]:t[S],onfocus:this._onComponentFocus};return V("div",{class:h.dateInputContainer,key:`${o}-date-time-container`},V("calcite-input-date-picker",{...u,class:i,"data-date-part":"date",key:`${o}-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)}),V("calcite-input-time-picker",{...u,class:i,"data-date-part":"time",key:`${o}-time-input`,onblur:()=>{this._focusedFieldInput=null},value:d.time??"",onCalciteInputTimePickerChange:t=>this._saveValueFromDateComponent(e,t.target)}),p?V("calcite-input-time-zone",{...u,class:i,clearable:e.value===C||null==e.value,"data-date-part":"timeZone",key:`${o}-timezone-input`,onblur:()=>{this._focusedFieldInput=null},value:d.timeZoneOffset||"",onCalciteInputTimeZoneChange:t=>this._saveValueFromDateComponent(e,t.target)}):null)}_renderDateFieldComponents(e,t){const{class:i,key:o,readOnly:n,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,m={afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterComponentCreateOrUpdate,overlayPositioning:"fixed",readOnly:n,[S]:t[S],onfocus:this._onComponentFocus};return V("div",{class:h.dateInputContainer,key:`${o}-date-time-container`},V("calcite-input-date-picker",{...m,class:i,"data-date-part":"date",key:`${o}-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?V("calcite-input-time-picker",{...m,"data-date-part":"time",key:`${o}-time-input`,onblur:()=>{this._focusedFieldInput=null},step:1,value:l.time??"",onCalciteInputTimePickerChange:t=>{this._saveValueFromDateComponent(e,t.target)}}):null)}getCommonInputProps(e){const{template:t,valid:i,value:o,minLength:n,maxLength:a,required:s,fieldName:r,editable:l,userHasChangedValue:d,range:{max:p,min:u}}=e,m=!l||this.readOnly,c=!m&&this._effectiveDisabled;let v=t.hint??void 0,b=!1;return o===C&&(v=this.messages.differentValuesPlaceholder,b=!0),{afterCreate:this._afterComponentCreateOrUpdate,afterUpdate:this._afterComponentCreateOrUpdate,"aria-invalid":i?"false":"true",class:this.classes(h.fieldInput,m?h.inputDisabled:null),status:!d&&!this.viewModel.submitHasBeenAttempted||i?"idle":"invalid",maxLength:a&&a>-1?a:void 0,minLength:n&&n>-1?n:void 0,key:t.elementId,label:r,name:r,max:null!=p?p:void 0,min:null!=u?u:void 0,disabled:c,readOnly:m,onblur:this._onComponentBlur,required:s,placeholder:v,value:b?"":o??"",[S]:t.elementId,onfocus:this._onComponentFocus}}_onFormSubmit(e){e.preventDefault()}_getFieldInputFromHTMLElement(e){return this.viewModel.findFieldInput(e.getAttribute(S))}_afterRadioGroupCreateOrUpdate(e){const t=e.selectedItem,i=e.querySelector("calcite-radio-button"),o=t||i;o&&this._afterComponentCreateOrUpdate(o)}_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,D(e))}_onComponentBlur(){this._focusedFieldInput=null}_parseValue(e,t){if(m(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:o}=t.template;if(!t)return;const n=t?.value;if(m(t.template,"switch")&&"single"!==this.viewModel.mode){const e=i(this._batchSwitchInputInitialValues,t,()=>t.value);this._batchSwitchInputInitialValues.set(t,null===e?n:e)}const a=this._parseValue(e,t);a!==n&&this.viewModel.setValue(o,a)}_afterDateComponentCreate(e){this._setDateTimeTimeZoneMap(e),this._afterComponentCreateOrUpdate(e)}_saveValueFromDateComponent(e,t){const{elementId:i}=e.template,o=e.field.type,n=this._dateComponentMap.get(`${i}`);if(!n)return;const a=e.effectiveTimeZone;let s=e.value===C?void 0:e.value,r=null;"date-only"===o?r=Array.isArray(t.value)?t.value[0]:t.value:"time-only"===o?(s=I(s),r=I(t.value)):r="timestamp-offset"===o?null!=t.value?x({dateComponent:n.date,timeComponent:n.time,oldValue:s,timeZoneComponent:n.timeZone,defaultTimeZone:a}):null:null!=t.value?M({oldValue:s,dateComponent:n.date,timeZone:a,timeComponent:n.time?.value===C?void 0:n.time}):null,s!==r&&(null!==r&&t.value?this.viewModel.setValue(`${i}`,r):this.viewModel.setValue(`${i}`,null))}};e([a()],E.prototype,"activeFeatureIndex",null),e([a()],E.prototype,"disabled",null),e([a()],E.prototype,"_effectiveDisabled",null),e([a()],E.prototype,"features",null),e([a()],E.prototype,"map",null),e([a()],E.prototype,"maximumFeatureCount",null),e([a()],E.prototype,"maximumFeatureCountWithComplexForms",null),e([a()],E.prototype,"spatialReference",null),e([a()],E.prototype,"layerInfos",null),e([a()],E.prototype,"timeZone",null),e([a()],E.prototype,"headingLevel",void 0),e([a()],E.prototype,"icon",null),e([a(),O("esri/t9n/common")],E.prototype,"messagesCommon",void 0),e([a(),O("esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm")],E.prototype,"messages",void 0),e([a(),O("esri/widgets/FeatureForm/t9n/FeatureForm")],E.prototype,"featureFormMessages",void 0),e([a()],E.prototype,"readOnly",null),e([a()],E.prototype,"valid",null),e([a({type:c}),T(["value-change","submit"])],E.prototype,"viewModel",void 0),e([a({type:v,nonNullable:!0})],E.prototype,"visibleElements",void 0),e([a()],E.prototype,"groupDisplay",void 0),E=e([s("esri.widgets.BatchAttributeForm")],E);const R=E;export{R as default};
5
+ import{__decorate as e}from"tslib";import{substitute as t}from"../intl.js";import"../core/has.js";import{getOrCreateMapValue as i}from"../core/MapUtils.js";import{watch as n,on as o}from"../core/reactiveUtils.js";import{property as a,subclass as s}from"../core/accessorSupport/decorators.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 m}from"./BatchAttributeForm/batchAttributeFormUtils.js";import c from"./BatchAttributeForm/BatchAttributeFormViewModel.js";import{css as h}from"./BatchAttributeForm/css.js";import{VisibleElements as v}from"./BatchAttributeForm/VisibleElements.js";import{isGroupInput as b,isFieldInput as f,isTextElementInput as C,differentValuesString as g}from"./BatchAttributeForm/inputs/support/inputUtils.js";import{loadCalciteComponents as _}from"./support/componentsUtils.js";import{getLabelForDateFieldValue as y,getIntlOptionsForField as F,prepareISOFieldValueForDateComponents as w,prepareUnixFieldValueForDateComponents as I,normalizeTimeOnlyString as x,getISOFieldValueFromDateComponents as M,getUnixFieldValueFromDateComponents as k}from"./support/dateUtils.js";import{globalCss as O}from"./support/globalCss.js";import{messageBundle as T,vmEvent as V,tsx as D}from"./support/widget.js";import{setFocus as U}from"./support/widgetUtils.js";import{isEmptyValue as E}from"./support/forms/formUtils.js";const S="data-element-id";let R=class extends d{constructor(e,t){super(e,t),this.headingLevel=2,this.messagesCommon=null,this.messages=null,this.featureFormMessages=null,this.viewModel=new c,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._afterRadioGroupCreateOrUpdate=this._afterRadioGroupCreateOrUpdate.bind(this)}initialize(){this.addHandles([n(()=>this.features,()=>{this._dateComponentMap.clear()}),n(()=>this.viewModel.activeForm,()=>{this._batchSwitchInputInitialValues.clear()}),o(()=>this.viewModel,"submit",()=>{this.valid||this.goToClosestError()})])}loadDependencies(){return _({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 maximumFeatureCount(){return this.viewModel.maximumFeatureCount}set maximumFeatureCount(e){this.viewModel.maximumFeatureCount=e}get maximumFeatureCountWithComplexForms(){return this.viewModel.maximumFeatureCountWithComplexForms}set maximumFeatureCountWithComplexForms(e){this.viewModel.maximumFeatureCountWithComplexForms=e}get spatialReference(){return this.viewModel.spatialReference}set spatialReference(e){this.viewModel.spatialReference=e}get layerInfos(){return this.viewModel.layerInfos}set layerInfos(e){this.viewModel.layerInfos=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)}get readOnly(){return this.viewModel.readOnly}set readOnly(e){this.viewModel.readOnly=e}get valid(){return this.viewModel.valid}goToClosestError(){const e=this.viewModel.getFirstVisibleInvalidFieldInput();if(!e)return;const{groupInput:t}=e;t&&(t.open||(t.open=!0)),this._focusedFieldInput=e.input,this._attemptFocusOnNextRender=!0,this.scheduleRender()}render(){const{status:e}=this.viewModel;return"failed"===e?this.viewModel.hasTooManyComplexFeatures?this._renderErrorNotice(t(this.messages.formFailedToLoadTooManyComplexFeatures,{num:this.viewModel.maximumFeatureCountWithComplexForms})):this.viewModel.hasTooManyFeatures?this._renderErrorNotice(t(this.messages.formFailedToLoadTooManyFeatures,{num:this.viewModel.maximumFeatureCount})):this._renderErrorNotice(this.messages.formFailedToLoad):this.viewModel.expressionEvaluationFailed?this._renderErrorNotice(this.messages.expressionEvaluationFailed):this.viewModel.hasLayersWithContingentValues?this._renderErrorNotice(this.messages.unsupportedContingentValues):D("div",{class:this.classes(h.base,O.widget,O.panel)},"loaded"===e?this._renderForm():"loading"===e&&this.visibleElements.loadingIndicator?D("calcite-loader",{key:"loader",label:this.messagesCommon?.loading}):null)}submit(){this.viewModel.submit()}_setDateTimeTimeZoneMap(e){const{datePart:t,elementId:n}=e.dataset,o=i(this._dateComponentMap,`${n}`,()=>({}));switch(t){case"date":o.date=e;break;case"time":o.time=e;break;case"timeZone":o.timeZone=e}}_renderErrorNotice(e){return D("div",{class:this.classes(h.base,O.widget,O.panel)},D("calcite-notice",{class:h.noticeError,icon:!0,kind:"warning",open:!0},D("div",{slot:"message"},e)))}_renderForm(){return D("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=>"hidden:group-visibility-expression:all-features"===e.effectiveVisibilityCode||"hidden:visibility-expression:all-features"===e.visibilityCode);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?D("calcite-notice",{class:h.noticeError,icon:!0,kind:"danger",open:!0},D("div",{slot:"message"},n)):null}_renderContent(){if(!this.viewModel.hasVisibleInputs)return[D("calcite-notice",{class:h.noticeError,icon:!0,kind:"warning",open:!0},D("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):f(e)?this._renderLabeledField(e):C(e)?this._renderTextComponent(e):void 0}_renderGroupInput(e){const{inputs:t,template:i,open:n}=e,o=t.filter(e=>e.visible),a=i.label??"";return D("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{elementId:i}=e.template,{label:n,required:o,dataType:a}=e,s=o?t(this.messages.requiredFieldLabel,{name:n}):n;return D("calcite-label",{"aria-label":s,class:h.label,key:`field--${i}`},D("div",{class:h.labelTextContent,key:"labelTextContainer"},n,o?D("span",{"aria-hidden":"true",title:this.messagesCommon.required},"*"):void 0),"unsupported"!==a?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?D("calcite-input-message",{icon:!0,status:"invalid"},o):i?D("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)===g||e.value===g)&&"batch"===this.viewModel.mode){const i={dropdown:{afterCreate:this._afterComponentCreateOrUpdate,afterUpdate:this._afterComponentCreateOrUpdate,disabled:t.readOnly,open:!1,[S]:t[S]},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.differentValuesPlaceholder,value:g,disabled:!0},...e.codedValueDomainOptions]})}return this._renderSwitchComponent({input:e,props:t})}_renderSwitchComponent({input:e,props:t}){return D("calcite-switch",{...t,checked:!!m(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 D("calcite-dropdown",{...o,onblur:()=>{this._focusedFieldInput=null},onfocus:this._onComponentFocus,onCalciteDropdownSelect:({currentTarget:e})=>this._saveInput(e)},D("calcite-button",{...n},e===g?this.messages.differentValuesPlaceholder:e),D("calcite-dropdown-group",{selectionMode:a.mode},t.map(t=>D("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 D("calcite-combobox",{...s,selectionMode:"single",value:i.placeholder===this.messages.differentValuesPlaceholder?g:String(i.value),onCalciteComboboxChange:({currentTarget:e})=>{e.value!==g&&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})=>D("calcite-combobox-item",{key:`#${t}`,selected:i.value===t,textLabel:e,value:`${t}`}))),a=[...n];o.length>0&&a.push(D("calcite-combobox-item-group",{key:"unsupported",label:this.featureFormMessages.subtypes.unsupportedDomainGroupTitle},o));const s=i.placeholder===this.messages.differentValuesPlaceholder,r=!s&&E(i.value);return e.showNoValueOptionEnabled&&a.unshift(D("calcite-combobox-item",{key:"empty-option",selected:r,textLabel:e.showNoValueLabel||this.messages.empty,value:""})),s&&a.unshift(D("calcite-combobox-item",{key:g,selected:!0,textLabel:this.messages.differentValuesPlaceholder,value:g})),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 D("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.differentValuesPlaceholder?D("calcite-label",{class:h.placeholderRadio,key:i.label,layout:"inline"},D("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 D("calcite-label",{class:h.inputRadioLabel,key:n.label,layout:"inline"},D("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||this.readOnly?this._renderReadOnlyComponent(e):"text-area"===i.input?.type?D("calcite-text-area",{...t,class:this.classes(h.individualElement),resize:"vertical",value:t.value?String(t.value):"",onCalciteTextAreaInput:({currentTarget:e})=>this._saveInput(e)}):D("calcite-input",{...t,class:this.classes(h.individualElement),type:"text",value:t.value?String(t.value):"",onCalciteInputInput:({currentTarget:e})=>this._saveInput(e)})}_renderNumberComponent(e,t){const i=r(e.field);return D("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 D("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{field:i}=e;let n;switch(i.type){case"date":n=this._renderDateFieldComponents(e,t);break;case"date-only":n=this._renderDateOnlyFieldComponent(e,t);break;case"time-only":n=this._renderTimeOnlyFieldComponent(e,t);break;case"timestamp-offset":n=this._renderTimestampOffsetFieldComponents(e,t);break;default:n=this._renderReadOnlyComponent(e,y(i,t.value,{timeZone:e.effectiveTimeZone,...F(e.template.field)}))}return e.value===g?[n,D("calcite-input-message",{icon:"information",key:"diff-values-message",status:"idle"},this.messages.differentValues)]:n}_renderDateOnlyFieldComponent(e,t){const{class:i,key:n,readOnly:o}=t,{rawMax:a,rawMin:s}=e.range;return D("calcite-input-date-picker",{afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterComponentCreateOrUpdate,class:i,"data-date-part":"date","data-element-id":t[S],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===g?"":e.value?String(e.value):"",onCalciteInputDatePickerChange:t=>this._saveValueFromDateComponent(e,t.currentTarget)})}_renderTimeOnlyFieldComponent(e,t){const{class:i,key:n,readOnly:o}=t;return D("calcite-input-time-picker",{afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterComponentCreateOrUpdate,class:i,"data-date-part":"time","data-element-id":t[S],key:`${n}-time-input`,onblur:()=>{this._focusedFieldInput=null},onfocus:this._onComponentFocus,overlayPositioning:"fixed",readOnly:o,value:e.value===g?"":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=w(a),l=w(s),d=w(e.value===g?"":e.value),p=e.includeTimeOffset,u={afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterComponentCreateOrUpdate,overlayPositioning:"fixed",readOnly:o,[S]:t[S],onfocus:this._onComponentFocus};return D("div",{class:h.dateInputContainer,key:`${n}-date-time-container`},D("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)}),D("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?D("calcite-input-time-zone",{...u,class:i,clearable:e.value===g||null==e.value,"data-date-part":"timeZone",key:`${n}-timezone-input`,onblur:()=>{this._focusedFieldInput=null},value:d.timeZoneOffset||"",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=I(e.value===g?"":e.value,r),d=I(s,r),p=I(a,r),u=e.includeTime,m={afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterComponentCreateOrUpdate,overlayPositioning:"fixed",readOnly:o,[S]:t[S],onfocus:this._onComponentFocus};return D("div",{class:h.dateInputContainer,key:`${n}-date-time-container`},D("calcite-input-date-picker",{...m,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?D("calcite-input-time-picker",{...m,"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)}_renderTextComponent(e){return D("div",{class:h.textElementInput,innerHTML:e.text,key:`text-element-${e.template.elementId}`})}getCommonInputProps(e){const{template:t,valid:i,value:n,minLength:o,maxLength:a,required:s,fieldName:r,editable:l,userHasChangedValue:d,range:{max:p,min:u}}=e,m=!l||this.readOnly,c=!m&&this._effectiveDisabled;let v=t.hint??void 0,b=!1;return n===g&&(v=this.messages.differentValuesPlaceholder,b=!0),{afterCreate:this._afterComponentCreateOrUpdate,afterUpdate:this._afterComponentCreateOrUpdate,"aria-invalid":i?"false":"true",class:this.classes(h.fieldInput,m?h.inputDisabled:null),status:!d&&!this.viewModel.submitHasBeenAttempted||i?"idle":"invalid",maxLength:a&&a>-1?a:void 0,minLength:o&&o>-1?o:void 0,key:t.elementId,label:r,name:r,max:null!=p?p:void 0,min:null!=u?u:void 0,disabled:c,readOnly:m,onblur:this._onComponentBlur,required:s,placeholder:v,value:b?"":n??"",[S]:t.elementId,onfocus:this._onComponentFocus}}_onFormSubmit(e){e.preventDefault()}_getFieldInputFromHTMLElement(e){return this.viewModel.findFieldInput(e.getAttribute(S))}_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,U(e))}_onComponentBlur(){this._focusedFieldInput=null}_parseValue(e,t){if(m(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(m(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)}_afterDateComponentCreate(e){this._setDateTimeTimeZoneMap(e),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===g?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?M({dateComponent:o.date,timeComponent:o.time,oldValue:s,timeZoneComponent:o.timeZone,defaultTimeZone:a}):null:null!=t.value?k({oldValue:s,dateComponent:o.date,timeZone:a,timeComponent:o.time?.value===g?void 0:o.time}):null,s!==r&&(null!==r&&t.value?this.viewModel.setValue(`${i}`,r):this.viewModel.setValue(`${i}`,null))}};e([a()],R.prototype,"activeFeatureIndex",null),e([a()],R.prototype,"disabled",null),e([a()],R.prototype,"_effectiveDisabled",null),e([a()],R.prototype,"features",null),e([a()],R.prototype,"map",null),e([a()],R.prototype,"maximumFeatureCount",null),e([a()],R.prototype,"maximumFeatureCountWithComplexForms",null),e([a()],R.prototype,"spatialReference",null),e([a()],R.prototype,"layerInfos",null),e([a()],R.prototype,"timeZone",null),e([a()],R.prototype,"headingLevel",void 0),e([a()],R.prototype,"icon",null),e([a(),T("esri/t9n/common")],R.prototype,"messagesCommon",void 0),e([a(),T("esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm")],R.prototype,"messages",void 0),e([a(),T("esri/widgets/FeatureForm/t9n/FeatureForm")],R.prototype,"featureFormMessages",void 0),e([a()],R.prototype,"readOnly",null),e([a()],R.prototype,"valid",null),e([a({type:c}),V(["value-change","submit"])],R.prototype,"viewModel",void 0),e([a({type:v,nonNullable:!0})],R.prototype,"visibleElements",void 0),e([a()],R.prototype,"groupDisplay",void 0),R=e([s("esri.widgets.BatchAttributeForm")],R);const L=R;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/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../../../core/Accessor.js";import{isSome as i}from"../../../core/arrayUtils.js";import{abortHandle as s}from"../../../core/handleUtils.js";import{debounce as a}from"../../../core/promiseUtils.js";import r from"../../../core/ReactiveMap.js";import{whenOnce as o,watch as n}from"../../../core/reactiveUtils.js";import{property as l,subclass as p}from"../../../core/accessorSupport/decorators.js";import{UpdatingHandles as c}from"../../../core/support/UpdatingHandles.js";import d from"../../../layers/GraphicsLayer.js";import h from"../../../views/interactive/sketch/SketchOptions.js";import{getVisualVariablesForLayer as u,updateGraphicSymbolWhenRequired as y,setVisualVariablesAndElevationInfoForUpdate as m,swapForEditingSession as v,visualVariableInteractiveUpdate as g,getSizeVariableAttribute as _,getRotationVariableAttribute as b}from"../workflowUtils.js";import w from"../../Sketch/SketchViewModel.js";const f=Symbol();let k=class extends t{constructor(e){super(e),this.features=[],this.onGeometriesUpdated=()=>{},this.onVisualVariableAttributesUpdated=()=>{},this.sketchOptions=new h,this.snappingManager=null,this.sourceLayer=null,this.view=null,this.viewModel=null,this._nextUpdateSubset=[],this._sketchGraphicsMap=new r,this._sketchLayer=null,this._updatingHandles=new c,this._visualVariableAttributes=new Map,this._visualVariablesForLayer=null,this._webStyleCache=new Map}async initialize(){this._visualVariablesForLayer=u(this.sourceLayer),this._nextUpdateSubset=this.features,this._initializeSketchGraphics(),this._initializeSketchLayer(),await this._updatingHandles.addPromise(this._initializeSketchViewModel())}destroy(){const{_sketchLayer:e,view:t}=this;t?.destroyed||t?.map.remove(e),e.destroy(),this.viewModel.destroy()}get sketchGraphics(){return Array.from(this._sketchGraphicsMap.values())}get updating(){return this._updatingHandles.updating}async enter(){await this.startUpdatingFeatures(this._nextUpdateSubset)}async exit(){this._completeCurrentOperation()}notifyAttributesChanged({features:e,fieldName:t}){const i=this._webStyleCache,s=this.view.scale,a=this._updatingHandles;for(const r of e){const e=this._sketchGraphicsMap.get(r),o=r.getAttribute(t);if(!e||e.getAttribute(t)===o)continue;e.setAttribute(t,o);const n=this._visualVariableAttributes.get(r);null==n?.size||n.size.isUpdatingInteractively||n.size.field!==t||n.size.setInitialValue(o),null==n?.rotation||n.rotation.isUpdatingInteractively||n.rotation.field!==t||n.rotation.setInitialValue(o),a.addPromise(y(e,i,s))}}async startUpdatingFeatures(e){const{onGeometriesUpdated:t,onVisualVariableAttributesUpdated:a,_sketchGraphicsMap:r,_sketchLayer:n,sourceLayer:l,view:p,viewModel:c,_webStyleCache:d}=this,h=e.map(e=>r.get(e)).filter(i),u={};this._completeCurrentOperation();let v=null;if(1===e.length){const t=e[0],i=this._visualVariableAttributes.get(t);!(!i?.rotation&&!i?.size)&&(await m({graphic:h[0],sketchLayer:n,sketchViewModel:c,sourceLayer:l,visualVariables:i,webStyleCache:d}),"point"===l.geometryType&&(u.enableRotation=null!=i.rotation,u.enableScaling=null!=i.size,v=async e=>{const s=e.graphics[0];g(p,s,e,i)&&(a?.([{feature:t,attributes:s.attributes}],e),this._updatingHandles.addPromise(y(s,d,"2d"===p.type?p.scale:null)))}))}else u.tool="move";const _=()=>c.update(h,u),b=c.on("update",a=>{if("complete"===a.state){if(null===p.activeTool)return void _();const e=new AbortController,t=s(e);return this.addHandles(t,f),void this._updatingHandles.addPromise(o(()=>null===p.activeTool,e.signal).then(async()=>{e.signal.aborted||(e.abort(),await _())}))}const n=e.map(e=>{const t=r.get(e);return t?{feature:e,geometry:t.geometry}:null}).filter(i);t(n,a),v?.(a)});await _(),this._nextUpdateSubset=this.features,this.addHandles(b,f),c.addHandles(b)}_completeCurrentOperation(){this.removeHandles(f),this.viewModel.complete()}_initializeSketchGraphics(){const{features:e,_sketchGraphicsMap:t,sourceLayer:i,_visualVariableAttributes:s}=this,a=this._visualVariablesForLayer,r=a.rotation?.field,o=a.size?.field,n={rotation:r?i.getField(r):null,size:o?i.getField(o):null},l=!(!n.rotation&&!n.size);for(const p of e)t.set(p,p.clone()),l&&s.set(p,S(a,n))}_initializeSketchLayer(){const{view:e}=this,t=new d({elevationInfo:this.sourceLayer.elevationInfo,internal:!0,listMode:"hide",title:"SketchController layer"});this._sketchLayer=t,e.map.add(t),this._updatingHandles.addPromise(e.whenLayerView(t))}async _initializeSketchViewModel(){const{_sketchGraphicsMap:e,_sketchLayer:t,sourceLayer:i,view:s,_webStyleCache:r}=this,o=Array.from(e.entries()),l=new w({allowDeleteKey:!1,defaultUpdateOptions:{multipleSelectionEnabled:!1,reshapeOptions:{enableCreateCurveFromStraightEdge:i.capabilities?.query.supportsTrueCurve}},layer:t,sketchOptions:this.sketchOptions,snappingManager:this.snappingManager,updateOnGraphicClick:!1,view:s});this.viewModel=l;const p=a(e=>Promise.all(o.map(([,t])=>y(t,r,e))));await p("2d"===s.type?s.scale:null),"2d"===s.type&&this.addHandles(n(()=>s.scale,e=>p(e))),this.addHandles(await Promise.all(o.map(([e,i])=>v(t,s,e,i))))}};function S({rotation:e,size:t},i){return{rotation:e?b(e,i.rotation):null,size:t?_(t,i.size):null}}e([l()],k.prototype,"features",void 0),e([l()],k.prototype,"onGeometriesUpdated",void 0),e([l()],k.prototype,"onVisualVariableAttributesUpdated",void 0),e([l()],k.prototype,"sketchGraphics",null),e([l()],k.prototype,"sketchOptions",void 0),e([l()],k.prototype,"snappingManager",void 0),e([l()],k.prototype,"sourceLayer",void 0),e([l()],k.prototype,"updating",null),e([l()],k.prototype,"view",void 0),e([l()],k.prototype,"viewModel",void 0),e([l()],k.prototype,"_nextUpdateSubset",void 0),e([l()],k.prototype,"_sketchGraphicsMap",void 0),e([l()],k.prototype,"_sketchLayer",void 0),e([l()],k.prototype,"_visualVariablesForLayer",void 0),k=e([p("esri.widgets.Editor.support.SketchController")],k);export{k as SketchController};
5
+ import{__decorate as e}from"tslib";import t from"../../../core/Accessor.js";import{isSome as i}from"../../../core/arrayUtils.js";import{abortHandle as s}from"../../../core/handleUtils.js";import{debounce as a}from"../../../core/promiseUtils.js";import r from"../../../core/ReactiveMap.js";import{whenOnce as o,watch as n}from"../../../core/reactiveUtils.js";import{property as l,subclass as p}from"../../../core/accessorSupport/decorators.js";import{UpdatingHandles as d}from"../../../core/support/UpdatingHandles.js";import c from"../../../layers/GraphicsLayer.js";import h from"../../../views/interactive/sketch/SketchOptions.js";import{getVisualVariablesForLayer as u,updateGraphicSymbolWhenRequired as y,setVisualVariablesAndElevationInfoForUpdate as m,swapForEditingSession as v,visualVariableInteractiveUpdate as g,getSizeVariableAttribute as _,getRotationVariableAttribute as b}from"../workflowUtils.js";import w from"../../Sketch/SketchViewModel.js";const f=Symbol();let k=class extends t{constructor(e){super(e),this.features=[],this.onGeometriesUpdated=()=>{},this.onVisualVariableAttributesUpdated=()=>{},this.sketchOptions=new h,this.snappingManager=null,this.sourceLayer=null,this.view=null,this.viewModel=null,this._nextUpdateSubset=[],this._sketchGraphicsMap=new r,this._sketchLayer=null,this._updatingHandles=new d,this._visualVariableAttributes=new Map,this._visualVariablesForLayer=null,this._webStyleCache=new Map}async initialize(){this._visualVariablesForLayer=u(this.sourceLayer),this._nextUpdateSubset=this.features,this._initializeSketchGraphics(),this._initializeSketchLayer(),await this._updatingHandles.addPromise(this._initializeSketchViewModel())}destroy(){const{_sketchLayer:e,view:t}=this;t?.destroyed||t?.map.remove(e),this._updatingHandles.destroy(),e.destroy(),this.viewModel.destroy()}get sketchGraphics(){return Array.from(this._sketchGraphicsMap.values())}get updating(){return this._updatingHandles.updating}async enter(){await this.startUpdatingFeatures(this._nextUpdateSubset)}async exit(){this._completeCurrentOperation()}notifyAttributesChanged({features:e,fieldName:t}){const i=this._webStyleCache,s=this.view.scale,a=this._updatingHandles;for(const r of e){const e=this._sketchGraphicsMap.get(r),o=r.getAttribute(t);if(!e||e.getAttribute(t)===o)continue;e.setAttribute(t,o);const n=this._visualVariableAttributes.get(r);null==n?.size||n.size.isUpdatingInteractively||n.size.field!==t||n.size.setInitialValue(o),null==n?.rotation||n.rotation.isUpdatingInteractively||n.rotation.field!==t||n.rotation.setInitialValue(o),a.addPromise(y(e,i,s))}}async startUpdatingFeatures(e){const{onGeometriesUpdated:t,onVisualVariableAttributesUpdated:a,_sketchGraphicsMap:r,_sketchLayer:n,sourceLayer:l,view:p,viewModel:d,_webStyleCache:c}=this,h=e.map(e=>r.get(e)).filter(i),u={};this._completeCurrentOperation();let v=null;if(1===e.length){const t=e[0],i=this._visualVariableAttributes.get(t);!(!i?.rotation&&!i?.size)&&(await m({graphic:h[0],sketchLayer:n,sketchViewModel:d,sourceLayer:l,visualVariables:i,webStyleCache:c}),"point"===l.geometryType&&(u.enableRotation=null!=i.rotation,u.enableScaling=null!=i.size,v=async e=>{const s=e.graphics[0];g(p,s,e,i)&&(a?.([{feature:t,attributes:s.attributes}],e),this._updatingHandles.addPromise(y(s,c,"2d"===p.type?p.scale:null)))}))}else u.tool="move";const _=()=>d.update(h,u),b=d.on("update",a=>{if("complete"===a.state){if(null===p.activeTool)return void _();const e=new AbortController,t=s(e);return this.addHandles(t,f),void this._updatingHandles.addPromise(o(()=>null===p.activeTool,e.signal).then(async()=>{e.signal.aborted||(e.abort(),await _())}))}const n=e.map(e=>{const t=r.get(e);return t?{feature:e,geometry:t.geometry}:null}).filter(i);t(n,a),v?.(a)});await _(),this._nextUpdateSubset=this.features,this.addHandles(b,f),d.addHandles(b)}_completeCurrentOperation(){this.removeHandles(f),this.viewModel.complete()}_initializeSketchGraphics(){const{features:e,_sketchGraphicsMap:t,sourceLayer:i,_visualVariableAttributes:s}=this,a=this._visualVariablesForLayer,r=a.rotation?.field,o=a.size?.field,n={rotation:r?i.getField(r):null,size:o?i.getField(o):null},l=!(!n.rotation&&!n.size);for(const p of e)t.set(p,p.clone()),l&&s.set(p,S(a,n))}_initializeSketchLayer(){const{view:e}=this,t=new c({elevationInfo:this.sourceLayer.elevationInfo,internal:!0,listMode:"hide",title:"SketchController layer"});this._sketchLayer=t,e.map.add(t),this._updatingHandles.addPromise(e.whenLayerView(t))}async _initializeSketchViewModel(){const{_sketchGraphicsMap:e,_sketchLayer:t,sourceLayer:i,view:s,_webStyleCache:r}=this,o=Array.from(e.entries()),l=new w({allowDeleteKey:!1,defaultUpdateOptions:{multipleSelectionEnabled:!1,reshapeOptions:{enableCreateCurveFromStraightEdge:i.capabilities?.query.supportsTrueCurve}},layer:t,sketchOptions:this.sketchOptions,snappingManager:this.snappingManager,updateOnGraphicClick:!1,view:s});this.viewModel=l;const p=a(e=>Promise.all(o.map(([,t])=>y(t,r,e))));await p("2d"===s.type?s.scale:null),"2d"===s.type&&this.addHandles(n(()=>s.scale,e=>p(e))),this.addHandles(await Promise.all(o.map(([e,i])=>v(t,s,e,i))))}};function S({rotation:e,size:t},i){return{rotation:e?b(e,i.rotation):null,size:t?_(t,i.size):null}}e([l()],k.prototype,"features",void 0),e([l()],k.prototype,"onGeometriesUpdated",void 0),e([l()],k.prototype,"onVisualVariableAttributesUpdated",void 0),e([l()],k.prototype,"sketchGraphics",null),e([l()],k.prototype,"sketchOptions",void 0),e([l()],k.prototype,"snappingManager",void 0),e([l()],k.prototype,"sourceLayer",void 0),e([l()],k.prototype,"updating",null),e([l()],k.prototype,"view",void 0),e([l()],k.prototype,"viewModel",void 0),e([l()],k.prototype,"_nextUpdateSubset",void 0),e([l()],k.prototype,"_sketchGraphicsMap",void 0),e([l()],k.prototype,"_sketchLayer",void 0),e([l()],k.prototype,"_visualVariablesForLayer",void 0),k=e([p("esri.widgets.Editor.support.SketchController")],k);export{k as SketchController};
@@ -1,4 +1,4 @@
1
1
  import "../../interfaces";
2
2
 
3
- import TextElementInput = __esri.TextElementInput;
4
- export default TextElementInput;
3
+ import FeatureFormTextElementInput = __esri.FeatureFormTextElementInput;
4
+ export default FeatureFormTextElementInput;
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../../core/Collection.js";import s from"../../core/ReactiveMap.js";import r from"../../core/ReactiveSet.js";import{renderingSanitizer as i}from"../../core/sanitizerUtils.js";import{generateUID as o}from"../../core/uid.js";import{property as n,subclass as p}from"../../core/accessorSupport/decorators.js";import{UpdatingHandles as l}from"../../core/support/UpdatingHandles.js";import{extractSubstitutionTemplatesFromString as a}from"../../layers/support/fieldUtils.js";import{prependExpressionPrefix as d,prependFieldPrefix as u,isExpressionReference as m,extractExpressionNameFromString as h,isLegacyFieldMapsExpressionReference as f}from"./featureFormUtils.js";import x from"./InputBase.js";import{assembleStringFromParts as c,splitStringIntoParts as _}from"./support/textElementInputUtils.js";import{compileTextElementMarkdownToHTML as g}from"./support/textManipulationUtils.js";let y=class extends x{constructor(e){super(e),this.group=null,this.id=`TextElementInput-${o()}`,this.type="text",this._expressionReferences=new s,this._expressionsUsed=new r,this._fieldsUsed=new r,this._literalParts=new t,this._templateParts=new t,this._updatingHandles=new l}initialize(){const{rawText:e}=this;e?"markdown"===this.textFormat?this._updatingHandles.addPromise(g(e).then(e=>this._initializeTextParts(e))):this._initializeTextParts(e):this._literalParts.push("")}get expressionsUsed(){return Array.from(this._expressionsUsed)}get fieldsIndex(){return this.layer.fieldsIndex}set fieldsIndex(e){this._overrideIfSome("fieldsIndex",e)}get fieldsUsed(){return Array.from(this._fieldsUsed)}get rawText(){return this.element.text}get text(){const e=this._templateParts.map(e=>`${this._expressionReferences.get(e)?.lastEvaluatedValue??""}`);return i.sanitize(c(this._literalParts,e))}get textFormat(){return this.element.textFormat}get updating(){return this._updatingHandles.updating||Array.from(this._expressionReferences.values()).some(e=>e?.updating)}setExpressionExecutor(e,t){this._expressionReferences.set(d(e),t)}setFieldExecutor(e,t){this._expressionReferences.set(u(e),t)}_initializeTextParts(e){const{fieldsIndex:t}=this,{literals:s,templates:r}=_(e),i=[],o=[];for(let n=0;n<r.length;n++){const e=s[n],p=a(r[n])[0];if(m(p))this._expressionsUsed.add(h(p)),this._expressionReferences.set(p,null),i.push(e),o.push(p);else if(f(p)){this._expressionsUsed.add(p);const t=d(p);this._expressionReferences.set(t,null),i.push(e),o.push(t)}else if(t?.has(p)){const s=t.normalizeFieldName(p);this._fieldsUsed.add(s);const r=u(s);this._expressionReferences.set(r,null),i.push(e),o.push(r)}else s[n+1]=e.concat(p,s[n+1])}i.push(s.at(-1)),this._literalParts.addMany(i),this._templateParts.addMany(o)}};e([n()],y.prototype,"expressionsUsed",null),e([n()],y.prototype,"fieldsIndex",null),e([n()],y.prototype,"fieldsUsed",null),e([n()],y.prototype,"group",void 0),e([n()],y.prototype,"id",void 0),e([n()],y.prototype,"rawText",null),e([n()],y.prototype,"text",null),e([n()],y.prototype,"textFormat",null),e([n()],y.prototype,"type",void 0),e([n()],y.prototype,"updating",null),y=e([p("esri.widgets.FeatureForm.TextElementInput")],y);const U=y;export{U as default};
5
+ import{__decorate as e}from"tslib";import t from"../../core/Collection.js";import s from"../../core/ReactiveMap.js";import r from"../../core/ReactiveSet.js";import{renderingSanitizer as i}from"../../core/sanitizerUtils.js";import{generateUID as o}from"../../core/uid.js";import{property as n,subclass as p}from"../../core/accessorSupport/decorators.js";import{UpdatingHandles as l}from"../../core/support/UpdatingHandles.js";import{extractSubstitutionTemplatesFromString as a}from"../../layers/support/fieldUtils.js";import{prependExpressionPrefix as d,prependFieldPrefix as u,isExpressionReference as m,extractExpressionNameFromString as h,isLegacyFieldMapsExpressionReference as f}from"./featureFormUtils.js";import x from"./InputBase.js";import{assembleStringFromParts as c,splitStringIntoParts as _}from"./support/textElementInputUtils.js";import{compileTextElementMarkdownToHTML as g}from"./support/textManipulationUtils.js";let y=class extends x{constructor(e){super(e),this.group=null,this.id=`TextElementInput-${o()}`,this.type="text",this._expressionReferences=new s,this._expressionsUsed=new r,this._fieldsUsed=new r,this._literalParts=new t,this._templateParts=new t,this._updatingHandles=new l}initialize(){const{rawText:e}=this;e?"markdown"===this.textFormat?this._updatingHandles.addPromise(g(e).then(e=>this._initializeTextParts(e))):this._initializeTextParts(e):this._literalParts.push("")}destroy(){this._updatingHandles.destroy()}get expressionsUsed(){return Array.from(this._expressionsUsed)}get fieldsIndex(){return this.layer.fieldsIndex}set fieldsIndex(e){this._overrideIfSome("fieldsIndex",e)}get fieldsUsed(){return Array.from(this._fieldsUsed)}get rawText(){return this.element.text}get text(){const e=this._templateParts.map(e=>`${this._expressionReferences.get(e)?.lastEvaluatedValue??""}`);return i.sanitize(c(this._literalParts,e))}get textFormat(){return this.element.textFormat}get updating(){return this._updatingHandles.updating||Array.from(this._expressionReferences.values()).some(e=>e?.updating)}setExpressionExecutor(e,t){this._expressionReferences.set(d(e),t)}setFieldExecutor(e,t){this._expressionReferences.set(u(e),t)}_initializeTextParts(e){const{fieldsIndex:t}=this,{literals:s,templates:r}=_(e),i=[],o=[];for(let n=0;n<r.length;n++){const e=s[n],p=a(r[n])[0];if(m(p))this._expressionsUsed.add(h(p)),this._expressionReferences.set(p,null),i.push(e),o.push(p);else if(f(p)){this._expressionsUsed.add(p);const t=d(p);this._expressionReferences.set(t,null),i.push(e),o.push(t)}else if(t?.has(p)){const s=t.normalizeFieldName(p);this._fieldsUsed.add(s);const r=u(s);this._expressionReferences.set(r,null),i.push(e),o.push(r)}else s[n+1]=e.concat(p,s[n+1])}i.push(s.at(-1)),this._literalParts.addMany(i),this._templateParts.addMany(o)}};e([n()],y.prototype,"expressionsUsed",null),e([n()],y.prototype,"fieldsIndex",null),e([n()],y.prototype,"fieldsUsed",null),e([n()],y.prototype,"group",void 0),e([n()],y.prototype,"id",void 0),e([n()],y.prototype,"rawText",null),e([n()],y.prototype,"text",null),e([n()],y.prototype,"textFormat",null),e([n()],y.prototype,"type",void 0),e([n()],y.prototype,"updating",null),y=e([p("esri.widgets.FeatureForm.TextElementInput")],y);const U=y;export{U as default};