((e,n,o)=>{"use strict";const l=ThemifyBuilderModuleJs.cssUrl+"menu_styles/",u=n.createElement("div"),m=e.is_builder_active,i=()=>e.loadCss(l+"mobile"),t=(e,n)=>{const o=e.nextElementSibling.style;o.display="none"===o.display||""===o.display?"block":"none",n.classList.toggle("menu-close"),e.closest("li").classList.toggle("tb_menu_open")},d=()=>{u.classList.remove("body-overlay-on"),n.body.classList.remove("menu-module-left","menu-module-right");const e=n.querySelector(".mobile-menu-module.visible");e&&(e.classList.remove("left"),e.classList.remove("right"),o((()=>{e.classList.remove("visible")}),300))},r=(u,i,t)=>{for(let n=i.length-1;n>-1;--n){let u=i[n],m=~~u.dataset.menuBreakpoint,d=u.tfClass("nav")[0];if(u.classList.contains("dropdown")&&e.loadCss(l+"dropdown","tb_menu_dropdown"),d){d.classList.contains("transparent")&&e.loadCss(l+"transparent","tb_menu_transparent");let n=d.classList.contains("fullwidth")?"fullwidth":d.classList.contains("vertical")?"vertical":"";""!==n&&(e.loadCss(l+n,"tb_menu_"+n),"vertical"!==n||u.tfClass("tf_acc_menu")[0]||e.loadCss(l+"accordion","tb_menu_accordion"))}m>0&&u.classList.toggle("module-menu-mobile-active",t<m),void 0===u.tfClass("tf_acc_menu")[0]&&o((()=>{e.edgeMenu(u)}),1500)}if(!m)if(!1===u){let e=n.tfClass("menu-module-burger")[0];if(e){let o=e=>!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length);"mobile-menu-dropdown"===e.parentElement.dataset.menuStyle&&e.length&&t<e.parentElement.dataset.menuBreakpoint&&n.body.tfOn("click",(l=>{const u=n.tfClass("module-menu-container")[0];!l.target.closest(".module-menu-container,.menu-module-burger")&&o(u)&&o(e)&&(e.classList.remove("is-open"),u.classList.remove("is-open"))}))}}else d()};if(e.on("builder_load_module_partial",((n,o)=>{if(!0===o&&!n.classList.contains("module-menu"))return;const l=e.selectWithParent("module-menu",n);r(!1,l,e.w)})),!m){const m=n.createElement("div"),r=n.createElement("link");let s=l+"mobile.css?ver="+e.v;null!==e.urlArgs&&(s+=e.urlArgs),r.rel="prefetch",r.setAttribute("as","style"),r.href=s,m.className="themify_builder",u.classList.add("body-overlay"),m.appendChild(u),n.body.append(m,r),n.body.tfOn("click",(function(l){const r=l.target;if(r.classList.contains("menu-module-burger"))l.preventDefault(),i().then((()=>{const l=r.parentElement,i=l.dataset,t=i.menuStyle;if("mobile-menu-dropdown"===t)return r.classList.toggle("is-open"),void r.nextElementSibling.classList.toggle("is-open");const d=i.menuDirection,s=i.elementId,c=m.dataset.id,a=l.closest(".themify_builder_content").dataset.postid;c&&a===c||(c&&m.classList.remove("themify_builder_content-"+c),m.dataset.id=a,m.className+=" themify_builder_content-"+a);let b=m.querySelector('div[data-module="'+s+'"]');if(!b){let o=l.dataset.gs,u=l.querySelector('div[class*="-container"] > ul').cloneNode(!0),i=u.className.replace(/nav|menu-bar|fullwidth|vertical|with-sub-arrow/g,""),r=l.className.match(/menu-[\d\-]+/g);o=o?" "+o:"",r=r?r[0]:"",b=n.createElement("div"),b.className="mobile-menu-module  "+i+" "+r+" "+s+" "+t+o+" module-menu",b.dataset.module=s,b.dataset.dir=d,m.append(b),u.removeAttribute("id"),u.className="nav";const c=u.tfClass("sub-menu");for(var f=0;f<c.length;f++){const e=c[f].previousElementSibling,o=n.createElement("i");o.className="toggle-menu",e.appendChild(o)}e.lazyScroll(u.querySelectorAll("[data-lazy]"),!0),b.innerHTML=u.outerHTML;const a=n.createElement("a"),_=n.createElement("span");a.className="menu-close",_.className="menu-close-inner tf_close",a.appendChild(_),b.prepend(a)}n.body.classList.add("menu-module-"+d),b.classList.add("visible"),o((()=>{b.classList.add(d)}),50),u.classList.add("body-overlay-on")}));else if(r.classList.contains("toggle-menu")&&r.matches(".mobile-menu-module ul .toggle-menu"))l.preventDefault(),l.stopPropagation(),i().then((()=>{t(r.closest("a"),r)}));else if("A"===r.tagName&&r.matches('.mobile-menu-module ul a[href="#"]')){l.preventDefault();const e=r.querySelector(".toggle-menu");null!==e&&i().then((()=>{t(this,e)}))}else if(r.matches(".themify_builder .body-overlay,.mobile-menu-module .menu-close,.mobile-menu-module .menu-item a")){if(r.classList.contains("toggle-menu")||"A"===r.tagName&&"#"===r.getAttribute("href"))return;(r.classList.contains("menu-close-inner")||r.parentNode.classList.contains("menu-close"))&&l.preventDefault(),i().then(d)}}))}e.on("tfsmartresize",(e=>{e&&r(!0,n.querySelectorAll(".module-menu.module"),e.w)}))})(Themify,document,setTimeout);