// ============================================================
// Mock dashboard SVG components — rendered in CSS/SVG to look
// like real Power BI dashboards
// ============================================================

const COLORS = {
  blue: '#0b4f9c',
  blue2: '#1769d6',
  blue3: '#4a9eff',
  blueL: '#cfe1f5',
  yellow: '#f2c811',
  green: '#0e8a4f',
  greenL: '#cfe9da',
  red: '#c43d3d',
  orange: '#e58712',
  purple: '#6f4ec9',
  ink: '#0a1628',
  ink3: '#5b6b7e',
  line: '#d9dce0',
  bg: '#ffffff',
  bgSoft: '#f7f7f4'
};

// ---- Sparkline ----
const Spark = ({ data, color = COLORS.blue, w = 60, h = 28, fill = true }) => {
  const max = Math.max(...data);
  const min = Math.min(...data);
  const range = max - min || 1;
  const step = w / (data.length - 1);
  const points = data.map((v, i) => `${i * step},${h - (v - min) / range * (h - 4) - 2}`);
  const path = `M${points.join(' L')}`;
  const areaPath = `${path} L${w},${h} L0,${h} Z`;
  return (
    <svg width={w} height={h} className="spark" style={{ width: "60px" }}>
      {fill && <path d={areaPath} fill={color} opacity="0.12" />}
      <path d={path} fill="none" stroke={color} strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round" />
    </svg>);

};

// ---- Bar chart ----
const BarChart = ({ data, color = COLORS.blue, h = 80, horizontal = false, labels = null }) => {
  const max = Math.max(...data);
  if (horizontal) {
    return (
      <div style={{ display: 'flex', flexDirection: 'column', gap: 4, height: '100%' }}>
        {data.map((v, i) =>
        <div key={i} style={{ display: 'flex', alignItems: 'center', gap: 6, fontSize: 9, fontFamily: 'JetBrains Mono, monospace' }}>
            {labels && <div style={{ width: 50, color: COLORS.ink3, fontSize: 9, flexShrink: 0 }}>{labels[i]}</div>}
            <div style={{ flex: 1, height: 10, background: COLORS.bgSoft, borderRadius: 2, overflow: 'hidden' }}>
              <div style={{ width: `${v / max * 100}%`, height: '100%', background: color, transition: 'width 0.6s ease' }} />
            </div>
            <div style={{ width: 30, textAlign: 'right', color: COLORS.ink, fontSize: 9 }}>{v}</div>
          </div>
        )}
      </div>);

  }
  const w = 100 / data.length;
  return (
    <div style={{ display: 'flex', alignItems: 'flex-end', gap: 2, height: h, width: '100%' }}>
      {data.map((v, i) =>
      <div key={i} style={{
        flex: 1,
        height: `${v / max * 100}%`,
        minHeight: 4,
        background: i === data.length - 1 ? COLORS.yellow : color,
        borderRadius: '2px 2px 0 0',
        transition: 'height 0.6s ease'
      }} />
      )}
    </div>);

};

// ---- Line chart ----
const LineChart = ({ series, w = 280, h = 100, showAxis = true, colors = [COLORS.blue, COLORS.orange] }) => {
  const all = series.flat();
  const max = Math.max(...all);
  const min = Math.min(...all);
  const range = max - min || 1;
  const padding = 8;
  const len = series[0].length;
  return (
    <svg width="100%" viewBox={`0 0 ${w} ${h}`} preserveAspectRatio="none" style={{ display: 'block' }}>
      {showAxis && [0.25, 0.5, 0.75].map((p) =>
      <line key={p} x1="0" y1={h * p} x2={w} y2={h * p} stroke={COLORS.line} strokeWidth="0.5" strokeDasharray="2 3" />
      )}
      {series.map((data, si) => {
        const step = (w - padding * 2) / (len - 1);
        const points = data.map((v, i) => `${padding + i * step},${h - padding - (v - min) / range * (h - padding * 2)}`);
        return (
          <g key={si}>
            <path d={`M${points.join(' L')}`} fill="none" stroke={colors[si]} strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" />
            {data.map((v, i) => {
              const [x, y] = points[i].split(',');
              return <circle key={i} cx={x} cy={y} r="2" fill={colors[si]} />;
            })}
          </g>);

      })}
    </svg>);

};

