@arcgis/core 4.34.0-next.44 → 4.34.0-next.46

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 (285) hide show
  1. package/AttributeBinsGraphic.js +1 -1
  2. package/PopupTemplate.js +1 -1
  3. package/arcade/featureSetUtils.js +1 -1
  4. package/arcade/functions/featuresetbase.js +1 -1
  5. package/arcade/geometry/wkt.js +1 -1
  6. package/assets/esri/core/workers/RemoteClient.js +1 -1
  7. package/assets/esri/core/workers/chunks/04cbd3aa9965b2eb71ea.js +1 -0
  8. package/assets/esri/core/workers/chunks/{42c5d957813080143e5a.js → 09268dc856c3d5ce178f.js} +1 -1
  9. package/assets/esri/core/workers/chunks/0f20c0eec850a39620a1.js +1 -0
  10. package/assets/esri/core/workers/chunks/{b40845b45f8d7cd347a1.js → 17df0f766ee1e323d3fa.js} +1 -1
  11. package/assets/esri/core/workers/chunks/{cf474c055a85bdbfa8d0.js → 19f1bfe815896d4983af.js} +1 -1
  12. package/assets/esri/core/workers/chunks/28a5a7c6b3d6902146f6.js +1 -0
  13. package/assets/esri/core/workers/chunks/{bb23371335ac049861e6.js → 28a85997c9003cacdefb.js} +1 -1
  14. package/assets/esri/core/workers/chunks/{9d9a7333a968065b53a1.js → 2942ab268f24cea2e722.js} +1 -1
  15. package/assets/esri/core/workers/chunks/{3a2cbfb03103c402c6c5.js → 2b75212c31145cc07d16.js} +1 -1
  16. package/assets/esri/core/workers/chunks/{787d281b2fe1edf6cf30.js → 2bb61f80473b495163e3.js} +1 -1
  17. package/assets/esri/core/workers/chunks/2cda605c302176905e84.js +1 -0
  18. package/assets/esri/core/workers/chunks/{5958598da96464128aed.js → 2f65081bfedeab44d6cb.js} +1 -1
  19. package/assets/esri/core/workers/chunks/{78de16f65ea297452a65.js → 31c6e951b99315e8e68a.js} +1 -1
  20. package/assets/esri/core/workers/chunks/33f3e3d05429f845c139.js +1 -0
  21. package/assets/esri/core/workers/chunks/3610357c8fa9bec9e0dc.js +1 -0
  22. package/assets/esri/core/workers/chunks/379a4f664e77ad1fffe9.js +1 -0
  23. package/assets/esri/core/workers/chunks/45b450c045d5fadf71b6.js +1 -0
  24. package/assets/esri/core/workers/chunks/{d547b27ac750953a998f.js → 46a470bea2a3601182dc.js} +1 -1
  25. package/assets/esri/core/workers/chunks/47f2e905ef42e36897aa.js +1 -0
  26. package/assets/esri/core/workers/chunks/4c6862ad3af947c704f7.js +1 -0
  27. package/assets/esri/core/workers/chunks/4d544e3e19ce07c2c195.js +1 -0
  28. package/assets/esri/core/workers/chunks/4f5e72993a4f5180d703.js +1 -0
  29. package/assets/esri/core/workers/chunks/50d526a16bc86a481055.js +1 -0
  30. package/assets/esri/core/workers/chunks/516b30778cd54d29e362.js +1 -0
  31. package/assets/esri/core/workers/chunks/54b1a960bb8c3fe05976.js +1 -0
  32. package/assets/esri/core/workers/chunks/5713f96bade5ebb54c81.js +1 -0
  33. package/assets/esri/core/workers/chunks/576792b5e1e13084adba.js +1 -0
  34. package/assets/esri/core/workers/chunks/{6759319f3fd2d03c446b.js → 5c556468e2a598ab793a.js} +1 -1
  35. package/assets/esri/core/workers/chunks/5d331f7628514a572f82.js +1 -0
  36. package/assets/esri/core/workers/chunks/64c31c90e4c589ca2f04.js +1 -0
  37. package/assets/esri/core/workers/chunks/65e1f5b20a585e04655a.js +1 -0
  38. package/assets/esri/core/workers/chunks/66db5f77e09d25e33951.js +1 -0
  39. package/assets/esri/core/workers/chunks/{863e87ac982d7727b435.js → 69e37365c17e7cc4168f.js} +1 -1
  40. package/assets/esri/core/workers/chunks/6fe738748ce837811ff4.js +1 -0
  41. package/assets/esri/core/workers/chunks/709dc98379f4ce18a0b5.js +1 -0
  42. package/assets/esri/core/workers/chunks/719450ccd455f503d81a.js +1 -0
  43. package/assets/esri/core/workers/chunks/73140c5c0beda7ea3703.js +1 -0
  44. package/assets/esri/core/workers/chunks/790e97ddbe318bc75415.js +1 -0
  45. package/assets/esri/core/workers/chunks/7df8c78e36b04ad657d2.js +1 -0
  46. package/assets/esri/core/workers/chunks/838c7fd37b2e78b1d582.js +1 -0
  47. package/assets/esri/core/workers/chunks/8736b78256037b145f8b.js +1 -0
  48. package/assets/esri/core/workers/chunks/{c6da9ba188b627ab3b79.js → 8aa77a5e82c033512b45.js} +1 -1
  49. package/assets/esri/core/workers/chunks/{b1c2e5e0a70fb5d27da5.js → 8bab4c59c9b644224ecb.js} +1 -1
  50. package/assets/esri/core/workers/chunks/8c6119dde0eead8d90d9.js +1 -0
  51. package/assets/esri/core/workers/chunks/{4f3c187a7cb2b1444281.js → 8c81156b1605a16acc29.js} +1 -1
  52. package/assets/esri/core/workers/chunks/{f4b145feab275b268c2e.js → 8cc700da2ac58849a708.js} +1 -1
  53. package/assets/esri/core/workers/chunks/8f70650aba8e55eb7a96.js +1 -0
  54. package/assets/esri/core/workers/chunks/914eaed113dda727eb47.js +1 -0
  55. package/assets/esri/core/workers/chunks/98175b454e807b1a3c5f.js +1 -0
  56. package/assets/esri/core/workers/chunks/{44116cf0bd4d6a127c96.js → 99b9392946d776a62997.js} +1 -1
  57. package/assets/esri/core/workers/chunks/9a20be3b02c9d6349b8d.js +1 -0
  58. package/assets/esri/core/workers/chunks/9affcf990ea810fa426b.js +1 -0
  59. package/assets/esri/core/workers/chunks/9b7fee0adffeee8d45ae.js +1 -0
  60. package/assets/esri/core/workers/chunks/9cbec2ffa445a72d4c33.js +1 -0
  61. package/assets/esri/core/workers/chunks/9d30fed26e0d84ef893b.js +1 -0
  62. package/assets/esri/core/workers/chunks/9f178cf73c63caaea190.js +1 -0
  63. package/assets/esri/core/workers/chunks/a1ff4c252012d5026133.js +1 -0
  64. package/assets/esri/core/workers/chunks/a34d98abcf958a632b0f.js +1 -0
  65. package/assets/esri/core/workers/chunks/a3a23a56df4e5ee86bb2.js +1 -0
  66. package/assets/esri/core/workers/chunks/a6493607b98783bf1ef2.js +1 -0
  67. package/assets/esri/core/workers/chunks/a69258f34a5eb5a1954f.js +1 -0
  68. package/assets/esri/core/workers/chunks/a7ff44157b8cf19de37e.js +1 -0
  69. package/assets/esri/core/workers/chunks/{5ae6e2b3557fe8730072.js → b287624909578d307e07.js} +1 -1
  70. package/assets/esri/core/workers/chunks/{48514235c32917e43a3f.js → b3e2e826295620b1a9dd.js} +2 -2
  71. package/assets/esri/core/workers/chunks/{5b91a49202129eedaf00.js → b4304673696fc0774bff.js} +1 -1
  72. package/assets/esri/core/workers/chunks/bd1c2afaf491d1c79a9e.js +1 -0
  73. package/assets/esri/core/workers/chunks/{f34739daceab54a280ad.js → beb77cdae0b1b6ad73da.js} +1 -1
  74. package/assets/esri/core/workers/chunks/{a638f1688ac9525a52a7.js → c2f184e9f579152aa29a.js} +1 -1
  75. package/assets/esri/core/workers/chunks/c483d2149d9d0099bfdb.js +1 -0
  76. package/assets/esri/core/workers/chunks/{349da65a8793f7873366.js → c5a0976de958b3b01c70.js} +1 -1
  77. package/assets/esri/core/workers/chunks/ce569860b170700e9b31.js +1 -0
  78. package/assets/esri/core/workers/chunks/cf5db995ba88912cf6b7.js +1 -0
  79. package/assets/esri/core/workers/chunks/cf6330f721c6910d25ff.js +1 -0
  80. package/assets/esri/core/workers/chunks/{2aac5d560e4c5defe882.js → cff15600d0ec7b19dffb.js} +1 -1
  81. package/assets/esri/core/workers/chunks/{0faec78b2dd6990a5da0.js → d09ded9fb621491e2466.js} +1 -1
  82. package/assets/esri/core/workers/chunks/d1842745a7699879a1e1.js +1 -0
  83. package/assets/esri/core/workers/chunks/{7e99fc78bd0f40a8ba81.js → d1c97fdcba6eb443cb1c.js} +1 -1
  84. package/assets/esri/core/workers/chunks/d62d41091f7ac5f77f16.js +1 -0
  85. package/assets/esri/core/workers/chunks/d70e1b8b8bee88a7a5b8.js +353 -0
  86. package/assets/esri/core/workers/chunks/d8d17e3ecccec7e99f0b.js +1 -0
  87. package/assets/esri/core/workers/chunks/{14b536e0c1de6c7422bc.js → e408ccee12bfe089c913.js} +1 -1
  88. package/assets/esri/core/workers/chunks/{7f2bdb8da5c9ffd7d05e.js → e58336aafe8c95bb6831.js} +1 -1
  89. package/assets/esri/core/workers/chunks/{30b9c131b69297ee186f.js → e59e09766b130a05c617.js} +1 -1
  90. package/assets/esri/core/workers/chunks/{01ae7d36bda6b6186786.js → eb61b47df99a54a364c8.js} +1 -1
  91. package/assets/esri/core/workers/chunks/ef02e33ea53b46b566cb.js +1 -0
  92. package/assets/esri/core/workers/chunks/f0ccd7ac83d94cbf40a5.js +1 -0
  93. package/assets/esri/core/workers/chunks/{655b8d24ffe5405f8ba1.js → f2a2d3cda4a3dc0a8caf.js} +1 -1
  94. package/assets/esri/core/workers/chunks/fc6408208c850eec4019.js +1 -0
  95. package/assets/esri/core/workers/chunks/ff79a8df1b1941ae350d.js +1 -0
  96. package/assets/esri/libs/parquet/pkg/bundle_bg.wasm +0 -0
  97. package/chunks/NativeLine.glsl.js +5 -14
  98. package/chunks/bundle.js +1 -1
  99. package/chunks/languageUtils.js +1 -1
  100. package/chunks/persistableUrlUtils.js +1 -1
  101. package/colorUtils.js +1 -1
  102. package/config.js +1 -1
  103. package/core/BidiEngine.js +1 -1
  104. package/core/accessorSupport/get.js +1 -1
  105. package/core/accessorSupport/read.js +1 -1
  106. package/core/accessorSupport/tracking.js +1 -1
  107. package/core/screenUtils.js +1 -1
  108. package/core/sql/DateOnly.js +1 -1
  109. package/core/urlUtils.js +1 -1
  110. package/core/uuid.js +1 -1
  111. package/core/workers/registry.js +1 -1
  112. package/geometry/operators/json/generalizeOperator.js +5 -0
  113. package/geometry/operators/json/simplifyOperator.js +1 -1
  114. package/identity/IdentityManagerBase.js +1 -1
  115. package/interfaces.d.ts +3 -3
  116. package/kernel.js +1 -1
  117. package/layers/ParquetLayer.js +1 -1
  118. package/layers/SubtypeGroupLayer.js +1 -1
  119. package/layers/graphics/data/QueryEngine.js +1 -1
  120. package/layers/graphics/data/QueryEngineResult.js +1 -1
  121. package/layers/graphics/sources/ParquetSource.js +1 -1
  122. package/layers/graphics/sources/geojson/GeoJSONSourceWorker.js +1 -1
  123. package/layers/graphics/sources/support/CSVSourceWorker.js +1 -1
  124. package/layers/graphics/sources/support/ParquetSourceWorker.js +5 -0
  125. package/layers/knowledgeGraph/KnowledgeGraphLayerDataManager.js +1 -1
  126. package/layers/mixins/ArcGISImageService.js +1 -1
  127. package/layers/support/TitleCreator.js +1 -1
  128. package/layers/support/fieldUtils.js +1 -1
  129. package/layers/support/parquetUtils.js +1 -1
  130. package/layers/support/rasterDatasets/WCSRaster.js +1 -1
  131. package/layers/support/rasterDatasets/pixelReader.js +1 -1
  132. package/libs/maquette-advanced-projector/utils.js +1 -1
  133. package/libs/parquet/parquet.js +1 -1
  134. package/networks/RulesTable.js +1 -1
  135. package/package.json +1 -1
  136. package/rest/generateRenderer.js +1 -1
  137. package/rest/networks/support/TraceResult.js +1 -1
  138. package/smartMapping/statistics/support/statsWorker.js +1 -1
  139. package/smartMapping/statistics/support/utils.js +1 -1
  140. package/support/revision.js +1 -1
  141. package/symbols/cim/CIMEffects.js +1 -1
  142. package/symbols/cim/CIMResourceManager.js +1 -1
  143. package/symbols/cim/CIMSymbolDrawHelper.js +1 -1
  144. package/symbols/cim/CIMSymbolHelper.js +1 -1
  145. package/symbols/cim/cimAnalyzer.js +1 -1
  146. package/symbols/cim/effects/CIMEffectHelper.js +1 -1
  147. package/symbols/cim/effects/EffectAddControlPoints.js +1 -1
  148. package/symbols/cim/effects/EffectArrow.js +1 -1
  149. package/symbols/cim/effects/EffectBuffer.js +1 -1
  150. package/symbols/cim/effects/EffectControlMeasureLine.js +1 -1
  151. package/symbols/cim/effects/EffectCut.js +1 -1
  152. package/symbols/cim/effects/EffectDashes.js +1 -1
  153. package/symbols/cim/effects/EffectDonut.js +1 -1
  154. package/symbols/cim/effects/EffectEnclosingPolygon.js +1 -1
  155. package/symbols/cim/effects/EffectJog.js +1 -1
  156. package/symbols/cim/effects/EffectMove.js +1 -1
  157. package/symbols/cim/effects/EffectOffset.js +1 -1
  158. package/symbols/cim/effects/EffectRadial.js +1 -1
  159. package/symbols/cim/effects/EffectReverse.js +1 -1
  160. package/symbols/cim/effects/EffectRotate.js +1 -1
  161. package/symbols/cim/effects/EffectScale.js +1 -1
  162. package/symbols/cim/effects/EffectSuppress.js +1 -1
  163. package/symbols/cim/effects/EffectTaperedPolygon.js +1 -1
  164. package/symbols/cim/effects/EffectWave.js +1 -1
  165. package/symbols/cim/fitVectorMarker.js +1 -1
  166. package/symbols/cim/placements/CIMMarkerPlacementHelper.js +1 -1
  167. package/symbols/cim/placements/PlacementAlongLineSameSize.js +1 -1
  168. package/symbols/cim/placements/PlacementAtExtremities.js +1 -1
  169. package/symbols/cim/placements/PlacementAtRatioPositions.js +1 -1
  170. package/symbols/cim/placements/PlacementInsidePolygon.js +1 -1
  171. package/symbols/cim/placements/PlacementOnLine.js +1 -1
  172. package/symbols/cim/placements/PlacementOnVertices.js +1 -1
  173. package/symbols/cim/placements/PlacementPolygonCenter.js +1 -1
  174. package/symbols/cim/utils.js +1 -1
  175. package/views/2d/engine/webgl/TextureManager.js +1 -1
  176. package/views/2d/engine/webgl/shaderGraph/GraphShaderModule.js +1 -1
  177. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedMarkerMeshWriter.js +1 -1
  178. package/views/2d/engine/webgl/shaderGraph/techniques/markers/MarkerMeshWriter.js +1 -1
  179. package/views/2d/engine/webgl/shaderGraph/techniques/mesh/MeshWriter.js +1 -1
  180. package/views/2d/engine/webgl/shaderGraph/techniques/text/TextMeshWriter.js +1 -1
  181. package/views/2d/interactive/editingTools/MediaTransformToolsWrapper.js +1 -1
  182. package/views/2d/layers/features/processor/FeatureUpdateStrategy.js +1 -1
  183. package/views/2d/layers/features/processor/TrackStrategy.js +1 -1
  184. package/views/3d/analysis/AreaMeasurement/support/AreaMeasurementPathHelper.js +1 -1
  185. package/views/3d/analysis/DirectLineMeasurement/DirectLineMeasurementVisualization.js +1 -1
  186. package/views/3d/layers/FeatureLayerViewBase3D.js +1 -1
  187. package/views/3d/layers/i3s/I3SNodeLoader.js +1 -1
  188. package/views/3d/terrain/TerrainRenderer.js +1 -1
  189. package/views/3d/webgl-engine/core/shaderLibrary/ShaderOutput.js +1 -1
  190. package/views/3d/webgl-engine/effects/bloom/BloomRenderNode.js +1 -1
  191. package/views/3d/webgl-engine/lib/intersectorUtilsConversions.js +1 -1
  192. package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
  193. package/views/3d/webgl-engine/materials/NativeLineMaterial.js +1 -1
  194. package/views/3d/webgl-engine/shaders/NativeLine.glsl.js +1 -1
  195. package/views/3d/webgl-engine/shaders/NativeLineTechnique.js +1 -1
  196. package/views/3d/webgl-engine/shaders/NativeLineTechniqueConfiguration.js +1 -1
  197. package/views/draw/DrawOperation.js +1 -1
  198. package/views/draw/{DrawManipulator.js → LegacyDrawManipulator.js} +1 -1
  199. package/views/draw/{DrawTool.js → LegacyDrawTool.js} +1 -1
  200. package/views/draw/PointDrawAction.js +1 -1
  201. package/views/draw/PolygonDrawAction.js +1 -1
  202. package/views/draw/PolylineDrawAction.js +1 -1
  203. package/views/draw/SegmentDrawAction.js +1 -1
  204. package/views/draw/support/Box.js +1 -1
  205. package/views/draw/support/Reshape.js +1 -1
  206. package/views/interactive/tooltip/tooltipCommonUtils.js +1 -1
  207. package/views/support/TextureCompressionWorker.js +1 -1
  208. package/webscene/spec-certification/spec.js +1 -1
  209. package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
  210. package/widgets/BatchAttributeForm.js +1 -1
  211. package/widgets/CatalogLayerList.js +1 -1
  212. package/widgets/CoordinateConversion/support/Format.js +1 -1
  213. package/widgets/Editor/UpdateWorkflow.js +1 -1
  214. package/widgets/Editor/workflowUtils.js +1 -1
  215. package/widgets/ElevationProfile/ElevationProfileController.js +1 -1
  216. package/widgets/Feature/FeatureRelationship.js +1 -1
  217. package/widgets/Feature/FeatureViewModel.js +1 -1
  218. package/widgets/Feature/support/featureUtils.js +1 -1
  219. package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationItemList.js +1 -1
  220. package/widgets/FeatureForm/FeatureFormViewModel.js +1 -1
  221. package/widgets/Legend/support/ActiveLayerInfo.js +1 -1
  222. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  223. package/widgets/OrientedImageryViewer/components/ImageViewerViewModel.js +1 -1
  224. package/widgets/OrientedImageryViewer/components/OrientedImageryVideoViewModel.js +1 -1
  225. package/widgets/OrientedImageryViewer/components/VideoEnhancementTools.js +5 -0
  226. package/widgets/OrientedImageryViewer/symbols.js +1 -1
  227. package/widgets/OrientedImageryViewer.js +1 -1
  228. package/widgets/Print.js +1 -1
  229. package/widgets/Sketch/SketchViewModel.js +1 -1
  230. package/widgets/Track/TrackViewModel.js +1 -1
  231. package/widgets/UtilityNetworkTrace/UtilityNetworkTraceViewModel.js +1 -1
  232. package/widgets/support/SelectionToolbar/SelectionToolbarViewModel.js +1 -1
  233. package/widgets/support/SnappingControls.js +1 -1
  234. package/widgets/support/UtilityNetworkAssociations/UtilityNetworkAssociationList.js +1 -1
  235. package/assets/esri/core/workers/chunks/03df4668002eb4cb4f98.js +0 -1
  236. package/assets/esri/core/workers/chunks/087ae1e3e767f0e678e5.js +0 -1
  237. package/assets/esri/core/workers/chunks/0b45566fad2cbb03fea1.js +0 -1
  238. package/assets/esri/core/workers/chunks/0d73afce787ee1e76b21.js +0 -1
  239. package/assets/esri/core/workers/chunks/1acc620bfd2983d6853f.js +0 -1
  240. package/assets/esri/core/workers/chunks/21dd626a5b5ea6a7e18e.js +0 -1
  241. package/assets/esri/core/workers/chunks/24e76fa530fc0c495fb5.js +0 -1
  242. package/assets/esri/core/workers/chunks/28d71e1b866113650c75.js +0 -1
  243. package/assets/esri/core/workers/chunks/2a26c3fc324d672ebe88.js +0 -1
  244. package/assets/esri/core/workers/chunks/2c816d3a737e39e6eb84.js +0 -1
  245. package/assets/esri/core/workers/chunks/2f54776ff86f397adc55.js +0 -1
  246. package/assets/esri/core/workers/chunks/3984ca7e05f30724adaf.js +0 -1
  247. package/assets/esri/core/workers/chunks/3af4a410ff0bca7ba2e3.js +0 -1
  248. package/assets/esri/core/workers/chunks/439128f23fa091633d2d.js +0 -1
  249. package/assets/esri/core/workers/chunks/489391ed1d443140617d.js +0 -1
  250. package/assets/esri/core/workers/chunks/4970d439d9648e97fd5a.js +0 -1
  251. package/assets/esri/core/workers/chunks/774844eea928efa811f2.js +0 -1
  252. package/assets/esri/core/workers/chunks/7b82ed4cc475c782256b.js +0 -1
  253. package/assets/esri/core/workers/chunks/7ef29640de297a0cf744.js +0 -1
  254. package/assets/esri/core/workers/chunks/8867368ab9b005460f19.js +0 -353
  255. package/assets/esri/core/workers/chunks/8c3c752408fac3db05cf.js +0 -1
  256. package/assets/esri/core/workers/chunks/8ca95499e00ce8b0af9a.js +0 -1
  257. package/assets/esri/core/workers/chunks/8f3ce10eacb5bc14a641.js +0 -1
  258. package/assets/esri/core/workers/chunks/91be247f868ce6596c9e.js +0 -1
  259. package/assets/esri/core/workers/chunks/97fc21355efc7b289f3b.js +0 -1
  260. package/assets/esri/core/workers/chunks/9cd9b22354dbdf1b1df0.js +0 -1
  261. package/assets/esri/core/workers/chunks/a89c060ad302381aaf7d.js +0 -1
  262. package/assets/esri/core/workers/chunks/aaab7694eb333ad480f5.js +0 -1
  263. package/assets/esri/core/workers/chunks/af98c7546be409303213.js +0 -1
  264. package/assets/esri/core/workers/chunks/b01a90ce699058307bc2.js +0 -1
  265. package/assets/esri/core/workers/chunks/b5f6a0607b620b027cdd.js +0 -1
  266. package/assets/esri/core/workers/chunks/c110941e87923ba47193.js +0 -1
  267. package/assets/esri/core/workers/chunks/c6e3d4c6bb02d58d5cfe.js +0 -1
  268. package/assets/esri/core/workers/chunks/cd6398a2951922e13b86.js +0 -1
  269. package/assets/esri/core/workers/chunks/ceb63ca9ad473c3f1820.js +0 -1
  270. package/assets/esri/core/workers/chunks/d392fbbcfac2a1b54bd6.js +0 -1
  271. package/assets/esri/core/workers/chunks/d93b24e863379116b2aa.js +0 -1
  272. package/assets/esri/core/workers/chunks/da6f46211551a96dce19.js +0 -1
  273. package/assets/esri/core/workers/chunks/dd9be173cddc16a354ed.js +0 -1
  274. package/assets/esri/core/workers/chunks/ddeaf688d72b2873c4ac.js +0 -1
  275. package/assets/esri/core/workers/chunks/e3f5afdf133c58b3d161.js +0 -1
  276. package/assets/esri/core/workers/chunks/e5aeb34d918dee539694.js +0 -1
  277. package/assets/esri/core/workers/chunks/e6d08230adb90b9a2a17.js +0 -1
  278. package/assets/esri/core/workers/chunks/e7806a57d29bca385f1d.js +0 -1
  279. package/assets/esri/core/workers/chunks/e799433770e4303fcd9c.js +0 -1
  280. package/assets/esri/core/workers/chunks/eb7dd722e4cd7f83b3f5.js +0 -1
  281. package/assets/esri/core/workers/chunks/f1adf8ebc2c1b93857bf.js +0 -1
  282. package/assets/esri/core/workers/chunks/f1b02c4bd5fde235212b.js +0 -1
  283. package/assets/esri/core/workers/chunks/f65b2d3a91a0c726fee4.js +0 -1
  284. package/assets/esri/core/workers/chunks/ff34fdda7899e784ac73.js +0 -1
  285. package/views/2d/engine/webgl/shaderGraph/techniques/mesh/loadGeometryEngine.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/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{getBasisEncoder as e,destroyBasisEncoder as t}from"../../libs/basisu/BasisUEncoder.js";import{getDXTEncoder as n,destroyDXTEncoder as r}from"../../libs/dxtEncoder/DXTEncoder.js";import{CompressedTextureFormat as a}from"../webgl/enums.js";let l,s,i=null,u=null;class o{constructor(e,t){this.internalFormat=e,this.compressedTexture=t}}function c(){i=null,l=null,u=null,s=null,t(),r()}async function h(e){let t;if(t=e.data instanceof ImageBitmap?m(e.data):y(e.data,e.width,e.height,e.components,e.needsFlip),e.hasS3TC){u||await f();const n=new Uint8Array(t.length);if(u?.encode(t,e.width,e.height,e.preMultiplyAlpha,n)){const e=U(n,!0),t=[n.buffer];return{result:new o(e?.internalFormat??null,e?.textureData??null),transferList:t}}return{result:new o(null,null)}}if(e.hasETC){if(i||await d(),e.preMultiplyAlpha&&!u&&await f(),e.preMultiplyAlpha){const n=new Uint8ClampedArray(t.length);u?.premultiply(new Uint8Array(t),e.width,e.height,n),t=n}const n=await p(t,e.width,e.height,e.hasMipmap),r=n?await w(n):null,a=r?.compressedTexture?.levels.map(e=>e.buffer)||[];return{result:new o(r?.internalFormat??null,r?.compressedTexture??null),transferList:a}}return{result:new o(null,null)}}async function d(){i||(i=await(l??=e()),l=null)}async function f(){u||(u=await(s??=n()),s=null)}async function p(e,t,n,r,a=255,l=0,s=!1,u=!1){if(!i)return null;const o=new i.BasisEncoder;o.setPerceptual(!u),o.setCheckForAlpha(!0),o.setForceAlpha(!1),o.setRenormalize(u),o.setMipGen(r),o.setMipSRGB(!u),o.setCreateKTX2File(!0),o.setKTX2SRGBTransferFunc(!u),o.setQualityLevel(a),o.setCompressionLevel(l);const c=new Uint8Array(e.byteLength);o.setSliceSourceImage(0,new Uint8Array(e),t,n,s);const h=o.encode(c),d=new Uint8Array(c.buffer,0,h),f=new i.KTX2File(new Uint8Array(d));return f.isValid()?(o.delete(),d):(f.close(),f.delete(),o.delete(),null)}async function w(e){if(!i)return new o(null,null);const t=new i.KTX2File(new Uint8Array(e));t.startTranscoding();const[n,r]=t.getHasAlpha()?[1,a.COMPRESSED_RGBA8_ETC2_EAC]:[0,a.COMPRESSED_RGB8_ETC2],l=t.getLevels(),s=[];for(let a=0;a<l;a++)s.push(new Uint8Array(t.getImageTranscodedSizeInBytes(a,0,0,n))),t.transcodeImage(s[a],a,0,0,n,0,-1,-1);return t.close(),t.delete(),{internalFormat:r,compressedTexture:{type:"compressed",levels:s}}}function m(e){const t=new OffscreenCanvas(e.width,e.height),n=t.getContext("2d");n.drawImage(e,0,0);return n.getImageData(0,0,t.width,t.height).data}function y(e,t,n,r,a){const l=new Uint8ClampedArray(e).subarray(0,t*n*r);if(!a)return l;const s=new Uint8ClampedArray(l.length),i=t*r;for(let u=0;u<n;u++){const e=u*i,t=(n-u-1)*i;s.set(l.subarray(e,e+i),t)}return s}const T=31,A=1,C=2,g=3,E=4,S=7,b=21,_=131072;function D(e){return e.charCodeAt(0)+(e.charCodeAt(1)<<8)+(e.charCodeAt(2)<<16)+(e.charCodeAt(3)<<24)}const M=D("DXT1"),X=D("DXT3"),R=D("DXT5");function U(e,t){const n=new Int32Array(e.buffer,e.byteOffset,T);let r,l;switch(n[b]){case M:r=8,l=a.COMPRESSED_RGB_S3TC_DXT1_EXT;break;case X:r=16,l=a.COMPRESSED_RGBA_S3TC_DXT3_EXT;break;case R:r=16,l=a.COMPRESSED_RGBA_S3TC_DXT5_EXT;break;default:return null}let s=1,i=n[E],u=n[g];(3&i||3&u)&&(i=i+3&-4,u=u+3&-4);const o=i,c=u;let h,d;n[C]&_&&!1!==t&&(s=Math.max(1,n[S]));let f=e.byteOffset+n[A]+4;const p=[];for(let a=0;a<s;++a)d=(i+3>>2)*(u+3>>2)*r,h=new Uint8Array(e.buffer,f,d),p.push(h),f+=d,i=Math.max(1,i>>1),u=Math.max(1,u>>1);return{textureData:{type:"compressed",levels:p},internalFormat:l,width:o,height:c}}export{o as TextureCompressionWorkerOutput,h as compress,p as compressRGBADataToKTX2,w as createTextureDataKTX2,c as destroy,d as initializeBasisEncoder,f as initializeDXTEncoder};
