text: // All material copyright ESRI, All Rights Reserved, unless otherwise specified.
  // See http://js.arcgis.com/3.34/esri/copyright.txt for details.
  //>>built
  define("esri/dijit/Legend/utils",["dojo/_base/lang","../../lang","dojo/i18n!../../nls/jsapi"],function(h,k,q){var l=q.widgets.legend;return{getVisualVariableTitle:function(a,d){var e,b=a.field,c=a.normalizationField,f=!1,m=!1,n=!1,b=h.isFunction(b)?null:b,c=h.isFunction(c)?null:c;if(a.legendOptions&&a.legendOptions.title)e=a.legendOptions.title;else if(a.valueExpressionTitle)e=a.valueExpressionTitle;else{if(d.renderer&&d.renderer.authoringInfo&&d.renderer.authoringInfo.visualVariables){var p=d.renderer.authoringInfo.visualVariables;
  for(a=0;a<p.length;a++){var g=p[a];if("colorInfo"===g.type&&"ratio"===g.style){f=!0;break}else if("colorInfo"===g.type&&"percent"===g.style){m=!0;break}else if("colorInfo"===g.type&&"percentTotal"===g.style){n=!0;break}}}(f=n&&"showRatioPercentTotal"||m&&"showRatioPercent"||f&&"showRatio"||c&&"showNormField"||b&&"showField"||null)&&(e=k.substitute({field:b&&d.getFieldLabel(b),normField:c&&d.getFieldLabel(c)},"showField"===f?"${field}":l[f]))}return e},getRendererTitle:function(a,d){var e;if(a){var b,
  c,f;"esri.renderer.ClassBreaksRenderer"===a.declaredClass&&(b=a.attributeField,c=a.normalizationField,f="percent-of-total"===a.normalizationType);b=h.isFunction(b)?null:b;c=h.isFunction(c)?null:c;a.legendOptions&&a.legendOptions.title?e=a.legendOptions.title:a.valueExpressionTitle?e=a.valueExpressionTitle:(a=c&&"showNormField"||(f?"showNormPct":null)||b&&"showField"||null)&&(e=k.substitute({field:b&&d.getFieldLabel(b),normField:c&&d.getFieldLabel(c)},"showField"===a?"${field}":l[a]))}return e}}});