var tdbSearch={};(function(){tdbSearch={items:[],init:function(){tdbSearch.items=[]},item:function(){this.jqueryObj=this.blockAtts=this.blockUid=void 0;this._is_search_open=!1;this._is_live_search_active=!0;this._last_request_results_count=this._current_selection_index=0;this._first_down_up=!0;this._resultsLimit=void 0;this._openSearchFormClass="";this._is_initialized=this.disable_trigger=this.isSearchFormFull=this.inComposer=!1},_initialize_item:function(a){if(!0!==a._is_initialized){jQuery(document).on("click",function(b){!0===a._is_search_open&&(a.jqueryObj.find("*").find(b.target).length||tdbSearch.hide_search_box(a))});if(!a.disable_trigger)a.jqueryObj.find(".tdb-head-search-btn").on("click",function(b){b.preventDefault();b.stopPropagation();!0===a._is_search_open?tdbSearch.hide_search_box(a):tdbSearch.show_search_box(a)});a._is_live_search_active&&!a.inComposer&&a.jqueryObj.find(".tdb-head-search-form-input").keydown(function(b){if(b.which&&39===b.which||b.keyCode&&39===b.keyCode||b.which&&37===b.which||b.keyCode&&37===b.keyCode)tdbSearch.set_input_focus(a);else{if(b.which&&13===b.which||b.keyCode&&13===b.keyCode)return b=a.jqueryObj.find(".tdb-aj-cur-element"),0a._last_request_results_count-1?(a.jqueryObj.find(".tdb-search-form").fadeTo(100,1),a.jqueryObj.find(".tdb-head-search-form-input").removeClass("tdb-head-search-nofocus")):(tdbSearch.remove_input_focus(a),a.jqueryObj.find(".td_module_wrap").eq(a._current_selection_index).addClass("tdb-aj-cur-element"))},do_ajax_call:function(a){var c=a.jqueryObj.find(".tdb-head-search-form-input").val();""===c?tdbSearch.set_input_focus(a):tdLocalCache.exist("tdb-"+c)?tdbSearch.process_ajax_response(tdLocalCache.get("tdb-"+c),a):jQuery.ajax({type:"POST",url:td_ajax_url,data:{action:"td_ajax_search",module:"tdb_module_search",atts:a.blockAtts,td_string:c,limit:a._resultsLimit},success:function(b,e,d){tdLocalCache.set("tdb-"+c,b);tdbSearch.process_ajax_response(b,a)},error:function(a,c,d){window.console.log(d)}})},process_ajax_response:function(a,c){var b=c.jqueryObj.find(".tdb-head-search-form-input").val(),e=c.jqueryObj.find(".tdb-aj-search");""===b?e.empty():(a=jQuery.parseJSON(a),a.td_search_query===b&&(c._current_selection_index=0,c._last_request_results_count=a.td_total_in_list,c._first_down_up=!0,e.html(a.td_data),"undefined"!==typeof window.tdAnimationStack&&!0===window.tdAnimationStack.activated&&(window.tdAnimationStack.check_for_new_items(".tdb-aj-search .td-animation-stack",window.tdAnimationStack.SORTED_METHOD.sort_left_to_right,!0,!1),window.tdAnimationStack.compute_items(!1))))},hideAllItems:function(){tdbSearch.items.forEach(function(a){tdbSearch.hide_search_box(a)})}}})();jQuery().ready(function(){tdbSearch.init();setTimeout(function(){jQuery(window).resize()},500)});