// Material Icons, as inline SVG. Same glyph vocabulary as the eater app, which
// bundles the Material set via `uses-material-design: true`.
//
// The path data is EXTRACTED, not hand-drawn: each `d` is the exact outline of the
// glyph at the codepoint Flutter's `Icons.<name>` uses, pulled from
// MaterialIcons-Regular.otf (Flutter SDK, Apache-2.0) and transformed from the
// font's 512-upem box into a 24x24 SVG viewBox. So a `search` here is byte-for-byte
// the same shape the app renders. Regenerate with the snippet in docs/reference/.
//
// Inline, not a font or a CDN: the site has no build step and web-ci requires SRI on
// every external <script>. Inlining sidesteps both, costs one HTTP request less, and
// lets icons inherit `currentColor`.
window.MFC = window.MFC || {};
window.MFC.ICON_PATHS = {
  home: 'M12.0 5.671 17.015 10.171V18.0H15.0V12.0H9.0V18.0H6.984V10.171L12.0 5.671ZM12.0 3.0 2.015 12.0H5.015V20.015H11.015V14.015H12.984V20.015H18.984V12.0H21.984L12.0 3.0Z',
  search: 'M15.515 14.015H14.718L14.437 13.734C15.421 12.609 15.984 11.109 15.984 9.515C15.984 5.906 13.078 3.0 9.515 3.0C5.906 3.0 3.0 5.906 3.0 9.515C3.0 13.078 5.906 15.984 9.515 15.984C11.109 15.984 12.609 15.421 13.734 14.437L14.015 14.718V15.515L18.984 20.484L20.484 18.984L15.515 14.015ZM9.515 14.015C7.031 14.015 5.015 12.0 5.015 9.515C5.015 7.031 7.031 5.015 9.515 5.015C12.0 5.015 14.015 7.031 14.015 9.515C14.015 12.0 12.0 14.015 9.515 14.015Z',
  eco: 'M6.046 8.062C3.328 10.781 3.328 15.187 6.046 17.953C7.5 14.531 10.125 11.671 13.406 9.984C10.640 12.328 8.671 15.609 8.015 19.312C10.593 20.531 13.781 20.109 15.937 17.953C19.453 14.484 20.015 3.984 20.015 3.984C20.015 3.984 9.515 4.546 6.046 8.062Z',
  restaurant: 'M11.015 9.0H9.0V2.015H6.984V9.0H5.015V2.015H3.0V9.0C3.0 11.109 4.640 12.843 6.75 12.984V21.984H9.234V12.984C11.343 12.843 12.984 11.109 12.984 9.0V2.015H11.015V9.0ZM15.984 6.0V14.015H18.515V21.984H21.0V2.015C18.234 2.015 15.984 4.218 15.984 6.0Z',
  chevron_right: 'M9.984 6.0 8.578 7.406 13.171 12.0 8.578 16.593 9.984 18.0 15.984 12.0 9.984 6.0Z',
  expand_more: 'M16.593 8.578 12.0 13.171 7.406 8.578 6.0 9.984 12.0 15.984 18.0 9.984 16.593 8.578Z',
  check: 'M9.0 16.171 4.828 12.0 3.421 13.406 9.0 18.984 21.0 6.984 19.593 5.578 9.0 16.171Z',
  close: 'M18.984 6.421 17.578 5.015 12.0 10.593 6.421 5.015 5.015 6.421 10.593 12.0 5.015 17.578 6.421 18.984 12.0 13.406 17.578 18.984 18.984 17.578 13.406 12.0 18.984 6.421Z',
  grid_view: 'M5.015 11.015H9.0C10.078 11.015 11.015 10.078 11.015 9.0V5.015C11.015 3.890 10.078 3.0 9.0 3.0H5.015C3.890 3.0 3.0 3.890 3.0 5.015V9.0C3.0 10.078 3.890 11.015 5.015 11.015ZM5.015 21.0H9.0C10.078 21.0 11.015 20.109 11.015 18.984V15.0C11.015 13.921 10.078 12.984 9.0 12.984H5.015C3.890 12.984 3.0 13.921 3.0 15.0V18.984C3.0 20.109 3.890 21.0 5.015 21.0ZM12.984 5.015V9.0C12.984 10.078 13.921 11.015 15.0 11.015H18.984C20.109 11.015 21.0 10.078 21.0 9.0V5.015C21.0 3.890 20.109 3.0 18.984 3.0H15.0C13.921 3.0 12.984 3.890 12.984 5.015ZM15.0 21.0H18.984C20.109 21.0 21.0 20.109 21.0 18.984V15.0C21.0 13.921 20.109 12.984 18.984 12.984H15.0C13.921 12.984 12.984 13.921 12.984 15.0V18.984C12.984 20.109 13.921 21.0 15.0 21.0Z',
  view_agenda: 'M18.984 12.984H5.015C3.890 12.984 3.0 13.921 3.0 15.0V18.984C3.0 20.109 3.890 21.0 5.015 21.0H18.984C20.109 21.0 21.0 20.109 21.0 18.984V15.0C21.0 13.921 20.109 12.984 18.984 12.984ZM18.984 18.984H5.015V15.0H18.984V18.984ZM18.984 3.0H5.015C3.890 3.0 3.0 3.890 3.0 5.015V9.0C3.0 10.078 3.890 11.015 5.015 11.015H18.984C20.109 11.015 21.0 10.078 21.0 9.0V5.015C21.0 3.890 20.109 3.0 18.984 3.0ZM18.984 9.0H5.015V5.015H18.984V9.0Z',
  arrow_forward: 'M6.234 20.25 8.015 21.984 18.0 12.0 8.015 2.015 6.234 3.75 14.437 12.0 6.234 20.25Z',
  open_in_new: 'M13.921 13.921 2.437 2.437 1.031 3.890 6.328 9.187 6.140 9.421H3.609C2.718 9.421 2.015 10.125 2.015 11.015V20.390C2.015 21.281 2.718 21.984 3.609 21.984H16.406C17.156 21.984 17.765 21.468 17.953 20.765L20.109 22.968L21.562 21.562L18.0 18.0L13.921 13.921ZM9.984 20.015C7.781 20.015 6.0 18.187 6.0 15.984C6.0 14.062 7.406 12.421 9.234 12.093L10.828 13.640C10.546 13.546 10.312 13.5 9.984 13.5C8.625 13.5 7.5 14.625 7.5 15.984C7.5 17.390 8.625 18.515 9.984 18.515C11.390 18.515 12.515 17.390 12.515 15.984C12.515 15.703 12.421 15.421 12.328 15.187L13.921 16.734C13.546 18.609 11.953 20.015 9.984 20.015ZM18.0 15.187 10.828 8.015H12.562L13.875 9.421H16.406C17.296 9.421 18.0 10.125 18.0 11.015V15.187ZM20.390 5.578H21.984L18.984 11.015V6.984H18.0V2.015H21.984L20.390 5.578Z',
};

// <Icon name="search" /> — inherits color + font-size unless overridden.
window.MFC.Icon = function Icon({ name, size = 20, className = '', title }) {
  const d = window.MFC.ICON_PATHS[name];
  if (!d) return null;
  return (
    <svg className={className} width={size} height={size} viewBox="0 0 24 24"
         fill="currentColor" aria-hidden={title ? undefined : 'true'}
         role={title ? 'img' : undefined} focusable="false">
      {title ? <title>{title}</title> : null}
      <path d={d} />
    </svg>
  );
};
