// 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/Screening/drawTool/SelectableLayerItem.html":'\x3cdiv\x3e\r\n  \x3cdiv class\x3d"layer-row" data-dojo-attach-point\x3d"layerContent"\x3e\r\n    \x3cdiv class\x3d"selectable-check" title\x3d"${nls.drawToolWidget.toggleSelectability}"\r\n      data-dojo-attach-point\x3d"selectableCheckBox" tabindex\x3d"0" role\x3d"checkbox" aria-checked\x3d"true"\x3e\r\n    \x3c/div\x3e\r\n    \x3cdiv class\x3d"layer-name jimu-ellipsis" data-dojo-attach-point\x3d"layerNameNode"\x3e\x3c/div\x3e\r\n  \x3c/div\x3e\r\n\x3c/div\x3e'}});
define("dojo/_base/declare dojo/_base/html dojo/_base/lang dojo/_base/event dojo/on dojo/Evented dijit/_WidgetBase dijit/_TemplatedMixin dijit/_WidgetsInTemplateMixin dojo/text!./SelectableLayerItem.html dojo/dom-attr dojo/keys".split(" "),function(k,d,b,e,f,l,m,n,p,q,g,h){return k([m,n,p,l],{baseClass:"jimu-widget-screening-selectable-layer-item",templateString:q,layerName:"layer",layerVisible:!0,checked:!1,constructor:function(c){this.layerName="layer";this.layerVisible=!0;this.checked=!1;b.mixin(this,
c)},postCreate:function(){this.inherited(arguments)},init:function(c){this.featureLayer=c;this.layerName=this.layerInfo.title||"layer";this.own(f(this.featureLayer,"selection-clear",b.hitch(this,function(){d.addClass(this.domNode,"no-action")})));this.layerNameNode.innerHTML=this.layerName;this.layerNameNode.title=this.layerName;d.addClass(this.selectableCheckBox,"checked");g.set(this.selectableCheckBox,"aria-label",this.layerName);g.set(this.selectableCheckBox,"aria-checked","true");this.own(f(this.selectableCheckBox,
"click",b.hitch(this,function(a){e.stop(a);this._toggleChecked(a)})));this.own(f(this.selectableCheckBox,"keydown",b.hitch(this,function(a){if(a.keyCode===h.ENTER||a.keyCode===h.SPACE)e.stop(a),this._toggleChecked(a);a.keyCode!==h.ESCAPE||this.isSingleTabSelected||(e.stop(a),this.emit("focusLastSelectedTab"))})));this.own(f(this.layerContent,"click",b.hitch(this,this._toggleContent)))},isLayerVisible:function(){return this.layerVisible},isChecked:function(){return this.checked},_toggleChecked:function(c){e.stop(c);
d.toggleClass(this.selectableCheckBox,"checked");(this.checked=d.hasClass(this.selectableCheckBox,"checked"))?g.set(this.selectableCheckBox,"aria-checked","true"):g.set(this.selectableCheckBox,"aria-checked","false");this.emit("stateChange",{checked:this.checked,layerInfo:this.layerInfo})}})});