export function normalizeHeaderTheme(theme) {
    switch (theme?.toLowerCase()) {
        case 'business':
            return 'business';
        case 'private':
            return 'private';
        default:
            return 'private';
    }
}
export function getAppearanceForTheme(theme) {
    switch (normalizeHeaderTheme(theme)) {
        case 'private':
            return 'light';
        case 'business':
            return 'dark';
        default:
            return 'light';
    }
}
export function resolveHeaderMenuThemes(menuThemes, menuModeOptions) {
    //1. Prop override
    if (menuThemes) {
        try {
            const parsed = JSON.parse(menuThemes);
            if (Array.isArray(parsed)) {
                const filtered = parsed
                    .filter((item) => typeof item === 'string')
                    .map(item => normalizeHeaderTheme(item));
                if (filtered.length > 0) {
                    return filtered;
                }
            }
        }
        catch (error) {
            console.warn('[pn-marketweb-header] Invalid menu-themes value', error);
        }
    }
    // 2. Fallback → VM
    if (!Array.isArray(menuModeOptions)) {
        return [];
    }
    return menuModeOptions
        .map(option => option?.root?.toggleTheme)
        .filter((theme) => typeof theme === 'string')
        .map(theme => normalizeHeaderTheme(theme));
}
//# sourceMappingURL=header-theme.js.map
