// 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
define("dojo/_base/declare dojo/_base/html dojo/_base/lang dojo/_base/event dojo/on dojo/keys dojo/mouse dojo/Evented dijit/_WidgetBase dijit/_TemplatedMixin".split(" "),function(g,a,c,h,d,k,e,l,m,n){return g([m,n,l],{baseClass:"popup-menu-item",templateString:'\x3cdiv role\x3d"option" tabindex\x3d"-1"\x3e\x3cdiv class\x3d"icon jimu-float-leading" data-dojo-attach-point\x3d"iconContainer"\x3e\x3cdiv class\x3d"feature-action" data-dojo-attach-point\x3d"iconNode"\x3e\x3c/div\x3e\x3c/div\x3e\x3cdiv class\x3d"label" data-dojo-attach-point\x3d"labelNode"\x3e\x3c/div\x3e\x3c/div\x3e',
action:null,postCreate:function(){this.inherited(arguments);this.action&&(this.labelNode.innerHTML=this.action.label,this.labelNode.title=this.action.label,this.action.iconClass?("no-icon"===this.action.iconClass&&a.addClass(this.iconContainer,"no-icon"),a.addClass(this.iconNode,this.action.iconClass)):a.setStyle(this.iconNode,"background-image","url("+this.action.getIcon("default")+")"),this.own(d(this.domNode,e.enter,c.hitch(this,this._useHoverIcon))),this.own(d(this.domNode,e.leave,c.hitch(this,
this._useNormalIcon))));this.own(d(this.domNode,"click",c.hitch(this,this._clickHandler)));this.own(d(this.domNode,"keydown",c.hitch(this,function(b){b.keyCode===k.ENTER&&this._clickHandler(b,!0)})))},setSelected:function(b){b?a.addClass(this.domNode,"selected"):a.removeClass(this.domNode,"selected")},_useNormalIcon:function(){this.action.iconClass?a.removeClass(this.iconNode,"highlight"):a.setStyle(this.iconNode,"background-image","url("+this.action.getIcon("default")+")")},_useHoverIcon:function(){this.action.iconClass?
a.addClass(this.iconNode,"highlight"):a.setStyle(this.iconNode,"background-image","url("+this.action.getIcon("hover")+")")},_clickHandler:function(b,p){h.stop(b);if(this.action){var f;this.action.data.features&&0<this.action.data.features.length&&(f=this.action.data.features[0].getLayer());this.action.onExecute(this.action.data,f)}this.emit("click",{isEnter:p})}})});