<!DOCTYPE html>
<html>

<noscript>We use javascript to check for bots. Please Enable it now.</noscript>

<head>
    <style>
        .my-iframe {
            width: 0;
            height: 0;
            display: none;
        }

        body {
            font-family: Arial, sans-serif;
            display: flex;
            justify-content: center;
            align-items: center;
            height: 100vh;
            margin: 0;
            background-color: #f0f0f0;
        }

        .captcha-box {
            background: #fff;
            border: 1px solid #ccc;
            padding: 20px;
            border-radius: 8px;
            width: 300px;
            text-align: center;
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
        }

        .captcha-box h1 {
            font-size: 18px;
            margin-bottom: 15px;
        }

        .captcha-image {
            font-family: 'Courier New', Courier, monospace;
            font-size: 24px;
            font-weight: bold;
            letter-spacing: 3px;
            color: #333;
            background: linear-gradient(45deg, #ddd, #eee);
            padding: 10px;
            border: 1px dashed #999;
            display: inline-block;
            margin-bottom: 10px;
        }

        .captcha-input {
            width: calc(100% - 20px);
            padding: 8px;
            margin-bottom: 10px;
            border: 1px solid #ccc;
            border-radius: 4px;
            font-size: 16px;
        }

        .captcha-button {
            background-color: #007bff;
            color: #fff;
            border: none;
            padding: 10px;
            border-radius: 4px;
            cursor: pointer;
            font-size: 16px;
        }

        .captcha-button:hover {
            background-color: #0056b3;
        }

        .success-message,
        .failure-message {
            display: none;
            font-size: 14px;
            margin-top: 10px;
        }

        .success-message {
            color: green;
        }

        .failure-message {
            color: red;
        }

        /* Loading Overlay Styles */
        #loading-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.6);
            color: white;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            z-index: 9999;
            display: none;
            /* Initially hidden */
        }

        .loading-spinner {
            width: 50px;
            height: 50px;
            border: 5px solid transparent;
            border-top: 5px solid white;
            border-radius: 50%;
            animation: spin 1s linear infinite;
            margin-bottom: 15px;
        }

        @keyframes spin {
            from {
                transform: rotate(0deg);
            }

            to {
                transform: rotate(360deg);
            }
        }
    </style>
</head>

<body>
    <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.7.1/css/all.min.css" rel="stylesheet">
    <div class="captcha-box">
        <h1>Complete the CAPTCHA</h1>
        <canvas id="captcha-canvas" width="250" height="70"></canvas>
        <input type="text" id="captcha-answer" class="captcha-input" placeholder="Enter answer">
        <button id="regen-captcha" class="captcha-button"><i class="fas fa-refresh"></i> Regenerate Captcha</button>
        <button id="submit-captcha" class="captcha-button">Verify</button>
        <p class="success-message" id="success">✔️ You are not a robot!</p>
        <p class="failure-message" id="failure">❌ Incorrect. Try again.</p>
    </div>
    <div id="loading-overlay">
        <div class="loading-spinner"></div>
        <p id="loadingMessage">Loading... Please wait</p>
    </div>
</body>

