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
@@ -0,0 +1,2 @@
1
+ "use strict";const e=require("react/jsx-runtime"),h=require("react"),v=require("lucide-react"),n={white:"#FFFFFF",black:"#0B0B0B",borderSubtle:"#E6E6E6",border:"#D9D9D9",searchBg:"#D8D8D8",rowSelected:"#F2F2F0",textMuted:"#989898",textMid:"#676767",textDark:"#323232",applyBg:"#2E3236",scrollbar:"#D5D9E2"},s="var(--font-sans, 'Averta', ui-sans-serif, system-ui, sans-serif)";function H({checked:l,mutedFill:i=!1}){return e.jsx("span",{style:{width:20,height:20,borderRadius:4,background:l?n.black:i?n.rowSelected:n.white,border:`1px solid ${l?n.black:n.textDark}`,display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0,boxSizing:"border-box"},children:l&&e.jsx(v.Check,{size:14,color:n.white,strokeWidth:3})})}function w({supervisor:l,checked:i,muted:r=!1,onToggle:x}){return e.jsxs("button",{type:"button",onClick:x,style:{display:"flex",alignItems:"center",gap:6,height:32,padding:"0 16px 0 8px",borderRadius:10,border:"none",background:i?n.rowSelected:"transparent",cursor:"pointer",width:"100%",textAlign:"left",fontFamily:s,flexShrink:0},children:[e.jsxs("span",{style:{display:"flex",alignItems:"center",gap:12,flex:1,minWidth:0},children:[e.jsx(H,{checked:i,mutedFill:r}),e.jsx("span",{style:{fontSize:14,lineHeight:"20px",fontWeight:400,color:!i&&r?n.textMid:n.black,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:l.name})]}),e.jsxs("span",{style:{fontSize:12,fontWeight:500,lineHeight:1,color:!i&&r?n.textMid:n.black,whiteSpace:"nowrap",padding:"4px 8px"},children:[l.agentCount," agents"]})]})}function W({left:l,right:i}){return e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",height:14,fontSize:12,lineHeight:1.5,fontFamily:s,flexShrink:0},children:[l,i]})}function c({children:l,onClick:i,faded:r=!1}){return e.jsx("button",{type:"button",onClick:i,style:{background:"transparent",border:"none",padding:0,cursor:i?"pointer":"default",fontFamily:s,fontSize:12,fontWeight:500,color:r?n.textMuted:n.textDark,whiteSpace:"nowrap"},children:l})}function N({supervisors:l=[],value:i=[],onApply:r,onClose:x,totalLabel:B,className:I="",style:E}){const F=h.useRef(i),[g,f]=h.useState(i),[d,D]=h.useState("");h.useEffect(()=>{F.current=i,f(i)},[i]);const y=h.useMemo(()=>new Set(g),[g]),o=d.trim().length>0,a=h.useMemo(()=>{const t=d.trim().toLowerCase();return t?l.filter(p=>p.name.toLowerCase().includes(t)):l},[l,d]),C=l.length>0&&g.length===l.length,R=g.length===0,q=!C&&!R,j=t=>{f(p=>p.includes(t)?p.filter(T=>T!==t):[...p,t])},S=()=>f(l.map(t=>t.id)),M=()=>f([]),$=()=>f(F.current),A=()=>D(""),L=()=>{r==null||r(g),x==null||x()},O=o?`${a.length} Result${a.length===1?"":"s"}`:B||`${l.length} Supervisors`;let u;o?u=a.length>0?e.jsx(c,{onClick:S,children:"Select all"}):null:C?u=e.jsx(c,{onClick:M,children:"Deselect all"}):R?u=e.jsx(c,{onClick:S,children:"Select all"}):u=e.jsxs("span",{style:{display:"inline-flex",gap:12},children:[e.jsx(c,{onClick:S,children:"Select all"}),e.jsx(c,{onClick:M,children:"Deselect all"})]});const b=!o&&q,z=o?a:b?[]:l,m=b?l.filter(t=>y.has(t.id)):[],k=b?l.filter(t=>!y.has(t.id)):[];return e.jsxs("div",{className:I,style:{width:262,background:n.white,border:`1px solid ${n.borderSubtle}`,borderRadius:10,padding:12,boxSizing:"border-box",display:"flex",flexDirection:"column",gap:6,fontFamily:s,boxShadow:"0 8px 24px rgba(11, 11, 11, 0.08)",...E},children:[e.jsx("div",{style:{background:n.searchBg,height:32,borderRadius:10,padding:1,display:"flex",alignItems:"center"},children:e.jsxs("div",{style:{background:n.white,flex:1,height:30,borderRadius:10,display:"flex",alignItems:"center",gap:8,padding:"0 8px"},children:[e.jsx(v.Search,{size:16,color:n.textMuted,strokeWidth:2}),e.jsx("input",{type:"text",value:d,onChange:t=>D(t.target.value),placeholder:"Search supervisors...",style:{flex:1,border:"none",outline:"none",background:"transparent",fontFamily:s,fontSize:14,color:n.black,minWidth:0}})]})}),e.jsx(W,{left:e.jsx("span",{style:{color:n.textMuted,fontWeight:400},children:O}),right:u}),z.length>0&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:6},children:z.map(t=>e.jsx(w,{supervisor:t,checked:y.has(t.id),muted:!1,onToggle:()=>j(t.id)},t.id))}),b&&e.jsxs(e.Fragment,{children:[m.length>0&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:6},children:m.map(t=>e.jsx(w,{supervisor:t,checked:!0,onToggle:()=>j(t.id)},t.id))}),m.length>0&&k.length>0&&e.jsx("div",{style:{height:1,background:n.border,margin:"4px 0"}}),k.length>0&&e.jsxs(e.Fragment,{children:[e.jsx(W,{left:e.jsx("span",{style:{color:n.textMuted,fontWeight:400},children:"Others"}),right:null}),e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:6},children:k.map(t=>e.jsx(w,{supervisor:t,checked:!1,muted:!0,onToggle:()=>j(t.id)},t.id))})]})]}),o&&a.length===0&&e.jsxs("div",{style:{padding:"16px 8px",textAlign:"center",fontSize:14,color:n.textMid,fontFamily:s},children:["No results for “",d,"”"]}),o&&a.length>0&&l.length>a.length&&e.jsxs("div",{style:{padding:"10px 8px",textAlign:"center",fontSize:14,color:n.textMid,fontFamily:s},children:["No other results for “",d,"”"]}),e.jsx("div",{style:{height:1,background:n.border,margin:"2px 0"}}),e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",height:30},children:[o?e.jsx(c,{onClick:A,children:"Clear search"}):e.jsx(c,{onClick:$,children:"Reset"}),e.jsx("button",{type:"button",onClick:L,style:{background:n.applyBg,color:n.white,border:"none",borderRadius:10,height:28,padding:"0 14px",fontFamily:s,fontSize:14,fontWeight:600,cursor:"pointer"},children:"Apply"})]})]})}exports.SupervisorSelect=N;
2
+ //# sourceMappingURL=SupervisorSelect.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SupervisorSelect.cjs.js","sources":["../src/components/performance/SupervisorSelect.jsx"],"sourcesContent":["\"use client\";\n\nimport React from \"react\";\nimport { Search, Check } from \"lucide-react\";\n\nconst C = {\n white: \"#FFFFFF\",\n black: \"#0B0B0B\",\n borderSubtle: \"#E6E6E6\",\n border: \"#D9D9D9\",\n searchBg: \"#D8D8D8\",\n rowSelected: \"#F2F2F0\",\n textMuted: \"#989898\",\n textMid: \"#676767\",\n textDark: \"#323232\",\n applyBg: \"#2E3236\",\n scrollbar: \"#D5D9E2\",\n};\n\nconst FONT = \"var(--font-sans, 'Averta', ui-sans-serif, system-ui, sans-serif)\";\n\nfunction Checkbox({ checked, mutedFill = false }) {\n return (\n <span\n style={{\n width: 20,\n height: 20,\n borderRadius: 4,\n background: checked ? C.black : mutedFill ? C.rowSelected : C.white,\n border: `1px solid ${checked ? C.black : C.textDark}`,\n display: \"inline-flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n flexShrink: 0,\n boxSizing: \"border-box\",\n }}\n >\n {checked && <Check size={14} color={C.white} strokeWidth={3} />}\n </span>\n );\n}\n\nfunction Row({ supervisor, checked, muted = false, onToggle }) {\n return (\n <button\n type=\"button\"\n onClick={onToggle}\n style={{\n display: \"flex\",\n alignItems: \"center\",\n gap: 6,\n height: 32,\n padding: \"0 16px 0 8px\",\n borderRadius: 10,\n border: \"none\",\n background: checked ? C.rowSelected : \"transparent\",\n cursor: \"pointer\",\n width: \"100%\",\n textAlign: \"left\",\n fontFamily: FONT,\n flexShrink: 0,\n }}\n >\n <span style={{ display: \"flex\", alignItems: \"center\", gap: 12, flex: 1, minWidth: 0 }}>\n <Checkbox checked={checked} mutedFill={muted} />\n <span\n style={{\n fontSize: 14,\n lineHeight: \"20px\",\n fontWeight: 400,\n color: !checked && muted ? C.textMid : C.black,\n whiteSpace: \"nowrap\",\n overflow: \"hidden\",\n textOverflow: \"ellipsis\",\n }}\n >\n {supervisor.name}\n </span>\n </span>\n <span\n style={{\n fontSize: 12,\n fontWeight: 500,\n lineHeight: 1,\n color: !checked && muted ? C.textMid : C.black,\n whiteSpace: \"nowrap\",\n padding: \"4px 8px\",\n }}\n >\n {supervisor.agentCount} agents\n </span>\n </button>\n );\n}\n\nfunction MetaRow({ left, right }) {\n return (\n <div\n style={{\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"space-between\",\n height: 14,\n fontSize: 12,\n lineHeight: 1.5,\n fontFamily: FONT,\n flexShrink: 0,\n }}\n >\n {left}\n {right}\n </div>\n );\n}\n\nfunction ActionLink({ children, onClick, faded = false }) {\n return (\n <button\n type=\"button\"\n onClick={onClick}\n style={{\n background: \"transparent\",\n border: \"none\",\n padding: 0,\n cursor: onClick ? \"pointer\" : \"default\",\n fontFamily: FONT,\n fontSize: 12,\n fontWeight: 500,\n color: faded ? C.textMuted : C.textDark,\n whiteSpace: \"nowrap\",\n }}\n >\n {children}\n </button>\n );\n}\n\nexport default function SupervisorSelect({\n supervisors = [],\n value = [],\n onApply,\n onClose,\n totalLabel,\n className = \"\",\n style,\n}) {\n const initialValueRef = React.useRef(value);\n const [staged, setStaged] = React.useState(value);\n const [query, setQuery] = React.useState(\"\");\n\n React.useEffect(() => {\n initialValueRef.current = value;\n setStaged(value);\n }, [value]);\n\n const stagedSet = React.useMemo(() => new Set(staged), [staged]);\n\n const isSearching = query.trim().length > 0;\n\n const filtered = React.useMemo(() => {\n const q = query.trim().toLowerCase();\n if (!q) return supervisors;\n return supervisors.filter((s) => s.name.toLowerCase().includes(q));\n }, [supervisors, query]);\n\n const allSelected = supervisors.length > 0 && staged.length === supervisors.length;\n const noneSelected = staged.length === 0;\n const isPartial = !allSelected && !noneSelected;\n\n const toggle = (id) => {\n setStaged((prev) => (prev.includes(id) ? prev.filter((x) => x !== id) : [...prev, id]));\n };\n const selectAll = () => setStaged(supervisors.map((s) => s.id));\n const deselectAll = () => setStaged([]);\n const reset = () => setStaged(initialValueRef.current);\n const clearSearch = () => setQuery(\"\");\n const apply = () => {\n onApply?.(staged);\n onClose?.();\n };\n\n const headerCount = isSearching\n ? `${filtered.length} Result${filtered.length === 1 ? \"\" : \"s\"}`\n : totalLabel || `${supervisors.length} Supervisors`;\n\n let headerRight;\n if (isSearching) {\n headerRight = filtered.length > 0 ? <ActionLink onClick={selectAll}>Select all</ActionLink> : null;\n } else if (allSelected) {\n headerRight = <ActionLink onClick={deselectAll}>Deselect all</ActionLink>;\n } else if (noneSelected) {\n headerRight = <ActionLink onClick={selectAll}>Select all</ActionLink>;\n } else {\n headerRight = (\n <span style={{ display: \"inline-flex\", gap: 12 }}>\n <ActionLink onClick={selectAll}>Select all</ActionLink>\n <ActionLink onClick={deselectAll}>Deselect all</ActionLink>\n </span>\n );\n }\n\n // Decide which sections to render\n const renderPartial = !isSearching && isPartial;\n const flatList = isSearching ? filtered : renderPartial ? [] : supervisors;\n const partialSelected = renderPartial ? supervisors.filter((s) => stagedSet.has(s.id)) : [];\n const partialOthers = renderPartial ? supervisors.filter((s) => !stagedSet.has(s.id)) : [];\n\n return (\n <div\n className={className}\n style={{\n width: 262,\n background: C.white,\n border: `1px solid ${C.borderSubtle}`,\n borderRadius: 10,\n padding: 12,\n boxSizing: \"border-box\",\n display: \"flex\",\n flexDirection: \"column\",\n gap: 6,\n fontFamily: FONT,\n boxShadow: \"0 8px 24px rgba(11, 11, 11, 0.08)\",\n ...style,\n }}\n >\n <div\n style={{\n background: C.searchBg,\n height: 32,\n borderRadius: 10,\n padding: 1,\n display: \"flex\",\n alignItems: \"center\",\n }}\n >\n <div\n style={{\n background: C.white,\n flex: 1,\n height: 30,\n borderRadius: 10,\n display: \"flex\",\n alignItems: \"center\",\n gap: 8,\n padding: \"0 8px\",\n }}\n >\n <Search size={16} color={C.textMuted} strokeWidth={2} />\n <input\n type=\"text\"\n value={query}\n onChange={(e) => setQuery(e.target.value)}\n placeholder=\"Search supervisors...\"\n style={{\n flex: 1,\n border: \"none\",\n outline: \"none\",\n background: \"transparent\",\n fontFamily: FONT,\n fontSize: 14,\n color: C.black,\n minWidth: 0,\n }}\n />\n </div>\n </div>\n\n <MetaRow\n left={\n <span style={{ color: C.textMuted, fontWeight: 400 }}>{headerCount}</span>\n }\n right={headerRight}\n />\n\n {flatList.length > 0 && (\n <div style={{ display: \"flex\", flexDirection: \"column\", gap: 6 }}>\n {flatList.map((s) => (\n <Row\n key={s.id}\n supervisor={s}\n checked={stagedSet.has(s.id)}\n muted={false}\n onToggle={() => toggle(s.id)}\n />\n ))}\n </div>\n )}\n\n {renderPartial && (\n <>\n {partialSelected.length > 0 && (\n <div style={{ display: \"flex\", flexDirection: \"column\", gap: 6 }}>\n {partialSelected.map((s) => (\n <Row key={s.id} supervisor={s} checked onToggle={() => toggle(s.id)} />\n ))}\n </div>\n )}\n {partialSelected.length > 0 && partialOthers.length > 0 && (\n <div style={{ height: 1, background: C.border, margin: \"4px 0\" }} />\n )}\n {partialOthers.length > 0 && (\n <>\n <MetaRow\n left={<span style={{ color: C.textMuted, fontWeight: 400 }}>Others</span>}\n right={null}\n />\n <div style={{ display: \"flex\", flexDirection: \"column\", gap: 6 }}>\n {partialOthers.map((s) => (\n <Row\n key={s.id}\n supervisor={s}\n checked={false}\n muted\n onToggle={() => toggle(s.id)}\n />\n ))}\n </div>\n </>\n )}\n </>\n )}\n\n {isSearching && filtered.length === 0 && (\n <div\n style={{\n padding: \"16px 8px\",\n textAlign: \"center\",\n fontSize: 14,\n color: C.textMid,\n fontFamily: FONT,\n }}\n >\n No results for &ldquo;{query}&rdquo;\n </div>\n )}\n {isSearching && filtered.length > 0 && supervisors.length > filtered.length && (\n <div\n style={{\n padding: \"10px 8px\",\n textAlign: \"center\",\n fontSize: 14,\n color: C.textMid,\n fontFamily: FONT,\n }}\n >\n No other results for &ldquo;{query}&rdquo;\n </div>\n )}\n\n <div style={{ height: 1, background: C.border, margin: \"2px 0\" }} />\n\n <div\n style={{\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"space-between\",\n height: 30,\n }}\n >\n {isSearching ? (\n <ActionLink onClick={clearSearch}>Clear search</ActionLink>\n ) : (\n <ActionLink onClick={reset}>Reset</ActionLink>\n )}\n <button\n type=\"button\"\n onClick={apply}\n style={{\n background: C.applyBg,\n color: C.white,\n border: \"none\",\n borderRadius: 10,\n height: 28,\n padding: \"0 14px\",\n fontFamily: FONT,\n fontSize: 14,\n fontWeight: 600,\n cursor: \"pointer\",\n }}\n >\n Apply\n </button>\n </div>\n </div>\n );\n}\n"],"names":["C","FONT","Checkbox","checked","mutedFill","jsx","Check","Row","supervisor","muted","onToggle","jsxs","MetaRow","left","right","ActionLink","children","onClick","faded","SupervisorSelect","supervisors","value","onApply","onClose","totalLabel","className","style","initialValueRef","React","staged","setStaged","query","setQuery","stagedSet","isSearching","filtered","q","s","allSelected","noneSelected","isPartial","toggle","id","prev","x","selectAll","deselectAll","reset","clearSearch","apply","headerCount","headerRight","renderPartial","flatList","partialSelected","partialOthers","Search","e","Fragment"],"mappings":"+FAKMA,EAAI,CACR,MAAO,UACP,MAAO,UACP,aAAc,UACd,OAAQ,UACR,SAAU,UACV,YAAa,UACb,UAAW,UACX,QAAS,UACT,SAAU,UACV,QAAS,UACT,UAAW,SACb,EAEMC,EAAO,mEAEb,SAASC,E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B,EACZ,QAAS,GACT,MAAK,GACL,SAAU,IAAMI,EAAOJ,EAAE,EAAE,CAAA,EAJtBA,EAAE,EAMV,CAAA,EACH,CAAA,EACF,CAAA,EAEJ,EAGDH,GAAeC,EAAS,SAAW,GAClCxB,EAAA,KAAC,MAAA,CACC,MAAO,CACL,QAAS,WACT,UAAW,SACX,SAAU,GACV,MAAOX,EAAE,QACT,WAAYC,CACd,EACD,SAAA,CAAA,mBACwB8B,EAAM,GAAA,CAAA,CAC/B,EAEDG,GAAeC,EAAS,OAAS,GAAKf,EAAY,OAASe,EAAS,QACnExB,EAAA,KAAC,MAAA,CACC,MAAO,CACL,QAAS,WACT,UAAW,SACX,SAAU,GACV,MAAOX,EAAE,QACT,WAAYC,CACd,EACD,SAAA,CAAA,yBAC8B8B,EAAM,GAAA,CAAA,CACrC,EAGF1B,EAAAA,IAAC,MAAI,CAAA,MAAO,CAAE,OAAQ,EAAG,WAAYL,EAAE,OAAQ,OAAQ,OAAW,CAAA,CAAA,EAElEW,EAAA,KAAC,MAAA,CACC,MAAO,CACL,QAAS,OACT,WAAY,SACZ,eAAgB,gBAChB,OAAQ,EACV,EAEC,SAAA,CACCuB,EAAA7B,EAAA,IAACU,EAAW,CAAA,QAASiC,EAAa,SAAA,cAAA,CAAY,EAE7C3C,EAAA,IAAAU,EAAA,CAAW,QAASgC,EAAO,SAAK,QAAA,EAEnC1C,EAAA,IAAC,SAAA,CACC,KAAK,SACL,QAAS4C,EACT,MAAO,CACL,WAAYjD,EAAE,QACd,MAAOA,EAAE,MACT,OAAQ,OACR,aAAc,GACd,OAAQ,GACR,QAAS,SACT,WAAYC,EACZ,SAAU,GACV,WAAY,IACZ,OAAQ,SACV,EACD,SAAA,OAAA,CAED,CAAA,CAAA,CACF,CAAA,CAAA,CAAA,CAGN"}
@@ -0,0 +1,352 @@
1
+ import { jsx as e, jsxs as r, Fragment as B } from "react/jsx-runtime";
2
+ import g from "react";
3
+ import { Search as q, Check as P } from "lucide-react";
4
+ const n = {
5
+ white: "#FFFFFF",
6
+ black: "#0B0B0B",
7
+ borderSubtle: "#E6E6E6",
8
+ border: "#D9D9D9",
9
+ searchBg: "#D8D8D8",
10
+ rowSelected: "#F2F2F0",
11
+ textMuted: "#989898",
12
+ textMid: "#676767",
13
+ textDark: "#323232",
14
+ applyBg: "#2E3236",
15
+ scrollbar: "#D5D9E2"
16
+ }, a = "var(--font-sans, 'Averta', ui-sans-serif, system-ui, sans-serif)";
17
+ function _({ checked: l, mutedFill: i = !1 }) {
18
+ return /* @__PURE__ */ e(
19
+ "span",
20
+ {
21
+ style: {
22
+ width: 20,
23
+ height: 20,
24
+ borderRadius: 4,
25
+ background: l ? n.black : i ? n.rowSelected : n.white,
26
+ border: `1px solid ${l ? n.black : n.textDark}`,
27
+ display: "inline-flex",
28
+ alignItems: "center",
29
+ justifyContent: "center",
30
+ flexShrink: 0,
31
+ boxSizing: "border-box"
32
+ },
33
+ children: l && /* @__PURE__ */ e(P, { size: 14, color: n.white, strokeWidth: 3 })
34
+ }
35
+ );
36
+ }
37
+ function D({ supervisor: l, checked: i, muted: o = !1, onToggle: f }) {
38
+ return /* @__PURE__ */ r(
39
+ "button",
40
+ {
41
+ type: "button",
42
+ onClick: f,
43
+ style: {
44
+ display: "flex",
45
+ alignItems: "center",
46
+ gap: 6,
47
+ height: 32,
48
+ padding: "0 16px 0 8px",
49
+ borderRadius: 10,
50
+ border: "none",
51
+ background: i ? n.rowSelected : "transparent",
52
+ cursor: "pointer",
53
+ width: "100%",
54
+ textAlign: "left",
55
+ fontFamily: a,
56
+ flexShrink: 0
57
+ },
58
+ children: [
59
+ /* @__PURE__ */ r("span", { style: { display: "flex", alignItems: "center", gap: 12, flex: 1, minWidth: 0 }, children: [
60
+ /* @__PURE__ */ e(_, { checked: i, mutedFill: o }),
61
+ /* @__PURE__ */ e(
62
+ "span",
63
+ {
64
+ style: {
65
+ fontSize: 14,
66
+ lineHeight: "20px",
67
+ fontWeight: 400,
68
+ color: !i && o ? n.textMid : n.black,
69
+ whiteSpace: "nowrap",
70
+ overflow: "hidden",
71
+ textOverflow: "ellipsis"
72
+ },
73
+ children: l.name
74
+ }
75
+ )
76
+ ] }),
77
+ /* @__PURE__ */ r(
78
+ "span",
79
+ {
80
+ style: {
81
+ fontSize: 12,
82
+ fontWeight: 500,
83
+ lineHeight: 1,
84
+ color: !i && o ? n.textMid : n.black,
85
+ whiteSpace: "nowrap",
86
+ padding: "4px 8px"
87
+ },
88
+ children: [
89
+ l.agentCount,
90
+ " agents"
91
+ ]
92
+ }
93
+ )
94
+ ]
95
+ }
96
+ );
97
+ }
98
+ function I({ left: l, right: i }) {
99
+ return /* @__PURE__ */ r(
100
+ "div",
101
+ {
102
+ style: {
103
+ display: "flex",
104
+ alignItems: "center",
105
+ justifyContent: "space-between",
106
+ height: 14,
107
+ fontSize: 12,
108
+ lineHeight: 1.5,
109
+ fontFamily: a,
110
+ flexShrink: 0
111
+ },
112
+ children: [
113
+ l,
114
+ i
115
+ ]
116
+ }
117
+ );
118
+ }
119
+ function s({ children: l, onClick: i, faded: o = !1 }) {
120
+ return /* @__PURE__ */ e(
121
+ "button",
122
+ {
123
+ type: "button",
124
+ onClick: i,
125
+ style: {
126
+ background: "transparent",
127
+ border: "none",
128
+ padding: 0,
129
+ cursor: i ? "pointer" : "default",
130
+ fontFamily: a,
131
+ fontSize: 12,
132
+ fontWeight: 500,
133
+ color: o ? n.textMuted : n.textDark,
134
+ whiteSpace: "nowrap"
135
+ },
136
+ children: l
137
+ }
138
+ );
139
+ }
140
+ function J({
141
+ supervisors: l = [],
142
+ value: i = [],
143
+ onApply: o,
144
+ onClose: f,
145
+ totalLabel: E,
146
+ className: j = "",
147
+ style: $
148
+ }) {
149
+ const C = g.useRef(i), [p, u] = g.useState(i), [h, R] = g.useState("");
150
+ g.useEffect(() => {
151
+ C.current = i, u(i);
152
+ }, [i]);
153
+ const m = g.useMemo(() => new Set(p), [p]), d = h.trim().length > 0, c = g.useMemo(() => {
154
+ const t = h.trim().toLowerCase();
155
+ return t ? l.filter((b) => b.name.toLowerCase().includes(t)) : l;
156
+ }, [l, h]), M = l.length > 0 && p.length === l.length, z = p.length === 0, A = !M && !z, S = (t) => {
157
+ u((b) => b.includes(t) ? b.filter((N) => N !== t) : [...b, t]);
158
+ }, k = () => u(l.map((t) => t.id)), W = () => u([]), L = () => u(C.current), O = () => R(""), T = () => {
159
+ o == null || o(p), f == null || f();
160
+ }, H = d ? `${c.length} Result${c.length === 1 ? "" : "s"}` : E || `${l.length} Supervisors`;
161
+ let x;
162
+ d ? x = c.length > 0 ? /* @__PURE__ */ e(s, { onClick: k, children: "Select all" }) : null : M ? x = /* @__PURE__ */ e(s, { onClick: W, children: "Deselect all" }) : z ? x = /* @__PURE__ */ e(s, { onClick: k, children: "Select all" }) : x = /* @__PURE__ */ r("span", { style: { display: "inline-flex", gap: 12 }, children: [
163
+ /* @__PURE__ */ e(s, { onClick: k, children: "Select all" }),
164
+ /* @__PURE__ */ e(s, { onClick: W, children: "Deselect all" })
165
+ ] });
166
+ const y = !d && A, v = d ? c : y ? [] : l, w = y ? l.filter((t) => m.has(t.id)) : [], F = y ? l.filter((t) => !m.has(t.id)) : [];
167
+ return /* @__PURE__ */ r(
168
+ "div",
169
+ {
170
+ className: j,
171
+ style: {
172
+ width: 262,
173
+ background: n.white,
174
+ border: `1px solid ${n.borderSubtle}`,
175
+ borderRadius: 10,
176
+ padding: 12,
177
+ boxSizing: "border-box",
178
+ display: "flex",
179
+ flexDirection: "column",
180
+ gap: 6,
181
+ fontFamily: a,
182
+ boxShadow: "0 8px 24px rgba(11, 11, 11, 0.08)",
183
+ ...$
184
+ },
185
+ children: [
186
+ /* @__PURE__ */ e(
187
+ "div",
188
+ {
189
+ style: {
190
+ background: n.searchBg,
191
+ height: 32,
192
+ borderRadius: 10,
193
+ padding: 1,
194
+ display: "flex",
195
+ alignItems: "center"
196
+ },
197
+ children: /* @__PURE__ */ r(
198
+ "div",
199
+ {
200
+ style: {
201
+ background: n.white,
202
+ flex: 1,
203
+ height: 30,
204
+ borderRadius: 10,
205
+ display: "flex",
206
+ alignItems: "center",
207
+ gap: 8,
208
+ padding: "0 8px"
209
+ },
210
+ children: [
211
+ /* @__PURE__ */ e(q, { size: 16, color: n.textMuted, strokeWidth: 2 }),
212
+ /* @__PURE__ */ e(
213
+ "input",
214
+ {
215
+ type: "text",
216
+ value: h,
217
+ onChange: (t) => R(t.target.value),
218
+ placeholder: "Search supervisors...",
219
+ style: {
220
+ flex: 1,
221
+ border: "none",
222
+ outline: "none",
223
+ background: "transparent",
224
+ fontFamily: a,
225
+ fontSize: 14,
226
+ color: n.black,
227
+ minWidth: 0
228
+ }
229
+ }
230
+ )
231
+ ]
232
+ }
233
+ )
234
+ }
235
+ ),
236
+ /* @__PURE__ */ e(
237
+ I,
238
+ {
239
+ left: /* @__PURE__ */ e("span", { style: { color: n.textMuted, fontWeight: 400 }, children: H }),
240
+ right: x
241
+ }
242
+ ),
243
+ v.length > 0 && /* @__PURE__ */ e("div", { style: { display: "flex", flexDirection: "column", gap: 6 }, children: v.map((t) => /* @__PURE__ */ e(
244
+ D,
245
+ {
246
+ supervisor: t,
247
+ checked: m.has(t.id),
248
+ muted: !1,
249
+ onToggle: () => S(t.id)
250
+ },
251
+ t.id
252
+ )) }),
253
+ y && /* @__PURE__ */ r(B, { children: [
254
+ w.length > 0 && /* @__PURE__ */ e("div", { style: { display: "flex", flexDirection: "column", gap: 6 }, children: w.map((t) => /* @__PURE__ */ e(D, { supervisor: t, checked: !0, onToggle: () => S(t.id) }, t.id)) }),
255
+ w.length > 0 && F.length > 0 && /* @__PURE__ */ e("div", { style: { height: 1, background: n.border, margin: "4px 0" } }),
256
+ F.length > 0 && /* @__PURE__ */ r(B, { children: [
257
+ /* @__PURE__ */ e(
258
+ I,
259
+ {
260
+ left: /* @__PURE__ */ e("span", { style: { color: n.textMuted, fontWeight: 400 }, children: "Others" }),
261
+ right: null
262
+ }
263
+ ),
264
+ /* @__PURE__ */ e("div", { style: { display: "flex", flexDirection: "column", gap: 6 }, children: F.map((t) => /* @__PURE__ */ e(
265
+ D,
266
+ {
267
+ supervisor: t,
268
+ checked: !1,
269
+ muted: !0,
270
+ onToggle: () => S(t.id)
271
+ },
272
+ t.id
273
+ )) })
274
+ ] })
275
+ ] }),
276
+ d && c.length === 0 && /* @__PURE__ */ r(
277
+ "div",
278
+ {
279
+ style: {
280
+ padding: "16px 8px",
281
+ textAlign: "center",
282
+ fontSize: 14,
283
+ color: n.textMid,
284
+ fontFamily: a
285
+ },
286
+ children: [
287
+ "No results for “",
288
+ h,
289
+ "”"
290
+ ]
291
+ }
292
+ ),
293
+ d && c.length > 0 && l.length > c.length && /* @__PURE__ */ r(
294
+ "div",
295
+ {
296
+ style: {
297
+ padding: "10px 8px",
298
+ textAlign: "center",
299
+ fontSize: 14,
300
+ color: n.textMid,
301
+ fontFamily: a
302
+ },
303
+ children: [
304
+ "No other results for “",
305
+ h,
306
+ "”"
307
+ ]
308
+ }
309
+ ),
310
+ /* @__PURE__ */ e("div", { style: { height: 1, background: n.border, margin: "2px 0" } }),
311
+ /* @__PURE__ */ r(
312
+ "div",
313
+ {
314
+ style: {
315
+ display: "flex",
316
+ alignItems: "center",
317
+ justifyContent: "space-between",
318
+ height: 30
319
+ },
320
+ children: [
321
+ d ? /* @__PURE__ */ e(s, { onClick: O, children: "Clear search" }) : /* @__PURE__ */ e(s, { onClick: L, children: "Reset" }),
322
+ /* @__PURE__ */ e(
323
+ "button",
324
+ {
325
+ type: "button",
326
+ onClick: T,
327
+ style: {
328
+ background: n.applyBg,
329
+ color: n.white,
330
+ border: "none",
331
+ borderRadius: 10,
332
+ height: 28,
333
+ padding: "0 14px",
334
+ fontFamily: a,
335
+ fontSize: 14,
336
+ fontWeight: 600,
337
+ cursor: "pointer"
338
+ },
339
+ children: "Apply"
340
+ }
341
+ )
342
+ ]
343
+ }
344
+ )
345
+ ]
346
+ }
347
+ );
348
+ }
349
+ export {
350
+ J as S
351
+ };
352
+ //# sourceMappingURL=SupervisorSelect.es.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SupervisorSelect.es.js","sources":["../src/components/performance/SupervisorSelect.jsx"],"sourcesContent":["\"use client\";\n\nimport React from \"react\";\nimport { Search, Check } from \"lucide-react\";\n\nconst C = {\n white: \"#FFFFFF\",\n black: \"#0B0B0B\",\n borderSubtle: \"#E6E6E6\",\n border: \"#D9D9D9\",\n searchBg: \"#D8D8D8\",\n rowSelected: \"#F2F2F0\",\n textMuted: \"#989898\",\n textMid: \"#676767\",\n textDark: \"#323232\",\n applyBg: \"#2E3236\",\n scrollbar: \"#D5D9E2\",\n};\n\nconst FONT = \"var(--font-sans, 'Averta', ui-sans-serif, system-ui, sans-serif)\";\n\nfunction Checkbox({ checked, mutedFill = false }) {\n return (\n <span\n style={{\n width: 20,\n height: 20,\n borderRadius: 4,\n background: checked ? C.black : mutedFill ? C.rowSelected : C.white,\n border: `1px solid ${checked ? C.black : C.textDark}`,\n display: \"inline-flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n flexShrink: 0,\n boxSizing: \"border-box\",\n }}\n >\n {checked && <Check size={14} color={C.white} strokeWidth={3} />}\n </span>\n );\n}\n\nfunction Row({ supervisor, checked, muted = false, onToggle }) {\n return (\n <button\n type=\"button\"\n onClick={onToggle}\n style={{\n display: \"flex\",\n alignItems: \"center\",\n gap: 6,\n height: 32,\n padding: \"0 16px 0 8px\",\n borderRadius: 10,\n border: \"none\",\n background: checked ? C.rowSelected : \"transparent\",\n cursor: \"pointer\",\n width: \"100%\",\n textAlign: \"left\",\n fontFamily: FONT,\n flexShrink: 0,\n }}\n >\n <span style={{ display: \"flex\", alignItems: \"center\", gap: 12, flex: 1, minWidth: 0 }}>\n <Checkbox checked={checked} mutedFill={muted} />\n <span\n style={{\n fontSize: 14,\n lineHeight: \"20px\",\n fontWeight: 400,\n color: !checked && muted ? C.textMid : C.black,\n whiteSpace: \"nowrap\",\n overflow: \"hidden\",\n textOverflow: \"ellipsis\",\n }}\n >\n {supervisor.name}\n </span>\n </span>\n <span\n style={{\n fontSize: 12,\n fontWeight: 500,\n lineHeight: 1,\n color: !checked && muted ? C.textMid : C.black,\n whiteSpace: \"nowrap\",\n padding: \"4px 8px\",\n }}\n >\n {supervisor.agentCount} agents\n </span>\n </button>\n );\n}\n\nfunction MetaRow({ left, right }) {\n return (\n <div\n style={{\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"space-between\",\n height: 14,\n fontSize: 12,\n lineHeight: 1.5,\n fontFamily: FONT,\n flexShrink: 0,\n }}\n >\n {left}\n {right}\n </div>\n );\n}\n\nfunction ActionLink({ children, onClick, faded = false }) {\n return (\n <button\n type=\"button\"\n onClick={onClick}\n style={{\n background: \"transparent\",\n border: \"none\",\n padding: 0,\n cursor: onClick ? \"pointer\" : \"default\",\n fontFamily: FONT,\n fontSize: 12,\n fontWeight: 500,\n color: faded ? C.textMuted : C.textDark,\n whiteSpace: \"nowrap\",\n }}\n >\n {children}\n </button>\n );\n}\n\nexport default function SupervisorSelect({\n supervisors = [],\n value = [],\n onApply,\n onClose,\n totalLabel,\n className = \"\",\n style,\n}) {\n const initialValueRef = React.useRef(value);\n const [staged, setStaged] = React.useState(value);\n const [query, setQuery] = React.useState(\"\");\n\n React.useEffect(() => {\n initialValueRef.current = value;\n setStaged(value);\n }, [value]);\n\n const stagedSet = React.useMemo(() => new Set(staged), [staged]);\n\n const isSearching = query.trim().length > 0;\n\n const filtered = React.useMemo(() => {\n const q = query.trim().toLowerCase();\n if (!q) return supervisors;\n return supervisors.filter((s) => s.name.toLowerCase().includes(q));\n }, [supervisors, query]);\n\n const allSelected = supervisors.length > 0 && staged.length === supervisors.length;\n const noneSelected = staged.length === 0;\n const isPartial = !allSelected && !noneSelected;\n\n const toggle = (id) => {\n setStaged((prev) => (prev.includes(id) ? prev.filter((x) => x !== id) : [...prev, id]));\n };\n const selectAll = () => setStaged(supervisors.map((s) => s.id));\n const deselectAll = () => setStaged([]);\n const reset = () => setStaged(initialValueRef.current);\n const clearSearch = () => setQuery(\"\");\n const apply = () => {\n onApply?.(staged);\n onClose?.();\n };\n\n const headerCount = isSearching\n ? `${filtered.length} Result${filtered.length === 1 ? \"\" : \"s\"}`\n : totalLabel || `${supervisors.length} Supervisors`;\n\n let headerRight;\n if (isSearching) {\n headerRight = filtered.length > 0 ? <ActionLink onClick={selectAll}>Select all</ActionLink> : null;\n } else if (allSelected) {\n headerRight = <ActionLink onClick={deselectAll}>Deselect all</ActionLink>;\n } else if (noneSelected) {\n headerRight = <ActionLink onClick={selectAll}>Select all</ActionLink>;\n } else {\n headerRight = (\n <span style={{ display: \"inline-flex\", gap: 12 }}>\n <ActionLink onClick={selectAll}>Select all</ActionLink>\n <ActionLink onClick={deselectAll}>Deselect all</ActionLink>\n </span>\n );\n }\n\n // Decide which sections to render\n const renderPartial = !isSearching && isPartial;\n const flatList = isSearching ? filtered : renderPartial ? [] : supervisors;\n const partialSelected = renderPartial ? supervisors.filter((s) => stagedSet.has(s.id)) : [];\n const partialOthers = renderPartial ? supervisors.filter((s) => !stagedSet.has(s.id)) : [];\n\n return (\n <div\n className={className}\n style={{\n width: 262,\n background: C.white,\n border: `1px solid ${C.borderSubtle}`,\n borderRadius: 10,\n padding: 12,\n boxSizing: \"border-box\",\n display: \"flex\",\n flexDirection: \"column\",\n gap: 6,\n fontFamily: FONT,\n boxShadow: \"0 8px 24px rgba(11, 11, 11, 0.08)\",\n ...style,\n }}\n >\n <div\n style={{\n background: C.searchBg,\n height: 32,\n borderRadius: 10,\n padding: 1,\n display: \"flex\",\n alignItems: \"center\",\n }}\n >\n <div\n style={{\n background: C.white,\n flex: 1,\n height: 30,\n borderRadius: 10,\n display: \"flex\",\n alignItems: \"center\",\n gap: 8,\n padding: \"0 8px\",\n }}\n >\n <Search size={16} color={C.textMuted} strokeWidth={2} />\n <input\n type=\"text\"\n value={query}\n onChange={(e) => setQuery(e.target.value)}\n placeholder=\"Search supervisors...\"\n style={{\n flex: 1,\n border: \"none\",\n outline: \"none\",\n background: \"transparent\",\n fontFamily: FONT,\n fontSize: 14,\n color: C.black,\n minWidth: 0,\n }}\n />\n </div>\n </div>\n\n <MetaRow\n left={\n <span style={{ color: C.textMuted, fontWeight: 400 }}>{headerCount}</span>\n }\n right={headerRight}\n />\n\n {flatList.length > 0 && (\n <div style={{ display: \"flex\", flexDirection: \"column\", gap: 6 }}>\n {flatList.map((s) => (\n <Row\n key={s.id}\n supervisor={s}\n checked={stagedSet.has(s.id)}\n muted={false}\n onToggle={() => toggle(s.id)}\n />\n ))}\n </div>\n )}\n\n {renderPartial && (\n <>\n {partialSelected.length > 0 && (\n <div style={{ display: \"flex\", flexDirection: \"column\", gap: 6 }}>\n {partialSelected.map((s) => (\n <Row key={s.id} supervisor={s} checked onToggle={() => toggle(s.id)} />\n ))}\n </div>\n )}\n {partialSelected.length > 0 && partialOthers.length > 0 && (\n <div style={{ height: 1, background: C.border, margin: \"4px 0\" }} />\n )}\n {partialOthers.length > 0 && (\n <>\n <MetaRow\n left={<span style={{ color: C.textMuted, fontWeight: 400 }}>Others</span>}\n right={null}\n />\n <div style={{ display: \"flex\", flexDirection: \"column\", gap: 6 }}>\n {partialOthers.map((s) => (\n <Row\n key={s.id}\n supervisor={s}\n checked={false}\n muted\n onToggle={() => toggle(s.id)}\n />\n ))}\n </div>\n </>\n )}\n </>\n )}\n\n {isSearching && filtered.length === 0 && (\n <div\n style={{\n padding: \"16px 8px\",\n textAlign: \"center\",\n fontSize: 14,\n color: C.textMid,\n fontFamily: FONT,\n }}\n >\n No results for &ldquo;{query}&rdquo;\n </div>\n )}\n {isSearching && filtered.length > 0 && supervisors.length > filtered.length && (\n <div\n style={{\n padding: \"10px 8px\",\n textAlign: \"center\",\n fontSize: 14,\n color: C.textMid,\n fontFamily: FONT,\n }}\n >\n No other results for &ldquo;{query}&rdquo;\n </div>\n )}\n\n <div style={{ height: 1, background: C.border, margin: \"2px 0\" }} />\n\n <div\n style={{\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"space-between\",\n height: 30,\n }}\n >\n {isSearching ? (\n <ActionLink onClick={clearSearch}>Clear search</ActionLink>\n ) : (\n <ActionLink onClick={reset}>Reset</ActionLink>\n )}\n <button\n type=\"button\"\n onClick={apply}\n style={{\n background: C.applyBg,\n color: C.white,\n border: \"none\",\n borderRadius: 10,\n height: 28,\n padding: \"0 14px\",\n fontFamily: FONT,\n fontSize: 14,\n fontWeight: 600,\n cursor: \"pointer\",\n }}\n >\n Apply\n </button>\n </div>\n </div>\n );\n}\n"],"names":["C","FONT","Checkbox","checked","mutedFill","jsx","Check","Row","supervisor","muted","onToggle","jsxs","MetaRow","left","right","ActionLink","children","onClick","faded","SupervisorSelect","supervisors","value","onApply","onClose","totalLabel","className","style","initialValueRef","React","staged","setStaged","query","setQuery","stagedSet","isSearching","filtered","q","s","allSelected","noneSelected","isPartial","toggle","id","prev","x","selectAll","deselectAll","reset","clearSearch","apply","headerCount","headerRight","renderPartial","flatList","partialSelected","partialOthers","Search","e","Fragment"],"mappings":";;;AAKA,MAAMA,IAAI;AAAA,EACR,OAAO;AAAA,EACP,OAAO;AAAA,EACP,cAAc;AAAA,EACd,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,aAAa;AAAA,EACb,WAAW;AAAA,EACX,SAAS;AAAA,EACT,UAAU;AAAA,EACV,SAAS;AAAA,EACT,WAAW;AACb,GAEMC,IAAO;AAEb,SAASC,EAAS,EAAE,SAAAC,GAAS,WAAAC,IAAY,MAAS;AAE9C,SAAA,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,OAAO;AAAA,QACL,OAAO;AAAA,QACP,QAAQ;AAAA,QACR,cAAc;AAAA,QACd,YAAYF,IAAUH,EAAE,QAAQI,IAAYJ,EAAE,cAAcA,EAAE;AAAA,QAC9D,QAAQ,aAAaG,IAAUH,EAAE,QAAQA,EAAE,QAAQ;AAAA,QACnD,SAAS;AAAA,QACT,YAAY;AAAA,QACZ,gBAAgB;AAAA,QAChB,Y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AYjD,EAAE;AAAA,oBACd,OAAOA,EAAE;AAAA,oBACT,QAAQ;AAAA,oBACR,cAAc;AAAA,oBACd,QAAQ;AAAA,oBACR,SAAS;AAAA,oBACT,YAAYC;AAAA,oBACZ,UAAU;AAAA,oBACV,YAAY;AAAA,oBACZ,QAAQ;AAAA,kBACV;AAAA,kBACD,UAAA;AAAA,gBAAA;AAAA,cAED;AAAA,YAAA;AAAA,UAAA;AAAA,QACF;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGN;"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),z=require("react"),I=require("lucide-react"),Z=require("../DataTable2.cjs.js"),de=require("../PerformancePanel.cjs.js");require("../sortable.esm.cjs.js");require("react-dom");require("../CustomFilterChips.cjs.js");require("motion/react");require("recharts");require("../AgentLiftAnalysisCard.cjs.js");require("../TourGuideTooltip.cjs.js");const n={ink:"#2E3236",muted:"#808183",border:"#D9D9D9",borderSubtle:"#E6E6E6",black:"#0B0B0B",white:"#FFFFFF",neutralBorder:"#BFBFBF",neutralLight:"#E6E6E6",neutral800:"#323232",neutral600:"#676767",neutral400:"#989898",fillTrack:"#EFEFEF",beige:"rgba(243, 241, 229, 0.4)"},d="var(--font-sans, 'Averta', ui-sans-serif, system-ui, sans-serif)";function G(t){if(!(t instanceof Date)){const i=new Date(t);if(Number.isNaN(i.getTime()))return String(t??"");t=i}return t.toLocaleDateString("en-US",{month:"2-digit",day:"2-digit",year:"numeric"})}const Ae=[{id:"8h",label:"8h"},{id:"1d",label:"1d"},{id:"7d",label:"7d"},{id:"30d",label:"30d"}],We={"8h":8*60*60*1e3,"1d":24*60*60*1e3,"7d":7*24*60*60*1e3,"30d":30*24*60*60*1e3};function Ne(t){const i=We[t];if(!i)return"";const l=new Date,r=new Date(l.getTime()-i);return`${G(r)} – ${G(l)}`}function Ce({label:t,active:i=!1,onClick:l}){return e.jsx("button",{type:"button",onClick:l,style:{height:32,minWidth:31,padding:"0 12px",borderRadius:10,border:i?"none":`1px solid ${n.borderSubtle}`,background:i?n.black:n.white,color:i?n.white:n.black,fontFamily:d,fontSize:14,cursor:"pointer"},children:t})}function ne({value:t,delta:i,label:l,style:r={}}){return e.jsxs("div",{style:{background:n.white,border:`1px solid ${n.border}`,borderRadius:8,padding:16,display:"flex",flexDirection:"column",gap:8,boxSizing:"border-box",...r},children:[e.jsxs("div",{style:{display:"flex",alignItems:"baseline",gap:8,minHeight:36},children:[e.jsx("span",{style:{fontFamily:d,fontSize:28,fontWeight:500,color:n.ink,letterSpacing:"-0.01em",lineHeight:1.1},children:t}),i!=null&&i!==""&&e.jsx("span",{style:{fontFamily:d,fontSize:12,fontWeight:500,color:n.muted,whiteSpace:"nowrap"},children:i})]}),e.jsx("span",{style:{fontFamily:d,fontSize:13,color:n.ink,lineHeight:1.2},children:l})]})}function Re({title:t="",present:i={value:"",caption:"",sub:""},absent:l={value:"",caption:"",sub:""},impact:r={value:"",caption:"",sub:""},style:s={}}){return e.jsxs("div",{style:{flex:1,background:n.beige,border:`1px solid ${n.border}`,borderRadius:8,padding:16,display:"flex",flexDirection:"column",gap:12,boxSizing:"border-box",minWidth:0,...s},children:[e.jsx("span",{style:{fontFamily:d,fontSize:13,fontWeight:500,color:n.ink,lineHeight:1.2},children:t}),e.jsxs("div",{style:{display:"flex",alignItems:"stretch",gap:24,minWidth:0},children:[e.jsx(X,{...i}),e.jsx(X,{...l}),e.jsx(X,{...r})]})]})}function X({value:t,caption:i,sub:l}){return e.jsxs("div",{style:{flex:1,minWidth:0,display:"flex",flexDirection:"column",gap:8},children:[e.jsx("span",{style:{fontFamily:d,fontSize:22,fontWeight:500,color:n.muted,letterSpacing:"-0.01em",lineHeight:1.1},children:t}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4},children:[e.jsx("span",{style:{fontFamily:d,fontSize:12,color:n.ink,lineHeight:1.2},children:i}),l&&e.jsx("span",{style:{fontFamily:d,fontSize:12,color:n.neutral600,lineHeight:1.2},children:l})]})]})}function _e({value:t,options:i=[],onChange:l}){const[r,s]=z.useState(!1),p=z.useRef(null),u=z.useRef(null);z.useEffect(()=>{if(!r)return;const a=f=>{var x,m;(x=u.current)!=null&&x.contains(f.target)||(m=p.current)!=null&&m.contains(f.target)||s(!1)};return document.addEventListener("mousedown",a),()=>document.removeEventListener("mousedown",a)},[r]);const h=i.find(a=>a.id===t)||i[0];return e.jsxs("div",{style:{position:"relative"},children:[e.jsxs("button",{type:"button",ref:p,onClick:()=>s(a=>!a),"aria-haspopup":"listbox","aria-expanded":r,style:{display:"inline-flex",alignItems:"center",gap:6,height:24,padding:"0 8px 0 0",background:"transparent",border:"none",cursor:"pointer",fontFamily:d,fontSize:12,color:n.ink},children:[h==null?void 0:h.label,e.jsx(I.ChevronDown,{size:14,strokeWidth:1.75,style:{transform:r?"rotate(180deg)":"none",transition:"transform 120ms ease"}})]}),r&&e.jsx("div",{ref:u,role:"listbox",style:{position:"absolute",top:28,right:0,zIndex:30,background:n.white,border:`1px solid ${n.border}`,borderRadius:8,boxShadow:"0 8px 24px rgba(11, 11, 11, 0.12)",minWidth:200,padding:4,fontFamily:d},children:i.map(a=>{const f=a.id===t;return e.jsxs("button",{type:"button",role:"option","aria-selected":f,onClick:()=>{l==null||l(a.id),s(!1)},style:{display:"flex",alignItems:"center",gap:8,width:"100%",padding:"8px 10px",border:"none",background:f?n.borderSubtle:"transparent",cursor:"pointer",textAlign:"left",fontFamily:d,fontSize:13,color:n.ink,borderRadius:6},children:[f?e.jsx(I.Check,{size:16,color:n.ink,strokeWidth:1.75}):e.jsx("span",{style:{width:16}}),e.jsx("span",{children:a.label})]},a.id)})})]})}function Pe({currentSeries:t=[],previousSeries:i=[],yLabels:l=[],height:r=176,showPrevious:s=!0,legendCurrentLabel:p="",legendPreviousLabel:u=""}){const h=r-8,a=32,f=8,x=1080,m=x-a-f,S=[...t,...s?i:[]];if(!(S.length>0))return e.jsx("div",{style:{height:r,display:"flex",alignItems:"center",justifyContent:"center",fontFamily:d,fontSize:12,color:n.muted},children:"No data"});const L=Math.min(...S,0),E=Math.max(...S,1),R=E-L||1,N=o=>12+(E-o)/R*(h-24),C=o=>{if(!o.length)return"";const b=o.length>1?m/(o.length-1):0;return o.map((F,v)=>`${v===0?"M":"L"}${a+v*b},${N(F)}`).join(" ")},D=C(t),w=s?C(i):"",$=o=>o.map((b,F)=>{const v=o.length>1?m/(o.length-1):0;return{x:a+F*v,y:N(b)}});return e.jsxs("div",{style:{width:"100%"},children:[e.jsxs("svg",{width:"100%",height:r,viewBox:`0 0 ${x} ${r}`,preserveAspectRatio:"none",children:[l.map((o,b)=>{const F=12+b/Math.max(1,l.length-1)*(h-24);return e.jsx("text",{x:0,y:F+3,fontFamily:d,fontSize:"10",fill:n.neutral800,children:o},o+b)}),e.jsx("line",{x1:a,y1:h,x2:x-f,y2:h,stroke:n.border,strokeWidth:"1"}),e.jsx("line",{x1:a,y1:12,x2:x-f,y2:12,stroke:n.borderSubtle,strokeDasharray:"2 4",strokeWidth:"1"}),w&&e.jsx("path",{d:w,stroke:n.neutral400,strokeWidth:"1.5",strokeDasharray:"4 4",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"}),D&&e.jsx("path",{d:D,stroke:n.black,strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"}),s&&$(i).map((o,b)=>e.jsx("circle",{cx:o.x,cy:o.y,r:3,fill:n.white,stroke:n.neutral400,strokeWidth:"1.5"},`prev-${b}`)),$(t).map((o,b)=>e.jsx("circle",{cx:o.x,cy:o.y,r:3,fill:n.white,stroke:n.black,strokeWidth:"1.5"},`cur-${b}`))]}),(p||s&&u)&&e.jsxs("div",{style:{display:"flex",justifyContent:"center",gap:24,marginTop:8,fontFamily:d,fontSize:11,color:n.ink},children:[p&&e.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:6},children:[e.jsx("span",{style:{width:20,height:0,borderTop:`2px solid ${n.black}`}}),p]}),s&&u&&e.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:6},children:[e.jsx("span",{style:{width:20,height:0,borderTop:`2px dashed ${n.neutral400}`}}),u]})]})]})}function le({icon:t,title:i,count:l}){return e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:16,width:"100%",paddingBottom:16,borderBottom:`1px solid ${n.border}`},children:[e.jsx("div",{style:{width:34,height:34,borderRadius:9999,background:"#F3F7F7",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:e.jsx(t,{size:20,color:n.ink,strokeWidth:1.75})}),e.jsx("span",{style:{flex:1,fontFamily:d,fontWeight:700,fontSize:16,color:n.ink,lineHeight:1.2},children:i}),l!=null&&l!==""&&e.jsx("span",{style:{fontFamily:d,fontSize:13,color:n.muted},children:l})]})}function re({label:t,value:i}){return e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"10px 0",borderBottom:`1px solid ${n.border}`,fontFamily:d,fontSize:13,lineHeight:1.4,gap:16},children:[e.jsx("span",{style:{color:n.ink,minWidth:0,overflow:"hidden",textOverflow:"ellipsis"},children:t}),e.jsx("span",{style:{color:n.muted,whiteSpace:"nowrap"},children:i})]})}function se({items:t=[]}){if(!t.length)return e.jsx("div",{style:{padding:"12px 0",fontFamily:d,fontSize:13,color:n.muted},children:"No items available."});const i=Math.ceil(t.length/2),l=t.slice(0,i),r=t.slice(i);return e.jsxs("div",{style:{display:"flex",gap:24},children:[e.jsx("div",{style:{flex:1,display:"flex",flexDirection:"column"},children:l.map((s,p)=>e.jsx(re,{...s},`l-${p}`))}),e.jsx("div",{style:{flex:1,display:"flex",flexDirection:"column"},children:r.map((s,p)=>e.jsx(re,{...s},`r-${p}`))})]})}function Me({value:t=0,max:i=5}){const l=typeof t=="number"?t:parseFloat(t)||0,r=Math.floor(l),s=l%1>0&&r<i;return e.jsx("div",{style:{display:"inline-flex",gap:4},children:Array.from({length:i}).map((p,u)=>u<r?e.jsx("span",{style:{width:10,height:10,borderRadius:"50%",background:n.black}},u):u===r&&s?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:n.black}})},u):e.jsx("span",{style:{width:10,height:10,borderRadius:"50%",background:n.white,border:`1px solid ${n.border}`,boxSizing:"border-box"}},u))})}const ce=[{id:"agent",label:"Agent",width:250,sortable:!0,filterable:!0},{id:"fireCount",label:"Fire Count",width:174,sortable:!0,filterable:!0,filterType:"number"},{id:"totalCalls",label:"Total Calls",width:181,sortable:!0,filterable:!0,filterType:"number"},{id:"rate",label:"Rate",width:183,sortable:!0,filterable:!0,filterType:"number"},{id:"avgStrength",label:"Avg Strength",width:172,sortable:!0,filterable:!0,filterType:"number"}],ue=[{id:"dateTime",label:"Date & Time",width:212,sortable:!0},{id:"agent",label:"Agent",width:224,sortable:!0,filterable:!0},{id:"title",label:"Title",width:298,sortable:!0,filterable:!0},{id:"strength",label:"Strength",width:172,sortable:!0,filterable:!0,filterType:"number"},{id:"compass",label:"Compass Score",width:183,sortable:!0,filterable:!0,filterType:"number",render:t=>{const i=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(Me,{value:i})]})}}];function pe({className:t="",signalName:i="",signalSubtitle:l="",onBack:r,dateRangeLabel:s="",rangeOptions:p=Ae,selectedWindow:u="30d",onWindowChange:h,dateRangePicker:a,dateRange:f,onDateRangeChange:x,onExport:m,fireRateStat:S={value:"",delta:"",label:""},fireCountStat:W={value:"",delta:"",label:""},outcomeCorrelation:L={title:"",present:{value:"",caption:"",sub:""},absent:{value:"",caption:"",sub:""},impact:{value:"",caption:"",sub:""}},chartTitle:E="",chartLegendCurrentLabel:R="",chartLegendPreviousLabel:N="",chartYLabels:C=[],fireRateTrend:D={currentSeries:[],previousSeries:[]},chartViewOptions:w=[],chartView:$,onChartViewChange:o,agentBreakdownRows:b=[],agentBreakdownColumns:F=ce,agentBreakdownTitle:v="",onAgentClick:_,onAgentBreakdownVisibleColumnsChange:k,agentBreakdownInitialPageSize:P=10,coOccurringTitle:M="",coOccurringItems:K=[],evidenceTitle:B="",evidenceItems:H=[],recentInteractions:j=[],recentInteractionColumns:O=ue,recentInteractionsTitle:U="",onInteractionClick:Y,onRecentInteractionsVisibleColumnsChange:y,recentInteractionsInitialPageSize:he=10,agentBreakdownTotal:be=null,agentBreakdownPage:ye=null,agentBreakdownPageSize:ge=null,onAgentBreakdownPageChange:me,onAgentBreakdownPageSizeChange:je,recentInteractionsTotal:ke=null,recentInteractionsPage:Se=null,recentInteractionsPageSize:we=null,onRecentInteractionsPageChange:Fe,onRecentInteractionsPageSizeChange:ve}){var ie;const[Te,J]=z.useState(null),T=f!==void 0?f:Te,Q=!!(T!=null&&T.from&&(T!=null&&T.to)),ze=g=>{J(g),x==null||x(g)},Le=g=>{J(null),x==null||x(null),h==null||h(g)},ee=Q?`${G(T.from)} – ${G(T.to)}`:s||Ne(u),[Ee,De]=z.useState($??((ie=w[0])==null?void 0:ie.id)??null),te=o?$:Ee,$e=g=>{o||De(g),o==null||o(g)},q=w.find(g=>g.id===te),Ie=(q==null?void 0:q.showPrevious)===void 0?!0:!!q.showPrevious;return e.jsxs("div",{className:t,style:{background:n.white,fontFamily:d,color:n.ink,width:"100%",minWidth:1192,boxSizing:"border-box",padding:"12px 32px 32px",display:"flex",flexDirection:"column",gap:24},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:16,paddingTop:12,flexWrap:"wrap"},children:[e.jsx("button",{type:"button","aria-label":"Back",onClick:r,style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:24,height:24,background:"transparent",border:"none",cursor:"pointer",color:n.ink,padding:0,flexShrink:0},children:e.jsx(I.ArrowLeft,{size:20,strokeWidth:1.75})}),e.jsxs("div",{style:{flex:1,minWidth:0,display:"flex",flexDirection:"column",gap:4,paddingLeft:16,borderLeft:`1px solid ${n.border}`,alignSelf:"stretch",justifyContent:"center"},children:[e.jsx("h1",{style:{fontFamily:d,fontSize:22,fontWeight:500,color:n.ink,margin:0,lineHeight:1.2,letterSpacing:"-0.01em",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:i}),l&&e.jsx("span",{style:{fontFamily:d,fontSize:12,color:n.muted,lineHeight:1.2},children:l})]}),e.jsxs("div",{style:{display:"flex",gap:10,alignItems:"center",flexWrap:"wrap"},children:[ee&&e.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:6,fontFamily:d,fontSize:13,color:n.ink,marginRight:6,whiteSpace:"nowrap"},children:[e.jsx(I.CalendarDays,{size:16,strokeWidth:1.75,color:n.muted}),ee]}),p.map(g=>e.jsx(Ce,{label:g.label,active:!Q&&g.id===u,onClick:()=>Le(g.id)},g.id)),a||e.jsx(de.DateRangeButton,{value:T,onChange:ze})]})]}),e.jsxs("div",{style:{display:"flex",gap:24,alignItems:"stretch"},children:[e.jsx(ne,{value:S.value,delta:S.delta,label:S.label,style:{width:272,flexShrink:0}}),e.jsx(ne,{value:W.value,delta:W.delta,label:W.label,style:{width:272,flexShrink:0}}),e.jsx(Re,{title:L.title,present:L.present,absent:L.absent,impact:L.impact})]}),e.jsxs("div",{style:{background:n.white,border:`1px solid ${n.border}`,borderRadius:8,padding:24,display:"flex",flexDirection:"column",gap:16},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12},children:[e.jsx("span",{style:{flex:1,fontFamily:d,fontSize:14,fontWeight:500,color:n.ink,lineHeight:1.2},children:E}),w.length>0&&e.jsx(_e,{value:te,options:w,onChange:$e})]}),e.jsx(Pe,{currentSeries:D.currentSeries||[],previousSeries:D.previousSeries||[],yLabels:C,showPrevious:Ie,legendCurrentLabel:R,legendPreviousLabel:N})]}),e.jsxs("div",{style:{position:"relative"},children:[v&&e.jsx("span",{style:{position:"absolute",top:14,left:4,zIndex:40,fontFamily:d,fontSize:20,fontWeight:500,color:n.ink,lineHeight:1.2,letterSpacing:"-0.01em",pointerEvents:"none"},children:v}),e.jsx(Z.DataTable2,{data:b,columns:F,initialPageSize:P,onRowClick:_,onVisibleColumnsChange:k,totalCount:be,page:ye,pageSize:ge,onPageChange:me,onPageSizeChange:je})]}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:16},children:[e.jsx(le,{icon:I.Share2,title:M}),e.jsx(se,{items:K})]}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:16},children:[e.jsx(le,{icon:I.FileText,title:B}),e.jsx(se,{items:H})]}),e.jsxs("div",{style:{position:"relative"},children:[U&&e.jsx("span",{style:{position:"absolute",top:14,left:0,zIndex:40,fontFamily:d,fontSize:20,fontWeight:600,color:n.ink,lineHeight:1.2,letterSpacing:"-0.01em",pointerEvents:"none"},children:U}),e.jsx(Z.DataTable2,{data:j,columns:O,initialPageSize:he,onRowClick:Y,onVisibleColumnsChange:y,totalCount:ke,page:Se,pageSize:we,onPageChange:Fe,onPageSizeChange:ve})]})]})}const oe={value:"",label:"",trend:"up"},c={ink:"#2E3236",muted:"#808183",border:"#D9D9D9",borderSubtle:"#E6E6E6",black:"#0B0B0B",white:"#FFFFFF",neutralBorder:"#BFBFBF",neutralLight:"#E6E6E6",neutral600:"#676767",neutral400:"#989898",fillTrack:"#EFEFEF"},A="var(--font-sans, 'Averta', ui-sans-serif, system-ui, sans-serif)";function Be({trend:t="up",width:i=49.618,height:l=35}){const r=z.useId(),s="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",p="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:i,height:l,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-${r}`,x1:"9.96776",y1:"16.2053",x2:"9.96776",y2:"36.0002",gradientUnits:"userSpaceOnUse",children:[e.jsx("stop",{stopColor:c.ink}),e.jsx("stop",{offset:"1",stopColor:c.white,stopOpacity:"0.01"})]})}),e.jsx("path",{d:p,fill:`url(#spark-${r})`,fillRule:"evenodd",clipRule:"evenodd",opacity:"0.1"}),e.jsx("path",{d:s,stroke:c.ink,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeDasharray:t==="down"?"2 4":void 0})]})}function fe({direction:t="up",color:i=c.muted,size:l=18}){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:l,height:l*9.5/18,viewBox:"0 0 19 10",fill:"none",style:{flexShrink:0},children:e.jsx("path",{d:t==="up"?r:s,stroke:i,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function ae({value:t,label:i,trend:l="up",style:r={}}){return e.jsxs("div",{style:{background:c.white,border:`1px solid ${c.border}`,borderRadius:8,padding:16,display:"flex",flexDirection:"column",gap:8,boxSizing:"border-box",...r},children:[e.jsxs("div",{style:{display:"flex",alignItems:"flex-start",justifyContent:"space-between"},children:[e.jsx(Be,{trend:l}),e.jsx(fe,{direction:l})]}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8,marginTop:8},children:[e.jsx("div",{style:{fontFamily:A,fontSize:28,fontWeight:500,lineHeight:"1.2",color:c.ink,letterSpacing:"-0.01em"},children:t}),e.jsx("div",{style:{fontFamily:A,fontSize:13,color:c.ink,lineHeight:"1.2"},children:i})]})]})}function He({label:t,active:i=!1,onClick:l}){return e.jsx("button",{type:"button",onClick:l,style:{height:32,minWidth:31,padding:"0 12px",borderRadius:10,border:i?"none":`1px solid ${c.borderSubtle}`,background:i?c.black:c.white,color:i?c.white:c.black,fontFamily:A,fontSize:14,cursor:"pointer"},children:t})}const Oe=[{id:"8h",label:"8h"},{id:"1d",label:"1d"},{id:"7d",label:"7d"},{id:"30d",label:"30d"}],Ue={"8h":8*60*60*1e3,"1d":24*60*60*1e3,"7d":7*24*60*60*1e3,"30d":30*24*60*60*1e3};function V(t){return t.toLocaleDateString("en-US",{month:"2-digit",day:"2-digit",year:"numeric"})}function qe(t){const i=Ue[t];if(!i)return"";const l=new Date,r=new Date(l.getTime()-i);return`${V(r)} – ${V(l)}`}function Ge({value:t}){const i=typeof t=="number"?t:parseFloat(String(t??"").replace("%",""))||0,l=Math.max(0,Math.min(100,i));return e.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:12,width:"100%"},children:[e.jsxs("span",{style:{minWidth:32,color:c.ink,fontVariantNumeric:"tabular-nums"},children:[l,"%"]}),e.jsx("span",{style:{flex:1,height:4,background:c.fillTrack,borderRadius:2,overflow:"hidden",minWidth:40,maxWidth:80},children:e.jsx("span",{style:{display:"block",width:`${l}%`,height:"100%",background:c.black,borderRadius:2}})})]})}function Ve({value:t}){if(t==null||t==="")return null;const i=typeof t=="number"?t:parseFloat(String(t).replace(/[^-\d.]/g,"")),l=Number.isFinite(i),r=!l||i>=0,s=typeof t=="string"?t:l?`${i>=0?"+":""}${i.toFixed(1)}`:String(t);return e.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:6},children:[e.jsx(fe,{direction:r?"up":"down",color:c.ink,size:16}),e.jsx("span",{style:{fontVariantNumeric:"tabular-nums"},children:s})]})}function Ke({value:t}){if(t==null||t==="")return null;const i=typeof t=="number"?t:parseFloat(String(t).replace(/[^-\d.]/g,""));if(!Number.isFinite(i))return e.jsx("span",{children:String(t)});const l=i>=0?"+":"",r=typeof t=="string"&&/^[+-]/.test(t)?t:`${l}${i}`;return e.jsx("span",{style:{fontVariantNumeric:"tabular-nums"},children:r})}const xe=[{id:"signal",label:"Signals",width:250,sortable:!0,filterable:!0},{id:"fireRate",label:"Fire Rate",width:140,sortable:!0,filterable:!0,filterType:"number",render:t=>e.jsx(Ge,{value:t})},{id:"fires",label:"Fires",width:140,sortable:!0,filterable:!0,filterType:"number"},{id:"delta",label:"Delta",width:140,sortable:!0,filterable:!0,filterType:"number",render:t=>e.jsx(Ve,{value:t})},{id:"avgStrength",label:"Avg Strength",width:140,sortable:!0,filterable:!0,filterType:"number"},{id:"compass",label:"Agent Lift",width:140,sortable:!0,filterable:!0,filterType:"number",render:t=>e.jsx(Ke,{value:t})},{id:"topAgent",label:"Top Agent",width:178,sortable:!0,filterable:!0}];function Ye({className:t="",title:i="",dateRangeLabel:l="",totalInteractionsStat:r=oe,activeSignalsStat:s=oe,activeSignalsHeading:p="",rangeOptions:u=Oe,selectedWindow:h="30d",onWindowChange:a,dateRangePicker:f,dateRange:x,onDateRangeChange:m,signals:S=[],signalColumns:W=xe,initialPageSize:L=10,onSignalClick:E,onVisibleColumnsChange:R,signalsTotal:N=null,signalsPage:C=null,signalsPageSize:D=null,onSignalsPageChange:w,onSignalsPageSizeChange:$,onExport:o,fireRateStatLabel:b="",fireCountStatLabel:F=""}){const[v,_]=z.useState(null),k=x!==void 0?x:v,P=!!(k!=null&&k.from&&(k!=null&&k.to)),M=y=>{_(y),m==null||m(y)},K=y=>{_(null),m==null||m(null),a==null||a(y)},B=p||(s.value!==""&&s.value!=null?`${s.value} ${s.label||""}`.trim():""),H=P?`${V(k.from)} – ${V(k.to)}`:l||qe(h),[j,O]=z.useState(null),U=y=>{if(E){E(y);return}O(y)},Y=j?{signalName:j.signal??"",fireRateStat:{value:j.fireRate!=null&&j.fireRate!==""?`${j.fireRate}%`:"",delta:j.delta??"",label:b},fireCountStat:{value:typeof j.fires=="number"?j.fires.toLocaleString():j.fires??"",delta:"",label:F},selectedWindow:h,onWindowChange:a,dateRange:k,onDateRangeChange:M,rangeOptions:u,dateRangePicker:f,onExport:o}:null;return e.jsxs(e.Fragment,{children:[j&&e.jsx(pe,{className:t,...Y,onBack:()=>O(null)}),e.jsxs("div",{className:t,style:{background:c.white,fontFamily:A,color:c.ink,width:"100%",minWidth:1192,boxSizing:"border-box",padding:"12px 32px 32px",flexDirection:"column",gap:24,display:j?"none":"flex"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:16,paddingTop:12,flexWrap:"wrap"},children:[e.jsx("h1",{style:{fontFamily:A,fontSize:24,fontWeight:500,color:c.ink,margin:0,lineHeight:"1.2",letterSpacing:"-0.01em",flex:1,minWidth:0},children:i}),e.jsxs("div",{style:{display:"flex",gap:10,alignItems:"center",flexWrap:"wrap"},children:[H&&e.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:6,fontFamily:A,fontSize:13,color:c.ink,marginRight:6,whiteSpace:"nowrap"},children:[e.jsx(I.CalendarDays,{size:16,strokeWidth:1.75,color:c.muted}),H]}),u.map(y=>e.jsx(He,{label:y.label,active:!P&&y.id===h,onClick:()=>K(y.id)},y.id)),f||e.jsx(de.DateRangeButton,{value:k,onChange:M})]})]}),e.jsxs("div",{style:{display:"flex",gap:24},children:[e.jsx(ae,{value:r.value,label:r.label,trend:r.trend,style:{width:264,flexShrink:0}}),e.jsx(ae,{value:s.value,label:s.label,trend:s.trend,style:{width:264,flexShrink:0}})]}),e.jsxs("div",{style:{position:"relative",paddingTop:8,borderTop:`1px solid ${c.border}`},children:[B&&e.jsx("span",{style:{position:"absolute",top:24,left:0,zIndex:40,fontFamily:A,fontSize:14,color:c.ink,fontWeight:500,lineHeight:1.2,pointerEvents:"none"},children:B}),e.jsx(Z.DataTable2,{data:S,columns:W,initialPageSize:L,onRowClick:U,onVisibleColumnsChange:R,totalCount:N,page:C,pageSize:D,onPageChange:w,onPageSizeChange:$})]})]})]})}exports.DEFAULT_AGENT_BREAKDOWN_COLUMNS=ce;exports.DEFAULT_RECENT_INTERACTION_COLUMNS=ue;exports.DEFAULT_SIGNAL_COLUMNS=xe;exports.SignalDetailsPage=pe;exports.SignalsListPage=Ye;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),z=require("react"),$=require("lucide-react"),X=require("../DataTable2.cjs.js"),E=require("../PerformancePanel.cjs.js");require("../sortable.esm.cjs.js");require("react-dom");require("../CustomFilterChips.cjs.js");require("motion/react");require("recharts");require("../AgentLiftAnalysisCard.cjs.js");require("../TourGuideTooltip.cjs.js");const i={ink:"#2E3236",muted:"#808183",border:"#D9D9D9",borderSubtle:"#E6E6E6",black:"#0B0B0B",white:"#FFFFFF",neutralBorder:"#BFBFBF",neutralLight:"#E6E6E6",neutral800:"#323232",neutral600:"#676767",neutral400:"#989898",fillTrack:"#EFEFEF",beige:"rgba(243, 241, 229, 0.4)"},d="var(--font-sans, 'Averta', ui-sans-serif, system-ui, sans-serif)",Ie=[{id:"8h",label:"8h"},{id:"1d",label:"1d"},{id:"7d",label:"7d"},{id:"30d",label:"30d"}];function We({label:t,active:l=!1,onClick:n}){return e.jsx("button",{type:"button",onClick:n,style:{height:32,minWidth:31,padding:"0 12px",borderRadius:10,border:l?"none":`1px solid ${i.borderSubtle}`,background:l?i.black:i.white,color:l?i.white:i.black,fontFamily:d,fontSize:14,cursor:"pointer"},children:t})}function ie({value:t,delta:l,label:n,style:r={}}){return e.jsxs("div",{style:{background:i.white,border:`1px solid ${i.border}`,borderRadius:8,padding:16,display:"flex",flexDirection:"column",gap:8,boxSizing:"border-box",...r},children:[e.jsxs("div",{style:{display:"flex",alignItems:"baseline",gap:8,minHeight:36},children:[e.jsx("span",{style:{fontFamily:d,fontSize:28,fontWeight:500,color:i.ink,letterSpacing:"-0.01em",lineHeight:1.1},children:t}),l!=null&&l!==""&&e.jsx("span",{style:{fontFamily:d,fontSize:12,fontWeight:500,color:i.muted,whiteSpace:"nowrap"},children:l})]}),e.jsx("span",{style:{fontFamily:d,fontSize:13,color:i.ink,lineHeight:1.2},children:n})]})}function $e({title:t="",present:l={value:"",caption:"",sub:""},absent:n={value:"",caption:"",sub:""},impact:r={value:"",caption:"",sub:""},style:s={}}){return e.jsxs("div",{style:{flex:1,background:i.beige,border:`1px solid ${i.border}`,borderRadius:8,padding:16,display:"flex",flexDirection:"column",gap:12,boxSizing:"border-box",minWidth:0,...s},children:[e.jsx("span",{style:{fontFamily:d,fontSize:13,fontWeight:500,color:i.ink,lineHeight:1.2},children:t}),e.jsxs("div",{style:{display:"flex",alignItems:"stretch",gap:24,minWidth:0},children:[e.jsx(Y,{...l}),e.jsx(Y,{...n}),e.jsx(Y,{...r})]})]})}function Y({value:t,caption:l,sub:n}){return e.jsxs("div",{style:{flex:1,minWidth:0,display:"flex",flexDirection:"column",gap:8},children:[e.jsx("span",{style:{fontFamily:d,fontSize:22,fontWeight:500,color:i.muted,letterSpacing:"-0.01em",lineHeight:1.1},children:t}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4},children:[e.jsx("span",{style:{fontFamily:d,fontSize:12,color:i.ink,lineHeight:1.2},children:l}),n&&e.jsx("span",{style:{fontFamily:d,fontSize:12,color:i.neutral600,lineHeight:1.2},children:n})]})]})}function Ae({value:t,options:l=[],onChange:n}){const[r,s]=z.useState(!1),p=z.useRef(null),u=z.useRef(null);z.useEffect(()=>{if(!r)return;const a=x=>{var f,m;(f=u.current)!=null&&f.contains(x.target)||(m=p.current)!=null&&m.contains(x.target)||s(!1)};return document.addEventListener("mousedown",a),()=>document.removeEventListener("mousedown",a)},[r]);const h=l.find(a=>a.id===t)||l[0];return e.jsxs("div",{style:{position:"relative"},children:[e.jsxs("button",{type:"button",ref:p,onClick:()=>s(a=>!a),"aria-haspopup":"listbox","aria-expanded":r,style:{display:"inline-flex",alignItems:"center",gap:6,height:24,padding:"0 8px 0 0",background:"transparent",border:"none",cursor:"pointer",fontFamily:d,fontSize:12,color:i.ink},children:[h==null?void 0:h.label,e.jsx($.ChevronDown,{size:14,strokeWidth:1.75,style:{transform:r?"rotate(180deg)":"none",transition:"transform 120ms ease"}})]}),r&&e.jsx("div",{ref:u,role:"listbox",style:{position:"absolute",top:28,right:0,zIndex:30,background:i.white,border:`1px solid ${i.border}`,borderRadius:8,boxShadow:"0 8px 24px rgba(11, 11, 11, 0.12)",minWidth:200,padding:4,fontFamily:d},children:l.map(a=>{const x=a.id===t;return e.jsxs("button",{type:"button",role:"option","aria-selected":x,onClick:()=>{n==null||n(a.id),s(!1)},style:{display:"flex",alignItems:"center",gap:8,width:"100%",padding:"8px 10px",border:"none",background:x?i.borderSubtle:"transparent",cursor:"pointer",textAlign:"left",fontFamily:d,fontSize:13,color:i.ink,borderRadius:6},children:[x?e.jsx($.Check,{size:16,color:i.ink,strokeWidth:1.75}):e.jsx("span",{style:{width:16}}),e.jsx("span",{children:a.label})]},a.id)})})]})}function Ce({currentSeries:t=[],previousSeries:l=[],yLabels:n=[],height:r=176,showPrevious:s=!0,legendCurrentLabel:p="",legendPreviousLabel:u=""}){const h=r-8,a=32,x=8,f=1080,m=f-a-x,S=[...t,...s?l:[]];if(!(S.length>0))return e.jsx("div",{style:{height:r,display:"flex",alignItems:"center",justifyContent:"center",fontFamily:d,fontSize:12,color:i.muted},children:"No data"});const L=Math.min(...S,0),D=Math.max(...S,1),P=D-L||1,N=o=>12+(D-o)/P*(h-24),R=o=>{if(!o.length)return"";const b=o.length>1?m/(o.length-1):0;return o.map((w,v)=>`${v===0?"M":"L"}${a+v*b},${N(w)}`).join(" ")},I=R(t),F=s?R(l):"",W=o=>o.map((b,w)=>{const v=o.length>1?m/(o.length-1):0;return{x:a+w*v,y:N(b)}});return e.jsxs("div",{style:{width:"100%"},children:[e.jsxs("svg",{width:"100%",height:r,viewBox:`0 0 ${f} ${r}`,preserveAspectRatio:"none",children:[n.map((o,b)=>{const w=12+b/Math.max(1,n.length-1)*(h-24);return e.jsx("text",{x:0,y:w+3,fontFamily:d,fontSize:"10",fill:i.neutral800,children:o},o+b)}),e.jsx("line",{x1:a,y1:h,x2:f-x,y2:h,stroke:i.border,strokeWidth:"1"}),e.jsx("line",{x1:a,y1:12,x2:f-x,y2:12,stroke:i.borderSubtle,strokeDasharray:"2 4",strokeWidth:"1"}),F&&e.jsx("path",{d:F,stroke:i.neutral400,strokeWidth:"1.5",strokeDasharray:"4 4",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"}),I&&e.jsx("path",{d:I,stroke:i.black,strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"}),s&&W(l).map((o,b)=>e.jsx("circle",{cx:o.x,cy:o.y,r:3,fill:i.white,stroke:i.neutral400,strokeWidth:"1.5"},`prev-${b}`)),W(t).map((o,b)=>e.jsx("circle",{cx:o.x,cy:o.y,r:3,fill:i.white,stroke:i.black,strokeWidth:"1.5"},`cur-${b}`))]}),(p||s&&u)&&e.jsxs("div",{style:{display:"flex",justifyContent:"center",gap:24,marginTop:8,fontFamily:d,fontSize:11,color:i.ink},children:[p&&e.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:6},children:[e.jsx("span",{style:{width:20,height:0,borderTop:`2px solid ${i.black}`}}),p]}),s&&u&&e.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:6},children:[e.jsx("span",{style:{width:20,height:0,borderTop:`2px dashed ${i.neutral400}`}}),u]})]})]})}function le({icon:t,title:l,count:n}){return e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:16,width:"100%",paddingBottom:16,borderBottom:`1px solid ${i.border}`},children:[e.jsx("div",{style:{width:34,height:34,borderRadius:9999,background:"#F3F7F7",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:e.jsx(t,{size:20,color:i.ink,strokeWidth:1.75})}),e.jsx("span",{style:{flex:1,fontFamily:d,fontWeight:700,fontSize:16,color:i.ink,lineHeight:1.2},children:l}),n!=null&&n!==""&&e.jsx("span",{style:{fontFamily:d,fontSize:13,color:i.muted},children:n})]})}function ne({label:t,value:l}){return e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"10px 0",borderBottom:`1px solid ${i.border}`,fontFamily:d,fontSize:13,lineHeight:1.4,gap:16},children:[e.jsx("span",{style:{color:i.ink,minWidth:0,overflow:"hidden",textOverflow:"ellipsis"},children:t}),e.jsx("span",{style:{color:i.muted,whiteSpace:"nowrap"},children:l})]})}function re({items:t=[]}){if(!t.length)return e.jsx("div",{style:{padding:"12px 0",fontFamily:d,fontSize:13,color:i.muted},children:"No items available."});const l=Math.ceil(t.length/2),n=t.slice(0,l),r=t.slice(l);return e.jsxs("div",{style:{display:"flex",gap:24},children:[e.jsx("div",{style:{flex:1,display:"flex",flexDirection:"column"},children:n.map((s,p)=>e.jsx(ne,{...s},`l-${p}`))}),e.jsx("div",{style:{flex:1,display:"flex",flexDirection:"column"},children:r.map((s,p)=>e.jsx(ne,{...s},`r-${p}`))})]})}function Ne({value:t=0,max:l=5}){const n=typeof t=="number"?t:parseFloat(t)||0,r=Math.floor(n),s=n%1>0&&r<l;return e.jsx("div",{style:{display:"inline-flex",gap:4},children:Array.from({length:l}).map((p,u)=>u<r?e.jsx("span",{style:{width:10,height:10,borderRadius:"50%",background:i.black}},u):u===r&&s?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}})},u):e.jsx("span",{style:{width:10,height:10,borderRadius:"50%",background:i.white,border:`1px solid ${i.border}`,boxSizing:"border-box"}},u))})}const ae=[{id:"agent",label:"Agent",width:250,sortable:!0,filterable:!0},{id:"fireCount",label:"Fire Count",width:174,sortable:!0,filterable:!0,filterType:"number"},{id:"totalCalls",label:"Total Calls",width:181,sortable:!0,filterable:!0,filterType:"number"},{id:"rate",label:"Rate",width:183,sortable:!0,filterable:!0,filterType:"number"},{id:"avgStrength",label:"Avg Strength",width:172,sortable:!0,filterable:!0,filterType:"number"}],de=[{id:"dateTime",label:"Date & Time",width:212,sortable:!0},{id:"agent",label:"Agent",width:224,sortable:!0,filterable:!0},{id:"title",label:"Title",width:298,sortable:!0,filterable:!0},{id:"strength",label:"Strength",width:172,sortable:!0,filterable:!0,filterType:"number"},{id:"compass",label:"Compass Score",width:183,sortable:!0,filterable:!0,filterType:"number",render:t=>{const l=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(Ne,{value:l})]})}}];function ce({className:t="",signalName:l="",signalSubtitle:n="",onBack:r,dateRangeLabel:s="",rangeOptions:p=Ie,selectedWindow:u="30d",onWindowChange:h,dateRangePicker:a,dateRange:x,onDateRangeChange:f,onExport:m,fireRateStat:S={value:"",delta:"",label:""},fireCountStat:C={value:"",delta:"",label:""},outcomeCorrelation:L={title:"",present:{value:"",caption:"",sub:""},absent:{value:"",caption:"",sub:""},impact:{value:"",caption:"",sub:""}},chartTitle:D="",chartLegendCurrentLabel:P="",chartLegendPreviousLabel:N="",chartYLabels:R=[],fireRateTrend:I={currentSeries:[],previousSeries:[]},chartViewOptions:F=[],chartView:W,onChartViewChange:o,agentBreakdownRows:b=[],agentBreakdownColumns:w=ae,agentBreakdownTitle:v="",onAgentClick:B,onAgentBreakdownVisibleColumnsChange:k,agentBreakdownInitialPageSize:M=10,coOccurringTitle:_="",coOccurringItems:V=[],evidenceTitle:H="",evidenceItems:O=[],recentInteractions:j=[],recentInteractionColumns:U=de,recentInteractionsTitle:q="",onInteractionClick:K,onRecentInteractionsVisibleColumnsChange:y,recentInteractionsInitialPageSize:xe=10,agentBreakdownTotal:fe=null,agentBreakdownPage:he=null,agentBreakdownPageSize:be=null,onAgentBreakdownPageChange:ye,onAgentBreakdownPageSizeChange:ge,recentInteractionsTotal:me=null,recentInteractionsPage:je=null,recentInteractionsPageSize:ke=null,onRecentInteractionsPageChange:Se,onRecentInteractionsPageSizeChange:Fe}){var te;const[we,Z]=z.useState(null),T=x!==void 0?x:we,J=!!(T!=null&&T.from&&(T!=null&&T.to)),ve=g=>{Z(g),f==null||f(g)},Te=g=>{Z(null),f==null||f(null),h==null||h(g)},Q=J?`${E.formatLocalDate(T.from)} – ${E.formatLocalDate(T.to)}`:E.computeWindowLabel(u)||s,[ze,Le]=z.useState(W??((te=F[0])==null?void 0:te.id)??null),ee=o?W:ze,Ee=g=>{o||Le(g),o==null||o(g)},G=F.find(g=>g.id===ee),De=(G==null?void 0:G.showPrevious)===void 0?!0:!!G.showPrevious;return e.jsxs("div",{className:t,style:{background:i.white,fontFamily:d,color:i.ink,width:"100%",minWidth:1192,boxSizing:"border-box",padding:"12px 32px 32px",display:"flex",flexDirection:"column",gap:24},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:16,paddingTop:12,flexWrap:"wrap"},children:[e.jsx("button",{type:"button","aria-label":"Back",onClick:r,style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:24,height:24,background:"transparent",border:"none",cursor:"pointer",color:i.ink,padding:0,flexShrink:0},children:e.jsx($.ArrowLeft,{size:20,strokeWidth:1.75})}),e.jsxs("div",{style:{flex:1,minWidth:0,display:"flex",flexDirection:"column",gap:4,paddingLeft:16,borderLeft:`1px solid ${i.border}`,alignSelf:"stretch",justifyContent:"center"},children:[e.jsx("h1",{style:{fontFamily:d,fontSize:22,fontWeight:500,color:i.ink,margin:0,lineHeight:1.2,letterSpacing:"-0.01em",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:l}),n&&e.jsx("span",{style:{fontFamily:d,fontSize:12,color:i.muted,lineHeight:1.2},children:n})]}),e.jsxs("div",{style:{display:"flex",gap:10,alignItems:"center",flexWrap:"wrap"},children:[Q&&e.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:6,fontFamily:d,fontSize:13,color:i.ink,marginRight:6,whiteSpace:"nowrap"},children:[e.jsx($.CalendarDays,{size:16,strokeWidth:1.75,color:i.muted}),Q]}),p.map(g=>e.jsx(We,{label:g.label,active:!J&&g.id===u,onClick:()=>Te(g.id)},g.id)),a||e.jsx(E.DateRangeButton,{value:T,onChange:ve})]})]}),e.jsxs("div",{style:{display:"flex",gap:24,alignItems:"stretch"},children:[e.jsx(ie,{value:S.value,delta:S.delta,label:S.label,style:{width:272,flexShrink:0}}),e.jsx(ie,{value:C.value,delta:C.delta,label:C.label,style:{width:272,flexShrink:0}}),e.jsx($e,{title:L.title,present:L.present,absent:L.absent,impact:L.impact})]}),e.jsxs("div",{style:{background:i.white,border:`1px solid ${i.border}`,borderRadius:8,padding:24,display:"flex",flexDirection:"column",gap:16},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12},children:[e.jsx("span",{style:{flex:1,fontFamily:d,fontSize:14,fontWeight:500,color:i.ink,lineHeight:1.2},children:D}),F.length>0&&e.jsx(Ae,{value:ee,options:F,onChange:Ee})]}),e.jsx(Ce,{currentSeries:I.currentSeries||[],previousSeries:I.previousSeries||[],yLabels:R,showPrevious:De,legendCurrentLabel:P,legendPreviousLabel:N})]}),e.jsxs("div",{style:{position:"relative"},children:[v&&e.jsx("span",{style:{position:"absolute",top:14,left:4,zIndex:40,fontFamily:d,fontSize:20,fontWeight:500,color:i.ink,lineHeight:1.2,letterSpacing:"-0.01em",pointerEvents:"none"},children:v}),e.jsx(X.DataTable2,{data:b,columns:w,initialPageSize:M,onRowClick:B,onVisibleColumnsChange:k,totalCount:fe,page:he,pageSize:be,onPageChange:ye,onPageSizeChange:ge})]}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:16},children:[e.jsx(le,{icon:$.Share2,title:_}),e.jsx(re,{items:V})]}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:16},children:[e.jsx(le,{icon:$.FileText,title:H}),e.jsx(re,{items:O})]}),e.jsxs("div",{style:{position:"relative"},children:[q&&e.jsx("span",{style:{position:"absolute",top:14,left:0,zIndex:40,fontFamily:d,fontSize:20,fontWeight:600,color:i.ink,lineHeight:1.2,letterSpacing:"-0.01em",pointerEvents:"none"},children:q}),e.jsx(X.DataTable2,{data:j,columns:U,initialPageSize:xe,onRowClick:K,onVisibleColumnsChange:y,totalCount:me,page:je,pageSize:ke,onPageChange:Se,onPageSizeChange:Fe})]})]})}const se={value:"",label:"",trend:"up"},c={ink:"#2E3236",muted:"#808183",border:"#D9D9D9",borderSubtle:"#E6E6E6",black:"#0B0B0B",white:"#FFFFFF",neutralBorder:"#BFBFBF",neutralLight:"#E6E6E6",neutral600:"#676767",neutral400:"#989898",fillTrack:"#EFEFEF"},A="var(--font-sans, 'Averta', ui-sans-serif, system-ui, sans-serif)";function Re({trend:t="up",width:l=49.618,height:n=35}){const r=z.useId(),s="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",p="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:l,height:n,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-${r}`,x1:"9.96776",y1:"16.2053",x2:"9.96776",y2:"36.0002",gradientUnits:"userSpaceOnUse",children:[e.jsx("stop",{stopColor:c.ink}),e.jsx("stop",{offset:"1",stopColor:c.white,stopOpacity:"0.01"})]})}),e.jsx("path",{d:p,fill:`url(#spark-${r})`,fillRule:"evenodd",clipRule:"evenodd",opacity:"0.1"}),e.jsx("path",{d:s,stroke:c.ink,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeDasharray:t==="down"?"2 4":void 0})]})}function ue({direction:t="up",color:l=c.muted,size:n=18}){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:n,height:n*9.5/18,viewBox:"0 0 19 10",fill:"none",style:{flexShrink:0},children:e.jsx("path",{d:t==="up"?r:s,stroke:l,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function oe({value:t,label:l,trend:n="up",style:r={}}){return e.jsxs("div",{style:{background:c.white,border:`1px solid ${c.border}`,borderRadius:8,padding:16,display:"flex",flexDirection:"column",gap:8,boxSizing:"border-box",...r},children:[e.jsxs("div",{style:{display:"flex",alignItems:"flex-start",justifyContent:"space-between"},children:[e.jsx(Re,{trend:n}),e.jsx(ue,{direction:n})]}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8,marginTop:8},children:[e.jsx("div",{style:{fontFamily:A,fontSize:28,fontWeight:500,lineHeight:"1.2",color:c.ink,letterSpacing:"-0.01em"},children:t}),e.jsx("div",{style:{fontFamily:A,fontSize:13,color:c.ink,lineHeight:"1.2"},children:l})]})]})}function Pe({label:t,active:l=!1,onClick:n}){return e.jsx("button",{type:"button",onClick:n,style:{height:32,minWidth:31,padding:"0 12px",borderRadius:10,border:l?"none":`1px solid ${c.borderSubtle}`,background:l?c.black:c.white,color:l?c.white:c.black,fontFamily:A,fontSize:14,cursor:"pointer"},children:t})}const Be=[{id:"8h",label:"8h"},{id:"1d",label:"1d"},{id:"7d",label:"7d"},{id:"30d",label:"30d"}];function Me({value:t}){const l=typeof t=="number"?t:parseFloat(String(t??"").replace("%",""))||0,n=Math.max(0,Math.min(100,l));return e.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:12,width:"100%"},children:[e.jsxs("span",{style:{minWidth:32,color:c.ink,fontVariantNumeric:"tabular-nums"},children:[n,"%"]}),e.jsx("span",{style:{flex:1,height:4,background:c.fillTrack,borderRadius:2,overflow:"hidden",minWidth:40,maxWidth:80},children:e.jsx("span",{style:{display:"block",width:`${n}%`,height:"100%",background:c.black,borderRadius:2}})})]})}function _e({value:t}){if(t==null||t==="")return null;const l=typeof t=="number"?t:parseFloat(String(t).replace(/[^-\d.]/g,"")),n=Number.isFinite(l),r=!n||l>=0,s=typeof t=="string"?t:n?`${l>=0?"+":""}${l.toFixed(1)}`:String(t);return e.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:6},children:[e.jsx(ue,{direction:r?"up":"down",color:c.ink,size:16}),e.jsx("span",{style:{fontVariantNumeric:"tabular-nums"},children:s})]})}function He({value:t}){if(t==null||t==="")return null;const l=typeof t=="number"?t:parseFloat(String(t).replace(/[^-\d.]/g,""));if(!Number.isFinite(l))return e.jsx("span",{children:String(t)});const n=l>=0?"+":"",r=typeof t=="string"&&/^[+-]/.test(t)?t:`${n}${l}`;return e.jsx("span",{style:{fontVariantNumeric:"tabular-nums"},children:r})}const pe=[{id:"signal",label:"Signals",width:250,sortable:!0,filterable:!0},{id:"fireRate",label:"Fire Rate",width:140,sortable:!0,filterable:!0,filterType:"number",render:t=>e.jsx(Me,{value:t})},{id:"fires",label:"Fires",width:140,sortable:!0,filterable:!0,filterType:"number"},{id:"delta",label:"Delta",width:140,sortable:!0,filterable:!0,filterType:"number",render:t=>e.jsx(_e,{value:t})},{id:"avgStrength",label:"Avg Strength",width:140,sortable:!0,filterable:!0,filterType:"number"},{id:"compass",label:"Agent Lift",width:140,sortable:!0,filterable:!0,filterType:"number",render:t=>e.jsx(He,{value:t})},{id:"topAgent",label:"Top Agent",width:178,sortable:!0,filterable:!0}];function Oe({className:t="",title:l="",dateRangeLabel:n="",totalInteractionsStat:r=se,activeSignalsStat:s=se,activeSignalsHeading:p="",rangeOptions:u=Be,selectedWindow:h="30d",onWindowChange:a,dateRangePicker:x,dateRange:f,onDateRangeChange:m,signals:S=[],signalColumns:C=pe,initialPageSize:L=10,onSignalClick:D,onVisibleColumnsChange:P,signalsTotal:N=null,signalsPage:R=null,signalsPageSize:I=null,onSignalsPageChange:F,onSignalsPageSizeChange:W,onExport:o,fireRateStatLabel:b="",fireCountStatLabel:w=""}){const[v,B]=z.useState(null),k=f!==void 0?f:v,M=!!(k!=null&&k.from&&(k!=null&&k.to)),_=y=>{B(y),m==null||m(y)},V=y=>{B(null),m==null||m(null),a==null||a(y)},H=p||(s.value!==""&&s.value!=null?`${s.value} ${s.label||""}`.trim():""),O=M?`${E.formatLocalDate(k.from)} – ${E.formatLocalDate(k.to)}`:E.computeWindowLabel(h)||n,[j,U]=z.useState(null),q=y=>{if(D){D(y);return}U(y)},K=j?{signalName:j.signal??"",fireRateStat:{value:j.fireRate!=null&&j.fireRate!==""?`${j.fireRate}%`:"",delta:j.delta??"",label:b},fireCountStat:{value:typeof j.fires=="number"?j.fires.toLocaleString():j.fires??"",delta:"",label:w},selectedWindow:h,onWindowChange:a,dateRange:k,onDateRangeChange:_,rangeOptions:u,dateRangePicker:x,onExport:o}:null;return e.jsxs(e.Fragment,{children:[j&&e.jsx(ce,{className:t,...K,onBack:()=>U(null)}),e.jsxs("div",{className:t,style:{background:c.white,fontFamily:A,color:c.ink,width:"100%",minWidth:1192,boxSizing:"border-box",padding:"12px 32px 32px",flexDirection:"column",gap:24,display:j?"none":"flex"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:16,paddingTop:12,flexWrap:"wrap"},children:[e.jsx("h1",{style:{fontFamily:A,fontSize:24,fontWeight:500,color:c.ink,margin:0,lineHeight:"1.2",letterSpacing:"-0.01em",flex:1,minWidth:0},children:l}),e.jsxs("div",{style:{display:"flex",gap:10,alignItems:"center",flexWrap:"wrap"},children:[O&&e.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:6,fontFamily:A,fontSize:13,color:c.ink,marginRight:6,whiteSpace:"nowrap"},children:[e.jsx($.CalendarDays,{size:16,strokeWidth:1.75,color:c.muted}),O]}),u.map(y=>e.jsx(Pe,{label:y.label,active:!M&&y.id===h,onClick:()=>V(y.id)},y.id)),x||e.jsx(E.DateRangeButton,{value:k,onChange:_})]})]}),e.jsxs("div",{style:{display:"flex",gap:24},children:[e.jsx(oe,{value:r.value,label:r.label,trend:r.trend,style:{width:264,flexShrink:0}}),e.jsx(oe,{value:s.value,label:s.label,trend:s.trend,style:{width:264,flexShrink:0}})]}),e.jsxs("div",{style:{position:"relative",paddingTop:8,borderTop:`1px solid ${c.border}`},children:[H&&e.jsx("span",{style:{position:"absolute",top:24,left:0,zIndex:40,fontFamily:A,fontSize:14,color:c.ink,fontWeight:500,lineHeight:1.2,pointerEvents:"none"},children:H}),e.jsx(X.DataTable2,{data:S,columns:C,initialPageSize:L,onRowClick:q,onVisibleColumnsChange:P,totalCount:N,page:R,pageSize:I,onPageChange:F,onPageSizeChange:W})]})]})]})}exports.DEFAULT_AGENT_BREAKDOWN_COLUMNS=ae;exports.DEFAULT_RECENT_INTERACTION_COLUMNS=de;exports.DEFAULT_SIGNAL_COLUMNS=pe;exports.SignalDetailsPage=ce;exports.SignalsListPage=Oe;
2
2
  //# sourceMappingURL=Signals.cjs.js.map