Nova FAQ
${getAgents().map(agent => `
${agent.avatar}

${agent.name}

Base de conhecimento

FAQs
${agent.knowledgeBase.faqs}
Documentos
${agent.knowledgeBase.documents}
Tamanho
${agent.knowledgeBase.size}
`).join('')}

Documentos Recentes

${[ { name: 'Manual de Atendimento.pdf', agent: 'Recepcionista Virtual', size: '1.2 MB', date: '2024-12-28' }, { name: 'Catálogo de Produtos 2025.pdf', agent: 'Vendas Bot', size: '2.8 MB', date: '2024-12-27' }, { name: 'FAQ Técnico.txt', agent: 'SAC Inteligente', size: '450 KB', date: '2024-12-26' }, { name: 'Política de Preços.pdf', agent: 'Vendas Bot', size: '890 KB', date: '2024-12-25' } ].map(doc => `

${doc.name}

${doc.agent} • ${doc.size}

${new Date(doc.date).toLocaleDateString('pt-BR')}
`).join('')}
`; } // ==================== SETTINGS ==================== function renderSettings() { const themes = [ { id: 'ocean', name: 'Oceano', color: '#3b82f6', icon: '🌊' }, { id: 'rose', name: 'Rosa Elegante', color: '#f43f5e', icon: '🌸' }, { id: 'nature', name: 'Natureza', color: '#22c55e', icon: '🌿' }, { id: 'energy', name: 'Energia', color: '#f97316', icon: '🔥' }, { id: 'mystic', name: 'Místico', color: '#a855f7', icon: '✨' }, { id: 'professional', name: 'Profissional', color: '#475569', icon: '💼' } ]; return `

Perfil

${currentUser.name}

Plano & Faturamento

Plano Atual

${MOCK_DATA.plans.find(p => p.id === currentUser.plan).name}

R$ ${MOCK_DATA.plans.find(p => p.id === currentUser.plan).price}/mês

Créditos Restantes ${currentUser.credits.toLocaleString()} de ${currentUser.totalCredits.toLocaleString()}
Próxima Renovação 01/01/2025

Aparência

${themes.map(theme => ` `).join('')}

Integrações

${[ { name: 'WhatsApp (Evolution API)', icon: 'message-circle', connected: true, color: 'green' }, { name: 'Google Calendar', icon: 'calendar', connected: false, color: 'blue' }, { name: 'Zapier', icon: 'zap', connected: false, color: 'orange' }, { name: 'Webhooks', icon: 'webhook', connected: true, color: 'purple' } ].map(integration => `

${integration.name}

${integration.connected ? 'Conectado' : 'Não conectado'}

`).join('')}

Notificações

${[ { label: 'Novas conversas', desc: 'Receber alerta quando um novo atendimento iniciar' }, { label: 'Agendamentos', desc: 'Notificações sobre novos agendamentos' }, { label: 'Créditos baixos', desc: 'Avisar quando os créditos estiverem acabando' }, { label: 'Relatórios semanais', desc: 'Resumo semanal de performance' } ].map(notif => `

${notif.label}

${notif.desc}

`).join('')}

Zona de Perigo

`; } // ==================== CHARTS ==================== function initializeCharts() { // Interactions Chart const interactionsCtx = document.getElementById('interactionsChart'); if (interactionsCtx) { new Chart(interactionsCtx, { type: 'line', data: { labels: ['Seg', 'Ter', 'Qua', 'Qui', 'Sex', 'Sáb', 'Dom'], datasets: [{ label: 'Interações', data: MOCK_DATA.analytics.daily.interactions, borderColor: `rgb(${getComputedStyle(document.body).getPropertyValue('--theme-primary')})`, backgroundColor: `rgba(${getComputedStyle(document.body).getPropertyValue('--theme-primary')}, 0.1)`, tension: 0.4, fill: true }] }, options: { responsive: true, maintainAspectRatio: false, plugins: { legend: { display: false } }, scales: { y: { beginAtZero: true, grid: { color: 'rgba(0, 0, 0, 0.05)' } }, x: { grid: { display: false } } } } }); } // Credits Chart const creditsCtx = document.getElementById('creditsChart'); if (creditsCtx) { new Chart(creditsCtx, { type: 'bar', data: { labels: ['Seg', 'Ter', 'Qua', 'Qui', 'Sex', 'Sáb', 'Dom'], datasets: [{ label: 'Créditos Consumidos', data: MOCK_DATA.analytics.daily.credits, backgroundColor: `rgba(${getComputedStyle(document.body).getPropertyValue('--theme-secondary')}, 0.8)`, borderRadius: 6 }] }, options: { responsive: true, maintainAspectRatio: false, plugins: { legend: { display: false } }, scales: { y: { beginAtZero: true, grid: { color: 'rgba(0, 0, 0, 0.05)' } }, x: { grid: { display: false } } } } }); } // Satisfaction Chart const satisfactionCtx = document.getElementById('satisfactionChart'); if (satisfactionCtx) { new Chart(satisfactionCtx, { type: 'line', data: { labels: ['Seg', 'Ter', 'Qua', 'Qui', 'Sex', 'Sáb', 'Dom'], datasets: [{ label: 'Satisfação', data: MOCK_DATA.analytics.daily.satisfaction, borderColor: '#fbbf24', backgroundColor: 'rgba(251, 191, 36, 0.1)', tension: 0.4, fill: true, pointBackgroundColor: '#fbbf24', pointBorderColor: '#fff', pointBorderWidth: 2, pointRadius: 5 }] }, options: { responsive: true, maintainAspectRatio: false, plugins: { legend: { display: false } }, scales: { y: { min: 0, max: 5, grid: { color: 'rgba(0, 0, 0, 0.05)' } }, x: { grid: { display: false } } } } }); } } // ==================== INITIALIZATION ==================== document.addEventListener('DOMContentLoaded', function() { initializeStorage(); checkAuth(); }); // Initialize Lucide icons on page load lucide.createIcons();