text: // All material copyright ESRI, All Rights Reserved, unless otherwise specified.
  // See https://js.arcgis.com/4.8/esri/copyright.txt for details.
  //>>built
  define(["require","exports","@dojo/shim/Map","./attributeSupport"],function(k,l,m,h){Object.defineProperty(l,"__esModule",{value:!0});k=function(){function g(a,b){this._fieldDataCache=new m.default;this._returnDistinctMap=new m.default;this.returnDistinctValues=a.returnDistinctValues;this.fieldsMap=b;if((a=a.outFields)&&-1===a.indexOf("*")){this.outFields=a;for(var c=b=0;c<a.length;c++){var d=a[c],e=h.getExpressionFromFieldName(d),f=this.fieldsMap.has(e),e=f?null:h.getWhereClause(e),f=f?this.fieldsMap.get(d).name:
  h.getAliasFromFieldName(d)||"FIELD_EXP_"+b++;this._fieldDataCache.set(d,{alias:f,clause:e})}}}g.prototype.getAttributes=function(a){a=a.getAttributes();a=this._processAttributesForOutFields(a);return a=this._processAttributesForDistinctValues(a)};g.prototype.getFieldAttribute=function(a,b){a=a.getAttributes();var c=this.fieldsMap.has(b),d=c?null:h.getWhereClause(b);b=c?this.fieldsMap.get(b).name:b;this._fieldDataCache.set(b,{alias:b,clause:d});return c?a[b]:d.calculateValue(a)};g.prototype._processAttributesForOutFields=
  function(a){var b=this.outFields;if(!a||!b||!b.length)return a;for(var c={},d=0;d<b.length;d++){var e=this._fieldDataCache.get(b[d]),f=e.alias,e=e.clause;c[f]=e?e.calculateValue(a):a[f]}return c};g.prototype._processAttributesForDistinctValues=function(a){if(!a||!this.returnDistinctValues)return a;var b=this.outFields,c=[];if(b)for(var d=0;d<b.length;d++){var e=this._fieldDataCache.get(b[d]).alias;c.push(a[e])}else for(e in a)c.push(a[e]);b=(b||["*"]).join(",")+"\x3d"+c.join(",");c=this._returnDistinctMap.get(b)||
  0;this._returnDistinctMap.set(b,++c);return 1<c?null:a};return g}();l.default=k});