window.addComment=function(v){var I,C,h,E=v.document,b={commentReplyClass:"comment-reply-link",commentReplyTitleId:"reply-title",cancelReplyId:"cancel-comment-reply-link",commentFormId:"commentform",temporaryFormId:"wp-temp-form-div",parentIdFieldId:"comment_parent",postIdFieldId:"comment_post_ID"},e=v.MutationObserver||v.WebKitMutationObserver||v.MozMutationObserver,r="querySelector"in E&&"addEventListener"in v,n=!!E.documentElement.dataset;function t(){d(),e&&new e(o).observe(E.body,{childList:!0,subtree:!0})}function d(e){if(r&&(I=g(b.cancelReplyId),C=g(b.commentFormId),I)){I.addEventListener("touchstart",l),I.addEventListener("click",l);function t(e){if((e.metaKey||e.ctrlKey)&&13===e.keyCode&&"a"!==E.activeElement.tagName.toLowerCase())return C.removeEventListener("keydown",t),e.preventDefault(),C.submit.click(),!1}C&&C.addEventListener("keydown",t);for(var n,d=function(e){var t=b.commentReplyClass;e&&e.childNodes||(e=E);e=E.getElementsByClassName?e.getElementsByClassName(t):e.querySelectorAll("."+t);return e}(e),o=0,i=d.length;o<i;o++)(n=d[o]).addEventListener("touchstart",a),n.addEventListener("click",a)}}function l(e){var t,n,d=g(b.temporaryFormId);d&&h&&(g(b.parentIdFieldId).value="0",t=d.textContent,d.parentNode.replaceChild(h,d),this.style.display="none",n=(d=(d=g(b.commentReplyTitleId))&&d.firstChild)&&d.nextSibling,d&&d.nodeType===Node.TEXT_NODE&&t&&(n&&"A"===n.nodeName&&n.id!==b.cancelReplyId&&(n.style.display=""),d.textContent=t),e.preventDefault())}function a(e){var t=g(b.commentReplyTitleId),t=t&&t.firstChild.textContent,n=this,d=m(n,"belowelement"),o=m(n,"commentid"),i=m(n,"respondelement"),r=m(n,"postid"),n=m(n,"replyto")||t;d&&o&&i&&r&&!1===v.addComment.moveForm(d,o,i,r,n)&&e.preventDefault()}function o(e){for(var t=e.length;t--;)if(e[t].addedNodes.length)return void d()}function m(e,t){return n?e.dataset[t]:e.getAttribute("data-"+t)}function g(e){return E.getElementById(e)}return r&&"loading"!==E.readyState?t():r&&v.addEventListener("DOMContentLoaded",t,!1),{init:d,moveForm:function(e,t,n,d,o){var i,r,l,a,m,c,s,e=g(e),n=(h=g(n),g(b.parentIdFieldId)),y=g(b.postIdFieldId),p=g(b.commentReplyTitleId),u=(p=p&&p.firstChild)&&p.nextSibling;if(e&&h&&n){void 0===o&&(o=p&&p.textContent),a=h,m=b.temporaryFormId,c=g(m),s=(s=g(b.commentReplyTitleId))?s.firstChild.textContent:"",c||((c=E.createElement("div")).id=m,c.style.display="none",c.textContent=s,a.parentNode.insertBefore(c,a)),d&&y&&(y.value=d),n.value=t,I.style.display="",e.parentNode.insertBefore(h,e.nextSibling),p&&p.nodeType===Node.TEXT_NODE&&(u&&"A"===u.nodeName&&u.id!==b.cancelReplyId&&(u.style.display="none"),p.textContent=o),I.onclick=function(){return!1};try{for(var f=0;f<C.elements.length;f++)if(i=C.elements[f],r=!1,"getComputedStyle"in v?l=v.getComputedStyle(i):E.documentElement.currentStyle&&(l=i.currentStyle),(i.offsetWidth<=0&&i.offsetHeight<=0||"hidden"===l.visibility)&&(r=!0),"hidden"!==i.type&&!i.disabled&&!r){i.focus();break}}catch(e){}return!1}}}}(window);
"undefined"===typeof window.tdcPostSettings&&(window.tdcPostSettings={tdbTemplateType:"all"});if(window.tdbVue&&"undefined"!==typeof window.tdbVue.router){var eventHub=new CloudLibraryVue;CloudLibraryVue.component("image-links",{template:'\n            <a :class="classes" :href="link">{{text}}</a>\n        ',props:{classes:[],link:"",text:""}});new CloudLibraryVue({el:"#tdb-modal",router:window.tdbVue.router})}
window.tdbVueManager&&"undefined"!==typeof window.tdbVueManager.router&&new CloudLibraryVue({el:"#tdb-modal-website-manager",router:window.tdbVueManager.router});
(function(){function m(a,b,c,d,f,g,h){var e=jQuery(".tdb-"+a+"-templates");e.length&&"undefined"===typeof e.data("tdb-templates")&&("undefined"!==typeof g&&g.call(),tdbGetMobileTemplates(a,b,e),g="","undefined"!==typeof tdcState&&(g=tdcState.isMobileComposer()?"1":""),g={action:"tdb_get_"+a+"_templates",mobile_templates:g,_nonce:window.tdb_globals.wpRestNonce},"cpt_tax"===a?g.data_id=b:g[a+"_id"]=b,jQuery.ajax({type:"POST",url:td_ajax_url,data:g,success:function(g,k,p){e.html("");g=jQuery.parseJSON(g);
k='<div class="tdb-templates-header"><div class="tdb-templates-header-item tdb-templates-header-item-name"><span>Cloud Templates</span></div>'+("undefined"!==typeof d&&!0===d?'<div class="tdb-templates-header-item tdb-templates-header-item-global"><span>Global</span></div>':"")+'<div class="tdb-templates-header-item tdb-templates-header-item-mobile" title="Optional - Create or assign a dedicated Mobile Template"><span>Mobile Template</span></div></div>';var l=p="",m=!1;_.isArray(g)&&g.length?(_.each(g,
function(e,g,h){h="";"true"===e.is_current.toString()&&(h=" tdb-current",m=!0);var k="";g="";switch(a){case "single":k=e.template_title+" - Set template for this post";break;case "category":k=e.template_title+" - Set template for this category";break;case "author":k=e.template_title+" - Set template for this author";break;case "tag":k=e.template_title+" - Set template for this tag";break;case "search":""!==e.cpt?(k=e.template_title+" - Set this template for the "+e.cpt.label+" custom post type",g=
' data-cpt="'+e.cpt.name+'"'):k=e.template_title+" - Set this template for post search results";break;case "woo_product":k=e.template_title+" - Set template for this product";break;case "woo_archive":k=e.template_title+" - Set template for this product archive";break;case "cpt":k=e.template_title+" - Set template for this custom post type";break;case "cpt_tax":""!==e.cpt?(k=e.template_title+" - Set this template for the "+e.cpt.label+" custom post type archive",g=' data-cpt="'+e.cpt.name+'"'):k=e.template_title+
" - Set template for this taxonomy"}h='<div class="tdb-template-el tdb-'+a+"-template-el"+h+'"  data-template-id="'+e.template_id+'"><div class="tdb-template-el-id tdb-'+a+'-template-id">'+e.template_id+'</div><div class="tdb-template-el-title" data-type="'+a+'" data-action="'+c+'" title="'+k+'" data-'+a+'-id="'+b+'" data-template-id="'+e.template_id+'"'+g+">"+e.template_title+'</div><div class="tdb-template-el-wrap"><div class="tdb-template-el-icon"><div class="tdb-template-el-options"><div title="Rename template" class="tdb-template-el-edit">Rename</div><div title="Duplicate template" class="tdb-template-el-duplicate">Duplicate</div><div title="Delete template" class="tdb-template-el-delete">Delete</div></div></div></div>';
"undefined"!==typeof d&&!0===d&&(k="","undefined"!==typeof f&&""!==f&&(k='data-global-action="'+f+'"'),h+='<div class="tdb-template-el-global tdb-'+a+'-template-global" title="Set as Global Template" data-type="'+a+'" data-'+a+'-id="'+b+'" data-template-id="'+e.template_id+'" '+k+g+'><input type="checkbox" class="tdb-template-el-global-input tdb-'+a+'-template-global-input" '+(!0===e.is_global?'checked="checked" ':"")+'><label></label><span class="tdb-template-el-global-checked tdb-'+a+'-template-global-checked">Global</span></div>');
h+='<div class="tdb-template-el-mobile-wrap tdb-'+a+'-template-mobile" data-type="'+a+'" data-'+a+'-id="'+b+'" data-template-id="'+e.template_id+'"><span class="tdb-template-el-mobile">'+(""===e.mobile_template_title?"-":'<span class="tdb-template-el-mobile-active">Yes</span>')+'</span><div class="tdb-template-el-mobile-btns" data-mobile-template-id="'+e.mobile_template_id+'" data-template-id="'+e.template_id+'"><div title="Optional - New mobile template" class="'+a+"id-"+e.template_id+' tdb-template-el-mobile-btn tdb-template-el-mobile-blank tdb-create-mobile-template" data-type="'+
a+'" data-'+a+'-id="'+b+'" data-template-id="'+e.template_id+'"></div><div title="Load mobile template from TagDiv Cloud Library" class="'+a+"id-"+e.template_id+' tdb-template-el-mobile-btn tdb-template-el-mobile-import tdb-load-mobile-template"></div></div></div>';l+=h+"</div>"}),"undefined"!==typeof d&&!0===d&&(p+='<div class="tdb-template-el tdb-'+a+"-template-el "+(m?"":"tdb-current")+'"><div class="tdb-template-el-id tdb-'+a+'-template-id"></div><div class="tdb-template-el-title" data-type="'+
a+'" data-action="'+c+'" title="Set as Global Template" data-'+a+'-id="'+b+'" data-template-id="">Global Template</div></div>'),e.append(p+k+l)):(e.append(k),e.append('<div class="tdb-templates-desc">No cloud templates. Please import one or more templates from <b>Cloud Library</b>.</div>'));e.data("tdb-templates",!0);"undefined"!==typeof h&&h.call()},error:function(a,b,c){}}))}function n(a,b,c){var d=jQuery(window);d.resize(function(){var f=d.width();a.offset().left+b.width()>f?b.hasClass(c)||b.addClass(c):
b.hasClass(c)&&b.removeClass(c)});d.resize()}jQuery(document).ready(function(){jQuery("#wp-admin-bar-tdb_template_builder_disabled a").click(function(a){a.preventDefault();alert("Please select tagDiv Builder Template from the theme panel or set a default template. The current page/post uses a template that is not editable.")});jQuery("#wp-admin-bar-new-tdb_templates").hide()});jQuery("body").on("click","#wp-admin-bar-tdb_template_load, .tdb-load-mobile-template",function(a){a.preventDefault();var b=
jQuery(this),c=b.attr("class");a="";var d=!1;b.hasClass("tdb-load-mobile-template")&&(d=!0);"undefined"!==typeof c&&(0===c.indexOf("singleid-")?(a={wp_type:"single",templateType:"Single"},b=c.split(" ")[0].replace("singleid-",""),d?a.assign_mobile_to_template=b:a.assign_to_post=b):0===c.indexOf("categoryid-")?(a={wp_type:"category",templateType:"Category"},b=c.split(" ")[0].replace("categoryid-",""),d?a.assign_mobile_to_template=b:a.assign_to_category=b):0===c.indexOf("404")?(a={wp_type:"404",templateType:"404"},
b=btoa(window.location.href),d?a.assign_mobile_to_template=b:a.assign_to_404=b):0===c.indexOf("date")?(a={wp_type:"date",templateType:"Date"},b=btoa(window.location.href),d?a.assign_mobile_to_template=b:a.assign_to_archive=b):0===c.indexOf("search")?(a={wp_type:"search",templateType:"Search"},b=btoa(window.location.href),d?a.assign_mobile_to_template=b:a.assign_to_search=b,-1!==c.indexOf("cpt-")&&(c=c.split(" ")[1].replace("cpt-",""),a.assign_to_search_cpt=c)):0===c.indexOf("attachment")?(a={wp_type:"attachment",
templateType:"Attachment"},b=btoa(window.location.href),d?a.assign_mobile_to_template=b:a.assign_to_attachment=b):0===c.indexOf("authorid")?(a={wp_type:"author",templateType:"Author"},b=c.split(" ")[0].replace("authorid-",""),d?a.assign_mobile_to_template=b:a.assign_to_author=b):0===c.indexOf("tagid")?(a={wp_type:"tag",templateType:"Tag"},b=c.split(" ")[0].replace("tagid-",""),d?a.assign_mobile_to_template=b:a.assign_to_tag=b):0===c.indexOf("pageid")?(a={wp_type:"page",templateType:"Pages"},b=c.split(" ")[0].replace("pageid-",
""),d&&(a.assign_mobile_to_template=b)):0===c.indexOf("woo_productid-")?(a={wp_type:"woo_product",templateType:"Woo Product"},b=c.split(" ")[0].replace("woo_productid-",""),d?a.assign_mobile_to_template=b:a.assign_to_woo_product=b):0===c.indexOf("woo_archiveid-")?(a={wp_type:"woo_archive",templateType:"Woo Archive"},b=c.split(" ")[0].replace("woo_archiveid-",""),d?a.assign_mobile_to_template=b:a.assign_to_woo_archive=b):0===c.indexOf("woo_search_archive")?(a={wp_type:"woo_search_archive",templateType:"Woo Search"},
b=btoa(window.location.href),d?a.assign_mobile_to_template=b:a.assign_to_woo_search_archive=b):0===c.indexOf("woo_shop_base")?(a={wp_type:"woo_shop_base",templateType:"Woo Shop Base"},b=btoa(window.location.href),d?a.assign_mobile_to_template=b:a.assign_to_woo_shop_base=b):0===c.indexOf("cpt_tax")?(a={wp_type:"cpt_tax",templateType:"Custom Taxonomy"},b=c.split(" ")[0].replace("cpt_taxid-",""),d?a.assign_mobile_to_template=b:a.assign_to_cpt_tax=b):0===c.indexOf("cpt")&&(a={wp_type:"cpt",templateType:"Custom Post Type"},
b=c.split(" ")[0].replace("cptid-",""),d?a.assign_mobile_to_template=b:a.assign_to_cpt=b),""!==a&&(a.hide_mobile_selector="hide",window.tdbVue.router.push({name:"loadRoute",params:a})))}).on("click",".tdb-create-mobile-template",function(a){var b=jQuery(this),c=b.data("template-id"),d=b.data("type");tdConfirm.modal({caption:"Create Mobile "+("page"===d?"Page":"Template"),objectContext:window,callbackYes:function(){var a=jQuery("#tdb-new-template-name"),g=jQuery("#tdb-copy-content");jQuery.ajax({type:"POST",
url:td_ajax_url,data:{action:"tdb_create_mobile_template",template_id:c,template_title:a.val(),template_type:d,copyContent:g.is(":checked")?"1":"0",_nonce:window.tdb_globals.wpRestNonce},success:function(a,e,f){a=jQuery.parseJSON(a);"undefined"!==typeof a.mobile_template_id&&(tdConfirm.close(),e=b.closest(".tdb-template-el"),e.length&&(f=e.find(".tdb-template-el-mobile:first"),e.find(".tdb-template-el-mobile-btns:first").data("mobile-template-id",a.mobile_template_id),f.html('<span class="tdb-template-el-mobile-active">Yes</span>')),
tdbGetMobileTemplates(d,c))},error:function(a,b,c){}})},htmlInfoContent:"Enter the mobile "+("page"===d?"page":"template")+' name: <input id="tdb-new-template-name" type="text" value=""onfocus="(function(e){ jQuery(e.target).siblings(\'#tdb-modal-notice\').fadeOut(50); })(event)"/><em id="tdb-modal-notice"></em><div class="tdb-form-check"><input type="checkbox" class="form-check-input" id="tdb-copy-content"><label class="form-check-label" for="tdb-copy-content"><span class="tdb-check"></span><span class="tdb-check-title">Copy content</span></label></div>',
textYes:"Create",textNo:"Cancel"})}).on("click","#wp-admin-bar-tdb_template_single > a, #wp-admin-bar-tdb_template_category > a, #wp-admin-bar-tdb_template_404 > a, #wp-admin-bar-tdb_template_date > a, #wp-admin-bar-tdb_template_search > a, #wp-admin-bar-tdb_template_attachment > a, #wp-admin-bar-tdb_template_author > a, #wp-admin-bar-tdb_template_tag > a, #wp-admin-bar-tdb_template_woo_product > a, #wp-admin-bar-tdb_template_woo_archive > a, #wp-admin-bar-tdb_template_woo_shop_base > a, #wp-admin-bar-tdb_template_woo_search_archive > a, #wp-admin-bar-tdb_template_cpt > a, #wp-admin-bar-tdb_template_cpt_tax > a",
function(a){a.preventDefault();var b=jQuery(this),c=b.parent(),d=c.attr("class"),f="",g="",h="",e="";switch(c.attr("id")){case "wp-admin-bar-tdb_template_single":f="single";g="tdb_assign_single_template_to_post";h="tdb_assign_single_template_global";e=d.replace(f+"id-","");break;case "wp-admin-bar-tdb_template_category":f="category";g="tdb_assign_cat_template_to_cat";h="tdb_assign_cat_template_global";e=d.replace(f+"id-","");break;case "wp-admin-bar-tdb_template_404":f="404";g="tdb_assign_404_template_global";
h="";e=d.replace("templateid-","");break;case "wp-admin-bar-tdb_template_date":f="date";g="tdb_assign_date_template_global";h="";e=d.replace("templateid-","");break;case "wp-admin-bar-tdb_template_search":f="search";g="tdb_assign_search_template_global";h="";e=d.replace("templateid-","");break;case "wp-admin-bar-tdb_template_attachment":f="attachment";g="tdb_assign_attachment_template_global";h="";e=d.replace("templateid-","");break;case "wp-admin-bar-tdb_template_author":f="author";g="tdb_assign_author_template_to_author";
h="tdb_assign_author_template_global";e=d.replace(f+"id-","");break;case "wp-admin-bar-tdb_template_tag":f="tag";g="tdb_assign_tag_template_to_tag";h="tdb_assign_tag_template_global";e=d.replace(f+"id-","");break;case "wp-admin-bar-tdb_template_woo_product":f="woo_product";g="tdb_assign_woo_product_template_to_product";h="tdb_assign_woo_product_template_global";e=d.replace(f+"id-","");break;case "wp-admin-bar-tdb_template_woo_archive":f="woo_archive";g="tdb_assign_woo_archive_template_to_tax";h="tdb_assign_woo_archive_template_global";
e=d.replace(f+"id-","");break;case "wp-admin-bar-tdb_template_woo_search_archive":f="woo_search_archive";g="tdb_assign_woo_search_archive_template_global";h="";e=d.replace("templateid-","");break;case "wp-admin-bar-tdb_template_woo_shop_base":f="woo_shop_base";g="tdb_assign_woo_shop_base_template_global";h="";e=d.replace("templateid-","");break;case "wp-admin-bar-tdb_template_cpt":f="cpt";g="tdb_assign_cpt_template_to_cpt";h="tdb_assign_cpt_template_global";e=d.replace(f+"id-","");break;case "wp-admin-bar-tdb_template_cpt_tax":f=
"cpt_tax",g="tdb_assign_cpt_tax_template_to_tax",h="tdb_assign_cpt_tax_template_global",e=d.replace("templateid-","")}var l=jQuery(".tdb-"+f+"-templates");l.length?a.currentTarget===this&&jQuery(a.target).parent().attr("id")==="wp-admin-bar-tdb_template_"+f&&(l.toggle(),b.toggleClass("tdb-templates-open"),b.toggleClass("tdb-templates-close")):(b.addClass("tdb-templates-loading"),l=jQuery('<div class="tdb-templates tdb-'+f+'-templates" data-type="'+f+'"></div>'),l.insertAfter(b),l.show());m(f,e,g,
""===h?!1:!0,h,void 0,function(){b.removeClass("tdb-templates-loading");b.addClass("tdb-templates-open");n(b,l,"tdb-templates-align-right")})}).on("click","#wp-admin-bar-tdc_page_mobile_template > a",function(a){a.preventDefault();var b=jQuery(this);a=b.parent().attr("class").replace("pageid-","");var c=jQuery("#tdb-mobile-templates");c.length?(c.toggle(),b.toggleClass("tdb-templates-open"),b.toggleClass("tdb-templates-close")):(b.addClass("tdb-templates-loading"),b.addClass("tdb-templates-open"),
tdbGetMobileTemplates("page",a,b,void 0,function(){b.removeClass("tdb-templates-loading");jQuery("#tdb-mobile-templates").show();n(b,jQuery("#tdb-mobile-templates"),"tdb-mobile-templates-align-right")}))}).on("click","#wp-admin-bar-tdc_create_mobile_page",function(a){var b=jQuery(this).attr("class").split(" ")[0].replace("pageid-","");tdConfirm.modal({caption:"Create Mobile Page",objectContext:window,callbackYes:function(){var a=jQuery("#tdb-new-template-name"),d=jQuery("#tdb-copy-content");jQuery.ajax({type:"POST",
url:td_ajax_url,data:{action:"tdb_create_mobile_template",template_id:b,template_title:a.val(),template_type:"page",copyContent:d.is(":checked")?"1":"0",_nonce:window.tdb_globals.wpRestNonce},success:function(c,d,h){"undefined"!==typeof jQuery.parseJSON(c).mobile_template_id&&(tdConfirm.close(),c=jQuery("#wp-admin-bar-tdc_page_mobile_template"),c.length&&c.find("a:first").html('<span class="td-mob-page-before">Mobile page</span>'+a.val()),tdbGetMobileTemplates("page",b))},error:function(a,b,c){}})},
htmlInfoContent:'Enter the mobile page name: <input id="tdb-new-template-name" type="text" value="" onfocus="(function(e){ jQuery(e.target).siblings(\'#tdb-modal-notice\').fadeOut(50); })(event)"/><em id="tdb-modal-notice"></em><div class="tdb-form-check"><input type="checkbox" class="form-check-input" id="tdb-copy-content"><label class="form-check-label" for="tdb-copy-content"><span class="tdb-check"></span><span class="tdb-check-title">Copy content</span></label></div>',textYes:"Create",textNo:"Cancel"})}).on("click",
".tdb-single-template-global label, .tdb-category-template-global label, .tdb-author-template-global label, .tdb-tag-template-global label, .tdb-woo_product-template-global label, .tdb-woo_archive-template-global label, .tdb-cpt-template-global label, .tdb-cpt_tax-template-global label ",function(a){a.preventDefault();var b=jQuery(this);a=b.closest(".tdb-template-el-global");var c=a.data("type"),d=a.data("global-action"),f=b.parent().data(c+"-id"),g=b.parent().data("template-id"),h=jQuery(".tdb-templates");
b={action:d,template_id:g,_nonce:window.tdb_globals.wpRestNonce};switch(c){case "single":b.single_id=f;break;case "category":b.category_id=f;break;case "tag":b.tag_id=f;break;case "author":b.author_id=f;break;case "woo_product":b.woo_product_id=f;break;case "woo_archive":b.woo_term_id=f;break;case "cpt":b.cpt_id=f;b.option="single_tpl";break;case "cpt_tax":void 0!==a.data("cpt")?(b.action="tdb_assign_cpt_template_global",b.cpt=f,b.option="archive_tpl"):b.cpt_tax_id=f}jQuery.ajax({type:"POST",url:td_ajax_url,
data:b,success:function(a,b,d){a=jQuery.parseJSON(a);"undefined"!==typeof a.reload&&window.location.reload();"undefined"!==typeof a.global_template_id&&(h.find(".tdb-"+c+'-template-global > input[type="checkbox"]').removeAttr("checked"),h.find(".tdb-"+c+'-template-global[data-template-id="'+g+'"] > input[type="checkbox"]').attr("checked",!0))},error:function(a,b,c){}});return!1}).on("click",".tdb-template-el-title",function(a){a.preventDefault();if(a.target===a.currentTarget){a=jQuery(this);var b=
a.data("action"),c=a.data("type"),d=a.data(c+"-id"),f=a.data("template-id");b={action:b,template_id:f,_nonce:window.tdb_globals.wpRestNonce};"cpt"===c?b.cpt=a.data("cpt-id"):"cpt_tax"===c&&(b.cpt_tax=a.data("cpt_tax-id"));switch(c){case "single":b.single_id=d;break;case "category":b.category_id=d;break;case "author":b.author_id=d;break;case "tag":b.tag_id=d;break;case "woo_product":b.woo_product_id=d;break;case "woo_archive":b.woo_term_id=d;break;case "cpt":b.cpt_id=d;break;case "cpt_tax":void 0!==a.data("cpt")?(b.action="tdb_assign_cpt_template_global",b.cpt=d,b.option="archive_tpl"):b.cpt_tax_id=d;break;case "search":void 0!==a.data("cpt")&&(b.action="tdb_assign_cpt_template_global",b.cpt=d,b.option="search_tpl")}jQuery.ajax({type:"POST",url:td_ajax_url,data:b,success:function(a,b,d){"undefined"===typeof jQuery.parseJSON(a).reload&&"cpt"!==c&&"cpt_tax"!==c&&"search"!==c||window.location.reload()},error:function(a,b,c){}});return!1}}).on("change",".tdb-template-el-title-input",function(a){a.preventDefault();
a=jQuery(this);var b=a.closest(".tdb-templates"),c=a.closest(".tdb-template-el"),d=c.find(".tdb-template-el-title:first");b.data("type");b=c.data("template-id");d.html();jQuery.ajax({type:"POST",url:td_ajax_url,data:{action:"tdb_change_template_name",template_id:b,template_title:a.val(),_nonce:window.tdb_globals.wpRestNonce},success:function(a,b,c){a=jQuery.parseJSON(a);"undefined"!==typeof a.template_id&&(d.html(a.template_title),d.removeData("title"))},error:function(a,b,c){}})}).on("click",".tdb-template-el-edit",
function(a){a.preventDefault();var b=jQuery(this);a=b.closest(".tdb-templates");var c=b.closest(".tdb-template-el");b=c.find(".tdb-template-el-title:first");a.data("type");c.data("template-id");c=b.html();"undefined"===typeof b.data("title")&&(a.find(".tdb-template-el-title").each(function(a,b){a=jQuery(b);b=a.data("title");"undefined"!==typeof b&&(a.html(b),a.removeData("title"))}),b.data("title",b.html()),b.html('<input class="tdb-template-el-title-input" type="text" value="'+c+'">'),b.find("input").focus().select())}).on("click",
".tdb-template-el-duplicate",function(a){a.preventDefault();a=jQuery(this);var b=a.closest(".tdb-templates"),c=a.closest(".tdb-template-el"),d=c.find(".tdb-template-el-title:first"),f=b.data("type");a=c.data("template-id");var g=d.html(),h=d.data(f+"-id"),e=d.data("action"),l="";0<="single category tag author woo_product woo_archive".split(" ").indexOf(f)&&(c=c.find(".tdb-template-el-global:first"),c.length&&(l=c.data("global-action")));tdbApi.run({wpNonce:window.tdb_globals.wpRestNonce,cloudEndPoint:"td-cloud-library/new_template",
post:{postId:a,templateType:f,templateName:g,duplicateTemplate:!0},done:function(a){b.removeData("tdb-templates");m(f,0<="single category tag author woo_product woo_archive cpt".split(" ").indexOf(f)?h:"",e,""===l?!1:!0,l)},error:function(a){console.log("td-cloud-library/new_template(duplicate template) - ERROR",a)}});jQuery(".tdb-template-el-title-input").trigger("change")}).on("keyup",".tdb-template-el-title-input",function(a){27===a.keyCode&&jQuery(this).trigger("change")}).on("click",".tdb-template-el-delete",
function(a){a=jQuery(this);a.closest(".tdb-templates");var b=a.closest(".tdb-template-el");a=b.data("template-id");jQuery.ajax({type:"POST",url:td_ajax_url,data:{action:"tdb_delete_template",template_id:a,_nonce:window.tdb_globals.wpRestNonce},success:function(a,d,f){a=jQuery.parseJSON(a);"undefined"!==typeof a.reload&&window.location.reload();"undefined"!==typeof a.template_id&&b.remove()},error:function(a,b,f){}});jQuery(".tdb-template-el-title-input").trigger("change")}).on("click",function(a){a=
jQuery(a.target);a.closest("#wp-admin-bar-tdb_template_single").length||a.closest("#wp-admin-bar-tdb_template_category").length||a.closest("#wp-admin-bar-tdb_template_404").length||a.closest("#wp-admin-bar-tdb_template_date").length||a.closest("#wp-admin-bar-tdb_template_search").length||a.closest("#wp-admin-bar-tdb_template_attachment").length||a.closest("#wp-admin-bar-tdb_template_author").length||a.closest("#wp-admin-bar-tdb_template_tag").length||a.closest("#wp-admin-bar-tdb_template_woo_product").length||
a.closest("#wp-admin-bar-tdb_template_woo_archive").length||a.closest("#wp-admin-bar-tdb_template_woo_search_archive").length||a.closest("#wp-admin-bar-tdb_template_woo_shop_base").length||a.closest("#wp-admin-bar-tdb_template_cpt").length||a.closest("#wp-admin-bar-tdb_template_cpt_tax").length||a.closest("#wp-admin-bar-tdc_page_mobile_template").length||(a=jQuery(".tdb-templates"),a.length&&(a.hide(),a.prev("a").removeClass("tdb-templates-open").addClass("tdb-templates-close"),jQuery(".tdb-template-el-title-input").trigger("change")),
a=jQuery("#tdb-mobile-templates"),a.length&&(a.hide(),a.prev("a").removeClass("tdb-templates-open").addClass("tdb-templates-close")))}).on("click","#tdb-mobile-templates .tdb-template-el-mobile-list-el",function(a){var b=jQuery(this),c=jQuery("#tdb-mobile-templates");a=b.data("template-id");var d=b.data("mobile-template-id"),f=c.closest(".tdb-template-el-mobile-btns"),g=b.closest(".tdb-template-el-mobile-wrap"),h=b.closest("#wp-admin-bar-tdc_page_mobile_template");jQuery.ajax({type:"POST",url:td_ajax_url,
data:{action:"tdb_set_mobile_template",template_id:a,mobile_template_id:d,_nonce:window.tdb_globals.wpRestNonce},success:function(a,l,k){a=jQuery.parseJSON(a);_.isObject(a)&&!_.isUndefined(a.result)&&1===a.result&&(f.data("mobile-template-id",d),c.find(".tdb-template-el-mobile-list-el").removeClass("tdb-current"),c.find('.tdb-template-el-mobile-list-el[data-mobile-template-id="'+d+'"]').addClass("tdb-current"),g.length&&(a=g.find(".tdb-template-el-mobile:first"),""===d?a.html("-"):a.html('<span class="tdb-template-el-mobile-active">Yes</span>')),
h.length&&(h.find("a:first").html('<span class="td-mob-page-before" style="margin-right:10px;">Mobile page</span>'+b.find(".tdb-template-el-mobile-list-title:first").html()),"No mobile page"===b.find(".tdb-template-el-mobile-list-title:first").html()&&h.find("a:first").html('<span class="td-mob-page-before">Mobile page</span>')))}})}).on("click","#tdb-mobile-templates .tdb-template-el-mobile-list-edit",function(a){a.stopPropagation()}).on("click","#tdb-mobile-templates .tdb-template-el-mobile-list-delete",
function(a){a.stopPropagation();a=jQuery(this);var b=a.data("type"),c=a.closest(".tdb-template-el-mobile-list-el"),d=c.data("template-id");a=c.data("mobile-template-id");var f=c.hasClass("tdb-current"),g=jQuery("#tdb-mobile-templates").closest(".tdb-template-el");jQuery.ajax({type:"POST",url:td_ajax_url,data:{action:"tdb_delete_template",template_id:a,_nonce:window.tdb_globals.wpRestNonce},success:function(a,e,l){"undefined"!==typeof jQuery.parseJSON(a).template_id&&tdbGetMobileTemplates(b,d,void 0,
function(){jQuery("#tdb-mobile-templates").addClass("loading")},function(){jQuery("#tdb-mobile-templates").removeClass("loading");if(f)if("page"===b){var a=jQuery("#wp-admin-bar-tdc_page_mobile_template");a.length&&a.find("a:first").html('<span class="td-mob-page-before">Mobile page</span>No mobile page')}else c.remove(),g.length&&g.find(".tdb-template-el-mobile:first").html("-")})},error:function(a,b,c){}})}).on("mouseenter",".tdb-template-el-mobile-btns",function(a){a=jQuery(this);var b=a.data("mobile-template-id"),
c=a.data("template-id"),d=jQuery("#tdb-mobile-templates");d.find(".tdb-template-el-mobile-list-inner").is(":empty")||(d.appendTo(a).show(),d.find(".tdb-template-el-mobile-list-el").removeClass("tdb-current"),d.find(".tdb-template-el-mobile-list-el").data("template-id",c),d.find('.tdb-template-el-mobile-list-el[data-mobile-template-id="'+b+'"]').addClass("tdb-current"))}).on("mouseleave",".tdb-template-el-mobile-btns",function(a){a=jQuery(".tdb-templates");var b=jQuery("#tdb-mobile-templates");b.hide();
b.insertBefore(a);b.find(".tdb-template-el-mobile-list-el").removeClass("tdb-current")});jQuery(".tdb-templates");window.tdbGetMobileTemplates=function(a,b,c,d,f,g,h){var e=jQuery("#tdb-mobile-templates",g);e.length||(e=jQuery('<div id="tdb-mobile-templates" class="tdb-template-el-mobile-list"><div class="tdb-template-el-mobile-list-inner"></div><div class="tdb-template-el-mobile-list-separator" style="height: 1px;width: 100%;background-color: #ebebeb;margin: 10px 0;"></div><a href="https://tagdiv.com/newspaper-10-3-7-update-brings-customizable-and-fast-mobile-pages/" target="_blank" style="height: auto;padding: 0;color: #1a9a75;" class="tdb-template-el-mobile-list-no-el">Documentation &#187;</a></div>'),
e.hide());"undefined"!==typeof c&&e.insertAfter(c);c={action:"tdb_get_"+a+"_mobile_templates",_nonce:window.tdb_globals.wpRestNonce};c[a+"_id"]=b;"undefined"!==typeof window.tdbLoadDataFromId&&(c.tdbLoadDataFromId=window.tdbLoadDataFromId);"undefined"!==typeof d&&d.call();jQuery.ajax({type:"POST",url:td_ajax_url,data:c,success:function(c,d,g){var k="";g=jQuery.parseJSON(c);c='<li id="wp-admin-bar-tdb_template_load" class="pageid-'+b+' tdb-load-mobile-template tdb-template-el-mobile-list-el"><div class="ab-item ab-empty-item" title="Optional - Load mobile page from TagDiv Cloud Library"></div><span class="tdb-template-el-mobile-list-title">Load mobile page from Cloud Library</span></li><li id="wp-admin-bar-tdc_create_mobile_page" class="pageid-'+
b+' tdb-template-el-mobile-list-el"><div class="ab-item ab-empty-item" title="Optional - Create blank mobile page"></div><span class="tdb-template-el-mobile-list-title">Create blank mobile page</span></li>';if(_.isArray(g)&&g.length){var l=!1,m="template";d="";"page"===a&&(m="page",d=c+'<div class="tdb-template-el-mobile-list-separator" style="height: 1px;width: 100%;background-color: #ebebeb;margin: 10px 0;"></div>');_.each(g,function(c,d,e){d="";_.isUndefined(c.is_current)||(d="tdb-current",l=!0);
k+='<div class="tdb-template-el-mobile-list-el '+d+'" data-mobile-template-id="'+c.template_id+'" data-template-id="'+b+'"><div class="tdb-template-el-mobile-list-title" title="'+c.template_title+'">'+c.template_title+'</div><a class="tdb-template-el-mobile-list-edit" title="Edit mobile '+m+' with Composer" href="'+c.template_url+'" target="_blank"></a><div class="tdb-template-el-mobile-list-delete" title="Delete mobile '+m+'" data-type="'+a+'"></div></div>'});""!==k&&(g="",l||(g="tdb-current",l=
!0),k=d+'<div class="tdb-template-el-mobile-list-el '+g+'" data-mobile-template-id="" data-template-id="'+b+'"><div class="tdb-template-el-mobile-list-title">No mobile '+m+"</div></div>"+k);""!==k&&(e.html('<div class="tdb-template-el-mobile-list-inner">'+k+'</div><div class="tdb-template-el-mobile-list-separator" style="height: 1px;width: 100%;background-color: #ebebeb;margin: 10px 0;"></div><a href="https://tagdiv.com/newspaper-10-3-7-update-brings-customizable-and-fast-mobile-pages/" target="_blank" style="height: auto;padding: 0;color: #1a9a75;" class="tdb-template-el-mobile-list-no-el">Documentation &#187;</a>'),
d=e.parent(".tdb-template-el-mobile-btns"),!_.isUndefined(h)&&d.length&&(e.find(".tdb-template-el-mobile-list-el").removeClass("tdb-current"),e.find(".tdb-template-el-mobile-list-el").data("template-id",b),e.find('.tdb-template-el-mobile-list-el[data-mobile-template-id="'+h+'"]').addClass("tdb-current")),e.is(":visible")&&d.length?e.show():e.hide())}""===k&&("page"===a?e.html(c+'<div class="tdb-template-el-mobile-list-separator" style="height: 1px;width: 100%;background-color: #ebebeb;margin: 10px 0;"></div><div class="tdb-template-el-mobile-list-inner"><div class="tdb-template-el-mobile-list-no-el">No mobile page, please import or create a new mobile page.</div><div class="tdb-template-el-mobile-list-separator" style="height: 1px;width: 100%;background-color: #ebebeb;margin: 10px 0;"></div><a href="https://tagdiv.com/newspaper-10-3-7-update-brings-customizable-and-fast-mobile-pages/" target="_blank" style="height: auto;padding: 0;color: #1a9a75;" class="tdb-template-el-mobile-list-no-el">Documentation &#187;</a></div>'):
e.html(""));"undefined"!==typeof f&&f.call()}})}})();
jQuery(window).on("load",function(){if("undefined"!==typeof window.tdReadingProgressBar){var m=!1;window.parent===window.top&&"undefined"!==typeof window.name&&"tdc-live-iframe"===window.name&&"undefined"!==typeof window.parent.tdcSidebar&&(m=!0);if(window.self===window.top||m)jQuery(".tdb_single_reading_progress").each(function(){var n=jQuery(this),a=n.data("td-block-uid");n=n.data("bar-position");var b=new tdReadingProgressBar.item;b.blockUid=a;b.barPosition=n;tdReadingProgressBar.addItem(b);m&&
tdReadingProgressBar.createFixedBar(b,0,30)}),m||tdReadingProgressBar.calculateBarsFill()}});
var tdToTop={};jQuery().ready(function(){tdToTop.init()});
(function(){tdToTop={$element:void 0,style:"",init:function(){var a=jQuery(".td-scroll-up");if(a.length){tdToTop.$element=a;tdToTop.style="undefined"!==typeof a.data("style")?a.data("style"):"style1";switch(tdToTop.style){case "style2":jQuery("body").css({position:"relative","overflow-x":"hidden"})}a.on("click",function(a){return tdToTop.handle_click_event(a)})}},td_events_scroll:function(a){if("undefined"!==typeof tdToTop.$element)switch(400<a?tdToTop.$element.hasClass("td-scroll-up-visible")||tdToTop.$element.addClass("td-scroll-up-visible"):
tdToTop.$element.hasClass("td-scroll-up-visible")&&tdToTop.$element.removeClass("td-scroll-up-visible"),tdToTop.style){case "style2":var b=tdToTop.$element.find(".td-scroll-up-progress-circle path"),c=b.get(0).getTotalLength(),d=jQuery(document).height()-jQuery(window).height();b.css({"stroke-dashoffset":c-a*c/d});a=jQuery(".td-footer-template-wrap");a.length&&(tdUtil.isInViewport(a)?tdToTop.$element.css({position:"absolute",bottom:a.outerHeight()+4}):tdToTop.$element.css({position:"fixed",bottom:4}))}},
handle_click_event:function(a){a.preventDefault();tdToTop.$element.hasClass("td-scroll-up-visible")&&tdToTop.$element.removeClass("td-scroll-up-visible");td_more_articles_box.is_box_visible=!1;jQuery(".td-more-articles-box").removeClass("td-front-end-display-block");tdUtil.scrollToPosition(0,1200)}}})();
jQuery().ready(function(){jQuery("#login-link-mob").on("click",function(){tdLoginMob.showHideElements([["#td-login-mob",1],["#td-register-mob",0],["#td-forgot-pass-mob",0]]);jQuery("#td-mobile-nav").addClass("td-hide-menu-content");700<jQuery(window).width()&&!1===tdDetect.isIe&&jQuery("#login_email-mob").focus();tdLoginMob.showHideMsg()});jQuery("#register-link-mob, #signin-register-link-mob").on("click",function(){tdLoginMob.showHideElements([["#td-login-mob",0],["#td-register-mob",1],["#td-forgot-pass-mob",
0]]);jQuery("#td-mobile-nav").addClass("td-hide-menu-content");700<jQuery(window).width()&&!1===tdDetect.isIe&&jQuery("#register_email-mob").focus();tdLoginMob.showHideMsg()});jQuery("#forgot-pass-link-mob").on("click",function(){tdLoginMob.showHideElements([["#td-login-mob",0],["#td-register-mob",0],["#td-forgot-pass-mob",1]]);700<jQuery(window).width()&&!1===tdDetect.isIe&&jQuery("#forgot_email-mob").focus();tdLoginMob.showHideMsg()});jQuery("#login_button-mob").on("click",function(){tdLoginMob.handlerLogin()});
jQuery("#login_pass-mob").keydown(function(a){(a.which&&13===a.which||a.keyCode&&13===a.keyCode)&&tdLoginMob.handlerLogin()});jQuery("#register_button-mob").on("click",function(){tdLoginMob.handlerRegister()});jQuery("#register_user-mob").keydown(function(a){(a.which&&13===a.which||a.keyCode&&13===a.keyCode)&&tdLoginMob.handlerRegister()});jQuery("#forgot_button-mob").on("click",function(){tdLoginMob.handlerForgotPass()});jQuery("#forgot_email-mob").keydown(function(a){(a.which&&13===a.which||a.keyCode&&
13===a.keyCode)&&tdLoginMob.handlerForgotPass()});jQuery("#td-mobile-nav .td-login-close span, #td-mobile-nav .td-register-close span").on("click",function(){tdLoginMob.showHideElements([["#td-login-mob",0],["#td-register-mob",0],["#td-forgot-pass-mob",0]]);jQuery("#td-mobile-nav").removeClass("td-hide-menu-content")});jQuery("#td-mobile-nav .td-forgot-pass-close a").on("click",function(){tdLoginMob.showHideElements([["#td-login-mob",1],["#td-register-mob",0],["#td-forgot-pass-mob",0]])});jQuery(".td-login-fb-mob").on("click",
function(a){a.preventDefault();a=jQuery(this);tdLoginMob.doFBLoginAction(a)})});var tdLoginMob={};
(function(){tdLoginMob={email_pattern:/^[a-zA-Z0-9][a-zA-Z0-9_\.-]{0,}[a-zA-Z0-9]@[a-zA-Z0-9][a-zA-Z0-9_\.-]{0,}[a-z0-9][\.][a-z0-9]{2,10}$/,handlerLogin:function(){var a=jQuery("#login_email-mob"),b=jQuery("#login_pass-mob"),c=jQuery("#gRecaptchaResponseMobL");if(a.length&&b.length){var d=a.val().trim(),e=b.val().trim(),g=c.attr("data-sitekey"),f="";d&&e?(tdLoginMob.addRemoveClass([".td_display_err",1,"td_display_msg_ok"]),tdLoginMob.showHideMsg(td_please_wait),c.length?grecaptcha.ready(function(){grecaptcha.execute(g,
{action:"submit"}).then(function(a){f=a;tdLoginMob.doAction("td_mod_login",d,"",e,f)})}):tdLoginMob.doAction("td_mod_login",d,"",e)):tdLoginMob.showHideMsg(td_email_user_pass_incorrect)}},handlerRegister:function(){var a=jQuery("#register_email-mob"),b=jQuery("#register_user-mob"),c=jQuery("#gRecaptchaResponseMobR");if(a.length&&b.length){var d=a.val().trim(),e=b.val().trim(),g=c.attr("data-sitekey"),f="";tdLoginMob.email_pattern.test(d)&&e?(tdLoginMob.addRemoveClass([".td_display_err",1,"td_display_msg_ok"]),
tdLoginMob.showHideMsg(td_please_wait),c.length?grecaptcha.ready(function(){grecaptcha.execute(g,{action:"submit"}).then(function(a){f=a;tdLoginMob.doAction("td_mod_register",d,e,"",f)})}):tdLoginMob.doAction("td_mod_register",d,e,"")):tdLoginMob.showHideMsg(td_email_user_incorrect)}},handlerForgotPass:function(){var a=jQuery("#forgot_email-mob");a.length&&(a=a.val().trim(),tdLoginMob.email_pattern.test(a)?(tdLoginMob.addRemoveClass([".td_display_err",1,"td_display_msg_ok"]),tdLoginMob.showHideMsg(td_please_wait),
tdLoginMob.doAction("td_mod_remember_pass",a,"","")):tdLoginMob.showHideMsg(td_email_incorrect))},showHideElements:function(a){if(a.constructor===Array)for(var b=a.length,c=0;c<b;c++)if(a[c].constructor===Array&&2===a[c].length){var d=jQuery(a[c][0]);d.length&&(1===a[c][1]?d.removeClass("td-login-hide").addClass("td-login-show"):d.removeClass("td-login-show").addClass("td-login-hide"))}},addRemoveClass:function(a){if(a.constructor===Array&&3===a.length){var b=jQuery(a[0]);b.length&&(1===a[1]?b.addClass(a[2]):
b.removeClass(a[2]))}},showHideMsg:function(a){var b=jQuery(".td_display_err");b.length&&(void 0!==a&&a.constructor===String&&0<a.length?(b.show(),b.html(a)):(b.hide(),b.html("")))},clearFields:function(){jQuery("#login_email-mob").val("");jQuery("#login_pass-mob").val("");jQuery("#register_email-mob").val("");jQuery("#register_user-mob").val("");jQuery("#forgot_email-mob").val("")},doAction:function(a,b,c,d,e){jQuery.ajax({type:"POST",url:td_ajax_url,data:{action:a,email:b,user:c,pass:d,captcha:e},
success:function(a,b,c){a=jQuery.parseJSON(a);switch(a[0]){case "login":1===a[1]?location.reload(!0):(tdLoginMob.addRemoveClass([".td_display_err",0,"td_display_msg_ok"]),tdLoginMob.showHideMsg(a[2]));break;case "register":1===a[1]?tdLoginMob.addRemoveClass([".td_display_err",1,"td_display_msg_ok"]):tdLoginMob.addRemoveClass([".td_display_err",0,"td_display_msg_ok"]);tdLoginMob.showHideMsg(a[2]);break;case "remember_pass":1===a[1]?tdLoginMob.addRemoveClass([".td_display_err",1,"td_display_msg_ok"]):
tdLoginMob.addRemoveClass([".td_display_err",0,"td_display_msg_ok"]),tdLoginMob.showHideMsg(a[2])}},error:function(a,b,c){}})},doFBLoginAction:function(a){var b=a.closest("#login-form-mobile");b.find(".td_display_err").hide();b.addClass("td-login-form-mobile-fb-open");FB.login(function(a){"connected"===a.status?FB.api("/me?fields=id,name,first_name,last_name,email,picture.type(large),locale",function(a){jQuery.ajax({type:"POST",url:td_ajax_url,data:{action:"td_ajax_fb_login_user",user:a},success:function(a){a=
jQuery.parseJSON(a);""!==a.error?(b.removeClass("td-login-form-mobile-fb-open"),tdLoginMob.addRemoveClass([".td_display_err",0,"td_display_msg_ok"]),tdLoginMob.showHideMsg(a.error)):(""!==a.success&&(tdLoginMob.addRemoveClass([".td_display_err",1,"td_display_msg_ok"]),tdLoginMob.showHideMsg(a.success)),location.reload(!0))}})}):(b.removeClass("td-login-form-mobile-fb-open"),tdLoginMob.addRemoveClass([".td_display_err",0,"td_display_msg_ok"]),tdLoginMob.showHideMsg("An unexpected error has occured. Please try again!"))},
{scope:"public_profile, email"})}}})();
jQuery().ready(function(){var b={type:"inline",preloader:!1,focus:"#name",removalDelay:500,callbacks:{beforeOpen:function(){this.st.mainClass=this.st.el.attr("data-effect");tdLogin.clearFields();tdLogin.showHideMsg();700>jQuery(window).width()?this.st.focus=!1:!1===tdDetect.isIe&&(this.st.focus="#login_email")},beforeClose:function(){}},disableOn:function(){return 750>jQuery(window).width()?!1:!0}};void 0!==window.tdb_login_sing_in_shortcode&&(jQuery(".tdb_header_user .td-login-modal-js").magnificPopup(b),
jQuery(".tdb-head-usr-log").on("click",function(a){750>jQuery(window).width()&&jQuery(a.target).parents("tdb_header_user").length&&(a.preventDefault(),jQuery("body").addClass("td-menu-mob-open-menu"),jQuery(".td-mobile-container").hide(),jQuery("#td-mobile-nav").addClass("td-hide-menu-content"),setTimeout(function(){jQuery(".td-mobile-container").show()},500),tdLogin.showHideElementsMobile([["#td-login-mob",1],["#td-register-mob",0],["#td-forgot-pass-mob",0]]))}));"yes"===window.tdc_is_installed&&
(jQuery(".comment-reply-login").attr({href:"#login-form","data-effect":"mpf-td-login-effect"}),jQuery(".comment-reply-login, .td-login-modal-js").magnificPopup(b));jQuery(".td-login-modal-js, .comment-reply-login").on("click",function(a){750>jQuery(window).width()&&!jQuery(a.target).parents("tdb_header_user").length&&(a.preventDefault(),jQuery("body").addClass("td-menu-mob-open-menu"),jQuery(".td-mobile-container").hide(),jQuery("#td-mobile-nav").addClass("td-hide-menu-content"),setTimeout(function(){jQuery(".td-mobile-container").show()},
500),tdLogin.showHideElementsMobile([["#td-login-mob",1],["#td-register-mob",0],["#td-forgot-pass-mob",0]]))});jQuery("#login-link").on("click",function(){tdLogin.showHideElements([["#td-login-div",1],["#td-register-div",0],["#td-forgot-pass-div",0]]);jQuery("#login-form").addClass("td-login-animation");700<jQuery(window).width()&&!1===tdDetect.isIe&&jQuery("#login_email").focus();tdLogin.showHideMsg()});jQuery("#register-link").on("click",function(){tdLogin.showHideElements([["#td-login-div",0],
["#td-register-div",1],["#td-forgot-pass-div",0]]);jQuery("#login-form").addClass("td-login-animation");700<jQuery(window).width()&&!1===tdDetect.isIe&&jQuery("#register_email").focus();tdLogin.showHideMsg()});jQuery("#forgot-pass-link").on("click",function(a){a.preventDefault();tdLogin.showHideElements([["#td-login-div",0],["#td-register-div",0],["#td-forgot-pass-div",1]]);jQuery("#login-form").addClass("td-login-animation");700<jQuery(window).width()&&!1===tdDetect.isIe&&jQuery("#forgot_email").focus();
tdLogin.showHideMsg()});jQuery("#login_button").on("click",function(){tdLogin.handlerLogin()});jQuery("#login_pass").keydown(function(a){(a.which&&13===a.which||a.keyCode&&13===a.keyCode)&&tdLogin.handlerLogin()});jQuery("#register_button").on("click",function(){tdLogin.handlerRegister()});jQuery("#register_user").keydown(function(a){(a.which&&13===a.which||a.keyCode&&13===a.keyCode)&&tdLogin.handlerRegister()});jQuery("#forgot_button").on("click",function(){tdLogin.handlerForgotPass()});jQuery("#forgot_email").keydown(function(a){(a.which&&
13===a.which||a.keyCode&&13===a.keyCode)&&tdLogin.handlerForgotPass()});jQuery(".td-back-button").on("click",function(){tdLogin.showHideElements([["#td-login-div",1],["#td-register-div",0],["#td-forgot-pass-div",0]]);jQuery("#login-form").removeClass("td-login-animation");jQuery(".td_display_err").hide()});jQuery(".td-login-fb-modal").on("click",function(a){a.preventDefault();a=jQuery(this);tdLogin.doFBLoginAction(a)})});var tdLogin={};
(function(){tdLogin={email_pattern:/^[a-zA-Z0-9][a-zA-Z0-9_\.-]{0,}[a-zA-Z0-9]@[a-zA-Z0-9][a-zA-Z0-9_\.-]{0,}[a-z0-9][\.][a-z0-9]{2,10}$/,pass_pattern:/^(?=.{6,})(?=.*[a-z])(?=.*[A-Z])/,handlerLogin:function(b){b=jQuery("#login_email");var a=jQuery("#login_pass"),c=jQuery("#gRecaptchaResponseL");if(b.length&&a.length){var d=b.val().trim(),e=a.val().trim(),h=c.attr("data-sitekey"),f="";d&&e?(tdLogin.addRemoveClass([".td_display_err",1,"td_display_msg_ok"]),tdLogin.showHideMsg(td_please_wait),c.length?
grecaptcha.ready(function(){grecaptcha.execute(h,{action:"submit"}).then(function(a){f=a;tdLogin.doAction("td_mod_login",d,"",e,f)})}):tdLogin.doAction("td_mod_login",d,"",e)):tdLogin.showHideMsg(td_email_user_pass_incorrect)}},handlerRegister:function(){var b=jQuery("#register_email"),a=jQuery("#register_user"),c=jQuery("#gRecaptchaResponseR");if(b.length&&a.length){var d=b.val().trim(),e=a.val().trim(),h=c.attr("data-sitekey"),f="";tdLogin.email_pattern.test(d)&&e?(tdLogin.addRemoveClass([".td_display_err",
1,"td_display_msg_ok"]),tdLogin.showHideMsg(td_please_wait),c.length?grecaptcha.ready(function(){grecaptcha.execute(h,{action:"submit"}).then(function(a){f=a;tdLogin.doAction("td_mod_register",d,e,"",f)})}):tdLogin.doAction("td_mod_register",d,e,"")):tdLogin.showHideMsg(td_email_user_incorrect)}},handlerForgotPass:function(){var b=jQuery("#forgot_email");b.length&&(b=b.val().trim(),tdLogin.email_pattern.test(b)?(tdLogin.addRemoveClass([".td_display_err",1,"td_display_msg_ok"]),tdLogin.showHideMsg(td_please_wait),
tdLogin.doAction("td_mod_remember_pass",b,"","")):tdLogin.showHideMsg(td_email_incorrect))},showHideElements:function(b){if(b.constructor===Array)for(var a=b.length,c=0;c<a;c++)if(b[c].constructor===Array&&2===b[c].length){var d=jQuery(b[c][0]);d.length&&(1===b[c][1]?d.removeClass("td-display-none").addClass("td-display-block"):d.removeClass("td-display-block").addClass("td-display-none"))}},showHideElementsMobile:function(b){if(b.constructor===Array)for(var a=b.length,c=0;c<a;c++)if(b[c].constructor===Array&&2===b[c].length){var d=jQuery(b[c][0]);d.length&&(1===b[c][1]?d.removeClass("td-login-hide").addClass("td-login-show"):d.removeClass("td-login-show").addClass("td-login-hide"))}},showTabs:function(b){if(b.constructor===Array)for(var a=b.length,c=0;c<a;c++)if(b[c].constructor===Array&&2===b[c].length){var d=jQuery(b[c][0]);d.length&&(1===b[c][1]?d.addClass("td_login_tab_focus"):d.removeClass("td_login_tab_focus"))}},addRemoveClass:function(b){if(b.constructor===Array&&3===b.length){var a=jQuery(b[0]);
a.length&&(1===b[1]?a.addClass(b[2]):a.removeClass(b[2]))}},showHideMsg:function(b){var a=jQuery(".td_display_err");a.length&&(void 0!==b&&b.constructor===String&&0<b.length?(a.show(),a.html(b)):(a.hide(),a.html("")))},clearFields:function(){jQuery("#login_email").val("");jQuery("#login_pass").val("");jQuery("#register_email").val("");jQuery("#register_user").val("");jQuery("#forgot_email").val("")},doAction:function(b,a,c,d,e){jQuery.ajax({type:"POST",url:td_ajax_url,data:{action:b,email:a,user:c,
pass:d,captcha:e},success:function(a,b,c){a=jQuery.parseJSON(a);switch(a[0]){case "login":1===a[1]?location.reload(!0):(tdLogin.addRemoveClass([".td_display_err",0,"td_display_msg_ok"]),tdLogin.showHideMsg(a[2]));break;case "register":1===a[1]?tdLogin.addRemoveClass([".td_display_err",1,"td_display_msg_ok"]):tdLogin.addRemoveClass([".td_display_err",0,"td_display_msg_ok"]);tdLogin.showHideMsg(a[2]);break;case "remember_pass":1===a[1]?tdLogin.addRemoveClass([".td_display_err",1,"td_display_msg_ok"]):
tdLogin.addRemoveClass([".td_display_err",0,"td_display_msg_ok"]),tdLogin.showHideMsg(a[2])}},error:function(a,b,c){}})},doCustomAction:function(b,a,c,d,e,h){a={action:b,email:a,user:c,pass:d,retype_pass:e,captcha:h};switch(b){case "td_mod_login":var f=jQuery("#tds-login-div");b=f.closest(".tds-block-inner").find("#tds_login_button");f.find(".td_display_err").hide();b.addClass("tds-s-btn-saving");break;case "td_mod_subscription_register":var g=jQuery("#tds-register-div");b=g.closest(".tds-block-inner").find("#tds_register_button");
g.find(".td_display_err").hide();b.addClass("tds-s-btn-saving");break;case "td_mod_subscription_reset_pass":var k=jQuery("#tds-reset-pass-div");b=k.closest(".tds-block-inner").find("#tds_reset_button");k.find(".td_display_err").hide();b.addClass("tds-s-btn-saving")}jQuery.ajax({type:"POST",url:td_ajax_url,data:a,success:function(a,b,c){a=jQuery.parseJSON(a);switch(a[0]){case "login":f.length&&f.closest(".tds-block-inner").find("#tds_login_button").removeClass("tds-s-btn-saving");if(1===a[1]){if(f.length){var d=
new URLSearchParams((new URL(window.location.href)).search.slice(1));d.has("ref_url")?(a=f.closest(".tds-block-inner").find("#tds_login_button"),a.length&&(a.attr("disabled",!0),window.location.replace(window.atob(d.get("ref_url").replace("=",""))))):(a=f.closest(".tds-block-inner").find("#tds_login_button"),d=f.closest(".tds-block-inner").find("#tds-my-account"),a.length&&a.attr("disabled",!0),d.length&&window.location.replace(d.val()))}}else tdLogin.addRemoveClass([".td_display_err",0,"td_display_msg_ok"]),
f.length&&(tdLogin.addRemoveClass([".td_display_err",0,"tds-s-notif-success"]),tdLogin.addRemoveClass([".td_display_err",1,"tds-s-notif-error"])),tdLogin.showHideMsg(a[2]);break;case "register":g.length&&g.closest(".tds-block-inner").find("#tds_register_button").removeClass("tds-s-btn-saving");if(1===a[1]){if(tdLogin.addRemoveClass([".td_display_err",1,"td_display_msg_ok"]),tdLogin.addRemoveClass([".td_display_err",1,"tds-s-notif-success"]),tdLogin.addRemoveClass([".td_display_err",0,"tds-s-notif-error"]),
g.length){d=new URLSearchParams((new URL(window.location.href)).search.slice(1));if(d.has("ref_url")){var e=g.find("#tds-continue-subscription");b=g.closest(".tds-block-inner").find("#tds_register_button");c=g.closest(".tds-block-inner").find(".tds-s-cal-page-switch");e.length&&e.show().attr("href",window.atob(d.get("ref_url").replace("=","")));b.length&&b.hide();c.length&&c.hide()}else b=g.closest(".tds-block-inner").find("#tds_register_button"),c=g.closest(".tds-block-inner").find(".tds-s-cal-page-switch"),
d=g.closest(".tds-block-inner").find("#tds-my-account"),e=g.closest(".tds-block-inner").find("#tds-my-account-register"),b.length&&b.hide(),c.length&&c.hide(),d.length&&d.show(),e.length&&e.data("enabled")&&window.location.replace(e.val());g.find(".tds-s-form-content .tds-s-fc-inner").hide()}}else tdLogin.addRemoveClass([".td_display_err",0,"td_display_msg_ok"]),tdLogin.addRemoveClass([".td_display_err",0,"tds-s-notif-success"]),tdLogin.addRemoveClass([".td_display_err",1,"tds-s-notif-error"]);tdLogin.showHideMsg(a[2]);
break;case "remember_pass":1===a[1]?tdLogin.addRemoveClass([".td_display_err",1,"td_display_msg_ok"]):tdLogin.addRemoveClass([".td_display_err",0,"td_display_msg_ok"]);tdLogin.showHideMsg(a[2]);break;case "reset_pass":k.length&&k.closest(".tds-block-inner").find("#tds_reset_button").removeClass("tds-s-btn-saving"),1===a[1]?(tdLogin.addRemoveClass([".td_display_err",1,"td_display_msg_ok"]),tdLogin.addRemoveClass([".td_display_err",1,"tds-s-notif-success"]),tdLogin.addRemoveClass([".td_display_err",
0,"tds-s-notif-error"]),k.length&&setTimeout(function(){window.location.replace(h)},1E3)):(tdLogin.addRemoveClass([".td_display_err",0,"td_display_msg_ok"]),tdLogin.addRemoveClass([".td_display_err",0,"tds-s-notif-success"]),tdLogin.addRemoveClass([".td_display_err",1,"tds-s-notif-error"])),tdLogin.showHideMsg(a[2])}},error:function(a,b,c){}})},doFBLoginAction:function(b){var a=b.closest(".td-login-wrap");a.find(".td_display_err").hide();a.addClass("td-login-wrap-fb-open");FB.login(function(b){"connected"===b.status?FB.api("/me?fields=id,name,first_name,last_name,email,locale",function(b){jQuery.ajax({type:"POST",url:td_ajax_url,data:{action:"td_ajax_fb_login_user",user:b},success:function(b){b=jQuery.parseJSON(b);""!==b.error?(a.removeClass("td-login-wrap-fb-open"),tdLogin.addRemoveClass([".td_display_err",0,"td_display_msg_ok"]),tdLogin.showHideMsg(b.error)):(""!==b.success&&(tdLogin.addRemoveClass([".td_display_err",1,"td_display_msg_ok"]),tdLogin.showHideMsg(b.success)),location.reload(!0))}})}):
(a.removeClass("td-login-wrap-fb-open"),tdLogin.addRemoveClass([".td_display_err",0,"td_display_msg_ok"]),tdLogin.showHideMsg("An unexpected error has occured. Please try again!"))},{scope:"public_profile, email"})},doFBLoginActionOptIn:function(b,a){var c=a.closest(".tds-block-inner");a=c.find(".tds-s-form");var d="";switch(b){case "login":d=a.find("#tds-my-account").val();break;case "register":d=a.find("#tds-my-account-register").val()}a.find(".td_display_err").hide();c.addClass("tds-s-fb-open");
FB.login(function(a){"connected"===a.status?FB.api("/me?fields=id,name,first_name,last_name,email,locale",function(a){jQuery.ajax({type:"POST",url:td_ajax_url,data:{action:"td_ajax_fb_login_user",user:a},success:function(a){a=jQuery.parseJSON(a);if(""!==a.error)c.removeClass("tds-s-fb-open"),tdLogin.addRemoveClass([".td_display_err",0,"td_display_msg_ok"]),tdLogin.addRemoveClass([".td_display_err",0,"tds-s-notif-success"]),tdLogin.addRemoveClass([".td_display_err",1,"tds-s-notif-error"]),tdLogin.showHideMsg(a.error);
else{""!==a.success&&(tdLogin.addRemoveClass([".td_display_err",1,"td_display_msg_ok"]),tdLogin.addRemoveClass([".td_display_err",1,"tds-s-notif-success"]),tdLogin.addRemoveClass([".td_display_err",0,"tds-s-notif-error"]),tdLogin.showHideMsg(a.success));var b=new URLSearchParams((new URL(window.location.href)).search.slice(1));setTimeout(function(){b.has("ref_url")?window.location.replace(window.atob(b.get("ref_url").replace("=",""))):window.location.replace(d)},200)}}})}):(c.removeClass("tds-s-fb-open"),
tdLogin.addRemoveClass([".td_display_err",0,"td_display_msg_ok"]),tdLogin.addRemoveClass([".td_display_err",0,"tds-s-notif-success"]),tdLogin.addRemoveClass([".td_display_err",1,"tds-s-notif-error"]),tdLogin.showHideMsg("An unexpected error has occured. Please try again!"))},{scope:"public_profile, email"})}}})();
var tdMenu={};
(function(){tdMenu={_itemsWithSubmenu:null,_mainMenu:null,_outsideClickArea:null,_outsideClickExcludedAreas:"#td-header-menu .sf-menu, #td-header-menu .sf-menu *, .menu-top-container, .menu-top-container *",_openMenuClass:"sfHover",_openMenuBodyClass:"td-open-menu",init:function(){var c=jQuery("#td-header-menu .sf-menu"),e=jQuery("#td-header-menu .sf-menu, .top-header-menu"),b=e.find(".menu-item-has-children > a, .td-mega-menu > a");b.append('<i class="td-icon-menu-down"></i>');c.supersubs({minWidth:10,maxWidth:20,
extraWidth:1});b.addClass("sf-with-ul");e.addClass("sf-js-enabled");b.parent().find("ul").first().css("display","none");tdMenu._mainMenu=c;tdMenu._itemsWithSubmenu=b;tdMenu._outsideClickArea=jQuery(window).not(tdMenu._outsideClickExcludedAreas);tdMenu._setHover(b,c)},_getSubmenuPosition:function(c){var e=jQuery(window).width();c=c.children("ul").first();if(0<c.length){var b=c.offset().left+c.width();b>e&&(c.parent().parent().hasClass("sf-menu")?c.css("left","-"+(b-e)+"px"):c.addClass("reversed").css("left",
"-"+(c.width()+0)+"px"))}},_getMouseAngleDirection:function(c,e,b,l){return Math.atan2(b-c,l-e)/Math.PI*180},_setHover:function(c,e){if(tdDetect.isTouchDevice)jQuery(document).on("touchstart","body",function(a){var d=c.parent(),b=jQuery("body");b.hasClass(tdMenu._openMenuBodyClass)&&!d.is(a.target)&&0===d.has(a.target).length&&(d.removeClass(tdMenu._openMenuClass),d.children("ul").hide(),b.removeClass(tdMenu._openMenuBodyClass))}),c.on("touchstart",function(a){a.preventDefault();a.stopPropagation();
var b=jQuery(this);a=b.parent();var f=jQuery("body");a.hasClass(tdMenu._openMenuClass)?null!==b.attr("href")&&"#"!==b.attr("href")?window.location.href=b.attr("href"):((a.parent().hasClass("sf-menu")||a.parent().hasClass("top-header-menu"))&&f.removeClass(tdMenu._openMenuBodyClass),a.removeClass(tdMenu._openMenuClass),a.find("ul").hide(),a.find("li").removeClass(tdMenu._openMenuClass)):(a.parent().hasClass("sf-menu")||a.parent().hasClass("top-header-menu")?(c.parent().removeClass(tdMenu._openMenuClass),
c.parent().children("ul").hide()):(b=a.siblings(),b.removeClass(tdMenu._openMenuClass),b.find("ul").hide(),b.find("li").removeClass(tdMenu._openMenuClass)),a.addClass(tdMenu._openMenuClass),a.children("ul").show(),tdMenu._getSubmenuPosition(a),f.addClass(tdMenu._openMenuBodyClass))});else{var b={},l,k=!0;e.on("mouseleave",function(){c.parent().removeClass(tdMenu._openMenuClass);c.parent().children("ul").hide();b={}});e.find(".menu-item").hover(function(){var a=jQuery(this),d="",f,e;if(a.hasClass("menu-item-has-children")||
a.hasClass("td-mega-menu"))if(a.parent().hasClass("sf-menu"))if(jQuery.isEmptyObject(b))a.addClass(tdMenu._openMenuClass),a.children("ul").show(),b=a;else{if(a[0]!==b[0]){var g=e=f=0;var h=null;!0===k&&(k=!1,l=setTimeout(function(){c.parent().removeClass(tdMenu._openMenuClass);c.parent().children("ul").hide();a.addClass(tdMenu._openMenuClass);a.children("ul").show();b=a},400));a.on("mousemove",function(d){5<=f?(f=0,h=tdMenu._getMouseAngleDirection(e,g,d.pageX,d.pageY),e=d.pageX,g=d.pageY):(f++,0===e&&0===g&&(e=d.pageX,g=d.pageY));null!==h&&(85<h||-85>h)&&(c.parent().removeClass(tdMenu._openMenuClass),c.parent().children("ul").hide(),a.addClass(tdMenu._openMenuClass),a.children("ul").show(),a.off("mousemove"),clearTimeout(l),k=!0,b=a)})}}else d=a.siblings(),d.removeClass(tdMenu._openMenuClass),d.find("ul").hide(),d.find("li").removeClass(tdMenu._openMenuClass),a.addClass(tdMenu._openMenuClass),a.children("ul").show(),tdMenu._getSubmenuPosition(a);else a.parent().hasClass("sf-menu")||a.parent().hasClass("top-header-menu")?
jQuery.isEmptyObject(b)||(g=e=f=0,h=null,!0===k&&(k=!1,l=setTimeout(function(){c.parent().removeClass(tdMenu._openMenuClass);c.parent().children("ul").hide();b={}},400)),a.on("mousemove",function(d){5<=f?(f=0,h=tdMenu._getMouseAngleDirection(e,g,d.pageX,d.pageY),e=d.pageX,g=d.pageY):(f++,0===e&&0===g&&(e=d.pageX,g=d.pageY));null!==h&&(85<h||-85>h)&&(c.parent().removeClass(tdMenu._openMenuClass),c.parent().children("ul").hide(),a.off("mousemove"),clearTimeout(l),k=!0,b={})})):(b=a.parent(),d=a.siblings(),
d.removeClass(tdMenu._openMenuClass),d.find("ul").hide(),d.find("li").removeClass(tdMenu._openMenuClass))},function(){var a=jQuery(this);!1===k&&(clearTimeout(l),k=!0);a.off("mousemove")})}},unsetHover:function(){null!==tdMenu._itemsWithSubmenu&&tdMenu._itemsWithSubmenu.off();null!==tdMenu._outsideClickArea&&tdMenu._outsideClickArea.off()}}})();jQuery().ready(function(){tdMenu.init()});
var tdAjaxSearch={};jQuery().ready(function(){tdAjaxSearch.init()});
(function(){tdAjaxSearch={_current_selection_index:0,_last_request_results_count:0,_first_down_up:!0,_is_search_open:!1,_is_mob_live_search_active:!0,_blockAtts:void 0,init:function(){jQuery(document).on("click",function(a){"td-icon-search"!==a.target.className&&"td-header-search"!==a.target.id&&"td-header-search-top"!==a.target.id&&!0===tdAjaxSearch._is_search_open&&tdAjaxSearch.hide_search_box()});jQuery("#td-header-search-button").on("click",function(a){a.preventDefault();a.stopPropagation();!0===tdAjaxSearch._is_search_open?tdAjaxSearch.hide_search_box():tdAjaxSearch.show_search_box()});jQuery("#td-header-search-button-mob, .tdb-header-search-button-mob").on("click",function(a){if("disabled"!==window.tdMobileSearch){jQuery("body").addClass("td-search-opened");var b=jQuery("#td-header-search-mob");setTimeout(function(){b.focus();var a=b.val();b.val("");b.val(a)},1300);tdAjaxSearch._is_mob_live_search_active&&0<b.val().trim().length&&tdAjaxSearch.do_ajax_call_mob()}});jQuery(".td-search-close span").on("click",
function(){jQuery("body").removeClass("td-search-opened")});jQuery("#td-header-search").keydown(function(a){if(a.which&&39===a.which||a.keyCode&&39===a.keyCode||a.which&&37===a.which||a.keyCode&&37===a.keyCode)tdAjaxSearch.td_aj_search_input_focus();else{if(a.which&&13===a.which||a.keyCode&&13===a.keyCode)return a=jQuery(".td-aj-cur-element"),0<a.length?(a=a.find(".entry-title a").attr("href"),window.location=a):jQuery(this).parent().parent().submit(),!1;if(a.which&&40===a.which||a.keyCode&&40===a.keyCode)return tdAjaxSearch.move_prompt_down(),!1;if(a.which&&38===a.which||a.keyCode&&38===a.keyCode)return tdAjaxSearch.move_prompt_up(),!1;(a.which&&8===a.which||a.keyCode&&8===a.keyCode)&&1===jQuery(this).val().length&&jQuery("#td-aj-search").empty();tdAjaxSearch.td_aj_search_input_focus();setTimeout(function(){tdAjaxSearch.do_ajax_call()},100);return!0}});jQuery("#td-header-search-mob").keydown(function(a){if(a.which&&13===a.which||a.keyCode&&13===a.keyCode)return a=jQuery(".td-aj-cur-element"),
0<a.length?window.location=a.find(".entry-title a").attr("href"):jQuery(this).parent().parent().submit(),!1;(a.which&&8===a.which||a.keyCode&&8===a.keyCode)&&1===jQuery(this).val().length&&jQuery("#td-aj-search-mob").empty();tdAjaxSearch._is_mob_live_search_active&&setTimeout(function(){tdAjaxSearch.do_ajax_call_mob()},100);return!0})},show_search_box:function(){jQuery(".td-drop-down-search").addClass("td-drop-down-search-open");!0!==tdDetect.isIos&&setTimeout(function(){document.getElementById("td-header-search").focus()},
200);tdAjaxSearch._is_search_open=!0},hide_search_box:function(){jQuery(".td-drop-down-search").removeClass("td-drop-down-search-open");tdAjaxSearch._is_search_open=!1},move_prompt_up:function(){!0===tdAjaxSearch._first_down_up?(tdAjaxSearch._first_down_up=!1,0===tdAjaxSearch._current_selection_index?tdAjaxSearch._current_selection_index=tdAjaxSearch._last_request_results_count-1:tdAjaxSearch._current_selection_index--):0===tdAjaxSearch._current_selection_index?tdAjaxSearch._current_selection_index=
tdAjaxSearch._last_request_results_count:tdAjaxSearch._current_selection_index--;tdAjaxSearch._repaintCurrentElement()},move_prompt_down:function(){!0===tdAjaxSearch._first_down_up?tdAjaxSearch._first_down_up=!1:tdAjaxSearch._current_selection_index===tdAjaxSearch._last_request_results_count?tdAjaxSearch._current_selection_index=0:tdAjaxSearch._current_selection_index++;tdAjaxSearch._repaintCurrentElement()},_repaintCurrentElement:function(){jQuery(".td_module_wrap").removeClass("td-aj-cur-element");
tdAjaxSearch._current_selection_index>tdAjaxSearch._last_request_results_count-1?jQuery(".td-search-form").fadeTo(100,1):(tdAjaxSearch.td_aj_search_input_remove_focus(),jQuery(".td_module_wrap").eq(tdAjaxSearch._current_selection_index).addClass("td-aj-cur-element"))},td_aj_search_input_focus:function(){tdAjaxSearch._current_selection_index=0;tdAjaxSearch._first_down_up=!0;jQuery(".td-search-form").fadeTo(100,1);jQuery(".td_module_wrap").removeClass("td-aj-cur-element")},td_aj_search_input_remove_focus:function(){0!==tdAjaxSearch._last_request_results_count&&jQuery(".td-search-form").css("opacity",.5)},process_ajax_response:function(a){var b=jQuery("#td-header-search").val();""===b?jQuery("#td-aj-search").empty():(a=jQuery.parseJSON(a),a.td_search_query===b&&(tdAjaxSearch._current_selection_index=0,tdAjaxSearch._last_request_results_count=a.td_total_in_list,tdAjaxSearch._first_down_up=!0,jQuery("#td-aj-search").html(a.td_data),"undefined"!==typeof window.tdAnimationStack&&!0===window.tdAnimationStack.activated&&
(window.tdAnimationStack.check_for_new_items("#td-aj-search .td-animation-stack",window.tdAnimationStack.SORTED_METHOD.sort_left_to_right,!0,!1),window.tdAnimationStack.compute_items(!1))))},process_ajax_response_mob:function(a){var b=jQuery("#td-header-search-mob").val();""===b?jQuery("#td-aj-search-mob").empty():(a=jQuery.parseJSON(a),a.td_search_query===b&&(jQuery("#td-aj-search-mob").html(a.td_data),"undefined"!==typeof window.tdAnimationStack&&!0===window.tdAnimationStack.activated&&(window.tdAnimationStack.check_for_new_items("#td-aj-search-mob .td-animation-stack",
window.tdAnimationStack.SORTED_METHOD.sort_left_to_right,!0,!1),window.tdAnimationStack.compute_items(!1))))},do_ajax_call:function(){var a=jQuery("#td-header-search").val();""===a?tdAjaxSearch.td_aj_search_input_focus():tdLocalCache.exist(a)?tdAjaxSearch.process_ajax_response(tdLocalCache.get(a)):jQuery.ajax({type:"POST",url:td_ajax_url,data:{action:"td_ajax_search",td_string:a},success:function(b,c,d){tdLocalCache.set(a,b);tdAjaxSearch.process_ajax_response(b)},error:function(a,c,d){}})},do_ajax_call_mob:function(){var a=
jQuery("#td-header-search-mob").val();""!==a&&(tdLocalCache.exist(a)?tdAjaxSearch.process_ajax_response_mob(tdLocalCache.get(a)):jQuery.ajax({type:"POST",url:td_ajax_url,data:{action:"td_ajax_search",atts:this._blockAtts,td_string:a},success:function(b,c,d){tdLocalCache.set(a,b);tdAjaxSearch.process_ajax_response_mob(b)},error:function(a,c,d){}}))}}})();