chordia-ui 3.5.5 → 3.5.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/UpdatedInteractionDetails.cjs.js +4 -4
- package/dist/components/UpdatedInteractionDetails.cjs.js.map +1 -1
- package/dist/components/UpdatedInteractionDetails.es.js +1109 -761
- package/dist/components/UpdatedInteractionDetails.es.js.map +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.es.js +14 -13
- package/package.json +1 -1
- package/src/components/UpdatedInteractionDetails/UpdatedGuidance.jsx +273 -0
- package/src/components/UpdatedInteractionDetails/UpdatedInteractionDetails.jsx +41 -2
- package/src/components/UpdatedInteractionDetails/UpdatedThreads.jsx +125 -86
- package/src/components/UpdatedInteractionDetails/index.js +1 -0
- package/src/components/index.js +1 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),p=require("react"),y=require("lucide-react"),it=require("../UpdatedInteractionRecording.cjs.js"),M={strong:"var(--Grey-Strong, #2E3236)",muted:"var(--Grey-Muted, #808183)",absent:"var(--Grey-absent, #D9D9D9)",accent:"var(--rail-orange, #C98A5A)",itemText:"var(--text-item, #3F3F3F)",quoteLine:"var(--border-warm, #B2AEA8)",quoteText:"var(--text-subtle-warm, #767473)",iconBg:"var(--surface-hover, #F3F7F7)"},Nt={effective:"Effective",strong:"Strong",needs_improvement:"Needs Improvement",mixed:"Mixed"},Ze="updated-coaching-synthesis-keyframes";function qt(){if(typeof document>"u"||document.getElementById(Ze))return;const t=document.createElement("style");t.id=Ze,t.textContent=`
|
|
2
2
|
@keyframes updated-coaching-shimmer {
|
|
3
3
|
0% { background-position: -200% 0; }
|
|
4
4
|
100% { background-position: 200% 0; }
|
|
@@ -7,11 +7,11 @@
|
|
|
7
7
|
0%, 100% { opacity: 0.4; }
|
|
8
8
|
50% { opacity: 1; }
|
|
9
9
|
}
|
|
10
|
-
`,document.head.appendChild(t)}function
|
|
10
|
+
`,document.head.appendChild(t)}function Kt({overall:t}){const n=Nt[t]||(t?t.replace(/_/g," "):"");return e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,flexShrink:0},children:[e.jsx("span",{style:{fontSize:13,fontWeight:400,color:M.strong,fontFamily:"var(--font-sans)",lineHeight:1.2},children:"Overall:"}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6},children:[e.jsx(y.ThumbsUp,{size:14,color:M.strong,strokeWidth:1.5}),e.jsx("span",{style:{fontSize:13,fontWeight:600,color:M.strong,fontFamily:"var(--font-sans)",lineHeight:1.2},children:n})]})]})}function Vt({item:t}){const n=typeof t=="string"?t:(t==null?void 0:t.text)||"",i=typeof t=="object"?t==null?void 0:t.quote:null;return e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:14},children:[e.jsx("div",{style:{fontSize:14,fontWeight:600,color:M.itemText,fontFamily:"var(--font-sans)",lineHeight:1.5},children:n}),i&&e.jsxs("div",{style:{display:"flex",gap:10},children:[e.jsx("div",{style:{width:1,flexShrink:0,alignSelf:"stretch",background:M.quoteLine}}),e.jsxs("div",{style:{fontSize:14,fontWeight:400,color:M.quoteText,fontFamily:"var(--font-sans)",lineHeight:1.5},children:["“",i,"”"]})]})]})}function Ue({icon:t,label:n,items:i}){return!i||i.length===0?null:e.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:16,borderRadius:12},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:16},children:[e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:24,height:24,borderRadius:9999,background:M.iconBg,flexShrink:0},children:t}),e.jsx("span",{style:{fontSize:16,fontWeight:600,color:M.strong,fontFamily:"var(--font-sans)",lineHeight:"normal"},children:n})]}),e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:24},children:i.map((r,s)=>e.jsx(Vt,{item:r},s))})]})}const st=({data:t,loading:n,error:i})=>{var f,m;if(p.useEffect(()=>{qt()},[]),n)return e.jsxs(e.Fragment,{children:[e.jsx("style",{children:`
|
|
11
11
|
@keyframes coaching-spinner-spin {
|
|
12
12
|
from { transform: rotate(0deg); }
|
|
13
13
|
to { transform: rotate(360deg); }
|
|
14
14
|
}
|
|
15
|
-
`}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:12,padding:"48px 24px"},children:[e.jsxs("svg",{width:48,height:48,viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{animation:"coaching-spinner-spin 1.2s linear infinite"},children:[e.jsx("path",{d:"M43 24C43 26.4951 42.5086 28.9658 41.5537 31.271C40.5989 33.5762 39.1993 35.6707 37.435 37.435C35.6707 39.1993 33.5762 40.5989 31.271 41.5537C28.9658 42.5086 26.4951 43 24 43C21.5049 43 19.0342 42.5086 16.729 41.5537C14.4238 40.5989 12.3293 39.1993 10.565 37.435C8.80066 35.6707 7.40113 33.5762 6.44629 31.271C5.49145 28.9658 5 26.4951 5 24",stroke:"#F3E7C7",strokeWidth:"4",strokeLinecap:"round"}),e.jsx("path",{d:"M12 24C12 22.4241 12.3104 20.8637 12.9134 19.4078C13.5165 17.9519 14.4004 16.629 15.5147 15.5147C16.629 14.4004 17.9519 13.5165 19.4078 12.9134C20.8637 12.3104 22.4241 12 24 12C25.5759 12 27.1363 12.3104 28.5922 12.9134C30.0481 13.5165 31.371 14.4004 32.4853 15.5147C33.5996 16.629 34.4835 17.9519 35.0866 19.4078C35.6896 20.8637 36 22.4241 36 24",stroke:"#00A66E",strokeWidth:"4",strokeLinecap:"round"}),e.jsx("path",{d:"M20 24C20 24.5253 20.1035 25.0454 20.3045 25.5307C20.5055 26.016 20.8001 26.457 21.1716 26.8284C21.543 27.1999 21.984 27.4945 22.4693 27.6955C22.9546 27.8965 23.4747 28 24 28C24.5253 28 25.0454 27.8965 25.5307 27.6955C26.016 27.4945 26.457 27.1999 26.8284 26.8284C27.1999 26.457 27.4945 26.016 27.6955 25.5307C27.8965 25.0454 28 24.5253 28 24",stroke:"#F3E7C7",strokeWidth:"4",strokeLinecap:"round"})]}),e.jsx("span",{style:{fontSize:14,color:M.muted,fontWeight:500,textAlign:"center"},children:"Synthesizing coaching summary..."})]})]});if(i)return e.jsx("div",{style:{fontSize:14,color:M.muted},children:"Unable to generate coaching summary."});if(!t)return null;const l=t.strengths||[],r=t.improvements||[],a=typeof t.one_liner=="string"?t.one_liner:((v=t.one_liner)==null?void 0:v.text)||"",u=typeof t.context=="string"?t.context:((m=t.context)==null?void 0:m.text)||"";return e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:16,background:"#FFF"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[e.jsx(x.ShieldCheck,{size:20,color:M.accent,strokeWidth:2}),e.jsx("span",{style:{fontSize:16,fontWeight:600,color:M.strong,fontFamily:"var(--font-sans)",lineHeight:1.2,textTransform:"uppercase"},children:"Coaching Summary"})]}),a&&e.jsx("div",{style:{fontSize:14,fontWeight:500,color:M.strong,fontFamily:"var(--font-sans)",lineHeight:1.5},children:a}),e.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:16,justifyContent:"space-between"},children:[u&&e.jsx("div",{style:{fontSize:14,fontWeight:400,color:M.muted,fontFamily:"var(--font-sans)",lineHeight:1.5,flex:1},children:u}),t.overall&&e.jsx($t,{overall:t.overall})]}),(l.length>0||r.length>0)&&e.jsxs("div",{style:{display:"flex",gap:24,paddingTop:24,borderTop:`1px solid ${M.absent}`},children:[e.jsx(Ne,{icon:e.jsx(x.TrendingUp,{size:14,color:M.strong,strokeWidth:1.5}),label:"Key Strengths",items:l}),e.jsx(Ne,{icon:e.jsx(x.Lightbulb,{size:14,color:M.strong,strokeWidth:1.5}),label:"Improvements",items:r})]})]})};function Nt(t){const n=Math.floor(t/60),i=Math.round(t%60);return`${n}:${i.toString().padStart(2,"0")}`}const qt={display:"flex",justifyContent:"space-between",padding:"8px 8px 12px 8px",alignItems:"center",gap:24,fontFamily:"var(--font-sans)",fontSize:13,fontWeight:400,lineHeight:"normal",borderBottom:"1px solid var(--Grey-absent, #D9D9D9)"},qe={display:"flex",flexDirection:"column",flex:"1 0 0",gap:0,minWidth:0},Ue=({meta:t={},callPurpose:n={},classification:i={},dimensions:l=[],outcomeQuality:r="Neutral",onMoreDetails:a,moreDetails:u=[],resolutionOutcome:v,customerIntent:m})=>{const[j,W]=f.useState(!1),k=t.duration_seconds!=null?Nt(t.duration_seconds):null,d=t.message_count,z=n.interaction_driver,b=i.interaction_paradigm,y=o=>l.find(B=>(B.key||"").toLowerCase().includes(o)),w=y("resolution_outcome"),E=y("customer_intent"),F=y("outcome_quality"),C=o=>o?o.replace(/_/g," ").replace(/\b\w/g,B=>B.toUpperCase()):null,_=r!=="Neutral"?r:F?C(F.value):r,H=v??(w?C(w.value):null),R=m??(E?C(E.value):null),h=new Set(["resolution_outcome","customer_intent","outcome_quality"].map(o=>`dim.${o}`)),g=l.filter(o=>!h.has(o.key)),s=[],G=[[k!=null?{label:"Duration",value:k}:null,d!=null?{label:"Messages",value:d}:null],[z!=null?{label:"Driver",value:z}:null,b!=null?{label:"Paradigm",value:b}:null]];for(let o=0;o<g.length;o+=2){const B=g[o]?{label:g[o].display_name||g[o].label||g[o].key,value:C(g[o].value)}:null,K=g[o+1]?{label:g[o+1].display_name||g[o+1].label||g[o+1].key,value:C(g[o+1].value)}:null;G.push([B,K])}G.push([{label:"Outcome Quality",value:_},{isMoreDetails:!0}]),G.forEach(o=>s.push(o));const L=[H!=null&&{label:"Resolution Outcome",value:H},R!=null&&{label:"Customer Intent",value:R},...u||[]].filter(Boolean),O=o=>e.jsxs("div",{style:qt,children:[e.jsx("span",{style:{color:"var(--Grey-Strong, #2E3236)",whiteSpace:"nowrap",flexShrink:0},children:o.label}),e.jsx("span",{style:{color:"var(--Grey-Muted, #808183)",textAlign:"right",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minWidth:0},children:o.value})]},o.label),q=()=>e.jsxs("div",{onClick:()=>{W(o=>!o),a&&!j&&a()},style:{display:"flex",alignItems:"center",gap:6,padding:"8px 8px 12px 8px",cursor:"pointer",fontFamily:"var(--font-sans)",borderBottom:"1px solid var(--Grey-absent, #D9D9D9)"},children:[e.jsx("span",{style:{color:"var(--Grey-Strong, #2E3236)",fontSize:13,fontWeight:500,lineHeight:"normal"},children:"More Details"}),j?e.jsx(x.ChevronUp,{size:16,color:"var(--Grey-Muted, #808183)",strokeWidth:1.5}):e.jsx(x.ChevronDown,{size:16,color:"var(--Grey-Muted, #808183)",strokeWidth:1.5})]},"more-details");return e.jsxs("div",{style:{display:"flex",flexDirection:"column",alignSelf:"stretch",gap:0,position:"relative",overflow:"visible"},children:[s.map((o,B)=>{var K;return e.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:24,alignSelf:"stretch"},children:[e.jsx("div",{style:qe,children:o[0]&&!o[0].isMoreDetails?O(o[0]):e.jsx("div",{style:{flex:1}})}),e.jsx("div",{style:qe,children:o[1]&&!o[1].isMoreDetails?O(o[1]):(K=o[1])!=null&&K.isMoreDetails?q():e.jsx("div",{style:{flex:1}})})]},B)}),j&&L.length>0&&e.jsxs("div",{style:{position:"absolute",top:"100%",right:0,marginTop:4,display:"flex",width:340,flexDirection:"column",alignItems:"flex-start",borderRadius:4,border:"1px solid var(--Grey-absent, #D9D9D9)",background:"var(--Grey-White, #FFF)",boxShadow:"-2px 2px 2px 0 rgba(0, 0, 0, 0.25)",overflow:"hidden",fontFamily:"var(--font-sans)",zIndex:50},children:[e.jsx("div",{style:{padding:"12px 16px",fontSize:13,fontWeight:600,color:"var(--Grey-Strong, #2E3236)",borderBottom:"1px solid var(--Grey-absent, #D9D9D9)",alignSelf:"stretch"},children:"More details"}),L.map(o=>e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"12px 16px",gap:24,fontSize:13,fontWeight:400,lineHeight:"normal",borderBottom:"1px solid var(--Grey-absent, #D9D9D9)",alignSelf:"stretch"},children:[e.jsx("span",{style:{color:"var(--Grey-Strong, #2E3236)",whiteSpace:"nowrap",flexShrink:0},children:o.label}),e.jsx("span",{style:{color:"var(--Grey-Muted, #808183)",fontSize:13,fontStyle:"normal",fontWeight:400,lineHeight:"120%",textAlign:"right"},children:o.value})]},o.label))]})]})},S={strong:"var(--Grey-Strong, #2E3236)",muted:"var(--Grey-Muted, #808183)",absent:"var(--Grey-absent, #D9D9D9)",white:"var(--Grey-White, #FFF)",cardBg:"var(--surface-warm-40, rgba(243, 241, 229, 0.40))"},T=1.2,Ke=3,Ve=t=>t!=null?Math.round(t*100)+"%":"—",Ye=t=>{if(t==null)return"—";const n=(t*100).toFixed(1);return t>0?`+${n}pp`:`${n}pp`},Xe=({outcomeLift:t,driverLabels:n=[]})=>{var d;if(!t||t.lift==null)return null;const i=t.p_expected,l=t.p_full,r=t.lift_raw??(l!=null&&i!=null?l-i:null),a=t.lift,u=(d=t.interpretation)!=null&&d.lift_band?t.interpretation.lift_band.replace(/_/g," "):a>=0?"Positive":"Negative",v=u.charAt(0).toUpperCase()+u.slice(1),j=/negative/i.test(u)?x.ThumbsDown:x.ThumbsUp,W=n.slice(0,Ke),k=n.length-Ke;return e.jsxs("div",{style:{display:"flex",flexDirection:"column",padding:24,gap:24,borderRadius:8,border:`1px solid ${S.absent}`,background:S.cardBg,alignSelf:"stretch"},children:[e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:32},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:24,alignSelf:"stretch"},children:[e.jsx("span",{style:{fontSize:15,fontWeight:600,color:S.strong,fontFamily:"var(--font-sans)",lineHeight:T},children:"Agent Lift Analysis"}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,fontFamily:"var(--font-sans)"},children:[e.jsx("span",{style:{fontSize:13,fontWeight:400,color:S.strong,lineHeight:T},children:"vs. Average Agent:"}),e.jsx("span",{style:{fontSize:14,fontWeight:600,color:S.strong,lineHeight:T},children:Ye(a)}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,paddingLeft:8,borderLeft:`1px solid ${S.absent}`},children:[e.jsx(j,{size:14,color:S.strong}),e.jsx("span",{style:{fontSize:13,fontWeight:600,color:S.strong,lineHeight:T},children:v})]})]})]}),e.jsxs("div",{style:{display:"flex",gap:24},children:[e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:16,alignItems:"flex-start",flex:1,minWidth:0},children:[e.jsx("span",{style:{fontSize:28,fontWeight:400,color:S.muted,fontFamily:"var(--font-sans)",lineHeight:T},children:Ve(i)}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8,alignItems:"flex-start",minHeight:48},children:[e.jsx("span",{style:{fontSize:13,fontWeight:400,color:S.strong,fontFamily:"var(--font-sans)",lineHeight:T,whiteSpace:"nowrap"},children:"Expected Outcome"}),e.jsx("span",{style:{fontSize:13,fontWeight:400,color:S.muted,fontFamily:"var(--font-sans)",lineHeight:T,textAlign:"left"},children:"Based on call type & difficulty"})]})]}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:16,alignItems:"flex-start",paddingLeft:24,borderLeft:`1px solid ${S.absent}`,flex:1,minWidth:0},children:[e.jsx("span",{style:{fontSize:28,fontWeight:400,color:S.muted,fontFamily:"var(--font-sans)",lineHeight:T},children:Ye(r)}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8,alignItems:"flex-start",minHeight:48},children:[e.jsx("span",{style:{fontSize:13,fontWeight:400,color:S.strong,fontFamily:"var(--font-sans)",lineHeight:T,whiteSpace:"nowrap"},children:"Agent Impact"}),e.jsx("span",{style:{fontSize:13,fontWeight:400,color:S.muted,fontFamily:"var(--font-sans)",lineHeight:T,textAlign:"left"},children:"Behavior-driven change"})]})]}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:16,alignItems:"flex-start",paddingLeft:24,borderLeft:`1px solid ${S.absent}`,flex:1,minWidth:0},children:[e.jsx("span",{style:{fontSize:28,fontWeight:400,color:S.strong,fontFamily:"var(--font-sans)",lineHeight:T},children:Ve(l)}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8,alignItems:"flex-start",minHeight:48},children:[e.jsx("span",{style:{fontSize:13,fontWeight:600,color:S.strong,fontFamily:"var(--font-sans)",lineHeight:T,whiteSpace:"nowrap"},children:"Predicted Outcome"}),e.jsx("span",{style:{fontSize:13,fontWeight:400,color:S.muted,fontFamily:"var(--font-sans)",lineHeight:T,textAlign:"left"},children:"With agent behaviors"})]})]})]})]}),n.length>0&&e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4,alignSelf:"stretch"},children:[e.jsx("span",{style:{fontSize:12,fontWeight:600,color:S.strong,fontFamily:"var(--font-sans)",lineHeight:T},children:"Key Drivers"}),e.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:4},children:[W.map((z,b)=>e.jsx("div",{style:{display:"flex",padding:8,alignItems:"center",justifyContent:"center",borderRadius:4,border:`1px solid ${S.absent}`,background:S.white},children:e.jsx("span",{style:{fontSize:12,fontWeight:400,color:S.strong,fontFamily:"var(--font-sans)",lineHeight:T,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:200},children:z})},b)),k>0&&e.jsx("div",{style:{display:"flex",padding:8,alignItems:"center",justifyContent:"center",borderRadius:4,border:`1px solid ${S.absent}`,background:S.white},children:e.jsxs("span",{style:{fontSize:12,fontWeight:400,color:S.strong,fontFamily:"var(--font-sans)",lineHeight:T,whiteSpace:"nowrap"},children:["+ ",k]})})]})]})]})},Ze=({children:t,size:n=28,onClick:i,title:l})=>{const[r,a]=f.useState(!1);return e.jsx("div",{title:l,onClick:i,onMouseEnter:()=>a(!0),onMouseLeave:()=>a(!1),style:{display:"flex",alignItems:"center",justifyContent:"center",width:n,height:n,borderRadius:9999,background:r?"var(--surface-hover, #F3F7F7)":"transparent",cursor:"pointer",flexShrink:0,transition:"background 0.15s"},children:t})},et=({signals:t={signals:[],present_count:0,total_signals_evaluated:0},expandedSignals:n=new Set,toggleSignal:i=()=>{},playEvidence:l=()=>{},highlightTurns:r=()=>{},onShowInTranscript:a=()=>{},timelinePlaying:u=!1,currentTimeSeconds:v=0})=>{const m=(t==null?void 0:t.signals)??[],j=(t==null?void 0:t.present_count)??m.length,W=d=>{const z=Math.floor(d/6e4),b=Math.floor(d%6e4/1e3);return`${z.toString().padStart(2,"0")}:${b.toString().padStart(2,"0")}`},k=d=>u&&d.start_ms!=null&&v*1e3>=d.start_ms&&v*1e3<=(d.end_ms??d.start_ms+5e3);return e.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"flex-start",alignSelf:"stretch",width:"100%",gap:16},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:16,width:"100%"},children:[e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:34,height:34,borderRadius:9999,background:"var(--surface-hover, #F3F7F7)",flexShrink:0},children:e.jsx(x.FileSignal,{size:20,color:"#2E3236",strokeWidth:1.5})}),e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",flex:1},children:[e.jsx("span",{style:{fontSize:15,fontWeight:500,color:"var(--Grey-Strong, #2E3236)"},children:"Signals"}),e.jsxs("span",{style:{fontSize:14,fontWeight:500,color:"var(--Grey-Strong, #2E3236)"},children:[j," Signals Detected"]})]})]}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",alignSelf:"stretch",background:"var(--Grey-White, #FFF)",gap:8},children:[m.length===0&&e.jsx("div",{style:{padding:"8px 0",fontSize:14,color:"var(--Grey-Muted, #808183)"},children:"No signals detected."}),m.map((d,z)=>{var E,F,C;const b=d.key??d.id??z,y=n.has(b),w=((E=d.observations)==null?void 0:E.length)??0;return e.jsxs("div",{id:`signal-${b}`,style:{display:"flex",flexDirection:"column",width:"100%",gap:8},children:[e.jsxs("button",{onClick:()=>i(b),style:{display:"flex",padding:"8px 0",alignItems:"center",gap:12,alignSelf:"stretch",width:"100%",background:"none",border:"none",borderBottom:"1px solid var(--Grey-absent, #D9D9D9)",cursor:"pointer"},children:[e.jsxs("span",{style:{flex:1,textAlign:"left",fontSize:14,fontWeight:600,color:"var(--text-dark, #0B0A0A)",lineHeight:1.71},children:[d.display_name||((F=d.key)==null?void 0:F.replace(/_/g," ")),w>0&&e.jsxs("span",{style:{fontWeight:600,color:"var(--text-dark, #0B0A0A)",marginLeft:6},children:["(",w,")"]})]}),y?e.jsx(x.ChevronUp,{size:20,color:"#767473"}):e.jsx(x.ChevronDown,{size:20,color:"#767473"})]}),y&&((C=d.observations)==null?void 0:C.length)>0&&e.jsx("div",{style:{display:"flex",flexDirection:"column",alignSelf:"stretch",gap:0},children:d.observations.map((_,H)=>{var R,h,g;return e.jsxs("div",{style:{display:"flex",flexDirection:"column",alignSelf:"stretch",gap:8},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12,padding:"8px 0",justifyContent:"space-between"},children:[e.jsx("span",{style:{flex:1,fontSize:14,fontWeight:400,color:"var(--text-subtle-warm, #767473)",lineHeight:1.5},children:_.reason||_.explanation}),((h=(R=_.evidence)==null?void 0:R[0])==null?void 0:h.start_ms)!=null&&e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,flexShrink:0},children:[e.jsx(Ze,{size:28,title:"Show in transcript",onClick:s=>{s.stopPropagation(),a(_.evidence[0].start_ms)},children:e.jsx(x.ScrollText,{size:16,color:"#808183",strokeWidth:1.5})}),e.jsx("span",{style:{fontSize:13,fontWeight:400,color:"var(--Grey-Muted, #808183)",lineHeight:1.2,whiteSpace:"nowrap"},children:W(_.evidence[0].start_ms)})]})]}),(g=_.evidence)==null?void 0:g.map((s,G)=>{const L=s.start_ms!=null&&s.end_ms!=null;return s.text&&e.jsxs("div",{onClick:O=>{O.stopPropagation(),L&&l(s)},onMouseEnter:()=>r(s.turn_ids??[]),onMouseLeave:()=>r([]),style:{display:"flex",alignItems:"center",gap:8,padding:"8px 0",cursor:L?"pointer":"default"},children:[L&&e.jsx(Ze,{size:28,children:k(s)?e.jsx(x.PauseCircle,{size:17,color:"var(--Grey-Muted, #808183)",strokeWidth:1.5}):e.jsx(x.PlayCircle,{size:17,color:"var(--Grey-Muted, #808183)",strokeWidth:1})}),e.jsxs("span",{style:{fontSize:13,fontWeight:400,color:"var(--Grey-Strong, #2E3236)",lineHeight:1.2},children:["“",s.text,"”"]})]},G)})]},_.key??H)})})]},b)})]})]})},A={strong:"var(--Grey-Strong, #2E3236)",muted:"var(--Grey-Muted, #808183)",absent:"var(--Grey-absent, #D9D9D9)",white:"var(--Grey-White, #FFF)",accent:"var(--rail-orange, #C98A5A)",track:"var(--rail-surface-2, #E3E1D7)",infoIcon:"var(--color-input-border, #ACACAD)"},Kt=({score:t=4,maxScore:n=10})=>{const j=Math.min(Math.round(t/n*5),5),W=180/5,k=b=>{const y=b*Math.PI/180;return{x:121.5+85*Math.cos(y),y:123-85*Math.sin(y)}},d=(b,y)=>{const w=k(b),E=k(y),F=b-y>180?1:0;return`M ${w.x} ${w.y} A 85 85 0 ${F} 1 ${E.x} ${E.y}`},z=2;return e.jsx("svg",{width:"100%",viewBox:"0 0 243 130",fill:"none",style:{maxWidth:243},children:Array.from({length:5},(b,y)=>{const w=180-y*W-(y>0?z/2:0),E=180-(y+1)*W+(y<5-1?z/2:0),F=y<j;return e.jsx("path",{d:d(w,E),stroke:F?A.strong:A.track,strokeWidth:30,strokeLinecap:"butt",fill:"none"},y)})})},Vt=({value:t=0,maxValue:n=5})=>e.jsx("div",{style:{display:"flex",gap:2},children:Array.from({length:n},(i,l)=>e.jsx("div",{style:{width:22,height:6,borderRadius:1,background:l<t?A.strong:A.track}},l))}),Yt={CSAT:"Predicted Customer Satisfaction",Resolution:"Predicted Resolution: was the issue fully resolved?","Process Adherence":"Process Adherence: Did the agent follow procedures?",Communication:"Predicted Communication Quality: Clarity, Empathy, Professionalism"},Zt=({text:t,children:n})=>{const[i,l]=f.useState(!1),r=f.useRef(null),[a,u]=f.useState({top:0,left:0}),v=()=>{if(r.current){const m=r.current.getBoundingClientRect();u({top:m.top-8,left:m.left+m.width/2})}l(!0)};return e.jsxs("div",{ref:r,style:{position:"relative",display:"inline-flex"},onMouseEnter:v,onMouseLeave:()=>l(!1),children:[n,i&&e.jsx("div",{style:{position:"fixed",top:a.top,left:a.left,transform:"translate(-50%, -100%)",display:"flex",width:"max-content",maxWidth:300,padding:10,alignItems:"center",borderRadius:4,border:"1px solid var(--Grey-absent, #D9D9D9)",background:"var(--Grey-Strong, #2E3236)",zIndex:9999,pointerEvents:"none"},children:e.jsx("span",{style:{color:"#FFF",fontSize:12,fontWeight:400,lineHeight:"140%"},children:t})})]})},Qt=({label:t,value:n=0,maxValue:i=5})=>e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8,padding:8,alignItems:"flex-start"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[e.jsx("span",{style:{fontSize:12,fontWeight:400,color:A.strong,fontFamily:"var(--font-sans)",lineHeight:"normal"},children:t}),e.jsx(Zt,{text:Yt[t]||t,children:e.jsx(x.Info,{size:14,color:A.infoIcon,strokeWidth:1,style:{cursor:"pointer"}})})]}),e.jsx(Vt,{value:n,maxValue:i})]}),tt=({score:t=83,maxScore:n=100,predictedScore:i=4,predictedLabel:l="Predicted Objective",description:r="",legends:a=[{label:"CSAT",value:3},{label:"Resolution",value:4},{label:"Process Adherence",value:5},{label:"Communication",value:3}]})=>(String(i).padStart(2,"0"),e.jsxs("div",{style:{display:"flex",flexDirection:"column",padding:24,borderRadius:8,border:`1px solid ${A.absent}`,background:A.white,alignSelf:"stretch",flex:1,gap:24},children:[e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[e.jsx("span",{style:{fontSize:15,fontWeight:600,color:A.strong,fontFamily:"var(--font-sans)",lineHeight:1.2},children:"Compass Score"}),e.jsx("span",{style:{fontSize:14,fontWeight:400,color:A.muted,fontFamily:"var(--font-sans)",lineHeight:"normal"},children:r})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",gap:24,flex:1,overflow:"hidden"},children:[e.jsxs("div",{style:{position:"relative",maxWidth:243,minWidth:160,flex:"0 1 243px",flexDirection:"column",alignItems:"center",display:"flex"},children:[e.jsx(Kt,{score:t,maxScore:n}),(()=>{const m=-(180-(n>0?Math.min(t/n,1):0)*180-45);return e.jsxs("svg",{width:"34",height:"35",viewBox:"0 0 34 35",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{marginTop:-24,transform:`rotate(${m}deg)`,transformOrigin:"center center"},children:[e.jsx("path",{d:"M16 25.2169C19.958 25.2169 23.1667 22.0083 23.1667 18.0503C23.1667 14.0922 19.958 10.8836 16 10.8836C12.042 10.8836 8.83334 14.0922 8.83334 18.0503C8.83334 22.0083 12.042 25.2169 16 25.2169Z",fill:"var(--rail-orange, #C98A5A)"}),e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M30.4791 11.2328L33.4351 0L21.6888 3.09113C19.9212 2.41855 18.0036 2.05025 16 2.05025C7.16344 2.05025 0 9.2137 0 18.0503C0 26.8868 7.16344 34.0503 16 34.0503C24.8366 34.0503 32 26.8868 32 18.0503C32 15.6119 31.4546 13.301 30.4791 11.2328ZM16 30.5503C22.9036 30.5503 28.5 24.9538 28.5 18.0503C28.5 11.1467 22.9036 5.55025 16 5.55025C9.09644 5.55025 3.5 11.1467 3.5 18.0503C3.5 24.9538 9.09644 30.5503 16 30.5503Z",fill:"var(--rail-orange, #C98A5A)"})]})})(),e.jsx("div",{style:{fontSize:28,fontWeight:400,color:A.strong,fontFamily:"var(--font-sans)",lineHeight:1,textAlign:"center",marginTop:8},children:t})]}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8,alignItems:"flex-start",justifyContent:"center",flex:1},children:[e.jsx("div",{style:{fontSize:15,fontWeight:500,color:A.strong,fontFamily:"var(--font-sans)",lineHeight:1.2,textAlign:"left"},children:"Interaction Quality Index"}),e.jsx("div",{style:{width:"100%",height:1,background:A.absent}}),a.map((u,v)=>e.jsx(Qt,{label:u.label,value:u.value},v))]})]})]})),Se=t=>{if(!t)return null;const n=String(t).toLowerCase();return n==="supervisor"?"var(--rail-compliance, #C98A5A)":n==="admin"||n==="administrator"?"var(--rail-discovery, #5E88B0)":n==="agent"?"var(--rail-outcome, #6B7C93)":null},de=t=>(t||"").split(" ").map(n=>n[0]).join("").toUpperCase()||"U",Jt=t=>{if(!t||t==="Just now")return!0;if(/^\d{4}-\d{2}-\d{2}T/.test(t))try{const i=/Z$|[+-]\d{2}:\d{2}$/.test(t)?t:t+"Z",l=new Date(i);return Number.isNaN(l.getTime())?!1:Date.now()-l.getTime()<15*60*1e3}catch{return!1}const n=t.match(/^(\d+)\s*min/);return n?parseInt(n[1],10)<15:!(/\d+\s*h/.test(t)||/\d+\s*day/.test(t))},Ut=t=>{if(!t)return"";if(!/^\d{4}-\d{2}-\d{2}T/.test(t))return t;try{const n=/Z$|[+-]\d{2}:\d{2}$/.test(t)?t:t+"Z",i=new Date(n);if(Number.isNaN(i.getTime()))return t;const r=new Date().getTime()-i.getTime(),a=Math.floor(r/6e4),u=Math.floor(r/36e5);if(a<1)return"Just now";if(a<60)return`${a} min`;if(u<24)return`${u} h`;const v=Math.floor(u/24);return v===1?"1 day":`${v} days`}catch{return t}},nt=({name:t,initials:n,color:i,avatar:l,size:r=36})=>l?e.jsx("img",{src:l,alt:t,style:{width:r,height:r,borderRadius:"50%",objectFit:"cover",flexShrink:0}}):e.jsx("div",{style:{width:r,height:r,borderRadius:"50%",background:i||"#6B7C93",color:"#FFF",display:"flex",alignItems:"center",justifyContent:"center",fontSize:r<=32?"10px":"11px",fontWeight:650,flexShrink:0,fontFamily:"var(--default-font-family)",letterSpacing:"0.02em"},title:t,children:n||de(t)}),Xt=({comment:t,isReply:n=!1,isConsecutive:i=!1,onReply:l,onSendReply:r,onEdit:a,onDelete:u,onMenuClick:v,showReply:m=!0})=>{var fe,ie;const[j,W]=f.useState(!1),[k,d]=f.useState(!1),[z,b]=f.useState(!1),[y,w]=f.useState(""),[E,F]=f.useState(!1),[C,_]=f.useState(""),[H,R]=f.useState(!1),h=f.useRef(null),g=f.useRef(null),s=t.author||{},G=s.name||t.author_name||"Unknown",L=s.initials||de(G),O=s.role||t.author_role,q=s.color||Se(O)||"#6B7C93",o=s.avatar||t.avatar,B=t.timestamp||t.created_at,K=Ut(B),V=Jt(B),ce=Array.isArray(t.content)?t.content:[t.content||t.text||""];return f.useEffect(()=>{if(!k)return;const c=J=>{h.current&&!h.current.contains(J.target)&&d(!1)};return document.addEventListener("mousedown",c),()=>document.removeEventListener("mousedown",c)},[k]),e.jsxs("div",{onMouseEnter:()=>W(!0),onMouseLeave:()=>W(!1),style:{display:"flex",paddingLeft:n?48:0,alignItems:"flex-start",gap:16,paddingTop:i?0:8,paddingBottom:8},children:[i?e.jsx("div",{style:{width:36,flexShrink:0}}):e.jsx(nt,{name:G,initials:L,color:q,avatar:o}),e.jsxs("div",{style:{flex:1,minWidth:0},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:i?"flex-end":"space-between",marginBottom:i?0:6},children:[!i&&e.jsxs("div",{style:{display:"flex",alignItems:"baseline",gap:8},children:[e.jsx("span",{style:{fontSize:13,fontWeight:650,color:"var(--text-ink, #1E2125)",lineHeight:"150%",fontFamily:"var(--default-font-family)"},children:G}),e.jsx("span",{style:{fontSize:12,fontWeight:400,color:"var(--Grey-Muted, #808183)",lineHeight:"150%",fontFamily:"var(--default-font-family)"},children:K}),(t.isEdited||t.is_edited)&&e.jsx("span",{style:{fontSize:12,fontWeight:400,color:"var(--Grey-Muted, #808183)",lineHeight:"150%",fontFamily:"var(--default-font-family)"},children:"(Edited)"})]}),e.jsxs("div",{style:{position:"relative"},ref:h,children:[e.jsx("button",{type:"button",onClick:()=>d(c=>!c),style:{padding:2,border:"none",background:"transparent",cursor:"pointer",borderRadius:4,display:"flex",alignItems:"center",justifyContent:"center",opacity:j||k?1:0,transition:"opacity 0.15s",flexShrink:0},children:e.jsx(x.Ellipsis,{size:24,color:"var(--Grey-Muted, #808183)"})}),k&&e.jsxs("div",{style:{position:"absolute",top:"100%",right:0,marginTop:4,display:"flex",width:99,flexDirection:"column",alignItems:"flex-start",borderRadius:4,border:"1px solid var(--Grey-absent, #D9D9D9)",background:"var(--Grey-White, #FFF)",boxShadow:"-2px 2px 2px 0 rgba(0, 0, 0, 0.25)",zIndex:50,overflow:"hidden"},children:[l&&e.jsx("button",{type:"button",onClick:()=>{d(!1),F(!1),b(!0)},style:{display:"flex",width:"100%",padding:"10px 16px",alignItems:"center",border:"none",background:"transparent",cursor:"pointer",fontSize:13,fontWeight:400,color:"var(--Grey-Strong, #2E3236)",fontFamily:"var(--default-font-family)",lineHeight:"150%",textAlign:"left"},onMouseEnter:c=>{c.currentTarget.style.background="var(--surface-hover, #F3F7F7)"},onMouseLeave:c=>{c.currentTarget.style.background="transparent"},children:"Reply"}),a&&e.jsx("button",{type:"button",disabled:!V,onClick:()=>{if(!V)return;d(!1);const c=Array.isArray(t.content)?t.content.join(`
|
|
16
|
-
`):t.content||t.text||"";_(c),F(!0),b(!1)},style:{display:"flex",width:"100%",padding:"10px 16px",alignItems:"center",border:"none",background:"transparent",cursor:V?"pointer":"not-allowed",fontSize:13,fontWeight:400,color:V?"var(--Grey-Strong, #2E3236)":"var(--Grey-Muted, #808183)",fontFamily:"var(--default-font-family)",lineHeight:"150%",textAlign:"left",opacity:V?1:.5},onMouseEnter:c=>{V&&(c.currentTarget.style.background="var(--surface-hover, #F3F7F7)")},onMouseLeave:c=>{c.currentTarget.style.background="transparent"},children:"Edit"}),u&&e.jsx("button",{type:"button",onClick:()=>{d(!1),R(!0)},style:{display:"flex",width:"100%",padding:"10px 16px",alignItems:"center",border:"none",background:"transparent",cursor:"pointer",fontSize:13,fontWeight:400,color:"var(--Grey-Strong, #2E3236)",fontFamily:"var(--default-font-family)",lineHeight:"150%",textAlign:"left"},onMouseEnter:c=>{c.currentTarget.style.background="var(--surface-hover, #F3F7F7)"},onMouseLeave:c=>{c.currentTarget.style.background="transparent"},children:"Delete"})]})]})]}),E?e.jsxs("div",{style:{display:"flex",width:662,maxWidth:"100%",padding:"8px 12px 12px 12px",flexDirection:"column",justifyContent:"center",alignItems:"flex-start",gap:24,borderRadius:8,border:"1px solid var(--Grey-absent, #D9D9D9)",background:"var(--Grey-White, #FFF)",boxSizing:"border-box",marginTop:4},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%"},children:[e.jsxs("span",{style:{fontSize:13,fontWeight:600,color:"var(--Grey-Muted, #808183)",fontFamily:"var(--default-font-family)",lineHeight:"normal"},children:["“"," ",((fe=t.author)==null?void 0:fe.name)||"Unknown"]}),e.jsx("button",{type:"button",onClick:()=>F(!1),style:{display:"flex",alignItems:"center",justifyContent:"center",background:"none",border:"none",cursor:"pointer",padding:0},children:e.jsx(x.X,{size:20,color:"var(--Grey-Muted, #808183)"})})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,width:"100%"},children:[e.jsx("input",{value:C,onChange:c=>_(c.target.value),onKeyDown:c=>{c.key==="Enter"&&!c.shiftKey&&(c.preventDefault(),C.trim()&&(a==null||a({...t,content:C.trim(),isEdited:!0}),F(!1))),c.key==="Escape"&&F(!1)},autoFocus:!0,style:{flex:1,padding:"10px 12px",fontSize:13,fontWeight:400,color:"var(--text-ink, #1E2125)",fontFamily:"var(--default-font-family)",lineHeight:"160%",border:"none",background:"transparent",outline:"none",boxSizing:"border-box"}}),e.jsx("button",{type:"button",onClick:()=>{C.trim()&&(a==null||a({...t,content:C.trim(),isEdited:!0}),F(!1))},disabled:!C.trim(),style:{display:"flex",padding:"6px 16px",justifyContent:"center",alignItems:"center",fontSize:13,fontWeight:600,color:C.trim()?"var(--Grey-White, #FFF)":"var(--Grey-Muted, #808183)",background:C.trim()?"var(--Grey-Strong, #2E3236)":"var(--grey-light, #e9e8e8a1)",border:"none",borderRadius:6,cursor:C.trim()?"pointer":"not-allowed",fontFamily:"var(--default-font-family)",flexShrink:0,transition:"all 0.15s",lineHeight:"150%"},children:"Save"})]})]}):e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:4,alignItems:"flex-start"},children:ce.map((c,J)=>e.jsx("div",{style:{fontSize:13,fontWeight:400,color:"var(--text-ink, #1E2125)",lineHeight:"160%",fontFamily:"var(--default-font-family)",padding:"8px 12px",background:n?"var(--surface-hover, #F3F7F7)":"var(--surface-warm-40, rgba(243, 241, 229, 0.40))",borderRadius:8,wordBreak:"break-word"},children:c},J))}),H&&e.jsxs("div",{style:{display:"inline-flex",alignItems:"center",gap:8,marginTop:8,fontSize:13,fontFamily:"var(--default-font-family)"},children:[e.jsx("span",{style:{color:"var(--Grey-Muted, #808183)",fontWeight:400},children:"Confirm: delete this comment?"}),e.jsx("button",{type:"button",onClick:()=>{R(!1),u==null||u(t)},style:{background:"var(--grey-light, #e9e8e8a1)",border:"none",cursor:"pointer",fontSize:13,fontWeight:600,color:"var(--text-ink, #1E2125)",fontFamily:"var(--default-font-family)",padding:"4px 10px",borderRadius:6,transition:"background 0.15s"},onMouseEnter:c=>{c.currentTarget.style.background="var(--Grey-absent, #D9D9D9)"},onMouseLeave:c=>{c.currentTarget.style.background="var(--grey-light, #e9e8e8a1)"},children:"Delete"}),e.jsx("button",{type:"button",onClick:()=>R(!1),style:{background:"none",border:"none",cursor:"pointer",fontSize:13,fontWeight:400,color:"var(--Grey-Muted, #808183)",fontFamily:"var(--default-font-family)",padding:"4px 10px",borderRadius:6,transition:"background 0.15s"},onMouseEnter:c=>{c.currentTarget.style.background="var(--grey-light, #e9e8e8a1)"},onMouseLeave:c=>{c.currentTarget.style.background="none"},children:"Cancel"})]}),m&&l&&!z&&!H&&e.jsxs("button",{type:"button",onClick:()=>{F(!1),b(!0)},style:{display:"flex",alignItems:"center",gap:6,marginTop:8,padding:0,border:"none",background:"transparent",cursor:"pointer",fontSize:13,fontWeight:400,color:"var(--Grey-Muted, #808183)",fontFamily:"var(--default-font-family)",transition:"color 0.15s"},children:[e.jsx(x.CornerDownRight,{size:20,color:"var(--Grey-Muted, #808183)",strokeWidth:1.5}),"Reply"]}),z&&e.jsxs("div",{style:{display:"flex",width:662,maxWidth:"100%",padding:"8px 12px 12px 12px",flexDirection:"column",justifyContent:"center",alignItems:"flex-start",gap:24,borderRadius:8,border:"1px solid var(--Grey-absent, #D9D9D9)",background:"var(--Grey-White, #FFF)",boxSizing:"border-box",marginTop:12},children:[e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8,width:"100%"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%"},children:[e.jsxs("span",{style:{fontSize:13,fontWeight:600,color:"var(--Grey-Muted, #808183)",fontFamily:"var(--default-font-family)",lineHeight:"normal"},children:["“"," ",((ie=t.author)==null?void 0:ie.name)||"Unknown"]}),e.jsx("button",{type:"button",onClick:()=>{w(""),b(!1)},style:{display:"flex",alignItems:"center",justifyContent:"center",background:"none",border:"none",cursor:"pointer",padding:0},children:e.jsx(x.X,{size:20,color:"var(--Grey-Muted, #808183)"})})]}),e.jsx("div",{style:{display:"flex",height:36,padding:16,alignItems:"center",gap:5,borderRadius:"0 8px 8px 8px",background:"var(--Grey-Strong, #2E3236)",boxSizing:"border-box",width:"100%"},children:e.jsx("span",{style:{color:"var(--Grey-White, #FFF)",fontSize:13,fontWeight:400,fontFamily:"var(--default-font-family)",lineHeight:"normal",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:Array.isArray(t.content)?t.content[0]:t.content})})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,width:"100%"},children:[e.jsx("input",{ref:g,value:y,onChange:c=>w(c.target.value),onKeyDown:c=>{c.key==="Enter"&&!c.shiftKey&&(c.preventDefault(),y.trim()&&(r==null||r({content:y.trim(),parentId:t.id}),w(""),b(!1))),c.key==="Escape"&&(w(""),b(!1))},autoFocus:!0,placeholder:"Add a reply",style:{flex:1,padding:"10px 12px",fontSize:13,fontWeight:400,color:"var(--text-ink, #1E2125)",fontFamily:"var(--default-font-family)",lineHeight:"160%",border:"none",background:"transparent",outline:"none",boxSizing:"border-box"}}),e.jsx("button",{type:"button",onClick:()=>{y.trim()&&(r==null||r({content:y.trim(),parentId:t.id}),w(""),b(!1))},disabled:!y.trim(),style:{display:"flex",height:28,padding:"8px 12px",justifyContent:"center",alignItems:"center",gap:8,fontSize:13,fontWeight:600,color:y.trim()?"var(--Grey-White, #FFF)":"var(--Grey-Muted, #808183)",background:y.trim()?"var(--Neutral-850, #272727)":"var(--grey-light, #e9e8e8a1)",border:"none",borderRadius:10,cursor:y.trim()?"pointer":"not-allowed",fontFamily:"var(--default-font-family)",lineHeight:"150%"},children:"Post"})]})]})]})]})},en=({currentUser:t,onSubmit:n})=>{const[i,l]=f.useState(""),[r,a]=f.useState(!1),u=f.useRef(null),v=()=>{const d=i.trim();d&&(n==null||n(d),l(""))},m=d=>{d.key==="Enter"&&!d.shiftKey&&(d.preventDefault(),v())},j=(t==null?void 0:t.initials)||de(t==null?void 0:t.name),W=(t==null?void 0:t.color)||Se(t==null?void 0:t.role)||"#6B7C93",k=t==null?void 0:t.avatar;return e.jsxs("div",{style:{display:"flex",gap:16,alignItems:"flex-start"},children:[e.jsx(nt,{name:t==null?void 0:t.name,initials:j,color:W,avatar:k}),e.jsx("div",{style:{flex:1,padding:12,display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"flex-start",gap:24,borderRadius:8,border:r?"1px solid var(--Grey-Strong, #2E3236)":"1px solid var(--Grey-absent, #D9D9D9)",background:"var(--Grey-White, #FFF)",transition:"border-color 0.15s"},children:e.jsxs("div",{style:{display:"flex",alignItems:"flex-end",gap:8,width:"100%"},children:[e.jsx("textarea",{ref:u,value:i,onChange:d=>l(d.target.value),onFocus:()=>a(!0),onBlur:()=>a(!1),onKeyDown:m,placeholder:"Add feedback",rows:1,style:{flex:1,border:"none",outline:"none",resize:"none",fontSize:13,fontWeight:400,color:"var(--text-ink, #1E2125)",fontFamily:"var(--default-font-family)",lineHeight:"160%",background:"transparent",padding:0,minHeight:24}}),e.jsx("button",{type:"button",onClick:v,disabled:!i.trim(),style:{display:"flex",padding:"6px 16px",justifyContent:"center",alignItems:"center",fontSize:13,fontWeight:600,color:i.trim()?"var(--Grey-White, #FFF)":"var(--Grey-Muted, #808183)",background:i.trim()?"var(--Grey-Strong, #2E3236)":"var(--grey-light, #e9e8e8a1)",border:"none",borderRadius:6,cursor:i.trim()?"pointer":"not-allowed",fontFamily:"var(--default-font-family)",transition:"all 0.15s",flexShrink:0,lineHeight:"150%"},children:"Post"})]})})]})},it=({comment:t,depth:n=0,isConsecutive:i=!1,onReply:l,onSendReply:r,onEdit:a,onDelete:u,onMenuClick:v})=>{const m=t.replies&&t.replies.length>0,j=!m;return e.jsxs(f.Fragment,{children:[e.jsx("div",{style:{paddingLeft:n>0?Math.min(n*32,128):0},children:e.jsx(Xt,{comment:t,isReply:n>0,isConsecutive:i,onReply:l,onSendReply:r,onEdit:a,onDelete:u,onMenuClick:v,showReply:j})}),m&&t.replies.map(W=>e.jsx(it,{comment:W,depth:n+1,onReply:l,onSendReply:r,onEdit:a,onDelete:u,onMenuClick:v},W.id))]})},st=({comments:t=[],totalComments:n,onSendComment:i,onReply:l,onSendReply:r,onEdit:a,onDelete:u,onMenuClick:v,onMarkResolved:m,currentUser:j,isResolved:W=!1})=>{const[k,d]=f.useState([]),[z,b]=f.useState(!1),y=f.useMemo(()=>{const h=new Set(t.map(s=>s.id)),g=k.filter(s=>!h.has(s.id));return[...t,...g]},[t,k]);f.useEffect(()=>{const h=new Set(t.map(g=>g.id));d(g=>g.filter(s=>!h.has(s.id)))},[t]);const w=f.useMemo(()=>{if(!j)return{name:"You",initials:"YO",color:"#6B7C93"};const h=j.name||"You",g=j.initials||de(h),s=j.role&&String(j.role).toLowerCase(),G=j.color||Se(s)||"#6B7C93";return{...j,name:h,initials:g,color:G}},[j]),E=async({content:h,parentId:g})=>{if(r){b(!0);try{await r({content:h,parentId:g})}finally{b(!1)}}else{const s={id:`temp-${Date.now()}`,author:w,content:h,timestamp:"Just now",parentId:g,isOptimistic:!0};d(G=>[...G,s])}},F=async h=>{if(i){b(!0);try{await i(h)}finally{b(!1)}}else{const g={id:`temp-${Date.now()}`,author:w,content:h,timestamp:"Just now",isOptimistic:!0};d(s=>[...s,g])}},C=h=>{d(g=>g.map(s=>s.id===h.id?{...s,content:h.content,isEdited:!0}:s)),a==null||a(h)},_=h=>{d(g=>g.filter(s=>s.id!==h.id)),u==null||u(h)},H=f.useMemo(()=>{const h={};y.forEach(s=>{s.parentId&&(h[s.parentId]||(h[s.parentId]=[]),h[s.parentId].push(s))});const g=s=>({...s,replies:(h[s.id]||[]).map(g)});return y.filter(s=>!s.parentId).map(g)},[y]),R=n??y.length;return e.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"flex-start",background:"var(--Grey-White, #FFF)",width:"100%",fontFamily:"var(--default-font-family)"},children:[e.jsxs("div",{style:{display:"flex",height:40,paddingBottom:8,alignItems:"center",gap:16,alignSelf:"stretch",borderBottom:"1px solid var(--Grey-absent, #D9D9D9)",justifyContent:"space-between"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[e.jsx(x.MessagesSquare,{size:24,color:"var(--rail-orange, #C98A5A)",strokeWidth:1.5}),e.jsxs("span",{style:{fontSize:14,fontWeight:650,color:"var(--Grey-Strong, #2E3236)",letterSpacing:"0.08em",textTransform:"uppercase",lineHeight:"150%"},children:["FEEDBACK",R>0?` (${R<10?"0":""}${R})`:""]})]}),W?e.jsxs("div",{style:{display:"inline-flex",height:32,padding:"12px 16px 12px 12px",justifyContent:"flex-end",alignItems:"center",gap:8,borderRadius:10,background:"var(--Rail-Surface-2, #E3E1D7)",flexShrink:0},children:[e.jsx(x.Check,{size:16,color:"var(--Grey-Strong, #2E3236)",strokeWidth:2}),e.jsx("span",{style:{fontSize:13,fontWeight:500,color:"var(--Grey-Strong, #2E3236)",fontFamily:"var(--default-font-family)",lineHeight:"150%"},children:"Resolved"})]}):m?e.jsxs("button",{type:"button",onClick:m,style:{display:"flex",alignItems:"center",gap:8,padding:"8px 16px",fontSize:13,fontWeight:500,color:"var(--Grey-Strong, #2E3236)",background:"var(--Grey-White, #FFF)",border:"1px solid var(--Grey-absent, #D9D9D9)",borderRadius:20,cursor:"pointer",fontFamily:"var(--default-font-family)",transition:"background 0.15s",lineHeight:"150%",flexShrink:0},children:[e.jsx(x.CircleCheck,{size:16,color:"var(--Grey-Strong, #2E3236)",strokeWidth:1.5}),"Mark as Resolved"]}):null]}),e.jsx("div",{style:{display:"flex",paddingTop:24,flexDirection:"column",alignItems:"flex-start",gap:10,alignSelf:"stretch",borderTop:"1px solid var(--Grey-absent, #D9D9D9)"},children:e.jsxs("div",{style:{width:662,maxWidth:"100%"},children:[y.length>0&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:0,marginBottom:24,maxHeight:600,overflowY:y.length>6?"auto":"visible"},children:H.map((h,g)=>{var q,o;const s=g>0?H[g-1]:null,G=((q=s==null?void 0:s.author)==null?void 0:q.name)||(s==null?void 0:s.author_name),L=((o=h.author)==null?void 0:o.name)||h.author_name,O=s&&G===L&&(!s.replies||s.replies.length===0);return e.jsx(it,{comment:h,depth:0,isConsecutive:!!O,onReply:l,onSendReply:E,onEdit:C,onDelete:_,onMenuClick:v},h.id)})}),y.length>0&&e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,marginBottom:16,marginLeft:48},children:[e.jsx(x.Info,{size:16,color:"var(--Grey-Muted, #808183)"}),e.jsx("span",{style:{color:"var(--Grey-Muted, #808183)",fontSize:13,fontStyle:"normal",fontWeight:400,lineHeight:"normal"},children:"Comments can be edited within 15 minutes."})]}),z&&e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"8px 0"},children:[e.jsx("div",{style:{width:16,height:16,border:"2px solid var(--Grey-absent, #D9D9D9)",borderTopColor:"var(--Grey-Strong, #2E3236)",borderRadius:"50%",animation:"spin 0.8s linear infinite"}}),e.jsx("span",{style:{fontSize:13,color:"var(--Grey-Muted, #808183)",fontFamily:"var(--default-font-family)"},children:"Sending..."}),e.jsx("style",{children:"@keyframes spin { to { transform: rotate(360deg); } }"})]}),e.jsx(en,{currentUser:w,onSubmit:F})]})})]})},ne=({text:t,children:n})=>{const[i,l]=f.useState(!1),r=f.useRef(null),[a,u]=f.useState({top:0,left:0});if(!t)return n;const v=()=>{if(r.current){const m=r.current.getBoundingClientRect();u({top:m.top-2,left:m.left+m.width/2})}l(!0)};return e.jsxs("div",{ref:r,style:{position:"relative",display:"inline-flex"},onMouseEnter:v,onMouseLeave:()=>l(!1),children:[n,i&&e.jsx("div",{style:{position:"fixed",top:a.top,left:a.left,transform:"translate(-50%, -100%)",display:"flex",padding:10,alignItems:"center",borderRadius:4,border:"1px solid var(--Grey-absent, #D9D9D9)",background:"var(--Grey-Strong, #2E3236)",zIndex:9999,pointerEvents:"none",whiteSpace:"nowrap"},children:e.jsx("span",{style:{color:"#FFF",fontSize:12,fontWeight:400,lineHeight:"normal"},children:t})})]})},tn=[{key:"overview",label:"Overview"},{key:"coaching",label:"Coaching Summary"},{key:"signals",label:"Signals & Recording"},{key:"comments",label:"Feedback"}],nn=({title:t="Wheel Stud Replacement Enquiry",onBack:n,data:i,coachingData:l,coachingLoading:r=!1,audioUrl:a,audioRef:u,currentTimeSeconds:v,timelinePlaying:m,playbackRate:j,timelineSegments:W,onSeek:k,onTogglePlay:d,onSeekBack:z,onSeekForward:b,onSetPlaybackRate:y,agentName:w,agentFullName:E,customerName:F,customerFullName:C,transcript:_,activeTurnIndex:H,turnObservations:R,highlightedTurns:h,onTurnPlayPause:g,onPlayEvidence:s,onHighlightTurns:G,callPurpose:L,classification:O,outcomeQuality:q,resolutionOutcome:o,customerIntent:B,interactionId:K,moreDetails:V,compassScore:ce,compassMaxScore:fe=10,predictedCsat:ie,predictedLabel:c="Predicted Objective",compassLegends:J,customerSessions:rt,customerSessionCount:ot,onSessionClick:ke,onViewAllSessions:we,prevSessionDesc:lt,prevSessionDisabled:se=!1,nextSessionDesc:at,nextSessionDisabled:re=!1,onPreviousSession:Ce,onNextSession:Fe,comments:De=[],currentUser:dt,onSendComment:ct,onSendReply:ft,onReply:pt,onEdit:gt,onDelete:ht,onMenuClick:ut,onMarkResolved:yt,commentsResolved:xt})=>{var Be,Pe;const[pe,Ie]=f.useState("overview"),[mt,We]=f.useState(new Set),[ze,ge]=f.useState(!1),[Ge,Me]=f.useState(null),[vt,Ee]=f.useState(!1),[bt,jt]=f.useState(0),U=f.useRef(null),he=f.useRef(null),ue=f.useRef(null),ye=f.useRef(null),xe=f.useRef(null),St={overview:he,coaching:ue,signals:ye,comments:xe},me=f.useRef(null),ve=f.useRef(!1);f.useEffect(()=>{const p=me.current;if(!p)return;const D=["overview","coaching","signals","comments"],I=[he,ue,ye,xe],P=(Q=>{let N=Q.parentElement;for(;N;){const{overflow:ae,overflowY:$e}=window.getComputedStyle(N);if(/(auto|scroll)/.test(ae+$e))return N;N=N.parentElement}return null})(p),Z=()=>{if(ve.current)return;let Q=D[0];for(let N=I.length-1;N>=0;N--){const ae=I[N].current;if(!ae)continue;if(ae.getBoundingClientRect().top<=150){Q=D[N];break}}Ie(Q)};return p.addEventListener("scroll",Z,{passive:!0}),P&&P!==p&&P.addEventListener("scroll",Z,{passive:!0}),window.addEventListener("scroll",Z,{passive:!0,capture:!0}),()=>{p.removeEventListener("scroll",Z),P&&P!==p&&P.removeEventListener("scroll",Z),window.removeEventListener("scroll",Z,{capture:!0})}},[]);const _e=f.useRef(null),kt=p=>{var I;Ie(p),ve.current=!0,_e.current=p;const D=(I=St[p])==null?void 0:I.current;if(D){const Y=me.current;if(Y&&Y.scrollHeight>Y.clientHeight){const P=Y.getBoundingClientRect().top,Q=D.getBoundingClientRect().top-P+Y.scrollTop-16;Y.scrollTo({top:Q,behavior:"smooth"})}else{const P=D.getBoundingClientRect().top+window.scrollY-120;window.scrollTo({top:P,behavior:"smooth"})}}setTimeout(()=>{ve.current=!1,_e.current=null},1200)},Te=rt||[],wt=p=>{var I;const D=p/1e3;(I=U.current)!=null&&I.scrollToTranscript&&U.current.scrollToTranscript(D)},Ct=p=>{var D;if(s)s(p);else{const I=p.start_ms??p.startMs;if(I!=null&&((D=U.current)!=null&&D.seekTo)){U.current.seekTo(I/1e3),Ee(!0),jt(I/1e3);const P=(p.end_ms??p.endMs??I+5e3)-I;setTimeout(()=>Ee(!1),P)}}},Ft=p=>{G&&G(p)},Dt=p=>{We(D=>{const I=new Set(D);return I.has(p)?I.delete(p):I.add(p),I})},It=(i==null?void 0:i.blocks)||[],X=p=>{var D;return((D=It.find(I=>I.block_id===p))==null?void 0:D.payload)||{}},$=X("interaction-metadata"),ee=X("interaction-context"),oe=X("interaction-signals"),Re=X("interaction-outcome-lift"),Wt=X("interaction-dimensions").dimensions||[],zt=ee.call_purpose||{},Gt=ee.classification||{},Ae={duration_seconds:156,message_count:25,...$},He={interaction_driver:"General Information",interaction_direction:"inbound",...zt},Mt={interaction_paradigm:"Informational",...Gt},Et={p_expected:.94,p_full:.83,lift_raw:-.11,lift:.043,interpretation:{lift_band:"positive"},...Re},_t=((Be=Re.driver_signal_keys)==null?void 0:Be.map(p=>p.replace(/^sig\./,"").replace(/_/g," ")))||["customer needs fully addressed","call flow expectations set","Opening expectations set","Active listening demonstrated","Resolution confirmed"],Tt=l||{one_liner:"David provided the customer with information on wheel stud replacement and pricing, but did not secure an appointment.",context:"The customer was seeking information on wheel stud replacement for a 2013 Chevy Bolt and was unsure about doing the repair themselves.",strengths:[{text:"Anthony effectively scheduled the appointment and confirmed the details clearly.",quote:"Alright. That is all set up for Saturday, the twenty eighth, at 12:00."},{text:"Handled customer objections well by explaining the need for a separate appointment for alignment.",quote:"I don't have the alignment changeover the weekend. So I would have to set up a separate appointment for the alignment."},{text:"Demonstrated courtesy and professionalism throughout the call.",quote:"Have a great day."}],improvements:[{text:"Close the loop by restating the plan and confirming next steps to ensure customer certainty.",quote:"Alright. That is all set up for Saturday, the twenty eighth, at 12:00."},{text:"Frame solutions positively by leading with what can be done rather than limitations.",quote:"I don't have the alignment changeover the weekend."}],overall:"effective"},Rt=(Pe=oe==null?void 0:oe.signals)!=null&&Pe.length?oe:{present_count:9,total_signals_evaluated:146,signals:[{key:"price_estimate_provided",display_name:"Price Estimate Provided",observations:[{key:"obs1",reason:"Evidence shows a price estimate or quote was provided.",evidence:[{start_ms:92e3,end_ms:97e3,text:"From Casper, you're probably looking at, like, a half hour labor plus a stud, so you'd probably be somewhere around $90 or something.",turn_ids:[8]}]}]},{key:"fee_or_cost_discussed",display_name:"Fee or Cost Discussed",observations:[{key:"obs2",reason:"Agent discussed pricing details with the customer."}]},{key:"engagement_budget",display_name:"Engagement Budget Discussed",observations:[{key:"obs3a",reason:"Budget expectations were set."},{key:"obs3b",reason:"Customer confirmed budget range."}]},{key:"projected_revenue",display_name:"Projected Revenue Discussed",observations:[{key:"obs4a",reason:"Revenue projection shared."},{key:"obs4b",reason:"Timeline for revenue discussed."},{key:"obs4c",reason:"Quarterly targets mentioned."}]},{key:"market_analysis",display_name:"Market Analysis Completed",observations:[{key:"obs5a",reason:"Market analysis referenced."},{key:"obs5b",reason:"Competitive landscape discussed."},{key:"obs5c",reason:"Market trends mentioned."},{key:"obs5d",reason:"Regional analysis provided."}]},{key:"target_audience",display_name:"Target Audience Defined",observations:[{key:"obs6a",reason:"Target audience identified."},{key:"obs6b",reason:"Demographics discussed."},{key:"obs6c",reason:"Audience segmentation reviewed."},{key:"obs6d",reason:"Persona mapping completed."},{key:"obs6e",reason:"Channel preferences noted."}]},{key:"concept_approval",display_name:"Concept Approval Received",observations:[{key:"obs7a",reason:"Concept approved by stakeholder."},{key:"obs7b",reason:"Feedback incorporated."},{key:"obs7c",reason:"Sign-off confirmed."},{key:"obs7d",reason:"Revisions requested."},{key:"obs7e",reason:"Final version accepted."},{key:"obs7f",reason:"Timeline approved."}]},{key:"prototype_developed",display_name:"Prototype Developed",observations:[{key:"obs8a",reason:"Prototype shared."},{key:"obs8b",reason:"Testing initiated."},{key:"obs8c",reason:"Feedback collected."},{key:"obs8d",reason:"Iterations completed."},{key:"obs8e",reason:"Usability tested."},{key:"obs8f",reason:"Design finalized."},{key:"obs8g",reason:"Stakeholder demo done."}]},{key:"user_testing",display_name:"User Testing Scheduled",observations:[{key:"obs9a",reason:"Testing sessions planned."},{key:"obs9b",reason:"Participants recruited."},{key:"obs9c",reason:"Test scripts prepared."},{key:"obs9d",reason:"Environment set up."},{key:"obs9e",reason:"Accessibility testing included."},{key:"obs9f",reason:"Results framework defined."},{key:"obs9g",reason:"Timeline confirmed."},{key:"obs9h",reason:"Backup plan discussed."}]}]},be=w||$.agent_name||$.agent||ee.agent_name||"Agent",At=E||$.agent_full_name||$.agent_name||be,te=F||$.customer_name||$.customer||ee.customer_name||"Customer",Le=C||$.customer_full_name||$.customer_name||te,je=ot??Te.length,le=$.created_dt||(i==null?void 0:i.created_dt)||ee.created_dt||"",Ht=le?new Date(/Z$|[+-]\d{2}:\d{2}$/.test(le)?le:le+"Z").toLocaleString():"",Lt=He.interaction_direction==="inbound"?"Inbound":"Outbound";return e.jsxs("div",{style:{display:"flex",flexDirection:"column",width:"100%",height:"100%",background:"var(--Grey-White, #FFF)"},children:[e.jsxs("div",{style:{position:"sticky",top:0,zIndex:20,background:"var(--Grey-White, #FFF)"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12,padding:"24px 24px 0"},children:[e.jsx("button",{onClick:n,style:{display:"flex",alignItems:"center",justifyContent:"center",background:"none",border:"none",cursor:"pointer",padding:0,flexShrink:0},children:e.jsx(x.ArrowLeft,{size:24,color:"var(--Grey-Strong, #2E3236)"})}),e.jsx("div",{style:{width:1,height:28,background:"var(--Base-absent, #D9D9D9)"}}),e.jsx("h1",{style:{color:"var(--Grey-Strong, #2E3236)",fontSize:24,fontStyle:"normal",fontWeight:400,lineHeight:"normal",margin:0,flex:1},children:t}),(Ce||Fe)&&e.jsxs("div",{style:{display:"flex",alignItems:"center",flexShrink:0},children:[e.jsx(ne,{text:lt,children:e.jsxs("button",{onClick:se?void 0:Ce,disabled:se,style:{display:"flex",alignItems:"center",gap:6,padding:"4px 12px",background:"none",border:"none",cursor:se?"default":"pointer",opacity:se?.4:1},children:[e.jsx(x.ArrowLeft,{size:16,color:"var(--Neutral-800, #323232)",strokeWidth:1.5}),e.jsx("span",{style:{color:"var(--Neutral-800, #323232)",fontSize:13,fontWeight:400,lineHeight:"24px",fontFamily:"var(--default-font-family)",whiteSpace:"nowrap"},children:"Previous Session"})]})}),e.jsx("div",{style:{width:1,height:20,background:"var(--Grey-absent, #D9D9D9)",flexShrink:0}}),e.jsx(ne,{text:at,children:e.jsxs("button",{onClick:re?void 0:Fe,disabled:re,style:{display:"flex",alignItems:"center",gap:6,padding:"4px 12px",background:"none",border:"none",cursor:re?"default":"pointer",opacity:re?.4:1},children:[e.jsx("span",{style:{color:"var(--Neutral-800, #323232)",fontSize:13,fontWeight:400,lineHeight:"24px",fontFamily:"var(--default-font-family)",whiteSpace:"nowrap"},children:"Next Session"}),e.jsx(x.ArrowRight,{size:16,color:"var(--Neutral-800, #323232)",strokeWidth:1.5})]})})]})]}),e.jsx("div",{style:{display:"flex",alignItems:"flex-start",background:"var(--Grey-White, #FFF)",borderBottom:"1px solid var(--Grey-Faint, #ACADAD)",padding:"0 24px",marginTop:8},children:tn.map(p=>e.jsx("button",{onClick:()=>kt(p.key),style:{display:"flex",padding:16,alignItems:"center",gap:10,background:"none",border:"none",borderBottom:pe===p.key?"3px solid var(--Grey-Strong, #2E3236)":"3px solid transparent",cursor:"pointer",fontSize:15,fontWeight:pe===p.key?500:400,color:pe===p.key?"var(--Grey-Strong, #2E3236)":"var(--Grey-Muted, #808183)",whiteSpace:"nowrap",transition:"border-color 0.2s ease, color 0.2s ease"},children:p.label},p.key))})]}),e.jsxs("div",{ref:me,style:{padding:24,flex:1,overflowY:"auto"},children:[e.jsxs("div",{ref:he,style:{display:"flex",flexDirection:"column",justifyContent:"flex-end",alignItems:"flex-start",gap:24,alignSelf:"stretch"},children:[e.jsxs("div",{style:{display:"flex",height:40,alignItems:"center",gap:16,alignSelf:"stretch"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,flex:1},children:[e.jsx(x.ClipboardList,{size:24,color:"var(--rail-orange, #C98A5A)",strokeWidth:2}),e.jsx("span",{style:{fontSize:16,fontWeight:600,color:"var(--Grey-Strong, #2E3236)",lineHeight:1.2,textTransform:"uppercase"},children:"Overview"})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:16,flexShrink:0},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,padding:"8px 0"},children:[e.jsx(x.CalendarDays,{size:16,color:"var(--Grey-Muted, #808183)",strokeWidth:1.5}),e.jsx("span",{style:{fontSize:13,fontWeight:400,color:"var(--Grey-Strong, #2E3236)",fontFamily:"var(--font-sans)",lineHeight:1.2},children:Ht})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,padding:"8px 0"},children:[e.jsx(x.PhoneIncoming,{size:16,color:"var(--Grey-Muted, #808183)",strokeWidth:1.5}),e.jsx("span",{style:{fontSize:13,fontWeight:400,color:"var(--Grey-Strong, #2E3236)",fontFamily:"var(--font-sans)",lineHeight:1.2},children:Lt})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:16,paddingLeft:16,borderLeft:"1px solid var(--Grey-absent, #D9D9D9)"},children:[e.jsx(ne,{text:At,children:e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,padding:"8px 0",cursor:"pointer"},children:[e.jsx(x.Headset,{size:16,color:"var(--Grey-Muted, #808183)",strokeWidth:1.5}),e.jsx("span",{style:{fontSize:13,fontWeight:400,color:"var(--Grey-Strong, #2E3236)",fontFamily:"var(--font-sans)",lineHeight:1.2},children:be})]})}),e.jsx(x.Repeat,{size:16,color:"var(--color-input-border, #ACACAD)",strokeWidth:1.5}),je>1?e.jsxs("div",{style:{position:"relative"},children:[e.jsx(ne,{text:Le,children:e.jsxs("button",{onClick:()=>ge(p=>!p),style:{display:"flex",alignItems:"center",gap:4,padding:"8px 0",background:"none",border:"none",cursor:"pointer"},children:[e.jsx(x.CircleUser,{size:16,color:"var(--Grey-Muted, #808183)",strokeWidth:1.5}),e.jsxs("span",{style:{fontSize:13,fontWeight:400,color:"var(--Grey-Strong, #2E3236)",lineHeight:1.2},children:[te," (",je," Sessions)"]}),ze?e.jsx(x.ChevronUp,{size:16,color:"var(--Grey-Muted, #808183)",strokeWidth:1.5}):e.jsx(x.ChevronDown,{size:16,color:"var(--Grey-Muted, #808183)",strokeWidth:1.5})]})}),ze&&e.jsxs("div",{style:{position:"absolute",top:"100%",right:0,marginTop:4,width:264,background:"var(--Grey-White, #FFF)",borderRadius:4,border:"1px solid var(--Grey-absent, #D9D9D9)",boxShadow:"0 4px 16px rgba(0,0,0,0.12)",zIndex:50,overflow:"hidden"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:8,padding:16},children:[e.jsx(x.CircleUser,{size:16,color:"var(--Grey-Muted, #808183)",strokeWidth:1.5,style:{marginTop:2,flexShrink:0}}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4},children:[e.jsx("span",{style:{fontSize:16,fontWeight:600,color:"var(--Grey-Strong, #2E3236)",lineHeight:1},children:te}),e.jsxs("span",{style:{fontSize:13,fontWeight:400,color:"var(--Grey-Muted, #808183)",lineHeight:1},children:[je," Sessions in past"]})]})]}),Te.slice(0,5).map((p,D)=>e.jsxs("div",{onClick:()=>{ke&&ke(p),ge(!1)},onMouseEnter:()=>Me(D),onMouseLeave:()=>Me(null),style:{display:"flex",width:264,padding:"12px 16px",justifyContent:"space-between",alignItems:"center",background:Ge===D?"var(--surface-hover, #F3F7F7)":"var(--Grey-White, #FFF)",borderTop:"1px solid var(--Grey-absent, #D9D9D9)",cursor:"pointer",boxSizing:"border-box",transition:"background 0.15s"},children:[e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:12},children:[e.jsx("span",{style:{fontSize:13,fontWeight:400,color:"var(--Grey-Strong, #2E3236)",lineHeight:1},children:p.title}),e.jsx("span",{style:{fontSize:12,fontWeight:400,color:"var(--Grey-Muted, #808183)",lineHeight:1},children:p.date})]}),Ge===D&&e.jsx(x.ExternalLink,{size:16,color:"var(--Grey-Muted, #808183)",strokeWidth:1,style:{flexShrink:0}})]},p.id||D)),e.jsx("div",{style:{padding:16,borderTop:"1px solid var(--Grey-absent, #D9D9D9)",display:"flex",justifyContent:"center"},children:e.jsxs("button",{onClick:()=>{we&&we(),ge(!1)},style:{display:"flex",height:32,padding:"16px 16px 16px 12px",justifyContent:"center",alignItems:"center",gap:6,background:"var(--Grey-White, #FFF)",border:"1px solid var(--Grey-absent, #D9D9D9)",borderRadius:10,cursor:"pointer"},children:[e.jsx(x.History,{size:16,color:"var(--Grey-Muted, #808183)",strokeWidth:1.5}),e.jsx("span",{style:{fontSize:14,fontWeight:600,color:"var(--Grey-Strong, #2E3236)"},children:"View All Sessions"})]})})]})]}):e.jsx(ne,{text:Le,children:e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:4,padding:"8px 0",cursor:"pointer"},children:[e.jsx(x.CircleUser,{size:16,color:"var(--Grey-Muted, #808183)",strokeWidth:1.5}),e.jsx("span",{style:{fontSize:13,fontWeight:400,color:"var(--Grey-Strong, #2E3236)",lineHeight:1.2},children:te})]})})]})]})]}),e.jsxs("div",{style:{display:"flex",alignItems:"stretch",gap:24,alignSelf:"stretch"},children:[e.jsx("div",{style:{flex:1,minWidth:0,display:"flex"},children:e.jsx(tt,{score:ce??0,maxScore:5,predictedScore:ie??0,predictedLabel:c,legends:J})}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"stretch",justifyContent:"flex-end",gap:24,flex:1,minWidth:0},children:[e.jsx(Ue,{meta:Ae,callPurpose:L||He,classification:O||Mt,outcomeQuality:q||"Neutral",dimensions:Wt,resolutionOutcome:o,customerIntent:B,interactionId:K??$.interaction_id,moreDetails:V}),e.jsx(Xe,{outcomeLift:Et,driverLabels:_t})]})]})]}),e.jsx("div",{ref:ue,style:{paddingTop:24},children:e.jsx(Je,{data:r?null:Tt,loading:r})}),e.jsxs("div",{ref:ye,style:{display:"flex",flexDirection:"column",gap:16,alignSelf:"stretch",paddingTop:24},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[e.jsx(x.FileSignal,{size:24,color:"#C98A5A",strokeWidth:2}),e.jsx("span",{style:{fontSize:16,fontWeight:600,color:"var(--Grey-Strong, #2E3236)",lineHeight:1.2,textTransform:"uppercase"},children:"Signals & Recording"})]}),e.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:24,alignSelf:"stretch",paddingTop:16,borderTop:"1px solid #D9D9D9"},children:[e.jsx("div",{style:{flex:1,minWidth:0},children:e.jsx(et,{signals:Rt,expandedSignals:mt,toggleSignal:Dt,playEvidence:Ct,highlightTurns:Ft,onShowInTranscript:wt,timelinePlaying:m||vt,currentTimeSeconds:v??bt})}),e.jsx("div",{style:{flex:1,minWidth:0},children:e.jsx(Qe.UpdatedInteractionRecording,{ref:U,audioUrl:a,durationSeconds:Ae.duration_seconds,audioRef:u,agentName:be,customerName:te,currentTimeSeconds:v,timelinePlaying:m,playbackRate:j,timelineSegments:W,onSeek:k,onTogglePlay:d,onSeekBack:z,onSeekForward:b,onSetPlaybackRate:y,transcript:_,activeTurnIndex:H,turnObservations:R,highlightedTurns:h,onTurnPlayPause:g,setExpandedSignals:We})})]})]}),e.jsx("div",{ref:xe,style:{paddingTop:24},children:e.jsx(st,{comments:De,totalComments:De.length,currentUser:dt,onSendComment:ct||(()=>{}),onSendReply:ft||(()=>{}),onReply:pt||(()=>{}),onEdit:gt||(()=>{}),onDelete:ht||(()=>{}),onMenuClick:ut||(()=>{}),onMarkResolved:yt||(()=>{}),isResolved:xt})})]})]})};exports.UpdatedInteractionRecording=Qe.UpdatedInteractionRecording;exports.UpdatedCoachingSynthesisCard=Je;exports.UpdatedCompassScore=tt;exports.UpdatedInteractionContext=Ue;exports.UpdatedInteractionDetails=nn;exports.UpdatedInteractionScores=Xe;exports.UpdatedInteractionSignals=et;exports.UpdatedThreads=st;
|
|
15
|
+
`}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:12,padding:"48px 24px"},children:[e.jsxs("svg",{width:48,height:48,viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{animation:"coaching-spinner-spin 1.2s linear infinite"},children:[e.jsx("path",{d:"M43 24C43 26.4951 42.5086 28.9658 41.5537 31.271C40.5989 33.5762 39.1993 35.6707 37.435 37.435C35.6707 39.1993 33.5762 40.5989 31.271 41.5537C28.9658 42.5086 26.4951 43 24 43C21.5049 43 19.0342 42.5086 16.729 41.5537C14.4238 40.5989 12.3293 39.1993 10.565 37.435C8.80066 35.6707 7.40113 33.5762 6.44629 31.271C5.49145 28.9658 5 26.4951 5 24",stroke:"#F3E7C7",strokeWidth:"4",strokeLinecap:"round"}),e.jsx("path",{d:"M12 24C12 22.4241 12.3104 20.8637 12.9134 19.4078C13.5165 17.9519 14.4004 16.629 15.5147 15.5147C16.629 14.4004 17.9519 13.5165 19.4078 12.9134C20.8637 12.3104 22.4241 12 24 12C25.5759 12 27.1363 12.3104 28.5922 12.9134C30.0481 13.5165 31.371 14.4004 32.4853 15.5147C33.5996 16.629 34.4835 17.9519 35.0866 19.4078C35.6896 20.8637 36 22.4241 36 24",stroke:"#00A66E",strokeWidth:"4",strokeLinecap:"round"}),e.jsx("path",{d:"M20 24C20 24.5253 20.1035 25.0454 20.3045 25.5307C20.5055 26.016 20.8001 26.457 21.1716 26.8284C21.543 27.1999 21.984 27.4945 22.4693 27.6955C22.9546 27.8965 23.4747 28 24 28C24.5253 28 25.0454 27.8965 25.5307 27.6955C26.016 27.4945 26.457 27.1999 26.8284 26.8284C27.1999 26.457 27.4945 26.016 27.6955 25.5307C27.8965 25.0454 28 24.5253 28 24",stroke:"#F3E7C7",strokeWidth:"4",strokeLinecap:"round"})]}),e.jsx("span",{style:{fontSize:14,color:M.muted,fontWeight:500,textAlign:"center"},children:"Synthesizing coaching summary..."})]})]});if(i)return e.jsx("div",{style:{fontSize:14,color:M.muted},children:"Unable to generate coaching summary."});if(!t)return null;const r=t.strengths||[],s=t.improvements||[],o=typeof t.one_liner=="string"?t.one_liner:((f=t.one_liner)==null?void 0:f.text)||"",g=typeof t.context=="string"?t.context:((m=t.context)==null?void 0:m.text)||"";return e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:16,background:"#FFF"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[e.jsx(y.ShieldCheck,{size:20,color:M.accent,strokeWidth:2}),e.jsx("span",{style:{fontSize:16,fontWeight:600,color:M.strong,fontFamily:"var(--font-sans)",lineHeight:1.2,textTransform:"uppercase"},children:"Coaching Summary"})]}),o&&e.jsx("div",{style:{fontSize:14,fontWeight:500,color:M.strong,fontFamily:"var(--font-sans)",lineHeight:1.5},children:o}),e.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:16,justifyContent:"space-between"},children:[g&&e.jsx("div",{style:{fontSize:14,fontWeight:400,color:M.muted,fontFamily:"var(--font-sans)",lineHeight:1.5,flex:1},children:g}),t.overall&&e.jsx(Kt,{overall:t.overall})]}),(r.length>0||s.length>0)&&e.jsxs("div",{style:{display:"flex",gap:24,paddingTop:24,borderTop:`1px solid ${M.absent}`},children:[e.jsx(Ue,{icon:e.jsx(y.TrendingUp,{size:14,color:M.strong,strokeWidth:1.5}),label:"Key Strengths",items:r}),e.jsx(Ue,{icon:e.jsx(y.Lightbulb,{size:14,color:M.strong,strokeWidth:1.5}),label:"Improvements",items:s})]})]})};function Yt(t){const n=Math.floor(t/60),i=Math.round(t%60);return`${n}:${i.toString().padStart(2,"0")}`}const Zt={display:"flex",justifyContent:"space-between",padding:"8px 8px 12px 8px",alignItems:"center",gap:24,fontFamily:"var(--font-sans)",fontSize:13,fontWeight:400,lineHeight:"normal",borderBottom:"1px solid var(--Grey-absent, #D9D9D9)"},Qe={display:"flex",flexDirection:"column",flex:"1 0 0",gap:0,minWidth:0},rt=({meta:t={},callPurpose:n={},classification:i={},dimensions:r=[],outcomeQuality:s="Neutral",onMoreDetails:o,moreDetails:g=[],resolutionOutcome:f,customerIntent:m})=>{const[k,j]=p.useState(!1),F=t.duration_seconds!=null?Yt(t.duration_seconds):null,c=t.message_count,S=n.interaction_driver,b=i.interaction_paradigm,v=d=>r.find(T=>(T.key||"").toLowerCase().includes(d)),w=v("resolution_outcome"),G=v("customer_intent"),W=v("outcome_quality"),D=d=>d?d.replace(/_/g," ").replace(/\b\w/g,T=>T.toUpperCase()):null,_=s!=="Neutral"?s:W?D(W.value):s,P=f??(w?D(w.value):null),H=m??(G?D(G.value):null),A=new Set(["resolution_outcome","customer_intent","outcome_quality"].map(d=>`dim.${d}`)),a=r.filter(d=>!A.has(d.key)),h=[],l=[[F!=null?{label:"Duration",value:F}:null,c!=null?{label:"Messages",value:c}:null],[S!=null?{label:"Driver",value:S}:null,b!=null?{label:"Paradigm",value:b}:null]];for(let d=0;d<a.length;d+=2){const T=a[d]?{label:a[d].display_name||a[d].label||a[d].key,value:D(a[d].value)}:null,q=a[d+1]?{label:a[d+1].display_name||a[d+1].label||a[d+1].key,value:D(a[d+1].value)}:null;l.push([T,q])}l.push([{label:"Outcome Quality",value:_},{isMoreDetails:!0}]),l.forEach(d=>h.push(d));const E=[P!=null&&{label:"Resolution Outcome",value:P},H!=null&&{label:"Customer Intent",value:H},...g||[]].filter(Boolean),O=d=>e.jsxs("div",{style:Zt,children:[e.jsx("span",{style:{color:"var(--Grey-Strong, #2E3236)",whiteSpace:"nowrap",flexShrink:0},children:d.label}),e.jsx("span",{style:{color:"var(--Grey-Muted, #808183)",textAlign:"right",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minWidth:0},children:d.value})]},d.label),Y=()=>e.jsxs("div",{onClick:()=>{j(d=>!d),o&&!k&&o()},style:{display:"flex",alignItems:"center",gap:6,padding:"8px 8px 12px 8px",cursor:"pointer",fontFamily:"var(--font-sans)",borderBottom:"1px solid var(--Grey-absent, #D9D9D9)"},children:[e.jsx("span",{style:{color:"var(--Grey-Strong, #2E3236)",fontSize:13,fontWeight:500,lineHeight:"normal"},children:"More Details"}),k?e.jsx(y.ChevronUp,{size:16,color:"var(--Grey-Muted, #808183)",strokeWidth:1.5}):e.jsx(y.ChevronDown,{size:16,color:"var(--Grey-Muted, #808183)",strokeWidth:1.5})]},"more-details");return e.jsxs("div",{style:{display:"flex",flexDirection:"column",alignSelf:"stretch",gap:0,position:"relative",overflow:"visible"},children:[h.map((d,T)=>{var q;return e.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:24,alignSelf:"stretch"},children:[e.jsx("div",{style:Qe,children:d[0]&&!d[0].isMoreDetails?O(d[0]):e.jsx("div",{style:{flex:1}})}),e.jsx("div",{style:Qe,children:d[1]&&!d[1].isMoreDetails?O(d[1]):(q=d[1])!=null&&q.isMoreDetails?Y():e.jsx("div",{style:{flex:1}})})]},T)}),k&&E.length>0&&e.jsxs("div",{style:{position:"absolute",top:"100%",right:0,marginTop:4,display:"flex",width:340,flexDirection:"column",alignItems:"flex-start",borderRadius:4,border:"1px solid var(--Grey-absent, #D9D9D9)",background:"var(--Grey-White, #FFF)",boxShadow:"-2px 2px 2px 0 rgba(0, 0, 0, 0.25)",overflow:"hidden",fontFamily:"var(--font-sans)",zIndex:50},children:[e.jsx("div",{style:{padding:"12px 16px",fontSize:13,fontWeight:600,color:"var(--Grey-Strong, #2E3236)",borderBottom:"1px solid var(--Grey-absent, #D9D9D9)",alignSelf:"stretch"},children:"More details"}),E.map(d=>e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"12px 16px",gap:24,fontSize:13,fontWeight:400,lineHeight:"normal",borderBottom:"1px solid var(--Grey-absent, #D9D9D9)",alignSelf:"stretch"},children:[e.jsx("span",{style:{color:"var(--Grey-Strong, #2E3236)",whiteSpace:"nowrap",flexShrink:0},children:d.label}),e.jsx("span",{style:{color:"var(--Grey-Muted, #808183)",fontSize:13,fontStyle:"normal",fontWeight:400,lineHeight:"120%",textAlign:"right"},children:d.value})]},d.label))]})]})},C={strong:"var(--Grey-Strong, #2E3236)",muted:"var(--Grey-Muted, #808183)",absent:"var(--Grey-absent, #D9D9D9)",white:"var(--Grey-White, #FFF)",cardBg:"var(--surface-warm-40, rgba(243, 241, 229, 0.40))"},R=1.2,Je=3,Xe=t=>t!=null?Math.round(t*100)+"%":"—",et=t=>{if(t==null)return"—";const n=(t*100).toFixed(1);return t>0?`+${n}pp`:`${n}pp`},ot=({outcomeLift:t,driverLabels:n=[]})=>{var c;if(!t||t.lift==null)return null;const i=t.p_expected,r=t.p_full,s=t.lift_raw??(r!=null&&i!=null?r-i:null),o=t.lift,g=(c=t.interpretation)!=null&&c.lift_band?t.interpretation.lift_band.replace(/_/g," "):o>=0?"Positive":"Negative",f=g.charAt(0).toUpperCase()+g.slice(1),k=/negative/i.test(g)?y.ThumbsDown:y.ThumbsUp,j=n.slice(0,Je),F=n.length-Je;return e.jsxs("div",{style:{display:"flex",flexDirection:"column",padding:24,gap:24,borderRadius:8,border:`1px solid ${C.absent}`,background:C.cardBg,alignSelf:"stretch"},children:[e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:32},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:24,alignSelf:"stretch"},children:[e.jsx("span",{style:{fontSize:15,fontWeight:600,color:C.strong,fontFamily:"var(--font-sans)",lineHeight:R},children:"Agent Lift Analysis"}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,fontFamily:"var(--font-sans)"},children:[e.jsx("span",{style:{fontSize:13,fontWeight:400,color:C.strong,lineHeight:R},children:"vs. Average Agent:"}),e.jsx("span",{style:{fontSize:14,fontWeight:600,color:C.strong,lineHeight:R},children:et(o)}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,paddingLeft:8,borderLeft:`1px solid ${C.absent}`},children:[e.jsx(k,{size:14,color:C.strong}),e.jsx("span",{style:{fontSize:13,fontWeight:600,color:C.strong,lineHeight:R},children:f})]})]})]}),e.jsxs("div",{style:{display:"flex",gap:24},children:[e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:16,alignItems:"flex-start",flex:1,minWidth:0},children:[e.jsx("span",{style:{fontSize:28,fontWeight:400,color:C.muted,fontFamily:"var(--font-sans)",lineHeight:R},children:Xe(i)}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8,alignItems:"flex-start",minHeight:48},children:[e.jsx("span",{style:{fontSize:13,fontWeight:400,color:C.strong,fontFamily:"var(--font-sans)",lineHeight:R,whiteSpace:"nowrap"},children:"Expected Outcome"}),e.jsx("span",{style:{fontSize:13,fontWeight:400,color:C.muted,fontFamily:"var(--font-sans)",lineHeight:R,textAlign:"left"},children:"Based on call type & difficulty"})]})]}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:16,alignItems:"flex-start",paddingLeft:24,borderLeft:`1px solid ${C.absent}`,flex:1,minWidth:0},children:[e.jsx("span",{style:{fontSize:28,fontWeight:400,color:C.muted,fontFamily:"var(--font-sans)",lineHeight:R},children:et(s)}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8,alignItems:"flex-start",minHeight:48},children:[e.jsx("span",{style:{fontSize:13,fontWeight:400,color:C.strong,fontFamily:"var(--font-sans)",lineHeight:R,whiteSpace:"nowrap"},children:"Agent Impact"}),e.jsx("span",{style:{fontSize:13,fontWeight:400,color:C.muted,fontFamily:"var(--font-sans)",lineHeight:R,textAlign:"left"},children:"Behavior-driven change"})]})]}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:16,alignItems:"flex-start",paddingLeft:24,borderLeft:`1px solid ${C.absent}`,flex:1,minWidth:0},children:[e.jsx("span",{style:{fontSize:28,fontWeight:400,color:C.strong,fontFamily:"var(--font-sans)",lineHeight:R},children:Xe(r)}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8,alignItems:"flex-start",minHeight:48},children:[e.jsx("span",{style:{fontSize:13,fontWeight:600,color:C.strong,fontFamily:"var(--font-sans)",lineHeight:R,whiteSpace:"nowrap"},children:"Predicted Outcome"}),e.jsx("span",{style:{fontSize:13,fontWeight:400,color:C.muted,fontFamily:"var(--font-sans)",lineHeight:R,textAlign:"left"},children:"With agent behaviors"})]})]})]})]}),n.length>0&&e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4,alignSelf:"stretch"},children:[e.jsx("span",{style:{fontSize:12,fontWeight:600,color:C.strong,fontFamily:"var(--font-sans)",lineHeight:R},children:"Key Drivers"}),e.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:4},children:[j.map((S,b)=>e.jsx("div",{style:{display:"flex",padding:8,alignItems:"center",justifyContent:"center",borderRadius:4,border:`1px solid ${C.absent}`,background:C.white},children:e.jsx("span",{style:{fontSize:12,fontWeight:400,color:C.strong,fontFamily:"var(--font-sans)",lineHeight:R,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:200},children:S})},b)),F>0&&e.jsx("div",{style:{display:"flex",padding:8,alignItems:"center",justifyContent:"center",borderRadius:4,border:`1px solid ${C.absent}`,background:C.white},children:e.jsxs("span",{style:{fontSize:12,fontWeight:400,color:C.strong,fontFamily:"var(--font-sans)",lineHeight:R,whiteSpace:"nowrap"},children:["+ ",F]})})]})]})]})},tt=({children:t,size:n=28,onClick:i,title:r})=>{const[s,o]=p.useState(!1);return e.jsx("div",{title:r,onClick:i,onMouseEnter:()=>o(!0),onMouseLeave:()=>o(!1),style:{display:"flex",alignItems:"center",justifyContent:"center",width:n,height:n,borderRadius:9999,background:s?"var(--surface-hover, #F3F7F7)":"transparent",cursor:"pointer",flexShrink:0,transition:"background 0.15s"},children:t})},lt=({signals:t={signals:[],present_count:0,total_signals_evaluated:0},expandedSignals:n=new Set,toggleSignal:i=()=>{},playEvidence:r=()=>{},highlightTurns:s=()=>{},onShowInTranscript:o=()=>{},timelinePlaying:g=!1,currentTimeSeconds:f=0})=>{const m=(t==null?void 0:t.signals)??[],k=(t==null?void 0:t.present_count)??m.length,j=c=>{const S=Math.floor(c/6e4),b=Math.floor(c%6e4/1e3);return`${S.toString().padStart(2,"0")}:${b.toString().padStart(2,"0")}`},F=c=>g&&c.start_ms!=null&&f*1e3>=c.start_ms&&f*1e3<=(c.end_ms??c.start_ms+5e3);return e.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"flex-start",alignSelf:"stretch",width:"100%",gap:16},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:16,width:"100%"},children:[e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:34,height:34,borderRadius:9999,background:"var(--surface-hover, #F3F7F7)",flexShrink:0},children:e.jsx(y.FileSignal,{size:20,color:"#2E3236",strokeWidth:1.5})}),e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",flex:1},children:[e.jsx("span",{style:{fontSize:15,fontWeight:500,color:"var(--Grey-Strong, #2E3236)"},children:"Signals"}),e.jsxs("span",{style:{fontSize:14,fontWeight:500,color:"var(--Grey-Strong, #2E3236)"},children:[k," Signals Detected"]})]})]}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",alignSelf:"stretch",background:"var(--Grey-White, #FFF)",gap:8},children:[m.length===0&&e.jsx("div",{style:{padding:"8px 0",fontSize:14,color:"var(--Grey-Muted, #808183)"},children:"No signals detected."}),m.map((c,S)=>{var G,W,D;const b=c.key??c.id??S,v=n.has(b),w=((G=c.observations)==null?void 0:G.length)??0;return e.jsxs("div",{id:`signal-${b}`,style:{display:"flex",flexDirection:"column",width:"100%",gap:8},children:[e.jsxs("button",{onClick:()=>i(b),style:{display:"flex",padding:"8px 0",alignItems:"center",gap:12,alignSelf:"stretch",width:"100%",background:"none",border:"none",borderBottom:"1px solid var(--Grey-absent, #D9D9D9)",cursor:"pointer"},children:[e.jsxs("span",{style:{flex:1,textAlign:"left",fontSize:14,fontWeight:600,color:"var(--text-dark, #0B0A0A)",lineHeight:1.71},children:[c.display_name||((W=c.key)==null?void 0:W.replace(/_/g," ")),w>0&&e.jsxs("span",{style:{fontWeight:600,color:"var(--text-dark, #0B0A0A)",marginLeft:6},children:["(",w,")"]})]}),v?e.jsx(y.ChevronUp,{size:20,color:"#767473"}):e.jsx(y.ChevronDown,{size:20,color:"#767473"})]}),v&&((D=c.observations)==null?void 0:D.length)>0&&e.jsx("div",{style:{display:"flex",flexDirection:"column",alignSelf:"stretch",gap:0},children:c.observations.map((_,P)=>{var H,A,a;return e.jsxs("div",{style:{display:"flex",flexDirection:"column",alignSelf:"stretch",gap:8},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12,padding:"8px 0",justifyContent:"space-between"},children:[e.jsx("span",{style:{flex:1,fontSize:14,fontWeight:400,color:"var(--text-subtle-warm, #767473)",lineHeight:1.5},children:_.reason||_.explanation}),((A=(H=_.evidence)==null?void 0:H[0])==null?void 0:A.start_ms)!=null&&e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,flexShrink:0},children:[e.jsx(tt,{size:28,title:"Show in transcript",onClick:h=>{h.stopPropagation(),o(_.evidence[0].start_ms)},children:e.jsx(y.ScrollText,{size:16,color:"#808183",strokeWidth:1.5})}),e.jsx("span",{style:{fontSize:13,fontWeight:400,color:"var(--Grey-Muted, #808183)",lineHeight:1.2,whiteSpace:"nowrap"},children:j(_.evidence[0].start_ms)})]})]}),(a=_.evidence)==null?void 0:a.map((h,l)=>{const E=h.start_ms!=null&&h.end_ms!=null;return h.text&&e.jsxs("div",{onClick:O=>{O.stopPropagation(),E&&r(h)},onMouseEnter:()=>s(h.turn_ids??[]),onMouseLeave:()=>s([]),style:{display:"flex",alignItems:"center",gap:8,padding:"8px 0",cursor:E?"pointer":"default"},children:[E&&e.jsx(tt,{size:28,children:F(h)?e.jsx(y.PauseCircle,{size:17,color:"var(--Grey-Muted, #808183)",strokeWidth:1.5}):e.jsx(y.PlayCircle,{size:17,color:"var(--Grey-Muted, #808183)",strokeWidth:1})}),e.jsxs("span",{style:{fontSize:13,fontWeight:400,color:"var(--Grey-Strong, #2E3236)",lineHeight:1.2},children:["“",h.text,"”"]})]},l)})]},_.key??P)})})]},b)})]})]})},L={strong:"var(--Grey-Strong, #2E3236)",muted:"var(--Grey-Muted, #808183)",absent:"var(--Grey-absent, #D9D9D9)",white:"var(--Grey-White, #FFF)",accent:"var(--rail-orange, #C98A5A)",track:"var(--rail-surface-2, #E3E1D7)",infoIcon:"var(--color-input-border, #ACACAD)"},Ut=({score:t=4,maxScore:n=10})=>{const k=Math.min(Math.round(t/n*5),5),j=180/5,F=b=>{const v=b*Math.PI/180;return{x:121.5+85*Math.cos(v),y:123-85*Math.sin(v)}},c=(b,v)=>{const w=F(b),G=F(v),W=b-v>180?1:0;return`M ${w.x} ${w.y} A 85 85 0 ${W} 1 ${G.x} ${G.y}`},S=2;return e.jsx("svg",{width:"100%",viewBox:"0 0 243 130",fill:"none",style:{maxWidth:243},children:Array.from({length:5},(b,v)=>{const w=180-v*j-(v>0?S/2:0),G=180-(v+1)*j+(v<5-1?S/2:0),W=v<k;return e.jsx("path",{d:c(w,G),stroke:W?L.strong:L.track,strokeWidth:30,strokeLinecap:"butt",fill:"none"},v)})})},Qt=({value:t=0,maxValue:n=5})=>e.jsx("div",{style:{display:"flex",gap:2},children:Array.from({length:n},(i,r)=>e.jsx("div",{style:{width:22,height:6,borderRadius:1,background:r<t?L.strong:L.track}},r))}),Jt={CSAT:"Predicted Customer Satisfaction",Resolution:"Predicted Resolution: was the issue fully resolved?","Process Adherence":"Process Adherence: Did the agent follow procedures?",Communication:"Predicted Communication Quality: Clarity, Empathy, Professionalism"},Xt=({text:t,children:n})=>{const[i,r]=p.useState(!1),s=p.useRef(null),[o,g]=p.useState({top:0,left:0}),f=()=>{if(s.current){const m=s.current.getBoundingClientRect();g({top:m.top-8,left:m.left+m.width/2})}r(!0)};return e.jsxs("div",{ref:s,style:{position:"relative",display:"inline-flex"},onMouseEnter:f,onMouseLeave:()=>r(!1),children:[n,i&&e.jsx("div",{style:{position:"fixed",top:o.top,left:o.left,transform:"translate(-50%, -100%)",display:"flex",width:"max-content",maxWidth:300,padding:10,alignItems:"center",borderRadius:4,border:"1px solid var(--Grey-absent, #D9D9D9)",background:"var(--Grey-Strong, #2E3236)",zIndex:9999,pointerEvents:"none"},children:e.jsx("span",{style:{color:"#FFF",fontSize:12,fontWeight:400,lineHeight:"140%"},children:t})})]})},en=({label:t,value:n=0,maxValue:i=5})=>e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8,padding:8,alignItems:"flex-start"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[e.jsx("span",{style:{fontSize:12,fontWeight:400,color:L.strong,fontFamily:"var(--font-sans)",lineHeight:"normal"},children:t}),e.jsx(Xt,{text:Jt[t]||t,children:e.jsx(y.Info,{size:14,color:L.infoIcon,strokeWidth:1,style:{cursor:"pointer"}})})]}),e.jsx(Qt,{value:n,maxValue:i})]}),at=({score:t=83,maxScore:n=100,predictedScore:i=4,predictedLabel:r="Predicted Objective",description:s="",legends:o=[{label:"CSAT",value:3},{label:"Resolution",value:4},{label:"Process Adherence",value:5},{label:"Communication",value:3}]})=>(String(i).padStart(2,"0"),e.jsxs("div",{style:{display:"flex",flexDirection:"column",padding:24,borderRadius:8,border:`1px solid ${L.absent}`,background:L.white,alignSelf:"stretch",flex:1,gap:24},children:[e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[e.jsx("span",{style:{fontSize:15,fontWeight:600,color:L.strong,fontFamily:"var(--font-sans)",lineHeight:1.2},children:"Compass Score"}),e.jsx("span",{style:{fontSize:14,fontWeight:400,color:L.muted,fontFamily:"var(--font-sans)",lineHeight:"normal"},children:s})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",gap:24,flex:1,overflow:"hidden"},children:[e.jsxs("div",{style:{position:"relative",maxWidth:243,minWidth:160,flex:"0 1 243px",flexDirection:"column",alignItems:"center",display:"flex"},children:[e.jsx(Ut,{score:t,maxScore:n}),(()=>{const m=-(180-(n>0?Math.min(t/n,1):0)*180-45);return e.jsxs("svg",{width:"34",height:"35",viewBox:"0 0 34 35",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{marginTop:-24,transform:`rotate(${m}deg)`,transformOrigin:"center center"},children:[e.jsx("path",{d:"M16 25.2169C19.958 25.2169 23.1667 22.0083 23.1667 18.0503C23.1667 14.0922 19.958 10.8836 16 10.8836C12.042 10.8836 8.83334 14.0922 8.83334 18.0503C8.83334 22.0083 12.042 25.2169 16 25.2169Z",fill:"var(--rail-orange, #C98A5A)"}),e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M30.4791 11.2328L33.4351 0L21.6888 3.09113C19.9212 2.41855 18.0036 2.05025 16 2.05025C7.16344 2.05025 0 9.2137 0 18.0503C0 26.8868 7.16344 34.0503 16 34.0503C24.8366 34.0503 32 26.8868 32 18.0503C32 15.6119 31.4546 13.301 30.4791 11.2328ZM16 30.5503C22.9036 30.5503 28.5 24.9538 28.5 18.0503C28.5 11.1467 22.9036 5.55025 16 5.55025C9.09644 5.55025 3.5 11.1467 3.5 18.0503C3.5 24.9538 9.09644 30.5503 16 30.5503Z",fill:"var(--rail-orange, #C98A5A)"})]})})(),e.jsx("div",{style:{fontSize:28,fontWeight:400,color:L.strong,fontFamily:"var(--font-sans)",lineHeight:1,textAlign:"center",marginTop:8},children:t})]}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8,alignItems:"flex-start",justifyContent:"center",flex:1},children:[e.jsx("div",{style:{fontSize:15,fontWeight:500,color:L.strong,fontFamily:"var(--font-sans)",lineHeight:1.2,textAlign:"left"},children:"Interaction Quality Index"}),e.jsx("div",{style:{width:"100%",height:1,background:L.absent}}),o.map((g,f)=>e.jsx(en,{label:g.label,value:g.value},f))]})]})]})),Se=t=>{if(!t)return null;const n=String(t).toLowerCase();return n==="supervisor"?"var(--rail-compliance, #C98A5A)":n==="admin"||n==="administrator"?"var(--rail-discovery, #5E88B0)":n==="agent"?"var(--rail-outcome, #6B7C93)":null},de=t=>(t||"").split(" ").map(n=>n[0]).join("").toUpperCase()||"U",tn=t=>{if(!t||t==="Just now")return!0;if(/^\d{4}-\d{2}-\d{2}T/.test(t))try{const i=/Z$|[+-]\d{2}:\d{2}$/.test(t)?t:t+"Z",r=new Date(i);return Number.isNaN(r.getTime())?!1:Date.now()-r.getTime()<15*60*1e3}catch{return!1}const n=t.match(/^(\d+)\s*min/);return n?parseInt(n[1],10)<15:!(/\d+\s*h/.test(t)||/\d+\s*day/.test(t))},nn=t=>{if(!t)return"";if(!/^\d{4}-\d{2}-\d{2}T/.test(t))return t;try{const n=/Z$|[+-]\d{2}:\d{2}$/.test(t)?t:t+"Z",i=new Date(n);if(Number.isNaN(i.getTime()))return t;const s=new Date().getTime()-i.getTime(),o=Math.floor(s/6e4),g=Math.floor(s/36e5);if(o<1)return"Just now";if(o<60)return`${o} min`;if(g<24)return`${g} h`;const f=Math.floor(g/24);return f===1?"1 day":`${f} days`}catch{return t}},dt=({name:t,initials:n,color:i,avatar:r,size:s=36})=>r?e.jsx("img",{src:r,alt:t,style:{width:s,height:s,borderRadius:"50%",objectFit:"cover",flexShrink:0}}):e.jsx("div",{style:{width:s,height:s,borderRadius:"50%",background:i||"#6B7C93",color:"#FFF",display:"flex",alignItems:"center",justifyContent:"center",fontSize:s<=32?"10px":"11px",fontWeight:650,flexShrink:0,fontFamily:"var(--default-font-family)",letterSpacing:"0.02em"},title:t,children:n||de(t)}),sn=({comment:t,isReply:n=!1,isConsecutive:i=!1,onReply:r,onSendReply:s,onEdit:o,onDelete:g,onMenuClick:f,showReply:m=!0})=>{var fe,ie;const[k,j]=p.useState(!1),[F,c]=p.useState(!1),[S,b]=p.useState(!1),[v,w]=p.useState(""),[G,W]=p.useState(!1),[D,_]=p.useState(""),[P,H]=p.useState(!1),A=p.useRef(null),a=p.useRef(null),h=t.author||{},l=h.name||t.author_name||"Unknown",E=h.initials||de(l),O=h.role||t.author_role,Y=h.color||Se(O)||"#6B7C93",d=h.avatar||t.avatar,T=t.timestamp||t.created_at,q=nn(T),K=tn(T),ce=Array.isArray(t.content)?t.content:[t.content||t.text||""];return p.useEffect(()=>{if(!F)return;const u=Q=>{A.current&&!A.current.contains(Q.target)&&c(!1)};return document.addEventListener("mousedown",u),()=>document.removeEventListener("mousedown",u)},[F]),e.jsxs("div",{onMouseEnter:()=>j(!0),onMouseLeave:()=>j(!1),style:{display:"flex",paddingLeft:n?48:0,alignItems:"flex-start",gap:16,paddingTop:i?0:8,paddingBottom:8},children:[i?e.jsx("div",{style:{width:36,flexShrink:0}}):e.jsx(dt,{name:l,initials:E,color:Y,avatar:d}),e.jsxs("div",{style:{flex:1,minWidth:0},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:i?"flex-end":"space-between",marginBottom:i?0:6},children:[!i&&e.jsxs("div",{style:{display:"flex",alignItems:"baseline",gap:8},children:[e.jsx("span",{style:{fontSize:13,fontWeight:650,color:"var(--text-ink, #1E2125)",lineHeight:"150%",fontFamily:"var(--default-font-family)"},children:l}),e.jsx("span",{style:{fontSize:12,fontWeight:400,color:"var(--Grey-Muted, #808183)",lineHeight:"150%",fontFamily:"var(--default-font-family)"},children:q}),(t.isEdited||t.is_edited)&&e.jsx("span",{style:{fontSize:12,fontWeight:400,color:"var(--Grey-Muted, #808183)",lineHeight:"150%",fontFamily:"var(--default-font-family)"},children:"(Edited)"})]}),e.jsxs("div",{style:{position:"relative"},ref:A,children:[e.jsx("button",{type:"button",onClick:()=>c(u=>!u),style:{padding:2,border:"none",background:"transparent",cursor:"pointer",borderRadius:4,display:"flex",alignItems:"center",justifyContent:"center",opacity:k||F?1:0,transition:"opacity 0.15s",flexShrink:0},children:e.jsx(y.Ellipsis,{size:24,color:"var(--Grey-Muted, #808183)"})}),F&&e.jsxs("div",{style:{position:"absolute",top:"100%",right:0,marginTop:4,display:"flex",width:99,flexDirection:"column",alignItems:"flex-start",borderRadius:4,border:"1px solid var(--Grey-absent, #D9D9D9)",background:"var(--Grey-White, #FFF)",boxShadow:"-2px 2px 2px 0 rgba(0, 0, 0, 0.25)",zIndex:50,overflow:"hidden"},children:[r&&e.jsx("button",{type:"button",onClick:()=>{c(!1),W(!1),b(!0)},style:{display:"flex",width:"100%",padding:"10px 16px",alignItems:"center",border:"none",background:"transparent",cursor:"pointer",fontSize:13,fontWeight:400,color:"var(--Grey-Strong, #2E3236)",fontFamily:"var(--default-font-family)",lineHeight:"150%",textAlign:"left"},onMouseEnter:u=>{u.currentTarget.style.background="var(--surface-hover, #F3F7F7)"},onMouseLeave:u=>{u.currentTarget.style.background="transparent"},children:"Reply"}),o&&e.jsx("button",{type:"button",disabled:!K,onClick:()=>{if(!K)return;c(!1);const u=Array.isArray(t.content)?t.content.join(`
|
|
16
|
+
`):t.content||t.text||"";_(u),W(!0),b(!1)},style:{display:"flex",width:"100%",padding:"10px 16px",alignItems:"center",border:"none",background:"transparent",cursor:K?"pointer":"not-allowed",fontSize:13,fontWeight:400,color:K?"var(--Grey-Strong, #2E3236)":"var(--Grey-Muted, #808183)",fontFamily:"var(--default-font-family)",lineHeight:"150%",textAlign:"left",opacity:K?1:.5},onMouseEnter:u=>{K&&(u.currentTarget.style.background="var(--surface-hover, #F3F7F7)")},onMouseLeave:u=>{u.currentTarget.style.background="transparent"},children:"Edit"}),g&&e.jsx("button",{type:"button",onClick:()=>{c(!1),H(!0)},style:{display:"flex",width:"100%",padding:"10px 16px",alignItems:"center",border:"none",background:"transparent",cursor:"pointer",fontSize:13,fontWeight:400,color:"var(--Grey-Strong, #2E3236)",fontFamily:"var(--default-font-family)",lineHeight:"150%",textAlign:"left"},onMouseEnter:u=>{u.currentTarget.style.background="var(--surface-hover, #F3F7F7)"},onMouseLeave:u=>{u.currentTarget.style.background="transparent"},children:"Delete"})]})]})]}),G?e.jsxs("div",{style:{display:"flex",width:662,maxWidth:"100%",padding:"8px 12px 12px 12px",flexDirection:"column",justifyContent:"center",alignItems:"flex-start",gap:24,borderRadius:8,border:"1px solid var(--Grey-absent, #D9D9D9)",background:"var(--Grey-White, #FFF)",boxSizing:"border-box",marginTop:4},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%"},children:[e.jsxs("span",{style:{fontSize:13,fontWeight:600,color:"var(--Grey-Muted, #808183)",fontFamily:"var(--default-font-family)",lineHeight:"normal"},children:["“"," ",((fe=t.author)==null?void 0:fe.name)||"Unknown"]}),e.jsx("button",{type:"button",onClick:()=>W(!1),style:{display:"flex",alignItems:"center",justifyContent:"center",background:"none",border:"none",cursor:"pointer",padding:0},children:e.jsx(y.X,{size:20,color:"var(--Grey-Muted, #808183)"})})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,width:"100%"},children:[e.jsx("input",{value:D,onChange:u=>_(u.target.value),onKeyDown:u=>{u.key==="Enter"&&!u.shiftKey&&(u.preventDefault(),D.trim()&&(o==null||o({...t,content:D.trim(),isEdited:!0}),W(!1))),u.key==="Escape"&&W(!1)},autoFocus:!0,style:{flex:1,padding:"10px 12px",fontSize:13,fontWeight:400,color:"var(--text-ink, #1E2125)",fontFamily:"var(--default-font-family)",lineHeight:"160%",border:"none",background:"transparent",outline:"none",boxSizing:"border-box"}}),e.jsx("button",{type:"button",onClick:()=>{D.trim()&&(o==null||o({...t,content:D.trim(),isEdited:!0}),W(!1))},disabled:!D.trim(),style:{display:"flex",padding:"6px 16px",justifyContent:"center",alignItems:"center",fontSize:13,fontWeight:600,color:D.trim()?"var(--Grey-White, #FFF)":"var(--Grey-Muted, #808183)",background:D.trim()?"var(--Grey-Strong, #2E3236)":"var(--grey-light, #e9e8e8a1)",border:"none",borderRadius:6,cursor:D.trim()?"pointer":"not-allowed",fontFamily:"var(--default-font-family)",flexShrink:0,transition:"all 0.15s",lineHeight:"150%"},children:"Save"})]})]}):e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:4,alignItems:"flex-start"},children:ce.map((u,Q)=>e.jsx("div",{style:{fontSize:13,fontWeight:400,color:"var(--text-ink, #1E2125)",lineHeight:"160%",fontFamily:"var(--default-font-family)",padding:"8px 12px",background:n?"var(--surface-hover, #F3F7F7)":"var(--surface-warm-40, rgba(243, 241, 229, 0.40))",borderRadius:8,wordBreak:"break-word"},children:u},Q))}),P&&e.jsxs("div",{style:{display:"inline-flex",alignItems:"center",gap:8,marginTop:8,fontSize:13,fontFamily:"var(--default-font-family)"},children:[e.jsx("span",{style:{color:"var(--Grey-Muted, #808183)",fontWeight:400},children:"Confirm: delete this comment?"}),e.jsx("button",{type:"button",onClick:()=>{H(!1),g==null||g(t)},style:{background:"var(--grey-light, #e9e8e8a1)",border:"none",cursor:"pointer",fontSize:13,fontWeight:600,color:"var(--text-ink, #1E2125)",fontFamily:"var(--default-font-family)",padding:"4px 10px",borderRadius:6,transition:"background 0.15s"},onMouseEnter:u=>{u.currentTarget.style.background="var(--Grey-absent, #D9D9D9)"},onMouseLeave:u=>{u.currentTarget.style.background="var(--grey-light, #e9e8e8a1)"},children:"Delete"}),e.jsx("button",{type:"button",onClick:()=>H(!1),style:{background:"none",border:"none",cursor:"pointer",fontSize:13,fontWeight:400,color:"var(--Grey-Muted, #808183)",fontFamily:"var(--default-font-family)",padding:"4px 10px",borderRadius:6,transition:"background 0.15s"},onMouseEnter:u=>{u.currentTarget.style.background="var(--grey-light, #e9e8e8a1)"},onMouseLeave:u=>{u.currentTarget.style.background="none"},children:"Cancel"})]}),m&&r&&!S&&!P&&e.jsxs("button",{type:"button",onClick:()=>{W(!1),b(!0)},style:{display:"flex",alignItems:"center",gap:6,marginTop:8,padding:0,border:"none",background:"transparent",cursor:"pointer",fontSize:13,fontWeight:400,color:"var(--Grey-Muted, #808183)",fontFamily:"var(--default-font-family)",transition:"color 0.15s"},children:[e.jsx(y.CornerDownRight,{size:20,color:"var(--Grey-Muted, #808183)",strokeWidth:1.5}),"Reply"]}),S&&e.jsxs("div",{style:{display:"flex",width:662,maxWidth:"100%",padding:"8px 12px 12px 12px",flexDirection:"column",justifyContent:"center",alignItems:"flex-start",gap:24,borderRadius:8,border:"1px solid var(--Grey-absent, #D9D9D9)",background:"var(--Grey-White, #FFF)",boxSizing:"border-box",marginTop:12},children:[e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8,width:"100%"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%"},children:[e.jsxs("span",{style:{fontSize:13,fontWeight:600,color:"var(--Grey-Muted, #808183)",fontFamily:"var(--default-font-family)",lineHeight:"normal"},children:["“"," ",((ie=t.author)==null?void 0:ie.name)||"Unknown"]}),e.jsx("button",{type:"button",onClick:()=>{w(""),b(!1)},style:{display:"flex",alignItems:"center",justifyContent:"center",background:"none",border:"none",cursor:"pointer",padding:0},children:e.jsx(y.X,{size:20,color:"var(--Grey-Muted, #808183)"})})]}),e.jsx("div",{style:{display:"flex",height:36,padding:16,alignItems:"center",gap:5,borderRadius:"0 8px 8px 8px",background:"var(--Grey-Strong, #2E3236)",boxSizing:"border-box",width:"100%"},children:e.jsx("span",{style:{color:"var(--Grey-White, #FFF)",fontSize:13,fontWeight:400,fontFamily:"var(--default-font-family)",lineHeight:"normal",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:Array.isArray(t.content)?t.content[0]:t.content})})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,width:"100%"},children:[e.jsx("input",{ref:a,value:v,onChange:u=>w(u.target.value),onKeyDown:u=>{u.key==="Enter"&&!u.shiftKey&&(u.preventDefault(),v.trim()&&(s==null||s({content:v.trim(),parentId:t.id}),w(""),b(!1))),u.key==="Escape"&&(w(""),b(!1))},autoFocus:!0,placeholder:"Add a reply",style:{flex:1,padding:"10px 12px",fontSize:13,fontWeight:400,color:"var(--text-ink, #1E2125)",fontFamily:"var(--default-font-family)",lineHeight:"160%",border:"none",background:"transparent",outline:"none",boxSizing:"border-box"}}),e.jsx("button",{type:"button",onClick:()=>{v.trim()&&(s==null||s({content:v.trim(),parentId:t.id}),w(""),b(!1))},disabled:!v.trim(),style:{display:"flex",height:28,padding:"8px 12px",justifyContent:"center",alignItems:"center",gap:8,fontSize:13,fontWeight:600,color:v.trim()?"var(--Grey-White, #FFF)":"var(--Grey-Muted, #808183)",background:v.trim()?"var(--Neutral-850, #272727)":"var(--grey-light, #e9e8e8a1)",border:"none",borderRadius:10,cursor:v.trim()?"pointer":"not-allowed",fontFamily:"var(--default-font-family)",lineHeight:"150%"},children:"Post"})]})]})]})]})},rn=({currentUser:t,onSubmit:n})=>{const[i,r]=p.useState(""),[s,o]=p.useState(!1),g=p.useRef(null),f=()=>{const c=i.trim();c&&(n==null||n(c),r(""))},m=c=>{c.key==="Enter"&&!c.shiftKey&&(c.preventDefault(),f())},k=(t==null?void 0:t.initials)||de(t==null?void 0:t.name),j=(t==null?void 0:t.color)||Se(t==null?void 0:t.role)||"#6B7C93",F=t==null?void 0:t.avatar;return e.jsxs("div",{style:{display:"flex",gap:16,alignItems:"flex-start"},children:[e.jsx(dt,{name:t==null?void 0:t.name,initials:k,color:j,avatar:F}),e.jsx("div",{style:{flex:1,padding:12,display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"flex-start",gap:24,borderRadius:8,border:s?"1px solid var(--Grey-Strong, #2E3236)":"1px solid var(--Grey-absent, #D9D9D9)",background:"var(--Grey-White, #FFF)",transition:"border-color 0.15s"},children:e.jsxs("div",{style:{display:"flex",alignItems:"flex-end",gap:8,width:"100%"},children:[e.jsx("textarea",{ref:g,value:i,onChange:c=>r(c.target.value),onFocus:()=>o(!0),onBlur:()=>o(!1),onKeyDown:m,placeholder:"Add feedback",rows:1,style:{flex:1,border:"none",outline:"none",resize:"none",fontSize:13,fontWeight:400,color:"var(--text-ink, #1E2125)",fontFamily:"var(--default-font-family)",lineHeight:"160%",background:"transparent",padding:0,minHeight:24}}),e.jsx("button",{type:"button",onClick:f,disabled:!i.trim(),style:{display:"flex",padding:"6px 16px",justifyContent:"center",alignItems:"center",fontSize:13,fontWeight:600,color:i.trim()?"var(--Grey-White, #FFF)":"var(--Grey-Muted, #808183)",background:i.trim()?"var(--Grey-Strong, #2E3236)":"var(--grey-light, #e9e8e8a1)",border:"none",borderRadius:6,cursor:i.trim()?"pointer":"not-allowed",fontFamily:"var(--default-font-family)",transition:"all 0.15s",flexShrink:0,lineHeight:"150%"},children:"Post"})]})})]})},ct=({comment:t,depth:n=0,isConsecutive:i=!1,onReply:r,onSendReply:s,onEdit:o,onDelete:g,onMenuClick:f})=>{const m=t.replies&&t.replies.length>0,k=!m;return e.jsxs(p.Fragment,{children:[e.jsx("div",{style:{paddingLeft:n>0?Math.min(n*32,128):0},children:e.jsx(sn,{comment:t,isReply:n>0,isConsecutive:i,onReply:r,onSendReply:s,onEdit:o,onDelete:g,onMenuClick:f,showReply:k})}),m&&t.replies.map(j=>e.jsx(ct,{comment:j,depth:n+1,onReply:r,onSendReply:s,onEdit:o,onDelete:g,onMenuClick:f},j.id))]})},ft=({comments:t=[],totalComments:n,children:i,onSendComment:r,onReply:s,onSendReply:o,onEdit:g,onDelete:f,onMenuClick:m,onMarkResolved:k,currentUser:j,isResolved:F=!1})=>{const[c,S]=p.useState([]),[b,v]=p.useState(!1),w=p.useMemo(()=>{const a=new Set(t.map(l=>l.id)),h=c.filter(l=>!a.has(l.id));return[...t,...h]},[t,c]);p.useEffect(()=>{const a=new Set(t.map(h=>h.id));S(h=>h.filter(l=>!a.has(l.id)))},[t]);const G=p.useMemo(()=>{if(!j)return{name:"You",initials:"YO",color:"#6B7C93"};const a=j.name||"You",h=j.initials||de(a),l=j.role&&String(j.role).toLowerCase(),E=j.color||Se(l)||"#6B7C93";return{...j,name:a,initials:h,color:E}},[j]),W=async({content:a,parentId:h})=>{if(o){v(!0);try{await o({content:a,parentId:h})}finally{v(!1)}}else{const l={id:`temp-${Date.now()}`,author:G,content:a,timestamp:"Just now",parentId:h,isOptimistic:!0};S(E=>[...E,l])}},D=async a=>{if(r){v(!0);try{await r(a)}finally{v(!1)}}else{const h={id:`temp-${Date.now()}`,author:G,content:a,timestamp:"Just now",isOptimistic:!0};S(l=>[...l,h])}},_=a=>{S(h=>h.map(l=>l.id===a.id?{...l,content:a.content,isEdited:!0}:l)),g==null||g(a)},P=a=>{S(h=>h.filter(l=>l.id!==a.id)),f==null||f(a)},H=p.useMemo(()=>{const a={};w.forEach(l=>{l.parentId&&(a[l.parentId]||(a[l.parentId]=[]),a[l.parentId].push(l))});const h=l=>({...l,replies:(a[l.id]||[]).map(h)});return w.filter(l=>!l.parentId).map(h)},[w]),A=n??w.length;return e.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"flex-start",background:"var(--Grey-White, #FFF)",width:"100%",fontFamily:"var(--default-font-family)"},children:[e.jsxs("div",{style:{display:"flex",height:40,paddingBottom:8,alignItems:"center",gap:8,alignSelf:"stretch"},children:[e.jsx(y.MessagesSquare,{size:24,color:"var(--rail-orange, #C98A5A)",strokeWidth:1.5}),e.jsx("span",{style:{fontSize:16,fontWeight:600,color:"var(--Grey-Strong, #2E3236)",textTransform:"uppercase",lineHeight:1.2},children:"Feedback & Guidance"})]}),e.jsx("div",{style:{width:"100%",height:1,background:"var(--Grey-absent, #D9D9D9)"}}),e.jsxs("div",{style:{display:"flex",gap:24,alignSelf:"stretch"},children:[e.jsxs("div",{style:{flex:1,minWidth:0},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:16,paddingTop:16,paddingBottom:8},children:[e.jsx("div",{style:{width:34,height:34,borderRadius:9999,background:"var(--surface-hover, #F3F7F7)",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:e.jsx(y.MessagesSquare,{style:{width:20,height:20,flexShrink:0},color:"var(--Grey-Strong, #2E3236)",strokeWidth:1.5})}),e.jsx("span",{style:{fontSize:15,fontWeight:500,color:"var(--Grey-Strong, #2E3236)"},children:"Feedback"}),e.jsxs("span",{style:{fontSize:13,fontWeight:400,color:"var(--Grey-Muted, #808183)",fontFamily:"var(--default-font-family)",lineHeight:"150%",marginLeft:"auto"},children:[A," Comment",A!==1?"s":""]}),F?e.jsxs("div",{style:{display:"inline-flex",height:32,padding:"12px 16px 12px 12px",justifyContent:"center",alignItems:"center",gap:8,borderRadius:10,background:"var(--Rail-Surface-2, #E3E1D7)",flexShrink:0},children:[e.jsx(y.Check,{size:16,color:"var(--Grey-Strong, #2E3236)",strokeWidth:2}),e.jsx("span",{style:{fontSize:13,fontWeight:500,color:"var(--Grey-Strong, #2E3236)",fontFamily:"var(--default-font-family)",lineHeight:"150%"},children:"Resolved"})]}):k?e.jsxs("button",{type:"button",onClick:k,style:{display:"flex",alignItems:"center",gap:8,padding:"8px 16px",fontSize:13,fontWeight:500,color:"var(--Grey-Strong, #2E3236)",background:"var(--Grey-White, #FFF)",border:"1px solid var(--Grey-absent, #D9D9D9)",borderRadius:20,cursor:"pointer",fontFamily:"var(--default-font-family)",transition:"background 0.15s",lineHeight:"150%",flexShrink:0},children:[e.jsx(y.CircleCheck,{size:16,color:"var(--Grey-Strong, #2E3236)",strokeWidth:1.5}),"Mark as Resolved"]}):null]}),w.length>0&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:0,marginBottom:24,maxHeight:600,overflowY:w.length>6?"auto":"visible"},children:H.map((a,h)=>{var d,T;const l=h>0?H[h-1]:null,E=((d=l==null?void 0:l.author)==null?void 0:d.name)||(l==null?void 0:l.author_name),O=((T=a.author)==null?void 0:T.name)||a.author_name,Y=l&&E===O&&(!l.replies||l.replies.length===0);return e.jsx(ct,{comment:a,depth:0,isConsecutive:!!Y,onReply:s,onSendReply:W,onEdit:_,onDelete:P,onMenuClick:m},a.id)})}),w.length>0&&e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,marginBottom:16,marginLeft:48},children:[e.jsx(y.Info,{size:16,color:"var(--Grey-Muted, #808183)"}),e.jsx("span",{style:{color:"var(--Grey-Muted, #808183)",fontSize:13,fontStyle:"normal",fontWeight:400,lineHeight:"normal"},children:"Comments can be edited within 15 minutes."})]}),b&&e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"8px 0"},children:[e.jsx("div",{style:{width:16,height:16,border:"2px solid var(--Grey-absent, #D9D9D9)",borderTopColor:"var(--Grey-Strong, #2E3236)",borderRadius:"50%",animation:"spin 0.8s linear infinite"}}),e.jsx("span",{style:{fontSize:13,color:"var(--Grey-Muted, #808183)",fontFamily:"var(--default-font-family)"},children:"Sending..."}),e.jsx("style",{children:"@keyframes spin { to { transform: rotate(360deg); } }"})]}),e.jsx(rn,{currentUser:G,onSubmit:D})]}),e.jsx("div",{style:{flex:1,minWidth:0},children:i})]})]})},nt=({children:t,size:n=28,onClick:i,title:r})=>{const[s,o]=p.useState(!1);return e.jsx("div",{title:r,onClick:i,onMouseEnter:()=>o(!0),onMouseLeave:()=>o(!1),style:{display:"flex",alignItems:"center",justifyContent:"center",width:n,height:n,borderRadius:9999,background:s?"var(--surface-hover, #F3F7F7)":"transparent",cursor:"pointer",flexShrink:0,transition:"background 0.15s"},children:t})},on=t=>{const n=Math.floor(t/6e4),i=Math.floor(t%6e4/1e3);return`${n.toString().padStart(2,"0")}:${i.toString().padStart(2,"0")}`},ln=({item:t,isLast:n,onPlayEvidence:i,onShowInTranscript:r,timelinePlaying:s,currentTimeSeconds:o})=>{var c;const g=(c=t.signal_refs)==null?void 0:c.map(S=>{const b=S.display_name||S.signal_key||"",v=S.confidence!=null?` (${Math.round(S.confidence*100)}%)`:"";return b+v}).join(", "),f=t.start_ms??t.startMs,m=t.end_ms??t.endMs,k=f!=null,j=(o??0)*1e3,F=s&&k&&j>=f&&j<=(m??f+5e3);return e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4,padding:"12px 0",borderBottom:n?"none":"1px solid var(--Grey-absent, #D9D9D9)"},children:[e.jsx("span",{style:{alignSelf:"stretch",fontSize:14,fontWeight:400,color:"var(--Grey-Strong, #2E3236)",lineHeight:"150%"},children:t.title||t.detail||""}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[g&&e.jsx("span",{style:{fontSize:14,fontWeight:400,color:"var(--Grey-Muted, #808183)",fontFamily:"var(--default-font-family)",lineHeight:"150%",flex:1,minWidth:0},children:g}),k&&e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,flexShrink:0},children:[e.jsx(nt,{size:28,title:F?"Pause":"Play evidence",onClick:()=>i==null?void 0:i({start_ms:f,end_ms:m}),children:F?e.jsx(y.PauseCircle,{size:17,color:"var(--Grey-Strong, #2E3236)",strokeWidth:1}):e.jsx(y.PlayCircle,{size:17,color:"var(--Grey-Muted, #808183)",strokeWidth:1})}),e.jsx(nt,{size:28,title:"Show in transcript",onClick:()=>r==null?void 0:r(f),children:e.jsx(y.ScrollText,{size:16,color:"#808183",strokeWidth:1.5})}),e.jsx("span",{style:{fontSize:13,fontWeight:400,color:"var(--Grey-Muted, #808183)",lineHeight:1.2,whiteSpace:"nowrap"},children:on(f)})]})]})]})},pt=({items:t=[],guidanceCount:n,loading:i=!1,onPlayEvidence:r,onShowInTranscript:s,timelinePlaying:o=!1,currentTimeSeconds:g=0})=>{const f=n??t.length;return e.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"stretch",width:"100%"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:16,paddingTop:16,paddingBottom:8},children:[e.jsx("div",{style:{width:34,height:34,borderRadius:9999,background:"var(--surface-hover, #F3F7F7)",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:e.jsx(y.Lightbulb,{style:{width:20,height:20,flexShrink:0},color:"var(--Grey-Strong, #2E3236)",strokeWidth:1.5})}),e.jsx("span",{style:{fontSize:15,fontWeight:500,color:"var(--Grey-Strong, #2E3236)"},children:"Guidance"}),e.jsxs("span",{style:{fontSize:13,fontWeight:400,color:"var(--Grey-Muted, #808183)",fontFamily:"var(--default-font-family)",lineHeight:"150%",marginLeft:"auto"},children:[f," Item",f!==1?"s":""]})]}),t.map((m,k)=>e.jsx(ln,{item:m,isLast:k===t.length-1,onPlayEvidence:r,onShowInTranscript:s,timelinePlaying:o,currentTimeSeconds:g},k))]})},ne=({text:t,children:n})=>{const[i,r]=p.useState(!1),s=p.useRef(null),[o,g]=p.useState({top:0,left:0});if(!t)return n;const f=()=>{if(s.current){const m=s.current.getBoundingClientRect();g({top:m.top-2,left:m.left+m.width/2})}r(!0)};return e.jsxs("div",{ref:s,style:{position:"relative",display:"inline-flex"},onMouseEnter:f,onMouseLeave:()=>r(!1),children:[n,i&&e.jsx("div",{style:{position:"fixed",top:o.top,left:o.left,transform:"translate(-50%, -100%)",display:"flex",padding:10,alignItems:"center",borderRadius:4,border:"1px solid var(--Grey-absent, #D9D9D9)",background:"var(--Grey-Strong, #2E3236)",zIndex:9999,pointerEvents:"none",whiteSpace:"nowrap"},children:e.jsx("span",{style:{color:"#FFF",fontSize:12,fontWeight:400,lineHeight:"normal"},children:t})})]})},an=[{key:"overview",label:"Overview"},{key:"coaching",label:"Coaching Summary"},{key:"signals",label:"Signals & Recording"},{key:"comments",label:"Feedback"}],dn=({title:t="Wheel Stud Replacement Enquiry",onBack:n,data:i,coachingData:r,coachingLoading:s=!1,audioUrl:o,audioRef:g,currentTimeSeconds:f,timelinePlaying:m,playbackRate:k,timelineSegments:j,onSeek:F,onTogglePlay:c,onSeekBack:S,onSeekForward:b,onSetPlaybackRate:v,agentName:w,agentFullName:G,customerName:W,customerFullName:D,transcript:_,activeTurnIndex:P,turnObservations:H,highlightedTurns:A,onTurnPlayPause:a,onPlayEvidence:h,onHighlightTurns:l,callPurpose:E,classification:O,outcomeQuality:Y,resolutionOutcome:d,customerIntent:T,interactionId:q,moreDetails:K,compassScore:ce,compassMaxScore:fe=10,predictedCsat:ie,predictedLabel:u="Predicted Objective",compassLegends:Q,customerSessions:gt,customerSessionCount:ht,onSessionClick:ke,onViewAllSessions:we,prevSessionDesc:ut,prevSessionDisabled:se=!1,nextSessionDesc:yt,nextSessionDisabled:re=!1,onPreviousSession:Ce,onNextSession:Fe,comments:De=[],guidance:We=[],currentUser:xt,onSendComment:mt,onSendReply:vt,onReply:bt,onEdit:jt,onDelete:St,onMenuClick:kt,onMarkResolved:wt,commentsResolved:Ct})=>{var Ke,Ve;const[pe,Ie]=p.useState("overview"),[Ft,ze]=p.useState(new Set),[Ge,ge]=p.useState(!1),[Me,_e]=p.useState(null),[Ee,Re]=p.useState(!1),[Te,Dt]=p.useState(0),J=p.useRef(null),he=p.useRef(null),ue=p.useRef(null),ye=p.useRef(null),xe=p.useRef(null),Wt={overview:he,coaching:ue,signals:ye,comments:xe},me=p.useRef(null),ve=p.useRef(!1);p.useEffect(()=>{const x=me.current;if(!x)return;const I=["overview","coaching","signals","comments"],z=[he,ue,ye,xe],B=(U=>{let N=U.parentElement;for(;N;){const{overflow:ae,overflowY:Ye}=window.getComputedStyle(N);if(/(auto|scroll)/.test(ae+Ye))return N;N=N.parentElement}return null})(x),Z=()=>{if(ve.current)return;let U=I[0];for(let N=z.length-1;N>=0;N--){const ae=z[N].current;if(!ae)continue;if(ae.getBoundingClientRect().top<=150){U=I[N];break}}Ie(U)};return x.addEventListener("scroll",Z,{passive:!0}),B&&B!==x&&B.addEventListener("scroll",Z,{passive:!0}),window.addEventListener("scroll",Z,{passive:!0,capture:!0}),()=>{x.removeEventListener("scroll",Z),B&&B!==x&&B.removeEventListener("scroll",Z),window.removeEventListener("scroll",Z,{capture:!0})}},[]);const He=p.useRef(null),It=x=>{var z;Ie(x),ve.current=!0,He.current=x;const I=(z=Wt[x])==null?void 0:z.current;if(I){const V=me.current;if(V&&V.scrollHeight>V.clientHeight){const B=V.getBoundingClientRect().top,U=I.getBoundingClientRect().top-B+V.scrollTop-16;V.scrollTo({top:U,behavior:"smooth"})}else{const B=I.getBoundingClientRect().top+window.scrollY-120;window.scrollTo({top:B,behavior:"smooth"})}}setTimeout(()=>{ve.current=!1,He.current=null},1200)},Ae=gt||[],Le=x=>{var z;const I=x/1e3;(z=J.current)!=null&&z.scrollToTranscript&&J.current.scrollToTranscript(I)},Be=x=>{var I;if(h)h(x);else{const z=x.start_ms??x.startMs;if(z!=null&&((I=J.current)!=null&&I.seekTo)){J.current.seekTo(z/1e3),Re(!0),Dt(z/1e3);const B=(x.end_ms??x.endMs??z+5e3)-z;setTimeout(()=>Re(!1),B)}}},zt=x=>{l&&l(x)},Gt=x=>{ze(I=>{const z=new Set(I);return z.has(x)?z.delete(x):z.add(x),z})},Mt=(i==null?void 0:i.blocks)||[],X=x=>{var I;return((I=Mt.find(z=>z.block_id===x))==null?void 0:I.payload)||{}},$=X("interaction-metadata"),ee=X("interaction-context"),oe=X("interaction-signals"),Pe=X("interaction-outcome-lift"),_t=X("interaction-dimensions").dimensions||[],Et=ee.call_purpose||{},Rt=ee.classification||{},$e={duration_seconds:156,message_count:25,...$},Oe={interaction_driver:"General Information",interaction_direction:"inbound",...Et},Tt={interaction_paradigm:"Informational",...Rt},Ht={p_expected:.94,p_full:.83,lift_raw:-.11,lift:.043,interpretation:{lift_band:"positive"},...Pe},At=((Ke=Pe.driver_signal_keys)==null?void 0:Ke.map(x=>x.replace(/^sig\./,"").replace(/_/g," ")))||["customer needs fully addressed","call flow expectations set","Opening expectations set","Active listening demonstrated","Resolution confirmed"],Lt=r||{one_liner:"David provided the customer with information on wheel stud replacement and pricing, but did not secure an appointment.",context:"The customer was seeking information on wheel stud replacement for a 2013 Chevy Bolt and was unsure about doing the repair themselves.",strengths:[{text:"Anthony effectively scheduled the appointment and confirmed the details clearly.",quote:"Alright. That is all set up for Saturday, the twenty eighth, at 12:00."},{text:"Handled customer objections well by explaining the need for a separate appointment for alignment.",quote:"I don't have the alignment changeover the weekend. So I would have to set up a separate appointment for the alignment."},{text:"Demonstrated courtesy and professionalism throughout the call.",quote:"Have a great day."}],improvements:[{text:"Close the loop by restating the plan and confirming next steps to ensure customer certainty.",quote:"Alright. That is all set up for Saturday, the twenty eighth, at 12:00."},{text:"Frame solutions positively by leading with what can be done rather than limitations.",quote:"I don't have the alignment changeover the weekend."}],overall:"effective"},Bt=(Ve=oe==null?void 0:oe.signals)!=null&&Ve.length?oe:{present_count:9,total_signals_evaluated:146,signals:[{key:"price_estimate_provided",display_name:"Price Estimate Provided",observations:[{key:"obs1",reason:"Evidence shows a price estimate or quote was provided.",evidence:[{start_ms:92e3,end_ms:97e3,text:"From Casper, you're probably looking at, like, a half hour labor plus a stud, so you'd probably be somewhere around $90 or something.",turn_ids:[8]}]}]},{key:"fee_or_cost_discussed",display_name:"Fee or Cost Discussed",observations:[{key:"obs2",reason:"Agent discussed pricing details with the customer."}]},{key:"engagement_budget",display_name:"Engagement Budget Discussed",observations:[{key:"obs3a",reason:"Budget expectations were set."},{key:"obs3b",reason:"Customer confirmed budget range."}]},{key:"projected_revenue",display_name:"Projected Revenue Discussed",observations:[{key:"obs4a",reason:"Revenue projection shared."},{key:"obs4b",reason:"Timeline for revenue discussed."},{key:"obs4c",reason:"Quarterly targets mentioned."}]},{key:"market_analysis",display_name:"Market Analysis Completed",observations:[{key:"obs5a",reason:"Market analysis referenced."},{key:"obs5b",reason:"Competitive landscape discussed."},{key:"obs5c",reason:"Market trends mentioned."},{key:"obs5d",reason:"Regional analysis provided."}]},{key:"target_audience",display_name:"Target Audience Defined",observations:[{key:"obs6a",reason:"Target audience identified."},{key:"obs6b",reason:"Demographics discussed."},{key:"obs6c",reason:"Audience segmentation reviewed."},{key:"obs6d",reason:"Persona mapping completed."},{key:"obs6e",reason:"Channel preferences noted."}]},{key:"concept_approval",display_name:"Concept Approval Received",observations:[{key:"obs7a",reason:"Concept approved by stakeholder."},{key:"obs7b",reason:"Feedback incorporated."},{key:"obs7c",reason:"Sign-off confirmed."},{key:"obs7d",reason:"Revisions requested."},{key:"obs7e",reason:"Final version accepted."},{key:"obs7f",reason:"Timeline approved."}]},{key:"prototype_developed",display_name:"Prototype Developed",observations:[{key:"obs8a",reason:"Prototype shared."},{key:"obs8b",reason:"Testing initiated."},{key:"obs8c",reason:"Feedback collected."},{key:"obs8d",reason:"Iterations completed."},{key:"obs8e",reason:"Usability tested."},{key:"obs8f",reason:"Design finalized."},{key:"obs8g",reason:"Stakeholder demo done."}]},{key:"user_testing",display_name:"User Testing Scheduled",observations:[{key:"obs9a",reason:"Testing sessions planned."},{key:"obs9b",reason:"Participants recruited."},{key:"obs9c",reason:"Test scripts prepared."},{key:"obs9d",reason:"Environment set up."},{key:"obs9e",reason:"Accessibility testing included."},{key:"obs9f",reason:"Results framework defined."},{key:"obs9g",reason:"Timeline confirmed."},{key:"obs9h",reason:"Backup plan discussed."}]}]},Ne=We.length?We:[{title:"Close the loop: Restate the plan and confirm what happens next so the customer leaves with certainty",signal_refs:[{display_name:"Next Step Unclear",confidence:.5}],start_ms:18e3,end_ms:23e3},{title:"Close the call properly: Summarize what was done and offer additional help",signal_refs:[{display_name:"Call Closing Stated",confidence:.55}],start_ms:89e3,end_ms:94e3},{title:"Frame solutions positively: Lead with what you can do rather than what you can't",signal_refs:[{display_name:"Positive Framing or Solution Orientation",confidence:.5}],start_ms:107e3,end_ms:112e3},{title:"Show expertise: Explain relevant products, policies or options with confidence rather than transfer",signal_refs:[{display_name:"Product Knowledge Demonstrated",confidence:.5}],start_ms:116e3,end_ms:121e3}],be=w||$.agent_name||$.agent||ee.agent_name||"Agent",Pt=G||$.agent_full_name||$.agent_name||be,te=W||$.customer_name||$.customer||ee.customer_name||"Customer",qe=D||$.customer_full_name||$.customer_name||te,je=ht??Ae.length,le=$.created_dt||(i==null?void 0:i.created_dt)||ee.created_dt||"",$t=le?new Date(/Z$|[+-]\d{2}:\d{2}$/.test(le)?le:le+"Z").toLocaleString():"",Ot=Oe.interaction_direction==="inbound"?"Inbound":"Outbound";return e.jsxs("div",{style:{display:"flex",flexDirection:"column",width:"100%",height:"100%",background:"var(--Grey-White, #FFF)"},children:[e.jsxs("div",{style:{position:"sticky",top:0,zIndex:20,background:"var(--Grey-White, #FFF)"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12,padding:"24px 24px 0"},children:[e.jsx("button",{onClick:n,style:{display:"flex",alignItems:"center",justifyContent:"center",background:"none",border:"none",cursor:"pointer",padding:0,flexShrink:0},children:e.jsx(y.ArrowLeft,{size:24,color:"var(--Grey-Strong, #2E3236)"})}),e.jsx("div",{style:{width:1,height:28,background:"var(--Base-absent, #D9D9D9)"}}),e.jsx("h1",{style:{color:"var(--Grey-Strong, #2E3236)",fontSize:24,fontStyle:"normal",fontWeight:400,lineHeight:"normal",margin:0,flex:1},children:t}),(Ce||Fe)&&e.jsxs("div",{style:{display:"flex",alignItems:"center",flexShrink:0},children:[e.jsx(ne,{text:ut,children:e.jsxs("button",{onClick:se?void 0:Ce,disabled:se,style:{display:"flex",alignItems:"center",gap:6,padding:"4px 12px",background:"none",border:"none",cursor:se?"default":"pointer",opacity:se?.4:1},children:[e.jsx(y.ArrowLeft,{size:16,color:"var(--Neutral-800, #323232)",strokeWidth:1.5}),e.jsx("span",{style:{color:"var(--Neutral-800, #323232)",fontSize:13,fontWeight:400,lineHeight:"24px",fontFamily:"var(--default-font-family)",whiteSpace:"nowrap"},children:"Previous Session"})]})}),e.jsx("div",{style:{width:1,height:20,background:"var(--Grey-absent, #D9D9D9)",flexShrink:0}}),e.jsx(ne,{text:yt,children:e.jsxs("button",{onClick:re?void 0:Fe,disabled:re,style:{display:"flex",alignItems:"center",gap:6,padding:"4px 12px",background:"none",border:"none",cursor:re?"default":"pointer",opacity:re?.4:1},children:[e.jsx("span",{style:{color:"var(--Neutral-800, #323232)",fontSize:13,fontWeight:400,lineHeight:"24px",fontFamily:"var(--default-font-family)",whiteSpace:"nowrap"},children:"Next Session"}),e.jsx(y.ArrowRight,{size:16,color:"var(--Neutral-800, #323232)",strokeWidth:1.5})]})})]})]}),e.jsx("div",{style:{display:"flex",alignItems:"flex-start",background:"var(--Grey-White, #FFF)",borderBottom:"1px solid var(--Grey-Faint, #ACADAD)",padding:"0 24px",marginTop:8},children:an.map(x=>e.jsx("button",{onClick:()=>It(x.key),style:{display:"flex",padding:16,alignItems:"center",gap:10,background:"none",border:"none",borderBottom:pe===x.key?"3px solid var(--Grey-Strong, #2E3236)":"3px solid transparent",cursor:"pointer",fontSize:15,fontWeight:pe===x.key?500:400,color:pe===x.key?"var(--Grey-Strong, #2E3236)":"var(--Grey-Muted, #808183)",whiteSpace:"nowrap",transition:"border-color 0.2s ease, color 0.2s ease"},children:x.label},x.key))})]}),e.jsxs("div",{ref:me,style:{padding:24,flex:1,overflowY:"auto"},children:[e.jsxs("div",{ref:he,style:{display:"flex",flexDirection:"column",justifyContent:"flex-end",alignItems:"flex-start",gap:24,alignSelf:"stretch"},children:[e.jsxs("div",{style:{display:"flex",height:40,alignItems:"center",gap:16,alignSelf:"stretch"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,flex:1},children:[e.jsx(y.ClipboardList,{size:24,color:"var(--rail-orange, #C98A5A)",strokeWidth:2}),e.jsx("span",{style:{fontSize:16,fontWeight:600,color:"var(--Grey-Strong, #2E3236)",lineHeight:1.2,textTransform:"uppercase"},children:"Overview"})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:16,flexShrink:0},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,padding:"8px 0"},children:[e.jsx(y.CalendarDays,{size:16,color:"var(--Grey-Muted, #808183)",strokeWidth:1.5}),e.jsx("span",{style:{fontSize:13,fontWeight:400,color:"var(--Grey-Strong, #2E3236)",fontFamily:"var(--font-sans)",lineHeight:1.2},children:$t})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,padding:"8px 0"},children:[e.jsx(y.PhoneIncoming,{size:16,color:"var(--Grey-Muted, #808183)",strokeWidth:1.5}),e.jsx("span",{style:{fontSize:13,fontWeight:400,color:"var(--Grey-Strong, #2E3236)",fontFamily:"var(--font-sans)",lineHeight:1.2},children:Ot})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:16,paddingLeft:16,borderLeft:"1px solid var(--Grey-absent, #D9D9D9)"},children:[e.jsx(ne,{text:Pt,children:e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,padding:"8px 0",cursor:"pointer"},children:[e.jsx(y.Headset,{size:16,color:"var(--Grey-Muted, #808183)",strokeWidth:1.5}),e.jsx("span",{style:{fontSize:13,fontWeight:400,color:"var(--Grey-Strong, #2E3236)",fontFamily:"var(--font-sans)",lineHeight:1.2},children:be})]})}),e.jsx(y.Repeat,{size:16,color:"var(--color-input-border, #ACACAD)",strokeWidth:1.5}),je>1?e.jsxs("div",{style:{position:"relative"},children:[e.jsx(ne,{text:qe,children:e.jsxs("button",{onClick:()=>ge(x=>!x),style:{display:"flex",alignItems:"center",gap:4,padding:"8px 0",background:"none",border:"none",cursor:"pointer"},children:[e.jsx(y.CircleUser,{size:16,color:"var(--Grey-Muted, #808183)",strokeWidth:1.5}),e.jsxs("span",{style:{fontSize:13,fontWeight:400,color:"var(--Grey-Strong, #2E3236)",lineHeight:1.2},children:[te," (",je," Sessions)"]}),Ge?e.jsx(y.ChevronUp,{size:16,color:"var(--Grey-Muted, #808183)",strokeWidth:1.5}):e.jsx(y.ChevronDown,{size:16,color:"var(--Grey-Muted, #808183)",strokeWidth:1.5})]})}),Ge&&e.jsxs("div",{style:{position:"absolute",top:"100%",right:0,marginTop:4,width:264,background:"var(--Grey-White, #FFF)",borderRadius:4,border:"1px solid var(--Grey-absent, #D9D9D9)",boxShadow:"0 4px 16px rgba(0,0,0,0.12)",zIndex:50,overflow:"hidden"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:8,padding:16},children:[e.jsx(y.CircleUser,{size:16,color:"var(--Grey-Muted, #808183)",strokeWidth:1.5,style:{marginTop:2,flexShrink:0}}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4},children:[e.jsx("span",{style:{fontSize:16,fontWeight:600,color:"var(--Grey-Strong, #2E3236)",lineHeight:1},children:te}),e.jsxs("span",{style:{fontSize:13,fontWeight:400,color:"var(--Grey-Muted, #808183)",lineHeight:1},children:[je," Sessions in past"]})]})]}),Ae.slice(0,5).map((x,I)=>e.jsxs("div",{onClick:()=>{ke&&ke(x),ge(!1)},onMouseEnter:()=>_e(I),onMouseLeave:()=>_e(null),style:{display:"flex",width:264,padding:"12px 16px",justifyContent:"space-between",alignItems:"center",background:Me===I?"var(--surface-hover, #F3F7F7)":"var(--Grey-White, #FFF)",borderTop:"1px solid var(--Grey-absent, #D9D9D9)",cursor:"pointer",boxSizing:"border-box",transition:"background 0.15s"},children:[e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:12},children:[e.jsx("span",{style:{fontSize:13,fontWeight:400,color:"var(--Grey-Strong, #2E3236)",lineHeight:1},children:x.title}),e.jsx("span",{style:{fontSize:12,fontWeight:400,color:"var(--Grey-Muted, #808183)",lineHeight:1},children:x.date})]}),Me===I&&e.jsx(y.ExternalLink,{size:16,color:"var(--Grey-Muted, #808183)",strokeWidth:1,style:{flexShrink:0}})]},x.id||I)),e.jsx("div",{style:{padding:16,borderTop:"1px solid var(--Grey-absent, #D9D9D9)",display:"flex",justifyContent:"center"},children:e.jsxs("button",{onClick:()=>{we&&we(),ge(!1)},style:{display:"flex",height:32,padding:"16px 16px 16px 12px",justifyContent:"center",alignItems:"center",gap:6,background:"var(--Grey-White, #FFF)",border:"1px solid var(--Grey-absent, #D9D9D9)",borderRadius:10,cursor:"pointer"},children:[e.jsx(y.History,{size:16,color:"var(--Grey-Muted, #808183)",strokeWidth:1.5}),e.jsx("span",{style:{fontSize:14,fontWeight:600,color:"var(--Grey-Strong, #2E3236)"},children:"View All Sessions"})]})})]})]}):e.jsx(ne,{text:qe,children:e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:4,padding:"8px 0",cursor:"pointer"},children:[e.jsx(y.CircleUser,{size:16,color:"var(--Grey-Muted, #808183)",strokeWidth:1.5}),e.jsx("span",{style:{fontSize:13,fontWeight:400,color:"var(--Grey-Strong, #2E3236)",lineHeight:1.2},children:te})]})})]})]})]}),e.jsxs("div",{style:{display:"flex",alignItems:"stretch",gap:24,alignSelf:"stretch"},children:[e.jsx("div",{style:{flex:1,minWidth:0,display:"flex"},children:e.jsx(at,{score:ce??0,maxScore:5,predictedScore:ie??0,predictedLabel:u,legends:Q})}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"stretch",justifyContent:"flex-end",gap:24,flex:1,minWidth:0},children:[e.jsx(rt,{meta:$e,callPurpose:E||Oe,classification:O||Tt,outcomeQuality:Y||"Neutral",dimensions:_t,resolutionOutcome:d,customerIntent:T,interactionId:q??$.interaction_id,moreDetails:K}),e.jsx(ot,{outcomeLift:Ht,driverLabels:At})]})]})]}),e.jsx("div",{ref:ue,style:{paddingTop:24},children:e.jsx(st,{data:s?null:Lt,loading:s})}),e.jsxs("div",{ref:ye,style:{display:"flex",flexDirection:"column",gap:16,alignSelf:"stretch",paddingTop:24},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[e.jsx(y.FileSignal,{size:24,color:"#C98A5A",strokeWidth:2}),e.jsx("span",{style:{fontSize:16,fontWeight:600,color:"var(--Grey-Strong, #2E3236)",lineHeight:1.2,textTransform:"uppercase"},children:"Signals & Recording"})]}),e.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:24,alignSelf:"stretch",paddingTop:16,borderTop:"1px solid #D9D9D9"},children:[e.jsx("div",{style:{flex:1,minWidth:0},children:e.jsx(lt,{signals:Bt,expandedSignals:Ft,toggleSignal:Gt,playEvidence:Be,highlightTurns:zt,onShowInTranscript:Le,timelinePlaying:m||Ee,currentTimeSeconds:f??Te})}),e.jsx("div",{style:{flex:1,minWidth:0},children:e.jsx(it.UpdatedInteractionRecording,{ref:J,audioUrl:o,durationSeconds:$e.duration_seconds,audioRef:g,agentName:be,customerName:te,currentTimeSeconds:f,timelinePlaying:m,playbackRate:k,timelineSegments:j,onSeek:F,onTogglePlay:c,onSeekBack:S,onSeekForward:b,onSetPlaybackRate:v,transcript:_,activeTurnIndex:P,turnObservations:H,highlightedTurns:A,onTurnPlayPause:a,setExpandedSignals:ze})})]})]}),e.jsx("div",{ref:xe,style:{paddingTop:24},children:e.jsx(ft,{comments:De,totalComments:De.length,currentUser:xt,onSendComment:mt||(()=>{}),onSendReply:vt||(()=>{}),onReply:bt||(()=>{}),onEdit:jt||(()=>{}),onDelete:St||(()=>{}),onMenuClick:kt||(()=>{}),onMarkResolved:wt||(()=>{}),isResolved:Ct,children:e.jsx(pt,{items:Ne,guidanceCount:Ne.length,onPlayEvidence:Be,onShowInTranscript:Le,timelinePlaying:m||Ee,currentTimeSeconds:f??Te})})})]})]})};exports.UpdatedInteractionRecording=it.UpdatedInteractionRecording;exports.UpdatedCoachingSynthesisCard=st;exports.UpdatedCompassScore=at;exports.UpdatedGuidance=pt;exports.UpdatedInteractionContext=rt;exports.UpdatedInteractionDetails=dn;exports.UpdatedInteractionScores=ot;exports.UpdatedInteractionSignals=lt;exports.UpdatedThreads=ft;
|
|
17
17
|
//# sourceMappingURL=UpdatedInteractionDetails.cjs.js.map
|