# Add the "Seating Chart" block to this P1 project

Add a Puck component from P1 Blocks (https://p1-blocks.prolificdigital.io/blocks/seating-chart) to this Pantheon Content Publisher (P1) Next.js project. SVG venue plan with patterned indigo price zones, a matching price table and accessible seating details.

## Steps

1. Create `components/puck/seating-chart-block.tsx` with the exact file contents below. If `components/puck/` doesn't exist, find the folder where this project keeps its Puck components (look at the imports in `puck.config.tsx`) and put it there.
2. In `puck.config.tsx`, import it: `import { seatingChartBlock } from "./components/puck/seating-chart-block";`
3. Register it under `components` as `SeatingChartBlock: seatingChartBlock`.
4. Add `"SeatingChartBlock"` to the best-fitting entry in `categories` (this block's library category is "Arts & culture"). Create a category only if none fits.
5. Run the project's type check (usually `pnpm typecheck`) and resolve anything project-specific.
6. If `package.json` has a `sync:registry` script, tell the user it must run (or that CI will run it) before the new component appears in the P1 editor.

## Rules

- Do not add dependencies. The block is self-contained by design: one type-only import from `@puckeditor/core`, Tailwind v4 classes, no client JavaScript.
- Keep the files as-is unless the user asks for changes. The accent color is `indigo-*`; if the project has brand colors, offer to swap them with a find-and-replace on `indigo-`.
- Images are plain `imageUrl` + `imageAlt` text fields. If this project defines a P1 media-library field (search for `"p1-media"`), offer to switch to it.
- Don't change prop names in `defaultProps`. Content editors' saved pages depend on them.

## File: `components/puck/seating-chart-block.tsx`

```tsx
import type { ComponentConfig } from "@puckeditor/core";

/**
 * Seating Chart — a venue's price zones drawn as an architect's plan: stage, orchestra, boxes,
 * mezzanine and balcony as labeled SVG shapes, each zone a distinct indigo shade *and* pattern,
 * repeated in a real price table, plus accessible seating and assistive listening details.
 * Register: `SeatingChartBlock: seatingChartBlock` in puck.config.tsx.
 */

type Heading = "h1" | "h2" | "h3" | "h4";
type Area = "orchestra" | "box" | "mezzanine" | "balcony";
type Fill = "solid" | "lines" | "dots" | "hatch";

type Zone = { area: Area; name: string; priceRange: string; fill: Fill; description: string };

export type SeatingChartProps = {
  eyebrow: string;
  heading: string;
  headingLevel: Heading;
  intro: string;
  venueName: string;
  stageLabel: string;
  zones: Zone[];
  priceCaption: string;
  accessHeading: string;
  access: { title: string; detail: string }[];
  note: string;
  ctaLabel: string;
  ctaHref: string;
};

const SUB = { h1: "h2", h2: "h3", h3: "h4", h4: "h5" } as const;
const ring = "focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600";

const CX = 240;
const CY = 30;
const r1 = (n: number) => Math.round(n * 10) / 10;
const pt = (r: number, deg: number) => [r1(CX + r * Math.cos((deg * Math.PI) / 180)), r1(CY + r * Math.sin((deg * Math.PI) / 180))];
// Annular sector between two radii and two angles (degrees, clockwise from +x in screen space).
const sector = (inner: number, outer: number, a1: number, a2: number) => {
  const large = a2 - a1 > 180 ? 1 : 0;
  const [ox1, oy1] = pt(outer, a1);
  const [ox2, oy2] = pt(outer, a2);
  const [ix2, iy2] = pt(inner, a2);
  const [ix1, iy1] = pt(inner, a1);
  return `M${ox1} ${oy1}A${outer} ${outer} 0 ${large} 1 ${ox2} ${oy2}L${ix2} ${iy2}A${inner} ${inner} 0 ${large} 0 ${ix1} ${iy1}Z`;
};

const SHAPES: Record<Area, { paths: string[]; labels: [number, number][] }> = {
  orchestra: { paths: [sector(58, 148, 30, 150)], labels: [pt(104, 90) as [number, number]] },
  box: { paths: [sector(72, 140, 12, 27), sector(72, 140, 153, 168)], labels: [pt(106, 20) as [number, number], pt(106, 160) as [number, number]] },
  mezzanine: { paths: [sector(162, 216, 33, 147)], labels: [pt(189, 90) as [number, number]] },
  balcony: { paths: [sector(230, 296, 36, 144)], labels: [pt(263, 90) as [number, number]] },
};
const AREA_ORDER: Area[] = ["orchestra", "box", "mezzanine", "balcony"];
const AREA_NAME: Record<Area, string> = { orchestra: "Orchestra", box: "Boxes", mezzanine: "Mezzanine", balcony: "Balcony" };
const FILLS: Fill[] = ["solid", "lines", "dots", "hatch"];

function Patterns({ uid }: { uid: string }) {
  return (
    <defs>
      <pattern id={`${uid}-solid`} width="8" height="8" patternUnits="userSpaceOnUse">
        <rect width="8" height="8" className="fill-indigo-800" />
      </pattern>
      <pattern id={`${uid}-lines`} width="8" height="8" patternUnits="userSpaceOnUse" patternTransform="rotate(45)">
        <rect width="8" height="8" className="fill-indigo-200" />
        <rect width="3.5" height="8" className="fill-indigo-600" />
      </pattern>
      <pattern id={`${uid}-dots`} width="9" height="9" patternUnits="userSpaceOnUse">
        <rect width="9" height="9" className="fill-indigo-50" />
        <circle cx="4.5" cy="4.5" r="2" className="fill-indigo-700" />
      </pattern>
      <pattern id={`${uid}-hatch`} width="8" height="8" patternUnits="userSpaceOnUse">
        <rect width="8" height="8" className="fill-white" />
        <path d="M0 0L8 8M8 0L0 8" strokeWidth="1.25" className="stroke-indigo-400" />
      </pattern>
      <pattern id={`${uid}-none`} width="6" height="6" patternUnits="userSpaceOnUse">
        <rect width="6" height="6" className="fill-neutral-100" />
      </pattern>
    </defs>
  );
}

export const seatingChartBlock: ComponentConfig<SeatingChartProps> = {
  label: "Seating Chart",
  fields: {
    eyebrow: { type: "text", label: "Eyebrow", metadata: { help: "Leave blank to hide it." } },
    heading: { type: "text", label: "Heading" },
    headingLevel: {
      type: "select",
      label: "Heading level",
      options: [
        { label: "H1", value: "h1" },
        { label: "H2", value: "h2" },
        { label: "H3", value: "h3" },
        { label: "H4", value: "h4" },
      ],
      metadata: { help: "Sets the page outline for screen readers and search. The look doesn't change." },
    },
    intro: { type: "textarea", label: "Intro", metadata: { help: "Leave blank to hide it." } },
    venueName: { type: "text", label: "Hall name", metadata: { help: "Labels the plan, like Halvard Main Hall." } },
    stageLabel: { type: "text", label: "Stage label" },
    zones: {
      type: "array",
      label: "Price zones",
      min: 1,
      max: 4,
      getItemSummary: (item) => [item?.name, item?.priceRange].filter(Boolean).join(": ") || "Zone",
      defaultItemProps: { area: "balcony", name: "Balcony", priceRange: "$29–$39", fill: "hatch", description: "" },
      arrayFields: {
        area: {
          type: "select",
          label: "Area on the plan",
          options: [
            { label: "Orchestra", value: "orchestra" },
            { label: "Boxes", value: "box" },
            { label: "Mezzanine", value: "mezzanine" },
            { label: "Balcony", value: "balcony" },
          ],
          metadata: { help: "Which part of the drawing this zone colors. Use each area once." },
        },
        name: { type: "text", label: "Zone name" },
        priceRange: { type: "text", label: "Prices", metadata: { help: "Like $49–$89." } },
        fill: {
          type: "select",
          label: "Pattern",
          options: [
            { label: "Deep indigo, solid", value: "solid" },
            { label: "Indigo stripes", value: "lines" },
            { label: "Indigo dots", value: "dots" },
            { label: "Light crosshatch", value: "hatch" },
          ],
          metadata: { help: "Give each zone a different pattern so the plan reads without color." },
        },
        description: { type: "text", label: "Description", metadata: { help: "Rows, sightlines, legroom. Leave blank to hide it." } },
      },
    },
    priceCaption: { type: "text", label: "Price table caption", metadata: { help: "Read aloud by screen readers and shown above the table." } },
    accessHeading: { type: "text", label: "Accessibility heading" },
    access: {
      type: "array",
      label: "Accessibility details",
      min: 0,
      max: 6,
      getItemSummary: (item) => item?.title || "Detail",
      defaultItemProps: { title: "Detail", detail: "" },
      arrayFields: {
        title: { type: "text", label: "Title" },
        detail: { type: "textarea", label: "Details" },
      },
    },
    note: { type: "textarea", label: "Plan note", metadata: { help: "Shown under the plan, like a note that zones are approximate." } },
    ctaLabel: { type: "text", label: "Button text", metadata: { help: "Leave blank to hide it." } },
    ctaHref: { type: "text", label: "Button link" },
  },
  defaultProps: {
    eyebrow: "Seating & prices",
    heading: "Find your seat",
    headingLevel: "h2",
    intro: "Halvard Main Hall seats 1,840 across four levels, and no seat is more than 110 feet from the stage. Prices vary by performance; these are typical for the 2026–27 season.",
    venueName: "Halvard Main Hall",
    stageLabel: "Stage",
    zones: [
      { area: "orchestra", name: "Orchestra", priceRange: "$69–$129", fill: "solid", description: "Rows A–Z, closest to the stage. Step-free from the main lobby." },
      { area: "box", name: "Box", priceRange: "$95–$149", fill: "lines", description: "Eight boxes of four movable chairs, with a side view of the stage." },
      { area: "mezzanine", name: "Mezzanine", priceRange: "$49–$89", fill: "dots", description: "The best view of choreography. Elevator access." },
      { area: "balcony", name: "Balcony", priceRange: "$29–$45", fill: "hatch", description: "Steeper rake and the full stage picture. Elevator to row C." },
    ],
    priceCaption: "Typical ticket prices by zone",
    accessHeading: "Accessible seating",
    access: [
      { title: "Wheelchair locations", detail: "In Orchestra rows M and Z and Mezzanine row A, each with a companion seat. Book them at the regular price." },
      { title: "Assistive listening", detail: "Infrared and induction-loop receivers are free at the coat check. The Orchestra and Mezzanine are fully looped." },
      { title: "Aisle-transfer seats", detail: "Armrests that lift, on every Orchestra aisle. Ask for them when you book." },
      { title: "ASL and audio description", detail: "Selected performances. Call the box office at 555-0163 to reserve a seat with a clear sightline." },
    ],
    note: "Zones are approximate and not to scale. Exact seats are shown when you pick a performance.",
    ctaLabel: "Choose a performance",
    ctaHref: "/season",
  },
  render: ({ id, eyebrow, heading, headingLevel, intro, venueName, stageLabel, zones, priceCaption, accessHeading, access, note, ctaLabel, ctaHref }) => {
    const H = headingLevel || "h2";
    const Sub = SUB[H] ?? "h3";
    const uid = `p1-seating-${id}`;
    const list = (zones ?? []).filter((z) => z?.name);
    const byArea = new Map<Area, Zone>();
    for (const z of list) if (z.area && !byArea.has(z.area)) byArea.set(z.area, z);
    const fillOf = (z?: Zone) => `url(#${uid}-${z && FILLS.includes(z.fill) ? z.fill : "none"})`;
    const accessList = (access ?? []).filter((a) => a?.title);
    const stage = stageLabel || "Stage";
    const desc = [
      `${stage} at the front.`,
      ...AREA_ORDER.filter((a) => byArea.has(a)).map((a) => {
        const z = byArea.get(a)!;
        return `${z.name}${z.priceRange ? `, ${z.priceRange}` : ""}.`;
      }),
    ].join(" ");

    return (
      <section className="bg-white px-4 py-16 sm:px-6 sm:py-20 lg:px-8 lg:py-24">
        <div className="mx-auto max-w-7xl">
          {eyebrow || heading || intro ? (
            <header className="max-w-3xl">
              {eyebrow ? <p className="text-xs font-semibold tracking-widest text-indigo-700 uppercase">{eyebrow}</p> : null}
              {heading ? <H className={`${eyebrow ? "mt-4" : ""} font-serif text-5xl leading-none font-normal tracking-tight text-balance text-neutral-950 sm:text-6xl lg:text-7xl`}>{heading}</H> : null}
              {intro ? <p className="mt-6 text-lg leading-8 text-pretty text-neutral-600">{intro}</p> : null}
            </header>
          ) : null}

          <div className="mt-12 grid grid-cols-1 gap-12 lg:mt-16 lg:grid-cols-12 lg:gap-14">
            <figure className="min-w-0 lg:col-span-7">
              <div className="relative border border-neutral-950 bg-neutral-50 p-4 sm:p-8">
                <span aria-hidden="true" className="absolute top-2 left-2 size-3 border-t border-l border-neutral-950" />
                <span aria-hidden="true" className="absolute top-2 right-2 size-3 border-t border-r border-neutral-950" />
                <span aria-hidden="true" className="absolute bottom-2 left-2 size-3 border-b border-l border-neutral-950" />
                <span aria-hidden="true" className="absolute right-2 bottom-2 size-3 border-r border-b border-neutral-950" />
                <div className="flex items-baseline justify-between gap-4 px-1">
                  {venueName ? <p className="font-serif text-lg text-neutral-950 italic sm:text-xl">{venueName}</p> : <span />}
                  <p aria-hidden="true" className="text-xs font-semibold tracking-widest text-neutral-600 uppercase">Plan</p>
                </div>
                <svg
                  viewBox="0 0 480 340"
                  preserveAspectRatio="xMidYMid meet"
                  role="img"
                  aria-labelledby={`${uid}-title ${uid}-desc`}
                  className="mt-4 h-auto w-full"
                >
                  <title id={`${uid}-title`}>{`Seating plan${venueName ? ` of ${venueName}` : ""}`}</title>
                  <desc id={`${uid}-desc`}>{desc}</desc>
                  <Patterns uid={uid} />
                  {AREA_ORDER.map((a) => {
                    const z = byArea.get(a);
                    return SHAPES[a].paths.map((d, i) => (
                      <path key={`${a}-${i}`} d={d} fill={fillOf(z)} strokeWidth="2.5" strokeLinejoin="round" className={z ? "stroke-white" : "stroke-neutral-300"} />
                    ));
                  })}
                  <rect x="150" y="6" width="180" height="34" rx="2" className="fill-neutral-950" />
                  <text x={CX} y="28" textAnchor="middle" fontSize="13" fontWeight="600" letterSpacing="3" className="fill-white">
                    {stage.toUpperCase()}
                  </text>
                  {AREA_ORDER.map((a) => {
                    const z = byArea.get(a);
                    if (!z) return null;
                    const text = z.name;
                    const w = Math.min(160, Math.max(44, text.length * 8.2 + 20));
                    return SHAPES[a].labels.map(([x, y], i) => (
                      <g key={`${a}-label-${i}`} aria-hidden="true">
                        <rect x={x - w / 2} y={y - 13} width={w} height="26" rx="13" className="fill-white stroke-neutral-950" strokeWidth="1" />
                        <text x={x} y={y + 5} textAnchor="middle" fontSize="14" fontWeight="600" className="fill-neutral-950">
                          {text}
                        </text>
                      </g>
                    ));
                  })}
                </svg>
              </div>
              {note ? (
                <figcaption className="mt-4 flex gap-2 text-sm leading-6 text-neutral-600">
                  <svg aria-hidden="true" viewBox="0 0 20 20" fill="currentColor" className="mt-0.5 size-5 shrink-0 text-indigo-600">
                    <path fillRule="evenodd" d="M18 10a8 8 0 1 1-16 0 8 8 0 0 1 16 0Zm-7-4a1 1 0 1 1-2 0 1 1 0 0 1 2 0ZM9 9a.75.75 0 0 0 0 1.5h.253a.25.25 0 0 1 .244.304l-.459 2.066A1.75 1.75 0 0 0 10.747 15H11a.75.75 0 0 0 0-1.5h-.253a.25.25 0 0 1-.244-.304l.459-2.066A1.75 1.75 0 0 0 9.253 9H9Z" clipRule="evenodd" />
                  </svg>
                  {note}
                </figcaption>
              ) : null}
            </figure>

            <div className="min-w-0 lg:col-span-5">
              {list.length ? (
                <table className="w-full text-left">
                  <caption className="border-b border-neutral-950 pb-3 text-left text-xs font-semibold tracking-widest text-neutral-950 uppercase">{priceCaption || "Ticket prices by zone"}</caption>
                  <thead className="sr-only">
                    <tr>
                      <th scope="col">Zone</th>
                      <th scope="col">Price</th>
                    </tr>
                  </thead>
                  <tbody className="divide-y divide-neutral-200">
                    {list.map((z, i) => (
                      <tr key={`${z.name}-${i}`}>
                        <th scope="row" className="py-4 pr-4 align-top font-normal">
                          <span className="flex gap-3">
                            <svg aria-hidden="true" viewBox="0 0 28 28" className="mt-0.5 size-7 shrink-0">
                              <rect x="0.5" y="0.5" width="27" height="27" fill={fillOf(z)} className="stroke-neutral-950" strokeWidth="1" />
                            </svg>
                            <span className="min-w-0">
                              <span className="block font-serif text-xl leading-tight text-neutral-950">{z.name}</span>
                              {z.description ? <span className="mt-1 block text-sm leading-6 text-pretty text-neutral-600">{z.description}</span> : null}
                            </span>
                          </span>
                        </th>
                        <td className="py-4 text-right align-top text-base font-semibold whitespace-nowrap text-neutral-950 tabular-nums">{z.priceRange}</td>
                      </tr>
                    ))}
                  </tbody>
                </table>
              ) : null}

              {accessList.length ? (
                <div className="mt-12">
                  <Sub className="flex items-center gap-2 border-b border-neutral-950 pb-3 text-xs font-semibold tracking-widest text-neutral-950 uppercase">
                    <svg aria-hidden="true" viewBox="0 0 20 20" fill="currentColor" className="size-5 text-indigo-600">
                      <path d="M10 1.5a1.75 1.75 0 1 1 0 3.5 1.75 1.75 0 0 1 0-3.5ZM4.2 6.6a.75.75 0 0 1 .95-.48c1.6.53 3.2.88 4.85.88s3.25-.35 4.85-.88a.75.75 0 1 1 .47 1.42c-1.13.38-2.3.66-3.5.8v3.16l1.66 5.8a.75.75 0 1 1-1.44.4L10.5 12.5h-1l-1.54 5.2a.75.75 0 1 1-1.44-.4l1.66-5.8V8.34a20 20 0 0 1-3.5-.8.75.75 0 0 1-.48-.94Z" />
                    </svg>
                    {accessHeading || "Accessible seating"}
                  </Sub>
                  <dl className="mt-2 divide-y divide-neutral-200">
                    {accessList.map((a, i) => (
                      <div key={`${a.title}-${i}`} className="py-4">
                        <dt className="text-sm font-semibold text-neutral-950">{a.title}</dt>
                        {a.detail ? <dd className="mt-1 text-sm leading-6 text-pretty text-neutral-600">{a.detail}</dd> : null}
                      </div>
                    ))}
                  </dl>
                </div>
              ) : null}

              {ctaLabel ? (
                <a href={ctaHref || "#"} className={`mt-8 inline-flex min-h-12 w-full items-center justify-center bg-neutral-950 px-6 text-base font-semibold text-white transition hover:bg-indigo-700 motion-reduce:transition-none sm:w-auto ${ring}`}>
                  {ctaLabel}
                </a>
              ) : null}
            </div>
          </div>
        </div>
      </section>
    );
  },
};
```
