// All material copyright ESRI, All Rights Reserved, unless otherwise specified.
// See http://js.arcgis.com/3.23/esri/copyright.txt for details.
//>>built
require({cache:{"url:esri/dijit/GeocodeMatch/templates/Popup.html":"\x3cdiv\x3e\r\n  \x3cdiv  class\x3d\"esri-popup-con\" data-dojo-attach-point\x3d'esri_popupHeader'\x3e\r\n    \x3cdiv\x3e\x3cspan\x3e${i18n.widgets.geocodeMatch.popup.addressTitle}\x3c/span\x3e\x3c/div\x3e\r\n    \x3cp data-dojo-attach-point\x3d'_addressTag'\x3e${i18n.widgets.geocodeMatch.popup.loadingPH}\x3c/p\x3e\r\n  \x3c/div\x3e\r\n  \x3cdiv  class\x3d\"esri-popup-con\" data-dojo-attach-point\x3d'esri_popupContent'\x3e\r\n    \x3cdiv\x3e\x3cspan\x3e${i18n.widgets.geocodeMatch.popup.locationTitle}\x3c/span\x3e\x3c/div\x3e\r\n    \x3cp data-dojo-attach-point\x3d'_Xtag'\x3e\x3c/p\x3e\r\n    \x3cp data-dojo-attach-point\x3d'_Ytag'\x3e\x3c/p\x3e\r\n  \x3c/div\x3e\r\n  \x3cdiv class\x3d\"esri-popup-button-con\"\x3e\r\n    \x3cdiv data-dojo-attach-point\x3d'_matchButton' data-dojo-type\x3d\"dijit.form.Button\"\x3e${i18n.widgets.geocodeMatch.popup.matchButtonLabel}\x3c/div\x3e\r\n    \x3cdiv data-dojo-attach-point\x3d'_discardButton' data-dojo-type\x3d\"dijit.form.Button\"\x3e${i18n.widgets.geocodeMatch.popup.discardButtonLabel}\x3c/div\x3e\r\n  \x3c/div\x3e\r\n\x3c/div\x3e"}});
define("esri/dijit/GeocodeMatch/Popup","dojo/_base/array dojo/_base/declare dojo/_base/lang dojo/Evented dojo/on dojo/uacss dojo/text!./templates/Popup.html dojo/i18n!../../nls/jsapi dijit/form/Button dijit/_WidgetBase dijit/_TemplatedMixin ../../kernel ../../geometry/webMercatorUtils".split(" "),function(h,d,b,k,e,l,m,f,g,n,p,q,r){d=d([n,p,k],{templateString:m,i18n:f,reverseRange:100,constructor:function(a,t){if(a.rowData&&(this._graphicID=a.graphic.attributes.id,a.rowData.address))if("object"===
typeof a.rowData.address){var b="",c;for(c in a.rowData.address)a.rowData.address.hasOwnProperty(c)&&(b+=a.rowData.address[c]+" ");this._address=b}else this._address=a.rowData.address;a.reverseRange&&(this.reverseRange=a.reverseRange)},postCreate:function(){this.inherited(arguments);var a;this._address&&this._addressTag?this._addressTag.innerHTML=this._address:this.geocodeMatch._locator.locationToAddress(this.graphic.geometry,this.reverseRange).then(b.hitch(this,function(a){a=a.address;var b="",c;
this.graphic.attributes.reverseGeocodeResults=a;if("object"===typeof a){for(c in a)a.hasOwnProperty(c)&&null!==a[c]&&"Loc_name"!==c&&(b+=a[c]+" ");this._addressTag&&(this._addressTag.innerHTML=b)}else this._addressTag&&(this._addressTag.innerHTML=a);this._matchButtonRef.set("disabled",!1)}),b.hitch(this,function(){this._addressTag&&(this._addressTag.innerHTML=f.widgets.geocodeMatch.popup.noAddress);this._matchButtonRef.set("disabled",!1)}));a=r.webMercatorToGeographic(this.graphic.geometry);this._Xtag.innerHTML=
this.i18n.widgets.geocodeMatch.popup.xTitle+a.x.toFixed(6);this._Ytag.innerHTML=this.i18n.widgets.geocodeMatch.popup.yTitle+a.y.toFixed(6);this._matchButtonRef=new g({label:this.i18n.widgets.geocodeMatch.popup.matchButtonLabel,"class":"esri_PopupButton esri_matchButton",disabled:!0},this._matchButton);this._discardButtonRef=new g({label:this.i18n.widgets.geocodeMatch.popup.discardButtonLabel,"class":"esri_PopupButton esri_deleteButton"},this._discardButton);this._listenerHandles=[e(this._matchButtonRef,
"click",b.hitch(this,function(){this.graphic.attributes.type===this.i18n.widgets.geocodeMatch.customLabel?this.geocodeMatch._matchCustomFeature(this.graphic):this.geocodeMatch._matchFeature(this.graphic.attributes.id);this.map.infoWindow.hide()})),e(this._discardButtonRef,"click",b.hitch(this,function(){this.map._layers[this.graphicsLayer.id].remove(this.graphic);this.map.infoWindow.hide()}))];!0===this.graphic.attributes.matched?(this._discardButtonRef.destroy(),this._matchButtonRef.destroy()):!1===
this.graphic.attributes.matched&&this._address&&(this._discardButtonRef.destroy(),this._matchButtonRef.set("disabled",!1));this.emit("load",{matchButtonRef:this._matchButtonRef,discardButtonRef:this._discardButtonRef})},startup:function(){this.inherited(arguments);this.emit("load",{matchButtonRef:this._matchButtonRef,discardButtonRef:this._discardButtonRef})},destroy:function(){this.inherited(arguments);h.forEach(this._listenerHandles,function(a){a.remove()})}});l("extend-esri")&&b.setObject("dijit.GeocodeMatchPopup",
d,q);return d});