// All material copyright ESRI, All Rights Reserved, unless otherwise specified.
// See http://@sbaseurl@/jsapi/jsapi/esri/copyright.txt and http://www.arcgis.com/apps/webappbuilder/copyright.txt for details.

//>>built
require({cache:{"widgets/NearMe/utils":function(){define(["dojo/_base/declare","dijit/_WidgetBase","dojo/_base/array","dojo/_base/lang"],function(V,W,t,Q){return V([W],{map:null,postCreate:function(){},getLayerDetailsFromMap:function(X,R,H){var y={},e;this.map&&this.map.webMapResponse&&this.map.webMapResponse.itemInfo&&this.map.webMapResponse.itemInfo.itemData&&this.map.webMapResponse.itemInfo.itemData.operationalLayers&&t.forEach(this.map.webMapResponse.itemInfo.itemData.operationalLayers,Q.hitch(this,
function(g){g.layerObject&&("ArcGISMapServiceLayer"===g.layerType||"ArcGISTiledMapServiceLayer"===g.layerType?(e=H&&H.substring(0,H.lastIndexOf("_")),e&&g.id!==e||(y.isMapServer=!0,y.id=g.id+"_"+R,g.visibility&&0<=g.layerObject.visibleLayers.indexOf(parseInt(R,10))?y.visibility=!0:y.visibility=!1,X.substring(0,X.length-1).replace(/.*?:\/\//g,"")===g.url.replace(/.*?:\/\//g,"")&&(t.forEach(g.resourceInfo.layers,Q.hitch(this,function(l){l.id===parseInt(R,10)&&(y.title=l.name)})),t.forEach(g.layers,
Q.hitch(this,function(l){l.id===parseInt(R,10)&&(l.name&&(y.title=l.name),y.popupInfo=l.popupInfo,l.layerDefinition&&(l.layerDefinition.definitionExpression&&(y.definitionExpression=l.layerDefinition.definitionExpression),l.layerDefinition.drawingInfo&&l.layerDefinition.drawingInfo.renderer&&(y.renderer=l.layerDefinition.drawingInfo.renderer)))}))))):H&&g.id!==H||g.url.replace(/.*?:\/\//g,"")!==(X+R).replace(/.*?:\/\//g,"")||H&&g.id!==H||(y.isMapServer=!1,y.title=g.title,y.visibility=g.visibility,
y.popupInfo=g.popupInfo,y.id=g.id,g.layerDefinition&&(g.layerDefinition.definitionExpression&&(y.definitionExpression=g.layerDefinition.definitionExpression),g.layerDefinition.drawingInfo&&g.layerDefinition.drawingInfo.renderer&&(y.renderer=g.layerDefinition.drawingInfo.renderer))))}));return y}})})},"widgets/NearMe/search":function(){define("dojo/_base/declare dijit/_WidgetBase dojo/Evented dojo/_base/lang dojo/_base/array esri/dijit/Search esri/tasks/locator esri/layers/FeatureLayer jimu/utils dojo/dom-construct jimu/LayerInfos/LayerInfos ./searchSourceUtils dojo/when dojo/Deferred dojo/promise/all dojo/on esri/InfoTemplate dojo/keys".split(" "),
function(V,W,t,Q,X,R,H,y,e,g,l,m,n,h,x,I,K,w){return V([W,t],{config:null,map:null,searchOptions:null,layerInfosObj:null,_urlParams:{},constructor:function(L){Q.mixin(this,L)},postCreate:function(){this._urlParams={}},startup:function(){this.inherited(arguments);l.getInstance(this.map,this.map.itemInfo).then(Q.hitch(this,function(L){this.layerInfosObj=L;this.own(this.layerInfosObj.on("layerInfosFilterChanged",Q.hitch(this,this.onLayerInfosFilterChanged)));m.setMap(this.map);m.setLayerInfosObj(this.layerInfosObj);
m.setAppConfig(this.appConfig);n(m.getConfigInfo(this.config.searchSourceSettings)).then(Q.hitch(this,function(T){this.config.searchSourceSettings||(this.config.searchSourceSettings=T);return x(this._convertConfig(T)).then(function(U){return X.filter(U,function(N){return N})})})).then(Q.hitch(this,function(T){this.domNode&&this._init(T)}))}))},_convertConfig:function(L){return X.map(L.sources,Q.hitch(this,function(T){var U=new h;if(T&&T.url&&"locator"===T.type){var N={locator:new H(T.url||""),outFields:["*"],
singleLineFieldName:T.singleLineFieldName||"",name:e.stripHTML(T.name||""),placeholder:e.stripHTML(T.placeholder||""),countryCode:T.countryCode||"",maxSuggestions:T.maxSuggestions,maxResults:T.maxResults||6,zoomScale:T.zoomScale||5E4,useMapExtent:!!T.searchInCurrentMapExtent};T.enableLocalSearch&&(N.localSearchOptions={minScale:T.localSearchMinScale,distance:T.localSearchDistance});U.resolve(N)}else T&&T.url&&"query"===T.type?(N=new y(T.url||null,{outFields:["*"]}),this.own(I(N,"load",Q.hitch(this,
function(S){var F=S.layer;var a=this._getInfoTemplate(F,T,T.displayField);var D=null;T.searchFields&&0<T.searchFields.length?D=T.searchFields:(D=[],X.forEach(F.fields,function(da){"esriFieldTypeOID"!==da.type&&da.name!==F.objectIdField&&"esriFieldTypeGeometry"!==da.type&&D.push(da.name)}));S={featureLayer:F,outFields:["*"],searchFields:D,displayField:T.displayField||"",exactMatch:!!T.exactMatch,name:e.stripHTML(T.name||""),placeholder:e.stripHTML(T.placeholder||""),maxSuggestions:T.maxSuggestions||
6,maxResults:T.maxResults||6,zoomScale:T.zoomScale||5E4,infoTemplate:a,useMapExtent:!!T.searchInCurrentMapExtent,_featureLayerId:T.layerId};a||delete S.infoTemplate;S._featureLayerId&&(a=this.layerInfosObj.getLayerInfoById(S._featureLayerId),F.setDefinitionExpression(a.getFilter()));U.resolve(S)}))),this.own(I(N,"error",function(){U.resolve(null)}))):U.resolve(null);return U}))},_getInfoTemplate:function(L,T,U){var N;var S=(N=this.layerInfosObj.getLayerInfoById(T.layerId))&&N.getInfoTemplate();var F=
N&&S;if(N&&!F)return null;F||(S=new K,S.setTitle("\x26nbsp;"),S.setContent(Q.hitch(this,"_formatContent",T.name,L,U)));return S},_init:function(L){var T=1===L.length?0:"all";L={map:this.map,addLayersFromMap:!1,autoNavigate:!1,autoComplete:!0,minCharacters:0,searchDelay:100,enableInfoWindow:!0,enableHighlight:this.config.searchSourceSettings.showInfoWindowOnSelect,showInfoWindowOnSelect:this.config.searchSourceSettings.showInfoWindowOnSelect,allPlaceholder:e.stripHTML(this.config.searchSourceSettings.allPlaceholder),
sources:L,activeSourceIndex:T};Q.mixin(L,this.searchOptions);this._urlParams=this._getUrlParams();this.search=new R(L,g.create("div",{"class":"searchControl"}));g.place(this.search.domNode,this.domNode);this.own(this.search.on("load",Q.hitch(this,this._load)));this.own(this.search.on("select-result",Q.hitch(this,this._selectResult)));this.own(this.search.on("clear-search",Q.hitch(this,this._clear)));this.own(this.search.on("search-results",Q.hitch(this,this._results)));this.own(this.search.on("suggest-results",
Q.hitch(this,this._results)));this.own(I(this.search.inputNode,"keyup",Q.hitch(this,function(U){U.keyCode===w.ENTER&&this.emit("init-attribute-search")})));this.own(I(this.search.submitNode,"click",Q.hitch(this,function(){this.emit("init-attribute-search")})));this.search.startup()},_getUrlParams:function(){var L=e.urlToObject(document.location.href);L.query=L.query||{};return L.query},setSearchText:function(L){this.search.set("value",L)},getSearchText:function(){return this.search.get("value")},
getActiveSource:function(){return this.search.activeSource},clearSearchText:function(){this.search&&this.search.clear()},_setSearchString:function(){this._urlParams.find&&(this.search.set("value",this._urlParams.find),setTimeout(Q.hitch(this,function(){this.search.search()}),1E3))},onLayerInfosFilterChanged:function(L){X.some(L,Q.hitch(this,function(T){this.search&&this.search.sources&&0<this.search.sources.length&&X.forEach(this.search.sources,function(U){U._featureLayerId===T.id&&U.featureLayer.setDefinitionExpression(T.getFilter())})}))},
_load:function(L){this.emit("search-loaded",L);this._setSearchString()},_results:function(L){this.emit("search-results",L)},_clear:function(L){this.emit("clear-search",L)},_selectResult:function(L){this.search.blur();this.emit("select-result",L)}})})},"esri/dijit/Search":function(){define("require dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/Evented dojo/Deferred dojo/keys dojo/on dojo/query dojo/uacss dojo/regexp dojo/dom dojo/dom-attr dojo/dom-class dojo/dom-style dojo/dom-construct dojo/date/locale dojo/i18n!../nls/jsapi dojo/text!./Search/templates/Search.html dijit/_WidgetBase dijit/_TemplatedMixin dijit/_FocusMixin dijit/a11yclick dijit/focus ../lang ../InfoTemplate ../kernel ../SpatialReference ../graphic ../promiseList ../symbols/PictureMarkerSymbol ../symbols/SimpleMarkerSymbol ../symbols/SimpleLineSymbol ../symbols/SimpleFillSymbol ../symbols/TextSymbol ../symbols/Font ../geometry/Point ../geometry/Extent ../geometry/normalizeUtils ../geometry/scaleUtils ../tasks/locator ../tasks/query ../Color ../styles/basic".split(" "),
function(V,W,t,Q,X,R,H,y,e,g,l,m,n,h,x,I,K,w,L,T,U,N,S,F,a,D,da,ha,ia,na,P,la,ja,J,z,B,ca,ra,oa,ta,za,b,f,G){function r(d,v){d&&v&&(d._layer=v,d._sourceLayer=v)}W=W([T,U,N,X],{declaredClass:"esri.dijit.Search",templateString:L,reHostedFS:/https?:\/\/services.*\.arcgis\.com/i,constructor:function(d,v){this.css={searchGroup:"searchGroup",searchInput:"searchInput",searchInputGroup:"searchInputGroup",searchBtn:"searchBtn",searchSubmit:"searchSubmit",searchIcon:"searchIcon esri-icon-search",searchButtonText:"searchButtonText",
searchToggle:"searchToggle",searchToggleIcon:"searchIcon esri-icon-down-arrow",searchMenu:"searchMenu",searchMenuHeader:"menuHeader",searchClear:"searchClear",searchClearIcon:"searchIcon esri-icon-close searchClose",searchSpinner:"searchIcon esri-icon-loading-indicator searchSpinner",searchSourceName:"sourceName",suggestionsMenu:"suggestionsMenu",sourcesMenu:"sourcesMenu",activeSource:"active",hasValue:"hasValue",hasButtonMode:"hasButtonMode",hasMultipleSources:"hasMultipleSources",showSuggestions:"showSuggestions",
showSources:"showSources",showNoResults:"showNoResults",searchLoading:"searchLoading",latLonHeader:"searchLatLongHeader",searchMoreResults:"moreResults",searchMoreResultsList:"resultsList",searchMoreResultsHeader:"moreHeader",searchMoreResultsItem:"moreItem",searchMoreResultsListHeader:"popupHeader",searchShowMoreResults:"showMoreResults",searchNoResultsMenu:"noResultsMenu",searchNoResultsBody:"noResultsBody",searchNoResultsHeader:"noResultsHeader",searchNoValueIcon:"noValueIcon esri-icon-notice-triangle",
searchNoValueText:"noValueText",searchNoResultsText:"noResultsText",searchExpandContainer:"searchExpandContainer",searchAnimateContainer:"searchAnimate",searchExpanded:"searchExpanded",searchCollapsed:"searchCollapsed",searchClearFloat:"searchClearFloat"};this._allIndex="all";this._objectIdIdentifier="_objectId";this._deferreds=[];this._sourceNames=[];this.defaultSource={locator:new za("//geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer"),singleLineFieldName:"SingleLine",outFields:["Addr_type",
"Match_addr","StAddr","City"],name:w.widgets.Search.main.esriLocatorName,localSearchOptions:{minScale:3E5,distance:5E4},placeholder:w.widgets.Search.main.placeholder,highlightSymbol:(new P(V.toUrl("./Search/images/search-pointer.png"),36,36)).setOffset(9,18)};this.options={map:null,theme:"arcgisSearch",visible:!0,value:"",allPlaceholder:"",sources:[this.defaultSource],activeSourceIndex:0,suggestionDelay:150,enableSourcesMenu:!0,enableSuggestionsMenu:!0,enableInfoWindow:!0,showInfoWindowOnSelect:!0,
enableSuggestions:!0,enableButtonMode:!1,autoNavigate:!0,autoSelect:!0,addLayersFromMap:!1,zoomScale:1E3,graphicsLayer:null,enableHighlight:!0,highlightGraphic:null,enableLabel:!1,labelSymbol:(new z).setColor(new f([181,56,46,.9])).setFont(new B("14px",B.STYLE_NORMAL,B.VARIANT_NORMAL,B.WEIGHT_BOLD,"Arial")),labelGraphic:null,infoTemplate:new D(w.widgets.Search.main.searchResult,'\x3cdiv class\x3d"${searchTheme}"\x3e\x3cdiv id\x3d"${searchMoreResultsId}" class\x3d"${searchMoreResults}"\x3e\x3cdiv class\x3d"${searchMoreResultsItem}"\x3e${searchResult}\x3c/div\x3e\x3cdiv\x3e${searchMoreResultsHtml}\x3c/div\x3e\x3c/div\x3e\x3c/div\x3e'),
searchResults:null,suggestResults:null,selectedResult:null,magicKey:null,selectedFeatureId:null,expanded:!1,maxLength:128,maxResults:6,maxSuggestions:6,locationToAddressDistance:1500,minCharacters:3,enableSearchingAll:!0};d=t.mixin({},this.options,d);this.set(d);this._updateActiveSource();this._i18n=w;this._defaultSR=new ha(4326);this.domNode=v},startup:function(){this.inherited(arguments);this.sources||(this.sources=[]);this._mapLoaded().then(t.hitch(this,this._init))},postCreate:function(){var d=
this;this.inherited(arguments);this._moreResultsId=this.id+"_more_results";this.own(y(this.submitNode,S,t.hitch(this,this._searchButton)));this.own(y(this.sourcesBtnNode,S,t.hitch(this,this._toggleSourcesMenu)));this.own(y(this.inputNode,S,t.hitch(this,this._inputClick)));this.own(y(this.clearNode,S,t.hitch(this,this._clearButton)));this.own(y(this.formNode,"submit",t.hitch(this,function(v){v.preventDefault();this._cancelSuggest();this.search()})));this.own(y(this.inputNode,"keyup",t.hitch(this,function(v){this._inputKey(v)})));
this.own(y(this.sourcesBtnNode,"keyup",t.hitch(this,function(v){this._sourceBtnKey(v)})));this.own(y(this.suggestionsNode,"li:click, li:keyup",function(v){d._suggestionsEvent(v,this)}));this.own(y(this.sourcesNode,"li:click, li:keyup",function(v){d._sourcesEvent(v,this)}));this.own(y(this.inputNode,"input, paste",t.hitch(this,function(){this._suggestDelay()})));this.map&&this.map.infoWindow&&this.map.infoWindow.domNode&&this.enableInfoWindow&&(this.own(y(this.map.infoWindow.domNode,"#"+this._moreResultsId+
"_show:click",t.hitch(this,function(v){this._showMoreResultsClick(v)}))),this.own(y(this.map.infoWindow.domNode,"#"+this._moreResultsId+"_list li a:click",t.hitch(this,function(v){this._moreResultsClick(v)}))),this.own(y(this.map.infoWindow.domNode,"#"+this._moreResultsId+" [data-switch-coordinates]:click",t.hitch(this,function(v){this._switchCoordinatesClick(v)}))));this.value&&this._checkStatus();this._hideMenus();this._updateVisible();this._insertSources(this.sources);this._setPlaceholder(this.activeSourceIndex);
this._updateButtonMode(this.enableButtonMode);this.toggle(this.expanded)},destroy:function(){this.clear();I.empty(this.domNode);this.inherited(arguments)},clear:function(){this.clearGraphics();n.get(this.inputNode,"value")&&n.set(this.inputNode,"value","");this._changeAttrValue("value","");this.set("searchResults",null);this.set("suggestResults",null);this.set("selectedResult",null);this.set("magicKey",null);this.set("selectedFeatureId",null);h.remove(this.containerNode,this.css.hasValue);n.set(this.clearNode,
"title","");this._hideMenus();this._closePopup();this._hideLoading();this.emit("clear-search")},show:function(){x.set(this.domNode,"display","block")},hide:function(){x.set(this.domNode,"display","none")},expand:function(){this.enableButtonMode&&(h.add(this.containerNode,this.css.searchExpanded),h.remove(this.containerNode,this.css.searchCollapsed),this._hideMenus(),this.set("expanded",!0))},collapse:function(){this.enableButtonMode&&(h.remove(this.containerNode,this.css.searchExpanded),h.add(this.containerNode,
this.css.searchCollapsed),this._hideMenus(),this.set("expanded",!1))},toggle:function(d){this.enableButtonMode&&("undefined"===typeof d&&(d=!this.expanded),d?this.expand():this.collapse())},search:function(d){var v=new R;this._mapLoaded().then(t.hitch(this,function(){this._searchDeferred(d).then(t.hitch(this,function(O){var E=O.results;this.set("searchResults",E);0===O.numResults&&(this._noResults(O.value),this._showNoResultsMenu());this._hideLoading();this.emit("search-results",O);this._selectFirstResult(E,
O.activeSourceIndex);v.resolve(E)}),t.hitch(this,function(O){v.reject(O)}))}));return v.promise},suggest:function(d){var v=new R;this._mapLoaded().then(t.hitch(this,function(){this._suggestDeferred(d).then(t.hitch(this,function(O){if(O){var E=O.results;this.set("suggestResults",E);this._insertSuggestions(E,O.value);this.emit("suggest-results",O);v.resolve(E)}}),t.hitch(this,function(O){v.reject(O)}))}));return v.promise},select:function(d){var v=this._getDefaultSymbol(d),O=this.labelSymbol,E=this.sources,
aa=this.activeSourceIndex,ma=this.enableHighlight,va=this.enableLabel,Aa=this.autoNavigate,xa=this.showInfoWindowOnSelect,q=this.enableInfoWindow,C=this.infoTemplate,Y=d.feature?new ia(d.feature.toJson()):null,ka=Y?d.feature._sourceLayer:null;r(Y,ka);if(aa===this._allIndex){var qa=this._getSourceIndexOfResult(d);if(null!==qa){var ua=E[qa];aa=qa}}else ua=E[aa];ua&&(ua.hasOwnProperty("highlightSymbol")&&(v=ua.highlightSymbol),ua.hasOwnProperty("labelSymbol")&&(O=ua.labelSymbol),ua.hasOwnProperty("enableHighlight")&&
(ma=ua.enableHighlight),ua.hasOwnProperty("enableLabel")&&(va=ua.enableLabel),ua.hasOwnProperty("autoNavigate")&&(Aa=ua.autoNavigate),ua.hasOwnProperty("showInfoWindowOnSelect")&&(xa=ua.showInfoWindowOnSelect),ua.hasOwnProperty("enableInfoWindow")&&(q=ua.enableInfoWindow),ua.hasOwnProperty("infoTemplate")?C=ua.infoTemplate:ua.featureLayer&&ua.featureLayer.infoTemplate&&(C=ua.featureLayer.infoTemplate));this._hideMenus();this._hideLoading();if(Y){E=this.highlightGraphic;var Ba=this.graphicsLayer;qa=
this.labelGraphic;var Ka=t.mixin({},Y.attributes,{searchTheme:this.theme,searchResult:this._searchResultHTML(d),searchMoreResults:this.css.searchMoreResults,searchMoreResultsItem:this.css.searchMoreResultsItem,searchMoreResultsId:this._moreResultsId,searchMoreResultsHtml:this._moreResultsHTML(d)}),Qa=null;q&&(Qa=C);qa?(qa.setGeometry(Y.geometry),qa.setAttributes(Ka),qa.setSymbol(O),O&&"textsymbol"===O.type&&qa.symbol.setText(d.name)):(qa=new ia(Y.geometry,O,Ka),r(qa,ka),O&&"textsymbol"===O.type&&
qa.symbol.setText(d.name),va&&(Ba?Ba.add(qa):this.map&&this.map.graphics&&this.map.graphics.add(qa)));E?(E.setGeometry(Y.geometry),E.setAttributes(Ka),E.setInfoTemplate(Qa),E.setSymbol(v)):(E=new ia(Y.geometry,v,Ka,Qa),r(E,ka),ma&&(Ba?Ba.add(E):this.map&&this.map.graphics&&this.map.graphics.add(E)));E&&E.symbol&&"textsymbol"===E.symbol.type&&E.symbol.setText(d.name);this.map&&this.map.infoWindow&&q&&xa&&(this.map.infoWindow.setFeatures([E]),v=this._getPointFromGeometry(E.geometry),this.map.infoWindow.show(v));
this.map&&Aa&&d&&d.hasOwnProperty("extent")&&"function"===typeof this.map.setExtent&&this.map.setExtent(d.extent,!0);this.set("highlightGraphic",E);this.set("labelGraphic",qa)}this.set("selectedResult",d);this.emit("select-result",{result:d,source:ua,sourceIndex:aa})},focus:function(){F.focus(this.inputNode)},blur:function(){this.inputNode.blur();F.curNode&&F.curNode.blur()},clearGraphics:function(){var d=this.highlightGraphic,v=this.graphicsLayer,O=this.labelGraphic;d&&(v?v.remove(d):this.map&&this.map.graphics&&
this.map.graphics.remove(d));O&&(v?v.remove(O):this.map&&this.map.graphics&&this.map.graphics.remove(O));this.set("labelGraphic",null);this.set("highlightGraphic",null)},_mapLoaded:function(){var d=new R;if(this.map)if(this.map.loaded)d.resolve();else y.once(this.map,"load",t.hitch(this,function(){d.resolve()}));else d.resolve();return d.promise},_init:function(){this._getMapLayers().then(t.hitch(this,function(){this.set("loaded",!0);this.emit("load")}))},_clearButton:function(){this.clear();F.focus(this.inputNode)},
_error:function(d){return Error(this.declaredClass+" "+d)},_searchDeferred:function(d){var v=new R,O=this.value,E=this.activeSourceIndex;d&&d.hasOwnProperty("index")&&(E=d.index);this._showLoading();this._hideMenus();this._closePopup();this.clearGraphics();var aa={magicKey:this.magicKey,text:O};d?"string"===typeof d?(aa.text=d,d=this._searchQueries(aa)):d="object"===typeof d&&d.hasOwnProperty("magicKey")?this._searchQueries(d):"object"===typeof d&&d.hasOwnProperty("geometry")?this._searchQueries({geometry:d}):
"object"===typeof d&&d.hasOwnProperty(this._objectIdIdentifier)?this._searchQueries(d):"object"===typeof d&&"point"===d.type?this._searchQueries({point:d}):d instanceof Array&&2===d.length?this._searchQueries({latlon:d}):this._searchQueries(aa):d=this._searchQueries(aa);d.always(t.hitch(this,function(ma){ma=this._formatResults(ma,E,O);v.resolve(ma)}));return v.promise},_suggestDeferred:function(d){var v=new R;this._deferreds.push(v);d||(d=this.value);var O=this.activeSourceIndex;this._suggestQueries({text:d}).always(t.hitch(this,
function(E){var aa;if(E)for(var ma=0;ma<E.length;ma++)E[ma]&&(aa=!0);aa?(E=this._formatResults(E,O,d),v.resolve(E)):v.resolve()}));return v.promise},_getDefaultSymbol:function(d){var v;this.map&&(v=this.map.getBasemap());v||(v="topo");if(d&&d.feature&&d.feature.geometry)var O=d.feature.geometry.type;"polyline"===O?O="line":"circle"===O||"extent"===O?O="polygon":"multipoint"===O&&(O="point");if(O){if(d=G.getSchemes({theme:"default",basemap:v,geometryType:O}))var E=d.primaryScheme;if(E){E.color&&E.hasOwnProperty("opacity")&&
(E.color.a=E.opacity);var aa=E;d=E.color;E=E.size;switch(O){case "point":var ma=new la;ma.setColor(d);ma.setSize(null!==E?E:aa.size);O=new ja;O.setColor(aa.outline.color);O.setWidth(aa.outline.width);ma.setOutline(O);break;case "line":ma=new ja;ma.setColor(d);ma.setWidth(null!==E?E:aa.width);break;case "polygon":ma=new J,ma.setColor(d),O=new ja,O.setColor(aa.outline.color),O.setWidth(aa.outline.width),ma.setOutline(O)}aa=ma}}return aa},_selectFirstResult:function(d,v){if(this.autoSelect&&d){var O;
v===this._allIndex?O=this._getFirstResult(d):d[v]&&d[v][0]&&(O=d[v][0]);O&&this.select(O)}},_getSourceIndexOfResult:function(d){var v=this.searchResults;if(v)for(var O in v)if(v[O]&&v[O].length)for(var E=0;E<v[O].length;E++)if(v[O][E]===d)return parseInt(O,10);return null},_getFirstResult:function(d){if(d)for(var v in d)if(d[v]&&d[v][0])return d[v][0];return!1},_onFocus:function(){this.map&&"function"===typeof this.map.disableKeyboardNavigation&&this.map.disableKeyboardNavigation();this.emit("focus");
this.inherited(arguments)},_onBlur:function(){this._hideMenus();this.map&&"function"===typeof this.map.enableKeyboardNavigation&&this.map.enableKeyboardNavigation();this.enableButtonMode&&this.loaded&&this.collapse();this.emit("blur");this.inherited(arguments)},_getMapLayers:function(){var d=new R;if(this.addLayersFromMap&&this.map){var v=[],O=this.map.graphicsLayerIds;if(O&&O.length){for(var E=0;E<O.length;E++){var aa=this.map.getLayer(O[E]);aa&&v.push(this._featureLayerLoaded(aa))}na(v).always(t.hitch(this,
function(ma){for(var va,Aa=this.sources,xa=0;xa<ma.length;xa++)ma[xa]&&ma[xa].loaded&&"Feature Layer"===ma[xa].type&&(Aa.push({featureLayer:ma[xa],enableSuggestions:!0}),va=!0);va&&this.set("sources",Aa);d.resolve()}))}else d.resolve()}else d.resolve();return d.promise},_switchCoordinatesClick:function(d){d.preventDefault();if(d=n.get(d.target,"data-switch-coordinates"))this._cancelSuggest(),this.set("value",d),this.search()},_moreResultsClick:function(d){d.preventDefault();var v=d.target;d=parseInt(n.get(v,
"data-source-index"),10);v=parseInt(n.get(v,"data-index"),10);var O=this.searchResults;O&&O[d]&&(d=O[d][v])&&this.select(d)},_showMoreResultsClick:function(d){d.preventDefault();if(d=m.byId(this._moreResultsId)){h.toggle(d,this.css.searchShowMoreResults);var v=m.byId(this._moreResultsId+"_show");v&&(h.contains(d,this.css.searchShowMoreResults)?n.set(v,"textContent",w.widgets.Search.main.hideMoreResults):n.set(v,"textContent",w.widgets.Search.main.showMoreResults))}},_featureLayerLoaded:function(d){var v=
new R;if(d.loaded)v.resolve(d);else if(d.loadError)v.reject(this._error("Layer failed to load."));else{var O=y.once(d,"load",t.hitch(this,function(){E.remove();v.resolve(d)}));var E=y.once(d,"error",t.hitch(this,function(){O.remove();v.reject(this._error("Layer could not be loaded."))}))}return v.promise},_getObjectSize:function(d){var v=0,O;for(O in d)d.hasOwnProperty(O)&&v++;return v},_sourcesEvent:function(d,v){var O=n.get(v,"data-index"),E=e("li",this.sourcesNode);v=Q.indexOf(E,v);O!==this._allIndex&&
(O=parseInt(O,10));"click"===d.type||d.keyCode===H.ENTER?(this.set("activeSourceIndex",O),F.focus(this.inputNode),this._hideSourcesMenu()):d.keyCode===H.UP_ARROW?(d.stopPropagation(),d.preventDefault(),d=v-1,0>d?F.focus(this.sourcesBtnNode):F.focus(E[d])):d.keyCode===H.DOWN_ARROW?(d.stopPropagation(),d.preventDefault(),d=v+1,d>=E.length?F.focus(this.sourcesBtnNode):F.focus(E[d])):d.keyCode===H.ESCAPE&&(this._hideSourcesMenu(),F.focus(this.inputNode))},_suggestionsEvent:function(d,v){var O=n.get(v,
"data-source-index"),E=parseInt(n.get(v,"data-index"),10),aa=e("li",this.suggestionsNode),ma=this.sources;v=Q.indexOf(aa,v);O!==this._allIndex&&(O=parseInt(O,10));var va;this._clearQueryTimeout();"click"===d.type||d.keyCode===H.ENTER?((aa=this.suggestResults)&&aa[O]&&aa[O][E]&&(va=aa[O][E]),va&&(va.index=O,ma[O].featureLayer?(O=ma[O].featureLayer.objectIdField,va[this._objectIdIdentifier]=va.feature.attributes[O],this.set("value",this._getSuggestionName(va)),this.set("selectedFeatureId",va.feature.attributes[O])):
va.magicKey&&va.text&&(this.set("value",va.text),this.set("magicKey",va.magicKey)),this.search(va),F.focus(this.inputNode))):d.keyCode===H.BACKSPACE||d.keyCode===H.DELETE?F.focus(this.inputNode):d.keyCode===H.UP_ARROW?(d.stopPropagation(),d.preventDefault(),va=v-1,0>va?F.focus(this.inputNode):F.focus(aa[va])):d.keyCode===H.DOWN_ARROW?(d.stopPropagation(),d.preventDefault(),va=v+1,va>=aa.length?F.focus(this.inputNode):F.focus(aa[va])):d.keyCode===H.ESCAPE&&(this._hideMenus(),F.focus(this.inputNode))},
_getResultName:function(d){var v;d.hasOwnProperty("name")&&null!==d.name&&(v=d.name.toString());v||(v=w.widgets.Search.main.untitledResult);return v},_getSuggestionName:function(d){var v;d.hasOwnProperty("name")&&null!==d.name&&(v=d.name.toString());d=d.text||v;d||(d=w.widgets.Search.main.untitledResult);return d},_searchResultHTML:function(d){var v="";if(d.feature&&d.feature.attributes&&d.feature.attributes.Addr_type&&"LatLong"===d.feature.attributes.Addr_type){var O=d.name.split(" ");if(2===O.length){var E=
O[0];var aa=O[1]}aa&&E?(d=parseFloat(E),aa=parseFloat(aa),O=aa+", "+d,v+='\x3cdiv class\x3d"'+this.css.searchMoreResultsItem+'"\x3e',v+='\x3cdiv class\x3d"'+this.css.latLonHeader+'"\x3e'+w.widgets.Search.main.lonlat+"\x3c/div\x3e",v=v+(d+", "+aa)+'\x3c/div\x3e\x3cdiv class\x3d"'+(this.css.searchMoreResultsItem+'"\x3e'),d===aa||90<d||-90>d||180<aa||-180>aa||(v+='\x3cdiv class\x3d"'+this.css.latLonHeader+'"\x3e'+w.widgets.Search.main.reverseLonLatHeader+"\x3c/div\x3e",v+='\x3ca data-switch-coordinates\x3d"'+
O+'" tabindex\x3d"0" href\x3d"#"\x3e'+O+"\x3c/a\x3e\x3c/div\x3e")):v=d.name}else v=d.name;return v},_moreResultsHTML:function(d){var v="",O="",E=this.searchResults,aa=this.sources,ma=0;if(E){O+='\x3cdiv class\x3d"'+this.css.searchMoreResultsItem+'"\x3e';O+='\x3ca href\x3d"#" id\x3d"'+this._moreResultsId+'_show"\x3e'+w.widgets.Search.main.showMoreResults+"\x3c/a\x3e";O=O+'\x3c/div\x3e\x3cdiv class\x3d"'+(this.css.searchMoreResultsList+'"\x3e');O+='\x3cdiv id\x3d"'+this._moreResultsId+'_list"\x3e';
for(var va in E)if(E[va]){var Aa=E[va].length;if(Aa){var xa=1===Aa&&E[va][0]===d;if(1<this._getObjectSize(E)&&!xa){var q=this._getSourceName(va);O+='\x3cdiv class\x3d"'+this.css.searchMoreResultsListHeader+'"\x3e'+q+"\x3c/div\x3e"}if(Aa&&!xa){O+="\x3cul\x3e";q=aa[va].maxResults||this.maxResults;for(xa=0;xa<Aa&&xa<q;++xa)if(E[va][xa]!==d){var C=this._getResultName(E[va][xa]);O+='\x3cli\x3e\x3ca tabindex\x3d"0" data-index\x3d"'+xa+'" data-source-index\x3d"'+va+'" href\x3d"#"\x3e'+C+"\x3c/a\x3e\x3c/li\x3e";
ma++}O+="\x3c/ul\x3e"}}}O+="\x3c/div\x3e\x3c/div\x3e"}ma&&(v+=O);return v},_validField:function(d,v){return d.getField(v)},_validFields:function(d,v){if(d&&v&&v.length){for(var O=0;O<v.length;O++)if(!this._validField(d,v[O]))return!1;return!0}return!1},_getCodedName:function(d,v){if(d&&d.length)for(var O=0,E=d.length;O<E;O++){var aa=d[O];if(aa.code===v)return aa.name}},_getCodedValue:function(d,v,O){if(d&&d.length)for(var E=0,aa=d.length;E<aa;E++){var ma=d[E],va=ma.name,Aa=v;O||(va=va.toLowerCase(),
Aa=Aa.toLowerCase());if(va===Aa)return ma.code}return!1},_whereClause:function(d,v,O,E){var aa=null;if(d){var ma="";this.reHostedFS.test(v.url)&&this._containsNonLatinCharacter(d)&&(ma="N");if(O&&O.length)for(var va=0,Aa=O.length;va<Aa;va++){var xa="",q=d.replace(/'/g,"''");xa=O[va];var C=v.getField(xa),Y=v.getDomain(xa);Y&&"codedValue"===Y.type&&(q=this._getCodedValue(Y.codedValues,q,E));!1!==q&&(C=C.type,"esriFieldTypeString"===C||"esriFieldTypeDate"===C?xa=E?xa+" \x3d "+ma+"'"+q+"'":"UPPER("+xa+
") LIKE "+ma+"'%"+q.toUpperCase()+"%'":"esriFieldTypeOID"===C||"esriFieldTypeSmallInteger"===C||"esriFieldTypeInteger"===C||"esriFieldTypeSingle"===C||"esriFieldTypeDouble"===C?(q=parseFloat(q),xa=isNaN(q)?!1:xa+" \x3d "+q):xa=xa+" \x3d "+q,xa&&(aa=aa?aa+" or ":"",aa+=xa))}}return aa},_suggest:function(d){d||(d={index:this.activeSourceIndex,text:this.value});var v=new R,O=d.index,E=this.sources[O],aa=this.enableSuggestions;E.hasOwnProperty("enableSuggestions")&&(aa=E.enableSuggestions);var ma=0;if(d.hasOwnProperty("text")&&
d.text){var va=t.trim(d.text);ma=d.text.length}d=E.minCharacters||this.minCharacters;if(aa&&va&&ma>=d&&this._supportsPagination(E)){var Aa="";E.prefix&&(Aa+=E.prefix);Aa+=va;E.suffix&&(Aa+=E.suffix);var xa=this._defaultSR;this.map&&(xa=this.map.spatialReference);aa={};E.locator?(E.categories&&(aa.categories=E.categories),E.locator.outSpatialReference=xa,this.map&&E.localSearchOptions&&E.localSearchOptions.hasOwnProperty("distance")&&E.localSearchOptions.hasOwnProperty("minScale")&&(ma=this._getScale(),
!E.localSearchOptions.minScale||ma&&ma<=parseFloat(E.localSearchOptions.minScale))&&(aa.location=this.map.extent.getCenter(),aa.distance=E.localSearchOptions.distance),aa.text=Aa,E.useMapExtent&&this.map&&this.map.extent&&(aa.searchExtent=this.map.extent),E.searchExtent&&(aa.searchExtent=E.searchExtent),aa.maxSuggestions=E.maxSuggestions||this.maxSuggestions,E.sourceCountry&&(aa.countryCode=E.sourceCountry),E.countryCode&&(aa.countryCode=E.countryCode),E.locator.suggestLocations(aa).then(t.hitch(this,
function(q){v.resolve(q)}),t.hitch(this,function(q){q||(q=this._error("Locator suggestLocations could not be performed."));v.reject(q)}))):E.featureLayer?this._featureLayerLoaded(E.featureLayer).then(t.hitch(this,function(){var q=this._getDisplayField(E),C=E.searchFields||[q],Y=[];E.suggestionTemplate?E.suggestionTemplate.replace(/(?:\$\{([^}]+)\})/g,function(Ba,Ka){Y.push(Ka)}):Y=[q];-1===Q.indexOf(Y,E.featureLayer.objectIdField)&&Y.push(E.featureLayer.objectIdField);q=this._validField(E.featureLayer,
q);var ka=this._validFields(E.featureLayer,Y),qa=this._validFields(E.featureLayer,C);if(q&&ka&&qa){q=new b;E.hasOwnProperty("suggestQueryParams")&&t.mixin(q,E.suggestQueryParams);q.outSpatialReference=xa;q.returnGeometry=!1;q.num=E.maxSuggestions||this.maxSuggestions;q.outFields=Y;E.useMapExtent&&this.map&&this.map.extent&&(q.geometry=this.map.extent);E.searchExtent&&(q.geometry=E.searchExtent);if(C=this._whereClause(Aa,E.featureLayer,C,!1)){q.where=C;var ua=!0}ua?E.featureLayer.queryFeatures(q,t.hitch(this,
function(Ba){var Ka;(Ba=Ba.features)&&(Ka=this._hydrateResults(Ba,O,!0));v.resolve(Ka)}),t.hitch(this,function(Ba){Ba||(Ba=this._error("FeatureLayer queryFeatures errored with suggestions"));v.reject(Ba)})):v.resolve()}else v.reject(this._error("Invalid FeatureLayer field"))})):v.reject(this._error("Invalid source"))}else v.resolve();return v.promise},_supportsPagination:function(d){var v;d.locator?v=!0:d.featureLayer&&d.featureLayer.advancedQueryCapabilities&&d.featureLayer.advancedQueryCapabilities.supportsPagination&&
(v=!0);return v},_suggestQueries:function(d){var v=this.sources,O=this.activeSourceIndex,E=[];if(O===this._allIndex)for(O=0;O<v.length;O++){var aa=d;aa.index=O;aa=this._suggest(aa);E.push(aa)}else d.index=O,aa=this._suggest(d),E.push(aa);return na(E)},_getPointFromGeometry:function(d){switch(d.type){case "extent":var v=d.getCenter();break;case "multipoint":v=d.getPoint(0);break;case "point":v=d;break;case "polygon":v=d.getCentroid();break;case "polyline":v=d.getPoint(0,0)}return v},_searchQueries:function(d){d.hasOwnProperty("index")||
(d.index=this.activeSourceIndex);var v=[];if(d.index===this._allIndex)for(var O=this.sources,E=0;E<O.length;E++){var aa=d;aa.index=E;aa=this._search(aa);v.push(aa)}else d=this._search(d),v.push(d);return na(v)},_searchButton:function(){this.enableButtonMode&&!this.expanded?(this.expand(),F.focus(this.inputNode)):(this._cancelSuggest(),this.search())},_search:function(d){d||(d={text:this.value,magicKey:null,geometry:null,point:null,index:this.activeSourceIndex,latlon:null});this.selectedFeatureId&&
(d.text=null,d[this._objectIdIdentifier]=this.selectedFeatureId);var v,O=new R,E=d.index,aa=this.sources[E],ma;d.hasOwnProperty("text")&&d.text&&(ma=t.trim(d.text));if(aa){var va="";aa.prefix&&!d.magicKey&&(va+=aa.prefix);va+=ma;aa.suffix&&!d.magicKey&&(va+=aa.suffix);var Aa=this._defaultSR;this.map&&(Aa=this.map.spatialReference);if(aa.locator)if(d.hasOwnProperty("text")&&ma){var xa={};aa.categories&&(xa.categories=aa.categories);aa.locationType&&(xa.locationType=aa.locationType);Aa&&(aa.locator.outSpatialReference=
Aa);if(this.map&&aa.localSearchOptions&&aa.localSearchOptions.hasOwnProperty("distance")&&aa.localSearchOptions.hasOwnProperty("minScale")){var q=this._getScale();if(!aa.localSearchOptions.minScale||q&&q<=parseFloat(aa.localSearchOptions.minScale))xa.location=this.map.extent.getCenter(),xa.distance=aa.localSearchOptions.distance}xa.address={};xa.maxLocations=aa.maxResults||this.maxResults;aa.useMapExtent&&this.map&&this.map.extent&&(xa.searchExtent=this.map.extent);aa.searchExtent&&(xa.searchExtent=
aa.searchExtent);aa.sourceCountry&&(xa.countryCode=aa.sourceCountry);aa.countryCode&&(xa.countryCode=aa.countryCode);d.magicKey&&(xa.magicKey=d.magicKey);aa.singleLineFieldName?xa.address[aa.singleLineFieldName]=va:xa.address["Single Line Input"]=va;aa.outFields&&(xa.outFields=aa.outFields);aa.locator.addressToLocations(xa).then(t.hitch(this,function(C){C=this._hydrateResults(C,E,!1);O.resolve(C)}),t.hitch(this,function(C){C||(C=this._error("Locator addressToLocations could not be performed"));O.reject(C)}))}else d.geometry?
(v=this._getPointFromGeometry(d.geometry.geometry))?this._reverseGeocodePoint(E,v).then(function(C){O.resolve(C)},function(C){O.reject(C)}):O.reject(this._error("Invalid point to reverse geocode")):d.point?this._reverseGeocodePoint(E,d.point).then(function(C){O.resolve(C)},function(C){O.reject(C)}):d.latlon?(xa=new ca(d.latlon,this._defaultSR),this._reverseGeocodePoint(E,xa).then(function(C){O.resolve(C)},function(C){O.reject(C)})):d.hasOwnProperty("text")&&!ma?O.resolve([]):O.reject(this._error("Invalid query type for Locator"));
else aa.featureLayer?this._featureLayerLoaded(aa.featureLayer).then(t.hitch(this,function(){var C=this._getDisplayField(aa),Y=aa.searchFields||[C];C=this._validField(aa.featureLayer,C);var ka=this._validFields(aa.featureLayer,Y);if(C&&ka){C=new b;aa.hasOwnProperty("searchQueryParams")&&t.mixin(C,aa.searchQueryParams);Aa&&(C.outSpatialReference=Aa,ka=this.map&&this.map.getMaxResolution()||1/ta.getUnitValueForSR(Aa))&&(C.maxAllowableOffset=ka);C.returnGeometry=!0;aa.outFields&&(C.outFields=aa.outFields);
if(!d.hasOwnProperty(this._objectIdIdentifier)){this._supportsPagination(aa)&&(C.num=aa.maxResults||this.maxResults);aa.useMapExtent&&this.map&&this.map.extent&&(C.geometry=this.map.extent);aa.searchExtent&&(C.geometry=aa.searchExtent);var qa=aa.exactMatch}d.hasOwnProperty("text")&&ma?(Y=this._whereClause(va,aa.featureLayer,Y,qa))?(C.where=Y,Y=!0):Y=!1:d.hasOwnProperty(this._objectIdIdentifier)?(C.objectIds=[d[this._objectIdIdentifier]],Y=!0):d.geometry?(C.geometry=d.geometry,Y=!0):d.point?(C.geometry=
d.point,Y=!0):d.latlon?(v=new ca(d.latlon,this._defaultSR),C.geometry=v,Y=!0):(d.hasOwnProperty("text")&&!ma?O.resolve([]):O.reject(this._error("Invalid query type for FeatureLayer")),Y=!1);Y?aa.featureLayer.queryFeatures(C,t.hitch(this,function(ua){ua=ua.features;var Ba;ua&&(Ba=this._hydrateResults(ua,E,!1));O.resolve(Ba)}),t.hitch(this,function(ua){ua||(ua=this._error("FeatureLayer queryFeatures could not be performed"));O.reject(ua)})):O.resolve()}else O.reject(this._error("Invalid FeatureLayer field"))})):
O.reject(this._error("Invalid source"))}else O.reject(this._error("Source is undefined"));return O.promise},_clearQueryTimeout:function(){this._queryTimer&&clearTimeout(this._queryTimer)},_formatResults:function(d,v,O){O={activeSourceIndex:v,value:O,numResults:0,numErrors:0,errors:null,results:null};var E={},aa={};if(d)if(v===this._allIndex)for(v=0;v<d.length;v++)d[v]&&(d[v]instanceof Error?(E[v]=d[v],O.numErrors++):(aa[v]=d[v],O.numResults+=d[v].length));else d[0]&&(d[0]instanceof Error?(E[v]=d[0],
O.numErrors++):(aa[v]=d[0],O.numResults+=d[0].length));O.numErrors&&(O.errors=E);O.numResults&&(O.results=aa);return O},_reverseGeocodePoint:function(d,v){var O=new R,E=this.sources[d];if(v&&E){var aa=E.locationToAddressDistance||this.locationToAddressDistance;E.locator.outSpatialReference=this._defaultSR;this.map&&(E.locator.outSpatialReference=this.map.spatialReference);E.locator.locationToAddress(v,aa,t.hitch(this,function(ma){ma=this._hydrateResults([ma],d,!1);O.resolve(ma)}),t.hitch(this,function(ma){ma||
(ma=this._error("Locator locationToAddress could not be performed"));O.reject(ma)}))}else O.reject(this._error("No point or source defined for reverse geocoding"));return O.promise},_cancelDeferreds:function(){if(this._deferreds&&this._deferreds.length)for(var d=0;d<this._deferreds.length;d++)this._deferreds[d].cancel(this.declaredClass+" cancelling request");this._deferreds=[]},_sourceBtnKey:function(d){if(d){var v=e("li",this.sourcesNode);d.keyCode===H.UP_ARROW?(d.stopPropagation(),d.preventDefault(),
this._showSourcesMenu(),(d=v.length)&&F.focus(v[d-1])):d.keyCode===H.DOWN_ARROW&&(d.stopPropagation(),d.preventDefault(),this._showSourcesMenu(),v[0]&&F.focus(v[0]))}},_inputKey:function(d){if(d){var v=e("li",this.suggestionsNode),O=this.suggestResults;if(d.keyCode===H.TAB||d.keyCode===H.ESCAPE)this._cancelSuggest(),this._hideMenus();else if(d.keyCode===H.UP_ARROW)d.stopPropagation(),d.preventDefault(),this._cancelSuggest(),O&&this._showSuggestionsMenu(),(d=v.length)&&F.focus(v[d-1]);else if(d.keyCode===
H.DOWN_ARROW)d.stopPropagation(),d.preventDefault(),this._cancelSuggest(),O&&this._showSuggestionsMenu(),v[0]&&F.focus(v[0]);else{if(d.ctrlKey||d.metaKey||d.keyCode===H.copyKey||d.keyCode===H.LEFT_ARROW||d.keyCode===H.RIGHT_ARROW||d.keyCode===H.ENTER)return d;this._suggestDelay()}}},_cancelSuggest:function(){this._cancelDeferreds();this._clearQueryTimeout()},_suggestDelay:function(){this._cancelSuggest();this._changeValue();this._queryTimer=setTimeout(t.hitch(this,function(){this.suggest()}),this.suggestionDelay)},
_changeValue:function(){this.set("magicKey",null);this.set("selectedFeatureId",null);this._changeAttrValue("value",this.inputNode.value);this._checkStatus()},_inputClick:function(){this._hideSourcesMenu();this._hideNoResultsMenu()},_getSourceName:function(d){return this._sourceNames[d]},_loadSources:function(d){d=Q.filter(d,function(v){return!!v.featureLayer});d=Q.map(d,function(v){return this._featureLayerLoaded(v.featureLayer)},this);return na(d)},_createSourceNameMap:function(d){return this._loadSources(d).then(t.hitch(this,
function(){var v=Q.map(d,function(O){return O.name||O.featureLayer&&O.featureLayer.name||w.widgets.Search.main.untitledSource});this._preventDuplicateSourceNames(d,v);return v}))},_getDuplicateSourceNameIndexes:function(d){var v={},O=[];Q.forEach(d,function(E,aa){v.hasOwnProperty(E)?(-1===O.indexOf(v[E])&&O.push(v[E]),O.push(aa)):d.lastIndexOf(E)!==aa&&(v[E]=aa)});return O},_preventDuplicateSourceNames:function(d,v){if(v&&1<v.length){var O=this._getDuplicateSourceNameIndexes(v);Q.forEach(O,function(E){v[E]+=
this._getFieldsString(d[E])},this)}},_getFieldsString:function(d){var v="",O=d.featureLayer;if(O){d=d.searchFields||[this._getDisplayField(d)];for(var E=0;E<d.length;E++){v=0===E?v+": ":v+", ";var aa=d[E],ma=O.getFieldLabel(aa);v+=ma||aa}}return v},_splitResult:function(d,v){v=l.escapeString(v);return d.replace(new RegExp("(^|)("+v+")(|$)","ig"),"$1|$2|$3").split("|")},_insertSuggestions:function(d,v){if(this.enableSuggestionsMenu&&this.suggestionsNode){this._hideSourcesMenu();this._hideNoResultsMenu();
var O=this.sources;if(d){var E=I.create("div");for(var aa in d)if(d[aa]&&d[aa].length){var ma=this._getSourceName(aa);1<O.length&&this.activeSourceIndex===this._allIndex&&I.create("div",{className:this.css.searchMenuHeader,textContent:ma},E);ma=I.create("ul",{role:"menu"},E);for(var va=O[aa].maxSuggestions||this.maxSuggestions,Aa=0;Aa<d[aa].length&&Aa<va;++Aa){var xa=I.create("li",{"data-index":Aa,"data-source-index":aa,role:"menuitem",tabindex:0},ma),q=this._getSuggestionName(d[aa][Aa]);q=this._splitResult(q,
v);for(var C=q.length,Y=0;Y<C;Y++){var ka=q[Y];ka.toLowerCase()===v.toLowerCase()?I.create("strong",{textContent:ka},xa):(ka=document.createTextNode(ka),I.place(ka,xa))}}}}E?(I.place(E,this.suggestionsNode,"only"),this._showSuggestionsMenu()):(I.empty(this.suggestionsNode),this._hideSuggestionsMenu())}},_insertSources:function(d){if(this.enableSourcesMenu&&d&&1<d.length){var v,O=this.activeSourceIndex,E=I.create("ul",{role:"menu"});if(this.enableSearchingAll){var aa="";O===this._allIndex&&(aa="active");
I.create("li",{"data-index":this._allIndex,role:"menuitem",className:aa,tabIndex:0,textContent:w.widgets.Search.main.all},E)}for(v=0;v<d.length;v++){aa="";v===O&&(aa=this.css.activeSource);var ma=this._getSourceName(v);I.create("li",{"data-index":v,role:"menuitem",className:aa,tabIndex:0,textContent:ma},E)}h.add(this.containerNode,this.css.hasMultipleSources);I.place(E,this.sourcesNode,"only")}else h.remove(this.containerNode,this.css.hasMultipleSources),I.empty(this.sourcesNode)},_showLoading:function(){h.add(this.containerNode,
this.css.searchLoading)},_hideLoading:function(){h.remove(this.containerNode,this.css.searchLoading)},_checkStatus:function(){this.value?(h.add(this.containerNode,this.css.hasValue),n.set(this.clearNode,"title",w.widgets.Search.main.clearButtonTitle)):this.clear()},_closePopup:function(){this.enableInfoWindow&&this.map&&this.map.infoWindow&&this.map.infoWindow.hide()},_noResults:function(d){var v;d&&(v=t.trim(d));var O=I.create("div",{className:this.css.searchNoResultsBody});d&&v?(I.create("div",
{className:this.css.searchNoResultsHeader,textContent:w.widgets.Search.main.noResults},O),I.create("div",{className:this.css.searchNoResultsText,textContent:a.substitute({value:'"'+d+'"'},w.widgets.Search.main.noResultsFound)},O)):(d=I.create("div",{},O),I.create("span",{"aria-hidden":"true",className:this.css.searchNoValueIcon},d),I.create("span",{className:this.css.searchNoValueText,textContent:w.widgets.Search.main.emptyValue},d));I.place(O,this.noResultsMenuNode,"only")},_hideMenus:function(){this._hideSourcesMenu();
this._hideSuggestionsMenu();this._hideNoResultsMenu()},_hideNoResultsMenu:function(){h.remove(this.containerNode,this.css.showNoResults)},_showNoResultsMenu:function(){this._hideSourcesMenu();this._hideSuggestionsMenu();h.add(this.containerNode,this.css.showNoResults)},_hideSourcesMenu:function(){h.remove(this.containerNode,this.css.showSources)},_hideSuggestionsMenu:function(){h.remove(this.containerNode,this.css.showSuggestions)},_showSourcesMenu:function(){this._hideSuggestionsMenu();this._hideNoResultsMenu();
h.add(this.containerNode,this.css.showSources)},_showSuggestionsMenu:function(){this._hideSourcesMenu();this._hideNoResultsMenu();h.add(this.containerNode,this.css.showSuggestions)},_toggleSourcesMenu:function(){this._hideSuggestionsMenu();this._hideNoResultsMenu();h.toggle(this.containerNode,this.css.showSources)},_getFirstStringField:function(d){if(d&&(d=d.fields)&&d.length)for(var v=0;v<d.length;v++){var O=d[v];if("esriFieldTypeString"===O.type)return O.name}return""},_getDisplayField:function(d){return d.displayField||
d.featureLayer.displayField||this._getFirstStringField(d.featureLayer)},_validLocation:function(d){return d&&"number"===typeof d.x&&"number"===typeof d.y},_validExtent:function(d){return d&&"number"===typeof d.xmin&&"number"===typeof d.ymin&&"number"===typeof d.xmax&&"number"===typeof d.ymax},_hydrateResult:function(d,v,O){var E={},aa=this._defaultSR;v=this.sources[v];this.map&&(aa=this.map.spatialReference);if(d.hasOwnProperty("text")&&d.hasOwnProperty("magicKey"))return d;if(d.hasOwnProperty("geometry")){var ma=
new ia(d.toJson());E.feature=ma;(ma=E.feature.geometry)&&ma.setSpatialReference(aa)}else if(d.hasOwnProperty("location")&&this._validLocation(d.location)){var va=new ca(d.location.x,d.location.y,aa);ma={};d.hasOwnProperty("attributes")&&(ma=d.attributes);d.hasOwnProperty("address")&&"object"===typeof d.address&&t.mixin(ma,d.address);d.hasOwnProperty("score")&&(ma.score=d.score);E.feature=new ia(va,null,ma,null)}!E.feature&&O&&(ma={},d.hasOwnProperty("attributes")&&(ma=d.attributes),d.hasOwnProperty("score")&&
(ma.score=d.score),E.feature=new ia(null,null,ma,null));if(E.feature){if(d.hasOwnProperty("extent")&&this._validExtent(d.extent))E.extent=new ra(d.extent),E.extent.setSpatialReference(aa);else if(E.feature&&E.feature.geometry)switch(E.feature.geometry.type){case "extent":E.extent=E.feature.geometry;break;case "multipoint":E.extent=oa.getDenormalizedExtent(E.feature.geometry);break;case "polygon":E.extent=oa.getDenormalizedExtent(E.feature.geometry);break;case "polyline":E.extent=oa.getDenormalizedExtent(E.feature.geometry);
break;case "point":this.map?(aa=this.zoomScale,v&&v.zoomScale&&(aa=v.zoomScale),this._getScale()>aa?E.extent=ta.getExtentForScale(this.map,aa).centerAt(E.feature.geometry):E.extent=this.map.extent.centerAt(E.feature.geometry)):E.extent=new ra({xmin:E.feature.geometry.x-.25,ymin:E.feature.geometry.y-.25,xmax:E.feature.geometry.x+.25,ymax:E.feature.geometry.y+.25,spatialReference:this._defaultSR})}else E.extent=null;E.name="";v.featureLayer?v.suggestionTemplate&&O?E.name=a.substitute(d.attributes,v.suggestionTemplate):
v.searchTemplate?E.name=a.substitute(d.attributes,v.searchTemplate):(ma=this._getDisplayField(v),O=v.featureLayer.getField(ma),aa=v.featureLayer.getDomain(ma),ma&&d.hasOwnProperty("attributes")&&d.attributes.hasOwnProperty(ma)&&(d=d.attributes[ma],aa&&"codedValue"===aa.type?E.name=this._getCodedName(aa.codedValues,d):O&&"esriFieldTypeDate"===O.type&&!isNaN(d)?E.name=K.format(new Date(d)):E.name=d)):d.address&&v.searchTemplate?E.name=a.substitute(d.address,v.searchTemplate):d.hasOwnProperty("name")?
E.name=d.name:d.hasOwnProperty("attributes")&&"object"===typeof d.attributes&&d.attributes.LongLabel?E.name=d.attributes.LongLabel:d.hasOwnProperty("attributes")&&"object"===typeof d.attributes&&d.attributes.Match_addr?(E.name=d.attributes.Match_addr,d.attributes.Addr_type&&"POI"===d.attributes.Addr_type&&d.attributes.StAddr&&d.attributes.City?E.name+=" - "+d.attributes.StAddr+", "+d.attributes.City:d.attributes.Addr_type&&"POI"===d.attributes.Addr_type&&d.attributes.City&&(E.name+=" - "+d.attributes.City)):
d.hasOwnProperty("address")&&"string"===typeof d.address?E.name=d.address:d.hasOwnProperty("address")&&"object"===typeof d.address&&d.address.hasOwnProperty("Address")?d.address.hasOwnProperty("Match_addr")?E.name=d.address.Match_addr:d.address.hasOwnProperty("Address")&&(E.name=d.address.Address):E.feature&&E.feature.geometry&&(E.name=E.feature.geometry.x+","+E.feature.geometry.y);v.featureLayer&&E.feature&&r(E.feature,v.featureLayer);return E}},_getScale:function(){var d;this.map&&"function"===
typeof this.map.getScale&&(d=this.map.getScale());return d},_hydrateResults:function(d,v,O,E){E=[];var aa=0;if(d&&d.length)for(aa;aa<d.length;aa++){var ma=this._hydrateResult(d[aa],v,O);ma&&E.push(ma)}return E},_containsNonLatinCharacter:function(d){for(var v=0;v<d.length;v++)if(255<d.charCodeAt(v))return!0;return!1},_setPlaceholder:function(d){var v="",O=this.sources[d];d===this._allIndex?v=this.allPlaceholder||w.widgets.Search.main.allPlaceholder:O&&O.placeholder&&(v=O.placeholder);var E=w.widgets.Search.main.all;
O&&(E=this._getSourceName(d));n.set(this.sourceNameNode,"textContent",E);n.set(this.inputNode,"placeholder",v);n.set(this.inputNode,"title",v)},_updateActiveSource:function(){var d=this.sources,v=this.activeSourceIndex,O;d&&d[v]&&(O=d[v]);O?this.set("activeSource",O):this.set("activeSource",null)},_updateVisible:function(){this.visible?this.show():this.hide()},_updateButtonMode:function(d){d?(h.toggle(this.containerNode,this.css.searchExpanded,this.expanded),h.toggle(this.containerNode,this.css.searchCollapsed,
!this.expanded),h.add(this.containerNode,this.css.hasButtonMode)):(h.remove(this.containerNode,this.css.searchExpanded),h.remove(this.containerNode,this.css.searchCollapsed),h.remove(this.containerNode,this.css.hasButtonMode))},_setDefaultActiveSourceIndex:function(d){d&&1===d.length||!this.enableSearchingAll?this.set("activeSourceIndex",0):this.set("activeSourceIndex",this._allIndex)},_setEnableSourcesMenuAttr:function(d){this._set("enableSourcesMenu",d);this._created&&this._insertSources(this.sources)},
_setEnableSearchingAllAttr:function(d){this._set("enableSearchingAll",d);this._created&&(this._setDefaultActiveSourceIndex(this.sources),this._hideMenus(),this._insertSources(this.sources))},_setSourcesAttr:function(d){this._createSourceNameMap(d).then(t.hitch(this,function(v){this._sourceNames=v;this._created&&(this._setDefaultActiveSourceIndex(d),this._hideMenus(),this._insertSources(d))}));this._set("sources",d)},_setAllPlaceholderAttr:function(d){this._set("allPlaceholder",d);this._created&&this._setPlaceholder(this.activeSourceIndex)},
_setActiveSourceIndexAttr:function(d){this._set("activeSourceIndex",d);this._updateActiveSource();this._created&&(this._setPlaceholder(d),this._hideMenus(),this._insertSources(this.sources))},_setMaxLengthAttr:function(d){this._set("maxLength",d);this._created&&n.set(this.inputNode,"maxLength",d)},_setValueAttr:function(d){this.set("magicKey",null);this.set("selectedFeatureId",null);this._set("value",d);this._created&&(n.set(this.inputNode,"value",d),this._checkStatus())},_setVisibleAttr:function(d){this._set("visible",
d);this._created&&this._updateVisible()},_setEnableButtonModeAttr:function(d){this._set("enableButtonMode",d);this._created&&this._updateButtonMode(d)},_setThemeAttr:function(d){this._created&&(h.remove(this.domNode,this.theme),h.add(this.domNode,d));this._set("theme",d)}});g("extend-esri")&&t.setObject("dijit.Search",W,da);return W})},"esri/tasks/locator":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/_base/Deferred dojo/_base/json dojo/has ../kernel ../request ../deferredUtils ./Task ./AddressCandidate".split(" "),
function(V,W,t,Q,X,R,H,y,e,g,l){V=V(g,{declaredClass:"esri.tasks.Locator",_eventMap:{"address-to-locations-complete":["addresses"],"addresses-to-locations-complete":["addresses"],"location-to-address-complete":["address"],"suggest-locations-complete":["suggestions"]},constructor:function(m){this._geocodeHandler=W.hitch(this,this._geocodeHandler);this._geocodeAddressesHandler=W.hitch(this,this._geocodeAddressesHandler);this._reverseGeocodeHandler=W.hitch(this,this._reverseGeocodeHandler);this.registerConnectEvents()},
outSpatialReference:null,setOutSpatialReference:function(m){this.outSpatialReference=m},_geocodeHandler:function(m,n,h,x,I){try{var K=m.candidates;n=[];var w,L=K.length,T=m.spatialReference,U;for(w=0;w<L;w++){var N=K[w];if(U=N.location)U.spatialReference=T;n[w]=new l(N)}this._successHandler([n],"onAddressToLocationsComplete",h,I)}catch(S){this._errorHandler(S,x,I)}},_geocodeAddressesHandler:function(m,n,h,x,I){try{var K=m.locations;n=[];var w,L=K.length,T=m.spatialReference,U;for(w=0;w<L;w++){if(U=
K[w].location)U.spatialReference=T;n[w]=new l(K[w])}this._successHandler([n],"onAddressesToLocationsComplete",h,I)}catch(N){this._errorHandler(N,x,I)}},addressToLocations:function(m,n,h,x,I){var K;if(m.address){x=h;h=n;n=m.outFields;I=m.searchExtent;var w=m.countryCode;var L=m.magicKey;var T=m.distance;var U=m.categories;m.location&&this.normalization&&(K=m.location.normalize());var N=m.locationType;var S=m.maxLocations;var F=m.forStorage;m=m.address}I&&(I=I.shiftCentralMeridian());var a=this.outSpatialReference;
m=this._encode(W.mixin({},this._url.query,m,{f:"json",outSR:a&&X.toJson(a.toJson()),outFields:n&&n.join(",")||null,searchExtent:I&&X.toJson(I.toJson()),category:U&&U.join(",")||null,countryCode:w||null,magicKey:L||null,distance:T||null,location:K||null,locationType:N||null,maxLocations:S||null,forStorage:F||null}));var D=this._geocodeHandler,da=this._errorHandler,ha=new Q(e._dfdCanceller);ha._pendingDfd=y({url:this._url.path+"/findAddressCandidates",content:m,callbackParamName:"callback",load:function(ia,
na){D(ia,na,h,x,ha)},error:function(ia){da(ia,x,ha)}});return ha},suggestLocations:function(m){var n=new Q(e._dfdCanceller);m.hasOwnProperty("location")&&this.normalization&&(m.location=m.location.normalize());m.searchExtent&&(m.searchExtent=m.searchExtent.shiftCentralMeridian());m=this._encode(W.mixin({},this._url.query,{f:"json",text:m.text,maxSuggestions:m.maxSuggestions,searchExtent:m.searchExtent&&X.toJson(m.searchExtent.toJson()),category:m.categories&&m.categories.join(",")||null,countryCode:m.countryCode||
null,location:m.location||null,distance:m.distance||null},{f:"json"}));m=y({url:this._url.path+"/suggest",content:m,callbackParamName:"callback"});n._pendingDfd=m;m.then(W.hitch(this,function(h){h=h.suggestions||[];this.onSuggestLocationsComplete(h);n.resolve(h)}),W.hitch(this,function(h){this._errorHandler(h);n.reject(h)}));return n},addressesToLocations:function(m,n,h){var x=this.outSpatialReference,I=[],K=m.categories,w=m.locationType,L=m.countryCode;t.forEach(m.addresses,function(S,F){I.push({attributes:S})});
m=this._encode(W.mixin({},this._url.query,{category:K&&K.join(",")||null,locationType:w||null,sourceCountry:L||null},{addresses:X.toJson({records:I})},{f:"json",outSR:x&&X.toJson(x.toJson())}));var T=this._geocodeAddressesHandler,U=this._errorHandler,N=new Q(e._dfdCanceller);N._pendingDfd=y({url:this._url.path+"/geocodeAddresses",content:m,callbackParamName:"callback",load:function(S,F){T(S,F,n,h,N)},error:function(S){U(S,h,N)}});return N},_reverseGeocodeHandler:function(m,n,h,x,I){try{var K=new l({address:m.address,
location:m.location,score:100});this._successHandler([K],"onLocationToAddressComplete",h,I)}catch(w){this._errorHandler(w,x,I)}},locationToAddress:function(m,n,h,x){m&&this.normalization&&(m=m.normalize());var I=this.outSpatialReference;m=this._encode(W.mixin({},this._url.query,{outSR:I&&X.toJson(I.toJson()),location:m&&X.toJson(m.toJson()),distance:n,f:"json"}));var K=this._reverseGeocodeHandler,w=this._errorHandler,L=new Q(e._dfdCanceller);L._pendingDfd=y({url:this._url.path+"/reverseGeocode",content:m,
callbackParamName:"callback",load:function(T,U){K(T,U,h,x,L)},error:function(T){w(T,x,L)}});return L},onSuggestLocationsComplete:function(){},onAddressToLocationsComplete:function(){},onAddressesToLocationsComplete:function(){},onLocationToAddressComplete:function(){}});R("extend-esri")&&W.setObject("tasks.Locator",V,H);return V})},"esri/tasks/AddressCandidate":function(){define(["dojo/_base/declare","dojo/_base/lang","dojo/has","../kernel","../geometry/Point"],function(V,W,t,Q,X){V=V(null,{declaredClass:"esri.tasks.AddressCandidate",
constructor:function(R){W.mixin(this,R);this.location=new X(this.location)}});t("extend-esri")&&W.setObject("tasks.AddressCandidate",V,Q);return V})},"esri/styles/basic":function(){define(["dojo/_base/array","dojo/_base/lang","dojo/has","../kernel","../Color"],function(V,W,t,Q,X){function R(l,m){if(l){var n={};n.color=new X(l.color);n.opacity=l.opacity||1;switch(m){case "point":n.outline={color:new X(l.outline.color),width:l.outline.width};n.size=l.size;break;case "line":n.width=l.width;break;case "polygon":n.outline=
{color:new X(l.outline.color),width:l.outline.width}}}return n}function H(l){if("esriGeometryPoint"===l||"esriGeometryMultipoint"===l)l="point";else if("esriGeometryPolyline"===l)l="line";else if("esriGeometryPolygon"===l||"esriGeometryMultiPatch"===l)l="polygon";return l}var y={"default":{name:"default",label:"Default",description:"Default theme for basic visualization of features.",basemapGroups:{light:"streets gray topo terrain national-geographic oceans osm gray-vector streets-vector topo-vector streets-relief-vector streets-navigation-vector".split(" "),
dark:["satellite","hybrid","dark-gray","dark-gray-vector","streets-night-vector"]},pointSchemes:{light:{primary:{color:[77,77,77,1],outline:{color:[255,255,255,.25],width:1},size:8},secondary:[{color:[226,119,40,1],outline:{color:[255,255,255,.25],width:1},size:8},{color:[255,255,255,1],outline:{color:[51,51,51,.25],width:1},size:8}]},dark:{primary:{color:[255,255,255,1],outline:{color:[92,92,92,.25],width:1},size:8},secondary:[{color:[226,119,40,1],outline:{color:[255,255,255,.25],width:1},size:8},
{color:[26,26,26,1],outline:{color:[178,178,178,.25],width:1},size:8}]}},lineSchemes:{light:{primary:{color:[77,77,77,1],width:2},secondary:[{color:[226,119,40,1],width:2},{color:[255,255,255,1],width:2}]},dark:{primary:{color:[255,255,255,1],width:2},secondary:[{color:[226,119,40,1],width:2},{color:[26,26,26,1],width:2}]}},polygonSchemes:{light:{primary:{color:[227,139,79,1],outline:{color:[255,255,255,.25],width:1},opacity:.8},secondary:[{color:[128,128,128,1],outline:{color:[255,255,255,.25],width:1},
opacity:.8},{color:[255,255,255,1],outline:{color:[128,128,128,.25],width:1},opacity:.8}]},dark:{primary:{color:[227,139,79,1],outline:{color:[92,92,92,.25],width:1},opacity:.8},secondary:[{color:[178,178,178,1],outline:{color:[92,92,92,.25],width:1},opacity:.8},{color:[26,26,26,1],outline:{color:[128,128,128,.25],width:1},opacity:.8}]}}}},e={};(function(){var l,m,n;for(l in y){var h=y[l];var x=h.basemapGroups;var I=e[l]={basemaps:[].concat(x.light).concat(x.dark),point:{},line:{},polygon:{}};for(m in x){var K=
x[m];for(n=0;n<K.length;n++){var w=K[n];h.pointSchemes&&(I.point[w]=h.pointSchemes[m]);h.lineSchemes&&(I.line[w]=h.lineSchemes[m]);h.polygonSchemes&&(I.polygon[w]=h.polygonSchemes[m])}}}})();var g={getAvailableThemes:function(l){var m=[],n;for(n in y){var h=y[n];var x=e[n];l&&-1===V.indexOf(x.basemaps,l)||m.push({name:h.name,label:h.label,description:h.description,basemaps:x.basemaps.slice(0)})}return m},getSchemes:function(l){var m=l.theme,n=l.basemap,h=H(l.geometryType);l=e[m];var x;(l=(l=l&&l[h])&&
l[n])&&(x={primaryScheme:R(l.primary,h),secondarySchemes:V.map(l.secondary,function(I){return R(I,h)})});return x},cloneScheme:function(l){if(l){var m=W.mixin({},l);m.color&&(m.color=new X(m.color));m.outline&&(m.outline={color:m.outline.color&&new X(m.outline.color),width:m.outline.width})}return m}};t("extend-esri")&&W.setObject("styles.basic",g,Q);return g})},"widgets/NearMe/searchSourceUtils":function(){define("dojo/_base/lang dojo/_base/array dojo/Deferred dojo/when dojo/promise/all jimu/portalUtils esri/lang esri/request".split(" "),
function(V,W,t,Q,X,R,H,y){return{map:null,layerInfosObj:null,appConfig:null,_esriLocatorRegExp:/geocode(.){0,3}\.arcgis.com\/arcgis\/rest\/services\/World\/GeocodeServer/g,setMap:function(e){this.map=e},setLayerInfosObj:function(e){this.layerInfosObj=e},setAppConfig:function(e){this.appConfig=e},getConfigInfo:function(e){if(e&&e.sources&&0<e.sources.length){var g=null;return this.searchLayer(this.map)&&e.upgradeFromGeocoder?(g=this.map.itemInfo.itemData.applicationProperties.viewing.search,g=W.map(g.layers,
V.hitch(this,function(l,m){m.hintText=l;return this._getQueryTypeGeocoder(m)},g.hintText)),X(g).then(V.hitch(this,function(l){e.sources=[].concat(l).concat(e.sources);return e}))):e}return Q(this._getSoucesFromPortalAndWebmap()).then(V.hitch(this,function(l){return{allPlaceholder:"",showInfoWindowOnSelect:!0,sources:l}}))},_getSoucesFromPortalAndWebmap:function(){var e=[],g=null;this.searchLayer(this.map)&&(g=this.map.itemInfo.itemData.applicationProperties.viewing.search,W.forEach(g.layers,V.hitch(this,
function(l,m){m.hintText=l;e.push(this._getQueryTypeGeocoder(m))},g.hintText)));return R.getPortalSelfInfo(this.appConfig.portalUrl).then(V.hitch(this,function(l){if((l=l.helperServices&&l.helperServices.geocode)&&0<l.length)for(var m=0,n=l.length;m<n;m++){var h=l[m];h&&e.push(this._processSingleLine(h))}return X(e).then(V.hitch(this,function(x){for(var I=[],K=0;K<x.length;K++){var w=x[K];w&&(w&&"query"===w.type?I.push(w):(w={name:w.name||this._getGeocodeName(w.url),url:w.url,singleLineFieldName:w.singleLineFieldName,
placeholder:w.placeholder||window.jimuNls.common.findAddressOrPlace||w.name||this._getGeocodeName(w.url),maxResults:6,searchInCurrentMapExtent:!1,type:"locator"},w.enableLocalSearch=this._isEsriLocator(w.url),w.localSearchMinScale=3E5,w.localSearchDistance=5E4,I.push(w)))}return I}))}))},_getQueryTypeGeocoder:function(e){var g=this.map.getLayer(e.id),l=null,m=null,n=null;n=H.isDefined(e.subLayer)?e.id+"_"+e.subLayer:e.id;l=this.layerInfosObj.traversal(function(h){return h.id===n?(m=h,!0):!1});return g&&
l&&m?(l=H.isDefined(e.subLayer)?m.url||g.url+"/"+e.subLayer:m.url||g.url,{name:m.title,layerId:n,url:l,placeholder:e.hintText||window.jimuNls.common.findAddressOrPlace,searchFields:[e.field.name],displayField:e.field.name,exactMatch:e.field.exactMatch||!1,maxResults:6,searchInCurrentMapExtent:!1,type:"query"}):null},_isEsriLocator:function(e){this._esriLocatorRegExp.lastIndex=0;return this._esriLocatorRegExp.test(e)},_processSingleLine:function(e){if(e.singleLineFieldName)return e;if(this._isEsriLocator(e.url))return e.singleLineFieldName=
"SingleLine",e;var g=new t;y({url:e.url,content:{f:"json"},handleAs:"json",callbackParamName:"callback"}).then(V.hitch(this,function(l){l.singleLineAddressField&&l.singleLineAddressField.name?(e.singleLineFieldName=l.singleLineAddressField.name,g.resolve(e)):(console.warn(e.url+"has no singleLineFieldName"),g.resolve(null))}),V.hitch(this,function(l){console.error(l);g.resolve(null)}));return g.promise},_getGeocodeName:function(e){if("string"!==typeof e)return"geocoder";e=e.split("/");return e[e.length-
2]||"geocoder"},getGeocoderName:function(e){return this._getGeocodeName(e)},hasAppSearchInfo:function(e){return e.itemInfo&&e.itemInfo.itemData&&e.itemInfo.itemData.applicationProperties&&e.itemInfo.itemData.applicationProperties.viewing&&e.itemInfo.itemData.applicationProperties.viewing.search},searchLayer:function(e){if(!this.hasAppSearchInfo(e))return!1;e=e.itemInfo.itemData.applicationProperties.viewing.search;return e.enabled&&0!==e.layers.length?!0:!1}}})},"widgets/NearMe/item-list":function(){define("require dojo/_base/declare dijit/_WidgetBase dojo/dom-construct dojo/query dojo/_base/array jimu/utils dojo/_base/lang dijit/layout/ContentPane dojo/dom-attr dojo/dom-style dojo/dom-class dojo/on dojo/Deferred dojo/Evented dojo/promise/all jimu/dijit/Message jimu/dijit/TabContainer dojo/text!./item-list.html esri/Color esri/dijit/Directions esri/dijit/PopupTemplate esri/graphic esri/geometry/Point esri/geometry/Polyline esri/geometry/Polygon esri/SpatialReference esri/geometry/geometryEngine esri/layers/FeatureLayer esri/layers/GraphicsLayer esri/symbols/jsonUtils esri/symbols/SimpleFillSymbol esri/symbols/SimpleLineSymbol esri/symbols/SimpleMarkerSymbol esri/tasks/query esri/tasks/RelationshipQuery esri/units dojo/_base/fx dojo/number jimu/LayerInfos/LayerInfos jimu/FilterManager esri/geometry/webMercatorUtils dijit/registry jimu/dijit/EditorXssFilter esri/renderers/jsonUtils jimu/symbolUtils esri/geometry/Multipoint dojo/keys dijit/focus dojo/string esri/geometry/scaleUtils ./libs/swiper dojo/text!./swiperLayout.html dojo/_base/event".split(" "),
function(V,W,t,Q,X,R,H,y,e,g,l,m,n,h,x,I,K,w,L,T,U,N,S,F,a,D,da,ha,ia,na,P,la,ja,J,z,B,ca,ra,oa,ta,za,b,f,G,r,d,v,O,E,aa,ma,va,Aa,xa){return W([t,x],{_itemListTemplate:L,_serviceArea:null,_operationalLayers:null,_selectedPoint:null,_panels:{},_currentPanel:null,map:null,config:null,folderUrl:null,loading:null,nls:null,parentDiv:null,outerContainer:null,_featureListContent:null,_featureInfoPanel:null,_directionInfoPanel:null,_tabContainer:null,_isNoFeature:null,_isSlide:!0,_loadAttachmentTimer:null,
_failedLayers:[],_routeCalculated:!1,_selectedLayer:null,_selectedItem:null,_selectedFeature:null,_selectedFeatureItem:null,_featureGraphicsLayer:null,_directionsWidget:null,_layerCount:null,_tables:[],_searchedFeatures:{},_attributeSearchList:null,_filterIcon:null,_proximityIcon:null,_gallerySwiper:[],_mediaRefreshTimers:null,_allContentPanes:[],postCreate:function(){this._proximityIcon=this._filterIcon=null;this._gallerySwiper=[];this._allContentPanes=[];this._tables=[];this._panels={};this._failedLayers=
[];this._operationalLayers=null;this._searchedFeatures={};this._attributeSearchList=null;this._tablesLayer={};this.domNode=Q.create("div",{"class":"esriCTItemListMainContainer"},this.outerContainer);this.updateListHeight();this.filterManager=za.getInstance();this._getUpdatedLayerFilters();this._createPanels();this._loadFeatureLayers();this._featureGraphicsLayer=new na;this.map.addLayer(this._featureGraphicsLayer);this.editorXssFilter=G.getInstance()},updateListHeight:function(){var q=l.get(this.searchOuterContainer,
"height");q+=23;l.set(this.filterListMainDiv,"height","calc(100% - "+q+"px)");l.set(this.domNode,"height","calc(100% - "+q+"px)")},_createPanels:function(){this._panels.layerListPanel=Q.create("div",{"class":"esriCTLayerList"},this.domNode);this._panels.featureListPanel=Q.create("div",{"class":"esriCTFeatureList"},this.domNode);var q=Q.toDom(this._itemListTemplate).childNodes[0];g.set(q,"tabindex",0);m.add(q,"esriCTPanelHeader");this._panels.featureListPanel.appendChild(q);this._featureListContent=
Q.create("div",{"class":"esriCTFeatureListContent"},null);l.set(this._featureListContent,"color",this.config.fontColor);this._panels.featureListPanel.appendChild(this._featureListContent);this._attachEventOnBackButton(this._panels.featureListPanel);this._panels.infoPanel=Q.create("div",{"class":"esriCTDirectionInfoPanel"},this.domNode);q=Q.toDom(this._itemListTemplate).childNodes[0];g.set(q,"tabindex",0);m.add(q,"esriCTPanelHeader");this._panels.infoPanel.appendChild(q);this._attachEventOnBackButton(this._panels.infoPanel);
this._featureInfoPanel=new e({},null);this._featureInfoPanel.startup();this.config.enableDirection?(this._directionInfoPanel=new e({},null),this._directionInfoPanel.startup(),this._tabContainer=new w({tabs:[{title:this.nls.informationTabTitle,content:this._featureInfoPanel},{title:this.nls.directionTabTitle,content:this._directionInfoPanel}]},Q.create("div",{"class":"esriCTTabContainer"},this._panels.infoPanel)),this._tabContainer.startup(),g.set(this._featureInfoPanel.domNode,"tabindex",0),g.set(this._featureInfoPanel.domNode,
"role","region"),q={"class":"esriCTProximityParent"},void 0===this.config.enableProximitySearch||this.config.enableProximitySearch||(q.style="display: none"),q=Q.create("div",q,this._panels.infoPanel),this.own(this._tabContainer.on("tabChanged",y.hitch(this,function(C){this.emit("tab-change",C);C===this.nls.directionTabTitle?this._routeCalculated?"block"===l.get(this.proximityButton.parentElement,"display")?H.initLastFocusNode(this.domNodeObj,this.proximityButton):this.emit("setLastNodeInFeatureInfo",
H.getFocusNodesInDom(this._directionsWidget.domNode).reverse()[0]):this._initializeDirectionWidget():this._getFeatureInfoLastNode();this.parentDivId&&f.byId(this.parentDivId)&&f.byId(this.parentDivId).resize&&f.byId(this.parentDivId).resize()})))):(this._panels.infoPanel.appendChild(this._featureInfoPanel.domNode),m.add(this._featureInfoPanel.domNode,"esriCTFeatureInfo"),g.set(this._featureInfoPanel.domNode,"tabindex",0),g.set(this._featureInfoPanel.domNode,"role","region"),(q=X(".esriCTItemListMainContainer .esriCTDirectionInfoPanel .esriCTPanelHeader"))&&
m.add(q[0],"esriCTBorderBottom"),q={"class":"esriCTProximityParent",style:"bottom: 0px"},void 0===this.config.enableProximitySearch||this.config.enableProximitySearch||(q.style="display: none"),q=Q.create("div",q,this._panels.infoPanel));this.proximityButton=Q.create("div",{"class":"esriCTProximityIconContainer",title:this.nls.proximityButtonTooltip,"aria-label":this.nls.proximityButtonTooltip,tabindex:"0",role:"button"},q);this._proximityIcon=Q.create("div",{"class":"esriCTProximityIcon",style:{"background-color":this.selectedThemeColor}},
this.proximityButton);this.own(n(this.proximityButton,"click",y.hitch(this,function(){this._selectedFeature&&this._selectedFeature.geometry&&this.emit("init-proximity",new S(this._selectedFeature.geometry))})));this.own(n(this.proximityButton,"keydown",y.hitch(this,function(C){(C.keyCode===O.ENTER||C.keyCode===O.SPACE)&&this._selectedFeature&&this._selectedFeature.geometry&&this.emit("init-proximity",new S(this._selectedFeature.geometry))})));this.parentDivId&&f.byId(this.parentDivId)&&f.byId(this.parentDivId).resize&&
f.byId(this.parentDivId).resize();this._attachEventToTab()},_attachEventOnBackButton:function(q){var C=X(".esriCTItemlList",q)[0];var Y=X(".esriCTBackButton",q)[0];C&&Y&&this.own(n(C,"click, keypress",y.hitch(this,function(ka){if("keypress"===ka.type){var qa=ka.charCode||ka.keyCode;if(qa!==O.ENTER&&qa!==O.SPACE)return}ka.stopPropagation();"none"!==l.get(Y,"display")&&this._isSlide&&(this._isSlide=!1,this._selectedItem=null,this._clearGrahics(),this._clearDirections(),this._clearMediaRefreshTimers(),
this._isFeatureList?(this._isFeatureList=!1,this._showPanel("featureListPanel",!0),E.focus(X(".esriCTItemlList[tabindex\x3d'0']",this._featureListContent)[0])):(this.loading.hide(),this._clearContent(this._featureListContent),this.showLayersOnBackToLayerList(),this._selectedLayer=null,this._isFeatureList=!1,this._showPanel("layerListPanel",!0),E.focus(X(".esriCTItemlList[tabindex\x3d'0']",this._panels.layerListPanel)[0])))})))},_loadFeatureLayers:function(){var q;this._operationalLayers=[];this._tables=
this.map.webMapResponse.itemInfo.itemData.tables;for(q=0;q<this.config.searchLayers.length;q++)this.config.searchLayers[q].popupInfo||this.config.searchLayers.splice(q,1);for(q=0;q<this.config.searchLayers.length;q++)if(this.config.searchLayers[q].popupInfo){var C=new ia(this.config.searchLayers[q].url,{infoTemplate:new N(this.config.searchLayers[q].popupInfo)});C.id=this.config.searchLayers[q].id?this.config.searchLayers[q].id:"FL_"+this.config.searchLayers[q].title+q;C.title=this.config.searchLayers[q].title;
this.config.searchLayers[q].definitionExpression&&C.setDefinitionExpression(this.config.searchLayers[q].definitionExpression);this.config.searchLayers[q].renderer&&C.setRenderer(r.fromJson(this.config.searchLayers[q].renderer));C.index=q;C.layerIndex=this._operationalLayers.length;C.isMapServer=this.config.searchLayers[q].isMapServer;C.baseURL=this.config.searchLayers[q].baseURL;C.showAttachments=this.config.searchLayers[q].popupInfo.showAttachments;this._operationalLayers.push(C);this._onLayerLoad(C)}},
_onLayerLoad:function(q){q.loaded?q.tableInfos=this._getRelatedTableInfo(q.index):this.own(q.on("load",y.hitch(this,function(){q.tableInfos=this._getRelatedTableInfo(q.index)})))},_getRelatedTableInfo:function(q){var C,Y=[];(C=this._operationalLayers[q])&&R.forEach(C.relationships,y.hitch(this,function(ka){R.forEach(this._tables,y.hitch(this,function(qa,ua){qa.url.replace(/.*?:\/\//g,"")===(C.baseURL+ka.relatedTableId).replace(/.*?:\/\//g,"")&&qa.popupInfo&&(qa.relationshipIds||(qa.relationshipIds=
{}),qa.relationshipIds[C.id]=ka.id,Y.push(ua),this._tablesLayer[qa.id]=new ia(qa.url),this._tablesLayer[qa.id].showAttachments=!0)}))}));return Y},hasValidLayers:function(){return this._operationalLayers&&0<this._operationalLayers.length?!0:!1},_clearContent:function(q){q&&Q.empty(q)},displayLayerList:function(q,C,Y){var ka=[];this.loading.hide();this._layerCount=0;this._isSlide=this._isNoFeature=!0;this._attributeSearchList=null;Y?(this._attributeSearchList=Y,this._tabContainer&&this._tabContainer.controlNode&&
(l.set(this._tabContainer.controlNode,"display","none"),m.add(this._tabContainer.containerNode,"esriCTTopBorder"))):this._tabContainer&&this._tabContainer.controlNode&&(l.set(this._tabContainer.controlNode,"display","block"),m.remove(this._tabContainer.containerNode,"esriCTTopBorder"));this.clearResultPanel();this._getUpdatedLayerFilters();this._searchedFeatures={};this.showAllLayers();this._setSearchedLocation(q);this._setServiceArea(C);this._failedLayers=[];this._filterConfiguredLayer(ka);I(ka).then(y.hitch(this,
function(){var qa=X(".esriCTItemlList[tabindex\x3d'0']",this._panels.layerListPanel);qa&&0<qa.length&&(this._currentPanelName="layerListPanel",m.add(qa[qa.length-1],"esriCTLastLayerFocusNode"));this._onFeatureCountComplete();this.emit("setLastNode","layerListPanel")}))},_getUpdatedLayerFilters:function(){ta.getInstance(this.map,this.map.webMapResponse.itemInfo).then(y.hitch(this,function(q){R.forEach(this.config.searchLayers,y.hitch(this,function(C){var Y=q.getLayerInfoById(C.id);Y&&(C.definitionExpression=
Y.getFilter())}))}))},_filterConfiguredLayer:function(q){this._currentPanel=this._panels.layerListPanel;l.set(this._currentPanel,"display","block");l.set(this._currentPanel,"left","0px");for(var C=0;C<this._operationalLayers.length;C++)this._resetFilter(this._operationalLayers[C].layerIndex),this._createItemTemplate(this._operationalLayers[C],q);1===this._operationalLayers.length&&(l.set(this._panels.layerListPanel,"display","none"),this._onSingleLayerFound(null,this._operationalLayers[0]))},_onSingleLayerFound:function(q,
C){if(q){var Y=new h;q.push(Y)}(q=X(".esriCTBackButton",this._panels.featureListPanel)[0])&&l.set(q,"display","none");this._currentPanel=this._panels.featureListPanel;l.set(this._currentPanel,"display","block");l.set(this._currentPanel,"left","0px");C&&this._displayFeatureList(C,Y)},_onSingleFeatureFound:function(q){this._displayFilteredFeatures(q.attributes[this._selectedLayer.objectIdField]);this._showFeatureDetails(null,q);if(q=X(".esriCTBackButton",this._panels.infoPanel)[0])l.set(q,"display",
"block"),1===this._layerCount&&l.set(this._panels.featureListPanel,"display","none")},_createItemTemplate:function(q,C){var Y=Q.toDom(this._itemListTemplate).childNodes[0];m.add(Y,"esriCTDisabled");l.set(Y,"color",this.config.fontColor);this._currentPanel.appendChild(Y);this._setItemName(Y,q.title);this._queryForCountOnly(Y,q,C);this._attachClickEvent(Y,q,!0)},_setItemName:function(q,C,Y){Y&&(q=X(Y,q)[0]);if(Y=X(".esriCTItemName",q)[0])g.set(Y,"innerHTML",C),g.set(q,"aria-label",H.stripHTML(C||"")),
g.set(q,"title",H.stripHTML(C||""))},_attachClickEvent:function(q,C){this.own(n(q,"click, keypress",y.hitch(this,function(Y){if("keypress"===Y.type){var ka=Y.charCode||Y.keyCode;if(ka!==O.ENTER&&ka!==O.SPACE)return}!m.contains(q,"esriCTDisabled")&&this._isSlide&&(Y.stopPropagation(),this._isSlide=!1,this._selectedItem=q,(Y=X(".esriCTBackButton",this._panels.featureListPanel)[0])&&l.set(Y,"display","block"),this._displayFeatureList(C,null))})))},_displayFeatureList:function(q,C){this._clearContent(this._featureListContent);
this._selectedLayer=q;if(this.config.enableDirection){var Y=X(".jimu-tab",this._panels.infoPanel);var ka=X(".jimu-tab .control",this._panels.infoPanel);var qa=X(".esriCTItemListMainContainer .esriCTDirectionInfoPanel .esriCTPanelHeader");ka&&ka[0]&&Y&&Y[0]&&qa&&qa[0]&&("esriGeometryPolygon"===q.geometryType&&this.config.intersectSearchedLocation?(m.add(Y[0],"esriCTOverrideHeight"),m.add(ka[0],"esriCTHidden"),m.add(qa[0],"esriCTBorderBottom")):(m.remove(Y[0],"esriCTOverrideHeight"),m.remove(ka[0],
"esriCTHidden"),m.remove(qa[0],"esriCTBorderBottom")))}this._setItemName(this._panels.featureListPanel,this._selectedLayer.title,".esriCTPanelHeader");this._queryForFeatureList(C)},_getQueryParams:function(q){var C=new z;C.spatialRelationship="esriSpatialRelIntersects";C.outSpatialReference=this.map.spatialReference;C.outFields=["*"];if(this._attributeSearchList)this._attributeSearchList[q.id]&&0<this._attributeSearchList[q.id].length?C.objectIds=this._attributeSearchList[q.id]:C.where="1\x3d2";else if(this._serviceArea||
this._selectedPoint)C.geometry=this._serviceArea||this._selectedPoint.geometry;return C},_queryForCountOnly:function(q,C,Y){var ka=this._getQueryParams(C);this.config.intersectSearchedLocation&&"esriGeometryPolygon"===C.geometryType&&this._selectedPoint&&(ka.geometry=this._selectedPoint.geometry);var qa=new h;ka.where&&"1\x3d2"===ka.where?(l.set(q,"display","none"),g.set(q,"tabindex","-1"),E.focus(X(".esriCTItemlList[tabindex\x3d'0']",q.parentElement)[0]),this.config.selectedSearchLayerOnly&&this._showHideOperationalLayer(C.url,
C.id,!1),qa.resolve()):C.queryFeatures(ka,y.hitch(this,function(ua){0<ua.features.length?(this._selectedLayer=C,this._layerCount++,this._searchedFeatures[C.id]=ua.features,this._setItemCount(q,ua.features.length,!0),this._showFilteredFeaturesOnLoad(ua.features,C.id)):(l.set(q,"display","none"),g.set(q,"tabindex","-1"),E.focus(X(".esriCTItemlList[tabindex\x3d'0']",q.parentElement)[0]),this.config.selectedSearchLayerOnly&&this._showHideOperationalLayer(C.url,C.id,!1));qa.resolve()}),y.hitch(this,function(){q&&
(l.set(q,"display","none"),g.set(q,"tabindex","-1"),E.focus(X(".esriCTItemlList[tabindex\x3d'0']",q.parentElement)[0]),this._showHideOperationalLayer(C.url,C.id,!1));this._failedLayers.push(C.title);qa.resolve()}));Y.push(qa)},_getFeatureLayerDetailsFormArray:function(q){var C;if(this._operationalLayers&&0<this._operationalLayers.length){var Y=this._operationalLayers.length;for(C=0;C<Y;C++)if(this._operationalLayers[C].id===q)return this._operationalLayers[C]}return null},_showFilteredFeaturesOnLoad:function(q,
C){var Y,ka="",qa;C=this._getFeatureLayerDetailsFormArray(C);if(this.config.selectedSearchLayerOnly&&(1<q.length&&(q=this._getSortedFeatureList(q)),qa=this._getMaxResultCountValue(q.length,C.maxRecordCount))){for(Y=0;Y<qa;Y++)ka&&(ka+=","),ka+=q[Y].attributes[this._selectedLayer.objectIdField];q=this._selectedLayer.objectIdField+" in ("+ka+")";this._setFilterOnMapLayer(q,C.id,C.url,C.isMapServer)}},_onFeatureCountComplete:function(){if(this._isNoFeature){this.clearResultPanel();l.set(this._panels.layerListPanel,
"display","block");l.set(this._panels.layerListPanel,"left","0px");var q=this.editorXssFilter.sanitize(this.config.noFeatureFoundMessage);Q.create("div",{"class":"esriCTNoFeatureFound","aria-label":q?q:this.nls.noFeatureFoundText,innerHTML:q?q:this.editorXssFilter.sanitize(this.nls.noFeatureFoundText)},this._panels.layerListPanel);this.emit("noFeatureFound")}else 1===this._layerCount&&1!==this._operationalLayers.length&&(l.set(this._panels.layerListPanel,"display","none"),this._onSingleLayerFound(null,
this._selectedLayer));this._failedLayers.length&&(q=this.nls.unableToFetchResults+"\n\x3c/t\x3e\x3cul\x3e\x3cli\x3e"+this._failedLayers.join("\n \x3c/li\x3e\x3cli\x3e")+"\x3c/li\x3e\x3c/ul\x3e",this._showMessage(q));this.loading.hide();this.parentDivId&&f.byId(this.parentDivId)&&f.byId(this.parentDivId).resize&&f.byId(this.parentDivId).resize()},_queryForFeatureList:function(q){this.loading.show();if(this._searchedFeatures[this._selectedLayer.id])this._hideAllLayers(),0<this._searchedFeatures[this._selectedLayer.id].length&&
this._creatFeatureList(this._searchedFeatures[this._selectedLayer.id]),this.loading.hide(),q&&q.resolve();else{var C=this._getQueryParams(this._selectedLayer);this.config.intersectSearchedLocation&&this._selectedLayer&&"esriGeometryPolygon"===this._selectedLayer.geometryType&&this._selectedPoint&&(C.geometry=this._selectedPoint.geometry);this._selectedLayer.queryFeatures(C,y.hitch(this,function(Y){this._hideAllLayers();0<Y.features.length&&(this._showFilteredFeaturesOnLoad(Y.features,this._selectedLayer.id),
this._creatFeatureList(Y.features));this.loading.hide();q&&q.resolve()}),y.hitch(this,function(){this.loading.hide();this._failedLayers.push(this._selectedLayer.title);q&&q.resolve()}))}},resetAllFilters:function(){for(var q=0;q<this._operationalLayers.length;q++)this._resetFilter(this._operationalLayers[q].layerIndex)},_setItemCount:function(q,C,Y){var ka=X(".esriCTItemCount",q)[0];X(".esriCTItemName",q);ka&&(m.remove(ka,"esriCTLoadingIcon"),Y?(C=this._getMaxResultCountValue(C,this._selectedLayer.maxRecordCount),
this.config.showFeaturesCount&&(g.set(ka,"innerHTML","("+oa.format(C)+")"),ka=g.get(q,"title")+" "+oa.format(C),g.set(q,"title",ka),g.set(q,"aria-label",ka)),C&&(this._isNoFeature=!1,m.remove(q,"esriCTDisabled"),g.set(q,"tabindex","0"),g.set(q,"role","button"),E.focus(X(".esriCTItemlList[tabindex\x3d'0']",q.parentElement)[0]))):(C=oa.format(C.toFixed(2))+" "+this.nls.units[this.config.bufferDistanceUnit.value].acronym,g.set(ka,"innerHTML",C),q&&(ka=g.get(q,"title")+" "+C,g.set(q,"title",ka),g.set(q,
"aria-label",ka))))},_getMaxResultCountValue:function(q,C){C||(C=1E3);return!this._attributeSearchList&&this.config.maxResultCount&&this.config.maxResultCount<=C?q<this.config.maxResultCount?q:this.config.maxResultCount:q<C?q:C},_creatFeatureList:function(q){var C="",Y;var ka=X(".esriCTPanelHeader",this._panels.featureListPanel)[0];this._isNoFeature=!1;0<q.length&&(q=this._getSortedFeatureList(q),ka&&this._setItemCount(ka,q.length,!0));var qa=this._getMaxResultCountValue(q.length,this._selectedLayer.maxRecordCount);
if(1===qa)this._onSingleFeatureFound(q[0]);else{for(ka=0;ka<qa;ka++){C&&(C+=",");C+=q[ka].attributes[this._selectedLayer.objectIdField];var ua=Q.toDom(this._itemListTemplate).childNodes[0];m.add(ua,"esriCTFeatureListItem");ka===qa-1&&m.add(ua,"esriCTLastFeatureFocusNode");g.set(ua,"tabindex","0");g.set(ua,"role","button");g.set(ua,"aria-label",q[ka].getTitle());this._featureListContent.appendChild(ua);this._setItemName(ua,q[ka].getTitle()||"");this._attributeSearchList||!q[ka].geometry||q[ka].geometry&&
"polygon"===q[ka].geometry.type&&this.config.intersectSearchedLocation?(Y=X(".esriCTItemCount",ua)[0])&&m.remove(Y,"esriCTLoadingIcon"):q[ka].hasOwnProperty("distanceToLocation")&&this._setItemCount(ua,q[ka].distanceToLocation,!1);this._attachEventOnFeatureDiv(ua,q[ka])}this.parentDivId&&f.byId(this.parentDivId)&&f.byId(this.parentDivId).resize&&f.byId(this.parentDivId).resize();this._displayFilteredFeatures(C);this._showPanel("featureListPanel");E.focus(X(".esriCTItemlList[tabindex\x3d'0']",this._featureListContent)[0]);
this.loading.hide();1===qa&&ua.click()}},_displayFilteredFeatures:function(q){this.config.selectedSearchLayerOnly&&(this._showHideOperationalLayer(this._selectedLayer.url,this._selectedLayer.id,!0),this._selectedLayer.setDefinitionExpression(this._selectedLayer.objectIdField+" in ("+q+")"))},_setFilterOnMapLayer:function(q,C,Y,ka){C&&(ka?(C=C.substring(0,C.lastIndexOf("_")),(Y=this.map.getLayer(C))&&this.filterManager.applyWidgetFilter(C,this.id,q)):(Y=this.map.getLayer(C))&&this.filterManager.applyWidgetFilter(C,
this.id,q))},_resetFilter:function(q){var C=this._operationalLayers[q].isMapServer?this._operationalLayers[q].id.substring(0,this._operationalLayers[q].id.lastIndexOf("_")):this._operationalLayers[q].id;this.filterManager.getWidgetFilter(C,this.id)?(this._setFilterOnMapLayer("",this._operationalLayers[q].id,this._operationalLayers[q].url,this._operationalLayers[q].isMapServer),ta.getInstance(this.map,this.map.webMapResponse.itemInfo).then(y.hitch(this,function(Y){var ka;if(ka=Y.getLayerInfoById(C)){var qa=
ka.getFilter();!qa&&this._operationalLayers[q].isMapServer&&(ka=Y.getLayerInfoById(this._operationalLayers[q].id))&&(qa=ka.getFilter());this.config.searchLayers[q].definitionExpression=qa;this._operationalLayers[q].setDefinitionExpression(qa)}}))):this._operationalLayers[q]&&this.config.searchLayers[q]&&this._operationalLayers[q].setDefinitionExpression(this.config.searchLayers[q].definitionExpression)},_getSortedFeatureList:function(q){var C;var Y=this._canGetGeodesicDistance();for(C=0;C<q.length;C++)q[C].distanceToLocation=
this._attributeSearchList?q[C].getTitle().toLowerCase():Y&&q[C].geometry?this._getGeodesicDistances(q[C].geometry):this._selectedPoint&&q[C].geometry?ha.distance(this._selectedPoint.geometry,q[C].geometry,this.config.bufferDistanceUnit.distanceUnit):0;q.sort(function(ka,qa){return ka.distanceToLocation<qa.distanceToLocation?-1:ka.distanceToLocation>qa.distanceToLocation?1:0});return q},_canGetGeodesicDistance:function(){var q=new da(4326);return this.config.isGeodesic&&this._selectedPoint&&b.canProject(this._selectedPoint.geometry,
q)?!0:!1},_getGeodesicDistances:function(q){if(!this._selectedPoint)return 0;var C="point"===this._selectedPoint.geometry.type?this._selectedPoint.geometry:this._selectedPoint.geometry.getPoint(0,0);if("point"!==q.type)if((q=ha.nearestCoordinate(q,C))&&!q.isEmpty)q=q.coordinate;else return 0;var Y=new a([[C.x,C.y],[q.x,q.y]]);Y.setSpatialReference(C.spatialReference);C=new da(4326);if(b.canProject(q,C)){Y=b.project(Y,C);var ka=ha.geodesicLength(Y,this.config.bufferDistanceUnit.distanceUnit);isNaN(ka)&&
(ka=0)}return ka},_attachEventOnFeatureDiv:function(q,C){this.own(n(q,"click, keypress",y.hitch(this,function(Y){if("keypress"===Y.type&&(Y=Y.charCode||Y.keyCode,Y!==O.ENTER&&Y!==O.SPACE))return;this._isFeatureList=!0;(Y=X(".esriCTBackButton",this._panels.infoPanel)[0])&&l.set(Y,"display","block");this._showFeatureDetails(q,C)})))},_showFeatureDetails:function(q,C){this._setItemName(this._panels.infoPanel,this._selectedLayer.title,".esriCTPanelHeader");this._showPanel("infoPanel");var Y=X(".esriCTProximityParent",
this.domNode);Y&&0<Y.length&&(Y=Y[0],C.geometry?m.remove(Y,"esriCTHidden"):m.add(Y,"esriCTHidden"));this._tabContainer&&(this._tabContainer.selectTab(this.nls.informationTabTitle),!C.geometry||this._attributeSearchList?(l.set(this._tabContainer.controlNode,"display","none"),m.add(this._tabContainer.containerNode,"esriCTTopBorder")):(l.set(this._tabContainer.controlNode,"display","block"),m.remove(this._tabContainer.containerNode,"esriCTTopBorder")));this._selectedFeatureItem=q;this._selectedFeature=
C;this._clearDirections();this._highlightFeatureOnMap();this._displayFeatureInfo(C);this.parentDivId&&f.byId(this.parentDivId)&&f.byId(this.parentDivId).resize&&f.byId(this.parentDivId).resize()},_zoomToSelectedPointFeature:function(q){var C;this.config.searchSourceSettings&&this.config.searchSourceSettings.sources&&0<this.config.searchSourceSettings.sources.length&&R.some(this.config.searchSourceSettings.sources,y.hitch(this,function(Y){if(Y&&Y.layerId&&this._selectedLayer.id&&Y.layerId===this._selectedLayer.id)return C=
ma.getExtentForScale(this.map,Y.zoomScale).centerAt(q.geometry),!0}));C?this.map.setExtent(C):this.map.centerAndZoom(q.geometry,this.map.getMaxZoom()-1)},_displayFeatureInfo:function(q){var C;this._loadAttachmentTimer&&clearTimeout(this._loadAttachmentTimer);this._featureInfoPanel&&(this._featureInfoPanel.set("content",""),this._gallerySwiper=[],this._allContentPanes=[],this._attributeSearchList||!q.geometry||q.geometry&&"polygon"===q.geometry.type&&this.config.intersectSearchedLocation||this._addDistanceToLocationInDetailsPanel(q),
this._showPopupInfo(q,q._layer),this.config.attributeSymbology&&(C=this._getConfiguredSymbologyForLayer(this._selectedLayer.id))&&0<C.length&&this._checkAttributeSymbology(q,C));if(this.config.zoomToFeature)if(q.geometry&&"point"===q.geometry.type)if(C=q.geometry,this._selectedPoint){var Y=this._getPointFromGeometry(this._selectedPoint.geometry);C={paths:[[[C.x,C.y],[Y.x,Y.y]]],spatialReference:this.map.spatialReference};C=new a(C);this.map.setExtent(C.getExtent().expand(1.5))}else this._zoomToSelectedPointFeature(q);
else q.geometry&&this.map.setExtent(q.geometry.getExtent().expand(1.5));this._getRelatedRecords(q)},_addDistanceToLocationInDetailsPanel:function(q){if(q.hasOwnProperty("distanceToLocation")){q=oa.format(q.distanceToLocation.toFixed(2))+" "+this.nls.units[this.config.bufferDistanceUnit.value].acronym;q=Q.create("div",{innerHTML:aa.substitute(this.nls.approximateDistanceTitle,{DistanceToLocation:q}),"class":"esriCTDistanceToLocation"});var C=new e({style:{padding:"0px"}});C.set("content",q);this._featureInfoPanel.addChild(C)}},
_getRelatedRecords:function(q){R.forEach(this._selectedLayer.tableInfos,y.hitch(this,function(C){this._queryRelatedRecords(this._tables[C],q.attributes[this._selectedLayer.objectIdField])}))},_queryRelatedRecords:function(q,C){if(this._selectedLayer&&q){var Y=new B;Y.objectIds=[parseInt(C,10)];Y.outFields=["*"];Y.relationshipId=q.relationshipIds[this._selectedLayer.id];q.layerDefinition&&q.layerDefinition.definitionExpression&&(Y.definitionExpression=q.layerDefinition.definitionExpression);this._selectedLayer.queryRelatedFeatures(Y,
y.hitch(this,function(ka){ka=ka[C];R.forEach(ka?ka.features:[],y.hitch(this,function(qa){qa.setInfoTemplate(new N(q.popupInfo));this._showPopupInfo(qa,this._tablesLayer[q.id])}));this.parentDivId&&f.byId(this.parentDivId)&&f.byId(this.parentDivId).resize&&f.byId(this.parentDivId).resize()}))}},_showPopupInfo:function(q,C){if(this._featureInfoPanel&&q){q._layer||(q._layer=C);q._layer._map||(q._layer._map=this.map);var Y=new e({"class":"esriCTPopupInfo"});var ka=q.getContent();var qa=f.byId(ka.id);
Y.set("content",ka);this.own(n(qa,"content-update",y.hitch(this,function(){this._getFeatureInfoLastNode()})));this._allContentPanes.push(Y);this._featureInfoPanel.addChild(Y);this._checkAttachments(qa,q,C)}},_checkAttachments:function(q,C,Y){m.add(X(".mediaSection",q.domNode)[0],"esriCTHidden");var ka=X(".attachmentsSection",q.domNode)[0];Q.empty(ka);m.remove(ka,"hidden");Y.hasAttachments&&Y.showAttachments?(this.loading.show(),this._loadAttachmentTimer=setTimeout(y.hitch(this,function(){this._showAttachments(C,
ka,Y,q)}),500)):this._createGallery(Y,ka,[],q)},_showAttachments:function(q,C,Y,ka){this.config.showImageGallery?(q=q.attributes[Y.objectIdField],Q.empty(C),Y.queryAttachmentInfos(q,y.hitch(this,function(qa){this.loading.hide();this._createGallery(Y,C,qa,ka);this.parentDivId&&f.byId(this.parentDivId)&&f.byId(this.parentDivId).resize&&f.byId(this.parentDivId).resize()}))):(this.loading.hide(),m.add(C,"esriCTHidden"),this._getFeatureInfoLastNode())},resetGallery:function(){"infoPanel"===this._currentPanelName&&
(!this._tabContainer||this._tabContainer&&this._tabContainer.selected===this.nls.informationTabTitle)&&this._gallerySwiper&&(R.forEach(this._gallerySwiper,function(q){q&&(q.update(),q.slideReset())},this),this._getFeatureInfoLastNode())},_createGallery:function(q,C,Y,ka){var qa;this._clearMediaRefreshTimers();this.config.showImageGallery&&(Y=this._checkForHyperlinks(Y,this._selectedFeature));var ua=Y.length,Ba=[];if(Y&&0<Y.length||q&&q.infoTemplate&&q.infoTemplate.info&&q.infoTemplate.info.mediaInfos&&
0<q.infoTemplate.info.mediaInfos.length){q.infoTemplate&&q.infoTemplate.info&&q.infoTemplate.info.mediaInfos&&(ua+=q.infoTemplate.info.mediaInfos.length);this.loading.show();q=Q.create("div",{"class":"esriCTThumbnailContainer"},C);Q.create("div",{style:{clear:"both"}},q);var Ka=Q.toDom(Aa);var Qa=X(".swiper-wrapper",Ka)[0];var Sa=!1;if(Y&&0<Y.length)for(q=0;q<Y.length;q++)if(0>Ba.indexOf(Y[q].url))if(Ba.push(Y[q].url),-1!==Y[q].contentType.indexOf("image")&&Y[q].contentType.match(/(\/tiff)/)&&(Y[q].contentType=
"application/tiff"),Y[q].contentType&&-1<Y[q].contentType.indexOf("image")){var Ua=Q.create("div",{"class":"swiper-slide"},Qa);var Xa=Q.create("img",{alt:Y[q].name,"class":"esriCTAttachmentImg",src:Y[q].url},Ua);this._attachEventOnImage(Xa,null);Sa=!0}else Y[q].contentType&&-1<Y[q].contentType.toLowerCase().indexOf("video/mp4")?(Ua=Q.create("div",{"class":"swiper-slide"},Qa),Xa=Q.toDom('\x3cvideo class\x3d"esriCTVideoElement" src\x3d"'+Y[q].url+'" height\x3d"auto" width\x3d"100%" controls\x3e\x3csource src\x3d"'+
Y[q].url+'" type\x3d"'+Y[q].contentType+'" poster\x3d"'+Y[q].url+'"\x3e\x3c/video\x3e'),Q.place(Xa,Ua),Sa=!0):(Ua=Q.create("div",{"class":"esriCTNonImageAttachmentContainer",tabindex:"0","aria-label":Y[q].name,role:"button",src:Y[q].url},C),Xa=this.folderUrl+"images/no-attachment.png",Xa=Q.create("img",{alt:"","class":"esriCTNonImageAttachmentImg esriCTAutoHeight",src:Xa},Ua),Xa=Q.create("div",{"class":"esriCTImageFormatDiv"},Ua),this._fetchDocumentContentType(Y[q],Xa),this._attachEventOnImage(Ua,
null));this._charts=[];this._checkMediaInfos(Qa,ka,Ba).then(y.hitch(this,function($a){if(Sa||$a)Q.place(Ka,C),qa=new va(Ka,{height:"250px",pagination:".swiper-pagination",nextButton:".swiper-button-next",prevButton:".swiper-button-prev",slidesPerView:1,paginationClickable:!0,spaceBetween:30,loop:!0,a11y:!0}),this.own(n(qa,"onSlideChangeStart",y.hitch(this,function(){R.forEach(X(".esriCTVideoElement",Qa),y.hitch(this,function(Ya){Ya.pause()}))}))),this.own(n(qa,"imagesReady",y.hitch(this,function(){R.forEach(X(".swiper-slide-duplicate",
Qa),y.hitch(this,function(Ya){var Wa;(Wa=X(".esriCTAttachmentImg",Ya))&&0<Wa.length&&(Wa=Wa[0],Ya=g.get(Wa,"refreshInterval"),this._attachEventOnImage(Wa,Ya))}))}))),R.forEach(this._charts,y.hitch(this,function(Ya){Ya.resize(200,200)})),1===ua&&(qa.nextButton&&0<qa.nextButton.length&&m.add(qa.nextButton[0],"esriCTHidden"),qa.prevButton&&0<qa.prevButton.length&&m.add(qa.prevButton[0],"esriCTHidden"),qa.lockSwipes());this.loading.hide();this._gallerySwiper.push(qa);this._getFeatureInfoLastNode()}))}else this._gallerySwiper.push(null),
this._getFeatureInfoLastNode()},_getFeatureInfoLastNode:function(){var q;if("block"===l.get(this.proximityButton.parentElement,"display"))var C=this.proximityButton;if(!C)for(var Y=this._allContentPanes.length-1;0<=Y&&((q=X(".swiper-pagination-bullet",this._allContentPanes[Y].domNode))&&0<q.length?C=q.reverse()[0]:(q=H.getFocusNodesInDom(this._allContentPanes[Y].domNode))&&0<q.length&&(C=q.reverse()[0]),!C);Y--);!C&&this._featureInfoPanel&&this._featureInfoPanel.domNode&&(C=this._featureInfoPanel.domNode);
if(!C&&(C=this._getInformationTabAsLastFocusNode()))return;C||(C=X(".esriCTItemListMainContainer .esriCTDirectionInfoPanel .esriCTPanelHeader",this.domNode.parentElement)[0]);this.emit("setLastNodeInFeatureInfo",C)},_checkForHyperlinks:function(q,C){var Y;var ka=[];ka=C.attributes;for(Y in ka)ka.hasOwnProperty(Y)&&ka[Y]&&String(ka[Y]).match(/^(http(s?):)/)&&(String(ka[Y]).match(/\.(png|jpg|jpeg|gif|bmp)(\/|$)/i)?(C={},C.contentType="image/"+String(ka[Y]).match(/\.(png|jpg|jpeg|gif|bmp)(\/|$)/i)[1],
C.url=ka[Y],q.push(C)):String(ka[Y]).match(/\.(mp4)(\/?)/i)&&(C={contentType:"video/mp4"},C.url=ka[Y],q.push(C)));return q},_checkMediaInfos:function(q,C,Y){var ka,qa;var ua=new h;var Ba=[];if(C._mediaInfos&&0<C._mediaInfos.length)var Ka=C._mediaInfos;else C&&C.template.info&&C.template.info.mediaInfos&&0<C.template.info.mediaInfos.length&&(Ka=C.template.info.mediaInfos);Ka&&C._mediaInfos&&0<C._mediaInfos.length?setTimeout(y.hitch(this,function(){for(var Qa=0;Qa<Ka.length;Qa++){var Sa=Ka[Qa],Ua=0;
("image"===Sa.type||"image"!==Sa.type&&Sa.value.fields&&0<Sa.value.fields.length)&&0>Y.indexOf(Sa.value.sourceURL)&&(Y.push(Sa.value.sourceURL),ka=Q.create("div",{"class":"swiper-slide"},q),"image"===Sa.type?(Sa.hasOwnProperty("refreshInterval")&&(Ua=Sa.refreshInterval),qa=Q.create("img",{alt:Sa.value.sourceURL,"class":"esriCTAttachmentImg",src:Sa.value.sourceURL,refreshInterval:Ua},ka),Ua&&g.set("refreshInterval",Ua),this._attachEventOnImage(qa,Ua)):Ba.push(this._loadMediaCharts(C,Sa,ka)))}0<Ba.length?
I(Ba).then(y.hitch(this,function(){ua.resolve(!0)})):ua.resolve(!0)}),1E3):ua.resolve(!1);return ua.promise},_loadMediaCharts:function(q,C,Y){var ka=new h,qa=this,ua=["dojox/charting/Chart2D","dojox/charting/action2d/Tooltip"];q=C.value.theme||q.chartTheme;y.isString(q)&&(q=q.replace(/\./gi,"/"),-1===q.indexOf("/")&&(q="dojox/charting/themes/"+q));q||(q="esri/dijit/Rainbow");ua.push(q);try{V(ua,function(Ba,Ka,Qa){qa._createChart(Y,C,Ba,Ka,Qa).then(y.hitch(this,function(){ka.resolve()}))})}catch(Ba){ka.resolve()}return ka.promise},
_createChart:function(q,C,Y,ka,qa){var ua=C.type;var Ba=C.value;C=new h;Y=new Y(Q.create("div",{"class":"chart"},q));qa&&Y.setTheme(qa);switch(ua){case "piechart":Y.addPlot("default",{type:"Pie",labels:!1});Y.addSeries("Series A",Ba.fields);break;case "linechart":Y.addPlot("default",{type:"Markers"});Y.addAxis("x",{min:0,majorTicks:!1,minorTicks:!1,majorLabels:!1,minorLabels:!1});Y.addAxis("y",{includeZero:!0,vertical:!0,fixUpper:"minor"});R.forEach(Ba.fields,function(Ka,Qa){Ka.x=Qa+1});Y.addSeries("Series A",
Ba.fields);break;case "columnchart":Y.addPlot("default",{type:"Columns",gap:3});Y.addAxis("y",{includeZero:!0,vertical:!0,fixUpper:"minor"});Y.addSeries("Series A",Ba.fields);break;case "barchart":Y.addPlot("default",{type:"Bars",gap:3}),Y.addAxis("x",{includeZero:!0,fixUpper:"minor",minorLabels:!1}),Y.addAxis("y",{vertical:!0,majorTicks:!1,minorTicks:!1,majorLabels:!1,minorLabels:!1}),Y.addSeries("Series A",Ba.fields)}new ka(Y);Y.render();this._charts.push(Y);C.resolve();return C.promise},_fetchDocumentContentType:function(q,
C){q=(q=/(?:\.([^.]+))?$/.exec(q.name))&&q[1]?"."+q[1].toUpperCase():this.nls.unknownAttachmentExt;g.set(C,"innerHTML",q)},_attachEventOnImage:function(q,C){this.own(n(q,"click",y.hitch(this,function(){this._displayImageAttachments(q,!1)})));this.own(n(q,"keydown",y.hitch(this,function(Y){this._displayImageAttachments(q,!0,Y)})));C&&(C*=6E4,C=setInterval(y.hitch(this,function(){q.setAttribute("src",q.alt+"?"+Math.random())}),C),this._mediaRefreshTimers.push(C))},_clearMediaRefreshTimers:function(){this._mediaRefreshTimers&&
R.forEach(this._mediaRefreshTimers,function(q){clearInterval(q)});this._mediaRefreshTimers=[]},_displayImageAttachments:function(q,C,Y){C&&Y.keyCode!==O.ENTER&&Y.keyCode!==O.SPACE||window.open(g.get(q,"src"))},_onImageLoad:function(q){m.remove(q.target.parentNode,"esriCTImageLoader");this._setImageDimensions(q.target)},_setImageDimensions:function(q){var C=q.parentElement;if(q&&0<q.offsetHeight){g.set(q,"originalHeight",q.offsetHeight);l.set(q,"maxHeight",q.offsetHeight+"px");l.set(q,"maxWidth",q.offsetWidth+
"px");var Y=parseFloat(g.get(q,"originalHeight"));if(C.offsetHeight<q.offsetHeight||Y>C.offsetHeight)Y=q.offsetWidth/q.offsetHeight,C=C.offsetHeight-2,Y=Math.floor(C*Y),m.remove(q,"esriCTAutoHeight"),l.set(q,"width",Y+"px"),l.set(q,"height",C+"px")}},_onError:function(q){m.remove(q.target.parentNode,"esriCTImageLoader")},_setSearchedLocation:function(q){this._selectedPoint=q},_setServiceArea:function(q){this._serviceArea=q},clearResultPanel:function(){this._isFeatureList=!1;this._clearContent(this._panels.layerListPanel);
l.set(this._panels.layerListPanel,"display","none");l.set(this._panels.featureListPanel,"display","none");l.set(this._panels.infoPanel,"display","none");this._clearContent(this._featureListContent);this._clearDirections();this._clearGrahics()},removeGraphicsLayer:function(){this._featureGraphicsLayer&&(this.map.removeLayer(this._featureGraphicsLayer),this._featureGraphicsLayer=null)},_clearGrahics:function(){this._featureGraphicsLayer&&this._featureGraphicsLayer.clear()},_showPanel:function(q,C){l.set(this._panels[q],
{display:"block",left:"-100%"});C?(this._slide(this._panels[q],-100,0),this._slide(this._currentPanel,0,100)):(this._slide(this._currentPanel,0,-100),this._slide(this._panels[q],100,0));this._currentPanelName=q;this._currentPanel=this._panels[q];this.parentDivId&&f.byId(this.parentDivId)&&f.byId(this.parentDivId).resize&&f.byId(this.parentDivId).resize();setTimeout(y.hitch(this,function(){this.emit("setLastNode",q)}),400)},_slide:function(q,C,Y){l.set(q,"display","block");l.set(q,"left",C+"%");ra.animateProperty({node:q,
properties:{left:{start:C,end:Y,units:"%"}},duration:300,onEnd:y.hitch(this,function(){l.set(q,"left",Y);0===Y?l.set(q,"display","block"):l.set(q,"display","none");this._isSlide=!0})}).play()},_showMessage:function(q){(new K({message:q})).message=q},_initializeDirectionWidget:function(){if(!this._directionsWidget){f.byId("directionDijit"+this.id)&&f.byId("directionDijit"+this.id).destroy();var q={id:"directionDijit"+this.id,map:this.map,directionsLengthUnits:ca[this.config.directionLengthUnit.routeUnit],
showTrafficOption:!1,dragging:!1,routeTaskUrl:this.config.routeService,routeSymbol:new ja(this.config.symbols.routeSymbol)};this._directionsWidget=new U(q,Q.create("div",{},null));this._directionsWidget.startup();this.own(this._directionsWidget.on("directions-finish",y.hitch(this,function(){this._directionsWidget.zoomToFullRoute();this.parentDivId&&f.byId(this.parentDivId)&&f.byId(this.parentDivId).resize&&f.byId(this.parentDivId).resize();this.loading.hide();"block"===l.get(this.proximityButton.parentElement,
"display")?H.initLastFocusNode(this.domNodeObj,this.proximityButton):this.emit("setLastNodeInFeatureInfo",H.getFocusNodesInDom(this._directionsWidget.domNode).reverse()[0])})));this._directionInfoPanel.set("content",this._directionsWidget.domNode)}this._routeSelectedLocations()},_clearDirections:function(){this._directionsWidget&&this._routeCalculated&&this._directionsWidget.clearDirections();this._routeCalculated=!1},_getPointFromGeometry:function(q){switch(q.type){case "extent":var C=q.getCenter();
break;case "multipoint":C=q.getPoint(0);break;case "point":C=q;break;case "polygon":C=q.getCentroid();break;case "polyline":C=q.getPoint(0,0)}return C},_routeSelectedLocations:function(){var q=[];this._clearDirections();this._selectedPoint&&this._selectedFeature&&this._selectedFeature.geometry&&(this.loading.show(),q.push(this._getPointFromGeometry(this._selectedPoint.geometry)),q.push(this._getPointFromGeometry(this._selectedFeature.geometry)),this._directionsWidget.updateStops(q).then(y.hitch(this,
function(){this._directionsWidget.getDirections();this._routeCalculated=!0}),y.hitch(this,function(){this.loading.hide();this._showMessage(this.nls.failedToGenerateRouteMsg)})))},_highlightFeatureOnMap:function(){var q;this._clearGrahics();this._selectedFeature&&this._selectedFeature.geometry&&(q=this._getHighLightSymbol(this._selectedFeature,this._selectedLayer))&&q.geometry&&this._featureGraphicsLayer.add(q)},_getHighLightSymbol:function(q,C){switch(q.geometry.type){case "point":case "multipoint":return this._getPointSymbol(q,
C);case "polyline":return this._getPolyLineSymbol(q,C);case "polygon":return this._getPolygonSymbol(q)}},_getHighLightSymbolColor:function(){var q=new T([0,255,255,1]);this.config.highlightColor&&(q=new T(this.config.highlightColor),this.config.hasOwnProperty("showSelectionColor")||(this.config.showSelectionColor=!0),q.a=this.config.showSelectionColor?1:0);return q},_getPointSymbol:function(q,C){var Y,ka;var qa=!1;var ua=this._getHighLightSymbolColor();ua=new J(J.STYLE_SQUARE,null,new ja(ja.STYLE_SOLID,
ua,3));ua.setColor(null);ua.size=30;if(C&&C.renderer)if(C.renderer.symbol)qa=!0,ua=this._updatePointSymbolProperties(ua,C.renderer.symbol);else if(C.renderer.infos&&0<C.renderer.infos.length){for(ka=0;ka<C.renderer.infos.length;ka++){C.typeIdField?Y=q.attributes[C.typeIdField]:C.renderer.attributeField&&(Y=q.attributes[C.renderer.attributeField]);var Ba=C.renderer.infos[ka].value;void 0!==Y&&null!==Y&&""!==Y&&void 0!==Ba&&null!==Ba&&""!==Ba&&Y.toString()===Ba.toString()&&(qa=!0,ua=this._updatePointSymbolProperties(ua,
C.renderer.infos[ka].symbol))}!qa&&C.renderer.defaultSymbol&&(qa=!0,ua=this._updatePointSymbolProperties(ua,C.renderer.defaultSymbol))}if(q.geometry&&"point"===q.geometry.type)var Ka=new F(q.geometry.x,q.geometry.y,new da({wkid:q.geometry.spatialReference.wkid}));else q.geometry&&"multipoint"===q.geometry.type&&(Ka=new v(new da({wkid:q.geometry.spatialReference.wkid})),q.geometry.points&&R.forEach(q.geometry.points,function(Qa){Ka.addPoint(Qa)}));return new S(Ka,ua,q.attributes)},_updatePointSymbolProperties:function(q,
C){if(C.hasOwnProperty("height")&&C.hasOwnProperty("width")){var Y=C.height;var ka=C.width;Y=(Y>ka?Y:ka)+10;q.size=Y}C.hasOwnProperty("size")&&(!Y||Y<C.size)&&(q.size=C.size+10);C.hasOwnProperty("xoffset")&&(q.xoffset=C.xoffset);C.hasOwnProperty("yoffset")&&(q.yoffset=C.yoffset);return q},_getPolyLineSymbol:function(q,C){var Y,ka;var qa=5;var ua=this._getHighLightSymbolColor();if(C&&C.renderer)if(C.renderer.symbol&&C.renderer.symbol.hasOwnProperty("width"))qa=C.renderer.symbol.width;else if(C.renderer.infos&&
0<C.renderer.infos.length)for(ka=0;ka<C.renderer.infos.length;ka++){C.typeIdField?Y=q.attributes[C.typeIdField]:C.renderer.attributeField&&(Y=q.attributes[C.renderer.attributeField]);var Ba=C.renderer.infos[ka].value;void 0!==Y&&null!==Y&&""!==Y&&void 0!==Ba&&null!==Ba&&""!==Ba&&Y.toString()===Ba.toString()&&C.renderer.infos[ka].symbol.hasOwnProperty("width")&&(qa=C.renderer.infos[ka].symbol.width)}else C.renderer.defaultSymbol&&C.renderer.defaultSymbol.hasOwnProperty("width")&&(qa=C.renderer.defaultSymbol.width);
C=new ja(ja.STYLE_SOLID,ua,qa);qa=new a(new da({wkid:q.geometry.spatialReference.wkid}));q.geometry.paths&&0<q.geometry.paths.length&&qa.addPath(q.geometry.paths[0]);return new S(qa,C,q.attributes)},_getPolygonSymbol:function(q){var C=this._getHighLightSymbolColor();C=new la(la.STYLE_SOLID,new ja(ja.STYLE_SOLID,C,4),new T([0,0,0,0]));var Y=new D(new da({wkid:q.geometry.spatialReference.wkid}));q.geometry.rings&&(Y.rings=y.clone(q.geometry.rings));return new S(Y,C,q.attributes)},_hideAllLayers:function(){if(this.config.selectedSearchLayerOnly){var q;
for(q=0;q<this.config.searchLayers.length;q++)this._showHideOperationalLayer(this.config.searchLayers[q].url,this.config.searchLayers[q].id,!1)}},showAllLayers:function(q){var C;for(C=0;C<this.config.searchLayers.length;C++){var Y=q?this.config.searchLayers[C].visibility:!0;this.config.selectedSearchLayerOnly&&this._searchedFeatures[this.config.searchLayers[C].id]&&1>this._searchedFeatures[this.config.searchLayers[C].id].length&&(Y=!1);this._showHideOperationalLayer(this.config.searchLayers[C].url,
this.config.searchLayers[C].id,Y)}},showLayersOnBackToLayerList:function(){var q;for(q=0;q<this.config.searchLayers.length;q++){var C=this.config.selectedSearchLayerOnly?this._searchedFeatures[this.config.searchLayers[q].id]&&0<this._searchedFeatures[this.config.searchLayers[q].id].length?!0:!1:!0;this._showHideOperationalLayer(this.config.searchLayers[q].url,this.config.searchLayers[q].id,C)}},_showHideOperationalLayer:function(q,C,Y){var ka;var qa=q.split("/");qa=qa[qa.length-1];for(ka in this.map._layers)if(this.map._layers.hasOwnProperty(ka))if(C&&
this.map._layers[ka].url===q&&this.map._layers[ka].id===C)this.map._layers[ka].setVisibility(Y);else if(this.map._layers[ka].visibleLayers&&C&&this.map._layers[ka].id===C.substring(0,C.lastIndexOf("_"))){var ua=this.map._layers[ka].url[this.map._layers[ka].url.length-1];ua="/"===ua?this.map._layers[ka].url+qa:this.map._layers[ka].url+"/"+qa;if(ua===q){ua=this.map._layers[ka].visibleLayers;var Ba=R.indexOf(ua,parseInt(qa,10));Y?-1===Ba&&ua.push(parseInt(qa,10)):-1!==Ba&&ua.splice(Ba,1);this.map._layers[ka].setVisibleLayers?
this.map._layers[ka].setVisibleLayers(ua):(this.map._layers[ka].visibleLayers=ua,this.map._layers[ka].setVisibility(Y))}}},_getConfiguredSymbologyForLayer:function(q){var C=[];if(this.config.attributeSymbology&&this.config.attributeSymbology.hasOwnProperty(q))return this.config.attributeSymbology[q];this.config.attributeSymbology&&this.config.attributeSymbology.length&&0<this.config.attributeSymbology.length&&R.forEach(this.config.attributeSymbology,y.hitch(this,function(Y){Y.hasOwnProperty("layerId")&&
Y.layerId===q&&C.push(Y)}));return C},_checkAttributeSymbology:function(q,C){var Y;if(Y=X(".attachmentsSection",this._featureInfoPanel.domNode)[0]){var ka=Q.create("div",{"class":"esriCTAttributeSymbolWrapper"},null);Q.place(ka,Y,"before")}R.forEach(C,y.hitch(this,function(qa){q.attributes.hasOwnProperty(qa.fieldName)&&q.attributes[qa.fieldName]===qa.fieldValue&&this._createAttributeSymbol(qa,ka)}))},_createAttributeSymbol:function(q,C){var Y=P.fromJson(q.symbol);q=this._selectedLayer.getField(q.fieldName);
C=Q.create("div",{"class":"esriCTAttributeSymbolContainer",title:q&&q.alias?q.alias:""},C);Y=d.createSymbolNode(Y);Q.place(Y,C)},resetIconColors:function(){this._filterIcon&&l.set(this._filterIcon,"background-color",this.selectedThemeColor);this._proximityIcon&&l.set(this._proximityIcon,"background-color",this.selectedThemeColor)},_attachEventToTab:function(){""!==this._tabContainer&&null!==this._tabContainer&&void 0!==this._tabContainer&&this._tabContainer.controlNodes&&1<this._tabContainer.controlNodes.length&&
this.own(n(this._tabContainer.controlNodes[1],"keydown",y.hitch(this,function(q){q.keyCode===O.TAB&&!q.shiftKey&&this._tabContainer.viewStack&&this._tabContainer.viewStack.getSelectedLabel()===this.nls.informationTabTitle&&(this.config.enableProximitySearch?(xa.stop(q),E.focus(this.proximityButton)):(xa.stop(q),this.emit("setFocusOnFirstFocusableNode")))})))},_getInformationTabAsLastFocusNode:function(){if(""!==this._tabContainer&&null!==this._tabContainer&&void 0!==this._tabContainer&&this._tabContainer.viewStack&&
this._tabContainer.viewStack.getSelectedLabel()===this.nls.informationTabTitle&&this._tabContainer.controlNodes&&0<this._tabContainer.controlNodes.length){var q=this._tabContainer.controlNodes[0];if(!this.config.enableProximitySearch)return H.initLastFocusNode(this.domNodeObj,q),!0}return!1}})})},"esri/dijit/Directions":function(){define("require dojo/_base/declare dojo/_base/lang dojo/_base/kernel dojo/_base/array dojo/_base/Color dijit/a11yclick dijit/_TemplatedMixin dijit/form/Select dijit/form/ValidationTextBox dijit/form/DateTextBox dijit/form/TimeTextBox dojo/store/Memory dojo/data/ObjectStore dojo/keys dojo/has dojo/on dojo/mouse dojo/dom dojo/dom-geometry dojo/dom-style dojo/dom-class dojo/dom-attr dojo/query dojo/number dojo/i18n!../nls/jsapi dojo/text!./templates/Directions.html ./Search dojo/dom-construct dojo/promise/all dojo/Deferred dojo/dnd/Source dojo/json ../kernel ../urlUtils ../graphic ../units ../TimeExtent ../InfoTemplate ../SpatialReference ../layers/ArcGISDynamicMapServiceLayer ../layers/GraphicsLayer ../geometry/webMercatorUtils ../geometry/geodesicUtils ../arcgis/utils ../geometry/Point ../geometry/Extent ../geometry/Polyline ../geometry/mathUtils ../symbols/SimpleMarkerSymbol ../symbols/PictureMarkerSymbol ../symbols/CartographicLineSymbol ../symbols/TextSymbol ../renderers/UniqueValueRenderer ../symbols/Font ./_EventedWidget ../tasks/FeatureSet ../tasks/RouteTask ../tasks/RouteParameters ../tasks/GeometryService ../tasks/DistanceParameters ../tasks/PrintTask ../tasks/PrintParameters ../tasks/PrintTemplate ../toolbars/edit ../toolbars/draw ../config ../tasks/ProjectParameters dojo/uacss".split(" "),
function(V,W,t,Q,X,R,H,y,e,g,l,m,n,h,x,I,K,w,L,T,U,N,S,F,a,D,da,ha,ia,na,P,la,ja,J,z,B,ca,ra,oa,ta,za,b,f,G,r,d,v,O,E,aa,ma,va,Aa,xa,q,C,Y,ka,qa,ua,Ba,Ka,Qa,Sa,Ua,Xa,$a,Ya){var Wa=z.getProtocolForWebResource(),cb=ha.createSubclass({_setSourcesAttr:function(c){c&&(c=c.map(function(k){k.locator&&null==k.locationType&&(k=t.mixin({locationType:"street"},k));return k}));this.inherited(arguments,[c])}});W=W("esri.dijit.Directions",[C,y],{templateString:da,mapClickActive:!1,barrierToolActive:!1,_eventMap:{activate:!0,
deactivate:!1,load:!0,"directions-start":!0,"directions-finish":["result"],"directions-clear":!0,"segment-select":["graphic"],"segment-highlight":["graphic"],error:["error"],"stops-update":["stops"],"route-item-created":!0,"route-item-updated":!0,"feature-collection-created":!0},_emptyStop:{name:""},constructor:function(c,k){if(!c.map)throw Error('Required "map" parameter is missing. Cannot instantiate Directions Widget.');if(!k)throw Error('Required "srcNodeRef" parameter is missing. Cannot instantiate Directions Widget.');
this._i18n=D;this._css={widgetContainerClass:"esriDirectionsContainer",searchSourceContainerClass:"esriSearchSourceContainer",stopsContainerClass:"esriStopsContainer",stopsTableContainerClass:"esriStopsTableContainer",stopsTableCoverClass:"esriStopsTableCover",reverseStopsClass:"esriStopsReverse",addStopsClass:"esriStopsAdd",stopsClass:"esriStops",stopsRemovableClass:"esriStopsRemovable",stopsButtonContainerClass:"esriStopsButtons",stopsOptionsButtonClass:"esriStopsOptionsButton",stopsAddDestinationClass:"esriStopsAddDestination",
stopsAddDestinationBtnClass:"esriStopsAddDestinationBtn",stopsGetDirectionsContainerClass:"esriStopsGetDirectionsContainer",stopsGetDirectionsClass:"esriStopsGetDirections",stopsClearDirectionsClass:"esriStopsClearDirections",stopsInnerGeocoderClass:"esriInnerGeocoder",stopsOptionsOptionsEnabledClass:"esriStopsOptionsEnabled",stopsOptionsMenuClass:"esriStopsOptionsMenu",stopsFindOptimalOrderClass:"esriFindOptimalOrderOption",stopsUseTrafficClass:"esriUseTrafficOption",stopsReturnToStartClass:"esriReturnToStartOption",
stopsOptionsCheckboxesClass:"esriOptionsCheckboxes",stopsOptionsToggleContainerClass:"esriOptionsToggleContainer",stopsOptionsUnitsContainerClass:"esriOptionsUnitsContainer",stopsOptionsUnitsMiClass:"esriOptionsUnitsMi",stopsOptionsUnitsKmClass:"esriOptionsUnitsKm",stopsOptionsImpedanceContainerClass:"esriOptionsImpedanceContainer",stopsOptionsImpedanceTimeClass:"esriOptionsImpedanceTime",stopsOptionsImpedanceDistanceClass:"esriOptionsImpedanceDistance",stopClass:"esriStop",stopOriginClass:"esriStopOrigin",
stopDestinationClass:"esriStopDestination",stopUnreachedFirstOrLastClass:"esriStopUnreachedFirstOrLast",stopUnreachedClass:"esriStopUnreached",esriStopGeocoderColumnClass:"esriStopGeocoderColumn",esriStopReverseColumnClass:"esriStopReverseColumn",stopDnDHandleClass:"esriStopDnDHandle",stopDnDHandleClassHidden:"esriStopDnDHandleHidden",stopIconColumnClass:"esriStopIconColumn",stopIconClass:"esriStopIcon",stopIconRemoveColumnClass:"esriStopIconRemoveColumn",stopIconRemoveClass:"esriStopIconRemove",
stopIconRemoveClassHidden:"esriStopIconRemoveHidden",resultsContainerClass:"esriResultsContainer",resultsLoadingClass:"esriResultsLoading",resultsPrintClass:"esriResultsPrint",resultsSaveClass:"esriResultsSave",resultsSummaryClass:"esriResultsSummary",routesContainerClass:"esriRoutesContainer",routesClass:"esriRoutes",routesErrorClass:"esriRoutesError",routesInfoClass:"esriRoutesInfo",routeClass:"esriRoute",routeTextColumnClass:"esriRouteTextColumn",routeTextClass:"esriRouteText",routeLengthClass:"esriRouteLength",
routeOriginClass:"esriDMTStopOrigin",routeDestinationClass:"esriDMTStopDestination",routeInfoClass:"esriRouteInfo",routeIconColumnClass:"esriRouteIconColumn",routeIconClass:"esriRouteIcon",infoWindowRouteClass:"esriInfoWindowRoute",routeZoomClass:"esriRouteZoom",esriPrintPageClass:"esriPrintPage",esriPrintBarClass:"esriPrintBar",esriPrintButtonClass:"esriPrintButton",esriCloseButtonClass:"esriCloseButton",esriPrintMainClass:"esriPrintMain",esriPrintHeaderClass:"esriPrintHeader",esriPrintLogoClass:"esriPrintLogo",
esriPrintMapClass:"esriPrintMap",esriPrintNameClass:"esriPrintName",esriPrintNotesClass:"esriPrintNotes",esriPrintLengthClass:"esriPrintLength",esriPrintDirectionsClass:"esriPrintDirections",esriPrintFooterClass:"esriPrintFooter",esriPrintStopLabelClass:"esriPrintStopLabel",clearClass:"esriClear",dndDragBodyClass:"esriDndDragDirection",stopsButtonClass:"esriDirectionsButton",stopsButtonTabClass:"esriDirectionsTabButton",stopsButtonTabLastClass:"esriDirectionsTabLastButton",stopsPressedButtonClass:"esriDirectionsPressedButton",
linkButtonClass:"esriLinkButton",activateButtonClass:"esriActivateButton",lineBarrierButtonClass:"esriLineBarrierButton",travelModesContainerClass:"esriTravelModesContainer"};this.options={map:null,autoSolve:!0,minStops:2,maxStops:20,theme:"simpleDirections",alphabet:"1234567890",directions:null,returnToStart:!1,optimalRoute:!1,routeTaskUrl:Wa+"//route.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World",printTaskUrl:Wa+"//utility.arcgisonline.com/arcgis/rest/services/Utilities/PrintingTools/GPServer/Export%20Web%20Map%20Task",
geometryTaskUrl:Wa+"//utility.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer",routeParams:{},stops:["",""],searchOptions:{},stopsInfoTemplate:new oa(D.widgets.directions.stop,"${address}${error}"),waypointInfoTemplate:new oa(D.widgets.directions.maneuver,D.widgets.directions.waypoint),segmentInfoTemplate:new oa(D.widgets.directions.maneuver,'\x3cdiv class\x3d"${maneuverType}"\x3e\x3cdiv class\x3d"'+this._css.routeIconClass+" "+this._css.infoWindowRouteClass+'"\x3e\x3cstrong\x3e${step}.\x3c/strong\x3e ${formattedText}\x3c/div\x3e\x3c/div\x3e'),
textSymbolFont:new q("11px",q.STYLE_NORMAL,q.VARIANT_NORMAL,q.WEIGHT_NORMAL,"Arial, Helvetica, sans-serif"),textSymbolColor:new R([255,255,255]),textSymbolOffset:{x:0,y:10.875},fromSymbol:(new ma({url:V.toUrl("./images/Directions/greenPoint.png"),height:21.75,width:15.75,type:"esriPMS"})).setOffset(0,10.875),fromSymbolDrag:(new ma({url:V.toUrl("./images/Directions/greenPointMove.png"),height:21.75,width:15.75,type:"esriPMS"})).setOffset(0,10.875),stopSymbol:(new ma({url:V.toUrl("./images/Directions/bluePoint.png"),
height:21.75,width:15.75,type:"esriPMS"})).setOffset(0,10.875),stopSymbolDrag:(new ma({url:V.toUrl("./images/Directions/bluePointMove.png"),height:21.75,width:15.75,type:"esriPMS"})).setOffset(0,10.875),toSymbol:(new ma({url:V.toUrl("./images/Directions/redPoint.png"),height:21.75,width:15.75,type:"esriPMS"})).setOffset(0,10.875),toSymbolDrag:(new ma({url:V.toUrl("./images/Directions/redPointMove.png"),height:21.75,width:15.75,type:"esriPMS"})).setOffset(0,10.875),unreachedSymbol:(new ma({url:V.toUrl("./images/Directions/grayPoint.png"),
height:21.75,width:15.75,type:"esriPMS"})).setOffset(0,10.875),unreachedSymbolDrag:(new ma({url:V.toUrl("./images/Directions/grayPointMove.png"),height:21.75,width:15.75,type:"esriPMS"})).setOffset(0,10.875),waypointSymbol:new aa({color:[255,255,255,255],size:10,type:"esriSMS",style:"esriSMSCircle",outline:{color:[20,89,127,255],width:2.5,type:"esriSLS",style:"esriSLSSolid"}}),maneuverSymbol:new aa({color:[255,255,255,255],size:4,type:"esriSMS",style:"esriSMSCircle",outline:{color:[30,99,137,255],
width:1,type:"esriSLS",style:"esriSLSSolid"}}),routeSymbol:(new va).setColor(new R([20,89,127,.75])).setWidth(10).setCap(va.CAP_ROUND).setJoin(va.JOIN_ROUND),segmentSymbol:(new va).setColor(new R([255,255,255,1])).setWidth(6).setCap(va.CAP_ROUND).setJoin(va.JOIN_ROUND),barrierRenderer:new xa({type:"uniqueValue",field1:"BarrierType",defaultSymbol:{type:"esriPMS",imageData:"PHN2ZyB3aWR0aD0iMjIyIiBoZWlnaHQ9IjIyMiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGc+CjxlbGxpcHNlIGZpbGw9IiNmZjAwMDAiIHN0cm9rZT0iIzAwMCIgc3Ryb2tlLXdpZHRoPSIyMCIgY3g9IjExMiIgY3k9IjExMSIgaWQ9InN2Z181IiByeD0iMTAwIiByeT0iMTAwIi8+CjxlbGxpcHNlIGZpbGw9IiNmZjAwMDAiIHN0cm9rZT0iI2ZmZmZmZiIgc3Ryb2tlLXdpZHRoPSIyMCIgY3g9IjExMiIgY3k9IjExMSIgaWQ9InN2Z182IiByeD0iOTUiIHJ5PSI5NSIvPgo8cmVjdCBmaWxsPSIjZmYwMDAwIiBzdHJva2Utd2lkdGg9IjIwIiB4PSI2NC41IiB5PSIxMDIiIHdpZHRoPSI5NSIgaGVpZ2h0PSIxOCIgaWQ9InN2Z183IiBzdHJva2U9IiNmZmZmZmYiLz4KPC9nPgo8L3N2Zz4\x3d",
contentType:"image/svg+xml",width:18,height:18},uniqueValueInfos:[{value:"2",symbol:{type:"esriPMS",imageData:"PHN2ZyB3aWR0aD0iMjg2IiBoZWlnaHQ9IjI1NiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGc+CjxwYXRoIGZpbGw9IiNmZmYiIHN0cm9rZS13aWR0aD0iMTAiIGQ9Im04Ljc0OTk5MiwyNTEuNzQ5OTk3bDEzNC45OTk5OTgsLTI0MS45OTk5OThsMTM0Ljk5OTk5OCwyNDEuOTk5OTk4bC0yNjkuOTk5OTk1LDBsLTAuMDAwMDAxLDB6IiBpZD0ic3ZnXzEiIHN0cm9rZT0iIzAwMCIvPgo8cGF0aCBzdHJva2U9IiNmZmYiIGZpbGw9IiNmZjAwMDAiIHN0cm9rZS13aWR0aD0iMTUiIGQ9Im0yMy41MDAwMDQsMjQyLjUwMDAwNWwxMTkuOTk5OTkyLC0yMTUuOTk5OTk5bDExOS45OTk5OTIsMjE1Ljk5OTk5OWwtMjM5Ljk5OTk4MywwbC0wLjAwMDAwMSwweiIgaWQ9InN2Z18yIi8+Cjx0ZXh0IGZvbnQtd2VpZ2h0PSJib2xkIiBmaWxsPSIjZmZmZmZmIiBzdHJva2U9IiNmZjAwMDAiIHN0cm9rZS13aWR0aD0iMCIgeD0iMTA5IiB5PSIyMjIuNzUiIGlkPSJzdmdfNSIgZm9udC1zaXplPSIxODAiIGZvbnQtZmFtaWx5PSJHZW9yZ2lhLCBUaW1lcywgJ1RpbWVzIE5ldyBSb21hbicsIHNlcmlmIiB0ZXh0LWFuY2hvcj0ic3RhcnQiIHhtbDpzcGFjZT0icHJlc2VydmUiPiE8L3RleHQ+CjwvZz4KPC9zdmc+",
contentType:"image/svg+xml",width:19,height:18}}]}),polylineBarrierRenderer:new xa({type:"uniqueValue",field1:"BarrierType",defaultSymbol:{color:[255,0,0,184],width:7.5,type:"esriSLS",style:"esriSLSSolid"},uniqueValueInfos:[{value:"1",symbol:{color:[255,85,0,184],width:7.5,type:"esriSLS",style:"esriSLSSolid"}}]}),polygonBarrierRenderer:new xa({type:"uniqueValue",field1:"BarrierType",defaultSymbol:{color:[255,0,0,156],outline:{color:[255,0,0,153],width:2.4,type:"esriSLS",style:"esriSLSSolid"},type:"esriSFS",
style:"esriSFSSolid"},uniqueValueInfos:[{value:"1",symbol:{color:[255,170,0,156],outline:{color:[255,0,0,153],width:7.5,type:"esriSLS",style:"esriSLSSolid"},type:"esriSFS",style:"esriSFSSolid"}}]}),printPage:"",printTemplate:"",focusOnNewStop:!0,dragging:!0,canModifyStops:!0,canModifyWaypoints:!0,directionsLengthUnits:null,directionsLanguage:null,traffic:!1,trafficLayer:null,showPrintPage:!0,showSaveButton:!1,showSegmentPopup:!1,showSegmentHighlight:!0,showReverseStopsButton:!0,showReturnToStartOption:!0,
showOptimalRouteOption:!0,showTravelModesOption:!0,showMilesKilometersOption:!0,showClearButton:!1,showActivateButton:!0,showBarriersButton:!0,loaded:!1,routeLayer:{itemId:null,title:null,isItemOwner:!0,ownerFolder:null},startTime:"now"};this.userOptions=c;this.defaults=t.mixin({},this.options,c,{_waypointName:"DWWP",_userDefinedStopName:"UserDefinedStopName",_solveInProgress:!1,_moveInProgress:!1,_stopSequence:1E3});if(!this.defaults.minStops||2>this.defaults.minStops)this.defaults.minStops=2;if(2<
this.defaults.minStops&&this.defaults.stops&&","===this.defaults.stops.toString())for(c=2;c<this.defaults.minStops;c++)this.defaults.stops.splice(0,0,"");this.domNode=k},postCreate:function(){this.inherited(arguments);this.own(K(this._activateButtonNode,H,t.hitch(this,function(){this.mapClickActive?this.deactivate():this.activate()})));this.own(K(this._lineBarrierButtonNode,H,t.hitch(this,function(){this.barrierToolActive?this.deactivateBarrierTool():this.activateBarrierTool()})));this.own(K(this._addDestinationNode,
H,t.hitch(this,this._addStopButton)));this.own(K(this._optionsButtonNode,H,t.hitch(this,this._toggleOptionsMenu)));this.own(K(this._saveMenuButton,H,t.hitch(this,this._toggleSaveMenu)));this.own(K(this._saveButton,H,t.hitch(this,function(){this._saveButton._enabled&&this._storeRouteUI()})));this.own(K(this._saveAsButton,H,t.hitch(this,function(){t.mixin(this.routeLayer,{itemId:null,title:null,ownerFolder:null});this._storeRouteUI()})));this.own(K(this._findOptimalOrderNode,H,t.hitch(this,this._toggleCheckbox)));
this.own(K(this._returnToStartNode,H,t.hitch(this,this._toggleCheckbox)));this.own(K(this._useTrafficNode,H,t.hitch(this,this._toggleCheckbox)));this.own(K(this._useMilesNode,H,t.hitch(this,this._toggleUnits)));this.own(K(this._useKilometersNode,H,t.hitch(this,this._toggleUnits)));this.own(K(this._getDirectionsButtonNode,H,t.hitch(this,this.getDirections)));this.own(K(this._clearDirectionsButtonNode,H,t.hitch(this,function(){this.clearDirections()})));var c=t.hitch(this,function(){clearTimeout(this._startTimeMenu._hideTimer);
this._startTimeMenu._hideTimer=setTimeout(t.hitch(this,function(){U.set(this._startTimeMenu,"display","none")}),100)});this.own(K(this._startTimeButtonNode,H,t.hitch(this,function(){this._startTimeButtonNode.disabled||"block"===U.get(this._startTimeMenu,"display")?U.set(this._startTimeMenu,"display","none"):(U.set(this._startTimeMenu,"display","block"),this["now"===this.startTime?"_startTimeMenuLeaveNow":"none"===this.startTime?"_startTimeMenuNone":"_startTimeMenuDepartAt"].focus())})));this.own(K(this._startTimeMenuLeaveNow,
"blur",c));this.own(K(this._startTimeMenuDepartAt,"blur",c));this.own(K(this._startTimeMenuNone,"blur",c));this.own(K(this._startTimeMenuLeaveNow,"mousedown",t.hitch(this,function(){this.startTime="now";this._updateStartTimeUI();this._clearDisplayBeforeSolve()})));this.own(K(this._startTimeMenuDepartAt,"mousedown",t.hitch(this,function(){this.startTime=(new Date).getTime();this._updateStartTimeUI();this._clearDisplayBeforeSolve()})));this.own(K(this._startTimeMenuNone,"mousedown",t.hitch(this,function(){this.startTime=
"none";this._updateStartTimeUI();this._clearDisplayBeforeSolve()})));this._symbolEventPaddingDirections=(new va).setColor(new R([0,255,0,0])).setWidth(20).setCap(va.CAP_ROUND);this._stopLayer=new b({id:"directions_stopLayer_"+this.id,displayOnPan:!0});this._routeLayer=new b({id:"directions_routeLayer_"+this.id,displayOnPan:!0});this._waypointsEventLayer=new b({id:"directions_waypointsEventLayer_"+this.id,displayOnPan:!0});this._barriersLayer=new b({id:"directions_barriersLayer_"+this.id,displayOnPan:!0});
this._polylineBarriersLayer=new b({id:"directions_polylineBarriersLayer_"+this.id,displayOnPan:!0});this._polygonBarriersLayer=new b({id:"directions_polygonBarriersLayer_"+this.id,displayOnPan:!0});this._barriersLayer.setRenderer(this.defaults.barrierRenderer);this._polylineBarriersLayer.setRenderer(this.defaults.polylineBarrierRenderer);this._polygonBarriersLayer.setRenderer(this.defaults.polygonBarrierRenderer);this.map&&(this.map.addLayer(this._routeLayer),this.map.addLayer(this._polygonBarriersLayer),
this.map.addLayer(this._polylineBarriersLayer),this.map.addLayer(this._barriersLayer),this.map.addLayer(this._stopLayer),this._externalTimeExtent=this.map.timeExtent);this._snappingManager=this.map.enableSnapping({layerInfos:[{layer:this._waypointsEventLayer,snapToVertex:!1,snapToPoint:!0,snapToEdge:!0}],tolerance:15});this._setWidgetProperties();var k=new B(null,this.waypointSymbol,{});c=t.hitch(this,function(){this._moveInProgress||this._solveInProgress||!k._isShown()||(this.editToolbar.deactivate(),
this._stopLayer.remove(k),clearTimeout(k._solveTimeout),k._solveTimeout=null,k.attributes.isWaypoint=!0,k._isStopIcon&&this.stopGraphics[k._index]&&(this._stopLayer.add(this.stopGraphics[k._index]),this._stopLayer.add(this.textGraphics[k._index])));k._showTooltip()});this._handle=t.mixin(k,{_isHandle:!0,_tooltip:ia.create("div",{className:this.theme+" esriDirectionsRouteTooltip",onmouseover:c},this.map.container),_showTooltip:t.hitch(this,function(u){k._tooltip.style.display=!u||u instanceof MouseEvent?
"none":"inline";u&&(u="string"===typeof u?u:"\x3ctable class\x3d'esriRoutesTooltip'\x3e"+this._renderDirectionsItemTR(u)+"\x3c/table\x3e",k._tooltip.innerHTML!==u&&(k._tooltip.innerHTML=u))}),_isShown:t.hitch(this,function(){return-1<X.indexOf(this._stopLayer.graphics,k)}),_remove:c});this._activate(this.mapClickActive)},startup:function(){this.inherited(arguments);return this._enqueue(this._init)},destroy:function(){this.deactivate();this.map.removeLayer(this._barriersLayer);this.map.removeLayer(this._polylineBarriersLayer);
this.map.removeLayer(this._polygonBarriersLayer);this.map.removeLayer(this._routeLayer);this.map.removeLayer(this._stopLayer);this.map.removeLayer(this._waypointsEventLayer);this._disconnectEvents();ia.empty(this.domNode);this.inherited(arguments)},activate:function(){return this._enqueue(function(){this.deactivateBarrierTool().then(t.hitch(this,function(){this.set("mapClickActive",!0)}))})},deactivate:function(){return this._enqueue(function(){this.deactivateBarrierTool().then(t.hitch(this,function(){this.set("mapClickActive",
!1)}))})},activateBarrierTool:function(){return this._enqueue(function(){this.set("mapClickActive",!1);this.set("barrierToolActive",!0)})},deactivateBarrierTool:function(){return this._enqueue(function(){this.set("mapClickActive",!1);this.set("barrierToolActive",!1)})},clearDirections:function(){return this._enqueue(function(){this.clearMessages();return this._clearDirections()})},reset:function(){return this._enqueue(this._reset)},modifyStopSequence:function(c,k){return this._enqueue(function(){return this._modifyStopSequence(c,
k)})},onActivate:function(){},onDeactivate:function(){},onActivateBarrierTool:function(){},onDeactivateBarrierTool:function(){},onLoad:function(){this._enableButton(this._getDirectionsButtonNode)},onDirectionsStart:function(){this._clearDisplayBeforeSolve();this.set("solving",!0);this._showLoadingSpinner(!0)},onDirectionsFinish:function(){this._showLoadingSpinner(!1);this.set("solving",!1)},onDirectionsClear:function(){},onSegmentSelect:function(){},onSegmentHighlight:function(){},onStopsUpdate:function(){},
onRouteItemCreated:function(){},onRouteItemUpdated:function(){},onFeatureCollectionCreated:function(){},onError:function(){},removeStops:function(){return this.reset()},removeStop:function(c,k,u){return this._enqueue(function(){this.clearMessages();return this._removeStop(c,k,u)})},updateStops:function(c){return this._enqueue(function(){return this._updateStops(c)})},addStops:function(c,k){return this._enqueue(function(){return this._addStops(c,k)}).then(t.hitch(this,this.zoomToFullRoute))},addStop:function(c,
k){return this._enqueue(function(){return this._addStop(c,k)},{_incrementalSolveStopRange:this._incrementalSolveStopRange})},updateStop:function(c,k,u){return this._enqueue(function(){return this._updateStop(c,k,u)},{_incrementalSolveStopRange:this._incrementalSolveStopRange})},setBarriers:function(c){this.routeParams.barriers=c;return this._getDirections().then(t.hitch(this,function(){this.zoomToFullRoute()}))},setPolylineBarriers:function(c){this.routeParams.polylineBarriers=c;return this._getDirections().then(t.hitch(this,
function(){this.zoomToFullRoute()}))},setPolygonBarriers:function(c){this.routeParams.polygonBarriers=c;return this._getDirections().then(t.hitch(this,function(){this.zoomToFullRoute()}))},clearMessages:function(){this.messages=[];this._msgNode&&(this._msgNode.innerHTML="")},getDirections:function(c){return this._enqueue(function(){return this._getDirections().then(t.hitch(this,function(){!0!==c&&this.zoomToFullRoute()}))})},selectSegment:function(c){if(!(!this.directions||!this.directions.features||
0>c||c>=this.directions.features.length))for(var k=F("[data-segment]",this._resultsNode),u=0;u<k.length;u++){var M=parseInt(S.get(k[u],"data-segment"),10);if(c===M&&k[u]!==this._focusedDirectionsItem){this._focusedDirectionsItem=k[u];this.centerAtSegmentStart(c);this.onSegmentSelect(this.directions.features[c]);k[u].focus();break}}},unhighlightSegment:function(c){var k=this._segmentGraphics;if(k&&(!this._focusedDirectionsItem||c)){for(c=0;c<k.length;c++)this._routeLayer.remove(k[c]);this._segmentGraphics=
[]}},highlightSegment:function(c,k){if(!(this._focusedDirectionsItem&&!k||c>=this.directions.features.length)){c=c||0;var u=t.hitch(this,function(Da){var Ca=this.map.toMap({x:0,y:0});return this.map.toScreen(Ca.offset(Da,0)).x}),M=t.hitch(this,function(Da){for(var Ca=0,Ga=0;Ga<Da.length;Ga++)for(var La=1;La<Da[Ga].length;La++){var Ta=Da[Ga][La-1],Na=Da[Ga][La];Ca+=u(Math.sqrt((Ta[0]-Na[0])*(Ta[0]-Na[0])+(Ta[1]-Na[1])*(Ta[1]-Na[1])))}return Ca}),A=t.hitch(this,function(Da){var Ca=this.map.toMap({x:0,
y:0});return this.map.toMap({x:Da,y:0}).x-Ca.x}),Z=function(Da,Ca,Ga){Ca=Math.max(1,Ca);for(var La=Ga?Da[0].length-1:0,Ta=0,Na,Ma,Ja,Fa=[[Da[0][Ga?La:0]]];Ga&&0<La||!Ga&&La<Da[0].length-1;){Ma=Da[0][Ga?La-1:La];Ja=Da[0][Ga?La:La+1];if(Na=u(Math.sqrt((Ma[0]-Ja[0])*(Ma[0]-Ja[0])+(Ma[1]-Ja[1])*(Ma[1]-Ja[1]))))if(Ta+Na<Ca)Ga?Fa[0].splice(0,0,Ma):Fa[0].push(Ja),Ta+=Na;else{Ca=(Ca-Ta)/Na;Ga?Fa[0].splice(0,0,[Ja[0]-(Ja[0]-Ma[0])*Ca,Ja[1]-(Ja[1]-Ma[1])*Ca]):Fa[0].push([Ma[0]+(Ja[0]-Ma[0])*Ca,Ma[1]+(Ja[1]-
Ma[1])*Ca]);break}La+=Ga?-1:1}return 0<Ta+Na?Fa:Da};k=this.get("directions").features[c];var ba=new O(k.geometry),ea=40*Math.PI/180;t.mixin(k.attributes,{_index:c});if(c){var fa=Z(this.get("directions").features[c-1].geometry.paths,25,!0),pa="esriDMTStop"!==k.attributes.maneuverType?Z(ba.paths,25,!1):fa;fa=pa!==fa?[fa[0].concat(pa[0])]:pa;var sa=(new O(pa)).getExtent();if(1<pa[0].length&&15<=u(Math.max(sa.getWidth(),sa.getHeight()))){Z=15*Math.cos(ea/2);M=15*Math.sin(ea/2);var wa=pa[0].length-2;ea=
pa[0][wa+1];for(sa=0;0<=wa&&!sa;){var ya=pa[0][wa];sa=u(Math.sqrt((ya[0]-ea[0])*(ya[0]-ea[0])+(ya[1]-ea[1])*(ya[1]-ea[1])));wa--}22>sa&&(pa=sa+(22-sa)/3,wa=sa+2*(22-sa)/3,wa=[ya[0]+wa/sa*(ea[0]-ya[0]),ya[1]+wa/sa*(ea[1]-ya[1])],ya=[ea[0]-pa/sa*(ea[0]-ya[0]),ea[1]-pa/sa*(ea[1]-ya[1])],ea=wa,sa=22);Z/=sa;pa=[ea[0]-(ea[0]-ya[0])*Z,ea[1]-(ea[1]-ya[1])*Z];ya[1]!==ea[1]?(Z=(ea[0]-ya[0])/(ea[1]-ya[1]),ya=A(M/Math.sqrt(1+Z*Z)),A=Z*ya):(ya=0,A=A(M));Infinity===Math.abs(ya)||Infinity===Math.abs(A)||isNaN(ya)||
isNaN(A)||(fa[0].push(ea),fa[0].push([pa[0]-ya,pa[1]+A]),fa[0].push([pa[0]+ya,pa[1]-A]),fa[0].push(ea))}else fa=Z(fa,2*M(pa),!0);ba.paths=fa}this.unhighlightSegment(this._segmentGraphics&&this._segmentGraphics.length);A=t.clone(this.routeSymbol).setWidth(this.segmentSymbol.width).setColor(new R([parseInt(.9*this.segmentSymbol.color.r),parseInt(.9*this.segmentSymbol.color.g),parseInt(.9*this.segmentSymbol.color.b)]));this._segmentGraphics=[new B(k.geometry,A,k.attributes,this.get("segmentInfoTemplate")),
new B(ba,this.routeSymbol,k.attributes,this.get("segmentInfoTemplate")),new B(ba,this.segmentSymbol,k.attributes,this.get("segmentInfoTemplate"))];this.get("showSegmentHighlight")&&(this._routeLayer.add(this._segmentGraphics[0]),this._routeLayer.add(this._segmentGraphics[1]),this._routeLayer.add(this._segmentGraphics[2]));k=t.hitch(this,function(Da){if(0<Da&&Da<this.directions.features.length){Da=this.directions.features[Da]._associatedFeaturesWithWaypoints;for(var Ca=0;Ca<Da.length;Ca++)Da[Ca]._associatedSnapFeature&&
Da[Ca]._associatedSnapFeature.getDojoShape()&&Da[Ca]._associatedSnapFeature.getDojoShape().moveToFront()}});k(c-1);k(c);this.onSegmentHighlight(this.directions.features[c])}},zoomToSegment:function(c){var k=new P;if(this.directions&&this.directions.features){var u=Math.max(0,Math.min(this.directions.features.length-1,c||0));this.map.setExtent(this.get("directions").features[u].geometry.getExtent(),!0).promise.always(t.hitch(this,function(){this.highlightSegment(u);k.resolve()}))}else k.reject(Error("No directions."));
return k.promise},centerAtSegmentStart:function(c){var k=new P;if(this.directions&&this.directions.features){var u=Math.max(0,Math.min(this.directions.features.length-1,c||0));var M=this.directions.features[u];this.map.centerAt(M.geometry.getPoint(0,0)).promise.always(t.hitch(this,function(){this.highlightSegment(u,!0);this._showSegmentPopup(M,u);k.resolve()}))}else k.reject(Error("No directions."));return k.promise},zoomToFullRoute:function(){var c=new P;this.directions&&this.directions.features?
(this._clearInfoWindow(),this.unhighlightSegment(),this.get("map").setExtent(this.get("directions").extent,!0).promise.always(c.resolve)):c.resolve();return c.promise},setListIcons:function(){var c,k=this._dnd.getAllNodes();for(c=0;c<k.length;c++){var u=F("."+this._css.stopIconClass,k[c])[0];u&&(u.innerHTML=this._getLetter(c));N.remove(k[c],this._css.stopOriginClass+" "+this._css.stopDestinationClass+" "+this._css.stopUnreachedClass+" "+this._css.stopUnreachedFirstOrLastClass);u=this._getStopSymbol(this.stops[c]);
u===this.fromSymbol?N.add(k[c],this._css.stopOriginClass):u===this.toSymbol?N.add(k[c],this._css.stopDestinationClass):u===this.unreachedSymbol&&N.add(k[c],this._css.stopUnreachedClass)}c=F("[data-reverse-td]",this._dndNode)[0];ia.destroy(c);this.get("showReverseStopsButton")&&ia.create("td",{"data-reverse-td":"true",rowspan:k.length,className:this._css.esriStopReverseColumnClass,innerHTML:'\x3cdiv role\x3d"button" class\x3d"'+this._css.reverseStopsClass+'" data-reverse-stops\x3d"true" title\x3d"'+
D.widgets.directions.reverseDirections+'"\x3e\x3c/div\x3e',onmouseover:function(M){M.stopPropagation()},onmouseout:function(M){M.stopPropagation()}},k[0])},addRouteSymbols:function(){if(this.stopGraphics.length){this._moveLayersToFront();for(var c=0;c<this.stopGraphics.length;c++)if(this.stopGraphics[c]&&(!this._handle._isShown()||this._handle._isShown()&&this._handle._index!==c)){this._stopLayer.add(this.stopGraphics[c]);var k=this.stopGraphics[c].getDojoShape();k&&k.moveToFront();this._stopLayer.add(this.textGraphics[c]);
(k=this.textGraphics[c].getDojoShape())&&k.moveToFront()}this._moveInProgress&&!this._handle.attributes.isWaypoint&&this._handle.getDojoShape()&&this._handle.getDojoShape().moveToFront()}},createRouteSymbols:function(){this._clearStopGraphics();for(var c=this.stops,k=function(ea){var fa={},pa;for(pa in ea)ea.hasOwnProperty(pa)&&0===pa.indexOf("Attr_")&&(fa[pa]=ea[pa]);return fa},u=0;u<c.length;u++){var M=c[u];if(M&&M.feature){var A=M.feature.attributes,Z=A?A.Status:void 0,ba=null;this._isStopAWaypoint(M)||
(ba=new Aa(this._getLetter(u),this.get("textSymbolFont"),this.get("textSymbolColor")),this.get("textSymbolOffset")&&ba.setOffset(this.get("textSymbolOffset").x,this.get("textSymbolOffset").y));ba=new B(M.feature.geometry,ba,{address:M.name},this.get("stopsInfoTemplate"));ba._isStopLabel=!0;ba._index=u;M=new B(M.feature.geometry,this._getStopSymbol(M),t.mixin({address:M.name,Status:void 0===Z?0:Z,CurbApproach:A&&A.CurbApproach?A.CurbApproach:null,TimeWindowStart:A&&A.TimeWindowStart?A.TimeWindowStart:
null,TimeWindowEnd:A&&A.TimeWindowEnd?A.TimeWindowEnd:null,isWaypoint:this._isStopAWaypoint(M)},k(A)),this.get(this._isStopAWaypoint(M)?"waypointInfoTemplate":"stopsInfoTemplate"));M._isStopIcon=!0;M._index=u;this.stopGraphics[u]=M;this.textGraphics[u]=ba}}this.set("stopGraphics",this.stopGraphics);this.set("textGraphics",this.textGraphics);this._showBarriers();this.addRouteSymbols();this.setListIcons()},setTravelMode:function(c){return this._enqueue(function(){this.clearMessages();this._travelModeSelector.setValue(c);
return this._setTravelMode(c)})},getSupportedTravelModeNames:function(){var c=[],k=this.serviceDescription;if(k&&k.supportedTravelModes&&k.supportedTravelModes.length){k=k.supportedTravelModes;for(var u=0;u<k.length;u++)c.push(k[u].name)}return c},setDirectionsLengthUnits:function(){var c=1===arguments.length?arguments[0]:this.get("directionsLengthUnits");return this._enqueue(function(){this.clearMessages();return this._setDirectionsLengthUnits(c)})},setDirectionsLanguage:function(){var c=1===arguments.length?
arguments[0]:this.get("directionsLanguage");return this._enqueue(function(){this.clearMessages();return this._setDirectionsLanguage(c)})},useMyCurrentLocation:function(c){this.clearMessages();return this._createLocateButton(this.geocoders[c],!0,!0)},loadRoute:function(c){return this._enqueue(t.hitch(this,function(){return this._loadRoute(c)}))},_getStopsAttr:function(){return this.returnToStart&&this._returnToStartStop?this.stops.concat(this._returnToStartStop):this.stops},_getTravelModeNameAttr:function(){return this.routeParams&&
this.routeParams.travelMode&&this.routeParams.travelMode.name},_reset:function(){var c=this.mapClickActive||this.barrierToolActive;this._clearBarriersGraphics();this._setWidgetProperties();return this._init().then(t.hitch(this,function(){this.mapClickActive=!c;this.set("mapClickActive",c);this._searchSourceSelector&&this._searchSourceSelector.setValue("all")}))},_activate:function(){var c=this.get("mapClickActive"),k=t.hitch(this,function(u){for(var M=u?[this.textGraphics,this.stopGraphics,this.displayedManeuverPointGraphics,
this.displayedRouteGraphics]:[this.displayedRouteGraphics,this.displayedManeuverPointGraphics,this.stopGraphics,this.textGraphics],A=0;A<M.length;A++)for(var Z=M[A],ba=0;ba<Z.length;ba++){var ea=Z[ba].getDojoShape();ea&&ea[u?"moveToBack":"moveToFront"].call(ea)}});this.drawToolbar&&(this.barrierToolActive=!1,this.drawToolbar.deactivate(),N.remove(this._lineBarrierButtonNode,this._css.stopsPressedButtonClass));this._addStopOnMapClickListener&&this._addStopOnMapClickListener.remove();c?(this.map.activeDirectionsWidget&&
this.map.activeDirectionsWidget!==this&&this.map.activeDirectionsWidget.deactivate(),this.map.activeDirectionsWidget=this,this._addStopOnMapClickListener=K(this.map,"click",t.hitch(this,function(u){this.canModifyStops&&!this._solveInProgress&&(this.map.infoWindow.hide(),this.addStop(new B(u.mapPoint)))})),this.map.addLayer(this._waypointsEventLayer),this._moveLayersToFront(),N.add(this._activateButtonNode,this._css.stopsPressedButtonClass),this.onActivate()):(this.map.removeLayer(this._waypointsEventLayer),
N.remove(this._activateButtonNode,this._css.stopsPressedButtonClass),this.onDeactivate());k(!c);this.emit("map-click-active",{mapClickActive:this.mapClickActive})},_activateBarrierTool:function(){this.get("barrierToolActive")?(this.map.activeDirectionsWidget&&this.map.activeDirectionsWidget!==this&&this.map.activeDirectionsWidget.deactivate(),this.map.activeDirectionsWidget=this,this.drawToolbar.activate(Xa.FREEHAND_POLYLINE),N.add(this._lineBarrierButtonNode,this._css.stopsPressedButtonClass),this.onActivateBarrierTool()):
(this.drawToolbar.deactivate(),N.remove(this._lineBarrierButtonNode,this._css.stopsPressedButtonClass),this.onDeactivateBarrierTool());this.emit("barrier-tool-active",{barrierToolActive:this.barrierToolActive})},_moveLayersToFront:function(){var c=this.get("map"),k=c.graphicsLayerIds.length-1;c.reorderLayer(this._routeLayer,k);c.reorderLayer(this._polygonBarriersLayer,k);c.reorderLayer(this._polylineBarriersLayer,k);c.reorderLayer(this._barriersLayer,k);c.reorderLayer(this._waypointsEventLayer,k);
c.reorderLayer(this._stopLayer,k)},_destroyGeocoders:function(){for(;this.geocoders&&this.geocoders.length;){if(this.geocoders[0])try{this.geocoders[0].destroy()}catch(c){}this.geocoders.splice(0,1)}this.geocoders=[]},_disconnectEvents:function(){var c=this._clearDirections(!0),k;if(this._watchEvents&&this._watchEvents.length)for(k=0;k<this._watchEvents.length;k++)this._watchEvents[k].unwatch();if(this._onEvents&&this._onEvents.length)for(k=0;k<this._onEvents.length;k++)this._onEvents[k].remove();
if(this._geocoderEvents)for(k=0;k<this._geocoderEvents.length;k++)this._geocoderEvents[k].value.unwatch(),this._geocoderEvents[k].blur.remove(),this._geocoderEvents[k].select.remove(),this._geocoderEvents[k].suggest.remove();this._onEvents=[];this._watchEvents=[];this._geocoderEvents=[];this._disconnectResults();this._destroyGeocoders();this._destroyGlobalGeocoder();this._destroyDnD();return c},_getDirections:function(){var c=new P;this._removeEmptyStops();1<this._getStopCount()+this._getWaypointCount()&&
this.loaded?(this.onDirectionsStart(),this.clearMessages(),this._dnd.sync(),this._sortGeocoders(),this._getCandidates(this.stops).then(t.hitch(this,function(k){this.stops=k;this._setStops();this._configureRoute().always(t.hitch(this,function(u){c.resolve(u)}))}),t.hitch(this,function(k){this.set("directions",null);this._clearRouteGraphics();c.reject(k);this.onDirectionsFinish(k)}))):this._clearDirections(!0).always(t.hitch(this,function(){this.createRouteSymbols();c.resolve()}));return c.promise},
_clearDirections:function(){var c=new P;this._handle&&this._handle._remove();this.get("routeParams")&&this.get("routeParams").stops?this.get("routeParams").stops.features.length?(this.get("routeParams").stops.features=[],this.onDirectionsClear(),c.resolve()):arguments.length?c.resolve():this._reset().then(c.resolve,c.reject):c.resolve();this.set("directions",null);this._clearDisplayBeforeSolve();this._clearDisplayAfterSolve();this._routeLayer.clear();this._waypointsEventLayer.clear();this._stopLayer.clear();
return c.promise},_setTravelMode:function(c){var k=new P,u=this.serviceDescription,M=function(){k.resolve(c)};if(u&&u.supportedTravelModes&&u.supportedTravelModes.length){var A=u.supportedTravelModes,Z=!1;for(u=0;u<A.length;u++)if(A[u].name===c){Z=!0;!this.routeParams.travelMode||this.routeParams.travelMode&&this.routeParams.travelMode.name!==c?(this.routeParams.travelMode=A[u].impedanceAttributeName?A[u]:A[u].itemId,this._checkStartTimeUIAvailability(),this._solveAndZoom().always(M)):M();this._travelModeSelector&&
this._travelModeSelector.domNode&&(this._travelModeSelector.domNode.title=A[u].description);break}Z||k.reject(c)}else k.reject(c);return k.promise},_setDirectionsLengthUnits:function(c){this._clearDisplayBeforeSolve();var k=new P;N.remove(this._useMilesNode,this._css.stopsPressedButtonClass);N.remove(this._useKilometersNode,this._css.stopsPressedButtonClass);c===ca.KILOMETERS?N.add(this._useKilometersNode,this._css.stopsPressedButtonClass):c===ca.MILES&&N.add(this._useMilesNode,this._css.stopsPressedButtonClass);
c===ca.KILOMETERS||c===ca.METERS||c===ca.MILES||c===ca.FEET||c===ca.YARDS||c===ca.NAUTICAL_MILES?(this.directionsLengthUnits=c,k.resolve(c)):k.reject(c);return k.promise},_setDirectionsLanguage:function(c){this._clearDisplayBeforeSolve();var k=new P;c=this._setDirectionsLanguageByLocale(c);this._solveAndZoom().always(function(){k.resolve(c)},k.reject);return k.promise},_showLoadingSpinner:function(c){void 0===c&&(c=this._requestQueueTail&&!this._requestQueueTail.isFulfilled()||this._moveInProgress);
c?(N.add(this._widgetContainer,this._css.resultsLoadingClass),N.add(this._resultsNode,"esriRoutesContainerBusy")):(N.remove(this._widgetContainer,this._css.resultsLoadingClass),N.remove(this._resultsNode,"esriRoutesContainerBusy"))},_enqueue:function(c,k){var u=new P;this._requestQueueTail||(this._requestQueueTail=new P,this._requestQueueTail.resolve());this._requestQueueTail.promise.always(t.hitch(this,function(){try{t.mixin(this,{_incrementalSolveStopRange:null},k);var M=c.call(this);M&&"object"===
typeof M&&M.hasOwnProperty("isFulfilled")?M.then(t.hitch(this,function(A){u.resolve(A);this._showLoadingSpinner()}),t.hitch(this,function(A){u.reject(A);this._showLoadingSpinner()})):(u.resolve(M),this._showLoadingSpinner())}catch(A){u.reject(A),this._showLoadingSpinner()}}));this._requestQueueTail=u;this._showLoadingSpinner();return u.promise},_createDnD:function(){this._dnd=new la(this._dndNode,{skipForm:!0,withHandles:!0})},_destroyDnD:function(){ia.empty(this._dndNode);this._dnd&&(this._dnd.destroy(),
this._dnd=null)},_createDepartAtControls:function(){if(this._departAtTime)this.map&&this._restoreMapTimeExtent(),this._useTrafficItemNode.title=D.widgets.directions.trafficLabelLive,N.remove(this._departAtContainer,"departAtContainerVisible"),this.startTime="now",this._updateStartTimeUI();else{var c=this,k=function(){this._keepDirections||c._clearDisplayBeforeSolve();this._keepDirections=!1},u=t.hitch(this,function(){this.map&&this.map.disableKeyboardNavigation()}),M=t.hitch(this,function(){this.map&&
this.map.enableKeyboardNavigation()});this._departAtTime=new m({required:!0,value:new Date,onChange:k,onFocus:u,onBlur:M},this._departAtTimeContainer);this._departAtDate=new l({required:!0,value:new Date,onChange:k,onFocus:u,onBlur:M,constraints:{min:new Date(864E5)}},this._departAtDateContainer)}},_setStartTime:function(c,k,u){if(isNaN(u))this.startTime="now"===u?u:"none";else{k=u instanceof Date?u:new Date(u);u=this.directions&&this.directions.features&&this.directions.features[0]&&this.directions.features[0].attributes;
var M=6E4*-k.getTimezoneOffset();k=new Date(k-M+(u&&u.arriveTimeUTC?u.ETA-u.arriveTimeUTC:M));this._departAtTime._keepDirections=!c;this._departAtDate._keepDirections=!c;this._departAtTime.setValue(k);this._departAtDate.setValue(k)}this._updateStartTimeUI()},_checkStartTimeUIAvailability:function(){var c=this._getImpedanceAttribute();c=this._isTimeUnits(c?c.units:"")||this.serviceDescription&&10.6<=this.serviceDescription.currentVersion;this._startTimeButtonNode.disabled=!c;N[c?"remove":"add"].apply(this,
[this._startTimeButtonNodeContainer,"esriLinkButtonDisabled"]);N[c?"remove":"add"].apply(this,[this._startTimeDDLArrow,"esriDirectionsDDLArrowDisabled"]);c||this.set("startTime","now")},_usingAGOL:function(c){c||(c=this.routeTaskUrl);return-1<c.search(/^(https?:)*\/\/*[^.]*\.arcgis\.com.*$/i)},_usingRouteAGOL:function(){return-1<this.get("routeTaskUrl").search(/^(https?:)*\/\/route*[^.]*\.arcgis\.com.*$/i)},_setSearchOptions:function(){var c={map:this.get("map"),autoNavigate:!1,enableInfoWindow:!1,
enableHighlight:!1,enableSourcesMenu:!1};this.searchOptions=t.mixin({maxResults:1,locationToAddressDistance:100},this.defaults.searchOptions,c)},_setDefaultUnits:function(){if(!this.get("directionsLengthUnits")){var c="EN-US"===Q.locale.toUpperCase()?ca.MILES:ca.KILOMETERS;this.defaults.directionsLengthUnits?c=this.defaults.directionsLengthUnits:this.userOptions.routeParams&&this.userOptions.routeParams.directionsLengthUnits&&(c=this.userOptions.routeParams.directionsLengthUnits);this.set("directionsLengthUnits",
c)}this._setDirectionsLengthUnits(this.directionsLengthUnits)},_setTrafficOptions:function(){this._usingRouteAGOL()&&!this.trafficLayer&&(this.trafficLayer=new za(Wa+"//traffic.arcgis.com/arcgis/rest/services/World/Traffic/MapServer",{opacity:.4}));this.trafficLayer&&this.trafficLayer.url&&this._usingAGOL(this.trafficLayer.url)&&(this._trafficAvailabilityButton.style.display="inline-block");this.set("showTrafficOption",(this.defaults.showTrafficOption||!this.defaults.hasOwnProperty("showTrafficOption"))&&
!!this.trafficLayer);this._optionsMenu()},_updateCanModifyStops:function(c,k){this.canModifyStops||this.canModifyWaypoints||this.set("mapClickActive",!1);k||!this.canModifyStops||this.canModifyWaypoints||this.set("mapClickActive",!0);this._showAddDestination();this._showMapClickActiveButton();this._stopsTableCover.style.display=this.canModifyStops?"none":"inline"},_updateCanAddWaypoints:function(c,k){this.canModifyStops||this.canModifyWaypoints||this.set("mapClickActive",!1);k||this.canModifyStops||
!this.canModifyWaypoints||this.set("mapClickActive",!0);this._showMapClickActiveButton();this._handle._remove()},_updateStartTimeUI:function(){isNaN(this.startTime)?(this._startTimeButtonLabel.innerHTML="now"==this.startTime?this._i18n.widgets.directions.leaveNow:this._i18n.widgets.directions.noStartTime,N.remove(this._startTimeButtonNodeContainer,"departAtButton"),N.remove(this._departAtContainer,"departAtContainerVisible")):(N.add(this._startTimeButtonNodeContainer,"departAtButton"),N.add(this._departAtContainer,
"departAtContainerVisible"),this._startTimeButtonLabel.innerHTML=this._i18n.widgets.directions.departAt)},_setWidgetProperties:function(){this._disconnectEvents();this.set(this.defaults);this.routeLayer=t.clone(this.defaults.routeLayer);this._folderSelector&&(this._outputLayer.setValue(""),this._outputLayer.set("disabled",!0),this._folderSelector.set("disabled",!0));this.set("stops",[]);this._updateCanModifyStops()},_updateStops:function(c){var k=new P;c?this.get("loaded")?this._reset().then(t.hitch(this,
function(){this._addStops(c).then(k.resolve,k.reject)}),k.reject):this._addStops(c).then(k.resolve,k.reject):k.reject();return k.promise},_removeStop:function(c,k,u,M){var A=new P,Z=t.hitch(this,function(ea){this.stops.splice(ea,1);var fa=this._dnd.getAllNodes()[ea],pa=this.get("geocoders");this._geocoderEvents[fa.id]&&(this._geocoderEvents[fa.id].blur.remove(),this._geocoderEvents[fa.id].select.remove(),this._geocoderEvents[fa.id].suggest.remove(),this._geocoderEvents[fa.id].value.unwatch());pa[ea].destroy();
pa.splice(ea,1);this.set("geocoders",pa);ia.destroy(fa);this._dnd.sync();this._stopsRemovable();this._optionsMenu();this._checkMaxStops();this.setListIcons();this._sortGeocoders()});if(0>c||c>=this.stops.length||void 0===c)c=this.stops.length-1;var ba=!1;for(M=this.stopGraphics[c]&&this._isStopAWaypoint(this.stops[c])||M;!ba;)Z(c),M?ba=!0:(c-=0>=c||c<this.stops.length&&this._isStopAWaypoint(this.stops[c])?0:1,ba=!this._isStopAWaypoint(this.stops[c]));for(;this.stops.length-this._getWaypointCount()<
this.minStops;)this._addStop();this._clearStopsStatusAttr();this._setStops();this.createRouteSymbols();u?(this._clearDisplayBeforeSolve(),this._clearDisplayAfterSolve(),this.createRouteSymbols(),A.resolve()):this._solveAndZoom(k).then(A.resolve,A.reject);return A.promise},_removeTrafficLayer:function(){this.trafficLayer&&this.map&&this.map.removeLayer(this.trafficLayer);this._trafficLayerAdded=!1},_addStops:function(c,k){var u=new P,M=[],A=this.autoSolve;this.autoSolve=!1;void 0===k&&(k=this._getStopCount());
for(var Z=0;Z<Math.min(c.length,this.maxStops-this._getStopCount());Z++){var ba=new P;this._addStop(c[Z],k+Z,!0).always(ba.resolve);M.push(ba)}na(M).always(t.hitch(this,function(){this.autoSolve=A;this._getDirections().always(function(){u.resolve(c)})}));return u.promise},_addStop:function(c,k,u){var M=new P;this._checkMaxStops();this.maxStopsReached?(this._showMessage(D.widgets.directions.error.maximumStops),M.reject(Error(D.widgets.directions.error.maximumStops))):(void 0===c&&void 0===k&&(k=this.stops.length),
c instanceof B&&c.attributes&&c.attributes.isWaypoint&&(!k||k===this.stops.length||2>this._getStopCount())&&!u?(this._showMessage(D.widgets.directions.error.waypointShouldBeInBetweenStops),M.reject(Error(D.widgets.directions.error.waypointShouldBeInBetweenStops))):this._getCandidate(c).then(t.hitch(this,function(A){this._isStopAWaypoint(A)&&A&&A.feature&&(A.feature.attributes=t.mixin({},A.feature.attributes,{isWaypoint:!0,CurbApproach:3}));this._insertStop(A,k);this.autoSolve&&""!==A.name?this._getDirections().always(function(){M.resolve(A,
k)}):M.resolve(A,k)}),t.hitch(this,function(A){M.reject(A)})));return M.promise},_removeEmptyStops:function(){for(var c=0,k=this.stops.length-this._getWaypointCount()-this.minStops;c<this.stops.length&&0<k;)this.stops[c]&&this.stops[c].name?c++:(this._removeStop(c,!0,!0,!0),k--,this._moveInProgress&&this._handle._index>=c&&this._handle._isStopIcon&&this._handle._index--)},_setReverseGeocode:function(c,k,u){if(c.feature.geometry&&-1<u){var M={address:c.name};this.stopGraphics[u]&&(t.mixin(this.stopGraphics[u].attributes,
M),this.stopGraphics[u].setGeometry(k));this.textGraphics[u]&&(t.mixin(this.textGraphics[u].attributes,M),this.textGraphics[u].setGeometry(k));this.set("stopGraphics",this.stopGraphics);this.set("textGraphics",this.textGraphics);(M=this.geocoders[u])&&M.inputNode&&(M.value=c.name,M.inputNode.value=c.name);t.mixin(c.feature.attributes,this.stops[u].feature.attributes);this.stops[u]=c;this.stops[u].feature.setGeometry(k);this._setStops();return this._enqueue(function(){return this._getDirections()})}},
_insertStop:function(c,k){var u;if(void 0===k)for(u=0;u<this.geocoders.length;u++){if(!this.geocoders[u].get("value")){var M=this.geocoders[u];break}}else u=k,this.geocoders[u]&&!this.geocoders[u].get("value")&&(M=this.geocoders[u]);!M||void 0!==k&&k!==u||this._isStopAWaypoint(c)?(void 0===k&&(k=this.geocoders.length),this.stops.splice(k,0,c),this._createGeocoder(c,k)):(this.stops[u]=c,M.set("value",c.name),M._stopReference=c);this._optionsMenu()},_createGeocoder:function(c,k){var u=this._dnd.getAllNodes(),
M=!1,A=!1,Z=u.length;u[k]?(A=u[k],M=!0):M=A=!1;var ba=t.hitch(this,function(sa,wa){var ya=wa?this._css.stopDnDHandleClass:this._css.stopDnDHandleClassHidden,Da=wa?this._css.stopDnDHandleClassHidden:this._css.stopDnDHandleClass;N.replace(sa.children[0],ya,Da);2<this.geocoders.length&&(ya=wa?this._css.stopIconRemoveClass:this._css.stopIconRemoveClassHidden,Da=wa?this._css.stopIconRemoveClassHidden:this._css.stopIconRemoveClass,N.replace(sa.children[3].children[0],ya,Da))}),ea=ia.create("tr",{className:this._css.stopClass,
style:this._isStopAWaypoint(c)?"display:none;":"",onmouseover:function(){ba(this,!0)},onmouseout:function(){ba(this,!1)}});ia.create("td",{className:this._css.stopDnDHandleClassHidden+" dojoDndHandle"},ea);u=ia.create("td",{className:this._css.stopIconColumnClass},ea);ia.create("div",{className:this._css.stopIconClass+" dojoDndHandle",innerHTML:this._getLetter(Z),"data-center-at":"true"},u);Z=ia.create("td",{className:this._css.esriStopGeocoderColumnClass},ea);Z=ia.create("div",{},Z);u=ia.create("td",
{className:this._css.stopIconRemoveColumnClass},ea);ia.create("div",{className:this._css.stopIconRemoveClassHidden,role:"button","data-remove":"true"},u);this._dnd.insertNodes(!1,[ea],M,A);M=t.mixin({},this.get("searchOptions"),{value:c.name,activeSourceIndex:this._globalGeocoder.activeSourceIndex});var fa=new cb(M,Z),pa=t.hitch(this,function(sa,wa){this._enqueue(function(){if(wa!==sa&&fa._stopReference&&fa._stopReference.name!==wa){var ya=X.indexOf(this.stops,fa._stopReference);this.stops[ya]={name:wa};
this._handle._remove();this._removeSomeWaypoints(this._markWPsForRemovalAfterUserChangedStopSequence(ya));this._setStops();this._clearDisplayBeforeSolve();this._clearDisplayAfterSolve();this.createRouteSymbols()}})});fa._tr=ea;fa._stopReference=c;fa.startup();this.geocoders.splice(k,0,fa);this._geocoderEvents[ea.id]={blur:fa.on("blur",function(){""!==this.value&&this._stopReference&&!this._stopReference.feature&&this.search()}),select:fa.on("select-result",t.hitch(this,function(sa){var wa=!0;if(sa&&
(sa.results||sa.result)){var ya=this._dnd.getAllNodes();ya=X.indexOf(ya,ea);var Da=fa.value,Ca=sa.results&&sa.results.results&&sa.results.results.length?sa.results.results[0]:sa.result;Ca?(Ca.name=Da,this.stops[ya]=this._toPointGeometry(Ca),this.geocoders[ya]._stopReference=this.stops[ya],pa("",Da)):(this.removeStop(ya),this.set("directions",null),this._showMessage(D.widgets.directions.error.unknownStop.replace("\x3cname\x3e",sa.target.get("value"))),this._clearRouteGraphics(),wa=!1);wa&&this.getDirections()}})),
suggest:fa.on("suggest-results",function(){if(document.activeElement===this.inputNode)for(var sa=F("LI[role\x3d'menuitem']",this.suggestionsNode),wa=0;wa<sa.length;wa++)S.set(sa[wa],"tabindex",-1);else this._hideSuggestionsMenu()}),value:fa.watch("value",function(sa,wa,ya){pa(wa,ya)})};this._checkMaxStops();this.setListIcons();this._stopsRemovable();this._optionsMenu();this._sortGeocoders()},_blurGeocoders:function(){if(document.activeElement)for(var c=0;c<this.geocoders.length;c++)if(this.geocoders[c].inputNode===
document.activeElement){this.geocoders[c]._hideSuggestionsMenu();this.geocoders[c].inputNode.blur();1<this._getStopCount()+this._getWaypointCount()&&this.getDirections(!0);break}},_decorateEmptyAGOLGeocoderResponse:function(c){c&&", , "===c.name&&(c.name=c.feature&&c.feature.attributes&&c.feature.attributes.Match_addr?c.feature.attributes.Match_addr+("POI"===c.feature.attributes.Addr_type&&c.feature.attributes.City&&-1===c.feature.attributes.Match_addr.indexOf(c.feature.attributes.City)?", "+c.feature.attributes.City:
""):"");return c},_toPointGeometry:function(c){var k=c.feature.geometry;k&&(k.getCentroid?c.feature.geometry=k.getCentroid():k.getExtent&&(k=k.getExtent())&&(c.feature.geometry=k.getCenter()));return c},_removeLocateButtonVisibilityEvents:function(){for(var c=0;c<this.geocoders.length;c++){var k=this.geocoders[c];k._onMouseEnter&&k._onMouseEnter.remove();k._onMouseOut&&k._onMouseOut.remove();k._onKeyPress&&k._onKeyPress.remove();k._locateButton&&(k._locateButton._onMouseEnter&&k._locateButton._onMouseEnter.remove(),
k._locateButton._onMouseOut&&k._locateButton._onMouseOut.remove())}},_setLocateButtonVisibilityEvents:function(){this._removeLocateButtonVisibilityEvents();for(var c=this,k=function(fa){fa instanceof FocusEvent?this._geocoder._lbShown_f=!0:this._geocoder._lbShown_g=!0;c._createLocateButton(this._geocoder,!0)},u=function(fa){fa instanceof FocusEvent?this._geocoder._lbShown_f=!1:this._geocoder._lbShown_g=!1;clearTimeout(this._destroyTimeout);this._destroyTimeout=setTimeout(t.hitch(this,function(){this._geocoder._lbShown_lb||
this._geocoder._lbShown_f||c._destroyLocateButton(this._locateButton)}),400)},M=function(){this._geocoder._lbShown_g=!0;clearTimeout(this._destroyTimeout);this._destroyTimeout=setTimeout(t.hitch(this,function(){""===this.value?c._createLocateButton(this._geocoder,!0):c._destroyLocateButton(this._locateButton)}),400)},A=function(){this._geocoder._lbShown_lb=!0;clearTimeout(this._geocoder._destroyTimeout)},Z=function(){this._geocoder._lbShown_lb=!1;clearTimeout(this._geocoder._destroyTimeout);this._geocoder._destroyTimeout=
setTimeout(t.hitch(this,function(){this._geocoder._lbShown_g||this._geocoder._lbShown_f||c._destroyLocateButton(this._geocoder.inputNode._locateButton)}),400)},ba=0;ba<this.geocoders.length;ba++){var ea=this.geocoders[ba];ea&&ea.inputNode&&(ea.inputNode._geocoder=ea,ea._onMouseEnter=K(ea.inputNode,w.enter,k),ea._onMouseOut=K(ea.inputNode,[w.leave,"blur"],u),ea._onKeyPress=K(ea.inputNode,"keydown",M),ea.inputNode._locateButton&&(ea=ea.inputNode._locateButton,ea._onMouseEnter=K(ea.domNode,w.enter,A),
ea._onMouseOut=K(ea.domNode,w.leave,Z)))}},_createLocateButton:function(c,k,u){var M=new P;c.inputNode._locateButton&&c.inputNode._locateButton._locating?M.resolve():V(["./LocateButton"],t.hitch(this,function(A){this._destroyLocateButton(c.inputNode._locateButton);if(c&&!this._solveInProgress){var Z=ia.create("div",{},c.domNode);N.add(c.domNode,this._css.stopsInnerGeocoderClass);var ba=new A({map:this.map,highlightLocation:!1,centerAt:!1,setScale:!1,useTracking:!1},Z);ba.startup();c.inputNode._locateButton=
ba;ba.domNode._geocoder=c;this._setLocateButtonVisibilityEvents();A=t.hitch(this,function(){ba._locating=!0;c.set("value","");c.inputNode.placeholder=D.widgets.directions.retrievingMyLocation.toUpperCase()});ba._onBeforeLocate=K(ba._locateNode,H,A);ba._onLocate=K(ba,"locate",t.hitch(this,function(ea){ba._locating=!1;ea.graphic?(k&&this._destroyLocateButton(c.inputNode._locateButton),this.updateStop(new B(ea.graphic.geometry),X.indexOf(this.geocoders,c)).then(t.hitch(this,function(){1<this.stopGraphics.length?
this.getDirections().always(function(){M.resolve(ea)}):M.resolve(ea)}))):(c.set("value",""),c.inputNode.placeholder=D.widgets.directions.myLocationError.toUpperCase(),console.error(ea.error),M.reject(ea.error))}));u?(A(),ba.locate().then(null,M.reject)):M.resolve()}else M.resolve()}));return M.promise},_destroyLocateButton:function(c){if(c){var k=c.domNode._geocoder;clearTimeout(k._destroyTimeout);c._locating?k._destroyTimeout=setTimeout(t.hitch(this,function(){k._lbShown_lb||k._lbShown_f||this._destroyLocateButton(c)}),
100):(c.clear(),c._onBeforeLocate.remove(),c._onLocate.remove(),c._onMouseEnter&&c._onMouseEnter.remove(),c._onMouseOut&&c._onMouseOut.remove(),c.destroy(),k.inputNode&&(k.inputNode._locateButton=null,k._setPlaceholder(k.activeSourceIndex)))}},_sortStops:function(){this.stops.length&&(this.stops.sort(t.hitch(this,function(c,k){for(var u,M,A=0;A<this.get("geocoders").length;A++)this.geocoders[A]._stopReference===c?u=A:this.geocoders[A]._stopReference===k&&(M=A);return u>M?1:M>u?-1:0})),this._setStops())},
_getCandidate:function(c){var k=new P,u=typeof c;c?"object"===u&&c.hasOwnProperty("feature")&&c.hasOwnProperty("name")?(c.feature.attributes&&void 0!==c.feature.attributes.displayName&&!this._isStopAWaypoint(c)&&(c.name=c.feature.attributes.displayName,c.feature.attributes.Name=this._userDefinedStopName),c.name=this._isStopAWaypoint(c)?this._waypointName:String(c.name),"point"!==c.feature.geometry.type&&(c.feature.geometry=new d([c.feature.geometry.x,c.feature.geometry.y],this.map.spatialReference)),
k.resolve(c)):"object"===u&&c.hasOwnProperty("address")&&c.hasOwnProperty("location")?(c=this._globalGeocoder._hydrateResult(c),k.resolve(c)):"object"!==u||!c.hasOwnProperty("name")||null!==c.name&&""!==c.name?c instanceof B&&c.attributes&&(void 0!==c.attributes.Name||c.attributes.isWaypoint)?(u=this._addStopWrapperToGraphic(c,c.attributes.isWaypoint?this._waypointName:String(c.attributes.Name)),String(c.attributes.Name)&&(u.feature.attributes.Name=this._userDefinedStopName),k.resolve(u)):("object"===
u&&c.hasOwnProperty("name")&&(c=String(c.name)),this._reverseGeocode(c).then(k.resolve,k.reject)):k.resolve(t.clone(this._emptyStop)):k.resolve(t.clone(this._emptyStop));return k.promise},_reverseGeocode:function(c){var k=new P,u,M=c.geometry?c.geometry:c;if(this._globalGeocoder){var A=t.hitch(this,function(fa){var pa=new P,sa=500;if(this.map){var wa=this.map.toScreen(M);wa.x+=r._calculateClickTolerance([fa]);this.map.spatialReference.isWebMercator()?(sa=Math.abs(this.map.toMap(wa).x-M.x),pa.resolve(sa)):
4326===this.map.spatialReference.wkid?(sa=Math.abs(f.geographicToWebMercator(this.map.toMap(wa)).x-f.geographicToWebMercator(M).x),pa.resolve(sa)):this._geometryService&&(fa=new Ba,fa.distanceUnit=ua.UNIT_METER,fa.geometry1=M,fa.geometry2=this.map.toMap(wa),this._geometryService.distance(fa,function(ya){sa=ya;pa.resolve(sa)},function(){pa.resolve(sa)}))}return pa.promise}),Z=[],ba=this._globalGeocoder.sources,ea=function(){ba[u].featureLayer&&Z.push(A(ba[u].featureLayer).then(t.hitch(ba[u],function(fa){this.searchQueryParams=
t.mixin(this.searchQueryParams,{distance:fa})})))};if("all"===this._globalGeocoder.activeSourceIndex)for(u=0;u<ba.length;u++)ea();else u=this._globalGeocoder.activeSourceIndex,ea();na(Z).always(t.hitch(this,function(){this._globalGeocoder.search(M).then(t.hitch(this,function(fa){var pa=!1;if(fa){var sa=null;for(u=0;u<this._globalGeocoder.sources.length;u++)if(fa[u]&&fa[u].length){var wa=fa[u];break}if(wa.length&&(pa=!0,sa=wa[0],this._globalGeocoder.sources[u].featureLayer))for(fa=Number.POSITIVE_INFINITY,
u=0;u<wa.length;u++){wa[u]=this._toPointGeometry(wa[u]);var ya=G.geodesicLengths([new O({paths:[[f.xyToLngLat(M.x,M.y),f.xyToLngLat(wa[u].feature.geometry.x,wa[u].feature.geometry.y)]],spatialReference:{wkid:this.map.spatialReference.wkid}})],"esriMeters")[0];fa>ya&&(fa=ya,sa=wa[u])}(sa=this._decorateEmptyAGOLGeocoderResponse(sa))&&""!==sa.name&&null!==sa.name&&void 0!==sa.name?(sa.name=String(sa.name),isNaN(M.x)||isNaN(M.y)||this.map.spatialReference.wkid!==M.spatialReference.wkid?!sa.feature.geometry||
isNaN(sa.feature.geometry.x)||isNaN(sa.feature.geometry.y)?(this._showMessage(D.widgets.directions.error.locator),k.reject(Error(D.widgets.directions.error.locator))):k.resolve(sa):(sa.feature.geometry=M,k.resolve(sa))):pa=!1}pa||(c instanceof d?c=new B(c):c instanceof Array&&(c=new B(new d(c[0],c[1]))),c instanceof B?this._decorateUngeocodedStop(c).then(k.resolve,k.reject):(this._showMessage(D.widgets.directions.error.unknownStop.replace("\x3cname\x3e",c.toString())),k.reject(Error(D.widgets.directions.error.unknownStop.replace("\x3cname\x3e",
c.toString())))))}))}))}else this._showMessage(D.widgets.directions.error.locatorUndefined),k.reject(Error(D.widgets.directions.error.locatorUndefined));return k.promise},_updateStop:function(c,k,u){var M=new P;this.stops&&this.stops[k]?c instanceof B&&c.attributes&&c.attributes.isWaypoint&&(!k||k===this.stops.length-1||2>this._getStopCount())?(this._showMessage(D.widgets.directions.error.waypointShouldBeInBetweenStops),M.reject(Error(D.widgets.directions.error.waypointShouldBeInBetweenStops))):this._getCandidate(c).then(t.hitch(this,
function(A){var Z=A.feature;Z=Z?Z.geometry:null;var ba=this.stops[k].feature;ba=ba?ba.geometry:null;Z=Z&&ba&&(Z.x!==ba.x||Z.y!==ba.y)||!Z&&ba;this.stops[k]=A;this.geocoders[k]||this._createGeocoder(A,k);ba=this.geocoders[k];ba._stopReference=A;ba._tr.style.display=this._isStopAWaypoint(A)?"none":"";ba.value=A.name;ba.inputNode&&(ba.inputNode.value=A.name);Z&&this.autoSolve&&1<this._getStopCount()+this._getWaypointCount()||u?this._getDirections().then(M.resolve,M.reject):(this._setStops(),M.resolve(A))}),
t.hitch(this,function(A){M.reject(A)})):(this._showMessage(D.widgets.directions.error.couldNotUpdateStop),M.reject(Error(D.widgets.directions.error.couldNotUpdateStop)));this._optionsMenu();return M.promise},_renderDirections:function(){var c=this.get("directions");if(this._resultsNode){var k='\x3cdiv class\x3d"'+this._css.clearClass+'"\x3e\x3c/div\x3e';k+=this._renderDirectionsSummary(c);k+='\x3cdiv class\x3d"'+this._css.clearClass+'"\x3e\x3c/div\x3e';k+='\x3cdiv class\x3d"'+this._css.routesClass+
'"\x3e';k+=this._renderDirectionsTable(c);k+="\x3cdiv class\x3d'esriPrintFooter'\x3e"+D.widgets.directions.printDisclaimer+"\x3c/div\x3e";k+="\x3c/div\x3e";this._resultsNode&&(this._resultsNode.innerHTML=k);this._disconnectResults();(c=F("[data-segment]",this._resultsNode))&&c.length&&X.forEach(c,t.hitch(this,function(u){this._resultEvents.push(K(u,w.enter,t.hitch(this,function(){if(!this._focusedDirectionsItem){var M=parseInt(S.get(u,"data-segment"),10);this.highlightSegment(M)}})));this._resultEvents.push(K(u,
"focusout",t.hitch(this,function(){this._focusedDirectionsItem=null;this.unhighlightSegment(!0)})));this._resultEvents.push(K(u,w.leave,this.unhighlightSegment));this._resultEvents.push(K(u,"click, keydown",t.hitch(this,function(M){M&&("click"===M.type||"keydown"===M.type&&M.keyCode===x.ENTER)&&(this._focusedDirectionsItem!==u?this.selectSegment(parseInt(S.get(u,"data-segment"),10)):(u.blur(),this.map.infoWindow.hide(),this._focusedDirectionsItem=null,this.unhighlightSegment(!0)))})))}))}},_renderDirectionsSummary:function(c){var k=
"",u=t.hitch(this,function(){for(var ba={},ea=this._getDirectionsTimeAttribute()||{},fa=this._getTimeNeutralAttribute()||{},pa=0,sa=0,wa=this.get("stops"),ya=wa.length-1;0<=ya;ya--)if(null!==wa[ya].feature.attributes.ArriveCurbApproach){ba=wa[ya].feature.attributes;break}for(var Da in ba)ba.hasOwnProperty(Da)&&(Da==="Cumul_"+ea.name&&(pa=ba[Da]),Da==="Cumul_"+fa.name&&(sa=ba[Da]));ba="esriTrafficLabelHidden";wa=D.widgets.directions.noTraffic;ya=c.totalTime-c.totalDriveTime;ya=(sa-this._convertCostValue(ya,
ea.units,fa.units))/(pa-ya||1);0<ya&&.8>ya?(ba="esriTrafficLabelHeavy",wa=D.widgets.directions.heavyTraffic):1===ya?(ba="esriTrafficLabelNone",wa=D.widgets.directions.noTraffic):1.25<ya&&(ba="esriTrafficLabelLight",wa=D.widgets.directions.ligthTraffic);fa=this._formatTime(sa,!1,fa.units);return{label:wa,labelClass:ba,ratio:ya,noTrafficCostStr:1!==ya&&fa?fa+" "+D.widgets.directions.onAverage+"\x3cbr\x3e":"",trafficCost:pa,noTrafficCost:sa,timeAtt:ea}});if(c.totalLength||c.totalTime){u=u();var M=this._getImpedanceAttribute();
k+="\x3cdiv class\x3d'"+this._css.resultsSummaryClass+"' data-full-route\x3d'true'\x3e\x3cdiv class\x3d'esriImpedanceCost'\x3e";if(this._isTimeUnits(M.units))k+=this._formatTime(u.trafficCost,!0,u.timeAtt.units)+"\x3cdiv class\x3d'esriImpedanceCostHrMin'\x3e\x3cdiv class\x3d'esriImpedanceCostHr'\x3e"+D.widgets.directions.time.hr+"\x3c/div\x3e\x3cdiv class\x3d'esriImpedanceCostMin'\x3e"+D.widgets.directions.time.min+"\x3c/div\x3e\x3c/div\x3e\x3c/div\x3e\x3cdiv class\x3d'esriOtherCosts'\x3e"+(u.noTrafficCost?
"\x3cdiv class\x3d'esriTrafficLabel "+u.labelClass+"'\x3e"+u.label+"\x3c/div\x3e"+u.noTrafficCostStr:"")+this._formatDistance(c.totalLength);else{M=(M=D.widgets.directions.units[this.directionsLengthUnits])?M.name:"";var A=this.serviceDescription&&10.6<=this.serviceDescription.currentVersion,Z=this.directions.features[0].attributes;k+=a.format(c.totalLength,{places:1})+"\x3cdiv class\x3d'esriImpedanceCostDist'\x3e"+M+"\x3c/div\x3e\x3c/div\x3e\x3cdiv class\x3d'esriOtherCosts'\x3e"+(u.noTrafficCost&&
A?"\x3cdiv class\x3d'esriTrafficLabel "+u.labelClass+"'\x3e"+u.label+"\x3c/div\x3e"+u.noTrafficCostStr:"")+this._formatTime(c.totalTime)+" "+("none"!==this.startTime&&u.noTrafficCost&&A?D.widgets.directions.atTheMoment+" "+this._toSpatiallyLocalTimeString(Z.arriveTimeUTC,Z.ETA):"")}k+="\x3c/div\x3e\x3c/div\x3e"}return k},_renderDirectionsTable:function(c){for(var k=0,u=0,M=0,A='\x3ctable summary\x3d"'+c.routeName+'"\x3e\x3ctbody role\x3d"menu"\x3e',Z=0;Z<c.features.length;Z++){var ba=c.features[Z].attributes;
"esriDMTDepart"===ba.maneuverType&&(u=M=0);M+=ba.length;u+=ba.time;k+=ba.time;A+=this._renderDirectionsItemTR(c.features[Z],M,u,k)}return A+"\x3c/tbody\x3e\x3c/table\x3e"},_renderDirectionsItemTR:function(c,k,u,M){var A=this.directions,Z=A?X.indexOf(A.features,c):-1;M="";var ba=this._css.routeClass,ea=c._associatedStopWithReturnToStart&&c._associatedStopWithReturnToStart.attributes,fa=c.attributes;if(-1<Z){fa&&(fa.step=Z+1);fa.maneuverType&&(ba+=" "+fa.maneuverType);ea&&null===ea.ArriveCurbApproach&&
null!==ea.DepartCurbApproach?ba+=" "+this._css.routeOriginClass:ea&&null!==ea.ArriveCurbApproach&&null===ea.DepartCurbApproach&&(ba+=" "+this._css.routeDestinationClass+" "+this._css.routeLastClass);M+='\x3ctr tabindex\x3d"0" role\x3d"menuitem" class\x3d"'+ba+" "+this._css.routeZoomClass+'" data-segment\x3d"'+Z+'"\x3e';M+='\x3ctd class\x3d"'+this._css.routeIconColumnClass+'"\x3e';M+='\x3cdiv class\x3d"'+this._css.routeIconClass+'"\x3e';M+=this._getLetter(c._associatedStop);M=M+'\x3c/div\x3e\x3c/td\x3e\x3ctd class\x3d"'+
(this._css.routeTextColumnClass+'"\x3e');M+='\x3cdiv class\x3d"'+this._css.routeInfoClass+'"\x3e';M+='\x3cdiv class\x3d"'+this._css.routeTextClass+'"\x3e';c=(A.strings[Z]||[]).slice();if("esriDMTDepart"===fa.maneuverType||"esriDMTStop"===fa.maneuverType)for(A=0;A<this.stops.length;A++)this.stops[A]&&this.stops[A].name&&c.push({string:this.stops[A].name});if(c){ba=fa.text;for(A=0;A<c.length;A++)ba=this._boldText(ba,c[A].string);fa.formattedText=ba}else fa.formattedText=fa.text;if("esriDMTStop"===fa.maneuverType&&
(k||u)||"esriDMTDepart"===fa.maneuverType&&0===Z)k=this._formatDistance(k-fa.length,!0),u=this._formatTime(u-fa.time),Z=this._formatTime(fa.time),c=this._formatDistance(fa.length,!0),fa.formattedText+="\x3cdiv class\x3d'esriRouteTextColumnCumulative'\x3e"+k+(k&&u?" \x26middot; ":"")+u+(k||u?"\x3cbr\x3e":"")+(Z?D.widgets.directions.serviceTime+":\x26nbsp;"+Z:"")+(Z&&c?"\x3cbr\x3e":"")+(c?D.widgets.directions.serviceDistance+":\x26nbsp;"+c:"")+"\x3c/div\x3e";M+="\x3cstrong\x3e"+a.format(fa.step)+".\x3c/strong\x3e "+
fa.formattedText;M+="\x3c/div\x3e";k=this._formatDistance(fa.length,!0);u=this._formatTime(fa.time);"esriDMTStop"!==fa.maneuverType&&"esriDMTDepart"!==fa.maneuverType||!this.routeParams.startTime||-22091616E5===fa.ETA?k&&(M+='\x3cdiv class\x3d"'+this._css.routeLengthClass+'"\x3e',M+=k,u&&(M+="\x26nbsp;\x26middot;\x3cwbr\x3e\x26nbsp;"+u),M+="\x3c/div\x3e"):M+='\x3cdiv class\x3d"'+this._css.routeLengthClass+'"\x3e'+this._toSpatiallyLocalTimeString(fa.arriveTimeUTC,fa.ETA)+"\x3c/div\x3e";M+="\x3c/div\x3e\x3c/td\x3e\x3c/tr\x3e"}return M},
_toSpatiallyLocalTimeString:function(c,k){var u=new Date(k),M=new Date(u.getTime()+6E4*u.getTimezoneOffset());M=Q.date.locale.format(M,{selector:"time"});var A="";c?(k=(k-c)/1E3/60/60,c=Math.floor(k),k=60*(k-c),c=D.widgets.directions.GMT+(0>c?"":"+")+a.format(c,{pattern:"00"})+a.format(k,{pattern:"00"}),A=M+" "+c):A="now"===this.startTime?Q.date.locale.format(u,{selector:"time"}):M;return A},_addStopWrapperToGraphic:function(c,k){return{extent:new v({xmin:c.geometry.x-.25,ymin:c.geometry.y-.25,xmax:c.geometry.x+
.25,ymax:c.geometry.y+.25,spatialReference:c.geometry.spatialReference}),feature:c,name:k}},_clearBarriersGraphics:function(){this._barriersLayer.clear();this._polylineBarriersLayer.clear();this._polygonBarriersLayer.clear()},_showBarriers:function(){this._clearBarriersGraphics();var c=this.routeParams,k=c.polylineBarriers&&c.polylineBarriers.features||[],u=c.polygonBarriers&&c.polygonBarriers.features||[];X.forEach(c.barriers&&c.barriers.features||[],t.hitch(this,function(M){this._barriersLayer.add(M)}));
X.forEach(k,t.hitch(this,function(M){this._polylineBarriersLayer.add(M)}));X.forEach(u,t.hitch(this,function(M){this._polygonBarriersLayer.add(M)}));this._barriersLayer.refresh();this._polylineBarriersLayer.refresh();this._polygonBarriersLayer.refresh()},_showRoute:function(c){this._clearDisplayAfterSolve();var k=c.routeResults[0].directions,u=new P;if(k){this.set("solveResult",c);this.set("directions",k);var M=c.routeResults[0].stops,A,Z;if(M&&M.length){var ba=[];for(A=0;A<M.length;A++){var ea=M[A];
ea.attributes.isWaypoint=ea.attributes.Name===this._waypointName||ea.attributes.isWaypoint;ea=this._addStopWrapperToGraphic(ea,ea.attributes.Name);this.stops[A]&&this.stops[A].feature&&this.stops[A].feature.attributes&&this.stops[A].feature.attributes.Name===this._userDefinedStopName&&(ea.feature.attributes.Name=this._userDefinedStopName);this._returnToStartStop&&this._returnToStartStop._resultsStopIndex===A?this._returnToStartStop=ea:ba.push(ea)}if(this.stops.length>ba.length)for(A=0;A<this.stops.length;A++)this.stops[A].feature||
""!==this.stops[A].name||ba.splice(A,0,this._emptyStop);this.stops=ba;for(A=0;A<this.stops.length;A++)this._updateStop(this.stops[A],A);this._setStops();this._setMenuNodeValues()}this.set("mergedRouteGraphic",new B(k.mergedGeometry,this.get("routeSymbol")));M=[];ba=[];for(A=ea=0;A<k.featuresWithWaypoints.length;A++){var fa=k.featuresWithWaypoints[A];if("esriDMTDepart"===fa.attributes.maneuverType)for(Z=0;Z<this.stops.length;Z++)if(this.stops[Z].feature===fa._associatedStop){ea=Z+1;break}fa.setSymbol(this.get("routeSymbol"));
this._routeLayer.add(fa);M.push(fa);(Z=fa.getDojoShape())&&Z.moveToBack();Z=new B(fa.geometry,this._symbolEventPaddingDirections,fa.attributes);Z._nextStopIndex=ea-.5;Z._isSnapFeature=!0;fa._associatedSnapFeature=Z;this._waypointsEventLayer.add(Z);"esriDMTDepart"!==fa.attributes.maneuverType&&(Z=fa.geometry.getPoint(0,0))&&(Z=new B(Z,this.maneuverSymbol),Z._directionsFeature=fa._associatedFeatureNoWaypoints,ba.push(Z),this._waypointsEventLayer.add(ba[ba.length-1]))}this.set("displayedRouteGraphics",
M);this.set("displayedManeuverPointGraphics",ba);this._renderDirections();for(A=0;A<this.stops.length;A++)if(this._isStopAWaypoint(this.stops[A])&&this._modifiedWaypointIndex===A){for(Z=0;Z<k.featuresWithWaypoints.length;Z++)if(M=k.featuresWithWaypoints[Z],M._associatedStop===this.stops[A].feature){if("esriDMTStop"===M.attributes.maneuverType||"esriDMTDepart"===M.attributes.maneuverType)this.stops[A].feature.geometry.x=M.geometry.paths[0][0][0],this.stops[A].feature.geometry.y=M.geometry.paths[0][0][1];
break}this._modifiedWaypointIndex=null;break}U.set(this._savePrintBtnContainer,"display","inline-block");this.onDirectionsFinish(c)}else c=c.routeResults[0].route,c.setSymbol(this.routeSymbol),this._routeLayer.add(c),this._incrementalRouteSegment=c;u.resolve();this._moveLayersToFront();this.createRouteSymbols();return u.promise},_setGeocodersStopReference:function(){if(this.geocoders)for(var c=0;c<this.geocoders.length;c++)this.geocoders[c]&&this.stops[c]&&(this.geocoders[c]._stopReference=this.stops[c])},
_setStops:function(){this._setGeocodersStopReference();this.createRouteSymbols();this._set("stops",this.stops);this.onStopsUpdate(this.stops)},_getCandidates:function(c){var k=[];if(c&&c.length){for(var u=0;u<c.length;u++)k.push(this._getCandidate(c[u]));return na(k)}c=new P;c.resolve([]);return c.promise},_clearResultsHTML:function(){this._resultsNode.innerHTML="";U.set(this._savePrintBtnContainer,"display","none")},_showSegmentPopup:function(c){if(c&&this.get("showSegmentPopup")&&this.get("map").infoWindow){var k=
c.geometry.getPoint(0,0);c=new B(k,null,c.attributes,this.get("segmentInfoTemplate"));var u=this.get("map").infoWindow;u.setFeatures([c]);u.show(k)}},_addStopButton:function(){this.addStop().then(t.hitch(this,function(){this.get("focusOnNewStop")&&this.geocoders[this.stops.length-1].focus()}))},_sortGeocoders:function(){var c=this._dnd.getAllNodes();this.geocoders.sort(t.hitch(this,function(u,M){return u.domNode&&u.domNode.parentNode&&u.domNode.parentNode.parentNode&&M.domNode&&M.domNode.parentNode&&
M.domNode.parentNode.parentNode?X.indexOf(c,u.domNode.parentNode.parentNode)>X.indexOf(c,M.domNode.parentNode.parentNode)?1:-1:0}));this.stops.length===this.geocoders.length&&this._sortStops();for(var k=0;k<this.geocoders.length;k++)this.geocoders[k]&&this.geocoders[k].inputNode&&(this.geocoders[k].inputNode.title=D.widgets.directions.stopNoTitle+(k+1));this._setLocateButtonVisibilityEvents()},_disconnectResults:function(){if(this._resultEvents&&this._resultEvents.length)for(var c=0;c<this._resultEvents.length;c++)this._resultEvents[c]&&
this._resultEvents[c].remove();this._resultEvents=[]},_formatArbitraryCostsForRouteTooltip:function(c){var k="",u;for(u in c)if(0===u.indexOf("Total_")&&c.hasOwnProperty(u)){var M=this._getCostAttribute(u.substr(6));M&&(k+=this._isTimeUnits(M.units)?this._formatTime(c[u],!1,M.units):this._formatDistance(c[u],!0,M.units),k+=k?" \x26middot; ":"")}k&&(k=D.widgets.directions.toNearbyStops+": \x3cb\x3e"+k.substr(0,k.length-10)+"\x3c/b\x3e");return k},_formatTime:function(c,k,u){u||(u=(this._getDirectionsTimeAttribute()||
{}).units);var M="";u=Math.round(this._convertCostValue(c,u,"esriNAUMinutes"));c=Math.floor(u/60);u=Math.floor(u%60);k?M=a.format(c,{pattern:100>c?"00":"000"})+":"+a.format(u,{pattern:"00"}):(c&&(M+=c+" "+D.widgets.directions.time.hr+" "),M+=c||u?u+" "+D.widgets.directions.time.min:"");return M},_formatDistance:function(c,k,u){u||(u=this.directionsLengthUnits);var M=this.directionsLengthUnits,A=D.widgets.directions.units[M],Z=M.replace("esri","").toLowerCase();c=this._convertCostValue(c,u,M);A&&(Z=
k?A.abbr:A.name);return c?a.format(c,{locale:"root",places:2})+" "+Z:""},_projectToGeographic:function(c){var k=new P;if(!c)return k.reject("Directions:: 'geometry' is not defined.",{geometry:c}),k.promise;if(4326==c.spatialReference.wkid)return k.resolve(c),k.promise;if(!this._geometryService)return k.reject("Directions:: Geometry service is not defined."),k.promise;var u=new Ya;u.outSR=new ta(4326);u.geometries=[c];this._geometryService.project(u).then(function(M){k.resolve(M&&M[0])},k.reject);
return k.promise},_createToolbars:function(){this.editToolbar||(this.editToolbar=new Ua(this.map));this.drawToolbar||(this.drawToolbar=new Xa(this.map),D.toolbars.draw.freehand=D.widgets.directions.lineBarrierFreehand,this.drawToolbar.onDrawComplete=t.hitch(this,function(c){var k=new B(c.geometry,null,{BarrierType:0});this._projectToGeographic(c.geographicGeometry||c.geometry).then(t.hitch(this,function(u){1<G.geodesicLengths([u],ca.METERS)[0]&&(this._polylineBarriersLayer.add(k),this.routeParams.polylineBarriers||
(this.routeParams.polylineBarriers=new Y),this.routeParams.polylineBarriers.features.push(k),this._clearStopsStatusAttr(),this.getDirections(!0))}))}))},_destroyGlobalGeocoder:function(){this._globalGeocoder&&(this._globalGeocoder.destroy(),this._globalGeocoder=null)},_createGlobalGeocoder:function(){var c=new P;this._globalGeocoder=new cb(this.get("searchOptions"));K.once(this._globalGeocoder,"load",c.resolve,c.reject);this._globalGeocoder.startup();return c.promise},_init:function(){var c=new P;
this.set("loaded",!1);this._enableButton(this._getDirectionsButtonNode,!1);U.set(this._saveAsButton,"display","none");this.clearMessages();if(this.get("map").loaded)this._configure().always(c.resolve);else K.once(this.get("map"),"load",t.hitch(this,function(){this._configure().always(c.resolve)}));return c.promise},_setDefaultStops:function(){var c=new P;this.defaults.stops&&this.defaults.stops.length?this._updateStops(this.defaults.stops).then(t.hitch(this,function(){this._removeEmptyStops();c.resolve()}),
c.reject):c.resolve();return c.promise},_configure:function(){var c=new P;this._handle&&this._handle._remove();this._createDnD();this._createDepartAtControls();this._setSearchOptions();this._createGlobalGeocoder().then(t.hitch(this,function(){this._createToolbars();this._usingAGOL()||(this.printTaskUrl=this.geometryTaskUrl=null);this._createGeometryTask();this._createPrintTask();this._showActivateButton();this._showBarriersButton();this._createTravelModesDDL();this._createSearchSourceDDL();var k=
[this._createRouteTask(),this._setDefaultStops()];na(k).then(t.hitch(this,function(){this._setDefaultUnits();this._setTrafficOptions();this._setMenuNodeValues();this._setupEvents();var u=this.directionsLanguage||this.userOptions.routeParams&&this.userOptions.routeParams.directionsLanguage||Q.locale.toLowerCase();this._setDirectionsLanguageByLocale(u);this._setupTravelModes().then(t.hitch(this,function(){this.set("loaded",!0);this.onLoad();c.resolve(!0)}),function(M){c.reject(M)})}),function(u){c.reject(u)})}),
function(k){c.reject(k)});this._naRouteSharing=null;return c.promise},_setDirectionsLanguageByLocale:function(c){var k=this.serviceDescription.directionsSupportedLanguages,u=function(A){if(k)for(var Z=0;Z<k.length;Z++)if(k[Z].toLowerCase().substr(0,2)===A)return k[Z];return null},M=u(c);M||(c=c.substr(0,2),M=u(c));this.directionsLanguage=M;return this.routeParams.directionsLanguage=M},_getStopSymbol:function(c,k){var u=c&&(c.feature&&c.feature.attributes||c.attributes),M=this.stopSymbol;u&&(M=this._isStopAWaypoint(c)?
this.waypointSymbol:void 0===u.Status||0===u.Status||6===u.Status?null===u.ArriveCurbApproach&&null!==u.DepartCurbApproach?this.get(k?"fromSymbolDrag":"fromSymbol"):null!==u.ArriveCurbApproach&&null===u.DepartCurbApproach?this.get(k?"toSymbolDrag":"toSymbol"):this.get(k?"stopSymbolDrag":"stopSymbol"):this.get(k?"unreachedSymbolDrag":"unreachedSymbol"));return M},_addTrafficLayer:function(){this.trafficLayer&&!this._trafficLayerAdded&&this.map&&(this.map.addLayer(this.trafficLayer),this.trafficLayer.show(),
this._trafficLayerAdded=!0)},_toggleUnits:function(c){c.target===this._useMilesNode?this.setDirectionsLengthUnits(ca.MILES):c.target===this._useKilometersNode&&this.setDirectionsLengthUnits(ca.KILOMETERS)},_toggleCheckbox:function(c){var k=S.get(c.target,"checked");c.target===this._findOptimalOrderNode?this.set("optimalRoute",k):c.target===this._useTrafficNode?this.set("traffic",k):c.target===this._returnToStartNode&&this.set("returnToStart",k)},_isStopLocated:function(c){return c&&c.feature&&c.feature.attributes&&
(!c.feature.attributes.Status||6===c.feature.attributes.Status)},_configureRouteOptions:function(){var c=this.get("routeParams"),k;this.get("directionsLengthUnits")?c.directionsLengthUnits=this.get("directionsLengthUnits"):this.set("directionsLengthUnits",c.directionsLengthUnits);c.findBestSequence=this.get("optimalRoute");if(c.findBestSequence)for(c.preserveFirstStop=this._isStopLocated(this.stops[0]),c.preserveLastStop=!this.returnToStart&&this._isStopLocated(this.stops[this.stops.length-1])||this.returnToStart&&
this._isStopLocated(this.stops[0]),k=0;k<this.stops.length;)this._isStopAWaypoint(this.stops[k])?this._removeStop(k,!0,!0):k++;if(!this.returnToStart&&this.stops.length&&this._isStopAWaypoint(this.stops[this.stops.length-1]))for(k=this.stops.length-1;0<k;)this._isStopAWaypoint(this.stops[k])&&this._removeStop(k,!0,!0),k--;if(this._isTimeUnits(this._getImpedanceAttribute().units)||this.serviceDescription&&10.6<=this.serviceDescription.currentVersion)if(c.useTimeWindows=!0,"now"===this.startTime)c.timeWindowsAreUTC=
!0,c.startTimeIsUTC=!0,c.startTime=new Date;else if("none"===this.startTime)c.startTime=null;else{c.timeWindowsAreUTC=!1;c.startTimeIsUTC=!1;var u=this._departAtTime,M=6E4*u.getValue().getTimezoneOffset();u=new Date(u.getValue().getTime()+this._departAtDate.getValue().getTime()-M);u=new Date(u.getTime()-6E4*u.getTimezoneOffset());c.startTime=u}else c.startTime=null,c.useTimeWindows=!1;u=this._getImpedanceAttribute();M=this._getTimeNeutralAttribute();var A=this._getDirectionsTimeAttribute();k=this.routeParams.accumulateAttributes||
this.serviceDescription.accumulateAttributeNames;M&&-1===X.indexOf(k,M.name)&&k.push(M.name);!this._isTimeUnits(u.units)&&this.serviceDescription&&10.6<=this.serviceDescription.currentVersion&&A&&-1===X.indexOf(k,A.name)&&k.push(A.name);this.routeParams.accumulateAttributes=k;c.returnStops=!0;A=[];for(k=0;k<this.stopGraphics.length;k++)if(this.stopGraphics[k]&&(A.push(new B(this.stopGraphics[k].toJson())),k)){var Z=A[0].attributes,ba=A[k].attributes;for(ea in ba)ba.hasOwnProperty(ea)&&!Z.hasOwnProperty(ea)&&
(Z[ea]=null)}if(this.get("returnToStart")&&this.stopGraphics.length&&this._isStopLocated(this.stops[0])){var ea=new B(this.stopGraphics[0].toJson());this._returnToStartStop=this._addStopWrapperToGraphic(ea,ea.attributes.Name);A.push(ea)}else this._returnToStartStop=null;c.stops.features=A;if(M)for(k=0;k<A.length;k++)A[k].attributes["Attr_"+M.name]=this._convertCostValue(A[k].attributes["Attr_"+u.name],u.units,M.units);this.set("routeParams",c)},_configureRoute:function(){var c=new P;c.promise.always(t.hitch(this,
function(){this._checkMaxStops()}));this.createRouteSymbols();this._configureRouteOptions();if(this.routeParams.returnRoutes&&this._incrementalSolveStopRange){var k=this._incrementalSolveStopRange;k.start<k.end?this.routeParams.stops.features=this.routeParams.stops.features.slice(k.start,k.end+1):k.start>k.end&&(this.routeParams.stops.features=this.routeParams.stops.features.slice(k.start,this.routeParams.stops.features.length-1).concat(this.routeParams.stops.features.slice(0,k.end+1)))}else this._incrementalSolveStopRange=
null;var u={},M=this.routeParams.stops.features;for(k=0;k<M.length;k++){var A=M[k].attributes.address;var Z=(k===this._handle._index&&!this._handle.attributes.isWaypoint&&this._incrementalSolveStopRange?this._waypointName:A)+"_"+this._stopSequence++;M[k].attributes.Name=Z;u[Z]=A;delete M[k].attributes.address;delete M[k].attributes.isWaypoint;delete M[k].attributes.Status}this._solveInProgress=!0;var ba={_incrementalSolveStopRange:this._incrementalSolveStopRange};this.routeTask.solve(this.routeParams,
t.hitch(this,function(ea){this._solveResultProcessing(ea,u,ba).then(c.resolve,c.reject)}),t.hitch(this,function(ea){t.mixin(this,ba);this._solveInProgress=!1;for(var fa=0;fa<this.stops.length;fa++)this.stops[fa].feature&&(this.stops[fa].feature.attributes=t.mixin(this.stops[fa].feature.attributes,{Status:5}));this.set("directions",null);this._clearDisplayAfterSolve();this.createRouteSymbols();this._routeTaskError(ea);c.reject(ea)}));return c.promise},_solveResultProcessing:function(c,k,u){var M=new P;
t.mixin(this,u);this._solveInProgress=!1;u=c.routeResults[0];var A=u.directions;u=u.stops;if(A){this._solverMessages=c.messages;var Z=function(sa){for(var wa in k)if(sa&&0===A.routeName.indexOf(wa)||!sa&&0<A.routeName.indexOf(wa))return k[wa];return""};var ba=Z(!0);Z=Z(!1);A.routeName=(ba!==this._waypointName?ba:D.widgets.directions.waypoint)+" \u2014 "+(Z!==this._waypointName?Z:D.widgets.directions.waypoint);for(ba=0;ba<A.features.length;ba++)if(Z=A.features[ba].attributes,"esriDMTDepart"===Z.maneuverType||
"esriDMTStop"===Z.maneuverType)for(var ea in k)if(k.hasOwnProperty(ea)&&-1<Z.text.indexOf(ea)){Z.text=Z.text.replace(ea,k[ea]);for(var fa=0;fa<u.length;fa++){var pa=u[fa].attributes;if(pa.Name===ea){t.mixin(A.features[ba],{_associatedStop:u[this.returnToStart&&fa===u.length-1?0:fa],_associatedStopWithReturnToStart:u[fa]});if(!pa.ArriveTime&&!pa.ArriveTimeUTC&&Z.ETA&&Z.arriveTimeUTC){pa.ArriveTime=Z.ETA;pa.ArriveTimeUTC=Z.arriveTimeUTC;fa=0;if(0==ba&&"esriDMTDepart"===Z.maneuverType||0<ba&&"esriDMTStop"===
Z.maneuverType)fa=this._convertCostValue(Z.time,(this._getDirectionsTimeAttribute()||{}).units,"milliseconds");pa.DepartTime=pa.ArriveTime+fa;pa.DepartTimeUTC=pa.ArriveTimeUTC+fa}break}}}for(ba=0;ba<u.length;ba++)this._returnToStartStop&&u[ba].attributes.Name===this._returnToStartStop.feature.attributes.Name&&(this._returnToStartStop._resultsStopIndex=ba),u[ba].attributes.Name=k[u[ba].attributes.Name];this._directionsPostprocessing(A);this.traffic&&this._updateMapTimeExtent()}this._showRoute(c).always(t.hitch(this,
function(){this._incrementalSolveStopRange=null;M.resolve(c)}));return M.promise},_directionsPostprocessing:function(c){var k,u=function(Z,ba){var ea=c.features[Z]._associatedFeaturesWithWaypoints||[];ea.push(c.featuresWithWaypoints[ba]);c.features[Z]._associatedFeaturesWithWaypoints=ea;c.featuresWithWaypoints[ba]._associatedFeatureNoWaypoints=c.features[Z]};var M=t.hitch(this,function(Z){return"\x3cdiv class\x3d'"+this.theme+"'\x3e\x3ctable class\x3d'esriRoutesTooltip'\x3e"+this._renderDirectionsItemTR(Z._associatedFeatureNoWaypoints)+
"\x3c/table\x3e\x3c/div\x3e"});c.featuresWithWaypoints=[];for(k=0;k<c.features.length;k++){var A=new B(c.features[k].toJson());A.setInfoTemplate(new oa({title:this._i18n.widgets.directions.maneuver,content:M}));c.featuresWithWaypoints.push(A);c.featuresWithWaypoints[k]._associatedStop=c.features[k]._associatedStop;c.featuresWithWaypoints[k]._associatedStopWithReturnToStart=c.features[k]._associatedStopWithReturnToStart}c.stringsWithWaypoints=t.mixin([],c.strings);c.eventsWithWaypoints=t.mixin([],
c.events);for(M=k=0;k<c.features.length;)c.features[k]._associatedStop&&c.features[k]._associatedStop.attributes.Name===this._waypointName?(c.features.splice(k,k?2:1),c.strings.splice(k,k?2:1),c.events.splice(k,k?2:1),k&&c.features[k]&&"esriDMTStraight"===c.features[k].attributes.maneuverType?(A=c.features.splice(k,1)[0],c.strings[k-1]=(c.strings[k-1]||[]).concat(c.strings.splice(k,1)[0]||[]),c.strings[k-1].length||(c.strings[k-1]=void 0),c.events[k-1]=(c.events[k-1]||[]).concat(c.events.splice(k,
1)[0]||[]),c.events[k-1].length||(c.events[k-1]=void 0),c.features[k-1].attributes.length+=A.attributes.length,c.features[k-1].attributes.time+=A.attributes.time,c.features[k-1].geometry.paths[0]=c.features[k-1].geometry.paths[0].concat(A.geometry.paths[0]),u(k-1,M++),u(k-1,M++),u(k-1,M++)):(k&&u(k-1,M++),k<c.features.length&&u(k,M++))):(u(k,M++),k++)},_boldText:function(c,k){try{var u=new RegExp("[^\x3cstrong\x3e\x26nbsp;]"+k.replace(/(\||\$|\^|\(|\)|\[|\]|\{|\}|\/|\.|\+|\*|\?|\?)/g,"\\$1")+"[^\x26nbsp;\x3c/strong\x3e]",
"g");c=(" "+c+" ").replace(u,"\x3cstrong\x3e\x26nbsp;"+k+"\x26nbsp;\x3c/strong\x3e");c=c.trim()}catch(M){}return c},_clearStopGraphics:function(){if(this.stopGraphics&&this.stopGraphics.length)for(var c=0;c<this.stopGraphics.length;c++)this._stopLayer.remove(this.stopGraphics[c]),this._stopLayer.remove(this.textGraphics[c]);this.set("stopGraphics",[]);this.set("textGraphics",[])},_updateMapTimeExtent:function(){if(this.map){var c=this.directions&&this.directions.features[0]&&this.directions.features[0].attributes||
{},k=(new Date).getTime();k="none"==this.startTime?k:c.arriveTimeUTC||k;this._useTrafficItemNode.title="none"!==this.startTime&&c.arriveTimeUTC?D.widgets.directions.trafficLabelDepartAt+": "+this._toSpatiallyLocalTimeString(c.arriveTimeUTC,c.ETA):"";this._myTimeExtentUpdate=!0;c=new Date(k);this.map.setTimeExtent(new ra(c,c))}},_restoreMapTimeExtent:function(){this.map&&(this._myTimeExtentUpdate=!0,this.map.setTimeExtent(this._externalTimeExtent))},_clearRouteGraphics:function(){for(var c=this.displayedRouteGraphics,
k=this.displayedManeuverPointGraphics,u=this._routeLayer,M=this._waypointsEventLayer,A=0,Z=0,ba=this._incrementalSolveStopRange?this._incrementalSolveStopRange:{start:0,end:this.stops?this.stops.length:-1};c&&Z<c.length;){if(c[Z]._associatedStop)for(var ea=0;ea<this.stops.length;ea++)if(this.stops[ea].feature===c[Z]._associatedStop){A=ea;break}A>=ba.start&&A<ba.end||ba.start>=ba.end&&(A>=ba.start||A<ba.end)?(u.remove(c[Z]),c.splice(Z,1)):Z++}u.remove(this._incrementalRouteSegment);this.set("displayedRouteGraphics",
c?c:[]);k&&k.length&&X.forEach(k,function(fa){M.remove(fa)});this.set("displayedManeuverPointGraphics",[]);this._waypointsEventLayer.clear();this.unhighlightSegment(!0)},_clearInfoWindow:function(){var c=this.get("map").infoWindow;c&&(c.hide(),c.clearFeatures())},_clearDisplayBeforeSolve:function(){this._toggleSaveMenu(!1);this._clearInfoWindow();this._clearResultsHTML()},_clearDisplayAfterSolve:function(){this._clearStopGraphics();this._clearRouteGraphics();this._clearBarriersGraphics();this.clearMessages()},
_getLetter:function(c){var k=this.alphabet,u="",M=function(ba){var ea="";"0123456789"===k||"1234567890"===k?ea=String(ba+1):(ba=ba||0,ba>=k.length&&(ea=M(Math.floor(ba/k.length)-1),ba%=k.length),ea+=k[ba]);return ea},A=c instanceof B?t.hitch(this,function(){for(var ba=this.get("returnToStart")?0:-1,ea=0;ea<this.stops.length;ea++)if(this.stops[ea].feature===c){ba=ea;break}return ba})():c;if(-1<A&&k&&k.length){k instanceof Array&&(k=k.toString().replace(/,/g,""));u=-1;for(var Z=0;Z<=A;Z++)u+=this._isStopAWaypoint(this.stops[Z])?
0:1;u=M(u)}return u},_solveAndZoom:function(c){if(this.autoSolve)return this._getDirections().then(t.hitch(this,function(){c||this.zoomToFullRoute()}));var k=new P;k.resolve();return k.promise},_setupEvents:function(){this._onEvents.push(K(this.domNode,"[data-blur-on-click]:click",function(){this.blur()}));this._onEvents.push(K(this._dndNode,"[data-reverse-stops]:click, [data-reverse-stops]:keydown",t.hitch(this,function(A){A&&("click"===A.type||"keydown"===A.type&&A.keyCode===x.ENTER)&&this.modifyStopSequence()})));
this._onEvents.push(K(this._printButton,"click, keydown",t.hitch(this,function(A){A&&("click"===A.type||"keydown"===A.type&&A.keyCode===x.ENTER)&&this._printDirections()})));this._onEvents.push(K(this._resultsNode,"[data-full-route]:click, [data-full-route]:keydown",t.hitch(this,function(A){A&&("click"===A.type||"keydown"===A.type&&A.keyCode===x.ENTER)&&this.zoomToFullRoute()})));this._onEvents.push(K(this._dndNode,"[data-remove]:click, [data-remove]:keydown",t.hitch(this,function(A){if(A&&("click"===
A.type||"keydown"===A.type&&A.keyCode===x.ENTER)){var Z=F("[data-remove]",this._dndNode);A=X.indexOf(Z,A.target);this.removeStop(A)}})));this._onEvents.push(K(this._dndNode,"[data-center-at]:click, [data-center-at]:keydown",t.hitch(this,function(A){if(A&&("click"===A.type||"keydown"===A.type&&A.keyCode===x.ENTER)){var Z=F("[data-center-at]",this._dndNode);A=X.indexOf(Z,A.target);this.stops[A]&&this.stops[A].feature&&this.stops[A].feature.geometry&&this.map.centerAndZoom(this.stops[A].feature.geometry)}})));
this._onEvents.push(K(this.map,"zoom-end",t.hitch(this,function(){var A=this._segmentGraphics;A&&A[0]&&void 0!==A[0].attributes._index&&this.highlightSegment(A[0].attributes._index,!0)})));this._onEvents.push(K(this._dnd,"Drop",t.hitch(this,function(){this._dnd.sync();this.set("optimalRoute",!1);var A,Z=!1,ba=[],ea=this._dnd.getAllNodes();for(A=0;A<this.geocoders.length;A++){var fa=X.indexOf(ea,this.geocoders[A]._tr);if(-1<fa&&A!==fa&&A!==fa-1){for(;0<fa&&this._isStopAWaypoint(this.stops[fa]);)fa--;
Z=!0;break}}Z&&(ba=this._markWPsForRemovalAfterUserChangedStopSequence(A,fa));this._sortGeocoders();this.setListIcons();this._removeSomeWaypoints(ba);this.stops[fa].name&&this.getDirections()})));this._onEvents.push(K(this._dnd,"DndStart",t.hitch(this,function(){var A=F("body")[0];N.add(A,this._css.dndDragBodyClass);this._removeLocateButtonVisibilityEvents()})));this._onEvents.push(K(this._dnd,"DndDrop, DndCancel",t.hitch(this,function(){var A=F("body")[0];N.remove(A,this._css.dndDragBodyClass);this._setLocateButtonVisibilityEvents()})));
var c=this._handle,k=t.hitch(this,function(A){var Z=t.hitch(this,function(ea,fa,pa,sa,wa){var ya=c._isShown();c.setGeometry(ea);c._tooltip.style.left=A.screenPoint.x+"px";c._tooltip.style.top=A.screenPoint.y+"px";!ya||c._index===pa&&c.attributes.isWaypoint===sa||(c._remove(),ya=!1);c.setSymbol(fa);c._index=pa;c._isStopIcon=c._index===Math.floor(c._index);c.attributes.isWaypoint=sa;c._isStopIcon&&(c.attributes.address=this.stopGraphics[pa].attributes.address,c.setInfoTemplate(this.stopGraphics[pa].infoTemplate));
if(this.canModifyWaypoints||c._isStopIcon)ya||(this._stopLayer.add(c),(ea=c.getDojoShape())&&ea[sa?"moveToBack":"moveToFront"].call(ea)),this.editToolbar.activate(Ua.MOVE,c);sa=sa?c._isStopIcon?D.widgets.directions.dragWaypoint:this.canModifyWaypoints?D.widgets.directions.dragRoute:"":D.widgets.directions.dragStop;c._showTooltip(wa||sa)});this.unhighlightSegment();if(this.mapClickActive&&this.dragging&&!this._solveInProgress&&!this._moveInProgress&&!c._solveTimeout)if(clearTimeout(c._removeTimeout),
(A.graphic._isStopIcon||A.graphic._isStopLabel)&&!A.graphic.attributes.isWaypoint&&this.canModifyStops||A.graphic._isStopIcon&&A.graphic.attributes.isWaypoint&&this.canModifyWaypoints){var ba=A.graphic._isStopLabel?this.stopGraphics[A.graphic._index]:A.graphic;Z(ba.geometry,this._getStopSymbol(this.stops[ba._index],!0),ba._index,!0===ba.attributes.isWaypoint);this._stopLayer.remove(this.stopGraphics[ba._index]);this._stopLayer.remove(this.textGraphics[ba._index])}else if(A.graphic._isSnapFeature||
A.graphic._isHandle&&!A.graphic._isStopIcon)this._snappingManager||(this._snappingManager=this.map.snappingManager),this._snappingManager.getSnappingPoint(A.screenPoint).then(t.hitch(this,function(ea){if(!this.maxStopsReached&&!this._moveInProgress&&ea){for(var fa=this.displayedManeuverPointGraphics,pa=null,sa=0;sa<fa.length;sa++)if(fa[sa].geometry.x===ea.x&&fa[sa].geometry.y===ea.y){pa=fa[sa]._directionsFeature;fa=X.indexOf(this.directions.features,pa);-1<fa&&this.highlightSegment(fa);break}Z(ea,
A.graphic._isHandle?c.symbol:this.waypointSymbol,A.graphic._isHandle?c._index:A.graphic._nextStopIndex,A.graphic._isHandle?c.attributes.isWaypoint:!0,pa)}}))}),u=t.hitch(this,function(){clearTimeout(c._removeTimeout);c._removeTimeout=setTimeout(c._remove,100);this.unhighlightSegment()}),M=t.hitch(this,function(A){if(this.barrierToolActive){A=A.graphic;var Z=this.routeParams,ba=Z.barriers?X.indexOf(Z.barriers.features,A):-1,ea=Z.polygonBarriers?X.indexOf(Z.polygonBarriers.features,A):-1,fa=Z.polylineBarriers?
X.indexOf(Z.polylineBarriers.features,A):-1;-1<ba&&Z.barriers.features.splice(ba,1);-1<ea&&Z.polygonBarriers.features.splice(ea,1);-1<fa&&Z.polylineBarriers.features.splice(fa,1);this._barriersLayer.remove(A);this._polygonBarriersLayer.remove(A);this._polylineBarriersLayer.remove(A);this._clearStopsStatusAttr();this.getDirections(!0)}});this._onEvents.push(this._waypointsEventLayer.on("mouse-move",k));this._onEvents.push(this._waypointsEventLayer.on("mouse-out",u));this._onEvents.push(this._stopLayer.on("mouse-move",
k));this._onEvents.push(this._stopLayer.on("mouse-out",u));this._onEvents.push(this._barriersLayer.on("click",M));this._onEvents.push(this._polylineBarriersLayer.on("click",M));this._onEvents.push(this._polygonBarriersLayer.on("click",M));this._editToolbarEvents();this._watchEvents.push(this.watch("theme",this._updateThemeWatch));this._watchEvents.push(this.watch("canModifyStops",this._updateCanModifyStops));this._watchEvents.push(this.watch("canModifyWaypoints",this._updateCanAddWaypoints));this._watchEvents.push(this.watch("showReturnToStartOption",
this._optionsMenu));this._watchEvents.push(this.watch("showOptimalRouteOption",this._optionsMenu));this._watchEvents.push(this.watch("returnToStart",this._setMenuNodeValues));this._watchEvents.push(this.watch("optimalRoute",this._setMenuNodeValues));this._watchEvents.push(this.watch("startTime",this._setStartTime));this._watchEvents.push(this.watch("traffic",this._setMenuNodeValues));this._watchEvents.push(this.watch("trafficLayer",this._trafficLayerUpdate));this._watchEvents.push(this.watch("routeTaskUrl",
t.hitch(this,function(){this._createRouteTask();this._setTrafficOptions()})));this._watchEvents.push(this.watch("printTaskUrl",t.hitch(this,function(){this._createPrintTask()})));this._watchEvents.push(this.watch("geometryTaskUrl",t.hitch(this,function(){this._createGeometryTask()})));this._watchEvents.push(this.watch("routeParams",t.hitch(this,function(){this._createRouteParams();this._setDefaultUnits()})));this._watchEvents.push(this.watch("searchOptions",t.hitch(this,function(){this._setSearchOptions();
this._createGlobalGeocoder();var A=this.get("searchOptions").sources;if(A)for(var Z=0;Z<this.geocoders.length;Z++)this.geocoders[Z].set("sources",A)})));this._watchEvents.push(this.watch("showReverseStopsButton",this.setListIcons));this._watchEvents.push(this.watch("editToolbar",this._editToolbarEvents));this._watchEvents.push(this.watch("showTravelModesOption",this._showTravelModesOption));this._watchEvents.push(this.watch("showMilesKilometersOption",this._showMilesKilometersOption));this._watchEvents.push(this.watch("showClearButton",
this._showClearButton));this._watchEvents.push(this.watch("directionsLengthUnits",this.setDirectionsLengthUnits));this._watchEvents.push(this.watch("directionsLanguage",this.setDirectionsLanguage));this._watchEvents.push(this.watch("mapClickActive",this._activate));this._watchEvents.push(this.watch("barrierToolActive",this._activateBarrierTool));this._watchEvents.push(this.watch("showActivateButton",this._showActivateButton));this._watchEvents.push(this.watch("showBarriersButton",this._showBarriersButton));
this._watchEvents.push(this.watch("showPrintPage",function(){U.set(this._printButton,"display",this.showPrintPage?"inline-block":"none")}));this._watchEvents.push(this.watch("showSaveButton",function(){U.set(this._saveMenuButton,"display",this.showSaveButton&&this.owningSystemUrl?"inline-block":"none")}))},_editToolbarEvents:function(){var c=t.hitch(this,function(u){var M="";if((u=u.routeResults?u.routeResults[0]:null)&&u.route){u=u.route.attributes;var A=this.routeParams.travelMode;if(A){M+="\x3cb\x3e"+
A.name+"\x3c/b\x3e "+D.widgets.directions.toNearbyStops+": ";var Z=void 0!==u["Total_"+A.timeAttributeName]?this._formatTime(u["Total_"+A.timeAttributeName],!1,(this._getCostAttribute(A.timeAttributeName)||{}).units):"";M+=(void 0!==u["Total_"+A.distanceAttributeName]?this._formatDistance(u["Total_"+A.distanceAttributeName],!0,(this._getCostAttribute(A.distanceAttributeName)||{}).units):"")+(Z?" \x26middot; "+Z:"")}else M=this._formatArbitraryCostsForRouteTooltip(u)}this._handle._showTooltip(M)}),
k=t.hitch(this,function(u,M){var A=new P,Z=this._handle,ba=this.map.toScreen(Z._origPoint).offset(u.transform.dx+Z.symbol.xoffset,u.transform.dy+Z.symbol.yoffset);u.origMapPoint||(u.origMapPoint=this.map.toMap(ba));U.set(Z._tooltip,"left",ba.x+"px");U.set(Z._tooltip,"top",ba.y+"px");clearTimeout(Z._solveTimeout);if(this._solveInProgress||!this._requestQueueTail.isFulfilled())Z._solveTimeout=setTimeout(function(){k(u,M).always(A.resolve)},100);else if(Z._isStopIcon){ba=u.graphic._index;var ea=this.stops[ba];
(ea=ea?{name:ea.name,extent:ea.extent,feature:new B(ea.feature.toJson())}:null)?(ea.feature.setGeometry(u.origMapPoint),this._modifiedWaypointIndex=this._isStopAWaypoint(this.stops[ba])?ba:null,this._incrementalSolveStopRange={start:this.returnToStart?(this.stops.length+ba-1)%this.stops.length:Math.max(0,ba-1),end:this.returnToStart?(ba+1)%this.stops.length:Math.min(this.stops.length-1,ba+1)},this.updateStop(ea,ba,M).always(t.hitch(this,function(fa){Z._solveTimeout=null;fa.routeResults&&c(fa);A.resolve()}))):
A.resolve()}else A.resolve();return A.promise});this._onEvents.push(K(this.editToolbar,"graphic-click",t.hitch(this,function(u){if(u.graphic.attributes.isWaypoint)!u.graphic._isStopIcon||this._moveInProgress||this._solveInProgress||(this._handle._remove(),this._moveInProgress=!0,this.removeStop(u.graphic._index,!0).always(t.hitch(this,function(){this._moveInProgress=!1})));else{var M=this.get("map").infoWindow;M&&(M.setFeatures([u.graphic]),M.show(u.graphic.geometry))}})));this._onEvents.push(K(this.editToolbar,
"graphic-move-start",t.hitch(this,function(u){this._blurGeocoders();this._moveInProgress=!0;this._removeEmptyStops();this.routeParams.returnDirections=!1;this.routeParams.returnRoutes=!0;u=u.graphic;u._origPoint=new d(u.geometry.toJson());u._maxDeviation=0;u._solveHasHappened=!1;this.map.disableMapNavigation()})));this._onEvents.push(K(this.editToolbar,"graphic-move-stop",t.hitch(this,function(u){this.map.enableMapNavigation();this.routeParams.returnDirections=!0;this.routeParams.returnRoutes=!1;
if(this._handle._isStopIcon)if(this._handle._solveHasHappened)if(this._handle.attributes.isWaypoint)k(u,!0).always(t.hitch(this,function(){this._moveInProgress=!1;this._handle._isStopIcon=!0;this._handle._remove();this._showLoadingSpinner()}));else{clearTimeout(this._handle._solveTimeout);this._handle._solveTimeout=null;var M=this.stops[u.graphic._index],A=(M&&M.feature&&M.feature.attributes&&M.feature.attributes.Name)===this._userDefinedStopName,Z=M&&M.name;this._reverseGeocode(new B(u.graphic.toJson())).then(t.hitch(this,
function(ba){A&&(ba.name=Z,ba.feature.attributes.Name=this._userDefinedStopName);this._setReverseGeocode(ba,ba.feature.geometry,u.graphic._index).always(t.hitch(this,function(){this._moveInProgress=!1;this._handle._remove();this._showLoadingSpinner()}))}))}else this._moveInProgress=!1;else this._moveInProgress=!1})));this._onEvents.push(K(this.editToolbar,"graphic-move",t.hitch(this,function(u){var M=this._handle,A=u.transform;A.dx&&A.dy&&(u.graphic._maxDeviation=Math.max(M._maxDeviation,Math.sqrt(A.dx*
A.dx+A.dy*A.dy)));10<M._maxDeviation&&(M._solveHasHappened=!0,u.graphic===M&&M.attributes.isWaypoint&&!M._isStopIcon?(this.set("optimalRoute",!1),M._index+=.5,M._isStopIcon=!0,u.graphic._stopIndex=M._index,this._incrementalSolveStopRange={start:this.returnToStart?(this.stops.length+M._index-1)%this.stops.length:Math.max(0,M._index-1),end:this.returnToStart?(M._index+1)%(this.stops.length+1):Math.min(this.stops.length,M._index+1)},this.addStop({name:this._waypointName,feature:new B(M.geometry,M.symbol,
{isWaypoint:!0,CurbApproach:3})},u.graphic._stopIndex)):((M=u.graphic.getDojoShape())&&M.moveToFront(),k(u)))})))},_isStopAWaypoint:function(c){return c&&c.feature&&c.feature.attributes&&c.feature.attributes.isWaypoint},_getStopCount:function(){var c=0,k;for(k=0;k<this.stops.length;k++)c+=!this._isStopAWaypoint(this.stops[k])&&this.stops[k].name?1:0;return c},_getWaypointCount:function(){var c=0,k;for(k=0;k<this.stops.length;k++)c+=this._isStopAWaypoint(this.stops[k])?1:0;return c},_decorateUngeocodedStop:function(c){var k=
new P,u=function(A,Z){k.resolve({name:void 0===A?D.widgets.directions.unlocatedStop:A.toFixed(6)+" "+Z.toFixed(6),feature:c})};if(c.geometry)if(c.geometry.spatialReference&&4326!==c.geometry.spatialReference.wkid)if(this.map&&this.map.spatialReference&&this.map.spatialReference.isWebMercator()){var M=f.xyToLngLat(c.geometry.x,c.geometry.y);u(M[0],M[1])}else this._geometryService?(M=new Ya,M.outSR=new ta(4326),M.geometries=[c.geometry],this._geometryService.project(M).then(t.hitch(this,function(A){A&&
A.length?u(A[0].x,A[0].y):u(c.geometry.x,c.geometry.y)}),t.hitch(this,function(){u()}))):u(c.geometry.x,c.geometry.y);else u(c.geometry.x,c.geometry.y);else u();return k.promise},_trafficLayerUpdate:function(c,k,u){c=this.get("map");k&&this._trafficLayerAdded&&(c.removeLayer(k),this._trafficLayerAdded=!1);u&&this.get("traffic")&&!this._trafficLayerAdded&&(c.addLayer(u),u.show(),this._trafficLayerAdded=!0)},_routeTaskError:function(c){var k=D.widgets.directions.error.routeTask,u=c.details,M=function(A){return(res=
A.match(/(\d+)/))?": "+res[0]:"."};u&&1===u.length&&("The distance between any inputs must be less than 50 miles (80 kilometers) when walking."===u[0]?k=D.widgets.directions.error.maxWalkingDistance:"Driving a truck is currently not supported outside of North America and Central America."===u[0]?k=D.widgets.directions.error.nonNAmTruckingMode:0===u[0].indexOf("The number of input locations loaded into Barriers")?k=D.widgets.directions.error.tooManyBarriers+M(u[0]):0===u[0].indexOf("The number of input locations loaded into PolygonBarriers")?
k=D.widgets.directions.error.tooManyPolygonBarriers+M(u[0]):0===u[0].indexOf("The number of input locations loaded into PolylineBarriers")&&(k=D.widgets.directions.error.tooManyPolylineBarriers+M(u[0])));this._showMessage(k);this.onDirectionsFinish(c)},_showMessage:function(c,k){var u="";this.messages.push({msg:c,error:!k});if(this.messages.length){u+="\x3cul\x3e";for(var M=0;M<this.messages.length;M++)u+='\x3cli class\x3d"'+(this.messages[M].error?this._css.routesErrorClass:this._css.routesInfoClass)+
'"\x3e'+this.messages[M].msg+"\x3c/li\x3e";u+="\x3c/ul\x3e"}this._msgNode&&(this._msgNode.innerHTML=u);if(!k)this.onError(c)},_isTimeUnits:function(c){return"milliseconds"===c||"esriNAUSeconds"===c||"esriNAUMinutes"===c||"esriNAUHours"===c||"esriNAUDays"===c},_getImpedanceAttribute:function(){return this._getCostAttribute(this.routeParams&&this.routeParams.travelMode&&this.routeParams.travelMode.impedanceAttributeName||this.routeParams.impedanceAttribute||this.serviceDescription.impedance)},_getDirectionsTimeAttribute:function(){return this._getCostAttribute(this.routeParams&&
this.routeParams.travelMode&&this.routeParams.travelMode.timeAttributeName||this.routeParams.directionsTimeAttribute||this.serviceDescription.directionsTimeAttribute)},_getTimeNeutralAttribute:function(){var c=(this._getDirectionsTimeAttribute()||{}).timeNeutralAttributeName;return this._getCostAttribute(c)},_getCostAttribute:function(c){for(var k=this.serviceDescription&&this.serviceDescription.networkDataset.networkAttributes||[],u,M=0;M<k.length;M++)if(k[M].name===c&&"esriNAUTCost"===k[M].usageType){u=
k[M];break}return u},_convertCostValue:function(c,k,u){var M=this._isTimeUnits(k),A=this._isTimeUnits(u);k=M?this._toMinutes(c,k):this._toMeters(c,k);return M===A?A?this._fromMinutes(k,u):this._fromMeters(k,u):c},_toMinutes:function(c,k,u){c=c||0;switch(k){case "milliseconds":c/=Math.pow(6E4,u?-1:1);break;case "esriNAUSeconds":c/=Math.pow(60,u?-1:1);break;case "esriNAUHours":c*=Math.pow(60,u?-1:1);break;case "esriNAUDays":c*=Math.pow(1440,u?-1:1)}return c},_fromMinutes:function(c,k){return this._toMinutes(c,
k,!0)},_toMeters:function(c,k,u){c=c||0;switch((k||"").replace("esriNAU","esri")){case "esriInches":c*=Math.pow(.0254,u?-1:1);break;case "esriFeet":c*=Math.pow(.3048,u?-1:1);break;case "esriYards":c*=Math.pow(.9144,u?-1:1);break;case "esriMiles":c*=Math.pow(1609.344,u?-1:1);break;case "esriNauticalMiles":c*=Math.pow(1851.995396854,u?-1:1);break;case "esriMillimeters":c/=Math.pow(1E3,u?-1:1);break;case "esriCentimeters":c/=Math.pow(100,u?-1:1);break;case "esriKilometers":c*=Math.pow(1E3,u?-1:1);break;
case "esriDecimeters":c/=Math.pow(10,u?-1:1)}return c},_fromMeters:function(c,k){return this._toMeters(c,k,!0)},_createRouteTask:function(){var c=new P;this.set("routeTask",new ka(this.get("routeTaskUrl")));this._createRouteParams();this.routeTask.getServiceDescription(this.travelModesServiceUrl,this.doNotFetchTravelModesFromOwningSystem).then(t.hitch(this,function(k){k.networkDataset?(this.set("serviceDescription",k),this.set("maxStops",parseInt(this.userOptions.maxStops||k.serviceLimits&&k.serviceLimits.Route_MaxStops||
this.defaults.maxStops)),this.defaults.portalUrl?(this.owningSystemUrl=this.defaults.portalUrl,c.resolve()):this.routeTask.getOwningSystemUrl().then(t.hitch(this,function(u){this.owningSystemUrl=u;c.resolve()}),c.reject)):(this._showMessage(D.widgets.directions.error.cantFindRouteServiceDescription),c.reject(Error(D.widgets.directions.error.cantFindRouteServiceDescription)))}),t.hitch(this,function(){this._showMessage(D.widgets.directions.error.cantFindRouteServiceDescription);c.reject(Error(D.widgets.directions.error.cantFindRouteServiceDescription));
this.mapClickActive=!1;this._activate()}));return c.promise},_createSearchSourceDDL:function(){if(this._globalGeocoder&&this._globalGeocoder.sources&&1<this._globalGeocoder.sources.length){var c=t.hitch(this,function(M){this._searchSourceSelector.domNode.blur();this._globalGeocoder.set("activeSourceIndex",M);for(var A=0;A<this.geocoders.length;A++)this.geocoders[A].set("activeSourceIndex",M);this._truncateSearchSourceIfNeeded()});if(!this._searchSourceSelector){for(var k=[{value:"all",label:D.widgets.Search.main.all,
selected:!0}],u=0;u<this._globalGeocoder.sources.length;u++)k.push({value:String(u),label:this._globalGeocoder.sources[u].name});this._searchSourceSelector=new e({className:"esriSearchSourcesDDL",style:"width:100%;",options:k},this._searchSourceSelectorContainer);this._searchSourceSelector.startup();this._searchSourceSelector.on("change",c);this._searchSourceSelector.domNode.style.width=""}c("all")}else 2>this._globalGeocoder.sources.length&&(this._searchSourceContainerNode.style.display="none")},
_createTravelModesDDL:function(){this._travelModeSelector||(this._travelModeSelector=new e({className:"esriTravelModesDDL",style:"width:100%;"},this._travelModeSelectorContainer),this._travelModeSelector.startup(),this._travelModeSelector._interractive=!0,this._travelModeSelector.on("change",t.hitch(this,function(c){this._travelModeSelector._interractive?this._enqueue(function(){return this._setTravelMode(c).always(t.hitch(this,function(){this._travelModeSelector._interractive=!0}))}):this._travelModeSelector._interractive=
!0})))},_setupTravelModes:function(){var c=this.get("serviceDescription"),k=c.supportedTravelModes,u=new P;if(k&&k.length&&this._travelModeSelector){for(var M=k[0].name,A=[],Z=0;Z<k.length;Z++){for(var ba="AUTOMOBILE"===k[Z].type?"Driving":"TRUCK"===k[Z].type?"Trucking":"WALK"===k[Z].type?"Walking":"Other",ea="",fa=c.networkDataset.networkAttributes,pa=0;pa<fa.length;pa++){var sa=fa[pa];if(sa.name===k[Z].impedanceAttributeName){if("esriNAUCentimeters"===sa.units||"esriNAUDecimalDegrees"===sa.units||
"esriNAUDecimeters"===sa.units||"esriNAUFeet"===sa.units||"esriNAUInches"===sa.units||"esriNAUKilometers"===sa.units||"esriNAUMeters"===sa.units||"esriNAUMiles"===sa.units||"esriNAUMillimeters"===sa.units||"esriNAUNauticalMiles"===sa.units||"esriNAUYards"===sa.units)ea="Distance";else if("esriNAUDays"===sa.units||"esriNAUHours"===sa.units||"esriNAUMinutes"===sa.units||"esriNAUSeconds"===sa.units)ea="Time";break}}A.push({id:k[Z].name,label:'\x3cdiv class\x3d"esriTravelModesDirectionsIcon esriTravelModesType'+
ba+ea+'"\x3e\x26nbsp;\x3c/div\x3e\x3cdiv class\x3d"esriTravelModesTypeName" title\x3d"'+k[Z].description+'"\x3e'+k[Z].name+"\x3c/div\x3e"});!c.defaultTravelMode||k[Z].id!==c.defaultTravelMode&&k[Z].itemId!==c.defaultTravelMode||(M=k[Z].name)}this._showTravelModesOption();this._travelModeSelector.setStore(new h({objectStore:new n({data:A})}));this._travelModeSelector._interractive=!1;this._travelModeSelector.setValue(M);this._setTravelMode(M).always(u.resolve)}else this._checkStartTimeUIAvailability(),
this.set("showTravelModesOption",!1),u.resolve();return u.promise},_createPrintTask:function(){this._printService=(this.printTaskUrl=this._usingAGOL()?this.printTaskUrl:this.defaults.printTaskUrl)?new Ka(this.printTaskUrl,{async:!1}):null;var c=new Sa;c.exportOptions={width:670,height:750,dpi:96};c.format="PNG32";c.layout="MAP_ONLY";c.preserveScale=!1;c.showAttribution=!1;var k=new Qa;k.map=this.map;k.outSpatialReference=this.map.spatialReference;k.template=c;this._printParams=k},_createGeometryTask:function(){this._geometryService=
null;this._usingAGOL()?this._geometryService=new ua(this.geometryTaskUrl):this.geometryTaskUrl=(this._geometryService=this.defaults.geometryTaskUrl?new ua(this.defaults.geometryTaskUrl):$a.defaults.geometryService)?this._geometryService.url:null},_showTravelModesOption:function(){var c=this.get("serviceDescription");U.set(this._travelModeContainerNode,"display",this.showTravelModesOption&&c&&c.supportedTravelModes&&c.supportedTravelModes.length&&!this.doNotFetchTravelModesFromOwningSystem?"block":
"none")},_showMilesKilometersOption:function(){U.set(this._agolDistanceUnitsNode,"display",this.showMilesKilometersOption?"block":"none")},_showClearButton:function(){U.set(this._clearDirectionsButtonNode,"display",this.showClearButton?"inline-block":"none")},_showActivateButton:function(){U.set(this._activateButtonNode,"display",this.showActivateButton?"inline-block":"none");this.showActivateButton||this.deactivate()},_showBarriersButton:function(){U.set(this._lineBarrierButtonNode,"display",this.showBarriersButton?
"inline-block":"none");this.showBarriersButton||this.deactivateBarrierTool()},_createRouteParams:function(){var c={returnDirections:!0,returnRoutes:!1,outputLines:"esriNAOutputLineTrueShape",preserveFirstStop:!0,preserveLastStop:!0,directionsOutputType:"complete",stops:new Y,ignoreInvalidLocations:!0,doNotLocateOnRestrictedElements:!0,outSpatialReference:this.get("map").spatialReference};this.get("routeParams")||(this.routeParams={});var k=new qa;this.routeParams=t.mixin(k,{outputGeometryPrecision:0,
outputGeometryPrecisionUnits:"esriMeters",restrictUTurns:"esriNFSBAtDeadEndsOnly"},this.get("routeParams"),c)},_markWPsForRemovalAfterUserChangedStopSequence:function(c,k){for(var u=c-1,M=[];0<=u&&this._isStopAWaypoint(this.stops[u]);)M.push(this.stops[u]),u--;for(u=c+1;u<this.stops.length&&this._isStopAWaypoint(this.stops[u]);)M.push(this.stops[u]),u++;if(k>c)for(u=k+1;u<this.stops.length&&this._isStopAWaypoint(this.stops[u]);)M.push(this.stops[u]),u++;else if(void 0!==k)for(u=k-1;0<=u&&this._isStopAWaypoint(this.stops[u]);)M.push(this.stops[u]),
u--;else if(this.returnToStart&&0===c)for(u=this.stops.length-1;0<=u&&this._isStopAWaypoint(this.stops[u]);)M.push(this.stops[u]),u--;return M},_removeSomeWaypoints:function(c){for(var k=new P,u=[],M=0;M<c.length;M++){var A=X.indexOf(this.stops,c[M]);-1<A&&u.push(this._removeStop(A,!0,!0))}na(u).always(k.resolve);return k.promise},_modifyStopSequence:function(c,k){var u=this._dnd.getAllNodes(),M=new P,A,Z=[];if(u.length)if(this._removeLocateButtonVisibilityEvents(),arguments.length&&void 0!==c)if(0<=
c&&0<=k&&c<this.stops.length&&k<this.stops.length&&c!==k){u=this._markWPsForRemovalAfterUserChangedStopSequence(c,k);var ba=this.stops.splice(c,1);this.stops.splice(k,0,ba[0]);for(A=0;A<this.stops.length;A++)Z.push(this._updateStop(this.stops[A],A));Z.push(this._removeSomeWaypoints(u));na(Z).always(t.hitch(this,function(){this._solveAndZoom().always(M.resolve)}))}else M.reject("Invalid From and To values.");else{for(A=0;A<this.stops.length;)this._isStopAWaypoint(this.stops[A])?Z.push(this._removeStop(A,
!0,!0)):A++;na(Z).always(t.hitch(this,function(){Z=[];this.stops.reverse();for(A=0;A<this.stops.length;A++)Z.push(this._updateStop(this.stops[A],A));na(Z).always(t.hitch(this,function(){this._solveAndZoom().always(M.resolve)}))}))}else M.resolve();return M.promise},_setMenuNodeValues:function(c){"traffic"!==c&&this._clearDisplayBeforeSolve();c=this.get("optimalRoute");this._findOptimalOrderNode&&S.set(this._findOptimalOrderNode,"checked",c);this._returnToStartNode&&(c=this.returnToStart&&!this.maxStopsReached&&
this.stops[0]&&(!this.stops[0].feature||this._isStopLocated(this.stops[0])),S.set(this._returnToStartNode,"checked",c),this.set("returnToStart",c),this.maxStopsReached&&this.returnToStart&&this._showMessage(D.widgets.directions.error.maximumStops));if(!this.returnToStart&&!this._incrementalSolveStopRange&&this.directions)for(this._incrementalSolveStopRange={start:this.stops.length-1,end:this.stops.length},this._clearRouteGraphics(),this._incrementalSolveStopRange=null,c=this.stops.length;0<c--&&this._isStopAWaypoint(this.stops[c]);)this._removeSomeWaypoints([this.stops[c]]);
this._useTrafficNode&&(S.set(this._useTrafficNode,"checked",this.traffic),this.traffic?(this._updateMapTimeExtent(),this._addTrafficLayer()):(this._removeTrafficLayer(),this._restoreMapTimeExtent()));switch(this.get("directionsLengthUnits")){case ca.KILOMETERS:S.set(this._useKilometersNode,"checked",!0);S.set(this._useMilesNode,"checked",!1);break;case ca.MILES:S.set(this._useKilometersNode,"checked",!1),S.set(this._useMilesNode,"checked",!0)}U.set(this._printButton,"display",this.showPrintPage?"inline-block":
"none");U.set(this._saveMenuButton,"display",this.showSaveButton&&this.owningSystemUrl?"inline-block":"none");this._showMilesKilometersOption();this._showClearButton()},_optionsMenu:function(){this._useTrafficItemNode&&U.set(this._useTrafficItemNode,"display",this.get("showTrafficOption")?"block":"none");this._returnToStartItemNode&&U.set(this._returnToStartItemNode,"display",this.get("showReturnToStartOption")?"block":"none");this._findOptimalOrderItemNode&&U.set(this._findOptimalOrderItemNode,"display",
this.get("showOptimalRouteOption")&&3<this._getStopCount()?"block":"none");this.stops.length>=this.get("minStops")?N.add(this._widgetContainer,this._css.stopsOptionsOptionsEnabledClass):(N.remove(this._widgetContainer,this._css.stopsOptionsOptionsEnabledClass),this._optionsMenuNode&&"block"===U.get(this._optionsMenuNode,"display")&&this._toggleOptionsMenu())},_stopsRemovable:function(){2<this._dnd.getAllNodes().length-this._getWaypointCount()?N.add(this._widgetContainer,this._css.stopsRemovableClass):
N.remove(this._widgetContainer,this._css.stopsRemovableClass)},_checkMaxStops:function(){this.set("maxStopsReached",this._getStopCount()+this._getWaypointCount()+(this.returnToStart?1:0)>=this.maxStops);this._showAddDestination()},_updateThemeWatch:function(c,k,u){N.remove(this.domNode,k);N.add(this.domNode,u)},_toggleOptionsMenu:function(){"block"===U.get(this._optionsMenuNode,"display")?(U.set(this._optionsMenuNode,"display","none"),N.remove(this._optionsButtonNode,"esriStopsOptionsOpen"),this._optionsButtonNode.innerHTML=
D.widgets.directions.showOptions):(U.set(this._optionsMenuNode,"display","block"),N.add(this._optionsButtonNode,"esriStopsOptionsOpen"),this._optionsButtonNode.innerHTML=D.widgets.directions.hideOptions)},_toggleSaveMenu:function(c){"block"===U.get(this._saveMenuNode,"display")||!1===c?(U.set(this._saveMenuNode,"display","none"),N.remove(this._saveMenuButton,this._css.stopsPressedButtonClass)):(this.clearMessages(),U.set(this._saveMenuNode,"display","block"),N.add(this._saveMenuButton,this._css.stopsPressedButtonClass),
this._enableSharing().then(t.hitch(this,function(){this._outputLayer.setValue(this.routeLayer.title?this.routeLayer.title:this.directions&&this.directions.routeName);if(this.routeLayer.ownerFolder)for(var k=this._folderSelector.store.objectStore.data,u=0;u<k.length;u++)if(k[u].folderId===this.routeLayer.ownerFolder){this._folderSelector.getValue()!==k[u].id&&(this._folderSelector._interractive=!1,this._folderSelector.setValue(k[u].id));break}this._enableButton(this._saveButton,this.routeLayer.isItemOwner||
!this._userCanCreatePortalItem);this._outputLayer.set("disabled",!1)})))},_showToolbar:function(){N[this.stops.length<this.maxStops&&this.canModifyStops||this.canModifyWaypoints?"add":"remove"].call(ia,this._widgetContainer,this._css.addStopsClass)},_showAddDestination:function(){this._showToolbar();this._addDestinationNode.style.display=this.stops.length<this.maxStops&&this.canModifyStops?"inline":"none"},_showMapClickActiveButton:function(){this._showToolbar();this._activateButtonNode.style.display=
this.canModifyStops||this.canModifyWaypoints?"inline-block":"none"},_getAbsoluteUrl:function(c){c=V.toUrl(c);return/^https?:/i.test(c)?c:/^\/\//i.test(c)?Wa+c:/^\//i.test(c)?Wa+"//"+window.location.host+c:c},_getManeuverImage:function(c){return c?"esriDMTStop"===c||"esriDMTDepart"===c?"":this._getAbsoluteUrl("./images/Directions/maneuvers/"+c+".png"):""},_loadPrintDirections:function(c){var k=this.get("printTemplate"),u=new P;this.directionsLengthUnits!==this.routeParams.directionsLengthUnits?this.getDirections().then(u.resolve,
u.reject):u.resolve();u.then(t.hitch(this,function(){if(!k&&this.directions){var M=this._getAbsoluteUrl("./css/Directions.css"),A=this._getAbsoluteUrl("./css/DirectionsPrint.css"),Z=this._getAbsoluteUrl("./images/Directions/print-logo.png");var ba=T.isBodyLtr()?"ltr":"rtl";k="";k+="\x3c!DOCTYPE HTML\x3e";k+='\x3chtml lang\x3d"en" class\x3d"'+this.get("theme")+'" dir\x3d"'+ba+'"\x3e';k+="\x3chead\x3e";k+='\x3cmeta charset\x3d"utf-8"\x3e';k+='\x3cmeta http-equiv\x3d"X-UA-Compatible" content\x3d"IE\x3dEdge,chrome\x3d1"\x3e';
k+="\x3ctitle\x3e"+this.get("directions").routeName+"\x3c/title\x3e";k+='\x3clink rel\x3d"stylesheet" media\x3d"screen" type\x3d"text/css" href\x3d"'+M+'" /\x3e';k+='\x3clink rel\x3d"stylesheet" media\x3d"print" type\x3d"text/css" href\x3d"'+A+'" /\x3e';k+="\x3c/head\x3e";k+='\x3cbody class\x3d"'+this._css.esriPrintPageClass+'"\x3e';k+='\x3cdiv class\x3d"'+this._css.esriPrintBarClass+'"\x3e';k+='\x3cdiv class\x3d"'+this._css.esriCloseButtonClass+'" title\x3d"'+D.common.close+'" onclick\x3d"window.close();"\x3e'+
D.common.close+"\x3c/div\x3e";k+='\x3cdiv id\x3d"printButton" class\x3d"'+this._css.esriPrintButtonClass+'" title\x3d"'+D.widgets.directions.print+'" onclick\x3d"window.print();"\x3e'+D.widgets.directions.print+"\x3c/div\x3e";k+="\x3c/div\x3e";k+='\x3cdiv class\x3d"'+this._css.esriPrintMainClass+'"\x3e';k+='\x3cdiv class\x3d"'+this._css.esriPrintHeaderClass+'"\x3e';k+='\x3cimg class\x3d"'+this._css.esriPrintLogoClass+'" src\x3d"'+Z+'" /\x3e';k+='\x3cdiv class\x3d"'+this._css.esriPrintNameClass+'"\x3e'+
this.get("directions").routeName+"\x3c/div\x3e";k+=this._renderDirectionsSummary(this.directions);c&&(k+='\x3cdiv id\x3d"divMap" class\x3d"esriPrintMap esriPrintWait"\x3e\x3c/div\x3e',k+='\x3chr class\x3d"esriNoPrint"/\x3e');k+='\x3cdiv id\x3d"print_helper"\x3e\x3c/div\x3e';k+='\x3ctextarea onkeyup\x3d"document.getElementById(\'print_helper\').innerHTML\x3dthis.value;" id\x3d"print_area" class\x3d"'+this._css.esriPrintNotesClass+'" placeholder\x3d"'+D.widgets.directions.printNotes+'"\x3e\x3c/textarea\x3e';
k+='\x3cdiv class\x3d"'+this._css.clearClass+'"\x3e\x3c/div\x3e';k+="\x3c/div\x3e";k+='\x3cdiv class\x3d"'+this._css.esriPrintDirectionsClass+'"\x3e';k+=this._renderDirectionsTable(this.directions);k+="\x3c/div\x3e";k+='\x3cdiv class\x3d"'+this._css.esriPrintFooterClass+'"\x3e';k+="\x3cp\x3e"+D.widgets.directions.printDisclaimer+"\x3c/p\x3e";k+="\x3c/div\x3e";k+="\x3c/div\x3e";k+="\x3c/body\x3e";k+="\x3c/html\x3e"}this._printWindow.document.open("text/html","replace");this._printWindow.document.write(k);
this._printWindow.document.close()}))},resize:function(){this._truncateSearchSourceIfNeeded()},_truncateSearchSourceIfNeeded:function(){var c=this._searchSourceSelector,k=c.containerNode.firstChild;c.domNode.clientWidth>this.domNode.clientWidth?U.set(k,"width",this._searchSourceContainerNode.clientWidth-20+"px"):U.set(k,"width","")},_printDirections:function(){if(this.directions){var c=screen.width/2,k=screen.height/1.5;c="toolbar\x3dno, location\x3dno, directories\x3dno, status\x3dyes, menubar\x3dno, scrollbars\x3dyes, resizable\x3dyes, width\x3d"+
c+", height\x3d"+k+", top\x3d"+(screen.height/2-k/2)+", left\x3d"+(screen.width/2-c/2);this.get("printPage")?(window.directions=this.get("directions"),window.open(this.get("printPage"),"directions_widget_print",c,!0)):(this._printWindow=window.open("","directions_widget_print",c,!0),this._loadPrintDirections(!!this._printService),this._printService&&V(["dojo/_base/window"],t.hitch(this,function(u){this.zoomToFullRoute().then(t.hitch(this,function(){this._printService.execute(this._printParams,t.hitch(this,
function(M){u.withDoc(this._printWindow.document,function(){var A=L.byId("divMap");A&&(N.remove(A,"esriPrintWait"),N.add(A,"esriPageBreak"),ia.create("img",{src:M.url,"class":"esriPrintMapImg"},A))})}),t.hitch(this,function(M){u.withDoc(this._printWindow.document,function(){var A=L.byId("divMap");A&&N.remove(A,"esriPrintWait")});console.error("Error while calling print service:\n "+M)}))}))})))}},_enableButton:function(c,k){k=k||void 0===k;N[k?"remove":"add"].apply(this,[c,"esriDisabledDirectionsButton"]);
c._enabled=k},_clearStopsStatusAttr:function(){for(var c=0;c<this.stops.length;c++)this.stops[c].feature&&this.stops[c].feature.attributes&&(this.stops[c].feature.attributes.Status=void 0)},_enableSharing:function(){var c=new P;!this._naRouteSharing&&this.owningSystemUrl?V(["../tasks/NARouteSharing"],t.hitch(this,function(k){this._naRouteSharing=new k(this.owningSystemUrl,this.map.spatialReference);this._folderSelector||(this._folderSelector=new e({className:"esriFoldersDDL",style:"width: 100%;",
sortByLabel:!1,disabled:!0,_interractive:!0,onChange:t.hitch(this,function(){this._folderSelector._interractive?this._enableButton(this._saveButton,!this.routeLayer.itemId):this._folderSelector._interractive=!0})},this._folderSelectorContainer),this._folderSelector.startup(),this._outputLayer=new g({style:"width: 100%",required:!0,trim:!0,regExp:'[^\x26|\x3c|\x3e|%|#|?|\\|"|/|+]+',maxLength:98,disabled:!0,onKeyPress:t.hitch(this,function(){this._enableButton(this._saveButton,!this.routeLayer.itemId||
!this._userCanCreatePortalItem)}),onFocus:t.hitch(this,function(){this.map&&this.map.disableKeyboardNavigation()}),onBlur:t.hitch(this,function(){this.map&&this.map.enableKeyboardNavigation()})},this._outputLayerContainer),this._outputLayer.startup());this._naRouteSharing.getFolders().then(t.hitch(this,function(u){for(var M=[],A=0;A<u.length;A++)M.push({id:u[A].url,folderId:u[A].id,label:u[A].title});this._folderSelector.setStore(new h({objectStore:new n({data:M})}));this._naRouteSharing.canCreateItem().then(t.hitch(this,
function(Z){this._folderSelector.set("disabled",!Z);this._userCanCreatePortalItem=Z}));this._enableButton(this._saveButton);c.resolve()}),t.hitch(this,function(u){console.log(u);this._naRouteSharing=null;this._toggleSaveMenu(!1);c.reject(u)}))})):this.owningSystemUrl?c.resolve():(c.reject(Error("Owning system is not defined, or the Directions widget is not done initializing.")),this._naRouteSharing=null);return c.promise},_storeRouteUI:function(){var c=new P;this._outputLayer&&this._outputLayer.isValid()?
this._storeRoute(this._outputLayer.getValue(),this._folderSelector.getValue(),this._folderSelector.store.objectStore.get(this._folderSelector.getValue()).folderId).then(c.resolve,c.reject):(this._outputLayer&&this._outputLayer.focus(),c.reject(Error("Need result layer name specified.")));return c.promise},_storeRoute:function(c,k,u){var M=new P,A=this.directions;if(this._savingRoute||!this._naRouteSharing)return this._saveButton.blur(),M.reject(Error("Not ready to store route.")),M.promise;this.clearMessages();
M.then(null,t.hitch(this,function(Ea){console.log("ERR",Ea);this._showMessage(D.widgets.directions.error.cantSaveRoute)}));M.promise.always(t.hitch(this,function(){this._enableButton(this._saveButton);U.set(this._saveAsButton,"display",this.routeLayer.itemId&&this._userCanCreatePortalItem?"inline-block":"none");this._showLoadingSpinner();this._savingRoute=!1}));if(A&&A.features&&A.features.length&&this.stops&&this.stops.length)if(this.owningSystemUrl)if(this.routeParams&&this.routeParams.travelMode)if(c&&
k){var Z=t.hitch(this,function(Ea){return this._naRouteSharing.getAttributeUnits(Ea,this.serviceDescription)});var ba=this.routeParams.travelMode.timeAttributeName;var ea=this.routeParams.travelMode.distanceAttributeName,fa=Z(ba),pa=Z(ea),sa=this.routeParams.directionsLengthUnits||this.serviceDescription.directionsLengthUnits,wa=this._naRouteSharing.toMeters,ya=this._naRouteSharing.toMinutes,Da=function(Ea,Ia,Oa){var Pa;for(Pa in Ea)if(Ea.hasOwnProperty(Pa)&&0===Pa.indexOf(Ia)&&-1===X.indexOf(Oa,
Pa.substr(Ia.length))){var ab=ab||{};ab[Pa.substr(Ia.length)]=Ea[Pa]}return ab},Ca=[],Ga=[],La=[];if(ba&&fa&&ea&&pa){var Ta=[],Na=this.routeParams.accumulateAttributes||this.serviceDescription.accumulateAttributeNames||[],Ma=this.serviceDescription.networkDataset.networkAttributes;for(Z=0;Z<Ma.length;Z++)"esriNAUTCost"===Ma[Z].usageType&&-1===X.indexOf(Na,Ma[Z].name)&&Ma[Z].name!==ba&&Ma[Z].name!==ea&&Ta.push(Ma[Z].name);Na=this.get("stops");var Ja={xmin:Infinity,ymin:Infinity,xmax:-Infinity,ymax:-Infinity};
for(Z=0;Z<Na.length;Z++)if(Na[Z].feature&&Na[Z].feature.toJson){Ma=Na[Z].feature.toJson();var Fa=Ma.attributes;var Ha=Ma.geometry,Ra=this._naRouteSharing.getUTCOffset(Fa.ArriveTime,Fa.ArriveTimeUTC),Va=this._naRouteSharing.getUTCOffset(Fa.DepartTime,Fa.DepartTimeUTC);t.mixin(Ja,{xmin:Ja.xmin>Ha.x?Ha.x:Ja.xmin,ymin:Ja.ymin>Ha.y?Ha.y:Ja.ymin,xmax:Ja.xmax<Ha.x?Ha.x:Ja.xmax,ymax:Ja.ymax<Ha.y?Ha.y:Ja.ymax});Ma.attributes={__OBJECTID:Z+1,CurbApproach:Fa.CurbApproach,ArrivalCurbApproach:Fa.ArriveCurbApproach,
DepartureCurbApproach:Fa.DepartCurbApproach,Name:Fa.Name===this._waypointName?D.widgets.directions.waypoint:Fa.Name===this._userDefinedStopName?Na[Z].name:Fa.Name,RouteName:A.routeName,Sequence:Fa.Sequence,Status:Fa.Status,LocationType:Fa.isWaypoint?1:0,TimeWindowStart:Fa.TimeWindowStart,TimeWindowEnd:Fa.TimeWindowEnd,TimeWindowStartUTCOffset:Ra,TimeWindowEndUTCOffset:Ra,ServiceMinutes:ya(Fa["Attr_"+ba],fa),ServiceMeters:wa(Fa["Attr_"+ea],pa),ServiceCosts:ja.stringify(Da(Fa,"Attr_",Ta)),CumulativeMinutes:ya(Fa["Cumul_"+
ba],fa),CumulativeMeters:wa(Fa["Cumul_"+ea],pa),CumulativeCosts:ja.stringify(Da(Fa,"Cumul_",Ta)),LateMinutes:ya(Fa["Violation_"+ba],fa),WaitMinutes:ya(Fa["Wait_"+ba],fa),ArrivalTime:this._naRouteSharing.toUTCTime(Fa.ArriveTime,Ra),DepartureTime:this._naRouteSharing.toUTCTime(Fa.DepartTime,Va),ArrivalUTCOffset:Ra,DepartureUTCOffset:Va};Ca.push(Ma)}ea=0;pa=function(Ea){try{Ea.strings=ja.parse(Ea.strings)}catch(Oa){bb.strings=void 0}if(Ea.strings&&Ea.strings.length)for(var Ia=0;Ia<Ea.strings.length;Ia++)if("esriDSTGeneral"===
Ea.strings[Ia].stringType)return Ea.strings[Ia].string};Na=function(Ea,Ia){for(var Oa=[],Pa=0;Pa<(Ea||[]).length;Pa++)Ea[Pa].stringType!==Ia&&Ia||Oa.push(Ea[Pa].string);return Oa.length?Oa.toString():void 0};Ma=function(Ea){switch(Ea){case "esriDMTStop":return"esriDPTManeuverArrive";case "esriDMTDepart":return"esriDPTManeuverDepart";case "esriDMTDoorPassage":return"esriDPTManeuverDoor";case "esriDMTBearLeft":return"esriDPTManeuverBearLeft";case "esriDMTBearRight":return"esriDPTManeuverBearRight";
case "esriDMTElevator":return"esriDPTManeuverElevator";case "esriDMTEscalator":return"esriDPTManeuverEscalator";case "esriDMTFerry":return"esriDPTManeuverFerryOn";case "esriDMTEndOfFerry":return"esriDPTManeuverFerryOff";case "esriDMTForkCenter":return"esriDPTManeuverForkCenter";case "esriDMTForkLeft":return"esriDPTManeuverForkLeft";case "esriDMTForkRight":return"esriDPTManeuverForkRight";case "esriDMTPedestrianRamp":return"esriDPTManeuverPedestrianRamp";case "esriDMTRampLeft":return"esriDPTManeuverRampLeft";
case "esriDMTRampRight":return"esriDPTManeuverRampRight";case "esriDMTRoundabout":return"esriDPTManeuverRoundabout";case "esriDMTTurnLeft":return"esriDPTManeuverTurnLeft";case "esriDMTLeftLeft":return"esriDPTManeuverTurnLeftLeft";case "esriDMTLeftRight":return"esriDPTManeuverTurnLeftRight";case "esriDMTTurnRight":return"esriDPTManeuverTurnRight";case "esriDMTRightLeft":return"esriDPTManeuverTurnRightLeft";case "esriDMTRightRight":return"esriDPTManeuverTurnRightRight";case "esriDMTSharpLeft":return"esriDPTManeuverSharpLeft";
case "esriDMTSharpRight":return"esriDPTManeuverSharpRight";case "esriDMTStraight":return"esriDPTManeuverStraight";case "esriDMTStrairs":return"esriDPTManeuverStairs";case "esriDMTUTurn":return"esriDPTManeuverUTurn"}return"esriDPTUnknown"};for(Z=0;Z<A.featuresWithWaypoints.length;Z++){var Za=A.featuresWithWaypoints[Z];Ha=Za.toJson();Ra=Ha.attributes;Va=Ha.geometry&&Ha.geometry.paths&&Ha.geometry.paths[0]||[];var db=Ha.geometry.hasM||Va[0]&&3===Va[0].length;Fa=this._naRouteSharing.getUTCOffset(Ra.ETA,
Ra.arriveTimeUTC);Ha.attributes={__OBJECTID:Z+1,Sequence:++ea,StopID:function(){var Ea=void 0,Ia=Za._associatedStopWithReturnToStart&&Za._associatedStopWithReturnToStart.attributes.Sequence;if(Ia)for(var Oa=0;Oa<Ca.length;Oa++)if(Ca[Oa].attributes.Sequence===Ia){Ea=Ca[Oa].attributes.__OBJECTID;break}return Ea}(),DirectionPointType:Ma(Ra.maneuverType),DisplayText:Za._associatedStopWithReturnToStart&&Za._associatedStopWithReturnToStart.attributes.isWaypoint?Ra.text.replace(this._waypointName,D.widgets.directions.waypoint):
Ra.text,ArrivalTime:this._naRouteSharing.toUTCTime(Ra.ETA,Fa),ArrivalUTCOffset:Fa,Azimuth:void 0,Name:Na(A.stringsWithWaypoints[Z],"esriDSTStreetName"),AlternateName:Na(A.stringsWithWaypoints[Z],"esriDSTAltName"),ExitName:Na(A.stringsWithWaypoints[Z],"esriDSTExit"),IntersectingName:Na(A.stringsWithWaypoints[Z],"esriDSTCrossStreet"),BranchName:Na(A.stringsWithWaypoints[Z],"esriDSTBranch"),TowardName:Na(A.stringsWithWaypoints[Z],"esriDSTToward"),ShortVoiceInstruction:void 0,VoiceInstruction:void 0,
Level:void 0};delete Ha.symbol;delete Ha.infoTemplate;Va.length?(Ha.geometry={x:Va[0][0],y:Va[0][1],spatialReference:Ha.geometry.spatialReference},db&&t.mixin(Ha.geometry,{m:Va[0][2]})):delete Ha.geometry;Ga.push(Ha);Ha=Za.toJson();Ra=Ha.attributes;Va=Ha.geometry&&Ha.geometry.paths&&Ha.geometry.paths[0]||[];Fa=!0;for(ba=0;ba<Va.length-1;ba++)if(Va[ba][0]!==Va[ba+1][0]||Va[ba][1]!==Va[ba+1][1]){Fa=!1;break}Fa||(Ha.attributes={DirectionPointID:Z+1,DirectionLineType:"esriDLTSegment",Meters:wa(Ra.length,
sa),Minutes:ya(Ra.time,fa),FromLevel:void 0,ToLevel:void 0},Ha.geometry.hasM=db,delete Ha.symbol,delete Ha.infoTemplate,La.push(Ha));var bb=A.eventsWithWaypoints[Ha.attributes.Sequence]||[];for(ba=0;ba<bb.length;ba++)Ha=bb[ba].toJson(),Ra=Ha.attributes,Fa=this._naRouteSharing.getUTCOffset(Ra.ETA,Ra.arriveTimeUTC),Ha.attributes={Sequence:++ea,DirectionPointType:"esriDPTEvent",DisplayText:pa(Ra),ArrivalTime:this._naRouteSharing.toUTCTime(Ra.ETA,Fa),ArrivalUTCOffset:Fa,Name:Ra.strings},Ga.push(Ha)}ba=
this.routeParams.barriers&&this.routeParams.barriers.features||[];var eb=[];for(Z=0;Z<ba.length;Z++)ea=ba[Z].toJson(),pa=ea.attributes,ea.attributes={BarrierType:pa.BarrierType||0,FullEdge:pa.FullEdge||!1,AddedCost:pa["Attr_"+this._getImpedanceAttribute().name]||0,Costs:ja.stringify(Da(pa,"Attr_",Ta)),CurbApproach:pa.CurbApproach||0,Name:pa.Name},eb.push(ea);ba=this.routeParams.polylineBarriers&&this.routeParams.polylineBarriers.features||[];var fb=[];for(Z=0;Z<ba.length;Z++)ea=ba[Z].toJson(),pa=
ea.attributes,ea.attributes={BarrierType:pa.BarrierType||0,ScaleFactor:pa["Attr_"+this._getImpedanceAttribute().name]||1,Costs:ja.stringify(Da(pa,"Attr_",Ta)),Name:pa.Name},fb.push(ea);ba=this.routeParams.polygonBarriers&&this.routeParams.polygonBarriers.features||[];var gb=[];for(Z=0;Z<ba.length;Z++)ea=ba[Z].toJson(),pa=ea.attributes,ea.attributes={BarrierType:pa.BarrierType||0,ScaleFactor:pa["Attr_"+this._getImpedanceAttribute().name]||1,Costs:ja.stringify(Da(pa,"Attr_",Ta)),Name:pa.Name},gb.push(ea);
var hb={geometry:A.mergedGeometry,attributes:{RouteName:A.routeName,TotalMinutes:ya(A.totalTime,fa),TotalMeters:wa(A.totalLength,sa),TotalLateMinutes:function(){for(var Ea=0,Ia=0;Ia<Ca.length;Ia++)Ea+=Ca[Ia].attributes.LateMinutes||0;return Ea}(),TotalWaitMinutes:function(){for(var Ea=0,Ia=0;Ia<Ca.length;Ia++)Ea+=Ca[Ia].attributes.WaitMinutes||0;return Ea}(),TotalCosts:Ca[Ca.length-1].attributes.CumulativeCosts,StartTime:"none"!==this.startTime?Ca[0].attributes.ArrivalTime:null,EndTime:"none"!==this.startTime?
Ca[Ca.length-1].attributes.DepartureTime:null,StartUTCOffset:Ca[0].attributes.ArrivalUTCOffset,EndUTCOffset:Ca[Ca.length-1].attributes.DepartureUTCOffset,Messages:ja.stringify(this._solverMessages),AnalysisSettings:ja.stringify({travelMode:t.hitch(this,function(){var Ea=t.clone(this.routeParams.travelMode);"\x26lt;"===Ea.name.substr(0,4)&&"\x26gt;"===Ea.name.substr(Ea.name.length-4,4)&&(Ea.name=Ea.name.substr(4,Ea.name.length-8));return Ea})(),directionsLanguage:this.routeParams.directionsLanguage||
this.serviceDescription.directionsLanguage,startTimeIsUTC:this.routeParams.startTimeIsUTC,timeWindowsAreUTC:this.routeParams.timeWindowsAreUTC,findBestSequence:this.routeParams.findBestSequence,preserveFirstStop:this.routeParams.preserveFirstStop,preserveLastStop:this.routeParams.preserveLastStop,accumulateAttributeNames:this.routeParams.accumulateAttributes||this.serviceDescription.accumulateAttributeNames})}};this._enableButton(this._saveButton,!1);this._savingRoute=!0;this._showLoadingSpinner(!0);
t.hitch(this,function(){var Ea=new P;this._printService?this.zoomToFullRoute().then(t.hitch(this,function(){var Ia=this._printParams.template,Oa=Ia.exportOptions;Ia.exportOptions={width:200,height:133,dpi:96};this._printService.execute(this._printParams,function(Pa){Ia.exportOptions=Oa;Ea.resolve(Pa.url)},function(Pa){Ia.exportOptions=Oa;console.error("Error while calling print service:\n "+Pa);Ea.resolve()})})):Ea.resolve();return Ea.promise})().then(t.hitch(this,function(Ea){var Ia={folder:k,name:c,
stops:Ca,directionPoints:Ga,directionLines:La,barriers:eb,polylineBarriers:fb,polygonBarriers:gb,extent:t.mixin(t.clone(A.extent),{xmin:Ja.xmin>A.extent.xmin?A.extent.xmin:Ja.xmin,ymin:Ja.ymin>A.extent.ymin?A.extent.ymin:Ja.ymin,xmax:Ja.xmax<A.extent.xmax?A.extent.xmax:Ja.xmax,ymax:Ja.ymax<A.extent.ymax?A.extent.ymax:Ja.ymax}),routeInfo:hb,thumbnail:Ea};this._userCanCreatePortalItem?this._naRouteSharing.store(Ia,this.routeLayer.itemId,"1.0.0").then(t.hitch(this,function(Oa){if(Oa.success){var Pa=
this._naRouteSharing.portal;Pa="//"+(Pa.isPortal?Pa.portalHostname:Pa.urlKey+"."+Pa.customBaseUrl);this._toggleSaveMenu();this._showMessage(D.widgets.directions.routeIsSaved+"\x3cbr/\x3e\x3ca class\x3d'esriLinkButton' target\x3d'_blank' href\x3d'"+Pa+"/home/item.html?id\x3d"+Oa.id+"'\x3e"+D.widgets.directions.share+"\x3c/a\x3e",!0);if(this.routeLayer.itemId)this.onRouteItemUpdated(Oa.id);else this.onRouteItemCreated(Oa.id);t.mixin(this.routeLayer,{itemId:Oa.id,title:Ia.name,isItemOwner:!0,ownerFolder:u});
M.resolve(Oa)}else M.reject(Oa)}),M.reject):this._naRouteSharing.createFeatureCollection(Ia,"1.0.0").then(t.hitch(this,function(Oa){M.resolve(Oa);this._toggleSaveMenu();this.onFeatureCollectionCreated(Oa)}),M.reject)}))}else M.reject(Error("Cannot deduce the impedance used."))}else M.reject(Error("Missing required parameter: layerName, folder must be specified."));else M.reject(Error("Shared route must be built using a Travel Mode."));else M.reject(Error("Cannot store route: owning system to store routes is not defined. Please specify Portal or ArcGIS Online Url in constructor."));
else M.reject(Error("No route to share. Build a route first."));return M.promise},_loadRoute:function(c){var k=new P;k.promise.always(t.hitch(this,function(){this._showLoadingSpinner(!1);U.set(this._saveAsButton,"display",this.routeLayer.itemId&&this._userCanCreatePortalItem?"inline-block":"none");this._enableButton(this._saveButton,this.routeLayer.isItemOwner)}));this._reset().then(t.hitch(this,function(){this._showLoadingSpinner(!0);this._enableSharing().then(t.hitch(this,function(){var u=t.clone(this.serviceDescription),
M=t.hitch(this,function(fa){t.mixin(this.routeLayer,{itemId:c,title:fa.title,isItemOwner:fa.isItemOwner,ownerFolder:fa.ownerFolder})}),A,Z,ba,ea;u.directionsLengthUnits=this.directionsLengthUnits;this._naRouteSharing.load(c,u).then(t.hitch(this,function(fa){if(fa.routeParameters){t.mixin(this.routeParams,fa.routeParameters);this.routeParams.accumulateAttributes=fa.routeParameters.accumulateAttributeNames;this.set("optimalRoute",this.routeParams.findBestSequence);this.startTime=this.routeParams.startTime?
this.routeParams.startTime:"none";this._setStartTime(void 0,void 0,this.startTime);var pa=fa.routeParameters.travelMode,sa=pa?this._getCostAttribute(pa.impedanceAttributeName):void 0;sa=sa?this._isTimeUnits(sa.units)?"Time":"Distance":"";ea=u.supportedTravelModes&&u.supportedTravelModes.length?this._travelModeSelector.store.objectStore.data.slice():[];if(canUseRouteLayerTM=1!==fa.successCode&&sa){var wa="AUTOMOBILE"===pa.type?"Driving":"TRUCK"===pa.type?"Trucking":"WALK"===pa.type?"Walking":"Other";
pa.name="\x26lt;"+pa.name+"\x26gt;";this.serviceDescription.supportedTravelModes=(u.supportedTravelModes||[]).concat(pa);ea.push({id:pa.name,label:'\x3cdiv class\x3d"esriTravelModesDirectionsIcon esriTravelModesType'+wa+sa+'"\x3e\x26nbsp;\x3c/div\x3e\x3cdiv class\x3d"esriTravelModesTypeName"\x3e'+pa.name+"\x3c/div\x3e"});this._travelModeSelector.setStore(new h({objectStore:new n({data:ea})}));this._travelModeSelector._interractive=!1;this._travelModeSelector.setValue(pa.name)}else{sa=!1;if(pa&&pa.name)for(ea=
u.supportedTravelModes||[],A=0;A<ea.length;A++)if(ea[A].name===pa.name){sa=!0;this._travelModeSelector._interractive=!1;this._travelModeSelector.setValue(pa.name);this.routeParams.travelMode=ea[A].impedanceAttributeName?ea[A]:ea[A].itemId;fa.loadMessages.push({message:D.widgets.directions.error.tmFromPortalSameName+" "+pa.name,messageType:"Warning"});break}if(!sa)if((pa=u.defaultTravelMode)&&ea)for(A=0;A<ea.length;A++){if(ea[A].id===pa){this.routeParams.travelMode=ea[A].impedanceAttributeName?ea[A]:
ea[A].itemId;fa.loadMessages.push({message:D.widgets.directions.error.tmFromPortalDefault+" "+(ea[A].name?ea[A].name:ea[A].itemId),messageType:"Warning"});break}}else this.routeParams.travelMode=null}this._checkStartTimeUIAvailability()}if(fa.solveResult&&fa.solveResult.routeResults){var ya=Infinity,Da=-Infinity;pa=fa.solveResult.routeResults[0].stops;var Ca=fa.solveResult.routeResults[0].directions.features;sa={};for(A=0;A<pa.length;A++){var Ga=pa[A].attributes;if(Ga.isWaypoint)for(Z=0;Z<Ca.length;Z++)wa=
Ca[Z].attributes,wa._stopSequence===Ga.Sequence&&(wa.text=wa.text.replace(Ga.Name,this._waypointName));ba=Ga.Name+"_"+this._stopSequence++;sa[ba]=Ga.isWaypoint?this._waypointName:Ga.Name;Ga.Name=ba;if(Ga.Sequence<ya&&(null!==Ga.ArriveCurbApproach||null!==Ga.DepartCurbApproach)){var La=Ga.Name;ya=Ga.Sequence}if(Ga.Sequence>Da&&(null!==Ga.ArriveCurbApproach||null!==Ga.DepartCurbApproach)){var Ta=Ga.Name;Da=Ga.Sequence}}ba=La+" - "+Ta;fa.solveResult.routeResults[0].routeName=ba;fa.solveResult.routeResults[0].directions.routeName=
ba;for(A=0;A<Ca.length;A++)if(wa=Ca[A].attributes,void 0!==wa._stopSequence)for(Z=0;Z<pa.length;Z++)if(wa._stopSequence===pa[Z].attributes.Sequence){ba=pa[Z].attributes.Name;wa.text=(wa.text||"").replace(sa[ba],ba);delete wa._stopSequence;break}La=pa[pa.length-1];pa[0].geometry.x===La.geometry.x&&pa[0].geometry.y===La.geometry.y&&(this._returnToStartStop=this._addStopWrapperToGraphic(new B(La.geometry,null,La.attributes),sa[La.attributes.Name]),this.set("returnToStart",!0));this._solveResultProcessing(fa.solveResult,
sa).then(t.hitch(this,function(){this._setStartTime(void 0,void 0,this.startTime);M(fa);this.zoomToFullRoute();k.resolve(fa)}),k.reject)}else{if(fa.routeParameters){La=fa.routeParameters.stops.features;this.stops=[];for(A=0;A<La.length;A++)this.stops.push(this._addStopWrapperToGraphic(La[A],La[A].attributes.Name)),this._updateStop(this.stops[A],A);this._setStops();fa.loadMessages.push({message:D.widgets.directions.routeLayerStopsOnly,messageType:"Warning"})}else fa.loadMessages.push({message:D.widgets.directions.routeLayerEmpty,
messageType:"Warning"});M(fa);k.resolve(fa)}for(A=0;A<fa.loadMessages.length;A++)this._showMessage(fa.loadMessages[A].message)}),t.hitch(this,function(fa){k.reject(fa);this._showMessage("GWM_0003"===fa.messageCode?D.widgets.directions.error.accessDenied+this._naRouteSharing.portal.getPortalUser().username:D.widgets.directions.error.loadError)}))}),k.reject)}),k.reject);return k.promise}});I("extend-esri")&&t.setObject("dijit.Directions",W,J);return W})},"dojo/data/ObjectStore":function(){define("../_base/lang ../Evented ../_base/declare ../_base/Deferred ../promise/all ../_base/array ../_base/connect ../regexp".split(" "),
function(V,W,t,Q,X,R,H,y){function e(g){return"*"==g?".*":"?"==g?".":g}return t("dojo.data.ObjectStore",[W],{objectStore:null,constructor:function(g){this._dirtyObjects=[];g.labelAttribute&&(g.labelProperty=g.labelAttribute);V.mixin(this,g)},labelProperty:"label",getValue:function(g,l,m){return"function"===typeof g.get?g.get(l):l in g?g[l]:m},getValues:function(g,l){g=this.getValue(g,l);return g instanceof Array?g:void 0===g?[]:[g]},getAttributes:function(g){var l=[],m;for(m in g)!g.hasOwnProperty(m)||
"_"==m.charAt(0)&&"_"==m.charAt(1)||l.push(m);return l},hasAttribute:function(g,l){return l in g},containsValue:function(g,l,m){return-1<R.indexOf(this.getValues(g,l),m)},isItem:function(g){return"object"==typeof g&&g&&!(g instanceof Date)},isItemLoaded:function(g){return g&&"function"!==typeof g.load},loadItem:function(g){var l;"function"===typeof g.item.load?Q.when(g.item.load(),function(m){l=m;var n=m instanceof Error?g.onError:g.onItem;n&&n.call(g.scope,m)}):g.onItem&&g.onItem.call(g.scope,g.item);
return l},close:function(g){return g&&g.abort&&g.abort()},fetch:function(g){function l(w){g.onError&&g.onError.call(n,w,g)}g=V.delegate(g,g&&g.queryOptions);var m=this,n=g.scope||m,h=g.query;if("object"==typeof h){h=V.delegate(h);for(var x in h){var I=h[x];"string"==typeof I&&(h[x]=RegExp("^"+y.escapeString(I,"*?\\").replace(/\\.|\*|\?/g,e)+"$",g.ignoreCase?"mi":"m"),h[x].toString=function(w){return function(){return w}}(I))}}var K=this.objectStore.query(h,g);Q.when(K.total,function(w){Q.when(K,function(L){g.onBegin&&
g.onBegin.call(n,w||L.length,g);if(g.onItem)for(var T=0;T<L.length;T++)g.onItem.call(n,L[T],g);g.onComplete&&g.onComplete.call(n,g.onItem?null:L,g);return L},l)},l);g.abort=function(){K.cancel&&K.cancel()};K.observe&&(this.observing&&this.observing.cancel(),this.observing=K.observe(function(w,L,T){if(-1==R.indexOf(m._dirtyObjects,w))if(-1==L)m.onNew(w);else if(-1==T)m.onDelete(w);else for(var U in w)if(U!=m.objectStore.idProperty)m.onSet(w,U,null,w[U])},!0));this.onFetch(K);g.store=this;return g},
getFeatures:function(){return{"dojo.data.api.Read":!!this.objectStore.get,"dojo.data.api.Identity":!0,"dojo.data.api.Write":!!this.objectStore.put,"dojo.data.api.Notification":!0}},getLabel:function(g){if(this.isItem(g))return this.getValue(g,this.labelProperty)},getLabelAttributes:function(g){return[this.labelProperty]},getIdentity:function(g){return this.objectStore.getIdentity?this.objectStore.getIdentity(g):g[this.objectStore.idProperty||"id"]},getIdentityAttributes:function(g){return[this.objectStore.idProperty]},
fetchItemByIdentity:function(g){var l;Q.when(this.objectStore.get(g.identity),function(m){l=m;g.onItem.call(g.scope,m)},function(m){g.onError.call(g.scope,m)});return l},newItem:function(g,l){if(l){var m=this.getValue(l.parent,l.attribute,[]);m=m.concat([g]);g.__parent=m;this.setValue(l.parent,l.attribute,m)}this._dirtyObjects.push({object:g,save:!0});this.onNew(g);return g},deleteItem:function(g){this.changing(g,!0);this.onDelete(g)},setValue:function(g,l,m){var n=g[l];this.changing(g);g[l]=m;this.onSet(g,
l,n,m)},setValues:function(g,l,m){if(!V.isArray(m))throw Error("setValues expects to be passed an Array object as its value");this.setValue(g,l,m)},unsetAttribute:function(g,l){this.changing(g);var m=g[l];delete g[l];this.onSet(g,l,m,void 0)},changing:function(g,l){g.__isDirty=!0;for(var m=0;m<this._dirtyObjects.length;m++){var n=this._dirtyObjects[m];if(g==n.object){l&&(n.object=!1,this._saveNotNeeded||(n.save=!0));return}}n=g instanceof Array?[]:{};for(m in g)g.hasOwnProperty(m)&&(n[m]=g[m]);this._dirtyObjects.push({object:!l&&
g,old:n,save:!this._saveNotNeeded})},save:function(g){g=g||{};var l=[],m=[],n=this,h=this._dirtyObjects;try{H.connect(g,"onError",function(){if(!1!==g.revertOnError){var U=h;h=m;n.revert();n._dirtyObjects=U}else n._dirtyObjects=h.concat(m)});var x;this.objectStore.transaction&&(x=this.objectStore.transaction());for(var I=0;I<h.length;I++){var K=h[I],w=K.object,L=K.old;delete w.__isDirty;if(w){var T=this.objectStore.put(w,{overwrite:!!L});l.push(T)}else"undefined"!=typeof L&&(T=this.objectStore.remove(this.getIdentity(L)),
l.push(T));m.push(K);h.splice(I--,1)}X(l).then(function(U){g.onComplete&&g.onComplete.call(g.scope,U)},function(U){g.onError&&g.onError.call(g.scope,U)});x&&x.commit()}catch(U){g.onError.call(g.scope,value)}},revert:function(){for(var g=this._dirtyObjects,l=g.length;0<l;){l--;var m=g[l],n=m.object;m=m.old;if(n&&m){for(var h in m)m.hasOwnProperty(h)&&n[h]!==m[h]&&(this.onSet(n,h,n[h],m[h]),n[h]=m[h]);for(h in n)m.hasOwnProperty(h)||(this.onSet(n,h,n[h]),delete n[h])}else if(m)this.onNew(m);else this.onDelete(n);
delete (n||m).__isDirty;g.splice(l,1)}},isDirty:function(g){return g?g.__isDirty:!!this._dirtyObjects.length},onSet:function(){},onNew:function(){},onDelete:function(){},onFetch:function(g){}})})},"esri/tasks/RouteTask":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/has ../kernel ../graphic ../request ../geometry/normalizeUtils ./Task ./RouteResult ./NAMessage ./NAServiceDescription".split(" "),function(V,W,t,Q,X,R,H,y,e,g,l,m){V=V([e,m],{declaredClass:"esri.tasks.RouteTask",
_eventMap:{"solve-complete":["result"]},constructor:function(n){this._url.orig=this._url.path;this._url.path+="/solve";this._handler=W.hitch(this,this._handler);this.registerConnectEvents()},__msigns:[{n:"solve",c:3,a:[{i:0,p:["stops.features","barriers.features","polylineBarriers.features","polygonBarriers.features"]}],e:2}],_handler:function(n,h,x,I,K){try{var w=[],L=[],T=n.directions||[],U=n.routes?n.routes.features:[],N=n.stops?n.stops.features:[],S=n.barriers?n.barriers.features:[],F=n.polygonBarriers?
n.polygonBarriers.features:[],a=n.polylineBarriers?n.polylineBarriers.features:[],D=n.messages,da=t.forEach,ha=t.indexOf,ia=!0,na,P,la=n.routes&&n.routes.spatialReference||n.stops&&n.stops.spatialReference||n.barriers&&n.barriers.spatialReference||n.polygonBarriers&&n.polygonBarriers.spatialReference||n.polylineBarriers&&n.polylineBarriers.spatialReference;this._chk=n.checksum;da(T,function(z){w.push(na=z.routeName);L[na]={directions:z}});da(U,function(z){-1===ha(w,na=z.attributes.Name)&&(w.push(na),
L[na]={});L[na].route=z});da(N,function(z){P=z.attributes;-1===ha(w,na=P.RouteName||"esri.tasks.RouteTask.NULL_ROUTE_NAME")&&(w.push(na),L[na]={});"esri.tasks.RouteTask.NULL_ROUTE_NAME"!==na&&(ia=!1);void 0===L[na].stops&&(L[na].stops=[]);L[na].stops.push(z)});0<N.length&&!0===ia&&(L[w[0]].stops=L["esri.tasks.RouteTask.NULL_ROUTE_NAME"].stops,delete L["esri.tasks.RouteTask.NULL_ROUTE_NAME"],w.splice(t.indexOf(w,"esri.tasks.RouteTask.NULL_ROUTE_NAME"),1));var ja=[];da(w,function(z,B){L[z].routeName=
"esri.tasks.RouteTask.NULL_ROUTE_NAME"===z?null:z;L[z].spatialReference=la;ja.push(new g(L[z]))});n=function(z){da(z,function(B,ca){B.geometry&&(B.geometry.spatialReference=la);z[ca]=new R(B)});return z};da(D,function(z,B){D[B]=new l(z)});var J={routeResults:ja,barriers:n(S),polygonBarriers:n(F),polylineBarriers:n(a),messages:D};this._successHandler([J],"onSolveComplete",x,K)}catch(z){this._errorHandler(z,I,K)}},solve:function(n,h,x,I){var K=I.assembly;n=this._encode(W.mixin({},this._url.query,{f:"json"},
n.toJson(K&&K[0]),this._chk?{checksum:this._chk}:{}));var w=this._handler,L=this._errorHandler;return H({url:this._url.path,timeout:25E4,content:n,callbackParamName:"callback",load:function(T,U){w(T,U,h,x,I.dfd)},error:function(T){L(T,x,I.dfd)}})},onSolveComplete:function(){}});y._createWrappers(V);Q("extend-esri")&&W.setObject("tasks.RouteTask",V,X);return V})},"esri/tasks/RouteResult":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/has ../kernel ../graphic ./DirectionsFeatureSet".split(" "),
function(V,W,t,Q,X,R,H){V=V(null,{declaredClass:"esri.tasks.RouteResult",constructor:function(y){var e=y.spatialReference,g=y.route;if(y.directions){var l=[],m=[],n=[];t.forEach(y.directions.features,function(x,I){m[I]=x.compressedGeometry;l[I]=x.strings;n[I]=x.events});y.directions.strings=l;y.directions.events=n;this.directions=new H(y.directions,m)}this.routeName=y.routeName;g&&(g.geometry&&(g.geometry.spatialReference=e),this.route=new R(g));if(y.stops){var h=this.stops=[];t.forEach(y.stops,function(x,
I){x.geometry&&(x.geometry.spatialReference=e);h[x.attributes.Sequence-1]=new R(x)})}},routeName:null,directions:null,route:null,stops:null});Q("extend-esri")&&W.setObject("tasks.RouteResult",V,X);return V})},"esri/tasks/DirectionsFeatureSet":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/has dojo/json ../kernel ../geometry/Extent ../geometry/Polyline ../geometry/Point ../graphic ./FeatureSet".split(" "),function(V,W,t,Q,X,R,H,y,e,g,l){V=V(l,{declaredClass:"esri.tasks.DirectionsFeatureSet",
constructor:function(m,n){this.routeId=m.routeId;this.routeName=m.routeName;W.mixin(this,m.summary);this.extent=new H(this.envelope);var h=this._fromCompressedGeometry,x=this.features,I=this.extent.spatialReference,K=[];t.forEach(n,function(w,L){x[L].setGeometry(K[L]=w?h(w,I):x[L].geometry)});this.mergedGeometry=this._mergePolylinesToSinglePath(K,I);this.geometryType="esriGeometryPolyline";t.forEach(m.events,function(w,L){t.forEach(w,function(T,U){w[U]=new g(new e(T.point.x,T.point.y,I),null,{ETA:T.ETA,
strings:X.stringify(T.strings),arriveTimeUTC:T.arriveTimeUTC})});m.events[L]=w});delete this.envelope},_fromCompressedGeometry:function(m,n){var h=0,x=0,I=0,K=0,w=[],L=0,T=0,U=0;(m=m.match(/((\+|\-)[^\+\-\|]+|\|)/g))||(m=[]);if(0===parseInt(m[L],32)){L=2;var N=parseInt(m[L],32);L++;var S=parseInt(m[L],32);L++;if(N&1){T=t.indexOf(m,"|")+1;var F=parseInt(m[T],32);T++}if(N&2){U=t.indexOf(m,"|",T)+1;var a=parseInt(m[U],32);U++}}else S=parseInt(m[L],32),L++;for(;L<m.length&&"|"!==m[L];){N=parseInt(m[L],
32)+h;L++;h=N;var D=parseInt(m[L],32)+x;L++;x=D;N=[N/S,D/S];T&&(D=parseInt(m[T],32)+I,T++,I=D,N.push(D/F));U&&(D=parseInt(m[U],32)+K,U++,K=D,N.push(D/a));w.push(N)}h=new y({paths:[w],hasZ:0<T,hasM:0<U});h.setSpatialReference(n);return h},_mergePolylinesToSinglePath:function(m,n){var h=[],x=!1;t.forEach(m,function(w){t.forEach(w.paths,function(L){x=x||w.hasM;h=h.concat(L)})});var I=[],K=[0,0];t.forEach(h,function(w){if(w[0]!==K[0]||w[1]!==K[1])I.push(w),K=w});return new y({paths:[I],spatialReference:n,
hasM:x})}});Q("extend-esri")&&W.setObject("tasks.DirectionsFeatureSet",V,R);return V})},"esri/tasks/NAMessage":function(){define(["dojo/_base/declare","dojo/_base/lang","dojo/has","../kernel"],function(V,W,t,Q){V=V(null,{declaredClass:"esri.tasks.NAMessage",constructor:function(X){W.mixin(this,X)}});W.mixin(V,{TYPE_INFORMATIVE:0,TYPE_PROCESS_DEFINITION:1,TYPE_PROCESS_START:2,TYPE_PROCESS_STOP:3,TYPE_WARNING:50,TYPE_ERROR:100,TYPE_EMPTY:101,TYPE_ABORT:200});t("extend-esri")&&W.setObject("tasks.NAMessage",
V,Q);return V})},"esri/tasks/NAServiceDescription":function(){define(["dojo/_base/declare","dojo/json","dojo/Deferred","dojo/_base/lang","../request"],function(V,W,t,Q,X){return V(null,{declaredClass:"esri.tasks._NAServiceDescription",_sd:null,getServiceDescription:function(R,H){var y=new t;if(this._sd)y.resolve(this._sd);else if(this._url&&this._url.orig){var e=this._url.orig,g=(this._url.path.match(/\/solve$/)||[]).length?"Route":(this._url.path.match(/\/solveClosestFacility$/)||[]).length?"ClosestFacility":
"ServiceAreas",l,m=function(n){X({url:n+("/"===n[n.length-1]?"":"/")+"GetTravelModes/execute",content:{f:"json",serviceName:g},callbackParamName:"callback"}).then(function(h){var x=[],I=null;if(h&&h.results&&h.results.length)for(var K=0;K<h.results.length;K++)if("supportedTravelModes"===h.results[K].paramName){if(h.results[K].value&&h.results[K].value.features)for(var w=0;w<h.results[K].value.features.length;w++)if(h.results[K].value.features[w].attributes){var L=W.parse(h.results[K].value.features[w].attributes.TravelMode);
x.push(L)}}else"defaultTravelMode"===h.results[K].paramName&&(I=h.results[K].value);l.supportedTravelModes=x;l.defaultTravelMode=I;y.resolve(l)},function(h){console.log("Could not read from the routingUtilities service.");y.reject(h)})};X({url:e,content:{f:"json"},callbackParamName:"callback"}).then(function(n){l=n;l.supportedTravelModes||(l.supportedTravelModes=[]);for(n=0;n<l.supportedTravelModes.length;n++)l.supportedTravelModes[n].id||(l.supportedTravelModes[n].id=l.supportedTravelModes[n].itemId);
H?y.resolve(l):R?m(R):10.4<=l.currentVersion?X({url:e+("/"===e[e.length-1]?"":"/")+"retrieveTravelModes",content:{f:"json"},callbackParamName:"callback"}).then(function(h){l.supportedTravelModes=h.supportedTravelModes;l.defaultTravelMode=h.defaultTravelMode;y.resolve(l)},function(h){console.log("Could not get to the NAServer's retrieveTravelModes.");y.reject(h)}):X({url:e.substring(0,e.indexOf("/rest/")+6)+"info",content:{f:"json"},callbackParamName:"callback"}).then(function(h){h.owningSystemUrl?
(e=h.owningSystemUrl,X({url:e+("/"===e[e.length-1]?"":"/")+"sharing/rest/portals/self",content:{f:"json"},callbackParamName:"callback"}).then(function(x){x&&x.helperServices&&x.helperServices.routingUtilities&&x.helperServices.routingUtilities.url?m(x.helperServices.routingUtilities.url):(console.log("Portal does not have helperServices.routingUtilities defined."),y.resolve(l))},function(x){console.log("Could not get to the portal's self.");y.reject(x)})):y.resolve(l)},function(h){console.log("Could not get to the NAServer service description.");
y.reject(h)})},function(n){y.reject(n)})}else y.reject("NA Task has no URL specified.");y.then(Q.hitch(this,function(n){this._sd=n}),Q.hitch(this,function(){this._sd=null}));return y.promise},getOwningSystemUrl:function(){var R=new t;if(this._url&&this._url.orig){var H=this._url.orig;X({url:H.substring(0,H.indexOf("/rest/")+6)+"info",content:{f:"json"},callbackParamName:"callback"}).promise.always(function(y){R.resolve(y.owningSystemUrl)})}else R.resolve(void 0);return R.promise}})})},"esri/tasks/RouteParameters":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/json dojo/has ../kernel ../lang ../graphicsUtils ./NATypes".split(" "),
function(V,W,t,Q,X,R,H,y){V=V(null,{declaredClass:"esri.tasks.RouteParameters",accumulateAttributes:null,attributeParameterValues:null,barriers:null,directionsLanguage:null,directionsLengthUnits:null,directionsOutputType:null,directionsStyleName:null,directionsTimeAttribute:null,doNotLocateOnRestrictedElements:!0,findBestSequence:null,ignoreInvalidLocations:null,impedanceAttribute:null,outputLines:"esriNAOutputLineTrueShape",outputGeometryPrecision:null,outputGeometryPrecisionUnits:null,outSpatialReference:null,
overrides:null,polygonBarriers:null,polylineBarriers:null,preserveFirstStop:null,preserveLastStop:null,restrictionAttributes:null,restrictUTurns:null,returnBarriers:!1,returnDirections:!1,returnPolygonBarriers:!1,returnPolylineBarriers:!1,returnRoutes:!0,returnStops:!1,returnZ:!0,startTime:null,startTimeIsUTC:null,timeWindowsAreUTC:null,stops:null,useHierarchy:null,useTimeWindows:null,travelMode:null,toJson:function(e){var g={returnDirections:this.returnDirections,returnRoutes:this.returnRoutes,returnZ:this.returnZ,
returnStops:this.returnStops,returnBarriers:this.returnBarriers,returnPolygonBarriers:this.returnPolygonBarriers,returnPolylineBarriers:this.returnPolylineBarriers,attributeParameterValues:this.attributeParameterValues&&t.toJson(this.attributeParameterValues),outSR:this.outSpatialReference?this.outSpatialReference.wkid||t.toJson(this.outSpatialReference.toJson()):null,outputLines:this.outputLines,overrides:this.overrides,findBestSequence:this.findBestSequence,preserveFirstStop:this.preserveFirstStop,
preserveLastStop:this.preserveLastStop,useTimeWindows:this.useTimeWindows,startTime:this.startTime?this.startTime.getTime():null,startTimeIsUTC:this.startTimeIsUTC,timeWindowsAreUTC:this.timeWindowsAreUTC,accumulateAttributeNames:this.accumulateAttributes?this.accumulateAttributes.join(","):null,ignoreInvalidLocations:this.ignoreInvalidLocations,impedanceAttributeName:this.impedanceAttribute,restrictionAttributeNames:this.restrictionAttributes?this.restrictionAttributes.join(","):null,restrictUTurns:this.restrictUTurns,
useHierarchy:this.useHierarchy,directionsLanguage:this.directionsLanguage,outputGeometryPrecision:this.outputGeometryPrecision,outputGeometryPrecisionUnits:this.outputGeometryPrecisionUnits,directionsLengthUnits:y.LengthUnit[this.directionsLengthUnits],directionsTimeAttributeName:this.directionsTimeAttribute,directionsStyleName:this.directionsStyleName,travelMode:"object"===typeof this.travelMode?t.toJson(this.travelMode):this.travelMode},l=this.stops;"esri.tasks.FeatureSet"===l.declaredClass&&0<
l.features.length?g.stops=t.toJson({type:"features",features:H._encodeGraphics(l.features,e&&e["stops.features"]),doNotLocateOnRestrictedElements:this.doNotLocateOnRestrictedElements}):"esri.tasks.DataLayer"===l.declaredClass?g.stops=l:"esri.tasks.DataFile"===l.declaredClass&&(g.stops=t.toJson({type:"features",url:l.url,doNotLocateOnRestrictedElements:this.doNotLocateOnRestrictedElements}));if(this.directionsOutputType)switch(this.directionsOutputType.toLowerCase()){case "complete":g.directionsOutputType=
"esriDOTComplete";break;case "complete-no-events":g.directionsOutputType="esriDOTCompleteNoEvents";break;case "instructions-only":g.directionsOutputType="esriDOTInstructionsOnly";break;case "standard":g.directionsOutputType="esriDOTStandard";break;case "summary-only":g.directionsOutputType="esriDOTSummaryOnly";break;default:g.directionsOutputType=this.directionsOutputType}l=function(m,n){return m?"esri.tasks.FeatureSet"===m.declaredClass?0<m.features.length?t.toJson({type:"features",features:H._encodeGraphics(m.features,
e&&e[n])}):null:"esri.tasks.DataLayer"===m.declaredClass?m:"esri.tasks.DataFile"===m.declaredClass?t.toJson({type:"features",url:m.url}):t.toJson(m):null};this.barriers&&(g.barriers=l(this.barriers,"barriers.features"));this.polygonBarriers&&(g.polygonBarriers=l(this.polygonBarriers,"polygonBarriers.features"));this.polylineBarriers&&(g.polylineBarriers=l(this.polylineBarriers,"polylineBarriers.features"));return R.filter(g,function(m){if(null!==m)return!0})}});Q("extend-esri")&&W.setObject("tasks.RouteParameters",
V,X);return V})},"esri/tasks/NATypes":function(){define(["dojo/_base/lang","dojo/has","../kernel"],function(V,W,t){var Q={esriFeet:"esriNAUFeet",esriKilometers:"esriNAUKilometers",esriMeters:"esriNAUMeters",esriMiles:"esriNAUMiles",esriNauticalMiles:"esriNAUNauticalMiles",esriYards:"esriNAUYards"},X={NONE:"esriNAOutputLineNone",STRAIGHT:"esriNAOutputLineStraight",TRUE_SHAPE:"esriNAOutputLineTrueShape",TRUE_SHAPE_WITH_MEASURE:"esriNAOutputLineTrueShapeWithMeasure"},R={ALLOW_BACKTRACK:"esriNFSBAllowBacktrack",
AT_DEAD_ENDS_ONLY:"esriNFSBAtDeadEndsOnly",NO_BACKTRACK:"esriNFSBNoBacktrack",AT_DEAD_ENDS_AND_INTERSECTIONS:"esriNFSBAtDeadEndsAndIntersections"},H={NONE:"esriNAOutputPolygonNone",SIMPLIFIED:"esriNAOutputPolygonSimplified",DETAILED:"esriNAOutputPolygonDetailed"},y={FROM_FACILITY:"esriNATravelDirectionFromFacility",TO_FACILITY:"esriNATravelDirectionToFacility"},e={LengthUnit:Q,OutputLine:X,UTurn:R,OutputPolygon:H,TravelDirection:y};W("extend-esri")&&(V.setObject("tasks._NALengthUnit",Q,t),V.setObject("tasks.NAOutputLine",
X,t),V.setObject("tasks.NAUTurn",R,t),V.setObject("tasks.NAOutputPolygon",H,t),V.setObject("tasks.NATravelDirection",y,t));return e})},"esri/tasks/DistanceParameters":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/json dojo/has ../kernel ../geometry/jsonUtils".split(" "),function(V,W,t,Q,X,R){V=V(null,{declaredClass:"esri.tasks.DistanceParameters",geometry1:null,geometry2:null,distanceUnit:null,geodesic:null,toJson:function(){var H={},y=this.geometry1;y&&(H.geometry1=t.toJson({geometryType:R.getJsonType(y),
geometry:y}));if(y=this.geometry2)H.geometry2=t.toJson({geometryType:R.getJsonType(y),geometry:y});H.sr=t.toJson(this.geometry1.spatialReference.toJson());this.distanceUnit&&(H.distanceUnit=this.distanceUnit);this.geodesic&&(H.geodesic=this.geodesic);return H}});Q("extend-esri")&&W.setObject("tasks.DistanceParameters",V,X);return V})},"esri/tasks/PrintTask":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/_base/json dojo/_base/Deferred dojo/has ../kernel ../lang ../layerUtils ../deferredUtils ../Color ../request ../urlUtils ../geometry/Polygon ../renderers/SimpleRenderer ../symbols/FillSymbol ./Geoprocessor ./PrintTemplate ./Task dojo/dom-attr dojo/dom-construct dojox/gfx/_base dojox/gfx/canvas dojox/json/query dojo/has!extend-esri?./PrintParameters dojo/has!extend-esri?./LegendLayer".split(" "),
function(V,W,t,Q,X,R,H,y,e,g,l,m,n,h,x,I,K,w,L,T,U,N,S,F){V=V(L,{declaredClass:"esri.tasks.PrintTask",constructor:function(a,D){this.url=a;this.printGp=new K(this.url);this._handler=W.hitch(this,this._handler);D&&D.async&&(this.async=!0);this._colorEvaluator=F("$..color")},async:!1,_vtlExtent:null,_cimVersion:null,_is11xService:!1,_loadGpServerMetadata:!0,execute:function(a,D,da){if(!this._loadGpServerMetadata)return this._execute(a,D,da);var ha=new X(g._dfdCanceller),ia=this._url.path,na=ia.lastIndexOf("/GPServer/");
0<na&&(ia=ia.slice(0,na+9));ha._pendingDfd=m({url:ia,callbackParamName:"callback",content:W.mixin({},this._url.query,{f:"json"})}).then(W.hitch(this,function(P){this._loadGpServerMetadata=!1;this.async="esriExecutionTypeAsynchronous"===P.executionType;this._cimVersion=P.cimVersion;this._is11xService=!!this._cimVersion;ha._pendingDfd=this._execute(a);return ha._pendingDfd})).then(W.hitch(this,function(P){this._successHandler([P],null,D,ha)})).otherwise(function(P){da&&da(P);ha.errback(P)});return ha},
_handler:function(a,D,da,ha,ia){try{if(this.async)"esriJobSucceeded"===a.jobStatus?this.printGp.getResultData(a.jobId,"Output_File",W.hitch(this,function(P){na=P.value;this._successHandler([na],"onComplete",da,ia)})):this._errorHandler(Error(a.jobStatus),ha,ia);else{var na=a[0].value;this._successHandler([na],"onComplete",da,ia)}}catch(P){this._errorHandler(P,ha,ia)}},_execute:function(a,D,da){var ha=this._handler,ia=this._errorHandler,na=a.template||new w;na.hasOwnProperty("showLabels")||(na.showLabels=
!0);var P=na.exportOptions,la;P&&(la={outputSize:[P.width,P.height],dpi:P.dpi});P=na.layoutOptions;var ja=[];if(P){this.legendAll=!1;P.legendLayers?t.forEach(P.legendLayers,function(G){var r={};r.id=G.layerId;G.subLayerIds&&(r.subLayerIds=G.subLayerIds);ja.push(r)}):this.legendAll=!0;if("Miles"===P.scalebarUnit||"Kilometers"===P.scalebarUnit){var J="esriKilometers";var z="esriMiles"}else if("Meters"===P.scalebarUnit||"Feet"===P.scalebarUnit)J="esriMeters",z="esriFeet";var B={esriMiles:"mi",esriKilometers:"km",
esriFeet:"ft",esriMeters:"m"};B={titleText:P.titleText,authorText:P.authorText,copyrightText:P.copyrightText,customTextElements:P.customTextElements,scaleBarOptions:{metricUnit:J,metricLabel:B[J],nonMetricUnit:z,nonMetricLabel:B[z]},legendOptions:{operationalLayers:ja}}}J=this._getPrintDefinition(a.map,na);a.outSpatialReference&&(J.mapOptions.spatialReference=a.outSpatialReference.toJson());a.template&&y.isDefined(a.template.showAttribution)&&(J.mapOptions.showAttribution=a.template.showAttribution);
W.mixin(J,{exportOptions:la,layoutOptions:B});this.allLayerslegend&&W.mixin(J.layoutOptions,{legendOptions:{operationalLayers:this.allLayerslegend}});if(J.operationalLayers){la=J.operationalLayers;var ca=function(G){return y.fixJson(W.mixin(G,{type:"esriSLS",cap:void 0,join:void 0,meterLimit:void 0}))},ra=/[\u4E00-\u9FFF\u0E00-\u0E7F\u0900-\u097F\u3040-\u309F\u30A0-\u30FF\u31F0-\u31FF]/,oa=/[\u0600-\u06FF]/,ta=function(G){var r=G.text,d=(G=G.font)&&G.family&&G.family.toLowerCase();r&&G&&("arial"===
d||"arial unicode ms"===d)&&(G.family=ra.test(r)?"Arial Unicode MS":"Arial","normal"!==G.style&&oa.test(r)&&(G.family="Arial Unicode MS"))};for(B=0;B<la.length;B++)if(la[B].featureCollection&&la[B].featureCollection.layers)for(z=0;z<la[B].featureCollection.layers.length;z++){var za=la[B].featureCollection.layers[z];if(za.layerDefinition&&za.layerDefinition.drawingInfo&&za.layerDefinition.drawingInfo.renderer&&za.layerDefinition.drawingInfo.renderer.symbol){var b=za.layerDefinition.drawingInfo.renderer;
"esriCLS"===b.symbol.type?b.symbol=ca(b.symbol):"esriTS"===b.symbol.type?ta(b.symbol):b.symbol.outline&&"esriCLS"===b.symbol.outline.type&&(b.symbol.outline=ca(b.symbol.outline))}if(za.featureSet&&za.featureSet.features)for(P=0;P<za.featureSet.features.length;P++)b=za.featureSet.features[P],b.symbol&&("esriCLS"===b.symbol.type?b.symbol=ca(b.symbol):"esriTS"===b.symbol.type?ta(b.symbol):b.symbol.outline&&"esriCLS"===b.symbol.outline.type&&(b.symbol.outline=ca(b.symbol.outline)))}}na={Web_Map_as_JSON:Q.toJson(y.fixJson(J)),
Format:na.format,Layout_Template:na.layout};a.extraParameters&&(na=W.mixin(na,a.extraParameters));var f=new X(g._dfdCanceller);a=function(G,r){ha(G,r,D,da,f)};J=function(G){ia(G,da,f)};f._pendingDfd=this.async?this.printGp.submitJob(na,a,null,J):this.printGp.execute(na,a,J);return f},onComplete:function(){},_createMultipointLayer:function(){return{layerDefinition:{name:"multipointLayer",geometryType:"esriGeometryMultipoint",drawingInfo:{renderer:null}},featureSet:{geometryType:"esriGeometryMultipoint",
features:[]}}},_createPolygonLayer:function(){return{layerDefinition:{name:"polygonLayer",geometryType:"esriGeometryPolygon",drawingInfo:{renderer:null}},featureSet:{geometryType:"esriGeometryPolygon",features:[]}}},_createPointLayer:function(){return{layerDefinition:{name:"pointLayer",geometryType:"esriGeometryPoint",drawingInfo:{renderer:null}},featureSet:{geometryType:"esriGeometryPoint",features:[]}}},_createPolylineLayer:function(){return{layerDefinition:{name:"polylineLayer",geometryType:"esriGeometryPolyline",
drawingInfo:{renderer:null}},featureSet:{geometryType:"esriGeometryPolyline",features:[]}}},_convertSvgSymbol:function(a){if(!(8>=R("ie")||!a.path&&"image/svg+xml"!==a.contentType)){var D=S.createSurface(U.create("div"),1024,1024);var da="image/svg+xml"===a.contentType?D.createObject(S.Image,{src:"data:image/svg+xml;base64,"+a.imageData,width:N.pt2px(a.width),height:N.pt2px(a.height),x:0,y:0}):D.createObject(S.Path,a.path).setFill(a.color).setStroke(a.outline);"pendingRender"in D&&D._render(!0);var ha=
D.rawNode.getContext("2d"),ia=Math.ceil(da.getBoundingBox().width),na=Math.ceil(da.getBoundingBox().height);da=ha.getImageData(da.getBoundingBox().x,da.getBoundingBox().y,ia,na);ha.canvas.width=ia;ha.canvas.height=na;ha.putImageData(da,0,0);ha=ha.canvas.toDataURL("image/png");a={type:"esriPMS",imageData:ha.substr(22,ha.length),angle:a.angle,contentType:"image/png",height:a.size?a.size:N.px2pt(na),width:a.size?ia/na*a.size:N.px2pt(ia),xoffset:a.xoffset,yoffset:a.yoffset};D.destroy();return a}},_convertSvgRenderer:function(a){"simple"===
a.type&&a.symbol&&(a.symbol.path||"image/svg+xml"===a.symbol.contentType)?a.symbol=this._convertSvgSymbol(a.symbol):"uniqueValue"===a.type?(a.defaultSymbol&&(a.defaultSymbol.path||"image/svg+xml"===a.defaultSymbol.contentType)&&(a.defaultSymbol=this._convertSvgSymbol(a.defaultSymbol)),a.uniqueValueInfos&&t.forEach(a.uniqueValueInfos,function(D){if(D.symbol.path||"image/svg+xml"===D.symbol.contentType)D.symbol=this._convertSvgSymbol(D.symbol)},this)):"classBreaks"===a.type&&(a.defaultSymbol&&(a.defaultSymbol.path||
"image/svg+xml"===a.defaultSymbol.contentType)&&(a.defaultSymbol=this._convertSvgSymbol(a.defaultSymbol)),a.classBreakInfos&&t.forEach(a.classBreakInfos,function(D){if(D.symbol.path||"image/svg+xml"===D.symbol.contentType)D.symbol=this._convertSvgSymbol(D.symbol)},this))},_createFeatureCollection:function(a,D,da,ha){var ia=this._createPolygonLayer(),na=this._createPolylineLayer(),P=this._createPointLayer(),la=this._createMultipointLayer(),ja=this._createPointLayer();ja.layerDefinition.name="textLayer";
delete ja.layerDefinition.drawingInfo;if("esri.layers.FeatureLayer"===a.declaredClass||"esri.layers.StreamLayer"===a.declaredClass)ia.layerDefinition.name=na.layerDefinition.name=P.layerDefinition.name=la.layerDefinition.name=W.getObject("arcgisProps.title",!1,a)||a.name||a.id;var J=a.renderer&&"esri.renderer.SimpleRenderer"===a.renderer.declaredClass;if(!a.renderer||a.renderer.valueExpression||W.isFunction(a.renderer.attributeField))delete ia.layerDefinition.drawingInfo,delete na.layerDefinition.drawingInfo,
delete P.layerDefinition.drawingInfo,delete la.layerDefinition.drawingInfo;else{var z=a.renderer.toJson({useLegacyRotationProperties:!0});if("temporal"===z.type){z={latestObservationRenderer:z.latestObservationRenderer,trackLinesRenderer:z.trackRenderer,observationAger:z.observationAger,renderer:z.observationRenderer};var B={};a._trackIdField&&(B.trackIdField=a._trackIdField);a._startTimeField&&(B.startTimeField=a._startTimeField);a._endTimeField&&(B.endTimeField=a._endTimeField);ia.layerDefinition.drawingInfo=
z;ia.layerDefinition.timeInfo=B;na.layerDefinition.drawingInfo=z;na.layerDefinition.timeInfo=B;P.layerDefinition.drawingInfo=z;P.layerDefinition.timeInfo=B;la.layerDefinition.drawingInfo=z;la.layerDefinition.timeInfo=B}else ia.layerDefinition.drawingInfo.renderer=z,na.layerDefinition.drawingInfo.renderer=z,P.layerDefinition.drawingInfo.renderer=z,la.layerDefinition.drawingInfo.renderer=z}z=a.fields;z||!a.renderer||a.renderer.valueExpression||W.isFunction(a.renderer.attributeField)||("esri.renderer.ClassBreaksRenderer"===
a.renderer.declaredClass?(z=[{name:a.renderer.attributeField,type:"esriFieldTypeDouble"}],a.renderer.normalizationField&&z.push({name:a.renderer.normalizationField,type:"esriFieldTypeDouble"})):"esri.renderer.UniqueValueRenderer"===a.renderer.declaredClass&&(z=[{name:a.renderer.attributeField,type:"esriFieldTypeString"}],a.renderer.attributeField2&&z.push({name:a.renderer.attributeField2,type:"esriFieldTypeString"}),a.renderer.attributeField3&&z.push({name:a.renderer.attributeField3,type:"esriFieldTypeString"})));
z&&(ia.layerDefinition.fields=z,na.layerDefinition.fields=z,P.layerDefinition.fields=z,la.layerDefinition.fields=z);z=a.graphics;a.isFeatureReductionActive&&a.isFeatureReductionActive()&&(z=a.getSingleGraphics());B=z.length;var ca;for(ca=0;ca<B;ca++){var ra=z[ca];if(!1!==ra.visible&&ra.geometry){var oa=ra.toJson();oa.symbol&&oa.symbol.outline&&oa.symbol.outline.color&&oa.symbol.outline.color[3]&&!this._is11xService&&(oa.symbol.outline.color[3]=255);if(a.renderer&&!oa.symbol&&(W.isFunction(a.renderer.attributeField)||
a.renderer.valueExpression||this._isFeatureCollectionRequired(a.renderer,a)||"esri.renderer.DotDensityRenderer"===a.renderer.declaredClass||da)){da=da||a.renderer;var ta=null;try{ta=da.getSymbol(ra)}catch(za){}if(!ta)continue;oa.symbol=ta.toJson();this._isFeatureCollectionRequired(da,a)&&this._applyVisualVariables(oa.symbol,{renderer:da,graphic:ra,symbol:ta,mapResolution:D&&D.getResolutionInMeters(),mapScale:D&&D.getScale()})}oa.symbol&&(oa.symbol.path||"image/svg+xml"===oa.symbol.contentType?oa.symbol=
this._convertSvgSymbol(oa.symbol):oa.symbol.text&&delete oa.attributes);switch(ra.geometry.type){case "polygon":ia.featureSet.features.push(oa);break;case "polyline":na.featureSet.features.push(oa);break;case "point":oa.symbol&&oa.symbol.text?ja.featureSet.features.push(oa):P.featureSet.features.push(oa);break;case "multipoint":la.featureSet.features.push(oa);break;case "extent":oa.geometry=h.fromExtent(ra.geometry).toJson(),ia.featureSet.features.push(oa)}}}D=[];0<ia.featureSet.features.length&&
D.push(ia);0<na.featureSet.features.length&&D.push(na);0<la.featureSet.features.length&&D.push(la);0<P.featureSet.features.length&&D.push(P);0<ja.featureSet.features.length&&D.push(ja);if(!D.length)return null;t.forEach(D,function(za){var b=t.every(za.featureSet.features,function(f){return f.symbol});if(J||b)ha&&ha.forceFeatureAttributes||t.forEach(za.featureSet.features,function(f){delete f.attributes}),ha.forceFeatureAttributes||delete za.layerDefinition.fields;b&&delete za.layerDefinition.drawingInfo});
t.forEach(D,function(za){za.layerDefinition.drawingInfo&&za.layerDefinition.drawingInfo.renderer&&this._convertSvgRenderer(za.layerDefinition.drawingInfo.renderer)},this);return{id:a.id,opacity:a.opacity,minScale:a.minScale||0,maxScale:a.maxScale||0,featureCollection:{layers:D}}},_getPrintDefinition:function(a,D){var da={operationalLayers:this._createOperationalLayers(a,D)},ha=this._vtlExtent||a.extent,ia=a.spatialReference;this._vtlExtent=null;a.spatialReference._isWrappable()&&(ha=ha._normalize(!0),
ia=ha.spatialReference);ha={mapOptions:{showAttribution:a.showAttribution,extent:ha.toJson(),spatialReference:ia.toJson()}};D.preserveScale&&W.mixin(ha.mapOptions,{scale:D.outScale||a.getScale()});a.timeExtent&&W.mixin(ha.mapOptions,{time:[a.timeExtent.startTime.getTime(),a.timeExtent.endTime.getTime()]});a={};W.mixin(a,ha,da);return a},_createOperationalLayers:function(a,D){var da,ha=[],ia=0;D.preserveScale&&(ia=D.outScale||a.getScale());this.allLayerslegend=this.legendAll?[]:null;this._vtlExtent=
null;var na=t.map(a.layerIds,a.getLayer,a);a._mapImageLyr&&na.push(a._mapImageLyr);for(da=0;da<na.length;da++){var P=na[da];if(P.loaded&&P.visible&&(!ia||P.isVisibleAtScale(ia))){var la=P.declaredClass;var ja={id:P.id,title:W.getObject("arcgisProps.title",!1,P)||P.id,opacity:P.opacity,minScale:P.minScale||0,maxScale:P.maxScale||0};ja=W.mixin(ja,this._getUrlAndToken(P));P.getNode()&&T.get(P.getNode(),"data-reference")&&(ja._isRefLayer=!0);switch(la){case "esri.layers.ArcGISDynamicMapServiceLayer":var J=
[];la=!!P._params.layers;if(P._params.dynamicLayers)la=D.outScale?P._getDynLayerObjs(D.outScale):Q.fromJson(P._params.dynamicLayers),t.forEach(la,function(oa){J.push({id:oa.id,name:oa.name,layerDefinition:oa});delete oa.id;delete oa.name;delete oa.maxScale;delete oa.minScale}),0===J.length&&(ja.visibleLayers=[-1]);else if(P.supportsDynamicLayers){if(la||P.layerDefinitions||P.layerTimeOptions){var z=P.createDynamicLayerInfosFromLayerInfos(),B=null;la&&(B=P.visibleLayers);B=e._getVisibleLayers(z,B);
var ca=e._getLayersForScale(D.outScale||a.getScale(),z);t.forEach(z,function(oa){if(!oa.subLayerIds){var ta=oa.id;-1<t.indexOf(B,ta)&&-1<t.indexOf(ca,ta)&&(oa={source:oa.source.toJson()},P.layerDefinitions&&P.layerDefinitions[ta]&&(oa.definitionExpression=P.layerDefinitions[ta]),P.layerTimeOptions&&P.layerTimeOptions[ta]&&(oa.layerTimeOptions=P.layerTimeOptions[ta].toJson()),J.push({id:ta,layerDefinition:oa}))}});0===J.length&&(ja.visibleLayers=[-1])}}else t.forEach(P.layerInfos,function(oa){var ta=
{id:oa.id,layerDefinition:{}};P.layerDefinitions&&P.layerDefinitions[oa.id]&&(ta.layerDefinition.definitionExpression=P.layerDefinitions[oa.id]);P.layerTimeOptions&&P.layerTimeOptions[oa.id]&&(ta.layerDefinition.layerTimeOptions=P.layerTimeOptions[oa.id].toJson());(ta.layerDefinition.definitionExpression||ta.layerDefinition.layerTimeOptions)&&J.push(ta)}),la&&(ja.visibleLayers=P.visibleLayers.length?P.visibleLayers:[-1]);J.length&&(ja.layers=J);ha.push(ja);this.allLayerslegend&&this.allLayerslegend.push({id:P.id,
subLayerIds:P.visibleLayers});break;case "esri.layers.ArcGISImageServiceLayer":ja=W.mixin(ja,{url:P.url,bandIds:P.bandIds,compressionQuality:P.compressionQuality,format:P.format,interpolation:P.interpolation});P.mosaicRule&&W.mixin(ja,{mosaicRule:P.mosaicRule.toJson()});if(P.renderingRule||P.renderer)this._is11xService?(P.renderingRule&&(ja.renderingRule=P.renderingRule.toJson()),P.renderer&&(ja.layerDefinition=ja.layerDefinition||{},ja.layerDefinition.drawingInfo=ja.layerDefinition.drawingInfo||
{},ja.layerDefinition.drawingInfo.renderer=P.renderer.toJson())):(la=P.getExportImageRenderingRule())&&W.mixin(ja,{renderingRule:la.toJson()});ha.push(ja);this.allLayerslegend&&this.allLayerslegend.push({id:P.id});break;case "esri.layers.RasterXLayer":this._is11xService&&(ja=W.mixin(ja,{url:P.url,bandIds:P.bandIds,interpolation:P.interpolation}),P.renderer&&(ja.layerDefinition=ja.layerDefinition||{},ja.layerDefinition.drawingInfo=ja.layerDefinition.drawingInfo||{},ja.layerDefinition.drawingInfo.renderer=
P.renderer.toJson()),ha.push(ja),this.allLayerslegend&&this.allLayerslegend.push({id:P.id}));break;case "esri.layers.WMSLayer":ja=W.mixin(ja,{url:P.url,title:P.title,type:"wms",version:P.version,transparentBackground:P.imageTransparency,visibleLayers:P.visibleLayers});ha.push(ja);this.allLayerslegend&&this.allLayerslegend.push({id:P.id,subLayerIds:P.visibleLayers});break;case "esri.virtualearth.VETiledLayer":la=P.mapStyle;"roadOnDemand"===la?la="Road":"aerialWithLabelsOnDemand"===la&&(la="Hybrid");
ja=W.mixin(ja,{visibility:P.visible,type:"BingMaps"+la,culture:P.culture,key:P.bingMapsKey});ha.push(ja);break;case "esri.layers.OpenStreetMapLayer":ja=W.mixin(ja,{credits:P.copyright,type:"OpenStreetMap",url:n.getAbsoluteUrl(P.tileServers[0])});ha.push(ja);break;case "esri.layers.WMTSLayer":ja=W.mixin(ja,{url:P.url,type:"wmts",layer:P._identifier,style:P._style,format:P.format,tileMatrixSet:P._tileMatrixSetId});ha.push(ja);break;case "esri.layers.MapImageLayer":la=P.getImages();t.forEach(la,function(oa,
ta){oa.visible&&oa.href&&(ja={id:P.id+"_image"+ta,type:"image",title:P.id,minScale:P.minScale||0,maxScale:P.maxScale||0,opacity:P.opacity*oa.opacity,extent:oa.extent.toJson()},"data:image/png;base64,"===oa.href.substr(0,22)?ja.imageData=oa.href.substr(22):ja.url=oa.href,ha.push(ja))});break;case "esri.layers.VectorTileLayer":delete ja.url;delete ja.token;if(this._is11xService&&P.currentStyleInfo.serviceUrl&&P.currentStyleInfo.styleUrl&&(la=H.id&&H.id.findCredential(P.currentStyleInfo.styleUrl),z=
H.id&&H.id.findCredential(P.currentStyleInfo.serviceUrl),!la&&!z||"2.1.0"!==this._cimVersion)){ja.type="VectorTileLayer";ja.styleUrl=P.currentStyleInfo.styleUrl;la&&(ja.token=la.token);z&&z.token!==ja.token&&(ja.additionalTokens=[{url:P.currentStyleInfo.serviceUrl,token:z.token}]);ha.push(ja);break}ja.type="image";la=this._vtlExtent||a.extent.offset(0,0);var ra=D.exportOptions&&D.exportOptions.dpi||96;z={format:"png",pixelRatio:ra/96};"MAP_ONLY"!==D.layout||!D.preserveScale||D.outScale&&D.outScale!==
a.getScale()||96!==ra||!D.exportOptions||D.exportOptions.width%2===a.width%2&&D.exportOptions.height%2===a.height%2||(z.area={x:0,y:0,width:a.width,height:a.height},D.exportOptions.width%2!==a.width%2&&--z.area.width,D.exportOptions.height%2!==a.height%2&&--z.area.height,this._vtlExtent||(ra=a.toMap({x:z.area.width,y:z.area.height}),la.update(la.xmin,ra.y,ra.x,la.ymax,la.spatialReference),this._vtlExtent=la));ja.extent=la._normalize(!0).toJson();la=P.takeScreenshot(z);la.isResolved()?la.then(function(oa){"data:image/png;base64,"===
oa.dataURL.substr(0,22)&&(ja.imageData=oa.dataURL.substr(22))}):console.error("PrintTask: VectorTileLayer.takeScreenshot() returned an unresolved Promise");ja.imageData&&ha.push(ja);break;case "esri.layers.WebTiledLayer":la=P.url.replace(/\$\{/g,"{");ja=W.mixin(ja,{type:"WebTiledLayer",urlTemplate:la,credits:P.copyright});P.subDomains&&0<P.subDomains.length&&(ja.subDomains=P.subDomains);P._wmtsInfo&&(ja.wmtsInfo=P._wmtsInfo);delete ja.url;ha.push(ja);break;default:if(P.getTileUrl||P.getImageUrl)ja=
W.mixin(ja,{url:P.url}),ha.push(ja)}}}na=t.map(a.graphicsLayerIds,a.getLayer,a);for(da=0;da<na.length;da++)P=na[da],P.isFeatureReductionActive&&P.isFeatureReductionActive()&&(P.getSingleGraphics().length?na.splice(++da,0,P.getFeatureReductionLayer()):na[da]=P.getFeatureReductionLayer());for(da=0;da<na.length;da++)if(P=na[da],P.loaded&&P.visible&&(!ia||P.isVisibleAtScale(ia)))switch(la=P.declaredClass,la){case "esri.layers.CSVLayer":if(this._is11xService){ja={id:P.id,url:P.url,title:P.title,opacity:P.opacity,
minScale:P.minScale||0,maxScale:P.maxScale||0,type:"CSV",locationInfo:{latitudeFieldName:P.latitudeFieldName,longitudeFieldName:P.longitudeFieldName},layerDefinition:{drawingInfo:{renderer:P.renderer&&P.renderer.toJson({useLegacyRotationProperties:!0})}}};ha.push(ja);break}case "esri.layers.FeatureLayer":case "esri.layers.LabelLayer":case "esri.layers.StreamLayer":if("esri.layers.LabelLayer"===la&&!D.showLabels||P.renderer&&"esri.renderer.HeatmapRenderer"===P.renderer.declaredClass)continue;la=null;
P.url&&P.renderer&&("esri.renderer.ScaleDependentRenderer"===P.renderer.declaredClass?"scale"===P.renderer.rangeType?la=P.renderer.getRendererInfoByScale(a.getScale())&&P.renderer.getRendererInfoByScale(a.getScale()).renderer:"zoom"===P.renderer.rangeType&&(la=P.renderer.getRendererInfoByZoom(a.getZoom())&&P.renderer.getRendererInfoByZoom(a.getZoom()).renderer):la=P.renderer);z=la&&"esri.layers.CSVLayer"!==P.declaredClass&&!this._isFeatureCollectionRequired(la,P)&&!la.valueExpression;ra=P.isFeatureReductionActive&&
P.isFeatureReductionActive();if(la&&!ra&&"esri.renderer.DotDensityRenderer"!==la.declaredClass&&"esri.layers.StreamLayer"!==P.declaredClass&&(this._is11xService||z)&&("esri.renderer.SimpleRenderer"===la.declaredClass||"esri.renderer.TemporalRenderer"===la.declaredClass||null==la.attributeField||W.isString(la.attributeField)&&P._getField(la.attributeField,!0)))if(ja={id:P.id,title:W.getObject("arcgisProps.title",!1,P)||P.id,opacity:P.opacity,minScale:P.minScale||0,maxScale:P.maxScale||0,layerDefinition:{drawingInfo:{renderer:la.toJson({useLegacyRotationProperties:!0})}}},
ja=W.mixin(ja,this._getUrlAndToken(P)),"esri.renderer.TemporalRenderer"===la.declaredClass&&(z=ja.layerDefinition.drawingInfo,z.latestObservationRenderer=z.renderer.latestObservationRenderer,z.trackLinesRenderer=z.renderer.trackRenderer,z.observationAger=z.renderer.observationAger,z.renderer=z.renderer.observationRenderer,P._trackIdField&&(ja.layerDefinition.timeInfo={trackIdField:P._trackIdField})),this._convertSvgRenderer(ja.layerDefinition.drawingInfo.renderer),this._is11xService||1>P.opacity||
"esri.renderer.TemporalRenderer"===la.declaredClass||this._updateLayerOpacity(ja))if(P._params.source&&(la=P._params.source.toJson(),W.mixin(ja.layerDefinition,{source:la})),P.getDefinitionExpression()&&W.mixin(ja.layerDefinition,{definitionExpression:P.getDefinitionExpression()}),2!==P.mode)0<P.getSelectedFeatures().length&&(la=t.map(P.getSelectedFeatures(),function(oa){return oa.attributes[P.objectIdField]}),0<la.length&&P.getSelectionSymbol()&&W.mixin(ja,{selectionObjectIds:la,selectionSymbol:P.getSelectionSymbol().toJson()}));
else{la=t.map(P.getSelectedFeatures(),function(oa){return oa.attributes[P.objectIdField]});if(0===la.length||!P._params.drawMode)break;W.mixin(ja.layerDefinition,{objectIds:la});la=null;P.getSelectionSymbol()&&(la=new x(P.getSelectionSymbol()));W.mixin(ja.layerDefinition.drawingInfo,{renderer:la&&la.toJson()})}else ja=this._createFeatureCollection(P,a,null,D);else ja=la&&(la.valueExpression||this._isFeatureCollectionRequired(la,P)||"esri.renderer.DotDensityRenderer"===la.declaredClass)?this._createFeatureCollection(P,
a,la,D):this._createFeatureCollection(P,a,null,D);if(!ja)continue;ha.push(ja);this.allLayerslegend&&this.allLayerslegend.push({id:P.id});break;case "esri.layers._GraphicsLayer":case "esri.layers.GraphicsLayer":case "esri.layers.WFSLayer":ja=this._createFeatureCollection(P,a,null,D);if(!ja)continue;ha.push(ja);this.allLayerslegend&&this.allLayerslegend.push({id:P.id});break;case "esri.layers.ArcGISImageServiceVectorLayer":ja={id:P.id,title:W.getObject("arcgisProps.title",!1,P)||P.id,opacity:P.opacity,
minScale:P.minScale||0,maxScale:P.maxScale||0,visibility:P.visible,symbolTileSize:P.symbolTileSize,layerDefinition:{drawingInfo:{renderer:P.renderer.toJson({useLegacyRotationProperties:!0})}}},ja=W.mixin(ja,this._getUrlAndToken(P)),P.mosaicRule&&W.mixin(ja,{mosaicRule:P.mosaicRule.toJson()}),ha.push(ja),this.allLayerslegend&&this.allLayerslegend.push({id:P.id})}ia&&t.forEach(ha,function(oa){oa.minScale=0;oa.maxScale=0});a.graphics&&0<a.graphics.graphics.length&&(ja=this._createFeatureCollection(a.graphics,
a,null,D))&&ha.push(ja);a._labels&&D.showLabels&&(ja=this._createFeatureCollection(a._labels,a,null,D))&&ha.push(ja);t.forEach(ha,function(oa,ta,za){oa._isRefLayer&&(delete oa._isRefLayer,za.splice(ta,1),za.push(oa))});return ha},_getUrlAndToken:function(a){return{token:a._getToken(),url:a._url?a._url.path:null}},_updateLayerOpacity:function(a){var D=this._colorEvaluator(a);D=t.filter(D,function(na){return W.isArray(na)&&4===na.length});var da=!0;if(D.length){var ha=D[0][3],ia;for(ia=1;ia<D.length;ia++)if(ha!==
D[ia][3]){da=!1;break}if(da)for(a.opacity=ha/255,ia=0;ia<D.length;ia++)D[ia][3]=255}return da},_isFeatureCollectionRequired:function(a,D){if(D&&D.isFeatureReductionActive&&D.isFeatureReductionActive())return!0;var da=!1;if(D=this._getVariable(a,"rotationInfo",!1))da=(da=D.field)&&W.isFunction(da)||D.valueExpression;return a.hasVisualVariables("sizeInfo")||a.hasVisualVariables("colorInfo")||a.hasVisualVariables("opacityInfo")||da},_getVariable:function(a,D,da){if(a)var ha=(a=a.getVisualVariablesForType(D,
da))&&a[0];return ha},_applyVisualVariables:function(a,D){var da=D.renderer,ha=D.graphic,ia=D.symbol,na=D.mapResolution,P=D.mapScale,la=ia.type;if("textsymbol"!==la&&"shieldlabelsymbol"!==la){var ja=this._getVariable(da,"sizeInfo",!1),J=this._getVariable(da,"colorInfo",!1),z=this._getVariable(da,"opacityInfo",!1);D=this._getVariable(da,"rotationInfo",!1);ia instanceof I&&(ja=this._getVariable(da,"sizeInfo","outline")||ja);na=ja?da.getSize(ha,{sizeInfo:ja,shape:"simplemarkersymbol"===la?ia.style:null,
resolution:na,scale:P}):ha.size;null!=na&&("simplemarkersymbol"===la?a.size=N.px2pt(na):"picturemarkersymbol"===la?(P=ia.width/ia.height*na,a.width=N.px2pt(P),a.height=N.px2pt(na),0!==ia.xoffset&&(a.xoffset=N.px2pt(ia.xoffset/ia.width*P)),0!==ia.yoffset&&(a.yoffset=N.px2pt(ia.yoffset/ia.height*na))):"simplelinesymbol"===la?a.width=N.px2pt(na):a.outline&&(a.outline.width=N.px2pt(na)));J&&(!(ia=da.getColor(ha,{colorInfo:J}))||"simplemarkersymbol"!==la&&"simplelinesymbol"!==la&&"simplefillsymbol"!==
la||(a.color=l.toJsonColor(ia)));z&&(ia=da.getOpacity(ha,{opacityInfo:z}),null!=ia&&a.color&&(a.color[3]=Math.round(255*ia)));D&&(da=da.getRotationAngle(ha,{rotationInfo:D}))&&(a.angle=-da)}}});R("extend-esri")&&W.setObject("tasks.PrintTask",V,H);return V})},"esri/tasks/Geoprocessor":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/_base/Deferred dojo/_base/json dojo/has dojo/io-query ../kernel ../request ../deferredUtils ../geometry/normalizeUtils ./Task ./FeatureSet ./JobInfo ./GPMessage ./LinearUnit ./DataFile ./RasterData ./Date ./ParameterValue ./GPResultImageLayer ../layers/ArcGISDynamicMapServiceLayer ../layers/MapImage".split(" "),
function(V,W,t,Q,X,R,H,y,e,g,l,m,n,h,x,I,K,w,L,T,U,N,S){V=V(m,{declaredClass:"esri.tasks.Geoprocessor",_eventMap:{"execute-complete":["results","messages"],"get-result-data-complete":["result"],"get-result-image-complete":["mapImage"],"get-result-image-layer-complete":["layer"],"job-cancel":["jobInfo"],"job-complete":["jobInfo"],"status-update":["jobInfo"]},constructor:function(F){this._jobUpdateHandler=W.hitch(this,this._jobUpdateHandler);this._getJobStatus=W.hitch(this,this._getJobStatus);this._getResultDataHandler=
W.hitch(this,this._getResultDataHandler);this._getResultImageHandler=W.hitch(this,this._getResultImageHandler);this._executeHandler=W.hitch(this,this._executeHandler);this._updateTimers=[];this.registerConnectEvents()},updateDelay:1E3,processSpatialReference:null,outputSpatialReference:null,outSpatialReference:null,setUpdateDelay:function(F){this.updateDelay=F},setProcessSpatialReference:function(F){this.processSpatialReference=F},setOutputSpatialReference:function(F){this._setOutSR(F)},setOutSpatialReference:function(F){this._setOutSR(F)},
__msigns:[{n:"execute",c:3,a:[{i:0,p:["*"]}],e:2,f:1},{n:"submitJob",c:4,a:[{i:0,p:["*"]}],e:3}],_setOutSR:function(F){this.outSpatialReference=this.outputSpatialReference=F},_getOutSR:function(){return this.outSpatialReference||this.outputSpatialReference},_gpEncode:function(F,a,D){for(var da in F){var ha=F[da];W.isArray(ha)?F[da]=X.toJson(t.map(ha,function(ia){return this._gpEncode({item:ia},!0).item},this)):ha instanceof Date&&(F[da]=ha.getTime())}return this._encode(F,a,D)},_decode:function(F){var a=
F.dataType,D=new T(F);if(-1!==t.indexOf(["GPBoolean","GPDouble","GPLong","GPString"],a))return D;if("GPLinearUnit"===a)D.value=new I(D.value);else if("GPFeatureRecordSetLayer"===a||"GPRecordSet"===a)D.value=new n(D.value);else if("GPDataFile"===a)D.value=new K(D.value);else if("GPDate"===a)F=D.value,W.isString(F)?D.value=new L({date:F}):D.value=new Date(F);else if("GPRasterData"===a||"GPRasterDataLayer"===a)F=F.value.mapImage,D.value=F?new S(F):new w(D.value);else if(-1!==a.indexOf("GPMultiValue:")){var da=
a.split(":")[1];F=D.value;D.value=t.map(F,function(ha){return this._decode({paramName:"_name",dataType:da,value:ha}).value},this)}else console.log(this.declaredClass+" : GP Data type not handled. : "+D.dataType),D=null;return D},submitJob:function(F,a,D,da,ha){var ia=this._getOutSR(),na=ha.assembly;F=this._gpEncode(W.mixin({},this._url.query,{f:"json","env:outSR":ia?ia.wkid||X.toJson(ia.toJson()):null,"env:processSR":this.processSpatialReference?this.processSpatialReference.wkid||X.toJson(this.processSpatialReference.toJson()):
null},F),null,na&&na[0]);var P=this._jobUpdateHandler,la=this._errorHandler;return e({url:this._url.path+"/submitJob",content:F,callbackParamName:"callback",load:function(ja,J){P(ja,J,!1,a,D,ha.dfd)},error:function(ja){la(ja,da,ha.dfd)}})},_jobUpdateHandler:function(F,a,D,da,ha,ia){var na=F.jobId;a=new h(F);this._successHandler([a],"onStatusUpdate",ha,D&&ia);if(!D)switch(clearTimeout(this._updateTimers[na]),this._updateTimers[na]=null,ia&&ia.progress(a),F.jobStatus){case h.STATUS_SUBMITTED:case h.STATUS_EXECUTING:case h.STATUS_WAITING:case h.STATUS_NEW:var P=
this._getJobStatus;this._updateTimers[na]=setTimeout(function(){P(na,D,da,ha,ia)},this.updateDelay);break;default:this._successHandler([a],"onJobComplete",da,ia)}},_getJobStatus:function(F,a,D,da,ha){var ia=this._jobUpdateHandler;e({url:this._url.path+"/jobs/"+F,content:W.mixin({},this._url.query,{f:"json"}),callbackParamName:"callback",load:function(na,P){ia(na,P,a,D,da,ha)},error:this._errorHandler})},_getResultDataHandler:function(F,a,D,da,ha){try{var ia=this._decode(F);this._successHandler([ia],
"onGetResultDataComplete",D,ha)}catch(na){this._errorHandler(na,da,ha)}},getResultData:function(F,a,D,da){var ha=this._getResultDataHandler,ia=this._errorHandler,na=new Q(g._dfdCanceller);na._pendingDfd=e({url:this._url.path+"/jobs/"+F+"/results/"+a,content:W.mixin({},this._url.query,{f:"json",returnType:"data"}),callbackParamName:"callback",load:function(P,la){ha(P,la,D,da,na)},error:function(P){ia(P,da,na)}});return na},checkJobStatus:function(F,a,D){var da=this._jobUpdateHandler,ha=this._errorHandler,
ia=new Q(g._dfdCanceller);ia._pendingDfd=e({url:this._url.path+"/jobs/"+F,content:W.mixin({},this._url.query,{f:"json"}),callbackParamName:"callback",load:function(na,P){da(na,P,!0,null,a,ia)},error:function(na){ha(na,D,ia)}});return ia},cancelJob:function(F,a,D){var da=this._errorHandler,ha=new Q(g._dfdCanceller);ha._pendingDfd=e({url:this._url.path+"/jobs/"+F+"/cancel",content:W.mixin({},this._url.query,{f:"json"}),callbackParamName:"callback",load:W.hitch(this,function(ia,na){this._successHandler([ia],
"onJobCancel",a,ha)}),error:function(ia){da(ia,D,ha)}});return ha},execute:function(F,a,D,da){var ha=this._getOutSR(),ia=da.assembly;F=this._gpEncode(W.mixin({},this._url.query,{f:"json","env:outSR":ha?ha.wkid||X.toJson(ha.toJson()):null,"env:processSR":this.processSpatialReference?this.processSpatialReference.wkid||X.toJson(this.processSpatialReference.toJson()):null},F),null,ia&&ia[0]);var na=this._executeHandler,P=this._errorHandler;return e({url:this._url.path+"/execute",content:F,callbackParamName:"callback",
load:function(la,ja){na(la,ja,a,D,da.dfd)},error:function(la){P(la,D,da.dfd)}})},_executeHandler:function(F,a,D,da,ha){try{var ia=F.results,na,P=F.messages;var la=0;for(na=ia.length;la<na;la++)ia[la]=this._decode(ia[la]);la=0;for(na=P.length;la<na;la++)P[la]=new x(P[la]);this._successHandler([ia,P],"onExecuteComplete",D,ha)}catch(ja){this._errorHandler(ja,da,ha)}},_getResultImageHandler:function(F,a,D,da,ha){try{var ia=this._decode(F);this._successHandler([ia],"onGetResultImageComplete",D,ha)}catch(na){this._errorHandler(na,
da,ha)}},getResultImage:function(F,a,D,da,ha){var ia=this._getResultImageHandler,na=this._errorHandler;D=this._gpEncode(W.mixin({},this._url.query,{f:"json"},D.toJson()));var P=new Q(g._dfdCanceller);P._pendingDfd=e({url:this._url.path+"/jobs/"+F+"/results/"+a,content:D,callbackParamName:"callback",load:function(la,ja){ia(la,ja,da,ha,P)},error:function(la){na(la,ha,P)}});return P},cancelJobStatusUpdates:function(F){clearTimeout(this._updateTimers[F]);this._updateTimers[F]=null},getResultImageLayer:function(F,
a,D,da){if(null==a){var ha=this._url.path.indexOf("/GPServer/");F=this._url.path.substring(0,ha)+"/MapServer/jobs/"+F}else F=this._url.path+"/jobs/"+F+"/results/"+a;this._url.query&&(F+="?"+H.objectToQuery(this._url.query));a=null==a?new N(F,{imageParameters:D}):new U(F,{imageParameters:D},!0);this.onGetResultImageLayerComplete(a);da&&da(a);return a},onStatusUpdate:function(){},onJobComplete:function(){},onExecuteComplete:function(){},onGetResultDataComplete:function(){},onGetResultImageComplete:function(){},
onGetResultImageLayerComplete:function(){},onJobCancel:function(){}});l._createWrappers(V);R("extend-esri")&&W.setObject("tasks.Geoprocessor",V,y);return V})},"esri/tasks/JobInfo":function(){define(["dojo/_base/declare","dojo/_base/lang","dojo/has","../kernel","./GPMessage"],function(V,W,t,Q,X){V=V(null,{declaredClass:"esri.tasks.JobInfo",constructor:function(R){this.messages=[];W.mixin(this,R);R=this.messages;var H,y=R.length;for(H=0;H<y;H++)R[H]=new X(R[H])},jobId:"",jobStatus:""});W.mixin(V,{STATUS_CANCELLED:"esriJobCancelled",
STATUS_CANCELLING:"esriJobCancelling",STATUS_DELETED:"esriJobDeleted",STATUS_DELETING:"esriJobDeleting",STATUS_EXECUTING:"esriJobExecuting",STATUS_FAILED:"esriJobFailed",STATUS_NEW:"esriJobNew",STATUS_SUBMITTED:"esriJobSubmitted",STATUS_SUCCEEDED:"esriJobSucceeded",STATUS_TIMED_OUT:"esriJobTimedOut",STATUS_WAITING:"esriJobWaiting"});t("extend-esri")&&W.setObject("tasks.JobInfo",V,Q);return V})},"esri/tasks/GPMessage":function(){define(["dojo/_base/declare","dojo/_base/lang","dojo/has","../kernel"],
function(V,W,t,Q){V=V(null,{declaredClass:"esri.tasks.GPMessage",constructor:function(X){W.mixin(this,X)}});W.mixin(V,{TYPE_INFORMATIVE:"esriJobMessageTypeInformative",TYPE_PROCESS_DEFINITION:"esriJobMessageTypeProcessDefinition",TYPE_PROCESS_START:"esriJobMessageTypeProcessStart",TYPE_PROCESS_STOP:"esriJobMessageTypeProcessStop",TYPE_WARNING:"esriJobMessageTypeWarning",TYPE_ERROR:"esriJobMessageTypeError",TYPE_EMPTY:"esriJobMessageTypeEmpty",TYPE_ABORT:"esriJobMessageTypeAbort"});t("extend-esri")&&
W.setObject("tasks.GPMessage",V,Q);return V})},"esri/tasks/LinearUnit":function(){define(["dojo/_base/declare","dojo/_base/lang","dojo/has","../kernel"],function(V,W,t,Q){V=V(null,{declaredClass:"esri.tasks.LinearUnit",constructor:function(X){X&&W.mixin(this,X)},distance:0,units:null,toJson:function(){var X={};this.distance&&(X.distance=this.distance);this.units&&(X.units=this.units);return X}});t("extend-esri")&&W.setObject("tasks.LinearUnit",V,Q);return V})},"esri/tasks/DataFile":function(){define(["dojo/_base/declare",
"dojo/_base/lang","dojo/has","../kernel"],function(V,W,t,Q){V=V(null,{declaredClass:"esri.tasks.DataFile",constructor:function(X){X&&W.mixin(this,X)},url:null,itemID:null,toJson:function(){var X={};this.url&&(X.url=this.url);this.itemID&&(X.itemID=this.itemID);return X}});t("extend-esri")&&W.setObject("tasks.DataFile",V,Q);return V})},"esri/tasks/RasterData":function(){define(["dojo/_base/declare","dojo/_base/lang","dojo/has","../kernel"],function(V,W,t,Q){V=V(null,{declaredClass:"esri.tasks.RasterData",
constructor:function(X){X&&W.mixin(this,X)},url:null,format:null,itemID:null,toJson:function(){var X={};this.url&&(X.url=this.url);this.format&&(X.format=this.format);this.itemID&&(X.itemID=this.itemID);return X}});t("extend-esri")&&W.setObject("tasks.RasterData",V,Q);return V})},"esri/tasks/Date":function(){define(["dojo/_base/declare","dojo/_base/lang","dojo/date/locale","dojo/has","../kernel"],function(V,W,t,Q,X){V=V(null,{declaredClass:"esri.tasks.Date",constructor:function(R){R&&(R.format&&(this.format=
R.format),this.date=t.parse(R.date,{selector:"date",datePattern:this.format}))},date:new Date,format:"EEE MMM dd HH:mm:ss zzz yyyy",toJson:function(){return{date:t.format(this.date,{selector:"date",datePattern:this.format}),format:this.format}}});Q("extend-esri")&&W.setObject("tasks.Date",V,X);return V})},"esri/tasks/ParameterValue":function(){define(["dojo/_base/declare","dojo/_base/lang","dojo/has","../kernel"],function(V,W,t,Q){V=V(null,{declaredClass:"esri.tasks.ParameterValue",constructor:function(X){W.mixin(this,
X)}});t("extend-esri")&&W.setObject("tasks.ParameterValue",V,Q);return V})},"esri/tasks/GPResultImageLayer":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/json dojo/has dojo/io-query ../kernel ../layers/ArcGISDynamicMapServiceLayer".split(" "),function(V,W,t,Q,X,R,H){V=V(H,{declaredClass:"esri.tasks._GPResultImageLayer",constructor:function(y,e){e&&e.imageParameters&&e.imageParameters.extent&&(this.initialExtent=this.fullExtent=e.imageParameters.extent,this.spatialReference=this.initialExtent.spatialReference);
this.getImageUrl=W.hitch(this,this.getImageUrl);this.loaded=!0;this.onLoad(this)},getImageUrl:function(y,e,g,l){var m=y.spatialReference.wkid;l(this._url.path+"?"+X.objectToQuery(W.mixin(this._params,{f:"image",bbox:t.toJson(y.toJson()),bboxSR:m,imageSR:m,size:e+","+g})))}});Q("extend-esri")&&W.setObject("tasks._GPResultImageLayer",V,R);return V})},"esri/tasks/PrintTemplate":function(){define(["dojo/_base/declare","dojo/_base/lang","dojo/has","../kernel"],function(V,W,t,Q){V=V(null,{declaredClass:"esri.tasks.PrintTemplate",
label:null,exportOptions:{width:800,height:1100,dpi:96},layoutOptions:null,format:"PNG32",layout:"MAP_ONLY",outScale:0,preserveScale:!0,forceFeatureAttributes:!1,showAttribution:null,showLabels:!0});t("extend-esri")&&W.setObject("tasks.PrintTemplate",V,Q);return V})},"dojox/gfx/canvas":function(){define("./_base dojo/_base/lang dojo/_base/array dojo/_base/declare dojo/_base/window dojo/dom-geometry dojo/dom ./shape ./path ./arc ./matrix ./decompose ./bezierutils".split(" "),function(V,W,t,Q,X,R,H,
y,e,g,l,m,n){function h(J,z,B,ca,ra,oa,ta,za,b,f){var G=z.length,r=0;if(f){var d=f.l/ra;r=f.i}else d=z[0]/ra;for(;oa<ta;){if(oa+d>ta){var v={l:(oa+d-ta)*ra,i:r};d=ta-oa}r%2||(J.beginPath(),J.arc(B,ca,ra,oa,oa+d,za),b&&J.stroke());oa+=d;++r;d=z[r%G]/ra}return v}function x(J,z,B,ca){var ra=0,oa=0,ta=0;if(ca){var za=ca.l;ta=ca.i}else za=z[0];for(;1>oa;)oa=n.tAtLength(J,za),1==oa&&(ra=n.computeLength(J),ra={l:za-ra,i:ta}),J=n.splitBezierAtT(J,oa),ta%2||B.push(J[0]),J=J[1],++ta,za=z[ta%z.length];return ra}
function I(J,z,B,ca){var ra=[z.last.x,z.last.y].concat(B),oa=!(J instanceof Array);B=4===B.length?"quadraticCurveTo":"bezierCurveTo";var ta=[];z=x(ra,z.canvasDash,ta,ca);for(ca=0;ca<ta.length;++ca)ra=ta[ca],oa?(J.moveTo(ra[0],ra[1]),J[B].apply(J,ra.slice(2))):(J.push("moveTo",[ra[0],ra[1]]),J.push(B,ra.slice(2)));return z}function K(J,z,B,ca,ra,oa,ta){var za=0,b=0,f=0,G=n.distance(B,ca,ra,oa),r=0;z=z.canvasDash;var d=B,v=ca,O=!(J instanceof Array);ta?(f=ta.l,r=ta.i):f+=z[0];for(;.01<Math.abs(1-b);){f>
G&&(za={l:f-G,i:r},f=G);b=f/G;ta=B+(ra-B)*b;var E=ca+(oa-ca)*b;r++%2||(O?(J.moveTo(d,v),J.lineTo(ta,E)):(J.push("moveTo",[d,v]),J.push("lineTo",[ta,E])));d=ta;v=E;f+=z[r%z.length]}return za}var w=V.canvas={},L=null,T=l.multiplyPoint,U=Math.PI,N=2*U,S=U/2;m=W.extend;if(X.global.CanvasRenderingContext2D){X=X.doc.createElement("canvas").getContext("2d");var F="function"==typeof X.setLineDash,a="function"==typeof X.fillText}var D={solid:"none",shortdash:[4,1],shortdot:[1,1],shortdashdot:[4,1,1,1],shortdashdotdot:[4,
1,1,1,1,1],dot:[1,3],dash:[4,3],longdash:[8,3],dashdot:[4,3,1,3],longdashdot:[8,3,1,3],longdashdotdot:[8,3,1,3,1,3]};w.Shape=Q("dojox.gfx.canvas.Shape",y.Shape,{_render:function(J){J.save();this._renderTransform(J);this._renderClip(J);this._renderShape(J);this._renderFill(J,!0);this._renderStroke(J,!0);J.restore()},_renderClip:function(J){this.canvasClip&&(this.canvasClip.render(J),J.clip())},_renderTransform:function(J){if("canvasTransform"in this){var z=this.canvasTransform;J.translate(z.dx,z.dy);
J.rotate(z.angle2);J.scale(z.sx,z.sy);J.rotate(z.angle1)}},_renderShape:function(J){},_renderFill:function(J,z){if("canvasFill"in this){var B=this.fillStyle;if("canvasFillImage"in this){var ca=B.width,ra=B.height,oa=this.canvasFillImage.width,ta=this.canvasFillImage.height,za=Math.min(ca==oa?1:ca/oa,ra==ta?1:ra/ta),b=(ca-za*oa)/2,f=(ra-za*ta)/2;L.width=ca;L.height=ra;var G=L.getContext("2d");G.clearRect(0,0,ca,ra);G.drawImage(this.canvasFillImage,0,0,oa,ta,b,f,za*oa,za*ta);this.canvasFill=J.createPattern(L,
"repeat");delete this.canvasFillImage}J.fillStyle=this.canvasFill;z&&("pattern"!==B.type||0===B.x&&0===B.y||J.translate(B.x,B.y),J.fill())}else J.fillStyle="rgba(0,0,0,0.0)"},_renderStroke:function(J,z){var B=this.strokeStyle;B?(J.strokeStyle=B.color.toString(),J.lineWidth=B.width,J.lineCap=B.cap,"number"==typeof B.join?(J.lineJoin="miter",J.miterLimit=B.join):J.lineJoin=B.join,this.canvasDash?F?(J.setLineDash(this.canvasDash),z&&J.stroke()):this._renderDashedStroke(J,z):z&&J.stroke()):z||(J.strokeStyle=
"rgba(0,0,0,0.0)")},_renderDashedStroke:function(J,z){},getEventSource:function(){return null},on:function(){},connect:function(){},disconnect:function(){},canvasClip:null,setClip:function(J){this.inherited(arguments);var z=J?"width"in J?"rect":"cx"in J?"ellipse":"points"in J?"polyline":"d"in J?"path":null:null;if(J&&!z)return this;this.canvasClip=J?da(z,J):null;this.parent&&this.parent._makeDirty();return this}});var da=function(J,z){switch(J){case "ellipse":return{canvasEllipse:P({shape:z}),render:function(B){return w.Ellipse.prototype._renderShape.call(this,
B)}};case "rect":return{shape:W.delegate(z,{r:0}),render:function(B){return w.Rect.prototype._renderShape.call(this,B)}};case "path":return{canvasPath:ha(z),render:function(B){this.canvasPath._renderShape(B)}};case "polyline":return{canvasPolyline:z.points,render:function(B){return w.Polyline.prototype._renderShape.call(this,B)}}}return null},ha=function(J){var z=new dojox.gfx.canvas.Path;z.canvasPath=[];z._setPath(J.d);return z},ia=function(J,z,B){var ca=J.prototype[z];J.prototype[z]=B?function(){this.parent&&
this.parent._makeDirty();ca.apply(this,arguments);B.call(this);return this}:function(){this.parent&&this.parent._makeDirty();return ca.apply(this,arguments)}};ia(w.Shape,"setTransform",function(){this.matrix?this.canvasTransform=V.decompose(this.matrix):delete this.canvasTransform});ia(w.Shape,"setFill",function(){var J=this.fillStyle;if(J){if("object"==typeof J&&"type"in J){var z=this.surface.rawNode.getContext("2d");switch(J.type){case "linear":case "radial":var B="linear"==J.type?z.createLinearGradient(J.x1,
J.y1,J.x2,J.y2):z.createRadialGradient(J.cx,J.cy,0,J.cx,J.cy,J.r);t.forEach(J.colors,function(ca){B.addColorStop(ca.offset,V.normalizeColor(ca.color).toString())});break;case "pattern":L||(L=document.createElement("canvas")),z=new Image,this.surface.downloadImage(z,J.src),this.canvasFillImage=z}}else B=J.toString();this.canvasFill=B}else delete this.canvasFill});ia(w.Shape,"setStroke",function(){var J=this.strokeStyle;if(J){var z=this.strokeStyle.style.toLowerCase();z in D&&(z=D[z]);if(z instanceof
Array){this.canvasDash=z=z.slice();var B;for(B=0;B<z.length;++B)z[B]*=J.width;if("butt"!=J.cap){for(B=0;B<z.length;B+=2)z[B]-=J.width,1>z[B]&&(z[B]=1);for(B=1;B<z.length;B+=2)z[B]+=J.width}}else delete this.canvasDash}else delete this.canvasDash;this._needsDash=!F&&!!this.canvasDash});ia(w.Shape,"setShape");w.Group=Q("dojox.gfx.canvas.Group",w.Shape,{constructor:function(){y.Container._init.call(this)},_render:function(J){J.save();this._renderTransform(J);this._renderClip(J);for(var z=0;z<this.children.length;++z)this.children[z]._render(J);
J.restore()},destroy:function(){y.Container.clear.call(this,!0);w.Shape.prototype.destroy.apply(this,arguments)}});w.Rect=Q("dojox.gfx.canvas.Rect",[w.Shape,y.Rect],{_renderShape:function(J){var z=this.shape,B=Math.min(z.r,z.height/2,z.width/2),ca=z.x,ra=ca+z.width,oa=z.y;z=oa+z.height;var ta=ca+B,za=ra-B,b=oa+B,f=z-B;J.beginPath();J.moveTo(ta,oa);B?(J.arc(za,b,B,-S,0,!1),J.arc(za,f,B,0,S,!1),J.arc(ta,f,B,S,U,!1),J.arc(ta,b,B,U,U+S,!1)):(J.lineTo(za,oa),J.lineTo(ra,f),J.lineTo(ta,z),J.lineTo(ca,b));
J.closePath()},_renderDashedStroke:function(J,z){var B=this.shape,ca=Math.min(B.r,B.height/2,B.width/2),ra=B.x,oa=ra+B.width,ta=B.y,za=ta+B.height,b=ra+ca,f=oa-ca,G=ta+ca,r=za-ca;ca?(J.beginPath(),B=K(J,this,b,ta,f,ta),z&&J.stroke(),B=h(J,this.canvasDash,f,G,ca,-S,0,!1,z,B),J.beginPath(),B=K(J,this,oa,G,oa,r,B),z&&J.stroke(),B=h(J,this.canvasDash,f,r,ca,0,S,!1,z,B),J.beginPath(),B=K(J,this,f,za,b,za,B),z&&J.stroke(),B=h(J,this.canvasDash,b,r,ca,S,U,!1,z,B),J.beginPath(),B=K(J,this,ra,r,ra,G,B),z&&
J.stroke(),h(J,this.canvasDash,b,G,ca,U,U+S,!1,z,B)):(J.beginPath(),B=K(J,this,b,ta,f,ta),B=K(J,this,f,ta,oa,r,B),B=K(J,this,oa,r,b,za,B),K(J,this,b,za,ra,G,B),z&&J.stroke())}});var na=[];(function(){var J=g.curvePI4;na.push(J.s,J.c1,J.c2,J.e);for(var z=45;360>z;z+=45){var B=l.rotateg(z);na.push(T(B,J.c1),T(B,J.c2),T(B,J.e))}})();var P=function(J){var z=[],B=J.shape,ca=l.normalize([l.translate(B.cx,B.cy),l.scale(B.rx,B.ry)]);var ra=T(ca,na[0]);z.push([ra.x,ra.y]);for(B=1;B<na.length;B+=3){var oa=
T(ca,na[B]);var ta=T(ca,na[B+1]);ra=T(ca,na[B+2]);z.push([oa.x,oa.y,ta.x,ta.y,ra.x,ra.y])}if(J._needsDash){ra=[];oa=z[0];for(B=1;B<z.length;++B)ta=[],x(oa.concat(z[B]),J.canvasDash,ta),oa=[z[B][4],z[B][5]],ra.push(ta);J._dashedPoints=ra}return z};w.Ellipse=Q("dojox.gfx.canvas.Ellipse",[w.Shape,y.Ellipse],{setShape:function(){this.inherited(arguments);this.canvasEllipse=P(this);return this},setStroke:function(){this.inherited(arguments);F||(this.canvasEllipse=P(this));return this},_renderShape:function(J){var z=
this.canvasEllipse,B;J.beginPath();J.moveTo.apply(J,z[0]);for(B=1;B<z.length;++B)J.bezierCurveTo.apply(J,z[B]);J.closePath()},_renderDashedStroke:function(J,z){var B=this._dashedPoints;J.beginPath();for(var ca=0;ca<B.length;++ca)for(var ra=B[ca],oa=0;oa<ra.length;++oa){var ta=ra[oa];J.moveTo(ta[0],ta[1]);J.bezierCurveTo(ta[2],ta[3],ta[4],ta[5],ta[6],ta[7])}z&&J.stroke()}});w.Circle=Q("dojox.gfx.canvas.Circle",[w.Shape,y.Circle],{_renderShape:function(J){var z=this.shape;J.beginPath();J.arc(z.cx,z.cy,
z.r,0,N,1)},_renderDashedStroke:function(J,z){var B=this.shape,ca=0,ra=this.canvasDash.length;for(i=0;ca<N;){var oa=this.canvasDash[i%ra]/B.r;i%2||(J.beginPath(),J.arc(B.cx,B.cy,B.r,ca,ca+oa,0),z&&J.stroke());ca+=oa;++i}}});w.Line=Q("dojox.gfx.canvas.Line",[w.Shape,y.Line],{_renderShape:function(J){var z=this.shape;J.beginPath();J.moveTo(z.x1,z.y1);J.lineTo(z.x2,z.y2)},_renderDashedStroke:function(J,z){var B=this.shape;J.beginPath();K(J,this,B.x1,B.y1,B.x2,B.y2);z&&J.stroke()}});w.Polyline=Q("dojox.gfx.canvas.Polyline",
[w.Shape,y.Polyline],{setShape:function(){this.inherited(arguments);var J=this.shape.points,z=J[0],B;this.bbox=null;this._normalizePoints();if(J.length)if("number"==typeof z)z=J;else for(z=[],B=0;B<J.length;++B){var ca=J[B];z.push(ca.x,ca.y)}else z=[];this.canvasPolyline=z;return this},_renderShape:function(J){var z=this.canvasPolyline;if(z.length){J.beginPath();J.moveTo(z[0],z[1]);for(var B=2;B<z.length;B+=2)J.lineTo(z[B],z[B+1])}},_renderDashedStroke:function(J,z){var B=this.canvasPolyline,ca=0;
J.beginPath();for(var ra=0;ra<B.length;ra+=2)ca=K(J,this,B[ra],B[ra+1],B[ra+2],B[ra+3],ca);z&&J.stroke()}});w.Image=Q("dojox.gfx.canvas.Image",[w.Shape,y.Image],{setShape:function(){this.inherited(arguments);var J=new Image;this.surface.downloadImage(J,this.shape.src);this.canvasImage=J;return this},_renderShape:function(J){var z=this.shape;J.drawImage(this.canvasImage,z.x,z.y,z.width,z.height)}});w.Text=Q("dojox.gfx.canvas.Text",[w.Shape,y.Text],{_setFont:function(){this.fontStyle?this.canvasFont=
V.makeFontString(this.fontStyle):delete this.canvasFont},getTextWidth:function(){var J=this.shape,z=0;if(J.text){var B=this.surface.rawNode.getContext("2d");B.save();this._renderTransform(B);this._renderFill(B,!1);this._renderStroke(B,!1);this.canvasFont&&(B.font=this.canvasFont);z=B.measureText(J.text).width;B.restore()}return z},_render:function(J){J.save();this._renderTransform(J);this._renderFill(J,!1);this._renderStroke(J,!1);this._renderShape(J);J.restore()},_renderShape:function(J){var z=this.shape;
z.text&&(J.textAlign="middle"===z.align?"center":z.align,this.canvasFont&&(J.font=this.canvasFont),this.canvasFill&&J.fillText(z.text,z.x,z.y),this.strokeStyle&&(J.beginPath(),J.strokeText(z.text,z.x,z.y),J.closePath()))}});ia(w.Text,"setFont");a||w.Text.extend({getTextWidth:function(){return 0},getBoundingBox:function(){return null},_renderShape:function(){}});var la={M:"_moveToA",m:"_moveToR",L:"_lineToA",l:"_lineToR",H:"_hLineToA",h:"_hLineToR",V:"_vLineToA",v:"_vLineToR",C:"_curveToA",c:"_curveToR",
S:"_smoothCurveToA",s:"_smoothCurveToR",Q:"_qCurveToA",q:"_qCurveToR",T:"_qSmoothCurveToA",t:"_qSmoothCurveToR",A:"_arcTo",a:"_arcTo",Z:"_closePath",z:"_closePath"};w.Path=Q("dojox.gfx.canvas.Path",[w.Shape,e.Path],{constructor:function(){this.lastControl={}},setShape:function(){this.canvasPath=[];this._dashedPath=[];return this.inherited(arguments)},setStroke:function(){this.inherited(arguments);F||(this.segmented=!1,this._confirmSegmented());return this},_setPath:function(){this._dashResidue=null;
this.inherited(arguments)},_updateWithSegment:function(J){var z=W.clone(this.last);this[la[J.action]](this.canvasPath,J.action,J.args,this._needsDash?this._dashedPath:null);this.last=z;this.inherited(arguments)},_renderShape:function(J){var z=this.canvasPath;J.beginPath();for(var B=0;B<z.length;B+=2)J[z[B]].apply(J,z[B+1])},_renderDashedStroke:F?function(){}:function(J,z){var B=this._dashedPath;J.beginPath();for(var ca=0;ca<B.length;ca+=2)J[B[ca]].apply(J,B[ca+1]);z&&J.stroke()},_moveToA:function(J,
z,B,ca){J.push("moveTo",[B[0],B[1]]);ca&&ca.push("moveTo",[B[0],B[1]]);for(z=2;z<B.length;z+=2)J.push("lineTo",[B[z],B[z+1]]),ca&&(this._dashResidue=K(ca,this,B[z-2],B[z-1],B[z],B[z+1],this._dashResidue));this.last.x=B[B.length-2];this.last.y=B[B.length-1];this.lastControl={}},_moveToR:function(J,z,B,ca){z="x"in this.last?[this.last.x+=B[0],this.last.y+=B[1]]:[this.last.x=B[0],this.last.y=B[1]];J.push("moveTo",z);ca&&ca.push("moveTo",z);for(z=2;z<B.length;z+=2)J.push("lineTo",[this.last.x+=B[z],this.last.y+=
B[z+1]]),ca&&(this._dashResidue=K(ca,this,ca[ca.length-1][0],ca[ca.length-1][1],this.last.x,this.last.y,this._dashResidue));this.lastControl={}},_lineToA:function(J,z,B,ca){for(z=0;z<B.length;z+=2)ca&&(this._dashResidue=K(ca,this,this.last.x,this.last.y,B[z],B[z+1],this._dashResidue)),J.push("lineTo",[B[z],B[z+1]]);this.last.x=B[B.length-2];this.last.y=B[B.length-1];this.lastControl={}},_lineToR:function(J,z,B,ca){for(z=0;z<B.length;z+=2)J.push("lineTo",[this.last.x+=B[z],this.last.y+=B[z+1]]),ca&&
(this._dashResidue=K(ca,this,ca[ca.length-1][0],ca[ca.length-1][1],this.last.x,this.last.y,this._dashResidue));this.lastControl={}},_hLineToA:function(J,z,B,ca){for(z=0;z<B.length;++z)J.push("lineTo",[B[z],this.last.y]),ca&&(this._dashResidue=K(ca,this,ca[ca.length-1][0],ca[ca.length-1][1],B[z],this.last.y,this._dashResidue));this.last.x=B[B.length-1];this.lastControl={}},_hLineToR:function(J,z,B,ca){for(z=0;z<B.length;++z)J.push("lineTo",[this.last.x+=B[z],this.last.y]),ca&&(this._dashResidue=K(ca,
this,ca[ca.length-1][0],ca[ca.length-1][1],this.last.x,this.last.y,this._dashResidue));this.lastControl={}},_vLineToA:function(J,z,B,ca){for(z=0;z<B.length;++z)J.push("lineTo",[this.last.x,B[z]]),ca&&(this._dashResidue=K(ca,this,ca[ca.length-1][0],ca[ca.length-1][1],this.last.x,B[z],this._dashResidue));this.last.y=B[B.length-1];this.lastControl={}},_vLineToR:function(J,z,B,ca){for(z=0;z<B.length;++z)J.push("lineTo",[this.last.x,this.last.y+=B[z]]),ca&&(this._dashResidue=K(ca,this,ca[ca.length-1][0],
ca[ca.length-1][1],this.last.x,this.last.y,this._dashResidue));this.lastControl={}},_curveToA:function(J,z,B,ca){for(z=0;z<B.length;z+=6)J.push("bezierCurveTo",B.slice(z,z+6)),ca&&(this._dashResidue=I(ca,this,J[J.length-1],this._dashResidue));this.last.x=B[B.length-2];this.last.y=B[B.length-1];this.lastControl.x=B[B.length-4];this.lastControl.y=B[B.length-3];this.lastControl.type="C"},_curveToR:function(J,z,B,ca){for(z=0;z<B.length;z+=6)J.push("bezierCurveTo",[this.last.x+B[z],this.last.y+B[z+1],
this.lastControl.x=this.last.x+B[z+2],this.lastControl.y=this.last.y+B[z+3],this.last.x+B[z+4],this.last.y+B[z+5]]),ca&&(this._dashResidue=I(ca,this,J[J.length-1],this._dashResidue)),this.last.x+=B[z+4],this.last.y+=B[z+5];this.lastControl.type="C"},_smoothCurveToA:function(J,z,B,ca){for(z=0;z<B.length;z+=4){var ra="C"==this.lastControl.type;J.push("bezierCurveTo",[ra?2*this.last.x-this.lastControl.x:this.last.x,ra?2*this.last.y-this.lastControl.y:this.last.y,B[z],B[z+1],B[z+2],B[z+3]]);ca&&(this._dashResidue=
I(ca,this,J[J.length-1],this._dashResidue));this.lastControl.x=B[z];this.lastControl.y=B[z+1];this.lastControl.type="C"}this.last.x=B[B.length-2];this.last.y=B[B.length-1]},_smoothCurveToR:function(J,z,B,ca){for(z=0;z<B.length;z+=4){var ra="C"==this.lastControl.type;J.push("bezierCurveTo",[ra?2*this.last.x-this.lastControl.x:this.last.x,ra?2*this.last.y-this.lastControl.y:this.last.y,this.last.x+B[z],this.last.y+B[z+1],this.last.x+B[z+2],this.last.y+B[z+3]]);ca&&(this._dashResidue=I(ca,this,J[J.length-
1],this._dashResidue));this.lastControl.x=this.last.x+B[z];this.lastControl.y=this.last.y+B[z+1];this.lastControl.type="C";this.last.x+=B[z+2];this.last.y+=B[z+3]}},_qCurveToA:function(J,z,B,ca){for(z=0;z<B.length;z+=4)J.push("quadraticCurveTo",B.slice(z,z+4));ca&&(this._dashResidue=I(ca,this,J[J.length-1],this._dashResidue));this.last.x=B[B.length-2];this.last.y=B[B.length-1];this.lastControl.x=B[B.length-4];this.lastControl.y=B[B.length-3];this.lastControl.type="Q"},_qCurveToR:function(J,z,B,ca){for(z=
0;z<B.length;z+=4)J.push("quadraticCurveTo",[this.lastControl.x=this.last.x+B[z],this.lastControl.y=this.last.y+B[z+1],this.last.x+B[z+2],this.last.y+B[z+3]]),ca&&(this._dashResidue=I(ca,this,J[J.length-1],this._dashResidue)),this.last.x+=B[z+2],this.last.y+=B[z+3];this.lastControl.type="Q"},_qSmoothCurveToA:function(J,z,B,ca){for(z=0;z<B.length;z+=2){var ra="Q"==this.lastControl.type;J.push("quadraticCurveTo",[this.lastControl.x=ra?2*this.last.x-this.lastControl.x:this.last.x,this.lastControl.y=
ra?2*this.last.y-this.lastControl.y:this.last.y,B[z],B[z+1]]);ca&&(this._dashResidue=I(ca,this,J[J.length-1],this._dashResidue));this.lastControl.type="Q"}this.last.x=B[B.length-2];this.last.y=B[B.length-1]},_qSmoothCurveToR:function(J,z,B,ca){for(z=0;z<B.length;z+=2){var ra="Q"==this.lastControl.type;J.push("quadraticCurveTo",[this.lastControl.x=ra?2*this.last.x-this.lastControl.x:this.last.x,this.lastControl.y=ra?2*this.last.y-this.lastControl.y:this.last.y,this.last.x+B[z],this.last.y+B[z+1]]);
ca&&(this._dashResidue=I(ca,this,J[J.length-1],this._dashResidue));this.lastControl.type="Q";this.last.x+=B[z];this.last.y+=B[z+1]}},_arcTo:function(J,z,B,ca){z="a"==z;for(var ra=0;ra<B.length;ra+=7){var oa=B[ra+5],ta=B[ra+6];z&&(oa+=this.last.x,ta+=this.last.y);var za=g.arcAsBezier(this.last,B[ra],B[ra+1],B[ra+2],B[ra+3]?1:0,B[ra+4]?1:0,oa,ta);t.forEach(za,function(b){J.push("bezierCurveTo",b)});ca&&(this._dashResidue=I(ca,this,p,this._dashResidue));this.last.x=oa;this.last.y=ta}this.lastControl=
{}},_closePath:function(J,z,B,ca){J.push("closePath",[]);ca&&(this._dashResidue=K(ca,this,this.last.x,this.last.y,ca[1][0],ca[1][1],this._dashResidue));this.lastControl={}}});t.forEach("moveTo lineTo hLineTo vLineTo curveTo smoothCurveTo qCurveTo qSmoothCurveTo arcTo closePath".split(" "),function(J){ia(w.Path,J)});w.TextPath=Q("dojox.gfx.canvas.TextPath",[w.Shape,e.TextPath],{_renderShape:function(J){},_setText:function(){},_setFont:function(){}});w.Surface=Q("dojox.gfx.canvas.Surface",y.Surface,
{constructor:function(){y.Container._init.call(this);this.pendingImageCount=0;this.makeDirty()},destroy:function(){y.Container.clear.call(this,!0);this.inherited(arguments)},setDimensions:function(J,z){this.width=V.normalizedLength(J);this.height=V.normalizedLength(z);if(!this.rawNode)return this;J=!1;this.rawNode.width!=this.width&&(this.rawNode.width=this.width,J=!0);this.rawNode.height!=this.height&&(this.rawNode.height=this.height,J=!0);J&&this.makeDirty();return this},getDimensions:function(){return this.rawNode?
{width:this.rawNode.width,height:this.rawNode.height}:null},_render:function(J){!this.rawNode||!J&&this.pendingImageCount||(J=this.rawNode.getContext("2d"),J.clearRect(0,0,this.rawNode.width,this.rawNode.height),this.render(J),"pendingRender"in this&&(clearTimeout(this.pendingRender),delete this.pendingRender))},render:function(J){J.save();for(var z=0;z<this.children.length;++z)this.children[z]._render(J);J.restore()},makeDirty:function(){this.pendingImagesCount||"pendingRender"in this||this._batch||
(this.pendingRender=setTimeout(W.hitch(this,this._render),0))},downloadImage:function(J,z){var B=W.hitch(this,this.onImageLoad);!this.pendingImageCount++&&"pendingRender"in this&&(clearTimeout(this.pendingRender),delete this.pendingRender);J.onload=B;J.onerror=B;J.onabort=B;J.src=z},onImageLoad:function(){--this.pendingImageCount||(this.onImagesLoaded(),this._render())},onImagesLoaded:function(){},getEventSource:function(){return null},connect:function(){},disconnect:function(){},on:function(){}});
w.createSurface=function(J,z,B){if(!z&&!B){var ca=R.position(J);z=z||ca.w;B=B||ca.h}"number"==typeof z&&(z+="px");"number"==typeof B&&(B+="px");ca=new w.Surface;J=H.byId(J);var ra=J.ownerDocument.createElement("canvas");ra.width=V.normalizedLength(z);ra.height=V.normalizedLength(B);J.appendChild(ra);ca.rawNode=ra;ca._parent=J;return ca.surface=ca};var ja=y.Container;Q={openBatch:function(){++this._batch;return this},closeBatch:function(){this._batch=0<this._batch?--this._batch:0;this._makeDirty();
return this},_makeDirty:function(){this._batch||this.surface.makeDirty()},add:function(J){this._makeDirty();return ja.add.apply(this,arguments)},remove:function(J,z){this._makeDirty();return ja.remove.apply(this,arguments)},clear:function(){this._makeDirty();return ja.clear.apply(this,arguments)},getBoundingBox:ja.getBoundingBox,_moveChildToFront:function(J){this._makeDirty();return ja._moveChildToFront.apply(this,arguments)},_moveChildToBack:function(J){this._makeDirty();return ja._moveChildToBack.apply(this,
arguments)}};e={createObject:function(J,z){J=new J;J.surface=this.surface;J.setShape(z);this.add(J);return J}};m(w.Group,Q);m(w.Group,y.Creator);m(w.Group,e);m(w.Surface,Q);m(w.Surface,y.Creator);m(w.Surface,e);w.fixTarget=function(J,z){return!0};return w})},"dojox/gfx/shape":function(){define("./_base dojo/_base/lang dojo/_base/declare dojo/_base/kernel dojo/_base/sniff dojo/on dojo/_base/array dojo/dom-construct dojo/_base/Color ./matrix".split(" "),function(V,W,t,Q,X,R,H,y,e,g){function l(n,h){for(var x=
n.length-1;h<x;)n[h]=n[++h];n.length=x}var m=V.shape={};m.Shape=t("dojox.gfx.shape.Shape",null,{constructor:function(){this.parentMatrix=this.parent=this.bbox=this.strokeStyle=this.fillStyle=this.matrix=this.shape=this.rawNode=null;if(X("gfxRegistry")){var n=m.register(this);this.getUID=function(){return n}}},destroy:function(){X("gfxRegistry")&&m.dispose(this);this.rawNode&&"__gfxObject__"in this.rawNode&&(this.rawNode.__gfxObject__=null);this.rawNode=null},getNode:function(){return this.rawNode},
getShape:function(){return this.shape},getTransform:function(){return this.matrix},getFill:function(){return this.fillStyle},getStroke:function(){return this.strokeStyle},getParent:function(){return this.parent},getBoundingBox:function(){return this.bbox},getTransformedBoundingBox:function(){var n=this.getBoundingBox();if(!n)return null;var h=this._getRealMatrix();return[g.multiplyPoint(h,n.x,n.y),g.multiplyPoint(h,n.x+n.width,n.y),g.multiplyPoint(h,n.x+n.width,n.y+n.height),g.multiplyPoint(h,n.x,
n.y+n.height)]},getEventSource:function(){return this.rawNode},setClip:function(n){this.clip=n},getClip:function(){return this.clip},setShape:function(n){this.shape=V.makeParameters(this.shape,n);this.bbox=null;return this},setFill:function(n){if(!n)return this.fillStyle=null,this;var h=null;if("object"==typeof n&&"type"in n)switch(n.type){case "linear":h=V.makeParameters(V.defaultLinearGradient,n);break;case "radial":h=V.makeParameters(V.defaultRadialGradient,n);break;case "pattern":h=V.makeParameters(V.defaultPattern,
n)}else h=V.normalizeColor(n);this.fillStyle=h;return this},setStroke:function(n){if(!n)return this.strokeStyle=null,this;if("string"==typeof n||W.isArray(n)||n instanceof e)n={color:n};n=this.strokeStyle=V.makeParameters(V.defaultStroke,n);n.color=V.normalizeColor(n.color);return this},setTransform:function(n){this.matrix=g.clone(n?g.normalize(n):g.identity);return this._applyTransform()},_applyTransform:function(){return this},moveToFront:function(){var n=this.getParent();n&&(n._moveChildToFront(this),
this._moveToFront());return this},moveToBack:function(){var n=this.getParent();n&&(n._moveChildToBack(this),this._moveToBack());return this},_moveToFront:function(){},_moveToBack:function(){},applyRightTransform:function(n){return n?this.setTransform([this.matrix,n]):this},applyLeftTransform:function(n){return n?this.setTransform([n,this.matrix]):this},applyTransform:function(n){return n?this.setTransform([this.matrix,n]):this},removeShape:function(n){this.parent&&this.parent.remove(this,n);return this},
_setParent:function(n,h){this.parent=n;return this._updateParentMatrix(h)},_updateParentMatrix:function(n){this.parentMatrix=n?g.clone(n):null;return this._applyTransform()},_getRealMatrix:function(){for(var n=this.matrix,h=this.parent;h;)h.matrix&&(n=g.multiply(h.matrix,n)),h=h.parent;return n}});m._eventsProcessing={on:function(n,h){return R(this.getEventSource(),n,m.fixCallback(this,V.fixTarget,h))},connect:function(n,h,x){"on"==n.substring(0,2)&&(n=n.substring(2));return this.on(n,x?W.hitch(h,
x):h)},disconnect:function(n){return n.remove()}};m.fixCallback=function(n,h,x,I){I||(I=x,x=null);if(W.isString(I)){x=x||Q.global;if(!x[I])throw['dojox.gfx.shape.fixCallback: scope["',I,'"] is null (scope\x3d"',x,'")'].join("");return function(K){return h(K,n)?x[I].apply(x,arguments||[]):void 0}}return x?function(K){return h(K,n)?I.apply(x,arguments||[]):void 0}:function(K){return h(K,n)?I.apply(x,arguments):void 0}};W.extend(m.Shape,m._eventsProcessing);m.Container={_init:function(){this.children=
[];this._batch=0},openBatch:function(){return this},closeBatch:function(){return this},add:function(n){var h=n.getParent();h&&h.remove(n,!0);this.children.push(n);return n._setParent(this,this._getRealMatrix())},remove:function(n,h){for(var x=0;x<this.children.length;++x)if(this.children[x]==n){h||(n.parent=null,n.parentMatrix=null);l(this.children,x);break}return this},clear:function(n){for(var h,x=0;x<this.children.length;++x)h=this.children[x],h.parent=null,h.parentMatrix=null,n&&h.destroy();this.children=
[];return this},getBoundingBox:function(){if(this.children){var n=null;H.forEach(this.children,function(h){var x=h.getBoundingBox();x&&((h=h.getTransform())&&(x=g.multiplyRectangle(h,x)),n?(n.x=Math.min(n.x,x.x),n.y=Math.min(n.y,x.y),n.endX=Math.max(n.endX,x.x+x.width),n.endY=Math.max(n.endY,x.y+x.height)):n={x:x.x,y:x.y,endX:x.x+x.width,endY:x.y+x.height})});n&&(n.width=n.endX-n.x,n.height=n.endY-n.y);return n}return null},_moveChildToFront:function(n){for(var h=0;h<this.children.length;++h)if(this.children[h]==
n){l(this.children,h);this.children.push(n);break}return this},_moveChildToBack:function(n){for(var h=0;h<this.children.length;++h)if(this.children[h]==n){l(this.children,h);this.children.unshift(n);break}return this}};m.Surface=t("dojox.gfx.shape.Surface",null,{constructor:function(){this._parent=this.rawNode=null;this._nodes=[];this._events=[]},destroy:function(){H.forEach(this._nodes,y.destroy);this._nodes=[];H.forEach(this._events,function(n){n&&n.remove()});this._events=[];this.rawNode=null;
if(X("ie"))for(;this._parent.lastChild;)y.destroy(this._parent.lastChild);else this._parent.innerHTML="";this._parent=null},getEventSource:function(){return this.rawNode},_getRealMatrix:function(){return null},isLoaded:!0,onLoad:function(n){},whenLoaded:function(n,h){var x=W.hitch(n,h);if(this.isLoaded)x(this);else R.once(this,"load",function(I){x(I)})}});W.extend(m.Surface,m._eventsProcessing);m.Rect=t("dojox.gfx.shape.Rect",m.Shape,{constructor:function(n){this.shape=V.getDefault("Rect");this.rawNode=
n},getBoundingBox:function(){return this.shape}});m.Ellipse=t("dojox.gfx.shape.Ellipse",m.Shape,{constructor:function(n){this.shape=V.getDefault("Ellipse");this.rawNode=n},getBoundingBox:function(){if(!this.bbox){var n=this.shape;this.bbox={x:n.cx-n.rx,y:n.cy-n.ry,width:2*n.rx,height:2*n.ry}}return this.bbox}});m.Circle=t("dojox.gfx.shape.Circle",m.Shape,{constructor:function(n){this.shape=V.getDefault("Circle");this.rawNode=n},getBoundingBox:function(){if(!this.bbox){var n=this.shape;this.bbox={x:n.cx-
n.r,y:n.cy-n.r,width:2*n.r,height:2*n.r}}return this.bbox}});m.Line=t("dojox.gfx.shape.Line",m.Shape,{constructor:function(n){this.shape=V.getDefault("Line");this.rawNode=n},getBoundingBox:function(){if(!this.bbox){var n=this.shape;this.bbox={x:Math.min(n.x1,n.x2),y:Math.min(n.y1,n.y2),width:Math.abs(n.x2-n.x1),height:Math.abs(n.y2-n.y1)}}return this.bbox}});m.Polyline=t("dojox.gfx.shape.Polyline",m.Shape,{constructor:function(n){this.shape=V.getDefault("Polyline");this.rawNode=n},setShape:function(n,
h){n&&n instanceof Array?(this.inherited(arguments,[{points:n}]),h&&this.shape.points.length&&this.shape.points.push(this.shape.points[0])):this.inherited(arguments,[n]);return this},_normalizePoints:function(){var n=this.shape.points,h=n&&n.length;if(h&&"number"==typeof n[0]){for(var x=[],I=0;I<h;I+=2)x.push({x:n[I],y:n[I+1]});this.shape.points=x}},getBoundingBox:function(){if(!this.bbox&&this.shape.points.length){for(var n=this.shape.points,h=n.length,x=n[0],I=x.x,K=x.y,w=x.x,L=x.y,T=1;T<h;++T)x=
n[T],I>x.x&&(I=x.x),w<x.x&&(w=x.x),K>x.y&&(K=x.y),L<x.y&&(L=x.y);this.bbox={x:I,y:K,width:w-I,height:L-K}}return this.bbox}});m.Image=t("dojox.gfx.shape.Image",m.Shape,{constructor:function(n){this.shape=V.getDefault("Image");this.rawNode=n},getBoundingBox:function(){return this.shape},setStroke:function(){return this},setFill:function(){return this}});m.Text=t(m.Shape,{constructor:function(n){this.fontStyle=null;this.shape=V.getDefault("Text");this.rawNode=n},getFont:function(){return this.fontStyle},
setFont:function(n){this.fontStyle="string"==typeof n?V.splitFontString(n):V.makeParameters(V.defaultFont,n);this._setFont();return this},getBoundingBox:function(){var n=null;this.getShape().text&&(n=V._base._computeTextBoundingBox(this));return n}});m.Creator={createShape:function(n){switch(n.type){case V.defaultPath.type:return this.createPath(n);case V.defaultRect.type:return this.createRect(n);case V.defaultCircle.type:return this.createCircle(n);case V.defaultEllipse.type:return this.createEllipse(n);
case V.defaultLine.type:return this.createLine(n);case V.defaultPolyline.type:return this.createPolyline(n);case V.defaultImage.type:return this.createImage(n);case V.defaultText.type:return this.createText(n);case V.defaultTextPath.type:return this.createTextPath(n)}return null},createGroup:function(){return this.createObject(V.Group)},createRect:function(n){return this.createObject(V.Rect,n)},createEllipse:function(n){return this.createObject(V.Ellipse,n)},createCircle:function(n){return this.createObject(V.Circle,
n)},createLine:function(n){return this.createObject(V.Line,n)},createPolyline:function(n){return this.createObject(V.Polyline,n)},createImage:function(n){return this.createObject(V.Image,n)},createText:function(n){return this.createObject(V.Text,n)},createPath:function(n){return this.createObject(V.Path,n)},createTextPath:function(n){return this.createObject(V.TextPath,{}).setText(n)},createObject:function(n,h){return null}};return m})},"dojox/gfx/path":function(){define(["./_base","dojo/_base/lang",
"dojo/_base/declare","./matrix","./shape"],function(V,W,t,Q,X){X=t("dojox.gfx.path.Path",X.Shape,{constructor:function(R){this.shape=W.clone(V.defaultPath);this.segments=[];this.tbbox=null;this.absolute=!0;this.last={};this.rawNode=R;this.segmented=!1},setAbsoluteMode:function(R){this._confirmSegmented();this.absolute="string"==typeof R?"absolute"==R:R;return this},getAbsoluteMode:function(){this._confirmSegmented();return this.absolute},getBoundingBox:function(){this._confirmSegmented();return this.bbox&&
"l"in this.bbox?{x:this.bbox.l,y:this.bbox.t,width:this.bbox.r-this.bbox.l,height:this.bbox.b-this.bbox.t}:null},_getRealBBox:function(){this._confirmSegmented();if(this.tbbox)return this.tbbox;var R=this.bbox,H=this._getRealMatrix();this.bbox=null;for(var y=0,e=this.segments.length;y<e;++y)this._updateWithSegment(this.segments[y],H);H=this.bbox;this.bbox=R;return this.tbbox=H?[{x:H.l,y:H.t},{x:H.r,y:H.t},{x:H.r,y:H.b},{x:H.l,y:H.b}]:null},getLastPosition:function(){this._confirmSegmented();return"x"in
this.last?this.last:null},_applyTransform:function(){this.tbbox=null;return this.inherited(arguments)},_updateBBox:function(R,H,y){y&&(H=Q.multiplyPoint(y,R,H),R=H.x,H=H.y);this.bbox&&"l"in this.bbox?(this.bbox.l>R&&(this.bbox.l=R),this.bbox.r<R&&(this.bbox.r=R),this.bbox.t>H&&(this.bbox.t=H),this.bbox.b<H&&(this.bbox.b=H)):this.bbox={l:R,b:H,r:R,t:H}},_updateWithSegment:function(R,H){var y=R.args,e=y.length,g;switch(R.action){case "M":case "L":case "C":case "S":case "Q":case "T":for(g=0;g<e;g+=2)this._updateBBox(y[g],
y[g+1],H);this.last.x=y[e-2];this.last.y=y[e-1];this.absolute=!0;break;case "H":for(g=0;g<e;++g)this._updateBBox(y[g],this.last.y,H);this.last.x=y[e-1];this.absolute=!0;break;case "V":for(g=0;g<e;++g)this._updateBBox(this.last.x,y[g],H);this.last.y=y[e-1];this.absolute=!0;break;case "m":g=0;"x"in this.last||(this._updateBBox(this.last.x=y[0],this.last.y=y[1],H),g=2);for(;g<e;g+=2)this._updateBBox(this.last.x+=y[g],this.last.y+=y[g+1],H);this.absolute=!1;break;case "l":case "t":for(g=0;g<e;g+=2)this._updateBBox(this.last.x+=
y[g],this.last.y+=y[g+1],H);this.absolute=!1;break;case "h":for(g=0;g<e;++g)this._updateBBox(this.last.x+=y[g],this.last.y,H);this.absolute=!1;break;case "v":for(g=0;g<e;++g)this._updateBBox(this.last.x,this.last.y+=y[g],H);this.absolute=!1;break;case "c":for(g=0;g<e;g+=6)this._updateBBox(this.last.x+y[g],this.last.y+y[g+1],H),this._updateBBox(this.last.x+y[g+2],this.last.y+y[g+3],H),this._updateBBox(this.last.x+=y[g+4],this.last.y+=y[g+5],H);this.absolute=!1;break;case "s":case "q":for(g=0;g<e;g+=
4)this._updateBBox(this.last.x+y[g],this.last.y+y[g+1],H),this._updateBBox(this.last.x+=y[g+2],this.last.y+=y[g+3],H);this.absolute=!1;break;case "A":for(g=0;g<e;g+=7)this._updateBBox(y[g+5],y[g+6],H);this.last.x=y[e-2];this.last.y=y[e-1];this.absolute=!0;break;case "a":for(g=0;g<e;g+=7)this._updateBBox(this.last.x+=y[g+5],this.last.y+=y[g+6],H);this.absolute=!1}R=[R.action];for(g=0;g<e;++g)R.push(V.formatNumber(y[g],!0));if("string"==typeof this.shape.path)this.shape.path+=R.join("");else for(g=
0,e=R.length;g<e;++g)this.shape.path.push(R[g])},_validSegments:{m:2,l:2,h:1,v:1,c:6,s:4,q:4,t:2,a:7,z:0},_pushSegment:function(R,H){this.tbbox=null;var y=this._validSegments[R.toLowerCase()];"number"==typeof y&&(y?H.length>=y&&(R={action:R,args:H.slice(0,H.length-H.length%y)},this.segments.push(R),this._updateWithSegment(R)):(R={action:R,args:[]},this.segments.push(R),this._updateWithSegment(R)))},_collectArgs:function(R,H){for(var y=0;y<H.length;++y){var e=H[y];"boolean"==typeof e?R.push(e?1:0):
"number"==typeof e?R.push(e):e instanceof Array?this._collectArgs(R,e):"x"in e&&"y"in e&&R.push(e.x,e.y)}},moveTo:function(){this._confirmSegmented();var R=[];this._collectArgs(R,arguments);this._pushSegment(this.absolute?"M":"m",R);return this},lineTo:function(){this._confirmSegmented();var R=[];this._collectArgs(R,arguments);this._pushSegment(this.absolute?"L":"l",R);return this},hLineTo:function(){this._confirmSegmented();var R=[];this._collectArgs(R,arguments);this._pushSegment(this.absolute?
"H":"h",R);return this},vLineTo:function(){this._confirmSegmented();var R=[];this._collectArgs(R,arguments);this._pushSegment(this.absolute?"V":"v",R);return this},curveTo:function(){this._confirmSegmented();var R=[];this._collectArgs(R,arguments);this._pushSegment(this.absolute?"C":"c",R);return this},smoothCurveTo:function(){this._confirmSegmented();var R=[];this._collectArgs(R,arguments);this._pushSegment(this.absolute?"S":"s",R);return this},qCurveTo:function(){this._confirmSegmented();var R=
[];this._collectArgs(R,arguments);this._pushSegment(this.absolute?"Q":"q",R);return this},qSmoothCurveTo:function(){this._confirmSegmented();var R=[];this._collectArgs(R,arguments);this._pushSegment(this.absolute?"T":"t",R);return this},arcTo:function(){this._confirmSegmented();var R=[];this._collectArgs(R,arguments);this._pushSegment(this.absolute?"A":"a",R);return this},closePath:function(){this._confirmSegmented();this._pushSegment("Z",[]);return this},_confirmSegmented:function(){if(!this.segmented){var R=
this.shape.path;this.shape.path=[];this._setPath(R);this.shape.path=this.shape.path.join("");this.segmented=!0}},_setPath:function(R){R=W.isArray(R)?R:R.match(V.pathSvgRegExp);this.segments=[];this.absolute=!0;this.bbox={};this.last={};if(R){for(var H="",y=[],e=R.length,g=0;g<e;++g){var l=R[g],m=parseFloat(l);isNaN(m)?(H&&this._pushSegment(H,y),y=[],H=l):y.push(m)}this._pushSegment(H,y)}},setShape:function(R){this.inherited(arguments,["string"==typeof R?{path:R}:R]);this.segmented=!1;this.segments=
[];V.lazyPathSegmentation||this._confirmSegmented();return this},_2PI:2*Math.PI});t=t("dojox.gfx.path.TextPath",X,{constructor:function(R){"text"in this||(this.text=W.clone(V.defaultTextPath));"fontStyle"in this||(this.fontStyle=W.clone(V.defaultFont))},getText:function(){return this.text},setText:function(R){this.text=V.makeParameters(this.text,"string"==typeof R?{text:R}:R);this._setText();return this},getFont:function(){return this.fontStyle},setFont:function(R){this.fontStyle="string"==typeof R?
V.splitFontString(R):V.makeParameters(V.defaultFont,R);this._setFont();return this}});return V.path={Path:X,TextPath:t}})},"dojox/gfx/arc":function(){define(["./_base","dojo/_base/lang","./matrix"],function(V,W,t){function Q(g){var l=Math.cos(g);g=Math.sin(g);var m={x:l+4/3*(1-l),y:g-4/3*l*(1-l)/g};return{s:{x:l,y:-g},c1:{x:m.x,y:-m.y},c2:m,e:{x:l,y:g}}}var X=2*Math.PI,R=Math.PI/4,H=Math.PI/8,y=R+H,e=Q(H);return V.arc={unitArcAsBezier:Q,curvePI4:e,arcAsBezier:function(g,l,m,n,h,x,I,K){h=!!h;x=!!x;
var w=t._degToRad(n);n=l*l;var L=m*m,T=t.multiplyPoint(t.rotate(-w),{x:(g.x-I)/2,y:(g.y-K)/2}),U=T.x*T.x,N=T.y*T.y;n=Math.sqrt((n*L-n*N-L*U)/(n*N+L*U));isNaN(n)&&(n=0);n={x:n*l*T.y/m,y:-n*m*T.x/l};h==x&&(n={x:-n.x,y:-n.y});n=t.multiplyPoint([t.translate((g.x+I)/2,(g.y+K)/2),t.rotate(w)],n);l=t.normalize([t.translate(n.x,n.y),t.rotate(w),t.scale(l,m)]);n=t.invert(l);g=t.multiplyPoint(n,g);K=t.multiplyPoint(n,I,K);I=Math.atan2(g.y,g.x);n=I-Math.atan2(K.y,K.x);x&&(n=-n);0>n?n+=X:n>X&&(n-=X);m=H;K=e;
m=x?m:-m;g=[];for(h=n;0<h;h-=R)h<y&&(m=h/2,K=Q(m),m=x?m:-m,h=0),T=t.normalize([l,t.rotate(I+m)]),x?(n=t.multiplyPoint(T,K.c1),w=t.multiplyPoint(T,K.c2),T=t.multiplyPoint(T,K.e)):(n=t.multiplyPoint(T,K.c2),w=t.multiplyPoint(T,K.c1),T=t.multiplyPoint(T,K.s)),g.push([n.x,n.y,w.x,w.y,T.x,T.y]),I+=2*m;return g}}})},"dojox/gfx/decompose":function(){define(["./_base","dojo/_base/lang","./matrix"],function(V,W,t){function Q(e,g){return Math.abs(e-g)<=1E-6*(Math.abs(e)+Math.abs(g))}function X(e,g,l,m){if(!isFinite(e))return l;
if(!isFinite(l))return e;g=Math.abs(g);m=Math.abs(m);return(g*e+m*l)/(g+m)}function R(e){e=t.normalize(e);var g=-e.xx-e.yy,l=e.xx*e.yy-e.xy*e.yx,m=Math.sqrt(g*g-4*l);g=-(g+(0>g?-m:m))/2;l/=g;m=e.xy/(g-e.xx);var n=1,h=e.xy/(l-e.xx),x=1;Q(g,l)&&(m=1,h=n=0,x=1);isFinite(m)||(m=1,n=(g-e.xx)/e.xy,isFinite(n)||(m=(g-e.yy)/e.yx,n=1,isFinite(m)||(m=1,n=e.yx/(g-e.yy))));isFinite(h)||(h=1,x=(l-e.xx)/e.xy,isFinite(x)||(h=(l-e.yy)/e.yx,x=1,isFinite(h)||(h=1,x=e.yx/(l-e.yy))));e=Math.sqrt(m*m+n*n);var I=Math.sqrt(h*
h+x*x);isFinite(m/=e)||(m=0);isFinite(n/=e)||(n=0);isFinite(h/=I)||(h=0);isFinite(x/=I)||(x=0);return{value1:g,value2:l,vector1:{x:m,y:n},vector2:{x:h,y:x}}}function H(e,g){var l=0>e.xx*e.yy||0<e.xy*e.yx?-1:1,m=g.angle1=(Math.atan2(e.yx,e.yy)+Math.atan2(-l*e.xy,l*e.xx))/2;l=Math.cos(m);m=Math.sin(m);g.sx=X(e.xx/l,l,-e.xy/m,m);g.sy=X(e.yy/l,l,e.yx/m,m);return g}function y(e,g){var l=0>e.xx*e.yy||0<e.xy*e.yx?-1:1,m=g.angle2=(Math.atan2(l*e.yx,l*e.xx)+Math.atan2(-e.xy,e.yy))/2;l=Math.cos(m);m=Math.sin(m);
g.sx=X(e.xx/l,l,e.yx/m,m);g.sy=X(e.yy/l,l,-e.xy/m,m);return g}return V.decompose=function(e){var g=t.normalize(e);e={dx:g.dx,dy:g.dy,sx:1,sy:1,angle1:0,angle2:0};if(Q(g.xy,0)&&Q(g.yx,0))return W.mixin(e,{sx:g.xx,sy:g.yy});if(Q(g.xx*g.yx,-g.xy*g.yy))return H(g,e);if(Q(g.xx*g.xy,-g.yx*g.yy))return y(g,e);var l=new t.Matrix2D(g);var m=W.mixin(l,{dx:0,dy:0,xy:l.yx,yx:l.xy});l=R([g,m]);m=R([m,g]);l=new t.Matrix2D({xx:l.vector1.x,xy:l.vector2.x,yx:l.vector1.y,yy:l.vector2.y});m=new t.Matrix2D({xx:m.vector1.x,
xy:m.vector1.y,yx:m.vector2.x,yy:m.vector2.y});g=new t.Matrix2D([t.invert(l),g,t.invert(m)]);H(m,e);g.xx*=e.sx;g.yy*=e.sy;y(l,e);g.xx*=e.sx;g.yy*=e.sy;return W.mixin(e,{sx:g.xx,sy:g.yy})}})},"dojox/gfx/bezierutils":function(){define(["./_base"],function(V){V=V.bezierutils={};V.tAtLength=function(H,y){var e=0,g=6==H.length,l=0,m=0,n=g?Q:R,h=function(x,I){for(var K=0,w=0;w<x.length-2;w+=2)K+=t(x[w],x[w+1],x[w+2],x[w+3]);w=g?t(H[0],H[1],H[4],H[5]):t(H[0],H[1],H[6],H[7]);K-w>I||l+K>y+I?(++m,x=n(x,.5),
h(x[0],I),Math.abs(l-y)<=I||h(x[1],I)):(l+=K,e+=1/(1<<m))};y&&h(H,.5);return e};var W=V.computeLength=function(H){for(var y=6==H.length,e=0,g=0;g<H.length-2;g+=2)e+=t(H[g],H[g+1],H[g+2],H[g+3]);g=y?t(H[0],H[1],H[4],H[5]):t(H[0],H[1],H[6],H[7]);return.1<e-g?(H=y?Q(H,.5):X(H,.5),e=W(H[0],y),e+=W(H[1],y)):e},t=V.distance=function(H,y,e,g){return Math.sqrt((e-H)*(e-H)+(g-y)*(g-y))},Q=function(H,y){var e=1-y,g=e*e,l=y*y,m=H[0],n=H[1],h=H[2],x=H[3],I=H[4];H=H[5];var K=g*m+2*e*y*h+l*I;g=g*n+2*e*y*x+l*H;
return[[m,n,e*m+y*h,e*n+y*x,K,g],[K,g,e*h+y*I,e*x+y*H,I,H]]},X=function(H,y){var e=1-y,g=e*e,l=g*e,m=y*y,n=m*y,h=H[0],x=H[1],I=H[2],K=H[3],w=H[4],L=H[5],T=H[6];H=H[7];var U=l*h+3*g*y*I+3*e*m*w+n*T;l=l*x+3*g*y*K+3*e*m*L+n*H;return[[h,x,e*h+y*I,e*x+y*K,g*h+2*e*y*I+m*w,g*x+2*e*y*K+m*L,U,l],[U,l,g*I+2*e*y*w+m*T,g*K+2*e*y*L+m*H,e*w+y*T,e*L+y*H,T,H]]},R=V.splitBezierAtT=function(H,y){return 6==H.length?Q(H,y):X(H,y)};return V})},"dojox/json/query":function(){define(["dojo/_base/kernel","dojo/_base/lang",
"dojox","dojo/_base/array"],function(V,W,t){W.getObject("json",!0,t);t.json._slice=function(Q,X,R,H){var y=Q.length,e=[];R=R||y;X=0>X?Math.max(0,X+y):Math.min(y,X);for(R=0>R?Math.max(0,R+y):Math.min(y,R);X<R;X+=H)e.push(Q[X]);return e};t.json._find=function(Q,X){function R(e){X&&(!0!==X||e instanceof Array?e[X]&&H.push(e[X]):H.push(e));for(var g in e){var l=e[g];X?l&&"object"==typeof l&&R(l):H.push(l)}}var H=[];if(X instanceof Array){if(1==X.length)return Q[X[0]];for(var y=0;y<X.length;y++)H.push(Q[X[y]])}else R(Q);
return H};t.json._distinctFilter=function(Q,X){for(var R=[],H={},y=0,e=Q.length;y<e;++y){var g=Q[y];X(g,y,Q)&&("object"==typeof g&&g?g.__included||(g.__included=!0,R.push(g)):H[g+typeof g]||(H[g+typeof g]=!0,R.push(g)))}y=0;for(e=R.length;y<e;++y)R[y]&&delete R[y].__included;return R};return t.json.query=function(Q,X){function R(m,n,h,x,I,K,w,L){return y[L].match(/[\*\?]/)||"~"==w?"/^"+y[L].substring(1,y[L].length-1).replace(/\\([btnfr\\"'])|([^\w\*\?])/g,"\\$1$2").replace(/([\*\?])/g,"[\\w\\W]$1")+
("~"==w?"$/i":"$/")+".test("+n+")":m}var H=0,y=[];Q=Q.replace(/"(\\.|[^"\\])*"|'(\\.|[^'\\])*'|[\[\]]/g,function(m){H+="["==m?1:"]"==m?-1:0;return"]"==m&&0<H?"`]":'"'==m.charAt(0)||"'"==m.charAt(0)?"`"+(y.push(m)-1):m});var e="";Q.replace(/(\]|\)|push|pop|shift|splice|sort|reverse)\s*\(/,function(){throw Error("Unsafe function call");});Q=Q.replace(/([^<>=]=)([^=])/g,"$1\x3d$2").replace(/@|(\.\s*)?[a-zA-Z\$_]+(\s*:)?/g,function(m){return"."==m.charAt(0)?m:"@"==m?"$obj":(m.match(/:|^(\$|Math|true|false|null)$/)?
"":"$obj.")+m}).replace(/\.?\.?\[(`\]|[^\]])*\]|\?.*|\.\.([\w\$_]+)|\.\*/g,function(m,n,h){return(n=m.match(/^\.?\.?(\[\s*\^?\?|\^?\?|\[\s*==)(.*?)\]?$/))?(h="",m.match(/^\./)&&(e="dojox.json._find("+e,h=",true)"),e=(n[1].match(/=/)?"dojo.map":n[1].match(/\^/)?"dojox.json._distinctFilter":"dojo.filter")+"("+e,h+",function($obj){return "+n[2]+"})"):(n=m.match(/^\[\s*([\/\\].*)\]/))?".concat().sort(function(a,b){"+n[1].replace(/\s*,?\s*([\/\\])\s*([^,\\\/]+)/g,function(x,I,K){return"var av\x3d "+K.replace(/\$obj/,
"a")+",bv\x3d "+K.replace(/\$obj/,"b")+";if(av\x3ebv||bv\x3d\x3dnull){return "+("/"==I?1:-1)+";}\nif(bv\x3eav||av\x3d\x3dnull){return "+("/"==I?-1:1)+";}\n"})+"return 0;})":(n=m.match(/^\[(-?[0-9]*):(-?[0-9]*):?(-?[0-9]*)\]/))?(e="dojox.json._slice("+e,","+(n[1]||0)+","+(n[2]||0)+","+(n[3]||1)+")"):m.match(/^\.\.|\.\*|\[\s*\*\s*\]|,/)?(e="dojox.json._find("+e,("."==m.charAt(1)?",'"+h+"'":m.match(/,/)?","+m:"")+")"):m}).replace(/(\$obj\s*((\.\s*[\w_$]+\s*)|(\[\s*`([0-9]+)\s*`\]))*)(==|~)\s*`([0-9]+)/g,
R).replace(/`([0-9]+)\s*(==|~)\s*(\$obj\s*((\.\s*[\w_$]+)|(\[\s*`([0-9]+)\s*`\]))*)/g,function(m,n,h,x,I,K,w,L){return R(m,x,I,K,w,L,h,n)});Q=e+("$"==Q.charAt(0)?"":"$")+Q.replace(/`([0-9]+|\])/g,function(m,n){return"]"==n?"]":y[n]});for(var g=eval("1\x26\x26function($,$1,$2,$3,$4,$5,$6,$7,$8,$9){var $obj\x3d$;return "+Q+"}"),l=0;l<arguments.length-1;l++)arguments[l]=arguments[l+1];return X?g.apply(this,arguments):g}})},"esri/tasks/PrintParameters":function(){define(["dojo/_base/declare","dojo/_base/lang",
"dojo/has","../kernel"],function(V,W,t,Q){V=V(null,{declaredClass:"esri.tasks.PrintParameters",map:null,template:null,outSpatialReference:null,extraParameters:null});t("extend-esri")&&W.setObject("tasks.PrintParameters",V,Q);return V})},"esri/toolbars/edit":function(){define("require dojo/_base/declare dojo/_base/lang dojo/_base/connect dojo/_base/array dojo/_base/Color dojo/has dojo/dom-construct dojo/dom-style ../kernel ../lang ../sniff ./_toolbar ./_Box ./_GraphicMover ./_VertexEditor ./TextEditor ../symbols/SimpleMarkerSymbol ../symbols/SimpleLineSymbol ../symbols/TextSymbol ../graphic".split(" "),
function(V,W,t,Q,X,R,H,y,e,g,l,m,n,h,x,I,K,w,L,T,U){var N=W(n,{declaredClass:"esri.toolbars.Edit",constructor:function(S,F){this._map=S;this._tool=0;if(this._map.loaded)this._scratchGL=S.graphics;else var a=Q.connect(this._map,"onLoad",this,function(){Q.disconnect(a);a=null;this._scratchGL=this._map.graphics});S=H("esri-mobile");this._defaultOptions=t.mixin({vertexSymbol:new w(w.STYLE_CIRCLE,S?20:12,new L(L.STYLE_SOLID,new R([0,0,0,.5]),1),new R([128,128,128])),ghostVertexSymbol:new w(w.STYLE_CIRCLE,
S?18:10,new L(L.STYLE_SOLID,new R([0,0,0,.5]),1),new R([255,255,255,.75])),ghostLineSymbol:new L(L.STYLE_DOT,new R([128,128,128]),2),allowDeleteVertices:!0,allowAddVertices:!0,rotateHandleOffset:S?24:16,boxLineSymbol:new L(L.STYLE_DASH,new R([64,64,64]),1),boxHandleSymbol:new w(w.STYLE_SQUARE,S?16:9,new L(L.STYLE_SOLID,new R([0,0,0,.5]),1),new R([255,255,255,.75])),textAnchorSymbol:new w(w.STYLE_CIRCLE,10,null,new R([255,0,0]))},F||{})},activate:function(S,F,a){this.deactivate();this._graphic=F;this._options=
t.mixin(t.mixin({},this._defaultOptions),a||{});var D=N.MOVE;a=N.EDIT_VERTICES;var da=N.SCALE,ha=N.ROTATE,ia=N.EDIT_TEXT,na=!1,P=!1,la=!1,ja=this._map,J=ja.spatialReference,z=F.geometry.spatialReference;this._geo=!(!J||!z||J.equals(z)||!J.isWebMercator()||4326!==z.wkid);this._isTextPoint=this._prepareTextSymbolEditing(F,S);(S&D)===D&&(na=this._enableMove(F));D=(S&da)===da;ha=(S&ha)===ha;if(D||ha)la=this._enableBoxEditing(F,D,ha);(S&a)===a&&(P=this._enableVertexEditing(F));(S&ia)===ia&&this._enableTextEditing(F);
if(!(na||P||la))throw Error("[esri.toolbars.Edit::activate] Unable to activate the tool. Check if the tool is valid for the given geometry type.");if(this._tool=S)this._mapPanEndHandle=Q.connect(ja,"onPanEnd",this,this._mapPanEndHandler),this._mapExtChgHandle=Q.connect(ja,"onExtentChange",this,this._mapExtentChangeHandler),this.onActivate(this._tool,F);ja.snappingManager&&(na||P)&&ja.snappingManager._startSelectionLayerQuery()},deactivate:function(){this._isTextPoint=null;var S=this._tool,F=this._graphic;
if(S){var a=!!this._modified;this._clear();Q.disconnect(this._mapPanEndHandle);Q.disconnect(this._mapExtChgHandle);this._graphic=this._geo=this._mapPanEndHandle=this._mapExtChgHandle=null;this.onDeactivate(S,F,{isModified:a});this._map.snappingManager&&this._map.snappingManager._stopSelectionLayerQuery()}},refresh:function(){this._refreshMoveables(!0)},getCurrentState:function(){return{tool:this._tool,graphic:this._graphic,isModified:!!this._modified}},onActivate:function(S,F){},onDeactivate:function(S,
F,a){},onGraphicMoveStart:function(S){},onGraphicFirstMove:function(S){this._modified=!0},onGraphicMove:function(S,F){},onGraphicMoveStop:function(S,F){},onGraphicClick:function(S,F){},onVertexMoveStart:function(S,F){},onVertexFirstMove:function(S,F){this._modified=!0},onVertexMove:function(S,F,a){},onVertexMoveStop:function(S,F,a){},onVertexAdd:function(S,F){this._modified=!0},onVertexClick:function(S,F){},onVertexMouseOver:function(S,F){},onVertexMouseOut:function(S,F){},onVertexDelete:function(S,
F){this._modified=!0},onTextEditStart:function(S,F){},onTextEditEnd:function(S){},onScaleStart:function(S){},onScaleFirstMove:function(S){this._modified=!0},onScale:function(S,F){},onScaleStop:function(S,F){},onRotateStart:function(S){},onRotateFirstMove:function(S){this._modified=!0},onRotate:function(S,F){},onRotateStop:function(S,F){},_eventMap:{activate:["tool","graphic"],deactivate:["tool","graphic","info"],"graphic-move-start":["graphic"],"graphic-first-move":["graphic"],"graphic-move":["graphic",
"transform"],"graphic-move-stop":["graphic","transform"],"graphic-click":["graphic","info"],"vertex-move-start":["graphic","vertexinfo"],"vertex-first-move":["graphic","vertexinfo"],"vertex-move":["graphic","vertexinfo","transform"],"vertex-move-stop":["graphic","vertexinfo","transform"],"vertex-add":["graphic","vertexinfo"],"vertex-click":["graphic","vertexinfo"],"vertex-mouse-over":["graphic","vertexinfo"],"vertex-mouse-out":["graphic","vertexinfo"],"vertex-delete":["graphic","vertexinfo"],"scale-start":["graphic"],
"scale-first-move":["graphic"],scale:["graphic","info"],"scale-stop":["graphic","info"],"rotate-start":["graphic"],"rotate-first-move":["graphic"],rotate:["graphic","info"],"rotate-stop":["graphic","info"]},_prepareTextSymbolEditing:function(S,F){if("point"===S.geometry.type||"multipoint"===S.geometry.type){var a=S.getLayer(),D=a.renderer;a=S.symbol||a._getSymbol(S);!a&&(D.hasVisualVariables("sizeInfo",!1)||D.hasVisualVariables("colorInfo",!1)||D.hasVisualVariables("opacityInfo",!1))&&D.addBreak&&
D.infos&&1===D.infos.length&&(a=D.infos[0].symbol||D.defaultSymbol);if(a&&"textsymbol"===a.type){if((F&N.SCALE)===N.SCALE||(F&N.ROTATE)===N.ROTATE||(F&N.EDIT_TEXT)===N.EDIT_TEXT){S.setSymbol(new T(a.toJson()));var da=this;this._textSymbolEditor?(this._textSymbolEditor.createForm(S),this._textSymbolEditor.show()):this._options&&this._options.textSymbolEditor?(this._textSymbolEditor=this._options.textSymbolEditor,this._textSymbolEditor.on("symbol-change",function(){da._boxEditor&&da._boxEditor.refresh()})):
V(["../dijit/SymbolEditor"],function(ha){if(!da._textSymbolEditor){var ia=da._options.textSymbolEditorHolder?y.create("div",null,da._options.textSymbolEditorHolder):y.create("div",null,da._map.root);da._textSymbolEditor=new ha({graphic:S},ia);ha=da._textSymbolEditor.domNode.parentNode.id;e.set(da._textSymbolEditor.domNode,{position:"map_root"===ha?"absolute":"relative",left:"map_root"===ha?da._map.width/2-100+"px":"5px",top:"20px","z-index":50});da._textSymbolEditor.startup();da._textSymbolEditor.createForm(S);
da._textSymbolEditor.show();da._textSymbolEditor.on("symbol-change",function(){da._boxEditor&&da._boxEditor.refresh()})}})}if((F&N.MOVE)===N.MOVE||(F&N.ROTATE)===N.ROTATE||(F&N.SCALE)===N.SCALE)this._textAnchor=new U(S.geometry,this._options.textAnchorSymbol),this._scratchGL.add(this._textAnchor);return!0}}return!1},_enableMove:function(S){var F=this._map;switch(S.geometry.type){case "point":case "polyline":case "polygon":return this._graphicMover=new x(S,F,this,this._textAnchor),!0}return!1},_enableVertexEditing:function(S){var F=
this._map;switch(S.geometry.type){case "multipoint":case "polyline":case "polygon":return this._vertexEditor=I.create(S,F,this),!0}return!1},_enableBoxEditing:function(S,F,a){var D=this._map,da=S.geometry.type;return"polyline"===da||"polygon"===da||this._isTextPoint?(this._boxEditor=new h(S,D,this,F,a,this._options.uniformScaling,this._isTextPoint),!0):!1},_enableTextEditing:function(S){return this._isTextPoint?(this._textEditor=new K(S,this._map,this),Q.connect(this._textEditor,"onEditStart",t.hitch(this,
function(){this._textAnchor&&(this._textAnchor.getLayer().remove(this._textAnchor),this._textAnchor=null);this._map.disableKeyboardNavigation();this._disableMove();this._disableBoxEditing()})),!0):!1},_disableMove:function(){var S=this._graphicMover;S&&(S.destroy(),this._graphicMover=null)},_disableVertexEditing:function(){var S=this._vertexEditor;S&&(S.destroy(),this._vertexEditor=null)},_disableBoxEditing:function(){var S=this._boxEditor;S&&(S.destroy(),this._boxEditor=null)},_disableTextEditing:function(){this._textEditor&&
(this._textEditor.destroy(),this._textEditor=null);this._map.enableKeyboardNavigation()},_disableSymbolEditing:function(){this._textSymbolEditor&&this._textSymbolEditor.hide()},_clear:function(){this._disableMove();this._disableVertexEditing();this._disableBoxEditing();this._disableTextEditing();this._disableSymbolEditing();this._textAnchor&&(this._textAnchor.getLayer().remove(this._textAnchor),this._textAnchor=null);this._tool=0;this._modified=!1},_mapPanEndHandler:function(){this._refreshMoveables()},
_mapExtentChangeHandler:function(S,F,a){a&&this._refreshMoveables()},_refreshMoveables:function(S){var F=X.filter([this._graphicMover,this._vertexEditor,this._boxEditor],l.isDefined);X.forEach(F,function(a){a.refresh(S)})},_beginOperation:function(S){X.forEach(this._getAffectedTools(S),function(F){F.suspend()})},_endOperation:function(S){X.forEach(this._getAffectedTools(S),function(F){F.resume()})},_getAffectedTools:function(S){var F=[];switch(S){case "MOVE":F=[this._vertexEditor,this._boxEditor];
break;case "VERTICES":F=[this._boxEditor];break;case "BOX":F=[this._vertexEditor]}return F=X.filter(F,l.isDefined)}});t.mixin(N,{MOVE:1,EDIT_VERTICES:2,SCALE:4,ROTATE:8,EDIT_TEXT:16});H("extend-esri")&&t.setObject("toolbars.Edit",N,g);return N})},"esri/toolbars/_Box":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/_base/connect dojo/_base/Color dojo/has dojo/dom-style dojox/gfx/Moveable dojox/gfx/matrix ../kernel ../lang ../geometry/Point ../geometry/Polyline ../symbols/SimpleMarkerSymbol ../geometry/webMercatorUtils ../geometry/jsonUtils ../graphic".split(" "),
function(V,W,t,Q,X,R,H,y,e,g,l,m,n,h,x,I,K){V=V(null,{declaredClass:"esri.toolbars._Box",constructor:function(w,L,T,U,N,S,F){this._graphic=w;this._map=L;this._toolbar=T;this._scale=U;this._rotate=N;this._defaultEventArgs={};this._scaleEvent="Scale";this._rotateEvent="Rotate";this._uniformScaling=S;w=T._options;this._markerSymbol=w.boxHandleSymbol;this._lineSymbol=w.boxLineSymbol;this._moveStartHandler=W.hitch(this,this._moveStartHandler);this._firstMoveHandler=W.hitch(this,this._firstMoveHandler);
this._moveStopHandler=W.hitch(this,this._moveStopHandler);this._moveHandler=W.hitch(this,this._moveHandler);this._isTextPoint=F;this._init()},destroy:function(){this._cleanUp();this._graphic=this._map=this._toolbar=this._markerSymbol=this._lineSymbol=null},refresh:function(){this._draw()},suspend:function(){t.forEach(this._getAllGraphics(),function(w){w.hide()})},resume:function(){t.forEach(this._getAllGraphics(),function(w){w.show()});this._draw()},_init:function(){this._draw()},_cleanUp:function(){this._connects&&
t.forEach(this._connects,Q.disconnect);var w=this._toolbar._scratchGL;this._anchors&&t.forEach(this._anchors,function(L){w.remove(L.graphic);(L=L.moveable)&&L.destroy()});this._box&&w.remove(this._box);this._box=this._anchors=this._connects=null},_draw:function(){if(this._graphic.getDojoShape()){var w=this._map,L=this._toolbar._scratchGL,T=this._getBoxCoords(),U=new n(w.spatialReference),N=W.clone(t.filter(T,function(S,F){return 8!==F&&0===F%2}));N[0]&&N.push([N[0][0],N[0][1]]);U.addPath(N);this._rotate&&
U.addPath([T[1],T[8]]);this._box?this._box.setGeometry(U):(this._box=new K(U,this._lineSymbol),L.add(this._box));this._anchors?t.forEach(this._anchors,function(S,F){this._scale||(F=8);var a=new m(T[F],w.spatialReference);S.graphic.setGeometry(a);a=S.moveable;var D=S.graphic.getDojoShape();D&&(a?D!==a.shape&&(a.destroy(),S.moveable=this._getMoveable(S.graphic,F)):S.moveable=this._getMoveable(S.graphic,F))},this):(this._anchors=[],this._connects=[],t.forEach(T,function(S,F){!this._scale&&8>F||(S=new m(S,
w.spatialReference),S=new K(S,this._markerSymbol),this._isTextPoint&&1===F%2&&S.hide(),L.add(S),this._anchors.push({graphic:S,moveable:this._getMoveable(S,F)}))},this))}else this._cleanUp()},_getBoxCoords:function(w){var L=this._map,T=[],U,N,S;if(this._isTextPoint){var F=this._graphic.getNode().getBoundingClientRect();var a=L.__container.getBoundingClientRect();F=[{x:F.left-a.left,y:F.top-a.top},{x:F.right-a.left,y:F.top-a.top},{x:F.right-a.left,y:F.bottom-a.top},{x:F.left-a.left,y:F.bottom-a.top}]}else F=
this._getTransformedBoundingBox(this._graphic);t.forEach(F,function(D,da,ha){U=D;(N=ha[da+1])||(N=ha[0]);S={x:(U.x+N.x)/2,y:(U.y+N.y)/2};w||(U=L.toMap(U),S=L.toMap(S));T.push([U.x,U.y]);T.push([S.x,S.y])});this._rotate&&(F=W.clone(T[1]),F=w?{x:F[0],y:F[1]}:L.toScreen({x:F[0],y:F[1],spatialReference:L.spatialReference}),F.y-=this._toolbar._options.rotateHandleOffset,w||(F=L.toMap(F)),T.push([F.x,F.y]));return T},_getTransformedBoundingBox:function(w){var L=this._map,T=w.geometry.getExtent(),U=w.geometry.spatialReference;
w=new m(T.xmin,T.ymax,U);T=new m(T.xmax,T.ymin,U);w=L.toScreen(w);T=L.toScreen(T);return[{x:w.x,y:w.y},{x:T.x,y:w.y},{x:T.x,y:T.y},{x:w.x,y:T.y}]},_getAllGraphics:function(){var w=[this._box];this._anchors&&t.forEach(this._anchors,function(L){w.push(L.graphic)});return w=t.filter(w,l.isDefined)},_getMoveable:function(w,L){var T=w.getDojoShape();if(T)return w=new y(T),w._index=L,this._connects.push(Q.connect(w,"onMoveStart",this._moveStartHandler)),this._connects.push(Q.connect(w,"onFirstMove",this._firstMoveHandler)),
this._connects.push(Q.connect(w,"onMoveStop",this._moveStopHandler)),w.onMove=this._moveHandler,(T=T.getEventSource())&&H.set(T,"cursor",this._toolbar._cursors["box"+L]),w},_moveStartHandler:function(w){this._toolbar["on"+(8===w.host._index?this._rotateEvent:this._scaleEvent)+"Start"](this._graphic)},_firstMoveHandler:function(w){this._toolbar._deactivateScrollWheel();var L=w.host._index,T=this._wrapOffset=w.host.shape._wrapOffsets[0]||0,U=this._graphic.getLayer().getNavigationTransform();w=t.map(this._getBoxCoords(!0),
function(S){return{x:S[0]+T,y:S[1]}});var N=this._isTextPoint?this._map.toScreen(this._graphic.geometry):{x:w[1].x,y:w[3].y};this._centerCoord=e.multiplyPoint(e.invert(U),N);if(8===L)N=e.multiplyPoint(e.invert(U),w[1]),this._isTextPoint&&(this._centerCoord=this._deNormalizePoint(this._centerCoord,N)),this._startLine=[this._centerCoord,N],this._moveLine=W.clone(this._startLine);else if(N=e.multiplyPoint(e.invert(U),w[L]),U=e.multiplyPoint(e.invert(U),w[(L+4)%8]),this._isTextPoint&&(this._centerCoord=
this._deNormalizePoint(this._centerCoord,N)),this._firstMoverToAnchor=Math.sqrt((N.x-this._centerCoord.x)*(N.x-this._centerCoord.x)+(N.y-this._centerCoord.y)*(N.y-this._centerCoord.y)),this._startBox=U,this._startBox.width=w[4].x-w[0].x,this._startBox.height=w[4].y-w[0].y,this._moveBox=W.clone(this._startBox),this._xfactor=N.x>U.x?1:-1,this._yfactor=N.y>U.y?1:-1,1===L||5===L)this._xfactor=0;else if(3===L||7===L)this._yfactor=0;this._toolbar._beginOperation("BOX");this._toolbar["on"+(8===L?this._rotateEvent:
this._scaleEvent)+"FirstMove"](this._graphic)},_moveHandler:function(w,L){w=w.host._index;var T=this._defaultEventArgs;T.angle=0;T.scaleX=1;T.scaleY=1;if(8===w){var U=this._startLine;var N=this._moveLine;var S=N[1];S.x+=L.dx;S.y+=L.dy;L=this._getAngle(U,N);this._isTextPoint&&(L+=this._graphic.symbol.angle);N=e.rotategAt(L,U[0]);this._graphic.getDojoShape().setTransform(N);T.transform=N;T.angle=L;T.around=U[0]}else{U=this._startBox;N=this._moveBox;N.width+=L.dx*this._xfactor;N.height+=L.dy*this._yfactor;
this._uniformScaling||this._isTextPoint?(U=N.x+this._xfactor*N.width,N=N.y+this._yfactor*N.height,U=Math.sqrt((U-this._centerCoord.x)*(U-this._centerCoord.x)+(N-this._centerCoord.y)*(N-this._centerCoord.y)),this._scaleRatio=L=S=U/this._firstMoverToAnchor,U=this._centerCoord):(L=N.width/U.width,S=N.height/U.height,U={x:U.x,y:U.y});if(isNaN(L)||Infinity===L||-Infinity===L)L=1;if(isNaN(S)||Infinity===S||-Infinity===S)S=1;N=e.scaleAt(L,S,U);if(this._isTextPoint){var F=e.rotategAt(this._graphic.symbol.angle,
U);this._graphic.getDojoShape().setTransform([F,N])}else this._graphic.getDojoShape().setTransform(N);T.transform=N;T.scaleX=L;T.scaleY=S;T.around=U}this._toolbar["on"+(8===w?this._rotateEvent:this._scaleEvent)](this._graphic,T)},_moveStopHandler:function(w){this._toolbar._activateScrollWheel();var L=this._graphic,T=this._toolbar,U=T._geo?x.geographicToWebMercator(L.geometry):L.geometry,N=U.spatialReference,S=L.getDojoShape(),F=S.getTransform(),a=L.getLayer().getNavigationTransform();this._isTextPoint?
(L=this._graphic.symbol,8===w.host._index?L.angle+=this._getAngle(this._startLine,this._moveLine):L.font.setSize(Math.round(L.font.size*this._scaleRatio*100)/100),this._graphic.setSymbol(L)):(U=U.toJson(),this._updateSegments(U.paths||U.rings,F,a,N),S.setTransform(null),U=I.fromJson(U),L.setGeometry(T._geo?x.webMercatorToGeographic(U,!0):U));this._draw();this._startLine=this._moveLine=this._startBox=this._moveBox=this._xfactor=this._yfactor=null;T._endOperation("BOX");this._defaultEventArgs.transform=
F;T["on"+(8===w.host._index?this._rotateEvent:this._scaleEvent)+"Stop"](this._graphic,this._defaultEventArgs)},_updateSegments:function(w,L,T,U){var N=this._map,S=this._wrapOffset||0;t.forEach(w,function(F){t.forEach(F,function(a){this._updatePoint(a,U,S,e,N,T,L)},this)},this)},_updatePoint:function(w,L,T,U,N,S,F){L=N.toScreen({x:w[0],y:w[1],spatialReference:L},!0);L.x+=T;L=U.multiplyPoint([S,F,U.invert(S)],L);L.x-=T;T=N.toMap(L);w[0]=T.x;w[1]=T.y},_getAngle:function(w,L){return 180*Math.atan2(L[0].y-
L[1].y,L[0].x-L[1].x)/Math.PI-180*Math.atan2(w[0].y-w[1].y,w[0].x-w[1].x)/Math.PI},_deNormalizePoint:function(w,L){var T=this._map._getFrameWidth();if(-1===T)return w;for(w={x:w.x,y:w.y};Math.abs(w.x-L.x)>=T;)w.x=w.x<L.x?w.x+T:w.x-T;var U=Math.abs(w.x-L.x);Math.abs(w.x-L.x+T)<U?w.x+=T:Math.abs(w.x-L.x-T)<U&&(w.x-=T);return w}});R("extend-esri")&&W.setObject("toolbars._Box",V,g);return V})},"dojox/gfx/Moveable":function(){define("dojo/_base/lang dojo/_base/declare dojo/_base/array dojo/_base/event dojo/topic dojo/touch dojo/dom-class dojo/_base/window ./Mover dojo/mouse".split(" "),
function(V,W,t,Q,X,R,H,y,e,g){return W("dojox.gfx.Moveable",null,{constructor:function(l,m){this.shape=l;this.delay=m&&0<m.delay?m.delay:0;this.mover=m&&m.mover?m.mover:e;this.leftButtonOnly=m&&m.leftButtonOnly;this.events=[this.shape.on(R.press,V.hitch(this,"onMouseDown"))]},destroy:function(){t.forEach(this.events,function(l){l.remove()});this.events=this.shape=null},onMouseDown:function(l){this.delay?(this.events.push(this.shape.on(R.move,V.hitch(this,"onMouseMove")),this.shape.on(R.release,V.hitch(this,
"onMouseUp"))),this._lastX=l.clientX,this._lastY=l.clientY):this.leftButtonOnly&&!g.isLeft(l)||new this.mover(this.shape,l,this);Q.stop(l)},onMouseMove:function(l){var m=l.clientY;if(Math.abs(l.clientX-this._lastX)>this.delay||Math.abs(m-this._lastY)>this.delay)this.onMouseUp(l),new this.mover(this.shape,l,this);Q.stop(l)},onMouseUp:function(l){this.events.pop().remove()},onMoveStart:function(l){X.publish("/gfx/move/start",l);H.add(y.body(),"dojoMove")},onMoveStop:function(l){X.publish("/gfx/move/stop",
l);H.remove(y.body(),"dojoMove")},onFirstMove:function(l){},onMove:function(l,m,n){this.onMoving(l,m,n);this.shape.applyLeftTransform(m);this.onMoved(l,m)},onMoving:function(l,m){},onMoved:function(l,m){}})})},"dojox/gfx/Mover":function(){define("dojo/_base/lang dojo/_base/array dojo/_base/declare dojo/on dojo/touch dojo/_base/event".split(" "),function(V,W,t,Q,X,R){return t("dojox.gfx.Mover",null,{constructor:function(H,y,e){this.shape=H;this.lastX=y.clientX;this.lastY=y.clientY;H=this.host=e;y=
document;e=Q(y,X.move,V.hitch(this,"onFirstMove"));this.events=[Q(y,X.move,V.hitch(this,"onMouseMove")),Q(y,X.release,V.hitch(this,"destroy")),Q(y,"dragstart",V.hitch(R,"stop")),Q(y,"selectstart",V.hitch(R,"stop")),e];if(H&&H.onMoveStart)H.onMoveStart(this)},onMouseMove:function(H){var y=H.clientX,e=H.clientY;this.host.onMove(this,{dx:y-this.lastX,dy:e-this.lastY},H);this.lastX=y;this.lastY=e;R.stop(H)},onFirstMove:function(){this.host.onFirstMove(this);this.events.pop().remove()},destroy:function(){W.forEach(this.events,
function(y){y.remove()});var H=this.host;if(H&&H.onMoveStop)H.onMoveStop(this);this.events=this.shape=null}})})},"esri/toolbars/_GraphicMover":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/connect dojo/_base/json dojo/dom-style dojox/gfx/Moveable dojox/gfx/Mover dojox/gfx/matrix ../kernel ../PointerEvents ../sniff ../geometry/webMercatorUtils ../geometry/ScreenPoint ../geometry/Point".split(" "),function(V,W,t,Q,X,R,H,y,e,g,l,m,n,h){var x=V(null,{declaredClass:"esri.toolbars._GraphicMover",
constructor:function(I,K,w,L){this.graphic=I;this.map=K;this.toolbar=w;this.tempPt=L;this._enableGraphicMover();this._moved=!1},refresh:function(I){var K=this.graphic.getDojoShape();!K||!I&&K._hostGraphic||(this._disableGraphicMover(),this._enableGraphicMover())},destroy:function(){this._disableGraphicMover()},hasMoved:function(){return this._moved},_enableGraphicMover:function(){var I=this.graphic,K=I.getDojoShape();K&&(K._hostGraphic=I,this._moveable=new R(K,{mover:x.Mover}),this._moveStartHandle=
t.connect(this._moveable,"onMoveStart",this,this._moveStartHandler),this._firstMoveHandle=t.connect(this._moveable,"onFirstMove",this,this._firstMoveHandler),this._movingHandle=t.connect(this._moveable,"onMoving",this,this._movingHandler),this._moveStopHandle=t.connect(this._moveable,"onMoveStop",this,this._moveStopHandler),(I=K.getEventSource())&&X.set(I,"cursor",this.toolbar._cursors.move))},_disableGraphicMover:function(){var I=this._moveable;if(I){t.disconnect(this._moveStartHandle);t.disconnect(this._firstMoveHandle);
t.disconnect(this._movingHandle);t.disconnect(this._moveStopHandle);var K=I.shape;K&&(K._hostGraphic=null,(K=K.getEventSource())&&X.set(K,"cursor","inherit"));I.destroy()}this._moveable=null},_moveStartHandler:function(){var I=this.graphic,K=this.map;this._startTx=I.getDojoShape().getTransform();"point"===this.graphic.geometry.type&&K.snappingManager&&K.snappingManager._setUpSnapping();this.toolbar.onGraphicMoveStart(I)},_firstMoveHandler:function(){this.toolbar._beginOperation("MOVE");this.toolbar.onGraphicFirstMove(this.graphic)},
_movingHandler:function(I,K,w){I=I.shape.getTransform();K=this.map;var L;l("esri-pointer")?L=K.navigationManager.pointerEvents._processTouchEvent(w,w):w&&"pointermove"===w.type&&(L=g.prototype._processTouchEvent.call({map:K},w,w));L&&K.snappingManager&&K.snappingManager._onSnappingMouseMoveHandler(L);this.tempPt&&this.tempPt.getDojoShape().setTransform(I);this.toolbar.onGraphicMove(this.graphic,I)},_moveStopHandler:function(I){var K=this.graphic,w=this.toolbar,L=this.map,T=w._geo?m.geographicToWebMercator(K.geometry):
K.geometry,U=T.type,N=K.getDojoShape(),S=N.getTransform();if(Q.toJson(S)!==Q.toJson(this._startTx)){this._moved=!0;switch(U){case "point":U=[S,y.invert(this._startTx)];if(L.snappingManager)var F=L.snappingManager._snappingPoint;T=F||L.toMap(y.multiplyPoint(U,L.toScreen(T,!0)));L.snappingManager&&L.snappingManager._killOffSnapping();break;case "polyline":T=this._updatePolyGeometry(T,T.paths,S);break;case "polygon":T=this._updatePolyGeometry(T,T.rings,S)}N.setTransform(null);K.setGeometry(w._geo?m.webMercatorToGeographic(T,
!0):T);this.tempPt&&this.tempPt.setGeometry(new h(K.geometry.toJson()))}else this._moved=!1;w._endOperation("MOVE");w.onGraphicMoveStop(K,S);this._moved||(I=I.__e,L=this.map.position,I=new n(I.pageX-L.x,I.pageY-L.y),w.onGraphicClick(K,{screenPoint:I,mapPoint:this.map.toMap(I)}))},_updatePolyGeometry:function(I,K,w){var L=this.map,T=I.getPoint(0,0);L=L.toMap(L.toScreen(T).offset(w.dx,w.dy));w=L.x-T.x;T=L.y-T.y;var U;for(L=0;L<K.length;L++){var N=K[L];for(U=0;U<N.length;U++){var S=I.getPoint(L,U);I.setPoint(L,
U,S.offset(w,T))}}return I}});x.Mover=V(H,{declaredClass:"esri.toolbars._Mover",constructor:function(I,K,w){this.__e=K}});l("extend-esri")&&(W.setObject("toolbars._GraphicMover",x,e),W.setObject("toolbars._Mover",x.Mover,e));return x})},"esri/toolbars/_VertexEditor":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/connect dojo/_base/array dojo/has dijit/Menu dijit/MenuItem ../kernel ./_VertexMover ../geometry/Point ../geometry/jsonUtils dojo/i18n!../nls/jsapi".split(" "),function(V,
W,t,Q,X,R,H,y,e,g,l,m){var n=V(null,{declaredClass:"esri.toolbars._GraphicVertexEditor",constructor:function(h,x,I){this.graphic=h;this.map=x;this.toolbar=I;h=I._options;this._symbol1=h.vertexSymbol;this._symbol2=h.ghostVertexSymbol;x=h.ghostLineSymbol;this._lineStroke={style:x.style,width:x.width,color:x.color};this._canDel=h.allowDeleteVertices;this._canAdd=h.allowAddVertices;this._addControllers()},destroy:function(){this._removeControllers()},refresh:function(h){h?(this._removeControllers(),this._addControllers()):
(this._refresh(this._vertexMovers),this._refresh(this._mpVertexMovers))},suspend:function(){this._suspended||this._removeControllers();this._suspended=!0},resume:function(){this._suspended&&this._addControllers();this._suspended=!1},_addControllers:function(){this._firstMoveHandle=t.connect(e,"onFirstMove",this,this._firstMoveHandler);this._moveStopHandle=t.connect(e,"onMoveStop",this,this._moveStopHandler);this._vertexMovers=this._add(this._getSegments(this.graphic.geometry),this._symbol1);this._canAdd&&
(this._mpVertexMovers=this._add(this._getMidpointSegments(this.graphic.geometry),this._symbol2,!0));var h=this._getGraphicsLayer();this._mouseOverHandle=t.connect(h,"onMouseOver",this,this._mouseOverHandler);this._mouseOutHandle=t.connect(h,"onMouseOut",this,this._mouseOutHandler);this._canDel&&(this._ctxMenu=new R({style:"font-size: 12px; margin-left: 5px; margin-top: 5px;"}),h=this._ctxDelete=new H({label:m.toolbars.edit.deleteLabel,iconClass:"vertexDeleteIcon",style:"outline: none;"}),this._deleteHandle=
t.connect(h,"onClick",this,this._deleteHandler),this._ctxMenu.addChild(h),this._ctxMenu.startup())},_removeControllers:function(){t.disconnect(this._firstMoveHandle);t.disconnect(this._moveStopHandle);t.disconnect(this._mouseOverHandle);t.disconnect(this._mouseOutHandle);t.disconnect(this._deleteHandle);this._ctxMenu&&(this._ctxDelete=null,this._unbindCtxNode(),this._ctxMenu.destroyRecursive());this._remove(this._vertexMovers);this._remove(this._mpVertexMovers);this._vertexMovers=this._mpVertexMovers=
null},_add:function(h,x,I){var K,w,L=this.graphic,T=[];for(K=0;K<h.length;K++){var U=h[K],N=[];for(w=0;w<U.length;w++)N.push(new e(U[w],x,L,K,w,U.length,this,I));T.push(N)}return T},_remove:function(h){h&&Q.forEach(h,function(x){Q.forEach(x,function(I){I.destroy()})})},_refresh:function(h){h&&Q.forEach(h,function(x){Q.forEach(x,function(I){I.refresh()})})},_isNew:function(h){return-1===Q.indexOf(this._vertexMovers[h.segIndex],h)?!0:!1},_getGraphicsLayer:function(){return this.toolbar._scratchGL},
_deleteHandler:function(h){h=this._selectedMover;this._updateRelatedGraphic(h,h.relatedGraphic,h.graphic.geometry,h.segIndex,h.ptIndex,h.segLength,!1,!0);this._canAdd&&this._deleteMidpoints(h);this._deleteVertex(h);this.toolbar._endOperation("VERTICES")},_mouseOverHandler:function(h){h=h.graphic;var x=this._findMover(h);x&&(this.toolbar.onVertexMouseOver(this.graphic,x._getInfo()),x._placeholder||(this._selectedMover=x,this._canDel&&this._bindCtxNode(h.getDojoShape().getNode())))},_mouseOutHandler:function(h){if(h=
this._findMover(h.graphic))this.toolbar.onVertexMouseOut(this.graphic,h._getInfo())},_bindCtxNode:function(h){this._unbindCtxNode();this._ctxDelete.set("disabled",this._selectedMover.segLength<=this.minLength?!0:!1);this._ctxMenu.bindDomNode(h);this._bindNode=h},_unbindCtxNode:function(){var h=this._bindNode;h&&this._ctxMenu.unBindDomNode(h)},_findMover:function(h){var x=[];var I=this._mpVertexMovers;Q.forEach(this._vertexMovers,function(w){x=x.concat(w)});I&&Q.forEach(I,function(w){x=x.concat(w)});
for(I=0;I<x.length;I++){var K=x[I];if(K.graphic===h)return K}},_firstMoveHandler:function(h){!this._isNew(h)&&this._canAdd&&this._hideRelatedMidpoints(h);this.toolbar._beginOperation("VERTICES")},_moveStopHandler:function(h,x){var I=this._isNew(h);x&&(x.dx||x.dy)?(this._updateRelatedGraphic(h,h.relatedGraphic,h.graphic.geometry,h.segIndex,h.ptIndex,h.segLength,I),this._canAdd&&(I?this._addMidpoints(h):(this._repositionRelatedMidpoints(h),this._showRelatedMidpoints(h))),this.toolbar._endOperation("VERTICES")):
!I&&this._canAdd&&this._showRelatedMidpoints(h)},_showRelatedMidpoints:function(h){var x=this._getAdjacentMidpoints(h.ptIndex,h.segLength),I=this._mpVertexMovers[h.segIndex];for(h=0;h<x.length;h++){var K=I[x[h]];K.graphic.show();K.refresh()}},_hideRelatedMidpoints:function(h){var x=this._getAdjacentMidpoints(h.ptIndex,h.segLength),I=this._mpVertexMovers[h.segIndex];for(h=0;h<x.length;h++)I[x[h]].graphic.hide()},_repositionRelatedMidpoints:function(h){var x,I=this._getAdjacentMidpoints(h.ptIndex,h.segLength),
K=this._mpVertexMovers[h.segIndex];for(x=0;x<I.length;x++){var w=this._getAdjacentVertices(I[x],h.segLength),L=h.relatedGraphic.geometry.getPoint(h.segIndex,w[0]);w=h.relatedGraphic.geometry.getPoint(h.segIndex,w[1]);L=new g({x:(L.x+w.x)/2,y:(L.y+w.y)/2,spatialReference:L.spatialReference.toJson()});K[I[x]].graphic.setGeometry(L)}},_addMidpoints:function(h){var x=h.segIndex,I=h.ptIndex,K=h.segLength,w=I+1,L,T=K+1;this._mpVertexMovers[x].splice(I,1);var U=this._vertexMovers[x];for(L=0;L<w;L++)U[L].segLength+=
1;for(L=w;L<U.length;L++)U[L].ptIndex+=1,U[L].segLength+=1;h.ptIndex=w;h.segLength=U.length+1;U.splice(w,0,h);h.graphic.setSymbol(this._symbol1);U=this._mpVertexMovers[x];for(L=0;L<I;L++)U[L].segLength+=1;for(L=I;L<K-1;L++)U[L].ptIndex+=1,U[L].segLength+=1;w=this._getAdjacentVertices(I,T);x=this._getAdjacentVertices(I+1,T);K=h.relatedGraphic.geometry.getPoint(h.segIndex,w[0]);L=h.relatedGraphic.geometry.getPoint(h.segIndex,w[1]);w=new g({x:(K.x+L.x)/2,y:(K.y+L.y)/2,spatialReference:K.spatialReference.toJson()});
K=h.relatedGraphic.geometry.getPoint(h.segIndex,x[0]);L=h.relatedGraphic.geometry.getPoint(h.segIndex,x[1]);x=new g({x:(K.x+L.x)/2,y:(K.y+L.y)/2,spatialReference:K.spatialReference.toJson()});K=new e(w,this._symbol2,this.graphic,h.segIndex,I,T,this,!0);h=new e(x,this._symbol2,this.graphic,h.segIndex,I+1,T,this,!0);U.splice(I,0,K,h)},_deleteVertex:function(h){var x,I=h.ptIndex,K=this._vertexMovers[h.segIndex];for(x=0;x<I;x++)--K[x].segLength;for(x=I+1;x<K.length;x++){var w=K[x];--w.ptIndex;--w.segLength}K.splice(I,
1);x=h._getInfo();h.destroy();this.toolbar.onVertexDelete(this.graphic,x)}});W.mixin(n,{create:function(h,x,I){switch(h.geometry.type){case "multipoint":return new n.MultipointVertexEditor(h,x,I);case "polyline":return new n.PolylineVertexEditor(h,x,I);case "polygon":return new n.PolygonVertexEditor(h,x,I)}}});n.MultipointVertexEditor=V(n,{declaredClass:"esri.toolbars._MultipointVertexEditor",minLength:1,constructor:function(){this._moveStartHandle=t.connect(e,"onMoveStart",this,this._moveStartHandler);
t.disconnect(this._firstMoveHandle)},destroy:function(){this.inherited(arguments);t.disconnect(this._moveStartHandle)},_getSegments:function(h){var x=h.points,I=[],K=h.spatialReference;for(h=0;h<x.length;h++){var w=x[h];I.push(new g({x:w[0],y:w[1],spatialReference:K.toJson()}))}return[I]},_getMidpointSegments:function(h){return[]},_getControlPoints:function(h,x,I,K,w){return[]},_getGraphicsLayer:function(){return this.graphic._graphicsLayer},_mouseOverHandler:function(h){var x=h.graphic;if(h=this._findMover(h))this.toolbar.onVertexMouseOver(x,
h._getInfo()),this._selectedMover=h,this._canDel&&this._bindCtxNode(h.graphic.getDojoShape().getNode())},_mouseOutHandler:function(h){var x=h.graphic;if(h=this._findMover(h))this.toolbar.onVertexMouseOut(x,h._getInfo())},_findMover:function(h){var x=[].concat(this._vertexMovers[0]),I=h.target;for(h=0;h<x.length;h++){var K=x[h];if(K.graphic.getDojoShape().getNode()===I)return K}},_moveStartHandler:function(h){var x=h.ptIndex,I=h.segLength-1,K=h.relatedGraphic.geometry.points;h=K.splice(x,1);K.push(h[0]);
K=this._vertexMovers[0];for(h=I;h>x;h--)--K[h].ptIndex;h=K.splice(x,1);K.push(h[0]);h[0].ptIndex=I},_moveStopHandler:function(h){this._updateRelatedGraphic(h,h.relatedGraphic,h.graphic.geometry,h.segIndex,h.ptIndex,h.segLength);this.toolbar._endOperation("VERTICES")},_updateRelatedGraphic:function(h,x,I,K,w,L,T,U){h=x.geometry;U?h.removePoint(w):h.setPoint(w,I);x.setGeometry(h)},_deleteMidpoints:function(h){}});n.PolylineVertexEditor=V(n,{declaredClass:"esri.toolbars._PolylineVertexEditor",minLength:2,
_getSegments:function(h){var x,I,K=h.paths,w=[];for(x=0;x<K.length;x++){var L=K[x],T=[];for(I=0;I<L.length;I++)T.push(h.getPoint(x,I));w.push(T)}return w},_getMidpointSegments:function(h){var x,I,K=h.paths,w=[],L=h.spatialReference;for(x=0;x<K.length;x++){var T=K[x],U=[];for(I=0;I<T.length-1;I++){var N=h.getPoint(x,I),S=h.getPoint(x,I+1);N=new g({x:(N.x+S.x)/2,y:(N.y+S.y)/2,spatialReference:L.toJson()});U.push(N)}w.push(U)}return w},_getControlPoints:function(h,x,I,K,w){var L=this.map,T,U;this._isNew(h)?
(h=K,K+=1,0<=h&&(T=L.toScreen(x.getPoint(I,h))),K<=w&&(U=L.toScreen(x.getPoint(I,K)))):(h=K-1,K+=1,0<=h&&(T=L.toScreen(x.getPoint(I,h))),K<w&&(U=L.toScreen(x.getPoint(I,K))));return[T,U]},_getAdjacentMidpoints:function(h,x){var I=[],K=h-1;0<=K&&I.push(K);h<x-1&&I.push(h);return I},_getAdjacentVertices:function(h,x){return[h,h+1]},_deleteMidpoints:function(h){var x=this._mpVertexMovers[h.segIndex],I=x.length-1,K=this._getAdjacentMidpoints(h.ptIndex,h.segLength).sort(),w,L=K[0];for(w=0;w<L;w++)--x[w].segLength;
for(w=L+1;w<x.length;w++){var T=x[w];--T.ptIndex;--T.segLength}if(1===K.length)x.splice(L,1)[0].destroy();else for(T=this._getAdjacentVertices(L,I),w=h.relatedGraphic.geometry.getPoint(h.segIndex,T[0]),T=h.relatedGraphic.geometry.getPoint(h.segIndex,T[1]),w=new g({x:(w.x+T.x)/2,y:(w.y+T.y)/2,spatialReference:w.spatialReference.toJson()}),h=new e(w,this._symbol2,this.graphic,h.segIndex,L,I,this,!0),x=x.splice(L,K.length,h),w=0;w<x.length;w++)x[w].destroy()},_updateRelatedGraphic:function(h,x,I,K,w,
L,T,U){h=x.geometry;T?h.insertPoint(K,w+1,l.fromJson(I.toJson())):U?h.removePoint(K,w):h.setPoint(K,w,l.fromJson(I.toJson()));x.setGeometry(h)}});n.PolygonVertexEditor=V(n,{declaredClass:"esri.toolbars._PolygonVertexEditor",minLength:3,_getSegments:function(h){var x,I,K=h.rings,w=[];for(x=0;x<K.length;x++){var L=K[x],T=[];for(I=0;I<L.length-1;I++)T.push(h.getPoint(x,I));w.push(T)}return w},_getMidpointSegments:function(h){var x,I,K=h.rings,w=[],L=h.spatialReference;for(x=0;x<K.length;x++){var T=K[x],
U=[];for(I=0;I<T.length-1;I++){var N=h.getPoint(x,I),S=h.getPoint(x,I+1);N=new g({x:(N.x+S.x)/2,y:(N.y+S.y)/2,spatialReference:L.toJson()});U.push(N)}w.push(U)}return w},_getControlPoints:function(h,x,I,K,w){var L=this.map;this._isNew(h)?h=K:(h=K-1,h=0>h?(w+h)%w:h);K=(K+1)%w;w=L.toScreen(x.getPoint(I,h));x=L.toScreen(x.getPoint(I,K));return[w,x]},_getAdjacentMidpoints:function(h,x){var I=h-1;return[0>I?(x+I)%x:I,h]},_getAdjacentVertices:function(h,x){return[h,(h+1)%x]},_deleteMidpoints:function(h){var x=
h.ptIndex,I=this._mpVertexMovers[h.segIndex],K=I.length-1,w=this._getAdjacentMidpoints(x,h.segLength).sort();var L=w[0];var T=w[w.length-1];if(0===x){var U=this._getAdjacentVertices(K-1,K);x=h.relatedGraphic.geometry.getPoint(h.segIndex,U[0]);U=h.relatedGraphic.geometry.getPoint(h.segIndex,U[1]);x=new g({x:(x.x+U.x)/2,y:(x.y+U.y)/2,spatialReference:x.spatialReference.toJson()});h=new e(x,this._symbol2,this.graphic,h.segIndex,K-1,K,this,!0);I.splice(T,1,h)[0].destroy();I.splice(L,1)[0].destroy();for(w=
0;w<I.length-1;w++)L=I[w],--L.ptIndex,--L.segLength}else{U=this._getAdjacentVertices(L,K);x=h.relatedGraphic.geometry.getPoint(h.segIndex,U[0]);U=h.relatedGraphic.geometry.getPoint(h.segIndex,U[1]);x=new g({x:(x.x+U.x)/2,y:(x.y+U.y)/2,spatialReference:x.spatialReference.toJson()});h=new e(x,this._symbol2,this.graphic,h.segIndex,L,K,this,!0);T=I.splice(L,w.length,h);for(w=0;w<T.length;w++)T[w].destroy();for(w=0;w<L;w++)--I[w].segLength;for(w=L+1;w<I.length;w++)L=I[w],--L.ptIndex,--L.segLength}},_updateRelatedGraphic:function(h,
x,I,K,w,L,T,U){h=x.geometry;T?h.insertPoint(K,w+1,l.fromJson(I.toJson())):U?(h.removePoint(K,w),0===w&&h.setPoint(K,L-1,l.fromJson(h.getPoint(K,0).toJson()))):(h.setPoint(K,w,l.fromJson(I.toJson())),0===w&&h.setPoint(K,L,l.fromJson(I.toJson())));x.setGeometry(h)}});X("extend-esri")&&(W.setObject("toolbars._GraphicVertexEditor",n,y),W.setObject("toolbars._MultipointVertexEditor",n.MultipointVertexEditor,y),W.setObject("toolbars._PolylineVertexEditor",n.PolylineVertexEditor,y),W.setObject("toolbars._PolygonVertexEditor",
n.PolygonVertexEditor,y));return n})},"esri/toolbars/_VertexMover":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/connect dojo/sniff dojo/dom-style dojox/gfx/Moveable dojox/gfx/matrix ../kernel ../PointerEvents ../sniff ../geometry/Point ../graphic ../geometry/webMercatorUtils".split(" "),function(V,W,t,Q,X,R,H,y,e,g,l,m,n){V=V(null,{declaredClass:"esri.toolbars.VertexMover",constructor:function(h,x,I,K,w,L,T,U){this.point=h;this.symbol=x;this.relatedGraphic=I;this.segIndex=K;this.ptIndex=
w;this.segLength=L;this.editor=T;this.map=T.map;this._scratchGL=T.toolbar._scratchGL;this._placeholder=U||!1;this._type=I.geometry.type;this._init();this._enable()},refresh:function(h){if(h||this._needRefresh())this._disable(),this._enable()},destroy:function(){this._disable();this.graphic&&this._scratchGL.remove(this.graphic);this.point=this.symbol=this.graphic=this.relatedGraphic=this.segIndex=this.ptIndex=this.segLength=this.editor=this.map=this._scratchGL=null},_init:function(){var h=new l(this.point.toJson());
h=new m(h,this.symbol);switch(this._type){case "multipoint":h._shape=this.relatedGraphic.getDojoShape().children[this.ptIndex];break;case "polyline":case "polygon":this._scratchGL.add(h)}this.graphic=h},_enable:function(){var h=this.graphic.getDojoShape();h&&(h._hasMover=!0,this._moveable=this._getMoveable(h),(h=h.getEventSource())&&X.set(h,"cursor",this.editor.toolbar._cursors[this._placeholder?"move-gv":"move-v"]))},_disable:function(){var h=this._moveable;if(h){t.disconnect(this._startHandle);
t.disconnect(this._firstHandle);t.disconnect(this._movingHandle);t.disconnect(this._stopHandle);var x=h.shape;x&&(x=x.getEventSource())&&X.set(x,"cursor","inherit");h.destroy();this._moveable=null}},_needRefresh:function(){var h=this.graphic.getDojoShape(),x=!1;if(h)switch(this._type){case "multipoint":var I=this.relatedGraphic.getDojoShape();I&&(I=I.children[this.ptIndex],h!==I&&(this.graphic._shape=I,x=!0));break;case "polyline":case "polygon":x=!h._hasMover}return x},_getMoveable:function(h){h=
new R(h,Q("mac")&&Q("ff")&&!g("esri-touch")&&{leftButtonOnly:!0});this._startHandle=t.connect(h,"onMoveStart",this,this._moveStartHandler);this._firstHandle=t.connect(h,"onFirstMove",this,this._firstMoveHandler);this._movingHandle=t.connect(h,"onMoving",this,this._movingHandler);this._stopHandle=t.connect(h,"onMoveStop",this,this._moveStopHandler);return h},_getPtIndex:function(){return this.ptIndex+(this._placeholder?1:0)},_getInfo:function(){return{graphic:this.graphic,isGhost:this._placeholder,
segmentIndex:this.segIndex,pointIndex:this._getPtIndex()}},_moveStartHandler:function(h){var x=this.map;x.snappingManager&&x.snappingManager._setUpSnapping();this.editor.toolbar._deactivateScrollWheel();this._startTx=this.graphic.getDojoShape().getTransform();h.shape.moveToFront();this.constructor.onMoveStart(this);this.editor.toolbar.onVertexMoveStart(this.relatedGraphic,this._getInfo())},_firstMoveHandler:function(h){var x=h.shape,I=this._getControlEdges(),K=this._scratchGL._div,w,L=[],T=h.host.shape._wrapOffsets[0]||
0;for(w=0;w<I.length;w++){var U=I[w];U.x1+=T;U.x2+=T;L.push([K.createLine({x1:U.x1,y1:U.y1,x2:U.x2,y2:U.y2}).setStroke(this.editor._lineStroke),U.x1,U.y1,U.x2,U.y2])}x._lines=L;h.shape.moveToFront();this.constructor.onFirstMove(this);this.editor.toolbar.onVertexFirstMove(this.relatedGraphic,this._getInfo())},_movingHandler:function(h,x,I){x=this.map;var K;g("esri-pointer")?K=x.navigationManager.pointerEvents._processTouchEvent(I,I):I&&"pointermove"===I.type&&(K=e.prototype._processTouchEvent.call({map:x},
I,I));K&&x.snappingManager&&x.snappingManager._onSnappingMouseMoveHandler(K);I=h.shape;h=I.getTransform();I=I._lines;for(K=0;K<I.length;K++)x=I[K],x[0].setShape({x1:x[1]+h.dx,y1:x[2]+h.dy,x2:x[3],y2:x[4]});this.editor.toolbar.onVertexMove(this.relatedGraphic,this._getInfo(),h)},_moveStopHandler:function(h){h=h.shape;var x=this.editor.toolbar,I=h.getTransform(),K=this.map,w=this.graphic,L=x._geo?n.geographicToWebMercator(w.geometry):w.geometry;x._activateScrollWheel();var T,U=h._lines;if(U){for(T=
0;T<U.length;T++)U[T][0].removeShape();h._lines=null}T=!1;U=!0;var N=this._getInfo();I&&(I.dx||I.dy)?this._placeholder&&(this._placeholder=!1,T=!0):U=!1;if(K.snappingManager)var S=K.snappingManager._snappingPoint;var F=[I,H.invert(this._startTx)];S=S||K.toMap(H.multiplyPoint(F,K.toScreen(L,!0)));K.snappingManager&&K.snappingManager._killOffSnapping();h.setTransform(null);w.setGeometry(x._geo?n.webMercatorToGeographic(S,!0):S);this.constructor.onMoveStop(this,I);x.onVertexMoveStop(this.relatedGraphic,
N,I);if(!U)x.onVertexClick(this.relatedGraphic,N);if(T)x.onVertexAdd(this.relatedGraphic,this._getInfo())},_getControlEdges:function(){var h=this.map,x=this.relatedGraphic.geometry,I=this.segIndex,K=this.ptIndex,w=this.segLength,L=this._scratchGL.getNavigationTransform(),T=L.dx;L=L.dy;var U=h.toScreen(this.graphic.geometry);h=U.x-T;U=U.y-L;var N=[];x=this.editor._getControlPoints(this,x,I,K,w);x[0]&&N.push({x1:h,y1:U,x2:x[0].x-T,y2:x[0].y-L});x[1]&&N.push({x1:h,y1:U,x2:x[1].x-T,y2:x[1].y-L});return N}});
g("extend-esri")&&W.setObject("toolbars.VertexMover",V,y);W.mixin(V,{onMoveStart:function(){},onFirstMove:function(){},onMoveStop:function(){}});return V})},"esri/toolbars/TextEditor":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/connect dojo/_base/event dojo/has dojo/dom-construct dojo/dom-class dojo/dom-style dojo/keys ../kernel".split(" "),function(V,W,t,Q,X,R,H,y,e,g){V=V(null,{declaredClass:"esri.toolbars.TextEditor",constructor:function(l,m,n){this._graphic=l;this._map=m;
this._toolbar=n;this._enable(this._graphic)},destroy:function(){this._disable()},onEditStart:function(){},onEditEnd:function(){},_enable:function(l){this._editBox?(t.disconnect(this._addEditBoxHandler),this._addEditBoxHandler=null):(this._map.navigationManager.setImmediateClick(!0),this._addEditBoxHandler=t.connect(l.getLayer(),"onDblClick",this,function(m){this._map.navigationManager.setImmediateClick(!1);m.graphic==l&&(Q.stop(m),t.disconnect(this._addEditBoxHandler),this._addEditBoxHandler=null,
this._addTextBox(l))}))},_disable:function(){this._applyEdit();this._addEditBoxHandler&&(t.disconnect(this._addEditBoxHandler),this._addEditBoxHandler=null);this._removeTextBox();this.onEditEnd(this._graphic);this._toolbar.onTextEditEnd(this._graphic)},_addTextBox:function(l,m){if(!this._editBox){if(!l.symbol.text){l.symbol.text="Tempt text";l.setSymbol(l.symbol);var n=""}var h=this._createInputTextStyle(l,this._map);""!==n&&(n=m||l.symbol.text);this._editBox=R.create("input",{type:"text",value:n});
y.set(this._editBox,h);H.add(this._editBox,"esriTextEditorInput");this._map.container.appendChild(this._editBox);this._editBox.focus();this._editBoxKeyHandler=t.connect(this._editBox,"onkeyup",W.hitch(this,function(I){I.keyCode!=e.ENTER&&I.keyCode!==e.TAB||this._disable()}));this._editBoxBlurHandler=t.connect(this._editBox,"onblur",W.hitch(this,function(I){this._disable()}));l.symbol.text="";l.setSymbol(l.symbol);l.hide();var x=this._editBox;this._disableBoxHandler||(this._disableBoxHandler=this._map.on("zoom-start",
W.hitch(this,function(){this._disable()})));this._moveBoxHandler=this._map.on("pan",function(I){y.set(x,{left:this._editBoxLeft+I.delta.x+"px",top:this._editBoxTop+I.delta.y+"px"})});this._moveBoxStartHandler=this._map.on("pan-start",function(){this._editBoxLeft=parseFloat(y.get(x,"left"));this._editBoxTop=parseFloat(y.get(x,"top"))});this.onEditStart(l,this._editBox);this._toolbar.onTextEditStart(l,this._editBox)}},_removeTextBox:function(){this._editBoxBlurHandler&&(t.disconnect(this._editBoxBlurHandler),
this._editBoxBlurHandler=null);this._editBox&&(this._editBox.parentNode.removeChild(this._editBox),this._editBox=null);this._disableBoxHandler&&(this._disableBoxHandler.remove(),this._disableBoxHandler=null);this._moveBoxHandler&&(this._moveBoxHandler.remove(),this._moveBoxHandler=null);this._moveBoxStartHandler&&(this._moveBoxStartHandler.remove(),this._moveBoxStartHandler=null);this._editBoxKeyHandler&&(t.disconnect(this._editBoxKeyHandler),this._editBoxKeyHandler=null)},_createInputTextStyle:function(l,
m){m=l.getDojoShape().getTransformedBoundingBox();var n=l.getLayer();n=n.hasLocalNavigationTransform()?{dx:0,dy:0}:n.getNavigationTransform();var h=l.symbol.font;return{"font-family":h.family,"font-size":h.size+"px","font-style":h.style,"font-variant":h.variant,"font-weight":h.weight,left:m[0].x+n.dx+"px",top:m[0].y+n.dy+"px",width:Math.abs(m[0].x-m[1].x)/Math.cos(l.symbol.angle/180*Math.PI)+"px"}},_applyEdit:function(){if(this._editBox)if(this._editBox.value){this._graphic.show();var l=this._graphic.symbol;
l.text=this._editBox.value;this._graphic.setSymbol(l)}else this._graphic.getLayer().remove(this._graphic)}});X("extend-esri")&&W.setObject("toolbars.TextEditor",V,g);return V})},"jimu/dijit/EditorXssFilter":function(){define("dojo/_base/declare dojo/_base/array dijit/_WidgetBase dojo/_base/lang dojo/Evented libs/arcgis-html-sanitizer/arcgis-html-sanitizer".split(" "),function(V,W,t,Q,X,R){var H=null,y=V([t,X],{baseClass:"jimu-editor-xss-filter",declaredClass:"jimu.dijit.EditorXssFilter",sanitizer:null,
xss:null,whiteList:{},graphicsWhiteList:{},postCreate:function(){this.whiteList=this._getWhiteList();this.sanitizer=new R({whiteList:this.whiteList,safeAttrValue:Q.hitch(this,function(e,g,l,m){return"style"===g?this.xss.friendlyAttrValue(l).replace(/"/g,"'"):"img"===e&&"src"===g?this.xss.escapeAttrValue(l):this.xss.safeAttrValue(e,g,l,m)}),onTag:Q.hitch(this,function(e,g,l){if(l.isWhite&&this._isInWhiteList(e,this.graphicsWhiteList))return g}),onIgnoreTagAttr:Q.hitch(this,function(e,g,l,m){if("data-"===
g.substr(0,5))return g+'\x3d"'+this.xss.escapeAttrValue(l)+'"'}),onIgnoreTag:Q.hitch(this,function(e,g,l){if("o:"===e.substr(0,2)||"!--[if"===e||"!--[endif]--"===e)return g})},!0);this.xss=this.sanitizer.xss},sanitize:function(e){return this.sanitizer.sanitize(e)},_getWhiteList:function(){var e="title height width class style font-family id align text-align".split(" "),g={div:e,h1:e,h2:e,h3:e,h4:e,h5:e,h6:e,span:e,p:e,s:e,strong:e,em:e,u:e,ol:e,ul:e,li:e,a:["href","target"].concat(e),img:["src","alt",
"border"].concat(e),blockquote:e,font:["face","size","color"].concat(e),pre:e,code:e,b:e,i:e,wbr:e,video:"autoplay controls loop muted poster preload".split(" ").concat(e),audio:["autoplay","controls","loop","muted","preload"].concat(e),source:["media","src","type"].concat(e),table:["cellpadding","cellspacing","border"].concat(e),tbody:[].concat(e),tr:["valign"].concat(e),td:["valign","colspan","rowspan","nowrap"].concat(e),th:["valign","colspan","rowspan","nowrap"].concat(e),hr:e,html:e,title:e,
link:["rel","href"],style:["type"].concat(e),body:e};this.graphicsWhiteList={animate:[],animateMotion:[],animateTransform:[],circle:[],clipPath:[],"color-profile":[],defs:[],desc:[],discard:[],ellipse:[],feBlend:[],feColorMatrix:[],feComponentTransfer:[],feComposite:[],feConvolveMatrix:[],feDiffuseLighting:[],feDisplacementMap:[],feDistantLight:[],feDropShadow:[],feFlood:[],feFuncA:[],feFuncB:[],feFuncG:[],feFuncR:[],feGaussianBlur:[],feImage:[],feMerge:[],feMergeNode:[],feMorphology:[],feOffset:[],
fePointLight:[],feSpecularLighting:[],feSpotLight:[],feTile:[],feTurbulence:[],filter:[],foreignObject:[],g:[],hatch:[],hatchpath:[],line:[],linearGradient:[],marker:[],mask:[],mesh:[],meshgradient:[],meshpatch:[],meshrow:[],metadata:[],mpath:[],path:[],pattern:[],polygon:[],polyline:[],radialGradient:[],rect:[],set:[],solidcolor:[],stop:[],svg:[],switch:[],symbol:[],text:[],textPath:[],title:[],tspan:[],use:[],view:[],object:[],canvas:e};return this._extendObjectOfArrays([g,{a:["target","href","title"],
abbr:["title"],address:[],area:["shape","coords","href","alt"],article:[],aside:[],audio:["autoplay","controls","loop","preload","src"],b:[],bdi:["dir"],bdo:["dir"],big:[],blockquote:["cite"],br:[],caption:[],center:[],cite:[],code:[],col:["align","valign","span","width"],colgroup:["align","valign","span","width"],dd:[],del:["datetime"],details:["open"],div:[],dl:[],dt:[],em:[],font:["color","size","face"],footer:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],header:[],hr:[],i:[],img:["src","alt","title",
"width","height"],ins:["datetime"],li:[],mark:[],nav:[],ol:[],p:[],pre:[],s:[],section:[],small:[],span:[],sub:[],summary:[],sup:[],strong:[],table:["width","border","align","valign"],tbody:["align","valign"],td:["width","rowspan","colspan","align","valign"],tfoot:["align","valign"],th:["width","rowspan","colspan","align","valign"],thead:["align","valign"],tr:["rowspan","align","valign"],tt:[],u:[],ul:[],video:"autoplay controls loop preload src height width".split(" ")},this.graphicsWhiteList])},
_extendObjectOfArrays:function(e){var g={};W.forEach(e,function(l){var m=Object.keys(l);W.forEach(m,function(n){Array.isArray(l[n])&&Array.isArray(g[n])?g[n]=g[n].concat(l[n]):g[n]=l[n]},this)},this);return g},_isInWhiteList:function(e,g){g=Object.keys(g);var l=!1;W.forEach(g,function(m){e===m&&(l=!0)},this);return l}});y.getInstance=function(){null===H&&(H=new y);return H};return y})},"widgets/NearMe/libs/swiper":function(){(function(){function V(H){H.fn.swiper=function(y){var e;H(this).each(function(){var g=
new t(this,y);e||(e=g)});return e}}var W,t=function(H,y){function e(){var b=a.params.autoplay,f=a.slides.eq(a.activeIndex);f.attr("data-swiper-autoplay")&&(b=f.attr("data-swiper-autoplay")||a.params.autoplay);a.autoplayTimeoutId=setTimeout(function(){a.params.loop?(a.fixLoop(),a._slideNext(),a.emit("onAutoplay",a)):a.isEnd?y.autoplayStopOnLast?a.stopAutoplay():(a._slideTo(0),a.emit("onAutoplay",a)):(a._slideNext(),a.emit("onAutoplay",a))},b)}function g(b,f){b=W(b.target);if(!b.is(f))if("string"===
typeof f)b=b.parents(f);else if(f.nodeType){var G;b.parents().each(function(r,d){d===f&&(G=f)});if(G)return f;return}if(0!==b.length)return b[0]}function l(b,f){f=f||{};var G=new (window.MutationObserver||window.WebkitMutationObserver)(function(r){r.forEach(function(d){a.onResize(!0);a.emit("onObserverUpdate",a,d)})});G.observe(b,{attributes:"undefined"===typeof f.attributes?!0:f.attributes,childList:"undefined"===typeof f.childList?!0:f.childList,characterData:"undefined"===typeof f.characterData?
!0:f.characterData});a.observers.push(G)}function m(b){b.originalEvent&&(b=b.originalEvent);var f=b.keyCode||b.charCode;if(!a.params.allowSwipeToNext&&(a.isHorizontal()&&39===f||!a.isHorizontal()&&40===f)||!a.params.allowSwipeToPrev&&(a.isHorizontal()&&37===f||!a.isHorizontal()&&38===f))return!1;if(!(b.shiftKey||b.altKey||b.ctrlKey||b.metaKey||document.activeElement&&document.activeElement.nodeName&&("input"===document.activeElement.nodeName.toLowerCase()||"textarea"===document.activeElement.nodeName.toLowerCase()))){if(37===
f||39===f||38===f||40===f){var G=!1;if(0<a.container.parents("."+a.params.slideClass).length&&0===a.container.parents("."+a.params.slideActiveClass).length)return;var r=window.pageXOffset,d=window.pageYOffset,v=window.innerWidth,O=window.innerHeight,E=a.container.offset();a.rtl&&(E.left-=a.container[0].scrollLeft);E=[[E.left,E.top],[E.left+a.width,E.top],[E.left,E.top+a.height],[E.left+a.width,E.top+a.height]];for(var aa=0;aa<E.length;aa++){var ma=E[aa];ma[0]>=r&&ma[0]<=r+v&&ma[1]>=d&&ma[1]<=d+O&&
(G=!0)}if(!G)return}if(a.isHorizontal()){if(37===f||39===f)b.preventDefault?b.preventDefault():b.returnValue=!1;(39===f&&!a.rtl||37===f&&a.rtl)&&a.slideNext();(37===f&&!a.rtl||39===f&&a.rtl)&&a.slidePrev()}else{if(38===f||40===f)b.preventDefault?b.preventDefault():b.returnValue=!1;40===f&&a.slideNext();38===f&&a.slidePrev()}a.emit("onKeyPress",a,f)}}function n(){var b="onwheel"in document;b||(b=document.createElement("div"),b.setAttribute("onwheel","return;"),b="function"===typeof b.onwheel);!b&&
document.implementation&&document.implementation.hasFeature&&!0!==document.implementation.hasFeature("","")&&(b=document.implementation.hasFeature("Events.wheel","3.0"));return b}function h(b){var f=0,G=0,r=0,d=0;"detail"in b&&(G=b.detail);"wheelDelta"in b&&(G=-b.wheelDelta/120);"wheelDeltaY"in b&&(G=-b.wheelDeltaY/120);"wheelDeltaX"in b&&(f=-b.wheelDeltaX/120);"axis"in b&&b.axis===b.HORIZONTAL_AXIS&&(f=G,G=0);r=10*f;d=10*G;"deltaY"in b&&(d=b.deltaY);"deltaX"in b&&(r=b.deltaX);(r||d)&&b.deltaMode&&
(1===b.deltaMode?(r*=40,d*=40):(r*=800,d*=800));r&&!f&&(f=1>r?-1:1);d&&!G&&(G=1>d?-1:1);return{spinX:f,spinY:G,pixelX:r,pixelY:d}}function x(b){b.originalEvent&&(b=b.originalEvent);var f=0;f=a.rtl?-1:1;var G=h(b);if(a.params.mousewheelForceToAxis)if(a.isHorizontal())if(Math.abs(G.pixelX)>Math.abs(G.pixelY))f*=G.pixelX;else return;else if(Math.abs(G.pixelY)>Math.abs(G.pixelX))f=G.pixelY;else return;else f=Math.abs(G.pixelX)>Math.abs(G.pixelY)?-G.pixelX*f:-G.pixelY;if(0!==f){a.params.mousewheelInvert&&
(f=-f);if(a.params.freeMode){f=a.getWrapperTranslate()+f*a.params.mousewheelSensitivity;G=a.isBeginning;var r=a.isEnd;f>=a.minTranslate()&&(f=a.minTranslate());f<=a.maxTranslate()&&(f=a.maxTranslate());a.setWrapperTransition(0);a.setWrapperTranslate(f);a.updateProgress();a.updateActiveIndex();(!G&&a.isBeginning||!r&&a.isEnd)&&a.updateClasses();a.params.freeModeSticky?(clearTimeout(a.mousewheel.timeout),a.mousewheel.timeout=setTimeout(function(){a.slideReset()},300)):a.params.lazyLoading&&a.lazy&&
a.lazy.load();a.emit("onScroll",a,b);a.params.autoplay&&a.params.autoplayDisableOnInteraction&&a.stopAutoplay();if(0===f||f===a.maxTranslate())return}else{if(60<(new window.Date).getTime()-a.mousewheel.lastScrollTime)if(0>f)if((!a.isEnd||a.params.loop)&&!a.animating)a.slideNext(),a.emit("onScroll",a,b);else{if(a.params.mousewheelReleaseOnEdges)return!0}else if((!a.isBeginning||a.params.loop)&&!a.animating)a.slidePrev(),a.emit("onScroll",a,b);else if(a.params.mousewheelReleaseOnEdges)return!0;a.mousewheel.lastScrollTime=
(new window.Date).getTime()}b.preventDefault?b.preventDefault():b.returnValue=!1;return!1}}function I(b,f){b=W(b);var G=a.rtl?-1:1;var r=b.attr("data-swiper-parallax")||"0";var d=b.attr("data-swiper-parallax-x");var v=b.attr("data-swiper-parallax-y");d||v?(d=d||"0",v=v||"0"):a.isHorizontal()?(d=r,v="0"):(v=r,d="0");d=0<=d.indexOf("%")?parseInt(d,10)*f*G+"%":d*f*G+"px";v=0<=v.indexOf("%")?parseInt(v,10)*f+"%":v*f+"px";b.transform("translate3d("+d+", "+v+",0px)")}function K(b){0!==b.indexOf("on")&&
(b=b[0]!==b[0].toUpperCase()?"on"+b[0].toUpperCase()+b.substring(1):"on"+b);return b}if(!(this instanceof t))return new t(H,y);var w={direction:"horizontal",touchEventsTarget:"container",initialSlide:0,speed:300,autoplay:!1,autoplayDisableOnInteraction:!0,autoplayStopOnLast:!1,iOSEdgeSwipeDetection:!1,iOSEdgeSwipeThreshold:20,freeMode:!1,freeModeMomentum:!0,freeModeMomentumRatio:1,freeModeMomentumBounce:!0,freeModeMomentumBounceRatio:1,freeModeMomentumVelocityRatio:1,freeModeSticky:!1,freeModeMinimumVelocity:.02,
autoHeight:!1,setWrapperSize:!1,virtualTranslate:!1,effect:"slide",coverflow:{rotate:50,stretch:0,depth:100,modifier:1,slideShadows:!0},flip:{slideShadows:!0,limitRotation:!0},cube:{slideShadows:!0,shadow:!0,shadowOffset:20,shadowScale:.94},fade:{crossFade:!1},parallax:!1,zoom:!1,zoomMax:3,zoomMin:1,zoomToggle:!0,scrollbar:null,scrollbarHide:!0,scrollbarDraggable:!1,scrollbarSnapOnRelease:!1,keyboardControl:!1,mousewheelControl:!1,mousewheelReleaseOnEdges:!1,mousewheelInvert:!1,mousewheelForceToAxis:!1,
mousewheelSensitivity:1,mousewheelEventsTarged:"container",hashnav:!1,hashnavWatchState:!1,history:!1,replaceState:!1,breakpoints:void 0,spaceBetween:0,slidesPerView:1,slidesPerColumn:1,slidesPerColumnFill:"column",slidesPerGroup:1,centeredSlides:!1,slidesOffsetBefore:0,slidesOffsetAfter:0,roundLengths:!1,touchRatio:1,touchAngle:45,simulateTouch:!0,shortSwipes:!0,longSwipes:!0,longSwipesRatio:.5,longSwipesMs:300,followFinger:!0,onlyExternal:!1,threshold:0,touchMoveStopPropagation:!0,touchReleaseOnEdges:!1,
uniqueNavElements:!0,pagination:null,paginationElement:"span",paginationClickable:!1,paginationHide:!1,paginationBulletRender:null,paginationProgressRender:null,paginationFractionRender:null,paginationCustomRender:null,paginationType:"bullets",resistance:!0,resistanceRatio:.85,nextButton:null,prevButton:null,watchSlidesProgress:!1,watchSlidesVisibility:!1,grabCursor:!1,preventClicks:!0,preventClicksPropagation:!0,slideToClickedSlide:!1,lazyLoading:!1,lazyLoadingInPrevNext:!1,lazyLoadingInPrevNextAmount:1,
lazyLoadingOnTransitionStart:!1,preloadImages:!0,updateOnImagesReady:!0,loop:!1,loopAdditionalSlides:0,loopedSlides:null,control:void 0,controlInverse:!1,controlBy:"slide",normalizeSlideIndex:!0,allowSwipeToPrev:!0,allowSwipeToNext:!0,swipeHandler:null,noSwiping:!0,noSwipingClass:"swiper-no-swiping",passiveListeners:!0,containerModifierClass:"swiper-container-",slideClass:"swiper-slide",slideActiveClass:"swiper-slide-active",slideDuplicateActiveClass:"swiper-slide-duplicate-active",slideVisibleClass:"swiper-slide-visible",
slideDuplicateClass:"swiper-slide-duplicate",slideNextClass:"swiper-slide-next",slideDuplicateNextClass:"swiper-slide-duplicate-next",slidePrevClass:"swiper-slide-prev",slideDuplicatePrevClass:"swiper-slide-duplicate-prev",wrapperClass:"swiper-wrapper",bulletClass:"swiper-pagination-bullet",bulletActiveClass:"swiper-pagination-bullet-active",buttonDisabledClass:"swiper-button-disabled",paginationCurrentClass:"swiper-pagination-current",paginationTotalClass:"swiper-pagination-total",paginationHiddenClass:"swiper-pagination-hidden",
paginationProgressbarClass:"swiper-pagination-progressbar",paginationClickableClass:"swiper-pagination-clickable",paginationModifierClass:"swiper-pagination-",lazyLoadingClass:"swiper-lazy",lazyStatusLoadingClass:"swiper-lazy-loading",lazyStatusLoadedClass:"swiper-lazy-loaded",lazyPreloaderClass:"swiper-lazy-preloader",notificationClass:"swiper-notification",preloaderClass:"preloader",zoomContainerClass:"swiper-zoom-container",observer:!1,observeParents:!1,a11y:!1,prevSlideMessage:"Previous slide",
nextSlideMessage:"Next slide",firstSlideMessage:"This is the first slide",lastSlideMessage:"This is the last slide",paginationBulletMessage:"Go to slide {{index}}",runCallbacksOnInit:!0},L=y&&y.virtualTranslate;y=y||{};var T={},U;for(U in y)if("object"!==typeof y[U]||null===y[U]||y[U].nodeType||y[U]===window||y[U]===document||"undefined"!==typeof Q&&y[U]instanceof Q||"undefined"!==typeof jQuery&&y[U]instanceof jQuery)T[U]=y[U];else{T[U]={};for(var N in y[U])T[U][N]=y[U][N]}for(var S in w)if("undefined"===
typeof y[S])y[S]=w[S];else if("object"===typeof y[S])for(var F in w[S])"undefined"===typeof y[S][F]&&(y[S][F]=w[S][F]);var a=this;a.params=y;a.originalParams=T;a.classNames=[];"undefined"!==typeof W&&"undefined"!==typeof Q&&(W=Q);if("undefined"===typeof W&&(W="undefined"===typeof Q?window.Dom7||window.Zepto||window.jQuery:Q,!W))return;a.$=W;a.currentBreakpoint=void 0;a.getActiveBreakpoint=function(){if(!a.params.breakpoints)return!1;var b=!1,f=[];for(r in a.params.breakpoints)a.params.breakpoints.hasOwnProperty(r)&&
f.push(r);f.sort(function(d,v){return parseInt(d,10)>parseInt(v,10)});for(var G=0;G<f.length;G++){var r=f[G];r>=window.innerWidth&&!b&&(b=r)}return b||"max"};a.setBreakpoint=function(){var b=a.getActiveBreakpoint();if(b&&a.currentBreakpoint!==b){var f=b in a.params.breakpoints?a.params.breakpoints[b]:a.originalParams,G=a.params.loop&&f.slidesPerView!==a.params.slidesPerView,r;for(r in f)a.params[r]=f[r];a.currentBreakpoint=b;G&&a.destroyLoop&&a.reLoop(!0)}};a.params.breakpoints&&a.setBreakpoint();
a.container=W(H);if(0!==a.container.length){if(1<a.container.length){var D=[];a.container.each(function(){D.push(new t(this,y))});return D}a.container[0].swiper=a;a.container.data("swiper",a);a.classNames.push(a.params.containerModifierClass+a.params.direction);a.params.freeMode&&a.classNames.push(a.params.containerModifierClass+"free-mode");a.support.flexbox||(a.classNames.push(a.params.containerModifierClass+"no-flexbox"),a.params.slidesPerColumn=1);a.params.autoHeight&&a.classNames.push(a.params.containerModifierClass+
"autoheight");if(a.params.parallax||a.params.watchSlidesVisibility)a.params.watchSlidesProgress=!0;a.params.touchReleaseOnEdges&&(a.params.resistanceRatio=0);0<=["cube","coverflow","flip"].indexOf(a.params.effect)&&(a.support.transforms3d?(a.params.watchSlidesProgress=!0,a.classNames.push(a.params.containerModifierClass+"3d")):a.params.effect="slide");"slide"!==a.params.effect&&a.classNames.push(a.params.containerModifierClass+a.params.effect);"cube"===a.params.effect&&(a.params.resistanceRatio=0,
a.params.slidesPerView=1,a.params.slidesPerColumn=1,a.params.slidesPerGroup=1,a.params.centeredSlides=!1,a.params.spaceBetween=0,a.params.virtualTranslate=!0);if("fade"===a.params.effect||"flip"===a.params.effect)a.params.slidesPerView=1,a.params.slidesPerColumn=1,a.params.slidesPerGroup=1,a.params.watchSlidesProgress=!0,a.params.spaceBetween=0,"undefined"===typeof L&&(a.params.virtualTranslate=!0);a.params.grabCursor&&a.support.touch&&(a.params.grabCursor=!1);a.wrapper=a.container.children("."+a.params.wrapperClass);
a.params.pagination&&(a.paginationContainer=W(a.params.pagination),a.params.uniqueNavElements&&"string"===typeof a.params.pagination&&1<a.paginationContainer.length&&1===a.container.find(a.params.pagination).length&&(a.paginationContainer=a.container.find(a.params.pagination)),"bullets"===a.params.paginationType&&a.params.paginationClickable?a.paginationContainer.addClass(a.params.paginationModifierClass+"clickable"):a.params.paginationClickable=!1,a.paginationContainer.addClass(a.params.paginationModifierClass+
a.params.paginationType));if(a.params.nextButton||a.params.prevButton)a.params.nextButton&&(a.nextButton=W(a.params.nextButton),a.params.uniqueNavElements&&"string"===typeof a.params.nextButton&&1<a.nextButton.length&&1===a.container.find(a.params.nextButton).length&&(a.nextButton=a.container.find(a.params.nextButton))),a.params.prevButton&&(a.prevButton=W(a.params.prevButton),a.params.uniqueNavElements&&"string"===typeof a.params.prevButton&&1<a.prevButton.length&&1===a.container.find(a.params.prevButton).length&&
(a.prevButton=a.container.find(a.params.prevButton)));a.isHorizontal=function(){return"horizontal"===a.params.direction};a.rtl=a.isHorizontal()&&("rtl"===a.container[0].dir.toLowerCase()||"rtl"===a.container.css("direction"));a.rtl&&a.classNames.push(a.params.containerModifierClass+"rtl");a.rtl&&(a.wrongRTL="-webkit-box"===a.wrapper.css("display"));1<a.params.slidesPerColumn&&a.classNames.push(a.params.containerModifierClass+"multirow");a.device.android&&a.classNames.push(a.params.containerModifierClass+
"android");a.container.addClass(a.classNames.join(" "));a.translate=0;a.progress=0;a.velocity=0;a.lockSwipeToNext=function(){a.params.allowSwipeToNext=!1;!1===a.params.allowSwipeToPrev&&a.params.grabCursor&&a.unsetGrabCursor()};a.lockSwipeToPrev=function(){a.params.allowSwipeToPrev=!1;!1===a.params.allowSwipeToNext&&a.params.grabCursor&&a.unsetGrabCursor()};a.lockSwipes=function(){a.params.allowSwipeToNext=a.params.allowSwipeToPrev=!1;a.params.grabCursor&&a.unsetGrabCursor()};a.unlockSwipeToNext=
function(){a.params.allowSwipeToNext=!0;!0===a.params.allowSwipeToPrev&&a.params.grabCursor&&a.setGrabCursor()};a.unlockSwipeToPrev=function(){a.params.allowSwipeToPrev=!0;!0===a.params.allowSwipeToNext&&a.params.grabCursor&&a.setGrabCursor()};a.unlockSwipes=function(){a.params.allowSwipeToNext=a.params.allowSwipeToPrev=!0;a.params.grabCursor&&a.setGrabCursor()};a.setGrabCursor=function(b){a.container[0].style.cursor="move";a.container[0].style.cursor=b?"-webkit-grabbing":"-webkit-grab";a.container[0].style.cursor=
b?"-moz-grabbin":"-moz-grab";a.container[0].style.cursor=b?"grabbing":"grab"};a.unsetGrabCursor=function(){a.container[0].style.cursor=""};a.params.grabCursor&&a.setGrabCursor();a.imagesToLoad=[];a.imagesLoaded=0;a.loadImage=function(b,f,G,r,d,v){function O(){v&&v()}b.complete&&d?O():f?(b=new window.Image,b.onload=O,b.onerror=O,r&&(b.sizes=r),G&&(b.srcset=G),f&&(b.src=f)):O()};a.preloadImages=function(){function b(){"undefined"!==typeof a&&null!==a&&a&&(void 0!==a.imagesLoaded&&a.imagesLoaded++,a.imagesLoaded===
a.imagesToLoad.length&&(a.params.updateOnImagesReady&&a.update(),a.emit("onImagesReady",a)))}a.imagesToLoad=a.container.find("img");for(var f=0;f<a.imagesToLoad.length;f++)a.loadImage(a.imagesToLoad[f],a.imagesToLoad[f].currentSrc||a.imagesToLoad[f].getAttribute("src"),a.imagesToLoad[f].srcset||a.imagesToLoad[f].getAttribute("srcset"),a.imagesToLoad[f].sizes||a.imagesToLoad[f].getAttribute("sizes"),!0,b)};a.autoplayTimeoutId=void 0;a.autoplaying=!1;a.autoplayPaused=!1;a.startAutoplay=function(){if("undefined"!==
typeof a.autoplayTimeoutId||!a.params.autoplay||a.autoplaying)return!1;a.autoplaying=!0;a.emit("onAutoplayStart",a);e()};a.stopAutoplay=function(b){a.autoplayTimeoutId&&(a.autoplayTimeoutId&&clearTimeout(a.autoplayTimeoutId),a.autoplaying=!1,a.autoplayTimeoutId=void 0,a.emit("onAutoplayStop",a))};a.pauseAutoplay=function(b){a.autoplayPaused||(a.autoplayTimeoutId&&clearTimeout(a.autoplayTimeoutId),a.autoplayPaused=!0,0===b?(a.autoplayPaused=!1,e()):a.wrapper.transitionEnd(function(){a&&(a.autoplayPaused=
!1,a.autoplaying?e():a.stopAutoplay())}))};a.minTranslate=function(){return-a.snapGrid[0]};a.maxTranslate=function(){return-a.snapGrid[a.snapGrid.length-1]};a.updateAutoHeight=function(){var b=[],f=0,G;if("auto"!==a.params.slidesPerView&&1<a.params.slidesPerView)for(G=0;G<Math.ceil(a.params.slidesPerView);G++){var r=a.activeIndex+G;if(r>a.slides.length)break;b.push(a.slides.eq(r)[0])}else b.push(a.slides.eq(a.activeIndex)[0]);for(G=0;G<b.length;G++)"undefined"!==typeof b[G]&&(r=b[G].offsetHeight,
f=r>f?r:f);f&&a.wrapper.css("height",f+"px")};a.updateContainerSize=function(){var b="undefined"!==typeof a.params.width?a.params.width:a.container[0].clientWidth;var f="undefined"!==typeof a.params.height?a.params.height:a.container[0].clientHeight;0===b&&a.isHorizontal()||0===f&&!a.isHorizontal()||(b=b-parseInt(a.container.css("padding-left"),10)-parseInt(a.container.css("padding-right"),10),f=f-parseInt(a.container.css("padding-top"),10)-parseInt(a.container.css("padding-bottom"),10),a.width=b,
a.height=f,a.size=a.isHorizontal()?a.width:a.height)};a.updateSlidesSize=function(){a.slides=a.wrapper.children("."+a.params.slideClass);a.snapGrid=[];a.slidesGrid=[];a.slidesSizesGrid=[];var b=a.params.spaceBetween,f=-a.params.slidesOffsetBefore,G,r=0,d=0;if("undefined"!==typeof a.size){"string"===typeof b&&0<=b.indexOf("%")&&(b=parseFloat(b.replace("%",""))/100*a.size);a.virtualSize=-b;a.rtl?a.slides.css({marginLeft:"",marginTop:""}):a.slides.css({marginRight:"",marginBottom:""});if(1<a.params.slidesPerColumn){var v=
Math.floor(a.slides.length/a.params.slidesPerColumn)===a.slides.length/a.params.slidesPerColumn?a.slides.length:Math.ceil(a.slides.length/a.params.slidesPerColumn)*a.params.slidesPerColumn;"auto"!==a.params.slidesPerView&&"row"===a.params.slidesPerColumnFill&&(v=Math.max(v,a.params.slidesPerView*a.params.slidesPerColumn))}var O=a.params.slidesPerColumn,E=v/O,aa=E-(a.params.slidesPerColumn*E-a.slides.length);for(G=0;G<a.slides.length;G++){var ma=0;var va=a.slides.eq(G);if(1<a.params.slidesPerColumn){if("column"===
a.params.slidesPerColumnFill){var Aa=Math.floor(G/O);var xa=G-Aa*O;(Aa>aa||Aa===aa&&xa===O-1)&&++xa>=O&&(xa=0,Aa++);var q=Aa+xa*v/O;va.css({"-webkit-box-ordinal-group":q,"-moz-box-ordinal-group":q,"-ms-flex-order":q,"-webkit-order":q,order:q})}else xa=Math.floor(G/E),Aa=G-xa*E;va.css("margin-"+(a.isHorizontal()?"top":"left"),0!==xa&&a.params.spaceBetween&&a.params.spaceBetween+"px").attr("data-swiper-column",Aa).attr("data-swiper-row",xa)}"none"!==va.css("display")&&("auto"===a.params.slidesPerView?
(ma=a.isHorizontal()?va.outerWidth(!0):va.outerHeight(!0),a.params.roundLengths&&(ma=Math.floor(ma))):(ma=(a.size-(a.params.slidesPerView-1)*b)/a.params.slidesPerView,a.params.roundLengths&&(ma=Math.floor(ma)),a.isHorizontal()?a.slides[G].style.width=ma+"px":a.slides[G].style.height=ma+"px"),a.slides[G].swiperSlideSize=ma,a.slidesSizesGrid.push(ma),a.params.centeredSlides?(f=f+ma/2+r/2+b,0===r&&0!==G&&(f=f-a.size/2-b),0===G&&(f=f-a.size/2-b),.001>Math.abs(f)&&(f=0),0===d%a.params.slidesPerGroup&&
a.snapGrid.push(f),a.slidesGrid.push(f)):(0===d%a.params.slidesPerGroup&&a.snapGrid.push(f),a.slidesGrid.push(f),f=f+ma+b),a.virtualSize+=ma+b,r=ma,d++)}a.virtualSize=Math.max(a.virtualSize,a.size)+a.params.slidesOffsetAfter;a.rtl&&a.wrongRTL&&("slide"===a.params.effect||"coverflow"===a.params.effect)&&a.wrapper.css({width:a.virtualSize+a.params.spaceBetween+"px"});if(!a.support.flexbox||a.params.setWrapperSize)a.isHorizontal()?a.wrapper.css({width:a.virtualSize+a.params.spaceBetween+"px"}):a.wrapper.css({height:a.virtualSize+
a.params.spaceBetween+"px"});if(1<a.params.slidesPerColumn&&(a.virtualSize=(ma+a.params.spaceBetween)*v,a.virtualSize=Math.ceil(a.virtualSize/a.params.slidesPerColumn)-a.params.spaceBetween,a.isHorizontal()?a.wrapper.css({width:a.virtualSize+a.params.spaceBetween+"px"}):a.wrapper.css({height:a.virtualSize+a.params.spaceBetween+"px"}),a.params.centeredSlides)){f=[];for(G=0;G<a.snapGrid.length;G++)a.snapGrid[G]<a.virtualSize+a.snapGrid[0]&&f.push(a.snapGrid[G]);a.snapGrid=f}if(!a.params.centeredSlides){f=
[];for(G=0;G<a.snapGrid.length;G++)a.snapGrid[G]<=a.virtualSize-a.size&&f.push(a.snapGrid[G]);a.snapGrid=f;1<Math.floor(a.virtualSize-a.size)-Math.floor(a.snapGrid[a.snapGrid.length-1])&&a.snapGrid.push(a.virtualSize-a.size)}0===a.snapGrid.length&&(a.snapGrid=[0]);0!==a.params.spaceBetween&&(a.isHorizontal()?a.rtl?a.slides.css({marginLeft:b+"px"}):a.slides.css({marginRight:b+"px"}):a.slides.css({marginBottom:b+"px"}));a.params.watchSlidesProgress&&a.updateSlidesOffset()}};a.updateSlidesOffset=function(){for(var b=
0;b<a.slides.length;b++)a.slides[b].swiperSlideOffset=a.isHorizontal()?a.slides[b].offsetLeft:a.slides[b].offsetTop};a.currentSlidesPerView=function(){var b=1,f;if(a.params.centeredSlides){var G=a.slides[a.activeIndex].swiperSlideSize,r;for(f=a.activeIndex+1;f<a.slides.length;f++)a.slides[f]&&!r&&(G+=a.slides[f].swiperSlideSize,b++,G>a.size&&(r=!0));for(f=a.activeIndex-1;0<=f;f--)a.slides[f]&&!r&&(G+=a.slides[f].swiperSlideSize,b++,G>a.size&&(r=!0))}else for(f=a.activeIndex+1;f<a.slides.length;f++)a.slidesGrid[f]-
a.slidesGrid[a.activeIndex]<a.size&&b++;return b};a.updateSlidesProgress=function(b){"undefined"===typeof b&&(b=a.translate||0);if(0!==a.slides.length){"undefined"===typeof a.slides[0].swiperSlideOffset&&a.updateSlidesOffset();var f=-b;a.rtl&&(f=b);a.slides.removeClass(a.params.slideVisibleClass);for(b=0;b<a.slides.length;b++){var G=a.slides[b],r=(f+(a.params.centeredSlides?a.minTranslate():0)-G.swiperSlideOffset)/(G.swiperSlideSize+a.params.spaceBetween);if(a.params.watchSlidesVisibility){var d=
-(f-G.swiperSlideOffset),v=d+a.slidesSizesGrid[b];(0<=d&&d<a.size||0<v&&v<=a.size||0>=d&&v>=a.size)&&a.slides.eq(b).addClass(a.params.slideVisibleClass)}G.progress=a.rtl?-r:r}}};a.updateProgress=function(b){"undefined"===typeof b&&(b=a.translate||0);var f=a.maxTranslate()-a.minTranslate(),G=a.isBeginning,r=a.isEnd;0===f?(a.progress=0,a.isBeginning=a.isEnd=!0):(a.progress=(b-a.minTranslate())/f,a.isBeginning=0>=a.progress,a.isEnd=1<=a.progress);a.isBeginning&&!G&&a.emit("onReachBeginning",a);a.isEnd&&
!r&&a.emit("onReachEnd",a);a.params.watchSlidesProgress&&a.updateSlidesProgress(b);a.emit("onProgress",a,a.progress)};a.updateActiveIndex=function(){var b=a.rtl?a.translate:-a.translate,f,G;for(G=0;G<a.slidesGrid.length;G++)"undefined"!==typeof a.slidesGrid[G+1]?b>=a.slidesGrid[G]&&b<a.slidesGrid[G+1]-(a.slidesGrid[G+1]-a.slidesGrid[G])/2?f=G:b>=a.slidesGrid[G]&&b<a.slidesGrid[G+1]&&(f=G+1):b>=a.slidesGrid[G]&&(f=G);a.params.normalizeSlideIndex&&(0>f||"undefined"===typeof f)&&(f=0);b=Math.floor(f/
a.params.slidesPerGroup);b>=a.snapGrid.length&&(b=a.snapGrid.length-1);f!==a.activeIndex&&(a.snapIndex=b,a.previousIndex=a.activeIndex,a.activeIndex=f,a.updateClasses(),a.updateRealIndex())};a.updateRealIndex=function(){a.realIndex=parseInt(a.slides.eq(a.activeIndex).attr("data-swiper-slide-index")||a.activeIndex,10)};a.updateClasses=function(){a.slides.removeClass(a.params.slideActiveClass+" "+a.params.slideNextClass+" "+a.params.slidePrevClass+" "+a.params.slideDuplicateActiveClass+" "+a.params.slideDuplicateNextClass+
" "+a.params.slideDuplicatePrevClass);var b=a.slides.eq(a.activeIndex);b.addClass(a.params.slideActiveClass);y.loop&&(b.hasClass(a.params.slideDuplicateClass)?a.wrapper.children("."+a.params.slideClass+":not(."+a.params.slideDuplicateClass+')[data-swiper-slide-index\x3d"'+a.realIndex+'"]').addClass(a.params.slideDuplicateActiveClass):a.wrapper.children("."+a.params.slideClass+"."+a.params.slideDuplicateClass+'[data-swiper-slide-index\x3d"'+a.realIndex+'"]').addClass(a.params.slideDuplicateActiveClass));
var f=b.next("."+a.params.slideClass).addClass(a.params.slideNextClass);a.params.loop&&0===f.length&&(f=a.slides.eq(0),f.addClass(a.params.slideNextClass));b=b.prev("."+a.params.slideClass).addClass(a.params.slidePrevClass);a.params.loop&&0===b.length&&(b=a.slides.eq(-1),b.addClass(a.params.slidePrevClass));y.loop&&(f.hasClass(a.params.slideDuplicateClass)?a.wrapper.children("."+a.params.slideClass+":not(."+a.params.slideDuplicateClass+')[data-swiper-slide-index\x3d"'+f.attr("data-swiper-slide-index")+
'"]').addClass(a.params.slideDuplicateNextClass):a.wrapper.children("."+a.params.slideClass+"."+a.params.slideDuplicateClass+'[data-swiper-slide-index\x3d"'+f.attr("data-swiper-slide-index")+'"]').addClass(a.params.slideDuplicateNextClass),b.hasClass(a.params.slideDuplicateClass)?a.wrapper.children("."+a.params.slideClass+":not(."+a.params.slideDuplicateClass+')[data-swiper-slide-index\x3d"'+b.attr("data-swiper-slide-index")+'"]').addClass(a.params.slideDuplicatePrevClass):a.wrapper.children("."+
a.params.slideClass+"."+a.params.slideDuplicateClass+'[data-swiper-slide-index\x3d"'+b.attr("data-swiper-slide-index")+'"]').addClass(a.params.slideDuplicatePrevClass));if(a.paginationContainer&&0<a.paginationContainer.length){f=a.params.loop?Math.ceil((a.slides.length-2*a.loopedSlides)/a.params.slidesPerGroup):a.snapGrid.length;if(a.params.loop){var G=Math.ceil((a.activeIndex-a.loopedSlides)/a.params.slidesPerGroup);G>a.slides.length-1-2*a.loopedSlides&&(G-=a.slides.length-2*a.loopedSlides);G>f-
1&&(G-=f);0>G&&"bullets"!==a.params.paginationType&&(G=f+G)}else G="undefined"!==typeof a.snapIndex?a.snapIndex:a.activeIndex||0;"bullets"===a.params.paginationType&&a.bullets&&0<a.bullets.length&&(a.bullets.removeClass(a.params.bulletActiveClass),1<a.paginationContainer.length?a.bullets.each(function(){W(this).index()===G&&W(this).addClass(a.params.bulletActiveClass)}):a.bullets.eq(G).addClass(a.params.bulletActiveClass));"fraction"===a.params.paginationType&&(a.paginationContainer.find("."+a.params.paginationCurrentClass).text(G+
1),a.paginationContainer.find("."+a.params.paginationTotalClass).text(f));if("progress"===a.params.paginationType){var r=b=(G+1)/f,d=1;a.isHorizontal()||(d=b,r=1);a.paginationContainer.find("."+a.params.paginationProgressbarClass).transform("translate3d(0,0,0) scaleX("+r+") scaleY("+d+")").transition(a.params.speed)}"custom"===a.params.paginationType&&a.params.paginationCustomRender&&(a.paginationContainer.html(a.params.paginationCustomRender(a,G+1,f)),a.emit("onPaginationRendered",a,a.paginationContainer[0]))}a.params.loop||
(a.params.prevButton&&a.prevButton&&0<a.prevButton.length&&(a.isBeginning?(a.prevButton.addClass(a.params.buttonDisabledClass),a.params.a11y&&a.a11y&&a.a11y.disable(a.prevButton)):(a.prevButton.removeClass(a.params.buttonDisabledClass),a.params.a11y&&a.a11y&&a.a11y.enable(a.prevButton))),a.params.nextButton&&a.nextButton&&0<a.nextButton.length&&(a.isEnd?(a.nextButton.addClass(a.params.buttonDisabledClass),a.params.a11y&&a.a11y&&a.a11y.disable(a.nextButton)):(a.nextButton.removeClass(a.params.buttonDisabledClass),
a.params.a11y&&a.a11y&&a.a11y.enable(a.nextButton))))};a.updatePagination=function(){if(a.params.pagination&&a.paginationContainer&&0<a.paginationContainer.length){var b="";if("bullets"===a.params.paginationType){for(var f=a.params.loop?Math.ceil((a.slides.length-2*a.loopedSlides)/a.params.slidesPerGroup):a.snapGrid.length,G=0;G<f;G++)b=a.params.paginationBulletRender?b+a.params.paginationBulletRender(a,G,a.params.bulletClass):b+("\x3c"+a.params.paginationElement+' class\x3d"'+a.params.bulletClass+
'"\x3e\x3c/'+a.params.paginationElement+"\x3e");a.paginationContainer.html(b);a.bullets=a.paginationContainer.find("."+a.params.bulletClass);a.params.paginationClickable&&a.params.a11y&&a.a11y&&a.a11y.initPagination()}"fraction"===a.params.paginationType&&(b=a.params.paginationFractionRender?a.params.paginationFractionRender(a,a.params.paginationCurrentClass,a.params.paginationTotalClass):'\x3cspan class\x3d"'+a.params.paginationCurrentClass+'"\x3e\x3c/span\x3e / \x3cspan class\x3d"'+a.params.paginationTotalClass+
'"\x3e\x3c/span\x3e',a.paginationContainer.html(b));"progress"===a.params.paginationType&&(b=a.params.paginationProgressRender?a.params.paginationProgressRender(a,a.params.paginationProgressbarClass):'\x3cspan class\x3d"'+a.params.paginationProgressbarClass+'"\x3e\x3c/span\x3e',a.paginationContainer.html(b));"custom"!==a.params.paginationType&&a.emit("onPaginationRendered",a,a.paginationContainer[0])}};a.update=function(b){function f(){G=Math.min(Math.max(a.translate,a.maxTranslate()),a.minTranslate());
a.setWrapperTranslate(G);a.updateActiveIndex();a.updateClasses()}if(a){a.updateContainerSize();a.updateSlidesSize();a.updateProgress();a.updatePagination();a.updateClasses();a.params.scrollbar&&a.scrollbar&&a.scrollbar.set();var G;b?(a.controller&&a.controller.spline&&(a.controller.spline=void 0),a.params.freeMode?(f(),a.params.autoHeight&&a.updateAutoHeight()):(b=("auto"===a.params.slidesPerView||1<a.params.slidesPerView)&&a.isEnd&&!a.params.centeredSlides?a.slideTo(a.slides.length-1,0,!1,!0):a.slideTo(a.activeIndex,
0,!1,!0))||f()):a.params.autoHeight&&a.updateAutoHeight()}};a.onResize=function(b){if(a.params.onBeforeResize)a.params.onBeforeResize(a);a.params.breakpoints&&a.setBreakpoint();var f=a.params.allowSwipeToPrev,G=a.params.allowSwipeToNext;a.params.allowSwipeToPrev=a.params.allowSwipeToNext=!0;a.updateContainerSize();a.updateSlidesSize();("auto"===a.params.slidesPerView||a.params.freeMode||b)&&a.updatePagination();a.params.scrollbar&&a.scrollbar&&a.scrollbar.set();a.controller&&a.controller.spline&&
(a.controller.spline=void 0);b=!1;if(a.params.freeMode){var r=Math.min(Math.max(a.translate,a.maxTranslate()),a.minTranslate());a.setWrapperTranslate(r);a.updateActiveIndex();a.updateClasses();a.params.autoHeight&&a.updateAutoHeight()}else a.updateClasses(),b=("auto"===a.params.slidesPerView||1<a.params.slidesPerView)&&a.isEnd&&!a.params.centeredSlides?a.slideTo(a.slides.length-1,0,!1,!0):a.slideTo(a.activeIndex,0,!1,!0);a.params.lazyLoading&&!b&&a.lazy&&a.lazy.load();a.params.allowSwipeToPrev=f;
a.params.allowSwipeToNext=G;if(a.params.onAfterResize)a.params.onAfterResize(a)};a.touchEventsDesktop={start:"mousedown",move:"mousemove",end:"mouseup"};window.navigator.pointerEnabled?a.touchEventsDesktop={start:"pointerdown",move:"pointermove",end:"pointerup"}:window.navigator.msPointerEnabled&&(a.touchEventsDesktop={start:"MSPointerDown",move:"MSPointerMove",end:"MSPointerUp"});a.touchEvents={start:a.support.touch||!a.params.simulateTouch?"touchstart":a.touchEventsDesktop.start,move:a.support.touch||
!a.params.simulateTouch?"touchmove":a.touchEventsDesktop.move,end:a.support.touch||!a.params.simulateTouch?"touchend":a.touchEventsDesktop.end};(window.navigator.pointerEnabled||window.navigator.msPointerEnabled)&&("container"===a.params.touchEventsTarget?a.container:a.wrapper).addClass("swiper-wp8-"+a.params.direction);a.initEvents=function(b){var f=b?"off":"on";b=b?"removeEventListener":"addEventListener";var G="container"===a.params.touchEventsTarget?a.container[0]:a.wrapper[0],r=a.support.touch?
G:document,d=a.params.nested?!0:!1;if(a.browser.ie)G[b](a.touchEvents.start,a.onTouchStart,!1),r[b](a.touchEvents.move,a.onTouchMove,d),r[b](a.touchEvents.end,a.onTouchEnd,!1);else if(a.support.touch&&(r="touchstart"===a.touchEvents.start&&a.support.passiveListener&&a.params.passiveListeners?{passive:!0,capture:!1}:!1,G[b](a.touchEvents.start,a.onTouchStart,r),G[b](a.touchEvents.move,a.onTouchMove,d),G[b](a.touchEvents.end,a.onTouchEnd,r)),y.simulateTouch&&!a.device.ios&&!a.device.android||y.simulateTouch&&
!a.support.touch&&a.device.ios)G[b]("mousedown",a.onTouchStart,!1),document[b]("mousemove",a.onTouchMove,d),document[b]("mouseup",a.onTouchEnd,!1);window[b]("resize",a.onResize);if(a.params.nextButton&&a.nextButton&&0<a.nextButton.length&&(a.nextButton[f]("click",a.onClickNext),a.params.a11y&&a.a11y))a.nextButton[f]("keydown",a.a11y.onEnterKey);if(a.params.prevButton&&a.prevButton&&0<a.prevButton.length&&(a.prevButton[f]("click",a.onClickPrev),a.params.a11y&&a.a11y))a.prevButton[f]("keydown",a.a11y.onEnterKey);
if(a.params.pagination&&a.params.paginationClickable&&(a.paginationContainer[f]("click","."+a.params.bulletClass,a.onClickIndex),a.params.a11y&&a.a11y))a.paginationContainer[f]("keydown","."+a.params.bulletClass,a.a11y.onEnterKey);if(a.params.preventClicks||a.params.preventClicksPropagation)G[b]("click",a.preventClicks,!0)};a.attachEvents=function(){a.initEvents()};a.detachEvents=function(){a.initEvents(!0)};a.allowClick=!0;a.preventClicks=function(b){a.allowClick||(a.params.preventClicks&&b.preventDefault(),
a.params.preventClicksPropagation&&a.animating&&(b.stopPropagation(),b.stopImmediatePropagation()))};a.onClickNext=function(b){b.preventDefault();a.isEnd&&!a.params.loop||a.slideNext()};a.onClickPrev=function(b){b.preventDefault();a.isBeginning&&!a.params.loop||a.slidePrev()};a.onClickIndex=function(b){b.preventDefault();b=W(this).index()*a.params.slidesPerGroup;a.params.loop&&(b+=a.loopedSlides);a.slideTo(b)};a.updateClickedSlide=function(b){b=g(b,"."+a.params.slideClass);var f=!1;if(b)for(var G=
0;G<a.slides.length;G++)a.slides[G]===b&&(f=!0);if(b&&f){if(a.clickedSlide=b,a.clickedIndex=W(b).index(),a.params.slideToClickedSlide&&void 0!==a.clickedIndex&&a.clickedIndex!==a.activeIndex){var r=a.clickedIndex;f="auto"===a.params.slidesPerView?a.currentSlidesPerView():a.params.slidesPerView;a.params.loop?a.animating||(b=parseInt(W(a.clickedSlide).attr("data-swiper-slide-index"),10),a.params.centeredSlides?r<a.loopedSlides-f/2||r>a.slides.length-a.loopedSlides+f/2?(a.fixLoop(),r=a.wrapper.children("."+
a.params.slideClass+'[data-swiper-slide-index\x3d"'+b+'"]:not(.'+a.params.slideDuplicateClass+")").eq(0).index(),setTimeout(function(){a.slideTo(r)},0)):a.slideTo(r):r>a.slides.length-f?(a.fixLoop(),r=a.wrapper.children("."+a.params.slideClass+'[data-swiper-slide-index\x3d"'+b+'"]:not(.'+a.params.slideDuplicateClass+")").eq(0).index(),setTimeout(function(){a.slideTo(r)},0)):a.slideTo(r)):a.slideTo(r)}}else a.clickedSlide=void 0,a.clickedIndex=void 0};var da,ha,ia,na,P,la,ja,J,z=Date.now(),B,ca=[],
ra;a.animating=!1;a.touches={startX:0,startY:0,currentX:0,currentY:0,diff:0};var oa,ta;a.onTouchStart=function(b){b.originalEvent&&(b=b.originalEvent);if((oa="touchstart"===b.type)||!("which"in b)||3!==b.which)if(a.params.noSwiping&&g(b,"."+a.params.noSwipingClass))a.allowClick=!0;else if(!a.params.swipeHandler||g(b,a.params.swipeHandler)){var f=a.touches.currentX="touchstart"===b.type?b.targetTouches[0].pageX:b.pageX,G=a.touches.currentY="touchstart"===b.type?b.targetTouches[0].pageY:b.pageY;a.device.ios&&
a.params.iOSEdgeSwipeDetection&&f<=a.params.iOSEdgeSwipeThreshold||(da=!0,ha=!1,ia=!0,ta=P=void 0,a.touches.startX=f,a.touches.startY=G,na=Date.now(),a.allowClick=!0,a.updateContainerSize(),a.swipeDirection=void 0,0<a.params.threshold&&(J=!1),"touchstart"!==b.type&&(f=!0,W(b.target).is("input, select, textarea, button, video")&&(f=!1),document.activeElement&&W(document.activeElement).is("input, select, textarea, button, video")&&document.activeElement.blur(),f&&b.preventDefault()),a.emit("onTouchStart",
a,b))}};a.onTouchMove=function(b){b.originalEvent&&(b=b.originalEvent);if(!oa||"mousemove"!==b.type)if(b.preventedByNestedSwiper)a.touches.startX="touchmove"===b.type?b.targetTouches[0].pageX:b.pageX,a.touches.startY="touchmove"===b.type?b.targetTouches[0].pageY:b.pageY;else if(a.params.onlyExternal)a.allowClick=!1,da&&(a.touches.startX=a.touches.currentX="touchmove"===b.type?b.targetTouches[0].pageX:b.pageX,a.touches.startY=a.touches.currentY="touchmove"===b.type?b.targetTouches[0].pageY:b.pageY,
na=Date.now());else{if(oa&&a.params.touchReleaseOnEdges&&!a.params.loop)if(!a.isHorizontal()){if(a.touches.currentY<a.touches.startY&&a.translate<=a.maxTranslate()||a.touches.currentY>a.touches.startY&&a.translate>=a.minTranslate())return}else if(a.touches.currentX<a.touches.startX&&a.translate<=a.maxTranslate()||a.touches.currentX>a.touches.startX&&a.translate>=a.minTranslate())return;if(oa&&document.activeElement&&b.target===document.activeElement&&W(b.target).is("input, select, textarea, button, video"))ha=
!0,a.allowClick=!1;else if(ia&&a.emit("onTouchMove",a,b),!(b.targetTouches&&1<b.targetTouches.length)){a.touches.currentX="touchmove"===b.type?b.targetTouches[0].pageX:b.pageX;a.touches.currentY="touchmove"===b.type?b.targetTouches[0].pageY:b.pageY;if("undefined"===typeof P)if(a.isHorizontal()&&a.touches.currentY===a.touches.startY||!a.isHorizontal()&&a.touches.currentX===a.touches.startX)P=!1;else{var f=180*Math.atan2(Math.abs(a.touches.currentY-a.touches.startY),Math.abs(a.touches.currentX-a.touches.startX))/
Math.PI;P=a.isHorizontal()?f>a.params.touchAngle:90-f>a.params.touchAngle}P&&a.emit("onTouchMoveOpposite",a,b);"undefined"!==typeof ta||a.touches.currentX===a.touches.startX&&a.touches.currentY===a.touches.startY||(ta=!0);if(da)if(P)da=!1;else if(ta){a.allowClick=!1;a.emit("onSliderMove",a,b);b.preventDefault();a.params.touchMoveStopPropagation&&!a.params.nested&&b.stopPropagation();ha||(y.loop&&a.fixLoop(),ja=a.getWrapperTranslate(),a.setWrapperTransition(0),a.animating&&a.wrapper.trigger("webkitTransitionEnd transitionend oTransitionEnd MSTransitionEnd msTransitionEnd"),
a.params.autoplay&&a.autoplaying&&(a.params.autoplayDisableOnInteraction?a.stopAutoplay():a.pauseAutoplay()),ra=!1,!a.params.grabCursor||!0!==a.params.allowSwipeToNext&&!0!==a.params.allowSwipeToPrev||a.setGrabCursor(!0));ha=!0;f=a.touches.diff=a.isHorizontal()?a.touches.currentX-a.touches.startX:a.touches.currentY-a.touches.startY;f*=a.params.touchRatio;a.rtl&&(f=-f);a.swipeDirection=0<f?"prev":"next";la=f+ja;var G=!0;0<f&&la>a.minTranslate()?(G=!1,a.params.resistance&&(la=a.minTranslate()-1+Math.pow(-a.minTranslate()+
ja+f,a.params.resistanceRatio))):0>f&&la<a.maxTranslate()&&(G=!1,a.params.resistance&&(la=a.maxTranslate()+1-Math.pow(a.maxTranslate()-ja-f,a.params.resistanceRatio)));G&&(b.preventedByNestedSwiper=!0);!a.params.allowSwipeToNext&&"next"===a.swipeDirection&&la<ja&&(la=ja);!a.params.allowSwipeToPrev&&"prev"===a.swipeDirection&&la>ja&&(la=ja);if(0<a.params.threshold)if(Math.abs(f)>a.params.threshold||J){if(!J){J=!0;a.touches.startX=a.touches.currentX;a.touches.startY=a.touches.currentY;la=ja;a.touches.diff=
a.isHorizontal()?a.touches.currentX-a.touches.startX:a.touches.currentY-a.touches.startY;return}}else{la=ja;return}a.params.followFinger&&((a.params.freeMode||a.params.watchSlidesProgress)&&a.updateActiveIndex(),a.params.freeMode&&(0===ca.length&&ca.push({position:a.touches[a.isHorizontal()?"startX":"startY"],time:na}),ca.push({position:a.touches[a.isHorizontal()?"currentX":"currentY"],time:(new window.Date).getTime()})),a.updateProgress(la),a.setWrapperTranslate(la))}}}};a.onTouchEnd=function(b){b.originalEvent&&
(b=b.originalEvent);ia&&a.emit("onTouchEnd",a,b);ia=!1;if(da){a.params.grabCursor&&ha&&da&&(!0===a.params.allowSwipeToNext||!0===a.params.allowSwipeToPrev)&&a.setGrabCursor(!1);var f=Date.now(),G=f-na;a.allowClick&&(a.updateClickedSlide(b),a.emit("onTap",a,b),300>G&&300<f-z&&(B&&clearTimeout(B),B=setTimeout(function(){a&&(a.params.paginationHide&&0<a.paginationContainer.length&&!W(b.target).hasClass(a.params.bulletClass)&&a.paginationContainer.toggleClass(a.params.paginationHiddenClass),a.emit("onClick",
a,b))},300)),300>G&&300>f-z&&(B&&clearTimeout(B),a.emit("onDoubleTap",a,b)));z=Date.now();setTimeout(function(){a&&(a.allowClick=!0)},0);if(da&&ha&&a.swipeDirection&&0!==a.touches.diff&&la!==ja)if(da=ha=!1,f=a.params.followFinger?a.rtl?a.translate:-a.translate:-la,a.params.freeMode)if(f<-a.minTranslate())a.slideTo(a.activeIndex);else if(f>-a.maxTranslate())a.slides.length<a.snapGrid.length?a.slideTo(a.snapGrid.length-1):a.slideTo(a.slides.length-1);else{if(a.params.freeModeMomentum){if(1<ca.length){f=
ca.pop();var r=ca.pop(),d=f.time-r.time;a.velocity=(f.position-r.position)/d;a.velocity/=2;Math.abs(a.velocity)<a.params.freeModeMinimumVelocity&&(a.velocity=0);if(150<d||300<(new window.Date).getTime()-f.time)a.velocity=0}else a.velocity=0;a.velocity*=a.params.freeModeMomentumVelocityRatio;ca.length=0;f=1E3*a.params.freeModeMomentumRatio;r=a.translate+a.velocity*f;a.rtl&&(r=-r);d=!1;var v=20*Math.abs(a.velocity)*a.params.freeModeMomentumBounceRatio;if(r<a.maxTranslate())if(a.params.freeModeMomentumBounce){r+
a.maxTranslate()<-v&&(r=a.maxTranslate()-v);var O=a.maxTranslate();ra=d=!0}else r=a.maxTranslate();else if(r>a.minTranslate())a.params.freeModeMomentumBounce?(r-a.minTranslate()>v&&(r=a.minTranslate()+v),O=a.minTranslate(),ra=d=!0):r=a.minTranslate();else if(a.params.freeModeSticky){v=0;for(v=0;v<a.snapGrid.length;v+=1)if(a.snapGrid[v]>-r){var E=v;break}r=Math.abs(a.snapGrid[E]-r)<Math.abs(a.snapGrid[E-1]-r)||"next"===a.swipeDirection?a.snapGrid[E]:a.snapGrid[E-1];a.rtl||(r=-r)}if(0!==a.velocity)f=
a.rtl?Math.abs((-r-a.translate)/a.velocity):Math.abs((r-a.translate)/a.velocity);else if(a.params.freeModeSticky){a.slideReset();return}a.params.freeModeMomentumBounce&&d?(a.updateProgress(O),a.setWrapperTransition(f),a.setWrapperTranslate(r),a.onTransitionStart(),a.animating=!0,a.wrapper.transitionEnd(function(){a&&ra&&(a.emit("onMomentumBounce",a),a.setWrapperTransition(a.params.speed),a.setWrapperTranslate(O),a.wrapper.transitionEnd(function(){if(a)a.onTransitionEnd()}))})):a.velocity?(a.updateProgress(r),
a.setWrapperTransition(f),a.setWrapperTranslate(r),a.onTransitionStart(),a.animating||(a.animating=!0,a.wrapper.transitionEnd(function(){if(a)a.onTransitionEnd()}))):a.updateProgress(r);a.updateActiveIndex()}if(!a.params.freeModeMomentum||G>=a.params.longSwipesMs)a.updateProgress(),a.updateActiveIndex()}else{E=0;d=a.slidesSizesGrid[0];for(r=0;r<a.slidesGrid.length;r+=a.params.slidesPerGroup)"undefined"!==typeof a.slidesGrid[r+a.params.slidesPerGroup]?f>=a.slidesGrid[r]&&f<a.slidesGrid[r+a.params.slidesPerGroup]&&
(E=r,d=a.slidesGrid[r+a.params.slidesPerGroup]-a.slidesGrid[r]):f>=a.slidesGrid[r]&&(E=r,d=a.slidesGrid[a.slidesGrid.length-1]-a.slidesGrid[a.slidesGrid.length-2]);f=(f-a.slidesGrid[E])/d;G>a.params.longSwipesMs?a.params.longSwipes?("next"===a.swipeDirection&&(f>=a.params.longSwipesRatio?a.slideTo(E+a.params.slidesPerGroup):a.slideTo(E)),"prev"===a.swipeDirection&&(f>1-a.params.longSwipesRatio?a.slideTo(E+a.params.slidesPerGroup):a.slideTo(E))):a.slideTo(a.activeIndex):a.params.shortSwipes?("next"===
a.swipeDirection&&a.slideTo(E+a.params.slidesPerGroup),"prev"===a.swipeDirection&&a.slideTo(E)):a.slideTo(a.activeIndex)}else da=ha=!1}};a._slideTo=function(b,f){return a.slideTo(b,f,!0,!0)};a.slideTo=function(b,f,G,r){"undefined"===typeof G&&(G=!0);"undefined"===typeof b&&(b=0);0>b&&(b=0);a.snapIndex=Math.floor(b/a.params.slidesPerGroup);a.snapIndex>=a.snapGrid.length&&(a.snapIndex=a.snapGrid.length-1);var d=-a.snapGrid[a.snapIndex];a.params.autoplay&&a.autoplaying&&(r||!a.params.autoplayDisableOnInteraction?
a.pauseAutoplay(f):a.stopAutoplay());a.updateProgress(d);if(a.params.normalizeSlideIndex)for(r=0;r<a.slidesGrid.length;r++)-Math.floor(100*d)>=Math.floor(100*a.slidesGrid[r])&&(b=r);if(!a.params.allowSwipeToNext&&d<a.translate&&d<a.minTranslate()||!a.params.allowSwipeToPrev&&d>a.translate&&d>a.maxTranslate()&&(a.activeIndex||0)!==b)return!1;"undefined"===typeof f&&(f=a.params.speed);a.previousIndex=a.activeIndex||0;a.activeIndex=b;a.updateRealIndex();if(a.rtl&&-d===a.translate||!a.rtl&&d===a.translate)return a.params.autoHeight&&
a.updateAutoHeight(),a.updateClasses(),"slide"!==a.params.effect&&a.setWrapperTranslate(d),!1;a.updateClasses();a.onTransitionStart(G);0===f||a.browser.lteIE9?(a.setWrapperTranslate(d),a.setWrapperTransition(0),a.onTransitionEnd(G)):(a.setWrapperTranslate(d),a.setWrapperTransition(f),a.animating||(a.animating=!0,a.wrapper.transitionEnd(function(){if(a)a.onTransitionEnd(G)})));return!0};a.onTransitionStart=function(b){"undefined"===typeof b&&(b=!0);a.params.autoHeight&&a.updateAutoHeight();if(a.lazy)a.lazy.onTransitionStart();
b&&(a.emit("onTransitionStart",a),a.activeIndex!==a.previousIndex&&(a.emit("onSlideChangeStart",a),a.activeIndex>a.previousIndex?a.emit("onSlideNextStart",a):a.emit("onSlidePrevStart",a)))};a.onTransitionEnd=function(b){a.animating=!1;a.setWrapperTransition(0);"undefined"===typeof b&&(b=!0);if(a.lazy)a.lazy.onTransitionEnd();b&&(a.emit("onTransitionEnd",a),a.activeIndex!==a.previousIndex&&(a.emit("onSlideChangeEnd",a),a.activeIndex>a.previousIndex?a.emit("onSlideNextEnd",a):a.emit("onSlidePrevEnd",
a)));a.params.history&&a.history&&a.history.setHistory(a.params.history,a.activeIndex);a.params.hashnav&&a.hashnav&&a.hashnav.setHash()};a.slideNext=function(b,f,G){if(a.params.loop){if(a.animating)return!1;a.fixLoop()}return a.slideTo(a.activeIndex+a.params.slidesPerGroup,f,b,G)};a._slideNext=function(b){return a.slideNext(!0,b,!0)};a.slidePrev=function(b,f,G){if(a.params.loop){if(a.animating)return!1;a.fixLoop()}return a.slideTo(a.activeIndex-1,f,b,G)};a._slidePrev=function(b){return a.slidePrev(!0,
b,!0)};a.slideReset=function(b,f,G){return a.slideTo(a.activeIndex,f,b)};a.disableTouchControl=function(){return a.params.onlyExternal=!0};a.enableTouchControl=function(){a.params.onlyExternal=!1;return!0};a.setWrapperTransition=function(b,f){a.wrapper.transition(b);"slide"!==a.params.effect&&a.effects[a.params.effect]&&a.effects[a.params.effect].setTransition(b);a.params.parallax&&a.parallax&&a.parallax.setTransition(b);a.params.scrollbar&&a.scrollbar&&a.scrollbar.setTransition(b);a.params.control&&
a.controller&&a.controller.setTransition(b,f);a.emit("onSetTransition",a,b)};a.setWrapperTranslate=function(b,f,G){var r=0,d=0;a.isHorizontal()?r=a.rtl?-b:b:d=b;a.params.roundLengths&&(r=Math.floor(r),d=Math.floor(d));a.params.virtualTranslate||(a.support.transforms3d?a.wrapper.transform("translate3d("+r+"px, "+d+"px, 0px)"):a.wrapper.transform("translate("+r+"px, "+d+"px)"));a.translate=a.isHorizontal()?r:d;r=a.maxTranslate()-a.minTranslate();(0===r?0:(b-a.minTranslate())/r)!==a.progress&&a.updateProgress(b);
f&&a.updateActiveIndex();"slide"!==a.params.effect&&a.effects[a.params.effect]&&a.effects[a.params.effect].setTranslate(a.translate);a.params.parallax&&a.parallax&&a.parallax.setTranslate(a.translate);a.params.scrollbar&&a.scrollbar&&a.scrollbar.setTranslate(a.translate);a.params.control&&a.controller&&a.controller.setTranslate(a.translate,G);a.emit("onSetTranslate",a,a.translate)};a.getTranslate=function(b,f){"undefined"===typeof f&&(f="x");if(a.params.virtualTranslate)return a.rtl?-a.translate:
a.translate;b=window.getComputedStyle(b,null);if(window.WebKitCSSMatrix){var G=b.transform||b.webkitTransform;6<G.split(",").length&&(G=G.split(", ").map(function(d){return d.replace(",",".")}).join(", "));b=new window.WebKitCSSMatrix("none"===G?"":G)}else{b=b.MozTransform||b.OTransform||b.MsTransform||b.msTransform||b.transform||b.getPropertyValue("transform").replace("translate(","matrix(1, 0, 0, 1,");var r=b.toString().split(",")}"x"===f&&(G=window.WebKitCSSMatrix?b.m41:16===r.length?parseFloat(r[12]):
parseFloat(r[4]));"y"===f&&(G=window.WebKitCSSMatrix?b.m42:16===r.length?parseFloat(r[13]):parseFloat(r[5]));a.rtl&&G&&(G=-G);return G||0};a.getWrapperTranslate=function(b){"undefined"===typeof b&&(b=a.isHorizontal()?"x":"y");return a.getTranslate(a.wrapper[0],b)};a.observers=[];a.initObservers=function(){if(a.params.observeParents)for(var b=a.container.parents(),f=0;f<b.length;f++)l(b[f]);l(a.container[0],{childList:!1});l(a.wrapper[0],{attributes:!1})};a.disconnectObservers=function(){for(var b=
0;b<a.observers.length;b++)a.observers[b].disconnect();a.observers=[]};a.createLoop=function(){a.wrapper.children("."+a.params.slideClass+"."+a.params.slideDuplicateClass).remove();var b=a.wrapper.children("."+a.params.slideClass);"auto"!==a.params.slidesPerView||a.params.loopedSlides||(a.params.loopedSlides=b.length);a.loopedSlides=parseInt(a.params.loopedSlides||a.params.slidesPerView,10);a.loopedSlides+=a.params.loopAdditionalSlides;a.loopedSlides>b.length&&(a.loopedSlides=b.length);var f=[],G=
[],r;b.each(function(d,v){var O=W(this);d<a.loopedSlides&&G.push(v);d<b.length&&d>=b.length-a.loopedSlides&&f.push(v);O.attr("data-swiper-slide-index",d)});for(r=0;r<G.length;r++)a.wrapper.append(W(G[r].cloneNode(!0)).addClass(a.params.slideDuplicateClass));for(r=f.length-1;0<=r;r--)a.wrapper.prepend(W(f[r].cloneNode(!0)).addClass(a.params.slideDuplicateClass))};a.destroyLoop=function(){a.wrapper.children("."+a.params.slideClass+"."+a.params.slideDuplicateClass).remove();a.slides.removeAttr("data-swiper-slide-index")};
a.reLoop=function(b){var f=a.activeIndex-a.loopedSlides;a.destroyLoop();a.createLoop();a.updateSlidesSize();b&&a.slideTo(f+a.loopedSlides,0,!1)};a.fixLoop=function(){if(a.activeIndex<a.loopedSlides){var b=a.slides.length-3*a.loopedSlides+a.activeIndex;b+=a.loopedSlides;a.slideTo(b,0,!1,!0)}else if("auto"===a.params.slidesPerView&&a.activeIndex>=2*a.loopedSlides||a.activeIndex>a.slides.length-2*a.params.slidesPerView)b=-a.slides.length+a.activeIndex+a.loopedSlides,b+=a.loopedSlides,a.slideTo(b,0,!1,
!0)};a.appendSlide=function(b){a.params.loop&&a.destroyLoop();if("object"===typeof b&&b.length)for(var f=0;f<b.length;f++)b[f]&&a.wrapper.append(b[f]);else a.wrapper.append(b);a.params.loop&&a.createLoop();a.params.observer&&a.support.observer||a.update(!0)};a.prependSlide=function(b){a.params.loop&&a.destroyLoop();var f=a.activeIndex+1;if("object"===typeof b&&b.length){for(f=0;f<b.length;f++)b[f]&&a.wrapper.prepend(b[f]);f=a.activeIndex+b.length}else a.wrapper.prepend(b);a.params.loop&&a.createLoop();
a.params.observer&&a.support.observer||a.update(!0);a.slideTo(f,0,!1)};a.removeSlide=function(b){a.params.loop&&(a.destroyLoop(),a.slides=a.wrapper.children("."+a.params.slideClass));var f=a.activeIndex;if("object"===typeof b&&b.length)for(var G=0;G<b.length;G++){var r=b[G];a.slides[r]&&a.slides.eq(r).remove();r<f&&f--}else r=b,a.slides[r]&&a.slides.eq(r).remove(),r<f&&f--;f=Math.max(f,0);a.params.loop&&a.createLoop();a.params.observer&&a.support.observer||a.update(!0);a.params.loop?a.slideTo(f+a.loopedSlides,
0,!1):a.slideTo(f,0,!1)};a.removeAllSlides=function(){for(var b=[],f=0;f<a.slides.length;f++)b.push(f);a.removeSlide(b)};a.effects={fade:{setTranslate:function(){for(var b=0;b<a.slides.length;b++){var f=a.slides.eq(b),G=-f[0].swiperSlideOffset;a.params.virtualTranslate||(G-=a.translate);var r=0;a.isHorizontal()||(r=G,G=0);f.css({opacity:a.params.fade.crossFade?Math.max(1-Math.abs(f[0].progress),0):1+Math.min(Math.max(f[0].progress,-1),0)}).transform("translate3d("+G+"px, "+r+"px, 0px)")}},setTransition:function(b){a.slides.transition(b);
if(a.params.virtualTranslate&&0!==b){var f=!1;a.slides.transitionEnd(function(){if(!f&&a){f=!0;a.animating=!1;for(var G=["webkitTransitionEnd","transitionend","oTransitionEnd","MSTransitionEnd","msTransitionEnd"],r=0;r<G.length;r++)a.wrapper.trigger(G[r])}})}}},flip:{setTranslate:function(){for(var b=0;b<a.slides.length;b++){var f=a.slides.eq(b),G=f[0].progress;a.params.flip.limitRotation&&(G=Math.max(Math.min(f[0].progress,1),-1));var r=-180*G,d=0,v=-f[0].swiperSlideOffset,O=0;a.isHorizontal()?a.rtl&&
(r=-r):(O=v,v=0,d=-r,r=0);f[0].style.zIndex=-Math.abs(Math.round(G))+a.slides.length;if(a.params.flip.slideShadows){var E=a.isHorizontal()?f.find(".swiper-slide-shadow-left"):f.find(".swiper-slide-shadow-top"),aa=a.isHorizontal()?f.find(".swiper-slide-shadow-right"):f.find(".swiper-slide-shadow-bottom");0===E.length&&(E=W('\x3cdiv class\x3d"swiper-slide-shadow-'+(a.isHorizontal()?"left":"top")+'"\x3e\x3c/div\x3e'),f.append(E));0===aa.length&&(aa=W('\x3cdiv class\x3d"swiper-slide-shadow-'+(a.isHorizontal()?
"right":"bottom")+'"\x3e\x3c/div\x3e'),f.append(aa));E.length&&(E[0].style.opacity=Math.max(-G,0));aa.length&&(aa[0].style.opacity=Math.max(G,0))}f.transform("translate3d("+v+"px, "+O+"px, 0px) rotateX("+d+"deg) rotateY("+r+"deg)")}},setTransition:function(b){a.slides.transition(b).find(".swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left").transition(b);if(a.params.virtualTranslate&&0!==b){var f=!1;a.slides.eq(a.activeIndex).transitionEnd(function(){if(!f&&
a&&W(this).hasClass(a.params.slideActiveClass)){f=!0;a.animating=!1;for(var G=["webkitTransitionEnd","transitionend","oTransitionEnd","MSTransitionEnd","msTransitionEnd"],r=0;r<G.length;r++)a.wrapper.trigger(G[r])}})}}},cube:{setTranslate:function(){var b=0;if(a.params.cube.shadow)if(a.isHorizontal()){var f=a.wrapper.find(".swiper-cube-shadow");0===f.length&&(f=W('\x3cdiv class\x3d"swiper-cube-shadow"\x3e\x3c/div\x3e'),a.wrapper.append(f));f.css({height:a.width+"px"})}else f=a.container.find(".swiper-cube-shadow"),
0===f.length&&(f=W('\x3cdiv class\x3d"swiper-cube-shadow"\x3e\x3c/div\x3e'),a.container.append(f));for(var G=0;G<a.slides.length;G++){var r=a.slides.eq(G),d=90*G,v=Math.floor(d/360);a.rtl&&(d=-d,v=Math.floor(-d/360));var O=Math.max(Math.min(r[0].progress,1),-1),E=0,aa=0,ma=0;0===G%4?(E=4*-v*a.size,ma=0):0===(G-1)%4?(E=0,ma=4*-v*a.size):0===(G-2)%4?(E=a.size+4*v*a.size,ma=a.size):0===(G-3)%4&&(E=-a.size,ma=3*a.size+4*a.size*v);a.rtl&&(E=-E);a.isHorizontal()||(aa=E,E=0);d="rotateX("+(a.isHorizontal()?
0:-d)+"deg) rotateY("+(a.isHorizontal()?d:0)+"deg) translate3d("+E+"px, "+aa+"px, "+ma+"px)";1>=O&&-1<O&&(b=90*G+90*O,a.rtl&&(b=90*-G-90*O));r.transform(d);a.params.cube.slideShadows&&(d=a.isHorizontal()?r.find(".swiper-slide-shadow-left"):r.find(".swiper-slide-shadow-top"),v=a.isHorizontal()?r.find(".swiper-slide-shadow-right"):r.find(".swiper-slide-shadow-bottom"),0===d.length&&(d=W('\x3cdiv class\x3d"swiper-slide-shadow-'+(a.isHorizontal()?"left":"top")+'"\x3e\x3c/div\x3e'),r.append(d)),0===v.length&&
(v=W('\x3cdiv class\x3d"swiper-slide-shadow-'+(a.isHorizontal()?"right":"bottom")+'"\x3e\x3c/div\x3e'),r.append(v)),d.length&&(d[0].style.opacity=Math.max(-O,0)),v.length&&(v[0].style.opacity=Math.max(O,0)))}a.wrapper.css({"-webkit-transform-origin":"50% 50% -"+a.size/2+"px","-moz-transform-origin":"50% 50% -"+a.size/2+"px","-ms-transform-origin":"50% 50% -"+a.size/2+"px","transform-origin":"50% 50% -"+a.size/2+"px"});a.params.cube.shadow&&(a.isHorizontal()?f.transform("translate3d(0px, "+(a.width/
2+a.params.cube.shadowOffset)+"px, "+-a.width/2+"px) rotateX(90deg) rotateZ(0deg) scale("+a.params.cube.shadowScale+")"):(G=Math.abs(b)-90*Math.floor(Math.abs(b)/90),G=a.params.cube.shadowScale/(1.5-(Math.sin(2*G*Math.PI/360)/2+Math.cos(2*G*Math.PI/360)/2)),f.transform("scale3d("+a.params.cube.shadowScale+", 1, "+G+") translate3d(0px, "+(a.height/2+a.params.cube.shadowOffset)+"px, "+-a.height/2/G+"px) rotateX(-90deg)")));a.wrapper.transform("translate3d(0px,0,"+(a.isSafari||a.isUiWebView?-a.size/
2:0)+"px) rotateX("+(a.isHorizontal()?0:b)+"deg) rotateY("+(a.isHorizontal()?-b:0)+"deg)")},setTransition:function(b){a.slides.transition(b).find(".swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left").transition(b);a.params.cube.shadow&&!a.isHorizontal()&&a.container.find(".swiper-cube-shadow").transition(b)}},coverflow:{setTranslate:function(){var b=a.translate;b=a.isHorizontal()?-b+a.width/2:-b+a.height/2;for(var f=a.isHorizontal()?a.params.coverflow.rotate:
-a.params.coverflow.rotate,G=a.params.coverflow.depth,r=0,d=a.slides.length;r<d;r++){var v=a.slides.eq(r),O=a.slidesSizesGrid[r];O=(b-v[0].swiperSlideOffset-O/2)/O*a.params.coverflow.modifier;var E=a.isHorizontal()?f*O:0,aa=a.isHorizontal()?0:f*O,ma=-G*Math.abs(O),va=a.isHorizontal()?0:a.params.coverflow.stretch*O,Aa=a.isHorizontal()?a.params.coverflow.stretch*O:0;.001>Math.abs(Aa)&&(Aa=0);.001>Math.abs(va)&&(va=0);.001>Math.abs(ma)&&(ma=0);.001>Math.abs(E)&&(E=0);.001>Math.abs(aa)&&(aa=0);v.transform("translate3d("+
Aa+"px,"+va+"px,"+ma+"px)  rotateX("+aa+"deg) rotateY("+E+"deg)");v[0].style.zIndex=-Math.abs(Math.round(O))+1;a.params.coverflow.slideShadows&&(E=a.isHorizontal()?v.find(".swiper-slide-shadow-left"):v.find(".swiper-slide-shadow-top"),aa=a.isHorizontal()?v.find(".swiper-slide-shadow-right"):v.find(".swiper-slide-shadow-bottom"),0===E.length&&(E=W('\x3cdiv class\x3d"swiper-slide-shadow-'+(a.isHorizontal()?"left":"top")+'"\x3e\x3c/div\x3e'),v.append(E)),0===aa.length&&(aa=W('\x3cdiv class\x3d"swiper-slide-shadow-'+
(a.isHorizontal()?"right":"bottom")+'"\x3e\x3c/div\x3e'),v.append(aa)),E.length&&(E[0].style.opacity=0<O?O:0),aa.length&&(aa[0].style.opacity=0<-O?-O:0))}a.browser.ie&&(a.wrapper[0].style.perspectiveOrigin=b+"px 50%")},setTransition:function(b){a.slides.transition(b).find(".swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left").transition(b)}}};a.lazy={initialImageLoaded:!1,loadImageInSlide:function(b,f){if("undefined"!==typeof b&&("undefined"===
typeof f&&(f=!0),0!==a.slides.length)){var G=a.slides.eq(b);b=G.find("."+a.params.lazyLoadingClass+":not(."+a.params.lazyStatusLoadedClass+"):not(."+a.params.lazyStatusLoadingClass+")");!G.hasClass(a.params.lazyLoadingClass)||G.hasClass(a.params.lazyStatusLoadedClass)||G.hasClass(a.params.lazyStatusLoadingClass)||(b=b.add(G[0]));0!==b.length&&b.each(function(){var r=W(this);r.addClass(a.params.lazyStatusLoadingClass);var d=r.attr("data-background"),v=r.attr("data-src"),O=r.attr("data-srcset"),E=r.attr("data-sizes");
a.loadImage(r[0],v||d,O,E,!1,function(){if("undefined"!==typeof a&&null!==a&&a){d?(r.css("background-image",'url("'+d+'")'),r.removeAttr("data-background")):(O&&(r.attr("srcset",O),r.removeAttr("data-srcset")),E&&(r.attr("sizes",E),r.removeAttr("data-sizes")),v&&(r.attr("src",v),r.removeAttr("data-src")));r.addClass(a.params.lazyStatusLoadedClass).removeClass(a.params.lazyStatusLoadingClass);G.find("."+a.params.lazyPreloaderClass+", ."+a.params.preloaderClass).remove();if(a.params.loop&&f){var aa=
G.attr("data-swiper-slide-index");G.hasClass(a.params.slideDuplicateClass)?(aa=a.wrapper.children('[data-swiper-slide-index\x3d"'+aa+'"]:not(.'+a.params.slideDuplicateClass+")"),a.lazy.loadImageInSlide(aa.index(),!1)):(aa=a.wrapper.children("."+a.params.slideDuplicateClass+'[data-swiper-slide-index\x3d"'+aa+'"]'),a.lazy.loadImageInSlide(aa.index(),!1))}a.emit("onLazyImageReady",a,G[0],r[0])}});a.emit("onLazyImageLoad",a,G[0],r[0])})}},load:function(){var b,f=a.params.slidesPerView;"auto"===f&&(f=
0);a.lazy.initialImageLoaded||(a.lazy.initialImageLoaded=!0);if(a.params.watchSlidesVisibility)a.wrapper.children("."+a.params.slideVisibleClass).each(function(){a.lazy.loadImageInSlide(W(this).index())});else if(1<f)for(b=a.activeIndex;b<a.activeIndex+f;b++)a.slides[b]&&a.lazy.loadImageInSlide(b);else a.lazy.loadImageInSlide(a.activeIndex);if(a.params.lazyLoadingInPrevNext)if(1<f||a.params.lazyLoadingInPrevNextAmount&&1<a.params.lazyLoadingInPrevNextAmount){b=a.params.lazyLoadingInPrevNextAmount;
var G=f,r=Math.min(a.activeIndex+G+Math.max(b,G),a.slides.length);G=Math.max(a.activeIndex-Math.max(G,b),0);for(b=a.activeIndex+f;b<r;b++)a.slides[b]&&a.lazy.loadImageInSlide(b);for(b=G;b<a.activeIndex;b++)a.slides[b]&&a.lazy.loadImageInSlide(b)}else f=a.wrapper.children("."+a.params.slideNextClass),0<f.length&&a.lazy.loadImageInSlide(f.index()),f=a.wrapper.children("."+a.params.slidePrevClass),0<f.length&&a.lazy.loadImageInSlide(f.index())},onTransitionStart:function(){a.params.lazyLoading&&(a.params.lazyLoadingOnTransitionStart||
!a.params.lazyLoadingOnTransitionStart&&!a.lazy.initialImageLoaded)&&a.lazy.load()},onTransitionEnd:function(){a.params.lazyLoading&&!a.params.lazyLoadingOnTransitionStart&&a.lazy.load()}};H=!1!==a.params.simulateTouch||a.support.touch?a.touchEvents:a.touchEventsDesktop;a.scrollbar={isTouched:!1,setDragPosition:function(b){var f=a.scrollbar;b=(a.isHorizontal()?"touchstart"===b.type||"touchmove"===b.type?b.targetTouches[0].pageX:b.pageX||b.clientX:"touchstart"===b.type||"touchmove"===b.type?b.targetTouches[0].pageY:
b.pageY||b.clientY)-f.track.offset()[a.isHorizontal()?"left":"top"]-f.dragSize/2;var G=-a.minTranslate()*f.moveDivider,r=-a.maxTranslate()*f.moveDivider;b<G?b=G:b>r&&(b=r);b=-b/f.moveDivider;a.updateProgress(b);a.setWrapperTranslate(b,!0)},dragStart:function(b){var f=a.scrollbar;f.isTouched=!0;b.preventDefault();b.stopPropagation();f.setDragPosition(b);clearTimeout(f.dragTimeout);f.track.transition(0);a.params.scrollbarHide&&f.track.css("opacity",1);a.wrapper.transition(100);f.drag.transition(100);
a.emit("onScrollbarDragStart",a)},dragMove:function(b){var f=a.scrollbar;f.isTouched&&(b.preventDefault?b.preventDefault():b.returnValue=!1,f.setDragPosition(b),a.wrapper.transition(0),f.track.transition(0),f.drag.transition(0),a.emit("onScrollbarDragMove",a))},dragEnd:function(b){var f=a.scrollbar;f.isTouched&&(f.isTouched=!1,a.params.scrollbarHide&&(clearTimeout(f.dragTimeout),f.dragTimeout=setTimeout(function(){f.track.css("opacity",0);f.track.transition(400)},1E3)),a.emit("onScrollbarDragEnd",
a),a.params.scrollbarSnapOnRelease&&a.slideReset())},draggableEvents:H,enableDraggable:function(){var b=a.scrollbar,f=a.support.touch?b.track:document;W(b.track).on(b.draggableEvents.start,b.dragStart);W(f).on(b.draggableEvents.move,b.dragMove);W(f).on(b.draggableEvents.end,b.dragEnd)},disableDraggable:function(){var b=a.scrollbar,f=a.support.touch?b.track:document;W(b.track).off(b.draggableEvents.start,b.dragStart);W(f).off(b.draggableEvents.move,b.dragMove);W(f).off(b.draggableEvents.end,b.dragEnd)},
set:function(){if(a.params.scrollbar){var b=a.scrollbar;b.track=W(a.params.scrollbar);a.params.uniqueNavElements&&"string"===typeof a.params.scrollbar&&1<b.track.length&&1===a.container.find(a.params.scrollbar).length&&(b.track=a.container.find(a.params.scrollbar));b.drag=b.track.find(".swiper-scrollbar-drag");0===b.drag.length&&(b.drag=W('\x3cdiv class\x3d"swiper-scrollbar-drag"\x3e\x3c/div\x3e'),b.track.append(b.drag));b.drag[0].style.width="";b.drag[0].style.height="";b.trackSize=a.isHorizontal()?
b.track[0].offsetWidth:b.track[0].offsetHeight;b.divider=a.size/a.virtualSize;b.moveDivider=b.trackSize/a.size*b.divider;b.dragSize=b.trackSize*b.divider;a.isHorizontal()?b.drag[0].style.width=b.dragSize+"px":b.drag[0].style.height=b.dragSize+"px";b.track[0].style.display=1<=b.divider?"none":"";a.params.scrollbarHide&&(b.track[0].style.opacity=0)}},setTranslate:function(){if(a.params.scrollbar){var b=a.scrollbar,f=b.dragSize;var G=(b.trackSize-b.dragSize)*a.progress;a.rtl&&a.isHorizontal()?(G=-G,
0<G?(f=b.dragSize-G,G=0):-G+b.dragSize>b.trackSize&&(f=b.trackSize+G)):0>G?(f=b.dragSize+G,G=0):G+b.dragSize>b.trackSize&&(f=b.trackSize-G);a.isHorizontal()?(a.support.transforms3d?b.drag.transform("translate3d("+G+"px, 0, 0)"):b.drag.transform("translateX("+G+"px)"),b.drag[0].style.width=f+"px"):(a.support.transforms3d?b.drag.transform("translate3d(0px, "+G+"px, 0)"):b.drag.transform("translateY("+G+"px)"),b.drag[0].style.height=f+"px");a.params.scrollbarHide&&(clearTimeout(b.timeout),b.track[0].style.opacity=
1,b.timeout=setTimeout(function(){b.track[0].style.opacity=0;b.track.transition(400)},1E3))}},setTransition:function(b){a.params.scrollbar&&a.scrollbar.drag.transition(b)}};a.controller={LinearSpline:function(b,f){var G=function(){var v,O,E;return function(aa,ma){O=-1;for(v=aa.length;1<v-O;)aa[E=v+O>>1]<=ma?O=E:v=E;return v}}();this.x=b;this.y=f;this.lastIndex=b.length-1;var r,d;this.interpolate=function(v){if(!v)return 0;d=G(this.x,v);r=d-1;return(v-this.x[r])*(this.y[d]-this.y[r])/(this.x[d]-this.x[r])+
this.y[r]}},getInterpolateFunction:function(b){a.controller.spline||(a.controller.spline=a.params.loop?new a.controller.LinearSpline(a.slidesGrid,b.slidesGrid):new a.controller.LinearSpline(a.snapGrid,b.snapGrid))},setTranslate:function(b,f){function G(E){b=E.rtl&&"horizontal"===E.params.direction?-a.translate:a.translate;"slide"===a.params.controlBy&&(a.controller.getInterpolateFunction(E),v=-a.controller.spline.interpolate(-b));v&&"container"!==a.params.controlBy||(d=(E.maxTranslate()-E.minTranslate())/
(a.maxTranslate()-a.minTranslate()),v=(b-a.minTranslate())*d+E.minTranslate());a.params.controlInverse&&(v=E.maxTranslate()-v);E.updateProgress(v);E.setWrapperTranslate(v,!1,a);E.updateActiveIndex()}var r=a.params.control,d,v;if(Array.isArray(r))for(var O=0;O<r.length;O++)r[O]!==f&&r[O]instanceof t&&G(r[O]);else r instanceof t&&f!==r&&G(r)},setTransition:function(b,f){function G(v){v.setWrapperTransition(b,a);0!==b&&(v.onTransitionStart(),v.wrapper.transitionEnd(function(){r&&(v.params.loop&&"slide"===
a.params.controlBy&&v.fixLoop(),v.onTransitionEnd())}))}var r=a.params.control,d;if(Array.isArray(r))for(d=0;d<r.length;d++)r[d]!==f&&r[d]instanceof t&&G(r[d]);else r instanceof t&&f!==r&&G(r)}};a.hashnav={onHashCange:function(b,f){b=document.location.hash.replace("#","");f=a.slides.eq(a.activeIndex).attr("data-hash");b!==f&&a.slideTo(a.wrapper.children("."+a.params.slideClass+'[data-hash\x3d"'+b+'"]').index())},attachEvents:function(b){b=b?"off":"on";W(window)[b]("hashchange",a.hashnav.onHashCange)},
setHash:function(){if(a.hashnav.initialized&&a.params.hashnav)if(a.params.replaceState&&window.history&&window.history.replaceState)window.history.replaceState(null,null,"#"+a.slides.eq(a.activeIndex).attr("data-hash")||"");else{var b=a.slides.eq(a.activeIndex);b=b.attr("data-hash")||b.attr("data-history");document.location.hash=b||""}},init:function(){if(a.params.hashnav&&!a.params.history){a.hashnav.initialized=!0;var b=document.location.hash.replace("#","");if(b)for(var f=0,G=a.slides.length;f<
G;f++){var r=a.slides.eq(f);(r.attr("data-hash")||r.attr("data-history"))!==b||r.hasClass(a.params.slideDuplicateClass)||(r=r.index(),a.slideTo(r,0,a.params.runCallbacksOnInit,!0))}a.params.hashnavWatchState&&a.hashnav.attachEvents()}},destroy:function(){a.params.hashnavWatchState&&a.hashnav.attachEvents(!0)}};a.history={init:function(){if(a.params.history)if(window.history&&window.history.pushState){if(a.history.initialized=!0,this.paths=this.getPathValues(),this.paths.key||this.paths.value)this.scrollToSlide(0,
this.paths.value,a.params.runCallbacksOnInit),a.params.replaceState||window.addEventListener("popstate",this.setHistoryPopState)}else a.params.history=!1,a.params.hashnav=!0},setHistoryPopState:function(){a.history.paths=a.history.getPathValues();a.history.scrollToSlide(a.params.speed,a.history.paths.value,!1)},getPathValues:function(){var b=window.location.pathname.slice(1).split("/"),f=b.length;return{key:b[f-2],value:b[f-1]}},setHistory:function(b,f){a.history.initialized&&a.params.history&&(f=
a.slides.eq(f),f=this.slugify(f.attr("data-history")),window.location.pathname.includes(b)||(f=b+"/"+f),a.params.replaceState?window.history.replaceState(null,null,f):window.history.pushState(null,null,f))},slugify:function(b){return b.toString().toLowerCase().replace(/\s+/g,"-").replace(/[^\w\-]+/g,"").replace(/\-\-+/g,"-").replace(/^-+/,"").replace(/-+$/,"")},scrollToSlide:function(b,f,G){if(f)for(var r=0,d=a.slides.length;r<d;r++){var v=a.slides.eq(r);this.slugify(v.attr("data-history"))!==f||
v.hasClass(a.params.slideDuplicateClass)||(v=v.index(),a.slideTo(v,b,G))}else a.slideTo(0,b,G)}};a.disableKeyboardControl=function(){a.params.keyboardControl=!1;W(document).off("keydown",m)};a.enableKeyboardControl=function(){a.params.keyboardControl=!0;W(document).on("keydown",m)};a.mousewheel={event:!1,lastScrollTime:(new window.Date).getTime()};a.params.mousewheelControl&&(a.mousewheel.event=-1<navigator.userAgent.indexOf("firefox")?"DOMMouseScroll":n()?"wheel":"mousewheel");a.disableMousewheelControl=
function(){if(!a.mousewheel.event)return!1;var b=a.container;"container"!==a.params.mousewheelEventsTarged&&(b=W(a.params.mousewheelEventsTarged));b.off(a.mousewheel.event,x);a.params.mousewheelControl=!1;return!0};a.enableMousewheelControl=function(){if(!a.mousewheel.event)return!1;var b=a.container;"container"!==a.params.mousewheelEventsTarged&&(b=W(a.params.mousewheelEventsTarged));b.on(a.mousewheel.event,x);return a.params.mousewheelControl=!0};a.parallax={setTranslate:function(){a.container.children("[data-swiper-parallax], [data-swiper-parallax-x], [data-swiper-parallax-y]").each(function(){I(this,
a.progress)});a.slides.each(function(){var b=W(this);b.find("[data-swiper-parallax], [data-swiper-parallax-x], [data-swiper-parallax-y]").each(function(){I(this,Math.min(Math.max(b[0].progress,-1),1))})})},setTransition:function(b){"undefined"===typeof b&&(b=a.params.speed);a.container.find("[data-swiper-parallax], [data-swiper-parallax-x], [data-swiper-parallax-y]").each(function(){var f=W(this),G=parseInt(f.attr("data-swiper-parallax-duration"),10)||b;0===b&&(G=0);f.transition(G)})}};a.zoom={scale:1,
currentScale:1,isScaling:!1,gesture:{slide:void 0,slideWidth:void 0,slideHeight:void 0,image:void 0,imageWrap:void 0,zoomMax:a.params.zoomMax},image:{isTouched:void 0,isMoved:void 0,currentX:void 0,currentY:void 0,minX:void 0,minY:void 0,maxX:void 0,maxY:void 0,width:void 0,height:void 0,startX:void 0,startY:void 0,touchesStart:{},touchesCurrent:{}},velocity:{x:void 0,y:void 0,prevPositionX:void 0,prevPositionY:void 0,prevTime:void 0},getDistanceBetweenTouches:function(b){return 2>b.targetTouches.length?
1:Math.sqrt(Math.pow(b.targetTouches[1].pageX-b.targetTouches[0].pageX,2)+Math.pow(b.targetTouches[1].pageY-b.targetTouches[0].pageY,2))},onGestureStart:function(b){var f=a.zoom;if(!a.support.gestures){if("touchstart"!==b.type||"touchstart"===b.type&&2>b.targetTouches.length)return;f.gesture.scaleStart=f.getDistanceBetweenTouches(b)}if(!f.gesture.slide||!f.gesture.slide.length)if(f.gesture.slide=W(this),0===f.gesture.slide.length&&(f.gesture.slide=a.slides.eq(a.activeIndex)),f.gesture.image=f.gesture.slide.find("img, svg, canvas"),
f.gesture.imageWrap=f.gesture.image.parent("."+a.params.zoomContainerClass),f.gesture.zoomMax=f.gesture.imageWrap.attr("data-swiper-zoom")||a.params.zoomMax,0===f.gesture.imageWrap.length){f.gesture.image=void 0;return}f.gesture.image.transition(0);f.isScaling=!0},onGestureChange:function(b){var f=a.zoom;if(!a.support.gestures){if("touchmove"!==b.type||"touchmove"===b.type&&2>b.targetTouches.length)return;f.gesture.scaleMove=f.getDistanceBetweenTouches(b)}f.gesture.image&&0!==f.gesture.image.length&&
(f.scale=a.support.gestures?b.scale*f.currentScale:f.gesture.scaleMove/f.gesture.scaleStart*f.currentScale,f.scale>f.gesture.zoomMax&&(f.scale=f.gesture.zoomMax-1+Math.pow(f.scale-f.gesture.zoomMax+1,.5)),f.scale<a.params.zoomMin&&(f.scale=a.params.zoomMin+1-Math.pow(a.params.zoomMin-f.scale+1,.5)),f.gesture.image.transform("translate3d(0,0,0) scale("+f.scale+")"))},onGestureEnd:function(b){var f=a.zoom;!a.support.gestures&&("touchend"!==b.type||"touchend"===b.type&&2>b.changedTouches.length)||!f.gesture.image||
0===f.gesture.image.length||(f.scale=Math.max(Math.min(f.scale,f.gesture.zoomMax),a.params.zoomMin),f.gesture.image.transition(a.params.speed).transform("translate3d(0,0,0) scale("+f.scale+")"),f.currentScale=f.scale,f.isScaling=!1,1===f.scale&&(f.gesture.slide=void 0))},onTouchStart:function(b,f){var G=b.zoom;G.gesture.image&&0!==G.gesture.image.length&&!G.image.isTouched&&("android"===b.device.os&&f.preventDefault(),G.image.isTouched=!0,G.image.touchesStart.x="touchstart"===f.type?f.targetTouches[0].pageX:
f.pageX,G.image.touchesStart.y="touchstart"===f.type?f.targetTouches[0].pageY:f.pageY)},onTouchMove:function(b){var f=a.zoom;if(f.gesture.image&&0!==f.gesture.image.length&&(a.allowClick=!1,f.image.isTouched&&f.gesture.slide)){f.image.isMoved||(f.image.width=f.gesture.image[0].offsetWidth,f.image.height=f.gesture.image[0].offsetHeight,f.image.startX=a.getTranslate(f.gesture.imageWrap[0],"x")||0,f.image.startY=a.getTranslate(f.gesture.imageWrap[0],"y")||0,f.gesture.slideWidth=f.gesture.slide[0].offsetWidth,
f.gesture.slideHeight=f.gesture.slide[0].offsetHeight,f.gesture.imageWrap.transition(0),a.rtl&&(f.image.startX=-f.image.startX),a.rtl&&(f.image.startY=-f.image.startY));var G=f.image.width*f.scale,r=f.image.height*f.scale;if(!(G<f.gesture.slideWidth&&r<f.gesture.slideHeight)){f.image.minX=Math.min(f.gesture.slideWidth/2-G/2,0);f.image.maxX=-f.image.minX;f.image.minY=Math.min(f.gesture.slideHeight/2-r/2,0);f.image.maxY=-f.image.minY;f.image.touchesCurrent.x="touchmove"===b.type?b.targetTouches[0].pageX:
b.pageX;f.image.touchesCurrent.y="touchmove"===b.type?b.targetTouches[0].pageY:b.pageY;if(!f.image.isMoved&&!f.isScaling){if(a.isHorizontal()&&Math.floor(f.image.minX)===Math.floor(f.image.startX)&&f.image.touchesCurrent.x<f.image.touchesStart.x||Math.floor(f.image.maxX)===Math.floor(f.image.startX)&&f.image.touchesCurrent.x>f.image.touchesStart.x){f.image.isTouched=!1;return}if(!a.isHorizontal()&&Math.floor(f.image.minY)===Math.floor(f.image.startY)&&f.image.touchesCurrent.y<f.image.touchesStart.y||
Math.floor(f.image.maxY)===Math.floor(f.image.startY)&&f.image.touchesCurrent.y>f.image.touchesStart.y){f.image.isTouched=!1;return}}b.preventDefault();b.stopPropagation();f.image.isMoved=!0;f.image.currentX=f.image.touchesCurrent.x-f.image.touchesStart.x+f.image.startX;f.image.currentY=f.image.touchesCurrent.y-f.image.touchesStart.y+f.image.startY;f.image.currentX<f.image.minX&&(f.image.currentX=f.image.minX+1-Math.pow(f.image.minX-f.image.currentX+1,.8));f.image.currentX>f.image.maxX&&(f.image.currentX=
f.image.maxX-1+Math.pow(f.image.currentX-f.image.maxX+1,.8));f.image.currentY<f.image.minY&&(f.image.currentY=f.image.minY+1-Math.pow(f.image.minY-f.image.currentY+1,.8));f.image.currentY>f.image.maxY&&(f.image.currentY=f.image.maxY-1+Math.pow(f.image.currentY-f.image.maxY+1,.8));f.velocity.prevPositionX||(f.velocity.prevPositionX=f.image.touchesCurrent.x);f.velocity.prevPositionY||(f.velocity.prevPositionY=f.image.touchesCurrent.y);f.velocity.prevTime||(f.velocity.prevTime=Date.now());f.velocity.x=
(f.image.touchesCurrent.x-f.velocity.prevPositionX)/(Date.now()-f.velocity.prevTime)/2;f.velocity.y=(f.image.touchesCurrent.y-f.velocity.prevPositionY)/(Date.now()-f.velocity.prevTime)/2;2>Math.abs(f.image.touchesCurrent.x-f.velocity.prevPositionX)&&(f.velocity.x=0);2>Math.abs(f.image.touchesCurrent.y-f.velocity.prevPositionY)&&(f.velocity.y=0);f.velocity.prevPositionX=f.image.touchesCurrent.x;f.velocity.prevPositionY=f.image.touchesCurrent.y;f.velocity.prevTime=Date.now();f.gesture.imageWrap.transform("translate3d("+
f.image.currentX+"px, "+f.image.currentY+"px,0)")}}},onTouchEnd:function(b,f){b=b.zoom;if(b.gesture.image&&0!==b.gesture.image.length)if(b.image.isTouched&&b.image.isMoved){b.image.isTouched=!1;b.image.isMoved=!1;var G=300,r=300;f=b.image.currentX+b.velocity.x*G;var d=b.image.currentY+b.velocity.y*r;0!==b.velocity.x&&(G=Math.abs((f-b.image.currentX)/b.velocity.x));0!==b.velocity.y&&(r=Math.abs((d-b.image.currentY)/b.velocity.y));G=Math.max(G,r);b.image.currentX=f;b.image.currentY=d;f=b.image.height*
b.scale;b.image.minX=Math.min(b.gesture.slideWidth/2-b.image.width*b.scale/2,0);b.image.maxX=-b.image.minX;b.image.minY=Math.min(b.gesture.slideHeight/2-f/2,0);b.image.maxY=-b.image.minY;b.image.currentX=Math.max(Math.min(b.image.currentX,b.image.maxX),b.image.minX);b.image.currentY=Math.max(Math.min(b.image.currentY,b.image.maxY),b.image.minY);b.gesture.imageWrap.transition(G).transform("translate3d("+b.image.currentX+"px, "+b.image.currentY+"px,0)")}else b.image.isTouched=!1,b.image.isMoved=!1},
onTransitionEnd:function(b){var f=b.zoom;f.gesture.slide&&b.previousIndex!==b.activeIndex&&(f.gesture.image.transform("translate3d(0,0,0) scale(1)"),f.gesture.imageWrap.transform("translate3d(0,0,0)"),f.gesture.slide=f.gesture.image=f.gesture.imageWrap=void 0,f.scale=f.currentScale=1)},toggleZoom:function(b,f){var G=b.zoom;G.gesture.slide||(G.gesture.slide=b.clickedSlide?W(b.clickedSlide):b.slides.eq(b.activeIndex),G.gesture.image=G.gesture.slide.find("img, svg, canvas"),G.gesture.imageWrap=G.gesture.image.parent("."+
b.params.zoomContainerClass));if(G.gesture.image&&0!==G.gesture.image.length){if("undefined"===typeof G.image.touchesStart.x&&f){var r="touchend"===f.type?f.changedTouches[0].pageX:f.pageX;var d="touchend"===f.type?f.changedTouches[0].pageY:f.pageY}else r=G.image.touchesStart.x,d=G.image.touchesStart.y;if(G.scale&&1!==G.scale)G.scale=G.currentScale=1,G.gesture.imageWrap.transition(300).transform("translate3d(0,0,0)"),G.gesture.image.transition(300).transform("translate3d(0,0,0) scale(1)"),G.gesture.slide=
void 0;else{G.scale=G.currentScale=G.gesture.imageWrap.attr("data-swiper-zoom")||b.params.zoomMax;if(f){var v=G.gesture.slide[0].offsetWidth;f=G.gesture.slide[0].offsetHeight;var O=G.gesture.slide.offset().left;b=G.gesture.slide.offset().top;var E=G.gesture.image[0].offsetWidth;var aa=G.gesture.image[0].offsetHeight;E*=G.scale;var ma=aa*G.scale;aa=Math.min(v/2-E/2,0);E=Math.min(f/2-ma/2,0);ma=-aa;var va=-E;r=(O+v/2-r)*G.scale;d=(b+f/2-d)*G.scale;r<aa&&(r=aa);r>ma&&(r=ma);d<E&&(d=E);d>va&&(d=va)}else d=
r=0;G.gesture.imageWrap.transition(300).transform("translate3d("+r+"px, "+d+"px,0)");G.gesture.image.transition(300).transform("translate3d(0,0,0) scale("+G.scale+")")}}},attachEvents:function(b){var f=b?"off":"on";if(a.params.zoom&&(b="touchstart"===a.touchEvents.start&&a.support.passiveListener&&a.params.passiveListeners?{passive:!0,capture:!1}:!1,a.support.gestures?(a.slides[f]("gesturestart",a.zoom.onGestureStart,b),a.slides[f]("gesturechange",a.zoom.onGestureChange,b),a.slides[f]("gestureend",
a.zoom.onGestureEnd,b)):"touchstart"===a.touchEvents.start&&(a.slides[f](a.touchEvents.start,a.zoom.onGestureStart,b),a.slides[f](a.touchEvents.move,a.zoom.onGestureChange,b),a.slides[f](a.touchEvents.end,a.zoom.onGestureEnd,b)),a[f]("touchStart",a.zoom.onTouchStart),a.slides.each(function(G,r){if(0<W(r).find("."+a.params.zoomContainerClass).length)W(r)[f](a.touchEvents.move,a.zoom.onTouchMove)}),a[f]("touchEnd",a.zoom.onTouchEnd),a[f]("transitionEnd",a.zoom.onTransitionEnd),a.params.zoomToggle))a.on("doubleTap",
a.zoom.toggleZoom)},init:function(){a.zoom.attachEvents()},destroy:function(){a.zoom.attachEvents(!0)}};a._plugins=[];for(var za in a.plugins)(H=a.plugins[za](a,a.params[za]))&&a._plugins.push(H);a.callPlugins=function(b,f,G,r,d,v){for(var O=0;O<a._plugins.length;O++)if(b in a._plugins[O])a._plugins[O][b](f,G,r,d,v)};a.emitterEventListeners={};a.emit=function(b,f,G,r,d,v){if(a.params[b])a.params[b](f,G,r,d,v);var O;if(a.emitterEventListeners[b])for(O=0;O<a.emitterEventListeners[b].length;O++)a.emitterEventListeners[b][O](f,
G,r,d,v);a.callPlugins&&a.callPlugins(b,f,G,r,d,v)};a.on=function(b,f){b=K(b);a.emitterEventListeners[b]||(a.emitterEventListeners[b]=[]);a.emitterEventListeners[b].push(f);return a};a.off=function(b,f){var G;b=K(b);if("undefined"===typeof f)return a.emitterEventListeners[b]=[],a;if(a.emitterEventListeners[b]&&0!==a.emitterEventListeners[b].length){for(G=0;G<a.emitterEventListeners[b].length;G++)a.emitterEventListeners[b][G]===f&&a.emitterEventListeners[b].splice(G,1);return a}};a.once=function(b,
f){b=K(b);var G=function(r,d,v,O,E){f(r,d,v,O,E);a.off(b,G)};a.on(b,G);return a};a.a11y={makeFocusable:function(b){b.attr("tabIndex","0");return b},addRole:function(b,f){b.attr("role",f);return b},addLabel:function(b,f){b.attr("aria-label",f);return b},disable:function(b){b.attr("aria-disabled",!0);return b},enable:function(b){b.attr("aria-disabled",!1);return b},onEnterKey:function(b){13===b.keyCode&&(W(b.target).is(a.params.nextButton)?(a.onClickNext(b),a.isEnd?a.a11y.notify(a.params.lastSlideMessage):
a.a11y.notify(a.params.nextSlideMessage)):W(b.target).is(a.params.prevButton)&&(a.onClickPrev(b),a.isBeginning?a.a11y.notify(a.params.firstSlideMessage):a.a11y.notify(a.params.prevSlideMessage)),W(b.target).is("."+a.params.bulletClass)&&W(b.target)[0].click())},liveRegion:W('\x3cspan class\x3d"'+a.params.notificationClass+'" aria-live\x3d"assertive" aria-atomic\x3d"true"\x3e\x3c/span\x3e'),notify:function(b){var f=a.a11y.liveRegion;0!==f.length&&(f.html(""),f.html(b))},init:function(){a.params.nextButton&&
a.nextButton&&0<a.nextButton.length&&(a.a11y.makeFocusable(a.nextButton),a.a11y.addRole(a.nextButton,"button"),a.a11y.addLabel(a.nextButton,a.params.nextSlideMessage));a.params.prevButton&&a.prevButton&&0<a.prevButton.length&&(a.a11y.makeFocusable(a.prevButton),a.a11y.addRole(a.prevButton,"button"),a.a11y.addLabel(a.prevButton,a.params.prevSlideMessage));W(a.container).append(a.a11y.liveRegion)},initPagination:function(){a.params.pagination&&a.params.paginationClickable&&a.bullets&&a.bullets.length&&
a.bullets.each(function(){var b=W(this);a.a11y.makeFocusable(b);a.a11y.addRole(b,"button");a.a11y.addLabel(b,a.params.paginationBulletMessage.replace(/{{index}}/,b.index()+1))})},destroy:function(){a.a11y.liveRegion&&0<a.a11y.liveRegion.length&&a.a11y.liveRegion.remove()}};a.init=function(){a.params.loop&&a.createLoop();a.updateContainerSize();a.updateSlidesSize();a.updatePagination();a.params.scrollbar&&a.scrollbar&&(a.scrollbar.set(),a.params.scrollbarDraggable&&a.scrollbar.enableDraggable());"slide"!==
a.params.effect&&a.effects[a.params.effect]&&(a.params.loop||a.updateProgress(),a.effects[a.params.effect].setTranslate());a.params.loop?a.slideTo(a.params.initialSlide+a.loopedSlides,0,a.params.runCallbacksOnInit):(a.slideTo(a.params.initialSlide,0,a.params.runCallbacksOnInit),0===a.params.initialSlide&&(a.parallax&&a.params.parallax&&a.parallax.setTranslate(),a.lazy&&a.params.lazyLoading&&(a.lazy.load(),a.lazy.initialImageLoaded=!0)));a.attachEvents();a.params.observer&&a.support.observer&&a.initObservers();
a.params.preloadImages&&!a.params.lazyLoading&&a.preloadImages();a.params.zoom&&a.zoom&&a.zoom.init();a.params.autoplay&&a.startAutoplay();a.params.keyboardControl&&a.enableKeyboardControl&&a.enableKeyboardControl();a.params.mousewheelControl&&a.enableMousewheelControl&&a.enableMousewheelControl();a.params.hashnavReplaceState&&(a.params.replaceState=a.params.hashnavReplaceState);a.params.history&&a.history&&a.history.init();a.params.hashnav&&a.hashnav&&a.hashnav.init();a.params.a11y&&a.a11y&&a.a11y.init();
a.emit("onInit",a)};a.cleanupStyles=function(){a.container.removeClass(a.classNames.join(" ")).removeAttr("style");a.wrapper.removeAttr("style");a.slides&&a.slides.length&&a.slides.removeClass([a.params.slideVisibleClass,a.params.slideActiveClass,a.params.slideNextClass,a.params.slidePrevClass].join(" ")).removeAttr("style").removeAttr("data-swiper-column").removeAttr("data-swiper-row");a.paginationContainer&&a.paginationContainer.length&&a.paginationContainer.removeClass(a.params.paginationHiddenClass);
a.bullets&&a.bullets.length&&a.bullets.removeClass(a.params.bulletActiveClass);a.params.prevButton&&W(a.params.prevButton).removeClass(a.params.buttonDisabledClass);a.params.nextButton&&W(a.params.nextButton).removeClass(a.params.buttonDisabledClass);a.params.scrollbar&&a.scrollbar&&(a.scrollbar.track&&a.scrollbar.track.length&&a.scrollbar.track.removeAttr("style"),a.scrollbar.drag&&a.scrollbar.drag.length&&a.scrollbar.drag.removeAttr("style"))};a.destroy=function(b,f){a.detachEvents();a.stopAutoplay();
a.params.scrollbar&&a.scrollbar&&a.params.scrollbarDraggable&&a.scrollbar.disableDraggable();a.params.loop&&a.destroyLoop();f&&a.cleanupStyles();a.disconnectObservers();a.params.zoom&&a.zoom&&a.zoom.destroy();a.params.keyboardControl&&a.disableKeyboardControl&&a.disableKeyboardControl();a.params.mousewheelControl&&a.disableMousewheelControl&&a.disableMousewheelControl();a.params.a11y&&a.a11y&&a.a11y.destroy();a.params.history&&!a.params.replaceState&&window.removeEventListener("popstate",a.history.setHistoryPopState);
a.params.hashnav&&a.hashnav&&a.hashnav.destroy();a.emit("onDestroy");!1!==b&&(a=null)};a.init();return a}};t.prototype={isSafari:function(){var H=window.navigator.userAgent.toLowerCase();return 0<=H.indexOf("safari")&&0>H.indexOf("chrome")&&0>H.indexOf("android")}(),isUiWebView:/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/i.test(window.navigator.userAgent),isArray:function(H){return"[object Array]"===Object.prototype.toString.apply(H)},browser:{ie:window.navigator.pointerEnabled||window.navigator.msPointerEnabled,
ieTouch:window.navigator.msPointerEnabled&&1<window.navigator.msMaxTouchPoints||window.navigator.pointerEnabled&&1<window.navigator.maxTouchPoints,lteIE9:function(){var H=document.createElement("div");H.innerHTML="\x3c!--[if lte IE 9]\x3e\x3ci\x3e\x3c/i\x3e\x3c![endif]--\x3e";return 1===H.getElementsByTagName("i").length}()},device:function(){var H=window.navigator.userAgent,y=H.match(/(Android);?[\s\/]+([\d.]+)?/),e=H.match(/(iPad).*OS\s([\d_]+)/),g=H.match(/(iPod)(.*OS\s([\d_]+))?/);H=!e&&H.match(/(iPhone\sOS|iOS)\s([\d_]+)/);
return{ios:e||H||g,android:y}}(),support:{touch:window.Modernizr&&!0===Modernizr.touch||!!("ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch),transforms3d:window.Modernizr&&!0===Modernizr.csstransforms3d||function(){var H=document.createElement("div").style;return"webkitPerspective"in H||"MozPerspective"in H||"OPerspective"in H||"MsPerspective"in H||"perspective"in H}(),flexbox:function(){for(var H=document.createElement("div").style,y="alignItems webkitAlignItems webkitBoxAlign msFlexAlign mozBoxAlign webkitFlexDirection msFlexDirection mozBoxDirection mozBoxOrient webkitBoxDirection webkitBoxOrient".split(" "),
e=0;e<y.length;e++)if(y[e]in H)return!0}(),observer:"MutationObserver"in window||"WebkitMutationObserver"in window,passiveListener:function(){var H=!1;try{var y=Object.defineProperty({},"passive",{get:function(){H=!0}});window.addEventListener("testPassiveListener",null,y)}catch(e){}return H}(),gestures:"ongesturestart"in window},plugins:{}};var Q=function(){var H=function(e){var g=0;for(g=0;g<e.length;g++)this[g]=e[g];this.length=e.length;return this},y=function(e,g){var l=[],m=0;if(e&&!g&&e instanceof
H)return e;if(e)if("string"===typeof e)if(m=e.trim(),0<=m.indexOf("\x3c")&&0<=m.indexOf("\x3e")){g="div";0===m.indexOf("\x3cli")&&(g="ul");0===m.indexOf("\x3ctr")&&(g="tbody");if(0===m.indexOf("\x3ctd")||0===m.indexOf("\x3cth"))g="tr";0===m.indexOf("\x3ctbody")&&(g="table");0===m.indexOf("\x3coption")&&(g="select");g=document.createElement(g);g.innerHTML=e;for(m=0;m<g.childNodes.length;m++)l.push(g.childNodes[m])}else for(e=g||"#"!==e[0]||e.match(/[ .<>:~]/)?(g||document).querySelectorAll(e):[document.getElementById(e.split("#")[1])],
m=0;m<e.length;m++)e[m]&&l.push(e[m]);else if(e.nodeType||e===window||e===document)l.push(e);else if(0<e.length&&e[0].nodeType)for(m=0;m<e.length;m++)l.push(e[m]);return new H(l)};H.prototype={addClass:function(e){if("undefined"===typeof e)return this;e=e.split(" ");for(var g=0;g<e.length;g++)for(var l=0;l<this.length;l++)this[l].classList.add(e[g]);return this},removeClass:function(e){e=e.split(" ");for(var g=0;g<e.length;g++)for(var l=0;l<this.length;l++)this[l].classList.remove(e[g]);return this},
hasClass:function(e){return this[0]?this[0].classList.contains(e):!1},toggleClass:function(e){e=e.split(" ");for(var g=0;g<e.length;g++)for(var l=0;l<this.length;l++)this[l].classList.toggle(e[g]);return this},attr:function(e,g){if(1===arguments.length&&"string"===typeof e){if(this[0])return this[0].getAttribute(e)}else{for(var l=0;l<this.length;l++)if(2===arguments.length)this[l].setAttribute(e,g);else for(var m in e)this[l][m]=e[m],this[l].setAttribute(m,e[m]);return this}},removeAttr:function(e){for(var g=
0;g<this.length;g++)this[g].removeAttribute(e);return this},data:function(e,g){if("undefined"===typeof g){if(this[0]){if(g=this[0].getAttribute("data-"+e))return g;if(this[0].dom7ElementDataStorage&&e in this[0].dom7ElementDataStorage)return this[0].dom7ElementDataStorage[e]}}else{for(var l=0;l<this.length;l++){var m=this[l];m.dom7ElementDataStorage||(m.dom7ElementDataStorage={});m.dom7ElementDataStorage[e]=g}return this}},transform:function(e){for(var g=0;g<this.length;g++){var l=this[g].style;l.webkitTransform=
l.MsTransform=l.msTransform=l.MozTransform=l.OTransform=l.transform=e}return this},transition:function(e){"string"!==typeof e&&(e+="ms");for(var g=0;g<this.length;g++){var l=this[g].style;l.webkitTransitionDuration=l.MsTransitionDuration=l.msTransitionDuration=l.MozTransitionDuration=l.OTransitionDuration=l.transitionDuration=e}return this},on:function(e,g,l,m){function n(I){var K=I.target;if(y(K).is(g))l.call(K,I);else{K=y(K).parents();for(var w=0;w<K.length;w++)y(K[w]).is(g)&&l.call(K[w],I)}}e=
e.split(" ");var h,x;for(h=0;h<this.length;h++)if("function"===typeof g||!1===g)for("function"===typeof g&&(m=(l=g)||!1),x=0;x<e.length;x++)this[h].addEventListener(e[x],l,m);else for(x=0;x<e.length;x++)this[h].dom7LiveListeners||(this[h].dom7LiveListeners=[]),this[h].dom7LiveListeners.push({listener:l,liveListener:n}),this[h].addEventListener(e[x],n,m);return this},off:function(e,g,l,m){e=e.split(" ");for(var n=0;n<e.length;n++)for(var h=0;h<this.length;h++)if("function"===typeof g||!1===g)"function"===
typeof g&&(m=(l=g)||!1),this[h].removeEventListener(e[n],l,m);else if(this[h].dom7LiveListeners)for(var x=0;x<this[h].dom7LiveListeners.length;x++)this[h].dom7LiveListeners[x].listener===l&&this[h].removeEventListener(e[n],this[h].dom7LiveListeners[x].liveListener,m);return this},once:function(e,g,l,m){function n(x){l(x);h.off(e,g,n,m)}var h=this;"function"===typeof g&&(m=l=g=!1);h.on(e,g,n,m)},trigger:function(e,g){for(var l=0;l<this.length;l++){try{var m=new window.CustomEvent(e,{detail:g,bubbles:!0,
cancelable:!0})}catch(n){m=document.createEvent("Event"),m.initEvent(e,!0,!0),m.detail=g}this[l].dispatchEvent(m)}return this},transitionEnd:function(e){function g(h){if(h.target===this)for(e.call(this,h),m=0;m<l.length;m++)n.off(l[m],g)}var l=["webkitTransitionEnd","transitionend","oTransitionEnd","MSTransitionEnd","msTransitionEnd"],m,n=this;if(e)for(m=0;m<l.length;m++)n.on(l[m],g);return this},width:function(){return this[0]===window?window.innerWidth:0<this.length?parseFloat(this.css("width")):
null},outerWidth:function(e){return 0<this.length?e?this[0].offsetWidth+parseFloat(this.css("margin-right"))+parseFloat(this.css("margin-left")):this[0].offsetWidth:null},height:function(){return this[0]===window?window.innerHeight:0<this.length?parseFloat(this.css("height")):null},outerHeight:function(e){return 0<this.length?e?this[0].offsetHeight+parseFloat(this.css("margin-top"))+parseFloat(this.css("margin-bottom")):this[0].offsetHeight:null},offset:function(){if(0<this.length){var e=this[0],
g=e.getBoundingClientRect(),l=document.body;return{top:g.top+(window.pageYOffset||e.scrollTop)-(e.clientTop||l.clientTop||0),left:g.left+(window.pageXOffset||e.scrollLeft)-(e.clientLeft||l.clientLeft||0)}}return null},css:function(e,g){var l;if(1===arguments.length)if("string"===typeof e){if(this[0])return window.getComputedStyle(this[0],null).getPropertyValue(e)}else{for(l=0;l<this.length;l++)for(var m in e)this[l].style[m]=e[m];return this}if(2===arguments.length&&"string"===typeof e)for(l=0;l<
this.length;l++)this[l].style[e]=g;return this},each:function(e){for(var g=0;g<this.length;g++)e.call(this[g],g,this[g]);return this},html:function(e){if("undefined"===typeof e)return this[0]?this[0].innerHTML:void 0;for(var g=0;g<this.length;g++)this[g].innerHTML=e;return this},text:function(e){if("undefined"===typeof e)return this[0]?this[0].textContent.trim():null;for(var g=0;g<this.length;g++)this[g].textContent=e;return this},is:function(e){if(!this[0])return!1;if("string"===typeof e){var g=
this[0];if(g===document)return e===document;if(g===window)return e===window;if(g.matches)return g.matches(e);if(g.webkitMatchesSelector)return g.webkitMatchesSelector(e);if(g.mozMatchesSelector)return g.mozMatchesSelector(e);if(g.msMatchesSelector)return g.msMatchesSelector(e);e=y(e);for(g=0;g<e.length;g++)if(e[g]===this[0])return!0;return!1}if(e===document)return this[0]===document;if(e===window)return this[0]===window;if(e.nodeType||e instanceof H)for(e=e.nodeType?[e]:e,g=0;g<e.length;g++)if(e[g]===
this[0])return!0;return!1},index:function(){if(this[0]){for(var e=this[0],g=0;null!==(e=e.previousSibling);)1===e.nodeType&&g++;return g}},eq:function(e){if("undefined"===typeof e)return this;var g=this.length;return e>g-1?new H([]):0>e?(e=g+e,0>e?new H([]):new H([this[e]])):new H([this[e]])},append:function(e){var g;for(g=0;g<this.length;g++)if("string"===typeof e){var l=document.createElement("div");for(l.innerHTML=e;l.firstChild;)this[g].appendChild(l.firstChild)}else if(e instanceof H)for(l=0;l<
e.length;l++)this[g].appendChild(e[l]);else this[g].appendChild(e);return this},prepend:function(e){var g,l;for(g=0;g<this.length;g++)if("string"===typeof e){var m=document.createElement("div");m.innerHTML=e;for(l=m.childNodes.length-1;0<=l;l--)this[g].insertBefore(m.childNodes[l],this[g].childNodes[0])}else if(e instanceof H)for(l=0;l<e.length;l++)this[g].insertBefore(e[l],this[g].childNodes[0]);else this[g].insertBefore(e,this[g].childNodes[0]);return this},insertBefore:function(e){e=y(e);for(var g=
0;g<this.length;g++)if(1===e.length)e[0].parentNode.insertBefore(this[g],e[0]);else if(1<e.length)for(var l=0;l<e.length;l++)e[l].parentNode.insertBefore(this[g].cloneNode(!0),e[l])},insertAfter:function(e){e=y(e);for(var g=0;g<this.length;g++)if(1===e.length)e[0].parentNode.insertBefore(this[g],e[0].nextSibling);else if(1<e.length)for(var l=0;l<e.length;l++)e[l].parentNode.insertBefore(this[g].cloneNode(!0),e[l].nextSibling)},next:function(e){return 0<this.length?e?this[0].nextElementSibling&&y(this[0].nextElementSibling).is(e)?
new H([this[0].nextElementSibling]):new H([]):this[0].nextElementSibling?new H([this[0].nextElementSibling]):new H([]):new H([])},nextAll:function(e){var g=[],l=this[0];if(!l)return new H([]);for(;l.nextElementSibling;)l=l.nextElementSibling,e?y(l).is(e)&&g.push(l):g.push(l);return new H(g)},prev:function(e){return 0<this.length?e?this[0].previousElementSibling&&y(this[0].previousElementSibling).is(e)?new H([this[0].previousElementSibling]):new H([]):this[0].previousElementSibling?new H([this[0].previousElementSibling]):
new H([]):new H([])},prevAll:function(e){var g=[],l=this[0];if(!l)return new H([]);for(;l.previousElementSibling;)l=l.previousElementSibling,e?y(l).is(e)&&g.push(l):g.push(l);return new H(g)},parent:function(e){for(var g=[],l=0;l<this.length;l++)e?y(this[l].parentNode).is(e)&&g.push(this[l].parentNode):g.push(this[l].parentNode);return y(y.unique(g))},parents:function(e){for(var g=[],l=0;l<this.length;l++)for(var m=this[l].parentNode;m;)e?y(m).is(e)&&g.push(m):g.push(m),m=m.parentNode;return y(y.unique(g))},
find:function(e){for(var g=[],l=0;l<this.length;l++)for(var m=this[l].querySelectorAll(e),n=0;n<m.length;n++)g.push(m[n]);return new H(g)},children:function(e){for(var g=[],l=0;l<this.length;l++)for(var m=this[l].childNodes,n=0;n<m.length;n++)e?1===m[n].nodeType&&y(m[n]).is(e)&&g.push(m[n]):1===m[n].nodeType&&g.push(m[n]);return new H(y.unique(g))},remove:function(){for(var e=0;e<this.length;e++)this[e].parentNode&&this[e].parentNode.removeChild(this[e]);return this},add:function(){var e,g;for(e=
0;e<arguments.length;e++){var l=y(arguments[e]);for(g=0;g<l.length;g++)this[this.length]=l[g],this.length++}return this}};y.fn=H.prototype;y.unique=function(e){for(var g=[],l=0;l<e.length;l++)-1===g.indexOf(e[l])&&g.push(e[l]);return g};return y}(),X=["jQuery","Zepto","Dom7"],R=0;for(;R<X.length;R++)window[X[R]]&&V(window[X[R]]);if(X="undefined"===typeof Q?window.Dom7||window.Zepto||window.jQuery:Q)"transitionEnd"in X.fn||(X.fn.transitionEnd=function(H){function y(m){if(m.target===this)for(H.call(this,
m),g=0;g<e.length;g++)l.off(e[g],y)}var e=["webkitTransitionEnd","transitionend","oTransitionEnd","MSTransitionEnd","msTransitionEnd"],g,l=this;if(H)for(g=0;g<e.length;g++)l.on(e[g],y);return this}),"transform"in X.fn||(X.fn.transform=function(H){for(var y=0;y<this.length;y++){var e=this[y].style;e.webkitTransform=e.MsTransform=e.msTransform=e.MozTransform=e.OTransform=e.transform=H}return this}),"transition"in X.fn||(X.fn.transition=function(H){"string"!==typeof H&&(H+="ms");for(var y=0;y<this.length;y++){var e=
this[y].style;e.webkitTransitionDuration=e.MsTransitionDuration=e.msTransitionDuration=e.MozTransitionDuration=e.OTransitionDuration=e.transitionDuration=H}return this}),"outerWidth"in X.fn||(X.fn.outerWidth=function(H){return 0<this.length?H?this[0].offsetWidth+parseFloat(this.css("margin-right"))+parseFloat(this.css("margin-left")):this[0].offsetWidth:null});window.Swiper=t})();"undefined"!==typeof module?module.exports=window.Swiper:"function"===typeof define&&define.amd&&define([],function(){return window.Swiper})},
"widgets/NearMe/filter-list":function(){define("dojo/_base/declare dojo/text!./filter-list.html dojo/_base/array dojo/_base/html dojo/_base/lang dojo/query dojo/on dojo/dom-attr dojo/keys dijit/_WidgetsInTemplateMixin dojo/dom-class jimu/utils jimu/BaseWidget jimu/filterUtils jimu/dijit/FilterParameters esri/symbols/jsonUtils jimu/symbolUtils jimu/LayerInfos/LayerInfos jimu/FilterManager esri/request dojo/Evented dojo/NodeList dojo/NodeList-dom".split(" "),function(V,W,t,Q,X,R,H,y,e,g,l,m,n,h,x,I,
K,w,L,T,U){return V([n,g,U],{name:"NearMeFilter",templateString:W,lastFocusNode:null,baseClass:"jimu-widget-nearme-filter",_itemTemplate:'\x3cli aria-label\x3d"${layerTitle} ${filterNotAppliedLabel}" role\x3d"listitem" tabindex\x3d"0" class\x3d"filter-item" data-index\x3d"${index}"\x3e\x3cdiv class\x3d"header" \x3e\x3cspan role\x3d"button" aria-label\x3d"${toggleTip}" class\x3d"arrow jimu-float-leading jimu-trailing-margin05" title\x3d"${toggleTip}" \x3e\x3c/span\x3e\x3cspan class\x3d"icon"\x3e\x3cimg src\x3d"${icon}" /\x3e\x3c/span\x3e\x3cspan class\x3d"icon symbolIcon" style\x3d"display:none;"\x3e\x3c/span\x3e\x3cspan class\x3d"item-title"\x3e${title}\x3c/span\x3e\x3cspan class\x3d"cando jimu-float-trailing esriCTFliterListCheckbox"\x3e\x3c/span\x3e\x3cspan class\x3d"doing jimu-float-trailing esriCTFliterListCheckbox"\x3e\x3c/span\x3e\x3cspan class\x3d"done jimu-float-trailing esriCTFliterListCheckbox"\x3e\x3c/span\x3e\x3c/div\x3e\x3cdiv class\x3d"body"\x3e\x3cdiv class\x3d"parameters"\x3e\x3c/div\x3e\x3cdiv tabindex\x3d"0" role\x3d"button" aria-label\x3d"${apply}" class\x3d"jimu-btn apply jimu-float-trailing jimu-trailing-margin25"\x3e${apply}\x3c/div\x3e\x3c/div\x3e\x3c/li\x3e',
_layerTitleTemplate:'\x3cdiv class\x3d"esriCTGroupFilterLayerName"\x3e${layerTitle}\x3c/div\x3e',_store:null,totalAppliedFilters:0,postCreate:function(){this.inherited(arguments);this.totalAppliedFilters=0;this._updateClearAllButtonState();this.own(H(this.clearAllButton,"click",X.hitch(this,this._clearAllFilters)));this.own(H(this.clearAllButton,"keydown",X.hitch(this,function(a){a.keyCode!==e.ENTER&&a.keyCode!==e.SPACE||this._clearAllFilters()})));this._store={};this.layerInfosObj=w.getInstanceSync();
this.filterUtils=new h;this.filterManager=L.getInstance();var N=this.config.filters,S={},F=[];this.config.groupFiltersByLayer?(t.forEach(N,function(a,D){S[a.layerId]||(S[a.layerId]=[],F.push(a.layerId));a.index=D;S[a.layerId].push(a)}),t.forEach(F,X.hitch(this,function(a){var D=this.layerInfosObj.getLayerInfoById(a);D=X.replace(this._layerTitleTemplate,{layerTitle:D.layerObject.name||D.title},/\$\{([^\}]+)\}/ig);D=Q.toDom(D);Q.place(D,this.filterList);for(D=0;D<S[a].length;D++)this._addFilterInList(S[a][D],
S[a][D].index)}))):t.forEach(N,X.hitch(this,function(a,D){this._addFilterInList(a,D)}))},getLastNode:function(){if(this.lastFocusNode)if(l.contains(this.lastFocusNode,"has-ask-for-value")){var N=m.getFocusNodesInDom(this.lastFocusNode);N=l.contains(this.lastFocusNode,"config-parameters")?N.reverse()[0]:R(".arrow",this.lastFocusNode)[0]}else N=this.lastFocusNode;return N},_addFilterInList:function(N,S){var F=this.filterUtils.isAskForValues(N.filter),a={icon:N.icon?m.processUrlInWidgetConfig(N.icon,
this.folderUrl):this.folderUrl+"/css/images/default_task_icon.png",index:S,title:N.name,layerTitle:N.layerTitle?N.layerTitle:N.name,toggleTip:this.nls.toggleTip,hasValue:F?window.appInfo.isRunInMobile?"block !important":"":"none",isAskForValue:F,apply:X.getObject("jimuNls.common.apply",!1,window)||"Apply",filterNotAppliedLabel:this.nls.filterNotAppliedLabel};this._store[N.layerId]||(this._store[N.layerId]={mapFilterControls:{}});S=X.replace(this._itemTemplate,a,/\$\{([^\}]+)\}/ig);var D=Q.toDom(S);
this.lastFocusNode=D;Q.place(D,this.filterList);if(N.symbol){S=R(".icon",D);Q.setStyle(S[0],"display","none");Q.setStyle(S[1],"display","inline-block");var da=I.fromJson(N.symbol),ha=N.symbol.url||N.symbol.imageData;ha?(da.setWidth(25),da.setHeight(25)):da.setSize(25);da=ha?K.createSymbolNode(da):K.createSymbolNode(da,{width:26,height:26});Q.place(da,S[1])}this.own(R(".header",D).on("click",X.hitch(this,"enableFilter",D,N,a,!1)));F?(Q.addClass(D,"has-ask-for-value"),y.set(D,"tabindex","-1")):(this.own(H(R(".header",
D)[0].parentElement,"keydown",X.hitch(this,"enableFilter",D,N,a,!0))),Q.addClass(D,"not-has-ask-for-value"));F=R(".apply",D);S=R(".arrow",D);"none"!==a.hasValue?(y.set(F[0],"type",""),y.set(S[0],"type",""),y.set(S[0],"tabindex","0"),this.own(S.on("click",X.hitch(this,"configFilter",D,N))),this.own(S.on("keydown",X.hitch(this,function(ia){if(ia.keyCode===e.ENTER||ia.keyCode===e.SPACE)this.configFilter(D,N),ia.stopPropagation()}))),this.own(F.on("click",X.hitch(this,"applyFilterValues",D,N,!1))),this.own(F.on("keydown",
X.hitch(this,"applyFilterValues",D,N,!0))),Q.addClass(D,"requesting"),this.configFilter(D,N,null,X.hitch(this,function(){this.config.collapse&&Q.removeClass(D,"config-parameters");N.autoApplyWhenWidgetOpen&&this.enableFilter(D,N,a)}))):(y.set(F[0],"type","hidden"),y.set(S[0],"type","hidden"),N.autoApplyWhenWidgetOpen&&this.enableFilter(D,N,a))},startup:function(){this.inherited(arguments);this.resize()},_getPriorityOfMapFilter:function(N){N=X.getObject(N+".mapFilterControls",!1,this._store);var S=
0,F;for(F in N){var a=N[F];a.priority>S&&(S=a.priority)}return S},_getMapFilterControl:function(N){N=X.getObject(N+".mapFilterControls",!1,this._store);var S=!0,F;for(F in N){var a=N[F];0<a.priority&&(S=!!a.enable)}return S},_setItemFilter:function(N,S,F,a){this._store[N]["filter_item_"+S]=F;F=this._getPriorityOfMapFilter(N);X.setObject(N+".mapFilterControls.filter_item_"+S,{enable:a,priority:F+1},this._store)},_removeItemFilter:function(N,S){delete this._store[N]["filter_item_"+S];delete this._store[N].mapFilterControls["filter_item_"+
S]},_getExpr:function(N){if(!this._store[N])return null;var S=[];N=this._store[N];for(var F in N){var a=N[F];a&&"mapFilterControls"!==F&&S.push("("+a+")")}return S.join(" AND ")},_bindMapUpdateEvents:function(N,S){H.once(this.map,"update-start",X.hitch(this,function(){Q.addClass(N,"applying");Q.removeClass(N,"applied");y.set(N,"aria-label",N.innerText+this.nls.applyingFilterLabel)}));H.once(this.map,"update-end",X.hitch(this,function(){S?(Q.addClass(N,"applied"),y.set(N,"aria-label",N.innerText+this.nls.filterAppliedLabel)):
(Q.removeClass(N,"applied"),y.set(N,"aria-label",N.innerText+this.nls.filterNotAppliedLabel));Q.removeClass(N,"applying")}))},enableFilter:function(N,S,F,a,D){if(!a||D.keyCode===e.ENTER||D.keyCode===e.SPACE)if(!Q.hasClass(N,"config-parameters")||N.filterParams&&N.filterParams.getFilterExpr())if(!F.isAskForValue||N.filterParams&&N.filterParams.getFilterExpr()){F=S.layerId;a=Q.getAttr(N,"data-index");D=null;var da=this.layerInfosObj.getLayerInfoById(F);D=Q.hasClass(N,"applied");da.isShowInMap()&&da.isInScale()?
this._bindMapUpdateEvents(N,D?!1:!0):D?Q.removeClass(N,"applied"):Q.addClass(N,"applied");da=null;D?(this._removeItemFilter(F,a),D=this._getExpr(F),da=this._getMapFilterControl(F),this.filterManager.applyWidgetFilter(F,this.id,D,da),this.totalAppliedFilters--):(N=this._getFilterExpr(N,S),this._setItemFilter(F,a,N,S.enableMapFilter),D=this._getExpr(F),da=this._getMapFilterControl(F),this.filterManager.applyWidgetFilter(F,this.id,D,da),this.totalAppliedFilters++);this.filtersUpdated=!0;this._updateClearAllButtonState()}else this.configFilter(N,
S)},configFilter:function(N,S,F,a){N.filterParams?(Q.hasClass(N,"config-parameters")?(Q.removeClass(N,"config-parameters"),this._changeItemTitleWidth(N,window.appInfo.isRunInMobile?60:45)):(Q.addClass(N,"config-parameters"),this._changeItemTitleWidth(N,60)),a&&a(),this.emit("setLastFilterNode",this.getLastNode())):T({url:S.url,content:{f:"json"},handleAs:"json",callbackPrams:"callback"}).then(X.hitch(this,function(D){Q.addClass(N,"config-parameters");Q.removeClass(N,"requesting");var da=R(".parameters",
N)[0];N.handles=[];N.filterParams=new x;var ha=X.clone(S.filter),ia=null;S.enableMapFilter&&(ia=S.layerId);N.filterParams.build(S.url,D,ha,ia,this.id);this.own(H(N.filterParams,"change",X.hitch(this,function(na){na?(R(".apply",N).removeClass("disable-apply"),N.expr=na):(delete N.expr,R(".apply",N).addClass("disable-apply"))})));N.expr=N.filterParams.getFilterExpr();N.expr?R(".apply",N).removeClass("disable-apply"):(delete N.expr,R(".apply",N).addClass("disable-apply"));N.filterParams.placeAt(da);
this._changeItemTitleWidth(N,60);a&&a()}));F&&F.target&&F.stopPropagation()},applyFilterValues:function(N,S,F,a){if(!F||a.keyCode===e.ENTER||a.keyCode===e.SPACE){var D=N.filterParams&&(N.expr||this._getFilterExpr(N,S)),da=!0;F=!1;l.contains(N,"applied")?(F=!0,this._getExpr(S.layerId)==="("+D+")"&&(da=!1)):da=!0;if(D&&da){N.expr=D;D=S.layerId;da=Q.getAttr(N,"data-index");var ha=this.layerInfosObj.getLayerInfoById(D);ha.isShowInMap()&&ha.isInScale()?this._bindMapUpdateEvents(N,!0):Q.addClass(N,"applied");
this._setItemFilter(D,da,N.expr,S.enableMapFilter);N=this._getExpr(D);S=this._getMapFilterControl(D);this.filterManager.applyWidgetFilter(D,this.id,N,S);this.filtersUpdated=!0;F||this.totalAppliedFilters++;this._updateClearAllButtonState()}a.stopPropagation()}},_getFilterExpr:function(N,S){return N.filterParams?N.filterParams.getFilterExpr():this.filterUtils.hasVirtualDate(S.filter)?(this.filterUtils.isHosted=m.isHostedService(S.url),this.filterUtils.getExprByFilterObj(S.filter)):S.filter.expr},resize:function(){this.inherited(arguments);
this._changeItemTitleWidth(this.domNode,window.appInfo.isRunInMobile?60:45)},_changeItemTitleWidth:function(N,S){var F=R(".header",N)[0];F&&(S=Q.getContentBox(F).w-S,0<S&&R(".header .item-title",N).style({maxWidth:S+"px"}))},destroy:function(){R(".filter-item",this.filterList).forEach(function(S){delete S.filterParams;delete S.expr});if(this._store)for(var N in this._store)N&&this.filterManager.applyWidgetFilter(N,this.id,"",null);this.inherited(arguments)},filterListShown:function(){this.filtersUpdated=
!1},_updateClearAllButtonState:function(){0<this.totalAppliedFilters?(l.add(this.clearAllButton,"esriCTClearAllFilterActive"),y.set(this.clearAllButton,"aria-disabled","false")):(l.remove(this.clearAllButton,"esriCTClearAllFilterActive"),y.set(this.clearAllButton,"aria-disabled","true"))},_clearAllFilters:function(){if(l.contains(this.clearAllButton,"esriCTClearAllFilterActive")&&this.filterList){var N=R(".applied",this.filterList);t.forEach(N,function(S){(S=R(".header",S))&&0<S.length&&S[0].click()});
this._updateClearAllButtonState();this.emit("clearAllFilters")}}})})},"dojo/NodeList":function(){define(["./query"],function(V){return V.NodeList})},"esri/tasks/BufferParameters":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/_base/json dojo/has ../kernel ../geometry/Polygon ../geometry/jsonUtils".split(" "),function(V,W,t,Q,X,R,H,y){V=V(null,{declaredClass:"esri.tasks.BufferParameters",geometries:null,outSpatialReference:null,bufferSpatialReference:null,distances:null,
unit:null,unionResults:!1,geodesic:!1,toJson:function(){var e={unit:this.unit,unionResults:this.unionResults,geodesic:this.geodesic},g=this.distances,l=this.outSpatialReference,m=this.bufferSpatialReference,n=t.map(this.geometries,function(I){I="extent"===I.type?H.fromExtent(I):I;return I.toJson()},this),h=this.geometries;if(h&&0<h.length){var x="extent"===h[0].type?"esriGeometryPolygon":y.getJsonType(h[0]);e.geometries=Q.toJson({geometryType:x,geometries:n});e.inSR=h[0].spatialReference.wkid?h[0].spatialReference.wkid:
Q.toJson(h[0].spatialReference.toJson())}g&&(e.distances=g.join(","));l&&(e.outSR=l.wkid?l.wkid:Q.toJson(l.toJson()));m&&(e.bufferSR=m.wkid?m.wkid:Q.toJson(m.toJson()));return e}});X("extend-esri")&&W.setObject("tasks.BufferParameters",V,R);return V})},"esri/dijit/LocateButton":function(){define("require dojo/Evented dojo/_base/declare dojo/_base/lang dojo/has ../kernel ../config dijit/_WidgetBase dijit/a11yclick dijit/_TemplatedMixin dojo/on dojo/Deferred dojo/text!./templates/LocateButton.html dojo/i18n!../nls/jsapi dojo/dom-class dojo/dom-style dojo/dom-attr ../geometry/webMercatorUtils ../geometry/Point ../SpatialReference ../graphic ../symbols/PictureMarkerSymbol ../tasks/ProjectParameters".split(" "),
function(V,W,t,Q,X,R,H,y,e,g,l,m,n,h,x,I,K,w,L,T,U,N,S){V=t("esri.dijit.LocateButton",[y,g,W],{templateString:n,options:{theme:"LocateButton",map:null,visible:!0,highlightLocation:!0,symbol:new N(V.toUrl("./images/sdk_gps_location.png"),28,28),infoTemplate:null,scale:null,useTracking:!1,clearOnTrackingStop:!1,setScale:!0,centerAt:!0,timeout:15E3,graphicsLayer:null,geolocationOptions:{maximumAge:0,timeout:15E3,enableHighAccuracy:!0}},constructor:function(F,a){F=Q.mixin({},this.options,F);this.domNode=
a;this._i18n=h;a=navigator.geolocation;var D=window.hasOwnProperty("isSecureContext");D=D&&window.isSecureContext||!D&&"https:"===window.location.protocol;D&&a||(F.visible=!1);a||console.log("LocateButton::navigator.geolocation unsupported.");D||console.log("LocateButton::navigator.geolocation requires a secure origin.");this.set("map",F.map);this.set("theme",F.theme);this.set("visible",F.visible);this.set("scale",F.scale);this.set("highlightLocation",F.highlightLocation);this.set("symbol",F.symbol);
this.set("infoTemplate",F.infoTemplate);this.set("geolocationOptions",F.geolocationOptions);this.set("useTracking",F.useTracking);this.set("setScale",F.setScale);this.set("centerAt",F.centerAt);this.set("timeout",F.timeout);this.set("graphicsLayer",F.graphicsLayer);this.set("clearOnTrackingStop",F.clearOnTrackingStop);this.watch("theme",this._updateThemeWatch);this.watch("visible",this._visible);this.watch("tracking",this._locate);this.watch("useTracking",Q.hitch(this,function(){this.get("tracking")&&
!this.get("useTracking")&&this._stopTracking();this._setTitle()}));this._css={container:"locateContainer",locate:"zoomLocateButton",loading:"loading",tracking:"tracking"}},postCreate:function(){this.inherited(arguments);this.own(l(this._locateNode,e,Q.hitch(this,this.locate)))},startup:function(){this.inherited(arguments);this.get("map")||(this.set("visible",!1),console.log("LocateButton::map required"));if(this.get("map").loaded)this._init();else l.once(this.get("map"),"load",Q.hitch(this,function(){this._init()}))},
destroy:function(){this.clear();this._graphicsEvent&&this._graphicsEvent.remove();this._removeWatchPosition();this.inherited(arguments)},clear:function(){var F=this.get("highlightGraphic"),a=this.get("graphicsLayer");F&&(a?a.remove(F):this.get("map").graphics.remove(F),this.set("highlightGraphic",null))},locate:function(){this.get("useTracking")&&this.set("tracking",!this.get("tracking"));return this._locate()},show:function(){this.set("visible",!0)},hide:function(){this.set("visible",!1)},_setTitle:function(){this.get("useTracking")?
this.get("tracking")?K.set(this._locateNode,"title",this._i18n.widgets.locateButton.locate.stopTracking):K.set(this._locateNode,"title",this._i18n.widgets.locateButton.locate.tracking):K.set(this._locateNode,"title",this._i18n.widgets.locateButton.locate.title)},_removeWatchPosition:function(){this.get("watchId")&&(navigator.geolocation.clearWatch(this.get("watchId")),this.set("watchId",null));this._removePrivateVars()},_stopTracking:function(){x.remove(this._locateNode,this._css.tracking);this._removeWatchPosition();
this.get("clearOnTrackingStop")&&this.clear();this._hideLoading()},_positionToObject:function(F){return F?{coords:Q.mixin({},F.coords),timestamp:F.timestamp}:{}},_startTracking:function(){x.add(this._locateNode,this._css.tracking);this._removeWatchPosition();var F=navigator.geolocation.watchPosition(Q.hitch(this,function(a){a=this._positionToObject(a);this._setPosition(a).then(Q.hitch(this,function(D){this._locateEvent(D)}),Q.hitch(this,function(D){D||(D=Error("LocateButton::Error setting the position."));
this._locateError(D)}))}),Q.hitch(this,function(a){this.set("tracking",!1);a||(a=Error("LocateButton::Could not get tracking position."));this._locateError(a)}),this.get("geolocationOptions"));this.set("watchId",F)},_removePrivateVars:function(){this._scale=this._position=this._graphic=null},_getCurrentPosition:function(){var F=new m;this._removePrivateVars();var a=setTimeout(Q.hitch(this,function(){clearTimeout(a);F.reject(Error("LocateButton::time expired for getting location."))}),this.get("timeout"));
navigator.geolocation.getCurrentPosition(Q.hitch(this,function(D){D=this._positionToObject(D);clearTimeout(a);this._setPosition(D).then(Q.hitch(this,function(da){F.resolve(da)}),Q.hitch(this,function(da){da||(da=Error("LocateButton::Error setting map position."));F.reject(da)}))}),Q.hitch(this,function(D){D||(D=Error("LocateButton::Could not get current position."));F.reject(D)}),this.get("geolocationOptions"));return F.promise},_locate:function(){var F=new m;this._showLoading();if(navigator.geolocation)this.get("useTracking")?
this.get("tracking")?(this._startTracking(),F.resolve({tracking:!0})):(this._stopTracking(),F.resolve({tracking:!1})):this._getCurrentPosition().then(Q.hitch(this,function(D){this._locateEvent(D);F.resolve(D)}),Q.hitch(this,function(D){D||(D=Error("LocateButton::Could not get current position."));this._locateError(D);F.reject(D)}));else{var a=Error("LocateButton::geolocation unsupported");this._locateError(a);F.reject(a)}this._setTitle();return F.promise},_projectPoint:function(F){var a=new m,D=this.get("map").spatialReference,
da=D.wkid;D.isWebMercator()?(F=w.geographicToWebMercator(F),a.resolve(F)):H.defaults.geometryService&&4326!==da?(da=new S,da.geometries=[F],da.outSR=D,H.defaults.geometryService.project(da).then(Q.hitch(this,function(ha){ha&&ha.length?a.resolve(ha[0]):a.reject(Error("LocateButton::Point was not projected."))}),function(ha){ha||(ha=Error("LocateButton::please specify a geometry service on esri/config to project."));a.reject(ha)})):a.resolve(F);return a.promise},_getScale:function(F){var a=this.get("scale");
return F&&F.coords?a||F.coords.accuracy||5E4:a||5E4},_createPoint:function(F){var a;F&&F.coords&&(a=new L([F.coords.longitude,F.coords.latitude],new T({wkid:4326})));return a},_setPosition:function(F){var a=new m,D,da;this._removePrivateVars();if((this._position=F)&&F.coords){if(D=this._createPoint(F))this._graphic=da=this._createGraphic(D,F);var ha=this._getScale(F);this._scale=ha;D?this._projectPoint(D).then(Q.hitch(this,function(ia){this._graphic=da=this._createGraphic(ia,F);var na={graphic:da,
scale:ha,position:F};this.get("setScale")&&this.get("map").setScale(ha);this.get("centerAt")?this.get("map").centerAt(ia).then(Q.hitch(this,function(){a.resolve(na)}),Q.hitch(this,function(P){P||(P=Error("LocateButton::Could not center map."));a.reject(P)})):a.resolve(na)}),Q.hitch(this,function(ia){ia||(ia=Error("LocateButton::Error projecting point."));a.reject(ia)})):(D=Error("LocateButton::Invalid point"),a.reject(D))}else D=Error("LocateButton::Invalid position"),a.reject(D);return a.promise},
_createGraphic:function(F,a){if(F){a={position:a};var D=new U(F,this.get("symbol"),a,this.get("infoTemplate"))}return D},_locateEvent:function(F){if(F.graphic){var a=this.get("highlightGraphic"),D=this.get("graphicsLayer");a?(a.setGeometry(F.graphic.geometry),a.setAttributes(F.graphic.attributes),a.setInfoTemplate(F.graphic.infoTemplate),a.setSymbol(F.graphic.symbol)):(a=F.graphic,this.get("highlightLocation")&&(D?D.add(a):this.get("map").graphics.add(a)));this.set("highlightGraphic",a)}this._hideLoading();
this.emit("locate",F)},_locateError:function(F){F={graphic:this._graphic,scale:this._scale,position:this._position,error:F};this._hideLoading();this.emit("locate",F)},_showLoading:function(){this.get("useTracking")||x.add(this._locateNode,this._css.loading)},_hideLoading:function(){this.get("useTracking")||x.remove(this._locateNode,this._css.loading)},_init:function(){this._visible();this._setTitle();this.get("tracking")&&this.get("useTracking")&&this._locate();this.set("loaded",!0);this.emit("load",
{})},_updateThemeWatch:function(F,a,D){x.remove(this.domNode,a);x.add(this.domNode,D)},_visible:function(){this.get("visible")?I.set(this.domNode,"display","block"):I.set(this.domNode,"display","none")}});X("extend-esri")&&Q.setObject("dijit.LocateButton",V,R);return V})},"widgets/NearMe/_build-generate_module":function(){define(["dojo/text!./Widget.html","dojo/text!./css/style.css","dojo/i18n!./nls/strings"],function(){})},"url:esri/dijit/Search/templates/Search.html":'\x3cdiv role\x3d"presentation" class\x3d"${theme}"\x3e\r\n  \x3cdiv role\x3d"presentation" class\x3d"${css.searchGroup}" data-dojo-attach-point\x3d"containerNode"\x3e\r\n    \x3cdiv data-dojo-attach-point\x3d"expandNode" class\x3d"${css.searchExpandContainer}"\x3e\r\n      \x3cdiv class\x3d"${css.searchAnimateContainer}"\x3e\r\n        \x3cdiv role\x3d"button" title\x3d"${_i18n.widgets.Search.main.searchIn}" id\x3d"${id}_menu_button" class\x3d"${css.searchBtn} ${css.searchToggle}" tabindex\x3d"0" data-dojo-attach-point\x3d"sourcesBtnNode"\x3e\r\n          \x3cspan aria-hidden\x3d"true" role\x3d"presentation" class\x3d"${css.searchToggleIcon}"\x3e\x3c/span\x3e\x3cspan class\x3d"${css.searchSourceName}" data-dojo-attach-point\x3d"sourceNameNode"\x3e\x3c/span\x3e\r\n        \x3c/div\x3e\r\n        \x3cdiv class\x3d"${css.searchInputGroup}"\x3e\r\n          \x3cform data-dojo-attach-point\x3d"formNode"\x3e\r\n            \x3cinput maxlength\x3d"${maxLength}" autocomplete\x3d"off" type\x3d"text" tabindex\x3d"0" class\x3d"${css.searchInput}" value\x3d"${value}" aria-haspopup\x3d"true" id\x3d"${id}_input" data-dojo-attach-point\x3d"inputNode" role\x3d"textbox"\x3e\r\n          \x3c/form\x3e\r\n          \x3cdiv role\x3d"button" class\x3d"${css.searchClear}" tabindex\x3d"0" data-dojo-attach-point\x3d"clearNode"\x3e\x3cspan aria-hidden\x3d"true" class\x3d"${css.searchClearIcon}"\x3e\x3c/span\x3e\x3cspan aria-hidden\x3d"true" class\x3d"${css.searchSpinner}"\x3e\x3c/span\x3e\r\n          \x3c/div\x3e\r\n          \x3cdiv data-dojo-attach-point\x3d"suggestionsNode" class\x3d"${css.searchMenu} ${css.suggestionsMenu}"\x3e\x3c/div\x3e\r\n        \x3c/div\x3e\r\n      \x3c/div\x3e\r\n    \x3c/div\x3e\r\n    \x3cdiv role\x3d"button" title\x3d"${_i18n.widgets.Search.main.searchButtonTitle}" class\x3d"${css.searchBtn} ${css.searchSubmit}" tabindex\x3d"0" data-dojo-attach-point\x3d"submitNode"\x3e\r\n      \x3cspan aria-hidden\x3d"true" role\x3d"presentation" class\x3d"${css.searchIcon}"\x3e\x3c/span\x3e\r\n      \x3cspan class\x3d"${css.searchButtonText}"\x3e${_i18n.widgets.Search.main.searchButtonTitle}\x3c/span\x3e\r\n    \x3c/div\x3e\r\n    \x3cdiv data-dojo-attach-point\x3d"sourcesNode" class\x3d"${css.searchMenu} ${css.sourcesMenu}"\x3e\x3c/div\x3e\r\n    \x3cdiv data-dojo-attach-point\x3d"noResultsMenuNode" class\x3d"${css.searchMenu} ${css.searchNoResultsMenu}"\x3e\x3c/div\x3e\r\n    \x3cdiv class\x3d"${css.searchClearFloat}"\x3e\x3c/div\x3e\r\n  \x3c/div\x3e\r\n\x3c/div\x3e',
"url:widgets/NearMe/item-list.html":'\x3cdiv class\x3d"esriCTItemlList"\x3e\r\n    \x3cdiv class\x3d"esriCTBackButton"\x3e\r\n        \x3cdiv class\x3d"esriCTItemLeftArrow"\x3e\r\n        \x3c/div\x3e\r\n    \x3c/div\x3e\r\n    \x3cdiv class\x3d"esriCTItemRightArrow"\x3e\r\n    \x3c/div\x3e\r\n    \x3cdiv class\x3d"esriCTItemCount esriCTLoadingIcon"\x3e\r\n    \x3c/div\x3e\r\n    \x3cdiv class\x3d"esriCTItemName"\x3e\r\n    \x3c/div\x3e\r\n\x3c/div\x3e\r\n',"url:esri/dijit/templates/Directions.html":'\x3cdiv class\x3d"${options.theme}" role\x3d"presentation"\x3e\r\n    \x3cdiv data-dojo-attach-point\x3d"_widgetContainer" class\x3d"${_css.widgetContainerClass}" role\x3d"presentation"\x3e\r\n        \x3cdiv class\x3d"${_css.stopsContainerClass}" role\x3d"presentation"\x3e\r\n            \x3cdiv id\x3d"search-source-container" class\x3d"${_css.searchSourceContainerClass}" data-dojo-attach-point\x3d"_searchSourceContainerNode"\x3e\r\n                \x3cdiv data-dojo-attach-point\x3d"_searchSourceSelectorContainer"\x3e\x3c/div\x3e\r\n            \x3c/div\x3e\r\n            \x3cdiv class\x3d"${_css.stopsTableContainerClass}"\x3e\r\n                \x3ctable class\x3d"${_css.stopsClass}" data-dojo-attach-point\x3d"_dndNode"\x3e\x3c/table\x3e\r\n                \x3cdiv class\x3d"${_css.stopsTableCoverClass}" data-dojo-attach-point\x3d"_stopsTableCover"\x3e\x3c/div\x3e\r\n            \x3c/div\x3e\r\n            \x3cdiv class\x3d"${_css.clearClass}"\x3e\x3c/div\x3e\r\n            \x3cdiv class\x3d"${_css.stopsButtonContainerClass}"\x3e\r\n                \x3cdiv class\x3d"${_css.stopsAddDestinationClass}"\x3e\r\n                    \x3cdiv tabindex\x3d"0" role\x3d"button" data-dojo-attach-point\x3d"_activateButtonNode" title\x3d"${_i18n.widgets.directions.activate}" class\x3d"${_css.activateButtonClass} ${_css.stopsButtonClass} ${_css.stopsButtonTabClass} ${_css.stopsPressedButtonClass}" data-blur-on-click\x3d"true"\x3e\x3c/div\x3e\r\n                    \x3cdiv tabindex\x3d"0" role\x3d"button" data-dojo-attach-point\x3d"_lineBarrierButtonNode" title\x3d"${_i18n.widgets.directions.lineBarrier}" class\x3d"${_css.lineBarrierButtonClass} ${_css.stopsButtonClass} ${_css.stopsButtonTabClass}" data-blur-on-click\x3d"true"\x3e\x3c/div\x3e\r\n                    \x3cdiv role\x3d"button" tabindex\x3d"0" class\x3d"${_css.linkButtonClass} ${_css.stopsAddDestinationBtnClass}" data-dojo-attach-point\x3d"_addDestinationNode" data-blur-on-click\x3d"true"\x3e${_i18n.widgets.directions.addDestination}\x3c/div\x3e\r\n                \x3c/div\x3e\r\n                \x3cdiv class\x3d"${_css.travelModesContainerClass}" data-dojo-attach-point\x3d"_travelModeContainerNode"\x3e\r\n                    \x3cdiv data-dojo-attach-point\x3d"_travelModeSelectorContainer"\x3e\x3c/div\x3e\r\n                \x3c/div\x3e\r\n                \x3cdiv tabindex\x3d"0" role\x3d"button" class\x3d"${_css.linkButtonClass} startTimeMenuButton" data-blur-on-click\x3d"true" data-dojo-attach-point\x3d"_startTimeButtonNodeContainer"\x3e\r\n                    \x3cdiv data-dojo-attach-point\x3d"_startTimeButtonNode"\x3e\r\n                        \x3cspan data-dojo-attach-point\x3d"_startTimeButtonLabel"\x3e${_i18n.widgets.directions.leaveNow}\x3c/span\x3e\r\n                        \x3cdiv data-dojo-attach-point\x3d"_startTimeDDLArrow" class\x3d"esriDirectionsDDLArrow"\x3e\x3c/div\x3e\r\n                    \x3c/div\x3e\r\n                    \x3cdiv class\x3d"startTimeMenu" data-dojo-attach-point\x3d"_startTimeMenu"\x3e\r\n                        \x3cul role\x3d"menu"\x3e\r\n                            \x3cli data-dojo-attach-point\x3d"_startTimeMenuLeaveNow" tabindex\x3d"0" class\x3d"esriRouteZoom startTimeMenuItem" role\x3d"menuitemradio" aria-checked\x3d"true"\x3e${_i18n.widgets.directions.leaveNow}\x3c/li\x3e\r\n                            \x3cli data-dojo-attach-point\x3d"_startTimeMenuDepartAt" tabindex\x3d"0" class\x3d"esriRouteZoom startTimeMenuItem" role\x3d"menuitemradio"\x3e${_i18n.widgets.directions.departAt}\x3c/li\x3e\r\n                            \x3cli data-dojo-attach-point\x3d"_startTimeMenuNone" tabindex\x3d"0" class\x3d"esriRouteZoom startTimeMenuItem" role\x3d"menuitemradio"\x3e${_i18n.widgets.directions.noStartTime}\x3c/li\x3e\r\n                        \x3c/ul\x3e\r\n                    \x3c/div\x3e\r\n                \x3c/div\x3e\r\n                \x3cdiv tabindex\x3d"0" role\x3d"button" class\x3d"${_css.linkButtonClass} ${_css.stopsOptionsButtonClass}" data-dojo-attach-point\x3d"_optionsButtonNode" data-blur-on-click\x3d"true"\x3e${_i18n.widgets.directions.showOptions}\x3c/div\x3e\r\n            \t\x3cdiv class\x3d"${_css.clearClass}"\x3e\x3c/div\x3e\r\n                \x3cdiv class\x3d"departAtContainer" data-dojo-attach-point\x3d"_departAtContainer"\x3e\r\n                    \x3cdiv id\x3d"${id}_directionsDepartAtTime" data-dojo-attach-point\x3d"_departAtTimeContainer"\x3e\x3c/div\x3e\r\n                    \x3cdiv id\x3d"${id}_directionsDepartAtDate" data-dojo-attach-point\x3d"_departAtDateContainer"\x3e\x3c/div\x3e\r\n                \x3c/div\x3e\r\n            \x3c/div\x3e\r\n            \x3cdiv role\x3d"presentation" class\x3d"${_css.stopsOptionsMenuClass}" data-dojo-attach-point\x3d"_optionsMenuNode"\x3e\r\n                \x3cdiv class\x3d"${_css.stopsOptionsCheckboxesClass}"\x3e\r\n                    \x3cul\x3e\r\n                        \x3cli class\x3d"${_css.stopsFindOptimalOrderClass}" data-dojo-attach-point\x3d"_findOptimalOrderItemNode"\x3e\x3cinput tabindex\x3d"0" data-dojo-attach-point\x3d"_findOptimalOrderNode" type\x3d"checkbox" id\x3d"${id}_find_optimal_order" /\x3e\x3clabel for\x3d"${id}_find_optimal_order"\x3e${_i18n.widgets.directions.findOptimalOrder}\x3c/label\x3e\x3c/li\x3e\r\n                        \x3cli class\x3d"${_css.stopsReturnToStartClass}" data-dojo-attach-point\x3d"_returnToStartItemNode"\x3e\x3cinput tabindex\x3d"0" data-dojo-attach-point\x3d"_returnToStartNode" type\x3d"checkbox" id\x3d"${id}_stopsReturnToStart" /\x3e\x3clabel for\x3d"${id}_stopsReturnToStart"\x3e${_i18n.widgets.directions.returnToStart}\x3c/label\x3e\x3c/li\x3e\r\n                        \x3cli class\x3d"${_css.stopsUseTrafficClass}" data-dojo-attach-point\x3d"_useTrafficItemNode" title\x3d"${_i18n.widgets.directions.trafficLabelLive}"\x3e\r\n                            \x3cinput tabindex\x3d"0" data-dojo-attach-point\x3d"_useTrafficNode" type\x3d"checkbox" id\x3d"${id}_stopsUseTraffic" /\x3e\x3clabel for\x3d"${id}_stopsUseTraffic"\x3e${_i18n.widgets.directions.useTraffic}\x3c/label\x3e\r\n                            \x3ca data-dojo-attach-point\x3d"_trafficAvailabilityButton" style\x3d"display: none;" href\x3d"http://www.arcgis.com/home/item.html?id\x3db7a893e8e1e04311bd925ea25cb8d7c7" target\x3d"_blank"\x3e\x3cdiv class\x3d"esriTrafficAvailabilityButton" title\x3d"${_i18n.widgets.directions.seeTrafficAvailability}"\x3e\x3c/div\x3e\x3c/a\x3e\r\n                        \x3c/li\x3e\r\n                    \x3c/ul\x3e\r\n                \x3c/div\x3e\r\n                \x3cdiv class\x3d"${_css.stopsOptionsToggleContainerClass}"\x3e\r\n                    \x3cdiv class\x3d"${_css.stopsOptionsUnitsContainerClass}"  data-dojo-attach-point\x3d"_agolDistanceUnitsNode"\x3e\r\n                        \x3cdiv tabindex\x3d"0" role\x3d"button" class\x3d"${_css.stopsOptionsUnitsMiClass} ${_css.stopsButtonClass}" data-dojo-attach-point\x3d"_useMilesNode" data-blur-on-click\x3d"true"\x3e${_i18n.widgets.directions.units.esriMiles.abbr}\x3c/div\x3e\r\n                        \x3cdiv tabindex\x3d"0" role\x3d"button" class\x3d"${_css.stopsOptionsUnitsKmClass} ${_css.stopsButtonClass} ${_css.stopsButtonTabLastClass} ${_css.stopsPressedButtonClass}" data-dojo-attach-point\x3d"_useKilometersNode" data-blur-on-click\x3d"true"\x3e${_i18n.widgets.directions.units.esriKilometers.abbr}\x3c/div\x3e\r\n                        \x3cdiv class\x3d"${_css.clearClass}"\x3e\x3c/div\x3e\r\n                    \x3c/div\x3e\r\n                    \x3cdiv class\x3d"${_css.clearClass}"\x3e\x3c/div\x3e\r\n                \x3c/div\x3e\r\n                \x3cdiv class\x3d"${_css.clearClass}"\x3e\x3c/div\x3e\r\n            \x3c/div\x3e\r\n            \x3cdiv class\x3d"${_css.stopsGetDirectionsContainerClass}"\x3e\r\n                \x3cdiv class\x3d"getDirectionsBtnContainer"\x3e\r\n                    \x3cdiv tabindex\x3d"0" role\x3d"button" class\x3d"${_css.stopsButtonClass} ${_css.stopsGetDirectionsClass} esriDisabledDirectionsButton" data-dojo-attach-point\x3d"_getDirectionsButtonNode" data-blur-on-click\x3d"true"\x3e${_i18n.widgets.directions.getDirections}\x3c/div\x3e\r\n                    \x3cdiv tabindex\x3d"0" role\x3d"button" class\x3d"${_css.linkButtonClass} ${_css.stopsClearDirectionsClass}" data-dojo-attach-point\x3d"_clearDirectionsButtonNode" data-blur-on-click\x3d"true"\x3e${_i18n.widgets.directions.clearDirections}\x3c/div\x3e\r\n                \x3c/div\x3e\r\n                \x3cdiv class\x3d"savePrintBtnContainer" data-dojo-attach-point\x3d"_savePrintBtnContainer"\x3e\r\n                    \x3cdiv tabindex\x3d"0" role\x3d"button" class\x3d"${_css.resultsSaveClass} ${_css.stopsButtonClass} ${_css.stopsButtonTabClass}" data-blur-on-click\x3d"true" data-dojo-attach-point\x3d"_saveMenuButton" title\x3d"${_i18n.widgets.directions.saveTitle}" \x3e\x3c/div\x3e\r\n                    \x3cdiv tabindex\x3d"0" role\x3d"button" class\x3d"${_css.resultsPrintClass} ${_css.stopsButtonClass} ${_css.stopsButtonTabClass}" data-blur-on-click\x3d"true" data-dojo-attach-point\x3d"_printButton" title\x3d"${_i18n.widgets.directions.print}" \x3e\x3c/div\x3e\r\n                \x3c/div\x3e\r\n            \x3c/div\x3e\r\n            \x3cdiv role\x3d"presentation" class\x3d"${_css.stopsOptionsMenuClass} esriSaveContainer" data-dojo-attach-point\x3d"_saveMenuNode"\x3e\r\n                \x3cdiv class\x3d"esriLayerNameLabel"\x3e${_i18n.widgets.directions.layerName}\x3c/div\x3e\r\n                \x3cinput type\x3d"text" data-dojo-attach-point\x3d"_outputLayerContainer"\x3e\r\n                \x3cdiv data-dojo-attach-point\x3d"_folderSelectorContainer"\x3e\x3c/div\x3e\r\n                \x3cdiv tabindex\x3d"0" role\x3d"button" class\x3d"${_css.stopsButtonClass} esriSaveButton esriDisabledDirectionsButton" data-dojo-attach-point\x3d"_saveButton" data-blur-on-click\x3d"true"\x3e${_i18n.widgets.directions.save}\x3c/div\x3e\r\n                \x3cdiv tabindex\x3d"0" role\x3d"button" class\x3d"esriLinkButton esriSaveAsButton" data-dojo-attach-point\x3d"_saveAsButton" data-blur-on-click\x3d"true"\x3e${_i18n.widgets.directions.saveAs}\x3c/div\x3e\r\n            \x3c/div\x3e\r\n    \t\x3c/div\x3e\r\n    \t\x3cdiv class\x3d"${_css.clearClass}"\x3e\x3c/div\x3e\r\n    \t\x3cdiv data-dojo-attach-point\x3d"_msgNode" role\x3d"presentation"\x3e\x3c/div\x3e\r\n    \t\x3cdiv class\x3d"${_css.resultsContainerClass}" role\x3d"presentation"\x3e\r\n        \t\x3cdiv class\x3d"${_css.routesContainerClass}" data-dojo-attach-point\x3d"_resultsNode" role\x3d"presentation"\x3e\x3c/div\x3e\r\n    \t\x3c/div\x3e\r\n    \x3c/div\x3e\r\n\x3c/div\x3e',
"url:widgets/NearMe/swiperLayout.html":'\x3cdiv class\x3d"swiper-container"\x3e\r\n    \x3cdiv class\x3d"swiper-wrapper"\x3e\r\n    \x3c/div\x3e\r\n    \x3cdiv class\x3d"swiper-button-prev"\x3e\x3c/div\x3e\r\n    \x3cdiv class\x3d"swiper-button-next"\x3e\x3c/div\x3e\r\n    \x3cdiv class\x3d"swiper-pagination"\x3e\x3c/div\x3e\r\n    \x3cdiv class\x3d"swiper-scrollbar"\x3e\x3c/div\x3e\r\n\x3c/div\x3e',"url:widgets/NearMe/filter-list.html":'\x3cdiv\x3e\r\n  \x3cul class\x3d"filter-list" data-dojo-attach-point\x3d"filterList"\x3e\x3c/ul\x3e\r\n\x3c/div\x3e',
"url:esri/dijit/templates/LocateButton.html":'\x3cdiv class\x3d"${theme}" role\x3d"presentation"\x3e\r\n    \x3cdiv class\x3d"${_css.container}"\x3e\r\n            \x3cdiv data-dojo-attach-point\x3d"_locateNode" role\x3d"button" class\x3d"${_css.locate}" tabindex\x3d"0"\x3e\x3cspan\x3e${_i18n.widgets.locateButton.locate.button}\x3c/span\x3e\x3c/div\x3e\r\n    \x3c/div\x3e\r\n\x3c/div\x3e\r\n',"url:widgets/NearMe/Widget.html":'\x3cdiv\x3e\r\n    \x3cdiv data-dojo-attach-point\x3d"widgetMainNode" class\x3d"esriCTWidgetMainNode esriCTHidden"\x3e\r\n        \x3cdiv class\x3d"esriCTSearchOuterContainer" data-dojo-attach-point\x3d"searchOuterContainer"\x3e\r\n            \x3cdiv class\x3d"esriCTSearchHeader firstFocusNode" data-dojo-attach-point\x3d"searchHeaderTextNode" role\x3d"presentation" tabindex\x3d"0"\r\n                aria-label\x3d"${nls.searchHeaderText}"\x3e${nls.searchHeaderText}\x3c/div\x3e\r\n            \x3cdiv class\x3d"esriCTSearchContainer"\x3e\r\n                \x3cdiv class\x3d"esriCTSearchDiv"\x3e\r\n                    \x3cdiv data-dojo-attach-point\x3d"search"\x3e\r\n                    \x3c/div\x3e\r\n                \x3c/div\x3e\r\n                \x3cdiv class\x3d"esriCTCurrentLocationDiv esriCTImgButtons esriCTCurrentLocation esriCTHidden"\r\n                    data-dojo-attach-point\x3d"currentLocationNode"\x3e\r\n                \x3c/div\x3e\r\n                \x3cdiv role\x3d"button" tabindex\x3d"0"\r\n                    class\x3d"esriCTSelectLocationDiv esriCTImgButtons esriCTSelectLocation esriCTHidden"\r\n                    data-dojo-attach-point\x3d"selectLocation" aria-label\x3d"${nls.selectLocationToolTip}"\r\n                    title\x3d"${nls.selectLocationToolTip}"\x3e\r\n                \x3c/div\x3e\r\n            \x3c/div\x3e\r\n            \x3cdiv style\x3d"clear: both"\x3e\x3c/div\x3e\r\n            \x3cdiv class\x3d"esriCTBufferOptionParentDiv esriCTHidden" data-dojo-attach-point\x3d"bufferOptionParentNode"\x3e\r\n                \x3cdiv data-dojo-attach-point\x3d"bufferTextboxParentNode" class\x3d"esriCTBufferTextboxParent"\x3e\r\n                    \x3cdiv class\x3d"esriCTBufferTextboxText" data-dojo-attach-point\x3d"bufferTextboxText"\x3e\r\n                        ${nls.bufferTextboxLabel}\x3c/div\x3e\r\n                    \x3cdiv tabindex\x3d"0" aria-label\x3d"${nls.bufferTextboxLabel}" data-dojo-attach-point\x3d"bufferTextboxNode"\x3e\r\n                    \x3c/div\x3e\r\n                \x3c/div\x3e\r\n                \x3cdiv class\x3d"esriCTSliderDiv" data-dojo-attach-point\x3d"sliderParentNode"\x3e\r\n                    \x3cdiv data-dojo-attach-point\x3d"silderText" class\x3d"esriCTSliderText" tabindex\x3d"0" role\x3d"presentation" \x3e\r\n                    \x3c/div\x3e\r\n                    \x3cdiv data-dojo-attach-point\x3d"horizantalSliderContainer"\x3e\r\n                    \x3c/div\x3e\r\n                    \x3cdiv class\x3d"esriCTSliderValuesDiv"\x3e\r\n                        \x3cdiv class\x3d"esriCTSliderMinValueDiv" data-dojo-attach-point\x3d"sliderMinValue"\x3e\r\n                        \x3c/div\x3e\r\n                        \x3cdiv class\x3d"esriCTSliderMaxValueDiv" data-dojo-attach-point\x3d"sliderMaxValue"\x3e\r\n                        \x3c/div\x3e\r\n                    \x3c/div\x3e\r\n                \x3c/div\x3e\r\n            \x3c/div\x3e\r\n\r\n            \x3cdiv data-dojo-attach-point\x3d"applyFilterNode" class\x3d"esriCTApplyFilterDiv"\x3e\r\n                \x3cdiv data-dojo-attach-point\x3d"applyFilterArrowNodeParent" class\x3d"esriCTapplyFilterArrowNodeParent"  tabindex\x3d"0" role\x3d"button" aria-label\x3d"${nls.filterTitle}"\x3e\r\n                    \x3cdiv class\x3d"esriCTFilterToApply" \x3e\r\n                        ${nls.filterTitle}\r\n                    \x3c/div\x3e\r\n                    \x3cdiv title\x3d"${nls.filterTitle}"\r\n                        data-dojo-attach-point\x3d"applyFilterArrowNode"\r\n                        class\x3d"esriCTApplyFilterArrowNode esriCTApplyFilterArrowDown"\x3e\r\n                    \x3c/div\x3e\r\n                \x3c/div\x3e\r\n                \x3cdiv tabindex\x3d"0" role\x3d"button" aria-label\x3d"${nls.clearFilterButton}" title\x3d"${nls.clearFilterButton}"\r\n                    data-dojo-attach-point\x3d"clearAllFilterButton" aria-disabled\x3d"false"\r\n                    class\x3d"esriCTClearAllFilter esriCTClearAllFilterActive"\x3e\r\n                \x3c/div\x3e\r\n            \x3c/div\x3e\r\n            \x3cdiv style\x3d"clear: both"\x3e\x3c/div\x3e\r\n        \x3c/div\x3e\r\n\r\n        \x3cdiv class\x3d"esriCTWidgetErrorNode" data-dojo-attach-point\x3d"widgetErrorNode"\x3e\r\n        \x3c/div\x3e\r\n\r\n        \x3cdiv data-dojo-attach-point\x3d"layerListOuterDiv" class\x3d"esriCTListOuterContainer"\x3e\r\n        \x3c/div\x3e\r\n\r\n        \x3cdiv data-dojo-attach-point\x3d"filterListOuterDiv" class\x3d"esriCTListOuterContainer esriCTHidden"\x3e\r\n            \x3cdiv data-dojo-attach-point\x3d"filterListMainDiv" class\x3d"esriCTFilterListMainContainer"\x3e\r\n                \x3cdiv style\x3d"height: 100%;" data-dojo-attach-point\x3d"filterListNode"\x3e\x3c/div\x3e\r\n            \x3c/div\x3e\r\n        \x3c/div\x3e\r\n    \x3c/div\x3e\r\n\x3c/div\x3e',
"url:widgets/NearMe/css/style.css":".swiper-container {margin-left: auto; margin-right: auto; position: relative; overflow: hidden; z-index: 1;}.swiper-container-no-flexbox .swiper-slide {float: left;}.swiper-container-vertical \x3e .swiper-wrapper {-webkit-box-orient: vertical; -moz-box-orient: vertical; -ms-flex-direction: column; -webkit-flex-direction: column; flex-direction: column;}.swiper-wrapper {position: relative; width: 100%; height: 100%; z-index: 1; display: -webkit-box; display: -moz-box; display: -ms-flexbox; display: -webkit-flex; display: flex; -webkit-transition-property: -webkit-transform; -moz-transition-property: -moz-transform; -o-transition-property: -o-transform; -ms-transition-property: -ms-transform; transition-property: transform; -webkit-box-sizing: content-box; -moz-box-sizing: content-box; box-sizing: content-box;}.swiper-container-android .swiper-slide,.swiper-wrapper {-webkit-transform: translate3d(0px, 0, 0); -moz-transform: translate3d(0px, 0, 0); -o-transform: translate(0px, 0px); -ms-transform: translate3d(0px, 0, 0); transform: translate3d(0px, 0, 0);}.swiper-container-multirow \x3e .swiper-wrapper {-webkit-box-lines: multiple; -moz-box-lines: multiple; -ms-flex-wrap: wrap; -webkit-flex-wrap: wrap; flex-wrap: wrap;}.swiper-container-free-mode \x3e .swiper-wrapper {-webkit-transition-timing-function: ease-out; -moz-transition-timing-function: ease-out; -ms-transition-timing-function: ease-out; -o-transition-timing-function: ease-out; transition-timing-function: ease-out; margin: 0 auto;}.swiper-slide {-webkit-flex-shrink: 0; -ms-flex: 0 0 auto; flex-shrink: 0; width: 100%; height: 100%; position: relative;}.swiper-container-autoheight,.swiper-container-autoheight .swiper-slide {height: auto;}.swiper-container-autoheight .swiper-wrapper {-webkit-box-align: start; -ms-flex-align: start; -webkit-align-items: flex-start; align-items: flex-start; -webkit-transition-property: -webkit-transform, height; -moz-transition-property: -moz-transform; -o-transition-property: -o-transform; -ms-transition-property: -ms-transform; transition-property: transform, height;}.swiper-container .swiper-notification {position: absolute; left: 0; top: 0; pointer-events: none; opacity: 0; z-index: -1000;}.swiper-wp8-horizontal {-ms-touch-action: pan-y; touch-action: pan-y;}.swiper-wp8-vertical {-ms-touch-action: pan-x; touch-action: pan-x;}.swiper-button-prev,.swiper-button-next {position: absolute; top: 50%; width: 27px; height: 44px; margin-top: -22px; z-index: 10; cursor: pointer; -moz-background-size: 27px 44px; -webkit-background-size: 27px 44px; background-size: 27px 44px; background-position: center; background-repeat: no-repeat;}.swiper-button-prev.swiper-button-disabled,.swiper-button-next.swiper-button-disabled {opacity: 0.35; cursor: auto; pointer-events: none;}.swiper-button-prev,.swiper-container-rtl .swiper-button-next {background-image: url(\"data:image/svg+xml;charset\x3dutf-8,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2027%2044'%3E%3Cpath%20d%3D'M0%2C22L22%2C0l2.1%2C2.1L4.2%2C22l19.9%2C19.9L22%2C44L0%2C22L0%2C22L0%2C22z'%20fill%3D'%23007aff'%2F%3E%3C%2Fsvg%3E\"); left: 10px; right: auto;}.swiper-button-prev.swiper-button-black,.swiper-container-rtl .swiper-button-next.swiper-button-black {background-image: url(\"data:image/svg+xml;charset\x3dutf-8,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2027%2044'%3E%3Cpath%20d%3D'M0%2C22L22%2C0l2.1%2C2.1L4.2%2C22l19.9%2C19.9L22%2C44L0%2C22L0%2C22L0%2C22z'%20fill%3D'%23000000'%2F%3E%3C%2Fsvg%3E\");}.swiper-button-prev.swiper-button-white,.swiper-container-rtl .swiper-button-next.swiper-button-white {background-image: url(\"data:image/svg+xml;charset\x3dutf-8,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2027%2044'%3E%3Cpath%20d%3D'M0%2C22L22%2C0l2.1%2C2.1L4.2%2C22l19.9%2C19.9L22%2C44L0%2C22L0%2C22L0%2C22z'%20fill%3D'%23ffffff'%2F%3E%3C%2Fsvg%3E\");}.swiper-button-next,.swiper-container-rtl .swiper-button-prev {background-image: url(\"data:image/svg+xml;charset\x3dutf-8,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2027%2044'%3E%3Cpath%20d%3D'M27%2C22L27%2C22L5%2C44l-2.1-2.1L22.8%2C22L2.9%2C2.1L5%2C0L27%2C22L27%2C22z'%20fill%3D'%23007aff'%2F%3E%3C%2Fsvg%3E\"); right: 10px; left: auto;}.swiper-button-next.swiper-button-black,.swiper-container-rtl .swiper-button-prev.swiper-button-black {background-image: url(\"data:image/svg+xml;charset\x3dutf-8,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2027%2044'%3E%3Cpath%20d%3D'M27%2C22L27%2C22L5%2C44l-2.1-2.1L22.8%2C22L2.9%2C2.1L5%2C0L27%2C22L27%2C22z'%20fill%3D'%23000000'%2F%3E%3C%2Fsvg%3E\");}.swiper-button-next.swiper-button-white,.swiper-container-rtl .swiper-button-prev.swiper-button-white {background-image: url(\"data:image/svg+xml;charset\x3dutf-8,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2027%2044'%3E%3Cpath%20d%3D'M27%2C22L27%2C22L5%2C44l-2.1-2.1L22.8%2C22L2.9%2C2.1L5%2C0L27%2C22L27%2C22z'%20fill%3D'%23ffffff'%2F%3E%3C%2Fsvg%3E\");}.swiper-pagination {position: absolute; text-align: center; -webkit-transition: 300ms; -moz-transition: 300ms; -o-transition: 300ms; transition: 300ms; -webkit-transform: translate3d(0, 0, 0); -ms-transform: translate3d(0, 0, 0); -o-transform: translate3d(0, 0, 0); transform: translate3d(0, 0, 0); z-index: 10;}.swiper-pagination.swiper-pagination-hidden {opacity: 0;}.swiper-pagination-fraction,.swiper-pagination-custom,.swiper-container-horizontal \x3e .swiper-pagination-bullets {bottom: 10px; left: 0; width: 100%;}.swiper-pagination-bullet {width: 8px; height: 8px; display: inline-block; border-radius: 100%; background: #000; opacity: 0.2;}button.swiper-pagination-bullet {border: none; margin: 0; padding: 0; box-shadow: none; -moz-appearance: none; -ms-appearance: none; -webkit-appearance: none; appearance: none;}.swiper-pagination-clickable .swiper-pagination-bullet {cursor: pointer;}.swiper-pagination-white .swiper-pagination-bullet {background: #fff;}.swiper-pagination-bullet-active {opacity: 1; background: #007aff;}.swiper-pagination-white .swiper-pagination-bullet-active {background: #fff;}.swiper-pagination-black .swiper-pagination-bullet-active {background: #000;}.swiper-container-vertical \x3e .swiper-pagination-bullets {right: 10px; top: 50%; -webkit-transform: translate3d(0px, -50%, 0); -moz-transform: translate3d(0px, -50%, 0); -o-transform: translate(0px, -50%); -ms-transform: translate3d(0px, -50%, 0); transform: translate3d(0px, -50%, 0);}.swiper-container-vertical \x3e .swiper-pagination-bullets .swiper-pagination-bullet {margin: 5px 0; display: block;}.swiper-container-horizontal \x3e .swiper-pagination-bullets .swiper-pagination-bullet {margin: 0 5px;}.swiper-pagination-progress {background: rgba(0, 0, 0, 0.25); position: absolute;}.swiper-pagination-progress .swiper-pagination-progressbar {background: #007aff; position: absolute; left: 0; top: 0; width: 100%; height: 100%; -webkit-transform: scale(0); -ms-transform: scale(0); -o-transform: scale(0); transform: scale(0); -webkit-transform-origin: left top; -moz-transform-origin: left top; -ms-transform-origin: left top; -o-transform-origin: left top; transform-origin: left top;}.swiper-container-rtl .swiper-pagination-progress .swiper-pagination-progressbar {-webkit-transform-origin: right top; -moz-transform-origin: right top; -ms-transform-origin: right top; -o-transform-origin: right top; transform-origin: right top;}.swiper-container-horizontal \x3e .swiper-pagination-progress {width: 100%; height: 4px; left: 0; top: 0;}.swiper-container-vertical \x3e .swiper-pagination-progress {width: 4px; height: 100%; left: 0; top: 0;}.swiper-pagination-progress.swiper-pagination-white {background: rgba(255, 255, 255, 0.5);}.swiper-pagination-progress.swiper-pagination-white .swiper-pagination-progressbar {background: #fff;}.swiper-pagination-progress.swiper-pagination-black .swiper-pagination-progressbar {background: #000;}.swiper-container-3d {-webkit-perspective: 1200px; -moz-perspective: 1200px; -o-perspective: 1200px; perspective: 1200px;}.swiper-container-3d .swiper-wrapper,.swiper-container-3d .swiper-slide,.swiper-container-3d .swiper-slide-shadow-left,.swiper-container-3d .swiper-slide-shadow-right,.swiper-container-3d .swiper-slide-shadow-top,.swiper-container-3d .swiper-slide-shadow-bottom,.swiper-container-3d .swiper-cube-shadow {-webkit-transform-style: preserve-3d; -moz-transform-style: preserve-3d; -ms-transform-style: preserve-3d; transform-style: preserve-3d;}.swiper-container-3d .swiper-slide-shadow-left,.swiper-container-3d .swiper-slide-shadow-right,.swiper-container-3d .swiper-slide-shadow-top,.swiper-container-3d .swiper-slide-shadow-bottom {position: absolute; left: 0; top: 0; width: 100%; height: 100%; pointer-events: none; z-index: 10;}.swiper-container-3d .swiper-slide-shadow-left {background-image: -webkit-gradient(linear, left top, right top, from(rgba(0, 0, 0, 0.5)), to(rgba(0, 0, 0, 0))); background-image: -webkit-linear-gradient(right, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0)); background-image: -moz-linear-gradient(right, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0)); background-image: -o-linear-gradient(right, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0)); background-image: linear-gradient(to left, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0));}.swiper-container-3d .swiper-slide-shadow-right {background-image: -webkit-gradient(linear, right top, left top, from(rgba(0, 0, 0, 0.5)), to(rgba(0, 0, 0, 0))); background-image: -webkit-linear-gradient(left, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0)); background-image: -moz-linear-gradient(left, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0)); background-image: -o-linear-gradient(left, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0)); background-image: linear-gradient(to right, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0));}.swiper-container-3d .swiper-slide-shadow-top {background-image: -webkit-gradient(linear, left top, left bottom, from(rgba(0, 0, 0, 0.5)), to(rgba(0, 0, 0, 0))); background-image: -webkit-linear-gradient(bottom, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0)); background-image: -moz-linear-gradient(bottom, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0)); background-image: -o-linear-gradient(bottom, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0)); background-image: linear-gradient(to top, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0));}.swiper-container-3d .swiper-slide-shadow-bottom {background-image: -webkit-gradient(linear, left bottom, left top, from(rgba(0, 0, 0, 0.5)), to(rgba(0, 0, 0, 0))); background-image: -webkit-linear-gradient(top, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0)); background-image: -moz-linear-gradient(top, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0)); background-image: -o-linear-gradient(top, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0)); background-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0));}.swiper-container-coverflow .swiper-wrapper,.swiper-container-flip .swiper-wrapper {-ms-perspective: 1200px;}.swiper-container-cube,.swiper-container-flip {overflow: visible;}.swiper-container-cube .swiper-slide,.swiper-container-flip .swiper-slide {pointer-events: none; -webkit-backface-visibility: hidden; -moz-backface-visibility: hidden; -ms-backface-visibility: hidden; backface-visibility: hidden; z-index: 1;}.swiper-container-cube .swiper-slide .swiper-slide,.swiper-container-flip .swiper-slide .swiper-slide {pointer-events: none;}.swiper-container-cube .swiper-slide-active,.swiper-container-flip .swiper-slide-active,.swiper-container-cube .swiper-slide-active .swiper-slide-active,.swiper-container-flip .swiper-slide-active .swiper-slide-active {pointer-events: auto;}.swiper-container-cube .swiper-slide-shadow-top,.swiper-container-flip .swiper-slide-shadow-top,.swiper-container-cube .swiper-slide-shadow-bottom,.swiper-container-flip .swiper-slide-shadow-bottom,.swiper-container-cube .swiper-slide-shadow-left,.swiper-container-flip .swiper-slide-shadow-left,.swiper-container-cube .swiper-slide-shadow-right,.swiper-container-flip .swiper-slide-shadow-right {z-index: 0; -webkit-backface-visibility: hidden; -moz-backface-visibility: hidden; -ms-backface-visibility: hidden; backface-visibility: hidden;}.swiper-container-cube .swiper-slide {visibility: hidden; -webkit-transform-origin: 0 0; -moz-transform-origin: 0 0; -ms-transform-origin: 0 0; transform-origin: 0 0; width: 100%; height: 100%;}.swiper-container-cube.swiper-container-rtl .swiper-slide {-webkit-transform-origin: 100% 0; -moz-transform-origin: 100% 0; -ms-transform-origin: 100% 0; transform-origin: 100% 0;}.swiper-container-cube .swiper-slide-active,.swiper-container-cube .swiper-slide-next,.swiper-container-cube .swiper-slide-prev,.swiper-container-cube .swiper-slide-next + .swiper-slide {pointer-events: auto; visibility: visible;}.swiper-container-cube .swiper-cube-shadow {position: absolute; left: 0; bottom: 0px; width: 100%; height: 100%; background: #000; opacity: 0.6; -webkit-filter: blur(50px); filter: blur(50px); z-index: 0;}.swiper-container-fade.swiper-container-free-mode .swiper-slide {-webkit-transition-timing-function: ease-out; -moz-transition-timing-function: ease-out; -ms-transition-timing-function: ease-out; -o-transition-timing-function: ease-out; transition-timing-function: ease-out;}.swiper-container-fade .swiper-slide {pointer-events: none; -webkit-transition-property: opacity; -moz-transition-property: opacity; -o-transition-property: opacity; transition-property: opacity;}.swiper-container-fade .swiper-slide .swiper-slide {pointer-events: none;}.swiper-container-fade .swiper-slide-active,.swiper-container-fade .swiper-slide-active .swiper-slide-active {pointer-events: auto;}.swiper-zoom-container {width: 100%; height: 100%; display: -webkit-box; display: -moz-box; display: -ms-flexbox; display: -webkit-flex; display: flex; -webkit-box-pack: center; -moz-box-pack: center; -ms-flex-pack: center; -webkit-justify-content: center; justify-content: center; -webkit-box-align: center; -moz-box-align: center; -ms-flex-align: center; -webkit-align-items: center; align-items: center; text-align: center;}.swiper-zoom-container \x3e img,.swiper-zoom-container \x3e svg,.swiper-zoom-container \x3e canvas {max-width: 100%; max-height: 100%; object-fit: contain;}.swiper-scrollbar {border-radius: 10px; position: relative; -ms-touch-action: none; background: rgba(0, 0, 0, 0.1);}.swiper-container-horizontal \x3e .swiper-scrollbar {position: absolute; left: 1%; bottom: 3px; z-index: 50; height: 5px; width: 98%;}.swiper-container-vertical \x3e .swiper-scrollbar {position: absolute; right: 3px; top: 1%; z-index: 50; width: 5px; height: 98%;}.swiper-scrollbar-drag {height: 100%; width: 100%; position: relative; background: rgba(0, 0, 0, 0.5); border-radius: 10px; left: 0; top: 0;}.swiper-scrollbar-cursor-drag {cursor: move;}.swiper-lazy-preloader {width: 42px; height: 42px; position: absolute; left: 50%; top: 50%; margin-left: -21px; margin-top: -21px; z-index: 10; -webkit-transform-origin: 50%; -moz-transform-origin: 50%; transform-origin: 50%; -webkit-animation: swiper-preloader-spin 1s steps(12, end) infinite; -moz-animation: swiper-preloader-spin 1s steps(12, end) infinite; animation: swiper-preloader-spin 1s steps(12, end) infinite;}.swiper-lazy-preloader:after {display: block; content: \"\"; width: 100%; height: 100%; background-image: url(\"data:image/svg+xml;charset\x3dutf-8,%3Csvg%20viewBox%3D'0%200%20120%20120'%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20xmlns%3Axlink%3D'http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink'%3E%3Cdefs%3E%3Cline%20id%3D'l'%20x1%3D'60'%20x2%3D'60'%20y1%3D'7'%20y2%3D'27'%20stroke%3D'%236c6c6c'%20stroke-width%3D'11'%20stroke-linecap%3D'round'%2F%3E%3C%2Fdefs%3E%3Cg%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%20transform%3D'rotate(30%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%20transform%3D'rotate(60%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%20transform%3D'rotate(90%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%20transform%3D'rotate(120%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%20transform%3D'rotate(150%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.37'%20transform%3D'rotate(180%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.46'%20transform%3D'rotate(210%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.56'%20transform%3D'rotate(240%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.66'%20transform%3D'rotate(270%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.75'%20transform%3D'rotate(300%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.85'%20transform%3D'rotate(330%2060%2C60)'%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E\"); background-position: 50%; -webkit-background-size: 100%; background-size: 100%; background-repeat: no-repeat;}.swiper-lazy-preloader-white:after {background-image: url(\"data:image/svg+xml;charset\x3dutf-8,%3Csvg%20viewBox%3D'0%200%20120%20120'%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20xmlns%3Axlink%3D'http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink'%3E%3Cdefs%3E%3Cline%20id%3D'l'%20x1%3D'60'%20x2%3D'60'%20y1%3D'7'%20y2%3D'27'%20stroke%3D'%23fff'%20stroke-width%3D'11'%20stroke-linecap%3D'round'%2F%3E%3C%2Fdefs%3E%3Cg%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%20transform%3D'rotate(30%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%20transform%3D'rotate(60%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%20transform%3D'rotate(90%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%20transform%3D'rotate(120%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%20transform%3D'rotate(150%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.37'%20transform%3D'rotate(180%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.46'%20transform%3D'rotate(210%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.56'%20transform%3D'rotate(240%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.66'%20transform%3D'rotate(270%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.75'%20transform%3D'rotate(300%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.85'%20transform%3D'rotate(330%2060%2C60)'%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E\");}@-webkit-keyframes swiper-preloader-spin {100% {-webkit-transform: rotate(360deg);}}@keyframes swiper-preloader-spin {100% {transform: rotate(360deg);}}.jimu-widget-nearme-filter {width: 100%; height: 100%; position: relative;}.jimu-widget-nearme-filter .filter-list{height: 100%; overflow: auto; border-top: 1px solid #d7d7d7;} .jimu-widget-nearme-filter .filter-list,.jimu-widget-nearme-filter .filter-list li {margin: 0; padding: 0;}.jimu-widget-nearme-filter .filter-list li {list-style: none;}.jimu-widget-nearme-filter .filter-list .filter-item{border-bottom: 1px solid #d7d7d7; font-size: 12px; overflow: hidden; outline-offset: -2px;}.jimu-widget-nearme-filter .filter-list .filter-item .header{vertical-align: middle; padding-top: 12px; padding-bottom: 12px; min-height: 40px; cursor: pointer; position: relative;}.jimu-widget-nearme-filter .filter-list .filter-item .header:hover{background-color: #eee;}.jimu-widget-nearme-filter .filter-list .filter-item.config-parameters .header .item-title{font-family: 'Avenir Medium', Verdana, Geneva, sans-serif;}.jimu-widget-nearme-filter .filter-list .filter-item .body{display: none;}.jimu-widget-nearme-filter .filter-list .filter-item.config-parameters .body{display: block;}.jimu-widget-nearme-filter .filter-list .filter-item .header\x3e*{line-height: 25px; display: inline-block; vertical-align: middle; word-break: break-word;}.jimu-widget-nearme-filter .filter-list .filter-item .header\x3e.icon{vertical-align: top;}.jimu-widget-nearme-filter .filter-list .filter-item .header:after{content: \"\"; height: 100%; min-height: 16px; vertical-align: top; display: inline-block;}.jimu-widget-nearme-filter .filter-list .filter-item .header .icon{width: 25px; height: 25px; margin-right: 5px;}.jimu-rtl .jimu-widget-nearme-filter .filter-list .filter-item .header .icon{margin-right: 0; margin-left: 5px;}.jimu-widget-nearme-filter .filter-list .filter-item .header .icon img{width: 100%; height: 100%;}.jimu-widget-nearme-filter .filter-list .filter-item .header .cando{display: block; position: absolute; top: 14px; right: 0; width: 16px; height: 16px; content: ''; border-radius: 50%; text-indent: -9999em; background: none; border: 2px solid #d6d6d6;}.jimu-rtl .jimu-widget-nearme-filter .filter-list .filter-item .header .cando{left: 0; right: auto;}.jimu-widget-nearme-filter .filter-list .filter-item .header .doing{display: none; position: absolute; top: 14px; right: 0; width: 16px; height: 16px; border-radius: 50%; text-indent: -9999em; background: none; border: 2px solid #d6d6d6; border-left-color: #4A4A4A; -webkit-animation: load8 1.1s infinite linear; -moz-animation: load8 1.1s infinite linear; -ms-animation: load8 1.1s infinite linear; -o-animation: load8 1.1s infinite linear; animation: load8 1.1s infinite linear; -webkit-transform: translateZ(0); -moz-transform: translateZ(0); -ms-transform: translateZ(0); -o-transform: translateZ(0); transform: translateZ(0);}.jimu-rtl .jimu-widget-nearme-filter .filter-list .filter-item .header .doing{left: 0; right: auto;}.jimu-widget-nearme-filter .filter-list .filter-item .header .done{display: none; position: absolute; top: 14px; right: 0; width: 16px; height: 16px; border-radius: 50%; text-indent: -9999em; background: url(\"images/done.svg\") no-repeat center;}.jimu-rtl .jimu-widget-nearme-filter .filter-list .filter-item .header .done{left: 0; right: auto;}.jimu-widget-nearme-filter .filter-list .filter-item.requesting .header .cando,.jimu-widget-nearme-filter .filter-list .filter-item.applying .header .cando{display: none;}.jimu-widget-nearme-filter .filter-list .filter-item.requesting .header .doing,.jimu-widget-nearme-filter .filter-list .filter-item.applying .header .doing{display: block;}.jimu-widget-nearme-filter .filter-list .filter-item.requesting .header .done,.jimu-widget-nearme-filter .filter-list .filter-item.applying .header .done{display: none;}.jimu-widget-nearme-filter .filter-list .filter-item.applied .header .cando{display: none;}.jimu-widget-nearme-filter .filter-list .filter-item.applied .header .doing{display: none;}.jimu-widget-nearme-filter .filter-list .filter-item.applied .header .done{display: block;}.jimu-widget-nearme-filter .filter-list .filter-item .header .arrow{content: ''; border-radius: 50%; width: 16px; height: 25px; top: 12px; text-indent: -9999em; background: url(\"images/arrow_normal.svg\") no-repeat center; z-index: 10;}.jimu-widget-nearme-filter .filter-list .filter-item .header .arrow:hover{background: url(\"images/arrow_hover.svg\") no-repeat center;}.jimu-widget-nearme-filter .filter-list .filter-item.config-parameters .header .arrow{transform: rotate(90deg);}.jimu-widget-nearme-filter .filter-list .filter-item.not-has-ask-for-value .header .arrow{background: transparent !important;}.jimu-widget-nearme-filter .filter-list .filter-item .body .parameters{margin: 0 30px;}.jimu-widget-nearme-filter .filter-list .filter-item .body .jimu-btn{background: #fff; border-radius: 0; width: 82px; border: 1px solid #c7c7c7; color: #000; font-size: 12px; margin-bottom: 15px;}.jimu-widget-nearme-filter .filter-list .filter-item .body .jimu-btn:hover{border: 1px solid #000;}.jimu-widget-nearme-filter .jimu-loading-shelter .loading-container{width: auto;}.jimu-widget-nearme-filter .esriCTGroupFilterLayerName{vertical-align: middle; min-height: 40px; font-weight: bold; font-size: 14px; padding: 12px; border-bottom: 1px solid #d7d7d7;}@-webkit-keyframes load8 {0% {-webkit-transform: rotate(0deg); transform: rotate(0deg);} 100% {-webkit-transform: rotate(360deg); transform: rotate(360deg);}}@-moz-keyframes load8 {0% {-moz-transform: rotate(0deg); transform: rotate(0deg);} 100% {-moz-transform: rotate(360deg); transform: rotate(360deg);}}@-ms-keyframes load8 {0% {-ms-transform: rotate(0deg); transform: rotate(0deg);} 100% {-ms-transform: rotate(360deg); transform: rotate(360deg);}}@keyframes load8 {0% {-webkit-transform: rotate(0deg); -ms-transform: rotate(0deg); -moz-transform: rotate(0deg); transform: rotate(0deg);} 100% {-webkit-transform: rotate(360deg); -ms-transform: rotate(360deg); -moz-transform: rotate(360deg); transform: rotate(360deg);}}.jimu-widget-nearme .swiper-container {width: 100%; height: 250px;}.jimu-widget-nearme .swiper-slide {text-align: center; font-size: 18px; background: #fff; display: -webkit-box; display: -ms-flexbox; display: -webkit-flex; display: flex; -webkit-box-pack: center; -ms-flex-pack: center; -webkit-justify-content: center; justify-content: center; -webkit-box-align: center; -ms-flex-align: center; -webkit-align-items: center; align-items: center;}.jimu-widget-nearme .swiper-slide img {max-width: 100%; height: auto;}.jimu-widget-nearme .swiper-slide .chart {width: 200px; height: 200px;}.jimu-widget-nearme .swiper-pagination-bullet:focus {opacity: 1 !important;}.esriCTNearMeContentPanel{padding: 15px 0px !important; overflow-y: hidden !important;}.esriCTContentPanelNoPadding{padding: 0 0 !important;}.jimu-widget-nearme{min-width: 222px; height: 100%; overflow-x: hidden;}.jimu-widget-nearme .esriCTHidden{display: none;}.jimu-widget-nearme .esriCTWidgetMainNode{min-height: 200px;}.jimu-widget-nearme .esriCTWidgetErrorNode{padding: 0px 14px;}.jimu-widget-nearme .mediaSection{padding-bottom: 10px; clear: both;}.jimu-widget-nearme .esriCTDistanceToLocation{line-height: 25px; margin-top: 10px; background-color: #d9dde0; text-align: center;}.jimu-widget-nearme .simpleDirections .esriSearchSourceContainer{display: none;}.jimu-widget-nearme .simpleDirections .esriStopsContainer{height: 0px; margin: 0px;}.jimu-widget-nearme .getDirectionsBtnContainer{display: none;}.jimu-widget-nearme .esriStopsTableContainer{display: none;}.jimu-widget-nearme .esriStopsButtons{display: none;}.jimu-widget-nearme .simpleDirections{margin-top: 20px;}.jimu-widget-nearme .simpleDirections .savePrintBtnContainer{position: relative; top: 15px; left: 90%; margin: 0px; z-index: 1;}.jimu-launchpad-panel .jimu-widget-nearme .simpleDirections .savePrintBtnContainer{top: 10px;}.jimu-launchpad-panel .jimu-widget-nearme .simpleDirections .esriStopsGetDirectionsContainer{padding-top: 0; margin: 0px 10px;}.jimu-widget-nearme .simpleDirections .esriResultsSummary{padding: 0 40px;}.jimu-widget-nearme .simpleDirections .esriResultsLoading .esriResultsContainer{display: none;}.jimu-widget-nearme .esriCTSliderDiv{height: 60px; padding-top: 10px; clear: both;}.jimu-widget-nearme .esriCTOverrideSliderDiv{padding-top: 2px;}.jimu-widget-nearme .esriCTSliderText{font-size: 12px; color: #000000; font-weight: normal;}.jimu-widget-nearme .esriCTHorizantalSlider{width: 100%; margin-top: 15px;}.jimu-widget-nearme .esriCTSliderValuesDiv{width: 100%; margin-top: 8px;}.jimu-widget-nearme .esriCTSliderMinValueDiv{float: left; margin-left: 2px;}.jimu-widget-nearme .esriCTSliderMaxValueDiv{float: right; margin-right: 2px;}.claro .jimu-widget-nearme .dijitSlider {background: transparent; border: 0 none; -webkit-border-radius: 3px; border-radius: 3px; padding: 0;}.claro .jimu-widget-nearme .dijitSliderBar {border-style: solid; outline: 1px;}.claro .jimu-widget-nearme .dijitRuleLabelsContainer {color: #2b2e34;}.claro .jimu-widget-nearme .dijitSliderDisabled {opacity: 0.65; -ms-filter: \"progid:DXImageTransform.Microsoft.Alpha(Opacity\x3d65)\"; filter: alpha(opacity\x3d65);}.claro .jimu-widget-nearme .dijitRuleLabelsContainerH {padding: 8px 0 !important; color: #878787 !important;}.claro .jimu-widget-nearme .dijitSliderBarH,.claro .jimu-widget-nearme .dijitSliderBumperH {height: 4px;}.claro .jimu-widget-nearme .dijitSlider .dijitSliderLeftBumper {-webkit-border-radius: 2px 0 0 2px; border-radius: 2px 0 0 2px; border-width: 1px 0 1px 1px; margin-left: 4px;}.claro .jimu-widget-nearme .dijitSlider .dijitSliderRightBumper {-webkit-border-radius: 0 2px 2px 0; border-radius: 0 2px 2px 0; border-width: 1px 1px 1px 0; margin-left: -2px; margin-right: 4px;}.claro .jimu-widget-nearme .dijitSlider .dijitSliderProgressBarH {border-color: #878787; background-color: #878787; background-image: none; -webkit-box-shadow: none; box-shadow: none;}.claro .jimu-widget-nearme .dijitSlider .dijitSliderLeftBumper {border-color: #878787; background-color: #878787; background-image: none; -webkit-box-shadow: none; box-shadow: none; -webkit-border-radius: 2px 0 0 2px; border-radius: 2px 0 0 2px;}.claro .jimu-widget-nearme .dijitSlider .dijitSliderRemainingBarH,.claro .jimu-widget-nearme .dijitSlider .dijitSliderRightBumper {border-color: #ebebeb; background-color: #ebebeb; -webkit-border-radius: 2px; border-radius: 2px;}.claro .jimu-widget-nearme .dijitSliderHover .dijitSliderProgressBarH,.claro .jimu-widget-nearme .dijitSliderHover .dijitSliderLeftBumper {border-color: #6e6e6e; background-color: #6e6e6e; background-image: none; -webkit-box-shadow: none; box-shadow: none;}.claro .jimu-widget-nearme .dijitSliderFocused .dijitSliderProgressBarH,.claro .jimu-widget-nearme .dijitSliderFocused .dijitSliderLeftBumper {border-color: #878787;}.claro .jimu-widget-nearme .dijitSliderFocused .dijitSliderRemainingBarH,.claro .jimu-widget-nearme .dijitSliderFocused .dijitSliderRightBumper {border-color: #ebebeb; background-color: #ebebeb; -webkit-box-shadow: none; box-shadow: none;}.claro .jimu-widget-nearme .dijitSliderRtl .dijitSliderLeftBumper,.claro .jimu-widget-nearme .dijitSliderRtl .dijitSliderRightBumper{display: none;}.claro .jimu-widget-nearme .dijitSliderImageHandle {background: #878787; -webkit-border-radius: 50%; border-radius: 50%; border: 0 none; width: 16px; height: 16px; margin-top: -2px; position: absolute;}.claro .jimu-widget-nearme .dijitSliderImageHandle:after {content: \"\"; display: block; background: #ffffff; -webkit-border-radius: 50%; border-radius: 50%; height: 8px; width: 8px; left: 4px; top: 4px; position: absolute;}.claro .jimu-widget-nearme .dijitSliderDisabled.dijitSliderFocused .dijitSliderImageHandle:after {display: none; outline: none;}.claro .jimu-widget-nearme .dijitSliderDecrementIconH,.claro .jimu-widget-nearme .dijitSliderIncrementIconH,.claro .jimu-widget-nearme .jimu-widget-nearme .dijitSliderDecrementIconH:hover,.claro .jimu-widget-nearme .dijitSliderIncrementIconH:hover{padding: 0; height: 20px; width: 20px; background-color: transparent; border: 0 none;}.jimu-widget-nearme .esriCTSearchDiv{float: left;}.jimu-widget-nearme .esriCTSearchDiv .arcgisSearch{float: left; width: 100% !important;}.jimu-widget-nearme .esriCTSearchContainer{width: 100%; height: 35px; float: left; clear: both;}.jimu-widget-nearme .arcgisSearch .searchGroup .searchInput{width: 170px;}.jimu-widget-nearme .arcgisSearch .searchBtn{padding: 6px;}.jimu-widget-search .arcgisSearch .searchGroup .searchInputGroup .searchInput{width: auto;}.jimu-widget-nearme .esriCTSearchOuterContainer{width: calc(100% - 40px); margin: 0 auto;}.jimu-widget-nearme .esriCTSearchHeader{padding: 2px 2px 10px 2px; font-size: 12px; color: #000000; font-weight: normal; outline-offset: -2px;}.jimu-widget-nearme .arcgisSearch .searchToggle:focus{outline: 2px solid #18acc2;}.jimu-launchpad-panel .jimu-widget-nearme .arcgisSearch .searchClose, .arcgisSearch .searchSpinner{height: 28px;}.jimu-widget-nearme .arcgisSearch .searchMenu{max-height: 250px;}.jimu-widget-nearme .esriCTSelectLocationDiv{margin: 0px 0px 0px 12px; float: right;}.jimu-widget-nearme .esriCTSelectLocation{background-image: url(\"../images/select-location.png\");}.jimu-widget-nearme .esriCTSelectLocationActive{background-image: url(\"../images/select-location-active.png\"); background-color: #57585A;}.jimu-widget-nearme .esriCTImgButtons{cursor: pointer; width: 32px; height: 34px; border: 1px solid #57585A; border-radius: 4px; background-size: 20px; background-position: center center; background-repeat: no-repeat;}.jimu-widget-nearme .esriCTCurrentLocationDiv{margin: 0px 0px 0px 12px; float: left;}.jimu-widget-nearme .esriCTCurrentLocation .LocateButton .zoomLocateButton{background-image: url(\"../images/current-location.png\"); background-color: transparent; background-size: 20px; background-position: center center; background-repeat: no-repeat;}.esriRtl .jimu-widget-nearme .esriCTCurrentLocationDiv{margin: 0px 12px 12px 0px;float: right;}.jimu-widget-nearme .jimu-loading-indicator{z-index: 100;}.jimu-widget-nearme .esriCTListOuterContainer{margin-top: 10px;}.jimu-widget-nearme .esriCTItemListMainContainer{width: 100%; right: 0px; min-height: 80px; left: 0px; height: calc(100% - 188px); position: absolute; padding-top: 5px;}.jimu-widget-nearme .esriCTFilterListMainContainer{width: 100%; right: 0px; min-height: 80px; left: 0px; height: calc(100% - 188px); position: absolute;}.jimu-widget-nearme .esriCTItemListOverrideMainContainer{height: calc(100% - 80px);}.jimu-widget-nearme .esriCTItemListOverrideMainContainerForBothBufferOptions{height: calc(100% - 160px);}.jimu-widget-nearme .esriCTItemlList{width: 100%; border-bottom: 1px solid #DDDDDD; height: 36px; cursor: pointer; outline-offset: -1px;}.jimu-widget-nearme .esriCTItemlList:focus{font-weight: bolder; outline: 2px solid #18acc2;}.jimu-widget-nearme .esriCTItemName{white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 35px; padding: 0px 10px 0px 20px;}.jimu-widget-nearme .esriCTPanelHeader .esriCTItemName{padding: 0px 20px 0px 0px; font-size: 12px; color: #3e3e3e;}.jimu-widget-nearme .esriCTItemRightArrow, .jimu-widget-nearme .esriCTItemLeftArrow{width: 10px; height: 20px; background-repeat: no-repeat; background-color: #3e3e3e; background-position: center center;}.jimu-widget-nearme .esriCTItemRightArrow{margin: 7px 20px 0px 0px;}.jimu-widget-nearme .esriCTItemLeftArrow{margin: 7px 10px 0px 0px;}.jimu-widget-nearme .esriCTItemCount{float: right; margin: 0px 20px 0px 0px; line-height: 35px; height: 35px; text-align: right; overflow: hidden; max-width: 100px;}.jimu-widget-nearme .esriCTLoadingIcon{background-image: url('../images/loading-icon.gif'); background-position: center center; background-repeat: no-repeat; height: 20px; width: 20px; margin-top: 7px;}.jimu-widget-nearme .esriCTItemRightArrow{background-image: url('../images/right-arrow.png'); float: right;}.jimu-widget-nearme .esriCTItemLeftArrow{background-image: url('../images/left-arrow.png'); float: left;}.esriCTDisabled{cursor: default !important;}.esriCTDisabled .esriCTItemRightArrow{background-color: #d8d8d8;}.jimu-widget-nearme .esriCTBackButtonText{float: left; height: 35px; line-height: 35px; text-overflow: ellipsis; white-space: nowrap; max-width: 100px; overflow: hidden;}.jimu-widget-nearme .esriCTBackButton{float: left;}.jimu-widget-nearme .esriCTPanelHeader{font-weight: bold; padding-left: 20px; padding-right: 20px;}.esriCTDirectionInfoPanel .esriCTItemlList{border-bottom: none;}.esriCTFeatureList .esriCTItemRightArrow, .esriCTLayerList .esriCTItemLeftArrow, .esriCTDirectionInfoPanel .esriCTItemRightArrow, .esriCTDirectionInfoPanel .esriCTItemCount{display: none;}.esriCTFeatureListItem .esriCTItemCount{display: block;}.esriCTFeatureListItem .esriCTItemLeftArrow, .esriCTFeatureListItem .esriCTBackButtonText{display: none;}.jimu-widget-nearme .esriCTLayerList, .jimu-widget-nearme .esriCTFeatureList, .jimu-widget-nearme .esriCTDirectionInfoPanel{border-top: 1px solid #464646; position: absolute; width: 100%; height: 100%; left: 0px; top: 0px; display: none;}.jimu-widget-nearme .esriCTNoFeatureFound{height: 32px; margin: 5px 16px; line-height: 30px;}.jimu-widget-nearme .esriCTFeatureListContent{height: calc(100% - 30px); overflow: auto;}.jimu-widget-nearme .esriCTLayerList{overflow: auto;}.jimu-widget-nearme .esriCTAttributeSymbolWrapper{margin: 5px; display: inline-block;}.jimu-widget-nearme .esriCTAttributeSymbolContainer{float: left; margin-right : 5px;}.jimu-widget-nearme .esriCTItemListMainContainer .editSummarySection{display: none;}.jimu-widget-nearme .jimu-tab \x3e .jimu-viewstack{position: relative; top: 0px; height: 100%;}.jimu-widget-nearme .dijitContentPane{overflow: auto; padding: 0px 20px; -webkit-overflow-scrolling: auto;}.jimu-widget-nearme .esriCTPopupInfo{padding: 20px 0px !important; width: 100% !important; height: auto !important;}.jimu-widget-nearme .jimu-tab{height: calc(100% - 56px); min-height: 80px; margin-top: 2px;}.jimu-widget-nearme .esriCTOverrideHeight{height: calc(100% - 46px);}.jimu-widget-nearme .esriCTFeatureInfo{height: calc(100% - 35px); min-height: 80px;}.jimu-widget-nearme .esriCTBorderBottom{border-bottom: 1px solid #464646;}.jimu-widget-nearme .esriCTTopBorder{border-top: 1px solid #464646;}.jimu-widget-nearme .esriCTThumbnailContainer{margin: 2px;}.jimu-widget-nearme .esriCTAttachmentImg{cursor: pointer; position: absolute; margin: auto; top: 0; bottom: 0; right: 0; left: 0;}.jimu-widget-nearme .esriCTNonImageAttachmentImg{cursor: pointer; float: left;}.jimu-widget-nearme .esriCTImageFormatDiv{height: 18px; width: 50px; float: left; background-color: #C4BD97; text-align: center; line-height: 18px; color: #fff;}.jimu-widget-nearme .esriCTNonImageAttachmentContainer{height: 58px; width: 50px; float: left; margin: 0 10px 10px 2px; cursor: pointer;}.jimu-widget-nearme .esriCTImageLoader{cursor: default; display: block; background-position: center center; background-image: url(../images/image-loader.gif); background-repeat: no-repeat; width: 90px; height: 60px;}.jimu-widget-nearme .esriCTAutoHeight{height: auto;}.jimu-widget-nearme .esriViewPopup .break{display: none;}.esriRtl .jimu-widget-nearme .esriCTNonImageAttachmentImg{float: right;}.esriRtl .jimu-widget-nearme .esriCTImageFormatDiv{float: right;}.esriRtl .jimu-widget-nearme .esriCTNonImageAttachmentContainer{margin: 0 2px 10px 10px; float: right;}.esriRtl .jimu-widget-nearme .esriCTSliderMinValueDiv{float: right; margin-right: 2px;}.esriRtl .jimu-widget-nearme .esriCTSliderMaxValueDiv{float: left; margin-left: 2px;}.esriRtl .jimu-widget-nearme .esriCTItemName{padding: 0px 20px 0px 10px;}.esriRtl .jimu-widget-nearme .esriCTPanelHeader .esriCTItemName{padding: 0px 0px 0px 20px;}.esriRtl .jimu-widget-nearme .esriCTItemCount{float: left; margin: 0px 0px 0px 20px;}.esriRtl .jimu-widget-nearme .esriCTItemRightArrow{background-image: url('../images/left-arrow.png'); float: left; margin: 7px 0 0 20px;}.esriRtl .jimu-widget-nearme .esriCTBackButton{float: right;}.esriRtl .jimu-widget-nearme .esriCTItemLeftArrow{background-image: url('../images/right-arrow.png'); margin: 7px 0px 0px 10px;}.esriRtl .jimu-widget-nearme .simpleDirections .savePrintBtnContainer{left: 0px; right: 90%;}.esriRtl .jimu-widget-nearme .esriCTSearchDiv, .esriRtl .jimu-widget-nearme .esriCTAttributeSymbolContainer{float: right;}.esriRtl .jimu-widget-nearme .esriCTSelectLocationDiv{margin: 0px 0px 10px 0px; float: left;}.jimu-widget-nearme .esriCTProximityParent {position: relative; right: 65px; float: right; bottom: -20px;}.esriRtl .jimu-widget-nearme .esriCTProximityParent {right: inherit; left: 65px; float: left;}.jimu-widget-nearme .esriCTProximityIconContainer {position: absolute; height: 40px; width: 40px; background: #fffdfd; border-radius: 25px; box-shadow: 0px 0px 2px 2px #d4d4d4; cursor: pointer; z-index: 1; bottom: 0;}.jimu-widget-nearme .esriCTProximityIcon {background-image: url(../images/proximity.png); background-repeat: no-repeat; background-position: center center; background-color: gray; height: 24px; width: 24px; background-size: 24px 24px; margin: 8px;}.jimu-widget-nearme .esriCTFilterIconContainer {position: absolute; right: 25px; height: 40px; width: 40px; background: #fffdfd; border-radius: 25px; box-shadow: 0px 0px 2px 2px #d4d4d4; cursor: pointer; z-index: 1; bottom: 0;}.esriRtl .jimu-widget-nearme .esriCTFilterIconContainer {right: inherit; left: 25px;}.jimu-widget-nearme .esriCTFilterIcon {background-image: url(../images/filter.png); background-repeat: no-repeat; background-position: center center; background-color: gray; height: 25px; width: 25px; background-size: 25px 25px; margin: 8px;}.esriCTMapTooltip{width: 100px; word-wrap: break-word; border: 1px solid #7EABCD; background-color: white; padding: 5px; font-size: 9pt; z-index: 9999; -o-border-radius: 4px; -moz-border-radius: 4px; -webkit-border-radius: 4px; border-radius: 4px;}.jimu-widget-nearme .esriCTClearAllFilter {background-image: url(../images/clear-all-filter.png); background-repeat: no-repeat; background-position: center center; background-color: #d6d6d6; height: 20px; width: 20px; background-size: 20px 20px; cursor: default; float: right;}.esriRtl .jimu-widget-nearme .esriCTClearAllFilter {float: left;}.jimu-widget-nearme .esriCTClearAllFilterActive {background-color: #18acc2; cursor: pointer;}.jimu-widget-nearme .esriCTFilterBackDiv {width: calc(100% - 30px); float: left;}.esriRtl .jimu-widget-nearme .esriCTFilterBackDiv {float: right;}.dart-panel .jimu-widget-nearme .esriCTDistanceToLocation {background-color: rgba(0, 0, 0, 0.2) !important;}.dart-panel .jimu-widget-nearme .esriCTImgButtons {background-color: darkgray;}.dart-panel .arcgisSearch .searchGroup .searchInput {padding: 6px 24px 6px 12px !important;}.esriRtl .dart-panel .jimu-widget-nearme .arcgisSearch .searchGroup .searchInput {padding: 6px 12px 6px 24px !important;}.dart-panel .jimu-widget-nearme .arcgisSearch .searchMenu{background-color: darkgray !important;}.dart-panel .jimu-widget-nearme .arcgisSearch .searchMenu li:hover, .dart-panel .jimu-widget-nearme .arcgisSearch .searchMenu li:focus {background-color: #878787 !important;}.dart-panel .jimu-widget-nearme .simpleDirections .esriResultsSummary {background-color: darkgray !important;} .dart-panel .jimu-widget-nearme .simpleDirections .esriRouteLength {background: darkgray !important;}.jimu-widget-nearme .esriCTBufferTextboxParent{width: 100%; height: 40px; margin-top: 12px;}.jimu-widget-nearme .esriCTBufferTextboxText {white-space: nowrap; overflow: hidden; text-overflow: ellipsis; float: left; line-height: 30px;}.esriRtl .jimu-widget-nearme .esriCTBufferTextboxText{float: right;}.jimu-widget-nearme .esriCTBufferTextbox{width: 30%; float: left; margin-left: 8px;}.esriRtl .jimu-widget-nearme .esriCTBufferTextbox{float: right; margin-right: 8px;}.jimu-widget-nearme .esriCTapplyFilterArrowNodeParent{outline-offset: 2px; height: 15px; width: 80%; display: inline-block;}.jimu-widget-nearme .esriCTFliterListCheckbox{margin: 0px 22px;}.DashboardTheme .jimu-widget-nearme .esriCTItemName {color: white;}.DashboardTheme .jimu-widget-nearme .esriCTItemCount{color: white;}.DashboardTheme .jimu-widget-nearme .esriCTDistanceToLocation{color: #000000;}.DashboardTheme.light .jimu-widget-nearme .esriCTItemName{color: #000000;}.DashboardTheme.light .jimu-widget-nearme .esriCTItemCount{color: #000000;}.DashboardTheme .jimu-widget-nearme .esriCTClearAllFilter{background-image: url(../images/clear-all-filter-dark.png);}.DashboardTheme.light .jimu-widget-nearme .esriCTClearAllFilter{background-image: url(../images/clear-all-filter.png);}.DashboardTheme .jimu-widget-nearme .esriCTApplyFilterArrowNode{background-image: url(../images/filter-arrow-dark.png); background-color: #fff;}.DashboardTheme .jimu-widget-nearme .esriCTApplyFilterArrowUp{background-image: url(../images/filter-arrow-dark-up.png); background-color: #fff;}.DashboardTheme.light .jimu-widget-nearme .esriCTApplyFilterArrowNode{background-image: url(../images/filter-arrow.png); background-color: #3e3e3e;}.DashboardTheme.light .jimu-widget-nearme .esriCTApplyFilterArrowUp{background-image: url(../images/filter-arrow-up.png); background-color: #3e3e3e;}.DashboardTheme .jimu-widget-nearme-filter .filter-list .filter-item .header:hover{color: #222;}.jimu-widget-nearme .esriCTApplyFilterDiv{width: 100%; clear: both;}.jimu-widget-nearme .esriCTApplyFilterDivSpacing{margin-top: 15px;}.jimu-widget-nearme .esriCTFilterToApply{max-width: calc(100% - 40px); float: left; cursor: pointer;}.esriRtl .jimu-widget-nearme .esriCTFilterToApply{float: right;}.jimu-widget-nearme .esriCTApplyFilterArrowNode{background-image: url('../images/filter-arrow.png'); width: 18px; height: 18px; background-repeat: no-repeat; background-color: #3e3e3e; background-position: center center; float: left; margin: 0 5px; cursor: pointer;}.esriRtl .jimu-widget-nearme .esriCTApplyFilterArrowNode{float: right; margin: 3px 5px;}.jimu-widget-nearme .esriCTApplyFilterArrowUp{background-image: url('../images/filter-arrow-up.png');}",
"*now":function(V){V(['dojo/i18n!*preload*widgets/NearMe/nls/Widget*["ar","bs","ca","cs","da","de","en","el","es","et","fi","fr","he","hr","hu","id","it","ja","ko","lt","lv","nb","nl","pl","pt-br","pt-pt","ro","ru","sk","sl","sr","sv","th","tr","zh-cn","uk","vi","zh-hk","zh-tw","ROOT"]'])},"*noref":1}});
define("dojo/_base/declare dijit/_WidgetsInTemplateMixin jimu/BaseWidget dojo/on dojo/dom-construct dojo/dom-class dojo/query dojo/keys dojo/_base/lang dojo/_base/array ./utils ./search ./item-list ./filter-list jimu/portalUtils esri/layers/GraphicsLayer esri/graphic esri/tasks/GeometryService esri/tasks/BufferParameters dijit/form/HorizontalSlider dojo/dom-attr dojo/string dojo/dom-geometry dojo/dom-style esri/symbols/jsonUtils esri/tasks/locator esri/geometry/webMercatorUtils esri/InfoTemplate jimu/dijit/Message jimu/dijit/LoadingIndicator dijit/registry dojo/Deferred dojo/promise/all esri/tasks/query esri/tasks/QueryTask esri/request esri/geometry/scaleUtils esri/geometry/Extent jimu/dijit/EditorXssFilter esri/SpatialReference esri/dijit/LocateButton jimu/utils dijit/focus dijit/form/NumberTextBox".split(" "),function(V,
W,t,Q,X,R,H,y,e,g,l,m,n,h,x,I,K,w,L,T,U,N,S,F,a,D,da,ha,ia,na,P,la,ja,J,z,B,ca,ra,oa,ta,za,b,f,G){return V([t,W],{baseClass:"jimu-widget-nearme",_highlightGraphicsLayer:null,_loading:null,_windowResizeTimer:null,_sliderChangeTimer:null,_mapTooltip:null,_searchContainerNodeElement:null,_locatorInstance:null,_searchedLocation:null,_slider:null,_bufferParams:null,_mapClickHandler:null,_mapMoveHandler:null,_itemListObject:null,_isValidConfig:null,appUtils:null,_hasMulitpleSourcesInSearch:!0,_searchInstance:null,
_attributeSearchLayers:[],_doAttributeSearchOn:[],selectedThemeColor:"#000",_geocoderSpatialRef:null,_lastFocusNodes:{mainScreen:null,layerList:null,featureList:null,featureInfo:null,filterList:null},postCreate:function(){this.config.hasOwnProperty("showImageGallery")||(this.config.showImageGallery=!0);this.config.hasOwnProperty("showFeaturesCount")||(this.config.showFeaturesCount=!0);this.config.hasOwnProperty("bufferInputOption")||(this.config.bufferInputOption="slider");this.editorXssFilter=oa.getInstance();
this._bufferParams=null;this.selectedThemeColor="#000";this.openAtStartAysn=!0;this._getSelectedThemeColor();this.config.hasOwnProperty("enableDirection")||(this.config.enableDirection=this.map.webMapResponse.itemInfo.itemData&&this.map.webMapResponse.itemInfo.itemData.applicationProperties&&this.map.webMapResponse.itemInfo.itemData.applicationProperties.viewing&&this.map.webMapResponse.itemInfo.itemData.applicationProperties.viewing.routing&&this.map.webMapResponse.itemInfo.itemData.applicationProperties.viewing.routing.enabled?
!0:!1);this.config.routeService&&(this.config.routeService=this._replaceRouteTaskUrlWithAppProxy(this.config.routeService));this._attributeSearchLayers=[];this._doAttributeSearchOn=[];(!this.config.filterSettings||!this.config.filterSettings.filters||0>=this.config.filterSettings.filters.length)&&R.add(this.applyFilterNode,"esriCTHidden")},_setTheme:function(){var r;if("LaunchpadTheme"===this.appConfig.theme.name)b.loadStyleLink(this.baseClass+"launchpadOverrideCSS",this.folderUrl+"/css/launchpadTheme.css",
null);else if(r=document.getElementById(this.baseClass+"launchpadOverrideCSS"))r.disabled=!0},startup:function(){R.add(this.domNode.parentElement,"esriCTNearMeContentPanel");this.appConfig.portalUrl&&""!==e.trim(this.appConfig.portalUrl)?x.getPortalSelfInfo(this.appConfig.portalUrl).then(e.hitch(this,function(r){this.config.helperServices=r&&r.helperServices;this.config.helperServices&&this.config.helperServices.geometry?(this._isValidConfig=this._validateConfig())?(this._setTheme(),this.appUtils=
new l({map:this.map}),this._updateConfig(),R.remove(this.widgetMainNode,"esriCTHidden"),R.add(this.widgetErrorNode,"esriCTHidden"),this._initWidgetComponents(),this.config.showLocationTool?R.remove(this.selectLocation,"esriCTHidden"):this._mapClickHandler||this._connectMapEventHandler(),this._onWindowResize()):(R.add(this.widgetMainNode,"esriCTHidden"),R.remove(this.widgetErrorNode,"esriCTHidden")):this._displayWidgetError(this.nls.geometryServicesNotFound)}),e.hitch(this,function(){this._displayWidgetError(this.nls.geometryServicesNotFound)})):
this._displayWidgetError(this.nls.geometryServicesNotFound)},_replaceRouteTaskUrlWithAppProxy:function(r){var d=r;!window.isBuilder&&!this.appConfig.mode&&this.appConfig.appProxies&&0<this.appConfig.appProxies.length&&g.some(this.appConfig.appProxies,function(v){if(r===v.sourceUrl)return d=v.proxyUrl,!0});return d},_displayWidgetError:function(r){this.widgetErrorNode&&U.set(this.widgetErrorNode,"innerHTML",r);this._showMessage(r)},onOpen:function(){if(this._isValidConfig){for(var r=0;r<this.config.searchLayers.length;r++){var d=
this.config.searchLayers[r].id,v=null;0<d.indexOf("_")&&(v=d.substring(0,d.lastIndexOf("_")));this.map._layers[d]?this.config.searchLayers[r].visibility=this.map._layers[d].visible:v&&this.map._layers[v].visibleLayers&&(d=this.config.searchLayers[r].url.split("/"),d=d[d.length-1],visibleLayerIndex=g.indexOf(this.map._layers[v].visibleLayers,parseInt(d,10)),this.config.searchLayers[r].visibility=-1===visibleLayerIndex?!1:!0)}this._onWindowResize();this.config.showLocationTool||this._connectMapEventHandler();
this._slider&&this._slider.set("value",this.config.defaultBufferDistance);b.isAutoFocusFirstNodeWidget(this)&&b.focusFirstFocusNode(this.domNode)}},resize:function(){this._onWindowResize()},destroy:function(){this._destroyWidgetData();this.inherited(arguments)},onClose:function(){this._isValidConfig&&(this._disconnectMapEventHandler(),this._searchInstance&&this._searchInstance.clearSearchText(),this._searchedLocation&&this._itemListObject&&(this._itemListObject.resetAllFilters(),this._clearResults()),
this._itemListObject&&this._itemListObject.showAllLayers(!0))},onDeActive:function(){this._isValidConfig&&this.config.showLocationTool&&this._disconnectMapEventHandler()},_destroyWidgetData:function(){this._itemListObject&&(this._itemListObject.removeGraphicsLayer(),this._itemListObject.showAllLayers(!0),this._itemListObject.resetAllFilters(),this._itemListObject.destroy(),this._itemListObject=null);this._clearResults()},_validateConfig:function(){if(!this.config.searchLayers||!this.config.searchLayers.length)return this._displayWidgetError(this.nls.invalidSearchLayerMsg),
!1;this.config.symbols.polygonSymbol||(this.config.symbols.polygonSymbol={color:[255,189,1,0],outline:{color:[255,189,1,255],width:2.25,type:"esriSLS",style:"esriSLSSolid"},type:"esriSFS",style:"esriSFSSolid"});this.config.symbols.polylineSymbol||(this.config.symbols.polylineSymbol={color:[21,99,184,255],width:3.75,type:"esriSLS",style:"esriSLSSolid"});return!0},_updateConfig:function(){var r;for(r=0;r<this.config.searchLayers.length;r++)e.mixin(this.config.searchLayers[r],this.appUtils.getLayerDetailsFromMap(this.config.searchLayers[r].baseURL,
this.config.searchLayers[r].layerId,this.config.searchLayers[r].id))},_showMessage:function(r){(new ia({message:r})).message=r},_initWidgetComponents:function(){this.config.editorDescription&&(this.searchHeaderTextNode.innerHTML=this.editorXssFilter.sanitize(this.config.editorDescription),U.set(this.searchHeaderTextNode,"aria-label",b.stripHTML(this.config.editorDescription)));this._bufferGraphicLayer=new I;this.map.addLayer(this._bufferGraphicLayer);this._highlightGraphicsLayer=new I;this.map.addLayer(this._highlightGraphicsLayer);
this._createSearchInstance();this._createCurrentLocationInstance();this._createSlider();this._initLoading();this._initLayerList();this._displayBufferInputOptions();this._setBufferSliderVisiblity();this.config.showLocationTool&&this._connectSelectLocationHandler();this._mapTooltip=X.create("div",{"class":"esriCTMapTooltip",innerHTML:this.nls.selectLocationToolTip},this.map.container);F.set(this._mapTooltip,"position","fixed");F.set(this._mapTooltip,"display","none");this.own(Q(window,"resize",e.hitch(this,
this._onWindowResize)));this._createFilterList()},_hideFilterListBeforeInitWorkflow:function(){R.contains(this.applyFilterNode,"esriCTHidden")||R.contains(this.filterListOuterDiv,"esriCTHidden")||(R.toggle(this.applyFilterArrowNode,"esriCTApplyFilterArrowUp"),R.remove(this.layerListOuterDiv,"esriCTHidden"),R.add(this.filterListOuterDiv,"esriCTHidden"))},_showHideFilterList:function(){R.toggle(this.applyFilterArrowNode,"esriCTApplyFilterArrowUp");R.contains(this.applyFilterArrowNode,"esriCTApplyFilterArrowUp")?
(R.add(this.layerListOuterDiv,"esriCTHidden"),R.remove(this.filterListOuterDiv,"esriCTHidden"),b.initLastFocusNode(this.domNode,this._filterList.getLastNode()),this._filterList.filterListShown()):(R.remove(this.layerListOuterDiv,"esriCTHidden"),R.add(this.filterListOuterDiv,"esriCTHidden"),this._searchedLocation?this._itemListObject.emit("setLastNode",this._itemListObject._currentPanelName):this._getMainScreenLastNode(),this._searchedLocation&&this._filterList.filtersUpdated&&this._prevFeature&&this._initWorkflow(this._prevFeature,
this._prevAttributeSearchResult))},_createFilterList:function(){this.config.filterSettings&&this.config.filterSettings.filters&&0<this.config.filterSettings.filters.length&&(this._filterList=new h({map:this.map,config:this.config.filterSettings,nls:this.nls,folderUrl:this.folderUrl,clearAllButton:this.clearAllFilterButton},X.create("div",{},this.filterListNode)),this.own(Q(this._filterList,"setLastFilterNode",e.hitch(this,function(r){b.initLastFocusNode(this.domNode,r)}))),this.own(Q(this._filterList,
"clearAllFilters",e.hitch(this,function(r){this._searchedLocation&&this._filterList.filtersUpdated&&this._prevFeature&&this._initWorkflow(this._prevFeature,this._prevAttributeSearchResult)}))),this._filterList.startup(),this.own(Q(this.applyFilterArrowNodeParent,"click",e.hitch(this,function(r){this._showHideFilterList()}))),this.own(Q(this.applyFilterArrowNodeParent,"keydown",e.hitch(this,function(r){r.keyCode!==y.ENTER&&r.keyCode!==y.SPACE||this._showHideFilterList()}))),this.config.filterSettings.expandFiltersOnLoad&&
this._showHideFilterList())},_setLayersForAttributeSearch:function(r){var d=[];this._attributeSearchLayers=[];r&&0<r.length&&(g.forEach(this.config.searchLayers,e.hitch(this,function(v){d.push(v.id)})),g.forEach(r,e.hitch(this,function(v){v._featureLayerId&&-1<d.indexOf(v._featureLayerId)&&this._attributeSearchLayers.push(v)})))},_performAttributeSearch:function(r){var d=[],v=[];var O=new la;g.forEach(r,e.hitch(this,function(E){var aa=this._searchInstance.getSearchText();aa=this._searchInstance.search._whereClause(aa,
E.featureLayer,E.searchFields,E.exactMatch);E.featureLayer.getDefinitionExpression()&&(aa=E.featureLayer.getDefinitionExpression()+" and "+aa);d.push(this._queryForIds(E.featureLayer,aa));v.push(E._featureLayerId)}));ja(d).then(e.hitch(this,function(E){for(var aa,ma=0;ma<E.length;ma++){var va=[];0<E[ma].length&&(aa||(aa={}),aa.hasOwnProperty(v[ma])&&(va=aa[v[ma]]),va=this._addOIDsInList(va,E[ma]),aa[v[ma]]=va)}O.resolve(aa)}));return O.promise},_addOIDsInList:function(r,d){for(var v=0;v<d.length;v++)0>
r.indexOf(d[v])&&r.push(d[v]);return r},_queryForIds:function(r,d){var v=new la;var O=new z(r.url);var E=new J;E.returnGeometry=!1;E.where=d?d:"1\x3d1";O.executeForIds(E).then(e.hitch(this,function(aa){aa&&0<aa.length?(aa.length>r.maxRecordCount&&(aa=aa.slice(0,r.maxRecordCount)),v.resolve(aa)):v.resolve([])}),e.hitch(this,function(){v.resolve([])}));return v.promise},_createSearchInstance:function(){this.config.response=this.map.webMapResponse;this._searchInstance=new m({searchOptions:{addLayersFromMap:!1,
autoNavigate:!1,autoComplete:!0,minCharacters:0,maxLocations:5,searchDelay:100,enableHighlight:!1},config:this.config,appConfig:this.appConfig,nls:this.nls,map:this.map},X.create("div",{},this.search));this.own(this._searchInstance.on("init-attribute-search",e.hitch(this,function(){var r,d=[];this._doAttributeSearchOn=[];0<this._attributeSearchLayers.length&&((r=this._searchInstance.getActiveSource())?r._featureLayerId&&(d=g.filter(this._attributeSearchLayers,e.hitch(this,function(v){return v._featureLayerId===
r._featureLayerId})),0<d.length&&this._doAttributeSearchOn.push(r)):this._doAttributeSearchOn=this._attributeSearchLayers)})));this.own(this._searchInstance.on("select-result",e.hitch(this,function(r){r.isFeatureFromMapClick=!1;if(0<this._doAttributeSearchOn.length)this._performAttributeSearch(this._doAttributeSearchOn).then(e.hitch(this,function(E){var aa=!0;if(E)for(var ma in E)0<E[ma].length?aa=!1:delete E[ma];aa?this._initWorkflow(r):this._initWorkflow(null,E)}));else{var d=!0;if(r&&r.source&&
r.source._featureLayerId&&r.source.featureLayer){var v=g.filter(this._attributeSearchLayers,e.hitch(this,function(E){return E._featureLayerId===r.source._featureLayerId}));if(0<v.length&&r.source.featureLayer.objectIdField&&r.result.feature.attributes){d=!1;v=r.source.featureLayer.objectIdField;var O={};O[r.source._featureLayerId]=[r.result.feature.attributes[v]]}}d?this._initWorkflow(r):this._initWorkflow(null,O)}})));this.own(this._searchInstance.on("clear-search",e.hitch(this,function(){this._itemListObject&&
(this._itemListObject.showAllLayers(!0),this._itemListObject.resetAllFilters());this._clearResults();this._getMainScreenLastNode()})));this.own(this._searchInstance.on("search-results",e.hitch(this,function(){this._clearResults(!0)})));this.own(this._searchInstance.on("search-loaded",e.hitch(this,function(){setTimeout(e.hitch(this,function(){this._getMainScreenLastNode();this._initReverseGeocoder();this._searchContainerNodeElement=H(".arcgisSearch .searchGroup .searchInput",this.domNode)[0];2>this._searchInstance.search.sources.length&&
(this._hasMulitpleSourcesInSearch=!1);this._setLayersForAttributeSearch(this._searchInstance.search.sources);this._onWindowResize()}),1E3)})));this._searchInstance.startup()},_getMainScreenLastNode:function(){var r=this._searchInstance.search.submitNode;this.config.showCurrentLocationTool&&(r=this.currentLocationNode);this.config.showLocationTool&&(r=this.selectLocation);if(!R.contains(this.bufferOptionParentNode,"esriCTHidden")){this._bufferTextbox&&!R.contains(this.bufferTextboxParentNode,"esriCTHidden")&&
(r=this._bufferTextbox.domNode);var d=H(".esriCTSliderDiv",this.widgetMainNode);d&&!R.contains(d[0],"esriCTHidden")&&(r=this._slider.sliderHandle)}R.contains(this.applyFilterNode,"esriCTHidden")||(this.applyFilterArrowNodeParent&&(r=this.applyFilterArrowNodeParent),this.clearAllFilterButton&&(r=this.clearAllFilterButton),R.contains(this.filterListOuterDiv,"esriCTHidden")||(r=this._filterList.getLastNode()));this._itemListObject&&this._itemListObject.filterButton&&"block"===F.get(this._itemListObject.filterButton.parentElement,
"display")&&(r=this._itemListObject.filterButton,this._lastFocusNodes.layerList=r,this._lastFocusNodes.featureList=r);this._lastFocusNodes.mainScreen=r;b.initLastFocusNode(this.domNode,r)},_createCurrentLocationInstance:function(){this.isNeedHttpsButNot=b.isNeedHttpsButNot();b.isNeedHttpsButNot()&&(this.config.showCurrentLocationTool=!1);this.config.showCurrentLocationTool&&(R.remove(this.currentLocationNode,"esriCTHidden"),this._geoLocateInstance=new za({highlightLocation:!1,map:this.map},X.create("div",
{},this.currentLocationNode)),this.own(Q(this._geoLocateInstance,"locate",e.hitch(this,function(r){r&&r.graphic&&r.graphic.geometry?this._initWorkflow({feature:new K(r.graphic.geometry),isFeatureFromMapClick:!0}):r.error&&r.error.message&&this._showMessage(r.error.message)}))),this._geoLocateInstance._locateNode&&U.set(this._geoLocateInstance._locateNode,"aria-label",this.nls.selectLocationToolTip))},_initReverseGeocoder:function(){var r;this.config.searchSourceSettings&&this.config.searchSourceSettings.sources&&
(g.some(this.config.searchSourceSettings.sources,e.hitch(this,function(d){if(d&&d.url&&"locator"===d.type)return r=d.url,!0})),r&&(this._loading.show(),B({url:r,content:{f:"json"},handleAs:"json",callbackPrams:"callback"}).then(e.hitch(this,function(d){this._loading.hide();this._geocoderSpatialRef=new ta(d.spatialReference);this._locatorInstance=new D(r);this.own(this._locatorInstance.on("location-to-address-complete",e.hitch(this,this._onLocationToAddressComplete)))}))))},_onLocationToAddressComplete:function(r){var d;
if(r.address&&r.address.address){if(r.address.address.Match_addr)var v=r.address.address.Match_addr;else{v="";for(var O in r.address.address)"Loc_name"!==O&&r.address.address[O]&&(v+=r.address.address[O]+" ");v=e.trim(v)}this._searchInstance&&this._searchInstance.setSearchText(v);r=new ha;r.setContent("${Match_addr}");r.setTitle(this.nls.searchLocationTitle);v={Match_addr:v};var E=new K(this._searchedLocation.geometry,null,v,r);this.map.infoWindow.clearFeatures();this.map.infoWindow.setFeatures([E]);
setTimeout(e.hitch(this,function(){d=this.map.toScreen(E.geometry);this.map.infoWindow.show(d,this.map.getInfoWindowAnchor(d));this.map.infoWindow.isShowing=!0}),500)}},_connectSelectLocationHandler:function(){Q(this.selectLocation,"click",e.hitch(this,function(){this._selectLocationButtonClicked()}));Q(this.selectLocation,"keydown",e.hitch(this,function(r){r.keyCode!==y.ENTER&&r.keyCode!==y.SPACE||this._selectLocationButtonClicked()}))},_selectLocationButtonClicked:function(){R.contains(this.selectLocation,
"esriCTSelectLocationActive")?this._disconnectMapEventHandler():(R.replace(this.selectLocation,"esriCTSelectLocationActive","esriCTSelectLocation"),this._connectMapEventHandler())},_initWorkflow:function(r,d){this._hideFilterListBeforeInitWorkflow();this._clearResults(!d);this._doAttributeSearchOn=[];var v=this._getSelectedFeatureFromResult(r);this._prevAttributeSearchResult=e.clone(d);this._prevFeature={feature:v,isFeatureFromMapClick:v?r.isFeatureFromMapClick:!1};this._searchedLocation=v;r&&r.source&&
r.source.zoomScale&&(this._prevFeature.zoomScale=r.source.zoomScale);r&&this._locatorInstance&&r.isFeatureFromMapClick&&this._searchedLocation&&this._searchedLocation.geometry&&this.showReverseGeocodedAddress();v&&v.geometry?this._itemListObject.hasValidLayers()?(this._highlightSelectedLocation(v),R.contains(this.bufferOptionParentNode,"esriCTHidden")?this.zoomToFeature().then(e.hitch(this,function(){this._itemListObject.displayLayerList(this._searchedLocation,null)})):this._createBuffer(v.geometry)):
this._showMessage(this.nls.allPopupsDisabledMsg):d&&(this._itemListObject.hasValidLayers()?this._itemListObject.displayLayerList(null,null,d):this._showMessage(this.nls.allPopupsDisabledMsg))},_clearResults:function(r){this._highlightGraphicsLayer&&this._highlightGraphicsLayer.clear();this._searchedLocation=null;this._itemListObject&&this._itemListObject.clearResultPanel();this._bufferGraphicLayer&&this._bufferGraphicLayer.clear();r||this.map.infoWindow.hide()},_connectMapEventHandler:function(){this._mapClickHandler||
(this._disableWebMapPopup(),this._mapClickHandler=this.own(this.map.on("click",e.hitch(this,this._onMapClick)))[0],"ontouchstart"in document.documentElement?F.set(this._mapTooltip,"display","none"):(this._mapMoveHandler=this.own(this.map.on("mouse-move",e.hitch(this,this._onMapMouseMove)))[0],this.own(this.map.on("mouse-out",e.hitch(this,function(){F.set(this._mapTooltip,"display","none")})))))},_onMapClick:function(r){this.config.showLocationTool&&this._disconnectMapEventHandler();this.map.infoWindow.hide();
this._searchInstance&&this._searchInstance.clearSearchText();this._initWorkflow({feature:new K(r.mapPoint),isFeatureFromMapClick:!0})},_onMapMouseMove:function(r){if(r.clientX||r.pageY){var d=r.clientX;r=r.clientY}else d=r.clientX+document.body.scrollLeft-document.body.clientLeft,r=r.clientY+document.body.scrollTop-document.body.clientTop;F.set(this._mapTooltip,"display","none");F.set(this._mapTooltip,{left:d+15+"px",top:r+"px"});F.set(this._mapTooltip,"display","")},_disconnectMapEventHandler:function(){this._enableWebMapPopup();
R.replace(this.selectLocation,"esriCTSelectLocation","esriCTSelectLocationActive");this._mapClickHandler&&(this._mapClickHandler.remove(),this._mapClickHandler=null);this._mapMoveHandler&&(this._mapMoveHandler.remove(),this._mapMoveHandler=null,this._mapTooltip.style.display="none")},_enableWebMapPopup:function(){this.map&&this.map.setInfoWindowOnClick(!0)},_disableWebMapPopup:function(){this.map&&this.map.setInfoWindowOnClick(!1)},_createSlider:function(){this._slider=new T({name:"slider",showButtons:!1,
discreteValues:this.config.maxBufferDistance+1,minimum:0,maximum:this.config.maxBufferDistance,value:this.config.defaultBufferDistance,intermediateChanges:!0,"class":"esriCTHorizantalSlider","aria-label":this.nls.bufferDistanceLabel},this.horizantalSliderContainer);this._bufferParams={BufferDistance:this._slider.value.toString(),BufferUnit:this.nls.units[this.config.bufferDistanceUnit.value].displayText};this._bufferTextbox=new G({constraints:{min:0,max:this.config.maxBufferDistance},required:!0,
value:this.config.defaultBufferDistance,"class":"esriCTBufferTextbox","aria-label":N.substitute(this.nls.bufferSliderText,this._bufferParams)},this.bufferTextboxNode);U.set(this.silderText,"innerHTML",N.substitute(this.nls.bufferSliderText,this._bufferParams));U.set(this.silderText,"aria-label",N.substitute(this.nls.bufferSliderText,this._bufferParams));U.set(this.bufferTextboxText,"innerHTML",N.substitute(this.nls.bufferTextboxLabel,this._bufferParams));this.own(Q(this._bufferTextbox,"keydown",e.hitch(this,
function(r){r.keyCode===y.ENTER&&this._bufferTextboxChange()})));this.own(Q(this._bufferTextbox,"blur",e.hitch(this,function(){this._bufferTextboxChange()})));this.own(this._slider.on("change",e.hitch(this,this._sliderChange)));this.sliderMinValue.innerHTML=this._slider.minimum.toString();this.sliderMaxValue.innerHTML=this._slider.maximum.toString()},_bufferTextboxChange:function(){if(this._bufferTextbox.isValid()){var r=this._bufferTextbox.getValue();this._slider.set("value",r)}else this._showMessage(this.nls.invalidBufferDistance)},
_sliderChange:function(r){r=parseFloat(r,10);if(!isNaN(r)){this._bufferParams.BufferDistance=r;var d=N.substitute(this.nls.bufferSliderText,this._bufferParams);U.set(this.silderText,"innerHTML",d);U.set(this.silderText,"aria-label",d);this._bufferTextbox.set("value",r);this._bufferTextbox&&this._bufferTextbox.focusNode&&U.set(this._bufferTextbox.focusNode,"aria-label",d);this._sliderChangeTimer&&clearTimeout(this._sliderChangeTimer);this._searchedLocation&&(this._loading.show(),this._sliderChangeTimer=
setTimeout(e.hitch(this,this._createBuffer),700))}},showReverseGeocodedAddress:function(){this._geocoderSpatialRef&&this._locatorInstance&&this.getProjectedGeometry(this._searchedLocation.geometry,this._geocoderSpatialRef).then(e.hitch(this,function(r){this._locatorInstance.locationToAddress(r,100)}))},getProjectedGeometry:function(r,d){var v=new w(this.config.helperServices.geometry.url);var O=new la;if(da.canProject(r,d)){var E=da.project(r,d);O.resolve(E)}else v.project([r],d,function(aa){E=aa[0];
O.resolve(E)});return O.promise},_createBuffer:function(){var r=new w(this.config.helperServices.geometry.url);if(0<this._bufferParams.BufferDistance){this._loading.show();var d=new L;d.distances=[this._bufferParams.BufferDistance];d.unit=w[this.config.bufferDistanceUnit.bufferUnit];d.bufferSpatialReference=this.map.spatialReference;d.outSpatialReference=this.map.spatialReference;d.geometries=[this._searchedLocation.geometry];if(this.config.isGeodesic||4326===this.map.spatialReference.wkid)this.config.isGeodesic=
!0,d.geodesic=!0;r.buffer(d,e.hitch(this,function(v){this._showBuffer(v);this.map.setExtent(v[0].getExtent().expand(1.5));this._loading.hide();this._itemListObject.displayLayerList(this._searchedLocation,v[0])}),e.hitch(this,function(){this._showMessage(this.nls.unableToCreateBuffer);this._loading.hide()}))}else this._bufferGraphicLayer.clear(),this._prevFeature.isFeatureFromMapClick?(this._itemListObject.displayLayerList(this._searchedLocation,null),this._loading.hide()):this.zoomToFeature().then(e.hitch(this,
function(){this._itemListObject.displayLayerList(this._searchedLocation,null);this._loading.hide()}))},zoomToFeature:function(){var r=new la;var d=this._prevFeature.feature.geometry;if("point"===d.type){if(this._prevFeature.hasOwnProperty("zoomScale"))var v=this._prevFeature.zoomScale;v&&this.map.getScale()>v?v=ca.getExtentForScale(this.map,this._prevFeature.zoomScale).centerAt(d):(v=this.map.extent.centerAt(d))||(v=this.pointToExtent(this.map,d,20))}else v=d.getExtent().expand(1.5);v?this.map.setExtent(v).then(e.hitch(this,
function(){r.resolve()})):r.resolve();return r},pointToExtent:function(r,d,v){var O=r.extent.getWidth()/r.width;v*=O;return new ra(d.x-v,d.y-v,d.x+v,d.y+v,r.spatialReference)},_showBuffer:function(r){if(this.config.bufferInfo&&this.config.bufferInfo.isVisible&&(this._bufferGraphicLayer.clear(),this.config&&this.config.symbols&&this.config.symbols.bufferSymbol)){var d=a.fromJson(this.config.symbols.bufferSymbol);g.forEach(r,e.hitch(this,function(v){v=new K(v,d);this._bufferGraphicLayer.add(v)}))}},
_getSelectedFeatureFromResult:function(r){if(r)if(r.feature)var d=r.feature;else r.result&&r.result.feature&&(d=r.result.feature);return d},_highlightSelectedLocation:function(r){if(r){this._highlightGraphicsLayer.clear();var d="polygon"===r.geometry.type?a.fromJson(this.config.symbols.polygonSymbol):"polyline"===r.geometry.type?a.fromJson(this.config.symbols.polylineSymbol):a.fromJson(this.config.symbols.graphicLocationSymbol);this._highlightGraphicsLayer.add(new K(r.geometry,d))}},_onWindowResize:function(){this._windowResizeTimer&&
clearTimeout(this._windowResizeTimer);this._windowResizeTimer=setTimeout(e.hitch(this,this._resetComponents),500)},_resetComponents:function(){var r,d=[];var v=H(".arcgisSearch .searchGroup",this.domNode)[0];this._searchContainerNodeElement||(this._searchContainerNodeElement=H(".arcgisSearch .searchGroup .searchInput",this.domNode)[0]);d=H(".dijitContentPane",this.domNode);d.push(this.domNode);g.forEach(d,e.hitch(this,function(O){F.set(O,"-webkit-overflow-scrolling","auto")}));this.widgetMainNode&&
this._searchContainerNodeElement&&(r=S.position(this.widgetMainNode))&&r.w&&(r=r.w-144,this._hasMulitpleSourcesInSearch||(r+=32),0<r&&(this.config.showLocationTool&&(r-=45),this.config.showCurrentLocationTool&&(r-=45),this._searchContainerNodeElement.style.setProperty("width",r+"px","important"),v&&v.style.setProperty("max-width","100%","important")));0<d.length&&setTimeout(e.hitch(this,function(){g.forEach(d,e.hitch(this,function(O){F.set(O,"-webkit-overflow-scrolling","touch")}))}),500);this._itemListObject&&
this._itemListObject.resetGallery()},_initLayerList:function(){this._itemListObject=new n({map:this.map,config:this.config,nls:this.nls,loading:this._loading,parentDivId:this.id,folderUrl:this.folderUrl,outerContainer:this.layerListOuterDiv,searchOuterContainer:this.searchOuterContainer,selectedThemeColor:this.selectedThemeColor,domNodeObj:this.domNode,applyFilterNode:this.applyFilterNode,filterListMainDiv:this.filterListMainDiv});this.own(Q(this._itemListObject,"init-proximity",e.hitch(this,function(r){var d=
{isFeatureFromMapClick:!1};d.feature=r;this._initWorkflow(d)})));this.own(Q(this._itemListObject,"setLastNode",e.hitch(this,function(r){"layerListPanel"===r?(this._itemListObject.filterButton&&"block"===F.get(this._itemListObject.filterButton.parentElement,"display")?this._lastFocusNodes.layerList=this._itemListObject.filterButton:this._lastFocusNodes.layerList=H(".esriCTLastLayerFocusNode")[0],this._lastFocusNodes.layerList&&b.initLastFocusNode(this.domNode,this._lastFocusNodes.layerList)):"featureListPanel"===
r&&(this._itemListObject.filterButton&&"block"===F.get(this._itemListObject.filterButton.parentElement,"display")||(this._lastFocusNodes.featureList=H(".esriCTLastFeatureFocusNode")[0]),b.initLastFocusNode(this.domNode,this._lastFocusNodes.featureList))})));this.own(Q(this._itemListObject,"setLastNodeInFeatureInfo",e.hitch(this,function(r){b.initLastFocusNode(this.domNode,r)})));this.own(Q(this._itemListObject,"noFeatureFound",e.hitch(this,function(){this._getMainScreenLastNode();b.focusFirstFocusNode(this.domNode)})));
this.own(Q(this._itemListObject,"setFocusOnFirstFocusableNode",e.hitch(this,function(){1===this._searchInstance.search.sources.length?f.focus(this._searchInstance.search.inputNode):f.focus(this._searchInstance.search.sourcesBtnNode)})));this.id&&P.byId(this.id)&&P.byId(this.id).resize&&P.byId(this.id).resize()},_initLoading:function(){this._loading=new na({hidden:!0});this._loading.placeAt(this.domNode);this._loading.startup()},_displayBufferInputOptions:function(){"slider"===this.config.bufferInputOption?
(R.add(this.bufferTextboxParentNode,"esriCTHidden"),R.add(this.applyFilterNode,"esriCTApplyFilterDivSpacing")):"textbox"===this.config.bufferInputOption?R.add(this.sliderParentNode,"esriCTHidden"):"sliderAndTextbox"===this.config.bufferInputOption&&(R.add(this.silderText,"esriCTHidden"),R.add(this.sliderParentNode,"esriCTOverrideSliderDiv"));R.remove(this.bufferOptionParentNode,"esriCTHidden")},_setBufferSliderVisiblity:function(){var r=!0,d;this.config.searchLayers&&0<this.config.searchLayers.length&&
(g.some(this.config.searchLayers,e.hitch(this,function(v){if("esriGeometryPolygon"!==v.geometryType)return r=!1})),this.config.intersectSearchedLocation&&r?(R.add(this.bufferOptionParentNode,"esriCTHidden"),(d=H(".esriCTItemListMainContainer",this.domNode))&&("slider"===this.config.bufferInputOption||"textbox"===this.config.bufferInputOption?R.add(d[0],"esriCTItemListOverrideMainContainer"):R.add(d[0],"esriCTItemListOverrideMainContainerForBothBufferOptions"))):(R.remove(this.bufferOptionParentNode,
"esriCTHidden"),"textbox"===this.config.bufferInputOption?b.initLastFocusNode(this.domNode,this._bufferTextbox.domNode):b.initLastFocusNode(this.domNode,this.horizantalSliderContainer)),this._itemListObject&&this._itemListObject.updateListHeight())},_getSelectedThemeColor:function(r,d){var v=this.appConfig.theme.name;d&&(v=r);var O=this.appConfig&&this.appConfig.theme&&this.appConfig.theme.styles?this.appConfig.theme.styles[0]:"default";d&&(O=d);this.appConfig&&this.appConfig.theme&&this.appConfig.theme.customStyles&&
this.appConfig.theme.customStyles.mainBackgroundColor&&!d?this.selectedThemeColor=this.appConfig.theme.customStyles.mainBackgroundColor:B({url:"./themes/"+v+"/manifest.json",content:{f:"json"},handleAs:"json",callbackParamName:"callback"}).then(e.hitch(this,function(E){var aa;if(E&&E.styles&&0<E.styles.length)for(aa=0;aa<E.styles.length;aa++){var ma=E.styles[aa];if(ma.name===O){this.selectedThemeColor=ma.styleColor;break}}this.selectedThemeColor||(this.selectedThemeColor="#000000");d&&(this._itemListObject.selectedThemeColor=
this.selectedThemeColor,this._itemListObject.resetIconColors())}),e.hitch(this,function(){this.selectedThemeColor="#000000"}))},onAppConfigChanged:function(r,d,v){"styleChange"===d&&(r&&r.theme&&r.theme.customStyles&&r.theme.customStyles.mainBackgroundColor?(this._itemListObject.selectedThemeColor=r.theme.customStyles.mainBackgroundColor,this._itemListObject.resetIconColors()):(r=r.theme.name,this._getSelectedThemeColor(r,v)))}})});