/* global React */ const { useState: useStateSim, useMemo: useMemoSim } = React; function Simulator({ savingsPct = 16, onSubmit }) { const [stage, setStage] = useStateSim(0); // 0=form, 1=upload, 2=done const [bill, setBill] = useStateSim(280); const [name, setName] = useStateSim(""); const [phone, setPhone] = useStateSim(""); const [city, setCity] = useStateSim(""); const [file, setFile] = useStateSim(null); const [filePreview, setFilePreview] = useStateSim(null); const monthly = useMemoSim(() => Math.round(bill * (savingsPct / 100)), [bill, savingsPct]); const annual = monthly * 12; const onFile = (e) => { const f = e.target.files?.[0]; if (f) { setFile(f); const reader = new FileReader(); reader.onload = (ev) => setFilePreview(ev.target.result); reader.readAsDataURL(f); } }; return (
Cadastre sua conta

Veja sua economia real
antes mesmo de assinar.

Informe o valor médio da sua conta de luz e veja quanto você economiza todo mês. Sem custo, sem compromisso.

Sua economia estimada · todo mês
R${monthly}
Conta atual
R$ {bill}
Após desconto
R$ {bill - monthly}
Em 12 meses: R$ {annual.toLocaleString("pt-BR")} economizados. Em 5 anos: R$ {(annual*5).toLocaleString("pt-BR")}.
=0?"active":""}`}> Etapa {stage+1} de 2 =1?"active":""}`}>
{stage === 0 && ( <>

Qual o valor da sua conta de luz?

Informe o valor médio em reais. Pode ser aproximado.

setBill(Math.max(0, +e.target.value || 0))} style={{fontSize: 24, fontWeight: 700, fontFamily: "var(--font-display)", color: "var(--green-900)", borderColor: "var(--green-400)"}} /> setBill(+e.target.value)} style={{accentColor:"var(--green-700)", marginTop: 6}}/>
R$ 80R$ 2.000+
setName(e.target.value)}/>
setCity(e.target.value)}/>
setPhone(e.target.value)}/>
)} {stage === 1 && ( <>

Mande sua conta (opcional)

Foto ou PDF. A gente analisa e devolve uma simulação exata em até 24h.

)} {stage === 2 && (

Cadastro recebido!

Em até 24h você recebe a simulação completa no WhatsApp {phone || "(31) 97142-5778"}.

)}
); } window.Simulator = Simulator;