1import{r as s,j as e}from"./react-daO8XSXc.js";import{a6 as E,a7 as S,s as R,U as k,a4 as z,a8 as A}from"./index-B58ZFblL.js";import{I as j}from"./Input-BllD4-Ae.js";import{a4 as I,a5 as C,a as L,y as M}from"./lucide-DgiROqw5.js";import"./supabase-CWGMQrOR.js";import"./framer-CJI0BPWU.js";const W=({isOpen:o,onClose:y,onLogin:m})=>{const[r,u]=s.useState(""),[p,x]=s.useState(""),[f,a]=s.useState(""),[h,i]=s.useState(!1),[v,n]=s.useState(!1),[l,c]=s.useState(""),w=async()=>{if(!r.trim()){a("Informe o e-mail acima para receber o link de recuperação.");return}a(""),c(""),n(!0);const t=await A(r);if(n(!1),t==="limite"){a("Muitas tentativas seguidas. Espere alguns minutos e tente de novo.");return}if(t==="falha"){a("Não conseguimos enviar agora. Verifique a conexão e tente de novo.");return}c(`Se houver uma conta em ${r.trim()}, o link de recuperação foi enviado. Ele vale por tempo limitado.`)};s.useEffect(()=>{o&&(a(""),i(!1),c(""),n(!1),u(""),x(""))},[o]);const N=async t=>{var g;t.preventDefault(),a(""),i(!0);try{const{data:d,error:b}=await R.auth.signInWithPassword({email:r,password:p});if(b){a(b.message==="Invalid login credentials"?"E-mail ou senha incorretos.":"Ocorreu um erro. Tente novamente.");return}if(!k((g=d.user)==null?void 0:g.app_metadata)){await z(),a("Esta conta não tem permissão de administrador.");return}m&&m("admin")}catch(d){console.error("Erro de autenticação:",d),a("Ocorreu um erro. Tente novamente.")}finally{i(!1)}};return e.jsx(E,{isOpen:o,onClose:y,size:"md",className:"p-0 overflow-hidden border border-white/10",children:e.jsxs("div",{className:"w-full relative bg-[#050505] flex flex-col justify-center",children:[e.jsx("div",{className:"absolute inset-0 bg-gradient-to-br from-crimson/10 via-trans
1parent to-blue-900/10 opacity-60 pointer-events-none"}),e.jsx("div",{className:"absolute top-0 left-0 w-full h-full bg-noise opacity-10 mix-blend-overlay pointer-events-none"}),e.jsxs("div",{className:"p-8 md:p-10 relative z-10 flex flex-col justify-center",children:[e.jsx("div",{className:"mb-8 flex justify-center",children:e.jsx("img",{src:"https://cgixkcjvnytslvpabzow.supabase.co/storage/v1/object/public/site/midia/brand/growth-conference-logo.png",alt:"Logo",className:"h-8 w-auto opacity-90"})}),e.jsxs("div",{className:"text-center mb-8",children:[e.jsx("h2",{className:"text-2xl font-bold text-white mb-2 tracking-tight",children:"Acesso Restrito"}),e.jsx("p",{className:"text-gray-400 text-sm font-light",children:"Informe credenciais de gerenciamento."})]}),f&&e.jsxs("div",{className:"mb-6 p-3 rounded-lg bg-red-500/10 border border-red-500/20 flex items-center justify-center gap-2 text-red-400 text-xs animate-in fade-in slide-in-from-top-2 text-center",children:[e.jsx(I,{size:16}),f]}),e.jsxs("form",{className:"space-y-4",onSubmit:N,children:[e.jsx(j,{label:"Email Corporativo",type:"email",placeholder:"[email protected]",value:r,onChange:t=>u(t.target.value),icon:e.jsx(C,{size:16}),required:!0}),e.jsx(j,{label:"Senha",id:"login-senha",type:"password",placeholder:"â¢â¢â¢â¢â¢â¢â¢â¢",value:p,onChange:t=>x(t.target.value),icon:e.jsx(L,{size:16}),required:!0}),e.jsx(S,{type:"submit",variant:"primary",fullWidth:!0,isLoading:h,className:"mt-8 shadow-[0_0_20px_rgba(255,0,0,0.15)]",rightIcon:!h&&e.jsx(M,{size:14,className:"group-hover:translate-x-1 transition-transform"}),children:"Acessar Dashboard"})]}),e.jsxs("div",{className:"mt-5 text-center space-y-2",children:[l&&e.jsx("p",{className:"text-xs text-gray-400 leading-relaxed animate-in fade-in",children:l}),e.jsx("button",{type:"button",onClick:w,disabled:v,className:"text-xs text-gray-500 hover:text-white underline underline-offset-4 transition-colors disabled:opacity-50",children:v?"Enviandoâ¦":l?"Enviar de novo":"Esqueci minha senha"})]}),e.jsx("div",{className:"mt-8 text-center border-t border-white/5 pt-6",children:e.jsx("p",{className:"text-[10px] text-gray-600 uppercase tracking-widest font-mono",children:"Uso exclusivo administrativo"})})]})]})})};export{W 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.