| Current Path : /home/users/unlimited/www/web.medimeet.codeskitter.site/assets/ |
| Current File : /home/users/unlimited/www/web.medimeet.codeskitter.site/assets/ContactUs-C7jI2nxl.js |
import{p as E,ad as M,r as f,aF as T,j as e,B as i,T as r,au as m,I as u,c0 as C,H as h,c1 as W,c2 as R,ao as l,ap as d,Q as x,V as k,W as B,X as N,c3 as U,l as Y,ah as g,av as G,a7 as L}from"./index-DjKxDI5z.js";import{u as Q}from"./index.esm-CezfYLhO.js";import{G as S}from"./grid-item-Mhehj2ZM.js";import{T as $}from"./textarea-BkR2wR26.js";const H=async s=>{const o=await G(L.token,"add_contact_us_form_data",s);if(o.response!==200)throw new Error(o.message);return o};function K(){const{settingsData:s}=E(),o=s==null?void 0:s.find(a=>a.id_name==="phone"),w=s==null?void 0:s.find(a=>a.id_name==="phone_second"),v=s==null?void 0:s.find(a=>a.id_name==="email"),y=s==null?void 0:s.find(a=>a.id_name==="address"),_=s==null?void 0:s.find(a=>a.id_name==="clinic_location_latitude"),I=s==null?void 0:s.find(a=>a.id_name==="clinic_location_longitude"),j=M(),[b,c]=f.useState(!1),{register:n,handleSubmit:A,reset:z,formState:{errors:t}}=Q(),p=T({mutationFn:async a=>{c(!1);let q={...a};await H(q)},onSuccess:()=>{g(j,"success","Success"),c(!0),z()},onError:a=>{g(j,"error",a.message)}}),F=a=>{p.mutate(a)};return f.useEffect(()=>{setTimeout(()=>{c(!1)},4e3)},[b]),e.jsxs(i,{children:[" ",e.jsx(i,{bg:"primary.main",p:4,py:{base:"4",md:"20"},children:e.jsxs(i,{className:"container",children:[e.jsx(r,{fontFamily:"Quicksand, sans-serif",fontSize:{base:20,md:32},fontWeight:700,textAlign:"center",mt:0,color:"#fff",children:"Contact Us"}),e.jsx(r,{fontFamily:"Quicksand, sans-serif",fontSize:{base:12,md:16},fontWeight:500,textAlign:"center",mt:0,color:"#fff",children:"We are here to assist you with any inquiries or support. Feel free to contact us, and we will get back to you as soon as possible."})]})})," ",e.jsxs(i,{p:8,maxW:"1200px",mx:"auto",children:[e.jsxs(m,{columns:{base:1,md:3},spacing:6,mb:8,children:[e.jsxs(i,{p:6,boxShadow:"md",borderRadius:"md",textAlign:"center",bg:"white",children:[e.jsx(u,{as:C,boxSize:8,mb:4,color:"blue.500"}),e.jsx(h,{as:"h3",size:"md",mb:2,children:"Address"}),e.jsx(r,{children:y.value})]}),e.jsxs(i,{p:6,boxShadow:"md",borderRadius:"md",textAlign:"center",bg:"white",children:[e.jsx(u,{as:W,boxSize:8,mb:4,color:"blue.500"}),e.jsx(h,{as:"h3",size:"md",mb:2,children:"Call Us"}),e.jsx(r,{children:o.value}),e.jsx(r,{children:w.value})]}),e.jsxs(i,{p:6,boxShadow:"md",borderRadius:"md",textAlign:"center",bg:"white",children:[e.jsx(u,{as:R,boxSize:8,mb:4,color:"blue.500"}),e.jsx(h,{as:"h3",size:"md",mb:2,children:"Email Us"}),e.jsx(r,{children:v.value})]})]}),e.jsxs(m,{columns:{base:1,md:2},spacing:6,children:[e.jsx(S,{children:e.jsx(i,{as:"iframe",src:`https://www.google.com/maps?q=${_.value},${I.value}&hl=es;z=14&output=embed`,width:"100%",height:"400",frameBorder:"0",style:{border:0},allowFullScreen:"","aria-hidden":"false",tabIndex:"0"})}),e.jsx(S,{children:e.jsx(i,{p:6,boxShadow:"md",borderRadius:"md",bg:"white",children:e.jsxs("form",{onSubmit:A(F),children:[e.jsxs(m,{columns:2,spacing:4,children:[e.jsxs(l,{isInvalid:t.name,children:[e.jsx(d,{children:"Your Name"}),e.jsx(x,{type:"text",placeholder:"Your Name",...n("name",{required:"Name is required"})})]}),e.jsxs(l,{isInvalid:t.email,children:[e.jsx(d,{children:"Your Email"}),e.jsx(x,{type:"email",placeholder:"Your Email",...n("email",{required:"Email is required",pattern:{value:/^\S+@\S+\.\S+$/,message:"Invalid email format"}})})]})]}),e.jsxs(l,{mt:4,isInvalid:t.subject,children:[e.jsx(d,{children:"Subject"}),e.jsx(x,{type:"text",placeholder:"Subject",...n("subject",{required:"Subject is required"})})]}),e.jsxs(l,{mt:4,isInvalid:t.message,children:[e.jsx(d,{children:"Message"}),e.jsx($,{placeholder:"Message",...n("message",{required:"Message is required"})})]}),b?e.jsxs(k,{mt:4,status:"success",variant:"subtle",flexDirection:"column",alignItems:"center",justifyContent:"center",textAlign:"center",children:[e.jsx(B,{boxSize:"20px",mr:0}),e.jsx(N,{mt:2,fontSize:"md",children:"Message Recived!"}),e.jsx(U,{maxWidth:"sm",children:"We have received your message and will get back to you soon."})]}):null,e.jsx(Y,{colorScheme:"blue",mt:4,width:"full",type:"submit",isLoading:p.isPending,children:"Send Message"})]})})})]})]})]})}export{K as default};