// W2Go iconography — line icons, 24px viewBox, current color stroke.

const Icon = ({ d, size = 22, stroke = 1.6, fill = 'none', children, ...rest }) => (
  <svg width={size} height={size} viewBox="0 0 24 24" fill={fill}
       stroke="currentColor" strokeWidth={stroke} strokeLinecap="round" strokeLinejoin="round" {...rest}>
    {d ? <path d={d}/> : children}
  </svg>
);

const Ic = {
  Back:     (p) => <Icon {...p}><path d="M15 5l-7 7 7 7"/></Icon>,
  Close:    (p) => <Icon {...p}><path d="M6 6l12 12M18 6L6 18"/></Icon>,
  Search:   (p) => <Icon {...p}><circle cx="11" cy="11" r="6.5"/><path d="M20 20l-3.5-3.5"/></Icon>,
  Pin:      (p) => <Icon {...p}><path d="M12 22s7-7.5 7-13a7 7 0 10-14 0c0 5.5 7 13 7 13z"/><circle cx="12" cy="9" r="2.5"/></Icon>,
  Crosshair:(p) => <Icon {...p}><circle cx="12" cy="12" r="3.5"/><path d="M12 2v3M12 19v3M2 12h3M19 12h3"/></Icon>,
  Home:     (p) => <Icon {...p}><path d="M4 11l8-7 8 7v9a1 1 0 01-1 1h-5v-7h-4v7H5a1 1 0 01-1-1v-9z"/></Icon>,
  Bag:      (p) => <Icon {...p}><path d="M5 8h14l-1.2 11.2a2 2 0 01-2 1.8H8.2a2 2 0 01-2-1.8L5 8z"/><path d="M9 8V6a3 3 0 016 0v2"/></Icon>,
  Bell:     (p) => <Icon {...p}><path d="M6 18l-1 1h14l-1-1V12a6 6 0 10-12 0v6z"/><path d="M10 21a2 2 0 004 0"/></Icon>,
  User:     (p) => <Icon {...p}><circle cx="12" cy="8" r="4"/><path d="M4 21c1.5-4.5 5-6 8-6s6.5 1.5 8 6"/></Icon>,
  Heart:    (p) => <Icon {...p}><path d="M12 20s-7-4.5-9-9.2C1.6 7.4 4 4 7.5 4 9.6 4 11 5.2 12 6.8 13 5.2 14.4 4 16.5 4 20 4 22.4 7.4 21 10.8 19 15.5 12 20 12 20z"/></Icon>,
  HeartFill:(p) => <Icon fill="currentColor" {...p}><path d="M12 20s-7-4.5-9-9.2C1.6 7.4 4 4 7.5 4 9.6 4 11 5.2 12 6.8 13 5.2 14.4 4 16.5 4 20 4 22.4 7.4 21 10.8 19 15.5 12 20 12 20z"/></Icon>,
  Plus:     (p) => <Icon {...p}><path d="M12 5v14M5 12h14"/></Icon>,
  Minus:    (p) => <Icon {...p}><path d="M5 12h14"/></Icon>,
  Check:    (p) => <Icon {...p}><path d="M5 12.5l4.5 4.5L20 7"/></Icon>,
  Star:     (p) => <Icon fill="currentColor" stroke="none" {...p}><path d="M12 2.8l2.7 5.7 6.3.9-4.6 4.4 1.1 6.2L12 17.1l-5.5 2.9 1.1-6.2L3 9.4l6.3-.9L12 2.8z"/></Icon>,
  Arrow:    (p) => <Icon {...p}><path d="M5 12h14M14 6l6 6-6 6"/></Icon>,
  Filter:   (p) => <Icon {...p}><path d="M4 6h16M7 12h10M10 18h4"/></Icon>,
  Clock:    (p) => <Icon {...p}><circle cx="12" cy="12" r="9"/><path d="M12 7v5l3 2"/></Icon>,
  Fire:     (p) => <Icon {...p}><path d="M12 3c1 3 4 4 4 8a4 4 0 11-8 0c0-1.5.5-2.5 1.5-3.5C9 9.5 11 7 12 3z"/></Icon>,
  Leaf:     (p) => <Icon {...p}><path d="M4 20c0-8 6-14 16-14 0 10-6 16-14 16-1 0-2-1-2-2zM4 20l8-8"/></Icon>,
  Card:     (p) => <Icon {...p}><rect x="2.5" y="6" width="19" height="13" rx="2"/><path d="M2.5 10.5h19M6 15.5h3"/></Icon>,
  Wallet:   (p) => <Icon {...p}><path d="M3 7h15a2 2 0 012 2v8a2 2 0 01-2 2H5a2 2 0 01-2-2V7zM3 7l2-3h11"/><circle cx="17" cy="13" r="1.5" fill="currentColor"/></Icon>,
  Bike:     (p) => <Icon {...p}><circle cx="5.5" cy="17" r="3.2"/><circle cx="18" cy="17" r="3.2"/><path d="M5.5 17l4-9h3l3 9M9.5 8h-2M12.5 8l1.5-3h2"/></Icon>,
  Door:     (p) => <Icon {...p}><path d="M6 21V4a1 1 0 011-1h7a1 1 0 011 1v17"/><path d="M3 21h18M11.5 12h.01"/></Icon>,
  Receipt:  (p) => <Icon {...p}><path d="M6 3h12v18l-2-1.5L14 21l-2-1.5L10 21l-2-1.5L6 21V3z"/><path d="M9 8h6M9 12h6M9 16h4"/></Icon>,
  Spark:    (p) => <Icon {...p}><path d="M12 3l1.5 5L19 9.5 13.5 11 12 16l-1.5-5L5 9.5 10.5 8 12 3z"/></Icon>,
  Tag:      (p) => <Icon {...p}><path d="M3 12V4h8l10 10-8 8L3 12z"/><circle cx="8" cy="8" r="1.4" fill="currentColor"/></Icon>,
  ChevronR: (p) => <Icon {...p}><path d="M9 5l7 7-7 7"/></Icon>,
  ChevronD: (p) => <Icon {...p}><path d="M5 9l7 7 7-7"/></Icon>,
  Wifi:     (p) => <Icon {...p}><path d="M2 8.5C5 5.5 8.4 4 12 4s7 1.5 10 4.5M5.5 12C7.5 10 9.7 9 12 9s4.5 1 6.5 3M9 15.5c.9-.9 1.9-1.3 3-1.3s2.1.4 3 1.3"/><circle cx="12" cy="19" r="1.2" fill="currentColor"/></Icon>,
  Apple:    (p) => <Icon stroke="none" fill="currentColor" {...p}><path d="M16.5 12.5c0-2.4 2-3.6 2.1-3.7-1.1-1.7-2.9-1.9-3.5-1.9-1.5-.2-2.9.9-3.6.9-.8 0-1.9-.9-3.1-.8-1.6 0-3.1.9-3.9 2.4-1.7 2.9-.4 7.2 1.2 9.5.8 1.1 1.7 2.4 2.9 2.3 1.2 0 1.6-.7 3.1-.7 1.5 0 1.8.7 3.1.7 1.3 0 2.1-1.1 2.9-2.3.9-1.3 1.3-2.6 1.3-2.7-.1-.1-2.5-1-2.5-3.7zM14 5.2C14.6 4.4 15 3.3 14.9 2.2c-1 0-2.1.7-2.8 1.5-.6.7-1.1 1.8-1 2.9 1.1.1 2.2-.6 2.9-1.4z"/></Icon>,
  Google:   (p) => <Icon stroke="none" {...p}><path fill="#4285F4" d="M21.6 12.2c0-.7-.1-1.4-.2-2H12v3.8h5.4c-.2 1.2-1 2.3-2.1 3v2.5h3.4c2-1.8 3-4.6 2.9-7.3z"/><path fill="#34A853" d="M12 22c2.7 0 5-.9 6.7-2.5l-3.4-2.5c-.9.6-2.1 1-3.3 1-2.5 0-4.7-1.7-5.4-4H3.1v2.5C4.8 19.9 8.1 22 12 22z"/><path fill="#FBBC05" d="M6.6 14c-.4-1.2-.4-2.5 0-3.7V7.7H3.1c-1.4 2.8-1.4 6 0 8.8L6.6 14z"/><path fill="#EA4335" d="M12 5.4c1.5 0 2.8.5 3.8 1.5l2.9-2.9C16.9 2.3 14.6 1.4 12 1.4c-3.9 0-7.2 2.1-8.9 5.3l3.5 2.7c.7-2.3 2.9-4 5.4-4z"/></Icon>,
  Phone:    (p) => <Icon {...p}><path d="M5 4h4l2 5-2.5 1.5a11 11 0 005 5L15 13l5 2v4a1 1 0 01-1 1A15 15 0 014 5a1 1 0 011-1z"/></Icon>,
  Mail:     (p) => <Icon {...p}><rect x="3" y="5" width="18" height="14" rx="2"/><path d="M3 7l9 6 9-6"/></Icon>,
  Lock:     (p) => <Icon {...p}><rect x="5" y="11" width="14" height="10" rx="2"/><path d="M8 11V8a4 4 0 018 0v3"/></Icon>,
  Sliders:  (p) => <Icon {...p}><path d="M4 7h10M18 7h2M4 17h2M10 17h10"/><circle cx="16" cy="7" r="2"/><circle cx="8" cy="17" r="2"/></Icon>,
  Map:      (p) => <Icon {...p}><path d="M3 6l6-2 6 2 6-2v14l-6 2-6-2-6 2V6z"/><path d="M9 4v16M15 6v16"/></Icon>,
  Box:      (p) => <Icon {...p}><path d="M3.5 7.5L12 3l8.5 4.5v9L12 21l-8.5-4.5v-9z"/><path d="M3.5 7.5L12 12l8.5-4.5M12 12v9"/></Icon>,
};

window.Ic = Ic;
