// All material copyright ESRI, All Rights Reserved, unless otherwise specified.
// See http://js.arcgis.com/3.23/esri/copyright.txt for details.
//>>built
require({cache:{"esri/PopupInfo":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/_base/json dojo/i18n dojo/has dojo/Deferred dojo/sniff dojo/promise/all dojox/html/entities ./lang ./kernel ./request ./promiseList ./tasks/query ./tasks/QueryTask ./tasks/RelationshipQuery ./tasks/StatisticDefinition ./support/expressionUtils ./layers/support/attributeUtils dojo/i18n!dojo/cldr/nls/number".split(" "),function(m,p,t,x,B,q,h,b,a,d,g,e,f,c,k,u,v,r,l,A,y){m=m(null,{declaredClass:"esri.PopupInfo",
_reExprField:/^\s*expression\//i,_exprPrefix:"expression/",_relatedFieldPrefix:"relationships/",initialize:function(a,c){if(a){p.mixin(this,c);this.info=a;this.title=this.getTitle;this.content=this.getContent;this._exprCache=this._compileExpressions(this.info.expressionInfos);var n=this._fieldLabels={},b=this._fieldsMap={};this.info.fieldInfos&&t.forEach(this.info.fieldInfos,function(a){var c=a.fieldName.toLowerCase(),w=this._isExpressionField(c)?this.getExpressionInfo(c):null;n[c]=w?w.title:a.label;
b[c]=a},this);this.titleHasRelatedFields=!(!this.info.title||-1===this.info.title.indexOf("{"+this._relatedFieldPrefix))}},toJson:function(){return x.fromJson(x.toJson(this.info))},getTitle:function(){},getContent:function(){},getFieldInfo:function(a){var c;t.some(this.info&&this.info.fieldInfos,function(n){n.fieldName===a&&(c=n);return!!c});return c},getExpressionInfo:function(a){if(this._isExpressionField(a)){a=a.replace(this._reExprField,"");a=a.toLowerCase();var c;t.some(this.info.expressionInfos,
function(n){n.name.toLowerCase()===a&&(c=n);return!!c});return c}},hasGeometryOperations:function(){return t.some(this.info.expressionInfos,function(a){return l.hasGeometryOperations(a.expression)})},getComponents:function(a){var n=this.info,b={};n.fieldInfos&&(n=t.filter(n.fieldInfos,function(a){return-1!==a.fieldName.indexOf(this._relatedFieldPrefix)},this))&&0<n.length&&(b.relatedInfo=this._getRelatedRecords({graphic:a,fieldsInfo:n}));this._needFullResolutionFeature(a)&&(b.fullResolutionFeature=
this._getFullResolutionFeature(a));return c(b).then(p.hitch(this,function(c){return this._getPopupValues(a,c.fullResolutionFeature)}))},getAttachments:function(a){var c=a.getSourceLayer();a=a.attributes;if(this.info.showAttachments&&c&&c.hasAttachments&&c.objectIdField&&(a=a&&a[c.objectIdField]))return c.queryAttachmentInfos(a)},_needFullResolutionFeature:function(a){return(a=a.getSourceLayer())?"esriGeometryPoint"!==a.geometryType&&"function"===typeof a.getMaxAllowableOffset&&0<a.getMaxAllowableOffset()&&
this.hasGeometryOperations():!1},_getFullResolutionFeature:function(a){var c=a.getSourceLayer(),b=c.objectIdField;a=(a=a.attributes)&&b&&a[b];if(null==a)return null;var n=new k;n.objectIds=[a];n.maxAllowableOffset=0;n.outFields=[b];return c.queryFeatures(n).then(function(a){return a.features&&a.features[0]})},_isExpressionField:function(a){return this._reExprField.test(a)},_compileExpressions:function(a){var c={};t.forEach(a,function(a){var b=a.returnType&&a.returnType.toLowerCase();c[a.name]=A.createAttributeCache({valueExpression:a.expression},
"number"!==b)});return c},_fetchAttributes:function(a,c){var b=p.clone(a.attributes)||{},n=c&&c.geometry,e=this._exprPrefix,f=this._exprCache;t.forEach(this.info.expressionInfos,function(c){var w=e+c.name;c=(c=f[c.name])?a._getDataValue(c.attributeInfo,c,l,null,n):null;"string"===typeof c&&(c=d.encode(c));b[w]=c});return b},_getPopupValues:function(a,c,b){var d=this.info,e=a.getSourceLayer(),n=this._fetchAttributes(a,c),w=p.clone(n);c=d.fieldInfos;var f="",k="",u,C,l,r,E,v=e&&e._getDateOpts&&e._getDateOpts().properties,
v=v&&v.slice(0),h={dateFormat:{properties:v,formatter:"DateFormat"+this._insertOffset(this._dateFormats.shortDateShortTime)}};if(this._relatedInfo)for(r in this._relatedInfo)if(this._relatedInfo.hasOwnProperty(r)){var y=this._relatedInfo[r],A=this._relatedLayersInfo[r];y&&(t.forEach(y.relatedFeatures,function(a){for(E in a.attributes)if(a.attributes.hasOwnProperty(E)&&"esriRelCardinalityOneToOne"===A.relation.cardinality){var c=this._toRelatedFieldName([A.relation.id,E]);n[c]=w[c]=a.attributes[E]}},
this),t.forEach(y.relatedStatsFeatures,function(a){for(E in a.attributes)if(a.attributes.hasOwnProperty(E)){var c=this._toRelatedFieldName([A.relation.id,E]);n[c]=w[c]=a.attributes[E]}},this))}c&&t.forEach(c,function(a){C=a.fieldName;var c=this._getLayerFieldInfo(e,C);c&&(C=a.fieldName=c.name);w[C]=this._formatValue(w[C],C,h);v&&a.format&&a.format.dateFormat&&(a=t.indexOf(v,C),-1<a&&v.splice(a,1))},this);if(e){r=e.types;var q=(y=e.typeIdField)&&n[y];for(C in n)if(n.hasOwnProperty(C)&&-1===C.indexOf(this._relatedFieldPrefix)&&
(l=n[C],g.isDefined(l))){var B=this._getDomainName(e,a,r,q,C,l);g.isDefined(B)?w[C]=B:C===y&&(B=this._getTypeName(e,a,l),g.isDefined(B)&&(w[C]=B))}}d.title&&(f=this._processFieldsInLinks(this._fixTokens(d.title,e),n),f=p.trim(g.substitute(w,f,h)||""));if(b)return{title:f};d.description&&(k=this._processFieldsInLinks(this._fixTokens(d.description,e),n),k=p.trim(g.substitute(w,k,h)||""));c&&(u=[],t.forEach(c,function(a){(C=a.fieldName)&&a.visible&&u.push([this._fieldLabels[C.toLowerCase()]||C,g.substitute(w,
"${"+C+"}",h)||""])},this));var m,x;d.mediaInfos&&(m=[],t.forEach(d.mediaInfos,function(a){x=0;l=a.value;switch(a.type){case "image":var c=l.sourceURL,c=c&&p.trim(g.substitute(n,this._fixTokens(c,e)));x=!!c;break;case "piechart":case "linechart":case "columnchart":case "barchart":var b,c=l.normalizeField;l.fields=t.map(l.fields,function(a){return(b=this._getLayerFieldInfo(e,a))?b.name:a},this);c&&(b=this._getLayerFieldInfo(e,c),l.normalizeField=b?b.name:c);x=t.some(l.fields,function(a){return g.isDefined(n[a])||
-1!==a.indexOf(this._relatedFieldPrefix)&&this._relatedInfo},this);break;default:return}if(x){a=p.clone(a);l=a.value;var c=a.title?this._processFieldsInLinks(this._fixTokens(a.title,e),n):"",d=a.caption?this._processFieldsInLinks(this._fixTokens(a.caption,e),n):"";a.title=c?p.trim(g.substitute(w,c,h)||""):"";a.caption=d?p.trim(g.substitute(w,d,h)||""):"";if("image"===a.type)l.sourceURL=g.substitute(n,this._fixTokens(l.sourceURL,e)),l.linkURL&&(l.linkURL=p.trim(g.substitute(n,this._fixTokens(l.linkURL,
e))||""));else{var f,k;t.forEach(l.fields,function(a,c){if(-1!==a.indexOf(this._relatedFieldPrefix))k=this._getRelatedChartInfos(a,l,n,h),k instanceof Array?l.fields=k:l.fields[c]=k;else{var b=n[a],b=void 0===b?null:b;f=n[l.normalizeField]||0;b&&f&&(b/=f);l.fields[c]={y:b,tooltip:(this._fieldLabels[a.toLowerCase()]||a)+":\x3cbr/\x3e"+this._formatValue(b,a,h,!!f)}}},this)}m.push(a)}},this));return{title:f,description:k,hasDescription:!!d.description,fields:u&&u.length?u:null,mediaInfos:m&&m.length?
m:null,formatted:w,editSummary:e&&e.getEditSummary?e.getEditSummary(a):""}},_getRelatedChartInfos:function(a,c,b,e){var d,n,w,f,k,u;d=[];u=this._fromRelatedFieldName(a);k=u[0];n=this._relatedInfo[k];k=this._relatedLayersInfo[k];n&&t.forEach(n.relatedFeatures,function(n){n=n.attributes;var k,l;for(l in n)if(n.hasOwnProperty(l)&&l===u[1]){k={};f=n[l];c.normalizeField&&(w=-1!==c.normalizeField.indexOf(this._relatedFieldPrefix)?n[this._fromRelatedFieldName(c.normalizeField)[1]]:b[c.normalizeField]);f&&
w&&(f/=w);if(c.tooltipField)if(-1!==c.tooltipField.indexOf(this._relatedFieldPrefix)){var C=this._fromRelatedFieldName(c.tooltipField)[1],r=g.isDefined(n[C])?n[C]:C;k.tooltip=r+":\x3cbr/\x3e"+this._formatValue(f,C,e,!!w)}else k.tooltip=(this._fieldLabels[a.toLowerCase()]||a)+":\x3cbr/\x3e"+this._formatValue(f,c.tooltipField,e,!!w);else k.tooltip=f;k.y=f;d.push(k)}},this);return"esriRelCardinalityOneToMany"===k.relation.cardinality||"esriRelCardinalityManyToMany"===k.relation.cardinality?d:d[0]},_dateFormats:{shortDate:"(datePattern: 'M/d/y', selector: 'date')",
shortDateLE:"(datePattern: 'd/M/y', selector: 'date')",longMonthDayYear:"(datePattern: 'MMMM d, y', selector: 'date')",dayShortMonthYear:"(datePattern: 'd MMM y', selector: 'date')",longDate:"(datePattern: 'EEEE, MMMM d, y', selector: 'date')",shortDateShortTime:"(datePattern: 'M/d/y', timePattern: 'h:mm a', selector: 'date and time')",shortDateLEShortTime:"(datePattern: 'd/M/y', timePattern: 'h:mm a', selector: 'date and time')",shortDateShortTime24:"(datePattern: 'M/d/y', timePattern: 'H:mm', selector: 'date and time')",
shortDateLEShortTime24:"(datePattern: 'd/M/y', timePattern: 'H:mm', selector: 'date and time')",shortDateLongTime:"(datePattern: 'M/d/y', timePattern: 'h:mm:ss a', selector: 'date and time')",shortDateLELongTime:"(datePattern: 'd/M/y', timePattern: 'h:mm:ss a', selector: 'date and time')",shortDateLongTime24:"(datePattern: 'M/d/y', timePattern: 'H:mm:ss', selector: 'date and time')",shortDateLELongTime24:"(datePattern: 'd/M/y', timePattern: 'H:mm:ss', selector: 'date and time')",longMonthYear:"(datePattern: 'MMMM y', selector: 'date')",
shortMonthYear:"(datePattern: 'MMM y', selector: 'date')",year:"(datePattern: 'y', selector: 'date')"},_reHref:/href\s*=\s*\"([^\"]+)\"/ig,_reHrefApos:/href\s*=\s*\'([^\']+)\'/ig,_reEmptyHref:/^href\s*=\s*"\s*"$/i,_reEmptyHrefApos:/^href\s*=\s*'\s*'$/i,_fixTokens:function(a,c){var b=this;return a.replace(/(\{([^\{\r\n]+)\})/g,function(a,e,n){a=b._getLayerFieldInfo(c,n);return"$"+(a?"{"+a.name+"}":e)})},_encodeAttributes:function(a){a=p.clone(a)||{};var c,b;for(c in a)(b=a[c])&&"string"===typeof b&&
(b=encodeURIComponent(b).replace(/\'/g,"\x26apos;"),a[c]=b);return a},_processFieldsInLinks:function(a,c){var b=this._encodeAttributes(c),b=p.hitch(this,this._addValuesToHref,c,b);a&&(a=a.replace(this._reHref,b).replace(this._reHrefApos,b));return a},_addValuesToHref:function(a,c,b,e){e=e&&p.trim(e);b=g.substitute(e&&0===e.indexOf("${")?a:c,b);this._reEmptyHref.test(b)?b='href\x3d"about:blank"':this._reEmptyHrefApos.test(b)&&(b="href\x3d'about:blank'");return b},_getLayerFieldInfo:function(a,c){return a&&
a.getField?a.getField(c):null},_formatValue:function(a,c,b,e){var d=this._fieldsMap[c.toLowerCase()],f=d&&d.format;c=-1!==t.indexOf(b.dateFormat.properties,c);var w="number"===typeof a&&!c&&(!f||!f.dateFormat);if(!g.isDefined(a)||!d||!g.isDefined(f))return w?this._forceLTR(a):a;var n="",d=[],k=f.hasOwnProperty("places")||f.hasOwnProperty("digitSeparator"),u=f.hasOwnProperty("digitSeparator")?f.digitSeparator:!0;if(k&&!c)n="NumberFormat",d.push("places: "+(g.isDefined(f.places)&&(!e||0<f.places)?Number(f.places):
"Infinity")),d.length&&(n+="("+d.join(",")+")");else if(f.dateFormat)n="DateFormat"+this._insertOffset(this._dateFormats[f.dateFormat]||this._dateFormats.shortDateShortTime);else return w?this._forceLTR(a):a;var l=this._applyFormatting(a,n,b);k&&-1<a.constructor.toString().indexOf("Array")&&(l="",t.forEach(a,p.hitch(this,function(a,c){c&&(l+=" ");l+=this._applyFormatting(a,n,b)})));k&&!u&&y.group&&(l=l.replace(new RegExp("\\"+y.group,"g"),""));c&&(l='\x3cspan class\x3d"esriDateValue"\x3e'+l+"\x3c/span\x3e");
return w?this._forceLTR(l):l},_applyFormatting:function(a,c,b){return g.substitute({myKey:a},"${myKey:"+c+"}",b)||""},_forceLTR:function(a){var c=b("ie");return c&&10>=c?a:"\x3cspan class\x3d'esriNumericValue'\x3e"+a+"\x3c/span\x3e"},_insertOffset:function(a){a&&(a=g.isDefined(this.utcOffset)?a.replace(/\)\s*$/,", utcOffset:"+this.utcOffset+")"):a);return a},_getDomainName:function(a,c,b,e,f,d){return(a=a.getDomain&&a.getDomain(f,{feature:c}))&&a.codedValues?a.getName(d):null},_getTypeName:function(a,
c,b){return(a=a.getType&&a.getType(c))&&a.name},_getRelatedRecords:function(a){var c=a.graphic,b;this._relatedLayersInfoPromise||(this._relatedLayersInfoPromise=this._getRelatedLayersInfo(a).then(p.hitch(this,function(a){for(b in a)a.hasOwnProperty(b)&&a[b]&&(this._relatedLayersInfo[b].relatedLayerInfo=a[b])})));return this._relatedLayersInfoPromise.then(p.hitch(this,function(){return this._queryRelatedLayers(c)})).then(p.hitch(this,function(a){this._setRelatedRecords(c,a);return a}))},_getRelatedLayersInfo:function(c){var b=
c.fieldsInfo,e,d,k={};e=c.graphic.getSourceLayer();this._relatedLayersInfo||(this._relatedLayersInfo={});t.forEach(b,function(a){var c,b,d,f;c=this._fromRelatedFieldName(a.fieldName);b=c[0];c=c[1];b&&(!this._relatedLayersInfo[b]&&e&&e.relationships&&(t.some(e.relationships,function(a){if(a.id==b)return f=a,!0}),f&&(this._relatedLayersInfo[b]={relation:f,relatedFields:[],outStatistics:[]})),this._relatedLayersInfo[b]&&(this._relatedLayersInfo[b].relatedFields.push(c),a.statisticType&&(d=new r,d.statisticType=
a.statisticType,d.onStatisticField=c,d.outStatisticFieldName=c,this._relatedLayersInfo[b].outStatistics.push(d))))},this);for(d in this._relatedLayersInfo)this._relatedLayersInfo.hasOwnProperty(d)&&this._relatedLayersInfo[d]&&(c=this._relatedLayersInfo[d].relation,c=e.url.replace(/[0-9]+$/,c.relatedTableId),this._relatedLayersInfo[d].relatedLayerUrl=c,k[d]=f({url:c,content:{f:"json"},callbackParamName:"callback"}));return a(k)},_queryRelatedLayers:function(c){var b={},d;for(d in this._relatedLayersInfo)this._relatedLayersInfo.hasOwnProperty(d)&&
(b[d]=this._queryRelatedLayer({graphic:c,relatedInfo:this._relatedLayersInfo[d]}));return a(b)},_queryRelatedLayer:function(c){var b,d,e,f,n,w,l,g,r,v,y,A,q;b=c.graphic;d=b.getSourceLayer();e=d.url.match(/[0-9]+$/g)[0];y=c.relatedInfo;v=y.relatedLayerInfo;A=y.relatedLayerUrl;c=y.relation;t.some(v.relationships,function(a){if(a.relatedTableId===parseInt(e,10))return f=a,!0},this);f&&(n=new k,t.some(v.fields,function(a){if(a.name===f.keyField)return g=-1!==t.indexOf(["esriFieldTypeSmallInteger","esriFieldTypeInteger",
"esriFieldTypeSingle","esriFieldTypeDouble"],a.type)?"number":"string",!0}),f.relationshipTableId&&f.keyFieldInRelationshipTable?(q=new h,this._queryRelatedRecords(b,f).then(p.hitch(this,function(a){var c;(c=a[b.attributes[d.objectIdField]])?(a=t.map(c.features,function(a){return a.attributes[v.objectIdField]},this),y.outStatistics&&0<y.outStatistics.length&&v.supportsStatistics&&(r=new k,r.objectIds=a,r.outFields=n.outFields,r.outStatistics=y.outStatistics),r&&(w=new u(A),w.execute(r).then(p.hitch(this,
function(a){var b=[];b.push(c);b.push(a);q.resolve(b)})))):q.resolve()}))):(l="string"===g?f.keyField+"\x3d'"+b.attributes[c.keyField]+"'":f.keyField+"\x3d"+b.attributes[c.keyField],n.where=l,n.outFields=y.relatedFields,y.outStatistics&&0<y.outStatistics.length&&v.supportsStatistics&&(r=new k,r.where=n.where,r.outFields=n.outFields,r.outStatistics=y.outStatistics),w=new u(A),l=[],l.push(w.execute(n)),r&&l.push(w.execute(r))));return l?a(l):q?q.promise:void 0},_setRelatedRecords:function(a,c){this._relatedInfo=
[];for(var b in c)if(c.hasOwnProperty(b)&&c[b]){var d=c[b];this._relatedInfo[b]={};this._relatedInfo[b].relatedFeatures=d[0].features;g.isDefined(d[1])&&(this._relatedInfo[b].relatedStatsFeatures=d[1].features)}},_handlerErrorResponse:function(a,c){a.reject(c)},_fromRelatedFieldName:function(a){var c=[];-1!==a.indexOf(this._relatedFieldPrefix)&&(a=a.split("/"),c=a.slice(1));return c},_toRelatedFieldName:function(a){var c="";a&&0<a.length&&(c=this._relatedFieldPrefix+a[0]+"/"+a[1]);return c},_queryRelatedRecords:function(a,
c){var b=a.getSourceLayer(),d=new v;d.outFields=["*"];d.relationshipId=c.id;d.objectIds=[a.attributes[b.objectIdField]];return b.queryRelatedFeatures(d)}});q("extend-esri")&&(e.PopupInfo=e.PopupInfoTemplate=m);return m})},"dojox/html/entities":function(){define(["dojo/_base/lang"],function(m){var p=m.getObject("dojox.html.entities",!0),t=function(p,q){var h,b;if(q._encCache&&q._encCache.regexp&&q._encCache.mapper&&q.length==q._encCache.length)h=q._encCache.mapper,b=q._encCache.regexp;else{h={};b=
["["];var a;for(a=0;a<q.length;a++)h[q[a][0]]="\x26"+q[a][1]+";",b.push(q[a][0]);b.push("]");b=new RegExp(b.join(""),"g");q._encCache={mapper:h,regexp:b,length:q.length}}return p=p.replace(b,function(a){return h[a]})},x=function(p,q){var h,b;if(q._decCache&&q._decCache.regexp&&q._decCache.mapper&&q.length==q._decCache.length)h=q._decCache.mapper,b=q._decCache.regexp;else{h={};b=["("];var a;for(a=0;a<q.length;a++){var d="\x26"+q[a][1]+";";a&&b.push("|");h[d]=q[a][0];b.push(d)}b.push(")");b=new RegExp(b.join(""),
"g");q._decCache={mapper:h,regexp:b,length:q.length}}return p=p.replace(b,function(a){return h[a]})};p.html=[["\x26","amp"],['"',"quot"],["\x3c","lt"],["\x3e","gt"],["\u00a0","nbsp"]];p.latin=[["\u00a1","iexcl"],["\u00a2","cent"],["\u00a3","pound"],["\u20ac","euro"],["\u00a4","curren"],["\u00a5","yen"],["\u00a6","brvbar"],["\u00a7","sect"],["\u00a8","uml"],["\u00a9","copy"],["\u00aa","ordf"],["\u00ab","laquo"],["\u00ac","not"],["\u00ad","shy"],["\u00ae","reg"],["\u00af","macr"],["\u00b0","deg"],["\u00b1",
"plusmn"],["\u00b2","sup2"],["\u00b3","sup3"],["\u00b4","acute"],["\u00b5","micro"],["\u00b6","para"],["\u00b7","middot"],["\u00b8","cedil"],["\u00b9","sup1"],["\u00ba","ordm"],["\u00bb","raquo"],["\u00bc","frac14"],["\u00bd","frac12"],["\u00be","frac34"],["\u00bf","iquest"],["\u00c0","Agrave"],["\u00c1","Aacute"],["\u00c2","Acirc"],["\u00c3","Atilde"],["\u00c4","Auml"],["\u00c5","Aring"],["\u00c6","AElig"],["\u00c7","Ccedil"],["\u00c8","Egrave"],["\u00c9","Eacute"],["\u00ca","Ecirc"],["\u00cb","Euml"],
["\u00cc","Igrave"],["\u00cd","Iacute"],["\u00ce","Icirc"],["\u00cf","Iuml"],["\u00d0","ETH"],["\u00d1","Ntilde"],["\u00d2","Ograve"],["\u00d3","Oacute"],["\u00d4","Ocirc"],["\u00d5","Otilde"],["\u00d6","Ouml"],["\u00d7","times"],["\u00d8","Oslash"],["\u00d9","Ugrave"],["\u00da","Uacute"],["\u00db","Ucirc"],["\u00dc","Uuml"],["\u00dd","Yacute"],["\u00de","THORN"],["\u00df","szlig"],["\u00e0","agrave"],["\u00e1","aacute"],["\u00e2","acirc"],["\u00e3","atilde"],["\u00e4","auml"],["\u00e5","aring"],
["\u00e6","aelig"],["\u00e7","ccedil"],["\u00e8","egrave"],["\u00e9","eacute"],["\u00ea","ecirc"],["\u00eb","euml"],["\u00ec","igrave"],["\u00ed","iacute"],["\u00ee","icirc"],["\u00ef","iuml"],["\u00f0","eth"],["\u00f1","ntilde"],["\u00f2","ograve"],["\u00f3","oacute"],["\u00f4","ocirc"],["\u00f5","otilde"],["\u00f6","ouml"],["\u00f7","divide"],["\u00f8","oslash"],["\u00f9","ugrave"],["\u00fa","uacute"],["\u00fb","ucirc"],["\u00fc","uuml"],["\u00fd","yacute"],["\u00fe","thorn"],["\u00ff","yuml"],
["\u0192","fnof"],["\u0391","Alpha"],["\u0392","Beta"],["\u0393","Gamma"],["\u0394","Delta"],["\u0395","Epsilon"],["\u0396","Zeta"],["\u0397","Eta"],["\u0398","Theta"],["\u0399","Iota"],["\u039a","Kappa"],["\u039b","Lambda"],["\u039c","Mu"],["\u039d","Nu"],["\u039e","Xi"],["\u039f","Omicron"],["\u03a0","Pi"],["\u03a1","Rho"],["\u03a3","Sigma"],["\u03a4","Tau"],["\u03a5","Upsilon"],["\u03a6","Phi"],["\u03a7","Chi"],["\u03a8","Psi"],["\u03a9","Omega"],["\u03b1","alpha"],["\u03b2","beta"],["\u03b3",
"gamma"],["\u03b4","delta"],["\u03b5","epsilon"],["\u03b6","zeta"],["\u03b7","eta"],["\u03b8","theta"],["\u03b9","iota"],["\u03ba","kappa"],["\u03bb","lambda"],["\u03bc","mu"],["\u03bd","nu"],["\u03be","xi"],["\u03bf","omicron"],["\u03c0","pi"],["\u03c1","rho"],["\u03c2","sigmaf"],["\u03c3","sigma"],["\u03c4","tau"],["\u03c5","upsilon"],["\u03c6","phi"],["\u03c7","chi"],["\u03c8","psi"],["\u03c9","omega"],["\u03d1","thetasym"],["\u03d2","upsih"],["\u03d6","piv"],["\u2022","bull"],["\u2026","hellip"],
["\u2032","prime"],["\u2033","Prime"],["\u203e","oline"],["\u2044","frasl"],["\u2118","weierp"],["\u2111","image"],["\u211c","real"],["\u2122","trade"],["\u2135","alefsym"],["\u2190","larr"],["\u2191","uarr"],["\u2192","rarr"],["\u2193","darr"],["\u2194","harr"],["\u21b5","crarr"],["\u21d0","lArr"],["\u21d1","uArr"],["\u21d2","rArr"],["\u21d3","dArr"],["\u21d4","hArr"],["\u2200","forall"],["\u2202","part"],["\u2203","exist"],["\u2205","empty"],["\u2207","nabla"],["\u2208","isin"],["\u2209","notin"],
["\u220b","ni"],["\u220f","prod"],["\u2211","sum"],["\u2212","minus"],["\u2217","lowast"],["\u221a","radic"],["\u221d","prop"],["\u221e","infin"],["\u2220","ang"],["\u2227","and"],["\u2228","or"],["\u2229","cap"],["\u222a","cup"],["\u222b","int"],["\u2234","there4"],["\u223c","sim"],["\u2245","cong"],["\u2248","asymp"],["\u2260","ne"],["\u2261","equiv"],["\u2264","le"],["\u2265","ge"],["\u2282","sub"],["\u2283","sup"],["\u2284","nsub"],["\u2286","sube"],["\u2287","supe"],["\u2295","oplus"],["\u2297",
"otimes"],["\u22a5","perp"],["\u22c5","sdot"],["\u2308","lceil"],["\u2309","rceil"],["\u230a","lfloor"],["\u230b","rfloor"],["\u2329","lang"],["\u232a","rang"],["\u25ca","loz"],["\u2660","spades"],["\u2663","clubs"],["\u2665","hearts"],["\u2666","diams"],["\u0152","OElig"],["\u0153","oelig"],["\u0160","Scaron"],["\u0161","scaron"],["\u0178","Yuml"],["\u02c6","circ"],["\u02dc","tilde"],["\u2002","ensp"],["\u2003","emsp"],["\u2009","thinsp"],["\u200c","zwnj"],["\u200d","zwj"],["\u200e","lrm"],["\u200f",
"rlm"],["\u2013","ndash"],["\u2014","mdash"],["\u2018","lsquo"],["\u2019","rsquo"],["\u201a","sbquo"],["\u201c","ldquo"],["\u201d","rdquo"],["\u201e","bdquo"],["\u2020","dagger"],["\u2021","Dagger"],["\u2030","permil"],["\u2039","lsaquo"],["\u203a","rsaquo"]];p.encode=function(m,q){m&&(q?m=t(m,q):(m=t(m,p.html),m=t(m,p.latin)));return m};p.decode=function(m,q){m&&(q?m=x(m,q):(m=x(m,p.html),m=x(m,p.latin)));return m};return p})},"esri/promiseList":function(){define(["dojo/_base/array","dojo/Deferred",
"dojo/when"],function(m,p,t){var x=m.forEach;return function(m){function q(c,b){a[b]=c;e.progress([c,b]);0===--f&&e.resolve(a)}var h,b;m instanceof Array?b=m:m&&"object"===typeof m&&(h=m);var a,d=[];if(h){b=[];for(var g in h)Object.hasOwnProperty.call(h,g)&&(d.push(g),b.push(h[g]));a={}}else b&&(a=[]);if(!b||!b.length)return(new p).resolve(a);var e=new p;e.promise.always(function(){a=d=null});var f=b.length;x(b,function(a,b){h||d.push(b);t(a,function(a){e.isFulfilled()||q(a,d[b])},function(a){e.isFulfilled()||
q(a,d[b])})});return e.promise}})},"esri/tasks/QueryTask":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/_base/Deferred dojo/_base/json dojo/has ../kernel ../request ../deferredUtils ../geometry/Extent ../geometry/normalizeUtils ./Task ./FeatureSet".split(" "),function(m,p,t,x,B,q,h,b,a,d,g,e,f){m=m(e,{declaredClass:"esri.tasks.QueryTask",_eventMap:{complete:["featureSet"],"execute-for-count-complete":["count"],"execute-for-ids-complete":["objectIds"],"execute-relationship-query-complete":["featureSets"]},
constructor:function(a,b){this._handler=p.hitch(this,this._handler);this._relationshipQueryHandler=p.hitch(this,this._relationshipQueryHandler);this._executeForIdsHandler=p.hitch(this,this._executeForIdsHandler);this._countHandler=p.hitch(this,this._countHandler);this._extentHandler=p.hitch(this,this._extentHandler);this.source=b&&b.source;this.gdbVersion=b&&b.gdbVersion;this.registerConnectEvents()},__msigns:[{n:"execute",c:4,a:[{i:0,p:["geometry"]}],e:2},{n:"executeForIds",c:3,a:[{i:0,p:["geometry"]}],
e:2},{n:"executeForCount",c:3,a:[{i:0,p:["geometry"]}],e:2},{n:"executeForExtent",c:3,a:[{i:0,p:["geometry"]}],e:2}],onComplete:function(){},onExecuteRelationshipQueryComplete:function(){},onExecuteForIdsComplete:function(){},onExecuteForCountComplete:function(){},onExecuteForExtentComplete:function(){},execute:function(a,d,e,f,g){f=g.assembly;a=this._encode(p.mixin({},this._url.query,{f:"json"},a.toJson(f&&f[0])));var c=this._handler,k=this._errorHandler;this.source&&(f={source:this.source.toJson()},
a.layer=B.toJson(f));this.gdbVersion&&(a.gdbVersion=this.gdbVersion);return b({url:this._url.path+"/query",content:a,callbackParamName:"callback",load:function(a,b){c(a,b,d,e,g.dfd)},error:function(a){k(a,e,g.dfd)}},this.requestOptions)},executeRelationshipQuery:function(c,d,f){c=this._encode(p.mixin({},this._url.query,{f:"json"},c.toJson()));var e=this._relationshipQueryHandler,k=this._errorHandler;this.gdbVersion&&(c.gdbVersion=this.gdbVersion);var l=new x(a._dfdCanceller);l._pendingDfd=b({url:this._url.path+
"/queryRelatedRecords",content:c,callbackParamName:"callback",load:function(a,c){e(a,c,d,f,l)},error:function(a){k(a,f,l)}},this.requestOptions);return l},executeForIds:function(a,d,f,e){var c=e.assembly;a=this._encode(p.mixin({},this._url.query,{f:"json",returnIdsOnly:!0},a.toJson(c&&c[0])));var k=this._executeForIdsHandler,g=this._errorHandler;this.source&&(c={source:this.source.toJson()},a.layer=B.toJson(c));this.gdbVersion&&(a.gdbVersion=this.gdbVersion);return b({url:this._url.path+"/query",
content:a,callbackParamName:"callback",load:function(a,c){k(a,c,d,f,e.dfd)},error:function(a){g(a,f,e.dfd)}},this.requestOptions)},executeForCount:function(a,d,f,e){var c=e.assembly;a=this._encode(p.mixin({},this._url.query,{f:"json",returnIdsOnly:!0,returnCountOnly:!0},a.toJson(c&&c[0])));var k=this._countHandler,g=this._errorHandler;this.source&&(c={source:this.source.toJson()},a.layer=B.toJson(c));this.gdbVersion&&(a.gdbVersion=this.gdbVersion);return b({url:this._url.path+"/query",content:a,callbackParamName:"callback",
load:function(a,c){k(a,c,d,f,e.dfd)},error:function(a){g(a,f,e.dfd)}},this.requestOptions)},executeForExtent:function(a,d,e,f){var c=f.assembly;a=this._encode(p.mixin({},this._url.query,{f:"json",returnExtentOnly:!0,returnCountOnly:!0},a.toJson(c&&c[0])));var k=this._extentHandler,g=this._errorHandler;this.source&&(c={source:this.source.toJson()},a.layer=B.toJson(c));this.gdbVersion&&(a.gdbVersion=this.gdbVersion);return b({url:this._url.path+"/query",content:a,callbackParamName:"callback",load:function(a,
c){k(a,c,d,e,f.dfd)},error:function(a){g(a,e,f.dfd)}},this.requestOptions)},_handler:function(a,b,d,e,g){try{var c=new f(a);this._successHandler([c],"onComplete",d,g)}catch(A){this._errorHandler(A,e,g)}},_relationshipQueryHandler:function(a,b,d,e,g){try{var c=a.geometryType,k=a.spatialReference,u={};t.forEach(a.relatedRecordGroups,function(a){var b={};b.geometryType=c;b.spatialReference=k;b.features=a.relatedRecords;b=new f(b);if(null!=a.objectId)u[a.objectId]=b;else for(var d in a)a.hasOwnProperty(d)&&
"relatedRecords"!==d&&(u[a[d]]=b)});this._successHandler([u],"onExecuteRelationshipQueryComplete",d,g)}catch(n){this._errorHandler(n,e,g)}},_executeForIdsHandler:function(a,b,d,e,f){try{this._successHandler([a.objectIds],"onExecuteForIdsComplete",d,f)}catch(l){this._errorHandler(l,e,f)}},_countHandler:function(a,b,d,e,f){try{var c,k=a.features,g=a.objectIds;if(g)c=g.length;else{if(k)throw Error("Unable to perform query. Please check your parameters.");c=a.count}this._successHandler([c],"onExecuteForCountComplete",
d,f)}catch(n){this._errorHandler(n,e,f)}},_extentHandler:function(a,b,e,f,g){try{a.extent&&(a.extent=new d(a.extent)),this._successHandler([a],"onExecuteForExtentComplete",e,g)}catch(l){this._errorHandler(l,f,g)}}});g._createWrappers(m);q("extend-esri")&&p.setObject("tasks.QueryTask",m,h);return m})},"esri/tasks/Task":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/json dojo/has ../kernel ../deferredUtils ../urlUtils ../Evented".split(" "),function(m,p,t,x,B,q,h,b){m=m(b,{declaredClass:"esri.tasks._Task",
_eventMap:{error:["error"],complete:["result"]},constructor:function(a,b){a&&p.isString(a)&&(this._url=h.urlToObject(this.url=a));b&&b.requestOptions&&(this.requestOptions=b.requestOptions);this.normalization=!0;this._errorHandler=p.hitch(this,this._errorHandler);this.registerConnectEvents()},_useSSL:function(){var a=this._url,b=/^http:/i;this.url&&(this.url=this.url.replace(b,"https:"));a&&a.path&&(a.path=a.path.replace(b,"https:"))},_encode:function(a,b,g){var d,f,c={},k,u;for(k in a)if("declaredClass"!==
k&&(d=a[k],f=typeof d,null!==d&&void 0!==d&&"function"!==f))if(p.isArray(d))for(c[k]=[],u=d.length,f=0;f<u;f++)c[k][f]=this._encode(d[f]);else"object"===f?d.toJson&&(f=d.toJson(g&&g[k]),"esri.tasks.FeatureSet"===d.declaredClass&&f.spatialReference&&(f.sr=f.spatialReference,delete f.spatialReference),c[k]=b?f:t.toJson(f)):c[k]=d;return c},_successHandler:function(a,b,g,e){b&&this[b].apply(this,a);g&&g.apply(null,a);e&&q._resDfd(e,a)},_errorHandler:function(a,b,g){this.onError(a);b&&b(a);g&&g.errback(a)},
setNormalization:function(a){this.normalization=a},onError:function(){}});x("extend-esri")&&(B.Task=m);return m})},"esri/tasks/FeatureSet":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/has ../kernel ../lang ../graphic ../SpatialReference ../graphicsUtils ../geometry/jsonUtils ../symbols/jsonUtils".split(" "),function(m,p,t,x,B,q,h,b,a,d,g){m=m(null,{declaredClass:"esri.tasks.FeatureSet",constructor:function(a){if(a){p.mixin(this,a);var f=this.features,c=a.spatialReference,
e=d.getGeometryType(a.geometryType),c=this.spatialReference=new b(c);this.geometryType=a.geometryType;a.fields&&(this.fields=a.fields);t.forEach(f,function(a,b){var d=a.geometry&&a.geometry.spatialReference;f[b]=new h(e&&a.geometry?new e(a.geometry):null,a.symbol&&g.fromJson(a.symbol),a.attributes);f[b].geometry&&!d&&f[b].geometry.setSpatialReference(c)});this._hydrate()}else this.features=[]},displayFieldName:null,geometryType:null,spatialReference:null,fieldAliases:null,toJson:function(b){var f=
{};this.displayFieldName&&(f.displayFieldName=this.displayFieldName);this.fields&&(f.fields=this.fields);this.spatialReference?f.spatialReference=this.spatialReference.toJson():this.features[0]&&this.features[0].geometry&&(f.spatialReference=this.features[0].geometry.spatialReference.toJson());this.features[0]&&(this.features[0].geometry&&(f.geometryType=d.getJsonType(this.features[0].geometry)),f.features=a._encodeGraphics(this.features,b));f.geometryType=f.geometryType||this.geometryType;f.exceededTransferLimit=
this.exceededTransferLimit;f.transform=this.transform;return q.fixJson(f)},_hydrate:function(){var a=this.transform,b=this.geometryType;if(a&&b)for(var c=this.features,d=a.translate[0],g=a.translate[1],h=a.scale[0],r=a.scale[1],l=function(a,b,c){if("esriGeometryPoint"===a)return function(a){a.x=b(a.x);a.y=c(a.y)};if("esriGeometryPolyline"===a||"esriGeometryPolygon"===a)return function(a){a=a.rings||a.paths;var d,f,e,g,w,k,l,n;d=0;for(f=a.length;d<f;d++)for(w=a[d],e=0,g=w.length;e<g;e++)k=w[e],0<e?
(l+=k[0],n+=k[1]):(l=k[0],n=k[1]),k[0]=b(l),k[1]=c(n)};if("esriGeometryEnvelope"===a)return function(a){a.xmin=b(a.xmin);a.ymin=c(a.ymin);a.xmax=b(a.xmax);a.ymax=c(a.ymax)};if("esriGeometryMultipoint"===a)return function(a){a=a.points;var d,f,e,k,w;d=0;for(f=a.length;d<f;d++)e=a[d],0<d?(k+=e[0],w+=e[1]):(k=e[0],w=e[1]),e[0]=b(k),e[1]=c(w)}}(b,function(a){return a*h+d},function(a){return g-a*r}),a=0,b=c.length;a<b;a++)c[a].geometry&&l(c[a].geometry);this.transform=null},quantize:function(a){if(!this.geometryType)return this.transform=
null,this;var b=a.translate[0],c=a.translate[1],d=a.scale[0],e=a.scale[1],g=this.features,h=function(a,b,c){var d,f,e,w,k,g,l=[];d=0;for(f=a.length;d<f;d++)if(e=a[d],0<d){if(g=b(e[0]),e=c(e[1]),g!==w||e!==k)l.push([g-w,e-k]),w=g,k=e}else w=b(e[0]),k=c(e[1]),l.push([w,k]);return 0<l.length?l:null},l=function(a,b,c){if("esriGeometryPoint"===a)return function(a){a.x=b(a.x);a.y=c(a.y);return a};if("esriGeometryPolyline"===a||"esriGeometryPolygon"===a)return function(a){var d,f,e,k,g;e=a.rings||a.paths;
g=[];d=0;for(f=e.length;d<f;d++)k=e[d],(k=h(k,b,c))&&g.push(k);return 0<g.length?(a.rings?a.rings=g:a.paths=g,a):null};if("esriGeometryMultipoint"===a)return function(a){var d;d=h(a.points,b,c);return 0<d.length?(a.points=d,a):null};if("esriGeometryEnvelope"===a)return function(a){return a}}(this.geometryType,function(a){return Math.round((a-b)/d)},function(a){return Math.round((c-a)/e)}),A,y;A=0;for(y=g.length;A<y;A++)g[A].geometry&&(l(g[A].geometry)||g[A].setGeometry(null));this.transform=a;return this}});
x("extend-esri")&&p.setObject("tasks.FeatureSet",m,B);return m})},"esri/tasks/RelationshipQuery":function(){define(["dojo/_base/declare","dojo/_base/lang","dojo/_base/json","dojo/has","../kernel"],function(m,p,t,x,B){m=m(null,{declaredClass:"esri.tasks.RelationshipQuery",definitionExpression:"",relationshipId:null,returnGeometry:!1,objectIds:null,outSpatialReference:null,outFields:null,toJson:function(){var m={definitionExpression:this.definitionExpression,relationshipId:this.relationshipId,returnGeometry:this.returnGeometry,
maxAllowableOffset:this.maxAllowableOffset,geometryPrecision:this.geometryPrecision},h=this.objectIds,b=this.outFields,a=this.outSpatialReference;h&&(m.objectIds=h.join(","));b&&(m.outFields=b.join(","));a&&(m.outSR=a.wkid||t.toJson(a.toJson()));m._ts=this._ts;return m}});x("extend-esri")&&p.setObject("tasks.RelationshipQuery",m,B);return m})},"esri/tasks/StatisticDefinition":function(){define(["dojo/_base/declare","dojo/_base/lang","dojo/has","../kernel"],function(m,p,t,x){m=m(null,{declaredClass:"esri.tasks.StatisticDefinition",
toJson:function(){return{statisticType:this.statisticType,onStatisticField:this.onStatisticField,outStatisticFieldName:this.outStatisticFieldName,maxPointCount:this.maxPointCount,maxRecordCount:this.maxRecordCount,maxVertexCount:this.maxVertexCount}}});t("extend-esri")&&p.setObject("tasks.StatisticDefinition",m,x);return m})},"esri/core/timerUtils":function(){define([],function(){function m(m){var h,b=m.length;for(h=0;h<b;h++)m[h]()}var p={LOW:1,HIGH:2},t,x={};x[p.LOW]=[];x[p.HIGH]=[];var B=function(){clearTimeout(t);
t=null;var q=x[p.HIGH];x[p.HIGH]=[];m(q);q=x[p.LOW];x[p.LOW]=[];m(q)};return{priority:p,callbackQueue:x,setTimeout:function(m,h){var b=[h,x[h].push(m)-1];t||(t=setTimeout(B,0));return b},clearTimeout:function(m){m&&x[m[0]].splice(m[1],1)}}})},"esri/layers/labelLayerUtils/DynamicLabelClass":function(){define("dojo/_base/declare dojo/_base/lang dojo/has ../../kernel ../../geometry/Extent ../../geometry/Polygon".split(" "),function(m,p,t,x,B,q){m=m(null,{declaredClass:"esri.layers.labelLayerUtils.DynamicLabelClass",
constructor:function(){this._preparedLabels=[];this._placedLabels=[];this._extent=null;this._y1=this._x1=this._y0=this._x0=this._ymax=this._ymin=this._xmax=this._xmin=0;this._scale=1},setMap:function(h,b){this._labelLayer=b;this._xmin=h.extent.xmin;this._xmax=h.extent.xmax;this._ymin=h.extent.ymin;this._ymax=h.extent.ymax;this._scale=(this._xmax-this._xmin)/h.width},_process:function(h){this._preparedLabels=h;this._placedLabels=[];var b;for(h=this._preparedLabels.length-1;0<=h;h--){var a=this._preparedLabels[h],
d=Math.min(a.labelWidth,a.labelHeight),g=a.labelWidth+0*d,d=a.labelHeight+0*d,e=(b=a.options)&&void 0!==b.lineLabelPlacement?b.lineLabelPlacement:"PlaceAtCenter",f=b&&void 0!==b.lineLabelPosition?b.lineLabelPosition:"Above",c=b&&void 0!==b.pointPriorities?b.pointPriorities:"AboveRight",k=[2,2,1,3,0,2,3,3,2];"AboveLeft"==c?k=[1,2,2,2,0,3,2,3,3]:"AboveCenter"==c?k=[2,1,2,2,0,2,3,3,3]:"AboveRight"==c?k=[2,2,1,3,0,2,3,3,2]:"CenterLeft"==c?k=[2,2,3,1,0,3,2,2,3]:"CenterCenter"==c?k=[0,0,0,0,1,0,0,0,0]:
"CenterRight"==c?k=[3,2,2,3,0,1,3,2,2]:"BelowLeft"==c?k=[2,3,3,2,0,3,1,2,2]:"BelowCenter"==c?k=[3,3,3,2,0,2,2,1,2]:"BelowRight"==c&&(k=[3,3,2,3,0,2,2,2,1]);var u=b&&void 0!==b.labelRotation?b.labelRotation:!0,c=Math.PI/180*a.angle;b=b&&void 0!==b.howManyLabels?b.howManyLabels:"OneLabel";if("point"==a.geometry.type)this._generatePointPositions(a,a.geometry.x,a.geometry.y,a.text,c,g,d,a.symbolWidth,a.symbolHeight,k);else if("multipoint"==a.geometry.type)for(e=a.geometry,f=0;f<e.points.length;f++)this._generatePointPositions(a,
e.points[f][0],e.points[f][1],a.text,c,g,d,a.symbolWidth,a.symbolHeight,k);else"polyline"==a.geometry.type?this._generateLinePositions(a,a.geometry,a.text,g,d,2*a.symbolHeight+d,e,f,u):"polygon"==a.geometry.type&&this._generatePolygonPositions(a,b,a.geometry,a.text,c,g,d)}return this._placedLabels},_generatePointPositions:function(h,b,a,d,g,e,f,c,k,u){c=(c+e)*this._scale;k=(k+f)*this._scale;var v,r;for(v=1;3>=v;v++)for(r=1;9>=r;r++)if(u[r-1]==v)switch(r){case 1:if(this._findPlace(h,d,b-c,a+k,g,e,
f))return;break;case 2:if(this._findPlace(h,d,b,a+k,g,e,f))return;break;case 3:if(this._findPlace(h,d,b+c,a+k,g,e,f))return;break;case 4:if(this._findPlace(h,d,b-c,a,g,e,f))return;break;case 5:if(this._findPlace(h,d,b,a,g,e,f))return;break;case 6:if(this._findPlace(h,d,b+c,a,g,e,f))return;break;case 7:if(this._findPlace(h,d,b-c,a-k,g,e,f))return;break;case 8:if(this._findPlace(h,d,b,a-k,g,e,f))return;break;case 9:if(this._findPlace(h,d,b+c,a-k,g,e,f))return}},_generateLinePositions:function(h,b,a,
d,g,e,f,c,k){var u=d*this._scale*d*this._scale,v,r,l;for(v=0;v<b.paths.length;v++){var A=b.paths[v],y=A.length,n=Math.floor((y-1)/2),m=0!==(y-1)%2?1:-1;"PlaceAtStart"==f&&(n=0,m=1);"PlaceAtEnd"==f&&(n=y-2,m=-1);for(;0<=n&&n<y-1;){for(r=n;r<y;r++){var p=A[n][0],F=A[n][1],t=A[r][0]-p,q=A[r][1]-F;if(t*t+q*q>u){for(var w=Math.atan2(q,t);w>Math.PI/2;)w-=Math.PI;for(;w<-(Math.PI/2);)w+=Math.PI;var D=Math.sin(w),G=Math.cos(w),I=0,J=0;"Above"==c&&(I=e*D*this._scale,J=e*G*this._scale);"Below"==c&&(I=-e*D*
this._scale,J=-e*G*this._scale);if(1==r-n){if(this._clipLine(p,F,A[r][0],A[r][1])&&(p=this._x1-this._x0,l=this._y1-this._y0,p*p+l*l>u&&(r=Math.atan2(l,p),t=d/2+2*g,F=t*this._scale*Math.cos(r),t=t*this._scale*Math.sin(r),"PlaceAtStart"==f?(p=this._x0+F,l=this._y0+t):"PlaceAtEnd"==f?(p=this._x1-F,l=this._y1-t):(p=this._x0+p/2,l=this._y0+l/2),this._findPlace(h,a,p-I,l+J,k?-r:0,d,g))))return}else{var K=0;for(l=n;l<=r;l++)K=Math.max(K,Math.abs((A[l][1]-F)*G-(A[l][0]-p)*D));if(K<g&&this._findPlace(h,a,
p+t/2-I,F+q/2+J,k?-w:0,d,g))return}break}}n+=m}}},_generatePolygonPositions:function(h,b,a,d,g,e,f){var c;if("ManyLabels"==b)for(b=0;b<a.rings.length;b++)c=a.rings[b],q.prototype.isClockwise(c)&&(c=this._findCentroid(c,this._xmin,this._ymin,this._xmax,this._ymax),this._findPlace(h,d,c[0],c[1],g,e,f));else{c=this._findCentroidForFeature(a,this._xmin,this._ymin,this._xmax,this._ymax);var k=c[1],u=0;for(b=0;10>b;b++){u+=f/4;c=this._findCentroidForFeature(a,this._xmin,k+(u-f/4),this._xmax,k+(u+f/4));
if(this._findPlace(h,d,c[0],c[1],g,e,f))break;c=this._findCentroidForFeature(a,this._xmin,k-(u+f/4),this._xmax,k-(u-f/4));if(this._findPlace(h,d,c[0],c[1],g,e,f))break}}},_findCentroid:function(h,b,a,d,g){var e=h.length,f=[0,0],c=0,k=h[0][0],u=h[0][1];k>d&&(k=d);k<b&&(k=b);u>g&&(u=g);u<a&&(u=a);for(var v=1;v<e-1;v++){var r=h[v][0],l=h[v][1],A=h[v+1][0],y=h[v+1][1];r>d&&(r=d);r<b&&(r=b);l>g&&(l=g);l<a&&(l=a);A>d&&(A=d);A<b&&(A=b);y>g&&(y=g);y<a&&(y=a);var n=(r-k)*(y-u)-(A-k)*(l-u);f[0]+=n*(k+r+A);
f[1]+=n*(u+l+y);c+=n}f[0]/=3*c;f[1]/=3*c;if(isNaN(f[0])||isNaN(f[1]))return f;a=[];this._fillBuffer(h,a,f);f[0]=this._sortBuffer(a,f[0],b,d);return f},_findCentroidForFeature:function(h,b,a,d,g){for(var e,f=0,c=[0,0],k=0;k<h.rings.length;k++){var u=h.rings[k],v=u.length,r=u[0][0],l=u[0][1];r>d&&(r=d);r<b&&(r=b);l>g&&(l=g);l<a&&(l=a);for(e=1;e<v-1;e++){var A=u[e][0],y=u[e][1],n=u[e+1][0],m=u[e+1][1];A>d&&(A=d);A<b&&(A=b);y>g&&(y=g);y<a&&(y=a);n>d&&(n=d);n<b&&(n=b);m>g&&(m=g);m<a&&(m=a);var p=(A-r)*
(m-l)-(n-r)*(y-l);c[0]+=p*(r+A+n);c[1]+=p*(l+y+m);f+=p}}c[0]/=3*f;c[1]/=3*f;if(isNaN(c[0])||isNaN(c[1]))return c;a=[];for(e=0;e<h.rings.length;e++)this._fillBuffer(h.rings[e],a,c);c[0]=this._sortBuffer(a,c[0],b,d);return c},_fillBuffer:function(h,b,a){for(var d=h.length-1,g=h[0][1]>=h[d][1]?1:-1,e=0;e<=d;e++){var f=e,c=e+1;e==d&&(c=0);var k=h[f][0],f=h[f][1],u=h[c][0],c=h[c][1],v=c>=f?1:-1;if(f<=a[1]&&a[1]<=c||c<=a[1]&&a[1]<=f)a[1]!=f&&a[1]!=c?(b.push((a[1]-f)*(u-k)/(c-f)+k),g=v):a[1]==f&&a[1]!=c?
(g!=v&&b.push(k),g=v):a[1]!=f&&a[1]==c?(b.push(u),g=v):a[1]==f&&a[1]==c&&(1==g&&b.push(k),b.push(u),g=v)}},_sortBuffer:function(h,b,a,d){var g=h.length;h.sort();if(0<g){for(var e=0,f=b=0;f<g-1;f+=2){var c=Math.abs(h[f+1]-h[f]);!(h[f]<=a&&h[f+1]<=a||h[f]>=d&&h[f+1]>=d)&&c>e&&(e=c,b=f)}g=h[b];h=h[b+1];g>d&&(g=d);g<a&&(g=a);h>d&&(h=d);h<a&&(h=a);b=(g+h)/2}return b},_findPlace:function(h,b,a,d,g,e,f){if(isNaN(a)||isNaN(d))return!1;for(var c=0;c<this._placedLabels.length;c++){var k=this._placedLabels[c].angle,
u=this._placedLabels[c].width*this._scale,v=this._placedLabels[c].height*this._scale,r=this._placedLabels[c].x-a,l=this._placedLabels[c].y-d;if(0===g&&0===k){if(this._findPlace2(-e*this._scale,-f*this._scale,e*this._scale,f*this._scale,r-u,l-v,r+u,l+v))return!1}else{var A=new B(-e*this._scale,-f*this._scale,e*this._scale,f*this._scale,null),y=0,n=1;0!==g&&(y=Math.sin(g),n=Math.cos(g));var m=r*n-l*y,r=r*y+l*n,k=k-g,y=Math.sin(k),n=Math.cos(k),p=-u*n- -v*y,l=-u*y+-v*n,k=+u*n- -v*y,t=+u*y+-v*n,u=m+p,
v=r-l,y=m+k,n=r-t,p=m-p,l=r+l,m=m-k,r=r+t,k=new q;k.addRing([[u,v],[y,n],[p,l],[m,r],[u,v]]);if(A.intersects(k))return!1}}for(;g>Math.PI/2;)g-=Math.PI;for(;g<-(Math.PI/2);)g+=Math.PI;c={};c.layer=h;c.text=b;c.angle=g;c.x=a;c.y=d;c.width=e;c.height=f;this._placedLabels.push(c);return!0},_findPlace2:function(h,b,a,d,g,e,f,c){return(h>=g&&h<=f||a>=g&&a<=f||h<=g&&a>=f)&&(b>=e&&b<=c||d>=e&&d<=c||b<=e&&d>=c)?!0:!1},_clipLine:function(h,b,a,d){for(var g=this._code(h,b),e=this._code(a,d);0!==g||0!==e;){if(0!==
(g&e))return!1;var f=a-h,c=d-b;0!==g?(h<this._xmin?(b+=c*(this._xmin-h)/f,h=this._xmin):h>this._xmax?(b+=c*(this._xmax-h)/f,h=this._xmax):b<this._ymin?(h+=f*(this._ymin-b)/c,b=this._ymin):b>this._ymax&&(h+=f*(this._ymax-b)/c,b=this._ymax),g=this._code(h,b)):(a<this._xmin?(d+=c*(this._xmin-a)/f,a=this._xmin):a>this._xmax?(d+=c*(this._xmax-a)/f,a=this._xmax):d<this._ymin?(a+=f*(this._ymin-d)/c,d=this._ymin):d>this._ymax&&(a+=f*(this._ymax-d)/c,d=this._ymax),e=this._code(a,d))}this._x0=h;this._y0=b;
this._x1=a;this._y1=d;return!0},_code:function(h,b){var a=0;h<this._xmin&&(a+=8);h>this._xmax&&(a+=4);b<this._ymin&&(a+=2);b>this._ymax&&(a+=1);return a}});t("extend-esri")&&p.setObject("layers.labelLayerUtils.DynamicLabelClass",m,x);return m})},"esri/layers/labelLayerUtils/StaticLabelClass":function(){define("dojo/_base/declare dojo/_base/lang dojo/has ../../kernel ../../geometry/Extent ../../geometry/Point ../../geometry/Polygon".split(" "),function(m,p,t,x,B,q,h){return m(null,{declaredClass:"esri.layers.labelLayerUtils.StaticLabel",
constructor:function(){this._preparedLabels=[];this._placedLabels=[];this._extent=null;this._ymax=this._ymin=this._xmax=this._xmin=0;this._scale=1;this._LINE_STEP_CONST=1.5;this._POLYGON_X_STEP_CONST=1;this._POLYGON_Y_STEP_CONST=.75;this._OVERRUN=2},setMap:function(b,a){this._labelLayer=a;this._map=b;this._xmin=b.extent.xmin;this._xmax=b.extent.xmax;this._ymin=b.extent.ymin;this._ymax=b.extent.ymax;this._scale=(this._xmax-this._xmin)/b.width},_process:function(b){var a,d,g,e,f,c,k,u,v;this._preparedLabels=
b;this._placedLabels=[];for(b=this._preparedLabels.length-1;0<=b;b--){a=this._preparedLabels[b];f=a.labelWidth;c=a.labelHeight;u=(k=a.options)&&k.lineLabelPlacement?k.lineLabelPlacement:"PlaceAtCenter";v=k&&k.lineLabelPosition?k.lineLabelPosition:"Above";d=k&&k.labelRotation?k.labelRotation:!0;g=Math.PI/180*a.angle;e=k&&k.howManyLabels?k.howManyLabels:"OneLabel";var r=[];if("point"===a.geometry.type)this._generatePointPositions(a.geometry.x,a.geometry.y,a.text,g,f,c,a.symbolWidth,a.symbolHeight,k,
r);else if("multipoint"===a.geometry.type)for(d=0;d<a.geometry.points.length;d++)this._generatePointPositions(a.geometry.points[d][0],a.geometry.points[d][1],a.text,g,f,c,a.symbolWidth,a.symbolHeight,k,r);else if("polyline"===a.geometry.type)if("PlaceAtStart"===u)this._generateLinePositionsPlaceAtStart(a.geometry,!0,a.text,f,c,2*a.symbolHeight+c,u,v,d,r);else if("PlaceAtEnd"===u)this._generateLinePositionsPlaceAtEnd(a.geometry,!0,a.text,f,c,2*a.symbolHeight+c,u,v,d,r);else{k=[];var l=a.geometry.getExtent(),
m=this._map.extent;if(l.getWidth()<f*this._scale/this._OVERRUN&&l.getHeight()<f*this._scale/this._OVERRUN)continue;else.5*l.getWidth()<m.getWidth()&&.5*l.getHeight()<m.getHeight()?this._generateLinePositionsPlaceAtCenter(a.geometry,!1,.1*Math.min(this._map.width,this._map.height)*this._scale,a.text,f,c,2*a.symbolHeight+c,u,v,d,k):this._generateLinePositionsPlaceAtCenter(a.geometry,!0,.2*Math.min(this._map.width,this._map.height)*this._scale,a.text,f,c,2*a.symbolHeight+c,u,v,d,k);this._postSorting(m,
k,r)}else if("polygon"===a.geometry.type){u=[];for(d=0;d<a.geometry.rings.length;d++)v=a.geometry.rings[d],1<a.geometry.rings.length&&!h.prototype.isClockwise(v)||(k=this._calcRingExtent(v),k.xmax-k.xmin<4*f*this._scale/this._OVERRUN&&k.ymax-k.ymin<4*c*this._scale/this._OVERRUN||u.push(v));u.sort(function(a,b){return b.length-a.length});for(d=0;d<u.length;d++)this._generatePolygonPositionsForManyLabels(u[d],a.geometry.spatialReference,a.text,g,f,c,r)}for(d=0;d<r.length&&(u=r[d].x,v=r[d].y,void 0!==
r[d].angle&&(g=r[d].angle),k=this._findPlace(a,a.text,u,v,g,f,c),"OneLabel"!==e||!k||!this._labelLayer._isWithinScreenArea(new q(u,v,a.geometry.spatialReference)));d++);}return this._placedLabels},_generatePointPositions:function(b,a,d,g,e,f,c,k,u,h){d=u&&u.pointPriorities?u.pointPriorities:"AboveRight";e=(c+e)*this._scale;f=(k+f)*this._scale;switch(d.toLowerCase()){case "aboveleft":b-=e;a+=f;break;case "abovecenter":a+=f;break;case "aboveright":b+=e;a+=f;break;case "centerleft":b-=e;break;case "centercenter":break;
case "centerright":b+=e;break;case "belowleft":b-=e;a-=f;break;case "belowcenter":a-=f;break;case "belowright":b+=e;a-=f;break;default:return}h.push({x:b,y:a})},_generateLinePositionsPlaceAtStart:function(b,a,d,g,e,f,c,k,u,h){c=g*this._scale;var r=this._LINE_STEP_CONST*Math.min(this._map.width,this._map.height)*this._scale,l,m,y,n,v,p,t,q;for(l=0;l<b.paths.length;l++){var z=b.paths[l],w=c,D=0;for(m=0;m<z.length-1;m++)y=z[m][0],n=z[m][1],v=z[m+1][0],p=z[m+1][1],t=v-y,q=p-n,t=Math.sqrt(t*t+q*q),D+t>
w?(D=this._generatePositionsOnLine(b.spatialReference,a,w,r,D,y,n,v,p,d,g,e,f,k,u,h),w=r):D+=t}},_generateLinePositionsPlaceAtEnd:function(b,a,d,g,e,f,c,k,u,h){c=g*this._scale;var r=this._LINE_STEP_CONST*Math.min(this._map.width,this._map.height)*this._scale,l,m,v,n,p,t,q,x;for(l=0;l<b.paths.length;l++){var z=b.paths[l],w=c,D=0;for(m=z.length-2;0<=m;m--)v=z[m+1][0],n=z[m+1][1],p=z[m][0],t=z[m][1],q=p-v,x=t-n,q=Math.sqrt(q*q+x*x),D+q>w?(D=this._generatePositionsOnLine(b.spatialReference,a,w,r,D,v,
n,p,t,d,g,e,f,k,u,h),w=r):D+=q}},_generateLinePositionsPlaceAtCenter:function(b,a,d,g,e,f,c,k,u,h,r){var l,m,v,n,p,t,q,x;for(k=0;k<b.paths.length;k++){var z=b.paths[k];if(!(2>z.length)){if(2==z.length){n=z[0];l=z[1];v=n[0];n=n[1];z=l[0];t=l[1];p=(z-v)*(z-v)+(t-n)*(t-n);q=Math.atan2(t-n,z-v);t=Math.cos(q);q=Math.sin(q);z=[];x=v;for(var w=n;(x-v)*(x-v)+(w-n)*(w-n)<p;)z.push([x,w]),x+=d/2*t,w+=d/2*q;z.push(l)}var D=0;for(l=0;l<z.length-1;l++)v=z[l][0],n=z[l][1],p=z[l+1][0],t=z[l+1][1],q=p-v,x=t-n,D+=
Math.sqrt(q*q+x*x);for(l=w=0;l<z.length-1;l++){v=z[l][0];n=z[l][1];p=z[l+1][0];t=z[l+1][1];q=p-v;x=t-n;q=Math.sqrt(q*q+x*x);if(w+q>D/2)break;w+=q}l==z.length-1&&l--;v=z[l][0];n=z[l][1];p=z[l+1][0];t=z[l+1][1];q=p-v;x=t-n;w=D/2-w;q=Math.atan2(x,q);x=v+w*Math.cos(q);q=n+w*Math.sin(q);v=this._angleAndShifts(v,n,p,t,c,u,h);r.push({x:x+v.shiftX,y:q+v.shiftY,angle:v.angle});var D=x,G=q,w=0;for(m=l;m<z.length-1;m++)m==l?(v=D,n=G):(v=z[m][0],n=z[m][1]),p=z[m+1][0],t=z[m+1][1],q=p-v,x=t-n,q=Math.sqrt(q*q+
x*x),w=w+q>d?this._generatePositionsOnLine(b.spatialReference,a,d,d,w,v,n,p,t,g,e,f,c,u,h,r):w+q;w=0;for(m=l;0<=m;m--)m==l?(v=D,n=G):(v=z[m+1][0],n=z[m+1][1]),p=z[m][0],t=z[m][1],q=p-v,x=t-n,q=Math.sqrt(q*q+x*x),w=w+q>d?this._generatePositionsOnLine(b.spatialReference,a,d,d,w,v,n,p,t,g,e,f,c,u,h,r):w+q}}},_generatePositionsOnLine:function(b,a,d,g,e,f,c,k,u,h,m,l,p,q,n,t){h=Math.atan2(u-c,k-f);m=f;l=c;var v=m,r=l;do if(e=d-e,m+=e*Math.cos(h),l+=e*Math.sin(h),this._belongs(m,l,f,c,k,u))e=this._angleAndShifts(f,
c,k,u,p,q,n),d=m+e.shiftX,r=l+e.shiftY,a?this._labelLayer._isWithinScreenArea(new B(d,r,d,r,b))&&t.push({x:d,y:r,angle:e.angle}):t.push({x:d,y:r,angle:e.angle}),v=m,r=l,e=0,d=g;else return b=k-v,u-=r,Math.sqrt(b*b+u*u);while(1)},_postSorting:function(b,a,d){if(b&&0<a.length){var g=.5*(b.xmin+b.xmax);b=.5*(b.ymin+b.ymax);for(var e=a[0].x,f=a[0].y,c=Math.sqrt((e-g)*(e-g)+(f-b)*(f-b)),k=a[0].angle,u=0;u<a.length;u++){var h=a[u].x,m=a[u].y,l=Math.sqrt((h-g)*(h-g)+(m-b)*(m-b));l<c&&(e=h,f=m,c=l,k=a[u].angle)}d.push({x:e,
y:f,angle:k})}},_belongs:function(b,a,d,g,e,f){if(e==d&&f==g)return!1;if(e>d){if(b>e||b<d)return!1}else if(b<e||b>d)return!1;if(f>g){if(a>f||a<g)return!1}else if(a<f||a>g)return!1;return!0},_angleAndShifts:function(b,a,d,g,e,f,c){for(b=Math.atan2(g-a,d-b);b>Math.PI/2;)b-=Math.PI;for(;b<-(Math.PI/2);)b+=Math.PI;g=Math.sin(b);var k=Math.cos(b);d=a=0;"Above"==f&&(a=e*g*this._scale,d=e*k*this._scale);"Below"==f&&(a=-e*g*this._scale,d=-e*k*this._scale);e=[];e.angle=c?-b:0;e.shiftX=-a;e.shiftY=d;return e},
_generatePolygonPositionsForManyLabels:function(b,a,d,g,e,f,c){e=this._findCentroidForRing(b);g=e[0];var k=e[1],h=this._calcRingExtent(b);e=h.xmin;f=h.ymin;var m=h.xmax,h=h.ymax,r=(h-f)/(this._map.height*this._scale);if(!(10<(m-e)/(this._map.width*this._scale)&&10<r)){var l=!0;if(m-e>this._map.width*this._scale||h-f>this._map.height*this._scale)l=!1;var r=this._map.width*this._scale*(l?.1875:.5),l=this._map.height*this._scale*(l?.1875:.5),p=!0,q=!0,n=0;do{k+=(n%2?-1:1)*n*l;if(this._scanRingByX(d,
a,b,g,k,e,m,r,c))break;k<f&&(p=!1);k>h&&(q=!1);n++}while(p||q)}},_scanRingByX:function(b,a,d,g,e,f,c,k,h){var m=!0,u=!0,l=0,p=1E3;do{g+=(l%2?-1:1)*l*k;var q=this._movePointInsideRing(d,g,e),n=this._labelLayer._isWithinScreenArea(new B(q,e,q,e,a)),t=this._isPointWithinRing(b,d,q,e);if(n&&t)return h.push({x:q,y:e}),!0;g<f&&(m=!1);g>c&&(u=!1);l++;p--;if(0>=p)return!0}while(m||u);return!1},_movePointInsideRing:function(b,a,d){for(var g=[],e=b.length-1,f=b[0][1]>=b[e][1]?1:-1,c=0;c<=e;c++){var k=c,h=c+
1;c==e&&(h=0);var m=b[k][0],k=b[k][1],r=b[h][0],h=b[h][1],l=h>=k?1:-1;if(k<=d&&d<=h||h<=d&&d<=k)d!=k&&d!=h?(g.push((d-k)*(r-m)/(h-k)+m),f=l):d==k&&d!=h?(f!=l&&g.push(m),f=l):d!=k&&d==h?(g.push(r),f=l):d==k&&d==h&&(1==f&&g.push(m),g.push(r),f=l)}g.sort(function(a,b){return a-b});b=g.length;if(0<b){for(c=d=a=0;c<b-1;c+=2)e=Math.abs(g[c+1]-g[c]),e>a&&(a=e,d=c);a=(g[d]+g[d+1])/2}return a},_calcRingExtent:function(b){var a,d;d=new B;for(a=0;a<b.length-1;a++){var g=b[a][0],e=b[a][1];if(void 0===d.xmin||
g<d.xmin)d.xmin=g;if(void 0===d.ymin||e<d.ymin)d.ymin=e;if(void 0===d.xmax||g>d.xmax)d.xmax=g;if(void 0===d.ymax||e>d.ymax)d.ymax=e}return d},_isPointWithinPolygon:function(b,a,d,g){var e;for(e=0;e<a.rings.length;e++)if(this._isPointWithinRing(b,a.rings[e],d,g))return!0;return!1},_isPointWithinRing:function(b,a,d,g){var e,f,c,k,h=[],m=a.length;for(b=0;b<m-1;b++)if(e=a[b][0],f=a[b][1],c=a[b+1][0],k=a[b+1][1],e!=c||f!=k){if(f==k)if(g==f)h.push(e);else continue;e==c?(f<k&&g>=f&&g<k&&h.push(e),f>k&&g<=
f&&g>k&&h.push(e)):(f=(c-e)/(k-f)*(g-f)+e,e<c&&f>=e&&f<c&&h.push(f),e>c&&f<=e&&f>c&&h.push(f))}h.sort(function(a,b){return a-b});for(b=0;b<h.length-1;b++)if(e=h[b],c=h[b+1],d>=e&&d<c)if(b%2)break;else return!0;return!1},_findCentroidForRing:function(b){for(var a=b.length,d=[0,0],g=0,e=b[0][0],f=b[0][1],c=1;c<a-1;c++){var k=b[c][0],h=b[c][1],m=b[c+1][0],r=b[c+1][1],l=(k-e)*(r-f)-(m-e)*(h-f);d[0]+=l*(e+k+m);d[1]+=l*(f+h+r);g+=l}d[0]/=3*g;d[1]/=3*g;return d},_findCentroidForFeature:function(b){for(var a=
0,d=[0,0],g=0;g<b.rings.length;g++)for(var e=b.rings[g],f=e.length,c=e[0][0],k=e[0][1],h=1;h<f-1;h++){var m=e[h][0],r=e[h][1],l=e[h+1][0],p=e[h+1][1],q=(m-c)*(p-k)-(l-c)*(r-k);d[0]+=q*(c+m+l);d[1]+=q*(k+r+p);a+=q}d[0]/=3*a;d[1]/=3*a;return d},_findPlace:function(b,a,d,g,e,f,c){if(isNaN(d)||isNaN(g))return!1;for(var k=0;k<this._placedLabels.length;k++){var m=this._placedLabels[k].angle,p=this._placedLabels[k].width*this._scale,r=this._placedLabels[k].height*this._scale,l=this._placedLabels[k].x-d,
q=this._placedLabels[k].y-g;if(0===e&&0===m){if(this._findPlace2(-f*this._scale,-c*this._scale,f*this._scale,c*this._scale,l-p,q-r,l+p,q+r))return!1}else{var t=new B(-f*this._scale,-c*this._scale,f*this._scale,c*this._scale,null),n=0,x=1;0!==e&&(n=Math.sin(e),x=Math.cos(e));var E=l*x-q*n,l=l*n+q*x,m=m-e,n=Math.sin(m),x=Math.cos(m),F=-p*x- -r*n,q=-p*n+-r*x,m=+p*x- -r*n,H=+p*n+-r*x,p=E+F,r=l-q,n=E+m,x=l-H,F=E-F,q=l+q,E=E-m,l=l+H,m=new h;m.addRing([[p,r],[n,x],[F,q],[E,l],[p,r]]);if(t.intersects(m))return!1}}for(;e>
Math.PI/2;)e-=Math.PI;for(;e<-(Math.PI/2);)e+=Math.PI;k={};k.layer=b;k.text=a;k.angle=e;k.x=d;k.y=g;k.width=f;k.height=c;this._placedLabels.push(k);return!0},_findPlace2:function(b,a,d,g,e,f,c,k){return(b>=e&&b<=c||d>=e&&d<=c||b<=e&&d>=c)&&(a>=f&&a<=k||g>=f&&g<=k||a<=f&&g>=k)?!0:!1}})})},"*noref":1}});
define("esri/layers/LabelLayer","require dojo/_base/declare dojo/_base/lang dojo/number dojo/i18n!dojo/cldr/nls/number dojo/_base/array dojo/_base/connect dojo/has dojox/gfx/_base ../kernel ../lang ../graphic ../PopupInfo ../core/timerUtils ./labelLayerUtils/DynamicLabelClass ./labelLayerUtils/StaticLabelClass ./support/attributeUtils ../symbols/TextSymbol ../symbols/ShieldLabelSymbol ../geometry/Extent ../geometry/Point ../geometry/webMercatorUtils ./GraphicsLayer ./LabelClass ../renderers/SimpleRenderer ../support/expressionUtils".split(" "),function(m,
p,t,x,B,q,h,b,a,d,g,e,f,c,k,u,v,r,l,A,y,n,C,E,F,H){function z(a){return"sizeInfo"===a.type}m=p(C,{declaredClass:"esri.layers.LabelLayer",constructor:function(a){this._refreshLabels=t.hitch(this,this._refreshLabels);this.id="labels";this.featureLayers=[];this._featureLayerInfos=[];this._preparedLabels=[];this._engineType="STATIC";this._mapEventHandlers=[];a&&(a.id&&(this.id=a.id),a.mode&&(this._engineType="DYNAMIC"===a.mode.toUpperCase()?"DYNAMIC":"STATIC"))},_setMap:function(a){this._mapEventHandlers.push(a.on("extent-change",
t.hitch(this,"_handleLevelChange")));var b=this.inherited(arguments);this.refresh();return b},_unsetMap:function(){var a;for(a=0;a<this._mapEventHandlers.length;a++)h.disconnect(this._mapEventHandlers[a]);this.refresh();c.clearTimeout(this._refreshHandle);this._refreshHandle=null;this.inherited(arguments)},setAlgorithmType:function(a){this._engineType=a&&"DYNAMIC"===a.toUpperCase()?"DYNAMIC":"STATIC";this.refresh()},addFeatureLayer:function(a,b,c,d){if(!this.getFeatureLayer(a.layerId)){var f=[];f.push(a.on("update-end",
t.hitch(this,"refresh")));f.push(a.on("suspend",t.hitch(this,"refresh")));f.push(a.on("resume",t.hitch(this,"refresh")));f.push(a.on("edits-complete",t.hitch(this,"refresh")));f.push(a.on("labeling-info-change",t.hitch(this,"refresh")));f.push(a.on("time-extent-change",t.hitch(this,"refresh")));f.push(a.on("show-labels-change",t.hitch(this,"refresh")));f.push(a.on("feature-reduction-change",t.hitch(this,"refresh")));this._featureLayerInfos.push({FeatureLayer:a,LabelExpressionInfo:c,LabelingOptions:d,
LabelRenderer:b,EventHandlers:f});this.featureLayers.push(a);this.refresh()}},getFeatureLayer:function(a){var b,c;for(b=0;b<this.featureLayers.length;b++)if(c=this.featureLayers[b],void 0!==c&&c.id==a)return c;return null},removeFeatureLayer:function(a){var b;a=this.getFeatureLayer(a);if(void 0!==a&&(b=q.indexOf(this.featureLayers,a),-1<b)){this.featureLayers.splice(b,1);for(a=0;a<this._featureLayerInfos[b].EventHandlers.length;a++)h.disconnect(this._featureLayerInfos[b].EventHandlers[a]);this._featureLayerInfos.splice(b,
1);this.refresh()}},removeAllFeatureLayers:function(){var a;for(a=0;a<this.featureLayers.length;a++){for(var b=0;b<this._featureLayerInfos[a].EventHandlers.length;b++)h.disconnect(this._featureLayerInfos[a].EventHandlers[b]);this.featureLayers=[];this._featureLayerInfos=[]}this.refresh()},getFeatureLayers:function(){return this.featureLayers},getFeatureLayerInfo:function(a){var b,c;for(b=0;b<this.featureLayers.length;b++)if(c=this.featureLayers[b],void 0!==c&&c.id==a)return this._featureLayerInfos[b];
return null},refresh:function(){null==this._refreshHandle&&(this._refreshHandle=c.setTimeout(this._refreshLabels,c.priority.LOW))},_handleLevelChange:function(a){a.levelChange&&this.clear();this.refresh()},_refreshLabels:function(a){this._refreshHandle=null;var b,c,d,f,e,g=[],h,l="DYNAMIC"===this._engineType?new k:new u;if(this._map){l.setMap(this._map,this);this._preparedLabels=[];for(a=0;a<this.featureLayers.length;a++)if(c=this.featureLayers[a],c.visible&&c.showLabels&&c.visibleAtMapScale&&!c._suspended)if(b=
this._featureLayerInfos[a],e=this._convertOptions(null),b.LabelRenderer){if(g=c.labelingInfo)if(h=g[0])f=this._getLabelExpression(h),e=this._convertOptions(h);d=b.LabelRenderer;b.LabelExpressionInfo&&(f=b.LabelExpressionInfo);b.LabelingOptions&&(e=this._convertOptions(null),void 0!==b.LabelingOptions.pointPriorities&&(g=b.LabelingOptions.pointPriorities,e.pointPriorities="above-center"==g||"AboveCenter"==g||"esriServerPointLabelPlacementAboveCenter"==g?"AboveCenter":"above-left"==g||"AboveLeft"==
g||"esriServerPointLabelPlacementAboveLeft"==g?"AboveLeft":"above-right"==g||"AboveRight"==g||"esriServerPointLabelPlacementAboveRight"==g?"AboveRight":"below-center"==g||"BelowCenter"==g||"esriServerPointLabelPlacementBelowCenter"==g?"BelowCenter":"below-left"==g||"BelowLeft"==g||"esriServerPointLabelPlacementBelowLeft"==g?"BelowLeft":"below-right"==g||"BelowRight"==g||"esriServerPointLabelPlacementBelowRight"==g?"BelowRight":"center-center"==g||"CenterCenter"==g||"esriServerPointLabelPlacementCenterCenter"==
g?"CenterCenter":"center-left"==g||"CenterLeft"==g||"esriServerPointLabelPlacementCenterLeft"==g?"CenterLeft":"center-right"==g||"CenterRight"==g||"esriServerPointLabelPlacementCenterRight"==g?"CenterRight":"AboveRight"),void 0!==b.LabelingOptions.lineLabelPlacement&&(e.lineLabelPlacement=b.LabelingOptions.lineLabelPlacement),void 0!==b.LabelingOptions.lineLabelPosition&&(e.lineLabelPosition=b.LabelingOptions.lineLabelPosition),void 0!==b.LabelingOptions.labelRotation&&(e.labelRotation=b.LabelingOptions.labelRotation),
void 0!==b.LabelingOptions.howManyLabels&&(e.howManyLabels=b.LabelingOptions.howManyLabels));d instanceof E&&(f=this._getLabelExpression(d),d=new F(d.symbol),e=this._convertOptions(d));this._addLabels(c,d,f,e)}else if(g=c.labelingInfo)for(b=g.length-1;0<=b;b--)if(h=g[b])d=new E(h instanceof E?h.toJson():h),f=this._getLabelExpression(h),e=this._convertOptions(h),this._addLabels(c,d,f,e);f=l._process(this._preparedLabels);this.clear();this.drawLabels(this._map,f)}},drawLabels:function(a,b){this._scale=
(a.extent.xmax-a.extent.xmin)/a.width;var c;for(c=0;c<b.length;c++){var d=b[c],f=d.x,g=d.y,k=d.text,h=d.angle,l=d.layer.labelSymbol;"polyline"==d.layer.geometry.type&&d.layer.options.labelRotation&&l.setAngle(180/Math.PI*h);l.setText(k);d=f;l instanceof r&&(f=l.getHeight(),d-=.25*f*this._scale*Math.sin(h),g-=.33*f*this._scale);h=new e(new y(d,g,a.extent.spatialReference));h.setSymbol(l);this.add(h)}},_addLabels:function(a,b,c,d){var f,e,g,k;if(this._isWithinScaleRange(b.minScale,b.maxScale)&&c&&""!==
c){var h=this._map,l=!a.url&&!h.spatialReference.equals(a.spatialReference);for(f=0;f<a.graphics.length;f++)if(e=a.graphics[f],!1!==e.visible&&!e._suspended){g=e.geometry;if(l){if(!n.canProject(g,h))continue;g=n.project(g,h)}g&&this._isWhere(b.where,e.attributes)&&this._isWithinScreenArea(g)&&(k=this._buildLabelText(c,e,a.fields,d),this._addLabel(k,b,a.renderer,e,d,g,h))}}},_isWithinScreenArea:function(a){a="point"===a.type?new A(a.x,a.y,a.x,a.y,a.spatialReference):a.getExtent();if(void 0===a)return!1;
a=this._intersects(this._map,a);return null===a||0===a.length?!1:!0},_isWithinScaleRange:function(a,b){var c=this._map.getScale();return 0<a&&c>=a||0<b&&c<=b?!1:!0},_isWhere:function(a,b){try{if(!a)return!0;if(a){var c=a.split(" ");if(3===c.length)return this._sqlEquation(b[this._removeQuotes(c[0])],c[1],this._removeQuotes(c[2]));if(7===c.length){var d=this._sqlEquation(b[this._removeQuotes(c[0])],c[1],this._removeQuotes(c[2])),f=c[3],e=this._sqlEquation(b[this._removeQuotes(c[4])],c[5],this._removeQuotes(c[6]));
switch(f){case "AND":return d&&e;case "OR":return d||e}}}return!1}catch(L){console.log("Error.: can't parse \x3d "+a)}},_sqlEquation:function(a,b,c){switch(b){case "\x3d":return a==c?!0:!1;case "\x3c\x3e":return a!=c?!0:!1;case "\x3e":return a>c?!0:!1;case "\x3e\x3d":return a>=c?!0:!1;case "\x3c":return a<c?!0:!1;case "\x3c\x3d":return a<=c?!0:!1}return!1},_removeQuotes:function(a){var b=a.indexOf('"'),c=a.lastIndexOf('"');if(-1!=b&&-1!=c)return a.substr(1,a.length-2);b=a.indexOf("'");c=a.lastIndexOf("'");
return-1!=b&&-1!=c?a.substr(1,a.length-2):a},_getSizeInfo:function(a){return a?a.sizeInfo||q.filter(a.visualVariables,z)[0]:null},_addLabel:function(b,c,d,f,e,g,k){var h,m,n,p;if(b&&""!==t.trim(b)&&c){b=b.replace(/\s+/g," ");h=c.getSymbol(f);h instanceof r?(h=new r(h.toJson()),h.setVerticalAlignment("baseline"),h.setHorizontalAlignment("center")):h=h instanceof l?new l(h.toJson()):new r;h.setText(b);c.symbol=h;if(n=this._getProportionalSize(c.sizeInfo,f.attributes))h instanceof r?h.setSize(n):h instanceof
l&&(h.setWidth(n),h.setHeight(n));p=n=0;if(d){m=d.getSymbol(f);var q=this._getSizeInfo(d);if((d=q?d.getSize(f,{sizeInfo:q,resolution:k.getResolutionInMeters()}):f.size)&&null!==d)n=p=d;else if(m)if("simplemarkersymbol"==m.type)p=n=m.size;else if("picturemarkersymbol"==m.type)n=m.width,p=m.height;else if("simplelinesymbol"==m.type||"cartographiclinesymbol"==m.type)n=m.width}d={};d.graphic=f;d.options=e;d.geometry=g;d.labelRenderer=c;d.labelSymbol=h;d.labelWidth=h.getWidth()/2;d.labelHeight=h.getHeight()/
2;d.symbolWidth=a.normalizedLength(n)/2;d.symbolHeight=a.normalizedLength(p)/2;d.text=b;d.angle=h.angle;this._preparedLabels.push(d)}},_buildLabelText:function(a,b,c,d){if(d.hasExpression)return a=d.arcadeCache,b=b._getDataValue(a.attributeInfo,a,H),g.isDefined(b)?""+b:"";var e=b.attributes;return a.replace(/{[^}]*}/g,function(a){var b,k=a;for(b=0;b<c.length;b++)if("{"+c[b].name+"}"==a){var k=e[c[b].name],h=c[b].domain;if(h&&t.isObject(h)){if("codedValue"==h.type&&d.useCodedValues)for(b=k,a=0;a<h.codedValues.length;a++){if(h.codedValues[a].code==
b){k=h.codedValues[a].name;break}}else"range"==h.type&&h.minValue<=k&&k<=h.maxValue&&(k=h.name);break}h=c[b].type;if(d.fieldInfos){var l=d.fieldInfos;for(b=0;b<l.length;b++)if("{"+l[b].fieldName+"}"==a){a=l[b].format;"esriFieldTypeDate"==h?(a="DateFormat"+f.prototype._dateFormats[a.dateFormat?a.dateFormat:"shortDate"])&&(k=g.substitute({myKey:k},"${myKey:"+a+"}")):"esriFieldTypeInteger"!=h&&"esriFieldTypeSingle"!=h&&"esriFieldTypeSmallInteger"!=h&&"esriFieldTypeLong"!=h&&"esriFieldTypeDouble"!=h||
!a||(k=x.format(k,{places:a.places}),a.digitSeparator||B.group&&(k=k.replace(new RegExp("\\"+B.group,"g"),"")));break}}break}else k="";return null==k?"":k})},_getLabelExpression:function(a){var b="";a.labelExpressionInfo?b=a.labelExpressionInfo.value||a.labelExpressionInfo.expression:this._validSyntax(a.labelExpression)&&(b=this._convertLabelExpression(a.labelExpression));return b},_validSyntax:function(a){return/^(\s*\[[^\]]+\]\s*)+$/i.test(a)},_convertLabelExpression:function(a){return a.replace(RegExp("\\[",
"g"),"{").replace(RegExp("\\]","g"),"}")},_getProportionalSize:function(a,b){if(!a)return null;var c=g.substitute(b,"${"+a.field+"}",{first:!0});return!(a.minSize&&a.maxSize&&a.minDataValue&&a.maxDataValue&&c)||0>=a.maxDataValue-a.minDataValue?null:(a.maxSize-a.minSize)/(a.maxDataValue-a.minDataValue)*(c-a.minDataValue)+a.minSize},_convertOptions:function(a){var b=!0,c="shortDate",d=null,f=null,e="",g=!0,h,k;if(a&&(a.format&&(c=a.format.dateFormat,d={places:a.format.places,digitSeparator:a.format.digitSeparator}),
f=a.fieldInfos,e=a.labelPlacement,null!=a.useCodedValues&&(b=a.useCodedValues),a=a.labelExpressionInfo)){var l=a.expression;l&&!a.value&&(k=!0,h=v.createAttributeCache({valueExpression:l},!0))}if("always-horizontal"==e||"esriServerPolygonPlacementAlwaysHorizontal"==e)g=!1;return{useCodedValues:b,dateFormat:c,numberFormat:d,fieldInfos:f,pointPriorities:"above-center"==e||"esriServerPointLabelPlacementAboveCenter"==e?"AboveCenter":"above-left"==e||"esriServerPointLabelPlacementAboveLeft"==e?"AboveLeft":
"above-right"==e||"esriServerPointLabelPlacementAboveRight"==e?"AboveRight":"below-center"==e||"esriServerPointLabelPlacementBelowCenter"==e?"BelowCenter":"below-left"==e||"esriServerPointLabelPlacementBelowLeft"==e?"BelowLeft":"below-right"==e||"esriServerPointLabelPlacementBelowRight"==e?"BelowRight":"center-center"==e||"esriServerPointLabelPlacementCenterCenter"==e?"CenterCenter":"center-left"==e||"esriServerPointLabelPlacementCenterLeft"==e?"CenterLeft":"center-right"==e||"esriServerPointLabelPlacementCenterRight"==
e?"CenterRight":"AboveRight",lineLabelPlacement:"above-start"==e||"below-start"==e||"center-start"==e?"PlaceAtStart":"above-end"==e||"below-end"==e||"center-end"==e?"PlaceAtEnd":"PlaceAtCenter",lineLabelPosition:"above-after"==e||"esriServerLinePlacementAboveAfter"==e||"above-along"==e||"esriServerLinePlacementAboveAlong"==e||"above-before"==e||"esriServerLinePlacementAboveBefore"==e||"above-start"==e||"esriServerLinePlacementAboveStart"==e||"above-end"==e||"esriServerLinePlacementAboveEnd"==e?"Above":
"below-after"==e||"esriServerLinePlacementBelowAfter"==e||"below-along"==e||"esriServerLinePlacementBelowAlong"==e||"below-before"==e||"esriServerLinePlacementBelowBefore"==e||"below-start"==e||"esriServerLinePlacementBelowStart"==e||"below-end"==e||"esriServerLinePlacementBelowEnd"==e?"Below":"center-after"==e||"esriServerLinePlacementCenterAfter"==e||"center-along"==e||"esriServerLinePlacementCenterAlong"==e||"center-before"==e||"esriServerLinePlacementCenterBefore"==e||"center-start"==e||"esriServerLinePlacementCenterStart"==
e||"center-end"==e||"esriServerLinePlacementCenterEnd"==e?"OnLine":"Above",labelRotation:g,howManyLabels:"OneLabel",hasExpression:k,arcadeCache:h}}});b("extend-esri")&&t.setObject("layers.LabelLayer",m,d);return m});