function setDark(){document.body.classList.add("dark"),localStorage.setItem("mode","dark")}function setLight(){document.body.classList.remove("dark"),localStorage.setItem("mode","light")}function setMode(){"dark"===localStorage.getItem("mode")?setDark():setLight()}window.matchMedia("(prefers-color-scheme: dark)").matches?null!==localStorage.getItem("mode")?setMode():setDark():window.matchMedia("(prefers-color-scheme: light)").matches&&(null!==localStorage.getItem("mode")?setMode():setLight());