@brandlab-digital/site-core 3.20.0 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6,7 +6,7 @@
6
6
  * `defineBrandlabNavigation` (3.9.0) takes the menu as data plus the rules context (which pages exist, the money
7
7
  * services, the recorded order) and enforces the N1 rules, throwing a precise error when one is broken.
8
8
  * `validateBrandlabNavigation` returns the same findings without throwing; the conformance rule applies it to a
9
- * rendered header. The types below are the contract the ui-kit header renders.
9
+ * rendered header. The types below are the contract a site's header renders.
10
10
  */
11
11
  export interface BrandlabNavLink {
12
12
  readonly label: string;
@@ -6,7 +6,7 @@
6
6
  * `defineBrandlabNavigation` (3.9.0) takes the menu as data plus the rules context (which pages exist, the money
7
7
  * services, the recorded order) and enforces the N1 rules, throwing a precise error when one is broken.
8
8
  * `validateBrandlabNavigation` returns the same findings without throwing; the conformance rule applies it to a
9
- * rendered header. The types below are the contract the ui-kit header renders.
9
+ * rendered header. The types below are the contract a site's header renders.
10
10
  */
11
11
  export const BRANDLAB_NAV_PANELS = ['list', 'columns', 'featured'];
12
12
  // ---------------------------------------------------------------------------
@@ -1 +1 @@
1
- {"version":3,"file":"navigation.js","sourceRoot":"","sources":["../src/navigation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAuBH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,MAAM,EAAE,SAAS,EAAE,UAAU,CAAU,CAAA;AAsC3E,8EAA8E;AAC9E,oEAAoE;AACpE,8EAA8E;AAE9E;;;GAGG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,MAAM;IACN,OAAO;IACP,UAAU;IACV,eAAe;IACf,OAAO;IACP,SAAS;IACT,UAAU;IACV,UAAU;IACV,SAAS;IACT,QAAQ;IACR,MAAM;IACN,MAAM;IACN,WAAW;IACX,QAAQ;IACR,SAAS;CACD,CAAA;AAGV,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACpC,OA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AE,GAAG,CAAC,IAAI,CAAC,WAAW,IAAI,EAAE,CAAC,CAAC;SACrF,CAAA;QACD,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAA;QAClE,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,KAAK,MAAM,IAAI,IAAI,KAAK,IAAI,CAAC,CAAA;QAChE,KAAK,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,EAAE,SAAS,CAAC,CAAA;IACnC,CAAC;IACD,IAAI,IAAI,KAAK,WAAW;QAAE,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,CAAA;IAChH,OAAO,wBAAwB,CAAC;QAC9B,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CACxB,IAAI,CAAC,IAAI,KAAK,MAAM;YAClB,CAAC,CAAC,IAAI;YACN,CAAC,CAAC,EAAE,GAAG,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,EAAE,CAChF;QACD,KAAK,EAAE,OAAO,CAAC,KAAK;KACrB,CAAC,CAAA;AACJ,CAAC","sourcesContent":["/**\n * The navigation model (F1). One menu per site, built from data: the header, the drawer and the checks all read it.\n * A `menu` item is a real link to its hub plus a separate disclosure button (the WAI-ARIA disclosure navigation\n * pattern); its panel always repeats the hub link first. Prices never appear in menus.\n *\n * `defineBrandlabNavigation` (3.9.0) takes the menu as data plus the rules context (which pages exist, the money\n * services, the recorded order) and enforces the N1 rules, throwing a precise error when one is broken.\n * `validateBrandlabNavigation` returns the same findings without throwing; the conformance rule applies it to a\n * rendered header. The types below are the contract the ui-kit header renders.\n */\n\nexport interface BrandlabNavLink {\n readonly label: string\n readonly href: string\n /** A short line under the label in wide panels. Never a price. */\n readonly description?: string\n}\n\n/** One money-service card with its photo, for the `featured` panel. */\nexport interface BrandlabNavFeatured {\n readonly label: string\n readonly href: string\n readonly description: string\n readonly image: { readonly src: string; readonly alt: string; readonly width: number; readonly height: number }\n}\n\n/** A titled group of links inside a `columns` panel (from the services catalogue's `serviceGroups`). */\nexport interface BrandlabNavGroup {\n readonly heading: string\n readonly links: readonly BrandlabNavLink[]\n}\n\nexport const BRANDLAB_NAV_PANELS = ['list', 'columns', 'featured'] as const\nexport type BrandlabNavPanel = (typeof BRANDLAB_NAV_PANELS)[number]\n\nexport interface BrandlabNavLinkItem {\n readonly kind: 'link'\n /** Stable slug used for element ids. */\n readonly id: string\n readonly label: string\n readonly href: string\n /** Other paths that mark this item as the current section. */\n readonly activePaths?: readonly string[]\n}\n\nexport interface BrandlabNavMenuItem {\n readonly kind: 'menu'\n readonly id: string\n readonly label: string\n /** The hub: the top-level label links here, and the panel's first link repeats it. */\n readonly href: string\n /** The panel's first link, for example \"All services\". */\n readonly hubLabel: string\n readonly panel: BrandlabNavPanel\n /** The panel's links in order (for `columns`, every group's links in order). */\n readonly links: readonly BrandlabNavLink[]\n /** For `columns`: the groups, two or three balanced columns. */\n readonly groups?: readonly BrandlabNavGroup[]\n /** For `featured`: one money-service card with its photo. */\n readonly featured?: BrandlabNavFeatured\n readonly activePaths?: readonly string[]\n}\n\nexport type BrandlabNavItem = BrandlabNavLinkItem | BrandlabNavMenuItem\n\nexport interface BrandlabNavigation {\n /** In order, left to right; the phone and the quote button follow the menu and are not items. */\n readonly items: readonly BrandlabNavItem[]\n}\n\n// ---------------------------------------------------------------------------\n// Closed labels, the pages a menu can link to and the rules context\n// ---------------------------------------------------------------------------\n\n/**\n * The top-level labels N1 allows (v1 5.2, rule 6). A money-service name is allowed too (split mode), and so is a\n * label Romie recorded for the site (\"Locations\" on a live site until its next approved change).\n */\nexport const BRANDLAB_NAV_LABELS = [\n 'Home',\n 'About',\n 'Services',\n 'More services',\n 'Areas',\n 'Gallery',\n 'Projects',\n 'Our work',\n 'Reviews',\n 'Guides',\n 'Blog',\n 'FAQs',\n 'Resources',\n 'Prices',\n 'Contact',\n] as const\nexport type BrandlabNavLabel = (typeof BRANDLAB_NAV_LABELS)[number]\n\nexport const BRANDLAB_NAV_PAGE_KEYS = [\n 'about',\n 'services',\n 'areas',\n 'gallery',\n 'projects',\n 'guides',\n 'faqs',\n 'reviews',\n 'prices',\n 'contact',\n] as const\nexport type BrandlabNavPageKey = (typeof BRANDLAB_NAV_PAGE_KEYS)[number]\n\n/** The paths a page is usually served at, for reading a site's pages from its routes or its rendered links. */\nexport const BRANDLAB_NAV_PAGE_ALIASES: Readonly<Record<BrandlabNavPageKey, readonly string[]>> = Object.freeze({\n about: ['/about', '/about-us'],\n services: ['/services', '/our-services'],\n areas: ['/areas', '/locations', '/service-areas', '/areas-we-service', '/areas-we-serve'],\n gallery: ['/gallery'],\n projects: ['/projects', '/our-projects', '/portfolio', '/our-work'],\n guides: ['/guides', '/blog', '/cost-guides'],\n faqs: ['/faqs', '/faq'],\n reviews: ['/reviews'],\n prices: ['/prices', '/pricing'],\n contact: ['/contact', '/contact-us'],\n})\n\n/** One path, or the few paths a page answers at. */\nexport type BrandlabNavigationPath = string | readonly string[]\n\n/**\n * Where each page lives, for the pages the menu can be asked to link to. About, Services and Contact are always\n * required; the others are listed only when the site has them (the area hub when location routes exist, and so on).\n */\nexport interface BrandlabNavigationPages {\n readonly about: BrandlabNavigationPath\n /** The services hub. */\n readonly services: BrandlabNavigationPath\n readonly contact: BrandlabNavigationPath\n /** The areas (locations) hub, when location routes exist. */\n readonly areas?: BrandlabNavigationPath\n readonly gallery?: BrandlabNavigationPath\n readonly projects?: BrandlabNavigationPath\n /** The guides (blog) hub, when cost guides exist. */\n readonly guides?: BrandlabNavigationPath\n readonly faqs?: BrandlabNavigationPath\n readonly reviews?: BrandlabNavigationPath\n readonly prices?: BrandlabNavigationPath\n}\n\n/** A money service in money order. Split mode needs two or three, each with sub-services. */\nexport interface BrandlabNavigationMoneyService {\n readonly label: string\n readonly href: string\n /** How many sub-services sit under it. */\n readonly subServices: number\n}\n\n/**\n * What Romie recorded for a site's menu, in `navigation` of the strategy record (`defineSiteStrategy`). `order` lists\n * the item ids (the slug of each label as shown) or the v1 keys (`svc:decking`, `areas`, `blog`); when it is there the\n * menu must reproduce it item for item. `labels` and `areas` stand without an order.\n */\nexport interface BrandlabRecordedNavigation {\n readonly order?: readonly string[]\n /** Labels outside the closed list that Romie recorded, by item key: `{ areas: 'Locations' }`. */\n readonly labels?: Readonly<Record<string, string>>\n /** `link` or `menu` for the Areas item. */\n readonly areas?: 'link' | 'menu'\n /** Who set it, for example \"Romie\". */\n readonly setBy: string\n /** The date it was recorded, as YYYY-MM-DD. */\n readonly recordedOn: string\n}\n\nexport interface BrandlabNavigationRules {\n readonly pages: BrandlabNavigationPages\n /** Areas is a plain link to its hub by default; `menu` records a dropdown of regions. */\n readonly areasMode?: 'link' | 'menu'\n /** The money services in money order; leave it out when the services are not known. */\n readonly moneyServices?: readonly BrandlabNavigationMoneyService[]\n /** How many services sit outside the split money services (the contents of More services). */\n readonly otherServices?: number\n readonly recorded?: BrandlabRecordedNavigation\n}\n\n// ---------------------------------------------------------------------------\n// Findings\n// ---------------------------------------------------------------------------\n\nexport const BRANDLAB_NAV_RULES = [\n 'shape',\n 'label',\n 'label-page',\n 'proof-label',\n 'required-link',\n 'about-early',\n 'services-before-areas',\n 'contact-last',\n 'home-first',\n 'hub',\n 'price',\n 'split',\n 'single-child',\n 'panel',\n 'areas-mode',\n 'recorded',\n] as const\nexport type BrandlabNavigationRuleId = (typeof BRANDLAB_NAV_RULES)[number]\n\nexport interface BrandlabNavigationFinding {\n readonly rule: BrandlabNavigationRuleId\n /** One plain sentence: what is wrong and where. */\n readonly message: string\n /** The id of the item the finding is about, when it is about one. */\n readonly item?: string\n}\n\nexport class BrandlabNavigationError extends Error {\n readonly findings: readonly BrandlabNavigationFinding[]\n\n constructor(findings: readonly BrandlabNavigationFinding[]) {\n super(\n `The navigation breaks ${findings.length === 1 ? 'an N1 rule' : `${findings.length} N1 rules`}:\\n` +\n findings.map((finding) => `- ${finding.message}`).join('\\n'),\n )\n this.name = 'BrandlabNavigationError'\n this.findings = findings\n }\n}\n\n// ---------------------------------------------------------------------------\n// Reading paths and keys\n// ---------------------------------------------------------------------------\n\nfunction isText(value: unknown): value is string {\n return typeof value === 'string' && value.trim().length > 0\n}\n\nfunction pathKey(href: string): string {\n const [beforeHash = ''] = href.split('#')\n const [beforeQuery = ''] = beforeHash.split('?')\n if (beforeQuery === '') return ''\n const trimmed = beforeQuery.length > 1 ? beforeQuery.replace(/\\/+$/, '') : beforeQuery\n return (trimmed || '/').toLowerCase()\n}\n\nfunction pathsOf(value: BrandlabNavigationPath | undefined): string[] {\n if (value === undefined) return []\n const list = typeof value === 'string' ? [value] : [...value]\n return list.filter(isText).map(pathKey)\n}\n\nfunction slug(text: string): string {\n return text\n .toLowerCase()\n .replace(/[^a-z0-9]+/g, '-')\n .replace(/(^-|-$)/g, '')\n}\n\nfunction usableHref(href: unknown): href is string {\n return isText(href) && !href.trim().startsWith('#') && !/^javascript:/i.test(href.trim())\n}\n\n/** The pages named in the route catalogue (by kind first, then by usual path). Always-required pages fall back to usual paths. */\nexport function navigationPagesFromRoutes(\n routes: readonly { readonly path: string; readonly kind?: string }[],\n): BrandlabNavigationPages {\n const paths = new Set(routes.map((route) => pathKey(route.path)))\n const byKind: Partial<Record<BrandlabNavPageKey, string>> = {}\n const kinds: Record<string, BrandlabNavPageKey> = {\n 'service-index': 'services',\n 'location-index': 'areas',\n 'blog-index': 'guides',\n 'project-index': 'projects',\n contact: 'contact',\n }\n // A kinded route whose path is another page's usual path belongs to that page: a project-index route at\n // /gallery is the gallery, so the projects hub is the next project-index route (AA lists /gallery first).\n const aliasOfOther = (key: BrandlabNavPageKey, path: string) =>\n BRANDLAB_NAV_PAGE_KEYS.some((other) => other !== key && BRANDLAB_NAV_PAGE_ALIASES[other].includes(pathKey(path)))\n for (const route of routes) {\n const key = route.kind ? kinds[route.kind] : undefined\n if (key && !byKind[key] && !aliasOfOther(key, route.path)) byKind[key] = route.path\n }\n const found: Partial<Record<BrandlabNavPageKey, readonly string[]>> = {}\n for (const key of BRANDLAB_NAV_PAGE_KEYS) {\n const named = byKind[key]\n const aliased = BRANDLAB_NAV_PAGE_ALIASES[key].filter((alias) => paths.has(alias))\n const all = [...new Set([...(named ? [named] : []), ...aliased])]\n if (all.length > 0) found[key] = all\n }\n const required = (key: 'about' | 'services' | 'contact') => found[key] ?? BRANDLAB_NAV_PAGE_ALIASES[key]\n const pages: { -readonly [K in keyof BrandlabNavigationPages]: BrandlabNavigationPages[K] } = {\n about: required('about'),\n services: required('services'),\n contact: required('contact'),\n }\n for (const key of ['areas', 'gallery', 'projects', 'guides', 'faqs', 'reviews', 'prices'] as const) {\n if (found[key]) pages[key] = found[key]\n }\n return pages\n}\n\n// ---------------------------------------------------------------------------\n// The N1 rules\n// ---------------------------------------------------------------------------\n\n/** What each closed label points at: the page keys it may link to. */\nconst LABEL_PAGES: Readonly<Record<string, readonly BrandlabNavPageKey[]>> = {\n About: ['about'],\n Services: ['services'],\n 'More services': ['services'],\n Areas: ['areas'],\n Gallery: ['gallery'],\n Projects: ['projects'],\n 'Our work': ['projects', 'gallery'],\n Reviews: ['reviews'],\n Guides: ['guides'],\n Blog: ['guides'],\n FAQs: ['faqs'],\n Resources: ['guides', 'faqs'],\n Prices: ['prices'],\n Contact: ['contact'],\n}\n\n/** Menus whose panel counts the hub as one of its children. */\nconst HUB_COUNTS_AS_CHILD = new Set(['our work', 'resources'])\nconst SERVICES_LIST_MAX = 8\nconst AREAS_LIST_MAX = 12\nconst PRICE = /\\$/\n\ninterface Facts {\n readonly item: BrandlabNavItem\n readonly index: number\n readonly path: string\n readonly roles: ReadonlySet<BrandlabNavPageKey>\n readonly keys: readonly string[]\n}\n\nexport interface ValidateBrandlabNavigationOptions {\n /** Rules to leave out, for example the panel-shape rules on a header the site built itself. */\n readonly skip?: readonly BrandlabNavigationRuleId[]\n}\n\nfunction rolesOf(path: string, pages: BrandlabNavigationPages): Set<BrandlabNavPageKey> {\n const roles = new Set<BrandlabNavPageKey>()\n for (const key of BRANDLAB_NAV_PAGE_KEYS) {\n if (path !== '' && pathsOf(pages[key]).includes(path)) roles.add(key)\n }\n return roles\n}\n\n/** The recorded-order keys an item answers to: its id, the v1 `svc:` form and the page it links to. */\nfunction keysOf(item: BrandlabNavItem, path: string, roles: ReadonlySet<BrandlabNavPageKey>): string[] {\n const keys = new Set<string>([item.id, `svc:${item.id}`])\n if (path === '/') keys.add('home')\n for (const role of roles) keys.add(role)\n if (roles.has('guides')) keys.add('blog')\n return [...keys].map((key) => key.toLowerCase())\n}\n\nfunction pageLabel(key: BrandlabNavPageKey): string {\n return key === 'faqs' ? 'FAQs' : key.charAt(0).toUpperCase() + key.slice(1)\n}\n\nfunction firstPath(pages: BrandlabNavigationPages, key: BrandlabNavPageKey): string {\n return pathsOf(pages[key])[0] ?? ''\n}\n\n/**\n * Applies the N1 rules to a menu and returns every finding (none when the menu passes). The rules follow v1 5.1 to\n * 5.5: required links when their condition holds, About in the first two items, services before Areas, Contact last,\n * labels from the closed list, every dropdown holding its hub link, no prices, split mode for two or three money\n * services and a recorded order reproduced exactly (a recorded order replaces the three position rules).\n */\nexport function validateBrandlabNavigation(\n nav: BrandlabNavigation,\n context: BrandlabNavigationRules,\n options: ValidateBrandlabNavigationOptions = {},\n): readonly BrandlabNavigationFinding[] {\n const findings: BrandlabNavigationFinding[] = []\n const skip = new Set(options.skip ?? [])\n const add = (rule: BrandlabNavigationRuleId, message: string, item?: BrandlabNavItem) => {\n if (skip.has(rule)) return\n findings.push(item ? { rule, message, item: item.id } : { rule, message })\n }\n\n const items = nav?.items\n if (!Array.isArray(items) || items.length === 0) {\n add('shape', 'The navigation has no items.')\n return findings\n }\n\n const pages = context.pages\n const recorded = context.recorded\n const money = context.moneyServices\n const servicePaths = pathsOf(pages.services)\n const name = (item: BrandlabNavItem, index: number) => (isText(item.label) ? `\"${item.label}\"` : `Item ${index + 1}`)\n\n // Shape: every item is something the header can render.\n const idOwners = new Map<string, string>()\n const facts: Facts[] = []\n for (const [index, item] of items.entries()) {\n const who = name(item, index)\n if (!isText(item.label)) add('shape', `${who} has no label.`, item)\n else if (item.label !== item.label.trim()) add('shape', `${who} has spaces around its label.`, item)\n if (!isText(item.id)) add('shape', `${who} has no id.`, item)\n else if (idOwners.has(item.id)) add('shape', `${who} and ${idOwners.get(item.id)} both give the id \"${item.id}\".`, item)\n else idOwners.set(item.id, who)\n if (!usableHref(item.href) && item.kind !== 'menu') add('shape', `${who} does not link to a page.`, item)\n const path = usableHref(item.href) ? pathKey(item.href) : ''\n const roles = rolesOf(path, pages)\n facts.push({ item, index, path, roles, keys: keysOf(item, path, roles) })\n }\n const menus = facts.filter((fact): fact is Facts & { item: BrandlabNavMenuItem } => fact.item.kind === 'menu')\n\n // Prices never appear in a menu.\n const checkPrice = (text: string | undefined, where: string, item: BrandlabNavItem) => {\n if (text && PRICE.test(text)) add('price', `${where} shows a price (\"${text}\"); menus never carry prices.`, item)\n }\n for (const { item, index } of facts) {\n const who = name(item, index)\n checkPrice(item.label, who, item)\n if (item.kind !== 'menu') continue\n checkPrice(item.hubLabel, `The hub link of ${who}`, item)\n for (const link of item.links ?? []) {\n checkPrice(link.label, `The ${who} panel link \"${link.label}\"`, item)\n checkPrice(link.description, `The description of \"${link.label}\" in the ${who} panel`, item)\n }\n for (const group of item.groups ?? []) {\n checkPrice(group.heading, `The \"${group.heading}\" column heading in the ${who} panel`, item)\n }\n if (item.featured) {\n checkPrice(item.featured.label, `The featured card in the ${who} panel`, item)\n checkPrice(item.featured.description, `The description of the featured card in the ${who} panel`, item)\n }\n }\n\n // Dropdowns: the hub link, the panel's shape and single-child items.\n for (const { item, index, roles } of menus) {\n const who = name(item, index)\n if (!usableHref(item.href)) {\n add('hub', `${who} is a dropdown whose label does not link to a hub page; the label links to the hub and the panel opens with the same link.`, item)\n } else if (!isText(item.hubLabel)) {\n add('hub', `The ${who} panel does not open with a link to its hub (${item.href}); every dropdown holds its hub link, for example \"All services\".`, item)\n }\n const links = Array.isArray(item.links) ? item.links : []\n if (!Array.isArray(item.links)) add('shape', `${who} has no panel links.`, item)\n const hubPath = usableHref(item.href) ? pathKey(item.href) : ''\n for (const link of links) {\n if (!isText(link.label) || !usableHref(link.href)) {\n add('shape', `${who} has a panel link without ${isText(link.label) ? 'a page to link to' : 'a label'}.`, item)\n } else if (hubPath !== '' && pathKey(link.href) === hubPath) {\n add('hub', `The ${who} panel lists its hub (${link.href}) again as \"${link.label}\"; the header adds the hub link first from the hub label.`, item)\n }\n }\n if (!HUB_COUNTS_AS_CHILD.has((isText(item.label) ? item.label : '').toLowerCase())) {\n if (links.length === 0) add('single-child', `${who} is a dropdown with nothing in it, so it stays a plain link.`, item)\n else if (links.length === 1) add('single-child', `${who} has a single child link, so it stays a plain link (a dropdown needs at least two).`, item)\n } else if (links.length === 0) {\n add('single-child', `${who} is a dropdown with nothing in it, so it stays a plain link.`, item)\n }\n if (!(BRANDLAB_NAV_PANELS as readonly string[]).includes(item.panel)) {\n add('panel', `${who} has an unknown panel type \"${String(item.panel)}\".`, item)\n } else if (item.panel === 'columns') {\n const groups = item.groups ?? []\n const sizes = groups.map((group) => group.links.length)\n if (groups.length < 2 || groups.length > 3) {\n add('panel', `${who} uses ${groups.length === 0 ? 'no' : groups.length} column groups; a columns panel has two or three.`, item)\n } else if (Math.max(...sizes) - Math.min(...sizes) > 1) {\n add('panel', `The ${who} columns are unbalanced (${sizes.join(', ')} links); they must be within one link of each other.`, item)\n }\n for (const group of groups) {\n if (!isText(group.heading)) add('panel', `A column in the ${who} panel has no heading.`, item)\n }\n } else if (item.groups && item.groups.length > 0) {\n add('panel', `${who} has column groups but a ${item.panel} panel.`, item)\n }\n if (item.panel === 'featured') {\n const featured = item.featured\n if (!featured || !isText(featured.label) || !usableHref(featured.href) || !isText(featured.description)) {\n add('panel', `${who} has a featured panel without a complete featured card (label, link and description).`, item)\n } else if (!isText(featured.image?.src) || !isText(featured.image?.alt) || !(featured.image.width > 0) || !(featured.image.height > 0)) {\n add('panel', `The featured card in the ${who} panel needs an image with its alt text and size.`, item)\n }\n } else if (item.featured) {\n add('panel', `${who} has a featured card but a ${item.panel} panel.`, item)\n }\n if (item.panel !== 'columns') {\n const isAreas = roles.has('areas')\n const cap = isAreas ? AREAS_LIST_MAX : roles.has('services') && item.label !== 'More services' ? SERVICES_LIST_MAX : undefined\n if (cap !== undefined && links.length > cap) {\n add(\n 'panel',\n isAreas\n ? `The ${who} dropdown lists ${links.length} regions; it holds up to ${cap}.`\n : `The ${who} dropdown lists ${links.length} services; more than ${cap} use a columns panel.`,\n item,\n )\n }\n }\n }\n\n // Labels: the closed list, a money-service name or a recorded label.\n const recordedLabels = new Map<string, string>()\n for (const [key, label] of Object.entries(recorded?.labels ?? {})) recordedLabels.set(key.toLowerCase(), label)\n const recordedLabelFor = (fact: Facts) => fact.keys.map((key) => recordedLabels.get(key)).find((label) => label !== undefined)\n const closed = new Set<string>(BRANDLAB_NAV_LABELS)\n const moneyFor = (fact: Facts) => money?.find((service) => pathKey(service.href) === fact.path)\n const isServiceChild = (path: string) => servicePaths.some((root) => root !== '' && path.startsWith(`${root}/`))\n const isServiceItem = (fact: Facts) =>\n fact.roles.has('services') || moneyFor(fact) !== undefined || (money === undefined && isServiceChild(fact.path))\n const closedLabels = BRANDLAB_NAV_LABELS.join(', ')\n for (const fact of facts) {\n const { item } = fact\n if (!isText(item.label)) continue\n const service = moneyFor(fact)\n if (closed.has(item.label)) {\n if (service && service.label !== item.label) {\n add('label', `\"${item.label}\" links to ${item.href}, which is the money service \"${service.label}\"; name the item after the service.`, item)\n }\n } else if (service) {\n if (service.label !== item.label) add('label', `\"${item.label}\" must be named after its money service, \"${service.label}\".`, item)\n } else if (recordedLabelFor(fact) === item.label) {\n // A label Romie recorded for this item.\n } else if (money === undefined && isServiceChild(fact.path)) {\n // A money-service dropdown on a site that has not listed its money services.\n } else {\n add('label', `\"${item.label}\" is not a label the closed list allows (${closedLabels}, or the name of a money service).`, item)\n }\n const recordedLabel = recordedLabelFor(fact)\n if (recordedLabel !== undefined && recordedLabel !== item.label) {\n add('recorded', `The recorded label for \"${item.id}\" is \"${recordedLabel}\", but the menu says \"${item.label}\".`, item)\n }\n }\n\n // Each closed label links to its own page.\n for (const fact of facts) {\n const { item } = fact\n if (!isText(item.label) || !usableHref(item.href) || recordedLabelFor(fact) === item.label) continue\n if (item.label === 'Home') {\n if (fact.path !== '/') add('label-page', `\"Home\" links to ${item.href}, but Home is the front page (/).`, item)\n continue\n }\n const wanted = LABEL_PAGES[item.label]\n if (!wanted) continue\n const defined = wanted.filter((key) => pathsOf(pages[key]).length > 0)\n if (!wanted.some((key) => fact.roles.has(key))) {\n if (defined.length > 0) {\n const where = defined.map((key) => firstPath(pages, key)).join(' or ')\n add('label-page', `\"${item.label}\" links to ${item.href}, but the ${defined.map(pageLabel).join(' or ')} page is ${where}.`, item)\n } else if (fact.roles.size > 0) {\n add('label-page', `\"${item.label}\" links to ${item.href}, which is the ${[...fact.roles].map(pageLabel).join(' or ')} page, not a ${wanted.map(pageLabel).join(' or ')} page.`, item)\n }\n }\n if (item.label === 'Our work' && (pathsOf(pages.gallery).length === 0 || pathsOf(pages.projects).length === 0)) {\n add('proof-label', '\"Our work\" is for a site with both a gallery and projects; use \"Gallery\" or \"Projects\" for the one it has.', item)\n }\n if (item.label === 'Our work') {\n if (item.kind !== 'menu') {\n add('proof-label', '\"Our work\" is a dropdown (Projects, Gallery and more), not a plain link; a site with one proof page uses its name instead.', item)\n } else {\n for (const key of ['gallery', 'projects'] as const) {\n const inPanel = fact.roles.has(key) || (item.links ?? []).some((link) => usableHref(link.href) && pathsOf(pages[key]).includes(pathKey(link.href)))\n if (pathsOf(pages[key]).length > 0 && !inPanel) {\n add('label-page', `The \"Our work\" panel has no link to the ${pageLabel(key)} page (${firstPath(pages, key)}).`, item)\n }\n }\n }\n }\n if (item.label === 'Resources') {\n // Resources is the fit fold: Guides and FAQs together in one dropdown, and not also on their own.\n if (item.kind !== 'menu') {\n add('label-page', '\"Resources\" is a dropdown that folds Guides and FAQs together, not a plain link.', item)\n } else {\n const paths = (key: 'guides' | 'faqs') => [...pathsOf(pages[key]), ...BRANDLAB_NAV_PAGE_ALIASES[key]]\n const holds = (key: 'guides' | 'faqs') =>\n paths(key).includes(fact.path) || (item.links ?? []).some((link) => usableHref(link.href) && paths(key).includes(pathKey(link.href)))\n if (!holds('guides') || !holds('faqs')) {\n add('label-page', `\"Resources\" is only for folding Guides and FAQs into one dropdown, so its panel holds the Guides hub and FAQs.`, item)\n }\n const alone = facts.find((other) => other !== fact && (other.roles.has('guides') || other.roles.has('faqs')))\n if (alone) add('label-page', `\"Resources\" folds Guides and FAQs, but \"${alone.item.label}\" is also in the menu on its own.`, alone.item)\n }\n }\n }\n\n // Required links, when their condition holds.\n const topLevel = (key: BrandlabNavPageKey) => facts.some((fact) => fact.roles.has(key))\n const inResources = (key: BrandlabNavPageKey) =>\n menus.some(\n ({ item }) =>\n item.label === 'Resources' &&\n (item.links ?? []).some((link) => usableHref(link.href) && pathsOf(pages[key]).includes(pathKey(link.href))),\n )\n const reach = (key: BrandlabNavPageKey) => topLevel(key) || ((key === 'guides' || key === 'faqs') && inResources(key))\n const split = money !== undefined && money.length >= 2 && money.length <= 3 && money.every((service) => service.subServices >= 2)\n const splitServed = split && money.every((service) => menus.some((menu) => menu.path === pathKey(service.href)))\n const missing = (label: string, key: BrandlabNavPageKey, because: string) =>\n add('required-link', `${label} is missing: the menu has no link to the ${pageLabel(key)} page (${firstPath(pages, key)}); ${because}.`)\n if (!reach('about')) missing('About', 'about', 'About is always required')\n if (!reach('services') && !splitServed) missing('Services', 'services', 'Services, or the money-service dropdowns, are always required')\n if (pathsOf(pages.areas).length > 0 && !reach('areas')) missing('Areas', 'areas', 'Areas is required whenever location routes exist')\n const proof = (['gallery', 'projects'] as const).filter((key) => pathsOf(pages[key]).length > 0)\n if (proof.length > 0 && !proof.some((key) => reach(key))) {\n add(\n 'required-link',\n `${proof.length === 2 ? 'Our work' : pageLabel(proof[0]!)} is missing: the menu links to none of ${proof.map((key) => `${pageLabel(key)} (${firstPath(pages, key)})`).join(' and ')}; the proof page is required when one exists.`,\n )\n }\n if (pathsOf(pages.guides).length > 0 && !reach('guides')) missing('Guides', 'guides', 'Guides is required when guides exist, and can sit inside Resources')\n if (pathsOf(pages.faqs).length > 0 && !reach('faqs')) missing('FAQs', 'faqs', 'FAQs is required when the page exists, and can sit inside Resources')\n if (!reach('contact')) missing('Contact', 'contact', 'Contact is always required')\n\n // Split mode: two or three money services that each have sub-services.\n if (money !== undefined) {\n if (split) {\n for (const service of money) {\n const found = menus.find((menu) => menu.path === pathKey(service.href))\n if (!found) {\n const plain = facts.find((fact) => fact.path === pathKey(service.href))\n add(\n 'split',\n plain\n ? `Split mode: \"${service.label}\" has ${service.subServices} sub-services, so it is a dropdown, not a plain link.`\n : `Split mode: \"${service.label}\" needs its own dropdown (${service.href}); each of the ${money.length} money services gets one and the rest go under More services.`,\n plain?.item,\n )\n }\n }\n for (const fact of facts) {\n if (fact.item.label === 'Services') {\n add('split', 'Split mode replaces the single Services dropdown with one dropdown per money service plus More services.', fact.item)\n }\n }\n const more = facts.find((fact) => fact.item.label === 'More services')\n if (context.otherServices !== undefined && context.otherServices > 0 && !more) {\n add('split', `Split mode needs More services to hold the other ${context.otherServices} service${context.otherServices === 1 ? '' : 's'}.`)\n }\n if (context.otherServices === 0 && more) add('split', 'More services has nothing to hold: every service is already under a money-service dropdown.', more.item)\n if (more && more.item.kind !== 'menu') add('split', 'More services is a dropdown holding the other services, not a plain link.', more.item)\n } else {\n for (const fact of facts) {\n if (fact.item.label === 'More services') {\n add('split', 'More services belongs to split mode, which needs two or three money services that each have sub-services.', fact.item)\n }\n }\n }\n }\n\n // Areas is a plain link unless the site records a dropdown.\n const areasMode = recorded?.areas ?? context.areasMode ?? 'link'\n for (const fact of facts) {\n if (!fact.roles.has('areas')) continue\n if (areasMode === 'link' && fact.item.kind === 'menu') {\n add('areas-mode', `${name(fact.item, fact.index)} is a dropdown; Areas is a plain link to its hub unless the site records areas: 'menu'.`, fact.item)\n } else if (areasMode === 'menu' && fact.item.kind === 'link') {\n add('areas-mode', `${name(fact.item, fact.index)} is a plain link but the site records areas: 'menu'.`, fact.item)\n }\n }\n\n if (recorded) validateRecordedShape(recorded, add)\n if (recorded?.order !== undefined) {\n validateRecordedOrder(recorded, facts, add)\n } else {\n // Relative rules: only where no order is recorded.\n const home = facts.find((fact) => fact.path === '/')\n if (home && home.index > 0) add('home-first', `Home comes first when it is shown, but it is item ${home.index + 1}.`, home.item)\n const about = facts.find((fact) => fact.roles.has('about'))\n if (about && about.index > 1) {\n add('about-early', `About must be one of the first two items, but it is item ${about.index + 1}.`, about.item)\n }\n const areas = facts.find((fact) => fact.roles.has('areas'))\n if (areas) {\n const late = facts.filter((fact) => fact.index > areas.index && isServiceItem(fact))\n for (const fact of late) {\n add('services-before-areas', `Services come before Areas, but ${name(fact.item, fact.index)} follows ${name(areas.item, areas.index)}.`, fact.item)\n }\n }\n const contact = facts.find((fact) => fact.roles.has('contact'))\n const last = facts[facts.length - 1]!\n if (contact && contact !== last) {\n add('contact-last', `Contact must be the last item, but ${name(last.item, last.index)} follows it.`, contact.item)\n }\n }\n\n return findings\n}\n\nfunction validateRecordedShape(\n recorded: BrandlabRecordedNavigation,\n add: (rule: BrandlabNavigationRuleId, message: string, item?: BrandlabNavItem) => void,\n): void {\n const date = recorded.recordedOn\n if (!isText(recorded.setBy) || typeof date !== 'string' || !/^\\d{4}-\\d{2}-\\d{2}$/.test(date) || Number.isNaN(Date.parse(date))) {\n add('recorded', 'A recorded menu needs setBy (who set it) and recordedOn (the date as YYYY-MM-DD).')\n }\n if (recorded.order !== undefined) {\n const order = recorded.order\n if (!Array.isArray(order) || order.length === 0 || !order.every(isText)) {\n add('recorded', 'A recorded order lists the items in order, each by its id or key.')\n } else {\n const wanted = order.map((key) => key.trim().toLowerCase())\n const repeated = wanted.find((key, index) => wanted.indexOf(key) !== index)\n if (repeated) add('recorded', `The recorded order lists \"${repeated}\" twice.`)\n }\n }\n if (recorded.labels !== undefined) {\n const labels = recorded.labels\n const entries = labels && typeof labels === 'object' && !Array.isArray(labels) ? Object.entries(labels) : undefined\n if (!entries || !entries.every(([key, label]) => isText(key) && isText(label))) {\n add('recorded', 'Recorded labels pair an item key with its label, for example areas: \"Locations\".')\n }\n }\n if (recorded.areas !== undefined && recorded.areas !== 'link' && recorded.areas !== 'menu') {\n add('recorded', \"The recorded Areas item is 'link' or 'menu'.\")\n }\n}\n\nfunction validateRecordedOrder(\n recorded: BrandlabRecordedNavigation,\n facts: readonly Facts[],\n add: (rule: BrandlabNavigationRuleId, message: string, item?: BrandlabNavItem) => void,\n): void {\n const order = Array.isArray(recorded.order) ? recorded.order : []\n if (order.length === 0 || !order.every(isText)) return\n const wanted = order.map((key) => key.trim().toLowerCase())\n const by = isText(recorded.setBy) && isText(recorded.recordedOn) ? ` by ${recorded.setBy} on ${recorded.recordedOn}` : ''\n const count = Math.max(wanted.length, facts.length)\n for (let index = 0; index < count; index += 1) {\n const fact = facts[index]\n const key = wanted[index]\n if (fact && key !== undefined && fact.keys.includes(key)) continue\n if (!fact) {\n add('recorded', `The menu ends after \"${facts[facts.length - 1]!.item.label}\", but the order recorded${by} continues with \"${key}\" at position ${index + 1}.`)\n } else if (key === undefined) {\n add('recorded', `The menu has \"${fact.item.label}\" at position ${index + 1}, which the order recorded${by} does not list.`, fact.item)\n } else {\n add('recorded', `Position ${index + 1} should be \"${key}\" as recorded${by}, but the menu has \"${fact.item.label}\".`, fact.item)\n }\n break\n }\n}\n\n// ---------------------------------------------------------------------------\n// Building the menu\n// ---------------------------------------------------------------------------\n\nexport interface BrandlabNavigationLinkInput {\n readonly kind: 'link'\n readonly label: string\n readonly href: string\n readonly activePaths?: readonly string[]\n}\n\nexport interface BrandlabNavigationMenuInput {\n readonly kind: 'menu'\n readonly label: string\n /** The hub: the label links here, and the panel opens with a link to it. */\n readonly href: string\n /** The panel's first link, for example \"All services\". */\n readonly hubLabel: string\n /** Left out, it follows the data: `featured` when a card is given, `columns` when groups are, else `list`. */\n readonly panel?: BrandlabNavPanel\n /** The panel's links after the hub. Left out for `columns`, where the groups' links are the panel's links. */\n readonly links?: readonly BrandlabNavLink[]\n readonly groups?: readonly BrandlabNavGroup[]\n readonly featured?: BrandlabNavFeatured\n readonly activePaths?: readonly string[]\n}\n\nexport type BrandlabNavigationItemInput = BrandlabNavigationLinkInput | BrandlabNavigationMenuInput\n\nexport interface BrandlabNavigationInput {\n /** The menu in order, left to right. The phone and the quote button are not items. */\n readonly items: readonly BrandlabNavigationItemInput[]\n readonly rules: BrandlabNavigationRules\n}\n\nfunction deepFreeze<T>(value: T): T {\n if (value !== null && typeof value === 'object' && !Object.isFrozen(value)) {\n Object.freeze(value)\n for (const child of Object.values(value)) deepFreeze(child)\n }\n return value\n}\n\nfunction buildItem(input: BrandlabNavigationItemInput, index: number, problems: BrandlabNavigationFinding[]): BrandlabNavItem {\n const id = isText(input?.label) ? slug(input.label) : ''\n const activePaths = input.activePaths ? { activePaths: [...input.activePaths] } : {}\n if (input.kind === 'link') {\n return { kind: 'link', id, label: input.label, href: input.href, ...activePaths }\n }\n if (input.kind !== 'menu') {\n problems.push({ rule: 'shape', message: `Item ${index + 1} is neither a link nor a menu.` })\n }\n const flattened = input.groups?.flatMap((group) => group.links.map((link) => ({ ...link })))\n if (flattened && input.links && input.links.length > 0 && JSON.stringify(flattened) !== JSON.stringify(input.links)) {\n problems.push({\n rule: 'shape',\n message: `\"${input.label}\" gives both links and column groups, and the links are not the groups' links in order; give the groups only.`,\n })\n }\n const panel: BrandlabNavPanel = input.panel ?? (input.featured ? 'featured' : input.groups ? 'columns' : 'list')\n return {\n kind: 'menu',\n id,\n label: input.label,\n href: input.href,\n hubLabel: input.hubLabel,\n panel,\n links: flattened ?? (input.links ?? []).map((link) => ({ ...link })),\n ...(input.groups ? { groups: input.groups.map((group) => ({ heading: group.heading, links: group.links.map((link) => ({ ...link })) })) } : {}),\n ...(input.featured ? { featured: { ...input.featured, image: { ...input.featured.image } } } : {}),\n ...activePaths,\n }\n}\n\n/**\n * Builds the menu from data and enforces N1. Returns a frozen `BrandlabNavigation` with a stable id per item (the\n * slug of its label), or throws a `BrandlabNavigationError` listing every rule the menu breaks.\n *\n * A site that records no menu passes its route catalogue instead of `items` (3.14.0) and gets the default order from\n * `defaultBrandlabNavigationItems`: Home · About · Services ▾ · Areas ▾ · Our work ▾ · Blog · FAQs · Contact.\n */\nexport function defineBrandlabNavigation(input: BrandlabNavigationInput | BrandlabDefaultNavigationInput): BrandlabNavigation {\n if (input && !('items' in input) && 'routes' in input) {\n const generated = defaultBrandlabNavigation(input)\n return defineBrandlabNavigation(generated)\n }\n if (!input || !Array.isArray(input.items) || !input.rules?.pages) {\n throw new BrandlabNavigationError([{ rule: 'shape', message: 'defineBrandlabNavigation needs items and rules.pages, or the site routes.' }])\n }\n const problems: BrandlabNavigationFinding[] = []\n const nav: BrandlabNavigation = { items: input.items.map((item, index) => buildItem(item, index, problems)) }\n const findings = [...problems, ...validateBrandlabNavigation(nav, input.rules)]\n if (findings.length > 0) throw new BrandlabNavigationError(findings)\n return deepFreeze(nav)\n}\n\n// ---------------------------------------------------------------------------\n// The default menu (correction #1, 3.14.0)\n// ---------------------------------------------------------------------------\n\n/** The route fields the default menu reads (a `BrandlabRoute` from the site's route catalogue fits). */\nexport interface BrandlabNavigationRoute {\n readonly id: string\n readonly path: string\n readonly kind?: string\n /** The page's short name, used as its menu label. */\n readonly breadcrumbLabel?: string\n readonly parentId?: string\n}\n\nexport interface BrandlabDefaultNavigationInput {\n /** The site's route catalogue, in the order the services and regions should appear (money order). */\n readonly routes: readonly BrandlabNavigationRoute[]\n /** The rules context. `pages` defaults to `navigationPagesFromRoutes(routes)`. */\n readonly rules?: Omit<BrandlabNavigationRules, 'pages'> & { readonly pages?: BrandlabNavigationPages }\n /** More than 8 services: the Services panel's two or three titled columns, which the routes can't name. */\n readonly serviceGroups?: readonly BrandlabNavGroup[]\n /** The panels' first links. Defaults: \"All services\", \"All areas\" and \"Projects\". */\n readonly hubLabels?: { readonly services?: string; readonly areas?: string; readonly work?: string }\n}\n\nconst DEFAULT_HUB_LABELS = { services: 'All services', areas: 'All areas', work: 'Projects' } as const\n\nfunction routeLabel(route: BrandlabNavigationRoute): string {\n if (isText(route.breadcrumbLabel)) return route.breadcrumbLabel\n throw new BrandlabNavigationError([\n { rule: 'shape', message: `The route \"${route.id}\" (${route.path}) has no breadcrumbLabel, so the default menu has no label for it.` },\n ])\n}\n\n/** The routes of `kind` directly under the hub route (all of `kind` when none records a parent). */\nfunction childrenOf(routes: readonly BrandlabNavigationRoute[], kind: string, hub: BrandlabNavigationRoute | undefined): BrandlabNavigationRoute[] {\n const ofKind = routes.filter((route) => route.kind === kind)\n if (!hub) return ofKind.filter((route) => route.parentId === undefined)\n const under = ofKind.filter((route) => route.parentId === hub.id)\n return under.length > 0 || ofKind.some((route) => route.parentId !== undefined) ? under : ofKind\n}\n\n/**\n * The default menu for a site that records none (F1, Romie's correction #1): Home · About · Services ▾ · Areas ▾\n * (the regions and \"All areas\", or a plain link when the site has one region or more than 12) · Our work ▾ (Projects\n * and Gallery; the one that exists as a plain link otherwise) · Blog (or Guides) · FAQs · Contact. Pages the site\n * doesn't have are left out; the phone and the quote button follow the menu and are not items. Returns the input for\n * `defineBrandlabNavigation`, with `areasMode` set to match the Areas item unless the site records it.\n */\nexport function defaultBrandlabNavigation(input: BrandlabDefaultNavigationInput): BrandlabNavigationInput {\n const routes = input?.routes\n if (!Array.isArray(routes)) {\n throw new BrandlabNavigationError([{ rule: 'shape', message: 'The default menu needs the site routes.' }])\n }\n if (input.rules?.recorded?.order !== undefined) {\n throw new BrandlabNavigationError([\n { rule: 'recorded', message: 'The site records a menu order, so it passes its menu as items; the default menu is for sites that record none.' },\n ])\n }\n const pages = input.rules?.pages ?? navigationPagesFromRoutes(routes)\n const hubLabels = { ...DEFAULT_HUB_LABELS, ...input.hubLabels }\n const has = (key: BrandlabNavPageKey) => pathsOf(pages[key]).length > 0\n const hrefOf = (key: BrandlabNavPageKey) => (typeof pages[key] === 'string' ? (pages[key] as string) : (pages[key] as readonly string[] | undefined)?.find(isText)) ?? ''\n const hubRoute = (kind: string, key: BrandlabNavPageKey) =>\n routes.find((route) => route.kind === kind) ?? routes.find((route) => pathsOf(pages[key]).includes(pathKey(route.path)))\n const items: BrandlabNavigationItemInput[] = [{ kind: 'link', label: 'Home', href: '/' }, { kind: 'link', label: 'About', href: hrefOf('about') }]\n\n // Services: one dropdown of the top-level services, or a plain link to the hub when there is one or none.\n const servicesHub = hubRoute('service-index', 'services')\n const services = childrenOf(routes, 'service', servicesHub).map((route) => ({ label: routeLabel(route), href: route.path }))\n const servicesHref = servicesHub?.path ?? hrefOf('services')\n if (input.serviceGroups && input.serviceGroups.length > 0) {\n items.push({ kind: 'menu', label: 'Services', href: servicesHref, hubLabel: hubLabels.services, groups: input.serviceGroups })\n } else if (services.length > SERVICES_LIST_MAX) {\n throw new BrandlabNavigationError([\n {\n rule: 'panel',\n message: `The site has ${services.length} services; more than ${SERVICES_LIST_MAX} need a columns panel, so pass serviceGroups (two or three titled columns) to the default menu.`,\n },\n ])\n } else if (services.length >= 2) {\n items.push({ kind: 'menu', label: 'Services', href: servicesHref, hubLabel: hubLabels.services, links: services })\n } else {\n items.push({ kind: 'link', label: 'Services', href: servicesHref })\n }\n\n // Areas: the regions under the areas hub, when location routes exist.\n let areasMode: 'link' | 'menu' | undefined\n if (has('areas')) {\n const areasHub = hubRoute('location-index', 'areas')\n const areasHref = areasHub?.path ?? hrefOf('areas')\n const regions = areasHub ? routes.filter((route) => route.kind === 'location' && route.parentId === areasHub.id) : []\n const wanted = input.rules?.recorded?.areas ?? input.rules?.areasMode\n areasMode = wanted ?? (regions.length >= 2 && regions.length <= AREAS_LIST_MAX ? 'menu' : 'link')\n items.push(\n areasMode === 'menu'\n ? { kind: 'menu', label: 'Areas', href: areasHref, hubLabel: hubLabels.areas, links: regions.map((route) => ({ label: routeLabel(route), href: route.path })) }\n : { kind: 'link', label: 'Areas', href: areasHref },\n )\n }\n\n // Proof: Our work ▾ with both pages (the projects page is the hub, the gallery listed once), or the one that exists.\n const galleryPaths = pathsOf(pages.gallery)\n const projectsHref = pathsOf(pages.projects).find((path) => !galleryPaths.includes(path))\n const galleryHref = galleryPaths.find((path) => path !== projectsHref)\n if (projectsHref && galleryHref) {\n items.push({ kind: 'menu', label: 'Our work', href: projectsHref, hubLabel: hubLabels.work, links: [{ label: 'Gallery', href: galleryHref }] })\n } else if (projectsHref) {\n items.push({ kind: 'link', label: 'Projects', href: projectsHref })\n } else if (galleryHref) {\n items.push({ kind: 'link', label: 'Gallery', href: galleryHref })\n }\n\n if (has('guides')) {\n const href = hrefOf('guides')\n items.push({ kind: 'link', label: /(^|\\/)blog(\\/|$)/i.test(href) ? 'Blog' : 'Guides', href })\n }\n if (has('faqs')) items.push({ kind: 'link', label: 'FAQs', href: hrefOf('faqs') })\n items.push({ kind: 'link', label: 'Contact', href: hrefOf('contact') })\n\n const { pages: _pages, ...rest } = input.rules ?? {}\n return { items, rules: { ...rest, pages, ...(areasMode && rest.areasMode === undefined && !rest.recorded?.areas ? { areasMode } : {}) } }\n}\n\n// ---------------------------------------------------------------------------\n// Fit: the fold order\n// ---------------------------------------------------------------------------\n\n/** When the menu does not fit at the declared desktop width (check N7), these steps apply in this order. */\nexport const BRANDLAB_NAV_FOLD_ORDER = ['resources', 'hide-home', 'raise-breakpoint'] as const\nexport type BrandlabNavFoldStep = (typeof BRANDLAB_NAV_FOLD_ORDER)[number]\n\nexport interface BrandlabNavFoldOptions {\n readonly rules: BrandlabNavigationRules\n /** The first link in the Resources panel, for example \"All guides\". */\n readonly hubLabel: string\n /** The money services' cost guides, listed after the hub and before FAQs. */\n readonly costGuides?: readonly BrandlabNavLink[]\n}\n\n/**\n * Applies the model's fold steps in order, up to and including `step`: fold Guides and FAQs into \"Resources ▾\",\n * then hide Home. The third step (raise the breakpoint) is the header's, not the menu's. A recorded order is never\n * folded. The result is checked against N1 again.\n */\nexport function foldBrandlabNavigation(\n nav: BrandlabNavigation,\n step: Exclude<BrandlabNavFoldStep, 'raise-breakpoint'>,\n options: BrandlabNavFoldOptions,\n): BrandlabNavigation {\n if (options.rules.recorded) {\n throw new BrandlabNavigationError([\n { rule: 'recorded', message: 'A recorded order is reproduced exactly, so it is not folded; raise the desktop breakpoint instead.' },\n ])\n }\n let items = [...nav.items]\n const pages = options.rules.pages\n const find = (key: 'guides' | 'faqs') =>\n items.find((item): item is BrandlabNavLinkItem => item.kind === 'link' && pathsOf(pages[key]).includes(pathKey(item.href)))\n const guides = find('guides')\n const faqs = find('faqs')\n if (guides && faqs) {\n const resources: BrandlabNavMenuItem = {\n kind: 'menu',\n id: 'resources',\n label: 'Resources',\n href: guides.href,\n hubLabel: options.hubLabel,\n panel: 'list',\n links: [...(options.costGuides ?? []), { label: faqs.label, href: faqs.href }],\n activePaths: [...(guides.activePaths ?? []), faqs.href, ...(faqs.activePaths ?? [])],\n }\n const first = Math.min(items.indexOf(guides), items.indexOf(faqs))\n items = items.filter((item) => item !== guides && item !== faqs)\n items.splice(first, 0, resources)\n }\n if (step === 'hide-home') items = items.filter((item) => !(usableHref(item.href) && pathKey(item.href) === '/'))\n return defineBrandlabNavigation({\n items: items.map((item) =>\n item.kind === 'link'\n ? item\n : { ...item, panel: item.panel, links: item.groups ? undefined : item.links },\n ),\n rules: options.rules,\n })\n}\n"]}
1
+ {"version":3,"file":"navig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AI,KAAK,MAAM;YAClB,CAAC,CAAC,IAAI;YACN,CAAC,CAAC,EAAE,GAAG,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,EAAE,CAChF;QACD,KAAK,EAAE,OAAO,CAAC,KAAK;KACrB,CAAC,CAAA;AACJ,CAAC","sourcesContent":["/**\n * The navigation model (F1). One menu per site, built from data: the header, the drawer and the checks all read it.\n * A `menu` item is a real link to its hub plus a separate disclosure button (the WAI-ARIA disclosure navigation\n * pattern); its panel always repeats the hub link first. Prices never appear in menus.\n *\n * `defineBrandlabNavigation` (3.9.0) takes the menu as data plus the rules context (which pages exist, the money\n * services, the recorded order) and enforces the N1 rules, throwing a precise error when one is broken.\n * `validateBrandlabNavigation` returns the same findings without throwing; the conformance rule applies it to a\n * rendered header. The types below are the contract a site's header renders.\n */\n\nexport interface BrandlabNavLink {\n readonly label: string\n readonly href: string\n /** A short line under the label in wide panels. Never a price. */\n readonly description?: string\n}\n\n/** One money-service card with its photo, for the `featured` panel. */\nexport interface BrandlabNavFeatured {\n readonly label: string\n readonly href: string\n readonly description: string\n readonly image: { readonly src: string; readonly alt: string; readonly width: number; readonly height: number }\n}\n\n/** A titled group of links inside a `columns` panel (from the services catalogue's `serviceGroups`). */\nexport interface BrandlabNavGroup {\n readonly heading: string\n readonly links: readonly BrandlabNavLink[]\n}\n\nexport const BRANDLAB_NAV_PANELS = ['list', 'columns', 'featured'] as const\nexport type BrandlabNavPanel = (typeof BRANDLAB_NAV_PANELS)[number]\n\nexport interface BrandlabNavLinkItem {\n readonly kind: 'link'\n /** Stable slug used for element ids. */\n readonly id: string\n readonly label: string\n readonly href: string\n /** Other paths that mark this item as the current section. */\n readonly activePaths?: readonly string[]\n}\n\nexport interface BrandlabNavMenuItem {\n readonly kind: 'menu'\n readonly id: string\n readonly label: string\n /** The hub: the top-level label links here, and the panel's first link repeats it. */\n readonly href: string\n /** The panel's first link, for example \"All services\". */\n readonly hubLabel: string\n readonly panel: BrandlabNavPanel\n /** The panel's links in order (for `columns`, every group's links in order). */\n readonly links: readonly BrandlabNavLink[]\n /** For `columns`: the groups, two or three balanced columns. */\n readonly groups?: readonly BrandlabNavGroup[]\n /** For `featured`: one money-service card with its photo. */\n readonly featured?: BrandlabNavFeatured\n readonly activePaths?: readonly string[]\n}\n\nexport type BrandlabNavItem = BrandlabNavLinkItem | BrandlabNavMenuItem\n\nexport interface BrandlabNavigation {\n /** In order, left to right; the phone and the quote button follow the menu and are not items. */\n readonly items: readonly BrandlabNavItem[]\n}\n\n// ---------------------------------------------------------------------------\n// Closed labels, the pages a menu can link to and the rules context\n// ---------------------------------------------------------------------------\n\n/**\n * The top-level labels N1 allows (v1 5.2, rule 6). A money-service name is allowed too (split mode), and so is a\n * label Romie recorded for the site (\"Locations\" on a live site until its next approved change).\n */\nexport const BRANDLAB_NAV_LABELS = [\n 'Home',\n 'About',\n 'Services',\n 'More services',\n 'Areas',\n 'Gallery',\n 'Projects',\n 'Our work',\n 'Reviews',\n 'Guides',\n 'Blog',\n 'FAQs',\n 'Resources',\n 'Prices',\n 'Contact',\n] as const\nexport type BrandlabNavLabel = (typeof BRANDLAB_NAV_LABELS)[number]\n\nexport const BRANDLAB_NAV_PAGE_KEYS = [\n 'about',\n 'services',\n 'areas',\n 'gallery',\n 'projects',\n 'guides',\n 'faqs',\n 'reviews',\n 'prices',\n 'contact',\n] as const\nexport type BrandlabNavPageKey = (typeof BRANDLAB_NAV_PAGE_KEYS)[number]\n\n/** The paths a page is usually served at, for reading a site's pages from its routes or its rendered links. */\nexport const BRANDLAB_NAV_PAGE_ALIASES: Readonly<Record<BrandlabNavPageKey, readonly string[]>> = Object.freeze({\n about: ['/about', '/about-us'],\n services: ['/services', '/our-services'],\n areas: ['/areas', '/locations', '/service-areas', '/areas-we-service', '/areas-we-serve'],\n gallery: ['/gallery'],\n projects: ['/projects', '/our-projects', '/portfolio', '/our-work'],\n guides: ['/guides', '/blog', '/cost-guides'],\n faqs: ['/faqs', '/faq'],\n reviews: ['/reviews'],\n prices: ['/prices', '/pricing'],\n contact: ['/contact', '/contact-us'],\n})\n\n/** One path, or the few paths a page answers at. */\nexport type BrandlabNavigationPath = string | readonly string[]\n\n/**\n * Where each page lives, for the pages the menu can be asked to link to. About, Services and Contact are always\n * required; the others are listed only when the site has them (the area hub when location routes exist, and so on).\n */\nexport interface BrandlabNavigationPages {\n readonly about: BrandlabNavigationPath\n /** The services hub. */\n readonly services: BrandlabNavigationPath\n readonly contact: BrandlabNavigationPath\n /** The areas (locations) hub, when location routes exist. */\n readonly areas?: BrandlabNavigationPath\n readonly gallery?: BrandlabNavigationPath\n readonly projects?: BrandlabNavigationPath\n /** The guides (blog) hub, when cost guides exist. */\n readonly guides?: BrandlabNavigationPath\n readonly faqs?: BrandlabNavigationPath\n readonly reviews?: BrandlabNavigationPath\n readonly prices?: BrandlabNavigationPath\n}\n\n/** A money service in money order. Split mode needs two or three, each with sub-services. */\nexport interface BrandlabNavigationMoneyService {\n readonly label: string\n readonly href: string\n /** How many sub-services sit under it. */\n readonly subServices: number\n}\n\n/**\n * What Romie recorded for a site's menu, in `navigation` of the strategy record (`defineSiteStrategy`). `order` lists\n * the item ids (the slug of each label as shown) or the v1 keys (`svc:decking`, `areas`, `blog`); when it is there the\n * menu must reproduce it item for item. `labels` and `areas` stand without an order.\n */\nexport interface BrandlabRecordedNavigation {\n readonly order?: readonly string[]\n /** Labels outside the closed list that Romie recorded, by item key: `{ areas: 'Locations' }`. */\n readonly labels?: Readonly<Record<string, string>>\n /** `link` or `menu` for the Areas item. */\n readonly areas?: 'link' | 'menu'\n /** Who set it, for example \"Romie\". */\n readonly setBy: string\n /** The date it was recorded, as YYYY-MM-DD. */\n readonly recordedOn: string\n}\n\nexport interface BrandlabNavigationRules {\n readonly pages: BrandlabNavigationPages\n /** Areas is a plain link to its hub by default; `menu` records a dropdown of regions. */\n readonly areasMode?: 'link' | 'menu'\n /** The money services in money order; leave it out when the services are not known. */\n readonly moneyServices?: readonly BrandlabNavigationMoneyService[]\n /** How many services sit outside the split money services (the contents of More services). */\n readonly otherServices?: number\n readonly recorded?: BrandlabRecordedNavigation\n}\n\n// ---------------------------------------------------------------------------\n// Findings\n// ---------------------------------------------------------------------------\n\nexport const BRANDLAB_NAV_RULES = [\n 'shape',\n 'label',\n 'label-page',\n 'proof-label',\n 'required-link',\n 'about-early',\n 'services-before-areas',\n 'contact-last',\n 'home-first',\n 'hub',\n 'price',\n 'split',\n 'single-child',\n 'panel',\n 'areas-mode',\n 'recorded',\n] as const\nexport type BrandlabNavigationRuleId = (typeof BRANDLAB_NAV_RULES)[number]\n\nexport interface BrandlabNavigationFinding {\n readonly rule: BrandlabNavigationRuleId\n /** One plain sentence: what is wrong and where. */\n readonly message: string\n /** The id of the item the finding is about, when it is about one. */\n readonly item?: string\n}\n\nexport class BrandlabNavigationError extends Error {\n readonly findings: readonly BrandlabNavigationFinding[]\n\n constructor(findings: readonly BrandlabNavigationFinding[]) {\n super(\n `The navigation breaks ${findings.length === 1 ? 'an N1 rule' : `${findings.length} N1 rules`}:\\n` +\n findings.map((finding) => `- ${finding.message}`).join('\\n'),\n )\n this.name = 'BrandlabNavigationError'\n this.findings = findings\n }\n}\n\n// ---------------------------------------------------------------------------\n// Reading paths and keys\n// ---------------------------------------------------------------------------\n\nfunction isText(value: unknown): value is string {\n return typeof value === 'string' && value.trim().length > 0\n}\n\nfunction pathKey(href: string): string {\n const [beforeHash = ''] = href.split('#')\n const [beforeQuery = ''] = beforeHash.split('?')\n if (beforeQuery === '') return ''\n const trimmed = beforeQuery.length > 1 ? beforeQuery.replace(/\\/+$/, '') : beforeQuery\n return (trimmed || '/').toLowerCase()\n}\n\nfunction pathsOf(value: BrandlabNavigationPath | undefined): string[] {\n if (value === undefined) return []\n const list = typeof value === 'string' ? [value] : [...value]\n return list.filter(isText).map(pathKey)\n}\n\nfunction slug(text: string): string {\n return text\n .toLowerCase()\n .replace(/[^a-z0-9]+/g, '-')\n .replace(/(^-|-$)/g, '')\n}\n\nfunction usableHref(href: unknown): href is string {\n return isText(href) && !href.trim().startsWith('#') && !/^javascript:/i.test(href.trim())\n}\n\n/** The pages named in the route catalogue (by kind first, then by usual path). Always-required pages fall back to usual paths. */\nexport function navigationPagesFromRoutes(\n routes: readonly { readonly path: string; readonly kind?: string }[],\n): BrandlabNavigationPages {\n const paths = new Set(routes.map((route) => pathKey(route.path)))\n const byKind: Partial<Record<BrandlabNavPageKey, string>> = {}\n const kinds: Record<string, BrandlabNavPageKey> = {\n 'service-index': 'services',\n 'location-index': 'areas',\n 'blog-index': 'guides',\n 'project-index': 'projects',\n contact: 'contact',\n }\n // A kinded route whose path is another page's usual path belongs to that page: a project-index route at\n // /gallery is the gallery, so the projects hub is the next project-index route (AA lists /gallery first).\n const aliasOfOther = (key: BrandlabNavPageKey, path: string) =>\n BRANDLAB_NAV_PAGE_KEYS.some((other) => other !== key && BRANDLAB_NAV_PAGE_ALIASES[other].includes(pathKey(path)))\n for (const route of routes) {\n const key = route.kind ? kinds[route.kind] : undefined\n if (key && !byKind[key] && !aliasOfOther(key, route.path)) byKind[key] = route.path\n }\n const found: Partial<Record<BrandlabNavPageKey, readonly string[]>> = {}\n for (const key of BRANDLAB_NAV_PAGE_KEYS) {\n const named = byKind[key]\n const aliased = BRANDLAB_NAV_PAGE_ALIASES[key].filter((alias) => paths.has(alias))\n const all = [...new Set([...(named ? [named] : []), ...aliased])]\n if (all.length > 0) found[key] = all\n }\n const required = (key: 'about' | 'services' | 'contact') => found[key] ?? BRANDLAB_NAV_PAGE_ALIASES[key]\n const pages: { -readonly [K in keyof BrandlabNavigationPages]: BrandlabNavigationPages[K] } = {\n about: required('about'),\n services: required('services'),\n contact: required('contact'),\n }\n for (const key of ['areas', 'gallery', 'projects', 'guides', 'faqs', 'reviews', 'prices'] as const) {\n if (found[key]) pages[key] = found[key]\n }\n return pages\n}\n\n// ---------------------------------------------------------------------------\n// The N1 rules\n// ---------------------------------------------------------------------------\n\n/** What each closed label points at: the page keys it may link to. */\nconst LABEL_PAGES: Readonly<Record<string, readonly BrandlabNavPageKey[]>> = {\n About: ['about'],\n Services: ['services'],\n 'More services': ['services'],\n Areas: ['areas'],\n Gallery: ['gallery'],\n Projects: ['projects'],\n 'Our work': ['projects', 'gallery'],\n Reviews: ['reviews'],\n Guides: ['guides'],\n Blog: ['guides'],\n FAQs: ['faqs'],\n Resources: ['guides', 'faqs'],\n Prices: ['prices'],\n Contact: ['contact'],\n}\n\n/** Menus whose panel counts the hub as one of its children. */\nconst HUB_COUNTS_AS_CHILD = new Set(['our work', 'resources'])\nconst SERVICES_LIST_MAX = 8\nconst AREAS_LIST_MAX = 12\nconst PRICE = /\\$/\n\ninterface Facts {\n readonly item: BrandlabNavItem\n readonly index: number\n readonly path: string\n readonly roles: ReadonlySet<BrandlabNavPageKey>\n readonly keys: readonly string[]\n}\n\nexport interface ValidateBrandlabNavigationOptions {\n /** Rules to leave out, for example the panel-shape rules on a header the site built itself. */\n readonly skip?: readonly BrandlabNavigationRuleId[]\n}\n\nfunction rolesOf(path: string, pages: BrandlabNavigationPages): Set<BrandlabNavPageKey> {\n const roles = new Set<BrandlabNavPageKey>()\n for (const key of BRANDLAB_NAV_PAGE_KEYS) {\n if (path !== '' && pathsOf(pages[key]).includes(path)) roles.add(key)\n }\n return roles\n}\n\n/** The recorded-order keys an item answers to: its id, the v1 `svc:` form and the page it links to. */\nfunction keysOf(item: BrandlabNavItem, path: string, roles: ReadonlySet<BrandlabNavPageKey>): string[] {\n const keys = new Set<string>([item.id, `svc:${item.id}`])\n if (path === '/') keys.add('home')\n for (const role of roles) keys.add(role)\n if (roles.has('guides')) keys.add('blog')\n return [...keys].map((key) => key.toLowerCase())\n}\n\nfunction pageLabel(key: BrandlabNavPageKey): string {\n return key === 'faqs' ? 'FAQs' : key.charAt(0).toUpperCase() + key.slice(1)\n}\n\nfunction firstPath(pages: BrandlabNavigationPages, key: BrandlabNavPageKey): string {\n return pathsOf(pages[key])[0] ?? ''\n}\n\n/**\n * Applies the N1 rules to a menu and returns every finding (none when the menu passes). The rules follow v1 5.1 to\n * 5.5: required links when their condition holds, About in the first two items, services before Areas, Contact last,\n * labels from the closed list, every dropdown holding its hub link, no prices, split mode for two or three money\n * services and a recorded order reproduced exactly (a recorded order replaces the three position rules).\n */\nexport function validateBrandlabNavigation(\n nav: BrandlabNavigation,\n context: BrandlabNavigationRules,\n options: ValidateBrandlabNavigationOptions = {},\n): readonly BrandlabNavigationFinding[] {\n const findings: BrandlabNavigationFinding[] = []\n const skip = new Set(options.skip ?? [])\n const add = (rule: BrandlabNavigationRuleId, message: string, item?: BrandlabNavItem) => {\n if (skip.has(rule)) return\n findings.push(item ? { rule, message, item: item.id } : { rule, message })\n }\n\n const items = nav?.items\n if (!Array.isArray(items) || items.length === 0) {\n add('shape', 'The navigation has no items.')\n return findings\n }\n\n const pages = context.pages\n const recorded = context.recorded\n const money = context.moneyServices\n const servicePaths = pathsOf(pages.services)\n const name = (item: BrandlabNavItem, index: number) => (isText(item.label) ? `\"${item.label}\"` : `Item ${index + 1}`)\n\n // Shape: every item is something the header can render.\n const idOwners = new Map<string, string>()\n const facts: Facts[] = []\n for (const [index, item] of items.entries()) {\n const who = name(item, index)\n if (!isText(item.label)) add('shape', `${who} has no label.`, item)\n else if (item.label !== item.label.trim()) add('shape', `${who} has spaces around its label.`, item)\n if (!isText(item.id)) add('shape', `${who} has no id.`, item)\n else if (idOwners.has(item.id)) add('shape', `${who} and ${idOwners.get(item.id)} both give the id \"${item.id}\".`, item)\n else idOwners.set(item.id, who)\n if (!usableHref(item.href) && item.kind !== 'menu') add('shape', `${who} does not link to a page.`, item)\n const path = usableHref(item.href) ? pathKey(item.href) : ''\n const roles = rolesOf(path, pages)\n facts.push({ item, index, path, roles, keys: keysOf(item, path, roles) })\n }\n const menus = facts.filter((fact): fact is Facts & { item: BrandlabNavMenuItem } => fact.item.kind === 'menu')\n\n // Prices never appear in a menu.\n const checkPrice = (text: string | undefined, where: string, item: BrandlabNavItem) => {\n if (text && PRICE.test(text)) add('price', `${where} shows a price (\"${text}\"); menus never carry prices.`, item)\n }\n for (const { item, index } of facts) {\n const who = name(item, index)\n checkPrice(item.label, who, item)\n if (item.kind !== 'menu') continue\n checkPrice(item.hubLabel, `The hub link of ${who}`, item)\n for (const link of item.links ?? []) {\n checkPrice(link.label, `The ${who} panel link \"${link.label}\"`, item)\n checkPrice(link.description, `The description of \"${link.label}\" in the ${who} panel`, item)\n }\n for (const group of item.groups ?? []) {\n checkPrice(group.heading, `The \"${group.heading}\" column heading in the ${who} panel`, item)\n }\n if (item.featured) {\n checkPrice(item.featured.label, `The featured card in the ${who} panel`, item)\n checkPrice(item.featured.description, `The description of the featured card in the ${who} panel`, item)\n }\n }\n\n // Dropdowns: the hub link, the panel's shape and single-child items.\n for (const { item, index, roles } of menus) {\n const who = name(item, index)\n if (!usableHref(item.href)) {\n add('hub', `${who} is a dropdown whose label does not link to a hub page; the label links to the hub and the panel opens with the same link.`, item)\n } else if (!isText(item.hubLabel)) {\n add('hub', `The ${who} panel does not open with a link to its hub (${item.href}); every dropdown holds its hub link, for example \"All services\".`, item)\n }\n const links = Array.isArray(item.links) ? item.links : []\n if (!Array.isArray(item.links)) add('shape', `${who} has no panel links.`, item)\n const hubPath = usableHref(item.href) ? pathKey(item.href) : ''\n for (const link of links) {\n if (!isText(link.label) || !usableHref(link.href)) {\n add('shape', `${who} has a panel link without ${isText(link.label) ? 'a page to link to' : 'a label'}.`, item)\n } else if (hubPath !== '' && pathKey(link.href) === hubPath) {\n add('hub', `The ${who} panel lists its hub (${link.href}) again as \"${link.label}\"; the header adds the hub link first from the hub label.`, item)\n }\n }\n if (!HUB_COUNTS_AS_CHILD.has((isText(item.label) ? item.label : '').toLowerCase())) {\n if (links.length === 0) add('single-child', `${who} is a dropdown with nothing in it, so it stays a plain link.`, item)\n else if (links.length === 1) add('single-child', `${who} has a single child link, so it stays a plain link (a dropdown needs at least two).`, item)\n } else if (links.length === 0) {\n add('single-child', `${who} is a dropdown with nothing in it, so it stays a plain link.`, item)\n }\n if (!(BRANDLAB_NAV_PANELS as readonly string[]).includes(item.panel)) {\n add('panel', `${who} has an unknown panel type \"${String(item.panel)}\".`, item)\n } else if (item.panel === 'columns') {\n const groups = item.groups ?? []\n const sizes = groups.map((group) => group.links.length)\n if (groups.length < 2 || groups.length > 3) {\n add('panel', `${who} uses ${groups.length === 0 ? 'no' : groups.length} column groups; a columns panel has two or three.`, item)\n } else if (Math.max(...sizes) - Math.min(...sizes) > 1) {\n add('panel', `The ${who} columns are unbalanced (${sizes.join(', ')} links); they must be within one link of each other.`, item)\n }\n for (const group of groups) {\n if (!isText(group.heading)) add('panel', `A column in the ${who} panel has no heading.`, item)\n }\n } else if (item.groups && item.groups.length > 0) {\n add('panel', `${who} has column groups but a ${item.panel} panel.`, item)\n }\n if (item.panel === 'featured') {\n const featured = item.featured\n if (!featured || !isText(featured.label) || !usableHref(featured.href) || !isText(featured.description)) {\n add('panel', `${who} has a featured panel without a complete featured card (label, link and description).`, item)\n } else if (!isText(featured.image?.src) || !isText(featured.image?.alt) || !(featured.image.width > 0) || !(featured.image.height > 0)) {\n add('panel', `The featured card in the ${who} panel needs an image with its alt text and size.`, item)\n }\n } else if (item.featured) {\n add('panel', `${who} has a featured card but a ${item.panel} panel.`, item)\n }\n if (item.panel !== 'columns') {\n const isAreas = roles.has('areas')\n const cap = isAreas ? AREAS_LIST_MAX : roles.has('services') && item.label !== 'More services' ? SERVICES_LIST_MAX : undefined\n if (cap !== undefined && links.length > cap) {\n add(\n 'panel',\n isAreas\n ? `The ${who} dropdown lists ${links.length} regions; it holds up to ${cap}.`\n : `The ${who} dropdown lists ${links.length} services; more than ${cap} use a columns panel.`,\n item,\n )\n }\n }\n }\n\n // Labels: the closed list, a money-service name or a recorded label.\n const recordedLabels = new Map<string, string>()\n for (const [key, label] of Object.entries(recorded?.labels ?? {})) recordedLabels.set(key.toLowerCase(), label)\n const recordedLabelFor = (fact: Facts) => fact.keys.map((key) => recordedLabels.get(key)).find((label) => label !== undefined)\n const closed = new Set<string>(BRANDLAB_NAV_LABELS)\n const moneyFor = (fact: Facts) => money?.find((service) => pathKey(service.href) === fact.path)\n const isServiceChild = (path: string) => servicePaths.some((root) => root !== '' && path.startsWith(`${root}/`))\n const isServiceItem = (fact: Facts) =>\n fact.roles.has('services') || moneyFor(fact) !== undefined || (money === undefined && isServiceChild(fact.path))\n const closedLabels = BRANDLAB_NAV_LABELS.join(', ')\n for (const fact of facts) {\n const { item } = fact\n if (!isText(item.label)) continue\n const service = moneyFor(fact)\n if (closed.has(item.label)) {\n if (service && service.label !== item.label) {\n add('label', `\"${item.label}\" links to ${item.href}, which is the money service \"${service.label}\"; name the item after the service.`, item)\n }\n } else if (service) {\n if (service.label !== item.label) add('label', `\"${item.label}\" must be named after its money service, \"${service.label}\".`, item)\n } else if (recordedLabelFor(fact) === item.label) {\n // A label Romie recorded for this item.\n } else if (money === undefined && isServiceChild(fact.path)) {\n // A money-service dropdown on a site that has not listed its money services.\n } else {\n add('label', `\"${item.label}\" is not a label the closed list allows (${closedLabels}, or the name of a money service).`, item)\n }\n const recordedLabel = recordedLabelFor(fact)\n if (recordedLabel !== undefined && recordedLabel !== item.label) {\n add('recorded', `The recorded label for \"${item.id}\" is \"${recordedLabel}\", but the menu says \"${item.label}\".`, item)\n }\n }\n\n // Each closed label links to its own page.\n for (const fact of facts) {\n const { item } = fact\n if (!isText(item.label) || !usableHref(item.href) || recordedLabelFor(fact) === item.label) continue\n if (item.label === 'Home') {\n if (fact.path !== '/') add('label-page', `\"Home\" links to ${item.href}, but Home is the front page (/).`, item)\n continue\n }\n const wanted = LABEL_PAGES[item.label]\n if (!wanted) continue\n const defined = wanted.filter((key) => pathsOf(pages[key]).length > 0)\n if (!wanted.some((key) => fact.roles.has(key))) {\n if (defined.length > 0) {\n const where = defined.map((key) => firstPath(pages, key)).join(' or ')\n add('label-page', `\"${item.label}\" links to ${item.href}, but the ${defined.map(pageLabel).join(' or ')} page is ${where}.`, item)\n } else if (fact.roles.size > 0) {\n add('label-page', `\"${item.label}\" links to ${item.href}, which is the ${[...fact.roles].map(pageLabel).join(' or ')} page, not a ${wanted.map(pageLabel).join(' or ')} page.`, item)\n }\n }\n if (item.label === 'Our work' && (pathsOf(pages.gallery).length === 0 || pathsOf(pages.projects).length === 0)) {\n add('proof-label', '\"Our work\" is for a site with both a gallery and projects; use \"Gallery\" or \"Projects\" for the one it has.', item)\n }\n if (item.label === 'Our work') {\n if (item.kind !== 'menu') {\n add('proof-label', '\"Our work\" is a dropdown (Projects, Gallery and more), not a plain link; a site with one proof page uses its name instead.', item)\n } else {\n for (const key of ['gallery', 'projects'] as const) {\n const inPanel = fact.roles.has(key) || (item.links ?? []).some((link) => usableHref(link.href) && pathsOf(pages[key]).includes(pathKey(link.href)))\n if (pathsOf(pages[key]).length > 0 && !inPanel) {\n add('label-page', `The \"Our work\" panel has no link to the ${pageLabel(key)} page (${firstPath(pages, key)}).`, item)\n }\n }\n }\n }\n if (item.label === 'Resources') {\n // Resources is the fit fold: Guides and FAQs together in one dropdown, and not also on their own.\n if (item.kind !== 'menu') {\n add('label-page', '\"Resources\" is a dropdown that folds Guides and FAQs together, not a plain link.', item)\n } else {\n const paths = (key: 'guides' | 'faqs') => [...pathsOf(pages[key]), ...BRANDLAB_NAV_PAGE_ALIASES[key]]\n const holds = (key: 'guides' | 'faqs') =>\n paths(key).includes(fact.path) || (item.links ?? []).some((link) => usableHref(link.href) && paths(key).includes(pathKey(link.href)))\n if (!holds('guides') || !holds('faqs')) {\n add('label-page', `\"Resources\" is only for folding Guides and FAQs into one dropdown, so its panel holds the Guides hub and FAQs.`, item)\n }\n const alone = facts.find((other) => other !== fact && (other.roles.has('guides') || other.roles.has('faqs')))\n if (alone) add('label-page', `\"Resources\" folds Guides and FAQs, but \"${alone.item.label}\" is also in the menu on its own.`, alone.item)\n }\n }\n }\n\n // Required links, when their condition holds.\n const topLevel = (key: BrandlabNavPageKey) => facts.some((fact) => fact.roles.has(key))\n const inResources = (key: BrandlabNavPageKey) =>\n menus.some(\n ({ item }) =>\n item.label === 'Resources' &&\n (item.links ?? []).some((link) => usableHref(link.href) && pathsOf(pages[key]).includes(pathKey(link.href))),\n )\n const reach = (key: BrandlabNavPageKey) => topLevel(key) || ((key === 'guides' || key === 'faqs') && inResources(key))\n const split = money !== undefined && money.length >= 2 && money.length <= 3 && money.every((service) => service.subServices >= 2)\n const splitServed = split && money.every((service) => menus.some((menu) => menu.path === pathKey(service.href)))\n const missing = (label: string, key: BrandlabNavPageKey, because: string) =>\n add('required-link', `${label} is missing: the menu has no link to the ${pageLabel(key)} page (${firstPath(pages, key)}); ${because}.`)\n if (!reach('about')) missing('About', 'about', 'About is always required')\n if (!reach('services') && !splitServed) missing('Services', 'services', 'Services, or the money-service dropdowns, are always required')\n if (pathsOf(pages.areas).length > 0 && !reach('areas')) missing('Areas', 'areas', 'Areas is required whenever location routes exist')\n const proof = (['gallery', 'projects'] as const).filter((key) => pathsOf(pages[key]).length > 0)\n if (proof.length > 0 && !proof.some((key) => reach(key))) {\n add(\n 'required-link',\n `${proof.length === 2 ? 'Our work' : pageLabel(proof[0]!)} is missing: the menu links to none of ${proof.map((key) => `${pageLabel(key)} (${firstPath(pages, key)})`).join(' and ')}; the proof page is required when one exists.`,\n )\n }\n if (pathsOf(pages.guides).length > 0 && !reach('guides')) missing('Guides', 'guides', 'Guides is required when guides exist, and can sit inside Resources')\n if (pathsOf(pages.faqs).length > 0 && !reach('faqs')) missing('FAQs', 'faqs', 'FAQs is required when the page exists, and can sit inside Resources')\n if (!reach('contact')) missing('Contact', 'contact', 'Contact is always required')\n\n // Split mode: two or three money services that each have sub-services.\n if (money !== undefined) {\n if (split) {\n for (const service of money) {\n const found = menus.find((menu) => menu.path === pathKey(service.href))\n if (!found) {\n const plain = facts.find((fact) => fact.path === pathKey(service.href))\n add(\n 'split',\n plain\n ? `Split mode: \"${service.label}\" has ${service.subServices} sub-services, so it is a dropdown, not a plain link.`\n : `Split mode: \"${service.label}\" needs its own dropdown (${service.href}); each of the ${money.length} money services gets one and the rest go under More services.`,\n plain?.item,\n )\n }\n }\n for (const fact of facts) {\n if (fact.item.label === 'Services') {\n add('split', 'Split mode replaces the single Services dropdown with one dropdown per money service plus More services.', fact.item)\n }\n }\n const more = facts.find((fact) => fact.item.label === 'More services')\n if (context.otherServices !== undefined && context.otherServices > 0 && !more) {\n add('split', `Split mode needs More services to hold the other ${context.otherServices} service${context.otherServices === 1 ? '' : 's'}.`)\n }\n if (context.otherServices === 0 && more) add('split', 'More services has nothing to hold: every service is already under a money-service dropdown.', more.item)\n if (more && more.item.kind !== 'menu') add('split', 'More services is a dropdown holding the other services, not a plain link.', more.item)\n } else {\n for (const fact of facts) {\n if (fact.item.label === 'More services') {\n add('split', 'More services belongs to split mode, which needs two or three money services that each have sub-services.', fact.item)\n }\n }\n }\n }\n\n // Areas is a plain link unless the site records a dropdown.\n const areasMode = recorded?.areas ?? context.areasMode ?? 'link'\n for (const fact of facts) {\n if (!fact.roles.has('areas')) continue\n if (areasMode === 'link' && fact.item.kind === 'menu') {\n add('areas-mode', `${name(fact.item, fact.index)} is a dropdown; Areas is a plain link to its hub unless the site records areas: 'menu'.`, fact.item)\n } else if (areasMode === 'menu' && fact.item.kind === 'link') {\n add('areas-mode', `${name(fact.item, fact.index)} is a plain link but the site records areas: 'menu'.`, fact.item)\n }\n }\n\n if (recorded) validateRecordedShape(recorded, add)\n if (recorded?.order !== undefined) {\n validateRecordedOrder(recorded, facts, add)\n } else {\n // Relative rules: only where no order is recorded.\n const home = facts.find((fact) => fact.path === '/')\n if (home && home.index > 0) add('home-first', `Home comes first when it is shown, but it is item ${home.index + 1}.`, home.item)\n const about = facts.find((fact) => fact.roles.has('about'))\n if (about && about.index > 1) {\n add('about-early', `About must be one of the first two items, but it is item ${about.index + 1}.`, about.item)\n }\n const areas = facts.find((fact) => fact.roles.has('areas'))\n if (areas) {\n const late = facts.filter((fact) => fact.index > areas.index && isServiceItem(fact))\n for (const fact of late) {\n add('services-before-areas', `Services come before Areas, but ${name(fact.item, fact.index)} follows ${name(areas.item, areas.index)}.`, fact.item)\n }\n }\n const contact = facts.find((fact) => fact.roles.has('contact'))\n const last = facts[facts.length - 1]!\n if (contact && contact !== last) {\n add('contact-last', `Contact must be the last item, but ${name(last.item, last.index)} follows it.`, contact.item)\n }\n }\n\n return findings\n}\n\nfunction validateRecordedShape(\n recorded: BrandlabRecordedNavigation,\n add: (rule: BrandlabNavigationRuleId, message: string, item?: BrandlabNavItem) => void,\n): void {\n const date = recorded.recordedOn\n if (!isText(recorded.setBy) || typeof date !== 'string' || !/^\\d{4}-\\d{2}-\\d{2}$/.test(date) || Number.isNaN(Date.parse(date))) {\n add('recorded', 'A recorded menu needs setBy (who set it) and recordedOn (the date as YYYY-MM-DD).')\n }\n if (recorded.order !== undefined) {\n const order = recorded.order\n if (!Array.isArray(order) || order.length === 0 || !order.every(isText)) {\n add('recorded', 'A recorded order lists the items in order, each by its id or key.')\n } else {\n const wanted = order.map((key) => key.trim().toLowerCase())\n const repeated = wanted.find((key, index) => wanted.indexOf(key) !== index)\n if (repeated) add('recorded', `The recorded order lists \"${repeated}\" twice.`)\n }\n }\n if (recorded.labels !== undefined) {\n const labels = recorded.labels\n const entries = labels && typeof labels === 'object' && !Array.isArray(labels) ? Object.entries(labels) : undefined\n if (!entries || !entries.every(([key, label]) => isText(key) && isText(label))) {\n add('recorded', 'Recorded labels pair an item key with its label, for example areas: \"Locations\".')\n }\n }\n if (recorded.areas !== undefined && recorded.areas !== 'link' && recorded.areas !== 'menu') {\n add('recorded', \"The recorded Areas item is 'link' or 'menu'.\")\n }\n}\n\nfunction validateRecordedOrder(\n recorded: BrandlabRecordedNavigation,\n facts: readonly Facts[],\n add: (rule: BrandlabNavigationRuleId, message: string, item?: BrandlabNavItem) => void,\n): void {\n const order = Array.isArray(recorded.order) ? recorded.order : []\n if (order.length === 0 || !order.every(isText)) return\n const wanted = order.map((key) => key.trim().toLowerCase())\n const by = isText(recorded.setBy) && isText(recorded.recordedOn) ? ` by ${recorded.setBy} on ${recorded.recordedOn}` : ''\n const count = Math.max(wanted.length, facts.length)\n for (let index = 0; index < count; index += 1) {\n const fact = facts[index]\n const key = wanted[index]\n if (fact && key !== undefined && fact.keys.includes(key)) continue\n if (!fact) {\n add('recorded', `The menu ends after \"${facts[facts.length - 1]!.item.label}\", but the order recorded${by} continues with \"${key}\" at position ${index + 1}.`)\n } else if (key === undefined) {\n add('recorded', `The menu has \"${fact.item.label}\" at position ${index + 1}, which the order recorded${by} does not list.`, fact.item)\n } else {\n add('recorded', `Position ${index + 1} should be \"${key}\" as recorded${by}, but the menu has \"${fact.item.label}\".`, fact.item)\n }\n break\n }\n}\n\n// ---------------------------------------------------------------------------\n// Building the menu\n// ---------------------------------------------------------------------------\n\nexport interface BrandlabNavigationLinkInput {\n readonly kind: 'link'\n readonly label: string\n readonly href: string\n readonly activePaths?: readonly string[]\n}\n\nexport interface BrandlabNavigationMenuInput {\n readonly kind: 'menu'\n readonly label: string\n /** The hub: the label links here, and the panel opens with a link to it. */\n readonly href: string\n /** The panel's first link, for example \"All services\". */\n readonly hubLabel: string\n /** Left out, it follows the data: `featured` when a card is given, `columns` when groups are, else `list`. */\n readonly panel?: BrandlabNavPanel\n /** The panel's links after the hub. Left out for `columns`, where the groups' links are the panel's links. */\n readonly links?: readonly BrandlabNavLink[]\n readonly groups?: readonly BrandlabNavGroup[]\n readonly featured?: BrandlabNavFeatured\n readonly activePaths?: readonly string[]\n}\n\nexport type BrandlabNavigationItemInput = BrandlabNavigationLinkInput | BrandlabNavigationMenuInput\n\nexport interface BrandlabNavigationInput {\n /** The menu in order, left to right. The phone and the quote button are not items. */\n readonly items: readonly BrandlabNavigationItemInput[]\n readonly rules: BrandlabNavigationRules\n}\n\nfunction deepFreeze<T>(value: T): T {\n if (value !== null && typeof value === 'object' && !Object.isFrozen(value)) {\n Object.freeze(value)\n for (const child of Object.values(value)) deepFreeze(child)\n }\n return value\n}\n\nfunction buildItem(input: BrandlabNavigationItemInput, index: number, problems: BrandlabNavigationFinding[]): BrandlabNavItem {\n const id = isText(input?.label) ? slug(input.label) : ''\n const activePaths = input.activePaths ? { activePaths: [...input.activePaths] } : {}\n if (input.kind === 'link') {\n return { kind: 'link', id, label: input.label, href: input.href, ...activePaths }\n }\n if (input.kind !== 'menu') {\n problems.push({ rule: 'shape', message: `Item ${index + 1} is neither a link nor a menu.` })\n }\n const flattened = input.groups?.flatMap((group) => group.links.map((link) => ({ ...link })))\n if (flattened && input.links && input.links.length > 0 && JSON.stringify(flattened) !== JSON.stringify(input.links)) {\n problems.push({\n rule: 'shape',\n message: `\"${input.label}\" gives both links and column groups, and the links are not the groups' links in order; give the groups only.`,\n })\n }\n const panel: BrandlabNavPanel = input.panel ?? (input.featured ? 'featured' : input.groups ? 'columns' : 'list')\n return {\n kind: 'menu',\n id,\n label: input.label,\n href: input.href,\n hubLabel: input.hubLabel,\n panel,\n links: flattened ?? (input.links ?? []).map((link) => ({ ...link })),\n ...(input.groups ? { groups: input.groups.map((group) => ({ heading: group.heading, links: group.links.map((link) => ({ ...link })) })) } : {}),\n ...(input.featured ? { featured: { ...input.featured, image: { ...input.featured.image } } } : {}),\n ...activePaths,\n }\n}\n\n/**\n * Builds the menu from data and enforces N1. Returns a frozen `BrandlabNavigation` with a stable id per item (the\n * slug of its label), or throws a `BrandlabNavigationError` listing every rule the menu breaks.\n *\n * A site that records no menu passes its route catalogue instead of `items` (3.14.0) and gets the default order from\n * `defaultBrandlabNavigationItems`: Home · About · Services ▾ · Areas ▾ · Our work ▾ · Blog · FAQs · Contact.\n */\nexport function defineBrandlabNavigation(input: BrandlabNavigationInput | BrandlabDefaultNavigationInput): BrandlabNavigation {\n if (input && !('items' in input) && 'routes' in input) {\n const generated = defaultBrandlabNavigation(input)\n return defineBrandlabNavigation(generated)\n }\n if (!input || !Array.isArray(input.items) || !input.rules?.pages) {\n throw new BrandlabNavigationError([{ rule: 'shape', message: 'defineBrandlabNavigation needs items and rules.pages, or the site routes.' }])\n }\n const problems: BrandlabNavigationFinding[] = []\n const nav: BrandlabNavigation = { items: input.items.map((item, index) => buildItem(item, index, problems)) }\n const findings = [...problems, ...validateBrandlabNavigation(nav, input.rules)]\n if (findings.length > 0) throw new BrandlabNavigationError(findings)\n return deepFreeze(nav)\n}\n\n// ---------------------------------------------------------------------------\n// The default menu (correction #1, 3.14.0)\n// ---------------------------------------------------------------------------\n\n/** The route fields the default menu reads (a `BrandlabRoute` from the site's route catalogue fits). */\nexport interface BrandlabNavigationRoute {\n readonly id: string\n readonly path: string\n readonly kind?: string\n /** The page's short name, used as its menu label. */\n readonly breadcrumbLabel?: string\n readonly parentId?: string\n}\n\nexport interface BrandlabDefaultNavigationInput {\n /** The site's route catalogue, in the order the services and regions should appear (money order). */\n readonly routes: readonly BrandlabNavigationRoute[]\n /** The rules context. `pages` defaults to `navigationPagesFromRoutes(routes)`. */\n readonly rules?: Omit<BrandlabNavigationRules, 'pages'> & { readonly pages?: BrandlabNavigationPages }\n /** More than 8 services: the Services panel's two or three titled columns, which the routes can't name. */\n readonly serviceGroups?: readonly BrandlabNavGroup[]\n /** The panels' first links. Defaults: \"All services\", \"All areas\" and \"Projects\". */\n readonly hubLabels?: { readonly services?: string; readonly areas?: string; readonly work?: string }\n}\n\nconst DEFAULT_HUB_LABELS = { services: 'All services', areas: 'All areas', work: 'Projects' } as const\n\nfunction routeLabel(route: BrandlabNavigationRoute): string {\n if (isText(route.breadcrumbLabel)) return route.breadcrumbLabel\n throw new BrandlabNavigationError([\n { rule: 'shape', message: `The route \"${route.id}\" (${route.path}) has no breadcrumbLabel, so the default menu has no label for it.` },\n ])\n}\n\n/** The routes of `kind` directly under the hub route (all of `kind` when none records a parent). */\nfunction childrenOf(routes: readonly BrandlabNavigationRoute[], kind: string, hub: BrandlabNavigationRoute | undefined): BrandlabNavigationRoute[] {\n const ofKind = routes.filter((route) => route.kind === kind)\n if (!hub) return ofKind.filter((route) => route.parentId === undefined)\n const under = ofKind.filter((route) => route.parentId === hub.id)\n return under.length > 0 || ofKind.some((route) => route.parentId !== undefined) ? under : ofKind\n}\n\n/**\n * The default menu for a site that records none (F1, Romie's correction #1): Home · About · Services ▾ · Areas ▾\n * (the regions and \"All areas\", or a plain link when the site has one region or more than 12) · Our work ▾ (Projects\n * and Gallery; the one that exists as a plain link otherwise) · Blog (or Guides) · FAQs · Contact. Pages the site\n * doesn't have are left out; the phone and the quote button follow the menu and are not items. Returns the input for\n * `defineBrandlabNavigation`, with `areasMode` set to match the Areas item unless the site records it.\n */\nexport function defaultBrandlabNavigation(input: BrandlabDefaultNavigationInput): BrandlabNavigationInput {\n const routes = input?.routes\n if (!Array.isArray(routes)) {\n throw new BrandlabNavigationError([{ rule: 'shape', message: 'The default menu needs the site routes.' }])\n }\n if (input.rules?.recorded?.order !== undefined) {\n throw new BrandlabNavigationError([\n { rule: 'recorded', message: 'The site records a menu order, so it passes its menu as items; the default menu is for sites that record none.' },\n ])\n }\n const pages = input.rules?.pages ?? navigationPagesFromRoutes(routes)\n const hubLabels = { ...DEFAULT_HUB_LABELS, ...input.hubLabels }\n const has = (key: BrandlabNavPageKey) => pathsOf(pages[key]).length > 0\n const hrefOf = (key: BrandlabNavPageKey) => (typeof pages[key] === 'string' ? (pages[key] as string) : (pages[key] as readonly string[] | undefined)?.find(isText)) ?? ''\n const hubRoute = (kind: string, key: BrandlabNavPageKey) =>\n routes.find((route) => route.kind === kind) ?? routes.find((route) => pathsOf(pages[key]).includes(pathKey(route.path)))\n const items: BrandlabNavigationItemInput[] = [{ kind: 'link', label: 'Home', href: '/' }, { kind: 'link', label: 'About', href: hrefOf('about') }]\n\n // Services: one dropdown of the top-level services, or a plain link to the hub when there is one or none.\n const servicesHub = hubRoute('service-index', 'services')\n const services = childrenOf(routes, 'service', servicesHub).map((route) => ({ label: routeLabel(route), href: route.path }))\n const servicesHref = servicesHub?.path ?? hrefOf('services')\n if (input.serviceGroups && input.serviceGroups.length > 0) {\n items.push({ kind: 'menu', label: 'Services', href: servicesHref, hubLabel: hubLabels.services, groups: input.serviceGroups })\n } else if (services.length > SERVICES_LIST_MAX) {\n throw new BrandlabNavigationError([\n {\n rule: 'panel',\n message: `The site has ${services.length} services; more than ${SERVICES_LIST_MAX} need a columns panel, so pass serviceGroups (two or three titled columns) to the default menu.`,\n },\n ])\n } else if (services.length >= 2) {\n items.push({ kind: 'menu', label: 'Services', href: servicesHref, hubLabel: hubLabels.services, links: services })\n } else {\n items.push({ kind: 'link', label: 'Services', href: servicesHref })\n }\n\n // Areas: the regions under the areas hub, when location routes exist.\n let areasMode: 'link' | 'menu' | undefined\n if (has('areas')) {\n const areasHub = hubRoute('location-index', 'areas')\n const areasHref = areasHub?.path ?? hrefOf('areas')\n const regions = areasHub ? routes.filter((route) => route.kind === 'location' && route.parentId === areasHub.id) : []\n const wanted = input.rules?.recorded?.areas ?? input.rules?.areasMode\n areasMode = wanted ?? (regions.length >= 2 && regions.length <= AREAS_LIST_MAX ? 'menu' : 'link')\n items.push(\n areasMode === 'menu'\n ? { kind: 'menu', label: 'Areas', href: areasHref, hubLabel: hubLabels.areas, links: regions.map((route) => ({ label: routeLabel(route), href: route.path })) }\n : { kind: 'link', label: 'Areas', href: areasHref },\n )\n }\n\n // Proof: Our work ▾ with both pages (the projects page is the hub, the gallery listed once), or the one that exists.\n const galleryPaths = pathsOf(pages.gallery)\n const projectsHref = pathsOf(pages.projects).find((path) => !galleryPaths.includes(path))\n const galleryHref = galleryPaths.find((path) => path !== projectsHref)\n if (projectsHref && galleryHref) {\n items.push({ kind: 'menu', label: 'Our work', href: projectsHref, hubLabel: hubLabels.work, links: [{ label: 'Gallery', href: galleryHref }] })\n } else if (projectsHref) {\n items.push({ kind: 'link', label: 'Projects', href: projectsHref })\n } else if (galleryHref) {\n items.push({ kind: 'link', label: 'Gallery', href: galleryHref })\n }\n\n if (has('guides')) {\n const href = hrefOf('guides')\n items.push({ kind: 'link', label: /(^|\\/)blog(\\/|$)/i.test(href) ? 'Blog' : 'Guides', href })\n }\n if (has('faqs')) items.push({ kind: 'link', label: 'FAQs', href: hrefOf('faqs') })\n items.push({ kind: 'link', label: 'Contact', href: hrefOf('contact') })\n\n const { pages: _pages, ...rest } = input.rules ?? {}\n return { items, rules: { ...rest, pages, ...(areasMode && rest.areasMode === undefined && !rest.recorded?.areas ? { areasMode } : {}) } }\n}\n\n// ---------------------------------------------------------------------------\n// Fit: the fold order\n// ---------------------------------------------------------------------------\n\n/** When the menu does not fit at the declared desktop width (check N7), these steps apply in this order. */\nexport const BRANDLAB_NAV_FOLD_ORDER = ['resources', 'hide-home', 'raise-breakpoint'] as const\nexport type BrandlabNavFoldStep = (typeof BRANDLAB_NAV_FOLD_ORDER)[number]\n\nexport interface BrandlabNavFoldOptions {\n readonly rules: BrandlabNavigationRules\n /** The first link in the Resources panel, for example \"All guides\". */\n readonly hubLabel: string\n /** The money services' cost guides, listed after the hub and before FAQs. */\n readonly costGuides?: readonly BrandlabNavLink[]\n}\n\n/**\n * Applies the model's fold steps in order, up to and including `step`: fold Guides and FAQs into \"Resources ▾\",\n * then hide Home. The third step (raise the breakpoint) is the header's, not the menu's. A recorded order is never\n * folded. The result is checked against N1 again.\n */\nexport function foldBrandlabNavigation(\n nav: BrandlabNavigation,\n step: Exclude<BrandlabNavFoldStep, 'raise-breakpoint'>,\n options: BrandlabNavFoldOptions,\n): BrandlabNavigation {\n if (options.rules.recorded) {\n throw new BrandlabNavigationError([\n { rule: 'recorded', message: 'A recorded order is reproduced exactly, so it is not folded; raise the desktop breakpoint instead.' },\n ])\n }\n let items = [...nav.items]\n const pages = options.rules.pages\n const find = (key: 'guides' | 'faqs') =>\n items.find((item): item is BrandlabNavLinkItem => item.kind === 'link' && pathsOf(pages[key]).includes(pathKey(item.href)))\n const guides = find('guides')\n const faqs = find('faqs')\n if (guides && faqs) {\n const resources: BrandlabNavMenuItem = {\n kind: 'menu',\n id: 'resources',\n label: 'Resources',\n href: guides.href,\n hubLabel: options.hubLabel,\n panel: 'list',\n links: [...(options.costGuides ?? []), { label: faqs.label, href: faqs.href }],\n activePaths: [...(guides.activePaths ?? []), faqs.href, ...(faqs.activePaths ?? [])],\n }\n const first = Math.min(items.indexOf(guides), items.indexOf(faqs))\n items = items.filter((item) => item !== guides && item !== faqs)\n items.splice(first, 0, resources)\n }\n if (step === 'hide-home') items = items.filter((item) => !(usableHref(item.href) && pathKey(item.href) === '/'))\n return defineBrandlabNavigation({\n items: items.map((item) =>\n item.kind === 'link'\n ? item\n : { ...item, panel: item.panel, links: item.groups ? undefined : item.links },\n ),\n rules: options.rules,\n })\n}\n"]}
@@ -5,7 +5,7 @@
5
5
  * list. The hero or page header comes first and the CTA band last; a site may record an alternative order per family.
6
6
  * The permit note is a line inside `LocalFacts` (permit trades), not a section of its own.
7
7
  *
8
- * `planSectionSequence` is the sequencer's logic (F15), shared by `SectionSequence` in site-next and the K8 and K12
8
+ * `planSectionSequence` is the sequencer's logic (F15), shared by a site's own section sequencer and the K8 and K12
9
9
  * checks: skip what has nothing true to show, enforce the cap (only optional and recommended sections drop),
10
10
  * alternate the light tones so neighbours differ (at most one `band` and one `photo`) and write the per-page manifest.
11
11
  *
@@ -5,7 +5,7 @@
5
5
  * list. The hero or page header comes first and the CTA band last; a site may record an alternative order per family.
6
6
  * The permit note is a line inside `LocalFacts` (permit trades), not a section of its own.
7
7
  *
8
- * `planSectionSequence` is the sequencer's logic (F15), shared by `SectionSequence` in site-next and the K8 and K12
8
+ * `planSectionSequence` is the sequencer's logic (F15), shared by a site's own section sequencer and the K8 and K12
9
9
  * checks: skip what has nothing true to show, enforce the cap (only optional and recommended sections drop),
10
10
  * alternate the light tones so neighbours differ (at most one `band` and one `photo`) and write the per-page manifest.
11
11
  *
@@ -1 +1 @@
1
- {"version":3,"file":"section-order.js","sourceRoot":"","sources":["../src/section-order.ts"],"names":[],"mappings":"AAA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,EAAE,SAAS,EAAE,SAAS,CAAC,SAAS,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;gBACxF,GAAG,CAAC,IAAI,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;aAC3D,CAAA;QACH,CAAC,CAAC;QACF,OAAO;QACP,OAAO,EAAE,OAAO,EAAE;QAClB,KAAK,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,EAAE;KACrD,CAAA;IACD,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAA;AAC/B,CAAC","sourcesContent":["/**\n * Section order (v2 §3.3 matrix part A; LIB §7a for hubs and company pages). Every page family has a default order of\n * sections, each required (R: skipped only when nothing true exists, and the manifest says why), conditional (C:\n * renders when its data exists), recommended (Rec) or optional (O). Sections a family doesn't use (N) are not in its\n * list. The hero or page header comes first and the CTA band last; a site may record an alternative order per family.\n * The permit note is a line inside `LocalFacts` (permit trades), not a section of its own.\n *\n * `planSectionSequence` is the sequencer's logic (F15), shared by `SectionSequence` in site-next and the K8 and K12\n * checks: skip what has nothing true to show, enforce the cap (only optional and recommended sections drop),\n * alternate the light tones so neighbours differ (at most one `band` and one `photo`) and write the per-page manifest.\n *\n * 3.16.0: the strips (the proof strip and the emergency band) and the site's signature sections don't count toward the\n * cap (`UNCAPPED_SECTIONS`), so a trade band never pushes out the page's own content, and a signature section takes\n * the place the site declares (`after`), up to `SIGNATURE_LIMITS` per family.\n */\n\nexport const BRANDLAB_SECTION_IDS = [\n 'hero',\n 'page-header',\n 'article-header',\n // 3.19.1: a guide's article text, which may hold many H2s and lists (exempt from K8's and K11's one-H2 and card rules).\n 'article-body',\n 'answer',\n 'proof-strip',\n 'emergency',\n 'services',\n 'local-facts',\n 'council-rules',\n 'nearby-jobs',\n 'service-detail',\n 'price-guide',\n 'projects',\n 'before-after',\n 'gallery',\n 'reviews',\n 'comparison',\n 'about-owner',\n 'signature',\n 'process',\n 'guarantee',\n 'licences',\n 'partners',\n 'team',\n 'coverage',\n 'area-map',\n 'faqs',\n 'nearby-areas',\n 'related-services',\n 'guides',\n 'contact',\n 'cta',\n] as const\nexport type BrandlabSectionId = (typeof BRANDLAB_SECTION_IDS)[number]\n\nexport const BRANDLAB_PAGE_FAMILIES = [\n 'home',\n 'service',\n 'service-in-suburb',\n 'region',\n 'suburb',\n 'cost-guide',\n 'services-hub',\n 'locations-hub',\n 'projects-hub',\n 'project',\n 'gallery',\n 'reviews',\n 'about',\n 'faqs',\n 'contact',\n 'guides-hub',\n 'guide',\n 'council',\n 'emergency',\n] as const\nexport type BrandlabPageFamily = (typeof BRANDLAB_PAGE_FAMILIES)[number]\n\n/** R required, C conditional, Rec recommended, O optional (N, not used, is simply absent from a family's list). */\nexport const BRANDLAB_SECTION_REQUIREMENTS = ['R', 'C', 'Rec', 'O'] as const\nexport type BrandlabSectionRequirement = (typeof BRANDLAB_SECTION_REQUIREMENTS)[number]\n\n/** The section tones: two alternating grounds, one optional band and one optional photo ground. */\nexport const BRANDLAB_SECTION_TONES = ['canvas', 'surface', 'band', 'photo'] as const\nexport type BrandlabSectionTone = (typeof BRANDLAB_SECTION_TONES)[number]\n\n/** What a section asks for: a light tone the sequencer picks (`auto`), the page's one band or its one photo ground. */\nexport type BrandlabSectionToneRequest = 'auto' | 'band' | 'photo'\n\nexport interface BrandlabSectionOrderEntry {\n readonly id: BrandlabSectionId\n readonly requirement: BrandlabSectionRequirement\n /** Sections that may fill this place instead, for example `before-after` for `projects`. */\n readonly alternatives?: readonly BrandlabSectionId[]\n /** Shares one matrix position with that section: when both render they count once toward the cap. */\n readonly countsWith?: BrandlabSectionId\n /** A strip or signature section (3.16.0): it renders under the usual rules but never counts toward the cap. */\n readonly uncapped?: true\n}\n\nexport interface BrandlabFamilyOrder {\n readonly family: BrandlabPageFamily\n /** The most sections the page renders (v1 §7.1). */\n readonly cap: number\n readonly source: 'default' | 'recorded'\n readonly entries: readonly BrandlabSectionOrderEntry[]\n}\n\n/**\n * 11 on home and service-in-suburb pages, 12 on service, region and suburb pages, 6 on hubs and company pages. The\n * sections in `UNCAPPED_SECTIONS` don't count toward them.\n */\nexport const SECTION_CAPS: Readonly<Record<BrandlabPageFamily, number>> = Object.freeze({\n home: 11,\n service: 12,\n 'service-in-suburb': 11,\n region: 12,\n suburb: 12,\n 'cost-guide': 12,\n 'services-hub': 6,\n 'locations-hub': 6,\n 'projects-hub': 6,\n project: 6,\n gallery: 6,\n reviews: 6,\n about: 6,\n faqs: 6,\n contact: 6,\n 'guides-hub': 6,\n guide: 6,\n council: 6,\n emergency: 6,\n})\n\ntype Row = readonly [\n BrandlabSectionId,\n BrandlabSectionRequirement,\n (readonly BrandlabSectionId[] | undefined)?,\n BrandlabSectionId?,\n]\n\nconst PROJECTS: Row = ['projects', 'C', ['before-after']]\n\n/**\n * Sections that never count toward the cap (3.16.0): the two strips, which sit straight under the hero (the proof\n * strip and a trade's emergency band), and the site's signature sections, which `SIGNATURE_LIMITS` bounds instead. The\n * cap holds the page's own content sections, so a conditional trade band can't push one out.\n */\nexport const UNCAPPED_SECTIONS: readonly BrandlabSectionId[] = Object.freeze(['proof-strip', 'emergency', 'signature'])\n\n/**\n * The most signature sections a page renders (v2 §7.7: up to two on the home page and one on service pages). Families\n * not listed take none, and their order has no `signature` place.\n */\nexport const SIGNATURE_LIMITS: Readonly<Partial<Record<BrandlabPageFamily, number>>> = Object.freeze({ home: 2, service: 1 })\n\n/** A signature section's name (`data-bl-signature`): lower-case words joined by hyphens, for example `storm-line`. */\nexport const SIGNATURE_NAME_PATTERN = /^[a-z0-9]+(?:-[a-z0-9]+)*$/\n\n/** The defaults, in order. `EmergencyBand` has no number in the matrix; it sits straight after the proof strip. */\nconst DEFAULT_ROWS: Readonly<Record<BrandlabPageFamily, readonly Row[]>> = {\n home: [\n ['hero', 'R'],\n ['proof-strip', 'R'],\n ['emergency', 'C'],\n ['services', 'R'],\n PROJECTS,\n // 3.16.0: genuine job photos beside the projects, as on the service pages.\n ['gallery', 'O'],\n ['reviews', 'C'],\n ['price-guide', 'Rec'],\n ['about-owner', 'O'],\n ['signature', 'O'],\n ['process', 'O'],\n ['guarantee', 'O'],\n ['coverage', 'R'],\n ['faqs', 'Rec'],\n ['guides', 'C'],\n ['cta', 'R'],\n ],\n service: [\n ['hero', 'R'],\n ['proof-strip', 'R'],\n ['emergency', 'C'],\n ['service-detail', 'R'],\n ['price-guide', 'R'],\n PROJECTS,\n // 3.15.0: genuine job photos beside the projects, when the site has them.\n ['gallery', 'O'],\n ['reviews', 'C'],\n ['about-owner', 'O'],\n ['comparison', 'O'],\n ['signature', 'O'],\n ['process', 'O'],\n ['guarantee', 'C'],\n ['faqs', 'R'],\n ['related-services', 'C'],\n ['coverage', 'C'],\n ['guides', 'C'],\n ['cta', 'R'],\n ],\n 'service-in-suburb': [\n ['hero', 'R'],\n ['proof-strip', 'R'],\n ['emergency', 'C'],\n ['local-facts', 'R'],\n ['nearby-jobs', 'R'],\n ['price-guide', 'R'],\n ['service-detail', 'R'],\n ['reviews', 'R'],\n ['faqs', 'R'],\n ['nearby-areas', 'R'],\n ['related-services', 'R', undefined, 'nearby-areas'],\n ['cta', 'R'],\n ],\n region: [\n ['hero', 'R'],\n ['proof-strip', 'R'],\n ['service-detail', 'R'],\n ['services', 'R'],\n PROJECTS,\n ['reviews', 'C'],\n ['price-guide', 'C'],\n ['coverage', 'R'],\n ['faqs', 'R'],\n ['area-map', 'O'],\n ['cta', 'R'],\n ],\n suburb: [\n ['hero', 'R'],\n ['proof-strip', 'R'],\n ['local-facts', 'R'],\n ['services', 'R'],\n ['price-guide', 'C'],\n ['nearby-jobs', 'C'],\n ['reviews', 'C'],\n ['faqs', 'R'],\n // 3.15.0: the nearest served suburbs (NearbyAreas), then the locator map (AreaMap). Conditional: L3 holds any\n // neighbour list to real distance but no check needs one on a suburb page, so it renders when there are neighbours.\n ['nearby-areas', 'C'],\n ['area-map', 'R'],\n ['cta', 'R'],\n ],\n // 3.19.1: the library's PageHeader may fill the article header's place on cost guides and guides.\n 'cost-guide': [\n ['article-header', 'R', ['page-header']],\n ['answer', 'R'],\n ['price-guide', 'R'],\n ['service-detail', 'R'],\n ['comparison', 'O'],\n PROJECTS,\n ['faqs', 'Rec'],\n ['cta', 'R'],\n ],\n 'services-hub': [\n ['page-header', 'R'],\n ['services', 'R'],\n ['reviews', 'C'],\n ['cta', 'R'],\n ],\n 'locations-hub': [\n ['page-header', 'R'],\n ['coverage', 'R'],\n ['cta', 'R'],\n ],\n 'projects-hub': [\n ['page-header', 'R'],\n ['projects', 'R'],\n ['reviews', 'C'],\n ['cta', 'R'],\n ],\n project: [\n ['hero', 'R', ['page-header']],\n ['gallery', 'R'],\n ['service-detail', 'R'],\n ['reviews', 'C'],\n ['related-services', 'R'],\n ['cta', 'R'],\n ],\n gallery: [\n ['page-header', 'R'],\n ['gallery', 'R'],\n ['cta', 'R'],\n ],\n reviews: [\n ['page-header', 'R'],\n ['reviews', 'R'],\n ['cta', 'R'],\n ],\n // 3.19.0: genuine job photos on the about page (`gallery`), optional.\n about: [\n ['page-header', 'R'],\n ['about-owner', 'R'],\n ['licences', 'C'],\n ['partners', 'C'],\n ['reviews', 'C'],\n ['team', 'O'],\n ['gallery', 'O'],\n ['cta', 'R'],\n ],\n faqs: [\n ['page-header', 'R'],\n ['faqs', 'R'],\n ['cta', 'R'],\n ],\n // The contact page is the page header and the contact block, and nothing else (K12-contact).\n contact: [\n ['page-header', 'R'],\n ['contact', 'R'],\n ],\n 'guides-hub': [\n ['page-header', 'R'],\n ['guides', 'R'],\n ['cta', 'R'],\n ],\n // 3.19.0: the article's related projects and further guides, both optional. 3.19.1: the article's text is\n // `article-body` (a `service-detail` still fills the place), and the library's PageHeader may be the article header.\n guide: [\n ['article-header', 'R', ['page-header']],\n ['article-body', 'R', ['service-detail']],\n ['projects', 'O'],\n ['guides', 'O'],\n ['cta', 'R'],\n ],\n // `council-rules` (3.15.0): the council register's rule, fees, source and check date (CouncilRules). Optional by\n // default; a permit trade makes it conditional on a current register record.\n council: [\n ['page-header', 'R'],\n ['council-rules', 'O'],\n ['service-detail', 'R'],\n ['cta', 'R'],\n ],\n // 3.15.0: optional FAQs before the CTA band (AA's emergency tree work page answers storm and after-hours questions).\n emergency: [\n ['hero', 'R'],\n ['emergency', 'R'],\n ['service-detail', 'R'],\n ['reviews', 'C'],\n ['faqs', 'O'],\n ['cta', 'R'],\n ],\n}\n\nfunction toEntry([id, requirement, alternatives, countsWith]: Row): BrandlabSectionOrderEntry {\n return Object.freeze({\n id,\n requirement,\n ...(alternatives ? { alternatives: Object.freeze([...alternatives]) } : {}),\n ...(countsWith ? { countsWith } : {}),\n ...(UNCAPPED_SECTIONS.includes(id) ? { uncapped: true as const } : {}),\n })\n}\n\n/** The playbook trades (v2 §5, matrix part B). */\nexport const BRANDLAB_TRADES = [\n 'building',\n 'electrical',\n 'exterior',\n 'interiors',\n 'landscaping',\n 'plumbing',\n 'pools',\n 'renovations',\n 'roofing',\n 'tiling',\n 'trees',\n] as const\nexport type BrandlabTrade = (typeof BRANDLAB_TRADES)[number]\n\n/** A trade's changes to the defaults: a new requirement for a section already in a family's order. */\nexport type BrandlabTradeSectionRules = Readonly<\n Partial<Record<BrandlabPageFamily, Readonly<Partial<Record<BrandlabSectionId, BrandlabSectionRequirement>>>>>\n>\n\n/**\n * Lines inside a section that a trade can require (3.14.0): the permit note is `LocalFacts`' `permit` slot; the\n * qualifications and insurance lines stand in for a licence block where the trade has no licence. A component marks\n * each slot it renders with `data-bl-slot=\"<slot>\"`; when its data is missing or stale it renders nothing for the slot\n * and lists `<slot>:<no-… reason>` in the section's `data-bl-slot-skip` attribute (check K12-slots reads both).\n */\n/** `experience` and `established` (3.19.0) are the Licences ledger's optional lines. */\nexport const BRANDLAB_SECTION_SLOTS = ['permit', 'qualifications', 'insurance', 'licence', 'experience', 'established'] as const\nexport type BrandlabSectionSlot = (typeof BRANDLAB_SECTION_SLOTS)[number]\n\nexport const SECTION_SLOT_ATTRIBUTE = 'data-bl-slot'\nexport const SECTION_SLOT_SKIP_ATTRIBUTE = 'data-bl-slot-skip'\n\n/** A slot left empty for a data-backed reason, such as `{ slot: 'permit', reason: 'no-current-council-record' }`. */\nexport interface BrandlabSectionSlotSkip {\n readonly slot: BrandlabSectionSlot\n readonly reason: `no-${string}`\n}\n\n/** The `data-bl-slot-skip` value: space-separated `slot:reason` pairs. */\nexport function formatSectionSlotSkips(skips: readonly BrandlabSectionSlotSkip[]): string {\n return skips\n .map((skip) => {\n if (!(BRANDLAB_SECTION_SLOTS as readonly string[]).includes(skip.slot)) throw new Error(`Unknown section slot \"${skip.slot}\".`)\n if (!/^no-[a-z0-9]+(?:-[a-z0-9]+)*$/.test(skip.reason)) throw new Error(`A slot skip reason says what data is missing: \"no-…\", not \"${skip.reason}\".`)\n return `${skip.slot}:${skip.reason}`\n })\n .join(' ')\n}\n\n/** Reads a `data-bl-slot-skip` value; pairs that are not `slot:no-…` are ignored. */\nexport function parseSectionSlotSkips(value: string | undefined): BrandlabSectionSlotSkip[] {\n return (value ?? '')\n .split(/\\s+/)\n .flatMap((pair): BrandlabSectionSlotSkip[] => {\n const [slot, reason] = pair.split(':')\n return slot && reason && (BRANDLAB_SECTION_SLOTS as readonly string[]).includes(slot) && /^no-[a-z0-9]+(?:-[a-z0-9]+)*$/.test(reason)\n ? [{ slot: slot as BrandlabSectionSlot, reason: reason as `no-${string}` }]\n : []\n })\n}\n\n/** Slots a trade requires inside a family's sections. */\nexport type BrandlabTradeSlotRules = Readonly<\n Partial<Record<BrandlabPageFamily, Readonly<Partial<Record<BrandlabSectionId, readonly BrandlabSectionSlot[]>>>>>\n>\n\n/**\n * One trade's column of matrix part B: its credential block (a licence block, or qualifications and insurance where\n * the trade has no licence), its section requirement changes and the slots it requires. `unconfirmed` trades keep the\n * defaults until their playbook's rules are confirmed (licence classes, permit notes and emergency work are\n * \"inferred, confirm\" in the matrix).\n */\nexport interface BrandlabTradeProfile {\n readonly credentials: 'licence' | 'qualifications' | 'unconfirmed'\n readonly sections: BrandlabTradeSectionRules\n readonly slots: BrandlabTradeSlotRules\n /** Where the rules come from. */\n readonly source: string\n}\n\nconst UNCONFIRMED: BrandlabTradeProfile = Object.freeze({\n credentials: 'unconfirmed',\n sections: Object.freeze({}),\n slots: Object.freeze({}),\n source: 'Defaults until the playbook rules are confirmed (v2 §3.4).',\n})\n\n/** Validates trade profiles: requirement changes and slots name sections the family uses, and known slots. */\nexport function defineTradeProfiles<const T extends Readonly<Record<BrandlabTrade, BrandlabTradeProfile>>>(profiles: T): T {\n for (const [trade, profile] of Object.entries(profiles) as [string, BrandlabTradeProfile][]) {\n if (!(BRANDLAB_TRADES as readonly string[]).includes(trade)) throw new Error(`Unknown trade \"${trade}\".`)\n if (!['licence', 'qualifications', 'unconfirmed'].includes(profile.credentials)) {\n throw new Error(`Trade ${trade}: credentials must be licence, qualifications or unconfirmed.`)\n }\n const check = (rules: object, kind: string, value: (sectionValue: unknown, where: string) => void) => {\n for (const [family, sections] of Object.entries(rules)) {\n const rows = DEFAULT_ROWS[family as BrandlabPageFamily]\n if (!rows) throw new Error(`Trade ${trade}: unknown page family \"${family}\" in its ${kind}.`)\n for (const [section, sectionValue] of Object.entries(sections as object)) {\n if (!rows.some((row) => row[0] === section)) throw new Error(`Trade ${trade}: ${family} pages have no \"${section}\" section for its ${kind}.`)\n value(sectionValue, `Trade ${trade}: ${family} \"${section}\"`)\n }\n }\n }\n check(profile.sections, 'requirements', (requirement, where) => {\n if (!(BRANDLAB_SECTION_REQUIREMENTS as readonly unknown[]).includes(requirement)) throw new Error(`${where} has an unknown requirement.`)\n })\n check(profile.slots, 'slots', (slots, where) => {\n if (!Array.isArray(slots) || slots.length === 0 || slots.some((slot) => !(BRANDLAB_SECTION_SLOTS as readonly unknown[]).includes(slot))) {\n throw new Error(`${where} lists an unknown slot; slots are ${BRANDLAB_SECTION_SLOTS.join(', ')}.`)\n }\n })\n }\n return profiles\n}\n\n/**\n * Matrix part B, as confirmed (3.14.0). Trees: no NSW licence for tree work, so the licence block is optional and the\n * about page's owner block carries the qualifications and insurance lines (or, from 3.19.1, the page's Licences ledger\n * does, which K12-slots accepts in their place); the council permit note is required on\n * suburb and service-in-suburb pages (hidden, with its reason, once the council record is stale), and council pages\n * show the council's rules whenever the register holds a current record (3.15.0). The other trades\n * stay on the defaults until their rules are confirmed.\n */\nexport const SECTION_TRADE_PROFILES: Readonly<Record<BrandlabTrade, BrandlabTradeProfile>> = Object.freeze(\n defineTradeProfiles({\n ...(Object.fromEntries(BRANDLAB_TRADES.map((trade) => [trade, UNCONFIRMED])) as Record<BrandlabTrade, BrandlabTradeProfile>),\n trees: Object.freeze({\n credentials: 'qualifications',\n sections: Object.freeze({ about: Object.freeze({ licences: 'O' }), council: Object.freeze({ 'council-rules': 'C' }) }),\n slots: Object.freeze({\n suburb: Object.freeze({ 'local-facts': Object.freeze(['permit'] as const) }),\n 'service-in-suburb': Object.freeze({ 'local-facts': Object.freeze(['permit'] as const) }),\n about: Object.freeze({ 'about-owner': Object.freeze(['qualifications', 'insurance'] as const) }),\n }),\n source: 'v2 §3.4 matrix part B (trees row); playbook-trees §2.3 (permit slot, rows 2 and 6), §2.4 (council register) and §1.7 (no tree-work licence).',\n }),\n }),\n)\n\n/** The trade map (matrix part B): each trade's section requirement changes, from `SECTION_TRADE_PROFILES`. */\nexport const SECTION_ORDER_TRADE_MAP: Readonly<Record<BrandlabTrade, BrandlabTradeSectionRules>> = Object.freeze(\n Object.fromEntries(BRANDLAB_TRADES.map((trade) => [trade, SECTION_TRADE_PROFILES[trade].sections])) as Record<BrandlabTrade, BrandlabTradeSectionRules>,\n)\n\n/** The slots a trade requires on a family's pages, section by section, in the order the profile lists them. */\nexport function requiredSectionSlots(\n family: BrandlabPageFamily,\n trade?: BrandlabTrade,\n profiles: Readonly<Partial<Record<BrandlabTrade, BrandlabTradeProfile>>> = SECTION_TRADE_PROFILES,\n): { readonly section: BrandlabSectionId; readonly slot: BrandlabSectionSlot }[] {\n const rules = trade ? profiles[trade]?.slots[family] : undefined\n if (!rules) return []\n return (Object.entries(rules) as [BrandlabSectionId, readonly BrandlabSectionSlot[]][]).flatMap(([section, slots]) =>\n slots.map((slot) => ({ section, slot })),\n )\n}\n\n/** A family's default order, with the trade's rules applied. */\nexport function defaultSectionOrder(\n family: BrandlabPageFamily,\n trade?: BrandlabTrade,\n tradeMap: Readonly<Partial<Record<BrandlabTrade, BrandlabTradeSectionRules>>> = SECTION_ORDER_TRADE_MAP,\n): BrandlabFamilyOrder {\n const rows = DEFAULT_ROWS[family]\n if (!rows) throw new Error(`Unknown page family \"${family}\".`)\n const rules = trade ? tradeMap[trade]?.[family] : undefined\n const entries = rows.map((row) => {\n const requirement = rules?.[row[0]]\n return toEntry(requirement ? [row[0], requirement, row[2], row[3]] : row)\n })\n return Object.freeze({ family, cap: SECTION_CAPS[family], source: 'default', entries: Object.freeze(entries) })\n}\n\n/** A site's recorded alternative order for one family (LIB §7a), with the decision that recorded it. */\nexport interface BrandlabRecordedSectionOrder {\n readonly order: readonly BrandlabSectionId[]\n /** Who decided and why, for example \"Romie, 19 Oct 2026: reviews before prices for Superior\". */\n readonly decision: string\n /** YYYY-MM-DD. */\n readonly recordedOn: string\n}\n\nexport interface BrandlabSectionOrderInput {\n readonly trade?: BrandlabTrade\n readonly recorded?: Readonly<Partial<Record<BrandlabPageFamily, BrandlabRecordedSectionOrder>>>\n}\n\nexport type BrandlabSectionOrders = Readonly<Record<BrandlabPageFamily, BrandlabFamilyOrder>>\n\nconst ISO_DATE = /^\\d{4}-\\d{2}-\\d{2}$/\n\nfunction recordedOrder(base: BrandlabFamilyOrder, recorded: BrandlabRecordedSectionOrder): BrandlabFamilyOrder {\n const family = base.family\n const fail = (detail: string): never => {\n throw new Error(`Recorded section order for ${family}: ${detail}`)\n }\n if (family === 'contact') fail('the contact page is the page header and the contact block, and nothing else.')\n if (typeof recorded.decision !== 'string' || !recorded.decision.trim()) fail('decision must say who decided and why.')\n if (typeof recorded.recordedOn !== 'string' || !ISO_DATE.test(recorded.recordedOn) || Number.isNaN(Date.parse(recorded.recordedOn))) {\n fail('recordedOn must be a YYYY-MM-DD date.')\n }\n if (!Array.isArray(recorded.order) || recorded.order.length === 0) fail('order must list the sections.')\n const byId = new Map(base.entries.map((entry) => [entry.id, entry]))\n const seen = new Set<string>()\n for (const id of recorded.order) {\n if (!byId.has(id)) fail(`\"${id}\" is not used on ${family} pages.`)\n if (seen.has(id)) fail(`\"${id}\" appears twice.`)\n seen.add(id)\n }\n for (const entry of base.entries) {\n if ((entry.requirement === 'R' || entry.requirement === 'C') && !seen.has(entry.id)) {\n fail(`\"${entry.id}\" is ${entry.requirement === 'R' ? 'required' : 'conditional'} and must stay in the order.`)\n }\n }\n const first = base.entries[0]?.id\n const last = base.entries[base.entries.length - 1]?.id\n if (recorded.order[0] !== first) fail(`\"${first}\" comes first.`)\n if (last === 'cta' && recorded.order[recorded.order.length - 1] !== 'cta') fail('the CTA band comes last.')\n const proof = recorded.order.indexOf('proof-strip')\n if (proof >= 5) fail('the proof strip stays within the first five sections.')\n return Object.freeze({\n family,\n cap: base.cap,\n source: 'recorded',\n entries: Object.freeze(recorded.order.map((id) => byId.get(id) as BrandlabSectionOrderEntry)),\n })\n}\n\n/**\n * Declares a site's section orders (`src/data/strategy.ts`): the defaults for every family, the trade's rules and any\n * recorded alternative orders. A recorded order keeps every required and conditional section, the first section\n * first, the CTA band last and the proof strip within the first five; the contact page can't be reordered.\n */\nexport function defineSectionOrder(\n input: BrandlabSectionOrderInput = {},\n tradeMap: Readonly<Partial<Record<BrandlabTrade, BrandlabTradeSectionRules>>> = SECTION_ORDER_TRADE_MAP,\n): BrandlabSectionOrders {\n if (input.trade !== undefined && !(BRANDLAB_TRADES as readonly string[]).includes(input.trade)) {\n throw new Error(`Unknown trade \"${input.trade}\".`)\n }\n for (const family of Object.keys(input.recorded ?? {})) {\n if (!(BRANDLAB_PAGE_FAMILIES as readonly string[]).includes(family)) throw new Error(`Unknown page family \"${family}\".`)\n }\n const orders = Object.fromEntries(\n BRANDLAB_PAGE_FAMILIES.map((family) => {\n const base = defaultSectionOrder(family, input.trade, tradeMap)\n const recorded = input.recorded?.[family]\n return [family, recorded ? recordedOrder(base, recorded) : base]\n }),\n ) as Record<BrandlabPageFamily, BrandlabFamilyOrder>\n return Object.freeze(orders)\n}\n\n/** The reasons the sequencer itself skips a section. */\nexport const SEQUENCER_SKIP_REASONS = ['not-provided', 'not-in-order', 'duplicate', 'cap', 'limit'] as const\nexport type BrandlabSequencerSkipReason = (typeof SEQUENCER_SKIP_REASONS)[number]\n\n/**\n * A section's own, data-backed reason for rendering nothing: the data it needs isn't there (`no-feed-reviews`,\n * `no-approved-prices`, `no-jobs-nearby`, `no-faqs` and so on), its content belongs in the hero checklist, or (3.18.0,\n * `nearby-areas` only) the nearby suburbs are the area map's place list, one section for the map and its places.\n */\nexport type BrandlabSectionDataReason = `no-${string}` | 'merge-into-hero-checklist' | 'merge-into-area-map'\nexport type BrandlabSectionSkipReason = BrandlabSectionDataReason | BrandlabSequencerSkipReason\n\n/** A section's guard, computed from the same data it renders: render, or render nothing and say why. */\nexport type BrandlabSectionReadiness =\n | { readonly render: true }\n | { readonly render: false; readonly reason: BrandlabSectionDataReason }\n\nexport const SECTION_READY: BrandlabSectionReadiness = Object.freeze({ render: true })\n\n/** Whether a skip reason says the data isn't there (as opposed to the sequencer's own reasons). */\nexport function isDataBackedSkipReason(reason: string): reason is BrandlabSectionDataReason {\n return reason === 'merge-into-hero-checklist' || reason === 'merge-into-area-map' || /^no-[a-z0-9]+(?:-[a-z0-9]+)*$/.test(reason)\n}\n\n/** The attribute on the manifest's `<script type=\"application/json\">`. */\nexport const SECTION_MANIFEST_ATTRIBUTE = 'data-bl-manifest'\n\n/**\n * Page-level notes in the manifest. `cap-exceeded`: the required and conditional sections with data are more than\n * the cap, so they all render (neither drops for the cap) and the page is over its cap.\n */\nexport const SECTION_MANIFEST_FLAGS = ['cap-exceeded'] as const\nexport type BrandlabSectionManifestFlag = (typeof SECTION_MANIFEST_FLAGS)[number]\n\n/**\n * The per-page manifest K12 reads: what was planned, what rendered with which tone, and what was skipped and why. A\n * signature section carries its name (`signature`) and, when the site placed it, the section it follows (`after`).\n */\nexport interface BrandlabSectionManifest {\n readonly version: 1\n readonly family: BrandlabPageFamily\n readonly page?: string\n readonly cap: number\n readonly order: 'default' | 'recorded'\n readonly planned: readonly { readonly id: BrandlabSectionId; readonly requirement: BrandlabSectionRequirement }[]\n /** `id` is the planned place; `section` is what filled it (an alternative such as `before-after`, or the same id). */\n readonly rendered: readonly {\n readonly id: BrandlabSectionId\n readonly section: BrandlabSectionId\n readonly requirement: BrandlabSectionRequirement\n readonly tone: BrandlabSectionTone\n readonly signature?: string\n readonly after?: BrandlabSectionId\n }[]\n readonly skipped: readonly {\n readonly id: BrandlabSectionId\n readonly section: BrandlabSectionId\n readonly requirement: BrandlabSectionRequirement | 'N'\n readonly reason: BrandlabSectionSkipReason\n readonly signature?: string\n }[]\n /**\n * The rendered sections counted toward the cap: sections sharing one matrix position count once, and the strips and\n * signature sections (`UNCAPPED_SECTIONS`) not at all.\n */\n readonly counted: number\n readonly flags: readonly BrandlabSectionManifestFlag[]\n}\n\n/** One section a page offers the sequencer. */\nexport interface BrandlabSequenceCandidate {\n readonly id: BrandlabSectionId\n /** Defaults to ready. */\n readonly ready?: BrandlabSectionReadiness\n /** Defaults to `auto`. */\n readonly tone?: BrandlabSectionToneRequest\n /** A `signature` section's name (3.16.0), required for one: lower-case words joined by hyphens. */\n readonly signature?: string\n /**\n * Where a `signature` section goes (3.16.0): straight after this section of the family's order, or after the nearest\n * section before it that renders. Not before the proof strip, and never after the CTA band. Without it, the\n * signature takes the order's own `signature` place.\n */\n readonly after?: BrandlabSectionId\n}\n\nexport interface BrandlabSequencePlan {\n /** What renders, in order: the candidate's index, the planned place and the tone. */\n readonly rendered: readonly { readonly candidate: number; readonly id: BrandlabSectionId; readonly tone: BrandlabSectionTone }[]\n readonly manifest: BrandlabSectionManifest\n}\n\n/**\n * Tones for the sections that render, in order. `auto` sections alternate canvas and surface, so neighbours never\n * share a background; after a band or photo section the next light tone is the one the last light section didn't\n * have (Omega's `alternateTones`). Only the first `band` request and the first `photo` request are honoured, and\n * never twice in a row; later requests fall back to the light tones.\n */\nexport function assignSectionTones(requests: readonly BrandlabSectionToneRequest[]): BrandlabSectionTone[] {\n const tones: BrandlabSectionTone[] = []\n let previous: BrandlabSectionTone | undefined\n let lastLight: 'canvas' | 'surface' = 'surface'\n let bandUsed = false\n let photoUsed = false\n for (const request of requests) {\n let next: BrandlabSectionTone\n if (request === 'band' && !bandUsed && previous !== 'band') {\n next = 'band'\n bandUsed = true\n } else if (request === 'photo' && !photoUsed && previous !== 'photo') {\n next = 'photo'\n photoUsed = true\n } else if (previous === 'canvas') next = 'surface'\n else if (previous === 'surface') next = 'canvas'\n else next = lastLight === 'canvas' ? 'surface' : 'canvas'\n tones.push(next)\n previous = next\n if (next === 'canvas' || next === 'surface') lastLight = next\n }\n return tones\n}\n\n/** Only optional, then recommended, sections drop for the cap; K12 needs every R and C section with data rendered. */\nconst CAP_DROP_ORDER: readonly BrandlabSectionRequirement[] = ['O', 'Rec']\n\n/** Checks a signature candidate's name and place against the family's order; a mistake here is the site's code. */\nfunction assertSignature(order: BrandlabFamilyOrder, candidate: BrandlabSequenceCandidate): void {\n const where = `Signature section \"${candidate.signature ?? ''}\" on ${order.family} pages`\n if (typeof candidate.signature !== 'string' || !SIGNATURE_NAME_PATTERN.test(candidate.signature)) {\n throw new Error(`${where}: a signature section needs a name of lower-case words joined by hyphens, for example \"storm-line\".`)\n }\n if (candidate.after === undefined) return\n const ids = order.entries.map((entry) => entry.id)\n const at = ids.indexOf(candidate.after)\n if (at === -1) throw new Error(`${where}: \"${candidate.after}\" is not in the order, so it can't follow it.`)\n if (candidate.after === 'cta' || at === ids.length - 1) throw new Error(`${where}: nothing follows the last section.`)\n const proof = ids.indexOf('proof-strip')\n if (at < Math.max(proof, 0)) throw new Error(`${where}: it can't come before the proof strip.`)\n}\n\n/**\n * Plans one page: matches the page's candidate sections to the family order, skips what isn't ready, isn't offered or\n * isn't in the order, enforces the cap (optional, then recommended sections drop, last first; required and\n * conditional sections with data never drop: when they alone exceed the cap they all render and the manifest flags\n * `cap-exceeded`; the sections in `UNCAPPED_SECTIONS` don't count), places the signature sections (3.16.0), assigns\n * tones and writes the manifest.\n */\nexport function planSectionSequence(\n order: BrandlabFamilyOrder,\n candidates: readonly BrandlabSequenceCandidate[],\n page?: string,\n): BrandlabSequencePlan {\n const skipped: BrandlabSectionManifest['skipped'][number][] = []\n const used = new Set<number>()\n const chosen: { candidate: number; entry: BrandlabSectionOrderEntry }[] = []\n const isSignature = (candidate: BrandlabSequenceCandidate) => candidate.id === 'signature'\n\n for (const entry of order.entries) {\n // Signature sections are placed after the cap, by their own rules.\n if (entry.id === 'signature') {\n if (!candidates.some(isSignature)) skipped.push({ id: entry.id, section: entry.id, requirement: entry.requirement, reason: 'not-provided' })\n continue\n }\n const matches = candidates\n .map((candidate, index) => ({ candidate, index }))\n .filter(\n ({ candidate, index }) =>\n !used.has(index) && !isSignature(candidate) && (candidate.id === entry.id || entry.alternatives?.includes(candidate.id)),\n )\n if (matches.length === 0) {\n skipped.push({ id: entry.id, section: entry.id, requirement: entry.requirement, reason: 'not-provided' })\n continue\n }\n let filled = false\n for (const { candidate, index } of matches) {\n used.add(index)\n const ready = candidate.ready ?? SECTION_READY\n if (filled) skipped.push({ id: entry.id, section: candidate.id, requirement: entry.requirement, reason: 'duplicate' })\n else if (!ready.render) skipped.push({ id: entry.id, section: candidate.id, requirement: entry.requirement, reason: ready.reason })\n else {\n chosen.push({ candidate: index, entry })\n filled = true\n }\n }\n }\n\n candidates.forEach((candidate, index) => {\n if (!used.has(index) && !isSignature(candidate)) skipped.push({ id: candidate.id, section: candidate.id, requirement: 'N', reason: 'not-in-order' })\n })\n\n const counted = () => {\n const ids = new Set(chosen.map((pick) => pick.entry.id))\n return chosen.filter((pick) => !pick.entry.uncapped && !(pick.entry.countsWith && ids.has(pick.entry.countsWith))).length\n }\n // Sections sharing one matrix position drop together, so every drop lowers the count by one.\n const position = (pick: (typeof chosen)[number]) =>\n chosen.filter(\n (other) =>\n other === pick ||\n other.entry.countsWith === pick.entry.id ||\n pick.entry.countsWith === other.entry.id ||\n (pick.entry.countsWith !== undefined && other.entry.countsWith === pick.entry.countsWith),\n )\n for (const requirement of CAP_DROP_ORDER) {\n for (let index = chosen.length - 1; index >= 0 && counted() > order.cap; index -= 1) {\n const pick = chosen[index]\n if (!pick || pick.entry.requirement !== requirement || pick.entry.uncapped) continue\n const group = position(pick)\n if (!group.every((member) => CAP_DROP_ORDER.includes(member.entry.requirement))) continue\n for (const member of group) {\n skipped.push({\n id: member.entry.id,\n section: candidates[member.candidate]?.id ?? member.entry.id,\n requirement: member.entry.requirement,\n reason: 'cap',\n })\n chosen.splice(chosen.indexOf(member), 1)\n }\n index = Math.min(index, chosen.length)\n }\n }\n\n // Signature sections (3.16.0): each goes straight after the section it names (or the nearest one before it that\n // renders), or in the order's own `signature` place; at most SIGNATURE_LIMITS per family, never counted.\n // A recorded order may leave the `signature` place out; a signature placed with `after` still renders there.\n const ownPlace = order.entries.find((entry) => entry.id === 'signature')\n const place: BrandlabSectionOrderEntry = ownPlace ?? { id: 'signature', requirement: 'O', uncapped: true }\n const plannedAt = (id: BrandlabSectionId) => order.entries.findIndex((entry) => entry.id === id)\n const limit = SIGNATURE_LIMITS[order.family] ?? 0\n const placed: { candidate: number; entry: BrandlabSectionOrderEntry; anchor: number; after?: BrandlabSectionId }[] = []\n candidates.forEach((candidate, index) => {\n if (!isSignature(candidate)) return\n const signature = { signature: candidate.signature ?? '' }\n if (limit === 0 || (!ownPlace && candidate.after === undefined)) {\n skipped.push({ id: 'signature', section: 'signature', requirement: 'N', reason: 'not-in-order', ...signature })\n return\n }\n assertSignature(order, candidate)\n const ready = candidate.ready ?? SECTION_READY\n if (!ready.render) skipped.push({ id: 'signature', section: 'signature', requirement: place.requirement, reason: ready.reason, ...signature })\n else if (placed.length >= limit) skipped.push({ id: 'signature', section: 'signature', requirement: place.requirement, reason: 'limit', ...signature })\n else {\n // The anchor is the planned index the signature follows; the order's own place follows the section before it.\n const anchor = candidate.after !== undefined ? plannedAt(candidate.after) : plannedAt('signature') - 1\n placed.push({ candidate: index, entry: place, anchor, ...(candidate.after !== undefined ? { after: candidate.after } : {}) })\n }\n })\n const ordered: { candidate: number; entry: BrandlabSectionOrderEntry; after?: BrandlabSectionId }[] = []\n const pending = [...placed]\n for (const pick of chosen) {\n const at = plannedAt(pick.entry.id)\n // A signature anchored before this section goes in first (its anchor didn't render, or it is the place before).\n while (pending.length > 0 && pending.some((item) => item.anchor < at)) {\n const next = pending.findIndex((item) => item.anchor < at)\n ordered.push(...pending.splice(next, 1))\n }\n ordered.push(pick)\n }\n ordered.push(...pending)\n\n const tones = assignSectionTones(ordered.map((pick) => candidates[pick.candidate]?.tone ?? 'auto'))\n const rendered = ordered.map((pick, index) => ({ candidate: pick.candidate, id: pick.entry.id, tone: tones[index] ?? 'canvas' }))\n const manifest: BrandlabSectionManifest = {\n version: 1,\n family: order.family,\n ...(page !== undefined ? { page } : {}),\n cap: order.cap,\n order: order.source,\n planned: order.entries.map((entry) => ({ id: entry.id, requirement: entry.requirement })),\n rendered: ordered.map((pick, index) => {\n const candidate = candidates[pick.candidate]\n return {\n id: pick.entry.id,\n section: candidate?.id ?? pick.entry.id,\n requirement: pick.entry.requirement,\n tone: tones[index] ?? 'canvas',\n ...(candidate && isSignature(candidate) ? { signature: candidate.signature ?? '' } : {}),\n ...(pick.after !== undefined ? { after: pick.after } : {}),\n }\n }),\n skipped,\n counted: counted(),\n flags: counted() > order.cap ? ['cap-exceeded'] : [],\n }\n return { rendered, manifest }\n}\n"]}
1
+ {"version":3,"file":"section-order.js","sourceRoot":"","sources":["../src/section-order.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,MAAM;IACN,aAAa;IACb,gBAAgB;IAChB,wHAAwH;IACxH,cAAc;IACd,QAAQ;IACR,aAAa;IACb,WAAW;IACX,UAAU;IACV,aAAa;IACb,eAAe;IACf,aAAa;IACb,gBAAgB;IAChB,aAAa;IACb,UAAU;IACV,cAAc;IACd,SAAS;IACT,SAAS;IACT,YAAY;IACZ,aAAa;IACb,WAAW;IACX,SAAS;IACT,WAAW;IACX,UAAU;IACV,UAAU;IACV,MAAM;IACN,UAAU;IACV,UAAU;IACV,MAAM;IACN,cAAc;IACd,kBAAkB;IAClB,QAAQ;IACR,SAAS;IACT,KAAK;CACG,CAAA;AAGV,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACpC,MAAM;IACN,SAAS;IACT,mBAAmB;IACnB,QAAQ;IACR,QAAQ;IACR,YAAY;IACZ,cAAc;IACd,eAAe;IACf,cAAc;IACd,SAAS;IACT,SAAS;IACT,SAAS;IACT,OAAO;IACP,MAAM;IACN,SAAS;IACT,YAAY;IACZ,OAAO;IACP,SAAS;IACT,WAAW;CACH,CAAA;AAGV,mHAAmH;AACnH,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,CAAU,CAAA;AAG5E,mGAAmG;AACnG,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,CAAU,CAAA;AAyBrF;;;GAGG;AACH,MAAM,CAAC,MAAM,YAAY,GAAiD,MAAM,CAAC,MAAM,CAAC;IACtF,IAAI,EAAE,EAAE;IACR,OAAO,EAAE,EAAE;IACX,mBAAmB,EAAE,EAAE;IACvB,MAAM,EAAE,EAAE;IACV,MAAM,EAAE,EAAE;IACV,YAAY,EAAE,EAAE;IA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AC,SAAS,IAAI,WAAW,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,SAAS,CAAC,SAAS,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;gBACxF,GAAG,CAAC,IAAI,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;aAC3D,CAAA;QACH,CAAC,CAAC;QACF,OAAO;QACP,OAAO,EAAE,OAAO,EAAE;QAClB,KAAK,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,EAAE;KACrD,CAAA;IACD,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAA;AAC/B,CAAC","sourcesContent":["/**\n * Section order (v2 §3.3 matrix part A; LIB §7a for hubs and company pages). Every page family has a default order of\n * sections, each required (R: skipped only when nothing true exists, and the manifest says why), conditional (C:\n * renders when its data exists), recommended (Rec) or optional (O). Sections a family doesn't use (N) are not in its\n * list. The hero or page header comes first and the CTA band last; a site may record an alternative order per family.\n * The permit note is a line inside `LocalFacts` (permit trades), not a section of its own.\n *\n * `planSectionSequence` is the sequencer's logic (F15), shared by a site's own section sequencer and the K8 and K12\n * checks: skip what has nothing true to show, enforce the cap (only optional and recommended sections drop),\n * alternate the light tones so neighbours differ (at most one `band` and one `photo`) and write the per-page manifest.\n *\n * 3.16.0: the strips (the proof strip and the emergency band) and the site's signature sections don't count toward the\n * cap (`UNCAPPED_SECTIONS`), so a trade band never pushes out the page's own content, and a signature section takes\n * the place the site declares (`after`), up to `SIGNATURE_LIMITS` per family.\n */\n\nexport const BRANDLAB_SECTION_IDS = [\n 'hero',\n 'page-header',\n 'article-header',\n // 3.19.1: a guide's article text, which may hold many H2s and lists (exempt from K8's and K11's one-H2 and card rules).\n 'article-body',\n 'answer',\n 'proof-strip',\n 'emergency',\n 'services',\n 'local-facts',\n 'council-rules',\n 'nearby-jobs',\n 'service-detail',\n 'price-guide',\n 'projects',\n 'before-after',\n 'gallery',\n 'reviews',\n 'comparison',\n 'about-owner',\n 'signature',\n 'process',\n 'guarantee',\n 'licences',\n 'partners',\n 'team',\n 'coverage',\n 'area-map',\n 'faqs',\n 'nearby-areas',\n 'related-services',\n 'guides',\n 'contact',\n 'cta',\n] as const\nexport type BrandlabSectionId = (typeof BRANDLAB_SECTION_IDS)[number]\n\nexport const BRANDLAB_PAGE_FAMILIES = [\n 'home',\n 'service',\n 'service-in-suburb',\n 'region',\n 'suburb',\n 'cost-guide',\n 'services-hub',\n 'locations-hub',\n 'projects-hub',\n 'project',\n 'gallery',\n 'reviews',\n 'about',\n 'faqs',\n 'contact',\n 'guides-hub',\n 'guide',\n 'council',\n 'emergency',\n] as const\nexport type BrandlabPageFamily = (typeof BRANDLAB_PAGE_FAMILIES)[number]\n\n/** R required, C conditional, Rec recommended, O optional (N, not used, is simply absent from a family's list). */\nexport const BRANDLAB_SECTION_REQUIREMENTS = ['R', 'C', 'Rec', 'O'] as const\nexport type BrandlabSectionRequirement = (typeof BRANDLAB_SECTION_REQUIREMENTS)[number]\n\n/** The section tones: two alternating grounds, one optional band and one optional photo ground. */\nexport const BRANDLAB_SECTION_TONES = ['canvas', 'surface', 'band', 'photo'] as const\nexport type BrandlabSectionTone = (typeof BRANDLAB_SECTION_TONES)[number]\n\n/** What a section asks for: a light tone the sequencer picks (`auto`), the page's one band or its one photo ground. */\nexport type BrandlabSectionToneRequest = 'auto' | 'band' | 'photo'\n\nexport interface BrandlabSectionOrderEntry {\n readonly id: BrandlabSectionId\n readonly requirement: BrandlabSectionRequirement\n /** Sections that may fill this place instead, for example `before-after` for `projects`. */\n readonly alternatives?: readonly BrandlabSectionId[]\n /** Shares one matrix position with that section: when both render they count once toward the cap. */\n readonly countsWith?: BrandlabSectionId\n /** A strip or signature section (3.16.0): it renders under the usual rules but never counts toward the cap. */\n readonly uncapped?: true\n}\n\nexport interface BrandlabFamilyOrder {\n readonly family: BrandlabPageFamily\n /** The most sections the page renders (v1 §7.1). */\n readonly cap: number\n readonly source: 'default' | 'recorded'\n readonly entries: readonly BrandlabSectionOrderEntry[]\n}\n\n/**\n * 11 on home and service-in-suburb pages, 12 on service, region and suburb pages, 6 on hubs and company pages. The\n * sections in `UNCAPPED_SECTIONS` don't count toward them.\n */\nexport const SECTION_CAPS: Readonly<Record<BrandlabPageFamily, number>> = Object.freeze({\n home: 11,\n service: 12,\n 'service-in-suburb': 11,\n region: 12,\n suburb: 12,\n 'cost-guide': 12,\n 'services-hub': 6,\n 'locations-hub': 6,\n 'projects-hub': 6,\n project: 6,\n gallery: 6,\n reviews: 6,\n about: 6,\n faqs: 6,\n contact: 6,\n 'guides-hub': 6,\n guide: 6,\n council: 6,\n emergency: 6,\n})\n\ntype Row = readonly [\n BrandlabSectionId,\n BrandlabSectionRequirement,\n (readonly BrandlabSectionId[] | undefined)?,\n BrandlabSectionId?,\n]\n\nconst PROJECTS: Row = ['projects', 'C', ['before-after']]\n\n/**\n * Sections that never count toward the cap (3.16.0): the two strips, which sit straight under the hero (the proof\n * strip and a trade's emergency band), and the site's signature sections, which `SIGNATURE_LIMITS` bounds instead. The\n * cap holds the page's own content sections, so a conditional trade band can't push one out.\n */\nexport const UNCAPPED_SECTIONS: readonly BrandlabSectionId[] = Object.freeze(['proof-strip', 'emergency', 'signature'])\n\n/**\n * The most signature sections a page renders (v2 §7.7: up to two on the home page and one on service pages). Families\n * not listed take none, and their order has no `signature` place.\n */\nexport const SIGNATURE_LIMITS: Readonly<Partial<Record<BrandlabPageFamily, number>>> = Object.freeze({ home: 2, service: 1 })\n\n/** A signature section's name (`data-bl-signature`): lower-case words joined by hyphens, for example `storm-line`. */\nexport const SIGNATURE_NAME_PATTERN = /^[a-z0-9]+(?:-[a-z0-9]+)*$/\n\n/** The defaults, in order. `EmergencyBand` has no number in the matrix; it sits straight after the proof strip. */\nconst DEFAULT_ROWS: Readonly<Record<BrandlabPageFamily, readonly Row[]>> = {\n home: [\n ['hero', 'R'],\n ['proof-strip', 'R'],\n ['emergency', 'C'],\n ['services', 'R'],\n PROJECTS,\n // 3.16.0: genuine job photos beside the projects, as on the service pages.\n ['gallery', 'O'],\n ['reviews', 'C'],\n ['price-guide', 'Rec'],\n ['about-owner', 'O'],\n ['signature', 'O'],\n ['process', 'O'],\n ['guarantee', 'O'],\n ['coverage', 'R'],\n ['faqs', 'Rec'],\n ['guides', 'C'],\n ['cta', 'R'],\n ],\n service: [\n ['hero', 'R'],\n ['proof-strip', 'R'],\n ['emergency', 'C'],\n ['service-detail', 'R'],\n ['price-guide', 'R'],\n PROJECTS,\n // 3.15.0: genuine job photos beside the projects, when the site has them.\n ['gallery', 'O'],\n ['reviews', 'C'],\n ['about-owner', 'O'],\n ['comparison', 'O'],\n ['signature', 'O'],\n ['process', 'O'],\n ['guarantee', 'C'],\n ['faqs', 'R'],\n ['related-services', 'C'],\n ['coverage', 'C'],\n ['guides', 'C'],\n ['cta', 'R'],\n ],\n 'service-in-suburb': [\n ['hero', 'R'],\n ['proof-strip', 'R'],\n ['emergency', 'C'],\n ['local-facts', 'R'],\n ['nearby-jobs', 'R'],\n ['price-guide', 'R'],\n ['service-detail', 'R'],\n ['reviews', 'R'],\n ['faqs', 'R'],\n ['nearby-areas', 'R'],\n ['related-services', 'R', undefined, 'nearby-areas'],\n ['cta', 'R'],\n ],\n region: [\n ['hero', 'R'],\n ['proof-strip', 'R'],\n ['service-detail', 'R'],\n ['services', 'R'],\n PROJECTS,\n ['reviews', 'C'],\n ['price-guide', 'C'],\n ['coverage', 'R'],\n ['faqs', 'R'],\n ['area-map', 'O'],\n ['cta', 'R'],\n ],\n suburb: [\n ['hero', 'R'],\n ['proof-strip', 'R'],\n ['local-facts', 'R'],\n ['services', 'R'],\n ['price-guide', 'C'],\n ['nearby-jobs', 'C'],\n ['reviews', 'C'],\n ['faqs', 'R'],\n // 3.15.0: the nearest served suburbs (NearbyAreas), then the locator map (AreaMap). Conditional: L3 holds any\n // neighbour list to real distance but no check needs one on a suburb page, so it renders when there are neighbours.\n ['nearby-areas', 'C'],\n ['area-map', 'R'],\n ['cta', 'R'],\n ],\n // 3.19.1: the library's PageHeader may fill the article header's place on cost guides and guides.\n 'cost-guide': [\n ['article-header', 'R', ['page-header']],\n ['answer', 'R'],\n ['price-guide', 'R'],\n ['service-detail', 'R'],\n ['comparison', 'O'],\n PROJECTS,\n ['faqs', 'Rec'],\n ['cta', 'R'],\n ],\n 'services-hub': [\n ['page-header', 'R'],\n ['services', 'R'],\n ['reviews', 'C'],\n ['cta', 'R'],\n ],\n 'locations-hub': [\n ['page-header', 'R'],\n ['coverage', 'R'],\n ['cta', 'R'],\n ],\n 'projects-hub': [\n ['page-header', 'R'],\n ['projects', 'R'],\n ['reviews', 'C'],\n ['cta', 'R'],\n ],\n project: [\n ['hero', 'R', ['page-header']],\n ['gallery', 'R'],\n ['service-detail', 'R'],\n ['reviews', 'C'],\n ['related-services', 'R'],\n ['cta', 'R'],\n ],\n gallery: [\n ['page-header', 'R'],\n ['gallery', 'R'],\n ['cta', 'R'],\n ],\n reviews: [\n ['page-header', 'R'],\n ['reviews', 'R'],\n ['cta', 'R'],\n ],\n // 3.19.0: genuine job photos on the about page (`gallery`), optional.\n about: [\n ['page-header', 'R'],\n ['about-owner', 'R'],\n ['licences', 'C'],\n ['partners', 'C'],\n ['reviews', 'C'],\n ['team', 'O'],\n ['gallery', 'O'],\n ['cta', 'R'],\n ],\n faqs: [\n ['page-header', 'R'],\n ['faqs', 'R'],\n ['cta', 'R'],\n ],\n // The contact page is the page header and the contact block, and nothing else (K12-contact).\n contact: [\n ['page-header', 'R'],\n ['contact', 'R'],\n ],\n 'guides-hub': [\n ['page-header', 'R'],\n ['guides', 'R'],\n ['cta', 'R'],\n ],\n // 3.19.0: the article's related projects and further guides, both optional. 3.19.1: the article's text is\n // `article-body` (a `service-detail` still fills the place), and the library's PageHeader may be the article header.\n guide: [\n ['article-header', 'R', ['page-header']],\n ['article-body', 'R', ['service-detail']],\n ['projects', 'O'],\n ['guides', 'O'],\n ['cta', 'R'],\n ],\n // `council-rules` (3.15.0): the council register's rule, fees, source and check date (CouncilRules). Optional by\n // default; a permit trade makes it conditional on a current register record.\n council: [\n ['page-header', 'R'],\n ['council-rules', 'O'],\n ['service-detail', 'R'],\n ['cta', 'R'],\n ],\n // 3.15.0: optional FAQs before the CTA band (AA's emergency tree work page answers storm and after-hours questions).\n emergency: [\n ['hero', 'R'],\n ['emergency', 'R'],\n ['service-detail', 'R'],\n ['reviews', 'C'],\n ['faqs', 'O'],\n ['cta', 'R'],\n ],\n}\n\nfunction toEntry([id, requirement, alternatives, countsWith]: Row): BrandlabSectionOrderEntry {\n return Object.freeze({\n id,\n requirement,\n ...(alternatives ? { alternatives: Object.freeze([...alternatives]) } : {}),\n ...(countsWith ? { countsWith } : {}),\n ...(UNCAPPED_SECTIONS.includes(id) ? { uncapped: true as const } : {}),\n })\n}\n\n/** The playbook trades (v2 §5, matrix part B). */\nexport const BRANDLAB_TRADES = [\n 'building',\n 'electrical',\n 'exterior',\n 'interiors',\n 'landscaping',\n 'plumbing',\n 'pools',\n 'renovations',\n 'roofing',\n 'tiling',\n 'trees',\n] as const\nexport type BrandlabTrade = (typeof BRANDLAB_TRADES)[number]\n\n/** A trade's changes to the defaults: a new requirement for a section already in a family's order. */\nexport type BrandlabTradeSectionRules = Readonly<\n Partial<Record<BrandlabPageFamily, Readonly<Partial<Record<BrandlabSectionId, BrandlabSectionRequirement>>>>>\n>\n\n/**\n * Lines inside a section that a trade can require (3.14.0): the permit note is `LocalFacts`' `permit` slot; the\n * qualifications and insurance lines stand in for a licence block where the trade has no licence. A component marks\n * each slot it renders with `data-bl-slot=\"<slot>\"`; when its data is missing or stale it renders nothing for the slot\n * and lists `<slot>:<no-… reason>` in the section's `data-bl-slot-skip` attribute (check K12-slots reads both).\n */\n/** `experience` and `established` (3.19.0) are the Licences ledger's optional lines. */\nexport const BRANDLAB_SECTION_SLOTS = ['permit', 'qualifications', 'insurance', 'licence', 'experience', 'established'] as const\nexport type BrandlabSectionSlot = (typeof BRANDLAB_SECTION_SLOTS)[number]\n\nexport const SECTION_SLOT_ATTRIBUTE = 'data-bl-slot'\nexport const SECTION_SLOT_SKIP_ATTRIBUTE = 'data-bl-slot-skip'\n\n/** A slot left empty for a data-backed reason, such as `{ slot: 'permit', reason: 'no-current-council-record' }`. */\nexport interface BrandlabSectionSlotSkip {\n readonly slot: BrandlabSectionSlot\n readonly reason: `no-${string}`\n}\n\n/** The `data-bl-slot-skip` value: space-separated `slot:reason` pairs. */\nexport function formatSectionSlotSkips(skips: readonly BrandlabSectionSlotSkip[]): string {\n return skips\n .map((skip) => {\n if (!(BRANDLAB_SECTION_SLOTS as readonly string[]).includes(skip.slot)) throw new Error(`Unknown section slot \"${skip.slot}\".`)\n if (!/^no-[a-z0-9]+(?:-[a-z0-9]+)*$/.test(skip.reason)) throw new Error(`A slot skip reason says what data is missing: \"no-…\", not \"${skip.reason}\".`)\n return `${skip.slot}:${skip.reason}`\n })\n .join(' ')\n}\n\n/** Reads a `data-bl-slot-skip` value; pairs that are not `slot:no-…` are ignored. */\nexport function parseSectionSlotSkips(value: string | undefined): BrandlabSectionSlotSkip[] {\n return (value ?? '')\n .split(/\\s+/)\n .flatMap((pair): BrandlabSectionSlotSkip[] => {\n const [slot, reason] = pair.split(':')\n return slot && reason && (BRANDLAB_SECTION_SLOTS as readonly string[]).includes(slot) && /^no-[a-z0-9]+(?:-[a-z0-9]+)*$/.test(reason)\n ? [{ slot: slot as BrandlabSectionSlot, reason: reason as `no-${string}` }]\n : []\n })\n}\n\n/** Slots a trade requires inside a family's sections. */\nexport type BrandlabTradeSlotRules = Readonly<\n Partial<Record<BrandlabPageFamily, Readonly<Partial<Record<BrandlabSectionId, readonly BrandlabSectionSlot[]>>>>>\n>\n\n/**\n * One trade's column of matrix part B: its credential block (a licence block, or qualifications and insurance where\n * the trade has no licence), its section requirement changes and the slots it requires. `unconfirmed` trades keep the\n * defaults until their playbook's rules are confirmed (licence classes, permit notes and emergency work are\n * \"inferred, confirm\" in the matrix).\n */\nexport interface BrandlabTradeProfile {\n readonly credentials: 'licence' | 'qualifications' | 'unconfirmed'\n readonly sections: BrandlabTradeSectionRules\n readonly slots: BrandlabTradeSlotRules\n /** Where the rules come from. */\n readonly source: string\n}\n\nconst UNCONFIRMED: BrandlabTradeProfile = Object.freeze({\n credentials: 'unconfirmed',\n sections: Object.freeze({}),\n slots: Object.freeze({}),\n source: 'Defaults until the playbook rules are confirmed (v2 §3.4).',\n})\n\n/** Validates trade profiles: requirement changes and slots name sections the family uses, and known slots. */\nexport function defineTradeProfiles<const T extends Readonly<Record<BrandlabTrade, BrandlabTradeProfile>>>(profiles: T): T {\n for (const [trade, profile] of Object.entries(profiles) as [string, BrandlabTradeProfile][]) {\n if (!(BRANDLAB_TRADES as readonly string[]).includes(trade)) throw new Error(`Unknown trade \"${trade}\".`)\n if (!['licence', 'qualifications', 'unconfirmed'].includes(profile.credentials)) {\n throw new Error(`Trade ${trade}: credentials must be licence, qualifications or unconfirmed.`)\n }\n const check = (rules: object, kind: string, value: (sectionValue: unknown, where: string) => void) => {\n for (const [family, sections] of Object.entries(rules)) {\n const rows = DEFAULT_ROWS[family as BrandlabPageFamily]\n if (!rows) throw new Error(`Trade ${trade}: unknown page family \"${family}\" in its ${kind}.`)\n for (const [section, sectionValue] of Object.entries(sections as object)) {\n if (!rows.some((row) => row[0] === section)) throw new Error(`Trade ${trade}: ${family} pages have no \"${section}\" section for its ${kind}.`)\n value(sectionValue, `Trade ${trade}: ${family} \"${section}\"`)\n }\n }\n }\n check(profile.sections, 'requirements', (requirement, where) => {\n if (!(BRANDLAB_SECTION_REQUIREMENTS as readonly unknown[]).includes(requirement)) throw new Error(`${where} has an unknown requirement.`)\n })\n check(profile.slots, 'slots', (slots, where) => {\n if (!Array.isArray(slots) || slots.length === 0 || slots.some((slot) => !(BRANDLAB_SECTION_SLOTS as readonly unknown[]).includes(slot))) {\n throw new Error(`${where} lists an unknown slot; slots are ${BRANDLAB_SECTION_SLOTS.join(', ')}.`)\n }\n })\n }\n return profiles\n}\n\n/**\n * Matrix part B, as confirmed (3.14.0). Trees: no NSW licence for tree work, so the licence block is optional and the\n * about page's owner block carries the qualifications and insurance lines (or, from 3.19.1, the page's Licences ledger\n * does, which K12-slots accepts in their place); the council permit note is required on\n * suburb and service-in-suburb pages (hidden, with its reason, once the council record is stale), and council pages\n * show the council's rules whenever the register holds a current record (3.15.0). The other trades\n * stay on the defaults until their rules are confirmed.\n */\nexport const SECTION_TRADE_PROFILES: Readonly<Record<BrandlabTrade, BrandlabTradeProfile>> = Object.freeze(\n defineTradeProfiles({\n ...(Object.fromEntries(BRANDLAB_TRADES.map((trade) => [trade, UNCONFIRMED])) as Record<BrandlabTrade, BrandlabTradeProfile>),\n trees: Object.freeze({\n credentials: 'qualifications',\n sections: Object.freeze({ about: Object.freeze({ licences: 'O' }), council: Object.freeze({ 'council-rules': 'C' }) }),\n slots: Object.freeze({\n suburb: Object.freeze({ 'local-facts': Object.freeze(['permit'] as const) }),\n 'service-in-suburb': Object.freeze({ 'local-facts': Object.freeze(['permit'] as const) }),\n about: Object.freeze({ 'about-owner': Object.freeze(['qualifications', 'insurance'] as const) }),\n }),\n source: 'v2 §3.4 matrix part B (trees row); playbook-trees §2.3 (permit slot, rows 2 and 6), §2.4 (council register) and §1.7 (no tree-work licence).',\n }),\n }),\n)\n\n/** The trade map (matrix part B): each trade's section requirement changes, from `SECTION_TRADE_PROFILES`. */\nexport const SECTION_ORDER_TRADE_MAP: Readonly<Record<BrandlabTrade, BrandlabTradeSectionRules>> = Object.freeze(\n Object.fromEntries(BRANDLAB_TRADES.map((trade) => [trade, SECTION_TRADE_PROFILES[trade].sections])) as Record<BrandlabTrade, BrandlabTradeSectionRules>,\n)\n\n/** The slots a trade requires on a family's pages, section by section, in the order the profile lists them. */\nexport function requiredSectionSlots(\n family: BrandlabPageFamily,\n trade?: BrandlabTrade,\n profiles: Readonly<Partial<Record<BrandlabTrade, BrandlabTradeProfile>>> = SECTION_TRADE_PROFILES,\n): { readonly section: BrandlabSectionId; readonly slot: BrandlabSectionSlot }[] {\n const rules = trade ? profiles[trade]?.slots[family] : undefined\n if (!rules) return []\n return (Object.entries(rules) as [BrandlabSectionId, readonly BrandlabSectionSlot[]][]).flatMap(([section, slots]) =>\n slots.map((slot) => ({ section, slot })),\n )\n}\n\n/** A family's default order, with the trade's rules applied. */\nexport function defaultSectionOrder(\n family: BrandlabPageFamily,\n trade?: BrandlabTrade,\n tradeMap: Readonly<Partial<Record<BrandlabTrade, BrandlabTradeSectionRules>>> = SECTION_ORDER_TRADE_MAP,\n): BrandlabFamilyOrder {\n const rows = DEFAULT_ROWS[family]\n if (!rows) throw new Error(`Unknown page family \"${family}\".`)\n const rules = trade ? tradeMap[trade]?.[family] : undefined\n const entries = rows.map((row) => {\n const requirement = rules?.[row[0]]\n return toEntry(requirement ? [row[0], requirement, row[2], row[3]] : row)\n })\n return Object.freeze({ family, cap: SECTION_CAPS[family], source: 'default', entries: Object.freeze(entries) })\n}\n\n/** A site's recorded alternative order for one family (LIB §7a), with the decision that recorded it. */\nexport interface BrandlabRecordedSectionOrder {\n readonly order: readonly BrandlabSectionId[]\n /** Who decided and why, for example \"Romie, 19 Oct 2026: reviews before prices for Superior\". */\n readonly decision: string\n /** YYYY-MM-DD. */\n readonly recordedOn: string\n}\n\nexport interface BrandlabSectionOrderInput {\n readonly trade?: BrandlabTrade\n readonly recorded?: Readonly<Partial<Record<BrandlabPageFamily, BrandlabRecordedSectionOrder>>>\n}\n\nexport type BrandlabSectionOrders = Readonly<Record<BrandlabPageFamily, BrandlabFamilyOrder>>\n\nconst ISO_DATE = /^\\d{4}-\\d{2}-\\d{2}$/\n\nfunction recordedOrder(base: BrandlabFamilyOrder, recorded: BrandlabRecordedSectionOrder): BrandlabFamilyOrder {\n const family = base.family\n const fail = (detail: string): never => {\n throw new Error(`Recorded section order for ${family}: ${detail}`)\n }\n if (family === 'contact') fail('the contact page is the page header and the contact block, and nothing else.')\n if (typeof recorded.decision !== 'string' || !recorded.decision.trim()) fail('decision must say who decided and why.')\n if (typeof recorded.recordedOn !== 'string' || !ISO_DATE.test(recorded.recordedOn) || Number.isNaN(Date.parse(recorded.recordedOn))) {\n fail('recordedOn must be a YYYY-MM-DD date.')\n }\n if (!Array.isArray(recorded.order) || recorded.order.length === 0) fail('order must list the sections.')\n const byId = new Map(base.entries.map((entry) => [entry.id, entry]))\n const seen = new Set<string>()\n for (const id of recorded.order) {\n if (!byId.has(id)) fail(`\"${id}\" is not used on ${family} pages.`)\n if (seen.has(id)) fail(`\"${id}\" appears twice.`)\n seen.add(id)\n }\n for (const entry of base.entries) {\n if ((entry.requirement === 'R' || entry.requirement === 'C') && !seen.has(entry.id)) {\n fail(`\"${entry.id}\" is ${entry.requirement === 'R' ? 'required' : 'conditional'} and must stay in the order.`)\n }\n }\n const first = base.entries[0]?.id\n const last = base.entries[base.entries.length - 1]?.id\n if (recorded.order[0] !== first) fail(`\"${first}\" comes first.`)\n if (last === 'cta' && recorded.order[recorded.order.length - 1] !== 'cta') fail('the CTA band comes last.')\n const proof = recorded.order.indexOf('proof-strip')\n if (proof >= 5) fail('the proof strip stays within the first five sections.')\n return Object.freeze({\n family,\n cap: base.cap,\n source: 'recorded',\n entries: Object.freeze(recorded.order.map((id) => byId.get(id) as BrandlabSectionOrderEntry)),\n })\n}\n\n/**\n * Declares a site's section orders (`src/data/strategy.ts`): the defaults for every family, the trade's rules and any\n * recorded alternative orders. A recorded order keeps every required and conditional section, the first section\n * first, the CTA band last and the proof strip within the first five; the contact page can't be reordered.\n */\nexport function defineSectionOrder(\n input: BrandlabSectionOrderInput = {},\n tradeMap: Readonly<Partial<Record<BrandlabTrade, BrandlabTradeSectionRules>>> = SECTION_ORDER_TRADE_MAP,\n): BrandlabSectionOrders {\n if (input.trade !== undefined && !(BRANDLAB_TRADES as readonly string[]).includes(input.trade)) {\n throw new Error(`Unknown trade \"${input.trade}\".`)\n }\n for (const family of Object.keys(input.recorded ?? {})) {\n if (!(BRANDLAB_PAGE_FAMILIES as readonly string[]).includes(family)) throw new Error(`Unknown page family \"${family}\".`)\n }\n const orders = Object.fromEntries(\n BRANDLAB_PAGE_FAMILIES.map((family) => {\n const base = defaultSectionOrder(family, input.trade, tradeMap)\n const recorded = input.recorded?.[family]\n return [family, recorded ? recordedOrder(base, recorded) : base]\n }),\n ) as Record<BrandlabPageFamily, BrandlabFamilyOrder>\n return Object.freeze(orders)\n}\n\n/** The reasons the sequencer itself skips a section. */\nexport const SEQUENCER_SKIP_REASONS = ['not-provided', 'not-in-order', 'duplicate', 'cap', 'limit'] as const\nexport type BrandlabSequencerSkipReason = (typeof SEQUENCER_SKIP_REASONS)[number]\n\n/**\n * A section's own, data-backed reason for rendering nothing: the data it needs isn't there (`no-feed-reviews`,\n * `no-approved-prices`, `no-jobs-nearby`, `no-faqs` and so on), its content belongs in the hero checklist, or (3.18.0,\n * `nearby-areas` only) the nearby suburbs are the area map's place list, one section for the map and its places.\n */\nexport type BrandlabSectionDataReason = `no-${string}` | 'merge-into-hero-checklist' | 'merge-into-area-map'\nexport type BrandlabSectionSkipReason = BrandlabSectionDataReason | BrandlabSequencerSkipReason\n\n/** A section's guard, computed from the same data it renders: render, or render nothing and say why. */\nexport type BrandlabSectionReadiness =\n | { readonly render: true }\n | { readonly render: false; readonly reason: BrandlabSectionDataReason }\n\nexport const SECTION_READY: BrandlabSectionReadiness = Object.freeze({ render: true })\n\n/** Whether a skip reason says the data isn't there (as opposed to the sequencer's own reasons). */\nexport function isDataBackedSkipReason(reason: string): reason is BrandlabSectionDataReason {\n return reason === 'merge-into-hero-checklist' || reason === 'merge-into-area-map' || /^no-[a-z0-9]+(?:-[a-z0-9]+)*$/.test(reason)\n}\n\n/** The attribute on the manifest's `<script type=\"application/json\">`. */\nexport const SECTION_MANIFEST_ATTRIBUTE = 'data-bl-manifest'\n\n/**\n * Page-level notes in the manifest. `cap-exceeded`: the required and conditional sections with data are more than\n * the cap, so they all render (neither drops for the cap) and the page is over its cap.\n */\nexport const SECTION_MANIFEST_FLAGS = ['cap-exceeded'] as const\nexport type BrandlabSectionManifestFlag = (typeof SECTION_MANIFEST_FLAGS)[number]\n\n/**\n * The per-page manifest K12 reads: what was planned, what rendered with which tone, and what was skipped and why. A\n * signature section carries its name (`signature`) and, when the site placed it, the section it follows (`after`).\n */\nexport interface BrandlabSectionManifest {\n readonly version: 1\n readonly family: BrandlabPageFamily\n readonly page?: string\n readonly cap: number\n readonly order: 'default' | 'recorded'\n readonly planned: readonly { readonly id: BrandlabSectionId; readonly requirement: BrandlabSectionRequirement }[]\n /** `id` is the planned place; `section` is what filled it (an alternative such as `before-after`, or the same id). */\n readonly rendered: readonly {\n readonly id: BrandlabSectionId\n readonly section: BrandlabSectionId\n readonly requirement: BrandlabSectionRequirement\n readonly tone: BrandlabSectionTone\n readonly signature?: string\n readonly after?: BrandlabSectionId\n }[]\n readonly skipped: readonly {\n readonly id: BrandlabSectionId\n readonly section: BrandlabSectionId\n readonly requirement: BrandlabSectionRequirement | 'N'\n readonly reason: BrandlabSectionSkipReason\n readonly signature?: string\n }[]\n /**\n * The rendered sections counted toward the cap: sections sharing one matrix position count once, and the strips and\n * signature sections (`UNCAPPED_SECTIONS`) not at all.\n */\n readonly counted: number\n readonly flags: readonly BrandlabSectionManifestFlag[]\n}\n\n/** One section a page offers the sequencer. */\nexport interface BrandlabSequenceCandidate {\n readonly id: BrandlabSectionId\n /** Defaults to ready. */\n readonly ready?: BrandlabSectionReadiness\n /** Defaults to `auto`. */\n readonly tone?: BrandlabSectionToneRequest\n /** A `signature` section's name (3.16.0), required for one: lower-case words joined by hyphens. */\n readonly signature?: string\n /**\n * Where a `signature` section goes (3.16.0): straight after this section of the family's order, or after the nearest\n * section before it that renders. Not before the proof strip, and never after the CTA band. Without it, the\n * signature takes the order's own `signature` place.\n */\n readonly after?: BrandlabSectionId\n}\n\nexport interface BrandlabSequencePlan {\n /** What renders, in order: the candidate's index, the planned place and the tone. */\n readonly rendered: readonly { readonly candidate: number; readonly id: BrandlabSectionId; readonly tone: BrandlabSectionTone }[]\n readonly manifest: BrandlabSectionManifest\n}\n\n/**\n * Tones for the sections that render, in order. `auto` sections alternate canvas and surface, so neighbours never\n * share a background; after a band or photo section the next light tone is the one the last light section didn't\n * have (Omega's `alternateTones`). Only the first `band` request and the first `photo` request are honoured, and\n * never twice in a row; later requests fall back to the light tones.\n */\nexport function assignSectionTones(requests: readonly BrandlabSectionToneRequest[]): BrandlabSectionTone[] {\n const tones: BrandlabSectionTone[] = []\n let previous: BrandlabSectionTone | undefined\n let lastLight: 'canvas' | 'surface' = 'surface'\n let bandUsed = false\n let photoUsed = false\n for (const request of requests) {\n let next: BrandlabSectionTone\n if (request === 'band' && !bandUsed && previous !== 'band') {\n next = 'band'\n bandUsed = true\n } else if (request === 'photo' && !photoUsed && previous !== 'photo') {\n next = 'photo'\n photoUsed = true\n } else if (previous === 'canvas') next = 'surface'\n else if (previous === 'surface') next = 'canvas'\n else next = lastLight === 'canvas' ? 'surface' : 'canvas'\n tones.push(next)\n previous = next\n if (next === 'canvas' || next === 'surface') lastLight = next\n }\n return tones\n}\n\n/** Only optional, then recommended, sections drop for the cap; K12 needs every R and C section with data rendered. */\nconst CAP_DROP_ORDER: readonly BrandlabSectionRequirement[] = ['O', 'Rec']\n\n/** Checks a signature candidate's name and place against the family's order; a mistake here is the site's code. */\nfunction assertSignature(order: BrandlabFamilyOrder, candidate: BrandlabSequenceCandidate): void {\n const where = `Signature section \"${candidate.signature ?? ''}\" on ${order.family} pages`\n if (typeof candidate.signature !== 'string' || !SIGNATURE_NAME_PATTERN.test(candidate.signature)) {\n throw new Error(`${where}: a signature section needs a name of lower-case words joined by hyphens, for example \"storm-line\".`)\n }\n if (candidate.after === undefined) return\n const ids = order.entries.map((entry) => entry.id)\n const at = ids.indexOf(candidate.after)\n if (at === -1) throw new Error(`${where}: \"${candidate.after}\" is not in the order, so it can't follow it.`)\n if (candidate.after === 'cta' || at === ids.length - 1) throw new Error(`${where}: nothing follows the last section.`)\n const proof = ids.indexOf('proof-strip')\n if (at < Math.max(proof, 0)) throw new Error(`${where}: it can't come before the proof strip.`)\n}\n\n/**\n * Plans one page: matches the page's candidate sections to the family order, skips what isn't ready, isn't offered or\n * isn't in the order, enforces the cap (optional, then recommended sections drop, last first; required and\n * conditional sections with data never drop: when they alone exceed the cap they all render and the manifest flags\n * `cap-exceeded`; the sections in `UNCAPPED_SECTIONS` don't count), places the signature sections (3.16.0), assigns\n * tones and writes the manifest.\n */\nexport function planSectionSequence(\n order: BrandlabFamilyOrder,\n candidates: readonly BrandlabSequenceCandidate[],\n page?: string,\n): BrandlabSequencePlan {\n const skipped: BrandlabSectionManifest['skipped'][number][] = []\n const used = new Set<number>()\n const chosen: { candidate: number; entry: BrandlabSectionOrderEntry }[] = []\n const isSignature = (candidate: BrandlabSequenceCandidate) => candidate.id === 'signature'\n\n for (const entry of order.entries) {\n // Signature sections are placed after the cap, by their own rules.\n if (entry.id === 'signature') {\n if (!candidates.some(isSignature)) skipped.push({ id: entry.id, section: entry.id, requirement: entry.requirement, reason: 'not-provided' })\n continue\n }\n const matches = candidates\n .map((candidate, index) => ({ candidate, index }))\n .filter(\n ({ candidate, index }) =>\n !used.has(index) && !isSignature(candidate) && (candidate.id === entry.id || entry.alternatives?.includes(candidate.id)),\n )\n if (matches.length === 0) {\n skipped.push({ id: entry.id, section: entry.id, requirement: entry.requirement, reason: 'not-provided' })\n continue\n }\n let filled = false\n for (const { candidate, index } of matches) {\n used.add(index)\n const ready = candidate.ready ?? SECTION_READY\n if (filled) skipped.push({ id: entry.id, section: candidate.id, requirement: entry.requirement, reason: 'duplicate' })\n else if (!ready.render) skipped.push({ id: entry.id, section: candidate.id, requirement: entry.requirement, reason: ready.reason })\n else {\n chosen.push({ candidate: index, entry })\n filled = true\n }\n }\n }\n\n candidates.forEach((candidate, index) => {\n if (!used.has(index) && !isSignature(candidate)) skipped.push({ id: candidate.id, section: candidate.id, requirement: 'N', reason: 'not-in-order' })\n })\n\n const counted = () => {\n const ids = new Set(chosen.map((pick) => pick.entry.id))\n return chosen.filter((pick) => !pick.entry.uncapped && !(pick.entry.countsWith && ids.has(pick.entry.countsWith))).length\n }\n // Sections sharing one matrix position drop together, so every drop lowers the count by one.\n const position = (pick: (typeof chosen)[number]) =>\n chosen.filter(\n (other) =>\n other === pick ||\n other.entry.countsWith === pick.entry.id ||\n pick.entry.countsWith === other.entry.id ||\n (pick.entry.countsWith !== undefined && other.entry.countsWith === pick.entry.countsWith),\n )\n for (const requirement of CAP_DROP_ORDER) {\n for (let index = chosen.length - 1; index >= 0 && counted() > order.cap; index -= 1) {\n const pick = chosen[index]\n if (!pick || pick.entry.requirement !== requirement || pick.entry.uncapped) continue\n const group = position(pick)\n if (!group.every((member) => CAP_DROP_ORDER.includes(member.entry.requirement))) continue\n for (const member of group) {\n skipped.push({\n id: member.entry.id,\n section: candidates[member.candidate]?.id ?? member.entry.id,\n requirement: member.entry.requirement,\n reason: 'cap',\n })\n chosen.splice(chosen.indexOf(member), 1)\n }\n index = Math.min(index, chosen.length)\n }\n }\n\n // Signature sections (3.16.0): each goes straight after the section it names (or the nearest one before it that\n // renders), or in the order's own `signature` place; at most SIGNATURE_LIMITS per family, never counted.\n // A recorded order may leave the `signature` place out; a signature placed with `after` still renders there.\n const ownPlace = order.entries.find((entry) => entry.id === 'signature')\n const place: BrandlabSectionOrderEntry = ownPlace ?? { id: 'signature', requirement: 'O', uncapped: true }\n const plannedAt = (id: BrandlabSectionId) => order.entries.findIndex((entry) => entry.id === id)\n const limit = SIGNATURE_LIMITS[order.family] ?? 0\n const placed: { candidate: number; entry: BrandlabSectionOrderEntry; anchor: number; after?: BrandlabSectionId }[] = []\n candidates.forEach((candidate, index) => {\n if (!isSignature(candidate)) return\n const signature = { signature: candidate.signature ?? '' }\n if (limit === 0 || (!ownPlace && candidate.after === undefined)) {\n skipped.push({ id: 'signature', section: 'signature', requirement: 'N', reason: 'not-in-order', ...signature })\n return\n }\n assertSignature(order, candidate)\n const ready = candidate.ready ?? SECTION_READY\n if (!ready.render) skipped.push({ id: 'signature', section: 'signature', requirement: place.requirement, reason: ready.reason, ...signature })\n else if (placed.length >= limit) skipped.push({ id: 'signature', section: 'signature', requirement: place.requirement, reason: 'limit', ...signature })\n else {\n // The anchor is the planned index the signature follows; the order's own place follows the section before it.\n const anchor = candidate.after !== undefined ? plannedAt(candidate.after) : plannedAt('signature') - 1\n placed.push({ candidate: index, entry: place, anchor, ...(candidate.after !== undefined ? { after: candidate.after } : {}) })\n }\n })\n const ordered: { candidate: number; entry: BrandlabSectionOrderEntry; after?: BrandlabSectionId }[] = []\n const pending = [...placed]\n for (const pick of chosen) {\n const at = plannedAt(pick.entry.id)\n // A signature anchored before this section goes in first (its anchor didn't render, or it is the place before).\n while (pending.length > 0 && pending.some((item) => item.anchor < at)) {\n const next = pending.findIndex((item) => item.anchor < at)\n ordered.push(...pending.splice(next, 1))\n }\n ordered.push(pick)\n }\n ordered.push(...pending)\n\n const tones = assignSectionTones(ordered.map((pick) => candidates[pick.candidate]?.tone ?? 'auto'))\n const rendered = ordered.map((pick, index) => ({ candidate: pick.candidate, id: pick.entry.id, tone: tones[index] ?? 'canvas' }))\n const manifest: BrandlabSectionManifest = {\n version: 1,\n family: order.family,\n ...(page !== undefined ? { page } : {}),\n cap: order.cap,\n order: order.source,\n planned: order.entries.map((entry) => ({ id: entry.id, requirement: entry.requirement })),\n rendered: ordered.map((pick, index) => {\n const candidate = candidates[pick.candidate]\n return {\n id: pick.entry.id,\n section: candidate?.id ?? pick.entry.id,\n requirement: pick.entry.requirement,\n tone: tones[index] ?? 'canvas',\n ...(candidate && isSignature(candidate) ? { signature: candidate.signature ?? '' } : {}),\n ...(pick.after !== undefined ? { after: pick.after } : {}),\n }\n }),\n skipped,\n counted: counted(),\n flags: counted() > order.cap ? ['cap-exceeded'] : [],\n }\n return { rendered, manifest }\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brandlab-digital/site-core",
3
- "version": "3.20.0",
3
+ "version": "4.0.0",
4
4
  "license": "UNLICENSED",
5
5
  "repository": {
6
6
  "type": "git",