/* COPYRIGHT Esri - https://js.arcgis.com/5.1.0/LICENSE.txt */
import{__decorate as t}from"tslib";import{JSONMap as e}from"../../core/jsonMap.js";import{JSONSupport as r}from"../../core/JSONSupport.js";import{clone as i}from"../../core/lang.js";import{property as o,subclass as s}from"../../core/accessorSupport/decorators.js";import{ensureType as n}from"../../core/accessorSupport/ensureType.js";import p from"../../geometry/SpatialReference.js";import{fromJSON as l}from"../../geometry/support/jsonUtils.js";import{geometryTypes as a}from"../../geometry/support/typeUtils.js";import u from"./TopFilter.js";import d from"../../time/TimeExtent.js";import{writer as c}from"../../core/accessorSupport/decorators/writer.js";var y;const m=new e({esriSpatialRelIntersects:"intersects",esriSpatialRelContains:"contains",esriSpatialRelCrosses:"crosses",esriSpatialRelDisjoint:"disjoint",esriSpatialRelEnvelopeIntersects:"envelope-intersects",esriSpatialRelIndexIntersects:"index-intersects",esriSpatialRelOverlaps:"overlaps",esriSpatialRelTouches:"touches",esriSpatialRelWithin:"within",esriSpatialRelRelation:"relation"}),h=new e({esriSRUnit_Meter:"meters",esriSRUnit_Kilometer:"kilometers",esriSRUnit_Foot:"feet",esriSRUnit_StatuteMile:"miles",esriSRUnit_NauticalMile:"nautical-miles",esriSRUnit_USNauticalMile:"us-nautical-miles"});let j=class extends r{static{y=this}constructor(t){super(t),this.cacheHint=void 0,this.distance=void 0,this.geometry=null,this.geometryPrecision=void 0,this.maxAllowableOffset=void 0,this.num=void 0,this.objectIds=null,this.orderByFields=null,this.outFields=null,this.outSpatialReference=null,this.resultType=null,this.returnGeometry=!1,this.returnM=void 0,this.returnZ=void 0,this.start=void 0,this.spatialRelationship="intersects",this.timeExtent=null,this.topFilter=void 0,this.units=null,this.where="1=1"}writeStart(t,e){e.resultOffset=this.start,e.resultRecordCount=this.num||10}clone(){return new y(i({cacheHint:this.cacheHint,distance:this.distance,geometry:this.geometry,geometryPrecision:this.geometryPrecision,maxAllowableOffset:this.maxAllowableOffset,num:this.num,objectIds:this.objectIds,orderByFields:this.orderByFields,outFields:this.outFields,outSpatialReference:this.outSpatialReference,resultType:this.resultType,returnGeometry:this.returnGeometry,returnZ:this.returnZ,returnM:this.returnM,start:this.start,spatialRelationship:this.spatialRelationship,timeExtent:this.timeExtent,topFilter:this.topFilter,units:this.units,where:this.where}))}};t([o({type:Boolean,json:{write:!0}})],j.prototype,"cacheHint",void 0),t([o({type:Number,json:{write:{overridePolicy:t=>({enabled:!!t})}}})],j.prototype,"distance",void 0),t([o({types:a,json:{read:l,write:!0}})],j.prototype,"geometry",void 0),t([o({type:Number,json:{write:!0}})],j.prototype,"geometryPrecision",void 0),t([o({type:Number,json:{write:!0}})],j.prototype,"maxAllowableOffset",void 0),t([o({type:Number,json:{read:{source:"resultRecordCount"}}})],j.prototype,"num",void 0),t([o({json:{write:!0}})],j.prototype,"objectIds",void 0),t([o({type:[String],json:{write:!0}})],j.prototype,"orderByFields",void 0),t([o({type:[String],json:{write:!0}})],j.prototype,"outFields",void 0),t([o({type:p,json:{read:{source:"outSR"},write:{target:"outSR"}}})],j.prototype,"outSpatialReference",void 0),t([o({type:String,json:{write:!0}})],j.prototype,"resultType",void 0),t([o({json:{write:!0}})],j.prototype,"returnGeometry",void 0),t([o({type:Boolean,json:{write:{overridePolicy:t=>({enabled:t})}}})],j.prototype,"returnM",void 0),t([o({type:Boolean,json:{write:{overridePolicy:t=>({enabled:t})}}})],j.prototype,"returnZ",void 0),t([o({type:Number,json:{read:{source:"resultOffset"}}})],j.prototype,"start",void 0),t([c("start"),c("num")],j.prototype,"writeStart",null),t([o({type:String,json:{read:{source:"spatialRel",reader:m.read},write:{target:"spatialRel",writer:m.write}}})],j.prototype,"spatialRelationship",void 0),t([o({type:d,json:{write:!0}})],j.prototype,"timeExtent",void 0),t([o({type:u,json:{write:!0}})],j.prototype,"topFilter",void 0),t([o({type:String,json:{read:h.read,write:{writer:h.write,overridePolicy(t){return{enabled:null!=t&&!!this.distance}}}}})],j.prototype,"units",void 0),t([o({type:String,json:{write:!0}})],j.prototype,"where",void 0),j=y=t([s("esri.rest.support.TopFeaturesQuery")],j),j.from=n(j);export{j as default};
