1import{aG as w,r as i,j as e,u as v}from"./index-CyIDn5oY.js";import{g as x}from"./digest.functions-Cx7M_Ynq.js";import{S as k}from"./StoppedLinkNotice-DhI6P17-.js";import{u as T,S as z,t as A}from"./SpeedControl-f3UhKViu.js";const L="This link does not match a call on the email";function C(){const{token:n,call:a}=w.useSearch(),[o,l]=i.useState("loading"),[r,f]=i.useState(null),[c,m]=i.useState(null),[s,d]=i.useState("idle"),p=i.useRef(null),{speed:u,setSpeed:y}=T(p),[g,S]=i.useState(null),b=t=>{const h=v(t);h?(S(h),l("stopped")):l("error")};i.useEffect(()=>{(async()=>{if(!n||!a)return l("miss");try{const t=await x({data:{token:n,callId:a,audio:!1}});if(!t.found)return l("miss");f({topic:t.topic,whenLabel:t.whenLabel,line:t.line}),l("ready")}catch(t){b(t)}})()},[n,a]);const j=async()=>{if(!(!n||!a||s==="loading"||c)){d("loading");try{const t=await x({data:{token:n,callId:a,audio:!0}});if(!t.found||!t.dataUri){d("none");return}m(await A(t.dataUri)),d("idle")}catch{d("none")}}};return e.jsxs("div",{className:"dln-page",style:{minHeight:"100dvh",display:"grid",placeItems:"center",background:"#f6f5f4",fontFamily:"-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"},children:[e.jsx("style",{children:` 2 @keyframes dln{to{transform:rotate(360deg)}} 3 .dln-page{padding:24px} 4 .dln-card{padding:30px} 5 @media (max-width:820px){ 6 .dln-page{padding:12px 12px calc(16px + env(safe-area-inset-bottom))} 7 .dln-card{padding:24px 16px;border-radius:14px} 8 } 9 `}),e.jsxs("div",{className:"dln-card",style:{width:"100%",maxWidth:560,background:"#fff",border:"1px solid #e6e4e0",borderRadius:16,boxShadow:"0 10px 40px rgba(45,43,43,.08)",overflowWrap:"anywhere"},children:[e.jsx("img",{src:"/teleserv-logo.png",alt:"TeleServ",style:{height:22,width:"auto",display:"block",margin:"0 auto 22px"}}),e.jsx("div",{style:{fontSize:11,letterSpacing:".08em",textTransform:"uppercase",color:"#0a6d8c",textAlign:"center",fontWeight:700},children:"Worth celebrating"}),o==="loading"&&e.jsxs("div",{style:{textAlign:"center",marginTop:18},children:[e.jsx("div",{style:{width:44,height:44,margin:"0 auto 16px",borderRadius:"50%",border:"3px solid #dcdad5",borderTopColor:"#0088b0",animation:"dln .8s linear infinite"}}),e.jsx("div",{style:{fontSize:15,color:"#6b6864"},children:"Loading the callâ¦"})]}),o==="ready"&&r&&e.jsxs(e.Fragment,{children:[e.jsx("h1",{style:{fontFamily:"Georgia,'Times New Roman',serif",fontSize:24,fontWeight:600,margin:"8px 0 0",color:"#201e1d",textAlign:"center"},children:r.topic}),r.whenLabel&&e.jsx("div",{style:{fontSize:12.5,color:"#9a9793",textAlign:"center",marginTop:6},children:r.whenLabel}),e.jsx("p",{style:{fontSize:15,lineHeight:1.62,color:"#4a4744",margin:"18px 0 0",textAlign:"center"},children:r.line}),c?e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginTop:22},children:[e.jsx("audio",{ref:p,controls:!0,controlsList:"noplaybackrate",autoPlay:!0,src:c,style:{flex:1,minWidth:0,height:44,display:"block"}}),e.jsx(z,{speed:u,onChange:y,size:"lg"})]}):s==="none"?e.jsx("div",{style:{textAlign:"center",fontSize:13.5,color:"#9a9793",padding:"22px 0 6px",lineHeight:1.5},children:"This call has no recording to play."}):e.jsx("button",{onClick:j,disabled:s==="loading",style:{display:"flex",alignItems:"center",justifyContent:"center",gap:9,width:"100%",marginTop:22,border:"1px solid #cfe6ee",background:"#eef7fb",borderRadius:11,padding:"13px",minHeight:44,fontSize:14.5,fontWeight:600,color:"#0a6d8c",cursor:s==="loading"?"default":"pointer",fontFamily:"inherit"},children:s==="loading"?"Loading the recordingâ¦":"Play the recording"})]}),o==="miss"&&e.jsxs("div",{style:{textAlign:"center",marginTop:18},children:[e.jsx("h1",{style:{fontSize:20,fontWeight:600,margin:"0 0 8px",color:"#201e1d"},children:L}),e.jsx("p",{style:{fontSize:14.5,color:"#6b6864",lineHeight:1.55,margin:0},children:"Open the Listen link from the email itself. Only the calls named in that email play here."})]}),o==="stopped"&&g&&e.jsx(k,{...g}),o==="error"&&e.jsxs("div",{style:{textAlign:"center",marginTop:18},children:[e.jsx("h1",{style:{fontSize:20,fontWeight:600,margin:"0 0 8px",color:"#201e1d"},children:"Something went wrong"}),e.jsx("p",{style:{fontSize:14.5,color:"#6b6864",lineHeight:1.55,margin:0},children:"The call could not be loaded just now. Try the link again in a moment."})]})]})]})}export{C as component};
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.