// 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:{"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: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'}});
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,X,k,l,r,z,g,I,n,h,m,x,G,Y,O,Z,aa,ba,K,ca,P,H,da,L,ea,E,M,Q,fa,ha,R,C,S,ia,ja,ka,la,J,T,ma,N,p,na,oa,pa,qa,y,A,ra,sa,ta,ua,U){return W([X,Y],{_itemListTemplate:ba,_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=k.create("div",{"class":"esriCTItemListMainContainer"},this.outerContainer);this.updateListHeight();this.filterManager=ma.getInstance();this._getUpdatedLayerFilters();this._createPanels();this._loadFeatureLayers();this._featureGraphicsLayer=new fa;this.map.addLayer(this._featureGraphicsLayer);this.editorXssFilter=na.getInstance()},updateListHeight:function(){var a=h.get(this.searchOuterContainer,
"height");a+=23;h.set(this.filterListMainDiv,"height","calc(100% - "+a+"px)");h.set(this.domNode,"height","calc(100% - "+a+"px)")},_createPanels:function(){this._panels.layerListPanel=k.create("div",{"class":"esriCTLayerList"},this.domNode);this._panels.featureListPanel=k.create("div",{"class":"esriCTFeatureList"},this.domNode);var a=k.toDom(this._itemListTemplate).childNodes[0];n.set(a,"tabindex",0);m.add(a,"esriCTPanelHeader");this._panels.featureListPanel.appendChild(a);this._featureListContent=
k.create("div",{"class":"esriCTFeatureListContent"},null);h.set(this._featureListContent,"color",this.config.fontColor);this._panels.featureListPanel.appendChild(this._featureListContent);this._attachEventOnBackButton(this._panels.featureListPanel);this._panels.infoPanel=k.create("div",{"class":"esriCTDirectionInfoPanel"},this.domNode);a=k.toDom(this._itemListTemplate).childNodes[0];n.set(a,"tabindex",0);m.add(a,"esriCTPanelHeader");this._panels.infoPanel.appendChild(a);this._attachEventOnBackButton(this._panels.infoPanel);
this._featureInfoPanel=new I({},null);this._featureInfoPanel.startup();this.config.enableDirection?(this._directionInfoPanel=new I({},null),this._directionInfoPanel.startup(),this._tabContainer=new aa({tabs:[{title:this.nls.informationTabTitle,content:this._featureInfoPanel},{title:this.nls.directionTabTitle,content:this._directionInfoPanel}]},k.create("div",{"class":"esriCTTabContainer"},this._panels.infoPanel)),this._tabContainer.startup(),n.set(this._featureInfoPanel.domNode,"tabindex",0),n.set(this._featureInfoPanel.domNode,
"role","region"),a={"class":"esriCTProximityParent"},void 0===this.config.enableProximitySearch||this.config.enableProximitySearch||(a.style="display: none"),a=k.create("div",a,this._panels.infoPanel),this.own(this._tabContainer.on("tabChanged",g.hitch(this,function(b){this.emit("tab-change",b);b===this.nls.directionTabTitle?this._routeCalculated?"block"===h.get(this.proximityButton.parentElement,"display")?z.initLastFocusNode(this.domNodeObj,this.proximityButton):this.emit("setLastNodeInFeatureInfo",
z.getFocusNodesInDom(this._directionsWidget.domNode).reverse()[0]):this._initializeDirectionWidget():this._getFeatureInfoLastNode();this.parentDivId&&p.byId(this.parentDivId)&&p.byId(this.parentDivId).resize&&p.byId(this.parentDivId).resize()})))):(this._panels.infoPanel.appendChild(this._featureInfoPanel.domNode),m.add(this._featureInfoPanel.domNode,"esriCTFeatureInfo"),n.set(this._featureInfoPanel.domNode,"tabindex",0),n.set(this._featureInfoPanel.domNode,"role","region"),(a=l(".esriCTItemListMainContainer .esriCTDirectionInfoPanel .esriCTPanelHeader"))&&
m.add(a[0],"esriCTBorderBottom"),a={"class":"esriCTProximityParent",style:"bottom: 0px"},void 0===this.config.enableProximitySearch||this.config.enableProximitySearch||(a.style="display: none"),a=k.create("div",a,this._panels.infoPanel));this.proximityButton=k.create("div",{"class":"esriCTProximityIconContainer",title:this.nls.proximityButtonTooltip,"aria-label":this.nls.proximityButtonTooltip,tabindex:"0",role:"button"},a);this._proximityIcon=k.create("div",{"class":"esriCTProximityIcon",style:{"background-color":this.selectedThemeColor}},
this.proximityButton);this.own(x(this.proximityButton,"click",g.hitch(this,function(){this._selectedFeature&&this._selectedFeature.geometry&&this.emit("init-proximity",new H(this._selectedFeature.geometry))})));this.own(x(this.proximityButton,"keydown",g.hitch(this,function(b){(b.keyCode===y.ENTER||b.keyCode===y.SPACE)&&this._selectedFeature&&this._selectedFeature.geometry&&this.emit("init-proximity",new H(this._selectedFeature.geometry))})));this.parentDivId&&p.byId(this.parentDivId)&&p.byId(this.parentDivId).resize&&
p.byId(this.parentDivId).resize();this._attachEventToTab()},_attachEventOnBackButton:function(a){var b=l(".esriCTItemlList",a)[0];var c=l(".esriCTBackButton",a)[0];b&&c&&this.own(x(b,"click, keypress",g.hitch(this,function(d){if("keypress"===d.type){var e=d.charCode||d.keyCode;if(e!==y.ENTER&&e!==y.SPACE)return}d.stopPropagation();"none"!==h.get(c,"display")&&this._isSlide&&(this._isSlide=!1,this._selectedItem=null,this._clearGrahics(),this._clearDirections(),this._clearMediaRefreshTimers(),this._isFeatureList?
(this._isFeatureList=!1,this._showPanel("featureListPanel",!0),A.focus(l(".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),A.focus(l(".esriCTItemlList[tabindex\x3d'0']",this._panels.layerListPanel)[0])))})))},_loadFeatureLayers:function(){var a;this._operationalLayers=[];this._tables=this.map.webMapResponse.itemInfo.itemData.tables;
for(a=0;a<this.config.searchLayers.length;a++)this.config.searchLayers[a].popupInfo||this.config.searchLayers.splice(a,1);for(a=0;a<this.config.searchLayers.length;a++)if(this.config.searchLayers[a].popupInfo){var b=new Q(this.config.searchLayers[a].url,{infoTemplate:new P(this.config.searchLayers[a].popupInfo)});b.id=this.config.searchLayers[a].id?this.config.searchLayers[a].id:"FL_"+this.config.searchLayers[a].title+a;b.title=this.config.searchLayers[a].title;this.config.searchLayers[a].definitionExpression&&
b.setDefinitionExpression(this.config.searchLayers[a].definitionExpression);this.config.searchLayers[a].renderer&&b.setRenderer(oa.fromJson(this.config.searchLayers[a].renderer));b.index=a;b.layerIndex=this._operationalLayers.length;b.isMapServer=this.config.searchLayers[a].isMapServer;b.baseURL=this.config.searchLayers[a].baseURL;b.showAttachments=this.config.searchLayers[a].popupInfo.showAttachments;this._operationalLayers.push(b);this._onLayerLoad(b)}},_onLayerLoad:function(a){a.loaded?a.tableInfos=
this._getRelatedTableInfo(a.index):this.own(a.on("load",g.hitch(this,function(){a.tableInfos=this._getRelatedTableInfo(a.index)})))},_getRelatedTableInfo:function(a){var b,c=[];(b=this._operationalLayers[a])&&r.forEach(b.relationships,g.hitch(this,function(d){r.forEach(this._tables,g.hitch(this,function(e,f){e.url.replace(/.*?:\/\//g,"")===(b.baseURL+d.relatedTableId).replace(/.*?:\/\//g,"")&&e.popupInfo&&(e.relationshipIds||(e.relationshipIds={}),e.relationshipIds[b.id]=d.id,c.push(f),this._tablesLayer[e.id]=
new Q(e.url),this._tablesLayer[e.id].showAttachments=!0)}))}));return c},hasValidLayers:function(){return this._operationalLayers&&0<this._operationalLayers.length?!0:!1},_clearContent:function(a){a&&k.empty(a)},displayLayerList:function(a,b,c){var d=[];this.loading.hide();this._layerCount=0;this._isSlide=this._isNoFeature=!0;this._attributeSearchList=null;c?(this._attributeSearchList=c,this._tabContainer&&this._tabContainer.controlNode&&(h.set(this._tabContainer.controlNode,"display","none"),m.add(this._tabContainer.containerNode,
"esriCTTopBorder"))):this._tabContainer&&this._tabContainer.controlNode&&(h.set(this._tabContainer.controlNode,"display","block"),m.remove(this._tabContainer.containerNode,"esriCTTopBorder"));this.clearResultPanel();this._getUpdatedLayerFilters();this._searchedFeatures={};this.showAllLayers();this._setSearchedLocation(a);this._setServiceArea(b);this._failedLayers=[];this._filterConfiguredLayer(d);O(d).then(g.hitch(this,function(){var e=l(".esriCTItemlList[tabindex\x3d'0']",this._panels.layerListPanel);
e&&0<e.length&&(this._currentPanelName="layerListPanel",m.add(e[e.length-1],"esriCTLastLayerFocusNode"));this._onFeatureCountComplete();this.emit("setLastNode","layerListPanel")}))},_getUpdatedLayerFilters:function(){T.getInstance(this.map,this.map.webMapResponse.itemInfo).then(g.hitch(this,function(a){r.forEach(this.config.searchLayers,g.hitch(this,function(b){var c=a.getLayerInfoById(b.id);c&&(b.definitionExpression=c.getFilter())}))}))},_filterConfiguredLayer:function(a){this._currentPanel=this._panels.layerListPanel;
h.set(this._currentPanel,"display","block");h.set(this._currentPanel,"left","0px");for(var b=0;b<this._operationalLayers.length;b++)this._resetFilter(this._operationalLayers[b].layerIndex),this._createItemTemplate(this._operationalLayers[b],a);1===this._operationalLayers.length&&(h.set(this._panels.layerListPanel,"display","none"),this._onSingleLayerFound(null,this._operationalLayers[0]))},_onSingleLayerFound:function(a,b){if(a){var c=new G;a.push(c)}(a=l(".esriCTBackButton",this._panels.featureListPanel)[0])&&
h.set(a,"display","none");this._currentPanel=this._panels.featureListPanel;h.set(this._currentPanel,"display","block");h.set(this._currentPanel,"left","0px");b&&this._displayFeatureList(b,c)},_onSingleFeatureFound:function(a){this._displayFilteredFeatures(a.attributes[this._selectedLayer.objectIdField]);this._showFeatureDetails(null,a);if(a=l(".esriCTBackButton",this._panels.infoPanel)[0])h.set(a,"display","block"),1===this._layerCount&&h.set(this._panels.featureListPanel,"display","none")},_createItemTemplate:function(a,
b){var c=k.toDom(this._itemListTemplate).childNodes[0];m.add(c,"esriCTDisabled");h.set(c,"color",this.config.fontColor);this._currentPanel.appendChild(c);this._setItemName(c,a.title);this._queryForCountOnly(c,a,b);this._attachClickEvent(c,a,!0)},_setItemName:function(a,b,c){c&&(a=l(c,a)[0]);if(c=l(".esriCTItemName",a)[0])n.set(c,"innerHTML",b),n.set(a,"aria-label",z.stripHTML(b||"")),n.set(a,"title",z.stripHTML(b||""))},_attachClickEvent:function(a,b){this.own(x(a,"click, keypress",g.hitch(this,function(c){if("keypress"===
c.type){var d=c.charCode||c.keyCode;if(d!==y.ENTER&&d!==y.SPACE)return}!m.contains(a,"esriCTDisabled")&&this._isSlide&&(c.stopPropagation(),this._isSlide=!1,this._selectedItem=a,(c=l(".esriCTBackButton",this._panels.featureListPanel)[0])&&h.set(c,"display","block"),this._displayFeatureList(b,null))})))},_displayFeatureList:function(a,b){this._clearContent(this._featureListContent);this._selectedLayer=a;if(this.config.enableDirection){var c=l(".jimu-tab",this._panels.infoPanel);var d=l(".jimu-tab .control",
this._panels.infoPanel);var e=l(".esriCTItemListMainContainer .esriCTDirectionInfoPanel .esriCTPanelHeader");d&&d[0]&&c&&c[0]&&e&&e[0]&&("esriGeometryPolygon"===a.geometryType&&this.config.intersectSearchedLocation?(m.add(c[0],"esriCTOverrideHeight"),m.add(d[0],"esriCTHidden"),m.add(e[0],"esriCTBorderBottom")):(m.remove(c[0],"esriCTOverrideHeight"),m.remove(d[0],"esriCTHidden"),m.remove(e[0],"esriCTBorderBottom")))}this._setItemName(this._panels.featureListPanel,this._selectedLayer.title,".esriCTPanelHeader");
this._queryForFeatureList(b)},_getQueryParams:function(a){var b=new ia;b.spatialRelationship="esriSpatialRelIntersects";b.outSpatialReference=this.map.spatialReference;b.outFields=["*"];if(this._attributeSearchList)this._attributeSearchList[a.id]&&0<this._attributeSearchList[a.id].length?b.objectIds=this._attributeSearchList[a.id]:b.where="1\x3d2";else if(this._serviceArea||this._selectedPoint)b.geometry=this._serviceArea||this._selectedPoint.geometry;return b},_queryForCountOnly:function(a,b,c){var d=
this._getQueryParams(b);this.config.intersectSearchedLocation&&"esriGeometryPolygon"===b.geometryType&&this._selectedPoint&&(d.geometry=this._selectedPoint.geometry);var e=new G;d.where&&"1\x3d2"===d.where?(h.set(a,"display","none"),n.set(a,"tabindex","-1"),A.focus(l(".esriCTItemlList[tabindex\x3d'0']",a.parentElement)[0]),this.config.selectedSearchLayerOnly&&this._showHideOperationalLayer(b.url,b.id,!1),e.resolve()):b.queryFeatures(d,g.hitch(this,function(f){0<f.features.length?(this._selectedLayer=
b,this._layerCount++,this._searchedFeatures[b.id]=f.features,this._setItemCount(a,f.features.length,!0),this._showFilteredFeaturesOnLoad(f.features,b.id)):(h.set(a,"display","none"),n.set(a,"tabindex","-1"),A.focus(l(".esriCTItemlList[tabindex\x3d'0']",a.parentElement)[0]),this.config.selectedSearchLayerOnly&&this._showHideOperationalLayer(b.url,b.id,!1));e.resolve()}),g.hitch(this,function(){a&&(h.set(a,"display","none"),n.set(a,"tabindex","-1"),A.focus(l(".esriCTItemlList[tabindex\x3d'0']",a.parentElement)[0]),
this._showHideOperationalLayer(b.url,b.id,!1));this._failedLayers.push(b.title);e.resolve()}));c.push(e)},_getFeatureLayerDetailsFormArray:function(a){var b;if(this._operationalLayers&&0<this._operationalLayers.length){var c=this._operationalLayers.length;for(b=0;b<c;b++)if(this._operationalLayers[b].id===a)return this._operationalLayers[b]}return null},_showFilteredFeaturesOnLoad:function(a,b){var c,d="",e;b=this._getFeatureLayerDetailsFormArray(b);if(this.config.selectedSearchLayerOnly&&(1<a.length&&
(a=this._getSortedFeatureList(a)),e=this._getMaxResultCountValue(a.length,b.maxRecordCount))){for(c=0;c<e;c++)d&&(d+=","),d+=a[c].attributes[this._selectedLayer.objectIdField];a=this._selectedLayer.objectIdField+" in ("+d+")";this._setFilterOnMapLayer(a,b.id,b.url,b.isMapServer)}},_onFeatureCountComplete:function(){if(this._isNoFeature){this.clearResultPanel();h.set(this._panels.layerListPanel,"display","block");h.set(this._panels.layerListPanel,"left","0px");var a=this.editorXssFilter.sanitize(this.config.noFeatureFoundMessage);
k.create("div",{"class":"esriCTNoFeatureFound","aria-label":a?a:this.nls.noFeatureFoundText,innerHTML:a?a:this.editorXssFilter.sanitize(this.nls.noFeatureFoundText)},this._panels.layerListPanel);this.emit("noFeatureFound")}else 1===this._layerCount&&1!==this._operationalLayers.length&&(h.set(this._panels.layerListPanel,"display","none"),this._onSingleLayerFound(null,this._selectedLayer));this._failedLayers.length&&(a=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(a));this.loading.hide();this.parentDivId&&p.byId(this.parentDivId)&&p.byId(this.parentDivId).resize&&p.byId(this.parentDivId).resize()},_queryForFeatureList:function(a){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(),a&&a.resolve();else{var b=this._getQueryParams(this._selectedLayer);
this.config.intersectSearchedLocation&&this._selectedLayer&&"esriGeometryPolygon"===this._selectedLayer.geometryType&&this._selectedPoint&&(b.geometry=this._selectedPoint.geometry);this._selectedLayer.queryFeatures(b,g.hitch(this,function(c){this._hideAllLayers();0<c.features.length&&(this._showFilteredFeaturesOnLoad(c.features,this._selectedLayer.id),this._creatFeatureList(c.features));this.loading.hide();a&&a.resolve()}),g.hitch(this,function(){this.loading.hide();this._failedLayers.push(this._selectedLayer.title);
a&&a.resolve()}))}},resetAllFilters:function(){for(var a=0;a<this._operationalLayers.length;a++)this._resetFilter(this._operationalLayers[a].layerIndex)},_setItemCount:function(a,b,c){var d=l(".esriCTItemCount",a)[0];l(".esriCTItemName",a);d&&(m.remove(d,"esriCTLoadingIcon"),c?(b=this._getMaxResultCountValue(b,this._selectedLayer.maxRecordCount),this.config.showFeaturesCount&&(n.set(d,"innerHTML","("+J.format(b)+")"),d=n.get(a,"title")+" "+J.format(b),n.set(a,"title",d),n.set(a,"aria-label",d)),b&&
(this._isNoFeature=!1,m.remove(a,"esriCTDisabled"),n.set(a,"tabindex","0"),n.set(a,"role","button"),A.focus(l(".esriCTItemlList[tabindex\x3d'0']",a.parentElement)[0]))):(b=J.format(b.toFixed(2))+" "+this.nls.units[this.config.bufferDistanceUnit.value].acronym,n.set(d,"innerHTML",b),a&&(d=n.get(a,"title")+" "+b,n.set(a,"title",d),n.set(a,"aria-label",d))))},_getMaxResultCountValue:function(a,b){b||(b=1E3);return!this._attributeSearchList&&this.config.maxResultCount&&this.config.maxResultCount<=b?a<
this.config.maxResultCount?a:this.config.maxResultCount:a<b?a:b},_creatFeatureList:function(a){var b="",c;var d=l(".esriCTPanelHeader",this._panels.featureListPanel)[0];this._isNoFeature=!1;0<a.length&&(a=this._getSortedFeatureList(a),d&&this._setItemCount(d,a.length,!0));var e=this._getMaxResultCountValue(a.length,this._selectedLayer.maxRecordCount);if(1===e)this._onSingleFeatureFound(a[0]);else{for(d=0;d<e;d++){b&&(b+=",");b+=a[d].attributes[this._selectedLayer.objectIdField];var f=k.toDom(this._itemListTemplate).childNodes[0];
m.add(f,"esriCTFeatureListItem");d===e-1&&m.add(f,"esriCTLastFeatureFocusNode");n.set(f,"tabindex","0");n.set(f,"role","button");n.set(f,"aria-label",a[d].getTitle());this._featureListContent.appendChild(f);this._setItemName(f,a[d].getTitle()||"");this._attributeSearchList||!a[d].geometry||a[d].geometry&&"polygon"===a[d].geometry.type&&this.config.intersectSearchedLocation?(c=l(".esriCTItemCount",f)[0])&&m.remove(c,"esriCTLoadingIcon"):a[d].hasOwnProperty("distanceToLocation")&&this._setItemCount(f,
a[d].distanceToLocation,!1);this._attachEventOnFeatureDiv(f,a[d])}this.parentDivId&&p.byId(this.parentDivId)&&p.byId(this.parentDivId).resize&&p.byId(this.parentDivId).resize();this._displayFilteredFeatures(b);this._showPanel("featureListPanel");A.focus(l(".esriCTItemlList[tabindex\x3d'0']",this._featureListContent)[0]);this.loading.hide();1===e&&f.click()}},_displayFilteredFeatures:function(a){this.config.selectedSearchLayerOnly&&(this._showHideOperationalLayer(this._selectedLayer.url,this._selectedLayer.id,
!0),this._selectedLayer.setDefinitionExpression(this._selectedLayer.objectIdField+" in ("+a+")"))},_setFilterOnMapLayer:function(a,b,c,d){b&&(d?(b=b.substring(0,b.lastIndexOf("_")),(c=this.map.getLayer(b))&&this.filterManager.applyWidgetFilter(b,this.id,a)):(c=this.map.getLayer(b))&&this.filterManager.applyWidgetFilter(b,this.id,a))},_resetFilter:function(a){var b=this._operationalLayers[a].isMapServer?this._operationalLayers[a].id.substring(0,this._operationalLayers[a].id.lastIndexOf("_")):this._operationalLayers[a].id;
this.filterManager.getWidgetFilter(b,this.id)?(this._setFilterOnMapLayer("",this._operationalLayers[a].id,this._operationalLayers[a].url,this._operationalLayers[a].isMapServer),T.getInstance(this.map,this.map.webMapResponse.itemInfo).then(g.hitch(this,function(c){var d;if(d=c.getLayerInfoById(b)){var e=d.getFilter();!e&&this._operationalLayers[a].isMapServer&&(d=c.getLayerInfoById(this._operationalLayers[a].id))&&(e=d.getFilter());this.config.searchLayers[a].definitionExpression=e;this._operationalLayers[a].setDefinitionExpression(e)}}))):
this._operationalLayers[a]&&this.config.searchLayers[a]&&this._operationalLayers[a].setDefinitionExpression(this.config.searchLayers[a].definitionExpression)},_getSortedFeatureList:function(a){var b;var c=this._canGetGeodesicDistance();for(b=0;b<a.length;b++)a[b].distanceToLocation=this._attributeSearchList?a[b].getTitle().toLowerCase():c&&a[b].geometry?this._getGeodesicDistances(a[b].geometry):this._selectedPoint&&a[b].geometry?M.distance(this._selectedPoint.geometry,a[b].geometry,this.config.bufferDistanceUnit.distanceUnit):
0;a.sort(function(d,e){return d.distanceToLocation<e.distanceToLocation?-1:d.distanceToLocation>e.distanceToLocation?1:0});return a},_canGetGeodesicDistance:function(){var a=new E(4326);return this.config.isGeodesic&&this._selectedPoint&&N.canProject(this._selectedPoint.geometry,a)?!0:!1},_getGeodesicDistances:function(a){if(!this._selectedPoint)return 0;var b="point"===this._selectedPoint.geometry.type?this._selectedPoint.geometry:this._selectedPoint.geometry.getPoint(0,0);if("point"!==a.type)if((a=
M.nearestCoordinate(a,b))&&!a.isEmpty)a=a.coordinate;else return 0;var c=new L([[b.x,b.y],[a.x,a.y]]);c.setSpatialReference(b.spatialReference);b=new E(4326);if(N.canProject(a,b)){c=N.project(c,b);var d=M.geodesicLength(c,this.config.bufferDistanceUnit.distanceUnit);isNaN(d)&&(d=0)}return d},_attachEventOnFeatureDiv:function(a,b){this.own(x(a,"click, keypress",g.hitch(this,function(c){if("keypress"===c.type&&(c=c.charCode||c.keyCode,c!==y.ENTER&&c!==y.SPACE))return;this._isFeatureList=!0;(c=l(".esriCTBackButton",
this._panels.infoPanel)[0])&&h.set(c,"display","block");this._showFeatureDetails(a,b)})))},_showFeatureDetails:function(a,b){this._setItemName(this._panels.infoPanel,this._selectedLayer.title,".esriCTPanelHeader");this._showPanel("infoPanel");var c=l(".esriCTProximityParent",this.domNode);c&&0<c.length&&(c=c[0],b.geometry?m.remove(c,"esriCTHidden"):m.add(c,"esriCTHidden"));this._tabContainer&&(this._tabContainer.selectTab(this.nls.informationTabTitle),!b.geometry||this._attributeSearchList?(h.set(this._tabContainer.controlNode,
"display","none"),m.add(this._tabContainer.containerNode,"esriCTTopBorder")):(h.set(this._tabContainer.controlNode,"display","block"),m.remove(this._tabContainer.containerNode,"esriCTTopBorder")));this._selectedFeatureItem=a;this._selectedFeature=b;this._clearDirections();this._highlightFeatureOnMap();this._displayFeatureInfo(b);this.parentDivId&&p.byId(this.parentDivId)&&p.byId(this.parentDivId).resize&&p.byId(this.parentDivId).resize()},_zoomToSelectedPointFeature:function(a){var b;this.config.searchSourceSettings&&
this.config.searchSourceSettings.sources&&0<this.config.searchSourceSettings.sources.length&&r.some(this.config.searchSourceSettings.sources,g.hitch(this,function(c){if(c&&c.layerId&&this._selectedLayer.id&&c.layerId===this._selectedLayer.id)return b=sa.getExtentForScale(this.map,c.zoomScale).centerAt(a.geometry),!0}));b?this.map.setExtent(b):this.map.centerAndZoom(a.geometry,this.map.getMaxZoom()-1)},_displayFeatureInfo:function(a){var b;this._loadAttachmentTimer&&clearTimeout(this._loadAttachmentTimer);
this._featureInfoPanel&&(this._featureInfoPanel.set("content",""),this._gallerySwiper=[],this._allContentPanes=[],this._attributeSearchList||!a.geometry||a.geometry&&"polygon"===a.geometry.type&&this.config.intersectSearchedLocation||this._addDistanceToLocationInDetailsPanel(a),this._showPopupInfo(a,a._layer),this.config.attributeSymbology&&(b=this._getConfiguredSymbologyForLayer(this._selectedLayer.id))&&0<b.length&&this._checkAttributeSymbology(a,b));if(this.config.zoomToFeature)if(a.geometry&&
"point"===a.geometry.type)if(b=a.geometry,this._selectedPoint){var c=this._getPointFromGeometry(this._selectedPoint.geometry);b={paths:[[[b.x,b.y],[c.x,c.y]]],spatialReference:this.map.spatialReference};b=new L(b);this.map.setExtent(b.getExtent().expand(1.5))}else this._zoomToSelectedPointFeature(a);else a.geometry&&this.map.setExtent(a.geometry.getExtent().expand(1.5));this._getRelatedRecords(a)},_addDistanceToLocationInDetailsPanel:function(a){if(a.hasOwnProperty("distanceToLocation")){a=J.format(a.distanceToLocation.toFixed(2))+
" "+this.nls.units[this.config.bufferDistanceUnit.value].acronym;a=k.create("div",{innerHTML:ra.substitute(this.nls.approximateDistanceTitle,{DistanceToLocation:a}),"class":"esriCTDistanceToLocation"});var b=new I({style:{padding:"0px"}});b.set("content",a);this._featureInfoPanel.addChild(b)}},_getRelatedRecords:function(a){r.forEach(this._selectedLayer.tableInfos,g.hitch(this,function(b){this._queryRelatedRecords(this._tables[b],a.attributes[this._selectedLayer.objectIdField])}))},_queryRelatedRecords:function(a,
b){if(this._selectedLayer&&a){var c=new ja;c.objectIds=[parseInt(b,10)];c.outFields=["*"];c.relationshipId=a.relationshipIds[this._selectedLayer.id];a.layerDefinition&&a.layerDefinition.definitionExpression&&(c.definitionExpression=a.layerDefinition.definitionExpression);this._selectedLayer.queryRelatedFeatures(c,g.hitch(this,function(d){d=d[b];r.forEach(d?d.features:[],g.hitch(this,function(e){e.setInfoTemplate(new P(a.popupInfo));this._showPopupInfo(e,this._tablesLayer[a.id])}));this.parentDivId&&
p.byId(this.parentDivId)&&p.byId(this.parentDivId).resize&&p.byId(this.parentDivId).resize()}))}},_showPopupInfo:function(a,b){if(this._featureInfoPanel&&a){a._layer||(a._layer=b);a._layer._map||(a._layer._map=this.map);var c=new I({"class":"esriCTPopupInfo"});var d=a.getContent();var e=p.byId(d.id);c.set("content",d);this.own(x(e,"content-update",g.hitch(this,function(){this._getFeatureInfoLastNode()})));this._allContentPanes.push(c);this._featureInfoPanel.addChild(c);this._checkAttachments(e,a,
b)}},_checkAttachments:function(a,b,c){m.add(l(".mediaSection",a.domNode)[0],"esriCTHidden");var d=l(".attachmentsSection",a.domNode)[0];k.empty(d);m.remove(d,"hidden");c.hasAttachments&&c.showAttachments?(this.loading.show(),this._loadAttachmentTimer=setTimeout(g.hitch(this,function(){this._showAttachments(b,d,c,a)}),500)):this._createGallery(c,d,[],a)},_showAttachments:function(a,b,c,d){this.config.showImageGallery?(a=a.attributes[c.objectIdField],k.empty(b),c.queryAttachmentInfos(a,g.hitch(this,
function(e){this.loading.hide();this._createGallery(c,b,e,d);this.parentDivId&&p.byId(this.parentDivId)&&p.byId(this.parentDivId).resize&&p.byId(this.parentDivId).resize()}))):(this.loading.hide(),m.add(b,"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(a){a&&(a.update(),a.slideReset())},
this),this._getFeatureInfoLastNode())},_createGallery:function(a,b,c,d){var e;this._clearMediaRefreshTimers();this.config.showImageGallery&&(c=this._checkForHyperlinks(c,this._selectedFeature));var f=c.length,q=[];if(c&&0<c.length||a&&a.infoTemplate&&a.infoTemplate.info&&a.infoTemplate.info.mediaInfos&&0<a.infoTemplate.info.mediaInfos.length){a.infoTemplate&&a.infoTemplate.info&&a.infoTemplate.info.mediaInfos&&(f+=a.infoTemplate.info.mediaInfos.length);this.loading.show();a=k.create("div",{"class":"esriCTThumbnailContainer"},
b);k.create("div",{style:{clear:"both"}},a);var t=k.toDom(ua);var v=l(".swiper-wrapper",t)[0];var u=!1;if(c&&0<c.length)for(a=0;a<c.length;a++)if(0>q.indexOf(c[a].url))if(q.push(c[a].url),-1!==c[a].contentType.indexOf("image")&&c[a].contentType.match(/(\/tiff)/)&&(c[a].contentType="application/tiff"),c[a].contentType&&-1<c[a].contentType.indexOf("image")){var w=k.create("div",{"class":"swiper-slide"},v);var B=k.create("img",{alt:c[a].name,"class":"esriCTAttachmentImg",src:c[a].url},w);this._attachEventOnImage(B,
null);u=!0}else c[a].contentType&&-1<c[a].contentType.toLowerCase().indexOf("video/mp4")?(w=k.create("div",{"class":"swiper-slide"},v),B=k.toDom('\x3cvideo class\x3d"esriCTVideoElement" src\x3d"'+c[a].url+'" height\x3d"auto" width\x3d"100%" controls\x3e\x3csource src\x3d"'+c[a].url+'" type\x3d"'+c[a].contentType+'" poster\x3d"'+c[a].url+'"\x3e\x3c/video\x3e'),k.place(B,w),u=!0):(w=k.create("div",{"class":"esriCTNonImageAttachmentContainer",tabindex:"0","aria-label":c[a].name,role:"button",src:c[a].url},
b),B=this.folderUrl+"images/no-attachment.png",B=k.create("img",{alt:"","class":"esriCTNonImageAttachmentImg esriCTAutoHeight",src:B},w),B=k.create("div",{"class":"esriCTImageFormatDiv"},w),this._fetchDocumentContentType(c[a],B),this._attachEventOnImage(w,null));this._charts=[];this._checkMediaInfos(v,d,q).then(g.hitch(this,function(va){if(u||va)k.place(t,b),e=new ta(t,{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(x(e,"onSlideChangeStart",g.hitch(this,function(){r.forEach(l(".esriCTVideoElement",v),g.hitch(this,function(D){D.pause()}))}))),this.own(x(e,"imagesReady",g.hitch(this,function(){r.forEach(l(".swiper-slide-duplicate",v),g.hitch(this,function(D){var F;(F=l(".esriCTAttachmentImg",D))&&0<F.length&&(F=F[0],D=n.get(F,"refreshInterval"),this._attachEventOnImage(F,D))}))}))),r.forEach(this._charts,g.hitch(this,function(D){D.resize(200,200)})),
1===f&&(e.nextButton&&0<e.nextButton.length&&m.add(e.nextButton[0],"esriCTHidden"),e.prevButton&&0<e.prevButton.length&&m.add(e.prevButton[0],"esriCTHidden"),e.lockSwipes());this.loading.hide();this._gallerySwiper.push(e);this._getFeatureInfoLastNode()}))}else this._gallerySwiper.push(null),this._getFeatureInfoLastNode()},_getFeatureInfoLastNode:function(){var a;if("block"===h.get(this.proximityButton.parentElement,"display"))var b=this.proximityButton;if(!b)for(var c=this._allContentPanes.length-
1;0<=c&&((a=l(".swiper-pagination-bullet",this._allContentPanes[c].domNode))&&0<a.length?b=a.reverse()[0]:(a=z.getFocusNodesInDom(this._allContentPanes[c].domNode))&&0<a.length&&(b=a.reverse()[0]),!b);c--);!b&&this._featureInfoPanel&&this._featureInfoPanel.domNode&&(b=this._featureInfoPanel.domNode);if(!b&&(b=this._getInformationTabAsLastFocusNode()))return;b||(b=l(".esriCTItemListMainContainer .esriCTDirectionInfoPanel .esriCTPanelHeader",this.domNode.parentElement)[0]);this.emit("setLastNodeInFeatureInfo",
b)},_checkForHyperlinks:function(a,b){var c;var d=[];d=b.attributes;for(c in d)d.hasOwnProperty(c)&&d[c]&&String(d[c]).match(/^(http(s?):)/)&&(String(d[c]).match(/\.(png|jpg|jpeg|gif|bmp)(\/|$)/i)?(b={},b.contentType="image/"+String(d[c]).match(/\.(png|jpg|jpeg|gif|bmp)(\/|$)/i)[1],b.url=d[c],a.push(b)):String(d[c]).match(/\.(mp4)(\/?)/i)&&(b={contentType:"video/mp4"},b.url=d[c],a.push(b)));return a},_checkMediaInfos:function(a,b,c){var d,e;var f=new G;var q=[];if(b._mediaInfos&&0<b._mediaInfos.length)var t=
b._mediaInfos;else b&&b.template.info&&b.template.info.mediaInfos&&0<b.template.info.mediaInfos.length&&(t=b.template.info.mediaInfos);t&&b._mediaInfos&&0<b._mediaInfos.length?setTimeout(g.hitch(this,function(){for(var v=0;v<t.length;v++){var u=t[v],w=0;("image"===u.type||"image"!==u.type&&u.value.fields&&0<u.value.fields.length)&&0>c.indexOf(u.value.sourceURL)&&(c.push(u.value.sourceURL),d=k.create("div",{"class":"swiper-slide"},a),"image"===u.type?(u.hasOwnProperty("refreshInterval")&&(w=u.refreshInterval),
e=k.create("img",{alt:u.value.sourceURL,"class":"esriCTAttachmentImg",src:u.value.sourceURL,refreshInterval:w},d),w&&n.set("refreshInterval",w),this._attachEventOnImage(e,w)):q.push(this._loadMediaCharts(b,u,d)))}0<q.length?O(q).then(g.hitch(this,function(){f.resolve(!0)})):f.resolve(!0)}),1E3):f.resolve(!1);return f.promise},_loadMediaCharts:function(a,b,c){var d=new G,e=this,f=["dojox/charting/Chart2D","dojox/charting/action2d/Tooltip"];a=b.value.theme||a.chartTheme;g.isString(a)&&(a=a.replace(/\./gi,
"/"),-1===a.indexOf("/")&&(a="dojox/charting/themes/"+a));a||(a="esri/dijit/Rainbow");f.push(a);try{V(f,function(q,t,v){e._createChart(c,b,q,t,v).then(g.hitch(this,function(){d.resolve()}))})}catch(q){d.resolve()}return d.promise},_createChart:function(a,b,c,d,e){var f=b.type;var q=b.value;b=new G;c=new c(k.create("div",{"class":"chart"},a));e&&c.setTheme(e);switch(f){case "piechart":c.addPlot("default",{type:"Pie",labels:!1});c.addSeries("Series A",q.fields);break;case "linechart":c.addPlot("default",
{type:"Markers"});c.addAxis("x",{min:0,majorTicks:!1,minorTicks:!1,majorLabels:!1,minorLabels:!1});c.addAxis("y",{includeZero:!0,vertical:!0,fixUpper:"minor"});r.forEach(q.fields,function(t,v){t.x=v+1});c.addSeries("Series A",q.fields);break;case "columnchart":c.addPlot("default",{type:"Columns",gap:3});c.addAxis("y",{includeZero:!0,vertical:!0,fixUpper:"minor"});c.addSeries("Series A",q.fields);break;case "barchart":c.addPlot("default",{type:"Bars",gap:3}),c.addAxis("x",{includeZero:!0,fixUpper:"minor",
minorLabels:!1}),c.addAxis("y",{vertical:!0,majorTicks:!1,minorTicks:!1,majorLabels:!1,minorLabels:!1}),c.addSeries("Series A",q.fields)}new d(c);c.render();this._charts.push(c);b.resolve();return b.promise},_fetchDocumentContentType:function(a,b){a=(a=/(?:\.([^.]+))?$/.exec(a.name))&&a[1]?"."+a[1].toUpperCase():this.nls.unknownAttachmentExt;n.set(b,"innerHTML",a)},_attachEventOnImage:function(a,b){this.own(x(a,"click",g.hitch(this,function(){this._displayImageAttachments(a,!1)})));this.own(x(a,"keydown",
g.hitch(this,function(c){this._displayImageAttachments(a,!0,c)})));b&&(b*=6E4,b=setInterval(g.hitch(this,function(){a.setAttribute("src",a.alt+"?"+Math.random())}),b),this._mediaRefreshTimers.push(b))},_clearMediaRefreshTimers:function(){this._mediaRefreshTimers&&r.forEach(this._mediaRefreshTimers,function(a){clearInterval(a)});this._mediaRefreshTimers=[]},_displayImageAttachments:function(a,b,c){b&&c.keyCode!==y.ENTER&&c.keyCode!==y.SPACE||window.open(n.get(a,"src"))},_onImageLoad:function(a){m.remove(a.target.parentNode,
"esriCTImageLoader");this._setImageDimensions(a.target)},_setImageDimensions:function(a){var b=a.parentElement;if(a&&0<a.offsetHeight){n.set(a,"originalHeight",a.offsetHeight);h.set(a,"maxHeight",a.offsetHeight+"px");h.set(a,"maxWidth",a.offsetWidth+"px");var c=parseFloat(n.get(a,"originalHeight"));if(b.offsetHeight<a.offsetHeight||c>b.offsetHeight)c=a.offsetWidth/a.offsetHeight,b=b.offsetHeight-2,c=Math.floor(b*c),m.remove(a,"esriCTAutoHeight"),h.set(a,"width",c+"px"),h.set(a,"height",b+"px")}},
_onError:function(a){m.remove(a.target.parentNode,"esriCTImageLoader")},_setSearchedLocation:function(a){this._selectedPoint=a},_setServiceArea:function(a){this._serviceArea=a},clearResultPanel:function(){this._isFeatureList=!1;this._clearContent(this._panels.layerListPanel);h.set(this._panels.layerListPanel,"display","none");h.set(this._panels.featureListPanel,"display","none");h.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(a,b){h.set(this._panels[a],{display:"block",left:"-100%"});b?(this._slide(this._panels[a],-100,0),this._slide(this._currentPanel,0,100)):(this._slide(this._currentPanel,0,-100),this._slide(this._panels[a],100,0));this._currentPanelName=a;this._currentPanel=
this._panels[a];this.parentDivId&&p.byId(this.parentDivId)&&p.byId(this.parentDivId).resize&&p.byId(this.parentDivId).resize();setTimeout(g.hitch(this,function(){this.emit("setLastNode",a)}),400)},_slide:function(a,b,c){h.set(a,"display","block");h.set(a,"left",b+"%");la.animateProperty({node:a,properties:{left:{start:b,end:c,units:"%"}},duration:300,onEnd:g.hitch(this,function(){h.set(a,"left",c);0===c?h.set(a,"display","block"):h.set(a,"display","none");this._isSlide=!0})}).play()},_showMessage:function(a){(new Z({message:a})).message=
a},_initializeDirectionWidget:function(){if(!this._directionsWidget){p.byId("directionDijit"+this.id)&&p.byId("directionDijit"+this.id).destroy();var a={id:"directionDijit"+this.id,map:this.map,directionsLengthUnits:ka[this.config.directionLengthUnit.routeUnit],showTrafficOption:!1,dragging:!1,routeTaskUrl:this.config.routeService,routeSymbol:new C(this.config.symbols.routeSymbol)};this._directionsWidget=new ca(a,k.create("div",{},null));this._directionsWidget.startup();this.own(this._directionsWidget.on("directions-finish",
g.hitch(this,function(){this._directionsWidget.zoomToFullRoute();this.parentDivId&&p.byId(this.parentDivId)&&p.byId(this.parentDivId).resize&&p.byId(this.parentDivId).resize();this.loading.hide();"block"===h.get(this.proximityButton.parentElement,"display")?z.initLastFocusNode(this.domNodeObj,this.proximityButton):this.emit("setLastNodeInFeatureInfo",z.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(a){switch(a.type){case "extent":var b=a.getCenter();break;case "multipoint":b=a.getPoint(0);break;case "point":b=a;break;case "polygon":b=a.getCentroid();break;case "polyline":b=a.getPoint(0,0)}return b},_routeSelectedLocations:function(){var a=[];this._clearDirections();this._selectedPoint&&this._selectedFeature&&this._selectedFeature.geometry&&
(this.loading.show(),a.push(this._getPointFromGeometry(this._selectedPoint.geometry)),a.push(this._getPointFromGeometry(this._selectedFeature.geometry)),this._directionsWidget.updateStops(a).then(g.hitch(this,function(){this._directionsWidget.getDirections();this._routeCalculated=!0}),g.hitch(this,function(){this.loading.hide();this._showMessage(this.nls.failedToGenerateRouteMsg)})))},_highlightFeatureOnMap:function(){var a;this._clearGrahics();this._selectedFeature&&this._selectedFeature.geometry&&
(a=this._getHighLightSymbol(this._selectedFeature,this._selectedLayer))&&a.geometry&&this._featureGraphicsLayer.add(a)},_getHighLightSymbol:function(a,b){switch(a.geometry.type){case "point":case "multipoint":return this._getPointSymbol(a,b);case "polyline":return this._getPolyLineSymbol(a,b);case "polygon":return this._getPolygonSymbol(a)}},_getHighLightSymbolColor:function(){var a=new K([0,255,255,1]);this.config.highlightColor&&(a=new K(this.config.highlightColor),this.config.hasOwnProperty("showSelectionColor")||
(this.config.showSelectionColor=!0),a.a=this.config.showSelectionColor?1:0);return a},_getPointSymbol:function(a,b){var c,d;var e=!1;var f=this._getHighLightSymbolColor();f=new S(S.STYLE_SQUARE,null,new C(C.STYLE_SOLID,f,3));f.setColor(null);f.size=30;if(b&&b.renderer)if(b.renderer.symbol)e=!0,f=this._updatePointSymbolProperties(f,b.renderer.symbol);else if(b.renderer.infos&&0<b.renderer.infos.length){for(d=0;d<b.renderer.infos.length;d++){b.typeIdField?c=a.attributes[b.typeIdField]:b.renderer.attributeField&&
(c=a.attributes[b.renderer.attributeField]);var q=b.renderer.infos[d].value;void 0!==c&&null!==c&&""!==c&&void 0!==q&&null!==q&&""!==q&&c.toString()===q.toString()&&(e=!0,f=this._updatePointSymbolProperties(f,b.renderer.infos[d].symbol))}!e&&b.renderer.defaultSymbol&&(e=!0,f=this._updatePointSymbolProperties(f,b.renderer.defaultSymbol))}if(a.geometry&&"point"===a.geometry.type)var t=new da(a.geometry.x,a.geometry.y,new E({wkid:a.geometry.spatialReference.wkid}));else a.geometry&&"multipoint"===a.geometry.type&&
(t=new qa(new E({wkid:a.geometry.spatialReference.wkid})),a.geometry.points&&r.forEach(a.geometry.points,function(v){t.addPoint(v)}));return new H(t,f,a.attributes)},_updatePointSymbolProperties:function(a,b){if(b.hasOwnProperty("height")&&b.hasOwnProperty("width")){var c=b.height;var d=b.width;c=(c>d?c:d)+10;a.size=c}b.hasOwnProperty("size")&&(!c||c<b.size)&&(a.size=b.size+10);b.hasOwnProperty("xoffset")&&(a.xoffset=b.xoffset);b.hasOwnProperty("yoffset")&&(a.yoffset=b.yoffset);return a},_getPolyLineSymbol:function(a,
b){var c,d;var e=5;var f=this._getHighLightSymbolColor();if(b&&b.renderer)if(b.renderer.symbol&&b.renderer.symbol.hasOwnProperty("width"))e=b.renderer.symbol.width;else if(b.renderer.infos&&0<b.renderer.infos.length)for(d=0;d<b.renderer.infos.length;d++){b.typeIdField?c=a.attributes[b.typeIdField]:b.renderer.attributeField&&(c=a.attributes[b.renderer.attributeField]);var q=b.renderer.infos[d].value;void 0!==c&&null!==c&&""!==c&&void 0!==q&&null!==q&&""!==q&&c.toString()===q.toString()&&b.renderer.infos[d].symbol.hasOwnProperty("width")&&
(e=b.renderer.infos[d].symbol.width)}else b.renderer.defaultSymbol&&b.renderer.defaultSymbol.hasOwnProperty("width")&&(e=b.renderer.defaultSymbol.width);b=new C(C.STYLE_SOLID,f,e);e=new L(new E({wkid:a.geometry.spatialReference.wkid}));a.geometry.paths&&0<a.geometry.paths.length&&e.addPath(a.geometry.paths[0]);return new H(e,b,a.attributes)},_getPolygonSymbol:function(a){var b=this._getHighLightSymbolColor();b=new R(R.STYLE_SOLID,new C(C.STYLE_SOLID,b,4),new K([0,0,0,0]));var c=new ea(new E({wkid:a.geometry.spatialReference.wkid}));
a.geometry.rings&&(c.rings=g.clone(a.geometry.rings));return new H(c,b,a.attributes)},_hideAllLayers:function(){if(this.config.selectedSearchLayerOnly){var a;for(a=0;a<this.config.searchLayers.length;a++)this._showHideOperationalLayer(this.config.searchLayers[a].url,this.config.searchLayers[a].id,!1)}},showAllLayers:function(a){var b;for(b=0;b<this.config.searchLayers.length;b++){var c=a?this.config.searchLayers[b].visibility:!0;this.config.selectedSearchLayerOnly&&this._searchedFeatures[this.config.searchLayers[b].id]&&
1>this._searchedFeatures[this.config.searchLayers[b].id].length&&(c=!1);this._showHideOperationalLayer(this.config.searchLayers[b].url,this.config.searchLayers[b].id,c)}},showLayersOnBackToLayerList:function(){var a;for(a=0;a<this.config.searchLayers.length;a++){var b=this.config.selectedSearchLayerOnly?this._searchedFeatures[this.config.searchLayers[a].id]&&0<this._searchedFeatures[this.config.searchLayers[a].id].length?!0:!1:!0;this._showHideOperationalLayer(this.config.searchLayers[a].url,this.config.searchLayers[a].id,
b)}},_showHideOperationalLayer:function(a,b,c){var d;var e=a.split("/");e=e[e.length-1];for(d in this.map._layers)if(this.map._layers.hasOwnProperty(d))if(b&&this.map._layers[d].url===a&&this.map._layers[d].id===b)this.map._layers[d].setVisibility(c);else if(this.map._layers[d].visibleLayers&&b&&this.map._layers[d].id===b.substring(0,b.lastIndexOf("_"))){var f=this.map._layers[d].url[this.map._layers[d].url.length-1];f="/"===f?this.map._layers[d].url+e:this.map._layers[d].url+"/"+e;if(f===a){f=this.map._layers[d].visibleLayers;
var q=r.indexOf(f,parseInt(e,10));c?-1===q&&f.push(parseInt(e,10)):-1!==q&&f.splice(q,1);this.map._layers[d].setVisibleLayers?this.map._layers[d].setVisibleLayers(f):(this.map._layers[d].visibleLayers=f,this.map._layers[d].setVisibility(c))}}},_getConfiguredSymbologyForLayer:function(a){var b=[];if(this.config.attributeSymbology&&this.config.attributeSymbology.hasOwnProperty(a))return this.config.attributeSymbology[a];this.config.attributeSymbology&&this.config.attributeSymbology.length&&0<this.config.attributeSymbology.length&&
r.forEach(this.config.attributeSymbology,g.hitch(this,function(c){c.hasOwnProperty("layerId")&&c.layerId===a&&b.push(c)}));return b},_checkAttributeSymbology:function(a,b){var c;if(c=l(".attachmentsSection",this._featureInfoPanel.domNode)[0]){var d=k.create("div",{"class":"esriCTAttributeSymbolWrapper"},null);k.place(d,c,"before")}r.forEach(b,g.hitch(this,function(e){a.attributes.hasOwnProperty(e.fieldName)&&a.attributes[e.fieldName]===e.fieldValue&&this._createAttributeSymbol(e,d)}))},_createAttributeSymbol:function(a,
b){var c=ha.fromJson(a.symbol);a=this._selectedLayer.getField(a.fieldName);b=k.create("div",{"class":"esriCTAttributeSymbolContainer",title:a&&a.alias?a.alias:""},b);c=pa.createSymbolNode(c);k.place(c,b)},resetIconColors:function(){this._filterIcon&&h.set(this._filterIcon,"background-color",this.selectedThemeColor);this._proximityIcon&&h.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(x(this._tabContainer.controlNodes[1],"keydown",g.hitch(this,function(a){a.keyCode===y.TAB&&!a.shiftKey&&this._tabContainer.viewStack&&this._tabContainer.viewStack.getSelectedLabel()===this.nls.informationTabTitle&&(this.config.enableProximitySearch?(U.stop(a),A.focus(this.proximityButton)):(U.stop(a),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 a=this._tabContainer.controlNodes[0];if(!this.config.enableProximitySearch)return z.initLastFocusNode(this.domNodeObj,a),!0}return!1}})});