@brandlab-digital/site-core 4.3.1 → 4.4.1

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.
@@ -1 +1 @@
1
- {"version":3,"file":"project.js","sourceRoot":"","sources":["../src/project.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAA;AACxD,OAAO,EAAE,+BAA+B,EAAE,MAAM,gBAAgB,CAAA;AA6FhE;;;GAGG;AACH,MAAM,CAAC,MAAM,2BAA2B,GACtC,+MAA+M,CAAA;AAEjN,oDAAoD;AACpD,MAAM,CAAC,MAAM,gCAAgC,GAAG,CAAC,QAAQ,EAAE,mBAAmB,EAAE,QAAQ,EAAE,SAAS,CAAU,CAAA;AAG7G,8FAA8F;AAC9F,MAAM,CAAC,MAAM,mCAAmC,GAAG,OAAO,CAAA;AAkB1D,uGAAuG;AACvG,MAAM,CAAC,MAAM,8BAA8B,GAAG,MAAqC,CAAA;AAEnF,iGAAiG;AACjG,MAAM,CAAC,MAAM,mCAAmC,GAAG,CAAC,CAAA;AA6EpD,MAAM,mBAAmB,GAAG;IAC1B,WAAW;IACX,QAAQ;IACR,cAAc;IACd,SAAS;IACT,qBAAqB;IACrB,YAAY;IACZ,YAAY;IACZ,SAAS;CACD,CAAA;AACV,MAAM,cAAc,GAAG,IAAI,GAAG,CAAsB;IAClD,UAAU;IACV,WAAW;IACX,mBAAmB;IACnB,MAAM;IACN,UAAU;IACV,OAAO;CACR,CAAC,CAAA;AACF,MAAM,aAAa,GAAG,IAAI,GAAG,CAAsB,CAAC,MAAM,EAAE,KAAK,EAAE,YAAY,CAAC,CAAC,CAAA;AACjF,MAAM,gBAAgB,GAAG,IAAI,GAAG,CAAgC;IAC9D,MAAM;IACN,iBAAiB;IACjB,iBAAiB;IACjB,0BAA0B;CAC3B,CAAC,CAAA;AACF,MAAM,mBAAmB,GAAG,IAAI,GAAG,CAA2B;IAC5D,MAAM;IACN,uBAA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ChC,MAAM,IAAI,KAAK,CAAC,cAAc,KAAK,0BAA0B,CAAC,CAAA;QAChE,CAAC;QAED,IAAI,SAAS,CAAC,SAAS,IAAI,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC;YACzE,MAAM,IAAI,KAAK,CAAC,cAAc,KAAK,mCAAmC,CAAC,CAAA;QACzE,CAAC;IACH,CAAC,CAAC,CAAA;IAEF,OAAO,MAAM,CAAA;AACf,CAAC","sourcesContent":["import { normalizeBrandlabRoutePath } from './routes.js'\nimport { assertBrandlabCanonicalEntityId } from './entity-id.js'\nimport type { GooglePlaceReviewsSelection } from './google-reviews.js'\nimport type { BusinessProfileReviewsPolicy } from './google-business-reviews.js'\n\nexport type BrandlabRouteFamily =\n | 'services'\n | 'locations'\n | 'service-locations'\n | 'blog'\n | 'projects'\n | 'legal'\n\nexport type BrandlabBlogAdapter = 'none' | 'mdx' | 'structured'\nexport type BrandlabContactAttachmentMode =\n | 'none'\n | 'images-optional'\n | 'images-required'\n | 'images-and-pdfs-optional'\nexport type BrandlabLocationStrategy =\n | 'none'\n | 'approved-service-area'\n | 'physical-location'\n | 'multi-location'\nexport type BrandlabReviewsProvider = 'google-places' | 'google-business-profile' | 'project-owned'\nexport type BrandlabGoogleReviewsMode = 'link-only' | 'summary' | 'full'\n\nexport type BrandlabReviewsCapability =\n | { provider: 'project-owned' }\n | {\n /** 3.5.0: Google reviews read on the server from the Brandlab reviews feed (site-next/google-business-reviews/server). */\n provider: 'google-business-profile'\n /** Optional presentation policy: the newest reviews, or the newest five-star ones. */\n selection?: BusinessProfileReviewsPolicy\n }\n | {\n provider: 'google-places'\n mode: BrandlabGoogleReviewsMode\n /** Optional presentation policy. Five-star selection is valid only in full mode. */\n selection?: GooglePlaceReviewsSelection\n /** Stable route IDs where review proof is intentionally presented. */\n routeIds: readonly string[]\n }\n\nexport interface BrandlabException {\n ruleId: string\n rationale: string\n owner: 'Romie'\n evidence: string\n expiresAt?: string\n reviewTrigger: string\n}\n\nexport type BrandlabSiteSystemTier = 'shell' | 'enquiry' | 'full'\n\n/**\n * Site System v2 adoption. `brandlab-ready` blocks on the declared tier's checks and the tiers below it; higher\n * tiers report without blocking. Absent means the site has not adopted v2 and nothing in the ready gate blocks.\n */\nexport interface BrandlabSiteSystemConfig {\n tier: BrandlabSiteSystemTier\n /** A new build or redesign: the same-trade distinctness check (D4) blocks whatever the tier. */\n newBuild?: boolean\n /** Extra pages the ready gate samples, beyond home, the contact page and one page per route. */\n samples?: readonly string[]\n /** Quote and call-to-action labels Romie recorded for this site, beyond the closed list. */\n labels?: readonly string[]\n /** Whether the business offers free quotes (\"Get a free quote\" rather than \"Get a quote\"). */\n freeQuotes?: boolean\n /** Third-party hostnames the site may load, for example www.youtube.com. */\n thirdParties?: readonly string[]\n /** Extra tel: links the site legitimately shows, for example a second line. */\n phones?: readonly string[]\n /**\n * Estate families allowed to refresh more often than every 7 days (check W3, from 3.13.0), each with the reason\n * and the recorded decision. Without an entry, a full-tier estate family refreshes at most weekly.\n */\n refreshExceptions?: readonly BrandlabEstateRefreshException[]\n /**\n * What the thank-you page promises about a reply (check C7, 3.15.0). Absent or `{ promise: true }`: the page names a\n * specific reply time (\"within one business day\"). `{ promise: false, ... }` records a decision to promise no time\n * and the exact wording the page uses instead.\n */\n replyTime?: BrandlabReplyTimeRecord\n}\n\n/**\n * The thank-you page's reply promise. A no-promise record carries the page's own wording (no time in it), who decided\n * (the owner, or Romie for the owner) and the day the decision was made.\n */\nexport type BrandlabReplyTimeRecord =\n | { promise: true }\n | { promise: false; wording: string; decidedBy: 'owner' | 'romie'; decidedOn: string }\n\n/**\n * Wording that still promises a time: a digit, minutes or hours, \"same day\", \"next day\", a business or working day,\n * \"end of the day\", \"today\" or \"tomorrow\". A no-promise record's wording must not match.\n */\nexport const BRANDLAB_REPLY_TIME_PROMISE =\n /\\d|\\b(?:minutes?|mins?|hours?|hrs?|today|tomorrow|overnight)\\b|\\b(?:same|next)[-\\s]+(?:business[-\\s]+|working[-\\s]+)?day\\b|\\b(?:business|working)[-\\s]+days?\\b|\\bend\\s+of\\s+(?:the\\s+)?(?:business\\s+)?day\\b/i\n\n/** The location estate families check W3 covers. */\nexport const BRANDLAB_ESTATE_REFRESH_FAMILIES = ['suburb', 'service-in-suburb', 'region', 'council'] as const\nexport type BrandlabEstateRefreshFamily = (typeof BRANDLAB_ESTATE_REFRESH_FAMILIES)[number]\n\n/** The shortest refresh an estate family may use without an exception: 7 days, in seconds. */\nexport const BRANDLAB_ESTATE_MIN_REFRESH_SECONDS = 604_800\n\nexport interface BrandlabEstateRefreshException {\n family: BrandlabEstateRefreshFamily\n /** The shortest refresh the family may use, in whole seconds (60 to 604,799). */\n revalidateSeconds: number\n /** Why the family needs to refresh more often than weekly. */\n reason: string\n /** The recorded decision that allows it, for example a Notion decision id. */\n decisionId: string\n}\n\n/** A Vercel function region a Brandlab site may run in: Sydney, or Washington with a recorded decision. */\nexport type BrandlabOriginRegion = 'syd1' | 'iad1'\n\n/** `hosting.originRegion`: one region, or both (`['syd1', 'iad1']`; the ISR store then always goes to iad1). */\nexport type BrandlabOriginRegionSetting = BrandlabOriginRegion | readonly BrandlabOriginRegion[]\n\n/** The region every site runs in unless a decision records another: Sydney, where the visitors are. */\nexport const BRANDLAB_DEFAULT_ORIGIN_REGION = 'syd1' satisfies BrandlabOriginRegion\n\n/** The longest a non-Sydney origin decision lasts before it is reviewed: six calendar months. */\nexport const BRANDLAB_ORIGIN_DECISION_MAX_MONTHS = 6\n\n/**\n * A recorded origin-region decision under rule `origin-region-v1` (operations/shared-platform/ORIGIN_REGION.md).\n * Any region other than Sydney needs one; it lapses on `reviewBy`, at most six months after `decidedOn`.\n */\nexport interface BrandlabOriginRegionDecision {\n rule: 'origin-region-v1'\n /** YYYY-MM-DD. */\n decidedOn: string\n /** Where the benchmark and the decision are recorded (a Notion page, a PR or a report path). */\n evidence: string\n /** The expected saving per billing cycle in US dollars (at least US$2 under the rule). */\n savingUsdPerCycle: number\n /** How much slower a cold miss was in the benchmark, in milliseconds (at most 250 under the rule). */\n coldMissDeltaMs: number\n /** YYYY-MM-DD, after `decidedOn` and no more than six months after it. The ready gate fails once it passes. */\n reviewBy: string\n}\n\n/** A firewall rule recorded for the ready gate's crawler guard (W10): what it matches in the user agent and does. */\nexport interface BrandlabFirewallRuleRecord {\n /** The rule's name or id in the Vercel or Cloudflare firewall. */\n id: string\n action: 'deny' | 'challenge' | 'rate-limit' | 'log' | 'bypass'\n /** How the rule matches the User-Agent header, as the firewall writes it. */\n userAgent: { match: 'contains' | 'equals' | 'regex'; value: string }\n}\n\n/**\n * Where the site's server functions run (3.13.0). `vercel.json` `regions` must equal `originRegion`; the default is\n * Sydney. Firewall rules that match on the user agent are recorded here so the ready gate can check them.\n */\nexport interface BrandlabHostingConfig {\n originRegion: BrandlabOriginRegionSetting\n decision?: BrandlabOriginRegionDecision\n firewall?: readonly BrandlabFirewallRuleRecord[]\n}\n\nexport type BrandlabSitemapConfig =\n | { mode: 'single' }\n | {\n mode: 'split'\n families: readonly string[]\n reason: string\n }\n\nexport interface BrandlabProjectConfig {\n projectId: string\n routes: {\n families: readonly BrandlabRouteFamily[]\n }\n capabilities?: {\n blog?: { adapter: BrandlabBlogAdapter }\n contact?: {\n fieldProfile: string\n attachments: BrandlabContactAttachmentMode\n }\n locations?: { strategy: BrandlabLocationStrategy }\n reviews?: BrandlabReviewsCapability\n }\n sitemap?: BrandlabSitemapConfig\n searchCertification: {\n representativeRoutes: {\n home: string\n contact?: string\n service?: string\n location?: string\n blog?: string\n }\n }\n exceptions?: readonly BrandlabException[]\n siteSystem?: BrandlabSiteSystemConfig\n /** Where the server functions run; absent means Sydney (`syd1`). */\n hosting?: BrandlabHostingConfig\n}\n\nconst PROJECT_CONFIG_KEYS = [\n 'projectId',\n 'routes',\n 'capabilities',\n 'sitemap',\n 'searchCertification',\n 'exceptions',\n 'siteSystem',\n 'hosting',\n] as const\nconst ROUTE_FAMILIES = new Set<BrandlabRouteFamily>([\n 'services',\n 'locations',\n 'service-locations',\n 'blog',\n 'projects',\n 'legal',\n])\nconst BLOG_ADAPTERS = new Set<BrandlabBlogAdapter>(['none', 'mdx', 'structured'])\nconst ATTACHMENT_MODES = new Set<BrandlabContactAttachmentMode>([\n 'none',\n 'images-optional',\n 'images-required',\n 'images-and-pdfs-optional',\n])\nconst LOCATION_STRATEGIES = new Set<BrandlabLocationStrategy>([\n 'none',\n 'approved-service-area',\n 'physical-location',\n 'multi-location',\n])\nconst REVIEWS_PROVIDERS = new Set<BrandlabReviewsProvider>([\n 'google-places',\n 'google-business-profile',\n 'project-owned',\n])\nconst GOOGLE_REVIEWS_MODES = new Set<BrandlabGoogleReviewsMode>([\n 'link-only',\n 'summary',\n 'full',\n])\nconst GOOGLE_REVIEWS_SELECTIONS = new Set<GooglePlaceReviewsSelection>([\n 'relevance',\n 'five-star-featured',\n])\nconst BUSINESS_PROFILE_REVIEWS_SELECTIONS = new Set<BusinessProfileReviewsPolicy>([\n 'recent',\n 'five-star',\n])\nconst SITE_SYSTEM_TIERS = new Set<BrandlabSiteSystemTier>(['shell', 'enquiry', 'full'])\nconst SITE_SYSTEM_KEYS = ['tier', 'newBuild', 'samples', 'labels', 'freeQuotes', 'thirdParties', 'phones', 'refreshExceptions', 'replyTime']\nconst REPLY_TIME_KEYS = ['promise', 'wording', 'decidedBy', 'decidedOn']\nconst REFRESH_EXCEPTION_KEYS = ['family', 'revalidateSeconds', 'reason', 'decisionId']\nconst HOSTNAME_PATTERN = /^(?=.{1,253}$)(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z]{2,63}$/\nconst TEL_HREF_PATTERN = /^tel:\\+?\\d{6,15}$/\n\nconst ORIGIN_REGIONS = new Set<BrandlabOriginRegion>(['syd1', 'iad1'])\nconst HOSTING_KEYS = ['originRegion', 'decision', 'firewall']\nconst DECISION_KEYS = ['rule', 'decidedOn', 'evidence', 'savingUsdPerCycle', 'coldMissDeltaMs', 'reviewBy']\nconst FIREWALL_ACTIONS = new Set(['deny', 'challenge', 'rate-limit', 'log', 'bypass'])\nconst FIREWALL_MATCHES = new Set(['contains', 'equals', 'regex'])\nconst ISO_DAY = /^(\\d{4})-(\\d{2})-(\\d{2})$/\n\n/** A YYYY-MM-DD calendar day as a UTC timestamp, or null when it is not a real day. */\nfunction isoDay(value: unknown): number | null {\n if (typeof value !== 'string') return null\n const match = ISO_DAY.exec(value)\n if (!match) return null\n const time = Date.UTC(Number(match[1]), Number(match[2]) - 1, Number(match[3]))\n return new Date(time).toISOString().slice(0, 10) === value ? time : null\n}\n\n/** The last day a decision taken on `decidedOn` may be reviewed by: the same day six months later (or month end). */\nexport function brandlabOriginDecisionReviewLimit(decidedOn: string): string {\n const start = isoDay(decidedOn)\n if (start === null) throw new Error('decidedOn must be a YYYY-MM-DD date.')\n const date = new Date(start)\n const day = date.getUTCDate()\n const target = new Date(Date.UTC(date.getUTCFullYear(), date.getUTCMonth() + BRANDLAB_ORIGIN_DECISION_MAX_MONTHS, 1))\n const lastDay = new Date(Date.UTC(target.getUTCFullYear(), target.getUTCMonth() + 1, 0)).getUTCDate()\n target.setUTCDate(Math.min(day, lastDay))\n return target.toISOString().slice(0, 10)\n}\n\n/** The regions `hosting.originRegion` names, sorted; Sydney alone when there is no hosting block. */\nexport function brandlabOriginRegions(hosting?: Pick<BrandlabHostingConfig, 'originRegion'>): BrandlabOriginRegion[] {\n const setting = hosting?.originRegion ?? BRANDLAB_DEFAULT_ORIGIN_REGION\n return [...new Set(typeof setting === 'string' ? [setting] : setting)].sort()\n}\n\n/**\n * Problems with a site's hosting record on `today` (YYYY-MM-DD): the ready gate (W5) fails on any. A region other\n * than Sydney needs an `origin-region-v1` decision whose `reviewBy` has not passed and is no more than six months\n * after `decidedOn`. The shape is checked too, because the gate reads the config without running it.\n */\nexport function brandlabHostingProblems(hosting: unknown, today: string): string[] {\n if (hosting === undefined) return []\n if (!hosting || typeof hosting !== 'object' || Array.isArray(hosting)) return ['hosting must be an object with an originRegion.']\n const record = hosting as Record<string, unknown>\n const problems: string[] = []\n const unknown = Object.keys(record).filter((key) => !HOSTING_KEYS.includes(key))\n if (unknown.length > 0) problems.push(`hosting contains unsupported keys: ${unknown.join(', ')}.`)\n const setting = record.originRegion\n const list = typeof setting === 'string' ? [setting] : Array.isArray(setting) ? setting : null\n if (\n !list ||\n list.length === 0 ||\n list.some((region) => !ORIGIN_REGIONS.has(region as BrandlabOriginRegion)) ||\n new Set(list).size !== list.length\n ) {\n problems.push(`hosting.originRegion must be 'syd1', 'iad1' or ['syd1', 'iad1'] (found ${JSON.stringify(setting)}).`)\n return problems\n }\n const sydneyOnly = list.length === 1 && list[0] === BRANDLAB_DEFAULT_ORIGIN_REGION\n const decision = record.decision\n if (decision === undefined) {\n if (!sydneyOnly) {\n problems.push(`hosting.originRegion ${JSON.stringify(setting)} needs a recorded origin-region-v1 decision (hosting.decision); only syd1 runs without one.`)\n }\n } else if (!decision || typeof decision !== 'object' || Array.isArray(decision)) {\n problems.push('hosting.decision must be an object.')\n } else {\n const entry = decision as Record<string, unknown>\n const extra = Object.keys(entry).filter((key) => !DECISION_KEYS.includes(key))\n if (extra.length > 0) problems.push(`hosting.decision contains unsupported keys: ${extra.join(', ')}.`)\n if (entry.rule !== 'origin-region-v1') problems.push(`hosting.decision.rule must be 'origin-region-v1' (found ${JSON.stringify(entry.rule)}).`)\n if (typeof entry.evidence !== 'string' || !entry.evidence.trim()) problems.push('hosting.decision.evidence must name where the benchmark and decision are recorded.')\n for (const key of ['savingUsdPerCycle', 'coldMissDeltaMs'] as const) {\n if (typeof entry[key] !== 'number' || !Number.isFinite(entry[key])) problems.push(`hosting.decision.${key} must be a number.`)\n }\n const decided = isoDay(entry.decidedOn)\n const review = isoDay(entry.reviewBy)\n if (decided === null) problems.push('hosting.decision.decidedOn must be a YYYY-MM-DD date.')\n if (review === null) problems.push('hosting.decision.reviewBy must be a YYYY-MM-DD date.')\n if (decided !== null && review !== null) {\n const limit = brandlabOriginDecisionReviewLimit(entry.decidedOn as string)\n if (review <= decided) problems.push(`hosting.decision.reviewBy (${entry.reviewBy}) must be after decidedOn (${entry.decidedOn}).`)\n else if ((entry.reviewBy as string) > limit) {\n problems.push(`hosting.decision.reviewBy (${entry.reviewBy}) is more than ${BRANDLAB_ORIGIN_DECISION_MAX_MONTHS} months after decidedOn (${entry.decidedOn}); review by ${limit} at the latest.`)\n }\n if (!sydneyOnly && isoDay(today) !== null && today > (entry.reviewBy as string)) {\n problems.push(`The origin-region decision for ${JSON.stringify(setting)} lapsed on ${entry.reviewBy}: review it under origin-region-v1 and record a new reviewBy, or move back to syd1.`)\n }\n }\n }\n const firewall = record.firewall\n if (firewall !== undefined) {\n if (!Array.isArray(firewall)) problems.push('hosting.firewall must be a list of recorded rules.')\n else {\n firewall.forEach((rule: unknown, index) => {\n const field = `hosting.firewall[${index}]`\n if (!rule || typeof rule !== 'object' || Array.isArray(rule)) {\n problems.push(`${field} must be an object.`)\n return\n }\n const entry = rule as Record<string, unknown>\n if (typeof entry.id !== 'string' || !entry.id.trim()) problems.push(`${field}.id must name the firewall rule.`)\n if (!FIREWALL_ACTIONS.has(entry.action as string)) problems.push(`${field}.action must be one of ${[...FIREWALL_ACTIONS].join(', ')}.`)\n const userAgent = entry.userAgent as Record<string, unknown> | undefined\n if (!userAgent || typeof userAgent !== 'object' || !FIREWALL_MATCHES.has(userAgent.match as string) || typeof userAgent.value !== 'string' || !userAgent.value) {\n problems.push(`${field}.userAgent must be { match: 'contains' | 'equals' | 'regex', value }.`)\n } else if (userAgent.match === 'regex') {\n try {\n new RegExp(userAgent.value)\n } catch {\n problems.push(`${field}.userAgent.value is not a valid regular expression.`)\n }\n }\n })\n }\n }\n return problems\n}\n\nfunction assertNonEmpty(value: string, field: string) {\n if (!value.trim()) {\n throw new Error(`${field} cannot be empty.`)\n }\n}\n\nfunction assertRootRelativePath(path: string, field: string) {\n try {\n normalizeBrandlabRoutePath(path)\n } catch {\n throw new Error(`${field} must be a root-relative path without a query string or hash.`)\n }\n}\n\nfunction assertKnownKeys(value: object, allowed: readonly string[], field: string, hint = '') {\n const unsupported = Object.keys(value).filter((key) => !allowed.includes(key))\n if (unsupported.length > 0) {\n throw new Error(`${field} contains unsupported keys: ${unsupported.join(', ')}.${hint}`)\n }\n}\n\nfunction assertRefreshExceptions(value: unknown) {\n const field = 'siteSystem.refreshExceptions'\n if (!Array.isArray(value)) throw new Error(`${field} must be a list.`)\n value.forEach((entry: unknown, index) => {\n const itemField = `${field}[${index}]`\n if (!entry || typeof entry !== 'object' || Array.isArray(entry)) {\n throw new Error(`${itemField} must be an object with family, revalidateSeconds, reason and decisionId.`)\n }\n assertKnownKeys(entry, REFRESH_EXCEPTION_KEYS, itemField)\n const exception = entry as Record<string, unknown>\n if (!(BRANDLAB_ESTATE_REFRESH_FAMILIES as readonly unknown[]).includes(exception.family)) {\n throw new Error(`${itemField}.family must be one of ${BRANDLAB_ESTATE_REFRESH_FAMILIES.join(', ')}.`)\n }\n const seconds = exception.revalidateSeconds\n if (!Number.isSafeInteger(seconds) || (seconds as number) < 60 || (seconds as number) >= BRANDLAB_ESTATE_MIN_REFRESH_SECONDS) {\n throw new Error(`${itemField}.revalidateSeconds must be whole seconds from 60 to 604799; weekly or slower needs no exception.`)\n }\n for (const key of ['reason', 'decisionId'] as const) {\n if (typeof exception[key] !== 'string') throw new Error(`${itemField}.${key} must be text.`)\n assertNonEmpty(exception[key] as string, `${itemField}.${key}`)\n }\n })\n assertUnique(value.map((entry: { family: string }) => entry.family), `${field}.family`)\n}\n\nfunction assertReplyTime(value: unknown) {\n const field = 'siteSystem.replyTime'\n if (!value || typeof value !== 'object' || Array.isArray(value) || typeof (value as { promise?: unknown }).promise !== 'boolean') {\n throw new Error(`${field} must be { promise: true } or { promise: false, wording, decidedBy, decidedOn }.`)\n }\n const record = value as Record<string, unknown>\n if (record.promise === true) {\n assertKnownKeys(record, ['promise'], field)\n return\n }\n assertKnownKeys(record, REPLY_TIME_KEYS, field)\n if (typeof record.wording !== 'string') throw new Error(`${field}.wording must be text.`)\n assertNonEmpty(record.wording, `${field}.wording`)\n if (BRANDLAB_REPLY_TIME_PROMISE.test(record.wording)) {\n throw new Error(`${field}.wording promises a reply time; a no-promise record uses wording such as \"We will call you back as soon as possible.\"`)\n }\n if (record.decidedBy !== 'owner' && record.decidedBy !== 'romie') {\n throw new Error(`${field}.decidedBy must be owner or romie.`)\n }\n if (isoDay(record.decidedOn) === null) throw new Error(`${field}.decidedOn must be a YYYY-MM-DD date.`)\n}\n\nfunction assertStringList(\n value: unknown,\n field: string,\n check: (item: string, itemField: string) => void,\n) {\n if (!Array.isArray(value)) {\n throw new Error(`${field} must be a list.`)\n }\n value.forEach((item, index) => {\n if (typeof item !== 'string') throw new Error(`${field}[${index}] must be text.`)\n check(item, `${field}[${index}]`)\n })\n assertUnique(value as string[], field)\n}\n\nfunction assertUnique(values: readonly string[], field: string) {\n const duplicate = values.find((value, index) => values.indexOf(value) !== index)\n if (duplicate) {\n throw new Error(`${field} contains duplicate value \"${duplicate}\".`)\n }\n}\n\n/**\n * Defines project-owned variation only. Runtime versions and global Brandlab\n * policy deliberately do not belong in this object.\n */\nexport function defineBrandlabProject<const T extends BrandlabProjectConfig>(config: T): T {\n if (!config || typeof config !== 'object' || Array.isArray(config)) {\n throw new TypeError('defineBrandlabProject requires a project configuration.')\n }\n assertKnownKeys(config, PROJECT_CONFIG_KEYS, 'Project configuration')\n assertNonEmpty(config.projectId, 'projectId')\n\n assertBrandlabCanonicalEntityId(config.projectId)\n\n if (!config.routes || typeof config.routes !== 'object') {\n throw new Error('routes.families is required.')\n }\n assertKnownKeys(\n config.routes,\n ['families'],\n 'routes',\n ' Redirects belong in the src/data/redirects.ts table.',\n )\n assertUnique(config.routes.families, 'routes.families')\n config.routes.families.forEach((family, index) => {\n if (!ROUTE_FAMILIES.has(family)) {\n throw new Error(`routes.families[${index}] is unsupported.`)\n }\n })\n\n const representativeRoutes = config.searchCertification.representativeRoutes\n Object.entries(representativeRoutes).forEach(([name, path]) => {\n if (path) assertRootRelativePath(path, `searchCertification.representativeRoutes.${name}`)\n })\n if (representativeRoutes.home !== '/') {\n throw new Error('searchCertification.representativeRoutes.home must be \"/\".')\n }\n\n if (config.capabilities?.contact) {\n assertNonEmpty(config.capabilities.contact.fieldProfile, 'contact.fieldProfile')\n if (!/^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(config.capabilities.contact.fieldProfile)) {\n throw new Error('contact.fieldProfile must be lowercase kebab-case.')\n }\n if (!ATTACHMENT_MODES.has(config.capabilities.contact.attachments)) {\n throw new Error('contact.attachments is unsupported.')\n }\n }\n if (\n config.capabilities?.blog &&\n !BLOG_ADAPTERS.has(config.capabilities.blog.adapter)\n ) {\n throw new Error('blog.adapter is unsupported.')\n }\n if (\n config.capabilities?.locations &&\n !LOCATION_STRATEGIES.has(config.capabilities.locations.strategy)\n ) {\n throw new Error('locations.strategy is unsupported.')\n }\n if (\n config.capabilities?.reviews &&\n !REVIEWS_PROVIDERS.has(config.capabilities.reviews.provider)\n ) {\n throw new Error('reviews.provider is unsupported.')\n }\n if (\n config.capabilities?.reviews?.provider === 'google-places' &&\n !config.routes.families.includes('legal')\n ) {\n throw new Error('Google Places reviews require the legal route family.')\n }\n if (config.capabilities?.reviews?.provider === 'google-places') {\n const reviews = config.capabilities.reviews\n if (!GOOGLE_REVIEWS_MODES.has(reviews.mode)) {\n throw new Error('reviews.mode is unsupported.')\n }\n if (reviews.selection && !GOOGLE_REVIEWS_SELECTIONS.has(reviews.selection)) {\n throw new Error('reviews.selection is unsupported.')\n }\n if (reviews.selection === 'five-star-featured' && reviews.mode !== 'full') {\n throw new Error('Five-star featured reviews require full mode.')\n }\n if (!Array.isArray(reviews.routeIds) || reviews.routeIds.length === 0) {\n throw new Error('Google Places reviews require at least one approved route ID.')\n }\n assertUnique(reviews.routeIds, 'reviews.routeIds')\n reviews.routeIds.forEach((routeId, index) => {\n if (!/^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(routeId)) {\n throw new Error(`reviews.routeIds[${index}] must be lowercase kebab-case.`)\n }\n })\n }\n\n if (config.capabilities?.reviews?.provider === 'google-business-profile') {\n const reviews = config.capabilities.reviews\n if (\n reviews.selection !== undefined &&\n !BUSINESS_PROFILE_REVIEWS_SELECTIONS.has(reviews.selection)\n ) {\n throw new Error('reviews.selection is unsupported.')\n }\n if ('exclude' in reviews) {\n throw new Error(\n 'reviews.exclude belongs in src/config/reviews.ts (reviews.exclude, passed to selectBusinessProfileReviews), not brandlab.config.',\n )\n }\n }\n\n if (config.sitemap?.mode === 'split') {\n if (config.sitemap.families.length === 0) {\n throw new Error('Split sitemap configuration requires at least one family.')\n }\n assertUnique(config.sitemap.families, 'sitemap.families')\n config.sitemap.families.forEach((path, index) =>\n assertRootRelativePath(path, `sitemap.families[${index}]`),\n )\n assertNonEmpty(config.sitemap.reason, 'sitemap.reason')\n }\n\n if (config.siteSystem !== undefined) {\n const siteSystem = config.siteSystem\n if (!siteSystem || typeof siteSystem !== 'object' || Array.isArray(siteSystem)) {\n throw new Error('siteSystem must be an object with a tier.')\n }\n assertKnownKeys(siteSystem, SITE_SYSTEM_KEYS, 'siteSystem')\n if (!SITE_SYSTEM_TIERS.has(siteSystem.tier)) {\n throw new Error('siteSystem.tier is unsupported.')\n }\n if (siteSystem.newBuild !== undefined && typeof siteSystem.newBuild !== 'boolean') {\n throw new Error('siteSystem.newBuild must be true or false.')\n }\n if (siteSystem.samples !== undefined) {\n if (!Array.isArray(siteSystem.samples)) {\n throw new Error('siteSystem.samples must be a list of paths.')\n }\n assertUnique(siteSystem.samples, 'siteSystem.samples')\n siteSystem.samples.forEach((path, index) =>\n assertRootRelativePath(path, `siteSystem.samples[${index}]`),\n )\n }\n if (siteSystem.labels !== undefined) {\n assertStringList(siteSystem.labels, 'siteSystem.labels', (label, field) => assertNonEmpty(label, field))\n }\n if (siteSystem.freeQuotes !== undefined && typeof siteSystem.freeQuotes !== 'boolean') {\n throw new Error('siteSystem.freeQuotes must be true or false.')\n }\n if (siteSystem.thirdParties !== undefined) {\n assertStringList(siteSystem.thirdParties, 'siteSystem.thirdParties', (host, field) => {\n if (!HOSTNAME_PATTERN.test(host)) throw new Error(`${field} must be a hostname such as www.youtube.com.`)\n })\n }\n if (siteSystem.phones !== undefined) {\n assertStringList(siteSystem.phones, 'siteSystem.phones', (href, field) => {\n if (!TEL_HREF_PATTERN.test(href)) throw new Error(`${field} must be a tel: link such as tel:+61290001234.`)\n })\n }\n if (siteSystem.refreshExceptions !== undefined) {\n assertRefreshExceptions(siteSystem.refreshExceptions)\n }\n if (siteSystem.replyTime !== undefined) {\n assertReplyTime(siteSystem.replyTime)\n }\n }\n\n if (config.hosting !== undefined) {\n // The date-bound lapse is the ready gate's (W5): a lapsed decision must not stop a build or a rollback.\n const problems = brandlabHostingProblems(config.hosting, '0000-01-01')\n if (problems.length > 0) throw new Error(problems[0])\n }\n\n assertUnique(\n (config.exceptions ?? []).map((exception) => exception.ruleId),\n 'exceptions.ruleId',\n )\n\n ;(config.exceptions ?? []).forEach((exception, index) => {\n assertNonEmpty(exception.ruleId, `exceptions[${index}].ruleId`)\n assertNonEmpty(exception.rationale, `exceptions[${index}].rationale`)\n assertNonEmpty(exception.evidence, `exceptions[${index}].evidence`)\n assertNonEmpty(exception.reviewTrigger, `exceptions[${index}].reviewTrigger`)\n if (exception.owner !== 'Romie') {\n throw new Error(`exceptions[${index}].owner must be \"Romie\".`)\n }\n\n if (exception.expiresAt && Number.isNaN(Date.parse(exception.expiresAt))) {\n throw new Error(`exceptions[${index}].expiresAt must be a valid date.`)\n }\n })\n\n return config\n}\n"]}
1
+ {"version":3,"file":"project.js","sourceRoot":"","sources":["../src/project.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAA;AACxD,OAAO,EAAE,+BAA+B,EAAE,MAAM,gBAAgB,CAAA;AAmGhE,uEAAuE;AACvE,MAAM,C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nimport { assertBrandlabCanonicalEntityId } from './entity-id.js'\nimport type { GooglePlaceReviewsSelection } from './google-reviews.js'\nimport type { BusinessProfileReviewsPolicy } from './google-business-reviews.js'\n\nexport type BrandlabRouteFamily =\n | 'services'\n | 'locations'\n | 'service-locations'\n | 'blog'\n | 'projects'\n | 'legal'\n\nexport type BrandlabBlogAdapter = 'none' | 'mdx' | 'structured'\nexport type BrandlabContactAttachmentMode =\n | 'none'\n | 'images-optional'\n | 'images-required'\n | 'images-and-pdfs-optional'\nexport type BrandlabLocationStrategy =\n | 'none'\n | 'approved-service-area'\n | 'physical-location'\n | 'multi-location'\nexport type BrandlabReviewsProvider = 'google-places' | 'google-business-profile' | 'project-owned'\nexport type BrandlabGoogleReviewsMode = 'link-only' | 'summary' | 'full'\n\nexport type BrandlabReviewsCapability =\n | { provider: 'project-owned' }\n | {\n /** 3.5.0: Google reviews read on the server from the Brandlab reviews feed (site-next/google-business-reviews/server). */\n provider: 'google-business-profile'\n /** Optional presentation policy: the newest reviews, or the newest five-star ones. */\n selection?: BusinessProfileReviewsPolicy\n }\n | {\n provider: 'google-places'\n mode: BrandlabGoogleReviewsMode\n /** Optional presentation policy. Five-star selection is valid only in full mode. */\n selection?: GooglePlaceReviewsSelection\n /** Stable route IDs where review proof is intentionally presented. */\n routeIds: readonly string[]\n }\n\nexport interface BrandlabException {\n ruleId: string\n rationale: string\n owner: 'Romie'\n evidence: string\n expiresAt?: string\n reviewTrigger: string\n}\n\nexport type BrandlabSiteSystemTier = 'shell' | 'enquiry' | 'full'\n\n/**\n * Site System v2 adoption. `brandlab-ready` blocks on the declared tier's checks and the tiers below it; higher\n * tiers report without blocking. Absent means the site has not adopted v2 and nothing in the ready gate blocks.\n */\nexport interface BrandlabSiteSystemConfig {\n tier: BrandlabSiteSystemTier\n /** A new build or redesign: the same-trade distinctness check (D4) blocks whatever the tier. */\n newBuild?: boolean\n /** Extra pages the ready gate samples, beyond home, the contact page and one page per route. */\n samples?: readonly string[]\n /** Quote and call-to-action labels Romie recorded for this site, beyond the closed list. */\n labels?: readonly string[]\n /** Whether the business offers free quotes (\"Get a free quote\" rather than \"Get a quote\"). */\n freeQuotes?: boolean\n /** Third-party hostnames the site may load, for example www.youtube.com. */\n thirdParties?: readonly string[]\n /** Extra tel: links the site legitimately shows, for example a second line. */\n phones?: readonly string[]\n /**\n * Estate families allowed to refresh more often than every 7 days (check W3, from 3.13.0), each with the reason\n * and the recorded decision. Without an entry, a full-tier estate family refreshes at most weekly.\n */\n refreshExceptions?: readonly BrandlabEstateRefreshException[]\n /**\n * What the thank-you page promises about a reply (check C7, 3.15.0). Absent or `{ promise: true }`: the page names a\n * specific reply time (\"within one business day\"). `{ promise: false, ... }` records a decision to promise no time\n * and the exact wording the page uses instead.\n */\n replyTime?: BrandlabReplyTimeRecord\n /**\n * The site's own design kit as the ready gate reads it (check K8, 4.4.0). Absent: a page carries at most one\n * section in the `band` tone, as before.\n */\n kit?: BrandlabSiteKitRecord\n}\n\n/**\n * What a site's design kit declares to the ready gate. `tones` lists the section tones that have a per-page limit,\n * by the `data-tone` name the site's sections carry: `{ band: 2, feature: 1 }` lets a page carry two band sections\n * and one feature section. A tone that is not listed has no limit. Neighbouring sections still differ in tone.\n */\nexport interface BrandlabSiteKitRecord {\n tones: Readonly<Record<string, number>>\n}\n\n/** The most sections of one limited tone a kit may allow on a page. */\nexport const BRANDLAB_SITE_KIT_TONE_MAX = 12\n\n/**\n * The thank-you page's reply promise. A no-promise record carries the page's own wording (no time in it), who decided\n * (the owner, or Romie for the owner) and the day the decision was made.\n */\nexport type BrandlabReplyTimeRecord =\n | { promise: true }\n | { promise: false; wording: string; decidedBy: 'owner' | 'romie'; decidedOn: string }\n\n/**\n * Wording that still promises a time: a digit, minutes or hours, \"same day\", \"next day\", a business or working day,\n * \"end of the day\", \"today\" or \"tomorrow\". A no-promise record's wording must not match.\n */\nexport const BRANDLAB_REPLY_TIME_PROMISE =\n /\\d|\\b(?:minutes?|mins?|hours?|hrs?|today|tomorrow|overnight)\\b|\\b(?:same|next)[-\\s]+(?:business[-\\s]+|working[-\\s]+)?day\\b|\\b(?:business|working)[-\\s]+days?\\b|\\bend\\s+of\\s+(?:the\\s+)?(?:business\\s+)?day\\b/i\n\n/** The location estate families check W3 covers. */\nexport const BRANDLAB_ESTATE_REFRESH_FAMILIES = ['suburb', 'service-in-suburb', 'region', 'council'] as const\nexport type BrandlabEstateRefreshFamily = (typeof BRANDLAB_ESTATE_REFRESH_FAMILIES)[number]\n\n/** The shortest refresh an estate family may use without an exception: 7 days, in seconds. */\nexport const BRANDLAB_ESTATE_MIN_REFRESH_SECONDS = 604_800\n\nexport interface BrandlabEstateRefreshException {\n family: BrandlabEstateRefreshFamily\n /** The shortest refresh the family may use, in whole seconds (60 to 604,799). */\n revalidateSeconds: number\n /** Why the family needs to refresh more often than weekly. */\n reason: string\n /** The recorded decision that allows it, for example a Notion decision id. */\n decisionId: string\n}\n\n/** A Vercel function region a Brandlab site may run in: Sydney, or Washington with a recorded decision. */\nexport type BrandlabOriginRegion = 'syd1' | 'iad1'\n\n/** `hosting.originRegion`: one region, or both (`['syd1', 'iad1']`; the ISR store then always goes to iad1). */\nexport type BrandlabOriginRegionSetting = BrandlabOriginRegion | readonly BrandlabOriginRegion[]\n\n/** The region every site runs in unless a decision records another: Sydney, where the visitors are. */\nexport const BRANDLAB_DEFAULT_ORIGIN_REGION = 'syd1' satisfies BrandlabOriginRegion\n\n/** The longest a non-Sydney origin decision lasts before it is reviewed: six calendar months. */\nexport const BRANDLAB_ORIGIN_DECISION_MAX_MONTHS = 6\n\n/**\n * A recorded origin-region decision under rule `origin-region-v1` (operations/shared-platform/ORIGIN_REGION.md).\n * Any region other than Sydney needs one; it lapses on `reviewBy`, at most six months after `decidedOn`.\n */\nexport interface BrandlabOriginRegionDecision {\n rule: 'origin-region-v1'\n /** YYYY-MM-DD. */\n decidedOn: string\n /** Where the benchmark and the decision are recorded (a Notion page, a PR or a report path). */\n evidence: string\n /** The expected saving per billing cycle in US dollars (at least US$2 under the rule). */\n savingUsdPerCycle: number\n /** How much slower a cold miss was in the benchmark, in milliseconds (at most 250 under the rule). */\n coldMissDeltaMs: number\n /** YYYY-MM-DD, after `decidedOn` and no more than six months after it. The ready gate fails once it passes. */\n reviewBy: string\n}\n\n/** A firewall rule recorded for the ready gate's crawler guard (W10): what it matches in the user agent and does. */\nexport interface BrandlabFirewallRuleRecord {\n /** The rule's name or id in the Vercel or Cloudflare firewall. */\n id: string\n action: 'deny' | 'challenge' | 'rate-limit' | 'log' | 'bypass'\n /** How the rule matches the User-Agent header, as the firewall writes it. */\n userAgent: { match: 'contains' | 'equals' | 'regex'; value: string }\n}\n\n/**\n * Where the site's server functions run (3.13.0). `vercel.json` `regions` must equal `originRegion`; the default is\n * Sydney. Firewall rules that match on the user agent are recorded here so the ready gate can check them.\n */\nexport interface BrandlabHostingConfig {\n originRegion: BrandlabOriginRegionSetting\n decision?: BrandlabOriginRegionDecision\n firewall?: readonly BrandlabFirewallRuleRecord[]\n}\n\nexport type BrandlabSitemapConfig =\n | { mode: 'single' }\n | {\n mode: 'split'\n families: readonly string[]\n reason: string\n }\n\nexport interface BrandlabProjectConfig {\n projectId: string\n routes: {\n families: readonly BrandlabRouteFamily[]\n }\n capabilities?: {\n blog?: { adapter: BrandlabBlogAdapter }\n contact?: {\n fieldProfile: string\n attachments: BrandlabContactAttachmentMode\n }\n locations?: { strategy: BrandlabLocationStrategy }\n reviews?: BrandlabReviewsCapability\n }\n sitemap?: BrandlabSitemapConfig\n searchCertification: {\n representativeRoutes: {\n home: string\n contact?: string\n service?: string\n location?: string\n blog?: string\n }\n }\n exceptions?: readonly BrandlabException[]\n siteSystem?: BrandlabSiteSystemConfig\n /** Where the server functions run; absent means Sydney (`syd1`). */\n hosting?: BrandlabHostingConfig\n}\n\nconst PROJECT_CONFIG_KEYS = [\n 'projectId',\n 'routes',\n 'capabilities',\n 'sitemap',\n 'searchCertification',\n 'exceptions',\n 'siteSystem',\n 'hosting',\n] as const\nconst ROUTE_FAMILIES = new Set<BrandlabRouteFamily>([\n 'services',\n 'locations',\n 'service-locations',\n 'blog',\n 'projects',\n 'legal',\n])\nconst BLOG_ADAPTERS = new Set<BrandlabBlogAdapter>(['none', 'mdx', 'structured'])\nconst ATTACHMENT_MODES = new Set<BrandlabContactAttachmentMode>([\n 'none',\n 'images-optional',\n 'images-required',\n 'images-and-pdfs-optional',\n])\nconst LOCATION_STRATEGIES = new Set<BrandlabLocationStrategy>([\n 'none',\n 'approved-service-area',\n 'physical-location',\n 'multi-location',\n])\nconst REVIEWS_PROVIDERS = new Set<BrandlabReviewsProvider>([\n 'google-places',\n 'google-business-profile',\n 'project-owned',\n])\nconst GOOGLE_REVIEWS_MODES = new Set<BrandlabGoogleReviewsMode>([\n 'link-only',\n 'summary',\n 'full',\n])\nconst GOOGLE_REVIEWS_SELECTIONS = new Set<GooglePlaceReviewsSelection>([\n 'relevance',\n 'five-star-featured',\n])\nconst BUSINESS_PROFILE_REVIEWS_SELECTIONS = new Set<BusinessProfileReviewsPolicy>([\n 'recent',\n 'five-star',\n])\nconst SITE_SYSTEM_TIERS = new Set<BrandlabSiteSystemTier>(['shell', 'enquiry', 'full'])\nconst SITE_SYSTEM_KEYS = ['tier', 'newBuild', 'samples', 'labels', 'freeQuotes', 'thirdParties', 'phones', 'refreshExceptions', 'replyTime', 'kit']\nconst REPLY_TIME_KEYS = ['promise', 'wording', 'decidedBy', 'decidedOn']\nconst REFRESH_EXCEPTION_KEYS = ['family', 'revalidateSeconds', 'reason', 'decisionId']\nconst HOSTNAME_PATTERN = /^(?=.{1,253}$)(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z]{2,63}$/\nconst TEL_HREF_PATTERN = /^tel:\\+?\\d{6,15}$/\n\nconst ORIGIN_REGIONS = new Set<BrandlabOriginRegion>(['syd1', 'iad1'])\nconst HOSTING_KEYS = ['originRegion', 'decision', 'firewall']\nconst DECISION_KEYS = ['rule', 'decidedOn', 'evidence', 'savingUsdPerCycle', 'coldMissDeltaMs', 'reviewBy']\nconst FIREWALL_ACTIONS = new Set(['deny', 'challenge', 'rate-limit', 'log', 'bypass'])\nconst FIREWALL_MATCHES = new Set(['contains', 'equals', 'regex'])\nconst ISO_DAY = /^(\\d{4})-(\\d{2})-(\\d{2})$/\n\n/** A YYYY-MM-DD calendar day as a UTC timestamp, or null when it is not a real day. */\nfunction isoDay(value: unknown): number | null {\n if (typeof value !== 'string') return null\n const match = ISO_DAY.exec(value)\n if (!match) return null\n const time = Date.UTC(Number(match[1]), Number(match[2]) - 1, Number(match[3]))\n return new Date(time).toISOString().slice(0, 10) === value ? time : null\n}\n\n/** The last day a decision taken on `decidedOn` may be reviewed by: the same day six months later (or month end). */\nexport function brandlabOriginDecisionReviewLimit(decidedOn: string): string {\n const start = isoDay(decidedOn)\n if (start === null) throw new Error('decidedOn must be a YYYY-MM-DD date.')\n const date = new Date(start)\n const day = date.getUTCDate()\n const target = new Date(Date.UTC(date.getUTCFullYear(), date.getUTCMonth() + BRANDLAB_ORIGIN_DECISION_MAX_MONTHS, 1))\n const lastDay = new Date(Date.UTC(target.getUTCFullYear(), target.getUTCMonth() + 1, 0)).getUTCDate()\n target.setUTCDate(Math.min(day, lastDay))\n return target.toISOString().slice(0, 10)\n}\n\n/** The regions `hosting.originRegion` names, sorted; Sydney alone when there is no hosting block. */\nexport function brandlabOriginRegions(hosting?: Pick<BrandlabHostingConfig, 'originRegion'>): BrandlabOriginRegion[] {\n const setting = hosting?.originRegion ?? BRANDLAB_DEFAULT_ORIGIN_REGION\n return [...new Set(typeof setting === 'string' ? [setting] : setting)].sort()\n}\n\n/**\n * Problems with a site's hosting record on `today` (YYYY-MM-DD): the ready gate (W5) fails on any. A region other\n * than Sydney needs an `origin-region-v1` decision whose `reviewBy` has not passed and is no more than six months\n * after `decidedOn`. The shape is checked too, because the gate reads the config without running it.\n */\nexport function brandlabHostingProblems(hosting: unknown, today: string): string[] {\n if (hosting === undefined) return []\n if (!hosting || typeof hosting !== 'object' || Array.isArray(hosting)) return ['hosting must be an object with an originRegion.']\n const record = hosting as Record<string, unknown>\n const problems: string[] = []\n const unknown = Object.keys(record).filter((key) => !HOSTING_KEYS.includes(key))\n if (unknown.length > 0) problems.push(`hosting contains unsupported keys: ${unknown.join(', ')}.`)\n const setting = record.originRegion\n const list = typeof setting === 'string' ? [setting] : Array.isArray(setting) ? setting : null\n if (\n !list ||\n list.length === 0 ||\n list.some((region) => !ORIGIN_REGIONS.has(region as BrandlabOriginRegion)) ||\n new Set(list).size !== list.length\n ) {\n problems.push(`hosting.originRegion must be 'syd1', 'iad1' or ['syd1', 'iad1'] (found ${JSON.stringify(setting)}).`)\n return problems\n }\n const sydneyOnly = list.length === 1 && list[0] === BRANDLAB_DEFAULT_ORIGIN_REGION\n const decision = record.decision\n if (decision === undefined) {\n if (!sydneyOnly) {\n problems.push(`hosting.originRegion ${JSON.stringify(setting)} needs a recorded origin-region-v1 decision (hosting.decision); only syd1 runs without one.`)\n }\n } else if (!decision || typeof decision !== 'object' || Array.isArray(decision)) {\n problems.push('hosting.decision must be an object.')\n } else {\n const entry = decision as Record<string, unknown>\n const extra = Object.keys(entry).filter((key) => !DECISION_KEYS.includes(key))\n if (extra.length > 0) problems.push(`hosting.decision contains unsupported keys: ${extra.join(', ')}.`)\n if (entry.rule !== 'origin-region-v1') problems.push(`hosting.decision.rule must be 'origin-region-v1' (found ${JSON.stringify(entry.rule)}).`)\n if (typeof entry.evidence !== 'string' || !entry.evidence.trim()) problems.push('hosting.decision.evidence must name where the benchmark and decision are recorded.')\n for (const key of ['savingUsdPerCycle', 'coldMissDeltaMs'] as const) {\n if (typeof entry[key] !== 'number' || !Number.isFinite(entry[key])) problems.push(`hosting.decision.${key} must be a number.`)\n }\n const decided = isoDay(entry.decidedOn)\n const review = isoDay(entry.reviewBy)\n if (decided === null) problems.push('hosting.decision.decidedOn must be a YYYY-MM-DD date.')\n if (review === null) problems.push('hosting.decision.reviewBy must be a YYYY-MM-DD date.')\n if (decided !== null && review !== null) {\n const limit = brandlabOriginDecisionReviewLimit(entry.decidedOn as string)\n if (review <= decided) problems.push(`hosting.decision.reviewBy (${entry.reviewBy}) must be after decidedOn (${entry.decidedOn}).`)\n else if ((entry.reviewBy as string) > limit) {\n problems.push(`hosting.decision.reviewBy (${entry.reviewBy}) is more than ${BRANDLAB_ORIGIN_DECISION_MAX_MONTHS} months after decidedOn (${entry.decidedOn}); review by ${limit} at the latest.`)\n }\n if (!sydneyOnly && isoDay(today) !== null && today > (entry.reviewBy as string)) {\n problems.push(`The origin-region decision for ${JSON.stringify(setting)} lapsed on ${entry.reviewBy}: review it under origin-region-v1 and record a new reviewBy, or move back to syd1.`)\n }\n }\n }\n const firewall = record.firewall\n if (firewall !== undefined) {\n if (!Array.isArray(firewall)) problems.push('hosting.firewall must be a list of recorded rules.')\n else {\n firewall.forEach((rule: unknown, index) => {\n const field = `hosting.firewall[${index}]`\n if (!rule || typeof rule !== 'object' || Array.isArray(rule)) {\n problems.push(`${field} must be an object.`)\n return\n }\n const entry = rule as Record<string, unknown>\n if (typeof entry.id !== 'string' || !entry.id.trim()) problems.push(`${field}.id must name the firewall rule.`)\n if (!FIREWALL_ACTIONS.has(entry.action as string)) problems.push(`${field}.action must be one of ${[...FIREWALL_ACTIONS].join(', ')}.`)\n const userAgent = entry.userAgent as Record<string, unknown> | undefined\n if (!userAgent || typeof userAgent !== 'object' || !FIREWALL_MATCHES.has(userAgent.match as string) || typeof userAgent.value !== 'string' || !userAgent.value) {\n problems.push(`${field}.userAgent must be { match: 'contains' | 'equals' | 'regex', value }.`)\n } else if (userAgent.match === 'regex') {\n try {\n new RegExp(userAgent.value)\n } catch {\n problems.push(`${field}.userAgent.value is not a valid regular expression.`)\n }\n }\n })\n }\n }\n return problems\n}\n\nfunction assertNonEmpty(value: string, field: string) {\n if (!value.trim()) {\n throw new Error(`${field} cannot be empty.`)\n }\n}\n\nfunction assertRootRelativePath(path: string, field: string) {\n try {\n normalizeBrandlabRoutePath(path)\n } catch {\n throw new Error(`${field} must be a root-relative path without a query string or hash.`)\n }\n}\n\nfunction assertKnownKeys(value: object, allowed: readonly string[], field: string, hint = '') {\n const unsupported = Object.keys(value).filter((key) => !allowed.includes(key))\n if (unsupported.length > 0) {\n throw new Error(`${field} contains unsupported keys: ${unsupported.join(', ')}.${hint}`)\n }\n}\n\nfunction assertRefreshExceptions(value: unknown) {\n const field = 'siteSystem.refreshExceptions'\n if (!Array.isArray(value)) throw new Error(`${field} must be a list.`)\n value.forEach((entry: unknown, index) => {\n const itemField = `${field}[${index}]`\n if (!entry || typeof entry !== 'object' || Array.isArray(entry)) {\n throw new Error(`${itemField} must be an object with family, revalidateSeconds, reason and decisionId.`)\n }\n assertKnownKeys(entry, REFRESH_EXCEPTION_KEYS, itemField)\n const exception = entry as Record<string, unknown>\n if (!(BRANDLAB_ESTATE_REFRESH_FAMILIES as readonly unknown[]).includes(exception.family)) {\n throw new Error(`${itemField}.family must be one of ${BRANDLAB_ESTATE_REFRESH_FAMILIES.join(', ')}.`)\n }\n const seconds = exception.revalidateSeconds\n if (!Number.isSafeInteger(seconds) || (seconds as number) < 60 || (seconds as number) >= BRANDLAB_ESTATE_MIN_REFRESH_SECONDS) {\n throw new Error(`${itemField}.revalidateSeconds must be whole seconds from 60 to 604799; weekly or slower needs no exception.`)\n }\n for (const key of ['reason', 'decisionId'] as const) {\n if (typeof exception[key] !== 'string') throw new Error(`${itemField}.${key} must be text.`)\n assertNonEmpty(exception[key] as string, `${itemField}.${key}`)\n }\n })\n assertUnique(value.map((entry: { family: string }) => entry.family), `${field}.family`)\n}\n\nfunction assertSiteKit(value: unknown) {\n const field = 'siteSystem.kit'\n if (!value || typeof value !== 'object' || Array.isArray(value)) throw new Error(`${field} must be { tones: { band: 2 } }.`)\n assertKnownKeys(value as Record<string, unknown>, ['tones'], field)\n const tones = (value as { tones?: unknown }).tones\n if (!tones || typeof tones !== 'object' || Array.isArray(tones)) throw new Error(`${field}.tones must map each limited data-tone name to the sections a page may carry.`)\n for (const [name, limit] of Object.entries(tones as Record<string, unknown>)) {\n if (!/^[a-z][a-z0-9-]*$/.test(name)) throw new Error(`${field}.tones: \"${name}\" is not a data-tone name (lower case letters, digits and hyphens).`)\n if (!Number.isSafeInteger(limit) || (limit as number) < 1 || (limit as number) > BRANDLAB_SITE_KIT_TONE_MAX) {\n throw new Error(`${field}.tones.${name} must be a whole number from 1 to ${BRANDLAB_SITE_KIT_TONE_MAX}.`)\n }\n }\n}\n\nfunction assertReplyTime(value: unknown) {\n const field = 'siteSystem.replyTime'\n if (!value || typeof value !== 'object' || Array.isArray(value) || typeof (value as { promise?: unknown }).promise !== 'boolean') {\n throw new Error(`${field} must be { promise: true } or { promise: false, wording, decidedBy, decidedOn }.`)\n }\n const record = value as Record<string, unknown>\n if (record.promise === true) {\n assertKnownKeys(record, ['promise'], field)\n return\n }\n assertKnownKeys(record, REPLY_TIME_KEYS, field)\n if (typeof record.wording !== 'string') throw new Error(`${field}.wording must be text.`)\n assertNonEmpty(record.wording, `${field}.wording`)\n if (BRANDLAB_REPLY_TIME_PROMISE.test(record.wording)) {\n throw new Error(`${field}.wording promises a reply time; a no-promise record uses wording such as \"We will call you back as soon as possible.\"`)\n }\n if (record.decidedBy !== 'owner' && record.decidedBy !== 'romie') {\n throw new Error(`${field}.decidedBy must be owner or romie.`)\n }\n if (isoDay(record.decidedOn) === null) throw new Error(`${field}.decidedOn must be a YYYY-MM-DD date.`)\n}\n\nfunction assertStringList(\n value: unknown,\n field: string,\n check: (item: string, itemField: string) => void,\n) {\n if (!Array.isArray(value)) {\n throw new Error(`${field} must be a list.`)\n }\n value.forEach((item, index) => {\n if (typeof item !== 'string') throw new Error(`${field}[${index}] must be text.`)\n check(item, `${field}[${index}]`)\n })\n assertUnique(value as string[], field)\n}\n\nfunction assertUnique(values: readonly string[], field: string) {\n const duplicate = values.find((value, index) => values.indexOf(value) !== index)\n if (duplicate) {\n throw new Error(`${field} contains duplicate value \"${duplicate}\".`)\n }\n}\n\n/**\n * Defines project-owned variation only. Runtime versions and global Brandlab\n * policy deliberately do not belong in this object.\n */\nexport function defineBrandlabProject<const T extends BrandlabProjectConfig>(config: T): T {\n if (!config || typeof config !== 'object' || Array.isArray(config)) {\n throw new TypeError('defineBrandlabProject requires a project configuration.')\n }\n assertKnownKeys(config, PROJECT_CONFIG_KEYS, 'Project configuration')\n assertNonEmpty(config.projectId, 'projectId')\n\n assertBrandlabCanonicalEntityId(config.projectId)\n\n if (!config.routes || typeof config.routes !== 'object') {\n throw new Error('routes.families is required.')\n }\n assertKnownKeys(\n config.routes,\n ['families'],\n 'routes',\n ' Redirects belong in the src/data/redirects.ts table.',\n )\n assertUnique(config.routes.families, 'routes.families')\n config.routes.families.forEach((family, index) => {\n if (!ROUTE_FAMILIES.has(family)) {\n throw new Error(`routes.families[${index}] is unsupported.`)\n }\n })\n\n const representativeRoutes = config.searchCertification.representativeRoutes\n Object.entries(representativeRoutes).forEach(([name, path]) => {\n if (path) assertRootRelativePath(path, `searchCertification.representativeRoutes.${name}`)\n })\n if (representativeRoutes.home !== '/') {\n throw new Error('searchCertification.representativeRoutes.home must be \"/\".')\n }\n\n if (config.capabilities?.contact) {\n assertNonEmpty(config.capabilities.contact.fieldProfile, 'contact.fieldProfile')\n if (!/^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(config.capabilities.contact.fieldProfile)) {\n throw new Error('contact.fieldProfile must be lowercase kebab-case.')\n }\n if (!ATTACHMENT_MODES.has(config.capabilities.contact.attachments)) {\n throw new Error('contact.attachments is unsupported.')\n }\n }\n if (\n config.capabilities?.blog &&\n !BLOG_ADAPTERS.has(config.capabilities.blog.adapter)\n ) {\n throw new Error('blog.adapter is unsupported.')\n }\n if (\n config.capabilities?.locations &&\n !LOCATION_STRATEGIES.has(config.capabilities.locations.strategy)\n ) {\n throw new Error('locations.strategy is unsupported.')\n }\n if (\n config.capabilities?.reviews &&\n !REVIEWS_PROVIDERS.has(config.capabilities.reviews.provider)\n ) {\n throw new Error('reviews.provider is unsupported.')\n }\n if (\n config.capabilities?.reviews?.provider === 'google-places' &&\n !config.routes.families.includes('legal')\n ) {\n throw new Error('Google Places reviews require the legal route family.')\n }\n if (config.capabilities?.reviews?.provider === 'google-places') {\n const reviews = config.capabilities.reviews\n if (!GOOGLE_REVIEWS_MODES.has(reviews.mode)) {\n throw new Error('reviews.mode is unsupported.')\n }\n if (reviews.selection && !GOOGLE_REVIEWS_SELECTIONS.has(reviews.selection)) {\n throw new Error('reviews.selection is unsupported.')\n }\n if (reviews.selection === 'five-star-featured' && reviews.mode !== 'full') {\n throw new Error('Five-star featured reviews require full mode.')\n }\n if (!Array.isArray(reviews.routeIds) || reviews.routeIds.length === 0) {\n throw new Error('Google Places reviews require at least one approved route ID.')\n }\n assertUnique(reviews.routeIds, 'reviews.routeIds')\n reviews.routeIds.forEach((routeId, index) => {\n if (!/^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(routeId)) {\n throw new Error(`reviews.routeIds[${index}] must be lowercase kebab-case.`)\n }\n })\n }\n\n if (config.capabilities?.reviews?.provider === 'google-business-profile') {\n const reviews = config.capabilities.reviews\n if (\n reviews.selection !== undefined &&\n !BUSINESS_PROFILE_REVIEWS_SELECTIONS.has(reviews.selection)\n ) {\n throw new Error('reviews.selection is unsupported.')\n }\n if ('exclude' in reviews) {\n throw new Error(\n 'reviews.exclude belongs in src/config/reviews.ts (reviews.exclude, passed to selectBusinessProfileReviews), not brandlab.config.',\n )\n }\n }\n\n if (config.sitemap?.mode === 'split') {\n if (config.sitemap.families.length === 0) {\n throw new Error('Split sitemap configuration requires at least one family.')\n }\n assertUnique(config.sitemap.families, 'sitemap.families')\n config.sitemap.families.forEach((path, index) =>\n assertRootRelativePath(path, `sitemap.families[${index}]`),\n )\n assertNonEmpty(config.sitemap.reason, 'sitemap.reason')\n }\n\n if (config.siteSystem !== undefined) {\n const siteSystem = config.siteSystem\n if (!siteSystem || typeof siteSystem !== 'object' || Array.isArray(siteSystem)) {\n throw new Error('siteSystem must be an object with a tier.')\n }\n assertKnownKeys(siteSystem, SITE_SYSTEM_KEYS, 'siteSystem')\n if (!SITE_SYSTEM_TIERS.has(siteSystem.tier)) {\n throw new Error('siteSystem.tier is unsupported.')\n }\n if (siteSystem.newBuild !== undefined && typeof siteSystem.newBuild !== 'boolean') {\n throw new Error('siteSystem.newBuild must be true or false.')\n }\n if (siteSystem.samples !== undefined) {\n if (!Array.isArray(siteSystem.samples)) {\n throw new Error('siteSystem.samples must be a list of paths.')\n }\n assertUnique(siteSystem.samples, 'siteSystem.samples')\n siteSystem.samples.forEach((path, index) =>\n assertRootRelativePath(path, `siteSystem.samples[${index}]`),\n )\n }\n if (siteSystem.labels !== undefined) {\n assertStringList(siteSystem.labels, 'siteSystem.labels', (label, field) => assertNonEmpty(label, field))\n }\n if (siteSystem.freeQuotes !== undefined && typeof siteSystem.freeQuotes !== 'boolean') {\n throw new Error('siteSystem.freeQuotes must be true or false.')\n }\n if (siteSystem.thirdParties !== undefined) {\n assertStringList(siteSystem.thirdParties, 'siteSystem.thirdParties', (host, field) => {\n if (!HOSTNAME_PATTERN.test(host)) throw new Error(`${field} must be a hostname such as www.youtube.com.`)\n })\n }\n if (siteSystem.phones !== undefined) {\n assertStringList(siteSystem.phones, 'siteSystem.phones', (href, field) => {\n if (!TEL_HREF_PATTERN.test(href)) throw new Error(`${field} must be a tel: link such as tel:+61290001234.`)\n })\n }\n if (siteSystem.refreshExceptions !== undefined) {\n assertRefreshExceptions(siteSystem.refreshExceptions)\n }\n if (siteSystem.replyTime !== undefined) {\n assertReplyTime(siteSystem.replyTime)\n }\n if (siteSystem.kit !== undefined) {\n assertSiteKit(siteSystem.kit)\n }\n }\n\n if (config.hosting !== undefined) {\n // The date-bound lapse is the ready gate's (W5): a lapsed decision must not stop a build or a rollback.\n const problems = brandlabHostingProblems(config.hosting, '0000-01-01')\n if (problems.length > 0) throw new Error(problems[0])\n }\n\n assertUnique(\n (config.exceptions ?? []).map((exception) => exception.ruleId),\n 'exceptions.ruleId',\n )\n\n ;(config.exceptions ?? []).forEach((exception, index) => {\n assertNonEmpty(exception.ruleId, `exceptions[${index}].ruleId`)\n assertNonEmpty(exception.rationale, `exceptions[${index}].rationale`)\n assertNonEmpty(exception.evidence, `exceptions[${index}].evidence`)\n assertNonEmpty(exception.reviewTrigger, `exceptions[${index}].reviewTrigger`)\n if (exception.owner !== 'Romie') {\n throw new Error(`exceptions[${index}].owner must be \"Romie\".`)\n }\n\n if (exception.expiresAt && Number.isNaN(Date.parse(exception.expiresAt))) {\n throw new Error(`exceptions[${index}].expiresAt must be a valid date.`)\n }\n })\n\n return config\n}\n"]}
@@ -9,6 +9,10 @@
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
  *
12
+ * 4.4.0 (Romie's 20 November 2026 ruling): a page's own search brief sets its section order. `briefSectionOrder`
13
+ * turns the brief's list into the order `planSectionSequence` takes; the family defaults stay as the starting point
14
+ * for pages without a brief, and the ready gate (K12) no longer holds a briefed page to them.
15
+ *
12
16
  * 3.16.0: the strips (the proof strip and the emergency band) and the site's signature sections don't count toward the
13
17
  * cap (`UNCAPPED_SECTIONS`), so a trade band never pushes out the page's own content, and a signature section takes
14
18
  * the place the site declares (`after`), up to `SIGNATURE_LIMITS` per family.
@@ -39,7 +43,8 @@ export interface BrandlabFamilyOrder {
39
43
  readonly family: BrandlabPageFamily;
40
44
  /** The most sections the page renders (v1 §7.1). */
41
45
  readonly cap: number;
42
- readonly source: 'default' | 'recorded';
46
+ /** `brief` (4.4.0): the order one page's brief sets, built with `briefSectionOrder`. */
47
+ readonly source: 'default' | 'recorded' | 'brief';
43
48
  readonly entries: readonly BrandlabSectionOrderEntry[];
44
49
  }
45
50
  /**
@@ -139,6 +144,19 @@ export type BrandlabSectionOrders = Readonly<Record<BrandlabPageFamily, Brandlab
139
144
  * first, the CTA band last and the proof strip within the first five; the contact page can't be reordered.
140
145
  */
141
146
  export declare function defineSectionOrder(input?: BrandlabSectionOrderInput, tradeMap?: Readonly<Partial<Record<BrandlabTrade, BrandlabTradeSectionRules>>>): BrandlabSectionOrders;
147
+ /** The sections a page may open with. */
148
+ export declare const LEAD_SECTIONS: readonly BrandlabSectionId[];
149
+ /**
150
+ * The order one page's brief sets (4.4.0). The brief lists the page's sections in its own order; nothing is taken
151
+ * from the family's default order except the cap and the signature limit. The only rules are structural:
152
+ * - the page opens with its hero, page header or article header;
153
+ * - the CTA band, when the brief has one, comes last (the contact page has none and keeps its own two sections);
154
+ * - a suburb page keeps its area map (`area-map`), which carries the links to nearby suburbs;
155
+ * - no section is listed twice.
156
+ * The lead, the CTA band and a suburb page's area map are required; every other listed section is conditional: it
157
+ * renders when its data exists and otherwise says what is missing. Pass the result to `planSectionSequence`.
158
+ */
159
+ export declare function briefSectionOrder(family: BrandlabPageFamily, sections: readonly BrandlabSectionId[]): BrandlabFamilyOrder;
142
160
  /** The reasons the sequencer itself skips a section. */
143
161
  export declare const SEQUENCER_SKIP_REASONS: readonly ["not-provided", "not-in-order", "duplicate", "cap", "limit"];
144
162
  export type BrandlabSequencerSkipReason = (typeof SEQUENCER_SKIP_REASONS)[number];
@@ -176,7 +194,7 @@ export interface BrandlabSectionManifest {
176
194
  readonly family: BrandlabPageFamily;
177
195
  readonly page?: string;
178
196
  readonly cap: number;
179
- readonly order: 'default' | 'recorded';
197
+ readonly order: 'default' | 'recorded' | 'brief';
180
198
  readonly planned: readonly {
181
199
  readonly id: BrandlabSectionId;
182
200
  readonly requirement: BrandlabSectionRequirement;
@@ -1 +1 @@
1
- {"version":3,"file":"section-order.d.ts","sourceRoot":"","sources":["../src/section-order.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,eAAO,MAAM,oBAAoB,0bAmCvB,CAAA;AACV,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,oBAAoB,CAAC,CAAC,MAAM,CAAC,C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BAAoB;IACnC,qFAAqF;IACrF,QAAQ,CAAC,QAAQ,EAAE,SAAS;QAAE,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,EAAE,iBAAiB,CAAC;QAAC,QAAQ,CAAC,IAAI,EAAE,mBAAmB,CAAA;KAAE,EAAE,CAAA;IAChI,QAAQ,CAAC,QAAQ,EAAE,uBAAuB,CAAA;CAC3C;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,SAAS,0BAA0B,EAAE,GAAG,mBAAmB,EAAE,CAsBzG;AAoBD;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,mBAAmB,EAC1B,UAAU,EAAE,SAAS,yBAAyB,EAAE,EAChD,IAAI,CAAC,EAAE,MAAM,GACZ,oBAAoB,CAsItB"}
@@ -9,6 +9,10 @@
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
  *
12
+ * 4.4.0 (Romie's 20 November 2026 ruling): a page's own search brief sets its section order. `briefSectionOrder`
13
+ * turns the brief's list into the order `planSectionSequence` takes; the family defaults stay as the starting point
14
+ * for pages without a brief, and the ready gate (K12) no longer holds a briefed page to them.
15
+ *
12
16
  * 3.16.0: the strips (the proof strip and the emergency band) and the site's signature sections don't count toward the
13
17
  * cap (`UNCAPPED_SECTIONS`), so a trade band never pushes out the page's own content, and a signature section takes
14
18
  * the place the site declares (`after`), up to `SIGNATURE_LIMITS` per family.
@@ -497,6 +501,58 @@ export function defineSectionOrder(input = {}, tradeMap = SECTION_ORDER_TRADE_MA
497
501
  }));
498
502
  return Object.freeze(orders);
499
503
  }
504
+ /** The sections a page may open with. */
505
+ export const LEAD_SECTIONS = Object.freeze(['hero', 'page-header', 'article-header']);
506
+ /**
507
+ * The order one page's brief sets (4.4.0). The brief lists the page's sections in its own order; nothing is taken
508
+ * from the family's default order except the cap and the signature limit. The only rules are structural:
509
+ * - the page opens with its hero, page header or article header;
510
+ * - the CTA band, when the brief has one, comes last (the contact page has none and keeps its own two sections);
511
+ * - a suburb page keeps its area map (`area-map`), which carries the links to nearby suburbs;
512
+ * - no section is listed twice.
513
+ * The lead, the CTA band and a suburb page's area map are required; every other listed section is conditional: it
514
+ * renders when its data exists and otherwise says what is missing. Pass the result to `planSectionSequence`.
515
+ */
516
+ export function briefSectionOrder(family, sections) {
517
+ const fail = (detail) => {
518
+ throw new Error(`Brief section order for ${family}: ${detail}`);
519
+ };
520
+ if (!BRANDLAB_PAGE_FAMILIES.includes(family))
521
+ throw new Error(`Unknown page family "${String(family)}".`);
522
+ if (family === 'contact')
523
+ fail('the contact page is the page header and the contact block, and nothing else.');
524
+ if (!Array.isArray(sections) || sections.length === 0)
525
+ fail('list the sections the brief calls for.');
526
+ const seen = new Set();
527
+ for (const id of sections) {
528
+ if (!BRANDLAB_SECTION_IDS.includes(id))
529
+ fail(`"${String(id)}" is not a section.`);
530
+ if (id === 'contact')
531
+ fail('the contact block belongs to the contact page.');
532
+ if (seen.has(id) && id !== 'signature')
533
+ fail(`"${id}" appears twice.`);
534
+ seen.add(id);
535
+ }
536
+ const first = sections[0];
537
+ if (!LEAD_SECTIONS.includes(first))
538
+ fail(`the page opens with ${LEAD_SECTIONS.join(', ')}, not "${first}".`);
539
+ if (sections.slice(1).some((id) => LEAD_SECTIONS.includes(id)))
540
+ fail('only the first section is a hero or header.');
541
+ const cta = sections.indexOf('cta');
542
+ if (cta !== -1 && cta !== sections.length - 1)
543
+ fail('the CTA band comes last.');
544
+ if (family === 'suburb' && !seen.has('area-map'))
545
+ fail('a suburb page keeps its area map ("area-map"), which carries the links to nearby suburbs.');
546
+ if (sections.filter((id) => id === 'signature').length > 1)
547
+ fail('"signature" appears twice; list its place once.');
548
+ const required = new Set([first, 'cta', ...(family === 'suburb' ? ['area-map'] : [])]);
549
+ return Object.freeze({
550
+ family,
551
+ cap: SECTION_CAPS[family],
552
+ source: 'brief',
553
+ entries: Object.freeze(sections.map((id) => toEntry([id, id === 'signature' ? 'O' : required.has(id) ? 'R' : 'C']))),
554
+ });
555
+ }
500
556
  /** The reasons the sequencer itself skips a section. */
501
557
  export const SEQUENCER_SKIP_REASONS = ['not-provided', 'not-in-order', 'duplicate', 'cap', 'limit'];
502
558
  export const SECTION_READY = Object.freeze({ render: true });