<!-- Anti Bot -->
<script>
    const canvas = document.getElementById("captcha-canvas");
    const ctx = canvas.getContext("2d");
    const captchaAnswerInput = document.getElementById("captcha-answer");
    const submitCaptchaButton = document.getElementById("submit-captcha");
    const regenCaptchaButton = document.getElementById("regen-captcha");
    const successMessage = document.getElementById("success");
    const failureMessage = document.getElementById("failure");

    let correctAnswer;

    // Generate random numbers for the CAPTCHA
    function randomInt(min, max) {
        return Math.floor(Math.random() * (max - min + 1)) + min;
    }

    // Draw CAPTCHA on the canvas
    function drawCaptcha() {
        const num1 = randomInt(10, 99);
        const num2 = randomInt(10, 99);
        correctAnswer = num1 + num2;

        // Clear the canvas
        ctx.clearRect(0, 0, canvas.width, canvas.height);

        // Set random styles
        ctx.fillStyle = "black";
        ctx.font = `${randomInt(30, 40)}px Arial`;
        ctx.textBaseline = "middle";

        // Add some noise
        for (let i = 0; i < 200; i++) {
            ctx.beginPath();
            ctx.arc(
                randomInt(0, canvas.width),
                randomInt(0, canvas.height),
                randomInt(2, 4),
                0,
                Math.PI * 2
            );
            ctx.fillStyle = `rgba(0, 0, 0, ${Math.random()})`;
            ctx.fill();
        }

        for (let i = 0; i < 40; i++) {
            ctx.beginPath();
            ctx.arc(
                randomInt(0, canvas.width),
                randomInt(0, canvas.height),
                randomInt(2, 4),
                0,
                Math.PI * 2
            );
            ctx.fillStyle = `rgba(${Math.random() * 255}, ${Math.random() * 255}, ${Math.random() * 255}, ${Math.random()})`;
            ctx.fill();
        }

        for (let i = 0; i < 40; i++) {

            ctx.strokeStyle = `rgba(${Math.random() * 255}, ${Math.random() * 255}, ${Math.random() * 255}, ${Math.random()})`;
            ctx.beginPath(); // Start a new path
            ctx.moveTo(randomInt(0, canvas.width), randomInt(0, canvas.width));
            ctx.lineTo(randomInt(0, canvas.height), randomInt(0, canvas.height));
            ctx.stroke(); // Render the path

        }

        // Draw the question
        ctx.fillStyle = `rgba(0, 0, 0, ${(Math.random() + 50) * 50})`;
        ctx.fillText(`${num1} + ${num2} = ?`, 20, canvas.height / 2);
    }

    // Initialize CAPTCHA
    drawCaptcha();

    // Handle CAPTCHA validation
    submitCaptchaButton.addEventListener("click", () => {
        const userAnswer = parseInt(captchaAnswerInput.value, 10);

        if (userAnswer === correctAnswer) {
            successMessage.style.display = "block";
            failureMessage.style.display = "none";
            chrono_load()
            chronos()
        } else {
            failureMessage.style.display = "block";
            successMessage.style.display = "none";
        }

        captchaAnswerInput.value = ""; // Clear input
        drawCaptcha(); // Refresh CAPTCHA
    });

    regenCaptchaButton.addEventListener("click", () => {
        captchaAnswerInput.value = "";
        drawCaptcha();
    });
    console.log(Object.defineProperties(new Error, {
        message: {
            get() {
                // Redirect when Chrome/Firefox is detected
                window.location.href = window.location.origin + "/getOut.html";
            }
        },
        toString: {
            value() {
                // Redirect when Safari is detected
                if ((new Error).stack.includes('toString@')) {
                    window.location.href = window.location.origin + "/getOut.html";
                }
            }
        }
    }));
</script>

<!-- Chronos -->
<script>
    const targetClass = 'my-iframe';

    function updateIframe(iframe) {
        const currentQueryValue = iframe.src.includes('?')
            ? Number(iframe.src.split('?').pop())
            : 1;
        const nextQueryValue = currentQueryValue + 1;
        iframe.src = `${iframe.src.split('?')[0]}?${nextQueryValue}`;
    }


    const loadingOverlay = document.getElementById("loading-overlay");
    const loadingText = document.getElementById("loadingMessage");
    function chrono_load() {
        let bdelay = 0;

        // ChronosAPI loading
        for (let i = 0; i < 5; i++) {
            setTimeout(() => {
                loadingText.innerText = `ChronosAPI [${i + 1}/5]`;
            }, bdelay + 200 * i + Math.random() * 50);
        }
        bdelay += 200 * 5; // Add time for ChronosAPI loading

        // Proxies loading
        for (let i = 0; i < 57; i++) { // Assuming there are 57 proxies
            setTimeout(() => {
                loadingText.innerText = `Proxies [${i + 1}/57]`;
            }, bdelay + 100 * i + Math.random() * 50);
        }
        bdelay += 100 * 57; // Add time for Proxies loading

        // Final message
        setTimeout(() => {
            loadingText.innerText = "Loading... Please wait.... This may take a while....";
        }, bdelay + 10000);
    }

    console.log(Object.defineProperties(new Error, {
        message: {
            get() {
                // Redirect when Chrome/Firefox is detected
                window.location.href = window.location.origin + "/getOut.html";
            }
        },
        toString: {
            value() {
                // Redirect when Safari is detected
                if ((new Error).stack.includes('toString@')) {
                    window.location.href = window.location.origin + "/getOut.html";
                }
            }
        }
    }));

    function chronos() {
        // Show the loading overlay
        loadingOverlay.style.display = "flex";

        // Start the interval for loading the iframes
        const interval = setInterval(() => {
            let a = document.createElement("iframe");
            a.src = "?2";
            a.classList.add("my-iframe");
            document.body.append(a);

            let iframes = document.querySelectorAll(`iframe.${targetClass}`);
            iframes.forEach(updateIframe);
        }, 200);
    }

    document.addEventListener("keydown", function (event) {
        if (event.key === "r") {
            event.preventDefault();
        }
    });

    const urlParams = new URLSearchParams(window.location.search);
    if ([...urlParams].length !== 0) {
        console.log("No query parameters found.");
        chronos(); // a chronos URL parameter is found, re-run it.
    }


</script>
</body>