// ---- Donut ----
const Donut = ({ data, size = 80, colors = [COLORS.blue, COLORS.yellow, COLORS.blue3, COLORS.greenL] }) => {
  const total = data.reduce((a, b) => a + b, 0);
  const radius = size / 2 - 8;
  const cx = size / 2,cy = size / 2;
  const c = 2 * Math.PI * radius;
  let offset = 0;
  return (
    <svg width={size} height={size}>
      <circle cx={cx} cy={cy} r={radius} fill="none" stroke={COLORS.bgSoft} strokeWidth="10" />
      {data.map((v, i) => {
        const len = v / total * c;
        const seg =
        <circle key={i} cx={cx} cy={cy} r={radius} fill="none"
        stroke={colors[i % colors.length]}
        strokeWidth="10"
        strokeDasharray={`${len} ${c}`}
        strokeDashoffset={-offset}
        transform={`rotate(-90 ${cx} ${cy})`}
        strokeLinecap="butt" />;


        offset += len;
        return seg;
      })}
      <text x={cx} y={cy + 4} textAnchor="middle" fontSize="14" fontWeight="600" fontFamily="JetBrains Mono, monospace" fill={COLORS.ink}>
        {total}
      </text>
    </svg>);

};

// ---- Heatmap mini ----
const Heatmap = ({ rows = 7, cols = 14 }) => {
  const cells = [];
  for (let r = 0; r < rows; r++) {
    for (let c = 0; c < cols; c++) {
      const intensity = Math.random();
      cells.push({ r, c, intensity });
    }
  }
  return (
    <div style={{ display: 'grid', gridTemplateColumns: `repeat(${cols}, 1fr)`, gap: 2, height: '100%' }}>
      {cells.map((cell, i) =>
      <div key={i} style={{
        aspectRatio: '1',
        background: `rgba(11, 79, 156, ${0.08 + cell.intensity * 0.8})`,
        borderRadius: 1
      }} />
      )}
    </div>);

};

// ---- Map placeholder (Georgia-ish silhouette) ----
const MiniMap = () =>
<svg viewBox="0 0 200 100" width="100%" height="100%" preserveAspectRatio="xMidYMid meet">
    <defs>
      <pattern id="dots" width="4" height="4" patternUnits="userSpaceOnUse">
        <circle cx="2" cy="2" r="0.6" fill={COLORS.line} />
      </pattern>
    </defs>
    <rect width="200" height="100" fill="url(#dots)" opacity="0.5" />
    <path d="M20,55 Q35,40 55,42 Q75,38 95,45 Q115,40 140,48 Q160,46 180,55 Q175,70 155,72 Q135,75 110,72 Q90,75 65,70 Q40,72 25,65 Z"
  fill={COLORS.blueL} stroke={COLORS.blue} strokeWidth="1" opacity="0.7" />
    {/* City dots */}
    <circle cx="80" cy="58" r="4" fill={COLORS.blue} />
    <circle cx="80" cy="58" r="8" fill={COLORS.blue} opacity="0.2" />
    <circle cx="130" cy="55" r="3" fill={COLORS.yellow} />
    <circle cx="130" cy="55" r="6" fill={COLORS.yellow} opacity="0.3" />
    <circle cx="50" cy="60" r="2" fill={COLORS.blue3} />
    <circle cx="160" cy="62" r="2.5" fill={COLORS.green} />
    <circle cx="105" cy="52" r="2" fill={COLORS.orange} />
  </svg>;


// ---- Funnel ----
const Funnel = ({ steps }) =>
<div style={{ display: 'flex', flexDirection: 'column', gap: 4, padding: 4 }}>
    {steps.map((s, i) =>
  <div key={i} style={{
    marginLeft: `${i * 8}%`, marginRight: `${i * 8}%`,
    background: `linear-gradient(90deg, ${COLORS.blue}, ${COLORS.blue2})`,
    opacity: 1 - i * 0.15,
    padding: '4px 8px',
    borderRadius: 3,
    color: 'white',
    fontSize: 9,
    fontFamily: 'JetBrains Mono, monospace',
    display: 'flex',
    justifyContent: 'space-between'
  }}>
        <span>{s.label}</span><span>{s.value}</span>
      </div>
  )}
  </div>;


