/*
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/arrayUtils","../core/Logger","../core/maybe","../core/unitUtils","../core/accessorSupport/decorators/property","../core/has","../core/accessorSupport/ensureType","../core/accessorSupport/decorators/subclass","../geometry/Polygon"],(function(e,t,r,o,n,s,i,l,a,p,u,y){"use strict";const c=n.getLogger("esri.analysis.AreaMeasurementAnalysis");let g=function(t){function r(e){var r;return(r=t.call(this,e)||this).type="area-measurement",r.extent=null,r.unit=null,r.nonEditableMessage="Assign a closed polygon geometry containing more than two points to the analysis to allow editing.",r}return e._inheritsLoose(r,t),r.prototype.clear=function(){this.geometry=null},e._createClass(r,[{key:"geometry",set:function(e){if(s.isNone(e))return this._set("geometry",null),void this._set("extent",null);e.rings.length>1&&c.warn("Measuring polygons with multiple rings is not supported."),this._set("geometry",e.clone()),this._set("extent",e.extent)}},{key:"requiredPropertiesForEditing",get:function(){if(s.isSome(this.geometry)&&1===this.geometry.rings.length){const e=this.geometry.rings[0];if(e.length<=2||!o.equals(e[0],e[e.length-1]))return[null]}return[this.geometry]}}]),r}(r);t.__decorate([l.property({type:["area-measurement"]})],g.prototype,"type",void 0),t.__decorate([l.property({value:null,type:y})],g.prototype,"geometry",null),t.__decorate([l.property({readOnly:!0})],g.prototype,"extent",void 0),t.__decorate([l.property({type:i.measurementAreaUnits,value:null})],g.prototype,"unit",void 0),t.__decorate([l.property({readOnly:!0})],g.prototype,"requiredPropertiesForEditing",null),t.__decorate([l.property({readOnly:!0})],g.prototype,"nonEditableMessage",void 0),g=t.__decorate([u.subclass("esri.analysis.AreaMeasurementAnalysis")],g);return g}));
