<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Enhanced Auth & Bypass</title>
    <base target="_top">
    <link href="https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap" rel="stylesheet">
    <style>
        body {
            font-family: 'Poppins', Arial, sans-serif;
            background: linear-gradient(135deg, #6a11cb, #2575fc);
            color: #fff;
            margin: 0;
            padding: 0;
            display: flex;
            justify-content: center;
            align-items: center;
            height: 100vh;
            overflow: hidden;
        }

        #auth-banner, #main-content {
            display: flex;
            flex-direction: column;
            align-items: center;
            padding: 40px;
            background: rgba(255, 255, 255, 0.1);
            border-radius: 20px;
            box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
            backdrop-filter: blur(15px);
            transition: all 0.4s ease;
            width: 100%;
            max-width: 500px;
        }

        h1 {
            font-size: 28px;
            margin-bottom: 20px;
            color: #fff;
            text-align: center;
        }

        input[type="text"], input[type="url"] {
            width: 100%;
            padding: 15px;
            margin: 10px 0;
            border: 1px solid rgba(255, 255, 255, 0.3);
            border-radius: 12px;
            font-size: 16px;
            color: #fff;
            background: rgba(255, 255, 255, 0.1);
            transition: all 0.3s ease;
        }

        input[type="text"]::placeholder, input[type="url"]::placeholder {
            color: rgba(255, 255, 255, 0.7);
        }

        input[type="text"]:focus, input[type="url"]:focus {
            border-color: #4adeff;
            box-shadow: 0 0 15px rgba(74, 222, 255, 0.5);
            outline: none;
        }

        button {
            background: linear-gradient(135deg, #4adeff, #16c784);
            color: white;
            padding: 12px 20px;
            border: none;
            border-radius: 15px;
            cursor: pointer;
            font-size: 16px;
            margin-top: 20px;
            transition: background 0.4s ease, transform 0.3s ease;
            font-weight: 600;
        }

        button:hover {
            background: linear-gradient(135deg, #16c784, #4adeff);
            transform: scale(1.05);
        }

        .error {
            color: #ff6b6b;
            margin-top: 10px;
            font-size: 14px;
            text-align: center;
        }

        a {
            color: #4adeff;
            font-size: 14px;
            text-decoration: none;
            margin-top: 20px;
        }

        a:hover {
            text-decoration: underline;
        }

        .button-container {
            display: flex;
            gap: 10px;
            justify-content: center;
            width: 100%;
            margin-top: 20px;
        }

        .button-container button {
            flex: 1;
        }

        #main-content {
            display: none;
        }

        #auth-banner.shown {
            animation: fadeIn 0.6s ease;
        }

        #main-content.shown {
            animation: fadeIn 0.6s ease;
        }

        @keyframes fadeIn {
            from {
                opacity: 0;
                transform: translateY(20px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        @media (max-width: 768px) {
            body {
                padding: 20px;
            }

            #auth-banner, #main-content {
                padding: 30px;
            }

            h1 {
                font-size: 24px;
            }

            button {
                padding: 10px 15px;
                font-size: 14px;
            }
        }
    </style>
</head>
<body>
    <div id="auth-banner" class="shown">
        <h1>🔒 Enter Your Auth Key</h1>
        <input type="text" id="authKey" placeholder="Enter your key...">
        <button onclick="validateKey()">Login</button>
        <p class="error" id="error-message"></p>
    </div>

    <div id="main-content">
        <h1>🌐 Website Bypasser</h1>
        <p>Enter the URL of the website to bypass:</p>
        <input type="url" id="myURL" placeholder="https://example.com" 
               onkeydown="if (event.keyCode == 13) document.getElementById('analyze').click()">
        <div class="button-container">
            <button id="analyze" onclick="download()">Analyze</button>
            <button id="analyze1" onclick="download1()">Advanced Analyze</button>
        </div>
        <p id="abc"></p>
        <p id="abc1"></p>
    </div>

    <script>
        const validKeys = ["Dias9872", "Otherppl"];

        function validateKey() {
            const enteredKey = document.getElementById('authKey').value.trim();
            const errorMessage = document.getElementById('error-message');

            if (validKeys.includes(enteredKey)) {
                document.getElementById('auth-banner').style.display = 'none';
                document.getElementById('main-content').style.display = 'flex';
            } else {
                errorMessage.textContent = "⛔ Wrong key. Please try again.";
            }
        }

        function download() {
            function onSuccess(download) {
                const a = document.createElement('a');
                const data = download[2] === 1 
                    ? new Uint8Array(download[0]) 
                    : download[0];
                const blob = new Blob([data], { type: download[1] });
                a.href = window.URL.createObjectURL(blob);
                a.download = `file.${download[1].split("/")[1].split(";")[0]}`;
                a.click();
                resetState();
            }

            function onFailure() {
                document.getElementById('abc').textContent = "⚠️ URL Error";
            }

            updateMessage("abc", "⏳ Bypassing...");
            clearMessage("abc1");

            if (typeof google !== 'undefined' && google.script && google.script.run) {
                google.script.run.withFailureHandler(onFailure)
                    .withSuccessHandler(onSuccess)
                    .fun1(document.getElementById('myURL').value);
            } else {
                console.error("google.script.run is not defined.");
            }
        }

        function download1() {
            function onSuccess(download) {
                const a = document.createElement('a');
                const data = download[2] === 1 
                    ? new Uint8Array(download[0]) 
                    : download[0];
                const blob = new Blob([data], { type: download[1] });
                a.href = window.URL.createObjectURL(blob);
                a.download = `file.${download[1].split("/")[1].split(";")[0]}`;
                a.click();
                resetState();
            }

            function onFailure() {
                document.getElementById('abc1').textContent = "⚠️ Error";
            }

            updateMessage("abc1", "⏳ Advanced Analyzing...");
            clearMessage("abc");

            if (typeof google !== 'undefined' && google.script && google.script.run) {
                google.script.run.withFailureHandler(onFailure)
                    .withSuccessHandler(onSuccess)
                    .fun2(document.getElementById('myURL').value);
            } else {
                console.error("google.script.run is not defined.");
            }
        }

        function updateMessage(id, message) {
            document.getElementById(id).textContent = message;
        }

        function clearMessage(id) {
            document.getElementById(id).textContent = "";
        }

        function resetState() {
            document.getElementById('myURL').value = "";
            clearMessage("abc");
            clearMessage("abc1");
        }
    </script>
</body>
</html>
