PageSourceSearch

https://country-connect.co.uk/assets/DashboardSupport-BQW3VZ9g.js

js country-connect.co.uk collected 2026-10-04 10:25:50 UTC 42,442 bytes, 6 lines download raw bytes

1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-Dt_fZ0DR.js","assets/index-CbZU0Csi.css"])))=>i.map(i=>d[i]);
2import{cA as jt,u as vt,r,cH as bt,b as Nt,c as k,e as fe,j as e,cF as wt,C as M,i as q,cZ as Ee,B as m,E as yt,M as V,c_ as Q,c$ as Ue,y as $,aP as T,aH as K,f as _e,g as ze,s as p,K as Ct,q as Z,aX as Be,aF as Oe,bl as St,cu as $t,ct as Tt,_ as He,d0 as We,$ as Rt,d1 as Dt,cC as At,d2 as It,bS as Ft,aC as Lt,I as E,b4 as je,d3 as U,X as Y,b5 as Pt,Z as Mt,a1 as qt,N as ke,d4 as Et,d5 as Ut,H as et,x as G,cU as Ve}from"./index-Dt_fZ0DR.js";import{T as _t,a as zt,b as ve,c as be}from"./tabs-D1KgA41r.js";import{S as Bt,a as Ot}from"./SimpleTicketForm-PFI_K7rJ.js";import{S as Ge,a as Ke,b as Ze,c as Ye,d as v}from"./select-CZzvDZ6M.js";import{s as Ht}from"./htmlSanitizer-CpY7Ov5t.js";import{u as Wt,i as kt,a as Vt,E as Gt}from"./index-CMFSFx1G.js";import"./TypingIndicator-DMsG83yU.js";import"./skeleton-C9AxFwjo.js";import"./ChatBubble-czOl3b8-.js";import"./index-CN61O0kr.js";import"./alert-BhsIGHaz.js";import"./SpeedTestWidget-CC80V5Py.js";import"./index-BdQq_4o_.js";function Qe(c){switch(c.toLowerCase()){case"scheduled":case"open":return"bg-blue-500/10 text-blue-600 dark:text-blue-400 border-blue-500/20";case"in progress":return"bg-amber-500/10 text-amber-600 dark:text-amber-400 border-amber-500/20";case"on hold":return"bg-orange-500/10 text-orange-600 dark:text-orange-400 border-orange-500/20";case"complete":return"bg-green-500/10 text-green-600 dark:text-green-400 border-green-500/20";case"closed":case"cancelled":return"bg-muted text-muted-foreground border-border";default:return"bg-muted text-muted-foreground border-border"}}function Kt(c){switch(c.toLowerCase()){case"scheduled":case"open":return e.jsx(Q,{className:"w-4 h-4 text-blue-500"});case"in progress":return e.jsx(Z,{className:"w-4 h-4 text-amber-500"});case"on hold":return e.jsx(K,{className:"w-4 h-4 text-orange-500"});case"complete":return e.jsx(et,{className:"w-4 h-4 text-green-500"});case"closed":case"cancelled":return e.jsx(Y,{className:"w-4 h-4 text-muted-foreground"});default:return e.jsx(Q,{className:"w-4 h-4 text-muted-foreground"})}}function Xe(c){if(!c)return"Not scheduled";try{return new Date(c).toLocaleDateString("en-GB",{weekday:"long",day:"numeric",month:"short",hour:"2-digit",minute:"2-digit"})}catch{return c}}function Zt(c){return c?c.replace(/<[^>]*>/g,`
3`).replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&").replace(/&quot;/g,'"').replace(/<[^>]*>/g,`
4`).replace(/ticket[:\s#]*\d+/gi,"").replace(/splynx[:\s#]*\d+/gi,"").split(`
5`).map(x=>x.replace(/\s{2,}/g," ").trim()).filter(x=>x.length>0).join(`
6`):""}function Yt(){return typeof window>"u"?"tickets":new URLSearchParams(window.location.search).get("source")==="service-check"?"chat":"tickets"}function ms(){const{user:c,loading:x,isAuthenticated:A}=jt(),[,X]=vt(),[Ne,R]=r.useState(()=>Yt()),{isFeatureEnabled:tt}=bt(),I=tt("quick_help"),[st,_]=r.useState(!1),[d,J]=r.useState(null),[g,z]=r.useState("all"),[ee,te]=r.useState(!1),[w,we]=r.useState(""),[y,ye]=r.useState(""),[se,at]=r.useState(!1),[b,B]=r.useState([]),[Ce,ae]=r.useState(!1),[it,Se]=r.useState({}),[ie,nt]=r.useState(null),[$e,ne]=r.useState(null),[re,Te]=r.useState(""),[Re,De]=r.useState("AM"),[Ae,Ie]=r.useState(""),[O,Fe]=r.useState({}),[F,le]=r.useState({}),[de,ce]=r.useState(!1),Le=r.useRef({}),oe=r.useRef(null),{toast:h}=Nt(),n=Wt({extensions:[kt,Vt.configure({placeholder:"Type your reply..."})],editorProps:{attributes:{class:"max-w-none focus:outline-none min-h-[80px] text-[13px] px-3 py-2 text-foreground"}}}),{data:o,isLoading:rt}=k({queryKey:["/api/customer/support"],enabled:A,staleTime:5*60*1e3}),{data:me,isLoading:lt}=k({queryKey:[`/api/customer/support/${d}/messages`],enabled:!!d,staleTime:2*60*1e3}),{data:C,isLoading:dt,isError:ct}=k({queryKey:["/api/customer/activity"],enabled:A,staleTime:5*60*1e3}),{data:f}=k({queryKey:["/api/network-status/mine"],enabled:A,staleTime:2*60*1e3}),Pe=r.useMemo(()=>C?C.length:0,[C]),xe=r.useRef({});r.useEffect(()=>{if(!d||!c)return;xe.current[d]=(xe.current[d]||0)+1;const t=xe.current[d];(async()=>{try{await G("POST",`/api/support/tickets/${d}/track-open`),console.log(`[TICKET ${d}] Tracked ticket open #${t} at ${new Date().toISOString()}`)}catch(s){console.error(`[TICKET ${d}
6] Failed to track ticket open:`,s)}})()},[d,c]),r.useEffect(()=>{if(n){if(oe.current){const t=n.getHTML();t&&t!=="<p></p>"&&Se(i=>({...i,[oe.current]:t}))}if(d){const t=it[d];t?n.commands.setContent(t):n.commands.clearContent(),B([])}oe.current=d}},[d,n]);const ue=fe({mutationFn:async({ticketId:t,message:i,imageUrls:s,ticketStatus:a})=>await G("POST",`/api/customer/support/${t}/messages`,{message:i,imageUrls:s,ticketStatus:a}),onSuccess:(t,i)=>{$.invalidateQueries({queryKey:[`/api/customer/support/${d}/messages`]}),$.invalidateQueries({queryKey:["/api/customer/support"]}),n==null||n.commands.clearContent(),B([]),Se(s=>{const a={...s};return delete a[i.ticketId],a}),h({title:"Reply sent",description:"Your message has been added to the ticket"})},onError:t=>{h({title:"Failed to send reply",description:t.message||"Please try again",variant:"destructive"})}}),pe=fe({mutationFn:async({taskId:t,newDate:i,newSlot:s,reason:a})=>await G("POST",`/api/customer/activity/${t}/request-change`,{newDate:i,newSlot:s,reason:a}),onSuccess:()=>{$.invalidateQueries({queryKey:["/api/customer/activity"]}),ne(null),Te(""),De("AM"),Ie(""),h({title:"Time change requested",description:"Your request has been submitted. The team will review it shortly."})},onError:t=>{h({title:"Failed to submit request",description:t.message||"Please try again",variant:"destructive"})}}),H=fe({mutationFn:async({taskId:t,message:i,attachmentUrls:s})=>await G("POST",`/api/customer/activity/${t}/comment`,{message:i,attachmentUrls:s}),onSuccess:(t,i)=>{$.invalidateQueries({queryKey:["/api/customer/activity"]}),Fe(s=>{const a={...s};return delete a[i.taskId],a}),le(s=>{const a={...s};return delete a[i.taskId],a}),h({title:"Comment added",description:"Your comment has been sent to the support team."})},onError:t=>{h({title:"Failed to add comment",description:t.message||"Please try again",variant:"destructive"})}}),ot=(t,i)=>{const s=Array.from(i.target.files||[]),a=s.filter(l=>l.type.startsWith("image/")||l.type==="application/pdf");a.length!==s.length&&h({title:"Invalid files",description:"Only images and PDFs are supported",variant:"destructive"}),le(l=>({...l,[t]:[...l[t]||[],...a].slice(0,5)})),i.target&&(i.target.value="")},mt=(t,i)=>{le(s=>({...s,[t]:(s[t]||[]).filter((a,l)=>l!==i)}))},Me=async t=>{const i=(O[t]||"").trim(),s=F[t]||[];if(!i&&s.length===0)return;let a=[];if(s.length>0){ce(!0);try{const{auth:u}=await Ve(async()=>{const{auth:S}=await import("./index-Dt_fZ0DR.js").then(j=>j.gw);return{auth:S}},__vite__mapDeps([0,1])),N=u.currentUser;if(!N)throw new Error("Not authenticated");const D=await N.getIdToken(),L=s.map(async S=>{const j=new FormData;j.append("file",S);const P=await fetch("/api/upload/support-attachment",{method:"POST",headers:{Authorization:`Bearer ${D}`},body:j});if(!P.ok)throw new Error("Failed to upload file");const{url:ge}=await P.json();return ge});a=await Promise.all(L)}catch{h({title:"Failed to upload attachments",description:"Please try again",variant:"destructive"}),ce(!1);return}ce(!1)}const l=i||(a.length>0?"Attachments":"");H.mutate({taskId:t,message:l,attachmentUrls:a})},xt=async()=>{if(!d||!n)return;const t=n.getHTML(),i=n.getText().trim().length>0;if(!i&&b.length===0)return;let s=[];if(b.length>0){ae(!0);try{const{auth:u}=await Ve(async()=>{const{auth:S}=await import("./index-Dt_fZ0DR.js").then(j=>j.gw);return{auth:S}},__vite__mapDeps([0,1])),N=u.currentUser;if(!N)throw new Error("Not authenticated");const D=await N.getIdToken(),L=b.map(async S=>{const j=new FormData;j.append("file",S);const P=await fetch("/api/upload/support-attachment",{method:"POST",headers:{Authorization:`Bearer ${D}`},body:j});if(!P.ok)throw new Error("Failed to upload file");const{url:ge}=await P.json();return ge});s=await Promise.all(L)}catch{h({title:"Failed to upload attachments",description:"Please try again",variant:"destructive"}),ae(!1);return}ae(!1)}let a=i?t:s.length>0?"<p>Attachments</p>":"";const l=o==null?void 0:o.find(u=>u.id===d);ue.mutate({ticketId:d,message:a,imageUrls:s,ticketStatus:l==null?void 0:l.status})},ut=t=>{const i=Array.from(t.target.files||[]),s=i.filter(a=>a.type.startsWith("image/"));s.length!==i.length&&h({title:"Invalid files",description:"Only image files are allowed",variant:"destructive"}),B(a=>[...a,...s].slice(0,3))},pt=t=>{B(i=>i.filter((s,a)=>a!==t))};r.useEffect(()=>{!x&&!A&&X("/login")},[x,A,X]);const W=r.useMemo(()=>
6{if(!o)return[];let t=[...o];if(ee||(t=t.filter(i=>!i.closed)),g!=="all"&&(t=t.filter(i=>{const s=i.status.toLowerCase(),a=g.toLowerCase();return!!(s===a||a==="waiting"&&s.includes("waiting"))})),w){const i=new Date(`${w}T00:00:00`);t=t.filter(s=>new Date(s.createdDate)>=i)}if(y){const i=new Date(`${y}T23:59:59.999`);t=t.filter(s=>new Date(s.createdDate)<=i)}return t},[o,g,ee,w,y]),ht=()=>{z("all"),we(""),ye("")},he=g!=="all"||w!==""||y!=="";r.useMemo(()=>o?{all:o.length,open:o.filter(t=>["new","open"].includes(t.status.toLowerCase())).length,inProgress:o.filter(t=>{const i=t.status.toLowerCase();return i==="in progress"||i.includes("waiting")}).length,closed:o.filter(t=>t.closed===!0).length}:{all:0,open:0,inProgress:0,closed:0},[o]);const qe=r.useMemo(()=>o?o.filter(t=>!t.closed).length:0,[o]);if(x)return e.jsx("div",{className:"min-h-screen flex items-center justify-center",children:e.jsx("div",{className:"text-lg",children:"Loading..."})});if(!c)return null;const gt=[{label:"Dashboard",href:"/dashboard"},{label:"Support"}],ft=t=>{const s=document.documentElement.classList.contains("dark")?"rgb(248 113 113)":"rgb(239 68 68)",a=t.toLowerCase();return a==="open"||a==="new"?e.jsx(K,{className:"w-4 h-4",style:{color:s}}):a==="in progress"||a.includes("waiting")?e.jsx(Z,{className:"w-4 h-4",style:{color:"rgb(234 179 8)"}}):a==="closed"||a==="resolved"?e.jsx(et,{className:"w-4 h-4",style:{color:"rgb(22 163 74)"}}):e.jsx(V,{className:"w-4 h-4 text-muted-foreground"})};return e.jsx(wt,{title:"Support Centre",breadcrumbs:gt,children:e.jsxs("div",{className:"space-y-4",children:[e.jsx("p",{className:"text-muted-foreground text-[10pt] sm:text-sm","data-testid":"text-support-subtitle",children:"Get help and manage your support tickets"}),(f==null?void 0:f.impacted)&&f.incidents.length>0&&e.jsx(M,{className:"border-amber-500/40 bg-amber-500/5","data-testid":"banner-network-incident",children:e.jsxs(q,{className:"py-3 flex items-start gap-3",children:[e.jsx(Ee,{className:"w-5 h-5 text-amber-600 dark:text-amber-400 shrink-0 mt-0.5"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-[10pt] sm:text-sm font-medium text-amber-800 dark:text-amber-300",children:f.incidents[0].impact==="major"||f.incidents[0].impact==="critical"?"There is a known outage affecting your area":"There is a network issue affecting your area"}),e.jsxs("p",{className:"text-[9pt] sm:text-[12px] text-muted-foreground mt-0.5",children:[f.incidents[0].title,f.incidents.length>1?` (+${f.incidents.length-1} more)`:""," — our team is on it. You can still raise a ticket below."]})]}),e.jsxs(m,{variant:"outline",size:"sm",className:"shrink-0 border-amber-400/60",onClick:()=>X("/dashboard/support/status"),"data-testid":"button-view-network-status",children:["View status",e.jsx(yt,{className:"w-3.5 h-3.5 ml-1"})]})]})}),e.jsxs(_t,{value:Ne,onValueChange:R,className:"w-full",children:[e.jsxs(zt,{className:"w-full grid grid-cols-3","data-testid":"tabs-support",children:[e.jsxs(ve,{value:"tickets",className:"gap-2 text-[10pt] sm:text-sm","data-testid":"tab-tickets",children:[e.jsx(V,{className:"w-4 h-4"}),e.jsxs("span",{children:["Tickets",qe>0?` (${qe})`:""]})]}),e.jsxs(ve,{value:"activity",className:"gap-2 text-[10pt] sm:text-sm","data-testid":"tab-activity",children:[e.jsx(Q,{className:"w-4 h-4"}),e.jsxs("span",{children:["Activity",Pe>0?` (${Pe})`:""]})]}),e.jsxs(ve,{value:"chat",className:"relative gap-2 text-[10pt] sm:text-sm","data-testid":"tab-chat",children:[e.jsx(Ue,{className:"w-4 h-4"}),e.jsx("span",{children:I?"Get Support":"Raise a Ticket"}),I&&st&&e.jsx("span",{className:"absolute top-1.5 right-1.5 w-2 h-2 rounded-full bg-primary animate-pulse","data-testid":"indicator-active-session"})]})]}),e.jsx(be,{value:"chat",forceMount:!0,className:`mt-4 ${Ne!=="chat"?"hidden":""}`,style:I?{height:"calc(100vh - 200px)",minHeight:"400px"}:{},"data-testid":"tab-content-chat",children:I?e.jsx(Bt,{onDismiss:()=>{_(!1),R("tickets")},onTicketCreated:()=>{_(!0),$.invalidateQueries({queryKey:["/api/customer/support"]})},onViewTicket:t=>{_(!1),R("tickets"),te(!0),z("all"),J(t)},onSessionStart:()=>_(!0)}):e.jsx(Ot,{onTicketCreated:()=>{$.invalidateQueries({queryKey:["/api/customer/support"]})},onViewTickets:()=>R("tickets")})}),e.jsx(be,{value:"activity",className:"mt-4","data-testid":"tab-content-activity",children:dt?e.jsx("div",{className:"flex items-center justify-center h-64",children:e.jsx(T,{className:"w-8 h-8 animate-spin text-muted-foreground"})}):ct?e.jsx(M,{children:e.jsx(q,{className:"py-8",children:e.jsxs("div",{className:"text-center",children:[e.jsx(K,{className:"w-12 h-12 text-muted-foreground mx-auto mb-3"}),e.jsx("p",{className:"text-[10pt] sm:text-[14px] text-muted-foreground mb-1","data-testid":"text-activity-error",children:"Unable to load activity"}),e.jsx("p",{className:"text-[9pt] sm:text-[12px] text-muted-foreground mb-4",children:"There was a problem fetching your scheduled tasks. Please try again."}),e.jsxs(m,{variant:"outline",size:"sm",onClick:()=>
6$.invalidateQueries({queryKey:["/api/customer/activity"]}),"data-testid":"button-retry-activity",children:[e.jsx(T,{className:"w-4 h-4 mr-2"}),"Retry"]})]})})}):C&&C.length>0?e.jsxs(M,{"data-testid":"card-activity-tasks",children:[e.jsx(_e,{children:e.jsxs(ze,{className:"text-[14px] sm:text-[16px]",children:["Upcoming Activity (",C.length,")"]})}),e.jsx(q,{children:e.jsx("div",{className:"flex flex-col gap-2",children:C.map(t=>{const i=Zt(t.description);return e.jsxs("div",{className:"border rounded-md","data-testid":`activity-task-${t.id}`,children:[e.jsxs("button",{onClick:()=>nt(ie===t.id?null:t.id),className:"w-full px-3 py-2.5 flex items-center justify-between hover-elevate active-elevate-2 pt-[6px] pb-[6px] mt-[4px] mb-[4px]","data-testid":`button-toggle-activity-${t.id}`,children:[e.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[Kt(t.status),e.jsxs("div",{className:"text-left flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx("span",{className:"text-[10pt] sm:text-[14px] font-medium","data-testid":`text-activity-title-${t.id}`,children:t.title}),e.jsx(p,{variant:"outline",className:`text-[10px] px-1.5 py-0.5 h-5 ${Qe(t.status)}`,"data-testid":`badge-activity-status-${t.id}`,children:t.status.toUpperCase()})]}),e.jsxs("div",{className:"text-[10pt] sm:text-[12px] text-muted-foreground mt-0.5 flex items-center gap-2 flex-wrap",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Ct,{className:"w-3 h-3"}),Xe(t.scheduledFrom)]}),t.duration&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-muted-foreground/50",children:"·"}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Z,{className:"w-3 h-3"}),t.duration]})]})]})]})]}),e.jsxs("div",{className:"flex items-center gap-2 ml-2 flex-shrink-0",children:[t.linkedTicketId&&e.jsxs(p,{variant:"secondary",className:"text-[10px] h-5 hidden sm:inline-flex","data-testid":`badge-linked-ticket-${t.id}`,children:["Ticket #",t.linkedTicketId]}),e.jsx(Be,{className:`w-4 h-4 text-muted-foreground transition-transform ${ie===t.id?"rotate-180":""}`})]})]}),ie===t.id&&e.jsx("div",{className:"border-t bg-muted/20",children:e.jsxs("div",{className:"px-3 py-2.5 space-y-3",children:[t.sessionContext?e.jsxs(e.Fragment,{children:[e.jsxs("div",{"data-testid":`session-issue-summary-${t.id}`,children:[e.jsx("p",{className:"text-[10pt] sm:text-[13px] font-medium text-foreground",children:t.sessionContext.issueSummary}),t.sessionContext.likelyCause&&e.jsxs("p",{className:"text-[9pt] sm:text-[11px] text-muted-foreground mt-0.5 flex items-center gap-1",children:[e.jsx(Ee,{className:"w-3 h-3 flex-shrink-0"}),e.jsx("span",{children:t.sessionContext.likelyCause})]})]}),t.sessionContext.diagnosticResults&&e.jsxs("div",{className:"rounded-md border bg-card p-3 space-y-2","data-testid":`session-diagnostics-${t.id}`,children:[e.jsxs("p",{className:"text-[9pt] sm:text-[11px] font-medium text-muted-foreground flex items-center gap-1.5",children:[e.jsx(Oe,{className:"w-3 h-3"}),"Diagnostic Report"]}),e.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-2",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[t.sessionContext.diagnosticResults.connectionStatus==="Online"?e.jsx(St,{className:"w-3.5 h-3.5 text-green-500"}):e.jsx($t,{className:"w-3.5 h-3.5 text-red-500"}),e.jsx("span",{className:`text-[10pt] sm:text-[12px] font-medium ${t.sessionContext.diagnosticResults.connectionStatus==="Online"?"text-green-600 dark:text-green-400":"text-red-600 dark:text-red-400"}`,children:t.sessionContext.diagnosticResults.connectionStatus})]}),(t.sessionContext.diagnosticResults.speedDown!==void 0||t.sessionContext.diagnosticResults.planSpeedDown!==void 0)&&e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(Tt,{className:"w-3.5 h-3.5 text-muted-foreground"}),e.jsx("span",{className:"text-[10pt] sm:text-[12px]",children:t.sessionContext.diagnosticResults.speedDown!==void 0?`${t.sessionContext.diagnosticResults.speedDown}/${t.sessionContext.diagnosticResults.speedUp} Mbps`:`Plan: ${t.sessionContext.diagnosticResults.planSpeedDown}/${t.sessionContext.diagnosticResults.planSpeedUp}`})]}),t.sessionContext.diagnosticResults.stabilityScore&&e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(Oe,{className:`w-3.5 h-3.5 ${t.sessionContext.diagnosticResults.stabilityScore==="stable"?"text-green-500":t.sessionContext.diagnosticResults.stabilityScore==="intermittent"?"text-amber-500":"text-red-500"}`}),e.jsxs("span",{className:`text-[10pt] sm:text-[12px] capitalize ${t.sessionContext.diagnosticResults.stabilityScore==="stable"?"text-green-600 dark:text-green-400":t.sessionContext.diagnosticResults.stabilityScore==="intermittent"?"text-amber-600 dar
6k:text-amber-400":"text-red-600 dark:text-red-400"}`,children:[t.sessionContext.diagnosticResults.stabilityScore,t.sessionContext.diagnosticResults.disconnectionCount!==void 0&&t.sessionContext.diagnosticResults.disconnectionCount>0&&` (${t.sessionContext.diagnosticResults.disconnectionCount} drops)`]})]}),t.sessionContext.diagnosticResults.nasHealth&&e.jsxs("div",{className:"flex items-center gap-1.5",children:[t.sessionContext.diagnosticResults.nasHealth==="Healthy"?e.jsx(He,{className:"w-3.5 h-3.5 text-green-500"}):e.jsx(K,{className:"w-3.5 h-3.5 text-amber-500"}),e.jsxs("span",{className:"text-[10pt] sm:text-[12px]",children:["Mast: ",t.sessionContext.diagnosticResults.nasHealth,t.sessionContext.diagnosticResults.nasName&&` (${t.sessionContext.diagnosticResults.nasName})`]})]})]}),t.sessionContext.diagnosticResults.speedDown!==void 0&&t.sessionContext.diagnosticResults.planSpeedDown!==void 0&&e.jsx("div",{className:"pt-1 border-t border-border/50",children:e.jsxs("div",{className:"flex items-center gap-2 text-[9pt] sm:text-[11px] text-muted-foreground",children:[e.jsxs("span",{children:["Plan speed: ",t.sessionContext.diagnosticResults.planSpeedDown,"/",t.sessionContext.diagnosticResults.planSpeedUp," Mbps"]}),e.jsx("span",{className:"text-muted-foreground/50",children:"vs"}),e.jsxs("span",{children:["Actual: ",t.sessionContext.diagnosticResults.speedDown,"/",t.sessionContext.diagnosticResults.speedUp," Mbps"]})]})}),t.sessionContext.diagnosticResults.disconnectionCauses&&t.sessionContext.diagnosticResults.disconnectionCauses.length>0&&e.jsx("div",{className:"pt-1 border-t border-border/50",children:e.jsxs("p",{className:"text-[9pt] sm:text-[11px] text-muted-foreground",children:["Drop causes: ",t.sessionContext.diagnosticResults.disconnectionCauses.join(", ")]})})]}),t.sessionContext.stepsTried.length>0&&e.jsxs("div",{"data-testid":`session-steps-tried-${t.id}`,children:[e.jsxs("p",{className:"text-[9pt] sm:text-[11px] font-medium text-muted-foreground mb-1.5 flex items-center gap-1.5",children:[e.jsx(We,{className:"w-3 h-3"}),"What's Been Tried"]}),e.jsx("div",{className:"flex flex-col gap-1",children:t.sessionContext.stepsTried.map((s,a)=>e.jsxs("div",{className:"flex items-start gap-2 text-[10pt] sm:text-[12px] py-0.5",children:[s.outcome==="resolved"?e.jsx(He,{className:"w-3.5 h-3.5 text-green-500 mt-0.5 flex-shrink-0"}):s.outcome==="no improvement"?e.jsx(Rt,{className:"w-3.5 h-3.5 text-red-500 mt-0.5 flex-shrink-0"}):e.jsx(Dt,{className:"w-3.5 h-3.5 text-muted-foreground mt-0.5 flex-shrink-0"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("span",{className:"font-medium",children:s.step}),e.jsxs("span",{className:"text-muted-foreground",children:[" — ",s.outcome]}),s.evidenceUrl&&e.jsx("img",{src:s.evidenceUrl,alt:s.step,className:"mt-1 rounded border max-w-[120px] max-h-[80px] object-cover","data-testid":`img-step-evidence-${t.id}-${a}`})]})]},a))})]}),t.sessionContext.evidenceCollected.length>0&&e.jsxs("div",{"data-testid":`session-evidence-${t.id}`,children:[e.jsxs("p",{className:"text-[9pt] sm:text-[11px] font-medium text-muted-foreground mb-1.5 flex items-center gap-1.5",children:[e.jsx(At,{className:"w-3 h-3"}),"Evidence Collected"]}),e.jsx("div",{className:"flex flex-wrap gap-2",children:t.sessionContext.evidenceCollected.map((s,a)=>e.jsxs("div",{className:"border rounded-md p-2 bg-card text-[10pt] sm:text-[12px] max-w-[200px]",children:[s.url&&e.jsx("img",{src:s.url,alt:s.type,className:"rounded border max-w-full max-h-[80px] object-cover mb-1","data-testid":`img-evidence-${t.id}-${a}`}),e.jsx("p",{className:"font-medium capitalize",children:s.type}),s.analysis&&e.jsx("p",{className:"text-[9pt] sm:text-[11px] text-muted-foreground mt-0.5",children:s.analysis})]},a))})]}),t.sessionContext.pendingEvidenceRequests.length>0&&e.jsxs("div",{className:"rounded-md border border-amber-500/30 bg-amber-500/5 p-3","data-testid":`session-pending-evidence-${t.id}`,children:[e.jsxs("p",{className:"text-[9pt] sm:text-[11px] font-medium text-amber-600 dark:text-amber-400 mb-1.5 flex items-center gap-1.5",children:[e.jsx(It,{className:"w-3 h-3"}),"Evidence Still Needed"]}),e.jsx("div",{className:"flex flex-col gap-1.5",children:t.sessionContext.pendingEvidenceRequests.map((s,a)=>e.jsxs("div",{className:"flex items-center gap-2 text-[10pt] sm:text-[12px]",children:[e.jsx(Ft,{className:"w-3.5 h-3.5 text-amber-500 flex-shrink-0"}),e.jsx("span",{children:s})]},a))}),e.jsx("p",{className:"text-[9pt] sm:text-[11px] text-muted-foreground mt-2",children:"Add photos using the comment box below to help the engineer prepare."})]})]}):e.jsxs(e.Fragment,{children:[i&&e.jsxs("div",{children:[e.jsx("p",{className:"text-[9pt] sm:text-[11px] font-medium text-muted-foreground mb-1",children:"Description"}),e.jsx("p",{className:"text-[10pt] sm:text-[12px] text-foreground whitespace-pre-wrap break-words","data-testid":`text-activity-description-${t.id}`,children:i})]}),e.jsxs("div",{className:"flex flex-wrap gap-3",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-[9pt] sm:text-[11px] font-medium text-muted-foreground mb-0.5",children:"Status"}),e.jsx(p,{variant:"outline",className:`text-[10px] h-5 ${Qe(t.status)}`,children:t.status})]}),t.scheduledFrom&&e.jsxs("div",{children:[e.jsx("p",{className:"text-[9pt] sm:text-[11px] font-medium text-muted-foreground mb-0.5",children:"Scheduled"}),e.jsx("p",{className:"text-[10pt] sm:text-[12px]",children:Xe(t.scheduledFrom)})]}),t.duration&&e.jsxs("div",{children:[e.jsx("p",{className:"text-[9pt] sm:text-[11px] font-medium text-muted-foreground mb-0.5",children:"Duration"}),e.jsx("p",{className:"text-[10pt] sm:text-[12px]",children:t.duration})]})]})]}),e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[t.linkedTicketId&&e.jsxs(m,{variant:"outline",size:"sm",onClick:s=>{s.stopPropagation(),R("tickets"),te(!0),z("all"),J(t.linkedTicketId)},"data-testid":`button-view-linked-ticket-${t.id}`,children:[e.jsx(Lt,{className:"w-3.5 h-3.5 mr-1.5"}),"View Linked Ticket"]}),e.jsxs(m,{variant:"outline",size:"sm",onClick:s=>{s.stopPropagation(),ne($e===t.id?null:t.id)},"data-testid":`button-request-time-change-${t.id}`,children:[e.jsx(Z,{className:"w-3.5 h-3.5 mr-1.5"}),"Request Time Change"]})]}),$e===t.id&&e.jsxs("div",{className:"p-3 rounded border bg-card space-y-2","data-testid":`form-time-change-${t.id}`,children:[e.jsx("p",{className:"text-[9pt] sm:text-[11px] font-medium text-muted-foreground",children:"Request a New Time"}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx(E,{type:"date",value:re,onChange:s=>Te(s.target.value),className:"w-auto text-[12px]",min:new Date().toISOString().split("T")[0],"data-testid":`input-change-date-${t.id}`}),e.jsxs(Ge,{value:Re,onValueChange:De,children:[e.jsx(Ke,{className:"w-[100px] text-[12px]","data-testid":`select-change-slot-${t.id}`,children:e.jsx(Ze,{})}),e.jsxs(Ye,{children:[e.jsx(v,{value:"AM",children:"Morning"}),e.jsx(v,{value:"PM",children:"Afternoon"})]})]})]}),e.jsx(E,{placeholder:"Reason for change (optional)",value:Ae,onChange:s=>Ie(s.target.value),className:"text-[12px]","data-testid":`input-change-reason-${t.id}`}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(m,{size:"sm",disabled:!re||pe.isPending,onClick:s=>{s.stopPropagation(),pe.mutate({taskId:t.id,newDate:re,newSlot:Re,reason:Ae})},"data-testid":`button-submit-time-change-${t.id}`,children:[pe.isPending?e.jsx(T,{className:"w-3.5 h-3.5 animate-spin mr-1.5"}):e.jsx(je,{className:"w-3.5 h-3.5 mr-1.5"}),"Submit Request"]}),e.jsx(m,{variant:"ghost",size:"sm",onClick:s=>{s.stopPropagation(),ne(null)},"data-testid":`button-cancel-time-change-${t.id}`,children:"Cancel"})]})]}),t.changeRequests.length>0&&e.jsxs("div",{children:[e.jsx("p",{className:"text-[9pt] sm:text-[11px] font-medium text-muted-foreground mb-1",children:"Time Change Requests"}),e.jsx("div",{className:"flex flex-col gap-1",children:t.changeRequests.map(s=>e.jsxs("div",{className:"text-[10pt] sm:text-[12px] p-2 rounded border bg-card flex items-center gap-2 flex-wrap",children:[e.jsx(p,{variant:"outline",className:`text-[10px] h-5 ${s.status==="approved"?"bg-green-500/10 text-green-600 dark:text-green-400 border-green-500/20":s.status==="rejected"?"bg-red-500/10 text-red-600 dark:text-red-400 border-red-500/20":"bg-
6amber-500/10 text-amber-600 dark:text-amber-400 border-amber-500/20"}`,children:s.status.toUpperCase()}),e.jsxs("span",{children:[s.requestedDate," ",s.requestedSlot]}),s.reason&&e.jsxs("span",{className:"text-muted-foreground",children:["- ",s.reason]})]},s.id))})]}),t.comments.length>0&&e.jsxs("div",{children:[e.jsx("p",{className:"text-[9pt] sm:text-[11px] font-medium text-muted-foreground mb-1",children:"Comments"}),e.jsx("div",{className:"flex flex-col gap-1",children:t.comments.map(s=>e.jsxs("div",{className:"text-[10pt] sm:text-[12px] p-2 rounded border bg-card","data-testid":`comment-${s.id}`,children:[e.jsxs("div",{className:"flex justify-between mb-1",children:[e.jsx("span",{className:"font-medium text-[10pt] sm:text-[13px]",children:"You"}),e.jsx("span",{className:"text-muted-foreground text-[9pt] sm:text-[11px]",children:s.createdAt?new Date(s.createdAt).toLocaleDateString("en-GB",{day:"2-digit",month:"short",hour:"2-digit",minute:"2-digit"}):""})]}),e.jsx("p",{className:"text-foreground",children:s.message}),s.attachmentUrls&&s.attachmentUrls.length>0&&e.jsx("div",{className:"flex flex-wrap gap-2 mt-2",children:s.attachmentUrls.map((a,l)=>e.jsx("a",{href:a,target:"_blank",rel:"noopener noreferrer",className:"block","data-testid":`comment-attachment-${s.id}-${l}`,children:a.split("?")[0].match(/\.(jpg|jpeg|png|gif|webp)$/i)?e.jsx("img",{src:a,alt:`Attachment ${l+1}`,className:"w-16 h-16 object-cover rounded border"}):e.jsxs("div",{className:"flex items-center gap-1 px-2 py-1 rounded border bg-muted text-[10px]",children:[e.jsx(U,{className:"w-3 h-3"}),e.jsxs("span",{children:["File ",l+1]})]})},l))})]},s.id))})]}),e.jsxs("div",{className:"border-t pt-2","data-testid":`form-activity-comment-${t.id}`,children:[e.jsx("p",{className:"text-[9pt] sm:text-[11px] font-medium text-muted-foreground mb-1",children:"Add a Comment"}),(F[t.id]||[]).length>0&&e.jsx("div",{className:"flex flex-wrap gap-2 mb-2",children:(F[t.id]||[]).map((s,a)=>e.jsxs("div",{className:"relative group","data-testid":`preview-attachment-${t.id}-${a}`,children:[s.type.startsWith("image/")?e.jsx("img",{src:URL.createObjectURL(s),alt:s.name,className:"w-14 h-14 object-cover rounded border"}):e.jsx("div",{className:"w-14 h-14 flex items-center justify-center rounded border bg-muted",children:e.jsx(U,{className:"w-4 h-4 text-muted-foreground"})}),e.jsx("button",{onClick:l=>{l.stopPropagation(),mt(t.id,a)},className:"absolute -top-1.5 -right-1.5 w-4 h-4 rounded-full bg-destructive text-destructive-foreground flex items-center justify-center text-[10px]","data-testid":`button-remove-attachment-${t.id}-${a}`,children:e.jsx(Y,{className:"w-3 h-3"})})]},a))}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(E,{placeholder:"Add a note or attach photos...",value:O[t.id]||"",onChange:s=>Fe(a=>({...a,[t.id]:s.target.value})),className:"text-[12px] flex-1",onKeyDown:s=>{const a=(O[t.id]||"").trim(),l=(F[t.id]||[]).length>0;s.key==="Enter"&&!s.shiftKey&&(a||l)&&(s.preventDefault(),Me(t.id))},"data-testid":`input-activity-comment-${t.id}`}),e.jsx("input",{type:"file",accept:"image/*,.pdf",multiple:!0,className:"hidden",ref:s=>{Le.current[t.id]=s},onChange:s=>ot(t.id,s),"data-testid":`input-file-activity-${t.id}`}),e.jsx(m,{size:"icon",variant:"outline",onClick:s=>{var a;s.stopPropagation(),(a=Le.current[t.id])==null||a.click()},disabled:de||H.isPending,"data-testid":`button-attach-activity-${t.id}`,children:e.jsx(U,{className:"w-4 h-4"})}),e.jsx(m,{size:"icon",disabled:!(O[t.id]||"").trim()&&!(F[t.id]||[]).length||H.isPending||de,onClick:s=>{s.stopPropagation(),Me(t.id)},"data-testid":`button-send-activity-comment-${t.id}`,children:H.isPending||de?e.jsx(T,{className:"w-4 h-4 animate-spin"}):e.jsx(je,{className:"w-4 h-4"})})]})]})]})})]},t.id)})})})]}):e.jsx(M,{"data-testid":"card-activity-empty",children:e.jsx(q,{className:"py-8",children:e.jsxs("div",{className:"text-center",children:[e.jsx(Q,{className:"w-12 h-12 text-muted-foreground mx-auto mb-3"}),e.jsx("p",{className:"text-[10pt] sm:text-[14px] text-muted-foreground mb-1","data-testid":"text-no-activity",children:"No upcoming activity"}),e.jsx("p",{className:"text-[9pt] sm:text-[12px] text-muted-foreground mb-4",children:"When you book a callback or engineer visit, it will appear here"}),e.jsxs(m,{variant:"outline",size:"sm",onClick:()=>R("chat"),"data-testid":"button-go-to-support",children:[e.jsx(Ue,{className:"w-4 h-4 mr-2"}),I?"Get Support":"Raise a Ticket"]})]})})})}),e.jsx(be,{value:"tickets",className:"mt-4","data-testid":"tab-content-tickets",children:rt?e.jsx("div",{className:"flex items-center justify-center h-64",children:e.jsx(T,{className:"w-8 h-8 animate-spin text-muted-foreground"})}):e.jsxs(M,{"data-testid":"card-support-tickets",children:[e.jsx(_e,{children:e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3",children:[e.jsxs(ze,{className:"text-[14px] sm:text-[16
6px]",children:["Your Support Tickets (",W.length,")"]}),o&&o.length>0&&e.jsxs("div",{className:"flex flex-row gap-3 items-center w-full sm:w-auto",children:[e.jsxs(m,{variant:"outline",size:"sm",onClick:()=>at(!se),className:"flex-1 sm:flex-none","data-testid":"button-toggle-filters",children:[e.jsx(Pt,{className:"w-4 h-4 mr-2"}),se?"Hide":"Filters",he&&e.jsx(p,{variant:"default",className:"ml-2 h-5 text-[10px]",children:"Active"})]}),e.jsxs("div",{className:"flex items-center gap-2 pl-3 border-l",children:[e.jsx(Mt,{id:"show-closed",checked:ee,onCheckedChange:te,"data-testid":"switch-show-closed"}),e.jsx(qt,{htmlFor:"show-closed",className:"text-[10pt] sm:text-[13px] cursor-pointer whitespace-nowrap",children:"Closed"})]})]})]}),se&&o&&o.length>0&&e.jsxs("div",{className:"stack-spacing p-3 border rounded-md bg-muted/20",children:[e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-[10pt] sm:text-[12px] font-medium mb-1.5 block",children:"Status"}),e.jsxs(Ge,{value:g,onValueChange:z,children:[e.jsx(Ke,{className:"h-9","data-testid":"select-status-filter",children:e.jsx(Ze,{placeholder:"All statuses"})}),e.jsxs(Ye,{children:[e.jsx(v,{value:"all",children:"All Statuses"}),e.jsx(v,{value:"new",children:"New"}),e.jsx(v,{value:"open",children:"Open"}),e.jsx(v,{value:"in progress",children:"In Progress"}),e.jsx(v,{value:"waiting",children:"Waiting"}),e.jsx(v,{value:"closed",children:"Closed"}),e.jsx(v,{value:"resolved",children:"Resolved"})]})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-[10pt] sm:text-[12px] font-medium mb-1.5 block",children:"From Date"}),e.jsx("div",{className:"relative",children:e.jsx(E,{type:"date",value:w,onChange:t=>we(t.target.value),className:"h-9","data-testid":"input-date-from"})})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-[10pt] sm:text-[12px] font-medium mb-1.5 block",children:"To Date"}),e.jsx("div",{className:"relative",children:e.jsx(E,{type:"date",value:y,onChange:t=>ye(t.target.value),className:"h-9","data-testid":"input-date-to"})})]}),e.jsx("div",{className:"flex items-end",children:e.jsxs(m,{variant:"ghost",size:"sm",onClick:ht,disabled:!he,className:"w-full h-9","data-testid":"button-clear-filters",children:[e.jsx(Y,{className:"w-4 h-4 mr-2"}),"Clear"]})})]}),he&&e.jsxs("div",{className:"flex flex-wrap gap-2 pt-2 border-t",children:[e.jsx("span",{className:"text-[10pt] sm:text-[12px] text-muted-foreground",children:"Active:"}),g!=="all"&&e.jsx(p,{variant:"secondary",className:"text-[10px] h-5",children:g}),w&&e.jsxs(p,{variant:"secondary",className:"text-[10px] h-5",children:["From: ",ke(new Date(`${w}T00:00:00`),"dd MMM yyyy")]}),y&&e.jsxs(p,{variant:"secondary",className:"text-[10px] h-5",children:["To: ",ke(new Date(`${y}T00:00:00`),"dd MMM yyyy")]})]})]})]})}),e.jsx(q,{children:W&&W.length>0?e.jsx("div",{className:"flex flex-col gap-2",children:W.map(t=>e.jsxs("div",{className:"border rounded-md","data-testid":`ticket-${t.id}`,children:[e.jsxs("button",{onClick:()=>J(d===t.id?null:t.id),className:"w-full px-3 py-2.5 flex items-center justify-between hover-elevate active-elevate-2 pt-[6px] pb-[6px] mt-[4px] mb-[4px]","data-testid":`button-toggle-ticket-${t.id}`,children:[e.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[ft(t.status),e.jsxs("div",{className:"text-left flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx("span",{className:"text-[10pt] sm:text-[14px] font-medium","data-testid":`text-ticket-subject-${t.id}`,children:t.subject}),e.jsx(p,{variant:Je(t.status),className:"text-[10px] px-1.5 py-0.5 h-5",children:t.status.toUpperCase()})]}),e.jsxs("div",{className:"text-[10pt] sm:text-[12px] text-muted-foreground mt-0.5 flex items-center gap-2 flex-wrap",children:[e.jsxs("span",{children:["#",t.id]}),e.jsx("span",{className:"text-muted-foreground/50",children:"·"}),e.jsx("span",{children:new Date(t.updatedDate).toLocaleString("en-GB",{day:"2-digit",month:"short",year:"numeric",hour:"2-digit",minute:"2-digit"})})]})]})]}),e.jsxs("div",{className:"flex items-center gap-2 ml-2 flex-shrink-0",children:[e.jsxs("div",{className:"hidden sm:flex flex-col gap-1 items-end",children:[e.jsx(p,{variant:Je(t.status),className:"text-[10px] h-5","data-testid":`badge-status-${t.id}`,children:t.status.toUpperCase()}),e.jsx(p,{variant:"outline",className:`text-[10px] h-5 ${Qt(t.priority)}`,children:t.priority.toUpperCase()})]}),e.jsx(Be,{className:`w-4 h-4 text-muted-foreground transition-transform ${d===t.id?"rotate-180":""}`})]})]}),d===t.id&&e.jsxs("div",{className:"border-t bg-muted/20",children:[e.jsx("div",{className:"px-3 py-2.5",children:lt?e.jsx("div",{className:"flex items-center justify-center py-4",children:e.jsx(T,{className:"w-5 h-5 animate-spin text-muted-foreground"})}):me&&me.length>0?e.jsx("div",{className:"flex flex-col gap-1 max-h-96 overflow-y-auto",children:me.map(i=>e.jsxs("div",{className:`text-[10pt] sm:text-[12px] p-2.5 rounded ${i.userType==="admin"?"bg-card border border-border":"bg-primary/10 border border-primary/20"}`,"data-testid":`message-${i.id}`,children:[e.jsxs("div",{className:"flex justify-between mb-1.5",children:[e.jsx("span",{className:"font-medium text-[10pt] sm:text-[13px]",children:i.userType==="admin"?i.userName:"You"}),e.jsx("span",{className:"text-muted-foreground text-[9pt] sm:text-[11px]",children:new Date(i.createdDate).toLocaleDateString("en-GB",{timeZone:"Europe/London",day:"2-digit",month:"short",hour:"2-digit",minute:"2-digit"})})]}),e.jsx("div",{className:"text-foreground text-[10pt] sm:text-[12px] message-content",dangerouslySetInnerHTML:{__html:Ht(i.message)}}),i.attachments&&i.attachments.length>0&&e.jsx("div",{className:"mt-2 flex flex-wrap gap-2",children:i.attachments.map((s,a)=>{var N,D;const l=((N=s.mime_type)==null?void 0:N.startsWith("image/"))||((D=s.filename)==null?void 0:D.match(/\.(jpg|jpeg|png|gif|webp)$/i)),u=s.url||s.path||s.file_url;return l&&u?e.jsx("a",{href:u,target:"_blank",rel:"noopener noreferrer",className:"block hover-elevate rounded overflow-visible border",children:e.jsx("img",{src:u,alt:s.filename||`Attachment ${a+1}`,className:"max-w-[200px] max-h-[150px] object-cover",onError:L=>{L.currentTarget.src="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNDAiIGhlaWdodD0iNDAiIHZpZXdCb3g9IjAgMCA0MCA0MCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cmVjdCB3aWR0aD0iNDAiIGhlaWdodD0iNDAiIGZpbGw9IiNGM0Y0RjYiLz48cGF0aCBkPSJNMTUgMTVIMjVWMjVIMTVWMTVaIiBmaWxsPSIjOUNBM0FGIi8+PC9zdmc+"}})},a):u?e.jsxs("a",{href:u,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1.5 text-[9pt] sm:text-[11px] px-2 py-1 bg-muted rounded hover-elevate",children:[e.jsx(U,{className:"w-3 h-3"}),e.jsx("span",{children:s.filename||`Attachment ${a+1}`})]},a):null})})]},i.id))}):e.jsxs("div",{className:"text-center py-4",children:[e.jsx(V,{className:"w-8 h-8 text-muted-foreground mx-auto mb-2"}),e.jsx("p",{className:"text-[10pt] sm:text-[12px] text-muted-foreground",children:"No messages yet"}),e.jsx("p",{className:"text-[9pt] sm:text-[11px] text-muted-foreground mt-1",children:"Start the conversation below"})]})}),e.jsxs("div",{className:"px-3 pb-3 pt-2 border-t",children:[e.jsxs("div",{className:"flex items-center gap-1 mb-2 pb-2 border-b flex-wrap",children:[e.jsx(m,{variant:"ghost",size:"icon",onClick:()=>n==null?void 0:n.chain().focus().toggleBold().run(),className:`h-8 w-8 ${n!=null&&n.isActive("bold")?"bg-muted":""}`,title:"Bold","data-testid":"button-format-bold",children:e.jsx(Et,{className:"w-3.5 h-3.5"})}),e.jsx(m,{variant:"ghost",size:"icon",onClick:()=>n==null?void 0:n.chain().focus().toggleItalic().run(),className:`h-8 w-8 ${n!=null&&n.isActive("italic")?"bg-muted":""}`,title:"Italic","data-testid":"button-format-italic",children:e.jsx(Ut,{className:"w-3.5 h-3.5"})}),e.jsx(m,{variant:"ghost",size:"icon",onClick:()=>n==null?void 0:n.chain().focus().toggleBulletList().run(),className:`h-8 w-8 ${n!=null&&n.isActive("bulletList")?"bg-muted":""}`,title:"Bullet List","data-testid":"button-format-list",children:e.jsx(We,{className:"w-3.5 h-3.5"})}),e.jsx("div",{className:"h-4 w-px bg-border mx-1"}),e.jsx(m,{variant:"ghost",size:"icon",onClick:()=>{var i;return(i=document.getElementById(`image-upload-${t.id}`))==null?void 0:i.click()},className:"h-8 w-8",title:"Attach Image",disabled:b.length>=3,"data-testid":"button-attach-image",children:e.jsx(U,{className:"w-3.5 h-3.5"})}),e.jsx("input",{id:`image-upload-${t.id}`,type:"file",accept:"image/*",multiple:!0,className:"hidden",onChange:ut}),e.jsx("span",{className:"text-[9pt] sm:text-[10px] text-muted-foreground ml-auto",children:b.length>0&&`${b.length}/3 images`})]}),b.length>0&&e.jsx("div",{className:"flex gap-2 mb-2 flex-wrap",children:b.map((i,s)=>e.jsxs("div",{className:"relative group",children:[e.jsx("img",{src:URL.createObjectURL(i),alt:i.name,className:"w-16 h-16 object-cover rounded border"}),e.jsx(m,{variant:"destructive",size:"icon",onClick:()=>pt(s),className:"absolute -top-2 -right-2 h-5 w-5 opacity-0 group-hover:opacity-100 transition-opacity",children:e.jsx(Y,{className:"w-3 h-3"})})]},s))}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("div",{className:"flex-1 border rounded-md overflow-hidden","data-testid":`editor-reply-${t.id}`,children:e.jsx(Gt,{editor:n,className:"min-h-[80px]"})}),e.jsx(m,{onClick:xt,disabled:ue.isPending||Ce,size:"icon",className:"flex-shrink-0","data-testid":`button-send-reply-${t.id}`,children:ue.isPending||Ce?e.jsx(T,{className:"w-4 h-4 animate-spin"}):e.jsx(je,{className:"w-4 h-4"})})]}),e.jsx("p",{className:"text-[9pt] sm:text-[10px] text-muted-foreground mt-1.5",children:"Press Ctrl+Enter to send"})]})]})]},t.id))}):e.jsxs("div",{className:"text-center py-8",children:[e.jsx(V,{className:"w-12 h-12 text-muted-foreground mx-auto mb-3"}),e.jsx("p",{className:"text-[10pt] sm:text-[14px] text-muted-foreground mb-1",children:g!=="all"?`No ${g} tickets found`:"No support tickets found"})]})})]})})]})]})})}function Je(c){const x=c.toLowerCase();return x==="open"||x==="new"?"destructive":x==="in progress"||x.includes("waiting")?"default":x==="closed"||x==="resolved"?"secondary":"outline"}function Qt(c){return{high:"border-red-500 text-red-500",medium:"border-yellow-500 text-yellow-500",normal:"border-yellow-500 text-yellow-500",low:"border-green-500 text-green-500"}[c.toLowerCase()]||"border-muted-foreground text-muted-foreground"}export{ms 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.