/*
 COPYRIGHT 2009 ESRI

 TRADE SECRETS: ESRI PROPRIETARY AND CONFIDENTIAL
 Unpublished material - all rights reserved under the
 Copyright Laws of the United States and applicable international
 laws, treaties, and conventions.

 For additional information, contact:
 Environmental Systems Research Institute, Inc.
 Attn: Contracts and Legal Services Department
 380 New York Street
 Redlands, California, 92373
 USA

 email: contracts@esri.com
 */
//>>built
require({cache:{"url:esri/dijit/analysis/templates/BufferTool.html":"<div class=\"esriAnalysis\">\r\n    <div data-dojo-type=\"dijit/layout/ContentPane\" style=\"margin-top:0.5em; margin-bottom: 0.5em;\">\r\n      <div data-dojo-attach-point=\"_bufferToolContentTitle\" class=\"analysisTitle\">\r\n         <table class=\"esriFormTable\" >\r\n            <tr>\r\n              <td class=\"esriToolIconTd\"><div class=\"buffersIcon\"></div></td>\r\n              <td class=\"esriAlignLeading\">${i18n.createBuffers}</td>\r\n              <td>\r\n                <div class=\"esriFloatTrailing\" style=\"padding:0;\">\r\n                  <a href=\"#\" class='esriFloatLeading helpIcon' esriHelpTopic=\"toolDescription\"></a>\r\n                  <a href=\"#\" data-dojo-attach-point=\"_closeBtn\" title=\"${i18n.close}\" class=\"closeIcon\">              \r\n                  <img data-dojo-attach-point=\"_closeImg\" border=\"0\"/></a>\r\n                </div>\r\n              </td>\r\n            </tr>\r\n         </table>\r\n      </div>\r\n      <div style=\"clear:both; border-bottom: #333 thin solid; height:1px;width:100%;\"></div>\r\n    </div>\r\n    <div data-dojo-type=\"dijit/form/Form\" data-dojo-attach-point=\"_form\" readOnly=\"true\">\r\n     <table class=\"esriFormTable\"  data-dojo-attach-point=\"_bufferTable\">\r\n       <tbody>\r\n        <tr>\r\n          <td colspan=\"2\" class=\"sectionHeader esriLeadingMargin1\" data-dojo-attach-point=\"_bufferToolDescription\" >\r\n            <div>${i18n.bufferDefine}</div>\r\n          </td>\r\n        </tr>\r\n        <tr>\r\n          <td style=\"padding-top:5px;\">\r\n            <label data-dojo-attach-point=\"_labelOne\" class=\"esriFloatLeading esriTrailingMargin025\">${i18n.oneLabel}</label>\r\n            <label data-dojo-attach-point=\"_polylabel\" class=\"\">${i18n.sizeLabel}</label>\r\n          </td>\r\n          <td class=\"longTextInput\">\r\n            <a href=\"#\" class='esriFloatTrailing helpIcon' data-dojo-attach-point=\"_analysisFieldHelpLink\" esriHelpTopic=\"BufferSize\"></a>\r\n          </td>\r\n        </tr>\r\n        <tr>\r\n          <td colspan=\"2\">\r\n            <table>\r\n              <tr>\r\n                <td>\r\n                  <div class=\"esriLeadingMargin4 bufferSelector selected\" data-dojo-attach-point=\"_Distance\" >\r\n                    <div class=\"bufferIcon bufferDistanceIcon\"></div>\r\n                    <div><label class=\"esriSelectLabel\">${i18n.distance}</label></div>\r\n                  </div>\r\n                </td>\r\n                <td>\r\n                  <div class=\"bufferSelector\" data-dojo-attach-point=\"_Attribute\">\r\n                    <div class=\"bufferIcon bufferAttributeIcon\"></div>\r\n                    <div><label class=\"esriSelectLabel\">${i18n.field}</label></div>\r\n                  </div>\r\n                </td>\r\n              </tr>\r\n            </table>\r\n          </td>\r\n        </tr>\r\n        <tr>\r\n         <td colspan=\"2\">\r\n         <table style=\"width:99%;\">\r\n          <tr>\r\n          <td style=\"width:45%;\">\r\n            <input type=\"text\" class=\"\" data-dojo-type=\"dijit/form/ValidationTextBox\" data-dojo-props=\"intermediateChanges:true,value:'1',required:true,missingMessage:'${i18n.distanceMsg}'\" data-dojo-attach-point=\"_bufferDist\" style=\"width:95%;\"></input>\r\n            <select class=\"\" data-dojo-attach-point=\"_bufferDistAttribute\" data-dojo-type=\"dijit/form/Select\" style=\"display:none; width:95%;table-layout:fixed;\"></select>\r\n          </td>\r\n          <td style=\"width:55%;\"> \r\n            <!-- Default, Centimeters, DecimalDegrees, Feet, Inches, Kilometers, Meters, Miles, Millimeters, NauticalMiles, Points, Yards -->\r\n            <select class=\"mediumInput esriAnalysisSelect\" data-dojo-type=\"dijit/form/Select\" data-dojo-attach-point=\"_bufferUnits\" style=\"width:105%;table-layout:fixed;\">\r\n              <option value=\"Miles\">${i18n.miles}</option>\r\n              <option value=\"Yards\">${i18n.yards}</option>\r\n              <option value=\"Feet\">${i18n.feet}</option>\r\n              <option type=\"separator\"></option>\r\n              <option value=\"Kilometers\">${i18n.kilometers}</option>\r\n              <option value=\"Meters\">${i18n.meters}</option>\r\n              <option value=\"NauticalMiles\">${i18n.nautMiles}</option>\r\n            </select>\r\n          </td>\r\n          </tr>\r\n          <tr>\r\n            <td class=\"shortTextInput\" colspan=\"2\" align=\"center\" data-dojo-attach-point=\"_sizeHelp\">\r\n              <label class=\"esriSmallLabel\">${i18n.sizeHelp}</label>\r\n            </td>\r\n          </tr>\r\n         </table>\r\n         </td>\r\n        </tr>\r\n\r\n        <tr data-dojo-attach-point=\"_optionsRow\">\r\n          <td colspan=\"2\" style=\"padding:5px 0px;\">\r\n            <div class=\"optionsClose\" style=\"width:99%\" data-dojo-attach-point=\"_optionsDiv\">\r\n              <div class=\"dijitTreeExpando\" data-dojo-attach-event=\"onclick:_handleOptionsBtnClick\"><label class=\"esriLeadingMargin2\">${i18n.optionsLabel}</label></div>\r\n              <a style=\"position:relative; top:-16px; left:1px; \"href=\"#\" class='esriFloatTrailing helpIcon' data-dojo-attach-point=\"_bufferOptionsHelpLink\" esriHelpTopic=\"BufferOptionPoly\"></a>\r\n              <table class=\"esriFormTable optionsTable\">\r\n                <tbody>\r\n\r\n                <tr>\r\n                  <td colspan=\"2\" align=\"\">\r\n                    <div class=\"esriFloatLeading esriLeadingMargin2\">${i18n.typeLabel}</div>\r\n                  </td>\r\n                </tr> \r\n\r\n                <tr>\r\n                  <td>\r\n                    <table>\r\n                      <tr>\r\n                        <td>\r\n                          <div class=\"esriLeadingMargin4 bufferSelector selected\" data-dojo-attach-point=\"_Overlap\">\r\n                            <div class=\"bufferIcon bufferOverlapIcon\"></div>\r\n                            <div><label class=\"esriSelectLabel\">${i18n.overlap}</label></div>\r\n                          </div>\r\n                        </td>\r\n                        <td>\r\n                          <div class=\"bufferSelector\" data-dojo-attach-point=\"_Dissolve\">\r\n                            <div class=\"bufferIcon bufferDissolveIcon\"></div>\r\n                            <div><label class=\"esriSelectLabel\">${i18n.dissolve}</label></div>\r\n                          </div>\r\n                        </td>\r\n                      </tr>\r\n                    </table>\r\n                  </td>\r\n                </tr>\r\n\r\n                <tr>\r\n                  <td colspan=\"2\" align=\"\">\r\n                    <table data-dojo-attach-point=\"polygonTypes\" style=\"display:none;\">\r\n                      <tr>\r\n                        <td colspan=\"2\" align=\"\">\r\n                          <div class=\"esriFloatLeading esriLeadingMargin2\">${i18n.areaofInputPoly}</div>\r\n                        </td>\r\n                      </tr>\r\n                      <tr>\r\n                        <td>\r\n                          <table>\r\n                            <tr>\r\n                              <td>\r\n                                <div class=\"esriLeadingMargin4 bufferSelector selected\" data-dojo-attach-point=\"_Include\">\r\n                                  <div class=\"bufferIcon bufferIncludeIcon\"></div>\r\n                                  <div><label class=\"esriSelectLabel\">${i18n.include}</label></div>\r\n                                </div>\r\n                              </td>\r\n                              <td>\r\n                                <div class=\"bufferSelector\" data-dojo-attach-point=\"_Exclude\">\r\n                                  <div class=\"bufferIcon bufferExcludeIcon\"></div>\r\n                                  <div><label class=\"esriSelectLabel\">${i18n.exclude}</label></div>\r\n                                </div>\r\n                              </td>\r\n                            </tr>\r\n                          </table>\r\n                        </td>\r\n                      </tr>\r\n                    </table>\r\n                  </td>\r\n                </tr>\r\n\r\n\r\n\r\n                <tr>\r\n                  <td colspan=\"2\">\r\n                    <div>\r\n                    <table data-dojo-attach-point=\"sideTypes\" style=\"display:none;\">\r\n                      <tr>\r\n                        <td align=\"center\" colspan=\"3\">\r\n                          <div class=\"esriFloatLeading esriLeadingMargin2\">${i18n.sideType}</div>\r\n                        </td>\r\n                      </tr>\r\n                      <tr>\r\n                          <td>\r\n                            <div class=\"esriLeadingMargin4 bufferSelector selected\" data-dojo-attach-point=\"_Around\">\r\n                              <div class=\"bufferIcon bufferAroundIcon\"></div>\r\n                              <div><label class=\"esriSelectLabel\">${i18n.around}</label></div>\r\n                            </div>\r\n                          </td>\r\n                          <td>\r\n                            <div class=\"bufferSelector\" data-dojo-attach-point=\"_Left\" >\r\n                              <div class=\"bufferIcon bufferLeftIcon\"></div>\r\n                              <div><label class=\"esriSelectLabel\">${i18n.left}</label></div>\r\n                            </div>\r\n                          </td>\r\n                          <td>\r\n                            <div class=\"bufferSelector\" data-dojo-attach-point=\"_Right\">\r\n                              <div class=\"bufferIcon bufferRightIcon\"></div>\r\n                              <div><label class=\"esriSelectLabel\">${i18n.right}</label></div>\r\n                            </div>\r\n                          </td>\r\n                      </tr>\r\n                     </table>\r\n                    </div>\r\n                    <div>\r\n                     <table data-dojo-attach-point=\"endTypes\" style=\"display:none;\">\r\n                      <tr>\r\n                        <td align=\"center\" colspan=\"2\">\r\n                          <div class=\"esriFloatLeading esriLeadingMargin2\">${i18n.endType}</div>\r\n                        </td>\r\n                      </tr>\r\n                      <tr>\r\n                          <td>\r\n                            <div class=\"esriLeadingMargin4 bufferSelector selected\" data-dojo-attach-point=\"_Round\" >\r\n                              <div class=\"bufferIcon bufferRoundIcon\"></div>\r\n                              <div><label class=\"esriSelectLabel\">${i18n.round}</label></div>\r\n                            </div>\r\n                          </td>\r\n                          <td>\r\n                            <div class=\"bufferSelector\" data-dojo-attach-point=\"_Flat\">\r\n                              <div class=\"bufferIcon bufferFlatIcon\"></div>\r\n                              <div><label class=\"esriSelectLabel\">${i18n.flat}</label></div>\r\n                            </div>\r\n                          </td>\r\n                      </tr>\r\n                    </table>\r\n                    </div>\r\n                  </td>\r\n                </tr>\r\n\r\n                <tr>\r\n                  <td colspan=\"2\" align=\"center\">\r\n                    <table data-dojo-attach-point=\"ringTypes\" style=\"display:none;\">\r\n                      <tr>\r\n                        <td colspan=2 align=\"center\">\r\n                          <div class=\"esriFloatLeading esriLeadingMargin2\">${i18n.multipleDistance}</div>\r\n                        </td>\r\n                      </tr>\r\n                      <tr>\r\n                          <td>\r\n                            <div>\r\n                            <table>\r\n                            <tr>\r\n                            <td>\r\n                              <div class=\"esriLeadingMargin4 bufferSelector selected\" data-dojo-attach-point=\"_Rings\">\r\n                                <div class=\"bufferIcon bufferRingsIcon\"></div>\r\n                                <div><label class=\"esriSelectLabel\">${i18n.rings}</label></div>\r\n                              </div>\r\n                            </td>\r\n                            <td>\r\n                              <div class=\"bufferSelector\" data-dojo-attach-point=\"_Disks\">\r\n                                <div class=\"bufferIcon bufferDisksIcon\"></div>\r\n                                <div><label class=\"esriSelectLabel\">${i18n.disks}</label></div>\r\n                              </div>\r\n                            </td>\r\n                            </tr>\r\n                            </table>\r\n                            </div>\r\n                          </td>  \r\n                      </tr>\r\n                    </table>\r\n                  </td>\r\n                </tr>\r\n    \r\n\r\n\r\n                </tbody>\r\n              </table>\r\n            </div>\r\n          </td>\r\n        </tr>\r\n    \r\n        <tr>\r\n          <td  style=\"padding:5px 0px;\">\r\n            <label data-dojo-attach-point=\"_labelOne\" class=\"esriFloatLeading esriTrailingMargin025\">${i18n.twoLabel}</label>\r\n            <label data-dojo-attach-point=\"_polylabel\" class=\"\">${i18n.resultLabel}</label>\r\n          </td>\r\n          <td class=\"longTextInput\">\r\n            <a href=\"#\" class='esriFloatTrailing helpIcon' data-dojo-attach-point=\"_analysisFieldHelpLink\" esriHelpTopic=\"BufferLayer\"></a>\r\n          </td>\r\n        </tr>\r\n        <tr>\r\n          <td colspan=\"2\">\r\n            <input type=\"text\" data-dojo-type=\"dijit/form/ValidationTextBox\" class=\"longInput\" data-dojo-props=\"required:true\" data-dojo-attach-point=\"outputLayerInput\"  value=\"\">\r\n          </td>\r\n        </tr>\r\n        <tr>\r\n          <td colspan=\"3\">\r\n             <div data-dojo-attach-point=\"_chooseFolderRow\">\r\n               <label style=\"width:9px;font-size:smaller;\">${i18n.saveResultIn}</label>\r\n               <input class=\"longInput\" dojoAttachPoint=\"_webMapFolderSelect\" dojotype=\"dijit/form/ComboBox\" trim=\"true\" style=\"width:60%;height:auto\"></input>\r\n             </div>              \r\n          </td>\r\n        </tr>         \r\n       </tbody>\r\n      </table>\r\n\r\n    </div>\r\n    <div data-dojo-attach-point=\"_bufferToolContentButtons\" style=\"padding:5px;margin-top:5px;border-top:solid 1px #BBB;\">\r\n      <div style=\"width:100%;padding:0.5em 0 0.5em 0\">\r\n        <a class=\"esriFloatTrailing esriSmallFont\"  href=\"#\" data-dojo-attach-point=\"_showCreditsLink\" data-dojo-attach-event=\"onclick:_handleShowCreditsClick\">${i18n.showCredits}</a>\r\n       <label data-dojo-attach-point=\"_chooseExtentDiv\"class=\"esriSelectLabel\" style=\"font-size:smaller;\">\r\n         <input type=\"radio\" data-dojo-attach-point=\"_useExtentCheck\" data-dojo-type=\"dijit/form/CheckBox\" data-dojo-props=\"checked:true\" name=\"extent\" value=\"true\"/>\r\n           ${i18n.useMapExtent}\r\n       </label>\r\n      </div>\r\n      <button data-dojo-type=\"dijit/form/Button\" type=\"submit\" data-dojo-attach-point=\"_saveBtn\" class=\"esriLeadingMargin4\" data-dojo-attach-event=\"onClick:_handleSaveBtnClick\">\r\n          ${i18n.runAnalysis}\r\n      </button>\r\n    </div>\r\n    <div data-dojo-type=\"dijit/Dialog\" title=\"${i18n.creditTitle}\" data-dojo-attach-point=\"_usageDialog\" style=\"width:40em;\">\r\n      <div data-dojo-type=\"esri/dijit/analysis/CreditEstimator\"  data-dojo-attach-point=\"_usageForm\"></div>\r\n    </div>    \r\n</div>\r\n"}});define("esri/dijit/analysis/BufferTool",["require","dojo/_base/declare","dojo/_base/lang","dojo/_base/array","dojo/_base/connect","dojo/_base/json","dojo/has","dojo/i18n","dojo/json","dojo/string","dojo/dom-style","dojo/dom-attr","dojo/dom-construct","dojo/query","dojo/dom-class","dojo/number","dijit/_WidgetBase","dijit/_TemplatedMixin","dijit/_WidgetsInTemplateMixin","dijit/_OnDijitClickMixin","dijit/_FocusMixin","dijit/registry","dijit/form/Button","dijit/form/CheckBox","dijit/form/Form","dijit/form/Select","dijit/form/TextBox","dijit/form/ValidationTextBox","dijit/layout/ContentPane","dijit/form/ComboBox","dijit/Dialog","esri/kernel","esri/lang","esri/dijit/analysis/AnalysisBase","esri/dijit/analysis/utils","esri/dijit/analysis/CreditEstimator","dojo/text!esri/dijit/analysis/templates/BufferTool.html"],function(_1,_2,_3,_4,_5,_6,_7,_8,_9,_a,_b,_c,_d,_e,_f,_10,_11,_12,_13,_14,_15,_16,_17,_18,_19,_1a,_1b,_1c,_1d,_1e,_1f,_20,_21,_22,_23,_24,_25){var _26=_2([_11,_12,_13,_14,_15,_22],{declaredClass:"esri.dijit.analysis.BufferTool",templateString:_25,basePath:_1.toUrl("esri/dijit/analysis"),widgetsInTemplate:true,inputLayer:null,inputType:null,outputLayerName:null,bufferDistance:null,units:null,showSelectFolder:false,showChooseExtent:true,showHelp:true,showCredits:true,i18n:null,toolName:"CreateBuffers",helpFileName:"CreateBuffers",resultParameter:"BufferLayer",constructor:function(_27,_28){this.inherited(arguments);this._pbConnects=[];if(_27.containerNode){this.container=_27.containerNode;}},destroy:function(){this.inherited(arguments);_4.forEach(this._pbConnects,_5.disconnect);delete this._pbConnects;},postMixInProperties:function(){this.inherited(arguments);_3.mixin(this.i18n,_8.getLocalization("esri","jsapi").bufferTool);},postCreate:function(){this.inherited(arguments);_f.add(this._form,"esriSimpleForm");_c.set(this._closeImg,"src",this.basePath+"/images/close.gif");this.outputLayerInput.set("validator",_3.hitch(this,this.validateServiceName));this.bufferDistance=[];this.bufferDistance.push(this._bufferDist.get("value"));this._buildUI();},startup:function(){},_onClose:function(_29){if(_29){this._save();this.onSave();}this.onClose();},_toUpperFirstLetter:function(str){return (str.slice(0,1).toUpperCase()+str.slice(1));},_handleSaveBtnClick:function(e){var _2a={},_2b={};if(!this._form.validate()){return;}this._saveBtn.set("disabled",true);_2a.InputLayer=_6.toJson(_23.constructAnalysisInputLyrObj(this.inputLayer));_2a.DissolveType=(this._DissolveType&&this._DissolveType==="dissolve")?"Dissolve":"None";if(this.bufferDistType==="attribute"){_2a.Field=this._bufferDistAttribute.get("value");}else{_2a.Distances=this.bufferDistance;}_2a.Units=this._bufferUnits.get("value");if(this.bufferDistance.length){if(!this._RingType){this._RingType="rings";}_2a.RingType=(this._RingType==="rings")?"Rings":"Disks";}if(this.inputLayer.geometryType==="esriGeometryPolyline"||this.inputLayer.geometryType==="esriGeometryPolygon"){if(this.inputLayer.geometryType==="esriGeometryPolyline"){_2a.SideType=(this._SideType&&this._SideType==="left")?"Left":((this._SideType&&this._SideType==="right")?"Right":"Full");}else{_2a.SideType=(this._SideType&&this._SideType==="outside")?"Outside":"Full";}_2a.EndType=(this._EndType&&this._EndType==="flat")?"Flat":"Round";}_2a.OutputName=_6.toJson({serviceProperties:{name:this.outputLayerInput.get("value")}});if(this.showChooseExtent){if(this._useExtentCheck.get("checked")){_2a.context=_6.toJson({extent:this.map.extent});}}_2b.jobParams=_2a;_2b.itemParams={"description":_a.substitute(this.i18n.itemDescription,{layername:this.inputLayer.name,distance_field:_2a.Distances||_2a.Field,units:_2a.Units}),"tags":_a.substitute(this.i18n.itemTags,{layername:this.inputLayer.name}),"snippet":this.i18n.itemSnippet};if(this.showSelectFolder){_2b.itemParams.folder=this._webMapFolderSelect.item?this.folderStore.getValue(this._webMapFolderSelect.item,"id"):"";}this.execute(_2b);},_handleLayerChange:function(_2c){},_handleRadiusTypeChange:function(_2d){this.bufferDistType=_2d;_f.remove(this._Distance,"selected");_f.remove(this._Attribute,"selected");var _2e=this._bufferDist.get("value").split(" ");if(_2d==="attribute"){_b.set(this._bufferDistAttribute.domNode,"display","block");_b.set(this._bufferDist.domNode,"display","none");_b.set(this._sizeHelp,"visibility","hidden");_b.set(this.ringTypes,"display","none");if(this.inputType==="polygon"){_b.set(this.polygonTypes,"display","block");_b.set(this.sideTypes,"display","none");_b.set(this.endTypes,"display","none");}else{if(this.inputType==="line"){_b.set(this.sideTypes,"display","block");_b.set(this.endTypes,"display","block");_b.set(this.polygonTypes,"display","none");}}_f.add(this._Attribute,"selected");}else{if(_2d==="distance"){_b.set(this._bufferDistAttribute.domNode,"display","none");_b.set(this._bufferDist.domNode,"display","block");_b.set(this._sizeHelp,"visibility","visible");_f.add(this._Distance,"selected");if(_2e.length>1){_b.set(this.ringTypes,"display","block");_b.set(this.sideTypes,"display","none");_b.set(this.endTypes,"display","none");_b.set(this.polygonTypes,"display","none");}else{if(this.inputType==="polygon"){_b.set(this.ringTypes,"display","none");_b.set(this.sideTypes,"display","none");_b.set(this.endTypes,"display","none");_b.set(this.polygonTypes,"display","block");}else{if(this.inputType==="line"){_b.set(this.ringTypes,"display","none");_b.set(this.sideTypes,"display","block");_b.set(this.endTypes,"display","block");_b.set(this.polygonTypes,"display","none");}}}}}},_handleDissolveTypeChange:function(_2f){this._DissolveType=_2f;_f.remove(this._Overlap,"selected");_f.remove(this._Dissolve,"selected");_f.add((_2f==="none")?this._Overlap:this._Dissolve,"selected");},_handleRingTypeChange:function(_30){this._RingType=_30;_f.remove(this._Rings,"selected");_f.remove(this._Disks,"selected");_f.add((_30==="rings")?this._Rings:this._Disks,"selected");},_handlePolygonTypeChange:function(_31){this._SideType=_31;_f.remove(this._Include,"selected");_f.remove(this._Exclude,"selected");_f.add((_31==="full")?this._Include:this._Exclude,"selected");},_handleSideTypeChange:function(obj,_32){this._SideType=_32;_f.remove(this._Around,"selected");_f.remove(this._Left,"selected");_f.remove(this._Right,"selected");_f.add(obj,"selected");},_handleEndTypeChange:function(_33){this._EndType=_33;_f.remove(this._Round,"selected");_f.remove(this._Flat,"selected");_f.add((_33==="round")?this._Round:this._Flat,"selected");},_handleOptionsBtnClick:function(){if(_f.contains(this._optionsDiv,"disabled")){return;}if(_f.contains(this._optionsDiv,"optionsClose")){_f.remove(this._optionsDiv,"optionsClose");_f.add(this._optionsDiv,"optionsOpen");}else{if(_f.contains(this._optionsDiv,"optionsOpen")){_f.remove(this._optionsDiv,"optionsOpen");_f.add(this._optionsDiv,"optionsClose");}}},_handleDistanceChange:function(){var val=_3.trim(this._bufferDist.get("value")).split(" "),_34=[];if(val.length>1){_b.set(this.ringTypes,"display","block");_b.set(this.sideTypes,"display","none");_b.set(this.endTypes,"display","none");_b.set(this.polygonTypes,"display","none");}else{if(this.inputType==="line"){_b.set(this.sideTypes,"display","block");_b.set(this.endTypes,"display","block");}else{if(this.inputType==="polygon"){_b.set(this.polygonTypes,"display","block");}}_b.set(this.ringTypes,"display","none");}_4.forEach(val,function(v){_34.push(_10.parse(v));});this.bufferDistance=_34;},_handleShowCreditsClick:function(e){e.preventDefault();var _35={};if(!this._form.validate()){return;}_35.InputLayer=_6.toJson(_23.constructAnalysisInputLyrObj(this.inputLayer));_35.DissolveType=(this._DissolveType&&this._DissolveType==="dissolve")?"Dissolve":"None";if(this.bufferDistType==="attribute"){_35.Field=this._bufferDistAttribute.get("value");}else{_35.Distances=_6.toJson(this.bufferDistance);}_35.Units=this._bufferUnits.get("value");if(this.bufferDistance.length){if(!this._RingType){this._RingType="rings";}_35.RingType=(this._RingType==="rings")?"Rings":"Disks";}if(this.inputLayer.geometryType==="esriGeometryPolyline"||this.inputLayer.geometryType==="esriGeometryPolygon"){if(this.inputLayer.geometryType==="esriGeometryPolyline"){_35.SideType=(this._SideType&&this._SideType==="left")?"Left":((this._SideType&&this._SideType==="right")?"Right":"Full");}else{_35.SideType=(this._SideType&&this._SideType==="outside")?"Outside":"Full";}_35.EndType=(this._EndType&&this._EndType==="flat")?"Flat":"Round";}_35.OutputName=_6.toJson({serviceProperties:{name:this.outputLayerInput.get("value")}});if(this.showChooseExtent){if(this._useExtentCheck.get("checked")){_35.context=_6.toJson({extent:this.map.extent});}}console.log(_35);this.getCreditsEstimate(this.toolName,_35).then(_3.hitch(this,function(_36){this._usageForm.set("content",_36);this._usageDialog.show();}));},_save:function(){},_buildUI:function(){this._loadConnections();_23.initHelpLinks(this.domNode,this.showHelp);if(this.inputLayer){_c.set(this._bufferToolDescription,"innerHTML",_a.substitute(this.i18n.bufferDefine,{layername:this.inputLayer.name}));this.outputLayerInput.set("value",_a.substitute(this.i18n.outputLayerName,{layername:this.inputLayer.name}));var _37="";_4.forEach(this.inputLayer.fields,function(f){if(f.type==="esriFieldTypeDouble"||f.type==="esriFieldTypeInteger"||f.type==="esriFieldTypeSmallInteger"||f.type==="esriFieldTypeSingle"){this._bufferDistAttribute.addOption({value:f.name,label:_21.isDefined(f.alias)&&f.alias!==""?f.alias:f.name});}},this);_c.set(this._bufferOptionsHelpLink,"esriHelpTopic",(this.inputType==="polygon"?"OptionPoly":(this.inputType==="line"?"OptionLine":"OptionPoint")));}this._bufferDist.set("validator",_3.hitch(this,this.validateDistance));if(this.inputType==="line"){_b.set(this.sideTypes,"display","block");_b.set(this.endTypes,"display","block");}else{if(this.inputType==="polygon"){_b.set(this.polygonTypes,"display","block");}}if(this.outputLayerName){this.outputLayerInput.set("value",this.outputLayerName);}if(this.units){this._bufferUnits.set("value",this.units);}_b.set(this._chooseFolderRow,"display",this.showSelectFolder===true?"block":"none");if(this.showSelectFolder){this.getFolderStore().then(_3.hitch(this,function(_38){this.folderStore=_38;this._webMapFolderSelect.set("store",_38);this._webMapFolderSelect.set("value",this.portalUser.username);}));}_b.set(this._chooseExtentDiv,"display",this.showChooseExtent===true?"block":"none");_b.set(this._showCreditsLink,"display",this.showCredits===true?"block":"none");},validateDistance:function(){var _39=this,val,_3a=[];this._handleDistanceChange();val=_3.trim(this._bufferDist.get("value")).split(" ");if(val.length===0){return false;}_4.forEach(val,function(v){v=_10.parse(v);if(isNaN(v)){_3a.push(0);return false;}var _3b=_10.format(v,{locale:"en-us"}),_3c=_3.trim(_3b).match(/\D/g);if(_3c){_4.forEach(_3c,function(m){if(m==="."||m===","){_3a.push(1);}else{if(m==="-"&&_39.inputType==="polygon"){_3a.push(1);}else{_3a.push(0);}}});}});if(_4.indexOf(_3a,0)!==-1){return false;}return true;},_loadConnections:function(){this._connect(this,"onExecute",_3.hitch(this,"_onClose",false));this._connect(this._closeBtn,"onclick",_3.hitch(this,"_onClose",false));_5.connect(this._Distance,"onclick",_3.hitch(this,"_handleRadiusTypeChange","distance"));_5.connect(this._Attribute,"onclick",_3.hitch(this,"_handleRadiusTypeChange","attribute"));_5.connect(this._Overlap,"onclick",_3.hitch(this,"_handleDissolveTypeChange","none"));_5.connect(this._Dissolve,"onclick",_3.hitch(this,"_handleDissolveTypeChange","dissolve"));_5.connect(this._Include,"onclick",_3.hitch(this,"_handlePolygonTypeChange","full"));_5.connect(this._Exclude,"onclick",_3.hitch(this,"_handlePolygonTypeChange","outside"));_5.connect(this._Rings,"onclick",_3.hitch(this,"_handleRingTypeChange","rings"));_5.connect(this._Disks,"onclick",_3.hitch(this,"_handleRingTypeChange","disks"));_5.connect(this._Around,"onclick",_3.hitch(this,"_handleSideTypeChange",this._Around,"full"));_5.connect(this._Left,"onclick",_3.hitch(this,"_handleSideTypeChange",this._Left,"left"));_5.connect(this._Right,"onclick",_3.hitch(this,"_handleSideTypeChange",this._Right,"right"));_5.connect(this._Round,"onclick",_3.hitch(this,"_handleEndTypeChange","round"));_5.connect(this._Flat,"onclick",_3.hitch(this,"_handleEndTypeChange","flat"));},_setAnalysisGpServerAttr:function(url){this.analysisGpServer=url;this.set("toolServiceUrl",this.analysisGpServer+"/"+this.toolName);},_setInputLayerAttr:function(_3d){if(_3d.geometryType==="esriGeometryPolygon"){this.inputLayer=_3d;this.inputType="polygon";}else{if(_3d.geometryType==="esriGeometryPolyline"){this.inputLayer=_3d;this.inputType="line";}else{if(_3d.geometryType==="esriGeometryPoint"){this.inputLayer=_3d;this.inputType="point";}}}},_setLayerAttr:function(_3e){if(_3e.geometryType==="esriGeometryPolygon"){this.inputType="polygon";}else{if(_3e.geometryType==="esriGeometryPolyline"){this.inputType="line";}else{if(_3e.geometryType==="esriGeometryPoint"){this.inputType="point";}}}this.inputLayer=_3e;},_setLayersAttr:function(_3f){this._setLayerAttr(_3f);},_setDisableRunAnalysisAttr:function(_40){this._saveBtn.set("disabled",_40);},validateServiceName:function(_41){var _42=/(:|&|<|>|%|#|\?|\\|\"|\/|\+)/.test(_41);if(_41.length===0||((_a.trim(_41)).length===0)){this.outputLayerInput.set("invalidMessage",this.i18n.requiredValue);return false;}if(_42){this.outputLayerInput.set("invalidMessage",this.i18n.invalidServiceName);return false;}if(_41.length>98){this.outputLayerInput.set("invalidMessage",this.i18n.invalidServiceNameLength);return false;}return true;},_setShowSelectFolderAttr:function(_43){this.showSelectFolder=_43;},_getShowSelectFolderAttr:function(){return this.showSelectFolder;},_setMapAttr:function(map){this.map=map;},_getMapAttr:function(){return this.map;},_setShowHelpAttr:function(_44){this.showHelp=_44;},_getShowHelpAttr:function(){return this.showHelp;},_setShowChooseExtentAttr:function(_45){this.showChooseExtent=_45;},_getShowChooseExtentAttr:function(){return this.showChooseExtent;},_setShowCreditsAttr:function(_46){this.showCredits=_46;},_getShowCreditsAttr:function(){return this.showCredits;},_setUnitsAttr:function(_47){this.units=_47;},_getUnitsAttr:function(){this.units=this._bufferUnits.get("value");return this.units;},_connect:function(_48,evt,_49){this._pbConnects.push(_5.connect(_48,evt,_49));},onSave:function(){},onClose:function(){}});if(_7("extend-esri")){_3.setObject("dijit.analysis.BufferTool",_26,_20);}return _26;});