// Compte à rebours avant la redirection
let countdown = macymedLinkTrackerScript.timerRefresh;
const countdownElement = document.getElementById('countdown');

function updateCountdown() {
    if (countdownElement) {
        countdownElement.innerHTML = countdown;
    }
    if (countdown > 0) {
        countdown--;
        setTimeout(updateCountdown, 1000);
    }
}

document.addEventListener('DOMContentLoaded', function() {
    if (countdownElement) {
        countdownElement.innerHTML = countdown;
    }
    setTimeout(updateCountdown, 1000);
});