module.exports=[46927,a=>{"use strict";var b=a.i(87924),c=a.i(72131);function d({id:a}){let[d,e]=(0,c.useState)(null),[f,g]=(0,c.useState)(!0),[h,i]=(0,c.useState)("");if((0,c.useEffect)(()=>{let b=localStorage.getItem("admin_token");if(!b){i("Not authenticated"),g(!1);return}fetch(`/api/admin/chat/${a}`,{headers:{Authorization:`Bearer ${b}`}}).then(a=>{if(!a.ok)throw Error("Failed to load chat session");return a.json()}).then(a=>e(a)).catch(a=>i(a.message)).finally(()=>g(!1))},[a]),f)return(0,b.jsx)("div",{className:"flex items-center justify-center py-20",children:(0,b.jsx)("div",{className:"w-6 h-6 border-2 border-red-accent border-t-transparent rounded-full animate-spin"})});if(h||!d)return(0,b.jsx)("div",{className:"max-w-2xl mx-auto py-12 text-center",children:(0,b.jsx)("p",{className:"text-foreground/50",children:h||"Session not found"})});let j=d.intake_data||{},k=j.name||"Unknown",l=j.email||"",m=d.service_type||j.serviceType||"Not specified";return(0,b.jsxs)("div",{className:"max-w-3xl mx-auto",children:[(0,b.jsxs)("div",{className:"mb-6",children:[(0,b.jsx)("h1",{className:"text-lg font-semibold text-foreground",children:"Chat Transcript"}),(0,b.jsxs)("p",{className:"text-sm text-foreground/50 mt-1",children:[k," ",l&&`(${l})`," · ",m," ·"," ",new Date(d.created_at).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit"})]})]}),(0,b.jsx)("div",{className:"space-y-3",children:d.messages.filter(a=>"system"!==a.role).map((a,c)=>(0,b.jsx)("div",{className:`flex ${"user"===a.role?"justify-end":"justify-start"}`,children:(0,b.jsxs)("div",{className:`max-w-[80%] px-4 py-3 rounded-2xl text-sm leading-relaxed ${"user"===a.role?"bg-red-accent text-white rounded-br-md":"bg-subtle-bg border border-card-border text-foreground rounded-bl-md"}`,children:[(0,b.jsx)("div",{className:"whitespace-pre-wrap",children:a.content}),(0,b.jsx)("div",{className:`text-[10px] mt-1.5 ${"user"===a.role?"text-white/50":"text-foreground/30"}`,children:new Date(a.timestamp).toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit"})})]})},a.id||c))}),(0,b.jsxs)("div",{className:"mt-8 pt-4 border-t border-card-border text-xs text-foreground/40 flex items-center justify-between",children:[(0,b.jsxs)("span",{children:["Status: ",d.intake_state]}),(0,b.jsxs)("span",{children:[d.messages.length," messages"]})]})]})}a.s(["default",()=>d])}];

//# sourceMappingURL=src_app_admin_chat_%5Bid%5D_ChatTranscript_tsx_341f417f._.js.map