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.
Files changed (48) hide show
  1. package/dist/DataTable2.cjs.js +1 -1
  2. package/dist/DataTable2.cjs.js.map +1 -1
  3. package/dist/DataTable2.es.js +611 -604
  4. package/dist/DataTable2.es.js.map +1 -1
  5. package/dist/PerformancePanel.cjs.js +1 -1
  6. package/dist/PerformancePanel.cjs.js.map +1 -1
  7. package/dist/PerformancePanel.es.js +1068 -816
  8. package/dist/PerformancePanel.es.js.map +1 -1
  9. package/dist/SupervisorSelect.cjs.js +2 -0
  10. package/dist/SupervisorSelect.cjs.js.map +1 -0
  11. package/dist/SupervisorSelect.es.js +352 -0
  12. package/dist/SupervisorSelect.es.js.map +1 -0
  13. package/dist/components/Signals.cjs.js +1 -1
  14. package/dist/components/Signals.cjs.js.map +1 -1
  15. package/dist/components/Signals.es.js +273 -318
  16. package/dist/components/Signals.es.js.map +1 -1
  17. package/dist/components/UpdatedInteractionDetails.cjs.js +3 -3
  18. package/dist/components/UpdatedInteractionDetails.cjs.js.map +1 -1
  19. package/dist/components/UpdatedInteractionDetails.es.js +98 -92
  20. package/dist/components/UpdatedInteractionDetails.es.js.map +1 -1
  21. package/dist/components/performance.cjs.js +1 -1
  22. package/dist/components/performance.cjs.js.map +1 -1
  23. package/dist/components/performance.es.js +116 -349
  24. package/dist/components/performance.es.js.map +1 -1
  25. package/dist/components/reports.cjs.js +2 -2
  26. package/dist/components/reports.cjs.js.map +1 -1
  27. package/dist/components/reports.es.js +122 -141
  28. package/dist/components/reports.es.js.map +1 -1
  29. package/dist/index.cjs.js +1 -1
  30. package/dist/index.es.js +1 -1
  31. package/dist/pages/interactionDetails.cjs.js +2 -2
  32. package/dist/pages/interactionDetails.cjs.js.map +1 -1
  33. package/dist/pages/interactionDetails.es.js +130 -124
  34. package/dist/pages/interactionDetails.es.js.map +1 -1
  35. package/package.json +1 -1
  36. package/src/components/Signals/SignalDetailsPage.jsx +2 -29
  37. package/src/components/Signals/SignalsListPage.jsx +2 -24
  38. package/src/components/UpdatedInteractionDetails/UpdatedCoachingSynthesisCard.jsx +8 -1
  39. package/src/components/data/DataTable2.jsx +19 -5
  40. package/src/components/pages/interactionDetails/CoachingSynthesisCard.jsx +8 -1
  41. package/src/components/performance/PerformanceDetailsPage.jsx +230 -75
  42. package/src/components/performance/PerformancePanel.jsx +42 -45
  43. package/src/components/performance/index.js +27 -0
  44. package/src/components/performance/performanceApiMap.js +133 -0
  45. package/src/components/performance/performanceMetrics.js +63 -0
  46. package/src/components/performance/performanceRangeFormat.js +92 -0
  47. package/src/components/performance/performanceSparkline.js +52 -0
  48. package/src/components/reports/ReportsList.jsx +2 -25
