PageSourceSearch

https://help.portalidea.com.br/assets/Login-CuDMLtxC.js

js portalidea.com.br collected 2026-10-01 15:42:06 UTC 3,778 bytes, 1 lines download raw bytes

1import{r as i,u as f,j as e,S as N,C as y,a as b,b as w,c as E,d as C,I as g,B as n,s as A,t as l,e as I}from"./index-DYFI-0-M.js";import{L as h}from"./label-Cmaf3gPF.js";import{S,U as L}from"./user-gVscXY95.js";import{L as k}from"./lock-DZ_udZZ_.js";const B=()=>{const[d,x]=i.useState(""),[c,p]=i.useState(""),[m,r]=i.useState(!1),o=f(),j=async s=>{var u;s.preventDefault(),r(!0);try{const{data:a,error:t}=await A.functions.invoke("admin-login",{body:{email:d,password:c}});if(t||!(a!=null&&a.token)){const v=(u=t==null?void 0:t.context)==null?void 0:u.status;l({title:"Erro no login",description:v===429?"Muitas tentativas. Aguarde alguns minutos.":"Email ou senha incorretos. Tente novamente.",variant:"destructive"}),r(!1);return}I(a.token),localStorage.setItem("adminEmail",a.user.email),localStorage.setItem("adminName",a.user.name),localStorage.setItem("adminRole",a.user.role),localStorage.setItem("adminId",a.user.id),l({title:"Login realizado com sucesso!",description:`Bem-vindo, ${a.user.name}!`}),setTimeout(()=>{o("/painel-adm")},600)}catch(a){console.error("Erro no login:",a),l({title:"Erro no login",description:"Ocorreu um erro interno. Tente novamente.",variant:"destructive"})}r(!1)};return e.jsxs(e.Fragment,{children:[e.jsx(N,{title:"Login Administrativo - Portal IDEA",description:"Acesso restrito ao painel administrativo da Central de Ajuda do Portal IDEA. Login seguro para gerenciamento de conteúdo.",keywords:"login, admin, portal idea, painel administrativo, acesso restrito"}),e.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center p-4",style:{backgroundImage:"linear-gradient(135deg, hsl(180 65% 55% / 0.1) 0%, hsl(260 60% 55% / 0.1) 100%)"},children:e.jsx("div",{className:"w-full max-w-md",children:e.jsxs(y,{className:"shadow-elegant bg-gradient-card",children:[e.jsxs(b,{className:"text-center",children:[e.jsxs("div",{className:"flex items-center justify-center gap-3 mb-4",children:[e.jsx("img",{src:"/icone.png",alt:"Portal IDEA Logo",className:"h-12 w-auto"}),e.jsx("div",{className:"w-12 h-12 bg-primary rounded-full flex items-center justify-center",children:e.jsx(S,{className:"h-6 w-6 text-primary-foreground"})})]}),e.jsx(w,{className:"text-2xl font-bold",children:"Portal IDEA"}),e.jsx(E,{children:"Acesso Administrativo - Central de Ajuda"})]}),e.jsxs(C,{children:[e.jsxs("form",{onSubmit:j,className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(h,{htmlFor:"email",children:"Email"}),e.jsxs("div",{className:"relative",children:[e.jsx(L,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-muted-foreground h-4 w-4"}),e.jsx(g,{id:"email",type:"email",placeholder:"[email protected]",value:d,onChange:s=>x(s.target.value),className:"pl-10",required:!0})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(h,{htmlFor:"password",children:"Senha"}),e.jsxs("div",{className:"relative",children:[e.jsx(k,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-muted-foreground h-4 w-4"}),e.jsx(g,{id:"password",type:"password",placeholder:"••••••••",value:c,onChange:s=>p(s.target.value),className:"pl-10",required:!0})]})]}),e.jsx(n,{type:"submit",className:"w-full bg-primary hover:bg-primary/90 transition-smooth btn-mobile",disabled:m,children:m?"Entrando...":"Entrar no Painel"})]}),e.jsxs("div",{className:"mt-6 text-center space-y-3",children:[e.jsx(n,{variant:"ghost",onClick:()=>o("/forgot-password"),className:"text-primary hover:text-primary/80 text-sm",children:"Esqueci minha senha"}),e.jsx("div",{className:"border-t pt-3",children:e.jsx(n,{variant:"ghost",onClick:()=>o("/"),className:"text-muted-foreground hover:text-foreground",children:"← Voltar para Central de Ajuda"})})]})]})]})})})]})};export{B as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.