window.isRtl=window.Helpers.isRtl();window.isDarkStyle=window.Helpers.isDarkStyle();(function(){var d,c;const s=document.getElementById("navbarSupportedContent"),o=document.querySelector(".layout-navbar"),m=document.querySelectorAll(".navbar-nav .nav-link");setTimeout(function(){window.Helpers.initCustomOptionCheck()},1e3),typeof Waves<"u"&&(Waves.init(),Waves.attach(".btn[class*='btn-']:not([class*='btn-outline-']):not([class*='btn-label-'])",["waves-light"]),Waves.attach("[class*='btn-outline-']"),Waves.attach("[class*='btn-label-']"),Waves.attach(".pagination .page-item .page-link")),[].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]')).map(function(e){return new bootstrap.Tooltip(e)}),isRtl&&(Helpers._addClass("dropdown-menu-end",document.querySelectorAll("#layout-navbar .dropdown-menu")),Helpers._addClass("dropdown-menu-end",document.querySelectorAll(".dropdown-menu"))),window.addEventListener("scroll",e=>{window.scrollY>10?o.classList.add("navbar-active"):o.classList.remove("navbar-active")}),window.addEventListener("load",e=>{window.scrollY>10?o.classList.add("navbar-active"):o.classList.remove("navbar-active")});function l(){s.classList.remove("show")}document.addEventListener("click",function(e){s.contains(e.target)||l()}),m.forEach(e=>{e.addEventListener("click",t=>{e.classList.contains("dropdown-toggle")?t.preventDefault():l()})});const a=document.querySelectorAll(".nav-link.mega-dropdown");a&&a.forEach(e=>{new MegaDropdown(e)});let n=localStorage.getItem("templateCustomizer-"+templateName+"--Theme")||(((c=(d=window.templateCustomizer)==null?void 0:d.settings)==null?void 0:c.defaultStyle)??document.documentElement.getAttribute("data-bs-theme"));//!if there is no Customizer then use default style as light
const r=document.querySelector(".dropdown-style-switcher").querySelector("i");new bootstrap.Tooltip(r,{title:n.charAt(0).toUpperCase()+n.slice(1)+" Mode",fallbackPlacements:["bottom"]}),window.Helpers.switchImage(n),window.Helpers.setTheme(window.Helpers.getPreferredTheme()),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",()=>{const e=window.Helpers.getStoredTheme();e!=="light"&&e!=="dark"&&window.Helpers.setTheme(window.Helpers.getPreferredTheme())});function i(){const e=window.innerWidth-document.documentElement.clientWidth;document.body.style.setProperty("--bs-scrollbar-width",`${e}px`)}i(),window.addEventListener("DOMContentLoaded",()=>{window.Helpers.showActiveTheme(window.Helpers.getPreferredTheme()),i(),document.querySelectorAll("[data-bs-theme-value]").forEach(e=>{e.addEventListener("click",()=>{const t=e.getAttribute("data-bs-theme-value");window.Helpers.setStoredTheme(templateName,t),window.Helpers.setTheme(t),window.Helpers.showActiveTheme(t,!0),window.Helpers.syncCustomOptions(t);let w=t;t==="system"&&(w=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),new bootstrap.Tooltip(r,{title:t.charAt(0).toUpperCase()+t.slice(1)+" Mode",fallbackPlacements:["bottom"]}),window.Helpers.switchImage(w)})})})})();