5
+ import{getBasisEncoder as e,destroyBasisEncoder as t}from"../../libs/basisu/BasisUEncoder.js";import{getDXTEncoder as n,destroyDXTEncoder as r}from"../../libs/dxtEncoder/DXTEncoder.js";import{CompressedTextureFormat as a}from"../webgl/enums.js";let l,s,i=null,u=null;class o{constructor(e,t){this.internalFormat=e,this.compressedTexture=t}}function c(){i=null,l=null,u=null,s=null,t(),r()}async function h(e){let t;if(t=e.data instanceof ImageBitmap?w(e.data):y(e.data,e.width,e.height,e.components,e.needsFlip),e.hasS3TC){u||await f();const n=new Uint8Array(t.length);if(u?.encode(t,e.width,e.height,e.preMultiplyAlpha,n)){const e=U(n,!0),t=[n.buffer];return{result:new o(e?.internalFormat??null,e?.textureData??null),transferList:t}}return{result:new o(null,null)}}if(e.hasETC){if(i||await d(),e.preMultiplyAlpha&&!u&&await f(),e.preMultiplyAlpha){const n=new Uint8ClampedArray(t.length);u?.premultiply(new Uint8Array(t),e.width,e.height,n),t=n}const n=p(t,e.width,e.height,e.hasMipmap),r=n?m(n):null,a=r?.compressedTexture?.levels.map(e=>e.buffer)||[];return{result:new o(r?.internalFormat??null,r?.compressedTexture??null),transferList:a}}return{result:new o(null,null)}}async function d(){i||(i=await(l??=e()),l=null)}async function f(){u||(u=await(s??=n()),s=null)}function p(e,t,n,r,a=255,l=0,s=!1,u=!1){if(!i)return null;const o=new i.BasisEncoder;o.setPerceptual(!u),o.setCheckForAlpha(!0),o.setForceAlpha(!1),o.setRenormalize(u),o.setMipGen(r),o.setMipSRGB(!u),o.setCreateKTX2File(!0),o.setKTX2SRGBTransferFunc(!u),o.setQualityLevel(a),o.setCompressionLevel(l);const c=new Uint8Array(e.byteLength);o.setSliceSourceImage(0,new Uint8Array(e),t,n,s);const h=o.encode(c),d=new Uint8Array(c.buffer,0,h),f=new i.KTX2File(new Uint8Array(d));return f.isValid()?(o.delete(),d):(f.close(),f.delete(),o.delete(),null)}function m(e){if(!i)return new o(null,null);const t=new i.KTX2File(new Uint8Array(e));t.startTranscoding();const[n,r]=t.getHasAlpha()?[1,a.COMPRESSED_RGBA8_ETC2_EAC]:[0,a.COMPRESSED_RGB8_ETC2],l=t.getLevels(),s=[];for(let a=0;a<l;a++)s.push(new Uint8Array(t.getImageTranscodedSizeInBytes(a,0,0,n))),t.transcodeImage(s[a],a,0,0,n,0,-1,-1);return t.close(),t.delete(),{internalFormat:r,compressedTexture:{type:"compressed",levels:s}}}function w(e){const t=new OffscreenCanvas(e.width,e.height),n=t.getContext("2d");n.drawImage(e,0,0);return n.getImageData(0,0,t.width,t.height).data}function y(e,t,n,r,a){const l=new Uint8ClampedArray(e).subarray(0,t*n*r);if(!a)return l;const s=new Uint8ClampedArray(l.length),i=t*r;for(let u=0;u<n;u++){const e=u*i,t=(n-u-1)*i;s.set(l.subarray(e,e+i),t)}return s}const T=31,A=1,C=2,g=3,E=4,S=7,b=21,_=131072;function D(e){return e.charCodeAt(0)+(e.charCodeAt(1)<<8)+(e.charCodeAt(2)<<16)+(e.charCodeAt(3)<<24)}const M=D("DXT1"),X=D("DXT3"),R=D("DXT5");function U(e,t){const n=new Int32Array(e.buffer,e.byteOffset,T);let r,l;switch(n[b]){case M:r=8,l=a.COMPRESSED_RGB_S3TC_DXT1_EXT;break;case X:r=16,l=a.COMPRESSED_RGBA_S3TC_DXT3_EXT;break;case R:r=16,l=a.COMPRESSED_RGBA_S3TC_DXT5_EXT;break;default:return null}let s=1,i=n[E],u=n[g];(3&i||3&u)&&(i=i+3&-4,u=u+3&-4);const o=i,c=u;let h,d;n[C]&_&&!1!==t&&(s=Math.max(1,n[S]));let f=e.byteOffset+n[A]+4;const p=[];for(let a=0;a<s;++a)d=(i+3>>2)*(u+3>>2)*r,h=new Uint8Array(e.buffer,f,d),p.push(h),f+=d,i=Math.max(1,i>>1),u=Math.max(1,u>>1);return{textureData:{type:"compressed",levels:p},internalFormat:l,width:o,height:c}}export{o as TextureCompressionWorkerOutput,h as compress,p as compressRGBADataToKTX2,m as createTextureDataKTX2,c as destroy,d as initializeBasisEncoder,f as initializeDXTEncoder};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../core/Error.js";import{json as t}from"../../portal/schemas/webScene.js";import{ScanContext as r,sorted as n}from"./utils.js";function s(e,t){if(t.properties){if("layerType"in t.properties)return t.properties.layerType.enum[0];if("type"in t.properties&&t.properties.type.enum)return t.properties.type.enum[0]}switch(e){case"multipoint_geometry_schema.json":return"multipoint";case"point_geometry_schema.json":return"point";case"polyline_geometry_schema.json":return"polyline";case"polygon_geometry_schema.json":return"polygon";case"extent_schema.json":return"extent"}}function i(e){return"array"===e.type?`${i(e.items)}[]`:e.type}function a(e){const t={count:e.length,refsCount:0,typesCount:0,distinctTypes:[],type:null},r=new Set;for(const n in e){const s=e[n];s.$ref?t.refsCount++:s.type&&(t.typesCount++,r.add(i(s)))}return r.forEach(e=>t.distinctTypes.push(e)),t.distinctTypes.sort(),t.refsCount===t.count?t.type="refs":2===t.count&&t.refsCount>0&&1===t.distinctTypes.length&&"null"===t.distinctTypes[0]?t.type="refsAndNull":t.typesCount===t.count?(t.type="types",t.distinctTypes=t.distinctTypes):t.type="mix",t}function o(e,t){const r=t.stack[t.stack.length-1],n=t.definitions[r.klass.name];return n?.required&&n.required.includes(e.replace("[]",""))}function c(e){return"array"===e.type||!("properties"in e)}function l(e,t,r){if(!r.hasFilteredProperties)return`${e}--${t}`;return`${e}--${t}--${r.filteredPropertiesArray.join("/")}`}async function u(e,t,r,n,i){i.schemaStack.push(e);const a=s(e,r),u=n?n.replace("<?TYPE?>",a?`<${a}>`:""):"";if(c(r)){const n=i.currentClass?null:{type:e,name:e,id:`${e}--${t}`,typeValue:t,properties:[]};return n&&i.push(null,n),await T(r,u,i),i.schemaStack.pop(),n}const p=l(e,t,i),f="drawingInfo_schema.json"!==e&&"layer_schema.json"!==e&&i.seen.get(p);if(f&&u)return i.addProperty({name:u,type:f,required:o(u,i)}),i.schemaStack.pop(),f;const h={type:e,name:e,id:p,typeValue:t,properties:[]};return u&&i.addProperty({name:u,type:h,required:o(u,i)}),i.push(u,h),await T(r,"",i),i.schemaStack.pop(),i.pop()}async function p(e,t,r){const n=await r.requestSchema(e.$ref),s=L(n.schema);if(s){for(const e of s){const s={...n.schema};s.properties={...s.properties,type:{type:"string",enum:[e]}};const i=t&&!t.includes("<?TYPE?>")?`${t}<?TYPE?>`:t;await u(n.schemaId,e,s,i,r)}return}const i="layer_schema.json"===n.schemaId&&r.schemaStack.length?r.schemaStack[r.schemaStack.length-1].replace(/_schema\.json/,""):null;await u(n.schemaId,i,n.schema,t,r)}function f(e,t){if(!m(e))return!1;const r=e.stack.map(e=>e.klass.type).join("/");return/.*pointCloudLayer_schema\.json\/layerDefinition_schema\.json\/drawingInfo_schema\.json$/.test(r)&&"renderer"===t}function h(e,t){if(!y(e)&&!d(e))return!1;const r=e.stack.map(e=>e.klass.type).join("/");return(/.*(imageServiceLayer|tiledImageServiceLayer|wcsLayer)_schema\.json\/(layerDefinition|rasterLayerDefinition)_schema\.json\/rasterDrawingInfo_schema\.json$/.test(r)||/.*rasterPresetRenderer_schema\.json$/.test(r))&&"renderer"===t}function m(e){return!!e.currentClass&&"drawingInfo_schema.json"===e.currentClass.name}function y(e){return!!e.currentClass&&"rasterDrawingInfo_schema.json"===e.currentClass.name}function d(e){return!!e.currentClass&&"rasterPresetRenderer_schema.json"===e.currentClass.name}function _(e){switch(e.schemaStack[e.schemaStack.length-1]){case"operationalLayers_schema.json":case"elevationLayers_schema.json":case"baseMapLayer_schema.json":return!0}return!1}const w=/raster.*Renderer|vectorFieldRenderer/,j=/(uniqueValueRenderer|classBreaksRenderer|raster.*Renderer|vectorFieldRenderer)/,$=/(rasterUniqueValueRenderer|rasterClassBreaksRenderer)/;function g(e,t,r){if(m(r)||y(r)||d(r)){const n=f(r,t),s=h(r,t);return e.filter(e=>{if(/uniqueValueFromStyleRenderer_schema\.json$/.test(e.$ref))return!1;if(s)return j.test(e.$ref)&&!$.test(e.$ref);if(w.test(e.$ref))return!1;const t=/pointCloud.*Renderer/.test(e.$ref);return n===t})}if(_(r)){const t=["kmlLayer","rasterDataElevationLayer","rasterDataLayer","object3DTilesLayer"];return e.filter(e=>!t.some(t=>e.$ref.replace(/.*\//,"")===`${t}_schema.json`))}return e}async function P(e,t,r){await T(e.items,`${t}[]`,r)}async function S(e,t,r){for(const n in e.properties)if(!("webscene_schema.json"===r.currentClass?.name&&"mapRangeInfo"===n||"baseMap_schema.json"===r.currentClass?.name&&"elevationLayers"===n)){if(m(r)){const e=r.stack.map(e=>e.klass.type).join("/");if(/imageServiceLayer|tiledImageServiceLayer/.test(e)&&"transparency"===n)continue}await r.withFilter(n,async()=>{const s=t?`${t}.${n}`:n;await T(e.properties[n],s,r)})}}function k(e,t="",r=new Set){for(const n of e)if("properties"in n)for(const e in n.properties){const s=n.properties[e],i=t?`${t}.${e}`:e,a=Object.keys(s);if(0===a.length||1===a.length&&"$ref"===a[0])r.add(i);else{if(1!==a.length||"allOf"!==a[0])throw new Error(`unexpected allOf filter construct: ${JSON.stringify(s)}`);r.add(i),k(s.allOf,i,r)}}return r}async function R(e,t,r){let n=null;for(const i of e.allOf)if("$ref"in i){if(n)throw new Error("Cannot process more than 1 ref in an allOf construct");n=i}else if(!("properties"in i))throw new Error("allOf construct only allows simple top-level property filters");const s=k(e.allOf);await r.addFilter(s,()=>p(n,t,r))}async function C(e,t,r){const s=a(e.oneOf);if("refs"===s.type||"refsAndNull"===s.type){const n=g(e.oneOf,t,r);for(const e of n)if("null"===e.type);else{const s=`${t||""}`+(1!==n.length?"<?TYPE?>":"");await T(e,s,r)}return}if("types"!==s.type)for(const n in e.oneOf){const s=`.oneOf[${n}]`;await T(e.oneOf[n],`${t}${s}`,r)}else r.addProperty({name:t,type:n(s.distinctTypes).join("|"),required:o(t,r)})}function L(e){if("layerDefinition"===e.title)return null;const t=e.properties?.type;return t?.enum?t.enum:null}async function q(e,t,r){await p(e,t,r)}async function O(e,t,r){let s="unknown";e.type&&(s=Array.isArray(e.type)?n(e.type).join("|"):e.type.replaceAll(" ","").split(",").join("|"));const i={name:t,type:s,default:e.default,required:o(t,r)};e.enum&&(i.enum=n(e.enum).map(e=>"string"==typeof e?`"${e}"`:`${e}`).join("|")),r.addProperty(i)}async function T(e,t,r){return"array"===e.type?P(e,t,r):"properties"in e?S(e,t,r):"allOf"in e?R(e,t,r):"oneOf"in e?C(e,t,r):"$ref"in e?q(e,t,r):O(e,t,r)}const b="#/definitions/";function E(e){return 0===e.indexOf(b)?e.slice(b.length):e}async function I(e,t){const r=await v.create(e,t);return u(`${e||"webscene"}_schema.json`,null,r.schemaRoot,null,r)}class v extends r{constructor(e,t,r){super(),this.definitions=e,this.schemaRoot=t,this.requestSchema=r,this._filteredProperties=null,this.schemaStack=[],this.requestSchema.bind(this)}get hasFilteredProperties(){return(this._filteredProperties?.size??0)>0}get filteredPropertiesArray(){const e=[];return this._filteredProperties?.forEach(t=>e.push(t)),e}async withFilter(e,t){if(!this.hasFilteredProperties)return t();if(!this._filteredProperties?.has(e))return;const r=this._filteredProperties;this._filteredProperties=null;const n=e=>{this._filteredProperties||(this._filteredProperties=new Set),this._filteredProperties.add(e)};r.forEach(t=>{const r=t.split(".",2);r.length>1&&r[0]===e&&n(r[1])}),await t(),this._filteredProperties=r}async addFilter(e,t){const r=this._filteredProperties;this._filteredProperties=null;const n=e=>{this._filteredProperties||(this._filteredProperties=new Set),this._filteredProperties.add(e)};r&&r.forEach(n),e&&e.forEach(n);const s=await t();return this._filteredProperties=r,s}static async create(e,t){return t?.useRemoteSchema?v.createRemote(e,t?.baseUrl):v.createLocal(e)}static createLocal(e){const r=e&&"webscene"!==e?t.definitions[`${e}_schema.json`]:t;return new v(t.definitions,r,v._getLocalSchemaRequest())}static async createRemote(e,t){const r=await v._getRemoteSchemaRequest(t),n=new v({},null,r),s=(await n.requestSchema(`${e||"webscene"}_schema.json`)).schema;return new v(n.definitions,s,r)}static _getLocalSchemaRequest(){return function(t){const r=E(t),n=this.definitions[r];return n?Promise.resolve({schemaId:r,schema:n}):Promise.reject(new e("spec-certification:spec-invalid-local-schema","Schema reference is not a local reference"))}}static async _getRemoteSchemaRequest(t){if(!t)return Promise.reject(new e("spec-certification:spec-missing-base-url","The base url of the remote schema directory must be specified when using a remote schema"));const r=v._getLocalSchemaRequest(),n=(await import("../../request.js")).default;return function(e){return r.call(this,e).catch(()=>n(`${t}/${e}`,{responseType:"json"}).then(t=>(this.definitions[E(e)]=t.data,{schemaId:e,schema:t.data})))}}}const F=Object.keys(t.definitions).map(e=>e.replace(/_schema\.json$/,""));export{I as scan,F as schemaDefinitions};
5
+ import e from"../../core/Error.js";import{json as t}from"../../portal/schemas/webScene.js";import{ScanContext as r,sorted as n}from"./utils.js";function s(e,t){if(t.properties){if("layerType"in t.properties)return t.properties.layerType.enum[0];if("type"in t.properties&&t.properties.type.enum)return t.properties.type.enum[0]}switch(e){case"multipoint_geometry_schema.json":return"multipoint";case"point_geometry_schema.json":return"point";case"polyline_geometry_schema.json":return"polyline";case"polygon_geometry_schema.json":return"polygon";case"extent_schema.json":return"extent"}}function i(e){return"array"===e.type?`${i(e.items)}[]`:e.type}function a(e){const t={count:e.length,refsCount:0,typesCount:0,distinctTypes:[],type:null},r=new Set;for(const n in e){const s=e[n];s.$ref?t.refsCount++:s.type&&(t.typesCount++,r.add(i(s)))}return r.forEach(e=>t.distinctTypes.push(e)),t.distinctTypes.sort(),t.refsCount===t.count?t.type="refs":2===t.count&&t.refsCount>0&&1===t.distinctTypes.length&&"null"===t.distinctTypes[0]?t.type="refsAndNull":t.typesCount===t.count?(t.type="types",t.distinctTypes=t.distinctTypes):t.type="mix",t}function o(e,t){const r=t.stack[t.stack.length-1],n=t.definitions[r.klass.name];return n?.required&&n.required.includes(e.replace("[]",""))}function c(e){return"array"===e.type||!("properties"in e)}function l(e,t,r){if(!r.hasFilteredProperties)return`${e}--${t}`;return`${e}--${t}--${r.filteredPropertiesArray.join("/")}`}async function u(e,t,r,n,i){i.schemaStack.push(e);const a=s(e,r),u=n?n.replace("<?TYPE?>",a?`<${a}>`:""):"";if(c(r)){const n=i.currentClass?null:{type:e,name:e,id:`${e}--${t}`,typeValue:t,properties:[]};return n&&i.push(null,n),await T(r,u,i),i.schemaStack.pop(),n}const p=l(e,t,i),f="drawingInfo_schema.json"!==e&&"layer_schema.json"!==e&&i.seen.get(p);if(f&&u)return i.addProperty({name:u,type:f,required:o(u,i)}),i.schemaStack.pop(),f;const h={type:e,name:e,id:p,typeValue:t,properties:[]};return u&&i.addProperty({name:u,type:h,required:o(u,i)}),i.push(u,h),await T(r,"",i),i.schemaStack.pop(),i.pop()}async function p(e,t,r){const n=await r.requestSchema(e.$ref),s=L(n.schema);if(s){for(const e of s){const s={...n.schema};s.properties={...s.properties,type:{type:"string",enum:[e]}};const i=t&&!t.includes("<?TYPE?>")?`${t}<?TYPE?>`:t;await u(n.schemaId,e,s,i,r)}return}const i="layer_schema.json"===n.schemaId&&r.schemaStack.length?r.schemaStack[r.schemaStack.length-1].replace(/_schema\.json/,""):null;await u(n.schemaId,i,n.schema,t,r)}function f(e,t){if(!m(e))return!1;const r=e.stack.map(e=>e.klass.type).join("/");return/.*pointCloudLayer_schema\.json\/layerDefinition_schema\.json\/drawingInfo_schema\.json$/.test(r)&&"renderer"===t}function h(e,t){if(!y(e)&&!d(e))return!1;const r=e.stack.map(e=>e.klass.type).join("/");return(/.*(imageServiceLayer|tiledImageServiceLayer|wcsLayer)_schema\.json\/(layerDefinition|rasterLayerDefinition)_schema\.json\/rasterDrawingInfo_schema\.json$/.test(r)||/.*rasterPresetRenderer_schema\.json$/.test(r))&&"renderer"===t}function m(e){return!!e.currentClass&&"drawingInfo_schema.json"===e.currentClass.name}function y(e){return!!e.currentClass&&"rasterDrawingInfo_schema.json"===e.currentClass.name}function d(e){return!!e.currentClass&&"rasterPresetRenderer_schema.json"===e.currentClass.name}function _(e){switch(e.schemaStack[e.schemaStack.length-1]){case"operationalLayers_schema.json":case"elevationLayers_schema.json":case"baseMapLayer_schema.json":return!0}return!1}const w=/raster.*Renderer|vectorFieldRenderer/,j=/(uniqueValueRenderer|classBreaksRenderer|raster.*Renderer|vectorFieldRenderer)/,$=/(rasterUniqueValueRenderer|rasterClassBreaksRenderer)/;function g(e,t,r){if(m(r)||y(r)||d(r)){const n=f(r,t),s=h(r,t);return e.filter(e=>{if(e.$ref.endsWith("uniqueValueFromStyleRenderer_schema.json"))return!1;if(s)return j.test(e.$ref)&&!$.test(e.$ref);if(w.test(e.$ref))return!1;const t=/pointCloud.*Renderer/.test(e.$ref);return n===t})}if(_(r)){const t=["kmlLayer","rasterDataElevationLayer","rasterDataLayer","object3DTilesLayer"];return e.filter(e=>!t.some(t=>e.$ref.replace(/.*\//,"")===`${t}_schema.json`))}return e}async function P(e,t,r){await T(e.items,`${t}[]`,r)}async function S(e,t,r){for(const n in e.properties)if(!("webscene_schema.json"===r.currentClass?.name&&"mapRangeInfo"===n||"baseMap_schema.json"===r.currentClass?.name&&"elevationLayers"===n)){if(m(r)){const e=r.stack.map(e=>e.klass.type).join("/");if(/imageServiceLayer|tiledImageServiceLayer/.test(e)&&"transparency"===n)continue}await r.withFilter(n,async()=>{const s=t?`${t}.${n}`:n;await T(e.properties[n],s,r)})}}function k(e,t="",r=new Set){for(const n of e)if("properties"in n)for(const e in n.properties){const s=n.properties[e],i=t?`${t}.${e}`:e,a=Object.keys(s);if(0===a.length||1===a.length&&"$ref"===a[0])r.add(i);else{if(1!==a.length||"allOf"!==a[0])throw new Error(`unexpected allOf filter construct: ${JSON.stringify(s)}`);r.add(i),k(s.allOf,i,r)}}return r}async function R(e,t,r){let n=null;for(const i of e.allOf)if("$ref"in i){if(n)throw new Error("Cannot process more than 1 ref in an allOf construct");n=i}else if(!("properties"in i))throw new Error("allOf construct only allows simple top-level property filters");const s=k(e.allOf);await r.addFilter(s,()=>p(n,t,r))}async function C(e,t,r){const s=a(e.oneOf);if("refs"===s.type||"refsAndNull"===s.type){const n=g(e.oneOf,t,r);for(const e of n)if("null"===e.type);else{const s=`${t||""}`+(1!==n.length?"<?TYPE?>":"");await T(e,s,r)}return}if("types"!==s.type)for(const n in e.oneOf){const s=`.oneOf[${n}]`;await T(e.oneOf[n],`${t}${s}`,r)}else r.addProperty({name:t,type:n(s.distinctTypes).join("|"),required:o(t,r)})}function L(e){if("layerDefinition"===e.title)return null;const t=e.properties?.type;return t?.enum?t.enum:null}async function q(e,t,r){await p(e,t,r)}async function O(e,t,r){let s="unknown";e.type&&(s=Array.isArray(e.type)?n(e.type).join("|"):e.type.replaceAll(" ","").split(",").join("|"));const i={name:t,type:s,default:e.default,required:o(t,r)};e.enum&&(i.enum=n(e.enum).map(e=>"string"==typeof e?`"${e}"`:`${e}`).join("|")),r.addProperty(i)}async function T(e,t,r){return"array"===e.type?P(e,t,r):"properties"in e?S(e,t,r):"allOf"in e?R(e,t,r):"oneOf"in e?C(e,t,r):"$ref"in e?q(e,t,r):O(e,t,r)}const b="#/definitions/";function E(e){return e.startsWith(b)?e.slice(b.length):e}async function I(e,t){const r=await v.create(e,t);return u(`${e||"webscene"}_schema.json`,null,r.schemaRoot,null,r)}class v extends r{constructor(e,t,r){super(),this.definitions=e,this.schemaRoot=t,this.requestSchema=r,this._filteredProperties=null,this.schemaStack=[],this.requestSchema.bind(this)}get hasFilteredProperties(){return(this._filteredProperties?.size??0)>0}get filteredPropertiesArray(){const e=[];return this._filteredProperties?.forEach(t=>e.push(t)),e}async withFilter(e,t){if(!this.hasFilteredProperties)return t();if(!this._filteredProperties?.has(e))return;const r=this._filteredProperties;this._filteredProperties=null;const n=e=>{this._filteredProperties||(this._filteredProperties=new Set),this._filteredProperties.add(e)};r.forEach(t=>{const r=t.split(".",2);r.length>1&&r[0]===e&&n(r[1])}),await t(),this._filteredProperties=r}async addFilter(e,t){const r=this._filteredProperties;this._filteredProperties=null;const n=e=>{this._filteredProperties||(this._filteredProperties=new Set),this._filteredProperties.add(e)};r&&r.forEach(n),e&&e.forEach(n);const s=await t();return this._filteredProperties=r,s}static async create(e,t){return t?.useRemoteSchema?v.createRemote(e,t?.baseUrl):v.createLocal(e)}static createLocal(e){const r=e&&"webscene"!==e?t.definitions[`${e}_schema.json`]:t;return new v(t.definitions,r,v._getLocalSchemaRequest())}static async createRemote(e,t){const r=await v._getRemoteSchemaRequest(t),n=new v({},null,r),s=(await n.requestSchema(`${e||"webscene"}_schema.json`)).schema;return new v(n.definitions,s,r)}static _getLocalSchemaRequest(){return function(t){const r=E(t),n=this.definitions[r];return n?Promise.resolve({schemaId:r,schema:n}):Promise.reject(new e("spec-certification:spec-invalid-local-schema","Schema reference is not a local reference"))}}static async _getRemoteSchemaRequest(t){if(!t)return Promise.reject(new e("spec-certification:spec-missing-base-url","The base url of the remote schema directory must be specified when using a remote schema"));const r=v._getLocalSchemaRequest(),n=(await import("../../request.js")).default;return function(e){return r.call(this,e).catch(()=>n(`${t}/${e}`,{responseType:"json"}).then(t=>(this.definitions[E(e)]=t.data,{schemaId:e,schema:t.data})))}}}const F=Object.keys(t.definitions).map(e=>e.replace(/_schema\.json$/,""));export{I as scan,F as schemaDefinitions};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/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}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{subclass as c}from"../../core/accessorSupport/decorators/subclass.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 b}from"./inputs/support/createBatchFormInputs.js";import{isGroupInput as I,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";let T=class extends i{constructor(e){super(e),this.activeFeatureIndex=-1,this.disabled=!1,this.editType="NA",this.features=new s,this._hasAsyncArcadeExpressions=!1,this.maximumFeatureCountWithComplexForms=50,this.maximumFeatureCount=2e3,this.map=null,this.readOnly=!1,this.spatialReference=null,this.submitHasBeenAttempted=!1,this.timeZone=null,this.userHasChangedValues=!1,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(I(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?b(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())}async _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=await k(t,{arcadeExecutorProvider:this._arcadeExecutorProvider,formTimeZone:this._effectiveTimeZone});this._layerTemplateMap.set(t,r);const i=r.getExpressionExecutorsForLayer(t);if(this._expressionsManager.layerExpressionsModelMap.set(t,new x({preserveFieldValuesWhenHidden:r.preserveFieldValuesWhenHidden,executorMap:i})),!this._hasAsyncArcadeExpressions)for(const t of i.keys()){const e=i.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 r.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=b(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()],T.prototype,"_effectiveTimeZone",null),e([d({readOnly:!0})],T.prototype,"activeFeature",null),e([d()],T.prototype,"activeFeatureIndex",void 0),e([d({readOnly:!0})],T.prototype,"activeForm",null),e([d()],T.prototype,"disabled",void 0),e([d()],T.prototype,"calculating",null),e([d()],T.prototype,"editType",void 0),e([d()],T.prototype,"features",void 0),e([d()],T.prototype,"expressionEvaluationFailed",null),e([d()],T.prototype,"hasNonActiveInvalidFeatures",null),e([d()],T.prototype,"hasAsyncArcadeExpressions",null),e([d()],T.prototype,"_hasAsyncArcadeExpressions",void 0),e([d()],T.prototype,"invalidFeatures",null),e([d()],T.prototype,"hasVisibleInputs",null),e([d()],T.prototype,"hasLayersWithContingentValues",null),e([d()],T.prototype,"maximumFeatureCountWithComplexForms",void 0),e([d()],T.prototype,"maximumFeatureCount",void 0),e([d()],T.prototype,"visibleInputs",null),e([d()],T.prototype,"map",void 0),e([d()],T.prototype,"noVisibleElementsReason",null),e([d()],T.prototype,"readOnly",void 0),e([d()],T.prototype,"spatialReference",void 0),e([d()],T.prototype,"submitHasBeenAttempted",void 0),e([d()],T.prototype,"timeZone",void 0),e([d()],T.prototype,"updating",null),e([d()],T.prototype,"valid",null),e([d()],T.prototype,"layers",null),e([d()],T.prototype,"mode",null),e([d()],T.prototype,"sharedForm",void 0),e([d()],T.prototype,"sharedFormTemplate",void 0),e([d()],T.prototype,"userHasChangedValues",void 0),e([d()],T.prototype,"_arcadeExecutorProvider",void 0),e([d()],T.prototype,"_prepareTask",void 0),e([d()],T.prototype,"_reactiveGraphicLookup",void 0),e([d()],T.prototype,"_layerTemplateMap",void 0),e([d()],T.prototype,"_layerContingentValuesMap",void 0),e([d()],T.prototype,"_workingFeatures",void 0),e([d()],T.prototype,"_expressionsManager",void 0),T=e([c("esri.widgets.BatchAttributeForm.BatchAttributeFormViewModel")],T);const C=T;export{C 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}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{subclass as c}from"../../core/accessorSupport/decorators/subclass.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 b}from"./inputs/support/createBatchFormInputs.js";import{isGroupInput as I,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";let T=class extends i{constructor(e){super(e),this.activeFeatureIndex=-1,this.disabled=!1,this.editType="NA",this.features=new s,this._hasAsyncArcadeExpressions=!1,this.maximumFeatureCountWithComplexForms=50,this.maximumFeatureCount=2e3,this.map=null,this.readOnly=!1,this.spatialReference=null,this.submitHasBeenAttempted=!1,this.timeZone=null,this.userHasChangedValues=!1,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(I(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?b(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=await k(t,{arcadeExecutorProvider:this._arcadeExecutorProvider,formTimeZone:this._effectiveTimeZone});this._layerTemplateMap.set(t,r);const i=r.getExpressionExecutorsForLayer(t);if(this._expressionsManager.layerExpressionsModelMap.set(t,new x({preserveFieldValuesWhenHidden:r.preserveFieldValuesWhenHidden,executorMap:i})),!this._hasAsyncArcadeExpressions)for(const t of i.keys()){const e=i.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 r.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=b(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()],T.prototype,"_effectiveTimeZone",null),e([d({readOnly:!0})],T.prototype,"activeFeature",null),e([d()],T.prototype,"activeFeatureIndex",void 0),e([d({readOnly:!0})],T.prototype,"activeForm",null),e([d()],T.prototype,"disabled",void 0),e([d()],T.prototype,"calculating",null),e([d()],T.prototype,"editType",void 0),e([d()],T.prototype,"features",void 0),e([d()],T.prototype,"expressionEvaluationFailed",null),e([d()],T.prototype,"hasNonActiveInvalidFeatures",null),e([d()],T.prototype,"hasAsyncArcadeExpressions",null),e([d()],T.prototype,"_hasAsyncArcadeExpressions",void 0),e([d()],T.prototype,"invalidFeatures",null),e([d()],T.prototype,"hasVisibleInputs",null),e([d()],T.prototype,"hasLayersWithContingentValues",null),e([d()],T.prototype,"maximumFeatureCountWithComplexForms",void 0),e([d()],T.prototype,"maximumFeatureCount",void 0),e([d()],T.prototype,"visibleInputs",null),e([d()],T.prototype,"map",void 0),e([d()],T.prototype,"noVisibleElementsReason",null),e([d()],T.prototype,"readOnly",void 0),e([d()],T.prototype,"spatialReference",void 0),e([d()],T.prototype,"submitHasBeenAttempted",void 0),e([d()],T.prototype,"timeZone",void 0),e([d()],T.prototype,"updating",null),e([d()],T.prototype,"valid",null),e([d()],T.prototype,"layers",null),e([d()],T.prototype,"mode",null),e([d()],T.prototype,"sharedForm",void 0),e([d()],T.prototype,"sharedFormTemplate",void 0),e([d()],T.prototype,"userHasChangedValues",void 0),e([d()],T.prototype,"_arcadeExecutorProvider",void 0),e([d()],T.prototype,"_prepareTask",void 0),e([d()],T.prototype,"_reactiveGraphicLookup",void 0),e([d()],T.prototype,"_layerTemplateMap",void 0),e([d()],T.prototype,"_layerContingentValuesMap",void 0),e([d()],T.prototype,"_workingFeatures",void 0),e([d()],T.prototype,"_expressionsManager",void 0),T=e([c("esri.widgets.BatchAttributeForm.BatchAttributeFormViewModel")],T);const C=T;export{C as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import"../intl.js";import"../core/has.js";import{getOrCreateMapValue as t}from"../core/MapUtils.js";import{watch as i,on as o}from"../core/reactiveUtils.js";import{property as n}from"../core/accessorSupport/decorators/property.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{subclass as a}from"../core/accessorSupport/decorators/subclass.js";import{isIntegerField as s}from"../layers/support/fieldUtils.js";import{isString as r}from"../support/guards.js";import l from"./Widget.js";import{getHiddenFieldsValidationErrorMessage as d,getVisibleFieldInputValidationErrorMessage as p,isElementTemplateWithInputType as u}from"./BatchAttributeForm/batchAttributeFormUtils.js";import c from"./BatchAttributeForm/BatchAttributeFormViewModel.js";import{css as m}from"./BatchAttributeForm/css.js";import{VisibleElements as h}from"./BatchAttributeForm/VisibleElements.js";import{isGroupInput as v,isFieldInput as b,differentValuesString as f}from"./BatchAttributeForm/inputs/support/inputUtils.js";import{loadCalciteComponents as C}from"./support/componentsUtils.js";import{getLabelForDateFieldValue as g,getIntlOptionsForField as _,prepareISOFieldValueForDateComponents as y,prepareUnixFieldValueForDateComponents as F,normalizeTimeOnlyString as w,getISOFieldValueFromDateComponents as I,getUnixFieldValueFromDateComponents as M}from"./support/dateUtils.js";import{globalCss as x}from"./support/globalCss.js";import{setFocus as k}from"./support/widgetUtils.js";import{messageBundle as O}from"./support/decorators/messageBundle.js";import{vmEvent as T}from"./support/decorators/vmEvent.js";import{tsx as V}from"./support/jsxFactory.js";import{isEmptyValue as D}from"./support/forms/formUtils.js";import{substitute as S}from"../intl/substitute.js";const U="data-element-id";let E=class extends l{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 h,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([i(()=>this.features,()=>{this._dateComponentMap.clear()}),i(()=>this.viewModel.activeForm,()=>{this._batchSwitchInputInitialValues.clear()}),o(()=>this.viewModel,"submit",()=>{this.valid||this.goToClosestError()})])}loadDependencies(){return C({input:()=>import("@esri/calcite-components/dist/components/calcite-input"),block:()=>import("@esri/calcite-components/dist/components/calcite-block"),button:()=>import("@esri/calcite-components/dist/components/calcite-button"),combobox:()=>import("@esri/calcite-components/dist/components/calcite-combobox"),"combobox-item":()=>import("@esri/calcite-components/dist/components/calcite-combobox-item"),"combobox-item-group":()=>import("@esri/calcite-components/dist/components/calcite-combobox-item-group"),dropdown:()=>import("@esri/calcite-components/dist/components/calcite-dropdown"),"dropdown-group":()=>import("@esri/calcite-components/dist/components/calcite-dropdown-group"),"dropdown-item":()=>import("@esri/calcite-components/dist/components/calcite-dropdown-item"),"input-date-picker":()=>import("@esri/calcite-components/dist/components/calcite-input-date-picker"),"input-number":()=>import("@esri/calcite-components/dist/components/calcite-input-number"),"input-time-picker":()=>import("@esri/calcite-components/dist/components/calcite-input-time-picker"),"input-time-zone":()=>import("@esri/calcite-components/dist/components/calcite-input-time-zone"),label:()=>import("@esri/calcite-components/dist/components/calcite-label"),"input-message":()=>import("@esri/calcite-components/dist/components/calcite-input-message"),loader:()=>import("@esri/calcite-components/dist/components/calcite-loader"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice"),switch:()=>import("@esri/calcite-components/dist/components/calcite-switch"),"text-area":()=>import("@esri/calcite-components/dist/components/calcite-text-area"),"radio-button":()=>import("@esri/calcite-components/dist/components/calcite-radio-button"),"radio-button-group":()=>import("@esri/calcite-components/dist/components/calcite-radio-button-group")})}get activeFeatureIndex(){return this.viewModel.activeFeatureIndex}set activeFeatureIndex(e){this.viewModel.activeFeatureIndex=e}get disabled(){return this.viewModel.disabled}set disabled(e){this.viewModel.disabled=e}get _effectiveDisabled(){return this.disabled||this.viewModel.updating}get features(){return this.viewModel.features}set features(e){this.viewModel.features=e}get map(){return this.viewModel.map}set map(e){this.viewModel.map=e}get spatialReference(){return this.viewModel.spatialReference}set spatialReference(e){this.viewModel.spatialReference=e}get timeZone(){return this.viewModel.timeZone}set timeZone(e){this.viewModel.timeZone=e}get icon(){return"edit-attributes"}set icon(e){this._overrideIfSome("icon",e)}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(S(this.messages.formFailedToLoadTooManyComplexFeatures,{num:this.viewModel.maximumFeatureCountWithComplexForms})):this.viewModel.hasTooManyFeatures?this._renderErrorNotice(S(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(m.base,x.widget,x.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:i,elementId:o}=e.dataset,n=t(this._dateComponentMap,`${o}`,()=>({}));switch(i){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(m.base,x.widget,x.panel)},V("calcite-notice",{class:m.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=d(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:m.noticeError,icon:!0,kind:"danger",open:!0},V("div",{slot:"message"},o)):null}_renderContent(){if(!this.viewModel.hasVisibleInputs)return[V("calcite-notice",{class:m.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 v(e)?this._renderGroupInput(e):b(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(m.group,"sequential"===this.groupDisplay?m.groupSequential:null,this.disabled?m.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{label:t,elementId:i}=e.template,{required:o,dataType:n}=e,a=o?S(this.messages.requiredFieldLabel,{name:t}):t;return V("calcite-label",{"aria-label":a,class:m.label,key:`field--${i}`},V("div",{class:m.labelTextContent,key:"labelTextContainer"},t,o?V("span",{"aria-hidden":"true",title:this.messagesCommon.required},"*"):void 0),"unsupported"!==n?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))?p(e,t,this.messages):null;return n?V("calcite-input-message",{icon:!0,status:"invalid"},n):i?V("calcite-input-message",{class:m.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)===f||e.value===f)&&"batch"===this.viewModel.mode){const i={dropdown:{afterCreate:this._afterComponentCreateOrUpdate,afterUpdate:this._afterComponentCreateOrUpdate,disabled:t.readOnly,open:!1,[U]:t[U]},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:f,disabled:!0},...e.codedValueDomainOptions]})}return this._renderSwitchComponent({input:e,props:t})}_renderSwitchComponent({input:e,props:t}){return V("calcite-switch",{...t,checked:!!u(e.template,"switch")&&e.value===e.template.input.onValue,class:m.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===f?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?f:String(i.value),onCalciteComboboxChange:({currentTarget:e})=>{e.value!==f&&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&&D(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:f,selected:!0,textLabel:this.messages.differentValuesPlaceholder,value:f})),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=D(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:m.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:m.placeholderRadio,key:i.label,layout:"inline"},V("calcite-radio-button",{checked:!0,class:m.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:m.inputRadioLabel,key:o.label,layout:"inline"},V("calcite-radio-button",{...o,afterCreate:void 0,afterUpdate:void 0,checked:t,class:m.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):i.input&&"text-area"===i.input.type?V("calcite-text-area",{...t,class:this.classes(m.individualElement),resize:"vertical",value:t.value?String(t.value):"",onCalciteTextAreaInput:({currentTarget:e})=>this._saveInput(e)}):V("calcite-input",{...t,class:this.classes(m.individualElement),type:"text",value:t.value?String(t.value):"",onCalciteInputInput:({currentTarget:e})=>this._saveInput(e)})}_renderNumberComponent(e,t){const i=s(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(m.fieldInput,m.inputDisabled,m.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,g(i,t.value,{timeZone:e.effectiveTimeZone,..._(e.template.field)}))}return e.value===f?[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[U],key:`${o}-date-input`,max:r(a)?a:void 0,min:r(s)?s:void 0,onblur:()=>{this._focusedFieldInput=null},onfocus:this._onComponentFocus,overlayPositioning:"fixed",readOnly:n,value:e.value===f?"":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[U],key:`${o}-time-input`,onblur:()=>{this._focusedFieldInput=null},onfocus:this._onComponentFocus,overlayPositioning:"fixed",readOnly:n,value:e.value===f?"":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=y(a),l=y(s),d=y(e.value===f?"":e.value),p=e.includeTimeOffset,u={afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterComponentCreateOrUpdate,overlayPositioning:"fixed",readOnly:n,[U]:t[U],onfocus:this._onComponentFocus};return V("div",{class:m.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===f||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=F(e.value===f?"":e.value,r),d=F(s,r),p=F(a,r),u=e.includeTime,c={afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterComponentCreateOrUpdate,overlayPositioning:"fixed",readOnly:n,[U]:t[U],onfocus:this._onComponentFocus};return V("div",{class:m.dateInputContainer,key:`${o}-date-time-container`},V("calcite-input-date-picker",{...c,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",{...c,"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,c=!l||this.readOnly,h=!c&&this._effectiveDisabled;let v=t.hint??void 0,b=!1;return o===f&&(v=this.messages.differentValuesPlaceholder,b=!0),{afterCreate:this._afterComponentCreateOrUpdate,afterUpdate:this._afterComponentCreateOrUpdate,"aria-invalid":i?"false":"true",class:this.classes(m.fieldInput,c?m.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:h,readOnly:c,onblur:this._onComponentBlur,required:s,placeholder:v,value:b?"":o??"",[U]:t.elementId,onfocus:this._onComponentFocus}}_onFormSubmit(e){e.preventDefault()}_getFieldInputFromHTMLElement(e){return this.viewModel.findFieldInput(e.getAttribute(U))}_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,k(e))}_onComponentBlur(){this._focusedFieldInput=null}_parseValue(e,t){if(u(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 i=this._getFieldInputFromHTMLElement(e),{elementId:o}=i.template;if(!i)return;const n=i?.value;if(u(i.template,"switch")&&"single"!==this.viewModel.mode){const e=t(this._batchSwitchInputInitialValues,i,()=>i.value);this._batchSwitchInputInitialValues.set(i,null===e?n:e)}const a=this._parseValue(e,i);a!==n&&this.viewModel.setValue(o,a)}async _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===f?void 0:e.value,r=null;"date-only"===o?r=Array.isArray(t.value)?t.value[0]:t.value:"time-only"===o?(s=w(s),r=w(t.value)):r="timestamp-offset"===o?null!=t.value?I({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===f?void 0:n.time}):null,s!==r&&(null!==r&&t.value?this.viewModel.setValue(`${i}`,r):this.viewModel.setValue(`${i}`,null))}};e([n()],E.prototype,"activeFeatureIndex",null),e([n()],E.prototype,"disabled",null),e([n()],E.prototype,"_effectiveDisabled",null),e([n()],E.prototype,"features",null),e([n()],E.prototype,"map",null),e([n()],E.prototype,"spatialReference",null),e([n()],E.prototype,"timeZone",null),e([n()],E.prototype,"headingLevel",void 0),e([n()],E.prototype,"icon",null),e([n(),O("esri/t9n/common")],E.prototype,"messagesCommon",void 0),e([n(),O("esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm")],E.prototype,"messages",void 0),e([n(),O("esri/widgets/FeatureForm/t9n/FeatureForm")],E.prototype,"featureFormMessages",void 0),e([n()],E.prototype,"readOnly",null),e([n()],E.prototype,"valid",null),e([n(),T(["value-change","submit"])],E.prototype,"viewModel",void 0),e([n({type:h,nonNullable:!0})],E.prototype,"visibleElements",void 0),e([n()],E.prototype,"groupDisplay",void 0),E=e([a("esri.widgets.BatchAttributeForm")],E);const R=E;export{R as default};
5
+ import{__decorate as e}from"tslib";import"../intl.js";import"../core/has.js";import{getOrCreateMapValue as t}from"../core/MapUtils.js";import{watch as i,on as o}from"../core/reactiveUtils.js";import{property as n}from"../core/accessorSupport/decorators/property.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{subclass as a}from"../core/accessorSupport/decorators/subclass.js";import{isIntegerField as s}from"../layers/support/fieldUtils.js";import{isString as r}from"../support/guards.js";import l from"./Widget.js";import{getHiddenFieldsValidationErrorMessage as d,getVisibleFieldInputValidationErrorMessage as p,isElementTemplateWithInputType as u}from"./BatchAttributeForm/batchAttributeFormUtils.js";import c from"./BatchAttributeForm/BatchAttributeFormViewModel.js";import{css as m}from"./BatchAttributeForm/css.js";import{VisibleElements as h}from"./BatchAttributeForm/VisibleElements.js";import{isGroupInput as v,isFieldInput as b,differentValuesString as f}from"./BatchAttributeForm/inputs/support/inputUtils.js";import{loadCalciteComponents as C}from"./support/componentsUtils.js";import{getLabelForDateFieldValue as g,getIntlOptionsForField as _,prepareISOFieldValueForDateComponents as y,prepareUnixFieldValueForDateComponents as F,normalizeTimeOnlyString as w,getISOFieldValueFromDateComponents as I,getUnixFieldValueFromDateComponents as M}from"./support/dateUtils.js";import{globalCss as x}from"./support/globalCss.js";import{setFocus as k}from"./support/widgetUtils.js";import{messageBundle as O}from"./support/decorators/messageBundle.js";import{vmEvent as T}from"./support/decorators/vmEvent.js";import{tsx as V}from"./support/jsxFactory.js";import{isEmptyValue as D}from"./support/forms/formUtils.js";import{substitute as S}from"../intl/substitute.js";const U="data-element-id";let E=class extends l{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 h,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([i(()=>this.features,()=>{this._dateComponentMap.clear()}),i(()=>this.viewModel.activeForm,()=>{this._batchSwitchInputInitialValues.clear()}),o(()=>this.viewModel,"submit",()=>{this.valid||this.goToClosestError()})])}loadDependencies(){return C({input:()=>import("@esri/calcite-components/dist/components/calcite-input"),block:()=>import("@esri/calcite-components/dist/components/calcite-block"),button:()=>import("@esri/calcite-components/dist/components/calcite-button"),combobox:()=>import("@esri/calcite-components/dist/components/calcite-combobox"),"combobox-item":()=>import("@esri/calcite-components/dist/components/calcite-combobox-item"),"combobox-item-group":()=>import("@esri/calcite-components/dist/components/calcite-combobox-item-group"),dropdown:()=>import("@esri/calcite-components/dist/components/calcite-dropdown"),"dropdown-group":()=>import("@esri/calcite-components/dist/components/calcite-dropdown-group"),"dropdown-item":()=>import("@esri/calcite-components/dist/components/calcite-dropdown-item"),"input-date-picker":()=>import("@esri/calcite-components/dist/components/calcite-input-date-picker"),"input-number":()=>import("@esri/calcite-components/dist/components/calcite-input-number"),"input-time-picker":()=>import("@esri/calcite-components/dist/components/calcite-input-time-picker"),"input-time-zone":()=>import("@esri/calcite-components/dist/components/calcite-input-time-zone"),label:()=>import("@esri/calcite-components/dist/components/calcite-label"),"input-message":()=>import("@esri/calcite-components/dist/components/calcite-input-message"),loader:()=>import("@esri/calcite-components/dist/components/calcite-loader"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice"),switch:()=>import("@esri/calcite-components/dist/components/calcite-switch"),"text-area":()=>import("@esri/calcite-components/dist/components/calcite-text-area"),"radio-button":()=>import("@esri/calcite-components/dist/components/calcite-radio-button"),"radio-button-group":()=>import("@esri/calcite-components/dist/components/calcite-radio-button-group")})}get activeFeatureIndex(){return this.viewModel.activeFeatureIndex}set activeFeatureIndex(e){this.viewModel.activeFeatureIndex=e}get disabled(){return this.viewModel.disabled}set disabled(e){this.viewModel.disabled=e}get _effectiveDisabled(){return this.disabled||this.viewModel.updating}get features(){return this.viewModel.features}set features(e){this.viewModel.features=e}get map(){return this.viewModel.map}set map(e){this.viewModel.map=e}get spatialReference(){return this.viewModel.spatialReference}set spatialReference(e){this.viewModel.spatialReference=e}get timeZone(){return this.viewModel.timeZone}set timeZone(e){this.viewModel.timeZone=e}get icon(){return"edit-attributes"}set icon(e){this._overrideIfSome("icon",e)}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(S(this.messages.formFailedToLoadTooManyComplexFeatures,{num:this.viewModel.maximumFeatureCountWithComplexForms})):this.viewModel.hasTooManyFeatures?this._renderErrorNotice(S(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(m.base,x.widget,x.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:i,elementId:o}=e.dataset,n=t(this._dateComponentMap,`${o}`,()=>({}));switch(i){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(m.base,x.widget,x.panel)},V("calcite-notice",{class:m.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=d(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:m.noticeError,icon:!0,kind:"danger",open:!0},V("div",{slot:"message"},o)):null}_renderContent(){if(!this.viewModel.hasVisibleInputs)return[V("calcite-notice",{class:m.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 v(e)?this._renderGroupInput(e):b(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(m.group,"sequential"===this.groupDisplay?m.groupSequential:null,this.disabled?m.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{label:t,elementId:i}=e.template,{required:o,dataType:n}=e,a=o?S(this.messages.requiredFieldLabel,{name:t}):t;return V("calcite-label",{"aria-label":a,class:m.label,key:`field--${i}`},V("div",{class:m.labelTextContent,key:"labelTextContainer"},t,o?V("span",{"aria-hidden":"true",title:this.messagesCommon.required},"*"):void 0),"unsupported"!==n?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))?p(e,t,this.messages):null;return n?V("calcite-input-message",{icon:!0,status:"invalid"},n):i?V("calcite-input-message",{class:m.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)===f||e.value===f)&&"batch"===this.viewModel.mode){const i={dropdown:{afterCreate:this._afterComponentCreateOrUpdate,afterUpdate:this._afterComponentCreateOrUpdate,disabled:t.readOnly,open:!1,[U]:t[U]},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:f,disabled:!0},...e.codedValueDomainOptions]})}return this._renderSwitchComponent({input:e,props:t})}_renderSwitchComponent({input:e,props:t}){return V("calcite-switch",{...t,checked:!!u(e.template,"switch")&&e.value===e.template.input.onValue,class:m.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===f?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?f:String(i.value),onCalciteComboboxChange:({currentTarget:e})=>{e.value!==f&&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&&D(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:f,selected:!0,textLabel:this.messages.differentValuesPlaceholder,value:f})),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=D(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:m.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:m.placeholderRadio,key:i.label,layout:"inline"},V("calcite-radio-button",{checked:!0,class:m.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:m.inputRadioLabel,key:o.label,layout:"inline"},V("calcite-radio-button",{...o,afterCreate:void 0,afterUpdate:void 0,checked:t,class:m.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):i.input&&"text-area"===i.input.type?V("calcite-text-area",{...t,class:this.classes(m.individualElement),resize:"vertical",value:t.value?String(t.value):"",onCalciteTextAreaInput:({currentTarget:e})=>this._saveInput(e)}):V("calcite-input",{...t,class:this.classes(m.individualElement),type:"text",value:t.value?String(t.value):"",onCalciteInputInput:({currentTarget:e})=>this._saveInput(e)})}_renderNumberComponent(e,t){const i=s(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(m.fieldInput,m.inputDisabled,m.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,g(i,t.value,{timeZone:e.effectiveTimeZone,..._(e.template.field)}))}return e.value===f?[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[U],key:`${o}-date-input`,max:r(a)?a:void 0,min:r(s)?s:void 0,onblur:()=>{this._focusedFieldInput=null},onfocus:this._onComponentFocus,overlayPositioning:"fixed",readOnly:n,value:e.value===f?"":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[U],key:`${o}-time-input`,onblur:()=>{this._focusedFieldInput=null},onfocus:this._onComponentFocus,overlayPositioning:"fixed",readOnly:n,value:e.value===f?"":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=y(a),l=y(s),d=y(e.value===f?"":e.value),p=e.includeTimeOffset,u={afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterComponentCreateOrUpdate,overlayPositioning:"fixed",readOnly:n,[U]:t[U],onfocus:this._onComponentFocus};return V("div",{class:m.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===f||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=F(e.value===f?"":e.value,r),d=F(s,r),p=F(a,r),u=e.includeTime,c={afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterComponentCreateOrUpdate,overlayPositioning:"fixed",readOnly:n,[U]:t[U],onfocus:this._onComponentFocus};return V("div",{class:m.dateInputContainer,key:`${o}-date-time-container`},V("calcite-input-date-picker",{...c,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",{...c,"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,c=!l||this.readOnly,h=!c&&this._effectiveDisabled;let v=t.hint??void 0,b=!1;return o===f&&(v=this.messages.differentValuesPlaceholder,b=!0),{afterCreate:this._afterComponentCreateOrUpdate,afterUpdate:this._afterComponentCreateOrUpdate,"aria-invalid":i?"false":"true",class:this.classes(m.fieldInput,c?m.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:h,readOnly:c,onblur:this._onComponentBlur,required:s,placeholder:v,value:b?"":o??"",[U]:t.elementId,onfocus:this._onComponentFocus}}_onFormSubmit(e){e.preventDefault()}_getFieldInputFromHTMLElement(e){return this.viewModel.findFieldInput(e.getAttribute(U))}_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,k(e))}_onComponentBlur(){this._focusedFieldInput=null}_parseValue(e,t){if(u(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 i=this._getFieldInputFromHTMLElement(e),{elementId:o}=i.template;if(!i)return;const n=i?.value;if(u(i.template,"switch")&&"single"!==this.viewModel.mode){const e=t(this._batchSwitchInputInitialValues,i,()=>i.value);this._batchSwitchInputInitialValues.set(i,null===e?n:e)}const a=this._parseValue(e,i);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===f?void 0:e.value,r=null;"date-only"===o?r=Array.isArray(t.value)?t.value[0]:t.value:"time-only"===o?(s=w(s),r=w(t.value)):r="timestamp-offset"===o?null!=t.value?I({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===f?void 0:n.time}):null,s!==r&&(null!==r&&t.value?this.viewModel.setValue(`${i}`,r):this.viewModel.setValue(`${i}`,null))}};e([n()],E.prototype,"activeFeatureIndex",null),e([n()],E.prototype,"disabled",null),e([n()],E.prototype,"_effectiveDisabled",null),e([n()],E.prototype,"features",null),e([n()],E.prototype,"map",null),e([n()],E.prototype,"spatialReference",null),e([n()],E.prototype,"timeZone",null),e([n()],E.prototype,"headingLevel",void 0),e([n()],E.prototype,"icon",null),e([n(),O("esri/t9n/common")],E.prototype,"messagesCommon",void 0),e([n(),O("esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm")],E.prototype,"messages",void 0),e([n(),O("esri/widgets/FeatureForm/t9n/FeatureForm")],E.prototype,"featureFormMessages",void 0),e([n()],E.prototype,"readOnly",null),e([n()],E.prototype,"valid",null),e([n(),T(["value-change","submit"])],E.prototype,"viewModel",void 0),e([n({type:h,nonNullable:!0})],E.prototype,"visibleElements",void 0),e([n()],E.prototype,"groupDisplay",void 0),E=e([a("esri.widgets.BatchAttributeForm")],E);const R=E;export{R as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../core/Collection.js";import{IdentifiableMixin as o}from"../core/Identifiable.js";import i from"../core/ReactiveMap.js";import{on as s,watch as l,initial as r}from"../core/reactiveUtils.js";import{property as a}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{subclass as n}from"../core/accessorSupport/decorators/subclass.js";import p from"./Widget.js";import d from"./CatalogLayerList/CatalogLayerListViewModel.js";import c from"./CatalogLayerList/CatalogLayerListVisibleElements.js";import{css as m}from"./CatalogLayerList/css.js";import h from"./LayerList/LayerListItem.js";import y from"./LayerList/ListItem.js";import{minFilterItems as u,getItem as g,removeDestroyedListItems as L,setFilterPredicate as f}from"./LayerList/support/layerListUtils.js";import{loadCalciteComponents as _}from"./support/componentsUtils.js";import{globalCss as v}from"./support/globalCss.js";import{calciteListFilterProps as I}from"./support/listUtils.js";import{setFocus as w}from"./support/widgetUtils.js";import{messageBundle as b}from"./support/decorators/messageBundle.js";import{vmEvent as C}from"./support/decorators/vmEvent.js";import{tsx as F}from"./support/jsxFactory.js";var M;const O=t.ofType(y),T="nested";let P=M=class extends(o(p)){constructor(e,o){super(e,o),this._rootListEl=null,this._activeItem=null,this._tooltipReferenceMap=new i,this._focusRootFlowItem=!1,this._focusPanelFlowItem=!1,this._focusLayerFlowItem=null,this._layerListMap=new i,this._rootGroupUid=`operational-${this.uid}`,this._openedLayersController=null,this.catalogLayerList=null,this.catalogOptions=null,this.collapsed=!1,this.filterPlaceholder="",this.filterPredicate=null,this.filterText="",this.headingLevel=2,this.knowledgeGraphOptions=null,this.layerTablesEnabled=new t(["knowledge-graph"]),this.mapImageOptions=null,this.messages=null,this.messagesCommon=null,this.minFilterItems=u,this.openedLayers=new t,this.openedLayerLists=new t,this.selectedItems=new O,this.selectionMode="none",this.tableList=null,this.tileOptions=null,this.viewModel=new d,this.visibilityAppearance="default",this.visibleElements=new c,this._onTablesOpen=e=>{this.onTablesOpen?this.onTablesOpen(e):(this.openedLayers.push(e.layer),this._focusLayerFlowItem=e.layer?.uid)},this._onCatalogOpen=e=>{this.onCatalogOpen?this.onCatalogOpen(e):(this.openedLayers.push(e.layer?.parent),this._focusLayerFlowItem=e.layer?.uid)},this._onPanelOpen=()=>{this._focusPanelFlowItem=!0},this._onTooltipReferenceChange=(e,t)=>{t?this._tooltipReferenceMap.set(e,t):this._tooltipReferenceMap.delete(e)},this._onTriggerAction=(e,t)=>{this.triggerAction(e,t)},this._clearActiveItem=()=>{this._activeItem=null},this._setActiveItem=e=>{if("default"!==this.visibilityAppearance)return;const t=Array.from(e.composedPath()).find(e=>e.classList?.contains(m.item));this._activeItem=g(t)}}initialize(){this.addHandles([s(()=>this.openedLayers,"change",()=>this._handleOpenedLayersChange(),r),s(()=>this.viewModel.catalogItems,"change",()=>L(this.selectedItems),r),l(()=>[this.filterPredicate,this._rootListEl],()=>f(this._rootListEl,this.filterPredicate))])}loadDependencies(){return _({button:()=>import("@esri/calcite-components/dist/components/calcite-button"),flow:()=>import("@esri/calcite-components/dist/components/calcite-flow"),"flow-item":()=>import("@esri/calcite-components/dist/components/calcite-flow-item"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice"),tooltip:()=>import("@esri/calcite-components/dist/components/calcite-tooltip")})}destroy(){this._destroyOpenedLayerLists(),this._tooltipReferenceMap.clear()}get _filterEnabled(){return this.viewModel.totalItems>=this.minFilterItems&&this.visibleElements.filter}get _visibleItems(){return this.catalogItems?.filter(e=>!e.hidden&&(this.visibleElements.errors||!e.error))}get _openedPanelItems(){return this._visibleItems.flatten(e=>e.children).filter(({hidden:e,panel:t})=>!e&&t?.open&&!t.disabled&&t.flowEnabled)}get _renderedOpenLayerFlowItems(){const{openedLayers:e}=this;return e.toArray().map((t,o)=>this._renderLayerFlowItem(t,o===e.length-1))}get catalogItems(){return this.viewModel.catalogItems}set catalogItems(e){this.viewModel.catalogItems=e}get catalogLayer(){return this.viewModel.catalogLayer}set catalogLayer(e){this.viewModel.catalogLayer=e}get icon(){return"catalog-dataset"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get listItemCreatedFunction(){return this.viewModel.listItemCreatedFunction}set listItemCreatedFunction(e){this.viewModel.listItemCreatedFunction=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}triggerAction(e,t){return this.viewModel.triggerAction(e,t)}render(){const e=this.viewModel?.state,t={[v.hidden]:"loading"===e,[v.disabled]:"disabled"===e};return F("div",{class:this.classes(m.base,v.widget,v.panel,t)},this._renderItemTooltips(),this._renderItems())}async _createFlowList(e,t){const{_layerListMap:o}=this,i=o.get(e);if(i)return i;const s="catalog"===e.type?await this._createCatalogLayerList(e):await this._createTableList(e);return t.aborted||o.set(e,s),s}async _handleOpenedLayersChange(){const{_layerListMap:e,openedLayers:t,openedLayerLists:o}=this;this._openedLayersController?.abort();const i=new AbortController,{signal:s}=i;this._openedLayersController=i,e.forEach((o,i)=>{t.includes(i)||(o.destroy(),e.delete(i))});const l=await Promise.all(t.map(e=>this._createFlowList(e,s)));if(s.aborted)return;o.removeAll(),o.addMany(l);const r=o.at(-1);r?"catalogLayer"in r?(this._set("catalogLayerList",r),this._set("tableList",null)):(this._set("catalogLayerList",null),this._set("tableList",r)):(this._set("catalogLayerList",null),this._set("tableList",null))}_destroyOpenedLayerLists(){this.openedLayerLists.destroyAll(),this.openedLayers.removeAll(),this._layerListMap.forEach(e=>e.destroy()),this._layerListMap.clear()}_renderItemTooltip(e){const{_tooltipReferenceMap:t,messages:o}=this;return e?.layer?F("calcite-tooltip",{key:`tooltip-${e.layer.uid}`,overlayPositioning:"fixed",referenceElement:t.get(e.layer.uid)},o.layerIncompatibleTooltip):null}_renderItemTooltipNodes(e){return e.incompatible?this._renderItemTooltip(e):e.children?.filter(e=>!e.hidden).toArray().map(e=>this._renderItemTooltipNodes(e))}_renderItemTooltips(){return this._visibleItems?.toArray().map(e=>this._renderItemTooltipNodes(e))}_renderNoItemsMessage(){return F("div",{slot:"message"},this.messages.noItemsToDisplay)}_renderNoItems(){return F("div",{class:m.itemMessage,key:"esri-layer-list__no-items"},F("calcite-notice",{icon:"information",kind:"info",open:!0,width:"full"},this._renderNoItemsMessage()))}_renderPanelFlowItems(){const{_openedPanelItems:e,openedLayers:t}=this;return e.toArray().map(({title:o,panel:i},s)=>{const l=()=>this._handlePanelFlowItemBack(i);return F("calcite-flow-item",{afterCreate:this._focusPanelFlowItemNode,afterUpdate:this._focusPanelFlowItemNode,bind:this,description:o,heading:i.title,headingLevel:this.headingLevel,key:`flow-panel-${i.uid}`,selected:!t.length&&s===e.length-1,onCalciteFlowItemBack:e=>{e.preventDefault(),l()}},i.render(),F("calcite-button",{appearance:"transparent",onclick:l,slot:"footer-actions",width:"full"},this.messagesCommon.back))})}_handlePanelFlowItemBack(e){e.open=!1,this._focusRootFlowItem=!0}_focusRootFlowItemNode(e){this._focusRootFlowItem&&(this._focusRootFlowItem=!1,w(e))}_focusPanelFlowItemNode(e){this._focusPanelFlowItem&&(this._focusPanelFlowItem=!1,w(e))}_renderItems(){const{visible:e,collapsed:t,_visibleItems:o,_filterEnabled:i,_rootGroupUid:s,visibleElements:{closeButton:l,collapseButton:r,heading:a,flow:n},selectionMode:p,filterText:d,filterPlaceholder:c,messages:h,openedLayers:y,_openedPanelItems:u}=this,g=[F("calcite-flow-item",{afterCreate:this._focusRootFlowItemNode,afterUpdate:this._focusRootFlowItemNode,bind:this,closable:l,closed:!e,collapsed:t,collapsible:r,heading:a?h.widgetLabel:void 0,headingLevel:this.headingLevel,key:"root-flow-item",selected:!y.length&&!u.length,onCalciteFlowItemClose:()=>this.visible=!1},o?.length?null:this._renderNoItems(),F("calcite-list",{afterCreate:e=>{this._rootListEl=e,e.addEventListener("focusin",this._setActiveItem),e.addEventListener("focusout",this._clearActiveItem)},afterRemoved:e=>{this._rootListEl=null,e.removeEventListener("focusin",this._setActiveItem),e.removeEventListener("focusout",this._clearActiveItem)},"data-layer-type":s,displayMode:T,filterEnabled:i,filterPlaceholder:c,filterProps:I,filterText:i?d:"",group:s,key:"root-list",label:h.widgetLabel,onmouseleave:this._clearActiveItem,onmouseover:this._setActiveItem,selectionAppearance:"border",selectionMode:p,onCalciteListChange:e=>this._handleCalciteListChange(e),onCalciteListFilter:e=>this.filterText=e.currentTarget?.filterText??""},o.toArray().map(e=>this._renderItem(e)),i?F("div",{class:m.filterNoResults,slot:"filter-no-results"},F("calcite-notice",{kind:"info",open:!0,width:"full"},this._renderNoItemsMessage())):null)),this._renderPanelFlowItems(),this._renderedOpenLayerFlowItems];return e?n?F("calcite-flow",{key:"root-flow"},g):g:null}_focusLayerFlowItemNode(e){this._focusLayerFlowItem===e.dataset.layerUid&&(this._focusLayerFlowItem=null,w(e))}_renderLayerFlowItem(e,t){const{messages:o,openedLayers:i}=this,s=e.title||this.messages.untitledLayer;return F("calcite-flow-item",{afterCreate:this._focusLayerFlowItemNode,afterUpdate:this._focusLayerFlowItemNode,bind:this,"data-layer-uid":e.uid,description:s,heading:o["catalog"===e.type?"catalogLayers":"tables"],headingLevel:this.headingLevel,key:`flow-layer-list-${e.uid}`,selected:t,onCalciteFlowItemBack:e=>{e.preventDefault(),i.pop();const t=i.at(-1);t?this._focusLayerFlowItem=t.uid:this._focusRootFlowItem=!0}},this._layerListMap.get(e)?.render())}async _createCatalogLayerList(e){const{headingLevel:t,catalogOptions:o,view:i,filterPlaceholder:s,listItemCreatedFunction:l,minFilterItems:r,selectionMode:a,visibilityAppearance:n,onCatalogOpen:p,onTablesOpen:d}=this;return new M({headingLevel:t,view:i,filterPlaceholder:s,listItemCreatedFunction:l,minFilterItems:r,selectionMode:a,visibilityAppearance:n,...o,catalogLayer:e,onCatalogOpen:p,onTablesOpen:d})}_getTableListParams(e){switch(e.type){case"knowledge-graph":return{...this.knowledgeGraphOptions,tables:e.tables};case"map-image":return{...this.mapImageOptions,tables:e.subtables};case"tile":return{...this.tileOptions,tables:e.subtables};default:return null}}async _createTableList(e){const{default:t}=await import("./TableList.js"),{headingLevel:o,selectionMode:i}=this;return new t({headingLevel:o,selectionMode:i,...this._getTableListParams(e)})}_renderItem(e,t,o){return F(h,{activeItem:this._activeItem,css:m,displayMode:T,dragEnabled:!1,item:e,key:`layerListItem-${e.layer?.uid}`,layerTablesEnabled:this.layerTablesEnabled,listModeDisabled:this.viewModel.listModeDisabled,messages:this.messages,messagesCommon:this.messagesCommon,parent:t,parentTitles:o,rootGroupUid:this._rootGroupUid,selectedItems:this.selectedItems,selectionMode:this.selectionMode,visibilityAppearance:this.visibilityAppearance,visibleElements:this.visibleElements,onAction:this._onTriggerAction,onCatalogOpen:this._onCatalogOpen,onPanelOpen:this._onPanelOpen,onTablesOpen:this._onTablesOpen,onTooltipReferenceChange:this._onTooltipReferenceChange})}_handleCalciteListChange(e){const{selectionMode:t,selectedItems:o}=this;if("none"===t)return;const i=e.target.selectedItems.map(e=>g(e)).filter(Boolean);o.removeAll(),o.addMany(i)}};e([a()],P.prototype,"_rootListEl",void 0),e([a()],P.prototype,"_activeItem",void 0),e([a()],P.prototype,"_tooltipReferenceMap",void 0),e([a()],P.prototype,"_focusRootFlowItem",void 0),e([a()],P.prototype,"_focusPanelFlowItem",void 0),e([a()],P.prototype,"_focusLayerFlowItem",void 0),e([a()],P.prototype,"_layerListMap",void 0),e([a()],P.prototype,"_filterEnabled",null),e([a()],P.prototype,"_visibleItems",null),e([a()],P.prototype,"_openedPanelItems",null),e([a()],P.prototype,"_renderedOpenLayerFlowItems",null),e([a()],P.prototype,"catalogItems",null),e([a()],P.prototype,"catalogLayer",null),e([a({readOnly:!0})],P.prototype,"catalogLayerList",void 0),e([a()],P.prototype,"catalogOptions",void 0),e([a()],P.prototype,"collapsed",void 0),e([a()],P.prototype,"filterPlaceholder",void 0),e([a()],P.prototype,"filterPredicate",void 0),e([a()],P.prototype,"filterText",void 0),e([a()],P.prototype,"headingLevel",void 0),e([a()],P.prototype,"icon",null),e([a()],P.prototype,"knowledgeGraphOptions",void 0),e([a()],P.prototype,"label",null),e([a()],P.prototype,"layerTablesEnabled",void 0),e([a()],P.prototype,"listItemCreatedFunction",null),e([a()],P.prototype,"mapImageOptions",void 0),e([a(),b("esri/widgets/CatalogLayerList/t9n/CatalogLayerList")],P.prototype,"messages",void 0),e([a(),b("esri/t9n/common")],P.prototype,"messagesCommon",void 0),e([a()],P.prototype,"minFilterItems",void 0),e([a({readOnly:!0})],P.prototype,"openedLayers",void 0),e([a({readOnly:!0})],P.prototype,"openedLayerLists",void 0),e([a()],P.prototype,"onCatalogOpen",void 0),e([a()],P.prototype,"onTablesOpen",void 0),e([a({type:O})],P.prototype,"selectedItems",void 0),e([a()],P.prototype,"selectionMode",void 0),e([a({readOnly:!0})],P.prototype,"tableList",void 0),e([a()],P.prototype,"tileOptions",void 0),e([a()],P.prototype,"view",null),e([C("trigger-action"),a({type:d})],P.prototype,"viewModel",void 0),e([a()],P.prototype,"visibilityAppearance",void 0),e([a({type:c,nonNullable:!0})],P.prototype,"visibleElements",void 0),P=M=e([n("esri.widgets.CatalogLayerList")],P);const A=P;export{A as default};
5
+ import{__decorate as e}from"tslib";import t from"../core/Collection.js";import{IdentifiableMixin as o}from"../core/Identifiable.js";import i from"../core/ReactiveMap.js";import{on as s,watch as l,initial as r}from"../core/reactiveUtils.js";import{property as a}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{subclass as n}from"../core/accessorSupport/decorators/subclass.js";import p from"./Widget.js";import d from"./CatalogLayerList/CatalogLayerListViewModel.js";import c from"./CatalogLayerList/CatalogLayerListVisibleElements.js";import{css as m}from"./CatalogLayerList/css.js";import h from"./LayerList/LayerListItem.js";import y from"./LayerList/ListItem.js";import{minFilterItems as u,getItem as g,removeDestroyedListItems as L,setFilterPredicate as f}from"./LayerList/support/layerListUtils.js";import{loadCalciteComponents as _}from"./support/componentsUtils.js";import{globalCss as v}from"./support/globalCss.js";import{calciteListFilterProps as I}from"./support/listUtils.js";import{setFocus as w}from"./support/widgetUtils.js";import{messageBundle as b}from"./support/decorators/messageBundle.js";import{vmEvent as C}from"./support/decorators/vmEvent.js";import{tsx as F}from"./support/jsxFactory.js";var M;const O=t.ofType(y),T="nested";let P=M=class extends(o(p)){constructor(e,o){super(e,o),this._rootListEl=null,this._activeItem=null,this._tooltipReferenceMap=new i,this._focusRootFlowItem=!1,this._focusPanelFlowItem=!1,this._focusLayerFlowItem=null,this._layerListMap=new i,this._rootGroupUid=`operational-${this.uid}`,this._openedLayersController=null,this.catalogLayerList=null,this.catalogOptions=null,this.collapsed=!1,this.filterPlaceholder="",this.filterPredicate=null,this.filterText="",this.headingLevel=2,this.knowledgeGraphOptions=null,this.layerTablesEnabled=new t(["knowledge-graph"]),this.mapImageOptions=null,this.messages=null,this.messagesCommon=null,this.minFilterItems=u,this.openedLayers=new t,this.openedLayerLists=new t,this.selectedItems=new O,this.selectionMode="none",this.tableList=null,this.tileOptions=null,this.viewModel=new d,this.visibilityAppearance="default",this.visibleElements=new c,this._onTablesOpen=e=>{this.onTablesOpen?this.onTablesOpen(e):(this.openedLayers.push(e.layer),this._focusLayerFlowItem=e.layer?.uid)},this._onCatalogOpen=e=>{this.onCatalogOpen?this.onCatalogOpen(e):(this.openedLayers.push(e.layer?.parent),this._focusLayerFlowItem=e.layer?.uid)},this._onPanelOpen=()=>{this._focusPanelFlowItem=!0},this._onTooltipReferenceChange=(e,t)=>{t?this._tooltipReferenceMap.set(e,t):this._tooltipReferenceMap.delete(e)},this._onTriggerAction=(e,t)=>{this.triggerAction(e,t)},this._clearActiveItem=()=>{this._activeItem=null},this._setActiveItem=e=>{if("default"!==this.visibilityAppearance)return;const t=Array.from(e.composedPath()).find(e=>e.classList?.contains(m.item));this._activeItem=g(t)}}initialize(){this.addHandles([s(()=>this.openedLayers,"change",()=>this._handleOpenedLayersChange(),r),s(()=>this.viewModel.catalogItems,"change",()=>L(this.selectedItems),r),l(()=>[this.filterPredicate,this._rootListEl],()=>f(this._rootListEl,this.filterPredicate))])}loadDependencies(){return _({button:()=>import("@esri/calcite-components/dist/components/calcite-button"),flow:()=>import("@esri/calcite-components/dist/components/calcite-flow"),"flow-item":()=>import("@esri/calcite-components/dist/components/calcite-flow-item"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice"),tooltip:()=>import("@esri/calcite-components/dist/components/calcite-tooltip")})}destroy(){this._destroyOpenedLayerLists(),this._tooltipReferenceMap.clear()}get _filterEnabled(){return this.viewModel.totalItems>=this.minFilterItems&&this.visibleElements.filter}get _visibleItems(){return this.catalogItems?.filter(e=>!e.hidden&&(this.visibleElements.errors||!e.error))}get _openedPanelItems(){return this._visibleItems.flatten(e=>e.children).filter(({hidden:e,panel:t})=>!e&&t?.open&&!t.disabled&&t.flowEnabled)}get _renderedOpenLayerFlowItems(){const{openedLayers:e}=this;return e.toArray().map((t,o)=>this._renderLayerFlowItem(t,o===e.length-1))}get catalogItems(){return this.viewModel.catalogItems}set catalogItems(e){this.viewModel.catalogItems=e}get catalogLayer(){return this.viewModel.catalogLayer}set catalogLayer(e){this.viewModel.catalogLayer=e}get icon(){return"catalog-dataset"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get listItemCreatedFunction(){return this.viewModel.listItemCreatedFunction}set listItemCreatedFunction(e){this.viewModel.listItemCreatedFunction=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}triggerAction(e,t){return this.viewModel.triggerAction(e,t)}render(){const e=this.viewModel?.state,t={[v.hidden]:"loading"===e,[v.disabled]:"disabled"===e};return F("div",{class:this.classes(m.base,v.widget,v.panel,t)},this._renderItemTooltips(),this._renderItems())}async _createFlowList(e,t){const{_layerListMap:o}=this,i=o.get(e);if(i)return i;const s="catalog"===e.type?this._createCatalogLayerList(e):await this._createTableList(e);return t.aborted||o.set(e,s),s}async _handleOpenedLayersChange(){const{_layerListMap:e,openedLayers:t,openedLayerLists:o}=this;this._openedLayersController?.abort();const i=new AbortController,{signal:s}=i;this._openedLayersController=i,e.forEach((o,i)=>{t.includes(i)||(o.destroy(),e.delete(i))});const l=await Promise.all(t.map(e=>this._createFlowList(e,s)));if(s.aborted)return;o.removeAll(),o.addMany(l);const r=o.at(-1);r?"catalogLayer"in r?(this._set("catalogLayerList",r),this._set("tableList",null)):(this._set("catalogLayerList",null),this._set("tableList",r)):(this._set("catalogLayerList",null),this._set("tableList",null))}_destroyOpenedLayerLists(){this.openedLayerLists.destroyAll(),this.openedLayers.removeAll(),this._layerListMap.forEach(e=>e.destroy()),this._layerListMap.clear()}_renderItemTooltip(e){const{_tooltipReferenceMap:t,messages:o}=this;return e?.layer?F("calcite-tooltip",{key:`tooltip-${e.layer.uid}`,overlayPositioning:"fixed",referenceElement:t.get(e.layer.uid)},o.layerIncompatibleTooltip):null}_renderItemTooltipNodes(e){return e.incompatible?this._renderItemTooltip(e):e.children?.filter(e=>!e.hidden).toArray().map(e=>this._renderItemTooltipNodes(e))}_renderItemTooltips(){return this._visibleItems?.toArray().map(e=>this._renderItemTooltipNodes(e))}_renderNoItemsMessage(){return F("div",{slot:"message"},this.messages.noItemsToDisplay)}_renderNoItems(){return F("div",{class:m.itemMessage,key:"esri-layer-list__no-items"},F("calcite-notice",{icon:"information",kind:"info",open:!0,width:"full"},this._renderNoItemsMessage()))}_renderPanelFlowItems(){const{_openedPanelItems:e,openedLayers:t}=this;return e.toArray().map(({title:o,panel:i},s)=>{const l=()=>this._handlePanelFlowItemBack(i);return F("calcite-flow-item",{afterCreate:this._focusPanelFlowItemNode,afterUpdate:this._focusPanelFlowItemNode,bind:this,description:o,heading:i.title,headingLevel:this.headingLevel,key:`flow-panel-${i.uid}`,selected:!t.length&&s===e.length-1,onCalciteFlowItemBack:e=>{e.preventDefault(),l()}},i.render(),F("calcite-button",{appearance:"transparent",onclick:l,slot:"footer-actions",width:"full"},this.messagesCommon.back))})}_handlePanelFlowItemBack(e){e.open=!1,this._focusRootFlowItem=!0}_focusRootFlowItemNode(e){this._focusRootFlowItem&&(this._focusRootFlowItem=!1,w(e))}_focusPanelFlowItemNode(e){this._focusPanelFlowItem&&(this._focusPanelFlowItem=!1,w(e))}_renderItems(){const{visible:e,collapsed:t,_visibleItems:o,_filterEnabled:i,_rootGroupUid:s,visibleElements:{closeButton:l,collapseButton:r,heading:a,flow:n},selectionMode:p,filterText:d,filterPlaceholder:c,messages:h,openedLayers:y,_openedPanelItems:u}=this,g=[F("calcite-flow-item",{afterCreate:this._focusRootFlowItemNode,afterUpdate:this._focusRootFlowItemNode,bind:this,closable:l,closed:!e,collapsed:t,collapsible:r,heading:a?h.widgetLabel:void 0,headingLevel:this.headingLevel,key:"root-flow-item",selected:!y.length&&!u.length,onCalciteFlowItemClose:()=>this.visible=!1},o?.length?null:this._renderNoItems(),F("calcite-list",{afterCreate:e=>{this._rootListEl=e,e.addEventListener("focusin",this._setActiveItem),e.addEventListener("focusout",this._clearActiveItem)},afterRemoved:e=>{this._rootListEl=null,e.removeEventListener("focusin",this._setActiveItem),e.removeEventListener("focusout",this._clearActiveItem)},"data-layer-type":s,displayMode:T,filterEnabled:i,filterPlaceholder:c,filterProps:I,filterText:i?d:"",group:s,key:"root-list",label:h.widgetLabel,onmouseleave:this._clearActiveItem,onmouseover:this._setActiveItem,selectionAppearance:"border",selectionMode:p,onCalciteListChange:e=>this._handleCalciteListChange(e),onCalciteListFilter:e=>this.filterText=e.currentTarget?.filterText??""},o.toArray().map(e=>this._renderItem(e)),i?F("div",{class:m.filterNoResults,slot:"filter-no-results"},F("calcite-notice",{kind:"info",open:!0,width:"full"},this._renderNoItemsMessage())):null)),this._renderPanelFlowItems(),this._renderedOpenLayerFlowItems];return e?n?F("calcite-flow",{key:"root-flow"},g):g:null}_focusLayerFlowItemNode(e){this._focusLayerFlowItem===e.dataset.layerUid&&(this._focusLayerFlowItem=null,w(e))}_renderLayerFlowItem(e,t){const{messages:o,openedLayers:i}=this,s=e.title||this.messages.untitledLayer;return F("calcite-flow-item",{afterCreate:this._focusLayerFlowItemNode,afterUpdate:this._focusLayerFlowItemNode,bind:this,"data-layer-uid":e.uid,description:s,heading:o["catalog"===e.type?"catalogLayers":"tables"],headingLevel:this.headingLevel,key:`flow-layer-list-${e.uid}`,selected:t,onCalciteFlowItemBack:e=>{e.preventDefault(),i.pop();const t=i.at(-1);t?this._focusLayerFlowItem=t.uid:this._focusRootFlowItem=!0}},this._layerListMap.get(e)?.render())}_createCatalogLayerList(e){const{headingLevel:t,catalogOptions:o,view:i,filterPlaceholder:s,listItemCreatedFunction:l,minFilterItems:r,selectionMode:a,visibilityAppearance:n,onCatalogOpen:p,onTablesOpen:d}=this;return new M({headingLevel:t,view:i,filterPlaceholder:s,listItemCreatedFunction:l,minFilterItems:r,selectionMode:a,visibilityAppearance:n,...o,catalogLayer:e,onCatalogOpen:p,onTablesOpen:d})}_getTableListParams(e){switch(e.type){case"knowledge-graph":return{...this.knowledgeGraphOptions,tables:e.tables};case"map-image":return{...this.mapImageOptions,tables:e.subtables};case"tile":return{...this.tileOptions,tables:e.subtables};default:return null}}async _createTableList(e){const{default:t}=await import("./TableList.js"),{headingLevel:o,selectionMode:i}=this;return new t({headingLevel:o,selectionMode:i,...this._getTableListParams(e)})}_renderItem(e,t,o){return F(h,{activeItem:this._activeItem,css:m,displayMode:T,dragEnabled:!1,item:e,key:`layerListItem-${e.layer?.uid}`,layerTablesEnabled:this.layerTablesEnabled,listModeDisabled:this.viewModel.listModeDisabled,messages:this.messages,messagesCommon:this.messagesCommon,parent:t,parentTitles:o,rootGroupUid:this._rootGroupUid,selectedItems:this.selectedItems,selectionMode:this.selectionMode,visibilityAppearance:this.visibilityAppearance,visibleElements:this.visibleElements,onAction:this._onTriggerAction,onCatalogOpen:this._onCatalogOpen,onPanelOpen:this._onPanelOpen,onTablesOpen:this._onTablesOpen,onTooltipReferenceChange:this._onTooltipReferenceChange})}_handleCalciteListChange(e){const{selectionMode:t,selectedItems:o}=this;if("none"===t)return;const i=e.target.selectedItems.map(e=>g(e)).filter(Boolean);o.removeAll(),o.addMany(i)}};e([a()],P.prototype,"_rootListEl",void 0),e([a()],P.prototype,"_activeItem",void 0),e([a()],P.prototype,"_tooltipReferenceMap",void 0),e([a()],P.prototype,"_focusRootFlowItem",void 0),e([a()],P.prototype,"_focusPanelFlowItem",void 0),e([a()],P.prototype,"_focusLayerFlowItem",void 0),e([a()],P.prototype,"_layerListMap",void 0),e([a()],P.prototype,"_filterEnabled",null),e([a()],P.prototype,"_visibleItems",null),e([a()],P.prototype,"_openedPanelItems",null),e([a()],P.prototype,"_renderedOpenLayerFlowItems",null),e([a()],P.prototype,"catalogItems",null),e([a()],P.prototype,"catalogLayer",null),e([a({readOnly:!0})],P.prototype,"catalogLayerList",void 0),e([a()],P.prototype,"catalogOptions",void 0),e([a()],P.prototype,"collapsed",void 0),e([a()],P.prototype,"filterPlaceholder",void 0),e([a()],P.prototype,"filterPredicate",void 0),e([a()],P.prototype,"filterText",void 0),e([a()],P.prototype,"headingLevel",void 0),e([a()],P.prototype,"icon",null),e([a()],P.prototype,"knowledgeGraphOptions",void 0),e([a()],P.prototype,"label",null),e([a()],P.prototype,"layerTablesEnabled",void 0),e([a()],P.prototype,"listItemCreatedFunction",null),e([a()],P.prototype,"mapImageOptions",void 0),e([a(),b("esri/widgets/CatalogLayerList/t9n/CatalogLayerList")],P.prototype,"messages",void 0),e([a(),b("esri/t9n/common")],P.prototype,"messagesCommon",void 0),e([a()],P.prototype,"minFilterItems",void 0),e([a({readOnly:!0})],P.prototype,"openedLayers",void 0),e([a({readOnly:!0})],P.prototype,"openedLayerLists",void 0),e([a()],P.prototype,"onCatalogOpen",void 0),e([a()],P.prototype,"onTablesOpen",void 0),e([a({type:O})],P.prototype,"selectedItems",void 0),e([a()],P.prototype,"selectionMode",void 0),e([a({readOnly:!0})],P.prototype,"tableList",void 0),e([a()],P.prototype,"tileOptions",void 0),e([a()],P.prototype,"view",null),e([C("trigger-action"),a({type:d})],P.prototype,"viewModel",void 0),e([a()],P.prototype,"visibilityAppearance",void 0),e([a({type:c,nonNullable:!0})],P.prototype,"visibleElements",void 0),P=M=e([n("esri.widgets.CatalogLayerList")],P);const A=P;export{A as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../../../core/Accessor.js";import r from"../../../core/Error.js";import"../../../core/has.js";import{property as n}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as o}from"../../../core/accessorSupport/decorators/subclass.js";import{fromUsng as i,fromUtm as s,fromMgrs as a,fromLatitudeLongitude as l,toUtm as c,toUsng as p,toMgrs as u,toLatitudeLongitude as m}from"../../../geometry/coordinateFormatter.js";import{isLoaded as d,project as h}from"../../../geometry/projectionUtils.js";import f from"../../../geometry/SpatialReference.js";import{equals as v}from"../../../geometry/support/spatialReferenceUtils.js";import{project as g}from"../../../geometry/support/webMercatorUtils.js";import{isValidPoint as y,fromXY as w,pointToCoordinate as b,getDegreePrecision as S}from"./coordinateConversionUtils.js";let _=class extends t{constructor(e){super(e),this.conversionInfo=null,this.coordinateSegments=null,this._currentPattern=void 0,this.defaultPattern=null,this.name=null,this.viewModel=null}get currentPattern(){return(this._currentPattern||this.defaultPattern)??""}set currentPattern(e){this._currentPattern=e}get label(){return this.name??""}set label(e){this._overrideIfSome("label",e)}get hasDisplayProperties(){return!(!this.defaultPattern||!this.coordinateSegments)}get spatialReference(){return"basemap"===this.name?this._viewSpatialReference:this.conversionInfo?.spatialReference??f.WGS84}set spatialReference(e){this._overrideIfSome("spatialReference",e)}get _viewSpatialReference(){return this.viewModel?.view?.spatialReference??f.WGS84}get _additionalCharactersPattern(){const e=this.coordinateSegments;if(!e)return null;const t=e.map(e=>e.alias),r=this.currentPattern.replaceAll(new RegExp(`["nsew${t.join()}]`,"gi"),"").replaceAll(" ","");return new RegExp(`[${r}]`,"g")}get test(){}async convert(e){if(!y(e))throw new r("format:invalid-point","Could not convert invalid point.",{point:e});const t=this.conversionInfo?.convert;if(t)return Promise.resolve().then(()=>t(e));const n=await this._project(e,this.spatialReference);return{location:n,coordinate:await this._getCoordinate(n)}}getConversionStrategy(){const e=this._viewSpatialReference;return this.conversionInfo?.convert||this.viewModel?.formatterAvailable||"xy"===this.name&&(e.isWebMercator||e.isWGS84)||"basemap"===this.name?"client":"server"}getDisplayCoordinate(e){if(!e)return null;if(!this.coordinateSegments||!this.currentPattern)return e;let t=this.currentPattern;const r=this._getSegmentMatches(e,!1);for(let n=this.coordinateSegments.length-1;n>=0;n--){const e=this.coordinateSegments[n];t=t.replace(e.alias,r[n])}return t}_parseUserInput(e){const{defaultPattern:t,_additionalCharactersPattern:r,coordinateSegments:n}=this;if(!t||!r)return"";let o=t.replace(r,"");e=e.replace(r,"");const i=this._getSegmentMatches(e,!0);if(n)for(let s=n.length-1;s>=0;s--){const e=n[s];o=o.replace(e.alias,i[s])}return o}_getSegmentMatches(e,t){const r=new Array,{coordinateSegments:n}=this;if(!n)return r;for(let o=0;o<n.length;o++){const i=n[o],s=e.match(i.searchPattern);if(!s){r.push("");continue}let a=s[0];if(e=e.replace(a,"").trim(),i.substitution){const e=t?i.substitution.input(a):i.substitution.output(a);e&&(a=`${e}`)}r.push(a)}return r}async reverseConvert(e){const t=this._parseUserInput(e),n=this.conversionInfo?.reverseConvert;let o;if(n)o=n(t);else if("xy"===this.name||"basemap"===this.name)o=w(t,this.spatialReference);else if(this.viewModel?.formatterAvailable)switch(this.name){case"dd":case"ddm":case"dms":o=l(t,this.spatialReference);break;case"mgrs":{const e="automatic";o=a(t,this.spatialReference,e);break}case"utm":{const e="latitude-band-indicators";o=s(t,this.spatialReference,e);break}case"usng":o=i(t,this.spatialReference);break;default:o=null}if(!o)throw new r("format:invalid-input","Could not parse input into point.",{userInput:e});return this._project(o,this._viewSpatialReference)}async _getCoordinate(e){const t=this.viewModel?.view?.scale??0;if(!y(e))throw new r("format:invalid-point","Could not transform invalid point into coordinate.",{point:e});if(this.viewModel?.formatterAvailable||"basemap"===this.name||"xy"===this.name)switch(this.name){case"dd":case"ddm":case"dms":{const r=S(t);return m(e,this.name,r)}case"mgrs":return u(e,"automatic",5,!1);case"usng":return p(e,5,!1);case"utm":return c(e,"latitude-band-indicators",!0);default:return b(e,t)}return b(e,t)}async _project(e,t){if(v(e.spatialReference,t)||!t)return e;if(this.viewModel?.formatterAvailable&&d())return h(e,t);if(!this.viewModel?.formatterAvailable){const r=g(e,t);if(null!=r)return r}return null}};e([n()],_.prototype,"conversionInfo",void 0),e([n()],_.prototype,"coordinateSegments",void 0),e([n()],_.prototype,"currentPattern",null),e([n()],_.prototype,"_currentPattern",void 0),e([n()],_.prototype,"label",null),e([n()],_.prototype,"defaultPattern",void 0),e([n({readOnly:!0})],_.prototype,"hasDisplayProperties",null),e([n()],_.prototype,"name",void 0),e([n({type:f})],_.prototype,"spatialReference",null),e([n()],_.prototype,"viewModel",void 0),e([n({readOnly:!0})],_.prototype,"_viewSpatialReference",null),e([n({readOnly:!0})],_.prototype,"_additionalCharactersPattern",null),_=e([o("esri.widgets.CoordinateConversion.support.Format")],_);const R=_;export{R as default};
5
+ import{__decorate as e}from"tslib";import t from"../../../core/Accessor.js";import r from"../../../core/Error.js";import"../../../core/has.js";import{property as n}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as o}from"../../../core/accessorSupport/decorators/subclass.js";import{fromUsng as i,fromUtm as s,fromMgrs as a,fromLatitudeLongitude as l,toUtm as c,toUsng as p,toMgrs as u,toLatitudeLongitude as m}from"../../../geometry/coordinateFormatter.js";import{isLoaded as d,project as h}from"../../../geometry/projectionUtils.js";import f from"../../../geometry/SpatialReference.js";import{equals as v}from"../../../geometry/support/spatialReferenceUtils.js";import{project as g}from"../../../geometry/support/webMercatorUtils.js";import{isValidPoint as y,fromXY as w,pointToCoordinate as b,getDegreePrecision as S}from"./coordinateConversionUtils.js";let _=class extends t{constructor(e){super(e),this.conversionInfo=null,this.coordinateSegments=null,this._currentPattern=void 0,this.defaultPattern=null,this.name=null,this.viewModel=null}get currentPattern(){return(this._currentPattern||this.defaultPattern)??""}set currentPattern(e){this._currentPattern=e}get label(){return this.name??""}set label(e){this._overrideIfSome("label",e)}get hasDisplayProperties(){return!(!this.defaultPattern||!this.coordinateSegments)}get spatialReference(){return"basemap"===this.name?this._viewSpatialReference:this.conversionInfo?.spatialReference??f.WGS84}set spatialReference(e){this._overrideIfSome("spatialReference",e)}get _viewSpatialReference(){return this.viewModel?.view?.spatialReference??f.WGS84}get _additionalCharactersPattern(){const e=this.coordinateSegments;if(!e)return null;const t=e.map(e=>e.alias),r=this.currentPattern.replaceAll(new RegExp(`["nsew${t.join()}]`,"gi"),"").replaceAll(" ","");return new RegExp(`[${r}]`,"g")}get test(){}async convert(e){if(!y(e))throw new r("format:invalid-point","Could not convert invalid point.",{point:e});const t=this.conversionInfo?.convert;if(t)return Promise.resolve().then(()=>t(e));const n=this._project(e,this.spatialReference);return{location:n,coordinate:this._getCoordinate(n)}}getConversionStrategy(){const e=this._viewSpatialReference;return this.conversionInfo?.convert||this.viewModel?.formatterAvailable||"xy"===this.name&&(e.isWebMercator||e.isWGS84)||"basemap"===this.name?"client":"server"}getDisplayCoordinate(e){if(!e)return null;if(!this.coordinateSegments||!this.currentPattern)return e;let t=this.currentPattern;const r=this._getSegmentMatches(e,!1);for(let n=this.coordinateSegments.length-1;n>=0;n--){const e=this.coordinateSegments[n];t=t.replace(e.alias,r[n])}return t}_parseUserInput(e){const{defaultPattern:t,_additionalCharactersPattern:r,coordinateSegments:n}=this;if(!t||!r)return"";let o=t.replace(r,"");e=e.replace(r,"");const i=this._getSegmentMatches(e,!0);if(n)for(let s=n.length-1;s>=0;s--){const e=n[s];o=o.replace(e.alias,i[s])}return o}_getSegmentMatches(e,t){const r=new Array,{coordinateSegments:n}=this;if(!n)return r;for(let o=0;o<n.length;o++){const i=n[o],s=e.match(i.searchPattern);if(!s){r.push("");continue}let a=s[0];if(e=e.replace(a,"").trim(),i.substitution){const e=t?i.substitution.input(a):i.substitution.output(a);e&&(a=`${e}`)}r.push(a)}return r}async reverseConvert(e){const t=this._parseUserInput(e),n=this.conversionInfo?.reverseConvert;let o;if(n)o=n(t);else if("xy"===this.name||"basemap"===this.name)o=w(t,this.spatialReference);else if(this.viewModel?.formatterAvailable)switch(this.name){case"dd":case"ddm":case"dms":o=l(t,this.spatialReference);break;case"mgrs":{const e="automatic";o=a(t,this.spatialReference,e);break}case"utm":{const e="latitude-band-indicators";o=s(t,this.spatialReference,e);break}case"usng":o=i(t,this.spatialReference);break;default:o=null}if(!o)throw new r("format:invalid-input","Could not parse input into point.",{userInput:e});return this._project(o,this._viewSpatialReference)}_getCoordinate(e){const t=this.viewModel?.view?.scale??0;if(!y(e))throw new r("format:invalid-point","Could not transform invalid point into coordinate.",{point:e});if(this.viewModel?.formatterAvailable||"basemap"===this.name||"xy"===this.name)switch(this.name){case"dd":case"ddm":case"dms":{const r=S(t);return m(e,this.name,r)}case"mgrs":return u(e,"automatic",5,!1);case"usng":return p(e,5,!1);case"utm":return c(e,"latitude-band-indicators",!0);default:return b(e,t)}return b(e,t)}_project(e,t){if(v(e.spatialReference,t)||!t)return e;if(this.viewModel?.formatterAvailable&&d())return h(e,t);if(!this.viewModel?.formatterAvailable){const r=g(e,t);if(null!=r)return r}return null}};e([n()],_.prototype,"conversionInfo",void 0),e([n()],_.prototype,"coordinateSegments",void 0),e([n()],_.prototype,"currentPattern",null),e([n()],_.prototype,"_currentPattern",void 0),e([n()],_.prototype,"label",null),e([n()],_.prototype,"defaultPattern",void 0),e([n({readOnly:!0})],_.prototype,"hasDisplayProperties",null),e([n()],_.prototype,"name",void 0),e([n({type:f})],_.prototype,"spatialReference",null),e([n()],_.prototype,"viewModel",void 0),e([n({readOnly:!0})],_.prototype,"_viewSpatialReference",null),e([n({readOnly:!0})],_.prototype,"_additionalCharactersPattern",null),_=e([o("esri.widgets.CoordinateConversion.support.Format")],_);const R=_;export{R as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../../Graphic.js";import a from"../../core/Error.js";import{makeHandle as i}from"../../core/handleUtils.js";import o from"../../core/Logger.js";import{abortMaybe as r}from"../../core/maybe.js";import{debounce as s,createResolver as n,onAbort as l,createAbortError as d,throwIfAborted as c}from"../../core/promiseUtils.js";import p from"../../core/Queue.js";import{whenOnce as u,watch as h,sync as w,when as f}from"../../core/reactiveUtils.js";import{last as g}from"../../core/SetUtils.js";import{property as v}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{subclass as k}from"../../core/accessorSupport/decorators/subclass.js";import{isEditableLayer as m}from"../../layers/support/editableLayers.js";import{isFeatureLayer as y,isSubtypeSublayer as W,isSubtypeGroupLayer as b,isTable as C}from"../../layers/support/layerUtils.js";import{createFeatureServices as A}from"../../rest/featureService/utils.js";import _ from"../../views/draw/support/HighlightHelper.js";import{ViewEventPriorities as F}from"../../views/input/InputManager.js";import M from"../../views/interactive/sketch/SketchOptions.js";import{temporaryHighlightName as S}from"../../views/support/HighlightDefaults.js";import I from"./CreateFeaturesWorkflow.js";import{UpdateFeatureWorkflow as E}from"./UpdateFeatureWorkflow.js";import{UpdateRecordWorkflow as V}from"./UpdateRecordWorkflow.js";import U from"./UpdateWorkflowData.js";import j from"./Workflow.js";import{isUpdateRecordWorkflow as P,createWorkflowSteps as R,fetchCandidates as L}from"./workflowUtils.js";import{findUtilityNetwork as O,isGraphicForRelatableFeatureSupportedLayer as x}from"../Feature/support/featureUtils.js";var T;let H=T=class extends j{constructor(e){super(e),this._workflowStack=new p(g),this._sketchStack=new p(g),this.data=void 0,this.type="update"}destroy(){this._drainWorkflowStack(e=>e.cancel({force:!0}))}get activeEditorItem(){return this.activeWorkflow?.data.editorItem??void 0}get activeFeatureFormViewModel(){return this.activeWorkflow?.featureFormViewModel}get activeUtilityNetworkAssociationAddAssociationViewModel(){return"add-association"===this.activeWorkflow?.type?this.activeWorkflow.utilityNetworkAssociationAddAssociationViewModel:null}get activeSketchViewModel(){return this._sketchStack.peek()?.viewModel}get canDeleteAssociation(){const{activeFeatureFormViewModel:e}=this;if(!this.activeWorkflow||!this.data.viewModel.view?.map||!e)return!1;const{activeAssociation:t,feature:a}=e;return!(!t||!a?.sourceLayer||!y(a?.sourceLayer)&&!W(a?.sourceLayer))}get activeWorkflow(){return this._workflowStack.last()}get updating(){return this._updatingHandles.updating||!!this.activeWorkflow?.updating}get hasPreviousStep(){const e=this.activeWorkflow?.featureFormViewModel;return this._stepIndex>0||this.nestedWorkflowCount>1||null!=e?.relationshipId||"view"!==this.data.viewModel.attachmentsViewModel.mode||null!=e?.associationId||null!=e?.associatedLayer}get hasUpdatableCandidates(){const{candidates:e,viewModel:t}=this.data;return e.some(({layer:e})=>t.findEditorItemForLayer(e)?.supportsUpdateWorkflow)}get nestedWorkflowCount(){return this._workflowStack.length}get shouldShowAttachments(){return!!this.activeEditorItem?.capabilities.attachments.enabled}get shouldAllowAttachmentEditing(){return!!this.activeEditorItem?.capabilities.update.attachments.enabled}get hasPendingEdits(){return Array.from(this._workflowStack).some(e=>e.hasPendingEdits)}get helpMessage(){return this.activeWorkflow?.helpMessage?this.activeWorkflow.helpMessage:"awaiting-feature-to-update"===this.stepId?"select":void 0}get reliesOnOwnerAdminPrivileges(){return this.activeWorkflow?.reliesOnOwnerAdminPrivileges??!1}get hasInvalidFormTemplate(){return!!this.activeEditorItem?.hasInvalidFormTemplate}async back(e=()=>Promise.resolve(!0)){const{activeWorkflow:t}=this,a=t?.featureFormViewModel;if(a?.activeRelationshipInput){const e=a.activeRelationshipInput;if(e.activeCategory)return void(e.activeCategory=null);if(null!=a.relationshipId)return void(a.relationshipId=null);if(e.showAllEnabled)return void(e.showAllEnabled=!1)}if("add-association"===t?.type){const{activeUtilityNetworkAssociationAddAssociationViewModel:e}=this;if(e?.filterOptionsVisible)return void(e.filterOptionsVisible=!1);e?.featureSpatialItems.length&&e.reset()}if(null==a?.associatedLayer)if(null==a?.associationId)if("create-features"===t?.type&&t.hasPreviousStep)await t.previous({cancelCurrentStep:!0});else if(t){if(t.hasPendingEdits&&!a?.disabled){if(!await e())return}t.hasPreviousStep?await t.previous({cancelCurrentStep:!0}):await this.cancelActiveWorkflow({force:!0})}else this.hasPreviousStep?await this.previous({cancelCurrentStep:!0}):await this.cancel({force:!0});else a.associationId=null;else a.associatedLayer=null}async cancelActiveWorkflow(e){await(this.activeWorkflow?.cancel(e)),await this._popWorkflow()}async commit(){await this._drainWorkflowStack(e=>e.commit()),await super.commit()}static create(e){const{viewModel:t,snappingManager:a,startAt:i,addAttachmentsCallback:o,applyEditsCallback:r,applyEditsFeatureServiceCallback:s}=e,n=e.sketchOptions??new M,l=new T({data:new U({addAttachmentsCallback:o,applyEditsCallback:r,applyEditsFeatureServiceCallback:s,sketchOptions:n,snappingManager:a,viewModel:t}),onCommit:async()=>{}});return l._set("steps",this._createWorkflowSteps(l,i)),l}async save(){const{activeFeatureFormViewModel:e}=this;if(e){if(e.submit(),!e.submittable||e.pendingSubtypeChoice)return;const t=e.getValues();if(e.validateContingencyConstraints(t,{includeIncompleteViolations:!0}).length>0)return}this.nestedWorkflowCount>1?(await(this.activeWorkflow?.commit()),await this._popWorkflow()):await this.commit()}async startCreatingRelatedRecord(e){try{const t=await this._createNestedCreateFeaturesWorkflow(e);await this._pushWorkflow(t)}catch(t){throw new a("editor:unable-to-start-creating","Could not begin updating the provided feature or table record.",{error:t})}}async startUpdating(e,t,i=!1){try{const a=await this._createNestedUpdateWorkflow(e,i,t);await this._pushWorkflow(a)}catch(o){throw new a("editor:unable-to-start-updating","Could not begin updating the provided feature or table record.",{error:o})}}async startAddAssociation(e,t,i){try{const a=await this._createNestedAddAssociationWorkflow(e,t,i);await this._pushWorkflow(a)}catch(o){throw new a("editor:unable-to-start-updating","Could not begin updating the provided feature or table record.",{error:o})}}async deleteActiveFeature(){const{activeWorkflow:e}=this;if(!e)throw new a("editor:nothing-to-delete","There is no feature to delete");const t=P(e);t?(e.stageDelete(),e.data.edits.feature===this.data.rootFeature&&this._removeRootFeatureFromCandidates()):await e.cancel(),this.nestedWorkflowCount<2?t?await this.commit():await this.cancel({force:!0}):(t&&await e.commit(),await this._popWorkflow(),await this._returnToPageWithContent())}async deleteActiveAssociation(){if(!this.canDeleteAssociation)throw new a("editor:nothing-to-delete","There is no association to delete");await this._deleteActiveAssociation(),await this._popWorkflow(),await this._returnToPageWithContent()}async cancelAll(){await this._drainWorkflowStack(e=>e.cancel({force:!0}))}async _deleteActiveAssociation(){const{activeFeatureFormViewModel:e,data:t}=this,{activeAssociation:i,feature:o}=e,{applyEditsFeatureServiceCallback:r,viewModel:s}=t,{sourceLayer:n}=o,l=W(n)&&n.parent?n.parent:n,d=A([l]),c=d.values().next().value?.featureService;if(!c)throw new a("editor:failed-to-delete-association","Could not retrieve feature service needed to delete association");await(c?.load());const p=s.view.map,u=O(p,l);await(u?.networkSystemLayers.loadAssociationsTable());const h=u?.generateDeleteAssociations([i]);if(!h)throw new a("editor:failed-to-delete-association","Could not create payload needed to delete association");const w=u?.gdbVersion??void 0;await r(c,[h],{gdbVersion:w,globalIdUsed:!0})}_removeRootFeatureFromCandidates(){const{candidates:e,rootFeature:t}=this.data;if(0===e.length||!t)return;const a=e.indexOf(t);a>-1&&e.splice(a,1)}async _returnToPageWithContent(){const{activeFeatureFormViewModel:e}=this;if(!e?.activeAssociationInput)return;const{activeAssociationInput:t,associationId:a}=e;await t.refresh(),t.associatedLayer&&!t.associatedFeatures?.length&&(e.associatedLayer=null),null==a||t.associatedFeatureInfos.size||(e.associationId=null)}async _createNestedCreateFeaturesWorkflow(e){const{relatedLayer:t}=e,{addAttachmentsCallback:i,applyEditsCallback:o,applyEditsFeatureServiceCallback:r,sketchOptions:s,snappingManager:n,viewModel:l}=this.data;if(!m(t))throw new a("editor:unsupported-layer","Editing is not supported on the provided layer");const d=this._getCreationInfoForNestedCreateFeaturesWorkflow(e),c=d.template||d.initialFeature?"creating-features":"awaiting-feature-creation-info",p="create-features"!==this.activeWorkflow?.type&&"add-association"!==this.activeWorkflow?.type?this.activeWorkflow:void 0;return I.create({addAttachmentsCallback:i,applyEditsCallback:o,applyEditsFeatureServiceCallback:r,creationInfo:d,isNested:!0,parent:p,sketchOptions:s,snappingManager:n,startAt:c,viewModel:l})}_getCreationInfoForNestedCreateFeaturesWorkflow(e){const{relatedLayer:i}=e;if(!m(i)||b(i))throw new a("editor:unsupported-layer","Editing is not supported on the provided layer");const{viewModel:o}=this.data,r={layer:i,maxFeatures:1},s=this._makeRelatedRecordAttributes(e),n=o.getTemplatesForLayer(i);return n?.length>0?(r.attributeOverrides=s,1===n.length&&(r.template=n[0])):r.initialFeature=new t({sourceLayer:i,attributes:s}),r}async _createNestedUpdateWorkflow(e,t,a){const i=C(e.sourceLayer)?V:E,{applyEditsCallback:o,applyEditsFeatureServiceCallback:r,sketchOptions:s,snappingManager:n,viewModel:l}=this.data,d="create-features"!==this.activeWorkflow?.type&&"add-association"!==this.activeWorkflow?.type?this.activeWorkflow:void 0,c=await i.create({association:a,feature:e,parent:d,sketchOptions:s,snappingManager:n,viewModel:l,readOnly:t,applyEdits:o,applyEditsFeatureService:r,featureFormCallbacks:{addRelatedRecord:async e=>await this._updatingHandles.addPromise(this.startCreatingRelatedRecord(e)),editRelatedRecord:async({relatedFeature:e,readOnly:t})=>await this._updatingHandles.addPromise(this.startUpdating(e,void 0,t)),selectAssociatedFeature:async({feature:e,association:a})=>await this._updatingHandles.addPromise(this.startUpdating(e,a,t)),addAssociation:async e=>await this._updatingHandles.addPromise(this.startAddAssociation(e.feature,e.utilityNetwork,e.associationType))}});return await u(()=>!c.updating),c}async _createNestedAddAssociationWorkflow(e,t,a){const{AddAssociationWorkflow:i}=await import("./AddAssociationWorkflow.js"),{applyEditsCallback:o,applyEditsFeatureServiceCallback:r,viewModel:s}=this.data,n="create-features"!==this.activeWorkflow?.type&&"add-association"!==this.activeWorkflow?.type?this.activeWorkflow:void 0,l=this.activeFeatureFormViewModel?.activeAssociationInput,d=await i.create({utilityNetwork:t,associationType:a,feature:e,parent:n,viewModel:s,associationInput:l,applyEdits:o,applyEditsFeatureService:r});return await u(()=>!d.updating),d}async _drainWorkflowStack(e){const t=this._workflowStack,a=[];for(const i of t){const t=e(i).finally(()=>i.destroy());this._updatingHandles.addPromise(t),a.push(t)}await Promise.all(a),this._workflowStack.clear(),this._sketchStack.clear()}_makeRelatedRecordAttributes(e){const{parentFeature:t,relatedLayer:a,relationshipId:i}=e;if(!x(t))return;const o=a.relationships?.find(e=>e.id===i);if(!o)return void this._logContinuingWithoutRelationshipWarning("relationship-not-found","Could not begin creating a related record because the relationship specified could not be found on the destination layer.");if("origin"===o.role)return void this._logContinuingWithoutRelationshipWarning("unsupported-role","Creating new related records in the 'origin' table of a relationship is not yet supported");const r=t.sourceLayer;o.relatedTableId!==r.layerId&&this._logContinuingWithoutRelationshipWarning("invalid-argument-combination","The given parent feature does not belong to the relationship designated by the given relationship ID.");const s=r.relationships?.find(e=>e.id===i);if(!s)return void this._logContinuingWithoutRelationshipWarning("relationship-not-found","Could not begin creating a related record because the relationship specified could not be found on the origin layer.");const n=N(r,s),l=t.getAttribute(n);l||this._logContinuingWithoutRelationshipWarning("no-key-on-origin-feature","The given parent feature does not have a value for the relationship's origin primary key field.");const d=N(a,o);return{[d]:l}}async _popWorkflow(){this._workflowStack.pop()?.destroy(),this._sketchStack.pop();const e=await this._reconcileWorkflowStack();if(e.failureCount>0)throw new a("editor:next-workflow-failed","Popped the top workflow, but the next workflow in the stack failed to activate",e)}async _pushWorkflow(e){const t=this._workflowRequiresSketchViewModel(e);this.activeWorkflow?.exit({removeSketchHandles:t});const i=this._sketchStack,o=await(e?.start()),r=i.peek();o?(r?.exit(),i.push(o)):i.push(this._cloneSketchController(r)),this._workflowStack.push(e);const s=await this._reconcileWorkflowStack();if(s.failureCount>0)throw new a("editor:failed-to-start-updating-feature","Failed to enter the provided workflow.",s)}async _reconcileWorkflowStack(){const e=this._workflowStack,t=this._sketchStack;try{const a=e.peek();return await(a?.enter()),await(t.peek()?.enter()),{activeWorkflow:a,failureCount:0}}catch(a){e.pop().destroy(),t.pop();const{activeWorkflow:i,failureCount:o}=await this._reconcileWorkflowStack();return{activeWorkflow:i,failureCount:o+1}}}_cloneSketchController(e){return{enter:e?.enter??(async()=>{}),exit:e?.exit??(async()=>{}),viewModel:e?.viewModel}}_workflowRequiresSketchViewModel(e){const{type:t}=e;return"update-feature"===t||"create-features"===t&&!C(e.data.creationInfo?.layer)}static _createWorkflowSteps(e,t="awaiting-feature-to-update"){const{data:o}=e;return R(["awaiting-feature-to-update","awaiting-update-feature-candidate","editing-existing-feature","adding-attachment","editing-attachment"],t,{"awaiting-feature-to-update":()=>({id:"awaiting-feature-to-update",async setUp(){const{spinnerViewModel:t}=o.viewModel,a=o.viewModel.view;a.activeTool=null;let s=null;e.addHandles(i(()=>{s=r(s)}),this.id),o.rootFeature=null,o.candidates=[];const p=a.on("immediate-click",async i=>{const r=n();e._updatingHandles.addPromise(r.promise);try{t.location=i.mapPoint,t.visible=!0,s?.abort();const{editorItems:r}=o.viewModel;s=new AbortController;const n=await i.defer(()=>new Promise((e,t)=>{l(s?.signal,()=>t(d())),e(L(r,a,i,s?.signal))}));if(c(s),o.candidates=n.filter(e=>"fulfilled"===e.status).flatMap(e=>e.value).filter(e=>!e.isAggregate),t.visible=1===o.candidates.length,0===o.candidates.length)return;i.stopPropagation(),1===o.candidates.length?(o.rootFeature=o.candidates[0],e.go("editing-existing-feature").catch(()=>{}).then(()=>t.visible=!1)):e.next()}finally{r.resolve()}},F.TOOL),u=f(()=>null!=a.activeTool,()=>e.cancel({force:!0}),{once:!0});a.focus(),e.addHandles([p,u],this.id)},async tearDown(){0===o.candidates.length&&(o.viewModel.spinnerViewModel.visible=!1),e.removeHandles(this.id)}}),"awaiting-update-feature-candidate":()=>({id:"awaiting-update-feature-candidate",async setUp(){o.rootFeature=null;const{view:t}=o.viewModel;if(!t)return;const a=new _({view:t,highlightName:S});e.addHandles([h(()=>o.rootFeature,(e,t)=>{a.remove(t),a.add(e)},w),i(()=>a.removeAll())],this.id)},async tearDown(){e.removeHandles(this.id)}}),"editing-existing-feature":()=>({id:"editing-existing-feature",async setUp(){const{rootFeature:t,viewModel:i}=e.data;if(!t)throw new a("editor:no-feature-specified","Cannot setup the 'updating-existing-feature' step until the root feature is defined");await e.startUpdating(t),i.spinnerViewModel.visible=!1;const o=s(async()=>{await u(()=>!e.updating),e.previous()});e.addHandles([h(()=>e.nestedWorkflowCount,(e,t)=>{0===e&&0!==t&&o()},w)],this.id)},async tearDown(){await e.cancelAll(),e.removeHandles(this.id)}}),"adding-attachment":()=>({id:"adding-attachment",parent:"editing-existing-feature",async setUp(){},async tearDown(){o.viewModel.attachmentsViewModel.mode="view"}}),"editing-attachment":()=>({id:"editing-attachment",parent:"editing-existing-feature",async setUp(){},async tearDown(){o.viewModel.attachmentsViewModel.mode="view"}})})}_logContinuingWithoutRelationshipWarning(e,t){o.getLogger(this).warn(`editor:${e}`,t,"The create operation will be allowed to proceed, but the resulting feature may not be related to the given parent feature.")}};function N(e,{keyField:t}){return e.getField(t)?.name??t}e([v()],H.prototype,"activeEditorItem",null),e([v()],H.prototype,"activeFeatureFormViewModel",null),e([v()],H.prototype,"activeUtilityNetworkAssociationAddAssociationViewModel",null),e([v()],H.prototype,"activeSketchViewModel",null),e([v()],H.prototype,"canDeleteAssociation",null),e([v()],H.prototype,"activeWorkflow",null),e([v()],H.prototype,"updating",null),e([v()],H.prototype,"data",void 0),e([v()],H.prototype,"hasPreviousStep",null),e([v()],H.prototype,"hasUpdatableCandidates",null),e([v()],H.prototype,"nestedWorkflowCount",null),e([v()],H.prototype,"shouldShowAttachments",null),e([v()],H.prototype,"shouldAllowAttachmentEditing",null),e([v()],H.prototype,"hasPendingEdits",null),e([v()],H.prototype,"helpMessage",null),e([v()],H.prototype,"reliesOnOwnerAdminPrivileges",null),e([v()],H.prototype,"hasInvalidFormTemplate",null),H=T=e([k("esri.widgets.Editor.UpdateWorkflow")],H);const D=H;export{D as default};
5
+ import{__decorate as e}from"tslib";import t from"../../Graphic.js";import a from"../../core/Error.js";import{makeHandle as i}from"../../core/handleUtils.js";import o from"../../core/Logger.js";import{abortMaybe as r}from"../../core/maybe.js";import{debounce as s,createResolver as n,onAbort as l,createAbortError as d,throwIfAborted as c}from"../../core/promiseUtils.js";import p from"../../core/Queue.js";import{whenOnce as u,watch as h,sync as w,when as f}from"../../core/reactiveUtils.js";import{last as g}from"../../core/SetUtils.js";import{property as v}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{subclass as k}from"../../core/accessorSupport/decorators/subclass.js";import{isEditableLayer as m}from"../../layers/support/editableLayers.js";import{isFeatureLayer as y,isSubtypeSublayer as W,isSubtypeGroupLayer as b,isTable as C}from"../../layers/support/layerUtils.js";import{createFeatureServices as A}from"../../rest/featureService/utils.js";import _ from"../../views/draw/support/HighlightHelper.js";import{ViewEventPriorities as F}from"../../views/input/InputManager.js";import M from"../../views/interactive/sketch/SketchOptions.js";import{temporaryHighlightName as S}from"../../views/support/HighlightDefaults.js";import I from"./CreateFeaturesWorkflow.js";import{UpdateFeatureWorkflow as E}from"./UpdateFeatureWorkflow.js";import{UpdateRecordWorkflow as V}from"./UpdateRecordWorkflow.js";import U from"./UpdateWorkflowData.js";import j from"./Workflow.js";import{isUpdateRecordWorkflow as P,createWorkflowSteps as R,fetchCandidates as L}from"./workflowUtils.js";import{findUtilityNetwork as O,isGraphicForRelatableFeatureSupportedLayer as x}from"../Feature/support/featureUtils.js";var T;let H=T=class extends j{constructor(e){super(e),this._workflowStack=new p(g),this._sketchStack=new p(g),this.data=void 0,this.type="update"}destroy(){this._drainWorkflowStack(e=>e.cancel({force:!0}))}get activeEditorItem(){return this.activeWorkflow?.data.editorItem??void 0}get activeFeatureFormViewModel(){return this.activeWorkflow?.featureFormViewModel}get activeUtilityNetworkAssociationAddAssociationViewModel(){return"add-association"===this.activeWorkflow?.type?this.activeWorkflow.utilityNetworkAssociationAddAssociationViewModel:null}get activeSketchViewModel(){return this._sketchStack.peek()?.viewModel}get canDeleteAssociation(){const{activeFeatureFormViewModel:e}=this;if(!this.activeWorkflow||!this.data.viewModel.view?.map||!e)return!1;const{activeAssociation:t,feature:a}=e;return!(!t||!a?.sourceLayer||!y(a?.sourceLayer)&&!W(a?.sourceLayer))}get activeWorkflow(){return this._workflowStack.last()}get updating(){return this._updatingHandles.updating||!!this.activeWorkflow?.updating}get hasPreviousStep(){const e=this.activeWorkflow?.featureFormViewModel;return this._stepIndex>0||this.nestedWorkflowCount>1||null!=e?.relationshipId||"view"!==this.data.viewModel.attachmentsViewModel.mode||null!=e?.associationId||null!=e?.associatedLayer}get hasUpdatableCandidates(){const{candidates:e,viewModel:t}=this.data;return e.some(({layer:e})=>t.findEditorItemForLayer(e)?.supportsUpdateWorkflow)}get nestedWorkflowCount(){return this._workflowStack.length}get shouldShowAttachments(){return!!this.activeEditorItem?.capabilities.attachments.enabled}get shouldAllowAttachmentEditing(){return!!this.activeEditorItem?.capabilities.update.attachments.enabled}get hasPendingEdits(){return Array.from(this._workflowStack).some(e=>e.hasPendingEdits)}get helpMessage(){return this.activeWorkflow?.helpMessage?this.activeWorkflow.helpMessage:"awaiting-feature-to-update"===this.stepId?"select":void 0}get reliesOnOwnerAdminPrivileges(){return this.activeWorkflow?.reliesOnOwnerAdminPrivileges??!1}get hasInvalidFormTemplate(){return!!this.activeEditorItem?.hasInvalidFormTemplate}async back(e=()=>Promise.resolve(!0)){const{activeWorkflow:t}=this,a=t?.featureFormViewModel;if(a?.activeRelationshipInput){const e=a.activeRelationshipInput;if(e.activeCategory)return void(e.activeCategory=null);if(null!=a.relationshipId)return void(a.relationshipId=null);if(e.showAllEnabled)return void(e.showAllEnabled=!1)}if("add-association"===t?.type){const{activeUtilityNetworkAssociationAddAssociationViewModel:e}=this;if(e?.filterOptionsVisible)return void(e.filterOptionsVisible=!1);e?.featureSpatialItems.length&&e.reset()}if(null==a?.associatedLayer)if(null==a?.associationId)if("create-features"===t?.type&&t.hasPreviousStep)await t.previous({cancelCurrentStep:!0});else if(t){if(t.hasPendingEdits&&!a?.disabled){if(!await e())return}t.hasPreviousStep?await t.previous({cancelCurrentStep:!0}):await this.cancelActiveWorkflow({force:!0})}else this.hasPreviousStep?await this.previous({cancelCurrentStep:!0}):await this.cancel({force:!0});else a.associationId=null;else a.associatedLayer=null}async cancelActiveWorkflow(e){await(this.activeWorkflow?.cancel(e)),await this._popWorkflow()}async commit(){await this._drainWorkflowStack(e=>e.commit()),await super.commit()}static create(e){const{viewModel:t,snappingManager:a,startAt:i,addAttachmentsCallback:o,applyEditsCallback:r,applyEditsFeatureServiceCallback:s}=e,n=e.sketchOptions??new M,l=new T({data:new U({addAttachmentsCallback:o,applyEditsCallback:r,applyEditsFeatureServiceCallback:s,sketchOptions:n,snappingManager:a,viewModel:t}),onCommit:async()=>{}});return l._set("steps",this._createWorkflowSteps(l,i)),l}async save(){const{activeFeatureFormViewModel:e}=this;if(e){if(e.submit(),!e.submittable||e.pendingSubtypeChoice)return;const t=e.getValues();if(e.validateContingencyConstraints(t,{includeIncompleteViolations:!0}).length>0)return}this.nestedWorkflowCount>1?(await(this.activeWorkflow?.commit()),await this._popWorkflow()):await this.commit()}async startCreatingRelatedRecord(e){try{const t=this._createNestedCreateFeaturesWorkflow(e);await this._pushWorkflow(t)}catch(t){throw new a("editor:unable-to-start-creating","Could not begin updating the provided feature or table record.",{error:t})}}async startUpdating(e,t,i=!1){try{const a=await this._createNestedUpdateWorkflow(e,i,t);await this._pushWorkflow(a)}catch(o){throw new a("editor:unable-to-start-updating","Could not begin updating the provided feature or table record.",{error:o})}}async startAddAssociation(e,t,i){try{const a=await this._createNestedAddAssociationWorkflow(e,t,i);await this._pushWorkflow(a)}catch(o){throw new a("editor:unable-to-start-updating","Could not begin updating the provided feature or table record.",{error:o})}}async deleteActiveFeature(){const{activeWorkflow:e}=this;if(!e)throw new a("editor:nothing-to-delete","There is no feature to delete");const t=P(e);t?(e.stageDelete(),e.data.edits.feature===this.data.rootFeature&&this._removeRootFeatureFromCandidates()):await e.cancel(),this.nestedWorkflowCount<2?t?await this.commit():await this.cancel({force:!0}):(t&&await e.commit(),await this._popWorkflow(),await this._returnToPageWithContent())}async deleteActiveAssociation(){if(!this.canDeleteAssociation)throw new a("editor:nothing-to-delete","There is no association to delete");await this._deleteActiveAssociation(),await this._popWorkflow(),await this._returnToPageWithContent()}async cancelAll(){await this._drainWorkflowStack(e=>e.cancel({force:!0}))}async _deleteActiveAssociation(){const{activeFeatureFormViewModel:e,data:t}=this,{activeAssociation:i,feature:o}=e,{applyEditsFeatureServiceCallback:r,viewModel:s}=t,{sourceLayer:n}=o,l=W(n)&&n.parent?n.parent:n,d=A([l]),c=d.values().next().value?.featureService;if(!c)throw new a("editor:failed-to-delete-association","Could not retrieve feature service needed to delete association");await(c?.load());const p=s.view.map,u=O(p,l);await(u?.networkSystemLayers.loadAssociationsTable());const h=u?.generateDeleteAssociations([i]);if(!h)throw new a("editor:failed-to-delete-association","Could not create payload needed to delete association");const w=u?.gdbVersion??void 0;await r(c,[h],{gdbVersion:w,globalIdUsed:!0})}_removeRootFeatureFromCandidates(){const{candidates:e,rootFeature:t}=this.data;if(0===e.length||!t)return;const a=e.indexOf(t);a>-1&&e.splice(a,1)}async _returnToPageWithContent(){const{activeFeatureFormViewModel:e}=this;if(!e?.activeAssociationInput)return;const{activeAssociationInput:t,associationId:a}=e;await t.refresh(),t.associatedLayer&&!t.associatedFeatures?.length&&(e.associatedLayer=null),null==a||t.associatedFeatureInfos.size||(e.associationId=null)}_createNestedCreateFeaturesWorkflow(e){const{relatedLayer:t}=e,{addAttachmentsCallback:i,applyEditsCallback:o,applyEditsFeatureServiceCallback:r,sketchOptions:s,snappingManager:n,viewModel:l}=this.data;if(!m(t))throw new a("editor:unsupported-layer","Editing is not supported on the provided layer");const d=this._getCreationInfoForNestedCreateFeaturesWorkflow(e),c=d.template||d.initialFeature?"creating-features":"awaiting-feature-creation-info",p="create-features"!==this.activeWorkflow?.type&&"add-association"!==this.activeWorkflow?.type?this.activeWorkflow:void 0;return I.create({addAttachmentsCallback:i,applyEditsCallback:o,applyEditsFeatureServiceCallback:r,creationInfo:d,isNested:!0,parent:p,sketchOptions:s,snappingManager:n,startAt:c,viewModel:l})}_getCreationInfoForNestedCreateFeaturesWorkflow(e){const{relatedLayer:i}=e;if(!m(i)||b(i))throw new a("editor:unsupported-layer","Editing is not supported on the provided layer");const{viewModel:o}=this.data,r={layer:i,maxFeatures:1},s=this._makeRelatedRecordAttributes(e),n=o.getTemplatesForLayer(i);return n?.length>0?(r.attributeOverrides=s,1===n.length&&(r.template=n[0])):r.initialFeature=new t({sourceLayer:i,attributes:s}),r}async _createNestedUpdateWorkflow(e,t,a){const i=C(e.sourceLayer)?V:E,{applyEditsCallback:o,applyEditsFeatureServiceCallback:r,sketchOptions:s,snappingManager:n,viewModel:l}=this.data,d="create-features"!==this.activeWorkflow?.type&&"add-association"!==this.activeWorkflow?.type?this.activeWorkflow:void 0,c=await i.create({association:a,feature:e,parent:d,sketchOptions:s,snappingManager:n,viewModel:l,readOnly:t,applyEdits:o,applyEditsFeatureService:r,featureFormCallbacks:{addRelatedRecord:async e=>await this._updatingHandles.addPromise(this.startCreatingRelatedRecord(e)),editRelatedRecord:async({relatedFeature:e,readOnly:t})=>await this._updatingHandles.addPromise(this.startUpdating(e,void 0,t)),selectAssociatedFeature:async({feature:e,association:a})=>await this._updatingHandles.addPromise(this.startUpdating(e,a,t)),addAssociation:async e=>await this._updatingHandles.addPromise(this.startAddAssociation(e.feature,e.utilityNetwork,e.associationType))}});return await u(()=>!c.updating),c}async _createNestedAddAssociationWorkflow(e,t,a){const{AddAssociationWorkflow:i}=await import("./AddAssociationWorkflow.js"),{applyEditsCallback:o,applyEditsFeatureServiceCallback:r,viewModel:s}=this.data,n="create-features"!==this.activeWorkflow?.type&&"add-association"!==this.activeWorkflow?.type?this.activeWorkflow:void 0,l=this.activeFeatureFormViewModel?.activeAssociationInput,d=await i.create({utilityNetwork:t,associationType:a,feature:e,parent:n,viewModel:s,associationInput:l,applyEdits:o,applyEditsFeatureService:r});return await u(()=>!d.updating),d}async _drainWorkflowStack(e){const t=this._workflowStack,a=[];for(const i of t){const t=e(i).finally(()=>i.destroy());this._updatingHandles.addPromise(t),a.push(t)}await Promise.all(a),this._workflowStack.clear(),this._sketchStack.clear()}_makeRelatedRecordAttributes(e){const{parentFeature:t,relatedLayer:a,relationshipId:i}=e;if(!x(t))return;const o=a.relationships?.find(e=>e.id===i);if(!o)return void this._logContinuingWithoutRelationshipWarning("relationship-not-found","Could not begin creating a related record because the relationship specified could not be found on the destination layer.");if("origin"===o.role)return void this._logContinuingWithoutRelationshipWarning("unsupported-role","Creating new related records in the 'origin' table of a relationship is not yet supported");const r=t.sourceLayer;o.relatedTableId!==r.layerId&&this._logContinuingWithoutRelationshipWarning("invalid-argument-combination","The given parent feature does not belong to the relationship designated by the given relationship ID.");const s=r.relationships?.find(e=>e.id===i);if(!s)return void this._logContinuingWithoutRelationshipWarning("relationship-not-found","Could not begin creating a related record because the relationship specified could not be found on the origin layer.");const n=N(r,s),l=t.getAttribute(n);l||this._logContinuingWithoutRelationshipWarning("no-key-on-origin-feature","The given parent feature does not have a value for the relationship's origin primary key field.");const d=N(a,o);return{[d]:l}}async _popWorkflow(){this._workflowStack.pop()?.destroy(),this._sketchStack.pop();const e=await this._reconcileWorkflowStack();if(e.failureCount>0)throw new a("editor:next-workflow-failed","Popped the top workflow, but the next workflow in the stack failed to activate",e)}async _pushWorkflow(e){const t=this._workflowRequiresSketchViewModel(e);this.activeWorkflow?.exit({removeSketchHandles:t});const i=this._sketchStack,o=await(e?.start()),r=i.peek();o?(r?.exit(),i.push(o)):i.push(this._cloneSketchController(r)),this._workflowStack.push(e);const s=await this._reconcileWorkflowStack();if(s.failureCount>0)throw new a("editor:failed-to-start-updating-feature","Failed to enter the provided workflow.",s)}async _reconcileWorkflowStack(){const e=this._workflowStack,t=this._sketchStack;try{const a=e.peek();return await(a?.enter()),await(t.peek()?.enter()),{activeWorkflow:a,failureCount:0}}catch(a){e.pop().destroy(),t.pop();const{activeWorkflow:i,failureCount:o}=await this._reconcileWorkflowStack();return{activeWorkflow:i,failureCount:o+1}}}_cloneSketchController(e){return{enter:e?.enter??(async()=>{}),exit:e?.exit??(async()=>{}),viewModel:e?.viewModel}}_workflowRequiresSketchViewModel(e){const{type:t}=e;return"update-feature"===t||"create-features"===t&&!C(e.data.creationInfo?.layer)}static _createWorkflowSteps(e,t="awaiting-feature-to-update"){const{data:o}=e;return R(["awaiting-feature-to-update","awaiting-update-feature-candidate","editing-existing-feature","adding-attachment","editing-attachment"],t,{"awaiting-feature-to-update":()=>({id:"awaiting-feature-to-update",async setUp(){const{spinnerViewModel:t}=o.viewModel,a=o.viewModel.view;a.activeTool=null;let s=null;e.addHandles(i(()=>{s=r(s)}),this.id),o.rootFeature=null,o.candidates=[];const p=a.on("immediate-click",async i=>{const r=n();e._updatingHandles.addPromise(r.promise);try{t.location=i.mapPoint,t.visible=!0,s?.abort();const{editorItems:r}=o.viewModel;s=new AbortController;const n=await i.defer(()=>new Promise((e,t)=>{l(s?.signal,()=>t(d())),e(L(r,a,i,s?.signal))}));if(c(s),o.candidates=n.filter(e=>"fulfilled"===e.status).flatMap(e=>e.value).filter(e=>!e.isAggregate),t.visible=1===o.candidates.length,0===o.candidates.length)return;i.stopPropagation(),1===o.candidates.length?(o.rootFeature=o.candidates[0],e.go("editing-existing-feature").catch(()=>{}).then(()=>t.visible=!1)):e.next()}finally{r.resolve()}},F.TOOL),u=f(()=>null!=a.activeTool,()=>e.cancel({force:!0}),{once:!0});a.focus(),e.addHandles([p,u],this.id)},async tearDown(){0===o.candidates.length&&(o.viewModel.spinnerViewModel.visible=!1),e.removeHandles(this.id)}}),"awaiting-update-feature-candidate":()=>({id:"awaiting-update-feature-candidate",async setUp(){o.rootFeature=null;const{view:t}=o.viewModel;if(!t)return;const a=new _({view:t,highlightName:S});e.addHandles([h(()=>o.rootFeature,(e,t)=>{a.remove(t),a.add(e)},w),i(()=>a.removeAll())],this.id)},async tearDown(){e.removeHandles(this.id)}}),"editing-existing-feature":()=>({id:"editing-existing-feature",async setUp(){const{rootFeature:t,viewModel:i}=e.data;if(!t)throw new a("editor:no-feature-specified","Cannot setup the 'updating-existing-feature' step until the root feature is defined");await e.startUpdating(t),i.spinnerViewModel.visible=!1;const o=s(async()=>{await u(()=>!e.updating),e.previous()});e.addHandles([h(()=>e.nestedWorkflowCount,(e,t)=>{0===e&&0!==t&&o()},w)],this.id)},async tearDown(){await e.cancelAll(),e.removeHandles(this.id)}}),"adding-attachment":()=>({id:"adding-attachment",parent:"editing-existing-feature",async setUp(){},async tearDown(){o.viewModel.attachmentsViewModel.mode="view"}}),"editing-attachment":()=>({id:"editing-attachment",parent:"editing-existing-feature",async setUp(){},async tearDown(){o.viewModel.attachmentsViewModel.mode="view"}})})}_logContinuingWithoutRelationshipWarning(e,t){o.getLogger(this).warn(`editor:${e}`,t,"The create operation will be allowed to proceed, but the resulting feature may not be related to the given parent feature.")}};function N(e,{keyField:t}){return e.getField(t)?.name??t}e([v()],H.prototype,"activeEditorItem",null),e([v()],H.prototype,"activeFeatureFormViewModel",null),e([v()],H.prototype,"activeUtilityNetworkAssociationAddAssociationViewModel",null),e([v()],H.prototype,"activeSketchViewModel",null),e([v()],H.prototype,"canDeleteAssociation",null),e([v()],H.prototype,"activeWorkflow",null),e([v()],H.prototype,"updating",null),e([v()],H.prototype,"data",void 0),e([v()],H.prototype,"hasPreviousStep",null),e([v()],H.prototype,"hasUpdatableCandidates",null),e([v()],H.prototype,"nestedWorkflowCount",null),e([v()],H.prototype,"shouldShowAttachments",null),e([v()],H.prototype,"shouldAllowAttachmentEditing",null),e([v()],H.prototype,"hasPendingEdits",null),e([v()],H.prototype,"helpMessage",null),e([v()],H.prototype,"reliesOnOwnerAdminPrivileges",null),e([v()],H.prototype,"hasInvalidFormTemplate",null),H=T=e([k("esri.widgets.Editor.UpdateWorkflow")],H);const D=H;export{D as default};