"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9080],{89080:function(e,t,i){i.d(t,{qJ:function(){return ea},I_:function(){return b},Xc:function(){return p},hP:function(){return eR},Fk:function(){return ef},XO:function(){return ey},P4:function(){return ej},VI:function(){return eC},mc:function(){return ew},mQ:function(){return ek},KJ:function(){return ex}});var o=i(85893),n=i(66242),r=i(23795),s=i(87357),l=i(15861),a=i(2734),c=i(41664),d=i.n(c),x=i(67294),h=i(78741),m=i(36662),p=e=>{let{id:t,name:i,image:c}=e,x=(0,a.Z)();return(0,o.jsx)(n.Z,{sx:{width:"100%",maxWidth:"290px",boxShadow:x.customShadows.z4,transition:"100ms","&:hover":{boxShadow:x.customShadows.z12,transform:"translate(0, -3px)",color:"primary.main"}},children:(0,o.jsxs)(r.Z,{component:d(),href:"".concat(m.GK.doctors,"?departmentId=").concat(t),color:"inherit",sx:{"&:hover":{textDecoration:"none"}},children:[(0,o.jsx)(s.Z,{p:1,children:(0,o.jsx)(h.Z,{alt:"name",src:c||"/assets/department-test-image.png",ratio:"6/4",sx:{borderRadius:1.5}})}),(0,o.jsx)(l.Z,{variant:"h4",pb:2,pt:1,px:2,textAlign:"center",children:i})]})})},u=i(51233),g=i(25675),f=i.n(g),j=i(12699),b=e=>{let{title:t,text:i,image:r,color:s="primary",sx:c,...d}=e,x=(0,a.Z)();return(0,o.jsxs)(n.Z,{sx:{pt:1,px:5,height:"100%",boxShadow:0,textAlign:"center",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"space-between",color:x.palette.common.black,bgcolor:x.palette.common.white,rowGap:3,border:"1px solid",borderColor:"primary.darker",...c},...d,"data-testid":j.B.cardWithPhone.card,children:[(0,o.jsxs)(u.Z,{width:"100%",display:"flex",alignItems:"flex-start",justifyContent:"flex-start",textAlign:"left",children:[(0,o.jsx)(l.Z,{variant:"h4",fontWeight:600,mt:2,sx:{fontSize:"25px"},children:t}),(0,o.jsx)(l.Z,{variant:"body2",color:"grey.600",mt:1,"data-testid":j.B.cardWithPhone.text,textAlign:"left",sx:{fontSize:"14px"},children:i})]}),(0,o.jsx)(f(),{width:215,height:322,src:"/assets/images/phones/".concat(r),alt:r,style:{objectFit:"contain",objectPosition:"bottom",width:"100%",height:"90%"}})]})},y=i(83965),Z=i(44267),w=i(83321),v=i(83894),C=i(5152),I=i.n(C),T=i(11163),S=i(55678),k=i(80350),W=i(98854),R=i(80546),z=i(72691),D=i(32236),P=i(85841),A=i(25652),E=i(34077),N=i(17601),F=i(67140),G=i(68228),B=i(62166),H=i(96186),M=i(57334),O=i.n(M),L=i(44253),_=i(86886),q=i(32912),U=i(42227),V=i(36609),X=i(75217),Y=i(88490),J=i(26725),K=e=>{let t,{timeslots:i=[],onClick:n=()=>{},handleDoctorClick:a=()=>{},href:c=""}=e,d=(0,X.Z)("up","md"),x=(0,X.Z)("down","sm");return(0,o.jsx)(s.Z,{display:"flex",flexDirection:"column",children:!!i.length&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(l.Z,{pt:"20px",pb:"5px",variant:"body4",fontWeight:500,children:(0,V.t)("doctors.todayAvailableTime")}),(0,o.jsx)(_.ZP,{container:!0,direction:"row",columns:3,spacing:1,rowSpacing:2,sx:{hideScrollbarX:Y.IW,hideScrollbarY:Y.U3},children:i.length&&(t=i,d&&i.length>9&&(t=i.slice(0,9)),!d&&i.length>3&&(t=i.slice(0,3)),t.map(e=>(0,o.jsx)(_.ZP,{item:!0,md:1,onClick:()=>n(e),sx:{cursor:"pointer"},children:(0,o.jsx)(s.Z,{height:d?"18px":"40px",width:d?"auto":"80px",bgcolor:"grey.200",borderRadius:"5px",display:"flex",justifyContent:"center",alignItems:"center",children:(0,o.jsx)(l.Z,{variant:"body5",children:e.startTimestamp&&(0,q.Z)((0,U.Z)(e.startTimestamp),J.Ne)})})},e.id)))}),(d&&i.length>9||!d&&i.length>3)&&(0,o.jsx)(r.Z,{sx:{marginTop:"5px",width:"max-content",...x&&{alignSelf:"center"}},onClick:a,href:c,children:(0,V.t)("doctors.seeAllTimeSlots")})]})})},Q=e=>{let{name:t="",href:i="",languages:n=[],departments:a=[],timeslots:c=[],handleDoctorClick:h=()=>{},onClickSlot:m=()=>{}}=e,{translate:p,currentLang:u}=(0,B.n)(),g=(0,x.useMemo)(()=>!!(null==n?void 0:n.length)&&n.map(e=>{let{countryCode:t,id:i}=e;return t&&G.v5.includes(t.toUpperCase())&&(0,o.jsx)(O(),{hasDropShadow:!0,size:"m",code:t.toUpperCase()},"".concat(i,"-").concat(t))}),[n]),f=(0,x.useMemo)(()=>a.map((e,t)=>(0,o.jsx)(l.Z,{variant:"overlineBold",component:"span",color:"primary.main",sx:{lineHeight:"15px",textTransform:"initial"},children:"".concat((0,L.W)(e.name||"",p)).concat(a.length===t+1?"":", ")},e.id)),[a,u]);return(0,o.jsxs)(s.Z,{display:"flex",flexDirection:"column",children:[(0,o.jsxs)(s.Z,{display:"flex",flexDirection:"row",justifyContent:"flex-start",columnGap:2,pb:"10px",children:[(0,o.jsx)(r.Z,{component:d(),href:i,underline:"none",onClick:h,sx:{"& :hover":{color:"primary.main"}},children:(0,o.jsx)(l.Z,{variant:"subtitle1",component:"span",color:"grey.600",children:t})}),(0,o.jsx)(s.Z,{maxWidth:100,mt:.7,display:"flex",columnGap:.5,rowGap:.5,flexWrap:"wrap",alignItems:"flex-start",alignContent:"flex-start",justifyContent:"flex-end",children:g})]}),(0,o.jsx)(s.Z,{display:"flex",flexDirection:"row",alignItems:"flex-start",flexWrap:"wrap",children:f}),(0,o.jsx)(s.Z,{display:{xs:"none",sm:"block"},children:(0,o.jsx)(K,{timeslots:c,onClick:m,handleDoctorClick:h,href:i})})]})},$=i(69661),ee=i(72583),et=i(32018),ei=e=>{let{profilePicture:t,isOnline:i=!1,isFavoriteLocally:n=!1,handleFavoriteButtonClick:r=()=>{}}=e,l=(0,X.Z)("up","sm"),a=l?156:96;return(0,o.jsxs)(s.Z,{width:a,height:a,position:"relative",children:[(0,o.jsx)(s.Z,{display:"flex",flexDirection:"column",alignItems:"center",children:(0,o.jsx)($.Z,{src:null==t?void 0:t.url,alt:(null==t?void 0:t.hashedName)||"doctor",style:{borderRadius:"15px",width:a,height:a}})}),(0,o.jsx)(s.Z,{sx:{position:"absolute",top:"10px",left:"10px",display:"flex",alignItems:"center",justifyContent:"center",width:"18px",height:"18px",borderRadius:"9px",border:"2px solid",borderColor:i?"common.white":"grey.400",bgcolor:"secondary.contrastText"},children:i?(0,o.jsx)(et.R,{size:10}):(0,o.jsx)(s.Z,{width:"10px",height:"10px",borderRadius:"5px",bgcolor:"grey.400","data-testid":j.B.cardWithDoctorProfile.isOnlineIndicator})}),(0,o.jsx)(s.Z,{sx:{position:"absolute",padding:"10px",top:"-4px",right:"-2px",width:"44px",height:"44px",cursor:"pointer"},onClick:r,children:(0,o.jsx)(ee.Wv,{isRed:n})})]})},eo=i(49086),en=e=>{let{price15:t,price20:i,price30:n}=e;return(0,o.jsxs)(s.Z,{sx:{display:"flex",flexDirection:"row",justifyContent:"flex-end",alignItems:"center",flex:1,gap:{xs:"3px",lg:"16px"}},children:[(0,o.jsxs)(s.Z,{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"space-between",width:"53px",height:"48px",p:"5px",bgcolor:"secondary.dark",borderRadius:"5px",children:[(0,o.jsx)(l.Z,{display:"flex",variant:"body5",lineHeight:1.2,component:"span",color:"grey.0",children:t}),(0,o.jsx)(s.Z,{height:"1px",width:"100%",bgcolor:"grey.0"}),(0,o.jsx)(l.Z,{fontSize:"8px",lineHeight:1.5,color:"grey.0",children:(0,V.t)("doctors.forNumberOfMinutes",{value:eo.BF.SHORT})})]}),(0,o.jsxs)(s.Z,{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"space-between",width:"53px",height:"48px",p:"5px",bgcolor:"secondary.dark",borderRadius:"5px",children:[(0,o.jsx)(l.Z,{display:"flex",variant:"body5",lineHeight:1.2,component:"span",color:"grey.0",children:i}),(0,o.jsx)(s.Z,{height:"1px",width:"100%",bgcolor:"grey.0"}),(0,o.jsx)(l.Z,{fontSize:"8px",lineHeight:1.5,color:"grey.0",children:(0,V.t)("doctors.forNumberOfMinutes",{value:eo.BF.MEDIUM})})]}),(0,o.jsxs)(s.Z,{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"space-between",width:"53px",height:"48px",p:"5px",bgcolor:"secondary.dark",borderRadius:"5px",children:[(0,o.jsx)(l.Z,{display:"flex",variant:"body5",lineHeight:1.2,component:"span",color:"grey.0",children:n}),(0,o.jsx)(s.Z,{height:"1px",width:"100%",bgcolor:"grey.0"}),(0,o.jsx)(l.Z,{fontSize:"8px",lineHeight:1.5,color:"grey.0",children:(0,V.t)("doctors.forNumberOfMinutes",{value:eo.BF.LONG})})]})]})},er=i(27979),es=e=>{let{calculatedScore:t,rating:i}=e;return(0,o.jsxs)(s.Z,{display:"flex",justifyContent:"space-between",width:"100%",children:[(0,o.jsx)(s.Z,{display:"flex",flexDirection:"column",alignItems:"center"}),(0,o.jsxs)(s.Z,{display:"flex",alignItems:"center",gap:"4px",children:[(0,o.jsx)(s.Z,{sx:{width:"36px",height:"33px",borderRadius:"3px",display:"flex",justifyContent:"center",alignItems:"center"},bgcolor:"grey.300",children:(0,o.jsx)(er.Z,{width:15,height:15,icon:"mdi:crown",color:"secondary.dark"})}),(0,o.jsx)(s.Z,{sx:{width:"36px",height:"33px",borderRadius:"3px",display:"flex",justifyContent:"center",alignItems:"center"},bgcolor:"grey.300",children:(0,o.jsx)(er.Z,{width:15,height:15,icon:"material-symbols:verified-user",color:"secondary.main"})})]})]})};let el=I()(()=>Promise.resolve().then(i.bind(i,827)),{loadableGenerated:{webpack:()=>[827]},ssr:!1});var ea=e=>{var t;let{doctor:i,isOnline:r,isFavorite:l,handleFavoriteIconClick:c}=e,{id:d,profilePicture:h,titlePrefix:p,firstName:g,lastName:f,titleSuffix:b,departments:C,languages:I}=i,M=(0,a.Z)(),{translate:O}=(0,B.n)(),{push:L,pathname:_}=(0,T.useRouter)(),{calculatedScore:q}=(0,z.r)(null==i?void 0:i.userRatings),U=(0,N.CG)(E.HF),{isAuthenticated:V,userType:X}=(0,F.E)(),{setDoctorInfo:Y}=(0,x.useContext)(D.X),[J,$]=(0,x.useState)(l||!1),[ee,et]=(0,x.useState)(!1),[eo,er]=(0,x.useState)(!1),[ea,ec]=(0,x.useState)(null),[ed,ex]=(0,x.useState)(!1),[eh,em]=(0,x.useState)(null),[ep,eu]=(0,x.useState)(!1),[eg]=(0,P.ce)(),[ef]=(0,P.Iw)(),ej=async e=>{if(!V||X!==A.FW.PATIENT){await L({pathname:m.jb.loginPatient,query:{backUrl:_}});return}ec(e),et(!0)},eb=async()=>{if(!V||X!==A.FW.PATIENT){await L({pathname:m.jb.loginPatient,query:{backUrl:_}});return}if(!ev()){S.Am.error(O("doctors.immediateCallIsNotAvailable"));return}ec(null),er(!0)},ey=()=>{Y(i)},eZ=async()=>{let e=await c(d,J);e&&$(e=>!e)},ew=(0,x.useMemo)(()=>{let e=(0,H.VN)(),t=Math.floor((0,v.Z)(new Date).getTime()/1e3),o=null==i?void 0:i.timeslots.filter(i=>{let{startTimestamp:o}=i;return o&&o>=e&&o<t});return null==o?void 0:o.sort((e,t)=>e.startTimestamp-t.startTimestamp)},[null==i?void 0:i.timeslots]),ev=()=>{if(!(null==i?void 0:i.online)||!(null==i?void 0:i.freeNext35Min))return!1;if(ew.length){let e=[...ew].sort((e,t)=>e.startTimestamp-t.startTimestamp)[0],t=(0,H.VN)()+2100;if(e.startTimestamp<t)return!1}return!0},eC=(0,x.useMemo)(()=>ev(),[ew,null==i?void 0:i.online,null==i?void 0:i.freeNext35Min]),eI=async(e,t)=>{let{reason:o,duration:n,isFastAppointment:r}=e,s=null==i?void 0:i[n];if(!s)return;if(s>(null==U?void 0:U.credits)){em({price:s,reason:o,duration:n,isFastAppointment:r}),et(!1),ex(!0);return}if(!n||!r&&(!(null==ea?void 0:ea.id)||!(null==ea?void 0:ea.startTimestamp))){et(!1),ec(null),em(null),S.Am.error(O("toasts.somethingWentWrong"));return}let l={discountCode:t||void 0,doctorId:i.id,patientId:U.id,description:o||"",bookingDuration:R._Y[n]};if(r){let{isSuccess:e}=await ef({...l});e&&(er(!1),S.Am.success(O("toasts.successfullyBooked")),L(m.PO.scheduledAppointment));return}let{isSuccess:a}=await eg({...l,timeslotId:Number(null==ea?void 0:ea.id),startTime:String(null==ea?void 0:ea.startTimestamp),endTime:String((0,H.uz)(null==ea?void 0:ea.startTimestamp,R.nL[n]))});a&&(Y(e=>({...e,timeslots:(null==e?void 0:e.timeslots.length)?[...e.timeslots.filter(e=>e.id!==(null==ea?void 0:ea.id))]:[]})),et(!1),ec(null),em(null),S.Am.success(O("toasts.successfullyBooked")))},eT=async()=>{if(ex(!1),!(null==i?void 0:i.id)||!(null==eh?void 0:eh.duration)||!(null==eh?void 0:eh.isFastAppointment)&&(!(null==ea?void 0:ea.id)||!(null==ea?void 0:ea.startTimestamp))){ex(!1),ec(null),em(null),S.Am.error(O("toasts.somethingWentWrong"));return}let e={doctorId:i.id,patientId:U.id,description:(null==eh?void 0:eh.reason)||"",bookingDuration:R._Y[eh.duration]};if(eh.isFastAppointment){let{isSuccess:t}=await ef({...e});t&&(er(!1),em(null),S.Am.success(O("toasts.successfullyBooked")));return}if(!ea)return;let{isSuccess:t}=await eg({...e,timeslotId:Number(ea.id),startTime:String(ea.startTimestamp),endTime:String((0,H.uz)(ea.startTimestamp,R.nL[eh.duration]))});t&&(Y(e=>({...e,timeslots:(null==e?void 0:e.timeslots.length)?[...e.timeslots.filter(e=>e.id!==(null==ea?void 0:ea.id))]:[]})),et(!1),ec(null),em(null),S.Am.success(O("toasts.successfullyBooked")))},eS=async()=>{V&&X===A.FW.PATIENT||await L({pathname:m.jb.loginPatient,query:{backUrl:_}}),eu(!0)};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(n.Z,{sx:{py:{xs:"14px",lg:"26px"},px:{xs:"10px",lg:"20px"},boxShadow:M.customShadows.z20,display:"flex",flexDirection:{xs:"column",sm:"row"},borderRadius:"30px",textDecoration:"none"},children:[(0,o.jsx)(y.Z,{children:(0,o.jsxs)(s.Z,{flexBasis:"row",display:"flex",gap:1,justifyContent:{xs:"flex-start",sm:"space-between"},children:[(0,o.jsx)(ei,{profilePicture:h,isOnline:r,isFavoriteLocally:J,handleFavoriteButtonClick:eZ}),(0,o.jsx)(s.Z,{display:{sx:"block",sm:"none"},children:(0,o.jsx)(Q,{name:"".concat(p||""," ").concat(g," ").concat(f," ").concat(b||""),href:m.GK.doctorById(d),languages:I,departments:C,timeslots:ew,handleDoctorClick:ey,onClickSlot:ej})})]})}),(0,o.jsx)(Z.Z,{sx:{pl:3,py:0,width:"100%",pb:"0 !important",px:{xs:"10px",lg:3}},children:(0,o.jsxs)(s.Z,{display:"flex",children:[(0,o.jsx)(s.Z,{display:{xs:"none",sm:"block"},width:{xs:"100%",sm:"60%"},children:(0,o.jsx)(Q,{name:"".concat(p||""," ").concat(g," ").concat(f," ").concat(b||""),href:m.GK.doctorById(d),languages:I,departments:C,timeslots:ew,handleDoctorClick:ey,onClickSlot:ej})}),(0,o.jsxs)(s.Z,{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",gap:"16px",flex:1,pl:"10px",children:[(0,o.jsx)(es,{calculatedScore:q,rating:(null==i?void 0:null===(t=i.userRatings)||void 0===t?void 0:t.length)||0}),(0,o.jsx)(en,{price15:"".concat(null==i?void 0:i.priceFor15," ").concat(G.Xz),price20:"".concat(null==i?void 0:i.priceFor20," ").concat(G.Xz),price30:"".concat(null==i?void 0:i.priceFor30," ").concat(G.Xz)}),(0,o.jsx)(s.Z,{display:{xs:"block",sm:"none"},children:(0,o.jsx)(K,{timeslots:ew,onClick:ej,handleDoctorClick:ey,href:m.GK.doctorById(d)})}),(0,o.jsxs)(u.Z,{gap:.5,children:[ew.length?(0,o.jsx)(w.Z,{fullWidth:!0,variant:"outlined",disabled:!ew.length,"data-testid":j.B.cardWithDoctorProfile.callNowBtn,onClick:()=>{if(!ew.length)return;let e=ew.find(e=>{let{startTimestamp:t}=e;return t>=(0,H.VN)()});e&&ej(e)},children:O("doctors.bookNow")}):(0,o.jsx)(w.Z,{fullWidth:!0,size:"medium",variant:"outlined",sx:{height:40},onClick:eS,children:O("common.appReq")}),eC&&(0,o.jsx)(w.Z,{fullWidth:!0,size:"medium",variant:"contained",color:"secondary",sx:{height:40},onClick:eb,children:O("doctors.immediateCall")})]})]})]})})]}),(0,o.jsx)(W.Nd,{doctorInfo:i,timeslot:ea,open:ee||eo,handleClose:()=>{ec(null),et(!1),er(!1)},onSubmit:eI,isFastAppointment:eo}),(0,o.jsx)(el,{open:ed,handleClose:eT}),(0,o.jsx)(k.RD,{doctorInfo:i,open:ep,handleClose:()=>eu(!1)})]})},ec=i(67720),ed=i(87541);let ex=e=>{let{title:t,text:i,avatarSrc:n,time:r,duration:a,withBottomDivider:c}=e;return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(s.Z,{py:2,px:3,children:[(0,o.jsxs)(s.Z,{display:"flex",columnGap:3,children:[(0,o.jsx)($.Z,{sx:{width:40,height:40,borderRadius:"8px"},src:n,alt:"patient-avatar"}),(0,o.jsxs)(u.Z,{children:[(0,o.jsx)(l.Z,{fontSize:14,fontWeight:400,lineHeight:"20px",children:t}),(0,o.jsx)(l.Z,{fontSize:12,fontWeight:300,lineHeight:"20px",maxWidth:202,children:i})]})]}),(0,o.jsxs)(s.Z,{display:"flex",alignItems:"center",columnGap:6,mt:1,children:[(0,o.jsx)(ed.Ew,{time:r,clockSize:25}),(0,o.jsx)(l.Z,{component:"span",variant:"subtitle4",children:a})]})]}),c&&(0,o.jsx)(ec.Z,{sx:{borderStyle:"dashed",borderWidth:1,mx:3}})]})};var eh=i(93919),em=i(41796);let ep=e=>({borderRadius:"20px",boxShadow:e.customShadows.z4,textTransform:"initial","&:hover":{boxShadow:e.customShadows.z4,bgcolor:(0,em.Fq)(e.palette.secondary.main,.05)}});var eu=i(4926),eg=i(46042),ef=e=>{let{cardVariant:t=eh.z.WHITE,orderStatus:i,isDownloadButton:n,isPaid:r,name:c,date:d,durationTime:h,onButtonClick:m,sx:p}=e,{translate:g}=(0,B.n)(),f=(0,a.Z)(),j=(0,x.useMemo)(()=>t===eh.z.WHITE?{bgcolor:"common.white",sx:{boxShadow:f.customShadows.z4,...p}}:t===eh.z.GREY?{bgcolor:"grey.100"}:{},[t,p,f.customShadows.z4]),b=(0,x.useMemo)(()=>{switch(i){case eg.Zx.PAID:return{labelText:"doctor.paid",labelColor:"green",isCreditIcon:!0};case eg.Zx.COMPLETED:return{labelText:"doctor.completed",labelColor:"green",isCreditIcon:!0,buttonText:n?"doctor.reports":"doctor.createReports"};case eg.Zx.PENDING_APPROVAL:return{labelText:"doctor.requested",labelColor:"purple"};case eg.Zx.REJECTED:return{labelText:"doctor.rejected",labelColor:"red"};case eg.Zx.ACCEPTED:return{labelText:"doctor.accepted",labelColor:"red"};case eg.Zx.PENDING_PAYMENT:return{labelText:"doctor.noFunds",labelColor:"customGrey"};case eg.Zx.CANCELLED:return{labelText:"doctor.cancelled",labelColor:"red"};default:return{labelText:"",labelColor:"red"}}},[n,i]);return(0,o.jsxs)(s.Z,{width:"100%",borderRadius:"10px",bgcolor:"common.white",py:{xs:1.5,sm:2.5},px:{xs:1.5,sm:2.5},...j,children:[(0,o.jsxs)(s.Z,{display:"flex",justifyContent:"space-between",children:[(0,o.jsxs)(s.Z,{display:"flex",alignItems:"center",children:[(0,o.jsx)(er.Z,{width:20,height:20,icon:"uil:schedule"}),(0,o.jsx)(l.Z,{variant:"body2",ml:{xs:.5,sm:1.5},mt:.4,component:"span",children:d})]}),(0,o.jsxs)(s.Z,{display:"flex",alignItems:"center",children:[(null==b?void 0:b.isCreditIcon)&&r&&(0,o.jsx)(er.Z,{width:30,height:30,icon:"ph:credit-card"}),(0,o.jsx)(eu.Z,{ml:{xs:.5,sm:2},variant:"customFilled",color:b.labelColor,sx:{minWidth:{xs:80,sm:90}},children:g(b.labelText)})]})]}),(0,o.jsx)(ec.Z,{variant:"fullWidth",sx:{my:{xs:1.5,sm:2.5},borderStyle:"dashed",borderColor:"grey.400"}}),(0,o.jsxs)(s.Z,{display:"flex",justifyContent:"space-between",alignItems:"center",children:[(0,o.jsxs)(u.Z,{children:[(0,o.jsx)(l.Z,{variant:"subtitle4",mb:{xs:.5,sm:1.5},sx:{fontWeight:500},children:c}),(0,o.jsx)(eu.Z,{variant:"customFilled",color:"blue",startIcon:(0,o.jsx)(er.Z,{mr:.5,color:"common.white",icon:"basil:clock-outline"}),sx:{width:100},children:h})]}),(0,o.jsx)(s.Z,{children:!!(null==b?void 0:b.buttonText)&&(0,o.jsxs)(w.Z,{onClick:m,variant:"lightContained",color:"secondary",size:"small",sx:{...ep(f)},children:[n&&(0,o.jsx)(er.Z,{mr:2,icon:"mdi:download-box-outline"}),g(b.buttonText)]})})]})]})},ej=e=>{let{name:t,departments:i,time:n,onDownloadInvoiceClick:r,onDownloadReportClick:c,onBookAgainClick:d,onRatingClick:x,hasRating:h,sx:m}=e,p=(0,a.Z)(),g=(0,X.Z)("down","sm"),{translate:f}=(0,B.n)(),j=()=>null==i?void 0:i.split(", ").map(e=>(0,o.jsx)(eu.Z,{color:"primary",sx:{fontWeight:400,bgcolor:"grey.100",color:"primary.main",mr:1},children:(0,L.W)(e||"",f)},e));return(0,o.jsxs)(s.Z,{width:"100%",borderRadius:"10px",bgcolor:"common.white",py:2.5,px:1.5,sx:{boxShadow:p.customShadows.z4,...m},children:[(0,o.jsxs)(s.Z,{display:"flex",justifyContent:"space-between",mx:1,children:[(0,o.jsxs)(s.Z,{display:"flex",alignItems:"center",columnGap:2,children:[(0,o.jsx)(l.Z,{fontSize:16,lineHeight:"20px",fontWeight:500,component:"span",children:t}),(0,o.jsx)(s.Z,{maxWidth:500,display:{xs:"none",sm:"block"},children:j()})]}),(0,o.jsxs)(s.Z,{display:"flex",alignItems:"center",children:[(0,o.jsx)(er.Z,{width:20,height:20,icon:"uil:schedule"}),(0,o.jsx)(l.Z,{variant:"body2",ml:1.5,mt:.4,component:"span",children:n})]})]}),(0,o.jsx)(s.Z,{display:{xs:"block",sm:"none"},children:j()}),(0,o.jsx)(ec.Z,{variant:"fullWidth",sx:{my:2,mx:1,borderStyle:"dashed",borderColor:"grey.400"}}),(0,o.jsxs)(s.Z,{display:"flex",justifyContent:"space-between",alignItems:"center",children:[(0,o.jsxs)(s.Z,{display:"flex",columnGap:1,ml:1,children:[c&&(0,o.jsxs)(w.Z,{variant:"lightContained",color:"secondary",size:"small",sx:{...ep(p),borderRadius:"5px"},onClick:c,children:[(0,o.jsx)(er.Z,{mr:2,icon:"mdi:download-box-outline"}),f("patient.report")]}),r&&(0,o.jsxs)(w.Z,{variant:"lightContained",color:"secondary",size:"small",sx:{...ep(p),borderRadius:"5px"},onClick:r,children:[(0,o.jsx)(er.Z,{mr:2,icon:"mdi:download-box-outline"}),f("patient.invoice")]})]}),(0,o.jsxs)(u.Z,{sx:{display:"flex",flexDirection:g?"column":"row",alignItems:"flex-end"},children:[(0,o.jsxs)(w.Z,{variant:"tabButton",color:"secondary",sx:{color:p.palette.custom.blue,px:1,textTransform:"none"},onClick:x,disabled:h,children:[(0,o.jsx)(er.Z,{mr:1,icon:"carbon:review"}),h?f("patient.reviewWasAdded"):f("patient.addReview")]}),(0,o.jsxs)(w.Z,{variant:"tabButton",color:"secondary",sx:{color:p.palette.custom.blue,px:1},onClick:d,children:[(0,o.jsx)(er.Z,{mr:1,icon:"eva:clock-outline"}),f("patient.bookAgain")]})]})]})]})},eb=i(31812),ey=e=>{let{avatar:t,status:i,name:n,date:r,time:a,durationTime:c,onButtonClick:d,sx:h}=e,{translate:m}=(0,B.n)(),p=(0,x.useMemo)(()=>{switch(i){case eg.Zx.ACCEPTED:return{buttonColor:"green",buttonText:"doctor.confirmed"};case eg.Zx.PAID:return{buttonColor:"green",buttonText:"doctor.confirmed",isJoinButton:!0};case eg.Zx.PENDING_APPROVAL:return{buttonColor:"purple",buttonText:"doctor.requested",isRemoveButton:!0};case eg.Zx.REJECTED:return{buttonColor:"red",buttonText:"doctor.rejected",isRemoveButton:!0};case eg.Zx.PENDING_PAYMENT:return{buttonColor:"red",buttonText:"doctor.noFunds",isRemoveButton:!0};case eg.Zx.CANCELLED:return{buttonColor:"red",buttonText:"doctor.cancelled"};default:return{buttonColor:"white",buttonText:""}}},[i]);return(0,o.jsxs)(s.Z,{width:"100%",borderRadius:"10px",bgcolor:"grey.100",display:"flex",justifyContent:"space-between",pt:{xs:.5,sm:1},pb:{xs:.9,sm:1.8},px:{xs:1.25,sm:2.5},sx:h,children:[(0,o.jsxs)(s.Z,{mt:1.5,display:"flex",columnGap:2,children:[(0,o.jsx)($.Z,{sx:{width:57,height:57,borderRadius:"8px"},src:t,alt:"doctor-avatar"}),(0,o.jsxs)(u.Z,{rowGap:.3,children:[(0,o.jsx)(l.Z,{fontSize:16,fontWeight:500,lineHeight:"20px",color:"grey.600",children:n}),(0,o.jsx)(l.Z,{fontSize:10,fontWeight:400,lineHeight:"20px",color:"primary.main",children:r}),(0,o.jsx)(ed.Ew,{time:a,clockSize:20,fontSize:"14px",fontWeight:400,sx:{ml:-.3}})]})]}),(0,o.jsxs)(u.Z,{display:"flex",justifyContent:"space-between",children:[(0,o.jsxs)(s.Z,{display:"flex",justifyContent:"flex-end",children:[(null==p?void 0:p.isRemoveButton)&&(0,o.jsx)(w.Z,{color:"secondary",sx:{py:0,px:0,fontWeight:500,mb:1},onClick:d,children:m("doctor.remove")}),(null==p?void 0:p.isJoinButton)&&(0,o.jsx)(eb.Z,{color:"primary",variant:"contained",sx:{py:.2,fontWeight:500,borderRadius:"10px",mt:.5,mb:1},onClick:d,children:m("common.joinCall")})]}),(0,o.jsxs)(s.Z,{display:"flex",flexDirection:{xs:"column",sm:"row"},gap:1,alignItems:"center",columnGap:2,children:[(0,o.jsx)(eu.Z,{variant:"customFilled",color:p.buttonColor,sx:{borderRadius:"8px",fontSize:"12px",fontWeight:500,minWidth:85},children:m(p.buttonText)}),(0,o.jsx)(eu.Z,{variant:"customFilled",color:"blue",startIcon:(0,o.jsx)(er.Z,{width:12,height:12,mr:.5,color:"common.white",icon:"basil:clock-outline"}),sx:{textTransform:"initial",borderRadius:"8px",fontSize:"12px",fontWeight:500,minWidth:85},children:c})]})]})]})},eZ=i(93946),ew=e=>{let{doctorId:t,fullName:i,ratingScore:n,reviewsCount:a,departments:c,avatar:x,onDeleteButtonClick:h,sx:p}=e,{translate:g}=(0,B.n)();return(0,o.jsxs)(s.Z,{width:"100%",borderRadius:"10px",bgcolor:"grey.100",display:"flex",justifyContent:"space-between",position:"relative",pt:{xs:3,sm:1},pb:1.8,pl:2.5,pr:{xs:2,sm:5.5},sx:p,children:[(0,o.jsxs)(s.Z,{mt:1,display:"flex",columnGap:2,children:[(0,o.jsx)($.Z,{sx:{width:57,height:57,borderRadius:"8px"},src:x,alt:"doctor-avatar"}),(0,o.jsxs)(u.Z,{rowGap:.3,children:[(0,o.jsx)(r.Z,{component:d(),href:m.GK.doctorById(t),underline:"none",sx:{"& :hover":{color:"primary.main"}},children:(0,o.jsx)(l.Z,{fontSize:16,fontWeight:500,lineHeight:"20px",color:"grey.600",children:i})}),(0,o.jsx)(l.Z,{fontSize:14,fontWeight:400,lineHeight:"20px",color:"primary.main",maxWidth:405,children:c})]})]}),(0,o.jsxs)(u.Z,{mt:1,display:"flex",flex:1,alignItems:"flex-end",children:[n&&(0,o.jsx)(ed.iG,{score:n}),a&&(0,o.jsxs)(l.Z,{fontSize:16,fontWeight:400,color:"grey.600",letterSpacing:"1.2px",textTransform:"lowercase",lineHeight:"18px",textAlign:"center",children:[a," ",g("patient.reviews")]})]}),(0,o.jsx)(eZ.Z,{sx:{position:"absolute",right:5,top:{xs:0,sm:5}},onClick:h,children:(0,o.jsx)(er.Z,{width:18,icon:"gridicons:cross"})})]})},ev=i(13627);let eC=e=>{let{isActive:t,isApproved:i,isRead:n,avatar:r,fullName:c,description:d,isLast:x,onClick:h,handleDownloadAll:m,handleApproveOpinionPrescription:p}=e,g=(0,a.Z)(),f=(0,X.Z)("down","sm");return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(s.Z,{position:"relative",py:{xs:1,lg:2.5},pl:{xs:2,lg:2.5},pr:2,borderRadius:"8px",display:"flex",justifyContent:"space-between",alignItems:"center",sx:{transition:"200ms",cursor:{xs:"default",sm:"pointer"}},bgcolor:n||t?"transprent":"grey.100",onClick:f?void 0:h,children:[(0,o.jsxs)(s.Z,{position:"relative",zIndex:2,display:"flex",alignItems:"center",columnGap:2.5,children:[(0,o.jsx)($.Z,{src:r,alt:"patient-avatar",sx:{height:40,width:40,borderRadius:"8px",bgcolor:{xs:(0,em.Fq)(g.palette.grey[500],.24),sm:t?"common.white":(0,em.Fq)(g.palette.grey[500],.24)},transition:"600ms"}}),(0,o.jsxs)(u.Z,{maxWidth:"80%",children:[(0,o.jsx)(l.Z,{variant:"subtitle4",sx:{fontWeight:500,transition:"300ms"},color:{xs:"common.black",sm:t?"text.white":"initial"},children:c}),(0,o.jsxs)(l.Z,{variant:"body2",color:{xs:"common.black",sm:t?"text.white":"initial"},sx:{transition:"300ms"},children:[d.slice(0,f?ev.r:ev.a),d.length>(f?ev.r:ev.a)&&"..."]})]})]}),!t&&!n&&(0,o.jsx)(s.Z,{width:10,height:10,children:(0,o.jsx)(ed.Cd,{size:10,bgcolor:"custom.lightBlue",sx:{position:{xs:"absolute",sm:"initial"},top:3,right:3}})}),(0,o.jsxs)(s.Z,{display:{xs:"flex",sm:"none"},children:[(0,o.jsx)(eZ.Z,{sx:{bgcolor:"common.white"},onClick:h,children:(0,o.jsx)(er.Z,{width:20,color:"grey.500",icon:"ic:outline-message"})}),(0,o.jsx)(eZ.Z,{sx:{bgcolor:"common.white"},onClick:m,children:(0,o.jsx)(er.Z,{color:"secondary.main",width:20,icon:"mdi:download-box-outline"})}),i?(0,o.jsx)(eZ.Z,{sx:{bgcolor:"common.white"},disabled:!0,children:(0,o.jsx)(er.Z,{color:"success.main",width:20,icon:"carbon:checkmark-outline"})}):(0,o.jsx)(eZ.Z,{sx:{bgcolor:"common.white"},onClick:p,children:(0,o.jsx)(er.Z,{color:"custom.blue",width:20,icon:"simple-line-icons:plus"})})]}),(0,o.jsx)(s.Z,{display:{xs:"none",sm:"block"},zIndex:1,ml:t?-2.5:"calc(100% + 20px)",borderRadius:"8px",position:"absolute",width:"100%",height:"100%",bgcolor:(0,Y.v3)({direction:"to left",startColor:"transparent",endColor:"".concat(g.palette.primary.light3," 30%")}),sx:{opacity:1,transition:"300ms"}})]}),!x&&(0,o.jsx)(ec.Z,{sx:{borderColor:"grey.100"}})]})};var eI=i(69690),eT=i(76972),eS=i(29383),ek=(0,x.memo)(e=>{let{title:t,date:i,href:n}=e,{translate:r}=(0,B.n)();return(0,o.jsxs)(u.Z,{bgcolor:"grey.100",borderRadius:"8px",p:{xs:1.25,sm:2.5},width:"100%",children:[(0,o.jsxs)(_.ZP,{container:!0,justifyContent:"space-between",children:[(0,o.jsxs)(_.ZP,{item:!0,display:"flex",alignItems:"center",columnGap:.5,children:[(0,o.jsx)(er.Z,{icon:"system-uicons:chain"}),(0,o.jsx)(l.Z,{variant:"body2",color:"primary.main",children:(0,q.Z)(i,J.HS)})]}),(0,o.jsx)(w.Z,{href:n,component:d(),variant:"lightContained",color:"secondary",size:"small",sx:{borderRadius:"20px",boxShadow:e=>e.customShadows.z8,textTransform:"initial",display:{xs:"flex",sm:"none"},py:.25,px:2,height:"auto",fontWeight:400},children:r("opinionPrescription.viewDoctors")})]}),(0,o.jsx)(ec.Z,{sx:{borderColor:"grey.400",borderStyle:"dashed",borderWidth:"1px",strokeWidth:"1px",width:"100%",my:{xs:1.3,sm:2.3}}}),(0,o.jsxs)(s.Z,{display:"flex",justifyContent:"space-between",alignItems:"center",children:[(0,o.jsxs)(u.Z,{children:[(0,o.jsxs)(l.Z,{variant:"subtitle4",fontWeight:500,children:[t.slice(0,ev.a),t.length>ev.a&&"..."]}),(0,o.jsx)(l.Z,{variant:"body5",mt:.5,children:(e=>{if(!e)return;let t=Date.now(),i=(0,eI.Z)(t,e),o=(0,eT.Z)(t,e),n=(0,eS.Z)(t,e);return 0===i&&0===o&&0===n?r("opinionPrescription.justNow"):i<60&&0===o&&0===n?"".concat(i," ").concat(1===i?r("common.minute"):r("common.minutes")," ").concat(r("common.ago")):o<24&&0===n?"".concat(o," ").concat(1===o?r("common.hour"):r("common.hours")," ").concat(r("common.ago")):r("opinionPrescription.moreThanDayAgo")})(i)})]}),(0,o.jsx)(w.Z,{href:n,component:d(),variant:"lightContained",color:"secondary",size:"small",sx:{borderRadius:"20px",boxShadow:e=>e.customShadows.z8,textTransform:"initial",display:{xs:"none",sm:"flex"}},children:r("opinionPrescription.viewDoctors")})]})]})}),eW=i(5257),eR=(0,x.memo)(e=>{let{fullName:t,avatar:i,ratings:n,departments:r,href:a}=e,{translate:c}=(0,B.n)(),{calculatedScore:x}=(0,z.r)(n);return(0,o.jsxs)(s.Z,{display:"flex",justifyContent:"space-between",alignItems:"center",bgcolor:"grey.100",borderRadius:"8px",p:2.5,width:"100%",flexDirection:{xs:"column",sm:"row"},gap:2,children:[(0,o.jsxs)(s.Z,{display:"flex",columnGap:2,children:[(0,o.jsx)($.Z,{src:i,alt:"doctor-avatar",sx:{width:60,height:60,borderRadius:"8px"}}),(0,o.jsxs)(u.Z,{maxWidth:"90%",children:[(0,o.jsx)(l.Z,{fontSize:16,fontWeight:500,lineHeight:"20px",color:"grey.600",mb:.25,children:t}),(0,o.jsx)(l.Z,{fontSize:14,fontWeight:400,lineHeight:"20px",color:"primary.main",mb:.5,children:r}),(0,o.jsx)(eW.T,{size:22,rating:x})]})]}),(0,o.jsxs)(w.Z,{href:a,component:d(),variant:"lightContained",color:"primary",size:"small",sx:{minWidth:220,borderRadius:"20px",boxShadow:e=>e.customShadows.z8,textTransform:"initial"},children:[(0,o.jsx)(er.Z,{icon:"simple-line-icons:plus",mr:2}),c("opinionPrescription.makeAppointment")]})]})})},93919:function(e,t,i){var o,n;i.d(t,{z:function(){return o}}),(n=o||(o={})).WHITE="white",n.GREY="grey"},32018:function(e,t,i){i.d(t,{R:function(){return l}});var o=i(85893),n=i(87357),r=i(2734),s=i(82145);let l=e=>{let{size:t=7}=e,i=(0,r.Z)();return(0,o.jsxs)("div",{style:{position:"relative",height:t,width:t,maxHeight:t,maxWidth:t},children:[(0,o.jsx)(s.m.div,{style:{position:"absolute",width:"100%",height:"100%",borderRadius:"50%",border:"2px solid ".concat(i.palette.success.main),top:0,left:0},animate:{scale:[0,2],opacity:[1,.75,.5,0],transition:{duration:2.5,ease:[.215,.61,.355,1],repeat:1/0,repeatType:"loop",repeatDelay:.5}}}),(0,o.jsx)(n.Z,{width:t,height:t,minWidth:t,minHeight:t,component:"div",mr:.7,borderRadius:"50%",bgcolor:"primary.main",position:"relative",zIndex:10,sx:{maxHeight:t,maxWidth:t}})]})};i(62166)},5257:function(e,t,i){i.d(t,{T:function(){return a}});var o=i(85893),n=i(87357),r=i(67294),s=i(27979),l=i(49086),a=(0,r.memo)(e=>{let{rating:t,isVertical:i,size:r=14}=e,a=Math.floor(t);return(0,o.jsxs)(n.Z,{sx:{display:"flex",flexDirection:i?"column":"row",gap:"2px"},children:[(()=>{let e=[];for(let t=0;t<a;t++)e.push((0,o.jsx)(s.Z,{width:r,height:r,icon:"material-symbols:star",color:"warning.light"},t));return e})(),t%1!=0&&(0,o.jsx)(s.Z,{width:r,height:r,icon:"ooui:half-star-ltr",color:"warning.light"}),(()=>{let e=l.CQ.FIVE-Math.ceil(t),i=[];for(let t=0;t<e;t++)i.push((0,o.jsx)(s.Z,{width:r,height:r,icon:"material-symbols:star",color:"grey.300"},t));return i})()]})})},72691:function(e,t,i){i.d(t,{r:function(){return n}});var o=i(67294);let n=e=>{let t=(0,o.useMemo)(()=>{if(!(null==e?void 0:e.length))return 0;let t=e.reduce((e,t)=>e+t.score,0);return Number((t/e.length).toFixed(1))},[e]);return{calculatedScore:t}}}}]);