// Paywall — tela que bloqueia o app quando o trial expira. // Renderizada DEPOIS do login mas ANTES do conteúdo principal, // quando profile.plan === 'trial' e trial_ends_at já passou. // // Existem duas versões: WebPaywall (desktop, layout amplo) e // MobilePaywall (celular, layout compacto). Ambas oferecem os 3 // o plano único com botão que abre o checkout da Cakto. (function () { const PLANS = [ { id: 'anual', name: 'CENTRAL DA VIDA', subtitle: 'Plano anual · acesso completo', total: 38.90, months: 12, color: '#B197FC', recommended: true }, ]; const fmtBRL = (v) => `R$ ${v.toLocaleString('pt-BR', { minimumFractionDigits: 2, maximumFractionDigits: 2 })}`; // ── Web Paywall (desktop) ────────────────────────────────── function WebPaywall({ user, onLogout, onRefresh, showToast }) { const choose = (planId) => { const plan = PLANS.find(p => p.id === planId); if (window.Checkout && window.Checkout.openCheckout(planId, user)) { showToast && showToast(`Abrindo checkout · ${plan.name}`); } }; return (
Seu período de teste terminou
Continue com a Central completa
Sofia 24/7, tarefas, hábitos, metas, finanças e backup em nuvem. Seus dados estão salvos — só faltam você escolher um plano.
{PLANS.map(plan => ( choose(plan.id)} /> ))}
Todos os planos incluem
{['Sofia IA ilimitada', 'Backup em nuvem', 'Cofrinhos e metas', 'Sincronização', 'Relatórios PDF', 'Suporte prioritário', 'Cancele a qualquer hora', '14 dias garantia'].map((f, i) => (
{f}
))}
·
); } function PaywallCardWeb({ plan, onSelect }) { const perMonth = plan.total / plan.months; const periodLabel = plan.months === 1 ? '/mês' : plan.months === 6 ? 'a cada 6 meses' : '/ano'; return (
{plan.recommended && (
ACESSO COMPLETO
)}
{plan.name}
{plan.save && ( economize {plan.save} )}
{plan.subtitle}
{fmtBRL(plan.total)} {periodLabel}
{plan.months > 1 && (
equivale a {fmtBRL(perMonth)}/mês
)}
); } // ── Mobile Paywall (celular) ─────────────────────────────── function MobilePaywall({ user, onLogout, onRefresh, showToast }) { const choose = (planId) => { const plan = PLANS.find(p => p.id === planId); if (window.Checkout && window.Checkout.openCheckout(planId, user)) { showToast && showToast(`Abrindo checkout · ${plan.name}`); } }; return (
Seu trial terminou
Continue com a Central completa
Seus dados estão salvos. Escolha um plano e siga de onde parou ✨
{PLANS.map(plan => ( choose(plan.id)} /> ))}
Tudo incluído
Sofia IA ilimitada · Backup em nuvem · Cofrinhos e metas ilimitados · Relatórios PDF · 14 dias garantia
); } function PaywallCardMobile({ plan, onSelect }) { const perMonth = plan.total / plan.months; const periodLabel = plan.months === 1 ? '/mês' : plan.months === 6 ? '/sem' : '/ano'; return (
{plan.recommended && (
COMPLETO
)}
{plan.name}
{plan.save && ( -{plan.save} )}
{plan.subtitle}
{fmtBRL(plan.total)} {periodLabel}
{plan.months > 1 && (
{fmtBRL(perMonth)}/mês
)}
); } // Expõe globalmente window.WebPaywall = WebPaywall; window.MobilePaywall = MobilePaywall; })();