{"version":3,"sources":["../call-control-sdk/lib/pages/managementDashboard/index.tsx","../call-control-sdk/lib/pages/managementDashboard/useManagementDashboard.ts"],"sourcesContent":["import React, { useState, useEffect, useCallback, useMemo, useRef } from \"react\";\r\nimport {\r\n\tBox, Paper, Stack, Typography, CircularProgress, Alert,\r\n\tTable, TableBody, TableCell, TableContainer, TableHead, TableRow,\r\n\tTextField, InputAdornment, Chip,\r\n} from \"@mui/material\";\r\nimport dayjs, { Dayjs } from \"dayjs\";\r\nimport { LocalizationProvider } from \"@mui/x-date-pickers/LocalizationProvider\";\r\nimport { AdapterDayjs } from \"@mui/x-date-pickers/AdapterDayjs\";\r\nimport {\r\n\tComposedChart, Bar, Line, XAxis, YAxis, CartesianGrid,\r\n\tTooltip as RTooltip, ResponsiveContainer,\r\n} from \"recharts\";\r\n\r\nimport SearchIcon from \"@mui/icons-material/Search\";\r\nimport FileDownloadIcon from \"@mui/icons-material/FileDownload\";\r\nimport RefreshIcon from \"@mui/icons-material/Refresh\";\r\nimport SouthEastIcon from \"@mui/icons-material/SouthEast\";\r\nimport NorthEastIcon from \"@mui/icons-material/NorthEast\";\r\nimport PhoneMissedIcon from \"@mui/icons-material/PhoneMissed\";\r\n\r\nimport PageHeader from \"../common/components/PageHeader\";\r\nimport ReportFilterBar, { type QuickRange } from \"../common/components/ReportFilterBar\";\r\nimport AppButton from \"../common/components/AppButton\";\r\nimport { headCellSx as sharedHeadSx } from \"../common/utils/tableStyles\";\r\nimport { SDKProvider } from \"../../components/SDKProvider\";\r\nimport { getManagementDashboard } from \"./useManagementDashboard\";\r\nimport type { MgmtDashboardResponse, SourceStats } from \"./types\";\r\nimport { useNumberMask } from \"../../utils/numberMask\";\r\nimport { useGetAuthorizationToken } from \"../../hooks/useGetAuthorizationToken\";\r\n\r\n/* ═══════════════════════ COLORS (brand teal — see ThemeContext #1A5F6C) ═══════════════════════ */\r\nconst C = {\r\n\tnavy: \"#14505b\", blue: \"#1A5F6C\", green: \"#00A550\", amber: \"#C47C00\",\r\n\tred: \"#F05A22\", teal: \"#1A5F6C\",\r\n\tsurface: \"#fff\", s2: \"#f5f9fa\", s3: \"#e7f1f2\",\r\n\tb1: \"rgba(26,95,108,.08)\", b2: \"rgba(26,95,108,.16)\",\r\n\tt1: \"#1a2e33\", t2: \"#3d5a60\", t3: \"#6b8a90\",\r\n\tblt: \"#e3f1f3\", glt: \"#e4f6ef\", alt: \"#fdf3e0\", rlt: \"#fdeae3\", tlt: \"#e3f1f3\",\r\n};\r\n\r\n/* ═══════════════════════ STYLES ═══════════════════════ */\r\nconst headSx = { ...sharedHeadSx as object, py: 1, px: 1.5 };\r\nconst cellSx = { fontSize: 12, py: 0.8, px: 1.5, borderBottom: `1px solid ${C.b1}` };\r\nconst monoSx = { fontFamily: \"'JetBrains Mono', monospace\", fontSize: 12, fontWeight: 700 };\r\nconst labelSx = { fontSize: 11, fontWeight: 700, letterSpacing: 0.7, textTransform: \"uppercase\" as const, color: C.t2, textAlign: \"center\" as const, lineHeight: 1.2 };\r\nconst cardPaper = { background: C.surface, border: `1px solid #dce3ef`, borderRadius: \"6px\", overflow: \"hidden\", boxShadow: \"0 1px 4px rgba(0,0,0,.09)\" };\r\nconst cardHeader = { px: 1.5, py: 1, minHeight: 36, background: C.s2, borderBottom: `1px solid ${C.b1}`, display: \"flex\", alignItems: \"center\", justifyContent: \"center\" };\r\nconst numIconSx = { fontSize: { xs: 28, lg: 24, xl: 28 }, color: C.blue };\r\nconst bigNumSx = { fontFamily: \"'Barlow Condensed', sans-serif\", fontSize: { xs: 32, lg: 26, xl: 32 }, fontWeight: 800, color: C.navy, lineHeight: 1 };\r\n/* The direction arrow sits above the headline, so it stays smaller than the number. */\r\nconst trendIconSx = { fontSize: { xs: 22, lg: 19, xl: 22 }, color: C.blue };\r\nconst cellLabelSx = { fontSize: 10, fontWeight: 700, letterSpacing: 0.5, color: C.t3, mb: 0.3, lineHeight: 1.2 };\r\n\r\n/* ═══════════════════════ EMPTY STATE ═══════════════════════ */\r\n/* Also the stand-in when the response omits `unique_abandoned` altogether. */\r\nconst EMPTY_UNIQUE_ABANDONED = {\r\n\tunique_total: 0,\r\n\tof_abandoned_calls: 0,\r\n\tavg_callback_duration: \"00:00:00\",\r\n\tqueue: { total: 0, called_back: 0, to_call: 0, called_back_pct: 0, to_call_pct: 0 },\r\n\tivr:   { total: 0, called_back: 0, to_call: 0, called_back_pct: 0, to_call_pct: 0 },\r\n};\r\n\r\nconst EMPTY: MgmtDashboardResponse = {\r\n\tinbound:  { total: 0, answered: 0, unanswered: 0, answered_pct: 0, unanswered_pct: 0 },\r\n\toutbound: { total: 0, answered: 0, unanswered: 0, answered_pct: 0, unanswered_pct: 0 },\r\n\ttotals:   { total_calls: 0, total_answered: 0, highest_duration: \"00:00:00\", lowest_duration: \"00:00:00\", calls_lt_30sec: 0, avg_inbound_duration: \"00:00:00\", avg_outbound_duration: \"00:00:00\" },\r\n\tabandoned:{ total: 0, called_back: 0, to_call: 0, called_back_pct: 0, to_call_pct: 0, avg_callback_duration: \"00:00:00\" },\r\n\tivr:      { total: 0, called_back: 0, to_call: 0, called_back_pct: 0, to_call_pct: 0 },\r\n\tunique_abandoned: EMPTY_UNIQUE_ABANDONED,\r\n\twaiting:  { avg_wait_time: \"00:00:00\", avg_lang_selection: \"00:00:00\", avg_queue_wait: \"00:00:00\" },\r\n\tcht:      [],\r\n\tqueue_calls:    [],\r\n\thourly_chart:   [],\r\n\trepeated_calls: [],\r\n};\r\n\r\n/* ═══════════════════════ SUB-COMPONENTS ═══════════════════════ */\r\n\r\n/* A count and its share of the card's headline. `null` renders the placeholder dash for\r\n\tfigures the API does not report yet (unique patients, outbound callback follow-up). */\r\ntype Split = Readonly<{ label: string; value: number | null; pct: number | null }>;\r\n\r\n/* `unique_abandoned` is optional on the response (older platform builds omit it), so the card\r\n\ttakes the non-optional shape and the call site falls back to the zeroed block above. */\r\ntype AbandonFollowUpBlock = NonNullable<MgmtDashboardResponse[\"unique_abandoned\"]>;\r\n\r\nconst splitValue = (v: number | null) => (v === null ? \"—\" : v.toLocaleString());\r\nconst splitPct   = (p: number | null) => (p === null ? \"—\" : `${p.toFixed(1)}%`);\r\n\r\n/* Stand-in for a share the API omits. Every `*_pct` the response carries is used as sent —\r\n\tthis only fills the gap when a platform build predates one of those fields. */\r\nconst pctOf = (n: number, of: number) => (of ? (100 * n) / of : 0);\r\n\r\n/* One row of a source breakdown: the source's own total and its answered / unanswered split. */\r\ntype SourceRow = Readonly<{ label: string } & SourceStats>;\r\n\r\n/* Headline: direction arrow, the count, then what the count is. Under it the answered /\r\n\tdropped split, and on a tinted footer the breakdown of the dropped bucket. */\r\nfunction DirectionCard({ title, icon, total, totalLabel, cells, footer, sources }: Readonly<{\r\n\ttitle: string;\r\n\ticon: React.ReactNode;\r\n\ttotal: number;\r\n\ttotalLabel: string;\r\n\tcells: Split[];\r\n\t/* Breakdown of the dropped bucket. Omitted entirely when the API reports no split for it\r\n\t\t— `bar` draws the rows' shares as one stacked bar. */\r\n\tfooter?: { title: string; rows: Split[]; bar?: boolean };\r\n\t/* Breakdown of the whole headline by source, each with its own answered / unanswered split. */\r\n\tsources?: SourceRow[];\r\n}>) {\r\n\treturn (\r\n\t\t<Paper sx={{ ...cardPaper, display: \"flex\", flexDirection: \"column\" }}>\r\n\t\t\t<Box sx={cardHeader}>\r\n\t\t\t\t<Typography sx={labelSx}>{title}</Typography>\r\n\t\t\t</Box>\r\n\t\t\t{/* flex:1 keeps the footers of all four row-1 cards on the same baseline */}\r\n\t\t\t<Box sx={{ p: 1.5, flex: 1 }}>\r\n\t\t\t\t{/* Arrow rides to the left of the count, on the same line. */}\r\n\t\t\t\t<Box sx={{ display: \"flex\", alignItems: \"center\", justifyContent: \"center\", gap: 0.8 }}>\r\n\t\t\t\t\t{icon}\r\n\t\t\t\t\t<Typography sx={bigNumSx}>{total.toLocaleString()}</Typography>\r\n\t\t\t\t</Box>\r\n\t\t\t\t<Typography sx={{ ...cellLabelSx, textAlign: \"center\", mt: 0.7, mb: 1.2 }}>{totalLabel}</Typography>\r\n\t\t\t\t<Box sx={{ display: \"grid\", gridTemplateColumns: \"1fr 1fr\", borderTop: `2px solid ${C.s3}`, pt: 1 }}>\r\n\t\t\t\t\t{cells.map(({ label, value, pct }, idx) => (\r\n\t\t\t\t\t\t<Box key={label} sx={{ textAlign: \"center\", px: 0.25, ...(idx === 0 && { borderRight: `1px solid ${C.b1}` }) }}>\r\n\t\t\t\t\t\t\t<Box sx={{ display: \"flex\", alignItems: \"baseline\", justifyContent: \"center\", gap: 0.6 }}>\r\n\t\t\t\t\t\t\t\t<Typography sx={{ fontSize: 15, fontWeight: 700, color: C.blue }}>{splitValue(value)}</Typography>\r\n\t\t\t\t\t\t\t\t<Typography sx={{ fontSize: 12, fontWeight: 600, color: C.blue }}>{splitPct(pct)}</Typography>\r\n\t\t\t\t\t\t\t</Box>\r\n\t\t\t\t\t\t\t<Typography sx={{ ...cellLabelSx, mb: 0, mt: 0.4 }}>{label}</Typography>\r\n\t\t\t\t\t\t</Box>\r\n\t\t\t\t\t))}\r\n\t\t\t\t</Box>\r\n\t\t\t\t{/* Side-by-side cells under a divider, like the Summary card's highest / lowest row. */}\r\n\t\t\t\t{sources && (\r\n\t\t\t\t\t<Box sx={{ display: \"grid\", gridTemplateColumns: `repeat(${sources.length}, 1fr)`, borderTop: `1px solid ${C.b1}`, mt: 0.8, pt: 0.8 }}>\r\n\t\t\t\t\t\t{sources.map((r, idx) => (\r\n\t\t\t\t\t\t\t<Box key={r.label} sx={{ textAlign: \"center\", px: 0.25, ...(idx < sources.length - 1 && { borderRight: `1px solid ${C.b1}` }) }}>\r\n\t\t\t\t\t\t\t\t<Typography sx={cellLabelSx}>{r.label.toUpperCase()}</Typography>\r\n\t\t\t\t\t\t\t\t<Typography sx={{ fontSize: 15, fontWeight: 700, color: C.navy, lineHeight: 1.2 }}>{r.total.toLocaleString()}</Typography>\r\n\t\t\t\t\t\t\t\t{[\r\n\t\t\t\t\t\t\t\t\t{ label: \"Ans\",   value: r.answered,   pct: r.answered_pct },\r\n\t\t\t\t\t\t\t\t\t{ label: \"Unans\", value: r.unanswered, pct: r.unanswered_pct },\r\n\t\t\t\t\t\t\t\t].map(({ label, value, pct }) => (\r\n\t\t\t\t\t\t\t\t\t<Box key={label} sx={{ display: \"flex\", alignItems: \"baseline\", justifyContent: \"center\", gap: 0.5, mt: 0.3 }}>\r\n\t\t\t\t\t\t\t\t\t\t<Typography sx={{ fontSize: 10, fontWeight: 600, color: C.t3 }}>{label}</Typography>\r\n\t\t\t\t\t\t\t\t\t\t<Typography sx={{ fontSize: 12, fontWeight: 700, color: C.blue }}>{splitValue(value)}</Typography>\r\n\t\t\t\t\t\t\t\t\t\t<Typography sx={{ fontSize: 11, fontWeight: 600, color: C.blue }}>{splitPct(pct)}</Typography>\r\n\t\t\t\t\t\t\t\t\t</Box>\r\n\t\t\t\t\t\t\t\t))}\r\n\t\t\t\t\t\t\t</Box>\r\n\t\t\t\t\t\t))}\r\n\t\t\t\t\t</Box>\r\n\t\t\t\t)}\r\n\t\t\t</Box>\r\n\t\t\t{/* Same tint as the card headers, so the breakdown reads as its own zone without colour. */}\r\n\t\t\t{footer && (\r\n\t\t\t<Box sx={{ background: C.s2, borderTop: `1px solid ${C.b1}`, px: 1.5, py: 1.1 }}>\r\n\t\t\t\t<Typography sx={{ ...cellLabelSx, textAlign: \"center\", mb: 0.9 }}>{footer.title}</Typography>\r\n\t\t\t\t{footer.rows.map(({ label, value, pct }, idx) => (\r\n\t\t\t\t\t<Box key={label} sx={{ display: \"flex\", alignItems: \"baseline\", justifyContent: \"center\", gap: 0.9, mb: idx === footer.rows.length - 1 ? 0 : 0.7 }}>\r\n\t\t\t\t\t\t<Typography sx={{ fontSize: 12, fontWeight: 600, color: C.t2 }}>{label}</Typography>\r\n\t\t\t\t\t\t<Typography sx={{ fontSize: 13, fontWeight: 700, color: C.blue }}>{splitValue(value)}</Typography>\r\n\t\t\t\t\t\t<Typography sx={{ fontSize: 12, fontWeight: 600, color: C.blue }}>{splitPct(pct)}</Typography>\r\n\t\t\t\t\t</Box>\r\n\t\t\t\t))}\r\n\t\t\t\t{/* Segments shaded like the Queue Wise Calls bars. */}\r\n\t\t\t\t{footer.bar && (\r\n\t\t\t\t\t<Box sx={{ display: \"flex\", height: 8, mt: 1.1, borderRadius: \"4px\", overflow: \"hidden\", background: C.s3 }}>\r\n\t\t\t\t\t\t{footer.rows.map(({ label, pct }, idx) => (\r\n\t\t\t\t\t\t\t<Box key={label} sx={{ width: `${pct ?? 0}%`, background: idx === 0 ? C.blue : \"#7fb3bd\" }} />\r\n\t\t\t\t\t\t))}\r\n\t\t\t\t\t</Box>\r\n\t\t\t\t)}\r\n\t\t\t</Box>\r\n\t\t\t)}\r\n\t\t</Paper>\r\n\t);\r\n}\r\n\r\n/* Follow-up on the distinct patients behind the abandoned calls, split by where they dropped:\r\n\tqueue vs IVR. Its own `unique_abandoned` block — deduplicated, so these counts are not the\r\n\tcall-level `abandoned` / `ivr` figures the cards above show. */\r\nfunction UniquePatientsCard({ data, avgCallbackDuration }: Readonly<{ data: AbandonFollowUpBlock; avgCallbackDuration: string }>) {\r\n\tconst columns = [\r\n\t\t{ title: \"QUEUE ABANDONED\", stats: data.queue },\r\n\t\t{ title: \"IVR ABANDONED\",   stats: data.ivr },\r\n\t];\r\n\tconst rowsFor = (s: AbandonFollowUpBlock[\"queue\"]): Split[] => [\r\n\t\t{ label: \"Called Back\",      value: s.called_back, pct: s.called_back_pct },\r\n\t\t{ label: \"Yet To Be Called\", value: s.to_call,     pct: s.to_call_pct },\r\n\t];\r\n\treturn (\r\n\t\t<Paper sx={{ ...cardPaper, display: \"flex\", flexDirection: \"column\" }}>\r\n\t\t\t<Box sx={cardHeader}>\r\n\t\t\t\t<Typography sx={labelSx}>Unique Abandoned Patients</Typography>\r\n\t\t\t</Box>\r\n\t\t\t<Box sx={{ p: 1.5, flex: 1 }}>\r\n\t\t\t\t{/* Headline, like the other row-1 cards. Reported as its own field rather than summed\r\n\t\t\t\t\there, since a patient who abandoned in both buckets is one unique patient. */}\r\n\t\t\t\t<Box sx={{ display: \"flex\", justifyContent: \"center\" }}>\r\n\t\t\t\t\t<Typography sx={bigNumSx}>\r\n\t\t\t\t\t\t{(data.unique_total ?? data.queue.total + data.ivr.total).toLocaleString()}\r\n\t\t\t\t\t</Typography>\r\n\t\t\t\t</Box>\r\n\t\t\t\t<Typography sx={{ ...cellLabelSx, textAlign: \"center\", mt: 0.7, mb: 1.2 }}>\r\n\t\t\t\t\tUNIQUE PATIENTS (OF {data.of_abandoned_calls.toLocaleString()} ABANDONED CALLS)\r\n\t\t\t\t</Typography>\r\n\t\t\t\t<Box sx={{ display: \"grid\", gridTemplateColumns: \"1fr 1fr\", borderTop: `2px solid ${C.s3}`, pt: 1 }}>\r\n\t\t\t\t\t{columns.map(({ title, stats }, idx) => (\r\n\t\t\t\t\t\t<Box key={title} sx={{ px: 1, ...(idx === 0 && { borderRight: `1px solid ${C.b1}` }) }}>\r\n\t\t\t\t\t\t\t{/* The bucket's own total sits on the heading; the rows under it split that total\r\n\t\t\t\t\t\t\t\tinto called back vs still to call. */}\r\n\t\t\t\t\t\t\t<Box sx={{ display: \"flex\", alignItems: \"baseline\", justifyContent: \"space-between\", gap: 1, mb: 0.6 }}>\r\n\t\t\t\t\t\t\t\t<Typography sx={{ ...cellLabelSx, mb: 0 }}>{title}</Typography>\r\n\t\t\t\t\t\t\t\t<Typography sx={{ fontSize: 14, fontWeight: 700, color: C.navy, flexShrink: 0 }}>\r\n\t\t\t\t\t\t\t\t\t{stats.total.toLocaleString()}\r\n\t\t\t\t\t\t\t\t</Typography>\r\n\t\t\t\t\t\t\t</Box>\r\n\t\t\t\t\t\t\t{rowsFor(stats).map(({ label, value, pct }) => (\r\n\t\t\t\t\t\t\t\t<Box key={label} sx={{ display: \"flex\", alignItems: \"baseline\", justifyContent: \"space-between\", gap: 1, py: 0.7, borderBottom: `1px solid ${C.b1}` }}>\r\n\t\t\t\t\t\t\t\t\t<Typography sx={{ fontSize: 12, color: C.t2 }}>{label}</Typography>\r\n\t\t\t\t\t\t\t\t\t<Box sx={{ display: \"flex\", alignItems: \"baseline\", gap: 0.6, flexShrink: 0 }}>\r\n\t\t\t\t\t\t\t\t\t\t<Typography sx={{ fontSize: 13, fontWeight: 700, color: C.blue }}>{splitValue(value)}</Typography>\r\n\t\t\t\t\t\t\t\t\t\t<Typography sx={{ fontSize: 12, fontWeight: 600, color: C.blue }}>{splitPct(pct)}</Typography>\r\n\t\t\t\t\t\t\t\t\t</Box>\r\n\t\t\t\t\t\t\t\t</Box>\r\n\t\t\t\t\t\t\t))}\r\n\t\t\t\t\t\t</Box>\r\n\t\t\t\t\t))}\r\n\t\t\t\t</Box>\r\n\t\t\t</Box>\r\n\t\t\t{/* Same tinted footer as the Inbound card, so all row-1 footers share a baseline. */}\r\n\t\t\t<Box sx={{ background: C.s2, borderTop: `1px solid ${C.b1}`, px: 1.5, py: 1.1, textAlign: \"center\" }}>\r\n\t\t\t\t<Typography sx={{ ...cellLabelSx, mb: 0.5 }}>AVERAGE CALLBACK DURATION</Typography>\r\n\t\t\t\t<Typography sx={{ ...monoSx, fontSize: 16, color: C.blue }}>{avgCallbackDuration}</Typography>\r\n\t\t\t</Box>\r\n\t\t</Paper>\r\n\t);\r\n}\r\n\r\n/* Laid out like the direction cards: centered headline, then labelled cells in a 2-up grid. */\r\nfunction SummaryCard({ data }: Readonly<{ data: MgmtDashboardResponse[\"totals\"] }>) {\r\n\treturn (\r\n\t\t<Paper sx={cardPaper}>\r\n\t\t\t<Box sx={cardHeader}>\r\n\t\t\t\t<Typography sx={labelSx}>Summary</Typography>\r\n\t\t\t</Box>\r\n\t\t\t<Box sx={{ p: 1.5 }}>\r\n\t\t\t\t<Box sx={{ display: \"flex\", alignItems: \"baseline\", justifyContent: \"center\", gap: 0.75 }}>\r\n\t\t\t\t\t<Typography sx={bigNumSx}>{data.total_answered.toLocaleString()}</Typography>\r\n\t\t\t\t\t<Typography sx={{ fontSize: 18, color: C.t3 }}>/</Typography>\r\n\t\t\t\t\t<Typography sx={{ ...bigNumSx, color: C.t3 }}>{data.total_calls.toLocaleString()}</Typography>\r\n\t\t\t\t</Box>\r\n\t\t\t\t<Typography sx={{ ...cellLabelSx, textAlign: \"center\", mt: 0.5, mb: 1.2 }}>ANSWERED / TOTAL CALLS (IB + OB)</Typography>\r\n\t\t\t\t<Box sx={{ display: \"grid\", gridTemplateColumns: \"1fr 1fr\", borderTop: `2px solid ${C.s3}`, pt: 1 }}>\r\n\t\t\t\t\t<Box sx={{ textAlign: \"center\", px: 0.25, borderRight: `1px solid ${C.b1}` }}>\r\n\t\t\t\t\t\t<Typography sx={cellLabelSx}>HIGHEST DURATION</Typography>\r\n\t\t\t\t\t\t<Typography sx={{ ...monoSx, fontSize: 14, color: C.blue }}>{data.highest_duration}</Typography>\r\n\t\t\t\t\t</Box>\r\n\t\t\t\t\t<Box sx={{ textAlign: \"center\", px: 0.25 }}>\r\n\t\t\t\t\t\t<Typography sx={cellLabelSx}>LOWEST DURATION</Typography>\r\n\t\t\t\t\t\t<Typography sx={{ ...monoSx, fontSize: 14, color: C.blue }}>{data.lowest_duration}</Typography>\r\n\t\t\t\t\t</Box>\r\n\t\t\t\t\t<Box sx={{ gridColumn: \"1 / -1\", textAlign: \"center\", borderTop: `1px solid ${C.b1}`, mt: 0.8, pt: 0.8 }}>\r\n\t\t\t\t\t\t<Typography sx={cellLabelSx}>CALLS &lt; 30 SEC</Typography>\r\n\t\t\t\t\t\t<Typography sx={{ fontSize: 15, fontWeight: 700, color: C.blue }}>{data.calls_lt_30sec.toLocaleString()}</Typography>\r\n\t\t\t\t\t</Box>\r\n\t\t\t\t</Box>\r\n\t\t\t</Box>\r\n\t\t</Paper>\r\n\t);\r\n}\r\n\r\nfunction QueueCallsCard({ data }: Readonly<{ data: MgmtDashboardResponse[\"queue_calls\"] }>) {\r\n\tconst maxCount = data.reduce((m, q) => Math.max(m, q.call_count), 0) || 1;\r\n\treturn (\r\n\t\t<Paper sx={cardPaper}>\r\n\t\t\t<Box sx={cardHeader}>\r\n\t\t\t\t<Typography sx={labelSx}>Queue Wise Calls</Typography>\r\n\t\t\t</Box>\r\n\t\t\t<Box sx={{ p: 1.5 }}>\r\n\t\t\t\t{data.length === 0 && <Typography sx={{ fontSize: 12, color: C.t3, textAlign: \"center\", py: 2 }}>No data</Typography>}\r\n\t\t\t\t{data.map((q, i) => {\r\n\t\t\t\t\tconst pct = Math.max(6, (q.call_count / maxCount) * 100);\r\n\t\t\t\t\treturn (\r\n\t\t\t\t\t\t<Box key={q.queue_name} sx={{ mb: 0.7, \"&:last-child\": { mb: 0 } }}>\r\n\t\t\t\t\t\t\t<Box sx={{ display: \"flex\", justifyContent: \"space-between\", alignItems: \"center\", mb: 0.3 }}>\r\n\t\t\t\t\t\t\t\t<Typography sx={{ fontSize: 12, fontWeight: 600, color: C.t2 }}>{q.queue_name}</Typography>\r\n\t\t\t\t\t\t\t\t<Typography sx={{ fontSize: 13, fontWeight: 700, color: C.blue }}>{q.call_count}</Typography>\r\n\t\t\t\t\t\t\t</Box>\r\n\t\t\t\t\t\t\t<Box sx={{ height: 6, background: C.s3, borderRadius: 3, overflow: \"hidden\" }}>\r\n\t\t\t\t\t\t\t\t<Box sx={{ height: \"100%\", width: `${pct}%`, background: i === 0 ? C.blue : \"#7fb3bd\", borderRadius: 3 }} />\r\n\t\t\t\t\t\t\t</Box>\r\n\t\t\t\t\t\t</Box>\r\n\t\t\t\t\t);\r\n\t\t\t\t})}\r\n\t\t\t</Box>\r\n\t\t</Paper>\r\n\t);\r\n}\r\n\r\nfunction IvrAbandonedCard({ data }: Readonly<{ data: AbandonFollowUpBlock[\"ivr\"] }>) {\r\n\tconst gridCellSx = { p: 1, textAlign: \"center\" as const, borderTop: `1px solid ${C.b1}` };\r\n\tconst gridLabelSx = { fontSize: 10, fontWeight: 600, color: C.t3, mb: 0.3, lineHeight: 1.2 };\r\n\tconst splitSx = { display: \"flex\", alignItems: \"baseline\", justifyContent: \"center\", gap: 0.5 };\r\n\treturn (\r\n\t\t<Paper sx={cardPaper}>\r\n\t\t\t<Box sx={cardHeader}>\r\n\t\t\t\t<Typography sx={labelSx}>IVR Abandoned</Typography>\r\n\t\t\t</Box>\r\n\t\t\t<Box sx={{ py: 1.1, px: 1 }}>\r\n\t\t\t\t<Box sx={{ display: \"flex\", alignItems: \"center\", justifyContent: \"center\", gap: 1 }}>\r\n\t\t\t\t\t<PhoneMissedIcon sx={numIconSx} />\r\n\t\t\t\t\t<Typography sx={bigNumSx}>{data.total.toLocaleString()}</Typography>\r\n\t\t\t\t</Box>\r\n\t\t\t</Box>\r\n\t\t\t<Box sx={{ display: \"grid\", gridTemplateColumns: \"1fr 1fr\" }}>\r\n\t\t\t\t{[\r\n\t\t\t\t\t{ label: \"Called Back\",       value: data.called_back, pct: data.called_back_pct },\r\n\t\t\t\t\t{ label: \"To be Called Back\", value: data.to_call,     pct: data.to_call_pct },\r\n\t\t\t\t].map(({ label, value, pct }, idx) => (\r\n\t\t\t\t\t<Box key={label} sx={{ ...gridCellSx, ...(idx === 0 && { borderRight: `1px solid ${C.b1}` }) }}>\r\n\t\t\t\t\t\t<Typography sx={gridLabelSx}>{label}</Typography>\r\n\t\t\t\t\t\t<Box sx={splitSx}>\r\n\t\t\t\t\t\t\t<Typography sx={{ fontSize: 15, fontWeight: 700, color: C.blue }}>{value.toLocaleString()}</Typography>\r\n\t\t\t\t\t\t\t<Typography sx={{ fontSize: 11, color: C.t3 }}>|</Typography>\r\n\t\t\t\t\t\t\t<Typography sx={{ fontSize: 12, fontWeight: 600, color: C.blue }}>{pct.toFixed(1)}%</Typography>\r\n\t\t\t\t\t\t</Box>\r\n\t\t\t\t\t</Box>\r\n\t\t\t\t))}\r\n\t\t\t</Box>\r\n\t\t</Paper>\r\n\t);\r\n}\r\n\r\n/* IVR Patients card — commented out per request.\r\nfunction IvrCard({ data }: Readonly<{ data: MgmtDashboardResponse[\"ivr\"] }>) {\r\n\treturn (\r\n\t\t<Paper sx={cardPaper}>\r\n\t\t\t<Box sx={cardHeader}>\r\n\t\t\t\t<Typography sx={labelSx}>IVR Patients</Typography>\r\n\t\t\t</Box>\r\n\t\t\t<Box sx={{ p: 1.5 }}>\r\n\t\t\t\t<Typography sx={{ fontFamily: \"'Barlow Condensed', sans-serif\", fontSize: 30, fontWeight: 800, color: C.navy, lineHeight: 1, mb: 1, textAlign: \"center\" }}>\r\n\t\t\t\t\t{data.total.toLocaleString()}\r\n\t\t\t\t</Typography>\r\n\t\t\t\t<Box sx={{ display: \"grid\", gridTemplateColumns: \"1fr 1fr\", borderTop: `2px solid ${C.s3}`, pt: 1 }}>\r\n\t\t\t\t\t{[\r\n\t\t\t\t\t\t{ label: \"Called Back\", value: data.called_back, pct: data.called_back_pct },\r\n\t\t\t\t\t\t{ label: \"To Be Called\", value: data.to_call, pct: data.to_call_pct },\r\n\t\t\t\t\t].map(({ label, value, pct }, idx) => (\r\n\t\t\t\t\t\t<Box key={label} sx={{ textAlign: \"center\", px: 0.5, ...(idx === 0 && { borderRight: `1px solid ${C.b1}` }) }}>\r\n\t\t\t\t\t\t\t<Typography sx={{ fontSize: 10, fontWeight: 600, color: C.t3, mb: 0.3, lineHeight: 1.2 }}>{label}</Typography>\r\n\t\t\t\t\t\t\t<Box sx={{ display: \"flex\", alignItems: \"baseline\", justifyContent: \"center\", gap: 0.5 }}>\r\n\t\t\t\t\t\t\t\t<Typography sx={{ fontSize: 13, fontWeight: 700, color: C.blue }}>{value}</Typography>\r\n\t\t\t\t\t\t\t\t<Typography sx={{ fontSize: 11, color: C.t3 }}>|</Typography>\r\n\t\t\t\t\t\t\t\t<Typography sx={{ fontSize: 12, fontWeight: 600, color: C.blue }}>{pct.toFixed(1)}%</Typography>\r\n\t\t\t\t\t\t\t</Box>\r\n\t\t\t\t\t\t</Box>\r\n\t\t\t\t\t))}\r\n\t\t\t\t</Box>\r\n\t\t\t</Box>\r\n\t\t</Paper>\r\n\t);\r\n}\r\n*/\r\n\r\n/* Hover box for the hourly chart — swatch + label + value per series, with the\r\n   answered/abandoned split and hour range spelled out. */\r\nconst HOURLY_SERIES = [\r\n\t{ key: \"answered\",  label: \"Answered\",  color: \"#F2B51D\", line: false },\r\n\t{ key: \"abandoned\", label: \"Abandoned\", color: \"#9fc4cb\", line: false },\r\n\t{ key: \"agents\",    label: \"Agents\",    color: \"#14505b\", line: true  },\r\n] as const;\r\n\r\nfunction HourlyTooltip({ active, payload }: Readonly<any>) {\r\n\tif (!active || !payload?.length) return null;\r\n\tconst row = payload[0].payload as Record<string, number | string>;\r\n\tconst calls = Number(row.answered) + Number(row.abandoned);\r\n\treturn (\r\n\t\t<Box sx={{\r\n\t\t\tbackground: C.surface, border: `1px solid ${C.b2}`, borderRadius: \"8px\",\r\n\t\t\tboxShadow: \"0 6px 18px rgba(20,80,91,.18)\", px: 1.25, py: 1, minWidth: 168,\r\n\t\t\tpointerEvents: \"none\",\r\n\t\t}}>\r\n\t\t\t<Box sx={{ mb: 0.75, pb: 0.6, borderBottom: `1px solid ${C.b1}` }}>\r\n\t\t\t\t<Typography sx={{ ...monoSx, fontSize: 12, color: C.navy }}>{row.hour}:00 – {row.hour}:59</Typography>\r\n\t\t\t</Box>\r\n\t\t\t{HOURLY_SERIES.map(({ key, label, color, line }) => (\r\n\t\t\t\t<Box key={key} sx={{ display: \"flex\", alignItems: \"center\", gap: 0.9, mb: 0.4 }}>\r\n\t\t\t\t\t<Box sx={{ width: 10, height: line ? 3 : 10, borderRadius: \"2px\", background: color, flexShrink: 0 }} />\r\n\t\t\t\t\t<Typography sx={{ fontSize: 11, color: C.t2, flex: 1 }}>{label}</Typography>\r\n\t\t\t\t\t<Typography sx={{ fontSize: 12, fontWeight: 700, color: C.t1, fontVariantNumeric: \"tabular-nums\" }}>{row[key]}</Typography>\r\n\t\t\t\t</Box>\r\n\t\t\t))}\r\n\t\t\t<Box sx={{ display: \"flex\", justifyContent: \"space-between\", alignItems: \"baseline\", mt: 0.7, pt: 0.6, borderTop: `1px solid ${C.b1}` }}>\r\n\t\t\t\t<Typography sx={{ fontSize: 11, color: C.t3 }}>Total calls</Typography>\r\n\t\t\t\t<Box sx={{ display: \"flex\", alignItems: \"baseline\", gap: 0.5 }}>\r\n\t\t\t\t\t<Typography sx={{ fontSize: 13, fontWeight: 700, color: C.blue, fontVariantNumeric: \"tabular-nums\" }}>{calls}</Typography>\r\n\t\t\t\t\t{calls > 0 && (\r\n\t\t\t\t\t\t<Typography sx={{ fontSize: 10, color: C.t3 }}>\r\n\t\t\t\t\t\t\t· {((Number(row.answered) / calls) * 100).toFixed(0)}% answered\r\n\t\t\t\t\t\t</Typography>\r\n\t\t\t\t\t)}\r\n\t\t\t\t</Box>\r\n\t\t\t</Box>\r\n\t\t</Box>\r\n\t);\r\n}\r\n\r\nfunction statusColor(status: string) {\r\n\tconst s = status?.toUpperCase();\r\n\tif (s === \"ANSWERED\")  return C.green;\r\n\tif (s === \"CANCEL\")    return C.red;\r\n\tif (s === \"ABANDONED\") return \"#c05621\";\r\n\treturn C.t2;\r\n}\r\n\r\n/* ═══════════════════════ MAIN CONTENT ═══════════════════════ */\r\n\r\nfunction ManagementDashboardContent() {\r\n\t// SDK initialization completes after this route can mount.  Subscribe to the\r\n\t// token so the first dashboard request waits for an authenticated session.\r\n\tconst authorizationToken = useGetAuthorizationToken();\r\n\t// Repeated-caller numbers are masked without `phone_number:view_unmasked` — in the table\r\n\t// AND in the CSV this page builds itself, which would otherwise hand back exactly\r\n\t// what the masking withholds.\r\n\tconst { maskNumber } = useNumberMask();\r\n\tconst [startDate, setStartDate] = useState<Dayjs | null>(dayjs().startOf(\"day\"));\r\n\tconst [endDate, setEndDate]     = useState<Dayjs | null>(dayjs());\r\n\tconst [quickRange, setQuickRange] = useState(\"today\");\r\n\r\n\tconst [data, setData]       = useState<MgmtDashboardResponse>(EMPTY);\r\n\t// Starts true: until the first response lands (including while waiting for the\r\n\t// token right after login) `data` is the all-zero EMPTY placeholder, not real numbers.\r\n\tconst [loading, setLoading] = useState(true);\r\n\tconst [error, setError]     = useState(\"\");\r\n\tconst [repeatedSearch, setRepeatedSearch] = useState(\"\");\r\n\tconst chartRef = useRef<HTMLDivElement>(null);\r\n\t// Every filter edit fires a request (a quick range sets start and end separately), and\r\n\t// the responses can land out of order. Only the latest request may touch state —\r\n\t// otherwise the first to finish clears the spinner with stale numbers and a slower\r\n\t// one overwrites them seconds later.\r\n\tconst requestSeq = useRef(0);\r\n\r\n\tconst fetchDashboard = useCallback(async () => {\r\n\t\tif (!authorizationToken || !startDate || !endDate) return;\r\n\t\tconst seq = ++requestSeq.current;\r\n\t\tsetLoading(true);\r\n\t\tsetError(\"\");\r\n\t\ttry {\r\n\t\t\tconst result = await getManagementDashboard({\r\n\t\t\t\tstart_date: startDate.format(\"YYYY-MM-DDTHH:mm:ss\"),\r\n\t\t\t\tend_date:   endDate.format(\"YYYY-MM-DDTHH:mm:ss\"),\r\n\t\t\t});\r\n\t\t\tif (seq === requestSeq.current) setData(result);\r\n\t\t} catch (err: any) {\r\n\t\t\tif (seq === requestSeq.current) setError(err?.response?.data?.detail || err?.message || \"Failed to load dashboard\");\r\n\t\t} finally {\r\n\t\t\tif (seq === requestSeq.current) setLoading(false);\r\n\t\t}\r\n\t}, [authorizationToken, startDate, endDate]);\r\n\r\n\tuseEffect(() => { fetchDashboard(); }, [fetchDashboard]);\r\n\r\n\tconst handleQuickRangeChange = (range: QuickRange) => setQuickRange(range);\r\n\r\n\t// A quick range means \"up to now\", but its end was pinned to the `dayjs()` of the click\r\n\t// that selected it (Today is pinned at mount). Refreshing has to re-derive the window\r\n\t// from the current clock, otherwise every refresh re-sends the first click's timestamp\r\n\t// and the last few minutes of calls never appear. Moving the state also keeps the date\r\n\t// picker showing what was actually requested; the fetch effect does the reload.\r\n\t// A hand-picked range is an explicit window, so it refetches unchanged.\r\n\tconst handleRefresh = () => {\r\n\t\tif (quickRange === \"today\" || quickRange === \"week\" || quickRange === \"month\") {\r\n\t\t\tconst now = dayjs();\r\n\t\t\tsetStartDate(\r\n\t\t\t\tquickRange === \"week\"  ? now.startOf(\"week\").startOf(\"day\") :\r\n\t\t\t\tquickRange === \"month\" ? now.startOf(\"month\").startOf(\"day\") :\r\n\t\t\t\t                         now.startOf(\"day\")\r\n\t\t\t);\r\n\t\t\tsetEndDate(now);\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tfetchDashboard();\r\n\t};\r\n\r\n\tconst filteredRepeated = useMemo(() => {\r\n\t\tif (!repeatedSearch) return data.repeated_calls;\r\n\t\tconst q = repeatedSearch.toLowerCase();\r\n\t\treturn data.repeated_calls.filter((r) =>\r\n\t\t\tr.phone_number.toLowerCase().includes(q) ||\r\n\t\t\tr.latest_status.toLowerCase().includes(q) ||\r\n\t\t\tr.latest_call_type.toLowerCase().includes(q)\r\n\t\t);\r\n\t}, [data.repeated_calls, repeatedSearch]);\r\n\r\n\tconst hourlyData = useMemo(() => {\r\n\t\tconst map = new Map(data.hourly_chart.map((h) => [h.hour, h]));\r\n\t\treturn Array.from({ length: 24 }, (_, h) => ({\r\n\t\t\thour: `${String(h).padStart(2, \"0\")}`,\r\n\t\t\tanswered:  map.get(h)?.answered  ?? 0,\r\n\t\t\tabandoned: map.get(h)?.abandoned ?? 0,\r\n\t\t\tagents:    map.get(h)?.agents    ?? 0,\r\n\t\t}));\r\n\t}, [data.hourly_chart]);\r\n\r\n\t/* The inbound split comes from the API as sent: `inbound.total` already counts the IVR\r\n\t\tabandons, `inbound.abandoned` is queue + IVR, and the two `*_abandoned_pct` fields are\r\n\t\tshares of that abandoned bucket rather than of the headline. The `??` arms only cover a\r\n\t\tresponse that omits a field — they are not a second way of reporting the same numbers. */\r\n\tconst inboundTotal      = data.inbound.total;\r\n\tconst queueAbandoned    = data.inbound.queue_abandoned ?? data.abandoned?.total ?? 0;\r\n\tconst ivrAbandoned      = data.inbound.ivr_abandoned   ?? data.ivr?.total ?? 0;\r\n\tconst abandonedTotal    = data.inbound.abandoned ?? queueAbandoned + ivrAbandoned;\r\n\tconst queueAbandonedPct = data.inbound.queue_abandoned_pct ?? pctOf(queueAbandoned, abandonedTotal);\r\n\tconst ivrAbandonedPct   = data.inbound.ivr_abandoned_pct   ?? pctOf(ivrAbandoned, abandonedTotal);\r\n\tconst outboundUnanswered = data.outbound.unanswered ?? 0;\r\n\tconst outboundSources: SourceRow[] = [\r\n\t\tdata.outbound.abandoned && { label: \"Abandoned Calls\",    ...data.outbound.abandoned },\r\n\t\tdata.outbound.digital   && { label: \"Digital Lead Calls\", ...data.outbound.digital   },\r\n\t\tdata.outbound.manual    && { label: \"Manual Calls\",       ...data.outbound.manual    },\r\n\t].filter((r): r is SourceRow => !!r);\r\n\r\n\tconst downloadChart = () => {\r\n\t\tconst svgEl = chartRef.current?.querySelector(\"svg\");\r\n\t\tif (!svgEl) return;\r\n\t\tconst svgData = new XMLSerializer().serializeToString(svgEl);\r\n\t\tconst canvas = document.createElement(\"canvas\");\r\n\t\tconst img = new Image();\r\n\t\timg.onload = () => {\r\n\t\t\tcanvas.width = img.width;\r\n\t\t\tcanvas.height = img.height;\r\n\t\t\tconst ctx = canvas.getContext(\"2d\");\r\n\t\t\tif (!ctx) return;\r\n\t\t\tctx.fillStyle = \"#fff\";\r\n\t\t\tctx.fillRect(0, 0, canvas.width, canvas.height);\r\n\t\t\tctx.drawImage(img, 0, 0);\r\n\t\t\tconst a = document.createElement(\"a\");\r\n\t\t\ta.download = `hourly_chart.png`;\r\n\t\t\ta.href = canvas.toDataURL(\"image/png\");\r\n\t\t\ta.click();\r\n\t\t};\r\n\t\timg.src = \"data:image/svg+xml;base64,\" + btoa(unescape(encodeURIComponent(svgData)));\r\n\t};\r\n\r\n\treturn (\r\n\t\t<LocalizationProvider dateAdapter={AdapterDayjs}>\r\n\t\t\t<Box sx={{ background: \"transparent\", minHeight: \"100vh\" }}>\r\n\r\n\t\t\t\t{/* ── HEADER ── */}\r\n\t\t\t\t<PageHeader\r\n\t\t\t\t\ttitle=\"Management Dashboard\"\r\n\t\t\t\t\tactions={\r\n\t\t\t\t\t\t<Stack direction=\"row\" spacing={1} alignItems=\"center\">\r\n\t\t\t\t\t\t\t<AppButton\r\n\t\t\t\t\t\t\t\tvariant=\"outlined\"\r\n\t\t\t\t\t\t\t\tstartIcon={<RefreshIcon sx={{ fontSize: \"0.95rem !important\" }} />}\r\n\t\t\t\t\t\t\t\tonClick={handleRefresh}\r\n\t\t\t\t\t\t\t\tdisabled={loading}\r\n\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\tRefresh\r\n\t\t\t\t\t\t\t</AppButton>\r\n\t\t\t\t\t\t\t {/* <AppButton\r\n\t\t\t\t\t\t\t\tstartIcon={<FileDownloadIcon sx={{ fontSize: \"0.95rem !important\" }} />}\r\n\t\t\t\t\t\t\t\tdisabled={loading || data.totals.total_calls === 0}\r\n\t\t\t\t\t\t\t\tonClick={() => {\r\n\t\t\t\t\t\t\t\t\t// Build columns explicitly — Object.values() silently shifts every\r\n\t\t\t\t\t\t\t\t\t  // field once the API drops one (it no longer sends `comments`). \r\n\t\t\t\t\t\t\t\t\tconst esc = (v: unknown) => `\"${String(v ?? \"\").replace(/\"/g, '\"\"')}\"`;\r\n\t\t\t\t\t\t\t\t\tconst rows = data.repeated_calls.map((r) =>\r\n\t\t\t\t\t\t\t\t\t\t[maskNumber(r.phone_number), r.date, r.call_count, r.latest_status, r.latest_call_type].map(esc).join(\",\")\r\n\t\t\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t\t\t\tconst csv = [\"Phone,Date,Count,Status,Type\", ...rows].join(\"\\n\");\r\n\t\t\t\t\t\t\t\t\tconst a = document.createElement(\"a\");\r\n\t\t\t\t\t\t\t\t\ta.href = URL.createObjectURL(new Blob([csv], { type: \"text/csv\" }));\r\n\t\t\t\t\t\t\t\t\ta.download = `mgmt_dashboard_${startDate?.format(\"YYYY-MM-DD\")}.csv`;\r\n\t\t\t\t\t\t\t\t\ta.click();\r\n\t\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\tExport CSV\r\n\t\t\t\t\t\t\t</AppButton> */}\r\n\t\t\t\t\t\t</Stack>\r\n\t\t\t\t\t}\r\n\t\t\t\t/>\r\n\r\n\t\t\t\t{/* ── FILTER BAR ── */}\r\n\t\t\t\t<ReportFilterBar\r\n\t\t\t\t\tstartDate={startDate}\r\n\t\t\t\t\tendDate={endDate}\r\n\t\t\t\t\tonStartChange={setStartDate}\r\n\t\t\t\t\tonEndChange={setEndDate}\r\n\t\t\t\t\tshowTime={true}\r\n\t\t\t\t\tquickRange={quickRange}\r\n\t\t\t\t\tonQuickRangeChange={handleQuickRangeChange}\r\n\t\t\t\t/>\r\n\r\n\t\t\t\t{error && (\r\n\t\t\t\t\t<Alert severity=\"error\" sx={{ mx: 2.5, mt: 1.5 }} onClose={() => setError(\"\")}>{error}</Alert>\r\n\t\t\t\t)}\r\n\r\n\t\t\t\t{loading && (\r\n\t\t\t\t\t<Box sx={{ display: \"flex\", justifyContent: \"center\", py: 5 }}>\r\n\t\t\t\t\t\t<CircularProgress size={36} />\r\n\t\t\t\t\t</Box>\r\n\t\t\t\t)}\r\n\r\n\t\t\t\t{!loading && (\r\n\t\t\t\t\t<Box sx={{ px: { xs: 1, md: 2 }, py: 1.5 }}>\r\n\r\n\t\t\t\t\t\t{/* ═══ ROW 1 — Summary, Inbound, Unique Abandoned Patients, Outbound ═══ */}\r\n\t\t\t\t\t\t<Box sx={{\r\n\t\t\t\t\t\t\tdisplay: \"grid\",\r\n\t\t\t\t\t\t\tgridTemplateColumns: { xs: \"1fr\", sm: \"repeat(2, 1fr)\", lg: \"repeat(4, 1fr)\" },\r\n\t\t\t\t\t\t\tgap: 1.2,\r\n\t\t\t\t\t\t\tmb: 1.2,\r\n\t\t\t\t\t\t\talignItems: \"stretch\",\r\n\t\t\t\t\t\t}}>\r\n\r\n\t\t\t\t\t\t\t<SummaryCard data={data.totals} />\r\n\r\n\t\t\t\t\t\t\t{/* IVR abandons (callers who hung up before reaching a queue) are already inside the\r\n\t\t\t\t\t\t\t\t\tinbound headline and the abandoned total; the footer splits the two buckets. */}\r\n\t\t\t\t\t\t\t<DirectionCard\r\n\t\t\t\t\t\t\t\ttitle=\"Inbound Calls\"\r\n\t\t\t\t\t\t\t\ticon={<SouthEastIcon sx={trendIconSx} />}\r\n\t\t\t\t\t\t\t\ttotal={inboundTotal}\r\n\t\t\t\t\t\t\t\ttotalLabel=\"TOTAL INBOUND RECEIVED\"\r\n\t\t\t\t\t\t\t\tcells={[\r\n\t\t\t\t\t\t\t\t\t{ label: \"ANSWERED\",  value: data.inbound.answered, pct: data.inbound.answered_pct                            },\r\n\t\t\t\t\t\t\t\t\t{ label: \"ABANDONED\", value: abandonedTotal,        pct: data.inbound.abandoned_pct ?? pctOf(abandonedTotal, inboundTotal) },\r\n\t\t\t\t\t\t\t\t]}\r\n\t\t\t\t\t\t\t\tfooter={{\r\n\t\t\t\t\t\t\t\t\ttitle: `OF THE ${abandonedTotal.toLocaleString()} ABANDONED`,\r\n\t\t\t\t\t\t\t\t\tbar: true,\r\n\t\t\t\t\t\t\t\t\trows: [\r\n\t\t\t\t\t\t\t\t\t\t{ label: \"Queue Abandoned\", value: queueAbandoned, pct: queueAbandonedPct },\r\n\t\t\t\t\t\t\t\t\t\t{ label: \"IVR Abandoned\",   value: ivrAbandoned,   pct: ivrAbandonedPct   },\r\n\t\t\t\t\t\t\t\t\t],\r\n\t\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\t/>\r\n\r\n\t\t\t\t\t\t\t{/* Callback duration is reported on `unique_abandoned`; the `abandoned` arm covers older\r\n\t\t\t\t\t\t\t\tresponses that still carry it on the call-level block. */}\r\n\t\t\t\t\t\t\t<UniquePatientsCard\r\n\t\t\t\t\t\t\t\tdata={data.unique_abandoned ?? EMPTY_UNIQUE_ABANDONED}\r\n\t\t\t\t\t\t\t\tavgCallbackDuration={data.unique_abandoned?.avg_callback_duration ?? data.abandoned?.avg_callback_duration ?? \"00:00:00\"}\r\n\t\t\t\t\t\t\t/>\r\n\r\n\t\t\t\t\t\t\t{/* The source row splits the headline by how the call was placed; it is left off when\r\n\t\t\t\t\t\t\t\tthe platform build does not report the abandoned / digital / manual blocks. */}\r\n\t\t\t\t\t\t\t<DirectionCard\r\n\t\t\t\t\t\t\t\ttitle=\"Outbound Calls\"\r\n\t\t\t\t\t\t\t\ticon={<NorthEastIcon sx={trendIconSx} />}\r\n\t\t\t\t\t\t\t\ttotal={data.outbound.total}\r\n\t\t\t\t\t\t\t\ttotalLabel=\"TOTAL OUTBOUND PLACED\"\r\n\t\t\t\t\t\t\t\tcells={[\r\n\t\t\t\t\t\t\t\t\t{ label: \"ANSWERED\",   value: data.outbound.answered, pct: data.outbound.answered_pct        },\r\n\t\t\t\t\t\t\t\t\t{ label: \"UNANSWERED\", value: outboundUnanswered,     pct: data.outbound.unanswered_pct ?? 0 },\r\n\t\t\t\t\t\t\t\t]}\r\n\t\t\t\t\t\t\t\tsources={outboundSources.length ? outboundSources : undefined}\r\n\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\t{/* <IvrAbandonedCard data={data.ivr} /> */}\r\n\t\t\t\t\t\t\t{/* <IvrCard data={data.ivr} /> */}\r\n\t\t\t\t\t\t</Box>\r\n\r\n\t\t\t\t\t\t{/* ═══ ROW 2 — 4 metric cards ═══ */}\r\n\t\t\t\t\t\t<Box sx={{\r\n\t\t\t\t\t\t\tdisplay: \"grid\",\r\n\t\t\t\t\t\t\tgridTemplateColumns: { xs: \"1fr\", sm: \"repeat(2, 1fr)\", lg: \"1fr 1fr 1fr 1.6fr\" },\r\n\t\t\t\t\t\t\tgap: 1.2,\r\n\t\t\t\t\t\t\tmb: 1.2,\r\n\t\t\t\t\t\t}}>\r\n\r\n\t\t\t\t\t\t\t<QueueCallsCard data={data.queue_calls} />\r\n\r\n\t\t\t\t\t\t\t{/* Avg Duration */}\r\n\t\t\t\t\t\t\t<Paper sx={cardPaper}>\r\n\t\t\t\t\t\t\t\t<Box sx={cardHeader}><Typography sx={labelSx}>Avg Total Calls Duration</Typography></Box>\r\n\t\t\t\t\t\t\t\t<Box sx={{ p: 1.5 }}>\r\n\t\t\t\t\t\t\t\t\t{[\r\n\t\t\t\t\t\t\t\t\t\t{ label: \"Inbound\",  value: data.totals.avg_inbound_duration },\r\n\t\t\t\t\t\t\t\t\t\t{ label: \"Outbound\", value: data.totals.avg_outbound_duration },\r\n\t\t\t\t\t\t\t\t\t].map(({ label, value }) => (\r\n\t\t\t\t\t\t\t\t\t\t<Box key={label} sx={{ display: \"flex\", justifyContent: \"space-between\", alignItems: \"center\", py: 1, borderBottom: `1px solid ${C.b1}`, \"&:last-child\": { borderBottom: \"none\" } }}>\r\n\t\t\t\t\t\t\t\t\t\t\t<Typography sx={{ fontSize: 12, fontWeight: 600, color: C.t2 }}>{label}</Typography>\r\n\t\t\t\t\t\t\t\t\t\t\t<Typography sx={{ ...monoSx, fontSize: 16, color: C.blue }}>{value}</Typography>\r\n\t\t\t\t\t\t\t\t\t\t</Box>\r\n\t\t\t\t\t\t\t\t\t))}\r\n\t\t\t\t\t\t\t\t</Box>\r\n\t\t\t\t\t\t\t</Paper>\r\n\r\n\t\t\t\t\t\t\t{/* Inbound Average Durations */}\r\n\t\t\t\t\t\t\t<Paper sx={cardPaper}>\r\n\t\t\t\t\t\t\t\t<Box sx={cardHeader}><Typography sx={labelSx}>Inbound Average Durations</Typography></Box>\r\n\t\t\t\t\t\t\t\t<Box sx={{ p: 1.5, display: \"grid\", gridTemplateColumns: \"1fr 1fr\", mt: 0.5 }}>\r\n\t\t\t\t\t\t\t\t\t{[\r\n\t\t\t\t\t\t\t\t\t\t{ label: \"Average IVR Waiting Time\",   value: data.waiting.avg_wait_time },\r\n\t\t\t\t\t\t\t\t\t\t{ label: \"Average Queue Waiting Time\", value: data.waiting.avg_queue_wait },\r\n\t\t\t\t\t\t\t\t\t].map(({ label, value }, idx) => (\r\n\t\t\t\t\t\t\t\t\t\t<Box key={label} sx={{ textAlign: \"center\", px: 0.5, ...(idx < 1 && { borderRight: `1px solid ${C.b1}` }) }}>\r\n\t\t\t\t\t\t\t\t\t\t\t<Typography sx={{ fontSize: 10, fontWeight: 600, color: C.t3, mb: 0.5 }}>{label}</Typography>\r\n\t\t\t\t\t\t\t\t\t\t\t<Typography sx={{ ...monoSx, fontSize: 18, color: C.blue }}>{value}</Typography>\r\n\t\t\t\t\t\t\t\t\t\t</Box>\r\n\t\t\t\t\t\t\t\t\t))}\r\n\t\t\t\t\t\t\t\t</Box>\r\n\t\t\t\t\t\t\t</Paper>\r\n\r\n\t\t\t\t\t\t\t{/* CHT Table */}\r\n\t\t\t\t\t\t\t<Paper sx={cardPaper}>\r\n\t\t\t\t\t\t\t\t<Box sx={cardHeader}><Typography sx={labelSx}>Average CHT</Typography></Box>\r\n\t\t\t\t\t\t\t\t<TableContainer>\r\n\t\t\t\t\t\t\t\t\t<Table size=\"small\">\r\n\t\t\t\t\t\t\t\t\t\t<TableHead>\r\n\t\t\t\t\t\t\t\t\t\t\t<TableRow>\r\n\t\t\t\t\t\t\t\t\t\t\t\t<TableCell sx={headSx}>Call Type</TableCell>\r\n\t\t\t\t\t\t\t\t\t\t\t\t<TableCell sx={headSx}>Call Handling Time</TableCell>\r\n\t\t\t\t\t\t\t\t\t\t\t\t<TableCell sx={headSx}>Talk Duration</TableCell>\r\n\t\t\t\t\t\t\t\t\t\t\t\t<TableCell sx={headSx}>Hold Duration</TableCell>\r\n\t\t\t\t\t\t\t\t\t\t\t</TableRow>\r\n\t\t\t\t\t\t\t\t\t\t</TableHead>\r\n\t\t\t\t\t\t\t\t\t\t<TableBody>\r\n\t\t\t\t\t\t\t\t\t\t\t{data.cht.length === 0 && (\r\n\t\t\t\t\t\t\t\t\t\t\t\t<TableRow><TableCell colSpan={4} sx={{ textAlign: \"center\", py: 2, color: C.t3, fontSize: 12 }}>No data</TableCell></TableRow>\r\n\t\t\t\t\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t\t\t\t\t\t{data.cht.map((row) => (\r\n\t\t\t\t\t\t\t\t\t\t\t\t<TableRow key={row.call_type} hover>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t<TableCell sx={{ ...cellSx, fontWeight: 600, color: C.t2 }}>{row.call_type}</TableCell>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t<TableCell sx={{ ...cellSx, ...monoSx, color: C.blue }}>{row.call_handling_time}</TableCell>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t<TableCell sx={{ ...cellSx, ...monoSx, color: C.blue }}>{row.talk_duration}</TableCell>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t<TableCell sx={{ ...cellSx, ...monoSx, color: C.blue }}>{row.hold_duration}</TableCell>\r\n\t\t\t\t\t\t\t\t\t\t\t\t</TableRow>\r\n\t\t\t\t\t\t\t\t\t\t\t))}\r\n\t\t\t\t\t\t\t\t\t\t</TableBody>\r\n\t\t\t\t\t\t\t\t\t</Table>\r\n\t\t\t\t\t\t\t\t</TableContainer>\r\n\t\t\t\t\t\t\t</Paper>\r\n\r\n\t\t\t\t\t\t</Box>\r\n\r\n\t\t\t\t\t\t{/* ═══ ROW 3 — Chart + Repeated Calls ═══ */}\r\n\t\t\t\t\t\t<Box sx={{ display: \"grid\", gridTemplateColumns: { xs: \"1fr\", lg: \"1fr 1fr\" }, gap: 1.2 }}>\r\n\r\n\t\t\t\t\t\t\t{/* Hourly Chart */}\r\n\t\t\t\t\t\t\t<Paper sx={cardPaper}>\r\n\t\t\t\t\t\t\t\t<Box sx={{ ...cardHeader, flexWrap: \"wrap\", gap: 1, justifyContent: \"space-between\" }}>\r\n\t\t\t\t\t\t\t\t\t<Box>\r\n\t\t\t\t\t\t\t\t\t\t<Typography sx={labelSx}>Avg Hour Wise Inbound Calls vs Agents</Typography>\r\n\t\t\t\t\t\t\t\t\t\t<Stack direction=\"row\" spacing={1.5} sx={{ mt: 0.5 }}>\r\n\t\t\t\t\t\t\t\t\t\t\t{[\r\n\t\t\t\t\t\t\t\t\t\t\t\t{ color: \"#F2B51D\", label: \"Answered\" },\r\n\t\t\t\t\t\t\t\t\t\t\t\t{ color: \"#9fc4cb\", label: \"Abandoned\" },\r\n\t\t\t\t\t\t\t\t\t\t\t\t{ color: \"#14505b\", label: \"Agents\" },\r\n\t\t\t\t\t\t\t\t\t\t\t].map(({ color, label }) => (\r\n\t\t\t\t\t\t\t\t\t\t\t\t<Box key={label} sx={{ display: \"flex\", alignItems: \"center\", gap: 0.5 }}>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t<Box sx={{ width: 12, height: 12, borderRadius: \"2px\", background: color }} />\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t<Typography sx={{ fontSize: 11, color: C.t3 }}>{label}</Typography>\r\n\t\t\t\t\t\t\t\t\t\t\t\t</Box>\r\n\t\t\t\t\t\t\t\t\t\t\t))}\r\n\t\t\t\t\t\t\t\t\t\t</Stack>\r\n\t\t\t\t\t\t\t\t\t</Box>\r\n\t\t\t\t\t\t\t\t\t<Box sx={{ display: \"flex\", flexDirection: \"column\", alignItems: \"flex-end\", gap: 0.5 }}>\r\n\t\t\t\t\t\t\t\t\t\t<Typography\r\n\t\t\t\t\t\t\t\t\t\t\tonClick={downloadChart}\r\n\t\t\t\t\t\t\t\t\t\t\tsx={{ fontSize: 11, color: C.blue, cursor: \"pointer\", border: `1px solid ${C.b2}`, borderRadius: \"4px\", px: 1, py: 0.3 }}\r\n\t\t\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\t\t\t⬇ DOWNLOAD\r\n\t\t\t\t\t\t\t\t\t\t</Typography>\r\n\t\t\t\t\t\t\t\t\t</Box>\r\n\t\t\t\t\t\t\t\t</Box>\r\n\t\t\t\t\t\t\t\t<Box ref={chartRef} sx={{ p: 1.5, height: 260 }}>\r\n\t\t\t\t\t\t\t\t\t<ResponsiveContainer width=\"100%\" height=\"100%\">\r\n\t\t\t\t\t\t\t\t\t\t<ComposedChart data={hourlyData} margin={{ top: 4, right: 30, left: -20, bottom: 0 }} barGap={1}>\r\n\t\t\t\t\t\t\t\t\t\t\t<CartesianGrid strokeDasharray=\"3 3\" stroke={C.b2} vertical={false} />\r\n\t\t\t\t\t\t\t\t\t\t\t<XAxis dataKey=\"hour\" tick={{ fontSize: 9, fill: C.t3 }} interval={1} />\r\n\t\t\t\t\t\t\t\t\t\t\t<YAxis yAxisId=\"left\" tick={{ fontSize: 9, fill: C.t3 }} />\r\n\t\t\t\t\t\t\t\t\t\t\t<YAxis yAxisId=\"right\" orientation=\"right\" tick={{ fontSize: 9, fill: C.t3 }} />\r\n\t\t\t\t\t\t\t\t\t\t\t<RTooltip\r\n\t\t\t\t\t\t\t\t\t\t\t\tcontent={<HourlyTooltip />}\r\n\t\t\t\t\t\t\t\t\t\t\t\tcursor={{ fill: \"rgba(26,95,108,.07)\" }}\r\n\t\t\t\t\t\t\t\t\t\t\t\tanimationDuration={140}\r\n\t\t\t\t\t\t\t\t\t\t\t\twrapperStyle={{ outline: \"none\", zIndex: 2 }}\r\n\t\t\t\t\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\t\t\t\t\t<Bar yAxisId=\"left\" dataKey=\"answered\"  fill=\"#F2B51D\" radius={[2, 2, 0, 0]} maxBarSize={14} />\r\n\t\t\t\t\t\t\t\t\t\t\t<Bar yAxisId=\"left\" dataKey=\"abandoned\" fill=\"#9fc4cb\" radius={[2, 2, 0, 0]} maxBarSize={14} />\r\n\t\t\t\t\t\t\t\t\t\t\t<Line yAxisId=\"right\" type=\"monotone\" dataKey=\"agents\" stroke=\"#14505b\" strokeWidth={1.5} dot={{ r: 2, fill: \"#14505b\" }} />\r\n\t\t\t\t\t\t\t\t\t\t</ComposedChart>\r\n\t\t\t\t\t\t\t\t\t</ResponsiveContainer>\r\n\t\t\t\t\t\t\t\t</Box>\r\n\t\t\t\t\t\t\t</Paper>\r\n\r\n\t\t\t\t\t\t\t{/* Repeated Calls Table */}\r\n\t\t\t\t\t\t\t<Paper sx={cardPaper}>\r\n\t\t\t\t\t\t\t\t<Box sx={{ ...cardHeader, justifyContent: \"space-between\" }}>\r\n\t\t\t\t\t\t\t\t\t<Typography sx={labelSx}>Repeated Calls</Typography>\r\n\t\t\t\t\t\t\t\t\t<Chip label={data.repeated_calls.length} size=\"small\" sx={{ background: C.rlt, color: C.red, fontWeight: 700, fontSize: 11 }} />\r\n\t\t\t\t\t\t\t\t</Box>\r\n\t\t\t\t\t\t\t\t<Box sx={{ px: 1.5, py: 1 }}>\r\n\t\t\t\t\t\t\t\t\t<TextField\r\n\t\t\t\t\t\t\t\t\t\tsize=\"small\"\r\n\t\t\t\t\t\t\t\t\t\tplaceholder=\"Search…\"\r\n\t\t\t\t\t\t\t\t\t\tvalue={repeatedSearch}\r\n\t\t\t\t\t\t\t\t\t\tonChange={(e) => setRepeatedSearch(e.target.value)}\r\n\t\t\t\t\t\t\t\t\t\tfullWidth\r\n\t\t\t\t\t\t\t\t\t\tslotProps={{ input: { startAdornment: <InputAdornment position=\"start\"><SearchIcon sx={{ fontSize: 16, color: C.t3 }} /></InputAdornment> } }}\r\n\t\t\t\t\t\t\t\t\t\tsx={{ \"& .MuiInputBase-root\": { fontSize: 12 } }}\r\n\t\t\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\t\t</Box>\r\n\t\t\t\t\t\t\t\t<TableContainer sx={{ maxHeight: 260, overflow: \"auto\" }}>\r\n\t\t\t\t\t\t\t\t\t<Table size=\"small\" stickyHeader>\r\n\t\t\t\t\t\t\t\t\t\t<TableHead>\r\n\t\t\t\t\t\t\t\t\t\t\t<TableRow>\r\n\t\t\t\t\t\t\t\t\t\t\t\t<TableCell sx={headSx}>Phone Number</TableCell>\r\n\t\t\t\t\t\t\t\t\t\t\t\t<TableCell sx={headSx}>Date</TableCell>\r\n\t\t\t\t\t\t\t\t\t\t\t\t<TableCell sx={headSx}>No of Calls</TableCell>\r\n\t\t\t\t\t\t\t\t\t\t\t\t<TableCell sx={headSx}>Latest Status</TableCell>\r\n\t\t\t\t\t\t\t\t\t\t\t\t<TableCell sx={headSx}>Latest Call Type</TableCell>\r\n\t\t\t\t\t\t\t\t\t\t\t</TableRow>\r\n\t\t\t\t\t\t\t\t\t\t</TableHead>\r\n\t\t\t\t\t\t\t\t\t\t<TableBody>\r\n\t\t\t\t\t\t\t\t\t\t\t{filteredRepeated.length === 0 && (\r\n\t\t\t\t\t\t\t\t\t\t\t\t<TableRow><TableCell colSpan={5} sx={{ textAlign: \"center\", py: 2, color: C.t3, fontSize: 12 }}>No repeated calls</TableCell></TableRow>\r\n\t\t\t\t\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t\t\t\t\t\t{filteredRepeated.map((r) => (\r\n\t\t\t\t\t\t\t\t\t\t\t\t<TableRow key={`${r.phone_number}-${r.date}`} hover>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t<TableCell sx={{ ...cellSx, ...monoSx, fontSize: 11 }}>{maskNumber(r.phone_number)}</TableCell>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t<TableCell sx={{ ...cellSx, fontSize: 11 }}>{r.date}</TableCell>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t<TableCell sx={{ ...cellSx, fontWeight: 700, color: C.navy, fontSize: 13 }}>{r.call_count}</TableCell>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t<TableCell sx={{ ...cellSx, fontSize: 11, fontWeight: 600, color: statusColor(r.latest_status) }}>{r.latest_status}</TableCell>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t<TableCell sx={{ ...cellSx, fontSize: 11 }}>{r.latest_call_type}</TableCell>\r\n\t\t\t\t\t\t\t\t\t\t\t\t</TableRow>\r\n\t\t\t\t\t\t\t\t\t\t\t))}\r\n\t\t\t\t\t\t\t\t\t\t</TableBody>\r\n\t\t\t\t\t\t\t\t\t</Table>\r\n\t\t\t\t\t\t\t\t</TableContainer>\r\n\t\t\t\t\t\t\t</Paper>\r\n\r\n\t\t\t\t\t\t</Box>\r\n\r\n\t\t\t\t\t</Box>\r\n\t\t\t\t)}\r\n\t\t\t</Box>\r\n\t\t</LocalizationProvider>\r\n\t);\r\n}\r\n\r\nconst ManagementDashboard: React.FC = () => (\r\n\t<SDKProvider>\r\n\t\t<ManagementDashboardContent />\r\n\t</SDKProvider>\r\n);\r\n\r\nexport default ManagementDashboard;\r\n","import axiosInstance from \"../../services/axios\";\r\nimport { END_POINT } from \"../../services/endPoint\";\r\nimport type { MgmtDashboardParams, MgmtDashboardResponse } from \"./types\";\r\n\r\nfunction buildQs(params: MgmtDashboardParams): string {\r\n\tconst qs = new URLSearchParams();\r\n\tif (params.start_date) qs.append(\"start_date\", params.start_date);\r\n\tif (params.end_date) qs.append(\"end_date\", params.end_date);\r\n\tif (params.agent_id != null) qs.append(\"agent_id\", String(params.agent_id));\r\n\tconst str = qs.toString();\r\n\treturn str ? `?${str}` : \"\";\r\n}\r\n\r\nexport async function getManagementDashboard(params: MgmtDashboardParams): Promise<MgmtDashboardResponse> {\r\n\tconst res = await axiosInstance.get<MgmtDashboardResponse>(\r\n\t\t`${END_POINT.MANAGEMENT_DASHBOARD}${buildQs(params)}`,\r\n\t);\r\n\treturn res.data;\r\n}\r\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAgB,UAAU,WAAW,aAAa,SAAS,cAAc;AACzE;AAAA,EACC;AAAA,EAAK;AAAA,EAAO;AAAA,EAAO;AAAA,EAAY;AAAA,EAAkB;AAAA,EACjD;AAAA,EAAO;AAAA,EAAW;AAAA,EAAW;AAAA,EAAgB;AAAA,EAAW;AAAA,EACxD;AAAA,EAAW;AAAA,EAAgB;AAAA,OACrB;AACP,OAAO,WAAsB;AAC7B,SAAS,4BAA4B;AACrC,SAAS,oBAAoB;AAC7B;AAAA,EACC;AAAA,EAAe;AAAA,EAAK;AAAA,EAAM;AAAA,EAAO;AAAA,EAAO;AAAA,EACxC,WAAW;AAAA,EAAU;AAAA,OACf;AAEP,OAAO,g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