1import{bm as N,d as s,g as p,j as t,e as w,T as C}from"./index-BjLsg-Ak.js";import{a as S,b as k,B as E}from"./booking-dialog-DyCZKBfp.js";import"./dialog-B9fRFhMx.js";import"./chevron-left-Cl7JeZ7f.js";import"./chevron-right-f-TaOkac.js";import"./masked-input-BI8SSCBC.js";import"./client.server-DCSAgBBY.js";import"./pencil-DdaBcbnL.js";function T(){const{slug:r,appointmentId:o}=N.useParams(),[e,x]=s.useState(null),[c,h]=s.useState(null),[f,a]=s.useState(!0),[l,d]=s.useState(null),[g,b]=s.useState(!0),m=p(S),u=p(k);if(s.useEffect(()=>{let n=!1;return a(!0),d(null),Promise.all([m({data:{slug:r}}),u({data:{slug:r,appointmentId:o}})]).then(([i,y])=>{n||(x(i),h(y))}).catch(i=>{n||d(i instanceof Error?i.message:"Agendamento não encontrado")}).finally(()=>{n||a(!1)}),()=>{n=!0}},[m,u,r,o]),f)return t.jsx("div",{className:"min-h-screen flex items-center justify-center bg-background",children:t.jsx(w,{className:"h-6 w-6 animate-spin text-primary"})});if(l||!e||!c)return t.jsx("div",{className:"font-poppins min-h-screen bg-background flex items-center justify-center px-4",children:t.jsxs("div",{className:"max-w-md w-full text-center space-y-4 border border-border rounded-2xl p-8 bg-card",children:[t.jsx("div",{className:"w-14 h-14 mx-auto rounded-full bg-destructive/10 flex items-center justify-center",children:t.jsx(C,{className:"h-7 w-7 text-destructive"})}),t.jsx("h1",{className:"text-xl font-bold text-foreground",children:"Link inválido"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:l??"Este link de reagendamento não é mais válido."}),t.jsx("a",{href:`/c/${r}`,className:"inline-flex items-center justify-center text-sm font-medium text-primary hover:underline",children:"Fazer um novo agendamento â"})]})});const j=[e.street,e.number,e.neighborhood,e.city,e.state].filter(Boolean).join(", "),v={street:e.street,number:e.number,complement:e.complement,neighborhood:e.neighborhood,city:e.city,state:e.state,cep:e.cep};return t.jsx("div",{className:"min-h-screen bg-background",children:t.jsx(E,{open:g,onOpenChange:n=>{b(n),n||(window.location.href=`/c/${r}`)},procedures:e.procedures,clinicSlug:e.slug,clinicName:e.name,clinicAddress:j,clinicAddressParts:v,clinicPhone:e.phone,clinicWhatsapp:e.whatsapp_doctor,rescheduleContext:c})})}export{T 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.