PageSourceSearch

https://teledoc.med.br/assets/ValidateDocumentPage-Cyxg-mPT.js

js teledoc.med.br collected 2026-10-02 00:26:50 UTC 9,919 bytes, 1 lines download raw bytes

1import{k as C,c as z,r as t,j as e}from"./vendor_react-DkiuXrlk.js";import{l as S}from"./index-Bxp3srNF.js";import{r as j,L,g as f,ad as E,v as b,b as P,$ as n,u as D,S as V,y as T}from"./vendor_icons-C2O4Okw2.js";import"./vendor_pdf-D9UlI7qi.js";import"./vendor_motion-mPVRFuhH.js";const F=()=>{const{code:r}=C(),[N]=z(),[i,v]=t.useState(r||N.get("codigo")||""),[c,m]=t.useState(!1),[s,l]=t.useState(null),[x,g]=t.useState(!1),[y,p]=t.useState(!1),h="";t.useEffect(()=>{r&&r.length>=6&&d(r)},[r]),t.useEffect(()=>{document.title="Validar documento | Teledoc";let a=document.querySelector('meta[name="robots"]');a||(a=document.createElement("meta"),a.setAttribute("name","robots"),document.head.appendChild(a)),a.content="noindex, nofollow, noarchive, nosnippet"},[]);const d=async a=>{const o=a||i.trim().toUpperCase();if(!o||o.length<6){l({valido:!1,mensagem:"Digite um código de validação válido (mínimo 6 caracteres)."}),g(!0);return}m(!0),g(!0);try{const u=S.API_URL||"",k=await(await fetch(`${u}/api/v1/public/validate/${o}`)).json();l(k)}catch{l({valido:!1,mensagem:"Erro ao validar documento. Tente novamente."})}finally{m(!1)}},w=a=>{a.key==="Enter"&&d()};return e.jsxs("div",{className:"min-h-screen bg-gradient-to-br from-slate-50 via-white to-primary-50 flex flex-col",children:[e.jsxs("main",{className:"flex-1 max-w-5xl mx-auto px-4 py-8 w-full",children:[e.jsxs("div",{className:"bg-white rounded-2xl shadow-xl shadow-gray-200/50 border border-gray-100 p-6 md:p-8 mb-8",children:[e.jsxs("div",{className:"text-center mb-8",children:[e.jsx("div",{className:"inline-flex h-20 mb-4",children:e.jsx("img",{src:`${h}/logo.png`,alt:"Teledoc",className:`w-full h-full object-contain transition-opacity duration-300 ${y?"opacity-100":"opacity-0"}`,onLoad:()=>p(!0),onError:()=>p(!0)})}),e.jsx("h2",{className:"text-2xl md:text-3xl font-bold text-gray-800 mb-3",children:"Validar documento"}),e.jsx("p",{className:"text-gray-600 max-w-lg mx-auto",children:"Digite o código de validação impresso no documento para verificar sua autenticidade e integridade."})]}),e.jsxs("div",{className:"max-w-xl mx-auto",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row gap-3",children:[e.jsxs("div",{className:"relative flex-1",children:[e.jsx(j,{size:18,className:"absolute left-4 top-1/2 -translate-y-1/2 text-gray-400"}),e.jsx("input",{type:"text",value:i,onChange:a=>v(a.target.value.toUpperCase()),onKeyPress:w,placeholder:"Ex: A3KM9X2P",className:"w-full pl-11 pr-4 py-4 text-lg font-mono tracking-widest uppercase border-2 border-gray-200 rounded-xl focus:border-primary-400 focus:ring-4 focus:ring-primary-100 outline-none transition-all bg-gray-50/50",maxLength:12})]}),e.jsx("button",{onClick:()=>d(),disabled:c||i.length<6,className:"px-8 py-4 bg-gradient-to-r from-primary-500 to-primary-600 hover:from-primary-600 hover:to-primary-700 disabled:from-gray-300 disabled:to-gray-400 text-white font-semibold rounded-xl transition-all flex items-center justify-center gap-2 shadow-lg shadow-primary-500/25 disabled:shadow-none",children:c?e.jsx(L,{size:20,className:"animate-spin"}):e.jsxs(e.Fragment,{children:[e.jsx(j,{size:20}),"Validar"]})})]}),e.jsx("p",{className:"text-center text-sm text-gray-400 mt-4",children:"O código está impresso no rodapé do documento assinado digitalmente."})]})]}),x&&s&&e.jsxs("div",{className:`bg-white rounded-2xl shadow-xl shadow-gray-200/50 border overflow-hidden transition-all ${s.valido?"border-green-200 ring-2 ring-green-500/20":"border-red-200 ring-2 ring-red-500/20"}`,children:[e.jsx("div",{className:`p-6 md:p-8 ${s.valido?"bg-gradient-to-r from-green-500 to-emerald-500":"bg-gradient-to-r from-red-500 to-rose-500"}`,children:e.jsxs("div",{className:"flex items-center gap-4",children:[s.valido?e.jsx("div",{className:"p-3 bg-white/20 rounded-2xl backdrop-blur-sm",children:e.jsx(f,{size:40,className:"text-white"})}):e.jsx("div",{className:"p-3 bg-white/20 rounded-2xl backdrop-blur-sm",children:e.jsx(E,{size:40,className:"text-white"})}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-2xl md:text-3xl font-bold text-white",children:s.valido?"Documento Válido ✓":"Documento Não Encontrado"}),e.jsx("p",{className:"text-white/80 mt-1",children:s.mensagem})]})]})}
1),s.valido&&s.documento&&e.jsxs("div",{className:"p-6 md:p-8",children:[e.jsxs("div",{className:"grid md:grid-cols-2 gap-6 mb-8",children:[e.jsxs("div",{className:"space-y-5",children:[e.jsxs("div",{className:"flex items-start gap-4",children:[e.jsx("div",{className:"p-3 bg-blue-100 rounded-xl",children:e.jsx(b,{size:22,className:"text-blue-600"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-gray-400 uppercase tracking-wide",children:"Tipo de Documento"}),e.jsx("p",{className:"font-bold text-gray-800 text-lg",children:s.documento.tipo})]})]}),e.jsxs("div",{className:"flex items-start gap-4",children:[e.jsx("div",{className:"p-3 bg-purple-100 rounded-xl",children:e.jsx(P,{size:22,className:"text-purple-600"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-gray-400 uppercase tracking-wide",children:"Data de Assinatura"}),e.jsx("p",{className:"font-bold text-gray-800 text-lg",children:new Date(s.documento.assinadoEm).toLocaleDateString("pt-BR",{day:"2-digit",month:"long",year:"numeric",hour:"2-digit",minute:"2-digit"})})]})]}),e.jsxs("div",{className:"flex items-start gap-4",children:[e.jsx("div",{className:"p-3 bg-teal-100 rounded-xl",children:e.jsx(n,{size:22,className:"text-teal-600"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-gray-400 uppercase tracking-wide",children:"Código de Validação"}),e.jsx("p",{className:"font-mono font-bold text-gray-800 text-xl tracking-[0.3em] bg-gray-100 px-3 py-1 rounded-lg inline-block",children:s.documento.codigoValidacao})]})]})]}),e.jsxs("div",{className:"space-y-5",children:[s.paciente&&e.jsxs("div",{className:"flex items-start gap-4",children:[e.jsx("div",{className:"p-3 bg-amber-100 rounded-xl",children:e.jsx(D,{size:22,className:"text-amber-600"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-gray-400 uppercase tracking-wide",children:"Paciente"}),e.jsx("p",{className:"font-bold text-gray-800 text-lg",children:s.paciente.nome}),s.paciente.cpfMascarado&&e.jsxs("p",{className:"text-sm text-gray-500 font-mono",children:["CPF: ",s.paciente.cpfMascarado]})]})]}),s.profissional&&e.jsxs("div",{className:"flex items-start gap-4",children:[e.jsx("div",{className:"p-3 bg-green-100 rounded-xl",children:e.jsx(V,{size:22,className:"text-green-600"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-gray-400 uppercase tracking-wide",children:s.profissional.tipo}),e.jsx("p",{className:"font-bold text-gray-800 text-lg",children:s.profissional.nome}),e.jsx("p",{className:"text-sm text-gray-500",children:s.profissional.registro})]})]})]})]}),e.jsxs("div",{className:"flex items-start gap-4 p-5 bg-gradient-to-r from-green-50 to-emerald-50 rounded-xl border border-green-200/50",children:[e.jsx(n,{size:22,className:"text-green-600 flex-shrink-0 mt-0.5"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm text-green-800 font-medium",children:"Autenticidade Garantida"}),e.jsx("p",{className:"text-sm text-green-700 mt-1",children:"Este documento possui assinatura digital com certificação ICP-Brasil, garantindo sua validade jurídica em todo território nacional, em conformidade com a MP 2.200-2/2001 e Lei 14.063/2020."})]})]}),s.verificadoEm&&e.jsxs("p",{className:"text-center text-sm text-gray-400 mt-6",children:["Verificação realizada em: ",new Date(s.verificadoEm).toLocaleString("pt-BR")]})]})]}),!x&&e.jsxs("div",{className:"grid md:grid-cols-3 gap-4 mt-8",children:[e.jsxs("div",{className:"bg-white/60 backdrop-blur-sm rounded-xl p-5 border border-gray-100",children:[e.jsx("div",{className:"w-10 h-10 bg-primary-100 rounded-lg flex items-center justify-center mb-3",children:e.jsx(n,{size:20,className:"text-primary-600"})}),e.jsx("h3",{className:"font-semibold text-gray-800 mb-1",children:"Seguro"}),e.jsx("p",{className:"text-sm text-gray-500",children:"Verificação protegida e validada pelo sistema."})]}),e.jsxs("div",{className:"bg-white/60 backdrop-blur-sm rounded-xl p-5 border border-gray-100",children:[e.jsx("div",{className:"w-10 h-10 bg-green-100 rounded-lg flex items-center justify-center mb-3",children:e.jsx(f,{size:20,className:"text-green-600"})}
1),e.jsx("h3",{className:"font-semibold text-gray-800 mb-1",children:"Autêntico"}),e.jsx("p",{className:"text-sm text-gray-500",children:"Confirma que o documento não foi alterado."})]}),e.jsxs("div",{className:"bg-white/60 backdrop-blur-sm rounded-xl p-5 border border-gray-100",children:[e.jsx("div",{className:"w-10 h-10 bg-blue-100 rounded-lg flex items-center justify-center mb-3",children:e.jsx(b,{size:20,className:"text-blue-600"})}),e.jsx("h3",{className:"font-semibold text-gray-800 mb-1",children:"Legal"}),e.jsx("p",{className:"text-sm text-gray-500",children:"Baseado na Lei 14.063/2020 de assinatura eletrônica."})]})]})]}),e.jsx("footer",{className:"bg-white/50 backdrop-blur-sm border-t border-gray-100 py-6 mt-auto",children:e.jsx("div",{className:"max-w-5xl mx-auto px-4",children:e.jsxs("div",{className:"flex flex-col md:flex-row items-center justify-between gap-4",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("img",{src:`${h}/logo.png`,alt:"Teledoc",className:"w-6 h-6 object-contain"}),e.jsxs("span",{className:"text-sm text-gray-500",children:["© ",new Date().getFullYear()," Teledoc - Sistema de Telemedicina"]})]}),e.jsx("div",{className:"flex items-center gap-4 text-sm text-gray-400",children:e.jsxs("a",{href:"mailto:[email protected]",className:"hover:text-primary-600 flex items-center gap-1.5",children:[e.jsx(T,{size:14}),"[email protected]"]})})]})})})]})};export{F as ValidateDocumentPage,F 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.