/* COPYRIGHT Esri - https://js.arcgis.com/5.1.0/LICENSE.txt */
import{__decorate as e}from"tslib";import{ClonableMixin as t}from"../../core/Clonable.js";import{JSONMap as o}from"../../core/jsonMap.js";import{JSONSupport as r}from"../../core/JSONSupport.js";import i from"../../core/Logger.js";import{property as s,subclass as n}from"../../core/accessorSupport/decorators.js";import{ensureType as a}from"../../core/accessorSupport/ensureType.js";import p from"../../geometry/SpatialReference.js";import{fromJSON as l}from"../../geometry/support/jsonUtils.js";import{geometryTypes as m}from"../../geometry/support/typeUtils.js";import{unitsKebabDict as u}from"../../layers/graphics/data/queryUtils.js";import d from"./AutoIntervalBinParameters.js";import y from"./BinParametersBase.js";import c from"./DateBinParameters.js";import j from"./FixedBoundariesBinParameters.js";import f from"./FixedIntervalBinParameters.js";import{spatialRelKebabDict as h}from"./spatialRelationships.js";import v from"./StatisticDefinition.js";import w from"../../time/TimeExtent.js";import{isTimeZoneValid as g}from"../../time/timeZoneUtils.js";import{enumeration as S}from"../../core/accessorSupport/decorators/enumeration.js";const b=new o({asc:"ascending",desc:"descending"}),B={base:y,key:"type",typeMap:{"auto-interval":d,date:c,"fixed-boundaries":j,"fixed-interval":f}};let R=class extends(t(r)){constructor(e){super(e),this.binParameters=null,this.binOrder="ascending",this.cacheHint=void 0,this.datumTransformation=null,this.defaultSpatialReference=null,this.distance=void 0,this.geometry=null,this.lowerBoundaryAlias=null,this.outSpatialReference=null,this.outStatistics=null,this.returnDistinctValues=null,this.spatialRelationship="intersects",this.timeExtent=null,this.upperBoundaryAlias=null,this.units=null,this.where="1=1"}set outTimeZone(e){this._set("outTimeZone",e),e&&!g(e)&&i.getLogger(this).warn("#outTimeZone",`the parsed value '${e}' may not be a valid IANA time zone`)}};e([s({types:B,json:{name:"bin",write:!0}})],R.prototype,"binParameters",void 0),e([S(b)],R.prototype,"binOrder",void 0),e([s({type:Boolean,json:{write:!0}})],R.prototype,"cacheHint",void 0),e([s({json:{write:!0}})],R.prototype,"datumTransformation",void 0),e([s({type:p,json:{name:"defaultSR",write:!0}})],R.prototype,"defaultSpatialReference",void 0),e([s({type:Number,json:{write:{overridePolicy:e=>({enabled:e>0})}}})],R.prototype,"distance",void 0),e([s({types:m,json:{read:l,write:!0}})],R.prototype,"geometry",void 0),e([s({type:String,json:{write:!0}})],R.prototype,"lowerBoundaryAlias",void 0),e([s({type:p,json:{name:"outSR",write:!0}})],R.prototype,"outSpatialReference",void 0),e([s({type:[v],json:{write:{enabled:!0,overridePolicy(){return{enabled:null!=this.outStatistics&&this.outStatistics.length>0}}}}})],R.prototype,"outStatistics",void 0),e([s({value:null,json:{name:"outTimeReference",read:{reader:e=>e.ianaTimeZone},write:{writer:(e,t,o)=>{e&&(t[o]={ianaTimeZone:e})}}}})],R.prototype,"outTimeZone",null),e([s({type:Boolean,json:{name:"returnAggIds",write:{overridePolicy:e=>({enabled:null!=e})}}})],R.prototype,"returnAggregateIds",void 0),e([s({type:Boolean,json:{write:!0}})],R.prototype,"returnDistinctValues",void 0),e([S(h,{name:"spatialRel"})],R.prototype,"spatialRelationship",void 0),e([s({type:w,json:{write:!0}})],R.prototype,"timeExtent",void 0),e([s({type:String,json:{write:!0}})],R.prototype,"upperBoundaryAlias",void 0),e([s({type:String,json:{read:u.read,write:{writer:u.write,overridePolicy(e){return{enabled:null!=e&&!!this.distance}}}}})],R.prototype,"units",void 0),e([s({type:String,json:{write:!0}})],R.prototype,"where",void 0),R=e([n("esri.rest.support.AttributeBinsQuery")],R),R.from=a(R);export{R as default};
