/* Thredly dashboard icon set — stroke-based, 1.6 default, currentColor */
const Svg = ({ d, size = 20, sw = 1.6, fill, children, vb = 24, style, className }) => (
  <svg width={size} height={size} viewBox={`0 0 ${vb} ${vb}`} fill={fill || 'none'}
       stroke={fill ? 'none' : 'currentColor'} strokeWidth={sw}
       strokeLinecap="round" strokeLinejoin="round" style={style} className={className} aria-hidden="true">
    {children || (d && <path d={d} />)}
  </svg>
);

const Icon = {
  grid: (p) => <Svg {...p}><rect x="3.5" y="3.5" width="7" height="7" rx="1.5"/><rect x="13.5" y="3.5" width="7" height="7" rx="1.5"/><rect x="3.5" y="13.5" width="7" height="7" rx="1.5"/><rect x="13.5" y="13.5" width="7" height="7" rx="1.5"/></Svg>,
  home: (p) => <Svg {...p}><path d="M4 11.5 12 4l8 7.5"/><path d="M5.5 10v9.5h13V10"/><path d="M9.8 19.5V14h4.4v5.5"/></Svg>,
  book: (p) => <Svg {...p}><path d="M5 4.5h9a3 3 0 0 1 3 3V20a2.5 2.5 0 0 0-2.5-2.5H5z"/><path d="M5 4.5v13"/></Svg>,
  template: (p) => <Svg {...p}><rect x="3.5" y="4" width="17" height="16" rx="2"/><path d="M3.5 9h17M9 9v11"/></Svg>,
  gear: (p) => <Svg {...p}><circle cx="12" cy="12" r="3.2"/><path d="M12 2.8v2.4M12 18.8v2.4M5.3 5.3l1.7 1.7M17 17l1.7 1.7M2.8 12h2.4M18.8 12h2.4M5.3 18.7l1.7-1.7M17 7l1.7-1.7"/></Svg>,
  chevDown: (p) => <Svg {...p}><path d="M6 9l6 6 6-6"/></Svg>,
  chevRight: (p) => <Svg {...p}><path d="M9 6l6 6-6 6"/></Svg>,
  plus: (p) => <Svg {...p}><path d="M12 5v14M5 12h14"/></Svg>,
  search: (p) => <Svg {...p}><circle cx="11" cy="11" r="6.5"/><path d="M20 20l-3.8-3.8"/></Svg>,
  bell: (p) => <Svg {...p}><path d="M18 8.5a6 6 0 1 0-12 0c0 6-2 7-2 7h16s-2-1-2-7"/><path d="M10 21a2 2 0 0 0 4 0"/></Svg>,
  eye: (p) => <Svg {...p}><path d="M2.5 12S6 5.5 12 5.5 21.5 12 21.5 12 18 18.5 12 18.5 2.5 12 2.5 12Z"/><circle cx="12" cy="12" r="3"/></Svg>,
  pencil: (p) => <Svg {...p}><path d="M16.5 4.5l3 3M4 20l1-4L16 5l3 3L8 19z"/></Svg>,
  views: (p) => <Svg {...p}><path d="M4 19V9M9.5 19V5M15 19v-7M20.5 19v-10"/></Svg>,
  clock: (p) => <Svg {...p}><circle cx="12" cy="12" r="8.5"/><path d="M12 7.5V12l3 2"/></Svg>,
  arrowUp: (p) => <Svg {...p}><path d="M12 19V6M6 11l6-6 6 6"/></Svg>,
  arrowRight: (p) => <Svg {...p}><path d="M5 12h14M13 6l6 6-6 6"/></Svg>,
  arrowLeft: (p) => <Svg {...p}><path d="M19 12H5M11 6l-6 6 6 6"/></Svg>,
  external: (p) => <Svg {...p}><path d="M14 5h5v5M19 5l-8 8M16 13v5.5a1.5 1.5 0 0 1-1.5 1.5h-9A1.5 1.5 0 0 1 4 18.5v-9A1.5 1.5 0 0 1 5.5 8H11"/></Svg>,
  calendar: (p) => <Svg {...p}><rect x="3.5" y="5" width="17" height="15.5" rx="2"/><path d="M3.5 9.5h17M8 3v4M16 3v4"/></Svg>,
  layers: (p) => <Svg {...p}><path d="M12 3.5 21 8l-9 4.5L3 8z"/><path d="M3 12l9 4.5L21 12M3 16l9 4.5L21 16"/></Svg>,
  tag: (p) => <Svg {...p}><path d="M12.5 2.6A2 2 0 0 0 11.1 2H4.5A1.5 1.5 0 0 0 3 3.5v6.6a2 2 0 0 0 .6 1.4l8.7 8.7a2 2 0 0 0 2.8 0l6.3-6.3a2 2 0 0 0 0-2.8z"/><circle cx="7.8" cy="7.8" r="1.2"/></Svg>,
  cards: (p) => <Svg {...p}><rect x="3.5" y="4.5" width="17" height="12.5" rx="2"/><path d="M7 20.5h10"/></Svg>,
  info: (p) => <Svg {...p}><circle cx="12" cy="12" r="8.5"/><path d="M12 11v5M12 7.6v.4"/></Svg>,
  dots: (p) => <Svg {...p}><circle cx="5" cy="12" r="1.4" fill="currentColor" stroke="none"/><circle cx="12" cy="12" r="1.4" fill="currentColor" stroke="none"/><circle cx="19" cy="12" r="1.4" fill="currentColor" stroke="none"/></Svg>,
  sparkle: (p) => <Svg {...p}><path d="M12 3.5l1.8 4.7L18.5 10l-4.7 1.8L12 16.5l-1.8-4.7L5.5 10l4.7-1.8z"/></Svg>,
  check: (p) => <Svg {...p}><path d="M5 12.5l4.5 4.5L19 6.5"/></Svg>,
  star: (p) => <Svg {...p}><path d="M12 3.6l2.6 5.7 6.1.6-4.6 4.1 1.4 6L12 17l-5.5 3 1.4-6-4.6-4.1 6.1-.6z"/></Svg>,
  rocket: (p) => <Svg {...p}><path d="M5.5 14.5c-1.5 1-2 4-2 4s3-.5 4-2M9 15l-3-3c1-4 4-7.5 8.5-8.5C18.5 3 19.5 4 19.5 4s1 1 .5 5.5C19 14 15.5 17 11.5 18z"/><circle cx="14.5" cy="9.5" r="1.6"/></Svg>,
  question: (p) => <Svg {...p}><circle cx="12" cy="12" r="8.5"/><path d="M9.5 9.3a2.5 2.5 0 0 1 4.8.9c0 1.7-2.3 2-2.3 3.6M12 17.2v.2"/></Svg>,
  users: (p) => <Svg {...p}><circle cx="9" cy="8.5" r="3"/><path d="M3.5 19.5c0-3 2.4-5 5.5-5s5.5 2 5.5 5"/><path d="M15.5 6.2a3 3 0 0 1 0 5.6M16.5 14.6c2.4.5 4 2.3 4 4.9"/></Svg>,
  building: (p) => <Svg {...p}><rect x="5" y="3.5" width="11" height="17" rx="1.5"/><path d="M16 8.5h3.5v12H4"/><path d="M8.5 7h4M8.5 10.5h4M8.5 14h4"/></Svg>,
  file: (p) => <Svg {...p}><path d="M6 3.5h7l5 5v12H6z"/><path d="M13 3.5V8.5h5"/><path d="M9 13h6M9 16.5h6"/></Svg>,
  x: (p) => <Svg {...p}><path d="M6 6l12 12M18 6 6 18"/></Svg>,
  folder: (p) => <Svg {...p}><path d="M3.5 6.5a1.5 1.5 0 0 1 1.5-1.5h4l2 2.2h7.5a1.5 1.5 0 0 1 1.5 1.5v8.3a1.5 1.5 0 0 1-1.5 1.5H5a1.5 1.5 0 0 1-1.5-1.5z"/></Svg>,
  chevUpDown: (p) => <Svg {...p}><path d="M8 9.5l4-4 4 4M8 14.5l4 4 4-4"/></Svg>,
  trash: (p) => <Svg {...p}><path d="M4 7h16M10 7V5h4v2M6.5 7l.8 12.6a1 1 0 0 0 1 .94h7.4a1 1 0 0 0 1-.94L17.5 7M10 11v6M14 11v6"/></Svg>,
  grip: (p) => <Svg {...p}><g fill="currentColor" stroke="none"><circle cx="9" cy="6" r="1.45"/><circle cx="15" cy="6" r="1.45"/><circle cx="9" cy="12" r="1.45"/><circle cx="15" cy="12" r="1.45"/><circle cx="9" cy="18" r="1.45"/><circle cx="15" cy="18" r="1.45"/></g></Svg>,
  layoutRows: (p) => <Svg {...p}><path d="M4 7h16M4 12h16M4 17h16"/></Svg>,
  layoutCols: (p) => <Svg {...p}><rect x="3.5" y="4.5" width="7.2" height="15" rx="1.5"/><rect x="13.3" y="4.5" width="7.2" height="15" rx="1.5"/></Svg>,
  quote: (p) => <Svg {...p}><path d="M9.2 6.8C6 7.8 4.2 10.2 4.2 13.6V17.2H10v-5.6H7c.1-1.7 1-2.7 2.8-3.2zM19.8 6.8c-3.2 1-5 3.4-5 6.8v3.6h5.8v-5.6h-3c.1-1.7 1-2.7 2.8-3.2z"/></Svg>,
  megaphone: (p) => <Svg {...p}><path d="m3.5 11 16-5v12l-16-5z"/><path d="M7 13v2.5a2 2 0 0 0 4 0v-1.2"/><path d="M19.5 9.5a3 3 0 0 1 0 5"/></Svg>,
  playCircle: (p) => <Svg {...p}><circle cx="12" cy="12" r="8.5"/><path d="M10.2 8.6 16 12l-5.8 3.4z" fill="currentColor" stroke="none"/></Svg>,
  link: (p) => <Svg {...p}><path d="M9 15l6-6"/><path d="M10.5 6.4 12 5a3.7 3.7 0 0 1 5.2 5.2l-1.4 1.4M13.5 17.6 12 19a3.7 3.7 0 0 1-5.2-5.2l1.4-1.4"/></Svg>,
  send: (p) => <Svg {...p}><path d="M20 4 3.5 11.2 10 13l2 6 8-15z"/><path d="M10 13l10-9"/></Svg>,
  mail: (p) => <Svg {...p}><rect x="3" y="5.5" width="18" height="13" rx="2.5"/><path d="M4 7.5l8 5.2 8-5.2"/></Svg>,
  creditCard: (p) => <Svg {...p}><rect x="2.5" y="5" width="19" height="14" rx="2.5"/><path d="M2.5 9.5h19M6 14.5h4"/></Svg>,
  bank: (p) => <Svg {...p}><path d="M4 9.5 12 4l8 5.5M5 9.5v8M19 9.5v8M9 9.5v8M15 9.5v8M3.5 20.5h17"/></Svg>,
  target: (p) => <Svg {...p}><circle cx="12" cy="12" r="8.5"/><circle cx="12" cy="12" r="4.7"/><circle cx="12" cy="12" r="1.3" fill="currentColor" stroke="none"/></Svg>,
  checkSquare: (p) => <Svg {...p}><rect x="4" y="4" width="16" height="16" rx="3.5"/><path d="M8.4 12.3l2.6 2.6 4.6-5"/></Svg>,
  lock: (p) => <Svg {...p}><rect x="5" y="10.5" width="14" height="9.5" rx="2"/><path d="M8 10.5V8a4 4 0 0 1 8 0v2.5"/></Svg>,
  copy: (p) => <Svg {...p}><rect x="8" y="8" width="12" height="12" rx="2"/><path d="M16 8V6a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h2"/></Svg>,
  image: (p) => <Svg {...p}><rect x="3.5" y="5" width="17" height="14" rx="2.5"/><circle cx="9" cy="10" r="1.6"/><path d="M5 17l4.5-4.5L13 16l2.5-2.5L20 18"/></Svg>,
  upload: (p) => <Svg {...p}><path d="M12 16V5M8 9l4-4 4 4"/><path d="M5 18.5h14"/></Svg>,
  key: (p) => <Svg {...p}><circle cx="8" cy="14" r="4"/><path d="M11 11.5 20 4l1.5 1.5M16.5 7.5 18.5 9.5"/></Svg>,
  monitor: (p) => <Svg {...p}><rect x="3" y="4.5" width="18" height="12" rx="2"/><path d="M9 20.5h6M12 16.5v4"/></Svg>,
  tablet: (p) => <Svg {...p}><rect x="5.5" y="3" width="13" height="18" rx="2"/><path d="M11 18h2"/></Svg>,
  smartphone: (p) => <Svg {...p}><rect x="7" y="3" width="10" height="18" rx="2.2"/><path d="M11 18h2"/></Svg>,
  sun: (p) => <Svg {...p}><circle cx="12" cy="12" r="3.9"/><path d="M12 2.6v2.5M12 18.9v2.5M4.3 4.3l1.8 1.8M17.9 17.9l1.8 1.8M2.6 12h2.5M18.9 12h2.5M4.3 19.7l1.8-1.8M17.9 6.1l1.8-1.8"/></Svg>,
  moon: (p) => <Svg {...p}><path d="M20 14.4A8 8 0 0 1 9.6 4 7 7 0 1 0 20 14.4z"/></Svg>,
  download: (p) => <Svg {...p}><path d="M12 4v11M8 11l4 4 4-4"/><path d="M5 19.5h14"/></Svg>,
  refresh: (p) => <Svg {...p}><path d="M20 11a8 8 0 0 0-14-4.5L4 8M4 4v4h4M4 13a8 8 0 0 0 14 4.5L20 16M20 20v-4h-4"/></Svg>,
  alert: (p) => <Svg {...p}><path d="M12 3.5 21.5 20H2.5z"/><path d="M12 10v4.5M12 17.4v.2"/></Svg>,
  bug: (p) => <Svg {...p}><rect x="7" y="8" width="10" height="11" rx="5"/><path d="M9 8a3 3 0 0 1 6 0M3.5 11H7M17 11h3.5M3.5 17H7M17 17h3.5M12 8v11"/></Svg>,
  chart: (p) => <Svg {...p}><path d="M4 4v15.5a.5.5 0 0 0 .5.5H20"/><path d="M7.5 15.5 11 11l3 2.5 4-5.5"/></Svg>,
  plug: (p) => <Svg {...p}><path d="M9 2.5v5M15 2.5v5"/><path d="M6.5 7.5h11v2.8a5.5 5.5 0 0 1-11 0z"/><path d="M12 15.3v3.2a3 3 0 0 0 3 3h.5"/></Svg>,
};

Object.assign(window, { Icon, Svg });
