"),n.on("blur.tt",function(t){var r,s,o;r=document.activeElement,s=i.is(r),o=i.has(r).length>0,e.isMsie()&&(s||o)&&(t.preventDefault(),t.stopImmediatePropagation(),e.defer(function(){n.focus()}))}),i.on("mousedown.tt",function(t){t.preventDefault()})},_onSelectableClicked:function(t,e){this.select(e)},_onDatasetCleared:function(){this._updateHint()},_onDatasetRendered:function(t,e,n,i){this._updateHint(),this.eventBus.trigger("render",n,i,e)},_onAsyncRequested:function(t,e,n){this.eventBus.trigger("asyncrequest",n,e)},_onAsyncCanceled:function(t,e,n){this.eventBus.trigger("asynccancel",n,e)},_onAsyncReceived:function(t,e,n){this.eventBus.trigger("asyncreceive",n,e)},_onFocused:function(){this._minLengthMet()&&this.menu.update(this.input.getQuery())},_onBlurred:function(){this.input.hasQueryChangedSinceLastFocus()&&this.eventBus.trigger("change",this.input.getQuery())},_onEnterKeyed:function(t,e){var n;(n=this.menu.getActiveSelectable())&&this.select(n)&&e.preventDefault()},_onTabKeyed:function(t,e){var n;(n=this.menu.getActiveSelectable())?this.select(n)&&e.preventDefault():(n=this.menu.getTopSelectable())&&this.autocomplete(n)&&e.preventDefault()},_onEscKeyed:function(){this.close()},_onUpKeyed:function(){this.moveCursor(-1)},_onDownKeyed:function(){this.moveCursor(1)},_onLeftKeyed:function(){"rtl"===this.dir&&this.input.isCursorAtEnd()&&this.autocomplete(this.menu.getTopSelectable())},_onRightKeyed:function(){"ltr"===this.dir&&this.input.isCursorAtEnd()&&this.autocomplete(this.menu.getTopSelectable())},_onQueryChanged:function(t,e){this._minLengthMet(e)?this.menu.update(e):this.menu.empty()},_onWhitespaceChanged:function(){this._updateHint()},_onLangDirChanged:function(t,e){this.dir!==e&&(this.dir=e,this.menu.setLanguageDirection(e))},_openIfActive:function(){this.isActive()&&this.open()},_minLengthMet:function(t){return(t=e.isString(t)?t:this.input.getQuery()||"").length>=this.minLength},_updateHint:function(){var t,n,i,r,s,u;t=this.menu.getTopSelectable(),n=this.menu.getSelectableData(t),i=this.input.getInputValue(),!n||e.isBlankString(i)||this.input.hasOverflow()?this.input.clearHint():(r=o.normalizeQuery(i),s=e.escapeRegExChars(r),(u=new RegExp("^(?:"+s+")(.+$)","i").exec(n.val))&&this.input.setHint(i+u[1]))},isEnabled:function(){return this.enabled},enable:function(){this.enabled=!0},disable:function(){this.enabled=!1},isActive:function(){return this.active},activate:function(){return!!this.isActive()||!(!this.isEnabled()||this.eventBus.before("active"))&&(this.active=!0,this.eventBus.trigger("active"),!0)},deactivate:function(){return!this.isActive()||!this.eventBus.before("idle")&&(this.active=!1,this.close(),this.eventBus.trigger("idle"),!0)},isOpen:function(){return this.menu.isOpen()},open:function(){return this.isOpen()||this.eventBus.before("open")||(this.menu.open(),this._updateHint(),this.eventBus.trigger("open")),this.isOpen()},close:function(){return this.isOpen()&&!this.eventBus.before("close")&&(this.menu.close(),this.input.clearHint(),this.input.resetInputValue(),this.eventBus.trigger("close")),!this.isOpen()},setVal:function(t){this.input.setQuery(e.toStr(t))},getVal:function(){return this.input.getQuery()},select:function(t){var e=this.menu.getSelectableData(t);return!(!e||this.eventBus.before("select",e.obj))&&(this.input.setQuery(e.val,!0),this.eventBus.trigger("select",e.obj),this.close(),!0)},autocomplete:function(t){var e,n;return e=this.input.getQuery(),!(!((n=this.menu.getSelectableData(t))&&e!==n.val)||this.eventBus.before("autocomplete",n.obj))&&(this.input.setQuery(n.val),this.eventBus.trigger("autocomplete",n.obj),!0)},moveCursor:function(t){var e,n,i,r;return e=this.input.getQuery(),n=this.menu.selectableRelativeToCursor(t),r=(i=this.menu.getSelectableData(n))?i.obj:null,!(this._minLengthMet()&&this.menu.update(e))&&!this.eventBus.before("cursorchange",r)&&(this.menu.setCursor(n),i?this.input.setInputValue(i.val):(this.input.resetInputValue(),this._updateHint()),this.eventBus.trigger("cursorchange",r),!0)},destroy:function(){this.input.destroy(),this.menu.destroy()}}),n;function i(t){var n=[].slice.call(arguments,1);return function(){var i=[].slice.call(arguments);e.each(n,function(e){return t[e].apply(t,i)})}}}();!function(){"use strict";var r,s,u;function l(e,n){e.each(function(){var e,i=t(this);(e=i.data(s.typeahead))&&n(e,i)})}function f(n){var i;return(i=e.isJQuery(n)||e.isElement(n)?t(n).first():[]).length?i:null}r=t.fn.typeahead,s={www:"tt-www",attrs:"tt-attrs",typeahead:"tt-typeahead"},u={initialize:function(r,u){var l;return u=e.isArray(u)?u:[].slice.call(arguments,1),l=n((r=r||{}).classNames),this.each(function(){var n,d,p,g,m,y,v,_,b,w,S;e.each(u,function(t){t.highlight=!!r.highlight}),n=t(this),d=t(l.html.wrapper),p=f(r.hint),g=f(r.menu),m=!1!==r.hint&&!p,y=!1!==r.menu&&!g,m&&(p=function(t,e){return t.clone().addClass(e.classes.hint).removeData().css(e.css.hint).css((n=t,{backgroundAttachment:n.css("background-attachment"),backgroundClip:n.css("background-clip"),backgroundColor:n.css("background-color"),backgroundImage:n.css("background-image"),backgroundOrigin:n.css("background-origin"),backgroundPosition:n.css("background-position"),backgroundRepeat:n.css("background-repeat"),backgroundSize:n.css("background-size")})).prop("readonly",!0).removeAttr("id name placeholder required").attr({autocomplete:"off",spellcheck:"false",tabindex:-1});var n}(n,l)),y&&(g=t(l.html.menu).css(l.css.menu)),p&&p.val(""),n=function(t,e){t.data(s.attrs,{dir:t.attr("dir"),autocomplete:t.attr("autocomplete"),spellcheck:t.attr("spellcheck"),style:t.attr("style")}),t.addClass(e.classes.input).attr({autocomplete:"off",spellcheck:!1});try{!t.attr("dir")&&t.attr("dir","auto")}catch(t){}return t}(n,l),(m||y)&&(d.css(l.css.wrapper),n.css(m?l.css.input:l.css.inputWithNoHint),n.wrap(d).parent().prepend(m?p:null).append(y?g:null));S=y?c:a,v=new i({el:n}),_=new o({hint:p,input:n},l),b=new S({node:g,datasets:u},l),w=new h({input:_,menu:b,eventBus:v,minLength:r.minLength},l),n.data(s.www,l),n.data(s.typeahead,w)})},isEnabled:function(){var t;return l(this.first(),function(e){t=e.isEnabled()}),t},enable:function(){return l(this,function(t){t.enable()}),this},disable:function(){return l(this,function(t){t.disable()}),this},isActive:function(){var t;return l(this.first(),function(e){t=e.isActive()}),t},activate:function(){return l(this,function(t){t.activate()}),this},deactivate:function(){return l(this,function(t){t.deactivate()}),this},isOpen:function(){var t;return l(this.first(),function(e){t=e.isOpen()}),t},open:function(){return l(this,function(t){t.open()}),this},close:function(){return l(this,function(t){t.close()}),this},select:function(e){var n=!1,i=t(e);return l(this.first(),function(t){n=t.select(i)}),n},autocomplete:function(e){var n=!1,i=t(e);return l(this.first(),function(t){n=t.autocomplete(i)}),n},moveCursor:function(t){var e=!1;return l(this.first(),function(n){e=n.moveCursor(t)}),e},val:function(t){var e;return arguments.length?(l(this,function(e){e.setVal(t)}),this):(l(this.first(),function(t){e=t.getVal()}),e)},destroy:function(){return l(this,function(t,n){!function(t){var n,i;n=t.data(s.www),i=t.parent().filter(n.selectors.wrapper),e.each(t.data(s.attrs),function(n,i){e.isUndefined(n)?t.removeAttr(i):t.attr(i,n)}),t.removeData(s.typeahead).removeData(s.www).removeData(s.attr).removeClass(n.classes.input),i.length&&(t.detach().insertAfter(i),i.remove())}(n),t.destroy()}),this}},t.fn.typeahead=function(t){return u[t]?u[t].apply(this,[].slice.call(arguments,1)):u.initialize.apply(this,arguments)},t.fn.typeahead.noConflict=function(){return t.fn.typeahead=r,this}}()});