1import{r as g,A as k,c as Q,l as o,q as X,f as s,n as e,t as _,v as i,F as b,p as x,h as p,D as S,G as M,M as ee,H as te,S as le,i as n,B as se,a5 as W}from"./K-I_OXp7.js";import{_ as oe,a as ne,b as ae,c as ie,d as re}from"./DhNemgce.js";import{_ as de}from"./yL-Mf2k0.js";import{F as ue}from"./6gHC3bcd.js";import"./kSNd0Trm.js";import"./DlAUqK2U.js";const ce={class:"min-h-screen"},me={class:"mb-4 flex items-center space-x-4 border bg-slate-800 px-3 py-4 text-white"},pe={class:"mx-4 border-b pb-2"},fe={class:"mb-2 flex items-start"},ge={class:"mr-4 flex items-center rounded-full bg-green-200 p-1"},be=["src","alt"],xe={class:"w-3/4 flex-wrap"},ve={class:"mb-1 flex text-xl font-semibold"},he={class:"text-sm"},ye={key:0},we={class:"font-medium"},_e={class:"text-gray-600"},ke={key:0,class:"mx-4 mb-1 border-b py-3"},De={class:"text-gray-600"},Ce={class:"font-medium"},Ae={key:1,class:"mx-4 mt-4"},Ne={class:"mb-4"},$e=["onClick"],ze=["src"],Se={class:"text-left"},Me={class:"font-medium"},Ve={class:"text-sm text-gray-600"},Be={key:2,class:"mx-4 mt-4"},Pe={class:"mb-10 flex space-x-4 overflow-auto"},Fe=["onClick"],Ie={class:""},Le={class:"text-sm text-green-600"},Te={class:"mb-4 border-b pb-2 text-xl font-semibold"},We={key:0,class:"mb-2 border-b pb-4"},Ee={class:"flex flex-wrap gap-2"},Ze=["onClick"],Ue={key:1,class:"mb-2 border-b pb-4"},He={class:"flex flex-wrap gap-2"},Re=["onClick"],qe={key:2,class:"mb-2 border-b pb-4"},Oe={class:"flex flex-wrap gap-2"},Ge=["onClick"],Je={key:3,class:"mb-2 border-b pb-4"},Ke={class:"flex flex-wrap gap-2"},Ye=["onClick"],je={key:3,class:"mx-4 mt-4"},Qe={class:"mb-4 w-full"},Xe={key:0,class:"mt-2 text-sm text-red-500"},et={class:"mb-4 w-full"},tt={key:0,class:"mt-2 text-sm text-red-500"},lt={class:"phone mb-4 w-full"},st={class:"relative mb-2 flex w-full items-center"},ot=["src"],nt={key:0,class:"absolute top-12 z-10 mt-1 max-h-80 w-full rounded-md border bg-white pl-0 text-sm lg:text-base",tabindex:"-1",role:"listbox","aria-labelledby":"phone-label","aria-activedescendant":"listbox-option-3"},at={class:"sticky top-0 z-10 rounded-md bg-white"},it={class:"relative cursor-default select-none list-none px-3 py-2 text-gray-900"},rt={class:"max-h-64 overflow-y-scroll"},dt=["onClick"],ut=["alt","src"],ct={class:"truncate font-normal"},mt={class:"mb-1 text-sm text-red-500"},pt={key:4,class:"mx-4 mt-4 flex flex-col items-center py-10"},wt={__name:"DoctorProfileAppointmentMobilePage",props:{doctorData:{type:Object,default:()=>({})},facilityData:{type:Object,default:()=>({})}},emits:["getFacilityData"],setup(m,{emit:E}){const d=m,B=E,v=g(1),f=g(null),y=g(null),P=k(()=>{var a;return d.facilityData.slots?(a=d.facilityData.slots[f.value])==null?void 0:a.filter(t=>t.split(" ")[1]==="am"&&Number(t.split(":")[0])<12):[]}),F=k(()=>{var a;return d.facilityData.slots?(a=d.facilityData.slots[f.value])==null?void 0:a.filter(t=>t.split(" ")[1]==="pm"&&(Number(t.split(":")[0])<4||Number(t.split(":")[0])===12)):[]}),I=k(()=>{var a;return d.facilityData.slots?(a=d.facilityData.slots[f.value])==null?void 0:a.filter(t=>t.split(" ")[1]==="pm"&&Number(t.split(":")[0])>=4&&Number(t.split(":")[0])<8):[]}),L=k(()=>{var a;return d.facilityData.slots?(a=d.facilityData.slots[f.value])==null?void 0:a.filter(t=>t.split(" ")[1]==="pm"&&Number(t.split(":")[0])>8&&Number(t.split(":")[0])<12):[]}),D=a=>{y.value={day:f.value,time:a},v.value=3},C=g({name:"India",iso:"IN",code:"+91",flagIcon:"https://purecatamphetamine.github.io/country-flag-icons/3x2/IN.svg"}),w=g(""),A=g(!1),Z=()=>{A.value=!A.value},U=a=>{C.value=a,w.value="",A.value=!1},H=k(()=>w.value.length<3?W:W.filter(a=>a.name.toLowerCase().includes(w.value.toLowerCase()))),V=g(null),R=()=>{var a;(a=V.value)==null||a.show()},q=a=>{var t;if(a===!0){const N={name:r.value.name,email:r.value.email};B("submitAppointment",N);const $=`Hello ${d.doctorData.name}. I am ${r.value.name}. I found your profile on ClinicSpots. I wanted to book an appointment with you on ${y.value.day} at ${y.value.time} in ${d.facilityData.facility_name}.`,z=d.doctorData.whatsapp_number||d.doctorData.phone;v.value=4,(t=V.value)==null||t.close(),setTimeout(()=>
1{le(`https://api.whatsapp.com/send/?phone=${z}&text=${$}&type=phone_number&app_absent=0`,{external:!0,open:{target:"_blank"}})},1500)}else verification="OTP not verified"};let h=!0;const r=g({name:null,email:null,phone:null}),u=g({name:null,email:null,phone:null}),O=/\d/,G=/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,J=/^[0-9]+$/,K=()=>{h=!0,u.value.name=null,u.value.email=null,u.value.phone=null,r.value.name?O.test(r.value.name)&&(u.value.name="Name cannot contain any digits",h=!1):(u.value.name="Name is required",h=!1),r.value.email&&!G.test(r.value.email)&&(u.value.email="Please enter your email address",h=!1),r.value.phone?(!J.test(r.value.phone)||r.value.phone.length<6||r.value.phone.length>15)&&(u.value.phone="Please enter a valid WhatsApp Number",h=!1):(u.value.phone="Please enter your WhatsApp Number",h=!1)},Y=()=>{K(),h&&R()},j=a=>{B("getFacilityData",a)};return Q(()=>d.facilityData,a=>{a.slots&&(v.value=2,f.value=Object.keys(d.facilityData.slots)[0])},{immediate:!0}),(a,t)=>{var N,$,z,T;return n(),o("div",ce,[X(s(re),{ref_key:"verificationModal",ref:V,"device-type":"mobile","country-code":s(C).code,"phone-number":s(r).phone,onCheckVerified:q},null,8,["country-code","phone-number"]),e("div",me,[e("button",{onClick:t[0]||(t[0]=l=>a.$router.go(-1))},t[7]||(t[7]=[e("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"size-5"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M15.75 19.5 8.25 12l7.5-7.5"})],-1)])),t[8]||(t[8]=e("h1",{class:"text-xl font-medium"},"Book Appointment",-1))]),e("div",pe,[e("div",fe,[e("div",ge,[e("img",{src:m.doctorData.media.url,alt:m.doctorData.media.alt_text,class:"size-20 rounded-full"},null,8,be)]),e("div",xe,[e("h1",ve,[_(i(m.doctorData.name)+" ",1),t[9]||(t[9]=e("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",class:"ml-2 mt-1 size-6 text-green-600"},[e("path",{"fill-rule":"evenodd",d:"M8.603 3.799A4.49 4.49 0 0 1 12 2.25c1.357 0 2.573.6 3.397 1.549a4.49 4.49 0 0 1 3.498 1.307 4.491 4.491 0 0 1 1.307 3.497A4.49 4.49 0 0 1 21.75 12a4.49 4.49 0 0 1-1.549 3.397 4.491 4.491 0 0 1-1.307 3.497 4.491 4.491 0 0 1-3.497 1.307A4.49 4.49 0 0 1 12 21.75a4.49 4.49 0 0 1-3.397-1.549 4.49 4.49 0 0 1-3.498-1.306 4.491 4.491 0 0 1-1.307-3.498A4.49 4.49 0 0 1 2.25 12c0-1.357.6-2.573 1.549-3.397a4.49 4.49 0 0 1 1.307-3.497 4.49 4.49 0 0 1 3.497-1.307Zm7.007 6.387a.75.75 0 1 0-1.22-.872l-3.236 4.53L9.53 12.22a.75.75 0 0 0-1.06 1.06l2.25 2.25a.75.75 0 0 0 1.14-.094l3.75-5.25Z","clip-rule":"evenodd"})],-1))]),e("p",he,[(n(!0),o(b,null,x(m.doctorData.specializations,(l,c)=>(n(),o("span",{key:l},i(c!==m.doctorData.specializations.length-1?`${l}, `:l),1))),128))])])]),m.facilityData.facility_address?(n(),o("div",ye,[e("p",we,i(m.facilityData.facility_name),1),e("span",_e,i(m.facilityData.facility_address),1)])):p("",!0)]),s(y)?(n(),o("div",ke,[e("p",De,[t[10]||(t[10]=_(" Appointment on: ")),e("span",Ce,i(s(y).time)+", "+i(s(y).day),1)])])):p("",!0),s(v)===1?(n(),o("div",Ae,[t[11]||(t[11]=e("h2",{class:"mb-4 text-xl font-semibold"},"Select Facility",-1)),e("div",Ne,[(n(!0),o(b,null,x(m.doctorData.facilities,l=>(n(),o("button",{key:l.id,class:"mb-4 flex size-full space-x-4 rounded-lg border p-2",onClick:c=>j(l.id)},[e("img",{src:l.logo.url||s(ue),alt:"Default facility photo",class:"size-14 object-contain"},null,8,ze),e("div",Se,[e("p",Me,i(l.name),1),e("p",Ve,i(l.full_address),1)])],8,$e))),128))])])):p("",!0),s(v)===2?(n(),o("div",Be,[t[16]||(t[16]=e("h2",{class:"mb-4 text-xl font-semibold"},"Select a day",-1)),e("div",Pe,[(n(!0),o(b,null,x(m.facilityData.slots,(l,c)=>(n(),o("div",{key:`slotDay-${c}`},[e("button",{class:se(["flex min-w-36 max-w-36 flex-col items-center rounded-lg border py-2",{"border-green-600 bg-green-50":s(f)==c}]),onClick:ft=>f.value=c},[e("p",Ie,i(c),1),e("p",Le,i(l.length)+" slots",1)],10,Fe)]))),128))]),e("h2",Te,i(s(f)),1),(N=s(P))!=null&&N.length?(n(),o("div",We,[t[12]||(t[12]=e("p",{class:"mb-4 flex items-center text-lg font-medium"},[e("img",{src:oe,alt:"morning",class:"mr-2 size-9 rounded-full bg-green-50 p-1"}),_(" Morning ")],-1)),e("div",Ee,[(n(!0),o(b,null,x(s(P),l=>(n(),o("button",{key:l,class:"rounded-lg bg-green-600 px-4 py-2 text-white",onClick:c=>D(l)},i(l),9,Ze))),128))])])):p("",!0),($=s(F))!=null&&$.length?(n(),o("div",Ue,[t[13]||(t[13]=e("p",{class:"mb-4 flex items-center text-lg font-medium"},[e("img",{src:ne,alt:"afternoon",class:"mr-2 size-9 rounded-full bg-green-50 p-1"}),_(" Afternoon ")],-1)),e("div",He,[(n(!0),o(b,null,x(s(F),l=>(n(),o("button",{key:l,class:"rounded-lg bg-green-600 px-4 py-2 text-white",onClick:c=>D(l)},i(l),9,Re))),128))])])):p("",!0),(z=s(I))!=null&&z.length?(n(),o("div",qe,[t[14]||(t[14]=e("p",{class:"mb-4 flex items-center text-lg font-medium"},[e("img",{src:ae,alt:"evening",class:"mr-2 size-9 rounded-full bg-green-50 p-1"}),_(" Evening ")],-1)),e("div",Oe,[(n(!0),o(b,null,x(s(I),l=>(n(),o("button",{key:l,class:"rounded-lg bg-green-600 px-4 py-2 text-white",onClick:c=>D(l)},i(l),9,Ge))),128))])])):p("",!0),(T=s(L))!=null&&T.length?(n(),o("div",Je,[t[15]||(t[15]=e("p",{class:"mb-4 flex items-center text-lg font-medium"},[e("img",{src:ie,alt:"night",class:"mr-2 size-9 rounded-full bg-green-50 p-1"}),_(" Night ")],-1)),e("div",Ke,[(n(!0),o(b,null,x(s(L),l=>(n(),o("button",{key:l,class:"rounded-lg bg-green-600 px-4 py-2 text-white",onClick:c=>D(l)}
1,i(l),9,Ye))),128))])])):p("",!0)])):s(v)===3?(n(),o("div",je,[t[24]||(t[24]=e("h2",{class:"mb-4 text-xl font-semibold"},"Patient Details",-1)),e("form",{onSubmit:t[6]||(t[6]=te(()=>{},["prevent"]))},[e("div",Qe,[t[17]||(t[17]=e("label",{class:"mb-1 block text-xs font-semibold uppercase tracking-wide text-gray-500 lg:mb-2",for:"grid-full-name"}," Full name ",-1)),S(e("input",{id:"grid-full-name","onUpdate:modelValue":t[1]||(t[1]=l=>s(r).name=l),required:"",class:"block w-full appearance-none rounded border border-gray-200 bg-gray-100 px-3 py-2 leading-tight text-gray-700 focus:border-green-500 focus:bg-white focus:outline-none lg:px-4 lg:py-3",type:"text",placeholder:"John Doe"},null,512),[[M,s(r).name]]),s(u).name?(n(),o("p",Xe,i(s(u).name),1)):p("",!0)]),e("div",et,[t[18]||(t[18]=e("label",{class:"mb-1 block text-xs font-semibold uppercase tracking-wide text-gray-500 lg:mb-2",for:"grid-email"}," Email ",-1)),S(e("input",{id:"grid-email","onUpdate:modelValue":t[2]||(t[2]=l=>s(r).email=l),class:"block w-full appearance-none rounded border border-gray-200 bg-gray-100 px-3 py-2 leading-tight text-gray-700 focus:border-green-500 focus:bg-white focus:outline-none lg:px-4 lg:py-3",type:"email",placeholder:"[email protected]"},null,512),[[M,s(r).email]]),s(u).email?(n(),o("p",tt,i(s(u).email),1)):p("",!0)]),e("div",lt,[t[22]||(t[22]=e("label",{id:"phone-label",class:"mb-1 block text-xs font-semibold tracking-wide text-gray-500 lg:mb-2",for:"grid-zip"}," WHATSAPP PHONE NUMBER ",-1)),e("div",st,[t[21]||(t[21]=e("img",{src:de,alt:"WhatsApp logo",class:"mr-2 size-9"},null,-1)),e("button",{type:"button",class:"mr-1 flex min-w-max cursor-pointer items-center rounded-md border border-gray-200 bg-gray-100 p-2 text-sm focus:border-green-500 focus:outline-none lg:py-3","aria-haspopup":"listbox","aria-expanded":"true","aria-label":"Select Country",onClick:t[3]||(t[3]=l=>Z())},[e("img",{alt:"country flag",src:s(C).flagIcon,class:"mr-2 h-4 rounded-sm",height:"16",width:"24"},null,8,ot),e("span",null,i(s(C).code),1),t[19]||(t[19]=e("span",{class:"pl-2"},[e("svg",{class:"size-5 text-gray-300",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},[e("path",{"fill-rule":"evenodd",d:"M10 3a1 1 0 01.707.293l3 3a1 1 0 01-1.414 1.414L10 5.414 7.707 7.707a1 1 0 01-1.414-1.414l3-3A1 1 0 0110 3zm-3.707 9.293a1 1 0 011.414 0L10 14.586l2.293-2.293a1 1 0 011.414 1.414l-3 3a1 1 0 01-1.414 0l-3-3a1 1 0 010-1.414z","clip-rule":"evenodd"})])],-1))]),S(e("input",{id:"grid-zip","onUpdate:modelValue":t[4]||(t[4]=l=>s(r).phone=l),class:"block w-full appearance-none rounded border border-gray-200 bg-gray-100 px-3 py-2 leading-tight text-gray-700 focus:border-green-500 focus:bg-white focus:outline-none lg:px-4 lg:py-3",type:"tel",placeholder:"9999900000"},null,512),[[M,s(r).phone]]),s(A)?(n(),o("ul",nt,[e("div",at,[e("li",it,[S(e("input",{ref:"countrySearch","onUpdate:modelValue":t[5]||(t[5]=l=>ee(w)?w.value=l:null),type:"search",name:"search",autocomplete:"off",class:"block w-full rounded-md border border-gray-300 px-3 py-2 text-sm focus:border-green-500 focus:outline-none lg:px-4",placeholder:"Search a country"},null,512),[[M,s(w)]])]),t[20]||(t[20]=e("hr",null,null,-1))]),e("div",rt,[(n(!0),o(b,null,x(s(H),l=>(n(),o("li",{key:l.iso,class:"relative flex cursor-pointer select-none list-none items-center py-2 pl-3 pr-9 text-gray-900 transition hover:bg-gray-100",role:"option",onClick:c=>U(l)},[e("img",{alt:l.iso,src:l.flagIcon,class:"mr-2 inline h-4 rounded-sm",height:"16",width:"24"},null,8,ut),e("span",ct,i(l.name)+" ("+i(l.code)+") ",1)],8,dt))),128))])])):p("",!0)]),e("p",mt,i(s(u).phone)+" Â ",1),t[23]||(t[23]=e("p",{class:"text-xs italic text-gray-600"}," We recommend you to enter your WhatsApp. The appointment will be booked through your WhatsApp account for a hassle free experience. ",-1))]),e("button",{type:"submit","aria-label":"Submit Form",class:"relative w-full rounded-md bg-green-600 px-4 py-2 text-center text-white hover:bg-green-500 lg:w-auto",onClick:Y}," Book Appointment ")],32)])):s(v)===4?(n(),o("div",pt,t[25]||(t[25]=[e("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"
1currentColor",class:"mb-2 size-20 text-green-600"},[e("path",{"fill-rule":"evenodd",d:"M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12Zm13.36-1.814a.75.75 0 1 0-1.22-.872l-3.236 4.53L9.53 12.22a.75.75 0 0 0-1.06 1.06l2.25 2.25a.75.75 0 0 0 1.14-.094l3.75-5.25Z","clip-rule":"evenodd"})],-1),e("p",{class:"mb-4 text-2xl font-medium"},"Appointment almost booked...",-1),e("p",{class:"mb-6 text-center"}," You will be redirected to WhatsApp to continue the appointment booking process ",-1)]))):p("",!0)])}}};export{wt 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.