{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "nonprofit-core",
  "title": "Nonprofit: content and kit",
  "description": "Every word and figure of the nonprofit template and the arithmetic behind them (unit costs, jars, the appeal, days left, largest-remainder shares), the gift kept in sessionStorage, the sea and sun palette in both themes, the drawings, the appeal bar, the column and the entrances its sections share.",
  "dependencies": [
    "motion"
  ],
  "registryDependencies": [
    "https://eased.dev/r/eased-tokens.json",
    "https://eased.dev/r/eased-motion.json",
    "https://eased.dev/r/template-core.json"
  ],
  "files": [
    {
      "path": "src/registry/eased/templates/nonprofit/content.ts",
      "content": "import type { ContactFormContent } from \"../_shared/contact-form\";\nimport type { EmailCaptureContent } from \"../_shared/email-capture\";\nimport type { FaqItem } from \"../_shared/faq\";\nimport type { FooterContent } from \"../_shared/footer\";\nimport type { ProofNumber } from \"../_shared/proof-strip\";\nimport type { Frequency, Range, Unit } from \"./giving\";\n\n/**\n * Every word and number of the nonprofit template. The sample charity is Brimwell, a small\n * charity that funds household water filters, tap stands and well repairs, written for the\n * United Kingdom: pounds, en-GB dates and a generic tax-relief line. Every figure is a sample;\n * every registration, regulator and tax-relief claim is a bracketed placeholder you replace\n * (README, \"Before you ship\"). The places, people and supporters are invented. Links that start\n * with \"/\" are the template's own pages.\n */\n\nexport const brand = {\n  name: \"Brimwell\",\n  line: \"Clean water, counted one household at a time.\",\n  domain: \"brimwell.example\",\n  email: \"hello@brimwell.example\",\n  /** Placeholders, never claims: replace each with your own wording and number. */\n  registered: \"[Registered charity in England and Wales, no. 0000000]\",\n  regulator: \"[Regulated by your fundraising regulator]\",\n};\n\n/** The quiet line under every sample figure. */\nexport const sampleNote = \"Sample figures for this template.\";\n\nexport const locale = \"en-GB\";\nexport const money: Intl.NumberFormatOptions = { style: \"currency\", currency: \"GBP\", maximumFractionDigits: 0 };\nconst GBP = new Intl.NumberFormat(locale, money);\nexport const formatMoney = (n: number) => GBP.format(n);\n\n/* ---------- Giving ---------------------------------------------------------------------- */\n\n/**\n * What a gift pays for. `unit` is the one thing every sentence counts: a household filter, its\n * spare cartridges and a follow-up visit for a year. The hero's figures, the jars, the appeal and\n * the donate page all derive from `unit.cost`, so change it here and they all stay true.\n */\nexport const giving = {\n  unit: { cost: 15, one: \"family\", many: \"families\" } satisfies Unit,\n  once: { min: 15, max: 300, step: 5, rest: 45, presets: [15, 45, 90, 150] } satisfies Range,\n  monthly: { min: 5, max: 25, step: 1, rest: 10, presets: [5, 10, 15, 25] } satisfies Range,\n  /** A typed amount, in whole pounds. */\n  typed: { min: 1, max: 100_000 },\n  /** The hero's jars, one per family: one-off and monthly both top out at 20. */\n  jars: 20,\n  /**\n   * The hero's example: the one-off amount it slides up to and the monthly one it flips to. Both\n   * give a single-digit count, like the resting gift, so the headline keeps its width as it plays.\n   */\n  example: { once: 90, monthly: 10 },\n};\n\nexport const frequencies: readonly { value: Frequency; label: string }[] = [\n  { value: \"once\", label: \"One-off\" },\n  { value: \"monthly\", label: \"Monthly\" },\n];\n\n/**\n * The appeal the header carries on every page. Its target is counted in families and its money\n * target derives from the unit cost; `raised` is pounds in so far. `closes` is the last day, in\n * `timeZone`: after it, the header reads as closed (README).\n */\nexport const appeal = {\n  name: \"Winter filters appeal\",\n  short: \"Winter appeal\",\n  target: 640,\n  raised: 6135,\n  closes: \"2027-02-28\",\n  /**\n   * Demo mode, for the sample: the appeal closes this many days after today, every day, so a\n   * preview never reaches its closed state by itself. Set it to null for a real appeal, which\n   * then closes on `closes`.\n   */\n  rolling: 61 as number | null,\n  timeZone: \"Europe/London\",\n  closesLabel: (date: string) => `Closes ${date}`,\n  /** Before the client knows today, in demo mode: no date at all rather than a wrong one. */\n  open: \"Open now\",\n  left: (days: number) => (days === 0 ? \"Last day\" : days === 1 ? \"1 day left\" : `${days} days left`),\n  closed: \"Appeal closed\",\n  /** Once it has closed: where gifts go instead, said wherever the appeal was. */\n  general: \"Where it’s needed most\",\n  after: \"The winter appeal has closed. Gifts now go to the project closest to finishing.\",\n  /** The progress bar's spoken value. */\n  spoken: (funded: number, target: number, days: string) => `${funded} of ${target} families funded. ${days}.`,\n  of: (target: number) => `of ${target}`,\n  families: \"families\",\n};\n\n/** The top bar: the pages, the action and the phone menu. */\nexport const nav = {\n  label: \"Main\",\n  skip: \"Skip to content\",\n  home: \"Brimwell home\",\n  links: [\n    { label: \"Projects\", href: \"/projects\" },\n    { label: \"Impact\", href: \"/impact\" },\n    { label: \"Get involved\", href: \"/get-involved\" },\n    { label: \"About\", href: \"/about\" },\n  ],\n  donate: { label: \"Donate\", href: \"/donate\" },\n  menu: \"Menu\",\n  close: \"Close\",\n  contact: { label: \"Contact\", href: \"/contact\" },\n};\n\n/* ---------- Home ------------------------------------------------------------------------ */\n\nexport const hero = {\n  label: \"Choose a gift\",\n  lead: \"Brimwell funds household water filters, school taps and wells that work again. Move the amount and watch it land.\",\n  /** The calculator card: what you give, the sum it works, what families get. */\n  card: {\n    give: \"You give\",\n    get: \"Families get\",\n    /** The sum, plainly: \"£45 ÷ £15 = 3 families\", or \"£10 × 12 = £120 ÷ £15 = 8 families\". */\n    sum: (amount: string, yearly: string | null, cost: string, count: string) => (yearly ? `${amount} × 12 = ${yearly} ÷ ${cost} = ${count}` : `${amount} ÷ ${cost} = ${count}`),\n    /** Under one family's worth there is no division to show: \"£10 of the £15 one family needs\". */\n    sumUnder: (amount: string, yearly: string | null, cost: string) => (yearly ? `${amount} × 12 = ${yearly} of the ${cost} one family needs` : `${amount} of the ${cost} one family needs`),\n    unit: (cost: string) => `${cost} is one family’s filter, cartridges and visits for a year`,\n    left: (left: string) => `${left} left over goes toward the next family`,\n    where: { label: \"Where it goes\", href: \"/impact\" },\n  },\n  /** The two lines under the jars: the share that reaches a home, and the follow-up promise. */\n  trust: {\n    reach: (pct: number) => `${pct}% of every pound reaches a home`,\n    reachLink: { label: \"See the split\", href: \"/impact\" },\n    visits: \"Every filter visited twice in its first year\",\n    visitsLink: { label: \"How we check\", href: \"/impact\" },\n  },\n  /** After the amount: nothing for one-off, \" a month\" for monthly. */\n  per: { once: \"\", monthly: \" a month\" } satisfies Record<Frequency, string>,\n  gives: \"gives\",\n  what: { once: \"a water filter for a year.\", monthly: \"a water filter, every year.\" } satisfies Record<Frequency, string>,\n  /** Under one family's worth: what the gift does instead. A monthly gift is counted over its year. */\n  toward: (left: string, monthly = false) => `toward a family’s filter. ${left} more ${monthly ? \"over the year \" : \"\"}completes one.`,\n  /** Past the last jar. */\n  more: (n: string) => `and ${n} more beyond these twenty`,\n  spoken: (amount: string, per: string, count: string, what: string) => `${amount}${per} gives ${count} ${what}`,\n  spokenToward: (amount: string, left: string, per = \"\") => `${amount}${per} goes toward a family’s filter. ${left} more ${per ? \"over the year \" : \"\"}completes one.`,\n  sliderLabel: { once: \"One-off gift, in pounds\", monthly: \"Monthly gift, in pounds\" } satisfies Record<Frequency, string>,\n  frequencyLabel: \"How often\",\n  presetsLabel: \"Amounts\",\n  other: \"Other amount\",\n  otherInvalid: (min: string) => `Enter whole pounds, ${min} or more.`,\n  otherTooMuch: (max: string) => `For gifts over ${max}, please talk to us first.`,\n  donate: (amount: string, per: string) => `Donate ${amount}${per}`,\n  /** The appeal line under the controls, before the families funded with the gift. */\n  withGift: \"With your gift\",\n  jarsLabel: \"Twenty jars, one for each family a gift gives a filter to\",\n  jarsCaption: \"One jar is one family’s filter for a year\",\n  play: \"Play the example\",\n  stop: \"Stop the example\",\n  replay: \"Play it again\",\n  playing: \"Playing an example gift\",\n};\n\n/** What a gift does: the chain from a donation to a filled glass, in four links. */\nexport const chain = {\n  label: \"What a gift does\",\n  title: \"From your gift to a full glass in four steps.\",\n  steps: [\n    { id: \"gift\", title: \"Your gift\", body: \"Counted the day you give. Monthly gifts arrive on the same date each month.\", detail: \"Counted the same day\" },\n    { id: \"filter\", title: \"A filter is bought\", body: \"In batches of fifty, from a maker near the villages, so parts are never a flight away.\", detail: \"Fifty at a time\" },\n    { id: \"fitted\", title: \"A technician fits it\", body: \"A local technician installs it in the home and shows the family how to clean it.\", detail: \"About 40 minutes a home\" },\n    { id: \"glass\", title: \"Safe water, all year\", body: \"We visit at three and nine months, swap the cartridge and test the water.\", detail: \"Visits at 3 and 9 months\" },\n  ],\n  note: \"The order is real; the timings in it are samples.\",\n};\n\n/**\n * Where the money goes, in pounds over the sample year. The page shows each as a whole\n * percentage that sums to 100 by largest remainder (giving.ts), so editing a line keeps it true.\n */\nexport const spend = {\n  label: \"Where the money goes\",\n  title: \"Most of every pound becomes a filter in a home.\",\n  body: \"Filters, the technicians who fit them and the visits that keep them working come first. Raising the next pound and running a small office take the rest.\",\n  year: \"Sample year to March\",\n  lines: [\n    { id: \"filters\", label: \"Filters, cartridges and parts\", amount: 182_400 },\n    { id: \"fitting\", label: \"Fitting and training, by local technicians\", amount: 61_250 },\n    { id: \"testing\", label: \"Water tests and follow-up visits\", amount: 23_900 },\n    { id: \"fundraising\", label: \"Raising the next pound\", amount: 14_300 },\n    { id: \"running\", label: \"Running the charity\", amount: 9_150 },\n  ],\n  total: \"Spent in the year\",\n  columns: [\"Spending\", \"Pounds\", \"Share\"],\n  /** The lines that reach a home, for the headline share. */\n  reach: [\"filters\", \"fitting\", \"testing\"],\n  reachLabel: \"reaches a home\",\n};\n\n/* ---------- Projects -------------------------------------------------------------------- */\n\nexport type Project = {\n  slug: string;\n  name: string;\n  /** An invented area: no real place is named. */\n  area: string;\n  kind: string;\n  summary: string;\n  /** Pounds raised and needed. */\n  raised: number;\n  target: number;\n  /** What the money buys, as counts. */\n  builds: readonly { count: number; label: string }[];\n  steps: readonly { label: string; done: boolean }[];\n  /** Where the pin sits on the drawn map, in its 1000 × 560 box. */\n  pin: { x: number; y: number };\n  story: string;\n};\n\nexport const projects: readonly Project[] = [\n  {\n    slug: \"hill-villages\",\n    name: \"Filters for the hill villages\",\n    area: \"North hills\",\n    kind: \"Household filters\",\n    summary: \"Seven villages above the river, each with a spring that runs brown after rain. A filter in every home, fitted by two technicians from the villages.\",\n    raised: 2520,\n    target: 3300,\n    builds: [\n      { count: 220, label: \"household filters\" },\n      { count: 2, label: \"technicians trained\" },\n    ],\n    steps: [\n      { label: \"Villages asked for filters\", done: true },\n      { label: \"Technicians trained\", done: true },\n      { label: \"First 160 filters fitted\", done: true },\n      { label: \"Last 60 filters fitted\", done: false },\n    ],\n    pin: { x: 300, y: 150 },\n    story: \"The villages chose their technicians themselves; both had fixed pumps for years before the training.\",\n  },\n  {\n    slug: \"river-schools\",\n    name: \"Six river schools\",\n    area: \"River bend\",\n    kind: \"School tanks and taps\",\n    summary: \"A rain tank, a filter and a row of taps at each of six primary schools, so a morning’s lessons don’t stop for the walk to the river.\",\n    raised: 8400,\n    target: 10800,\n    builds: [\n      { count: 6, label: \"school tanks\" },\n      { count: 24, label: \"taps\" },\n      { count: 6, label: \"water clubs\" },\n    ],\n    steps: [\n      { label: \"Schools and parents agreed sites\", done: true },\n      { label: \"Four tanks built\", done: true },\n      { label: \"Last two tanks built\", done: false },\n      { label: \"Water clubs running\", done: false },\n    ],\n    pin: { x: 520, y: 300 },\n    story: \"Each school runs a water club that checks the taps every Friday and keeps the log.\",\n  },\n  {\n    slug: \"lake-shore\",\n    name: \"Tap stands on the lake shore\",\n    area: \"Lake shore\",\n    kind: \"Tap stands\",\n    summary: \"Four tap stands fed from one filtered tank, each within a short walk of every house in the settlement.\",\n    raised: 5150,\n    target: 5200,\n    builds: [\n      { count: 4, label: \"tap stands\" },\n      { count: 1, label: \"filtered tank\" },\n    ],\n    steps: [\n      { label: \"Tank site agreed\", done: true },\n      { label: \"Tank and pipes laid\", done: true },\n      { label: \"Tap stands opened\", done: false },\n    ],\n    pin: { x: 790, y: 220 },\n    story: \"A committee of six keeps the taps and the small fund that pays for washers and parts.\",\n  },\n  {\n    slug: \"market-clinic\",\n    name: \"Water for the market clinic\",\n    area: \"Market town\",\n    kind: \"Clinic tank\",\n    summary: \"A raised tank, a filter and hand-wash stations for the clinic beside the market, which sees every family in the valley at least once a year.\",\n    raised: 1890,\n    target: 6400,\n    builds: [\n      { count: 1, label: \"raised tank\" },\n      { count: 5, label: \"hand-wash stations\" },\n    ],\n    steps: [\n      { label: \"Clinic staff asked for it\", done: true },\n      { label: \"Tank designed\", done: false },\n      { label: \"Tank and stations built\", done: false },\n    ],\n    pin: { x: 640, y: 430 },\n    story: \"The clinic’s nurses chose where each hand-wash station goes.\",\n  },\n  {\n    slug: \"south-plain\",\n    name: \"Wells back in use on the south plain\",\n    area: \"South plain\",\n    kind: \"Well repairs\",\n    summary: \"Nine hand-pump wells that stopped working for want of parts. New pumps, new seals and a parts kit left with each well’s keeper.\",\n    raised: 3960,\n    target: 4950,\n    builds: [\n      { count: 9, label: \"wells repaired\" },\n      { count: 9, label: \"parts kits\" },\n    ],\n    steps: [\n      { label: \"Wells surveyed\", done: true },\n      { label: \"Six wells repaired\", done: true },\n      { label: \"Last three repaired\", done: false },\n    ],\n    pin: { x: 230, y: 430 },\n    story: \"Every keeper has fixed their own pump at least once since the repair.\",\n  },\n];\n\n/** The project pages' values, for /projects/[slug]. */\nexport const projectSlugs = projects.map((p) => p.slug);\n\nexport const projectsBand = {\n  label: \"Projects\",\n  title: \"Five places, one map.\",\n  body: \"Every project starts with a community asking. These are the five we are funding now.\",\n  all: { label: \"All projects\", href: \"/projects\" },\n  mapLabel: \"A drawn map of the five project areas. The areas are invented for this template.\",\n  funded: (pct: string) => `${pct} funded`,\n  read: (name: string) => `More on ${name.charAt(0).toLowerCase()}${name.slice(1)}`,\n};\n\n/* ---------- Stories, ways, proof, close ------------------------------------------------- */\n\n/** Invented people, clearly samples: first names only, nothing that identifies anyone. */\nexport const stories = {\n  label: \"Stories\",\n  title: \"In their words.\",\n  body: \"The people who run the clubs, fit the filters and raise the money.\",\n  sample: \"Sample stories: the people and their words are invented for this template.\",\n  items: [\n    {\n      id: \"halima\",\n      quote: \"The filter club at our school started with four of us. Now every class sends someone on Fridays to check the taps.\",\n      name: \"Halima\",\n      role: \"Runs a school water club, River bend\",\n    },\n    {\n      id: \"joseph\",\n      quote: \"I fitted forty filters in my first month. People stop me at the market to ask about the cartridge, which I like.\",\n      name: \"Joseph\",\n      role: \"Technician, North hills\",\n    },\n    {\n      id: \"lucia\",\n      quote: \"I asked friends for a pound a mile. It came to eleven filters, and a very sore pair of legs.\",\n      name: \"Lucia\",\n      role: \"Fundraiser, cycled 165 miles\",\n    },\n  ],\n};\n\nexport const ways = {\n  label: \"Other ways to give\",\n  title: \"Not just a card number.\",\n  body: \"Time, a team, a workplace or a line in a will each go as far as a gift.\",\n  /**\n   * Each way, with a worked figure where one applies: the gift it describes, and the sentence\n   * the counted families go into (worked out from `giving.unit`, like every other figure).\n   */\n  items: [\n    {\n      id: \"monthly\",\n      title: \"Give monthly\",\n      body: \"Twelve gifts a year let us promise a technician a year of work.\",\n      href: \"/donate\",\n      cta: \"Set up a monthly gift\",\n      figure: { amount: 10, frequency: \"monthly\", matched: false, say: (n: string) => `£10 a month keeps ${n} in safe water every year` },\n    },\n    {\n      id: \"fundraise\",\n      title: \"Fundraise for us\",\n      body: \"A run, a bake, a long walk. We send a pack and cheer you on.\",\n      href: \"/get-involved\",\n      cta: \"Plan a fundraiser\",\n      figure: { amount: 300, frequency: \"once\", matched: false, say: (n: string) => `Twenty friends at £15 each fit filters for ${n}` },\n    },\n    {\n      id: \"workplace\",\n      title: \"Through your workplace\",\n      body: \"Match funding and giving from your pay, set up with your employer.\",\n      href: \"/get-involved\",\n      cta: \"Ask about workplace giving\",\n      figure: { amount: 20, frequency: \"monthly\", matched: true, say: (n: string) => `£20 a month from your pay, matched, reaches ${n} a year` },\n    },\n    {\n      id: \"will\",\n      title: \"A gift in your will\",\n      body: \"Any size, written by your own solicitor. We’re glad to talk it through.\",\n      href: \"/contact\",\n      cta: \"Talk to us\",\n      figure: null,\n    },\n  ] satisfies readonly { id: string; title: string; body: string; href: string; cta: string; figure: { amount: number; frequency: Frequency; matched: boolean; say: (n: string) => string } | null }[],\n  noFigure: \"A conversation first, with no obligation\",\n};\n\n/** Supporters: invented businesses, set as wordmarks in the template's type. */\nexport const proof = {\n  label: \"Supporters\",\n  title: \"Backed by neighbours.\",\n  body: \"Local firms that match their staff’s gifts, and the numbers so far.\",\n  marks: [\n    { name: \"Tidewright Engineering\", style: \"mono\" },\n    { name: \"Lowmoor Cycles\", style: \"heavy\" },\n    { name: \"Greyling Print\", style: \"light\" },\n    { name: \"Quillbeck Opticians\", style: \"caps\" },\n    { name: \"Haddow Joinery\", style: \"slab\" },\n  ] as const,\n  numbers: [\n    { value: 12480, label: \"Families with a filter\" },\n    { value: 51, label: \"Wells back in use\" },\n    { value: 86, label: \"Technicians trained\" },\n    { value: 3920, label: \"Monthly givers\" },\n  ] satisfies ProofNumber[],\n};\n\nexport const close = {\n  title: \"Fill the next jar.\",\n  body: \"Fifteen pounds keeps a family in safe water for a year.\",\n  action: { label: \"Donate\", href: \"/donate\" },\n};\n\n/* ---------- Pages ----------------------------------------------------------------------- */\n\nexport const donatePage = {\n  label: \"Donate\",\n  title: \"Your gift.\",\n  lead: \"Three short steps, then your payment provider takes over.\",\n  steps: { amount: \"Amount\", details: \"Your details\", relief: \"Tax relief\" },\n  restored: \"We kept the amount you chose.\",\n  fields: {\n    first: { label: \"First name\", required: \"Enter your first name.\" },\n    last: { label: \"Last name\", required: \"Enter your last name.\" },\n    email: { label: \"Email\", placeholder: \"you@email.example\", required: \"Enter your email so we can send a receipt.\", invalid: \"That doesn’t look like an email address.\" },\n    address: { label: \"Home address\", required: \"Tax relief needs your home address.\" },\n    postcode: { label: \"Postcode\", required: \"Tax relief needs your postcode.\" },\n  },\n  relief: {\n    label: \"[Tax-relief scheme]: add [25%] to my gift at no cost to me\",\n    description:\n      \"I am a [country] taxpayer and understand that if I pay less [income tax] in the year than the amount claimed on all my donations, I must pay the difference. Replace this with your scheme’s exact wording.\",\n    /** [Your scheme's rate]: what the scheme adds to each pound given. */\n    rate: 0.25,\n    adds: (extra: string) => `Adds ${extra} at no cost to you.`,\n  },\n  updates: { label: \"Email me now and then about what my gift did\", description: \"About four emails a year. Unsubscribe from any of them.\" },\n  summary: {\n    label: \"Your gift\",\n    per: { once: \"one-off\", monthly: \"a month\" } satisfies Record<Frequency, string>,\n    rows: { gift: \"Your gift\", gives: \"Gives a year of filters to\", relief: \"Tax relief adds\" },\n    gives: (count: string, what: string) => `Gives ${count} ${what}`,\n    toward: \"Goes toward a family’s filter\",\n    appeal: (name: string) => `Counts toward the ${name}`,\n  },\n  submit: \"Continue to payment\",\n  pending: \"Checking…\",\n  next: {\n    title: \"Ready for payment.\",\n    to: (gift: string, where: string) => `Your gift of ${gift} goes to ${where}.`,\n    body: \"This is where your payment provider’s page opens. The sample stops here: no card or bank details are asked for or stored.\",\n    back: \"Change my gift\",\n  },\n  /** A gift that came from a project's page goes to that project. */\n  project: {\n    label: \"Your gift goes to\",\n    instead: \"Give to the appeal instead\",\n  },\n  faq: [\n    { question: \"Is my payment secure?\", answer: \"Payment happens on your payment provider’s page, not on this site. [Name your provider here.]\" },\n    { question: \"Can I change or stop a monthly gift?\", answer: \"Any time, from the link in your receipt or by writing to hello@brimwell.example.\" },\n    { question: \"Where does my gift go?\", answer: \"To the current appeal. If it is full, to the project closest to finishing.\" },\n  ] satisfies FaqItem[],\n};\n\nexport const projectsPage = {\n  label: \"Projects\",\n  title: \"What we’re funding now.\",\n  lead: \"Five projects, each asked for by the people who will use it. Pick one and see what it buys.\",\n  raised: (raised: string, target: string) => `${raised} of ${target}`,\n  of: (target: string) => `raised of ${target}`,\n  builds: \"What it pays for\",\n  progress: \"Where it’s up to\",\n  done: \"Done\",\n  next: \"Next\",\n  give: (name: string) => `Give to ${name.toLowerCase()}`,\n  back: \"All projects\",\n  areaNote: \"The areas are invented for this template.\",\n};\n\nexport const impactPage = {\n  label: \"Impact\",\n  title: \"The year in numbers.\",\n  lead: \"Our sample annual report, short enough to read on the bus. Every figure on this page is a sample for the template.\",\n  year: \"Sample year to March\",\n  headline: { value: 12480, label: \"families with safe water at home\" },\n  /** The first number, worked out from `months`. */\n  fitted: \"filters fitted this year\",\n  fittedMeans: \"Each one is a household’s safe water for a year, cartridges and visits included.\",\n  numbers: [\n    { id: \"wells\", value: 14, label: \"wells repaired\", means: \"Hand pumps back in use, each left with a parts kit and a keeper.\" },\n    { id: \"schools\", value: 6, label: \"schools with taps\", means: \"A rain tank, a filter and a row of taps at each, kept by a pupils’ club.\" },\n    { id: \"working\", value: 96, label: \"of filters still working at nine months\", means: \"Checked in the home at the nine-month visit, cartridge swapped.\", percent: true },\n  ],\n  months: {\n    label: \"Filters fitted each month\",\n    /** April to March, in fitted filters. */\n    values: [140, 180, 210, 260, 230, 190, 240, 280, 300, 260, 250, 320],\n    names: [\"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\", \"Jan\", \"Feb\", \"Mar\"],\n  },\n  promise: {\n    title: \"What we promise\",\n    items: [\n      \"Every filter is visited at three and nine months.\",\n      \"Every project is asked for by the people who use it.\",\n      \"We publish what didn’t work, too: three filters in ten needed a second visit this year.\",\n    ],\n  },\n  accounts: { label: \"Full accounts\", body: \"[Link to your filed accounts and annual report.]\" },\n};\n\nexport const involvedPage = {\n  label: \"Get involved\",\n  title: \"Give time, not only money.\",\n  lead: \"Volunteer at an event, fundraise in your own way, or bring your workplace along. Tell us what you have in mind and we’ll reply within a week.\",\n  /**\n   * Each way in, with what it takes, what you get and when it next happens. `next` is a monthly\n   * rule (the nth weekday, 0 Sunday to 6 Saturday), worked out on the visitor's device from today.\n   */\n  options: [\n    {\n      id: \"volunteer\",\n      title: \"Volunteer\",\n      body: \"Help pack filter kits on our sorting days, or run a stall at a local event.\",\n      time: \"Three hours, once or every month\",\n      get: \"Lunch, a T-shirt and the kit you packed, counted\",\n      next: { nth: 1, weekday: 6, name: \"Sorting day\", rule: \"first Saturday of the month\" },\n    },\n    {\n      id: \"fundraise\",\n      title: \"Fundraise\",\n      body: \"Your challenge, your bake, your birthday. Join the group run if you want company.\",\n      time: \"As long as your challenge takes\",\n      get: \"A pack, a giving page and a running vest\",\n      next: { nth: 2, weekday: 0, name: \"Group run\", rule: \"second Sunday of the month\" },\n    },\n    {\n      id: \"workplace\",\n      title: \"Your workplace\",\n      body: \"Matched giving, a team challenge or a half-hour talk at lunch.\",\n      time: \"A half-hour talk to start\",\n      get: \"A matched-giving guide and a speaker\",\n      next: { nth: 1, weekday: 3, name: \"Lunch talk\", rule: \"first Wednesday of the month\" },\n    },\n  ],\n  labels: { time: \"Time\", get: \"You get\", next: \"Next\" },\n  form: {\n    label: \"Get involved\",\n    fields: [\n      { name: \"name\", label: \"Your name\", type: \"text\", required: \"Tell us your name.\", autoComplete: \"name\" },\n      { name: \"email\", label: \"Email\", type: \"email\", required: \"Enter your email so we can reply.\", invalid: \"That doesn’t look like an email address.\", autoComplete: \"email\" },\n      {\n        name: \"kind\",\n        label: \"I’d like to\",\n        type: \"select\",\n        options: [\"Volunteer at an event\", \"Fundraise for Brimwell\", \"Bring my workplace along\", \"Something else\"],\n        required: \"Choose one.\",\n      },\n      { name: \"message\", label: \"What do you have in mind?\", type: \"textarea\", rows: 4, required: \"Tell us a little.\", min: { length: 10, message: \"A few more words, please.\" }, className: \"sm:col-span-2\" },\n    ],\n    submit: \"Send\",\n    sent: { title: \"Thanks, we’ll be in touch.\", body: \"Expect a reply within a week.\", again: \"Send another\" },\n    failed: \"We couldn’t send that. Try again, or email hello@brimwell.example.\",\n  } satisfies ContactFormContent,\n};\n\n/** Invented people. */\nexport const aboutPage = {\n  label: \"About\",\n  title: \"A small charity with one job.\",\n  lead: \"Brimwell funds clean water close to home: filters in houses, taps at schools and wells that work again. We stay small on purpose, so most of what you give reaches a home.\",\n  story: {\n    title: \"How we work\",\n    body: [\n      \"We only fund what a community asks for, and we only buy parts that can be bought again nearby. Technicians come from the villages they work in.\",\n      \"We go back. Every filter is visited twice in its first year, and we publish what we find.\",\n    ],\n  },\n  people: {\n    title: \"The team\",\n    list: [\n      { name: \"Mercy Fairbairn\", role: \"Director\" },\n      { name: \"Siobhan Tomlin\", role: \"Projects\" },\n      { name: \"Tobiah Arkwright\", role: \"Finance\" },\n      { name: \"Femi Penhale\", role: \"Supporters\" },\n    ],\n    note: \"Invented people for the template.\",\n  },\n  governance: {\n    title: \"Governance\",\n    items: [brand.registered, \"[Registered office address]\", \"[Names of trustees]\", brand.regulator],\n  },\n};\n\nexport const contactPage = {\n  label: \"Contact\",\n  title: \"Talk to a person.\",\n  lead: \"Questions about a gift, a fundraiser or a receipt. We reply within two working days.\",\n  details: [\n    { label: \"Email\", value: \"hello@brimwell.example\", href: \"mailto:hello@brimwell.example\" },\n    { label: \"Phone\", value: \"020 7946 0752\", href: \"tel:+442079460752\" },\n    { label: \"Post\", value: \"Brimwell, 12 Sample Row, Exampleton, XX0 0XX\" },\n  ],\n  form: {\n    label: \"Contact\",\n    fields: [\n      { name: \"name\", label: \"Your name\", type: \"text\", required: \"Tell us your name.\", autoComplete: \"name\" },\n      { name: \"email\", label: \"Email\", type: \"email\", required: \"Enter your email so we can reply.\", invalid: \"That doesn’t look like an email address.\", autoComplete: \"email\" },\n      { name: \"topic\", label: \"About\", type: \"select\", options: [\"A gift I made\", \"A receipt\", \"A fundraiser\", \"Something else\"], required: \"Choose one.\" },\n      { name: \"message\", label: \"Message\", type: \"textarea\", rows: 5, required: \"Write a message.\", min: { length: 10, message: \"A few more words, please.\" }, className: \"sm:col-span-2\" },\n    ],\n    submit: \"Send message\",\n    sent: { title: \"Message sent.\", body: \"We’ll reply within two working days.\", again: \"Send another\" },\n    failed: \"We couldn’t send that. Try again, or email hello@brimwell.example.\",\n  } satisfies ContactFormContent,\n};\n\nexport const notFound = {\n  title: \"This page has run dry.\",\n  body: \"The link may be old, or the page has moved. These are the pages people look for.\",\n  linksLabel: \"Pages people look for\",\n  links: [\n    { label: \"Donate\", href: \"/donate\" },\n    { label: \"Projects\", href: \"/projects\" },\n    { label: \"Home\", href: \"/\" },\n  ],\n};\n\n/** The footer's own blocks beside the shared columns: where to write, and the newsletter. */\nexport const footerExtra = {\n  office: {\n    title: \"Registered office\",\n    lines: [\"Brimwell\", \"[Registered office address]\", brand.registered, \"[Company number, if incorporated]\"],\n  },\n  contact: {\n    title: \"Talk to us\",\n    lines: [\n      { label: \"hello@brimwell.example\", href: \"mailto:hello@brimwell.example\" },\n      { label: \"020 7946 0752\", href: \"tel:+442079460752\" },\n    ],\n    hours: \"Weekdays, 9am to 5pm\",\n  },\n  newsletter: {\n    title: \"Four letters a year about what your gifts did.\",\n    capture: {\n      label: \"Email address\",\n      placeholder: \"you@email.example\",\n      submit: \"Sign up\",\n      required: \"Enter your email to sign up.\",\n      invalid: \"That doesn’t look like an email address.\",\n      sent: \"Thanks. The next letter comes in the spring.\",\n      failed: \"We couldn’t sign you up. Try again in a moment.\",\n    } satisfies EmailCaptureContent,\n  },\n};\n\nexport const footer: FooterContent = {\n  columns: [\n    {\n      title: \"Give\",\n      links: [\n        { label: \"Donate\", href: \"/donate\" },\n        { label: \"Get involved\", href: \"/get-involved\" },\n      ],\n    },\n    {\n      title: \"Brimwell\",\n      links: [\n        { label: \"Projects\", href: \"/projects\" },\n        { label: \"Impact\", href: \"/impact\" },\n        { label: \"About\", href: \"/about\" },\n      ],\n    },\n    {\n      title: \"Help\",\n      links: [\n        { label: \"Contact\", href: \"/contact\" },\n        { label: \"Accounts\", href: \"/impact\" },\n        { label: \"Complaints\", href: \"/contact\" },\n      ],\n    },\n  ],\n  legal: {\n    line: `Brimwell. ${brand.registered}`,\n    label: \"Legal\",\n    links: [\n      { label: \"Privacy\", href: \"/privacy\" },\n      { label: \"Terms\", href: \"/terms\" },\n    ],\n  },\n};\n",
      "type": "registry:lib",
      "target": "@components/eased/templates/nonprofit/content.ts"
    },
    {
      "path": "src/registry/eased/templates/nonprofit/content-legal.ts",
      "content": "import type { LegalDoc } from \"../_shared/legal\";\n\n/**\n * Brimwell's privacy notice and terms. Sample text written for a UK charity: every bracketed\n * line is a placeholder for your own details, and none of it is legal advice.\n */\n\nexport const legalLabels = {\n  updated: \"Last updated\",\n  contents: \"On this page\",\n};\nexport const legalNote = \"Sample text for this template. Replace it with your own before you launch; it is not legal advice.\";\n\nexport const privacy: LegalDoc = {\n  title: \"Privacy\",\n  updated: \"2026-11-28\",\n  intro: \"What we keep when you give, fundraise or write to us, why we keep it, and how to have it changed or deleted.\",\n  sections: [\n    {\n      title: \"Who we are\",\n      body: [\"Brimwell, [registered office address], is the controller of your data. [Registered charity in England and Wales, no. 0000000.] Write to privacy@brimwell.example.\"],\n    },\n    {\n      title: \"What we keep\",\n      body: [\n        \"Only what giving and replying need:\",\n        {\n          list: [\n            \"Your name and email, for your receipt and any updates you asked for\",\n            \"Your gift: the amount, how often and the date\",\n            \"Your home address, only if you ticked the tax-relief box, because the scheme requires it\",\n            \"Your message, if you wrote to us\",\n          ],\n        },\n        \"Card and bank details go to [your payment provider] and never reach us.\",\n      ],\n    },\n    {\n      title: \"Why we keep it\",\n      body: [\n        \"To take and acknowledge your gift, to claim tax relief you asked for under [the scheme], to send the updates you chose, and to answer you. [State your lawful bases here.]\",\n      ],\n    },\n    {\n      title: \"How long\",\n      body: [\"Gift records for [the period your tax authority requires]. Messages for a year. Updates until you unsubscribe.\"],\n    },\n    {\n      title: \"Your rights\",\n      body: [\n        \"You can ask to see, correct or delete what we hold, or to stop updates, at any time. Write to privacy@brimwell.example. You can also complain to [your data protection authority].\",\n      ],\n    },\n  ],\n};\n\nexport const terms: LegalDoc = {\n  title: \"Terms\",\n  updated: \"2026-11-28\",\n  intro: \"The terms for giving to Brimwell through this site.\",\n  sections: [\n    {\n      title: \"Your gift\",\n      body: [\n        \"Gifts go to the current appeal. If an appeal is full or closes, your gift goes to the project closest to finishing. [Describe your restricted and unrestricted funds policy.]\",\n      ],\n    },\n    {\n      title: \"Monthly gifts\",\n      body: [\"Monthly gifts are taken on the same day each month until you stop them. Stop or change one any time from your receipt or by writing to hello@brimwell.example.\"],\n    },\n    {\n      title: \"Refunds\",\n      body: [\"If you gave by mistake, write within [30] days and we will refund the gift in full.\"],\n    },\n    {\n      title: \"Figures on this site\",\n      body: [\"The figures on this site are samples for this template. [Replace this section with where your published figures come from.]\"],\n    },\n    {\n      title: \"Contact\",\n      body: [\"Brimwell, [registered office address]. hello@brimwell.example.\"],\n    },\n  ],\n};\n",
      "type": "registry:lib",
      "target": "@components/eased/templates/nonprofit/content-legal.ts"
    },
    {
      "path": "src/registry/eased/templates/nonprofit/giving.ts",
      "content": "/**\n * The arithmetic behind every number the template shows: what a gift pays for, how full each\n * jar in the hero is, what the appeal reads after your gift, how many days it has left and the\n * spending split. Plain functions of the content, with no imports, so the tests run them as\n * they are (scripts/nonprofit-giving.test.mjs) and editing a unit cost or an amount in\n * content.ts keeps every sentence true.\n */\n\nexport type Frequency = \"once\" | \"monthly\";\n\n/** What one unit of help costs and what it is called: a household filter for a year, £15. */\nexport type Unit = { cost: number; one: string; many: string };\n\n/** A frequency's amounts: the slider's range and step, where it rests, and the presets. */\nexport type Range = { min: number; max: number; step: number; rest: number; presets: readonly number[] };\n\n/** The sum a gift comes to in a year: a monthly gift twelve times over. */\nexport const yearly = (amount: number, frequency: Frequency) => (frequency === \"monthly\" ? amount * 12 : amount);\n\n/** Whole units a gift pays for in a year. Amounts are whole pounds, so this never rounds a float. */\nexport const unitsFor = (amount: number, frequency: Frequency, unit: Unit) => Math.floor(yearly(amount, frequency) / unit.cost);\n\n/** What is left over toward the next unit, in pounds. */\nexport const remainderFor = (amount: number, frequency: Frequency, unit: Unit) => yearly(amount, frequency) % unit.cost;\n\n/** \"1 family\", \"3 families\". */\nexport const countOf = (n: number, unit: Unit) => `${n.toLocaleString(\"en-GB\")} ${n === 1 ? unit.one : unit.many}`;\n\n/** The unit's noun alone, singular at exactly one. */\nexport const nounOf = (n: number, unit: Unit) => (n === 1 ? unit.one : unit.many);\n\n/** An amount pulled into a frequency's slider range and onto its step. */\nexport function onRange(amount: number, range: Range) {\n  const stepped = range.min + Math.round((amount - range.min) / range.step) * range.step;\n  return Math.min(range.max, Math.max(range.min, stepped));\n}\n\n/** A typed amount as whole pounds, or null when it is not one: \"45\", \"£45\", \"1,000\" and \"45.00\" read; \"45.5\" and \"\" do not. */\nexport function parseAmount(text: string) {\n  const clean = text.replace(/[£,\\s]/g, \"\").replace(/\\.0+$/, \"\");\n  if (!/^\\d{1,6}$/.test(clean)) return null;\n  const n = Number(clean);\n  return n > 0 ? n : null;\n}\n\n/**\n * How full each of the hero's jars is, 0 to 1, one jar per unit: whole jars for the units the\n * gift pays for, one part-filled by the remainder, the rest empty. Past the last jar the gift\n * still counts; the hero says how many more in words.\n */\nexport function jarFills(amount: number, frequency: Frequency, unit: Unit, jars: number) {\n  const filled = yearly(amount, frequency) / unit.cost;\n  return Array.from({ length: jars }, (_, i) => Math.min(1, Math.max(0, filled - i)));\n}\n\n/** The appeal in units: funded so far, and with your gift added to the pot. */\nexport function appealAfter(raised: number, gift: number, unit: Unit, target: number) {\n  return {\n    before: Math.min(target, Math.floor(raised / unit.cost)),\n    after: Math.min(target, Math.floor((raised + gift) / unit.cost)),\n  };\n}\n\nconst DAY = 86_400_000;\n\n/** Today's date in a time zone, as a UTC midnight timestamp, so days can be counted without DST. */\nfunction todayIn(timeZone: string, now: Date) {\n  const parts = new Intl.DateTimeFormat(\"en-CA\", { timeZone, year: \"numeric\", month: \"2-digit\", day: \"2-digit\" }).formatToParts(now);\n  const get = (type: string) => Number(parts.find((p) => p.type === type)?.value);\n  return Date.UTC(get(\"year\"), get(\"month\") - 1, get(\"day\"));\n}\n\nconst iso = (t: number) => new Date(t).toISOString().slice(0, 10);\n\n/**\n * Whole calendar days from today to the closing day, both in the appeal's own time zone, so a\n * reader in another zone and a DST change see the same count. 0 is the last day; below 0 the\n * appeal has closed.\n */\nexport function daysLeft(closes: string, timeZone: string, now: Date) {\n  const [y, m, d] = closes.split(\"-\").map(Number);\n  return Math.round((Date.UTC(y, m - 1, d) - todayIn(timeZone, now)) / DAY);\n}\n\n/**\n * The appeal's closing day as `YYYY-MM-DD`. With `rolling` set (the sample's demo mode) it is\n * always that many days after today, so a preview never reaches its closed state by itself;\n * without it, the fixed `closes` date.\n */\nexport function closingDay(closes: string, rolling: number | null, timeZone: string, now: Date) {\n  return rolling === null ? closes : iso(todayIn(timeZone, now) + rolling * DAY);\n}\n\n/**\n * The next date a monthly rule falls on, today included: the `nth` (1-4) `weekday` (0 Sunday to\n * 6 Saturday) of the month, in the time zone, as `YYYY-MM-DD`.\n */\nexport function nextMonthly(nth: number, weekday: number, timeZone: string, now: Date) {\n  const today = todayIn(timeZone, now);\n  const at = (year: number, month: number) => {\n    const first = new Date(Date.UTC(year, month, 1)).getUTCDay();\n    return Date.UTC(year, month, 1 + ((weekday - first + 7) % 7) + (nth - 1) * 7);\n  };\n  const d = new Date(today);\n  const thisMonth = at(d.getUTCFullYear(), d.getUTCMonth());\n  return iso(thisMonth >= today ? thisMonth : at(d.getUTCFullYear(), d.getUTCMonth() + 1));\n}\n\n/** The sum the hero shows: the yearly amount, the whole units it pays for and what is left over. */\nexport function sumOf(amount: number, frequency: Frequency, unit: Unit) {\n  return { yearly: yearly(amount, frequency), units: unitsFor(amount, frequency, unit), rest: remainderFor(amount, frequency, unit) };\n}\n\n/**\n * Whole percentages that always sum to `total`: each share floored, then the points left over\n * go to the largest remainders (ties to the earlier entry).\n */\nexport function largestRemainder(values: readonly number[], total = 100) {\n  const sum = values.reduce((a, b) => a + b, 0);\n  if (sum <= 0) return values.map(() => 0);\n  const exact = values.map((v) => (v / sum) * total);\n  const floors = exact.map(Math.floor);\n  let left = total - floors.reduce((a, b) => a + b, 0);\n  const order = exact.map((e, i) => ({ i, r: e - Math.floor(e) })).sort((a, b) => b.r - a.r || a.i - b.i);\n  for (const { i } of order) {\n    if (left <= 0) break;\n    floors[i] += 1;\n    left -= 1;\n  }\n  return floors;\n}\n",
      "type": "registry:lib",
      "target": "@components/eased/templates/nonprofit/giving.ts"
    },
    {
      "path": "src/registry/eased/templates/nonprofit/gift.tsx",
      "content": "\"use client\";\n\nimport { useCallback, useEffect, useState, useSyncExternalStore } from \"react\";\nimport { appeal, giving, projectSlugs } from \"./content\";\nimport { closingDay, daysLeft, onRange, type Frequency } from \"./giving\";\n\n/**\n * The gift a visitor has chosen, how often, and the amount for each frequency, kept in\n * sessionStorage so it follows them from the home page to the donate page and survives a\n * reload. Only a person's own choices are saved; the hero's example never is. Beside it, the\n * gift the hero is showing right now (the example included), which the header's appeal bar\n * reads; and the appeal's days left, worked out on the client so a prerendered page is never\n * stale.\n */\n\n/** A gift: how often, the amount for each frequency, and the project it goes to (null: the appeal). */\nexport type Gift = { frequency: Frequency; once: number; monthly: number; project: string | null };\n\nexport const REST: Gift = { frequency: \"once\", once: giving.once.rest, monthly: giving.monthly.rest, project: null };\n\n/** The amount for the gift's own frequency. */\nexport const amountOf = (g: Gift) => (g.frequency === \"monthly\" ? g.monthly : g.once);\n\nconst KEY = \"brimwell-gift\";\nconst HIDE = \"nf-restore\";\n\n/**\n * Runs as the page parses, before React: with a saved gift, it hides what will change\n * (`data-nf-restore`) until the saved gift is on screen, so a reload never flashes the sample\n * amount. A style in <head>, not an attribute, so hydration compares nothing it changed.\n */\nexport const RESTORE_SCRIPT = `try{if(sessionStorage.getItem(\"${KEY}\")){var t=document.createElement(\"style\");t.id=\"${HIDE}\";t.textContent=\"[data-nf-restore]{visibility:hidden}\";document.head.appendChild(t)}}catch(e){}`;\n\ntype Saved = { gift: Gift; chosen: boolean };\nconst EMPTY: Saved = { gift: REST, chosen: false };\nlet memory = EMPTY;\nlet raw: string | null | undefined;\nconst listeners = new Set<() => void>();\n\n/** A saved number, or the frequency's resting amount when it is missing or out of bounds. */\nconst saneAmount = (n: unknown, fallback: number) => (Number.isInteger(n) && (n as number) >= giving.typed.min && (n as number) <= giving.typed.max ? (n as number) : fallback);\n\n/** The saved gift, read once per change; storage can throw (private mode, blocked site data), so memory stands in. */\nfunction read(): Saved {\n  let next: string | null = null;\n  try {\n    next = window.sessionStorage.getItem(KEY);\n  } catch {\n    return memory;\n  }\n  if (next === raw) return memory;\n  raw = next;\n  try {\n    const parsed = next ? (JSON.parse(next) as Partial<Gift>) : null;\n    memory = parsed\n      ? {\n          chosen: true,\n          gift: {\n            frequency: parsed.frequency === \"monthly\" ? \"monthly\" : \"once\",\n            once: saneAmount(parsed.once, REST.once),\n            monthly: saneAmount(parsed.monthly, REST.monthly),\n            project: typeof parsed.project === \"string\" && projectSlugs.includes(parsed.project) ? parsed.project : null,\n          },\n        }\n      : EMPTY;\n  } catch {\n    memory = EMPTY;\n  }\n  return memory;\n}\n\nconst emit = () => listeners.forEach((l) => l());\n\nfunction write(gift: Gift) {\n  memory = { gift, chosen: true };\n  try {\n    raw = JSON.stringify(gift);\n    window.sessionStorage.setItem(KEY, raw);\n  } catch {\n    // Memory still holds it for this page.\n  }\n  emit();\n}\n\nconst subscribe = (l: () => void) => {\n  listeners.add(l);\n  return () => listeners.delete(l);\n};\n\n/** False for the first frame after hydration, while a saved gift is filled in; true after, on every page. */\nlet liveNow = false;\nconst subscribeLive = (l: () => void) => {\n  listeners.add(l);\n  if (!liveNow) {\n    requestAnimationFrame(() => {\n      if (liveNow) return;\n      liveNow = true;\n      document.getElementById(HIDE)?.remove();\n      emit();\n    });\n  }\n  return () => listeners.delete(l);\n};\n\n/**\n * The visitor's gift. `choose` saves a change they made; `chosen` is whether they have made one\n * this session. `live` is false while the saved gift is being restored: anything that would\n * animate the change (a roll, a fill) shows it at once.\n */\nexport function useGift() {\n  const saved = useSyncExternalStore(subscribe, read, () => EMPTY);\n  const live = useSyncExternalStore(subscribeLive, () => liveNow, () => false);\n  const choose = useCallback((patch: Partial<Gift>) => {\n    const next = { ...read().gift, ...patch };\n    write({ ...next, once: Math.round(next.once), monthly: Math.round(next.monthly) });\n  }, []);\n  return { gift: saved.gift, chosen: saved.chosen, live, choose };\n}\n\n/* ---------- What the hero shows --------------------------------------------------------- */\n\nlet shown: Gift | null = null;\nconst shownListeners = new Set<() => void>();\nconst subscribeShown = (l: () => void) => {\n  shownListeners.add(l);\n  return () => shownListeners.delete(l);\n};\n\n/** The hero reports the gift it shows (its example included); null when there is no hero on the page. */\nexport function setShownGift(g: Gift | null) {\n  if (g === shown || (g && shown && g.frequency === shown.frequency && g.once === shown.once && g.monthly === shown.monthly)) return;\n  shown = g;\n  shownListeners.forEach((l) => l());\n}\n\n/** The gift the appeal bar adds: the hero's, while there is one; else the saved one, once chosen; else none. */\nexport function useAddedGift() {\n  const { gift, chosen } = useGift();\n  const onHero = useSyncExternalStore(subscribeShown, () => shown, () => null);\n  return onHero ?? (chosen ? gift : null);\n}\n\n/** An amount on a frequency's slider: in its range and on its step. */\nexport const stepped = (amount: number, frequency: Frequency) => onRange(amount, frequency === \"monthly\" ? giving.monthly : giving.once);\n\n/* ---------- The appeal's clock ---------------------------------------------------------- */\n\n/** Longest wait between re-checks: a laptop that slept or a tab left open past midnight is right within five minutes. */\nconst RECHECK = 5 * 60 * 1000;\n\n/** The closing day as of `now`: rolling in demo mode, else the fixed date (giving.ts). */\nexport const closesOn = (now: Date) => closingDay(appeal.closes, appeal.rolling, appeal.timeZone, now);\n\n/**\n * Days left in the appeal: null on the server and during hydration (the page shows the closing\n * date instead, or no date in demo mode), then today's count, re-checked every few minutes and\n * whenever the tab comes back.\n */\nexport function useDaysLeft() {\n  const [days, setDays] = useState<number | null>(null);\n  useEffect(() => {\n    const check = () => {\n      const now = new Date();\n      setDays(daysLeft(closesOn(now), appeal.timeZone, now));\n    };\n    check();\n    const timer = window.setInterval(check, RECHECK);\n    const onVisible = () => document.visibilityState === \"visible\" && check();\n    document.addEventListener(\"visibilitychange\", onVisible);\n    window.addEventListener(\"focus\", check);\n    return () => {\n      window.clearInterval(timer);\n      document.removeEventListener(\"visibilitychange\", onVisible);\n      window.removeEventListener(\"focus\", check);\n    };\n  }, []);\n  return days;\n}\n\n/** Now, on the client only: null on the server and during hydration, then re-read every few minutes and when the tab comes back. */\nexport function useNow() {\n  const [now, setNow] = useState<Date | null>(null);\n  useEffect(() => {\n    const check = () => setNow(new Date());\n    check();\n    const timer = window.setInterval(check, RECHECK);\n    const onVisible = () => document.visibilityState === \"visible\" && check();\n    document.addEventListener(\"visibilitychange\", onVisible);\n    return () => {\n      window.clearInterval(timer);\n      document.removeEventListener(\"visibilitychange\", onVisible);\n    };\n  }, []);\n  return now;\n}\n\n/** A `YYYY-MM-DD` day as the page prints it, \"28 February 2027\". */\nexport const printDay = (day: string, month: \"long\" | \"short\" = \"long\") =>\n  new Intl.DateTimeFormat(\"en-GB\", { weekday: month === \"short\" ? \"short\" : undefined, day: \"numeric\", month, year: month === \"long\" ? \"numeric\" : undefined, timeZone: \"UTC\" }).format(new Date(`${day}T00:00:00Z`));\n",
      "type": "registry:component",
      "target": "@components/eased/templates/nonprofit/gift.tsx"
    },
    {
      "path": "src/registry/eased/templates/nonprofit/kit.tsx",
      "content": "\"use client\";\n\nimport { motion } from \"motion/react\";\nimport { useId, type ReactNode } from \"react\";\nimport { enter, reducedFade, stagger, useSafeReducedMotion } from \"../../lib/motion\";\nimport { BaseProvider } from \"../_shared/base\";\nimport { brand } from \"./content\";\nimport { RESTORE_SCRIPT } from \"./gift\";\n\n/**\n * The pieces every section of the nonprofit shares: the token set and the page root, the\n * column, the label and heading styles, the entrances, the mark and the page opening.\n */\n\n/* ---------- Tokens -------------------------------------------------------------------- */\n\nconst LIGHT = `\n  --eased-bg: oklch(98.2% 0.012 90);\n  --eased-surface: oklch(100% 0 0);\n  --eased-surface-raised: oklch(100% 0 0);\n  --eased-surface-sunken: oklch(95.6% 0.014 88);\n  --eased-surface-hover: oklch(94.4% 0.016 88);\n  --eased-surface-active: oklch(91.8% 0.02 88);\n  --eased-line-subtle: oklch(90.6% 0.014 88);\n  --eased-line: oklch(85.5% 0.018 85);\n  --eased-line-strong: oklch(70% 0.024 80);\n  --eased-text: oklch(22% 0.05 258);\n  --eased-text-secondary: oklch(37% 0.045 258);\n  --eased-text-muted: oklch(47% 0.04 258);\n  --eased-brand: oklch(86% 0.165 92);\n  --eased-brand-hover: oklch(82.5% 0.17 89);\n  --eased-brand-active: oklch(79% 0.17 86);\n  --eased-brand-subtle: oklch(49% 0.19 256 / 0.1);\n  --eased-brand-line: oklch(49% 0.19 256 / 0.45);\n  --eased-brand-text: oklch(46% 0.19 257);\n  --eased-text-on-brand: oklch(22% 0.05 258);\n  --eased-danger: oklch(52% 0.2 25);\n  --eased-danger-text: oklch(47% 0.19 25);\n  --eased-danger-subtle: oklch(52% 0.2 25 / 0.1);\n  --eased-success-text: oklch(44% 0.12 160);\n  --eased-success-subtle: oklch(62% 0.14 160 / 0.14);\n  --eased-ring: oklch(49% 0.19 256 / 0.6);\n  --eased-ring-soft: oklch(49% 0.19 256 / 0.18);\n  --eased-shadow-tint: 25% 0.06 258;\n  --nf-sea: oklch(49% 0.19 256);\n  --nf-sea-deep: oklch(41% 0.16 258);\n  --nf-sun: oklch(86% 0.165 92);\n  --nf-jar: oklch(98.5% 0.01 90);\n  --nf-water: oklch(60% 0.17 240);\n  --nf-ink: oklch(22% 0.05 258);\n`;\n\nconst DARK = `\n  --eased-bg: oklch(17.5% 0.035 258);\n  --eased-surface: oklch(21% 0.04 258);\n  --eased-surface-raised: oklch(24% 0.042 258);\n  --eased-surface-sunken: oklch(14.5% 0.03 258);\n  --eased-surface-hover: oklch(26% 0.044 258);\n  --eased-surface-active: oklch(30% 0.046 258);\n  --eased-line-subtle: oklch(27% 0.04 258);\n  --eased-line: oklch(33% 0.042 258);\n  --eased-line-strong: oklch(45% 0.045 258);\n  --eased-text: oklch(96.5% 0.012 90);\n  --eased-text-secondary: oklch(83% 0.025 250);\n  --eased-text-muted: oklch(72% 0.03 250);\n  --eased-brand: oklch(85% 0.155 92);\n  --eased-brand-hover: oklch(88% 0.14 94);\n  --eased-brand-active: oklch(80% 0.155 88);\n  --eased-brand-subtle: oklch(72% 0.13 248 / 0.16);\n  --eased-brand-line: oklch(77% 0.12 245 / 0.5);\n  --eased-brand-text: oklch(78% 0.12 245);\n  --eased-text-on-brand: oklch(20% 0.05 258);\n  --eased-danger: oklch(66% 0.18 25);\n  --eased-danger-text: oklch(76% 0.13 25);\n  --eased-danger-subtle: oklch(66% 0.18 25 / 0.16);\n  --eased-success-text: oklch(80% 0.12 160);\n  --eased-success-subtle: oklch(72% 0.14 160 / 0.16);\n  --eased-ring: oklch(78% 0.12 245 / 0.65);\n  --eased-ring-soft: oklch(78% 0.12 245 / 0.2);\n  --eased-shadow-tint: 4% 0.03 258;\n  --nf-sea: oklch(40% 0.155 257);\n  --nf-sea-deep: oklch(31% 0.12 258);\n  --nf-sun: oklch(84% 0.155 90);\n  --nf-jar: oklch(93% 0.018 90);\n  --nf-water: oklch(66% 0.15 236);\n  --nf-ink: oklch(20% 0.05 258);\n`;\n\n/**\n * The sea: the saturated blue the big surfaces are made of (the hero's panel, the projects\n * band, the phone menu). Paper type on it at 4.5:1 or better in both themes; controls are glass\n * over it; the brand stays the sun, so the one filled action still reads.\n */\nconst SEA = `\n  --eased-bg: var(--nf-sea);\n  --eased-surface: oklch(100% 0 0 / 0.12);\n  --eased-surface-raised: oklch(100% 0 0 / 0.18);\n  --eased-surface-sunken: oklch(0% 0 0 / 0.14);\n  --eased-surface-hover: oklch(100% 0 0 / 0.18);\n  --eased-surface-active: oklch(100% 0 0 / 0.26);\n  --eased-line-subtle: oklch(100% 0 0 / 0.18);\n  --eased-line: oklch(100% 0 0 / 0.3);\n  --eased-line-strong: oklch(100% 0 0 / 0.5);\n  --eased-text: oklch(98.5% 0.01 90);\n  --eased-text-secondary: oklch(94% 0.025 250);\n  --eased-text-muted: oklch(90% 0.035 250);\n  --eased-brand-text: oklch(98.5% 0.01 90);\n  --eased-brand-line: oklch(100% 0 0 / 0.55);\n  --eased-brand-subtle: oklch(100% 0 0 / 0.14);\n  --eased-ring: oklch(100% 0 0 / 0.8);\n  --eased-ring-soft: oklch(100% 0 0 / 0.22);\n`;\n\n/** The sun: the close's band. Ink type on it; its one action is ink with paper type. */\nconst SUN = `\n  --eased-bg: var(--nf-sun);\n  --eased-text: oklch(20% 0.05 258);\n  --eased-text-secondary: oklch(26% 0.05 258);\n  --eased-text-muted: oklch(30% 0.05 258);\n  --eased-line-subtle: oklch(20% 0.05 258 / 0.16);\n  --eased-line: oklch(20% 0.05 258 / 0.26);\n  --eased-brand: oklch(20% 0.05 258);\n  --eased-brand-hover: oklch(27% 0.06 258);\n  --eased-brand-active: oklch(32% 0.07 258);\n  --eased-text-on-brand: oklch(98% 0.012 90);\n  --eased-ring: oklch(20% 0.05 258 / 0.75);\n  --eased-ring-soft: oklch(20% 0.05 258 / 0.2);\n`;\n\n/**\n * Brimwell's tokens, on its root in both themes, with the sea and the sun restated on\n * `[data-nf-sea]` and `[data-nf-sun]`, and `[data-nf-paper]` putting the page's own back for a\n * card that sits on one of them. `.nf-rise` is the first screen's entrance: CSS, so it\n * plays before hydration and never plays at all under reduced motion.\n */\nconst THEME = `\n[data-brimwell] {${LIGHT}\n  --eased-radius-panel: 16px;\n  --eased-radius-surface: 28px;\n  --eased-radius-control: 12px;\n  --eased-radius-control-sm: 10px;\n  --eased-radius-control-xs: 7px;\n  --nf-bar: 4px;\n  --nf-header: calc(4rem + var(--nf-bar));\n}\n[data-theme=\"dark\"] [data-brimwell] {${DARK}}\n[data-brimwell] [data-nf-sea] {${SEA}}\n[data-brimwell] [data-nf-sun] {${SUN}}\n[data-brimwell] [data-nf-paper] {${LIGHT}}\n[data-theme=\"dark\"] [data-brimwell] [data-nf-paper] {${DARK}}\n@keyframes nf-rise { from { opacity: 0; transform: translateY(10px); } }\n.nf-rise { animation: nf-rise 0.5s var(--eased-ease-enter) both; animation-delay: calc(var(--i, 0) * ${stagger.line}s); }\n@media (prefers-reduced-motion: reduce) { .nf-rise { animation: none; } }\n`;\n\n/** The page root: the token set, the canvas and type, and the mount for links and overlays. */\nexport function Root({ base, children }: { base: string; children: ReactNode }) {\n  return (\n    <div data-brimwell=\"\" className=\"flex min-h-dvh flex-col bg-bg font-sans text-ui text-text\">\n      <style href=\"eased-brimwell-theme\" precedence=\"default\">\n        {THEME}\n      </style>\n      <script dangerouslySetInnerHTML={{ __html: RESTORE_SCRIPT }} />\n      <BaseProvider base={base}>{children}</BaseProvider>\n    </div>\n  );\n}\n\n/* ---------- Layout -------------------------------------------------------------------- */\n\n/** The page column: the full 1440px canvas less a 16px gutter (24px from sm, 40px from xl). */\nexport const COLUMN = \"mx-auto w-full max-w-[90rem] px-4 sm:px-6 xl:px-10\";\n\n/** Small labels over sections: the sans at 500 in caps, 12px (rule 48). */\nexport const LABEL = \"text-ui-xs font-medium uppercase tracking-caps text-text-muted\";\n\n/** Section headings: the sans at 600, tight. */\nexport const TITLE = \"font-display text-display-4xl font-semibold tracking-display text-balance text-text sm:text-display-5xl\";\n\n/** The quiet line under sample figures. */\nexport const NOTE = \"text-ui-sm text-text-muted\";\n\n/** A section's vertical rhythm. */\nexport const SECTION = \"py-section-sm sm:py-section\";\n\n/** On a template-core form: its fields, select and button at 44px on phones. */\nexport const FORM_TARGETS = \"max-sm:[&_input]:min-h-11 max-sm:[&_button]:min-h-11\";\n\n/** Plain link, in the sea, underlined. */\nexport const LINK = \"focus-ring rounded-control-xs font-medium text-brand-text underline decoration-brand-line underline-offset-4 transition-colors duration-(--eased-duration-fast) ease-standard hover-fine:decoration-current\";\n\n/**\n * Rises 10px and fades in the first time it scrolls into view, `index` lines after the first\n * (rule 89). Reduced motion only changes the start and the timing, and remounts so it never\n * keeps a start pose read before the setting was known. Below the first screen only: the first\n * screen rises with `.nf-rise`, which needs no script.\n */\nexport function Reveal({ index = 0, className = \"\", children }: { index?: number; className?: string; children: ReactNode }) {\n  const reduced = useSafeReducedMotion();\n  return (\n    <motion.div\n      key={reduced ? \"reduced\" : \"full\"}\n      className={className}\n      initial={reduced ? { opacity: 0 } : { opacity: 0, y: 10 }}\n      whileInView={{ opacity: 1, y: 0 }}\n      viewport={{ once: true, amount: 0.15 }}\n      transition={reduced ? reducedFade : { ...enter, duration: 0.45, delay: index * stagger.line }}\n    >\n      {children}\n    </motion.div>\n  );\n}\n\n/** A page's opening, past the home page: the label, the h1 and a lead, rising in as the first screen does. */\nexport function PageHead({ label, title, lead, children }: { label: string; title: ReactNode; lead?: ReactNode; children?: ReactNode }) {\n  return (\n    <div className=\"flex flex-col gap-pad-base\">\n      <p className={`nf-rise ${LABEL}`}>{label}</p>\n      <h1 className=\"nf-rise max-w-4xl font-display text-[clamp(2.75rem,7vw,5.5rem)] leading-[1] font-semibold tracking-[-0.04em] text-balance text-text [--i:1]\">\n        {title}\n      </h1>\n      {lead && <p className=\"nf-rise max-w-2xl text-ui-md text-pretty text-text-secondary [--i:2] sm:text-ui-lg\">{lead}</p>}\n      {children}\n    </div>\n  );\n}\n\n/* ---------- Mark ---------------------------------------------------------------------- */\n\n/** Brimwell's mark: a drop filled to the brim, the water line a third of the way down. */\nexport function Mark({ className = \"size-6\" }: { className?: string }) {\n  const id = useId();\n  return (\n    <svg viewBox=\"0 0 24 24\" className={`shrink-0 ${className}`} aria-hidden>\n      <defs>\n        <clipPath id={`${id}-water`}>\n          <rect x=\"0\" y=\"10\" width=\"24\" height=\"14\" />\n        </clipPath>\n      </defs>\n      <path d=\"M12 2.5C12 2.5 4.5 10.6 4.5 15a7.5 7.5 0 0 0 15 0c0-4.4-7.5-12.5-7.5-12.5Z\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinejoin=\"round\" />\n      <path d=\"M12 2.5C12 2.5 4.5 10.6 4.5 15a7.5 7.5 0 0 0 15 0c0-4.4-7.5-12.5-7.5-12.5Z\" fill=\"currentColor\" clipPath={`url(#${id}-water)`} />\n    </svg>\n  );\n}\n\n/** The mark and the name, the home link's content. */\nexport function Wordmark({ className = \"\", markClassName = \"size-6 text-brand-text\" }: { className?: string; markClassName?: string }) {\n  return (\n    <span className={`inline-flex items-center gap-1.5 ${className}`}>\n      <Mark className={markClassName} />\n      <span className=\"text-ui-lg font-semibold tracking-[-0.03em]\">{brand.name}</span>\n    </span>\n  );\n}\n",
      "type": "registry:component",
      "target": "@components/eased/templates/nonprofit/kit.tsx"
    },
    {
      "path": "src/registry/eased/templates/nonprofit/art.tsx",
      "content": "\"use client\";\n\nimport { motion } from \"motion/react\";\nimport { useId } from \"react\";\nimport { bouncy, exitFast, instant, reducedFade, smooth, useSafeReducedMotion } from \"../../lib/motion\";\n\n/**\n * Brimwell's drawings, all in code: bold flat shapes in the sea, the sun and paper, no outlines\n * thinner than the type's stems. The jar is the template's unit (one family's filter for a\n * year); the stations draw the chain from a gift to a glass; the map draws the five invented\n * project areas. Everything here is decoration and hidden from screen readers; the words beside\n * each drawing say what it shows.\n */\n\n/** A jar's body in its 60 × 80 box: the vessel the water fills. */\nconst BODY = \"M10 22c0-5 3-8 8-8h24c5 0 8 3 8 8v46c0 6-4 10-10 10H20c-6 0-10-4-10-10Z\";\n/** The water's top edge, one long shallow wave, so moving it up never shows a flat cut. */\nconst WATER = \"M0 4c10-4 20 4 30 0s20-4 30 0 20 4 30 0v120H0Z\";\n\n/**\n * One jar. `fill` is 0 to 1; the water rides up on the smooth spring, or jumps there when\n * `instant` (a drag, a restore, reduced motion). A full jar takes its sun-coloured lid, popping\n * on the bouncy spring (a playful reveal, rule 79); under reduced motion it fades.\n */\nexport function Jar({ fill, instant: jump = false, lid = \"var(--nf-sun)\", className = \"w-full\" }: { fill: number; instant?: boolean; lid?: string; className?: string }) {\n  const id = useId();\n  const reduced = useSafeReducedMotion();\n  const full = fill >= 1;\n  const still = jump || reduced;\n  return (\n    <svg viewBox=\"0 0 60 80\" className={`block aspect-[3/4] h-auto overflow-visible ${className}`} aria-hidden>\n      <defs>\n        <clipPath id={`${id}-body`}>\n          <path d={BODY} />\n        </clipPath>\n      </defs>\n      <rect x=\"16\" y=\"2\" width=\"28\" height=\"9\" rx=\"3\" fill=\"var(--nf-jar)\" opacity=\"0.55\" />\n      <motion.rect\n        x=\"16\"\n        y=\"2\"\n        width=\"28\"\n        height=\"9\"\n        rx=\"3\"\n        fill={lid}\n        style={{ transformBox: \"fill-box\", transformOrigin: \"50% 100%\" }}\n        initial={false}\n        animate={full ? { opacity: 1, scale: 1 } : { opacity: 0, scale: still ? 1 : 0.8 }}\n        transition={still ? (reduced && !jump ? reducedFade : instant) : full ? { ...bouncy, opacity: { duration: 0.12 } } : exitFast}\n      />\n      <path d={BODY} fill=\"var(--nf-jar)\" />\n      <g clipPath={`url(#${id}-body)`}>\n        <motion.path\n          d={WATER}\n          fill=\"var(--nf-water)\"\n          initial={false}\n          animate={{ y: 12 + 68 * (1 - fill) }}\n          transition={still ? instant : smooth}\n        />\n      </g>\n      <path d=\"M16 26v28\" stroke=\"var(--nf-jar)\" strokeWidth=\"4\" strokeLinecap=\"round\" opacity=\"0.7\" />\n    </svg>\n  );\n}\n\n/** The sun, a disc with eight short rays, for the hero's panel. */\nexport function Sun({ className = \"\" }: { className?: string }) {\n  return (\n    <svg viewBox=\"0 0 200 200\" className={className} aria-hidden>\n      <circle cx=\"100\" cy=\"100\" r=\"58\" fill=\"var(--nf-sun)\" />\n      {Array.from({ length: 8 }, (_, i) => (\n        <rect key={i} x=\"94\" y=\"6\" width=\"12\" height=\"26\" rx=\"6\" fill=\"var(--nf-sun)\" transform={`rotate(${i * 45} 100 100)`} />\n      ))}\n    </svg>\n  );\n}\n\n/** The pipe and tap that feed the jars, across the top of the hero's panel. */\nexport function Pipe({ className = \"\" }: { className?: string }) {\n  return (\n    <svg viewBox=\"0 0 400 120\" className={className} preserveAspectRatio=\"xMinYMid meet\" aria-hidden>\n      <path d=\"M-200 40h470c22 0 34 12 34 34v14\" fill=\"none\" stroke=\"var(--nf-sea-deep)\" strokeWidth=\"26\" strokeLinejoin=\"round\" />\n      <rect x=\"276\" y=\"22\" width=\"22\" height=\"36\" rx=\"6\" fill=\"var(--nf-sun)\" />\n      <rect x=\"262\" y=\"14\" width=\"50\" height=\"12\" rx=\"6\" fill=\"var(--nf-sun)\" />\n      <path d=\"M304 104c0 0-8 9-8 14a8 8 0 0 0 16 0c0-5-8-14-8-14Z\" fill=\"var(--nf-jar)\" />\n    </svg>\n  );\n}\n\n/* ---------- The chain's stations ------------------------------------------------------ */\n\n/** One station of the chain, drawn at 96px: the gift, the batch of filters, the home, the glass. */\nexport function Station({ id, className = \"\" }: { id: string; className?: string }) {\n  return (\n    <svg viewBox=\"0 0 96 96\" className={className} aria-hidden>\n      <circle cx=\"48\" cy=\"48\" r=\"46\" fill=\"var(--nf-sea)\" />\n      {id === \"gift\" && (\n        <>\n          <circle cx=\"48\" cy=\"48\" r=\"24\" fill=\"var(--nf-sun)\" />\n          <path d=\"M53 37.5c-1.6-2-4-2.8-6.4-2.3-3.4.7-4.8 3.6-4.4 7.1l.8 13.2M38 47h12M38 59h19\" fill=\"none\" stroke=\"var(--nf-ink)\" strokeWidth=\"4\" strokeLinecap=\"round\" />\n        </>\n      )}\n      {id === \"filter\" && (\n        <>\n          <rect x=\"20\" y=\"44\" width=\"56\" height=\"30\" rx=\"5\" fill=\"var(--nf-sun)\" />\n          {[26, 42, 58].map((x) => (\n            <g key={x}>\n              <rect x={x + 2} y=\"22\" width=\"8\" height=\"5\" rx=\"2\" fill=\"var(--nf-jar)\" />\n              <rect x={x} y=\"28\" width=\"12\" height=\"20\" rx=\"4\" fill=\"var(--nf-jar)\" />\n            </g>\n          ))}\n          <rect x=\"20\" y=\"44\" width=\"56\" height=\"7\" fill=\"var(--nf-ink)\" opacity=\"0.14\" />\n        </>\n      )}\n      {id === \"fitted\" && (\n        <>\n          <path d=\"M20 46 48 24l28 22v28a4 4 0 0 1-4 4H24a4 4 0 0 1-4-4Z\" fill=\"var(--nf-jar)\" />\n          <rect x=\"40\" y=\"46\" width=\"16\" height=\"24\" rx=\"5\" fill=\"var(--nf-water)\" />\n          <rect x=\"43\" y=\"41\" width=\"10\" height=\"5\" rx=\"2\" fill=\"var(--nf-sun)\" />\n        </>\n      )}\n      {id === \"glass\" && (\n        <>\n          <path d=\"M31 22h34l-5 52a6 6 0 0 1-6 5H42a6 6 0 0 1-6-5Z\" fill=\"var(--nf-jar)\" />\n          <path d=\"M33.6 46c5-2.4 10 2.4 15 0s10-2.4 13.8 0l-2.6 28a6 6 0 0 1-6 5H42a6 6 0 0 1-6-5Z\" fill=\"var(--nf-water)\" />\n          <circle cx=\"70\" cy=\"26\" r=\"9\" fill=\"var(--nf-sun)\" />\n        </>\n      )}\n    </svg>\n  );\n}\n\n/* ---------- The map ------------------------------------------------------------------- */\n\n/**\n * The five project areas, drawn: two landmasses as glass over the sea, the river that runs\n * between them into the lake, and a sun-coloured drop for each project. `active` lifts one pin.\n * The places are invented; nothing here is a real coastline.\n */\nexport function ProjectMap({ pins, active, className = \"\" }: { pins: readonly { slug: string; x: number; y: number }[]; active: string | null; className?: string }) {\n  const reduced = useSafeReducedMotion();\n  return (\n    <svg viewBox=\"0 0 1000 560\" className={className} aria-hidden>\n      <path\n        d=\"M40 70c90-40 230-60 360-40 70 11 110 60 160 70 80 16 150-20 250-8 90 11 140 60 150 120 10 70-30 120-20 190 9 60 40 90 10 120-40 40-150 30-260 26-120-4-210 10-320 4-110-6-230-20-290-70-55-46-30-130-60-200C40 200 0 110 40 70Z\"\n        fill=\"oklch(100% 0 0 / 0.14)\"\n      />\n      <path d=\"M700 150c40-30 120-26 150 10 26 31 10 80-30 96-44 18-110 8-130-26-14-24-14-58 10-80Z\" fill=\"var(--nf-sea-deep)\" />\n      <path d=\"M380 40c20 60-30 100-10 160 16 48 90 60 140 100 40 32 60 90 140 120\" fill=\"none\" stroke=\"var(--nf-sea-deep)\" strokeWidth=\"22\" strokeLinecap=\"round\" />\n      <path d=\"M510 300c60-30 120-40 200-90\" fill=\"none\" stroke=\"var(--nf-sea-deep)\" strokeWidth=\"14\" strokeLinecap=\"round\" />\n      {[\n        [150, 260],\n        [420, 470],\n        [860, 420],\n        [250, 90],\n      ].map(([x, y]) => (\n        <path key={`${x}-${y}`} d={`M${x - 26} ${y}l26-30 26 30Z`} fill=\"oklch(100% 0 0 / 0.16)\" />\n      ))}\n      {pins.map((p) => {\n        const on = p.slug === active;\n        return (\n          <motion.g\n            key={p.slug}\n            style={{ transformBox: \"fill-box\", transformOrigin: \"50% 100%\" }}\n            initial={false}\n            animate={{ scale: on && !reduced ? 1.25 : 1 }}\n            transition={reduced ? instant : bouncy}\n          >\n            <path d={`M${p.x} ${p.y}c0 0-20-22-20-36a20 20 0 0 1 40 0c0 14-20 36-20 36Z`} fill=\"var(--nf-sun)\" />\n            <circle cx={p.x} cy={p.y - 36} r=\"7\" fill={on ? \"var(--nf-ink)\" : \"var(--nf-sea)\"} />\n          </motion.g>\n        );\n      })}\n    </svg>\n  );\n}\n\n/** An empty jar on its side, for the 404. */\nexport function EmptyJar({ className = \"\" }: { className?: string }) {\n  return (\n    <svg viewBox=\"0 0 240 180\" className={className} aria-hidden>\n      <ellipse cx=\"120\" cy=\"164\" rx=\"100\" ry=\"10\" fill=\"var(--nf-sea)\" opacity=\"0.18\" />\n      <g transform=\"rotate(-78 120 100)\">\n        <rect x=\"88\" y=\"18\" width=\"64\" height=\"18\" rx=\"6\" fill=\"var(--nf-sun)\" />\n        <path d=\"M70 64c0-14 8-22 22-22h56c14 0 22 8 22 22v96c0 14-8 22-22 22H92c-14 0-22-8-22-22Z\" fill=\"var(--nf-sea)\" />\n        <path d=\"M86 70v60\" stroke=\"var(--nf-jar)\" strokeWidth=\"8\" strokeLinecap=\"round\" opacity=\"0.6\" />\n      </g>\n      <path d=\"M196 120c0 0-8 9-8 14a8 8 0 0 0 16 0c0-5-8-14-8-14Z\" fill=\"var(--nf-water)\" />\n    </svg>\n  );\n}\n",
      "type": "registry:component",
      "target": "@components/eased/templates/nonprofit/art.tsx"
    },
    {
      "path": "src/registry/eased/templates/nonprofit/drawings.tsx",
      "content": "/**\n * The template's scenes, drawn in the same manner as art.tsx: bold flat shapes in the sea, the\n * sun, the water and paper, no outlines. People are figures, never faces; each project, way to\n * give and way in has its own scene. All decoration, hidden from screen readers; the words beside\n * each say what it shows. Colours come from the `--nf-*` tokens, so every scene follows the theme.\n */\n\nconst SEA = \"var(--nf-sea)\";\nconst DEEP = \"var(--nf-sea-deep)\";\nconst SUN = \"var(--nf-sun)\";\nconst WATER = \"var(--nf-water)\";\nconst PAPER = \"var(--nf-jar)\";\nconst INK = \"var(--nf-ink)\";\n\n/** A person, shoulders up: a paper head and a rounded body in the palette's colours, with one of four hair shapes. No face, no skin tone. */\nexport function Figure({ index = 0, className = \"\" }: { index?: number; className?: string }) {\n  const looks = [\n    { body: SEA, hair: INK, bg: SUN },\n    { body: SUN, hair: DEEP, bg: WATER },\n    { body: WATER, hair: INK, bg: SEA },\n    { body: DEEP, hair: SUN, bg: WATER },\n  ];\n  const l = looks[index % looks.length];\n  const hair = [\n    <path key=\"h\" d=\"M33 30a15 15 0 0 1 30 0v4H33Z\" fill={l.hair} />,\n    <path key=\"h\" d=\"M31 34c0-12 8-18 17-18s17 6 17 18c-4-5-10-7-17-7s-13 2-17 7Z\" fill={l.hair} />,\n    <circle key=\"h\" cx=\"48\" cy=\"17\" r=\"8\" fill={l.hair} />,\n    <path key=\"h\" d=\"M33 30a15 15 0 0 1 30 0v14h-6V30H39v14h-6Z\" fill={l.hair} />,\n  ][index % 4];\n  return (\n    <svg viewBox=\"0 0 96 96\" className={className} aria-hidden>\n      <rect width=\"96\" height=\"96\" rx=\"20\" fill={l.bg} />\n      <path d=\"M20 96c0-20 12-34 28-34s28 14 28 34Z\" fill={l.body} />\n      <circle cx=\"48\" cy=\"38\" r=\"15\" fill={PAPER} />\n      {hair}\n    </svg>\n  );\n}\n\n/* ---------- One scene per project -------------------------------------------------------- */\n\nconst ground = <rect x=\"0\" y=\"118\" width=\"240\" height=\"42\" fill={DEEP} />;\n\n/** Each project's own scene, by slug: a house with its filter, a school with its tank, tap stands by the lake, the clinic tank, a well's hand pump. */\nexport function ProjectArt({ slug, className = \"\" }: { slug: string; className?: string }) {\n  return (\n    <svg viewBox=\"0 0 240 160\" preserveAspectRatio=\"xMidYMid slice\" className={className} aria-hidden>\n      <rect width=\"240\" height=\"160\" fill={SEA} />\n      <circle cx=\"200\" cy=\"34\" r=\"16\" fill={SUN} />\n      {ground}\n      {slug === \"hill-villages\" && (\n        <>\n          <path d=\"M-10 118 50 62l50 56Z\" fill=\"oklch(100% 0 0 / 0.14)\" />\n          <path d=\"M120 118V78l40-26 40 26v40Z\" fill={PAPER} />\n          <rect x=\"146\" y=\"88\" width=\"16\" height=\"30\" rx=\"3\" fill={SEA} />\n          <rect x=\"172\" y=\"90\" width=\"16\" height=\"22\" rx=\"5\" fill={WATER} />\n          <rect x=\"174\" y=\"85\" width=\"12\" height=\"5\" rx=\"2\" fill={SUN} />\n        </>\n      )}\n      {slug === \"river-schools\" && (\n        <>\n          <rect x=\"40\" y=\"72\" width=\"110\" height=\"46\" fill={PAPER} />\n          <path d=\"M34 74 95 46l61 28Z\" fill={SUN} />\n          {[52, 76, 100, 124].map((x) => (\n            <rect key={x} x={x} y=\"84\" width=\"14\" height=\"14\" rx=\"2\" fill={SEA} />\n          ))}\n          <rect x=\"172\" y=\"60\" width=\"36\" height=\"40\" rx=\"6\" fill={WATER} />\n          <rect x=\"176\" y=\"100\" width=\"4\" height=\"18\" fill={PAPER} />\n          <rect x=\"200\" y=\"100\" width=\"4\" height=\"18\" fill={PAPER} />\n          <path d=\"M150 104h22\" stroke={PAPER} strokeWidth=\"4\" />\n        </>\n      )}\n      {slug === \"lake-shore\" && (\n        <>\n          <ellipse cx=\"70\" cy=\"122\" rx=\"62\" ry=\"12\" fill={WATER} />\n          {[146, 176, 206].map((x) => (\n            <g key={x}>\n              <rect x={x} y=\"84\" width=\"8\" height=\"34\" rx=\"2\" fill={PAPER} />\n              <path d={`M${x + 8} 88h10v8`} stroke={SUN} strokeWidth=\"5\" fill=\"none\" strokeLinecap=\"round\" />\n              <circle cx={x + 18} cy=\"104\" r=\"3\" fill={WATER} />\n            </g>\n          ))}\n        </>\n      )}\n      {slug === \"market-clinic\" && (\n        <>\n          <rect x=\"30\" y=\"68\" width=\"100\" height=\"50\" fill={PAPER} />\n          <rect x=\"70\" y=\"92\" width=\"20\" height=\"26\" fill={SEA} />\n          <path d=\"M24 70h112l-8-12H32Z\" fill={SUN} />\n          <rect x=\"160\" y=\"96\" width=\"6\" height=\"22\" fill={PAPER} />\n          <rect x=\"196\" y=\"96\" width=\"6\" height=\"22\" fill={PAPER} />\n          <rect x=\"154\" y=\"60\" width=\"54\" height=\"38\" rx=\"8\" fill={WATER} />\n          <rect x=\"154\" y=\"60\" width=\"54\" height=\"10\" rx=\"4\" fill={PAPER} opacity=\"0.6\" />\n        </>\n      )}\n      {slug === \"south-plain\" && (\n        <>\n          <path d=\"M-10 118c60-14 120-14 260 0Z\" fill=\"oklch(100% 0 0 / 0.14)\" />\n          <rect x=\"100\" y=\"104\" width=\"50\" height=\"14\" rx=\"3\" fill={PAPER} />\n          <rect x=\"118\" y=\"58\" width=\"12\" height=\"48\" rx=\"3\" fill={SUN} />\n          <path d=\"M124 64 166 52\" stroke={SUN} strokeWidth=\"7\" strokeLinecap=\"round\" />\n          <path d=\"M118 80h-14v8\" stroke={PAPER} strokeWidth=\"6\" fill=\"none\" strokeLinecap=\"round\" />\n          <path d=\"M104 96c0 0-4 5-4 8a4 4 0 0 0 8 0c0-3-4-8-4-8Z\" fill={WATER} />\n        </>\n      )}\n    </svg>\n  );\n}\n\n/* ---------- Ways to give and ways in ---------------------------------------------------- */\n\n/** A scene for each way to give or way in, by id: a month of drops, a finishing flag, an office, a sealed letter, a packed crate, a medal. */\nexport function WayArt({ id, className = \"\" }: { id: string; className?: string }) {\n  return (\n    <svg viewBox=\"0 0 120 90\" className={className} aria-hidden>\n      <rect width=\"120\" height=\"90\" rx=\"14\" fill={SEA} />\n      {id === \"monthly\" && (\n        <>\n          <rect x=\"26\" y=\"16\" width=\"68\" height=\"60\" rx=\"8\" fill={PAPER} />\n          <rect x=\"26\" y=\"16\" width=\"68\" height=\"14\" rx=\"6\" fill={SUN} />\n          {Array.from({ length: 12 }, (_, i) => (\n            <path key={i} d={`M${36 + (i % 4) * 16} ${36 + Math.floor(i / 4) * 13}c0 0-4 5-4 7a4 4 0 0 0 8 0c0-2-4-7-4-7Z`} fill={WATER} />\n          ))}\n        </>\n      )}\n      {id === \"fundraise\" && (\n        <>\n          <rect x=\"30\" y=\"18\" width=\"5\" height=\"58\" rx=\"2\" fill={PAPER} />\n          <rect x=\"85\" y=\"18\" width=\"5\" height=\"58\" rx=\"2\" fill={PAPER} />\n          <rect x=\"35\" y=\"20\" width=\"50\" height=\"16\" fill={SUN} />\n          {[0, 1, 2, 3, 4].map((i) => (\n            <rect key={i} x={35 + i * 10} y={i % 2 ? 20 : 28} width=\"10\" height=\"8\" fill={INK} opacity=\"0.85\" />\n          ))}\n          <path d=\"M20 76h80\" stroke={DEEP} strokeWidth=\"6\" />\n        </>\n      )}\n      {id === \"workplace\" && (\n        <>\n          <rect x=\"34\" y=\"18\" width=\"52\" height=\"58\" rx=\"4\" fill={PAPER} />\n          {[0, 1, 2].map((r) =>\n            [0, 1, 2].map((c) => <rect key={`${r}${c}`} x={42 + c * 14} y={26 + r * 14} width=\"8\" height=\"8\" rx=\"1.5\" fill={r === 1 && c === 1 ? SUN : SEA} />),\n          )}\n          <rect x=\"54\" y=\"64\" width=\"12\" height=\"12\" fill={DEEP} />\n        </>\n      )}\n      {id === \"will\" && (\n        <>\n          <rect x=\"24\" y=\"24\" width=\"72\" height=\"46\" rx=\"6\" fill={PAPER} />\n          <path d=\"M24 28 60 52l36-24\" fill=\"none\" stroke={SEA} strokeWidth=\"4\" strokeLinejoin=\"round\" />\n          <circle cx=\"60\" cy=\"56\" r=\"8\" fill={SUN} />\n        </>\n      )}\n      {id === \"volunteer\" && (\n        <>\n          <rect x=\"24\" y=\"40\" width=\"72\" height=\"34\" rx=\"5\" fill={SUN} />\n          {[34, 52, 70].map((x) => (\n            <g key={x}>\n              <rect x={x + 2} y=\"22\" width=\"12\" height=\"5\" rx=\"2\" fill={PAPER} />\n              <rect x={x} y=\"27\" width=\"16\" height=\"22\" rx=\"5\" fill={WATER} />\n            </g>\n          ))}\n          <rect x=\"24\" y=\"40\" width=\"72\" height=\"7\" fill={INK} opacity=\"0.15\" />\n        </>\n      )}\n      {id === \"medal\" && (\n        <>\n          <path d=\"M48 12h10l6 26h-10ZM72 12H62l-6 26h10Z\" fill={WATER} />\n          <circle cx=\"60\" cy=\"54\" r=\"20\" fill={SUN} />\n          <path d=\"M60 44c0 0-8 9-8 13a8 8 0 0 0 16 0c0-4-8-13-8-13Z\" fill={SEA} />\n        </>\n      )}\n    </svg>\n  );\n}\n",
      "type": "registry:component",
      "target": "@components/eased/templates/nonprofit/drawings.tsx"
    },
    {
      "path": "src/registry/eased/templates/nonprofit/appeal.tsx",
      "content": "\"use client\";\n\nimport { motion } from \"motion/react\";\nimport { instant, smooth, useSafeReducedMotion } from \"../../lib/motion\";\nimport { appeal, giving } from \"./content\";\nimport { printDay, useDaysLeft } from \"./gift\";\nimport { appealAfter } from \"./giving\";\n\n/**\n * The appeal, as the template draws it everywhere: a bar that fills to what is raised, with a\n * sun-coloured stretch for the gift being shown, and the words for it. Everything derives from\n * `appeal` and `giving.unit` in content.ts: the money target is the families target times the\n * unit cost, and the families funded are whole units of what is raised.\n */\n\nexport const target = appeal.target * giving.unit.cost;\n\n/** The appeal's state with a gift of `added` pounds a year in the pot. */\nexport function appealWith(added: number) {\n  const { before, after } = appealAfter(appeal.raised, added, giving.unit, appeal.target);\n  return {\n    before,\n    after,\n    /** Fractions of the money target, for the bar. */\n    raised: Math.min(1, appeal.raised / target),\n    withGift: Math.min(1, (appeal.raised + added) / target),\n  };\n}\n\n/**\n * Days left as words: before the client knows today, the fixed closing date (or, in demo mode,\n * no date at all), then the count, then closed. `closed` drops the gift's stretch and the appeal's\n * framing wherever the appeal is shown.\n */\nexport function useAppealTime() {\n  const days = useDaysLeft();\n  if (days === null) return { closed: false, text: appeal.rolling === null ? appeal.closesLabel(printDay(appeal.closes)) : appeal.open };\n  if (days < 0) return { closed: true, text: appeal.closed };\n  return { closed: false, text: appeal.left(days) };\n}\n\n/**\n * The bar. The raised part and the gift's stretch are two layers scaled from the left edge, so\n * they move on transforms only (rule 75); the gift's stretch is never shorter than 0.4% of the\n * bar while it adds anything, so the smallest gift still shows. `instant` follows a drag exactly.\n */\nexport function AppealBar({\n  added,\n  instant: jump = false,\n  className = \"h-1\",\n  trackClassName = \"bg-line-subtle\",\n  raisedClassName = \"bg-(--nf-sea)\",\n}: {\n  added: number;\n  instant?: boolean;\n  className?: string;\n  trackClassName?: string;\n  /** The raised part's colour: the sea on paper, paper on the sea. */\n  raisedClassName?: string;\n}) {\n  const reduced = useSafeReducedMotion();\n  const { raised, withGift } = appealWith(added);\n  const transition = jump || reduced ? instant : smooth;\n  return (\n    <span aria-hidden className={`relative block w-full overflow-hidden ${trackClassName} ${className}`}>\n      <motion.span\n        className=\"absolute inset-y-0 left-0 w-full origin-left bg-(--nf-sun)\"\n        initial={false}\n        animate={{ scaleX: added > 0 ? Math.max(withGift, raised + 0.004) : raised }}\n        transition={transition}\n      />\n      <motion.span className={`absolute inset-y-0 left-0 w-full origin-left ${raisedClassName}`} initial={false} animate={{ scaleX: raised }} transition={transition} />\n    </span>\n  );\n}\n",
      "type": "registry:component",
      "target": "@components/eased/templates/nonprofit/appeal.tsx"
    }
  ],
  "meta": {
    "template": "nonprofit",
    "kind": "template-lib",
    "industries": [
      "health"
    ]
  },
  "type": "registry:lib"
}