
export const PUBLIC_DOMAINS = [
    { value: 'webconf.viviers-fibre.net', label: 'Domain One' },
    { value: 'jitsi.riot.im',             label: 'Domain Two' },
    { value: 'meet.evolix.org',           label: 'Domain Three' },
    { value: 'video.devloprog.org',       label: 'Domain Four' },
];

let shuffledDomains = null;

export function getRandomDomain() {
    if (shuffledDomains === null) {
        const domains = PUBLIC_DOMAINS.map(d => d.value);
        shuffleArray(domains);
        shuffledDomains = domains;
    }

    const randomIndex = Math.floor(Math.random() * shuffledDomains.length);
    return shuffledDomains[randomIndex];
}

function shuffleArray(array) {
    for (let i = array.length - 1; i > 0; i--) {
        const j = Math.floor(Math.random() * (i + 1));
        [array[i], array[j]] = [array[j], array[i]];
    }
}
