{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "advanced-filter-builder",
  "title": "Advanced Filter Builder",
  "description": "A query builder for data tables: conditions made of field, operator and value with operators that fit the field type, and / or toggles, one level of grouping, a plain-English sentence of the filter, saved views, copy as JSON, and a results table that filters live.",
  "dependencies": [
    "motion",
    "clsx",
    "tailwind-merge"
  ],
  "files": [
    {
      "path": "registry/new-york/advanced-filter-builder/advanced-filter-builder.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\nimport { AnimatePresence, motion, useReducedMotion } from \"motion/react\";\nimport { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nfunction cn(...inputs: ClassValue[]) {\n  return twMerge(clsx(inputs));\n}\n\ntype FieldKey = \"status\" | \"plan\" | \"mrr\" | \"country\" | \"seats\" | \"lastActive\";\ntype Op = \"is\" | \"isNot\" | \"gt\" | \"lt\" | \"between\" | \"within\" | \"olderThan\";\nexport interface Condition {\n  id: string;\n  field: FieldKey;\n  op: Op;\n  value: string[] | number | [number, number];\n}\nexport interface FilterGroup {\n  id: string;\n  join: \"and\" | \"or\";\n  items: (Condition | FilterGroup)[];\n}\ninterface Customer {\n  id: string;\n  name: string;\n  status: string;\n  plan: string;\n  mrr: number;\n  country: string;\n  seats: number;\n  lastActive: number; // days ago\n}\n\nexport interface AdvancedFilterBuilderProps {\n  defaultFilter?: FilterGroup;\n  onChange?: (filter: FilterGroup) => void;\n  theme?: \"dark\" | \"light\";\n  className?: string;\n}\n\nconst PALETTES = {\n  dark: { bg: \"#0A0A0A\", text: \"#F5F4F1\", muted: \"rgba(245,244,241,0.62)\", faint: \"rgba(245,244,241,0.36)\", panel: \"#121212\", group: \"rgba(255,255,255,0.03)\", border: \"rgba(255,255,255,0.09)\", input: \"#0D0D0D\", chip: \"rgba(255,255,255,0.07)\", on: \"#F5F4F1\", onText: \"#0A0A0A\", accent: \"#60A5FA\", green: \"#4ADE80\", ring: \"rgba(245,244,241,0.6)\" },\n  light: { bg: \"#FAFAF8\", text: \"#0A0A0A\", muted: \"rgba(10,10,10,0.62)\", faint: \"rgba(10,10,10,0.42)\", panel: \"#FFFFFF\", group: \"rgba(10,10,10,0.025)\", border: \"rgba(10,10,10,0.1)\", input: \"#FAFAF8\", chip: \"rgba(10,10,10,0.06)\", on: \"#0A0A0A\", onText: \"#FAFAF8\", accent: \"#2563EB\", green: \"#15803D\", ring: \"rgba(10,10,10,0.5)\" },\n};\n\nconst FIELDS: Record<FieldKey, { label: string; type: \"enum\" | \"number\" | \"days\"; options?: string[]; unit?: string }> = {\n  status: { label: \"Status\", type: \"enum\", options: [\"Active\", \"Trial\", \"Churned\"] },\n  plan: { label: \"Plan\", type: \"enum\", options: [\"Starter\", \"Pro\", \"Team\"] },\n  mrr: { label: \"MRR\", type: \"number\", unit: \"$\" },\n  country: { label: \"Country\", type: \"enum\", options: [\"Germany\", \"United States\", \"United Kingdom\", \"Japan\", \"Brazil\"] },\n  seats: { label: \"Seats\", type: \"number\" },\n  lastActive: { label: \"Last active\", type: \"days\" },\n};\nconst OPS: Record<\"enum\" | \"number\" | \"days\", { op: Op; label: string }[]> = {\n  enum: [\n    { op: \"is\", label: \"is any of\" },\n    { op: \"isNot\", label: \"is none of\" },\n  ],\n  number: [\n    { op: \"gt\", label: \"is more than\" },\n    { op: \"lt\", label: \"is less than\" },\n    { op: \"between\", label: \"is between\" },\n  ],\n  days: [\n    { op: \"within\", label: \"within the last\" },\n    { op: \"olderThan\", label: \"more than\" },\n  ],\n};\nconst C = (id: string, name: string, status: string, plan: string, mrr: number, country: string, seats: number, lastActive: number): Customer => ({ id, name, status, plan, mrr, country, seats, lastActive });\nconst CUSTOMERS: Customer[] = [\n  C(\"1\", \"Kestrel Labs\", \"Active\", \"Team\", 1840, \"United States\", 42, 0),\n  C(\"2\", \"Ferro & Co\", \"Active\", \"Pro\", 620, \"Germany\", 12, 2),\n  C(\"3\", \"Atlas Freight\", \"Active\", \"Team\", 2400, \"United States\", 64, 1),\n  C(\"4\", \"Vento Bikes\", \"Trial\", \"Pro\", 0, \"Germany\", 5, 3),\n  C(\"5\", \"Mirai Health\", \"Active\", \"Pro\", 480, \"Japan\", 9, 6),\n  C(\"6\", \"Solaria Energy\", \"Churned\", \"Starter\", 0, \"Brazil\", 3, 48),\n  C(\"7\", \"Northpine Studio\", \"Active\", \"Starter\", 90, \"United Kingdom\", 4, 12),\n  C(\"8\", \"Halden Studio\", \"Active\", \"Pro\", 540, \"Germany\", 11, 0),\n  C(\"9\", \"Brightwell Dental\", \"Trial\", \"Starter\", 0, \"United States\", 2, 9),\n  C(\"10\", \"Okapi Logistics\", \"Active\", \"Team\", 1320, \"Brazil\", 30, 4),\n  C(\"11\", \"Lumen Coffee\", \"Churned\", \"Pro\", 0, \"United Kingdom\", 6, 75),\n  C(\"12\", \"Tanaka Robotics\", \"Active\", \"Team\", 2960, \"Japan\", 80, 1),\n  C(\"13\", \"Greenleaf Farms\", \"Active\", \"Starter\", 120, \"United States\", 5, 21),\n  C(\"14\", \"Orbit Media\", \"Trial\", \"Team\", 0, \"Germany\", 18, 2),\n  C(\"15\", \"Coastline Surf\", \"Active\", \"Pro\", 360, \"Brazil\", 7, 35),\n  C(\"16\", \"Meridian Law\", \"Active\", \"Pro\", 780, \"United Kingdom\", 15, 5),\n];\nconst isGroup = (x: Condition | FilterGroup): x is FilterGroup => \"items\" in x;\nconst DEFAULT: FilterGroup = {\n  id: \"root\",\n  join: \"and\",\n  items: [\n    { id: \"c1\", field: \"status\", op: \"is\", value: [\"Active\"] },\n    {\n      id: \"g1\",\n      join: \"or\",\n      items: [\n        { id: \"c2\", field: \"plan\", op: \"is\", value: [\"Team\"] },\n        { id: \"c3\", field: \"mrr\", op: \"gt\", value: 500 },\n      ],\n    },\n  ],\n};\n\nfunction test(c: Condition, row: Customer) {\n  const v = row[c.field];\n  switch (c.op) {\n    case \"is\":\n      return (c.value as string[]).length === 0 || (c.value as string[]).includes(String(v));\n    case \"isNot\":\n      return !(c.value as string[]).includes(String(v));\n    case \"gt\":\n      return Number(v) > Number(c.value);\n    case \"lt\":\n      return Number(v) < Number(c.value);\n    case \"between\": {\n      const [a, b] = c.value as [number, number];\n      return Number(v) >= a && Number(v) <= b;\n    }\n    case \"within\":\n      return Number(v) <= Number(c.value);\n    case \"olderThan\":\n      return Number(v) > Number(c.value);\n  }\n}\nconst evaluate = (g: FilterGroup, row: Customer): boolean => {\n  if (!g.items.length) return true;\n  const res = g.items.map((x) => (isGroup(x) ? evaluate(x, row) : test(x, row)));\n  return g.join === \"and\" ? res.every(Boolean) : res.some(Boolean);\n};\nconst describeCond = (c: Condition) => {\n  const f = FIELDS[c.field];\n  const op = OPS[f.type].find((o) => o.op === c.op)?.label ?? \"\";\n  const val = Array.isArray(c.value) && typeof c.value[0] !== \"number\" ? (c.value as string[]).join(\", \") || \"anything\" : c.op === \"between\" ? `${f.unit ?? \"\"}${(c.value as number[])[0]} and ${f.unit ?? \"\"}${(c.value as number[])[1]}` : f.type === \"days\" ? `${c.value} days` : `${f.unit ?? \"\"}${c.value}`;\n  return `${f.label} ${op} ${val}`;\n};\nconst describe = (g: FilterGroup, nested = false): string => {\n  const parts = g.items.map((x) => (isGroup(x) ? describe(x, true) : describeCond(x)));\n  const s = parts.join(` ${g.join} `);\n  return nested && parts.length > 1 ? `(${s})` : s;\n};\nconst defaultValue = (field: FieldKey, op: Op): Condition[\"value\"] => (FIELDS[field].type === \"enum\" ? [] : op === \"between\" ? [100, 1000] : FIELDS[field].type === \"days\" ? 7 : 500);\nconst money = (n: number) => (n ? `$${n.toLocaleString(\"en-US\")}` : \"—\");\n\nexport function AdvancedFilterBuilder({ defaultFilter = DEFAULT, onChange, theme = \"dark\", className }: AdvancedFilterBuilderProps) {\n  const p = PALETTES[theme];\n  const reduce = !!useReducedMotion();\n  const uid = React.useId();\n  const [filter, setFilter] = React.useState<FilterGroup>(defaultFilter);\n  const [views, setViews] = React.useState<{ name: string; filter: FilterGroup }[]>([{ name: \"Healthy accounts\", filter: DEFAULT }]);\n  const [naming, setNaming] = React.useState(false);\n  const [viewName, setViewName] = React.useState(\"\");\n  const [copied, setCopied] = React.useState(false);\n  const counter = React.useRef(10);\n  const focusOnce = React.useCallback((el: HTMLInputElement | null) => el?.focus({ preventScroll: true }), []);\n\n  React.useEffect(() => {\n    if (!copied) return;\n    const t = setTimeout(() => setCopied(false), 1500);\n    return () => clearTimeout(t);\n  }, [copied]);\n\n  const commit = (next: FilterGroup) => {\n    setFilter(next);\n    onChange?.(next);\n  };\n  const mapGroup = (g: FilterGroup, id: string, fn: (g: FilterGroup) => FilterGroup): FilterGroup => (g.id === id ? fn(g) : { ...g, items: g.items.map((x) => (isGroup(x) ? mapGroup(x, id, fn) : x)) });\n  const mapCond = (g: FilterGroup, id: string, fn: (c: Condition) => Condition): FilterGroup => ({ ...g, items: g.items.map((x) => (isGroup(x) ? mapCond(x, id, fn) : x.id === id ? fn(x) : x)) });\n  const remove = (g: FilterGroup, id: string): FilterGroup => ({ ...g, items: g.items.filter((x) => x.id !== id).map((x) => (isGroup(x) ? remove(x, id) : x)).filter((x) => !isGroup(x) || x.items.length > 0) });\n  const newCond = (): Condition => ({ id: `c${++counter.current}`, field: \"country\", op: \"is\", value: [] });\n\n  const rows = CUSTOMERS.filter((r) => evaluate(filter, r));\n  const conditions = JSON.stringify(filter).match(/\"field\"/g)?.length ?? 0;\n\n  const ring = { [\"--tw-ring-color\" as string]: p.ring, [\"--tw-ring-offset-color\" as string]: p.panel } as React.CSSProperties;\n  const focus = \"outline-none focus-visible:ring-2 focus-visible:ring-offset-2\";\n  const ctl = cn(\"h-8 cursor-pointer rounded-lg border px-2 text-[12.5px]\", focus);\n  const ctlStyle = { borderColor: p.border, background: p.input, color: p.text, ...ring } as React.CSSProperties;\n  const ghostBtn = cn(\"flex h-8 cursor-pointer items-center gap-1.5 rounded-lg border-0 bg-transparent px-2 text-[12.5px] hover:bg-[var(--h)]\", focus);\n\n  const valueControl = (c: Condition) => {\n    const f = FIELDS[c.field];\n    if (f.type === \"enum\") {\n      const vals = c.value as string[];\n      return (\n        <div className=\"order-last flex min-w-0 basis-full flex-wrap gap-1 @[560px]:order-none @[560px]:flex-1 @[560px]:basis-auto\" role=\"group\" aria-label={`${f.label} values`}>\n          {f.options!.map((o) => {\n            const on = vals.includes(o);\n            return (\n              <button key={o} type=\"button\" aria-pressed={on} onClick={() => commit(mapCond(filter, c.id, (x) => ({ ...x, value: on ? vals.filter((v) => v !== o) : [...vals, o] })))} className={cn(\"h-7 cursor-pointer rounded-full border px-2.5 text-[12px] transition-colors\", focus)} style={{ borderColor: on ? p.accent : p.border, background: on ? `${p.accent}1f` : \"transparent\", color: on ? p.text : p.muted, ...ring }}>\n                {o}\n              </button>\n            );\n          })}\n        </div>\n      );\n    }\n    if (c.op === \"between\") {\n      const [a, b] = c.value as [number, number];\n      return (\n        <div className=\"flex items-center gap-1.5\">\n          {[a, b].map((v, i) => (\n            <input key={i} type=\"number\" value={v} onChange={(e) => commit(mapCond(filter, c.id, (x) => ({ ...x, value: (i ? [a, Number(e.target.value)] : [Number(e.target.value), b]) as [number, number] })))} aria-label={`${f.label} ${i ? \"max\" : \"min\"}`} className={cn(ctl, \"w-20 cursor-text tabular-nums\")} style={ctlStyle} />\n          ))}\n        </div>\n      );\n    }\n    return (\n      <span className=\"flex items-center gap-1.5\">\n        <input type=\"number\" value={c.value as number} min={0} onChange={(e) => commit(mapCond(filter, c.id, (x) => ({ ...x, value: Number(e.target.value) })))} aria-label={`${f.label} value`} className={cn(ctl, \"w-20 cursor-text tabular-nums\")} style={ctlStyle} />\n        {f.type === \"days\" && (\n          <span className=\"text-[12.5px]\" style={{ color: p.muted }}>\n            days\n          </span>\n        )}\n      </span>\n    );\n  };\n\n  const condRow = (c: Condition) => {\n    const f = FIELDS[c.field];\n    return (\n      <div className=\"flex flex-wrap items-center gap-1.5\">\n        <select value={c.field} onChange={(e) => commit(mapCond(filter, c.id, () => ({ id: c.id, field: e.target.value as FieldKey, op: OPS[FIELDS[e.target.value as FieldKey].type][0].op, value: defaultValue(e.target.value as FieldKey, OPS[FIELDS[e.target.value as FieldKey].type][0].op) })))} aria-label=\"Field\" className={ctl} style={ctlStyle}>\n          {(Object.keys(FIELDS) as FieldKey[]).map((k) => (\n            <option key={k} value={k}>\n              {FIELDS[k].label}\n            </option>\n          ))}\n        </select>\n        <select value={c.op} onChange={(e) => commit(mapCond(filter, c.id, (x) => ({ ...x, op: e.target.value as Op, value: f.type === \"enum\" ? x.value : defaultValue(x.field, e.target.value as Op) })))} aria-label=\"Condition\" className={ctl} style={ctlStyle}>\n          {OPS[f.type].map((o) => (\n            <option key={o.op} value={o.op}>\n              {o.label}\n            </option>\n          ))}\n        </select>\n        {valueControl(c)}\n        <button type=\"button\" onClick={() => commit(remove(filter, c.id))} aria-label={`Remove ${describeCond(c)}`} className={cn(\"ml-auto grid h-7 w-7 cursor-pointer place-items-center rounded-md border-0 bg-transparent\", focus)} style={{ color: p.faint, ...ring }}>\n          <svg width=\"13\" height=\"13\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" aria-hidden=\"true\">\n            <path d=\"M6 6l12 12M18 6 6 18\" />\n          </svg>\n        </button>\n      </div>\n    );\n  };\n\n  const groupBox = (g: FilterGroup, depth: number): React.ReactNode => (\n    <div className={cn(\"flex flex-col gap-2\", depth > 0 && \"rounded-xl border p-3\")} style={depth > 0 ? { borderColor: p.border, background: p.group } : undefined}>\n      <AnimatePresence initial={false}>\n        {g.items.map((x, i) => (\n          <motion.div key={x.id} layout={!reduce ? \"position\" : false} initial={reduce ? false : { opacity: 0, y: -4 }} animate={{ opacity: 1, y: 0 }} exit={reduce ? undefined : { opacity: 0, height: 0 }} className=\"flex gap-2\">\n            <div className=\"w-12 shrink-0 pt-1.5 text-right\">\n              {i === 0 ? (\n                <span className=\"text-[12px]\" style={{ color: p.faint }}>\n                  {depth ? \"\" : \"Where\"}\n                </span>\n              ) : (\n                <button type=\"button\" onClick={() => commit(mapGroup(filter, g.id, (gg) => ({ ...gg, join: gg.join === \"and\" ? \"or\" : \"and\" })))} aria-label={`Combine with ${g.join === \"and\" ? \"or\" : \"and\"} instead`} className={cn(\"h-6 cursor-pointer rounded-md border px-1.5 text-[11px] font-semibold tracking-[0.04em] uppercase\", focus)} style={{ borderColor: g.join === \"and\" ? p.border : `${p.accent}88`, color: g.join === \"and\" ? p.muted : p.accent, background: \"transparent\", ...ring }}>\n                  {g.join}\n                </button>\n              )}\n            </div>\n            <div className=\"min-w-0 flex-1\">{isGroup(x) ? groupBox(x, depth + 1) : condRow(x)}</div>\n          </motion.div>\n        ))}\n      </AnimatePresence>\n      <div className=\"flex flex-wrap gap-1 pl-14\" style={{ [\"--h\" as string]: p.chip } as React.CSSProperties}>\n        <button type=\"button\" onClick={() => commit(mapGroup(filter, g.id, (gg) => ({ ...gg, items: [...gg.items, newCond()] })))} className={ghostBtn} style={{ color: p.muted, ...ring }}>\n          + Add condition\n        </button>\n        {depth === 0 && (\n          <button type=\"button\" onClick={() => commit(mapGroup(filter, g.id, (gg) => ({ ...gg, items: [...gg.items, { id: `g${++counter.current}`, join: \"or\", items: [newCond()] }] })))} className={ghostBtn} style={{ color: p.muted, ...ring }}>\n            + Add group\n          </button>\n        )}\n      </div>\n    </div>\n  );\n\n  return (\n    <section className={cn(\"@container w-full\", className)} style={{ background: p.bg, color: p.text }}>\n      <div className=\"mx-auto max-w-5xl px-4 py-10 @[640px]:px-6\">\n        <div className=\"flex flex-wrap items-end justify-between gap-3\">\n          <div>\n            <h2 className=\"m-0 text-[20px] font-semibold tracking-[-0.01em]\">Customers</h2>\n            <p className=\"m-0 mt-1 text-[13px]\" style={{ color: p.muted }} aria-live=\"polite\">\n              Showing <span style={{ color: p.text }}>{rows.length}</span> of {CUSTOMERS.length} · {conditions} {conditions === 1 ? \"condition\" : \"conditions\"}\n            </p>\n          </div>\n          <div className=\"flex flex-wrap items-center gap-1.5\">\n            {views.map((v) => (\n              <button key={v.name} type=\"button\" onClick={() => commit(v.filter)} aria-pressed={JSON.stringify(v.filter) === JSON.stringify(filter)} className={cn(\"h-7 cursor-pointer rounded-full border px-2.5 text-[12px]\", focus)} style={{ borderColor: JSON.stringify(v.filter) === JSON.stringify(filter) ? p.on : p.border, color: p.text, background: \"transparent\", ...ring }}>\n                {v.name}\n              </button>\n            ))}\n          </div>\n        </div>\n\n        <div className=\"mt-5 rounded-2xl border p-4 @[640px]:p-5\" style={{ borderColor: p.border, background: p.panel }}>\n          {filter.items.length ? (\n            groupBox(filter, 0)\n          ) : (\n            <div className=\"flex items-center justify-between gap-3\">\n              <span className=\"text-[13px]\" style={{ color: p.faint }}>\n                No filters. Showing everyone.\n              </span>\n              <button type=\"button\" onClick={() => commit({ ...filter, items: [newCond()] })} className={cn(\"h-8 cursor-pointer rounded-lg border-0 px-3 text-[12.5px] font-medium\", focus)} style={{ background: p.on, color: p.onText, ...ring }}>\n                + Add filter\n              </button>\n            </div>\n          )}\n          <div className=\"mt-4 flex flex-col gap-3 border-t pt-3 @[640px]:flex-row @[640px]:items-center @[640px]:justify-between\" style={{ borderColor: p.border }}>\n            <p className=\"m-0 min-w-0 text-[12.5px] leading-[1.5]\" style={{ color: p.muted }}>\n              <span style={{ color: p.faint }}>Reads as: </span>\n              {filter.items.length ? describe(filter) : \"everyone\"}\n            </p>\n            <div className=\"flex shrink-0 items-center gap-1.5\">\n              {naming ? (\n                <form\n                  className=\"flex gap-1.5\"\n                  onSubmit={(e) => {\n                    e.preventDefault();\n                    if (!viewName.trim()) return;\n                    setViews((v) => [...v.filter((x) => x.name !== viewName.trim()), { name: viewName.trim(), filter }]);\n                    setNaming(false);\n                    setViewName(\"\");\n                  }}\n                >\n                  <label htmlFor={`${uid}-vn`} className=\"sr-only\">\n                    View name\n                  </label>\n                  <input id={`${uid}-vn`} ref={focusOnce} value={viewName} onChange={(e) => setViewName(e.target.value)} onKeyDown={(e) => e.key === \"Escape\" && setNaming(false)} placeholder=\"View name\" className={cn(ctl, \"w-36 cursor-text\")} style={ctlStyle} />\n                  <button type=\"submit\" className={cn(\"h-8 cursor-pointer rounded-lg border-0 px-3 text-[12.5px] font-medium\", focus)} style={{ background: p.on, color: p.onText, ...ring }}>\n                    Save\n                  </button>\n                </form>\n              ) : (\n                <>\n                  <button type=\"button\" onClick={() => commit({ ...filter, items: [] })} className={cn(\"h-8 cursor-pointer rounded-lg border-0 bg-transparent px-2.5 text-[12.5px]\", focus)} style={{ color: p.muted, ...ring }}>\n                    Clear\n                  </button>\n                  <button\n                    type=\"button\"\n                    onClick={() => {\n                      navigator.clipboard?.writeText(JSON.stringify(filter, null, 2)).catch(() => {});\n                      setCopied(true);\n                    }}\n                    className={cn(\"h-8 cursor-pointer rounded-lg border bg-transparent px-2.5 text-[12.5px]\", focus)}\n                    style={{ borderColor: p.border, color: copied ? p.green : p.text, ...ring }}\n                  >\n                    {copied ? \"✓ Copied\" : \"Copy JSON\"}\n                  </button>\n                  <button type=\"button\" onClick={() => setNaming(true)} disabled={!filter.items.length} className={cn(\"h-8 cursor-pointer rounded-lg border-0 px-3 text-[12.5px] font-medium disabled:opacity-40\", focus)} style={{ background: p.on, color: p.onText, ...ring }}>\n                    Save view\n                  </button>\n                </>\n              )}\n            </div>\n          </div>\n        </div>\n\n        <div className=\"mt-5 overflow-x-auto rounded-2xl border\" style={{ borderColor: p.border }}>\n          <table className=\"w-full min-w-[520px] border-collapse text-left text-[13px]\">\n            <thead>\n              <tr style={{ color: p.faint }}>\n                {[\"Customer\", \"Status\", \"Plan\", \"MRR\", \"Country\", \"Last active\"].map((h, i) => (\n                  <th key={h} className={cn(\"border-b px-3 py-2.5 text-[11.5px] font-medium tracking-[0.04em] uppercase\", i >= 4 && \"hidden @[760px]:table-cell\", i === 3 && \"text-right\")} style={{ borderColor: p.border }}>\n                    {h}\n                  </th>\n                ))}\n              </tr>\n            </thead>\n            <tbody>\n              <AnimatePresence initial={false}>\n                {rows.map((r) => (\n                  <motion.tr key={r.id} layout={!reduce ? \"position\" : false} initial={reduce ? false : { opacity: 0 }} animate={{ opacity: 1 }} exit={reduce ? undefined : { opacity: 0 }} transition={{ duration: 0.18 }}>\n                    <td className=\"border-b px-3 py-2.5 font-medium\" style={{ borderColor: p.border }}>\n                      {r.name}\n                    </td>\n                    <td className=\"border-b px-3 py-2.5\" style={{ borderColor: p.border }}>\n                      <span className=\"rounded-full px-2 py-0.5 text-[11.5px]\" style={{ background: r.status === \"Active\" ? `${p.green}1f` : r.status === \"Trial\" ? `${p.accent}1f` : p.chip, color: r.status === \"Active\" ? p.green : r.status === \"Trial\" ? p.accent : p.muted }}>\n                        {r.status}\n                      </span>\n                    </td>\n                    <td className=\"border-b px-3 py-2.5\" style={{ borderColor: p.border, color: p.muted }}>\n                      {r.plan} · {r.seats} seats\n                    </td>\n                    <td className=\"border-b px-3 py-2.5 text-right tabular-nums\" style={{ borderColor: p.border }}>\n                      {money(r.mrr)}\n                    </td>\n                    <td className=\"hidden border-b px-3 py-2.5 @[760px]:table-cell\" style={{ borderColor: p.border, color: p.muted }}>\n                      {r.country}\n                    </td>\n                    <td className=\"hidden border-b px-3 py-2.5 @[760px]:table-cell\" style={{ borderColor: p.border, color: p.faint }}>\n                      {r.lastActive === 0 ? \"Today\" : `${r.lastActive}d ago`}\n                    </td>\n                  </motion.tr>\n                ))}\n              </AnimatePresence>\n              {!rows.length && (\n                <tr>\n                  <td colSpan={6} className=\"px-3 py-10 text-center text-[13px]\" style={{ color: p.faint }}>\n                    No customers match. Loosen a condition or switch and to or.\n                  </td>\n                </tr>\n              )}\n            </tbody>\n          </table>\n        </div>\n      </div>\n    </section>\n  );\n}\n\nexport default AdvancedFilterBuilder;\n",
      "type": "registry:component"
    }
  ],
  "type": "registry:component"
}