!function(a){a.widget("ui.combobox",{input:null,options:{editable:!1,value:null},_create:function(){var b=this,c=this.element.hide(),d=c.children(":selected"),e=this.options.value?this.options.value:d.val()?d.text():"";this.input=a("<input>").insertAfter(c).val(e).autocomplete({delay:0,minLength:0,source:function(b,d){var e=new RegExp(a.ui.autocomplete.escapeRegex(b.term),"i");d(c.children("option").map(function(){var c=a(this).text();return!this.value||b.term&&!e.test(c)?void 0:{label:c,value:c,option:this}}))},select:function(a,c){c.item.option.selected=!0,b._trigger("selected",a,{item:c.item.option})},change:function(d,e){if(!e.item){var f=new RegExp("^"+a.ui.autocomplete.escapeRegex(a(this).val())+"$","i"),g=!1;if(c.children("option").each(function(){return this.value.match(f)?(this.selected=g=!0,!1):void 0}),!g)return b.options.editable||(a(this).val(b.options.value),c.val(a(this).val())),!1}}}).addClass("tbui-widget tbui-widget-content tbui-corner-left"),this.input.data("autocomplete")._renderItem=function(b,c){return a("<li></li>").data("item.autocomplete",c).append("<a>"+c.label+"</a>").appendTo(b)},a("<button>&nbsp;</button>").attr("tabIndex",-1).attr("title","Show All Items").insertAfter(this.input).button({icons:{primary:"tbui-icon-triangle-1-s"},text:!1}).removeClass("tbui-corner-all").addClass("tbui-corner-right tbui-button-icon").click(function(){return b.input.autocomplete("widget").is(":visible")?(b.input.autocomplete("close"),void 0):(b.input.autocomplete("search",""),b.input.focus(),void 0)})},value:function(){return this.input.val()}})}(jQuery);