// ---- Stacked bars ----
const StackedBars = ({ data, colors = [COLORS.blue, COLORS.yellow, COLORS.blue3] }) => {
  const max = Math.max(...data.map((d) => d.reduce((a, b) => a + b, 0)));
  return (
    <div style={{ display: 'flex', alignItems: 'flex-end', gap: 4, height: '100%', width: '100%' }}>
      {data.map((stack, i) => {
        const total = stack.reduce((a, b) => a + b, 0);
        return (
          <div key={i} style={{ flex: 1, height: `${total / max * 100}%`, minHeight: 8, display: 'flex', flexDirection: 'column-reverse', borderRadius: '2px 2px 0 0', overflow: 'hidden' }}>
            {stack.map((v, j) =>
            <div key={j} style={{ flex: v, background: colors[j % colors.length], minHeight: 1 }} />
            )}
          </div>);

      })}
    </div>);

};

// ============================================================
// HERO MAIN DASHBOARD MOCK
// ============================================================

const HeroDashboard = () => {
  const [tick, setTick] = React.useState(0);
  React.useEffect(() => {
    const t = setInterval(() => setTick((v) => v + 1), 2400);
    return () => clearInterval(t);
  }, []);

  const revenueData = [12, 18, 14, 22, 19, 28, 24, 32, 28, 35, 31, 38];
  const conversionData = [2.1, 2.4, 2.2, 2.8, 2.6, 3.2, 3.0, 3.6, 3.4, 4.1, 3.9, 4.5];
  const drift = (arr) => arr.map((v) => v * (0.95 + Math.sin(tick + v) * 0.05));

  return (
    <div className="dash-mock">
      <div className="dash-chrome">
        <div className="dash-chrome-dots">
          <span className="dash-chrome-dot"></span>
          <span className="dash-chrome-dot"></span>
          <span className="dash-chrome-dot"></span>
        </div>
        <div className="dash-chrome-title mono">retail-vip-analysis.pbix</div>
        <div className="dash-chrome-tag">LIVE</div>
      </div>
      <div className="dash-toolbar">
        <span className="dash-tab active">Overview</span>
        <span className="dash-tab">Customers</span>
        <span className="dash-tab">Products</span>
        <span className="dash-tab">Trends</span>
        <span style={{ flex: 1 }}></span>
        <span style={{ fontFamily: 'JetBrains Mono, monospace', fontSize: 10, color: COLORS.ink3 }}>Q1 2026 </span>
      </div>
      <div className="dash-body">
        {/* Top KPI row */}
        <div className="kpi-tile span-2">
          <div className="kpi-label">Revenue</div>
          <div className="kpi-value">2.84M</div>
          <div className="kpi-delta up">+12.4% vs LY</div>
          <Spark data={drift(revenueData)} color={COLORS.green} />
        </div>
        <div className="kpi-tile span-2">
          <div className="kpi-label">Active VIPs</div>
          <div className="kpi-value">1,284</div>
          <div className="kpi-delta up"> +84</div>
          <Spark data={[80, 85, 82, 88, 92, 95, 98, 102, 108, 112, 118, 128]} color={COLORS.blue} />
        </div>
        <div className="kpi-tile span-2">
          <div className="kpi-label">Avg Basket</div>
          <div className="kpi-value">\u20be 184</div>
          <div className="kpi-delta down">\u2198 -2.1%</div>
          <Spark data={[200, 195, 198, 192, 188, 190, 184, 186, 184, 182, 184, 184]} color={COLORS.red} />
        </div>

        {/* Big chart */}
        <div className="chart-tile span-4">
          <div className="chart-tile-title">
            <h4>Revenue vs. Forecast \ last 12 months</h4>
            <span className="menu"></span>
          </div>
          <div style={{ height: 110 }}>
            <LineChart series={[drift(revenueData), conversionData.map((v) => v * 8)]} w={280} h={110} colors={[COLORS.blue, COLORS.yellow]} />
          </div>
          <div style={{ display: 'flex', gap: 14, marginTop: 6, fontSize: 10, color: COLORS.ink3, fontFamily: 'JetBrains Mono, monospace' }}>
            <span><span style={{ display: 'inline-block', width: 8, height: 8, background: COLORS.blue, borderRadius: 1, marginRight: 4 }}></span>Revenue</span>
            <span><span style={{ display: 'inline-block', width: 8, height: 8, background: COLORS.yellow, borderRadius: 1, marginRight: 4 }}></span>Forecast</span>
          </div>
        </div>
        <div className="chart-tile span-2" style={{ alignItems: 'center', justifyContent: 'center' }}>
          <div className="chart-tile-title" style={{ width: '100%' }}>
            <h4>By segment</h4>
          </div>
          <Donut data={[42, 28, 18, 12]} size={86} />
        </div>
      </div>
    </div>);

};

