/* COPYRIGHT Esri - https://js.arcgis.com/5.0.18/LICENSE.txt */
import{__decorate as t}from"tslib";import e from"../../../../../core/Accessor.js";import{destroyHandle as a}from"../../../../../core/handleUtils.js";import{watch as s,sync as r}from"../../../../../core/reactiveUtils.js";import{property as o,subclass as i}from"../../../../../core/accessorSupport/decorators.js";import{UpdatingHandles as n}from"../../../../../core/support/UpdatingHandles.js";import{MeasurementData as p}from"./MeasurementData.js";let l=class extends e{get updating(){return this._updatingHandles.updating}constructor(t){super(t),this._updatingHandles=new n}initialize(){const{view:t}=this,e=new p({view:t});this.analysisViewData.measurementData=e;const o=()=>this._update(e);this.addHandles([this.analysisViewData.path.on("change",o),s(()=>{const{stagedPoint:t,mode:e}=this.analysisViewData;return[t,e]},o,r),a(e)]),o()}destroy(){this._updatingHandles.destroy()}_update(t,e=!1){const{analysisViewData:a,view:s}=this;t.update(a.path,a.stagedPoint,s,{maxRelativeErrorCoplanar:.005,maxRelativeErrorAlmostCoplanar:.01,verticalAngleThreshold:80},a.mode,e,this._updatingHandles)}};t([o({constructOnly:!0})],l.prototype,"view",void 0),t([o({constructOnly:!0})],l.prototype,"analysis",void 0),t([o({constructOnly:!0})],l.prototype,"analysisViewData",void 0),t([o()],l.prototype,"updating",null),l=t([i("esri.views.3d.analysis.AreaMeasurement.support.AreaMeasurementController")],l);export{l as AreaMeasurementController};
