/*
	Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
	Available via Academic Free License >= 2.1 OR the modified BSD license.
	see: http://dojotoolkit.org/license for details
*/

/*
	This is an optimized version of Dojo, built for deployment and not for
	development. To get sources and documentation, please visit:

		http://dojotoolkit.org
*/

window[esri._dojoScopeName||"dojo"]._xdResourceLoaded(function(_1,_2,_3){return {depends:[["provide","esri.layers.osm"],["provide","dojo.io.iframe"],["provide","esri.layers.FeatureLayer"],["provide","esri.layers.MapImageLayer"],["provide","esri.PopupBase"],["provide","dojox.charting.scaler.common"],["provide","dojox.charting.scaler.linear"],["provide","dojox.charting.axis2d.common"],["provide","dojox.charting.Element"],["provide","dojox.charting.axis2d.Base"],["provide","dojox.lang.functional.lambda"],["provide","dojox.lang.functional.array"],["provide","dojox.lang.functional.object"],["provide","dojox.lang.functional"],["provide","dojox.lang.utils"],["provide","dojox.charting.axis2d.Invisible"],["provide","dojo.colors"],["provide","dojox.charting.axis2d.Default"],["provide","dojox.charting.plot2d.common"],["provide","dojox.charting.scaler.primitive"],["provide","dojox.charting.plot2d._PlotEvents"],["provide","dojox.charting.plot2d.Base"],["provide","dojox.lang.functional.reversed"],["provide","dojox.gfx.fx"],["provide","dojox.charting.plot2d.Default"],["provide","dojox.charting.plot2d.Lines"],["provide","dojox.charting.plot2d.Areas"],["provide","dojox.charting.plot2d.Markers"],["provide","dojox.charting.plot2d.MarkersOnly"],["provide","dojox.gfx.gradutils"],["provide","dojox.charting.plot2d.Scatter"],["provide","dojox.lang.functional.sequence"],["provide","dojox.charting.plot2d.Stacked"],["provide","dojox.charting.plot2d.StackedLines"],["provide","dojox.charting.plot2d.StackedAreas"],["provide","dojox.charting.plot2d.Columns"],["provide","dojox.charting.plot2d.StackedColumns"],["provide","dojox.charting.plot2d.ClusteredColumns"],["provide","dojox.charting.plot2d.Bars"],["provide","dojox.charting.plot2d.StackedBars"],["provide","dojox.charting.plot2d.ClusteredBars"],["provide","dojox.charting.plot2d.Grid"],["provide","dojox.charting.plot2d.Pie"],["provide","dojox.charting.plot2d.Bubble"],["provide","dojox.charting.plot2d.Candlesticks"],["provide","dojox.charting.plot2d.OHLC"],["provide","dojo.fx.easing"],["provide","dojox.charting.plot2d.Spider"],["provide","dojox.lang.functional.fold"],["provide","dojox.color._base"],["provide","dojox.color"],["provide","dojox.color.Palette"],["provide","dojox.charting.Theme"],["provide","dojox.charting.Series"],["provide","dojox.charting.Chart"],["provide","dojox.charting.Chart2D"],["provide","dojox.charting.themes.PlotKit.base"],["provide","dijit.Tooltip"],["provide","dojox.charting.action2d.Base"],["provide","dojox.lang.functional.scan"],["provide","dojox.charting.action2d.Tooltip"],["provide","esri.dijit.Popup"],["provide","esri.layers.KMLLayer"],["provide","esri.layers.wms"],["provide","dojo.DeferredList"],["provide","dojo.data.util.filter"],["provide","dojo.data.util.sorter"],["provide","dojo.data.util.simpleFetch"],["provide","dojox.data.CsvStore"],["provide","esri.arcgis.csv"],["provide","esri.arcgis.utils"]],defineResource:function(_4,_5,_6){if(!_4._hasResource["esri.layers.osm"]){_4._hasResource["esri.layers.osm"]=true;_4.provide("esri.layers.osm");_4.declare("esri.layers.OpenStreetMapLayer",esri.layers.TiledMapServiceLayer,{constructor:function(_7){this.spatialReference=new esri.SpatialReference({wkid:102100});this.tileInfo=new esri.layers.TileInfo({rows:256,cols:256,dpi:96,format:"PNG8",compressionQuality:0,origin:{x:-20037508.342787,y:20037508.342787},spatialReference:{wkid:102100},lods:[{level:0,scale:591657527.591555,resolution:156543.033928},{level:1,scale:295828763.795777,resolution:78271.5169639999},{level:2,scale:147914381.897889,resolution:39135.7584820001},{level:3,scale:73957190.948944,resolution:19567.8792409999},{level:4,scale:36978595.474472,resolution:9783.93962049996},{level:5,scale:18489297.737236,resolution:4891.96981024998},{level:6,scale:9244648.868618,resolution:2445.98490512499},{level:7,scale:4622324.434309,resolution:1222.99245256249},{level:8,scale:2311162.217155,resolution:611.49622628138},{level:9,scale:1155581.108577,resolution:305.748113140558},{level:10,scale:577790.554289,resolution:152.874056570411},{level:11,scale:288895.277144,resolution:76.4370282850732},{level:12,scale:144447.638572,resolution:38.2185141425366},{level:13,scale:72223.819286,resolution:19.1092570712683},{level:14,scale:36111.909643,resolution:9.55462853563415},{level:15,scale:18055.954822,resolution:4.77731426794937},{level:16,scale:9027.977411,resolution:2.38865713397468},{level:17,scale:4513.988705,resolution:1.19432856685505},{level:18,scale:2256.994353,resolution:0.597164283559817}]});this.fullExtent=new esri.geometry.Extent({xmin:-20037508.34,ymin:-20037508.34,xmax:20037508.34,ymax:20037508.34,spatialReference:{wkid:102100}});this.initialExtent=new esri.geometry.Extent({xmin:-20037508.34,ymin:-20037508.34,xmax:20037508.34,ymax:20037508.34,spatialReference:{wkid:102100}});this.tileServers=(_7&&_7.tileServers)||["http://a.tile.openstreetmap.org/","http://b.tile.openstreetmap.org/","http://c.tile.openstreetmap.org/"];this.serversLength=this.tileServers.length;this._displayLevels=_7?_7.displayLevels:null;this.loaded=true;this.onLoad(this);var _8=_7&&_7.loadCallback;if(_8){_8(this);}},getTileUrl:function(_9,_a,_b){return esri._getProxiedUrl(this.tileServers[_a%this.serversLength]+"/"+_9+"/"+_b+"/"+_a+".png");}});}if(!_4._hasResource["dojo.io.iframe"]){_4._hasResource["dojo.io.iframe"]=true;_4.provide("dojo.io.iframe");_4.getObject("io",true,_4);_4.io.iframe={create:function(_c,_d,_e){if(window[_c]){return window[_c];}if(window.frames[_c]){return window.frames[_c];}var _f=null;var _10=_e;if(!_10){if(_4.config["useXDomain"]&&!_4.config["dojoBlankHtmlUrl"]){console.warn("dojo.io.iframe.create: When using cross-domain Dojo builds,"+" please save dojo/resources/blank.html to your domain and set djConfig.dojoBlankHtmlUrl"+" to the path on your domain to blank.html");}_10=(_4.config["dojoBlankHtmlUrl"]||_4.moduleUrl("dojo","resources/blank.html"));}var _f=_4.place("<iframe id=\""+_c+"\" name=\""+_c+"\" src=\""+_10+"\" onload=\""+_d+"\" style=\"position: absolute; left: 1px; top: 1px; height: 1px; width: 1px; visibility: hidden\">",_4.body());window[_c]=_f;return _f;},setSrc:function(_11,src,_12){try{if(!_12){if(_4.isWebKit){_11.location=src;}else{frames[_11.name].location=src;}}else{var _13;if(_4.isIE||_4.isWebKit){_13=_11.contentWindow.document;}else{_13=_11.contentWindow;}if(!_13){_11.location=src;return;}else{_13.location.replace(src);}}}catch(e){console.log("dojo.io.iframe.setSrc: ",e);}},doc:function(_14){var doc=_14.contentDocument||(((_14.name)&&(_14.document)&&(_4.doc.getElementsByTagName("iframe")[_14.name].contentWindow)&&(_4.doc.getElementsByTagName("iframe")[_14.name].contentWindow.document)))||((_14.name)&&(_4.doc.frames[_14.name])&&(_4.doc.frames[_14.name].document))||null;return doc;},send:function(_15){if(!this["_frame"]){this._frame=this.create(this._iframeName,_4._scopeName+".io.iframe._iframeOnload();");}var dfd=_4._ioSetArgs(_15,function(dfd){dfd.canceled=true;dfd.ioArgs._callNext();},function(dfd){var _16=null;try{var _17=dfd.ioArgs;var dii=_4.io.iframe;var ifd=dii.doc(dii._frame);var _18=_17.handleAs;_16=ifd;if(_18!="html"){if(_18=="xml"){if(_4.isIE<9||(_4.isIE&&_4.isQuirks)){_4.query("a",dii._frame.contentWindow.document.documentElement).orphan();var _19=(dii._frame.contentWindow.document).documentElement.innerText;_19=_19.replace(/>\s+</g,"><");_19=_4.trim(_19);var _1a={responseText:_19};_16=_4._contentHandlers["xml"](_1a);}}else{_16=ifd.getElementsByTagName("textarea")[0].value;if(_18=="json"){_16=_4.fromJson(_16);}else{if(_18=="javascript"){_16=_4.eval(_16);}}}}}catch(e){_16=e;}finally{_17._callNext();}return _16;},function(_1b,dfd){dfd.ioArgs._hasError=true;dfd.ioArgs._callNext();return _1b;});dfd.ioArgs._callNext=function(){if(!this["_calledNext"]){this._calledNext=true;_4.io.iframe._currentDfd=null;_4.io.iframe._fireNextRequest();}};this._dfdQueue.push(dfd);this._fireNextRequest();_4._ioWatch(dfd,function(dfd){return !dfd.ioArgs["_hasError"];},function(dfd){return (!!dfd.ioArgs["_finished"]);},function(dfd){if(dfd.ioArgs._finished){dfd.callback(dfd);}else{dfd.errback(new Error("Invalid dojo.io.iframe request state"));}});return dfd;},_currentDfd:null,_dfdQueue:[],_iframeName:_4._scopeName+"IoIframe",_fireNextRequest:function(){try{if((this._currentDfd)||(this._dfdQueue.length==0)){return;}do{var dfd=this._currentDfd=this._dfdQueue.shift();}while(dfd&&dfd.canceled&&this._dfdQueue.length);if(!dfd||dfd.canceled){this._currentDfd=null;return;}var _1c=dfd.ioArgs;var _1d=_1c.args;_1c._contentToClean=[];var fn=_4.byId(_1d["form"]);var _1e=_1d["content"]||{};if(fn){if(_1e){var _1f=function(_20,_21){_4.create("input",{type:"hidden",name:_20,value:_21},fn);_1c._contentToClean.push(_20);};for(var x in _1e){var val=_1e[x];if(_4.isArray(val)&&val.length>1){var i;for(i=0;i<val.length;i++){_1f(x,val[i]);}}else{if(!fn[x]){_1f(x,val);}else{fn[x].value=val;}}}}var _22=fn.getAttributeNode("action");var _23=fn.getAttributeNode("method");var _24=fn.getAttributeNode("target");if(_1d["url"]){_1c._originalAction=_22?_22.value:null;if(_22){_22.value=_1d.url;}else{fn.setAttribute("action",_1d.url);}}if(!_23||!_23.value){if(_23){_23.value=(_1d["method"])?_1d["method"]:"post";}else{fn.setAttribute("method",(_1d["method"])?_1d["method"]:"post");}}_1c._originalTarget=_24?_24.value:null;if(_24){_24.value=this._iframeName;}else{fn.setAttribute("target",this._iframeName);}fn.target=this._iframeName;_4._ioNotifyStart(dfd);fn.submit();}else{var _25=_1d.url+(_1d.url.indexOf("?")>-1?"&":"?")+_1c.query;_4._ioNotifyStart(dfd);this.setSrc(this._frame,_25,true);}}catch(e){dfd.errback(e);}},_iframeOnload:function(){var dfd=this._currentDfd;if(!dfd){this._fireNextRequest();return;}var _26=dfd.ioArgs;var _27=_26.args;var _28=_4.byId(_27.form);if(_28){var _29=_26._contentToClean;for(var i=0;i<_29.length;i++){var key=_29[i];for(var j=0;j<_28.childNodes.length;j++){var _2a=_28.childNodes[j];if(_2a.name==key){_4.destroy(_2a);break;}}}if(_26["_originalAction"]){_28.setAttribute("action",_26._originalAction);}if(_26["_originalTarget"]){_28.setAttribute("target",_26._originalTarget);_28.target=_26._originalTarget;}}_26._finished=true;}};}if(!_4._hasResource["esri.layers.FeatureLayer"]){_4._hasResource["esri.layers.FeatureLayer"]=true;_4.provide("esri.layers.FeatureLayer");_4.declare("esri.layers.FeatureLayer",esri.layers.GraphicsLayer,{constructor:function(url,_2b){this._outFields=_2b&&_2b.outFields;this._loadCallback=_2b&&_2b.loadCallback;var _2c=_2b&&_2b._usePatch;this._usePatch=(_2c===null||_2c===undefined)?true:_2c;this._trackIdField=_2b&&_2b.trackIdField;this.objectIdField=_2b&&_2b.objectIdField;this._maxOffset=_2b&&_2b.maxAllowableOffset;this._optEditable=_2b&&_2b.editable;this._optAutoGen=_2b&&_2b.autoGeneralize;this.editSummaryCallback=_2b&&_2b.editSummaryCallback;this.userId=_2b&&_2b.userId;this.userIsAdmin=_2b&&_2b.userIsAdmin;this.useMapTime=(_2b&&_2b.hasOwnProperty("useMapTime"))?(!!_2b.useMapTime):true;this.source=_2b&&_2b.source;this.gdbVersion=_2b&&_2b.gdbVersion;this._selectedFeatures={};this._selectedFeaturesArr=[];this._newFeatures=[];this._deletedFeatures={};this._ulid=this._getUniqueId();var _2d=this.constructor,_2e=this.mode=(esri._isDefined(_2b&&_2b.mode)?_2b.mode:_2d.MODE_ONDEMAND);switch(_2e){case _2d.MODE_SNAPSHOT:this._mode=new esri.layers._SnapshotMode(this);this._isSnapshot=true;break;case _2d.MODE_ONDEMAND:this._tileWidth=(_2b&&_2b.tileWidth)||512;this._tileHeight=(_2b&&_2b.tileHeight)||512;this._mode=new esri.layers._OnDemandMode(this);var _2f=_2b&&_2b.latticeTiling;this.latticeTiling=_2f;break;case _2d.MODE_SELECTION:this._mode=new esri.layers._SelectionMode(this);this._isSelOnly=true;break;}this._initLayer=_4.hitch(this,this._initLayer);this._selectHandler=_4.hitch(this,this._selectHandler);this._editable=false;if(_4.isObject(url)&&url.layerDefinition){var _30=url;this._collection=true;this.mode=_2d.MODE_SNAPSHOT;this._initLayer(_30);return this;}this._task=new esri.tasks.QueryTask(this.url,{source:this.source,gdbVersion:this.gdbVersion});var _31=this._url.path;this._fserver=false;if(_31.search(/\/FeatureServer\//i)!==-1){this._fserver=true;}var _32=_2b&&_2b.resourceInfo;if(_32){this._initLayer(_32);}else{if(this.source){var _33={source:this.source.toJson()};this._url.query=_4.mixin(this._url.query,{layer:_4.toJson(_33)});}if(this.gdbVersion){this._url.query=_4.mixin(this._url.query,{gdbVersion:this.gdbVersion});}esri.request({url:_31,content:_4.mixin({f:"json"},this._url.query),callbackParamName:"callback",load:this._initLayer,error:this._errorHandler});}},_initLayer:function(_34,io){if(_34||io){this._json=_34;this._findCredential();if(this._collection){this._mode=new esri.layers._SnapshotMode(this);this._isSnapshot=true;this._featureSet=_34.featureSet;this._nextId=_34.nextObjectId;_34=_34.layerDefinition;}if(_34.hasOwnProperty("capabilities")){var _35=(this.capabilities=_34.capabilities);if(_35&&_35.toLowerCase().indexOf("editing")!==-1){this._editable=true;}else{this._editable=false;}}else{if(!this._collection){this._editable=this._fserver;}}if(esri._isDefined(this._optEditable)){this._editable=this._optEditable;delete this._optEditable;}this._json=_4.toJson(this._json);if(this._editable){delete this._maxOffset;}else{if(this.mode!==this.constructor.MODE_SNAPSHOT&&((_34.geometryType==="esriGeometryPolyline")||(_34.geometryType==="esriGeometryPolygon"))){this._autoGeneralize=esri._isDefined(this._optAutoGen)?this._optAutoGen:(this.mode===this.constructor.MODE_ONDEMAND);delete this._optAutoGen;}}this.minScale=_34.minScale||0;this.maxScale=_34.maxScale||0;this.layerId=_34.id;this.name=_34.name;this.description=_34.description;this.copyright=_34.copyrightText;this.type=_34.type;this.geometryType=_34.geometryType;this.displayField=_34.displayField;this.defaultDefinitionExpression=_34.definitionExpression;this.fullExtent=new esri.geometry.Extent(_34.extent);if((this.geometryType==="esriGeometryPoint")||(this.geometryType==="esriGeometryMultipoint")){this.latticeTiling=false;}this.indexedFields=_34.indexedFields;this.maxRecordCount=_34.maxRecordCount;this.canModifyLayer=_34.canModifyLayer;this.supportsStatistics=_34.supportsStatistics;this.supportsAdvancedQueries=_34.supportsAdvancedQueries;this.hasLabels=_34.hasLabels;this.canScaleSymbols=_34.canScaleSymbols;this.supportsRollbackOnFailure=_34.supportsRollbackOnFailure;this.syncCanReturnChanges=_34.syncCanReturnChanges;this.isDataVersioned=_34.isDataVersioned;this.editFieldsInfo=_34.editFieldsInfo;this.ownershipBasedAccessControlForFeatures=_34.ownershipBasedAccessControlForFeatures;if(this.editFieldsInfo&&this.ownershipBasedAccessControlForFeatures){this.creatorField=this.editFieldsInfo.creatorField;}this.relationships=_34.relationships;this.allowGeometryUpdates=esri._isDefined(_34.allowGeometryUpdates)?_34.allowGeometryUpdates:true;this._isTable=(this.type==="Table");var _36=(this.fields=[]),_37=_34.fields,i;for(i=0;i<_37.length;i++){_36.push(new esri.layers.Field(_37[i]));}if(!this.objectIdField){this.objectIdField=_34.objectIdField;if(!this.objectIdField){_37=_34.fields;for(i=0;i<_37.length;i++){var _38=_37[i];if(_38.type==="esriFieldTypeOID"){this.objectIdField=_38.name;break;}}}if(!this.objectIdField){console.debug("esri.layers.FeatureLayer: "+esri.substitute({url:this.url},esri.bundle.layers.FeatureLayer.noOIDField));}}if(!esri._isDefined(this._nextId)){var _39=this.objectIdField,_3a=-1;if(this._collection&&_39){var _3b=this._featureSet,_3c=_3b&&_3b.features,il=_3c?_3c.length:0,oid,_3d;for(i=0;i<il;i++){_3d=_3c[i].attributes;oid=_3d&&_3d[_39];if(oid>_3a){_3a=oid;}}}this._nextId=(_3a+1);}this.globalIdField=_34.globalIdField;this.typeIdField=_34.typeIdField;this.visibilityField=_34.visibilityField;var _3e=_34.defaultSymbol;if(_3e){this.defaultSymbol=esri.symbol.fromJson(_3e);}var _3f=this.types=[],_40=_34.types,_41,_42,_43,_44=this.editFieldsInfo,_45=_44&&_44.creatorField,_46=_44&&_44.editorField,fix=(_45||_46),_47=[];if(_40){for(i=0;i<_40.length;i++){_41=new esri.layers.FeatureType(_40[i]);_42=_41.templates;if(fix&&_42&&_42.length){_47=_47.concat(_42);}_3f.push(_41);}}var _48=_34.templates,_49,_4a=this.templates=[];if(_48){for(i=0;i<_48.length;i++){_49=new esri.layers.FeatureTemplate(_48[i]);if(fix){_47.push(_49);}_4a.push(_49);}}for(i=0;i<_47.length;i++){_43=_4.getObject("prototype.attributes",false,_47[i]);if(_43){if(_45){delete _43[_45];}if(_46){delete _43[_46];}}}var _4b=_34.timeInfo;if(_4b){this.timeInfo=new esri.layers.TimeInfo(_4b);this._startTimeField=_4b.startTimeField;this._endTimeField=_4b.endTimeField;if(this._startTimeField&&this._endTimeField){this._twoTimeFields=true;}if(this._trackIdField){_4b.trackIdField=this._trackIdField;}else{this._trackIdField=_4b.trackIdField;}}this.hasAttachments=(!this._collection&&_34.hasAttachments)?true:false;this.htmlPopupType=_34.htmlPopupType;var _4c=_34.drawingInfo,_4d;if(!this.renderer){if(_4c&&_4c.renderer){_4d=_4c.renderer;this.setRenderer(esri.renderer.fromJson(_4d));if(_4d.type==="classBreaks"){this.renderer._setMaxInclusiveness(true);}if(!this._collection){var _4e=_4d.type,_4f=[];_4d=this.renderer;switch(_4e){case "simple":_4f.push(_4d.symbol);break;case "uniqueValue":case "classBreaks":_4f.push(_4d.defaultSymbol);_4f=_4f.concat(_4.map(_4d.infos,function(_50){return _50.symbol;}));break;}_4f=_4.filter(_4f,esri._isDefined);var _51=this._url.path+"/images/",_52=this._getToken();_4.forEach(_4f,function(sym){var url=sym.url;if(url){if((url.search(/https?\:/)===-1)&&(url.indexOf("data:")===-1)){sym.url=_51+url;}if(_52&&sym.url.search(/https?\:/)!==-1){sym.url+=("?token="+_52);}}});}}else{if(_3e){_40=this.types;if(_40.length>0){_4d=new esri.renderer.UniqueValueRenderer(this.defaultSymbol,this.typeIdField);_4.forEach(_40,function(_53){_4d.addValue(_53.id,_53.symbol);});}else{_4d=new esri.renderer.SimpleRenderer(this.defaultSymbol);}this.setRenderer(_4d);}else{if(!this._isTable){var _54;switch(this.geometryType){case "esriGeometryPoint":case "esriGeometryMultipoint":_54=new esri.symbol.SimpleMarkerSymbol();break;case "esriGeometryPolyline":_54=new esri.symbol.SimpleLineSymbol();break;case "esriGeometryPolygon":_54=new esri.symbol.SimpleFillSymbol();break;}this.setRenderer(_54?new esri.renderer.SimpleRenderer(_54):null);}}}}var _55=(_4c&&_4c.transparency)||0;if(!esri._isDefined(this.opacity)&&_55>0){this.opacity=1-(_55/100);}this.version=_34.currentVersion;if(!this.version){var ver;if("capabilities" in _34||"drawingInfo" in _34||"hasAttachments" in _34||"htmlPopupType" in _34||"relationships" in _34||"timeInfo" in _34||"typeIdField" in _34||"types" in _34){ver=10;}else{ver=9.3;}this.version=ver;}if((_4.isIE||_4.isSafari)&&this._editable&&this.version<10.02){this._ts=true;}this.loaded=true;this._fixRendererFields();this._checkFields();this._updateCaps();if(this._collection){this._fireUpdateStart();var _56=this._featureSet;delete this._featureSet;this._mode._drawFeatures(new esri.tasks.FeatureSet(_56));this._fcAdded=true;}this.onLoad(this);var _57=this._loadCallback;if(_57){delete this._loadCallback;_57(this);}}},setRenderer:function(ren){this.inherited("setRenderer",arguments);var _58=this.renderer;if(_58){this._ager=(_58.declaredClass.indexOf("TemporalRenderer")!==-1&&_58.observationAger&&_58.observationRenderer);var _59=_4.filter([_58,_58.observationRenderer,_58.latestObservationRenderer,_58.trackRenderer],esri._isDefined);var _5a=[];_4.forEach(_59,function(rnd){_5a.push(rnd.attributeField);_5a.push(rnd.attributeField2);_5a.push(rnd.attributeField3);},this);this._rendererFields=_4.filter(_5a,esri._isDefined);}else{this._ager=false;this._rendererFields=[];}if(this.loaded&&this._rendererFields.length>0){this._fixRendererFields();this._checkFields(this._rendererFields);}if(this.loaded&&this._collection){this._typesDirty=true;}},_setMap:function(map,_5b){this._map=map;this._toggleTime(true);var div=this.inherited("_setMap",arguments);this.clearSelection();var _5c=this.renderer;if(this.timeInfo){if(this._trackIdField||(_5c&&(_5c.latestObservationRenderer||_5c.trackRenderer))){this._trackManager=new esri.layers._TrackManager(this);this._trackManager.initialize(map);}}this._zoomConnect=_4.connect(map,"onZoomEnd",this,this._zoomHandler);this._zoomHandler();var _5d=this._mode;if(_5d){_5d.initialize(map);}return div;},_unsetMap:function(map,_5e){var _5f=this._mode;if(_5f){_5f.destroy();this._mode=null;}if(this._trackManager){this._trackManager.destroy();this._trackManager=null;}_4.disconnect(this._zoomConnect);this._zoomConnect=null;this._toggleTime(false);this.inherited("_unsetMap",arguments);},refresh:function(){var _60=this._mode;if(_60){_60.refresh();}},setEditable:function(_61){if(!this._collection){console.log("FeatureLayer:setEditCapabilities - this functionality is not yet supported for layer in a feature service");return this;}if(!this.loaded){this._optEditable=_61;return this;}var _62=this._editable;this._editable=_61;this._updateCaps();if(_62!==_61){this.onCapabilitiesChange();}return this;},getEditCapabilities:function(_63){var _64={"canCreate":false,"canUpdate":false,"canDelete":false};if(!this.loaded||!this._editable){return _64;}var _65=_63&&_63.feature,_66=_63&&_63.userId,_67=_4.map((this.capabilities?this.capabilities.toLowerCase().split(","):[]),_4.trim),_68=_4.indexOf(_67,"editing")>-1,_69=_68&&(_4.indexOf(_67,"create")>-1),_6a=_68&&(_4.indexOf(_67,"update")>-1),_6b=_68&&(_4.indexOf(_67,"delete")>-1),_6c=this.ownershipBasedAccessControlForFeatures,_6d=this.editFieldsInfo,_6e=_6d&&_6d.creatorField,_6f=_6d&&_6d.realm,_70=_65&&_65.attributes,_71=(_70&&_6e)?_70[_6e]:undefined,_72,_73=!!this.userIsAdmin,_74=!_6c||_73||!!(_6c.allowOthersToUpdate||_6c.allowUpdateToOthers),_75=!_6c||_73||!!(_6c.allowOthersToDelete||_6c.allowDeleteToOthers);if(_68&&(!(_69||_6a||_6b)||_73)){_69=_6a=_6b=true;}_72={"canCreate":_69,"canUpdate":_6a,"canDelete":_6b};if(_71===null){_72.canUpdate=_6a&&_74;_72.canDelete=_6b&&_75;}else{if(_71===""){return _72;}else{if(_71){_66=_66||this.getUserId();if(_66&&_6f){_66=_66+"@"+_6f;}if(_66.toLowerCase()===_71.toLowerCase()){return _72;}else{_72.canUpdate=_6a&&_74;_72.canDelete=_6b&&_75;}}}}return _72;},getUserId:function(){var _76;if(this.loaded){_76=(this.credential&&this.credential.userId)||this.userId||"";}return _76;},setUserIsAdmin:function(_77){this.userIsAdmin=_77;},setEditSummaryCallback:function(_78){this.editSummaryCallback=_78;},getEditSummary:function(_79,_7a,_7b){_7b=esri._isDefined(_7b)?_7b:(new Date()).getTime();var _7c="",_7d=this.getEditInfo(_79,_7a,_7b),_7e=(_7a&&_7a.callback)||this.editSummaryCallback;if(_7e){_7d=_7e(_79,_7d)||"";}if(_4.isString(_7d)){_7c=_7d;}else{if(_7d){var _7f=_7d.action,_80=_7d.userId,_81=_7d.timeValue,_82=0;if(_7f){_82++;}if(_80){_82++;}if(esri._isDefined(_81)){_82++;}if(_82>1){_7c=(_7f==="edit"?"edit":"create")+(_80?"User":"")+(esri._isDefined(_81)?_7d.displayPattern:"");}}_7c=_7c&&esri.substitute(_7d,esri.bundle.layers.FeatureLayer[_7c]);}return _7c;},getEditInfo:function(_83,_84,_85){if(!this.loaded){return;}_85=esri._isDefined(_85)?_85:(new Date()).getTime();var _86=(_84&&_84.action)||"last",_87=this.editFieldsInfo,_88=_87&&_87.creatorField,_89=_87&&_87.creationDateField,_8a=_87&&_87.editorField,_8b=_87&&_87.editDateField,_8c=_87&&_87.realm,_8d=_83&&_83.attributes,_8e=(_8d&&_88)?_8d[_88]:undefined,_8f=(_8d&&_89)?_8d[_89]:null,_90=(_8d&&_8a)?_8d[_8a]:undefined,_91=(_8d&&_8b)?_8d[_8b]:null,_92=this._getEditData(_8e,_8f,_85),_93=this._getEditData(_90,_91,_85),_94;switch(_86){case "creation":_94=_92;break;case "edit":_94=_93;break;case "last":_94=_93||_92;break;}if(_94){_94.action=(_94===_93)?"edit":"creation";}return _94;},_getEditData:function(_95,_96,_97){var _98,_99,_9a,_9b=60000,_9c=3600000,_9d=2*_9c,_9e=24*_9c,_9f=7*_9e;if(esri._isDefined(_96)){_99=_97-_96;if(_99<0){_9a="Full";}else{if(_99<_9b){_9a="Seconds";}else{if(_99<(2*_9b)){_9a="Minute";}else{if(_99<_9c){_9a="Minutes";}else{if(_99<_9d){_9a="Hour";}else{if(_99<_9e){_9a="Hours";}else{if(_99<_9f){_9a="WeekDay";}else{_9a="Full";}}}}}}}}if((_95!==undefined)||_9a){_98=_98||{};_98.userId=_95;if(_9a){var _a0=_4.date.locale.format,_a1=new Date(_96);_98.minutes=Math.floor(_99/_9b);_98.hours=Math.floor(_99/_9c);_98.weekDay=_a0(_a1,{datePattern:"EEEE",selector:"date"});_98.formattedDate=_a0(_a1,{selector:"date"});_98.formattedTime=_a0(_a1,{selector:"time"});_98.displayPattern=_9a;_98.timeValue=_96;}}return _98;},isEditable:function(){return this._editable;},setMaxAllowableOffset:function(_a2){if(!this._editable){this._maxOffset=_a2;}return this;},getMaxAllowableOffset:function(){return this._maxOffset;},setAutoGeneralize:function(_a3){if(!this.loaded){this._optAutoGen=_a3;}else{if(!this._editable&&(this.mode!==this.constructor.MODE_SNAPSHOT)&&((this.geometryType==="esriGeometryPolyline")||(this.geometryType==="esriGeometryPolygon"))){this._autoGeneralize=_a3;if(_a3){var map=this._map;if(map&&map.loaded){this._maxOffset=Math.floor(map.extent.getWidth()/map.width);}}else{delete this._maxOffset;}}}return this;},setScaleRange:function(_a4,_a5){this.minScale=_a4||0;this.maxScale=_a5||0;if(this._map&&this._map.loaded){this._updateStatus();}},setGDBVersion:function(_a6){if(!this._collection&&(_a6!==this.gdbVersion)&&(_a6||this.gdbVersion)){this.gdbVersion=_a6;this._task.gdbVersion=_a6;this._url.query=_4.mixin(this._url.query,{gdbVersion:_a6});if(this.loaded){this.clearSelection();if(this._map){this.refresh();}}this.onGDBVersionChange();}return this;},setDefinitionExpression:function(_a7){this._defnExpr=_a7;var _a8=this._mode;if(_a8){_a8.propertyChangeHandler(1);}return this;},getDefinitionExpression:function(){return this._defnExpr;},setTimeDefinition:function(_a9){if(this._isSnapshot){this._timeDefn=_a9;var _aa=this._mode;if(_aa){_aa.propertyChangeHandler(2);}}return this;},getTimeDefinition:function(){return this._timeDefn;},setTimeOffset:function(_ab,_ac){this._timeOffset=_ab;this._timeOffsetUnits=_ac;var _ad=this._mode;if(_ad){_ad.propertyChangeHandler(0);}return this;},setUseMapTime:function(use){this.useMapTime=use;this._toggleTime(!this._suspended);var _ae=this._mode;if(_ae){_ae.propertyChangeHandler(0);}},selectFeatures:function(_af,_b0,_b1,_b2){_b0=_b0||this.constructor.SELECTION_NEW;var _b3=this._getShallowClone(_af),map=this._map,_b4,dfd=esri._fixDfd(new _4.Deferred(esri._dfdCanceller));_b3.outFields=this._getOutFields();_b3.returnGeometry=true;if(map){_b3.outSpatialReference=new esri.SpatialReference(map.spatialReference.toJson());}if(!this._applyQueryFilters(_b3)){_b4={features:[]};this._selectHandler(_b4,_b0,_b1,_b2,dfd);return dfd;}var _b5=this._canDoClientSideQuery(_b3);if(_b5){_b4={features:this._doQuery(_b3,_b5)};this._selectHandler(_b4,_b0,_b1,_b2,dfd);return dfd;}else{if(this._collection){var err=new Error("FeatureLayer::selectFeatures - "+esri.bundle.layers.FeatureLayer.invalidParams);this._resolve([err],null,_b2,dfd,true);return dfd;}var _b6=this;if(this._ts){_b3._ts=(new Date()).getTime();}var _b7=dfd._pendingDfd=this._task.execute(_b3);_b7.addCallbacks(function(_b8){_b6._selectHandler(_b8,_b0,_b1,_b2,dfd);},function(err){_b6._resolve([err],null,_b2,dfd,true);});return dfd;}},getSelectedFeatures:function(){var _b9=this._selectedFeatures,_ba=[],_bb;for(_bb in _b9){if(_b9.hasOwnProperty(_bb)){_ba.push(_b9[_bb]);}}return _ba;},clearSelection:function(_bc){var _bd=this._selectedFeatures,_be=this._mode,_bf;for(_bf in _bd){if(_bd.hasOwnProperty(_bf)){this._unSelectFeatureIIf(_bf,_be);_be._removeFeatureIIf(_bf);}}this._selectedFeatures={};if(this._isSelOnly){_be._applyTimeFilter(true);}if(!_bc){this.onSelectionClear();}return this;},setSelectionSymbol:function(_c0){this._selectionSymbol=_c0;if(_c0){var _c1=this._selectedFeatures,_c2;for(_c2 in _c1){if(_c1.hasOwnProperty(_c2)){_c1[_c2].setSymbol(_c0);}}}return this;},getSelectionSymbol:function(){return this._selectionSymbol;},__msigns:[{n:"applyEdits",c:5,a:[{i:0},{i:1}],e:4,f:1}],applyEdits:function(_c3,_c4,_c5,_c6,_c7,_c8){var _c9=_c8.assembly,dfd=_c8.dfd;this._applyNormalized(_c3,_c9&&_c9[0]);this._applyNormalized(_c4,_c9&&_c9[1]);this.onBeforeApplyEdits(_c3,_c4,_c5);var i,_ca={},_cb=this.objectIdField,_cc={f:"json"},_cd=false;if(this._collection){var _ce={};_ce.addResults=_c3?_4.map(_c3,function(){_cd=true;return {objectId:this._nextId++,success:true};},this):null;_ce.updateResults=_c4?_4.map(_c4,function(_cf){_cd=true;var oid=_cf.attributes[_cb];_ca[oid]=_cf;return {objectId:oid,success:true};},this):null;_ce.deleteResults=_c5?_4.map(_c5,function(_d0){_cd=true;return {objectId:_d0.attributes[_cb],success:true};},this):null;if(_cd){this._editHandler(_ce,_c3,_ca,_c6,_c7,dfd);}return;}if(_c3&&_c3.length>0){_cc.adds=this._convertFeaturesToJson(_c3,0,1);_cd=true;}if(_c4&&_c4.length>0){for(i=0;i<_c4.length;i++){var _d1=_c4[i];_ca[_d1.attributes[_cb]]=_d1;}_cc.updates=this._convertFeaturesToJson(_c4,0,0,1);_cd=true;}if(_c5&&_c5.length>0){var ids=[];for(i=0;i<_c5.length;i++){ids.push(_c5[i].attributes[_cb]);}_cc.deletes=ids.join(",");_cd=true;}if(_cd){var _d2=this;return esri.request({url:this._url.path+"/applyEdits",content:_4.mixin(_cc,this._url.query),callbackParamName:"callback",load:function(_d3){_d2._editHandler(_d3,_c3,_ca,_c6,_c7,dfd);},error:function(err){_d2._resolve([err],null,_c7,dfd,true);}},{usePost:true});}},queryFeatures:function(_d4,_d5,_d6){return this._query("execute","onQueryFeaturesComplete",_d4,_d5,_d6);},queryRelatedFeatures:function(_d7,_d8,_d9){return this._query("executeRelationshipQuery","onQueryRelatedFeaturesComplete",_d7,_d8,_d9);},queryIds:function(_da,_db,_dc){return this._query("executeForIds","onQueryIdsComplete",_da,_db,_dc);},queryCount:function(_dd,_de,_df){return this._query("executeForCount","onQueryCountComplete",_dd,_de,_df);},queryAttachmentInfos:function(_e0,_e1,_e2){var url=this._url.path+"/"+_e0+"/attachments",dfd=new _4.Deferred(esri._dfdCanceller),_e3=this;dfd._pendingDfd=esri.request({url:url,content:_4.mixin({f:"json"},this._url.query),callbackParamName:"callback",load:function(_e4){var _e5=_e4.attachmentInfos,_e6;_4.forEach(_e5,function(_e7){_e6=_4.objectToQuery({gdbVersion:_e3._url.query&&_e3._url.query.gdbVersion,layer:_e3._url.query&&_e3._url.query.layer,token:_e3._getToken()});_e7.url=url+"/"+_e7.id+(_e6?("?"+_e6):"");_e7.objectId=_e0;});_e3._resolve([_e5],"onQueryAttachmentInfosComplete",_e1,dfd);},error:function(err){_e3._resolve([err],null,_e2,dfd,true);}});return dfd;},addAttachment:function(_e8,_e9,_ea,_eb){return this._sendAttachment("add",_e8,_e9,_ea,_eb);},updateAttachment:function(_ec,_ed,_ee,_ef,_f0){_ee.appendChild(_4.create("input",{type:"hidden",name:"attachmentId",value:_ed}));return this._sendAttachment("update",_ec,_ee,_ef,_f0);},deleteAttachments:function(_f1,_f2,_f3,_f4){var url=this._url.path+"/"+_f1+"/deleteAttachments",dfd=new _4.Deferred(esri._dfdCanceller),_f5=this,_f6={f:"json",attachmentIds:_f2.join(",")};dfd._pendingDfd=esri.request({url:url,content:_4.mixin(_f6,this._url.query),callbackParamName:"callback",load:_4.hitch(this,function(_f7){var _f8=_f7.deleteAttachmentResults;_f8=_4.map(_f8,function(_f9){var res=new esri.layers.FeatureEditResult(_f9);res.attachmentId=res.objectId;res.objectId=_f1;return res;});_f5._resolve([_f8],"onDeleteAttachmentsComplete",_f3,dfd);}),error:function(err){_f5._resolve([err],null,_f4,dfd,true);}},{usePost:true});return dfd;},addType:function(_fa){if(!this._collection){return false;}var _fb=this.types;if(_fb){var _fc=_4.some(_fb,function(_fd){if(_fd.id==_fa.id){return true;}return false;});if(_fc){return false;}else{_fb.push(_fa);}}else{this.types=[_fa];}this._typesDirty=true;return true;},deleteType:function(_fe){if(!this._collection){return;}var _ff=this.types;if(_ff){var _100=-1;_4.some(_ff,function(type,_101){if(type.id==_fe){_100=_101;return true;}return false;});if(_100>-1){this._typesDirty=true;return _ff.splice(_100,1)[0];}}},toJson:function(){var _102=this._json,json=_4.isString(_102)?_4.fromJson(_102):_4.clone(_102);if(!json){return;}json=json.layerDefinition?json:{layerDefinition:json};var _103=json.layerDefinition,_104=this._collection;if(_104&&this._typesDirty){_103.types=_4.map(this.types||[],function(type){return type.toJson();});var _105=this.renderer,_106=_103.drawingInfo;if(_106&&_105&&_105.declaredClass.indexOf("TemporalRenderer")===-1){_106.renderer=_105.toJson();}}var _107=null;if(!(_104&&!this._fcAdded)){_107={geometryType:_103.geometryType,features:this._convertFeaturesToJson(this.graphics,true)};}json.featureSet=_4.mixin({},json.featureSet||{},_107);if(_104){json.nextObjectId=this._nextId;_103.capabilities=this.capabilities;}return json;},onSelectionComplete:function(){},onSelectionClear:function(){},onBeforeApplyEdits:function(){},onEditsComplete:function(){},onQueryFeaturesComplete:function(){},onQueryRelatedFeaturesComplete:function(){},onQueryIdsComplete:function(){},onQueryCountComplete:function(){},onQueryAttachmentInfosComplete:function(){},onAddAttachmentComplete:function(){},onUpdateAttachmentComplete:function(){},onDeleteAttachmentsComplete:function(){},onCapabilitiesChange:function(){},onGDBVersionChange:function(){},onQueryLimitExceeded:function(){},_updateCaps:function(){var _108=this._editable,_109=_4.trim(this.capabilities||""),_10a=_4.map((_109?_109.split(","):[]),_4.trim),caps=_4.map((_109?_109.toLowerCase().split(","):[]),_4.trim),_10b=_4.indexOf(caps,"editing"),cap,i,_10c,_10d={"Create":_4.indexOf(caps,"create"),"Update":_4.indexOf(caps,"update"),"Delete":_4.indexOf(caps,"delete")};if(_108&&_10b===-1){_10a.push("Editing");}else{if(!_108&&_10b>-1){_10c=[_10b];for(cap in _10d){if(_10d[cap]>-1){_10c.push(_10d[cap]);}}_10c.sort();for(i=_10c.length-1;i>=0;i--){_10a.splice(_10c[i],1);}}}this.capabilities=_10a.join(",");},_counter:{value:0},_getUniqueId:function(){return this._counter.value++;},_getDesiredStatus:function(){return this.visible&&this._isMapAtVisibleScale();},_isMapAtVisibleScale:function(){if(!this._map){return false;}var _10e=esri.geometry.getScale(this._map);var _10f=this.minScale,_110=this.maxScale,_111=!_10f,_112=!_110;if(!_111&&_10e<=_10f){_111=true;}if(!_112&&_10e>=_110){_112=true;}return (_111&&_112)?true:false;},_suspend:function(){this.inherited("_suspend",arguments);this._toggleTime(false);var mode=this._mode;if(mode){mode.suspend();}},_resume:function(){this.inherited("_resume",arguments);this._toggleTime(true);var mode=this._mode;if(mode){mode.resume();}},_zoomHandler:function(){var map=this._map;if(map&&map.loaded){if(this._autoGeneralize){this._maxOffset=Math.floor(map.extent.getWidth()/map.width);}this._updateStatus();}},_toggleTime:function(_113){var map=this._map;if(_113&&this.timeInfo&&this.useMapTime&&map){this._mapTimeExtent=map.timeExtent;if(!this._timeConnect){this._timeConnect=_4.connect(map,"onTimeExtentChange",this,this._timeChangeHandler);}}else{this._mapTimeExtent=null;_4.disconnect(this._timeConnect);this._timeConnect=null;}},_timeChangeHandler:function(_114){this._mapTimeExtent=_114;var mode=this._mode;if(mode){mode.propertyChangeHandler(0);}},_getOffsettedTE:function(_115){var _116=this._timeOffset,_117=this._timeOffsetUnits;return (_115&&_116&&_117)?_115.offset(-1*_116,_117):_115;},_getTimeOverlap:function(_118,_119){if(_118&&_119){return _118.intersection(_119);}else{return _118||_119;}},_getTimeFilter:function(_11a){var _11b=this.getTimeDefinition(),_11c=null,_11d;if(_11b||_11c){_11d=this._getTimeOverlap(_11b,_11c);if(!_11d){return [false];}}if(_11a){_11a=_11d?this._getTimeOverlap(_11a,_11d):_11a;if(!_11a){return [false];}}else{_11a=_11d;}return [true,_11a];},_getAttributeFilter:function(_11e){var _11f=this.getDefinitionExpression();if(_11e){_11e=_11f?"("+_11f+") AND ("+_11e+")":_11e;}else{_11e=_11f;}return _11e;},_applyQueryFilters:function(_120){_120.where=this._getAttributeFilter(_120.where);_120.maxAllowableOffset=this._maxOffset;if(this.timeInfo){var _121=this._getTimeFilter(_120.timeExtent);if(!_121[0]){return false;}else{_120.timeExtent=_121[1];}}return true;},_add:function(_122){var _123=this._selectionSymbol,attr=_122.attributes,_124=this.visibilityField;if(_123&&this._isSelOnly){_122.setSymbol(_123);}if(_124&&attr&&attr.hasOwnProperty(_124)){_122[attr[_124]?"show":"hide"]();}return this.add.apply(this,arguments);},_remove:function(){return this.remove.apply(this,arguments);},_canDoClientSideQuery:function(_125){var _126=[],map=this._map;if(this._isTable||!map){return;}if(_125.text||(_125.where&&_125.where!==this.getDefinitionExpression())){return;}var _127=this._isSnapshot,_128=this._isSelOnly;var _129=_125.geometry;if(_129){if(!_128&&_125.spatialRelationship===esri.tasks.Query.SPATIAL_REL_INTERSECTS&&(_129.type==="extent"&&(_127||map.extent.contains(_129)))){_126.push(1);}else{return;}}var ids=_125.objectIds;if(ids){if(_127){_126.push(2);}else{var len=ids.length,mode=this._mode,_12a=0,i;for(i=0;i<len;i++){if(mode._getFeature(ids[i])){_12a++;}}if(_12a===len){_126.push(2);}else{return;}}}if(this.timeInfo){var _12b=_125.timeExtent,_12c=this._mapTimeExtent;if(_127){if(_12b){_126.push(3);}}else{if(_128){if(_12b){return;}}else{if(_12c){if(_4.indexOf(_126,2)!==-1){if(_12b){_126.push(3);}}else{return;}}else{if(_126.length>0){if(_12b){_126.push(3);}}else{if(_12b){return;}}}}}}return _126.length>0?_126:null;},_doQuery:function(_12d,_12e,_12f){var _130=[],mode=this._mode,_131=this.objectIdField,i,len,_132;if(_4.indexOf(_12e,2)!==-1){_130=[];var ids=_12d.objectIds;len=ids.length;for(i=0;i<len;i++){var obj=mode._getFeature(ids[i]);if(obj){_130.push(obj);}}if(_130.length===0){return [];}}if(_4.indexOf(_12e,1)!==-1){_132=_130.length>0?_130:this.graphics;len=_132.length;var _133=_12d.geometry._normalize(null,true);_130=[];for(i=0;i<len;i++){var _134=_132[i],_135=_134.geometry;if(_135){if(this.normalization&&_133.length){if(_133[0].intersects(_135)||_133[1].intersects(_135)){_130.push(_134);}}else{if(_133.intersects(_135)){_130.push(_134);}}}}if(_130.length===0){return [];}}if(_4.indexOf(_12e,3)!==-1){if(this.timeInfo){_132=_130.length>0?_130:this.graphics;var time=_12d.timeExtent,_136=this._filterByTime(_132,time.startTime,time.endTime);_130=_136.match;}}if(_12f){return _4.map(_130,function(obj){return obj.attributes[_131];},this);}else{return _130;}},_filterByTime:function(_137,_138,_139){var _13a=this._startTimeField,_13b=this._endTimeField,_13c;if(!this._twoTimeFields){_13c=_13a||_13b;}var _13d=esri._isDefined,yea=[],nay=[],i,len=_137.length,_13e,_13f;_138=_138?_138.getTime():-Infinity;_139=_139?_139.getTime():Infinity;if(_13c){for(i=0;i<len;i++){_13e=_137[i];_13f=_13e.attributes;var time=_13f[_13c];if(time>=_138&&time<=_139){yea.push(_13e);}else{nay.push(_13e);}}}else{for(i=0;i<len;i++){_13e=_137[i];_13f=_13e.attributes;var _140=_13f[_13a],end=_13f[_13b];_140=_13d(_140)?_140:-Infinity;end=_13d(end)?end:Infinity;if((_140>=_138&&_140<=_139)||(end>=_138&&end<=_139)||(_138>=_140&&_139<=end)){yea.push(_13e);}else{nay.push(_13e);}}}return {match:yea,noMatch:nay};},_resolve:function(args,_141,_142,dfd,_143){if(_141){this[_141].apply(this,args);}if(_142){_142.apply(null,args);}if(dfd){esri._resDfd(dfd,args,_143);}},_getShallowClone:function(_144){var _145=new esri.tasks.Query(),prop;for(prop in _144){if(_144.hasOwnProperty(prop)){_145[prop]=_144[prop];}}return _145;},_query:function(type,_146,_147,_148,_149){var that=this,dfd=new _4.Deferred(esri._dfdCanceller);var _14a=function(_14b,_14c){if(!_14c&&type==="execute"&&!that._isTable){var _14d=_14b.features,mode=that._mode,_14e=that.objectIdField,il=_14d.length,i;for(i=il-1;i>=0;i--){var oid=_14d[i].attributes[_14e];var _14f=mode._getFeature(oid);if(_14f){_14d.splice(i,1,_14f);}}}that._resolve([_14b],_146,_148,dfd);};if(type!=="executeRelationshipQuery"){_147=this._getShallowClone(_147);_147.outFields=this._getOutFields();_147.returnGeometry=true;var map=this._map,_150;if(map){_147.outSpatialReference=new esri.SpatialReference(map.spatialReference.toJson());}if(!this._applyQueryFilters(_147)){switch(type){case "execute":_150=new esri.tasks.FeatureSet({features:[]});break;case "executeForIds":_150=[];break;case "executeForCount":_150=0;break;}_14a(_150,true);return dfd;}var _151=this._canDoClientSideQuery(_147);if(_151){var _152=this._doQuery(_147,_151,(type==="executeForIds"||type==="executeForCount"));switch(type){case "execute":_150=new esri.tasks.FeatureSet();_150.features=_152;break;case "executeForIds":_150=_152;break;case "executeForCount":_150=_152.length;break;}_14a(_150,true);return dfd;}}if(this._collection){var err=new Error("FeatureLayer::_query - "+esri.bundle.layers.FeatureLayer.invalidParams);this._resolve([err],null,_149,dfd,true);return dfd;}if(this._ts){_147._ts=(new Date()).getTime();}var temp=dfd._pendingDfd=this._task[type](_147);temp.addCallbacks(_14a,function(err){that._resolve([err],null,_149,dfd,true);});return dfd;},_convertFeaturesToJson:function(_153,_154,_155,_156){var json=[],_157=this._selectionSymbol,_158=this.visibilityField,i,_159,_15a=this.objectIdField;if(_155||_156){_159=_4.filter(this.fields,function(_15b){return (_15b.editable===false)&&(!_156||(_15b.name!==_15a));});}for(i=0;i<_153.length;i++){var _15c=_153[i],_15d={},_15e=_15c.geometry,attr=_15c.attributes,_15f=_15c.symbol;if(_15e&&(!_156||this.allowGeometryUpdates)){_15d.geometry=_15e.toJson();}if(_158){_15d.attributes=attr=_4.mixin({},attr);attr[_158]=_15c.visible?1:0;}else{if(attr){_15d.attributes=_4.mixin({},attr);}}if(_15d.attributes&&_159&&_159.length){_4.forEach(_159,function(_160){delete _15d.attributes[_160.name];});}if(_15f&&(_15f!==_157)){_15d.symbol=_15f.toJson();}json.push(_15d);}return _154?json:_4.toJson(json);},_selectHandler:function(_161,_162,_163,_164,dfd){var _165,ctor=this.constructor;switch(_162){case ctor.SELECTION_NEW:this.clearSelection(true);_165=true;break;case ctor.SELECTION_ADD:_165=true;break;case ctor.SELECTION_SUBTRACT:_165=false;break;}var i,_166=_161.features,mode=this._mode,_167=[],_168=this.objectIdField,_169,oid;if(_165){for(i=0;i<_166.length;i++){_169=_166[i];oid=_169.attributes[_168];var _16a=mode._addFeatureIIf(oid,_169);_167.push(_16a);this._selectFeatureIIf(oid,_16a,mode);}}else{for(i=0;i<_166.length;i++){_169=_166[i];oid=_169.attributes[_168];this._unSelectFeatureIIf(oid,mode);var _16b=mode._removeFeatureIIf(oid);_167.push(_16b||_169);}}if(this._isSelOnly){mode._applyTimeFilter(true);}this._resolve([_167,_162,_161.exceededTransferLimit?{queryLimitExceeded:true}:null],"onSelectionComplete",_163,dfd);if(_161.exceededTransferLimit){this.onQueryLimitExceeded();}},_selectFeatureIIf:function(oid,_16c,mode){var _16d=this._selectedFeatures,_16e=_16d[oid];if(!_16e){mode._incRefCount(oid);_16d[oid]=_16c;if(!this._isTable){this._setSelectSymbol(_16c);}}return _16e||_16c;},_unSelectFeatureIIf:function(oid,mode){var _16f=this._selectedFeatures[oid];if(_16f){mode._decRefCount(oid);delete this._selectedFeatures[oid];if(!this._isTable){this._setUnSelectSymbol(_16f);}}return _16f;},_isSelected:function(_170){},_setSelectSymbol:function(_171){var _172=this._selectionSymbol;if(_172&&!this._isSelOnly){_171.setSymbol(_172);}},_setUnSelectSymbol:function(_173){var _174=this._selectionSymbol;if(_174&&!this._isSelOnly){if(_174===_173.symbol){_173.setSymbol(null,true);}}},_getOutFields:function(){var _175=_4.filter([this.objectIdField,this.typeIdField,this.creatorField,this._startTimeField,this._endTimeField,this._trackIdField].concat(this._rendererFields),function(_176,_177,arr){return !!_176&&(_4.indexOf(arr,_176)===_177);});var _178=_4.clone(this._outFields);if(_178){if(_4.indexOf(_178,"*")!==-1){return _178;}_4.forEach(_175,function(_179){if(_4.indexOf(_178,_179)===-1){_178.push(_179);}});return _178;}else{return _175;}},_checkFields:function(_17a){var _17b=_17a||this._getOutFields();_4.forEach(_17b,function(_17c){if(_17c==="*"){return;}if(!this._getField(_17c)){console.debug("esri.layers.FeatureLayer: "+esri.substitute({url:this.url,field:_17c},esri.bundle.layers.FeatureLayer.fieldNotFound));}},this);if(!_17a&&!this._isTable&&!this._fserver&&!this._collection){var _17d=_4.some(this.fields,function(_17e){return (_17e&&_17e.type==="esriFieldTypeGeometry")?true:false;});if(!_17d){console.debug("esri.layers.FeatureLayer: "+esri.substitute({url:this.url},esri.bundle.layers.FeatureLayer.noGeometryField));}}},_fixRendererFields:function(){var _17f=this.renderer;if(_17f&&this.fields.length>0){var _180=_4.filter([_17f,_17f.observationRenderer,_17f.latestObservationRenderer,_17f.trackRenderer],esri._isDefined);var _181=[];_4.forEach(_180,function(rnd){var _182,_183;_183=rnd.attributeField;if(_183){_182=!this._getField(_183)&&this._getField(_183,true);if(_182){rnd.attributeField=_182.name;}}_183=rnd.attributeField2;if(_183){_182=!this._getField(_183)&&this._getField(_183,true);if(_182){rnd.attributeField2=_182.name;}}_183=rnd.attributeField3;if(_183){_182=!this._getField(_183)&&this._getField(_183,true);if(_182){rnd.attributeField3=_182.name;}}_181.push(rnd.attributeField);_181.push(rnd.attributeField2);_181.push(rnd.attributeField3);},this);this._rendererFields=_4.filter(_181,esri._isDefined);}},_getField:function(_184,_185){var _186=this.fields;if(_186.length===0){return null;}var _187;if(_185){_184=_184.toLowerCase();}_4.some(_186,function(_188){var _189=false;if(_185){_189=(_188&&_188.name.toLowerCase()===_184)?true:false;}else{_189=(_188&&_188.name===_184)?true:false;}if(_189){_187=_188;}return _189;});return _187;},_getDateOpts:function(){if(!this._dtOpts){var _18a=_4.map(_4.filter(this.fields,function(_18b){return !!(_18b&&_18b.type==="esriFieldTypeDate");}),function(_18c){return _18c.name;});this._dtOpts={properties:_18a};}return this._dtOpts;},_applyNormalized:function(_18d,_18e){if(_18d&&_18e){_4.forEach(_18d,function(_18f,_190){if(_18f&&_18e[_190]){_18f.setGeometry(_18e[_190]);}});}},_editHandler:function(_191,adds,_192,_193,_194,dfd){var _195=_191.addResults,_196=_191.updateResults,_197=_191.deleteResults,i,_198,oid,_199,attr,_19a=this.objectIdField,mode=this._mode,_19b=this._isTable;var _19c=this.editFieldsInfo,_19d=this._getOutFields()||[],_19e=_19c&&_19c.creatorField,_19f=_19c&&_19c.creationDateField,_1a0=_19c&&_19c.editorField,_1a1=_19c&&_19c.editDateField,_1a2=_19c&&_19c.realm;if(_4.indexOf(_19d,"*")===-1){if(_19e&&_4.indexOf(_19d,_19e)===-1){_19e=null;}if(_19f&&_4.indexOf(_19d,_19f)===-1){_19f=null;}if(_1a0&&_4.indexOf(_19d,_1a0)===-1){_1a0=null;}if(_1a1&&_4.indexOf(_19d,_1a1)===-1){_1a1=null;}}var _1a3=(_19f||_1a1)?(new Date()).getTime():null,_1a4=(_19e||_1a0)?this.getUserId():undefined;if(_1a4&&_1a2){_1a4=_1a4+"@"+_1a2;}if(_195){for(i=0;i<_195.length;i++){_195[i]=new esri.layers.FeatureEditResult(_195[i]);if(_19b){continue;}_198=_195[i];if(_198.success){oid=_198.objectId;_199=adds[i];var gl=_199._graphicsLayer;if(gl&&gl!==this){gl.remove(_199);}attr=_199.attributes||{};attr[_19a]=oid;if(_19e){attr[_19e]=_1a4;}if(_1a0){attr[_1a0]=_1a4;}if(_19f){attr[_19f]=_1a3;}if(_1a1){attr[_1a1]=_1a3;}_199.setAttributes(attr);mode.drawFeature(_199);}}}if(_196){for(i=0;i<_196.length;i++){_196[i]=new esri.layers.FeatureEditResult(_196[i]);if(_19b){continue;}_198=_196[i];if(_198.success){oid=_198.objectId;_199=_192[oid];var _1a5=mode._getFeature(oid);if(_1a5){if(_1a5.geometry!==_199.geometry){_1a5.setGeometry(esri.geometry.fromJson(_199.geometry.toJson()));}this._repaint(_1a5,oid);}_199=_1a5||_199;attr=_199.attributes||{};if(_1a0){attr[_1a0]=_1a4;}if(_1a1){attr[_1a1]=_1a3;}_199.setAttributes(attr);}}}if(_197){var _1a6=[];for(i=0;i<_197.length;i++){_197[i]=new esri.layers.FeatureEditResult(_197[i]);if(_19b){continue;}_198=_197[i];if(_198.success){oid=_198.objectId;_199=mode._getFeature(oid);if(_199){if(this._unSelectFeatureIIf(oid,mode)){_1a6.push(_199);}_199._count=0;mode._removeFeatureIIf(oid);}}}if(_1a6.length>0){this.onSelectionComplete(_1a6,this.constructor.SELECTION_SUBTRACT);}}this._resolve([_195,_196,_197],"onEditsComplete",_193,dfd);},_sendAttachment:function(type,_1a7,_1a8,_1a9,_1aa){var _1ab=(type==="add")?"addAttachment":"updateAttachment",url=this._url.path+"/"+_1a7+"/"+_1ab,self=this;var dfd=esri.request({url:url,form:_1a8,content:_4.mixin(this._url.query,{f:"json",token:this._getToken()||undefined}),callbackParamName:"callback.html",handleAs:"json"}).addCallback(function(_1ac){var _1ad=(type==="add")?"addAttachmentResult":"updateAttachmentResult",_1ae=(type==="add")?"onAddAttachmentComplete":"onUpdateAttachmentComplete",_1af=new esri.layers.FeatureEditResult(_1ac[_1ad]);_1af.attachmentId=_1af.objectId;_1af.objectId=_1a7;self._resolve([_1af],_1ae,_1a9);return _1af;}).addErrback(function(_1b0){self._resolve([_1b0],null,_1aa,null,true);});return dfd;},_repaint:function(_1b1,oid,_1b2){oid=esri._isDefined(oid)?oid:_1b1.attributes[this.objectIdField];if(!(oid in this._selectedFeatures)||!this._selectionSymbol){_1b1.setSymbol(_1b1.symbol,_1b2);}},_getKind:function(_1b3){var _1b4=this._trackManager;if(_1b4){return _1b4.isLatestObservation(_1b3)?1:0;}return 0;}});_4.mixin(esri.layers.FeatureLayer,{MODE_SNAPSHOT:0,MODE_ONDEMAND:1,MODE_SELECTION:2,SELECTION_NEW:3,SELECTION_ADD:4,SELECTION_SUBTRACT:5,POPUP_NONE:"esriServerHTMLPopupTypeNone",POPUP_HTML_TEXT:"esriServerHTMLPopupTypeAsHTMLText",POPUP_URL:"esriServerHTMLPopupTypeAsURL"});esri._createWrappers("esri.layers.FeatureLayer");_4.declare("esri.layers.FeatureType",null,{constructor:function(json){if(json&&_4.isObject(json)){this.id=json.id;this.name=json.name;var _1b5=json.symbol;if(_1b5){this.symbol=esri.symbol.fromJson(_1b5);}var _1b6=json.domains,_1b7,i;var _1b8=this.domains={};for(_1b7 in _1b6){if(_1b6.hasOwnProperty(_1b7)){var _1b9=_1b6[_1b7];switch(_1b9.type){case "range":_1b8[_1b7]=new esri.layers.RangeDomain(_1b9);break;case "codedValue":_1b8[_1b7]=new esri.layers.CodedValueDomain(_1b9);break;case "inherited":_1b8[_1b7]=new esri.layers.InheritedDomain(_1b9);break;}}}var _1ba=json.templates;if(_1ba){var _1bb=this.templates=[];for(i=0;i<_1ba.length;i++){_1bb.push(new esri.layers.FeatureTemplate(_1ba[i]));}}}},toJson:function(){var json={id:this.id,name:this.name,symbol:this.symbol&&this.symbol.toJson()};var _1bc,_1bd=this.domains,_1be=this.templates,_1bf=esri._sanitize;if(_1bd){var _1c0=json.domains={};for(_1bc in _1bd){if(_1bd.hasOwnProperty(_1bc)){_1c0[_1bc]=_1bd[_1bc]&&_1bd[_1bc].toJson();}}_1bf(_1c0);}if(_1be){json.templates=_4.map(_1be,function(_1c1){return _1c1.toJson();});}return _1bf(json);}});_4.declare("esri.layers.FeatureTemplate",null,{constructor:function(json){if(json&&_4.isObject(json)){this.name=json.name;this.description=json.description;this.drawingTool=json.drawingTool;var _1c2=json.prototype;this.prototype=new esri.Graphic(_1c2.geometry,null,_1c2.attributes);}},toJson:function(){return esri._sanitize({name:this.name,description:this.description,drawingTool:this.drawingTool,prototype:this.prototype&&this.prototype.toJson()});}});_4.mixin(esri.layers.FeatureTemplate,{TOOL_AUTO_COMPLETE_POLYGON:"esriFeatureEditToolAutoCompletePolygon",TOOL_CIRCLE:"esriFeatureEditToolCircle",TOOL_ELLIPSE:"esriFeatureEditToolEllipse",TOOL_FREEHAND:"esriFeatureEditToolFreehand",TOOL_LINE:"esriFeatureEditToolLine",TOOL_NONE:"esriFeatureEditToolNone",TOOL_POINT:"esriFeatureEditToolPoint",TOOL_POLYGON:"esriFeatureEditToolPolygon",TOOL_RECTANGLE:"esriFeatureEditToolRectangle",TOOL_ARROW:"esriFeatureEditToolArrow",TOOL_TRIANGLE:"esriFeatureEditToolTriangle",TOOL_LEFT_ARROW:"esriFeatureEditToolLeftArrow",TOOL_RIGHT_ARROW:"esriFeatureEditToolRightArrow",TOOL_UP_ARROW:"esriFeatureEditToolUpArrow",TOOL_DOWN_ARROW:"esriFeatureEditToolDownArrow"});_4.declare("esri.layers.FeatureEditResult",null,{constructor:function(json){if(json&&_4.isObject(json)){this.objectId=json.objectId;this.success=json.success;if(!json.success){var err=json.error;this.error=new Error();this.error.code=err.code;this.error.message=err.description;}}}});_4.declare("esri.layers._RenderMode",null,{constructor:function(){this._prefix="jsonp_"+(_4._scopeName||"dojo")+"IoScript";},initialize:function(map){},propertyChangeHandler:function(type){},destroy:function(){},drawFeature:function(_1c3){},suspend:function(){},resume:function(){},refresh:function(){},_incRefCount:function(oid){var _1c4=this._featureMap[oid];if(_1c4){_1c4._count++;}},_decRefCount:function(oid){var _1c5=this._featureMap[oid];if(_1c5){_1c5._count--;}},_getFeature:function(oid){return this._featureMap[oid];},_addFeatureIIf:function(oid,_1c6){var fmap=this._featureMap,_1c7=fmap[oid],_1c8=this.featureLayer;if(!_1c7){fmap[oid]=_1c6;_1c8._add(_1c6);_1c6._count=0;}return _1c7||_1c6;},_removeFeatureIIf:function(oid){var _1c9=this._featureMap[oid],_1ca=this.featureLayer;if(_1c9){if(_1c9._count){return;}delete this._featureMap[oid];_1ca._remove(_1c9);}return _1c9;},_clearIIf:function(){var i,_1cb=this.featureLayer,_1cc=_1cb.graphics,_1cd=_1cb._selectedFeatures,_1ce=_1cb.objectIdField;for(i=_1cc.length-1;i>=0;i--){var _1cf=_1cc[i];var oid=_1cf.attributes[_1ce];if(oid in _1cd){_1cf._count=1;continue;}_1cf._count=0;this._removeFeatureIIf(oid);}},_isPending:function(id){var dfd=_4.io.script[this._prefix+id];return dfd?true:false;},_cancelPendingRequest:function(dfd,id){dfd=dfd||_4.io.script[this._prefix+id];if(dfd){try{dfd.cancel();_4.io.script._validCheck(dfd);}catch(e){}}},_purgeRequests:function(){_4.io.script._validCheck(null);},_toggleVisibility:function(show){var _1d0=this.featureLayer,_1d1=_1d0.graphics,_1d2=show?"show":"hide",i,len=_1d1.length;show=show&&_1d0._ager;for(i=0;i<len;i++){var _1d3=_1d1[i];_1d3[_1d2]();if(show){_1d0._repaint(_1d3);}}},_applyTimeFilter:function(_1d4){var _1d5=this.featureLayer;if(!_1d5.timeInfo||_1d5._suspended){return;}if(!_1d4){_1d5._fireUpdateStart();}var _1d6=_1d5._trackManager;if(_1d6){_1d6.clearTracks();}var defn=_1d5.getTimeDefinition(),_1d7=_1d5._getOffsettedTE(_1d5._mapTimeExtent);if(_1d7){_1d7=_1d5._getTimeOverlap(defn,_1d7);if(_1d7){var _1d8=_1d5._filterByTime(_1d5.graphics,_1d7.startTime,_1d7.endTime);if(_1d6){_1d6.addFeatures(_1d8.match);}_4.forEach(_1d8.match,function(_1d9){var _1da=_1d9._shape;if(!_1d9.visible){_1d9.show();_1da=_1d9._shape;_1da&&_1da._moveToFront();}if(_1d5._ager&&_1da){_1d5._repaint(_1d9);}});_4.forEach(_1d8.noMatch,function(_1db){if(_1db.visible){_1db.hide();}});}else{this._toggleVisibility(false);}}else{if(_1d6){_1d6.addFeatures(_1d5.graphics);}this._toggleVisibility(true);}if(_1d6){_1d6.moveLatestToFront();_1d6.drawTracks();}if(!_1d4){_1d5._fireUpdateEnd();}}});_4.declare("esri.layers._SelectionMode",[esri.layers._RenderMode],{constructor:function(_1dc){this.featureLayer=_1dc;this._featureMap={};},initialize:function(map){this.map=map;this._init=true;},propertyChangeHandler:function(type){if(this._init&&type===0){this._applyTimeFilter();}},destroy:function(){this._init=false;},resume:function(){this.propertyChangeHandler(0);}});_4.declare("esri.layers._SnapshotMode",[esri.layers._RenderMode],{constructor:function(_1dd){this.featureLayer=_1dd;this._featureMap={};this._drawFeatures=_4.hitch(this,this._drawFeatures);this._queryErrorHandler=_4.hitch(this,this._queryErrorHandler);},initialize:function(map){this.map=map;var _1de=this.featureLayer;if(_1de._collection){this._applyTimeFilter();}else{this._fetchAll();}this._init=true;},propertyChangeHandler:function(type){if(this._init){if(type){this._fetchAll();}else{this._applyTimeFilter();}}},destroy:function(){this._init=false;},drawFeature:function(_1df){var _1e0=this.featureLayer,_1e1=_1e0.objectIdField,oid=_1df.attributes[_1e1];this._addFeatureIIf(oid,_1df);this._incRefCount(oid);},resume:function(){this.propertyChangeHandler(0);},refresh:function(){var _1e2=this.featureLayer;if(_1e2._collection){_1e2._fireUpdateStart();_1e2._refresh(true);_1e2._fireUpdateEnd();}else{this._fetchAll();}},_getRequestId:function(_1e3){var id="_"+_1e3.name+_1e3.layerId+_1e3._ulid;return id.replace(/[^a-zA-Z0-9\_]+/g,"_");},_fetchAll:function(){var _1e4=this.featureLayer;if(_1e4._collection){return;}_1e4._fireUpdateStart();this._clearIIf();this._sendRequest();},_sendRequest:function(){var map=this.map,_1e5=this.featureLayer,_1e6=_1e5.getDefinitionExpression();var _1e7=new esri.tasks.Query();_1e7.outFields=_1e5._getOutFields();_1e7.where=_1e6||"1=1";_1e7.returnGeometry=true;_1e7.outSpatialReference=new esri.SpatialReference(map.spatialReference.toJson());_1e7.timeExtent=_1e5.getTimeDefinition();_1e7.maxAllowableOffset=_1e5._maxOffset;if(_1e5._ts){_1e7._ts=(new Date()).getTime();}var _1e8;if(_1e5._usePatch){_1e8=this._getRequestId(_1e5);this._cancelPendingRequest(null,_1e8);}_1e5._task.execute(_1e7,this._drawFeatures,this._queryErrorHandler,_1e8);},_drawFeatures:function(_1e9){this._purgeRequests();var _1ea=_1e9.features,_1eb=this.featureLayer,_1ec=_1eb.objectIdField,i,len=_1ea.length,_1ed,oid;for(i=0;i<len;i++){_1ed=_1ea[i];oid=_1ed.attributes[_1ec];this._addFeatureIIf(oid,_1ed);this._incRefCount(oid);}this._applyTimeFilter(true);_1eb._fireUpdateEnd(null,_1e9.exceededTransferLimit?{queryLimitExceeded:true}:null);if(_1e9.exceededTransferLimit){_1eb.onQueryLimitExceeded();}},_queryErrorHandler:function(err){this._purgeRequests();var _1ee=this.featureLayer;_1ee._errorHandler(err);_1ee._fireUpdateEnd(err);}});_4.declare("esri.layers._OnDemandMode",[esri.layers._RenderMode],{constructor:function(_1ef){this.featureLayer=_1ef;this._featureMap={};this._queryErrorHandler=_4.hitch(this,this._queryErrorHandler);},initialize:function(map){this.map=map;this._initialize();this._init=true;},propertyChangeHandler:function(type){if(this._init){if(type<2){this._zoomHandler();}}},destroy:function(){this._disableConnectors();this._init=false;},drawFeature:function(_1f0){var _1f1=this._gridLayer,geom=_1f0.geometry,_1f2=[];if(!geom){return;}_1f2=_1f1.getCellsInExtent((geom.type==="point")?{xmin:geom.x,ymin:geom.y,xmax:geom.x,ymax:geom.y}:geom.getExtent(),false).cells;var _1f3=this._cellMap,i,cell,oid=_1f0.attributes[this.featureLayer.objectIdField],_1f4,row,col;for(i=0;i<_1f2.length;i++){cell=_1f2[i];_1f4=cell.latticeID;row=cell.row;col=cell.col;if(_1f4){cell=(_1f3[_1f4]=(_1f3[_1f4]||cell));}else{_1f3[row]=_1f3[row]||{};cell=(_1f3[row][col]=(_1f3[row][col]||cell));}cell.features=cell.features||[];cell.features.push(_1f0);this._addFeatureIIf(oid,_1f0);this._incRefCount(oid);}},suspend:function(){if(!this._init){return;}this._disableConnectors();},resume:function(){if(!this._init){return;}this._enableConnectors();this._zoomHandler();},refresh:function(){this._zoomHandler();},_initialize:function(){var map=this.map,_1f5=this.featureLayer;var _1f6=_1f5._srInfo;this._gridLayer=new esri.layers._GridLayout(new esri.geometry.Point(_1f6?_1f6.valid[0]:map.extent.xmin,map.extent.ymax,map.spatialReference),{width:_1f5._tileWidth,height:_1f5._tileHeight},{width:map.width,height:map.height},_1f6);this._ioQueue=[];if(!_1f5._suspended){this._zoomHandler();this._enableConnectors();}},_enableConnectors:function(){var map=this.map;this._zoomConnect=_4.connect(map,"onZoomEnd",this,this._zoomHandler);this._panConnect=_4.connect(map,"onPanEnd",this,this._panHandler);this._resizeConnect=_4.connect(map,"onResize",this,this._panHandler);},_disableConnectors:function(){_4.disconnect(this._zoomConnect);_4.disconnect(this._panConnect);_4.disconnect(this._resizeConnect);},_zoomHandler:function(){this._processIOQueue(true);var _1f7=this.featureLayer,map=this.map;if(_1f7._suspended){return;}_1f7._fireUpdateStart();this._clearIIf();var _1f8=_1f7._trackManager;if(_1f8){_1f8.clearTracks();}this._cellMap={};this._gridLayer.setResolution(map.extent);this._sendRequest();},_panHandler:function(){this.featureLayer._fireUpdateStart();this._sendRequest(this.featureLayer._resized&&arguments[0]);},_getRequestId:function(_1f9,cell){var id="_"+_1f9.name+_1f9.layerId+_1f9._ulid+"_"+cell.resolution+"_"+(cell.latticeID||(cell.row+"_"+cell.col));return id.replace(/[^a-zA-Z0-9\_]+/g,"_");},_sendRequest:function(_1fa){this._exceeds=false;var _1fb=this.featureLayer,map=this.map,_1fc=_1fa||map.extent,_1fd=this._gridLayer.getCellsInExtent(_1fc,_1fb.latticeTiling),_1fe=_1fd.cells;if(!_1fb._editable){var _1ff=this._cellMap;_1fe=_4.filter(_1fe,function(cell){if(cell.lattice){if(_1ff[cell.latticeID]){return false;}}else{if(_1ff[cell.row]&&_1ff[cell.row][cell.col]){return false;}}return true;});}var _200=_1fb._getOutFields(),_201=_1fb.getDefinitionExpression(),time=_1fb._getOffsettedTE(_1fb._mapTimeExtent),_202=_1fb._usePatch,_203=this._ioQueue,i,self=this,func=this._drawFeatures,cell,_204,_205;this._pending=this._pending||0;for(i=0;i<_1fe.length;i++){cell=_1fe[i];_204=new esri.tasks.Query();_204.geometry=cell.extent||cell.lattice;_204.outFields=_200;_204.where=_201;if(_1fb.latticeTiling&&cell.extent){_204.spatialRelationship=esri.tasks.Query.SPATIAL_REL_CONTAINS;}_204.returnGeometry=true;_204.timeExtent=time;_204.maxAllowableOffset=_1fb._maxOffset;if(_1fb._ts){_204._ts=(new Date()).getTime();}_205=null;if(_202){_205=this._getRequestId(_1fb,cell);if(this._isPending(_205)){continue;}}this._pending++;_203.push(_1fb._task.execute(_204,function(){var _206=cell;return function(_207){func.apply(self,[_207,_206]);};}.call(this),this._queryErrorHandler,_205));}this._removeOldCells(_1fc);this._endCheck();},_drawFeatures:function(_208,cell){this._exceeds=this._exceeds||_208.exceededTransferLimit;this._finalizeIO();var _209=this.featureLayer,map=this.map,_20a=map.extent,_20b=cell.extent,row=cell.row,col=cell.col,_20c=_209.objectIdField,_20d=_208.features,_20e=this._gridLayer,_20f=this._cellMap,i,len,_210=cell.latticeID,_211=_210?_20f[_210]:(_20f[row]&&_20f[row][col]);if((cell.resolution!=_20e._resolution)||(_210?(_210!==_20e.getLatticeID(_20a)):(!_20e.intersects(_20b,_20a)))){if(_211){this._removeCell(row,col,_210);}}else{if(_211){this._updateCell(_211,_20d);}else{cell.features=_20d;if(_210){_20f[_210]=cell;}else{_20f[row]=_20f[row]||{};_20f[row][col]=cell;}len=_20d.length;for(i=0;i<len;i++){var _212=_20d[i];var oid=_212.attributes[_20c];this._addFeatureIIf(oid,_212);this._incRefCount(oid);}}}this._endCheck();},_queryErrorHandler:function(err){this._finalizeIO();this.featureLayer._errorHandler(err);this._endCheck(true);},_finalizeIO:function(){this._purgeRequests();this._pending--;},_endCheck:function(_213){if(this._pending===0){this._processIOQueue();var _214=this.featureLayer,_215=_214._trackManager;if(_215){_215.clearTracks();_215.addFeatures(_214.graphics);if(_214._ager){_4.forEach(_214.graphics,function(_216){if(_216._shape){_214._repaint(_216);}});}_215.moveLatestToFront();_215.drawTracks();}this.featureLayer._fireUpdateEnd(_213&&new Error("FeatureLayer: "+esri.bundle.layers.FeatureLayer.updateError),this._exceeds?{queryLimitExceeded:true}:null);if(this._exceeds){_214.onQueryLimitExceeded();}}},_processIOQueue:function(_217){this._ioQueue=_4.filter(this._ioQueue,function(dfd){var keep=dfd.fired>-1?false:true;return keep;});if(_217){_4.forEach(this._ioQueue,this._cancelPendingRequest);}},_removeOldCells:function(_218){var _219=this._cellMap,_21a=this._gridLayer,_21b,_21c;for(_21b in _219){if(_219[_21b]){var row=_219[_21b],_21d=row.latticeID,_21e=0,_21f=0;if(_21d){_21e++;if(_21d!==_21a.getLatticeID(_218)){this._removeCell(null,null,_21d);_21f++;}}else{for(_21c in row){if(row[_21c]){_21e++;var _220=row[_21c].extent;if(!_21a.intersects(_220,_218)){this._removeCell(_21b,_21c);_21f++;}}}}if(_21f===_21e){delete _219[_21b];}}}},_updateCell:function(cell,_221){var _222=this.featureLayer,_223=_222.objectIdField,_224=_222._selectedFeatures,i,len=_221.length;cell.features=cell.features||[];for(i=0;i<len;i++){var _225=_221[i];var oid=_225.attributes[_223];var _226=this._addFeatureIIf(oid,_225);if(_226===_225){this._incRefCount(oid);cell.features.push(_226);}else{if(!(oid in _224)){_226.setGeometry(_225.geometry);_226.setAttributes(_225.attributes);}}}},_removeCell:function(row,col,_227){var _228=this._cellMap,_229=this.featureLayer,_22a=_229.objectIdField;var cell=_227?_228[_227]:(_228[row]&&_228[row][col]);if(cell){if(_227){delete _228[_227];}else{delete _228[row][col];}var _22b=cell.features,i;for(i=0;i<_22b.length;i++){var _22c=_22b[i];var oid=_22c.attributes[_22a];this._decRefCount(oid);if(oid in _229._selectedFeatures){continue;}this._removeFeatureIIf(oid);}}}});_4.declare("esri.layers._GridLayout",null,{constructor:function(_22d,_22e,_22f,_230){this.origin=_22d;this.cellWidth=_22e.width;this.cellHeight=_22e.height;this.mapWidth=_22f.width;this.mapHeight=_22f.height;this.srInfo=_230;},setResolution:function(_231){this._resolution=(_231.xmax-_231.xmin)/this.mapWidth;if(this.srInfo){var _232=Math.round((2*this.srInfo.valid[1])/this._resolution),_233=Math.round(_232/this.cellWidth);this._frameStats=[_233,0,_233-1];}},getCellCoordinates:function(_234){var res=this._resolution,_235=this.origin;return {row:Math.floor((_235.y-_234.y)/(this.cellHeight*res)),col:Math.floor((_234.x-_235.x)/(this.cellWidth*res))};},normalize:function(col){var _236=this._frameStats;if(_236){var _237=_236[0],m180=_236[1],p180=_236[2];if(col<m180){col=col%_237;col=col<m180?col+_237:col;}else{if(col>p180){col=col%_237;}}}return col;},intersects:function(_238,_239){var _23a=this.srInfo;if(_23a){return _4.some(_239._getParts(_23a),function(_23b){return _238.intersects(_23b.extent);});}else{return _238.intersects(_239);}},getCellExtent:function(row,col){var res=this._resolution,_23c=this.origin,_23d=this.cellWidth,_23e=this.cellHeight;return new esri.geometry.Extent((col*_23d*res)+_23c.x,_23c.y-((row+1)*_23e*res),((col+1)*_23d*res)+_23c.x,_23c.y-(row*_23e*res),new esri.SpatialReference(_23c.spatialReference.toJson()));},getLatticeID:function(_23f){var _240=this.getCellCoordinates({x:_23f.xmin,y:_23f.ymax}),_241=this.getCellCoordinates({x:_23f.xmax,y:_23f.ymin}),_242=_240.row,_243=_241.row,_244=this.normalize(_240.col),_245=this.normalize(_241.col);return _242+"_"+_243+"_"+_244+"_"+_245;},sorter:function(a,b){return (a<b)?-1:1;},getCellsInExtent:function(_246,_247){var _248=this.getCellCoordinates({x:_246.xmin,y:_246.ymax}),_249=this.getCellCoordinates({x:_246.xmax,y:_246.ymin}),_24a=_248.row,_24b=_249.row,_24c=_248.col,_24d=_249.col,_24e=[],i,j,nj,_24f=[],_250=[],len,xmin,xmax,ymin,ymax,_251=[],_252,_253;for(i=_24a;i<=_24b;i++){for(j=_24c;j<=_24d;j++){nj=this.normalize(j);_246=this.getCellExtent(i,nj);_24e.push({row:i,col:nj,extent:_246,resolution:this._resolution});if(_247){_24f.push(_246.xmin,_246.xmax);_250.push(_246.ymin,_246.ymax);}}}_24c=this.normalize(_24c);_24d=this.normalize(_24d);_24f.sort(this.sorter);_250.sort(this.sorter);len=_24f.length;for(i=len-1;i>=0;i--){if(i<(len-1)){if(_24f[i]===_24f[i+1]){_24f.splice(i,1);}}}len=_250.length;for(i=len-1;i>=0;i--){if(i<(len-1)){if(_250[i]===_250[i+1]){_250.splice(i,1);}}}if(_24f.length&&_250.length){xmin=_24f[0];xmax=_24f[_24f.length-1];ymin=_250[0];ymax=_250[_250.length-1];len=_24f.length;for(i=0;i<len;i++){_251.push([[_24f[i],ymax],[_24f[i],ymin]]);}len=_250.length;for(i=0;i<len;i++){_251.push([[xmin,_250[i]],[xmax,_250[i]]]);}_252=new esri.geometry.Polyline({paths:_251,spatialReference:this.origin.spatialReference.toJson()});_253=_24a+"_"+_24b+"_"+_24c+"_"+_24d;_24e.push({latticeID:_253,lattice:_252,resolution:this._resolution});}return {minRow:_24a,maxRow:_24b,minCol:_24c,maxCol:_24d,cells:_24e};}});_4.declare("esri.layers._TrackManager",null,{constructor:function(_254){this.layer=_254;this.trackMap={};},initialize:function(map){this.map=map;var _255=this.layer,_256=_255.renderer.trackRenderer;if(_256&&(_255.geometryType==="esriGeometryPoint")){var _257=(this.container=new esri.layers._GraphicsLayer({id:_255.id+"_tracks",_child:true}));_257._setMap(map,_255._div);_257.setRenderer(_256);}},addFeatures:function(_258){var tkid,_259=this.trackMap,_25a=this.layer,_25b=_25a._trackIdField;_4.forEach(_258,function(_25c){var _25d=_25c.attributes;tkid=_25d[_25b];var ary=(_259[tkid]=(_259[tkid]||[]));ary.push(_25c);});var _25e=_25a._startTimeField,_25f=_25a.objectIdField;var _260=function(a,b){var _261=a.attributes[_25e],_262=b.attributes[_25e];if(_261===_262){return (a.attributes[_25f]<b.attributes[_25f])?-1:1;}else{return (_261<_262)?-1:1;}};for(tkid in _259){_259[tkid].sort(_260);}},drawTracks:function(){var _263=this.container;if(!_263){return;}var _264=this.trackMap,sr=this.map.spatialReference,tkid,ary,path,i,_265;for(tkid in _264){ary=_264[tkid];path=[];for(i=ary.length-1;i>=0;i--){_265=ary[i].geometry;if(_265){path.push([_265.x,_265.y]);}}if(path.length>0){_263.add(new esri.Graphic(new esri.geometry.Polyline({paths:[path],spatialReference:sr})));}}},moveLatestToFront:function(){_4.forEach(this.getLatestObservations(),function(_266){var _267=_266._shape;_267&&_267._moveToFront();this._repaint(_266,null,true);},this.layer);},getLatestObservations:function(){var _268=[];if(!this.layer.renderer.latestObservationRenderer){return _268;}var _269=this.trackMap,tkid;for(tkid in _269){var ary=_269[tkid];_268.push(ary[ary.length-1]);}return _268;},clearTracks:function(){var _26a=this.getLatestObservations();this.trackMap={};var _26b=this.container;if(_26b){_26b.clear();}_4.forEach(_26a,function(_26c){this._repaint(_26c,null,true);},this.layer);},isLatestObservation:function(_26d){var _26e=this.layer._trackIdField;var _26f=this.trackMap[_26d.attributes[_26e]];if(_26f){return (_26f[_26f.length-1]===_26d);}return false;},destroy:function(){var _270=this.container;if(_270){_270.clear();_270._unsetMap(this.map,this.layer._div);this.container=null;}this.map=null;this.layer=null;this.trackMap=null;}});}if(!_4._hasResource["esri.layers.MapImageLayer"]){_4._hasResource["esri.layers.MapImageLayer"]=true;_4.provide("esri.layers.MapImageLayer");_4.declare("esri.layers.MapImageLayer",[esri.layers.Layer],{"-chains-":{constructor:"manual"},constructor:function(_271){this.inherited(arguments,[null,_271]);this._mapImages=[];var _272=_4.hitch;this._panStart=_272(this,this._panStart);this._pan=_272(this,this._pan);this._extentChange=_272(this,this._extentChange);this._zoom=_272(this,this._zoom);this._zoomStart=_272(this,this._zoomStart);this._scale=_272(this,this._scale);this._resize=_272(this,this._resize);this.loaded=true;this.onLoad(this);},opacity:1,_transform:esri._getDOMAccessor("transform"),addImage:function(_273){var _274=this._mapImages.push(_273);_274=_274-1;_273._idx=_274;_273._layer=this;if(this._div){this._createImage(_273,_274);}},removeImage:function(_275){if(_275){var idx=_275._idx,_276=this._mapImages;if(_276[idx]===_275){delete _276[idx];var node=_275._node;if(node){this._clearEvents(node);node.e_idx=node.e_bl=node.e_tr=node.e_l=node.e_t=node.e_w=node.e_h=null;if(node.parentNode){node.parentNode.removeChild(node);_4.destroy(node);}}_275._node=_275._idx=_275._layer=null;}}},removeAllImages:function(){var _277=this._mapImages,i,len=_277.length;for(i=0;i<len;i++){var _278=_277[i];if(_278){this.removeImage(_278);}}this._mapImages=[];},getImages:function(){var _279=this._mapImages,_27a=[],i,len=_279.length;for(i=0;i<len;i++){if(_279[i]){_27a.push(_279[i]);}}return _27a;},setOpacity:function(_27b){if(this.opacity!=_27b){this.onOpacityChange(this.opacity=_27b);}},onOpacityChange:function(_27c){var div=this._div,i,len,_27d;if(div){if(!_4.isIE||_4.isIE>8){_4.style(div,"opacity",_27c);}else{_27d=div.childNodes;len=_27d.length;for(i=0;i<len;i++){_4.style(_27d[i],"opacity",_27c);}}}},_createImage:function(_27e,idx){var node=_4.create("img");_4.style(node,{position:"absolute"});if(_4.isIE<=8){_4.style(node,"opacity",this.opacity);}if(_27e.rotation){var _27f="rotate("+(360-_27e.rotation)+"deg)";if(_4.isIE<9){}else{_4.style(node,this._transform,_27f);_4.style(node,"transform",_27f);}}_27e._node=node;node.e_idx=idx;node.e_layer=this;node.e_load=_4.connect(node,"onload",esri.layers.MapImageLayer.prototype._imageLoaded);node.e_error=_4.connect(node,"onerror",esri.layers.MapImageLayer.prototype._imageError);node.e_abort=_4.connect(node,"onabort",esri.layers.MapImageLayer.prototype._imageError);node.src=_27e.href;},_imageLoaded:function(evt,img){var node=img||evt.target||evt.currentTarget,self=node.e_layer,_280=self._mapImages[node.e_idx];if(self._map&&(self._map.__zooming||self._map.__panning)){self._standby.push(node);return;}self._clearEvents(node);if(!_280||_280._node!==node){return;}if(self._map){self._attach(_280);}},_imageError:function(evt){var node=evt.target||evt.currentTarget,self=node.e_layer,_281=self._mapImages[node.e_idx];self._clearEvents(node);if(_281){_281._node=null;}},_clearEvents:function(node){var _282=_4.disconnect;_282(node.e_load);_282(node.e_error);_282(node.e_abort);node.e_load=node.e_error=node.e_abort=node.e_layer=null;},_attach:function(_283){var _284=_283.extent,_285,_286=_284.spatialReference,_287=this._sr,div=this._div,node=_283._node,_288=new esri.geometry.Point({x:_284.xmin,y:_284.ymin}),_289=new esri.geometry.Point({x:_284.xmax,y:_284.ymax});if(_287.wkid){_285=(_287._isWebMercator()&&_286._isWebMercator())||(_287.wkid===_286.wkid);}else{if(_287.wkt){_285=(_287.wkt===_286.wkt);}}if(!_285){if(_287._isWebMercator()&&_286.wkid===4326){_288=esri.geometry.geographicToWebMercator(_288);_289=esri.geometry.geographicToWebMercator(_289);}else{if(_286._isWebMercator()&&_287.wkid===4326){_288=esri.geometry.webMercatorToGeographic(_288);_289=esri.geometry.webMercatorToGeographic(_289);}}}node.e_bl=_288;node.e_tr=_289;if(_283.visible){this._setPos(node,div._left,div._top);(this._active||div).appendChild(node);}},_setPos:function(node,_28a,_28b){var _28c=node.e_bl,_28d=node.e_tr,map=this._map;_28c=map.toScreen(_28c);_28d=map.toScreen(_28d);var left=_28c.x-_28a,top=_28d.y-_28b,_28e=Math.abs(_28d.x-_28c.x),_28f=Math.abs(_28c.y-_28d.y),css={width:_28e+"px",height:_28f+"px"},_290=this._mapImages[node.e_idx];if(map.navigationMode==="css-transforms"){css[esri._css.names.transform]=esri._css.translate(left,top)+(_290.rotation?(" "+esri._css.rotate(360-_290.rotation)):"");}else{css.left=left+"px";css.top=top+"px";}_4.style(node,css);node.e_l=left;node.e_t=top;node.e_w=_28e;node.e_h=_28f;},_setMap:function(map,_291){this._map=map;this._sr=map.spatialReference;var div=this._div=_4.create("div",null,_291),_292=esri._css.names,css={position:"absolute"},vd=map.__visibleDelta;if(!_4.isIE||_4.isIE>8){css.opacity=this.opacity;}if(map.navigationMode==="css-transforms"){css[_292.transform]=esri._css.translate(vd.x,vd.y);_4.style(div,css);div._left=vd.x;div._top=vd.y;css={position:"absolute",width:map.width+"px",height:map.height+"px",overflow:"visible"};this._active=_4.create("div",null,div);_4.style(this._active,css);this._passive=_4.create("div",null,div);_4.style(this._passive,css);}else{div._left=0;div._top=0;_4.style(div,css);}this._standby=[];var _293=this._mapImages,i,len=_293.length;for(i=0;i<len;i++){var _294=_293[i],node=_294._node;if(!node){this._createImage(_294,_294._idx);}}this.onVisibilityChange(this.visible);return div;},_unsetMap:function(map,_295){this._disconnect();var div=this._div;if(div){var _296=this._mapImages,i,len=_296.length;for(i=0;i<len;i++){var _297=_296[i];if(_297){var node=_297._node;if(node){this._clearEvents(node);node.e_idx=node.e_bl=node.e_tr=node.e_l=node.e_t=node.e_w=node.e_h=null;}_297._node=null;}}_295.removeChild(div);_4.destroy(div);}this._map=this._div=this._sr=this._active=this._passive=this._standby=null;},onVisibilityChange:function(_298){var div=this._div;if(div){if(_298){this._redraw();this._connect(this._map);esri.show(div);}else{this._disconnect();esri.hide(div);}}},_connect:function(map){if(!this._connections){var _299=_4.connect,_29a=(map.navigationMode==="css-transforms");this._connections=[_299(map,"onPanStart",this._panStart),_299(map,"onPan",this._pan),_299(map,"onExtentChange",this._extentChange),_29a&&_299(map,"onZoomStart",this._zoomStart),_29a?_299(map,"onScale",this._scale):_299(map,"onZoom",this._zoom),_29a&&_299(map,"onResize",this._resize)];}},_disconnect:function(){if(this._connections){_4.forEach(this._connections,_4.disconnect);this._connections=null;}},_panStart:function(){this._panL=this._div._left;this._panT=this._div._top;},_pan:function(_29b,_29c){var div=this._div;div._left=this._panL+_29c.x;div._top=this._panT+_29c.y;if(this._map.navigationMode==="css-transforms"){_4.style(div,esri._css.names.transform,esri._css.translate(div._left,div._top));}else{_4.style(div,{left:div._left+"px",top:div._top+"px"});}},_extentChange:function(_29d,_29e,_29f){if(_29f){this._redraw(this._map.navigationMode==="css-transforms");}else{if(_29e){this._pan(_29d,_29e);}}var i,_2a0=this._standby;if(_2a0&&_2a0.length){for(i=_2a0.length-1;i>=0;i--){this._imageLoaded(null,_2a0[i]);_2a0.splice(i,1);}}},_redraw:function(_2a1){if(_2a1){var _2a2=this._passive,_2a3=esri._css.names;_4.style(_2a2,_2a3.transition,"none");this._moveImages(_2a2,this._active);_4.style(_2a2,_2a3.transform,"none");}var div=this._active||this._div,_2a4=this._div._left,_2a5=this._div._top,i,len=div.childNodes.length,node;for(i=0;i<len;i++){node=div.childNodes[i];this._setPos(node,_2a4,_2a5);}},_zoom:function(_2a6,_2a7,_2a8){var div=this._div,_2a9=div._left,_2aa=div._top,i,len=div.childNodes.length,node;for(i=0;i<len;i++){node=div.childNodes[i];var _2ab=node.e_w*_2a7,_2ac=node.e_h*_2a7,_2ad=(_2a8.x-_2a9-node.e_l)*(_2ab-node.e_w)/node.e_w,_2ae=(_2a8.y-_2aa-node.e_t)*(_2ac-node.e_h)/node.e_h;_2ad=isNaN(_2ad)?0:_2ad;_2ae=isNaN(_2ae)?0:_2ae;_4.style(node,{left:(node.e_l-_2ad)+"px",top:(node.e_t-_2ae)+"px",width:_2ab+"px",height:_2ac+"px"});}},_zoomStart:function(){this._moveImages(this._active,this._passive);},_moveImages:function(_2af,dest){var _2b0=_2af.childNodes,i,len=_2b0.length;if(len>0){for(i=len-1;i>=0;i--){dest.appendChild(_2b0[i]);}}},_scale:function(mtx,_2b1){var css={},_2b2=esri._css.names,_2b3=this._passive;_4.style(_2b3,_2b2.transition,_2b1?"none":(_2b2.transformName+" "+esri.config.defaults.map.zoomDuration+"ms ease"));css[_2b2.transform]=esri._css.matrix(mtx);_4.style(_2b3,_2b2.transform,esri._css.matrix(mtx));},_resize:function(_2b4,_2b5,_2b6){_4.style(this._active,{width:_2b5+"px",height:_2b6+"px"});_4.style(this._passive,{width:_2b5+"px",height:_2b6+"px"});}});_4.extend(esri.layers.MapImage,{visible:true,getLayer:function(){return this._layer;},getNode:function(){return this._node;},show:function(){if(!this.visible){this.visible=true;var node=this._node,_2b7=this._layer,div;if(node){div=_2b7&&_2b7._div;if(div){_2b7._setPos(node,div._left,div._top);(_2b7._active||div).appendChild(node);}esri.show(node);}}},hide:function(){if(this.visible){this.visible=false;var node=this._node;if(node){esri.hide(node);if(node.parentNode){node.parentNode.removeChild(node);}}}}});}if(!_4._hasResource["esri.PopupBase"]){_4._hasResource["esri.PopupBase"]=true;_4.provide("esri.PopupBase");_4.declare("esri.PopupBase",null,{onSetFeatures:function(){},onClearFeatures:function(){},onSelectionChange:function(){},onDfdComplete:function(){},initialize:function(){this.count=0;this.selectedIndex=-1;},cleanup:function(){this.features=this.deferreds=null;},setFeatures:function(arg){if(!arg||!arg.length){return;}this.clearFeatures();var _2b8,_2b9;if(arg[0] instanceof _4.Deferred){_2b9=arg;}else{_2b8=arg;}if(_2b8){this._updateFeatures(null,_2b8);}else{this.deferreds=_2b9;_2b9=_2b9.slice(0);_4.forEach(_2b9,function(dfd){dfd.addBoth(_4.hitch(this,this._updateFeatures,dfd));},this);}},clearFeatures:function(){this.features=this.deferreds=null;this.count=0;var _2ba=this.selectedIndex;this.selectedIndex=-1;if(_2ba>-1){this.onSelectionChange();}this.onClearFeatures();},getSelectedFeature:function(){var _2bb=this.features;if(_2bb){return _2bb[this.selectedIndex];}},select:function(_2bc){if(_2bc<0||_2bc>=this.count){return;}this.selectedIndex=_2bc;this.onSelectionChange();},enableHighlight:function(map){this._highlighted=map.graphics.add(new esri.Graphic(new esri.geometry.Point(0,0,map.spatialReference)));this._highlighted.hide();var ESYM=esri.symbol;if(!this.markerSymbol){var _2bd=(this.markerSymbol=new ESYM.SimpleMarkerSymbol());_2bd.setStyle(ESYM.SimpleMarkerSymbol.STYLE_TARGET);_2bd._setDim(16,16,7);_2bd.setOutline(new ESYM.CartographicLineSymbol(ESYM.SimpleLineSymbol.STYLE_SOLID,new _4.Color([0,255,255]),2,ESYM.CartographicLineSymbol.CAP_ROUND,ESYM.CartographicLineSymbol.JOIN_ROUND));_2bd.setColor(new _4.Color([0,0,0,0]));}if(!this.lineSymbol){this.lineSymbol=new ESYM.SimpleLineSymbol(ESYM.SimpleLineSymbol.STYLE_SOLID,new _4.Color([0,255,255]),2);}if(!this.fillSymbol){this.fillSymbol=new ESYM.SimpleFillSymbol(ESYM.SimpleFillSymbol.STYLE_NULL,new ESYM.SimpleLineSymbol(ESYM.SimpleLineSymbol.STYLE_SOLID,new _4.Color([0,255,255]),2),new _4.Color([0,0,0,0]));}},disableHighlight:function(map){var _2be=this._highlighted;if(_2be){_2be.hide();map.graphics.remove(_2be);delete this._highlighted;}this.markerSymbol=this.lineSymbol=this.fillSymbol=null;},showHighlight:function(){if(this._highlighted&&this.features&&this.features[this.selectedIndex]){this._highlighted.show();}},hideHighlight:function(){if(this._highlighted){this._highlighted.hide();}},updateHighlight:function(map,_2bf){var _2c0=_2bf.geometry,_2c1=this._highlighted;if(!_2c0||!_2c1){return;}_2c1.hide();if(!_2c1.getLayer()&&map){map.graphics.add(_2c1);}_2c1.setGeometry(esri.geometry.fromJson(_2c0.toJson()));var _2c2;switch(_2c0.type){case "point":case "multipoint":_2c2=this.markerSymbol;_2c2.setOffset(0,0);_2c2.setAngle(0);var lyr=_2bf.getLayer();if(lyr){var _2c3=lyr._getSymbol(_2bf),_2c4,_2c5,xoff=0,yoff=0,_2c6=0;if(_2c3){switch(_2c3.type){case "simplemarkersymbol":_2c4=_2c5=(_2c3.size||0);break;case "picturemarkersymbol":_2c4=(_2c3.width||0);_2c5=(_2c3.height||0);break;}xoff=_2c3.xoffset||0;yoff=_2c3.yoffset||0;_2c6=_2c3.angle||0;}if(_2c4&&_2c5){_2c2._setDim(_2c4+1,_2c5+1,7);}_2c2.setOffset(xoff,yoff);_2c2.setAngle(_2c6);}break;case "polyline":_2c2=this.lineSymbol;break;case "polygon":_2c2=this.fillSymbol;break;}_2c1.setSymbol(_2c2);},_unbind:function(dfd){var _2c7=_4.indexOf(this.deferreds,dfd);if(_2c7===-1){return;}this.deferreds.splice(_2c7,1);if(!this.deferreds.length){this.deferreds=null;return 2;}return 1;},_updateFeatures:function(dfd,_2c8){if(dfd){if(this.deferreds){var res=this._unbind(dfd);if(!res){return;}if(_2c8&&_2c8 instanceof Error){this.onDfdComplete(_2c8);if(res===2){this.onSetFeatures();}return;}if(_2c8&&_2c8.length){if(!this.features){this.features=_2c8;this.count=_2c8.length;this.selectedIndex=0;this.onDfdComplete();if(res===2){this.onSetFeatures();}this.select(0);}else{var _2c9=_4.filter(_2c8,function(_2ca){return _4.indexOf(this.features,_2ca)===-1;},this);this.features=this.features.concat(_2c9);this.count=this.features.length;this.onDfdComplete();if(res===2){this.onSetFeatures();}}}else{this.onDfdComplete();if(res===2){this.onSetFeatures();}}}}else{this.features=_2c8;this.count=_2c8.length;this.selectedIndex=0;this.onSetFeatures();this.select(0);}}});_4.declare("esri.PopupInfoTemplate",[esri.InfoTemplate],{"-chains-":{constructor:"manual"},initialize:function(json){if(!json){return;}this.info=json;this.title=this.getTitle;this.content=this.getContent;var _2cb=(this._fieldLabels={}),_2cc=(this._fieldsMap={});if(json.fieldInfos){_4.forEach(json.fieldInfos,function(_2cd){_2cb[_2cd.fieldName]=_2cd.label;_2cc[_2cd.fieldName]=_2cd;});}},toJson:function(){return _4.fromJson(_4.toJson(this.info));},getTitle:function(){},getContent:function(){},getComponents:function(_2ce){var _2cf=this.info,_2d0=_2ce.getLayer(),_2d1=_4.clone(_2ce.attributes)||{},_2d2=_4.clone(_2d1),_2d3=_2cf.fieldInfos,_2d4="",_2d5="",_2d6,_2d7,_2d8,_2d9=_2d0&&_2d0._getDateOpts&&_2d0._getDateOpts().properties,_2da={dateFormat:{properties:_2d9,formatter:"DateFormat"+this._dateFormats["shortDateShortTime"]}};if(_2d3){_4.forEach(_2d3,function(_2db){var _2dc=_2db.fieldName,val=_2d2[_2dc];_2d2[_2dc]=this._formatValue(val,_2dc,_2da);if(_2d9&&_2db.format&&_2db.format.dateFormat){var pos=_4.indexOf(_2d9,_2dc);if(pos>-1){_2d9.splice(pos,1);}}},this);}if(_2d0){var _2dd=_2d0.types,_2de=_2d0.typeIdField,_2df=_2de&&_2d1[_2de];for(_2d7 in _2d1){_2d8=_2d1[_2d7];if(esri._isDefined(_2d8)){var _2e0=this._getDomainName(_2d0,_2dd,_2df,_2d7,_2d8);if(esri._isDefined(_2e0)){_2d2[_2d7]=_2e0;}else{if(_2d7===_2de){var _2e1=this._getTypeName(_2d0,_2d8);if(esri._isDefined(_2e1)){_2d2[_2d7]=_2e1;}}}}}}if(_2cf.title){_2d4=_4.trim(esri.substitute(_2d2,this._fixTokens(_2cf.title),_2da)||"");}if(_2cf.description){_2d5=_4.trim(esri.substitute(_2d2,this._fixTokens(_2cf.description),_2da)||"");}if(_2d3){_2d6=[];_4.forEach(_2d3,function(_2e2){_2d7=_2e2.fieldName;if(_2d7&&_2e2.visible){_2d6.push([_2e2.label||_2d7,esri.substitute(_2d2,"${"+_2d7+"}",_2da)||""]);}});}var _2e3,_2e4;if(_2cf.mediaInfos){_2e3=[];_4.forEach(_2cf.mediaInfos,function(_2e5){_2e4=0;_2d8=_2e5.value;switch(_2e5.type){case "image":var url=_2d8.sourceURL;url=url&&_4.trim(esri.substitute(_2d1,this._fixTokens(url)));_2e4=!!url;break;case "piechart":case "linechart":case "columnchart":case "barchart":_2e4=_4.some(_2d8.fields,function(_2e6){return esri._isDefined(_2d1[_2e6]);});break;default:return;}if(_2e4){_2e5=_4.clone(_2e5);_2d8=_2e5.value;_2e5.title=_2e5.title?_4.trim(esri.substitute(_2d2,this._fixTokens(_2e5.title),_2da)||""):"";_2e5.caption=_2e5.caption?_4.trim(esri.substitute(_2d2,this._fixTokens(_2e5.caption),_2da)||""):"";if(_2e5.type==="image"){_2d8.sourceURL=esri.substitute(_2d1,this._fixTokens(_2d8.sourceURL));if(_2d8.linkURL){_2d8.linkURL=_4.trim(esri.substitute(_2d1,this._fixTokens(_2d8.linkURL))||"");}}else{var _2e7=_2d1[_2d8.normalizeField]||0;_2d8.fields=_4.map(_2d8.fields,function(_2e8){var data=_2d1[_2e8];data=(data===undefined)?null:data;if(data&&_2e7){data=data/_2e7;}return {y:data,tooltip:(this._fieldLabels[_2e8]||_2e8)+":<br/>"+this._formatValue(data,_2e8,_2da)};},this);}_2e3.push(_2e5);}},this);}return {title:_2d4,description:_2d5,fields:(_2d6&&_2d6.length)?_2d6:null,mediaInfos:(_2e3&&_2e3.length)?_2e3:null,formatted:_2d2,editSummary:(_2d0&&_2d0.getEditSummary)?_2d0.getEditSummary(_2ce):""};},getAttachments:function(_2e9){var _2ea=_2e9.getLayer(),_2eb=_2e9.attributes;if(this.info.showAttachments&&_2ea&&_2ea.hasAttachments&&_2ea.objectIdField){var oid=_2eb&&_2eb[_2ea.objectIdField];if(oid){return _2ea.queryAttachmentInfos(oid);}}},_dateFormats:{"shortDate":"(datePattern: 'M/d/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')","shortDateShortTime24":"(datePattern: 'M/d/y', timePattern: 'H:mm', selector: 'date and time')","longMonthYear":"(datePattern: 'MMMM y', selector: 'date')","shortMonthYear":"(datePattern: 'MMM y', selector: 'date')","year":"(datePattern: 'y', selector: 'date')"},_fixTokens:function(_2ec){return _2ec.replace(/(\{[^\{\r\n]+\})/g,"$$$1");},_formatValue:function(val,_2ed,_2ee){var _2ef=this._fieldsMap[_2ed],fmt=_2ef&&_2ef.format;if(!esri._isDefined(val)||!_2ef||!esri._isDefined(fmt)){return val;}var _2f0="",_2f1=[],_2f2=fmt.hasOwnProperty("places")||fmt.hasOwnProperty("digitSeparator"),_2f3=fmt.hasOwnProperty("digitSeparator")?fmt.digitSeparator:true;if(_2f2){_2f0="NumberFormat";_2f1.push("places: "+(esri._isDefined(fmt.places)?Number(fmt.places):"Infinity"));if(_2f1.length){_2f0+=("("+_2f1.join(",")+")");}}else{if(fmt.dateFormat){_2f0="DateFormat"+(this._dateFormats[fmt.dateFormat]||this._dateFormats["shortDateShortTime"]);}else{return val;}}var _2f4=esri.substitute({"myKey":val},"${myKey:"+_2f0+"}",_2ee)||"";if(_2f2&&!_2f3){var _2f5=_4.i18n.getLocalization("dojo.cldr","number");if(_2f5.group){_2f4=_2f4.replace(new RegExp("\\"+_2f5.group,"g"),"");}}return _2f4;},_getDomainName:function(_2f6,_2f7,_2f8,_2f9,_2fa){var _2fb,stop;if(_2f7&&esri._isDefined(_2f8)){_4.some(_2f7,function(_2fc){if(_2fc.id==_2f8){_2fb=_2fc.domains&&_2fc.domains[_2f9];if(_2fb&&_2fb.type==="inherited"){_2fb=this._getLayerDomain(_2f6,_2f9);stop=true;}return true;}return false;},this);}if(!stop&&!_2fb){_2fb=this._getLayerDomain(_2f6,_2f9);}if(_2fb&&_2fb.codedValues){var _2fd;_4.some(_2fb.codedValues,function(_2fe){if(_2fe.code==_2fa){_2fd=_2fe.name;return true;}return false;});return _2fd;}},_getLayerDomain:function(_2ff,_300){var _301=_2ff.fields;if(_301){var _302;_4.some(_301,function(_303){if(_303.name===_300){_302=_303.domain;return true;}return false;});return _302;}},_getTypeName:function(_304,id){var _305=_304.types;if(_305){var _306;_4.some(_305,function(_307){if(_307.id==id){_306=_307.name;return true;}return false;});return _306;}}});}if(!_4._hasResource["dojox.charting.scaler.common"]){_4._hasResource["dojox.charting.scaler.common"]=true;_4.provide("dojox.charting.scaler.common");(function(){var eq=function(a,b){return Math.abs(a-b)<=0.000001*(Math.abs(a)+Math.abs(b));};_4.mixin(_6.charting.scaler.common,{findString:function(val,text){val=val.toLowerCase();for(var i=0;i<text.length;++i){if(val==text[i]){return true;}}return false;},getNumericLabel:function(_308,_309,_30a){var def="";if(_4.number){def=(_30a.fixed?_4.number.format(_308,{places:_309<0?-_309:0}):_4.number.format(_308))||"";}else{def=_30a.fixed?_308.toFixed(_309<0?-_309:0):_308.toString();}if(_30a.labelFunc){var r=_30a.labelFunc(def,_308,_309);if(r){return r;}}if(_30a.labels){var l=_30a.labels,lo=0,hi=l.length;while(lo<hi){var mid=Math.floor((lo+hi)/2),val=l[mid].value;if(val<_308){lo=mid+1;}else{hi=mid;}}if(lo<l.length&&eq(l[lo].value,_308)){return l[lo].text;}--lo;if(lo>=0&&lo<l.length&&eq(l[lo].value,_308)){return l[lo].text;}lo+=2;if(lo<l.length&&eq(l[lo].value,_308)){return l[lo].text;}}return def;}});})();}if(!_4._hasResource["dojox.charting.scaler.linear"]){_4._hasResource["dojox.charting.scaler.linear"]=true;_4.provide("dojox.charting.scaler.linear");(function(){var _30b=3,dc=_6.charting,dcs=dc.scaler,dcsc=dcs.common,_30c=dcsc.findString,_30d=dcsc.getNumericLabel;var _30e=function(min,max,_30f,_310,_311,_312,span){_30f=_4.delegate(_30f);if(!_310){if(_30f.fixUpper=="major"){_30f.fixUpper="minor";}if(_30f.fixLower=="major"){_30f.fixLower="minor";}}if(!_311){if(_30f.fixUpper=="minor"){_30f.fixUpper="micro";}if(_30f.fixLower=="minor"){_30f.fixLower="micro";}}if(!_312){if(_30f.fixUpper=="micro"){_30f.fixUpper="none";}if(_30f.fixLower=="micro"){_30f.fixLower="none";}}var _313=_30c(_30f.fixLower,["major"])?Math.floor(_30f.min/_310)*_310:_30c(_30f.fixLower,["minor"])?Math.floor(_30f.min/_311)*_311:_30c(_30f.fixLower,["micro"])?Math.floor(_30f.min/_312)*_312:_30f.min,_314=_30c(_30f.fixUpper,["major"])?Math.ceil(_30f.max/_310)*_310:_30c(_30f.fixUpper,["minor"])?Math.ceil(_30f.max/_311)*_311:_30c(_30f.fixUpper,["micro"])?Math.ceil(_30f.max/_312)*_312:_30f.max;if(_30f.useMin){min=_313;}if(_30f.useMax){max=_314;}var _315=(!_310||_30f.useMin&&_30c(_30f.fixLower,["major"]))?min:Math.ceil(min/_310)*_310,_316=(!_311||_30f.useMin&&_30c(_30f.fixLower,["major","minor"]))?min:Math.ceil(min/_311)*_311,_317=(!_312||_30f.useMin&&_30c(_30f.fixLower,["major","minor","micro"]))?min:Math.ceil(min/_312)*_312,_318=!_310?0:(_30f.useMax&&_30c(_30f.fixUpper,["major"])?Math.round((max-_315)/_310):Math.floor((max-_315)/_310))+1,_319=!_311?0:(_30f.useMax&&_30c(_30f.fixUpper,["major","minor"])?Math.round((max-_316)/_311):Math.floor((max-_316)/_311))+1,_31a=!_312?0:(_30f.useMax&&_30c(_30f.fixUpper,["major","minor","micro"])?Math.round((max-_317)/_312):Math.floor((max-_317)/_312))+1,_31b=_311?Math.round(_310/_311):0,_31c=_312?Math.round(_311/_312):0,_31d=_310?Math.floor(Math.log(_310)/Math.LN10):0,_31e=_311?Math.floor(Math.log(_311)/Math.LN10):0,_31f=span/(max-min);if(!isFinite(_31f)){_31f=1;}return {bounds:{lower:_313,upper:_314,from:min,to:max,scale:_31f,span:span},major:{tick:_310,start:_315,count:_318,prec:_31d},minor:{tick:_311,start:_316,count:_319,prec:_31e},micro:{tick:_312,start:_317,count:_31a,prec:0},minorPerMajor:_31b,microPerMinor:_31c,scaler:dcs.linear};};_4.mixin(_6.charting.scaler.linear,{buildScaler:function(min,max,span,_320){var h={fixUpper:"none",fixLower:"none",natural:false};if(_320){if("fixUpper" in _320){h.fixUpper=String(_320.fixUpper);}if("fixLower" in _320){h.fixLower=String(_320.fixLower);}if("natural" in _320){h.natural=Boolean(_320.natural);}}if("min" in _320){min=_320.min;}if("max" in _320){max=_320.max;}if(_320.includeZero){if(min>0){min=0;}if(max<0){max=0;}}h.min=min;h.useMin=true;h.max=max;h.useMax=true;if("from" in _320){min=_320.from;h.useMin=false;}if("to" in _320){max=_320.to;h.useMax=false;}if(max<=min){return _30e(min,max,h,0,0,0,span);}var mag=Math.floor(Math.log(max-min)/Math.LN10),_321=_320&&("majorTickStep" in _320)?_320.majorTickStep:Math.pow(10,mag),_322=0,_323=0,_324;if(_320&&("minorTickStep" in _320)){_322=_320.minorTickStep;}else{do{_322=_321/10;if(!h.natural||_322>0.9){_324=_30e(min,max,h,_321,_322,0,span);if(_324.bounds.scale*_324.minor.tick>_30b){break;}}_322=_321/5;if(!h.natural||_322>0.9){_324=_30e(min,max,h,_321,_322,0,span);if(_324.bounds.scale*_324.minor.tick>_30b){break;}}_322=_321/2;if(!h.natural||_322>0.9){_324=_30e(min,max,h,_321,_322,0,span);if(_324.bounds.scale*_324.minor.tick>_30b){break;}}return _30e(min,max,h,_321,0,0,span);}while(false);}if(_320&&("microTickStep" in _320)){_323=_320.microTickStep;_324=_30e(min,max,h,_321,_322,_323,span);}else{do{_323=_322/10;if(!h.natural||_323>0.9){_324=_30e(min,max,h,_321,_322,_323,span);if(_324.bounds.scale*_324.micro.tick>_30b){break;}}_323=_322/5;if(!h.natural||_323>0.9){_324=_30e(min,max,h,_321,_322,_323,span);if(_324.bounds.scale*_324.micro.tick>_30b){break;}}_323=_322/2;if(!h.natural||_323>0.9){_324=_30e(min,max,h,_321,_322,_323,span);if(_324.bounds.scale*_324.micro.tick>_30b){break;}}_323=0;}while(false);}return _323?_324:_30e(min,max,h,_321,_322,0,span);},buildTicks:function(_325,_326){var step,next,tick,_327=_325.major.start,_328=_325.minor.start,_329=_325.micro.start;if(_326.microTicks&&_325.micro.tick){step=_325.micro.tick,next=_329;}else{if(_326.minorTicks&&_325.minor.tick){step=_325.minor.tick,next=_328;}else{if(_325.major.tick){step=_325.major.tick,next=_327;}else{return null;}}}var _32a=1/_325.bounds.scale;if(_325.bounds.to<=_325.bounds.from||isNaN(_32a)||!isFinite(_32a)||step<=0||isNaN(step)||!isFinite(step)){return null;}var _32b=[],_32c=[],_32d=[];while(next<=_325.bounds.to+_32a){if(Math.abs(_327-next)<step/2){tick={value:_327};if(_326.majorLabels){tick.label=_30d(_327,_325.major.prec,_326);}_32b.push(tick);_327+=_325.major.tick;_328+=_325.minor.tick;_329+=_325.micro.tick;}else{if(Math.abs(_328-next)<step/2){if(_326.minorTicks){tick={value:_328};if(_326.minorLabels&&(_325.minMinorStep<=_325.minor.tick*_325.bounds.scale)){tick.label=_30d(_328,_325.minor.prec,_326);}_32c.push(tick);}_328+=_325.minor.tick;_329+=_325.micro.tick;}else{if(_326.microTicks){_32d.push({value:_329});}_329+=_325.micro.tick;}}next+=step;}return {major:_32b,minor:_32c,micro:_32d};},getTransformerFromModel:function(_32e){var _32f=_32e.bounds.from,_330=_32e.bounds.scale;return function(x){return (x-_32f)*_330;};},getTransformerFromPlot:function(_331){var _332=_331.bounds.from,_333=_331.bounds.scale;return function(x){return x/_333+_332;};}});})();}if(!_4._hasResource["dojox.charting.axis2d.common"]){_4._hasResource["dojox.charting.axis2d.common"]=true;_4.provide("dojox.charting.axis2d.common");(function(){var g=_6.gfx;var _334=function(s){s.marginLeft="0px";s.marginTop="0px";s.marginRight="0px";s.marginBottom="0px";s.paddingLeft="0px";s.paddingTop="0px";s.paddingRight="0px";s.paddingBottom="0px";s.borderLeftWidth="0px";s.borderTopWidth="0px";s.borderRightWidth="0px";s.borderBottomWidth="0px";};var _335=function(n){if(n["getBoundingClientRect"]){var bcr=n.getBoundingClientRect();return bcr.width||(bcr.right-bcr.left);}else{return _4.marginBox(n).w;}};_4.mixin(_6.charting.axis2d.common,{createText:{gfx:function(_336,_337,x,y,_338,text,font,_339){return _337.createText({x:x,y:y,text:text,align:_338}).setFont(font).setFill(_339);},html:function(_33a,_33b,x,y,_33c,text,font,_33d,_33e){var p=_4.doc.createElement("div"),s=p.style,_33f;_334(s);s.font=font;p.innerHTML=String(text).replace(/\s/g,"&nbsp;");s.color=_33d;s.position="absolute";s.left="-10000px";_4.body().appendChild(p);var size=g.normalizedLength(g.splitFontString(font).size);if(!_33e){_33f=_335(p);}_4.body().removeChild(p);s.position="relative";if(_33e){s.width=_33e+"px";switch(_33c){case "middle":s.textAlign="center";s.left=(x-_33e/2)+"px";break;case "end":s.textAlign="right";s.left=(x-_33e)+"px";break;default:s.left=x+"px";s.textAlign="left";break;}}else{switch(_33c){case "middle":s.left=Math.floor(x-_33f/2)+"px";break;case "end":s.left=Math.floor(x-_33f)+"px";break;default:s.left=Math.floor(x)+"px";break;}}s.top=Math.floor(y-size)+"px";s.whiteSpace="nowrap";var wrap=_4.doc.createElement("div"),w=wrap.style;_334(w);w.width="0px";w.height="0px";wrap.appendChild(p);_33a.node.insertBefore(wrap,_33a.node.firstChild);return wrap;}}});})();}if(!_4._hasResource["dojox.charting.Element"]){_4._hasResource["dojox.charting.Element"]=true;_4.provide("dojox.charting.Element");_4.declare("dojox.charting.Element",null,{chart:null,group:null,htmlElements:null,dirty:true,constructor:function(_340){this.chart=_340;this.group=null;this.htmlElements=[];this.dirty=true;this.trailingSymbol="...";this._events=[];},createGroup:function(_341){if(!_341){_341=this.chart.surface;}if(!this.group){this.group=_341.createGroup();}return this;},purgeGroup:function(){this.destroyHtmlElements();if(this.group){this.group.clear();this.group.removeShape();this.group=null;}this.dirty=true;if(this._events.length){_4.forEach(this._events,function(item){item.shape.disconnect(item.handle);});this._events=[];}return this;},cleanGroup:function(_342){this.destroyHtmlElements();if(!_342){_342=this.chart.surface;}if(this.group){this.group.clear();}else{this.group=_342.createGroup();}this.dirty=true;return this;},destroyHtmlElements:function(){if(this.htmlElements.length){_4.forEach(this.htmlElements,_4.destroy);this.htmlElements=[];}},destroy:function(){this.purgeGroup();},getTextWidth:function(s,font){return _6.gfx._base._getTextBox(s,{font:font}).w||0;},getTextWithLimitLength:function(s,font,_343,_344){if(!s||s.length<=0){return {text:"",truncated:_344||false};}if(!_343||_343<=0){return {text:s,truncated:_344||false};}var _345=2,_346=0.618,_347=s.substring(0,1)+this.trailingSymbol,_348=this.getTextWidth(_347,font);if(_343<=_348){return {text:_347,truncated:true};}var _349=this.getTextWidth(s,font);if(_349<=_343){return {text:s,truncated:_344||false};}else{var _34a=0,end=s.length;while(_34a<end){if(end-_34a<=_345){while(this.getTextWidth(s.substring(0,_34a)+this.trailingSymbol,font)>_343){_34a-=1;}return {text:(s.substring(0,_34a)+this.trailingSymbol),truncated:true};}var _34b=_34a+Math.round((end-_34a)*_346),_34c=this.getTextWidth(s.substring(0,_34b),font);if(_34c<_343){_34a=_34b;end=end;}else{_34a=_34a;end=_34b;}}}},getTextWithLimitCharCount:function(s,font,_34d,_34e){if(!s||s.length<=0){return {text:"",truncated:_34e||false};}if(!_34d||_34d<=0||s.length<=_34d){return {text:s,truncated:_34e||false};}return {text:s.substring(0,_34d)+this.trailingSymbol,truncated:true};},_plotFill:function(fill,dim,_34f){if(!fill||!fill.type||!fill.space){return fill;}var _350=fill.space;switch(fill.type){case "linear":if(_350==="plot"||_350==="shapeX"||_350==="shapeY"){fill=_6.gfx.makeParameters(_6.gfx.defaultLinearGradient,fill);fill.space=_350;if(_350==="plot"||_350==="shapeX"){var span=dim.height-_34f.t-_34f.b;fill.y1=_34f.t+span*fill.y1/100;fill.y2=_34f.t+span*fill.y2/100;}if(_350==="plot"||_350==="shapeY"){var span=dim.width-_34f.l-_34f.r;fill.x1=_34f.l+span*fill.x1/100;fill.x2=_34f.l+span*fill.x2/100;}}break;case "radial":if(_350==="plot"){fill=_6.gfx.makeParameters(_6.gfx.defaultRadialGradient,fill);fill.space=_350;var _351=dim.width-_34f.l-_34f.r,_352=dim.height-_34f.t-_34f.b;fill.cx=_34f.l+_351*fill.cx/100;fill.cy=_34f.t+_352*fill.cy/100;fill.r=fill.r*Math.sqrt(_351*_351+_352*_352)/200;}break;case "pattern":if(_350==="plot"||_350==="shapeX"||_350==="shapeY"){fill=_6.gfx.makeParameters(_6.gfx.defaultPattern,fill);fill.space=_350;if(_350==="plot"||_350==="shapeX"){var span=dim.height-_34f.t-_34f.b;fill.y=_34f.t+span*fill.y/100;fill.height=span*fill.height/100;}if(_350==="plot"||_350==="shapeY"){var span=dim.width-_34f.l-_34f.r;fill.x=_34f.l+span*fill.x/100;fill.width=span*fill.width/100;}}break;}return fill;},_shapeFill:function(fill,bbox){if(!fill||!fill.space){return fill;}var _353=fill.space;switch(fill.type){case "linear":if(_353==="shape"||_353==="shapeX"||_353==="shapeY"){fill=_6.gfx.makeParameters(_6.gfx.defaultLinearGradient,fill);fill.space=_353;if(_353==="shape"||_353==="shapeX"){var span=bbox.width;fill.x1=bbox.x+span*fill.x1/100;fill.x2=bbox.x+span*fill.x2/100;}if(_353==="shape"||_353==="shapeY"){var span=bbox.height;fill.y1=bbox.y+span*fill.y1/100;fill.y2=bbox.y+span*fill.y2/100;}}break;case "radial":if(_353==="shape"){fill=_6.gfx.makeParameters(_6.gfx.defaultRadialGradient,fill);fill.space=_353;fill.cx=bbox.x+bbox.width/2;fill.cy=bbox.y+bbox.height/2;fill.r=fill.r*bbox.width/200;}break;case "pattern":if(_353==="shape"||_353==="shapeX"||_353==="shapeY"){fill=_6.gfx.makeParameters(_6.gfx.defaultPattern,fill);fill.space=_353;if(_353==="shape"||_353==="shapeX"){var span=bbox.width;fill.x=bbox.x+span*fill.x/100;fill.width=span*fill.width/100;}if(_353==="shape"||_353==="shapeY"){var span=bbox.height;fill.y=bbox.y+span*fill.y/100;fill.height=span*fill.height/100;}}break;}return fill;},_pseudoRadialFill:function(fill,_354,_355,_356,end){if(!fill||fill.type!=="radial"||fill.space!=="shape"){return fill;}var _357=fill.space;fill=_6.gfx.makeParameters(_6.gfx.defaultRadialGradient,fill);fill.space=_357;if(arguments.length<4){fill.cx=_354.x;fill.cy=_354.y;fill.r=fill.r*_355/100;return fill;}var _358=arguments.length<5?_356:(end+_356)/2;return {type:"linear",x1:_354.x,y1:_354.y,x2:_354.x+fill.r*_355*Math.cos(_358)/100,y2:_354.y+fill.r*_355*Math.sin(_358)/100,colors:fill.colors};return fill;}});}if(!_4._hasResource["dojox.charting.axis2d.Base"]){_4._hasResource["dojox.charting.axis2d.Base"]=true;_4.provide("dojox.charting.axis2d.Base");_4.declare("dojox.charting.axis2d.Base",_6.charting.Element,{constructor:function(_359,_35a){this.vertical=_35a&&_35a.vertical;},clear:function(){return this;},initialized:function(){return false;},calculate:function(min,max,span){return this;},getScaler:function(){return null;},getTicks:function(){return null;},getOffsets:function(){return {l:0,r:0,t:0,b:0};},render:function(dim,_35b){this.dirty=false;return this;}});}if(!_4._hasResource["dojox.lang.functional.lambda"]){_4._hasResource["dojox.lang.functional.lambda"]=true;_4.provide("dojox.lang.functional.lambda");(function(){var df=_6.lang.functional,_35c={};var _35d="ab".split(/a*/).length>1?String.prototype.split:function(sep){var r=this.split.call(this,sep),m=sep.exec(this);if(m&&m.index==0){r.unshift("");}return r;};var _35e=function(s){var args=[],_35f=_35d.call(s,/\s*->\s*/m);if(_35f.length>1){while(_35f.length){s=_35f.pop();args=_35f.pop().split(/\s*,\s*|\s+/m);if(_35f.length){_35f.push("(function("+args+"){return ("+s+")})");}}}else{if(s.match(/\b_\b/)){args=["_"];}else{var l=s.match(/^\s*(?:[+*\/%&|\^\.=<>]|!=)/m),r=s.match(/[+\-*\/%&|\^\.=<>!]\s*$/m);if(l||r){if(l){args.push("$1");s="$1"+s;}if(r){args.push("$2");s=s+"$2";}}else{var vars=s.replace(/(?:\b[A-Z]|\.[a-zA-Z_$])[a-zA-Z_$\d]*|[a-zA-Z_$][a-zA-Z_$\d]*:|this|true|false|null|undefined|typeof|instanceof|in|delete|new|void|arguments|decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|escape|eval|isFinite|isNaN|parseFloat|parseInt|unescape|dojo|dijit|dojox|window|document|'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"/g,"").match(/([a-z_$][a-z_$\d]*)/gi)||[],t={};_4.forEach(vars,function(v){if(!(v in t)){args.push(v);t[v]=1;}});}}}return {args:args,body:s};};var _360=function(a){return a.length?function(){var i=a.length-1,x=df.lambda(a[i]).apply(this,arguments);for(--i;i>=0;--i){x=df.lambda(a[i]).call(this,x);}return x;}:function(x){return x;};};_4.mixin(df,{rawLambda:function(s){return _35e(s);},buildLambda:function(s){s=_35e(s);return "function("+s.args.join(",")+"){return ("+s.body+");}";},lambda:function(s){if(typeof s=="function"){return s;}if(s instanceof Array){return _360(s);}if(s in _35c){return _35c[s];}s=_35e(s);return _35c[s]=new Function(s.args,"return ("+s.body+");");},clearLambdaCache:function(){_35c={};}});})();}if(!_4._hasResource["dojox.lang.functional.array"]){_4._hasResource["dojox.lang.functional.array"]=true;_4.provide("dojox.lang.functional.array");(function(){var d=_4,df=_6.lang.functional,_361={};d.mixin(df,{filter:function(a,f,o){if(typeof a=="string"){a=a.split("");}o=o||d.global;f=df.lambda(f);var t=[],v,i,n;if(d.isArray(a)){for(i=0,n=a.length;i<n;++i){v=a[i];if(f.call(o,v,i,a)){t.push(v);}}}else{if(typeof a.hasNext=="function"&&typeof a.next=="function"){for(i=0;a.hasNext();){v=a.next();if(f.call(o,v,i++,a)){t.push(v);}}}else{for(i in a){if(!(i in _361)){v=a[i];if(f.call(o,v,i,a)){t.push(v);}}}}}return t;},forEach:function(a,f,o){if(typeof a=="string"){a=a.split("");}o=o||d.global;f=df.lambda(f);var i,n;if(d.isArray(a)){for(i=0,n=a.length;i<n;f.call(o,a[i],i,a),++i){}}else{if(typeof a.hasNext=="function"&&typeof a.next=="function"){for(i=0;a.hasNext();f.call(o,a.next(),i++,a)){}}else{for(i in a){if(!(i in _361)){f.call(o,a[i],i,a);}}}}return o;},map:function(a,f,o){if(typeof a=="string"){a=a.split("");}o=o||d.global;f=df.lambda(f);var t,n,i;if(d.isArray(a)){t=new Array(n=a.length);for(i=0;i<n;t[i]=f.call(o,a[i],i,a),++i){}}else{if(typeof a.hasNext=="function"&&typeof a.next=="function"){t=[];for(i=0;a.hasNext();t.push(f.call(o,a.next(),i++,a))){}}else{t=[];for(i in a){if(!(i in _361)){t.push(f.call(o,a[i],i,a));}}}}return t;},every:function(a,f,o){if(typeof a=="string"){a=a.split("");}o=o||d.global;f=df.lambda(f);var i,n;if(d.isArray(a)){for(i=0,n=a.length;i<n;++i){if(!f.call(o,a[i],i,a)){return false;}}}else{if(typeof a.hasNext=="function"&&typeof a.next=="function"){for(i=0;a.hasNext();){if(!f.call(o,a.next(),i++,a)){return false;}}}else{for(i in a){if(!(i in _361)){if(!f.call(o,a[i],i,a)){return false;}}}}}return true;},some:function(a,f,o){if(typeof a=="string"){a=a.split("");}o=o||d.global;f=df.lambda(f);var i,n;if(d.isArray(a)){for(i=0,n=a.length;i<n;++i){if(f.call(o,a[i],i,a)){return true;}}}else{if(typeof a.hasNext=="function"&&typeof a.next=="function"){for(i=0;a.hasNext();){if(f.call(o,a.next(),i++,a)){return true;}}}else{for(i in a){if(!(i in _361)){if(f.call(o,a[i],i,a)){return true;}}}}}return false;}});})();}if(!_4._hasResource["dojox.lang.functional.object"]){_4._hasResource["dojox.lang.functional.object"]=true;_4.provide("dojox.lang.functional.object");(function(){var d=_4,df=_6.lang.functional,_362={};d.mixin(df,{keys:function(obj){var t=[];for(var i in obj){if(!(i in _362)){t.push(i);}}return t;},values:function(obj){var t=[];for(var i in obj){if(!(i in _362)){t.push(obj[i]);}}return t;},filterIn:function(obj,f,o){o=o||d.global;f=df.lambda(f);var t={},v,i;for(i in obj){if(!(i in _362)){v=obj[i];if(f.call(o,v,i,obj)){t[i]=v;}}}return t;},forIn:function(obj,f,o){o=o||d.global;f=df.lambda(f);for(var i in obj){if(!(i in _362)){f.call(o,obj[i],i,obj);}}return o;},mapIn:function(obj,f,o){o=o||d.global;f=df.lambda(f);var t={},i;for(i in obj){if(!(i in _362)){t[i]=f.call(o,obj[i],i,obj);}}return t;}});})();}if(!_4._hasResource["dojox.lang.functional"]){_4._hasResource["dojox.lang.functional"]=true;_4.provide("dojox.lang.functional");}if(!_4._hasResource["dojox.lang.utils"]){_4._hasResource["dojox.lang.utils"]=true;_4.provide("dojox.lang.utils");(function(){var _363={},du=_6.lang.utils,opts=Object.prototype.toString;var _364=function(o){if(o){switch(opts.call(o)){case "[object Array]":return o.slice(0);case "[object Object]":return _4.delegate(o);}}return o;};_4.mixin(du,{coerceType:function(_365,_366){switch(typeof _365){case "number":return Number(eval("("+_366+")"));case "string":return String(_366);case "boolean":return Boolean(eval("("+_366+")"));}return eval("("+_366+")");},updateWithObject:function(_367,_368,conv){if(!_368){return _367;}for(var x in _367){if(x in _368&&!(x in _363)){var t=_367[x];if(t&&typeof t=="object"){du.updateWithObject(t,_368[x],conv);}else{_367[x]=conv?du.coerceType(t,_368[x]):_364(_368[x]);}}}return _367;},updateWithPattern:function(_369,_36a,_36b,conv){if(!_36a||!_36b){return _369;}for(var x in _36b){if(x in _36a&&!(x in _363)){_369[x]=conv?du.coerceType(_36b[x],_36a[x]):_364(_36a[x]);}}return _369;},merge:function(_36c,_36d){if(_36d){var _36e=opts.call(_36c),_36f=opts.call(_36d),t,i,l,m;switch(_36f){case "[object Array]":if(_36f==_36e){t=new Array(Math.max(_36c.length,_36d.length));for(i=0,l=t.length;i<l;++i){t[i]=du.merge(_36c[i],_36d[i]);}return t;}return _36d.slice(0);case "[object Object]":if(_36f==_36e&&_36c){t=_4.delegate(_36c);for(i in _36d){if(i in _36c){l=_36c[i];m=_36d[i];if(m!==l){t[i]=du.merge(l,m);}}else{t[i]=_4.clone(_36d[i]);}}return t;}return _4.clone(_36d);}}return _36d;}});})();}if(!_4._hasResource["dojox.charting.axis2d.Invisible"]){_4._hasResource["dojox.charting.axis2d.Invisible"]=true;_4.provide("dojox.charting.axis2d.Invisible");(function(){var dc=_6.charting,df=_6.lang.functional,du=_6.lang.utils,g=_6.gfx,lin=dc.scaler.linear,_370=du.merge,_371=4,_372=45;_4.declare("dojox.charting.axis2d.Invisible",_6.charting.axis2d.Base,{defaultParams:{vertical:false,fixUpper:"none",fixLower:"none",natural:false,leftBottom:true,includeZero:false,fixed:true,majorLabels:true,minorTicks:true,minorLabels:true,microTicks:false,rotation:0},optionalParams:{min:0,max:1,from:0,to:1,majorTickStep:4,minorTickStep:2,microTickStep:1,labels:[],labelFunc:null,maxLabelSize:0,maxLabelCharCount:0,trailingSymbol:null},constructor:function(_373,_374){this.opt=_4.clone(this.defaultParams);du.updateWithObject(this.opt,_374);du.updateWithPattern(this.opt,_374,this.optionalParams);},dependOnData:function(){return !("min" in this.opt)||!("max" in this.opt);},clear:function(){delete this.scaler;delete this.ticks;this.dirty=true;return this;},initialized:function(){return "scaler" in this&&!(this.dirty&&this.dependOnData());},setWindow:function(_375,_376){this.scale=_375;this.offset=_376;return this.clear();},getWindowScale:function(){return "scale" in this?this.scale:1;},getWindowOffset:function(){return "offset" in this?this.offset:0;},_groupLabelWidth:function(_377,font,_378){if(!_377.length){return 0;}if(_4.isObject(_377[0])){_377=df.map(_377,function(_379){return _379.text;});}if(_378){_377=df.map(_377,function(_37a){return _4.trim(_37a).length==0?"":_37a.substring(0,_378)+this.trailingSymbol;},this);}var s=_377.join("<br>");return _6.gfx._base._getTextBox(s,{font:font}).w||0;},calculate:function(min,max,span,_37b){if(this.initialized()){return this;}var o=this.opt;this.labels="labels" in o?o.labels:_37b;this.scaler=lin.buildScaler(min,max,span,o);var tsb=this.scaler.bounds;if("scale" in this){o.from=tsb.lower+this.offset;o.to=(tsb.upper-tsb.lower)/this.scale+o.from;if(!isFinite(o.from)||isNaN(o.from)||!isFinite(o.to)||isNaN(o.to)||o.to-o.from>=tsb.upper-tsb.lower){delete o.from;delete o.to;delete this.scale;delete this.offset;}else{if(o.from<tsb.lower){o.to+=tsb.lower-o.from;o.from=tsb.lower;}else{if(o.to>tsb.upper){o.from+=tsb.upper-o.to;o.to=tsb.upper;}}this.offset=o.from-tsb.lower;}this.scaler=lin.buildScaler(min,max,span,o);tsb=this.scaler.bounds;if(this.scale==1&&this.offset==0){delete this.scale;delete this.offset;}}var ta=this.chart.theme.axis,_37c=0,_37d=o.rotation%360,_37e=o.font||(ta.majorTick&&ta.majorTick.font)||(ta.tick&&ta.tick.font),size=_37e?g.normalizedLength(g.splitFontString(_37e).size):0,cosr=Math.abs(Math.cos(_37d*Math.PI/180)),sinr=Math.abs(Math.sin(_37d*Math.PI/180));if(_37d<0){_37d+=360;}if(size){if(this.vertical?_37d!=0&&_37d!=180:_37d!=90&&_37d!=270){if(this.labels){_37c=this._groupLabelWidth(this.labels,_37e,o.maxLabelCharCount);}else{var _37f=Math.ceil(Math.log(Math.max(Math.abs(tsb.from),Math.abs(tsb.to)))/Math.LN10),t=[];if(tsb.from<0||tsb.to<0){t.push("-");}t.push(_4.string.rep("9",_37f));var _380=Math.floor(Math.log(tsb.to-tsb.from)/Math.LN10);if(_380>0){t.push(".");t.push(_4.string.rep("9",_380));}_37c=_6.gfx._base._getTextBox(t.join(""),{font:_37e}).w;}_37c=o.maxLabelSize?Math.min(o.maxLabelSize,_37c):_37c;}else{_37c=size;}switch(_37d){case 0:case 90:case 180:case 270:break;default:var gap1=Math.sqrt(_37c*_37c+size*size),gap2=this.vertical?size*cosr+_37c*sinr:_37c*cosr+size*sinr;_37c=Math.min(gap1,gap2);break;}}this.scaler.minMinorStep=_37c+_371;this.ticks=lin.buildTicks(this.scaler,o);return this;},getScaler:function(){return this.scaler;},getTicks:function(){return this.ticks;}});})();}if(!_4._hasResource["dojo.colors"]){_4._hasResource["dojo.colors"]=true;_4.provide("dojo.colors");_4.getObject("colors",true,_4);(function(){var _381=function(m1,m2,h){if(h<0){++h;}if(h>1){--h;}var h6=6*h;if(h6<1){return m1+(m2-m1)*h6;}if(2*h<1){return m2;}if(3*h<2){return m1+(m2-m1)*(2/3-h)*6;}return m1;};_4.colorFromRgb=function(_382,obj){var m=_382.toLowerCase().match(/^(rgba?|hsla?)\(([\s\.\-,%0-9]+)\)/);if(m){var c=m[2].split(/\s*,\s*/),l=c.length,t=m[1],a;if((t=="rgb"&&l==3)||(t=="rgba"&&l==4)){var r=c[0];if(r.charAt(r.length-1)=="%"){a=_4.map(c,function(x){return parseFloat(x)*2.56;});if(l==4){a[3]=c[3];}return _4.colorFromArray(a,obj);}return _4.colorFromArray(c,obj);}if((t=="hsl"&&l==3)||(t=="hsla"&&l==4)){var H=((parseFloat(c[0])%360)+360)%360/360,S=parseFloat(c[1])/100,L=parseFloat(c[2])/100,m2=L<=0.5?L*(S+1):L+S-L*S,m1=2*L-m2;a=[_381(m1,m2,H+1/3)*256,_381(m1,m2,H)*256,_381(m1,m2,H-1/3)*256,1];if(l==4){a[3]=c[3];}return _4.colorFromArray(a,obj);}}return null;};var _383=function(c,low,high){c=Number(c);return isNaN(c)?high:c<low?low:c>high?high:c;};_4.Color.prototype.sanitize=function(){var t=this;t.r=Math.round(_383(t.r,0,255));t.g=Math.round(_383(t.g,0,255));t.b=Math.round(_383(t.b,0,255));t.a=_383(t.a,0,1);return this;};})();_4.colors.makeGrey=function(g,a){return _4.colorFromArray([g,g,g,a]);};_4.mixin(_4.Color.named,{aliceblue:[240,248,255],antiquewhite:[250,235,215],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],blanchedalmond:[255,235,205],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],oldlace:[253,245,230],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],thistle:[216,191,216],tomato:[255,99,71],transparent:[0,0,0,0],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],whitesmoke:[245,245,245],yellowgreen:[154,205,50]});}if(!_4._hasResource["dojox.charting.axis2d.Default"]){_4._hasResource["dojox.charting.axis2d.Default"]=true;_4.provide("dojox.charting.axis2d.Default");(function(){var dc=_6.charting,du=_6.lang.utils,g=_6.gfx,lin=dc.scaler.linear,_384=4,_385=45;_4.declare("dojox.charting.axis2d.Default",_6.charting.axis2d.Invisible,{defaultParams:{vertical:false,fixUpper:"none",fixLower:"none",natural:false,leftBottom:true,includeZero:false,fixed:true,majorLabels:true,minorTicks:true,minorLabels:true,microTicks:false,rotation:0,htmlLabels:true},optionalParams:{min:0,max:1,from:0,to:1,majorTickStep:4,minorTickStep:2,microTickStep:1,labels:[],labelFunc:null,maxLabelSize:0,maxLabelCharCount:0,trailingSymbol:null,stroke:{},majorTick:{},minorTick:{},microTick:{},tick:{},font:"",fontColor:"",title:"",titleGap:0,titleFont:"",titleFontColor:"",titleOrientation:""},constructor:function(_386,_387){this.opt=_4.clone(this.defaultParams);du.updateWithObject(this.opt,_387);du.updateWithPattern(this.opt,_387,this.optionalParams);},getOffsets:function(){var s=this.scaler,_388={l:0,r:0,t:0,b:0};if(!s){return _388;}var o=this.opt,_389=0,a,b,c,d,gl=dc.scaler.common.getNumericLabel,_38a=0,ma=s.major,mi=s.minor,ta=this.chart.theme.axis,_38b=o.font||(ta.majorTick&&ta.majorTick.font)||(ta.tick&&ta.tick.font),_38c=o.titleFont||(ta.tick&&ta.tick.titleFont),_38d=(o.titleGap==0)?0:o.titleGap||(ta.tick&&ta.tick.titleGap)||15,_38e=this.chart.theme.getTick("major",o),_38f=this.chart.theme.getTick("minor",o),size=_38b?g.normalizedLength(g.splitFontString(_38b).size):0,_390=_38c?g.normalizedLength(g.splitFontString(_38c).size):0,_391=o.rotation%360,_392=o.leftBottom,cosr=Math.abs(Math.cos(_391*Math.PI/180)),sinr=Math.abs(Math.sin(_391*Math.PI/180));this.trailingSymbol=(o.trailingSymbol===undefined||o.trailingSymbol===null)?this.trailingSymbol:o.trailingSymbol;if(_391<0){_391+=360;}if(size){if(this.labels){_389=this._groupLabelWidth(this.labels,_38b,o.maxLabelCharCount);}else{_389=this._groupLabelWidth([gl(ma.start,ma.prec,o),gl(ma.start+ma.count*ma.tick,ma.prec,o),gl(mi.start,mi.prec,o),gl(mi.start+mi.count*mi.tick,mi.prec,o)],_38b,o.maxLabelCharCount);}_389=o.maxLabelSize?Math.min(o.maxLabelSize,_389):_389;if(this.vertical){var side=_392?"l":"r";switch(_391){case 0:case 180:_388[side]=_389;_388.t=_388.b=size/2;break;case 90:case 270:_388[side]=size;_388.t=_388.b=_389/2;break;default:if(_391<=_385||(180<_391&&_391<=(180+_385))){_388[side]=size*sinr/2+_389*cosr;_388[_392?"t":"b"]=size*cosr/2+_389*sinr;_388[_392?"b":"t"]=size*cosr/2;}else{if(_391>(360-_385)||(180>_391&&_391>(180-_385))){_388[side]=size*sinr/2+_389*cosr;_388[_392?"b":"t"]=size*cosr/2+_389*sinr;_388[_392?"t":"b"]=size*cosr/2;}else{if(_391<90||(180<_391&&_391<270)){_388[side]=size*sinr+_389*cosr;_388[_392?"t":"b"]=size*cosr+_389*sinr;}else{_388[side]=size*sinr+_389*cosr;_388[_392?"b":"t"]=size*cosr+_389*sinr;}}}break;}_388[side]+=_384+Math.max(_38e.length,_38f.length)+(o.title?(_390+_38d):0);}else{var side=_392?"b":"t";switch(_391){case 0:case 180:_388[side]=size;_388.l=_388.r=_389/2;break;case 90:case 270:_388[side]=_389;_388.l=_388.r=size/2;break;default:if((90-_385)<=_391&&_391<=90||(270-_385)<=_391&&_391<=270){_388[side]=size*sinr/2+_389*cosr;_388[_392?"r":"l"]=size*cosr/2+_389*sinr;_388[_392?"l":"r"]=size*cosr/2;}else{if(90<=_391&&_391<=(90+_385)||270<=_391&&_391<=(270+_385)){_388[side]=size*sinr/2+_389*cosr;_388[_392?"l":"r"]=size*cosr/2+_389*sinr;_388[_392?"r":"l"]=size*cosr/2;}else{if(_391<_385||(180<_391&&_391<(180-_385))){_388[side]=size*sinr+_389*cosr;_388[_392?"r":"l"]=size*cosr+_389*sinr;}else{_388[side]=size*sinr+_389*cosr;_388[_392?"l":"r"]=size*cosr+_389*sinr;}}}break;}_388[side]+=_384+Math.max(_38e.length,_38f.length)+(o.title?(_390+_38d):0);}}if(_389){this._cachedLabelWidth=_389;}return _388;},render:function(dim,_393){if(!this.dirty){return this;}var o=this.opt,ta=this.chart.theme.axis,_394=o.leftBottom,_395=o.rotation%360,_396,stop,_397,_398=0,_399,_39a,_39b,_39c,_39d,_39e,_39f=o.font||(ta.majorTick&&ta.majorTick.font)||(ta.tick&&ta.tick.font),_3a0=o.titleFont||(ta.tick&&ta.tick.titleFont),_3a1=o.fontColor||(ta.majorTick&&ta.majorTick.fontColor)||(ta.tick&&ta.tick.fontColor)||"black",_3a2=o.titleFontColor||(ta.tick&&ta.tick.titleFontColor)||"black",_3a3=(o.titleGap==0)?0:o.titleGap||(ta.tick&&ta.tick.titleGap)||15,_3a4=o.titleOrientation||(ta.tick&&ta.tick.titleOrientation)||"axis",_3a5=this.chart.theme.getTick("major",o),_3a6=this.chart.theme.getTick("minor",o),_3a7=this.chart.theme.getTick("micro",o),_3a8=Math.max(_3a5.length,_3a6.length,_3a7.length),_3a9="stroke" in o?o.stroke:ta.stroke,size=_39f?g.normalizedLength(g.splitFontString(_39f).size):0,cosr=Math.abs(Math.cos(_395*Math.PI/180)),sinr=Math.abs(Math.sin(_395*Math.PI/180)),_3aa=_3a0?g.normalizedLength(g.splitFontString(_3a0).size):0;if(_395<0){_395+=360;}if(this.vertical){_396={y:dim.height-_393.b};stop={y:_393.t};_397={y:(dim.height-_393.b+_393.t)/2};_399=size*sinr+(this._cachedLabelWidth||0)*cosr+_384+Math.max(_3a5.length,_3a6.length)+_3aa+_3a3;_39a={x:0,y:-1};_39d={x:0,y:0};_39b={x:1,y:0};_39c={x:_384,y:0};switch(_395){case 0:_39e="end";_39d.y=size*0.4;break;case 90:_39e="middle";_39d.x=-size;break;case 180:_39e="start";_39d.y=-size*0.4;break;case 270:_39e="middle";break;default:if(_395<_385){_39e="end";_39d.y=size*0.4;}else{if(_395<90){_39e="end";_39d.y=size*0.4;}else{if(_395<(180-_385)){_39e="start";}else{if(_395<(180+_385)){_39e="start";_39d.y=-size*0.4;}else{if(_395<270){_39e="start";_39d.x=_394?0:size*0.4;}else{if(_395<(360-_385)){_39e="end";_39d.x=_394?0:size*0.4;}else{_39e="end";_39d.y=size*0.4;}}}}}}}if(_394){_396.x=stop.x=_393.l;_398=(_3a4&&_3a4=="away")?90:270;_397.x=_393.l-_399+(_398==270?_3aa:0);_39b.x=-1;_39c.x=-_39c.x;}else{_396.x=stop.x=dim.width-_393.r;_398=(_3a4&&_3a4=="axis")?90:270;_397.x=dim.width-_393.r+_399-(_398==270?0:_3aa);switch(_39e){case "start":_39e="end";break;case "end":_39e="start";break;case "middle":_39d.x+=size;break;}}}else{_396={x:_393.l};stop={x:dim.width-_393.r};_397={x:(dim.width-_393.r+_393.l)/2};_399=size*cosr+(this._cachedLabelWidth||0)*sinr+_384+Math.max(_3a5.length,_3a6.length)+_3aa+_3a3;_39a={x:1,y:0};_39d={x:0,y:0};_39b={x:0,y:1};_39c={x:0,y:_384};switch(_395){case 0:_39e="middle";_39d.y=size;break;case 90:_39e="start";_39d.x=-size*0.4;break;case 180:_39e="middle";break;case 270:_39e="end";_39d.x=size*0.4;break;default:if(_395<(90-_385)){_39e="start";_39d.y=_394?size:0;}else{if(_395<(90+_385)){_39e="start";_39d.x=-size*0.4;}else{if(_395<180){_39e="start";_39d.y=_394?0:-size;}else{if(_395<(270-_385)){_39e="end";_39d.y=_394?0:-size;}else{if(_395<(270+_385)){_39e="end";_39d.y=_394?size*0.4:0;}else{_39e="end";_39d.y=_394?size:0;}}}}}}if(_394){_396.y=stop.y=dim.height-_393.b;_398=(_3a4&&_3a4=="axis")?180:0;_397.y=dim.height-_393.b+_399-(_398?_3aa:0);}else{_396.y=stop.y=_393.t;_398=(_3a4&&_3a4=="away")?180:0;_397.y=_393.t-_399+(_398?0:_3aa);_39b.y=-1;_39c.y=-_39c.y;switch(_39e){case "start":_39e="end";break;case "end":_39e="start";break;case "middle":_39d.y-=size;break;}}}this.cleanGroup();try{var s=this.group,c=this.scaler,t=this.ticks,_3ab,f=lin.getTransformerFromModel(this.scaler),_3ac=!_398&&!_395&&this.opt.htmlLabels&&!_4.isIE&&!_4.isOpera?"html":"gfx",dx=_39b.x*_3a5.length,dy=_39b.y*_3a5.length;s.createLine({x1:_396.x,y1:_396.y,x2:stop.x,y2:stop.y}).setStroke(_3a9);if(o.title){var _3ad=dc.axis2d.common.createText[_3ac](this.chart,s,_397.x,_397.y,"middle",o.title,_3a0,_3a2);if(_3ac=="html"){this.htmlElements.push(_3ad);}else{_3ad.setTransform(g.matrix.rotategAt(_398,_397.x,_397.y));}}_4.forEach(t.major,function(tick){var _3ae=f(tick.value),elem,x=_396.x+_39a.x*_3ae,y=_396.y+_39a.y*_3ae;s.createLine({x1:x,y1:y,x2:x+dx,y2:y+dy}).setStroke(_3a5);if(tick.label){var _3af=o.maxLabelCharCount?this.getTextWithLimitCharCount(tick.label,_39f,o.maxLabelCharCount):{text:tick.label,truncated:false};_3af=o.maxLabelSize?this.getTextWithLimitLength(_3af.text,_39f,o.maxLabelSize,_3af.truncated):_3af;elem=dc.axis2d.common.createText[_3ac](this.chart,s,x+dx+_39c.x+(_395?0:_39d.x),y+dy+_39c.y+(_395?0:_39d.y),_39e,_3af.text,_39f,_3a1);_3af.truncated&&this.labelTooltip(elem,this.chart,tick.label,_3af.text,_39f,_3ac);if(_3ac=="html"){this.htmlElements.push(elem);}else{if(_395){elem.setTransform([{dx:_39d.x,dy:_39d.y},g.matrix.rotategAt(_395,x+dx+_39c.x,y+dy+_39c.y)]);}}}},this);dx=_39b.x*_3a6.length;dy=_39b.y*_3a6.length;_3ab=c.minMinorStep<=c.minor.tick*c.bounds.scale;_4.forEach(t.minor,function(tick){var _3b0=f(tick.value),elem,x=_396.x+_39a.x*_3b0,y=_396.y+_39a.y*_3b0;s.createLine({x1:x,y1:y,x2:x+dx,y2:y+dy}).setStroke(_3a6);if(_3ab&&tick.label){var _3b1=o.maxLabelCharCount?this.getTextWithLimitCharCount(tick.label,_39f,o.maxLabelCharCount):{text:tick.label,truncated:false};_3b1=o.maxLabelSize?this.getTextWithLimitLength(_3b1.text,_39f,o.maxLabelSize,_3b1.truncated):_3b1;elem=dc.axis2d.common.createText[_3ac](this.chart,s,x+dx+_39c.x+(_395?0:_39d.x),y+dy+_39c.y+(_395?0:_39d.y),_39e,_3b1.text,_39f,_3a1);_3b1.truncated&&this.labelTooltip(elem,this.chart,tick.label,_3b1.text,_39f,_3ac);if(_3ac=="html"){this.htmlElements.push(elem);}else{if(_395){elem.setTransform([{dx:_39d.x,dy:_39d.y},g.matrix.rotategAt(_395,x+dx+_39c.x,y+dy+_39c.y)]);}}}},this);dx=_39b.x*_3a7.length;dy=_39b.y*_3a7.length;_4.forEach(t.micro,function(tick){var _3b2=f(tick.value),elem,x=_396.x+_39a.x*_3b2,y=_396.y+_39a.y*_3b2;s.createLine({x1:x,y1:y,x2:x+dx,y2:y+dy}).setStroke(_3a7);},this);}catch(e){}this.dirty=false;return this;},labelTooltip:function(elem,_3b3,_3b4,_3b5,font,_3b6){if(!_5||!_5.Tooltip){return;}var _3b7={type:"rect"},_3b8=["above","below"],_3b9=_6.gfx._base._getTextBox(_3b5,{font:font}).w||0;fontHeight=font?g.normalizedLength(g.splitFontString(font).size):0;if(_3b6=="html"){_4.mixin(_3b7,_4.coords(elem.firstChild,true));_3b7.width=Math.ceil(_3b9);_3b7.height=Math.ceil(fontHeight);this._events.push({shape:_4,handle:_4.connect(elem.firstChild,"onmouseover",this,function(e){_5.showTooltip(_3b4,_3b7,_3b8);})});this._events.push({shape:_4,handle:_4.connect(elem.firstChild,"onmouseout",this,function(e){_5.hideTooltip(_3b7);})});}else{var shp=elem.getShape(),lt=_4.coords(_3b3.node,true);_3b7=_4.mixin(_3b7,{x:shp.x-_3b9/2,y:shp.y});_3b7.x+=lt.x;_3b7.y+=lt.y;_3b7.x=Math.round(_3b7.x);_3b7.y=Math.round(_3b7.y);_3b7.width=Math.ceil(_3b9);_3b7.height=Math.ceil(fontHeight);this._events.push({shape:elem,handle:elem.connect("onmouseenter",this,function(e){_5.showTooltip(_3b4,_3b7,_3b8);})});this._events.push({shape:elem,handle:elem.connect("onmouseleave",this,function(e){_5.hideTooltip(_3b7);})});}}});})();}if(!_4._hasResource["dojox.charting.plot2d.common"]){_4._hasResource["dojox.charting.plot2d.common"]=true;_4.provide("dojox.charting.plot2d.common");(function(){var df=_6.lang.functional,dc=_6.charting.plot2d.common;_4.mixin(_6.charting.plot2d.common,{makeStroke:function(_3ba){if(!_3ba){return _3ba;}if(typeof _3ba=="string"||_3ba instanceof _4.Color){_3ba={color:_3ba};}return _6.gfx.makeParameters(_6.gfx.defaultStroke,_3ba);},augmentColor:function(_3bb,_3bc){var t=new _4.Color(_3bb),c=new _4.Color(_3bc);c.a=t.a;return c;},augmentStroke:function(_3bd,_3be){var s=dc.makeStroke(_3bd);if(s){s.color=dc.augmentColor(s.color,_3be);}return s;},augmentFill:function(fill,_3bf){var fc,c=new _4.Color(_3bf);if(typeof fill=="string"||fill instanceof _4.Color){return dc.augmentColor(fill,_3bf);}return fill;},defaultStats:{vmin:Number.POSITIVE_INFINITY,vmax:Number.NEGATIVE_INFINITY,hmin:Number.POSITIVE_INFINITY,hmax:Number.NEGATIVE_INFINITY},collectSimpleStats:function(_3c0){var _3c1=_4.delegate(dc.defaultStats);for(var i=0;i<_3c0.length;++i){var run=_3c0[i];for(var j=0;j<run.data.length;j++){if(run.data[j]!==null){if(typeof run.data[j]=="number"){var _3c2=_3c1.vmin,_3c3=_3c1.vmax;if(!("ymin" in run)||!("ymax" in run)){_4.forEach(run.data,function(val,i){if(val!==null){var x=i+1,y=val;if(isNaN(y)){y=0;}_3c1.hmin=Math.min(_3c1.hmin,x);_3c1.hmax=Math.max(_3c1.hmax,x);_3c1.vmin=Math.min(_3c1.vmin,y);_3c1.vmax=Math.max(_3c1.vmax,y);}});}if("ymin" in run){_3c1.vmin=Math.min(_3c2,run.ymin);}if("ymax" in run){_3c1.vmax=Math.max(_3c3,run.ymax);}}else{var _3c4=_3c1.hmin,_3c5=_3c1.hmax,_3c2=_3c1.vmin,_3c3=_3c1.vmax;if(!("xmin" in run)||!("xmax" in run)||!("ymin" in run)||!("ymax" in run)){_4.forEach(run.data,function(val,i){if(val!==null){var x="x" in val?val.x:i+1,y=val.y;if(isNaN(x)){x=0;}if(isNaN(y)){y=0;}_3c1.hmin=Math.min(_3c1.hmin,x);_3c1.hmax=Math.max(_3c1.hmax,x);_3c1.vmin=Math.min(_3c1.vmin,y);_3c1.vmax=Math.max(_3c1.vmax,y);}});}if("xmin" in run){_3c1.hmin=Math.min(_3c4,run.xmin);}if("xmax" in run){_3c1.hmax=Math.max(_3c5,run.xmax);}if("ymin" in run){_3c1.vmin=Math.min(_3c2,run.ymin);}if("ymax" in run){_3c1.vmax=Math.max(_3c3,run.ymax);}}break;}}}return _3c1;},calculateBarSize:function(_3c6,opt,_3c7){if(!_3c7){_3c7=1;}var gap=opt.gap,size=(_3c6-2*gap)/_3c7;if("minBarSize" in opt){size=Math.max(size,opt.minBarSize);}if("maxBarSize" in opt){size=Math.min(size,opt.maxBarSize);}size=Math.max(size,1);gap=(_3c6-size*_3c7)/2;return {size:size,gap:gap};},collectStackedStats:function(_3c8){var _3c9=_4.clone(dc.defaultStats);if(_3c8.length){_3c9.hmin=Math.min(_3c9.hmin,1);_3c9.hmax=df.foldl(_3c8,"seed, run -> Math.max(seed, run.data.length)",_3c9.hmax);for(var i=0;i<_3c9.hmax;++i){var v=_3c8[0].data[i];v=v&&(typeof v=="number"?v:v.y);if(isNaN(v)){v=0;}_3c9.vmin=Math.min(_3c9.vmin,v);for(var j=1;j<_3c8.length;++j){var t=_3c8[j].data[i];t=t&&(typeof t=="number"?t:t.y);if(isNaN(t)){t=0;}v+=t;}_3c9.vmax=Math.max(_3c9.vmax,v);}}return _3c9;},curve:function(a,_3ca){var arr=a.slice(0);if(_3ca=="x"){arr[arr.length]=arr[0];}var p=_4.map(arr,function(item,i){if(i==0){return "M"+item.x+","+item.y;}if(!isNaN(_3ca)){var dx=item.x-arr[i-1].x,dy=arr[i-1].y;return "C"+(item.x-(_3ca-1)*(dx/_3ca))+","+dy+" "+(item.x-(dx/_3ca))+","+item.y+" "+item.x+","+item.y;}else{if(_3ca=="X"||_3ca=="x"||_3ca=="S"){var p0,p1=arr[i-1],p2=arr[i],p3;var bz1x,bz1y,bz2x,bz2y;var f=1/6;if(i==1){if(_3ca=="x"){p0=arr[arr.length-2];}else{p0=p1;}f=1/3;}else{p0=arr[i-2];}if(i==(arr.length-1)){if(_3ca=="x"){p3=arr[1];}else{p3=p2;}f=1/3;}else{p3=arr[i+1];}var p1p2=Math.sqrt((p2.x-p1.x)*(p2.x-p1.x)+(p2.y-p1.y)*(p2.y-p1.y));var p0p2=Math.sqrt((p2.x-p0.x)*(p2.x-p0.x)+(p2.y-p0.y)*(p2.y-p0.y));var p1p3=Math.sqrt((p3.x-p1.x)*(p3.x-p1.x)+(p3.y-p1.y)*(p3.y-p1.y));var _3cb=p0p2*f;var _3cc=p1p3*f;if(_3cb>p1p2/2&&_3cc>p1p2/2){_3cb=p1p2/2;_3cc=p1p2/2;}else{if(_3cb>p1p2/2){_3cb=p1p2/2;_3cc=p1p2/2*p1p3/p0p2;}else{if(_3cc>p1p2/2){_3cc=p1p2/2;_3cb=p1p2/2*p0p2/p1p3;}}}if(_3ca=="S"){if(p0==p1){_3cb=0;}if(p2==p3){_3cc=0;}}bz1x=p1.x+_3cb*(p2.x-p0.x)/p0p2;bz1y=p1.y+_3cb*(p2.y-p0.y)/p0p2;bz2x=p2.x-_3cc*(p3.x-p1.x)/p1p3;bz2y=p2.y-_3cc*(p3.y-p1.y)/p1p3;}}return "C"+(bz1x+","+bz1y+" "+bz2x+","+bz2y+" "+p2.x+","+p2.y);});return p.join(" ");},getLabel:function(_3cd,_3ce,_3cf){if(_4.number){return (_3ce?_4.number.format(_3cd,{places:_3cf}):_4.number.format(_3cd))||"";}return _3ce?_3cd.toFixed(_3cf):_3cd.toString();}});})();}if(!_4._hasResource["dojox.charting.scaler.primitive"]){_4._hasResource["dojox.charting.scaler.primitive"]=true;_4.provide("dojox.charting.scaler.primitive");_6.charting.scaler.primitive={buildScaler:function(min,max,span,_3d0){if(min==max){min-=0.5;max+=0.5;}return {bounds:{lower:min,upper:max,from:min,to:max,scale:span/(max-min),span:span},scaler:_6.charting.scaler.primitive};},buildTicks:function(_3d1,_3d2){return {major:[],minor:[],micro:[]};},getTransformerFromModel:function(_3d3){var _3d4=_3d3.bounds.from,_3d5=_3d3.bounds.scale;return function(x){return (x-_3d4)*_3d5;};},getTransformerFromPlot:function(_3d6){var _3d7=_3d6.bounds.from,_3d8=_3d6.bounds.scale;return function(x){return x/_3d8+_3d7;};}};}if(!_4._hasResource["dojox.charting.plot2d._PlotEvents"]){_4._hasResource["dojox.charting.plot2d._PlotEvents"]=true;_4.provide("dojox.charting.plot2d._PlotEvents");_4.declare("dojox.charting.plot2d._PlotEvents",null,{constructor:function(){this._shapeEvents=[];this._eventSeries={};},destroy:function(){this.resetEvents();this.inherited(arguments);},plotEvent:function(o){},raiseEvent:function(o){this.plotEvent(o);var t=_4.delegate(o);t.originalEvent=o.type;t.originalPlot=o.plot;t.type="onindirect";_4.forEach(this.chart.stack,function(plot){if(plot!==this&&plot.plotEvent){t.plot=plot;plot.plotEvent(t);}},this);},connect:function(_3d9,_3da){this.dirty=true;return _4.connect(this,"plotEvent",_3d9,_3da);},events:function(){var ls=this.plotEvent._listeners;if(!ls||!ls.length){return false;}for(var i in ls){if(!(i in Array.prototype)){return true;}}return false;},resetEvents:function(){if(this._shapeEvents.length){_4.forEach(this._shapeEvents,function(item){item.shape.disconnect(item.handle);});this._shapeEvents=[];}this.raiseEvent({type:"onplotreset",plot:this});},_connectSingleEvent:function(o,_3db){this._shapeEvents.push({shape:o.eventMask,handle:o.eventMask.connect(_3db,this,function(e){o.type=_3db;o.event=e;this.raiseEvent(o);o.event=null;})});},_connectEvents:function(o){if(o){o.chart=this.chart;o.plot=this;o.hAxis=this.hAxis||null;o.vAxis=this.vAxis||null;o.eventMask=o.eventMask||o.shape;this._connectSingleEvent(o,"onmouseover");this._connectSingleEvent(o,"onmouseout");this._connectSingleEvent(o,"onclick");}},_reconnectEvents:function(_3dc){var a=this._eventSeries[_3dc];if(a){_4.forEach(a,this._connectEvents,this);}},fireEvent:function(_3dd,_3de,_3df,_3e0){var s=this._eventSeries[_3dd];if(s&&s.length&&_3df<s.length){var o=s[_3df];o.type=_3de;o.event=_3e0||null;this.raiseEvent(o);o.event=null;}}});}if(!_4._hasResource["dojox.charting.plot2d.Base"]){_4._hasResource["dojox.charting.plot2d.Base"]=true;_4.provide("dojox.charting.plot2d.Base");_4.declare("dojox.charting.plot2d.Base",[_6.charting.Element,_6.charting.plot2d._PlotEvents],{constructor:function(_3e1,_3e2){this.zoom=null,this.zoomQueue=[];this.lastWindow={vscale:1,hscale:1,xoffset:0,yoffset:0};},clear:function(){this.series=[];this._hAxis=null;this._vAxis=null;this.dirty=true;return this;},setAxis:function(axis){if(axis){this[axis.vertical?"_vAxis":"_hAxis"]=axis;}return this;},addSeries:function(run){this.series.push(run);return this;},getSeriesStats:function(){return _6.charting.plot2d.common.collectSimpleStats(this.series);},calculateAxes:function(dim){this.initializeScalers(dim,this.getSeriesStats());return this;},isDirty:function(){return this.dirty||this._hAxis&&this._hAxis.dirty||this._vAxis&&this._vAxis.dirty;},isDataDirty:function(){return _4.some(this.series,function(item){return item.dirty;});},performZoom:function(dim,_3e3){var vs=this._vAxis.scale||1,hs=this._hAxis.scale||1,_3e4=dim.height-_3e3.b,_3e5=this._hScaler.bounds,_3e6=(_3e5.from-_3e5.lower)*_3e5.scale,_3e7=this._vScaler.bounds,_3e8=(_3e7.from-_3e7.lower)*_3e7.scale;rVScale=vs/this.lastWindow.vscale,rHScale=hs/this.lastWindow.hscale,rXOffset=(this.lastWindow.xoffset-_3e6)/((this.lastWindow.hscale==1)?hs:this.lastWindow.hscale),rYOffset=(_3e8-this.lastWindow.yoffset)/((this.lastWindow.vscale==1)?vs:this.lastWindow.vscale),shape=this.group,anim=_6.gfx.fx.animateTransform(_4.delegate({shape:shape,duration:1200,transform:[{name:"translate",start:[0,0],end:[_3e3.l*(1-rHScale),_3e4*(1-rVScale)]},{name:"scale",start:[1,1],end:[rHScale,rVScale]},{name:"original"},{name:"translate",start:[0,0],end:[rXOffset,rYOffset]}]},this.zoom));_4.mixin(this.lastWindow,{vscale:vs,hscale:hs,xoffset:_3e6,yoffset:_3e8});this.zoomQueue.push(anim);_4.connect(anim,"onEnd",this,function(){this.zoom=null;this.zoomQueue.shift();if(this.zoomQueue.length>0){this.zoomQueue[0].play();}});if(this.zoomQueue.length==1){this.zoomQueue[0].play();}return this;},render:function(dim,_3e9){return this;},getRequiredColors:function(){return this.series.length;},initializeScalers:function(dim,_3ea){if(this._hAxis){if(!this._hAxis.initialized()){this._hAxis.calculate(_3ea.hmin,_3ea.hmax,dim.width);}this._hScaler=this._hAxis.getScaler();}else{this._hScaler=_6.charting.scaler.primitive.buildScaler(_3ea.hmin,_3ea.hmax,dim.width);}if(this._vAxis){if(!this._vAxis.initialized()){this._vAxis.calculate(_3ea.vmin,_3ea.vmax,dim.height);}this._vScaler=this._vAxis.getScaler();}else{this._vScaler=_6.charting.scaler.primitive.buildScaler(_3ea.vmin,_3ea.vmax,dim.height);}return this;}});}if(!_4._hasResource["dojox.lang.functional.reversed"]){_4._hasResource["dojox.lang.functional.reversed"]=true;_4.provide("dojox.lang.functional.reversed");(function(){var d=_4,df=_6.lang.functional;d.mixin(df,{filterRev:function(a,f,o){if(typeof a=="string"){a=a.split("");}o=o||d.global;f=df.lambda(f);var t=[],v,i=a.length-1;for(;i>=0;--i){v=a[i];if(f.call(o,v,i,a)){t.push(v);}}return t;},forEachRev:function(a,f,o){if(typeof a=="string"){a=a.split("");}o=o||d.global;f=df.lambda(f);for(var i=a.length-1;i>=0;f.call(o,a[i],i,a),--i){}},mapRev:function(a,f,o){if(typeof a=="string"){a=a.split("");}o=o||d.global;f=df.lambda(f);var n=a.length,t=new Array(n),i=n-1,j=0;for(;i>=0;t[j++]=f.call(o,a[i],i,a),--i){}return t;},everyRev:function(a,f,o){if(typeof a=="string"){a=a.split("");}o=o||d.global;f=df.lambda(f);for(var i=a.length-1;i>=0;--i){if(!f.call(o,a[i],i,a)){return false;}}return true;},someRev:function(a,f,o){if(typeof a=="string"){a=a.split("");}o=o||d.global;f=df.lambda(f);for(var i=a.length-1;i>=0;--i){if(f.call(o,a[i],i,a)){return true;}}return false;}});})();}if(!_4._hasResource["dojox.gfx.fx"]){_4._hasResource["dojox.gfx.fx"]=true;_4.provide("dojox.gfx.fx");(function(){var d=_4,g=_6.gfx,m=g.matrix;function _3eb(_3ec,end){this.start=_3ec,this.end=end;};_3eb.prototype.getValue=function(r){return (this.end-this.start)*r+this.start;};function _3ed(_3ee,end,_3ef){this.start=_3ee,this.end=end;this.units=_3ef;};_3ed.prototype.getValue=function(r){return (this.end-this.start)*r+this.start+this.units;};function _3f0(_3f1,end){this.start=_3f1,this.end=end;this.temp=new _4.Color();};_3f0.prototype.getValue=function(r){return d.blendColors(this.start,this.end,r,this.temp);};function _3f2(_3f3){this.values=_3f3;this.length=_3f3.length;};_3f2.prototype.getValue=function(r){return this.values[Math.min(Math.floor(r*this.length),this.length-1)];};function _3f4(_3f5,def){this.values=_3f5;this.def=def?def:{};};_3f4.prototype.getValue=function(r){var ret=_4.clone(this.def);for(var i in this.values){ret[i]=this.values[i].getValue(r);}return ret;};function _3f6(_3f7,_3f8){this.stack=_3f7;this.original=_3f8;};_3f6.prototype.getValue=function(r){var ret=[];_4.forEach(this.stack,function(t){if(t instanceof m.Matrix2D){ret.push(t);return;}if(t.name=="original"&&this.original){ret.push(this.original);return;}if(!(t.name in m)){return;}var f=m[t.name];if(typeof f!="function"){ret.push(f);return;}var val=_4.map(t.start,function(v,i){return (t.end[i]-v)*r+v;}),_3f9=f.apply(m,val);if(_3f9 instanceof m.Matrix2D){ret.push(_3f9);}},this);return ret;};var _3fa=new d.Color(0,0,0,0);function _3fb(prop,obj,name,def){if(prop.values){return new _3f2(prop.values);}var _3fc,_3fd,end;if(prop.start){_3fd=g.normalizeColor(prop.start);}else{_3fd=_3fc=obj?(name?obj[name]:obj):def;}if(prop.end){end=g.normalizeColor(prop.end);}else{if(!_3fc){_3fc=obj?(name?obj[name]:obj):def;}end=_3fc;}return new _3f0(_3fd,end);};function _3fe(prop,obj,name,def){if(prop.values){return new _3f2(prop.values);}var _3ff,_400,end;if(prop.start){_400=prop.start;}else{_400=_3ff=obj?obj[name]:def;}if(prop.end){end=prop.end;}else{if(typeof _3ff!="number"){_3ff=obj?obj[name]:def;}end=_3ff;}return new _3eb(_400,end);};g.fx.animateStroke=function(args){if(!args.easing){args.easing=d._defaultEasing;}var anim=new d.Animation(args),_401=args.shape,_402;d.connect(anim,"beforeBegin",anim,function(){_402=_401.getStroke();var prop=args.color,_403={},_404,_405,end;if(prop){_403.color=_3fb(prop,_402,"color",_3fa);}prop=args.style;if(prop&&prop.values){_403.style=new _3f2(prop.values);}prop=args.width;if(prop){_403.width=_3fe(prop,_402,"width",1);}prop=args.cap;if(prop&&prop.values){_403.cap=new _3f2(prop.values);}prop=args.join;if(prop){if(prop.values){_403.join=new _3f2(prop.values);}else{_405=prop.start?prop.start:(_402&&_402.join||0);end=prop.end?prop.end:(_402&&_402.join||0);if(typeof _405=="number"&&typeof end=="number"){_403.join=new _3eb(_405,end);}}}this.curve=new _3f4(_403,_402);});d.connect(anim,"onAnimate",_401,"setStroke");return anim;};g.fx.animateFill=function(args){if(!args.easing){args.easing=d._defaultEasing;}var anim=new d.Animation(args),_406=args.shape,fill;d.connect(anim,"beforeBegin",anim,function(){fill=_406.getFill();var prop=args.color,_407={};if(prop){this.curve=_3fb(prop,fill,"",_3fa);}});d.connect(anim,"onAnimate",_406,"setFill");return anim;};g.fx.animateFont=function(args){if(!args.easing){args.easing=d._defaultEasing;}var anim=new d.Animation(args),_408=args.shape,font;d.connect(anim,"beforeBegin",anim,function(){font=_408.getFont();var prop=args.style,_409={},_40a,_40b,end;if(prop&&prop.values){_409.style=new _3f2(prop.values);}prop=args.variant;if(prop&&prop.values){_409.variant=new _3f2(prop.values);}prop=args.weight;if(prop&&prop.values){_409.weight=new _3f2(prop.values);}prop=args.family;if(prop&&prop.values){_409.family=new _3f2(prop.values);}prop=args.size;if(prop&&prop.units){_40b=parseFloat(prop.start?prop.start:(_408.font&&_408.font.size||"0"));end=parseFloat(prop.end?prop.end:(_408.font&&_408.font.size||"0"));_409.size=new _3ed(_40b,end,prop.units);}this.curve=new _3f4(_409,font);});d.connect(anim,"onAnimate",_408,"setFont");return anim;};g.fx.animateTransform=function(args){if(!args.easing){args.easing=d._defaultEasing;}var anim=new d.Animation(args),_40c=args.shape,_40d;d.connect(anim,"beforeBegin",anim,function(){_40d=_40c.getTransform();this.curve=new _3f6(args.transform,_40d);});d.connect(anim,"onAnimate",_40c,"setTransform");return anim;};})();}if(!_4._hasResource["dojox.charting.plot2d.Default"]){_4._hasResource["dojox.charting.plot2d.Default"]=true;_4.provide("dojox.charting.plot2d.Default");(function(){var df=_6.lang.functional,du=_6.lang.utils,dc=_6.charting.plot2d.common,_40e=df.lambda("item.purgeGroup()");var _40f=1200;_4.declare("dojox.charting.plot2d.Default",_6.charting.plot2d.Base,{defaultParams:{hAxis:"x",vAxis:"y",lines:true,areas:false,markers:false,tension:"",animate:false},optionalParams:{stroke:{},outline:{},shadow:{},fill:{},font:"",fontColor:"",markerStroke:{},markerOutline:{},markerShadow:{},markerFill:{},markerFont:"",markerFontColor:""},constructor:function(_410,_411){this.opt=_4.clone(this.defaultParams);du.updateWithObject(this.opt,_411);du.updateWithPattern(this.opt,_411,this.optionalParams);this.series=[];this.hAxis=this.opt.hAxis;this.vAxis=this.opt.vAxis;this.animate=this.opt.animate;},render:function(dim,_412){if(this.zoom&&!this.isDataDirty()){return this.performZoom(dim,_412);}this.resetEvents();this.dirty=this.isDirty();if(this.dirty){_4.forEach(this.series,_40e);this._eventSeries={};this.cleanGroup();this.group.setTransform(null);var s=this.group;df.forEachRev(this.series,function(item){item.cleanGroup(s);});}var t=this.chart.theme,_413,_414,_415,_416=this.events();for(var i=this.series.length-1;i>=0;--i){var run=this.series[i];if(!this.dirty&&!run.dirty){t.skip();this._reconnectEvents(run.name);continue;}run.cleanGroup();if(!run.data.length){run.dirty=false;t.skip();continue;}var _417=t.next(this.opt.areas?"area":"line",[this.opt,run],true),s=run.group,_418=[],_419=[],rseg=null,_41a,ht=this._hScaler.scaler.getTransformerFromModel(this._hScaler),vt=this._vScaler.scaler.getTransformerFromModel(this._vScaler),_41b=this._eventSeries[run.name]=new Array(run.data.length);for(var j=0;j<run.data.length;j++){if(run.data[j]!=null){if(!rseg){rseg=[];_419.push(j);_418.push(rseg);}rseg.push(run.data[j]);}else{rseg=null;}}for(var seg=0;seg<_418.length;seg++){if(typeof _418[seg][0]=="number"){_41a=_4.map(_418[seg],function(v,i){return {x:ht(i+_419[seg]+1)+_412.l,y:dim.height-_412.b-vt(v)};},this);}else{_41a=_4.map(_418[seg],function(v,i){return {x:ht(v.x)+_412.l,y:dim.height-_412.b-vt(v.y)};},this);}var _41c=this.opt.tension?dc.curve(_41a,this.opt.tension):"";if(this.opt.areas&&_41a.length>1){var fill=_417.series.fill;var _41d=_4.clone(_41a);if(this.opt.tension){var _41e="L"+_41d[_41d.length-1].x+","+(dim.height-_412.b)+" L"+_41d[0].x+","+(dim.height-_412.b)+" L"+_41d[0].x+","+_41d[0].y;run.dyn.fill=s.createPath(_41c+" "+_41e).setFill(fill).getFill();}else{_41d.push({x:_41a[_41a.length-1].x,y:dim.height-_412.b});_41d.push({x:_41a[0].x,y:dim.height-_412.b});_41d.push(_41a[0]);run.dyn.fill=s.createPolyline(_41d).setFill(fill).getFill();}}if(this.opt.lines||this.opt.markers){_413=_417.series.stroke;if(_417.series.outline){_414=run.dyn.outline=dc.makeStroke(_417.series.outline);_414.width=2*_414.width+_413.width;}}if(this.opt.markers){run.dyn.marker=_417.symbol;}var _41f=null,_420=null,_421=null;if(_413&&_417.series.shadow&&_41a.length>1){var _422=_417.series.shadow,_423=_4.map(_41a,function(c){return {x:c.x+_422.dx,y:c.y+_422.dy};});if(this.opt.lines){if(this.opt.tension){run.dyn.shadow=s.createPath(dc.curve(_423,this.opt.tension)).setStroke(_422).getStroke();}else{run.dyn.shadow=s.createPolyline(_423).setStroke(_422).getStroke();}}if(this.opt.markers&&_417.marker.shadow){_422=_417.marker.shadow;_421=_4.map(_423,function(c){return s.createPath("M"+c.x+" "+c.y+" "+_417.symbol).setStroke(_422).setFill(_422.color);},this);}}if(this.opt.lines&&_41a.length>1){if(_414){if(this.opt.tension){run.dyn.outline=s.createPath(_41c).setStroke(_414).getStroke();}else{run.dyn.outline=s.createPolyline(_41a).setStroke(_414).getStroke();}}if(this.opt.tension){run.dyn.stroke=s.createPath(_41c).setStroke(_413).getStroke();}else{run.dyn.stroke=s.createPolyline(_41a).setStroke(_413).getStroke();}}if(this.opt.markers){_41f=new Array(_41a.length);_420=new Array(_41a.length);_414=null;if(_417.marker.outline){_414=dc.makeStroke(_417.marker.outline);_414.width=2*_414.width+(_417.marker.stroke?_417.marker.stroke.width:0);}_4.forEach(_41a,function(c,i){var path="M"+c.x+" "+c.y+" "+_417.symbol;if(_414){_420[i]=s.createPath(path).setStroke(_414);}_41f[i]=s.createPath(path).setStroke(_417.marker.stroke).setFill(_417.marker.fill);},this);run.dyn.markerFill=_417.marker.fill;run.dyn.markerStroke=_417.marker.stroke;if(_416){_4.forEach(_41f,function(s,i){var o={element:"marker",index:i+_419[seg],run:run,shape:s,outline:_420[i]||null,shadow:_421&&_421[i]||null,cx:_41a[i].x,cy:_41a[i].y};if(typeof _418[seg][0]=="number"){o.x=i+_419[seg]+1;o.y=_418[seg][i];}else{o.x=_418[seg][i].x;o.y=_418[seg][i].y;}this._connectEvents(o);_41b[i+_419[seg]]=o;},this);}else{delete this._eventSeries[run.name];}}}run.dirty=false;}if(this.animate){var _424=this.group;_6.gfx.fx.animateTransform(_4.delegate({shape:_424,duration:_40f,transform:[{name:"translate",start:[0,dim.height-_412.b],end:[0,0]},{name:"scale",start:[1,0],end:[1,1]},{name:"original"}]},this.animate)).play();}this.dirty=false;return this;}});})();}if(!_4._hasResource["dojox.charting.plot2d.Lines"]){_4._hasResource["dojox.charting.plot2d.Lines"]=true;_4.provide("dojox.charting.plot2d.Lines");_4.declare("dojox.charting.plot2d.Lines",_6.charting.plot2d.Default,{constructor:function(){this.opt.lines=true;}});}if(!_4._hasResource["dojox.charting.plot2d.Areas"]){_4._hasResource["dojox.charting.plot2d.Areas"]=true;_4.provide("dojox.charting.plot2d.Areas");_4.declare("dojox.charting.plot2d.Areas",_6.charting.plot2d.Default,{constructor:function(){this.opt.lines=true;this.opt.areas=true;}});}if(!_4._hasResource["dojox.charting.plot2d.Markers"]){_4._hasResource["dojox.charting.plot2d.Markers"]=true;_4.provide("dojox.charting.plot2d.Markers");_4.declare("dojox.charting.plot2d.Markers",_6.charting.plot2d.Default,{constructor:function(){this.opt.markers=true;}});}if(!_4._hasResource["dojox.charting.plot2d.MarkersOnly"]){_4._hasResource["dojox.charting.plot2d.MarkersOnly"]=true;_4.provide("dojox.charting.plot2d.MarkersOnly");_4.declare("dojox.charting.plot2d.MarkersOnly",_6.charting.plot2d.Default,{constructor:function(){this.opt.lines=false;this.opt.markers=true;}});}if(!_4._hasResource["dojox.gfx.gradutils"]){_4._hasResource["dojox.gfx.gradutils"]=true;_4.provide("dojox.gfx.gradutils");(function(){var d=_4,m=_6.gfx.matrix,C=d.Color;function _425(o,c){if(o<=0){return c[0].color;}var len=c.length;if(o>=1){return c[len-1].color;}for(var i=0;i<len;++i){var stop=c[i];if(stop.offset>=o){if(i){var prev=c[i-1];return d.blendColors(new C(prev.color),new C(stop.color),(o-prev.offset)/(stop.offset-prev.offset));}return stop.color;}}return c[len-1].color;};_6.gfx.gradutils.getColor=function(fill,pt){var o;if(fill){switch(fill.type){case "linear":var _426=Math.atan2(fill.y2-fill.y1,fill.x2-fill.x1),_427=m.rotate(-_426),_428=m.project(fill.x2-fill.x1,fill.y2-fill.y1),p=m.multiplyPoint(_428,pt),pf1=m.multiplyPoint(_428,fill.x1,fill.y1),pf2=m.multiplyPoint(_428,fill.x2,fill.y2),_429=m.multiplyPoint(_427,pf2.x-pf1.x,pf2.y-pf1.y).x,o=m.multiplyPoint(_427,p.x-pf1.x,p.y-pf1.y).x/_429;break;case "radial":var dx=pt.x-fill.cx,dy=pt.y-fill.cy,o=Math.sqrt(dx*dx+dy*dy)/fill.r;break;}return _425(o,fill.colors);}return new C(fill||[0,0,0,0]);};_6.gfx.gradutils.reverse=function(fill){if(fill){switch(fill.type){case "linear":case "radial":fill=_4.delegate(fill);if(fill.colors){var c=fill.colors,l=c.length,i=0,stop,n=fill.colors=new Array(c.length);for(;i<l;++i){stop=c[i];n[i]={offset:1-stop.offset,color:stop.color};}n.sort(function(a,b){return a.offset-b.offset;});}break;}}return fill;};})();}if(!_4._hasResource["dojox.charting.plot2d.Scatter"]){_4._hasResource["dojox.charting.plot2d.Scatter"]=true;_4.provide("dojox.charting.plot2d.Scatter");(function(){var df=_6.lang.functional,du=_6.lang.utils,dc=_6.charting.plot2d.common,_42a=df.lambda("item.purgeGroup()");_4.declare("dojox.charting.plot2d.Scatter",_6.charting.plot2d.Base,{defaultParams:{hAxis:"x",vAxis:"y",shadows:null,animate:null},optionalParams:{markerStroke:{},markerOutline:{},markerShadow:{},markerFill:{},markerFont:"",markerFontColor:""},constructor:function(_42b,_42c){this.opt=_4.clone(this.defaultParams);du.updateWithObject(this.opt,_42c);du.updateWithPattern(this.opt,_42c,this.optionalParams);this.series=[];this.hAxis=this.opt.hAxis;this.vAxis=this.opt.vAxis;this.animate=this.opt.animate;},render:function(dim,_42d){if(this.zoom&&!this.isDataDirty()){return this.performZoom(dim,_42d);}this.resetEvents();this.dirty=this.isDirty();if(this.dirty){_4.forEach(this.series,_42a);this._eventSeries={};this.cleanGroup();var s=this.group;df.forEachRev(this.series,function(item){item.cleanGroup(s);});}var t=this.chart.theme,_42e=this.events();for(var i=this.series.length-1;i>=0;--i){var run=this.series[i];if(!this.dirty&&!run.dirty){t.skip();this._reconnectEvents(run.name);continue;}run.cleanGroup();if(!run.data.length){run.dirty=false;t.skip();continue;}var _42f=t.next("marker",[this.opt,run]),s=run.group,_430,ht=this._hScaler.scaler.getTransformerFromModel(this._hScaler),vt=this._vScaler.scaler.getTransformerFromModel(this._vScaler);if(typeof run.data[0]=="number"){_430=_4.map(run.data,function(v,i){return {x:ht(i+1)+_42d.l,y:dim.height-_42d.b-vt(v)};},this);}else{_430=_4.map(run.data,function(v,i){return {x:ht(v.x)+_42d.l,y:dim.height-_42d.b-vt(v.y)};},this);}var _431=new Array(_430.length),_432=new Array(_430.length),_433=new Array(_430.length);_4.forEach(_430,function(c,i){var _434=typeof run.data[i]=="number"?t.post(_42f,"marker"):t.addMixin(_42f,"marker",run.data[i],true),path="M"+c.x+" "+c.y+" "+_434.symbol;if(_434.marker.shadow){_431[i]=s.createPath("M"+(c.x+_434.marker.shadow.dx)+" "+(c.y+_434.marker.shadow.dy)+" "+_434.symbol).setStroke(_434.marker.shadow).setFill(_434.marker.shadow.color);if(this.animate){this._animateScatter(_431[i],dim.height-_42d.b);}}if(_434.marker.outline){var _435=dc.makeStroke(_434.marker.outline);_435.width=2*_435.width+_434.marker.stroke.width;_433[i]=s.createPath(path).setStroke(_435);if(this.animate){this._animateScatter(_433[i],dim.height-_42d.b);}}var _436=dc.makeStroke(_434.marker.stroke),fill=this._plotFill(_434.marker.fill,dim,_42d);if(fill&&(fill.type==="linear"||fill.type=="radial")){var _437=_6.gfx.gradutils.getColor(fill,{x:c.x,y:c.y});if(_436){_436.color=_437;}_432[i]=s.createPath(path).setStroke(_436).setFill(_437);}else{_432[i]=s.createPath(path).setStroke(_436).setFill(fill);}if(this.animate){this._animateScatter(_432[i],dim.height-_42d.b);}},this);if(_432.length){run.dyn.stroke=_432[_432.length-1].getStroke();run.dyn.fill=_432[_432.length-1].getFill();}if(_42e){var _438=new Array(_432.length);_4.forEach(_432,function(s,i){var o={element:"marker",index:i,run:run,shape:s,outline:_433&&_433[i]||null,shadow:_431&&_431[i]||null,cx:_430[i].x,cy:_430[i].y};if(typeof run.data[0]=="number"){o.x=i+1;o.y=run.data[i];}else{o.x=run.data[i].x;o.y=run.data[i].y;}this._connectEvents(o);_438[i]=o;},this);this._eventSeries[run.name]=_438;}else{delete this._eventSeries[run.name];}run.dirty=false;}this.dirty=false;return this;},_animateScatter:function(_439,_43a){_6.gfx.fx.animateTransform(_4.delegate({shape:_439,duration:1200,transform:[{name:"translate",start:[0,_43a],end:[0,0]},{name:"scale",start:[0,0],end:[1,1]},{name:"original"}]},this.animate)).play();}});})();}if(!_4._hasResource["dojox.lang.functional.sequence"]){_4._hasResource["dojox.lang.functional.sequence"]=true;_4.provide("dojox.lang.functional.sequence");(function(){var d=_4,df=_6.lang.functional;d.mixin(df,{repeat:function(n,f,z,o){o=o||d.global;f=df.lambda(f);var t=new Array(n),i=1;t[0]=z;for(;i<n;t[i]=z=f.call(o,z),++i){}return t;},until:function(pr,f,z,o){o=o||d.global;f=df.lambda(f);pr=df.lambda(pr);var t=[];for(;!pr.call(o,z);t.push(z),z=f.call(o,z)){}return t;}});})();}if(!_4._hasResource["dojox.charting.plot2d.Stacked"]){_4._hasResource["dojox.charting.plot2d.Stacked"]=true;_4.provide("dojox.charting.plot2d.Stacked");(function(){var df=_6.lang.functional,dc=_6.charting.plot2d.common,_43b=df.lambda("item.purgeGroup()");_4.declare("dojox.charting.plot2d.Stacked",_6.charting.plot2d.Default,{getSeriesStats:function(){var _43c=dc.collectStackedStats(this.series);this._maxRunLength=_43c.hmax;return _43c;},render:function(dim,_43d){if(this._maxRunLength<=0){return this;}var acc=df.repeat(this._maxRunLength,"-> 0",0);for(var i=0;i<this.series.length;++i){var run=this.series[i];for(var j=0;j<run.data.length;++j){var v=run.data[j];if(v!==null){if(isNaN(v)){v=0;}acc[j]+=v;}}}if(this.zoom&&!this.isDataDirty()){return this.performZoom(dim,_43d);}this.resetEvents();this.dirty=this.isDirty();if(this.dirty){_4.forEach(this.series,_43b);this._eventSeries={};this.cleanGroup();var s=this.group;df.forEachRev(this.series,function(item){item.cleanGroup(s);});}var t=this.chart.theme,_43e=this.events(),ht=this._hScaler.scaler.getTransformerFromModel(this._hScaler),vt=this._vScaler.scaler.getTransformerFromModel(this._vScaler);for(var i=this.series.length-1;i>=0;--i){var run=this.series[i];if(!this.dirty&&!run.dirty){t.skip();this._reconnectEvents(run.name);continue;}run.cleanGroup();var _43f=t.next(this.opt.areas?"area":"line",[this.opt,run],true),s=run.group,_440,_441=_4.map(acc,function(v,i){return {x:ht(i+1)+_43d.l,y:dim.height-_43d.b-vt(v)};},this);var _442=this.opt.tension?dc.curve(_441,this.opt.tension):"";if(this.opt.areas){var _443=_4.clone(_441);if(this.opt.tension){var p=dc.curve(_443,this.opt.tension);p+=" L"+_441[_441.length-1].x+","+(dim.height-_43d.b)+" L"+_441[0].x+","+(dim.height-_43d.b)+" L"+_441[0].x+","+_441[0].y;run.dyn.fill=s.createPath(p).setFill(_43f.series.fill).getFill();}else{_443.push({x:_441[_441.length-1].x,y:dim.height-_43d.b});_443.push({x:_441[0].x,y:dim.height-_43d.b});_443.push(_441[0]);run.dyn.fill=s.createPolyline(_443).setFill(_43f.series.fill).getFill();}}if(this.opt.lines||this.opt.markers){if(_43f.series.outline){_440=dc.makeStroke(_43f.series.outline);_440.width=2*_440.width+_43f.series.stroke.width;}}if(this.opt.markers){run.dyn.marker=_43f.symbol;}var _444,_445,_446;if(_43f.series.shadow&&_43f.series.stroke){var _447=_43f.series.shadow,_448=_4.map(_441,function(c){return {x:c.x+_447.dx,y:c.y+_447.dy};});if(this.opt.lines){if(this.opt.tension){run.dyn.shadow=s.createPath(dc.curve(_448,this.opt.tension)).setStroke(_447).getStroke();}else{run.dyn.shadow=s.createPolyline(_448).setStroke(_447).getStroke();}}if(this.opt.markers){_447=_43f.marker.shadow;_446=_4.map(_448,function(c){return s.createPath("M"+c.x+" "+c.y+" "+_43f.symbol).setStroke(_447).setFill(_447.color);},this);}}if(this.opt.lines){if(_440){if(this.opt.tension){run.dyn.outline=s.createPath(_442).setStroke(_440).getStroke();}else{run.dyn.outline=s.createPolyline(_441).setStroke(_440).getStroke();}}if(this.opt.tension){run.dyn.stroke=s.createPath(_442).setStroke(_43f.series.stroke).getStroke();}else{run.dyn.stroke=s.createPolyline(_441).setStroke(_43f.series.stroke).getStroke();}}if(this.opt.markers){_444=new Array(_441.length);_445=new Array(_441.length);_440=null;if(_43f.marker.outline){_440=dc.makeStroke(_43f.marker.outline);_440.width=2*_440.width+(_43f.marker.stroke?_43f.marker.stroke.width:0);}_4.forEach(_441,function(c,i){var path="M"+c.x+" "+c.y+" "+_43f.symbol;if(_440){_445[i]=s.createPath(path).setStroke(_440);}_444[i]=s.createPath(path).setStroke(_43f.marker.stroke).setFill(_43f.marker.fill);},this);if(_43e){var _449=new Array(_444.length);_4.forEach(_444,function(s,i){var o={element:"marker",index:i,run:run,shape:s,outline:_445[i]||null,shadow:_446&&_446[i]||null,cx:_441[i].x,cy:_441[i].y,x:i+1,y:run.data[i]};this._connectEvents(o);_449[i]=o;},this);this._eventSeries[run.name]=_449;}else{delete this._eventSeries[run.name];}}run.dirty=false;for(var j=0;j<run.data.length;++j){var v=run.data[j];if(v!==null){if(isNaN(v)){v=0;}acc[j]-=v;}}}this.dirty=false;return this;}});})();}if(!_4._hasResource["dojox.charting.plot2d.StackedLines"]){_4._hasResource["dojox.charting.plot2d.StackedLines"]=true;_4.provide("dojox.charting.plot2d.StackedLines");_4.declare("dojox.charting.plot2d.StackedLines",_6.charting.plot2d.Stacked,{constructor:function(){this.opt.lines=true;}});}if(!_4._hasResource["dojox.charting.plot2d.StackedAreas"]){_4._hasResource["dojox.charting.plot2d.StackedAreas"]=true;_4.provide("dojox.charting.plot2d.StackedAreas");_4.declare("dojox.charting.plot2d.StackedAreas",_6.charting.plot2d.Stacked,{constructor:function(){this.opt.lines=true;this.opt.areas=true;}});}if(!_4._hasResource["dojox.charting.plot2d.Columns"]){_4._hasResource["dojox.charting.plot2d.Columns"]=true;_4.provide("dojox.charting.plot2d.Columns");(function(){var df=_6.lang.functional,du=_6.lang.utils,dc=_6.charting.plot2d.common,_44a=df.lambda("item.purgeGroup()");_4.declare("dojox.charting.plot2d.Columns",_6.charting.plot2d.Base,{defaultParams:{hAxis:"x",vAxis:"y",gap:0,animate:null},optionalParams:{minBarSize:1,maxBarSize:1,stroke:{},outline:{},shadow:{},fill:{},font:"",fontColor:""},constructor:function(_44b,_44c){this.opt=_4.clone(this.defaultParams);du.updateWithObject(this.opt,_44c);du.updateWithPattern(this.opt,_44c,this.optionalParams);this.series=[];this.hAxis=this.opt.hAxis;this.vAxis=this.opt.vAxis;this.animate=this.opt.animate;},getSeriesStats:function(){var _44d=dc.collectSimpleStats(this.series);_44d.hmin-=0.5;_44d.hmax+=0.5;return _44d;},render:function(dim,_44e){if(this.zoom&&!this.isDataDirty()){return this.performZoom(dim,_44e);}this.resetEvents();this.dirty=this.isDirty();if(this.dirty){_4.forEach(this.series,_44a);this._eventSeries={};this.cleanGroup();var s=this.group;df.forEachRev(this.series,function(item){item.cleanGroup(s);});}var t=this.chart.theme,f,gap,_44f,ht=this._hScaler.scaler.getTransformerFromModel(this._hScaler),vt=this._vScaler.scaler.getTransformerFromModel(this._vScaler),_450=Math.max(0,this._vScaler.bounds.lower),_451=vt(_450),_452=this.events();f=dc.calculateBarSize(this._hScaler.bounds.scale,this.opt);gap=f.gap;_44f=f.size;for(var i=this.series.length-1;i>=0;--i){var run=this.series[i];if(!this.dirty&&!run.dirty){t.skip();this._reconnectEvents(run.name);continue;}run.cleanGroup();var _453=t.next("column",[this.opt,run]),s=run.group,_454=new Array(run.data.length);for(var j=0;j<run.data.length;++j){var _455=run.data[j];if(_455!==null){var v=typeof _455=="number"?_455:_455.y,vv=vt(v),_456=vv-_451,h=Math.abs(_456),_457=typeof _455!="number"?t.addMixin(_453,"column",_455,true):t.post(_453,"column");if(_44f>=1&&h>=1){var rect={x:_44e.l+ht(j+0.5)+gap,y:dim.height-_44e.b-(v>_450?vv:_451),width:_44f,height:h};var _458=this._plotFill(_457.series.fill,dim,_44e);_458=this._shapeFill(_458,rect);var _459=s.createRect(rect).setFill(_458).setStroke(_457.series.stroke);run.dyn.fill=_459.getFill();run.dyn.stroke=_459.getStroke();if(_452){var o={element:"column",index:j,run:run,shape:_459,x:j+0.5,y:v};this._connectEvents(o);_454[j]=o;}if(this.animate){this._animateColumn(_459,dim.height-_44e.b-_451,h);}}}}this._eventSeries[run.name]=_454;run.dirty=false;}this.dirty=false;return this;},_animateColumn:function(_45a,_45b,_45c){_6.gfx.fx.animateTransform(_4.delegate({shape:_45a,duration:1200,transform:[{name:"translate",start:[0,_45b-(_45b/_45c)],end:[0,0]},{name:"scale",start:[1,1/_45c],end:[1,1]},{name:"original"}]},this.animate)).play();}});})();}if(!_4._hasResource["dojox.charting.plot2d.StackedColumns"]){_4._hasResource["dojox.charting.plot2d.StackedColumns"]=true;_4.provide("dojox.charting.plot2d.StackedColumns");(function(){var df=_6.lang.functional,dc=_6.charting.plot2d.common,_45d=df.lambda("item.purgeGroup()");_4.declare("dojox.charting.plot2d.StackedColumns",_6.charting.plot2d.Columns,{getSeriesStats:function(){var _45e=dc.collectStackedStats(this.series);this._maxRunLength=_45e.hmax;_45e.hmin-=0.5;_45e.hmax+=0.5;return _45e;},render:function(dim,_45f){if(this._maxRunLength<=0){return this;}var acc=df.repeat(this._maxRunLength,"-> 0",0);for(var i=0;i<this.series.length;++i){var run=this.series[i];for(var j=0;j<run.data.length;++j){var _460=run.data[j];if(_460!==null){var v=typeof _460=="number"?_460:_460.y;if(isNaN(v)){v=0;}acc[j]+=v;}}}if(this.zoom&&!this.isDataDirty()){return this.performZoom(dim,_45f);}this.resetEvents();this.dirty=this.isDirty();if(this.dirty){_4.forEach(this.series,_45d);this._eventSeries={};this.cleanGroup();var s=this.group;df.forEachRev(this.series,function(item){item.cleanGroup(s);});}var t=this.chart.theme,f,gap,_461,ht=this._hScaler.scaler.getTransformerFromModel(this._hScaler),vt=this._vScaler.scaler.getTransformerFromModel(this._vScaler),_462=this.events();f=dc.calculateBarSize(this._hScaler.bounds.scale,this.opt);gap=f.gap;_461=f.size;for(var i=this.series.length-1;i>=0;--i){var run=this.series[i];if(!this.dirty&&!run.dirty){t.skip();this._reconnectEvents(run.name);continue;}run.cleanGroup();var _463=t.next("column",[this.opt,run]),s=run.group,_464=new Array(acc.length);for(var j=0;j<acc.length;++j){var _460=run.data[j];if(_460!==null){var v=acc[j],_465=vt(v),_466=typeof _460!="number"?t.addMixin(_463,"column",_460,true):t.post(_463,"column");if(_461>=1&&_465>=1){var rect={x:_45f.l+ht(j+0.5)+gap,y:dim.height-_45f.b-vt(v),width:_461,height:_465};var _467=this._plotFill(_466.series.fill,dim,_45f);_467=this._shapeFill(_467,rect);var _468=s.createRect(rect).setFill(_467).setStroke(_466.series.stroke);run.dyn.fill=_468.getFill();run.dyn.stroke=_468.getStroke();if(_462){var o={element:"column",index:j,run:run,shape:_468,x:j+0.5,y:v};this._connectEvents(o);_464[j]=o;}if(this.animate){this._animateColumn(_468,dim.height-_45f.b,_465);}}}}this._eventSeries[run.name]=_464;run.dirty=false;for(var j=0;j<run.data.length;++j){var _460=run.data[j];if(_460!==null){var v=typeof _460=="number"?_460:_460.y;if(isNaN(v)){v=0;}acc[j]-=v;}}}this.dirty=false;return this;}});})();}if(!_4._hasResource["dojox.charting.plot2d.ClusteredColumns"]){_4._hasResource["dojox.charting.plot2d.ClusteredColumns"]=true;_4.provide("dojox.charting.plot2d.ClusteredColumns");(function(){var df=_6.lang.functional,dc=_6.charting.plot2d.common,_469=df.lambda("item.purgeGroup()");_4.declare("dojox.charting.plot2d.ClusteredColumns",_6.charting.plot2d.Columns,{render:function(dim,_46a){if(this.zoom&&!this.isDataDirty()){return this.performZoom(dim,_46a);}this.resetEvents();this.dirty=this.isDirty();if(this.dirty){_4.forEach(this.series,_469);this._eventSeries={};this.cleanGroup();var s=this.group;df.forEachRev(this.series,function(item){item.cleanGroup(s);});}var t=this.chart.theme,f,gap,_46b,_46c,ht=this._hScaler.scaler.getTransformerFromModel(this._hScaler),vt=this._vScaler.scaler.getTransformerFromModel(this._vScaler),_46d=Math.max(0,this._vScaler.bounds.lower),_46e=vt(_46d),_46f=this.events();f=dc.calculateBarSize(this._hScaler.bounds.scale,this.opt,this.series.length);gap=f.gap;_46b=_46c=f.size;for(var i=0;i<this.series.length;++i){var run=this.series[i],_470=_46c*i;if(!this.dirty&&!run.dirty){t.skip();this._reconnectEvents(run.name);continue;}run.cleanGroup();var _471=t.next("column",[this.opt,run]),s=run.group,_472=new Array(run.data.length);for(var j=0;j<run.data.length;++j){var _473=run.data[j];if(_473!==null){var v=typeof _473=="number"?_473:_473.y,vv=vt(v),_474=vv-_46e,h=Math.abs(_474),_475=typeof _473!="number"?t.addMixin(_471,"column",_473,true):t.post(_471,"column");if(_46b>=1&&h>=1){var rect={x:_46a.l+ht(j+0.5)+gap+_470,y:dim.height-_46a.b-(v>_46d?vv:_46e),width:_46b,height:h};var _476=this._plotFill(_475.series.fill,dim,_46a);_476=this._shapeFill(_476,rect);var _477=s.createRect(rect).setFill(_476).setStroke(_475.series.stroke);run.dyn.fill=_477.getFill();run.dyn.stroke=_477.getStroke();if(_46f){var o={element:"column",index:j,run:run,shape:_477,x:j+0.5,y:v};this._connectEvents(o);_472[j]=o;}if(this.animate){this._animateColumn(_477,dim.height-_46a.b-_46e,h);}}}}this._eventSeries[run.name]=_472;run.dirty=false;}this.dirty=false;return this;}});})();}if(!_4._hasResource["dojox.charting.plot2d.Bars"]){_4._hasResource["dojox.charting.plot2d.Bars"]=true;_4.provide("dojox.charting.plot2d.Bars");(function(){var df=_6.lang.functional,du=_6.lang.utils,dc=_6.charting.plot2d.common,_478=df.lambda("item.purgeGroup()");_4.declare("dojox.charting.plot2d.Bars",_6.charting.plot2d.Base,{defaultParams:{hAxis:"x",vAxis:"y",gap:0,animate:null},optionalParams:{minBarSize:1,maxBarSize:1,stroke:{},outline:{},shadow:{},fill:{},font:"",fontColor:""},constructor:function(_479,_47a){this.opt=_4.clone(this.defaultParams);du.updateWithObject(this.opt,_47a);du.updateWithPattern(this.opt,_47a,this.optionalParams);this.series=[];this.hAxis=this.opt.hAxis;this.vAxis=this.opt.vAxis;this.animate=this.opt.animate;},getSeriesStats:function(){var _47b=dc.collectSimpleStats(this.series),t;_47b.hmin-=0.5;_47b.hmax+=0.5;t=_47b.hmin,_47b.hmin=_47b.vmin,_47b.vmin=t;t=_47b.hmax,_47b.hmax=_47b.vmax,_47b.vmax=t;return _47b;},render:function(dim,_47c){if(this.zoom&&!this.isDataDirty()){return this.performZoom(dim,_47c);}this.dirty=this.isDirty();this.resetEvents();if(this.dirty){_4.forEach(this.series,_478);this._eventSeries={};this.cleanGroup();var s=this.group;df.forEachRev(this.series,function(item){item.cleanGroup(s);});}var t=this.chart.theme,f,gap,_47d,ht=this._hScaler.scaler.getTransformerFromModel(this._hScaler),vt=this._vScaler.scaler.getTransformerFromModel(this._vScaler),_47e=Math.max(0,this._hScaler.bounds.lower),_47f=ht(_47e),_480=this.events();f=dc.calculateBarSize(this._vScaler.bounds.scale,this.opt);gap=f.gap;_47d=f.size;for(var i=this.series.length-1;i>=0;--i){var run=this.series[i];if(!this.dirty&&!run.dirty){t.skip();this._reconnectEvents(run.name);continue;}run.cleanGroup();var _481=t.next("bar",[this.opt,run]),s=run.group,_482=new Array(run.data.length);for(var j=0;j<run.data.length;++j){var _483=run.data[j];if(_483!==null){var v=typeof _483=="number"?_483:_483.y,hv=ht(v),_484=hv-_47f,w=Math.abs(_484),_485=typeof _483!="number"?t.addMixin(_481,"bar",_483,true):t.post(_481,"bar");if(w>=1&&_47d>=1){var rect={x:_47c.l+(v<_47e?hv:_47f),y:dim.height-_47c.b-vt(j+1.5)+gap,width:w,height:_47d};var _486=this._plotFill(_485.series.fill,dim,_47c);_486=this._shapeFill(_486,rect);var _487=s.createRect(rect).setFill(_486).setStroke(_485.series.stroke);run.dyn.fill=_487.getFill();run.dyn.stroke=_487.getStroke();if(_480){var o={element:"bar",index:j,run:run,shape:_487,x:v,y:j+1.5};this._connectEvents(o);_482[j]=o;}if(this.animate){this._animateBar(_487,_47c.l+_47f,-w);}}}}this._eventSeries[run.name]=_482;run.dirty=false;}this.dirty=false;return this;},_animateBar:function(_488,_489,_48a){_6.gfx.fx.animateTransform(_4.delegate({shape:_488,duration:1200,transform:[{name:"translate",start:[_489-(_489/_48a),0],end:[0,0]},{name:"scale",start:[1/_48a,1],end:[1,1]},{name:"original"}]},this.animate)).play();}});})();}if(!_4._hasResource["dojox.charting.plot2d.StackedBars"]){_4._hasResource["dojox.charting.plot2d.StackedBars"]=true;_4.provide("dojox.charting.plot2d.StackedBars");(function(){var df=_6.lang.functional,dc=_6.charting.plot2d.common,_48b=df.lambda("item.purgeGroup()");_4.declare("dojox.charting.plot2d.StackedBars",_6.charting.plot2d.Bars,{getSeriesStats:function(){var _48c=dc.collectStackedStats(this.series),t;this._maxRunLength=_48c.hmax;_48c.hmin-=0.5;_48c.hmax+=0.5;t=_48c.hmin,_48c.hmin=_48c.vmin,_48c.vmin=t;t=_48c.hmax,_48c.hmax=_48c.vmax,_48c.vmax=t;return _48c;},render:function(dim,_48d){if(this._maxRunLength<=0){return this;}var acc=df.repeat(this._maxRunLength,"-> 0",0);for(var i=0;i<this.series.length;++i){var run=this.series[i];for(var j=0;j<run.data.length;++j){var _48e=run.data[j];if(_48e!==null){var v=typeof _48e=="number"?_48e:_48e.y;if(isNaN(v)){v=0;}acc[j]+=v;}}}if(this.zoom&&!this.isDataDirty()){return this.performZoom(dim,_48d);}this.resetEvents();this.dirty=this.isDirty();if(this.dirty){_4.forEach(this.series,_48b);this._eventSeries={};this.cleanGroup();var s=this.group;df.forEachRev(this.series,function(item){item.cleanGroup(s);});}var t=this.chart.theme,f,gap,_48f,ht=this._hScaler.scaler.getTransformerFromModel(this._hScaler),vt=this._vScaler.scaler.getTransformerFromModel(this._vScaler),_490=this.events();f=dc.calculateBarSize(this._vScaler.bounds.scale,this.opt);gap=f.gap;_48f=f.size;for(var i=this.series.length-1;i>=0;--i){var run=this.series[i];if(!this.dirty&&!run.dirty){t.skip();this._reconnectEvents(run.name);continue;}run.cleanGroup();var _491=t.next("bar",[this.opt,run]),s=run.group,_492=new Array(acc.length);for(var j=0;j<acc.length;++j){var _48e=run.data[j];if(_48e!==null){var v=acc[j],_493=ht(v),_494=typeof _48e!="number"?t.addMixin(_491,"bar",_48e,true):t.post(_491,"bar");if(_493>=1&&_48f>=1){var rect={x:_48d.l,y:dim.height-_48d.b-vt(j+1.5)+gap,width:_493,height:_48f};var _495=this._plotFill(_494.series.fill,dim,_48d);_495=this._shapeFill(_495,rect);var _496=s.createRect(rect).setFill(_495).setStroke(_494.series.stroke);run.dyn.fill=_496.getFill();run.dyn.stroke=_496.getStroke();if(_490){var o={element:"bar",index:j,run:run,shape:_496,x:v,y:j+1.5};this._connectEvents(o);_492[j]=o;}if(this.animate){this._animateBar(_496,_48d.l,-_493);}}}}this._eventSeries[run.name]=_492;run.dirty=false;for(var j=0;j<run.data.length;++j){var _48e=run.data[j];if(_48e!==null){var v=typeof _48e=="number"?_48e:_48e.y;if(isNaN(v)){v=0;}acc[j]-=v;}}}this.dirty=false;return this;}});})();}if(!_4._hasResource["dojox.charting.plot2d.ClusteredBars"]){_4._hasResource["dojox.charting.plot2d.ClusteredBars"]=true;_4.provide("dojox.charting.plot2d.ClusteredBars");(function(){var df=_6.lang.functional,dc=_6.charting.plot2d.common,_497=df.lambda("item.purgeGroup()");_4.declare("dojox.charting.plot2d.ClusteredBars",_6.charting.plot2d.Bars,{render:function(dim,_498){if(this.zoom&&!this.isDataDirty()){return this.performZoom(dim,_498);}this.resetEvents();this.dirty=this.isDirty();if(this.dirty){_4.forEach(this.series,_497);this._eventSeries={};this.cleanGroup();var s=this.group;df.forEachRev(this.series,function(item){item.cleanGroup(s);});}var t=this.chart.theme,f,gap,_499,_49a,ht=this._hScaler.scaler.getTransformerFromModel(this._hScaler),vt=this._vScaler.scaler.getTransformerFromModel(this._vScaler),_49b=Math.max(0,this._hScaler.bounds.lower),_49c=ht(_49b),_49d=this.events();f=dc.calculateBarSize(this._vScaler.bounds.scale,this.opt,this.series.length);gap=f.gap;_499=_49a=f.size;for(var i=this.series.length-1;i>=0;--i){var run=this.series[i],_49e=_49a*(this.series.length-i-1);if(!this.dirty&&!run.dirty){t.skip();this._reconnectEvents(run.name);continue;}run.cleanGroup();var _49f=t.next("bar",[this.opt,run]),s=run.group,_4a0=new Array(run.data.length);for(var j=0;j<run.data.length;++j){var _4a1=run.data[j];if(_4a1!==null){var v=typeof _4a1=="number"?_4a1:_4a1.y,hv=ht(v),_4a2=hv-_49c,w=Math.abs(_4a2),_4a3=typeof _4a1!="number"?t.addMixin(_49f,"bar",_4a1,true):t.post(_49f,"bar");if(w>=1&&_499>=1){var rect={x:_498.l+(v<_49b?hv:_49c),y:dim.height-_498.b-vt(j+1.5)+gap+_49e,width:w,height:_499};var _4a4=this._plotFill(_4a3.series.fill,dim,_498);_4a4=this._shapeFill(_4a4,rect);var _4a5=s.createRect(rect).setFill(_4a4).setStroke(_4a3.series.stroke);run.dyn.fill=_4a5.getFill();run.dyn.stroke=_4a5.getStroke();if(_49d){var o={element:"bar",index:j,run:run,shape:_4a5,x:v,y:j+1.5};this._connectEvents(o);_4a0[j]=o;}if(this.animate){this._animateBar(_4a5,_498.l+_49c,-_4a2);}}}}this._eventSeries[run.name]=_4a0;run.dirty=false;}this.dirty=false;return this;}});})();}if(!_4._hasResource["dojox.charting.plot2d.Grid"]){_4._hasResource["dojox.charting.plot2d.Grid"]=true;_4.provide("dojox.charting.plot2d.Grid");(function(){var du=_6.lang.utils,dc=_6.charting.plot2d.common;_4.declare("dojox.charting.plot2d.Grid",_6.charting.Element,{defaultParams:{hAxis:"x",vAxis:"y",hMajorLines:true,hMinorLines:false,vMajorLines:true,vMinorLines:false,hStripes:"none",vStripes:"none",animate:null},optionalParams:{},constructor:function(_4a6,_4a7){this.opt=_4.clone(this.defaultParams);du.updateWithObject(this.opt,_4a7);this.hAxis=this.opt.hAxis;this.vAxis=this.opt.vAxis;this.dirty=true;this.animate=this.opt.animate;this.zoom=null,this.zoomQueue=[];this.lastWindow={vscale:1,hscale:1,xoffset:0,yoffset:0};},clear:function(){this._hAxis=null;this._vAxis=null;this.dirty=true;return this;},setAxis:function(axis){if(axis){this[axis.vertical?"_vAxis":"_hAxis"]=axis;}return this;},addSeries:function(run){return this;},getSeriesStats:function(){return _4.delegate(dc.defaultStats);},initializeScalers:function(){return this;},isDirty:function(){return this.dirty||this._hAxis&&this._hAxis.dirty||this._vAxis&&this._vAxis.dirty;},performZoom:function(dim,_4a8){var vs=this._vAxis.scale||1,hs=this._hAxis.scale||1,_4a9=dim.height-_4a8.b,_4aa=this._hAxis.getScaler().bounds,_4ab=(_4aa.from-_4aa.lower)*_4aa.scale,_4ac=this._vAxis.getScaler().bounds,_4ad=(_4ac.from-_4ac.lower)*_4ac.scale;rVScale=vs/this.lastWindow.vscale,rHScale=hs/this.lastWindow.hscale,rXOffset=(this.lastWindow.xoffset-_4ab)/((this.lastWindow.hscale==1)?hs:this.lastWindow.hscale),rYOffset=(_4ad-this.lastWindow.yoffset)/((this.lastWindow.vscale==1)?vs:this.lastWindow.vscale),shape=this.group,anim=_6.gfx.fx.animateTransform(_4.delegate({shape:shape,duration:1200,transform:[{name:"translate",start:[0,0],end:[_4a8.l*(1-rHScale),_4a9*(1-rVScale)]},{name:"scale",start:[1,1],end:[rHScale,rVScale]},{name:"original"},{name:"translate",start:[0,0],end:[rXOffset,rYOffset]}]},this.zoom));_4.mixin(this.lastWindow,{vscale:vs,hscale:hs,xoffset:_4ab,yoffset:_4ad});this.zoomQueue.push(anim);_4.connect(anim,"onEnd",this,function(){this.zoom=null;this.zoomQueue.shift();if(this.zoomQueue.length>0){this.zoomQueue[0].play();}});if(this.zoomQueue.length==1){this.zoomQueue[0].play();}return this;},getRequiredColors:function(){return 0;},render:function(dim,_4ae){if(this.zoom){return this.performZoom(dim,_4ae);}this.dirty=this.isDirty();if(!this.dirty){return this;}this.cleanGroup();var s=this.group,ta=this.chart.theme.axis;try{var _4af=this._vAxis.getScaler(),vt=_4af.scaler.getTransformerFromModel(_4af),_4b0=this._vAxis.getTicks();if(this.opt.hMinorLines){_4.forEach(_4b0.minor,function(tick){var y=dim.height-_4ae.b-vt(tick.value);var _4b1=s.createLine({x1:_4ae.l,y1:y,x2:dim.width-_4ae.r,y2:y}).setStroke(ta.minorTick);if(this.animate){this._animateGrid(_4b1,"h",_4ae.l,_4ae.r+_4ae.l-dim.width);}},this);}if(this.opt.hMajorLines){_4.forEach(_4b0.major,function(tick){var y=dim.height-_4ae.b-vt(tick.value);var _4b2=s.createLine({x1:_4ae.l,y1:y,x2:dim.width-_4ae.r,y2:y}).setStroke(ta.majorTick);if(this.animate){this._animateGrid(_4b2,"h",_4ae.l,_4ae.r+_4ae.l-dim.width);}},this);}}catch(e){}try{var _4b3=this._hAxis.getScaler(),ht=_4b3.scaler.getTransformerFromModel(_4b3),_4b0=this._hAxis.getTicks();if(_4b0&&this.opt.vMinorLines){_4.forEach(_4b0.minor,function(tick){var x=_4ae.l+ht(tick.value);var _4b4=s.createLine({x1:x,y1:_4ae.t,x2:x,y2:dim.height-_4ae.b}).setStroke(ta.minorTick);if(this.animate){this._animateGrid(_4b4,"v",dim.height-_4ae.b,dim.height-_4ae.b-_4ae.t);}},this);}if(_4b0&&this.opt.vMajorLines){_4.forEach(_4b0.major,function(tick){var x=_4ae.l+ht(tick.value);var _4b5=s.createLine({x1:x,y1:_4ae.t,x2:x,y2:dim.height-_4ae.b}).setStroke(ta.majorTick);if(this.animate){this._animateGrid(_4b5,"v",dim.height-_4ae.b,dim.height-_4ae.b-_4ae.t);}},this);}}catch(e){}this.dirty=false;return this;},_animateGrid:function(_4b6,type,_4b7,size){var _4b8=type=="h"?[_4b7,0]:[0,_4b7];var _4b9=type=="h"?[1/size,1]:[1,1/size];_6.gfx.fx.animateTransform(_4.delegate({shape:_4b6,duration:1200,transform:[{name:"translate",start:_4b8,end:[0,0]},{name:"scale",start:_4b9,end:[1,1]},{name:"original"}]},this.animate)).play();}});})();}if(!_4._hasResource["dojox.charting.plot2d.Pie"]){_4._hasResource["dojox.charting.plot2d.Pie"]=true;_4.provide("dojox.charting.plot2d.Pie");(function(){var df=_6.lang.functional,du=_6.lang.utils,dc=_6.charting.plot2d.common,da=_6.charting.axis2d.common,g=_6.gfx,m=g.matrix,_4ba=0.2;_4.declare("dojox.charting.plot2d.Pie",[_6.charting.Element,_6.charting.plot2d._PlotEvents],{defaultParams:{labels:true,ticks:false,fixed:true,precision:1,labelOffset:20,labelStyle:"default",htmlLabels:true,radGrad:"native",fanSize:5,startAngle:0},optionalParams:{radius:0,stroke:{},outline:{},shadow:{},fill:{},font:"",fontColor:"",labelWiring:{}},constructor:function(_4bb,_4bc){this.opt=_4.clone(this.defaultParams);du.updateWithObject(this.opt,_4bc);du.updateWithPattern(this.opt,_4bc,this.optionalParams);this.run=null;this.dyn=[];},clear:function(){this.dirty=true;this.dyn=[];this.run=null;return this;},setAxis:function(axis){return this;},addSeries:function(run){this.run=run;return this;},getSeriesStats:function(){return _4.delegate(dc.defaultStats);},initializeScalers:function(){return this;},getRequiredColors:function(){return this.run?this.run.data.length:0;},render:function(dim,_4bd){if(!this.dirty){return this;}this.resetEvents();this.dirty=false;this._eventSeries={};this.cleanGroup();var s=this.group,t=this.chart.theme;if(!this.run||!this.run.data.length){return this;}var rx=(dim.width-_4bd.l-_4bd.r)/2,ry=(dim.height-_4bd.t-_4bd.b)/2,r=Math.min(rx,ry),_4be="font" in this.opt?this.opt.font:t.axis.font,size=_4be?g.normalizedLength(g.splitFontString(_4be).size):0,_4bf="fontColor" in this.opt?this.opt.fontColor:t.axis.fontColor,_4c0=m._degToRad(this.opt.startAngle),_4c1=_4c0,step,_4c2,_4c3,_4c4,_4c5,_4c6,run=this.run.data,_4c7=this.events();if(typeof run[0]=="number"){_4c2=df.map(run,"x ? Math.max(x, 0) : 0");if(df.every(_4c2,"<= 0")){return this;}_4c3=df.map(_4c2,"/this",df.foldl(_4c2,"+",0));if(this.opt.labels){_4c4=_4.map(_4c3,function(x){return x>0?this._getLabel(x*100)+"%":"";},this);}}else{_4c2=df.map(run,"x ? Math.max(x.y, 0) : 0");if(df.every(_4c2,"<= 0")){return this;}_4c3=df.map(_4c2,"/this",df.foldl(_4c2,"+",0));if(this.opt.labels){_4c4=_4.map(_4c3,function(x,i){if(x<=0){return "";}var v=run[i];return "text" in v?v.text:this._getLabel(x*100)+"%";},this);}}var _4c8=df.map(run,function(v,i){if(v===null||typeof v=="number"){return t.next("slice",[this.opt,this.run],true);}return t.next("slice",[this.opt,this.run,v],true);},this);if(this.opt.labels){_4c5=df.foldl1(df.map(_4c4,function(_4c9,i){var font=_4c8[i].series.font;return _6.gfx._base._getTextBox(_4c9,{font:font}).w;},this),"Math.max(a, b)")/2;if(this.opt.labelOffset<0){r=Math.min(rx-2*_4c5,ry-size)+this.opt.labelOffset;}_4c6=r-this.opt.labelOffset;}if("radius" in this.opt){r=this.opt.radius;_4c6=r-this.opt.labelOffset;}var _4ca={cx:_4bd.l+rx,cy:_4bd.t+ry,r:r};this.dyn=[];var _4cb=new Array(_4c3.length);_4.some(_4c3,function(_4cc,i){if(_4cc<0){return false;}if(_4cc==0){this.dyn.push({fill:null,stroke:null});return false;}var v=run[i],_4cd=_4c8[i],_4ce;if(_4cc>=1){_4ce=this._plotFill(_4cd.series.fill,dim,_4bd);_4ce=this._shapeFill(_4ce,{x:_4ca.cx-_4ca.r,y:_4ca.cy-_4ca.r,width:2*_4ca.r,height:2*_4ca.r});_4ce=this._pseudoRadialFill(_4ce,{x:_4ca.cx,y:_4ca.cy},_4ca.r);var _4cf=s.createCircle(_4ca).setFill(_4ce).setStroke(_4cd.series.stroke);this.dyn.push({fill:_4ce,stroke:_4cd.series.stroke});if(_4c7){var o={element:"slice",index:i,run:this.run,shape:_4cf,x:i,y:typeof v=="number"?v:v.y,cx:_4ca.cx,cy:_4ca.cy,cr:r};this._connectEvents(o);_4cb[i]=o;}return true;}var end=_4c1+_4cc*2*Math.PI;if(i+1==_4c3.length){end=_4c0+2*Math.PI;}var step=end-_4c1,x1=_4ca.cx+r*Math.cos(_4c1),y1=_4ca.cy+r*Math.sin(_4c1),x2=_4ca.cx+r*Math.cos(end),y2=_4ca.cy+r*Math.sin(end);var _4d0=m._degToRad(this.opt.fanSize);if(_4cd.series.fill&&_4cd.series.fill.type==="radial"&&this.opt.radGrad==="fan"&&step>_4d0){var _4d1=s.createGroup(),_4d2=Math.ceil(step/_4d0),_4d3=step/_4d2;_4ce=this._shapeFill(_4cd.series.fill,{x:_4ca.cx-_4ca.r,y:_4ca.cy-_4ca.r,width:2*_4ca.r,height:2*_4ca.r});for(var j=0;j<_4d2;++j){var _4d4=j==0?x1:_4ca.cx+r*Math.cos(_4c1+(j-_4ba)*_4d3),_4d5=j==0?y1:_4ca.cy+r*Math.sin(_4c1+(j-_4ba)*_4d3),_4d6=j==_4d2-1?x2:_4ca.cx+r*Math.cos(_4c1+(j+1+_4ba)*_4d3),_4d7=j==_4d2-1?y2:_4ca.cy+r*Math.sin(_4c1+(j+1+_4ba)*_4d3),fan=_4d1.createPath({}).moveTo(_4ca.cx,_4ca.cy).lineTo(_4d4,_4d5).arcTo(r,r,0,_4d3>Math.PI,true,_4d6,_4d7).lineTo(_4ca.cx,_4ca.cy).closePath().setFill(this._pseudoRadialFill(_4ce,{x:_4ca.cx,y:_4ca.cy},r,_4c1+(j+0.5)*_4d3,_4c1+(j+0.5)*_4d3));}_4d1.createPath({}).moveTo(_4ca.cx,_4ca.cy).lineTo(x1,y1).arcTo(r,r,0,step>Math.PI,true,x2,y2).lineTo(_4ca.cx,_4ca.cy).closePath().setStroke(_4cd.series.stroke);_4cf=_4d1;}else{_4cf=s.createPath({}).moveTo(_4ca.cx,_4ca.cy).lineTo(x1,y1).arcTo(r,r,0,step>Math.PI,true,x2,y2).lineTo(_4ca.cx,_4ca.cy).closePath().setStroke(_4cd.series.stroke);var _4ce=_4cd.series.fill;if(_4ce&&_4ce.type==="radial"){_4ce=this._shapeFill(_4ce,{x:_4ca.cx-_4ca.r,y:_4ca.cy-_4ca.r,width:2*_4ca.r,height:2*_4ca.r});if(this.opt.radGrad==="linear"){_4ce=this._pseudoRadialFill(_4ce,{x:_4ca.cx,y:_4ca.cy},r,_4c1,end);}}else{if(_4ce&&_4ce.type==="linear"){_4ce=this._plotFill(_4ce,dim,_4bd);_4ce=this._shapeFill(_4ce,_4cf.getBoundingBox());}}_4cf.setFill(_4ce);}this.dyn.push({fill:_4ce,stroke:_4cd.series.stroke});if(_4c7){var o={element:"slice",index:i,run:this.run,shape:_4cf,x:i,y:typeof v=="number"?v:v.y,cx:_4ca.cx,cy:_4ca.cy,cr:r};this._connectEvents(o);_4cb[i]=o;}_4c1=end;return false;},this);if(this.opt.labels){if(this.opt.labelStyle=="default"){_4c1=_4c0;_4.some(_4c3,function(_4d8,i){if(_4d8<=0){return false;}var _4d9=_4c8[i];if(_4d8>=1){var v=run[i],elem=da.createText[this.opt.htmlLabels&&_6.gfx.renderer!="vml"?"html":"gfx"](this.chart,s,_4ca.cx,_4ca.cy+size/2,"middle",_4c4[i],_4d9.series.font,_4d9.series.fontColor);if(this.opt.htmlLabels){this.htmlElements.push(elem);}return true;}var end=_4c1+_4d8*2*Math.PI,v=run[i];if(i+1==_4c3.length){end=_4c0+2*Math.PI;}var _4da=(_4c1+end)/2,x=_4ca.cx+_4c6*Math.cos(_4da),y=_4ca.cy+_4c6*Math.sin(_4da)+size/2;var elem=da.createText[this.opt.htmlLabels&&_6.gfx.renderer!="vml"?"html":"gfx"](this.chart,s,x,y,"middle",_4c4[i],_4d9.series.font,_4d9.series.fontColor);if(this.opt.htmlLabels){this.htmlElements.push(elem);}_4c1=end;return false;},this);}else{if(this.opt.labelStyle=="columns"){_4c1=_4c0;var _4db=[];_4.forEach(_4c3,function(_4dc,i){var end=_4c1+_4dc*2*Math.PI;if(i+1==_4c3.length){end=_4c0+2*Math.PI;}var _4dd=(_4c1+end)/2;_4db.push({angle:_4dd,left:Math.cos(_4dd)<0,theme:_4c8[i],index:i,omit:end-_4c1<0.001});_4c1=end;});var _4de=_6.gfx._base._getTextBox("a",{font:_4be}).h;this._getProperLabelRadius(_4db,_4de,_4ca.r*1.1);_4.forEach(_4db,function(_4df,i){if(!_4df.omit){var _4e0=_4ca.cx-_4ca.r*2,_4e1=_4ca.cx+_4ca.r*2,_4e2=_6.gfx._base._getTextBox(_4c4[i],{font:_4be}).w,x=_4ca.cx+_4df.labelR*Math.cos(_4df.angle),y=_4ca.cy+_4df.labelR*Math.sin(_4df.angle),_4e3=(_4df.left)?(_4e0+_4e2):(_4e1-_4e2),_4e4=(_4df.left)?_4e0:_4e3;var _4e5=s.createPath().moveTo(_4ca.cx+_4ca.r*Math.cos(_4df.angle),_4ca.cy+_4ca.r*Math.sin(_4df.angle));if(Math.abs(_4df.labelR*Math.cos(_4df.angle))<_4ca.r*2-_4e2){_4e5.lineTo(x,y);}_4e5.lineTo(_4e3,y).setStroke(_4df.theme.series.labelWiring);var elem=da.createText[this.opt.htmlLabels&&_6.gfx.renderer!="vml"?"html":"gfx"](this.chart,s,_4e4,y,"left",_4c4[i],_4df.theme.series.font,_4df.theme.series.fontColor);if(this.opt.htmlLabels){this.htmlElements.push(elem);}}},this);}}}var esi=0;this._eventSeries[this.run.name]=df.map(run,function(v){return v<=0?null:_4cb[esi++];});return this;},_getProperLabelRadius:function(_4e6,_4e7,_4e8){var _4e9={},_4ea={},_4eb=1,_4ec=1;if(_4e6.length==1){_4e6[0].labelR=_4e8;return;}for(var i=0;i<_4e6.length;i++){var _4ed=Math.abs(Math.sin(_4e6[i].angle));if(_4e6[i].left){if(_4eb>_4ed){_4eb=_4ed;_4e9=_4e6[i];}}else{if(_4ec>_4ed){_4ec=_4ed;_4ea=_4e6[i];}}}_4e9.labelR=_4ea.labelR=_4e8;this._caculateLabelR(_4e9,_4e6,_4e7);this._caculateLabelR(_4ea,_4e6,_4e7);},_caculateLabelR:function(_4ee,_4ef,_4f0){var i=_4ee.index,_4f1=_4ef.length,_4f2=_4ee.labelR;while(!(_4ef[i%_4f1].left^_4ef[(i+1)%_4f1].left)){if(!_4ef[(i+1)%_4f1].omit){var _4f3=(Math.sin(_4ef[i%_4f1].angle)*_4f2+((_4ef[i%_4f1].left)?(-_4f0):_4f0))/Math.sin(_4ef[(i+1)%_4f1].angle);_4f2=(_4f3<_4ee.labelR)?_4ee.labelR:_4f3;_4ef[(i+1)%_4f1].labelR=_4f2;}i++;}i=_4ee.index,j=(i==0)?_4f1-1:i-1;while(!(_4ef[i].left^_4ef[j].left)){if(!_4ef[j].omit){var _4f3=(Math.sin(_4ef[i].angle)*_4f2+((_4ef[i].left)?_4f0:(-_4f0)))/Math.sin(_4ef[j].angle);_4f2=(_4f3<_4ee.labelR)?_4ee.labelR:_4f3;_4ef[j].labelR=_4f2;}i--;j--;i=(i<0)?i+_4ef.length:i;j=(j<0)?j+_4ef.length:j;}},_getLabel:function(_4f4){return dc.getLabel(_4f4,this.opt.fixed,this.opt.precision);}});})();}if(!_4._hasResource["dojox.charting.plot2d.Bubble"]){_4._hasResource["dojox.charting.plot2d.Bubble"]=true;_4.provide("dojox.charting.plot2d.Bubble");(function(){var df=_6.lang.functional,du=_6.lang.utils,dc=_6.charting.plot2d.common,_4f5=df.lambda("item.purgeGroup()");_4.declare("dojox.charting.plot2d.Bubble",_6.charting.plot2d.Base,{defaultParams:{hAxis:"x",vAxis:"y",animate:null},optionalParams:{stroke:{},outline:{},shadow:{},fill:{},font:"",fontColor:""},constructor:function(_4f6,_4f7){this.opt=_4.clone(this.defaultParams);du.updateWithObject(this.opt,_4f7);du.updateWithPattern(this.opt,_4f7,this.optionalParams);this.series=[];this.hAxis=this.opt.hAxis;this.vAxis=this.opt.vAxis;this.animate=this.opt.animate;},render:function(dim,_4f8){if(this.zoom&&!this.isDataDirty()){return this.performZoom(dim,_4f8);}this.resetEvents();this.dirty=this.isDirty();if(this.dirty){_4.forEach(this.series,_4f5);this._eventSeries={};this.cleanGroup();var s=this.group;df.forEachRev(this.series,function(item){item.cleanGroup(s);});}var t=this.chart.theme,ht=this._hScaler.scaler.getTransformerFromModel(this._hScaler),vt=this._vScaler.scaler.getTransformerFromModel(this._vScaler),_4f9=this.events();for(var i=this.series.length-1;i>=0;--i){var run=this.series[i];if(!this.dirty&&!run.dirty){t.skip();this._reconnectEvents(run.name);continue;}run.cleanGroup();if(!run.data.length){run.dirty=false;t.skip();continue;}if(typeof run.data[0]=="number"){console.warn("dojox.charting.plot2d.Bubble: the data in the following series cannot be rendered as a bubble chart; ",run);continue;}var _4fa=t.next("circle",[this.opt,run]),s=run.group,_4fb=_4.map(run.data,function(v,i){return v?{x:ht(v.x)+_4f8.l,y:dim.height-_4f8.b-vt(v.y),radius:this._vScaler.bounds.scale*(v.size/2)}:null;},this);var _4fc=null,_4fd=null,_4fe=null;if(_4fa.series.shadow){_4fe=_4.map(_4fb,function(item){if(item!==null){var _4ff=t.addMixin(_4fa,"circle",item,true),_500=_4ff.series.shadow;var _501=s.createCircle({cx:item.x+_500.dx,cy:item.y+_500.dy,r:item.radius}).setStroke(_500).setFill(_500.color);if(this.animate){this._animateBubble(_501,dim.height-_4f8.b,item.radius);}return _501;}return null;},this);if(_4fe.length){run.dyn.shadow=_4fe[_4fe.length-1].getStroke();}}if(_4fa.series.outline){_4fd=_4.map(_4fb,function(item){if(item!==null){var _502=t.addMixin(_4fa,"circle",item,true),_503=dc.makeStroke(_502.series.outline);_503.width=2*_503.width+_4fa.series.stroke.width;var _504=s.createCircle({cx:item.x,cy:item.y,r:item.radius}).setStroke(_503);if(this.animate){this._animateBubble(_504,dim.height-_4f8.b,item.radius);}return _504;}return null;},this);if(_4fd.length){run.dyn.outline=_4fd[_4fd.length-1].getStroke();}}_4fc=_4.map(_4fb,function(item){if(item!==null){var _505=t.addMixin(_4fa,"circle",item,true),rect={x:item.x-item.radius,y:item.y-item.radius,width:2*item.radius,height:2*item.radius};var _506=this._plotFill(_505.series.fill,dim,_4f8);_506=this._shapeFill(_506,rect);var _507=s.createCircle({cx:item.x,cy:item.y,r:item.radius}).setFill(_506).setStroke(_505.series.stroke);if(this.animate){this._animateBubble(_507,dim.height-_4f8.b,item.radius);}return _507;}return null;},this);if(_4fc.length){run.dyn.fill=_4fc[_4fc.length-1].getFill();run.dyn.stroke=_4fc[_4fc.length-1].getStroke();}if(_4f9){var _508=new Array(_4fc.length);_4.forEach(_4fc,function(s,i){if(s!==null){var o={element:"circle",index:i,run:run,shape:s,outline:_4fd&&_4fd[i]||null,shadow:_4fe&&_4fe[i]||null,x:run.data[i].x,y:run.data[i].y,r:run.data[i].size/2,cx:_4fb[i].x,cy:_4fb[i].y,cr:_4fb[i].radius};this._connectEvents(o);_508[i]=o;}},this);this._eventSeries[run.name]=_508;}else{delete this._eventSeries[run.name];}run.dirty=false;}this.dirty=false;return this;},_animateBubble:function(_509,_50a,size){_6.gfx.fx.animateTransform(_4.delegate({shape:_509,duration:1200,transform:[{name:"translate",start:[0,_50a],end:[0,0]},{name:"scale",start:[0,1/size],end:[1,1]},{name:"original"}]},this.animate)).play();}});})();}if(!_4._hasResource["dojox.charting.plot2d.Candlesticks"]){_4._hasResource["dojox.charting.plot2d.Candlesticks"]=true;_4.provide("dojox.charting.plot2d.Candlesticks");(function(){var df=_6.lang.functional,du=_6.lang.utils,dc=_6.charting.plot2d.common,_50b=df.lambda("item.purgeGroup()");_4.declare("dojox.charting.plot2d.Candlesticks",_6.charting.plot2d.Base,{defaultParams:{hAxis:"x",vAxis:"y",gap:2,animate:null},optionalParams:{minBarSize:1,maxBarSize:1,stroke:{},outline:{},shadow:{},fill:{},font:"",fontColor:""},constructor:function(_50c,_50d){this.opt=_4.clone(this.defaultParams);du.updateWithObject(this.opt,_50d);du.updateWithPattern(this.opt,_50d,this.optionalParams);this.series=[];this.hAxis=this.opt.hAxis;this.vAxis=this.opt.vAxis;this.animate=this.opt.animate;},collectStats:function(_50e){var _50f=_4.delegate(dc.defaultStats);for(var i=0;i<_50e.length;i++){var run=_50e[i];if(!run.data.length){continue;}var _510=_50f.vmin,_511=_50f.vmax;if(!("ymin" in run)||!("ymax" in run)){_4.forEach(run.data,function(val,idx){if(val!==null){var x=val.x||idx+1;_50f.hmin=Math.min(_50f.hmin,x);_50f.hmax=Math.max(_50f.hmax,x);_50f.vmin=Math.min(_50f.vmin,val.open,val.close,val.high,val.low);_50f.vmax=Math.max(_50f.vmax,val.open,val.close,val.high,val.low);}});}if("ymin" in run){_50f.vmin=Math.min(_510,run.ymin);}if("ymax" in run){_50f.vmax=Math.max(_511,run.ymax);}}return _50f;},getSeriesStats:function(){var _512=this.collectStats(this.series);_512.hmin-=0.5;_512.hmax+=0.5;return _512;},render:function(dim,_513){if(this.zoom&&!this.isDataDirty()){return this.performZoom(dim,_513);}this.resetEvents();this.dirty=this.isDirty();if(this.dirty){_4.forEach(this.series,_50b);this._eventSeries={};this.cleanGroup();var s=this.group;df.forEachRev(this.series,function(item){item.cleanGroup(s);});}var t=this.chart.theme,f,gap,_514,ht=this._hScaler.scaler.getTransformerFromModel(this._hScaler),vt=this._vScaler.scaler.getTransformerFromModel(this._vScaler),_515=Math.max(0,this._vScaler.bounds.lower),_516=vt(_515),_517=this.events();f=dc.calculateBarSize(this._hScaler.bounds.scale,this.opt);gap=f.gap;_514=f.size;for(var i=this.series.length-1;i>=0;--i){var run=this.series[i];if(!this.dirty&&!run.dirty){t.skip();this._reconnectEvents(run.name);continue;}run.cleanGroup();var _518=t.next("candlestick",[this.opt,run]),s=run.group,_519=new Array(run.data.length);for(var j=0;j<run.data.length;++j){var v=run.data[j];if(v!==null){var _51a=t.addMixin(_518,"candlestick",v,true);var x=ht(v.x||(j+0.5))+_513.l+gap,y=dim.height-_513.b,open=vt(v.open),_51b=vt(v.close),high=vt(v.high),low=vt(v.low);if("mid" in v){var mid=vt(v.mid);}if(low>high){var tmp=high;high=low;low=tmp;}if(_514>=1){var _51c=open>_51b;var line={x1:_514/2,x2:_514/2,y1:y-high,y2:y-low},rect={x:0,y:y-Math.max(open,_51b),width:_514,height:Math.max(_51c?open-_51b:_51b-open,1)};shape=s.createGroup();shape.setTransform({dx:x,dy:0});var _51d=shape.createGroup();_51d.createLine(line).setStroke(_51a.series.stroke);_51d.createRect(rect).setStroke(_51a.series.stroke).setFill(_51c?_51a.series.fill:"white");if("mid" in v){_51d.createLine({x1:(_51a.series.stroke.width||1),x2:_514-(_51a.series.stroke.width||1),y1:y-mid,y2:y-mid}).setStroke(_51c?"white":_51a.series.stroke);}run.dyn.fill=_51a.series.fill;run.dyn.stroke=_51a.series.stroke;if(_517){var o={element:"candlestick",index:j,run:run,shape:_51d,x:x,y:y-Math.max(open,_51b),cx:_514/2,cy:(y-Math.max(open,_51b))+(Math.max(_51c?open-_51b:_51b-open,1)/2),width:_514,height:Math.max(_51c?open-_51b:_51b-open,1),data:v};this._connectEvents(o);_519[j]=o;}}if(this.animate){this._animateCandlesticks(shape,y-low,high-low);}}}this._eventSeries[run.name]=_519;run.dirty=false;}this.dirty=false;return this;},_animateCandlesticks:function(_51e,_51f,_520){_6.gfx.fx.animateTransform(_4.delegate({shape:_51e,duration:1200,transform:[{name:"translate",start:[0,_51f-(_51f/_520)],end:[0,0]},{name:"scale",start:[1,1/_520],end:[1,1]},{name:"original"}]},this.animate)).play();}});})();}if(!_4._hasResource["dojox.charting.plot2d.OHLC"]){_4._hasResource["dojox.charting.plot2d.OHLC"]=true;_4.provide("dojox.charting.plot2d.OHLC");(function(){var df=_6.lang.functional,du=_6.lang.utils,dc=_6.charting.plot2d.common,_521=df.lambda("item.purgeGroup()");_4.declare("dojox.charting.plot2d.OHLC",_6.charting.plot2d.Base,{defaultParams:{hAxis:"x",vAxis:"y",gap:2,animate:null},optionalParams:{minBarSize:1,maxBarSize:1,stroke:{},outline:{},shadow:{},fill:{},font:"",fontColor:""},constructor:function(_522,_523){this.opt=_4.clone(this.defaultParams);du.updateWithObject(this.opt,_523);du.updateWithPattern(this.opt,_523,this.optionalParams);this.series=[];this.hAxis=this.opt.hAxis;this.vAxis=this.opt.vAxis;this.animate=this.opt.animate;},collectStats:function(_524){var _525=_4.delegate(dc.defaultStats);for(var i=0;i<_524.length;i++){var run=_524[i];if(!run.data.length){continue;}var _526=_525.vmin,_527=_525.vmax;if(!("ymin" in run)||!("ymax" in run)){_4.forEach(run.data,function(val,idx){if(val!==null){var x=val.x||idx+1;_525.hmin=Math.min(_525.hmin,x);_525.hmax=Math.max(_525.hmax,x);_525.vmin=Math.min(_525.vmin,val.open,val.close,val.high,val.low);_525.vmax=Math.max(_525.vmax,val.open,val.close,val.high,val.low);}});}if("ymin" in run){_525.vmin=Math.min(_526,run.ymin);}if("ymax" in run){_525.vmax=Math.max(_527,run.ymax);}}return _525;},getSeriesStats:function(){var _528=this.collectStats(this.series);_528.hmin-=0.5;_528.hmax+=0.5;return _528;},render:function(dim,_529){if(this.zoom&&!this.isDataDirty()){return this.performZoom(dim,_529);}this.resetEvents();this.dirty=this.isDirty();if(this.dirty){_4.forEach(this.series,_521);this._eventSeries={};this.cleanGroup();var s=this.group;df.forEachRev(this.series,function(item){item.cleanGroup(s);});}var t=this.chart.theme,f,gap,_52a,ht=this._hScaler.scaler.getTransformerFromModel(this._hScaler),vt=this._vScaler.scaler.getTransformerFromModel(this._vScaler),_52b=Math.max(0,this._vScaler.bounds.lower),_52c=vt(_52b),_52d=this.events();f=dc.calculateBarSize(this._hScaler.bounds.scale,this.opt);gap=f.gap;_52a=f.size;for(var i=this.series.length-1;i>=0;--i){var run=this.series[i];if(!this.dirty&&!run.dirty){t.skip();this._reconnectEvents(run.name);continue;}run.cleanGroup();var _52e=t.next("candlestick",[this.opt,run]),s=run.group,_52f=new Array(run.data.length);for(var j=0;j<run.data.length;++j){var v=run.data[j];if(v!==null){var _530=t.addMixin(_52e,"candlestick",v,true);var x=ht(v.x||(j+0.5))+_529.l+gap,y=dim.height-_529.b,open=vt(v.open),_531=vt(v.close),high=vt(v.high),low=vt(v.low);if(low>high){var tmp=high;high=low;low=tmp;}if(_52a>=1){var hl={x1:_52a/2,x2:_52a/2,y1:y-high,y2:y-low},op={x1:0,x2:((_52a/2)+((_530.series.stroke.width||1)/2)),y1:y-open,y2:y-open},cl={x1:((_52a/2)-((_530.series.stroke.width||1)/2)),x2:_52a,y1:y-_531,y2:y-_531};shape=s.createGroup();shape.setTransform({dx:x,dy:0});var _532=shape.createGroup();_532.createLine(hl).setStroke(_530.series.stroke);_532.createLine(op).setStroke(_530.series.stroke);_532.createLine(cl).setStroke(_530.series.stroke);run.dyn.stroke=_530.series.stroke;if(_52d){var o={element:"candlestick",index:j,run:run,shape:_532,x:x,y:y-Math.max(open,_531),cx:_52a/2,cy:(y-Math.max(open,_531))+(Math.max(open>_531?open-_531:_531-open,1)/2),width:_52a,height:Math.max(open>_531?open-_531:_531-open,1),data:v};this._connectEvents(o);_52f[j]=o;}}if(this.animate){this._animateOHLC(shape,y-low,high-low);}}}this._eventSeries[run.name]=_52f;run.dirty=false;}this.dirty=false;return this;},_animateOHLC:function(_533,_534,_535){_6.gfx.fx.animateTransform(_4.delegate({shape:_533,duration:1200,transform:[{name:"translate",start:[0,_534-(_534/_535)],end:[0,0]},{name:"scale",start:[1,1/_535],end:[1,1]},{name:"original"}]},this.animate)).play();}});})();}if(!_4._hasResource["dojo.fx.easing"]){_4._hasResource["dojo.fx.easing"]=true;_4.provide("dojo.fx.easing");_4.getObject("fx.easing",true,_4);_4.fx.easing={linear:function(n){return n;},quadIn:function(n){return Math.pow(n,2);},quadOut:function(n){return n*(n-2)*-1;},quadInOut:function(n){n=n*2;if(n<1){return Math.pow(n,2)/2;}return -1*((--n)*(n-2)-1)/2;},cubicIn:function(n){return Math.pow(n,3);},cubicOut:function(n){return Math.pow(n-1,3)+1;},cubicInOut:function(n){n=n*2;if(n<1){return Math.pow(n,3)/2;}n-=2;return (Math.pow(n,3)+2)/2;},quartIn:function(n){return Math.pow(n,4);},quartOut:function(n){return -1*(Math.pow(n-1,4)-1);},quartInOut:function(n){n=n*2;if(n<1){return Math.pow(n,4)/2;}n-=2;return -1/2*(Math.pow(n,4)-2);},quintIn:function(n){return Math.pow(n,5);},quintOut:function(n){return Math.pow(n-1,5)+1;},quintInOut:function(n){n=n*2;if(n<1){return Math.pow(n,5)/2;}n-=2;return (Math.pow(n,5)+2)/2;},sineIn:function(n){return -1*Math.cos(n*(Math.PI/2))+1;},sineOut:function(n){return Math.sin(n*(Math.PI/2));},sineInOut:function(n){return -1*(Math.cos(Math.PI*n)-1)/2;},expoIn:function(n){return (n==0)?0:Math.pow(2,10*(n-1));},expoOut:function(n){return (n==1)?1:(-1*Math.pow(2,-10*n)+1);},expoInOut:function(n){if(n==0){return 0;}if(n==1){return 1;}n=n*2;if(n<1){return Math.pow(2,10*(n-1))/2;}--n;return (-1*Math.pow(2,-10*n)+2)/2;},circIn:function(n){return -1*(Math.sqrt(1-Math.pow(n,2))-1);},circOut:function(n){n=n-1;return Math.sqrt(1-Math.pow(n,2));},circInOut:function(n){n=n*2;if(n<1){return -1/2*(Math.sqrt(1-Math.pow(n,2))-1);}n-=2;return 1/2*(Math.sqrt(1-Math.pow(n,2))+1);},backIn:function(n){var s=1.70158;return Math.pow(n,2)*((s+1)*n-s);},backOut:function(n){n=n-1;var s=1.70158;return Math.pow(n,2)*((s+1)*n+s)+1;},backInOut:function(n){var s=1.70158*1.525;n=n*2;if(n<1){return (Math.pow(n,2)*((s+1)*n-s))/2;}n-=2;return (Math.pow(n,2)*((s+1)*n+s)+2)/2;},elasticIn:function(n){if(n==0||n==1){return n;}var p=0.3;var s=p/4;n=n-1;return -1*Math.pow(2,10*n)*Math.sin((n-s)*(2*Math.PI)/p);},elasticOut:function(n){if(n==0||n==1){return n;}var p=0.3;var s=p/4;return Math.pow(2,-10*n)*Math.sin((n-s)*(2*Math.PI)/p)+1;},elasticInOut:function(n){if(n==0){return 0;}n=n*2;if(n==2){return 1;}var p=0.3*1.5;var s=p/4;if(n<1){n-=1;return -0.5*(Math.pow(2,10*n)*Math.sin((n-s)*(2*Math.PI)/p));}n-=1;return 0.5*(Math.pow(2,-10*n)*Math.sin((n-s)*(2*Math.PI)/p))+1;},bounceIn:function(n){return (1-_4.fx.easing.bounceOut(1-n));},bounceOut:function(n){var s=7.5625;var p=2.75;var l;if(n<(1/p)){l=s*Math.pow(n,2);}else{if(n<(2/p)){n-=(1.5/p);l=s*Math.pow(n,2)+0.75;}else{if(n<(2.5/p)){n-=(2.25/p);l=s*Math.pow(n,2)+0.9375;}else{n-=(2.625/p);l=s*Math.pow(n,2)+0.984375;}}}return l;},bounceInOut:function(n){if(n<0.5){return _4.fx.easing.bounceIn(n*2)/2;}return (_4.fx.easing.bounceOut(n*2-1)/2)+0.5;}};}if(!_4._hasResource["dojox.charting.plot2d.Spider"]){_4._hasResource["dojox.charting.plot2d.Spider"]=true;_4.provide("dojox.charting.plot2d.Spider");_4.experimental("dojox.charting.plot2d.Spider");(function(){var df=_6.lang.functional,du=_6.lang.utils,dc=_6.charting.plot2d.common,da=_6.charting.axis2d.common,g=_6.gfx,m=g.matrix,_536=0.2;_4.declare("dojox.charting.plot2d.Spider",[_6.charting.Element,_6.charting.plot2d._PlotEvents],{defaultParams:{labels:true,ticks:false,fixed:true,precision:1,labelOffset:-10,labelStyle:"default",htmlLabels:true,startAngle:-90,divisions:3,axisColor:"",axisWidth:0,spiderColor:"",spiderWidth:0,seriesWidth:0,seriesFillAlpha:0.2,spiderOrigin:0.16,markerSize:3,spiderType:"polygon",animationType:_4.fx.easing.backOut,axisTickFont:"",axisTickFontColor:"",axisFont:"",axisFontColor:""},optionalParams:{radius:0,font:"",fontColor:""},constructor:function(_537,_538){this.opt=_4.clone(this.defaultParams);du.updateWithObject(this.opt,_538);du.updateWithPattern(this.opt,_538,this.optionalParams);this.series=[];this.dyn=[];this.datas={};this.labelKey=[];this.oldSeriePoints={};this.animations={};},clear:function(){this.dirty=true;this.dyn=[];this.series=[];this.datas={};this.labelKey=[];this.oldSeriePoints={};this.animations={};return this;},setAxis:function(axis){return this;},addSeries:function(run){var _539=false;this.series.push(run);for(var key in run.data){var val=run.data[key],data=this.datas[key];if(data){data.vlist.push(val);data.min=Math.min(data.min,val);data.max=Math.max(data.max,val);}else{this.datas[key]={min:val,max:val,vlist:[val]};}}if(this.labelKey.length<=0){for(var key in run.data){this.labelKey.push(key);}}return this;},getSeriesStats:function(){return _6.charting.plot2d.common.collectSimpleStats(this.series);},calculateAxes:function(dim){this.initializeScalers(dim,this.getSeriesStats());return this;},getRequiredColors:function(){return this.series.length;},initializeScalers:function(dim,_53a){if(this._hAxis){if(!this._hAxis.initialized()){this._hAxis.calculate(_53a.hmin,_53a.hmax,dim.width);}this._hScaler=this._hAxis.getScaler();}else{this._hScaler=_6.charting.scaler.primitive.buildScaler(_53a.hmin,_53a.hmax,dim.width);}if(this._vAxis){if(!this._vAxis.initialized()){this._vAxis.calculate(_53a.vmin,_53a.vmax,dim.height);}this._vScaler=this._vAxis.getScaler();}else{this._vScaler=_6.charting.scaler.primitive.buildScaler(_53a.vmin,_53a.vmax,dim.height);}return this;},render:function(dim,_53b){if(!this.dirty){return this;}this.dirty=false;this.cleanGroup();var s=this.group,t=this.chart.theme;this.resetEvents();if(!this.series||!this.series.length){return this;}var o=this.opt,ta=t.axis,rx=(dim.width-_53b.l-_53b.r)/2,ry=(dim.height-_53b.t-_53b.b)/2,r=Math.min(rx,ry),_53c=o.font||(ta.majorTick&&ta.majorTick.font)||(ta.tick&&ta.tick.font)||"normal normal normal 7pt Tahoma",_53d=o.axisFont||(ta.tick&&ta.tick.titleFont)||"normal normal normal 11pt Tahoma",_53e=o.axisTickFontColor||(ta.majorTick&&ta.majorTick.fontColor)||(ta.tick&&ta.tick.fontColor)||"silver",_53f=o.axisFontColor||(ta.tick&&ta.tick.titleFontColor)||"black",_540=o.axisColor||(ta.tick&&ta.tick.axisColor)||"silver",_541=o.spiderColor||(ta.tick&&ta.tick.spiderColor)||"silver",_542=o.axisWidth||(ta.stroke&&ta.stroke.width)||2,_543=o.spiderWidth||(ta.stroke&&ta.stroke.width)||2,_544=o.seriesWidth||(ta.stroke&&ta.stroke.width)||2,_545=g.normalizedLength(g.splitFontString(_53d).size),_546=m._degToRad(o.startAngle),_547=_546,step,_548,_549,_54a,_54b,_54c,_54d,_54e,_54f,_550,_551,ro=o.spiderOrigin,dv=o.divisions>=3?o.divisions:3,ms=o.markerSize,spt=o.spiderType,at=o.animationType,_552=o.labelOffset<-10?o.labelOffset:-10,_553=0.2;if(o.labels){_54a=_4.map(this.series,function(s){return s.name;},this);_54b=df.foldl1(df.map(_54a,function(_554,i){var font=t.series.font;return _6.gfx._base._getTextBox(_554,{font:font}).w;},this),"Math.max(a, b)")/2;r=Math.min(rx-2*_54b,ry-_545)+_552;_54c=r-_552;}if("radius" in o){r=o.radius;_54c=r-_552;}r/=(1+_553);var _555={cx:_53b.l+rx,cy:_53b.t+ry,r:r};for(var i=this.series.length-1;i>=0;i--){var _556=this.series[i];if(!this.dirty&&!_556.dirty){t.skip();continue;}_556.cleanGroup();var run=_556.data;if(run!==null){var len=this._getObjectLength(run);if(!_54d||_54d.length<=0){_54d=[],_54e=[],_551=[];this._buildPoints(_54d,len,_555,r,_547,true);this._buildPoints(_54e,len,_555,r*ro,_547,true);this._buildPoints(_551,len,_555,_54c,_547);if(dv>2){_54f=[],_550=[];for(var j=0;j<dv-2;j++){_54f[j]=[];this._buildPoints(_54f[j],len,_555,r*(ro+(1-ro)*(j+1)/(dv-1)),_547,true);_550[j]=r*(ro+(1-ro)*(j+1)/(dv-1));}}}}}var _557=s.createGroup(),_558={color:_540,width:_542},_559={color:_541,width:_543};for(var j=_54d.length-1;j>=0;--j){var _55a=_54d[j],st={x:_55a.x+(_55a.x-_555.cx)*_553,y:_55a.y+(_55a.y-_555.cy)*_553},nd={x:_55a.x+(_55a.x-_555.cx)*_553/2,y:_55a.y+(_55a.y-_555.cy)*_553/2};_557.createLine({x1:_555.cx,y1:_555.cy,x2:st.x,y2:st.y}).setStroke(_558);this._drawArrow(_557,st,nd,_558);}var _55b=s.createGroup();for(var j=_551.length-1;j>=0;--j){var _55a=_551[j],_55c=_6.gfx._base._getTextBox(this.labelKey[j],{font:_53d}).w||0,_55d=this.opt.htmlLabels&&_6.gfx.renderer!="vml"?"html":"gfx";elem=da.createText[_55d](this.chart,_55b,(!_4._isBodyLtr()&&_55d=="html")?(_55a.x+_55c-dim.width):_55a.x,_55a.y,"middle",this.labelKey[j],_53d,_53f);if(this.opt.htmlLabels){this.htmlElements.push(elem);}}var _55e=s.createGroup();if(spt=="polygon"){_55e.createPolyline(_54d).setStroke(_559);_55e.createPolyline(_54e).setStroke(_559);if(_54f.length>0){for(var j=_54f.length-1;j>=0;--j){_55e.createPolyline(_54f[j]).setStroke(_559);}}}else{var _55f=this._getObjectLength(this.datas);_55e.createCircle({cx:_555.cx,cy:_555.cy,r:r}).setStroke(_559);_55e.createCircle({cx:_555.cx,cy:_555.cy,r:r*ro}).setStroke(_559);if(_550.length>0){for(var j=_550.length-1;j>=0;--j){_55e.createCircle({cx:_555.cx,cy:_555.cy,r:_550[j]}).setStroke(_559);}}}var _560=s.createGroup(),len=this._getObjectLength(this.datas),k=0;for(var key in this.datas){var data=this.datas[key],min=data.min,max=data.max,_561=max-min,end=_547+2*Math.PI*k/len;for(var i=0;i<dv;i++){var text=min+_561*i/(dv-1),_55a=this._getCoordinate(_555,r*(ro+(1-ro)*i/(dv-1)),end);text=this._getLabel(text);var _55c=_6.gfx._base._getTextBox(text,{font:_53c}).w||0,_55d=this.opt.htmlLabels&&_6.gfx.renderer!="vml"?"html":"gfx";if(this.opt.htmlLabels){this.htmlElements.push(da.createText[_55d](this.chart,_560,(!_4._isBodyLtr()&&_55d=="html")?(_55a.x+_55c-dim.width):_55a.x,_55a.y,"start",text,_53c,_53e));}}k++;}this.chart.seriesShapes={};var _562=[];for(var i=this.series.length-1;i>=0;i--){var _556=this.series[i],run=_556.data;if(run!==null){var _563=[],k=0,_564=[];for(var key in run){var data=this.datas[key],min=data.min,max=data.max,_561=max-min,_565=run[key],end=_547+2*Math.PI*k/len,_55a=this._getCoordinate(_555,r*(ro+(1-ro)*(_565-min)/_561),end);_563.push(_55a);_564.push({sname:_556.name,key:key,data:_565});k++;}_563[_563.length]=_563[0];_564[_564.length]=_564[0];var _566=this._getBoundary(_563),_567=t.next("spider",[o,_556]),ts=_556.group,f=g.normalizeColor(_567.series.fill),sk={color:_567.series.fill,width:_544};f.a=o.seriesFillAlpha;_556.dyn={fill:f,stroke:sk};var osps=this.oldSeriePoints[_556.name];var cs=this._createSeriesEntry(ts,(osps||_54e),_563,f,sk,r,ro,ms,at);this.chart.seriesShapes[_556.name]=cs;this.oldSeriePoints[_556.name]=_563;var po={element:"spider_poly",index:i,id:"spider_poly_"+_556.name,run:_556,plot:this,shape:cs.poly,parent:ts,brect:_566,cx:_555.cx,cy:_555.cy,cr:r,f:f,s:s};this._connectEvents(po);var so={element:"spider_plot",index:i,id:"spider_plot_"+_556.name,run:_556,plot:this,shape:_556.group};this._connectEvents(so);_4.forEach(cs.circles,function(c,i){var _568=c.getShape(),co={element:"spider_circle",index:i,id:"spider_circle_"+_556.name+i,run:_556,plot:this,shape:c,parent:ts,tdata:_564[i],cx:_563[i].x,cy:_563[i].y,f:f,s:s};this._connectEvents(co);},this);}}return this;},_createSeriesEntry:function(ts,osps,sps,f,sk,r,ro,ms,at){var _569=ts.createPolyline(osps).setFill(f).setStroke(sk),_56a=[];for(var j=0;j<osps.length;j++){var _56b=osps[j],cr=ms;var _56c=ts.createCircle({cx:_56b.x,cy:_56b.y,r:cr}).setFill(f).setStroke(sk);_56a.push(_56c);}var _56d=_4.map(sps,function(np,j){var sp=osps[j],anim=new _4._Animation({duration:1000,easing:at,curve:[sp.y,np.y]});var spl=_569,sc=_56a[j];_4.connect(anim,"onAnimate",function(y){var _56e=spl.getShape();_56e.points[j].y=y;spl.setShape(_56e);var _56f=sc.getShape();_56f.cy=y;sc.setShape(_56f);});return anim;});var _570=_4.map(sps,function(np,j){var sp=osps[j],anim=new _4._Animation({duration:1000,easing:at,curve:[sp.x,np.x]});var spl=_569,sc=_56a[j];_4.connect(anim,"onAnimate",function(x){var _571=spl.getShape();_571.points[j].x=x;spl.setShape(_571);var _572=sc.getShape();_572.cx=x;sc.setShape(_572);});return anim;});var _573=_4.fx.combine(_56d.concat(_570));_573.play();return {group:ts,poly:_569,circles:_56a};},plotEvent:function(o){var _574=o.id?o.id:"default",a;if(_574 in this.animations){a=this.animations[_574];a.anim&&a.anim.stop(true);}else{a=this.animations[_574]={};}if(o.element=="spider_poly"){if(!a.color){var _575=o.shape.getFill();if(!_575||!(_575 instanceof _4.Color)){return;}a.color={start:_575,end:_576(_575)};}var _577=a.color.start,end=a.color.end;if(o.type=="onmouseout"){var t=_577;_577=end;end=t;}a.anim=_6.gfx.fx.animateFill({shape:o.shape,duration:800,easing:_4.fx.easing.backOut,color:{start:_577,end:end}});a.anim.play();}else{if(o.element=="spider_circle"){var init,_578,_579=1.5;if(o.type=="onmouseover"){init=_6.gfx.matrix.identity;_578=_579;var _57a={type:"rect"};_57a.x=o.cx;_57a.y=o.cy;_57a.width=_57a.height=1;var lt=_4.coords(this.chart.node,true);_57a.x+=lt.x;_57a.y+=lt.y;_57a.x=Math.round(_57a.x);_57a.y=Math.round(_57a.y);_57a.width=Math.ceil(_57a.width);_57a.height=Math.ceil(_57a.height);this.aroundRect=_57a;var _57b=["after","before"];if(_5&&_5.Tooltip){_5.showTooltip(o.tdata.sname+"<br/>"+o.tdata.key+"<br/>"+o.tdata.data,this.aroundRect,_57b);}}else{init=_6.gfx.matrix.scaleAt(_579,o.cx,o.cy);_578=1/_579;if(_5&&_5.Tooltip){this.aroundRect&&_5.hideTooltip(this.aroundRect);}}var cs=o.shape.getShape(),init=m.scaleAt(_579,cs.cx,cs.cy),_57c={shape:o.shape,duration:200,easing:_4.fx.easing.backOut,transform:[{name:"scaleAt",start:[1,cs.cx,cs.cy],end:[_578,cs.cx,cs.cy]},init]};a.anim=_6.gfx.fx.animateTransform(_57c);a.anim.play();}else{if(o.element=="spider_plot"){if(o.type=="onmouseover"&&!_4.isIE){o.shape.moveToFront();}}}}},_getBoundary:function(_57d){var xmax=_57d[0].x,xmin=_57d[0].x,ymax=_57d[0].y,ymin=_57d[0].y;for(var i=0;i<_57d.length;i++){var _57e=_57d[i];xmax=Math.max(_57e.x,xmax);ymax=Math.max(_57e.y,ymax);xmin=Math.min(_57e.x,xmin);ymin=Math.min(_57e.y,ymin);}return {x:xmin,y:ymin,width:xmax-xmin,height:ymax-ymin};},_drawArrow:function(s,_57f,end,_580){var len=Math.sqrt(Math.pow(end.x-_57f.x,2)+Math.pow(end.y-_57f.y,2)),sin=(end.y-_57f.y)/len,cos=(end.x-_57f.x)/len,_581={x:end.x+(len/3)*(-sin),y:end.y+(len/3)*cos},_582={x:end.x+(len/3)*sin,y:end.y+(len/3)*(-cos)};s.createPolyline([_57f,_581,_582]).setFill(_580.color).setStroke(_580);},_buildPoints:function(_583,_584,_585,_586,_587,_588){for(var i=0;i<_584;i++){var end=_587+2*Math.PI*i/_584;_583.push(this._getCoordinate(_585,_586,end));}if(_588){_583.push(this._getCoordinate(_585,_586,_587+2*Math.PI));}},_getCoordinate:function(_589,_58a,_58b){return {x:_589.cx+_58a*Math.cos(_58b),y:_589.cy+_58a*Math.sin(_58b)};},_getObjectLength:function(obj){var _58c=0;if(_4.isObject(obj)){for(var key in obj){_58c++;}}return _58c;},_getLabel:function(_58d){return dc.getLabel(_58d,this.opt.fixed,this.opt.precision);}});function _576(_58e){var a=new _6.color.Color(_58e),x=a.toHsl();if(x.s==0){x.l=x.l<50?100:0;}else{x.s=100;if(x.l<50){x.l=75;}else{if(x.l>75){x.l=50;}else{x.l=x.l-50>75-x.l?50:75;}}}var _58e=_6.color.fromHsl(x);_58e.a=0.7;return _58e;};})();}if(!_4._hasResource["dojox.lang.functional.fold"]){_4._hasResource["dojox.lang.functional.fold"]=true;_4.provide("dojox.lang.functional.fold");(function(){var d=_4,df=_6.lang.functional,_58f={};d.mixin(df,{foldl:function(a,f,z,o){if(typeof a=="string"){a=a.split("");}o=o||d.global;f=df.lambda(f);var i,n;if(d.isArray(a)){for(i=0,n=a.length;i<n;z=f.call(o,z,a[i],i,a),++i){}}else{if(typeof a.hasNext=="function"&&typeof a.next=="function"){for(i=0;a.hasNext();z=f.call(o,z,a.next(),i++,a)){}}else{for(i in a){if(!(i in _58f)){z=f.call(o,z,a[i],i,a);}}}}return z;},foldl1:function(a,f,o){if(typeof a=="string"){a=a.split("");}o=o||d.global;f=df.lambda(f);var z,i,n;if(d.isArray(a)){z=a[0];for(i=1,n=a.length;i<n;z=f.call(o,z,a[i],i,a),++i){}}else{if(typeof a.hasNext=="function"&&typeof a.next=="function"){if(a.hasNext()){z=a.next();for(i=1;a.hasNext();z=f.call(o,z,a.next(),i++,a)){}}}else{var _590=true;for(i in a){if(!(i in _58f)){if(_590){z=a[i];_590=false;}else{z=f.call(o,z,a[i],i,a);}}}}}return z;},foldr:function(a,f,z,o){if(typeof a=="string"){a=a.split("");}o=o||d.global;f=df.lambda(f);for(var i=a.length;i>0;--i,z=f.call(o,z,a[i],i,a)){}return z;},foldr1:function(a,f,o){if(typeof a=="string"){a=a.split("");}o=o||d.global;f=df.lambda(f);var n=a.length,z=a[n-1],i=n-1;for(;i>0;--i,z=f.call(o,z,a[i],i,a)){}return z;},reduce:function(a,f,z){return arguments.length<3?df.foldl1(a,f):df.foldl(a,f,z);},reduceRight:function(a,f,z){return arguments.length<3?df.foldr1(a,f):df.foldr(a,f,z);},unfold:function(pr,f,g,z,o){o=o||d.global;f=df.lambda(f);g=df.lambda(g);pr=df.lambda(pr);var t=[];for(;!pr.call(o,z);t.push(f.call(o,z)),z=g.call(o,z)){}return t;}});})();}if(!_4._hasResource["dojox.color._base"]){_4._hasResource["dojox.color._base"]=true;_4.provide("dojox.color._base");_6.color.Color=_4.Color;_6.color.blend=_4.blendColors;_6.color.fromRgb=_4.colorFromRgb;_6.color.fromHex=_4.colorFromHex;_6.color.fromArray=_4.colorFromArray;_6.color.fromString=_4.colorFromString;_6.color.greyscale=_4.colors.makeGrey;_4.mixin(_6.color,{fromCmy:function(cyan,_591,_592){if(_4.isArray(cyan)){_591=cyan[1],_592=cyan[2],cyan=cyan[0];}else{if(_4.isObject(cyan)){_591=cyan.m,_592=cyan.y,cyan=cyan.c;}}cyan/=100,_591/=100,_592/=100;var r=1-cyan,g=1-_591,b=1-_592;return new _6.color.Color({r:Math.round(r*255),g:Math.round(g*255),b:Math.round(b*255)});},fromCmyk:function(cyan,_593,_594,_595){if(_4.isArray(cyan)){_593=cyan[1],_594=cyan[2],_595=cyan[3],cyan=cyan[0];}else{if(_4.isObject(cyan)){_593=cyan.m,_594=cyan.y,_595=cyan.b,cyan=cyan.c;}}cyan/=100,_593/=100,_594/=100,_595/=100;var r,g,b;r=1-Math.min(1,cyan*(1-_595)+_595);g=1-Math.min(1,_593*(1-_595)+_595);b=1-Math.min(1,_594*(1-_595)+_595);return new _6.color.Color({r:Math.round(r*255),g:Math.round(g*255),b:Math.round(b*255)});},fromHsl:function(hue,_596,_597){if(_4.isArray(hue)){_596=hue[1],_597=hue[2],hue=hue[0];}else{if(_4.isObject(hue)){_596=hue.s,_597=hue.l,hue=hue.h;}}_596/=100;_597/=100;while(hue<0){hue+=360;}while(hue>=360){hue-=360;}var r,g,b;if(hue<120){r=(120-hue)/60,g=hue/60,b=0;}else{if(hue<240){r=0,g=(240-hue)/60,b=(hue-120)/60;}else{r=(hue-240)/60,g=0,b=(360-hue)/60;}}r=2*_596*Math.min(r,1)+(1-_596);g=2*_596*Math.min(g,1)+(1-_596);b=2*_596*Math.min(b,1)+(1-_596);if(_597<0.5){r*=_597,g*=_597,b*=_597;}else{r=(1-_597)*r+2*_597-1;g=(1-_597)*g+2*_597-1;b=(1-_597)*b+2*_597-1;}return new _6.color.Color({r:Math.round(r*255),g:Math.round(g*255),b:Math.round(b*255)});},fromHsv:function(hue,_598,_599){if(_4.isArray(hue)){_598=hue[1],_599=hue[2],hue=hue[0];}else{if(_4.isObject(hue)){_598=hue.s,_599=hue.v,hue=hue.h;}}if(hue==360){hue=0;}_598/=100;_599/=100;var r,g,b;if(_598==0){r=_599,b=_599,g=_599;}else{var _59a=hue/60,i=Math.floor(_59a),f=_59a-i;var p=_599*(1-_598);var q=_599*(1-(_598*f));var t=_599*(1-(_598*(1-f)));switch(i){case 0:r=_599,g=t,b=p;break;case 1:r=q,g=_599,b=p;break;case 2:r=p,g=_599,b=t;break;case 3:r=p,g=q,b=_599;break;case 4:r=t,g=p,b=_599;break;case 5:r=_599,g=p,b=q;break;}}return new _6.color.Color({r:Math.round(r*255),g:Math.round(g*255),b:Math.round(b*255)});}});_4.extend(_6.color.Color,{toCmy:function(){var cyan=1-(this.r/255),_59b=1-(this.g/255),_59c=1-(this.b/255);return {c:Math.round(cyan*100),m:Math.round(_59b*100),y:Math.round(_59c*100)};},toCmyk:function(){var cyan,_59d,_59e,_59f;var r=this.r/255,g=this.g/255,b=this.b/255;_59f=Math.min(1-r,1-g,1-b);cyan=(1-r-_59f)/(1-_59f);_59d=(1-g-_59f)/(1-_59f);_59e=(1-b-_59f)/(1-_59f);return {c:Math.round(cyan*100),m:Math.round(_59d*100),y:Math.round(_59e*100),b:Math.round(_59f*100)};},toHsl:function(){var r=this.r/255,g=this.g/255,b=this.b/255;var min=Math.min(r,b,g),max=Math.max(r,g,b);var _5a0=max-min;var h=0,s=0,l=(min+max)/2;if(l>0&&l<1){s=_5a0/((l<0.5)?(2*l):(2-2*l));}if(_5a0>0){if(max==r&&max!=g){h+=(g-b)/_5a0;}if(max==g&&max!=b){h+=(2+(b-r)/_5a0);}if(max==b&&max!=r){h+=(4+(r-g)/_5a0);}h*=60;}return {h:h,s:Math.round(s*100),l:Math.round(l*100)};},toHsv:function(){var r=this.r/255,g=this.g/255,b=this.b/255;var min=Math.min(r,b,g),max=Math.max(r,g,b);var _5a1=max-min;var h=null,s=(max==0)?0:(_5a1/max);if(s==0){h=0;}else{if(r==max){h=60*(g-b)/_5a1;}else{if(g==max){h=120+60*(b-r)/_5a1;}else{h=240+60*(r-g)/_5a1;}}if(h<0){h+=360;}}return {h:h,s:Math.round(s*100),v:Math.round(max*100)};}});}if(!_4._hasResource["dojox.color"]){_4._hasResource["dojox.color"]=true;_4.provide("dojox.color");}if(!_4._hasResource["dojox.color.Palette"]){_4._hasResource["dojox.color.Palette"]=true;_4.provide("dojox.color.Palette");(function(){var dxc=_6.color;dxc.Palette=function(base){this.colors=[];if(base instanceof _6.color.Palette){this.colors=base.colors.slice(0);}else{if(base instanceof _6.color.Color){this.colors=[null,null,base,null,null];}else{if(_4.isArray(base)){this.colors=_4.map(base.slice(0),function(item){if(_4.isString(item)){return new _6.color.Color(item);}return item;});}else{if(_4.isString(base)){this.colors=[null,null,new _6.color.Color(base),null,null];}}}}};function _5a2(p,_5a3,val){var ret=new _6.color.Palette();ret.colors=[];_4.forEach(p.colors,function(item){var r=(_5a3=="dr")?item.r+val:item.r,g=(_5a3=="dg")?item.g+val:item.g,b=(_5a3=="db")?item.b+val:item.b,a=(_5a3=="da")?item.a+val:item.a;ret.colors.push(new _6.color.Color({r:Math.min(255,Math.max(0,r)),g:Math.min(255,Math.max(0,g)),b:Math.min(255,Math.max(0,b)),a:Math.min(1,Math.max(0,a))}));});return ret;};function tCMY(p,_5a4,val){var ret=new _6.color.Palette();ret.colors=[];_4.forEach(p.colors,function(item){var o=item.toCmy(),c=(_5a4=="dc")?o.c+val:o.c,m=(_5a4=="dm")?o.m+val:o.m,y=(_5a4=="dy")?o.y+val:o.y;ret.colors.push(_6.color.fromCmy(Math.min(100,Math.max(0,c)),Math.min(100,Math.max(0,m)),Math.min(100,Math.max(0,y))));});return ret;};function _5a5(p,_5a6,val){var ret=new _6.color.Palette();ret.colors=[];_4.forEach(p.colors,function(item){var o=item.toCmyk(),c=(_5a6=="dc")?o.c+val:o.c,m=(_5a6=="dm")?o.m+val:o.m,y=(_5a6=="dy")?o.y+val:o.y,k=(_5a6=="dk")?o.b+val:o.b;ret.colors.push(_6.color.fromCmyk(Math.min(100,Math.max(0,c)),Math.min(100,Math.max(0,m)),Math.min(100,Math.max(0,y)),Math.min(100,Math.max(0,k))));});return ret;};function tHSL(p,_5a7,val){var ret=new _6.color.Palette();ret.colors=[];_4.forEach(p.colors,function(item){var o=item.toHsl(),h=(_5a7=="dh")?o.h+val:o.h,s=(_5a7=="ds")?o.s+val:o.s,l=(_5a7=="dl")?o.l+val:o.l;ret.colors.push(_6.color.fromHsl(h%360,Math.min(100,Math.max(0,s)),Math.min(100,Math.max(0,l))));});return ret;};function tHSV(p,_5a8,val){var ret=new _6.color.Palette();ret.colors=[];_4.forEach(p.colors,function(item){var o=item.toHsv(),h=(_5a8=="dh")?o.h+val:o.h,s=(_5a8=="ds")?o.s+val:o.s,v=(_5a8=="dv")?o.v+val:o.v;ret.colors.push(_6.color.fromHsv(h%360,Math.min(100,Math.max(0,s)),Math.min(100,Math.max(0,v))));});return ret;};function _5a9(val,low,high){return high-((high-val)*((high-low)/high));};_4.extend(dxc.Palette,{transform:function(_5aa){var fn=_5a2;if(_5aa.use){var use=_5aa.use.toLowerCase();if(use.indexOf("hs")==0){if(use.charAt(2)=="l"){fn=tHSL;}else{fn=tHSV;}}else{if(use.indexOf("cmy")==0){if(use.charAt(3)=="k"){fn=_5a5;}else{fn=tCMY;}}}}else{if("dc" in _5aa||"dm" in _5aa||"dy" in _5aa){if("dk" in _5aa){fn=_5a5;}else{fn=tCMY;}}else{if("dh" in _5aa||"ds" in _5aa){if("dv" in _5aa){fn=tHSV;}else{fn=tHSL;}}}}var _5ab=this;for(var p in _5aa){if(p=="use"){continue;}_5ab=fn(_5ab,p,_5aa[p]);}return _5ab;},clone:function(){return new dxc.Palette(this);}});_4.mixin(dxc.Palette,{generators:{analogous:function(args){var high=args.high||60,low=args.low||18,base=_4.isString(args.base)?new _6.color.Color(args.base):args.base,hsv=base.toHsv();var h=[(hsv.h+low+360)%360,(hsv.h+Math.round(low/2)+360)%360,hsv.h,(hsv.h-Math.round(high/2)+360)%360,(hsv.h-high+360)%360];var s1=Math.max(10,(hsv.s<=95)?hsv.s+5:(100-(hsv.s-95))),s2=(hsv.s>1)?hsv.s-1:21-hsv.s,v1=(hsv.v>=92)?hsv.v-9:Math.max(hsv.v+9,20),v2=(hsv.v<=90)?Math.max(hsv.v+5,20):(95+Math.ceil((hsv.v-90)/2)),s=[s1,s2,hsv.s,s1,s1],v=[v1,v2,hsv.v,v1,v2];return new dxc.Palette(_4.map(h,function(hue,i){return _6.color.fromHsv(hue,s[i],v[i]);}));},monochromatic:function(args){var base=_4.isString(args.base)?new _6.color.Color(args.base):args.base,hsv=base.toHsv();var s1=(hsv.s-30>9)?hsv.s-30:hsv.s+30,s2=hsv.s,v1=_5a9(hsv.v,20,100),v2=(hsv.v-20>20)?hsv.v-20:hsv.v+60,v3=(hsv.v-50>20)?hsv.v-50:hsv.v+30;return new dxc.Palette([_6.color.fromHsv(hsv.h,s1,v1),_6.color.fromHsv(hsv.h,s2,v3),base,_6.color.fromHsv(hsv.h,s1,v3),_6.color.fromHsv(hsv.h,s2,v2)]);},triadic:function(args){var base=_4.isString(args.base)?new _6.color.Color(args.base):args.base,hsv=base.toHsv();var h1=(hsv.h+57+360)%360,h2=(hsv.h-157+360)%360,s1=(hsv.s>20)?hsv.s-10:hsv.s+10,s2=(hsv.s>90)?hsv.s-10:hsv.s+10,s3=(hsv.s>95)?hsv.s-5:hsv.s+5,v1=(hsv.v-20>20)?hsv.v-20:hsv.v+20,v2=(hsv.v-30>20)?hsv.v-30:hsv.v+30,v3=(hsv.v-30>70)?hsv.v-30:hsv.v+30;return new dxc.Palette([_6.color.fromHsv(h1,s1,hsv.v),_6.color.fromHsv(hsv.h,s2,v2),base,_6.color.fromHsv(h2,s2,v1),_6.color.fromHsv(h2,s3,v3)]);},complementary:function(args){var base=_4.isString(args.base)?new _6.color.Color(args.base):args.base,hsv=base.toHsv();var h1=((hsv.h*2)+137<360)?(hsv.h*2)+137:Math.floor(hsv.h/2)-137,s1=Math.max(hsv.s-10,0),s2=_5a9(hsv.s,10,100),s3=Math.min(100,hsv.s+20),v1=Math.min(100,hsv.v+30),v2=(hsv.v>20)?hsv.v-30:hsv.v+30;return new dxc.Palette([_6.color.fromHsv(hsv.h,s1,v1),_6.color.fromHsv(hsv.h,s2,v2),base,_6.color.fromHsv(h1,s3,v2),_6.color.fromHsv(h1,hsv.s,hsv.v)]);},splitComplementary:function(args){var base=_4.isString(args.base)?new _6.color.Color(args.base):args.base,_5ac=args.da||30,hsv=base.toHsv();var _5ad=((hsv.h*2)+137<360)?(hsv.h*2)+137:Math.floor(hsv.h/2)-137,h1=(_5ad-_5ac+360)%360,h2=(_5ad+_5ac)%360,s1=Math.max(hsv.s-10,0),s2=_5a9(hsv.s,10,100),s3=Math.min(100,hsv.s+20),v1=Math.min(100,hsv.v+30),v2=(hsv.v>20)?hsv.v-30:hsv.v+30;return new dxc.Palette([_6.color.fromHsv(h1,s1,v1),_6.color.fromHsv(h1,s2,v2),base,_6.color.fromHsv(h2,s3,v2),_6.color.fromHsv(h2,hsv.s,hsv.v)]);},compound:function(args){var base=_4.isString(args.base)?new _6.color.Color(args.base):args.base,hsv=base.toHsv();var h1=((hsv.h*2)+18<360)?(hsv.h*2)+18:Math.floor(hsv.h/2)-18,h2=((hsv.h*2)+120<360)?(hsv.h*2)+120:Math.floor(hsv.h/2)-120,h3=((hsv.h*2)+99<360)?(hsv.h*2)+99:Math.floor(hsv.h/2)-99,s1=(hsv.s-40>10)?hsv.s-40:hsv.s+40,s2=(hsv.s-10>80)?hsv.s-10:hsv.s+10,s3=(hsv.s-25>10)?hsv.s-25:hsv.s+25,v1=(hsv.v-40>10)?hsv.v-40:hsv.v+40,v2=(hsv.v-20>80)?hsv.v-20:hsv.v+20,v3=Math.max(hsv.v,20);return new dxc.Palette([_6.color.fromHsv(h1,s1,v1),_6.color.fromHsv(h1,s2,v2),base,_6.color.fromHsv(h2,s3,v3),_6.color.fromHsv(h3,s2,v2)]);},shades:function(args){var base=_4.isString(args.base)?new _6.color.Color(args.base):args.base,hsv=base.toHsv();var s=(hsv.s==100&&hsv.v==0)?0:hsv.s,v1=(hsv.v-50>20)?hsv.v-50:hsv.v+30,v2=(hsv.v-25>=20)?hsv.v-25:hsv.v+55,v3=(hsv.v-75>=20)?hsv.v-75:hsv.v+5,v4=Math.max(hsv.v-10,20);return new dxc.Palette([new _6.color.fromHsv(hsv.h,s,v1),new _6.color.fromHsv(hsv.h,s,v2),base,new _6.color.fromHsv(hsv.h,s,v3),new _6.color.fromHsv(hsv.h,s,v4)]);}},generate:function(base,type){if(_4.isFunction(type)){return type({base:base});}else{if(dxc.Palette.generators[type]){return dxc.Palette.generators[type]({base:base});}}throw new Error("dojox.color.Palette.generate: the specified generator ('"+type+"') does not exist.");}});})();}if(!_4._hasResource["dojox.charting.Theme"]){_4._hasResource["dojox.charting.Theme"]=true;_4.provide("dojox.charting.Theme");_4.declare("dojox.charting.Theme",null,{shapeSpaces:{shape:1,shapeX:1,shapeY:1},constructor:function(_5ae){_5ae=_5ae||{};var def=_6.charting.Theme.defaultTheme;_4.forEach(["chart","plotarea","axis","series","marker"],function(name){this[name]=_4.delegate(def[name],_5ae[name]);},this);if(_5ae.seriesThemes&&_5ae.seriesThemes.length){this.colors=null;this.seriesThemes=_5ae.seriesThemes.slice(0);}else{this.seriesThemes=null;this.colors=(_5ae.colors||_6.charting.Theme.defaultColors).slice(0);}this.markerThemes=null;if(_5ae.markerThemes&&_5ae.markerThemes.length){this.markerThemes=_5ae.markerThemes.slice(0);}this.markers=_5ae.markers?_4.clone(_5ae.markers):_4.delegate(_6.charting.Theme.defaultMarkers);this.noGradConv=_5ae.noGradConv;this.noRadialConv=_5ae.noRadialConv;if(_5ae.reverseFills){this.reverseFills();}this._current=0;this._buildMarkerArray();},clone:function(){var _5af=new _6.charting.Theme({chart:this.chart,plotarea:this.plotarea,axis:this.axis,series:this.series,marker:this.marker,colors:this.colors,markers:this.markers,seriesThemes:this.seriesThemes,markerThemes:this.markerThemes,noGradConv:this.noGradConv,noRadialConv:this.noRadialConv});_4.forEach(["clone","clear","next","skip","addMixin","post","getTick"],function(name){if(this.hasOwnProperty(name)){_5af[name]=this[name];}},this);return _5af;},clear:function(){this._current=0;},next:function(_5b0,_5b1,_5b2){var _5b3=_6.lang.utils.merge,_5b4,_5b5;if(this.colors){_5b4=_4.delegate(this.series);_5b5=_4.delegate(this.marker);var _5b6=new _4.Color(this.colors[this._current%this.colors.length]),old;if(_5b4.stroke&&_5b4.stroke.color){_5b4.stroke=_4.delegate(_5b4.stroke);old=new _4.Color(_5b4.stroke.color);_5b4.stroke.color=new _4.Color(_5b6);_5b4.stroke.color.a=old.a;}else{_5b4.stroke={color:_5b6};}if(_5b5.stroke&&_5b5.stroke.color){_5b5.stroke=_4.delegate(_5b5.stroke);old=new _4.Color(_5b5.stroke.color);_5b5.stroke.color=new _4.Color(_5b6);_5b5.stroke.color.a=old.a;}else{_5b5.stroke={color:_5b6};}if(!_5b4.fill||_5b4.fill.type){_5b4.fill=_5b6;}else{old=new _4.Color(_5b4.fill);_5b4.fill=new _4.Color(_5b6);_5b4.fill.a=old.a;}if(!_5b5.fill||_5b5.fill.type){_5b5.fill=_5b6;}else{old=new _4.Color(_5b5.fill);_5b5.fill=new _4.Color(_5b6);_5b5.fill.a=old.a;}}else{_5b4=this.seriesThemes?_5b3(this.series,this.seriesThemes[this._current%this.seriesThemes.length]):this.series;_5b5=this.markerThemes?_5b3(this.marker,this.markerThemes[this._current%this.markerThemes.length]):_5b4;}var _5b7=_5b5&&_5b5.symbol||this._markers[this._current%this._markers.length];var _5b8={series:_5b4,marker:_5b5,symbol:_5b7};++this._current;if(_5b1){_5b8=this.addMixin(_5b8,_5b0,_5b1);}if(_5b2){_5b8=this.post(_5b8,_5b0);}return _5b8;},skip:function(){++this._current;},addMixin:function(_5b9,_5ba,_5bb,_5bc){if(_4.isArray(_5bb)){_4.forEach(_5bb,function(m){_5b9=this.addMixin(_5b9,_5ba,m);},this);}else{var t={};if("color" in _5bb){if(_5ba=="line"||_5ba=="area"){_4.setObject("series.stroke.color",_5bb.color,t);_4.setObject("marker.stroke.color",_5bb.color,t);}else{_4.setObject("series.fill",_5bb.color,t);}}_4.forEach(["stroke","outline","shadow","fill","font","fontColor","labelWiring"],function(name){var _5bd="marker"+name.charAt(0).toUpperCase()+name.substr(1),b=_5bd in _5bb;if(name in _5bb){_4.setObject("series."+name,_5bb[name],t);if(!b){_4.setObject("marker."+name,_5bb[name],t);}}if(b){_4.setObject("marker."+name,_5bb[_5bd],t);}});if("marker" in _5bb){t.symbol=_5bb.marker;}_5b9=_6.lang.utils.merge(_5b9,t);}if(_5bc){_5b9=this.post(_5b9,_5ba);}return _5b9;},post:function(_5be,_5bf){var fill=_5be.series.fill,t;if(!this.noGradConv&&this.shapeSpaces[fill.space]&&fill.type=="linear"){if(_5bf=="bar"){t={x1:fill.y1,y1:fill.x1,x2:fill.y2,y2:fill.x2};}else{if(!this.noRadialConv&&fill.space=="shape"&&(_5bf=="slice"||_5bf=="circle")){t={type:"radial",cx:0,cy:0,r:100};}}if(t){return _6.lang.utils.merge(_5be,{series:{fill:t}});}}return _5be;},getTick:function(name,_5c0){var tick=this.axis.tick,_5c1=name+"Tick";merge=_6.lang.utils.merge;if(tick){if(this.axis[_5c1]){tick=merge(tick,this.axis[_5c1]);}}else{tick=this.axis[_5c1];}if(_5c0){if(tick){if(_5c0[_5c1]){tick=merge(tick,_5c0[_5c1]);}}else{tick=_5c0[_5c1];}}return tick;},inspectObjects:function(f){_4.forEach(["chart","plotarea","axis","series","marker"],function(name){f(this[name]);},this);if(this.seriesThemes){_4.forEach(this.seriesThemes,f);}if(this.markerThemes){_4.forEach(this.markerThemes,f);}},reverseFills:function(){this.inspectObjects(function(o){if(o&&o.fill){o.fill=_6.gfx.gradutils.reverse(o.fill);}});},addMarker:function(name,_5c2){this.markers[name]=_5c2;this._buildMarkerArray();},setMarkers:function(obj){this.markers=obj;this._buildMarkerArray();},_buildMarkerArray:function(){this._markers=[];for(var p in this.markers){this._markers.push(this.markers[p]);}}});_4.mixin(_6.charting.Theme,{defaultMarkers:{CIRCLE:"m-3,0 c0,-4 6,-4 6,0 m-6,0 c0,4 6,4 6,0",SQUARE:"m-3,-3 l0,6 6,0 0,-6 z",DIAMOND:"m0,-3 l3,3 -3,3 -3,-3 z",CROSS:"m0,-3 l0,6 m-3,-3 l6,0",X:"m-3,-3 l6,6 m0,-6 l-6,6",TRIANGLE:"m-3,3 l3,-6 3,6 z",TRIANGLE_INVERTED:"m-3,-3 l3,6 3,-6 z"},defaultColors:["#54544c","#858e94","#6e767a","#948585","#474747"],defaultTheme:{chart:{stroke:null,fill:"white",pageStyle:null,titleGap:20,titlePos:"top",titleFont:"normal normal bold 14pt Tahoma",titleFontColor:"#333"},plotarea:{stroke:null,fill:"white"},axis:{stroke:{color:"#333",width:1},tick:{color:"#666",position:"center",font:"normal normal normal 7pt Tahoma",fontColor:"#333",titleGap:15,titleFont:"normal normal normal 11pt Tahoma",titleFontColor:"#333",titleOrientation:"axis"},majorTick:{width:1,length:6},minorTick:{width:0.8,length:3},microTick:{width:0.5,length:1}},series:{stroke:{width:1.5,color:"#333"},outline:{width:0.1,color:"#ccc"},shadow:null,fill:"#ccc",font:"normal normal normal 8pt Tahoma",fontColor:"#000",labelWiring:{width:1,color:"#ccc"}},marker:{stroke:{width:1.5,color:"#333"},outline:{width:0.1,color:"#ccc"},shadow:null,fill:"#ccc",font:"normal normal normal 8pt Tahoma",fontColor:"#000"}},defineColors:function(_5c3){_5c3=_5c3||{};var c=[],n=_5c3.num||5;if(_5c3.colors){var l=_5c3.colors.length;for(var i=0;i<n;i++){c.push(_5c3.colors[i%l]);}return c;}if(_5c3.hue){var s=_5c3.saturation||100;var st=_5c3.low||30;var end=_5c3.high||90;var l=(end+st)/2;return _6.color.Palette.generate(_6.color.fromHsv(_5c3.hue,s,l),"monochromatic").colors;}if(_5c3.generator){return _6.color.Palette.generate(_5c3.base,_5c3.generator).colors;}return c;},generateGradient:function(_5c4,_5c5,_5c6){var fill=_4.delegate(_5c4);fill.colors=[{offset:0,color:_5c5},{offset:1,color:_5c6}];return fill;},generateHslColor:function(_5c7,_5c8){_5c7=new _6.color.Color(_5c7);var hsl=_5c7.toHsl(),_5c9=_6.color.fromHsl(hsl.h,hsl.s,_5c8);_5c9.a=_5c7.a;return _5c9;},generateHslGradient:function(_5ca,_5cb,_5cc,_5cd){_5ca=new _6.color.Color(_5ca);var hsl=_5ca.toHsl(),_5ce=_6.color.fromHsl(hsl.h,hsl.s,_5cc),_5cf=_6.color.fromHsl(hsl.h,hsl.s,_5cd);_5ce.a=_5cf.a=_5ca.a;return _6.charting.Theme.generateGradient(_5cb,_5ce,_5cf);}});}if(!_4._hasResource["dojox.charting.Series"]){_4._hasResource["dojox.charting.Series"]=true;_4.provide("dojox.charting.Series");_4.declare("dojox.charting.Series",_6.charting.Element,{constructor:function(_5d0,data,_5d1){_4.mixin(this,_5d1);if(typeof this.plot!="string"){this.plot="default";}this.update(data);},clear:function(){this.dyn={};},update:function(data){if(_4.isArray(data)){this.data=data;}else{this.source=data;this.data=this.source.data;if(this.source.setSeriesObject){this.source.setSeriesObject(this);}}this.dirty=true;this.clear();}});}if(!_4._hasResource["dojox.charting.Chart"]){_4._hasResource["dojox.charting.Chart"]=true;_4.provide("dojox.charting.Chart");(function(){var df=_6.lang.functional,dc=_6.charting,g=_6.gfx,_5d2=df.lambda("item.clear()"),_5d3=df.lambda("item.purgeGroup()"),_5d4=df.lambda("item.destroy()"),_5d5=df.lambda("item.dirty = false"),_5d6=df.lambda("item.dirty = true"),_5d7=df.lambda("item.name");_4.declare("dojox.charting.Chart",null,{constructor:function(node,_5d8){if(!_5d8){_5d8={};}this.margins=_5d8.margins?_5d8.margins:{l:10,t:10,r:10,b:10};this.stroke=_5d8.stroke;this.fill=_5d8.fill;this.delayInMs=_5d8.delayInMs||200;this.title=_5d8.title;this.titleGap=_5d8.titleGap;this.titlePos=_5d8.titlePos;this.titleFont=_5d8.titleFont;this.titleFontColor=_5d8.titleFontColor;this.chartTitle=null;this.theme=null;this.axes={};this.stack=[];this.plots={};this.series=[];this.runs={};this.dirty=true;this.coords=null;this.node=_4.byId(node);var box=_4.marginBox(node);this.surface=g.createSurface(this.node,box.w||400,box.h||300);},destroy:function(){_4.forEach(this.series,_5d4);_4.forEach(this.stack,_5d4);df.forIn(this.axes,_5d4);if(this.chartTitle&&this.chartTitle.tagName){_4.destroy(this.chartTitle);}this.surface.destroy();},getCoords:function(){if(!this.coords){this.coords=_4.coords(this.node,true);}return this.coords;},setTheme:function(_5d9){this.theme=_5d9.clone();this.dirty=true;return this;},addAxis:function(name,_5da){var axis,_5db=_5da&&_5da.type||"Default";if(typeof _5db=="string"){if(!dc.axis2d||!dc.axis2d[_5db]){throw Error("Can't find axis: "+_5db+" - didn't you forget to dojo"+".require() it?");}axis=new dc.axis2d[_5db](this,_5da);}else{axis=new _5db(this,_5da);}axis.name=name;axis.dirty=true;if(name in this.axes){this.axes[name].destroy();}this.axes[name]=axis;this.dirty=true;return this;},getAxis:function(name){return this.axes[name];},removeAxis:function(name){if(name in this.axes){this.axes[name].destroy();delete this.axes[name];this.dirty=true;}return this;},addPlot:function(name,_5dc){var plot,_5dd=_5dc&&_5dc.type||"Default";if(typeof _5dd=="string"){if(!dc.plot2d||!dc.plot2d[_5dd]){throw Error("Can't find plot: "+_5dd+" - didn't you forget to dojo"+".require() it?");}plot=new dc.plot2d[_5dd](this,_5dc);}else{plot=new _5dd(this,_5dc);}plot.name=name;plot.dirty=true;if(name in this.plots){this.stack[this.plots[name]].destroy();this.stack[this.plots[name]]=plot;}else{this.plots[name]=this.stack.length;this.stack.push(plot);}this.dirty=true;return this;},removePlot:function(name){if(name in this.plots){var _5de=this.plots[name];delete this.plots[name];this.stack[_5de].destroy();this.stack.splice(_5de,1);df.forIn(this.plots,function(idx,name,_5df){if(idx>_5de){_5df[name]=idx-1;}});var ns=_4.filter(this.series,function(run){return run.plot!=name;});if(ns.length<this.series.length){_4.forEach(this.series,function(run){if(run.plot==name){run.destroy();}});this.runs={};_4.forEach(ns,function(run,_5e0){this.runs[run.plot]=_5e0;},this);this.series=ns;}this.dirty=true;}return this;},getPlotOrder:function(){return df.map(this.stack,_5d7);},setPlotOrder:function(_5e1){var _5e2={},_5e3=df.filter(_5e1,function(name){if(!(name in this.plots)||(name in _5e2)){return false;}_5e2[name]=1;return true;},this);if(_5e3.length<this.stack.length){df.forEach(this.stack,function(plot){var name=plot.name;if(!(name in _5e2)){_5e3.push(name);}});}var _5e4=df.map(_5e3,function(name){return this.stack[this.plots[name]];},this);df.forEach(_5e4,function(plot,i){this.plots[plot.name]=i;},this);this.stack=_5e4;this.dirty=true;return this;},movePlotToFront:function(name){if(name in this.plots){var _5e5=this.plots[name];if(_5e5){var _5e6=this.getPlotOrder();_5e6.splice(_5e5,1);_5e6.unshift(name);return this.setPlotOrder(_5e6);}}return this;},movePlotToBack:function(name){if(name in this.plots){var _5e7=this.plots[name];if(_5e7<this.stack.length-1){var _5e8=this.getPlotOrder();_5e8.splice(_5e7,1);_5e8.push(name);return this.setPlotOrder(_5e8);}}return this;},addSeries:function(name,data,_5e9){var run=new dc.Series(this,data,_5e9);run.name=name;if(name in this.runs){this.series[this.runs[name]].destroy();this.series[this.runs[name]]=run;}else{this.runs[name]=this.series.length;this.series.push(run);}this.dirty=true;if(!("ymin" in run)&&"min" in run){run.ymin=run.min;}if(!("ymax" in run)&&"max" in run){run.ymax=run.max;}return this;},removeSeries:function(name){if(name in this.runs){var _5ea=this.runs[name];delete this.runs[name];this.series[_5ea].destroy();this.series.splice(_5ea,1);df.forIn(this.runs,function(idx,name,runs){if(idx>_5ea){runs[name]=idx-1;}});this.dirty=true;}return this;},updateSeries:function(name,data){if(name in this.runs){var run=this.series[this.runs[name]];run.update(data);this._invalidateDependentPlots(run.plot,false);this._invalidateDependentPlots(run.plot,true);}return this;},getSeriesOrder:function(_5eb){return df.map(df.filter(this.series,function(run){return run.plot==_5eb;}),_5d7);},setSeriesOrder:function(_5ec){var _5ed,_5ee={},_5ef=df.filter(_5ec,function(name){if(!(name in this.runs)||(name in _5ee)){return false;}var run=this.series[this.runs[name]];if(_5ed){if(run.plot!=_5ed){return false;}}else{_5ed=run.plot;}_5ee[name]=1;return true;},this);df.forEach(this.series,function(run){var name=run.name;if(!(name in _5ee)&&run.plot==_5ed){_5ef.push(name);}});var _5f0=df.map(_5ef,function(name){return this.series[this.runs[name]];},this);this.series=_5f0.concat(df.filter(this.series,function(run){return run.plot!=_5ed;}));df.forEach(this.series,function(run,i){this.runs[run.name]=i;},this);this.dirty=true;return this;},moveSeriesToFront:function(name){if(name in this.runs){var _5f1=this.runs[name],_5f2=this.getSeriesOrder(this.series[_5f1].plot);if(name!=_5f2[0]){_5f2.splice(_5f1,1);_5f2.unshift(name);return this.setSeriesOrder(_5f2);}}return this;},moveSeriesToBack:function(name){if(name in this.runs){var _5f3=this.runs[name],_5f4=this.getSeriesOrder(this.series[_5f3].plot);if(name!=_5f4[_5f4.length-1]){_5f4.splice(_5f3,1);_5f4.push(name);return this.setSeriesOrder(_5f4);}}return this;},resize:function(_5f5,_5f6){var box;switch(arguments.length){case 1:box=_4.mixin({},_5f5);_4.marginBox(this.node,box);break;case 2:box={w:_5f5,h:_5f6};_4.marginBox(this.node,box);break;}box=_4.marginBox(this.node);this.surface.setDimensions(box.w,box.h);this.dirty=true;this.coords=null;return this.render();},getGeometry:function(){var ret={};df.forIn(this.axes,function(axis){if(axis.initialized()){ret[axis.name]={name:axis.name,vertical:axis.vertical,scaler:axis.scaler,ticks:axis.ticks};}});return ret;},setAxisWindow:function(name,_5f7,_5f8,zoom){var axis=this.axes[name];if(axis){axis.setWindow(_5f7,_5f8);_4.forEach(this.stack,function(plot){if(plot.hAxis==name||plot.vAxis==name){plot.zoom=zoom;}});}return this;},setWindow:function(sx,sy,dx,dy,zoom){if(!("plotArea" in this)){this.calculateGeometry();}df.forIn(this.axes,function(axis){var _5f9,_5fa,_5fb=axis.getScaler().bounds,s=_5fb.span/(_5fb.upper-_5fb.lower);if(axis.vertical){_5f9=sy;_5fa=dy/s/_5f9;}else{_5f9=sx;_5fa=dx/s/_5f9;}axis.setWindow(_5f9,_5fa);});_4.forEach(this.stack,function(plot){plot.zoom=zoom;});return this;},zoomIn:function(name,_5fc){var axis=this.axes[name];if(axis){var _5fd,_5fe,_5ff=axis.getScaler().bounds;var _600=Math.min(_5fc[0],_5fc[1]);var _601=Math.max(_5fc[0],_5fc[1]);_600=_5fc[0]<_5ff.lower?_5ff.lower:_600;_601=_5fc[1]>_5ff.upper?_5ff.upper:_601;_5fd=(_5ff.upper-_5ff.lower)/(_601-_600);_5fe=_600-_5ff.lower;this.setAxisWindow(name,_5fd,_5fe);this.render();}},calculateGeometry:function(){if(this.dirty){return this.fullGeometry();}var _602=_4.filter(this.stack,function(plot){return plot.dirty||(plot.hAxis&&this.axes[plot.hAxis].dirty)||(plot.vAxis&&this.axes[plot.vAxis].dirty);},this);_603(_602,this.plotArea);return this;},fullGeometry:function(){this._makeDirty();_4.forEach(this.stack,_5d2);if(!this.theme){this.setTheme(new _6.charting.Theme(_6.charting._def));}_4.forEach(this.series,function(run){if(!(run.plot in this.plots)){if(!dc.plot2d||!dc.plot2d.Default){throw Error("Can't find plot: Default - didn't you forget to dojo"+".require() it?");}var plot=new dc.plot2d.Default(this,{});plot.name=run.plot;this.plots[run.plot]=this.stack.length;this.stack.push(plot);}this.stack[this.plots[run.plot]].addSeries(run);},this);_4.forEach(this.stack,function(plot){if(plot.hAxis){plot.setAxis(this.axes[plot.hAxis]);}if(plot.vAxis){plot.setAxis(this.axes[plot.vAxis]);}},this);var dim=this.dim=this.surface.getDimensions();dim.width=g.normalizedLength(dim.width);dim.height=g.normalizedLength(dim.height);df.forIn(this.axes,_5d2);_603(this.stack,dim);var _604=this.offsets={l:0,r:0,t:0,b:0};df.forIn(this.axes,function(axis){df.forIn(axis.getOffsets(),function(o,i){_604[i]+=o;});});if(this.title){this.titleGap=(this.titleGap==0)?0:this.titleGap||this.theme.chart.titleGap||20;this.titlePos=this.titlePos||this.theme.chart.titlePos||"top";this.titleFont=this.titleFont||this.theme.chart.titleFont;this.titleFontColor=this.titleFontColor||this.theme.chart.titleFontColor||"black";var _605=g.normalizedLength(g.splitFontString(this.titleFont).size);_604[this.titlePos=="top"?"t":"b"]+=(_605+this.titleGap);}df.forIn(this.margins,function(o,i){_604[i]+=o;});this.plotArea={width:dim.width-_604.l-_604.r,height:dim.height-_604.t-_604.b};df.forIn(this.axes,_5d2);_603(this.stack,this.plotArea);return this;},render:function(){if(this.theme){this.theme.clear();}if(this.dirty){return this.fullRender();}this.calculateGeometry();df.forEachRev(this.stack,function(plot){plot.render(this.dim,this.offsets);},this);df.forIn(this.axes,function(axis){axis.render(this.dim,this.offsets);},this);this._makeClean();if(this.surface.render){this.surface.render();}return this;},fullRender:function(){this.fullGeometry();var _606=this.offsets,dim=this.dim,rect;_4.forEach(this.series,_5d3);df.forIn(this.axes,_5d3);_4.forEach(this.stack,_5d3);if(this.chartTitle&&this.chartTitle.tagName){_4.destroy(this.chartTitle);}this.surface.clear();this.chartTitle=null;var t=this.theme,fill=t.plotarea&&t.plotarea.fill,_607=t.plotarea&&t.plotarea.stroke,rect={x:_606.l-1,y:_606.t-1,width:dim.width-_606.l-_606.r+2,height:dim.height-_606.t-_606.b+2};if(fill){fill=dc.Element.prototype._shapeFill(dc.Element.prototype._plotFill(fill,dim,_606),rect);this.surface.createRect(rect).setFill(fill);}if(_607){this.surface.createRect({x:_606.l,y:_606.t,width:dim.width-_606.l-_606.r+1,height:dim.height-_606.t-_606.b+1}).setStroke(_607);}df.foldr(this.stack,function(z,plot){return plot.render(dim,_606),0;},0);fill=this.fill!==undefined?this.fill:(t.chart&&t.chart.fill);_607=this.stroke!==undefined?this.stroke:(t.chart&&t.chart.stroke);if(fill=="inherit"){var node=this.node,fill=new _4.Color(_4.style(node,"backgroundColor"));while(fill.a==0&&node!=document.documentElement){fill=new _4.Color(_4.style(node,"backgroundColor"));node=node.parentNode;}}if(fill){fill=dc.Element.prototype._plotFill(fill,dim,_606);if(_606.l){rect={width:_606.l,height:dim.height+1};this.surface.createRect(rect).setFill(dc.Element.prototype._shapeFill(fill,rect));}if(_606.r){rect={x:dim.width-_606.r,width:_606.r+1,height:dim.height+2};this.surface.createRect(rect).setFill(dc.Element.prototype._shapeFill(fill,rect));}if(_606.t){rect={width:dim.width+1,height:_606.t};this.surface.createRect(rect).setFill(dc.Element.prototype._shapeFill(fill,rect));}if(_606.b){rect={y:dim.height-_606.b,width:dim.width+1,height:_606.b+2};this.surface.createRect(rect).setFill(dc.Element.prototype._shapeFill(fill,rect));}}if(_607){this.surface.createRect({width:dim.width-1,height:dim.height-1}).setStroke(_607);}if(this.title){var _608=(g.renderer=="canvas"),_609=_608||!_4.isIE&&!_4.isOpera?"html":"gfx",_60a=g.normalizedLength(g.splitFontString(this.titleFont).size);this.chartTitle=dc.axis2d.common.createText[_609](this,this.surface,dim.width/2,this.titlePos=="top"?_60a+this.margins.t:dim.height-this.margins.b,"middle",this.title,this.titleFont,this.titleFontColor);}df.forIn(this.axes,function(axis){axis.render(dim,_606);});this._makeClean();if(this.surface.render){this.surface.render();}return this;},delayedRender:function(){if(!this._delayedRenderHandle){this._delayedRenderHandle=setTimeout(_4.hitch(this,function(){clearTimeout(this._delayedRenderHandle);this._delayedRenderHandle=null;this.render();}),this.delayInMs);}return this;},connectToPlot:function(name,_60b,_60c){return name in this.plots?this.stack[this.plots[name]].connect(_60b,_60c):null;},fireEvent:function(_60d,_60e,_60f){if(_60d in this.runs){var _610=this.series[this.runs[_60d]].plot;if(_610 in this.plots){var plot=this.stack[this.plots[_610]];if(plot){plot.fireEvent(_60d,_60e,_60f);}}}return this;},_makeClean:function(){_4.forEach(this.axes,_5d5);_4.forEach(this.stack,_5d5);_4.forEach(this.series,_5d5);this.dirty=false;},_makeDirty:function(){_4.forEach(this.axes,_5d6);_4.forEach(this.stack,_5d6);_4.forEach(this.series,_5d6);this.dirty=true;},_invalidateDependentPlots:function(_611,_612){if(_611 in this.plots){var plot=this.stack[this.plots[_611]],axis,_613=_612?"vAxis":"hAxis";if(plot[_613]){axis=this.axes[plot[_613]];if(axis&&axis.dependOnData()){axis.dirty=true;_4.forEach(this.stack,function(p){if(p[_613]&&p[_613]==plot[_613]){p.dirty=true;}});}}else{plot.dirty=true;}}}});function _614(_615){return {min:_615.hmin,max:_615.hmax};};function _616(_617){return {min:_617.vmin,max:_617.vmax};};function _618(_619,h){_619.hmin=h.min;_619.hmax=h.max;};function _61a(_61b,v){_61b.vmin=v.min;_61b.vmax=v.max;};function _61c(_61d,_61e){if(_61d&&_61e){_61d.min=Math.min(_61d.min,_61e.min);_61d.max=Math.max(_61d.max,_61e.max);}return _61d||_61e;};function _603(_61f,_620){var _621={},axes={};_4.forEach(_61f,function(plot){var _622=_621[plot.name]=plot.getSeriesStats();if(plot.hAxis){axes[plot.hAxis]=_61c(axes[plot.hAxis],_614(_622));}if(plot.vAxis){axes[plot.vAxis]=_61c(axes[plot.vAxis],_616(_622));}});_4.forEach(_61f,function(plot){var _623=_621[plot.name];if(plot.hAxis){_618(_623,axes[plot.hAxis]);}if(plot.vAxis){_61a(_623,axes[plot.vAxis]);}plot.initializeScalers(_620,_623);});};})();}if(!_4._hasResource["dojox.charting.Chart2D"]){_4._hasResource["dojox.charting.Chart2D"]=true;_4.provide("dojox.charting.Chart2D");_4.deprecated("dojox.charting.Chart2D","Use dojo.charting.Chart instead and require all other components explicitly","2.0");_6.charting.Chart2D=_6.charting.Chart;}if(!_4._hasResource["dojox.charting.themes.PlotKit.base"]){_4._hasResource["dojox.charting.themes.PlotKit.base"]=true;_4.provide("dojox.charting.themes.PlotKit.base");(function(){var dc=_6.charting,pk=dc.themes.PlotKit;pk.base=new dc.Theme({chart:{stroke:null,fill:"yellow"},plotarea:{stroke:null,fill:"yellow"},axis:{stroke:{color:"#fff",width:1},line:{color:"#fff",width:0.5},majorTick:{color:"#fff",width:0.5,length:6},minorTick:{color:"#fff",width:0.5,length:3},tick:{font:"normal normal normal 7pt Helvetica,Arial,sans-serif",fontColor:"#999"}},series:{stroke:{width:2.5,color:"#fff"},fill:"#666",font:"normal normal normal 7.5pt Helvetica,Arial,sans-serif",fontColor:"#666"},marker:{stroke:{width:2},fill:"#333",font:"normal normal normal 7pt Helvetica,Arial,sans-serif",fontColor:"#666"},colors:["red","green","blue"]});pk.base.next=function(_624,_625,_626){var _627=dc.Theme.prototype.next.apply(this,arguments);if(_624=="line"){_627.marker.outline={width:2,color:"#fff"};_627.series.stroke.width=3.5;_627.marker.stroke.width=2;}else{if(_624=="candlestick"){_627.series.stroke.width=1;}else{_627.series.stroke.color="#fff";}}return _627;};})();}if(!_4._hasResource["dijit.Tooltip"]){_4._hasResource["dijit.Tooltip"]=true;_4.provide("dijit.Tooltip");_4.declare("dijit._MasterTooltip",[_5._Widget,_5._Templated],{duration:_5.defaultDuration,templateString:_4.cache("dijit","templates/Tooltip.html","<div class=\"dijitTooltip dijitTooltipLeft\" id=\"dojoTooltip\"\r\n\t><div class=\"dijitTooltipContainer dijitTooltipContents\" dojoAttachPoint=\"containerNode\" role='alert'></div\r\n\t><div class=\"dijitTooltipConnector\" dojoAttachPoint=\"connectorNode\"></div\r\n></div>\r\n"),postCreate:function(){_4.body().appendChild(this.domNode);this.bgIframe=new _5.BackgroundIframe(this.domNode);this.fadeIn=_4.fadeIn({node:this.domNode,duration:this.duration,onEnd:_4.hitch(this,"_onShow")});this.fadeOut=_4.fadeOut({node:this.domNode,duration:this.duration,onEnd:_4.hitch(this,"_onHide")});},show:function(_628,_629,_62a,rtl){if(this.aroundNode&&this.aroundNode===_629){return;}this.domNode.width="auto";if(this.fadeOut.status()=="playing"){this._onDeck=arguments;return;}this.containerNode.innerHTML=_628;var pos=_5.placeOnScreenAroundElement(this.domNode,_629,_5.getPopupAroundAlignment((_62a&&_62a.length)?_62a:_5.Tooltip.defaultPosition,!rtl),_4.hitch(this,"orient"));_4.style(this.domNode,"opacity",0);this.fadeIn.play();this.isShowingNow=true;this.aroundNode=_629;},orient:function(node,_62b,_62c,_62d,_62e){this.connectorNode.style.top="";var _62f=_62d.w-this.connectorNode.offsetWidth;node.className="dijitTooltip "+{"BL-TL":"dijitTooltipBelow dijitTooltipABLeft","TL-BL":"dijitTooltipAbove dijitTooltipABLeft","BR-TR":"dijitTooltipBelow dijitTooltipABRight","TR-BR":"dijitTooltipAbove dijitTooltipABRight","BR-BL":"dijitTooltipRight","BL-BR":"dijitTooltipLeft"}[_62b+"-"+_62c];this.domNode.style.width="auto";var size=_4.contentBox(this.domNode);var _630=Math.min((Math.max(_62f,1)),size.w);var _631=_630<size.w;this.domNode.style.width=_630+"px";if(_631){this.containerNode.style.overflow="auto";var _632=this.containerNode.scrollWidth;this.containerNode.style.overflow="visible";if(_632>_630){_632=_632+_4.style(this.domNode,"paddingLeft")+_4.style(this.domNode,"paddingRight");this.domNode.style.width=_632+"px";}}if(_62c.charAt(0)=="B"&&_62b.charAt(0)=="B"){var mb=_4.marginBox(node);var _633=this.connectorNode.offsetHeight;if(mb.h>_62d.h){var _634=_62d.h-(_62e.h/2)-(_633/2);this.connectorNode.style.top=_634+"px";this.connectorNode.style.bottom="";}else{this.connectorNode.style.bottom=Math.min(Math.max(_62e.h/2-_633/2,0),mb.h-_633)+"px";this.connectorNode.style.top="";}}else{this.connectorNode.style.top="";this.connectorNode.style.bottom="";}return Math.max(0,size.w-_62f);},_onShow:function(){if(_4.isIE){this.domNode.style.filter="";}},hide:function(_635){if(this._onDeck&&this._onDeck[1]==_635){this._onDeck=null;}else{if(this.aroundNode===_635){this.fadeIn.stop();this.isShowingNow=false;this.aroundNode=null;this.fadeOut.play();}else{}}},_onHide:function(){this.domNode.style.cssText="";this.containerNode.innerHTML="";if(this._onDeck){this.show.apply(this,this._onDeck);this._onDeck=null;}}});_5.showTooltip=function(_636,_637,_638,rtl){if(!_5._masterTT){_5._masterTT=new _5._MasterTooltip();}return _5._masterTT.show(_636,_637,_638,rtl);};_5.hideTooltip=function(_639){if(!_5._masterTT){_5._masterTT=new _5._MasterTooltip();}return _5._masterTT.hide(_639);};_4.declare("dijit.Tooltip",_5._Widget,{label:"",showDelay:400,connectId:[],position:[],_setConnectIdAttr:function(_63a){_4.forEach(this._connections||[],function(_63b){_4.forEach(_63b,_4.hitch(this,"disconnect"));},this);var ary=_4.isArrayLike(_63a)?_63a:(_63a?[_63a]:[]);this._connections=_4.map(ary,function(id){var node=_4.byId(id);return node?[this.connect(node,"onmouseenter","_onTargetMouseEnter"),this.connect(node,"onmouseleave","_onTargetMouseLeave"),this.connect(node,"onfocus","_onTargetFocus"),this.connect(node,"onblur","_onTargetBlur")]:[];},this);this._set("connectId",_63a);this._connectIds=ary;},addTarget:function(node){var id=node.id||node;if(_4.indexOf(this._connectIds,id)==-1){this.set("connectId",this._connectIds.concat(id));}},removeTarget:function(node){var id=node.id||node,idx=_4.indexOf(this._connectIds,id);if(idx>=0){this._connectIds.splice(idx,1);this.set("connectId",this._connectIds);}},buildRendering:function(){this.inherited(arguments);_4.addClass(this.domNode,"dijitTooltipData");},startup:function(){this.inherited(arguments);var ids=this.connectId;_4.forEach(_4.isArrayLike(ids)?ids:[ids],this.addTarget,this);},_onTargetMouseEnter:function(e){this._onHover(e);},_onTargetMouseLeave:function(e){this._onUnHover(e);},_onTargetFocus:function(e){this._focus=true;this._onHover(e);},_onTargetBlur:function(e){this._focus=false;this._onUnHover(e);},_onHover:function(e){if(!this._showTimer){var _63c=e.target;this._showTimer=setTimeout(_4.hitch(this,function(){this.open(_63c);}),this.showDelay);}},_onUnHover:function(e){if(this._focus){return;}if(this._showTimer){clearTimeout(this._showTimer);delete this._showTimer;}this.close();},open:function(_63d){if(this._showTimer){clearTimeout(this._showTimer);delete this._showTimer;}_5.showTooltip(this.label||this.domNode.innerHTML,_63d,this.position,!this.isLeftToRight());this._connectNode=_63d;this.onShow(_63d,this.position);},close:function(){if(this._connectNode){_5.hideTooltip(this._connectNode);delete this._connectNode;this.onHide();}if(this._showTimer){clearTimeout(this._showTimer);delete this._showTimer;}},onShow:function(_63e,_63f){},onHide:function(){},uninitialize:function(){this.close();this.inherited(arguments);}});_5.Tooltip.defaultPosition=["after","before"];}if(!_4._hasResource["dojox.charting.action2d.Base"]){_4._hasResource["dojox.charting.action2d.Base"]=true;_4.provide("dojox.charting.action2d.Base");(function(){var _640=400,_641=_4.fx.easing.backOut,df=_6.lang.functional;_4.declare("dojox.charting.action2d.Base",null,{overOutEvents:{onmouseover:1,onmouseout:1},constructor:function(_642,plot,_643){this.chart=_642;this.plot=plot||"default";this.anim={};if(!_643){_643={};}this.duration=_643.duration?_643.duration:_640;this.easing=_643.easing?_643.easing:_641;},connect:function(){this.handle=this.chart.connectToPlot(this.plot,this,"process");},disconnect:function(){if(this.handle){_4.disconnect(this.handle);this.handle=null;}},reset:function(){},destroy:function(){this.disconnect();df.forIn(this.anim,function(o){df.forIn(o,function(anim){anim.action.stop(true);});});this.anim={};}});})();}if(!_4._hasResource["dojox.lang.functional.scan"]){_4._hasResource["dojox.lang.functional.scan"]=true;_4.provide("dojox.lang.functional.scan");(function(){var d=_4,df=_6.lang.functional,_644={};d.mixin(df,{scanl:function(a,f,z,o){if(typeof a=="string"){a=a.split("");}o=o||d.global;f=df.lambda(f);var t,n,i;if(d.isArray(a)){t=new Array((n=a.length)+1);t[0]=z;for(i=0;i<n;z=f.call(o,z,a[i],i,a),t[++i]=z){}}else{if(typeof a.hasNext=="function"&&typeof a.next=="function"){t=[z];for(i=0;a.hasNext();t.push(z=f.call(o,z,a.next(),i++,a))){}}else{t=[z];for(i in a){if(!(i in _644)){t.push(z=f.call(o,z,a[i],i,a));}}}}return t;},scanl1:function(a,f,o){if(typeof a=="string"){a=a.split("");}o=o||d.global;f=df.lambda(f);var t,n,z,_645=true;if(d.isArray(a)){t=new Array(n=a.length);t[0]=z=a[0];for(var i=1;i<n;t[i]=z=f.call(o,z,a[i],i,a),++i){}}else{if(typeof a.hasNext=="function"&&typeof a.next=="function"){if(a.hasNext()){t=[z=a.next()];for(var i=1;a.hasNext();t.push(z=f.call(o,z,a.next(),i++,a))){}}}else{for(var i in a){if(!(i in _644)){if(_645){t=[z=a[i]];_645=false;}else{t.push(z=f.call(o,z,a[i],i,a));}}}}}return t;},scanr:function(a,f,z,o){if(typeof a=="string"){a=a.split("");}o=o||d.global;f=df.lambda(f);var n=a.length,t=new Array(n+1),i=n;t[n]=z;for(;i>0;--i,z=f.call(o,z,a[i],i,a),t[i]=z){}return t;},scanr1:function(a,f,o){if(typeof a=="string"){a=a.split("");}o=o||d.global;f=df.lambda(f);var n=a.length,t=new Array(n),z=a[n-1],i=n-1;t[i]=z;for(;i>0;--i,z=f.call(o,z,a[i],i,a),t[i]=z){}return t;}});})();}if(!_4._hasResource["dojox.charting.action2d.Tooltip"]){_4._hasResource["dojox.charting.action2d.Tooltip"]=true;_4.provide("dojox.charting.action2d.Tooltip");(function(){var _646=function(o){var t=o.run&&o.run.data&&o.run.data[o.index];if(t&&typeof t!="number"&&(t.tooltip||t.text)){return t.tooltip||t.text;}if(o.element=="candlestick"){return "<table cellpadding=\"1\" cellspacing=\"0\" border=\"0\" style=\"font-size:0.9em;\">"+"<tr><td>Open:</td><td align=\"right\"><strong>"+o.data.open+"</strong></td></tr>"+"<tr><td>High:</td><td align=\"right\"><strong>"+o.data.high+"</strong></td></tr>"+"<tr><td>Low:</td><td align=\"right\"><strong>"+o.data.low+"</strong></td></tr>"+"<tr><td>Close:</td><td align=\"right\"><strong>"+o.data.close+"</strong></td></tr>"+(o.data.mid!==undefined?"<tr><td>Mid:</td><td align=\"right\"><strong>"+o.data.mid+"</strong></td></tr>":"")+"</table>";}return o.element=="bar"?o.x:o.y;};var df=_6.lang.functional,m=_6.gfx.matrix,pi4=Math.PI/4,pi2=Math.PI/2;_4.declare("dojox.charting.action2d.Tooltip",_6.charting.action2d.Base,{defaultParams:{text:_646},optionalParams:{},constructor:function(_647,plot,_648){this.text=_648&&_648.text?_648.text:_646;this.connect();},process:function(o){if(o.type==="onplotreset"||o.type==="onmouseout"){_5.hideTooltip(this.aroundRect);this.aroundRect=null;if(o.type==="onplotreset"){delete this.angles;}return;}if(!o.shape||o.type!=="onmouseover"){return;}var _649={type:"rect"},_64a=["after","before"];switch(o.element){case "marker":_649.x=o.cx;_649.y=o.cy;_649.width=_649.height=1;break;case "circle":_649.x=o.cx-o.cr;_649.y=o.cy-o.cr;_649.width=_649.height=2*o.cr;break;case "column":_64a=["above","below"];case "bar":_649=_4.clone(o.shape.getShape());break;case "candlestick":_649.x=o.x;_649.y=o.y;_649.width=o.width;_649.height=o.height;break;default:if(!this.angles){if(typeof o.run.data[0]=="number"){this.angles=df.map(df.scanl(o.run.data,"+",0),"* 2 * Math.PI / this",df.foldl(o.run.data,"+",0));}else{this.angles=df.map(df.scanl(o.run.data,"a + b.y",0),"* 2 * Math.PI / this",df.foldl(o.run.data,"a + b.y",0));}}var _64b=m._degToRad(o.plot.opt.startAngle),_64c=(this.angles[o.index]+this.angles[o.index+1])/2+_64b;_649.x=o.cx+o.cr*Math.cos(_64c);_649.y=o.cy+o.cr*Math.sin(_64c);_649.width=_649.height=1;if(_64c<pi4){}else{if(_64c<pi2+pi4){_64a=["below","above"];}else{if(_64c<Math.PI+pi4){_64a=["before","after"];}else{if(_64c<2*Math.PI-pi4){_64a=["above","below"];}}}}break;}var lt=_4.coords(this.chart.node,true);_649.x+=lt.x;_649.y+=lt.y;_649.x=Math.round(_649.x);_649.y=Math.round(_649.y);_649.width=Math.ceil(_649.width);_649.height=Math.ceil(_649.height);this.aroundRect=_649;var _64d=this.text(o);if(_64d){_5.showTooltip(_64d,this.aroundRect,_64a);}}});})();}if(!_4._hasResource["esri.dijit.Popup"]){_4._hasResource["esri.dijit.Popup"]=true;_4.provide("esri.dijit.Popup");(function(){var dc=_6.charting,pk=dc.themes.PlotKit;pk.popup=pk.base.clone();pk.popup.chart.fill=pk.popup.plotarea.fill="#e7eef6";pk.popup.colors=["#284B70","#702828","#5F7143","#F6BC0C","#382C6C","#50224F","#1D7554","#4C4C4C","#0271AE","#706E41","#446A73","#0C3E69","#757575","#B7B7B7","#A3A3A3"];pk.popup.series.stroke.width=1;pk.popup.marker.stroke.width=1;}());_4.declare("esri.dijit.Popup",[esri.InfoWindowBase,esri.PopupBase],{offsetX:3,offsetY:3,zoomFactor:4,marginLeft:10,marginTop:10,highlight:true,constructor:function(_64e,_64f){this.initialize();_4.mixin(this,_64e);this.domNode=_4.byId(_64f);var nls=this._nls=_4.mixin({},esri.bundle.widgets.popup);var _650=this.domNode;_4.addClass(_650,"esriPopup");var _651="<div class='esriPopupWrapper' style='position: absolute;'>"+"<div class='sizer'>"+"<div class='titlePane'>"+"<div class='spinner hidden' title='"+nls.NLS_searching+"...'></div>"+"<div class='title'></div>"+"<div class='titleButton prev hidden' title='"+nls.NLS_prevFeature+"'></div>"+"<div class='titleButton next hidden' title='"+nls.NLS_nextFeature+"'></div>"+"<div class='titleButton maximize' title='"+nls.NLS_maximize+"'></div>"+"<div class='titleButton close' title='"+nls.NLS_close+"'></div>"+"</div>"+"</div>"+"<div class='sizer content'>"+"<div class='contentPane'>"+"</div>"+"</div>"+"<div class='sizer'>"+"<div class='actionsPane'>"+"<div class='actionList hidden'>"+"<a class='action zoomTo' href='javascript:void(0);'>"+nls.NLS_zoomTo+"</a>"+"</div>"+"</div>"+"</div>"+"<div class='pointer hidden'></div>"+"</div>"+"<div class='outerPointer hidden'></div>";_4.attr(_650,"innerHTML",_651);this._sizers=_4.query(".sizer",_650);var _652=_4.query(".titlePane",_650)[0];_4.setSelectable(_652,false);this._title=_4.query(".title",_652)[0];this._prevFeatureButton=_4.query(".prev",_652)[0];this._nextFeatureButton=_4.query(".next",_652)[0];this._maxButton=_4.query(".maximize",_652)[0];this._spinner=_4.query(".spinner",_652)[0];this._contentPane=_4.query(".contentPane",_650)[0];this._positioner=_4.query(".esriPopupWrapper",_650)[0];this._pointer=_4.query(".pointer",_650)[0];this._outerPointer=_4.query(".outerPointer",_650)[0];this._actionList=_4.query(".actionsPane .actionList",_650)[0];this._eventConnections=[_4.connect(_4.query(".close",_652)[0],"onclick",this,this.hide),_4.connect(this._prevFeatureButton,"onclick",this,this.selectPrevious),_4.connect(this._nextFeatureButton,"onclick",this,this.selectNext),_4.connect(this._maxButton,"onclick",this,this._toggleSize),_4.connect(_4.query(".zoomTo",this._actionList)[0],"onclick",this,this._zoomToFeature)];if(esri.isTouchEnabled){var _653=esri.setScrollable(this._contentPane);this._eventConnections.push(_653[0],_653[1]);}this._setVisibility(false);this.isShowing=false;},setMap:function(map){this.inherited(arguments);_4.place(this.domNode,map.root);if(this.highlight){this.enableHighlight(map);}this._maxHeight=_4.style(this._contentPane,"maxHeight");},unsetMap:function(){this.disableHighlight(this.map);this.inherited(arguments);},setTitle:function(_654){if(!esri._isDefined(_654)||_654===""){_654="&nbsp;";}this.destroyDijits(this._title);this.place(_654,this._title);if(this.isShowing){this.startupDijits(this._title);this.reposition();}},setContent:function(_655){if(!esri._isDefined(_655)||_655===""){_655="&nbsp;";}this.destroyDijits(this._contentPane);this.place(_655,this._contentPane);if(this.isShowing){this.startupDijits(this._contentPane);this.reposition();}},show:function(_656){if(!_656){this._setVisibility(true);this.isShowing=true;return;}var map=this.map,_657;if(_656.spatialReference){this._location=_656;_657=map.toScreen(_656);}else{this._location=map.toMap(_656);_657=_656;}var _658=map._getFrameWidth();if(_658!==-1){_657.x=_657.x%_658;if(_657.x<0){_657.x+=_658;}if(map.width>_658){var _659=(map.width-_658)/2;while(_657.x<_659){_657.x+=_658;}}}if(this._maximized){this.restore();}else{this._setPosition(_657);}if(!this.isShowing){this._setVisibility(true);this.isShowing=true;this.onShow();}},hide:function(){if(this.isShowing){this._setVisibility(false);this.isShowing=false;this.onHide();}},resize:function(_65a,_65b){this._sizers.style({width:_65a+"px"});_4.style(this._contentPane,"maxHeight",_65b+"px");this._maxHeight=_65b;if(this.isShowing){this.reposition();}},reposition:function(){if(this.map&&this._location&&!this._maximized&&this.isShowing){this._setPosition(this.map.toScreen(this._location));}},onShow:function(){this._followMap();this.startupDijits(this._title);this.startupDijits(this._contentPane);this.reposition();this.showHighlight();},onHide:function(){this._unfollowMap();this.hideHighlight();},maximize:function(){var map=this.map;if(!map||this._maximized){return;}this._maximized=true;var max=this._maxButton;_4.removeClass(max,"maximize");_4.addClass(max,"restore");_4.attr(max,"title",this._nls.NLS_restore);var _65c=this.marginLeft,_65d=this.marginTop,_65e=map.width-(2*_65c),_65f=map.height-(2*_65d),_660=this.domNode;_4.style(_660,{left:_65c+"px",right:null,top:_65d+"px",bottom:null});_4.style(this._positioner,{left:null,right:null,top:null,bottom:null});this._savedWidth=_4.style(this._sizers[0],"width");this._savedHeight=_4.style(this._contentPane,"maxHeight");this._sizers.style({width:_65e+"px"});_4.style(this._contentPane,{maxHeight:(_65f-65)+"px",height:(_65f-65)+"px"});this._showPointer("");this._unfollowMap();_4.addClass(this.domNode,"esriPopupMaximized");this.onMaximize();},restore:function(){var map=this.map;if(!map||!this._maximized){return;}this._maximized=false;var max=this._maxButton;_4.removeClass(max,"restore");_4.addClass(max,"maximize");_4.attr(max,"title",this._nls.NLS_maximize);_4.style(this._contentPane,"height",null);this.resize(this._savedWidth,this._savedHeight);this._savedWidth=this._savedHeight=null;this.show(this._location);this._followMap();_4.removeClass(this.domNode,"esriPopupMaximized");this.onRestore();},destroy:function(){if(this.map){this.unsetMap();}this.cleanup();if(this.isShowing){this.hide();}this.destroyDijits(this._title);this.destroyDijits(this._content);_4.forEach(this._eventConnections,_4.disconnect);_4.destroy(this.domNode);this._sizers=this._contentPane=this._actionList=this._positioner=this._pointer=this._outerPointer=this._title=this._prevFeatureButton=this._nextFeatureButton=this._spinner=this._eventConnections=this._pagerScope=this._targetLocation=this._nls=this._maxButton=null;},selectNext:function(){this.select(this.selectedIndex+1);},selectPrevious:function(){this.select(this.selectedIndex-1);},setFeatures:function(){this.inherited(arguments);this._updateUI();},onSetFeatures:function(){},onClearFeatures:function(){this.setTitle("&nbsp;");this.setContent("&nbsp;");this._setPagerCallbacks(this);this._updateUI();this.hideHighlight();},onSelectionChange:function(){var ptr=this.selectedIndex;this._updateUI();if(ptr>=0){this.setContent(this.features[ptr].getContent());this.updateHighlight(this.map,this.features[ptr]);if(this.isShowing){this.showHighlight();}}},onDfdComplete:function(){this._updateUI();},onMaximize:function(){},onRestore:function(){},_setVisibility:function(_661){_4.style(this.domNode,"visibility",_661?"visible":"hidden");},_followMap:function(){this._unfollowMap();var map=this.map;this._handles=[_4.connect(map,"onPanStart",this,this._onPanStart),_4.connect(map,"onPan",this,this._onPan),_4.connect(map,"onZoomStart",this,this._onZoomStart),_4.connect(map,"onExtentChange",this,this._onExtentChange)];},_unfollowMap:function(){var _662=this._handles;if(_662){_4.forEach(_662,_4.disconnect,_4);this._handles=null;}},_onPanStart:function(){var _663=this.domNode.style;this._panOrigin={left:_663.left,top:_663.top,right:_663.right,bottom:_663.bottom};},_onPan:function(_664,_665){var _666=this._panOrigin,dx=_665.x,dy=_665.y,left=_666.left,top=_666.top,_667=_666.right,_668=_666.bottom;if(left){left=(parseFloat(left)+dx)+"px";}if(top){top=(parseFloat(top)+dy)+"px";}if(_667){_667=(parseFloat(_667)-dx)+"px";}if(_668){_668=(parseFloat(_668)-dy)+"px";}_4.style(this.domNode,{left:left,top:top,right:_667,bottom:_668});},_onZoomStart:function(){this._setVisibility(false);},_onExtentChange:function(_669,_66a,_66b){if(_66b){this._setVisibility(true);this.show(this._targetLocation||this._location);}this._targetLocation=null;},_toggleSize:function(){if(this._maximized){this.restore();}else{this.maximize();}},_setPosition:function(_66c){var posX=_66c.x,posY=_66c.y,offX=this.offsetX||0,offY=this.offsetY||0,_66d=0,_66e=0,_66f=_4.position(this.map.container,true),_670=_66f.w,_671=_66f.h,_672="Left",_673="bottom",_674=_4.contentBox(this._positioner),_675=_674.w/2,_676=_674.h/2,maxH=_4.style(this._sizers[0],"height")+this._maxHeight+_4.style(this._sizers[2],"height"),_677=maxH/2,xmin=0,ymin=0,xmax=_670,ymax=_671,_678=posX,_679=posY;var _67a=_4.getObject("dojo.window.getBox");if(_67a){_67a=_67a();xmin=Math.max(_67a.l,_66f.x);xmax=Math.min(_67a.l+_67a.w,_66f.x+_66f.w);ymin=Math.max(_67a.t,_66f.y);ymax=Math.min(_67a.t+_67a.h,_66f.y+_66f.h);_678+=_66f.x;_679+=_66f.y;}if(((_679-ymin)>_677)&&((ymax-_679)>=_677)){if((xmax-_678)>=_674.w){_673="";_672="Left";}else{if((_678-xmin)>=_674.w){_673="";_672="Right";}}}if(_672&&_673){if(((_678-xmin)>_675)&&((xmax-_678)>=_675)){if((_679-ymin)>=maxH){_672="";_673="bottom";}else{if((ymax-_679)>=maxH){_672="";_673="top";}}}}if(_672&&_673){if(_678<=xmax/2){_672="Left";}else{if(_678<=xmax){_672="Right";}}if(_679<=ymax/2){_673="top";}else{if(_679<=ymax){_673="bottom";}}}var _67b=_673+_672;switch(_67b){case "top":case "bottom":_66e=14;break;case "Left":case "Right":_66d=13;break;case "topLeft":case "topRight":case "bottomLeft":case "bottomRight":_66e=45;break;}_4.style(this.domNode,{left:posX+"px",top:posY+"px",right:null,bottom:null});var _67c={left:null,right:null,top:null,bottom:null};if(_672){_67c[_672.toLowerCase()]=(_66d+offX)+"px";}else{_67c.left=(-_675)+"px";}if(_673){_67c[_673]=(_66e+offY)+"px";}else{_67c.top=(-_676)+"px";}_4.style(this._positioner,_67c);this._showPointer(_67b);},_showPointer:function(_67d){_4.removeClass(this._pointer,["top","bottom","right","left","topLeft","topRight","bottomRight","bottomLeft","hidden"]);_4.removeClass(this._outerPointer,["right","left","hidden"]);if(_67d==="Right"||_67d==="Left"){_67d=_67d.toLowerCase();_4.addClass(this._outerPointer,_67d);}else{_4.addClass(this._pointer,_67d);}},_setPagerCallbacks:function(_67e,_67f,_680){if(_67e===this&&(!this._pagerScope||this._pagerScope===this)){return;}if(_67e===this._pagerScope){return;}this._pagerScope=_67e;if(_67e===this){_67f=this.selectPrevious;_680=this.selectNext;}var _681=this._eventConnections;_4.disconnect(_681[1]);_4.disconnect(_681[2]);if(_67f){_681[1]=_4.connect(this._prevFeatureButton,"onclick",_67e,_67f);}if(_680){_681[2]=_4.connect(this._nextFeatureButton,"onclick",_67e,_680);}},_zoomToFeature:function(){var _682=this.features,ptr=this.selectedIndex,map=this.map;if(_682){var _683=_682[ptr].geometry,_684,_685,_686=0,_687;if(_683){switch(_683.type){case "point":_684=_683;break;case "multipoint":_684=_683.getPoint(0);_685=_683.getExtent();break;case "polyline":_684=_683.getPoint(0,0);_685=_683.getExtent();if(map._getFrameWidth()!==-1){_4.forEach(_683.paths,function(path){var _688={"paths":[path,map.spatialReference]},_689=new esri.geometry.Polyline(_688),_68a=_689.getExtent(),_68b=Math.abs(_68a.ymax-_68a.ymin),_68c=Math.abs(_68a.xmax-_68a.xmin),_68d=(_68c>_68b)?_68c:_68b;if(_68d>_686){_686=_68d;_687=_68a;}});_687.spatialReference=_685.spatialReference;_685=_687;}break;case "polygon":_684=_683.getPoint(0,0);_685=_683.getExtent();if(map._getFrameWidth()!==-1){_4.forEach(_683.rings,function(ring){var _68e={"rings":[ring,map.spatialReference]},_68f=new esri.geometry.Polygon(_68e),_690=_68f.getExtent(),_691=Math.abs(_690.ymax-_690.ymin),_692=Math.abs(_690.xmax-_690.xmin),_693=(_692>_691)?_692:_691;if(_693>_686){_686=_693;_687=_690;}});_687.spatialReference=_685.spatialReference;_685=_687;}break;}}if(!_684){_684=this._location;}if(!_685||!_685.intersects(this._location)){this._location=_684;}if(_685){map.setExtent(_685,true);}else{var _694=map.getNumLevels(),_695=map.getLevel(),last=_694-1,_696=this.zoomFactor||1;if(_694>0){if(_695===last){return;}var _697=_695+_696;if(_697>last){_697=last;}map._scrollZoomHandler({value:(_697-_695),mapPoint:_684},true);}else{map._scrollZoomHandler({value:(1/Math.pow(2,_696))*2,mapPoint:_684},true);}}}},_updateUI:function(){var _698="&nbsp;",ptr=this.selectedIndex,_699=this.features,_69a=this.deferreds,prev=this._prevFeatureButton,next=this._nextFeatureButton,_69b=this._spinner,_69c=this._actionList,nls=this._nls;if(_699&&_699.length>1){if(nls.NLS_pagingInfo){_698=esri.substitute({index:(ptr+1),total:_699.length},nls.NLS_pagingInfo);}if(ptr===0){_4.addClass(prev,"hidden");}else{_4.removeClass(prev,"hidden");}if(ptr===_699.length-1){_4.addClass(next,"hidden");}else{_4.removeClass(next,"hidden");}}else{_4.addClass(prev,"hidden");_4.addClass(next,"hidden");}this.setTitle(_698);if(_69a&&_69a.length){if(_699){_4.removeClass(_69b,"hidden");}else{this.setContent("<div style='text-align: center;'>"+nls.NLS_searching+"...</div>");}}else{_4.addClass(_69b,"hidden");if(!_699||!_699.length){this.setContent("<div style='text-align: center;'>"+nls.NLS_noInfo+".</div>");}}if(_699&&_699.length){_4.removeClass(_69c,"hidden");}else{_4.addClass(_69c,"hidden");}}});_4.declare("esri.dijit.PopupTemplate",[esri.PopupInfoTemplate],{chartTheme:"dojox.charting.themes.PlotKit.popup",constructor:function(json,_69d){_4.mixin(this,_69d);this.initialize(json);this._nls=_4.mixin({},esri.bundle.widgets.popup);},getTitle:function(_69e){return this.info?this.getComponents(_69e).title:"";},getContent:function(_69f){return this.info?new esri.dijit._PopupRenderer({template:this,graphic:_69f,chartTheme:this.chartTheme,_nls:this._nls},_4.create("div")).domNode:"";}});_4.declare("esri.dijit._PopupRenderer",[_5._Widget,_5._Templated],{templateString:"<div class='esriViewPopup'>"+"<div class='mainSection'>"+"<div class='header' dojoAttachPoint='_title'></div>"+"<div class='hzLine'></div>"+"<div dojoAttachPoint='_description'></div>"+"<div class='break'></div>"+"</div>"+"<div class='attachmentsSection hidden'>"+"<div>${_nls.NLS_attach}:</div>"+"<ul dojoAttachPoint='_attachmentsList'>"+"</ul>"+"<div class='break'></div>"+"</div>"+"<div class='mediaSection hidden'>"+"<div class='header' dojoAttachPoint='_mediaTitle'></div>"+"<div class='hzLine'></div>"+"<div class='caption' dojoAttachPoint='_mediaCaption'></div>"+"<div class='gallery' dojoAttachPoint='_gallery'>"+"<div class='mediaHandle prev' dojoAttachPoint='_prevMedia' dojoAttachEvent='onclick: _goToPrevMedia'></div>"+"<div class='mediaHandle next' dojoAttachPoint='_nextMedia' dojoAttachEvent='onclick: _goToNextMedia'></div>"+"<ul class='summary'>"+"<li class='image mediaCount hidden' dojoAttachPoint='_imageCount'>0</li>"+"<li class='image mediaIcon hidden'></li>"+"<li class='chart mediaCount hidden' dojoAttachPoint='_chartCount'>0</li>"+"<li class='chart mediaIcon hidden'></li>"+"</ul>"+"<div class='frame' dojoAttachPoint='_mediaFrame'></div>"+"</div>"+"</div>"+"<div class='editSummarySection hidden' dojoAttachPoint='_editSummarySection'>"+"<div class='break'></div>"+"<div class='break hidden' dojoAttachPoint='_mediaBreak'></div>"+"<div class='editSummary' dojoAttachPoint='_editSummary'></div>"+"</div>"+"</div>",startup:function(){this.inherited(arguments);var _6a0=this.template,_6a1=this.graphic,_6a2=_6a0.getComponents(_6a1),_6a3=_6a2.title,_6a4=_6a2.description,_6a5=_6a2.fields,_6a6=_6a2.mediaInfos,_6a7=this.domNode,nls=this._nls;this._prevMedia.title=nls.NLS_prevMedia;this._nextMedia.title=nls.NLS_nextMedia;_4.attr(this._title,"innerHTML",_6a3);if(!_6a3){_4.addClass(this._title,"hidden");}if(!_6a4&&_6a5){_6a4="";_4.forEach(_6a5,function(row){_6a4+=("<tr valign='top'>");_6a4+=("<td class='attrName'>"+row[0]+"</td>");_6a4+=("<td class='attrValue'>"+row[1].replace(/^\s*(https?:\/\/[^\s]+)\s*$/i,"<a target='_blank' href='$1' title='$1'>More info</a>")+"</td>");_6a4+=("</tr>");});if(_6a4){_6a4="<table class='attrTable' cellpadding='0px' cellspacing='0px'>"+_6a4+"</table>";}}_4.attr(this._description,"innerHTML",_6a4);if(!_6a4){_4.addClass(this._description,"hidden");}_4.query("a",this._description).forEach(function(node){_4.attr(node,"target","_blank");});if(_6a3&&_6a4){_4.query(".mainSection .hzLine",_6a7).removeClass("hidden");}else{if(_6a3||_6a4){_4.query(".mainSection .hzLine",_6a7).addClass("hidden");}else{_4.query(".mainSection",_6a7).addClass("hidden");}}var dfd=(this._dfd=_6a0.getAttachments(_6a1));if(dfd){dfd.addBoth(_4.hitch(this,this._attListHandler,dfd));_4.attr(this._attachmentsList,"innerHTML","<li>"+nls.NLS_searching+"...</li>");_4.query(".attachmentsSection",_6a7).removeClass("hidden");}if(_6a6&&_6a6.length){_4.query(".mediaSection",_6a7).removeClass("hidden");_4.setSelectable(this._mediaFrame,false);this._mediaInfos=_6a6;this._mediaPtr=0;this._updateUI();this._displayMedia();}if(_6a2.editSummary){_4.attr(this._editSummary,"innerHTML",_6a2.editSummary);if(_6a6&&_6a6.length){_4.removeClass(this._mediaBreak,"hidden");}_4.removeClass(this._editSummarySection,"hidden");}},destroy:function(){if(this._dfd){this._dfd.cancel();}this._destroyFrame();this.template=this.graphic=this._nls=this._mediaInfos=this._mediaPtr=this._dfd=null;this.inherited(arguments);},_goToPrevMedia:function(){var ptr=this._mediaPtr-1;if(ptr<0){return;}this._mediaPtr--;this._updateUI();this._displayMedia();},_goToNextMedia:function(){var ptr=this._mediaPtr+1;if(ptr===this._mediaInfos.length){return;}this._mediaPtr++;this._updateUI();this._displayMedia();},_updateUI:function(){var _6a8=this._mediaInfos,_6a9=_6a8.length,_6aa=this.domNode,_6ab=this._prevMedia,_6ac=this._nextMedia;if(_6a9>1){var _6ad=0,_6ae=0;_4.forEach(_6a8,function(info){if(info.type==="image"){_6ad++;}else{if(info.type.indexOf("chart")!==-1){_6ae++;}}});if(_6ad){_4.attr(this._imageCount,"innerHTML",_6ad);_4.query(".summary .image",_6aa).removeClass("hidden");}if(_6ae){_4.attr(this._chartCount,"innerHTML",_6ae);_4.query(".summary .chart",_6aa).removeClass("hidden");}}else{_4.query(".summary",_6aa).addClass("hidden");_4.addClass(_6ab,"hidden");_4.addClass(_6ac,"hidden");}var ptr=this._mediaPtr;if(ptr===0){_4.addClass(_6ab,"hidden");}else{_4.removeClass(_6ab,"hidden");}if(ptr===_6a9-1){_4.addClass(_6ac,"hidden");}else{_4.removeClass(_6ac,"hidden");}this._destroyFrame();},_displayMedia:function(){var info=this._mediaInfos[this._mediaPtr],_6af=info.title,_6b0=info.caption,_6b1=_4.query(".mediaSection .hzLine",this.domNode)[0];_4.attr(this._mediaTitle,"innerHTML",_6af);_4[_6af?"removeClass":"addClass"](this._mediaTitle,"hidden");_4.attr(this._mediaCaption,"innerHTML",_6b0);_4[_6b0?"removeClass":"addClass"](this._mediaCaption,"hidden");_4[(_6af&&_6b0)?"removeClass":"addClass"](_6b1,"hidden");if(info.type==="image"){this._showImage(info.value);}else{this._showChart(info.type,info.value);}},_showImage:function(_6b2){_4.addClass(this._mediaFrame,"image");var _6b3=_4.style(this._gallery,"height"),html="<img src='"+_6b2.sourceURL+"' onload='esri.dijit._PopupRenderer.prototype._imageLoaded(this,"+_6b3+");' />";if(_6b2.linkURL){html="<a target='_blank' href='"+_6b2.linkURL+"'>"+html+"</a>";}_4.attr(this._mediaFrame,"innerHTML",html);},_showChart:function(type,_6b4){_4.removeClass(this._mediaFrame,"image");var _6b5=this._chart=new _6.charting.Chart2D(_4.create("div",{"class":"chart"},this._mediaFrame),{margins:{l:4,t:4,r:4,b:4}});var _6b6=_6b4.theme||this.chartTheme||"PlotKit.popup";_6b5.setTheme(_4.getObject(_6b6)||_4.getObject("dojox.charting.themes."+_6b6));switch(type){case "piechart":_6b5.addPlot("default",{type:"Pie",labels:false});_6b5.addSeries("Series A",_6b4.fields);break;case "linechart":_6b5.addPlot("default",{type:"Markers"});_6b5.addAxis("x",{min:0,majorTicks:false,minorTicks:false,majorLabels:false,minorLabels:false});_6b5.addAxis("y",{includeZero:true,vertical:true,fixUpper:"minor"});_4.forEach(_6b4.fields,function(info,idx){info.x=idx+1;});_6b5.addSeries("Series A",_6b4.fields);break;case "columnchart":_6b5.addPlot("default",{type:"Columns",gap:3});_6b5.addAxis("y",{includeZero:true,vertical:true,fixUpper:"minor"});_6b5.addSeries("Series A",_6b4.fields);break;case "barchart":_6b5.addPlot("default",{type:"Bars",gap:3});_6b5.addAxis("x",{includeZero:true,fixUpper:"minor",minorLabels:false});_6b5.addAxis("y",{vertical:true,majorTicks:false,minorTicks:false,majorLabels:false,minorLabels:false});_6b5.addSeries("Series A",_6b4.fields);break;}this._action=new _6.charting.action2d.Tooltip(_6b5);_6b5.render();},_destroyFrame:function(){if(this._chart){this._chart.destroy();this._chart=null;}if(this._action){this._action.destroy();this._action=null;}_4.attr(this._mediaFrame,"innerHTML","");},_imageLoaded:function(img,_6b7){var _6b8=img.height;if(_6b8<_6b7){var diff=Math.round((_6b7-_6b8)/2);_4.style(img,"marginTop",diff+"px");}},_attListHandler:function(dfd,_6b9){if(dfd===this._dfd){this._dfd=null;var html="";if(!(_6b9 instanceof Error)&&_6b9&&_6b9.length){_4.forEach(_6b9,function(info){html+=("<li>");html+=("<a href='"+info.url+"' target='_blank'>"+(info.name||"[No name]")+"</a>");html+=("</li>");});}_4.attr(this._attachmentsList,"innerHTML",html||"<li>"+this._nls.NLS_noAttach+"</li>");}}});}if(!_4._hasResource["esri.layers.KMLLayer"]){_4._hasResource["esri.layers.KMLLayer"]=true;_4.provide("esri.layers.KMLLayer");_4.declare("esri.layers.KMLLayer",[esri.layers.Layer],{serviceUrl:"http://utility.arcgis.com/sharing/kml",constructor:function(url,_6ba){if(!url){console.log("KMLLayer:constructor - please provide url for the KML file");}this._outSR=(_6ba&&_6ba.outSR)||new esri.SpatialReference({wkid:4326});this._options=_6ba;if(esri.config.defaults.kmlService){this.serviceUrl=esri.config.defaults.kmlService;}var link=(this.linkInfo=_6ba&&_6ba.linkInfo);if(link){this.visible=!!link.visibility;this._waitingForMap=!!link.viewFormat;}if(!link||(link&&link.visibility&&!this._waitingForMap)){this._parseKml();}this.refresh=_4.hitch(this,this.refresh);},getFeature:function(_6bb){if(!_6bb){return;}var type=_6bb.type,id=_6bb.id,_6bc,i,len;switch(type){case "esriGeometryPoint":case "esriGeometryPolyline":case "esriGeometryPolygon":var _6bd=this["_"+type];if(_6bd){_6bc=_4.getObject("_mode._featureMap."+id,false,_6bd);}break;case "GroundOverlay":var _6be=this._groundLyr;if(_6be){var _6bf=_6be.getImages();len=_6bf.length;for(i=0;i<len;i++){if(_6bf[i].id===id){_6bc=_6bf[i];break;}}}break;case "ScreenOverlay":break;case "NetworkLink":_4.some(this._links,function(link){if(link.linkInfo&&link.linkInfo.id===id){_6bc=link;return true;}else{return false;}});break;case "Folder":var _6c0=this.folders;len=_6c0?_6c0.length:0;for(i=0;i<len;i++){if(_6c0[i].id===id){_6bc=_6c0[i];break;}}break;default:console.log("KMLLayer:getFeature - unknown feature type");break;}return _6bc;},getLayers:function(){var _6c1=[];if(this._groundLyr){_6c1.push(this._groundLyr);}if(this._fLayers){_6c1=_6c1.concat(this._fLayers);}if(this._links){_4.forEach(this._links,function(link){if(link.declaredClass){_6c1.push(link);}});}return _6c1;},setFolderVisibility:function(_6c2,_6c3){if(!_6c2){return;}this._fireUpdateStart();_6c2.visible=_6c3;if(_6c3){_6c3=this._areLocalAncestorsVisible(_6c2);}this._setState(_6c2,_6c3);this._fireUpdateEnd();},onRefresh:function(){},_parseKml:function(map){var self=this;this._fireUpdateStart();this._io=esri.request({url:this.serviceUrl,content:{url:this._url.path+this._getQueryParameters(map),model:"simple",folders:"",refresh:this.loaded?true:undefined,outSR:_4.toJson(this._outSR.toJson())},callbackParamName:"callback",load:function(_6c4){self._io=null;self._initLayer(_6c4);},error:function(err){self._io=null;err=_4.mixin(new Error(),err);err.message="Unable to load KML: "+self.url+" "+(err.message||"");self._fireUpdateEnd(err);self.onError(err);}});},_initLayer:function(json){if(this.loaded){this._removeInternalLayers();}this.name=json.name;this.description=json.description;this.snippet=json.snippet;this.visibility=json.visibility;this.featureInfos=json.featureInfos;var i,len;var _6c5=(this.folders=json.folders),_6c6=[],fldr;if(_6c5){len=_6c5.length;for(i=0;i<len;i++){fldr=(_6c5[i]=new esri.layers.KMLFolder(_6c5[i]));if(fldr.parentFolderId===-1){_6c6.push(fldr);}}}var _6c7=(this._links=json.networkLinks),_6c8;len=_6c7?_6c7.length:0;for(i=0;i<len;i++){if(_6c7[i].viewRefreshMode&&_6c7[i].viewRefreshMode.toLowerCase().indexOf("onregion")!==-1){continue;}_6c8=_4.mixin({},this._options);_6c8.linkInfo=_6c7[i];if(_6c8.id){_6c8.id=_6c8.id+"_"+i;}_6c7[i]=new esri.layers.KMLLayer(_6c7[i].href,_6c8);_6c7[i]._parentLayer=this;_6c7[i]._parentFolderId=this._getLinkParentId(_6c7[i].linkInfo.id);}var _6c9=json.groundOverlays;if(_6c9&&_6c9.length>0){_6c8=_4.mixin({},this._options);if(_6c8.id){_6c8.id=_6c8.id+"_"+"mapImage";}var _6ca=(this._groundLyr=new esri.layers.MapImageLayer(_6c8));len=_6c9.length;for(i=0;i<len;i++){_6ca.addImage(new esri.layers.KMLGroundOverlay(_6c9[i]));}}var _6cb=_4.getObject("featureCollection.layers",false,json);if(_6cb&&_6cb.length>0){this._fLayers=[];_4.forEach(_6cb,function(_6cc,i){var _6cd=_4.getObject("featureSet.features",false,_6cc),_6ce;if(_6cd&&_6cd.length>0){_6c8=_4.mixin({outFields:["*"],infoTemplate:_6cc.popupInfo?new esri.dijit.PopupTemplate(_6cc.popupInfo):null,editable:false},this._options);if(_6c8.id){_6c8.id=_6c8.id+"_"+i;}_6cc.layerDefinition.capabilities="Query,Data";_6ce=new esri.layers.FeatureLayer(_6cc,_6c8);if(_6ce.geometryType){this["_"+_6ce.geometryType]=_6ce;}this._fLayers.push(_6ce);}},this);if(this._fLayers.length===0){delete this._fLayers;}}len=_6c6.length;for(i=0;i<len;i++){fldr=_6c6[i];this._setState(fldr,fldr.visible);}this._fireUpdateEnd();if(this.loaded){this._addInternalLayers();this.onRefresh();}else{this.loaded=true;this.onLoad(this);}},_addInternalLayers:function(){var map=this._map;this._fireUpdateStart();if(this._links){_4.forEach(this._links,function(link){if(link.declaredClass){map.addLayer(link);if(link._waitingForMap){link._waitingForMap=null;if(link.visible){link._parseKml(map);}else{link._wMap=map;}}}});}var _6cf=map.spatialReference,_6d0=this._outSR,_6d1,_6d2;if(_6cf.wkid){_6d1=(_6cf._isWebMercator()&&_6d0._isWebMercator())||(_6cf.wkid===_6d0.wkid);}else{if(_6cf.wkt){_6d1=(_6cf.wkt===_6d0.wkt);}else{console.log("KMLLayer:_setMap - map has invalid spatial reference");return;}}if(!_6d1){if(_6cf._isWebMercator()&&_6d0.wkid===4326){_6d2=esri.geometry.geographicToWebMercator;}else{if(_6d0._isWebMercator()&&_6cf.wkid===4326){_6d2=esri.geometry.webMercatorToGeographic;}else{console.log("KMLLayer:_setMap - unsupported workflow. Spatial reference of the map and kml layer do not match, and the conversion cannot be done on the client.");return;}}}if(this._groundLyr){if(_6d2){_4.forEach(this._groundLyr.getImages(),function(_6d3){_6d3.extent=_6d2(_6d3.extent);});}map.addLayer(this._groundLyr);}var _6d4=this._fLayers;if(_6d4&&_6d4.length>0){_4.forEach(_6d4,function(_6d5){if(_6d2){var _6d6=_6d5.graphics,i,geom,len=_6d6?_6d6.length:0;for(i=0;i<len;i++){geom=_6d6[i].geometry;if(geom){_6d6[i].setGeometry(_6d2(geom));}}}map.addLayer(_6d5);});}this.onVisibilityChange(this.visible);},_removeInternalLayers:function(){var map=this._map;if(this._links){_4.forEach(this._links,function(link){if(link.declaredClass&&link._io){link._io.cancel();}});}if(map){_4.forEach(this.getLayers(),map.removeLayer,map);}},_setState:function(_6d7,_6d8){var _6d9=_6d7.featureInfos,info,_6da,i,len=_6d9?_6d9.length:0,_6db=_6d8?"show":"hide";for(i=0;i<len;i++){info=_6d9[i];_6da=this.getFeature(info);if(!_6da){continue;}if(info.type==="Folder"){this._setState(_6da,_6d8&&_6da.visible);}else{if(info.type==="NetworkLink"){this._setInternalVisibility(_6da,_6d8);}else{_6da[_6db]();}}}},_areLocalAncestorsVisible:function(_6dc){var _6dd=_6dc.parentFolderId,_6de=_6dc.visible;while(_6de&&_6dd!==-1){var _6df=this.getFeature({type:"Folder",id:_6dd});_6de=_6de&&_6df.visible;_6dd=_6df.parentFolderId;}return _6de;},_setInternalVisibility:function(_6e0,_6e1){var _6e2=_6e0._parentLayer,_6e3=_6e0._parentFolderId;_6e1=_6e1&&_6e0.visible;while(_6e1&&_6e2){_6e1=_6e1&&_6e2.visible;if(_6e3>-1){_6e1=_6e1&&_6e2._areLocalAncestorsVisible(_6e2.getFeature({type:"Folder",id:_6e3}));}_6e3=_6e2._parentFolderId;_6e2=_6e2._parentLayer;}this._setIntState(_6e0,_6e1);},_setIntState:function(link,_6e4){if(!link){return;}_4.forEach(link.getLayers(),function(_6e5){if(_6e5.linkInfo){link._setIntState(_6e5,_6e4&&_6e5.visible&&link._areLocalAncestorsVisible(link.getFeature({type:"Folder",id:_6e5._parentFolderId})));}else{_6e5.setVisibility(_6e4);}});},_getLinkParentId:function(id){var _6e6=-1;if(this.folders){_4.some(this.folders,function(_6e7){if(_6e7.networkLinkIds&&_4.indexOf(_6e7.networkLinkIds,id)!==-1){_6e6=_6e7.id;return true;}return false;});}return _6e6;},_checkAutoRefresh:function(){var _6e8=this.linkInfo;if(_6e8){if(this.visible){if(this.loaded&&this._map){var _6e9=_6e8.refreshMode,_6ea=_6e8.refreshInterval,_6eb=_6e8.viewRefreshMode,_6ec=_6e8.viewRefreshTime;if(_6e9&&_6e9.toLowerCase().indexOf("oninterval")!==-1&&_6ea>0){this._stopAutoRefresh();this._timeoutHandle=setTimeout(this.refresh,_6ea*1000);}if(_6eb&&_6eb.toLowerCase().indexOf("onstop")!==-1&&_6ec>0){if(!this._extChgHandle){this._extChgHandle=_4.connect(this._map,"onExtentChange",this,this._extentChanged);}}}}else{this._stopAutoRefresh();_4.disconnect(this._extChgHandle);delete this._extChgHandle;}}},_stopAutoRefresh:function(){clearTimeout(this._timeoutHandle);this._timeoutHandle=null;},_getQueryParameters:function(map){map=map||this._map;var _6ed={},_6ee=this.linkInfo,_6ef=map&&map.extent;if(this._url.query){_4.mixin(_6ed,this._url.query);}if(_6ee){var _6f0=_6ee.viewFormat,_6f1=_6ee.httpQuery,_6f2=_6ee.viewBoundScale;if(_6ef&&_6f0){var _6f3=_6ef,_6f4=_6ef,sr=_6ef.spatialReference;if(sr){if(sr._isWebMercator()){_6f3=esri.geometry.webMercatorToGeographic(_6ef);}else{if(sr.wkid===4326){_6f4=esri.geometry.geographicToWebMercator(_6ef);}}}var _6f5=_6f3.getCenter(),_6f6=Math.max(_6f4.getWidth(),_6f4.getHeight());if(_6f2){_6f3=_6f3.expand(_6f2);}_6f0=_6f0.replace(/\[bboxWest\]/ig,_6f3.xmin).replace(/\[bboxEast\]/ig,_6f3.xmax).replace(/\[bboxSouth\]/ig,_6f3.ymin).replace(/\[bboxNorth\]/ig,_6f3.ymax).replace(/\[lookatLon\]/ig,_6f5.x).replace(/\[lookatLat\]/ig,_6f5.y).replace(/\[lookatRange\]/ig,_6f6).replace(/\[lookatTilt\]/ig,0).replace(/\[lookatHeading\]/ig,0).replace(/\[lookatTerrainLon\]/ig,_6f5.x).replace(/\[lookatTerrainLat\]/ig,_6f5.y).replace(/\[lookatTerrainAlt\]/ig,0).replace(/\[cameraLon\]/ig,_6f5.x).replace(/\[cameraLat\]/ig,_6f5.y).replace(/\[cameraAlt\]/ig,_6f6).replace(/\[horizFov\]/ig,60).replace(/\[vertFov\]/ig,60).replace(/\[horizPixels\]/ig,map.width).replace(/\[vertPixels\]/ig,map.height).replace(/\[terrainEnabled\]/ig,0);_4.mixin(_6ed,_4.queryToObject(_6f0));}if(_6f1){_6f1=_6f1.replace(/\[clientVersion\]/ig,esri.version).replace(/\[kmlVersion\]/ig,2.2).replace(/\[clientName\]/ig,"ArcGIS API for JavaScript").replace(/\[language\]/ig,_4.locale);_4.mixin(_6ed,_4.queryToObject(_6f1));}}var _6f7=[],_6f8;for(_6f8 in _6ed){if(esri._isDefined(_6ed[_6f8])){_6f7.push(_6f8+"="+_6ed[_6f8]);}}_6f7=_6f7.join("&");return _6f7?("?"+_6f7):"";},_setMap:function(map,_6f9){this._map=map;var div=this._div=_4.create("div",null,_6f9);_4.style(div,"position","absolute");this._addInternalLayers();return div;},_unsetMap:function(map,_6fa){if(this._io){this._io.cancel();}this._stopAutoRefresh();_4.disconnect(this._extChgHandle);delete this._extChgHandle;this._removeInternalLayers();var div=this._div;if(div){_6fa.removeChild(div);_4.destroy(div);}this._map=this._wMap=this._div=null;},onVisibilityChange:function(_6fb){if(!this.loaded){if(this.linkInfo&&_6fb){if(!this._waitingForMap){this._parseKml(this._wMap);}}return;}this._fireUpdateStart();this._setInternalVisibility(this,_6fb);this._checkAutoRefresh();this._fireUpdateEnd();},refresh:function(){if(!this.loaded||!this._map||this._io){return;}this._parseKml();},_extentChanged:function(){this._stopAutoRefresh();this._timeoutHandle=setTimeout(this.refresh,this.linkInfo.viewRefreshTime*1000);}});_4.declare("esri.layers.KMLGroundOverlay",[esri.layers.MapImage],{constructor:function(json){if(esri._isDefined(this.visibility)){this.visible=!!this.visibility;}}});_4.declare("esri.layers.KMLFolder",null,{constructor:function(json){_4.mixin(this,json);if(esri._isDefined(this.visibility)){this.visible=!!this.visibility;}}});}if(!_4._hasResource["esri.layers.wms"]){_4._hasResource["esri.layers.wms"]=true;_4.provide("esri.layers.wms");_4.declare("esri.layers.WMSLayer",[esri.layers.DynamicMapServiceLayer],{_CRS_TO_EPSG:{84:4326,83:4269,27:4267},_REVERSED_LAT_LONG_RANGES:[[4001,4999],[2044,2045],[2081,2083],[2085,2086],[2093,2093],[2096,2098],[2105,2132],[2169,2170],[2176,2180],[2193,2193],[2200,2200],[2206,2212],[2319,2319],[2320,2462],[2523,2549],[2551,2735],[2738,2758],[2935,2941],[2953,2953],[3006,3030],[3034,3035],[3058,3059],[3068,3068],[3114,3118],[3126,3138],[3300,3301],[3328,3335],[3346,3346],[3350,3352],[3366,3366],[3416,3416],[20004,20032],[20064,20092],[21413,21423],[21473,21483],[21896,21899],[22171,22177],[22181,22187],[22191,22197],[25884,25884],[27205,27232],[27391,27398],[27492,27492],[28402,28432],[28462,28492],[30161,30179],[30800,30800],[31251,31259],[31275,31279],[31281,31290],[31466,31700]],_WEB_MERCATOR:[102100,3857,102113,900913],_WORLD_MERCATOR:[3395,54004],allExtents:[],constructor:function(url,_6fc){url=this._stripParameters(url,["version","service","request","bbox","format","height","width","layers","srs","crs","styles","transparent","bgcolor","exceptions","time","elevation","sld","wfs"]);this.url=url;this._url=esri.urlToObject(url);this._getCapabilitiesURL=url;this._initLayer=_4.hitch(this,this._initLayer);this._parseCapabilities=_4.hitch(this,this._parseCapabilities);this._getCapabilitiesError=_4.hitch(this,this._getCapabilitiesError);if(_6fc){this.imageFormat=this._getImageFormat(_6fc.format);this.imageTransparency=(_6fc.transparent===false)?false:true;this.visibleLayers=_6fc.visibleLayers?_6fc.visibleLayers:[];if(_6fc.resourceInfo){this._readResourceInfo(_6fc.resourceInfo);}else{this._getCapabilities();}}else{this.imageFormat="image/png";this.imageTransparency=true;this.visibleLayers=[];this._getCapabilities();}this._blankImageURL=_4.moduleUrl("esri","../../images/pixel.png").uri;},setVisibleLayers:function(_6fd){_6fd=this._checkVisibleLayersList(_6fd);this.visibleLayers=(_6fd)?_6fd:[];this.refresh(true);},setImageFormat:function(_6fe){this.imageFormat=this._getImageFormat(_6fe);this.refresh(true);},setImageTransparency:function(_6ff){this.imageTransparency=_6ff;this.refresh(true);},getImageUrl:function(_700,_701,_702,_703){if(!this.visibleLayers||this.visibleLayers.length===0){_703(this._blankImageURL);return;}var wkid=_700.spatialReference.wkid;if(_4.some(this._WEB_MERCATOR,function(el){return el==wkid;})){var _704=_4.filter(this.spatialReferences,function(el){return (_4.some(this._WEB_MERCATOR,function(el2){return el2==el;}));},this);if(_704.length==0){_704=_4.filter(this.spatialReferences,function(el){return (_4.some(this._WORLD_MERCATOR,function(el2){return el2==el;}));},this);}if(_704.length>0){wkid=_704[0];}else{wkid=this._WEB_MERCATOR[0];}}var list=_4.filter(this.spatialReferences,function(el){return el!==wkid;});this.spatialReferences=list;this.spatialReferences.unshift(wkid);var xmin=_700.xmin;var xmax=_700.xmax;var ymin=_700.ymin;var ymax=_700.ymax;var _705={};_705.SERVICE="WMS";_705.REQUEST="GetMap";_705.FORMAT=this.imageFormat;_705.TRANSPARENT=this.imageTransparency?"TRUE":"FALSE";_705.STYLES="";_705.VERSION=this.version;_705.LAYERS=this.visibleLayers?this.visibleLayers.toString():null;_705.WIDTH=_701;_705.HEIGHT=_702;if(this.maxWidth<_701){_705.WIDTH=this.maxWidth;}if(this.maxHeight<_702){_705.HEIGHT=this.maxHeight;}var _706=wkid?wkid:NaN;if(!isNaN(_706)){if(this.version=="1.3.0"){_705.CRS="EPSG:"+_706;}else{_705.SRS="EPSG:"+_706;}}if(this.version=="1.3.0"&&this._useLatLong(_706)){_705.BBOX=ymin+","+xmin+","+ymax+","+xmax;}else{_705.BBOX=xmin+","+ymin+","+xmax+","+ymax;}var _707=this.getMapURL;_707+=(_707.indexOf("?")==-1)?"?":"";for(var key in _705){_707+=(_707.substring(_707.length-1,_707.length)=="?")?"":"&";_707+=key+"="+_705[key];}_703(_707);},_initLayer:function(_708,io){this.spatialReference=new esri.SpatialReference(this.extent.spatialReference);this.initialExtent=new esri.geometry.Extent(this.extent);this.fullExtent=new esri.geometry.Extent(this.extent);this.visibleLayers=this._checkVisibleLayersList(this.visibleLayers);this.loaded=true;this.onLoad(this);var _709=this._loadCallback;if(_709){delete this._loadCallback;_709(this);}},_readResourceInfo:function(_70a){if(!_70a.extent){console.error("esri.layers.WMSLayer: unable to find the 'extent' property in resourceInfo");return;}if(!_70a.layerInfos){console.error("esri.layers.WMSLayer: unable to find the 'layerInfos' property in resourceInfo");return;}this.extent=_70a.extent;this.allExtents[0]=_70a.extent;this.layerInfos=_70a.layerInfos;this.description=_70a.description?_70a.description:"";this.copyright=_70a.copyright?_70a.copyright:"";this.title=_70a.title?_70a.title:"";this.getMapURL=_70a.getMapURL?_70a.getMapURL:this._getCapabilitiesURL;this.version=_70a.version?_70a.version:"1.3.0";this.maxWidth=_70a.maxWidth?_70a.maxWidth:5000;this.maxHeight=_70a.maxHeight?_70a.maxHeight:5000;this.spatialReferences=_70a.spatialReferences?_70a.spatialReferences:[];this.imageFormat=this._getImageFormat(_70a.format);this._initLayer();},_getCapabilities:function(){var _70b=this._url.query?this._url.query:{};_70b.SERVICE="WMS";_70b.REQUEST="GetCapabilities";var uri=this._url.path+"?";for(var key in _70b){uri+=(uri.substring(uri.length-1,uri.length)=="?")?"":"&";uri+=key+"="+_70b[key];}var _70c=esri.request({url:uri,handleAs:"xml",load:this._parseCapabilities,error:this._getCapabilitiesError},{usePost:false});},_parseCapabilities:function(xml){if(!xml){this.onError("GetCapabilities request for "+this._getCapabilitiesURL+" failed. (Response is null.)");return;}this.version=this._getAttributeValue("WMS_Capabilities","version",xml,null);if(!this.version){this.version=this._getAttributeValue("WMT_MS_Capabilities","version",xml,"1.3.0");}var _70d=this._getTag("Service",xml);this.title=this._getTagValue("Title",_70d,"");if(!this.title||this.title.length==0){this.title=this._getTagValue("Name",_70d,"");}this.copyright=this._getTagValue("AccessConstraints",_70d,"");this.description=this._getTagValue("Abstract",_70d,"");this.maxWidth=parseInt(this._getTagValue("MaxWidth",_70d,5000));this.maxHeight=parseInt(this._getTagValue("MaxHeight",_70d,5000));var _70e=this._getTag("Layer",xml);if(!_70e){this._getCapabilitiesError({"error":{"message":"Response does not contain any layers."}});return;}var _70f=this._getLayerInfo(_70e);if(_70f){this.layerInfos=_70f.subLayers;if(!this.layerInfos||this.layerInfos.length==0){this.layerInfos=[_70f];}this.extent=_70f.extent;this.allExtents=_70f.allExtents;this.spatialReferences=_70f.spatialReferences;if(this.spatialReferences.length==0&&this.layerInfos.length>0){this.spatialReferences=this.layerInfos[0].spatialReferences;}}this.getMapURL=this._getCapabilitiesURL;var _710=_4.query("DCPType",this._getTag("GetMap",xml));if(_710&&_710.length>0){var _711=_4.query("HTTP",_710[0]);if(_711&&_711.length>0){var _712=_4.query("Get",_711[0]);if(_712&&_712.length>0){var _713=this._getAttributeValue("OnlineResource","xlink:href",_712[0],null);if(_713){if(_713.indexOf("&")==(_713.length-1)){_713=_713.substring(0,_713.length-1);}this.getMapURL=_713;}}}}this.getMapFormats=[];if(_4.query("Operation",xml).length==0){_4.forEach(_4.query("Format",this._getTag("GetMap",xml)),function(_714){this.getMapFormats.push(_714.text?_714.text:_714.textContent);},this);}else{_4.forEach(_4.query("Operation",xml),function(_715){if(_715.getAttribute("name")=="GetMap"){_4.forEach(_4.query("Format",_715),function(_716){this.getMapFormats.push(_716.text?_716.text:_716.textContent);},this);}},this);}if(!_4.some(this.getMapFormats,function(el){return el.indexOf(this.imageFormat)>-1;},this)){this.imageFormat=this.getMapFormats[0];}this._initLayer();},_getCapabilitiesError:function(_717,io){this.onError("GetCapabilities request for "+this._getCapabilitiesURL+" failed. ("+_4.toJson(_717)+")");},_getLayerInfo:function(_718){if(!_718){return null;}var _719=new esri.layers.WMSLayerInfo();_719.name="";_719.title="";_719.description="";_719.allExtents=[];_719.spatialReferences=[];_719.subLayers=[];var _71a=this._getTag("LatLonBoundingBox",_718);if(_71a){_719.allExtents[0]=this._getExtent(_71a,4326);}var _71b=this._getTag("EX_GeographicBoundingBox",_718);if(_71b){var _71c=new esri.geometry.Extent(0,0,0,0,new esri.SpatialReference({wkid:4326}));_71c.xmin=parseFloat(this._getTagValue("westBoundLongitude",_71b,0));_71c.ymin=parseFloat(this._getTagValue("southBoundLatitude",_71b,0));_71c.xmax=parseFloat(this._getTagValue("eastBoundLongitude",_71b,0));_71c.ymax=parseFloat(this._getTagValue("northBoundLatitude",_71b,0));_719.allExtents[0]=_71c;}_719.extent=_719.allExtents[0];var _71d=(_4.indexOf(["1.0.0","1.1.0","1.1.1"],this.version)>-1)?"SRS":"CRS";_4.forEach(_718.childNodes,function(_71e){if(_71e.nodeName=="Name"){_719.name=(_71e.text?_71e.text:_71e.textContent)||"";}else{if(_71e.nodeName=="Title"){_719.title=(_71e.text?_71e.text:_71e.textContent)||"";}else{if(_71e.nodeName=="Abstract"){_719.description=(_71e.text?_71e.text:_71e.textContent)||"";}else{if(_71e.nodeName=="BoundingBox"){srAttr=_71e.getAttribute(_71d);if(srAttr&&srAttr.indexOf("EPSG:")===0){wkid=parseInt(srAttr.substring(5));if(wkid!==0&&!isNaN(wkid)){var _71f;if(this.version=="1.3.0"){_71f=this._getExtent(_71e,wkid,this._useLatLong(wkid));}else{_71f=this._getExtent(_71e,wkid);}_719.allExtents[wkid]=_71f;if(!_719.extent){_719.extent=_71f;}}}else{if(srAttr&&srAttr.indexOf("CRS:")===0){wkid=parseInt(srAttr.substring(4));if(wkid!==0&&!isNaN(wkid)){if(this._CRS_TO_EPSG[wkid]){wkid=this._CRS_TO_EPSG[wkid];}_719.allExtents[wkid]=this._getExtent(_71e,wkid);}}else{wkid=parseInt(srAttr);if(wkid!==0&&!isNaN(wkid)){_719.allExtents[wkid]=this._getExtent(_71e,wkid);}}}}else{if(_71e.nodeName==_71d){var _720=_71e.text?_71e.text:_71e.textContent;var arr=_720.split(" ");_4.forEach(arr,function(val){if(val.indexOf(":")>-1){val=parseInt(val.split(":")[1]);}else{val=parseInt(val);}if(val!==84&&val!==0&&!isNaN(val)){if(!_4.some(_719.spatialReferences,function(el){return (el==val);})){_719.spatialReferences.push(val);}}},this);}else{if(_71e.nodeName=="Style"){var _721=this._getTag("LegendURL",_71e);if(_721){var _722=this._getTag("OnlineResource",_721);if(_722){_719.legendURL=_722.getAttribute("xlink:href");}}}else{if(_71e.nodeName==="Layer"){_719.subLayers.push(this._getLayerInfo(_71e));}}}}}}}},this);return _719;},_getImageFormat:function(_723){var _724=_723?_723.toLowerCase():"";switch(_724){case "jpg":return "image/jpeg";case "bmp":return "image/bmp";case "gif":return "image/gif";case "svg":return "image/svg+xml";default:return "image/png";}},getImageFormat:function(){var _725=this.imageFormat?this.imageFormat.toLowerCase():"";switch(_725){case "image/jpeg":return "jpg";case "image/bmp":return "bmp";case "image/gif":return "gif";case "image/svg+xml":return "svg";default:return "png";}},_getExtent:function(_726,wkid,_727){var _728;if(_726){_728=new esri.geometry.Extent();var minx=parseFloat(_726.getAttribute("minx"));var miny=parseFloat(_726.getAttribute("miny"));var maxx=parseFloat(_726.getAttribute("maxx"));var maxy=parseFloat(_726.getAttribute("maxy"));if(_727){_728.xmin=isNaN(miny)?((-1)*Number.MAX_VALUE):miny;_728.ymin=isNaN(minx)?((-1)*Number.MAX_VALUE):minx;_728.xmax=isNaN(maxy)?Number.MAX_VALUE:maxy;_728.ymax=isNaN(maxx)?Number.MAX_VALUE:maxx;}else{_728.xmin=isNaN(minx)?((-1)*Number.MAX_VALUE):minx;_728.ymin=isNaN(miny)?((-1)*Number.MAX_VALUE):miny;_728.xmax=isNaN(maxx)?Number.MAX_VALUE:maxx;_728.ymax=isNaN(maxy)?Number.MAX_VALUE:maxy;}_728.spatialReference=new esri.SpatialReference({wkid:wkid});}return _728;},_useLatLong:function(wkid){var _729;for(var i=0;i<this._REVERSED_LAT_LONG_RANGES.length;i++){var _72a=this._REVERSED_LAT_LONG_RANGES[i];if(wkid>=_72a[0]&&wkid<=_72a[1]){_729=true;break;}}return _729;},_getTag:function(_72b,xml){var tags=_4.query(_72b,xml);if(tags&&tags.length>0){return tags[0];}else{return null;}},_getTagValue:function(_72c,xml,_72d){var _72e=_4.query(_72c,xml);if(_72e&&_72e.length>0){if(_72e[0].text){return _72e[0].text;}else{return _72e[0].textContent;}}else{return _72d;}},_getAttributeValue:function(_72f,_730,xml,_731){var _732=_4.query(_72f,xml);if(_732&&_732.length>0){return _732[0].getAttribute(_730);}else{return _731;}},_checkVisibleLayersList:function(_733){if(_733&&_733.length>0&&this.layerInfos&&this.layerInfos.length>0){if((typeof _733[0])=="number"){var list=[];_4.forEach(_733,function(pos){if(pos<this.layerInfos.length){list.push(this.layerInfos[pos].name);}},this);_733=list;}}return _733;},_stripParameters:function(url,_734){var obj=esri.urlToObject(url);qs=[];for(var prop in obj.query){if(_4.indexOf(_734,prop.toLowerCase())===-1){qs.push(prop+"="+obj.query[prop]);}}return obj.path+(qs.length?("?"+qs.join("&")):"");}});_4.declare("esri.layers.WMSLayerInfo",null,{name:null,title:null,description:null,extent:null,legendURL:null,subLayers:[],allExtents:[],spatialReferences:[],constructor:function(_735){if(_735){this.name=_735.name;this.title=_735.title;this.description=_735.description;this.extent=_735.extent;this.legendURL=_735.legendURL;this.subLayers=_735.subLayers?_735.subLayers:[];this.allExtents=_735.allExtents?_735.allExtents:[];this.spatialReferences=_735.spatialReferences?_735.spatialReferences:[];}},clone:function(){var info={name:this.name,title:this.title,description:this.description,legendURL:this.legendURL};if(this.extent){info.extent=this.extent.getExtent();}info.subLayers=[];_4.forEach(this.subLayers,function(_736){info.subLayers.push(_736.clone());});info.allExtents=[];for(var wkid in this.allExtents){wkid=parseInt(wkid);if(!isNaN(wkid)){info.allExtents[wkid]=this.allExtents[wkid].getExtent();}}info.spatialReferences=[];_4.forEach(this.spatialReferences,function(wkid){info.spatialReferences.push(wkid);});return info;}});}if(!_4._hasResource["dojo.DeferredList"]){_4._hasResource["dojo.DeferredList"]=true;_4.provide("dojo.DeferredList");_4.DeferredList=function(list,_737,_738,_739,_73a){var _73b=[];_4.Deferred.call(this);var self=this;if(list.length===0&&!_737){this.resolve([0,[]]);}var _73c=0;_4.forEach(list,function(item,i){item.then(function(_73d){if(_737){self.resolve([i,_73d]);}else{_73e(true,_73d);}},function(_73f){if(_738){self.reject(_73f);}else{_73e(false,_73f);}if(_739){return null;}throw _73f;});function _73e(_740,_741){_73b[i]=[_740,_741];_73c++;if(_73c===list.length){self.resolve(_73b);}};});};_4.DeferredList.prototype=new _4.Deferred();_4.DeferredList.prototype.gatherResults=function(_742){var d=new _4.DeferredList(_742,false,true,false);d.addCallback(function(_743){var ret=[];_4.forEach(_743,function(_744){ret.push(_744[1]);});return ret;});return d;};}if(!_4._hasResource["dojo.data.util.filter"]){_4._hasResource["dojo.data.util.filter"]=true;_4.provide("dojo.data.util.filter");_4.getObject("data.util.filter",true,_4);_4.data.util.filter.patternToRegExp=function(_745,_746){var rxp="^";var c=null;for(var i=0;i<_745.length;i++){c=_745.charAt(i);switch(c){case "\\":rxp+=c;i++;rxp+=_745.charAt(i);break;case "*":rxp+=".*";break;case "?":rxp+=".";break;case "$":case "^":case "/":case "+":case ".":case "|":case "(":case ")":case "{":case "}":case "[":case "]":rxp+="\\";default:rxp+=c;}}rxp+="$";if(_746){return new RegExp(rxp,"mi");}else{return new RegExp(rxp,"m");}};}if(!_4._hasResource["dojo.data.util.sorter"]){_4._hasResource["dojo.data.util.sorter"]=true;_4.provide("dojo.data.util.sorter");_4.getObject("data.util.sorter",true,_4);_4.data.util.sorter.basicComparator=function(a,b){var r=-1;if(a===null){a=undefined;}if(b===null){b=undefined;}if(a==b){r=0;}else{if(a>b||a==null){r=1;}}return r;};_4.data.util.sorter.createSortFunction=function(_747,_748){var _749=[];function _74a(attr,dir,comp,s){return function(_74b,_74c){var a=s.getValue(_74b,attr);var b=s.getValue(_74c,attr);return dir*comp(a,b);};};var _74d;var map=_748.comparatorMap;var bc=_4.data.util.sorter.basicComparator;for(var i=0;i<_747.length;i++){_74d=_747[i];var attr=_74d.attribute;if(attr){var dir=(_74d.descending)?-1:1;var comp=bc;if(map){if(typeof attr!=="string"&&("toString" in attr)){attr=attr.toString();}comp=map[attr]||bc;}_749.push(_74a(attr,dir,comp,_748));}}return function(rowA,rowB){var i=0;while(i<_749.length){var ret=_749[i++](rowA,rowB);if(ret!==0){return ret;}}return 0;};};}if(!_4._hasResource["dojo.data.util.simpleFetch"]){_4._hasResource["dojo.data.util.simpleFetch"]=true;_4.provide("dojo.data.util.simpleFetch");_4.getObject("data.util.simpleFetch",true,_4);_4.data.util.simpleFetch.fetch=function(_74e){_74e=_74e||{};if(!_74e.store){_74e.store=this;}var self=this;var _74f=function(_750,_751){if(_751.onError){var _752=_751.scope||_4.global;_751.onError.call(_752,_750,_751);}};var _753=function(_754,_755){var _756=_755.abort||null;var _757=false;var _758=_755.start?_755.start:0;var _759=(_755.count&&(_755.count!==Infinity))?(_758+_755.count):_754.length;_755.abort=function(){_757=true;if(_756){_756.call(_755);}};var _75a=_755.scope||_4.global;if(!_755.store){_755.store=self;}if(_755.onBegin){_755.onBegin.call(_75a,_754.length,_755);}if(_755.sort){_754.sort(_4.data.util.sorter.createSortFunction(_755.sort,self));}if(_755.onItem){for(var i=_758;(i<_754.length)&&(i<_759);++i){var item=_754[i];if(!_757){_755.onItem.call(_75a,item,_755);}}}if(_755.onComplete&&!_757){var _75b=null;if(!_755.onItem){_75b=_754.slice(_758,_759);}_755.onComplete.call(_75a,_75b,_755);}};this._fetchItems(_74e,_753,_74f);return _74e;};}if(!_4._hasResource["dojox.data.CsvStore"]){_4._hasResource["dojox.data.CsvStore"]=true;_4.provide("dojox.data.CsvStore");_4.declare("dojox.data.CsvStore",null,{constructor:function(_75c){this._attributes=[];this._attributeIndexes={};this._dataArray=[];this._arrayOfAllItems=[];this._loadFinished=false;if(_75c.url){this.url=_75c.url;}this._csvData=_75c.data;if(_75c.label){this.label=_75c.label;}else{if(this.label===""){this.label=undefined;}}this._storeProp="_csvStore";this._idProp="_csvId";this._features={"dojo.data.api.Read":true,"dojo.data.api.Identity":true};this._loadInProgress=false;this._queuedFetches=[];this.identifier=_75c.identifier;if(this.identifier===""){delete this.identifier;}else{this._idMap={};}if("separator" in _75c){this.separator=_75c.separator;}if("urlPreventCache" in _75c){this.urlPreventCache=_75c.urlPreventCache?true:false;}},url:"",label:"",identifier:"",separator:",",urlPreventCache:false,_assertIsItem:function(item){if(!this.isItem(item)){throw new Error(this.declaredClass+": a function was passed an item argument that was not an item");}},_getIndex:function(item){var idx=this.getIdentity(item);if(this.identifier){idx=this._idMap[idx];}return idx;},getValue:function(item,_75d,_75e){this._assertIsItem(item);var _75f=_75e;if(typeof _75d==="string"){var ai=this._attributeIndexes[_75d];if(ai!=null){var _760=this._dataArray[this._getIndex(item)];_75f=_760[ai]||_75e;}}else{throw new Error(this.declaredClass+": a function was passed an attribute argument that was not a string");}return _75f;},getValues:function(item,_761){var _762=this.getValue(item,_761);return (_762?[_762]:[]);},getAttributes:function(item){this._assertIsItem(item);var _763=[];var _764=this._dataArray[this._getIndex(item)];for(var i=0;i<_764.length;i++){if(_764[i]!==""){_763.push(this._attributes[i]);}}return _763;},hasAttribute:function(item,_765){this._assertIsItem(item);if(typeof _765==="string"){var _766=this._attributeIndexes[_765];var _767=this._dataArray[this._getIndex(item)];return (typeof _766!=="undefined"&&_766<_767.length&&_767[_766]!=="");}else{throw new Error(this.declaredClass+": a function was passed an attribute argument that was not a string");}},containsValue:function(item,_768,_769){var _76a=undefined;if(typeof _769==="string"){_76a=_4.data.util.filter.patternToRegExp(_769,false);}return this._containsValue(item,_768,_769,_76a);},_containsValue:function(item,_76b,_76c,_76d){var _76e=this.getValues(item,_76b);for(var i=0;i<_76e.length;++i){var _76f=_76e[i];if(typeof _76f==="string"&&_76d){return (_76f.match(_76d)!==null);}else{if(_76c===_76f){return true;}}}return false;},isItem:function(_770){if(_770&&_770[this._storeProp]===this){var _771=_770[this._idProp];if(this.identifier){var data=this._dataArray[this._idMap[_771]];if(data){return true;}}else{if(_771>=0&&_771<this._dataArray.length){return true;}}}return false;},isItemLoaded:function(_772){return this.isItem(_772);},loadItem:function(item){},getFeatures:function(){return this._features;},getLabel:function(item){if(this.label&&this.isItem(item)){return this.getValue(item,this.label);}return undefined;},getLabelAttributes:function(item){if(this.label){return [this.label];}return null;},_fetchItems:function(_773,_774,_775){var self=this;var _776=function(_777,_778){var _779=null;if(_777.query){var key,_77a;_779=[];var _77b=_777.queryOptions?_777.queryOptions.ignoreCase:false;var _77c={};for(key in _777.query){_77a=_777.query[key];if(typeof _77a==="string"){_77c[key]=_4.data.util.filter.patternToRegExp(_77a,_77b);}}for(var i=0;i<_778.length;++i){var _77d=true;var _77e=_778[i];for(key in _777.query){_77a=_777.query[key];if(!self._containsValue(_77e,key,_77a,_77c[key])){_77d=false;}}if(_77d){_779.push(_77e);}}}else{_779=_778.slice(0,_778.length);}_774(_779,_777);};if(this._loadFinished){_776(_773,this._arrayOfAllItems);}else{if(this.url!==""){if(this._loadInProgress){this._queuedFetches.push({args:_773,filter:_776});}else{this._loadInProgress=true;var _77f={url:self.url,handleAs:"text",preventCache:self.urlPreventCache};var _780=_4.xhrGet(_77f);_780.addCallback(function(data){try{self._processData(data);_776(_773,self._arrayOfAllItems);self._handleQueuedFetches();}catch(e){_775(e,_773);}});_780.addErrback(function(_781){self._loadInProgress=false;if(_775){_775(_781,_773);}else{throw _781;}});var _782=null;if(_773.abort){_782=_773.abort;}_773.abort=function(){var df=_780;if(df&&df.fired===-1){df.cancel();df=null;}if(_782){_782.call(_773);}};}}else{if(this._csvData){try{this._processData(this._csvData);this._csvData=null;_776(_773,this._arrayOfAllItems);}catch(e){_775(e,_773);}}else{var _783=new Error(this.declaredClass+": No CSV source data was provided as either URL or String data input.");if(_775){_775(_783,_773);}else{throw _783;}}}}},close:function(_784){},_getArrayOfArraysFromCsvFileContents:function(_785){if(_4.isString(_785)){var _786=new RegExp("^\\s+","g");var _787=new RegExp("\\s+$","g");var _788=new RegExp("\"\"","g");var _789=[];var i;var _78a=this._splitLines(_785);for(i=0;i<_78a.length;++i){var _78b=_78a[i];if(_78b.length>0){var _78c=_78b.split(this.separator);var j=0;while(j<_78c.length){var _78d=_78c[j];var _78e=_78d.replace(_786,"");var _78f=_78e.replace(_787,"");var _790=_78f.charAt(0);var _791=_78f.charAt(_78f.length-1);var _792=_78f.charAt(_78f.length-2);var _793=_78f.charAt(_78f.length-3);if(_78f.length===2&&_78f=="\"\""){_78c[j]="";}else{if((_790=="\"")&&((_791!="\"")||((_791=="\"")&&(_792=="\"")&&(_793!="\"")))){if(j+1===_78c.length){return;}var _794=_78c[j+1];_78c[j]=_78e+this.separator+_794;_78c.splice(j+1,1);}else{if((_790=="\"")&&(_791=="\"")){_78f=_78f.slice(1,(_78f.length-1));_78f=_78f.replace(_788,"\"");}_78c[j]=_78f;j+=1;}}}_789.push(_78c);}}this._attributes=_789.shift();for(i=0;i<this._attributes.length;i++){this._attributeIndexes[this._attributes[i]]=i;}this._dataArray=_789;}},_splitLines:function(_795){var _796=[];var i;var line="";var _797=false;for(i=0;i<_795.length;i++){var c=_795.charAt(i);switch(c){case "\"":_797=!_797;line+=c;break;case "\r":if(_797){line+=c;}else{_796.push(line);line="";if(i<(_795.length-1)&&_795.charAt(i+1)=="\n"){i++;}}break;case "\n":if(_797){line+=c;}else{_796.push(line);line="";}break;default:line+=c;}}if(line!==""){_796.push(line);}return _796;},_processData:function(data){this._getArrayOfArraysFromCsvFileContents(data);this._arrayOfAllItems=[];if(this.identifier){if(this._attributeIndexes[this.identifier]===undefined){throw new Error(this.declaredClass+": Identity specified is not a column header in the data set.");}}for(var i=0;i<this._dataArray.length;i++){var id=i;if(this.identifier){var _798=this._dataArray[i];id=_798[this._attributeIndexes[this.identifier]];this._idMap[id]=i;}this._arrayOfAllItems.push(this._createItemFromIdentity(id));}this._loadFinished=true;this._loadInProgress=false;},_createItemFromIdentity:function(_799){var item={};item[this._storeProp]=this;item[this._idProp]=_799;return item;},getIdentity:function(item){if(this.isItem(item)){return item[this._idProp];}return null;},fetchItemByIdentity:function(_79a){var item;var _79b=_79a.scope?_79a.scope:_4.global;if(!this._loadFinished){var self=this;if(this.url!==""){if(this._loadInProgress){this._queuedFetches.push({args:_79a});}else{this._loadInProgress=true;var _79c={url:self.url,handleAs:"text"};var _79d=_4.xhrGet(_79c);_79d.addCallback(function(data){try{self._processData(data);var item=self._createItemFromIdentity(_79a.identity);if(!self.isItem(item)){item=null;}if(_79a.onItem){_79a.onItem.call(_79b,item);}self._handleQueuedFetches();}catch(error){if(_79a.onError){_79a.onError.call(_79b,error);}}});_79d.addErrback(function(_79e){this._loadInProgress=false;if(_79a.onError){_79a.onError.call(_79b,_79e);}});}}else{if(this._csvData){try{self._processData(self._csvData);self._csvData=null;item=self._createItemFromIdentity(_79a.identity);if(!self.isItem(item)){item=null;}if(_79a.onItem){_79a.onItem.call(_79b,item);}}catch(e){if(_79a.onError){_79a.onError.call(_79b,e);}}}}}else{item=this._createItemFromIdentity(_79a.identity);if(!this.isItem(item)){item=null;}if(_79a.onItem){_79a.onItem.call(_79b,item);}}},getIdentityAttributes:function(item){if(this.identifier){return [this.identifier];}else{return null;}},_handleQueuedFetches:function(){if(this._queuedFetches.length>0){for(var i=0;i<this._queuedFetches.length;i++){var _79f=this._queuedFetches[i];var _7a0=_79f.filter;var _7a1=_79f.args;if(_7a0){_7a0(_7a1,this._arrayOfAllItems);}else{this.fetchItemByIdentity(_79f.args);}}this._queuedFetches=[];}}});_4.extend(_6.data.CsvStore,_4.data.util.simpleFetch);}if(!_4._hasResource["esri.arcgis.csv"]){_4._hasResource["esri.arcgis.csv"]=true;_4.provide("esri.arcgis.csv");(function(){var EAC=esri.arcgis.csv;EAC.latFieldStrings=["lat","latitude","y","ycenter","latitude83","latdecdeg","POINT-Y"];EAC.longFieldStrings=["lon","lng","long","longitude","x","xcenter","longitude83","longdecdeg","POINT-X"];EAC.buildCSVFeatureCollection=function(_7a2){var _7a3=new _4.Deferred();var _7a4=function(_7a5){_7a3.callback(_7a5);};var _7a6=esri.request({url:_7a2.url,handleAs:"text",load:function(_7a7){EAC._processCsvData(_7a7,_7a2,_4.hitch(this,_7a4));},error:function(_7a8){console.error("error: "+_7a8);}},{usePost:false});return _7a3;};EAC.projectFeatureCollection=function(_7a9,_7aa){var _7ab=new _4.Deferred();var _7ac=function(_7ad){_7ab.callback(_7ad);};EAC._projectFeatureSet(_7a9,new esri.SpatialReference({wkid:4326}),_7aa,_4.hitch(this,_7ac));return _7ab;};EAC.generateDefaultPopupInfo=function(_7ae){var _7af=_7ae.layerDefinition.fields;var _7b0={"esriFieldTypeDouble":1,"esriFieldTypeSingle":1};var _7b1={"esriFieldTypeInteger":1,"esriFieldTypeSmallInteger":1};var dt={"esriFieldTypeDate":1};var _7b2=null;var _7b3=_4.map(_7af,_4.hitch(this,function(item){if(item.name.toUpperCase()==="NAME"){_7b2=item.name;}var _7b4=(item.type!=="esriFieldTypeOID"&&item.type!=="esriFieldTypeGlobalID"&&item.type!=="esriFieldTypeGeometry");var _7b5=null;if(_7b4){var f=item.name.toLowerCase();var _7b6=",stretched value,fnode_,tnode_,lpoly_,rpoly_,poly_,subclass,subclass_,rings_ok,rings_nok,";if(_7b6.indexOf(","+f+",")>-1||f.indexOf("area")>-1||f.indexOf("length")>-1||f.indexOf("shape")>-1||f.indexOf("perimeter")>-1||f.indexOf("objectid")>-1||f.indexOf("_")===f.length-1||(f.indexOf("_i")===f.length-2&&f.length>1)){_7b4=false;}if(item.type in _7b1){_7b5={places:0,digitSeparator:true};}else{if(item.type in _7b0){_7b5={places:2,digitSeparator:true};}else{if(item.type in dt){_7b5={dateFormat:"shortDateShortTime"};}}}}return _4.mixin({},{fieldName:item.name,label:item.alias,isEditable:true,tooltip:"",visible:_7b4,format:_7b5,stringFieldOption:"textbox"});}));var _7b7={title:_7b2?"{"+_7b2+"}":"",fieldInfos:_7b3,description:null,showAttachments:false,mediaInfos:[]};return _7b7;};EAC._processCsvData=function(data,_7b8,_7b9){var _7ba=data.indexOf("\n");var _7bb=_4.trim(data.substr(0,_7ba));var _7bc=_7b8.columnDelimiter;if(!_7bc){_7bc=EAC._getSeparator(_7bb);}var _7bd=new _6.data.CsvStore({data:data,separator:_7bc});var _7be=(_4.isIE<9)?750:1001;_7bd.fetch({start:0,count:_7be,onComplete:function(_7bf,_7c0){var _7c1=0;var _7c2={"layerDefinition":_7b8.layerDefinition,"featureSet":{"features":[],"geometryType":"esriGeometryPoint"}};var _7c3=_7c2.layerDefinition.objectIdField;if(!_7c3){if(!_4.some(_7c2.layerDefinition.fields,function(_7c4){if(_7c4.type=="esriFieldTypeOID"){_7c3=_7c4.name;return true;}return false;})){_7c2.layerDefinition.fields.push({"name":"__OBJECTID","alias":"__OBJECTID","type":"esriFieldTypeOID","editable":false,"domain":null});_7c3="__OBJECTID";}}var _7c5,_7c6;var _7c7=_7bd._attributes;var _7c8=[];var _7c9=[];_4.forEach(_7c2.layerDefinition.fields,function(_7ca,_7cb){if(_7ca.type==="esriFieldTypeDate"){_7c8.push(_7ca.name);}else{if(_7ca.type==="esriFieldTypeDouble"||_7ca.type==="esriFieldTypeInteger"){_7c9.push(_7ca.name);}}});if(_7b8.locationInfo&&_7b8.locationInfo.locationType==="coordinates"){_7c5=_7b8.locationInfo.latitudeFieldName;_7c6=_7b8.locationInfo.longitudeFieldName;}else{_4.forEach(_7c7,function(_7cc){var _7cd;_7cd=_4.indexOf(EAC.latFieldStrings,_7cc.toLowerCase());if(_7cd!==-1){_7c5=_7cc;}_7cd=_4.indexOf(EAC.longFieldStrings,_7cc.toLowerCase());if(_7cd!==-1){_7c6=_7cc;}},this);}if(!_7c5||!_7c6){setTimeout(function(){console.error("File does not seem to contain fields with point coordinates.");},1);return;}var i=0,il=_7bf.length;for(i;i<il;i++){if(_7c2.featureSet.features.length>=1000){setTimeout(function(){console.error("1000 feature limit reached. Unable to load any more data.");},1);break;}var item=_7bf[i];var _7ce=_7bd.getAttributes(item),_7cf={};_4.forEach(_7ce,function(attr,_7d0){if(_4.some(_7c8,function(a){return a===attr;})){var val=_7bd.getValue(item,attr),date=new Date(val);_7cf[attr]=EAC._isValidDate(date,val)?date.getTime():null;}else{if(_4.some(_7c9,function(a){return a===attr;})){var _7d1=_4.number.parse(_7bd.getValue(item,attr));if((attr==_7c5||attr==_7c6)&&(isNaN(_7d1)||Math.abs(_7d1)>181)){_7d1=parseFloat(_7bd.getValue(item,attr));if(isNaN(_7d1)){_7cf[attr]=null;}else{_7cf[attr]=_7d1;}}else{if(isNaN(_7d1)){_7cf[attr]=null;}else{_7cf[attr]=_7d1;}}}else{_7cf[attr]=_7bd.getValue(item,attr);}}});_7cf[_7c3]=_7c1;_7c1++;var _7d2=_7cf[_7c5];var _7d3=_7cf[_7c6];if(_7d3==null||_7d2==null||isNaN(_7d2)||isNaN(_7d3)){continue;}var _7d4=new esri.geometry.Point(_7d3,_7d2,new esri.SpatialReference({wkid:4326}));var _7d5={"geometry":_7d4.toJson(),"attributes":_7cf};_7c2.featureSet.features.push(_7d5);}_7c2.layerDefinition.name="csv";if(_7b9){_7b9(_7c2);}},onError:function(_7d6){console.error("Error fetching items from CSV store: ",_7d6);}});return true;};EAC._getSeparator=function(_7d7){var _7d8=[","," ",";","|","\t"];var _7d9=0;var _7da="";_4.forEach(_7d8,function(_7db){var _7dc=_7d7.split(_7db).length;if(_7dc>_7d9){_7d9=_7dc;_7da=_7db;}});return _7da;};EAC._isValidDate=function(d,_7dd){if(!d||Object.prototype.toString.call(d)!=="[object Date]"||isNaN(d.getTime())){return false;}var _7de=true;if(_4.isChrome&&/\d+\W*$/.test(_7dd)){var _7df=_7dd.match(/[a-zA-Z]{2,}/);if(_7df){var _7e0=false,i=0,len=_7df.length,_7e1=/^((jan(uary)?)|(feb(ruary)?)|(mar(ch)?)|(apr(il)?)|(may)|(jun(e)?)|(jul(y)?)|(aug(ust)?)|(sep(tember)?)|(oct(ober)?)|(nov(ember)?)|(dec(ember)?)|(am)|(pm)|(gmt)|(utc))$/i;while(!_7e0&&(i<=len)&&!(_7e0=!_7e1.test(_7df[i]))){i++;}_7de=!_7e0;}}return _7de;};EAC._projectFeatureSet=function(_7e2,_7e3,_7e4,_7e5){if(!_7e2.featureSet||_7e2.featureSet.length===0){return;}if(EAC._sameSpatialReference(_7e4,_7e3)){_7e5(_7e2);return;}var _7e6=function(_7e7){var _7e8=[];_4.forEach(_7e2.featureSet.features,function(_7e9,i){if(_7e7[i]){_7e9.geometry=_7e7[i];_7e8.push(_7e9);}},this);_7e5(_7e2);};var _7ea=function(_7eb,args){console.error("error projecting featureSet ("+_7e2.layerDefinition.name+"). Try one more time.");EAC._projectGeometries(_7ec,_7e2.featureSet.geometryType,_7e3,_7e4,_4.hitch(this,_7e6),_4.hitch(this,_7ed));};var _7ed=function(_7ee,args){console.error("error projecting featureSet ("+_7e2.layerDefinition.name+"). Final try.");_7e5(_7e2);};if(_7e2.featureSet.features&&_7e2.featureSet.features.length>0){var _7ec=[];_4.forEach(_7e2.featureSet.features,function(_7ef){_7ec.push(_7ef.geometry);});EAC._projectGeometries(_7ec,_7e2.featureSet.geometryType,_7e3,_7e4,_4.hitch(this,_7e6),_4.hitch(this,_7ea));}else{_7e5(_7e2);}};EAC._projectGeometries=function(_7f0,_7f1,inSR,_7f2,_7f3,_7f4){if(_7f0.length===0){_7f3(null);}var _7f5=esri.geometry.getGeometryType(_7f1);var _7f6=[];_4.forEach(_7f0,function(_7f7){var _7f8=new _7f5(_7f7);_7f8.spatialReference=inSR;_7f6.push(_7f8);},this);var _7f9=[102113,102100,3857];if(inSR.wkid&&inSR.wkid===4326&&_7f2.wkid&&_4.indexOf(_7f9,_7f2.wkid)>-1){_4.forEach(_7f6,function(_7fa){if(_7fa.xmin){_7fa.xmin=Math.max(_7fa.xmin,-180);_7fa.xmax=Math.min(_7fa.xmax,180);_7fa.ymin=Math.max(_7fa.ymin,-89.99);_7fa.ymax=Math.min(_7fa.ymax,89.99);}else{if(_7fa.rings){_4.forEach(_7fa.rings,function(ring){_4.forEach(ring,function(_7fb){_7fb[0]=Math.min(Math.max(_7fb[0],-180),180);_7fb[1]=Math.min(Math.max(_7fb[1],-89.99),89.99);},this);},this);}else{if(_7fa.paths){_4.forEach(_7fa.paths,function(path){_4.forEach(path,function(_7fc){_7fc[0]=Math.min(Math.max(_7fc[0],-180),180);_7fc[1]=Math.min(Math.max(_7fc[1],-89.99),89.99);},this);},this);}else{if(_7fa.x){_7fa.x=Math.min(Math.max(_7fa.x,-180),180);_7fa.y=Math.min(Math.max(_7fa.y,-89.99),89.99);}}}}},this);_7f0=[];_4.forEach(_7f6,function(_7fd){var _7fe=esri.geometry.geographicToWebMercator(_7fd);if(_7f2.wkid!==102100){_7fe.spatialReference=_7f2;}_7f0.push(_7fe.toJson());},this);_7f3(_7f0);}else{if(inSR.wkid!==null&&_4.indexOf(_7f9,inSR.wkid)>-1&&_7f2.wkid!==null&&_7f2.wkid===4326){_7f0=[];_4.forEach(_7f6,function(_7ff){_7f0.push(esri.geometry.webMercatorToGeographic(_7ff).toJson());},this);_7f3(_7f0);}else{var _800=function(_801,args){if(_801&&_801.length===_7f0.length){_7f0=[];_4.forEach(_801,function(_802){if(_802&&((_802.rings&&_802.rings.length>0&&_802.rings[0].length>0&&_802.rings[0][0].length>0&&!isNaN(_802.rings[0][0][0])&&!isNaN(_802.rings[0][0][1]))||(_802.paths&&_802.paths.length>0&&_802.paths[0].length>0&&_802.paths[0][0].length>0&&!isNaN(_802.paths[0][0][0])&&!isNaN(_802.paths[0][0][1]))||(_802.xmin&&!isNaN(_802.xmin)&&_802.ymin&&!isNaN(_802.ymin))||(_802.x&&!isNaN(_802.x)&&_802.y&&!isNaN(_802.y)))){_7f0.push(_802.toJson());}else{_7f0.push(null);}},this);_7f3(_7f0);}else{_7f4(_801,args);}};if(esri.config.defaults.geometryService){esri.config.defaults.geometryService.project(_7f6,_7f2,_4.hitch(this,_800),_7f4);}else{_7f3(null);}}}};EAC._sameSpatialReference=function(sp1,sp2){var _803=[102113,102100,3857];if(sp1&&sp2&&sp1.wkid===sp2.wkid&&sp1.wkt===sp2.wkt){return true;}else{if(sp1&&sp2&&sp1.wkid&&sp2.wkid&&_4.indexOf(_803,sp1.wkid)>-1&&_4.indexOf(_803,sp2.wkid)>-1){return true;}}return false;};}());}if(!_4._hasResource["esri.arcgis.utils"]){_4._hasResource["esri.arcgis.utils"]=true;_4.provide("esri.arcgis.utils");(function(){var EAU=esri.arcgis.utils;EAU.arcgisUrl=location.protocol+"//www.arcgis.com/sharing/content/items";String.prototype.endsWith=function(str){return (this.match(str+"$")==str);};EAU.getItem=function(_804){if(EAU._arcgisUrl&&EAU._arcgisUrl.length>0){EAU.arcgisUrl=EAU._arcgisUrl;}var url=EAU.arcgisUrl+"/"+_804;var _805={},_806=new _4.Deferred();esri.request({url:url,content:{f:"json"},callbackParamName:"callback",load:function(_807){_805.item=_807;esri.request({url:url+"/data",content:{f:"json"},callbackParamName:"callback",load:function(_808){_805.itemData=_808;_806.callback(_805);},error:function(_809){_806.errback(_809);}});},error:function(_80a){_806.errback(_80a);}});return _806;};EAU.createMap=function(arg1,_80b,_80c){var _80d=new _4.Deferred();_80c=_80c||{};var _80e=_80c.infoTemplateClass;_80c._clazz=(_80e&&_4.getObject(_80e))||esri.dijit.PopupTemplate;if(_4.isString(arg1)){EAU.getItem(arg1).addCallback(function(_80f){EAU._getItemProps(_80f,_80c).addCallback(function(_810){EAU._getLayers(_810.itemData,_80c).addCallback(_4.hitch(null,EAU._preCreateMap,_810,_80b,_80c,_80d));});}).addErrback(_4.hitch(_80d,_80d.errback));}else{EAU._getItemProps(arg1,_80c).addCallback(function(_811){EAU._getLayers(_811.itemData,_80c).addCallback(_4.hitch(null,EAU._preCreateMap,_811,_80b,_80c,_80d));});}return _80d;};EAU._arcgisUrl=null;EAU._getItemProps=function(_812,_813){var _814=new _4.Deferred();var _815=_812.itemData;var _816=[];var _817=[];_4.forEach(_815.operationalLayers,function(_818){if(_818.itemId&&!_818.type){if(_818.url.indexOf("/FeatureServer")>-1){_817.push(_818);_816.push(EAU._getItemData(_818));}else{if(!_818.layers&&_818.url.indexOf("/MapServer")>-1&&_818.url.indexOf("/MapServer/")===-1){_817.push(_818);_816.push(EAU._getItemData(_818));}}}});if(_816.length>0){var _819=new _4.DeferredList(_816);_819.addCallback(function(_81a){_4.forEach(_817,function(_81b,i){var _81c=_81a[i][1];if(_81c&&_81c.layers){if(_81b.url.indexOf("/FeatureServer")>-1){_4.forEach(_81c.layers,function(_81d){if(_81b.url.endsWith("/FeatureServer/"+_81d.id)){_81b.itemProperties=_81d;EAU._processFSItemProperties(_81b);}});}else{_81b.layers=_81c.layers;}}});_814.callback(_812);});}else{_814.callback(_812);}return _814;};EAU._getItemData=function(_81e){var url=EAU.arcgisUrl+"/"+_81e.itemId+"/data";var _81f=esri.request({url:url,content:{f:"json"},callbackParamName:"callback"});return _81f;};EAU._processFSItemProperties=function(_820){if(_820.itemProperties.layerDefinition){if(_820.layerDefinition){if(!_820.layerDefinition.drawingInfo){_820.layerDefinition.drawingInfo=_820.itemProperties.layerDefinition.drawingInfo;}if(!_820.layerDefinition.definitionExpression){_820.layerDefinition.definitionExpression=_820.itemProperties.layerDefinition.definitionExpression;}if(_820.layerDefinition.minScale===null){_820.layerDefinition.minScale=_820.itemProperties.layerDefinition.minScale;}if(_820.layerDefinition.maxScale===null){_820.layerDefinition.maxScale=_820.itemProperties.layerDefinition.maxScale;}}else{_820.layerDefinition=_820.itemProperties.layerDefinition;}}if(_820.itemProperties.popupInfo&&!_820.popupInfo&&!_820.disablePopup){_820.popupInfo=_820.itemProperties.popupInfo;}};EAU._getLayers=function(_821,_822){var _823=[];var _824=[];var _825=[];var _826=new _4.Deferred();_4.forEach(_821.operationalLayers,function(_827,_828){if(_827.featureCollection){_4.forEach(_827.featureCollection.layers,function(_829,idx){var _82a=true;if(_827.visibleLayers){if(_4.indexOf(_827.visibleLayers,idx)==-1){_82a=false;}}_829.visibility=(_827.visibility&&_82a);_829.opacity=_827.opacity;_829.id=(_827.id||("operational"+_828))+"_"+idx;_825.push(_829);},this);}else{_825.push(_827);}});_4.forEach(_821.baseMap.baseMapLayers,function(_82b,_82c){_82b.baseMapLayer=true;_82b.id=_82b.id||("base"+_82c);_823.push(_82b);});_4.forEach(_825,function(_82d,_82e){_82d.id=_82d.id||("operational"+_82e);_823.push(_82d);});_4.forEach(_823,function(_82f){if(_82f.url&&!_82f.type){_82f.deferredsPos=_824.length;_82f.errors=[];_824.push(EAU._getServiceInfo(_82f.url,_82f.errors));}else{if(_82f.url&&_82f.type=="CSV"){_82f.deferredsPos=_824.length;_824.push(esri.arcgis.csv.buildCSVFeatureCollection(_82f));}}});if(_824.length==0){var _830=EAU._getMapSR(_823);_823=EAU._buildLayerObjects(_823,_822,_830);_826.callback(_823);}else{var _831=new _4.DeferredList(_824);_831.addCallback(function(_832){EAU._preBuildLayerObjects(_832,_823,_822,_824,_826);});}return _826;};EAU._preBuildLayerObjects=function(_833,_834,_835,_836,_837){_4.forEach(_834,function(_838,_839){if(_838.url&&!_838.type){_838.resourceInfo=_833[_838.deferredsPos][1];delete _838.deferredsPos;}else{if(_838.url&&_838.type=="CSV"){_838.featureCollection=_836[_838.deferredsPos].results[0];delete _838.deferredsPos;}}});var _83a=EAU._getMapSR(_834);var _83b=[];var _83c=new _4.Deferred();_4.forEach(_834,function(_83d){if(_83d.url&&_83d.type=="CSV"){_83d.deferredsPos=_83b.length;_83b.push(esri.arcgis.csv.projectFeatureCollection(_83d.featureCollection,_83a));}});if(_83b.length==0){_834=EAU._buildLayerObjects(_834,_835,_83a);_837.callback(_834);}else{var _83e=new _4.DeferredList(_83b);_83e.addCallback(function(){_4.forEach(_834,function(_83f){if(_83f.url&&_83f.type=="CSV"){_83f.featureCollection=_83b[_83f.deferredsPos].results[0];delete _83f.deferredsPos;}});_834=EAU._buildLayerObjects(_834,_835,_83a);_837.callback(_834);});}};EAU._buildLayerObjects=function(_840,_841,_842){_4.forEach(_840,function(_843,_844){if(_843.url&&!_843.type){if(_844===0||_840[0].layerObject){_843.layerObject=EAU._initLayer(_843,_840,_841,_842);}}else{if(_843.url&&_843.type=="CSV"){_843.layerObject=EAU._initLayer(_843,_840,_841,_842);}else{_843.layerObject=EAU._initLayer(_843,_840,_841,_842);}}});var _845=_4.filter(_840,function(lyr){return !lyr.isReference;});var _846=_4.filter(_840,function(lyr){return !!lyr.isReference;});_840=_845.concat(_846);return _840;};EAU._preCreateMap=function(_847,_848,_849,_84a,_84b){try{var _84c=_849.mapOptions||{};_849.mapOptions=_84c;var card=_847.item;var _84d=[];_4.forEach(_84b,function(_84e){if(_4.isArray(_84e.layerObject)){_4.forEach(_84e.layerObject,function(l){_84d.push(l);});}else{_84d.push(_84e.layerObject);}});if(!_84d[0]){_84a.errback(new Error(esri.bundle.arcgis.utils.baseLayerError));return;}_84d=_4.filter(_84d,esri._isDefined);if(card){if(card.extent){if(!_84c.extent){var _84f=new esri.geometry.Extent(card.extent[0][0],card.extent[0][1],card.extent[1][0],card.extent[1][1],new esri.SpatialReference({wkid:4326}));var _850=_84d[0].spatialReference;if(_850.wkid===4326){_84c.extent=_84f;EAU._createMap(_84d,_84b,_847,_848,_849,_84a);}else{if(_850.wkid===102100||_850.wkid===102113||_850.wkid===3857){_84f.xmin=Math.max(_84f.xmin,-180);_84f.xmax=Math.min(_84f.xmax,180);_84f.ymin=Math.max(_84f.ymin,-89.99);_84f.ymax=Math.min(_84f.ymax,89.99);_84c.extent=esri.geometry.geographicToWebMercator(_84f);EAU._createMap(_84d,_84b,_847,_848,_849,_84a);}else{if(_849.geometryServiceURL||esri.config.defaults.geometryService){var gs;if(_849.geometryServiceURL){gs=new esri.tasks.GeometryService(_849.geometryServiceURL);}else{gs=esri.config.defaults.geometryService;}gs.project([_84f],_850,function(_851){var _852=_851[0];_84c.extent=_84c.extent||_852;EAU._createMap(_84d,_84b,_847,_848,_849,_84a);});}else{_84a.errback(new Error(esri.bundle.arcgis.utils.geometryServiceError));}}}}else{EAU._createMap(_84d,_84b,_847,_848,_849,_84a);}}else{EAU._createMap(_84d,_84b,_847,_848,_849,_84a);}}else{EAU._createMap(_84d,_84b,_847,_848,_849,_84a);}}catch(err){_84a.errback(err);}};EAU._getMapSR=function(_853){var _854=null;var _855=_853[0];if(_855.url&&!_855.type){if(_855.resourceInfo.spatialReference){_854=new esri.SpatialReference();if(_855.resourceInfo.spatialReference.wkid){_854.wkid=_855.resourceInfo.spatialReference.wkid;}if(_855.resourceInfo.spatialReference.wkt){_854.wkt=_855.resourceInfo.spatialReference.wkt;}}}else{if(_855.type.indexOf("BingMaps")>-1||_855.type=="OpenStreetMap"){_854=new esri.SpatialReference({wkid:102100});}else{if(_855.type=="WMS"){_854=new esri.SpatialReference({wkid:_855.spatialReferences[0]});}}}return _854;};EAU._createMap=function(_856,_857,_858,_859,_85a,_85b){var _85c=(_85a.mapOptions||{}),_85d,_85e;if(!_85c.infoWindow){_85d=new esri.dijit.Popup(null,_4.create("div"));_85c.infoWindow=_85d;}if(!esri._isDefined(_85c.showInfoWindowOnClick)){_85c.showInfoWindowOnClick=false;}var map=new esri.Map(_859,_85c);if(_85a.ignorePopups){_4.forEach(_856,function(_85f){delete _85f.infoTemplate;});}if(!(_85a.ignorePopups||_85a.disableClickBehavior)){_85e=_4.connect(map,"onClick",EAU._showPopup);}_4.connect(map,"onLayersAddResult",EAU._onLayersAddResult);map.addLayers(_856);if(!_85a.ignorePopups){EAU._addSelectionLayers(_856,map,_85a._clazz);}var _860=[];_4.forEach(_857,function(_861){_860=_860.concat(_861.errors);},this);_85b.callback({map:map,itemInfo:_858,errors:_860,clickEventHandle:_85e,clickEventListener:EAU._showPopup});};EAU._addSelectionLayers=function(_862,map,_863){var _864=[];_4.forEach(_862,function(_865){var _866=_865.__popups;if(_866&&_866.length>1&&_865.version>=10){_865.__deferredsPos=_864.length;_864.push(EAU._getLayersInfo(_865));}});var _867=[];if(_864.length>0){var _868=new _4.DeferredList(_864);_868.addCallback(function(_869){_4.forEach(_862,function(_86a){if(_86a.__popups&&_86a.__popups.length>0){if(_86a.__deferredsPos||_86a.__deferredsPos===0){var _86b=_869[_86a.__deferredsPos][1];_867=_867.concat(EAU._createSelectionFeatureLayers(_86a,_86b.layers,_863,map));delete _86a.__deferredsPos;}else{_867=_867.concat(EAU._createSelectionFeatureLayers(_86a,null,_863,map));}}});map.addLayers(_867);});}else{_4.forEach(_862,function(_86c){if(_86c.__popups&&_86c.__popups.length>0){_867=_867.concat(EAU._createSelectionFeatureLayers(_86c,null,_863,map));}});map.addLayers(_867);}};EAU._createSelectionFeatureLayers=function(_86d,_86e,_86f,map){var url=_86d.url;var _870=_86d.__popups;var ids=_86d.__popupIds;var _871=_86d.__resourceInfo;var _872=[];_4.forEach(_870,function(_873,_874){var i,_875=null;if(_86e){for(i=0;i<_86e.length;i++){if(_86e[i].id===ids[_874]){_875=_86e[i];break;}}}var _876=new esri.layers.FeatureLayer(EAU._checkUrl(url+"/"+ids[_874]),{id:_86d.id+"_"+ids[_874],outFields:["*"],mode:esri.layers.FeatureLayer.MODE_SELECTION,infoTemplate:_873&&new _86f(_873),drawMode:false,visible:_86d.visible,resourceInfo:_875,autoGeneralize:true});if(_876.loaded){EAU._updateLayerScaleInfo(_871.layers,_876);}else{_4.connect(_876,"onLoad",function(_877){EAU._updateLayerScaleInfo(_871.layers,_877);});}_872.push(_876);});if(_872.length>0){var _878=function(_879,_87a){_4.forEach(_879,function(_87b){if(_87a){_87b.show();}else{_87b.hide();}});};_4.connect(_86d,"onVisibilityChange",_4.hitch(this,_878,_872));var _87c=function(_87d,_87e,_87f){if(_87d.id===_87f.id){_4.forEach(_87e,function(_880){map.removeLayer(_880);});}};_4.connect(map,"onLayerRemove",_4.hitch(this,_87c,_86d,_872));}delete _86d.__popups;delete _86d.__popupIds;delete _86d.__resourceInfo;return _872;};EAU._getServiceInfo=function(url,_881){var url2=EAU._checkUrl(url);return esri.request({url:url2,content:{f:"json"},callbackParamName:"callback",error:function(_882,io){if(_882.message){_882.message+=" [url:"+url2+"]";}else{_882.message="[url:"+url2+"]";}_881.push(_882);esri.config.defaults.io.errorHandler(_882,io);}});};EAU._getLayersInfo=function(_883){return esri.request({url:EAU._checkUrl(_883.url+"/layers"),content:{f:"json"},callbackParamName:"callback",error:function(){}});};EAU._initLayer=function(_884,_885,_886,_887){var _888,_889=_886._clazz;if(_884.type==="OpenStreetMap"){_888=new esri.layers.OpenStreetMapLayer({id:_884.id});}else{if(_884.type==="WMS"){var _88a=[];var _88b=[];_4.forEach(_884.layers,function(_88c){_88b.push(new esri.layers.WMSLayerInfo({name:_88c.name,title:_88c.title,legendURL:_88c.legendURL}));_88a.push(_88c.name);},this);if(_884.visibleLayers){_88a=_884.visibleLayers;}var _88d=new esri.geometry.Extent(_884.extent[0][0],_884.extent[0][1],_884.extent[1][0],_884.extent[1][1],new esri.SpatialReference({wkid:4326}));var _88e={extent:_88d,layerInfos:_88b,version:_884.version,maxWidth:_884.maxWidth,maxHeight:_884.maxHeight,getMapUrl:_884.mapUrl,spatialReferences:_884.spatialReferences,title:_884.title,copyright:_884.copyright};_888=new esri.layers.WMSLayer(_884.url,{id:_884.id,visibleLayers:_88a,format:"png",transparent:_884.baseMapLayer?false:true,opacity:_884.opacity,resourceInfo:_88e});_888.spatialReference.wkid=_88e.spatialReferences[0];}else{if(_884.type==="KML"){_888=new esri.layers.KMLLayer(_884.url,{id:_884.id,outSR:_887});_4.connect(_888,"onLoad",function(){var _88f=function(_890){_4.forEach(_890,function(_891){if(_891.declaredClass==="esri.layers.FeatureLayer"||_891.declaredClass==="esri.layers.MapImageLayer"){_891.setOpacity(_884.opacity);}else{if(_891.declaredClass==="esri.layers.KMLLayer"){if(_891.loaded){_88f(_891.getLayers());}else{_4.connect(_891,"onLoad",_4.hitch(this,function(lyr){_88f(lyr.getLayers());}));}}}});};if(_884.opacity!==null){_88f(_888.getLayers());}if(_884.visibleFolders){_4.forEach(_888.folders,function(_892){if(_4.indexOf(_884.visibleFolders,_892.id)>-1){_888.setFolderVisibility(_892,true);}else{_888.setFolderVisibility(_892,false);}},this);}});}else{if(_884.type=="CSV"&&_884.url){_888=new esri.layers.FeatureLayer(_884.featureCollection,{infoTemplate:new esri.dijit.PopupTemplate(_884.popupInfo?_884.popupInfo:esri.arcgis.csv.generateDefaultPopupInfo(_884.featureCollection)),id:_884.id?_884.id:null,outFields:["*"],visible:(_884.visibility!==null)?_884.visibility:true,opacity:_884.opacity?_884.opacity:1,autoGeneralize:true});}else{if(_884.layerDefinition&&!_884.url){var _893=_4.fromJson(_4.toJson(_884));delete _893.id;delete _893.opacity;delete _893.visibility;_888=new esri.layers.FeatureLayer(_893,{id:_884.id,opacity:_884.opacity,visible:_884.visibility,outFields:["*"],infoTemplate:_893.popupInfo&&new _889(_893.popupInfo),autoGeneralize:true});}else{if(_884.type==="BingMapsAerial"||_884.type==="BingMapsRoad"||_884.type==="BingMapsHybrid"){var _894=esri.virtualearth.VETiledLayer.MAP_STYLE_AERIAL_WITH_LABELS;if(_884.type==="BingMapsAerial"){_894=esri.virtualearth.VETiledLayer.MAP_STYLE_AERIAL;}else{if(_884.type==="BingMapsRoad"){_894=esri.virtualearth.VETiledLayer.MAP_STYLE_ROAD;}}_888=new esri.virtualearth.VETiledLayer({bingMapsKey:_886.bingMapsKey,mapStyle:_894,id:_884.id});}else{if(_884.resourceInfo&&_884.resourceInfo.mapName){if(_884.resourceInfo.singleFusedMapCache===true){if(!_884.baseMapLayer){if(EAU._sameSpatialReferenceAsBasemap(_884,_885)){if(EAU._sameTilingSchemeAsBasemap(_884,_885)){_888=EAU._loadAsCached(_884);}else{_888=EAU._loadAsDynamic(_884);}}else{_888=EAU._loadAsDynamic(_884);}}else{_888=EAU._loadAsCached(_884);}}else{_888=EAU._loadAsDynamic(_884);}}else{if(_884.resourceInfo&&_884.resourceInfo.pixelSizeX){var _895=new esri.layers.ImageServiceParameters();_895.bandIds=_884.bandIds;if(!_884.bandIds&&_884.resourceInfo.bandCount&&parseInt(_884.resourceInfo.bandCount,10)>3){_895.bandIds=[0,1,2];}_888=new esri.layers.ArcGISImageServiceLayer(EAU._checkUrl(_884.url),{resourceInfo:_884.resourceInfo,opacity:_884.opacity,visible:_884.visibility,id:_884.id,imageServiceParameters:_895});}else{if(_884.resourceInfo&&_884.resourceInfo.type==="Feature Layer"){_888=new esri.layers.FeatureLayer(EAU._checkUrl(_884.url),{resourceInfo:_884.resourceInfo,opacity:_884.opacity,visible:_884.visibility,id:_884.id,mode:esri._isDefined(_884.mode)?_884.mode:esri.layers.FeatureLayer.MODE_ONDEMAND,outFields:["*"],infoTemplate:_884.popupInfo&&new _889(_884.popupInfo),autoGeneralize:true});if(_884.layerDefinition){if(_884.layerDefinition.drawingInfo&&_884.layerDefinition.drawingInfo.renderer){var _896=esri.renderer.fromJson(_884.layerDefinition.drawingInfo.renderer);_888.setRenderer(_896);}if(_884.layerDefinition.definitionExpression){_888.setDefinitionExpression(_884.layerDefinition.definitionExpression);}if(esri._isDefined(_884.layerDefinition.minScale)){_888.minScale=_884.layerDefinition.minScale;}if(esri._isDefined(_884.layerDefinition.maxScale)){_888.maxScale=_884.layerDefinition.maxScale;}}}}}}}}}}}_888.arcgisProps={title:_884.title};return _888;};EAU._loadAsCached=function(_897){var _898=[];if(!_897.displayLevels){_898=_4.map(_897.resourceInfo.tileInfo.lods,function(lod){return lod.level;});}var _899=new esri.layers.ArcGISTiledMapServiceLayer(EAU._checkUrl(_897.url),{resourceInfo:_897.resourceInfo,opacity:_897.opacity,visible:_897.visibility,displayLevels:_897.displayLevels||_898,id:_897.id});EAU._processPopups(_899,_897);return _899;};EAU._loadAsDynamic=function(_89a){var _89b=new esri.layers.ImageParameters();_89b.format="png24";if(_89a.resourceInfo&&_89a.resourceInfo.supportedImageFormatTypes&&_89a.resourceInfo.supportedImageFormatTypes.indexOf("PNG32")>-1){_89b.format="png32";}var _89c=new esri.layers.ArcGISDynamicMapServiceLayer(EAU._checkUrl(_89a.url),{resourceInfo:_89a.resourceInfo,opacity:_89a.opacity,visible:_89a.visibility,id:_89a.id,imageParameters:_89b});if(!_89a.visibleLayers){var _89d="";var _89e=_89c.layerInfos;_4.forEach(_89e,function(_89f){if(_89f.defaultVisibility){_89d+=(_89d.length>0?",":"")+_89f.id;}});_89a.visibleLayers=_89d;}var _8a0=EAU._getVisibleFeatureLayers(_89c.layerInfos,_89a.visibleLayers);_89c.setVisibleLayers(_8a0);if(_89a.layers&&_89a.layers.length>0){var _8a1=[];_4.forEach(_89a.layers,function(_8a2){if(_8a2.layerDefinition&&_8a2.layerDefinition.definitionExpression){_8a1[_8a2.id]=_8a2.layerDefinition.definitionExpression;}},this);if(_8a1.length>0){_89c.setLayerDefinitions(_8a1);}}EAU._processPopups(_89c,_89a);return _89c;};EAU._processPopups=function(_8a3,_8a4){var _8a5=_8a3.layerInfos;var _8a6=_8a4.layers;if(_8a6&&_8a5){var _8a7=[],ids=[];_4.forEach(_8a5,function(_8a8){var id=_8a8.id,i;if(!_8a8.subLayerIds&&_4.indexOf(_8a3.visibleLayers,id)!==-1){for(i=0;i<_8a6.length;i++){var _8a9=_8a6[i];if(_8a9.id===id){ids.push(id);_8a7.push(_8a9.popupInfo);break;}}}});if(_8a7.length){_8a3.__popups=_8a7;_8a3.__popupIds=ids;_8a3.__resourceInfo=_8a4.resourceInfo;}}};EAU._onLayersAddResult=function(_8aa){_4.forEach(_8aa,function(_8ab){var _8ac=_8ab.layer;if(_8ac.toJson){var json=_8ac.toJson();if(json.featureSet&&_8ac.name.indexOf("Text")>-1){_4.forEach(json.featureSet.features,function(_8ad,idx){if(_8ad.attributes.TEXT){var _8ae=_8ac.graphics[idx];_8ae.symbol.setText(_8ad.attributes.TEXT);if(_8ad.symbol.horizontalAlignment){_8ae.symbol.align=_8ad.symbol.horizontalAlignment;}_8ae.setSymbol(_8ae.symbol);_8ae.setAttributes(_8ad.attributes);}},this);}}});};EAU._sameSpatialReferenceAsBasemap=function(_8af,_8b0){var _8b1=[102113,102100,3857];var sp1=_8b0[0].layerObject.fullExtent.spatialReference;var sp2=new esri.SpatialReference(_8af.resourceInfo.fullExtent.spatialReference);if(_4.toJson(sp1.toJson())===_4.toJson(sp2.toJson())){return true;}else{if(_4.some(_8b1,function(wkid){return wkid===sp2.wkid;})&&_4.some(_8b1,function(wkid){return wkid===sp1.wkid;})){return true;}}return false;};EAU._sameTilingSchemeAsBasemap=function(_8b2,_8b3){if(!_8b3[0].layerObject.tileInfo){return false;}var _8b4=[];_4.forEach(_8b3,function(_8b5){if(_8b5.baseMapLayer){if(_8b5.layerObject.tileInfo){_8b4=_8b4.concat(_4.map(_8b5.layerObject.tileInfo.lods,function(lod){return lod.scale;}));}}});var _8b6=_4.some(_8b2.resourceInfo.tileInfo.lods,function(lod){return _4.some(_8b4,function(_8b7){return _8b7===lod.scale;});});return _8b6;};EAU._showPopup=function(evt){var map=this,_8b8=map.infoWindow,_8b9=evt.graphic;if(!map.loaded){return;}_8b8.hide();_8b8.clearFeatures();var _8ba=[];_4.forEach(map.graphicsLayerIds,function(_8bb){var _8bc=map.getLayer(_8bb);if(_8bc&&_8bc.declaredClass.indexOf("FeatureLayer")!==-1&&_8bc.loaded&&_8bc.visible){_8bc.clearSelection();if(_8bc.infoTemplate&&!_8bc._suspended){_8ba.push(_8bc);}}});_8b9=(_8b9&&_8b9._getEffInfoTemplate())?_8b9:null;if(!_8ba.length&&!_8b9){return;}var _8bd=EAU._calculateClickTolerance(_8ba);var _8be=evt.screenPoint,_8bf=map.toMap(new esri.geometry.Point(_8be.x-_8bd,_8be.y+_8bd)),_8c0=map.toMap(new esri.geometry.Point(_8be.x+_8bd,_8be.y-_8bd)),_8c1=new esri.geometry.Extent(_8bf.x,_8bf.y,_8c0.x,_8c0.y,map.spatialReference);var _8c2=new esri.tasks.Query();_8c2.geometry=_8c1;_8c2.timeExtent=map.timeExtent;var _8c3=_4.map(_8ba,function(_8c4){var dfd=_8c4.selectFeatures(_8c2);dfd.addCallback(function(){var _8c5=_8c4.getSelectedFeatures();return _8c5;});return dfd;});if(_8b9){var dfd=new _4.Deferred();dfd.callback([_8b9]);_8c3.splice(0,0,dfd);}var _8c6=_4.some(_8c3,function(dfd){return dfd.fired===-1;});if(!_8c6){var _8c7=_8b9?1:0;_4.forEach(_8ba,function(_8c8){_8c7=_8c7+_8c8.getSelectedFeatures().length;});if(!_8c7){return;}}_8b8.setFeatures(_8c3);_8b8.show(evt.mapPoint);};EAU._calculateClickTolerance=function(_8c9){var _8ca=6;_4.forEach(_8c9,function(_8cb){var _8cc=_8cb.renderer;if(_8cc.declaredClass==="esri.renderer.SimpleRenderer"){var _8cd=_8cc.symbol;if(_8cd&&_8cd.xoffset){_8ca=Math.max(_8ca,Math.abs(_8cd.xoffset));}if(_8cd&&_8cd.yoffset){_8ca=Math.max(_8ca,Math.abs(_8cd.yoffset));}}else{if(_8cc.declaredClass==="esri.renderer.UniqueValueRenderer"||_8cc.declaredClass==="esri.renderer.ClassBreaksRenderer"){_4.forEach(_8cc.infos,function(info){var _8ce=info.symbol;if(_8ce&&_8ce.xoffset){_8ca=Math.max(_8ca,Math.abs(_8ce.xoffset));}if(_8ce&&_8ce.yoffset){_8ca=Math.max(_8ca,Math.abs(_8ce.yoffset));}});}}});return _8ca;};EAU._getVisibleFeatureLayers=function(_8cf,_8d0){if(!_8cf||!_8d0||_8d0.length===0){return [];}var _8d1=","+_8d0+",";var _8d2=[];var _8d3="";var k,_8d4=",";for(k=0;k<_8cf.length;k++){if(_8cf[k].subLayerIds!==null){if(_8d1.indexOf(","+_8cf[k].id+",")===-1||_8d4.indexOf(","+_8cf[k].id+",")>-1){_8d4+=_8cf[k].subLayerIds.toString()+",";}}else{if(_8d1.indexOf(","+_8cf[k].id+",")>-1&&_8d4.indexOf(","+_8cf[k].id+",")===-1){_8d2.push(_8cf[k].id);_8d3=",";}}}return _8d2;};EAU._updateLayerScaleInfo=function(_8d5,_8d6){if(_8d6.version<=10.1&&_8d5){var i,id=parseInt(_8d6.url.substring(_8d6.url.lastIndexOf("/")+1,_8d6.url.length));for(i=_8d5.length-1;i>=0;i--){if(_8d5[i].id==id){if(_8d6.minScale==0&&_8d5[i].minScale>0){_8d6.minScale=_8d5[i].minScale;}else{if(_8d6.minScale>0&&_8d5[i].minScale==0){_8d6.minScale=_8d6.minScale;}else{if(_8d6.minScale>0&&_8d5[i].minScale>0){_8d6.minScale=Math.min(_8d6.minScale,_8d5[i].minScale);}}}_8d6.maxScale=Math.max(_8d6.maxScale||0,_8d5[i].maxScale||0);if(_8d5[i].parentLayerId>-1){id=_8d5[i].parentLayerId;}else{break;}}}}};EAU._checkUrl=function(url){if(location.protocol==="https:"&&(EAU._isHostedService(url)||EAU._isAgolService(url))){url=url.replace("http:","https:");}return url;};EAU._isHostedService=function(url){if(!url){return false;}var _8d7=".arcgis.com/";var _8d8=(new _4._Url(EAU.arcgisUrl)).authority;return (url.indexOf(_8d7)!==-1||url.indexOf(_8d8)!==-1);};EAU._isAgolService=function(url){if(!url){return false;}return (url.indexOf("/services.arcgisonline.com/")!==-1||url.indexOf("/server.arcgisonline.com/")!==-1);};}());}}};});
