{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "menu-dietary-filter",
  "type": "registry:component",
  "title": "Menu Dietary Filter",
  "description": "A dark all-day menu with dietary filter chips and a search field. Dishes animate out and back in as filters change, with a live counter and an empty state.",
  "author": "Hyperblur <hello@hyperblur.dev>",
  "dependencies": [],
  "registryDependencies": [],
  "categories": [
    "menus",
    "menu",
    "filter",
    "vegan",
    "gluten-free",
    "search",
    "restaurant"
  ],
  "docs": "https://hyperblur.dev/effects/menu-dietary-filter",
  "files": [
    {
      "path": "registry/hyperblur/menu-dietary-filter.tsx",
      "type": "registry:component",
      "target": "components/hyperblur/menu-dietary-filter.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\n\nexport type MenuDietaryTag = \"vegan\" | \"vegetarian\" | \"gluten-free\" | \"spicy\" | \"new\" | \"popular\";\nexport type MenuDietaryFilterId = \"vegan\" | \"vegetarian\" | \"gluten-free\" | \"spicy\" | \"under-10\";\n\nexport interface MenuDietaryItem {\n  id: string;\n  name: string;\n  description: string;\n  price: number;\n  tags?: MenuDietaryTag[];\n  art?: \"bowl\" | \"plate\" | \"wrap\" | \"soup\";\n  hue?: number;\n}\n\nexport interface MenuDietaryFilterState {\n  filters: MenuDietaryFilterId[];\n  query: string;\n  count: number;\n}\n\nexport interface MenuDietaryFilterProps extends Omit<React.HTMLAttributes<HTMLElement>, \"title\"> {\n  eyebrow?: string;\n  title?: string;\n  subtitle?: string;\n  items?: MenuDietaryItem[];\n  defaultFilters?: MenuDietaryFilterId[];\n  defaultQuery?: string;\n  priceLimit?: number;\n  onFilterChange?: (state: MenuDietaryFilterState) => void;\n  accent?: string;\n}\n\nconst defaultItems: MenuDietaryItem[] = [\n  { id: \"goddess\", name: \"Green Goddess Bowl\", description: \"Quinoa, charred broccolini, avocado, edamame, herb tahini\", price: 13, tags: [\"vegan\", \"gluten-free\", \"popular\"], art: \"bowl\", hue: 120 },\n  { id: \"tacos\", name: \"Smoky Black Bean Tacos\", description: \"Three corn tortillas, chipotle beans, pickled onion, lime crema\", price: 9.5, tags: [\"vegetarian\", \"gluten-free\", \"spicy\"], art: \"wrap\", hue: 28 },\n  { id: \"dandan\", name: \"Dan Dan Noodles\", description: \"Wheat noodles, Sichuan chili oil, crispy tofu, bok choy, sesame\", price: 12.5, tags: [\"vegan\", \"spicy\"], art: \"bowl\", hue: 8 },\n  { id: \"halloumi\", name: \"Halloumi Flatbread\", description: \"Grilled halloumi, za'atar, blistered tomato, mint yogurt\", price: 11, tags: [\"vegetarian\"], art: \"plate\", hue: 44 },\n  { id: \"sando\", name: \"Hot Honey Chicken Sando\", description: \"Buttermilk thigh, hot honey, cabbage slaw, toasted brioche\", price: 12, tags: [\"spicy\", \"popular\"], art: \"wrap\", hue: 36 },\n  { id: \"salmon\", name: \"Miso Glazed Salmon\", description: \"Brown rice, smashed cucumber, sesame greens, pickled ginger\", price: 16.5, tags: [\"gluten-free\"], art: \"plate\", hue: 16 },\n  { id: \"soup\", name: \"Roasted Tomato Soup\", description: \"Slow-roasted tomatoes, basil oil, garlic sourdough crumbs\", price: 7.5, tags: [\"vegan\", \"new\"], art: \"soup\", hue: 4 },\n  { id: \"falafel\", name: \"Falafel Wrap\", description: \"Herbed chickpea falafel, hummus, pickled turnip, tahini\", price: 9, tags: [\"vegan\"], art: \"wrap\", hue: 52 },\n  { id: \"caesar\", name: \"Kale Caesar\", description: \"Lacinato kale, aged parmesan, lemon, garlic crumbs\", price: 10.5, tags: [\"vegetarian\"], art: \"bowl\", hue: 96 },\n  { id: \"cauli\", name: \"Gochujang Cauliflower\", description: \"Rice-flour crunch, sticky gochujang glaze, scallion, sesame\", price: 8.5, tags: [\"vegan\", \"gluten-free\", \"spicy\", \"new\"], art: \"plate\", hue: 14 },\n  { id: \"steak\", name: \"Steak Frites\", description: \"8 oz hanger steak, herb butter, hand-cut fries, aioli\", price: 24, tags: [\"gluten-free\"], art: \"plate\", hue: 22 },\n  { id: \"chia\", name: \"Mango Chia Pudding\", description: \"Coconut milk, passion fruit, toasted coconut flakes\", price: 6.5, tags: [\"vegan\", \"gluten-free\"], art: \"soup\", hue: 40 },\n];\n\nconst filterDefs: { id: MenuDietaryFilterId; label: string }[] = [\n  { id: \"vegan\", label: \"Vegan\" },\n  { id: \"vegetarian\", label: \"Vegetarian\" },\n  { id: \"gluten-free\", label: \"Gluten-free\" },\n  { id: \"spicy\", label: \"Spicy\" },\n  { id: \"under-10\", label: \"Under $10\" },\n];\n\nconst tagLabels: Record<MenuDietaryTag, string> = {\n  vegan: \"Vegan\",\n  vegetarian: \"Vegetarian\",\n  \"gluten-free\": \"Gluten-free\",\n  spicy: \"Spicy\",\n  new: \"New\",\n  popular: \"Popular\",\n};\n\nconst css = `\n.hb-mc1 {\n  --hb-mc1-accent: #34d399;\n  box-sizing: border-box;\n  width: 100%;\n  container-type: inline-size;\n  position: relative;\n  overflow: hidden;\n  background: radial-gradient(120% 70% at 85% -10%, color-mix(in srgb, var(--hb-mc1-accent) 16%, transparent), transparent 60%), #0a0b0a;\n  color: #ededed;\n  font-family: var(--font-sans, ui-sans-serif, system-ui, sans-serif);\n  -webkit-font-smoothing: antialiased;\n}\n.hb-mc1 *, .hb-mc1 *::before, .hb-mc1 *::after { box-sizing: border-box; }\n.hb-mc1-wrap { max-width: 1120px; margin: 0 auto; padding: 72px 24px 96px; }\n.hb-mc1-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: 28px; }\n.hb-mc1-eyebrow { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 14px; color: var(--hb-mc1-accent); font-size: 12.5px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; }\n.hb-mc1-eyebrow::before { content: \"\"; width: 7px; height: 7px; border-radius: 50%; background: var(--hb-mc1-accent); box-shadow: 0 0 12px var(--hb-mc1-accent); }\n.hb-mc1-title { margin: 0; font-family: var(--font-grotesk, var(--font-sans, ui-sans-serif, system-ui, sans-serif)); font-weight: 600; font-size: clamp(34px, 5.2cqw, 56px); line-height: 1; letter-spacing: -.035em; }\n.hb-mc1-sub { margin: 14px 0 0; max-width: 460px; color: #8f8f8f; font-size: 15.5px; line-height: 1.6; }\n.hb-mc1-count { margin: 0; color: #a1a1a1; font-size: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; }\n.hb-mc1-count b { color: #ededed; font-weight: 600; }\n.hb-mc1-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px; margin-bottom: 24px; border-radius: 20px; background: rgba(255,255,255,.03); border: 1px solid rgba(255,255,255,.08); box-shadow: inset 0 1px 0 rgba(255,255,255,.04); }\n.hb-mc1-search { position: relative; flex: 1 1 220px; min-width: 0; }\n.hb-mc1-search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: #8f8f8f; pointer-events: none; }\n.hb-mc1-input { width: 100%; height: 42px; padding: 0 14px 0 40px; border-radius: 12px; border: 1px solid rgba(255,255,255,.08); background: #111; color: #ededed; font: inherit; font-size: 14.5px; outline: none; transition: border-color .2s, box-shadow .2s; }\n.hb-mc1-input::placeholder { color: #6f6f6f; }\n.hb-mc1-input:focus { border-color: color-mix(in srgb, var(--hb-mc1-accent) 60%, transparent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--hb-mc1-accent) 20%, transparent); }\n.hb-mc1-chips { display: flex; gap: 8px; flex-wrap: wrap; }\n.hb-mc1-chip { display: inline-flex; align-items: center; gap: 7px; height: 42px; padding: 0 15px; border-radius: 999px; border: 1px solid rgba(255,255,255,.1); background: #121212; color: #c8c8c8; font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; transition: background .2s, border-color .2s, color .2s, transform .15s; }\n.hb-mc1-chip:hover { border-color: rgba(255,255,255,.22); color: #fff; }\n.hb-mc1-chip:active { transform: scale(.96); }\n.hb-mc1-chip[aria-pressed=\"true\"] { background: color-mix(in srgb, var(--hb-mc1-accent) 16%, #111); border-color: color-mix(in srgb, var(--hb-mc1-accent) 55%, transparent); color: #fff; }\n.hb-mc1-chip[aria-pressed=\"true\"] .hb-mc1-ico { color: var(--hb-mc1-accent); }\n.hb-mc1-chip:focus-visible, .hb-mc1-clear:focus-visible { outline: 2px solid var(--hb-mc1-accent); outline-offset: 2px; }\n.hb-mc1-ico { flex: none; color: #8f8f8f; transition: color .2s; }\n.hb-mc1-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 0; padding: 0; list-style: none; }\n.hb-mc1-card { position: relative; display: flex; gap: 14px; min-width: 0; padding: 14px; border-radius: 18px; background: linear-gradient(180deg, #141414, #101010); border: 1px solid rgba(255,255,255,.07); box-shadow: inset 0 1px 0 rgba(255,255,255,.04); animation: hb-mc1-in .42s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(var(--hb-mc1-i, 0) * 35ms); transition: border-color .2s, transform .2s; }\n.hb-mc1-card:hover { border-color: rgba(255,255,255,.16); transform: translateY(-2px); }\n.hb-mc1-card[data-leaving=\"true\"] { animation: hb-mc1-out .24s cubic-bezier(.4,0,1,1) both; pointer-events: none; }\n@keyframes hb-mc1-in { from { opacity: 0; transform: translateY(10px) scale(.97); } }\n@keyframes hb-mc1-out { to { opacity: 0; transform: scale(.94); filter: blur(2px); } }\n.hb-mc1-art { flex: none; width: 76px; height: 76px; border-radius: 14px; background: radial-gradient(circle at 50% 40%, hsl(var(--hb-mc1-h) 45% 22%), hsl(var(--hb-mc1-h) 30% 10%)); display: grid; place-items: center; }\n.hb-mc1-art svg { width: 68px; height: 68px; }\n.hb-mc1-body { min-width: 0; flex: 1; display: flex; flex-direction: column; }\n.hb-mc1-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }\n.hb-mc1-name { margin: 0; font-size: 15.5px; font-weight: 600; line-height: 1.25; letter-spacing: -.01em; }\n.hb-mc1-price { flex: none; font-family: var(--font-grotesk, inherit); font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; color: #fff; }\n.hb-mc1-desc { margin: 5px 0 9px; color: #8f8f8f; font-size: 13px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }\n.hb-mc1-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: auto; }\n.hb-mc1-tag { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px 3px 6px; border-radius: 999px; font-size: 11px; font-weight: 600; letter-spacing: .01em; background: rgba(255,255,255,.05); color: #bdbdbd; border: 1px solid rgba(255,255,255,.07); }\n.hb-mc1-tag[data-tag=\"vegan\"], .hb-mc1-tag[data-tag=\"vegetarian\"] { color: #86efac; background: rgba(34,197,94,.09); border-color: rgba(34,197,94,.2); }\n.hb-mc1-tag[data-tag=\"gluten-free\"] { color: #fcd34d; background: rgba(245,158,11,.09); border-color: rgba(245,158,11,.2); }\n.hb-mc1-tag[data-tag=\"spicy\"] { color: #fca5a5; background: rgba(239,68,68,.1); border-color: rgba(239,68,68,.22); }\n.hb-mc1-tag[data-tag=\"new\"] { color: #93c5fd; background: rgba(59,130,246,.1); border-color: rgba(59,130,246,.22); }\n.hb-mc1-tag[data-tag=\"popular\"] { color: #f0abfc; background: rgba(217,70,239,.09); border-color: rgba(217,70,239,.2); }\n.hb-mc1-empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 56px 20px; border-radius: 20px; border: 1px dashed rgba(255,255,255,.12); animation: hb-mc1-in .4s ease both; }\n.hb-mc1-empty h3 { margin: 6px 0 0; font-family: var(--font-grotesk, inherit); font-size: 20px; font-weight: 600; }\n.hb-mc1-empty p { margin: 0; max-width: 340px; color: #8f8f8f; font-size: 14px; line-height: 1.55; }\n.hb-mc1-clear { margin-top: 8px; height: 40px; padding: 0 18px; border-radius: 999px; border: 0; background: #ededed; color: #0a0a0a; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; transition: background .2s; }\n.hb-mc1-clear:hover { background: #fff; }\n@container (max-width: 900px) { .hb-mc1-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }\n@container (max-width: 600px) {\n  .hb-mc1-wrap { padding: 56px 16px 64px; }\n  .hb-mc1-grid { grid-template-columns: minmax(0, 1fr); }\n  .hb-mc1-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -10px; padding: 0 10px; width: calc(100% + 20px); }\n  .hb-mc1-chip { flex: none; height: 38px; padding: 0 13px; font-size: 13.5px; }\n}\n@media (prefers-reduced-motion: reduce) {\n  .hb-mc1 *, .hb-mc1 *::before, .hb-mc1 *::after { animation: none !important; transition: none !important; }\n}\n`;\n\nfunction FilterIcon({ id }: { id: MenuDietaryFilterId | MenuDietaryTag }) {\n  const p = { width: 15, height: 15, viewBox: \"0 0 24 24\", fill: \"none\", stroke: \"currentColor\", strokeWidth: 2, strokeLinecap: \"round\" as const, strokeLinejoin: \"round\" as const, className: \"hb-mc1-ico\", \"aria-hidden\": true };\n  if (id === \"vegan\") return <svg {...p}><path d=\"M5 19c0-8 5-13 14-14 0 9-5 14-13 14\" /><path d=\"M5 19l8-8\" /></svg>;\n  if (id === \"vegetarian\") return <svg {...p}><path d=\"M12 4c3.5 0 6 4.5 6 9a6 6 0 0 1-12 0c0-4.5 2.5-9 6-9z\" /><circle cx=\"12\" cy=\"14\" r=\"2.2\" /></svg>;\n  if (id === \"gluten-free\") return <svg {...p}><path d=\"M12 21V8\" /><path d=\"M12 12c-2.5 0-4-1.5-4-4 2.5 0 4 1.5 4 4zM12 12c2.5 0 4-1.5 4-4-2.5 0-4 1.5-4 4zM12 8c-1.5-1-2-2.5-1-4.5 1.5 1 2 2.5 1 4.5z\" /><path d=\"M4 4l16 16\" /></svg>;\n  if (id === \"spicy\") return <svg {...p}><path d=\"M14 6c-4 1-9 6-9 13 6 0 12-5 13-10\" /><path d=\"M14 6c1.5-.5 3 0 4 1.5\" /><path d=\"M15 3.5c0 1.5.5 2.5 1.5 3\" /></svg>;\n  if (id === \"under-10\") return <svg {...p}><path d=\"M3 12V4h8l10 10-8 8L3 12z\" /><circle cx=\"7.5\" cy=\"8\" r=\"1.4\" /></svg>;\n  if (id === \"new\") return <svg {...p}><path d=\"M12 3l2.2 5.4L20 9l-4.4 3.8L17 19l-5-3-5 3 1.4-6.2L4 9l5.8-.6z\" /></svg>;\n  return <svg {...p}><path d=\"M12 3c1 3 4 5 4 9a4 4 0 0 1-8 0c0-2 1-3 2-4 0 2 1 3 2 3 0-3-1-5 0-8z\" /></svg>;\n}\n\nfunction DishArt({ art = \"bowl\", hue = 30 }: { art?: MenuDietaryItem[\"art\"]; hue?: number }) {\n  const h = (n: number, s: number, l: number) => `hsl(${((hue + n + 360) % 360).toFixed(0)} ${s}% ${l}%)`;\n  if (art === \"wrap\") {\n    return (\n      <svg viewBox=\"0 0 80 80\" aria-hidden=\"true\">\n        <ellipse cx=\"40\" cy=\"62\" rx=\"26\" ry=\"5\" fill=\"rgba(0,0,0,.35)\" />\n        <path d=\"M14 52c4-18 16-30 26-30s22 12 26 30z\" fill={h(0, 70, 72)} />\n        <path d=\"M18 50c6-12 14-20 22-20s16 8 22 20\" fill=\"none\" stroke={h(90, 55, 45)} strokeWidth=\"5\" strokeLinecap=\"round\" />\n        <path d=\"M22 48c5-8 11-13 18-13s13 5 18 13\" fill=\"none\" stroke={h(-20, 75, 52)} strokeWidth=\"4\" strokeLinecap=\"round\" />\n        <circle cx=\"32\" cy=\"40\" r=\"2\" fill=\"#fff6e8\" opacity=\".9\" />\n        <circle cx=\"46\" cy=\"38\" r=\"2\" fill=\"#fff6e8\" opacity=\".9\" />\n        <path d=\"M14 52h52\" stroke={h(0, 55, 58)} strokeWidth=\"3\" strokeLinecap=\"round\" />\n      </svg>\n    );\n  }\n  if (art === \"plate\") {\n    return (\n      <svg viewBox=\"0 0 80 80\" aria-hidden=\"true\">\n        <ellipse cx=\"41\" cy=\"44\" rx=\"31\" ry=\"29\" fill=\"rgba(0,0,0,.35)\" />\n        <circle cx=\"40\" cy=\"40\" r=\"30\" fill=\"#f4f1ea\" />\n        <circle cx=\"40\" cy=\"40\" r=\"22\" fill=\"#fffdf8\" stroke=\"#e6e0d4\" />\n        <path d=\"M27 44c2-10 18-14 26-6-3 8-19 12-26 6z\" fill={h(0, 62, 50)} />\n        <path d=\"M30 42c6-4 13-5 19-2\" fill=\"none\" stroke={h(10, 70, 72)} strokeWidth=\"1.6\" strokeLinecap=\"round\" />\n        <circle cx=\"50\" cy=\"30\" r=\"4\" fill={h(90, 50, 42)} />\n        <circle cx=\"45\" cy=\"27\" r=\"3\" fill={h(100, 45, 50)} />\n        <circle cx=\"30\" cy=\"31\" r=\"2\" fill={h(-30, 80, 55)} />\n      </svg>\n    );\n  }\n  if (art === \"soup\") {\n    return (\n      <svg viewBox=\"0 0 80 80\" aria-hidden=\"true\">\n        <ellipse cx=\"40\" cy=\"64\" rx=\"24\" ry=\"4.5\" fill=\"rgba(0,0,0,.35)\" />\n        <path d=\"M14 38h52c0 15-11 25-26 25S14 53 14 38z\" fill=\"#f2efe8\" />\n        <ellipse cx=\"40\" cy=\"38\" rx=\"26\" ry=\"8\" fill=\"#dcd6ca\" />\n        <ellipse cx=\"40\" cy=\"38\" rx=\"23\" ry=\"6.5\" fill={h(0, 72, 52)} />\n        <path d=\"M30 37c4-2 8 2 12 0s7-2 9 0\" fill=\"none\" stroke={h(20, 85, 78)} strokeWidth=\"1.6\" strokeLinecap=\"round\" />\n        <circle cx=\"45\" cy=\"36\" r=\"1.8\" fill={h(100, 50, 40)} />\n        <path d=\"M32 26c-2-3 2-5 0-8M42 26c-2-3 2-5 0-8M52 26c-2-3 2-5 0-8\" fill=\"none\" stroke=\"rgba(255,255,255,.35)\" strokeWidth=\"1.6\" strokeLinecap=\"round\" />\n      </svg>\n    );\n  }\n  return (\n    <svg viewBox=\"0 0 80 80\" aria-hidden=\"true\">\n      <ellipse cx=\"40\" cy=\"64\" rx=\"26\" ry=\"5\" fill=\"rgba(0,0,0,.35)\" />\n      <path d=\"M12 36h56c0 16-12 27-28 27S12 52 12 36z\" fill=\"#efeae0\" />\n      <path d=\"M12 36h56c0 3-1 6-2 8H14c-1-2-2-5-2-8z\" fill=\"#ddd6c8\" />\n      <ellipse cx=\"40\" cy=\"36\" rx=\"28\" ry=\"8\" fill={h(0, 40, 30)} />\n      <circle cx=\"30\" cy=\"33\" r=\"6\" fill={h(0, 55, 48)} />\n      <circle cx=\"44\" cy=\"31\" r=\"5.5\" fill={h(60, 55, 55)} />\n      <circle cx=\"53\" cy=\"36\" r=\"4.5\" fill={h(-40, 65, 55)} />\n      <circle cx=\"37\" cy=\"38\" r=\"4\" fill={h(30, 50, 70)} />\n      <path d=\"M24 37l5-4M47 37l4-3\" stroke=\"#fff6e8\" strokeWidth=\"1.4\" strokeLinecap=\"round\" opacity=\".7\" />\n    </svg>\n  );\n}\n\nfunction matches(item: MenuDietaryItem, filters: MenuDietaryFilterId[], query: string, limit: number) {\n  const tags = item.tags ?? [];\n  for (const f of filters) {\n    if (f === \"under-10\") {\n      if (item.price >= limit) return false;\n    } else if (f === \"vegetarian\") {\n      if (!tags.includes(\"vegetarian\") && !tags.includes(\"vegan\")) return false;\n    } else if (!tags.includes(f)) return false;\n  }\n  const q = query.trim().toLowerCase();\n  if (!q) return true;\n  return `${item.name} ${item.description}`.toLowerCase().includes(q);\n}\n\nexport function MenuDietaryFilter({\n  eyebrow = \"Greenline Kitchen · All-day menu\",\n  title = \"Eat the way you eat.\",\n  subtitle = \"Twelve dishes, cooked to order. Filter by what works for you and every plate is clearly marked.\",\n  items = defaultItems,\n  defaultFilters = [],\n  defaultQuery = \"\",\n  priceLimit = 10,\n  onFilterChange,\n  accent = \"#34d399\",\n  className,\n  style,\n  ...rest\n}: MenuDietaryFilterProps) {\n  const uid = React.useId().replace(/[^a-zA-Z0-9]/g, \"\");\n  const [filters, setFilters] = React.useState<MenuDietaryFilterId[]>(defaultFilters);\n  const [query, setQuery] = React.useState(defaultQuery);\n  const [leaving, setLeaving] = React.useState<string[]>([]);\n  const timer = React.useRef<ReturnType<typeof setTimeout> | null>(null);\n\n  React.useEffect(() => () => {\n    if (timer.current) clearTimeout(timer.current);\n  }, []);\n\n  const visible = items.filter((it) => matches(it, filters, query, priceLimit));\n\n  const apply = (nextFilters: MenuDietaryFilterId[], nextQuery: string) => {\n    const before = new Set(visible.map((it) => it.id));\n    const after = items.filter((it) => matches(it, nextFilters, nextQuery, priceLimit));\n    const afterIds = new Set(after.map((it) => it.id));\n    const gone = [...before].filter((id) => !afterIds.has(id));\n    setFilters(nextFilters);\n    setQuery(nextQuery);\n    setLeaving(gone);\n    if (timer.current) clearTimeout(timer.current);\n    if (gone.length) timer.current = setTimeout(() => setLeaving([]), 240);\n    onFilterChange?.({ filters: nextFilters, query: nextQuery, count: after.length });\n  };\n\n  const toggle = (id: MenuDietaryFilterId) => {\n    apply(filters.includes(id) ? filters.filter((f) => f !== id) : [...filters, id], query);\n  };\n\n  const visibleIds = new Set(visible.map((it) => it.id));\n  const rendered = items.filter((it) => visibleIds.has(it.id) || leaving.includes(it.id));\n  const activeLabels = filterDefs.filter((f) => filters.includes(f.id)).map((f) => f.label);\n  const priceLabel = (n: number) => (Number.isInteger(n) ? n.toFixed(0) : n.toFixed(2));\n\n  return (\n    <section\n      className={[\"hb-mc1\", className].filter(Boolean).join(\" \")}\n      style={{ \"--hb-mc1-accent\": accent, ...style } as React.CSSProperties}\n      {...rest}\n    >\n      <style href=\"hb-menu-dietary-filter\" precedence=\"default\">{css}</style>\n      <div className=\"hb-mc1-wrap\">\n        <div className=\"hb-mc1-head\">\n          <div>\n            <p className=\"hb-mc1-eyebrow\">{eyebrow}</p>\n            <h2 className=\"hb-mc1-title\">{title}</h2>\n            <p className=\"hb-mc1-sub\">{subtitle}</p>\n          </div>\n          <p className=\"hb-mc1-count\" aria-live=\"polite\">\n            Showing <b>{visible.length}</b> of <b>{items.length}</b>\n          </p>\n        </div>\n        <div className=\"hb-mc1-bar\">\n          <label className=\"hb-mc1-search\">\n            <span style={{ position: \"absolute\", width: 1, height: 1, overflow: \"hidden\", clip: \"rect(0 0 0 0)\" }}>Search the menu</span>\n            <svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" aria-hidden=\"true\">\n              <circle cx=\"11\" cy=\"11\" r=\"7\" />\n              <path d=\"M20 20l-3.5-3.5\" />\n            </svg>\n            <input\n              className=\"hb-mc1-input\"\n              type=\"search\"\n              value={query}\n              placeholder=\"Search tacos, tofu, salmon...\"\n              aria-controls={`${uid}-list`}\n              onChange={(e) => apply(filters, e.target.value)}\n            />\n          </label>\n          <div className=\"hb-mc1-chips\" role=\"group\" aria-label=\"Dietary filters\">\n            {filterDefs.map((f) => (\n              <button\n                key={f.id}\n                type=\"button\"\n                className=\"hb-mc1-chip\"\n                aria-pressed={filters.includes(f.id)}\n                onClick={() => toggle(f.id)}\n              >\n                <FilterIcon id={f.id} />\n                {f.id === \"under-10\" ? `Under $${priceLabel(priceLimit)}` : f.label}\n              </button>\n            ))}\n          </div>\n        </div>\n        {rendered.length ? (\n          <ul className=\"hb-mc1-grid\" id={`${uid}-list`}>\n            {rendered.map((it, i) => (\n              <li\n                key={it.id}\n                className=\"hb-mc1-card\"\n                data-leaving={leaving.includes(it.id) && !visibleIds.has(it.id) ? \"true\" : undefined}\n                style={{ \"--hb-mc1-i\": i % 9, \"--hb-mc1-h\": String(it.hue ?? 30) } as React.CSSProperties}\n              >\n                <div className=\"hb-mc1-art\"><DishArt art={it.art} hue={it.hue} /></div>\n                <div className=\"hb-mc1-body\">\n                  <div className=\"hb-mc1-row\">\n                    <h3 className=\"hb-mc1-name\">{it.name}</h3>\n                    <span className=\"hb-mc1-price\">${it.price.toFixed(2)}</span>\n                  </div>\n                  <p className=\"hb-mc1-desc\">{it.description}</p>\n                  {it.tags?.length ? (\n                    <div className=\"hb-mc1-tags\">\n                      {it.tags.map((t) => (\n                        <span key={t} className=\"hb-mc1-tag\" data-tag={t}>\n                          <FilterIcon id={t} />\n                          {tagLabels[t]}\n                        </span>\n                      ))}\n                    </div>\n                  ) : null}\n                </div>\n              </li>\n            ))}\n          </ul>\n        ) : (\n          <div className=\"hb-mc1-empty\" id={`${uid}-list`} role=\"status\">\n            <svg width=\"56\" height=\"56\" viewBox=\"0 0 80 80\" fill=\"none\" aria-hidden=\"true\">\n              <path d=\"M12 36h56c0 16-12 27-28 27S12 52 12 36z\" stroke=\"#5a5a5a\" strokeWidth=\"2.5\" />\n              <path d=\"M30 26c-2-3 2-5 0-8M40 26c-2-3 2-5 0-8M50 26c-2-3 2-5 0-8\" stroke=\"#3d3d3d\" strokeWidth=\"2.5\" strokeLinecap=\"round\" />\n            </svg>\n            <h3>Nothing on the menu matches</h3>\n            <p>\n              No dish is {activeLabels.length ? activeLabels.join(\" + \").toLowerCase() : \"a match\"}\n              {query.trim() ? ` for \"${query.trim()}\"` : \"\"}. Try removing a filter.\n            </p>\n            <button type=\"button\" className=\"hb-mc1-clear\" onClick={() => apply([], \"\")}>Clear filters</button>\n          </div>\n        )}\n      </div>\n    </section>\n  );\n}\n"
    }
  ]
}