/*! phoscon-app 2025-05-20 */

var theme=localStorage.getItem("app.theme");function setTheme(theme){let trimmed=theme.replace(/["\\]/g,"");theme||(theme="light"),theme="light"!=trimmed&&"dark"!=trimmed&&"slate"!=trimmed&&"contrast"!=trimmed?"light":trimmed,app.theme=theme,setTimeout(()=>{document.querySelectorAll("#themeSelect")&&document.querySelectorAll("#themeSelect").forEach(element=>{element.value=theme})},500),localStorage.setItem("app.theme",theme);var root=document.querySelector(":root");root.style.setProperty("--color-bg",`var(--color-bg-${theme})`),root.style.setProperty("--color-element",`var(--color-element-${theme})`),root.style.setProperty("--color-element-alt",`var(--color-element-alt-${theme})`),root.style.setProperty("--color-element-highlight",`var(--color-element-highlight-${theme})`),root.style.setProperty("--color-button",`var(--color-button-${theme})`),root.style.setProperty("--color-button-selected",`var(--color-button-selected-${theme})`),root.style.setProperty("--color-button-highlight",`var(--color-button-highlight-${theme})`),root.style.setProperty("--color-text",`var(--color-text-${theme})`),root.style.setProperty("--color-text-selected",`var(--color-text-selected-${theme})`),root.style.setProperty("--color-text-disabled",`var(--color-text-disabled-${theme})`),root.style.setProperty("--color-text-alt",`var(--color-text-alt-${theme})`),root.style.setProperty("--color-text-danger",`var(--color-text-danger-${theme})`),root.style.setProperty("--color-text-highlight",`var(--color-text-highlight-${theme})`),root.style.setProperty("--color-danger",`var(--color-danger-${theme})`),root.style.setProperty("--color-active-btn",`var(--color-active-btn-${theme})`),root.style.setProperty("--color-header",`var(--color-header-${theme})`),root.style.setProperty("--color-header-text",`var(--color-header-text-${theme})`),root.style.setProperty("--color-footer",`var(--color-footer-${theme})`),root.style.setProperty("--color-dashboard-button",`var(--color-dashboard-button-${theme})`),root.style.setProperty("--color-dashboard-button-highlight",`var(--color-dashboard-button-highlight-${theme})`),root.style.setProperty("--color-settings-selected-menu",`var(--color-settings-selected-menu-${theme})`),root.style.setProperty("--color-navbar-bg",`var(--color-navbar-bg-${theme})`),root.style.setProperty("--color-navbar-bg-highlight",`var(--color-navbar-bg-highlight-${theme})`),root.style.setProperty("--color-navbar-button",`var(--color-navbar-button-${theme})`),root.style.setProperty("--color-navbar-text",`var(--color-navbar-text-${theme})`),root.style.setProperty("--color-time-slice",`var(--color-time-slice-${theme})`),root.style.setProperty("--color-time-slice-hover",`var(--color-time-slice-hover-${theme})`),root.style.setProperty("--color-text-table-details",`var(--color-text-table-details-${theme})`),root.style.setProperty("--color-device-box-header",`var(--color-device-box-header-${theme})`),root.style.setProperty("--color-device-box-body",`var(--color-device-box-body-${theme})`),root.style.setProperty("--color-device-toggle",`var(--color-device-toggle-${theme})`),root.style.setProperty("--color-button-top",`var(--color-button-top-${theme})`),root.style.setProperty("--color-button-top-highlight",`var(--color-button-top-highlight-${theme})`)}theme?setTheme(theme):setTimeout(()=>{setTheme(localStorage.getItem("app.theme")||"light")},500);