chordia-ui 3.9.0 → 3.9.2
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/DataTable2.cjs.js +1 -1
- package/dist/DataTable2.cjs.js.map +1 -1
- package/dist/DataTable2.es.js +611 -604
- package/dist/DataTable2.es.js.map +1 -1
- package/dist/PerformancePanel.cjs.js +1 -1
- package/dist/PerformancePanel.cjs.js.map +1 -1
- package/dist/PerformancePanel.es.js +1068 -816
- package/dist/PerformancePanel.es.js.map +1 -1
- package/dist/SupervisorSelect.cjs.js +2 -0
- package/dist/SupervisorSelect.cjs.js.map +1 -0
- package/dist/SupervisorSelect.es.js +352 -0
- package/dist/SupervisorSelect.es.js.map +1 -0
- package/dist/components/Signals.cjs.js +1 -1
- package/dist/components/Signals.cjs.js.map +1 -1
- package/dist/components/Signals.es.js +273 -318
- package/dist/components/Signals.es.js.map +1 -1
- package/dist/components/UpdatedInteractionDetails.cjs.js +3 -3
- package/dist/components/UpdatedInteractionDetails.cjs.js.map +1 -1
- package/dist/components/UpdatedInteractionDetails.es.js +98 -92
- package/dist/components/UpdatedInteractionDetails.es.js.map +1 -1
- package/dist/components/performance.cjs.js +1 -1
- package/dist/components/performance.cjs.js.map +1 -1
- package/dist/components/performance.es.js +116 -349
- package/dist/components/performance.es.js.map +1 -1
- package/dist/components/reports.cjs.js +2 -2
- package/dist/components/reports.cjs.js.map +1 -1
- package/dist/components/reports.es.js +122 -141
- package/dist/components/reports.es.js.map +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.es.js +1 -1
- package/dist/pages/interactionDetails.cjs.js +2 -2
- package/dist/pages/interactionDetails.cjs.js.map +1 -1
- package/dist/pages/interactionDetails.es.js +130 -124
- package/dist/pages/interactionDetails.es.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Signals/SignalDetailsPage.jsx +2 -29
- package/src/components/Signals/SignalsListPage.jsx +2 -24
- package/src/components/UpdatedInteractionDetails/UpdatedCoachingSynthesisCard.jsx +8 -1
- package/src/components/data/DataTable2.jsx +19 -5
- package/src/components/pages/interactionDetails/CoachingSynthesisCard.jsx +8 -1
- package/src/components/performance/PerformanceDetailsPage.jsx +230 -75
- package/src/components/performance/PerformancePanel.jsx +42 -45
- package/src/components/performance/index.js +27 -0
- package/src/components/performance/performanceApiMap.js +133 -0
- package/src/components/performance/performanceMetrics.js +63 -0
- package/src/components/performance/performanceRangeFormat.js +92 -0
- package/src/components/performance/performanceSparkline.js +52 -0
- package/src/components/reports/ReportsList.jsx +2 -25
|
@@ -7,11 +7,11 @@
|
|
|
7
7
|
0%, 100% { opacity: 0.4; }
|
|
8
8
|
50% { opacity: 1; }
|
|
9
9
|
}
|
|
10
|
-
`,document.head.appendChild(t)}function _n({overall:t}){const n={size:14,color:B.strong,strokeWidth:1.5};switch(t){case"strong":case"effective":return e.jsx(a.ArrowUp,{...n});case"needs_improvement":return e.jsx(a.ArrowDown,{...n});case"mixed":return e.jsx(a.ArrowLeftRight,{...n});default:return e.jsx(a.ThumbsUp,{...n})}}function En({overall:t}){const n=Hn[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:B.strong,fontFamily:"var(--font-sans)",lineHeight:1.2},children:"Overall:"}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6},children:[e.jsx(_n,{overall:t}),e.jsx("span",{style:{fontSize:13,fontWeight:600,color:B.strong,fontFamily:"var(--font-sans)",lineHeight:1.2},children:n})]})]})}function An({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:B.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:B.quoteLine}}),e.jsxs("div",{style:{fontSize:14,fontWeight:400,color:B.quoteText,fontFamily:"var(--font-sans)",lineHeight:1.5},children:["“",i,"”"]})]})]})}function bt({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:B.iconBg,flexShrink:0},children:t}),e.jsx("span",{style:{fontSize:16,fontWeight:600,color:B.strong,fontFamily:"var(--font-sans)",lineHeight:"normal"},children:n})]}),e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:24},children:i.map((l,o)=>e.jsx(
|
|
10
|
+
`,document.head.appendChild(t)}function _n({overall:t}){const n={size:14,color:B.strong,strokeWidth:1.5};switch(t){case"strong":case"effective":return e.jsx(a.ArrowUp,{...n});case"needs_improvement":return e.jsx(a.ArrowDown,{...n});case"mixed":return e.jsx(a.ArrowLeftRight,{...n});default:return e.jsx(a.ThumbsUp,{...n})}}function En({overall:t}){const n=Hn[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:B.strong,fontFamily:"var(--font-sans)",lineHeight:1.2},children:"Overall:"}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6},children:[e.jsx(_n,{overall:t}),e.jsx("span",{style:{fontSize:13,fontWeight:600,color:B.strong,fontFamily:"var(--font-sans)",lineHeight:1.2},children:n})]})]})}function An(t){if(t==null)return null;const n=String(t).trim();return!n||n.toLowerCase()==="null"||n.toLowerCase()==="undefined"?null:n}function Tn({item:t}){const n=typeof t=="string"?t:(t==null?void 0:t.text)||"",i=An(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:B.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:B.quoteLine}}),e.jsxs("div",{style:{fontSize:14,fontWeight:400,color:B.quoteText,fontFamily:"var(--font-sans)",lineHeight:1.5},children:["“",i,"”"]})]})]})}function bt({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:B.iconBg,flexShrink:0},children:t}),e.jsx("span",{style:{fontSize:16,fontWeight:600,color:B.strong,fontFamily:"var(--font-sans)",lineHeight:"normal"},children:n})]}),e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:24},children:i.map((l,o)=>e.jsx(Tn,{item:l},o))})]})}const Gt=({data:t,loading:n,error:i})=>{var f,p;if(u.useEffect(()=>{Rn()},[]),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:B.muted,fontWeight:500,textAlign:"center"},children:"Synthesizing coaching summary..."})]})]});if(i)return e.jsx("div",{style:{fontSize:14,color:B.muted},children:"Unable to generate coaching summary."});if(!t)return null;const l=t.strengths||[],o=t.improvements||[],r=typeof t.one_liner=="string"?t.one_liner:((f=t.one_liner)==null?void 0:f.text)||"",d=typeof t.context=="string"?t.context:((p=t.context)==null?void 0:p.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(a.ShieldCheck,{size:20,color:B.accent,strokeWidth:2}),e.jsx("span",{style:{fontSize:16,fontWeight:600,color:B.strong,fontFamily:"var(--font-sans)",lineHeight:1.2,textTransform:"uppercase"},children:"Coaching Summary"})]}),r&&e.jsx("div",{style:{fontSize:14,fontWeight:500,color:B.strong,fontFamily:"var(--font-sans)",lineHeight:1.5},children:r}),e.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:16,justifyContent:"space-between"},children:[d&&e.jsx("div",{style:{fontSize:14,fontWeight:400,color:B.muted,fontFamily:"var(--font-sans)",lineHeight:1.5,flex:1},children:d}),t.overall&&e.jsx(En,{overall:t.overall})]}),(l.length>0||o.length>0)&&e.jsxs("div",{style:{display:"flex",gap:24,paddingTop:24,borderTop:`1px solid ${B.absent}`},children:[e.jsx(bt,{icon:e.jsx(a.TrendingUp,{size:14,color:B.strong,strokeWidth:1.5}),label:"Key Strengths",items:l}),e.jsx(bt,{icon:e.jsx(a.Lightbulb,{size:14,color:B.strong,strokeWidth:1.5}),label:"Improvements",items:o})]})]})};function Tn(t){const n=Math.floor(t/60),i=Math.round(t%60);return`${n}:${i.toString().padStart(2,"0")}`}const Ln={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)"};function Bn({text:t,style:n}){const i=u.useRef(null),[l,o]=u.useState(!1);return u.useEffect(()=>{const r=i.current;if(!r)return;const d=()=>o(r.scrollWidth>r.clientWidth);if(d(),typeof ResizeObserver>"u")return;const f=new ResizeObserver(d);return f.observe(r),()=>f.disconnect()},[t]),e.jsx("span",{ref:i,title:l&&t!=null?String(t):void 0,style:n,children:t})}const St={display:"flex",flexDirection:"column",flex:"1 0 0",gap:0,minWidth:0},Ht=({meta:t={},callPurpose:n={},classification:i={},dimensions:l=[],outcomeQuality:o="Neutral",onMoreDetails:r,moreDetails:d=[],resolutionOutcome:f,customerIntent:p,location:w,canShowEditButton:b=!1,onEditInteraction:M})=>{const[g,C]=u.useState(!1),F=u.useRef(null),I=t.duration_seconds!=null?Tn(t.duration_seconds):null,G=t.message_count,_=n.interaction_driver,k=i.interaction_paradigm,W=x=>l.find(Y=>(Y.key||"").toLowerCase().includes(x)),R=W("resolution_outcome"),N=W("customer_intent"),L=W("location"),O=W("outcome_quality"),y=x=>x?x.replace(/_/g," ").replace(/\b\w/g,Y=>Y.toUpperCase()):null,m=o!=="Neutral"?o:O?y(O.value):o,h=f??(R?y(R.value):null),P=p??(N?y(N.value):null),ee=w??(L?y(L.value):null),ie=k!=null?y(k):null,re=new Set(["resolution_outcome","customer_intent","location","outcome_quality"].map(x=>`dim.${x}`)),T=l.filter(x=>!re.has(x.key)),ae=[],de=[[I!=null?{label:"Duration",value:I}:null,G!=null?{label:"Messages",value:G}:null],[_!=null?{label:"Driver",value:_}:null,ee!=null?{label:"Location",value:ee}:null]];for(let x=0;x<T.length;x+=2){const Y=T[x]?{label:T[x].display_name||T[x].label||T[x].key,value:y(T[x].value)}:null,c=T[x+1]?{label:T[x+1].display_name||T[x+1].label||T[x+1].key,value:y(T[x+1].value)}:null;de.push([Y,c])}de.push([{label:"Outcome Quality",value:m},{isMoreDetails:!0}]),de.forEach(x=>ae.push(x));const X=[h!=null&&{label:"Resolution Outcome",value:h},P!=null&&{label:"Customer Intent",value:P},ie!=null&&{label:"Paradigm",value:ie},...d||[]].filter(Boolean);u.useEffect(()=>{if(!g)return;const x=Y=>{F.current&&!F.current.contains(Y.target)&&C(!1)};return document.addEventListener("mousedown",x),()=>document.removeEventListener("mousedown",x)},[g]);const ge=x=>e.jsxs("div",{style:Ln,children:[e.jsx("span",{style:{color:"var(--Grey-Strong, #2E3236)",whiteSpace:"nowrap",flexShrink:0},children:x.label}),e.jsx(Bn,{text:x.value,style:{color:"var(--Grey-Muted, #808183)",textAlign:"right",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minWidth:0,flex:1}})]},x.label),he=()=>e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:12,padding:"8px 8px 12px 8px",fontFamily:"var(--font-sans)",borderBottom:"none",minHeight:33},children:[e.jsxs("button",{onClick:()=>{C(x=>!x),r&&!g&&r()},style:{display:"flex",alignItems:"center",gap:6,background:"none",border:"none",cursor:"pointer",padding:0,color:"var(--Grey-Strong, #2E3236)",fontSize:13,fontWeight:500,lineHeight:"normal",fontFamily:"var(--font-sans)",whiteSpace:"nowrap",flexShrink:0},children:[e.jsx("span",{children:"More Details"}),g?e.jsx(a.ChevronUp,{size:16,color:"var(--Grey-Muted, #808183)",strokeWidth:1.5}):e.jsx(a.ChevronDown,{size:16,color:"var(--Grey-Muted, #808183)",strokeWidth:1.5})]}),b&&e.jsxs("button",{onClick:M||(()=>{}),style:{display:"flex",alignItems:"center",gap:6,padding:"5px 12px",background:"var(--Grey-White, #FFF)",border:"1px solid var(--Grey-absent, #D9D9D9)",borderRadius:12,color:"var(--Grey-Strong, #2E3236)",fontSize:13,fontWeight:500,lineHeight:"normal",fontFamily:"var(--font-sans)",cursor:"pointer",flexShrink:0},children:[e.jsx(a.Pencil,{size:15,color:"var(--Grey-Strong, #2E3236)",strokeWidth:1.5}),e.jsx("span",{style:{fontSize:13,lineHeight:"normal"},children:"Edit"})]})]},"more-details");return e.jsxs("div",{ref:F,style:{display:"flex",flexDirection:"column",alignSelf:"stretch",gap:0,position:"relative",overflow:"visible"},children:[ae.map((x,Y)=>{var c;return e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:24,alignSelf:"stretch",flexWrap:"nowrap"},children:[e.jsx("div",{style:St,children:x[0]&&!x[0].isMoreDetails?ge(x[0]):e.jsx("div",{style:{flex:1}})}),e.jsx("div",{style:St,children:x[1]&&!x[1].isMoreDetails?ge(x[1]):(c=x[1])!=null&&c.isMoreDetails?he():e.jsx("div",{style:{flex:1}})})]},Y)}),g&&X.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"}),X.map(x=>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:x.label}),e.jsx("span",{style:{color:"var(--Grey-Muted, #808183)",fontSize:13,fontStyle:"normal",fontWeight:400,lineHeight:"120%",textAlign:"right"},children:x.value})]},x.label))]})]})},wt=({children:t,size:n=28,onClick:i,title:l})=>{const[o,r]=u.useState(!1);return e.jsx("div",{title:l,onClick:i,onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!1),style:{display:"flex",alignItems:"center",justifyContent:"center",width:n,height:n,borderRadius:9999,background:o?"var(--surface-hover, #F3F7F7)":"transparent",cursor:"pointer",flexShrink:0,transition:"background 0.15s"},children:t})},Rt=({signals:t={signals:[],present_count:0,total_signals_evaluated:0},expandedSignals:n=new Set,toggleSignal:i=()=>{},playEvidence:l=()=>{},highlightTurns:o=()=>{},onShowInTranscript:r=()=>{},timelinePlaying:d=!1,currentTimeSeconds:f=0})=>{const p=(t==null?void 0:t.signals)??[],w=(t==null?void 0:t.present_count)??p.length,b=g=>{const C=Math.floor(g/6e4),F=Math.floor(g%6e4/1e3);return`${C.toString().padStart(2,"0")}:${F.toString().padStart(2,"0")}`},M=g=>d&&g.start_ms!=null&&f*1e3>=g.start_ms&&f*1e3<=(g.end_ms??g.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(a.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:16,fontWeight:500,color:"var(--Grey-Strong, #2E3236)",fontFamily:"var(--default-font-family)"},children:"Signals"}),e.jsxs("span",{style:{fontSize:14,fontWeight:500,color:"var(--Grey-Strong, #2E3236)",fontFamily:"var(--default-font-family)"},children:[w," Signals Detected"]})]})]}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",alignSelf:"stretch",background:"var(--Grey-White, #FFF)",gap:8},children:[p.length===0&&e.jsx("div",{style:{padding:"8px 0",fontSize:14,color:"var(--Grey-Muted, #808183)"},children:"No signals detected."}),p.map((g,C)=>{var _,k,W;const F=g.key??g.id??C,I=n.has(F),G=((_=g.observations)==null?void 0:_.length)??0;return e.jsxs("div",{id:`signal-${F}`,style:{display:"flex",flexDirection:"column",width:"100%",gap:8},children:[e.jsxs("button",{onClick:()=>i(F),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:[g.display_name||((k=g.key)==null?void 0:k.replace(/_/g," ")),G>0&&e.jsxs("span",{style:{fontWeight:600,color:"var(--text-dark, #0B0A0A)",marginLeft:6},children:["(",G,")"]})]}),I?e.jsx(a.ChevronUp,{size:20,color:"#767473"}):e.jsx(a.ChevronDown,{size:20,color:"#767473"})]}),I&&((W=g.observations)==null?void 0:W.length)>0&&e.jsx("div",{style:{display:"flex",flexDirection:"column",alignSelf:"stretch",gap:0},children:g.observations.map((R,N)=>{var L,O,y;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:R.reason||R.explanation}),((O=(L=R.evidence)==null?void 0:L[0])==null?void 0:O.start_ms)!=null&&e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,flexShrink:0},children:[e.jsx(wt,{size:28,title:"Show in transcript",onClick:m=>{m.stopPropagation(),r(R.evidence[0].start_ms)},children:e.jsx(a.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:b(R.evidence[0].start_ms)})]})]}),(y=R.evidence)==null?void 0:y.map((m,h)=>{const P=m.start_ms!=null&&m.end_ms!=null;return m.text&&e.jsxs("div",{onClick:ee=>{ee.stopPropagation(),P&&l(m)},onMouseEnter:()=>o(m.turn_ids??[]),onMouseLeave:()=>o([]),style:{display:"flex",alignItems:"center",gap:8,padding:"8px 0",cursor:P?"pointer":"default"},children:[P&&e.jsx(wt,{size:28,children:M(m)?e.jsx(a.PauseCircle,{size:17,color:"var(--Grey-Muted, #808183)",strokeWidth:1.5}):e.jsx(a.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:["“",m.text,"”"]})]},h)})]},R.key??N)})})]},F)})]})]})},K={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)"},Nn=({score:t=4,minScore:n=0,maxScore:i=5})=>{const b=Number(t),M=Number.isFinite(b)?Math.min(Math.max(b,n),i):n,g=i>n?(M-n)/(i-n)*5:0,C=180/5,F=_=>{const k=_*Math.PI/180;return{x:121.5+85*Math.cos(k),y:123-85*Math.sin(k)}},I=(_,k)=>{const W=F(_),R=F(k),N=_-k>180?1:0;return`M ${W.x} ${W.y} A 85 85 0 ${N} 1 ${R.x} ${R.y}`},G=2;return e.jsx("svg",{width:"100%",viewBox:"0 0 243 130",fill:"none",style:{maxWidth:243},children:Array.from({length:5},(_,k)=>{const W=180-k*C-(k>0?G/2:0),R=180-(k+1)*C+(k<5-1?G/2:0),N=Math.max(0,Math.min(1,g-k)),L=I(W,R);return e.jsxs("g",{children:[e.jsx("path",{d:L,stroke:K.track,strokeWidth:30,strokeLinecap:"butt",fill:"none"}),N>0&&e.jsx("path",{d:L,stroke:K.strong,strokeWidth:30,strokeLinecap:"butt",fill:"none",pathLength:1,strokeDasharray:`${N} 1`})]},k)})})},Pn=({value:t=0,maxValue:n=5})=>{const i=Number(t),l=Number.isFinite(i)?Math.min(Math.max(i,0),n):0;return e.jsx("div",{style:{display:"flex",gap:2},children:Array.from({length:n},(o,r)=>{const d=Math.max(0,Math.min(1,l-r));return e.jsx("div",{style:{width:22,height:6,borderRadius:1,background:K.track,overflow:"hidden"},children:d>0&&e.jsx("div",{style:{width:`${d*100}%`,height:"100%",background:K.strong}})},r)})})},$n={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"},On=({text:t,children:n})=>{const[i,l]=u.useState(!1),o=u.useRef(null),[r,d]=u.useState({top:0,left:0}),f=()=>{if(o.current){const p=o.current.getBoundingClientRect();d({top:p.top-8,left:p.left+p.width/2})}l(!0)};return e.jsxs("div",{ref:o,style:{position:"relative",display:"inline-flex"},onMouseEnter:f,onMouseLeave:()=>l(!1),children:[n,i&&e.jsx("div",{style:{position:"fixed",top:r.top,left:r.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})})]})},Yn=({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:K.strong,fontFamily:"var(--font-sans)",lineHeight:"normal"},children:t}),e.jsx(On,{text:$n[t]||t,children:e.jsx(a.Info,{size:14,color:K.infoIcon,strokeWidth:1,style:{cursor:"pointer"}})})]}),e.jsx(Pn,{value:n,maxValue:i})]}),_t=({score:t=4,minScore:n=0,maxScore:i=5,predictedScore:l=4,predictedLabel:o="Predicted Objective",description:r="",legends:d=[{label:"CSAT",value:3},{label:"Resolution",value:4},{label:"Process Adherence",value:5},{label:"Communication",value:3}]})=>{const f=Number(t),p=Number.isFinite(f)?Math.min(Math.max(f,n),i):n,w=p.toFixed(1);return e.jsxs("div",{style:{display:"flex",flexDirection:"column",padding:24,borderRadius:8,border:`1px solid ${K.absent}`,background:K.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:K.strong,fontFamily:"var(--font-sans)",lineHeight:1.2},children:"Interaction Quality"}),e.jsx("span",{style:{fontSize:14,fontWeight:400,color:K.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(Nn,{score:t,minScore:n,maxScore:i}),(()=>{const g=-(180-(i>n?(p-n)/(i-n):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(${g}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:K.strong,fontFamily:"var(--font-sans)",lineHeight:1,textAlign:"center",marginTop:8},children:w}),e.jsx("div",{style:{fontSize:15,fontWeight:500,color:K.strong,fontFamily:"var(--font-sans)",lineHeight:1.2,textAlign:"center",marginTop:8},children:"Compass Score"})]}),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:K.strong,fontFamily:"var(--font-sans)",lineHeight:1.2,textAlign:"left"},children:"Interaction Quality Index"}),e.jsx("div",{style:{width:"100%",height:1,background:K.absent}}),d.map((b,M)=>e.jsx(Yn,{label:b.label,value:b.value},M))]})]})]})},Et=t=>{if(!t)return null;const i=String(t).trim().toLowerCase().split(/[^a-z]+/).filter(Boolean);return i.includes("supervisor")?"var(--rail-compliance, #C98A5A)":i.includes("admin")||i.includes("administrator")||i.includes("superadmin")?"var(--rail-discovery, #5E88B0)":i.includes("agent")?"var(--rail-outcome, #6B7C93)":null},qn=t=>{var l,o,r,d,f,p;if(!t)return null;const n=t.role??t.userRole??t.user_role??t.author_role??t.roleName??t.role_name??t.userType??t.user_type??t.type;if(typeof n=="string")return n;if(Array.isArray(n))return n.join(" ");if(n&&typeof n=="object")return n.name||n.value||n.label||null;const i=((l=t.user)==null?void 0:l.role)??((o=t.user)==null?void 0:o.userRole)??((r=t.user)==null?void 0:r.user_role)??((d=t.profile)==null?void 0:d.role)??((f=t.profile)==null?void 0:f.userRole)??((p=t.profile)==null?void 0:p.user_role);return typeof i=="string"?i:Array.isArray(i)?i.join(" "):i&&typeof i=="object"&&(i.name||i.value||i.label)||null},At=t=>{if(!t)return"#6B7C93";const n=qn(t);return Et(n)||t.color||"#6B7C93"},Me=t=>(t||"").split(" ").map(n=>n[0]).join("").toUpperCase()||"U",Kn=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))},Vn=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 o=new Date().getTime()-i.getTime(),r=Math.floor(o/6e4),d=Math.floor(o/36e5);if(r<1)return"Just now";if(r<60)return`${r} min`;if(d<24)return`${d} h`;const f=Math.floor(d/24);return f===1?"1 day":`${f} days`}catch{return t}},Tt=({name:t,initials:n,color:i,avatar:l,size:o=36})=>l?e.jsx("img",{src:l,alt:t,style:{width:o,height:o,borderRadius:"50%",objectFit:"cover",flexShrink:0}}):e.jsx("div",{style:{width:o,height:o,borderRadius:"50%",background:i||"#6B7C93",color:"#FFF",display:"flex",alignItems:"center",justifyContent:"center",fontSize:o<=32?"10px":"11px",fontWeight:650,flexShrink:0,fontFamily:"var(--default-font-family)",letterSpacing:"0.02em"},title:t,children:n||Me(t)}),Zn=({comment:t,isReply:n=!1,isConsecutive:i=!1,onReply:l,onSendReply:o,onEdit:r,onDelete:d,onMenuClick:f,showReply:p=!0})=>{var x,Y;const[w,b]=u.useState(!1),[M,g]=u.useState(!1),[C,F]=u.useState(!1),[I,G]=u.useState(""),[_,k]=u.useState(!1),[W,R]=u.useState(""),[N,L]=u.useState(!1),O=u.useRef(null),y=u.useRef(null),m=u.useRef(null),h=t.author||{},P=h.name||t.author_name||"Unknown",ee=h.initials||Me(P),ie=h.role||t.author_role,re=h.color||Et(ie)||"#6B7C93",T=h.avatar||t.avatar,ae=t.timestamp||t.created_at,de=Vn(ae),X=Kn(ae),ge=!!(t.isEdited||t.is_edited||t.edited),he=Array.isArray(t.content)?t.content:[t.content||t.text||""];return u.useEffect(()=>{if(!M)return;const c=J=>{O.current&&!O.current.contains(J.target)&&g(!1)};return document.addEventListener("mousedown",c),()=>document.removeEventListener("mousedown",c)},[M]),u.useEffect(()=>{const c=y.current;if(!c)return;c.style.height="auto";const J=140;c.style.height=Math.min(c.scrollHeight,J)+"px",c.style.overflowY=c.scrollHeight>J?"auto":"hidden"},[I,C]),u.useEffect(()=>{const c=m.current;if(!c)return;c.style.height="auto";const J=140;c.style.height=Math.min(c.scrollHeight,J)+"px",c.style.overflowY=c.scrollHeight>J?"auto":"hidden"},[W,_]),e.jsxs("div",{onMouseEnter:()=>b(!0),onMouseLeave:()=>b(!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(Tt,{name:P,initials:ee,color:re,avatar:T}),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:P}),e.jsx("span",{style:{fontSize:12,fontWeight:400,color:"var(--Grey-Muted, #808183)",lineHeight:"150%",fontFamily:"var(--default-font-family)"},children:de}),ge&&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:O,children:[e.jsx("button",{type:"button",onClick:()=>g(c=>!c),style:{padding:2,border:"none",background:"transparent",cursor:"pointer",borderRadius:4,display:"flex",alignItems:"center",justifyContent:"center",opacity:w||M?1:0,transition:"opacity 0.15s",flexShrink:0},children:e.jsx(a.Ellipsis,{size:24,color:"var(--Grey-Muted, #808183)"})}),M&&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:()=>{g(!1),k(!1),F(!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"}),r&&e.jsx("button",{type:"button",disabled:!X,onClick:()=>{if(!X)return;g(!1);const c=Array.isArray(t.content)?t.content.join(`
|
|
16
|
-
`):t.content||t.text||"";R(c),k(!0),F(!1)},style:{display:"flex",width:"100%",padding:"10px 16px",alignItems:"center",border:"none",background:"transparent",cursor:X?"pointer":"not-allowed",fontSize:13,fontWeight:400,color:X?"var(--Grey-Strong, #2E3236)":"var(--Grey-Muted, #808183)",fontFamily:"var(--default-font-family)",lineHeight:"150%",textAlign:"left",opacity:X?1:.5},onMouseEnter:c=>{X&&(c.currentTarget.style.background="var(--surface-hover, #F3F7F7)")},onMouseLeave:c=>{c.currentTarget.style.background="transparent"},children:"Edit"}),d&&e.jsx("button",{type:"button",onClick:()=>{g(!1),L(!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.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:["“"," ",((x=t.author)==null?void 0:x.name)||"Unknown"]}),e.jsx("button",{type:"button",onClick:()=>k(!1),style:{display:"flex",alignItems:"center",justifyContent:"center",background:"none",border:"none",cursor:"pointer",padding:0},children:e.jsx(a.X,{size:20,color:"var(--Grey-Muted, #808183)"})})]}),e.jsxs("div",{style:{display:"flex",alignItems:"flex-end",gap:8,width:"100%"},children:[e.jsx("textarea",{ref:m,value:W,onChange:c=>R(c.target.value),onKeyDown:c=>{if(c.key==="Enter"){if(c.metaKey||c.ctrlKey||c.shiftKey)return;c.preventDefault(),W.trim()&&(r==null||r({...t,content:W.trim(),isEdited:!0}),k(!1))}c.key==="Escape"&&k(!1)},autoFocus:!0,rows:1,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",resize:"none",minHeight:24,maxHeight:140,overflowY:"hidden"}}),e.jsx("button",{type:"button",onClick:()=>{W.trim()&&(r==null||r({...t,content:W.trim(),isEdited:!0}),k(!1))},disabled:!W.trim(),style:{display:"flex",padding:"6px 16px",justifyContent:"center",alignItems:"center",fontSize:13,fontWeight:600,color:W.trim()?"var(--Grey-White, #FFF)":"var(--Grey-Muted, #808183)",background:W.trim()?"var(--Grey-Strong, #2E3236)":"var(--grey-light, #e9e8e8a1)",border:"none",borderRadius:6,cursor:W.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:he.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",whiteSpace:"pre-wrap"},children:c},J))}),N&&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:()=>{L(!1),d==null||d(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:()=>L(!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"})]}),p&&l&&!C&&!N&&e.jsxs("button",{type:"button",onClick:()=>{k(!1),F(!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(a.CornerDownRight,{size:20,color:"var(--Grey-Muted, #808183)",strokeWidth:1.5}),"Reply"]}),C&&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:["“"," ",((Y=t.author)==null?void 0:Y.name)||"Unknown"]}),e.jsx("button",{type:"button",onClick:()=>{G(""),F(!1)},style:{display:"flex",alignItems:"center",justifyContent:"center",background:"none",border:"none",cursor:"pointer",padding:0},children:e.jsx(a.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:"flex-end",gap:8,width:"100%"},children:[e.jsx("textarea",{ref:y,value:I,onChange:c=>G(c.target.value),onKeyDown:c=>{if(c.key==="Enter"){if(c.metaKey||c.ctrlKey||c.shiftKey)return;c.preventDefault(),I.trim()&&(o==null||o({content:I.trim(),parentId:t.id}),G(""),F(!1))}c.key==="Escape"&&(G(""),F(!1))},autoFocus:!0,placeholder:"Add a reply",rows:1,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",resize:"none",minHeight:24,maxHeight:140,overflowY:"hidden"}}),e.jsx("button",{type:"button",onClick:()=>{I.trim()&&(o==null||o({content:I.trim(),parentId:t.id}),G(""),F(!1))},disabled:!I.trim(),style:{display:"flex",height:28,padding:"8px 12px",justifyContent:"center",alignItems:"center",gap:8,fontSize:13,fontWeight:600,color:I.trim()?"var(--Grey-White, #FFF)":"var(--Grey-Muted, #808183)",background:I.trim()?"var(--Neutral-850, #272727)":"var(--grey-light, #e9e8e8a1)",border:"none",borderRadius:10,cursor:I.trim()?"pointer":"not-allowed",fontFamily:"var(--default-font-family)",lineHeight:"150%"},children:"Post"})]})]})]})]})},Qn=({currentUser:t,onSubmit:n})=>{const[i,l]=u.useState(""),[o,r]=u.useState(!1),d=u.useRef(null);u.useEffect(()=>{const g=d.current;if(!g)return;g.style.height="auto";const C=140;g.style.height=Math.min(g.scrollHeight,C)+"px",g.style.overflowY=g.scrollHeight>C?"auto":"hidden"},[i]);const f=()=>{const g=i.trim();g&&(n==null||n(g),l(""))},p=g=>{if(g.key==="Enter"){if(g.metaKey||g.ctrlKey||g.shiftKey)return;g.preventDefault(),f()}},w=(t==null?void 0:t.initials)||Me(t==null?void 0:t.name),b=At(t),M=t==null?void 0:t.avatar;return e.jsxs("div",{style:{display:"flex",gap:16,alignItems:"flex-start"},children:[e.jsx(Tt,{name:t==null?void 0:t.name,initials:w,color:b,avatar:M}),e.jsx("div",{style:{flex:1,padding:12,display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"flex-start",gap:24,borderRadius:8,border:o?"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:d,value:i,onChange:g=>l(g.target.value),onFocus:()=>r(!0),onBlur:()=>r(!1),onKeyDown:p,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,maxHeight:140,overflowY:"hidden"}}),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"})]})})]})},Lt=({comment:t,depth:n=0,isConsecutive:i=!1,onReply:l,onSendReply:o,onEdit:r,onDelete:d,onMenuClick:f})=>{const p=t.replies&&t.replies.length>0,w=!p;return e.jsxs(u.Fragment,{children:[e.jsx("div",{style:{paddingLeft:n>0?Math.min(n*32,128):0},children:e.jsx(Zn,{comment:t,isReply:n>0,isConsecutive:i,onReply:l,onSendReply:o,onEdit:r,onDelete:d,onMenuClick:f,showReply:w})}),p&&t.replies.map(b=>e.jsx(Lt,{comment:b,depth:n+1,onReply:l,onSendReply:o,onEdit:r,onDelete:d,onMenuClick:f},b.id))]})},Bt=({comments:t=[],totalComments:n,children:i,onSendComment:l,onReply:o,onSendReply:r,onEdit:d,onDelete:f,onMenuClick:p,onMarkResolved:w,currentUser:b,isResolved:M=!1})=>{const[g,C]=u.useState([]),[F,I]=u.useState(!1),G=u.useMemo(()=>{const y=new Set(t.map(h=>h.id)),m=g.filter(h=>!y.has(h.id));return[...t,...m]},[t,g]);u.useEffect(()=>{const y=new Set(t.map(m=>m.id));C(m=>m.filter(h=>!y.has(h.id)))},[t]);const _=u.useMemo(()=>{if(!b)return{name:"You",initials:"YO",color:"#6B7C93"};const y=b.name||"You",m=b.initials||Me(y),h=At(b);return{...b,name:y,initials:m,color:h}},[b]),k=async({content:y,parentId:m})=>{if(r){I(!0);try{await r({content:y,parentId:m})}finally{I(!1)}}else{const h={id:`temp-${Date.now()}`,author:_,content:y,timestamp:"Just now",parentId:m,isOptimistic:!0};C(P=>[...P,h])}},W=async y=>{if(l){I(!0);try{await l(y)}finally{I(!1)}}else{const m={id:`temp-${Date.now()}`,author:_,content:y,timestamp:"Just now",isOptimistic:!0};C(h=>[...h,m])}},R=y=>{C(m=>m.map(h=>h.id===y.id?{...h,content:y.content,isEdited:!0}:h)),d==null||d(y)},N=y=>{C(m=>m.filter(h=>h.id!==y.id)),f==null||f(y)},L=u.useMemo(()=>{const y={};G.forEach(h=>{h.parentId&&(y[h.parentId]||(y[h.parentId]=[]),y[h.parentId].push(h))});const m=h=>({...h,replies:(y[h.id]||[]).map(m)});return G.filter(h=>!h.parentId).map(m)},[G]),O=n??G.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(a.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(a.MessagesSquare,{style:{width:20,height:20,flexShrink:0},color:"var(--Grey-Strong, #2E3236)",strokeWidth:1.5})}),e.jsx("span",{style:{fontSize:16,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:[O," Comment",O!==1?"s":""]}),M?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(a.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"})]}):w?e.jsxs("button",{type:"button",onClick:w,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(a.CircleCheck,{size:16,color:"var(--Grey-Strong, #2E3236)",strokeWidth:1.5}),"Mark as Resolved"]}):null]}),G.length>0&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:0,marginBottom:24,maxHeight:600,overflowY:G.length>6?"auto":"visible"},children:L.map((y,m)=>{var re,T;const h=m>0?L[m-1]:null,P=((re=h==null?void 0:h.author)==null?void 0:re.name)||(h==null?void 0:h.author_name),ee=((T=y.author)==null?void 0:T.name)||y.author_name,ie=h&&P===ee&&(!h.replies||h.replies.length===0);return e.jsx(Lt,{comment:y,depth:0,isConsecutive:!!ie,onReply:o,onSendReply:k,onEdit:R,onDelete:N,onMenuClick:p},y.id)})}),G.length>0&&e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,marginBottom:16,marginLeft:48},children:[e.jsx(a.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."})]}),F&&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(Qn,{currentUser:_,onSubmit:W})]}),e.jsx("div",{style:{flex:1,minWidth:0},children:i})]})]})},z={strong:"var(--Grey-Strong, #2E3236)",muted:"var(--Grey-Muted, #808183)",border:"var(--Grey-absent, #D9D9D9)",surfaceHover:"var(--surface-hover, #F3F7F7)",warmBorder:"var(--border-warm, #B2AEA8)",quoteText:"var(--text-subtle-warm, #767473)",toneGreen:"var(--state-present, #25A372)",toneAmber:"var(--rail-orange, #C98A5A)",toneRed:"var(--color-red-strong, #D04A4A)",impactPositiveBg:"rgba(37, 163, 114, 0.12)",impactPositiveInk:"var(--state-present, #25A372)",impactNegativeBg:"rgba(208, 74, 74, 0.12)",impactNegativeInk:"var(--color-red-strong, #D04A4A)"},Xn="var(--font-sans, 'Averta', ui-sans-serif, system-ui, sans-serif)",kt=({children:t,size:n=24,onClick:i,title:l})=>{const[o,r]=u.useState(!1);return e.jsx("div",{title:l,onClick:i,onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!1),style:{display:"flex",alignItems:"center",justifyContent:"center",width:n,height:n,borderRadius:9999,background:o?z.surfaceHover:"transparent",cursor:"pointer",flexShrink:0,transition:"background 0.15s"},children:t})},Jn=t=>{const n=Math.floor(t/6e4),i=Math.floor(t%6e4/1e3);return`${n.toString().padStart(2,"0")}:${i.toString().padStart(2,"0")}`},Un=({icon:t})=>{const n={size:16,color:z.strong,strokeWidth:1.5};return t==="thumbs_down"?e.jsx(a.ArrowDown,{...n}):t==="focus"?e.jsx(a.Target,{...n}):e.jsx(a.ArrowUp,{...n})},ei=({label:t,direction:n})=>{if(!t)return null;const i=n==="negative"?a.ArrowDown:a.ArrowUp;return e.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:4,background:z.surfaceHover,color:z.strong,padding:"2px 8px",borderRadius:9999,fontSize:12,fontWeight:500,lineHeight:1.4,whiteSpace:"nowrap",flexShrink:0},children:[t,e.jsx(i,{size:12,color:z.strong,strokeWidth:2})]})},ti=({evidence:t,onPlayEvidence:n,onShowInTranscript:i,timelinePlaying:l,currentTimeSeconds:o})=>{const r=t.start_ms??t.startMs,d=t.end_ms??t.endMs,f=r!=null,p=(o??0)*1e3,w=l&&f&&p>=r&&p<=(d??r+5e3);return e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:6,paddingLeft:12,borderLeft:`2px solid ${z.warmBorder}`},children:[e.jsxs("span",{style:{fontSize:13,fontWeight:400,color:z.quoteText,lineHeight:1.5,fontStyle:"italic",wordBreak:"break-word"},children:["“",t.text,"”"]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,minHeight:24},children:[t.actor&&e.jsx("span",{style:{fontSize:12,fontWeight:500,color:z.muted,textTransform:"capitalize"},children:t.actor}),f&&e.jsxs(e.Fragment,{children:[e.jsx(kt,{size:24,title:w?"Pause":"Play evidence",onClick:()=>n==null?void 0:n({start_ms:r,end_ms:d}),children:w?e.jsx(a.PauseCircle,{size:16,color:z.strong,strokeWidth:1.25}):e.jsx(a.PlayCircle,{size:16,color:z.muted,strokeWidth:1.25})}),e.jsx(kt,{size:24,title:"Show in transcript",onClick:()=>i==null?void 0:i(r),children:e.jsx(a.ScrollText,{size:16,color:z.muted,strokeWidth:1.5})}),e.jsx("span",{style:{fontSize:12,fontWeight:400,color:z.muted,lineHeight:1.2,whiteSpace:"nowrap"},children:Jn(r)})]})]})]})},ni=({signal:t,onPlayEvidence:n,onShowInTranscript:i,timelinePlaying:l,currentTimeSeconds:o})=>{const r=Array.isArray(t.evidence)?t.evidence:[],d=r.length>0,[f,p]=u.useState(!1);return e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:6},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,flexWrap:"wrap"},children:[e.jsx(ei,{label:t.impact_label,direction:t.impact_direction}),d&&e.jsxs("button",{type:"button",onClick:()=>p(w=>!w),style:{display:"inline-flex",alignItems:"center",gap:2,background:"transparent",border:"none",padding:0,cursor:"pointer",fontSize:12,fontWeight:500,color:z.muted,fontFamily:"inherit"},children:[f?e.jsx(a.ChevronDown,{size:14,color:z.muted,strokeWidth:1.5}):e.jsx(a.ChevronRight,{size:14,color:z.muted,strokeWidth:1.5}),r.length," ",r.length===1?"quote":"quotes"]})]}),f&&d&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:12,paddingTop:4},children:r.map((w,b)=>e.jsx(ti,{evidence:w,onPlayEvidence:n,onShowInTranscript:i,timelinePlaying:l,currentTimeSeconds:o},b))})]})},ii=({item:t,isLast:n,onPlayEvidence:i,onShowInTranscript:l,timelinePlaying:o,currentTimeSeconds:r})=>{const d=Array.isArray(t.signals)?t.signals:[];return e.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:12,padding:"16px 16px",borderBottom:n?"none":`1px solid ${z.border}`},children:[e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:16,height:16,flexShrink:0,marginTop:2},children:e.jsx(Un,{icon:t.icon,tone:t.tone})}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:12,flex:1,minWidth:0},children:[e.jsx("span",{style:{fontFamily:Xn,fontSize:14,fontWeight:400,color:z.strong,lineHeight:"normal",wordBreak:"break-word"},children:t.title||""}),d.length>0&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:12},children:d.map((f,p)=>e.jsx(ni,{signal:f,onPlayEvidence:i,onShowInTranscript:l,timelinePlaying:o,currentTimeSeconds:r},f.signal_key||p))})]})]})},ri=({summary:t})=>{if(!t||typeof t!="object")return null;const n=Number(t.focus_count)||0,i=Number(t.opportunity_count)||0,l=Number(t.excellence_count)||0;if(n+i+l===0)return null;const o=[{key:"excellence",label:"Excellence",count:l,Icon:a.ArrowUp,color:z.strong},{key:"opportunity",label:"Opportunity",count:i,Icon:a.ArrowDown,color:z.strong},{key:"focus",label:"Focus",count:n,Icon:a.Target,color:z.strong}].filter(r=>r.count>0);return e.jsx("div",{style:{display:"flex",alignItems:"center",gap:16,padding:"8px 16px",background:z.surfaceHover,borderRadius:8},children:o.map(({key:r,label:d,count:f,Icon:p,color:w})=>e.jsxs("div",{style:{display:"inline-flex",alignItems:"center",gap:6},children:[e.jsx(p,{size:14,color:w,strokeWidth:1.75}),e.jsx("span",{style:{fontSize:13,fontWeight:600,color:z.strong,lineHeight:1.2},children:f}),e.jsx("span",{style:{fontSize:13,fontWeight:400,color:z.muted,lineHeight:1.2},children:d})]},r))})},li=5,Nt=({items:t=[],summary:n,guidanceCount:i,loading:l=!1,onPlayEvidence:o,onShowInTranscript:r,timelinePlaying:d=!1,currentTimeSeconds:f=0})=>{const p=Array.isArray(t)?t.filter(Boolean).slice(0,li):[],w=i??p.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:z.surfaceHover,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:e.jsx(a.Lightbulb,{style:{width:20,height:20,flexShrink:0},color:z.strong,strokeWidth:1.5})}),e.jsx("span",{style:{flex:1,fontSize:16,fontWeight:500,color:z.strong,lineHeight:1.2},children:"Guidance"}),e.jsxs("span",{style:{fontSize:14,fontWeight:500,color:z.strong,lineHeight:1.5,whiteSpace:"nowrap"},children:[w," Item",w!==1?"s":""]})]}),e.jsx(ri,{summary:n}),p.map((b,M)=>e.jsx(ii,{item:b,isLast:M===p.length-1,onPlayEvidence:o,onShowInTranscript:r,timelinePlaying:d,currentTimeSeconds:f},M))]})},Q={strong:"var(--Grey-Strong, #2E3236)",muted:"var(--Grey-Muted, #808183)",border:"var(--Grey-absent, #D9D9D9)",surface:"var(--Grey-White, #FFF)",surfaceHover:"var(--surface-hover, #F3F7F7)"},ze="var(--font-sans, 'Averta', ui-sans-serif, system-ui, sans-serif)",oi=[{key:"lookup_hold",label:"Lookup",Icon:a.Search},{key:"formal_hold",label:"Hold",Icon:a.Pause},{key:"extended_hold",label:"Extended",Icon:a.Pause},{key:"transfer_hold",label:"Transfer",Icon:a.ArrowRightLeft},{key:"probable_hold",label:"Possible",Icon:a.CircleDashed},{key:"dead_air",label:"Dead air",Icon:a.MicOff}],si=t=>{if(t==null||Number.isNaN(t))return"—";const n=Number(t);return Number.isFinite(n)?n>=1e3?`${(n/1e3).toFixed(1)}s`:`${Math.round(n)}ms`:"—"},ai=t=>{if(t==null||Number.isNaN(t))return null;const n=Number(t);return Number.isFinite(n)?`${(n*100).toFixed(1)}%`:null},Oe=t=>{if(t==null||Number.isNaN(t))return null;const n=Number(t);return Number.isFinite(n)?n.toLocaleString():null},di=({holdTypeCounts:t})=>{if(!t||typeof t!="object")return null;const n=oi.map(i=>({...i,count:Number(t[i.key])||0})).filter(i=>i.count>0);return n.length===0?null:e.jsx("div",{style:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:16,padding:"8px 16px",background:Q.surfaceHover,borderRadius:8},children:n.map(({key:i,label:l,Icon:o,count:r})=>e.jsxs("div",{style:{display:"inline-flex",alignItems:"center",gap:6},children:[e.jsx(o,{size:14,color:Q.strong,strokeWidth:1.5}),e.jsx("span",{style:{fontFamily:ze,fontSize:13,fontWeight:600,color:Q.strong,lineHeight:1.2},children:r}),e.jsx("span",{style:{fontFamily:ze,fontSize:13,fontWeight:400,color:Q.muted,lineHeight:1.2},children:l})]},i))})},ci=({summary:t})=>{const n=Oe(t==null?void 0:t.stall_count);if(!n)return null;const i=ai(t==null?void 0:t.stall_rate),l=Oe(t==null?void 0:t.stall_filler_count),o=Oe(t==null?void 0:t.stall_buying_time_count),r=[];return l&&r.push(`filler ${l}`),o&&r.push(`buying time ${o}`),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,flexWrap:"wrap",fontFamily:ze,fontSize:13,lineHeight:1.4},children:[e.jsxs("span",{style:{fontWeight:500,color:Q.strong},children:["Stalls: ",n,i?` (${i})`:""]}),r.length>0&&e.jsxs("span",{style:{color:Q.muted},children:["· ",r.join(" · ")]})]})},Ct=({label:t,percentiles:n})=>{if(!n||typeof n!="object")return null;const i=[{key:"p50",label:"p50",value:n.p50},{key:"p75",label:"p75",value:n.p75},{key:"p95",label:"p95",value:n.p95},{key:"p99",label:"p99",value:n.p99}].filter(l=>l.value!=null);return i.length===0?null:e.jsxs("div",{style:{display:"flex",alignItems:"baseline",gap:12,flexWrap:"wrap",fontFamily:ze,fontSize:13,lineHeight:1.4},children:[e.jsx("span",{style:{fontWeight:500,color:Q.strong,minWidth:72},children:t}),i.map(l=>e.jsxs("span",{style:{color:Q.muted},children:[e.jsx("span",{style:{fontWeight:500,color:Q.strong},children:l.label})," ",si(l.value)]},l.key))]})},fi=({summary:t})=>{if(!t||typeof t!="object")return null;const n=!!t.hold_type_counts&&Object.values(t.hold_type_counts).some(d=>Number(d)>0),i=(Number(t.stall_count)||0)>0,l=t.agent_response_percentiles_ms,o=t.customer_response_percentiles_ms,r=l&&Object.values(l).some(d=>d!=null)||o&&Object.values(o).some(d=>d!=null);return!n&&!i&&!r?null:e.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"stretch",gap:12,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:Q.surfaceHover,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:e.jsx(a.AudioLines,{size:20,color:Q.strong,strokeWidth:1.5})}),e.jsx("span",{style:{flex:1,fontFamily:"Varta, var(--font-sans, sans-serif)",fontSize:16,fontWeight:700,color:Q.strong,lineHeight:1.2,whiteSpace:"nowrap"},children:"Talk Patterns"})]}),n&&e.jsx(di,{holdTypeCounts:t.hold_type_counts}),(i||r)&&e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:10,padding:"12px 16px",border:`1px solid ${Q.border}`,borderRadius:8},children:[i&&e.jsx(ci,{summary:t}),r&&e.jsxs(e.Fragment,{children:[e.jsx(Ct,{label:"Agent",percentiles:l}),e.jsx(Ct,{label:"Customer",percentiles:o})]})]})]})},te={strong:"var(--Grey-Strong, #2E3236)",muted:"var(--Grey-Muted, #808183)",border:"var(--Grey-absent, #D9D9D9)",surfaceHover:"var(--surface-hover, #F3F7F7)",iconAccent:"var(--rail-orange, #C98A5A)"},ve="var(--font-sans, 'Averta', ui-sans-serif, system-ui, sans-serif)",Ft=t=>{if(t==null)return null;if(typeof t=="string")return{name:t,percent:null};const n=t.name??t.label??t.title??"";return n?{name:n,percent:t.percent!=null?t.percent:t.percentage!=null?t.percentage:null}:null},ui=t=>{if(t==null)return null;const n=Number(t);return Number.isFinite(n)?`${(Math.abs(n)<=1?n*100:n).toFixed(1)} %`:null},gi=({name:t,percent:n})=>e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12,padding:"12px 0",borderBottom:`1px solid ${te.border}`,width:"100%"},children:[e.jsx("span",{style:{flex:1,minWidth:0,fontFamily:ve,fontSize:13,fontWeight:400,color:te.strong,lineHeight:"24px",wordBreak:"break-word"},children:t}),n!=null&&e.jsx("span",{style:{fontFamily:ve,fontSize:13,fontWeight:400,color:te.muted,lineHeight:"24px",whiteSpace:"nowrap",flexShrink:0},children:ui(n)})]}),It=({title:t,items:n,initialVisibleCount:i})=>{const[l,o]=u.useState(!1);if(!n.length)return null;const r=Math.max(0,n.length-i),d=l?n:n.slice(0,i);return e.jsxs("div",{style:{flex:1,minWidth:0,display:"flex",flexDirection:"column",alignItems:"flex-start",gap:8},children:[e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",padding:"8px 0",width:"100%"},children:e.jsx("span",{style:{flex:1,minWidth:0,fontFamily:ve,fontSize:15,fontWeight:600,color:te.strong,lineHeight:"24px",wordBreak:"break-word"},children:t})}),e.jsx("div",{style:{display:"flex",flexDirection:"column",alignItems:"flex-start",width:"100%"},children:d.map((f,p)=>e.jsx(gi,{name:f.name,percent:f.percent},p))}),r>0&&e.jsxs("button",{type:"button",onClick:()=>o(f=>!f),style:{display:"inline-flex",alignItems:"center",gap:6,height:29,padding:"8px 0",background:"transparent",border:"none",cursor:"pointer",fontFamily:ve,fontSize:13,fontWeight:600,color:te.strong,lineHeight:1.2,whiteSpace:"nowrap"},children:[l?"Show Less":`${r} More`,l?e.jsx(a.ChevronUp,{size:16,color:te.strong,strokeWidth:1.75}):e.jsx(a.ChevronDown,{size:16,color:te.strong,strokeWidth:1.75})]})]})},Pt=({products:t=[],services:n=[],title:i="Products & Services",productsTitle:l="Products Discussed",servicesTitle:o="Services Discussed",initialVisibleCount:r=4})=>{const d=(t||[]).map(Ft).filter(Boolean),f=(n||[]).map(Ft).filter(Boolean);return!d.length&&!f.length?null:e.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"stretch",gap:16,width:"100%",background:"var(--Grey-White, #FFF)"},children:[e.jsx("div",{style:{display:"flex",alignItems:"center",gap:16,height:40,borderBottom:`1px solid ${te.border}`,width:"100%"},children:e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,flex:1,minWidth:0},children:[e.jsx(a.ClipboardCheck,{size:24,color:te.iconAccent,strokeWidth:1.5}),e.jsx("span",{style:{fontFamily:ve,fontSize:16,fontWeight:600,color:te.strong,lineHeight:1.2,textTransform:"uppercase",whiteSpace:"nowrap"},children:i})]})}),e.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:24,flexWrap:"wrap",width:"100%"},children:[e.jsx(It,{title:l,items:d,initialVisibleCount:r}),e.jsx(It,{title:o,items:f,initialVisibleCount:r})]})]})},ue=({text:t,children:n})=>{const[i,l]=u.useState(!1),o=u.useRef(null),[r,d]=u.useState({top:0,left:0});if(!t)return n;const f=()=>{if(o.current){const p=o.current.getBoundingClientRect();d({top:p.bottom+6,left:p.left+p.width/2})}l(!0)};return e.jsxs("div",{ref:o,style:{position:"relative",display:"inline-flex"},onMouseEnter:f,onMouseLeave:()=>l(!1),children:[n,i&&e.jsx("div",{style:{position:"fixed",top:r.top,left:r.left,transform:"translate(-50%, 0)",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})})]})},Wt=[{key:"overview",label:"Overview"},{key:"coaching",label:"Coaching Summary"},{key:"signals",label:"Signals & Recording"},{key:"comments",label:"Feedback"}];function pi(t){return/\bagent\b/.test(String(t??"").toLowerCase())}function hi(t){return/(admin|superadmin|administrator)/.test(String(t??"").toLowerCase())}function xi(t,n){const i=(t==null?void 0:t.direction)??(t==null?void 0:t.interaction_direction)??(t==null?void 0:t.call_direction)??n;if(i==null||i==="")return null;const l=String(i).toLowerCase().trim();return l==="outbound"||l.startsWith("outbound")?"outbound":l==="inbound"||l.startsWith("inbound")?"inbound":null}const yi=({title:t="Wheel Stud Replacement Enquiry",onBack:n,data:i,coachingData:l,coachingLoading:o=!1,audioUrl:r,audioRef:d,currentTimeSeconds:f,timelinePlaying:p,playbackRate:w,timelineSegments:b,onSeek:M,onTogglePlay:g,onSeekBack:C,onSeekForward:F,onSetPlaybackRate:I,agentName:G,agentFullName:_,customerName:k,customerFullName:W,transcript:R,activeTurnIndex:N,turnObservations:L,highlightedTurns:O,onTurnPlayPause:y,onPlayEvidence:m,onHighlightTurns:h,callPurpose:P,classification:ee,outcomeQuality:ie,resolutionOutcome:re,customerIntent:T,location:ae,interactionId:de,moreDetails:X,compassScore:ge,compassMaxScore:he=5,predictedCsat:x,predictedLabel:Y="Predicted Objective",compassLegends:c,customerSessions:J,customerSessionCount:$t,onSessionClick:Ye,onViewAllSessions:qe,prevSessionDesc:Ke,prevSessionDisabled:le=!1,nextSessionDesc:Ve,nextSessionDisabled:oe=!1,onPreviousSession:je,onNextSession:be,comments:Ze=[],guidance:Ot=[],guidanceSummary:Yt,talkPatterns:qt,productsServices:V,productsDiscussed:Ge,servicesDiscussed:He,currentUser:$,onSendComment:Kt,onSendReply:Vt,onReply:Zt,onEdit:Qt,onEditInteraction:Xt,onDelete:Jt,onMenuClick:Ut,onMarkResolved:en,commentsResolved:tn})=>{var ht;const[Re,Se]=u.useState("overview"),[nn,Qe]=u.useState(new Set),[rn,we]=u.useState(!1),[ln,Xe]=u.useState(null),[Je,Ue]=u.useState(!1),[et,on]=u.useState(0),[tt,sn]=u.useState(!1),ce=u.useRef(null),_e=u.useRef(null),nt=u.useRef(null),ke=u.useRef(null),it=u.useRef(null),rt=u.useRef(null),lt={overview:_e,coaching:nt,signals:ke,products:it,comments:rt},xe=u.useRef(null),Ee=u.useRef(!1),ot=u.useMemo(()=>{const s=(V==null?void 0:V.products)??Ge??[],v=(V==null?void 0:V.services)??He??[];return s.length>0||v.length>0},[V,Ge,He]),Ae=u.useMemo(()=>{if(!ot)return Wt;const s=[];for(const v of Wt)v.key==="comments"&&s.push({key:"products",label:"Products & Services"}),s.push(v);return s},[ot]);u.useEffect(()=>{const s=xe.current;if(!s)return;const v=Ae.map(A=>A.key),j=v.map(A=>lt[A]),D=(A=>{let U=A.parentElement;for(;U;){const{overflow:se,overflowY:ne}=window.getComputedStyle(U);if(/(auto|scroll)/.test(se+ne))return U;U=U.parentElement}return null})(s),E=()=>{var se;if(Ee.current)return;let A=v[0];for(let ne=j.length-1;ne>=0;ne--){const Pe=j[ne].current;if(!Pe)continue;if(Pe.getBoundingClientRect().top<=150){A=v[ne];break}}Se(A);const U=((se=_e.current)==null?void 0:se.getBoundingClientRect().top)??Number.POSITIVE_INFINITY;sn(U<=150)};return s.addEventListener("scroll",E,{passive:!0}),D&&D!==s&&D.addEventListener("scroll",E,{passive:!0}),window.addEventListener("scroll",E,{passive:!0,capture:!0}),E(),()=>{s.removeEventListener("scroll",E),D&&D!==s&&D.removeEventListener("scroll",E),window.removeEventListener("scroll",E,{capture:!0})}},[Ae]);const st=u.useRef(null),an=s=>{var j;Se(s),Ee.current=!0,st.current=s;const v=(j=lt[s])==null?void 0:j.current;if(v){const S=xe.current;if(S&&S.scrollHeight>S.clientHeight){const D=S.getBoundingClientRect().top,A=v.getBoundingClientRect().top-D+S.scrollTop-16;S.scrollTo({top:A,behavior:"smooth"})}else{const D=v.getBoundingClientRect().top+window.scrollY-120;window.scrollTo({top:D,behavior:"smooth"})}}setTimeout(()=>{Ee.current=!1,st.current=null},1200)},Te=J||[],Le=Te.length>1,at=s=>{Se("signals");const v=ke.current;if(v){const S=xe.current;if(S&&S.scrollHeight>S.clientHeight){const D=S.getBoundingClientRect().top,A=v.getBoundingClientRect().top-D+S.scrollTop-16;S.scrollTo({top:A,behavior:"smooth"})}else{const D=v.getBoundingClientRect().top+window.scrollY-120;window.scrollTo({top:D,behavior:"smooth"})}}const j=s/1e3;setTimeout(()=>{var S;(S=ce.current)!=null&&S.scrollToTranscript&&ce.current.scrollToTranscript(j)},220)},dt=s=>{Se("signals");const v=ke.current;if(v){const S=xe.current;if(S&&S.scrollHeight>S.clientHeight){const D=S.getBoundingClientRect().top,A=v.getBoundingClientRect().top-D+S.scrollTop-16;S.scrollTo({top:A,behavior:"smooth"})}else{const D=v.getBoundingClientRect().top+window.scrollY-120;window.scrollTo({top:D,behavior:"smooth"})}}const j=(s==null?void 0:s.start_ms)??(s==null?void 0:s.startMs);setTimeout(()=>{var S,D;if(j!=null&&((S=ce.current)!=null&&S.scrollToTranscript)&&ce.current.scrollToTranscript(j/1e3),m)m(s);else if(j!=null&&((D=ce.current)!=null&&D.seekTo)){ce.current.seekTo(j/1e3),Ue(!0),on(j/1e3);const A=(s.end_ms??s.endMs??j+5e3)-j;setTimeout(()=>Ue(!1),A)}},220)},dn=s=>{h&&h(s)},cn=s=>{Qe(v=>{const j=new Set(v);return j.has(s)?j.delete(s):j.add(s),j})},fn=(i==null?void 0:i.blocks)||[],ye=s=>{var v;return((v=fn.find(j=>j.block_id===s))==null?void 0:v.payload)||{}},Z=ye("interaction-metadata"),pe=ye("interaction-context"),Ce=ye("interaction-signals"),un=ye("interaction-outcome-lift"),gn=ye("interaction-dimensions").dimensions||[],pn=pe.call_purpose||{},hn=pe.classification||{},ct=Z||{},Fe=P||pn||{},xn=ee||hn||{},ft=un||{};(ft.driver_signal_keys||[]).map(s=>s.replace(/^sig\./,"").replace(/_/g," "));const yn=l||null,mn=(ht=Ce==null?void 0:Ce.signals)!=null&&ht.length?Ce:{present_count:0,total_signals_evaluated:0,signals:[]},ut=Ot||[],Be=G||Z.agent_name||Z.agent||pe.agent_name||"Agent",vn=_||Z.agent_full_name||Z.agent_name||Be,me=k||Z.customer_name||Z.customer||pe.customer_name||"Customer",gt=W||Z.customer_full_name||Z.customer_name||me,pt=String(($==null?void 0:$.role)??($==null?void 0:$.userRole)??($==null?void 0:$.user_role)??($==null?void 0:$.roleName)??($==null?void 0:$.role_name)??"").toLowerCase(),Ie=pi(pt),jn=hi(pt),Ne=$t??Te.length,We=Z.created_dt||(i==null?void 0:i.created_dt)||pe.created_dt||"",bn=We?new Date(/Z$|[+-]\d{2}:\d{2}$/.test(We)?We:We+"Z").toLocaleString():"",Sn=Fe.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:{display:"flex",alignItems:"center",gap:12,padding:"18px 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(a.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}),(je||be)&&!tt&&e.jsxs("div",{style:{display:"flex",alignItems:"center",flexShrink:0},children:[e.jsx(ue,{text:Ke,children:e.jsxs("button",{onClick:le?void 0:je,disabled:le,style:{display:"flex",alignItems:"center",gap:6,padding:"4px 12px",background:"none",border:"none",cursor:le?"default":"pointer",opacity:le?.4:1},children:[e.jsx(a.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 Interaction"})]})}),e.jsx("div",{style:{width:1,height:20,background:"var(--Grey-absent, #D9D9D9)",flexShrink:0}}),e.jsx(ue,{text:Ve,children:e.jsxs("button",{onClick:oe?void 0:be,disabled:oe,style:{display:"flex",alignItems:"center",gap:6,padding:"4px 12px",background:"none",border:"none",cursor:oe?"default":"pointer",opacity:oe?.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 Interaction"}),e.jsx(a.ArrowRight,{size:16,color:"var(--Neutral-800, #323232)",strokeWidth:1.5})]})})]})]}),e.jsx("div",{style:{position:"sticky",top:0,zIndex:30,backgroundColor:"#FFFFFF",paddingTop:8,boxShadow:"0 4px 6px -4px rgba(0, 0, 0, 0.04)"},children:e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:16,background:"#FFFFFF",borderBottom:"1px solid var(--Grey-Faint, #ACADAD)",padding:"0 24px"},children:[e.jsx("div",{style:{display:"flex",alignItems:"flex-start",minWidth:0},children:Ae.map(s=>e.jsx("button",{onClick:()=>an(s.key),style:{display:"flex",padding:16,alignItems:"center",gap:10,background:"none",border:"none",borderBottom:Re===s.key?"3px solid var(--Grey-Strong, #2E3236)":"3px solid transparent",cursor:"pointer",fontSize:15,fontWeight:Re===s.key?500:400,color:Re===s.key?"var(--Grey-Strong, #2E3236)":"var(--Grey-Muted, #808183)",whiteSpace:"nowrap",transition:"border-color 0.2s ease, color 0.2s ease"},children:s.label},s.key))}),(je||be)&&tt&&e.jsxs("div",{style:{display:"flex",alignItems:"center",flexShrink:0},children:[e.jsx(ue,{text:Ke,children:e.jsxs("button",{onClick:le?void 0:je,disabled:le,style:{display:"flex",alignItems:"center",gap:6,padding:"4px 12px",background:"none",border:"none",cursor:le?"default":"pointer",opacity:le?.4:1},children:[e.jsx(a.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 Interaction"})]})}),e.jsx("div",{style:{width:1,height:20,background:"var(--Grey-absent, #D9D9D9)",flexShrink:0}}),e.jsx(ue,{text:Ve,children:e.jsxs("button",{onClick:oe?void 0:be,disabled:oe,style:{display:"flex",alignItems:"center",gap:6,padding:"4px 12px",background:"none",border:"none",cursor:oe?"default":"pointer",opacity:oe?.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 Interaction"}),e.jsx(a.ArrowRight,{size:16,color:"var(--Neutral-800, #323232)",strokeWidth:1.5})]})})]})]})}),e.jsxs("div",{ref:xe,style:{padding:24,flex:1,overflowY:"auto"},children:[e.jsxs("div",{ref:_e,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(a.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(a.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:bn})]}),(()=>{const s=Fe.interaction_direction==="outbound"?a.PhoneOutgoing:a.PhoneIncoming;return e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,padding:"8px 0"},children:[e.jsx(s,{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:Sn})]})})(),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:16,paddingLeft:16,borderLeft:"1px solid var(--Grey-absent, #D9D9D9)"},children:[e.jsx(ue,{text:vn,children:e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,padding:"8px 0",cursor:"pointer"},children:[e.jsx(a.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})]})}),Ne>1?e.jsx("div",{children:e.jsx(ue,{text:gt,children:e.jsxs("button",{onClick:()=>we(!0),style:{display:"flex",alignItems:"center",gap:16,padding:"0 16px",height:34,borderRadius:8,background:"var(--Rail-Surface-2, #E3E1D7)",border:"none",cursor:"pointer"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:4,minWidth:0},children:[e.jsx(a.CircleUser,{size:16,color:"var(--Grey-Strong, #2E3236)",strokeWidth:1.5}),e.jsxs("span",{style:{fontSize:13,fontWeight:400,color:"var(--Grey-Strong, #2E3236)",lineHeight:1.2,whiteSpace:"nowrap"},children:[e.jsx("span",{style:{fontWeight:600},children:me})," ",e.jsxs("span",{children:["(",Ne," Interactions)"]})]})]}),e.jsx(a.ChevronRight,{size:16,color:"var(--Grey-Strong, #2E3236)",strokeWidth:1.7})]})})}):e.jsx(ue,{text:gt,children:e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:4,padding:"8px 0",cursor:"pointer"},children:[e.jsx(a.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:me})]})})]})]})]}),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(_t,{score:ge??.5,minScore:0,maxScore:he,predictedScore:x??.5,predictedLabel:Y,legends:c})}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"stretch",justifyContent:"flex-end",gap:24,flex:1,minWidth:0},children:[e.jsx(Ht,{meta:ct,callPurpose:Fe,classification:xn,outcomeQuality:ie||"Neutral",dimensions:gn,resolutionOutcome:re,customerIntent:T,location:ae??Z.location??Z.location_name??pe.location,interactionId:de??Z.interaction_id,moreDetails:X,canShowEditButton:jn,onEditInteraction:Xt}),(()=>{var mt,vt;const s=ft||{},v=s.difficulty,j=s.difficulty_band,S=s.p_expected,D=s.score_impact??S,E=s.lift_raw,A=s.lift_display,U=(mt=s.interpretation)==null?void 0:mt.lift_band,se=s.p_full,ne=(vt=s.interpretation)==null?void 0:vt.description;if(!(v!=null||j!=null||E!=null||U!=null||se!=null||ne!=null))return null;const $e=(fe,De,zn)=>Math.max(De,Math.min(zn,fe)),wn=v!=null?$e((v-50)/50,-1,1):0,kn=E!=null?$e(E*3,-1,1):0,xt=D!=null?Math.round(D*100):null,yt=fe=>{if(fe)return String(fe).split("_").map(De=>De.charAt(0).toUpperCase()+De.slice(1).toLowerCase()).join(" ")},Cn=yt(j),Fn=yt(U),In=(()=>{if(typeof A=="string"){const fe=parseFloat(A.replace("%",""));if(Number.isFinite(fe))return fe}return E!=null?Math.round(E*100):null})(),Wn=se!=null?Math.round(se*100):null,Dn={label:"Outcome",direction:"neutral"};return e.jsx(Mn.AgentLiftAnalysisCard,{title:Ie?"Score":"Agent Lift Analysis",status:Dn,showInfoIcon:!Ie,interactionDifficulty:Ie?void 0:{value:v!=null?wn:null,label:Cn,sublabel:"Based on interaction type",footer:xt!=null?`${xt}% Score impact`:void 0},agentImpact:Ie?void 0:{value:E!=null?kn:null,label:Fn,sublabel:ne,impactPercent:In,isLearning:String(U??"").toLowerCase()==="learning"},outcome:{percent:Wn,label:"Outcome",description:"Based on interaction difficulty and agent contribution."}})})()]})]})]}),e.jsx("div",{ref:nt,style:{paddingTop:24},children:e.jsx(Gt,{data:o?null:yn,loading:o})}),e.jsxs("div",{ref:ke,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(a.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(Rt,{signals:mn,expandedSignals:nn,toggleSignal:cn,playEvidence:dt,highlightTurns:dn,onShowInTranscript:at,timelinePlaying:p||Je,currentTimeSeconds:f??et})}),e.jsx("div",{style:{flex:1,minWidth:0},children:e.jsx(Mt.UpdatedInteractionRecording,{ref:ce,audioUrl:r,durationSeconds:ct.duration_seconds,audioRef:d,agentName:Be,customerName:me,currentTimeSeconds:f,timelinePlaying:p,playbackRate:w,timelineSegments:b,onSeek:M,onTogglePlay:g,onSeekBack:C,onSeekForward:F,onSetPlaybackRate:I,transcript:R,activeTurnIndex:N,turnObservations:L,highlightedTurns:O,onTurnPlayPause:y,setExpandedSignals:Qe})})]})]}),(()=>{const s=(V==null?void 0:V.products)??Ge??[],v=(V==null?void 0:V.services)??He??[];return!s.length&&!v.length?null:e.jsx("div",{ref:it,style:{paddingTop:24},children:e.jsx(Pt,{products:s,services:v})})})(),e.jsx("div",{ref:rt,style:{paddingTop:24},children:e.jsxs(Bt,{comments:Ze,totalComments:Ze.length,currentUser:$,onSendComment:Kt||(()=>{}),onSendReply:Vt||(()=>{}),onReply:Zt||(()=>{}),onEdit:Qt||(()=>{}),onDelete:Jt||(()=>{}),onMenuClick:Ut||(()=>{}),onMarkResolved:en||(()=>{}),isResolved:tn,children:[e.jsx(Nt,{items:ut,summary:Yt,guidanceCount:ut.length,onPlayEvidence:dt,onShowInTranscript:at,timelinePlaying:p||Je,currentTimeSeconds:f??et}),e.jsx(fi,{summary:qt})]})})]}),e.jsx(Gn.SideDrawer,{open:rn,onClose:()=>we(!1),title:e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,minWidth:0},children:[e.jsx("div",{style:{width:34,height:34,borderRadius:"50%",background:"var(--surface-hover, #F3F7F7)",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:e.jsx(a.CircleUser,{size:20,color:"var(--Grey-Strong, #2E3236)",strokeWidth:1.7})}),e.jsx("div",{style:{minWidth:0},children:e.jsx("div",{style:{fontSize:16,fontWeight:600,color:"var(--Grey-Strong, #2E3236)",lineHeight:1.2,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:me})})]}),subtitle:Le?e.jsxs("span",{style:{fontSize:13,fontWeight:400,color:"var(--Grey-Muted, #808183)",lineHeight:1.5},children:[Ne," Interactions"]}):null,width:470,height:"100vh",topOffset:70,footer:Le?e.jsx("div",{style:{width:"100%",display:"flex",justifyContent:"center"},children:e.jsxs("button",{onClick:()=>{qe&&qe(),we(!1)},style:{display:"flex",height:40,padding:"0 20px 0 18px",justifyContent:"center",alignItems:"center",gap:7,background:"var(--Grey-White, #FFF)",border:"1px solid var(--Grey-absent, #D9D9D9)",borderRadius:10,cursor:"pointer"},children:[e.jsx(a.History,{size:18,color:"var(--Grey-Muted, #808183)",strokeWidth:1.5}),e.jsx("span",{style:{fontSize:15,fontWeight:600,color:"var(--Grey-Strong, #2E3236)"},children:"View All Interactions"})]})}):null,children:e.jsx("div",{style:{borderTop:"1px solid var(--Grey-absent, #D9D9D9)",maxHeight:"100%",overflowY:"auto"},children:Le?Te.map((s,v)=>{const j=!!s.isCurrent,S=!j&&ln===v,D=xi(s,Fe.interaction_direction),E=D==="outbound"?a.PhoneOutgoing:a.PhoneIncoming;return e.jsxs("div",{onClick:j?void 0:()=>{Ye&&Ye(s),we(!1)},onMouseEnter:j?void 0:()=>Xe(v),onMouseLeave:j?void 0:()=>Xe(null),"aria-current":j?"page":void 0,style:{display:"flex",justifyContent:"space-between",alignItems:"center",gap:12,padding:"16px 12px",borderTop:v===0?"none":"1px solid var(--Grey-absent, #D9D9D9)",background:j?"#E3E1D7":S?"var(--surface-hover, #F3F7F7)":"var(--Grey-White, #FFF)",cursor:j?"default":"pointer",transition:"background 0.15s"},children:[e.jsxs("div",{style:{minWidth:0},children:[e.jsxs("div",{style:{fontSize:j?15:14,display:"flex",alignItems:"center",gap:6,fontWeight:j?500:400,color:"var(--Grey-Strong, #2E3236)",lineHeight:1.2,marginBottom:8,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:[D&&e.jsx(E,{size:16,color:"var(--Grey-Muted, #808183)",strokeWidth:1.5,style:{flexShrink:0},"aria-hidden":!0}),e.jsx("span",{style:{overflow:"hidden",textOverflow:"ellipsis",minWidth:0},children:s.title})]}),s.status&&e.jsxs("div",{style:{fontSize:13,color:"var(--Grey-Strong, #2E3236)",marginBottom:12,lineHeight:1.2},children:[e.jsx("span",{style:{fontWeight:400},children:"Location: "}),e.jsx("span",{style:{fontWeight:400,color:"var(--Grey-Muted, #808183)"},children:s.location})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:14,flexWrap:"wrap"},children:[e.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:6,fontSize:13,fontWeight:400,color:"var(--Grey-Muted, #808183)",lineHeight:1.1},children:[e.jsx(a.CalendarDays,{size:16,color:"var(--Grey-Muted, #808183)",strokeWidth:1.8}),s.date]}),(s.agent||s.agent_name)&&e.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:6,fontSize:13,fontWeight:400,color:"var(--Grey-Muted, #808183)",lineHeight:1.1},children:[e.jsx(a.Headset,{size:16,color:"var(--Grey-Muted, #808183)",strokeWidth:1.8}),s.agent||s.agent_name]})]})]}),!j&&S&&e.jsx(a.ExternalLink,{size:20,color:"var(--Grey-Muted, #808183)",strokeWidth:1.7,style:{flexShrink:0}})]},s.id||v)}):e.jsx("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",minHeight:140,padding:"24px 12px",color:"var(--Grey-Muted, #808183)",fontSize:14,fontStyle:"italic",textAlign:"center"},children:"No other interactions available"})})})]})},H={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))"},q=1.2,Dt=3,zt=t=>t!=null?Math.round(t*100)+"%":"—",mi=t=>{if(t==null)return"—";const n=(t*100).toFixed(1);return t>0?`+${n}pp`:`${n}pp`},vi=({outcomeLift:t,driverLabels:n=[],showOutcomeOnly:i=!1})=>{var C;if(!t||t.lift==null)return null;const l=t.p_expected,o=t.p_full,r=t.lift_raw??(o!=null&&l!=null?o-l:null),d=t.lift,f=(C=t.interpretation)!=null&&C.lift_band?t.interpretation.lift_band.replace(/_/g," "):d>=0?"Positive":"Negative",p=f.charAt(0).toUpperCase()+f.slice(1),b=/negative/i.test(f)?a.ThumbsDown:a.ThumbsUp,M=n.slice(0,Dt),g=n.length-Dt;return e.jsxs("div",{style:{display:"flex",flexDirection:"column",padding:24,gap:i?16:24,borderRadius:8,border:`1px solid ${H.absent}`,background:i?"#faf9f5":H.cardBg,alignSelf:"stretch"},children:[e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:i?24: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:H.strong,fontFamily:"var(--font-sans)",lineHeight:q},children:"Agent Lift Analysis"}),e.jsx("div",{style:{display:"flex",alignItems:"center",gap:8,fontFamily:"var(--font-sans)"},children:e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,paddingLeft:8},children:[e.jsx(b,{size:14,color:H.strong}),e.jsx("span",{style:{fontSize:13,fontWeight:600,color:H.strong,lineHeight:q},children:p})]})})]}),e.jsxs("div",{style:{display:"flex",gap:24,alignItems:"center",...i?{justifyContent:"center",width:"100%"}:{}},children:[!i&&e.jsxs(e.Fragment,{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:H.muted,fontFamily:"var(--font-sans)",lineHeight:q},children:zt(l)}),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:H.strong,fontFamily:"var(--font-sans)",lineHeight:q,whiteSpace:"nowrap"},children:"Expected Outcome"}),e.jsx("span",{style:{fontSize:13,fontWeight:400,color:H.muted,fontFamily:"var(--font-sans)",lineHeight:q,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 ${H.absent}`,flex:1,minWidth:0},children:[e.jsx("span",{style:{fontSize:28,fontWeight:400,color:H.muted,fontFamily:"var(--font-sans)",lineHeight:q},children:mi(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:H.strong,fontFamily:"var(--font-sans)",lineHeight:q,whiteSpace:"nowrap"},children:"Agent Impact"}),e.jsx("span",{style:{fontSize:13,fontWeight:400,color:H.muted,fontFamily:"var(--font-sans)",lineHeight:q,textAlign:"left"},children:"Behavior-driven change"})]})]})]}),e.jsxs("div",{style:{display:"flex",flexDirection:i?"row":"column",gap:16,alignItems:i?"center":"flex-start",justifyContent:i?"center":void 0,...i?{}:{paddingLeft:24,borderLeft:`1px solid ${H.absent}`,flex:1,minWidth:0}},children:[e.jsx("div",{style:{display:"flex",alignItems:"center",gap:4},children:e.jsx("span",{style:{fontSize:28,fontWeight:400,color:H.strong,fontFamily:"var(--font-sans)",lineHeight:q},children:zt(o)})}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8,alignItems:"flex-start",minHeight:i?void 0:48},children:[e.jsx("div",{style:{display:"flex",alignItems:"center",gap:4},children:e.jsx("span",{style:{fontSize:13,fontWeight:i?400:600,color:H.strong,fontFamily:"var(--font-sans)",lineHeight:q,whiteSpace:"nowrap"},children:"Outcome"})}),e.jsx("span",{style:{fontSize:13,fontWeight:400,color:H.muted,fontFamily:"var(--font-sans)",lineHeight:q,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:H.strong,fontFamily:"var(--font-sans)",lineHeight:q},children:"Key Drivers"}),e.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:4},children:[M.map((F,I)=>e.jsx("div",{style:{display:"flex",padding:8,alignItems:"center",justifyContent:"center",borderRadius:4,border:`1px solid ${H.absent}`,background:H.white},children:e.jsx("span",{style:{fontSize:12,fontWeight:400,color:H.strong,fontFamily:"var(--font-sans)",lineHeight:q,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:200},children:F})},I)),g>0&&e.jsx("div",{style:{display:"flex",padding:8,alignItems:"center",justifyContent:"center",borderRadius:4,border:`1px solid ${H.absent}`,background:H.white},children:e.jsxs("span",{style:{fontSize:12,fontWeight:400,color:H.strong,fontFamily:"var(--font-sans)",lineHeight:q,whiteSpace:"nowrap"},children:["+ ",g]})})]})]})]})};exports.UpdatedInteractionRecording=Mt.UpdatedInteractionRecording;exports.UpdatedCoachingSynthesisCard=Gt;exports.UpdatedCompassScore=_t;exports.UpdatedGuidance=Nt;exports.UpdatedInteractionContext=Ht;exports.UpdatedInteractionDetails=yi;exports.UpdatedInteractionScores=vi;exports.UpdatedInteractionSignals=Rt;exports.UpdatedProductsServices=Pt;exports.UpdatedThreads=Bt;
|
|
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:B.muted,fontWeight:500,textAlign:"center"},children:"Synthesizing coaching summary..."})]})]});if(i)return e.jsx("div",{style:{fontSize:14,color:B.muted},children:"Unable to generate coaching summary."});if(!t)return null;const l=t.strengths||[],o=t.improvements||[],r=typeof t.one_liner=="string"?t.one_liner:((f=t.one_liner)==null?void 0:f.text)||"",d=typeof t.context=="string"?t.context:((p=t.context)==null?void 0:p.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(a.ShieldCheck,{size:20,color:B.accent,strokeWidth:2}),e.jsx("span",{style:{fontSize:16,fontWeight:600,color:B.strong,fontFamily:"var(--font-sans)",lineHeight:1.2,textTransform:"uppercase"},children:"Coaching Summary"})]}),r&&e.jsx("div",{style:{fontSize:14,fontWeight:500,color:B.strong,fontFamily:"var(--font-sans)",lineHeight:1.5},children:r}),e.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:16,justifyContent:"space-between"},children:[d&&e.jsx("div",{style:{fontSize:14,fontWeight:400,color:B.muted,fontFamily:"var(--font-sans)",lineHeight:1.5,flex:1},children:d}),t.overall&&e.jsx(En,{overall:t.overall})]}),(l.length>0||o.length>0)&&e.jsxs("div",{style:{display:"flex",gap:24,paddingTop:24,borderTop:`1px solid ${B.absent}`},children:[e.jsx(bt,{icon:e.jsx(a.TrendingUp,{size:14,color:B.strong,strokeWidth:1.5}),label:"Key Strengths",items:l}),e.jsx(bt,{icon:e.jsx(a.Lightbulb,{size:14,color:B.strong,strokeWidth:1.5}),label:"Improvements",items:o})]})]})};function Ln(t){const n=Math.floor(t/60),i=Math.round(t%60);return`${n}:${i.toString().padStart(2,"0")}`}const Bn={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)"};function Nn({text:t,style:n}){const i=u.useRef(null),[l,o]=u.useState(!1);return u.useEffect(()=>{const r=i.current;if(!r)return;const d=()=>o(r.scrollWidth>r.clientWidth);if(d(),typeof ResizeObserver>"u")return;const f=new ResizeObserver(d);return f.observe(r),()=>f.disconnect()},[t]),e.jsx("span",{ref:i,title:l&&t!=null?String(t):void 0,style:n,children:t})}const St={display:"flex",flexDirection:"column",flex:"1 0 0",gap:0,minWidth:0},Ht=({meta:t={},callPurpose:n={},classification:i={},dimensions:l=[],outcomeQuality:o="Neutral",onMoreDetails:r,moreDetails:d=[],resolutionOutcome:f,customerIntent:p,location:w,canShowEditButton:b=!1,onEditInteraction:M})=>{const[g,C]=u.useState(!1),F=u.useRef(null),I=t.duration_seconds!=null?Ln(t.duration_seconds):null,G=t.message_count,_=n.interaction_driver,k=i.interaction_paradigm,W=x=>l.find(Y=>(Y.key||"").toLowerCase().includes(x)),R=W("resolution_outcome"),N=W("customer_intent"),L=W("location"),O=W("outcome_quality"),y=x=>x?x.replace(/_/g," ").replace(/\b\w/g,Y=>Y.toUpperCase()):null,m=o!=="Neutral"?o:O?y(O.value):o,h=f??(R?y(R.value):null),P=p??(N?y(N.value):null),ee=w??(L?y(L.value):null),ie=k!=null?y(k):null,re=new Set(["resolution_outcome","customer_intent","location","outcome_quality"].map(x=>`dim.${x}`)),T=l.filter(x=>!re.has(x.key)),ae=[],de=[[I!=null?{label:"Duration",value:I}:null,G!=null?{label:"Messages",value:G}:null],[_!=null?{label:"Driver",value:_}:null,ee!=null?{label:"Location",value:ee}:null]];for(let x=0;x<T.length;x+=2){const Y=T[x]?{label:T[x].display_name||T[x].label||T[x].key,value:y(T[x].value)}:null,c=T[x+1]?{label:T[x+1].display_name||T[x+1].label||T[x+1].key,value:y(T[x+1].value)}:null;de.push([Y,c])}de.push([{label:"Outcome Quality",value:m},{isMoreDetails:!0}]),de.forEach(x=>ae.push(x));const X=[h!=null&&{label:"Resolution Outcome",value:h},P!=null&&{label:"Customer Intent",value:P},ie!=null&&{label:"Paradigm",value:ie},...d||[]].filter(Boolean);u.useEffect(()=>{if(!g)return;const x=Y=>{F.current&&!F.current.contains(Y.target)&&C(!1)};return document.addEventListener("mousedown",x),()=>document.removeEventListener("mousedown",x)},[g]);const ge=x=>e.jsxs("div",{style:Bn,children:[e.jsx("span",{style:{color:"var(--Grey-Strong, #2E3236)",whiteSpace:"nowrap",flexShrink:0},children:x.label}),e.jsx(Nn,{text:x.value,style:{color:"var(--Grey-Muted, #808183)",textAlign:"right",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minWidth:0,flex:1}})]},x.label),he=()=>e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:12,padding:"8px 8px 12px 8px",fontFamily:"var(--font-sans)",borderBottom:"none",minHeight:33},children:[e.jsxs("button",{onClick:()=>{C(x=>!x),r&&!g&&r()},style:{display:"flex",alignItems:"center",gap:6,background:"none",border:"none",cursor:"pointer",padding:0,color:"var(--Grey-Strong, #2E3236)",fontSize:13,fontWeight:500,lineHeight:"normal",fontFamily:"var(--font-sans)",whiteSpace:"nowrap",flexShrink:0},children:[e.jsx("span",{children:"More Details"}),g?e.jsx(a.ChevronUp,{size:16,color:"var(--Grey-Muted, #808183)",strokeWidth:1.5}):e.jsx(a.ChevronDown,{size:16,color:"var(--Grey-Muted, #808183)",strokeWidth:1.5})]}),b&&e.jsxs("button",{onClick:M||(()=>{}),style:{display:"flex",alignItems:"center",gap:6,padding:"5px 12px",background:"var(--Grey-White, #FFF)",border:"1px solid var(--Grey-absent, #D9D9D9)",borderRadius:12,color:"var(--Grey-Strong, #2E3236)",fontSize:13,fontWeight:500,lineHeight:"normal",fontFamily:"var(--font-sans)",cursor:"pointer",flexShrink:0},children:[e.jsx(a.Pencil,{size:15,color:"var(--Grey-Strong, #2E3236)",strokeWidth:1.5}),e.jsx("span",{style:{fontSize:13,lineHeight:"normal"},children:"Edit"})]})]},"more-details");return e.jsxs("div",{ref:F,style:{display:"flex",flexDirection:"column",alignSelf:"stretch",gap:0,position:"relative",overflow:"visible"},children:[ae.map((x,Y)=>{var c;return e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:24,alignSelf:"stretch",flexWrap:"nowrap"},children:[e.jsx("div",{style:St,children:x[0]&&!x[0].isMoreDetails?ge(x[0]):e.jsx("div",{style:{flex:1}})}),e.jsx("div",{style:St,children:x[1]&&!x[1].isMoreDetails?ge(x[1]):(c=x[1])!=null&&c.isMoreDetails?he():e.jsx("div",{style:{flex:1}})})]},Y)}),g&&X.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"}),X.map(x=>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:x.label}),e.jsx("span",{style:{color:"var(--Grey-Muted, #808183)",fontSize:13,fontStyle:"normal",fontWeight:400,lineHeight:"120%",textAlign:"right"},children:x.value})]},x.label))]})]})},wt=({children:t,size:n=28,onClick:i,title:l})=>{const[o,r]=u.useState(!1);return e.jsx("div",{title:l,onClick:i,onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!1),style:{display:"flex",alignItems:"center",justifyContent:"center",width:n,height:n,borderRadius:9999,background:o?"var(--surface-hover, #F3F7F7)":"transparent",cursor:"pointer",flexShrink:0,transition:"background 0.15s"},children:t})},Rt=({signals:t={signals:[],present_count:0,total_signals_evaluated:0},expandedSignals:n=new Set,toggleSignal:i=()=>{},playEvidence:l=()=>{},highlightTurns:o=()=>{},onShowInTranscript:r=()=>{},timelinePlaying:d=!1,currentTimeSeconds:f=0})=>{const p=(t==null?void 0:t.signals)??[],w=(t==null?void 0:t.present_count)??p.length,b=g=>{const C=Math.floor(g/6e4),F=Math.floor(g%6e4/1e3);return`${C.toString().padStart(2,"0")}:${F.toString().padStart(2,"0")}`},M=g=>d&&g.start_ms!=null&&f*1e3>=g.start_ms&&f*1e3<=(g.end_ms??g.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(a.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:16,fontWeight:500,color:"var(--Grey-Strong, #2E3236)",fontFamily:"var(--default-font-family)"},children:"Signals"}),e.jsxs("span",{style:{fontSize:14,fontWeight:500,color:"var(--Grey-Strong, #2E3236)",fontFamily:"var(--default-font-family)"},children:[w," Signals Detected"]})]})]}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",alignSelf:"stretch",background:"var(--Grey-White, #FFF)",gap:8},children:[p.length===0&&e.jsx("div",{style:{padding:"8px 0",fontSize:14,color:"var(--Grey-Muted, #808183)"},children:"No signals detected."}),p.map((g,C)=>{var _,k,W;const F=g.key??g.id??C,I=n.has(F),G=((_=g.observations)==null?void 0:_.length)??0;return e.jsxs("div",{id:`signal-${F}`,style:{display:"flex",flexDirection:"column",width:"100%",gap:8},children:[e.jsxs("button",{onClick:()=>i(F),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:[g.display_name||((k=g.key)==null?void 0:k.replace(/_/g," ")),G>0&&e.jsxs("span",{style:{fontWeight:600,color:"var(--text-dark, #0B0A0A)",marginLeft:6},children:["(",G,")"]})]}),I?e.jsx(a.ChevronUp,{size:20,color:"#767473"}):e.jsx(a.ChevronDown,{size:20,color:"#767473"})]}),I&&((W=g.observations)==null?void 0:W.length)>0&&e.jsx("div",{style:{display:"flex",flexDirection:"column",alignSelf:"stretch",gap:0},children:g.observations.map((R,N)=>{var L,O,y;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:R.reason||R.explanation}),((O=(L=R.evidence)==null?void 0:L[0])==null?void 0:O.start_ms)!=null&&e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,flexShrink:0},children:[e.jsx(wt,{size:28,title:"Show in transcript",onClick:m=>{m.stopPropagation(),r(R.evidence[0].start_ms)},children:e.jsx(a.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:b(R.evidence[0].start_ms)})]})]}),(y=R.evidence)==null?void 0:y.map((m,h)=>{const P=m.start_ms!=null&&m.end_ms!=null;return m.text&&e.jsxs("div",{onClick:ee=>{ee.stopPropagation(),P&&l(m)},onMouseEnter:()=>o(m.turn_ids??[]),onMouseLeave:()=>o([]),style:{display:"flex",alignItems:"center",gap:8,padding:"8px 0",cursor:P?"pointer":"default"},children:[P&&e.jsx(wt,{size:28,children:M(m)?e.jsx(a.PauseCircle,{size:17,color:"var(--Grey-Muted, #808183)",strokeWidth:1.5}):e.jsx(a.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:["“",m.text,"”"]})]},h)})]},R.key??N)})})]},F)})]})]})},K={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)"},Pn=({score:t=4,minScore:n=0,maxScore:i=5})=>{const b=Number(t),M=Number.isFinite(b)?Math.min(Math.max(b,n),i):n,g=i>n?(M-n)/(i-n)*5:0,C=180/5,F=_=>{const k=_*Math.PI/180;return{x:121.5+85*Math.cos(k),y:123-85*Math.sin(k)}},I=(_,k)=>{const W=F(_),R=F(k),N=_-k>180?1:0;return`M ${W.x} ${W.y} A 85 85 0 ${N} 1 ${R.x} ${R.y}`},G=2;return e.jsx("svg",{width:"100%",viewBox:"0 0 243 130",fill:"none",style:{maxWidth:243},children:Array.from({length:5},(_,k)=>{const W=180-k*C-(k>0?G/2:0),R=180-(k+1)*C+(k<5-1?G/2:0),N=Math.max(0,Math.min(1,g-k)),L=I(W,R);return e.jsxs("g",{children:[e.jsx("path",{d:L,stroke:K.track,strokeWidth:30,strokeLinecap:"butt",fill:"none"}),N>0&&e.jsx("path",{d:L,stroke:K.strong,strokeWidth:30,strokeLinecap:"butt",fill:"none",pathLength:1,strokeDasharray:`${N} 1`})]},k)})})},$n=({value:t=0,maxValue:n=5})=>{const i=Number(t),l=Number.isFinite(i)?Math.min(Math.max(i,0),n):0;return e.jsx("div",{style:{display:"flex",gap:2},children:Array.from({length:n},(o,r)=>{const d=Math.max(0,Math.min(1,l-r));return e.jsx("div",{style:{width:22,height:6,borderRadius:1,background:K.track,overflow:"hidden"},children:d>0&&e.jsx("div",{style:{width:`${d*100}%`,height:"100%",background:K.strong}})},r)})})},On={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"},Yn=({text:t,children:n})=>{const[i,l]=u.useState(!1),o=u.useRef(null),[r,d]=u.useState({top:0,left:0}),f=()=>{if(o.current){const p=o.current.getBoundingClientRect();d({top:p.top-8,left:p.left+p.width/2})}l(!0)};return e.jsxs("div",{ref:o,style:{position:"relative",display:"inline-flex"},onMouseEnter:f,onMouseLeave:()=>l(!1),children:[n,i&&e.jsx("div",{style:{position:"fixed",top:r.top,left:r.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})})]})},qn=({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:K.strong,fontFamily:"var(--font-sans)",lineHeight:"normal"},children:t}),e.jsx(Yn,{text:On[t]||t,children:e.jsx(a.Info,{size:14,color:K.infoIcon,strokeWidth:1,style:{cursor:"pointer"}})})]}),e.jsx($n,{value:n,maxValue:i})]}),_t=({score:t=4,minScore:n=0,maxScore:i=5,predictedScore:l=4,predictedLabel:o="Predicted Objective",description:r="",legends:d=[{label:"CSAT",value:3},{label:"Resolution",value:4},{label:"Process Adherence",value:5},{label:"Communication",value:3}]})=>{const f=Number(t),p=Number.isFinite(f)?Math.min(Math.max(f,n),i):n,w=p.toFixed(1);return e.jsxs("div",{style:{display:"flex",flexDirection:"column",padding:24,borderRadius:8,border:`1px solid ${K.absent}`,background:K.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:K.strong,fontFamily:"var(--font-sans)",lineHeight:1.2},children:"Interaction Quality"}),e.jsx("span",{style:{fontSize:14,fontWeight:400,color:K.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(Pn,{score:t,minScore:n,maxScore:i}),(()=>{const g=-(180-(i>n?(p-n)/(i-n):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(${g}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:K.strong,fontFamily:"var(--font-sans)",lineHeight:1,textAlign:"center",marginTop:8},children:w}),e.jsx("div",{style:{fontSize:15,fontWeight:500,color:K.strong,fontFamily:"var(--font-sans)",lineHeight:1.2,textAlign:"center",marginTop:8},children:"Compass Score"})]}),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:K.strong,fontFamily:"var(--font-sans)",lineHeight:1.2,textAlign:"left"},children:"Interaction Quality Index"}),e.jsx("div",{style:{width:"100%",height:1,background:K.absent}}),d.map((b,M)=>e.jsx(qn,{label:b.label,value:b.value},M))]})]})]})},Et=t=>{if(!t)return null;const i=String(t).trim().toLowerCase().split(/[^a-z]+/).filter(Boolean);return i.includes("supervisor")?"var(--rail-compliance, #C98A5A)":i.includes("admin")||i.includes("administrator")||i.includes("superadmin")?"var(--rail-discovery, #5E88B0)":i.includes("agent")?"var(--rail-outcome, #6B7C93)":null},Kn=t=>{var l,o,r,d,f,p;if(!t)return null;const n=t.role??t.userRole??t.user_role??t.author_role??t.roleName??t.role_name??t.userType??t.user_type??t.type;if(typeof n=="string")return n;if(Array.isArray(n))return n.join(" ");if(n&&typeof n=="object")return n.name||n.value||n.label||null;const i=((l=t.user)==null?void 0:l.role)??((o=t.user)==null?void 0:o.userRole)??((r=t.user)==null?void 0:r.user_role)??((d=t.profile)==null?void 0:d.role)??((f=t.profile)==null?void 0:f.userRole)??((p=t.profile)==null?void 0:p.user_role);return typeof i=="string"?i:Array.isArray(i)?i.join(" "):i&&typeof i=="object"&&(i.name||i.value||i.label)||null},At=t=>{if(!t)return"#6B7C93";const n=Kn(t);return Et(n)||t.color||"#6B7C93"},Me=t=>(t||"").split(" ").map(n=>n[0]).join("").toUpperCase()||"U",Vn=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))},Zn=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 o=new Date().getTime()-i.getTime(),r=Math.floor(o/6e4),d=Math.floor(o/36e5);if(r<1)return"Just now";if(r<60)return`${r} min`;if(d<24)return`${d} h`;const f=Math.floor(d/24);return f===1?"1 day":`${f} days`}catch{return t}},Tt=({name:t,initials:n,color:i,avatar:l,size:o=36})=>l?e.jsx("img",{src:l,alt:t,style:{width:o,height:o,borderRadius:"50%",objectFit:"cover",flexShrink:0}}):e.jsx("div",{style:{width:o,height:o,borderRadius:"50%",background:i||"#6B7C93",color:"#FFF",display:"flex",alignItems:"center",justifyContent:"center",fontSize:o<=32?"10px":"11px",fontWeight:650,flexShrink:0,fontFamily:"var(--default-font-family)",letterSpacing:"0.02em"},title:t,children:n||Me(t)}),Qn=({comment:t,isReply:n=!1,isConsecutive:i=!1,onReply:l,onSendReply:o,onEdit:r,onDelete:d,onMenuClick:f,showReply:p=!0})=>{var x,Y;const[w,b]=u.useState(!1),[M,g]=u.useState(!1),[C,F]=u.useState(!1),[I,G]=u.useState(""),[_,k]=u.useState(!1),[W,R]=u.useState(""),[N,L]=u.useState(!1),O=u.useRef(null),y=u.useRef(null),m=u.useRef(null),h=t.author||{},P=h.name||t.author_name||"Unknown",ee=h.initials||Me(P),ie=h.role||t.author_role,re=h.color||Et(ie)||"#6B7C93",T=h.avatar||t.avatar,ae=t.timestamp||t.created_at,de=Zn(ae),X=Vn(ae),ge=!!(t.isEdited||t.is_edited||t.edited),he=Array.isArray(t.content)?t.content:[t.content||t.text||""];return u.useEffect(()=>{if(!M)return;const c=J=>{O.current&&!O.current.contains(J.target)&&g(!1)};return document.addEventListener("mousedown",c),()=>document.removeEventListener("mousedown",c)},[M]),u.useEffect(()=>{const c=y.current;if(!c)return;c.style.height="auto";const J=140;c.style.height=Math.min(c.scrollHeight,J)+"px",c.style.overflowY=c.scrollHeight>J?"auto":"hidden"},[I,C]),u.useEffect(()=>{const c=m.current;if(!c)return;c.style.height="auto";const J=140;c.style.height=Math.min(c.scrollHeight,J)+"px",c.style.overflowY=c.scrollHeight>J?"auto":"hidden"},[W,_]),e.jsxs("div",{onMouseEnter:()=>b(!0),onMouseLeave:()=>b(!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(Tt,{name:P,initials:ee,color:re,avatar:T}),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:P}),e.jsx("span",{style:{fontSize:12,fontWeight:400,color:"var(--Grey-Muted, #808183)",lineHeight:"150%",fontFamily:"var(--default-font-family)"},children:de}),ge&&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:O,children:[e.jsx("button",{type:"button",onClick:()=>g(c=>!c),style:{padding:2,border:"none",background:"transparent",cursor:"pointer",borderRadius:4,display:"flex",alignItems:"center",justifyContent:"center",opacity:w||M?1:0,transition:"opacity 0.15s",flexShrink:0},children:e.jsx(a.Ellipsis,{size:24,color:"var(--Grey-Muted, #808183)"})}),M&&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:()=>{g(!1),k(!1),F(!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"}),r&&e.jsx("button",{type:"button",disabled:!X,onClick:()=>{if(!X)return;g(!1);const c=Array.isArray(t.content)?t.content.join(`
|
|
16
|
+
`):t.content||t.text||"";R(c),k(!0),F(!1)},style:{display:"flex",width:"100%",padding:"10px 16px",alignItems:"center",border:"none",background:"transparent",cursor:X?"pointer":"not-allowed",fontSize:13,fontWeight:400,color:X?"var(--Grey-Strong, #2E3236)":"var(--Grey-Muted, #808183)",fontFamily:"var(--default-font-family)",lineHeight:"150%",textAlign:"left",opacity:X?1:.5},onMouseEnter:c=>{X&&(c.currentTarget.style.background="var(--surface-hover, #F3F7F7)")},onMouseLeave:c=>{c.currentTarget.style.background="transparent"},children:"Edit"}),d&&e.jsx("button",{type:"button",onClick:()=>{g(!1),L(!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.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:["“"," ",((x=t.author)==null?void 0:x.name)||"Unknown"]}),e.jsx("button",{type:"button",onClick:()=>k(!1),style:{display:"flex",alignItems:"center",justifyContent:"center",background:"none",border:"none",cursor:"pointer",padding:0},children:e.jsx(a.X,{size:20,color:"var(--Grey-Muted, #808183)"})})]}),e.jsxs("div",{style:{display:"flex",alignItems:"flex-end",gap:8,width:"100%"},children:[e.jsx("textarea",{ref:m,value:W,onChange:c=>R(c.target.value),onKeyDown:c=>{if(c.key==="Enter"){if(c.metaKey||c.ctrlKey||c.shiftKey)return;c.preventDefault(),W.trim()&&(r==null||r({...t,content:W.trim(),isEdited:!0}),k(!1))}c.key==="Escape"&&k(!1)},autoFocus:!0,rows:1,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",resize:"none",minHeight:24,maxHeight:140,overflowY:"hidden"}}),e.jsx("button",{type:"button",onClick:()=>{W.trim()&&(r==null||r({...t,content:W.trim(),isEdited:!0}),k(!1))},disabled:!W.trim(),style:{display:"flex",padding:"6px 16px",justifyContent:"center",alignItems:"center",fontSize:13,fontWeight:600,color:W.trim()?"var(--Grey-White, #FFF)":"var(--Grey-Muted, #808183)",background:W.trim()?"var(--Grey-Strong, #2E3236)":"var(--grey-light, #e9e8e8a1)",border:"none",borderRadius:6,cursor:W.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:he.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",whiteSpace:"pre-wrap"},children:c},J))}),N&&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:()=>{L(!1),d==null||d(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:()=>L(!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"})]}),p&&l&&!C&&!N&&e.jsxs("button",{type:"button",onClick:()=>{k(!1),F(!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(a.CornerDownRight,{size:20,color:"var(--Grey-Muted, #808183)",strokeWidth:1.5}),"Reply"]}),C&&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:["“"," ",((Y=t.author)==null?void 0:Y.name)||"Unknown"]}),e.jsx("button",{type:"button",onClick:()=>{G(""),F(!1)},style:{display:"flex",alignItems:"center",justifyContent:"center",background:"none",border:"none",cursor:"pointer",padding:0},children:e.jsx(a.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:"flex-end",gap:8,width:"100%"},children:[e.jsx("textarea",{ref:y,value:I,onChange:c=>G(c.target.value),onKeyDown:c=>{if(c.key==="Enter"){if(c.metaKey||c.ctrlKey||c.shiftKey)return;c.preventDefault(),I.trim()&&(o==null||o({content:I.trim(),parentId:t.id}),G(""),F(!1))}c.key==="Escape"&&(G(""),F(!1))},autoFocus:!0,placeholder:"Add a reply",rows:1,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",resize:"none",minHeight:24,maxHeight:140,overflowY:"hidden"}}),e.jsx("button",{type:"button",onClick:()=>{I.trim()&&(o==null||o({content:I.trim(),parentId:t.id}),G(""),F(!1))},disabled:!I.trim(),style:{display:"flex",height:28,padding:"8px 12px",justifyContent:"center",alignItems:"center",gap:8,fontSize:13,fontWeight:600,color:I.trim()?"var(--Grey-White, #FFF)":"var(--Grey-Muted, #808183)",background:I.trim()?"var(--Neutral-850, #272727)":"var(--grey-light, #e9e8e8a1)",border:"none",borderRadius:10,cursor:I.trim()?"pointer":"not-allowed",fontFamily:"var(--default-font-family)",lineHeight:"150%"},children:"Post"})]})]})]})]})},Xn=({currentUser:t,onSubmit:n})=>{const[i,l]=u.useState(""),[o,r]=u.useState(!1),d=u.useRef(null);u.useEffect(()=>{const g=d.current;if(!g)return;g.style.height="auto";const C=140;g.style.height=Math.min(g.scrollHeight,C)+"px",g.style.overflowY=g.scrollHeight>C?"auto":"hidden"},[i]);const f=()=>{const g=i.trim();g&&(n==null||n(g),l(""))},p=g=>{if(g.key==="Enter"){if(g.metaKey||g.ctrlKey||g.shiftKey)return;g.preventDefault(),f()}},w=(t==null?void 0:t.initials)||Me(t==null?void 0:t.name),b=At(t),M=t==null?void 0:t.avatar;return e.jsxs("div",{style:{display:"flex",gap:16,alignItems:"flex-start"},children:[e.jsx(Tt,{name:t==null?void 0:t.name,initials:w,color:b,avatar:M}),e.jsx("div",{style:{flex:1,padding:12,display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"flex-start",gap:24,borderRadius:8,border:o?"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:d,value:i,onChange:g=>l(g.target.value),onFocus:()=>r(!0),onBlur:()=>r(!1),onKeyDown:p,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,maxHeight:140,overflowY:"hidden"}}),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"})]})})]})},Lt=({comment:t,depth:n=0,isConsecutive:i=!1,onReply:l,onSendReply:o,onEdit:r,onDelete:d,onMenuClick:f})=>{const p=t.replies&&t.replies.length>0,w=!p;return e.jsxs(u.Fragment,{children:[e.jsx("div",{style:{paddingLeft:n>0?Math.min(n*32,128):0},children:e.jsx(Qn,{comment:t,isReply:n>0,isConsecutive:i,onReply:l,onSendReply:o,onEdit:r,onDelete:d,onMenuClick:f,showReply:w})}),p&&t.replies.map(b=>e.jsx(Lt,{comment:b,depth:n+1,onReply:l,onSendReply:o,onEdit:r,onDelete:d,onMenuClick:f},b.id))]})},Bt=({comments:t=[],totalComments:n,children:i,onSendComment:l,onReply:o,onSendReply:r,onEdit:d,onDelete:f,onMenuClick:p,onMarkResolved:w,currentUser:b,isResolved:M=!1})=>{const[g,C]=u.useState([]),[F,I]=u.useState(!1),G=u.useMemo(()=>{const y=new Set(t.map(h=>h.id)),m=g.filter(h=>!y.has(h.id));return[...t,...m]},[t,g]);u.useEffect(()=>{const y=new Set(t.map(m=>m.id));C(m=>m.filter(h=>!y.has(h.id)))},[t]);const _=u.useMemo(()=>{if(!b)return{name:"You",initials:"YO",color:"#6B7C93"};const y=b.name||"You",m=b.initials||Me(y),h=At(b);return{...b,name:y,initials:m,color:h}},[b]),k=async({content:y,parentId:m})=>{if(r){I(!0);try{await r({content:y,parentId:m})}finally{I(!1)}}else{const h={id:`temp-${Date.now()}`,author:_,content:y,timestamp:"Just now",parentId:m,isOptimistic:!0};C(P=>[...P,h])}},W=async y=>{if(l){I(!0);try{await l(y)}finally{I(!1)}}else{const m={id:`temp-${Date.now()}`,author:_,content:y,timestamp:"Just now",isOptimistic:!0};C(h=>[...h,m])}},R=y=>{C(m=>m.map(h=>h.id===y.id?{...h,content:y.content,isEdited:!0}:h)),d==null||d(y)},N=y=>{C(m=>m.filter(h=>h.id!==y.id)),f==null||f(y)},L=u.useMemo(()=>{const y={};G.forEach(h=>{h.parentId&&(y[h.parentId]||(y[h.parentId]=[]),y[h.parentId].push(h))});const m=h=>({...h,replies:(y[h.id]||[]).map(m)});return G.filter(h=>!h.parentId).map(m)},[G]),O=n??G.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(a.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(a.MessagesSquare,{style:{width:20,height:20,flexShrink:0},color:"var(--Grey-Strong, #2E3236)",strokeWidth:1.5})}),e.jsx("span",{style:{fontSize:16,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:[O," Comment",O!==1?"s":""]}),M?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(a.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"})]}):w?e.jsxs("button",{type:"button",onClick:w,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(a.CircleCheck,{size:16,color:"var(--Grey-Strong, #2E3236)",strokeWidth:1.5}),"Mark as Resolved"]}):null]}),G.length>0&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:0,marginBottom:24,maxHeight:600,overflowY:G.length>6?"auto":"visible"},children:L.map((y,m)=>{var re,T;const h=m>0?L[m-1]:null,P=((re=h==null?void 0:h.author)==null?void 0:re.name)||(h==null?void 0:h.author_name),ee=((T=y.author)==null?void 0:T.name)||y.author_name,ie=h&&P===ee&&(!h.replies||h.replies.length===0);return e.jsx(Lt,{comment:y,depth:0,isConsecutive:!!ie,onReply:o,onSendReply:k,onEdit:R,onDelete:N,onMenuClick:p},y.id)})}),G.length>0&&e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,marginBottom:16,marginLeft:48},children:[e.jsx(a.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."})]}),F&&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(Xn,{currentUser:_,onSubmit:W})]}),e.jsx("div",{style:{flex:1,minWidth:0},children:i})]})]})},z={strong:"var(--Grey-Strong, #2E3236)",muted:"var(--Grey-Muted, #808183)",border:"var(--Grey-absent, #D9D9D9)",surfaceHover:"var(--surface-hover, #F3F7F7)",warmBorder:"var(--border-warm, #B2AEA8)",quoteText:"var(--text-subtle-warm, #767473)",toneGreen:"var(--state-present, #25A372)",toneAmber:"var(--rail-orange, #C98A5A)",toneRed:"var(--color-red-strong, #D04A4A)",impactPositiveBg:"rgba(37, 163, 114, 0.12)",impactPositiveInk:"var(--state-present, #25A372)",impactNegativeBg:"rgba(208, 74, 74, 0.12)",impactNegativeInk:"var(--color-red-strong, #D04A4A)"},Jn="var(--font-sans, 'Averta', ui-sans-serif, system-ui, sans-serif)",kt=({children:t,size:n=24,onClick:i,title:l})=>{const[o,r]=u.useState(!1);return e.jsx("div",{title:l,onClick:i,onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!1),style:{display:"flex",alignItems:"center",justifyContent:"center",width:n,height:n,borderRadius:9999,background:o?z.surfaceHover:"transparent",cursor:"pointer",flexShrink:0,transition:"background 0.15s"},children:t})},Un=t=>{const n=Math.floor(t/6e4),i=Math.floor(t%6e4/1e3);return`${n.toString().padStart(2,"0")}:${i.toString().padStart(2,"0")}`},ei=({icon:t})=>{const n={size:16,color:z.strong,strokeWidth:1.5};return t==="thumbs_down"?e.jsx(a.ArrowDown,{...n}):t==="focus"?e.jsx(a.Target,{...n}):e.jsx(a.ArrowUp,{...n})},ti=({label:t,direction:n})=>{if(!t)return null;const i=n==="negative"?a.ArrowDown:a.ArrowUp;return e.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:4,background:z.surfaceHover,color:z.strong,padding:"2px 8px",borderRadius:9999,fontSize:12,fontWeight:500,lineHeight:1.4,whiteSpace:"nowrap",flexShrink:0},children:[t,e.jsx(i,{size:12,color:z.strong,strokeWidth:2})]})},ni=({evidence:t,onPlayEvidence:n,onShowInTranscript:i,timelinePlaying:l,currentTimeSeconds:o})=>{const r=t.start_ms??t.startMs,d=t.end_ms??t.endMs,f=r!=null,p=(o??0)*1e3,w=l&&f&&p>=r&&p<=(d??r+5e3);return e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:6,paddingLeft:12,borderLeft:`2px solid ${z.warmBorder}`},children:[e.jsxs("span",{style:{fontSize:13,fontWeight:400,color:z.quoteText,lineHeight:1.5,fontStyle:"italic",wordBreak:"break-word"},children:["“",t.text,"”"]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,minHeight:24},children:[t.actor&&e.jsx("span",{style:{fontSize:12,fontWeight:500,color:z.muted,textTransform:"capitalize"},children:t.actor}),f&&e.jsxs(e.Fragment,{children:[e.jsx(kt,{size:24,title:w?"Pause":"Play evidence",onClick:()=>n==null?void 0:n({start_ms:r,end_ms:d}),children:w?e.jsx(a.PauseCircle,{size:16,color:z.strong,strokeWidth:1.25}):e.jsx(a.PlayCircle,{size:16,color:z.muted,strokeWidth:1.25})}),e.jsx(kt,{size:24,title:"Show in transcript",onClick:()=>i==null?void 0:i(r),children:e.jsx(a.ScrollText,{size:16,color:z.muted,strokeWidth:1.5})}),e.jsx("span",{style:{fontSize:12,fontWeight:400,color:z.muted,lineHeight:1.2,whiteSpace:"nowrap"},children:Un(r)})]})]})]})},ii=({signal:t,onPlayEvidence:n,onShowInTranscript:i,timelinePlaying:l,currentTimeSeconds:o})=>{const r=Array.isArray(t.evidence)?t.evidence:[],d=r.length>0,[f,p]=u.useState(!1);return e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:6},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,flexWrap:"wrap"},children:[e.jsx(ti,{label:t.impact_label,direction:t.impact_direction}),d&&e.jsxs("button",{type:"button",onClick:()=>p(w=>!w),style:{display:"inline-flex",alignItems:"center",gap:2,background:"transparent",border:"none",padding:0,cursor:"pointer",fontSize:12,fontWeight:500,color:z.muted,fontFamily:"inherit"},children:[f?e.jsx(a.ChevronDown,{size:14,color:z.muted,strokeWidth:1.5}):e.jsx(a.ChevronRight,{size:14,color:z.muted,strokeWidth:1.5}),r.length," ",r.length===1?"quote":"quotes"]})]}),f&&d&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:12,paddingTop:4},children:r.map((w,b)=>e.jsx(ni,{evidence:w,onPlayEvidence:n,onShowInTranscript:i,timelinePlaying:l,currentTimeSeconds:o},b))})]})},ri=({item:t,isLast:n,onPlayEvidence:i,onShowInTranscript:l,timelinePlaying:o,currentTimeSeconds:r})=>{const d=Array.isArray(t.signals)?t.signals:[];return e.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:12,padding:"16px 16px",borderBottom:n?"none":`1px solid ${z.border}`},children:[e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:16,height:16,flexShrink:0,marginTop:2},children:e.jsx(ei,{icon:t.icon,tone:t.tone})}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:12,flex:1,minWidth:0},children:[e.jsx("span",{style:{fontFamily:Jn,fontSize:14,fontWeight:400,color:z.strong,lineHeight:"normal",wordBreak:"break-word"},children:t.title||""}),d.length>0&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:12},children:d.map((f,p)=>e.jsx(ii,{signal:f,onPlayEvidence:i,onShowInTranscript:l,timelinePlaying:o,currentTimeSeconds:r},f.signal_key||p))})]})]})},li=({summary:t})=>{if(!t||typeof t!="object")return null;const n=Number(t.focus_count)||0,i=Number(t.opportunity_count)||0,l=Number(t.excellence_count)||0;if(n+i+l===0)return null;const o=[{key:"excellence",label:"Excellence",count:l,Icon:a.ArrowUp,color:z.strong},{key:"opportunity",label:"Opportunity",count:i,Icon:a.ArrowDown,color:z.strong},{key:"focus",label:"Focus",count:n,Icon:a.Target,color:z.strong}].filter(r=>r.count>0);return e.jsx("div",{style:{display:"flex",alignItems:"center",gap:16,padding:"8px 16px",background:z.surfaceHover,borderRadius:8},children:o.map(({key:r,label:d,count:f,Icon:p,color:w})=>e.jsxs("div",{style:{display:"inline-flex",alignItems:"center",gap:6},children:[e.jsx(p,{size:14,color:w,strokeWidth:1.75}),e.jsx("span",{style:{fontSize:13,fontWeight:600,color:z.strong,lineHeight:1.2},children:f}),e.jsx("span",{style:{fontSize:13,fontWeight:400,color:z.muted,lineHeight:1.2},children:d})]},r))})},oi=5,Nt=({items:t=[],summary:n,guidanceCount:i,loading:l=!1,onPlayEvidence:o,onShowInTranscript:r,timelinePlaying:d=!1,currentTimeSeconds:f=0})=>{const p=Array.isArray(t)?t.filter(Boolean).slice(0,oi):[],w=i??p.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:z.surfaceHover,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:e.jsx(a.Lightbulb,{style:{width:20,height:20,flexShrink:0},color:z.strong,strokeWidth:1.5})}),e.jsx("span",{style:{flex:1,fontSize:16,fontWeight:500,color:z.strong,lineHeight:1.2},children:"Guidance"}),e.jsxs("span",{style:{fontSize:14,fontWeight:500,color:z.strong,lineHeight:1.5,whiteSpace:"nowrap"},children:[w," Item",w!==1?"s":""]})]}),e.jsx(li,{summary:n}),p.map((b,M)=>e.jsx(ri,{item:b,isLast:M===p.length-1,onPlayEvidence:o,onShowInTranscript:r,timelinePlaying:d,currentTimeSeconds:f},M))]})},Q={strong:"var(--Grey-Strong, #2E3236)",muted:"var(--Grey-Muted, #808183)",border:"var(--Grey-absent, #D9D9D9)",surface:"var(--Grey-White, #FFF)",surfaceHover:"var(--surface-hover, #F3F7F7)"},ze="var(--font-sans, 'Averta', ui-sans-serif, system-ui, sans-serif)",si=[{key:"lookup_hold",label:"Lookup",Icon:a.Search},{key:"formal_hold",label:"Hold",Icon:a.Pause},{key:"extended_hold",label:"Extended",Icon:a.Pause},{key:"transfer_hold",label:"Transfer",Icon:a.ArrowRightLeft},{key:"probable_hold",label:"Possible",Icon:a.CircleDashed},{key:"dead_air",label:"Dead air",Icon:a.MicOff}],ai=t=>{if(t==null||Number.isNaN(t))return"—";const n=Number(t);return Number.isFinite(n)?n>=1e3?`${(n/1e3).toFixed(1)}s`:`${Math.round(n)}ms`:"—"},di=t=>{if(t==null||Number.isNaN(t))return null;const n=Number(t);return Number.isFinite(n)?`${(n*100).toFixed(1)}%`:null},Oe=t=>{if(t==null||Number.isNaN(t))return null;const n=Number(t);return Number.isFinite(n)?n.toLocaleString():null},ci=({holdTypeCounts:t})=>{if(!t||typeof t!="object")return null;const n=si.map(i=>({...i,count:Number(t[i.key])||0})).filter(i=>i.count>0);return n.length===0?null:e.jsx("div",{style:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:16,padding:"8px 16px",background:Q.surfaceHover,borderRadius:8},children:n.map(({key:i,label:l,Icon:o,count:r})=>e.jsxs("div",{style:{display:"inline-flex",alignItems:"center",gap:6},children:[e.jsx(o,{size:14,color:Q.strong,strokeWidth:1.5}),e.jsx("span",{style:{fontFamily:ze,fontSize:13,fontWeight:600,color:Q.strong,lineHeight:1.2},children:r}),e.jsx("span",{style:{fontFamily:ze,fontSize:13,fontWeight:400,color:Q.muted,lineHeight:1.2},children:l})]},i))})},fi=({summary:t})=>{const n=Oe(t==null?void 0:t.stall_count);if(!n)return null;const i=di(t==null?void 0:t.stall_rate),l=Oe(t==null?void 0:t.stall_filler_count),o=Oe(t==null?void 0:t.stall_buying_time_count),r=[];return l&&r.push(`filler ${l}`),o&&r.push(`buying time ${o}`),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,flexWrap:"wrap",fontFamily:ze,fontSize:13,lineHeight:1.4},children:[e.jsxs("span",{style:{fontWeight:500,color:Q.strong},children:["Stalls: ",n,i?` (${i})`:""]}),r.length>0&&e.jsxs("span",{style:{color:Q.muted},children:["· ",r.join(" · ")]})]})},Ct=({label:t,percentiles:n})=>{if(!n||typeof n!="object")return null;const i=[{key:"p50",label:"p50",value:n.p50},{key:"p75",label:"p75",value:n.p75},{key:"p95",label:"p95",value:n.p95},{key:"p99",label:"p99",value:n.p99}].filter(l=>l.value!=null);return i.length===0?null:e.jsxs("div",{style:{display:"flex",alignItems:"baseline",gap:12,flexWrap:"wrap",fontFamily:ze,fontSize:13,lineHeight:1.4},children:[e.jsx("span",{style:{fontWeight:500,color:Q.strong,minWidth:72},children:t}),i.map(l=>e.jsxs("span",{style:{color:Q.muted},children:[e.jsx("span",{style:{fontWeight:500,color:Q.strong},children:l.label})," ",ai(l.value)]},l.key))]})},ui=({summary:t})=>{if(!t||typeof t!="object")return null;const n=!!t.hold_type_counts&&Object.values(t.hold_type_counts).some(d=>Number(d)>0),i=(Number(t.stall_count)||0)>0,l=t.agent_response_percentiles_ms,o=t.customer_response_percentiles_ms,r=l&&Object.values(l).some(d=>d!=null)||o&&Object.values(o).some(d=>d!=null);return!n&&!i&&!r?null:e.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"stretch",gap:12,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:Q.surfaceHover,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:e.jsx(a.AudioLines,{size:20,color:Q.strong,strokeWidth:1.5})}),e.jsx("span",{style:{flex:1,fontFamily:"Varta, var(--font-sans, sans-serif)",fontSize:16,fontWeight:700,color:Q.strong,lineHeight:1.2,whiteSpace:"nowrap"},children:"Talk Patterns"})]}),n&&e.jsx(ci,{holdTypeCounts:t.hold_type_counts}),(i||r)&&e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:10,padding:"12px 16px",border:`1px solid ${Q.border}`,borderRadius:8},children:[i&&e.jsx(fi,{summary:t}),r&&e.jsxs(e.Fragment,{children:[e.jsx(Ct,{label:"Agent",percentiles:l}),e.jsx(Ct,{label:"Customer",percentiles:o})]})]})]})},te={strong:"var(--Grey-Strong, #2E3236)",muted:"var(--Grey-Muted, #808183)",border:"var(--Grey-absent, #D9D9D9)",surfaceHover:"var(--surface-hover, #F3F7F7)",iconAccent:"var(--rail-orange, #C98A5A)"},ve="var(--font-sans, 'Averta', ui-sans-serif, system-ui, sans-serif)",Ft=t=>{if(t==null)return null;if(typeof t=="string")return{name:t,percent:null};const n=t.name??t.label??t.title??"";return n?{name:n,percent:t.percent!=null?t.percent:t.percentage!=null?t.percentage:null}:null},gi=t=>{if(t==null)return null;const n=Number(t);return Number.isFinite(n)?`${(Math.abs(n)<=1?n*100:n).toFixed(1)} %`:null},pi=({name:t,percent:n})=>e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12,padding:"12px 0",borderBottom:`1px solid ${te.border}`,width:"100%"},children:[e.jsx("span",{style:{flex:1,minWidth:0,fontFamily:ve,fontSize:13,fontWeight:400,color:te.strong,lineHeight:"24px",wordBreak:"break-word"},children:t}),n!=null&&e.jsx("span",{style:{fontFamily:ve,fontSize:13,fontWeight:400,color:te.muted,lineHeight:"24px",whiteSpace:"nowrap",flexShrink:0},children:gi(n)})]}),It=({title:t,items:n,initialVisibleCount:i})=>{const[l,o]=u.useState(!1);if(!n.length)return null;const r=Math.max(0,n.length-i),d=l?n:n.slice(0,i);return e.jsxs("div",{style:{flex:1,minWidth:0,display:"flex",flexDirection:"column",alignItems:"flex-start",gap:8},children:[e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",padding:"8px 0",width:"100%"},children:e.jsx("span",{style:{flex:1,minWidth:0,fontFamily:ve,fontSize:15,fontWeight:600,color:te.strong,lineHeight:"24px",wordBreak:"break-word"},children:t})}),e.jsx("div",{style:{display:"flex",flexDirection:"column",alignItems:"flex-start",width:"100%"},children:d.map((f,p)=>e.jsx(pi,{name:f.name,percent:f.percent},p))}),r>0&&e.jsxs("button",{type:"button",onClick:()=>o(f=>!f),style:{display:"inline-flex",alignItems:"center",gap:6,height:29,padding:"8px 0",background:"transparent",border:"none",cursor:"pointer",fontFamily:ve,fontSize:13,fontWeight:600,color:te.strong,lineHeight:1.2,whiteSpace:"nowrap"},children:[l?"Show Less":`${r} More`,l?e.jsx(a.ChevronUp,{size:16,color:te.strong,strokeWidth:1.75}):e.jsx(a.ChevronDown,{size:16,color:te.strong,strokeWidth:1.75})]})]})},Pt=({products:t=[],services:n=[],title:i="Products & Services",productsTitle:l="Products Discussed",servicesTitle:o="Services Discussed",initialVisibleCount:r=4})=>{const d=(t||[]).map(Ft).filter(Boolean),f=(n||[]).map(Ft).filter(Boolean);return!d.length&&!f.length?null:e.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"stretch",gap:16,width:"100%",background:"var(--Grey-White, #FFF)"},children:[e.jsx("div",{style:{display:"flex",alignItems:"center",gap:16,height:40,borderBottom:`1px solid ${te.border}`,width:"100%"},children:e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,flex:1,minWidth:0},children:[e.jsx(a.ClipboardCheck,{size:24,color:te.iconAccent,strokeWidth:1.5}),e.jsx("span",{style:{fontFamily:ve,fontSize:16,fontWeight:600,color:te.strong,lineHeight:1.2,textTransform:"uppercase",whiteSpace:"nowrap"},children:i})]})}),e.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:24,flexWrap:"wrap",width:"100%"},children:[e.jsx(It,{title:l,items:d,initialVisibleCount:r}),e.jsx(It,{title:o,items:f,initialVisibleCount:r})]})]})},ue=({text:t,children:n})=>{const[i,l]=u.useState(!1),o=u.useRef(null),[r,d]=u.useState({top:0,left:0});if(!t)return n;const f=()=>{if(o.current){const p=o.current.getBoundingClientRect();d({top:p.bottom+6,left:p.left+p.width/2})}l(!0)};return e.jsxs("div",{ref:o,style:{position:"relative",display:"inline-flex"},onMouseEnter:f,onMouseLeave:()=>l(!1),children:[n,i&&e.jsx("div",{style:{position:"fixed",top:r.top,left:r.left,transform:"translate(-50%, 0)",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})})]})},Wt=[{key:"overview",label:"Overview"},{key:"coaching",label:"Coaching Summary"},{key:"signals",label:"Signals & Recording"},{key:"comments",label:"Feedback"}];function hi(t){return/\bagent\b/.test(String(t??"").toLowerCase())}function xi(t){return/(admin|superadmin|administrator)/.test(String(t??"").toLowerCase())}function yi(t,n){const i=(t==null?void 0:t.direction)??(t==null?void 0:t.interaction_direction)??(t==null?void 0:t.call_direction)??n;if(i==null||i==="")return null;const l=String(i).toLowerCase().trim();return l==="outbound"||l.startsWith("outbound")?"outbound":l==="inbound"||l.startsWith("inbound")?"inbound":null}const mi=({title:t="Wheel Stud Replacement Enquiry",onBack:n,data:i,coachingData:l,coachingLoading:o=!1,audioUrl:r,audioRef:d,currentTimeSeconds:f,timelinePlaying:p,playbackRate:w,timelineSegments:b,onSeek:M,onTogglePlay:g,onSeekBack:C,onSeekForward:F,onSetPlaybackRate:I,agentName:G,agentFullName:_,customerName:k,customerFullName:W,transcript:R,activeTurnIndex:N,turnObservations:L,highlightedTurns:O,onTurnPlayPause:y,onPlayEvidence:m,onHighlightTurns:h,callPurpose:P,classification:ee,outcomeQuality:ie,resolutionOutcome:re,customerIntent:T,location:ae,interactionId:de,moreDetails:X,compassScore:ge,compassMaxScore:he=5,predictedCsat:x,predictedLabel:Y="Predicted Objective",compassLegends:c,customerSessions:J,customerSessionCount:$t,onSessionClick:Ye,onViewAllSessions:qe,prevSessionDesc:Ke,prevSessionDisabled:le=!1,nextSessionDesc:Ve,nextSessionDisabled:oe=!1,onPreviousSession:je,onNextSession:be,comments:Ze=[],guidance:Ot=[],guidanceSummary:Yt,talkPatterns:qt,productsServices:V,productsDiscussed:Ge,servicesDiscussed:He,currentUser:$,onSendComment:Kt,onSendReply:Vt,onReply:Zt,onEdit:Qt,onEditInteraction:Xt,onDelete:Jt,onMenuClick:Ut,onMarkResolved:en,commentsResolved:tn})=>{var ht;const[Re,Se]=u.useState("overview"),[nn,Qe]=u.useState(new Set),[rn,we]=u.useState(!1),[ln,Xe]=u.useState(null),[Je,Ue]=u.useState(!1),[et,on]=u.useState(0),[tt,sn]=u.useState(!1),ce=u.useRef(null),_e=u.useRef(null),nt=u.useRef(null),ke=u.useRef(null),it=u.useRef(null),rt=u.useRef(null),lt={overview:_e,coaching:nt,signals:ke,products:it,comments:rt},xe=u.useRef(null),Ee=u.useRef(!1),ot=u.useMemo(()=>{const s=(V==null?void 0:V.products)??Ge??[],v=(V==null?void 0:V.services)??He??[];return s.length>0||v.length>0},[V,Ge,He]),Ae=u.useMemo(()=>{if(!ot)return Wt;const s=[];for(const v of Wt)v.key==="comments"&&s.push({key:"products",label:"Products & Services"}),s.push(v);return s},[ot]);u.useEffect(()=>{const s=xe.current;if(!s)return;const v=Ae.map(A=>A.key),j=v.map(A=>lt[A]),D=(A=>{let U=A.parentElement;for(;U;){const{overflow:se,overflowY:ne}=window.getComputedStyle(U);if(/(auto|scroll)/.test(se+ne))return U;U=U.parentElement}return null})(s),E=()=>{var se;if(Ee.current)return;let A=v[0];for(let ne=j.length-1;ne>=0;ne--){const Pe=j[ne].current;if(!Pe)continue;if(Pe.getBoundingClientRect().top<=150){A=v[ne];break}}Se(A);const U=((se=_e.current)==null?void 0:se.getBoundingClientRect().top)??Number.POSITIVE_INFINITY;sn(U<=150)};return s.addEventListener("scroll",E,{passive:!0}),D&&D!==s&&D.addEventListener("scroll",E,{passive:!0}),window.addEventListener("scroll",E,{passive:!0,capture:!0}),E(),()=>{s.removeEventListener("scroll",E),D&&D!==s&&D.removeEventListener("scroll",E),window.removeEventListener("scroll",E,{capture:!0})}},[Ae]);const st=u.useRef(null),an=s=>{var j;Se(s),Ee.current=!0,st.current=s;const v=(j=lt[s])==null?void 0:j.current;if(v){const S=xe.current;if(S&&S.scrollHeight>S.clientHeight){const D=S.getBoundingClientRect().top,A=v.getBoundingClientRect().top-D+S.scrollTop-16;S.scrollTo({top:A,behavior:"smooth"})}else{const D=v.getBoundingClientRect().top+window.scrollY-120;window.scrollTo({top:D,behavior:"smooth"})}}setTimeout(()=>{Ee.current=!1,st.current=null},1200)},Te=J||[],Le=Te.length>1,at=s=>{Se("signals");const v=ke.current;if(v){const S=xe.current;if(S&&S.scrollHeight>S.clientHeight){const D=S.getBoundingClientRect().top,A=v.getBoundingClientRect().top-D+S.scrollTop-16;S.scrollTo({top:A,behavior:"smooth"})}else{const D=v.getBoundingClientRect().top+window.scrollY-120;window.scrollTo({top:D,behavior:"smooth"})}}const j=s/1e3;setTimeout(()=>{var S;(S=ce.current)!=null&&S.scrollToTranscript&&ce.current.scrollToTranscript(j)},220)},dt=s=>{Se("signals");const v=ke.current;if(v){const S=xe.current;if(S&&S.scrollHeight>S.clientHeight){const D=S.getBoundingClientRect().top,A=v.getBoundingClientRect().top-D+S.scrollTop-16;S.scrollTo({top:A,behavior:"smooth"})}else{const D=v.getBoundingClientRect().top+window.scrollY-120;window.scrollTo({top:D,behavior:"smooth"})}}const j=(s==null?void 0:s.start_ms)??(s==null?void 0:s.startMs);setTimeout(()=>{var S,D;if(j!=null&&((S=ce.current)!=null&&S.scrollToTranscript)&&ce.current.scrollToTranscript(j/1e3),m)m(s);else if(j!=null&&((D=ce.current)!=null&&D.seekTo)){ce.current.seekTo(j/1e3),Ue(!0),on(j/1e3);const A=(s.end_ms??s.endMs??j+5e3)-j;setTimeout(()=>Ue(!1),A)}},220)},dn=s=>{h&&h(s)},cn=s=>{Qe(v=>{const j=new Set(v);return j.has(s)?j.delete(s):j.add(s),j})},fn=(i==null?void 0:i.blocks)||[],ye=s=>{var v;return((v=fn.find(j=>j.block_id===s))==null?void 0:v.payload)||{}},Z=ye("interaction-metadata"),pe=ye("interaction-context"),Ce=ye("interaction-signals"),un=ye("interaction-outcome-lift"),gn=ye("interaction-dimensions").dimensions||[],pn=pe.call_purpose||{},hn=pe.classification||{},ct=Z||{},Fe=P||pn||{},xn=ee||hn||{},ft=un||{};(ft.driver_signal_keys||[]).map(s=>s.replace(/^sig\./,"").replace(/_/g," "));const yn=l||null,mn=(ht=Ce==null?void 0:Ce.signals)!=null&&ht.length?Ce:{present_count:0,total_signals_evaluated:0,signals:[]},ut=Ot||[],Be=G||Z.agent_name||Z.agent||pe.agent_name||"Agent",vn=_||Z.agent_full_name||Z.agent_name||Be,me=k||Z.customer_name||Z.customer||pe.customer_name||"Customer",gt=W||Z.customer_full_name||Z.customer_name||me,pt=String(($==null?void 0:$.role)??($==null?void 0:$.userRole)??($==null?void 0:$.user_role)??($==null?void 0:$.roleName)??($==null?void 0:$.role_name)??"").toLowerCase(),Ie=hi(pt),jn=xi(pt),Ne=$t??Te.length,We=Z.created_dt||(i==null?void 0:i.created_dt)||pe.created_dt||"",bn=We?new Date(/Z$|[+-]\d{2}:\d{2}$/.test(We)?We:We+"Z").toLocaleString():"",Sn=Fe.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:{display:"flex",alignItems:"center",gap:12,padding:"18px 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(a.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}),(je||be)&&!tt&&e.jsxs("div",{style:{display:"flex",alignItems:"center",flexShrink:0},children:[e.jsx(ue,{text:Ke,children:e.jsxs("button",{onClick:le?void 0:je,disabled:le,style:{display:"flex",alignItems:"center",gap:6,padding:"4px 12px",background:"none",border:"none",cursor:le?"default":"pointer",opacity:le?.4:1},children:[e.jsx(a.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 Interaction"})]})}),e.jsx("div",{style:{width:1,height:20,background:"var(--Grey-absent, #D9D9D9)",flexShrink:0}}),e.jsx(ue,{text:Ve,children:e.jsxs("button",{onClick:oe?void 0:be,disabled:oe,style:{display:"flex",alignItems:"center",gap:6,padding:"4px 12px",background:"none",border:"none",cursor:oe?"default":"pointer",opacity:oe?.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 Interaction"}),e.jsx(a.ArrowRight,{size:16,color:"var(--Neutral-800, #323232)",strokeWidth:1.5})]})})]})]}),e.jsx("div",{style:{position:"sticky",top:0,zIndex:30,backgroundColor:"#FFFFFF",paddingTop:8,boxShadow:"0 4px 6px -4px rgba(0, 0, 0, 0.04)"},children:e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:16,background:"#FFFFFF",borderBottom:"1px solid var(--Grey-Faint, #ACADAD)",padding:"0 24px"},children:[e.jsx("div",{style:{display:"flex",alignItems:"flex-start",minWidth:0},children:Ae.map(s=>e.jsx("button",{onClick:()=>an(s.key),style:{display:"flex",padding:16,alignItems:"center",gap:10,background:"none",border:"none",borderBottom:Re===s.key?"3px solid var(--Grey-Strong, #2E3236)":"3px solid transparent",cursor:"pointer",fontSize:15,fontWeight:Re===s.key?500:400,color:Re===s.key?"var(--Grey-Strong, #2E3236)":"var(--Grey-Muted, #808183)",whiteSpace:"nowrap",transition:"border-color 0.2s ease, color 0.2s ease"},children:s.label},s.key))}),(je||be)&&tt&&e.jsxs("div",{style:{display:"flex",alignItems:"center",flexShrink:0},children:[e.jsx(ue,{text:Ke,children:e.jsxs("button",{onClick:le?void 0:je,disabled:le,style:{display:"flex",alignItems:"center",gap:6,padding:"4px 12px",background:"none",border:"none",cursor:le?"default":"pointer",opacity:le?.4:1},children:[e.jsx(a.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 Interaction"})]})}),e.jsx("div",{style:{width:1,height:20,background:"var(--Grey-absent, #D9D9D9)",flexShrink:0}}),e.jsx(ue,{text:Ve,children:e.jsxs("button",{onClick:oe?void 0:be,disabled:oe,style:{display:"flex",alignItems:"center",gap:6,padding:"4px 12px",background:"none",border:"none",cursor:oe?"default":"pointer",opacity:oe?.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 Interaction"}),e.jsx(a.ArrowRight,{size:16,color:"var(--Neutral-800, #323232)",strokeWidth:1.5})]})})]})]})}),e.jsxs("div",{ref:xe,style:{padding:24,flex:1,overflowY:"auto"},children:[e.jsxs("div",{ref:_e,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(a.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(a.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:bn})]}),(()=>{const s=Fe.interaction_direction==="outbound"?a.PhoneOutgoing:a.PhoneIncoming;return e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,padding:"8px 0"},children:[e.jsx(s,{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:Sn})]})})(),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:16,paddingLeft:16,borderLeft:"1px solid var(--Grey-absent, #D9D9D9)"},children:[e.jsx(ue,{text:vn,children:e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,padding:"8px 0",cursor:"pointer"},children:[e.jsx(a.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})]})}),Ne>1?e.jsx("div",{children:e.jsx(ue,{text:gt,children:e.jsxs("button",{onClick:()=>we(!0),style:{display:"flex",alignItems:"center",gap:16,padding:"0 16px",height:34,borderRadius:8,background:"var(--Rail-Surface-2, #E3E1D7)",border:"none",cursor:"pointer"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:4,minWidth:0},children:[e.jsx(a.CircleUser,{size:16,color:"var(--Grey-Strong, #2E3236)",strokeWidth:1.5}),e.jsxs("span",{style:{fontSize:13,fontWeight:400,color:"var(--Grey-Strong, #2E3236)",lineHeight:1.2,whiteSpace:"nowrap"},children:[e.jsx("span",{style:{fontWeight:600},children:me})," ",e.jsxs("span",{children:["(",Ne," Interactions)"]})]})]}),e.jsx(a.ChevronRight,{size:16,color:"var(--Grey-Strong, #2E3236)",strokeWidth:1.7})]})})}):e.jsx(ue,{text:gt,children:e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:4,padding:"8px 0",cursor:"pointer"},children:[e.jsx(a.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:me})]})})]})]})]}),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(_t,{score:ge??.5,minScore:0,maxScore:he,predictedScore:x??.5,predictedLabel:Y,legends:c})}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"stretch",justifyContent:"flex-end",gap:24,flex:1,minWidth:0},children:[e.jsx(Ht,{meta:ct,callPurpose:Fe,classification:xn,outcomeQuality:ie||"Neutral",dimensions:gn,resolutionOutcome:re,customerIntent:T,location:ae??Z.location??Z.location_name??pe.location,interactionId:de??Z.interaction_id,moreDetails:X,canShowEditButton:jn,onEditInteraction:Xt}),(()=>{var mt,vt;const s=ft||{},v=s.difficulty,j=s.difficulty_band,S=s.p_expected,D=s.score_impact??S,E=s.lift_raw,A=s.lift_display,U=(mt=s.interpretation)==null?void 0:mt.lift_band,se=s.p_full,ne=(vt=s.interpretation)==null?void 0:vt.description;if(!(v!=null||j!=null||E!=null||U!=null||se!=null||ne!=null))return null;const $e=(fe,De,zn)=>Math.max(De,Math.min(zn,fe)),wn=v!=null?$e((v-50)/50,-1,1):0,kn=E!=null?$e(E*3,-1,1):0,xt=D!=null?Math.round(D*100):null,yt=fe=>{if(fe)return String(fe).split("_").map(De=>De.charAt(0).toUpperCase()+De.slice(1).toLowerCase()).join(" ")},Cn=yt(j),Fn=yt(U),In=(()=>{if(typeof A=="string"){const fe=parseFloat(A.replace("%",""));if(Number.isFinite(fe))return fe}return E!=null?Math.round(E*100):null})(),Wn=se!=null?Math.round(se*100):null,Dn={label:"Outcome",direction:"neutral"};return e.jsx(Mn.AgentLiftAnalysisCard,{title:Ie?"Score":"Agent Lift Analysis",status:Dn,showInfoIcon:!Ie,interactionDifficulty:Ie?void 0:{value:v!=null?wn:null,label:Cn,sublabel:"Based on interaction type",footer:xt!=null?`${xt}% Score impact`:void 0},agentImpact:Ie?void 0:{value:E!=null?kn:null,label:Fn,sublabel:ne,impactPercent:In,isLearning:String(U??"").toLowerCase()==="learning"},outcome:{percent:Wn,label:"Outcome",description:"Based on interaction difficulty and agent contribution."}})})()]})]})]}),e.jsx("div",{ref:nt,style:{paddingTop:24},children:e.jsx(Gt,{data:o?null:yn,loading:o})}),e.jsxs("div",{ref:ke,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(a.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(Rt,{signals:mn,expandedSignals:nn,toggleSignal:cn,playEvidence:dt,highlightTurns:dn,onShowInTranscript:at,timelinePlaying:p||Je,currentTimeSeconds:f??et})}),e.jsx("div",{style:{flex:1,minWidth:0},children:e.jsx(Mt.UpdatedInteractionRecording,{ref:ce,audioUrl:r,durationSeconds:ct.duration_seconds,audioRef:d,agentName:Be,customerName:me,currentTimeSeconds:f,timelinePlaying:p,playbackRate:w,timelineSegments:b,onSeek:M,onTogglePlay:g,onSeekBack:C,onSeekForward:F,onSetPlaybackRate:I,transcript:R,activeTurnIndex:N,turnObservations:L,highlightedTurns:O,onTurnPlayPause:y,setExpandedSignals:Qe})})]})]}),(()=>{const s=(V==null?void 0:V.products)??Ge??[],v=(V==null?void 0:V.services)??He??[];return!s.length&&!v.length?null:e.jsx("div",{ref:it,style:{paddingTop:24},children:e.jsx(Pt,{products:s,services:v})})})(),e.jsx("div",{ref:rt,style:{paddingTop:24},children:e.jsxs(Bt,{comments:Ze,totalComments:Ze.length,currentUser:$,onSendComment:Kt||(()=>{}),onSendReply:Vt||(()=>{}),onReply:Zt||(()=>{}),onEdit:Qt||(()=>{}),onDelete:Jt||(()=>{}),onMenuClick:Ut||(()=>{}),onMarkResolved:en||(()=>{}),isResolved:tn,children:[e.jsx(Nt,{items:ut,summary:Yt,guidanceCount:ut.length,onPlayEvidence:dt,onShowInTranscript:at,timelinePlaying:p||Je,currentTimeSeconds:f??et}),e.jsx(ui,{summary:qt})]})})]}),e.jsx(Gn.SideDrawer,{open:rn,onClose:()=>we(!1),title:e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,minWidth:0},children:[e.jsx("div",{style:{width:34,height:34,borderRadius:"50%",background:"var(--surface-hover, #F3F7F7)",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:e.jsx(a.CircleUser,{size:20,color:"var(--Grey-Strong, #2E3236)",strokeWidth:1.7})}),e.jsx("div",{style:{minWidth:0},children:e.jsx("div",{style:{fontSize:16,fontWeight:600,color:"var(--Grey-Strong, #2E3236)",lineHeight:1.2,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:me})})]}),subtitle:Le?e.jsxs("span",{style:{fontSize:13,fontWeight:400,color:"var(--Grey-Muted, #808183)",lineHeight:1.5},children:[Ne," Interactions"]}):null,width:470,height:"100vh",topOffset:70,footer:Le?e.jsx("div",{style:{width:"100%",display:"flex",justifyContent:"center"},children:e.jsxs("button",{onClick:()=>{qe&&qe(),we(!1)},style:{display:"flex",height:40,padding:"0 20px 0 18px",justifyContent:"center",alignItems:"center",gap:7,background:"var(--Grey-White, #FFF)",border:"1px solid var(--Grey-absent, #D9D9D9)",borderRadius:10,cursor:"pointer"},children:[e.jsx(a.History,{size:18,color:"var(--Grey-Muted, #808183)",strokeWidth:1.5}),e.jsx("span",{style:{fontSize:15,fontWeight:600,color:"var(--Grey-Strong, #2E3236)"},children:"View All Interactions"})]})}):null,children:e.jsx("div",{style:{borderTop:"1px solid var(--Grey-absent, #D9D9D9)",maxHeight:"100%",overflowY:"auto"},children:Le?Te.map((s,v)=>{const j=!!s.isCurrent,S=!j&&ln===v,D=yi(s,Fe.interaction_direction),E=D==="outbound"?a.PhoneOutgoing:a.PhoneIncoming;return e.jsxs("div",{onClick:j?void 0:()=>{Ye&&Ye(s),we(!1)},onMouseEnter:j?void 0:()=>Xe(v),onMouseLeave:j?void 0:()=>Xe(null),"aria-current":j?"page":void 0,style:{display:"flex",justifyContent:"space-between",alignItems:"center",gap:12,padding:"16px 12px",borderTop:v===0?"none":"1px solid var(--Grey-absent, #D9D9D9)",background:j?"#E3E1D7":S?"var(--surface-hover, #F3F7F7)":"var(--Grey-White, #FFF)",cursor:j?"default":"pointer",transition:"background 0.15s"},children:[e.jsxs("div",{style:{minWidth:0},children:[e.jsxs("div",{style:{fontSize:j?15:14,display:"flex",alignItems:"center",gap:6,fontWeight:j?500:400,color:"var(--Grey-Strong, #2E3236)",lineHeight:1.2,marginBottom:8,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:[D&&e.jsx(E,{size:16,color:"var(--Grey-Muted, #808183)",strokeWidth:1.5,style:{flexShrink:0},"aria-hidden":!0}),e.jsx("span",{style:{overflow:"hidden",textOverflow:"ellipsis",minWidth:0},children:s.title})]}),s.status&&e.jsxs("div",{style:{fontSize:13,color:"var(--Grey-Strong, #2E3236)",marginBottom:12,lineHeight:1.2},children:[e.jsx("span",{style:{fontWeight:400},children:"Location: "}),e.jsx("span",{style:{fontWeight:400,color:"var(--Grey-Muted, #808183)"},children:s.location})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:14,flexWrap:"wrap"},children:[e.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:6,fontSize:13,fontWeight:400,color:"var(--Grey-Muted, #808183)",lineHeight:1.1},children:[e.jsx(a.CalendarDays,{size:16,color:"var(--Grey-Muted, #808183)",strokeWidth:1.8}),s.date]}),(s.agent||s.agent_name)&&e.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:6,fontSize:13,fontWeight:400,color:"var(--Grey-Muted, #808183)",lineHeight:1.1},children:[e.jsx(a.Headset,{size:16,color:"var(--Grey-Muted, #808183)",strokeWidth:1.8}),s.agent||s.agent_name]})]})]}),!j&&S&&e.jsx(a.ExternalLink,{size:20,color:"var(--Grey-Muted, #808183)",strokeWidth:1.7,style:{flexShrink:0}})]},s.id||v)}):e.jsx("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",minHeight:140,padding:"24px 12px",color:"var(--Grey-Muted, #808183)",fontSize:14,fontStyle:"italic",textAlign:"center"},children:"No other interactions available"})})})]})},H={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))"},q=1.2,Dt=3,zt=t=>t!=null?Math.round(t*100)+"%":"—",vi=t=>{if(t==null)return"—";const n=(t*100).toFixed(1);return t>0?`+${n}pp`:`${n}pp`},ji=({outcomeLift:t,driverLabels:n=[],showOutcomeOnly:i=!1})=>{var C;if(!t||t.lift==null)return null;const l=t.p_expected,o=t.p_full,r=t.lift_raw??(o!=null&&l!=null?o-l:null),d=t.lift,f=(C=t.interpretation)!=null&&C.lift_band?t.interpretation.lift_band.replace(/_/g," "):d>=0?"Positive":"Negative",p=f.charAt(0).toUpperCase()+f.slice(1),b=/negative/i.test(f)?a.ThumbsDown:a.ThumbsUp,M=n.slice(0,Dt),g=n.length-Dt;return e.jsxs("div",{style:{display:"flex",flexDirection:"column",padding:24,gap:i?16:24,borderRadius:8,border:`1px solid ${H.absent}`,background:i?"#faf9f5":H.cardBg,alignSelf:"stretch"},children:[e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:i?24: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:H.strong,fontFamily:"var(--font-sans)",lineHeight:q},children:"Agent Lift Analysis"}),e.jsx("div",{style:{display:"flex",alignItems:"center",gap:8,fontFamily:"var(--font-sans)"},children:e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,paddingLeft:8},children:[e.jsx(b,{size:14,color:H.strong}),e.jsx("span",{style:{fontSize:13,fontWeight:600,color:H.strong,lineHeight:q},children:p})]})})]}),e.jsxs("div",{style:{display:"flex",gap:24,alignItems:"center",...i?{justifyContent:"center",width:"100%"}:{}},children:[!i&&e.jsxs(e.Fragment,{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:H.muted,fontFamily:"var(--font-sans)",lineHeight:q},children:zt(l)}),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:H.strong,fontFamily:"var(--font-sans)",lineHeight:q,whiteSpace:"nowrap"},children:"Expected Outcome"}),e.jsx("span",{style:{fontSize:13,fontWeight:400,color:H.muted,fontFamily:"var(--font-sans)",lineHeight:q,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 ${H.absent}`,flex:1,minWidth:0},children:[e.jsx("span",{style:{fontSize:28,fontWeight:400,color:H.muted,fontFamily:"var(--font-sans)",lineHeight:q},children:vi(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:H.strong,fontFamily:"var(--font-sans)",lineHeight:q,whiteSpace:"nowrap"},children:"Agent Impact"}),e.jsx("span",{style:{fontSize:13,fontWeight:400,color:H.muted,fontFamily:"var(--font-sans)",lineHeight:q,textAlign:"left"},children:"Behavior-driven change"})]})]})]}),e.jsxs("div",{style:{display:"flex",flexDirection:i?"row":"column",gap:16,alignItems:i?"center":"flex-start",justifyContent:i?"center":void 0,...i?{}:{paddingLeft:24,borderLeft:`1px solid ${H.absent}`,flex:1,minWidth:0}},children:[e.jsx("div",{style:{display:"flex",alignItems:"center",gap:4},children:e.jsx("span",{style:{fontSize:28,fontWeight:400,color:H.strong,fontFamily:"var(--font-sans)",lineHeight:q},children:zt(o)})}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8,alignItems:"flex-start",minHeight:i?void 0:48},children:[e.jsx("div",{style:{display:"flex",alignItems:"center",gap:4},children:e.jsx("span",{style:{fontSize:13,fontWeight:i?400:600,color:H.strong,fontFamily:"var(--font-sans)",lineHeight:q,whiteSpace:"nowrap"},children:"Outcome"})}),e.jsx("span",{style:{fontSize:13,fontWeight:400,color:H.muted,fontFamily:"var(--font-sans)",lineHeight:q,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:H.strong,fontFamily:"var(--font-sans)",lineHeight:q},children:"Key Drivers"}),e.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:4},children:[M.map((F,I)=>e.jsx("div",{style:{display:"flex",padding:8,alignItems:"center",justifyContent:"center",borderRadius:4,border:`1px solid ${H.absent}`,background:H.white},children:e.jsx("span",{style:{fontSize:12,fontWeight:400,color:H.strong,fontFamily:"var(--font-sans)",lineHeight:q,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:200},children:F})},I)),g>0&&e.jsx("div",{style:{display:"flex",padding:8,alignItems:"center",justifyContent:"center",borderRadius:4,border:`1px solid ${H.absent}`,background:H.white},children:e.jsxs("span",{style:{fontSize:12,fontWeight:400,color:H.strong,fontFamily:"var(--font-sans)",lineHeight:q,whiteSpace:"nowrap"},children:["+ ",g]})})]})]})]})};exports.UpdatedInteractionRecording=Mt.UpdatedInteractionRecording;exports.UpdatedCoachingSynthesisCard=Gt;exports.UpdatedCompassScore=_t;exports.UpdatedGuidance=Nt;exports.UpdatedInteractionContext=Ht;exports.UpdatedInteractionDetails=mi;exports.UpdatedInteractionScores=ji;exports.UpdatedInteractionSignals=Rt;exports.UpdatedProductsServices=Pt;exports.UpdatedThreads=Bt;
|
|
17
17
|
//# sourceMappingURL=UpdatedInteractionDetails.cjs.js.map
|