// 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/layers/LabelClass","dojo/_base/declare dojo/_base/lang dojo/has dojox/gfx/_base ../kernel ../lang ../symbols/TextSymbol ../symbols/ShieldLabelSymbol".split(" "),function(d,c,k,e,l,f,m,n){var p=RegExp("__begin__","ig"),q=RegExp("__end__","ig"),g=/^__begin__/i,h=/__end__$/i;d=d(null,{declaredClass:"esri.layers.LabelClass",labelPlacement:null,labelExpression:null,format:null,fieldInfos:null,useCodedValues:null,symbol:null,maxScale:0,minScale:0,where:null,sizeInfo:null,_labelPlacementLookup:{"above-center":"esriServerPointLabelPlacementAboveCenter",
"above-left":"esriServerPointLabelPlacementAboveLeft","above-right":"esriServerPointLabelPlacementAboveRight","below-center":"esriServerPointLabelPlacementBelowCenter","below-left":"esriServerPointLabelPlacementBelowLeft","below-right":"esriServerPointLabelPlacementBelowRight","center-center":"esriServerPointLabelPlacementCenterCenter","center-left":"esriServerPointLabelPlacementCenterLeft","center-right":"esriServerPointLabelPlacementCenterRight","above-after":"esriServerLinePlacementAboveAfter",
"above-along":"esriServerLinePlacementAboveAlong","above-before":"esriServerLinePlacementAboveBefore","above-start":"esriServerLinePlacementAboveStart","above-end":"esriServerLinePlacementAboveEnd","below-after":"esriServerLinePlacementBelowAfter","below-along":"esriServerLinePlacementBelowAlong","below-before":"esriServerLinePlacementBelowBefore","below-start":"esriServerLinePlacementBelowStart","below-end":"esriServerLinePlacementBelowEnd","center-after":"esriServerLinePlacementCenterAfter","center-along":"esriServerLinePlacementCenterAlong",
"center-before":"esriServerLinePlacementCenterBefore","center-start":"esriServerLinePlacementCenterStart","center-end":"esriServerLinePlacementCenterEnd","always-horizontal":"esriServerPolygonPlacementAlwaysHorizontal"},constructor:function(a){a&&(c.mixin(this,a),this._labelPlacementLookup.hasOwnProperty(this.labelPlacement)||(this.labelPlacement=f.valueOf(this._labelPlacementLookup,a.labelPlacement)),a.format&&(this.format=a.format),a.fieldInfos&&(this.fieldInfos=a.fieldInfos),a.symbol&&(this.symbol=
"esriSHD"===a.symbol.type?new n(a.symbol):new m(a.symbol)),a=this.sizeInfo)&&(a.minSize&&(a.minSize=e.pt2px(a.minSize)),a.maxSize&&(a.maxSize=e.pt2px(a.maxSize)))},getSymbol:function(){return this.symbol},toJson:function(){var a=this.sizeInfo;a&&(a=c.mixin({},a),a.minSize&&(a.minSize=e.px2pt(a.minSize)),a.maxSize&&(a.maxSize=e.px2pt(a.maxSize)));var b=f.fixJson(this.labelExpressionInfo&&c.clone(this.labelExpressionInfo));this._processLabelExpressionInfo(b);a={name:this.name,labelExpression:this.labelExpression,
labelExpressionInfo:b,format:this.format||void 0,fieldInfos:this.fieldInfos||void 0,useCodedValues:this.useCodedValues,maxScale:this.maxScale,minScale:this.minScale,where:this.where,sizeInfo:a||void 0,labelPlacement:this._labelPlacementLookup.hasOwnProperty(this.labelPlacement)?this._labelPlacementLookup[this.labelPlacement]:this.labelPlacement,symbol:this.symbol&&this.symbol.toJson()};return f.fixJson(a)},_processLabelExpressionInfo:function(a){a&&a.value&&(a.expression=this._convertTemplatedStringToArcade(a.value))},
_convertTemplatedStringToArcade:function(a){var b;a&&(b=c.replace(a,function(a,b){return'__begin__$feature["'+b+'"]__end__'}),b=g.test(b)?b.replace(g,""):'"'+b,b=h.test(b)?b.replace(h,""):b+'"',b=b.replace(p,'" + ').replace(q,' + "'));return b}});k("extend-esri")&&c.setObject("layers.LabelClass",d,l);return d});