@arcgis/core 5.0.0-next.14 → 5.0.0-next.15
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/PopupTemplate.js +1 -1
- package/applications/Components/QuantityFormatter.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{5299ec59c86022ca37e2.js → 080268f78436a2f0d996.js} +1 -1
- package/assets/esri/core/workers/chunks/{a6ee40dfc471d6612f3c.js → 1585298168c200d65c2f.js} +1 -1
- package/assets/esri/core/workers/chunks/{34bb4852ebef0f529c96.js → 1a98e35837c6279fd8ee.js} +1 -1
- package/assets/esri/core/workers/chunks/5608e1eeec887295dc7c.js +1 -0
- package/assets/esri/core/workers/chunks/57262321c51096ef885f.js +1 -0
- package/assets/esri/core/workers/chunks/58d891779f04b6d12fc0.js +1 -0
- package/assets/esri/core/workers/chunks/{7c14f99e6cfff2a8ef4a.js → 5a7bb13ccb9188f90dfd.js} +1 -1
- package/assets/esri/core/workers/chunks/607beb12592f99871bf9.js +1 -0
- package/assets/esri/core/workers/chunks/{8be16b03caa947ac7631.js → 79326e3ebd5081046f79.js} +1 -1
- package/assets/esri/core/workers/chunks/7c08c0824ad354177787.js +1 -0
- package/assets/esri/core/workers/chunks/{54c49a768147720c3c56.js → 8208dfa8f7fae7e616b9.js} +1 -1
- package/assets/esri/core/workers/chunks/{d7755c4c8d1d3059efca.js → 847f4fc39100fac1df01.js} +1 -1
- package/assets/esri/core/workers/chunks/8b73db0f4d6714396eb0.js +1 -0
- package/assets/esri/core/workers/chunks/{9cdd087c43a601ec331d.js → 9a7f7de06dbc37661ffb.js} +1 -1
- package/assets/esri/core/workers/chunks/{55adbd7481f8dfb1067e.js → a174c9f6bc687349e563.js} +1 -1
- package/assets/esri/core/workers/chunks/{38fa50336983265c73a4.js → bc318b6fef192cee2a72.js} +1 -1
- package/assets/esri/core/workers/chunks/{57806a01f33074b601e7.js → cdb4664fd59860ddeb5a.js} +1 -1
- package/assets/esri/core/workers/chunks/d98203c932a60f9f809d.js +1 -0
- package/assets/esri/core/workers/chunks/{5e08b19e6d7202ea38d7.js → db900e8949cc75e72b18.js} +1 -1
- package/assets/esri/core/workers/chunks/de831a9cb542a09db5c3.js +1 -0
- package/assets/esri/core/workers/chunks/{2166238a7ad63a2d43c7.js → e05ce6f91ca59e34da7c.js} +1 -1
- package/assets/esri/core/workers/chunks/{f28ffda9a95c6568503d.js → e07dda45281439e6582e.js} +1 -1
- package/assets/esri/core/workers/chunks/{d888ae5ac1810a486919.js → ff8752dbcb014ea66806.js} +1 -1
- package/chunks/GaussianSplat.glsl.js +2 -2
- package/config.js +1 -1
- package/copyright.txt +0 -60
- package/core/SetUtils.js +1 -1
- package/core/workers/workerFactory.js +1 -1
- package/identity/IdentityModal.js +1 -1
- package/interfaces.d.ts +105 -9
- package/intl.js +1 -1
- package/kernel.js +1 -1
- package/layers/ImageryTileLayer.js +1 -1
- package/layers/ParquetLayer.js +1 -1
- package/layers/graphics/sources/ParquetSource.js +1 -1
- package/layers/graphics/sources/support/QueryTask.js +1 -1
- package/layers/mixins/ArcGISImageService.js +1 -1
- package/layers/mixins/ImageryTileMixin.js +1 -1
- package/layers/support/NumberFieldFormat.js +1 -1
- package/layers/support/Sublayer.js +1 -1
- package/layers/support/SubtypeSublayer.js +1 -1
- package/layers/support/featureLayerUtils.js +1 -1
- package/layers/support/fieldUtils.js +1 -1
- package/layers/support/rasterDatasets/BaseRaster.js +1 -1
- package/layers/support/rasterFunctionUtils.js +1 -1
- package/package.json +1 -1
- package/popup/content.js +1 -1
- package/portal/schemas/definitions.js +1 -1
- package/renderers/support/numberUtils.js +1 -1
- package/rest/geometryService.js +1 -1
- package/rest/geoprocessor.js +1 -1
- package/rest/imageService.js +1 -1
- package/rest/locator.js +1 -1
- package/rest/query.js +1 -1
- package/smartMapping/labels/bins.js +1 -1
- package/smartMapping/popup/support/clusterUtils.js +1 -1
- package/smartMapping/popup/support/utils.js +1 -1
- package/smartMapping/renderers/support/utils.js +1 -1
- package/support/BasemapStyle.js +1 -1
- package/support/actions/actionUtils.js +1 -1
- package/support/revision.js +1 -1
- package/symbols/support/svgUtils.js +1 -1
- package/tables/elements.js +1 -1
- package/views/2d/layers/features/FeatureSourceEventLog.js +1 -1
- package/views/2d/layers/features/processor/TrackStrategy.js +1 -1
- package/views/2d/layers/graphics/GraphicStore.js +1 -1
- package/views/3d/analysis/AreaMeasurement/support/AreaMeasurementVisualization.js +1 -1
- package/views/3d/analysis/Dimension/DimensionVisualization.js +1 -1
- package/views/3d/analysis/DirectLineMeasurement/DirectLineMeasurementVisualization.js +1 -1
- package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillVisualization.js +1 -1
- package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
- package/views/3d/layers/IntegratedMeshLayerView3D.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/shading/PiUtils.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/util/FastApproximateTrigonometry.glsl.js +26 -0
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/shaders/GaussianSplat.glsl.js +1 -1
- package/views/analysis/ElevationProfile/ElevationProfileChart.js +1 -1
- package/views/draw/support/Reshape.js +1 -1
- package/views/interactive/SegmentLabels.js +1 -1
- package/views/interactive/editGeometry/EditGeometry.js +1 -1
- package/views/interactive/tooltip/components/DrawHeaderActions.js +1 -1
- package/views/interactive/tooltip/components/TooltipEditableField.js +1 -1
- package/views/interactive/tooltip/components/TooltipField.js +1 -1
- package/views/interactive/tooltip/components/ValueByValue.js +1 -1
- package/views/interactive/tooltip/content/Fields.js +1 -1
- package/views/interactive/tooltip/content/TooltipContent.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentDrawCircle.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentDrawMesh.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentDrawPoint.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentDrawPolygon.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentDrawPolyline.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentDrawRectangle.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentElevation.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentExtentRotate.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentExtentScale.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentMovePoint.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentReshapeEdgeOffset.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentSelectedVertex.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentTransformMesh.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentTransformPoint.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentTranslate.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentTranslateVertex.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentTranslateXY.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentTranslateZ.js +1 -1
- package/views/navigation/gamepad/GamepadSettings.js +1 -1
- package/views/overlay/BoxOverlayItem.js +1 -1
- package/views/overlay/CrosshairOverlayItem.js +1 -1
- package/views/overlay/OutlineOverlayItem.js +1 -1
- package/views/ui/UI.js +1 -1
- package/widgets/AreaMeasurement2D/AreaMeasurement2DTool.js +1 -1
- package/widgets/AreaMeasurement2D.js +1 -1
- package/widgets/AreaMeasurement3D.js +1 -1
- package/widgets/Attachments.js +1 -1
- package/widgets/Attribution.js +1 -1
- package/widgets/BasemapGallery.js +1 -1
- package/widgets/BasemapLayerList.js +1 -1
- package/widgets/BasemapToggle.js +1 -1
- package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
- package/widgets/BatchAttributeForm/batchAttributeFormUtils.js +1 -1
- package/widgets/BatchAttributeForm/inputs/FieldInput.js +1 -1
- package/widgets/BatchAttributeForm/inputs/InputBase.js +1 -1
- package/widgets/BatchAttributeForm/templates/support/createBatchFormTemplate.js +1 -1
- package/widgets/BatchAttributeForm.js +1 -1
- package/widgets/Bookmarks.js +1 -1
- package/widgets/BuildingExplorer/BuildingDisciplinesTree/BuildingDisciplinesNode.js +1 -1
- package/widgets/BuildingExplorer/BuildingDisciplinesTree/BuildingDisciplinesTree.js +1 -1
- package/widgets/BuildingExplorer/BuildingLevelPicker/BuildingLevelPicker.js +1 -1
- package/widgets/BuildingExplorer/BuildingLevelPicker/Label.js +1 -1
- package/widgets/BuildingExplorer/BuildingLevelPicker/LevelItem.js +1 -1
- package/widgets/BuildingExplorer/BuildingPhasePicker/BuildingPhasePicker.js +1 -1
- package/widgets/BuildingExplorer.js +1 -1
- package/widgets/CatalogLayerList.js +1 -1
- package/widgets/Compass.js +1 -1
- package/widgets/CoordinateConversion/CoordinateConversionViewModel.js +1 -1
- package/widgets/CoordinateConversion.js +1 -1
- package/widgets/Daylight/support/SliderWithDropdown.js +1 -1
- package/widgets/Daylight.js +1 -1
- package/widgets/DirectLineMeasurement3D.js +1 -1
- package/widgets/DirectionalPad.js +1 -1
- package/widgets/Directions.js +1 -1
- package/widgets/DistanceMeasurement2D/DistanceMeasurement2DTool.js +1 -1
- package/widgets/DistanceMeasurement2D.js +1 -1
- package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
- package/widgets/Editor/EditorViewModel.js +1 -1
- package/widgets/Editor/MergeFeaturesWorkflow.js +1 -1
- package/widgets/Editor/SplitFeatureWorkflow.js +1 -1
- package/widgets/Editor/SplitFeatureWorkflowData.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/UpdateWorkflow.js +1 -1
- package/widgets/Editor/Workflow.js +1 -1
- package/widgets/Editor/components/CreateFeaturesPanelContent.js +1 -1
- package/widgets/Editor/components/FeatureList.js +1 -1
- package/widgets/Editor/components/FooterActions.js +1 -1
- package/widgets/Editor/components/MergeFeaturesList.js +1 -1
- package/widgets/Editor/components/Notices.js +1 -1
- package/widgets/Editor/components/PanelContent.js +1 -1
- package/widgets/Editor/components/PanelToolbar.js +1 -1
- package/widgets/Editor/components/PendingFeatureList.js +1 -1
- package/widgets/Editor/components/Prompt.js +1 -1
- package/widgets/Editor/components/Settings.js +1 -1
- package/widgets/Editor/components/UpdateFeaturePanelContent.js +1 -1
- package/widgets/Editor/components/UploadDetails.js +1 -1
- package/widgets/Editor/components/workflowAdapters/pendingFeatureList/SplitFeatureWorkflowPendingFeatureListAdapter.js +1 -1
- package/widgets/Editor/support/errors.js +1 -1
- package/widgets/Editor.js +1 -1
- package/widgets/ElevationProfile/components/Legend.js +1 -1
- package/widgets/ElevationProfile/components/LegendItem.js +1 -1
- package/widgets/ElevationProfile/components/SettingsButton.js +1 -1
- package/widgets/ElevationProfile/components/Statistics.js +1 -1
- package/widgets/ElevationProfile/support/chartUtils.js +1 -1
- package/widgets/ElevationProfile.js +1 -1
- package/widgets/Expand.js +1 -1
- package/widgets/Feature/FeatureAttachments.js +1 -1
- package/widgets/Feature/FeatureContent.js +1 -1
- package/widgets/Feature/FeatureExpression/FeatureExpressionViewModel.js +1 -1
- package/widgets/Feature/FeatureExpression.js +1 -1
- package/widgets/Feature/FeatureFields.js +1 -1
- package/widgets/Feature/FeatureMedia.js +1 -1
- package/widgets/Feature/FeatureRelationship.js +1 -1
- package/widgets/Feature/FeatureUtilityNetworkAssociationList.js +1 -1
- package/widgets/Feature/FeatureUtilityNetworkAssociations.js +1 -1
- package/widgets/Feature/support/FeatureContentMixin.js +1 -1
- package/widgets/Feature/support/FeatureElementInfo.js +1 -1
- package/widgets/Feature.js +1 -1
- package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/AssociationDetails.js +1 -1
- package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/FeatureFormUtilityNetworkAssociationList.js +1 -1
- package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationItemList.js +1 -1
- package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationSettings.js +1 -1
- package/widgets/FeatureForm/featureFormUtils.js +1 -1
- package/widgets/FeatureForm.js +1 -1
- package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
- package/widgets/FeatureTable/Grid/Grid.js +1 -1
- package/widgets/FeatureTable.js +1 -1
- package/widgets/FeatureTemplates.js +1 -1
- package/widgets/Features/FeaturesDrillIn.js +1 -1
- package/widgets/Features.js +1 -1
- package/widgets/FloorFilter.js +1 -1
- package/widgets/FovOverlay.js +1 -1
- package/widgets/Fullscreen.js +1 -1
- package/widgets/Histogram.js +1 -1
- package/widgets/HistogramRangeSlider.js +1 -1
- package/widgets/Home.js +1 -1
- package/widgets/LayerList/LayerListItem.js +1 -1
- package/widgets/LayerList/ListItemPanel.js +1 -1
- package/widgets/LayerList.js +1 -1
- package/widgets/Legend/LegendViewModel.js +1 -1
- package/widgets/Legend/styles/card/CardView.js +1 -1
- package/widgets/Legend/styles/card/ColorRamp.js +1 -1
- package/widgets/Legend/styles/card/LegendElement.js +1 -1
- package/widgets/Legend/styles/card/SizeRamp.js +1 -1
- package/widgets/Legend/styles/card/UnivariateAboveAndBelowRamp.js +1 -1
- package/widgets/Legend/styles/card/UnivariateColorSizeRamp.js +1 -1
- package/widgets/Legend/styles/classic/ClassicView.js +1 -1
- package/widgets/Legend/styles/classic/ColorRamp.js +1 -1
- package/widgets/Legend/styles/classic/LegendElement.js +1 -1
- package/widgets/Legend/styles/classic/SizeRamp.js +1 -1
- package/widgets/Legend/styles/classic/UnivariateAboveAndBelowRamp.js +1 -1
- package/widgets/Legend/styles/classic/UnivariateColorSizeRamp.js +1 -1
- package/widgets/Legend/styles/support/relationshipUtils.js +1 -1
- package/widgets/Legend/styles/support/sizeRampUtils.js +1 -1
- package/widgets/Legend/styles/support/univariateUtils.js +1 -1
- package/widgets/Legend/styles/support/utils.js +1 -1
- package/widgets/Legend/support/sizeRampUtils.js +1 -1
- package/widgets/Legend/support/styleUtils.js +1 -1
- package/widgets/Legend/support/utils.js +1 -1
- package/widgets/Legend.js +1 -1
- package/widgets/LineOfSight.js +1 -1
- package/widgets/Locate/LocateViewModel.js +1 -1
- package/widgets/Locate.js +1 -1
- package/widgets/Measurement.js +1 -1
- package/widgets/NavigationToggle.js +1 -1
- package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/components/Alert.js +1 -1
- package/widgets/OrientedImageryViewer/components/ImageLocationWidget.js +1 -1
- package/widgets/OrientedImageryViewer/components/ImageMeasurementWidget.js +1 -1
- package/widgets/OrientedImageryViewer/components/ImageOverlays.js +1 -1
- package/widgets/OrientedImageryViewer/components/ImageViewer.js +1 -1
- package/widgets/OrientedImageryViewer/components/NavigationActions.js +1 -1
- package/widgets/OrientedImageryViewer/components/NavigationSettings.js +1 -1
- package/widgets/OrientedImageryViewer/components/NavigationUI360.js +1 -1
- package/widgets/OrientedImageryViewer/components/SequentialNavigationUI.js +1 -1
- package/widgets/OrientedImageryViewer/components/SketchTools.js +1 -1
- package/widgets/OrientedImageryViewer/components/VideoEnhancementTools.js +1 -1
- package/widgets/OrientedImageryViewer/mixins/ImageMeasurementMixin.js +1 -1
- package/widgets/OrientedImageryViewer/mixins/TriangulatedImageMeasurementMixin.js +1 -1
- package/widgets/OrientedImageryViewer.js +1 -1
- package/widgets/PanoramicVideoViewer.js +1 -1
- package/widgets/PanoramicViewer.js +1 -1
- package/widgets/Popup.js +1 -1
- package/widgets/Print/FileLink.js +1 -1
- package/widgets/Print.js +1 -1
- package/widgets/ScaleBar.js +1 -1
- package/widgets/ScaleRangeSlider.js +1 -1
- package/widgets/Search/SearchResultRenderer.js +1 -1
- package/widgets/Search/support/layerSearchUtils.js +1 -1
- package/widgets/Search.js +1 -1
- package/widgets/ShadowCast/components/DiscreteConfigurator.js +1 -1
- package/widgets/ShadowCast/components/DurationConfigurator.js +1 -1
- package/widgets/ShadowCast/components/ShadowTooltipContent.js +1 -1
- package/widgets/ShadowCast/components/ThresholdConfigurator.js +1 -1
- package/widgets/ShadowCast.js +1 -1
- package/widgets/Sketch/SketchViewModel.js +1 -1
- package/widgets/Sketch/support/ResponsiveToolbar/MeasuredContentGroup.js +1 -1
- package/widgets/Sketch/support/ResponsiveToolbar/OverflowGroup.js +1 -1
- package/widgets/Sketch/support/ResponsiveToolbar/ResponsiveToolbar.js +1 -1
- package/widgets/Sketch/support/ResponsiveToolbar/SplitButton.js +1 -1
- package/widgets/Sketch.js +1 -1
- package/widgets/Slice.js +1 -1
- package/widgets/Slider.js +1 -1
- package/widgets/Spinner.js +1 -1
- package/widgets/Swipe.js +1 -1
- package/widgets/TableList/ListItemPanel.js +1 -1
- package/widgets/TableList.js +1 -1
- package/widgets/TimeSlider.js +1 -1
- package/widgets/TimeZoneLabel.js +1 -1
- package/widgets/Track.js +1 -1
- package/widgets/UtilityNetworkAssociations/UtilityNetworkAssociationsLineSymbolPicker.js +1 -1
- package/widgets/UtilityNetworkAssociations/UtilityNetworkAssociationsViewModel.js +1 -1
- package/widgets/UtilityNetworkAssociations.js +1 -1
- package/widgets/UtilityNetworkTrace/UtilityNetworkTraceFeature.js +1 -1
- package/widgets/UtilityNetworkTrace/UtilityNetworkTraceFeaturesDrillIn.js +1 -1
- package/widgets/UtilityNetworkTrace.js +1 -1
- package/widgets/UtilityNetworkValidateTopology/UtilityNetworkValidateTopologyViewModel.js +1 -1
- package/widgets/UtilityNetworkValidateTopology.js +1 -1
- package/widgets/ValuePicker/ValuePickerCollection.js +1 -1
- package/widgets/ValuePicker/ValuePickerCombobox.js +1 -1
- package/widgets/ValuePicker/ValuePickerLabel.js +1 -1
- package/widgets/ValuePicker/ValuePickerSlider.js +1 -1
- package/widgets/ValuePicker.js +1 -1
- package/widgets/VideoPlayer/components/MetadataSection.js +1 -1
- package/widgets/VideoPlayer/components/PlayerActionsGroup.js +1 -1
- package/widgets/VideoPlayer/components/PlayerControlsGroup.js +1 -1
- package/widgets/VideoPlayer/components/SettingsButton.js +1 -1
- package/widgets/VideoPlayer.js +1 -1
- package/widgets/Weather/LabeledSlider.js +1 -1
- package/widgets/Weather.js +1 -1
- package/widgets/Widget.js +1 -1
- package/widgets/Zoom.js +1 -1
- package/widgets/smartMapping/BinaryColorSizeSlider.js +1 -1
- package/widgets/smartMapping/ClassedColorSlider.js +1 -1
- package/widgets/smartMapping/ClassedSizeSlider.js +1 -1
- package/widgets/smartMapping/ColorSizeSlider.js +1 -1
- package/widgets/smartMapping/ColorSlider.js +1 -1
- package/widgets/smartMapping/HeatmapSlider/HeatmapSliderViewModel.js +1 -1
- package/widgets/smartMapping/HeatmapSlider.js +1 -1
- package/widgets/smartMapping/OpacitySlider.js +1 -1
- package/widgets/smartMapping/SizeSlider.js +1 -1
- package/widgets/smartMapping/SmartMappingSliderBase.js +1 -1
- package/widgets/support/ColorPicker.js +1 -1
- package/widgets/support/FilterBuilder.js +1 -1
- package/widgets/support/FilterCondition.js +1 -1
- package/widgets/support/GridControls.js +1 -1
- package/widgets/support/Heading.js +1 -1
- package/widgets/support/ItemList.js +1 -1
- package/widgets/support/LabeledSwitch.js +1 -1
- package/widgets/support/MeasurementWidgetContent.js +1 -1
- package/widgets/support/SelectionList/GroupLayerItem.js +1 -1
- package/widgets/support/SelectionList/LayerItem.js +1 -1
- package/widgets/support/SelectionList/SelectionListViewModel.js +1 -1
- package/widgets/support/SelectionList/selectionListUtils.js +1 -1
- package/widgets/support/SelectionList.js +1 -1
- package/widgets/support/SelectionToolbar.js +1 -1
- package/widgets/support/SketchTooltipControls.js +1 -1
- package/widgets/support/SnappingControls.js +1 -1
- package/widgets/support/TimezonePicker.js +1 -1
- package/widgets/support/UnitSelect.js +1 -1
- package/widgets/support/UtilityNetworkAssociations/UtilityNetworkAssociationList.js +1 -1
- package/widgets/support/UtilityNetworkAssociations/utils/formatPercentAlong.js +1 -1
- package/widgets/support/chartUtilsAm5.js +1 -1
- package/widgets/support/dateUtils.js +1 -1
- package/widgets/support/iconUtils.js +1 -1
- package/widgets/support/widget.js +1 -1
- package/assets/esri/core/workers/chunks/3edffdb0e282ed562ac7.js +0 -1
- package/assets/esri/core/workers/chunks/8fc82fe1fcbcedf35400.js +0 -1
- package/assets/esri/core/workers/chunks/af5fc5d6c1d072a27df1.js +0 -1
- package/assets/esri/core/workers/chunks/bc29c29bfa5be3ebafb1.js +0 -1
- package/assets/esri/core/workers/chunks/c4dfd897bcab20dee43b.js +0 -1
- package/assets/esri/core/workers/chunks/c68935ed44eb0702a6ba.js +0 -1
- package/assets/esri/core/workers/chunks/db54552def7bc6cef9bd.js +0 -1
- package/assets/esri/core/workers/chunks/fd88e07cba5964f80e9e.js +0 -1
- package/views/interactive/editGeometry/CheckpointingEditGeometryOperations.js +0 -5
- package/views/interactive/editGeometry/operations/ReplayableAppendVertex.js +0 -5
- package/widgets/support/jsxFactory.js +0 -5
package/widgets/Track.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as
|
|
5
|
+
import{__decorate as e}from"tslib";import{deprecateWidget as o}from"../core/deprecate.js";import t from"../core/Logger.js";import{property as i}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as r}from"../core/accessorSupport/decorators/subclass.js";import s from"./Widget.js";import{loadCalciteComponents as a}from"./support/componentsUtils.js";import{globalCss as n}from"./support/globalCss.js";import{messageBundle as l,vmEvent as c,tsx as p}from"./support/widget.js";import d from"./Track/TrackViewModel.js";const g={base:"esri-track"};let u=class extends s{constructor(e,i){super(e,i),this.messages=null,this.viewModel=new d,this._toggleTracking=()=>{const e=this.viewModel;e&&"feature-unsupported"!==e.state&&"disabled"!==e.state&&("tracking"!==e.state&&"waiting"!==e.state?this.viewModel.start():this.viewModel.stop())},o(t.getLogger(this),"Track","arcgis-track",{version:"4.32"})}loadDependencies(){return a({button:()=>import("@esri/calcite-components/dist/components/calcite-button"),tooltip:()=>import("@esri/calcite-components/dist/components/calcite-tooltip")})}get geolocationOptions(){return this.viewModel.geolocationOptions}set geolocationOptions(e){this.viewModel.geolocationOptions=e}get goToLocationEnabled(){return this.viewModel.goToLocationEnabled}set goToLocationEnabled(e){this.viewModel.goToLocationEnabled=e}get goToOverride(){return this.viewModel.goToOverride}set goToOverride(e){this.viewModel.goToOverride=e}get graphic(){return this.viewModel.graphic}set graphic(e){this.viewModel.graphic=e}get icon(){return"compass-north-circle"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get rotationEnabled(){return this.viewModel.rotationEnabled}set rotationEnabled(e){this.viewModel.rotationEnabled=e}get scale(){return this.viewModel.scale}set scale(e){this.viewModel.scale=e}get tracking(){return this.viewModel.tracking}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}start(){this.viewModel.start()}stop(){this.viewModel.stop()}render(){const{viewModel:e,messages:o,icon:t}=this,i=e?.state,r="tracking"===i,s=this._localizeError(this.viewModel?.error),a=(r?o?.stopTracking:o?.startTracking)??"",l="feature-unsupported"===i,c=("tracking"===i?"pause":void 0)??t;return p("div",{class:this.classes(g.base,n.widget)},!l&&p("calcite-button",{class:n.widgetButton,disabled:"disabled"===i,iconStart:c,kind:"neutral",label:a,loading:"waiting"===i,onclick:this._toggleTracking,title:a}),s?p("calcite-tooltip",{open:!0,overlayPositioning:"fixed",referenceElement:this.container},s):null)}_localizeError(e){return e instanceof GeolocationPositionError?e.code===GeolocationPositionError.PERMISSION_DENIED?this.messages?.permissionError:e.code===GeolocationPositionError.TIMEOUT?this.messages?.timeoutError:this.messages?.positionUnavailable:e instanceof Error?e.message:void 0}};e([i()],u.prototype,"geolocationOptions",null),e([i()],u.prototype,"goToLocationEnabled",null),e([i()],u.prototype,"goToOverride",null),e([i()],u.prototype,"graphic",null),e([i()],u.prototype,"icon",null),e([i()],u.prototype,"label",null),e([i(),l("esri/widgets/Track/t9n/Track")],u.prototype,"messages",void 0),e([i()],u.prototype,"rotationEnabled",null),e([i()],u.prototype,"scale",null),e([i({readOnly:!0})],u.prototype,"tracking",null),e([i()],u.prototype,"view",null),e([i({type:d}),c(["track","track-error"])],u.prototype,"viewModel",void 0),u=e([r("esri.widgets.Track")],u);const m=u;export{m as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import{getAssetUrl as t}from"../../assets.js";import o from"../../Color.js";import{property as r}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as
|
|
5
|
+
import{__decorate as e}from"tslib";import{getAssetUrl as t}from"../../assets.js";import o from"../../Color.js";import{property as r}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as i}from"../../core/accessorSupport/decorators/subclass.js";import s from"../../symbols/LineSymbolMarker.js";import n from"../../symbols/SimpleLineSymbol.js";import l from"../Widget.js";import{loadCalciteComponents as c}from"../support/componentsUtils.js";import{messageBundle as a,tsx as d}from"../support/widget.js";import p from"./VisibleElementsSettingsPane.js";const m="esri-un-associations",u={divControlsSymbolPicker:`${m}__div-controls-symbol-picker`,dropdown:`${m}__dropdown`,dropdownItemLineCap:`${m}__dropdown-item-line-cap`,dropdownItemLinePattern:`${m}__dropdown-item-line-pattern`,dropdownSelectedItemLineCap:`${m}__dropdown-selected-item-line-cap`,dropdownSelectedItemLinePattern:`${m}__dropdown-selected-item-line-pattern`,dropdownTrigger:`${m}__dropdown-trigger`,labelAndToggle:`${m}__label-and-toggle`};let w=class extends l{constructor(e,t){super(e,t),this._lineCapTypes=["butt","round","square"],this._lineStyleTypes=["solid","dash","dash-dot","dot","long-dash","long-dash-dot","long-dash-dot-dot","short-dash","short-dash-dot","short-dash-dot-dot","short-dot"],this.lineSymbol=new n,this.messages=null,this.showArrows=!1,this.visibleElements=new p,this._afterComponentCreate=this._afterComponentCreate.bind(this)}render(){const{messages:{input:{lineCap:e,lineColor:t,lineStyle:o,lineWidth:r,showArrows:i}},visibleElements:s}=this,n=this.lineSymbol;return d("div",{class:u.divControlsSymbolPicker},s.arrowsToggle?this._renderToggle(i,this.showArrows,n,"marker"):void 0,s.capSelect?this._renderLineStylePicker(e,this._lineCapTypes,n,"cap"):void 0,s.colorPicker&&n.color?this._renderColorPicker(t,n.color.toHex(),n,"color"):void 0,s.stylePicker?this._renderLineStylePicker(o,this._lineStyleTypes,n,"style"):void 0,s.widthInput?this._renderNumberInput(r,n.width.toString(),n,"width"):void 0)}loadDependencies(){return c({dropdown:()=>import("@esri/calcite-components/dist/components/calcite-dropdown"),"dropdown-group":()=>import("@esri/calcite-components/dist/components/calcite-dropdown-group"),"dropdown-item":()=>import("@esri/calcite-components/dist/components/calcite-dropdown-item"),input:()=>import("@esri/calcite-components/dist/components/calcite-input"),"input-number":()=>import("@esri/calcite-components/dist/components/calcite-input-number"),label:()=>import("@esri/calcite-components/dist/components/calcite-label"),switch:()=>import("@esri/calcite-components/dist/components/calcite-switch")})}_afterComponentCreate(e){"value"in e&&null!=e.value&&"setNumberValue"in e&&e.setNumberValue({committing:!1,value:e.value,origin:"direct"})}_renderColorPicker(e,t,r,i){return d("calcite-label",{scale:"s"},e,d("calcite-input",{scale:"s",type:"color",value:t,onCalciteInputInput:e=>{const t=e.currentTarget;r.set(i,new o(t.value))}}))}_renderLineStylePicker(e,o,r,i){const s="style"===i,n="esri/widgets/UtilityNetworkAssociations/assets/img";function l(e,o){return d("calcite-dropdown-item",{label:e,selected:r[o]===e},d("div",{class:s?u.dropdownItemLinePattern:u.dropdownItemLineCap,style:`background-image:url(${t(`${n}/line-${s?"patterns":"caps"}/${e}.png`)})`}))}return d("calcite-label",{scale:"s"},e,d("calcite-dropdown",{class:u.dropdown,onCalciteDropdownSelect:e=>{const t=e.currentTarget;r.set(i,t.selectedItems[0].label)}},d("div",{class:u.dropdownTrigger,role:"button",slot:"trigger"},d("div",{class:s?u.dropdownSelectedItemLinePattern:u.dropdownSelectedItemLineCap,style:`background-image:url(${t(`${n}/line-${s?"patterns":"caps"}/${r[i]}.png`)})`})),d("calcite-dropdown-group",null,o.map(e=>l(e,i)))))}_renderNumberInput(e,t,o,r){return d("calcite-label",{scale:"s"},e,d("calcite-input-number",{afterCreate:this._afterComponentCreate,max:10,min:1,scale:"s",step:1,type:"number",value:t,onCalciteInputNumberChange:e=>{const t=e.currentTarget;o.set(r,t.value)}}))}_renderToggle(e,t,o,r){return d("div",{class:u.labelAndToggle},d("calcite-label",{scale:"s"},e),d("calcite-switch",{bind:this,checked:t,onCalciteSwitchChange:e=>{e.currentTarget.checked?o.set(r,new s({style:"arrow"})):o.set(r,null)}}))}};e([r()],w.prototype,"lineSymbol",void 0),e([r(),a("esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations")],w.prototype,"messages",void 0),e([r()],w.prototype,"showArrows",void 0),e([r({type:p,nonNullable:!0})],w.prototype,"visibleElements",void 0),w=e([i("esri.widgets.UtilityNetworkAssociations.UtilityNetworkAssociationsLineSymbolPicker")],w);const g=w;export{g as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as t}from"tslib";import i from"../../Graphic.js";import"../../intl.js";import
|
|
5
|
+
import{__decorate as t}from"tslib";import i from"../../Graphic.js";import{onLocaleChange as s,fetchMessageBundle as e}from"../../intl.js";import o from"../../core/Accessor.js";import r from"../../core/Collection.js";import n from"../../core/Error.js";import a from"../../core/Logger.js";import{watch as c}from"../../core/reactiveUtils.js";import{property as l}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{subclass as h}from"../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as y}from"../../core/support/UpdatingHandles.js";import m from"../../layers/GraphicsLayer.js";import u from"../../symbols/LineSymbolMarker.js";import p from"../../symbols/SimpleLineSymbol.js";import{addUniqueLayer as A}from"../../views/draw/support/layerUtils.js";const w={noAssociationTypeSpecified:-2147208504};let d=class extends o{constructor(t){super(t),this._internalGraphicsLayerConnectivity=this._createInternalGraphicsLayer("Connectivity Associations (Internal)"),this._internalGraphicsLayerStructuralAttachment=this._createInternalGraphicsLayer("Structural Attachment Associations (Internal)"),this._initialValidationsFinished=!1,this._updatingHandles=new y,this.autoRefreshAssociations=!1,this.connectivityAssociationsLineSymbol=new p({style:"short-dash",width:2,color:[190,159,159,1]}),this.executionError="",this.loadErrors=new r,this.maxAllowableAssociations=250,this.showAssociationsEnabled=!1,this.showArrowsConnectivity=!1,this.showArrowsStructuralAttachment=!1,this.structuralAttachmentAssociationsLineSymbol=new p({style:"short-dash",width:2,color:[159,190,159,1]})}initialize(){const t=async()=>{this.messages||(this.messages=await e("esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations"))};t().then(()=>{this.view||(this.view=null),this.utilityNetwork||(this.utilityNetwork=null),this.addHandles([c(()=>[this.view,this.utilityNetwork],async()=>{const{loadErrors:t,messages:{info:{noUtilityNetwork:i,noView:s}}}=this;this._initialValidationsFinished=!1,t.removeAll();let e=!1,o=!1;this.removeAssociations(),"2d"===this.view?.type?(A(this.view,this._internalGraphicsLayerConnectivity),A(this.view,this._internalGraphicsLayerStructuralAttachment),e=!0):(this.loadErrors.push(s),a.getLogger(this).error(new n("utilityNetworkAssociations:missing-property",s))),"utility"===this.utilityNetwork?.type?o=!0:(this.loadErrors.push(i),a.getLogger(this).error(new n("utilityNetworkAssociations:missing-property",i))),e&&o&&this.showAssociationsEnabled&&await this.showAssociations(),this._internalGraphicsLayerConnectivity.visible=this.includeConnectivityAssociations,this._internalGraphicsLayerStructuralAttachment.visible=this.includeStructuralAttachmentAssociations,this._initialValidationsFinished=!0},{initial:!0}),c(()=>[this.view?.stationary,this.showAssociationsEnabled,this.maxAllowableAssociations],async()=>{this.view?.stationary&&this.showAssociationsEnabled&&(this.includeConnectivityAssociations||this.includeStructuralAttachmentAssociations)&&await this.showAssociations()}),c(()=>[this.showArrowsConnectivity],()=>{const t=this.connectivityAssociationsLineSymbol.clone();t.marker=null,this.showArrowsConnectivity&&(t.marker=new u({color:this.connectivityAssociationsLineSymbol.color,placement:"end",style:"arrow"}));for(const i of this._internalGraphicsLayerConnectivity.graphics)i.symbol=t}),c(()=>[this.showArrowsStructuralAttachment],()=>{const t=this.structuralAttachmentAssociationsLineSymbol.clone();t.marker=null,this.showArrowsStructuralAttachment&&(t.marker=new u({color:this.structuralAttachmentAssociationsLineSymbol.color,placement:"end",style:"arrow"}));for(const i of this._internalGraphicsLayerStructuralAttachment.graphics)i.symbol=t}),c(()=>{const{cap:t,color:i,style:s,width:e,marker:o}=this.connectivityAssociationsLineSymbol;return[t,i,s,e,o]},()=>{const t=this.connectivityAssociationsLineSymbol.clone();for(const i of this._internalGraphicsLayerConnectivity.graphics)i.symbol=t;this.showArrowsConnectivity=!1,t.marker=null,this.connectivityAssociationsLineSymbol.marker&&(this.showArrowsConnectivity=!0,t.marker=new u({color:this.connectivityAssociationsLineSymbol.color,placement:"end",style:"arrow"}))}),c(()=>{const{cap:t,color:i,style:s,width:e,marker:o}=this.structuralAttachmentAssociationsLineSymbol;return[t,i,s,e,o]},()=>{const t=this.structuralAttachmentAssociationsLineSymbol.clone();for(const i of this._internalGraphicsLayerStructuralAttachment.graphics)i.symbol=t;this.showArrowsStructuralAttachment=!1,t.marker=null,this.structuralAttachmentAssociationsLineSymbol.marker&&(this.showArrowsStructuralAttachment=!0,t.marker=new u({color:this.structuralAttachmentAssociationsLineSymbol.color,placement:"end",style:"arrow"}))}),s(t)])})}destroy(){this._updatingHandles.destroy(),this.view=null,this._removeInternalGraphicsLayers()}set includeConnectivityAssociations(t){this._set("includeConnectivityAssociations",t),this._internalGraphicsLayerConnectivity.visible=t}set includeStructuralAttachmentAssociations(t){this._set("includeStructuralAttachmentAssociations",t),this._internalGraphicsLayerStructuralAttachment.visible=t}get state(){return this.loadErrors.length?"disabled":this._updatingHandles.updating?"executing":""!==this.executionError?"warning":this._initialValidationsFinished?"ready":"loading"}get utilityNetwork(){return this._get("utilityNetwork")}set utilityNetwork(t){this._get("utilityNetwork")!==t&&this._set("utilityNetwork",t)}get view(){return this._get("view")}set view(t){this._get("view")!==t&&this._set("view",t)}removeAssociations(){this._internalGraphicsLayerConnectivity.removeAll(),this._internalGraphicsLayerStructuralAttachment.removeAll()}async showAssociations(){const{messages:{info:{maxAllowableAssociationsExceeded:t,noAssociationsFound:s,noAssociationTypeSpecified:e}},utilityNetwork:o}=this;this._set("executionError","");const r={extent:this.view?.extent,gdbVersion:this.utilityNetwork?.gdbVersion,maxGeometryCount:this.maxAllowableAssociations,moment:this.utilityNetwork?.historicMoment,outSpatialReference:this.view?.spatialReference.clone(),returnConnectivityAssociations:this.includeConnectivityAssociations,returnAttachmentAssociations:this.includeStructuralAttachmentAssociations};this._updatingHandles.addPromise(o?.synthesizeAssociationGeometries(r).then(e=>{let o=[],r=[];return e?.maxGeometryCountExceeded?(this.removeAssociations(),void this._set("executionError",t)):0===e?.associations.length?(this.removeAssociations(),void this._set("executionError",s)):void(e&&(o=e?.associations.filter(({associationType:t})=>t.toLowerCase().includes("connectivity")).map(t=>(this.connectivityAssociationsLineSymbol.marker=null,this.showArrowsConnectivity&&(this.connectivityAssociationsLineSymbol.marker=new u({color:this.connectivityAssociationsLineSymbol.color,placement:"end",style:"arrow"})),new i({geometry:t.geometry.clone(),symbol:this.connectivityAssociationsLineSymbol}))),r=e.associations.filter(({associationType:t})=>"attachment"===t).map(t=>(this.structuralAttachmentAssociationsLineSymbol.marker=null,this.showArrowsStructuralAttachment&&(this.structuralAttachmentAssociationsLineSymbol.marker=new u({color:this.structuralAttachmentAssociationsLineSymbol.color,placement:"end",style:"arrow"})),new i({geometry:t.geometry.clone(),symbol:this.structuralAttachmentAssociationsLineSymbol}))),this._internalGraphicsLayerConnectivity.removeAll(),o.length>0&&this._internalGraphicsLayerConnectivity.addMany(o),this._internalGraphicsLayerStructuralAttachment.removeAll(),r.length>0&&this._internalGraphicsLayerStructuralAttachment.addMany(r)))},t=>{let i="Error: "+t;if(t instanceof n&&t.details?.raw)if(t.details.raw.extendedCode===w.noAssociationTypeSpecified)i=e;else i=t.details.message;this._set("executionError",i)}))}_createInternalGraphicsLayer(t){return new m({listMode:"hide",internal:!0,title:t})}_removeInternalGraphicsLayers(){this._internalGraphicsLayerConnectivity&&this._internalGraphicsLayerStructuralAttachment&&this.view?.map&&(this.view.map.remove(this._internalGraphicsLayerConnectivity),this.view.map.remove(this._internalGraphicsLayerStructuralAttachment))}};t([l()],d.prototype,"_initialValidationsFinished",void 0),t([l()],d.prototype,"autoRefreshAssociations",void 0),t([l({type:p,nonNullable:!0})],d.prototype,"connectivityAssociationsLineSymbol",void 0),t([l({readOnly:!0})],d.prototype,"executionError",void 0),t([l({type:Boolean,value:!0})],d.prototype,"includeConnectivityAssociations",null),t([l({type:Boolean,value:!0})],d.prototype,"includeStructuralAttachmentAssociations",null),t([l()],d.prototype,"loadErrors",void 0),t([l()],d.prototype,"maxAllowableAssociations",void 0),t([l()],d.prototype,"messages",void 0),t([l()],d.prototype,"showAssociationsEnabled",void 0),t([l()],d.prototype,"showArrowsConnectivity",void 0),t([l()],d.prototype,"showArrowsStructuralAttachment",void 0),t([l({readOnly:!0})],d.prototype,"state",null),t([l({type:p,nonNullable:!0})],d.prototype,"structuralAttachmentAssociationsLineSymbol",void 0),t([l()],d.prototype,"utilityNetwork",null),t([l()],d.prototype,"view",null),d=t([h("esri.widgets.UtilityNetworkAssociations.UtilityNetworkAssociationsViewModel")],d);const v=d;export{v as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as t}from"tslib";import{watch as i,on as s,initial as e}from"../core/reactiveUtils.js";import{property as o}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{subclass as n}from"../core/accessorSupport/decorators/subclass.js";import l from"./Widget.js";import{loadCalciteComponents as a}from"./support/componentsUtils.js";import"./support/widgetUtils.js";import{messageBundle as c}from"./support/decorators/messageBundle.js";import{tsx as r}from"./support/jsxFactory.js";import"@arcgis/toolkit/dom";import d from"./UtilityNetworkAssociations/UtilityNetworkAssociationsLineSymbolPicker.js";import h from"./UtilityNetworkAssociations/UtilityNetworkAssociationsViewModel.js";import m from"./UtilityNetworkAssociations/VisibleElements.js";const A="esri-un-associations",u={action:`${A}__action`,actionRefresh:`${A}__action-refresh`,blockContent:`${A}__block-content`,blockSectionSettings:`${A}__block-section-settings`,combobox:`${A}__combobox`,comboboxItem:`${A}__combobox-item`,divControlsMain:`${A}__div-controls-main`,label:`${A}__label`,labelAndCombobox:`${A}__label-and-combobox`,labelAndSlider:`${A}__label-and-slider`,labelAndToggle:`${A}__label-and-toggle`,panel:`${A}__panel`,slider:`${A}__slider`,statusIconContainer:`${A}__status-icon-container`,statusIconWarning:`${A}__status-icon-warning`,switch:`${A}__switch`,switchContainer:`${A}__switch-container`,widgetContainer:`${A}__widget-container`};let w=class extends l{constructor(t,i){super(t,i),this._autoRefreshAssociations=!0,this._associationsOptionsEnabled=!1,this._maxAllowableAssociationsSliderMax=1e3,this._maxAllowableAssociationsSliderMin=250,this._maxAllowableAssociationsSliderStep=250,this.messages=null,this.messagesCommon=null,this.viewModel=new h,this.visibleElements=new m}initialize(){this.addHandles([i(()=>[this.view?.stationary,this.showAssociationsEnabled,this.includeConnectivityAssociations,this.includeStructuralAttachmentAssociations,this.maxAllowableAssociations],()=>{!0===this.autoRefreshAssociations&&(!0===this.showAssociationsEnabled?this.viewModel.showAssociations():this.viewModel.removeAssociations())}),i(()=>this.view?.map?.utilityNetworks,t=>{t?.items.forEach(async(t,i)=>{t.loaded||await t.load(),0===i&&(this.utilityNetwork=t)})},e),s(()=>this.view?.map?.utilityNetworks,"change",t=>{const i=t.target;t.added.forEach(async t=>{t.loaded||await t.load()}),t.removed.some(t=>t.layerUrl===this.utilityNetwork?.layerUrl)&&(this.utilityNetwork=null),this.utilityNetwork=i.length?i.getItemAt(0):null})])}get autoRefreshAssociations(){return this._autoRefreshAssociations}set autoRefreshAssociations(t){this._autoRefreshAssociations=t}get connectivityAssociationsLineSymbol(){return this.viewModel.connectivityAssociationsLineSymbol}set connectivityAssociationsLineSymbol(t){this.viewModel.connectivityAssociationsLineSymbol=t}get icon(){return"view-associations"}set icon(t){this._overrideIfSome("icon",t)}get includeConnectivityAssociations(){return this.viewModel.includeConnectivityAssociations}set includeConnectivityAssociations(t){this.viewModel.includeConnectivityAssociations=t}get includeStructuralAttachmentAssociations(){return this.viewModel.includeStructuralAttachmentAssociations}set includeStructuralAttachmentAssociations(t){this.viewModel.includeStructuralAttachmentAssociations=t}get label(){return this.messages?.widgetLabel??""}set label(t){this._overrideIfSome("label",t)}get maxAllowableAssociations(){return this.viewModel.maxAllowableAssociations}set maxAllowableAssociations(t){this.viewModel.maxAllowableAssociations=t}get maxAllowableAssociationsSliderMax(){return this._maxAllowableAssociationsSliderMax}set maxAllowableAssociationsSliderMax(t){t<=this.maxAllowableAssociationsSliderMin||(this._maxAllowableAssociationsSliderMax=t)}get maxAllowableAssociationsSliderMin(){return this._maxAllowableAssociationsSliderMin}set maxAllowableAssociationsSliderMin(t){t<0||t>=this.maxAllowableAssociationsSliderMax||(this._maxAllowableAssociationsSliderMin=t)}get maxAllowableAssociationsSliderStep(){return this._maxAllowableAssociationsSliderStep}set maxAllowableAssociationsSliderStep(t){this._maxAllowableAssociationsSliderStep=t}get showArrowsConnectivity(){return this.viewModel.showArrowsConnectivity}set showArrowsConnectivity(t){this.viewModel.showArrowsConnectivity=t}get showArrowsStructuralAttachment(){return this.viewModel.showArrowsStructuralAttachment}set showArrowsStructuralAttachment(t){this.viewModel.showArrowsStructuralAttachment=t}get showAssociationsEnabled(){return this.viewModel.showAssociationsEnabled}set showAssociationsEnabled(t){this.viewModel.showAssociationsEnabled=t}get structuralAttachmentAssociationsLineSymbol(){return this.viewModel.structuralAttachmentAssociationsLineSymbol}set structuralAttachmentAssociationsLineSymbol(t){this.viewModel.structuralAttachmentAssociationsLineSymbol=t}get utilityNetwork(){return this.viewModel.utilityNetwork}set utilityNetwork(t){this.viewModel.utilityNetwork=t}get view(){return this.viewModel.view}set view(t){this.viewModel.view=t}render(){const{label:t}=this;return r("div",{class:u.widgetContainer},r("calcite-block",{class:u.blockContent,collapsible:!0,heading:t},this._renderStatusIcon(),this.autoRefreshAssociations?this._renderShowAssociationsSwitch():this._renderRefreshAssociationsAction(),this._renderContent()))}loadDependencies(){return a({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),block:()=>import("@esri/calcite-components/dist/components/calcite-block"),"block-section":()=>import("@esri/calcite-components/dist/components/calcite-block-section"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),combobox:()=>import("@esri/calcite-components/dist/components/calcite-combobox"),"combobox-item":()=>import("@esri/calcite-components/dist/components/calcite-combobox-item"),label:()=>import("@esri/calcite-components/dist/components/calcite-label"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice"),panel:()=>import("@esri/calcite-components/dist/components/calcite-panel"),slider:()=>import("@esri/calcite-components/dist/components/calcite-slider"),switch:()=>import("@esri/calcite-components/dist/components/calcite-switch"),tooltip:()=>import("@esri/calcite-components/dist/components/calcite-tooltip")})}_connectivityAssociationsSwitchChange(t){this.includeConnectivityAssociations=t.currentTarget.checked}_getLoadErrorMessagesAsNotices(t,i){return r("calcite-notice",{closable:!1,key:`error-notice-${i}`,kind:"warning",open:!0,scale:"s"},r("div",{slot:"message"},t))}_maxAllowableAssociationsSliderChange(t){this.maxAllowableAssociations=Number(t.currentTarget.value)}_refreshAssociations(){const{viewModel:t,viewModel:{state:i}}=this;"ready"!==i&&"warning"!==i||t.showAssociations()}_renderConnectivityAssociationsSettings(){const{messages:{input:{enableConnectivity:t}},visibleElements:{connectivityAssociationsSettings:i}}=this;if(i)return r("calcite-block-section",{class:u.blockSectionSettings,text:t},r(d,{id:`${this.id}-symbol-picker-connectivity`,lineSymbol:this.connectivityAssociationsLineSymbol,showArrows:this.showArrowsConnectivity,visibleElements:i}))}_renderConnectivityAssociationsToggle(){const{messages:{input:{enableConnectivity:t}}}=this;return r("div",{class:u.labelAndToggle,key:"connectivityAssociationsToggleDiv"},r("calcite-label",{class:u.label},t),r("calcite-switch",{bind:this,checked:this.includeConnectivityAssociations,disabled:!this._associationsOptionsEnabled&&this.autoRefreshAssociations,onCalciteSwitchChange:this._connectivityAssociationsSwitchChange}))}_renderComboboxItem({heading:t,value:i,selected:s}){return r("calcite-combobox-item",{class:u.comboboxItem,heading:t,selected:s,textLabel:t,value:i})}_renderContent(){const{viewModel:{loadErrors:t,state:i}}=this;return"disabled"===i?r("div",{class:u.divControlsMain,key:"loadErrorsDiv"},t.items.map(this._getLoadErrorMessagesAsNotices)):r("calcite-panel",{class:u.panel,disabled:"loading"===i},r("div",{class:u.divControlsMain},this._renderConnectivityAssociationsToggle(),this._renderStructuralAttachmentAssociationsToggle(),this._renderSettingsPane()))}_renderLoadingAction(t,i,s){return r("div",{key:t,slot:"control"},r("calcite-action",{id:i,loading:!0,text:s}),r("calcite-tooltip",{overlayPositioning:"fixed",referenceElement:i},r("span",null,s)))}_renderMaxAllowableAssociationsSlider(){const{messages:{input:{maxAllowableAssociations:t}},visibleElements:{maxAllowableAssociationsSlider:i}}=this;if(i)return r("div",{class:u.labelAndSlider,key:"maxAllowableAssociationsSliderDiv"},r("calcite-label",{class:u.label},t),r("calcite-slider",{bind:this,class:u.slider,labelTicks:!0,max:this.maxAllowableAssociationsSliderMax,min:this.maxAllowableAssociationsSliderMin,scale:"s",snap:!0,step:this.maxAllowableAssociationsSliderStep,ticks:this.maxAllowableAssociationsSliderStep,value:this.maxAllowableAssociations,onCalciteSliderChange:this._maxAllowableAssociationsSliderChange}))}_renderRefreshAssociationsAction(){const{messages:{input:{refreshAssociations:t}},messagesCommon:{loading:i},viewModel:{state:s}}=this,e=`${this.id}-refresh-action`;if("disabled"!==s)return r("div",{class:u.actionRefresh,slot:"control"},r("calcite-action",{bind:this,class:u.action,icon:"refresh-f",id:e,loading:"loading"===s,onclick:this._refreshAssociations,text:t}),r("calcite-tooltip",{overlayPositioning:"fixed",referenceElement:e},r("span",null,"loading"===s?i:t)))}_renderSettingsPane(){const{messagesCommon:{settings:t},visibleElements:{maxAllowableAssociationsSlider:i,connectivityAssociationsSettings:s,structuralAttachmentAssociationsSettings:e}}=this,o=(this.view?.map).utilityNetworks?.items;if(1!==o?.length||i||s||e)return r("calcite-block",{class:u.blockContent,collapsible:!0,heading:t},r("div",{class:u.divControlsMain},this._renderUtilityNetworkSettings(),this._renderMaxAllowableAssociationsSlider()),this._renderConnectivityAssociationsSettings(),this._renderStructuralAttachmentAssociationsSettings())}_renderShowAssociationsSwitch(){const{messages:{input:{enableAssociations:t}},messagesCommon:{loading:i},viewModel:{state:s}}=this,e=`${this.id}-show-associations-switch`;if("disabled"!==s)return"loading"===s?this._renderLoadingAction("loadingActionDiv",`${this.id}-loading-action`,i):r("div",{class:u.switchContainer,key:"switchDiv",slot:"control"},r("calcite-switch",{bind:this,checked:this.showAssociationsEnabled,class:u.switch,id:e,onCalciteSwitchChange:this._showAssociationsSwitchChange}),r("calcite-tooltip",{overlayPositioning:"fixed",referenceElement:e},r("span",null,t)))}_renderStatusIcon(){const{messagesCommon:{executing:t},viewModel:{executionError:i,state:s}}=this;switch(s){case"disabled":return this._renderWarningIcon("statusDiv",`${this.id}-disabled-icon`,null);case"warning":return this._renderWarningIcon("statusDiv",`${this.id}-warning-icon`,i);case"executing":return this._renderLoadingAction("executingActionDiv",`${this.id}-executing-action`,t);default:return}}_renderStructuralAttachmentAssociationsSettings(){const{messages:{input:{enableStructuralAttachment:t}},visibleElements:{structuralAttachmentAssociationsSettings:i}}=this;if(i)return r("calcite-block-section",{class:u.blockSectionSettings,text:t},r(d,{id:`${this.id}-symbol-picker-structural-attachment`,lineSymbol:this.structuralAttachmentAssociationsLineSymbol,showArrows:this.showArrowsStructuralAttachment,visibleElements:i}))}_renderStructuralAttachmentAssociationsToggle(){const{messages:{input:{enableStructuralAttachment:t}}}=this;return r("div",{class:u.labelAndToggle,key:"structuralAttachmentAssociationsToggleDiv"},r("calcite-label",{class:u.label},t),r("calcite-switch",{bind:this,checked:this.includeStructuralAttachmentAssociations,disabled:!this._associationsOptionsEnabled&&this.autoRefreshAssociations,onCalciteSwitchChange:this._structuralAttAssociationsSwitchChange}))}_renderUtilityNetworkSettings(){const{messages:{input:{utilityNetwork:t}}}=this,i=(this.view?.map).utilityNetworks?.items;if(1===i?.length)return null;const s=i?.map(t=>{const i=t.title,s=t.layerUrl,e=t.layerUrl===this.utilityNetwork?.layerUrl;return this._renderComboboxItem({heading:i,value:s,selected:e})});return r("div",{class:u.labelAndCombobox,key:"utilityNetworkComboboxDiv"},r("calcite-label",{class:u.label},t),r("calcite-combobox",{class:u.combobox,clearDisabled:!0,label:"",maxItems:3,overlayPositioning:"fixed",selectionMode:"single-persist",onCalciteComboboxChange:t=>{const s=i?.find(i=>i.layerUrl===t.currentTarget.value);this.utilityNetwork=s}},s))}_showAssociationsSwitchChange({currentTarget:t}){const{viewModel:i}=this;this.showAssociationsEnabled=t.checked,this._associationsOptionsEnabled=t.checked,this.showAssociationsEnabled||i.removeAssociations()}_structuralAttAssociationsSwitchChange(t){this.includeStructuralAttachmentAssociations=t.currentTarget.checked}_renderWarningIcon(t,i,s){return s?r("div",{class:u.statusIconContainer,key:t,slot:"control"},r("calcite-icon",{class:u.statusIconWarning,icon:"exclamation-mark-triangle",id:i,scale:"s"}),r("calcite-tooltip",{overlayPositioning:"fixed",referenceElement:i},r("span",null,s))):r("div",{class:u.statusIconContainer,key:t,slot:"control"},r("calcite-icon",{class:u.statusIconWarning,icon:"exclamation-mark-triangle",id:i,scale:"s"}))}};t([o()],w.prototype,"autoRefreshAssociations",null),t([o()],w.prototype,"connectivityAssociationsLineSymbol",null),t([o()],w.prototype,"icon",null),t([o()],w.prototype,"includeConnectivityAssociations",null),t([o()],w.prototype,"includeStructuralAttachmentAssociations",null),t([o()],w.prototype,"label",null),t([o()],w.prototype,"maxAllowableAssociations",null),t([o()],w.prototype,"maxAllowableAssociationsSliderMax",null),t([o()],w.prototype,"maxAllowableAssociationsSliderMin",null),t([o()],w.prototype,"maxAllowableAssociationsSliderStep",null),t([o(),c("esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations")],w.prototype,"messages",void 0),t([o(),c("esri/t9n/common")],w.prototype,"messagesCommon",void 0),t([o()],w.prototype,"showArrowsConnectivity",null),t([o()],w.prototype,"showArrowsStructuralAttachment",null),t([o()],w.prototype,"showAssociationsEnabled",null),t([o()],w.prototype,"structuralAttachmentAssociationsLineSymbol",null),t([o()],w.prototype,"utilityNetwork",null),t([o()],w.prototype,"view",null),t([o({type:h})],w.prototype,"viewModel",void 0),t([o({type:m,nonNullable:!0})],w.prototype,"visibleElements",void 0),w=t([n("esri.widgets.UtilityNetworkAssociations")],w);const b=w;export{b as default};
|
|
5
|
+
import{__decorate as t}from"tslib";import{watch as i,on as s,initial as e}from"../core/reactiveUtils.js";import{property as o}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{subclass as n}from"../core/accessorSupport/decorators/subclass.js";import l from"./Widget.js";import{loadCalciteComponents as a}from"./support/componentsUtils.js";import{messageBundle as c,tsx as r}from"./support/widget.js";import d from"./UtilityNetworkAssociations/UtilityNetworkAssociationsLineSymbolPicker.js";import h from"./UtilityNetworkAssociations/UtilityNetworkAssociationsViewModel.js";import m from"./UtilityNetworkAssociations/VisibleElements.js";const A="esri-un-associations",u={action:`${A}__action`,actionRefresh:`${A}__action-refresh`,blockContent:`${A}__block-content`,blockSectionSettings:`${A}__block-section-settings`,combobox:`${A}__combobox`,comboboxItem:`${A}__combobox-item`,divControlsMain:`${A}__div-controls-main`,label:`${A}__label`,labelAndCombobox:`${A}__label-and-combobox`,labelAndSlider:`${A}__label-and-slider`,labelAndToggle:`${A}__label-and-toggle`,panel:`${A}__panel`,slider:`${A}__slider`,statusIconContainer:`${A}__status-icon-container`,statusIconWarning:`${A}__status-icon-warning`,switch:`${A}__switch`,switchContainer:`${A}__switch-container`,widgetContainer:`${A}__widget-container`};let w=class extends l{constructor(t,i){super(t,i),this._autoRefreshAssociations=!0,this._associationsOptionsEnabled=!1,this._maxAllowableAssociationsSliderMax=1e3,this._maxAllowableAssociationsSliderMin=250,this._maxAllowableAssociationsSliderStep=250,this.messages=null,this.messagesCommon=null,this.viewModel=new h,this.visibleElements=new m}initialize(){this.addHandles([i(()=>[this.view?.stationary,this.showAssociationsEnabled,this.includeConnectivityAssociations,this.includeStructuralAttachmentAssociations,this.maxAllowableAssociations],()=>{!0===this.autoRefreshAssociations&&(!0===this.showAssociationsEnabled?this.viewModel.showAssociations():this.viewModel.removeAssociations())}),i(()=>this.view?.map?.utilityNetworks,t=>{t?.items.forEach(async(t,i)=>{t.loaded||await t.load(),0===i&&(this.utilityNetwork=t)})},e),s(()=>this.view?.map?.utilityNetworks,"change",t=>{const i=t.target;t.added.forEach(async t=>{t.loaded||await t.load()}),t.removed.some(t=>t.layerUrl===this.utilityNetwork?.layerUrl)&&(this.utilityNetwork=null),this.utilityNetwork=i.length?i.getItemAt(0):null})])}get autoRefreshAssociations(){return this._autoRefreshAssociations}set autoRefreshAssociations(t){this._autoRefreshAssociations=t}get connectivityAssociationsLineSymbol(){return this.viewModel.connectivityAssociationsLineSymbol}set connectivityAssociationsLineSymbol(t){this.viewModel.connectivityAssociationsLineSymbol=t}get icon(){return"view-associations"}set icon(t){this._overrideIfSome("icon",t)}get includeConnectivityAssociations(){return this.viewModel.includeConnectivityAssociations}set includeConnectivityAssociations(t){this.viewModel.includeConnectivityAssociations=t}get includeStructuralAttachmentAssociations(){return this.viewModel.includeStructuralAttachmentAssociations}set includeStructuralAttachmentAssociations(t){this.viewModel.includeStructuralAttachmentAssociations=t}get label(){return this.messages?.widgetLabel??""}set label(t){this._overrideIfSome("label",t)}get maxAllowableAssociations(){return this.viewModel.maxAllowableAssociations}set maxAllowableAssociations(t){this.viewModel.maxAllowableAssociations=t}get maxAllowableAssociationsSliderMax(){return this._maxAllowableAssociationsSliderMax}set maxAllowableAssociationsSliderMax(t){t<=this.maxAllowableAssociationsSliderMin||(this._maxAllowableAssociationsSliderMax=t)}get maxAllowableAssociationsSliderMin(){return this._maxAllowableAssociationsSliderMin}set maxAllowableAssociationsSliderMin(t){t<0||t>=this.maxAllowableAssociationsSliderMax||(this._maxAllowableAssociationsSliderMin=t)}get maxAllowableAssociationsSliderStep(){return this._maxAllowableAssociationsSliderStep}set maxAllowableAssociationsSliderStep(t){this._maxAllowableAssociationsSliderStep=t}get showArrowsConnectivity(){return this.viewModel.showArrowsConnectivity}set showArrowsConnectivity(t){this.viewModel.showArrowsConnectivity=t}get showArrowsStructuralAttachment(){return this.viewModel.showArrowsStructuralAttachment}set showArrowsStructuralAttachment(t){this.viewModel.showArrowsStructuralAttachment=t}get showAssociationsEnabled(){return this.viewModel.showAssociationsEnabled}set showAssociationsEnabled(t){this.viewModel.showAssociationsEnabled=t}get structuralAttachmentAssociationsLineSymbol(){return this.viewModel.structuralAttachmentAssociationsLineSymbol}set structuralAttachmentAssociationsLineSymbol(t){this.viewModel.structuralAttachmentAssociationsLineSymbol=t}get utilityNetwork(){return this.viewModel.utilityNetwork}set utilityNetwork(t){this.viewModel.utilityNetwork=t}get view(){return this.viewModel.view}set view(t){this.viewModel.view=t}render(){const{label:t}=this;return r("div",{class:u.widgetContainer},r("calcite-block",{class:u.blockContent,collapsible:!0,heading:t},this._renderStatusIcon(),this.autoRefreshAssociations?this._renderShowAssociationsSwitch():this._renderRefreshAssociationsAction(),this._renderContent()))}loadDependencies(){return a({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),block:()=>import("@esri/calcite-components/dist/components/calcite-block"),"block-section":()=>import("@esri/calcite-components/dist/components/calcite-block-section"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),combobox:()=>import("@esri/calcite-components/dist/components/calcite-combobox"),"combobox-item":()=>import("@esri/calcite-components/dist/components/calcite-combobox-item"),label:()=>import("@esri/calcite-components/dist/components/calcite-label"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice"),panel:()=>import("@esri/calcite-components/dist/components/calcite-panel"),slider:()=>import("@esri/calcite-components/dist/components/calcite-slider"),switch:()=>import("@esri/calcite-components/dist/components/calcite-switch"),tooltip:()=>import("@esri/calcite-components/dist/components/calcite-tooltip")})}_connectivityAssociationsSwitchChange(t){this.includeConnectivityAssociations=t.currentTarget.checked}_getLoadErrorMessagesAsNotices(t,i){return r("calcite-notice",{closable:!1,key:`error-notice-${i}`,kind:"warning",open:!0,scale:"s"},r("div",{slot:"message"},t))}_maxAllowableAssociationsSliderChange(t){this.maxAllowableAssociations=Number(t.currentTarget.value)}_refreshAssociations(){const{viewModel:t,viewModel:{state:i}}=this;"ready"!==i&&"warning"!==i||t.showAssociations()}_renderConnectivityAssociationsSettings(){const{messages:{input:{enableConnectivity:t}},visibleElements:{connectivityAssociationsSettings:i}}=this;if(i)return r("calcite-block-section",{class:u.blockSectionSettings,text:t},r(d,{id:`${this.id}-symbol-picker-connectivity`,lineSymbol:this.connectivityAssociationsLineSymbol,showArrows:this.showArrowsConnectivity,visibleElements:i}))}_renderConnectivityAssociationsToggle(){const{messages:{input:{enableConnectivity:t}}}=this;return r("div",{class:u.labelAndToggle,key:"connectivityAssociationsToggleDiv"},r("calcite-label",{class:u.label},t),r("calcite-switch",{bind:this,checked:this.includeConnectivityAssociations,disabled:!this._associationsOptionsEnabled&&this.autoRefreshAssociations,onCalciteSwitchChange:this._connectivityAssociationsSwitchChange}))}_renderComboboxItem({heading:t,value:i,selected:s}){return r("calcite-combobox-item",{class:u.comboboxItem,heading:t,selected:s,textLabel:t,value:i})}_renderContent(){const{viewModel:{loadErrors:t,state:i}}=this;return"disabled"===i?r("div",{class:u.divControlsMain,key:"loadErrorsDiv"},t.items.map(this._getLoadErrorMessagesAsNotices)):r("calcite-panel",{class:u.panel,disabled:"loading"===i},r("div",{class:u.divControlsMain},this._renderConnectivityAssociationsToggle(),this._renderStructuralAttachmentAssociationsToggle(),this._renderSettingsPane()))}_renderLoadingAction(t,i,s){return r("div",{key:t,slot:"control"},r("calcite-action",{id:i,loading:!0,text:s}),r("calcite-tooltip",{overlayPositioning:"fixed",referenceElement:i},r("span",null,s)))}_renderMaxAllowableAssociationsSlider(){const{messages:{input:{maxAllowableAssociations:t}},visibleElements:{maxAllowableAssociationsSlider:i}}=this;if(i)return r("div",{class:u.labelAndSlider,key:"maxAllowableAssociationsSliderDiv"},r("calcite-label",{class:u.label},t),r("calcite-slider",{bind:this,class:u.slider,labelTicks:!0,max:this.maxAllowableAssociationsSliderMax,min:this.maxAllowableAssociationsSliderMin,scale:"s",snap:!0,step:this.maxAllowableAssociationsSliderStep,ticks:this.maxAllowableAssociationsSliderStep,value:this.maxAllowableAssociations,onCalciteSliderChange:this._maxAllowableAssociationsSliderChange}))}_renderRefreshAssociationsAction(){const{messages:{input:{refreshAssociations:t}},messagesCommon:{loading:i},viewModel:{state:s}}=this,e=`${this.id}-refresh-action`;if("disabled"!==s)return r("div",{class:u.actionRefresh,slot:"control"},r("calcite-action",{bind:this,class:u.action,icon:"refresh-f",id:e,loading:"loading"===s,onclick:this._refreshAssociations,text:t}),r("calcite-tooltip",{overlayPositioning:"fixed",referenceElement:e},r("span",null,"loading"===s?i:t)))}_renderSettingsPane(){const{messagesCommon:{settings:t},visibleElements:{maxAllowableAssociationsSlider:i,connectivityAssociationsSettings:s,structuralAttachmentAssociationsSettings:e}}=this,o=(this.view?.map).utilityNetworks?.items;if(1!==o?.length||i||s||e)return r("calcite-block",{class:u.blockContent,collapsible:!0,heading:t},r("div",{class:u.divControlsMain},this._renderUtilityNetworkSettings(),this._renderMaxAllowableAssociationsSlider()),this._renderConnectivityAssociationsSettings(),this._renderStructuralAttachmentAssociationsSettings())}_renderShowAssociationsSwitch(){const{messages:{input:{enableAssociations:t}},messagesCommon:{loading:i},viewModel:{state:s}}=this,e=`${this.id}-show-associations-switch`;if("disabled"!==s)return"loading"===s?this._renderLoadingAction("loadingActionDiv",`${this.id}-loading-action`,i):r("div",{class:u.switchContainer,key:"switchDiv",slot:"control"},r("calcite-switch",{bind:this,checked:this.showAssociationsEnabled,class:u.switch,id:e,onCalciteSwitchChange:this._showAssociationsSwitchChange}),r("calcite-tooltip",{overlayPositioning:"fixed",referenceElement:e},r("span",null,t)))}_renderStatusIcon(){const{messagesCommon:{executing:t},viewModel:{executionError:i,state:s}}=this;switch(s){case"disabled":return this._renderWarningIcon("statusDiv",`${this.id}-disabled-icon`,null);case"warning":return this._renderWarningIcon("statusDiv",`${this.id}-warning-icon`,i);case"executing":return this._renderLoadingAction("executingActionDiv",`${this.id}-executing-action`,t);default:return}}_renderStructuralAttachmentAssociationsSettings(){const{messages:{input:{enableStructuralAttachment:t}},visibleElements:{structuralAttachmentAssociationsSettings:i}}=this;if(i)return r("calcite-block-section",{class:u.blockSectionSettings,text:t},r(d,{id:`${this.id}-symbol-picker-structural-attachment`,lineSymbol:this.structuralAttachmentAssociationsLineSymbol,showArrows:this.showArrowsStructuralAttachment,visibleElements:i}))}_renderStructuralAttachmentAssociationsToggle(){const{messages:{input:{enableStructuralAttachment:t}}}=this;return r("div",{class:u.labelAndToggle,key:"structuralAttachmentAssociationsToggleDiv"},r("calcite-label",{class:u.label},t),r("calcite-switch",{bind:this,checked:this.includeStructuralAttachmentAssociations,disabled:!this._associationsOptionsEnabled&&this.autoRefreshAssociations,onCalciteSwitchChange:this._structuralAttAssociationsSwitchChange}))}_renderUtilityNetworkSettings(){const{messages:{input:{utilityNetwork:t}}}=this,i=(this.view?.map).utilityNetworks?.items;if(1===i?.length)return null;const s=i?.map(t=>{const i=t.title,s=t.layerUrl,e=t.layerUrl===this.utilityNetwork?.layerUrl;return this._renderComboboxItem({heading:i,value:s,selected:e})});return r("div",{class:u.labelAndCombobox,key:"utilityNetworkComboboxDiv"},r("calcite-label",{class:u.label},t),r("calcite-combobox",{class:u.combobox,clearDisabled:!0,label:"",maxItems:3,overlayPositioning:"fixed",selectionMode:"single-persist",onCalciteComboboxChange:t=>{const s=i?.find(i=>i.layerUrl===t.currentTarget.value);this.utilityNetwork=s}},s))}_showAssociationsSwitchChange({currentTarget:t}){const{viewModel:i}=this;this.showAssociationsEnabled=t.checked,this._associationsOptionsEnabled=t.checked,this.showAssociationsEnabled||i.removeAssociations()}_structuralAttAssociationsSwitchChange(t){this.includeStructuralAttachmentAssociations=t.currentTarget.checked}_renderWarningIcon(t,i,s){return s?r("div",{class:u.statusIconContainer,key:t,slot:"control"},r("calcite-icon",{class:u.statusIconWarning,icon:"exclamation-mark-triangle",id:i,scale:"s"}),r("calcite-tooltip",{overlayPositioning:"fixed",referenceElement:i},r("span",null,s))):r("div",{class:u.statusIconContainer,key:t,slot:"control"},r("calcite-icon",{class:u.statusIconWarning,icon:"exclamation-mark-triangle",id:i,scale:"s"}))}};t([o()],w.prototype,"autoRefreshAssociations",null),t([o()],w.prototype,"connectivityAssociationsLineSymbol",null),t([o()],w.prototype,"icon",null),t([o()],w.prototype,"includeConnectivityAssociations",null),t([o()],w.prototype,"includeStructuralAttachmentAssociations",null),t([o()],w.prototype,"label",null),t([o()],w.prototype,"maxAllowableAssociations",null),t([o()],w.prototype,"maxAllowableAssociationsSliderMax",null),t([o()],w.prototype,"maxAllowableAssociationsSliderMin",null),t([o()],w.prototype,"maxAllowableAssociationsSliderStep",null),t([o(),c("esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations")],w.prototype,"messages",void 0),t([o(),c("esri/t9n/common")],w.prototype,"messagesCommon",void 0),t([o()],w.prototype,"showArrowsConnectivity",null),t([o()],w.prototype,"showArrowsStructuralAttachment",null),t([o()],w.prototype,"showAssociationsEnabled",null),t([o()],w.prototype,"structuralAttachmentAssociationsLineSymbol",null),t([o()],w.prototype,"utilityNetwork",null),t([o()],w.prototype,"view",null),t([o({type:h})],w.prototype,"viewModel",void 0),t([o({type:m,nonNullable:!0})],w.prototype,"visibleElements",void 0),w=t([n("esri.widgets.UtilityNetworkAssociations")],w);const b=w;export{b as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import"../../intl.js";import t from"../../core/Collection.js";import{watch as i}from"../../core/reactiveUtils.js";import{throttle as o}from"../../core/throttle.js";import{property as s}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as n}from"../../core/accessorSupport/decorators/subclass.js";import{fetchMessageBundle as r}from"../../intl/messages.js";import{isFeatureLayer as l,isSubtypeSublayer as a}from"../../layers/support/layerUtils.js";import"../../popup/content/AttachmentsContent.js";import"../../popup/content/Content.js";import"../../popup/content/CustomContent.js";import"../../popup/content/ExpressionContent.js";import"../../popup/content/FieldsContent.js";import"../../popup/content/MediaContent.js";import"../../popup/content/RelationshipContent.js";import"../../popup/content/TextContent.js";import c from"../../popup/content/UtilityNetworkAssociationsContent.js";import{substituteActionImage as d,getActionStyles as p}from"../../support/actions/actionUtils.js";import u from"../Feature.js";import h from"../Spinner.js";import m from"../Widget.js";import{css as g}from"../Feature/resources.js";import{FeatureContentMixin as v}from"../Feature/support/FeatureContentMixin.js";import{css as w}from"../Features/css.js";import _ from"../Features/FeaturesViewModel.js";import{ActionsCollection as f}from"../Popup/actions.js";import{zoomToLocation as y}from"../Popup/actionUtils.js";import{loadCalciteComponents as M}from"../support/componentsUtils.js";import{globalCss as F}from"../support/globalCss.js";import{Heading as A}from"../support/Heading.js";import"../support/widgetUtils.js";import{messageBundle as b}from"../support/decorators/messageBundle.js";import{vmEvent as I}from"../support/decorators/vmEvent.js";import{tsx as k}from"../support/jsxFactory.js";import"@arcgis/toolkit/dom";import C from"./UtilityNetworkTraceFeaturesDrillIn.js";import{substitute as T}from"../../intl/substitute.js";const j="selected-index",W=0,x="features-spinner",N="esri-utility-network-trace",S={blockContainer:`${N}__block-container`,blockContent:`${N}__block-content`,featureContent:`${N}__feature-content`,paddingBottom:`${N}__pad-bottom`,paddingTop:`${N}__pad-top`};let L=class extends(v(m)){constructor(e,s){super(e,s),this._actionBarMenuNode=null,this._drillInFlowItems=new t,this._drillInWidget=new C({flowItems:this._drillInFlowItems}),this._feature=null,this._featureMenuViewportNode=null,this._spinner=null,this._utilityNetworkTraceMessages=null,this.featureNavigationTop=!1,this.headerActions=new f,this.headingLevel=2,this.messages=null,this.messagesCommon=null,this.responsiveActionsEnabled=!1,this.viewModel=new _,this._renderAction=(e,t)=>{const i=this._getActionTitle(e),{type:o,active:s,uid:n,disabled:r,indicator:l}=e;return e.visible?k("calcite-action",{active:"toggle"===o&&e.value,appearance:"solid",bind:this,"data-action-uid":n,disabled:"zoom-to-feature"===e.id?!this.feature.geometry:r,icon:this._getActionIcon(e),indicator:l,key:`action-${t}`,loading:s,onclick:this._triggerAction,scale:"s",text:i,title:this._hideActionText?i:void 0},this._renderFallbackIcon(e)):null},this._renderAddNsoBlock=()=>{const{_utilityNetworkTraceMessages:e,messagesCommon:t}=this;return k("calcite-block",{class:S.blockContent,expanded:!this.feature,heading:e?.inputsStrings.addNonspatialOption},k("calcite-action",{icon:"x",onclick:()=>this.emit("close-un-trace-feature-block"),slot:"control",text:t.close}),k("calcite-notice",{icon:"information",kind:"info",open:!this.feature},k("div",{slot:"message"},e?.inputsStrings.addNonspatialHint)))},this._renderNoPopupErrorBlock=()=>{const{_utilityNetworkTraceMessages:e,messagesCommon:t}=this;return k("calcite-block",{description:void 0,expanded:!0,heading:"show-feature-info"===this.mode?t.warning:void 0},k("calcite-notice",{class:this.classes(S.paddingBottom,S.paddingTop),icon:"exclamation-mark-triangle",kind:"danger",open:!0},k("div",{slot:"message"},e.alertsStrings.noPopupConfigured)),"show-feature-info"===this.mode?k("calcite-action",{icon:"x",onclick:()=>this.emit("close-un-trace-feature-block"),slot:"control",text:t.close}):void 0)},this._displaySpinnerThrottled=o(()=>this._displaySpinner(),W),this.addHandles([this._displaySpinnerThrottled,i(()=>this.viewModel?.active,e=>this._drillInWidget.closed=!e),i(()=>this.viewModel?.view,(e,t)=>this._viewChange(e,t)),i(()=>this.viewModel?.view?.ready,(e,t)=>this._viewReadyChange(e??!1,t??!1)),i(()=>[this.viewModel?.waitingForResult,this.viewModel?.location],()=>{this._hideSpinner(),this._displaySpinnerThrottled()}),i(()=>this.viewModel?.screenLocation,()=>this._closeOpenActionMenu()),i(()=>this.selectedFeatureWidget,()=>this._destroyDrillInFlowItemWidgets()),i(()=>{const e=this.selectedFeatureWidget?.viewModel;return[e?.title,e?.state]},()=>this._setTitleFromFeatureWidget()),i(()=>{const e=this.selectedFeatureWidget?.viewModel;return[e?.content,e?.state]},()=>this._setContentFromFeatureWidget()),i(()=>this.viewModel?.featureViewModels,()=>this._featureMenuViewportScrollTop()),this._drillInWidget.on("close",()=>{this.emit("close")}),this._drillInWidget.on("exit",()=>this._destroyDrillInFlowItemWidgets()),this._drillInWidget.on("open-feature",({feature:e})=>this._openRelatedFeature(e)),this._drillInWidget.on("zoom-to-feature",({featureWidget:e})=>y(this.viewModel,e)),this._drillInWidget.on("add-nso-trace-location",({featureWidget:e})=>this.emit("add-nso-trace-location",{featureWidget:e}))])}initialize(){(async()=>{this._utilityNetworkTraceMessages=await r("esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace")})(),this._drillInWidget.mode=this.mode,this._drillInWidget.closable=!1}loadDependencies(){return M({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),"action-bar":()=>import("@esri/calcite-components/dist/components/calcite-action-bar"),"action-group":()=>import("@esri/calcite-components/dist/components/calcite-action-group"),block:()=>import("@esri/calcite-components/dist/components/calcite-block"),flow:()=>import("@esri/calcite-components/dist/components/calcite-flow"),"flow-item":()=>import("@esri/calcite-components/dist/components/calcite-flow-item"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice")})}destroy(){this._destroyDrillInFlowItemWidgets(),this._destroySelectedFeatureWidget(),this._destroySpinner(),this._drillInWidget?.destroy()}get _hideActionText(){if(!this.responsiveActionsEnabled)return!1;const e=this.view?.widthBreakpoint;return"xsmall"===e||"small"===e||"medium"===e}get active(){return this.viewModel.active}get content(){return this.viewModel.content}set content(e){this.viewModel.content=e}get feature(){return this.viewModel.features.length?this.viewModel.features[0]:null}set feature(e){this.viewModel.features=e?[e]:[]}get goToOverride(){return this.viewModel.goToOverride}set goToOverride(e){this.viewModel.goToOverride=e}get hasAssociationsPopupElement(){const e=l(this.feature?.sourceLayer)?this.feature?.sourceLayer:void 0,t=a(this.feature?.sourceLayer)?this.feature?.sourceLayer:void 0,i=e?.popupTemplate||t?.popupTemplate||null,o=i?.content;return!(Array.isArray(o)&&!o.some(e=>e instanceof c))}get hasPopupInfo(){const e=l(this.feature?.sourceLayer)?this.feature?.sourceLayer:void 0,t=a(this.feature?.sourceLayer)?this.feature?.sourceLayer:void 0;return!(!e?.popupTemplate&&!t?.popupTemplate)}get location(){return this.viewModel.location}set location(e){this.viewModel.location=e}get mode(){return this._get("mode")||"add-nso"}set mode(e){this._set("mode",e)}get promises(){return this.viewModel.promises}set promises(e){this.viewModel.promises=e}get selectedFeature(){return this.viewModel.selectedFeature}get selectedDrillInFeature(){const e=Array.from(this._drillInFlowItems).at(-1);if(!e)return null;const{flowType:t}=e;return"feature-association"===t||"feature-relationship"===t?e.graphic??null:null}get selectedFeatureWidget(){const{_feature:e,headingLevel:t,_drillInFlowItems:i,timeZone:o}=this,{selectedFeatureViewModel:s}=this.viewModel,n={title:!1};return s?(e?(e.viewModel=s,e.visibleElements=n):this._feature=new u({flowItems:i,headingLevel:t+1,timeZone:o,viewModel:s,visibleElements:n}),this._feature):null}get timeZone(){return this.viewModel.timeZone}set timeZone(e){this.viewModel.timeZone=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}open(e){this.removeHandles(j),this.viewModel.open({features:[e]})}triggerAction(e){return this.viewModel.triggerAction(e)}render(){return k("div",{bind:this,class:this.classes(w.base,F.widget,F.panel,S.blockContainer)},"add-nso"===this.mode?this._renderAddNsoBlock():void 0,this.feature?this.hasPopupInfo?this._renderContentContainer():this._renderNoPopupErrorBlock():void 0)}_renderActionBar(){return this.viewModel.allActions?.length?k("calcite-action-bar",{expandDisabled:!0,expanded:!this._hideActionText,key:"header-action-bar",scale:"s",slot:"action-bar"},k("calcite-action-group",{afterCreate:e=>this._actionBarMenuNode=e,overlayPositioning:"fixed",scale:"s"},this._renderActions())):null}_renderActions(){return this.viewModel.allActions.toArray().map(this._renderAction)}_renderContent(){const e=this.viewModel?.content;return e?"string"==typeof e?k("div",{class:g.contentNode,innerHTML:e,key:e}):this.renderNodeContent(e):null}_renderContentContainer(){const e=[this._renderContentFeature(),this._drillInWidget.render()];return k("calcite-flow",{key:"content-container"},e)}_renderContentFeature(){const{_drillInFlowItems:e,headingLevel:t,featureNavigationTop:i}=this,{title:o,active:s}=this.viewModel,n=o||"";return k("calcite-flow-item",{bind:this,class:this.classes({[w.contentFeature]:!0}),closed:!s,collapseDirection:i?"down":"up",headingLevel:t,key:"root-flow-item",loading:this.viewModel.waitingForContents,selected:0===e.length},"show-feature-info"===this.mode?k("calcite-action",{icon:"x",onclick:()=>{this.emit("close")},slot:"header-actions-end",text:this.messagesCommon.close}):void 0,n?k(A,{class:this.classes(w.featuresHeading,F.heading),innerHTML:n,key:"header-content",level:this.headingLevel,slot:"header-content"}):null,this._renderHeaderActions(),this._renderActionBar(),k("div",{class:"add-nso"===this.mode?this.classes(w.container,w.contentContainer):this.classes(w.container,w.contentContainer,S.featureContent)},this._renderContent()))}_renderFallbackIcon(e){const{className:t,icon:i}=e;if(i)return null;const o=d({action:e,feature:this.selectedFeature}),s={[w.icon]:!!t,[w.actionImage]:!!o};return t&&(s[t]=!0),o||t?k("span",{"aria-hidden":"true",class:this.classes(w.icon,s),key:"icon",styles:p(o)}):null}_renderHeaderAction(e,t){const i=e.title||"";return e.visible?k("calcite-action",{active:"toggle"===e.type&&e.value,appearance:"solid",bind:this,"data-action-uid":e.uid,disabled:e.disabled||!this.feature.geometry,icon:e.icon??void 0,indicator:e.indicator,key:`header-action-${t}`,loading:e.active,onclick:this._triggerHeaderAction,slot:"header-actions-end",text:i,title:i}):null}_renderHeaderActions(){return this.headerActions.map((e,t)=>this._renderHeaderAction(e,t)).toArray()}_closeOpenActionMenu(){const{_actionBarMenuNode:e}=this;e&&(e.menuOpen=!1)}_createSpinner(e){e&&(this._spinner=new h({view:e}),e.ui.add(this._spinner,{key:x,position:"manual",internal:!0}))}_destroyDrillInFlowItemWidgets(){this._drillInFlowItems.drain(e=>{"showAllEnabled"in e.viewModel&&(e.viewModel.showAllEnabled=!1),e.viewModel=null,e.destroy()})}_destroySelectedFeatureWidget(){const{_feature:e}=this;e&&(e.viewModel=null,!e.destroyed&&e.destroy()),this._feature=null}_destroySpinner(){const{_spinner:e,view:t}=this;e&&(t?.ui?.remove(e,x),e.destroy(),this._spinner=null)}_displaySpinner(){const{_spinner:e}=this;if(!e)return;const{location:t,waitingForResult:i}=this.viewModel;i&&t?e.show({location:t}):e.hide()}_featureMenuViewportScrollTop(){this._featureMenuViewportNode?.scrollContentTo({top:0})}_getActionIcon(e){return e.icon?e.icon:e.image||e.className?void 0:"question"}_getActionTitle(e){const{messages:t,selectedFeature:i,messagesCommon:o}=this,{id:s}=e,n=i?.attributes,r=e.title??"",l="zoom-to-feature"===s?T(r,{messages:t}):"remove-selected-feature"===s?T(r,{messages:o}):"zoom-to-clustered-features"===s||"browse-clustered-features"===s?T(r,{messages:t}):e.title;return l&&n?T(l,n):l??""}_hideSpinner(){const{_spinner:e}=this;e&&(e.location=null,e.hide())}async _openRelatedFeature(e){await e.viewModel.updateGeometry();const t=e.graphic,i=t?.geometry;null!=i&&null!=t&&(this._destroyDrillInFlowItemWidgets(),await this.viewModel.zoomTo({target:i}),this.open(t))}_setContentFromFeatureWidget(){const{selectedFeatureWidget:e}=this;e&&(this.viewModel.content=e)}_setTitleFromFeatureWidget(){const{selectedFeatureWidget:e,messagesCommon:t}=this,i=e?.viewModel;e&&(this.viewModel.title="error"===i?.state?t?.errorMessage:i?.title||"")}_triggerAction(e){const t=e.currentTarget;if(t.disabled)return;const i=t.dataset.actionUid,{allActions:o}=this.viewModel,s=o.findIndex(e=>e.uid===i),n=o.at(s);n&&"toggle"===n.type&&(n.value=!n.value),this.viewModel.triggerAction(s)}_triggerHeaderAction(e){const t=e.currentTarget;if(t.disabled)return;const i=t.dataset.actionUid,o=this.headerActions.find(({uid:e})=>e===i);o&&!o.disabled&&("toggle"===o?.type&&(o.value=!o.value),this.emit("trigger-header-action",{action:o}))}_viewReadyChange(e,t){e?this._wireUpView(this.viewModel?.view):t&&this.viewModel.clear()}_viewChange(e,t){e&&t&&this.viewModel.clear()}_wireUpView(e){this._destroySpinner(),e&&this._createSpinner(e)}};e([s()],L.prototype,"_drillInFlowItems",void 0),e([s()],L.prototype,"_hideActionText",null),e([s({readOnly:!0})],L.prototype,"active",null),e([s()],L.prototype,"content",null),e([s()],L.prototype,"feature",null),e([s()],L.prototype,"featureNavigationTop",void 0),e([s()],L.prototype,"goToOverride",null),e([s()],L.prototype,"hasAssociationsPopupElement",null),e([s()],L.prototype,"hasPopupInfo",null),e([s({type:f})],L.prototype,"headerActions",void 0),e([s()],L.prototype,"headingLevel",void 0),e([s()],L.prototype,"location",null),e([s(),b("esri/widgets/Features/t9n/Features")],L.prototype,"messages",void 0),e([s(),b("esri/t9n/common")],L.prototype,"messagesCommon",void 0),e([s()],L.prototype,"mode",null),e([s()],L.prototype,"promises",null),e([s()],L.prototype,"responsiveActionsEnabled",void 0),e([s({readOnly:!0})],L.prototype,"selectedFeature",null),e([s({readOnly:!0})],L.prototype,"selectedDrillInFeature",null),e([s({readOnly:!0})],L.prototype,"selectedFeatureWidget",null),e([s()],L.prototype,"timeZone",null),e([s()],L.prototype,"view",null),e([s({type:_}),I(["triggerAction","trigger-action"])],L.prototype,"viewModel",void 0),L=e([n("esri.widgets.UtilityNetworkTrace.UtilityNetworkTraceFeature")],L);const U=L;export{U as default};
|
|
5
|
+
import{__decorate as e}from"tslib";import{substitute as t}from"../../intl.js";import i from"../../core/Collection.js";import{watch as o}from"../../core/reactiveUtils.js";import{throttle as s}from"../../core/throttle.js";import{property as r}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as n}from"../../core/accessorSupport/decorators/subclass.js";import{fetchMessageBundle as l}from"../../intl/messages.js";import{isFeatureLayer as a,isSubtypeSublayer as d}from"../../layers/support/layerUtils.js";import{UtilityNetworkAssociationsContent as c}from"../../popup/content.js";import{substituteActionImage as u,getActionStyles as p}from"../../support/actions/actionUtils.js";import h from"../Feature.js";import m from"../Spinner.js";import g from"../Widget.js";import{css as w}from"../Feature/resources.js";import{FeatureContentMixin as v}from"../Feature/support/FeatureContentMixin.js";import{css as _}from"../Features/css.js";import f from"../Features/FeaturesViewModel.js";import{ActionsCollection as y}from"../Popup/actions.js";import{zoomToLocation as M}from"../Popup/actionUtils.js";import{loadCalciteComponents as F}from"../support/componentsUtils.js";import{globalCss as A}from"../support/globalCss.js";import{Heading as I}from"../support/Heading.js";import{tsx as b,messageBundle as k,vmEvent as T}from"../support/widget.js";import C from"./UtilityNetworkTraceFeaturesDrillIn.js";const W="selected-index",j=0,N="features-spinner",x="esri-utility-network-trace",S={blockContainer:`${x}__block-container`,blockContent:`${x}__block-content`,featureContent:`${x}__feature-content`,paddingBottom:`${x}__pad-bottom`,paddingTop:`${x}__pad-top`};let L=class extends(v(g)){constructor(e,t){super(e,t),this._actionBarMenuNode=null,this._drillInFlowItems=new i,this._drillInWidget=new C({flowItems:this._drillInFlowItems}),this._feature=null,this._featureMenuViewportNode=null,this._spinner=null,this._utilityNetworkTraceMessages=null,this.featureNavigationTop=!1,this.headerActions=new y,this.headingLevel=2,this.messages=null,this.messagesCommon=null,this.responsiveActionsEnabled=!1,this.viewModel=new f,this._renderAction=(e,t)=>{const i=this._getActionTitle(e),{type:o,active:s,uid:r,disabled:n,indicator:l}=e;return e.visible?b("calcite-action",{active:"toggle"===o&&e.value,appearance:"solid",bind:this,"data-action-uid":r,disabled:"zoom-to-feature"===e.id?!this.feature.geometry:n,icon:this._getActionIcon(e),indicator:l,key:`action-${t}`,loading:s,onclick:this._triggerAction,scale:"s",text:i,title:this._hideActionText?i:void 0},this._renderFallbackIcon(e)):null},this._renderAddNsoBlock=()=>{const{_utilityNetworkTraceMessages:e,messagesCommon:t}=this;return b("calcite-block",{class:S.blockContent,expanded:!this.feature,heading:e?.inputsStrings.addNonspatialOption},b("calcite-action",{icon:"x",onclick:()=>this.emit("close-un-trace-feature-block"),slot:"control",text:t.close}),b("calcite-notice",{icon:"information",kind:"info",open:!this.feature},b("div",{slot:"message"},e?.inputsStrings.addNonspatialHint)))},this._renderNoPopupErrorBlock=()=>{const{_utilityNetworkTraceMessages:e,messagesCommon:t}=this;return b("calcite-block",{description:void 0,expanded:!0,heading:"show-feature-info"===this.mode?t.warning:void 0},b("calcite-notice",{class:this.classes(S.paddingBottom,S.paddingTop),icon:"exclamation-mark-triangle",kind:"danger",open:!0},b("div",{slot:"message"},e.alertsStrings.noPopupConfigured)),"show-feature-info"===this.mode?b("calcite-action",{icon:"x",onclick:()=>this.emit("close-un-trace-feature-block"),slot:"control",text:t.close}):void 0)},this._displaySpinnerThrottled=s(()=>this._displaySpinner(),j),this.addHandles([this._displaySpinnerThrottled,o(()=>this.viewModel?.active,e=>this._drillInWidget.closed=!e),o(()=>this.viewModel?.view,(e,t)=>this._viewChange(e,t)),o(()=>this.viewModel?.view?.ready,(e,t)=>this._viewReadyChange(e??!1,t??!1)),o(()=>[this.viewModel?.waitingForResult,this.viewModel?.location],()=>{this._hideSpinner(),this._displaySpinnerThrottled()}),o(()=>this.viewModel?.screenLocation,()=>this._closeOpenActionMenu()),o(()=>this.selectedFeatureWidget,()=>this._destroyDrillInFlowItemWidgets()),o(()=>{const e=this.selectedFeatureWidget?.viewModel;return[e?.title,e?.state]},()=>this._setTitleFromFeatureWidget()),o(()=>{const e=this.selectedFeatureWidget?.viewModel;return[e?.content,e?.state]},()=>this._setContentFromFeatureWidget()),o(()=>this.viewModel?.featureViewModels,()=>this._featureMenuViewportScrollTop()),this._drillInWidget.on("close",()=>{this.emit("close")}),this._drillInWidget.on("exit",()=>this._destroyDrillInFlowItemWidgets()),this._drillInWidget.on("open-feature",({feature:e})=>this._openRelatedFeature(e)),this._drillInWidget.on("zoom-to-feature",({featureWidget:e})=>M(this.viewModel,e)),this._drillInWidget.on("add-nso-trace-location",({featureWidget:e})=>this.emit("add-nso-trace-location",{featureWidget:e}))])}initialize(){(async()=>{this._utilityNetworkTraceMessages=await l("esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace")})(),this._drillInWidget.mode=this.mode,this._drillInWidget.closable=!1}loadDependencies(){return F({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),"action-bar":()=>import("@esri/calcite-components/dist/components/calcite-action-bar"),"action-group":()=>import("@esri/calcite-components/dist/components/calcite-action-group"),block:()=>import("@esri/calcite-components/dist/components/calcite-block"),flow:()=>import("@esri/calcite-components/dist/components/calcite-flow"),"flow-item":()=>import("@esri/calcite-components/dist/components/calcite-flow-item"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice")})}destroy(){this._destroyDrillInFlowItemWidgets(),this._destroySelectedFeatureWidget(),this._destroySpinner(),this._drillInWidget?.destroy()}get _hideActionText(){if(!this.responsiveActionsEnabled)return!1;const e=this.view?.widthBreakpoint;return"xsmall"===e||"small"===e||"medium"===e}get active(){return this.viewModel.active}get content(){return this.viewModel.content}set content(e){this.viewModel.content=e}get feature(){return this.viewModel.features.length?this.viewModel.features[0]:null}set feature(e){this.viewModel.features=e?[e]:[]}get goToOverride(){return this.viewModel.goToOverride}set goToOverride(e){this.viewModel.goToOverride=e}get hasAssociationsPopupElement(){const e=a(this.feature?.sourceLayer)?this.feature?.sourceLayer:void 0,t=d(this.feature?.sourceLayer)?this.feature?.sourceLayer:void 0,i=e?.popupTemplate||t?.popupTemplate||null,o=i?.content;return!(Array.isArray(o)&&!o.some(e=>e instanceof c))}get hasPopupInfo(){const e=a(this.feature?.sourceLayer)?this.feature?.sourceLayer:void 0,t=d(this.feature?.sourceLayer)?this.feature?.sourceLayer:void 0;return!(!e?.popupTemplate&&!t?.popupTemplate)}get location(){return this.viewModel.location}set location(e){this.viewModel.location=e}get mode(){return this._get("mode")||"add-nso"}set mode(e){this._set("mode",e)}get promises(){return this.viewModel.promises}set promises(e){this.viewModel.promises=e}get selectedFeature(){return this.viewModel.selectedFeature}get selectedDrillInFeature(){const e=Array.from(this._drillInFlowItems).at(-1);if(!e)return null;const{flowType:t}=e;return"feature-association"===t||"feature-relationship"===t?e.graphic??null:null}get selectedFeatureWidget(){const{_feature:e,headingLevel:t,_drillInFlowItems:i,timeZone:o}=this,{selectedFeatureViewModel:s}=this.viewModel,r={title:!1};return s?(e?(e.viewModel=s,e.visibleElements=r):this._feature=new h({flowItems:i,headingLevel:t+1,timeZone:o,viewModel:s,visibleElements:r}),this._feature):null}get timeZone(){return this.viewModel.timeZone}set timeZone(e){this.viewModel.timeZone=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}open(e){this.removeHandles(W),this.viewModel.open({features:[e]})}triggerAction(e){return this.viewModel.triggerAction(e)}render(){return b("div",{bind:this,class:this.classes(_.base,A.widget,A.panel,S.blockContainer)},"add-nso"===this.mode?this._renderAddNsoBlock():void 0,this.feature?this.hasPopupInfo?this._renderContentContainer():this._renderNoPopupErrorBlock():void 0)}_renderActionBar(){return this.viewModel.allActions?.length?b("calcite-action-bar",{expandDisabled:!0,expanded:!this._hideActionText,key:"header-action-bar",scale:"s",slot:"action-bar"},b("calcite-action-group",{afterCreate:e=>this._actionBarMenuNode=e,overlayPositioning:"fixed",scale:"s"},this._renderActions())):null}_renderActions(){return this.viewModel.allActions.toArray().map(this._renderAction)}_renderContent(){const e=this.viewModel?.content;return e?"string"==typeof e?b("div",{class:w.contentNode,innerHTML:e,key:e}):this.renderNodeContent(e):null}_renderContentContainer(){const e=[this._renderContentFeature(),this._drillInWidget.render()];return b("calcite-flow",{key:"content-container"},e)}_renderContentFeature(){const{_drillInFlowItems:e,headingLevel:t,featureNavigationTop:i}=this,{title:o,active:s}=this.viewModel,r=o||"";return b("calcite-flow-item",{bind:this,class:this.classes({[_.contentFeature]:!0}),closed:!s,collapseDirection:i?"down":"up",headingLevel:t,key:"root-flow-item",loading:this.viewModel.waitingForContents,selected:0===e.length},"show-feature-info"===this.mode?b("calcite-action",{icon:"x",onclick:()=>{this.emit("close")},slot:"header-actions-end",text:this.messagesCommon.close}):void 0,r?b(I,{class:this.classes(_.featuresHeading,A.heading),innerHTML:r,key:"header-content",level:this.headingLevel,slot:"header-content"}):null,this._renderHeaderActions(),this._renderActionBar(),b("div",{class:"add-nso"===this.mode?this.classes(_.container,_.contentContainer):this.classes(_.container,_.contentContainer,S.featureContent)},this._renderContent()))}_renderFallbackIcon(e){const{className:t,icon:i}=e;if(i)return null;const o=u({action:e,feature:this.selectedFeature}),s={[_.icon]:!!t,[_.actionImage]:!!o};return t&&(s[t]=!0),o||t?b("span",{"aria-hidden":"true",class:this.classes(_.icon,s),key:"icon",styles:p(o)}):null}_renderHeaderAction(e,t){const i=e.title||"";return e.visible?b("calcite-action",{active:"toggle"===e.type&&e.value,appearance:"solid",bind:this,"data-action-uid":e.uid,disabled:e.disabled||!this.feature.geometry,icon:e.icon??void 0,indicator:e.indicator,key:`header-action-${t}`,loading:e.active,onclick:this._triggerHeaderAction,slot:"header-actions-end",text:i,title:i}):null}_renderHeaderActions(){return this.headerActions.map((e,t)=>this._renderHeaderAction(e,t)).toArray()}_closeOpenActionMenu(){const{_actionBarMenuNode:e}=this;e&&(e.menuOpen=!1)}_createSpinner(e){e&&(this._spinner=new m({view:e}),e.ui.add(this._spinner,{key:N,position:"manual",internal:!0}))}_destroyDrillInFlowItemWidgets(){this._drillInFlowItems.drain(e=>{"showAllEnabled"in e.viewModel&&(e.viewModel.showAllEnabled=!1),e.viewModel=null,e.destroy()})}_destroySelectedFeatureWidget(){const{_feature:e}=this;e&&(e.viewModel=null,!e.destroyed&&e.destroy()),this._feature=null}_destroySpinner(){const{_spinner:e,view:t}=this;e&&(t?.ui?.remove(e,N),e.destroy(),this._spinner=null)}_displaySpinner(){const{_spinner:e}=this;if(!e)return;const{location:t,waitingForResult:i}=this.viewModel;i&&t?e.show({location:t}):e.hide()}_featureMenuViewportScrollTop(){this._featureMenuViewportNode?.scrollContentTo({top:0})}_getActionIcon(e){return e.icon?e.icon:e.image||e.className?void 0:"question"}_getActionTitle(e){const{messages:i,selectedFeature:o,messagesCommon:s}=this,{id:r}=e,n=o?.attributes,l=e.title??"",a="zoom-to-feature"===r?t(l,{messages:i}):"remove-selected-feature"===r?t(l,{messages:s}):"zoom-to-clustered-features"===r||"browse-clustered-features"===r?t(l,{messages:i}):e.title;return a&&n?t(a,n):a??""}_hideSpinner(){const{_spinner:e}=this;e&&(e.location=null,e.hide())}async _openRelatedFeature(e){await e.viewModel.updateGeometry();const t=e.graphic,i=t?.geometry;null!=i&&null!=t&&(this._destroyDrillInFlowItemWidgets(),await this.viewModel.zoomTo({target:i}),this.open(t))}_setContentFromFeatureWidget(){const{selectedFeatureWidget:e}=this;e&&(this.viewModel.content=e)}_setTitleFromFeatureWidget(){const{selectedFeatureWidget:e,messagesCommon:t}=this,i=e?.viewModel;e&&(this.viewModel.title="error"===i?.state?t?.errorMessage:i?.title||"")}_triggerAction(e){const t=e.currentTarget;if(t.disabled)return;const i=t.dataset.actionUid,{allActions:o}=this.viewModel,s=o.findIndex(e=>e.uid===i),r=o.at(s);r&&"toggle"===r.type&&(r.value=!r.value),this.viewModel.triggerAction(s)}_triggerHeaderAction(e){const t=e.currentTarget;if(t.disabled)return;const i=t.dataset.actionUid,o=this.headerActions.find(({uid:e})=>e===i);o&&!o.disabled&&("toggle"===o?.type&&(o.value=!o.value),this.emit("trigger-header-action",{action:o}))}_viewReadyChange(e,t){e?this._wireUpView(this.viewModel?.view):t&&this.viewModel.clear()}_viewChange(e,t){e&&t&&this.viewModel.clear()}_wireUpView(e){this._destroySpinner(),e&&this._createSpinner(e)}};e([r()],L.prototype,"_drillInFlowItems",void 0),e([r()],L.prototype,"_hideActionText",null),e([r({readOnly:!0})],L.prototype,"active",null),e([r()],L.prototype,"content",null),e([r()],L.prototype,"feature",null),e([r()],L.prototype,"featureNavigationTop",void 0),e([r()],L.prototype,"goToOverride",null),e([r()],L.prototype,"hasAssociationsPopupElement",null),e([r()],L.prototype,"hasPopupInfo",null),e([r({type:y})],L.prototype,"headerActions",void 0),e([r()],L.prototype,"headingLevel",void 0),e([r()],L.prototype,"location",null),e([r(),k("esri/widgets/Features/t9n/Features")],L.prototype,"messages",void 0),e([r(),k("esri/t9n/common")],L.prototype,"messagesCommon",void 0),e([r()],L.prototype,"mode",null),e([r()],L.prototype,"promises",null),e([r()],L.prototype,"responsiveActionsEnabled",void 0),e([r({readOnly:!0})],L.prototype,"selectedFeature",null),e([r({readOnly:!0})],L.prototype,"selectedDrillInFeature",null),e([r({readOnly:!0})],L.prototype,"selectedFeatureWidget",null),e([r()],L.prototype,"timeZone",null),e([r()],L.prototype,"view",null),e([r({type:f}),T(["triggerAction","trigger-action"])],L.prototype,"viewModel",void 0),L=e([n("esri.widgets.UtilityNetworkTrace.UtilityNetworkTraceFeature")],L);const U=L;export{U as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import"../../intl.js";import{property as
|
|
5
|
+
import{__decorate as e}from"tslib";import{substitute as t}from"../../intl.js";import{property as i}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as o}from"../../core/accessorSupport/decorators/subclass.js";import{fetchMessageBundle as s}from"../../intl/messages.js";import a from"../Widget.js";import{css as n}from"../Features/css.js";import{zoomToFeature as r}from"../Popup/actions.js";import{loadCalciteComponents as c}from"../support/componentsUtils.js";import{messageBundle as l,tsx as d,tsxFragment as p}from"../support/widget.js";const m=r.clone(),u={featureContent:`${"esri-utility-network-trace"}__feature-content`};let h=class extends a{constructor(e,t){super(e,t),this._utilityNetworkTraceMessages=null,this.closed=!1,this.closable=!0,this.messages=null,this.messagesCommon=null,this._handleAddNonspatialTraceLocation=e=>{this.emit("add-nso-trace-location",{featureWidget:e})},this._handleOpenFeature=e=>{this.emit("open-feature",{feature:e})},this._handleZoomToFeature=e=>{this.emit("zoom-to-feature",{featureWidget:e})}}initialize(){(async()=>{this._utilityNetworkTraceMessages=await s("esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace")})()}loadDependencies(){return c({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),"action-bar":()=>import("@esri/calcite-components/dist/components/calcite-action-bar"),"action-group":()=>import("@esri/calcite-components/dist/components/calcite-action-group"),"flow-item":()=>import("@esri/calcite-components/dist/components/calcite-flow-item")})}get mode(){return this._get("mode")||"show-feature-info"}set mode(e){this._set("mode",e)}render(){const{flowItems:e}=this,t=e?.toArray();return d(p,null,t?.map((t,i)=>this._renderFlowItem(t,i===e.length-1)))}_renderAddNonspatialTraceLocationAction(e){const{_utilityNetworkTraceMessages:t}=this;return d("calcite-action",{appearance:"solid",bind:this,icon:"utility-network-trace",onclick:()=>this._handleAddNonspatialTraceLocation(e),scale:"s",text:t.inputsStrings.addNonspatialOption,textEnabled:!0,title:t.inputsStrings.addNonspatialOption})}_renderFlowItem(e,t){const{messages:i,closable:o,closed:s}=this,a="graphic"in e&&!e.isTable,r="feature-association"===e.flowType,c=this._getExitMessage(e),l=i.selectFeature,p=e,m=p?p.graphic?.sourceLayer:null,h=!(m?m.geometryType:null);return d("calcite-flow-item",{bind:this,closable:o,closed:s,description:this._getDrillInFlowItemDescription(e),heading:e.title??"",key:`flow-item-${e.viewModel.uid}`,selected:t,onCalciteFlowItemBack:e=>{e.preventDefault(),this._handleDrillInBackClick()}},d("calcite-action",{appearance:"transparent",bind:this,class:n.actionExit,icon:"move-up",key:"exit-action",onclick:this._handleExitClick,slot:"header-actions-start",text:c,title:c}),a?d("calcite-action",{appearance:"transparent",bind:this,icon:"zoom-to-object",key:"open-feature-action",onclick:()=>this._handleOpenFeature(e),slot:"header-actions-end",text:l,title:l}):null,"show-feature-info"===this.mode?d("calcite-action",{icon:"x",onclick:()=>{this.emit("close")},slot:"header-actions-end",text:this.messagesCommon.close}):void 0,r&&"add-nso"===this.mode?d("calcite-action-bar",{expandDisabled:!0,expanded:!0,key:"header-action-bar",scale:"s",slot:"action-bar"},d("calcite-action-group",{overlayPositioning:"fixed",scale:"s"},h?this._renderAddNonspatialTraceLocationAction(e):this._renderZoomToFeatureAction(e))):null,d("div",{class:this.classes(n.container,u.featureContent)},e.render()))}_renderZoomToFeatureAction(e){const t=this._getActionTitle(m);return d("calcite-action",{active:m.active,appearance:"solid",bind:this,"data-action-uid":m.uid,disabled:m.disabled,icon:m.icon??"question",indicator:m.indicator,key:`action-${m.uid}`,loading:m.active,onclick:()=>this._handleZoomToFeature(e),scale:"s",text:t,textEnabled:!0,title:t})}_getActionTitle(e){const{messages:i}=this,{id:o}=e,s=e.title??"";return"zoom-to-feature"===o?t(s,{messages:i}):s}_getDrillInFlowItemDescription(e){switch(e.flowType){case"feature":case"feature-association":case"feature-utility-network-associations":return e.viewModel.description??"";case"feature-relationship":return e.allItemsDescription;case"feature-utility-network-association-type":return e.description??""}}_getExitMessage(e){switch(e.flowType){case"feature":case"feature-association":return"";case"feature-relationship":return this.messages.exitRelatedRecords;case"feature-utility-network-associations":case"feature-utility-network-association-type":return this.messages.exitAssociations}}_handleDrillInBackClick(){const e=this.flowItems?.pop();e&&("showAllEnabled"in e.viewModel&&(e.viewModel.showAllEnabled=!1),e&&(e.viewModel=null,e.destroy()))}_handleExitClick(){this.emit("exit")}};e([i()],h.prototype,"closed",void 0),e([i()],h.prototype,"closable",void 0),e([i()],h.prototype,"flowItems",void 0),e([i(),l("esri/widgets/Features/t9n/Features")],h.prototype,"messages",void 0),e([i(),l("esri/t9n/common")],h.prototype,"messagesCommon",void 0),e([i()],h.prototype,"mode",null),h=e([o("esri.widgets.UtilityNetworkTrace.UtilityNetworkTraceFeaturesDrillIn")],h);const f=h;export{f as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import{watch as t,on as s,initial as i,when as r}from"../core/reactiveUtils.js";import{property as o}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{subclass as a}from"../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as l}from"../core/support/UpdatingHandles.js";import n from"../layers/support/CodedValueDomain.js";import{isSubtypeGroupLayer as c}from"../layers/support/layerUtils.js";import d from"../rest/support/Query.js";import u from"./Widget.js";import{loadCalciteComponents as h}from"./support/componentsUtils.js";import{globalCss as p}from"./support/globalCss.js";import{storeNode as g}from"./support/widgetUtils.js";import{messageBundle as m}from"./support/decorators/messageBundle.js";import{vmEvent as _}from"./support/decorators/vmEvent.js";import{tsx as b}from"./support/jsxFactory.js";import"@arcgis/toolkit/dom";import w from"./UtilityNetworkTrace/UtilityNetworkTraceFeature.js";import v from"./UtilityNetworkTrace/UtilityNetworkTraceViewModel.js";import{defaultSwatchColors as y}from"./UtilityNetworkTrace/support/GraphicHandler.js";const f="esri-utility-network-trace",S={base:f,addButtonContainer:`${f}__add-button-container`,blockContainer:`${f}__block-container`,blockContent:`${f}__block-content`,clearPrompt:`${f}__reset-prompt`,clearResultsBlock:`${f}__clear-results-block`,doublePaddingTop:`${f}__double-pad-top`,flow:`${f}__flow`,listContainer:`${f}__list-container`,noticeContainer:`${f}__notice-container`,numberInput:`${f}__number-input`,promptDivider:`${f}__divider`,tabs:`${f}__tabs`};function T(e){return{height:e+"px"}}function k(e){return{width:e+"px"}}function F(){return{width:"75%"}}function C(e){return{width:"100%",height:window.getComputedStyle(e).getPropertyValue("max-height")}}function A(e){return{display:"flex",flexDirection:e}}function R(e){return e instanceof n}const N={noExtension:-2147208474},M=Symbol();let x=class extends u{constructor(e,t){super(e,t),this._activeTab="input",this._activeTrace=null,this._activeSwatch="",this._addNonspatialObjectActive=!1,this._alertRemoveModal=!1,this._assetGroupHeader="",this._assetTypeHeader="",this._confirmReset=!1,this._errorMessage="",this._swatchNode=null,this._selectToolActive=!1,this._showFeatureInfoActive=!1,this._traceHeaderForFlow="",this._traceResultsFunctions=[],this._traceResultsAssetGroup=[],this._traceResultsAssetType=[],this._traceResultsIndividual=[],this._traceResultsState="result",this._warningNoFlag=!1,this._warningNoTraceSelected=!1,this._findNonspatialFeatureWidget=new w({mode:"add-nso"}),this._individualResultNode=null,this._loadUnError=!0,this._resultDisplayField="objectid",this._resultFeatureWidget=new w({mode:"show-feature-info"}),this._resultObjectIdField="objectid",this._resultSortField="objectid",this._resultSortOrder="desc",this._showResultOptions=!1,this._symbolStartFlag=null,this._symbolBarrier=null,this._traceLocationType="starting-point",this._updatingHandles=new l,this._warningNoBarrierAssetFound=!1,this._warningNoBarrierAssetNsoFound=!1,this._warningNoStartAssetFound=!1,this._warningNoStartAssetNsoFound=!1,this._warningNoTerminal=!1,this._wasPopupEnabled=!1,this._watchHandler=null,this.disabled=!0,this.inputSettings=[],this.messages=null,this.messagesCommon=null,this.messagesUnits=null,this.viewModel=new v,this._afterComponentCreate=this._afterComponentCreate.bind(this)}initialize(){this._utilityNetworkTraceInitialized(),this.addHandles([t(()=>this.view,()=>this._viewChangeHandle(),i),t(()=>this.viewModel?.resultAreaProperties,()=>this.scheduleRender()),t(()=>this._addNonspatialObjectActive,e=>{this._findNonspatialFeatureWidget.feature=null,e?this._changeCursor("crosshair"):this.view.popupEnabled=this._wasPopupEnabled}),t(()=>this._showFeatureInfoActive,e=>{e||(this._resultFeatureWidget.feature=null,this.view.popupEnabled=this._wasPopupEnabled)}),s(()=>this._findNonspatialFeatureWidget,"add-nso-trace-location",({featureWidget:e})=>{this.viewModel.addNonspatialTraceLocation(e.graphic,this._traceLocationType),this._warningNoFlag=!1,this._addNonspatialObjectActive=!1}),s(()=>this._findNonspatialFeatureWidget,"close-un-trace-feature-block",()=>{this._changeCursor("default"),this._addNonspatialObjectActive=!1,this.viewModel.cancelAddFlagByHit()}),s(()=>this._resultFeatureWidget,"close-un-trace-feature-block",()=>{this._showFeatureInfoActive=!1}),s(()=>this._resultFeatureWidget,"close",()=>{this._resetResultFeatureWidget()})])}destroy(){this._findNonspatialFeatureWidget?.destroy(),this._resultFeatureWidget?.destroy()}get defaultGraphicColor(){return this.viewModel.defaultGraphicColor}set defaultGraphicColor(e){this.viewModel.defaultGraphicColor=e}get enableResultArea(){return this.viewModel.enableResultArea}set enableResultArea(e){this.viewModel.enableResultArea=e}get flags(){return this.viewModel.flags}set flags(e){this.viewModel.flags=e}get icon(){return"utility-network-trace"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get resultAreaProperties(){return this.viewModel.resultAreaProperties}set resultAreaProperties(e){this.viewModel.resultAreaProperties=e}get selectedTraces(){return this.viewModel.selectedTraces}set selectedTraces(e){this.viewModel.selectedTraces=e}get selectOnComplete(){return this.viewModel.selectOnComplete}set selectOnComplete(e){this.viewModel.selectOnComplete=e}get showGraphicsOnComplete(){return this.viewModel.showGraphicsOnComplete}set showGraphicsOnComplete(e){this.viewModel.showGraphicsOnComplete=e}get showSelectionAttributes(){return this.viewModel.showSelectionAttributes}set showSelectionAttributes(e){this.viewModel.showSelectionAttributes=e}get traceResults(){return this.viewModel.traceResults}get utilityNetwork(){return this.viewModel.utilityNetwork}set utilityNetwork(e){this.viewModel.utilityNetwork=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}async checkCanTrace(){this._confirmReset=!1,this._resetResultFeatureWidget();const e=this.viewModel.checkCanTrace();e.status?(this._warningNoFlag=!1,this._warningNoTraceSelected=!1,this._warningNoTerminal=!1,this._traceResultsState="result",this.switchTab("results"),this.viewModel._activeProgress=!0,this.viewModel.removeAllResultAreaGraphics(),await this.viewModel.callTrace(),this.viewModel._activeProgress=!1):e.issues.forEach(e=>{switch(e){case"noStartingPoints":this._warningNoFlag=!0;break;case"noTerminalSelected":this._warningNoTerminal=!0;break;default:this._warningNoTraceSelected=!0}})}confirmReset(){this._confirmReset=!0}render(){return this._mixCustomStrings(),this._overrideFlagSymbol(),b("div",{class:this.classes(S.base,p.widget,p.panel,{[p.widgetDisabled]:this.disabled})},this._renderUtilityNetworkTrace())}loadDependencies(){return h({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),"action-group":()=>import("@esri/calcite-components/dist/components/calcite-action-group"),"action-pad":()=>import("@esri/calcite-components/dist/components/calcite-action-pad"),block:()=>import("@esri/calcite-components/dist/components/calcite-block"),"block-section":()=>import("@esri/calcite-components/dist/components/calcite-block-section"),button:()=>import("@esri/calcite-components/dist/components/calcite-button"),checkbox:()=>import("@esri/calcite-components/dist/components/calcite-checkbox"),"color-picker-swatch":()=>import("@esri/calcite-components/dist/components/calcite-color-picker-swatch"),combobox:()=>import("@esri/calcite-components/dist/components/calcite-combobox"),"combobox-item":()=>import("@esri/calcite-components/dist/components/calcite-combobox-item"),"dropdown-group":()=>import("@esri/calcite-components/dist/components/calcite-dropdown-group"),"dropdown-item":()=>import("@esri/calcite-components/dist/components/calcite-dropdown-item"),fab:()=>import("@esri/calcite-components/dist/components/calcite-flow"),flow:()=>import("@esri/calcite-components/dist/components/calcite-fab"),"flow-item":()=>import("@esri/calcite-components/dist/components/calcite-flow-item"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),"input-number":()=>import("@esri/calcite-components/dist/components/calcite-input-number"),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"),option:()=>import("@esri/calcite-components/dist/components/calcite-option"),panel:()=>import("@esri/calcite-components/dist/components/calcite-panel"),popover:()=>import("@esri/calcite-components/dist/components/calcite-popover"),scrim:()=>import("@esri/calcite-components/dist/components/calcite-scrim"),select:()=>import("@esri/calcite-components/dist/components/calcite-select"),"split-button":()=>import("@esri/calcite-components/dist/components/calcite-split-button"),tab:()=>import("@esri/calcite-components/dist/components/calcite-tab"),"tab-nav":()=>import("@esri/calcite-components/dist/components/calcite-tab-nav"),"tab-title":()=>import("@esri/calcite-components/dist/components/calcite-tab-title"),tabs:()=>import("@esri/calcite-components/dist/components/calcite-tabs")})}switchTab(e){this._activeTab=e}switchToFromAssetGroup(e,t,s){this._traceHeaderForFlow=t,this._traceResultsAssetGroup=e,this._traceResultsState=s}switchToFromAssetType(e,t,s){this._assetGroupHeader=t,this._traceResultsAssetType=e,this._traceResultsState=s}switchToFromFunctions(e,t){this._traceResultsFunctions=e,this._traceResultsState=t}switchToFromIndividualRecords(e,t,s){this._assetTypeHeader=t,this._traceResultsIndividual=e,this._traceResultsState=s}_renderAddNonspatialLocationBlock(){const{messages:e}=this;return b("calcite-block",{expanded:!0,key:`${this.id}__add-spatial-location-block`,label:e.inputsStrings.addNonspatialOption},this._findNonspatialFeatureWidget.render())}_renderAddSpatialLocationBlock(){const{messages:e,messagesCommon:t}=this;return b("calcite-block",{class:S.blockContent,expanded:!0,heading:"starting-point"===this._traceLocationType?e.inputsStrings.headerStartingPoint:e.inputsStrings.headerBarrier,key:`${this.id}__add-nonspatial-location-block`,label:"starting-point"===this._traceLocationType?e.inputsStrings.headerStartingPoint:e.inputsStrings.headerBarrier},b("calcite-action",{icon:"x",onclick:()=>{this.viewModel.removeClickHandler(),this.view?.popup&&(this.view.popupEnabled=this._wasPopupEnabled),this._changeCursor("default"),this._selectToolActive=!1},slot:"control",text:t.close}),b("calcite-notice",{icon:"starting-point"===this._traceLocationType?"pin-plus":"x-circle-f",kind:"info",open:!0},b("div",{slot:"message"},e.inputsStrings.addPointHint)))}_renderClearTraceResultsBlock(){const{messages:e,messagesCommon:t}=this;return b("calcite-scrim",{key:`${this.id}__clear-results-block`},b("calcite-block",{class:S.clearResultsBlock,expanded:!0},b("h3",null,e.resultsStrings.startOverButton),b("div",null,e.resultsStrings.startOverValidation),b("div",{class:S.promptDivider}),b("div",{styles:A("row")},b("calcite-button",{appearance:"outline",onclick:()=>{this._confirmReset=!1},slot:"secondary",width:"full"},t.cancel),b("calcite-button",{onclick:()=>{this._confirmReset=!1,this.viewModel.reset(),this.switchTab("input")},slot:"primary",width:"full"},t.form.ok))))}_renderExecutingTraceBlock(){const{messages:e}=this;return b("calcite-loader",{label:e.alertsStrings.traceExecuting,text:e.alertsStrings.traceExecuting,type:"indeterminate"})}_renderInputBlock(){const{messages:e}=this;return b("calcite-block",{class:S.blockContainer,expanded:!0,key:`${this.id}__inputs-block`,label:e.inputsStrings.headerTabInputs},b("calcite-flow",{class:S.flow},b("calcite-flow-item",{key:`${this.id}__inputs-flow-item`,selected:!this._selectToolActive&&!this._addNonspatialObjectActive},this._warningNoFlag?this._renderWarningMessage("flag",!0):null,this._warningNoTerminal?this._renderWarningMessage("noTerminal",!0):null,this._warningNoTraceSelected?this._renderWarningMessage("trace",!0):null,this._renderTraceSelectorContainer(),this._renderStartFlagsContainer(),this._renderBarriersFlagsContainer(),this._warningNoFlag&&this._warningNoTraceSelected?b("div",{styles:T(10)}):null,b("calcite-fab",{appearance:"solid",icon:"utility-network-trace",kind:"brand",onclick:()=>{this.checkCanTrace()},slot:"fab",text:e.tracingStrings.runTrace,textEnabled:!0,title:e.tracingStrings.runTrace,type:"button"}))))}_renderInputsTab(){const{messagesCommon:e}=this;let t="input";return this._selectToolActive&&!this._addNonspatialObjectActive&&(t="add-spatial-location"),!this._selectToolActive&&this._addNonspatialObjectActive&&(t="add-nso-location"),this.disabled&&(t="loading"),b("calcite-tab",{key:`${this.id}__inputs-tab-item`,selected:"input"===this._activeTab},"loading"===t?b("calcite-loader",{label:e.loading,type:"indeterminate"}):null,"input"===t?this._renderInputBlock():null,"add-spatial-location"===t?this._renderAddSpatialLocationBlock():null,"add-nso-location"===t?this._renderAddNonspatialLocationBlock():null)}_renderBarriersFlagsContainer(){const{messages:e}=this,t=[];let s=[];s=this.viewModel._flags.filter(e=>"barrier"===e.type),s.forEach(e=>{e.displayValue&&t.push(this._renderFlagRow(e,"barrier"))});let i=null;return this._symbolBarrier&&(i=this._getSymbolIcon(this._symbolBarrier)),b("calcite-block",{class:S.blockContent,collapsible:!0,expanded:!0,heading:e.inputsStrings.headerBarrier+" ("+s.length+")",overlayPositioning:"fixed"},b("div",{slot:"icon"},i||b("calcite-icon",{icon:"x-circle-f",scale:"s"})),b("div",null,e.inputsStrings.barrierPointHint),b("div",{class:S.listContainer},t),this._warningNoBarrierAssetFound?this._renderWarningMessage("noBarrierAsset",!0):null,this._warningNoBarrierAssetNsoFound?this._renderWarningMessage("noBarrierAssetNso",!0):null,b("div",{class:S.addButtonContainer},b("calcite-split-button",{appearance:"outline-fill",primaryIconStart:"select",primaryText:e.inputsStrings.addPointOption,onCalciteSplitButtonPrimaryClick:()=>{this._setupAddTraceLocation("barrier")}},b("calcite-dropdown-group",{selectionMode:"none"},b("calcite-dropdown-item",{onCalciteDropdownItemSelect:()=>{this._setupAddNonspatialObject("barrier")}},e.inputsStrings.addNonspatialOption)))))}_renderFlagRow(e,t){const{messages:s,messagesCommon:i}=this,r=[];let o=!1;return null!=e.allTerminals&&e.allTerminals.terminals.length>0&&(o=!0,e.allTerminals.terminals.forEach(t=>{let s=!1;e?.selectedTerminals?.includes(t.id)&&(s=!0),r.push(b("calcite-combobox-item",{key:t.name,selected:s,textLabel:t.name,value:t.id}))})),b("calcite-block",{collapsible:null!==e.allTerminals||"barrier"===e.type,heading:e.displayValue?.value??"",key:"pop"+e.globalId+e.type+e.id+t,overlayPositioning:"fixed"},b("calcite-action",{icon:"trash",label:i.remove,onclick:()=>{this.viewModel.removeFlag(e)},scale:"s",slot:"header-menu-actions",text:i.remove,textEnabled:!0}),e.mapGraphic&&e.mapPoint?b("calcite-action",{icon:"zoom-to-object",label:s.globalStrings.zoomToFeature,onclick:()=>{this.viewModel.zoomToAsset(e.details.geometry)},scale:"s",slot:"header-menu-actions",text:s.globalStrings.zoomToFeature,textEnabled:!0}):null,"barrier"===e.type?b("calcite-label",{layout:"inline",scale:"s"},b("calcite-checkbox",{checked:e.isFilterBarrier,onclick:()=>{this.viewModel.manageFilterBarrier(!e.isFilterBarrier,e)},scale:"s"}),s.inputsStrings.barrierFilter):null,o?b("calcite-combobox",{label:s.globalStrings.selectTerminalPlaceholder,maxItems:0,overlayPositioning:"fixed",placeholder:s.globalStrings.selectTerminalPlaceholder,scale:"s",selectionMode:"multiple",onCalciteComboboxChange:t=>{t.currentTarget.selectedItems.length>0?(e.selectedTerminals=[],t.currentTarget.selectedItems.forEach(t=>{this.viewModel.addTerminal(t.value,e)})):e.selectedTerminals=[]},onCalciteComboboxChipClose:t=>{t.preventDefault(),this.viewModel.removeTerminal(t.currentTarget.value,e)}},r):null)}_renderHighlightColorPicker(e,t,s){const{messages:i}=this,{graphicHandler:r}=this.viewModel,o=[],a=new RegExp(`^${e.hex}$`,"i"),l=r.highlightColor.length>y.length?5:4;for(const n of r.highlightColor)o.push(b("calcite-action",{active:a.test(n.hex),key:n.hex,label:i.resultsStrings.graphicColor,onclick:()=>{"aggregate"===s?this.viewModel.changeResultGraphicColor(n,t):this.viewModel.changeResultAreaColor(t,n)},scale:"s",text:i.resultsStrings.graphicColor},b("calcite-color-picker-swatch",{active:a.test(n.hex),color:n.hex,scale:"s"})));return b("calcite-action-pad",{expandDisabled:!0,layout:"grid",position:"start"},b("calcite-action-group",{columns:l},o))}_renderRemoveTraceContainer(e){const{messages:t}=this;return b("calcite-action",{icon:"trash",label:t.globalStrings.clearResults,onclick:()=>{this._alertRemoveModal=!0,this._activeTrace=e.trace},scale:"s",slot:"header-menu-actions",text:t.globalStrings.clearResults,textEnabled:!0})}_renderResultsTab(){let e="results";return this._showFeatureInfoActive&&(e="show-feature-info"),this.viewModel._activeProgress&&(e="executing"),this._confirmReset&&(e="clear-trace-results"),b("calcite-tab",{key:`${this.id}__results-tab-item`},"executing"===e?this._renderExecutingTraceBlock():null,"results"===e?this.viewModel.traceResults.length?this._renderResultsPanel():this._renderWarningMessage("noTraceExecuted",!1):null,"show-feature-info"===e?this._renderShowFeatureInfoBlock():null,"clear-trace-results"===e?this._renderClearTraceResultsBlock():null)}_renderResultsPanel(){const{messages:e}=this;return b("calcite-block",{class:S.blockContainer,expanded:!0,key:`${this.id}__results-block`,label:e.resultsStrings.headerTabResults},b("calcite-flow",{class:S.flow},this._renderTraceResults(),this._renderTraceResultFunctions(),this._renderTraceResultByAssetGroup(),this._renderTraceResultByAssetType(),this._renderTraceResultIndividual()))}_renderResultRowFunctions(e){return b("calcite-block",{collapsible:!1,heading:e.networkAttributeName+" "+e.functionType+" = "+e.result,overlayPositioning:"fixed"})}_renderResultRowAssetGroup(e){const t=this._getAssetGroupName(e[0]);return b("calcite-list-item",{key:`${t}-${e.assetGroupCode}`,label:t+" ("+e.length+")",onCalciteListItemSelect:()=>{this.switchToFromAssetType(this._groupResultsByAssetType(e),t+" ("+e.length+")","assetType")}},b("calcite-icon",{icon:"chevron-right",scale:"s",slot:"content-end"}))}_renderResultRowAssetType(e){const t=this._getAssetTypeName(e[0]);return b("calcite-list-item",{key:`${t}-${e.assetTypeCode}`,label:t+" ("+e.length+")",onCalciteListItemSelect:()=>{this._updatingHandles.addPromise(this.viewModel.queryFeaturesById(e).then(s=>{if(s?.length){this._resultObjectIdField=s[0].layer.objectIdField,"objectid"===this._resultDisplayField&&(this._resultDisplayField=s[0].layer.objectIdField),"objectid"===this._resultSortField&&(this._resultSortField=s[0].layer.objectIdField);const i=this._appendAttributes(e,s,"objectId");this.switchToFromIndividualRecords(i,t+" ("+e.length+")","records")}else this.switchToFromIndividualRecords(e,t+" ("+e.length+")","records")}))}},b("calcite-icon",{icon:"chevron-right",scale:"s",slot:"content-end"}))}_renderResultRowIndividual(e){const{messages:t}=this;let s,i=null;if(i=e?.details?.fields.find(({name:e})=>e===this._resultDisplayField),"date"===i?.type){s=new Date(e.details.attributes[this._resultDisplayField]).toDateString()}else if("assetgroup"===this._resultDisplayField.toLowerCase())s=this._getAssetGroupName(e);else if("assettype"===this._resultDisplayField.toLowerCase())s=this._getAssetTypeName(e);else if(i?.domain&&R(i.domain)){const t=i.domain.codedValues.find(({code:t})=>t===e.details.attributes[this._resultDisplayField]);s=t?.name}else s=e.details?.attributes[this._resultDisplayField]??e.objectId;return s&&""!==s&&null!==s?"string"==typeof s&&(s.trim()||(s=t.resultsStrings.noValue)):s=t.resultsStrings.noValue,b("calcite-list-item",{key:e.details.uid,label:s,onCalciteListItemSelect:async()=>{this._disablePopup(),this._showFeatureInfoActive=!0;const t=c(e.details?.layer)?e.details?.layer:null;if(t){const s=Object.keys(e.details.attributes).find(e=>e.toLowerCase()===t.subtypeField.toLowerCase())??"assetgroup",i=t.sublayers.find(t=>t.subtypeCode===e.details.attributes[s]),r=Object.keys(e.details.attributes).find(e=>e.toLowerCase()===t.objectIdField.toLowerCase())??"objectid",o=new d;o.outFields=["*"],o.returnGeometry=!0,o.where=r+" = "+e.details.attributes[r];const a=await(i?.queryFeatures(o));a&&this._resultFeatureWidget.open(a.features[0])}else this._resultFeatureWidget.open(e.details)}},b("calcite-icon",{icon:"chevron-right",scale:"s",slot:"content-end"}))}_renderShowFeatureInfoBlock(){const{messages:e}=this;return b("calcite-block",{class:S.blockContainer,expanded:!0,key:`${this.id}__show-feature-info-block`,label:e.resultsStrings.headerFeatureInfo},this._resultFeatureWidget.render())}_renderStartFlagsContainer(){const{messages:e}=this,t=[];let s=[];s=this.viewModel._flags.filter(e=>"starting-point"===e.type),s.forEach(e=>{e.displayValue&&t.push(this._renderFlagRow(e,"start"))});let i=null;return this._symbolStartFlag&&(i=this._getSymbolIcon(this._symbolStartFlag)),b("calcite-block",{class:S.blockContent,collapsible:!0,expanded:!0,heading:e.inputsStrings.headerStartingPoint+" ("+s.length+")",overlayPositioning:"fixed"},b("div",{slot:"icon"},i||b("calcite-icon",{icon:"pin",scale:"s"})),b("div",null,e.inputsStrings.startingPointHint),b("div",{class:S.listContainer},t),this._warningNoStartAssetFound?this._renderWarningMessage("noStartAsset",!0):null,this._warningNoStartAssetNsoFound?this._renderWarningMessage("noStartAssetNso",!0):null,b("div",{class:S.addButtonContainer},b("calcite-split-button",{appearance:"outline-fill",primaryIconStart:"select",primaryText:e.inputsStrings.addPointOption,onCalciteSplitButtonPrimaryClick:()=>{this._setupAddTraceLocation("starting-point")}},b("calcite-dropdown-group",{selectionMode:"none"},b("calcite-dropdown-item",{onCalciteDropdownItemSelect:()=>{this._setupAddNonspatialObject("starting-point")}},e.inputsStrings.addNonspatialOption)))))}_renderStartOverContainer(){const{messages:e}=this;return b("calcite-fab",{appearance:"solid",icon:"trash",kind:"brand",onclick:()=>{this.confirmReset()},slot:"fab",text:e.resultsStrings.startOverButton,textEnabled:!0,title:e.resultsStrings.startOverButton,type:"button"})}_renderTraceResultByAssetGroup(){const e=this._traceResultsAssetGroup,t=[];for(const s in e){const i=e[s];for(const e in i)t.push(this._renderResultRowAssetGroup(i[e]))}return b("calcite-flow-item",{heading:this._traceHeaderForFlow,key:"assetGroupResultMultiple",selected:"assetGroup"===this._traceResultsState,onCalciteFlowItemBack:()=>{this.switchToFromAssetGroup([],"","result")}},b("calcite-list",{label:""},t),this._renderStartOverContainer())}_renderTraceResultByAssetType(){const e=this._traceResultsAssetType,t=[];for(const s in e)e[s].length>0&&t.push(this._renderResultRowAssetType(e[s]));return b("calcite-flow-item",{heading:this._assetGroupHeader,key:"assetTypeResult",loading:this._updatingHandles.updating,selected:"assetType"===this._traceResultsState,onCalciteFlowItemBack:()=>{this.switchToFromAssetType([],"","assetGroup")}},b("calcite-list",{label:"",selectionMode:"none"},t),this._renderStartOverContainer())}_renderTraceResultFunctions(){if("functions"!==this._traceResultsState)return null;const{messages:e}=this,t=this._traceResultsFunctions,s=[];return t.forEach(e=>{s.push(this._renderResultRowFunctions(e))}),b("calcite-flow-item",{heading:e.resultsStrings.functionHeader,key:"functionResultMultiple",selected:"functions"===this._traceResultsState,onCalciteFlowItemBack:()=>{this.switchToFromFunctions([],"result")}},s,this._renderStartOverContainer())}_renderTraceResultIndividual(){const{messages:e}=this,t=this._traceResultsIndividual;t.sort(this._compare(this._resultSortField,this._resultSortOrder));const s=[];if(t.length>0){(t[0].details?.fields.some(({name:e})=>e.toLowerCase()===this._resultDisplayField.toLocaleLowerCase())??!1)||(this._resultDisplayField=this._resultObjectIdField,this._resultSortField=this._resultObjectIdField),t.forEach(e=>{e?.details&&s.push(this._renderResultRowIndividual(e))}),0===s.length&&s.push(b("calcite-list-item",{label:e.resultsStrings.noFeaturesInMap}))}return b("calcite-flow-item",{heading:this._assetTypeHeader,key:"individualResult",selected:"records"===this._traceResultsState,onCalciteFlowItemBack:()=>{this._showResultOptions=!1,this.switchToFromIndividualRecords([],"","assetType")}},b("calcite-action",{afterCreate:g,bind:this,"data-node-ref":"_individualResultNode",icon:"gear",id:"field_options"+this.id,label:e.resultsStrings.displayAttribute,onclick:()=>{this._showResultOptions=!0},slot:"header-actions-end",text:e.resultsStrings.displayAttribute}),this._renderTraceResultIndividualPopover(),b("calcite-list",{label:"",selectionMode:"none"},s),this._renderStartOverContainer())}_renderTraceResultIndividualPopover(){const{messages:e}=this,t=this._traceResultsIndividual,s=[],i=[];return t.length>0&&(t[0].details?t[0].details.fields.forEach(({name:e,alias:t})=>{s.push(b("calcite-option",{key:`display-${e}`,label:t??e,selected:e===this._resultDisplayField,value:e})),i.push(b("calcite-option",{key:`sort-${e}`,label:t??e,selected:e===this._resultSortField,value:e}))}):(s.push(b("calcite-option",{key:`display-${this._resultDisplayField}`,label:this._resultDisplayField,value:this._resultDisplayField})),i.push(b("calcite-option",{key:`sort-${this._resultDisplayField}`,label:this._resultDisplayField,value:this._resultDisplayField})))),b("calcite-popover",{autoClose:!0,label:e.resultsStrings.displayAttribute,offsetDistance:0,offsetSkidding:0,open:this._showResultOptions,overlayPositioning:"fixed",placement:"left-start",referenceElement:this._individualResultNode,styles:null!==this.domNode?k(.75*this.domNode.clientWidth):F()},b("calcite-block",{expanded:!0,label:e.resultsStrings.displayAttribute,overlayPositioning:"fixed"},b("calcite-label",{scale:"s"},e.resultsStrings.displayAttribute,b("calcite-select",{label:e.resultsStrings.displayAttribute,scale:"s",onCalciteSelectChange:e=>{const t=e.currentTarget;this._resultDisplayField=t.selectedOption.value,this._showResultOptions=!1}},s)),b("calcite-label",{scale:"s"},e.resultsStrings.sortBy,b("calcite-select",{label:e.resultsStrings.sortBy,scale:"s",onCalciteSelectChange:e=>{const s=e.currentTarget;this._resultSortField=s.selectedOption.value,t.sort(this._compare(this._resultSortField,this._resultSortOrder)),this._traceResultsIndividual=t,this._showResultOptions=!1}},i))))}_renderTraceResults(){const{messages:e,messagesCommon:t}=this,{selectFeatures:s}=e.resultsStrings,i=this.viewModel.traceResults,r=[];return i.forEach((t,i)=>{let o=[],a=[],l=!1,n=!1,c=!1,d="";null!==t.results&&t.results.hasOwnProperty("elements")?(null!==t.results.aggregatedGeometry&&(n=!0),null!==t.results.globalFunctionResults&&t.results.globalFunctionResults.length>0&&(a=t.results.globalFunctionResults,a.length>0&&(c=!0)),t.results.elements&&t.results.elements.length>0&&(o=t.results.elements,o.length>0&&(l=!0)),(n||l)&&(d=this.messagesUnits.units[t.resultArea?.unit]?.abbr),r.push(b("calcite-block",{class:S.blockContent,collapsible:!0,description:t.trace.description??"",expanded:!0,heading:t.trace.title,key:`${t.trace.title}${i}`,overlayPositioning:"fixed"},this._renderRemoveTraceContainer(t),b("calcite-list",{label:""},c?b("calcite-list-item",{label:e.resultsStrings.functionHeader+" ("+a.length+")",onCalciteListItemSelect:()=>{this.switchToFromFunctions(a,"functions")}},b("calcite-icon",{icon:"chevron-right",scale:"s",slot:"content-end"})):null,l&&this.viewModel.showSelectionAttributes?b("calcite-list-item",{key:this.id,label:e.resultsStrings.viewFeatures+" ("+o.length+")",onCalciteListItemSelect:()=>{this.switchToFromAssetGroup(this._groupResultsByAssetGroup(t),t.trace.title+" ("+o.length+")","assetGroup")}},b("calcite-icon",{icon:"chevron-right",scale:"s",slot:"content-end"})):this.viewModel.showSelectionAttributes?b("calcite-label",{layout:"inline",scale:"s"},e.resultsStrings.noSelectionResults):null),l?b("div",{class:S.doublePaddingTop},b("calcite-label",{layout:"inline",onclick:e=>{e.preventDefault(),e.stopPropagation(),this.viewModel.mergeSelection(!t.selectionEnabled,t.trace)},scale:"s"},b("calcite-checkbox",{checked:t.selectionEnabled,onclick:e=>{e.preventDefault(),e.stopPropagation(),this.viewModel.mergeSelection(!t.selectionEnabled,t.trace)}}),this.viewModel.showSelectionAttributes?s:`${s} (${o.length})`)):null,n?b("calcite-block-section",{expanded:t.graphicEnabled,key:`aggregate-${t.trace.title}-${i}`,text:e.resultsStrings.highlightTrace,toggleDisplay:"switch",onCalciteBlockSectionToggle:e=>{e.currentTarget.expanded?this.viewModel.changeResultGraphicColor(t.graphicColor,t):this.viewModel.removeResultGraphicFromView(t)}},b("calcite-list",{label:e.resultsStrings.graphicColor,selectionMode:"none"},b("calcite-list-item",{label:e.resultsStrings.graphicColor,onclick:e=>{this._swatchNode=e.currentTarget,this._activeSwatch="aggGeom_"+i}},b("calcite-color-picker-swatch",{color:t.graphicColor.hex,scale:"s",slot:"actions-end"})))):null,this.enableResultArea&&(n||l)?b("calcite-block-section",{expanded:t.resultArea?.show,key:`area-${t.trace.title}-${i}`,text:e.resultsStrings.resultAreaHeader,toggleDisplay:"switch",onCalciteBlockSectionToggle:e=>{e.currentTarget.expanded?t.resultAreaGraphic?this.viewModel.addResultAreaToMap(t,t.resultAreaGraphic):this.viewModel.addResultAreaToMap(t):this.viewModel.removeResultAreaFromMap(t)}},b("calcite-list",{label:"",selectionMode:"none"},b("calcite-list-item",{label:e.resultsStrings.graphicColor,onclick:e=>{const t=e.currentTarget;this._swatchNode=t,this._activeSwatch="resultArea_"+i}},b("calcite-color-picker-swatch",{color:t.resultArea?.color.hex,scale:"s",slot:"actions-end"}))),b("calcite-list",{label:"",selectionMode:"none"},b("calcite-list-item",{label:e.resultsStrings.resultAreaBuffer},b("calcite-input-number",{afterCreate:this._afterComponentCreate,class:S.numberInput,max:999999,min:0,scale:"s",slot:"actions-end",suffixText:d,value:t.resultArea?.distance.toString(),onCalciteInputNumberChange:e=>{if(!this.view?.popup)return;this.view.popup.visible&&this.view.closePopup();const s=e.currentTarget;t.resultArea.distance>=0?(t.resultArea.distance=parseInt(s.value,10),this.viewModel.removeResultAreaFromMap(t),this.viewModel.addResultAreaToMap(t)):(t.resultArea.distance=0,this.viewModel.removeResultAreaFromMap(t),this.viewModel.addResultAreaToMap(t))}})))):null,b("calcite-popover",{autoClose:!0,closable:!0,label:e.resultsStrings.graphicColor,offsetDistance:0,offsetSkidding:0,open:this._activeSwatch==="aggGeom_"+i||this._activeSwatch==="resultArea_"+i,overlayPositioning:"fixed",placement:"auto-start",referenceElement:this._swatchNode,scale:"s",onCalcitePopoverClose:()=>{this._swatchNode=null,this._activeSwatch=null}},this._renderHighlightColorPicker(this._activeSwatch==="resultArea_"+i?t.resultArea?.color:t.graphicColor,t,this._activeSwatch==="resultArea_"+i?"resultArea":"aggregate"))))):r.push(b("calcite-block",{collapsible:!1,expanded:!0,heading:t.trace.title,key:"error-"+i,overlayPositioning:"fixed"},this._renderRemoveTraceContainer(t),this._renderWarningMessage("noController",!1,t.status)))}),b("calcite-flow-item",{key:"traceResults",selected:"result"===this._traceResultsState},r,this._renderStartOverContainer(),this._alertRemoveModal?b("calcite-scrim",{key:"prompt"},b("div",{class:S.clearPrompt},b("h3",{slot:"header"},e.globalStrings.clearResults),b("div",{slot:"content"},e.alertsStrings.clearResultsAlert),b("div",{class:S.promptDivider}),b("div",{styles:A("row")},b("calcite-button",{appearance:"outline",onclick:()=>{this._alertRemoveModal=!1},slot:"secondary",width:"full"},t.cancel),b("calcite-button",{onclick:()=>{this._activeTrace&&this.viewModel.clearResult(this._activeTrace),this._alertRemoveModal=!1,0===this.viewModel.traceResults.length?this.switchTab("input"):(this._activeTrace=this.viewModel.traceResults[0].trace,this._traceResultsState="result")},slot:"primary",width:"full"},t.form.ok)))):null)}_renderTraceSelectorContainer(){const{messages:e}=this,t=this.viewModel.traces.map(e=>this._renderComboboxItem({value:e.globalId,text:e.title,selected:e.selected??!1})),s=this.viewModel.traces.filter(e=>e.selected),i=e.tracingStrings.traceOperation+` (${s.length})`;return b("calcite-block",{class:S.blockContent,collapsible:!0,expanded:!0,heading:i,overlayPositioning:"fixed"},b("calcite-icon",{icon:"utility-network-trace",scale:"s",slot:"icon"}),b("calcite-combobox",{label:e.inputsStrings.selectTraces,maxItems:0,overlayPositioning:"fixed",placeholder:e.inputsStrings.selectTraces,scale:"s",selectionMode:"multiple",onCalciteComboboxChange:e=>{this.viewModel.traces.forEach(t=>{t.selected=e.currentTarget.selectedItems.some(e=>e.value===t.globalId)}),e.currentTarget.selectedItems.length&&(this._warningNoTraceSelected=!1)}},t))}_renderUtilityNetworkTrace(){const{viewModel:e,viewModel:{utilityNetwork:t}}=this,s=e.view?.map,{messages:i}=this;let r=b("calcite-tabs",{class:S.tabs,layout:"center",position:"top",styles:C(this.container)},b("calcite-tab-nav",{slot:"title-group"},b("calcite-tab-title",{onclick:()=>{this.switchTab("input")},selected:"input"===this._activeTab},i.inputsStrings.headerTabInputs),b("calcite-tab-title",{onclick:()=>{this.switchTab("results")},selected:"results"===this._activeTab},i.resultsStrings.headerTabResults)),this._renderInputsTab(),this._renderResultsTab());return(!s.utilityNetworks?.length&&!t||t&&!t.sharedNamedTraceConfigurations.length)&&(r=b("calcite-panel",null,this._renderWarningMessage("noTraceConfig",!1))),this._loadUnError||(r=b("calcite-panel",null,this._renderWarningMessage("loadUNError",!1,this._errorMessage))),r}_renderWarningMessage(e,t,s){const{messages:i}=this;let r=i.alertsStrings.NoRunAlertHeader,o=i.alertsStrings.noResultsInfo;switch(e){case"flag":r=i.alertsStrings.startingPointAlertHeader,o=i.alertsStrings.startingPointAlert;break;case"noTerminal":r=i.alertsStrings.noTerminalDefinedHeader,o=i.alertsStrings.noTerminalDefined;break;case"trace":r=i.alertsStrings.selectTraceAlertHeader,o=i.alertsStrings.selectTraceAlert;break;case"noTraceExecuted":r=i.alertsStrings.NoRunAlertHeader,o=i.alertsStrings.noResultsInfo;break;case"noBarrierAsset":case"noStartAsset":r=i.alertsStrings.noAssetsFoundHeader,o=i.alertsStrings.noAssetFound;break;case"noBarrierAssetNso":case"noStartAssetNso":r="",o=i.alertsStrings.noAssetFound;break;case"noTraceConfig":r="",o=i.alertsStrings.noTraceSupported;break;default:r=i.alertsStrings.genericErrorHeader,o=s||""}return b("div",{class:S.noticeContainer,key:e},b("calcite-notice",{closable:t,icon:!0,key:e,kind:"danger",open:!0,scale:"s",width:"auto",onCalciteNoticeClose:()=>this._handleWarningNoticeClose(e)},b("div",{slot:"title"},r),b("div",{slot:"message"},o)))}_afterComponentCreate(e){"value"in e&&null!=e.value&&"setNumberValue"in e&&e.setNumberValue({committing:!1,value:e.value,origin:"direct"})}_appendAttributes(e,t,s){const i=[];return e.forEach(e=>{t.forEach(t=>{t.featureSet.features.forEach(r=>{e[s]===r.attributes[this._resultObjectIdField]&&(e.details=r,e.details.fields=t.featureSet.fields,i.push(e))})})}),i}_changeCursor(e="default"){this.removeHandles(M),this.view&&"default"!==e&&this.addHandles(this.view.acquireCursor(e),M)}_disablePopup(){const{view:e}=this;e.popupEnabled=!1,e.closePopup()}_compare(e,t){return(s,i)=>{let r=0,o=s.details?.attributes[e]??s.objectId,a=i.details?.attributes[e]??i.objectId;return isNaN(o)&&(o=o.toLowerCase()),isNaN(a)&&(a=a.toLowerCase()),"desc"===t?o>a?r=1:o<a&&(r=-1):o<a?r=1:o>a&&(r=-1),r}}_getAssetGroupName(e){let t=e.assetGroupCode.toString();const s=e.assetGroupCode,i=this.viewModel.getValidSources().find(t=>t.sourceId===e.networkSourceId);if(i){const e=i.assetGroups.find(e=>e.assetGroupCode===s);e&&(t=e.assetGroupName)}return t}_getAssetTypeName(e){let t=e.assetTypeCode.toString();const s=e.assetGroupCode,i=this.viewModel.getValidSources().find(t=>t.sourceId===e.networkSourceId);if(i){const r=i.assetGroups.find(e=>e.assetGroupCode===s);if(r){const s=r.assetTypes.find(t=>t.assetTypeCode===e.assetTypeCode);s&&(t=s.assetTypeName)}}return t}_getSymbolIcon(e){return"picture-marker"===e.type?b("img",{height:e.height,src:e.url??void 0,width:e.width}):null}_groupBy(e,t){return e.reduce((e,s)=>((e[s[t]]=e[s[t]]||[]).push(s),e),{})}_groupResultsByAssetGroup(e){const t=[],s=e.results?.elements,i=this._groupBy(s??[],"networkSourceId");for(const r in i)t.push(this._groupBy(i[r],"assetGroupCode"));return t}_groupResultsByAssetType(e){return this._groupBy(e,"assetTypeCode")}_handleWarningNoticeClose(e){switch(e){case"flag":this._warningNoFlag=!1;break;case"noTerminal":this._warningNoTerminal=!1;break;case"trace":this._warningNoTraceSelected=!1;break;case"noStartAsset":this._warningNoStartAssetFound=!1;break;case"noStartAssetNso":this._warningNoStartAssetNsoFound=!1;break;case"noBarrierAsset":this._warningNoBarrierAssetFound=!1;break;case"noBarrierAssetNso":this._warningNoBarrierAssetNsoFound=!1}}_mixCustomStrings(){const{messages:e}=this;this.inputSettings.length>0&&this.inputSettings.forEach(t=>{"starting-point"===t.type&&(e.inputsStrings.headerStartingPoint=t.label,e.inputsStrings.startingPointHint=t.description),"barrier"===t.type&&(e.inputsStrings.headerBarrier=t.label,e.inputsStrings.barrierPointHint=t.description)})}_overrideFlagSymbol(){this.inputSettings.length>0&&this.inputSettings.forEach(e=>{"starting-point"===e.type?this._symbolStartFlag=e.symbol:this._symbolBarrier=e.symbol,this.viewModel.changeFlagSymbol(e.type,e.symbol)})}_processFlagOnLoad(){return this.view?.when().then(()=>{this._watchHandler=r(()=>!this.view?.updating,async()=>{this._warningNoFlag=!1,this._warningNoBarrierAssetFound=!1,this._warningNoStartAssetFound=!1;const e=await this.viewModel.addFlagsOnLoad();this.viewModel.removeFlagsOnLoadWatcher(),e.includes("barrier")&&(this._warningNoBarrierAssetFound=!0),e.includes("starting-point")&&(this._warningNoStartAssetFound=!0),this.disabled=!1,null!==this._watchHandler&&this._watchHandler.remove()})})}_registerWatchers(){this.addHandles([t(()=>this.selectedTraces,()=>{this.viewModel.selectTracesOnLoad(),this.scheduleRender()}),t(()=>this.defaultGraphicColor,()=>{this.viewModel.traceResults.length>0&&this.viewModel.traceResults.forEach(e=>{this.viewModel.changeResultGraphicColor(this.viewModel.defaultGraphicColor,e)}),this.scheduleRender()})])}_renderComboboxItem({text:e,value:t,selected:s}){return b("calcite-combobox-item",{key:t,selected:s,textLabel:e,value:t})}_resetResultFeatureWidget(){this._showFeatureInfoActive=!1,this._resultFeatureWidget.feature=null,this.view.popupEnabled=this._wasPopupEnabled}_resetTraceLocationWarnings(){this._warningNoBarrierAssetFound=!1,this._warningNoBarrierAssetNsoFound=!1,this._warningNoStartAssetFound=!1,this._warningNoStartAssetNsoFound=!1}_setupAddNonspatialObject(e){this._disablePopup(),this._traceLocationType=e,this._addNonspatialObjectActive=!0,this._resetTraceLocationWarnings(),this.viewModel.getNonspatialTraceLocationInitialFeature().then(e=>{this._findNonspatialFeatureWidget.feature=null;const t=e.graphic;this._findNonspatialFeatureWidget.open(t)}).catch(()=>{this._warningNoStartAssetNsoFound="starting-point"===e,this._warningNoBarrierAssetNsoFound="barrier"===e,this._addNonspatialObjectActive=!1}).finally(()=>this._changeCursor("default"))}_setupAddTraceLocation(e){this._traceLocationType=e,this._changeCursor("crosshair"),this._selectToolActive=!0,this._addNonspatialObjectActive=!1,this._resetTraceLocationWarnings(),this.viewModel.addFlagByHit(this._traceLocationType,this._symbolStartFlag).then(e=>{this._changeCursor("default"),e?this._warningNoFlag=!1:(this._warningNoStartAssetFound="starting-point"===this._traceLocationType,this._warningNoBarrierAssetFound="barrier"===this._traceLocationType),this._selectToolActive=!1})}_utilityNetworkTraceInitialized(){this.viewModel.loadUtilityNetwork().then(async e=>{e&&(this.viewModel.selectTracesOnLoad(),this._registerWatchers(),this.viewModel.flags.length>0&&await this._processFlagOnLoad()),this.disabled=!1}).catch(e=>{const{messages:t}=this;this._loadUnError=!1,"utility-network:no-user-type-extension"===e.name||e.details.raw?.extendedCode===N.noExtension?this._errorMessage=t.alertsStrings.noUserExtension:this._errorMessage=e.message,this.disabled=!1})}_viewChangeHandle(){this._wasPopupEnabled=this.view?.popupEnabled??!1,this._findNonspatialFeatureWidget.view=this.view,this._resultFeatureWidget.view=this.view}};e([o()],x.prototype,"_activeTab",void 0),e([o()],x.prototype,"_activeTrace",void 0),e([o()],x.prototype,"_activeSwatch",void 0),e([o()],x.prototype,"_addNonspatialObjectActive",void 0),e([o()],x.prototype,"_alertRemoveModal",void 0),e([o()],x.prototype,"_assetGroupHeader",void 0),e([o()],x.prototype,"_assetTypeHeader",void 0),e([o()],x.prototype,"_confirmReset",void 0),e([o()],x.prototype,"_errorMessage",void 0),e([o()],x.prototype,"_swatchNode",void 0),e([o()],x.prototype,"_selectToolActive",void 0),e([o()],x.prototype,"_showFeatureInfoActive",void 0),e([o()],x.prototype,"_traceHeaderForFlow",void 0),e([o()],x.prototype,"_traceResultsFunctions",void 0),e([o()],x.prototype,"_traceResultsAssetGroup",void 0),e([o()],x.prototype,"_traceResultsAssetType",void 0),e([o()],x.prototype,"_traceResultsIndividual",void 0),e([o()],x.prototype,"_traceResultsState",void 0),e([o()],x.prototype,"_warningNoFlag",void 0),e([o()],x.prototype,"_warningNoTraceSelected",void 0),e([o()],x.prototype,"_updatingHandles",void 0),e([o()],x.prototype,"defaultGraphicColor",null),e([o()],x.prototype,"disabled",void 0),e([o()],x.prototype,"enableResultArea",null),e([o()],x.prototype,"flags",null),e([o()],x.prototype,"icon",null),e([o()],x.prototype,"inputSettings",void 0),e([o()],x.prototype,"label",null),e([o(),m("esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace")],x.prototype,"messages",void 0),e([o(),m("esri/t9n/common")],x.prototype,"messagesCommon",void 0),e([o(),m("esri/core/t9n/Units")],x.prototype,"messagesUnits",void 0),e([o()],x.prototype,"resultAreaProperties",null),e([o()],x.prototype,"selectedTraces",null),e([o()],x.prototype,"selectOnComplete",null),e([o()],x.prototype,"showGraphicsOnComplete",null),e([o()],x.prototype,"showSelectionAttributes",null),e([o({readOnly:!0})],x.prototype,"traceResults",null),e([o()],x.prototype,"utilityNetwork",null),e([o()],x.prototype,"view",null),e([_(["add-flag","add-flag-complete","add-flag-error","select-features","clear-selection","add-result-area","remove-result-area","create-result-area","reset"]),o({type:v})],x.prototype,"viewModel",void 0),x=e([a("esri.widgets.UtilityNetworkTrace")],x);const I=x;export{I as default};
|
|
5
|
+
import{__decorate as e}from"tslib";import{watch as t,on as s,initial as i,when as r}from"../core/reactiveUtils.js";import{property as o}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{subclass as a}from"../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as l}from"../core/support/UpdatingHandles.js";import n from"../layers/support/CodedValueDomain.js";import{isSubtypeGroupLayer as c}from"../layers/support/layerUtils.js";import d from"../rest/support/Query.js";import u from"./Widget.js";import{loadCalciteComponents as h}from"./support/componentsUtils.js";import{globalCss as p}from"./support/globalCss.js";import{messageBundle as g,vmEvent as m,tsx as _}from"./support/widget.js";import{storeNode as b}from"./support/widgetUtils.js";import w from"./UtilityNetworkTrace/UtilityNetworkTraceFeature.js";import v from"./UtilityNetworkTrace/UtilityNetworkTraceViewModel.js";import{defaultSwatchColors as y}from"./UtilityNetworkTrace/support/GraphicHandler.js";const f="esri-utility-network-trace",S={base:f,addButtonContainer:`${f}__add-button-container`,blockContainer:`${f}__block-container`,blockContent:`${f}__block-content`,clearPrompt:`${f}__reset-prompt`,clearResultsBlock:`${f}__clear-results-block`,doublePaddingTop:`${f}__double-pad-top`,flow:`${f}__flow`,listContainer:`${f}__list-container`,noticeContainer:`${f}__notice-container`,numberInput:`${f}__number-input`,promptDivider:`${f}__divider`,tabs:`${f}__tabs`};function T(e){return{height:e+"px"}}function k(e){return{width:e+"px"}}function F(){return{width:"75%"}}function C(e){return{width:"100%",height:window.getComputedStyle(e).getPropertyValue("max-height")}}function A(e){return{display:"flex",flexDirection:e}}function R(e){return e instanceof n}const N={noExtension:-2147208474},M=Symbol();let x=class extends u{constructor(e,t){super(e,t),this._activeTab="input",this._activeTrace=null,this._activeSwatch="",this._addNonspatialObjectActive=!1,this._alertRemoveModal=!1,this._assetGroupHeader="",this._assetTypeHeader="",this._confirmReset=!1,this._errorMessage="",this._swatchNode=null,this._selectToolActive=!1,this._showFeatureInfoActive=!1,this._traceHeaderForFlow="",this._traceResultsFunctions=[],this._traceResultsAssetGroup=[],this._traceResultsAssetType=[],this._traceResultsIndividual=[],this._traceResultsState="result",this._warningNoFlag=!1,this._warningNoTraceSelected=!1,this._findNonspatialFeatureWidget=new w({mode:"add-nso"}),this._individualResultNode=null,this._loadUnError=!0,this._resultDisplayField="objectid",this._resultFeatureWidget=new w({mode:"show-feature-info"}),this._resultObjectIdField="objectid",this._resultSortField="objectid",this._resultSortOrder="desc",this._showResultOptions=!1,this._symbolStartFlag=null,this._symbolBarrier=null,this._traceLocationType="starting-point",this._updatingHandles=new l,this._warningNoBarrierAssetFound=!1,this._warningNoBarrierAssetNsoFound=!1,this._warningNoStartAssetFound=!1,this._warningNoStartAssetNsoFound=!1,this._warningNoTerminal=!1,this._wasPopupEnabled=!1,this._watchHandler=null,this.disabled=!0,this.inputSettings=[],this.messages=null,this.messagesCommon=null,this.messagesUnits=null,this.viewModel=new v,this._afterComponentCreate=this._afterComponentCreate.bind(this)}initialize(){this._utilityNetworkTraceInitialized(),this.addHandles([t(()=>this.view,()=>this._viewChangeHandle(),i),t(()=>this.viewModel?.resultAreaProperties,()=>this.scheduleRender()),t(()=>this._addNonspatialObjectActive,e=>{this._findNonspatialFeatureWidget.feature=null,e?this._changeCursor("crosshair"):this.view.popupEnabled=this._wasPopupEnabled}),t(()=>this._showFeatureInfoActive,e=>{e||(this._resultFeatureWidget.feature=null,this.view.popupEnabled=this._wasPopupEnabled)}),s(()=>this._findNonspatialFeatureWidget,"add-nso-trace-location",({featureWidget:e})=>{this.viewModel.addNonspatialTraceLocation(e.graphic,this._traceLocationType),this._warningNoFlag=!1,this._addNonspatialObjectActive=!1}),s(()=>this._findNonspatialFeatureWidget,"close-un-trace-feature-block",()=>{this._changeCursor("default"),this._addNonspatialObjectActive=!1,this.viewModel.cancelAddFlagByHit()}),s(()=>this._resultFeatureWidget,"close-un-trace-feature-block",()=>{this._showFeatureInfoActive=!1}),s(()=>this._resultFeatureWidget,"close",()=>{this._resetResultFeatureWidget()})])}destroy(){this._findNonspatialFeatureWidget?.destroy(),this._resultFeatureWidget?.destroy()}get defaultGraphicColor(){return this.viewModel.defaultGraphicColor}set defaultGraphicColor(e){this.viewModel.defaultGraphicColor=e}get enableResultArea(){return this.viewModel.enableResultArea}set enableResultArea(e){this.viewModel.enableResultArea=e}get flags(){return this.viewModel.flags}set flags(e){this.viewModel.flags=e}get icon(){return"utility-network-trace"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get resultAreaProperties(){return this.viewModel.resultAreaProperties}set resultAreaProperties(e){this.viewModel.resultAreaProperties=e}get selectedTraces(){return this.viewModel.selectedTraces}set selectedTraces(e){this.viewModel.selectedTraces=e}get selectOnComplete(){return this.viewModel.selectOnComplete}set selectOnComplete(e){this.viewModel.selectOnComplete=e}get showGraphicsOnComplete(){return this.viewModel.showGraphicsOnComplete}set showGraphicsOnComplete(e){this.viewModel.showGraphicsOnComplete=e}get showSelectionAttributes(){return this.viewModel.showSelectionAttributes}set showSelectionAttributes(e){this.viewModel.showSelectionAttributes=e}get traceResults(){return this.viewModel.traceResults}get utilityNetwork(){return this.viewModel.utilityNetwork}set utilityNetwork(e){this.viewModel.utilityNetwork=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}async checkCanTrace(){this._confirmReset=!1,this._resetResultFeatureWidget();const e=this.viewModel.checkCanTrace();e.status?(this._warningNoFlag=!1,this._warningNoTraceSelected=!1,this._warningNoTerminal=!1,this._traceResultsState="result",this.switchTab("results"),this.viewModel._activeProgress=!0,this.viewModel.removeAllResultAreaGraphics(),await this.viewModel.callTrace(),this.viewModel._activeProgress=!1):e.issues.forEach(e=>{switch(e){case"noStartingPoints":this._warningNoFlag=!0;break;case"noTerminalSelected":this._warningNoTerminal=!0;break;default:this._warningNoTraceSelected=!0}})}confirmReset(){this._confirmReset=!0}render(){return this._mixCustomStrings(),this._overrideFlagSymbol(),_("div",{class:this.classes(S.base,p.widget,p.panel,{[p.widgetDisabled]:this.disabled})},this._renderUtilityNetworkTrace())}loadDependencies(){return h({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),"action-group":()=>import("@esri/calcite-components/dist/components/calcite-action-group"),"action-pad":()=>import("@esri/calcite-components/dist/components/calcite-action-pad"),block:()=>import("@esri/calcite-components/dist/components/calcite-block"),"block-section":()=>import("@esri/calcite-components/dist/components/calcite-block-section"),button:()=>import("@esri/calcite-components/dist/components/calcite-button"),checkbox:()=>import("@esri/calcite-components/dist/components/calcite-checkbox"),"color-picker-swatch":()=>import("@esri/calcite-components/dist/components/calcite-color-picker-swatch"),combobox:()=>import("@esri/calcite-components/dist/components/calcite-combobox"),"combobox-item":()=>import("@esri/calcite-components/dist/components/calcite-combobox-item"),"dropdown-group":()=>import("@esri/calcite-components/dist/components/calcite-dropdown-group"),"dropdown-item":()=>import("@esri/calcite-components/dist/components/calcite-dropdown-item"),fab:()=>import("@esri/calcite-components/dist/components/calcite-flow"),flow:()=>import("@esri/calcite-components/dist/components/calcite-fab"),"flow-item":()=>import("@esri/calcite-components/dist/components/calcite-flow-item"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),"input-number":()=>import("@esri/calcite-components/dist/components/calcite-input-number"),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"),option:()=>import("@esri/calcite-components/dist/components/calcite-option"),panel:()=>import("@esri/calcite-components/dist/components/calcite-panel"),popover:()=>import("@esri/calcite-components/dist/components/calcite-popover"),scrim:()=>import("@esri/calcite-components/dist/components/calcite-scrim"),select:()=>import("@esri/calcite-components/dist/components/calcite-select"),"split-button":()=>import("@esri/calcite-components/dist/components/calcite-split-button"),tab:()=>import("@esri/calcite-components/dist/components/calcite-tab"),"tab-nav":()=>import("@esri/calcite-components/dist/components/calcite-tab-nav"),"tab-title":()=>import("@esri/calcite-components/dist/components/calcite-tab-title"),tabs:()=>import("@esri/calcite-components/dist/components/calcite-tabs")})}switchTab(e){this._activeTab=e}switchToFromAssetGroup(e,t,s){this._traceHeaderForFlow=t,this._traceResultsAssetGroup=e,this._traceResultsState=s}switchToFromAssetType(e,t,s){this._assetGroupHeader=t,this._traceResultsAssetType=e,this._traceResultsState=s}switchToFromFunctions(e,t){this._traceResultsFunctions=e,this._traceResultsState=t}switchToFromIndividualRecords(e,t,s){this._assetTypeHeader=t,this._traceResultsIndividual=e,this._traceResultsState=s}_renderAddNonspatialLocationBlock(){const{messages:e}=this;return _("calcite-block",{expanded:!0,key:`${this.id}__add-spatial-location-block`,label:e.inputsStrings.addNonspatialOption},this._findNonspatialFeatureWidget.render())}_renderAddSpatialLocationBlock(){const{messages:e,messagesCommon:t}=this;return _("calcite-block",{class:S.blockContent,expanded:!0,heading:"starting-point"===this._traceLocationType?e.inputsStrings.headerStartingPoint:e.inputsStrings.headerBarrier,key:`${this.id}__add-nonspatial-location-block`,label:"starting-point"===this._traceLocationType?e.inputsStrings.headerStartingPoint:e.inputsStrings.headerBarrier},_("calcite-action",{icon:"x",onclick:()=>{this.viewModel.removeClickHandler(),this.view?.popup&&(this.view.popupEnabled=this._wasPopupEnabled),this._changeCursor("default"),this._selectToolActive=!1},slot:"control",text:t.close}),_("calcite-notice",{icon:"starting-point"===this._traceLocationType?"pin-plus":"x-circle-f",kind:"info",open:!0},_("div",{slot:"message"},e.inputsStrings.addPointHint)))}_renderClearTraceResultsBlock(){const{messages:e,messagesCommon:t}=this;return _("calcite-scrim",{key:`${this.id}__clear-results-block`},_("calcite-block",{class:S.clearResultsBlock,expanded:!0},_("h3",null,e.resultsStrings.startOverButton),_("div",null,e.resultsStrings.startOverValidation),_("div",{class:S.promptDivider}),_("div",{styles:A("row")},_("calcite-button",{appearance:"outline",onclick:()=>{this._confirmReset=!1},slot:"secondary",width:"full"},t.cancel),_("calcite-button",{onclick:()=>{this._confirmReset=!1,this.viewModel.reset(),this.switchTab("input")},slot:"primary",width:"full"},t.form.ok))))}_renderExecutingTraceBlock(){const{messages:e}=this;return _("calcite-loader",{label:e.alertsStrings.traceExecuting,text:e.alertsStrings.traceExecuting,type:"indeterminate"})}_renderInputBlock(){const{messages:e}=this;return _("calcite-block",{class:S.blockContainer,expanded:!0,key:`${this.id}__inputs-block`,label:e.inputsStrings.headerTabInputs},_("calcite-flow",{class:S.flow},_("calcite-flow-item",{key:`${this.id}__inputs-flow-item`,selected:!this._selectToolActive&&!this._addNonspatialObjectActive},this._warningNoFlag?this._renderWarningMessage("flag",!0):null,this._warningNoTerminal?this._renderWarningMessage("noTerminal",!0):null,this._warningNoTraceSelected?this._renderWarningMessage("trace",!0):null,this._renderTraceSelectorContainer(),this._renderStartFlagsContainer(),this._renderBarriersFlagsContainer(),this._warningNoFlag&&this._warningNoTraceSelected?_("div",{styles:T(10)}):null,_("calcite-fab",{appearance:"solid",icon:"utility-network-trace",kind:"brand",onclick:()=>{this.checkCanTrace()},slot:"fab",text:e.tracingStrings.runTrace,textEnabled:!0,title:e.tracingStrings.runTrace,type:"button"}))))}_renderInputsTab(){const{messagesCommon:e}=this;let t="input";return this._selectToolActive&&!this._addNonspatialObjectActive&&(t="add-spatial-location"),!this._selectToolActive&&this._addNonspatialObjectActive&&(t="add-nso-location"),this.disabled&&(t="loading"),_("calcite-tab",{key:`${this.id}__inputs-tab-item`,selected:"input"===this._activeTab},"loading"===t?_("calcite-loader",{label:e.loading,type:"indeterminate"}):null,"input"===t?this._renderInputBlock():null,"add-spatial-location"===t?this._renderAddSpatialLocationBlock():null,"add-nso-location"===t?this._renderAddNonspatialLocationBlock():null)}_renderBarriersFlagsContainer(){const{messages:e}=this,t=[];let s=[];s=this.viewModel._flags.filter(e=>"barrier"===e.type),s.forEach(e=>{e.displayValue&&t.push(this._renderFlagRow(e,"barrier"))});let i=null;return this._symbolBarrier&&(i=this._getSymbolIcon(this._symbolBarrier)),_("calcite-block",{class:S.blockContent,collapsible:!0,expanded:!0,heading:e.inputsStrings.headerBarrier+" ("+s.length+")",overlayPositioning:"fixed"},_("div",{slot:"icon"},i||_("calcite-icon",{icon:"x-circle-f",scale:"s"})),_("div",null,e.inputsStrings.barrierPointHint),_("div",{class:S.listContainer},t),this._warningNoBarrierAssetFound?this._renderWarningMessage("noBarrierAsset",!0):null,this._warningNoBarrierAssetNsoFound?this._renderWarningMessage("noBarrierAssetNso",!0):null,_("div",{class:S.addButtonContainer},_("calcite-split-button",{appearance:"outline-fill",primaryIconStart:"select",primaryText:e.inputsStrings.addPointOption,onCalciteSplitButtonPrimaryClick:()=>{this._setupAddTraceLocation("barrier")}},_("calcite-dropdown-group",{selectionMode:"none"},_("calcite-dropdown-item",{onCalciteDropdownItemSelect:()=>{this._setupAddNonspatialObject("barrier")}},e.inputsStrings.addNonspatialOption)))))}_renderFlagRow(e,t){const{messages:s,messagesCommon:i}=this,r=[];let o=!1;return null!=e.allTerminals&&e.allTerminals.terminals.length>0&&(o=!0,e.allTerminals.terminals.forEach(t=>{let s=!1;e?.selectedTerminals?.includes(t.id)&&(s=!0),r.push(_("calcite-combobox-item",{key:t.name,selected:s,textLabel:t.name,value:t.id}))})),_("calcite-block",{collapsible:null!==e.allTerminals||"barrier"===e.type,heading:e.displayValue?.value??"",key:"pop"+e.globalId+e.type+e.id+t,overlayPositioning:"fixed"},_("calcite-action",{icon:"trash",label:i.remove,onclick:()=>{this.viewModel.removeFlag(e)},scale:"s",slot:"header-menu-actions",text:i.remove,textEnabled:!0}),e.mapGraphic&&e.mapPoint?_("calcite-action",{icon:"zoom-to-object",label:s.globalStrings.zoomToFeature,onclick:()=>{this.viewModel.zoomToAsset(e.details.geometry)},scale:"s",slot:"header-menu-actions",text:s.globalStrings.zoomToFeature,textEnabled:!0}):null,"barrier"===e.type?_("calcite-label",{layout:"inline",scale:"s"},_("calcite-checkbox",{checked:e.isFilterBarrier,onclick:()=>{this.viewModel.manageFilterBarrier(!e.isFilterBarrier,e)},scale:"s"}),s.inputsStrings.barrierFilter):null,o?_("calcite-combobox",{label:s.globalStrings.selectTerminalPlaceholder,maxItems:0,overlayPositioning:"fixed",placeholder:s.globalStrings.selectTerminalPlaceholder,scale:"s",selectionMode:"multiple",onCalciteComboboxChange:t=>{t.currentTarget.selectedItems.length>0?(e.selectedTerminals=[],t.currentTarget.selectedItems.forEach(t=>{this.viewModel.addTerminal(t.value,e)})):e.selectedTerminals=[]},onCalciteComboboxChipClose:t=>{t.preventDefault(),this.viewModel.removeTerminal(t.currentTarget.value,e)}},r):null)}_renderHighlightColorPicker(e,t,s){const{messages:i}=this,{graphicHandler:r}=this.viewModel,o=[],a=new RegExp(`^${e.hex}$`,"i"),l=r.highlightColor.length>y.length?5:4;for(const n of r.highlightColor)o.push(_("calcite-action",{active:a.test(n.hex),key:n.hex,label:i.resultsStrings.graphicColor,onclick:()=>{"aggregate"===s?this.viewModel.changeResultGraphicColor(n,t):this.viewModel.changeResultAreaColor(t,n)},scale:"s",text:i.resultsStrings.graphicColor},_("calcite-color-picker-swatch",{active:a.test(n.hex),color:n.hex,scale:"s"})));return _("calcite-action-pad",{expandDisabled:!0,layout:"grid",position:"start"},_("calcite-action-group",{columns:l},o))}_renderRemoveTraceContainer(e){const{messages:t}=this;return _("calcite-action",{icon:"trash",label:t.globalStrings.clearResults,onclick:()=>{this._alertRemoveModal=!0,this._activeTrace=e.trace},scale:"s",slot:"header-menu-actions",text:t.globalStrings.clearResults,textEnabled:!0})}_renderResultsTab(){let e="results";return this._showFeatureInfoActive&&(e="show-feature-info"),this.viewModel._activeProgress&&(e="executing"),this._confirmReset&&(e="clear-trace-results"),_("calcite-tab",{key:`${this.id}__results-tab-item`},"executing"===e?this._renderExecutingTraceBlock():null,"results"===e?this.viewModel.traceResults.length?this._renderResultsPanel():this._renderWarningMessage("noTraceExecuted",!1):null,"show-feature-info"===e?this._renderShowFeatureInfoBlock():null,"clear-trace-results"===e?this._renderClearTraceResultsBlock():null)}_renderResultsPanel(){const{messages:e}=this;return _("calcite-block",{class:S.blockContainer,expanded:!0,key:`${this.id}__results-block`,label:e.resultsStrings.headerTabResults},_("calcite-flow",{class:S.flow},this._renderTraceResults(),this._renderTraceResultFunctions(),this._renderTraceResultByAssetGroup(),this._renderTraceResultByAssetType(),this._renderTraceResultIndividual()))}_renderResultRowFunctions(e){return _("calcite-block",{collapsible:!1,heading:e.networkAttributeName+" "+e.functionType+" = "+e.result,overlayPositioning:"fixed"})}_renderResultRowAssetGroup(e){const t=this._getAssetGroupName(e[0]);return _("calcite-list-item",{key:`${t}-${e.assetGroupCode}`,label:t+" ("+e.length+")",onCalciteListItemSelect:()=>{this.switchToFromAssetType(this._groupResultsByAssetType(e),t+" ("+e.length+")","assetType")}},_("calcite-icon",{icon:"chevron-right",scale:"s",slot:"content-end"}))}_renderResultRowAssetType(e){const t=this._getAssetTypeName(e[0]);return _("calcite-list-item",{key:`${t}-${e.assetTypeCode}`,label:t+" ("+e.length+")",onCalciteListItemSelect:()=>{this._updatingHandles.addPromise(this.viewModel.queryFeaturesById(e).then(s=>{if(s?.length){this._resultObjectIdField=s[0].layer.objectIdField,"objectid"===this._resultDisplayField&&(this._resultDisplayField=s[0].layer.objectIdField),"objectid"===this._resultSortField&&(this._resultSortField=s[0].layer.objectIdField);const i=this._appendAttributes(e,s,"objectId");this.switchToFromIndividualRecords(i,t+" ("+e.length+")","records")}else this.switchToFromIndividualRecords(e,t+" ("+e.length+")","records")}))}},_("calcite-icon",{icon:"chevron-right",scale:"s",slot:"content-end"}))}_renderResultRowIndividual(e){const{messages:t}=this;let s,i=null;if(i=e?.details?.fields.find(({name:e})=>e===this._resultDisplayField),"date"===i?.type){s=new Date(e.details.attributes[this._resultDisplayField]).toDateString()}else if("assetgroup"===this._resultDisplayField.toLowerCase())s=this._getAssetGroupName(e);else if("assettype"===this._resultDisplayField.toLowerCase())s=this._getAssetTypeName(e);else if(i?.domain&&R(i.domain)){const t=i.domain.codedValues.find(({code:t})=>t===e.details.attributes[this._resultDisplayField]);s=t?.name}else s=e.details?.attributes[this._resultDisplayField]??e.objectId;return s&&""!==s&&null!==s?"string"==typeof s&&(s.trim()||(s=t.resultsStrings.noValue)):s=t.resultsStrings.noValue,_("calcite-list-item",{key:e.details.uid,label:s,onCalciteListItemSelect:async()=>{this._disablePopup(),this._showFeatureInfoActive=!0;const t=c(e.details?.layer)?e.details?.layer:null;if(t){const s=Object.keys(e.details.attributes).find(e=>e.toLowerCase()===t.subtypeField.toLowerCase())??"assetgroup",i=t.sublayers.find(t=>t.subtypeCode===e.details.attributes[s]),r=Object.keys(e.details.attributes).find(e=>e.toLowerCase()===t.objectIdField.toLowerCase())??"objectid",o=new d;o.outFields=["*"],o.returnGeometry=!0,o.where=r+" = "+e.details.attributes[r];const a=await(i?.queryFeatures(o));a&&this._resultFeatureWidget.open(a.features[0])}else this._resultFeatureWidget.open(e.details)}},_("calcite-icon",{icon:"chevron-right",scale:"s",slot:"content-end"}))}_renderShowFeatureInfoBlock(){const{messages:e}=this;return _("calcite-block",{class:S.blockContainer,expanded:!0,key:`${this.id}__show-feature-info-block`,label:e.resultsStrings.headerFeatureInfo},this._resultFeatureWidget.render())}_renderStartFlagsContainer(){const{messages:e}=this,t=[];let s=[];s=this.viewModel._flags.filter(e=>"starting-point"===e.type),s.forEach(e=>{e.displayValue&&t.push(this._renderFlagRow(e,"start"))});let i=null;return this._symbolStartFlag&&(i=this._getSymbolIcon(this._symbolStartFlag)),_("calcite-block",{class:S.blockContent,collapsible:!0,expanded:!0,heading:e.inputsStrings.headerStartingPoint+" ("+s.length+")",overlayPositioning:"fixed"},_("div",{slot:"icon"},i||_("calcite-icon",{icon:"pin",scale:"s"})),_("div",null,e.inputsStrings.startingPointHint),_("div",{class:S.listContainer},t),this._warningNoStartAssetFound?this._renderWarningMessage("noStartAsset",!0):null,this._warningNoStartAssetNsoFound?this._renderWarningMessage("noStartAssetNso",!0):null,_("div",{class:S.addButtonContainer},_("calcite-split-button",{appearance:"outline-fill",primaryIconStart:"select",primaryText:e.inputsStrings.addPointOption,onCalciteSplitButtonPrimaryClick:()=>{this._setupAddTraceLocation("starting-point")}},_("calcite-dropdown-group",{selectionMode:"none"},_("calcite-dropdown-item",{onCalciteDropdownItemSelect:()=>{this._setupAddNonspatialObject("starting-point")}},e.inputsStrings.addNonspatialOption)))))}_renderStartOverContainer(){const{messages:e}=this;return _("calcite-fab",{appearance:"solid",icon:"trash",kind:"brand",onclick:()=>{this.confirmReset()},slot:"fab",text:e.resultsStrings.startOverButton,textEnabled:!0,title:e.resultsStrings.startOverButton,type:"button"})}_renderTraceResultByAssetGroup(){const e=this._traceResultsAssetGroup,t=[];for(const s in e){const i=e[s];for(const e in i)t.push(this._renderResultRowAssetGroup(i[e]))}return _("calcite-flow-item",{heading:this._traceHeaderForFlow,key:"assetGroupResultMultiple",selected:"assetGroup"===this._traceResultsState,onCalciteFlowItemBack:()=>{this.switchToFromAssetGroup([],"","result")}},_("calcite-list",{label:""},t),this._renderStartOverContainer())}_renderTraceResultByAssetType(){const e=this._traceResultsAssetType,t=[];for(const s in e)e[s].length>0&&t.push(this._renderResultRowAssetType(e[s]));return _("calcite-flow-item",{heading:this._assetGroupHeader,key:"assetTypeResult",loading:this._updatingHandles.updating,selected:"assetType"===this._traceResultsState,onCalciteFlowItemBack:()=>{this.switchToFromAssetType([],"","assetGroup")}},_("calcite-list",{label:"",selectionMode:"none"},t),this._renderStartOverContainer())}_renderTraceResultFunctions(){if("functions"!==this._traceResultsState)return null;const{messages:e}=this,t=this._traceResultsFunctions,s=[];return t.forEach(e=>{s.push(this._renderResultRowFunctions(e))}),_("calcite-flow-item",{heading:e.resultsStrings.functionHeader,key:"functionResultMultiple",selected:"functions"===this._traceResultsState,onCalciteFlowItemBack:()=>{this.switchToFromFunctions([],"result")}},s,this._renderStartOverContainer())}_renderTraceResultIndividual(){const{messages:e}=this,t=this._traceResultsIndividual;t.sort(this._compare(this._resultSortField,this._resultSortOrder));const s=[];if(t.length>0){(t[0].details?.fields.some(({name:e})=>e.toLowerCase()===this._resultDisplayField.toLocaleLowerCase())??!1)||(this._resultDisplayField=this._resultObjectIdField,this._resultSortField=this._resultObjectIdField),t.forEach(e=>{e?.details&&s.push(this._renderResultRowIndividual(e))}),0===s.length&&s.push(_("calcite-list-item",{label:e.resultsStrings.noFeaturesInMap}))}return _("calcite-flow-item",{heading:this._assetTypeHeader,key:"individualResult",selected:"records"===this._traceResultsState,onCalciteFlowItemBack:()=>{this._showResultOptions=!1,this.switchToFromIndividualRecords([],"","assetType")}},_("calcite-action",{afterCreate:b,bind:this,"data-node-ref":"_individualResultNode",icon:"gear",id:"field_options"+this.id,label:e.resultsStrings.displayAttribute,onclick:()=>{this._showResultOptions=!0},slot:"header-actions-end",text:e.resultsStrings.displayAttribute}),this._renderTraceResultIndividualPopover(),_("calcite-list",{label:"",selectionMode:"none"},s),this._renderStartOverContainer())}_renderTraceResultIndividualPopover(){const{messages:e}=this,t=this._traceResultsIndividual,s=[],i=[];return t.length>0&&(t[0].details?t[0].details.fields.forEach(({name:e,alias:t})=>{s.push(_("calcite-option",{key:`display-${e}`,label:t??e,selected:e===this._resultDisplayField,value:e})),i.push(_("calcite-option",{key:`sort-${e}`,label:t??e,selected:e===this._resultSortField,value:e}))}):(s.push(_("calcite-option",{key:`display-${this._resultDisplayField}`,label:this._resultDisplayField,value:this._resultDisplayField})),i.push(_("calcite-option",{key:`sort-${this._resultDisplayField}`,label:this._resultDisplayField,value:this._resultDisplayField})))),_("calcite-popover",{autoClose:!0,label:e.resultsStrings.displayAttribute,offsetDistance:0,offsetSkidding:0,open:this._showResultOptions,overlayPositioning:"fixed",placement:"left-start",referenceElement:this._individualResultNode,styles:null!==this.domNode?k(.75*this.domNode.clientWidth):F()},_("calcite-block",{expanded:!0,label:e.resultsStrings.displayAttribute,overlayPositioning:"fixed"},_("calcite-label",{scale:"s"},e.resultsStrings.displayAttribute,_("calcite-select",{label:e.resultsStrings.displayAttribute,scale:"s",onCalciteSelectChange:e=>{const t=e.currentTarget;this._resultDisplayField=t.selectedOption.value,this._showResultOptions=!1}},s)),_("calcite-label",{scale:"s"},e.resultsStrings.sortBy,_("calcite-select",{label:e.resultsStrings.sortBy,scale:"s",onCalciteSelectChange:e=>{const s=e.currentTarget;this._resultSortField=s.selectedOption.value,t.sort(this._compare(this._resultSortField,this._resultSortOrder)),this._traceResultsIndividual=t,this._showResultOptions=!1}},i))))}_renderTraceResults(){const{messages:e,messagesCommon:t}=this,{selectFeatures:s}=e.resultsStrings,i=this.viewModel.traceResults,r=[];return i.forEach((t,i)=>{let o=[],a=[],l=!1,n=!1,c=!1,d="";null!==t.results&&t.results.hasOwnProperty("elements")?(null!==t.results.aggregatedGeometry&&(n=!0),null!==t.results.globalFunctionResults&&t.results.globalFunctionResults.length>0&&(a=t.results.globalFunctionResults,a.length>0&&(c=!0)),t.results.elements&&t.results.elements.length>0&&(o=t.results.elements,o.length>0&&(l=!0)),(n||l)&&(d=this.messagesUnits.units[t.resultArea?.unit]?.abbr),r.push(_("calcite-block",{class:S.blockContent,collapsible:!0,description:t.trace.description??"",expanded:!0,heading:t.trace.title,key:`${t.trace.title}${i}`,overlayPositioning:"fixed"},this._renderRemoveTraceContainer(t),_("calcite-list",{label:""},c?_("calcite-list-item",{label:e.resultsStrings.functionHeader+" ("+a.length+")",onCalciteListItemSelect:()=>{this.switchToFromFunctions(a,"functions")}},_("calcite-icon",{icon:"chevron-right",scale:"s",slot:"content-end"})):null,l&&this.viewModel.showSelectionAttributes?_("calcite-list-item",{key:this.id,label:e.resultsStrings.viewFeatures+" ("+o.length+")",onCalciteListItemSelect:()=>{this.switchToFromAssetGroup(this._groupResultsByAssetGroup(t),t.trace.title+" ("+o.length+")","assetGroup")}},_("calcite-icon",{icon:"chevron-right",scale:"s",slot:"content-end"})):this.viewModel.showSelectionAttributes?_("calcite-label",{layout:"inline",scale:"s"},e.resultsStrings.noSelectionResults):null),l?_("div",{class:S.doublePaddingTop},_("calcite-label",{layout:"inline",onclick:e=>{e.preventDefault(),e.stopPropagation(),this.viewModel.mergeSelection(!t.selectionEnabled,t.trace)},scale:"s"},_("calcite-checkbox",{checked:t.selectionEnabled,onclick:e=>{e.preventDefault(),e.stopPropagation(),this.viewModel.mergeSelection(!t.selectionEnabled,t.trace)}}),this.viewModel.showSelectionAttributes?s:`${s} (${o.length})`)):null,n?_("calcite-block-section",{expanded:t.graphicEnabled,key:`aggregate-${t.trace.title}-${i}`,text:e.resultsStrings.highlightTrace,toggleDisplay:"switch",onCalciteBlockSectionToggle:e=>{e.currentTarget.expanded?this.viewModel.changeResultGraphicColor(t.graphicColor,t):this.viewModel.removeResultGraphicFromView(t)}},_("calcite-list",{label:e.resultsStrings.graphicColor,selectionMode:"none"},_("calcite-list-item",{label:e.resultsStrings.graphicColor,onclick:e=>{this._swatchNode=e.currentTarget,this._activeSwatch="aggGeom_"+i}},_("calcite-color-picker-swatch",{color:t.graphicColor.hex,scale:"s",slot:"actions-end"})))):null,this.enableResultArea&&(n||l)?_("calcite-block-section",{expanded:t.resultArea?.show,key:`area-${t.trace.title}-${i}`,text:e.resultsStrings.resultAreaHeader,toggleDisplay:"switch",onCalciteBlockSectionToggle:e=>{e.currentTarget.expanded?t.resultAreaGraphic?this.viewModel.addResultAreaToMap(t,t.resultAreaGraphic):this.viewModel.addResultAreaToMap(t):this.viewModel.removeResultAreaFromMap(t)}},_("calcite-list",{label:"",selectionMode:"none"},_("calcite-list-item",{label:e.resultsStrings.graphicColor,onclick:e=>{const t=e.currentTarget;this._swatchNode=t,this._activeSwatch="resultArea_"+i}},_("calcite-color-picker-swatch",{color:t.resultArea?.color.hex,scale:"s",slot:"actions-end"}))),_("calcite-list",{label:"",selectionMode:"none"},_("calcite-list-item",{label:e.resultsStrings.resultAreaBuffer},_("calcite-input-number",{afterCreate:this._afterComponentCreate,class:S.numberInput,max:999999,min:0,scale:"s",slot:"actions-end",suffixText:d,value:t.resultArea?.distance.toString(),onCalciteInputNumberChange:e=>{if(!this.view?.popup)return;this.view.popup.visible&&this.view.closePopup();const s=e.currentTarget;t.resultArea.distance>=0?(t.resultArea.distance=parseInt(s.value,10),this.viewModel.removeResultAreaFromMap(t),this.viewModel.addResultAreaToMap(t)):(t.resultArea.distance=0,this.viewModel.removeResultAreaFromMap(t),this.viewModel.addResultAreaToMap(t))}})))):null,_("calcite-popover",{autoClose:!0,closable:!0,label:e.resultsStrings.graphicColor,offsetDistance:0,offsetSkidding:0,open:this._activeSwatch==="aggGeom_"+i||this._activeSwatch==="resultArea_"+i,overlayPositioning:"fixed",placement:"auto-start",referenceElement:this._swatchNode,scale:"s",onCalcitePopoverClose:()=>{this._swatchNode=null,this._activeSwatch=null}},this._renderHighlightColorPicker(this._activeSwatch==="resultArea_"+i?t.resultArea?.color:t.graphicColor,t,this._activeSwatch==="resultArea_"+i?"resultArea":"aggregate"))))):r.push(_("calcite-block",{collapsible:!1,expanded:!0,heading:t.trace.title,key:"error-"+i,overlayPositioning:"fixed"},this._renderRemoveTraceContainer(t),this._renderWarningMessage("noController",!1,t.status)))}),_("calcite-flow-item",{key:"traceResults",selected:"result"===this._traceResultsState},r,this._renderStartOverContainer(),this._alertRemoveModal?_("calcite-scrim",{key:"prompt"},_("div",{class:S.clearPrompt},_("h3",{slot:"header"},e.globalStrings.clearResults),_("div",{slot:"content"},e.alertsStrings.clearResultsAlert),_("div",{class:S.promptDivider}),_("div",{styles:A("row")},_("calcite-button",{appearance:"outline",onclick:()=>{this._alertRemoveModal=!1},slot:"secondary",width:"full"},t.cancel),_("calcite-button",{onclick:()=>{this._activeTrace&&this.viewModel.clearResult(this._activeTrace),this._alertRemoveModal=!1,0===this.viewModel.traceResults.length?this.switchTab("input"):(this._activeTrace=this.viewModel.traceResults[0].trace,this._traceResultsState="result")},slot:"primary",width:"full"},t.form.ok)))):null)}_renderTraceSelectorContainer(){const{messages:e}=this,t=this.viewModel.traces.map(e=>this._renderComboboxItem({value:e.globalId,text:e.title,selected:e.selected??!1})),s=this.viewModel.traces.filter(e=>e.selected),i=e.tracingStrings.traceOperation+` (${s.length})`;return _("calcite-block",{class:S.blockContent,collapsible:!0,expanded:!0,heading:i,overlayPositioning:"fixed"},_("calcite-icon",{icon:"utility-network-trace",scale:"s",slot:"icon"}),_("calcite-combobox",{label:e.inputsStrings.selectTraces,maxItems:0,overlayPositioning:"fixed",placeholder:e.inputsStrings.selectTraces,scale:"s",selectionMode:"multiple",onCalciteComboboxChange:e=>{this.viewModel.traces.forEach(t=>{t.selected=e.currentTarget.selectedItems.some(e=>e.value===t.globalId)}),e.currentTarget.selectedItems.length&&(this._warningNoTraceSelected=!1)}},t))}_renderUtilityNetworkTrace(){const{viewModel:e,viewModel:{utilityNetwork:t}}=this,s=e.view?.map,{messages:i}=this;let r=_("calcite-tabs",{class:S.tabs,layout:"center",position:"top",styles:C(this.container)},_("calcite-tab-nav",{slot:"title-group"},_("calcite-tab-title",{onclick:()=>{this.switchTab("input")},selected:"input"===this._activeTab},i.inputsStrings.headerTabInputs),_("calcite-tab-title",{onclick:()=>{this.switchTab("results")},selected:"results"===this._activeTab},i.resultsStrings.headerTabResults)),this._renderInputsTab(),this._renderResultsTab());return(!s.utilityNetworks?.length&&!t||t&&!t.sharedNamedTraceConfigurations.length)&&(r=_("calcite-panel",null,this._renderWarningMessage("noTraceConfig",!1))),this._loadUnError||(r=_("calcite-panel",null,this._renderWarningMessage("loadUNError",!1,this._errorMessage))),r}_renderWarningMessage(e,t,s){const{messages:i}=this;let r=i.alertsStrings.NoRunAlertHeader,o=i.alertsStrings.noResultsInfo;switch(e){case"flag":r=i.alertsStrings.startingPointAlertHeader,o=i.alertsStrings.startingPointAlert;break;case"noTerminal":r=i.alertsStrings.noTerminalDefinedHeader,o=i.alertsStrings.noTerminalDefined;break;case"trace":r=i.alertsStrings.selectTraceAlertHeader,o=i.alertsStrings.selectTraceAlert;break;case"noTraceExecuted":r=i.alertsStrings.NoRunAlertHeader,o=i.alertsStrings.noResultsInfo;break;case"noBarrierAsset":case"noStartAsset":r=i.alertsStrings.noAssetsFoundHeader,o=i.alertsStrings.noAssetFound;break;case"noBarrierAssetNso":case"noStartAssetNso":r="",o=i.alertsStrings.noAssetFound;break;case"noTraceConfig":r="",o=i.alertsStrings.noTraceSupported;break;default:r=i.alertsStrings.genericErrorHeader,o=s||""}return _("div",{class:S.noticeContainer,key:e},_("calcite-notice",{closable:t,icon:!0,key:e,kind:"danger",open:!0,scale:"s",width:"auto",onCalciteNoticeClose:()=>this._handleWarningNoticeClose(e)},_("div",{slot:"title"},r),_("div",{slot:"message"},o)))}_afterComponentCreate(e){"value"in e&&null!=e.value&&"setNumberValue"in e&&e.setNumberValue({committing:!1,value:e.value,origin:"direct"})}_appendAttributes(e,t,s){const i=[];return e.forEach(e=>{t.forEach(t=>{t.featureSet.features.forEach(r=>{e[s]===r.attributes[this._resultObjectIdField]&&(e.details=r,e.details.fields=t.featureSet.fields,i.push(e))})})}),i}_changeCursor(e="default"){this.removeHandles(M),this.view&&"default"!==e&&this.addHandles(this.view.acquireCursor(e),M)}_disablePopup(){const{view:e}=this;e.popupEnabled=!1,e.closePopup()}_compare(e,t){return(s,i)=>{let r=0,o=s.details?.attributes[e]??s.objectId,a=i.details?.attributes[e]??i.objectId;return isNaN(o)&&(o=o.toLowerCase()),isNaN(a)&&(a=a.toLowerCase()),"desc"===t?o>a?r=1:o<a&&(r=-1):o<a?r=1:o>a&&(r=-1),r}}_getAssetGroupName(e){let t=e.assetGroupCode.toString();const s=e.assetGroupCode,i=this.viewModel.getValidSources().find(t=>t.sourceId===e.networkSourceId);if(i){const e=i.assetGroups.find(e=>e.assetGroupCode===s);e&&(t=e.assetGroupName)}return t}_getAssetTypeName(e){let t=e.assetTypeCode.toString();const s=e.assetGroupCode,i=this.viewModel.getValidSources().find(t=>t.sourceId===e.networkSourceId);if(i){const r=i.assetGroups.find(e=>e.assetGroupCode===s);if(r){const s=r.assetTypes.find(t=>t.assetTypeCode===e.assetTypeCode);s&&(t=s.assetTypeName)}}return t}_getSymbolIcon(e){return"picture-marker"===e.type?_("img",{height:e.height,src:e.url??void 0,width:e.width}):null}_groupBy(e,t){return e.reduce((e,s)=>((e[s[t]]=e[s[t]]||[]).push(s),e),{})}_groupResultsByAssetGroup(e){const t=[],s=e.results?.elements,i=this._groupBy(s??[],"networkSourceId");for(const r in i)t.push(this._groupBy(i[r],"assetGroupCode"));return t}_groupResultsByAssetType(e){return this._groupBy(e,"assetTypeCode")}_handleWarningNoticeClose(e){switch(e){case"flag":this._warningNoFlag=!1;break;case"noTerminal":this._warningNoTerminal=!1;break;case"trace":this._warningNoTraceSelected=!1;break;case"noStartAsset":this._warningNoStartAssetFound=!1;break;case"noStartAssetNso":this._warningNoStartAssetNsoFound=!1;break;case"noBarrierAsset":this._warningNoBarrierAssetFound=!1;break;case"noBarrierAssetNso":this._warningNoBarrierAssetNsoFound=!1}}_mixCustomStrings(){const{messages:e}=this;this.inputSettings.length>0&&this.inputSettings.forEach(t=>{"starting-point"===t.type&&(e.inputsStrings.headerStartingPoint=t.label,e.inputsStrings.startingPointHint=t.description),"barrier"===t.type&&(e.inputsStrings.headerBarrier=t.label,e.inputsStrings.barrierPointHint=t.description)})}_overrideFlagSymbol(){this.inputSettings.length>0&&this.inputSettings.forEach(e=>{"starting-point"===e.type?this._symbolStartFlag=e.symbol:this._symbolBarrier=e.symbol,this.viewModel.changeFlagSymbol(e.type,e.symbol)})}_processFlagOnLoad(){return this.view?.when().then(()=>{this._watchHandler=r(()=>!this.view?.updating,async()=>{this._warningNoFlag=!1,this._warningNoBarrierAssetFound=!1,this._warningNoStartAssetFound=!1;const e=await this.viewModel.addFlagsOnLoad();this.viewModel.removeFlagsOnLoadWatcher(),e.includes("barrier")&&(this._warningNoBarrierAssetFound=!0),e.includes("starting-point")&&(this._warningNoStartAssetFound=!0),this.disabled=!1,null!==this._watchHandler&&this._watchHandler.remove()})})}_registerWatchers(){this.addHandles([t(()=>this.selectedTraces,()=>{this.viewModel.selectTracesOnLoad(),this.scheduleRender()}),t(()=>this.defaultGraphicColor,()=>{this.viewModel.traceResults.length>0&&this.viewModel.traceResults.forEach(e=>{this.viewModel.changeResultGraphicColor(this.viewModel.defaultGraphicColor,e)}),this.scheduleRender()})])}_renderComboboxItem({text:e,value:t,selected:s}){return _("calcite-combobox-item",{key:t,selected:s,textLabel:e,value:t})}_resetResultFeatureWidget(){this._showFeatureInfoActive=!1,this._resultFeatureWidget.feature=null,this.view.popupEnabled=this._wasPopupEnabled}_resetTraceLocationWarnings(){this._warningNoBarrierAssetFound=!1,this._warningNoBarrierAssetNsoFound=!1,this._warningNoStartAssetFound=!1,this._warningNoStartAssetNsoFound=!1}_setupAddNonspatialObject(e){this._disablePopup(),this._traceLocationType=e,this._addNonspatialObjectActive=!0,this._resetTraceLocationWarnings(),this.viewModel.getNonspatialTraceLocationInitialFeature().then(e=>{this._findNonspatialFeatureWidget.feature=null;const t=e.graphic;this._findNonspatialFeatureWidget.open(t)}).catch(()=>{this._warningNoStartAssetNsoFound="starting-point"===e,this._warningNoBarrierAssetNsoFound="barrier"===e,this._addNonspatialObjectActive=!1}).finally(()=>this._changeCursor("default"))}_setupAddTraceLocation(e){this._traceLocationType=e,this._changeCursor("crosshair"),this._selectToolActive=!0,this._addNonspatialObjectActive=!1,this._resetTraceLocationWarnings(),this.viewModel.addFlagByHit(this._traceLocationType,this._symbolStartFlag).then(e=>{this._changeCursor("default"),e?this._warningNoFlag=!1:(this._warningNoStartAssetFound="starting-point"===this._traceLocationType,this._warningNoBarrierAssetFound="barrier"===this._traceLocationType),this._selectToolActive=!1})}_utilityNetworkTraceInitialized(){this.viewModel.loadUtilityNetwork().then(async e=>{e&&(this.viewModel.selectTracesOnLoad(),this._registerWatchers(),this.viewModel.flags.length>0&&await this._processFlagOnLoad()),this.disabled=!1}).catch(e=>{const{messages:t}=this;this._loadUnError=!1,"utility-network:no-user-type-extension"===e.name||e.details.raw?.extendedCode===N.noExtension?this._errorMessage=t.alertsStrings.noUserExtension:this._errorMessage=e.message,this.disabled=!1})}_viewChangeHandle(){this._wasPopupEnabled=this.view?.popupEnabled??!1,this._findNonspatialFeatureWidget.view=this.view,this._resultFeatureWidget.view=this.view}};e([o()],x.prototype,"_activeTab",void 0),e([o()],x.prototype,"_activeTrace",void 0),e([o()],x.prototype,"_activeSwatch",void 0),e([o()],x.prototype,"_addNonspatialObjectActive",void 0),e([o()],x.prototype,"_alertRemoveModal",void 0),e([o()],x.prototype,"_assetGroupHeader",void 0),e([o()],x.prototype,"_assetTypeHeader",void 0),e([o()],x.prototype,"_confirmReset",void 0),e([o()],x.prototype,"_errorMessage",void 0),e([o()],x.prototype,"_swatchNode",void 0),e([o()],x.prototype,"_selectToolActive",void 0),e([o()],x.prototype,"_showFeatureInfoActive",void 0),e([o()],x.prototype,"_traceHeaderForFlow",void 0),e([o()],x.prototype,"_traceResultsFunctions",void 0),e([o()],x.prototype,"_traceResultsAssetGroup",void 0),e([o()],x.prototype,"_traceResultsAssetType",void 0),e([o()],x.prototype,"_traceResultsIndividual",void 0),e([o()],x.prototype,"_traceResultsState",void 0),e([o()],x.prototype,"_warningNoFlag",void 0),e([o()],x.prototype,"_warningNoTraceSelected",void 0),e([o()],x.prototype,"_updatingHandles",void 0),e([o()],x.prototype,"defaultGraphicColor",null),e([o()],x.prototype,"disabled",void 0),e([o()],x.prototype,"enableResultArea",null),e([o()],x.prototype,"flags",null),e([o()],x.prototype,"icon",null),e([o()],x.prototype,"inputSettings",void 0),e([o()],x.prototype,"label",null),e([o(),g("esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace")],x.prototype,"messages",void 0),e([o(),g("esri/t9n/common")],x.prototype,"messagesCommon",void 0),e([o(),g("esri/core/t9n/Units")],x.prototype,"messagesUnits",void 0),e([o()],x.prototype,"resultAreaProperties",null),e([o()],x.prototype,"selectedTraces",null),e([o()],x.prototype,"selectOnComplete",null),e([o()],x.prototype,"showGraphicsOnComplete",null),e([o()],x.prototype,"showSelectionAttributes",null),e([o({readOnly:!0})],x.prototype,"traceResults",null),e([o()],x.prototype,"utilityNetwork",null),e([o()],x.prototype,"view",null),e([m(["add-flag","add-flag-complete","add-flag-error","select-features","clear-selection","add-result-area","remove-result-area","create-result-area","reset"]),o({type:v})],x.prototype,"viewModel",void 0),x=e([a("esri.widgets.UtilityNetworkTrace")],x);const I=x;export{I as default};
|