/*
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{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{QueryMixin as u}from"./QueryMixin.js";import d from"./TopFilter.js";import c from"../../time/TimeExtent.js";import{writer as y}from"../../core/accessorSupport/decorators/writer.js";var m;const h=new e({esriSpatialRelIntersects:"intersects",esriSpatialRelContains:"contains",esriSpatialRelCrosses:"crosses",esriSpatialRelDisjoint:"disjoint",esriSpatialRelEnvelopeIntersects:"envelope-intersects",esriSpatialRelIndexIntersects:"index-intersects",esriSpatialRelOverlaps:"overlaps",esriSpatialRelTouches:"touches",esriSpatialRelWithin:"within",esriSpatialRelRelation:"relation"}),j=new e({esriSRUnit_Meter:"meters",esriSRUnit_Kilometer:"kilometers",esriSRUnit_Foot:"feet",esriSRUnit_StatuteMile:"miles",esriSRUnit_NauticalMile:"nautical-miles",esriSRUnit_USNauticalMile:"us-nautical-miles"});let v=class extends(u(r)){static{m=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 m(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}})],v.prototype,"cacheHint",void 0),t([o({type:Number,json:{write:{overridePolicy:t=>({enabled:t>0})}}})],v.prototype,"distance",void 0),t([o({types:a,json:{read:l,write:!0}})],v.prototype,"geometry",void 0),t([o({type:Number,json:{write:!0}})],v.prototype,"geometryPrecision",void 0),t([o({type:Number,json:{write:!0}})],v.prototype,"maxAllowableOffset",void 0),t([o({type:Number,json:{read:{source:"resultRecordCount"}}})],v.prototype,"num",void 0),t([o({json:{write:!0}})],v.prototype,"objectIds",void 0),t([o({type:[String],json:{write:!0}})],v.prototype,"orderByFields",void 0),t([o({type:[String],json:{write:!0}})],v.prototype,"outFields",void 0),t([o({type:p,json:{read:{source:"outSR"},write:{target:"outSR"}}})],v.prototype,"outSpatialReference",void 0),t([o({type:String,json:{write:!0}})],v.prototype,"resultType",void 0),t([o({json:{write:!0}})],v.prototype,"returnGeometry",void 0),t([o({type:Boolean,json:{write:{overridePolicy:t=>({enabled:t})}}})],v.prototype,"returnM",void 0),t([o({type:Boolean,json:{write:{overridePolicy:t=>({enabled:t})}}})],v.prototype,"returnZ",void 0),t([o({type:Number,json:{read:{source:"resultOffset"}}})],v.prototype,"start",void 0),t([y("start"),y("num")],v.prototype,"writeStart",null),t([o({type:String,json:{read:{source:"spatialRel",reader:h.read},write:{target:"spatialRel",writer:h.write}}})],v.prototype,"spatialRelationship",void 0),t([o({type:c,json:{write:!0}})],v.prototype,"timeExtent",void 0),t([o({type:d,json:{write:!0}})],v.prototype,"topFilter",void 0),t([o({type:String,json:{read:j.read,write:{writer:j.write,overridePolicy(t){return{enabled:null!=t&&null!=this.distance}}}}})],v.prototype,"units",void 0),t([o({type:String,json:{write:!0}})],v.prototype,"where",void 0),v=m=t([s("esri.rest.support.TopFeaturesQuery")],v),v.from=n(v);export{v as default};
