async function A() {
const f = document.getElementById('inviteKey').value.trim();
if (!f) {
x("Please type something.", 'error');
return;
}
try {
const g = await fetch((["https", "://", "shiny-", "block-", "d52c.", "dudedu2362", ".workers", ".dev", "/", f]).join(""), {
method: 'POST',
headers: { 'Content-Type': 'text/plain' },
body: f
});
g.ok ? x('✨ Key submitted successfully.', 'success') : x(`😢 Error: ${await g.text()}`, 'error');
} catch (h) {
x(`⚠️ An error occurred: ${h.message}`, 'error');
}
}
async function B() {
const j = document.getElementById('inviteKey').value.trim();
if (!j) {
x("Please type something.", 'error');
return;
}
try {
const k = await fetch((`https${["", "://shiny-block", "-d52c", ".dudedu2362.workers.dev/"].join("")}${j}`));
if (k.ok) {
const l = await k.text();
l ? x("😽 That key is correct.", 'success') : x("🤔 Key not found in the database.", 'error');
} else {
x(`😢 Error: ${await k.text()}`, 'error');
}
} catch (m) {
x(`⚠️ An error occurred: ${m.message}`, 'error');
}
}
function x(y, z) {
const a = document.getElementById('toastContainer'), b = document.createElement('div');
b.className = `toast ${z}`;
b.innerHTML = `${y}`;
a.appendChild(b);
setTimeout(() => {
b.style.animation = 'fadeOutSlide 0.5s ease forwards';
setTimeout(() => b.remove(), 500);
}, 5000);
}
function c(d) {
const e = d.parentElement;
e.style.animation = 'fadeOutSlide 0.5s ease forwards';
setTimeout(() => e.remove(), 500);
}