// All material copyright ESRI, All Rights Reserved, unless otherwise specified.
// See http://js.arcgis.com/3.23/esri/copyright.txt for details.
//>>built
define("esri/dijit/geoenrichment/ReportPlayer/dataProviders/supportClasses/attachments/AttributesUtil",["dojo/_base/lang","esri/layers/CodedValueDomain","esri/dijit/geoenrichment/utils/DateUtil","esri/dijit/geoenrichment/utils/ObjectUtil"],function(c,d,e,f){return{composeAttributesFromFieldInfos:function(a,b){return a&&a.filter(function(a){return a.visible}).map(function(a){var c=a.fieldName,d=a.label,e=a.format&&a.format.places,f=a.format&&a.format.digitSeparator,g=a.format&&a.format.dateFormat,
h=b[a.fieldName];a=(a=a.format)&&a.dateFormat?"esriFieldTypeDate":a&&void 0!==a.places?0<a.places?"esriFieldTypeDouble":"esriFieldTypeInteger":"esriFieldTypeString";return{name:c,alias:d,places:e,digitSeparator:f,dateFormat:g,value:h,type:a,domain:null,length:void 0}})},formatAttributeValue:function(a){if(!a)return"";var b=a.domain&&"codedValue"===a.domain.type?new d(a.domain):null;if(b){if(attrValue=b.getName(a.value),void 0===attrValue||null===attrValue)attrValue=a.value}else"esriFieldTypeString"===
a.type?attrValue=a.value:"esriFieldTypeDate"===a.type?(b=new Date,b.setTime(a.value),attrValue=e.formatShortDate(b)):attrValue=f.formatNumber(a.value,{places:a.places,noSeparator:!1===a.digitSeparator});return null===attrValue||void 0===attrValue?"":attrValue},attributeToJson:function(a){return{name:a.name,alias:a.alias,places:a.places,digitSeparator:a.digitSeparator,dateFormat:a.dateFormat,value:a.value,type:a.type,length:a.length,domain:a.domain&&(a.domain.toJson?a.domain.toJson():c.clone(a.domain))}},
attributeFromJson:function(a){return{name:a.name,alias:a.alias,places:a.places,digitSeparator:a.digitSeparator,dateFormat:a.dateFormat,value:a.value,type:a.type,length:a.length,domain:a.domain}}}});