
const Icon = ({ d, size = 16, fill, stroke = "currentColor", strokeWidth = 1.5, children, ...rest }) => (
  <svg xmlns="http://www.w3.org/2000/svg" width={size} height={size} viewBox="0 0 24 24"
    fill={fill || "none"} stroke={stroke} strokeWidth={strokeWidth} strokeLinecap="round" strokeLinejoin="round" {...rest}>
    {d ? <path d={d}/> : children}
  </svg>
);

const I = {
  Search:   p => <Icon {...p}><circle cx="11" cy="11" r="7"/><path d="m20 20-3.5-3.5"/></Icon>,
  Plus:     p => <Icon {...p}><path d="M12 5v14M5 12h14"/></Icon>,
  Minus:    p => <Icon {...p}><path d="M5 12h14"/></Icon>,
  X:        p => <Icon {...p}><path d="M6 6 18 18M18 6 6 18"/></Icon>,
  Check:    p => <Icon {...p}><path d="m5 12 5 5 9-11"/></Icon>,
  ChevronDown: p => <Icon {...p}><path d="m6 9 6 6 6-6"/></Icon>,
  ChevronRight: p => <Icon {...p}><path d="m9 6 6 6-6 6"/></Icon>,
  ChevronUpDown: p => <Icon {...p}><path d="m8 9 4-4 4 4M8 15l4 4 4-4"/></Icon>,
  Play:     p => <Icon {...p}><path d="M7 5v14l12-7L7 5z" fill="currentColor" stroke="currentColor"/></Icon>,
  More:     p => <Icon {...p}><circle cx="5" cy="12" r="1.2" fill="currentColor"/><circle cx="12" cy="12" r="1.2" fill="currentColor"/><circle cx="19" cy="12" r="1.2" fill="currentColor"/></Icon>,
  MoreV:    p => <Icon {...p}><circle cx="12" cy="5" r="1.2" fill="currentColor"/><circle cx="12" cy="12" r="1.2" fill="currentColor"/><circle cx="12" cy="19" r="1.2" fill="currentColor"/></Icon>,
  Filter:   p => <Icon {...p}><path d="M3 5h18l-7 9v5l-4 2v-7L3 5z"/></Icon>,
  User:     p => <Icon {...p}><circle cx="12" cy="8" r="4"/><path d="M4 21a8 8 0 0 1 16 0"/></Icon>,
  Users:    p => <Icon {...p}><circle cx="9" cy="8" r="4"/><path d="M2 21a7 7 0 0 1 14 0"/><path d="M16 3.5A4 4 0 0 1 16 11.5"/><path d="M22 21a6 6 0 0 0-4-5.7"/></Icon>,
  Folder:   p => <Icon {...p}><path d="M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V7Z"/></Icon>,
  Tag:      p => <Icon {...p}><path d="M3 12V4h8l10 10-8 8L3 12Z"/><circle cx="8" cy="9" r="1.4" fill="currentColor"/></Icon>,
  Globe:    p => <Icon {...p}><circle cx="12" cy="12" r="9"/><path d="M3 12h18M12 3a14 14 0 0 1 0 18M12 3a14 14 0 0 0 0 18"/></Icon>,
  Shield:   p => <Icon {...p}><path d="M12 3 4 6v6c0 5 3.5 8 8 9 4.5-1 8-4 8-9V6l-8-3Z"/></Icon>,
  Cookie:   p => <Icon {...p}><path d="M12 3a9 9 0 1 0 9 9 4 4 0 0 1-5-5 4 4 0 0 1-4-4Z"/><circle cx="9" cy="10" r=".8" fill="currentColor"/><circle cx="14" cy="14" r=".8" fill="currentColor"/><circle cx="9" cy="15" r=".8" fill="currentColor"/></Icon>,
  Settings: p => <Icon {...p}><circle cx="12" cy="12" r="3"/><path d="M19.4 15a1.7 1.7 0 0 0 .3 1.8l.1.1a2 2 0 1 1-2.8 2.8l-.1-.1a1.7 1.7 0 0 0-1.8-.3 1.7 1.7 0 0 0-1 1.5V21a2 2 0 1 1-4 0v-.1a1.7 1.7 0 0 0-1.1-1.5 1.7 1.7 0 0 0-1.8.3l-.1.1a2 2 0 1 1-2.8-2.8l.1-.1a1.7 1.7 0 0 0 .3-1.8 1.7 1.7 0 0 0-1.5-1H3a2 2 0 1 1 0-4h.1a1.7 1.7 0 0 0 1.5-1.1 1.7 1.7 0 0 0-.3-1.8l-.1-.1a2 2 0 1 1 2.8-2.8l.1.1a1.7 1.7 0 0 0 1.8.3H9a1.7 1.7 0 0 0 1-1.5V3a2 2 0 1 1 4 0v.1a1.7 1.7 0 0 0 1 1.5 1.7 1.7 0 0 0 1.8-.3l.1-.1a2 2 0 1 1 2.8 2.8l-.1.1a1.7 1.7 0 0 0-.3 1.8V9a1.7 1.7 0 0 0 1.5 1H21a2 2 0 1 1 0 4h-.1a1.7 1.7 0 0 0-1.5 1Z"/></Icon>,
  Window:   p => <Icon {...p}><rect x="3" y="4" width="18" height="16" rx="2"/><path d="M3 9h18"/></Icon>,
  Apple:    p => <Icon {...p}><path d="M16 13c0-3 2.5-4 2.5-4-1.4-2-3.5-2-4.5-2-2 0-3 1-4 1s-2-1-3.5-1C4 7 2 9.5 2 13.5 2 18 5 22 7 22c1 0 2-1 3.5-1S13 22 14 22c2 0 4.5-3 4.5-5 0 0-2.5-1-2.5-4Z"/><path d="M13 5c.5-.7 1-1.5 1-3-1.5.1-3 1-3 3Z"/></Icon>,
  Linux:    p => <Icon {...p}><path d="M12 3c-2 0-3 2-3 4 0 1.5.5 2 .5 3.5S8 13 7 14.5C6 16 5 18 6 19l3 1 1-2h4l1 2 3-1c1-1 0-3-1-4.5S14.5 12 14.5 10.5 15 8.5 15 7c0-2-1-4-3-4Z"/></Icon>,
  Download: p => <Icon {...p}><path d="M12 3v12m-5-5 5 5 5-5"/><path d="M5 21h14"/></Icon>,
  Upload:   p => <Icon {...p}><path d="M12 21V9m-5 5 5-5 5 5"/><path d="M5 3h14"/></Icon>,
  Copy:     p => <Icon {...p}><rect x="9" y="9" width="12" height="12" rx="2"/><path d="M5 15V5a2 2 0 0 1 2-2h10"/></Icon>,
  Edit:     p => <Icon {...p}><path d="m4 20 4-1 11-11-3-3L5 16l-1 4Z"/></Icon>,
  Trash:    p => <Icon {...p}><path d="M3 6h18M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2m1 0v13a2 2 0 0 1-2 2H9a2 2 0 0 1-2-2V6"/></Icon>,
  Note:     p => <Icon {...p}><path d="M5 4h11l4 4v12a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2Z"/><path d="M9 12h6M9 16h4"/></Icon>,
  Refresh:  p => <Icon {...p}><path d="M21 12a9 9 0 1 1-3-6.7L21 8"/><path d="M21 3v5h-5"/></Icon>,
  Power:    p => <Icon {...p}><path d="M12 3v9"/><path d="M5.6 7.6a8 8 0 1 0 12.8 0"/></Icon>,
  Lock:     p => <Icon {...p}><rect x="4" y="11" width="16" height="10" rx="2"/><path d="M8 11V8a4 4 0 0 1 8 0v3"/></Icon>,
  Eye:      p => <Icon {...p}><path d="M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7S2 12 2 12Z"/><circle cx="12" cy="12" r="3"/></Icon>,
  EyeOff:   p => <Icon {...p}><path d="M3 3l18 18"/><path d="M10.6 5.1A10 10 0 0 1 22 12s-1.5 3-4 5"/><path d="M6 6.5C3.5 8.5 2 12 2 12s3.5 7 10 7c2 0 3.7-.5 5.1-1.3"/><path d="M9.9 9.9a3 3 0 0 0 4.2 4.2"/></Icon>,
  Star:     p => <Icon {...p}><path d="m12 3 2.6 5.5 6 .8-4.3 4.2 1 6L12 16.8 6.7 19.5l1-6L3.4 9.3l6-.8L12 3Z"/></Icon>,
  Star2:    p => <Icon {...p} fill="currentColor" stroke="none"><path d="m12 3 2.6 5.5 6 .8-4.3 4.2 1 6L12 16.8 6.7 19.5l1-6L3.4 9.3l6-.8L12 3Z"/></Icon>,
  Bolt:     p => <Icon {...p}><path d="M13 2 3 14h7l-1 8 10-12h-7l1-8Z"/></Icon>,
  Sort:     p => <Icon {...p}><path d="M7 4v16m0 0-3-3m3 3 3-3M17 20V4m0 0-3 3m3-3 3 3"/></Icon>,
  ArrowLeft: p => <Icon {...p}><path d="M19 12H5m0 0 7-7m-7 7 7 7"/></Icon>,
  ExternalLink: p => <Icon {...p}><path d="M14 4h6v6"/><path d="M20 4 10 14"/><path d="M20 13v5a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h5"/></Icon>,
  Clock:    p => <Icon {...p}><circle cx="12" cy="12" r="9"/><path d="M12 7v5l3 2"/></Icon>,
  Logo: (p) => (
    <Icon {...p} viewBox="0 0 24 24">
      <path d="M4 4h16l-8 16L4 4Z" stroke="currentColor"/>
      <path d="M9 4h6l-3 6-3-6Z" fill="currentColor" stroke="none"/>
    </Icon>
  ),
  Stop:     p => <Icon {...p}><rect x="6" y="6" width="12" height="12" rx="1.5" fill="currentColor" stroke="currentColor"/></Icon>,
  Pause:    p => <Icon {...p}><rect x="7" y="5" width="3.5" height="14" rx="1" fill="currentColor" stroke="currentColor"/><rect x="13.5" y="5" width="3.5" height="14" rx="1" fill="currentColor" stroke="currentColor"/></Icon>,
  Camera:   p => <Icon {...p}><path d="M4 8h3l2-3h6l2 3h3a1 1 0 0 1 1 1v9a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V9a1 1 0 0 1 1-1Z"/><circle cx="12" cy="13" r="3.5"/></Icon>,
  Hash:     p => <Icon {...p}><path d="M5 9h14M5 15h14M10 4l-2 16M16 4l-2 16"/></Icon>,
  Image:    p => <Icon {...p}><rect x="3" y="4" width="18" height="16" rx="2"/><circle cx="9" cy="10" r="1.5"/><path d="m3 17 5-5 4 4 3-3 6 6"/></Icon>,
  Terminal: p => <Icon {...p}><rect x="3" y="4" width="18" height="16" rx="2"/><path d="m7 9 3 3-3 3M13 15h4"/></Icon>,
  FolderOpen:p=> <Icon {...p}><path d="M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v0H3V7Z"/><path d="M3 9h18l-2 9a2 2 0 0 1-2 1.6H5A2 2 0 0 1 3 18V9Z"/></Icon>,
  Grid:     p => <Icon {...p}><rect x="4" y="4" width="7" height="7" rx="1"/><rect x="13" y="4" width="7" height="7" rx="1"/><rect x="4" y="13" width="7" height="7" rx="1"/><rect x="13" y="13" width="7" height="7" rx="1"/></Icon>,
  Layers:   p => <Icon {...p}><path d="M12 3 2 9l10 6 10-6-10-6Z"/><path d="m2 15 10 6 10-6"/></Icon>,
  Server:   p => <Icon {...p}><rect x="3" y="4" width="18" height="7" rx="2"/><rect x="3" y="13" width="18" height="7" rx="2"/><circle cx="7" cy="7.5" r=".8" fill="currentColor"/><circle cx="7" cy="16.5" r=".8" fill="currentColor"/></Icon>,
  AlertTriangle: p => <Icon {...p}><path d="M10.3 3.9 1.8 18a2 2 0 0 0 1.7 3h17a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0Z"/><path d="M12 9v4M12 17h.01"/></Icon>,
  BarChart: p => <Icon {...p}><path d="M4 20V10M10 20V4M16 20v-7M22 20H2"/></Icon>,
  Globe2:   p => <Icon {...p}><circle cx="12" cy="12" r="9"/><path d="M3 12h18M12 3a14 14 0 0 1 0 18M12 3a14 14 0 0 0 0 18"/></Icon>,
  LogOut:   p => <Icon {...p}><path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"/><path d="m16 17 5-5-5-5"/><path d="M21 12H9"/></Icon>,
};

window.I = I;
window.Icon = Icon;