// ============================================================
// GALLERY THUMBNAILS — small dashboards per project kind
// ============================================================

const GalleryThumb = ({ kind }) => {
  const wrap = (children) =>
  <div style={{ width: '100%', height: '100%', padding: 10, display: 'grid', gridTemplateRows: 'auto 1fr', gap: 6, background: COLORS.bgSoft }}>
      {children}
    </div>;


  const headerBar = (label) =>
  <div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', fontFamily: 'JetBrains Mono, monospace', fontSize: 8, color: COLORS.ink3 }}>
      <span style={{ background: COLORS.bg, border: `1px solid ${COLORS.line}`, borderRadius: 2, padding: '2px 5px' }}>{label}</span>
      <span style={{ display: 'inline-flex', gap: 3 }}>
        <span style={{ width: 4, height: 4, background: COLORS.green, borderRadius: '50%' }}></span>
        <span style={{ color: COLORS.green }}>LIVE</span>
      </span>
    </div>;


  const tile = (children, style = {}) =>
  <div style={{ background: COLORS.bg, border: `1px solid ${COLORS.line}`, borderRadius: 3, padding: 6, overflow: 'hidden', ...style }}>{children}</div>;


  switch (kind) {
    case 'restaurant':
      return wrap(<>
        {headerBar('madart-delivery.pbix')}
        <div style={{ display: 'grid', gridTemplateColumns: '1fr 1fr 1fr', gap: 4 }}>
          {tile(<><div style={{ fontSize: 7, color: COLORS.ink3 }}>ORDERS</div><div style={{ fontFamily: 'JetBrains Mono, monospace', fontSize: 13, fontWeight: 600 }}>3,482</div></>)}
          {tile(<><div style={{ fontSize: 7, color: COLORS.ink3 }}>SLA</div><div style={{ fontFamily: 'JetBrains Mono, monospace', fontSize: 13, fontWeight: 600, color: COLORS.green }}>96.2%</div></>)}
          {tile(<><div style={{ fontSize: 7, color: COLORS.ink3 }}>AOV</div><div style={{ fontFamily: 'JetBrains Mono, monospace', fontSize: 13, fontWeight: 600 }}>\u20be 28</div></>)}
          <div style={{ gridColumn: 'span 2', background: COLORS.bg, border: `1px solid ${COLORS.line}`, borderRadius: 3, padding: 6 }}>
            <BarChart data={[8, 12, 9, 14, 18, 22, 19, 25, 28, 24, 30, 26]} h={42} color={COLORS.blue} />
          </div>
          {tile(<Donut data={[40, 30, 20, 10]} size={50} />)}
        </div>
      </>);
    case 'automotive':
      return wrap(<>
        {headerBar('vehicle-parts-sales.pbix')}
        <div style={{ display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 4 }}>
          {tile(<><div style={{ fontSize: 7, color: COLORS.ink3 }}>MARGIN</div><div style={{ fontFamily: 'JetBrains Mono, monospace', fontSize: 13, fontWeight: 600 }}>34.8%</div><Spark data={[20, 25, 22, 28, 30, 32, 35]} w={50} h={14} /></>)}
          {tile(<><div style={{ fontSize: 7, color: COLORS.ink3 }}>STOCK RISK</div><div style={{ fontFamily: 'JetBrains Mono, monospace', fontSize: 13, fontWeight: 600, color: COLORS.orange }}>14 SKU</div></>)}
          <div style={{ gridColumn: 'span 2', background: COLORS.bg, border: `1px solid ${COLORS.line}`, borderRadius: 3, padding: 6 }}>
            <BarChart data={[120, 180, 150, 220, 190, 280, 240, 310]} labels={['BMW', 'Toy', 'VW', 'Hon', 'Kia', 'Nis', 'Mer', 'Aud']} horizontal />
          </div>
        </div>
      </>);
    case 'realestate':
      return wrap(<>
        {headerBar('contract-tracker.pbix')}
        <div style={{ display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 4, gridTemplateRows: 'auto 1fr' }}>
          <div style={{ gridColumn: 'span 2', background: COLORS.bg, border: `1px solid ${COLORS.line}`, borderRadius: 3, padding: 6 }}>
            <Funnel steps={[{ label: 'Leads', value: 480 }, { label: 'Tours', value: 280 }, { label: 'Offers', value: 124 }, { label: 'Closed', value: 62 }]} />
          </div>
          {tile(<><div style={{ fontSize: 7, color: COLORS.ink3 }}>VELOCITY</div><div style={{ fontFamily: 'JetBrains Mono, monospace', fontSize: 12, fontWeight: 600 }}>18 days</div></>)}
          {tile(<><div style={{ fontSize: 7, color: COLORS.ink3 }}>PIPELINE</div><div style={{ fontFamily: 'JetBrains Mono, monospace', fontSize: 12, fontWeight: 600 }}>$4.2M</div></>)}
        </div>
      </>);
    case 'retail':
      return wrap(<>
        {headerBar('retail-vip.pbix')}
        <div style={{ display: 'grid', gridTemplateColumns: '1fr 1fr 1fr', gap: 4 }}>
          {tile(<><div style={{ fontSize: 7, color: COLORS.ink3 }}>VIP COUNT</div><div style={{ fontFamily: 'JetBrains Mono, monospace', fontSize: 13, fontWeight: 600 }}>1,284</div></>)}
          {tile(<><div style={{ fontSize: 7, color: COLORS.ink3 }}>LTV</div><div style={{ fontFamily: 'JetBrains Mono, monospace', fontSize: 13, fontWeight: 600 }}>\u20be 4.8K</div></>)}
          {tile(<><div style={{ fontSize: 7, color: COLORS.ink3 }}>CHURN</div><div style={{ fontFamily: 'JetBrains Mono, monospace', fontSize: 13, fontWeight: 600, color: COLORS.red }}>3.2%</div></>)}
          <div style={{ gridColumn: 'span 3', background: COLORS.bg, border: `1px solid ${COLORS.line}`, borderRadius: 3, padding: 6 }}>
            <Heatmap rows={4} cols={12} />
          </div>
        </div>
      </>);
    case 'restaurant2':
      return wrap(<>
        {headerBar('restaurant-kpi.pbix')}
        <div style={{ display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 4 }}>
          {tile(<><div style={{ fontSize: 7, color: COLORS.ink3 }}>COVERS</div><div style={{ fontFamily: 'JetBrains Mono, monospace', fontSize: 13, fontWeight: 600 }}>284/d</div><BarChart data={[8, 12, 18, 22, 16, 20, 24]} h={20} /></>)}
          {tile(<><div style={{ fontSize: 7, color: COLORS.ink3 }}>FOOD COST</div><div style={{ fontFamily: 'JetBrains Mono, monospace', fontSize: 13, fontWeight: 600, color: COLORS.green }}>28.4%</div></>)}
          <div style={{ gridColumn: 'span 2', background: COLORS.bg, border: `1px solid ${COLORS.line}`, borderRadius: 3, padding: 6 }}>
            <LineChart series={[[20, 25, 30, 35, 28, 40, 38, 45, 42, 50, 48, 52]]} w={200} h={50} colors={[COLORS.orange]} />
          </div>
        </div>
      </>);
    case 'construction':
      return wrap(<>
        {headerBar('project-margin.pbix')}
        <div style={{ display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 4 }}>
          {tile(<><div style={{ fontSize: 7, color: COLORS.ink3 }}>EARNED VAL</div><div style={{ fontFamily: 'JetBrains Mono, monospace', fontSize: 13, fontWeight: 600 }}>$2.1M</div></>)}
          {tile(<><div style={{ fontSize: 7, color: COLORS.ink3 }}>VARIANCE</div><div style={{ fontFamily: 'JetBrains Mono, monospace', fontSize: 13, fontWeight: 600, color: COLORS.red }}>-4.2%</div></>)}
          <div style={{ gridColumn: 'span 2', background: COLORS.bg, border: `1px solid ${COLORS.line}`, borderRadius: 3, padding: 6 }}>
            <StackedBars data={[[20, 15, 8], [24, 18, 10], [18, 22, 12], [28, 20, 8], [32, 18, 14], [26, 24, 10]]} />
          </div>
        </div>
      </>);
    case 'cosmetics':
      return wrap(<>
        {headerBar('cosmetics-sku.pbix')}
        <div style={{ display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 4, height: '100%' }}>
          <div style={{ background: COLORS.bg, border: `1px solid ${COLORS.line}`, borderRadius: 3, padding: 6 }}>
            <Donut data={[35, 28, 18, 12, 7]} colors={[COLORS.purple, COLORS.yellow, COLORS.blue, COLORS.greenL, COLORS.orange]} size={70} />
          </div>
          <div style={{ display: 'grid', gridTemplateRows: '1fr 1fr', gap: 4 }}>
            {tile(<><div style={{ fontSize: 7, color: COLORS.ink3 }}>HERO SKU</div><div style={{ fontFamily: 'JetBrains Mono, monospace', fontSize: 11, fontWeight: 600 }}>Lipstick #24</div></>)}
            {tile(<><div style={{ fontSize: 7, color: COLORS.ink3 }}>RETURNS</div><div style={{ fontFamily: 'JetBrains Mono, monospace', fontSize: 11, fontWeight: 600 }}>2.8%</div></>)}
          </div>
        </div>
      </>);
    case 'automotive2':
      return wrap(<>
        {headerBar('service-dept.pbix')}
        <div style={{ display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 4 }}>
          {tile(<><div style={{ fontSize: 7, color: COLORS.ink3 }}>BAY UTIL</div><div style={{ fontFamily: 'JetBrains Mono, monospace', fontSize: 13, fontWeight: 600 }}>78%</div></>)}
          {tile(<><div style={{ fontSize: 7, color: COLORS.ink3 }}>HOURS BILLED</div><div style={{ fontFamily: 'JetBrains Mono, monospace', fontSize: 13, fontWeight: 600 }}>1,284</div></>)}
          <div style={{ gridColumn: 'span 2', background: COLORS.bg, border: `1px solid ${COLORS.line}`, borderRadius: 3, padding: 6 }}>
            <BarChart data={[18, 22, 15, 24, 28, 20, 26, 30]} labels={['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'M1', 'M2']} horizontal />
          </div>
        </div>
      </>);
    case 'retail2':
      return wrap(<>
        {headerBar('multi-brand.pbix')}
        <div style={{ display: 'grid', gridTemplateColumns: '1fr 1fr 1fr', gap: 4 }}>
          {tile(<><div style={{ fontSize: 7, color: COLORS.ink3 }}>BRANDS</div><div style={{ fontFamily: 'JetBrains Mono, monospace', fontSize: 13, fontWeight: 600 }}>14</div></>)}
          {tile(<><div style={{ fontSize: 7, color: COLORS.ink3 }}>STORES</div><div style={{ fontFamily: 'JetBrains Mono, monospace', fontSize: 13, fontWeight: 600 }}>62</div></>)}
          {tile(<><div style={{ fontSize: 7, color: COLORS.ink3 }}>SELL-THRU</div><div style={{ fontFamily: 'JetBrains Mono, monospace', fontSize: 13, fontWeight: 600, color: COLORS.green }}>68%</div></>)}
          <div style={{ gridColumn: 'span 3', background: COLORS.bg, border: `1px solid ${COLORS.line}`, borderRadius: 3, padding: 6, height: 60 }}>
            <MiniMap />
          </div>
        </div>
      </>);
    default:
      return wrap(<>{headerBar('dashboard.pbix')}</>);
  }
};

Object.assign(window, {
  Spark, BarChart, LineChart, Donut, Heatmap, MiniMap, Funnel, StackedBars,
  HeroDashboard, GalleryThumb, COLORS
});