1import{u as $,_ as F}from"./DWGya2NG.js";import{_ as G}from"./Bbj6j9yC.js";import{_ as j}from"./Byb60LZk.js";import H from"./B3Tzz-r_.js";import{f as J,z as U,B as n,y as q,E as N,k as z,H as A,l as Q,O as X,o as l,c as x,n as e,b as E,a as D,v as Y,q as Z,F as tt}from"./C7zEIAeD.js";import{u as et}from"./75lqhlR0.js";import{u as ot}from"./BkL0yvWL.js";import{u as at}from"./DA4EYZAb.js";import{u as nt,a as it}from"./IGxKcMLM.js";import{s as rt}from"./CvRTKnrj.js";import"./DIx7YeN0.js";import"./BPUEMVcK.js";import{u as st}from"./DdgkWr29.js";import"./BVBpBAVB.js";import{u as lt}from"./DnOLfqXR.js";import"./Cxk7pjc8.js";import"./Dk1M-Ra9.js";import"./DjSg3Nx8.js";import"./D0-Z8c3K.js";import"./CT0bwiz6.js";import"./DTmj8o4_.js";import"./C331zzYY.js";import"./CJyQhFO5.js";import"./CcmYQ047.js";import"./ByRl81Lu.js";import"./Dl__5uAE.js";import"./frkSSV2b.js";import"./CKVi2TRU.js";import"./DtbbvXvV.js";import"./D4BlskUX.js";import"./BHyqgs87.js";import"./Cd6xApvY.js";import"./BJwvOkbu.js";import"./BrCFPWGt.js";import"./CcukPR1p.js";import"./BXOKuZpE.js";import"./Rlssfzup.js";import"./CyqyKP3X.js";import"./BwCY_19y.js";const ut={key:0,class:"w-full pt-5 overflow-hidden"},mt={key:1,class:"bg-white w-full mt-[200px] px-5 lg:px-[42px] py-6 rounded-[20px] flex flex-col items-center gap-y-4 text-center"},ct=D("p",{class:"text-primary-900 font-semibold"}," We couldn't start the video session. ",-1),pt=D("p",{class:"text-sm text-gray-500"}," The video service may be temporarily unavailable. Please retry, or contact support if this keeps happening. ",-1),dt={key:2,class:"bg-white w-full mt-[200px] px-5 lg:px-[42px] py-6 rounded-[20px]"},vt=2e4,ee=J({__name:"[patientid]",setup(_t){const g=U(),y=n(()=>g.params.patientid),S=n(()=>g.params.chatid),I=n(()=>g.params.appointmentid),u=st(),k=et(),m=n(()=>{var t;return(t=k.roomChat)==null?void 0:t.roomName}),P=n(()=>{var t,a;return((t=k.roomChat)==null?void 0:t.expectedEndAt)||((a=k.roomChat)==null?void 0:a.expectedEndTime)}),c=lt(),B=ot(),p=n(()=>B.singlePatientData),i=$(),K=at(),s=n(()=>K.liveKitTokenData),r=nt(),M=it(),d=q(),{$echo:v}=N(),w=n(()=>p.value!==null&&s.value!==null),O=n(()=>i.loading.value===!1&&s.value===null&&!!i.error.value),_=z(!1);let f=null;function C(){f&&(clearTimeout(f),f=null)}function R(){C(),_.value=!1,f=setTimeout(()=>{w.value||(_.value=!0,console.warn("[channel] load timed out â never became ready",{hasPatient:p.value!==null,chatLoading:u.loading.value,patientLoading:c.loading.value,tokenLoading:i.loading.value,hasToken:s.value!==null,tokenError:i.error.value??null,roomChat:m.value??null}))},vt)}A(()=>[u.loading.value,c.loading.value,i.loading.value,p.value!==null,s.value!==null,!!i.error.value],([t,a,o,T,b,L])=>{console.info("[channel] gating",{chatLoading:t,patientLoading:a,tokenLoading:o,hasPatient:T,hasToken:b,tokenError:L})},{immediate:!0}),A(w,t=>{t&&(C(),_.value=!1)});const W=async()=>{R(),await Promise.allSettled([u.action(S.value),c.action(y.value),i.action(m.value)])};let h=null;return Q(async()=>{var a;R(),await M.loadPublic(),await u.action(S.value),await c.action(y.value),await i.action(m.value),P.value&&r.startSessionCountdown(P.value),v&&((a=d.user)!=null&&a.uuid)&&v.private(`doctor.${d.user.uuid}`).listen(".doctor.accepted.extension",o=>{o!=null&&o.new_end_time&&String(o==null?void 0:o.appointment_id)===I.value&&r.startSessionCountdown(o.new_end_time)});const{$apiClient:t}=N();h=rt(async()=>{try{await t.get("/session/keep-alive")}catch{}},5*60*1e3)}),X(()=>{var t;if(C(),h&&(clearInterval(h),h=null),v&&((t=d.user)!=null&&t.uuid))try{v.leave(`doctor.${d.user.uuid}`)}catch{}}),(t,a)=>{var V;const o=F,T=G,b=j,L=H;return l(),x(tt,null,[e(w)?(l(),x("div",ut,[E(o,{"chat-id":e(S),"room-id":e(m),"appointment-id":e(I),"counterpart-id":e(y),"counterpart-name":(V=e(p))==null?void 0:V.fullName,"token-details":e(s),role:"doctor"},null,8,["chat-id","room-id","appointment-id","counterpart-id","counterpart-name","token-details"])])):e(O)||e(_)?(l(),x("div",mt,[ct,pt,D("button",{onClick:W,class:"bg-primary-500 hover:bg-primary-900 text-white rounded-full px-6 py-2"}," Retry ")])):(l(),x("div",dt,[E(T)])),e(r).isCountingDown&&e(r).timeLeft||e(r).sessionJustExtended?(l(),Y(b,{
1key:3,role:"doctor",timer:e(r).timeLeft,"just-extended":e(r).sessionJustExtended},null,8,["timer","just-extended"])):Z("",!0),E(L)],64)}}});export{ee 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.