// 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/Stream/FilterItem.html":'\x3cdiv\x3e\r\n  \x3cdiv data-dojo-attach-point\x3d"controlSection"\x3e\r\n  \x3c/div\x3e\r\n  \x3cdiv data-dojo-attach-point\x3d"filterSection" style\x3d"display:none"\x3e\r\n    \x3cdiv data-dojo-attach-point\x3d"attrFilterParams"\x3e\x3c/div\x3e\r\n    \x3cdiv class\x3d"jimu-btn" data-dojo-attach-point\x3d"applyAttrFilterBtn"\x3e\r\n      ${nls.applyAttrFilter}\r\n    \x3c/div\x3e\r\n  \x3c/div\x3e\r\n\x3c/div\x3e'}});
define("dojo/_base/declare dojo/_base/lang dojo/on dojo/dom-style dojo/dom-construct dijit/_WidgetBase dijit/_TemplatedMixin dojo/text!./FilterItem.html jimu/dijit/CheckBox dijit/form/RadioButton jimu/dijit/FilterParameters jimu/filterUtils jimu/utils".split(" "),function(f,c,d,b,e,g,h,k,l,m,n,p,q){return f([g,h],{baseClass:"jimu-widget-stream-filterItem",templateString:k,streamLayer:null,config:null,type:null,checked:!1,uid:"",index:0,askForValues:!0,postCreate:function(){this.inherited(arguments);
this._init()},_init:function(){if("checkbox"===this.type)this.control=new l({checked:this.checked,label:this.config.name,onChange:c.hitch(this,this._checkBoxChange)}),this.control.placeAt(this.controlSection);else if("radio"===this.type){var a=e.create("div",{},this.controlSection);this.control=new m({checked:this.checked,value:this.config.name,name:this.uid+"_attFilterItem",id:this.uid+"_attFilterItem_"+this.index});this.own(d(this.control,"change",c.hitch(this,function(r){this._checkBoxChange(r)})));
this.control.placeAt(a);e.create("label",{"class":"jimu-widget-normal",innerHTML:q.sanitizeHTML(this.config.name),"for":this.uid+"_attFilterItem_"+this.index},a)}this.attrParamsDijit=new n;this.attrParamsDijit.placeAt(this.attrFilterParams);this.attrParamsDijit.startup();this.attrParamsDijit.build(this.streamLayer.url,this.streamLayer,this.config.filterInfo);(this.askForValues=(new p).isAskForValues(this.config.filterInfo))?this.own(d(this.applyAttrFilterBtn,"click",c.hitch(this,this._applyFilter))):
b.set(this.applyAttrFilterBtn,"display","none")},unCheck:function(){"checkbox"===this.type?this.control.setValue(!1):"radio"===this.type&&this.control.set("checked",!1);b.set(this.filterSection,"display","none")},_applyFilter:function(){var a=this.attrParamsDijit.getFilterExpr();a&&"string"===typeof a&&(this.streamLayer.setDefinitionExpression(a),this.streamLayer.clear())},_checkBoxChange:function(a){a?this.askForValues?b.set(this.filterSection,"display",""):this._applyFilter():(b.set(this.filterSection,
"display","none"),"checkbox"===this.type&&this.streamLayer&&this.streamLayer.setDefinitionExpression(null))}})});