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()}});
(function(){
var supportsPassive=false;
try {
var opts=Object.defineProperty({}, 'passive', {
get:function(){
supportsPassive=true;
}});
window.addEventListener('testPassive', null, opts);
window.removeEventListener('testPassive', null, opts);
} catch(e){}
function init(){
var input_begin='';
var keydowns={};
var lastKeyup=null;
var lastKeydown=null;
var keypresses=[];
var modifierKeys=[];
var correctionKeys=[];
var lastMouseup=null;
var lastMousedown=null;
var mouseclicks=[];
var mouseclickCoordinates=[];
var mousemoveTimer=null;
var lastMousemoveX=null;
var lastMousemoveY=null;
var mousemoveStart=null;
var mousemoves=[];
var touchmoveCountTimer=null;
var touchmoveCount=0;
var lastTouchEnd=null;
var lastTouchStart=null;
var touchEvents=[];
var scrollCountTimer=null;
var scrollCount=0;
var correctionKeyCodes=[ 'Backspace', 'Delete', 'ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight', 'Home', 'End', 'PageUp', 'PageDown' ];
var modifierKeyCodes=[ 'Shift', 'CapsLock' ];
var forms=document.querySelectorAll('form[method=post]');
for(var i=0; i < forms.length; i++){
var form=forms[i];
var formAction=form.getAttribute('action');
if(formAction){
if(formAction.indexOf('http://')==0||formAction.indexOf('https://')==0){
if(formAction.indexOf('http://' + window.location.hostname + '/')!=0&&formAction.indexOf('https://' + window.location.hostname + '/')!=0){
continue;
}}
}
form.addEventListener('submit', function (){
var ak_bkp=prepare_array_for_request(keypresses);
var ak_bmc=prepare_array_for_request(mouseclicks);
var ak_bte=prepare_array_for_request(touchEvents);
var ak_bmm=prepare_array_for_request(mousemoves);
var ak_bcc=prepare_array_for_request(mouseclickCoordinates);
var input_fields={
'bib': input_begin,
'bfs': Date.now(),
'bkpc': keypresses.length,
'bkp': ak_bkp,
'bmc': ak_bmc,
'bmcc': mouseclicks.length,
'bmk': modifierKeys.join(';'),
'bck': correctionKeys.join(';'),
'bmmc': mousemoves.length,
'btmc': touchmoveCount,
'bsc': scrollCount,
'bte': ak_bte,
'btec':touchEvents.length,
'bmm':ak_bmm,
'bcc':ak_bcc
};
var akismet_field_prefix='ak_';
if(this.getElementsByClassName){
var possible_akismet_containers=this.getElementsByClassName('akismet-fields-container');
for(var containerIndex=0; containerIndex < possible_akismet_containers.length; containerIndex++){
var container=possible_akismet_containers.item(containerIndex);
if(container.getAttribute('data-prefix') ){
akismet_field_prefix=container.getAttribute('data-prefix');
break;
}}
}
for(var field_name in input_fields){
var field=document.createElement('input');
field.setAttribute('type', 'hidden');
field.setAttribute('name', akismet_field_prefix + field_name);
field.setAttribute('value', input_fields[ field_name ]);
this.appendChild(field);
}}, supportsPassive ? { passive: true }:false);
form.addEventListener('keydown', function(e){
if(e.key in keydowns){
return;
}
var keydownTime=(new Date()).getTime();
keydowns[ e.key ]=[ keydownTime ];
if(! input_begin){
input_begin=keydownTime;
}
var lastKeyEvent=Math.max(lastKeydown, lastKeyup);
if(lastKeyEvent){
keydowns[ e.key ].push(keydownTime - lastKeyEvent);
}
lastKeydown=keydownTime;
}, supportsPassive ? { passive: true }:false);
form.addEventListener('keyup', function(e){
if(!(e.key in keydowns) ){
return;
}
var keyupTime=(new Date()).getTime();
if('TEXTAREA'===e.target.nodeName||'INPUT'===e.target.nodeName){
if(-1!==modifierKeyCodes.indexOf(e.key) ){
modifierKeys.push(keypresses.length - 1);
}else if(-1!==correctionKeyCodes.indexOf(e.key) ){
correctionKeys.push(keypresses.length - 1);
}else{
var keydownTime=keydowns[ e.key ][0];
var keypress=[];
keypress.push(keyupTime - keydownTime);
if(keydowns[ e.key ].length > 1){
keypress.push(keydowns[ e.key ][1]);
}
keypresses.push(keypress);
}}
delete keydowns[ e.key ];
lastKeyup=keyupTime;
}, supportsPassive ? { passive: true }:false);
form.addEventListener("focusin", function(e){
lastKeydown=null;
lastKeyup=null;
keydowns={};}, supportsPassive ? { passive: true }:false);
form.addEventListener("focusout", function(e){
lastKeydown=null;
lastKeyup=null;
keydowns={};}, supportsPassive ? { passive: true }:false);
}
document.addEventListener('mousedown', function(e){
lastMousedown=(new Date()).getTime();
var mouseclickCoordinate=[];
var rect=e.target.getBoundingClientRect();
var relativeX=e.clientX - rect.left;
var relativeY=e.clientY - rect.top;
mouseclickCoordinate.push(Math.round(relativeX) );
mouseclickCoordinate.push(Math.round(relativeY) );
mouseclickCoordinate.push(rect.width > 0 ? Math.round(relativeX / rect.width * 100):0);
mouseclickCoordinate.push(rect.height > 0 ? Math.round(relativeY / rect.height * 100):0);
mouseclickCoordinates.push(mouseclickCoordinate);
}, supportsPassive ? { passive: true }:false);
document.addEventListener('mouseup', function(e){
if(! lastMousedown){
return;
}
var now=(new Date()).getTime();
var mouseclick=[];
mouseclick.push(now - lastMousedown);
if(lastMouseup){
mouseclick.push(lastMousedown - lastMouseup);
}
mouseclicks.push(mouseclick);
lastMouseup=now;
lastKeydown=null;
lastKeyup=null;
keydowns={};}, supportsPassive ? { passive: true }:false);
document.addEventListener('mousemove', function(e){
if(mousemoveTimer){
clearTimeout(mousemoveTimer);
mousemoveTimer=null;
}else{
mousemoveStart=(new Date()).getTime();
lastMousemoveX=e.offsetX;
lastMousemoveY=e.offsetY;
}
mousemoveTimer=setTimeout(function(theEvent, originalMousemoveStart){
var now=(new Date()).getTime() - 500;
var mousemove=[];
mousemove.push(now - originalMousemoveStart);
mousemove.push(Math.round(Math.sqrt(Math.pow(theEvent.offsetX - lastMousemoveX, 2) +
Math.pow(theEvent.offsetY - lastMousemoveY, 2)
)
)
);
if(mousemove[1] > 0){
mousemoves.push(mousemove);
}
mousemoveStart=null;
mousemoveTimer=null;
}, 500, e, mousemoveStart);
}, supportsPassive ? { passive: true }:false);
document.addEventListener('touchmove', function(e){
if(touchmoveCountTimer){
clearTimeout(touchmoveCountTimer);
}
touchmoveCountTimer=setTimeout(function (){
touchmoveCount++;
}, 500);
}, supportsPassive ? { passive: true }:false);
document.addEventListener('touchstart', function(e){
lastTouchStart=(new Date()).getTime();
}, supportsPassive ? { passive: true }:false);
document.addEventListener('touchend', function(e){
if(! lastTouchStart){
return;
}
var now=(new Date()).getTime();
var touchEvent=[];
touchEvent.push(now - lastTouchStart);
if(lastTouchEnd){
touchEvent.push(lastTouchStart - lastTouchEnd);
}
touchEvents.push(touchEvent);
lastTouchEnd=now;
lastKeydown=null;
lastKeyup=null;
keydowns={};}, supportsPassive ? { passive: true }:false);
document.addEventListener('scroll', function(e){
if(scrollCountTimer){
clearTimeout(scrollCountTimer);
}
scrollCountTimer=setTimeout(function (){
scrollCount++;
}, 500);
}, supportsPassive ? { passive: true }:false);
}
function prepare_array_for_request(a, limit){
if(! limit){
limit=100;
}
var rv='';
if(a.length > 0){
var random_starting_point=Math.max(0, Math.floor(Math.random() * a.length - limit) );
for(var i=0; i < limit&&i < a.length; i++){
var entry=a[ random_starting_point + i ];
rv +=entry.join(',') + ';';
}}
return rv;
}
if(document.readyState!=='loading'){
init();
}else{
document.addEventListener('DOMContentLoaded', init);
}})();
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)}}})();
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){}}))}}})();
var tdbMenu={};
(function(){tdbMenu={ui_events:"mouseover click keydown wheel touchmove touchstart".split(" "),items:[],item:function(){this.blockAtts=this.blockUid="";this._outsideClickArea=this._mainMenu=this._itemsWithSubmenu=null;this._outsideClickExcludedAreas="";this._openMenuClass="tdb-hover";this._openMenuBodyClass="tdb-open-menu";this.isMegaMenuParentPos=this.isMegaMenuFull=this.inComposer=!1;this.megaMenuLoadType="";this._is_initialized=!1},init:function(){tdbMenu.items=[]},_initialize_item:function(a){if(!0!==a._is_initialized){tdbMenu._setHover(a);
var b=0<jQuery("."+a.blockUid).parents(".td-header-template-wrap").length,e=a.jqueryObj.find(".tdb-menu .tdb-mega-menu .sub-menu"),d=a.jqueryObj.find(".tdb-menu .tdb-mega-menu-page .sub-menu"),f=a.jqueryObj.find(".tdb-menu .tdb-mega-menu-cat .sub-menu");0<e.length&&(window.tdb_p_autoload_vars.isAjax?b||(a.isMegaMenuFull&&tdbMenu.megaMenuFull(a,a.inComposer),a.isMegaMenuParentPos&&tdbMenu.megaMenuParentPos(a,a.inComposer)):(a.isMegaMenuFull&&tdbMenu.megaMenuFull(a,a.inComposer),a.isMegaMenuParentPos&&
tdbMenu.megaMenuParentPos(a,a.inComposer)));if("ui_delayed"===a.megaMenuLoadType&&!a.inComposer&&(0<d.length||0<f.length))a.jqueryObj.on("ui_delayed_load",function(){0<d.length&&tdbMenu.loadDelayedPageMM(a);0<f.length&&tdbMenu.loadDelayedCatMM(a)});0<d.length&&0<jQuery("."+a.blockUid).parents(".tdc-row-is-sticky").length&&(window.tdb_p_autoload_vars.isAjax?b||tdbMenu.pageMegaMenuHeight(a,a.inComposer):tdbMenu.pageMegaMenuHeight(a,a.inComposer));a._is_initialized=!0}},loadDelayed:function(a){for(a=
0;a<tdbMenu.items.length;a++){var b=tdbMenu.items[a];"ui_delayed"!==b.megaMenuLoadType||b.inComposer||b.jqueryObj.trigger("ui_delayed_load")}tdbMenu.ui_events.forEach(function(a){window.removeEventListener(a,tdbMenu.loadDelayed,{passive:!0})})},loadDelayedPageMM:function(a){a.jqueryObj.find(".tdb-menu .tdb-mega-menu-page").each(function(){var a=jQuery(this).find("li.menu-item-0"),e=a.find(".tdb-menu-item-text"),d=a.data("p-mm-id");jQuery.ajax({type:"POST",url:td_ajax_url,data:{action:"tdb_get_mm_page",
pageId:d,td_res_context_registered_atts:td_res_context_registered_atts},success:function(a,b,c){a=jQuery.parseJSON(a);"undefined"!==typeof a.content&&(jQuery(a.content).appendTo(e),"undefined"!==typeof window.tdAnimationStack&&!0===window.tdAnimationStack.activated&&window.tdAnimationStack.reinit())},error:function(a,b,c){console.group("%c tdbMenu.loadDelayedPageMM/tdb_get_mm_page: error","color: orangered;");console.log("Post: ",{pageId:d});console.log("errorThrown: ",c);console.groupEnd()}})})},
loadDelayedCatMM:function(a){a.jqueryObj.find(".tdb-menu .tdb-mega-menu-cat").each(function(){var b=jQuery(this).find("li.menu-item-0"),e=b.find(".tdb-menu-item-text"),d=b.data("cat-mm-id");jQuery.ajax({type:"POST",url:td_ajax_url,data:{action:"tdb_get_mm_cat",td_block_atts:a.blockAtts,cat_mm_id:d},success:function(a,b,c){a=jQuery.parseJSON(a);"undefined"!==typeof a.content&&(jQuery(a.content).appendTo(e),"undefined"!==typeof window.tdAnimationStack&&!0===window.tdAnimationStack.activated&&window.tdAnimationStack.reinit())},
error:function(a,b,c){console.group("%c tdbMenu.loadDelayedCatMM/tdb_get_mm_cat: error","color: orangered;");console.log("Post: ",{cat_mm_id:d});console.log("errorThrown: ",c);console.groupEnd()}})})},addItem:function(a){if("undefined"===typeof a.blockUid)throw"item.blockUid is not defined";tdbMenu.items.push(a);tdbMenu._initialize_item(a)},deleteItem:function(a){for(var b=0;b<tdbMenu.items.length;b++)if(tdbMenu.items[b].blockUid===a)return tdbMenu.items.splice(b,1),!0;return!1},megaMenuFull:function(a,
b){function e(){k=d.find(".tdb-menu .tdb-mega-menu .sub-menu");k.each(function(){c=-f.left+"px";jQuery(this).attr("style","left:"+c+"; width: "+jQuery("body").outerWidth()+"px !important")});h||(d.find(".tdb-mega-menu-inactive").removeClass("tdb-mega-menu-inactive"),h=!0)}var d=a.jqueryObj,f,g,c,k,h=!1;jQuery(window).resize(function(){setTimeout(function(){f=d.offset();g=f.left;e();b&&setInterval(function(){f=d.offset();f.left!==g&&(e(),g=f.left)},1E3)},1500)});jQuery(window).resize()},megaMenuParentPos:function(a,
b){function e(){c=d.find(".tdb-menu .tdb-mega-menu > ul");c.show();c.each(function(){jQuery(this).css("left","");k=jQuery(this).offset();h=k.left;0>h?jQuery(this).offset({left:0}):(l=jQuery(window).width()-(h+jQuery(this).outerWidth()),0>l&&jQuery(this).offset({left:jQuery(window).width()-jQuery(this).outerWidth()}))});m||(d.find(".tdb-mega-menu-inactive").removeClass("tdb-mega-menu-inactive"),m=!0);c.hide()}var d=a.jqueryObj,f,g,c,k,h,l,m=!1;setTimeout(function(){jQuery(window).resize(function(){f=
d.offset();g=f.left;e();b&&setInterval(function(){f=d.offset();f.left!==g&&(e(),g=f.left)},1E3)});jQuery(window).resize()},60)},pageMegaMenuHeight:function(a,b){function e(){g.show();g.each(function(){var a=jQuery(this),b=a.find("> li"),e=f.offset().top+f.outerHeight();b=b.outerHeight();var g=d.scrollTop(),m=d.height();e+b>m+g?a.css({height:m+g-e,"overflow-y":"auto"}):a.css({height:"auto","overflow-y":"visible"})});g.hide()}var d=jQuery(window),f=a.jqueryObj,g=f.find(".tdb-menu .tdb-mega-menu-page > ul");
setTimeout(function(){d.on("resize scroll",function(){e();b&&setInterval(function(){e()},1E3)});d.resize().scroll()},1500)},_getSubmenuPosition:function(a){var b=jQuery(window).width();a=a.children(".sub-menu").first();if(0<a.length){var e=a.offset().left+a.width();e>b&&(a.parent().parent().hasClass("tdb-menu")?a.css("left","-"+(e-b)+"px"):a.addClass("reversed").css("left","-"+(a.width()+0)+"px"))}},_getMouseAngleDirection:function(a,b,e,d){return Math.atan2(e-a,d-b)/Math.PI*180},_setHover:function(a){var b=
a.jqueryObj.find(".tdb-menu");b.supersubs({minWidth:10,maxWidth:20,extraWidth:1,applyMin:!0});var e=b.find(".menu-item-has-children > a, .tdb-mega-menu > a");e.parent().find(".sub-menu").first().css("display","none");if(tdDetect.isTouchDevice)jQuery(document).on("touchstart","body",function(c){var b=e.parent(),d=jQuery("body");d.hasClass(a._openMenuBodyClass)&&!b.is(c.target)&&0===b.has(c.target).length&&(b.removeClass(a._openMenuClass),b.children(".sub-menu").hide(),d.removeClass(a._openMenuBodyClass))}),
e.on("touchstart",function(c){c.preventDefault();c.stopPropagation();var b=jQuery(this);c=b.parent();var d=jQuery("body");c.hasClass(a._openMenuClass)?null!==b.attr("href")&&"#"!==b.attr("href")?window.location.href=b.attr("href"):((c.parent().hasClass("tdb-menu")||c.parent().hasClass("top-header-menu"))&&d.removeClass(a._openMenuBodyClass),c.removeClass(a._openMenuClass),c.find(".sub-menu").hide(),c.find("li").removeClass(a._openMenuClass)):(c.parent().hasClass("tdb-menu")||c.parent().hasClass("top-header-menu")?
(e.parent().removeClass(a._openMenuClass),e.parent().children(".sub-menu").hide()):(b=c.siblings(),b.removeClass(a._openMenuClass),b.find(".sub-menu").hide(),b.find("li").removeClass(a._openMenuClass)),c.addClass(a._openMenuClass),c.children(".sub-menu").show(),tdbMenu._getSubmenuPosition(c),d.addClass(a._openMenuBodyClass))});else{var d={},f,g=!0;b.on("mouseleave",function(){e.parent().removeClass(a._openMenuClass);e.parent().children(".sub-menu").hide();d={}});b.find(".menu-item").hover(function(){var b=
jQuery(this),k="",h,l;if(b.hasClass("menu-item-has-children")||b.hasClass("tdb-mega-menu"))if(b.parent().hasClass("tdb-menu"))if(jQuery.isEmptyObject(d))b.addClass(a._openMenuClass),b.children(".sub-menu").show(),d=b;else{if(b[0]!==d[0]){var m=l=h=0;var n=null;!0===g&&(g=!1,f=setTimeout(function(){e.parent().removeClass(a._openMenuClass);e.parent().children(".sub-menu").hide();b.addClass(a._openMenuClass);b.children(".sub-menu").show();d=b},400));b.on("mousemove",function(c){5<=h?(h=0,n=tdbMenu._getMouseAngleDirection(l,
m,c.pageX,c.pageY),l=c.pageX,m=c.pageY):(h++,0===l&&0===m&&(l=c.pageX,m=c.pageY));null!==n&&(85<n||-85>n)&&(e.parent().removeClass(a._openMenuClass),e.parent().children(".sub-menu").hide(),b.addClass(a._openMenuClass),b.children(".sub-menu").show(),b.off("mousemove"),clearTimeout(f),g=!0,d=b)})}}else k=b.siblings(),k.removeClass(a._openMenuClass),k.find(".sub-menu").hide(),k.find("li").removeClass(a._openMenuClass),b.addClass(a._openMenuClass),b.children(".sub-menu").show(),tdbMenu._getSubmenuPosition(b);
else b.parent().hasClass("tdb-menu")?jQuery.isEmptyObject(d)||(m=l=h=0,n=null,!0===g&&(g=!1,f=setTimeout(function(){e.parent().removeClass(a._openMenuClass);e.parent().children(".sub-menu").hide();d={}},400)),b.on("mousemove",function(c){5<=h?(h=0,n=tdbMenu._getMouseAngleDirection(l,m,c.pageX,c.pageY),l=c.pageX,m=c.pageY):(h++,0===l&&0===m&&(l=c.pageX,m=c.pageY));null!==n&&(85<n||-85>n)&&(e.parent().removeClass(a._openMenuClass),e.parent().children(".sub-menu").hide(),b.off("mousemove"),clearTimeout(f),
g=!0,d={})})):(d=b.parent(),k=b.siblings(),k.removeClass(a._openMenuClass),k.find(".sub-menu").hide(),k.find("li").removeClass(a._openMenuClass))},function(){var a=jQuery(this);!1===g&&(clearTimeout(f),g=!0);a.off("mousemove")})}},unsetHover:function(a){null!==a._itemsWithSubmenu&&a._itemsWithSubmenu.off();null!==a._outsideClickArea&&a._outsideClickArea.off()}}})();var tdbMenuItemPullDown={};
(function(){tdbMenuItemPullDown={init:function(){setTimeout(function(){jQuery(".tdb-menu-items-pulldown").each(function(a,b){var e=jQuery(b),d=e.parent().attr("id");b=jQuery("."+d);var f="";"none"!==b.css("max-width")&&(f=b.css("max-width"));if(b.hasClass("tdb-menu-items-in-more")){var g=e.find(".tdb-menu:first"),c=g.parents(".tdb-menu-items-pulldown:first"),k=[];a=new tdPullDown.item;if(void 0!==b.css("display")&&"inline-block"===b.css("display")){var h=b.closest(".vc_column_container");c=h;var l=
"";l=0!==h.find(".tdc-elements").length?".tdc-elements":".wpb_wrapper";h.find(l+" > .td_block_wrap").each(function(){var a=.9*h.outerWidth(!0),b=jQuery(this).outerWidth(!0);if(jQuery(this).data("td-block-uid")!==d)if(b<a)k.push(jQuery(this));else return!1})}a.blockUid=d;a.horizontal_jquery_obj=g;a.vertical_jquery_obj=e.find(".tdb-menu-items-dropdown:first");a.horizontal_element_css_class="tdb-menu-item-button";a.horizontal_no_items_css_class="tdb-menu-items-empty";a.container_jquery_obj=c;a.horizontal_max_width=
f;a.excluded_jquery_elements=k;a.isTdbMenu=!0;e=b.find(".tdb-main-sub-icon-fake");e.length&&(a.main_sub_icon=e.html());b=b.find(".tdb-sub-icon-fake");b.length&&(a.sub_icon=b.html());tdPullDown.add_item(a)}g.parents(".tdb-menu-items-pulldown:first").hasClass("tdb-menu-items-pulldown-inactive")&&g.parents(".tdb-menu-items-pulldown:first").removeClass("tdb-menu-items-pulldown-inactive")})},50)}}})();jQuery().ready(function(){});
jQuery(document).ready(function(){tdbMenuItemPullDown.init();tdbMenu.ui_events.forEach(function(a){window.addEventListener(a,tdbMenu.loadDelayed,{passive:!0})})});
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"),0<b.length?window.location=b.find(".entry-title a").attr("href"):jQuery(this).parent().parent().submit(),!1;if(b.which&&40===b.which||b.keyCode&&40===b.keyCode)return tdbSearch.move_prompt_down(a),!1;if(b.which&&38===b.which||b.keyCode&&38===b.keyCode)return tdbSearch.move_prompt_up(a),!1;(b.which&&8===b.which||b.keyCode&&8===b.keyCode)&&1===jQuery(this).val().length&&
a.jqueryObj.find(".tdb-aj-search").empty();tdbSearch.set_input_focus(a);setTimeout(function(){tdbSearch.do_ajax_call(a)},100);return!0}});if(!a.disable_trigger){var c=0<jQuery("."+a.blockUid).parents(".td-header-template-wrap").length;window.tdb_p_autoload_vars.isAjax?c||(a.isSearchFormFull?tdbSearch.searchFormWidth(a,!0,a.inComposer):tdbSearch.searchFormWidth(a,!1,a.inComposer)):a.isSearchFormFull?tdbSearch.searchFormWidth(a,!0,a.inComposer):tdbSearch.searchFormWidth(a,!1,a.inComposer)}a._is_initialized=
!0}},addItem:function(a){if("undefined"===typeof a.blockUid)throw"item.blockUid is not defined";tdbSearch.items.push(a);tdbSearch._initialize_item(a)},deleteItem:function(a){for(var c=0;c<tdbSearch.items.length;c++)if(tdbSearch.items[c].blockUid===a)return tdbSearch.items.splice(c,1),!0;return!1},searchFormWidth:function(a,c,b){function e(){k=-f.left+"px";g.attr("style",g.attr("style")+";left:"+k)}var d=a.jqueryObj,f,h,k,g=d.find(".tdb-drop-down-search");jQuery(window).resize(function(){var a=d.offset().left;
c?(g.attr("style","width: "+jQuery("body").outerWidth()+"px !important; left: -"+a+"px;"),setTimeout(function(){f=d.offset();h=f.left;e();b&&setInterval(function(){f=d.offset();f.left!==h&&(e(),h=f.left)},1E3)},500)):g.attr("style","width: "+jQuery("body").outerWidth()+"px !important;")});a.inComposer&&jQuery(window).resize()},show_search_box:function(a){a.jqueryObj.find(".tdb-drop-down-search").addClass(a._openSearchFormClass);!0!==tdDetect.isIos&&setTimeout(function(){document.querySelector("."+
a.blockUid+" .tdb-head-search-form-input").focus()},200);a._is_search_open=!0},hide_search_box:function(a){a.jqueryObj.find(".tdb-drop-down-search").removeClass(a._openSearchFormClass);a._is_search_open=!1},move_prompt_up:function(a){!0===a._first_down_up?(a._first_down_up=!1,0===a._current_selection_index?a._current_selection_index=a._last_request_results_count-1:a._current_selection_index--):0===a._current_selection_index?a._current_selection_index=a._last_request_results_count:a._current_selection_index--;
tdbSearch._repaintCurrentElement(a)},move_prompt_down:function(a){!0===a._first_down_up?a._first_down_up=!1:a._current_selection_index===a._last_request_results_count?a._current_selection_index=0:a._current_selection_index++;tdbSearch._repaintCurrentElement(a)},set_input_focus:function(a){a._current_selection_index=0;a._first_down_up=!0;a.jqueryObj.find(".tdb-search-form").fadeTo(100,1);a.jqueryObj.find(".td_module_wrap").removeClass("tdb-aj-cur-element")},remove_input_focus:function(a){0!==a._last_request_results_count&&
a.jqueryObj.find(".tdb-head-search-form-input").addClass("tdb-head-search-nofocus")},_repaintCurrentElement:function(a){a.jqueryObj.find(".td_module_wrap").removeClass("tdb-aj-cur-element");a._current_selection_index>a._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)});
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()});