//>>built
define("dijit/form/_SearchMixin","dojo/_base/declare dojo/keys dojo/_base/lang dojo/query dojo/string dojo/when ../registry".split(" "),function(r,l,m,w,t,n,u){return r("dijit.form._SearchMixin",null,{pageSize:Infinity,store:null,fetchProperties:{},query:{},list:"",_setListAttr:function(c){this._set("list",c)},searchDelay:200,searchAttr:"name",queryExpr:"${0}*",ignoreCase:!0,_patternToRegExp:function(c){return new RegExp("^"+c.replace(/(\\.)|(\*)|(\?)|\W/g,function(b,e,a,g){return a?".*":g?".":e?
e:"\\"+b})+"$",this.ignoreCase?"mi":"m")},_abortQuery:function(){this.searchTimer&&(this.searchTimer=this.searchTimer.remove());this._queryDeferHandle&&(this._queryDeferHandle=this._queryDeferHandle.remove());this._fetchHandle&&(this._fetchHandle.abort&&(this._cancelingQuery=!0,this._fetchHandle.abort(),this._cancelingQuery=!1),this._fetchHandle.cancel&&(this._cancelingQuery=!0,this._fetchHandle.cancel(),this._cancelingQuery=!1),this._fetchHandle=null)},_processInput:function(c){if(!this.disabled&&
!this.readOnly){c=c.charOrCode;this._prev_key_backspace=!1;if(c===l.DELETE||c===l.BACKSPACE)this._maskValidSubsetError=this._prev_key_backspace=!0;if(this.store)this.searchTimer=this.defer("_startSearchFromInput",1);else this.onSearch()}},onSearch:function(){},_startSearchFromInput:function(){this._startSearch(this.focusNode.value)},_startSearch:function(c){this._abortQuery();var b=this,e=m.clone(this.query),a={start:0,count:this.pageSize,queryOptions:{ignoreCase:this.ignoreCase,deep:!0}},g=t.substitute(this.queryExpr,
[c.replace(/([\\\*\?])/g,"\\$1")]),q=function(){var p=b._fetchHandle=b.store.query(e,a);b.disabled||b.readOnly||h!==b._lastQuery||n(p,function(d){b._fetchHandle=null;b.disabled||b.readOnly||h!==b._lastQuery||n(p.total,function(v){d.total=v;var f=b.pageSize;if(isNaN(f)||f>d.total)f=d.total;d.nextPage=function(k){a.direction=k=!1!==k;a.count=f;k?(a.start+=d.length,a.start>=d.total&&(a.count=0)):(a.start-=f,0>a.start&&(a.count=Math.max(f+a.start,0),a.start=0));0>=a.count?(d.length=0,b.onSearch(d,e,a)):
q()};b.onSearch(d,e,a)})},function(d){b._fetchHandle=null})};m.mixin(a,this.fetchProperties);if(this.store._oldAPI)var h=g;else h=this._patternToRegExp(g),h.toString=function(){return g};this._lastQuery=e[this.searchAttr]=h;this._queryDeferHandle=this.defer(q,this.searchDelay)},constructor:function(){this.query={};this.fetchProperties={}},postMixInProperties:function(){if(!this.store){var c=this.list;c&&(this.store=u.byId(c))}this.inherited(arguments)}})});