(async () => {
  try {
    const res = await fetch(chrome.runtime.getURL('data/sponsors.json'));
    const data = await res.json();
    const meta = data.meta || {};

    document.getElementById('count').textContent =
      (meta.uniqueKeys || 0).toLocaleString();

    const d = meta.generatedAt ? new Date(meta.generatedAt) : null;
    document.getElementById('updated').textContent =
      d ? d.toLocaleDateString() : '—';

    if (meta.isSample) document.getElementById('warn').style.display = 'block';
  } catch (e) {
    document.getElementById('count').textContent = 'error';
  }
})();
