/*
All material copyright Esri, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
*/
import{__decorate as t}from"tslib";import{property as i,subclass as e}from"../../../core/accessorSupport/decorators.js";import{getDefaultUnitForView as s}from"../../../support/getDefaultUnitForView.js";import a from"./AnalysisView2D.js";import{DistanceMeasurementController as r}from"./DistanceMeasurement/DistanceMeasurementController.js";import{DistanceMeasurementLineVisualization as n}from"./DistanceMeasurement/DistanceMeasurementLineVisualization.js";import{DistanceMeasurementManipulatorVisualization as o}from"./DistanceMeasurement/DistanceMeasurementManipulatorVisualization.js";import{DistanceMeasurementSketchVisualization as l}from"./DistanceMeasurement/DistanceMeasurementSketchVisualization.js";import{DistanceMeasurementTool as p}from"./DistanceMeasurement/DistanceMeasurementTool.js";import u from"../../interactive/snapping/SnappingOptions.js";let c=class extends a{constructor(t){super(t),this.analysis=null,this.snappingOptions=new u,this.type="distance-measurement-view-2d"}initialize(){const{view:t}=this;this._lineVisualization=new n({view:t,measurementViewData:this}),this._controller=new r({view:t,measurementViewData:this}),this._manipulatorVisualization=new o({view:t,measurementViewData:this}),this._sketchVisualization=new l({view:t,measurementViewData:this}),this._tool=new p({view:t,measurementViewData:this})}destroy(){this._lineVisualization?.destroy(),this._controller?.destroy(),this._manipulatorVisualization?.destroy(),this._sketchVisualization?.destroy(),this._tool?.destroy()}get manipulatorGraphic(){return this._manipulatorVisualization?.graphic}get manipulatorGraphicsLayer(){return this._manipulatorVisualization?.graphicsLayer}get sketchGraphicsLayer(){return this._sketchVisualization?.graphicsLayer}get interactive(){return super.interactive}set interactive(t){super.interactive=t}get result(){return this._controller?.result}get unit(){return this.analysis.unit??s(this.view)}get updating(){return(this._controller?.updating??!0)||(this._lineVisualization?.updating??!0)||(this._sketchVisualization?.updating??!0)||(this._tool?.updating??!0)}get visible(){return super.visible}set visible(t){super.visible=t}async place(t){return this._tool.place(t)}};t([i()],c.prototype,"_lineVisualization",void 0),t([i()],c.prototype,"_controller",void 0),t([i()],c.prototype,"_manipulatorVisualization",void 0),t([i()],c.prototype,"_sketchVisualization",void 0),t([i()],c.prototype,"_tool",void 0),t([i({constructOnly:!0})],c.prototype,"analysis",void 0),t([i()],c.prototype,"manipulatorGraphic",null),t([i()],c.prototype,"manipulatorGraphicsLayer",null),t([i()],c.prototype,"sketchGraphicsLayer",null),t([i({readOnly:!0})],c.prototype,"result",null),t([i({type:u,nonNullable:!0})],c.prototype,"snappingOptions",void 0),t([i({readOnly:!0})],c.prototype,"type",void 0),t([i({readOnly:!0})],c.prototype,"unit",null),t([i({readOnly:!0})],c.prototype,"updating",null),c=t([e("esri.views.2d.analysis.DistanceMeasurementAnalysisView2D")],c);const m=c;export{m as default};
