@arcgis/core 5.2.0-next.12 → 5.2.0-next.14
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.
- package/arcgisGlobal.d.ts +3 -3
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/03354e9256b2f77fd4f2.js +1 -0
- package/assets/esri/core/workers/chunks/0826d36dfbfa28442b70.js +1 -0
- package/assets/esri/core/workers/chunks/{8103d06f760a2c79773d.js → 0a8ba5cb857f61de40fb.js} +15 -15
- package/assets/esri/core/workers/chunks/152f1c08197955224ad3.js +1 -0
- package/assets/esri/core/workers/chunks/1a0903b1d2d5101977c6.js +1 -0
- package/assets/esri/core/workers/chunks/{de541ad390a8d258d2e6.js → 1d5db8746a4f1ed1d18f.js} +1 -1
- package/assets/esri/core/workers/chunks/1effde6a39ef0d4af525.js +1 -0
- package/assets/esri/core/workers/chunks/{2a5176533e78a92d8e5b.js → 20c729fca2e4b4c6b28d.js} +1 -1
- package/assets/esri/core/workers/chunks/23d50c4478f40a7d62bf.js +1 -0
- package/assets/esri/core/workers/chunks/2623cd08487fdc9a94f1.js +1 -0
- package/assets/esri/core/workers/chunks/2c3fc2805f6de0963789.js +1 -0
- package/assets/esri/core/workers/chunks/2c4f10eaf02ef090ee8f.js +1 -0
- package/assets/esri/core/workers/chunks/314bc1b356d43bfa72a8.js +1 -0
- package/assets/esri/core/workers/chunks/{34544c79ce568f30a094.js → 31762eb20a9a0ed3f8b0.js} +1 -1
- package/assets/esri/core/workers/chunks/{26dca1d387183282276a.js → 318a2702632aaa4d3a63.js} +1 -1
- package/assets/esri/core/workers/chunks/3526ab3b1f87c24ae6f8.js +1 -0
- package/assets/esri/core/workers/chunks/{0b169bb1969f86232a1a.js → 35b3ff25f5fe24fe15e2.js} +1 -1
- package/assets/esri/core/workers/chunks/{81808c3aead7dfac3049.js → 38cfedce779dd75bd217.js} +1 -1
- package/assets/esri/core/workers/chunks/{5075e85e1eafd431a8c0.js → 39c994536ce6c1e5c956.js} +1 -1
- package/assets/esri/core/workers/chunks/3b74749db78bcba2bc16.js +1 -0
- package/assets/esri/core/workers/chunks/3d83ac791212b81c9d11.js +1 -0
- package/assets/esri/core/workers/chunks/3ecb906322a6a5c8c93b.js +1 -0
- package/assets/esri/core/workers/chunks/3f67162456a1f02190fa.js +1 -0
- package/assets/esri/core/workers/chunks/{ef46ef4f0ee9f2aeaa4a.js → 426b8e1e2eef2460851d.js} +1 -1
- package/assets/esri/core/workers/chunks/4376bc2934a996d8bc27.js +1 -0
- package/assets/esri/core/workers/chunks/44d0ca9d4c5f1722688c.js +1 -0
- package/assets/esri/core/workers/chunks/{c187bc997bad61b6c6e9.js → 47f21b65065558d583ca.js} +1 -1
- package/assets/esri/core/workers/chunks/{e25bcfdd8f20f8a08b19.js → 4d57c771af4137f74bfb.js} +1 -1
- package/assets/esri/core/workers/chunks/4e4419282c4bf7ee4678.js +1 -0
- package/assets/esri/core/workers/chunks/4e788fc6cb2ea936f676.js +1 -0
- package/assets/esri/core/workers/chunks/4f51963815b0d53ffbd9.js +1 -0
- package/assets/esri/core/workers/chunks/5100b5a6a506c704dfaf.js +1 -0
- package/assets/esri/core/workers/chunks/52afd43bbe23e358efb5.js +1 -0
- package/assets/esri/core/workers/chunks/5aba23584e0b230c75f5.js +1 -0
- package/assets/esri/core/workers/chunks/{d3c760109a70a71448c5.js → 67773a9f031d9f1d672f.js} +1 -1
- package/assets/esri/core/workers/chunks/6f7193b9ff5942c0d354.js +1 -0
- package/assets/esri/core/workers/chunks/70737052bab29fcaa120.js +1 -0
- package/assets/esri/core/workers/chunks/718d2d430c1a5a940b83.js +1 -0
- package/assets/esri/core/workers/chunks/71c996e1ae84d9daddf2.js +1 -0
- package/assets/esri/core/workers/chunks/753e0b21e57c12c742ee.js +1 -0
- package/assets/esri/core/workers/chunks/764c8ba14ab74b66b391.js +1 -0
- package/assets/esri/core/workers/chunks/{1996f0a930abdd97b855.js → 7a8ed08cd173963b3112.js} +1 -1
- package/assets/esri/core/workers/chunks/{4a20f7a0700fd14a129f.js → 7dcf804e1918b94fa4e1.js} +3 -10
- package/assets/esri/core/workers/chunks/{cc697c4d9cdc116373dc.js → 81726d997a2d34449bb2.js} +1 -1
- package/assets/esri/core/workers/chunks/{74e1826ad9e2c4fd3b42.js → 81883bca8a79ee2ddb00.js} +1 -1
- package/assets/esri/core/workers/chunks/{9fee0110dc7fee4c95e2.js → 854c320af09b6afc4b80.js} +2 -2
- package/assets/esri/core/workers/chunks/85505a8b8b0794656d06.js +1 -0
- package/assets/esri/core/workers/chunks/859bc873e7af911a518f.js +1 -0
- package/assets/esri/core/workers/chunks/{8407c91cce31e087b41b.js → 886ae23a1d8fa21e531f.js} +1 -1
- package/assets/esri/core/workers/chunks/{3ff7aa216cd794d951e8.js → 8e99f937fd36cf2cd05f.js} +1 -1
- package/assets/esri/core/workers/chunks/{c357c0a08b99c1e7f290.js → 9331969046f2b277d620.js} +1 -1
- package/assets/esri/core/workers/chunks/93d08d82ceab19e314f8.js +1 -0
- package/assets/esri/core/workers/chunks/97a654e8054302582a3b.js +1 -0
- package/assets/esri/core/workers/chunks/97d2bdbea39cbcf8fd0f.js +1 -0
- package/assets/esri/core/workers/chunks/a0208e35b217808777c4.js +1 -0
- package/assets/esri/core/workers/chunks/{f25bb204cf6727f6fdef.js → a0876a52a3c2ad849370.js} +1 -1
- package/assets/esri/core/workers/chunks/{7ad09ac5793e8d47b4b2.js → a4b970a841b3085500fc.js} +1 -1
- package/assets/esri/core/workers/chunks/aa5f36d7ed59c625ba78.js +1 -0
- package/assets/esri/core/workers/chunks/b045bffb4f2eb9203183.js +1 -0
- package/assets/esri/core/workers/chunks/b590402170ae289290d7.js +1 -0
- package/assets/esri/core/workers/chunks/b9935cc8e2bd4045058a.js +1 -0
- package/assets/esri/core/workers/chunks/{1a527c0740d9f4fa0791.js → bc547cf814d6703cef59.js} +1 -1
- package/assets/esri/core/workers/chunks/bcc097271f5cdf0a97a7.js +1 -0
- package/assets/esri/core/workers/chunks/bdc66ef2b6ed783047d5.js +1 -0
- package/assets/esri/core/workers/chunks/be1d2c3a61e6447fbbc7.js +1 -0
- package/assets/esri/core/workers/chunks/bf6ae205fbfbfcd1a0ee.js +1 -0
- package/assets/esri/core/workers/chunks/bfd1aef8ac795e1ce227.js +1 -0
- package/assets/esri/core/workers/chunks/c148ad0ea9258046ac1f.js +1 -0
- package/assets/esri/core/workers/chunks/{0f75c19d8e296a32e329.js → c2cd80b712f29e8cbb8d.js} +1 -1
- package/assets/esri/core/workers/chunks/cc0efa716b8414a44398.js +1 -0
- package/assets/esri/core/workers/chunks/{8f6833671c071b522923.js → cd66bd30f654fe571e57.js} +1 -1
- package/assets/esri/core/workers/chunks/cf41a66fb97c1076fb34.js +1 -0
- package/assets/esri/core/workers/chunks/cf8ce21dc649021e97f6.js +1 -0
- package/assets/esri/core/workers/chunks/d2f47f21ce0b0ab4da17.js +262 -0
- package/assets/esri/core/workers/chunks/d3be4d914fc99a1d686c.js +1 -0
- package/assets/esri/core/workers/chunks/dbd2bfcbf3e0f86f07b8.js +1 -0
- package/assets/esri/core/workers/chunks/{6675d56f49d07a97dc40.js → dd0c1cf921369e2bc48b.js} +1 -1
- package/assets/esri/core/workers/chunks/df18b0a653b328d8d052.js +1 -0
- package/assets/esri/core/workers/chunks/df54e741db40b308c2dd.js +2 -0
- package/assets/esri/core/workers/chunks/{89e09276086745aa21fa.js → e4e2f479c0c45ae1b2c3.js} +1 -1
- package/assets/esri/core/workers/chunks/e656fd5ecf9ac059a87b.js +1 -0
- package/assets/esri/core/workers/chunks/{58a7cdebc3d182c15ec6.js → e77df11aee136d64ff0f.js} +1 -1
- package/assets/esri/core/workers/chunks/{7a474ce61cf484df87b4.js → e80376832050a4b6d28a.js} +1 -1
- package/assets/esri/core/workers/chunks/{f75295cdd5e84eb97d5a.js → e8d65900eefff1152207.js} +1 -1
- package/assets/esri/core/workers/chunks/f116331c6eca937aac8e.js +1 -0
- package/assets/esri/core/workers/chunks/{3b837b512999e6ab24bc.js → f148666308071bdb185a.js} +1 -1
- package/assets/esri/core/workers/chunks/f23e995320674b32e142.js +1 -0
- package/assets/esri/core/workers/chunks/f334bf192dff5af10a70.js +1 -0
- package/assets/esri/core/workers/chunks/f76b1fc36f5606cac2c8.js +1 -0
- package/assets/esri/core/workers/chunks/{893c0d28a5bf3f9f29f1.js → f93facf47aba9b128fcc.js} +1 -1
- package/assets/esri/core/workers/chunks/fa1336b60278017d2525.js +1 -0
- package/assets/esri/core/workers/chunks/{c911f0b5bdd43b66b731.js → fa3faec65882c5b6f1a0.js} +1 -1
- package/assets/esri/core/workers/chunks/fccc34b86454c56f27ab.js +1 -0
- package/assets/esri/libs/parquet/pkg/bundle_bg.wasm +0 -0
- package/assets/esri/rest/knowledgeGraph/wasmInterface/arcgis-knowledge-client-core-simd.wasm +0 -0
- package/assets/esri/rest/knowledgeGraph/wasmInterface/arcgis-knowledge-client-core.wasm +0 -0
- package/assets/esri/themes/base/widgets/_BatchAttributeForm.scss +5 -1
- package/assets/esri/themes/dark/main.css +1 -1
- package/assets/esri/themes/light/main.css +1 -1
- package/assets/esri/themes/light/view.css +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_en.json +1 -1
- package/chunks/{ComponentShader.glsl.js → Component.glsl.js} +11 -11
- package/chunks/GlobalIlluminationBlur.glsl.js +7 -7
- package/chunks/GlowBlur.glsl.js +5 -6
- package/chunks/LineMarker.glsl.js +27 -26
- package/chunks/MeasurementArrow.glsl.js +5 -4
- package/chunks/RibbonLine.glsl.js +1 -8
- package/chunks/Terrain.glsl.js +24 -26
- package/chunks/arcgis-knowledge-client-core-simd.js +1 -1
- package/chunks/arcgis-knowledge-client-core.js +1 -1
- package/chunks/bundle2.js +1 -1
- package/config.js +1 -1
- package/core/promiseUtils.d.ts +1 -1
- package/core/promiseUtils.js +1 -1
- package/core/units.js +1 -1
- package/form/types.d.ts +1 -1
- package/geometry/Mesh.d.ts +220 -95
- package/geometry/operators/support/projectionZScaling.js +1 -1
- package/geometry/support/MeshGeoreferencedVertexSpace.d.ts +35 -13
- package/geometry/support/MeshLocalVertexSpace.d.ts +32 -8
- package/geometry/support/MeshVertexAttributes.d.ts +6 -2
- package/geometry/support/heightModelInfoUtils.js +1 -1
- package/geometry/support/zscale.js +1 -1
- package/graphic/{AnnotationGraphicOrigin.d.ts → AnnotationFeatureGraphicOrigin.d.ts} +9 -9
- package/graphic/{AnnotationGraphicOrigin.js → AnnotationFeatureGraphicOrigin.js} +1 -1
- package/interfaces.d.ts +3 -3
- package/kernel.js +1 -1
- package/layers/{AnnotationLayer.d.ts → AnnotationFeatureLayer.d.ts} +24 -24
- package/layers/AnnotationFeatureLayer.js +2 -0
- package/layers/GaussianSplatLayer.d.ts +4 -1
- package/layers/graphics/data/QueryEngine.js +1 -1
- package/layers/graphics/data/queryUtils.js +1 -1
- package/layers/graphics/sources/parquet/ParquetFileStatistics.js +1 -1
- package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
- package/layers/graphics/sources/support/parquetIdUtils.js +1 -1
- package/layers/save/featureLayerUtils.js +1 -1
- package/layers/support/AnnotationSublayer.d.ts +7 -7
- package/layers/support/FeatureEffect.d.ts +3 -2
- package/layers/support/arcgisLayers.js +1 -1
- package/layers/support/fetchService.js +1 -1
- package/layers/support/layerUtils.js +1 -1
- package/layers/support/layersLoader.js +1 -1
- package/layers/support/parquetUtils.js +1 -1
- package/layers/support/schemaValidator.js +1 -1
- package/layers/types.d.ts +1 -1
- package/networks/Network.js +1 -1
- package/networks/UtilityNetwork.js +1 -1
- package/networks/support/networkFieldUtils.js +1 -1
- package/package.json +2 -2
- package/portal/schemas/definitions.js +1 -1
- package/portal/schemas/gaussianSplatLayerItem.js +2 -0
- package/portal/schemas/integratedMesh3DTilesLayerItem.js +1 -1
- package/portal/support/loadUtils.js +1 -1
- package/renderers/support/types.d.ts +1 -1
- package/renderers/visualVariables/RotationVariable.d.ts +1 -16
- package/renderers/visualVariables/RotationVariable.js +1 -1
- package/rest/knowledgeGraph/ReplicaDefinition.d.ts +0 -2
- package/rest/knowledgeGraph/ServiceDefinition.d.ts +1 -1
- package/rest/knowledgeGraph/wasmInterface/replicaToWasmEncodedFactories.js +1 -1
- package/rest/knowledgeGraph/wasmInterface/wasmToReplicaFactories.js +1 -1
- package/rest/knowledgeGraphService.js +1 -1
- package/rest/networks/support/QueryAssociationsParameters.d.ts +2 -2
- package/rest/networks/support/SynthesizeAssociationGeometriesParameters.d.ts +2 -2
- package/rest/networks/support/TraceParameters.d.ts +2 -2
- package/rest/support/AttributeBinsQuery.js +1 -1
- package/rest/support/Query.js +1 -1
- package/rest/support/TopFeaturesQuery.js +1 -1
- package/support/revision.js +1 -1
- package/views/2d/engine/webgl/TextureManager.js +1 -1
- package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
- package/views/2d/engine/webgl/util/createMatcher.js +1 -1
- package/views/2d/layerViewModuleImportUtils.js +1 -1
- package/views/2d/layers/AnnotationFeatureLayerView2D.js +2 -0
- package/views/2d/layers/FeatureLikeLayerView2D.js +1 -1
- package/views/2d/layers/TileLayerView2D.js +1 -1
- package/views/2d/layers/features/sources/strategies/support/queryAdapters.js +1 -1
- package/views/2d/layers/support/annodime/annotationSchema.js +1 -1
- package/views/2d/types.d.ts +2 -2
- package/views/3d/analysis/LineOfSight/LineOfSightTool.js +1 -1
- package/views/3d/analysis/ShadowCast/ShadowCastTooltip.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedTool2.js +1 -1
- package/views/3d/layerViewModuleImportUtils.js +1 -1
- package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
- package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
- package/views/3d/support/GaussianSplatSortWorker.js +1 -1
- package/views/3d/support/GaussianSplatWorkerHandle.js +1 -1
- package/views/3d/support/gaussianSplatting/GaussianSplatDataStore.js +1 -1
- package/views/3d/support/gaussianSplatting/GaussianSplatOrderTexture.js +1 -1
- package/views/3d/support/gaussianSplatting/GaussianSplatTextureAtlas.js +1 -1
- package/views/3d/terrain/Tile.js +1 -1
- package/views/3d/terrain/isTerrainSurfaceLayer.js +1 -1
- package/views/3d/types.d.ts +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/{ComponentShader.glsl.js → Component.glsl.js} +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentTechnique.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/TextureBackedBuffer.glsl.js +7 -7
- package/views/3d/webgl-engine/core/shaderLibrary/TextureBackedBufferFields.glsl.js +29 -20
- package/views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/util/DiscardOrAdjustAlpha.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/util/GaussianSplatTextureFetch.glsl.js +6 -8
- package/views/3d/webgl-engine/lib/Compositor.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/TextureBackedBuffer/TexelFormatInfo.js +2 -0
- package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBackedBufferFieldCreation.js +1 -1
- package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBackedBufferLayout.js +1 -1
- package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBuffer.js +1 -1
- package/views/3d/webgl-engine/materials/ColorMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/PathTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/materials/WaterTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/CheckerBoardTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/ColorMaterialTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/DefaultMaterialTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/HUDMaterialTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/ImageMaterialTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/LineCalloutTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/LineMarker.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/LineMarkerTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/MeasurementArrow.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/MeasurementArrowTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/NativeLineTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/OutputColorHighlightOLID.glsl.js +10 -10
- package/views/3d/webgl-engine/shaders/PatternTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/RibbonLineTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/ShadedColorMaterialTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/SlicePlaneMaterialTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/TerrainTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/alphaCutoff.glsl.js +1 -1
- package/views/SceneView.d.ts +1 -1
- package/views/layers/{AnnotationLayerView.d.ts → AnnotationFeatureLayerView.d.ts} +6 -6
- package/views/layers/FeatureLikeLayerView.d.ts +2 -2
- package/views/layers/FeatureLikeLayerView.js +1 -1
- package/webdoc/widgets/FloorFilter.d.ts +14 -1
- package/webdoc/widgets/FloorFilter.js +1 -1
- package/webscene/support/AlphaCutoff.js +1 -1
- package/widgets/AreaMeasurement2D/AreaMeasurement2DTool.js +1 -1
- package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.d.ts +12 -4
- package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
- package/widgets/BatchAttributeForm/ReactiveGraphic.js +1 -1
- package/widgets/BatchAttributeForm/ValueChangeTransaction.js +2 -0
- package/widgets/BatchAttributeForm/VisibleElements.d.ts +8 -1
- package/widgets/BatchAttributeForm/VisibleElements.js +1 -1
- package/widgets/BatchAttributeForm/batchAttributeFormUtils.js +1 -1
- package/widgets/BatchAttributeForm/css.js +1 -1
- package/widgets/BatchAttributeForm/expressions/ExpressionsManager.js +1 -1
- package/widgets/BatchAttributeForm/expressions/ExpressionsModel.js +1 -1
- package/widgets/BatchAttributeForm/inputs/BatchFormInputs.d.ts +3 -0
- package/widgets/BatchAttributeForm/inputs/BatchFormInputs.js +1 -1
- package/widgets/BatchAttributeForm/inputs/FieldInput.js +1 -1
- package/widgets/BatchAttributeForm/inputs/GroupInput.js +1 -1
- package/widgets/BatchAttributeForm/inputs/InputBase.js +1 -1
- package/widgets/BatchAttributeForm/inputs/RelationshipElementInput.js +1 -1
- package/widgets/BatchAttributeForm/inputs/support/inputUtils.js +1 -1
- package/widgets/BatchAttributeForm/interfaceUtils.js +1 -1
- package/widgets/BatchAttributeForm/stringUtils.js +2 -0
- package/widgets/BatchAttributeForm/templates/support/createBatchFormTemplate.js +1 -1
- package/widgets/BatchAttributeForm/types.d.ts +19 -3
- package/widgets/BatchAttributeForm.js +1 -1
- package/widgets/Editor/AddAssociationWorkflow.js +1 -1
- package/widgets/Editor/AddAssociationWorkflowData.js +1 -1
- package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
- package/widgets/Editor/EditorViewModel.d.ts +1 -1
- package/widgets/Editor/EditorViewModel.js +1 -1
- package/widgets/Editor/MergeFeaturesWorkflow.d.ts +3 -3
- package/widgets/Editor/MergeFeaturesWorkflow.js +1 -1
- package/widgets/Editor/SplitFeatureWorkflow.d.ts +3 -3
- package/widgets/Editor/SplitFeatureWorkflow.js +1 -1
- package/widgets/Editor/UpdateFeatureWorkflow.js +1 -1
- package/widgets/Editor/UpdateFeaturesWorkflow.js +1 -1
- package/widgets/Editor/UpdateRecordWorkflow.js +1 -1
- package/widgets/Editor/UpdateRecordWorkflowData.js +1 -1
- package/widgets/Editor/UpdateWorkflow.js +1 -1
- package/widgets/Editor/components/UpdateFeaturePanelContent.js +1 -1
- package/widgets/Editor/support/SketchController.js +1 -1
- package/widgets/Editor/workflowUtils.js +1 -1
- package/widgets/Editor.js +1 -1
- package/widgets/FloorFilter/FloorFilterViewModel.d.ts +10 -0
- package/widgets/FloorFilter/FloorFilterViewModel.js +1 -1
- package/assets/esri/core/workers/chunks/07cc5743cb6a9fd68adb.js +0 -1
- package/assets/esri/core/workers/chunks/0bb159ba0226122465cf.js +0 -1
- package/assets/esri/core/workers/chunks/160e5b99f1097a473e6b.js +0 -1
- package/assets/esri/core/workers/chunks/17e68828ca6ff6912d3e.js +0 -1
- package/assets/esri/core/workers/chunks/1e340536d3c5f94920b5.js +0 -1
- package/assets/esri/core/workers/chunks/24810c36ae09bb4e83dc.js +0 -1
- package/assets/esri/core/workers/chunks/274b82cb183ddd0042f3.js +0 -1
- package/assets/esri/core/workers/chunks/297ae764445e6f73a5ea.js +0 -1
- package/assets/esri/core/workers/chunks/29aba121db7f00e0cf81.js +0 -1
- package/assets/esri/core/workers/chunks/2a3145a595d19391bb8a.js +0 -1
- package/assets/esri/core/workers/chunks/3297658ccd8d4b9ce733.js +0 -1
- package/assets/esri/core/workers/chunks/38ca59db0e8f45bd7811.js +0 -1
- package/assets/esri/core/workers/chunks/3c5534c576528c1921d2.js +0 -1
- package/assets/esri/core/workers/chunks/40b3cdf81c79bbc44527.js +0 -2
- package/assets/esri/core/workers/chunks/41f12eb7c9b7086528d5.js +0 -1
- package/assets/esri/core/workers/chunks/426156137f279d979ddd.js +0 -1
- package/assets/esri/core/workers/chunks/4714241189c13d0db897.js +0 -1
- package/assets/esri/core/workers/chunks/537c5dd4cd0a067199d1.js +0 -1
- package/assets/esri/core/workers/chunks/538537f9bc866d9caa75.js +0 -1
- package/assets/esri/core/workers/chunks/5437a1c05c1bd2175981.js +0 -1
- package/assets/esri/core/workers/chunks/58ac245ff7fb57c1004f.js +0 -1
- package/assets/esri/core/workers/chunks/5c7aff9604b4576a0e1d.js +0 -1
- package/assets/esri/core/workers/chunks/5d3ddbf94539cb4f493e.js +0 -1
- package/assets/esri/core/workers/chunks/5eb9fdb076488de9cd83.js +0 -1
- package/assets/esri/core/workers/chunks/603177137eb680afe371.js +0 -1
- package/assets/esri/core/workers/chunks/629099f05ca5c9ca1973.js +0 -1
- package/assets/esri/core/workers/chunks/62f78fa455d556008f6a.js +0 -1
- package/assets/esri/core/workers/chunks/686c51fd2144e132783e.js +0 -1
- package/assets/esri/core/workers/chunks/6f0341cfa4c68e6e60b3.js +0 -1
- package/assets/esri/core/workers/chunks/70229007d594536ba6a3.js +0 -1
- package/assets/esri/core/workers/chunks/7e89cb9ff615742e0894.js +0 -1
- package/assets/esri/core/workers/chunks/890b7a1153b7f65eba9a.js +0 -1
- package/assets/esri/core/workers/chunks/9660ae52fb3951a19e9c.js +0 -1
- package/assets/esri/core/workers/chunks/a4245bd4e67a428fd835.js +0 -1
- package/assets/esri/core/workers/chunks/ac33b10fe65f9e9e824f.js +0 -1
- package/assets/esri/core/workers/chunks/b5937ce657c1fff3864f.js +0 -1
- package/assets/esri/core/workers/chunks/b895674c0550826ecb28.js +0 -262
- package/assets/esri/core/workers/chunks/c3cf9e6e91f71c9cc5f3.js +0 -1
- package/assets/esri/core/workers/chunks/c80fc1b3048e8d58a1f8.js +0 -1
- package/assets/esri/core/workers/chunks/cc3e895cff019e811c07.js +0 -1
- package/assets/esri/core/workers/chunks/d122431f3b0b88dcb488.js +0 -1
- package/assets/esri/core/workers/chunks/d24e027bb8b2c09f25c8.js +0 -1
- package/assets/esri/core/workers/chunks/d2df8c328054dc6cb7b7.js +0 -1
- package/assets/esri/core/workers/chunks/d41caf20c26f80385265.js +0 -1
- package/assets/esri/core/workers/chunks/d468994822f9bc3d6279.js +0 -1
- package/assets/esri/core/workers/chunks/d63f532dd7d60ee8ef2c.js +0 -1
- package/assets/esri/core/workers/chunks/d64613209a9eb1eafb11.js +0 -1
- package/assets/esri/core/workers/chunks/d7be278aed1fb37ad5ec.js +0 -1
- package/assets/esri/core/workers/chunks/d8ec0afb2b91ccf32e55.js +0 -1
- package/assets/esri/core/workers/chunks/da1e8b338ab9fe9e0a8e.js +0 -1
- package/assets/esri/core/workers/chunks/dd920a6f6422fa213eba.js +0 -1
- package/assets/esri/core/workers/chunks/e279bcbe4f10e87bde6c.js +0 -1
- package/assets/esri/core/workers/chunks/e2de13810dce01b98520.js +0 -1
- package/assets/esri/core/workers/chunks/e5837e5ac6ef761f26a2.js +0 -1
- package/assets/esri/core/workers/chunks/e82488b9b3bb0c1dedb4.js +0 -1
- package/assets/esri/core/workers/chunks/f274a8e8c7ca4294e876.js +0 -1
- package/assets/esri/core/workers/chunks/f292c2c22a3822343118.js +0 -1
- package/assets/esri/core/workers/chunks/f4f642ddd4d5db7cbbb4.js +0 -1
- package/assets/esri/core/workers/chunks/f6d047358d14328f3622.js +0 -1
- package/assets/esri/core/workers/chunks/fb6605be0c5e36785543.js +0 -1
- package/assets/esri/core/workers/chunks/fd70a25ffdf2cc6c5be2.js +0 -1
- package/layers/AnnotationLayer.js +0 -2
- package/views/2d/layers/AnnotationLayerView2D.js +0 -2
- /package/assets/esri/core/workers/chunks/{9fee0110dc7fee4c95e2.js.LICENSE.txt → 854c320af09b6afc4b80.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{40b3cdf81c79bbc44527.js.LICENSE.txt → df54e741db40b308c2dd.js.LICENSE.txt} +0 -0
- /package/views/layers/{AnnotationLayerView.js → AnnotationFeatureLayerView.js} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{substitute as t}from"../intl.js";import{deprecateWidget as a}from"../core/deprecate.js";import i from"../core/Logger.js";import{getOrCreateMapValue as n}from"../core/MapUtils.js";import{destroyMaybe as s}from"../core/maybe.js";import l from"../core/ReactiveMap.js";import{watch as o,when as r,on as c,sync as d}from"../core/reactiveUtils.js";import{formatFileSize as m}from"../core/unitFormatUtils.js";import{property as h,subclass as u}from"../core/accessorSupport/decorators.js";import{formatDate as p}from"../intl/date.js";import{isIntegerField as g}from"../layers/support/fieldUtils.js";import{isString as v}from"../support/guards.js";import b from"./Widget.js";import{getAttachmentTypeCategory as f,getCalciteIconForAttachment as _}from"./Attachments/support/attachmentUtils.js";import{getAttachmentKey as C,getAttachmentFilenameParts as A,isImageAttachment as y}from"./BatchAttributeForm/attachmentUtils.js";import{getHiddenFieldsValidationErrorMessage as I,getVisibleFieldInputValidationErrorMessage as w,isElementTemplateWithInputType as F}from"./BatchAttributeForm/batchAttributeFormUtils.js";import k from"./BatchAttributeForm/BatchAttributeFormViewModel.js";import{css as M}from"./BatchAttributeForm/css.js";import{makeAddAttachmentFooterButtons as x,makeDiscardAttachmentFooterButtons as D,makeResetAttachmentFooterButtons as E,makeReplaceAttachmentFooterButtons as S,makeViewingAttachmentFooterButtons as L,makeCancelFooterButton as O,makeDefaultFooterButtons as T}from"./BatchAttributeForm/interfaceUtils.js";import V from"./BatchAttributeForm/VisibleElements.js";import{isGroupInput as R,isFieldInput as N,isTextElementInput as U,isRelationshipElementInput as P,isAttachmentElementInput as B,isUtilityNetworkAssociationsElementInput as $,differentValuesString as z,getNormalizedFieldName as j}from"./BatchAttributeForm/inputs/support/inputUtils.js";import{clearMultipleChoiceOtherChoiceStateForViewModel as W,getMultipleChoiceCheckboxState as H,otherChoiceCheckedPlaceholderValue as Z,getUpdatedMultipleChoiceValueForFeature as G,getMultipleChoiceSelectAllState as q,splitMultipleChoiceValue as K,canRestoreMultipleChoiceOtherChoiceDraftValue as X}from"./BatchAttributeForm/inputs/support/multipleChoiceInputUtils.js";import{loadRelationshipDetailsComponents as J,RelationshipDetails as Q}from"./BatchAttributeForm/rendered-content/RelationshipDetails.js";import{downloadAttachmentInfo as Y}from"./FeatureTable/support/exportUtils.js";import{loadCalciteComponents as ee}from"./support/componentsUtils.js";import{getLabelForDateFieldValue as te,getIntlOptionsForField as ae,prepareISOFieldValueForDateComponents as ie,prepareUnixFieldValueForDateComponents as ne,normalizeTimeOnlyString as se,getISOFieldValueFromDateComponents as le,getUnixFieldValueFromDateComponents as oe}from"./support/dateUtils.js";import{globalCss as re}from"./support/globalCss.js";import{calciteListFilterProps as ce}from"./support/listUtils.js";import{messageBundle as de,vmEvent as me,tsx as he}from"./support/widget.js";import{setFocus as ue}from"./support/widgetUtils.js";import{isEmptyValue as pe}from"./support/forms/formUtils.js";const ge="data-element-id",ve="esri_BatchAttributeForm_select_all",be="esri_BatchAttributeForm_other_choice";let fe=class extends b{constructor(e,t){super(e,t),this.headingLevel=2,this.messagesCommon=null,this.messages=null,this.featureTableMessages=null,this.messagesUnits=null,this.viewModel=new k,this.visibleElements=new V,this.groupDisplay="all",this._associationsList=null,this._associationsWidgetsMap=new l,this._attemptFocusOnNextRender=!1,this._dateComponentMap=new Map,this._touchedInputs=new Set,this._focusedFieldInput=null,this._batchSwitchInputInitialValues=new Map,this._listObserverNode=null,this._listObserver=new IntersectionObserver(e=>{e.length&&e[0].isIntersecting&&this.viewModel.activeRelationshipInput?.incrementPage()},{root:window.document}),this._attachmentDialogInfo=null,this._attachmentListFilterText="",this._attachmentFileInputMap=new Map,this._selectedAttachmentReplaceFileInput=null,this._afterListObserverCreated=e=>{this.viewModel.activeRelationshipInput&&(this._listObserverNode=e)},this._afterListObserverRemoved=()=>{this._listObserverNode=null},this._maximizeSelectedAttachment=()=>{this._attachmentDialogInfo=this.selectedAttachmentDetails},this._enterAttachmentReplaceView=()=>{const e=this.selectedAttachmentDetails;this._canReplaceSelectedAttachment()&&e&&(e.input.clearValidationCriteriaState(),this.viewModel.setShowingSelectedAttachmentReplacePage(!0))},this._setSelectedAttachmentReplaceFileInput=e=>{this._selectedAttachmentReplaceFileInput=e},this._openSelectedAttachmentReplaceFilePicker=()=>{this._canReplaceSelectedAttachment()&&this._selectedAttachmentReplaceFileInput?.click()},this._resetSelectedAttachmentName=()=>{const e=this.selectedAttachmentDetails,t=e?.attachment.globalId,a=e?e.input.getAttachmentEditState(e.attachment).initialName:null;e&&t&&null!=a&&this.viewModel.stageRenameAttachment(e.input.template.elementId,t,a)},this._resetSelectedAttachmentChanges=()=>{const e=this.selectedAttachmentDetails,t=e?.attachment.globalId;e&&t&&this.viewModel.resetAttachmentChanges(e.input.template.elementId,t)},this._deleteSelectedAttachment=()=>{const e=this.selectedAttachmentDetails,t=e?.attachment.globalId;e&&t&&!this._isSelectedAttachmentDeleteDisabled()&&(this.viewModel.stageDeleteAttachment(e.input.template.elementId,t),this._setSelectedAttachment(null))},this._closeAttachmentDialog=()=>{this.hideAttachmentDialog()},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),e?.suppressDeprecationWarning||(this.announceDeprecation=()=>{a(i.getLogger(this),"Editor","arcgis-editor",{version:"5.0"})})}normalizeCtorArgs(e={}){const{suppressDeprecationWarning:t,...a}=e;return a}initialize(){this.addHandles([o(()=>this.features,()=>{this._dateComponentMap.clear(),this._resetTransientFormState(),W(this.viewModel,{includeDraftValues:!0})}),o(()=>this.viewModel.activeForm,()=>{this._batchSwitchInputInitialValues.clear(),this._resetTransientFormState(),W(this.viewModel)}),o(()=>this.viewModel.selectedAttachmentAddElementId,()=>{this.hideAttachmentDialog()}),r(()=>!this.selectedAttachmentDetails,()=>this.hideAttachmentDialog()),o(()=>this.viewModel.selectedAttachmentListElementId,()=>{this._attachmentListFilterText=""}),o(()=>[this.viewModel.activeRelationshipInput,this._listObserverNode],()=>this._onObserverChange()),c(()=>this.viewModel,"submit",()=>{this.valid||this.goToFirstError()}),o(()=>[this._associationsEnabled,this.viewModel.activeForm.allUtilityNetworkAssociationsElementInputs],()=>this._setUpAssociationsWidgets(),d),o(()=>this.viewModel.activeAssociationsInput,e=>this._onActiveAssociationsInputChange(e))])}loadDependencies(){return Promise.all([ee({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),block:()=>import("@esri/calcite-components/dist/components/calcite-block"),button:()=>import("@esri/calcite-components/dist/components/calcite-button"),checkbox:()=>import("@esri/calcite-components/dist/components/calcite-checkbox"),chip:()=>import("@esri/calcite-components/dist/components/calcite-chip"),combobox:()=>import("@esri/calcite-components/dist/components/calcite-combobox"),"combobox-item":()=>import("@esri/calcite-components/dist/components/calcite-combobox-item"),"combobox-item-group":()=>import("@esri/calcite-components/dist/components/calcite-combobox-item-group"),dialog:()=>import("@esri/calcite-components/dist/components/calcite-dialog"),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"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),input:()=>import("@esri/calcite-components/dist/components/calcite-input"),"input-date-picker":()=>import("@esri/calcite-components/dist/components/calcite-input-date-picker"),"input-message":()=>import("@esri/calcite-components/dist/components/calcite-input-message"),"input-number":()=>import("@esri/calcite-components/dist/components/calcite-input-number"),"input-time-picker":()=>import("@esri/calcite-components/dist/components/calcite-input-time-picker"),"input-time-zone":()=>import("@esri/calcite-components/dist/components/calcite-input-time-zone"),label:()=>import("@esri/calcite-components/dist/components/calcite-label"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),loader:()=>import("@esri/calcite-components/dist/components/calcite-loader"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice"),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")}),J()])}destroy(){this._destroyAssociationsWidgets(),this._listObserverNode&&this._listObserver.unobserve(this._listObserverNode)}get activeFeatureIndex(){return this.viewModel.activeFeatureIndex}set activeFeatureIndex(e){this.viewModel.activeFeatureIndex=e}get attachmentsEnabled(){return this.viewModel.attachmentsEnabled}set attachmentsEnabled(e){this.viewModel.attachmentsEnabled=e}get callbacks(){return this.viewModel.callbacks}set callbacks(e){this.viewModel.callbacks=e}get disabled(){return this.viewModel.disabled}set disabled(e){this.viewModel.disabled=e}get effectiveTitle(){const{features:e,messages:t,page:a}=this;return"replacing-attachment"===a?t.titles.replaceAttachment:"viewing-attachment-details"===a?t.titles.editAttachment:"adding-attachments"===a?t.titles.addAttachments:"viewing-attachments"===a?t.titles.attachments:1===e.length||this.activeFeatureIndex>-1?t.titles.editFeature:e.length>1?t.titles.editFeatures:""}get effectiveDisabled(){return this.disabled||this.viewModel.updating}get features(){return this.viewModel.features}set features(e){this.viewModel.features=e}get footerButtonInfos(){if(!this.features.length)return[];const{messages:e,messagesCommon:t,page:a}=this,i=this.readOnly||this.effectiveDisabled,n=this._getSelectedAttachmentEditState(),s=this.viewModel.selectedAttachmentAddElementId;return"adding-attachments"===a&&s?x({messages:e,onclick:()=>this._attachmentFileInputMap.get(s)?.click()}):n?.isReplaced&&"replacing-attachment"!==a?D({label:t.remove,onclick:this._resetSelectedAttachmentChanges}):n?.isRenamed?E({messages:e}):"replacing-attachment"===a?S({disabled:i,messages:e,onclick:this._openSelectedAttachmentReplaceFilePicker}):"viewing-attachment-details"===a?L({deleteDisabled:this._isSelectedAttachmentDeleteDisabled(),deleteOnclick:this._deleteSelectedAttachment,doneOnclick:()=>this._setSelectedAttachment(null),messages:e.footerButtons}):"viewing-associated-features"===a?O({messages:t,purpose:"cancel-viewing-associated-features",onclick:this.goBack}):"viewing-associated-layers"===a?O({messages:t,purpose:"cancel-viewing-associated-layers",onclick:this.goBack}):"viewing-attachments"===a||"viewing-related-records"===a?[]:T({disabled:!this.viewModel.submittable||i,formId:this._formId,messages:e,callback:this.submit})}get footerNoticeInfos(){if(!this.features.length)return[];const{messages:{footerNotices:e}}=this;return this._isSelectedAttachmentDeleteDisabled()?[{icon:"information",message:e.deleteDisabledMinimumAttachments}]:[]}get map(){return this.viewModel.map}set map(e){this.viewModel.map=e}get maximumFeatureCount(){return this.viewModel.maximumFeatureCount}set maximumFeatureCount(e){this.viewModel.maximumFeatureCount=e}get maximumFeatureCountWithComplexForms(){return this.viewModel.maximumFeatureCountWithComplexForms}set maximumFeatureCountWithComplexForms(e){this.viewModel.maximumFeatureCountWithComplexForms=e}get spatialReference(){return this.viewModel.spatialReference}set spatialReference(e){this.viewModel.spatialReference=e}get layerInfos(){return this.viewModel.layerInfos}set layerInfos(e){this.viewModel.layerInfos=e}get timeZone(){return this.viewModel.timeZone}set timeZone(e){this.viewModel.timeZone=e}get icon(){return"edit-attributes"}set icon(e){this._overrideIfSome("icon",e)}get page(){return this.viewModel.page}get readOnly(){return this.viewModel.readOnly}set readOnly(e){this.viewModel.readOnly=e}get selectedAttachment(){return this.viewModel.selectedAttachment}get selectedAttachmentDetails(){return this.viewModel.selectedAttachmentDetails}get valid(){return this.viewModel.valid}get _associationsEnabled(){const{callbacks:e}=this;return!(!e?.addAssociation&&!e?.editAssociatedFeature)}get _formId(){return`${this.id}-form`}get _relatedRecordsEnabled(){const{callbacks:e}=this;return!(!e||!e.addRelatedRecord&&!e.editRelatedRecord)}async goBack(){return this.viewModel.goBack()}async goHome(){return this.viewModel.goHome()}goToFirstError(){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(){return he("div",{class:this.classes(M.base,re.widget,re.panel)},this._renderContent(),this._renderAttachmentDialog())}setActiveAssociationsInput(e){this.viewModel.setActiveAssociationsInput(e)}setActiveAssociationsLayer(e){this.viewModel.setActiveAssociationsLayer(e)}setActiveAssociationType(e){this.viewModel.setActiveAssociationType(e)}submit(){return this.viewModel.submit()}_setDateTimeTimeZoneMap(e){const{datePart:t,elementId:a}=e.dataset,i=n(this._dateComponentMap,`${a}`,()=>({}));switch(t){case"date":i.date=e;break;case"time":i.time=e;break;case"timeZone":i.timeZone=e}}_renderContent(){const{messages:e,viewModel:a}=this,{status:i}=a;return"failed"===i?a.hasTooManyComplexFeatures?this._renderErrorNotice(t(e.formFailedToLoadTooManyComplexFeatures,{num:a.maximumFeatureCountWithComplexForms})):a.hasTooManyFeatures?this._renderErrorNotice(t(e.formFailedToLoadTooManyFeatures,{num:a.maximumFeatureCount})):e.formFailedToLoad:a.expressionEvaluationFailed?this._renderErrorNotice(e.expressionEvaluationFailed):a.hasLayersWithContingentValues&&this.viewModel.features.length>1?this._renderErrorNotice(e.unsupportedContingentValues):"loading"===i&&this.visibleElements.loadingIndicator?he("calcite-loader",{key:"loader",label:this.messagesCommon?.loading}):0!==this.features.length?this._renderForm():void 0}_renderErrorNotice(e,t="warning"){return he("calcite-notice",{class:M.noticeError,icon:!0,kind:t,open:!0},he("div",{slot:"message"},e))}_renderForm(){return he("form",{class:M.form,id:this._formId,onsubmit:this._onFormSubmit},this._renderInvisibleFieldsError(),this._renderPage())}_renderPage(){switch(this.page){case"adding-attachments":return this._renderAttachmentAddPage();case"viewing-attachment-details":case"replacing-attachment":return this._renderAttachmentDetailPage();case"viewing-attachments":return this._renderAttachmentListPage();case"viewing-associated-layers":case"viewing-associated-features":return this._renderViewingAssociationsPage();case"viewing-related-categories":case"viewing-related-records":return this._renderRelationshipListPage();default:return this._renderFormContent()}}_renderInvisibleFieldsError(){const{viewModel:e}=this,{hasNonActiveInvalidFeatures:t,activeForm:a}=e;let i;if(!e.submitHasBeenAttempted)return null;if(a.invalidHiddenInputs.length>0)if(i=I(a,e.mode,this.messages),"batch"===this.viewModel.mode){const e=a.invalidHiddenInputs.filter(e=>"hidden:group-visibility-expression:all-features"===e.effectiveVisibilityCode||"hidden:visibility-expression:all-features"===e.visibilityCode);e.length>0?i+=` (${e.map(e=>e.label).join(", ")})`:i=null}else i+=` (${a.invalidHiddenInputs.map(e=>e.label).join(", ")})`;else if(t)return null;return i?this._renderErrorNotice(i,"danger"):null}_renderFormContent(){return this.viewModel.hasVisibleInputs?this.viewModel.activeForm.inputs.filter(e=>e.visible).map(e=>this._renderInput(e)):this._renderErrorNotice(this.messages.noVisibleFields[this.viewModel.noVisibleElementsReason])}_renderInput(e){return R(e)?this._renderGroupInput(e):N(e)?this._renderLabeledField(e):U(e)?this._renderTextComponent(e):P(e)?this._renderRelationshipElementInput(e):B(e)?this._renderAttachmentElementInput(e):$(e)?this._renderUtilityNetworkAssociationsElementInput(e):void 0}_renderGroupInput(e){const{inputs:t,template:a,open:i}=e,n=t.filter(e=>e.visible),s=a.label??"";return he("calcite-block",{class:this.classes(M.group,"sequential"===this.groupDisplay?M.groupSequential:null,this.disabled?M.inputDisabled:null),collapsible:!0,description:a.description??void 0,disabled:this.effectiveDisabled,expanded:i,heading:s,headingLevel:this.headingLevel,key:`{${a.elementId}-key}`,label:s,onCalciteBlockClose:()=>{e.open=!1},onCalciteBlockOpen:()=>{e.open=!0}},n.map(e=>this._renderInput(e)))}_renderLabeledField(e){const{elementId:a}=e.template,{label:i,required:n,dataType:s}=e,l=n?t(this.messages.requiredFieldLabel,{name:i}):i;return he("calcite-label",{"aria-label":l,class:M.label,key:`field--${a}`},he("div",{class:M.labelTextContent,key:"labelTextContainer"},i,n?he("span",{"aria-hidden":"true",title:this.messagesCommon.required},"*"):void 0),"unsupported"!==s?this._renderFieldInput(e):this._renderReadOnlyComponent(e),this._renderAuxiliaryText(e))}_renderFieldInput(e){const t=this.getCommonInputProps(e),{dataType:a}=e;return"date"===a?this._renderDateComponents(e,t):"coded-value"===e.domain?.type?this._renderCodedInputs({input:e,props:t}):null!==e.multipleChoiceChoices?this._renderMultipleChoiceComponent({input:e,props:t}):"number"===a?this._renderNumberComponent(e,t):this._renderStringComponent(e,t)}_renderAuxiliaryText(e){const{description:t}=e,a=this._getErrorToDisplay(e),i=a?w(e,a,this.messages):null;return i?he("calcite-input-message",{icon:!0,status:"invalid"},i):t?he("calcite-input-message",{class:M.description,icon:!1,status:"idle"},t):null}_renderCodedInputs({input:e,props:t}){const a=e.input?.type??null,i=e.codedValueOptions;switch(a){case"switch":return this._renderSwitchField({input:e,props:t});case"radio-buttons":return this._renderRadioButtonGroupComponent({input:e,options:i,props:t});default:return this._renderComboBoxComponent({options:i,props:t,input:e})}}_renderMultipleChoiceComponent({input:e,props:t}){const{messages:a}=this,{multipleChoiceChoices:i,multipleChoiceInput:n,multipleChoiceValues:s}=e;if(!n||!i||!s)return null;const l=!0===n.includeSelectAllChoices,o=new Map;let r=s.length>0,c=!1;for(const b of s){const t=H({input:e,choiceValue:b});o.set(b,t),(t.checked||t.indeterminate)&&(c=!0),t.checked||(r=!1)}const d={checked:r,indeterminate:!r&&c},m=d.checked?a.deselectAllLabel:a.selectAllLabel,h=e.getMultipleChoiceOtherChoiceRenderState(this.messages.otherOptionLabel),u=t=>{this._saveValueFromMultipleChoiceCheckbox({input:e,checkbox:t,isSelectAllCheckbox:!0})},p=t=>{this._saveValueFromMultipleChoiceCheckbox({input:e,checkbox:t})},g=t=>{const{fieldName:a}=h;a&&this._saveOtherChoiceCheckboxValue({input:e,isChecked:t.checked,otherChoiceFieldName:a})},v=t=>{this._saveValueFromMultipleChoiceTextInput({input:e,textInput:t,otherChoiceFieldName:h.fieldName})};return he("div",{class:M.multipleChoiceInput,key:`${t.key}-multiple-choice-group`},l?this._renderMultipleChoiceSelectAllCheckbox({props:t,selectAllState:d,selectAllLabel:m,handleSelectAllCheckboxChange:u}):null,this._renderMultipleChoiceChoiceCheckboxes({input:e,props:t,checkboxStatesByValue:o,handleChoiceCheckboxChange:p}),h.shouldShow?this._renderMultipleChoiceOtherChoice({props:t,includeSelectAllChoices:l,otherChoiceRenderState:h,handleOtherChoiceCheckboxChange:g,handleOtherChoiceInputChange:v,differentValuesPlaceholder:a.differentValuesPlaceholder}):null)}_renderMultipleChoiceSelectAllCheckbox({props:e,selectAllState:t,selectAllLabel:a,handleSelectAllCheckboxChange:i}){return he("calcite-checkbox",{afterCreate:e.afterCreate,afterUpdate:e.afterUpdate,"aria-invalid":e["aria-invalid"],checked:t.checked,class:M.multipleChoiceSelectAll,"data-element-id":e[ge],disabled:e.readOnly,indeterminate:t.indeterminate,key:`${e.key}-select-all`,label:a,labelText:a,value:ve,onblur:e.onblur,onCalciteCheckboxChange:({currentTarget:e})=>i(e),onfocus:e.onfocus})}_renderMultipleChoiceChoiceCheckboxes({input:e,props:t,checkboxStatesByValue:a,handleChoiceCheckboxChange:i}){const{multipleChoiceChoices:n}=e;return n?n.map(e=>{const n=a.get(e.value)??{checked:!1,indeterminate:!1};return he("calcite-checkbox",{afterCreate:t.afterCreate,afterUpdate:t.afterUpdate,"aria-invalid":t["aria-invalid"],checked:n.checked,class:t.class,"data-element-id":t[ge],disabled:t.readOnly,indeterminate:n.indeterminate,key:`${t.key}-${e.value}`,label:e.label,labelText:e.label,required:t.required,value:e.value,onblur:t.onblur,onCalciteCheckboxChange:({currentTarget:e})=>i(e),onfocus:t.onfocus})}):[]}_renderMultipleChoiceOtherChoice({props:e,includeSelectAllChoices:t,otherChoiceRenderState:a,handleOtherChoiceCheckboxChange:i,handleOtherChoiceInputChange:n,differentValuesPlaceholder:s}){return he("div",{class:this.classes(M.multipleChoiceOtherChoice,t?M.multipleChoiceOtherChoiceWithSelectAll:null),key:`${e.key}-other-choice`},he("calcite-checkbox",{afterCreate:e.afterCreate,afterUpdate:e.afterUpdate,"aria-invalid":e["aria-invalid"],checked:a.checkboxState.checked,class:e.class,"data-element-id":e[ge],disabled:e.readOnly,indeterminate:a.checkboxState.indeterminate,key:`${e.key}-other-choice-checkbox`,label:a.label,labelText:a.label,value:be,onblur:e.onblur,onCalciteCheckboxChange:({currentTarget:e})=>i(e),onfocus:e.onfocus}),a.checkboxState.checked?he("calcite-input",{afterCreate:e.afterCreate,afterUpdate:e.afterUpdate,"aria-invalid":e["aria-invalid"],"aria-label":a.label,class:M.textElementInput,"data-element-id":e[ge],disabled:e.readOnly,key:`${e.key}-other-choice-input`,maxLength:a.maxLength,placeholder:a.value===z?s:a.hint,required:e.required,type:"text",value:a.normalizedValue===z?"":a.normalizedValue?String(a.normalizedValue):"",onblur:e.onblur,onCalciteInputInput:({currentTarget:e})=>n(e),onfocus:e.onfocus}):null)}async _saveValueFromMultipleChoiceCheckbox({input:e,checkbox:t,isSelectAllCheckbox:a=!1}){if(this._markFieldInputTouched(e),e.multipleChoiceInput&&!a&&"batch"===this.viewModel.mode)return void await this._saveMultipleChoiceCheckboxValueByFeature({input:e,checkbox:t});const i=e.value,n=this._parseValue(t,e,a);n!==i&&await this.viewModel.setValue(e.template.elementId,n)}async _saveValueFromMultipleChoiceTextInput({input:e,textInput:t,otherChoiceFieldName:a}){if(!a)return;const i=t.value,n=null==i||""===i?null:i;e.initializeExplicitMultipleChoiceOtherChoiceCheckedState(),e.stashMultipleChoiceOtherChoiceDraftValueForFeatures(e.features,n);const s=j(e,a);s&&await this.viewModel.setValueForFieldName(s,n,e.template.elementId,Array.from(e.features,e=>e.source))}async _saveOtherChoiceCheckboxValue({input:e,isChecked:t,otherChoiceFieldName:a}){e.setExplicitMultipleChoiceOtherChoiceCheckedState(t),this._markFieldInputTouched(e),t||e.setMultipleChoiceOtherChoiceDraftValuesFromFeatures(e.features.toArray());const i=j(e,a);if(!i)return;const n=new Map;for(const s of e.features){const i=s.getAttribute(a);if(t){if(!pe(i))continue;const t=e.getMultipleChoiceOtherChoiceDraftValue(s),a=X(t)?t:Z;n.set(s,a);continue}null!=i&&n.set(s,null)}0!==n.size&&await this.viewModel.setValuePerFeatureForFieldName(i,new Map(Array.from(n,([e,t])=>[e.source,t])),e.template.elementId)}async _saveMultipleChoiceCheckboxValueByFeature({input:e,checkbox:t}){if(!e.multipleChoiceInput||!e.multipleChoiceValues)return;const a=new Map(e.features.map(a=>[a,G({input:e,choiceValue:t.value,currentValue:a.getAttribute(e.fieldName),isChecked:t.checked})]));0!==a.size&&await this.viewModel.setFieldInputValuePerFeature(e,a)}_renderSwitchField({input:e,props:t}){if((this._batchSwitchInputInitialValues.get(e)===z||e.value===z)&&"batch"===this.viewModel.mode){const a={dropdown:{afterCreate:this._afterComponentCreateOrUpdate,afterUpdate:this._afterComponentCreateOrUpdate,disabled:t.readOnly,open:!1,[ge]:t[ge]},trigger:{appearance:"transparent",iconEnd:"chevron-down",kind:"neutral",slot:"trigger",label:t.label},group:{mode:"single"}};return this._renderDropdownComponent({buttonValue:e.value,dropdownProps:a,options:[{name:this.messages.differentValuesPlaceholder,value:z,disabled:!0},...e.codedValueDomainOptions]})}return this._renderSwitchComponent({input:e,props:t})}_renderSwitchComponent({input:e,props:t}){return he("calcite-switch",{...t,checked:!!F(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:a}){const{trigger:i,dropdown:n,group:s}=a;return he("calcite-dropdown",{...n,topLayerDisabled:this.topLayerDisabled,onblur:()=>{this._focusedFieldInput=null},onCalciteDropdownSelect:({currentTarget:e})=>this._saveInput(e),onfocus:this._onComponentFocus},he("calcite-button",{...i},e===z?this.messages.differentValuesPlaceholder:e),he("calcite-dropdown-group",{selectionMode:s.mode},t.map(t=>he("calcite-dropdown-item",{disabled:t.disabled,label:String(t.name),selected:e===t.value},t.name))))}_renderComboBoxComponent({input:e,options:t,props:a}){const i="INSERT"===this.viewModel.editType,n=this._touchedInputs.has(e?.template?.elementId),s=i&&e.showNoValueOptionEnabled&&!n?()=>{}:a.onblur,l={...a,onblur:s};return he("calcite-combobox",{...l,selectionMode:"single",topLayerDisabled:this.topLayerDisabled,value:a.placeholder===this.messages.differentValuesPlaceholder?z:String(a.value),onCalciteComboboxChange:({currentTarget:e})=>{e.value!==z&&this._saveInput(e)}},this.renderComboboxOptionsList({input:e,options:t,props:a}))}renderComboboxOptionsList({input:e,options:t,props:a}){const i=e=>e.map(e=>{const{value:t}=e,i=pe(e.value)?this.messages.empty:e.name;return he("calcite-combobox-item",{heading:i,key:`#${t}`,selected:a.value===t,value:`${t}`})});let n=[];const{messages:s}=this;t.other.length>0&&n.push(he("calcite-combobox-item-group",{key:"other",label:s.other},i(t.other))),t.unsupported.length>0&&n.push(he("calcite-combobox-item-group",{key:"unsupported",label:s.unsupported},i(t.unsupported)));const l=i(t.recommended);n.length>0?n.unshift(he("calcite-combobox-item-group",{key:"recommended",label:s.recommended},l)):n=l;const o=a.placeholder===this.messages.differentValuesPlaceholder,r=!o&&pe(a.value);return e.showNoValueOptionEnabled&&!t.containsEmptyOption&&n.unshift(he("calcite-combobox-item",{heading:e.showNoValueLabel||this.messages.empty,key:"empty-option",selected:r,value:""})),o&&n.unshift(he("calcite-combobox-item",{heading:this.messages.differentValuesPlaceholder,key:z,selected:!0,value:z})),n}_renderRadioButtonGroupComponent({input:e,options:t,props:a}){const i=[...t.recommended,...t.other,...t.unsupported].map(({name:t,value:i})=>this._renderRadioButtons({label:t,value:i,selected:i===e.value,props:a}));if(e.showNoValueOptionEnabled&&!t.containsEmptyOption){const t="",n=e.showNoValueLabel||this.messages.empty,s=pe(e.value);i.unshift(this._renderRadioButtons({label:n,value:t,selected:s,props:a}))}return he("calcite-radio-button-group",{afterCreate:this._afterRadioGroupCreateOrUpdate,afterUpdate:this._afterRadioGroupCreateOrUpdate,class:M.inputRadioGroup,disabled:a.readOnly,key:`${a.key}-radio-group`,layout:"vertical",name:a.name,required:a.required},i,a.placeholder===this.messages.differentValuesPlaceholder?he("calcite-label",{class:M.placeholderRadio,key:a.label,layout:"inline"},he("calcite-radio-button",{checked:!0,class:M.inputRadio,disabled:!0,name:a.placeholder,value:a.placeholder}),a.placeholder):null)}_renderRadioButtons({value:e,selected:t,label:a,props:i}){return he("calcite-label",{class:M.inputRadioLabel,key:i.label,layout:"inline"},he("calcite-radio-button",{...i,afterCreate:void 0,afterUpdate:void 0,checked:t,class:M.inputRadio,disabled:i.readOnly,name:i.label,value:e,onblur:()=>{this._focusedFieldInput=null},onCalciteRadioButtonChange:({currentTarget:e})=>{e.checked&&this._saveInput(e)}}),a)}_renderStringComponent(e,t){const{template:a}=e;return!a.field.editable||this.readOnly?this._renderReadOnlyComponent(e):"text-area"===a.input?.type?he("calcite-text-area",{...t,class:this.classes(M.individualElement),resize:"vertical",value:t.value?String(t.value):"",onCalciteTextAreaInput:({currentTarget:e})=>this._saveInput(e)}):he("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 a=g(e.field);return he("calcite-input-number",{...t,integer:a,type:"number",value:a&&""!==t.value?Math.round(parseFloat(String(t.value))).toString():String(t.value),onCalciteInputNumberInput:({currentTarget:e})=>this._saveInput(e)})}_renderReadOnlyComponent(e,t){const a=this.getCommonInputProps(e);return he("calcite-input",{...a,class:this.classes(M.fieldInput,M.inputDisabled,M.individualElement),readOnly:!0,type:"text",value:String(t??a.value??"")})}_renderDateComponents(e,t){const{field:a}=e;let i;switch(a.type){case"date":i=this._renderDateFieldComponents(e,t);break;case"date-only":i=this._renderDateOnlyFieldComponent(e,t);break;case"time-only":i=this._renderTimeOnlyFieldComponent(e,t);break;case"timestamp-offset":i=this._renderTimestampOffsetFieldComponents(e,t);break;default:i=this._renderReadOnlyComponent(e,te(a,t.value,{timeZone:e.effectiveTimeZone,...ae(e.template.field)}))}return e.value===z?[i,he("calcite-input-message",{icon:"information",key:"diff-values-message",status:"idle"},this.messages.differentValues)]:i}_renderDateOnlyFieldComponent(e,t){const{class:a,key:i,readOnly:n}=t,{rawMax:s,rawMin:l}=e.range;return he("calcite-input-date-picker",{afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterComponentCreateOrUpdate,class:a,"data-date-part":"date","data-element-id":t[ge],key:`${i}-date-input`,max:v(s)?s:void 0,min:v(l)?l:void 0,overlayPositioning:"fixed",readOnly:n,topLayerDisabled:this.topLayerDisabled,value:e.value===z?"":e.value?String(e.value):"",onblur:()=>{this._focusedFieldInput=null},onCalciteInputDatePickerChange:t=>this._saveValueFromDateComponent(e,t.currentTarget),onfocus:this._onComponentFocus})}_renderTimeOnlyFieldComponent(e,t){const{class:a,key:i,readOnly:n}=t;return he("calcite-input-time-picker",{afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterComponentCreateOrUpdate,class:a,"data-date-part":"time","data-element-id":t[ge],key:`${i}-time-input`,overlayPositioning:"fixed",readOnly:n,value:e.value===z?"":e.value?String(e.value):"",onblur:()=>{this._focusedFieldInput=null},onCalciteInputTimePickerChange:t=>this._saveValueFromDateComponent(e,t.currentTarget),onfocus:this._onComponentFocus})}_renderTimestampOffsetFieldComponents(e,t){const{class:a,key:i,readOnly:n}=t,{rawMax:s,rawMin:l}=e.range,o=ie(s),r=ie(l),c=ie(e.value===z?"":e.value),d=e.includeTimeOffset,m={afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterComponentCreateOrUpdate,overlayPositioning:"fixed",readOnly:n,[ge]:t[ge],onfocus:this._onComponentFocus};return he("div",{class:M.dateInputContainer,key:`${i}-date-time-container`},he("calcite-input-date-picker",{...m,class:a,"data-date-part":"date",key:`${i}-date-input`,max:o?.date??void 0,min:r?.date??void 0,topLayerDisabled:this.topLayerDisabled,value:c.date??"",onblur:()=>{this._focusedFieldInput=null},onCalciteInputDatePickerChange:t=>this._saveValueFromDateComponent(e,t.target)}),he("calcite-input-time-picker",{...m,class:a,"data-date-part":"time",key:`${i}-time-input`,value:c.time??"",onblur:()=>{this._focusedFieldInput=null},onCalciteInputTimePickerChange:t=>this._saveValueFromDateComponent(e,t.target)}),d?he("calcite-input-time-zone",{...m,class:a,clearable:e.value===z||null==e.value,"data-date-part":"timeZone",key:`${i}-timezone-input`,value:c.timeZoneOffset||"",onblur:()=>{this._focusedFieldInput=null},onCalciteInputTimeZoneChange:t=>this._saveValueFromDateComponent(e,t.target)}):null)}_renderDateFieldComponents(e,t){const{class:a,key:i,readOnly:n,min:s,max:l}=t,o=e.effectiveTimeZone,r=ne(e.value===z?"":e.value,o),c=ne(l,o),d=ne(s,o),m=e.includeTime,h={afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterComponentCreateOrUpdate,overlayPositioning:"fixed",readOnly:n,[ge]:t[ge],onfocus:this._onComponentFocus};return he("div",{class:M.dateInputContainer,key:`${i}-date-time-container`},he("calcite-input-date-picker",{...h,class:a,"data-date-part":"date",key:`${i}-date-input`,max:c?.date??void 0,min:d?.date??void 0,topLayerDisabled:this.topLayerDisabled,value:r.date??"",onblur:()=>{this._focusedFieldInput=null},onCalciteInputDatePickerChange:t=>this._saveValueFromDateComponent(e,t.target)}),m?he("calcite-input-time-picker",{...h,"data-date-part":"time",key:`${i}-time-input`,step:1,value:r.time??"",onblur:()=>{this._focusedFieldInput=null},onCalciteInputTimePickerChange:t=>{this._saveValueFromDateComponent(e,t.target)}}):null)}_renderRelationshipElementInput(e){return this._relatedRecordsEnabled?he(Q,{afterObserverCreated:this._afterListObserverCreated,afterObserverRemoved:this._afterListObserverRemoved,input:e,messages:this.messages,messagesCommon:this.messagesCommon,viewModel:this.viewModel}):null}_renderRelationshipListPage(){const{activeRelationshipInput:e}=this.viewModel;if(e)return this._renderRelationshipElementInput(e)}_renderAttachmentElementInput(e){if(!this.attachmentsEnabled)return;const{allAttachmentsVisibleOnDefaultPage:t,attachments:a,defaultPageAttachments:i,template:{description:n,elementId:s,label:l}}=e,o=t?a:i;return he("div",{class:M.attachmentElementInput,"data-testid":`attachment-element-${s}`,key:`attachment-element-${s}`},l?he("div",{class:M.attachmentElementLabel,key:`attachment-element-label-${s}`},l):null,n?he("div",{class:M.description,key:`attachment-element-description-${s}`},n):null,a.length?this._renderAttachmentList(e,o,{label:l||this.messagesCommon.details,viewAllCount:t?null:a.length}):he("div",{class:M.attachmentElementEmptyState,key:`attachment-element-empty-state-${s}`},this.messages.attachments.noAttachments),this._renderAttachmentAddAction(e))}_renderAttachmentListPage(){const e=this.viewModel.selectedAttachmentListInput;if(e)return he("div",{class:M.attachmentElementAllPanel,key:`attachment-element-all-panel-${e.template.elementId}`},this._renderAttachmentList(e,e.attachments,{filterEnabled:!0,label:this.messages.titles.attachments}))}_renderAttachmentList(e,t,a){const{filterEnabled:i,label:n,viewAllCount:s}=a;return he("calcite-list",{class:M.attachmentElementList,filterEnabled:i,filterPlaceholder:i?this.messages.attachments.searchAttachments:void 0,filterProps:i?ce:void 0,filterText:i?this._attachmentListFilterText:void 0,label:n,selectionAppearance:"border",selectionMode:"none",onCalciteListFilter:i?e=>{this._attachmentListFilterText=e.currentTarget.filterText??""}:void 0},this._renderAttachmentListItems(e,t),null!=s?this._renderViewAllAttachmentsItem(e,s):null)}_renderAttachmentListItems(e,t){const{elementId:a}=e.template;return t.map((t,i)=>{const n=this._formatAttachmentSize(t.size),s=this._getAttachmentLabel(t,i,n,e.displayFilename),l=s===n?void 0:n,o=C(t),r=e.isStagedAttachmentAddition(t),c=e.getAttachmentEditState(t),d=c.isDeleted,m=!d&&(r||c.isRenamed||c.isReplaced);return he("calcite-list-item",{class:M.attachmentElementListItem,description:l,key:`attachment-item-${o}`,label:s,onCalciteListItemSelect:r||d?void 0:()=>this._setSelectedAttachment({attachmentKey:o,elementId:a})},he("div",{class:M.attachmentElementListItemStart,slot:"content-start"},this._renderAttachmentPreviewThumbnail(t,s,e)),m?he("span",{class:M.attachmentElementListItemStagedIndicator,slot:"content-end"}):null,r?[he("calcite-action",{disabled:this.effectiveDisabled,icon:"x",scale:"s",slot:"actions-end",text:this.messagesCommon.delete,title:this.messagesCommon.delete,onclick:()=>this.viewModel.stageDeleteAttachment(a,t.globalId)})]:d?he("calcite-chip",{label:this.messages.attachments.deleted,scale:"s",slot:"content-end"},this.messages.attachments.deleted):he("calcite-action",{icon:"chevron-right",scale:"s",slot:"actions-end",text:s,title:s}))})}_renderViewAllAttachmentsItem(e,a){const{elementId:i}=e.template,{viewAll:n}=this.messages.attachments;return he("calcite-list-item",{class:M.attachmentElementListItem,description:t(this.messages.attachments.count,{count:a}),key:`attachment-item-view-all-${i}`,label:n,onCalciteListItemSelect:()=>this._setAttachmentListElementId(i)},he("calcite-action",{icon:"chevron-right",scale:"s",slot:"actions-end",text:n,title:n}))}_renderAttachmentAddAction(e){const{elementId:t}=e.template,a=this.effectiveDisabled||e.addDisabled,i=this._renderAttachmentCountLimitsLabel(e),n=this._getAttachmentNoticeMessage(e),s=e.hasMinimumAttachmentCountNotMet||e.hasExceededAttachmentLimit?"danger":"info",l=e.canUploadFiles,o=e.isCaptureOnly&&!this.effectiveDisabled&&!n;return he("div",{class:M.attachmentElementAddActions,key:`attachment-element-add-actions-${t}`},l?he("calcite-button",{appearance:"outline",disabled:a,iconStart:"attachment",kind:"neutral",round:!0,scale:"s",onclick:()=>this._setAttachmentAddElementId(t)},this.messages.attachments.attach):null,this._renderAttachmentCaptureButton(e),o?this._renderAttachmentCaptureDisabledNotice(t):null,i?he("div",{class:M.attachmentElementEmptyActionHint},i):null,!this.effectiveDisabled&&n?he("calcite-notice",{closable:!1,icon:"danger"===s?"exclamation-mark-circle":"lightbulb",kind:s,open:!0,scale:"s",width:"full"},he("div",{slot:"message"},n)):null)}_renderAttachmentCaptureButton(e){if(!e.hasCaptureInputs)return null;const t=e.captureMediaType;return he("calcite-button",{appearance:"outline",disabled:!0,iconStart:_e(t),kind:"neutral",round:!0,scale:"s"},this._getCaptureButtonLabel(t))}_getAttachmentNoticeMessage(e){const t=this.messages.attachments;return e.hasUnsupportedFileTypeValidationError?this._getUnsupportedFileTypeMessage():e.hasMinimumAttachmentCountNotMet&&this._shouldShowMinimumAttachmentNotice(e)?t.minimumNotMet:e.hasExceededAttachmentLimit?t.attachmentLimitExceeded:e.hasReachedAttachmentLimit?t.attachmentLimitReached:null}_shouldShowMinimumAttachmentNotice(e){return e.hasAttachmentChanges||this.viewModel.submitHasBeenAttempted||this._touchedInputs.has(e.template.elementId)}_getCaptureButtonLabel(e){const{capture:t,recordAudio:a,takePhoto:i,takeVideo:n}=this.messages.attachments;switch(e){case"image":return i||t;case"video":return n||t;case"audio":return a||t;default:return t}}_renderAttachmentAddPage(){const e=this.viewModel.selectedAttachmentAddInput;return e?this._renderAttachmentAddPanel(e):null}_renderAttachmentAddPanel(e){const{maxAttachmentCount:t}=e,{elementId:a}=e.template;if(e.isCaptureOnly)return this._renderAttachmentCaptureDisabledNotice(a);const i=null==t||t-e.attachments.length>1,n=this.effectiveDisabled||e.addDisabled,s=this.messages.attachments,l=s.dragAndDropFile,o="upload",r=e=>{this._attachmentFileInputMap.set(a,e)};return he("div",{class:M.attachmentElementAddPanel,key:`attachment-element-add-panel-${a}`},he("input",{accept:e.accept,afterCreate:r,afterRemoved:()=>{this._attachmentFileInputMap.delete(a)},afterUpdate:r,class:M.attachmentElementFileInput,"data-element-id":a,disabled:n,multiple:i,type:"file",onchange:e=>{const t=e.currentTarget,i=t.files?Array.from(t.files):[];this._stageAttachmentFiles(a,i),t.value=""}}),he("div",{class:M.attachmentElementAddDropzone,"data-disabled":n?"true":"false",ondragover:e=>{e.preventDefault()},ondrop:e=>{if(e.preventDefault(),n)return;const t=e.dataTransfer?.files?Array.from(e.dataTransfer.files):[];this._stageAttachmentFiles(a,t)}},he("calcite-icon",{class:M.attachmentElementAddDropzoneIcon,icon:o,scale:"l"}),he("div",{class:M.attachmentElementAddDropzoneHeading},s.addFile),he("div",{class:M.attachmentElementAddDropzoneDetail,title:l},l),he("calcite-button",{appearance:"transparent",disabled:n,iconStart:"folder-open",kind:"brand",scale:"s",type:"button",onclick:e=>{e.stopPropagation(),this._openAttachmentFilePicker(a,n)}},s.selectFile)),this._renderAttachmentValidationCriteria(e,{includeCountCriteria:!0}))}_renderAttachmentCaptureDisabledNotice(e){return he("calcite-notice",{class:M.attachmentElementCaptureNotice,icon:!0,key:`attachment-element-capture-disabled-notice-${e}`,kind:"warning",open:!0,scale:"s"},he("div",{slot:"message"},this.messages.attachments.captureMethodNotSupported))}async _stageAttachmentFiles(e,t){if(0===t.length)return;const a=this.viewModel.selectedAttachmentAddInput;let i=!0;try{i=(await this.viewModel.stageAddAttachments(e,t)).length>0&&!a?.hasInvalidValidationCriteria&&!a?.hasUnsupportedFileTypeValidationError}finally{i&&this.viewModel.setSelectedAttachmentAddElementId(null)}}_openAttachmentFilePicker(e,t){t||this._attachmentFileInputMap.get(e)?.click()}_renderAttachmentDetailPage(){const e=this.selectedAttachmentDetails;if(!e)return;if("replacing-attachment"===this.page)return this._renderAttachmentReplacePanel(e);const{attachment:t,input:a}=e,i=C(t),n=!!a.getAttachmentPreviewUrl(t),s=a.getAttachmentEditState(t),{baseName:l,extension:o}=A(t.name),r=!this.readOnly&&!this.effectiveDisabled,c=r&&a.canUploadFiles;return he("div",{class:M.attachmentElementDetail,key:`attachment-detail-panel-${a.template.elementId}-${i}`},he("div",{class:M.attachmentElementDetailPreview},this._renderAttachmentPreviewImageForInput(t,a)),he("div",{class:M.attachmentElementDetailActions},y(t)?he("calcite-button",{appearance:"outline",disabled:!n,iconStart:"expand",kind:"neutral",label:this.messages.attachments.maximize,scale:"m",title:this.messages.attachments.maximize,onclick:this._maximizeSelectedAttachment}):null,he("calcite-button",{appearance:"outline",disabled:!n,iconStart:"download",kind:"neutral",label:this.messages.attachments.download,scale:"m",title:this.messages.attachments.download,onclick:()=>{this._downloadAttachment(t)}}),he("calcite-button",{appearance:"outline",disabled:!c,iconStart:"upload-to",kind:"neutral",label:this.messages.attachments.replace,scale:"m",title:this.messages.attachments.replace,onclick:this._enterAttachmentReplaceView})),he("div",{class:M.attachmentElementDetailMetadata},he("div",{class:M.attachmentElementDetailMetadataGroup},he("span",{class:M.attachmentElementDetailMetadataLabel},this.messages.attachments.fileName),a.allowUserRename?he("div",{class:M.attachmentElementDetailFileNameRow},he("calcite-input",{class:M.attachmentElementDetailFileNameInput,disabled:!r,scale:"m",suffixText:o,value:l,onCalciteInputInput:({currentTarget:e})=>this._renameSelectedAttachment(e.value)}),he("calcite-button",{appearance:"transparent",disabled:!r||null==s.initialName||!s.isRenamed,iconStart:"reset",kind:"neutral",scale:"m",title:this.messages.footerButtons.reset,onclick:this._resetSelectedAttachmentName})):he("span",{class:M.attachmentElementDetailMetadataValue},t.name)),he("div",{class:M.attachmentElementDetailMetadataGroup},he("span",{class:M.attachmentElementDetailMetadataLabel},this.messages.attachments.size),he("span",{class:M.attachmentElementDetailMetadataValue},this._formatAttachmentSize(t.size))),he("div",{class:M.attachmentElementDetailMetadataGroup},he("span",{class:M.attachmentElementDetailMetadataLabel},this.messages.attachments.type),he("span",{class:M.attachmentElementDetailMetadataValue},this._getLabelForAttachmentType(t)))))}_renderAttachmentReplacePanel(e){const{attachment:t,input:a}=e,i=this.readOnly||this.effectiveDisabled||!a.canUploadFiles,n=a.template.elementId;return he("div",{class:M.attachmentElementAddPanel,key:`attachment-replace-panel-${n}-${C(t)}`},he("input",{accept:a.accept,afterCreate:this._setSelectedAttachmentReplaceFileInput,afterRemoved:()=>{this._selectedAttachmentReplaceFileInput=null},afterUpdate:this._setSelectedAttachmentReplaceFileInput,class:M.attachmentElementFileInput,disabled:i,type:"file",onchange:e=>{const t=e.currentTarget,a=t.files?.[0];a&&this._stageSelectedAttachmentReplacement(a),t.value=""}}),he("div",{class:M.attachmentElementAddDropzone,"data-disabled":i?"true":"false",ondragover:e=>{e.preventDefault()},ondrop:e=>{if(e.preventDefault(),i)return;const t=e.dataTransfer?.files?.[0];t&&this._stageSelectedAttachmentReplacement(t)}},he("calcite-icon",{class:M.attachmentElementAddDropzoneIcon,icon:"refresh",scale:"l"}),he("div",{class:M.attachmentElementAddDropzoneHeading},this.messages.attachments.replace),he("div",{class:M.attachmentElementAddDropzoneDetail,title:this.messages.attachments.dragAndDropFile},this.messages.attachments.dragAndDropFile),he("calcite-button",{appearance:"transparent",disabled:i,iconStart:"folder-open",kind:"brand",scale:"s",onclick:e=>{e.stopPropagation(),this._openSelectedAttachmentReplaceFilePicker()}},this.messages.attachments.selectFile)),this._renderAttachmentValidationCriteria(a,{includeCountCriteria:!1}),he("div",{class:M.attachmentElementDetailMetadata},he("div",{class:M.attachmentElementDetailMetadataGroup},he("span",{class:M.attachmentElementDetailMetadataLabel},this.messages.attachments.fileToBeReplaced),he("span",{class:M.attachmentElementDetailMetadataValue},t.name))))}_renderAttachmentDialog(){const e=this._attachmentDialogInfo;if(!e)return null;const{attachment:t,input:a}=e;return he("calcite-dialog",{heading:t.name||this.messagesCommon.details,key:"attachment-preview-dialog",modal:!0,open:!0,placement:"cover",width:"l",onCalciteDialogClose:this._closeAttachmentDialog},he("div",{class:M.attachmentElementDetailPreview},this._renderAttachmentPreviewImageForInput(t,a)))}_setSelectedAttachment(e){e?.elementId&&this._touchedInputs.add(e.elementId),this.viewModel.setSelectedAttachment(e),e||this.hideAttachmentDialog()}_setAttachmentAddElementId(e){e&&this._touchedInputs.add(e),this.viewModel.setSelectedAttachmentAddElementId(e),this.viewModel.selectedAttachmentAddInput?.clearValidationCriteriaState(),this.hideAttachmentDialog()}_setAttachmentListElementId(e){e&&this._touchedInputs.add(e),this.viewModel.setSelectedAttachmentListElementId(e),this.hideAttachmentDialog()}_getAttachmentLabel(e,a,i,n){return!1!==n&&v(e.name)&&e.name.length>0?e.name:i!==this.messagesCommon.notApplicable?i:t(this.messages.attachments.attachmentNumberedLabel,{index:a+1})}_renderAttachmentCountLimitsLabel(e){const t=this.messages.attachments,a=null!=e.minAttachmentCount&&e.minAttachmentCount>0?this._renderAttachmentCountLimitLabel(t.minAttachmentsShort,e.minAttachmentCount,"min"):null,i=null!=e.maxAttachmentCount?this._renderAttachmentCountLimitLabel(t.maxAttachmentsShort,e.maxAttachmentCount,"max"):null;return a||i?[a,a&&i?he("span",{key:"attachment-count-limits-separator"},", "):null,i]:null}_renderAttachmentCountLimitLabel(e,a,i){const n="__count__",[s,l]=t(e,{count:n}).split(n);return he("span",{key:i},s,he("span",{class:M.attachmentElementEmptyActionHintValue},a),l)}_renderAttachmentValidationCriteria(e,{includeCountCriteria:t}){const a=this._getAttachmentValidationCriteria(e,{includeCountCriteria:t}),i=`attachment-validation-criteria-${e.template.elementId}`;return 0===a.length?null:he("div",{class:M.attachmentElementValidationCriteria,key:i},a.map(({key:e,message:t,state:a})=>he("calcite-notice",{appearance:"danger"===a?"outline-fill":"transparent",closable:!1,icon:!0,key:e,kind:a,open:!0,scale:"s",width:"full"},he("div",{slot:"message"},t))))}_getAttachmentValidationCriteria(e,{includeCountCriteria:a}){const i=[],n=e.validationCriterionStates,s=this.messages.attachments,l=this._getNestableAttachmentInputs(e.input);e.hasUnsupportedFileTypeValidationError&&i.push({key:"unsupported-file-type",message:this._getUnsupportedFileTypeMessage(),state:"danger"});for(const o of l)"document"===o.type&&null!=o.maxFileSize&&i.push({key:"maximum-file-size",message:t(s.maximumFileSize,{maxSize:this._formatAttachmentSizeLimitInMegabytes(o.maxFileSize)}),state:n.get("maximum-file-size")??"info"}),"audio"===o.type&&null!=o.maxDuration&&i.push({key:"maximum-audio-length",message:t(s.maximumAudioLength,{maxDuration:this._formatAttachmentDurationLimit(o.maxDuration)}),state:n.get("maximum-audio-length")??"info"}),"video"===o.type&&null!=o.maxDuration&&i.push({key:"maximum-video-length",message:t(s.maximumVideoLength,{maxDuration:this._formatAttachmentDurationLimit(o.maxDuration)}),state:n.get("maximum-video-length")??"info"});return a&&null!=e.minAttachmentCount&&e.minAttachmentCount>0&&i.push({key:"minimum-number-of-files",message:t(s.minimumNumberOfFiles,{count:e.minAttachmentCount}),state:n.get("minimum-number-of-files")??"info"}),a&&null!=e.maxAttachmentCount&&i.push({key:"maximum-number-of-files",message:t(s.maximumNumberOfFiles,{count:e.maxAttachmentCount}),state:n.get("maximum-number-of-files")??"info"}),i}_getNestableAttachmentInputs(e){return null==e?[]:"attachment"===e.type?e.inputTypes?.slice()??[]:[e]}_getUnsupportedFileTypeMessage(){return this.featureTableMessages.errorFileUnsupported}_formatAttachmentSize(e){return null==e||Number.isNaN(e)?this.messagesCommon.notApplicable:m(this.messagesUnits,e)}_formatAttachmentSizeLimitInMegabytes(e){return m(this.messagesUnits,1048576*e)}_formatAttachmentDurationLimit(e){return p(1e3*Math.round(e),{...e>=3600?{hour:"2-digit",hourCycle:"h23"}:{},minute:"2-digit",second:"2-digit",timeZone:"UTC"})}_getLabelForAttachmentType({contentType:e}){if(!e)return this.messagesCommon.notApplicable;const t=this.messages.attachments.attachmentTypes,a=f(e);return t?.[a]||e}_renderAttachmentPreviewThumbnail(e,t,a){const i=a.getAttachmentPreviewUrl(e,64);return i&&y(e)?he("img",{alt:t,class:M.attachmentElementListItemThumb,src:i}):he("calcite-icon",{class:M.attachmentElementListItemIcon,icon:_(e.contentType),scale:"s"})}_renderAttachmentPreviewImageForInput(e,t){const a=t.getAttachmentPreviewUrl(e),i=e.name||this.messagesCommon.details;return a&&y(e)?he("img",{alt:i,class:M.attachmentElementDetailPreviewImage,src:a,title:i}):[he("calcite-icon",{class:M.attachmentElementDetailPreviewIcon,icon:_(e.contentType),scale:"l",textLabel:i,title:i}),this.messages.attachments.noPreviewAvailable]}async _downloadAttachment(e){await Y(e)}_canReplaceSelectedAttachment(){return!this.readOnly&&!this.effectiveDisabled&&!!this.selectedAttachmentDetails?.input.canUploadFiles}_exitAttachmentReplaceView(){this.viewModel.setShowingSelectedAttachmentReplacePage(!1),this._selectedAttachmentReplaceFileInput=null}async _stageSelectedAttachmentReplacement(e){const t=this.selectedAttachmentDetails,a=t?.attachment.globalId;if(!t||!a)return;let i=!1;try{i=await this.viewModel.stageReplaceAttachment(t.input.template.elementId,a,e)}finally{i&&this._exitAttachmentReplaceView()}}_renameSelectedAttachment(e){const t=this.selectedAttachmentDetails,a=t?.attachment.globalId;t&&a&&this.viewModel.stageRenameAttachment(t.input.template.elementId,a,e)}_isSelectedAttachmentDeleteDisabled(){const e=this.selectedAttachmentDetails;if(!e)return!1;if(this.readOnly||this.effectiveDisabled)return!0;const t=e.input.minAttachmentCount;return null!=t&&e.input.attachments.length<=t}hideAttachmentDialog(){this._attachmentDialogInfo=null}_renderTextComponent(e){const{elementId:t}=e.template;return he("div",{class:M.textElementInput,"data-testid":`text-element-${t}`,innerHTML:e.text,key:`text-element-${t}`})}_renderUtilityNetworkAssociationsElementInput(e){if(!this._associationsEnabled)return;const{elementId:t}=e.template;return he("div",{class:M.utilityNetworkAssociationsElementInput,"data-testid":t,key:t},this._associationsWidgetsMap.get(e)?.render())}getCommonInputProps(e){const{template:t,valid:a,value:i,minLength:n,maxLength:s,required:l,fieldName:o,editable:r,userHasChangedValue:c,range:{max:d,min:m}}=e,h=!r||this.readOnly,u=!h&&this.effectiveDisabled;let p=t.hint??void 0,g=!1;return i===z&&(p=this.messages.differentValuesPlaceholder,g=!0),{afterCreate:this._afterComponentCreateOrUpdate,afterUpdate:this._afterComponentCreateOrUpdate,"aria-invalid":a?"false":"true",class:this.classes(M.fieldInput,h?M.inputDisabled:null),status:!c&&!this.viewModel.submitHasBeenAttempted||a?"idle":"invalid",maxLength:s&&s>-1?s:void 0,minLength:n&&n>-1?n:void 0,key:t.elementId,label:o,name:o,max:null!=d?d:void 0,min:null!=m?m:void 0,disabled:u,readOnly:h,onblur:this._onComponentBlur,required:l,placeholder:p,value:g?"":i??"",[ge]:t.elementId,onfocus:this._onComponentFocus}}_onObserverChange(){this._listObserverNode&&this._listObserver.unobserve(this._listObserverNode);const e=this.viewModel.activeRelationshipInput;e&&this._listObserverNode&&e.showAllEnabled&&this._listObserver.observe(this._listObserverNode)}_onFormSubmit(e){e.preventDefault()}_getFieldInputFromHTMLElement(e){return this.viewModel.findFieldInput(e.getAttribute(ge))}_afterRadioGroupCreateOrUpdate(e){const t=e.selectedItem,a=e.querySelector("calcite-radio-button"),i=t||a;i&&this._afterComponentCreateOrUpdate(i)}_onComponentFocus(e){const t=e.target,a=this._getFieldInputFromHTMLElement(t);this._isMultipleChoiceCheckbox(t,a)||this._markFieldInputTouched(a),this._focusedFieldInput=a}_markFieldInputTouched(e){this._touchedInputs.add(e.template.elementId)}_isMultipleChoiceCheckbox(e,t){return"CALCITE-CHECKBOX"===e.tagName&&null!=t.multipleChoiceInput}_afterComponentCreateOrUpdate(e){const t=this._getFieldInputFromHTMLElement(e),a=this._focusedFieldInput;this._attemptFocusOnNextRender&&a===t&&(this._attemptFocusOnNextRender=!1,ue(e))}_onComponentBlur(){this._focusedFieldInput=null}_resetTransientFormState(){this._attemptFocusOnNextRender=!1,this._focusedFieldInput=null,this._attachmentDialogInfo=null,this._selectedAttachmentReplaceFileInput=null,this._attachmentListFilterText="",this._attachmentFileInputMap.clear()}_parseValue(e,t,a=!1){const i=t.multipleChoiceInput,n=t.multipleChoiceValues;if(i&&n){const s=i.choiceDelimiter,l=e;if(a){return q({input:t}).checked?null:n.length>0?n.join(s):null}const o=K(t.value,s).filter(e=>e!==z),r=new Set(o);l.checked?r.add(l.value):r.delete(l.value);const c=n.filter(e=>r.has(e));return c.length?c.join(s):null}if(F(t.template,"switch")){if("calcite-dropdown"===e.localName&&t.domain)for(const a of t.domain.codedValues)if(a.name===e.selectedItems[0].textContent)return a.code;return e.checked?t.template.input.onValue:t.template.input.offValue}const s=e.value;return null==s||""===s?null:"number"===t.dataType?"-0"===s||"-0."===s||"-0,"===s?s:parseFloat(s):"date"===t.field.type?parseFloat(s):s}_saveInput(e){const t=this._getFieldInputFromHTMLElement(e),{elementId:a}=t.template;if(!t)return;const i=t?.value;if(F(t.template,"switch")&&"single"!==this.viewModel.mode){const e=n(this._batchSwitchInputInitialValues,t,()=>t.value);this._batchSwitchInputInitialValues.set(t,null===e?i:e)}const s=this._parseValue(e,t);s!==i&&this.viewModel.setValue(a,s)}_afterDateComponentCreate(e){this._setDateTimeTimeZoneMap(e),this._afterComponentCreateOrUpdate(e)}_saveValueFromDateComponent(e,t){const{elementId:a}=e.template,i=e.field.type,n=this._dateComponentMap.get(`${a}`);if(!n)return;const s=e.effectiveTimeZone;let l=e.value===z?void 0:e.value,o=null;"date-only"===i?o=Array.isArray(t.value)?t.value[0]:t.value:"time-only"===i?(l=se(l),o=se(t.value)):o="timestamp-offset"===i?null!=t.value?le({dateComponent:n.date,timeComponent:n.time,oldValue:l,timeZoneComponent:n.timeZone,defaultTimeZone:s}):null:null!=t.value?oe({oldValue:l,dateComponent:n.date,timeZone:s,timeComponent:n.time?.value===z?void 0:n.time}):null,l!==o&&(null!==o&&t.value?this.viewModel.setValue(`${a}`,o):this.viewModel.setValue(`${a}`,null))}_getErrorToDisplay(e){const t=e.compositeError;return e.valid||!t?null:"contingent-values-validation-error::contingency-violation-error"===t||"contingent-values-validation-error::contingency-violation-warning"===t||this._touchedInputs.has(e.template.elementId)||this.viewModel.submitHasBeenAttempted?t:null}_renderViewingAssociationsPage(){return this._associationsList?.render()}_onActiveAssociationsInputChange(e){const t=this._associationsList;t&&(e?(t.associationInput=e,t.viewModel=e.viewModel):t.associationInput=null)}async _setUpAssociationsWidgets(){this._destroyAssociationsWidgets();const e=this.viewModel.activeForm.allUtilityNetworkAssociationsElementInputs;if(this._associationsEnabled&&0!==e.length){await this._setUpUtilityNetworkAssociationList();for(const t of e)this._associationsWidgetsMap.set(t,await this._createAssociationsWidget(t))}}async _setUpUtilityNetworkAssociationList(){if(this._associationsList)return;const e=(await import("./FeatureForm/FeatureFormUtilityNetworkAssociations/FeatureFormUtilityNetworkAssociationList.js")).default;this._associationsList=new e({onSelectLayer:this._onSelectAssociatedLayer.bind(this),onSelectFeature:this._onEditAssociatedFeature.bind(this),onAddAssociation:this._onAddAssociation.bind(this)})}async _createAssociationsWidget(e){return new(0,(await import("./Feature/FeatureUtilityNetworkAssociations.js")).default)({viewModel:e.viewModel,onSelectAssociationType:t=>this._onSelectAssociationType(e,t)})}_destroyAssociationsWidgets(){this._associationsList=s(this._associationsList),this._associationsWidgetsMap.forEach(e=>s(e)),this._associationsWidgetsMap.clear()}_onSelectAssociationType(e,{listType:t}){this.setActiveAssociationsInput(e),this.setActiveAssociationType(t)}_onSelectAssociatedLayer({layer:e}){this.setActiveAssociationsLayer(e)}async _onEditAssociatedFeature(e){const t=this.callbacks?.editAssociatedFeature,a=this.viewModel.activeAssociationsInput;if(!t||!a?.feature)return;const{association:i,feature:n}=e;await t({parentFeature:a.feature.plainGraphic,association:i,feature:n})}_onAddAssociation(e){const t=this.callbacks?.addAssociation,a=this.viewModel.activeAssociationsInput;if(!t||!a?.feature)return;const{associationType:i,utilityNetwork:n}=e;t({feature:a.feature.plainGraphic,associationType:i,utilityNetwork:n})}_getSelectedAttachmentEditState(){const e=this.selectedAttachmentDetails;if(e)return e.input.getAttachmentEditState(e.attachment)}};function _e(e){switch(e){case"audio":return _("audio/mpeg");case"video":return _("video/mp4");case"image":return _("image/png");default:return"camera"}}e([h()],fe.prototype,"activeFeatureIndex",null),e([h()],fe.prototype,"attachmentsEnabled",null),e([h()],fe.prototype,"callbacks",null),e([h()],fe.prototype,"disabled",null),e([h()],fe.prototype,"effectiveTitle",null),e([h()],fe.prototype,"effectiveDisabled",null),e([h()],fe.prototype,"features",null),e([h()],fe.prototype,"footerButtonInfos",null),e([h()],fe.prototype,"footerNoticeInfos",null),e([h()],fe.prototype,"map",null),e([h()],fe.prototype,"maximumFeatureCount",null),e([h()],fe.prototype,"maximumFeatureCountWithComplexForms",null),e([h()],fe.prototype,"spatialReference",null),e([h()],fe.prototype,"layerInfos",null),e([h()],fe.prototype,"timeZone",null),e([h()],fe.prototype,"headingLevel",void 0),e([h()],fe.prototype,"icon",null),e([h(),de("esri/t9n/common")],fe.prototype,"messagesCommon",void 0),e([h(),de("esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm")],fe.prototype,"messages",void 0),e([h(),de("esri/widgets/FeatureTable/t9n/FeatureTable")],fe.prototype,"featureTableMessages",void 0),e([h(),de("esri/core/t9n/Units")],fe.prototype,"messagesUnits",void 0),e([h()],fe.prototype,"page",null),e([h()],fe.prototype,"readOnly",null),e([h()],fe.prototype,"selectedAttachment",null),e([h()],fe.prototype,"selectedAttachmentDetails",null),e([h()],fe.prototype,"valid",null),e([h({type:k}),me(["attachments-change","value-change","values-change","submit"])],fe.prototype,"viewModel",void 0),e([h({type:V,nonNullable:!0})],fe.prototype,"visibleElements",void 0),e([h()],fe.prototype,"groupDisplay",void 0),e([h()],fe.prototype,"_associationsEnabled",null),e([h()],fe.prototype,"_associationsList",void 0),e([h()],fe.prototype,"_attemptFocusOnNextRender",void 0),e([h()],fe.prototype,"_formId",null),e([h()],fe.prototype,"_focusedFieldInput",void 0),e([h()],fe.prototype,"_relatedRecordsEnabled",null),e([h()],fe.prototype,"_listObserverNode",void 0),e([h()],fe.prototype,"_attachmentDialogInfo",void 0),e([h()],fe.prototype,"_attachmentListFilterText",void 0),fe=e([u("esri.widgets.BatchAttributeForm")],fe);const Ce=fe;export{Ce as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import{substitute as t}from"../intl.js";import{deprecateWidget as i}from"../core/deprecate.js";import a from"../core/Logger.js";import{getOrCreateMapValue as n}from"../core/MapUtils.js";import{destroyMaybe as s}from"../core/maybe.js";import l from"../core/ReactiveMap.js";import{watch as o,when as r,on as c,sync as d}from"../core/reactiveUtils.js";import{formatFileSize as m}from"../core/unitFormatUtils.js";import{property as h,subclass as u}from"../core/accessorSupport/decorators.js";import{formatDate as p}from"../intl/date.js";import{isIntegerField as g}from"../layers/support/fieldUtils.js";import{isString as v}from"../support/guards.js";import b from"./Widget.js";import{getAttachmentTypeCategory as f,getCalciteIconForAttachment as _}from"./Attachments/support/attachmentUtils.js";import{getAttachmentKey as C,getAttachmentFilenameParts as A,isImageAttachment as y}from"./BatchAttributeForm/attachmentUtils.js";import{getHiddenFieldsValidationErrorMessage as I,getVisibleFieldInputValidationErrorMessage as w,isElementTemplateWithInputType as F,flattenInputs as k}from"./BatchAttributeForm/batchAttributeFormUtils.js";import M from"./BatchAttributeForm/BatchAttributeFormViewModel.js";import{css as x}from"./BatchAttributeForm/css.js";import{makeAddAttachmentFooterButtons as D,makeDiscardAttachmentFooterButtons as E,makeResetAttachmentFooterButtons as S,makeReplaceAttachmentFooterButtons as L,makeViewingAttachmentFooterButtons as O,makeCancelFooterButton as T,makeDefaultFooterButtons as V}from"./BatchAttributeForm/interfaceUtils.js";import R from"./BatchAttributeForm/VisibleElements.js";import{isGroupInput as N,isFieldInput as U,isTextElementInput as P,isRelationshipElementInput as B,isAttachmentElementInput as $,isUtilityNetworkAssociationsElementInput as z,differentValuesString as j,getNormalizedFieldName as H,isGroupedInput as W}from"./BatchAttributeForm/inputs/support/inputUtils.js";import{clearMultipleChoiceOtherChoiceStateForViewModel as Z,getMultipleChoiceCheckboxState as G,otherChoiceCheckedPlaceholderValue as q,getUpdatedMultipleChoiceValueForFeature as K,getMultipleChoiceSelectAllState as X,splitMultipleChoiceValue as J,canRestoreMultipleChoiceOtherChoiceDraftValue as Q}from"./BatchAttributeForm/inputs/support/multipleChoiceInputUtils.js";import{loadRelationshipDetailsComponents as Y,RelationshipDetails as ee}from"./BatchAttributeForm/rendered-content/RelationshipDetails.js";import{downloadAttachmentInfo as te}from"./FeatureTable/support/exportUtils.js";import{loadCalciteComponents as ie}from"./support/componentsUtils.js";import{getLabelForDateFieldValue as ae,getIntlOptionsForField as ne,prepareISOFieldValueForDateComponents as se,prepareUnixFieldValueForDateComponents as le,normalizeTimeOnlyString as oe,getISOFieldValueFromDateComponents as re,getUnixFieldValueFromDateComponents as ce}from"./support/dateUtils.js";import{globalCss as de}from"./support/globalCss.js";import{Heading as me}from"./support/Heading.js";import{calciteListFilterProps as he}from"./support/listUtils.js";import{messageBundle as ue,vmEvent as pe,tsx as ge}from"./support/widget.js";import{setFocus as ve}from"./support/widgetUtils.js";import{isEmptyValue as be}from"./support/forms/formUtils.js";const fe="data-element-id",_e="data-field-name",Ce="esri_BatchAttributeForm_select_all",Ae="esri_BatchAttributeForm_other_choice";let ye=class extends b{constructor(e,t){super(e,t),this.headingLevel=2,this.messagesCommon=null,this.messages=null,this.featureFormMessages=null,this.featureTableMessages=null,this.messagesUnits=null,this.viewModel=new M,this.visibleElements=new R,this.groupDisplay="all",this._associationsList=null,this._associationsWidgetsMap=new l,this._attemptFocusOnNextRender=!1,this._dateComponentMap=new Map,this._touchedInputs=new Set,this._focusedFieldInput=null,this._batchSwitchInputInitialValues=new Map,this._listObserverNode=null,this._listObserver=new IntersectionObserver(e=>{e.length&&e[0].isIntersecting&&this.viewModel.activeRelationshipInput?.incrementPage()},{root:window.document}),this._attachmentDialogInfo=null,this._attachmentListFilterText="",this._attachmentFileInputMap=new Map,this._selectedAttachmentReplaceFileInput=null,this._afterListObserverCreated=e=>{this.viewModel.activeRelationshipInput&&(this._listObserverNode=e)},this._afterListObserverRemoved=()=>{this._listObserverNode=null},this._maximizeSelectedAttachment=()=>{this._attachmentDialogInfo=this.selectedAttachmentDetails},this._enterAttachmentReplaceView=()=>{const e=this.selectedAttachmentDetails;this._canReplaceSelectedAttachment()&&e&&(e.input.clearValidationCriteriaState(),this.viewModel.setShowingSelectedAttachmentReplacePage(!0))},this._setSelectedAttachmentReplaceFileInput=e=>{this._selectedAttachmentReplaceFileInput=e},this._openSelectedAttachmentReplaceFilePicker=()=>{this._canReplaceSelectedAttachment()&&this._selectedAttachmentReplaceFileInput?.click()},this._resetSelectedAttachmentName=()=>{const e=this.selectedAttachmentDetails,t=e?.attachment.globalId,i=e?e.input.getAttachmentEditState(e.attachment).initialName:null;e&&t&&null!=i&&this.viewModel.stageRenameAttachment(e.input.template.elementId,t,i)},this._resetSelectedAttachmentChanges=()=>{const e=this.selectedAttachmentDetails,t=e?.attachment.globalId;e&&t&&this.viewModel.resetAttachmentChanges(e.input.template.elementId,t)},this._deleteSelectedAttachment=()=>{const e=this.selectedAttachmentDetails,t=e?.attachment.globalId;e&&t&&!this._isSelectedAttachmentDeleteDisabled()&&(this.viewModel.stageDeleteAttachment(e.input.template.elementId,t),this._setSelectedAttachment(null))},this._closeAttachmentDialog=()=>{this.hideAttachmentDialog()},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),e?.suppressDeprecationWarning||(this.announceDeprecation=()=>{i(a.getLogger(this),"Editor","arcgis-editor",{version:"5.0"})})}normalizeCtorArgs(e={}){const{suppressDeprecationWarning:t,...i}=e;return i}initialize(){this.addHandles([o(()=>this.features,()=>{this._dateComponentMap.clear(),Z(this.viewModel,{includeDraftValues:!0})}),o(()=>this.viewModel.activeForm,()=>{this._batchSwitchInputInitialValues.clear(),this._resetTransientFormState(),Z(this.viewModel),this._setFocusableInput()}),o(()=>this.viewModel.selectedAttachmentAddElementId,()=>{this.hideAttachmentDialog()}),r(()=>!this.selectedAttachmentDetails,()=>this.hideAttachmentDialog()),o(()=>this.viewModel.selectedAttachmentListElementId,()=>{this._attachmentListFilterText=""}),o(()=>[this.viewModel.activeRelationshipInput,this._listObserverNode],()=>this._onObserverChange()),c(()=>this.viewModel,"submit",()=>{this.valid||this.goToFirstError()}),o(()=>[this._associationsEnabled,this.viewModel.activeForm.allUtilityNetworkAssociationsElementInputs],()=>this._setUpAssociationsWidgets(),d),o(()=>this.viewModel.activeAssociationsInput,e=>this._onActiveAssociationsInputChange(e))])}loadDependencies(){return Promise.all([ie({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),block:()=>import("@esri/calcite-components/dist/components/calcite-block"),button:()=>import("@esri/calcite-components/dist/components/calcite-button"),checkbox:()=>import("@esri/calcite-components/dist/components/calcite-checkbox"),chip:()=>import("@esri/calcite-components/dist/components/calcite-chip"),combobox:()=>import("@esri/calcite-components/dist/components/calcite-combobox"),"combobox-item":()=>import("@esri/calcite-components/dist/components/calcite-combobox-item"),"combobox-item-group":()=>import("@esri/calcite-components/dist/components/calcite-combobox-item-group"),dialog:()=>import("@esri/calcite-components/dist/components/calcite-dialog"),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"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),input:()=>import("@esri/calcite-components/dist/components/calcite-input"),"input-date-picker":()=>import("@esri/calcite-components/dist/components/calcite-input-date-picker"),"input-message":()=>import("@esri/calcite-components/dist/components/calcite-input-message"),"input-number":()=>import("@esri/calcite-components/dist/components/calcite-input-number"),"input-time-picker":()=>import("@esri/calcite-components/dist/components/calcite-input-time-picker"),"input-time-zone":()=>import("@esri/calcite-components/dist/components/calcite-input-time-zone"),label:()=>import("@esri/calcite-components/dist/components/calcite-label"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),loader:()=>import("@esri/calcite-components/dist/components/calcite-loader"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice"),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")}),Y()])}destroy(){this._destroyAssociationsWidgets(),this._associationsList=s(this._associationsList),this._listObserverNode&&this._listObserver.unobserve(this._listObserverNode)}get activeFeatureIndex(){return this.viewModel.activeFeatureIndex}set activeFeatureIndex(e){this.viewModel.activeFeatureIndex=e}get attachmentsEnabled(){return this.viewModel.attachmentsEnabled}set attachmentsEnabled(e){this.viewModel.attachmentsEnabled=e}get callbacks(){return this.viewModel.callbacks}set callbacks(e){this.viewModel.callbacks=e}get disabled(){return this.viewModel.disabled}set disabled(e){this.viewModel.disabled=e}get effectiveTitle(){const{features:e,messages:t,page:i}=this;return t?"replacing-attachment"===i?t.titles.replaceAttachment:"viewing-attachment-details"===i?t.titles.editAttachment:"adding-attachments"===i?t.titles.addAttachments:"viewing-attachments"===i?t.titles.attachments:1===e.length||this.activeFeatureIndex>-1?t.titles.editFeature:e.length>1?t.titles.editFeatures:"":""}get effectiveDisabled(){return this.disabled||this.viewModel.updating}get features(){return this.viewModel.features}set features(e){this.viewModel.features=e}get footerButtonInfos(){if(!this.features.length||!this.messages||!this.messagesCommon)return[];const{messages:e,messagesCommon:t,page:i}=this,a=this.readOnly||this.effectiveDisabled,n=this._getSelectedAttachmentEditState(),s=this.viewModel.selectedAttachmentAddElementId;return"adding-attachments"===i&&s?D({messages:e,onclick:()=>this._attachmentFileInputMap.get(s)?.click()}):n?.isReplaced&&"replacing-attachment"!==i?E({label:t.remove,onclick:this._resetSelectedAttachmentChanges}):n?.isRenamed?S({messages:e}):"replacing-attachment"===i?L({disabled:a,messages:e,onclick:this._openSelectedAttachmentReplaceFilePicker}):"viewing-attachment-details"===i?O({deleteDisabled:this._isSelectedAttachmentDeleteDisabled(),deleteOnclick:this._deleteSelectedAttachment,doneOnclick:()=>this._setSelectedAttachment(null),messages:e.footerButtons}):"viewing-associated-features"===i?T({messages:t,purpose:"cancel-viewing-associated-features",onclick:this.goBack}):"viewing-associated-layers"===i?T({messages:t,purpose:"cancel-viewing-associated-layers",onclick:this.goBack}):"viewing-attachments"===i||"viewing-related-records"===i?[]:V({disabled:a||!this.valid,formId:this._formId,messages:e,callback:this.submit})}get footerNoticeInfos(){if(!this.features.length||!this.messages)return[];const{messages:{footerNotices:e}}=this;return this._isSelectedAttachmentDeleteDisabled()?[{icon:"information",message:e.deleteDisabledMinimumAttachments}]:[]}get map(){return this.viewModel.map}set map(e){this.viewModel.map=e}get maximumFeatureCount(){return this.viewModel.maximumFeatureCount}set maximumFeatureCount(e){this.viewModel.maximumFeatureCount=e}get maximumFeatureCountWithComplexForms(){return this.viewModel.maximumFeatureCountWithComplexForms}set maximumFeatureCountWithComplexForms(e){this.viewModel.maximumFeatureCountWithComplexForms=e}get spatialReference(){return this.viewModel.spatialReference}set spatialReference(e){this.viewModel.spatialReference=e}get layerInfos(){return this.viewModel.layerInfos}set layerInfos(e){this.viewModel.layerInfos=e}get timeZone(){return this.viewModel.timeZone}set timeZone(e){this.viewModel.timeZone=e}get icon(){return"edit-attributes"}set icon(e){this._overrideIfSome("icon",e)}get page(){return this.viewModel.page}get readOnly(){return this.viewModel.readOnly}set readOnly(e){this.viewModel.readOnly=e}get selectedAttachment(){return this.viewModel.selectedAttachment}get selectedAttachmentDetails(){return this.viewModel.selectedAttachmentDetails}get valid(){return this.viewModel.valid}get _formHeaderVisible(){return!("batch"===this.viewModel.mode||!this.viewModel.activeFeature)&&!(!this.viewModel.formDescription&&!this.viewModel.formTitle)}get _associationsEnabled(){const{callbacks:e}=this;return!(!e?.addAssociation&&!e?.editAssociatedFeature)}get _formId(){return`${this.id}-form`}get _relatedRecordsEnabled(){const{callbacks:e}=this;return!(!e||!e.addRelatedRecord&&!e.editRelatedRecord)}async goBack(){return this.viewModel.goBack()}async goHome(){return this.viewModel.goHome()}goToFirstError(){const e=this.viewModel.getFirstVisibleInvalidFieldInput();if(!e)return;const{groupInput:t}=e;t&&(t.open||(t.open=!0)),this._setFocusableInput(e.input),this.scheduleRender()}render(){return ge("div",{class:this.classes(x.base,de.widget,de.panel)},this._renderContent(),this._renderAttachmentDialog())}setActiveAssociationsInput(e){this.viewModel.setActiveAssociationsInput(e)}setActiveAssociationsLayer(e){this.viewModel.setActiveAssociationsLayer(e)}setActiveAssociationType(e){this.viewModel.setActiveAssociationType(e)}submit(){return this.viewModel.submit()}_setDateTimeTimeZoneMap(e){const{datePart:t,elementId:i}=e.dataset,a=n(this._dateComponentMap,`${i}`,()=>({}));switch(t){case"date":a.date=e;break;case"time":a.time=e;break;case"timeZone":a.timeZone=e}}_renderContent(){const{messages:e,viewModel:i}=this,{status:a}=i;return"failed"===a?i.hasTooManyComplexFeatures?this._renderErrorNotice(t(e.formFailedToLoadTooManyComplexFeatures,{num:i.maximumFeatureCountWithComplexForms})):i.hasTooManyFeatures?this._renderErrorNotice(t(e.formFailedToLoadTooManyFeatures,{num:i.maximumFeatureCount})):e.formFailedToLoad:i.expressionEvaluationFailed?this._renderErrorNotice(e.expressionEvaluationFailed):i.hasLayersWithContingentValues&&this.viewModel.features.length>1?this._renderErrorNotice(e.unsupportedContingentValues):"loading"===a&&this.visibleElements.loadingIndicator?ge("calcite-loader",{key:"loader",label:this.messagesCommon?.loading}):0!==this.features.length?this._renderForm():void 0}_renderErrorNotice(e,t="warning"){return ge("calcite-notice",{class:x.noticeError,icon:!0,kind:t,open:!0},ge("div",{slot:"message"},e))}_renderForm(){return ge("form",{class:x.form,id:this._formId,onsubmit:this._onFormSubmit},this._renderInvisibleFieldsError(),this._renderPage())}_renderPage(){switch(this.page){case"adding-attachments":return this._renderAttachmentAddPage();case"viewing-attachment-details":case"replacing-attachment":return this._renderAttachmentDetailPage();case"viewing-attachments":return this._renderAttachmentListPage();case"viewing-associated-layers":case"viewing-associated-features":return this._renderViewingAssociationsPage();case"viewing-related-categories":case"viewing-related-records":return this._renderRelationshipListPage();default:return this._renderDefaultPage()}}_renderInvisibleFieldsError(){const{viewModel:e}=this,{hasNonActiveInvalidFeatures:t,activeForm:i}=e;let a;if(!e.submitHasBeenAttempted)return null;if(i.invalidHiddenInputs.length>0)if(a=I(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?a+=` (${e.map(e=>e.label).join(", ")})`:a=null}else a+=` (${i.invalidHiddenInputs.map(e=>e.label).join(", ")})`;else if(t)return null;return a?this._renderErrorNotice(a,"danger"):null}_renderDefaultPage(){return[this._renderReadOnlyNotice(),this._renderFormHeader(),this._renderFormContent()]}_renderReadOnlyNotice(){if((this.disabled||this.readOnly)&&this.visibleElements.readOnlyNotice)return ge("calcite-notice",{class:x.disabledNotice,icon:"read-only-non-editable",kind:"brand",open:!0,scale:"s",width:"full"},ge("div",{slot:"message"},this.featureFormMessages.disabledForm))}_renderFormHeader(){const{formTitle:e,formDescription:t}=this.viewModel;if(!this._formHeaderVisible)return;const i=e?ge(me,{key:"title",level:this.headingLevel},e):void 0,a=t?ge("p",{class:x.description,key:"description"},t):void 0;return ge("div",{class:x.formHeader},i,a)}_renderFormContent(){return this.viewModel.hasVisibleInputs?this.viewModel.activeForm.inputs.filter(e=>e.visible).map(e=>this._renderInput(e)):this._renderErrorNotice(this.messages.noVisibleFields[this.viewModel.noVisibleElementsReason])}_renderInput(e){return N(e)?this._renderGroupInput(e):U(e)?this._renderLabeledField(e):P(e)?this._renderTextComponent(e):B(e)?this._renderRelationshipElementInput(e):$(e)?this._renderAttachmentElementInput(e):z(e)?this._renderUtilityNetworkAssociationsElementInput(e):void 0}_renderGroupInput(e){const{inputs:t,template:i,open:a}=e,n=t.filter(e=>e.visible),s=i.label??"";return ge("calcite-block",{class:this.classes(x.group,"sequential"===this.groupDisplay?x.groupSequential:null,this.disabled?x.inputDisabled:null),collapsible:!0,description:i.description??void 0,disabled:this.effectiveDisabled,expanded:a,heading:s,headingLevel:this.headingLevel,key:`{${i.elementId}-key}`,label:s,onCalciteBlockClose:()=>{e.open=!1},onCalciteBlockOpen:()=>{e.open=!0},onCalciteBlockToggle:({currentTarget:t})=>this._onGroupToggle(t,e)},n.map(e=>this._renderInput(e)))}_renderLabeledField(e){const{elementId:i}=e.template,{label:a,required:n,dataType:s}=e,l=n?t(this.messages.requiredFieldLabel,{name:a}):a;return ge("calcite-label",{"aria-label":l,class:x.label,key:`field--${i}`},ge("div",{class:x.labelTextContent,key:"labelTextContainer"},a,n?ge("span",{"aria-hidden":"true",title:this.messagesCommon.required},"*"):void 0),"unsupported"!==s?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}):null!==e.multipleChoiceChoices?this._renderMultipleChoiceComponent({input:e,props:t}):"number"===i?this._renderNumberComponent(e,t):this._renderStringComponent(e,t)}_renderAuxiliaryText(e){const{description:t}=e,i=this._getErrorToDisplay(e),a=i?w(e,i,this.messages):null;return a?ge("calcite-input-message",{icon:!0,status:"invalid"},a):t?ge("calcite-input-message",{class:x.description,icon:!1,status:"idle"},t):null}_renderCodedInputs({input:e,props:t}){const i=e.input?.type??null,a=e.codedValueOptions;switch(i){case"switch":return this._renderSwitchField({input:e,props:t});case"radio-buttons":return this._renderRadioButtonGroupComponent({input:e,options:a,props:t});default:return this._renderComboBoxComponent({options:a,props:t,input:e})}}_renderMultipleChoiceComponent({input:e,props:t}){const{messages:i}=this,{multipleChoiceChoices:a,multipleChoiceInput:n,multipleChoiceValues:s}=e;if(!n||!a||!s)return null;const l=!0===n.includeSelectAllChoices,o=new Map;let r=s.length>0,c=!1;for(const b of s){const t=G({input:e,choiceValue:b});o.set(b,t),(t.checked||t.indeterminate)&&(c=!0),t.checked||(r=!1)}const d={checked:r,indeterminate:!r&&c},m=d.checked?i.deselectAllLabel:i.selectAllLabel,h=e.getMultipleChoiceOtherChoiceRenderState(this.messages.otherOptionLabel),u=t=>{this._saveValueFromMultipleChoiceCheckbox({input:e,checkbox:t,isSelectAllCheckbox:!0})},p=t=>{this._saveValueFromMultipleChoiceCheckbox({input:e,checkbox:t})},g=t=>{const{fieldName:i}=h;i&&this._saveOtherChoiceCheckboxValue({input:e,isChecked:t.checked,otherChoiceFieldName:i})},v=t=>{this._saveValueFromMultipleChoiceTextInput({input:e,textInput:t,otherChoiceFieldName:h.fieldName})};return ge("div",{class:x.multipleChoiceInput,key:`${t.key}-multiple-choice-group`},l?this._renderMultipleChoiceSelectAllCheckbox({props:t,selectAllState:d,selectAllLabel:m,handleSelectAllCheckboxChange:u}):null,this._renderMultipleChoiceChoiceCheckboxes({input:e,props:t,checkboxStatesByValue:o,handleChoiceCheckboxChange:p}),h.shouldShow?this._renderMultipleChoiceOtherChoice({props:t,includeSelectAllChoices:l,otherChoiceRenderState:h,handleOtherChoiceCheckboxChange:g,handleOtherChoiceInputChange:v,differentValuesPlaceholder:i.differentValuesPlaceholder}):null)}_renderMultipleChoiceSelectAllCheckbox({props:e,selectAllState:t,selectAllLabel:i,handleSelectAllCheckboxChange:a}){return ge("calcite-checkbox",{afterCreate:e.afterCreate,afterUpdate:e.afterUpdate,"aria-invalid":e["aria-invalid"],checked:t.checked,class:x.multipleChoiceSelectAll,"data-element-id":e[fe],disabled:e.readOnly,indeterminate:t.indeterminate,key:`${e.key}-select-all`,label:i,labelText:i,value:Ce,onblur:e.onblur,onCalciteCheckboxChange:({currentTarget:e})=>a(e),onfocus:e.onfocus})}_renderMultipleChoiceChoiceCheckboxes({input:e,props:t,checkboxStatesByValue:i,handleChoiceCheckboxChange:a}){const{multipleChoiceChoices:n}=e;return n?n.map(e=>{const n=i.get(e.value)??{checked:!1,indeterminate:!1};return ge("calcite-checkbox",{afterCreate:t.afterCreate,afterUpdate:t.afterUpdate,"aria-invalid":t["aria-invalid"],checked:n.checked,class:t.class,"data-element-id":t[fe],disabled:t.readOnly,indeterminate:n.indeterminate,key:`${t.key}-${e.value}`,label:e.label,labelText:e.label,required:t.required,value:e.value,onblur:t.onblur,onCalciteCheckboxChange:({currentTarget:e})=>a(e),onfocus:t.onfocus})}):[]}_renderMultipleChoiceOtherChoice({props:e,includeSelectAllChoices:t,otherChoiceRenderState:i,handleOtherChoiceCheckboxChange:a,handleOtherChoiceInputChange:n,differentValuesPlaceholder:s}){return ge("div",{class:this.classes(x.multipleChoiceOtherChoice,t?x.multipleChoiceOtherChoiceWithSelectAll:null),key:`${e.key}-other-choice`},ge("calcite-checkbox",{afterCreate:e.afterCreate,afterUpdate:e.afterUpdate,"aria-invalid":e["aria-invalid"],checked:i.checkboxState.checked,class:e.class,"data-element-id":e[fe],disabled:e.readOnly,indeterminate:i.checkboxState.indeterminate,key:`${e.key}-other-choice-checkbox`,label:i.label,labelText:i.label,value:Ae,onblur:e.onblur,onCalciteCheckboxChange:({currentTarget:e})=>a(e),onfocus:e.onfocus}),i.checkboxState.checked?ge("calcite-input",{afterCreate:e.afterCreate,afterUpdate:e.afterUpdate,"aria-invalid":e["aria-invalid"],"aria-label":i.label,class:x.textElementInput,"data-element-id":e[fe],disabled:e.readOnly,key:`${e.key}-other-choice-input`,maxLength:i.maxLength,placeholder:i.value===j?s:i.hint,required:e.required,type:"text",value:i.normalizedValue===j?"":i.normalizedValue?String(i.normalizedValue):"",onblur:e.onblur,onCalciteInputInput:({currentTarget:e})=>n(e),onfocus:e.onfocus}):null)}async _saveValueFromMultipleChoiceCheckbox({input:e,checkbox:t,isSelectAllCheckbox:i=!1}){if(this._markFieldInputTouched(e),e.multipleChoiceInput&&!i&&"batch"===this.viewModel.mode)return void await this._saveMultipleChoiceCheckboxValueByFeature({input:e,checkbox:t});const a=e.value,n=this._parseValue(t,e,i);n!==a&&await this.viewModel.setValue(e.template.elementId,n)}async _saveValueFromMultipleChoiceTextInput({input:e,textInput:t,otherChoiceFieldName:i}){if(!i)return;const a=t.value,n=null==a||""===a?null:a;e.initializeExplicitMultipleChoiceOtherChoiceCheckedState(),e.stashMultipleChoiceOtherChoiceDraftValueForFeatures(e.features,n);const s=H(e,i);s&&await this.viewModel.setValueForFieldName(s,n,Array.from(e.features,e=>e.source))}async _saveOtherChoiceCheckboxValue({input:e,isChecked:t,otherChoiceFieldName:i}){e.setExplicitMultipleChoiceOtherChoiceCheckedState(t),this._markFieldInputTouched(e),t||e.setMultipleChoiceOtherChoiceDraftValuesFromFeatures(e.features.toArray());const a=H(e,i);if(!a)return;const n=new Map;for(const s of e.features){const a=s.getAttribute(i);if(t){if(!be(a))continue;const t=e.getMultipleChoiceOtherChoiceDraftValue(s),i=Q(t)?t:q;n.set(s,i);continue}null!=a&&n.set(s,null)}0!==n.size&&await this.viewModel.setValuePerFeatureForFieldName(a,new Map(Array.from(n,([e,t])=>[e.source,t])))}async _saveMultipleChoiceCheckboxValueByFeature({input:e,checkbox:t}){if(!e.multipleChoiceInput||!e.multipleChoiceValues)return;const i=new Map(e.features.map(i=>[i,K({input:e,choiceValue:t.value,currentValue:i.getAttribute(e.fieldName),isChecked:t.checked})]));0!==i.size&&await this.viewModel.setFieldInputValuePerFeature(e,i)}_renderSwitchField({input:e,props:t}){if((this._batchSwitchInputInitialValues.get(e)===j||e.value===j)&&"batch"===this.viewModel.mode){const i={dropdown:{afterCreate:this._afterComponentCreateOrUpdate,afterUpdate:this._afterComponentCreateOrUpdate,disabled:t.readOnly,open:!1,[fe]:t[fe]},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:j,disabled:!0},...e.codedValueDomainOptions]})}return this._renderSwitchComponent({input:e,props:t})}_renderSwitchComponent({input:e,props:t}){return ge("calcite-switch",{...t,checked:!!F(e.template,"switch")&&e.value===e.template.input.onValue,class:x.inputSwitch,disabled:t.readOnly,onblur:()=>{this._focusedFieldInput=null},onCalciteSwitchChange:({currentTarget:e})=>this._saveInput(e)})}_renderDropdownComponent({buttonValue:e,options:t,dropdownProps:i}){const{trigger:a,dropdown:n,group:s}=i;return ge("calcite-dropdown",{...n,topLayerDisabled:this.topLayerDisabled,onblur:()=>{this._focusedFieldInput=null},onCalciteDropdownSelect:({currentTarget:e})=>this._saveInput(e),onfocus:this._onComponentFocus},ge("calcite-button",{...a},e===j?this.messages.differentValuesPlaceholder:e),ge("calcite-dropdown-group",{selectionMode:s.mode},t.map(t=>ge("calcite-dropdown-item",{disabled:t.disabled,label:String(t.name),selected:e===t.value},t.name))))}_renderComboBoxComponent({input:e,options:t,props:i}){const a="INSERT"===this.viewModel.editType,n=this._touchedInputs.has(e?.template?.elementId),s=a&&e.showNoValueOptionEnabled&&!n?()=>{}:i.onblur,l={...i,onblur:s};return ge("calcite-combobox",{...l,selectionMode:"single",topLayerDisabled:this.topLayerDisabled,value:i.placeholder===this.messages.differentValuesPlaceholder?j:String(i.value),onCalciteComboboxChange:({currentTarget:e})=>{e.value!==j&&this._saveInput(e)}},this.renderComboboxOptionsList({input:e,options:t,props:i}))}renderComboboxOptionsList({input:e,options:t,props:i}){const a=e=>e.map(e=>{const{value:t}=e,a=be(e.value)?this.messages.empty:e.name;return ge("calcite-combobox-item",{heading:a,key:`#${t}`,selected:i.value===t,value:`${t}`})});let n=[];const{messages:s}=this;t.other.length>0&&n.push(ge("calcite-combobox-item-group",{key:"other",label:s.other},a(t.other))),t.unsupported.length>0&&n.push(ge("calcite-combobox-item-group",{key:"unsupported",label:s.unsupported},a(t.unsupported)));const l=a(t.recommended);n.length>0?n.unshift(ge("calcite-combobox-item-group",{key:"recommended",label:s.recommended},l)):n=l;const o=i.placeholder===this.messages.differentValuesPlaceholder,r=!o&&be(i.value);return e.showNoValueOptionEnabled&&!t.containsEmptyOption&&n.unshift(ge("calcite-combobox-item",{heading:e.showNoValueLabel||this.messages.empty,key:"empty-option",selected:r,value:""})),o&&n.unshift(ge("calcite-combobox-item",{heading:this.messages.differentValuesPlaceholder,key:j,selected:!0,value:j})),n}_renderRadioButtonGroupComponent({input:e,options:t,props:i}){const a=[...t.recommended,...t.other,...t.unsupported].map(({name:t,value:a})=>this._renderRadioButtons({label:t,value:a,selected:a===e.value,props:i}));if(e.showNoValueOptionEnabled&&!t.containsEmptyOption){const t="",n=e.showNoValueLabel||this.messages.empty,s=be(e.value);a.unshift(this._renderRadioButtons({label:n,value:t,selected:s,props:i}))}return ge("calcite-radio-button-group",{afterCreate:this._afterRadioGroupCreateOrUpdate,afterUpdate:this._afterRadioGroupCreateOrUpdate,class:x.inputRadioGroup,"data-field-name":i[_e],disabled:i.readOnly||i.disabled,key:`${i.key}-radio-group`,layout:"vertical",name:i.name,required:i.required},a,i.placeholder===this.messages.differentValuesPlaceholder?ge("calcite-label",{class:x.placeholderRadio,key:i.label,layout:"inline"},ge("calcite-radio-button",{checked:!0,class:x.inputRadio,disabled:!0,name:i.placeholder,value:i.placeholder}),i.placeholder):null)}_renderRadioButtons({value:e,selected:t,label:i,props:a}){return ge("calcite-label",{class:x.inputRadioLabel,key:a.label,layout:"inline"},ge("calcite-radio-button",{...a,afterCreate:void 0,afterUpdate:void 0,checked:t,class:x.inputRadio,disabled:a.readOnly||a.disabled,name:a.label,value:e,onblur:()=>{this._focusedFieldInput=null},onCalciteRadioButtonChange:({currentTarget:e})=>{e.checked&&this._saveInput(e)}}),i)}_renderStringComponent(e,t){const{template:i}=e;return!i.field.editable||this.readOnly?this._renderReadOnlyComponent(e):"text-area"===i.input?.type?ge("calcite-text-area",{...t,class:this.classes(x.individualElement),resize:"vertical",value:t.value?String(t.value):"",onCalciteTextAreaInput:({currentTarget:e})=>this._saveInput(e)}):ge("calcite-input",{...t,class:this.classes(x.individualElement),type:"text",value:t.value?String(t.value):"",onCalciteInputInput:({currentTarget:e})=>this._saveInput(e)})}_renderNumberComponent(e,t){const i=g(e.field);return ge("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 ge("calcite-input",{...i,class:this.classes(x.fieldInput,x.inputDisabled,x.individualElement),readOnly:!0,type:"text",value:String(t??i.value??"")})}_renderDateComponents(e,t){const{field:i}=e;let a;switch(i.type){case"date":a=this._renderDateFieldComponents(e,t);break;case"date-only":a=this._renderDateOnlyFieldComponent(e,t);break;case"time-only":a=this._renderTimeOnlyFieldComponent(e,t);break;case"timestamp-offset":a=this._renderTimestampOffsetFieldComponents(e,t);break;default:a=this._renderReadOnlyComponent(e,ae(i,t.value,{timeZone:e.effectiveTimeZone,...ne(e.template.field)}))}return e.value===j?[a,ge("calcite-input-message",{icon:"information",key:"diff-values-message",status:"idle"},this.messages.differentValues)]:a}_renderDateOnlyFieldComponent(e,t){const{class:i,disabled:a,key:n,readOnly:s}=t,{rawMax:l,rawMin:o}=e.range;return ge("calcite-input-date-picker",{afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterComponentCreateOrUpdate,class:i,"data-date-part":"date","data-element-id":t[fe],"data-field-name":t[_e],key:`${n}-date-input`,max:v(l)?l:void 0,min:v(o)?o:void 0,overlayPositioning:"fixed",readOnly:s||a,topLayerDisabled:this.topLayerDisabled,value:e.value===j?"":e.value?String(e.value):"",onblur:()=>{this._focusedFieldInput=null},onCalciteInputDatePickerChange:t=>this._saveValueFromDateComponent(e,t.currentTarget),onfocus:this._onComponentFocus})}_renderTimeOnlyFieldComponent(e,t){const{class:i,disabled:a,key:n,readOnly:s}=t;return ge("calcite-input-time-picker",{afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterComponentCreateOrUpdate,class:i,"data-date-part":"time","data-element-id":t[fe],"data-field-name":t[_e],key:`${n}-time-input`,overlayPositioning:"fixed",readOnly:s||a,value:e.value===j?"":e.value?String(e.value):"",onblur:()=>{this._focusedFieldInput=null},onCalciteInputTimePickerChange:t=>this._saveValueFromDateComponent(e,t.currentTarget),onfocus:this._onComponentFocus})}_renderTimestampOffsetFieldComponents(e,t){const{class:i,disabled:a,key:n,readOnly:s}=t,{rawMax:l,rawMin:o}=e.range,r=se(l),c=se(o),d=se(e.value===j?"":e.value),m=e.includeTimeOffset,h={afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterComponentCreateOrUpdate,overlayPositioning:"fixed",readOnly:s||a,[fe]:t[fe],[_e]:t[_e],onfocus:this._onComponentFocus};return ge("div",{class:x.dateInputContainer,key:`${n}-date-time-container`},ge("calcite-input-date-picker",{...h,class:i,"data-date-part":"date",key:`${n}-date-input`,max:r?.date??void 0,min:c?.date??void 0,topLayerDisabled:this.topLayerDisabled,value:d.date??"",onblur:()=>{this._focusedFieldInput=null},onCalciteInputDatePickerChange:t=>this._saveValueFromDateComponent(e,t.target)}),ge("calcite-input-time-picker",{...h,class:i,"data-date-part":"time",key:`${n}-time-input`,value:d.time??"",onblur:()=>{this._focusedFieldInput=null},onCalciteInputTimePickerChange:t=>this._saveValueFromDateComponent(e,t.target)}),m?ge("calcite-input-time-zone",{...h,class:i,clearable:e.value===j||null==e.value,"data-date-part":"timeZone",key:`${n}-timezone-input`,value:d.timeZoneOffset||"",onblur:()=>{this._focusedFieldInput=null},onCalciteInputTimeZoneChange:t=>this._saveValueFromDateComponent(e,t.target)}):null)}_renderDateFieldComponents(e,t){const{class:i,disabled:a,key:n,readOnly:s,min:l,max:o}=t,r=e.effectiveTimeZone,c=le(e.value===j?"":e.value,r),d=le(o,r),m=le(l,r),h=e.includeTime,u={afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterComponentCreateOrUpdate,overlayPositioning:"fixed",readOnly:s||a,[fe]:t[fe],[_e]:t[_e],onfocus:this._onComponentFocus};return ge("div",{class:x.dateInputContainer,key:`${n}-date-time-container`},ge("calcite-input-date-picker",{...u,class:i,"data-date-part":"date",key:`${n}-date-input`,max:d?.date??void 0,min:m?.date??void 0,topLayerDisabled:this.topLayerDisabled,value:c.date??"",onblur:()=>{this._focusedFieldInput=null},onCalciteInputDatePickerChange:t=>this._saveValueFromDateComponent(e,t.target)}),h?ge("calcite-input-time-picker",{...u,"data-date-part":"time",key:`${n}-time-input`,step:1,value:c.time??"",onblur:()=>{this._focusedFieldInput=null},onCalciteInputTimePickerChange:t=>{this._saveValueFromDateComponent(e,t.target)}}):null)}_renderRelationshipElementInput(e){return this._relatedRecordsEnabled?ge(ee,{afterObserverCreated:this._afterListObserverCreated,afterObserverRemoved:this._afterListObserverRemoved,input:e,messages:this.messages,messagesCommon:this.messagesCommon,viewModel:this.viewModel}):null}_renderRelationshipListPage(){const{activeRelationshipInput:e}=this.viewModel;if(e)return this._renderRelationshipElementInput(e)}_renderAttachmentElementInput(e){if(!this.attachmentsEnabled)return;const{allAttachmentsVisibleOnDefaultPage:t,attachments:i,defaultPageAttachments:a,template:{description:n,elementId:s,label:l}}=e,o=t?i:a;return ge("div",{class:x.attachmentElementInput,"data-testid":`attachment-element-${s}`,key:`attachment-element-${s}`},l?ge("div",{class:x.attachmentElementLabel,key:`attachment-element-label-${s}`},l):null,n?ge("div",{class:x.description,key:`attachment-element-description-${s}`},n):null,i.length?this._renderAttachmentList(e,o,{label:l||this.messagesCommon.details,viewAllCount:t?null:i.length}):ge("div",{class:x.attachmentElementEmptyState,key:`attachment-element-empty-state-${s}`},this.messages.attachments.noAttachments),this._renderAttachmentAddAction(e))}_renderAttachmentListPage(){const e=this.viewModel.selectedAttachmentListInput;if(e)return ge("div",{class:x.attachmentElementAllPanel,key:`attachment-element-all-panel-${e.template.elementId}`},this._renderAttachmentList(e,e.attachments,{filterEnabled:!0,label:this.messages.titles.attachments}))}_renderAttachmentList(e,t,i){const{filterEnabled:a,label:n,viewAllCount:s}=i;return ge("calcite-list",{class:x.attachmentElementList,filterEnabled:a,filterPlaceholder:a?this.messages.attachments.searchAttachments:void 0,filterProps:a?he:void 0,filterText:a?this._attachmentListFilterText:void 0,label:n,selectionAppearance:"border",selectionMode:"none",onCalciteListFilter:a?e=>{this._attachmentListFilterText=e.currentTarget.filterText??""}:void 0},this._renderAttachmentListItems(e,t),null!=s?this._renderViewAllAttachmentsItem(e,s):null)}_renderAttachmentListItems(e,t){const{elementId:i}=e.template;return t.map((t,a)=>{const n=this._formatAttachmentSize(t.size),s=this._getAttachmentLabel(t,a,n,e.displayFilename),l=s===n?void 0:n,o=C(t),r=e.isStagedAttachmentAddition(t),c=e.getAttachmentEditState(t),d=c.isDeleted,m=!d&&(r||c.isRenamed||c.isReplaced);return ge("calcite-list-item",{class:x.attachmentElementListItem,description:l,key:`attachment-item-${o}`,label:s,onCalciteListItemSelect:r||d?void 0:()=>this._setSelectedAttachment({attachmentKey:o,elementId:i})},ge("div",{class:x.attachmentElementListItemStart,slot:"content-start"},this._renderAttachmentPreviewThumbnail(t,s,e)),m?ge("span",{class:x.attachmentElementListItemStagedIndicator,slot:"content-end"}):null,r?[ge("calcite-action",{disabled:this.effectiveDisabled,icon:"x",scale:"s",slot:"actions-end",text:this.messagesCommon.delete,title:this.messagesCommon.delete,onclick:()=>this.viewModel.stageDeleteAttachment(i,t.globalId)})]:d?ge("calcite-chip",{label:this.messages.attachments.deleted,scale:"s",slot:"content-end"},this.messages.attachments.deleted):ge("calcite-action",{icon:"chevron-right",scale:"s",slot:"actions-end",text:s,title:s}))})}_renderViewAllAttachmentsItem(e,i){const{elementId:a}=e.template,{viewAll:n}=this.messages.attachments;return ge("calcite-list-item",{class:x.attachmentElementListItem,description:t(this.messages.attachments.count,{count:i}),key:`attachment-item-view-all-${a}`,label:n,onCalciteListItemSelect:()=>this._setAttachmentListElementId(a)},ge("calcite-action",{icon:"chevron-right",scale:"s",slot:"actions-end",text:n,title:n}))}_renderAttachmentAddAction(e){const{elementId:t}=e.template,i=this.effectiveDisabled||e.addDisabled,a=this._renderAttachmentCountLimitsLabel(e),n=this._getAttachmentNoticeMessage(e),s=e.hasMinimumAttachmentCountNotMet||e.hasExceededAttachmentLimit?"danger":"info",l=e.canUploadFiles,o=e.isCaptureOnly&&!this.effectiveDisabled&&!n;return ge("div",{class:x.attachmentElementAddActions,key:`attachment-element-add-actions-${t}`},l?ge("calcite-button",{appearance:"outline",disabled:i,iconStart:"attachment",kind:"neutral",round:!0,scale:"s",onclick:()=>this._setAttachmentAddElementId(t)},this.messages.attachments.attach):null,this._renderAttachmentCaptureButton(e),o?this._renderAttachmentCaptureDisabledNotice(t):null,a?ge("div",{class:x.attachmentElementEmptyActionHint},a):null,!this.effectiveDisabled&&n?ge("calcite-notice",{closable:!1,icon:"danger"===s?"exclamation-mark-circle":"lightbulb",kind:s,open:!0,scale:"s",width:"full"},ge("div",{slot:"message"},n)):null)}_renderAttachmentCaptureButton(e){if(!e.hasCaptureInputs)return null;const t=e.captureMediaType;return ge("calcite-button",{appearance:"outline",disabled:!0,iconStart:Ie(t),kind:"neutral",round:!0,scale:"s"},this._getCaptureButtonLabel(t))}_getAttachmentNoticeMessage(e){const t=this.messages.attachments;return e.hasUnsupportedFileTypeValidationError?this._getUnsupportedFileTypeMessage():e.hasMinimumAttachmentCountNotMet&&this._shouldShowMinimumAttachmentNotice(e)?t.minimumNotMet:e.hasExceededAttachmentLimit?t.attachmentLimitExceeded:e.hasReachedAttachmentLimit?t.attachmentLimitReached:null}_shouldShowMinimumAttachmentNotice(e){return e.hasAttachmentChanges||this.viewModel.submitHasBeenAttempted||this._touchedInputs.has(e.template.elementId)}_getCaptureButtonLabel(e){const{capture:t,recordAudio:i,takePhoto:a,takeVideo:n}=this.messages.attachments;switch(e){case"image":return a||t;case"video":return n||t;case"audio":return i||t;default:return t}}_renderAttachmentAddPage(){const e=this.viewModel.selectedAttachmentAddInput;return e?this._renderAttachmentAddPanel(e):null}_renderAttachmentAddPanel(e){const{maxAttachmentCount:t}=e,{elementId:i}=e.template;if(e.isCaptureOnly)return this._renderAttachmentCaptureDisabledNotice(i);const a=null==t||t-e.attachments.length>1,n=this.effectiveDisabled||e.addDisabled,s=this.messages.attachments,l=s.dragAndDropFile,o="upload",r=e=>{this._attachmentFileInputMap.set(i,e)};return ge("div",{class:x.attachmentElementAddPanel,key:`attachment-element-add-panel-${i}`},ge("input",{accept:e.accept,afterCreate:r,afterRemoved:()=>{this._attachmentFileInputMap.delete(i)},afterUpdate:r,class:x.attachmentElementFileInput,"data-element-id":i,disabled:n,multiple:a,type:"file",onchange:e=>{const t=e.currentTarget,a=t.files?Array.from(t.files):[];this._stageAttachmentFiles(i,a),t.value=""}}),ge("div",{class:x.attachmentElementAddDropzone,"data-disabled":n?"true":"false",ondragover:e=>{e.preventDefault()},ondrop:e=>{if(e.preventDefault(),n)return;const t=e.dataTransfer?.files?Array.from(e.dataTransfer.files):[];this._stageAttachmentFiles(i,t)}},ge("calcite-icon",{class:x.attachmentElementAddDropzoneIcon,icon:o,scale:"l"}),ge("div",{class:x.attachmentElementAddDropzoneHeading},s.addFile),ge("div",{class:x.attachmentElementAddDropzoneDetail,title:l},l),ge("calcite-button",{appearance:"transparent",disabled:n,iconStart:"folder-open",kind:"brand",scale:"s",type:"button",onclick:e=>{e.stopPropagation(),this._openAttachmentFilePicker(i,n)}},s.selectFile)),this._renderAttachmentValidationCriteria(e,{includeCountCriteria:!0}))}_renderAttachmentCaptureDisabledNotice(e){return ge("calcite-notice",{class:x.attachmentElementCaptureNotice,icon:!0,key:`attachment-element-capture-disabled-notice-${e}`,kind:"warning",open:!0,scale:"s"},ge("div",{slot:"message"},this.messages.attachments.captureMethodNotSupported))}async _stageAttachmentFiles(e,t){if(0===t.length)return;const i=this.viewModel.selectedAttachmentAddInput;let a=!0;try{a=(await this.viewModel.stageAddAttachments(e,t)).length>0&&!i?.hasInvalidValidationCriteria&&!i?.hasUnsupportedFileTypeValidationError}finally{a&&this.viewModel.setSelectedAttachmentAddElementId(null)}}_openAttachmentFilePicker(e,t){t||this._attachmentFileInputMap.get(e)?.click()}_renderAttachmentDetailPage(){const e=this.selectedAttachmentDetails;if(!e)return;if("replacing-attachment"===this.page)return this._renderAttachmentReplacePanel(e);const{attachment:t,input:i}=e,a=C(t),n=!!i.getAttachmentPreviewUrl(t),s=i.getAttachmentEditState(t),{baseName:l,extension:o}=A(t.name),r=!this.readOnly&&!this.effectiveDisabled,c=r&&i.canUploadFiles;return ge("div",{class:x.attachmentElementDetail,key:`attachment-detail-panel-${i.template.elementId}-${a}`},ge("div",{class:x.attachmentElementDetailPreview},this._renderAttachmentPreviewImageForInput(t,i)),ge("div",{class:x.attachmentElementDetailActions},y(t)?ge("calcite-button",{appearance:"outline",disabled:!n,iconStart:"expand",kind:"neutral",label:this.messages.attachments.maximize,scale:"m",title:this.messages.attachments.maximize,onclick:this._maximizeSelectedAttachment}):null,ge("calcite-button",{appearance:"outline",disabled:!n,iconStart:"download",kind:"neutral",label:this.messages.attachments.download,scale:"m",title:this.messages.attachments.download,onclick:()=>{this._downloadAttachment(t)}}),ge("calcite-button",{appearance:"outline",disabled:!c,iconStart:"upload-to",kind:"neutral",label:this.messages.attachments.replace,scale:"m",title:this.messages.attachments.replace,onclick:this._enterAttachmentReplaceView})),ge("div",{class:x.attachmentElementDetailMetadata},ge("div",{class:x.attachmentElementDetailMetadataGroup},ge("span",{class:x.attachmentElementDetailMetadataLabel},this.messages.attachments.fileName),i.allowUserRename?ge("div",{class:x.attachmentElementDetailFileNameRow},ge("calcite-input",{class:x.attachmentElementDetailFileNameInput,disabled:!r,scale:"m",suffixText:o,value:l,onCalciteInputInput:({currentTarget:e})=>this._renameSelectedAttachment(e.value)}),ge("calcite-button",{appearance:"transparent",disabled:!r||null==s.initialName||!s.isRenamed,iconStart:"reset",kind:"neutral",scale:"m",title:this.messages.footerButtons.reset,onclick:this._resetSelectedAttachmentName})):ge("span",{class:x.attachmentElementDetailMetadataValue},t.name)),ge("div",{class:x.attachmentElementDetailMetadataGroup},ge("span",{class:x.attachmentElementDetailMetadataLabel},this.messages.attachments.size),ge("span",{class:x.attachmentElementDetailMetadataValue},this._formatAttachmentSize(t.size))),ge("div",{class:x.attachmentElementDetailMetadataGroup},ge("span",{class:x.attachmentElementDetailMetadataLabel},this.messages.attachments.type),ge("span",{class:x.attachmentElementDetailMetadataValue},this._getLabelForAttachmentType(t)))))}_renderAttachmentReplacePanel(e){const{attachment:t,input:i}=e,a=this.readOnly||this.effectiveDisabled||!i.canUploadFiles,n=i.template.elementId;return ge("div",{class:x.attachmentElementAddPanel,key:`attachment-replace-panel-${n}-${C(t)}`},ge("input",{accept:i.accept,afterCreate:this._setSelectedAttachmentReplaceFileInput,afterRemoved:()=>{this._selectedAttachmentReplaceFileInput=null},afterUpdate:this._setSelectedAttachmentReplaceFileInput,class:x.attachmentElementFileInput,disabled:a,type:"file",onchange:e=>{const t=e.currentTarget,i=t.files?.[0];i&&this._stageSelectedAttachmentReplacement(i),t.value=""}}),ge("div",{class:x.attachmentElementAddDropzone,"data-disabled":a?"true":"false",ondragover:e=>{e.preventDefault()},ondrop:e=>{if(e.preventDefault(),a)return;const t=e.dataTransfer?.files?.[0];t&&this._stageSelectedAttachmentReplacement(t)}},ge("calcite-icon",{class:x.attachmentElementAddDropzoneIcon,icon:"refresh",scale:"l"}),ge("div",{class:x.attachmentElementAddDropzoneHeading},this.messages.attachments.replace),ge("div",{class:x.attachmentElementAddDropzoneDetail,title:this.messages.attachments.dragAndDropFile},this.messages.attachments.dragAndDropFile),ge("calcite-button",{appearance:"transparent",disabled:a,iconStart:"folder-open",kind:"brand",scale:"s",onclick:e=>{e.stopPropagation(),this._openSelectedAttachmentReplaceFilePicker()}},this.messages.attachments.selectFile)),this._renderAttachmentValidationCriteria(i,{includeCountCriteria:!1}),ge("div",{class:x.attachmentElementDetailMetadata},ge("div",{class:x.attachmentElementDetailMetadataGroup},ge("span",{class:x.attachmentElementDetailMetadataLabel},this.messages.attachments.fileToBeReplaced),ge("span",{class:x.attachmentElementDetailMetadataValue},t.name))))}_renderAttachmentDialog(){const e=this._attachmentDialogInfo;if(!e)return null;const{attachment:t,input:i}=e;return ge("calcite-dialog",{heading:t.name||this.messagesCommon.details,key:"attachment-preview-dialog",modal:!0,open:!0,placement:"cover",width:"l",onCalciteDialogClose:this._closeAttachmentDialog},ge("div",{class:x.attachmentElementDetailPreview},this._renderAttachmentPreviewImageForInput(t,i)))}_setSelectedAttachment(e){e?.elementId&&this._touchedInputs.add(e.elementId),this.viewModel.setSelectedAttachment(e),e||this.hideAttachmentDialog()}_setAttachmentAddElementId(e){e&&this._touchedInputs.add(e),this.viewModel.setSelectedAttachmentAddElementId(e),this.viewModel.selectedAttachmentAddInput?.clearValidationCriteriaState(),this.hideAttachmentDialog()}_setAttachmentListElementId(e){e&&this._touchedInputs.add(e),this.viewModel.setSelectedAttachmentListElementId(e),this.hideAttachmentDialog()}_getAttachmentLabel(e,i,a,n){return!1!==n&&v(e.name)&&e.name.length>0?e.name:a!==this.messagesCommon.notApplicable?a:t(this.messages.attachments.attachmentNumberedLabel,{index:i+1})}_renderAttachmentCountLimitsLabel(e){const t=this.messages.attachments,i=null!=e.minAttachmentCount&&e.minAttachmentCount>0?this._renderAttachmentCountLimitLabel(t.minAttachmentsShort,e.minAttachmentCount,"min"):null,a=null!=e.maxAttachmentCount?this._renderAttachmentCountLimitLabel(t.maxAttachmentsShort,e.maxAttachmentCount,"max"):null;return i||a?[i,i&&a?ge("span",{key:"attachment-count-limits-separator"},", "):null,a]:null}_renderAttachmentCountLimitLabel(e,i,a){const n="__count__",[s,l]=t(e,{count:n}).split(n);return ge("span",{key:a},s,ge("span",{class:x.attachmentElementEmptyActionHintValue},i),l)}_renderAttachmentValidationCriteria(e,{includeCountCriteria:t}){const i=this._getAttachmentValidationCriteria(e,{includeCountCriteria:t}),a=`attachment-validation-criteria-${e.template.elementId}`;return 0===i.length?null:ge("div",{class:x.attachmentElementValidationCriteria,key:a},i.map(({key:e,message:t,state:i})=>ge("calcite-notice",{appearance:"danger"===i?"outline-fill":"transparent",closable:!1,icon:!0,key:e,kind:i,open:!0,scale:"s",width:"full"},ge("div",{slot:"message"},t))))}_getAttachmentValidationCriteria(e,{includeCountCriteria:i}){const a=[],n=e.validationCriterionStates,s=this.messages.attachments,l=this._getNestableAttachmentInputs(e.input);e.hasUnsupportedFileTypeValidationError&&a.push({key:"unsupported-file-type",message:this._getUnsupportedFileTypeMessage(),state:"danger"});for(const o of l)"document"===o.type&&null!=o.maxFileSize&&a.push({key:"maximum-file-size",message:t(s.maximumFileSize,{maxSize:this._formatAttachmentSizeLimitInMegabytes(o.maxFileSize)}),state:n.get("maximum-file-size")??"info"}),"audio"===o.type&&null!=o.maxDuration&&a.push({key:"maximum-audio-length",message:t(s.maximumAudioLength,{maxDuration:this._formatAttachmentDurationLimit(o.maxDuration)}),state:n.get("maximum-audio-length")??"info"}),"video"===o.type&&null!=o.maxDuration&&a.push({key:"maximum-video-length",message:t(s.maximumVideoLength,{maxDuration:this._formatAttachmentDurationLimit(o.maxDuration)}),state:n.get("maximum-video-length")??"info"});return i&&null!=e.minAttachmentCount&&e.minAttachmentCount>0&&a.push({key:"minimum-number-of-files",message:t(s.minimumNumberOfFiles,{count:e.minAttachmentCount}),state:n.get("minimum-number-of-files")??"info"}),i&&null!=e.maxAttachmentCount&&a.push({key:"maximum-number-of-files",message:t(s.maximumNumberOfFiles,{count:e.maxAttachmentCount}),state:n.get("maximum-number-of-files")??"info"}),a}_getNestableAttachmentInputs(e){return null==e?[]:"attachment"===e.type?e.inputTypes?.slice()??[]:[e]}_getUnsupportedFileTypeMessage(){return this.featureTableMessages.errorFileUnsupported}_formatAttachmentSize(e){return null==e||Number.isNaN(e)?this.messagesCommon.notApplicable:m(this.messagesUnits,e)}_formatAttachmentSizeLimitInMegabytes(e){return m(this.messagesUnits,1048576*e)}_formatAttachmentDurationLimit(e){return p(1e3*Math.round(e),{...e>=3600?{hour:"2-digit",hourCycle:"h23"}:{},minute:"2-digit",second:"2-digit",timeZone:"UTC"})}_getLabelForAttachmentType({contentType:e}){if(!e)return this.messagesCommon.notApplicable;const t=this.messages.attachments.attachmentTypes,i=f(e);return t?.[i]||e}_renderAttachmentPreviewThumbnail(e,t,i){const a=i.getAttachmentPreviewUrl(e,64);return a&&y(e)?ge("img",{alt:t,class:x.attachmentElementListItemThumb,src:a}):ge("calcite-icon",{class:x.attachmentElementListItemIcon,icon:_(e.contentType),scale:"s"})}_renderAttachmentPreviewImageForInput(e,t){const i=t.getAttachmentPreviewUrl(e),a=e.name||this.messagesCommon.details;return i&&y(e)?ge("img",{alt:a,class:x.attachmentElementDetailPreviewImage,src:i,title:a}):[ge("calcite-icon",{class:x.attachmentElementDetailPreviewIcon,icon:_(e.contentType),scale:"l",textLabel:a,title:a}),this.messages.attachments.noPreviewAvailable]}async _downloadAttachment(e){await te(e)}_canReplaceSelectedAttachment(){return!this.readOnly&&!this.effectiveDisabled&&!!this.selectedAttachmentDetails?.input.canUploadFiles}_exitAttachmentReplaceView(){this.viewModel.setShowingSelectedAttachmentReplacePage(!1),this._selectedAttachmentReplaceFileInput=null}async _stageSelectedAttachmentReplacement(e){const t=this.selectedAttachmentDetails,i=t?.attachment.globalId;if(!t||!i)return;let a=!1;try{a=await this.viewModel.stageReplaceAttachment(t.input.template.elementId,i,e)}finally{a&&this._exitAttachmentReplaceView()}}_renameSelectedAttachment(e){const t=this.selectedAttachmentDetails,i=t?.attachment.globalId;t&&i&&this.viewModel.stageRenameAttachment(t.input.template.elementId,i,e)}_isSelectedAttachmentDeleteDisabled(){const e=this.selectedAttachmentDetails;if(!e)return!1;if(this.readOnly||this.effectiveDisabled)return!0;const t=e.input.minAttachmentCount;return null!=t&&e.input.attachments.length<=t}hideAttachmentDialog(){this._attachmentDialogInfo=null}_renderTextComponent(e){const{elementId:t}=e.template;return ge("div",{class:x.textElementInput,"data-testid":`text-element-${t}`,innerHTML:e.text,key:`text-element-${t}`})}_renderUtilityNetworkAssociationsElementInput(e){if(!this._associationsEnabled)return;const{elementId:t}=e.template;return ge("div",{class:x.utilityNetworkAssociationsElementInput,"data-testid":t,key:t},this._associationsWidgetsMap.get(e)?.render())}getCommonInputProps(e){const{template:t,valid:i,value:a,minLength:n,maxLength:s,required:l,fieldName:o,editable:r,userHasChangedValue:c,range:{max:d,min:m}}=e,h=!r||this.readOnly,u=!h&&this.effectiveDisabled;let p=t.hint??void 0,g=!1;return a===j&&(p=this.messages.differentValuesPlaceholder,g=!0),{afterCreate:this._afterComponentCreateOrUpdate,afterUpdate:this._afterComponentCreateOrUpdate,"aria-invalid":i?"false":"true",class:this.classes(x.fieldInput,h?x.inputDisabled:null),status:!c&&!this.viewModel.submitHasBeenAttempted||i?"idle":"invalid",maxLength:s&&s>-1?s:void 0,minLength:n&&n>-1?n:void 0,key:t.elementId,label:o,name:o,max:null!=d?d:void 0,min:null!=m?m:void 0,disabled:u,readOnly:h,onblur:this._onComponentBlur,required:l,placeholder:p,value:g?"":a??"",[fe]:t.elementId,[_e]:o,onfocus:this._onComponentFocus}}_onObserverChange(){this._listObserverNode&&this._listObserver.unobserve(this._listObserverNode);const e=this.viewModel.activeRelationshipInput;e&&this._listObserverNode&&e.showAllEnabled&&this._listObserver.observe(this._listObserverNode)}_onFormSubmit(e){e.preventDefault()}_getFieldInputFromHTMLElement(e){return this.viewModel.findFieldInput(e.getAttribute(fe))}_afterRadioGroupCreateOrUpdate(e){const t=e.selectedItem,i=e.querySelector("calcite-radio-button"),a=t||i;a&&this._afterComponentCreateOrUpdate(a)}_onComponentFocus(e){const t=e.target,i=this._getFieldInputFromHTMLElement(t);this._isMultipleChoiceCheckbox(t,i)||this._markFieldInputTouched(i),this._focusedFieldInput=i}_markFieldInputTouched(e){this._touchedInputs.add(e.template.elementId)}_isMultipleChoiceCheckbox(e,t){return"CALCITE-CHECKBOX"===e.tagName&&null!=t.multipleChoiceInput}_afterComponentCreateOrUpdate(e){const t=this._getFieldInputFromHTMLElement(e),i=this._focusedFieldInput;this._attemptFocusOnNextRender&&i===t&&(this._attemptFocusOnNextRender=!1,ve(e))}_onComponentBlur(){this._focusedFieldInput=null}_resetTransientFormState(){this._attemptFocusOnNextRender=!1,this._focusedFieldInput=null,this._attachmentDialogInfo=null,this._selectedAttachmentReplaceFileInput=null,this._attachmentListFilterText="",this._attachmentFileInputMap.clear()}_parseValue(e,t,i=!1){const a=t.multipleChoiceInput,n=t.multipleChoiceValues;if(a&&n){const s=a.choiceDelimiter,l=e;if(i){return X({input:t}).checked?null:n.length>0?n.join(s):null}const o=J(t.value,s).filter(e=>e!==j),r=new Set(o);l.checked?r.add(l.value):r.delete(l.value);const c=n.filter(e=>r.has(e));return c.length?c.join(s):null}if(F(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 s=e.value;return null==s||""===s?null:"number"===t.dataType?"-0"===s||"-0."===s||"-0,"===s?s:parseFloat(s):"date"===t.field.type?parseFloat(s):s}_saveInput(e){const t=this._getFieldInputFromHTMLElement(e),{elementId:i}=t.template;if(!t)return;const a=t?.value;if(F(t.template,"switch")&&"single"!==this.viewModel.mode){const e=n(this._batchSwitchInputInitialValues,t,()=>t.value);this._batchSwitchInputInitialValues.set(t,null===e?a:e)}const s=this._parseValue(e,t);s!==a&&this.viewModel.setValue(i,s)}_afterDateComponentCreate(e){this._setDateTimeTimeZoneMap(e),this._afterComponentCreateOrUpdate(e)}_saveValueFromDateComponent(e,t){const{elementId:i}=e.template,a=e.field.type,n=this._dateComponentMap.get(`${i}`);if(!n)return;const s=e.effectiveTimeZone;let l=e.value===j?void 0:e.value,o=null;"date-only"===a?o=Array.isArray(t.value)?t.value[0]:t.value:"time-only"===a?(l=oe(l),o=oe(t.value)):o="timestamp-offset"===a?null!=t.value?re({dateComponent:n.date,timeComponent:n.time,oldValue:l,timeZoneComponent:n.timeZone,defaultTimeZone:s}):null:null!=t.value?ce({oldValue:l,dateComponent:n.date,timeZone:s,timeComponent:n.time?.value===j?void 0:n.time}):null,l!==o&&(null!==o&&t.value?this.viewModel.setValue(`${i}`,o):this.viewModel.setValue(`${i}`,null))}_getErrorToDisplay(e){const t=e.compositeError;return e.valid||!t?null:"contingent-values-validation-error::contingency-violation-error"===t||"contingent-values-validation-error::contingency-violation-warning"===t||this._touchedInputs.has(e.template.elementId)||this.viewModel.submitHasBeenAttempted?t:null}_renderViewingAssociationsPage(){return this._associationsList?.render()}_onActiveAssociationsInputChange(e){const t=this._associationsList;t&&(e?(t.associationInput=e,t.viewModel=e.viewModel):t.associationInput=null)}async _setUpAssociationsWidgets(){const e=this.viewModel.activeForm.allUtilityNetworkAssociationsElementInputs;if(this._associationsEnabled&&0!==e.length){await this._setUpUtilityNetworkAssociationList();for(const t of e)this._associationsWidgetsMap.set(t,await this._createAssociationsWidget(t))}}async _setUpUtilityNetworkAssociationList(){if(this._associationsList)return;const e=(await import("./FeatureForm/FeatureFormUtilityNetworkAssociations/FeatureFormUtilityNetworkAssociationList.js")).default;this._associationsList=new e({onSelectLayer:this._onSelectAssociatedLayer.bind(this),onSelectFeature:this._onEditAssociatedFeature.bind(this),onAddAssociation:this._onAddAssociation.bind(this)});const t=this.viewModel.activeAssociationsInput;t&&(this._associationsList.associationInput=t,this._associationsList.viewModel=t.viewModel)}async _createAssociationsWidget(e){return new(0,(await import("./Feature/FeatureUtilityNetworkAssociations.js")).default)({viewModel:e.viewModel,onSelectAssociationType:t=>this._onSelectAssociationType(e,t)})}_destroyAssociationsWidgets(){this._associationsWidgetsMap.forEach(e=>s(e)),this._associationsWidgetsMap.clear()}_onSelectAssociationType(e,{listType:t}){this.setActiveAssociationsInput(e),this.setActiveAssociationType(t)}_onSelectAssociatedLayer({layer:e}){this.setActiveAssociationsLayer(e)}async _onEditAssociatedFeature(e){const t=this.callbacks?.editAssociatedFeature,i=this.viewModel.activeAssociationsInput;if(!t||!i?.feature)return;const{association:a,feature:n}=e;await t({parentFeature:i.feature.plainGraphic,association:a,feature:n})}_onAddAssociation(e){const t=this.callbacks?.addAssociation,i=this.viewModel.activeAssociationsInput;if(!t||!i?.feature)return;const{associationType:a,utilityNetwork:n}=e;t({feature:i.feature.plainGraphic,associationType:a,utilityNetwork:n})}_getSelectedAttachmentEditState(){const e=this.selectedAttachmentDetails;if(e)return e.input.getAttachmentEditState(e.attachment)}_setFocusableInput(e){const t=e&&U(e)?e:this._findFocusableInput(e);this._focusedFieldInput=t,this._attemptFocusOnNextRender=!0}_findFocusableInput(e){const t=this.viewModel.activeForm.inputs;if(!t.length)return;const i=k(t);let a;if(e)if(N(e)){const t=e.inputs.find(e=>e.visible);a=t?i.indexOf(t):0}else{let n;if(W(e)&&!e.group.open){n=e.group.inputs.filter(U)[t.length-1]}else n=e;a=i.indexOf(n)+1}else a=0;for(let n=a;n<i.length;n++){const e=i[n];if(e.visible&&U(e))return this.disabled||this.readOnly,e}return null}_onGroupToggle(e,t){e.expanded?(t.open=!0,this._setFocusableInput(t)):t.open=!1,this.scheduleRender()}};function Ie(e){switch(e){case"audio":return _("audio/mpeg");case"video":return _("video/mp4");case"image":return _("image/png");default:return"camera"}}e([h()],ye.prototype,"activeFeatureIndex",null),e([h()],ye.prototype,"attachmentsEnabled",null),e([h()],ye.prototype,"callbacks",null),e([h()],ye.prototype,"disabled",null),e([h()],ye.prototype,"effectiveTitle",null),e([h()],ye.prototype,"effectiveDisabled",null),e([h()],ye.prototype,"features",null),e([h()],ye.prototype,"footerButtonInfos",null),e([h()],ye.prototype,"footerNoticeInfos",null),e([h()],ye.prototype,"map",null),e([h()],ye.prototype,"maximumFeatureCount",null),e([h()],ye.prototype,"maximumFeatureCountWithComplexForms",null),e([h()],ye.prototype,"spatialReference",null),e([h()],ye.prototype,"layerInfos",null),e([h()],ye.prototype,"timeZone",null),e([h()],ye.prototype,"headingLevel",void 0),e([h()],ye.prototype,"icon",null),e([h(),ue("esri/t9n/common")],ye.prototype,"messagesCommon",void 0),e([h(),ue("esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm")],ye.prototype,"messages",void 0),e([h(),ue("esri/widgets/FeatureForm/t9n/FeatureForm")],ye.prototype,"featureFormMessages",void 0),e([h(),ue("esri/widgets/FeatureTable/t9n/FeatureTable")],ye.prototype,"featureTableMessages",void 0),e([h(),ue("esri/core/t9n/Units")],ye.prototype,"messagesUnits",void 0),e([h()],ye.prototype,"page",null),e([h()],ye.prototype,"readOnly",null),e([h()],ye.prototype,"selectedAttachment",null),e([h()],ye.prototype,"selectedAttachmentDetails",null),e([h()],ye.prototype,"valid",null),e([h({type:M}),pe(["attachments-change","value-change","values-change","submit"])],ye.prototype,"viewModel",void 0),e([h({type:R,nonNullable:!0})],ye.prototype,"visibleElements",void 0),e([h()],ye.prototype,"groupDisplay",void 0),e([h()],ye.prototype,"_formHeaderVisible",null),e([h()],ye.prototype,"_associationsEnabled",null),e([h()],ye.prototype,"_associationsList",void 0),e([h()],ye.prototype,"_attemptFocusOnNextRender",void 0),e([h()],ye.prototype,"_formId",null),e([h()],ye.prototype,"_focusedFieldInput",void 0),e([h()],ye.prototype,"_relatedRecordsEnabled",null),e([h()],ye.prototype,"_listObserverNode",void 0),e([h()],ye.prototype,"_attachmentDialogInfo",void 0),e([h()],ye.prototype,"_attachmentListFilterText",void 0),ye=e([u("esri.widgets.BatchAttributeForm")],ye);const we=ye;export{we as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as t}from"tslib";import e from"../../core/Error.js";import{makeHandle as i,abortHandle as o}from"../../core/handleUtils.js";import{isAborted as s}from"../../core/promiseUtils.js";import{watch as r}from"../../core/reactiveUtils.js";import{property as a,subclass as l}from"../../core/accessorSupport/decorators.js";import{isSubtypeSublayer as n}from"../../layers/support/layerUtils.js";import{createFeatureServices as d}from"../../rest/featureService/utils.js";import c from"../../views/draw/support/HighlightHelper.js";import{temporaryHighlightName as u}from"../../views/support/HighlightDefaults.js";import p from"./AddAssociationWorkflowData.js";import w from"./Workflow.js";import{fetchFullFeatures as h}from"./workflowUtils.js";import y from"../FeatureForm/UtilityNetworkAssociationAddAssociationViewModel.js";import{getFeatureTitle as m}from"../support/UtilityNetworkAssociations/utils/getFeatureTitle.js";var A;const f={exit:Symbol()};let g=class extends w{static{A=this}constructor(t){super(t),this._utilityNetworkAssociationAddAssociationViewModel=new y,this._highlightHelper=null,this.sourceFeatureItem=null,this.type="add-association"}initialize(){const{data:t}=this,{view:e}=t.viewModel;e&&(this._highlightHelper=new c({view:e,highlightName:u}),this.addHandles(i(()=>this._highlightHelper?.removeAll())));const s=new AbortController;this.addHandles(o(s)),this._updatingHandles.consumePromise(this._setup(s))}get editorItem(){return this.data.editorItem}get formViewModel(){return this._formViewModel}get utilityNetworkAssociationAddAssociationViewModel(){return this._utilityNetworkAssociationAddAssociationViewModel}get hasPendingEdits(){return!!this._utilityNetworkAssociationAddAssociationViewModel.selectedFeature}get layer(){return this.data.editorItem.layer}get parent(){return this.data.parent}get reliesOnOwnerAdminPrivileges(){return this.editorItem.capabilities.create.reliesOnOwnerAdminPrivileges}async enter(){this._addHandles()}exit(){this.removeHandles(f.exit)}async start(){return await super.start(),null}async _setup(t){const{data:i}=this,{feature:o}=i;try{const[e]=await h([o],o.sourceLayer,i.viewModel.view.spatialReference,t.signal);if(s(t))return;const r=e.sourceLayer&&"getFeatureTitle"in e.sourceLayer&&await e.sourceLayer.getFeatureTitle(e)||m(e);if(s(t))return;this.sourceFeatureItem={feature:o,label:r},this._initializeUtilityNetworkAssociationAddAssociationViewModel()}catch(r){await this.cancel({force:!0,error:new e("editor:failed-to-fetch-full-feature","Failed to retrieve all information for this feature. The update cannot proceed.",{detail:{error:r}})})}}_initializeUtilityNetworkAssociationAddAssociationViewModel(){const{viewModel:{view:t},utilityNetwork:e,associationType:i}=this.data,o=this._utilityNetworkAssociationAddAssociationViewModel;o.graphic=this.sourceFeatureItem.feature,o.map=t?.map,o.utilityNetwork=e,o.layer=this.layer,o.associationType=i,o.highlightHelper=this._highlightHelper,e.networkSystemLayers.loadAssociationsTable()}_addHandles(){const t=this._utilityNetworkAssociationAddAssociationViewModel;this.addHandles([r(()=>t.selectedLayer,t=>{t&&this.go("add-association-select-feature")}),r(()=>t.selectedFeature,t=>{t&&this.go("add-association-create-association")})],f.exit)}static async create(t){const e=new A({data:await p.create(t),onCommit:this._onCommitFactory(t.applyEditsFeatureService)});return e._set("steps",this._createWorkflowSteps(e)),e}static _createWorkflowSteps(t){return[{id:"add-association-select-layer",async setUp(){const{utilityNetworkAssociationAddAssociationViewModel:e}=t.data.viewModel;e&&(e.selectedLayer=null,e.selectedFeature=null,e.association=null)},async tearDown(){}},{id:"add-association-select-feature",async setUp(){const{utilityNetworkAssociationAddAssociationViewModel:e}=t.data.viewModel;e&&(e.selectedFeature=null,e.association=null)},async tearDown(){}},{id:"add-association-create-association",async setUp(){},async tearDown(){}}]}static{this._onCommitFactory=t=>async i=>{const{feature:o,utilityNetwork:s,
|
|
2
|
+
import{__decorate as t}from"tslib";import e from"../../core/Error.js";import{makeHandle as i,abortHandle as o}from"../../core/handleUtils.js";import{isAborted as s}from"../../core/promiseUtils.js";import{watch as r}from"../../core/reactiveUtils.js";import{property as a,subclass as l}from"../../core/accessorSupport/decorators.js";import{isSubtypeSublayer as n}from"../../layers/support/layerUtils.js";import{createFeatureServices as d}from"../../rest/featureService/utils.js";import c from"../../views/draw/support/HighlightHelper.js";import{temporaryHighlightName as u}from"../../views/support/HighlightDefaults.js";import p from"./AddAssociationWorkflowData.js";import w from"./Workflow.js";import{fetchFullFeatures as h}from"./workflowUtils.js";import y from"../FeatureForm/UtilityNetworkAssociationAddAssociationViewModel.js";import{getFeatureTitle as m}from"../support/UtilityNetworkAssociations/utils/getFeatureTitle.js";var A;const f={exit:Symbol()};let g=class extends w{static{A=this}constructor(t){super(t),this._utilityNetworkAssociationAddAssociationViewModel=new y,this._highlightHelper=null,this.sourceFeatureItem=null,this.type="add-association"}initialize(){const{data:t}=this,{view:e}=t.viewModel;e&&(this._highlightHelper=new c({view:e,highlightName:u}),this.addHandles(i(()=>this._highlightHelper?.removeAll())));const s=new AbortController;this.addHandles(o(s)),this._updatingHandles.consumePromise(this._setup(s))}get editorItem(){return this.data.editorItem}get formViewModel(){return this._formViewModel}get utilityNetworkAssociationAddAssociationViewModel(){return this._utilityNetworkAssociationAddAssociationViewModel}get hasPendingEdits(){return!!this._utilityNetworkAssociationAddAssociationViewModel.selectedFeature}get layer(){return this.data.editorItem.layer}get parent(){return this.data.parent}get reliesOnOwnerAdminPrivileges(){return this.editorItem.capabilities.create.reliesOnOwnerAdminPrivileges}async enter(){this._addHandles()}exit(){this.removeHandles(f.exit)}async start(){return await super.start(),null}async _setup(t){const{data:i}=this,{feature:o}=i;try{const[e]=await h([o],o.sourceLayer,i.viewModel.view.spatialReference,t.signal);if(s(t))return;const r=e.sourceLayer&&"getFeatureTitle"in e.sourceLayer&&await e.sourceLayer.getFeatureTitle(e)||m(e);if(s(t))return;this.sourceFeatureItem={feature:o,label:r},this._initializeUtilityNetworkAssociationAddAssociationViewModel()}catch(r){await this.cancel({force:!0,error:new e("editor:failed-to-fetch-full-feature","Failed to retrieve all information for this feature. The update cannot proceed.",{detail:{error:r}})})}}_initializeUtilityNetworkAssociationAddAssociationViewModel(){const{viewModel:{view:t},utilityNetwork:e,associationType:i}=this.data,o=this._utilityNetworkAssociationAddAssociationViewModel;o.graphic=this.sourceFeatureItem.feature,o.map=t?.map,o.utilityNetwork=e,o.layer=this.layer,o.associationType=i,o.highlightHelper=this._highlightHelper,e.networkSystemLayers.loadAssociationsTable()}_addHandles(){const t=this._utilityNetworkAssociationAddAssociationViewModel;this.addHandles([r(()=>t.selectedLayer,t=>{t&&this.go("add-association-select-feature")}),r(()=>t.selectedFeature,t=>{t&&this.go("add-association-create-association")})],f.exit)}static async create(t){const e=new A({data:await p.create(t),onCommit:this._onCommitFactory(t.applyEditsFeatureService)});return e._set("steps",this._createWorkflowSteps(e)),e}static _createWorkflowSteps(t){return[{id:"add-association-select-layer",async setUp(){const{utilityNetworkAssociationAddAssociationViewModel:e}=t.data.viewModel;e&&(e.selectedLayer=null,e.selectedFeature=null,e.association=null)},async tearDown(){}},{id:"add-association-select-feature",async setUp(){const{utilityNetworkAssociationAddAssociationViewModel:e}=t.data.viewModel;e&&(e.selectedFeature=null,e.association=null)},async tearDown(){}},{id:"add-association-create-association",async setUp(){},async tearDown(){}}]}static{this._onCommitFactory=t=>async i=>{const{feature:o,utilityNetwork:s,associationsInput:r}=i,{utilityNetworkAssociationAddAssociationViewModel:a}=i.viewModel,{association:l}=a;await s.networkSystemLayers.loadAssociationsTable();const c=s?.generateAddAssociations([l]);if(!c)throw new e("editor:failed-to-add-association","Could not create payload needed to add association");const u=o.sourceLayer,p=n(u)&&u.parent?u.parent:u,w=d([p]),h=w.values().next().value?.featureService;if(!h)throw new e("editor:failed-to-delete-association","Could not retrieve feature service needed to delete association");await(h?.load());const y=s?.gdbVersion??void 0;await t(h,[c],{gdbVersion:y}),await r.refresh()}}};t([a()],g.prototype,"_utilityNetworkAssociationAddAssociationViewModel",void 0),t([a()],g.prototype,"_formViewModel",void 0),t([a()],g.prototype,"editorItem",null),t([a()],g.prototype,"formViewModel",null),t([a()],g.prototype,"utilityNetworkAssociationAddAssociationViewModel",null),t([a()],g.prototype,"sourceFeatureItem",void 0),t([a()],g.prototype,"hasPendingEdits",null),t([a()],g.prototype,"layer",null),t([a()],g.prototype,"parent",null),t([a()],g.prototype,"reliesOnOwnerAdminPrivileges",null),g=A=t([l("esri.widgets.Editor.AddAssociationWorkflow")],g);export{g as AddAssociationWorkflow};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as t}from"tslib";import o from"../../core/Accessor.js";import{property as e,subclass as i}from"../../core/accessorSupport/decorators.js";import{findEditorItemForLayerOrThrow as r}from"./workflowUtils.js";var s;let a=s=class extends o{constructor(t){super(t),this.editorItem=null,this.feature=null,this.utilityNetwork=null,this.associationType=null,this.parent=null,this.
|
|
2
|
+
import{__decorate as t}from"tslib";import o from"../../core/Accessor.js";import{property as e,subclass as i}from"../../core/accessorSupport/decorators.js";import{findEditorItemForLayerOrThrow as r}from"./workflowUtils.js";var s;let a=s=class extends o{constructor(t){super(t),this.editorItem=null,this.feature=null,this.utilityNetwork=null,this.associationType=null,this.parent=null,this.associationsInput=null,this.viewModel=null}static async create(t){const{feature:o,parent:e,viewModel:i,utilityNetwork:a,associationType:n,associationsInput:p}=t,l=r(i.editorItems,o.sourceLayer);return new s({editorItem:l,feature:o,parent:e,viewModel:i,utilityNetwork:a,associationType:n,associationsInput:p})}};t([e({constructOnly:!0})],a.prototype,"editorItem",void 0),t([e()],a.prototype,"feature",void 0),t([e({constructOnly:!0})],a.prototype,"utilityNetwork",void 0),t([e({constructOnly:!0})],a.prototype,"associationType",void 0),t([e()],a.prototype,"parent",void 0),t([e()],a.prototype,"associationsInput",void 0),t([e()],a.prototype,"viewModel",void 0),a=s=t([i("esri.widgets.Editor.AddAssociationWorkflowData")],a);export{a as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../Graphic.js";import a from"../../core/Error.js";import{makeHandle as i,handlesGroup as r,abortHandle as s}from"../../core/handleUtils.js";import"../../core/has.js";import n from"../../core/Logger.js";import{removeMaybe as o,destroyMaybe as l}from"../../core/maybe.js";import{isPromiseLike as d,debounce as c}from"../../core/promiseUtils.js";import{watch as u,initial as p,sync as h,whenOnce as m,syncAndInitial as f}from"../../core/reactiveUtils.js";import{generateBracedUUID as g}from"../../core/uuid.js";import{property as w,subclass as y}from"../../core/accessorSupport/decorators.js";import{isSharedTemplateOrMetadata as v,isSharedTemplate as _,getCreationAttributes as F,isStandardFeatureTemplate as b}from"../../editing/templateUtils.js";import{getFullTemplate as M}from"../../editing/sharedTemplates/templateLoader.js";import I from"../../layers/GraphicsLayer.js";import{isSceneLayer as V,isTable as k}from"../../layers/support/layerUtils.js";import{isNumber as S}from"../../support/guards.js";import{getDisplayedSymbol as T}from"../../symbols/support/symbolUtils.js";import{updateGraphicSymbolWhenRequired as C}from"../../views/draw/support/editingSessionUtils.js";import{getDrawHelpMessage as A}from"../../views/draw/support/helpMessageUtils.js";import P from"../../views/draw/support/HighlightHelper.js";import E from"../../views/interactive/sketch/SketchOptions.js";import U from"../../views/interactive/snapping/FeatureSnappingLayerSource.js";import{temporaryHighlightName as H}from"../../views/support/HighlightDefaults.js";import L from"./CreateFeaturesWorkflowData.js";import{isModelUpload as O,handleModelUpload as j}from"./modelUploadUtils.js";import x from"./Workflow.js";import{activeSketchToolDrawsUnsupportedCurve as D,createToolFromGeometryType as z,containsUnsupportedCurve as R,findEditorItemForLayer as W,getServiceEditsFromWorkflowData as G,getServiceInfoForLayer as N,orderEditsByRelationshipDependencies as K,getServiceLayersById as Z,startCreatingNewFeature as q,syncUpdateOptions as B,findLayerInfo as J,isTerminalUpdateEventType as Q,getVisualVariableAttributes as X,startUpdatingFeatureGeometry as Y,createWorkflowSteps as $,avoidFeatureTemplateSelectionWithOnlyOneItem as ee,setUpSketchCreateWatchers as te,setRelationshipFields as ae,prepareAttachmentsForCreateFeaturesWorkflow as ie,showProgressCursor as re,setVisualVariablesAndElevationInfoForUpdate as se,visualVariableInteractiveUpdate as ne}from"./workflowUtils.js";import oe from"../FeatureForm/FeatureFormViewModel.js";import le from"../Sketch/SketchViewModel.js";var de;const ce=Symbol(),ue=Symbol(),pe=Symbol(),he=Symbol(),me={point:["point"],multipoint:["multipoint"],polygon:["polygon","freehandPolygon","rectangle","circle"],polyline:["polyline","freehandPolyline"],mesh:[],multipatch:[]};let fe=de=class extends x{constructor(e){super(e),this.type="create-features",this.createFeatureState="create-new",this.data=void 0,this.isNested=!1,this._getDrawMeshHelpMessage=void 0,this._webStyleCache=new Map,this._featureFormHandle=null,this._visualVariableAttributes={rotation:null,size:null},this._formViewModel=new oe,this._sketchLayer=null,this._sketchViewModel=null,this._attachmentFileInfos=new Map,this._isActive=!0}initialize(){this.isNested&&(this._isActive=!1),this._initializeSketchViewModel()}destroy(){this._sketchViewModel.destroy()}get allowSave(){return!this.updating}get curveResizeDisabled(){return this.data.curveResizeDisabled}get curveUpdatesDisabled(){return this.data.curveUpdatesDisabled}get formViewModel(){return this._formViewModel}get hasInvalidFormTemplate(){return!!this.data.editorItem?.hasInvalidFormTemplate}get hasPendingEdits(){if(this.pendingFeatures.some(e=>!!this.data.getEditsForPendingFeature(e)?.modified))return!0;const{creationInfo:e,upload:t}=this.data,{activeComponent:a,createGraphic:i}=this._sketchViewModel,r=i?.geometry?.type;return!("polyline"!==r&&"polygon"!==r&&"multipoint"!==r||"draw-2d"!==a?.type&&"draw-3d"!==a?.type)&&a.drawOperation.committedVertices.length>0||(!(!t||"pending"!==t.state&&"success"!==t.state)||!!e?.geometryToPlace)}get hasPreviousStep(){return this._stepIndex>0||"update-pending"===this.createFeatureState&&!!this.data.selectedPendingFeature&&!this.parent&&!O(this.data.creationInfo)}get helpMessage(){const{creationInfo:e,viewModel:t}=this.data;if("creating-features"!==this.stepId||!e)return;const{_sketchViewModel:a}=this,{drawTool:i,isUsingLegacyCreateTools:r}=a;if(!r)return i?.helpMessageKey??"noTool";const s=e.layer.geometryType,n=a.createGraphic;if("mesh"===s){this._getDrawMeshHelpMessage||import("../../views/draw/support/helpMessageUtils3d.js").then(e=>{this._getDrawMeshHelpMessage=e.getDrawMeshHelpMessage});const{view:e}=t;return"3d"===e?.type?this._getDrawMeshHelpMessage?.(n,e):void 0}const{activeCreateToolDrawMode:o,activeTool:l}=a;return A("rectangle"===l||"circle"===l?l:s,n?.geometry,o)}get noticeMessage(){if(D(this._sketchViewModel,this.data.editorItem))return"curveToolDensifyWarning"}get layer(){return this.data.creationInfo?.layer}get numPendingFeatures(){return this.pendingFeatures.length}get numPendingFeaturesExcludingHidden(){return this.pendingFeatures.filter(e=>this.data.isDisplayable(e)).length}get parent(){return this.data.parent}get pendingFeatures(){return this.data.pendingFeatures}get keyboardCancellationEnabled(){return 0===this.numPendingFeatures}get reliesOnOwnerAdminPrivileges(){return this.data.editorItem?.capabilities.create.reliesOnOwnerAdminPrivileges??!1}get saveActionLabel(){return"create"}get shouldShowAttachments(){return(this.data.selectedPendingFeature&&this.data.editorItem?.capabilities.create.attachments.enabled)??!1}get shouldAllowAttachmentEditing(){return this.shouldShowAttachments}get sketchUpdateOptions(){const{editorItem:e}=this.data;return{enableScaling:!this.curveResizeDisabled,multipleSelectionEnabled:!1,reshapeOptions:{enableCreateCurveFromStraightEdge:!V(e?.layer)&&!!e?.capabilities.supportsTrueCurve}}}get sketchViewModel(){return this._sketchViewModel}get test(){}get availableCreateTools(){const e=this.data.creationInfo?.layer.geometryType,t=this.data.viewModel.view;if(!e)return[];if(this.data.creationInfo?.maxFeatures&&this.data.creationInfo.maxFeatures<=this.numPendingFeatures)return[];if(v(this.data.fullTemplate)){const{tool:t}=z(e,this.data.fullTemplate);return[t]}return"2d"!==t?.type&&"multipoint"===e?[]:[...me[e]]}get _attachmentsActive(){const e=this.data.viewModel.attachmentsViewModel.mode,t=this.stepId;return this.shouldShowAttachments&&("add"===e||"edit"===e||"adding-attachment"===t||"editing-attachment"===t)}getUpdating(){return!!this._sketchViewModel?.updating}async enter(){this._isActive=!0,"awaiting-feature-creation-info"!==this.stepId&&await this._updatingHandles.addPromise(this._setUpCreatingFeaturesStep())}exit(){this._isActive=!1,this.removeHandles([pe])}async updatePendingFeature(e){if(e!==this.data.selectedPendingFeature)return this._sketchViewModel.cancel(),this._startUpdating({feature:e})}async start(){return await super.start(),k(this.data.creationInfo?.layer)?null:{enter:async()=>{},exit:async()=>{},viewModel:this._sketchViewModel}}async save(e){const{formViewModel:t}=this;if(t.pendingSubtypeChoice)return;t.submit(),this._stashValidationState();const a=this.data.selectedPendingFeature,i=this._hasValidationErrors(a)?a:this.data.pendingFeatures.find(e=>this._hasValidationErrors(e));if(i)return await this._startUpdating({feature:i}),void t?.submit();const{pendingFeatures:r,editorItem:s}=this.data;if(s&&e&&R(r.toArray(),s)){if(!await e("curveEditingDensifyPrompt"))return this.reset()}return super.save()}back(e){return"update-pending"!==this.createFeatureState||!this.data.selectedPendingFeature||O(this.data.creationInfo)||this._attachmentsActive||this.parent?super.back(e):this._clearSelectedFeature()}previous(e){return"update-pending"!==this.createFeatureState||!this.data.selectedPendingFeature||O(this.data.creationInfo)||this._attachmentsActive?super.previous(e):this._clearSelectedFeature()}cancelFeature(e){this.data.isSharedTemplateWorkflow?n.getLogger(this).warn("Cannot cancel individual features created by shared templates."):(this.data.removePendingFeature(e),this.sketchViewModel.removeGraphic(e))}static create(e){const{addAttachmentsCallback:t,applyEdits:a,applyEditsFeatureService:i,isNested:r,creationInfo:s,parent:n,snappingManager:o,startAt:l,viewModel:d}=e,c=e.sketchOptions??new E,u=s?.layer,p=u?W(d.editorItems,u):void 0,h=new de({data:new L({creationInfo:s,editorItem:p,parent:n,sketchOptions:c,snappingManager:o,viewModel:d}),isNested:r,onCommit:async e=>{const{creationInfo:r}=e;if(!r)return;h._sketchViewModel.cancel();const s=e.pendingFeatures.toArray(),{layer:n}=r,o=n.capabilities?.editing.supportsGlobalId&&"globalIdField"in n,l=h._attachmentFileInfos,{fullTemplate:c}=e,u=G(h.data),p=_(c)&&u;if(o){if(ve(s),p){let t=Fe(u,l);const a=await(N(n,d.view)?.load());a&&(t=K({edits:t,serviceInfo:a,view:d.view,findOriginalFeature:t=>e.getEditsForPendingFeature(t)?.initialFeature??t})),await i(c.featureService,t,{globalIdUsed:!0,honorSequenceOfEdits:!0,gdbVersion:c.layer.gdbVersion??void 0})}else{const e=_e(s,l);await a(n,e,{globalIdUsed:!0})}return}const m=p?await i(c.featureService,u,{gdbVersion:c.layer.gdbVersion??void 0}):[await a(n,{addFeatures:s})];m&&l.size>0&&await Promise.all(m.map(e=>{if(e?.addFeatureResults)return t(n,ye(s,e.addFeatureResults,n,l))}))}});return h._set("steps",this._createWorkflowSteps(h,l)),h}_fadeExistingFeatures(e){if("effect"in e){const t=e.effect;return e.effect="saturate(0.6) opacity(0.8)",i(()=>e.effect=t)}const t=e.opacity;return e.opacity=.7,i(()=>e.opacity=t)}async _initializeFullTemplateAndExecutorInfo(e){const{creationInfo:t}=e,{view:a}=e.viewModel;if(!t||!a)return null;const i=await M(a,t.template);if(e.fullTemplate=i,i&&_(i)){const{createTemplateExecutor:r}=await import("../../editing/sharedTemplates/executor/createTemplateExecutor.js"),s={completionResults:[],executor:await r(i),serviceLayersById:Z(t.layer,a)};e.templateExecutorInfo=s}return i}async _startCreating(){this.removeHandles(ue);const{data:e}=this;if(!e.creationInfo)return;const t=this.data.creationInfo?.maxFeatures;if(t&&this.numPendingFeatures>=t)return this.sketchViewModel.cancel(),void(this.numPendingFeatures&&await this._startUpdating({feature:this.pendingFeatures.at(-1)}));this.createFeatureState="create-new",await q(this._sketchViewModel,this._sketchLayer,e,this._webStyleCache)}async _clearSelectedFeature(){const e=this._formViewModel.pendingSubtypeChoice;e&&(e.resolve("undo"),await e.promise),this._stashValidationState(),this.sketchViewModel.cancel(),this.data.selectedPendingFeature=null,this._featureFormHandle=o(this._featureFormHandle),this._formViewModel.feature=null;const t=this.data.viewModel.attachmentsViewModel;"add"!==t.mode&&"edit"!==t.mode||await(this.data.viewModel.activeWorkflow?.previous())}_stashValidationState(){const e=this._formViewModel.feature,t=e&&this.data.getEditsForPendingFeature(e);t&&(t.submittable=this._formViewModel.submittable)}async _selectFeatureForUpdate({feature:e,initialFeature:t=e}){this._stashValidationState();const{data:a,pendingFeatures:i,_webStyleCache:s}=this;i.includes(e)||a.addPendingFeature(e,t),a.selectedPendingFeature=e;const{_formViewModel:n,_sketchViewModel:l,sketchUpdateOptions:d}=this,{creationInfo:c,viewModel:p}=a,{attachmentsViewModel:h,layerInfos:m,view:f}=p;if(!f||!c)return;B(l,d),o(this._featureFormHandle);const g=e.sourceLayer,w=J(m,g),y=w?.formTemplate,v=f.spatialReference;n.set({editType:"INSERT",feature:e,formTemplate:y,spatialReference:v,map:f.map}),"add"!==h.mode&&"edit"!==h.mode||await(p.activeWorkflow?.previous()),h.graphic=e,h.fileInfos.removeAll(),h.mode="view";(this._attachmentFileInfos.get(e)||[]).forEach(({file:e,form:t})=>h.addFile(e,t)),await C(e,s,"2d"===f.type?f.scale:null);const _=a.getEditsForPendingFeature(e);this._featureFormHandle=r([n.on("value-change",async({fieldName:t,value:a})=>{if(_?.updateAttributes(n.getValues()),S(a)){const e=this._visualVariableAttributes;e.size&&!e.size.isUpdatingInteractively&&t===e.size.field&&e.size.setInitialValue(a),e.rotation&&!e.rotation.isUpdatingInteractively&&t===e.rotation.field&&e.rotation.setInitialValue(a)}await C(e,s,"2d"===f.type?f.scale:null)}),l.on(["update","undo","redo"],e=>{("undo"===e.type||"redo"===e.type||"update"===e.type&&null!=e.toolEventInfo&&Q(e.toolEventInfo.type))&&n.notifyFeatureGeometryChanged()}),u(()=>n.feature?.sourceLayer,t=>e.sourceLayer=t),u(()=>[n.feature,n.submittable],()=>this._stashValidationState())]),this.createFeatureState="update-pending"}async _startUpdating({feature:e,initialFeature:t=e}){await this._selectFeatureForUpdate({feature:e,initialFeature:t});const{_sketchLayer:a,_sketchViewModel:i,data:r}=this,{creationInfo:s,viewModel:n}=r,{view:o}=n;if(!o||!s)return;const l=e.sourceLayer??s.layer;return k(l)?void 0:(this._visualVariableAttributes=X(e),Y({graphic:e,sketchLayer:a,sketchViewModel:i,sourceLayer:l,updateOptions:this.sketchUpdateOptions,visualVariables:this._visualVariableAttributes,webStyleCache:this._webStyleCache}))}static _createWorkflowSteps(e,t="awaiting-feature-creation-info"){const{data:a}=e,i=$(["awaiting-feature-creation-info","creating-features","adding-attachment","editing-attachment"],t,{"awaiting-feature-creation-info":()=>({id:"awaiting-feature-creation-info",async setUp(){const{creationInfo:t,viewModel:i}=a,{view:r}=i;r&&(O(t)?e.addHandles(await j({view:r,data:a,next:()=>e.next(),cancel:()=>i.cancelWorkflow({warnIfNoWorkflow:!1})}),this.id):(a.parent&&t&&e.addHandles(i.restrictFeatureTemplatesViewModelToLayer(t.layer),this.id),e.addHandles(i.featureTemplatesViewModel.on("select",({item:t})=>{t&&(a.creationInfo={...a.creationInfo,layer:t.layer,template:t.template},e.next())}),this.id)))},async tearDown(){e.removeHandles(this.id)}}),"creating-features":()=>({id:"creating-features",async setUp(){e._isActive&&await e._setUpCreatingFeaturesStep()},async tearDown(t){const{viewModel:i}=a;t.canceled&&(e.removeHandles([pe,ce,ue,he]),i.attachmentsViewModel.fileInfos.removeAll(),e._attachmentFileInfos.clear())}}),"adding-attachment":()=>({id:"adding-attachment",parent:"creating-features",async setUp(){},async tearDown(){const{attachmentsViewModel:t}=a.viewModel,{graphic:i,fileInfos:r}=t;e._attachmentFileInfos.set(i,r.toArray()),t.mode="view"}}),"editing-attachment":()=>({id:"editing-attachment",parent:"creating-features",async setUp(){},async tearDown(){const{attachmentsViewModel:t}=a.viewModel,{graphic:i,fileInfos:r}=t;e._attachmentFileInfos.set(i,r.toArray()),t.mode="view"}})});return ee(a,i)}static _configureSketchViewModel(e){const{data:t,_sketchLayer:a,_sketchViewModel:s,_webStyleCache:n}=e,{creationInfo:o,viewModel:l}=t,{view:d}=l,p=[];if(!d)return i();if("2d"===d.type){o&&p.push(e._fadeExistingFeatures(o.layer));const t=c((e,t)=>Promise.all(e.map(e=>C(e,n,t))));p.push(u(()=>d.scale,e=>t(a.graphics,e)))}const h=F(t.fullTemplate,o?.attributeOverrides,o?.layer),m=u(()=>s.createGraphic&&s.activeComponent,()=>{s.createGraphic&&s.activeComponent&&!e.hasHandles(ue)&&e._updatingHandles.consumePromise(te({creationAttributes:h,data:t,sketchViewModel:s,view:d,webStyleCache:n}).then(t=>e.addHandles(t,ue)))}),f=async t=>{if("cancel"!==t.state&&"complete"!==t.state||e.removeHandles(ue),"cancel"===t.state&&null!==d.activeTool&&d.activeTool!==e.sketchViewModel.activeComponent&&(await e._waitForActiveToolCleared(),await e._startCreating()),"complete"===t.state&&t.graphic){const a=await e._processEdits(t.graphic,{scale:"2d"===d.type?d.scale:null,useSourceLayer:!0,webStyleCache:e._webStyleCache});a&&(await e._waitForActiveToolCleared(),await e._startUpdating({feature:a}))}},g=async i=>{const{attachmentsViewModel:r}=l,{_formViewModel:n}=e;if(i.graphics.length>1)return void await e._clearSelectedFeature();const c=i.graphics[0];if("complete"===i.state){const{submittable:t}=n;if(e.numPendingFeatures!==o?.maxFeatures&&t||n.submit(),await e._clearSelectedFeature(),"add"!==r.mode&&"edit"!==r.mode||await(l.activeWorkflow?.previous()),null==e.data.selectedPendingFeature&&(null==d.activeTool||d.activeTool===e.sketchViewModel.activeComponent)&&(await e.sketchViewModel.wait(),"ready"===e.sketchViewModel.state&&"mesh"!==e.data.creationInfo?.layer.geometryType))return e._startCreating()}else{if("start"===i.state)return c.sourceLayer??=t.creationInfo?.layer,await se({graphic:c,sketchLayer:a,sketchViewModel:s,visualVariables:e._visualVariableAttributes,webStyleCache:e._webStyleCache,sourceLayer:c.sourceLayer}),e._selectFeatureForUpdate({feature:c});if("active"===i.state){await e.updatePendingFeature(c);const t=e._visualVariableAttributes;ne(d,c,i,t)&&await C(c,e._webStyleCache,"2d"===d.type?d.scale:null);const a=c.attributes,{rotation:r,size:s}=t;if(null!=r){const{field:e}=r;n.setValue(e,a[e])}if(null!=s){const{field:e}=s;n.setValue(e,a[e])}}}},w=async a=>{if(a.graphics.forEach(e=>{t.removePendingFeature(e)}),!O(t.creationInfo))return e._startCreating()},y=async()=>{if(O(t.creationInfo))try{await e.data.viewModel.back()}catch{}return e._startCreating()};p.push(m,s.on("create",t=>e._updatingHandles.addPromise(f(t))),s.on("update",t=>e._updatingHandles.addPromise(g(t))),s.on("delete",t=>e._updatingHandles.addPromise(w(t))),e._updatingHandles.addWhen(()=>!e.numPendingFeatures,()=>e._updatingHandles.addPromise(y())),i(()=>{s.cancel()}),ge(s,a,t),...we(t));const v=r(p);return s.addHandles(v),v}_initializeSketchViewModel(){const{data:e}=this,{view:t}=e.viewModel,a=new I({elevationInfo:e.creationInfo?.layer.elevationInfo,internal:!0,listMode:"hide",title:"createFeaturesWorkflow-internal"}),r=new le({layer:a,creationMode:"single",sketchOptions:e.sketchOptions,snappingManager:e.snappingManager,useLegacyCreateTools:e.viewModel.useLegacyCreateTools,updateOnGraphicClick:!1,defaultUpdateOptions:this.sketchUpdateOptions,view:t});this._sketchLayer=a,this._sketchViewModel=r,t?.map.add(a),this.addHandles([i(()=>{t?.destroyed||t?.map.remove(a),l(a)}),u(()=>this.numPendingFeatures>0,e=>this._sketchViewModel.updateOnGraphicClick=e,p),u(()=>this.sketchUpdateOptions,e=>{r.defaultUpdateOptions=e,B(r,e)},h)])}_hasValidationErrors(e){return!!e&&(!this.data.isSubmittable(e)||!!this._formViewModel.validateContingencyConstraints(e.attributes,{includeIncompleteViolations:!0})?.length)}async _processEdits(e,t){const{data:a,_formViewModel:i,_sketchLayer:r}=this,{layerInfos:s,view:n}=a.viewModel;i.editType="INSERT",i.map=n?.map,i.spatialReference=n?.spatialReference;const{templateExecutorInfo:o}=a;if(!o){const t=e.clone();return t.geometry=null,await this._addAndInitializeEdits(e,t),e}r.remove(e);const{executor:l}=o,c=l(e.geometry,"completion"),u=d(c)?await c:c;o.completionResults.push(u),ae(u.relationships),i.editType="INSERT",i.map=n?.map,i.spatialReference=n?.spatialReference,u.primary&&a.creationInfo?.attributeOverrides&&(u.primary.graphic.attributes={...u.primary.graphic.attributes,...a.creationInfo.attributeOverrides});for(const d of u.edits){let e=null;if(d.addFeatures)for(const a of d.addFeatures){const i=a.clone();i.geometry=null,null!=a.geometry&&(a.symbol=await T(a,t),r.add(a)),a.sourceLayer!==e?.layer&&(e=J(s,a.sourceLayer));const n=!!u.associationGraphics?.has(a);await this._addAndInitializeEdits(a,i,e,n)}}i.feature=null,await m(()=>!i.updating);return u.edits.reduce((e,t)=>e+(t.addFeatures?.length??0),0)>1?null:u.primary?.graphic}async _addAndInitializeEdits(e,t,a,i=!1){const{data:r,_formViewModel:s}=this,{layerInfos:n}=r.viewModel,o=r.addPendingFeature(e,t,{isAssociation:i});a??=J(n,e.sourceLayer),s.feature=e,s.formTemplate=a?.formTemplate,await m(()=>!s.updating),o.updateAttributes(s.getValues()),o.submittable=s.submittable}async _setUpCreatingFeaturesStep(){if(this.hasHandles(pe))return;const{data:e,sketchViewModel:s}=this,{creationInfo:n,viewModel:l}=e,{attachmentsViewModel:d,view:c}=l;if(!c||!n?.layer)throw new a("missing-parameters","CreateFeaturesWorkflow requires a view and creationInfo.");const{initialFeature:h,layer:m}=n,f=[],g=[];this._featureFormHandle=o(this._featureFormHandle),this._visualVariableAttributes={rotation:null,size:null},e.editorItem=W(l.editorItems,n.layer),n.template&&(null==e.fullTemplate&&await this._initializeFullTemplateAndExecutorInfo(e),g.push(i(()=>{e.templateExecutorInfo&&(e.templateExecutorInfo.completionResults=[])}))),s.allowDeleteKey=!e.isSharedTemplateWorkflow,ie(d),f.push(u(()=>d.mode,e=>{switch(e){case"add":this.go("adding-attachment");break;case"edit":this.go("editing-attachment")}}));const w=re(c);f.push(w);const y=k(n.layer),{template:_}=n,M=!_||b(_)||v(_)&&"feature"===_.type,I=y&&M;try{if(I){const a=h??new t({attributes:F(e.fullTemplate,n.attributeOverrides,m),sourceLayer:m}),i=await this._processEdits(a);i&&await this._startUpdating({feature:i})}else f.push(de._configureSketchViewModel(this)),h?(O(n)&&n.geometryToPlace&&(h.attributes=F(e.fullTemplate,n.attributeOverrides,m)),s.addGraphic(h),await this._startUpdating({feature:h})):await this._startCreating()}finally{w.remove()}const V=i(()=>{for(const t of e.pendingFeatures)s.removeGraphic(t),e.removePendingFeature(t)}),S=u(()=>c?.timeZone,e=>{this._formViewModel.timeZone=e,this.data.timeZone=e},p),T=i(()=>{O(n)&&l.cancelWorkflow({warnIfNoWorkflow:!1})});this._featureFormHandle&&f.push(this._featureFormHandle),this.addHandles(f,this._handleKeys.beforeCommit),this.addHandles(g,this._handleKeys.afterCommit),this.addHandles([i(()=>d.fileInfos.removeAll()),r(f),r(g),T,V,S],pe)}async _waitForActiveToolCleared(){const e=this.data.viewModel.view;if(null==e?.activeTool)return;const t=new AbortController;this.addHandles(s(t),he),await m(()=>null==e?.activeTool,t.signal),t.abort()}};function ge(e,t,a){let s=null;const n=()=>e.snappingOptions.featureSources,o=()=>(s=new U({layer:t}),n().add(s),s),d=()=>{null!=s&&(n().remove(s),s=l(s))};return r([u(()=>{const e=a.creationInfo?.layer,t=n().find(t=>t.layer===e);return{hasFeatureLayerSource:!!t,enabled:t?.enabled??!1}},({hasFeatureLayerSource:e,enabled:t})=>{if(!e)return d();s??=o(),s.enabled=t},f),i(d)])}function we(e){const t=e.viewModel.view;if(!t)return[];const a=[];if("3d"===t.type){const r=new P({view:t});a.push(u(()=>e.selectedPendingFeature,(e,t)=>{r.remove(e),r.add(t)}),i(()=>r.destroy()))}const r=new P({view:t,highlightName:H});return a.push(u(()=>e.temporaryHighlightFeature,e=>{r.removeAll(),r.add(e)}),i(()=>r.destroy())),a}function ye(e,t,a,i){const r=[];return t.forEach((t,s)=>{if(!t.error){const n=e[s],o=i.get(n)||[];n.attributes[a.objectIdField]=t.objectId,o.forEach(({form:e})=>r.push({feature:n,attachment:e}))}}),r}function ve(e){for(const t of e){const{sourceLayer:e}=t;e&&"globalIdField"in e&&null!=e.globalIdField&&(t.attributes[e.globalIdField]??=g())}}function _e(e,t){const a=[];if(!t||0===t.size)return{addFeatures:e};for(const[i,r]of t)for(const{file:e}of r)a.push({feature:i,attachment:{globalId:g(),data:e}});return a.length?{addFeatures:e,addAttachments:a}:{addFeatures:e}}function Fe(e,t){return e.map(e=>{const{addFeatures:a}=e;if(!a||0===a.length)return e;const i=[];for(const r of a){const e=t.get(r);if(e)for(const{file:t}of e)i.push({feature:r,attachment:{globalId:g(),data:t}})}return i.length?{...e,addAttachments:i}:e})}e([w()],fe.prototype,"allowSave",null),e([w()],fe.prototype,"createFeatureState",void 0),e([w()],fe.prototype,"curveResizeDisabled",null),e([w()],fe.prototype,"curveUpdatesDisabled",null),e([w()],fe.prototype,"data",void 0),e([w({constructOnly:!0})],fe.prototype,"isNested",void 0),e([w()],fe.prototype,"formViewModel",null),e([w()],fe.prototype,"hasInvalidFormTemplate",null),e([w()],fe.prototype,"hasPendingEdits",null),e([w()],fe.prototype,"hasPreviousStep",null),e([w()],fe.prototype,"_getDrawMeshHelpMessage",void 0),e([w()],fe.prototype,"helpMessage",null),e([w()],fe.prototype,"noticeMessage",null),e([w()],fe.prototype,"layer",null),e([w()],fe.prototype,"parent",null),e([w()],fe.prototype,"keyboardCancellationEnabled",null),e([w()],fe.prototype,"reliesOnOwnerAdminPrivileges",null),e([w()],fe.prototype,"saveActionLabel",null),e([w()],fe.prototype,"shouldShowAttachments",null),e([w()],fe.prototype,"shouldAllowAttachmentEditing",null),e([w()],fe.prototype,"sketchUpdateOptions",null),e([w()],fe.prototype,"sketchViewModel",null),e([w()],fe.prototype,"availableCreateTools",null),e([w()],fe.prototype,"_attachmentsActive",null),fe=de=e([y("esri.widgets.Editor.CreateFeaturesWorkflow")],fe);const be=fe;export{be as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../Graphic.js";import a from"../../core/Collection.js";import i from"../../core/Error.js";import{makeHandle as r,handlesGroup as s,abortHandle as n}from"../../core/handleUtils.js";import"../../core/has.js";import o from"../../core/Logger.js";import{removeMaybe as l,destroyMaybe as d}from"../../core/maybe.js";import{isPromiseLike as c,debounce as u}from"../../core/promiseUtils.js";import{watch as h,initial as p,sync as m,whenOnce as f,syncAndInitial as g}from"../../core/reactiveUtils.js";import{generateBracedUUID as w}from"../../core/uuid.js";import{property as y,subclass as v}from"../../core/accessorSupport/decorators.js";import{isSharedTemplateOrMetadata as F,isSharedTemplate as _,getCreationAttributes as b,isStandardFeatureTemplate as M}from"../../editing/templateUtils.js";import{getFullTemplate as I}from"../../editing/sharedTemplates/templateLoader.js";import V from"../../layers/GraphicsLayer.js";import{isSceneLayer as k,isTable as S}from"../../layers/support/layerUtils.js";import{isNumber as A}from"../../support/guards.js";import{getDisplayedSymbol as C}from"../../symbols/support/symbolUtils.js";import{updateGraphicSymbolWhenRequired as T}from"../../views/draw/support/editingSessionUtils.js";import{getDrawHelpMessage as P}from"../../views/draw/support/helpMessageUtils.js";import E from"../../views/draw/support/HighlightHelper.js";import H from"../../views/interactive/sketch/SketchOptions.js";import U from"../../views/interactive/snapping/FeatureSnappingLayerSource.js";import{temporaryHighlightName as L}from"../../views/support/HighlightDefaults.js";import j from"../BatchAttributeForm/BatchAttributeFormViewModel.js";import O from"./CreateFeaturesWorkflowData.js";import{isModelUpload as x,handleModelUpload as D}from"./modelUploadUtils.js";import z from"./Workflow.js";import{activeSketchToolDrawsUnsupportedCurve as R,createToolFromGeometryType as W,containsUnsupportedCurve as G,findEditorItemForLayer as N,getServiceEditsFromWorkflowData as K,getServiceInfoForLayer as B,orderEditsByRelationshipDependencies as Z,getServiceLayersById as q,startCreatingNewFeature as J,syncUpdateOptions as Q,findLayerInfo as X,handleFormValuesChangeEvent as Y,isTerminalUpdateEventType as $,getVisualVariableAttributes as ee,startUpdatingFeatureGeometry as te,createWorkflowSteps as ae,avoidFeatureTemplateSelectionWithOnlyOneItem as ie,setUpSketchCreateWatchers as re,setRelationshipFields as se,prepareAttachmentsForCreateFeaturesWorkflow as ne,showProgressCursor as oe,setVisualVariablesAndElevationInfoForUpdate as le,visualVariableInteractiveUpdate as de}from"./workflowUtils.js";import ce from"../Sketch/SketchViewModel.js";var ue;const he=Symbol(),pe=Symbol(),me=Symbol(),fe=Symbol(),ge={point:["point"],multipoint:["multipoint"],polygon:["polygon","freehandPolygon","rectangle","circle"],polyline:["polyline","freehandPolyline"],mesh:[],multipatch:[]};let we=ue=class extends z{constructor(e){super(e),this.type="create-features",this.createFeatureState="create-new",this.data=void 0,this.isNested=!1,this._getDrawMeshHelpMessage=void 0,this._webStyleCache=new Map,this._featureFormHandle=null,this._visualVariableAttributes={rotation:null,size:null},this._formViewModel=new j,this._sketchLayer=null,this._sketchViewModel=null,this._attachmentFileInfos=new Map,this._isActive=!0}initialize(){this.isNested&&(this._isActive=!1),this._initializeSketchViewModel()}destroy(){this._sketchViewModel.destroy()}get allowSave(){return!this.updating}get curveResizeDisabled(){return this.data.curveResizeDisabled}get curveUpdatesDisabled(){return this.data.curveUpdatesDisabled}get formViewModel(){return this._formViewModel}get hasInvalidFormTemplate(){return!!this.data.editorItem?.hasInvalidFormTemplate}get hasPendingEdits(){if(this.pendingFeatures.some(e=>!!this.data.getEditsForPendingFeature(e)?.modified))return!0;const{creationInfo:e,upload:t}=this.data,{activeComponent:a,createGraphic:i}=this._sketchViewModel,r=i?.geometry?.type;return!("polyline"!==r&&"polygon"!==r&&"multipoint"!==r||"draw-2d"!==a?.type&&"draw-3d"!==a?.type)&&a.drawOperation.committedVertices.length>0||(!(!t||"pending"!==t.state&&"success"!==t.state)||!!e?.geometryToPlace)}get hasPreviousStep(){return this._stepIndex>0||"update-pending"===this.createFeatureState&&!!this.data.selectedPendingFeature&&!this.parent&&!x(this.data.creationInfo)}get helpMessage(){const{creationInfo:e,viewModel:t}=this.data;if("creating-features"!==this.stepId||!e)return;const{_sketchViewModel:a}=this,{drawTool:i,isUsingLegacyCreateTools:r}=a;if(!r)return i?.helpMessageKey??"noTool";const s=e.layer.geometryType,n=a.createGraphic;if("mesh"===s){this._getDrawMeshHelpMessage||import("../../views/draw/support/helpMessageUtils3d.js").then(e=>{this._getDrawMeshHelpMessage=e.getDrawMeshHelpMessage});const{view:e}=t;return"3d"===e?.type?this._getDrawMeshHelpMessage?.(n,e):void 0}const{activeCreateToolDrawMode:o,activeTool:l}=a;return P("rectangle"===l||"circle"===l?l:s,n?.geometry,o)}get noticeMessage(){if(R(this._sketchViewModel,this.data.editorItem))return"curveToolDensifyWarning"}get layer(){return this.data.creationInfo?.layer}get numPendingFeatures(){return this.pendingFeatures.length}get numPendingFeaturesExcludingHidden(){return this.pendingFeatures.filter(e=>this.data.isDisplayable(e)).length}get parent(){return this.data.parent}get pendingFeatures(){return this.data.pendingFeatures}get keyboardCancellationEnabled(){return 0===this.numPendingFeatures}get reliesOnOwnerAdminPrivileges(){return this.data.editorItem?.capabilities.create.reliesOnOwnerAdminPrivileges??!1}get saveActionLabel(){return"create"}get shouldShowAttachments(){return(this.data.selectedPendingFeature&&this.data.editorItem?.capabilities.create.attachments.enabled)??!1}get shouldAllowAttachmentEditing(){return this.shouldShowAttachments}get sketchUpdateOptions(){const{editorItem:e}=this.data;return{enableScaling:!this.curveResizeDisabled,multipleSelectionEnabled:!1,reshapeOptions:{enableCreateCurveFromStraightEdge:!k(e?.layer)&&!!e?.capabilities.supportsTrueCurve}}}get sketchViewModel(){return this._sketchViewModel}get test(){}get availableCreateTools(){const e=this.data.creationInfo?.layer.geometryType,t=this.data.viewModel.view;if(!e)return[];if(this.data.creationInfo?.maxFeatures&&this.data.creationInfo.maxFeatures<=this.numPendingFeatures)return[];if(F(this.data.fullTemplate)){const{tool:t}=W(e,this.data.fullTemplate);return[t]}return"2d"!==t?.type&&"multipoint"===e?[]:[...ge[e]]}get _attachmentsActive(){const e=this.data.viewModel.attachmentsViewModel.mode,t=this.stepId;return this.shouldShowAttachments&&("add"===e||"edit"===e||"adding-attachment"===t||"editing-attachment"===t)}getUpdating(){return!!this._sketchViewModel?.updating}async enter(){this._isActive=!0,"awaiting-feature-creation-info"!==this.stepId&&await this._updatingHandles.addPromise(this._setUpCreatingFeaturesStep())}exit(){this._isActive=!1,this.removeHandles([me])}async updatePendingFeature(e){if(e!==this.data.selectedPendingFeature)return this._sketchViewModel.cancel(),this._startUpdating({feature:e})}async start(){return await super.start(),S(this.data.creationInfo?.layer)?null:{enter:async()=>{},exit:async()=>{},viewModel:this._sketchViewModel}}async save(e){const{formViewModel:t}=this;await t.submit(),this._stashValidationState();const a=this.data.selectedPendingFeature,i=this._hasValidationErrors(a)?a:this.data.pendingFeatures.find(e=>this._hasValidationErrors(e));if(i)return await this._startUpdating({feature:i}),void await(t?.submit());const{pendingFeatures:r,editorItem:s}=this.data;if(s&&e&&G(r.toArray(),s)){if(!await e("curveEditingDensifyPrompt"))return this.reset()}return super.save()}back(e){return"update-pending"!==this.createFeatureState||!this.data.selectedPendingFeature||x(this.data.creationInfo)||this._attachmentsActive||this.parent?super.back(e):this._clearSelectedFeature()}previous(e){return"update-pending"!==this.createFeatureState||!this.data.selectedPendingFeature||x(this.data.creationInfo)||this._attachmentsActive?super.previous(e):this._clearSelectedFeature()}cancelFeature(e){this.data.isSharedTemplateWorkflow?o.getLogger(this).warn("Cannot cancel individual features created by shared templates."):(this.data.removePendingFeature(e),this.sketchViewModel.removeGraphic(e))}static create(e){const{addAttachmentsCallback:t,applyEdits:a,applyEditsFeatureService:i,isNested:r,creationInfo:s,parent:n,snappingManager:o,startAt:l,viewModel:d}=e,c=e.sketchOptions??new H,u=s?.layer,h=u?N(d.editorItems,u):void 0,p=new ue({data:new O({creationInfo:s,editorItem:h,parent:n,sketchOptions:c,snappingManager:o,viewModel:d}),isNested:r,onCommit:async e=>{const{creationInfo:r}=e;if(!r)return;p._sketchViewModel.cancel();const s=e.pendingFeatures.toArray(),{layer:n}=r,o=n.capabilities?.editing.supportsGlobalId&&"globalIdField"in n,l=p._attachmentFileInfos,{fullTemplate:c}=e,u=K(p.data),h=_(c)&&u;if(o){if(_e(s),h){let t=Me(u,l);const a=await(B(n,d.view)?.load());a&&(t=Z({edits:t,serviceInfo:a,view:d.view,findOriginalFeature:t=>e.getEditsForPendingFeature(t)?.initialFeature??t})),await i(c.featureService,t,{globalIdUsed:!0,honorSequenceOfEdits:!0,gdbVersion:c.layer.gdbVersion??void 0})}else{const e=be(s,l);await a(n,e,{globalIdUsed:!0})}return}const m=h?await i(c.featureService,u,{gdbVersion:c.layer.gdbVersion??void 0}):[await a(n,{addFeatures:s})];m&&l.size>0&&await Promise.all(m.map(e=>{if(e?.addFeatureResults)return t(n,Fe(s,e.addFeatureResults,n,l))}))}});return p._set("steps",this._createWorkflowSteps(p,l)),p}_fadeExistingFeatures(e){if("effect"in e){const t=e.effect;return e.effect="saturate(0.6) opacity(0.8)",r(()=>e.effect=t)}const t=e.opacity;return e.opacity=.7,r(()=>e.opacity=t)}async _initializeFullTemplateAndExecutorInfo(e){const{creationInfo:t}=e,{view:a}=e.viewModel;if(!t||!a)return null;const i=await I(a,t.template);if(e.fullTemplate=i,i&&_(i)){const{createTemplateExecutor:r}=await import("../../editing/sharedTemplates/executor/createTemplateExecutor.js"),s={completionResults:[],executor:await r(i),serviceLayersById:q(t.layer,a)};e.templateExecutorInfo=s}return i}async _startCreating(){this.removeHandles(pe);const{data:e}=this;if(!e.creationInfo)return;const t=this.data.creationInfo?.maxFeatures;if(t&&this.numPendingFeatures>=t)return this.sketchViewModel.cancel(),void(this.numPendingFeatures&&await this._startUpdating({feature:this.pendingFeatures.at(-1)}));this.createFeatureState="create-new",await J(this._sketchViewModel,this._sketchLayer,e,this._webStyleCache)}async _clearSelectedFeature(){this._stashValidationState(),this.sketchViewModel.cancel(),this.data.selectedPendingFeature=null,this._featureFormHandle=l(this._featureFormHandle),this._formViewModel.features=new a,this._formViewModel.activeFeatureIndex=-1;const e=this.data.viewModel.attachmentsViewModel;"add"!==e.mode&&"edit"!==e.mode||await(this.data.viewModel.activeWorkflow?.previous())}_stashValidationState(){const e=this._formViewModel.activeFeature,t=e&&this.data.getEditsForPendingFeature(e);t&&(t.submittable=this._formViewModel.valid)}async _selectFeatureForUpdate({feature:e,initialFeature:t=e}){this._stashValidationState();const{data:i,pendingFeatures:r,_webStyleCache:n}=this;r.includes(e)||i.addPendingFeature(e,t),i.selectedPendingFeature=e;const{_formViewModel:o,_sketchViewModel:d,sketchUpdateOptions:c}=this,{creationInfo:u,viewModel:p}=i,{attachmentsViewModel:m,layerInfos:f,view:g}=p;if(!g||!u)return;Q(d,c),l(this._featureFormHandle);const w=e.sourceLayer,y=X(f,w),v=g.spatialReference;o.set({editType:"INSERT",features:new a([e]),activeFeatureIndex:0,layerInfos:y?[y]:null,spatialReference:v,map:g.map}),"add"!==m.mode&&"edit"!==m.mode||await(p.activeWorkflow?.previous()),m.graphic=e,m.fileInfos.removeAll(),m.mode="view";(this._attachmentFileInfos.get(e)||[]).forEach(({file:e,form:t})=>m.addFile(e,t)),await T(e,n,"2d"===g.type?g.scale:null);const F=i.getEditsForPendingFeature(e);this._featureFormHandle=s([o.on("values-change",Y({filter:e=>e===F?.feature,forEachValueChange:(e,t)=>{if(A(t)){const a=this._visualVariableAttributes;a.size&&!a.size.isUpdatingInteractively&&e===a.size.field&&a.size.setInitialValue(t),a.rotation&&!a.rotation.isUpdatingInteractively&&e===a.rotation.field&&a.rotation.setInitialValue(t)}},forEachFeature:e=>{F?.updateAttributes(o.getValues(e)),T(e,n,"2d"===g.type?g.scale:null)}})),d.on(["update","undo","redo"],t=>{("undo"===t.type||"redo"===t.type||"update"===t.type&&null!=t.toolEventInfo&&$(t.toolEventInfo.type))&&o.notifyGeometriesChanged([e])}),h(()=>o.activeFeature?.sourceLayer,t=>e.sourceLayer=t),h(()=>[o.activeFeature,o.valid],()=>this._stashValidationState())]),this.createFeatureState="update-pending"}async _startUpdating({feature:e,initialFeature:t=e}){await this._selectFeatureForUpdate({feature:e,initialFeature:t});const{_sketchLayer:a,_sketchViewModel:i,data:r}=this,{creationInfo:s,viewModel:n}=r,{view:o}=n;if(!o||!s)return;const l=e.sourceLayer??s.layer;return S(l)?void 0:(this._visualVariableAttributes=ee(e),te({graphic:e,sketchLayer:a,sketchViewModel:i,sourceLayer:l,updateOptions:this.sketchUpdateOptions,visualVariables:this._visualVariableAttributes,webStyleCache:this._webStyleCache}))}static _createWorkflowSteps(e,t="awaiting-feature-creation-info"){const{data:a}=e,i=ae(["awaiting-feature-creation-info","creating-features","adding-attachment","editing-attachment"],t,{"awaiting-feature-creation-info":()=>({id:"awaiting-feature-creation-info",async setUp(){const{creationInfo:t,viewModel:i}=a,{view:r}=i;r&&(x(t)?e.addHandles(await D({view:r,data:a,next:()=>e.next(),cancel:()=>i.cancelWorkflow({warnIfNoWorkflow:!1})}),this.id):(a.parent&&t&&e.addHandles(i.restrictFeatureTemplatesViewModelToLayer(t.layer),this.id),e.addHandles(i.featureTemplatesViewModel.on("select",({item:t})=>{t&&(a.creationInfo={...a.creationInfo,layer:t.layer,template:t.template},e.next())}),this.id)))},async tearDown(){e.removeHandles(this.id)}}),"creating-features":()=>({id:"creating-features",async setUp(){e._isActive&&await e._setUpCreatingFeaturesStep()},async tearDown(t){const{viewModel:i}=a;t.canceled&&(e.removeHandles([me,he,pe,fe]),i.attachmentsViewModel.fileInfos.removeAll(),e._attachmentFileInfos.clear())}}),"adding-attachment":()=>({id:"adding-attachment",parent:"creating-features",async setUp(){},async tearDown(){const{attachmentsViewModel:t}=a.viewModel,{graphic:i,fileInfos:r}=t;e._attachmentFileInfos.set(i,r.toArray()),t.mode="view"}}),"editing-attachment":()=>({id:"editing-attachment",parent:"creating-features",async setUp(){},async tearDown(){const{attachmentsViewModel:t}=a.viewModel,{graphic:i,fileInfos:r}=t;e._attachmentFileInfos.set(i,r.toArray()),t.mode="view"}})});return ie(a,i)}static _configureSketchViewModel(e){const{data:t,_sketchLayer:a,_sketchViewModel:i,_webStyleCache:n}=e,{creationInfo:o,viewModel:l}=t,{view:d}=l,c=[];if(!d)return r();if("2d"===d.type){o&&c.push(e._fadeExistingFeatures(o.layer));const t=u((e,t)=>Promise.all(e.map(e=>T(e,n,t))));c.push(h(()=>d.scale,e=>t(a.graphics,e)))}const p=b(t.fullTemplate,o?.attributeOverrides,o?.layer),m=h(()=>i.createGraphic&&i.activeComponent,()=>{i.createGraphic&&i.activeComponent&&!e.hasHandles(pe)&&e._updatingHandles.consumePromise(re({creationAttributes:p,data:t,sketchViewModel:i,view:d,webStyleCache:n}).then(t=>e.addHandles(t,pe)))}),f=async t=>{if("cancel"!==t.state&&"complete"!==t.state||e.removeHandles(pe),"cancel"===t.state&&null!==d.activeTool&&d.activeTool!==e.sketchViewModel.activeComponent&&(await e._waitForActiveToolCleared(),await e._startCreating()),"complete"===t.state&&t.graphic){const a=await e._processEdits(t.graphic,{scale:"2d"===d.type?d.scale:null,useSourceLayer:!0,webStyleCache:e._webStyleCache});a&&(await e._waitForActiveToolCleared(),await e._startUpdating({feature:a}))}},g=async r=>{const{attachmentsViewModel:s}=l,{_formViewModel:n}=e;if(r.graphics.length>1)return void await e._clearSelectedFeature();const c=r.graphics[0];if("complete"===r.state){if(e.numPendingFeatures!==o?.maxFeatures&&n.valid||n.submit(),await e._clearSelectedFeature(),"add"!==s.mode&&"edit"!==s.mode||await(l.activeWorkflow?.previous()),null==e.data.selectedPendingFeature&&(null==d.activeTool||d.activeTool===e.sketchViewModel.activeComponent)&&(await e.sketchViewModel.wait(),"ready"===e.sketchViewModel.state&&"mesh"!==e.data.creationInfo?.layer.geometryType))return e._startCreating()}else{if("start"===r.state)return c.sourceLayer??=t.creationInfo?.layer,await le({graphic:c,sketchLayer:a,sketchViewModel:i,visualVariables:e._visualVariableAttributes,webStyleCache:e._webStyleCache,sourceLayer:c.sourceLayer}),e._selectFeatureForUpdate({feature:c});if("active"===r.state){await e.updatePendingFeature(c);const t=e._visualVariableAttributes;de(d,c,r,t)&&await T(c,e._webStyleCache,"2d"===d.type?d.scale:null);const a=c.attributes,{rotation:i,size:s}=t;if(null!=i){const{field:t}=i;e._updatingHandles.consumePromise(n.setFieldValue(t,a[t]))}if(null!=s){const{field:t}=s;e._updatingHandles.consumePromise(n.setFieldValue(t,a[t]))}}}},w=async a=>{if(a.graphics.forEach(e=>{t.removePendingFeature(e)}),!x(t.creationInfo))return e._startCreating()},y=async()=>{if(x(t.creationInfo))try{await e.data.viewModel.back()}catch{}return e._startCreating()};c.push(m,i.on("create",t=>e._updatingHandles.addPromise(f(t))),i.on("update",t=>e._updatingHandles.addPromise(g(t))),i.on("delete",t=>e._updatingHandles.addPromise(w(t))),e._updatingHandles.addWhen(()=>!e.numPendingFeatures,()=>e._updatingHandles.addPromise(y())),r(()=>{i.cancel()}),ye(i,a,t),...ve(t));const v=s(c);return i.addHandles(v),v}_initializeSketchViewModel(){const{data:e}=this,{view:t}=e.viewModel,a=new V({elevationInfo:e.creationInfo?.layer.elevationInfo,internal:!0,listMode:"hide",title:"createFeaturesWorkflow-internal"}),i=new ce({layer:a,creationMode:"single",sketchOptions:e.sketchOptions,snappingManager:e.snappingManager,useLegacyCreateTools:e.viewModel.useLegacyCreateTools,updateOnGraphicClick:!1,defaultUpdateOptions:this.sketchUpdateOptions,view:t});this._sketchLayer=a,this._sketchViewModel=i,t?.map.add(a),this.addHandles([r(()=>{t?.destroyed||t?.map.remove(a),d(a)}),h(()=>this.numPendingFeatures>0,e=>this._sketchViewModel.updateOnGraphicClick=e,p),h(()=>this.sketchUpdateOptions,e=>{i.defaultUpdateOptions=e,Q(i,e)},m)])}_hasValidationErrors(e){return!!e&&!this.data.isSubmittable(e)}async _processEdits(e,t){const{data:i,_formViewModel:r,_sketchLayer:s}=this,{layerInfos:n,view:o}=i.viewModel;r.editType="INSERT",r.map=o?.map,r.spatialReference=o?.spatialReference;const{templateExecutorInfo:l}=i;if(!l){const t=e.clone();return t.geometry=null,await this._addAndInitializeEdits(e,t),e}s.remove(e);const{executor:d}=l,u=d(e.geometry,"completion"),h=c(u)?await u:u;l.completionResults.push(h),se(h.relationships),r.editType="INSERT",r.map=o?.map,r.spatialReference=o?.spatialReference,h.primary&&i.creationInfo?.attributeOverrides&&(h.primary.graphic.attributes={...h.primary.graphic.attributes,...i.creationInfo.attributeOverrides});for(const a of h.edits){let e=null;if(a.addFeatures)for(const i of a.addFeatures){const a=i.clone();a.geometry=null,null!=i.geometry&&(i.symbol=await C(i,t),s.add(i)),i.sourceLayer!==e?.layer&&(e=X(n,i.sourceLayer));const r=!!h.associationGraphics?.has(i);await this._addAndInitializeEdits(i,a,e,r)}}r.features=new a,r.activeFeatureIndex=-1,await f(()=>!r.updating);return h.edits.reduce((e,t)=>e+(t.addFeatures?.length??0),0)>1?null:h.primary?.graphic}async _addAndInitializeEdits(e,t,i,r=!1){const{data:s,_formViewModel:n}=this,{layerInfos:o}=s.viewModel,l=s.addPendingFeature(e,t,{isAssociation:r});i??=X(o,e.sourceLayer),n.features=new a([e]),n.activeFeatureIndex=0,n.layerInfos=i?[i]:null,await f(()=>!n.updating),l.updateAttributes(n.getValues(e)),l.submittable=n.valid}async _setUpCreatingFeaturesStep(){if(this.hasHandles(me))return;const{data:e,sketchViewModel:a}=this,{creationInfo:n,viewModel:o}=e,{attachmentsViewModel:d,view:c}=o;if(!c||!n?.layer)throw new i("missing-parameters","CreateFeaturesWorkflow requires a view and creationInfo.");const{initialFeature:u,layer:m}=n,f=[],g=[];this._featureFormHandle=l(this._featureFormHandle),this._visualVariableAttributes={rotation:null,size:null},e.editorItem=N(o.editorItems,n.layer),n.template&&(null==e.fullTemplate&&await this._initializeFullTemplateAndExecutorInfo(e),g.push(r(()=>{e.templateExecutorInfo&&(e.templateExecutorInfo.completionResults=[])}))),a.allowDeleteKey=!e.isSharedTemplateWorkflow,ne(d),f.push(h(()=>d.mode,e=>{switch(e){case"add":this.go("adding-attachment");break;case"edit":this.go("editing-attachment")}}));const w=oe(c);f.push(w);const y=S(n.layer),{template:v}=n,_=!v||M(v)||F(v)&&"feature"===v.type,I=y&&_;try{if(I){const a=u??new t({attributes:b(e.fullTemplate,n.attributeOverrides,m),sourceLayer:m}),i=await this._processEdits(a);i&&await this._startUpdating({feature:i})}else f.push(ue._configureSketchViewModel(this)),u?(x(n)&&n.geometryToPlace&&(u.attributes=b(e.fullTemplate,n.attributeOverrides,m)),a.addGraphic(u),await this._startUpdating({feature:u})):await this._startCreating()}finally{w.remove()}const V=r(()=>{for(const t of e.pendingFeatures)a.removeGraphic(t),e.removePendingFeature(t)}),k=h(()=>c?.timeZone,e=>{this._formViewModel.timeZone=e,this.data.timeZone=e},p),A=r(()=>{x(n)&&o.cancelWorkflow({warnIfNoWorkflow:!1})});this._featureFormHandle&&f.push(this._featureFormHandle),this.addHandles(f,this._handleKeys.beforeCommit),this.addHandles(g,this._handleKeys.afterCommit),this.addHandles([r(()=>d.fileInfos.removeAll()),s(f),s(g),A,V,k],me)}async _waitForActiveToolCleared(){const e=this.data.viewModel.view;if(null==e?.activeTool)return;const t=new AbortController;this.addHandles(n(t),fe),await f(()=>null==e?.activeTool,t.signal),t.abort()}};function ye(e,t,a){let i=null;const n=()=>e.snappingOptions.featureSources,o=()=>(i=new U({layer:t}),n().add(i),i),l=()=>{null!=i&&(n().remove(i),i=d(i))};return s([h(()=>{const e=a.creationInfo?.layer,t=n().find(t=>t.layer===e);return{hasFeatureLayerSource:!!t,enabled:t?.enabled??!1}},({hasFeatureLayerSource:e,enabled:t})=>{if(!e)return l();i??=o(),i.enabled=t},g),r(l)])}function ve(e){const t=e.viewModel.view;if(!t)return[];const a=[];if("3d"===t.type){const i=new E({view:t});a.push(h(()=>e.selectedPendingFeature,(e,t)=>{i.remove(e),i.add(t)}),r(()=>i.destroy()))}const i=new E({view:t,highlightName:L});return a.push(h(()=>e.temporaryHighlightFeature,e=>{i.removeAll(),i.add(e)}),r(()=>i.destroy())),a}function Fe(e,t,a,i){const r=[];return t.forEach((t,s)=>{if(!t.error){const n=e[s],o=i.get(n)||[];n.attributes[a.objectIdField]=t.objectId,o.forEach(({form:e})=>r.push({feature:n,attachment:e}))}}),r}function _e(e){for(const t of e){const{sourceLayer:e}=t;e&&"globalIdField"in e&&null!=e.globalIdField&&(t.attributes[e.globalIdField]??=w())}}function be(e,t){const a=[];if(!t||0===t.size)return{addFeatures:e};for(const[i,r]of t)for(const{file:e}of r)a.push({feature:i,attachment:{globalId:w(),data:e}});return a.length?{addFeatures:e,addAttachments:a}:{addFeatures:e}}function Me(e,t){return e.map(e=>{const{addFeatures:a}=e;if(!a||0===a.length)return e;const i=[];for(const r of a){const e=t.get(r);if(e)for(const{file:t}of e)i.push({feature:r,attachment:{globalId:w(),data:t}})}return i.length?{...e,addAttachments:i}:e})}e([y()],we.prototype,"allowSave",null),e([y()],we.prototype,"createFeatureState",void 0),e([y()],we.prototype,"curveResizeDisabled",null),e([y()],we.prototype,"curveUpdatesDisabled",null),e([y()],we.prototype,"data",void 0),e([y({constructOnly:!0})],we.prototype,"isNested",void 0),e([y()],we.prototype,"formViewModel",null),e([y()],we.prototype,"hasInvalidFormTemplate",null),e([y()],we.prototype,"hasPendingEdits",null),e([y()],we.prototype,"hasPreviousStep",null),e([y()],we.prototype,"_getDrawMeshHelpMessage",void 0),e([y()],we.prototype,"helpMessage",null),e([y()],we.prototype,"noticeMessage",null),e([y()],we.prototype,"layer",null),e([y()],we.prototype,"parent",null),e([y()],we.prototype,"keyboardCancellationEnabled",null),e([y()],we.prototype,"reliesOnOwnerAdminPrivileges",null),e([y()],we.prototype,"saveActionLabel",null),e([y()],we.prototype,"shouldShowAttachments",null),e([y()],we.prototype,"shouldAllowAttachmentEditing",null),e([y()],we.prototype,"sketchUpdateOptions",null),e([y()],we.prototype,"sketchViewModel",null),e([y()],we.prototype,"availableCreateTools",null),e([y()],we.prototype,"_attachmentsActive",null),we=ue=e([v("esri.widgets.Editor.CreateFeaturesWorkflow")],we);const Ie=we;export{Ie as default};
|
|
@@ -188,7 +188,7 @@ export default class EditorViewModel extends EventedAccessor {
|
|
|
188
188
|
*
|
|
189
189
|
* @since 4.33
|
|
190
190
|
*/
|
|
191
|
-
get formViewModel(): BatchAttributeFormViewModel |
|
|
191
|
+
get formViewModel(): BatchAttributeFormViewModel | null | undefined;
|
|
192
192
|
/**
|
|
193
193
|
* Use this property to determine if the next generation geometry creation
|
|
194
194
|
* has been disabled. This can happen when
|