@@ -1,2 +1,2 @@
1
- "use strict";const e=require("react/jsx-runtime"),w=require("react"),Ye=require("react-dom"),f=require("lucide-react"),Me=require("./DataTable2.cjs.js"),l={ink:"var(--color-text)",muted:"var(--color-text-secondary)",border:"var(--grey-absent)",borderSubtle:"var(--neutral-100)",iconCircle:"var(--surface-hover)",black:"var(--neutral-900)",white:"var(--grey-white)",neutralBorder:"var(--neutral-250)",neutral800:"var(--neutral-800)",neutral600:"var(--neutral-600)",neutral450:"var(--neutral-450)",neutral400:"var(--neutral-400)",neutral300:"var(--neutral-300)",neutral150:"var(--neutral-150)",neutral100:"var(--neutral-100)",beige:"var(--surface-warm-40)",shadowCard:"var(--shadow-card)",railCompliance:"var(--rail-compliance)",accentYellow:"var(--accent-yellow)"},V="var(--font-sans, 'Averta', ui-sans-serif, system-ui, sans-serif)",C="var(--font-sans, 'Averta', ui-sans-serif, system-ui, sans-serif)";function Ce(t){if(!t)return"";const n={month:"2-digit",day:"2-digit",year:"numeric"};if(t instanceof Date)return Number.isNaN(t.getTime())?"":t.toLocaleDateString("en-US",n);const r=String(t).trim(),s=r.match(/^(\d{4})-(\d{1,2})-(\d{1,2})/);if(s)return new Date(Number(s[1]),Number(s[2])-1,Number(s[3])).toLocaleDateString("en-US",n);const a=new Date(r);return Number.isNaN(a.getTime())?r:a.toLocaleDateString("en-US",n)}const Xe="M1.00049 13.5213C7.85975 11.7032 8.88149 4.73912 13.7838 4.73912C19.8344 4.73912 23.6237 17.166 29.1281 17.166C34.5998 17.166 37.4149 4.88121 43.4004 8.61051C47.9764 11.4616 50.6186 1.00024 50.6186 1.00024",Ge="M1.00049 16.692C8.88149 15.6975 8.88149 7.79403 13.7838 7.79403C19.8344 7.79403 23.6237 21.4034 29.1281 21.4034C34.5998 21.4034 37.4149 8.93821 43.4004 12.7223C47.9764 15.6152 50.6186 5.00024 50.6186 5.00024V36.0002C50.6186 36.0002 10.8223 36.0002 1.00049 36.0002C1.00049 28.8653 1.00049 19.4871 1.00049 16.692Z";function Ve(t,n=52,r=36){if(!Array.isArray(t))return null;const s=t.map(v=>Number(v)).filter(v=>Number.isFinite(v));if(s.length<2)return null;const a=Math.min(...s),o=Math.max(...s),c=4,x=o-a||1,j=r-c*2-4,h=v=>(s.length===1?0:v/(s.length-1)*(n-2))+1,y=v=>c+(1-(v-a)/x)*j;let b="";for(let v=0;v<s.length;v++)b+=`${v===0?"M":"L"}${h(v).toFixed(2)},${y(s[v]).toFixed(2)}`;const g=h(s.length-1),D=h(0),P=`${b} L${g.toFixed(2)},${r} L${D.toFixed(2)},${r} Z`;return{line:b,area:P}}function Ke({trend:t="up",points:n,width:r=49.618,height:s=35}){const a=w.useId(),o=Ve(n),c=o?o.line:Xe,x=o?o.area:Ge;return e.jsxs("svg",{width:r,height:s,viewBox:"0 0 52 36",fill:"none",style:{flexShrink:0,transform:!o&&t==="down"?"scaleX(-1)":void 0},children:[e.jsx("defs",{children:e.jsxs("linearGradient",{id:`spark-${a}`,x1:"9.96776",y1:"16.2053",x2:"9.96776",y2:"36.0002",gradientUnits:"userSpaceOnUse",children:[e.jsx("stop",{stopColor:l.ink}),e.jsx("stop",{offset:"1",stopColor:l.white,stopOpacity:"0.01"})]})}),e.jsx("path",{d:x,fill:`url(#spark-${a})`,fillRule:"evenodd",clipRule:"evenodd",opacity:"0.1"}),e.jsx("path",{d:c,stroke:l.ink,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeDasharray:!o&&t==="down"?"2 4":void 0})]})}function me({value:t,label:n,sub:r,trend:s="up",points:a}){return e.jsxs("div",{style:{flex:1,display:"flex",alignItems:"center",gap:16,minWidth:0},children:[e.jsx(Ke,{trend:s,points:a}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:6,minWidth:0},children:[e.jsx("div",{style:{fontFamily:V,fontSize:28,fontWeight:400,lineHeight:"1.2",color:l.muted,letterSpacing:"-0.01em",whiteSpace:"nowrap"},children:t}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:2},children:[e.jsx("span",{style:{fontFamily:C,fontSize:13,color:l.ink,lineHeight:"1.2"},children:n}),e.jsx("span",{style:{fontFamily:C,fontSize:13,color:l.neutral600,lineHeight:"1.2"},children:r})]})]})]})}function qe({label:t,active:n=!1,onClick:r}){return e.jsx("button",{type:"button",onClick:r,style:{height:32,minWidth:31,padding:"0 12px",borderRadius:10,border:n?"none":`1px solid ${l.borderSubtle}`,background:n?l.black:l.white,color:n?l.white:l.black,fontFamily:C,fontSize:14,cursor:"pointer"},children:t})}function se({yLabels:t,xLabels:n=[],points:r,highlightIndex:s}){const c=Array.isArray(r)&&r.length>0,x=w.useId(),j=6,h=Array.isArray(n)?n:[],y=h.length<=j?h:Array.from({length:j},(u,k)=>h[Math.round(k*(h.length-1)/(j-1))]),b=Math.max(2,y.length||j),g=Array.from({length:b},(u,k)=>k/(b-1)*460);if(!c)return e.jsxs("div",{style:{display:"flex",gap:8,height:133,width:"100%"},children:[e.jsx("div",{style:{width:24,flexShrink:0}}),e.jsx("div",{style:{flex:1,position:"relative",minWidth:0},children:e.jsx("svg",{width:"100%",height:110+14,viewBox:`0 0 460 ${110+14}`,preserveAspectRatio:"none",children:g.map((u,k)=>e.jsx("line",{x1:u,y1:"0",x2:u,y2:110,stroke:l.borderSubtle,strokeDasharray:"2 3",strokeWidth:"1",vectorEffect:"non-scaling-stroke"},`grid-${k}`))})})]});const D=Array.isArray(r[0])?r:r.map((u,k)=>[k,u]),P=D.map(([,u])=>u),v=Math.min(...P),B=Math.max(...P),O=B===v?Math.max(Math.abs(B)*.1,1):(B-v)*.1,E=v-O,_=B+O,Y=_-E||1,X=u=>(_-u)/Y*110,L=D.map(([u,k])=>[u,X(k)]),p=t&&t.length?t:Array.from({length:5},(u,k)=>{const A=_-k/4*(_-E),I=Math.abs(A),ee=I>=100?0:I>=10?1:2;return A.toFixed(ee)}),z=L[0][0],N=L[L.length-1][0]-z||1,T=u=>(u-z)/N*460,M=L.map(([u,k],A)=>`${A===0?"M":"L"}${T(u)},${k}`).join(" "),J=`${M} L${T(L[L.length-1][0])},110 L${T(L[0][0])},110 Z`,Q=s??L.length-1;return e.jsxs("div",{style:{display:"flex",gap:8,height:133,width:"100%"},children:[e.jsx("div",{style:{display:"flex",flexDirection:"column",justifyContent:"space-between",padding:"14px 0",fontFamily:C,fontSize:10,color:l.neutral800,flexShrink:0},children:p.map(u=>e.jsx("span",{children:u},u))}),e.jsxs("div",{style:{flex:1,position:"relative",minWidth:0},children:[e.jsxs("svg",{width:"100%",height:110+14,viewBox:`0 0 460 ${110+14}`,preserveAspectRatio:"none",children:[e.jsx("defs",{children:e.jsxs("linearGradient",{id:`area-${x}`,x1:"0",y1:"0",x2:"0",y2:"1",children:[e.jsx("stop",{offset:"0%",style:{stopColor:l.black,stopOpacity:.08}}),e.jsx("stop",{offset:"100%",style:{stopColor:l.black,stopOpacity:0}})]})}),g.map((u,k)=>e.jsx("line",{x1:u,y1:"0",x2:u,y2:110,stroke:l.borderSubtle,strokeDasharray:"2 3",strokeWidth:"1",vectorEffect:"non-scaling-stroke"},`grid-${k}`)),e.jsx("path",{d:J,fill:`url(#area-${x})`}),e.jsx("path",{d:M,stroke:l.black,strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",vectorEffect:"non-scaling-stroke"}),L.map(([u,k],A)=>{const I=A===Q;return e.jsx("circle",{cx:T(u),cy:k,r:I?4:3,fill:I?l.black:l.white,stroke:l.black,strokeWidth:"1.5",vectorEffect:"non-scaling-stroke"},A)})]}),e.jsx("div",{style:{display:"flex",justifyContent:"space-between",paddingRight:6,fontFamily:C,fontSize:10,color:l.neutral800,marginTop:6,overflow:"hidden"},children:y.map((u,k)=>e.jsx("span",{style:{whiteSpace:"nowrap"},children:u},k))})]})]})}function re({title:t,value:n,delta:r,children:s}){return e.jsxs("div",{style:{flex:1,background:l.white,border:`1px solid ${l.border}`,borderRadius:8,padding:24,display:"flex",flexDirection:"column",gap:24,minWidth:0,boxShadow:l.shadowCard},children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-end"},children:[e.jsx("span",{style:{fontFamily:V,fontWeight:600,fontSize:15,color:l.ink,lineHeight:1.2},children:t}),e.jsxs("span",{style:{display:"inline-flex",alignItems:"flex-end",gap:4,fontFamily:V,fontWeight:600},children:[e.jsx("span",{style:{fontSize:20,color:l.black,lineHeight:1},children:n}),e.jsx("span",{style:{fontSize:10,color:l.neutral300,lineHeight:1},children:r})]})]}),e.jsx("div",{style:{flex:1},children:s})]})}function be({icon:t,title:n,trailing:r,iconColor:s=l.ink,bordered:a=!1}){return e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,width:"100%",paddingBottom:a?12:0,borderBottom:a?`1px solid ${l.border}`:"none"},children:[e.jsx("div",{style:{width:24,height:24,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:e.jsx(t,{size:22,strokeWidth:1.75,style:{color:s}})}),e.jsx("div",{style:{flex:1,fontFamily:V,fontWeight:600,fontSize:16,color:l.ink,lineHeight:1.2,textTransform:"uppercase",letterSpacing:"0.02em"},children:n}),r&&e.jsx("div",{style:{fontFamily:C,fontSize:14,color:l.ink},children:r})]})}function Ze({text:t,bullet:n,citation:r,date:s,href:a}){const o=t??n??"";return e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",fontFamily:C,fontSize:14,color:l.ink,lineHeight:"24px",gap:16},children:[a?e.jsx("a",{href:a,target:"_blank",rel:"noopener noreferrer",style:{color:l.ink,textDecoration:"underline",textUnderlineOffset:2,textDecorationColor:l.border,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:o}):e.jsx("span",{style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:o}),e.jsxs("span",{style:{display:"inline-flex",gap:4,whiteSpace:"nowrap"},children:[e.jsx("span",{style:{color:l.ink},children:r}),s?e.jsxs("span",{style:{color:l.muted},children:["(",s,")"]}):null]})]})}function Le({title:t,summary:n,calls:r,percent:s,delta:a,bullets:o,defaultExpanded:c=!1}){const[x,j]=w.useState(c),h=s??a??"",y=Array.isArray(o)?o:[];return e.jsxs("div",{style:{borderTop:`1px solid ${l.border}`},children:[e.jsxs("button",{type:"button",onClick:()=>j(b=>!b),"aria-expanded":x,style:{border:"none",background:"transparent",padding:16,display:"flex",gap:12,alignItems:"flex-start",cursor:"pointer",width:"100%",textAlign:"left",fontFamily:C},children:[e.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:12,minWidth:0},children:[e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:12},children:[e.jsx("span",{style:{fontFamily:C,fontWeight:500,fontSize:14,color:l.black,lineHeight:"24px"},children:t}),e.jsx("span",{style:{fontFamily:C,fontSize:14,color:l.muted,lineHeight:"24px"},children:n})]}),e.jsxs("div",{style:{display:"flex",gap:16},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:4},children:[e.jsx(f.Phone,{size:12,color:l.ink,strokeWidth:1.75}),e.jsx("span",{style:{fontFamily:C,fontSize:12,color:l.ink},children:r})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:4},children:[e.jsx(f.TrendingUp,{size:12,color:l.ink,strokeWidth:1.75}),e.jsx("span",{style:{fontFamily:C,fontSize:12,color:l.ink},children:h})]})]})]}),e.jsx(f.ChevronDown,{size:20,color:l.ink,strokeWidth:2,style:{flexShrink:0,transform:x?"rotate(180deg)":"none",transition:"transform 150ms ease"}})]}),x&&y.length>0&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:12,padding:"0 16px 16px"},children:y.map((b,g)=>e.jsx(Ze,{...b},g))})]})}function We({label:t,value:n}){return e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"8px 8px 12px",borderBottom:`1px solid ${l.border}`,fontFamily:C,fontSize:13,lineHeight:"1.2"},children:[e.jsx("span",{style:{color:l.ink},children:t}),e.jsx("span",{style:{color:l.muted},children:n})]})}function Je({value:t=0,max:n=5}){const r=typeof t=="number"?t:parseFloat(t)||0,s=Math.floor(r),a=r%1>0&&s<n;return e.jsx("div",{style:{display:"flex",gap:4},children:Array.from({length:n}).map((o,c)=>c<s?e.jsx("span",{style:{width:10,height:10,borderRadius:"50%",background:l.black,display:"inline-block"}},c):c===s&&a?e.jsx("span",{style:{width:10,height:10,borderRadius:"50%",display:"inline-flex",alignItems:"center",justifyContent:"center"},children:e.jsx("span",{style:{width:6,height:6,borderRadius:"50%",background:l.black,display:"inline-block"}})},c):e.jsx("span",{style:{width:10,height:10,borderRadius:"50%",background:l.white,border:`1px solid ${l.border}`,display:"inline-block",boxSizing:"border-box"}},c))})}const Qe=[{id:"title",label:"Title",width:220,sortable:!0,filterable:!0},{id:"date",label:"Date",width:170,sortable:!0},{id:"duration",label:"Duration",width:170,sortable:!0},{id:"lift",label:"Lift",width:120,sortable:!0},{id:"compass",label:"Compass Score",width:220,sortable:!0,render:t=>{const n=typeof t=="number"?t:parseFloat(t)||0;return e.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:12},children:[e.jsx("span",{style:{minWidth:32},children:t}),e.jsx(Je,{value:n})]})}}];function Ie({icon:t,title:n}){return e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:16,width:"100%"},children:[e.jsx("div",{style:{width:34,height:34,borderRadius:9999,background:l.iconCircle,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:e.jsx(t,{size:20,color:l.ink,strokeWidth:1.75})}),e.jsx("span",{style:{fontFamily:V,fontWeight:600,fontSize:16,color:l.ink,lineHeight:1.2},children:n})]})}function Re({agentName:t="",startDate:n="",endDate:r="",totalCalls:s="",onBack:a,className:o="",kpiBaseline:c={value:"",label:"",sub:"",trend:"up"},kpiAgentLift:x={value:"",label:"",sub:"",trend:"down"},kpiScore:j={value:"",label:"",sub:"",trend:"up"},baselineChart:h={value:"",delta:""},agentLiftChart:y={value:"",delta:""},scoreChart:b={value:"",delta:""},csatChart:g={value:"",delta:""},volumeChart:D={value:"",delta:""},guidanceItems:P=[],strengthItems:v=[],callDrivers:B=[],callParadigms:O=[],strengthsTitle:E="",guidanceTitle:_="",callMixTitle:Y="",driversTitle:X="",paradigmsTitle:L="",sessionsTitle:p="",baselineChartTitle:z="",agentLiftChartTitle:$="",scoreChartTitle:N="",csatChartTitle:T="",volumeChartTitle:M="",sessions:J=[],sessionColumns:Q=[],initialPageSize:u=10,selectedWindow:k="30d",onWindowChange:A,dateRange:I,onDateRangeChange:ee,sessionsTotal:q=null,sessionsPage:te=null,sessionsPageSize:de=null,onSessionsPageChange:ce,onSessionsPageSizeChange:G,onExport:H,onSessionClick:ye,onSessionsVisibleColumnsChange:Z}){const xe=!!(I!=null&&I.from&&(I!=null&&I.to)),W=F=>!!(F&&(F.value||F.delta||Array.isArray(F.points)&&F.points.length>0)),ie=W(h)||W(y)||W(b),ne=W(g)||W(D);return e.jsxs("div",{className:o,style:{background:l.white,fontFamily:C,color:l.ink,width:"100%",minWidth:1192,boxSizing:"border-box",display:"flex",flexDirection:"column"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"23px 32px",minHeight:78,boxSizing:"border-box"},children:[e.jsx("button",{type:"button","aria-label":"Back",onClick:a,style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:24,height:24,background:"transparent",border:"none",cursor:"pointer",color:l.ink,padding:0,flexShrink:0},children:e.jsx(f.ArrowLeft,{size:20,strokeWidth:1.75})}),e.jsx("div",{style:{paddingLeft:16,borderLeft:`1px solid ${l.border}`,flex:1,minWidth:0,alignSelf:"stretch",display:"flex",alignItems:"center"},children:e.jsx("h1",{style:{fontFamily:V,fontSize:24,fontWeight:400,color:l.ink,margin:0,lineHeight:1,whiteSpace:"nowrap"},children:t})}),e.jsxs("button",{type:"button",onClick:()=>H==null?void 0:H(),disabled:!H,style:{display:"inline-flex",alignItems:"center",gap:8,height:32,padding:"0 16px",borderRadius:10,border:`1px solid ${l.neutralBorder}`,background:l.white,cursor:H?"pointer":"not-allowed",opacity:H?1:.5,fontFamily:C,fontSize:14,lineHeight:"24px",color:l.neutral800,flexShrink:0},children:[e.jsx(f.Download,{size:18,strokeWidth:1.75}),"Export CSV"]})]}),e.jsxs("div",{style:{padding:"0 32px 32px",display:"flex",flexDirection:"column",gap:16},children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",gap:16,paddingLeft:49},children:[e.jsxs("div",{style:{display:"flex",gap:16,alignItems:"center"},children:[e.jsxs("div",{style:{display:"inline-flex",alignItems:"center",gap:6},children:[e.jsx(f.CalendarDays,{size:14,color:l.ink,strokeWidth:1.75,style:{flexShrink:0}}),e.jsx("span",{style:{fontFamily:C,fontSize:12,color:l.ink,lineHeight:1.5},children:Ce(n)}),e.jsx(f.ArrowRight,{size:12,color:l.ink,strokeWidth:1.75,style:{flexShrink:0}}),e.jsx("span",{style:{fontFamily:C,fontSize:12,color:l.ink,lineHeight:1.5},children:Ce(r)})]}),e.jsxs("div",{style:{display:"inline-flex",alignItems:"center",gap:6},children:[e.jsx(f.Phone,{size:14,color:l.ink,strokeWidth:1.75,style:{flexShrink:0}}),e.jsx("span",{style:{fontFamily:C,fontSize:12,color:l.ink,lineHeight:1.5},children:s})]})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10},children:[[{id:"8h",label:"8h"},{id:"1d",label:"1d"},{id:"7d",label:"7d"},{id:"30d",label:"30d"}].map(F=>e.jsx(qe,{label:F.label,active:!xe&&F.id===k,onClick:()=>A==null?void 0:A(F.id)},F.id)),e.jsx(ve,{value:I,onChange:ee})]})]}),e.jsxs("div",{style:{background:l.beige,border:`1px solid ${l.border}`,borderRadius:8,padding:16,display:"flex",gap:24,alignItems:"center"},children:[e.jsx(me,{value:c.value,label:c.label,sub:c.sub,trend:c.trend,points:c.points}),e.jsx(f.ArrowRight,{size:20,color:l.ink,strokeWidth:1.75,style:{flexShrink:0}}),e.jsx(me,{value:x.value,label:x.label,sub:x.sub,trend:x.trend,points:x.points}),e.jsx(f.ArrowRight,{size:20,color:l.ink,strokeWidth:1.75,style:{flexShrink:0}}),e.jsx(me,{value:j.value,label:j.label,sub:j.sub,trend:j.trend,points:j.points})]}),ie&&e.jsxs("div",{style:{display:"flex",gap:24},children:[W(h)&&e.jsx(re,{title:z,value:h.value,delta:h.delta,children:e.jsx(se,{yLabels:h.yLabels,xLabels:h.xLabels,points:h.points})}),W(y)&&e.jsx(re,{title:$,value:y.value,delta:y.delta,children:e.jsx(se,{yLabels:y.yLabels,xLabels:y.xLabels,points:y.points})}),W(b)&&e.jsx(re,{title:N,value:b.value,delta:b.delta,children:e.jsx(se,{yLabels:b.yLabels,xLabels:b.xLabels,points:b.points})})]}),ne&&e.jsxs("div",{style:{display:"flex",gap:24},children:[W(g)&&e.jsx(re,{title:T,value:g.value,delta:g.delta,children:e.jsx(se,{yLabels:g.yLabels,xLabels:g.xLabels,points:g.points})}),W(D)&&e.jsx(re,{title:M,value:D.value,delta:D.delta,children:e.jsx(se,{yLabels:D.yLabels,xLabels:D.xLabels,points:D.points})})]}),e.jsxs("div",{style:{display:"flex",gap:24,marginTop:8,alignItems:"flex-start"},children:[e.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:16,minWidth:0},children:[e.jsx(be,{icon:f.ShieldCheck,title:E,iconColor:l.railCompliance}),e.jsx("div",{style:{display:"flex",flexDirection:"column",maxHeight:480,overflowY:"auto"},children:v.map((F,U)=>e.jsx(Le,{...F},U))})]}),e.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:16,minWidth:0},children:[e.jsx(be,{icon:f.Lightbulb,title:_,iconColor:l.accentYellow}),e.jsx("div",{style:{display:"flex",flexDirection:"column",maxHeight:480,overflowY:"auto"},children:P.map((F,U)=>e.jsx(Le,{...F},U))})]})]}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:16,marginTop:8},children:[e.jsx(be,{icon:f.Phone,title:Y,iconColor:l.railCompliance}),e.jsxs("div",{style:{display:"flex",gap:24,alignItems:"flex-start"},children:[e.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:8,minWidth:0},children:[e.jsx(Ie,{icon:f.FolderKanban,title:X}),e.jsx("div",{style:{display:"flex",flexDirection:"column",maxHeight:480,overflowY:"auto"},children:B.map((F,U)=>e.jsx(We,{...F},U))})]}),e.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:8,minWidth:0},children:[e.jsx(Ie,{icon:f.Layers,title:L}),e.jsx("div",{style:{display:"flex",flexDirection:"column",maxHeight:480,overflowY:"auto"},children:O.map((F,U)=>e.jsx(We,{...F},U))})]})]})]}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:16,marginTop:8},children:[p&&e.jsx("span",{style:{fontFamily:V,fontWeight:600,fontSize:16,color:l.ink,lineHeight:1.2},children:p}),e.jsx(Me.DataTable2,{data:J,columns:Q,initialPageSize:u,totalCount:q,page:te,pageSize:de,onPageChange:ce,onPageSizeChange:G,onRowClick:ye,onVisibleColumnsChange:Z})]})]})]})}const oe={value:"",label:"",trend:"up"},i={ink:"var(--color-text)",muted:"var(--color-text-secondary)",border:"var(--grey-absent)",borderSubtle:"var(--neutral-100)",iconCircle:"var(--surface-hover)",black:"var(--neutral-900)",white:"var(--grey-white)",green:"var(--color-green)",red:"var(--color-red-strong)",neutralBorder:"var(--neutral-250)",neutralLight:"var(--neutral-100)",beige:"var(--surface-warm-40)",neutral800:"var(--neutral-800)",textInk:"var(--text-ink)",textFaintGrey:"var(--text-faint-grey)",hoverWarm40:"var(--hover-warm-40)",shadowPopover:"var(--shadow-popover)",shadowDropdown:"var(--shadow-dropdown)",railCompliance:"var(--rail-compliance)"},K="var(--font-sans, 'Averta', ui-sans-serif, system-ui, sans-serif)",S="var(--font-sans, 'Averta', ui-sans-serif, system-ui, sans-serif)";function Pe({trend:t="up",width:n=49.618,height:r=35}){const s=w.useId(),a="M1.00049 13.5213C7.85975 11.7032 8.88149 4.73912 13.7838 4.73912C19.8344 4.73912 23.6237 17.166 29.1281 17.166C34.5998 17.166 37.4149 4.88121 43.4004 8.61051C47.9764 11.4616 50.6186 1.00024 50.6186 1.00024",o="M1.00049 16.692C8.88149 15.6975 8.88149 7.79403 13.7838 7.79403C19.8344 7.79403 23.6237 21.4034 29.1281 21.4034C34.5998 21.4034 37.4149 8.93821 43.4004 12.7223C47.9764 15.6152 50.6186 5.00024 50.6186 5.00024V36.0002C50.6186 36.0002 10.8223 36.0002 1.00049 36.0002C1.00049 28.8653 1.00049 19.4871 1.00049 16.692Z";return e.jsxs("svg",{width:n,height:r,viewBox:"0 0 52 36",fill:"none",style:{flexShrink:0,transform:t==="down"?"scaleX(-1)":void 0},children:[e.jsx("defs",{children:e.jsxs("linearGradient",{id:`spark-${s}`,x1:"9.96776",y1:"16.2053",x2:"9.96776",y2:"36.0002",gradientUnits:"userSpaceOnUse",children:[e.jsx("stop",{stopColor:i.ink}),e.jsx("stop",{offset:"1",stopColor:i.white,stopOpacity:"0.01"})]})}),e.jsx("path",{d:o,fill:`url(#spark-${s})`,fillRule:"evenodd",clipRule:"evenodd",opacity:"0.1"}),e.jsx("path",{d:a,stroke:i.ink,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeDasharray:t==="down"?"2 4":void 0})]})}function Oe({direction:t="up",color:n=i.muted}){const r="M12.4167 0.75H17.4167M17.4167 0.75V5.75M17.4167 0.75L10.3333 7.83333L6.16667 3.66667L0.75 9.08333",s="M12.4167 9.25H17.4167M17.4167 9.25V4.25M17.4167 9.25L10.3333 2.16667L6.16667 6.33333L0.75 0.91667";return e.jsx("svg",{width:18,height:9.5,viewBox:"0 0 19 10",fill:"none",style:{flexShrink:0},children:e.jsx("path",{d:t==="up"?r:s,stroke:n,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function $e({value:t,label:n,trend:r="up",muted:s=!1,beigeBg:a=!1,style:o={}}){return e.jsxs("div",{style:{background:a?i.beige:i.white,border:`1px solid ${i.border}`,borderRadius:8,padding:16,display:"flex",flexDirection:"column",gap:8,boxSizing:"border-box",...o},children:[e.jsxs("div",{style:{display:"flex",alignItems:"flex-start",justifyContent:"space-between"},children:[e.jsx(Pe,{trend:r}),e.jsx(Oe,{direction:r})]}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8,marginTop:8},children:[e.jsx("div",{style:{fontFamily:K,fontSize:28,fontWeight:500,lineHeight:"1.2",color:s?i.muted:i.ink,letterSpacing:"-0.01em"},children:t}),e.jsx("div",{style:{fontFamily:S,fontSize:13,color:i.ink,lineHeight:"1.2"},children:n})]})]})}function je({value:t,label:n,trend:r="up",withDivider:s=!1}){return e.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:8,paddingLeft:s?24:0,borderLeft:s?`1px solid ${i.border}`:"none",minWidth:0},children:[e.jsxs("div",{style:{display:"flex",alignItems:"flex-start",justifyContent:"space-between"},children:[e.jsx(Pe,{trend:r}),e.jsx(Oe,{direction:r})]}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8,marginTop:8},children:[e.jsx("div",{style:{fontFamily:K,fontSize:28,fontWeight:500,lineHeight:"1.2",color:i.muted,letterSpacing:"-0.01em"},children:t}),e.jsx("div",{style:{fontFamily:S,fontSize:13,color:i.ink,lineHeight:"1.2"},children:n})]})]})}function et({icon:t,children:n,trailing:r}){return e.jsxs("button",{type:"button",style:{display:"inline-flex",alignItems:"center",gap:8,height:32,padding:"0 16px",borderRadius:10,border:`1px solid ${i.neutralBorder}`,background:i.white,cursor:"pointer",fontFamily:S,fontSize:14,color:i.neutral800,whiteSpace:"nowrap"},children:[t&&e.jsx(t,{size:18,strokeWidth:1.75}),n,r&&e.jsx(r,{size:16,strokeWidth:2})]})}const tt=["January","February","March","April","May","June","July","August","September","October","November","December"],it=["Su","Mo","Tu","We","Th","Fr","Sa"];function pe(t){const n=new Date(t);return n.setHours(0,0,0,0),n}function nt(t,n){const s=new Date(t,n,1).getDay(),a=new Date(t,n,1-s);return Array.from({length:42},(o,c)=>{const x=new Date(a);return x.setDate(a.getDate()+c),x})}function lt({value:t,onApply:n,onClose:r,anchorRef:s}){const a=w.useRef(null),[o,c]=w.useState(t!=null&&t.from?pe(t.from):null),[x,j]=w.useState(t!=null&&t.to?pe(t.to):null),h=o||new Date,[y,b]=w.useState(h.getFullYear()),[g,D]=w.useState(h.getMonth()),[P,v]=w.useState({top:0,left:0});w.useLayoutEffect(()=>{const p=()=>{if(!(s!=null&&s.current))return;const z=s.current.getBoundingClientRect(),$=320;v({top:z.bottom+6,left:Math.max(8,z.right-$)})};return p(),window.addEventListener("scroll",p,!0),window.addEventListener("resize",p),()=>{window.removeEventListener("scroll",p,!0),window.removeEventListener("resize",p)}},[s]),w.useEffect(()=>{const p=$=>{var N,T;(N=a.current)!=null&&N.contains($.target)||(T=s==null?void 0:s.current)!=null&&T.contains($.target)||r()},z=$=>{$.key==="Escape"&&r()};return document.addEventListener("mousedown",p),document.addEventListener("keydown",z),()=>{document.removeEventListener("mousedown",p),document.removeEventListener("keydown",z)}},[r,s]);const B=nt(y,g),O=pe(new Date),E=p=>{const z=pe(p);z>O||(!o||o&&x?(c(z),j(null)):z<o?c(z):j(z))},_=()=>{g===0?(D(11),b(y-1)):D(g-1)},Y=()=>{g===11?(D(0),b(y+1)):D(g+1)},X=p=>o&&x&&p>=o&&p<=x,L=p=>o&&p.getTime()===o.getTime()||x&&p.getTime()===x.getTime();return Ye.createPortal(e.jsxs("div",{ref:a,style:{position:"fixed",top:P.top,left:P.left,width:320,background:i.white,border:`1px solid ${i.borderSubtle}`,borderRadius:12,boxShadow:i.shadowPopover,padding:16,zIndex:9999,fontFamily:S},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:12},children:[e.jsx("button",{type:"button",onClick:_,style:Te,"aria-label":"Previous month",children:e.jsx(f.ChevronLeft,{size:18,strokeWidth:1.75})}),e.jsxs("div",{style:{fontSize:14,fontWeight:600,color:i.ink},children:[tt[g]," ",y]}),e.jsx("button",{type:"button",onClick:Y,style:Te,"aria-label":"Next month",children:e.jsx(f.ChevronRight,{size:18,strokeWidth:1.75})})]}),e.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(7, 1fr)",gap:2,marginBottom:4},children:it.map(p=>e.jsx("div",{style:{textAlign:"center",fontSize:12,color:i.muted,padding:"4px 0"},children:p},p))}),e.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(7, 1fr)",gap:2},children:B.map(p=>{const z=p.getMonth()===g,$=X(p),N=L(p),T=p.getTime()===O.getTime(),M=p>O;return e.jsx("button",{type:"button",onClick:()=>E(p),disabled:M,"aria-disabled":M,style:{height:36,border:"none",borderRadius:8,background:N?i.black:$?i.hoverWarm40:"transparent",color:N?i.white:M?i.textFaintGrey:z?i.ink:i.muted,fontFamily:S,fontSize:13,fontWeight:T?500:400,cursor:M?"not-allowed":"pointer",opacity:M?.6:1},children:p.getDate()},p.toISOString())})}),e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginTop:12,paddingTop:12,borderTop:`1px solid ${i.borderSubtle}`},children:[e.jsx("button",{type:"button",onClick:()=>{c(null),j(null)},style:{background:"transparent",border:"none",padding:0,cursor:"pointer",fontSize:14,fontWeight:500,color:i.ink},children:"Clear"}),e.jsx("button",{type:"button",disabled:!o||!x,onClick:()=>{n({from:o,to:x}),r()},style:{background:!o||!x?i.neutralBorder:i.black,color:i.white,border:"none",borderRadius:10,height:30,padding:"0 16px",fontFamily:S,fontSize:14,fontWeight:600,cursor:!o||!x?"not-allowed":"pointer"},children:"Apply"})]})]}),document.body)}const Te={display:"inline-flex",alignItems:"center",justifyContent:"center",width:28,height:28,border:"none",background:"transparent",borderRadius:6,cursor:"pointer",color:i.ink};function ve({value:t,onChange:n}){const[r,s]=w.useState(!1),a=w.useRef(null),o=!!(t!=null&&t.from&&(t!=null&&t.to));return e.jsxs(e.Fragment,{children:[e.jsxs("button",{ref:a,type:"button",onClick:()=>s(c=>!c),style:{display:"inline-flex",alignItems:"center",gap:8,height:32,padding:"0 16px",borderRadius:10,border:o?"none":`1px solid ${i.neutralBorder}`,background:o?i.black:i.white,cursor:"pointer",fontFamily:S,fontSize:14,color:o?i.white:i.neutral800,fontWeight:o?600:400,whiteSpace:"nowrap"},children:[e.jsx(f.CalendarDays,{size:18,strokeWidth:1.75}),"Date Range"]}),r&&e.jsx(lt,{value:t,anchorRef:a,onClose:()=>s(!1),onApply:c=>n==null?void 0:n(c)})]})}function st({label:t,active:n=!1,onClick:r}){return e.jsx("button",{type:"button",onClick:r,style:{height:32,minWidth:31,padding:"0 12px",borderRadius:10,border:n?"none":`1px solid ${i.borderSubtle}`,background:n?i.black:i.white,color:n?i.white:i.black,fontFamily:S,fontSize:14,cursor:"pointer"},children:t})}const rt=[{id:"8h",label:"8h"},{id:"1d",label:"1d"},{id:"7d",label:"7d"},{id:"30d",label:"30d"}],_e={"8h":8*60*60*1e3,"1d":24*60*60*1e3,"7d":7*24*60*60*1e3,"30d":30*24*60*60*1e3};function ue(t){return t.toLocaleDateString("en-US",{month:"2-digit",day:"2-digit",year:"numeric"})}function ot(t){const n=_e[t];if(!n)return"";const r=new Date,s=new Date(r.getTime()-n);return`${ue(s)} – ${ue(r)}`}function at({value:t=0,max:n=5}){const r=typeof t=="number"?t:parseFloat(t)||0,s=Math.floor(r),a=r%1>0&&s<n;return e.jsx("div",{style:{display:"flex",gap:4},children:Array.from({length:n}).map((o,c)=>c<s?e.jsx("span",{style:{width:10,height:10,borderRadius:"50%",background:i.black,display:"inline-block"}},c):c===s&&a?e.jsx("span",{style:{width:10,height:10,borderRadius:"50%",display:"inline-flex",alignItems:"center",justifyContent:"center"},children:e.jsx("span",{style:{width:6,height:6,borderRadius:"50%",background:i.black,display:"inline-block"}})},c):e.jsx("span",{style:{width:10,height:10,borderRadius:"50%",background:i.white,border:`1px solid ${i.border}`,display:"inline-block",boxSizing:"border-box"}},c))})}const dt=[{id:"agent",label:"Agent",width:180,sortable:!0,filterable:!0},{id:"supervisor",label:"Supervisor",width:170,sortable:!0,filterable:!0},{id:"calls",label:"Calls",width:100,sortable:!0},{id:"baseline",label:"Baseline",width:110,sortable:!0},{id:"lift",label:"Lift",width:100,sortable:!0},{id:"score",label:"Score",width:100,sortable:!0,filterable:!0,filterType:"number"},{id:"compass",label:"Compass Score",width:200,sortable:!0,filterable:!0,filterType:"number",render:t=>e.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:12},children:[e.jsx("span",{style:{minWidth:32},children:t}),e.jsx(at,{value:typeof t=="number"?t:0})]})},{id:"totalDuration",label:"Total Duration",width:150,sortable:!0,filterable:!0,filterType:"duration",filterShowPresets:!1},{id:"avgDuration",label:"Average Duration",width:170,sortable:!0,filterable:!0,filterType:"duration",filterShowPresets:!1}];function he({icon:t,title:n,trailing:r,iconColor:s=i.ink,bordered:a=!1}){return e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,width:"100%",paddingBottom:a?12:0,borderBottom:a?`1px solid ${i.border}`:"none"},children:[e.jsx("div",{style:{width:24,height:24,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:e.jsx(t,{size:22,strokeWidth:1.75,style:{color:s}})}),e.jsx("div",{style:{flex:1,fontFamily:K,fontWeight:600,fontSize:16,color:i.ink,lineHeight:"1.2",textTransform:"uppercase",letterSpacing:"0.02em"},children:n}),r&&e.jsx("div",{style:{fontFamily:S,fontSize:14,color:i.ink},children:r})]})}function Ae({icon:t,title:n}){return e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:16,width:"100%"},children:[e.jsx("div",{style:{width:34,height:34,borderRadius:9999,background:i.iconCircle,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:e.jsx(t,{size:20,color:i.ink,strokeWidth:1.75})}),e.jsx("span",{style:{fontFamily:K,fontWeight:600,fontSize:16,color:i.ink,lineHeight:"24px"},children:n})]})}function He({title:t,summary:n,calls:r,percent:s,bullets:a,defaultExpanded:o=!1}){const[c,x]=w.useState(o),j=Array.isArray(a)?a:[];return e.jsxs("div",{style:{borderTop:`1px solid ${i.border}`},children:[e.jsxs("button",{type:"button",onClick:()=>x(h=>!h),"aria-expanded":c,style:{border:"none",background:"transparent",padding:16,display:"flex",gap:12,alignItems:"flex-start",cursor:"pointer",width:"100%",textAlign:"left",fontFamily:S},children:[e.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:12,minWidth:0},children:[e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:12},children:[e.jsx("div",{style:{fontFamily:K,fontWeight:600,fontSize:14,color:i.black,lineHeight:"24px"},children:t}),e.jsx("div",{style:{fontFamily:S,fontSize:14,color:i.muted,lineHeight:"24px"},children:n})]}),e.jsxs("div",{style:{display:"flex",gap:16},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:4},children:[e.jsx(f.Phone,{size:14,color:i.ink,strokeWidth:1.75}),e.jsx("span",{style:{fontFamily:S,fontSize:12,color:i.ink,lineHeight:1.5},children:r})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:4},children:[e.jsx(f.TrendingUp,{size:14,color:i.ink,strokeWidth:1.75}),e.jsx("span",{style:{fontFamily:S,fontSize:12,color:i.ink,lineHeight:1.5},children:s})]})]})]}),e.jsx(f.ChevronDown,{size:20,color:i.ink,strokeWidth:2,style:{flexShrink:0,transform:c?"rotate(180deg)":"none",transition:"transform 150ms ease"}})]}),c&&j.length>0&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:12,padding:"0 16px 16px"},children:j.map((h,y)=>e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",fontFamily:S,fontSize:14,color:i.ink,lineHeight:"24px",gap:16},children:[h.href?e.jsx("a",{href:h.href,target:"_blank",rel:"noopener noreferrer",style:{color:i.ink,textDecoration:"underline",textUnderlineOffset:2,textDecorationColor:i.border,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:h.text}):e.jsx("span",{style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:h.text}),e.jsxs("span",{style:{display:"inline-flex",gap:4,whiteSpace:"nowrap"},children:[e.jsx("span",{style:{color:i.ink},children:h.citation}),e.jsxs("span",{style:{color:i.muted},children:["(",h.date,")"]})]})]},y))})]})}function fe({label:t,value:n}){return e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"12px 0",borderBottom:`1px solid ${i.border}`,fontFamily:S,fontSize:13,lineHeight:"24px"},children:[e.jsx("span",{style:{color:i.ink},children:t}),e.jsx("span",{style:{color:i.muted},children:n})]})}function ae({message:t=""}){return t?e.jsx("div",{style:{padding:"16px 0",fontFamily:S,fontSize:13,color:i.muted,lineHeight:1.5},children:t}):null}function ct({className:t="",onAgentClick:n,title:r="",subtitle:s="",dateRangeLabel:a="",viewByOptions:o=[],initialViewBy:c="",onViewByChange:x,aggregatedByLabel:j="",volumeStat:h=oe,compassStat:y=oe,baselineSubStat:b=oe,agentLiftSubStat:g=oe,scoreSubStat:D=oe,agentRows:P=[],agentColumns:v=[],initialPageSize:B=10,guidanceItems:O=[],strengthItems:E=[],callDrivers:_=[],callParadigms:Y=[],topSignalsLeft:X=[],topSignalsRight:L=[],topSignalsTrailing:p="",strengthsTitle:z="",guidanceTitle:$="",callMixTitle:N="",driversTitle:T="",paradigmsTitle:M="",topSignalsTitle:J="",emptyStrengthsMessage:Q="",emptyGuidanceMessage:u="",emptyDriversMessage:k="",emptyParadigmsMessage:A="",emptyTopSignalsMessage:I="",rangeOptions:ee=rt,selectedWindow:q="30d",onWindowChange:te,dateRangePicker:de,dateRange:ce,onDateRangeChange:G,onExport:H,onVisibleColumnsChange:ye}){var De,ze;const[Z,xe]=w.useState(null),[W,ie]=w.useState(!1),[ne,F]=w.useState(c),[U,ke]=w.useState(null),R=ce!==void 0?ce:U,ge=!!(R!=null&&R.from&&(R!=null&&R.to)),Ne=d=>{ke(d),G==null||G(d)},Be=d=>{ke(null),G==null||G(null),te==null||te(d)},we=w.useRef(null),Se=w.useRef(null);w.useEffect(()=>{if(!W)return;const d=m=>{var le,Fe;(le=Se.current)!=null&&le.contains(m.target)||(Fe=we.current)!=null&&Fe.contains(m.target)||ie(!1)};return document.addEventListener("mousedown",d),()=>document.removeEventListener("mousedown",d)},[W]);const Ee=((De=o.find(d=>d.id===ne))==null?void 0:De.label)||(((ze=o[0])==null?void 0:ze.label)??""),Ue=d=>{if(n){n(d);return}xe(d)};return e.jsxs(e.Fragment,{children:[Z&&(()=>{let d=null,m=null;if(ge)d=R.from,m=R.to;else{const le=_e[q];le&&(m=new Date,d=new Date(m.getTime()-le))}return e.jsx(Re,{className:t,agentName:Z.agent,startDate:d||"",endDate:m||"",totalCalls:`${Z.calls} Calls`,onBack:()=>xe(null),selectedWindow:q,dateRange:R})})(),e.jsxs("div",{className:t,style:{background:i.white,fontFamily:S,color:i.ink,width:"100%",minWidth:1192,boxSizing:"border-box",padding:"12px 32px 32px",flexDirection:"column",gap:24,display:Z?"none":"flex"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:8,paddingTop:12},children:[e.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:4},children:[e.jsx("h1",{style:{fontFamily:K,fontSize:24,fontWeight:500,color:i.ink,margin:0,lineHeight:"1.2",letterSpacing:"-0.01em"},children:r}),e.jsx("p",{style:{fontFamily:S,fontSize:14,color:"var(--neutral-950)",margin:0,lineHeight:"1.4"},children:s})]}),e.jsxs("button",{type:"button",onClick:()=>H==null?void 0:H(),disabled:!H,style:{display:"inline-flex",alignItems:"center",gap:8,height:32,padding:"0 16px",borderRadius:10,border:`1px solid ${i.neutralBorder}`,background:i.white,cursor:H?"pointer":"not-allowed",opacity:H?1:.5,fontFamily:S,fontSize:14,color:i.neutral800},children:[e.jsx(f.Download,{size:18,strokeWidth:1.75}),"Export CSV"]})]}),e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[e.jsxs("div",{style:{position:"relative"},children:[e.jsxs("button",{type:"button",ref:we,onClick:()=>ie(d=>!d),"aria-haspopup":"listbox","aria-expanded":W,style:{display:"inline-flex",alignItems:"center",gap:8,height:32,padding:"0 16px",borderRadius:10,border:`1px solid ${i.neutralBorder}`,background:i.white,cursor:"pointer",fontFamily:S,fontSize:14,lineHeight:"24px",color:i.neutral800,whiteSpace:"nowrap"},children:[Ee,e.jsx(f.ChevronDown,{size:20,strokeWidth:1.75,style:{transform:W?"rotate(180deg)":"none",transition:"transform 120ms ease"}})]}),W&&e.jsxs("div",{ref:Se,role:"listbox",style:{position:"absolute",top:36,left:0,zIndex:20,background:i.white,border:`1px solid ${i.border}`,borderRadius:4,boxShadow:i.shadowDropdown,display:"flex",flexDirection:"column",minWidth:144,fontFamily:S},children:[j&&e.jsx("div",{style:{padding:12,fontFamily:K,fontWeight:600,fontSize:13,color:i.ink,lineHeight:1.2},children:j}),o.map(d=>{const m=ne===d.id;return e.jsxs("button",{type:"button",role:"option","aria-selected":m,onClick:()=>{d.id!==ne&&(F(d.id),x==null||x(d.id)),ie(!1)},style:{display:"flex",alignItems:"center",gap:8,padding:m?12:"12px 12px 12px 40px",borderTop:`1px solid ${i.border}`,borderLeft:"none",borderRight:"none",borderBottom:"none",background:"transparent",cursor:"pointer",textAlign:"left",fontFamily:S,fontSize:13,lineHeight:1.2,color:i.ink,width:"100%"},children:[m&&e.jsx(f.Check,{size:20,color:i.ink,strokeWidth:1.75,style:{flexShrink:0}}),e.jsx("span",{children:d.label})]},d.id)})]})]}),e.jsxs("div",{style:{display:"flex",gap:10,alignItems:"center"},children:[(()=>{const m=(ge?`${ue(R.from)} – ${ue(R.to)}`:"")||a||ot(q);return m?e.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:6,fontFamily:S,fontSize:13,color:i.ink},children:[e.jsx(f.CalendarDays,{size:16,strokeWidth:1.75,color:i.muted}),m]}):null})(),ee.map(d=>e.jsx(st,{label:d.label,active:!ge&&d.id===q,onClick:()=>Be(d.id)},d.id)),de?e.jsx(w.Suspense,{fallback:e.jsx(et,{icon:f.CalendarDays,children:"Date Range"}),children:de}):e.jsx(ve,{value:R,onChange:Ne})]})]}),e.jsxs("div",{style:{display:"flex",gap:24},children:[e.jsx($e,{value:h.value,label:h.label,trend:h.trend,style:{width:264,flexShrink:0}}),e.jsx($e,{value:y.value,label:y.label,trend:y.trend,style:{width:264,flexShrink:0}}),e.jsxs("div",{style:{flex:1,background:i.beige,border:`1px solid ${i.border}`,borderRadius:8,padding:16,display:"flex",gap:24,alignItems:"stretch",boxSizing:"border-box"},children:[e.jsx(je,{value:b.value,label:b.label,trend:b.trend}),e.jsx(je,{value:g.value,label:g.label,trend:g.trend,withDivider:!0}),e.jsx(je,{value:D.value,label:D.label,trend:D.trend,withDivider:!0})]})]}),e.jsx(Me.DataTable2,{data:P,columns:v,initialPageSize:B,onRowClick:Ue,onVisibleColumnsChange:ye}),e.jsxs("div",{style:{display:"flex",gap:24,alignItems:"flex-start"},children:[e.jsxs("div",{style:{flex:1,minWidth:0,display:"flex",flexDirection:"column",gap:16},children:[e.jsx(he,{icon:f.ShieldCheck,title:z,iconColor:"var(--rail-compliance)"}),e.jsx("div",{style:{display:"flex",flexDirection:"column",borderBottom:`1px solid ${i.border}`,maxHeight:480,overflowY:"auto"},children:E.length===0?e.jsx(ae,{message:Q}):E.map((d,m)=>e.jsx(He,{...d},m))})]}),e.jsxs("div",{style:{flex:1,minWidth:0,display:"flex",flexDirection:"column",gap:16},children:[e.jsx(he,{icon:f.Lightbulb,title:$,iconColor:"var(--rail-compliance)"}),e.jsx("div",{style:{display:"flex",flexDirection:"column",borderBottom:`1px solid ${i.border}`,maxHeight:480,overflowY:"auto"},children:O.length===0?e.jsx(ae,{message:u}):O.map((d,m)=>e.jsx(He,{...d},m))})]})]}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:16},children:[e.jsx(he,{icon:f.Phone,title:N,iconColor:"var(--rail-compliance)"}),e.jsxs("div",{style:{display:"flex",gap:24,alignItems:"flex-start"},children:[e.jsxs("div",{style:{flex:1,minWidth:0,display:"flex",flexDirection:"column",gap:8},children:[e.jsx(Ae,{icon:f.FolderKanban,title:T}),e.jsx("div",{style:{display:"flex",flexDirection:"column",maxHeight:480,overflowY:"auto"},children:_.length===0?e.jsx(ae,{message:k}):_.map((d,m)=>e.jsx(fe,{...d},m))})]}),e.jsxs("div",{style:{flex:1,minWidth:0,display:"flex",flexDirection:"column",gap:8},children:[e.jsx(Ae,{icon:f.Layers,title:M}),e.jsx("div",{style:{display:"flex",flexDirection:"column",maxHeight:480,overflowY:"auto"},children:Y.length===0?e.jsx(ae,{message:A}):Y.map((d,m)=>e.jsx(fe,{...d},m))})]})]})]}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:16},children:[e.jsx(he,{icon:f.Signal,title:J,iconColor:"var(--rail-compliance)",trailing:p,bordered:!0}),X.length===0&&L.length===0?e.jsx(ae,{message:I}):e.jsxs("div",{style:{display:"flex",gap:24},children:[e.jsx("div",{style:{flex:1,display:"flex",flexDirection:"column"},children:X.map((d,m)=>e.jsx(fe,{...d},m))}),e.jsx("div",{style:{flex:1,display:"flex",flexDirection:"column"},children:L.map((d,m)=>e.jsx(fe,{...d},m))})]})]})]})]})}exports.DEFAULT_AGENT_COLUMNS=dt;exports.DEFAULT_SESSION_COLUMNS=Qe;exports.DateRangeButton=ve;exports.PerformanceDetailsPage=Re;exports.PerformancePanel=ct;
1
+ "use strict";const e=require("react/jsx-runtime"),w=require("react"),ht=require("react-dom"),h=require("lucide-react"),qe=require("./DataTable2.cjs.js"),ve={"8h":8*60*60*1e3,"1d":24*60*60*1e3,"7d":7*24*60*60*1e3,"30d":30*24*60*60*1e3},Je="en-US",yt={month:"2-digit",day:"2-digit",year:"numeric"},mt={hour:"numeric",minute:"2-digit",hour12:!0};function he(t){if(!t)return null;if(t instanceof Date)return Number.isNaN(t.getTime())?null:t;const n=String(t).trim(),i=n.match(/^(\d{4})-(\d{1,2})-(\d{1,2})/);if(i){const o=new Date(Number(i[1]),Number(i[2])-1,Number(i[3]));return Number.isNaN(o.getTime())?null:o}const r=new Date(n);return Number.isNaN(r.getTime())?null:r}function Ze(t,n){return t.getFullYear()===n.getFullYear()&&t.getMonth()===n.getMonth()&&t.getDate()===n.getDate()}function ee(t){const n=t instanceof Date?t:he(t);return n?n.toLocaleDateString(Je,yt):""}function Ce(t){return t.toLocaleTimeString(Je,mt)}function se(t){return`${ee(t)} ${Ce(t)}`}function Qe(t,n){const i=he(t),r=he(n);return!i||!r?"":Ze(i,r)?`${se(i)} – ${Ce(r)}`:`${se(i)} – ${se(r)}`}function et(t,n){const i=he(t),r=he(n);return!i||!r?null:Ze(i,r)?{from:se(i),to:Ce(r)}:{from:se(i),to:se(r)}}function je(t){const n=ve[t];if(!n)return null;const i=new Date;return{from:new Date(i.getTime()-n),to:i}}function tt(t){if(!ve[t])return"";const i=je(t);return i?t==="8h"?Qe(i.from,i.to):`${ee(i.from)} – ${ee(i.to)}`:""}const nt="M1.00049 13.5213C7.85975 11.7032 8.88149 4.73912 13.7838 4.73912C19.8344 4.73912 23.6237 17.166 29.1281 17.166C34.5998 17.166 37.4149 4.88121 43.4004 8.61051C47.9764 11.4616 50.6186 1.00024 50.6186 1.00024",it="M1.00049 16.692C8.88149 15.6975 8.88149 7.79403 13.7838 7.79403C19.8344 7.79403 23.6237 21.4034 29.1281 21.4034C34.5998 21.4034 37.4149 8.93821 43.4004 12.7223C47.9764 15.6152 50.6186 5.00024 50.6186 5.00024V36.0002C50.6186 36.0002 10.8223 36.0002 1.00049 36.0002C1.00049 28.8653 1.00049 19.4871 1.00049 16.692Z";function ke(t){if(!Array.isArray(t))return null;const n=t.map(i=>Array.isArray(i)?Number(i[1]):i==null||i===""?NaN:Number(i)).filter(i=>Number.isFinite(i));return n.length>=2?n:null}function $e(t,n=52,i=36){const r=ke(t);if(!r)return null;const o=Math.min(...r),a=Math.max(...r),d=4,c=a-o||1,F=i-d*2-4,p=D=>(r.length===1?0:D/(r.length-1)*(n-2))+1,y=D=>d+(1-(D-o)/c)*F;let b="";for(let D=0;D<r.length;D++)b+=`${D===0?"M":"L"}${p(D).toFixed(2)},${y(r[D]).toFixed(2)}`;const v=p(r.length-1),S=p(0),W=`${b} L${v.toFixed(2)},${i} L${S.toFixed(2)},${i} Z`;return{line:b,area:W}}function we(t){const n=ke(t);if(!n)return null;const i=n[0],r=n[n.length-1];return r>i?"up":r<i?"down":"up"}const Ae="—";function Se(t){if(t==null)return!0;const n=String(t).trim();return!!(!n||/^[-−–—]$/.test(n)||/^(n\/a|null|undefined)$/i.test(n))}function ye(t){return!Se(t)}function Ie(t,n=Ae){return Se(t)?n:String(t)}function Oe(t){return t!=null&&String(t).trim()!==""}function U(t){return t?Oe(t.value)||Oe(t.delta)?!0:Array.isArray(t.points)&&t.points.length>0:!1}function lt(t){if(Se(t))return null;const n=String(t).trim(),i=n.match(/\(\s*([+-])?\s*([\d.]+)/);return i?i[1]==="-"?"down":i[1]==="+"?"up":parseFloat(i[2])<0?"down":"up":/^[-−]/.test(n)?"down":/^\+/.test(n)?"up":/-\d/.test(n)?"down":null}function De(t,n){return lt(n)??(t==="down"?"down":"up")}function rt(t,n,i){return we(i)??(ye(n)?De(t,n):t==="down"?"down":"up")}const s={ink:"var(--color-text)",muted:"var(--color-text-secondary)",border:"var(--grey-absent)",borderSubtle:"var(--neutral-100)",iconCircle:"var(--surface-hover)",black:"var(--neutral-900)",white:"var(--grey-white)",neutralBorder:"var(--neutral-250)",neutral800:"var(--neutral-800)",neutral600:"var(--neutral-600)",neutral450:"var(--neutral-450)",neutral400:"var(--neutral-400)",neutral300:"var(--neutral-300)",neutral150:"var(--neutral-150)",neutral100:"var(--neutral-100)",beige:"var(--surface-warm-40)",shadowCard:"var(--shadow-card)",railCompliance:"var(--rail-compliance)",accentYellow:"var(--accent-yellow)"},te="var(--font-sans, 'Averta', ui-sans-serif, system-ui, sans-serif)",z="var(--font-sans, 'Averta', ui-sans-serif, system-ui, sans-serif)";function st({direction:t="up",color:n=s.muted}){const i="M12.4167 0.75H17.4167M17.4167 0.75V5.75M17.4167 0.75L10.3333 7.83333L6.16667 3.66667L0.75 9.08333",r="M12.4167 9.25H17.4167M17.4167 9.25V4.25M17.4167 9.25L10.3333 2.16667L6.16667 6.33333L0.75 0.91667";return e.jsx("svg",{width:18,height:9.5,viewBox:"0 0 19 10",fill:"none",style:{flexShrink:0},children:e.jsx("path",{d:t==="up"?i:r,stroke:n,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function _e(t){if(!t)return"";const n={month:"2-digit",day:"2-digit",year:"numeric"};if(t instanceof Date)return Number.isNaN(t.getTime())?"":t.toLocaleDateString("en-US",n);const i=String(t).trim(),r=i.match(/^(\d{4})-(\d{1,2})-(\d{1,2})/);if(r)return new Date(Number(r[1]),Number(r[2])-1,Number(r[3])).toLocaleDateString("en-US",n);const o=new Date(i);return Number.isNaN(o.getTime())?i:o.toLocaleDateString("en-US",n)}function gt({trend:t="up",points:n,empty:i=!1,width:r=49.618,height:o=35}){const a=w.useId();if(i)return e.jsx("svg",{width:r,height:o,viewBox:"0 0 52 36",fill:"none",style:{flexShrink:0},children:e.jsx("path",{d:"M2,18 L50,18",stroke:s.ink,strokeWidth:"2",strokeLinecap:"round"})});const d=$e(n),c=d?d.line:nt,F=d?d.area:it;return e.jsxs("svg",{width:r,height:o,viewBox:"0 0 52 36",fill:"none",style:{flexShrink:0,transform:!d&&t==="down"?"scaleX(-1)":void 0},children:[e.jsx("defs",{children:e.jsxs("linearGradient",{id:`spark-${a}`,x1:"9.96776",y1:"16.2053",x2:"9.96776",y2:"36.0002",gradientUnits:"userSpaceOnUse",children:[e.jsx("stop",{stopColor:s.ink}),e.jsx("stop",{offset:"1",stopColor:s.white,stopOpacity:"0.01"})]})}),e.jsx("path",{d:F,fill:`url(#spark-${a})`,fillRule:"evenodd",clipRule:"evenodd",opacity:"0.1"}),e.jsx("path",{d:c,stroke:s.ink,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeDasharray:!d&&t==="down"?"2 4":void 0})]})}function bt({value:t,label:n,sub:i,trend:r="up",points:o}){const a=Ie(t),d=ye(t)||ke(o)!=null,c=rt(r,t,o);return e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",gap:16,minWidth:0},children:[e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4,flexShrink:0,alignItems:"flex-end"},children:[e.jsx(gt,{trend:c,points:o,empty:!d}),d?e.jsx(st,{direction:c}):null]}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:6,minWidth:0},children:[e.jsx("div",{style:{fontFamily:te,fontSize:28,fontWeight:400,lineHeight:"1.2",color:s.muted,letterSpacing:"-0.01em",whiteSpace:"nowrap"},children:a}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:2},children:[e.jsx("span",{style:{fontFamily:z,fontSize:13,color:s.ink,lineHeight:"1.2"},children:n}),e.jsx("span",{style:{fontFamily:z,fontSize:13,color:s.neutral600,lineHeight:"1.2"},children:i})]})]})]})}function jt({label:t,active:n=!1,onClick:i}){return e.jsx("button",{type:"button",onClick:i,style:{height:32,minWidth:31,padding:"0 12px",borderRadius:10,border:n?"none":`1px solid ${s.borderSubtle}`,background:n?s.black:s.white,color:n?s.white:s.black,fontFamily:z,fontSize:14,cursor:"pointer"},children:t})}function ue({yLabels:t,xLabels:n=[],points:i,highlightIndex:r}){const[o,a]=w.useState(null),d=460,c=110,F=Array.isArray(i)&&i.length>0,p=w.useId(),y=6,b=Array.isArray(n)?n:[],v=b.length<=y?b:Array.from({length:y},(x,m)=>b[Math.round(m*(b.length-1)/(y-1))]),S=Math.max(2,v.length||y),W=Array.from({length:S},(x,m)=>m/(S-1)*d);if(!F)return e.jsxs("div",{style:{display:"flex",gap:8,height:133,width:"100%"},children:[e.jsx("div",{style:{width:24,flexShrink:0}}),e.jsx("div",{style:{flex:1,position:"relative",minWidth:0},children:e.jsx("svg",{width:"100%",height:c+14,viewBox:`0 0 ${d} ${c+14}`,preserveAspectRatio:"none",children:W.map((x,m)=>e.jsx("line",{x1:x,y1:"0",x2:x,y2:c,stroke:s.borderSubtle,strokeDasharray:"2 3",strokeWidth:"1",vectorEffect:"non-scaling-stroke"},`grid-${m}`))})})]});const D=Array.isArray(i[0])?i:i.map((x,m)=>[m,x]),Y=D.map(([,x])=>x),I=Math.min(...Y),E=Math.max(...Y),X=E===I?Math.max(Math.abs(E)*.1,1):(E-I)*.1,G=I-X,O=E+X,J=O-G||1,f=x=>(O-x)/J*c,j=D.map(([x,m])=>[x,f(m)]),C=t&&t.length?t:Array.from({length:5},(x,m)=>{const T=O-m/4*(O-G),P=Math.abs(T),$=P>=100?0:P>=10?1:2;return T.toFixed($)}),M=j[0][0],_=j[j.length-1][0]-M||1,ie=8,oe=Math.max(1,d-ie*2),q=x=>ie+(x-M)/_*oe,Z=x=>{const m=Number(x);if(!Number.isFinite(m))return String(x??"");const T=Math.abs(m),P=T>=100?0:T>=10?1:2;return m.toFixed(P)},Q=j.map(([x,m],T)=>`${T===0?"M":"L"}${q(x)},${m}`).join(" "),B=`${Q} L${q(j[j.length-1][0])},${c} L${q(j[0][0])},${c} Z`,ae=r??j.length-1;return e.jsxs("div",{style:{display:"flex",gap:8,height:133,width:"100%"},children:[e.jsx("div",{style:{display:"flex",flexDirection:"column",justifyContent:"space-between",padding:"14px 0",fontFamily:z,fontSize:10,color:s.neutral800,flexShrink:0},children:C.map(x=>e.jsx("span",{children:x},x))}),e.jsxs("div",{style:{flex:1,position:"relative",minWidth:0},children:[o&&e.jsxs("div",{style:{position:"absolute",left:`${o.xPct}%`,top:`${o.yPct}%`,transform:"translate(-50%, calc(-100% - 10px))",pointerEvents:"none",zIndex:2,background:s.black,color:s.white,borderRadius:6,minWidth:60,padding:"8px 10px",boxShadow:"0 6px 16px rgba(0,0,0,0.18)",fontFamily:z,fontSize:11,lineHeight:1.25,whiteSpace:"nowrap",textAlign:"left"},children:[e.jsx("div",{children:o.label}),e.jsx("div",{style:{fontWeight:600},children:o.value}),e.jsx("div",{style:{position:"absolute",left:"50%",bottom:-5,width:10,height:10,background:s.black,transform:"translateX(-50%) rotate(45deg)",borderRadius:2}})]}),e.jsxs("svg",{width:"100%",height:c+14,viewBox:`0 0 ${d} ${c+14}`,preserveAspectRatio:"none",onMouseLeave:()=>a(null),children:[e.jsx("defs",{children:e.jsxs("linearGradient",{id:`area-${p}`,x1:"0",y1:"0",x2:"0",y2:"1",children:[e.jsx("stop",{offset:"0%",style:{stopColor:s.black,stopOpacity:.08}}),e.jsx("stop",{offset:"100%",style:{stopColor:s.black,stopOpacity:0}})]})}),W.map((x,m)=>e.jsx("line",{x1:x,y1:"0",x2:x,y2:c,stroke:s.borderSubtle,strokeDasharray:"2 3",strokeWidth:"1",vectorEffect:"non-scaling-stroke"},`grid-${m}`)),e.jsx("path",{d:B,fill:`url(#area-${p})`}),e.jsx("path",{d:Q,stroke:s.black,strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",vectorEffect:"non-scaling-stroke"}),j.map(([x,m],T)=>{const P=T===ae;return e.jsx("circle",{cx:q(x),cy:m,r:P?4:3,fill:P?s.black:s.white,stroke:s.black,strokeWidth:"1.5",vectorEffect:"non-scaling-stroke",onMouseEnter:()=>{var $;a({xPct:q(x)/d*100,yPct:m/(c+28)*100,label:b[T]||`Point ${T+1}`,value:Z(($=D[T])==null?void 0:$[1])})}},T)})]}),e.jsx("div",{style:{display:"flex",justifyContent:"space-between",paddingRight:6,fontFamily:z,fontSize:10,color:s.neutral800,marginTop:8,marginBottom:4,overflow:"hidden"},children:v.map((x,m)=>e.jsx("span",{style:{whiteSpace:"nowrap"},children:x},m))})]})]})}function xe({title:t,value:n,delta:i,children:r}){const o=Ie(n),a=ye(i),d=a?De("up",i):"up";return e.jsxs("div",{style:{flex:1,background:s.white,border:`1px solid ${s.border}`,borderRadius:8,padding:24,display:"flex",flexDirection:"column",gap:24,minWidth:0,boxShadow:s.shadowCard},children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-end"},children:[e.jsx("span",{style:{fontFamily:te,fontWeight:600,fontSize:15,color:s.ink,lineHeight:1.2},children:t}),e.jsxs("span",{style:{display:"inline-flex",alignItems:"flex-end",gap:4,fontFamily:te,fontWeight:600},children:[e.jsx("span",{style:{fontSize:20,color:s.black,lineHeight:1},children:o}),a?e.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:3,fontSize:10,color:s.neutral300,lineHeight:1},children:[e.jsx(st,{direction:d,color:s.neutral300}),i]}):null]})]}),e.jsx("div",{style:{flex:1},children:r})]})}function Te({icon:t,title:n,trailing:i,iconColor:r=s.ink,bordered:o=!1}){return e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,width:"100%",paddingBottom:o?12:0,borderBottom:o?`1px solid ${s.border}`:"none"},children:[e.jsx("div",{style:{width:24,height:24,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:e.jsx(t,{size:22,strokeWidth:1.75,style:{color:r}})}),e.jsx("div",{style:{flex:1,fontFamily:te,fontWeight:600,fontSize:16,color:s.ink,lineHeight:1.2,textTransform:"uppercase",letterSpacing:"0.02em"},children:n}),i&&e.jsx("div",{style:{fontFamily:z,fontSize:14,color:s.ink},children:i})]})}function vt({text:t,bullet:n,citation:i,date:r,href:o}){const a=t??n??"";return e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",fontFamily:z,fontSize:14,color:s.ink,lineHeight:"24px",gap:16},children:[o?e.jsx("a",{href:o,target:"_blank",rel:"noopener noreferrer",style:{color:s.ink,textDecoration:"underline",textUnderlineOffset:2,textDecorationColor:s.border,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:a}):e.jsx("span",{style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:a}),e.jsxs("span",{style:{display:"inline-flex",gap:4,whiteSpace:"nowrap"},children:[e.jsx("span",{style:{color:s.ink},children:i}),r?e.jsxs("span",{style:{color:s.muted},children:["(",r,")"]}):null]})]})}function Be({title:t,summary:n,calls:i,percent:r,delta:o,bullets:a,defaultExpanded:d=!1}){const[c,F]=w.useState(d),p=r??o,y=ye(p),b=y?String(p):Ae,S=(y?De("up",b):"up")==="down"?h.TrendingDown:h.TrendingUp,W=Array.isArray(a)?a:[];return e.jsxs("div",{style:{borderTop:`1px solid ${s.border}`},children:[e.jsxs("button",{type:"button",onClick:()=>F(D=>!D),"aria-expanded":c,style:{border:"none",background:"transparent",padding:16,display:"flex",gap:12,alignItems:"flex-start",cursor:"pointer",width:"100%",textAlign:"left",fontFamily:z},children:[e.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:12,minWidth:0},children:[e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:12},children:[e.jsx("span",{style:{fontFamily:z,fontWeight:500,fontSize:14,color:s.black,lineHeight:"24px"},children:t}),e.jsx("span",{style:{fontFamily:z,fontSize:14,color:s.muted,lineHeight:"24px"},children:n})]}),e.jsxs("div",{style:{display:"flex",gap:16},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:4},children:[e.jsx(h.Phone,{size:12,color:s.ink,strokeWidth:1.75}),e.jsxs("span",{style:{fontFamily:z,fontSize:12,color:s.ink},children:[i," calls"]})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:4},children:[y?e.jsx(S,{size:12,color:s.ink,strokeWidth:1.75}):null,e.jsx("span",{style:{fontFamily:z,fontSize:12,color:y?s.ink:s.muted},children:b})]})]})]}),e.jsx(h.ChevronDown,{size:20,color:s.ink,strokeWidth:2,style:{flexShrink:0,transform:c?"rotate(180deg)":"none",transition:"transform 150ms ease"}})]}),c&&W.length>0&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:12,padding:"0 16px 16px"},children:W.map((D,Y)=>e.jsx(vt,{...D},Y))})]})}function Ue({label:t,value:n}){return e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"8px 8px 12px",borderBottom:`1px solid ${s.border}`,fontFamily:z,fontSize:13,lineHeight:"1.2"},children:[e.jsx("span",{style:{color:s.ink},children:t}),e.jsx("span",{style:{color:s.muted},children:n})]})}function kt({value:t=0,max:n=5}){const i=typeof t=="number"?t:parseFloat(t)||0,r=Math.floor(i),o=i%1>0&&r<n;return e.jsx("div",{style:{display:"flex",gap:4},children:Array.from({length:n}).map((a,d)=>d<r?e.jsx("span",{style:{width:10,height:10,borderRadius:"50%",background:s.black,display:"inline-block"}},d):d===r&&o?e.jsx("span",{style:{width:10,height:10,borderRadius:"50%",display:"inline-flex",alignItems:"center",justifyContent:"center"},children:e.jsx("span",{style:{width:6,height:6,borderRadius:"50%",background:s.black,display:"inline-block"}})},d):e.jsx("span",{style:{width:10,height:10,borderRadius:"50%",background:s.white,border:`1px solid ${s.border}`,display:"inline-block",boxSizing:"border-box"}},d))})}const wt=[{id:"title",label:"Title",width:220,sortable:!0,filterable:!0},{id:"date",label:"Date",width:170,sortable:!0},{id:"duration",label:"Duration",width:170,sortable:!0},{id:"lift",label:"Lift",width:120,sortable:!0},{id:"compass",label:"Compass Score",width:220,sortable:!0,render:t=>{const n=typeof t=="number"?t:parseFloat(t)||0;return e.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:12},children:[e.jsx("span",{style:{minWidth:32},children:t}),e.jsx(kt,{value:n})]})}}];function Ye({icon:t,title:n}){return e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:16,width:"100%"},children:[e.jsx("div",{style:{width:34,height:34,borderRadius:9999,background:s.iconCircle,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:e.jsx(t,{size:20,color:s.ink,strokeWidth:1.75})}),e.jsx("span",{style:{fontFamily:te,fontWeight:600,fontSize:16,color:s.ink,lineHeight:1.2},children:n})]})}function ot({agentName:t="",startDate:n="",endDate:i="",totalCalls:r="",onBack:o,className:a="",kpiBaseline:d={value:"",label:"",sub:"",trend:"up"},kpiAgentLift:c={value:"",label:"",sub:"",trend:"down"},kpiScore:F={value:"",label:"",sub:"",trend:"up"},baselineChart:p={value:"",delta:""},agentLiftChart:y={value:"",delta:""},scoreChart:b={value:"",delta:""},csatChart:v={value:"",delta:""},volumeChart:S={value:"",delta:""},guidanceItems:W=[],strengthItems:D=[],callDrivers:Y=[],callParadigms:I=[],strengthsTitle:E="",guidanceTitle:X="",callMixTitle:G="",driversTitle:O="",paradigmsTitle:J="",sessionsTitle:f="",baselineChartTitle:j="",agentLiftChartTitle:C="",scoreChartTitle:M="",csatChartTitle:K="",volumeChartTitle:_="",sessions:ie=[],sessionColumns:oe=[],initialPageSize:q=10,selectedWindow:Z="30d",onWindowChange:Q,dateRange:B,onDateRangeChange:ae,sessionsTotal:x=null,sessionsPage:m=null,sessionsPageSize:T=null,onSessionsPageChange:P,onSessionsPageSizeChange:$,onExport:A,onSessionClick:Le,onSessionsVisibleColumnsChange:le}){const re=!!(B!=null&&B.from&&(B!=null&&B.to)),H=(()=>{if(re||Z!=="8h")return null;const g=je("8h");return g?et(g.from,g.to):null})(),V=(()=>{if(re||Z==="8h")return null;const g=je(Z);return g?{from:ee(g.from),to:ee(g.to)}:null})(),de=U(p)||U(y)||U(b),Fe=U(v)||U(S);return e.jsxs("div",{className:a,style:{background:s.white,fontFamily:z,color:s.ink,width:"100%",minWidth:1192,boxSizing:"border-box",display:"flex",flexDirection:"column"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"23px 32px",minHeight:78,boxSizing:"border-box"},children:[e.jsx("button",{type:"button","aria-label":"Back",onClick:o,style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:24,height:24,background:"transparent",border:"none",cursor:"pointer",color:s.ink,padding:0,flexShrink:0},children:e.jsx(h.ArrowLeft,{size:20,strokeWidth:1.75})}),e.jsx("div",{style:{paddingLeft:16,borderLeft:`1px solid ${s.border}`,flex:1,minWidth:0,alignSelf:"stretch",display:"flex",alignItems:"center"},children:e.jsx("h1",{style:{fontFamily:te,fontSize:24,fontWeight:400,color:s.ink,margin:0,lineHeight:1,whiteSpace:"nowrap"},children:t})}),e.jsxs("button",{type:"button",onClick:()=>A==null?void 0:A(),disabled:!A,style:{display:"inline-flex",alignItems:"center",gap:8,height:32,padding:"0 16px",borderRadius:10,border:`1px solid ${s.neutralBorder}`,background:s.white,cursor:A?"pointer":"not-allowed",opacity:A?1:.5,fontFamily:z,fontSize:14,lineHeight:"24px",color:s.neutral800,flexShrink:0},children:[e.jsx(h.Download,{size:18,strokeWidth:1.75}),"Export CSV"]})]}),e.jsxs("div",{style:{padding:"0 32px 32px",display:"flex",flexDirection:"column",gap:16},children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",gap:16,paddingLeft:49},children:[e.jsxs("div",{style:{display:"flex",gap:16,alignItems:"center"},children:[e.jsxs("div",{style:{display:"inline-flex",alignItems:"center",gap:6},children:[e.jsx(h.CalendarDays,{size:14,color:s.ink,strokeWidth:1.75,style:{flexShrink:0}}),e.jsx("span",{style:{fontFamily:z,fontSize:12,color:s.ink,lineHeight:1.5},children:(H==null?void 0:H.from)??(V==null?void 0:V.from)??_e(n)}),e.jsx(h.ArrowRight,{size:12,color:s.ink,strokeWidth:1.75,style:{flexShrink:0}}),e.jsx("span",{style:{fontFamily:z,fontSize:12,color:s.ink,lineHeight:1.5},children:(H==null?void 0:H.to)??(V==null?void 0:V.to)??_e(i)})]}),e.jsxs("div",{style:{display:"inline-flex",alignItems:"center",gap:6},children:[e.jsx(h.Phone,{size:14,color:s.ink,strokeWidth:1.75,style:{flexShrink:0}}),e.jsx("span",{style:{fontFamily:z,fontSize:12,color:s.ink,lineHeight:1.5},children:r})]})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10},children:[[{id:"8h",label:"8h"},{id:"1d",label:"1d"},{id:"7d",label:"7d"},{id:"30d",label:"30d"}].map(g=>e.jsx(jt,{label:g.label,active:!re&&g.id===Z,onClick:()=>Q==null?void 0:Q(g.id)},g.id)),e.jsx(Me,{value:B,onChange:ae})]})]}),e.jsx("div",{style:{background:s.beige,border:`1px solid ${s.border}`,borderRadius:8,padding:16,display:"flex",alignItems:"center"},children:[{key:"baseline",kpi:d},{key:"agent-lift",kpi:c},{key:"score",kpi:F}].map((g,N)=>e.jsxs(w.Fragment,{children:[N>0?e.jsx(h.ArrowRight,{size:20,color:s.ink,strokeWidth:1.75,style:{flexShrink:0,margin:"0 24px"}}):null,e.jsx("div",{style:{flex:1,display:"flex",justifyContent:"center",alignItems:"center",minWidth:0},children:e.jsx(bt,{value:g.kpi.value,label:g.kpi.label,sub:g.kpi.sub,trend:g.kpi.trend,points:g.kpi.points})})]},g.key))}),de&&e.jsxs("div",{style:{display:"flex",gap:24},children:[U(p)&&e.jsx(xe,{title:j,value:p.value,delta:p.delta,children:e.jsx(ue,{yLabels:p.yLabels,xLabels:p.xLabels,points:p.points})}),U(y)&&e.jsx(xe,{title:C,value:y.value,delta:y.delta,children:e.jsx(ue,{yLabels:y.yLabels,xLabels:y.xLabels,points:y.points})}),U(b)&&e.jsx(xe,{title:M,value:b.value,delta:b.delta,children:e.jsx(ue,{yLabels:b.yLabels,xLabels:b.xLabels,points:b.points})})]}),Fe&&e.jsxs("div",{style:{display:"flex",gap:24},children:[U(v)&&e.jsx(xe,{title:K,value:v.value,delta:v.delta,children:e.jsx(ue,{yLabels:v.yLabels,xLabels:v.xLabels,points:v.points})}),U(S)&&e.jsx(xe,{title:_,value:S.value,delta:S.delta,children:e.jsx(ue,{yLabels:S.yLabels,xLabels:S.xLabels,points:S.points})})]}),e.jsxs("div",{style:{display:"flex",gap:24,marginTop:8,alignItems:"flex-start"},children:[e.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:16,minWidth:0},children:[e.jsx(Te,{icon:h.ShieldCheck,title:E,iconColor:s.railCompliance}),e.jsx("div",{style:{display:"flex",flexDirection:"column",maxHeight:480,overflowY:"auto"},children:D.map((g,N)=>e.jsx(Be,{...g},N))})]}),e.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:16,minWidth:0},children:[e.jsx(Te,{icon:h.Lightbulb,title:X,iconColor:s.railCompliance}),e.jsx("div",{style:{display:"flex",flexDirection:"column",maxHeight:480,overflowY:"auto"},children:W.map((g,N)=>e.jsx(Be,{...g},N))})]})]}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:16,marginTop:8},children:[e.jsx(Te,{icon:h.Phone,title:G,iconColor:s.railCompliance}),e.jsxs("div",{style:{display:"flex",gap:24,alignItems:"flex-start"},children:[e.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:8,minWidth:0},children:[e.jsx(Ye,{icon:h.FolderKanban,title:O}),e.jsx("div",{style:{display:"flex",flexDirection:"column",maxHeight:480,overflowY:"auto"},children:Y.map((g,N)=>e.jsx(Ue,{...g},N))})]}),e.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:8,minWidth:0},children:[e.jsx(Ye,{icon:h.Layers,title:J}),e.jsx("div",{style:{display:"flex",flexDirection:"column",maxHeight:480,overflowY:"auto"},children:I.map((g,N)=>e.jsx(Ue,{...g},N))})]})]})]}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:16,marginTop:8},children:[f&&e.jsx("span",{style:{fontFamily:te,fontWeight:600,fontSize:16,color:s.ink,lineHeight:1.2},children:f}),e.jsx(qe.DataTable2,{data:ie,columns:oe,initialPageSize:q,totalCount:x,page:m,pageSize:T,onPageChange:P,onPageSizeChange:$,onRowClick:Le,onVisibleColumnsChange:le})]})]})]})}const fe={value:"",label:"",trend:"up"},l={ink:"var(--color-text)",muted:"var(--color-text-secondary)",border:"var(--grey-absent)",borderSubtle:"var(--neutral-100)",iconCircle:"var(--surface-hover)",black:"var(--neutral-900)",white:"var(--grey-white)",green:"var(--color-green)",red:"var(--color-red-strong)",neutralBorder:"var(--neutral-250)",neutralLight:"var(--neutral-100)",beige:"var(--surface-warm-40)",neutral800:"var(--neutral-800)",textInk:"var(--text-ink)",textFaintGrey:"var(--text-faint-grey)",hoverWarm40:"var(--hover-warm-40)",shadowPopover:"var(--shadow-popover)",shadowDropdown:"var(--shadow-dropdown)",railCompliance:"var(--rail-compliance)"},ne="var(--font-sans, 'Averta', ui-sans-serif, system-ui, sans-serif)",L="var(--font-sans, 'Averta', ui-sans-serif, system-ui, sans-serif)";function at({trend:t="up",points:n,width:i=49.618,height:r=35}){const o=w.useId(),a=$e(n),d=a?a.line:nt,c=a?a.area:it,F=we(n)??t;return e.jsxs("svg",{width:i,height:r,viewBox:"0 0 52 36",fill:"none",style:{flexShrink:0,transform:!a&&F==="down"?"scaleX(-1)":void 0},children:[e.jsx("defs",{children:e.jsxs("linearGradient",{id:`spark-${o}`,x1:"9.96776",y1:"16.2053",x2:"9.96776",y2:"36.0002",gradientUnits:"userSpaceOnUse",children:[e.jsx("stop",{stopColor:l.ink}),e.jsx("stop",{offset:"1",stopColor:l.white,stopOpacity:"0.01"})]})}),e.jsx("path",{d:c,fill:`url(#spark-${o})`,fillRule:"evenodd",clipRule:"evenodd",opacity:"0.1"}),e.jsx("path",{d,stroke:l.ink,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeDasharray:!a&&F==="down"?"2 4":void 0})]})}function dt(t,n){return we(n)??(t==="down"?"down":"up")}function ct({direction:t="up",color:n=l.muted}){const i="M12.4167 0.75H17.4167M17.4167 0.75V5.75M17.4167 0.75L10.3333 7.83333L6.16667 3.66667L0.75 9.08333",r="M12.4167 9.25H17.4167M17.4167 9.25V4.25M17.4167 9.25L10.3333 2.16667L6.16667 6.33333L0.75 0.91667";return e.jsx("svg",{width:18,height:9.5,viewBox:"0 0 19 10",fill:"none",style:{flexShrink:0},children:e.jsx("path",{d:t==="up"?i:r,stroke:n,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function Ve({value:t,label:n,trend:i="up",points:r,muted:o=!1,beigeBg:a=!1,style:d={}}){const c=dt(i,r);return e.jsxs("div",{style:{background:a?l.beige:l.white,border:`1px solid ${l.border}`,borderRadius:8,padding:16,display:"flex",flexDirection:"column",gap:8,boxSizing:"border-box",...d},children:[e.jsxs("div",{style:{display:"flex",alignItems:"flex-start",justifyContent:"space-between"},children:[e.jsx(at,{trend:c,points:r}),e.jsx(ct,{direction:c})]}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8,marginTop:8},children:[e.jsx("div",{style:{fontFamily:ne,fontSize:28,fontWeight:500,lineHeight:"1.2",color:o?l.muted:l.ink,letterSpacing:"-0.01em"},children:t}),e.jsx("div",{style:{fontFamily:L,fontSize:13,color:l.ink,lineHeight:"1.2"},children:n})]})]})}function We({value:t,label:n,trend:i="up",points:r,withDivider:o=!1}){const a=dt(i,r);return e.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:8,paddingLeft:o?24:0,borderLeft:o?`1px solid ${l.border}`:"none",minWidth:0},children:[e.jsxs("div",{style:{display:"flex",alignItems:"flex-start",justifyContent:"space-between"},children:[e.jsx(at,{trend:a,points:r}),e.jsx(ct,{direction:a})]}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8,marginTop:8},children:[e.jsx("div",{style:{fontFamily:ne,fontSize:28,fontWeight:500,lineHeight:"1.2",color:l.muted,letterSpacing:"-0.01em"},children:t}),e.jsx("div",{style:{fontFamily:L,fontSize:13,color:l.ink,lineHeight:"1.2"},children:n})]})]})}function St({icon:t,children:n,trailing:i}){return e.jsxs("button",{type:"button",style:{display:"inline-flex",alignItems:"center",gap:8,height:32,padding:"0 16px",borderRadius:10,border:`1px solid ${l.neutralBorder}`,background:l.white,cursor:"pointer",fontFamily:L,fontSize:14,color:l.neutral800,whiteSpace:"nowrap"},children:[t&&e.jsx(t,{size:18,strokeWidth:1.75}),n,i&&e.jsx(i,{size:16,strokeWidth:2})]})}const Dt=["January","February","March","April","May","June","July","August","September","October","November","December"],Lt=["Su","Mo","Tu","We","Th","Fr","Sa"];function me(t){const n=new Date(t);return n.setHours(0,0,0,0),n}function Ft(t,n){const r=new Date(t,n,1).getDay(),o=new Date(t,n,1-r);return Array.from({length:42},(a,d)=>{const c=new Date(o);return c.setDate(o.getDate()+d),c})}function zt({value:t,onApply:n,onClose:i,anchorRef:r}){const o=w.useRef(null),[a,d]=w.useState(t!=null&&t.from?me(t.from):null),[c,F]=w.useState(t!=null&&t.to?me(t.to):null),p=a||new Date,[y,b]=w.useState(p.getFullYear()),[v,S]=w.useState(p.getMonth()),[W,D]=w.useState({top:0,left:0});w.useLayoutEffect(()=>{const f=()=>{if(!(r!=null&&r.current))return;const j=r.current.getBoundingClientRect(),C=320;D({top:j.bottom+6,left:Math.max(8,j.right-C)})};return f(),window.addEventListener("scroll",f,!0),window.addEventListener("resize",f),()=>{window.removeEventListener("scroll",f,!0),window.removeEventListener("resize",f)}},[r]),w.useEffect(()=>{const f=C=>{var M,K;(M=o.current)!=null&&M.contains(C.target)||(K=r==null?void 0:r.current)!=null&&K.contains(C.target)||i()},j=C=>{C.key==="Escape"&&i()};return document.addEventListener("mousedown",f),document.addEventListener("keydown",j),()=>{document.removeEventListener("mousedown",f),document.removeEventListener("keydown",j)}},[i,r]);const Y=Ft(y,v),I=me(new Date),E=f=>{const j=me(f);j>I||(!a||a&&c?(d(j),F(null)):j<a?d(j):F(j))},X=()=>{v===0?(S(11),b(y-1)):S(v-1)},G=()=>{v===11?(S(0),b(y+1)):S(v+1)},O=f=>a&&c&&f>=a&&f<=c,J=f=>a&&f.getTime()===a.getTime()||c&&f.getTime()===c.getTime();return ht.createPortal(e.jsxs("div",{ref:o,style:{position:"fixed",top:W.top,left:W.left,width:320,background:l.white,border:`1px solid ${l.borderSubtle}`,borderRadius:12,boxShadow:l.shadowPopover,padding:16,zIndex:9999,fontFamily:L},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:12},children:[e.jsx("button",{type:"button",onClick:X,style:Xe,"aria-label":"Previous month",children:e.jsx(h.ChevronLeft,{size:18,strokeWidth:1.75})}),e.jsxs("div",{style:{fontSize:14,fontWeight:600,color:l.ink},children:[Dt[v]," ",y]}),e.jsx("button",{type:"button",onClick:G,style:Xe,"aria-label":"Next month",children:e.jsx(h.ChevronRight,{size:18,strokeWidth:1.75})})]}),e.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(7, 1fr)",gap:2,marginBottom:4},children:Lt.map(f=>e.jsx("div",{style:{textAlign:"center",fontSize:12,color:l.muted,padding:"4px 0"},children:f},f))}),e.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(7, 1fr)",gap:2},children:Y.map(f=>{const j=f.getMonth()===v,C=O(f),M=J(f),K=f.getTime()===I.getTime(),_=f>I;return e.jsx("button",{type:"button",onClick:()=>E(f),disabled:_,"aria-disabled":_,style:{height:36,border:"none",borderRadius:8,background:M?l.black:C?l.hoverWarm40:"transparent",color:M?l.white:_?l.textFaintGrey:j?l.ink:l.muted,fontFamily:L,fontSize:13,fontWeight:K?500:400,cursor:_?"not-allowed":"pointer",opacity:_?.6:1},children:f.getDate()},f.toISOString())})}),e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginTop:12,paddingTop:12,borderTop:`1px solid ${l.borderSubtle}`},children:[e.jsx("button",{type:"button",onClick:()=>{d(null),F(null)},style:{background:"transparent",border:"none",padding:0,cursor:"pointer",fontSize:14,fontWeight:500,color:l.ink},children:"Clear"}),e.jsx("button",{type:"button",disabled:!a||!c,onClick:()=>{n({from:a,to:c}),i()},style:{background:!a||!c?l.neutralBorder:l.black,color:l.white,border:"none",borderRadius:10,height:30,padding:"0 16px",fontFamily:L,fontSize:14,fontWeight:600,cursor:!a||!c?"not-allowed":"pointer"},children:"Apply"})]})]}),document.body)}const Xe={display:"inline-flex",alignItems:"center",justifyContent:"center",width:28,height:28,border:"none",background:"transparent",borderRadius:6,cursor:"pointer",color:l.ink};function Me({value:t,onChange:n}){const[i,r]=w.useState(!1),o=w.useRef(null),a=!!(t!=null&&t.from&&(t!=null&&t.to));return e.jsxs(e.Fragment,{children:[e.jsxs("button",{ref:o,type:"button",onClick:()=>r(d=>!d),style:{display:"inline-flex",alignItems:"center",gap:8,height:32,padding:"0 16px",borderRadius:10,border:a?"none":`1px solid ${l.neutralBorder}`,background:a?l.black:l.white,cursor:"pointer",fontFamily:L,fontSize:14,color:a?l.white:l.neutral800,fontWeight:a?600:400,whiteSpace:"nowrap"},children:[e.jsx(h.CalendarDays,{size:18,strokeWidth:1.75}),"Date Range"]}),i&&e.jsx(zt,{value:t,anchorRef:o,onClose:()=>r(!1),onApply:d=>n==null?void 0:n(d)})]})}function Tt({label:t,active:n=!1,onClick:i}){return e.jsx("button",{type:"button",onClick:i,style:{height:32,minWidth:31,padding:"0 12px",borderRadius:10,border:n?"none":`1px solid ${l.borderSubtle}`,background:n?l.black:l.white,color:n?l.white:l.black,fontFamily:L,fontSize:14,cursor:"pointer"},children:t})}const Wt=[{id:"8h",label:"8h"},{id:"1d",label:"1d"},{id:"7d",label:"7d"},{id:"30d",label:"30d"}];function Ct({value:t=0,max:n=5}){const i=typeof t=="number"?t:parseFloat(t)||0,r=Math.floor(i),o=i%1>0&&r<n;return e.jsx("div",{style:{display:"flex",gap:4},children:Array.from({length:n}).map((a,d)=>d<r?e.jsx("span",{style:{width:10,height:10,borderRadius:"50%",background:l.black,display:"inline-block"}},d):d===r&&o?e.jsx("span",{style:{width:10,height:10,borderRadius:"50%",display:"inline-flex",alignItems:"center",justifyContent:"center"},children:e.jsx("span",{style:{width:6,height:6,borderRadius:"50%",background:l.black,display:"inline-block"}})},d):e.jsx("span",{style:{width:10,height:10,borderRadius:"50%",background:l.white,border:`1px solid ${l.border}`,display:"inline-block",boxSizing:"border-box"}},d))})}const $t=[{id:"agent",label:"Agent",width:180,sortable:!0,filterable:!0},{id:"supervisor",label:"Supervisor",width:170,sortable:!0,filterable:!0},{id:"calls",label:"Calls",width:100,sortable:!0},{id:"baseline",label:"Baseline",width:110,sortable:!0},{id:"lift",label:"Lift",width:100,sortable:!0},{id:"score",label:"Score",width:100,sortable:!0,filterable:!0,filterType:"number"},{id:"compass",label:"Compass Score",width:200,sortable:!0,filterable:!0,filterType:"number",render:t=>e.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:12},children:[e.jsx("span",{style:{minWidth:32},children:t}),e.jsx(Ct,{value:typeof t=="number"?t:0})]})},{id:"totalDuration",label:"Total Duration",width:150,sortable:!0,filterable:!0,filterType:"duration",filterShowPresets:!1},{id:"avgDuration",label:"Average Duration",width:170,sortable:!0,filterable:!0,filterType:"duration",filterShowPresets:!1}];function ge({icon:t,title:n,trailing:i,iconColor:r=l.ink,bordered:o=!1}){return e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,width:"100%",paddingBottom:o?12:0,borderBottom:o?`1px solid ${l.border}`:"none"},children:[e.jsx("div",{style:{width:24,height:24,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:e.jsx(t,{size:22,strokeWidth:1.75,style:{color:r}})}),e.jsx("div",{style:{flex:1,fontFamily:ne,fontWeight:600,fontSize:16,color:l.ink,lineHeight:"1.2",textTransform:"uppercase",letterSpacing:"0.02em"},children:n}),i&&e.jsx("div",{style:{fontFamily:L,fontSize:14,color:l.ink},children:i})]})}function Ge({icon:t,title:n}){return e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:16,width:"100%"},children:[e.jsx("div",{style:{width:34,height:34,borderRadius:9999,background:l.iconCircle,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:e.jsx(t,{size:20,color:l.ink,strokeWidth:1.75})}),e.jsx("span",{style:{fontFamily:ne,fontWeight:600,fontSize:16,color:l.ink,lineHeight:"24px"},children:n})]})}function Ke({title:t,summary:n,calls:i,percent:r,bullets:o,defaultExpanded:a=!1}){const[d,c]=w.useState(a),F=Array.isArray(o)?o:[];return e.jsxs("div",{style:{borderTop:`1px solid ${l.border}`},children:[e.jsxs("button",{type:"button",onClick:()=>c(p=>!p),"aria-expanded":d,style:{border:"none",background:"transparent",padding:16,display:"flex",gap:12,alignItems:"flex-start",cursor:"pointer",width:"100%",textAlign:"left",fontFamily:L},children:[e.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:12,minWidth:0},children:[e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:12},children:[e.jsx("div",{style:{fontFamily:ne,fontWeight:600,fontSize:14,color:l.black,lineHeight:"24px"},children:t}),e.jsx("div",{style:{fontFamily:L,fontSize:14,color:l.muted,lineHeight:"24px"},children:n})]}),e.jsxs("div",{style:{display:"flex",gap:16},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:4},children:[e.jsx(h.Phone,{size:14,color:l.ink,strokeWidth:1.75}),e.jsx("span",{style:{fontFamily:L,fontSize:12,color:l.ink,lineHeight:1.5},children:i})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:4},children:[e.jsx(h.TrendingUp,{size:14,color:l.ink,strokeWidth:1.75}),e.jsx("span",{style:{fontFamily:L,fontSize:12,color:l.ink,lineHeight:1.5},children:r})]})]})]}),e.jsx(h.ChevronDown,{size:20,color:l.ink,strokeWidth:2,style:{flexShrink:0,transform:d?"rotate(180deg)":"none",transition:"transform 150ms ease"}})]}),d&&F.length>0&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:12,padding:"0 16px 16px"},children:F.map((p,y)=>e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",fontFamily:L,fontSize:14,color:l.ink,lineHeight:"24px",gap:16},children:[p.href?e.jsx("a",{href:p.href,target:"_blank",rel:"noopener noreferrer",style:{color:l.ink,textDecoration:"underline",textUnderlineOffset:2,textDecorationColor:l.border,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:p.text}):e.jsx("span",{style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:p.text}),e.jsxs("span",{style:{display:"inline-flex",gap:4,whiteSpace:"nowrap"},children:[e.jsx("span",{style:{color:l.ink},children:p.citation}),e.jsxs("span",{style:{color:l.muted},children:["(",p.date,")"]})]})]},y))})]})}function be({label:t,value:n}){return e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"12px 0",borderBottom:`1px solid ${l.border}`,fontFamily:L,fontSize:13,lineHeight:"24px"},children:[e.jsx("span",{style:{color:l.ink},children:t}),e.jsx("span",{style:{color:l.muted},children:n})]})}function pe({message:t=""}){return t?e.jsx("div",{style:{padding:"16px 0",fontFamily:L,fontSize:13,color:l.muted,lineHeight:1.5},children:t}):null}function At({className:t="",onAgentClick:n,title:i="",subtitle:r="",dateRangeLabel:o="",viewByOptions:a=[],initialViewBy:d="",onViewByChange:c,aggregatedByLabel:F="",volumeStat:p=fe,compassStat:y=fe,baselineSubStat:b=fe,agentLiftSubStat:v=fe,scoreSubStat:S=fe,agentRows:W=[],agentColumns:D=[],initialPageSize:Y=10,guidanceItems:I=[],strengthItems:E=[],callDrivers:X=[],callParadigms:G=[],topSignalsLeft:O=[],topSignalsRight:J=[],topSignalsTrailing:f="",strengthsTitle:j="",guidanceTitle:C="",callMixTitle:M="",driversTitle:K="",paradigmsTitle:_="",topSignalsTitle:ie="",emptyStrengthsMessage:oe="",emptyGuidanceMessage:q="",emptyDriversMessage:Z="",emptyParadigmsMessage:Q="",emptyTopSignalsMessage:B="",rangeOptions:ae=Wt,selectedWindow:x="30d",onWindowChange:m,dateRangePicker:T,dateRange:P,onDateRangeChange:$,onExport:A,onVisibleColumnsChange:Le}){var Ne,Re;const[le,re]=w.useState(null),[H,V]=w.useState(!1),[de,Fe]=w.useState(d),[g,N]=w.useState(null),R=P!==void 0?P:g,ze=!!(R!=null&&R.from&&(R!=null&&R.to)),ut=u=>{N(u),$==null||$(u)},xt=u=>{N(null),$==null||$(null),m==null||m(u)},Pe=w.useRef(null),He=w.useRef(null);w.useEffect(()=>{if(!H)return;const u=k=>{var ce,Ee;(ce=He.current)!=null&&ce.contains(k.target)||(Ee=Pe.current)!=null&&Ee.contains(k.target)||V(!1)};return document.addEventListener("mousedown",u),()=>document.removeEventListener("mousedown",u)},[H]);const ft=((Ne=a.find(u=>u.id===de))==null?void 0:Ne.label)||(((Re=a[0])==null?void 0:Re.label)??""),pt=u=>{if(n){n(u);return}re(u)};return e.jsxs(e.Fragment,{children:[le&&(()=>{let u=null,k=null;if(ze)u=R.from,k=R.to;else{const ce=ve[x];ce&&(k=new Date,u=new Date(k.getTime()-ce))}return e.jsx(ot,{className:t,agentName:le.agent,startDate:u||"",endDate:k||"",totalCalls:`${le.calls} Calls`,onBack:()=>re(null),selectedWindow:x,dateRange:R})})(),e.jsxs("div",{className:t,style:{background:l.white,fontFamily:L,color:l.ink,width:"100%",minWidth:1192,boxSizing:"border-box",padding:"12px 32px 32px",flexDirection:"column",gap:24,display:le?"none":"flex"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:8,paddingTop:12},children:[e.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:4},children:[e.jsx("h1",{style:{fontFamily:ne,fontSize:24,fontWeight:500,color:l.ink,margin:0,lineHeight:"1.2",letterSpacing:"-0.01em"},children:i}),e.jsx("p",{style:{fontFamily:L,fontSize:14,color:"var(--neutral-950)",margin:0,lineHeight:"1.4"},children:r})]}),e.jsxs("button",{type:"button",onClick:()=>A==null?void 0:A(),disabled:!A,style:{display:"inline-flex",alignItems:"center",gap:8,height:32,padding:"0 16px",borderRadius:10,border:`1px solid ${l.neutralBorder}`,background:l.white,cursor:A?"pointer":"not-allowed",opacity:A?1:.5,fontFamily:L,fontSize:14,color:l.neutral800},children:[e.jsx(h.Download,{size:18,strokeWidth:1.75}),"Export CSV"]})]}),e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[e.jsxs("div",{style:{position:"relative"},children:[e.jsxs("button",{type:"button",ref:Pe,onClick:()=>V(u=>!u),"aria-haspopup":"listbox","aria-expanded":H,style:{display:"inline-flex",alignItems:"center",gap:8,height:32,padding:"0 16px",borderRadius:10,border:`1px solid ${l.neutralBorder}`,background:l.white,cursor:"pointer",fontFamily:L,fontSize:14,lineHeight:"24px",color:l.neutral800,whiteSpace:"nowrap"},children:[ft,e.jsx(h.ChevronDown,{size:20,strokeWidth:1.75,style:{transform:H?"rotate(180deg)":"none",transition:"transform 120ms ease"}})]}),H&&e.jsxs("div",{ref:He,role:"listbox",style:{position:"absolute",top:36,left:0,zIndex:20,background:l.white,border:`1px solid ${l.border}`,borderRadius:4,boxShadow:l.shadowDropdown,display:"flex",flexDirection:"column",minWidth:144,fontFamily:L},children:[F&&e.jsx("div",{style:{padding:12,fontFamily:ne,fontWeight:600,fontSize:13,color:l.ink,lineHeight:1.2},children:F}),a.map(u=>{const k=de===u.id;return e.jsxs("button",{type:"button",role:"option","aria-selected":k,onClick:()=>{u.id!==de&&(Fe(u.id),c==null||c(u.id)),V(!1)},style:{display:"flex",alignItems:"center",gap:8,padding:k?12:"12px 12px 12px 40px",borderTop:`1px solid ${l.border}`,borderLeft:"none",borderRight:"none",borderBottom:"none",background:"transparent",cursor:"pointer",textAlign:"left",fontFamily:L,fontSize:13,lineHeight:1.2,color:l.ink,width:"100%"},children:[k&&e.jsx(h.Check,{size:20,color:l.ink,strokeWidth:1.75,style:{flexShrink:0}}),e.jsx("span",{children:u.label})]},u.id)})]})]}),e.jsxs("div",{style:{display:"flex",gap:10,alignItems:"center"},children:[(()=>{const k=(ze?`${ee(R.from)} – ${ee(R.to)}`:"")||tt(x)||o;return k?e.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:6,fontFamily:L,fontSize:13,color:l.ink},children:[e.jsx(h.CalendarDays,{size:16,strokeWidth:1.75,color:l.muted}),k]}):null})(),ae.map(u=>e.jsx(Tt,{label:u.label,active:!ze&&u.id===x,onClick:()=>xt(u.id)},u.id)),T?e.jsx(w.Suspense,{fallback:e.jsx(St,{icon:h.CalendarDays,children:"Date Range"}),children:T}):e.jsx(Me,{value:R,onChange:ut})]})]}),e.jsxs("div",{style:{display:"flex",gap:24},children:[e.jsx(Ve,{value:p.value,label:p.label,trend:p.trend,points:p.points,style:{width:264,flexShrink:0}}),e.jsx(Ve,{value:y.value,label:y.label,trend:y.trend,points:y.points,style:{width:264,flexShrink:0}}),e.jsxs("div",{style:{flex:1,background:l.beige,border:`1px solid ${l.border}`,borderRadius:8,padding:16,display:"flex",gap:24,alignItems:"stretch",boxSizing:"border-box"},children:[e.jsx(We,{value:b.value,label:b.label,trend:b.trend,points:b.points}),e.jsx(We,{value:v.value,label:v.label,trend:v.trend,points:v.points,withDivider:!0}),e.jsx(We,{value:S.value,label:S.label,trend:S.trend,points:S.points,withDivider:!0})]})]}),e.jsx(qe.DataTable2,{data:W,columns:D,initialPageSize:Y,onRowClick:pt,onVisibleColumnsChange:Le}),e.jsxs("div",{style:{display:"flex",gap:24,alignItems:"flex-start"},children:[e.jsxs("div",{style:{flex:1,minWidth:0,display:"flex",flexDirection:"column",gap:16},children:[e.jsx(ge,{icon:h.ShieldCheck,title:j,iconColor:"var(--rail-compliance)"}),e.jsx("div",{style:{display:"flex",flexDirection:"column",borderBottom:`1px solid ${l.border}`,maxHeight:480,overflowY:"auto"},children:E.length===0?e.jsx(pe,{message:oe}):E.map((u,k)=>e.jsx(Ke,{...u},k))})]}),e.jsxs("div",{style:{flex:1,minWidth:0,display:"flex",flexDirection:"column",gap:16},children:[e.jsx(ge,{icon:h.Lightbulb,title:C,iconColor:"var(--rail-compliance)"}),e.jsx("div",{style:{display:"flex",flexDirection:"column",borderBottom:`1px solid ${l.border}`,maxHeight:480,overflowY:"auto"},children:I.length===0?e.jsx(pe,{message:q}):I.map((u,k)=>e.jsx(Ke,{...u},k))})]})]}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:16},children:[e.jsx(ge,{icon:h.Phone,title:M,iconColor:"var(--rail-compliance)"}),e.jsxs("div",{style:{display:"flex",gap:24,alignItems:"flex-start"},children:[e.jsxs("div",{style:{flex:1,minWidth:0,display:"flex",flexDirection:"column",gap:8},children:[e.jsx(Ge,{icon:h.FolderKanban,title:K}),e.jsx("div",{style:{display:"flex",flexDirection:"column",maxHeight:480,overflowY:"auto"},children:X.length===0?e.jsx(pe,{message:Z}):X.map((u,k)=>e.jsx(be,{...u},k))})]}),e.jsxs("div",{style:{flex:1,minWidth:0,display:"flex",flexDirection:"column",gap:8},children:[e.jsx(Ge,{icon:h.Layers,title:_}),e.jsx("div",{style:{display:"flex",flexDirection:"column",maxHeight:480,overflowY:"auto"},children:G.length===0?e.jsx(pe,{message:Q}):G.map((u,k)=>e.jsx(be,{...u},k))})]})]})]}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:16},children:[e.jsx(ge,{icon:h.Signal,title:ie,iconColor:"var(--rail-compliance)",trailing:f,bordered:!0}),O.length===0&&J.length===0?e.jsx(pe,{message:B}):e.jsxs("div",{style:{display:"flex",gap:24},children:[e.jsx("div",{style:{flex:1,display:"flex",flexDirection:"column"},children:O.map((u,k)=>e.jsx(be,{...u},k))}),e.jsx("div",{style:{flex:1,display:"flex",flexDirection:"column"},children:J.map((u,k)=>e.jsx(be,{...u},k))})]})]})]})]})}exports.DEFAULT_AGENT_COLUMNS=$t;exports.DEFAULT_SESSION_COLUMNS=wt;exports.DateRangeButton=Me;exports.METRIC_PLACEHOLDER=Ae;exports.PerformanceDetailsPage=ot;exports.PerformancePanel=At;exports.RANGE_TO_MS=ve;exports.buildSparkPaths=$e;exports.computeWindowLabel=tt;exports.formatEightHourRangeEndpoints=et;exports.formatEightHourWindowLabel=Qe;exports.formatLocalDate=ee;exports.formatMetricDisplay=Ie;exports.getPresetWindowDates=je;exports.hasChartData=U;exports.hasMeaningfulMetric=ye;exports.isNullishMetric=Se;exports.normalizeSparkPoints=ke;exports.resolveKpiTrend=rt;exports.resolveTrend=De;exports.trendFromPoints=we;exports.trendFromSignedValue=lt;
2
2
  //# sourceMappingURL=PerformancePanel.cjs.js.map