/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
*/
define(["../chunks/_rollupPluginBabelHelpers","../chunks/tslib.es6","./Analysis","../core/maybe","../core/unitUtils","../core/accessorSupport/decorators/property","../core/arrayUtils","../core/has","../core/accessorSupport/ensureType","../core/accessorSupport/decorators/subclass","../geometry/Extent","../geometry/Point"],(function(t,e,r,o,n,i,s,a,p,l,u,c){"use strict";let d=function(e){function r(t){var r;return(r=e.call(this,t)||this).type="direct-line-measurement",r.startPoint=null,r.endPoint=null,r.unit=null,r.nonEditableMessage="Assign start and end points to the analysis to allow editing.",r}return t._inheritsLoose(r,e),r.prototype.clear=function(){this.startPoint=null,this.endPoint=null},t._createClass(r,[{key:"extent",get:function(){if(o.isNone(this.startPoint))return null;const t=u.fromPoint(this.startPoint);return o.isSome(this.endPoint)&&t.union(u.fromPoint(this.endPoint)),t}},{key:"requiredPropertiesForEditing",get:function(){return[this.startPoint,this.endPoint]}}]),r}(r);e.__decorate([i.property({type:["direct-line-measurement"]})],d.prototype,"type",void 0),e.__decorate([i.property({type:c})],d.prototype,"startPoint",void 0),e.__decorate([i.property({type:c})],d.prototype,"endPoint",void 0),e.__decorate([i.property()],d.prototype,"extent",null),e.__decorate([i.property({type:n.measurementLengthUnits,value:null})],d.prototype,"unit",void 0),e.__decorate([i.property({readOnly:!0})],d.prototype,"requiredPropertiesForEditing",null),e.__decorate([i.property({readOnly:!0})],d.prototype,"nonEditableMessage",void 0),d=e.__decorate([l.subclass("esri.analysis.DirectLineMeasurementAnalysis")],d);return d}));
