PageSourceSearch

https://www.covertiger.com/_next/static/chunks/pages/meeting-7d087987bb89e4db.js

js covertiger.com collected 2026-10-08 20:50:40 UTC 23,891 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3795],{9558:(e,t,r)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/meeting",function(){return r(73446)}])},73446:(e,t,r)=>{"use strict";r.r(t),r.d(t,{__N_SSP:()=>k,default:()=>N});var n=r(37876),a=r(77328),l=r.n(a),i=r(54587),s=r.n(i),o=r(89099),c=r(14232),d=r(48230),u=r.n(d);function h(e){let{leadId:t}=e,r=t?"/call?source=meeting&leadId=".concat(encodeURIComponent(t)):"/call";return(0,n.jsx)("div",{className:"w-full rounded-2xl border border-gray-200 bg-white p-8 text-center shadow-sm sm:p-10",children:(0,n.jsxs)("div",{className:"mx-auto max-w-lg space-y-4",children:[(0,n.jsx)("h1",{className:"text-xl font-semibold text-gray-900",children:"This meeting has ended"}),(0,n.jsx)("p",{className:"text-sm text-gray-600",children:"The video call with your advisor is no longer active. Ask your advisor to start a new video meeting and send you a fresh link, or open secure chat below."}),(0,n.jsxs)("div",{className:"flex flex-wrap items-center justify-center gap-3 pt-2",children:[(0,n.jsx)(u(),{href:"/",className:"inline-flex items-center rounded-full bg-[#00843d] px-5 py-2.5 text-sm font-semibold text-white hover:bg-[#006b32]",children:"Return to homepage"}),(0,n.jsx)(u(),{href:r,className:"inline-flex items-center rounded-full border border-[#00843d]/30 bg-[#e5f3ec] px-5 py-2.5 text-sm font-semibold text-[#00843d] hover:bg-[#d4ebdc]",children:"Open secure chat"})]})]})})}let x=e=>{let{className:t="h-4 w-4"}=e;return(0,n.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,className:t,"aria-hidden":"true",children:[(0,n.jsx)("path",{d:"M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z"}),(0,n.jsx)("path",{d:"M19 10v2a7 7 0 0 1-14 0v-2"}),(0,n.jsx)("line",{x1:"12",y1:"19",x2:"12",y2:"23"}),(0,n.jsx)("line",{x1:"8",y1:"23",x2:"16",y2:"23"})]})},m=e=>{let{className:t="h-4 w-4"}=e;return(0,n.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,className:t,"aria-hidden":"true",children:[(0,n.jsx)("line",{x1:"1",y1:"1",x2:"23",y2:"23"}),(0,n.jsx)("path",{d:"M9 9v3a3 3 0 0 0 5.12 2.12M15 9.34V4a3 3 0 0 0-5.94-.6"}),(0,n.jsx)("path",{d:"M17 16.95A7 7 0 0 1 5 12v-2m14 0v2a7 7 0 0 1-.11 1.23"}),(0,n.jsx)("line",{x1:"12",y1:"19",x2:"12",y2:"23"}),(0,n.jsx)("line",{x1:"8",y1:"23",x2:"16",y2:"23"})]})},f=e=>{let{className:t="h-4 w-4"}=e;return(0,n.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,className:t,"aria-hidden":"true",children:[(0,n.jsx)("polygon",{points:"23 7 16 12 23 17 23 7"}),(0,n.jsx)("rect",{x:"1",y:"5",width:"15",height:"14",rx:"2",ry:"2"})]})},p=e=>{let{className:t="h-4 w-4"}=e;return(0,n.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,className:t,"aria-hidden":"true",children:[(0,n.jsx)("path",{d:"M16.5 9.4l-9-5.19M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l2-1.14"}),(0,n.jsx)("line",{x1:"2",y1:"2",x2:"22",y2:"22"})]})},g=e=>{let{className:t="h-4 w-4"}=e;return(0,n.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,className:t,"aria-hidden":"true",children:[(0,n.jsx)("rect",{x:"2",y:"3",width:"20",height:"14",rx:"2",ry:"2"}),(0,n.jsx)("line",{x1:"8",y1:"21",x2:"16",y2:"21"}),(0,n.jsx)("line",{x1:"12",y1:"17",x2:"12",y2:"21"})]})},b=e=>{let{className:t="h-4 w-4"}=e;return(0,n.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,className:t,"aria-hidden":"true",children:[(0,n.jsx)("path",{d:"M10.68 13.31a16 16 0 0 0 3.41 2.6l1.27-1.27a2 2 0 0 1 2.11-.45c.907.339 1.85.573 2.81.7A2 2 0 0 1 22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72c.127.96.361 1.903.7 2.81a2 2 0 0 1-.45 2.11L8.09 9.91"}),(0,n.jsx)("line",{x1:"23",y1:"1",x2:"1",y2:"23"})]})};
1function w(e){let{meeting:t,leadId:r}=e,{videoGridRef:a,screenShareSlotRef:l,participantStripRef:i,hasScreenShareLayout:s,previewVideoRef:o,joinCall:c,leaveCall:d,toggleMute:u,toggleCamera:w,toggleScreenShare:v,isInCall:y,isBusy:C,isMuted:j,isCameraOff:k,isScreenSharing:N,cameraUnavailable:S,micUnavailable:_,previewLoading:E,previewReady:A,error:L,connectionLabel:K,advisorJoined:P,sessionEnded:T}=t;if(T)return(0,n.jsx)(h,{leadId:r});let M="inline-flex items-center gap-1.5 rounded-md border border-gray-200 bg-white px-3 py-2 text-xs font-medium text-gray-800 shadow-sm hover:bg-gray-50 disabled:opacity-50";return(0,n.jsxs)("div",{className:"flex w-full flex-col ".concat(y?"min-h-0 flex-1 rounded-2xl border border-gray-200 bg-white shadow-sm":"rounded-2xl border border-[#00843d]/20 bg-white p-4 shadow-sm sm:p-6"),children:[(0,n.jsxs)("div",{className:"flex shrink-0 flex-wrap items-center gap-x-3 gap-y-1 ".concat(y?"border-b border-gray-100 px-4 py-3":"mb-3"),children:[(0,n.jsx)("h1",{className:"text-sm font-semibold text-[#00843d]",children:"Video meeting"}),y?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("span",{className:"inline-flex items-center gap-1.5 text-xs text-gray-600",children:[(0,n.jsx)("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-500","aria-hidden":"true"}),K]}),(0,n.jsx)("span",{className:"text-xs text-gray-600",children:P?"Advisor connected":"Waiting for your advisor…"})]}):(0,n.jsx)("span",{className:"text-xs text-gray-600",children:"Set up your camera and mic before joining"})]}),(0,n.jsx)("div",{className:"relative w-full ".concat(y?"flex min-h-0 flex-1 flex-col px-4 py-3":"mb-5"),children:y?(0,n.jsx)("div",{className:"relative min-h-[calc(100dvh-12.5rem)] flex-1 overflow-hidden rounded-xl",children:(0,n.jsxs)("div",{className:"absolute inset-0 flex gap-2",children:[(0,n.jsx)("div",{ref:l,"aria-hidden":!s,className:"flex h-full min-h-0 flex-col gap-2 overflow-hidden rounded-xl bg-gray-900 ".concat(s?"w-[85%] flex-1":"hidden")}),(0,n.jsx)("div",{ref:i,"aria-hidden":!s,className:"flex h-full min-h-0 flex-col gap-2 ".concat(s?"w-[15%] min-w-[88px] max-w-[180px]":"hidden")}),(0,n.jsx)("div",{ref:a,className:s?"hidden":"flex h-full w-full min-h-0 items-stretch gap-3 flex-col md:flex-row"})]})}):(0,n.jsx)("div",{className:"mx-auto w-full max-w-3xl px-1 pb-4",children:(0,n.jsxs)("div",{className:"relative aspect-video w-full min-h-[200px] overflow-hidden rounded-xl bg-gray-900 sm:min-h-[280px]",children:[(0,n.jsx)("video",{ref:o,className:"h-full w-full -scale-x-100 object-cover object-center ".concat(k||S?"hidden":""),muted:!0,playsInline:!0,autoPlay:!0,"aria-label":"Your camera preview"}),E?(0,n.jsx)("div",{className:"absolute inset-0 flex items-center justify-center bg-gray-800 text-sm text-gray-300",children:"Starting camera…"}):null,!E&&(k||S||!A)?(0,n.jsx)("div",{className:"absolute inset-0 flex items-center justify-center bg-gray-800 text-sm text-gray-300",children:S?"Camera unavailable — you can still join with audio":k?"Camera is off":"Allow camera access to see your preview"}):null,(0,n.jsx)("span",{className:"absolute bottom-2 left-2 z-10 rounded bg-black/60 px-2 py-0.5 text-[10px] font-medium text-white",children:"You"})]})})}),S&&!y?(0,n.jsx)("p",{className:"text-xs text-amber-700 ".concat(y?"px-4":"mb-2"),children:"Camera unavailable — you can join with audio only."}):null,S&&y?(0,n.jsx)("p",{className:"px-4 text-xs text-amber-700",children:"Camera unavailable — continuing as audio-only."}):null,_?(0,n.jsx)("p",{className:"text-xs text-amber-700 ".concat(y?"px-4":"mb-2"),children:"Microphone blocked — allow mic access in your browser to speak."}):null,(0,n.jsxs)("div",{className:"flex shrink-0 flex-wrap items-center gap-2 ".concat(y?"border-t border-gray-100 px-4 py-3":""),children:[(0,n.jsxs)("button",{type:"button",onClick:()=>void u(),disabled:C||_,className:M,children:[j?(0,n.jsx)(m,{}):(0,n.jsx)(x,{}),j?"Unmute":"Mute"]}),(0,n.jsxs)("button",{type:"button",onClick:()=>void w(),disabled:C||S,className:M,children:[k?(0,n.jsx)(p,{}):(0,n.jsx)(f,{}),k?"Camera on":"Camera off"]}),y?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("button",{type:"button",onClick:()=>void v(),className:M,children:[(0,n.jsx)(g,{}),N?"Stop share":"Share screen"]}),(0,n.jsxs)("button",{type:"button",onClick:()=>void d(),className:"ml-auto inline-flex items-center gap-1 rounded-md bg-red-600 px-3 py-2 text-xs font-semibold text-white shadow-sm hover:bg-red-700",children:[(0,n.jsx)(b,{}),"Leave call"]})]}):(0,n.jsx)("button",{type:"button",onClick:()=>{c().catch(()=>{})},disabled:C,className:"ml-auto inline-flex items-center gap-1 rounded-full bg-[#00843d] px-4 py-2 text-sm font-semibold text-white hover:bg-[#006b32] disabled:opacity-60",children:C?"Joining…":"Join call"})]}),L?(0,n.jsx)("p",{className:"mt-2 text-xs text-red-600 ".concat(y?"px-4 pb-3":""),children:L}):null]})}var v=r(26042),y=r(92493);function C(e){if(e.kind!==v.CC.Kind.Audio)return;let t=e.attach();t.style.display="none",document.body.appendChild(t)}async function j(e,t){if(e&&t){e.srcObject=t;try{await e.play()}catch(e){}}}var k=!0;function N(){let e=(0,o.useRouter)(),t=String(e.query.leadId||e.query.lead_id||"").trim(),r
1=String(e.query.session_id||"").trim(),a=function(e,t){let r=(0,c.useRef)(null),n=(0,c.useRef)(null),a=(0,c.useRef)(!1),l=(0,c.useRef)(null),i=(0,c.useRef)(null),s=(0,c.useRef)(null),o=(0,c.useRef)(null),d=(0,c.useRef)(null),u=(0,c.useRef)(new Map),[h,x]=(0,c.useState)(v.KN.Disconnected),[m,f]=(0,c.useState)(!1),[p,g]=(0,c.useState)(!1),[b,w]=(0,c.useState)(!1),[k,N]=(0,c.useState)(!1),[S,_]=(0,c.useState)(!1),[E,A]=(0,c.useState)(!1),[L,K]=(0,c.useState)(!1),[P,T]=(0,c.useState)(!1),[M,R]=(0,c.useState)(!1),[V,I]=(0,c.useState)(""),[D,q]=(0,c.useState)(!1),[F,U]=(0,c.useState)(0),[H,O]=(0,c.useState)(!1),W=(0,c.useRef)(E);W.current=E;let B=(0,c.useCallback)(()=>{!function e(t){let{trackNodesRef:r,screenShareSlotRef:n,participantStripRef:a,videoGridRef:l,onLayoutChange:i,fullHeight:s=!1,retryOnMissingSlots:o=!0}=t,c=Array.from(r.current.entries()),d=c.filter(e=>{let[,t]=e;return t.isScreenShare}),u=c.filter(e=>{let[,t]=e;return!t.isScreenShare}),h=d.length>0;null==i||i(h);let x=null==n?void 0:n.current,m=null==a?void 0:a.current,f=null==l?void 0:l.current;if(h&&o&&(!x||!m))return void requestAnimationFrame(()=>{e({trackNodesRef:r,screenShareSlotRef:n,participantStripRef:a,videoGridRef:l,onLayoutChange:i,fullHeight:s,retryOnMissingSlots:!1})});let p=(e,t)=>{let r=e.querySelector("video");if(!r)return;let n=r.getAttribute("data-track-label")||"";r.className=t?"absolute inset-0 h-full w-full object-contain bg-black":"absolute inset-0 h-full w-full object-cover object-center".concat("You"===n?" -scale-x-100":"")},g=s?"relative h-full min-h-[240px] w-full overflow-hidden rounded-xl bg-gray-900":"relative h-full min-h-[240px] w-full overflow-hidden rounded-xl bg-gray-900 md:min-h-[320px]",b=s?"relative min-h-[72px] w-full flex-1 overflow-hidden rounded-lg bg-gray-900":"relative w-full aspect-video min-h-[72px] max-h-[160px] shrink-0 overflow-hidden rounded-lg bg-gray-900",w=!h&&1===u.length;h||u.length;let v=s?w?"relative h-full min-h-0 w-full flex-1 basis-0 self-stretch overflow-hidden rounded-xl bg-gray-900":"relative h-full min-h-0 flex-1 basis-0 self-stretch overflow-hidden rounded-xl bg-gray-900":w?"relative col-span-full aspect-video min-h-[200px] overflow-hidden rounded-xl bg-gray-900 md:min-h-[320px]":"relative aspect-video min-h-[200px] overflow-hidden rounded-lg bg-gray-900 md:min-h-[240px]",y=(e,t)=>{if("grid-full"===t){e.style.flex="1 1 0%",e.style.minHeight="0",e.style.height="100%",e.style.width="";return}if("grid-solo-full"===t||"screen-full"===t){e.style.flex="1 1 0%",e.style.minHeight="0",e.style.height="100%",e.style.width="100%";return}if("strip"===t){e.style.flex="1 1 0%",e.style.minHeight="72px",e.style.height="",e.style.width="100%";return}e.style.flex="",e.style.minHeight="",e.style.height="",e.style.width=""},C=s?"relative col-span-full h-full min-h-0 overflow-hidden rounded-lg bg-gray-900":"relative col-span-full aspect-video min-h-[320px] overflow-hidden rounded-lg bg-gray-900 md:min-h-[420px]";if(h&&x&&m){d.forEach(e=>{let[,t]=e;t.wrapper.className=g,p(t.wrapper,!0),y(t.wrapper,s?"screen-full":""),x.appendChild(t.wrapper)}),u.forEach(e=>{let[,t]=e;t.wrapper.className=b,p(t.wrapper,!1),y(t.wrapper,s?"strip":""),m.appendChild(t.wrapper)});return}f&&(u.forEach(e=>{let[,t]=e;t.wrapper.className=v,p(t.wrapper,!1),y(t.wrapper,s?w?"grid-solo-full":"grid-full":""),f.appendChild(t.wrapper)}),d.forEach(e=>{let[,t]=e;t.wrapper.className=C,p(t.wrapper,!0),y(t.wrapper,s?"screen-full":""),f.appendChild(t.wrapper)}))}({trackNodesRef:u,screenShareSlotRef:i,participantStripRef:s,videoGridRef:l,onLayoutChange:O,fullHeight:W.current})},[]),X=(0,c.useCallback)(e=>{U(e.remoteParticipants.size)},[]),Y=(0,c.useCallback)(e=>{if(e.kind!==v.CC.Kind.Video)return;let t=u.current.get(e.sid),r=null==t?void 0:t.isScreenShare;t&&(t.wrapper.remove(),u.current.delete(e.sid)),e.detach().forEach(e=>e.remove()),B(),r&&requestAnimationFrame(()=>{B()})},[B]),J=(0,c.useCallback)(function(e,t){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(e.kind!==v.CC.Kind.Video)return;Y(e);let n=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],a=e.attach();a.className="absolute inset-0 h-full w-full object-cover object-center",a.style.width="100%",a.style.height="100%",a.setAttribute("data-track-label",t),a.setAttribute("playsinline","true"),a.setAttribute("autoplay","true"),r?a.className="absolute inset-0 h-full w-full object-contain bg-black":n&&a.classList.add("-scale-x-100");
1let l=document.createElement("div");l.setAttribute("data-screen-share",r?"true":"false");let i=document.createElement("span");return i.className="absolute bottom-2 left-2 z-10 rounded bg-black/60 px-2 py-0.5 text-[10px] font-medium text-white",i.textContent=t,l.appendChild(a),l.appendChild(i),l}(e,t,r,"You"===t);u.current.set(e.sid,{wrapper:n,isScreenShare:r}),B(),r&&requestAnimationFrame(()=>{B()})},[Y,B]),z=(0,c.useCallback)((e,t,r)=>{if(e.kind===v.CC.Kind.Audio)return void C(e);if(e.kind===v.CC.Kind.Video){let r=t.source===v.CC.Source.ScreenShare||t.source===v.CC.Source.ScreenShareAudio;J(e,r?"Screen share":"Advisor",r)}},[J]),$=(0,c.useCallback)(e=>{let t=e.track;if(t&&t.kind===v.CC.Kind.Video){let r=e.source===v.CC.Source.ScreenShare||e.source===v.CC.Source.ScreenShareAudio;J(t,r?"Your screen":"You",r),r?w(!0):g(!1)}},[J]),G=(0,c.useCallback)(e=>{let t=e.track;t&&t.kind===v.CC.Kind.Video&&(Y(t),(e.source===v.CC.Source.ScreenShare||e.source===v.CC.Source.ScreenShareAudio)&&w(!1))},[Y]),Q=(0,c.useCallback)(()=>{u.current.forEach(e=>{let{wrapper:t}=e;return t.remove()}),u.current.clear(),i.current&&(i.current.innerHTML=""),s.current&&(s.current.innerHTML=""),l.current&&(l.current.innerHTML=""),O(!1)},[]),Z=(0,c.useCallback)(()=>{let e=d.current;e&&(e.getTracks().forEach(e=>e.stop()),d.current=null),o.current&&(o.current.srcObject=null),R(!1),T(!1)},[]),ee=(0,c.useCallback)(async()=>{if(d.current||E||D||!e||!t)return;T(!0),I("");let r=async e=>{d.current=e;let t=e.getAudioTracks().length>0,r=e.getVideoTracks().length>0;_(!t),N(!r),t||f(!0),r||g(!0),await j(o.current,e),R(!0)};try{try{await r(await navigator.mediaDevices.getUserMedia({audio:{echoCancellation:!0,noiseSuppression:!0},video:!0}))}catch(e){console.warn("[LiveKit] preview av failed, trying video only",e);try{await r(await navigator.mediaDevices.getUserMedia({video:!0})),_(!0),f(!0)}catch(e){console.warn("[LiveKit] preview video failed, trying audio only",e);try{await r(await navigator.mediaDevices.getUserMedia({audio:{echoCancellation:!0,noiseSuppression:!0}})),N(!0),g(!0)}catch(e){console.warn("[LiveKit] preview media failed",e),_(!0),N(!0),f(!0),g(!0),I("Camera and microphone are blocked. Allow access in your browser to join.")}}}}finally{T(!1)}},[E,e,D,t]),et=(0,c.useCallback)(()=>{let e=r.current;r.current=null,e&&(e.removeAllListeners(),e.disconnect()),Q(),A(!1),w(!1),U(0),x(v.KN.Disconnected)},[Q]),er=(0,c.useCallback)(()=>{Z(),et(),n.current=null,q(!0),I(""),K(!1)},[et,Z]),en=(0,c.useCallback)(()=>{let e=r.current;
1e&&l.current&&(e.remoteParticipants.forEach(e=>{e.trackPublications.forEach(t=>{if(t.track&&t.isSubscribed){if(t.track.kind===v.CC.Kind.Audio)return void C(t.track);t.track.kind===v.CC.Kind.Video&&z(t.track,t,e.sid)}})}),e.localParticipant.trackPublications.forEach(e=>{var t;(null==(t=e.track)?void 0:t.kind)===v.CC.Kind.Video&&$(e)}))},[$,z]),ea=(0,c.useCallback)(async(e,t)=>{let{micEnabled:l,cameraEnabled:i}=t,s=new v.Wv({adaptiveStream:!0,dynacast:!0,audioCaptureDefaults:{echoCancellation:!0,noiseSuppression:!0}});if(r.current=s,s.on(v.u9.ConnectionStateChanged,e=>{x(e)}),s.on(v.u9.ParticipantConnected,()=>X(s)),s.on(v.u9.ParticipantDisconnected,()=>X(s)),s.on(v.u9.TrackSubscribed,(e,t,r)=>{z(e,t,r.sid)}),s.on(v.u9.TrackUnsubscribed,e=>{if(e.kind===v.CC.Kind.Audio)e.kind===v.CC.Kind.Audio&&e.detach().forEach(e=>e.remove());else Y(e)}),s.on(v.u9.LocalTrackPublished,$),s.on(v.u9.LocalTrackUnpublished,G),s.on(v.u9.Disconnected,()=>{A(!1),x(v.KN.Disconnected),!a.current&&n.current&&(I("Connection lost. Tap Join call to try again."),et(),n.current=null,ee())}),await s.connect(e.livekit_url,e.token),l)try{await s.localParticipant.setMicrophoneEnabled(!0),f(!1),_(!1)}catch(e){console.warn("[LiveKit] microphone permission failed",e),f(!0),_(!0)}else await s.localParticipant.setMicrophoneEnabled(!1),f(!0);if(i)try{await s.localParticipant.setCameraEnabled(!0),g(!1),N(!1)}catch(e){console.warn("[LiveKit] camera permission failed, continuing audio-only",e),g(!0),N(!0)}else await s.localParticipant.setCameraEnabled(!1),g(!0);X(s),A(!0),n.current=e,requestAnimationFrame(()=>{en()})},[$,G,z,Y,X,en,et,ee]);(0,c.useEffect)(()=>{E&&en()},[E,en]),(0,c.useLayoutEffect)(()=>{E&&B()},[H,E,B]),(0,c.useEffect)(()=>{if(!e||!t||D||E)return;let r=!1;return(async()=>{try{let n=await (0,y.$)(e,t);if(r)return;if(null==n?void 0:n.ended)return void er();await ee()}catch(e){if(!r&&(0,y.X1)(e))return void er();r||I((null==e?void 0:e.message)||"Could not verify this meeting link.")}})(),()=>{r=!0}},[e,t,D,E,er,ee]),(0,c.useEffect)(()=>{d.current&&o.current&&j(o.current,d.current)},[M]);let el=(0,c.useCallback)(async()=>{a.current=!0;let t=n.current,r=null==t?void 0:t.session_id;if(n.current=null,r&&e)try{await (0,y.AA)(e,r)}catch(e){console.warn("[LiveKit] end session failed",e)}et(),a.current=!1,D||ee()},[et,e,D,ee]),ei=(0,c.useCallback)(async()=>{let e=!m,t=r.current;t?await t.localParticipant.setMicrophoneEnabled(!e):d.current&&d.current.getAudioTracks().forEach(t=>{t.enabled=!e}),f(e)},[m]),es=(0,c.useCallback)(async()=>{if(k)return;let e=!p,t=r.current;t?await t.localParticipant.setCameraEnabled(!e):d.current&&d.current.getVideoTracks().forEach(t=>{t.enabled=!e}),g(e)},[k,p]),eo=(0,c.useCallback)(async()=>{let e=r.current;if(!e)return;let t=!b;try{await e.localParticipant.setScreenShareEnabled(t),w(t),I("")}catch(e){console.warn("[LiveKit] screen share failed",e),w(!1),I("Screen share failed. Check browser permissions.")}},[b]),ec=(0,c.useCallback)(async()=>{if(!e||!t||L||E||D)return;let r=!m&&!S,a=!p&&!k;K(!0),I(""),Z();try{let n=await (0,y.R0)(e,t);await ea(n,{micEnabled:r,cameraEnabled:a})}catch(e){if((0,y.X1)(e))return void er();console.warn("[LiveKit] customer join failed",e),I((null==e?void 0:e.message)||"Failed to join video meeting"),et(),n.current=null,ee()}finally{K(!1)}},[et,ea,L,p,E,m,e,er,S,k,D,t,ee,Z]);return(0,c.useEffect)(()=>()=>{Z(),n.current&&(et(),n.current=null)},[et,Z]),{videoGridRef:l,screenShareSlotRef:i,participantStripRef:s,hasScreenShareLayout:H,previewVideoRef:o,joinCall:ec,leaveCall:el,toggleMute:ei,toggleCamera:es,toggleScreenShare:eo,isInCall:E,isBusy:L,isMuted:m,isCameraOff:p,isScreenSharing:b,cameraUnavailable:k,micUnavailable:S,previewLoading:P,previewReady:M,error:V,connectionState:h,connectionLabel:function(e){switch(e){case v.KN.Connected:return"Connected";case v.KN.Connecting:return"Connecting…";case v.KN.Reconnecting:return"Reconnecting…";case v.KN.Disconnected:return"Disconnected";default:return String(e||"Idle")}}(h),remoteParticipantCount:F,advisorJoined:F>0,sessionEnded:D}}(t,r),i=e.isReady,d=a.isInCall;return(0,c.useEffect)(()=>(document.documentElement.classList.toggle("meeting-in-call",d),()=>{document.documentElement.classList.remove("meeting-in-call")}),[d]),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(l(),{children:[(0,n.jsx)("title",{children:"Video meeting | CoverTiger"}),(0,n.jsx)("meta",{name:"robots",content:"noindex"})]}),(0,n.jsxs)("div",{className:"flex min-h-[100dvh] w-full flex-col ".concat("bg-[#f4f7f5]"),children:[(0,n.jsxs)("header",{className:"flex shrink-0 items-center justify-between border-b border-gray-200 bg-white px-4 py-3 sm:px-6",children:[(0,n.jsx)("div",{className:"flex min-w-0 items-center gap-3",children:(0,n.jsx)(s(),{src:"/home/logo.svg",alt:"CoverTiger",width:160,height:32,className:"h-8 w-auto max-w-[160px] object-contain object-left",priority:!0})}),(0,n.jsx)("div",{className:"hidden text-right text-xs text-gray-600 sm:block",children:(0,n.jsx)("a",{href:"mailto:[email protected]",className:"block hover:text-[#00843d]",children:"[email protected]"})})]}),(0,n.jsx)("main",{className:"mx-auto flex w-full max-w-[1600px] flex-1 flex-col ".concat(d?"min-h-0 px-3 py-3 sm:px-4 sm:py-4":"min-h-0 px-3 py-4 pb-10 sm:px-4 sm:py-6 sm:pb-12"),children:i?t&&r?(0,n.jsx)(w,{meeting:a,leadId:t}):(0,n.jsx)("div",{className:"rounded-2xl border border-red-200 bg-red-50 p-4 text-sm text-red-800",children:"This meeting link is invali
1d. Please ask your advisor for a new link."}):(0,n.jsx)("p",{className:"text-sm text-gray-600",children:"Loading…"})})]})]})}},77328:(e,t,r)=>{e.exports=r(89836)},92493:(e,t,r)=>{"use strict";r.d(t,{$:()=>c,AA:()=>h,Fr:()=>o,R0:()=>d,X1:()=>l,qM:()=>i,rP:()=>u});var n=r(65364);class a extends Error{constructor(e,{status:t,code:r}={}){super(e),this.name="LiveKitCallApiError",this.status=t,this.code=r}}function l(e){if(!e)return!1;if("session_ended"===e.code||410===e.status)return!0;let t=String(e.message||"").toLowerCase();return t.includes("session has ended")||t.includes("call session has ended")}function i(e){if(!e)return!1;if("business_hours_closed"===e.code||403===e.status){let t=String(e.message||"").toLowerCase();return"business_hours_closed"===e.code||t.includes("business hours")||t.includes("10 am to 7 pm")}return!1}async function s(e){let t=await fetch(String((void 0!==n?n.env.NEXT_PUBLIC_LIVEKIT_CALL_API_URL:"")||"/api/india-livekit-call").trim(),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),r=await t.json().catch(()=>({}));if(!t.ok){let e=(null==r?void 0:r.error)||(null==r?void 0:r.detail)||"LiveKit call API failed (".concat(t.status,")"),n="api_error";throw 410===t.status||String(e).toLowerCase().includes("session has ended")?n="session_ended":(403===t.status||(null==r?void 0:r.code)==="business_hours_closed")&&(n="business_hours_closed"),new a(e,{status:t.status,code:n})}return r}async function o(e){return s({action:"create",lead_id:e,role:"customer"})}async function c(e,t){let r=await s({action:"status",lead_id:e,session_id:t,role:"customer"}),n=String((null==r?void 0:r.status)||"").toLowerCase();return{status:n,ended:"ended"===n||"cancelled"===n,call_type:(null==r?void 0:r.call_type)||"audio"}}async function d(e,t){return s({action:"token",lead_id:e,session_id:t,role:"customer"})}async function u(e){return s({action:"poll_outbound",lead_id:e,role:"customer"})}async function h(e,t){return s({action:"end",lead_id:e,session_id:t,role:"customer"})}}},e=>{var t=t=>e(e.s=t);e.O(0,[6042,636,8792],()=>t(9558)),_N_E=e.O()}]);

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.