import { localStorageService } from "../services/localStorageService";
export const SETTINGS_NAVIGATION_COLLAPSED_KEY = "settings-view-navigation-collapsed";
function getDefaultState() {
    return {
        isDesktop: true,
        mobileSidebarOpen: false,
        desktopNavigationCollapsed: localStorageService.getItem(SETTINGS_NAVIGATION_COLLAPSED_KEY) ??
            false,
        onToggleNavigation: undefined,
    };
}
let state = getDefaultState();
const listeners = new Set();
function emit() {
    listeners.forEach((listener) => listener());
}
export function subscribeSettingsNavigation(listener) {
    listeners.add(listener);
    return () => listeners.delete(listener);
}
export function getSettingsNavigationSnapshot() {
    return state;
}
export function setSettingsNavigationState(partial) {
    state = { ...state, ...partial };
    emit();
}
export function resetSettingsNavigationState() {
    state = getDefaultState();
    emit();
}
//# sourceMappingURL=settingsNavigationStore.js.map