/*
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 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 f from"./FixedBoundariesBinParameters.js";import j from"./FixedIntervalBinParameters.js";import{QueryMixin as h}from"./QueryMixin.js";import{spatialRelKebabDict as v}from"./spatialRelationships.js";import w from"./StatisticDefinition.js";import S from"../../time/TimeExtent.js";import{isTimeZoneValid as g}from"../../time/timeZoneUtils.js";import{enumeration as b}from"../../core/accessorSupport/decorators/enumeration.js";const B=new o({asc:"ascending",desc:"descending"}),R={base:y,key:"type",typeMap:{"auto-interval":d,date:c,"fixed-boundaries":f,"fixed-interval":j}};let T=class extends(h(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:R,json:{name:"bin",write:!0}})],T.prototype,"binParameters",void 0),e([b(B)],T.prototype,"binOrder",void 0),e([s({type:Boolean,json:{write:!0}})],T.prototype,"cacheHint",void 0),e([s({json:{write:!0}})],T.prototype,"datumTransformation",void 0),e([s({type:p,json:{name:"defaultSR",write:!0}})],T.prototype,"defaultSpatialReference",void 0),e([s({type:Number,json:{write:{overridePolicy:e=>({enabled:e>0})}}})],T.prototype,"distance",void 0),e([s({types:m,json:{read:l,write:!0}})],T.prototype,"geometry",void 0),e([s({type:String,json:{write:!0}})],T.prototype,"lowerBoundaryAlias",void 0),e([s({type:p,json:{name:"outSR",write:!0}})],T.prototype,"outSpatialReference",void 0),e([s({type:[w],json:{write:{enabled:!0,overridePolicy(){return{enabled:null!=this.outStatistics&&this.outStatistics.length>0}}}}})],T.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})}}}})],T.prototype,"outTimeZone",null),e([s({type:Boolean,json:{write:!0}})],T.prototype,"returnDistinctValues",void 0),e([b(v,{name:"spatialRel"})],T.prototype,"spatialRelationship",void 0),e([s({type:S,json:{write:!0}})],T.prototype,"timeExtent",void 0),e([s({type:String,json:{write:!0}})],T.prototype,"upperBoundaryAlias",void 0),e([s({type:String,json:{read:u.read,write:{writer:u.write,overridePolicy(e){return{enabled:null!=e&&null!=this.distance}}}}})],T.prototype,"units",void 0),e([s({type:String,json:{write:!0}})],T.prototype,"where",void 0),T=e([n("esri.rest.support.AttributeBinsQuery")],T),T.from=a(T);export{T as default};
