/*
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 e,subclass as i}from"../../../core/accessorSupport/decorators.js";import{getDefaultUnitForView as a}from"../../../support/getDefaultUnitForView.js";import r from"./AnalysisView2D.js";import{AreaMeasurementAreaVisualization as s}from"./AreaMeasurement/AreaMeasurementAreaVisualization.js";import{AreaMeasurementController as o}from"./AreaMeasurement/AreaMeasurementController.js";import{AreaMeasurementManipulatorVisualization as n}from"./AreaMeasurement/AreaMeasurementManipulatorVisualization.js";import{AreaMeasurementSketchVisualization as p}from"./AreaMeasurement/AreaMeasurementSketchVisualization.js";import{AreaMeasurementTool as l}from"./AreaMeasurement/AreaMeasurementTool.js";import u from"../../interactive/snapping/SnappingOptions.js";let m=class extends r{constructor(t){super(t),this.analysis=null,this.snappingOptions=new u,this.type="area-measurement-view-2d"}initialize(){const{view:t}=this;this._areaVisualization=new s({view:t,measurementViewData:this}),this._controller=new o({view:t,measurementViewData:this}),this._manipulatorVisualization=new n({view:t,measurementViewData:this}),this._sketchVisualization=new p({view:t,measurementViewData:this}),this._tool=new l({view:t,measurementViewData:this})}destroy(){this._areaVisualization?.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??a(this.view)}get updating(){return(this._areaVisualization?.updating??!0)||(this._controller?.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([e()],m.prototype,"_areaVisualization",void 0),t([e()],m.prototype,"_controller",void 0),t([e()],m.prototype,"_manipulatorVisualization",void 0),t([e()],m.prototype,"_sketchVisualization",void 0),t([e()],m.prototype,"_tool",void 0),t([e({constructOnly:!0})],m.prototype,"analysis",void 0),t([e()],m.prototype,"manipulatorGraphic",null),t([e()],m.prototype,"manipulatorGraphicsLayer",null),t([e()],m.prototype,"sketchGraphicsLayer",null),t([e({readOnly:!0})],m.prototype,"result",null),t([e({type:u,nonNullable:!0})],m.prototype,"snappingOptions",void 0),t([e({readOnly:!0})],m.prototype,"type",void 0),t([e({readOnly:!0})],m.prototype,"unit",null),t([e({readOnly:!0})],m.prototype,"updating",null),m=t([i("esri.views.2d.analysis.AreaMeasurementAnalysisView2D")],m);const h=m;export{h as default};
