document.addEventListener('DOMContentLoaded', function() { // Initialize mock data let mockNumbers = [ { platform: 'Twilio', number: '+1 555-123-4567', country: 'USA', status: 'Available' }, { platform: 'Virtusim', number: '+44 7911 123456', country: 'UK', status: 'Available' }, { platform: 'IVASMS', number: '+62 812-3456-7890', country: 'Indonesia', status: 'Busy' } ]; // Load saved configuration loadConfiguration(); // Populate numbers table populateNumbersTable(); // Setup form submission document.getElementById('botConfigForm').addEventListener('submit', function(e) { e.preventDefault(); saveConfiguration(); showNotification('Configuration saved successfully!'); }); // Setup refresh button document.getElementById('refreshNumbers').addEventListener('click', function() { populateNumbersTable(); showNotification('Numbers refreshed!'); }); // Simulate incoming OTP messages setInterval(simulateIncomingOTP, 10000); function loadConfiguration() { const botToken = localStorage.getItem('botToken') || ''; const ownerId = localStorage.getItem('ownerId') || ''; const groupId = localStorage.getItem('groupId') || ''; document.getElementById('botToken').value = botToken; document.getElementById('ownerId').value = ownerId; document.getElementById('groupId').value = groupId; } function saveConfiguration() { const botToken = document.getElementById('botToken').value; const ownerId = document.getElementById('ownerId').value; const groupId = document.getElementById('groupId').value; localStorage.setItem('botToken', botToken); localStorage.setItem('ownerId', ownerId); localStorage.setItem('groupId', groupId); } function populateNumbersTable() { const tableBody = document.getElementById('numbersTableBody'); tableBody.innerHTML = ''; mockNumbers.forEach(number => { const row = document.createElement('tr'); row.className = 'border-t border-gray-600 hover:bg-gray-600 transition duration-150 fade-in'; row.innerHTML = `