"use strict";const e=require("react/jsx-runtime"),p=require("lucide-react"),h=require("./chartConstants-DyxWoEwB.js");function b({title:l,subtitle:t,icon:r,actions:a,height:c="md",loading:s=!1,loadingLabel:n,empty:i=!1,emptyMessage:o,emptyHint:d,emptyIcon:x,footer:u,className:v,children:f}){const m=h.CHART_HEIGHTS[c],j=["flex flex-col gap-4 p-4","rounded-[var(--radius-card)]","border border-[var(--border-color)]",v??""].filter(Boolean).join(" ");return e.jsxs("section",{className:j,style:{backgroundColor:"var(--dataviz-surface)"},"aria-busy":s||void 0,children:[e.jsxs("header",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"flex items-start gap-3 min-w-0",children:[r&&e.jsx("span",{className:"flex-shrink-0 mt-0.5",style:{color:"var(--dataviz-accent)"},"aria-hidden":"true",children:r}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("h3",{className:"text-base font-semibold text-[var(--text-primary)] truncate",children:l}),t&&e.jsx("p",{className:"text-xs text-[var(--text-secondary)] mt-0.5 truncate",children:t})]})]}),a&&e.jsx("div",{className:"flex items-center gap-2 flex-shrink-0",children:a})]}),e.jsx("div",{className:"relative w-full",style:{height:m},children:s?e.jsxs("div",{role:"status","aria-live":"polite",className:"flex flex-col items-center justify-center w-full h-full gap-2 text-[var(--text-secondary)]",children:[e.jsx(p.Loader2,{className:"w-6 h-6 animate-spin","aria-hidden":"true"}),n&&e.jsx("span",{className:"text-sm",children:n})]}):i?e.jsx(h.NoDataState,{message:o??"",hint:d,icon:x}):f}),u&&!s&&!i&&e.jsx("footer",{children:u})]})}function g({items:l,activeId:t,onHover:r,onSelect:a,ariaLabel:c}){return e.jsx("ul",{role:"list","aria-label":c,className:"flex flex-wrap gap-x-4 gap-y-2 justify-center items-center pt-3 border-t border-[var(--border-color)]",onMouseLeave:r?()=>r(null):void 0,children:l.map(s=>{const n=t===s.id,i=!!(a||r),o=a?"button":"div",d=r?()=>r(s.id):void 0,x=a?()=>a(s.id):void 0;return e.jsx("li",{children:e.jsxs(o,{type:a?"button":void 0,onMouseEnter:d,onClick:x,className:["inline-flex items-center gap-2 text-xs","rounded-[var(--radius-button)] px-2 py-1 transition-colors duration-150",i?"cursor-pointer hover:bg-[var(--bg-hover)]":"",n?"bg-[var(--bg-hover)]":"",a?"focus:outline-none focus:ring-2 focus:ring-[var(--color-accent-500)]":""].filter(Boolean).join(" "),children:[e.jsx("span",{className:"inline-block w-2.5 h-2.5 rounded-full flex-shrink-0",style:{backgroundColor:s.color},"aria-hidden":"true"}),e.jsx("span",{className:"text-[var(--text-secondary)] font-medium",children:s.label}),s.value&&e.jsx("span",{className:"text-[var(--text-tertiary)] tabular-nums",children:s.value})]})},s.id)})})}exports.ChartContainer=b;exports.ChartLegend=g;
//# sourceMappingURL=ChartLegend-CAdCdP0m.js.map
