PageSourceSearch

https://quattrefisioterapia.lovable.app/assets/auth-BYq-aE0D.js

js quattrefisioterapia.lovable.app collected 2026-10-03 03:41:00 UTC 7,550 bytes, 1 lines download raw bytes

1import{c as z,a as O,u as R,b as q,d as t,j as e,Q as f,S as M,i as W,L as p,I as _,E as B,B as g,e as C,k as V,f as G,C as H,n as D,t as r,p as K,s as Q}from"./index-Cg4Z73Bp.js";import{M as E}from"./masked-input-BpSDEEGi.js";import{D as J,a as U,b as Y,c as X,d as Z,e as $}from"./dialog-Bdpgmus5.js";import{f as ee}from"./ms-fachada.jpg.asset-DuAxSG-c.js";import{E as se}from"./eye-off-BiZFiqD9.js";import{K as ae}from"./key-round-7s9NeUX8.js";const te=z({method:"POST"}).handler(O("d40e40ef0a1b02aa3ea81ad7ff01f1f5e0b77be1b855bc12a8c369b186e5e4a4")),re="msintegrado";function me(){const o=R(),{user:l,profile:c,roles:j,loading:d,signOut:b}=q(),[v,F]=t.useState(""),[m,I]=t.useState(""),[h,P]=t.useState(!1),[N,w]=t.useState(!1),[T,n]=t.useState(!1),[y,S]=t.useState(""),[u,k]=t.useState(!1);async function A(s){s.preventDefault();const a=D(y);if(a.length<10){r.error("Telefone inválido",{description:"Informe DDD + número."});return}k(!0);try{await te({data:{phone:a}}),r.success("Solicitação enviada",{description:"Se o telefone estiver cadastrado, você receberá uma senha temporária no WhatsApp em alguns segundos."}),n(!1),S("")}catch(i){const x=i instanceof Error?i.message:"Falha ao solicitar redefinição";r.error("Erro",{description:x})}finally{k(!1)}}if(t.useEffect(()=>{if(!d&&l){if(!c&&j.length===0){b();return}c?.must_change_password?o({to:"/trocar-senha",replace:!0}):o({to:"/admin",replace:!0})}},[d,l,c,j.length,o,b]),d||l)return e.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background",children:e.jsxs("div",{className:"flex flex-col items-center gap-4",children:[e.jsx(f,{size:48,withWordmark:!0}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Verificando sessão..."})]})});async function L(s){s.preventDefault();const a=D(v);if(a.length<8){r.error("Telefone inválido",{description:"Informe DDD + número."});return}if(!m){r.error("Informe sua senha");return}w(!0);const i=K(a),{error:x}=await Q.auth.signInWithPassword({email:i,password:m});if(w(!1),x){r.error("Não foi possível entrar",{description:"Verifique telefone e senha."});return}r.success("Bem-vindo!")}return e.jsxs("div",{className:"flex min-h-screen flex-col bg-background",children:[e.jsxs("div",{className:"grid flex-1 lg:grid-cols-2",children:[e.jsxs("aside",{className:"relative hidden overflow-hidden lg:flex lg:flex-col lg:justify-between lg:p-12 bg-sidebar text-sidebar-foreground",children:[e.jsx("img",{src:ee.url,alt:"","aria-hidden":!0,className:"absolute inset-0 h-full w-full object-cover"}),e.jsx("div",{"aria-hidden":!0,className:"absolute inset-0",style:{backgroundImage:"radial-gradient(circle at 20% 20%, oklch(0.74 0.128 74 / 0.30), transparent 55%), radial-gradient(circle at 80% 80%, oklch(0.30 0.030 74 / 0.55), transparent 55%), linear-gradient(135deg, oklch(0.16 0.010 70 / 0.93), oklch(0.24 0.016 72 / 0.93))"}}),e.jsx("div",{className:"relative z-10 flex justify-center text-white",children:e.jsx(f,{size:40,withWordmark:!0,variant:"light"})}),e.jsxs("div",{className:"relative z-10 flex flex-col items-center space-y-6 text-center",children:[e.jsxs("div",{className:"inline-flex items-center gap-2 rounded-full border border-white/15 bg-white/5 px-3 py-1 text-xs font-medium backdrop-blur",children:[e.jsx(M,{className:"h-3.5 w-3.5 text-brand-amber"}),"MS Reabilitação e Treinamento Integrado"]}),e.jsx("h1",{className:"whitespace-nowrap text-[clamp(1.25rem,2.2vw,1.875rem)] font-semibold leading-tight tracking-tight text-white",children:"Gestão completa da sua clínica em um só lugar."}),e.jsx("p",{className:"max-w-xl text-base leading-relaxed text-white/75",children:"Fisioterapia, Pilates e treino funcional em grupos de até 4 pessoas. Agenda, prontuário, WhatsApp e financeiro em uma experiência sóbria, segura e veloz."}),e.jsxs("div",{className:"flex items-center gap-3 pt-4 text-xs text-white/60",children:[e.jsx(W,{className:"h-4 w-4 text-brand-amber"}),"Rua Jacuí, 3.967 — Ipiranga | Rua Luther King, 20 — Cidade Nova | BH-MG"]})]}),e.jsxs("div",{className:"relative z-10 text-center text-xs text-white/50",children:["© ",new Date().getFullYear()," MS Reabilitação e Treinamento Integrado. Todos os direitos reservados."]})]}),e.jsxs("main",{className:"flex flex-col",children:[e.jsx("div",{className:"flex flex-1 items-center justify-center px-4 py-10 sm:px-6",children:e.jsxs("div",{className:"w-full max-w-md",children:[e.jsx("div",{className:"mb-8 flex items-center justify-between lg:hidden",children:e.jsx(f,{size:32})}),e.jsxs("div",{className:"space-y-1.5 text-center",children:[e.jsx("h2",{className:"text-2xl font-semibold tracking-tight text-foreground",children:"Entrar na plataforma"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Acesse com o telefone cadastrado da clínica."})]}),e.jsxs("form",{onSubmit:L,className:"mt-8 space-y-5",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(p,{htmlFor:"phone",children:"Telefone"}),e.jsx(E,{id:"phone",mask:"phone",autoComplete:"tel",placeholder:"(00) 00000-0000",value:v,onValueChange:(s,a)=>F(a),className:"h-11",required:!0})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(p,{htmlFor:"password",children:"Senha"}),e.jsxs("div",{className:"relative",children:[e.jsx(_,{id:"password",type:h?"text":"password",autoComplete:"current-password",value:m,onChange:s=>I(s.target.value),className:"h-11 pr-10",required:!0}),e.jsx("button",{type:"button",tabIndex:-1,onMouseDown:s=>s.preventDefault(),onClick:s=>{s.stopPropagation(),P(a=>!a)}
1,className:"absolute right-2 top-1/2 z-10 -translate-y-1/2 rounded-md p-1.5 text-muted-foreground transition-colors hover:bg-accent hover:text-foreground","aria-label":h?"Ocultar senha":"Mostrar senha",children:h?e.jsx(se,{className:"h-4 w-4"}):e.jsx(B,{className:"h-4 w-4"})})]}),e.jsx("div",{className:"flex justify-end",children:e.jsx("button",{type:"button",onClick:()=>n(!0),className:"text-xs font-medium text-primary hover:underline",children:"Esqueci minha senha"})})]}),e.jsxs(g,{type:"submit",className:"h-11 w-full",disabled:N,children:[N&&e.jsx(C,{className:"mr-2 h-4 w-4 animate-spin"}),"Entrar"]}),e.jsx("div",{className:"text-center",children:e.jsx(V,{to:"/",className:"text-xs font-medium text-muted-foreground transition-colors hover:text-foreground hover:underline",children:"← Voltar ao site"})}),e.jsx("p",{className:"text-center text-xs text-muted-foreground",children:"Acesso restrito. Em caso de dúvidas, contate o administrador."})]})]})}),e.jsx(G,{})]})]}),e.jsx(H,{slug:re}),e.jsx(J,{open:T,onOpenChange:n,children:e.jsxs(U,{className:"sm:max-w-md",children:[e.jsxs(Y,{children:[e.jsxs(X,{className:"flex items-center gap-2",children:[e.jsx(ae,{className:"h-5 w-5 text-primary"}),"Esqueci minha senha"]}),e.jsx(Z,{children:"Informe o telefone cadastrado (clínica ou usuário). Enviaremos uma senha temporária via WhatsApp e você definirá uma nova no primeiro acesso."})]}),e.jsxs("form",{onSubmit:A,className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(p,{htmlFor:"forgot-phone",children:"Telefone"}),e.jsx(E,{id:"forgot-phone",mask:"phone",autoComplete:"tel",placeholder:"(00) 00000-0000",value:y,onValueChange:(s,a)=>S(a),className:"h-11",required:!0})]}),e.jsxs($,{className:"gap-2 sm:gap-2",children:[e.jsx(g,{type:"button",variant:"ghost",onClick:()=>n(!1),disabled:u,children:"Cancelar"}),e.jsxs(g,{type:"submit",disabled:u,children:[u&&e.jsx(C,{className:"mr-2 h-4 w-4 animate-spin"}),"Enviar senha temporária"]})]})]})]})})]})}export{me as component};

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.