@brandlab-digital/site-core 3.14.0 → 3.15.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.
- package/README.md +33 -1
- package/dist/area-map.d.ts +36 -3
- package/dist/area-map.d.ts.map +1 -1
- package/dist/area-map.js +71 -11
- package/dist/area-map.js.map +1 -1
- package/dist/business.d.ts +17 -1
- package/dist/business.d.ts.map +1 -1
- package/dist/business.js +14 -2
- package/dist/business.js.map +1 -1
- package/dist/geography.js +2 -2
- package/dist/geography.js.map +1 -1
- package/dist/jobs.d.ts +6 -3
- package/dist/jobs.d.ts.map +1 -1
- package/dist/jobs.js +12 -3
- package/dist/jobs.js.map +1 -1
- package/dist/project.d.ts +23 -0
- package/dist/project.d.ts.map +1 -1
- package/dist/project.js +33 -1
- package/dist/project.js.map +1 -1
- package/dist/section-order.d.ts +3 -2
- package/dist/section-order.d.ts.map +1 -1
- package/dist/section-order.js +15 -3
- package/dist/section-order.js.map +1 -1
- package/dist/strategy.d.ts +36 -0
- package/dist/strategy.d.ts.map +1 -1
- package/dist/strategy.js +40 -0
- package/dist/strategy.js.map +1 -1
- package/package.json +1 -1
package/dist/strategy.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"strategy.js","sourceRoot":"","sources":["../src/strategy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAIH,mGAAmG;AACnG,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,aAAa;IACb,WAAW;IACX,aAAa;IACb,eAAe;IACf,WAAW;IACX,gBAAgB;IAChB,cAAc;CACN,CAAA;AA4EV;;;GAGG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,SAAS,EAAE,QAAQ,CAAU,CAAA;AAgE7D;;;GAGG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,EAAE,CAAA;AACxC,MAAM,CAAC,MAAM,sBAAsB,GAAG,EAAE,CAAA;AAExC,MAAM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IAAI,MAAM,GAAG,QAAQ,IAAI,GAAG,CAAA;IAC5B,IAAI,QAAQ,KAAK,SAAS,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC;QACxD,yGAAyG;QACzG,MAAM,GAAG,GAAG,CAAC,KAAK,CAAC,eAAe,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,OAAO,CAAC,aAAa,EAAE,UAAU,CAAC,KAAK,QAAQ,CAAC,CAAA;QACxH,IAAI,CAAC,GAAG;YAAE,MAAM,IAAI,KAAK,CAAC,IAAI,QAAQ,qCAAqC,CAAC,CAAA;QAC5E,MAAM,GAAG,QAAQ,CAAA;IACnB,CAAC;IACD,IAAI,MAAM,KAAK,SAAS;QAAE,MAAM,IAAI,KAAK,CAAC,8BAA8B,IAAI,QAAQ,CAAC,CAAA;IACrF,MAAM,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,MAAM,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAA;IACvD,OAAO,GAAG,MAAM,IAAI,gBAAgB,CAAC,IAAI,EAAE,IAAI,EAAE,YAAY,CAAC,EAAE,CAAA;AAClE,CAAC","sourcesContent":["/**\n * The site strategy record (3.8.0). One literal per site, in `src/data/strategy.ts`, that the checks read.\n *\n * 3.8.0 holds what check D4 (same-trade distinctness) needs: the site's own look levers and the same-trade competitors\n * with theirs. `navigation` (3.9.0) is what Romie recorded for the menu: an exact order, labels outside the closed\n * list, whether Areas is a dropdown. 3.12.0 adds two optional parts the full tier reads: `phrases`, one owning page per\n * primary phrase (E10), and `waves`, the dated release schedule of a location estate (the location indexing guard).\n * Every location page is indexed (D4, 20 Oct 2026); the schedule only dates when each page enters the index and the\n * sitemap.\n *\n * The levers are recorded values, not measurements: the person building the look writes them down, and D4 compares\n * the records. A shared display font counts as the same lever, and an action hue within 20 degrees counts as the same.\n * Card style, photo treatment and the home sections are the same only when every part of them matches.\n */\n\nimport type { BrandlabRecordedNavigation } from './navigation.js'\n\n/** The seven look levers D4 compares (Site System v2 §7.7), in the order the record lists them. */\nexport const SITE_LOOK_LEVERS = [\n 'displayFont',\n 'actionHue',\n 'heroVariant',\n 'headerVariant',\n 'cardStyle',\n 'photoTreatment',\n 'homeSections',\n] as const\n\nexport type SiteLookLever = (typeof SITE_LOOK_LEVERS)[number]\n\n/** The card tokens the site's cards use. Two card styles are the same only when all three match. */\nexport interface SiteCardStyle {\n /** The corner radius token value, for example \"16px\" or \"0\". */\n radius: string\n /** The border token value, for example \"1px solid line\" or \"none\". */\n border: string\n /** The shadow token value, for example \"soft\" or \"none\". */\n shadow: string\n}\n\n/** How the site treats photographs. Two treatments are the same only when all three match. */\nexport interface SitePhotoTreatment {\n /** The crop ratio, for example \"4:3\" or \"16:9\". */\n cropRatio: string\n /** The scrim over photographs, for example \"light gradient\" or \"none\". */\n scrim: string\n /** The frame around photographs, for example \"rounded\" or \"square\". */\n frame: string\n}\n\n/** The home page's section order and its signature sections. */\nexport interface SiteHomeSections {\n /** The home page's sections in order, by section id. */\n sectionOrder: readonly string[]\n /** The sections or elements that make the home page recognisable, for example \"grass-edge divider\". May be empty. */\n signatures: readonly string[]\n}\n\n/** One site's look, as recorded. */\nexport interface SiteLook {\n /** The display (heading) font family, for example \"Plus Jakarta Sans\". */\n displayFont: string\n /** The hue of the main action colour in degrees: 0 up to, not including, 360. */\n actionHue: number\n /** The hero variant the site uses, as its skin names it. */\n heroVariant: string\n /** The header variant the site uses, as its skin names it. */\n headerVariant: string\n cardStyle: SiteCardStyle\n photoTreatment: SitePhotoTreatment\n homeSections: SiteHomeSections\n}\n\n/** A same-trade business with an overlapping service area, and its recorded look. */\nexport interface SiteCompetitor {\n name: string\n /** The bare domain, lowercase, for example \"example.com.au\". */\n domain: string\n /** The trade it shares with this site, for example \"tree services\". */\n trade: string\n look: SiteLook\n}\n\n/** A primary phrase and the one page that owns it (v2 §4.2, §5.3). */\nexport interface SitePhraseOwner {\n /** The searched phrase, for example \"blocked drains\" or \"plumber sydney\". */\n phrase: string\n /** The owning page's path, for example \"/services/blocked-drains\". */\n route: string\n}\n\n/** Phrase ownership: one page per primary phrase (E10). */\nexport interface SitePhrases {\n /**\n * The main trade, for example \"plumber\". The suburb page owns \"{mainTrade} {suburb}\" and the region page\n * \"{mainTrade} {region}\", so there is no service-in-suburb page or service-region hub for it.\n */\n mainTrade: string\n /** Every primary phrase with its owning page. No phrase has two owners. */\n owners: readonly SitePhraseOwner[]\n}\n\n/**\n * A wave's kind (3.14.0): `release` brings new pages (they may not be built before the day); `return` brings existing\n * pages of an existing estate back to the index (they are built and live now, noindex until the day).\n */\nexport const SITE_WAVE_KINDS = ['release', 'return'] as const\nexport type SiteWaveKind = (typeof SITE_WAVE_KINDS)[number]\n\n/** One wave of a location estate's release (v2 §4.4 step 8). */\nexport interface SiteReleaseWave {\n /** YYYY-MM-DD: from this day the wave's pages are indexable and in the sitemap. */\n releaseOn: string\n /** Defaults to `release` (3.14.0). */\n kind?: SiteWaveKind\n /** Paths or patterns: `*` matches within one path segment, `**` across segments, for example \"/services/decking/*\". */\n routes: readonly string[]\n}\n\n/**\n * Where an estate's location pages live (3.14.0): one path per family, with `{region}` or `{suburb}` as the last\n * segment. Service-in-suburb families may nest under a service (`/tree-services/stump-grinding/{suburb}`); their\n * service-region hubs take `{region}` in the same place.\n */\nexport interface SiteEstatePaths {\n region?: string\n suburb?: string\n serviceInSuburb?: readonly string[]\n}\n\n/**\n * An existing location estate's plan (3.14.0, D4 b): the pages indexed now, where the families live and the public\n * slugs that differ from the registry's. Every location page is indexed now or listed in a wave; a page indexed now\n * never waits for a wave. Where region and suburb pages share a parent, a region slug that is also a suburb's sends the\n * suburb to \"{slug}-suburb\" (AA: region `ryde`, suburb `ryde-suburb`). Public slugs apply on every location path.\n */\nexport interface SiteEstatePlan {\n /** Paths or patterns of the location pages indexable and in the sitemap today. */\n indexedNow: readonly string[]\n paths?: SiteEstatePaths\n slugs?: {\n /** Registry region slug → public slug, for example `{ 'ryde-area': 'ryde' }`. */\n regions?: Readonly<Record<string, string>>\n /** Registry suburb slug → public slug, always \"{slug}-suburb\", for example `{ ryde: 'ryde-suburb' }`. */\n suburbs?: Readonly<Record<string, string>>\n }\n}\n\n/**\n * Both fields are optional so a site can start the record before its look is settled; check D4 still fails a new\n * build or redesign whose record lacks either.\n */\nexport interface SiteStrategy {\n /** Same-trade competitors with overlapping regions, fellow Brandlab clients first. */\n competitors?: readonly SiteCompetitor[]\n /** This site's own look. */\n look?: SiteLook\n /** The menu order, labels or Areas dropdown Romie recorded, when he recorded one (N1 reproduces it exactly). */\n navigation?: BrandlabRecordedNavigation\n /** Phrase ownership (3.12.0). */\n phrases?: SitePhrases\n /**\n * The location estate's release waves, in date order (3.12.0). A location page a wave dates in the future may be\n * noindex or out of the sitemap until that day; every other location page is indexable and listed now.\n */\n waves?: readonly SiteReleaseWave[]\n /** An existing estate's plan: pages indexed now, family paths and public slugs (3.14.0). */\n estate?: SiteEstatePlan\n}\n\n/**\n * Consecutive waves go out at least 14 and at most 28 days apart, and the next wave still to come is at most 28 days\n * after the last one released (or after today when none is) (v2 §4.4 step 8: never all at once, never open-ended).\n */\nexport const SITE_WAVE_MIN_GAP_DAYS = 14\nexport const SITE_WAVE_MAX_GAP_DAYS = 28\n\nconst ROUTE_PATTERN = /^\\/(?:[A-Za-z0-9._~%*-]+(?:\\/[A-Za-z0-9._~%*-]+)*)?$/\nconst ISO_DAY = /^\\d{4}-\\d{2}-\\d{2}$/\nconst DAY_MS = 86_400_000\n\n/** A phrase as E10 compares it: lowercase words, \"&\" read as \"and\", punctuation dropped, a plural \"s\" dropped. */\nexport function normaliseSitePhrase(phrase: string): string {\n return phrase\n .toLowerCase()\n .replace(/&/g, ' and ')\n .replace(/[^a-z0-9]+/g, ' ')\n .trim()\n .split(' ')\n .map((word) => (word.length > 3 && word.endsWith('s') && !word.endsWith('ss') ? word.slice(0, -1) : word))\n .join(' ')\n}\n\n/** Whether a path matches a wave route: an exact path, or a pattern with `*` (one segment) and `**` (any depth). */\nexport function matchesWaveRoute(path: string, route: string): boolean {\n if (!route.includes('*')) return path === route\n const source = route\n .split(/(\\*\\*|\\*)/)\n .map((part) => (part === '**' ? '.*' : part === '*' ? '[^/]*' : part.replace(/[.+?^${}()|[\\]\\\\]/g, '\\\\$&')))\n .join('')\n return new RegExp(`^${source}$`).test(path)\n}\n\n/** The wave that dates a path, or undefined when no wave lists it. */\nexport function waveForRoute(waves: readonly SiteReleaseWave[], path: string): SiteReleaseWave | undefined {\n return waves.find((wave) => wave.routes.some((route) => matchesWaveRoute(path, route)))\n}\n\nconst DOMAIN = /^(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z]{2,}$/\n\nfunction assertText(value: unknown, field: string, maximum = 160) {\n if (\n typeof value !== 'string' ||\n !value.trim() ||\n value.trim() !== value ||\n value.length > maximum ||\n /[\\u0000-\\u001f\\u007f]/.test(value)\n ) {\n throw new Error(`${field} must be bounded, trimmed text.`)\n }\n}\n\nfunction assertKnownKeys(value: unknown, allowed: readonly string[], field: string) {\n if (\n !value ||\n typeof value !== 'object' ||\n Array.isArray(value) ||\n ![Object.prototype, null].includes(Object.getPrototypeOf(value))\n ) {\n throw new Error(`${field} must be a plain object.`)\n }\n const unknown = Object.keys(value).find((key) => !allowed.includes(key))\n if (unknown) throw new Error(`${field}.${unknown} is not a supported strategy key.`)\n}\n\nfunction assertExactKeys(value: unknown, allowed: readonly string[], field: string, optional: readonly string[] = []) {\n assertKnownKeys(value, allowed, field)\n const missing = allowed.find((key) => !optional.includes(key) && !Object.hasOwn(value as object, key))\n if (missing) throw new Error(`${field}.${missing} is required.`)\n}\n\nfunction assertTextList(values: unknown, field: string, minimum: number) {\n if (!Array.isArray(values) || values.length < minimum) {\n throw new Error(`${field} must be a list${minimum > 0 ? ' with at least one entry' : ''}.`)\n }\n values.forEach((value, index) => assertText(value, `${field}[${index}]`, 80))\n const duplicate = values.find((value, index) => values.indexOf(value) !== index)\n if (duplicate !== undefined) throw new Error(`${field} lists \"${duplicate}\" more than once.`)\n}\n\nfunction assertLook(look: SiteLook, field: string) {\n assertExactKeys(look, SITE_LOOK_LEVERS, field)\n assertText(look.displayFont, `${field}.displayFont`)\n if (typeof look.actionHue !== 'number' || !Number.isFinite(look.actionHue) || look.actionHue < 0 || look.actionHue >= 360) {\n throw new Error(`${field}.actionHue must be a hue in degrees from 0 up to, but not including, 360.`)\n }\n assertText(look.heroVariant, `${field}.heroVariant`)\n assertText(look.headerVariant, `${field}.headerVariant`)\n assertExactKeys(look.cardStyle, ['radius', 'border', 'shadow'], `${field}.cardStyle`)\n for (const token of ['radius', 'border', 'shadow'] as const) assertText(look.cardStyle[token], `${field}.cardStyle.${token}`)\n assertExactKeys(look.photoTreatment, ['cropRatio', 'scrim', 'frame'], `${field}.photoTreatment`)\n for (const token of ['cropRatio', 'scrim', 'frame'] as const) assertText(look.photoTreatment[token], `${field}.photoTreatment.${token}`)\n assertExactKeys(look.homeSections, ['sectionOrder', 'signatures'], `${field}.homeSections`)\n assertTextList(look.homeSections.sectionOrder, `${field}.homeSections.sectionOrder`, 1)\n assertTextList(look.homeSections.signatures, `${field}.homeSections.signatures`, 0)\n}\n\nconst RECORDED_DATE = /^\\d{4}-\\d{2}-\\d{2}$/\n\nfunction assertNavigation(navigation: BrandlabRecordedNavigation, field: string) {\n const allowed = ['order', 'labels', 'areas', 'setBy', 'recordedOn']\n assertExactKeys(navigation, allowed, field, ['order', 'labels', 'areas'])\n assertText(navigation.setBy, `${field}.setBy`)\n if (typeof navigation.recordedOn !== 'string' || !RECORDED_DATE.test(navigation.recordedOn) || Number.isNaN(Date.parse(navigation.recordedOn))) {\n throw new Error(`${field}.recordedOn must be the date it was recorded, as YYYY-MM-DD.`)\n }\n if (navigation.order !== undefined) assertTextList(navigation.order, `${field}.order`, 1)\n if (navigation.labels !== undefined) {\n assertExactKeys(navigation.labels, navigation.labels && typeof navigation.labels === 'object' ? Object.keys(navigation.labels) : [], `${field}.labels`)\n for (const [key, label] of Object.entries(navigation.labels)) {\n assertText(key, `${field}.labels key`, 80)\n assertText(label, `${field}.labels.${key}`, 80)\n }\n }\n if (navigation.areas !== undefined && navigation.areas !== 'link' && navigation.areas !== 'menu') {\n throw new Error(`${field}.areas must be 'link' or 'menu'.`)\n }\n}\n\nfunction assertRoute(value: unknown, field: string) {\n if (typeof value !== 'string' || !ROUTE_PATTERN.test(value) || (value.length > 1 && value.endsWith('/'))) {\n throw new Error(`${field} must be a root-relative path or pattern such as \"/services/decking/*\".`)\n }\n}\n\nfunction assertPhrases(phrases: SitePhrases) {\n assertExactKeys(phrases, ['mainTrade', 'owners'], 'strategy.phrases')\n assertText(phrases.mainTrade, 'strategy.phrases.mainTrade', 80)\n if (!Array.isArray(phrases.owners)) throw new Error('strategy.phrases.owners must be a list.')\n const owners = new Map<string, string>()\n phrases.owners.forEach((owner, index) => {\n const field = `strategy.phrases.owners[${index}]`\n assertExactKeys(owner, ['phrase', 'route'], field)\n assertText(owner.phrase, `${field}.phrase`, 80)\n assertRoute(owner.route, `${field}.route`)\n if (owner.route.includes('*')) throw new Error(`${field}.route must be one page's path, not a pattern.`)\n const key = normaliseSitePhrase(owner.phrase)\n const other = owners.get(key)\n if (other !== undefined && other !== owner.route) {\n throw new Error(`strategy.phrases gives \"${owner.phrase}\" two owners, ${other} and ${owner.route}; one page owns each phrase.`)\n }\n owners.set(key, owner.route)\n })\n}\n\n/** Today's date in Sydney, YYYY-MM-DD. */\nexport function sydneyToday(date: Date = new Date()): string {\n return new Intl.DateTimeFormat('en-CA', { timeZone: 'Australia/Sydney', year: 'numeric', month: '2-digit', day: '2-digit' }).format(date)\n}\n\nfunction assertWaves(waves: readonly SiteReleaseWave[], today: string) {\n if (!Array.isArray(waves)) throw new Error('strategy.waves must be a list.')\n const seen = new Set<string>()\n let previous: number | undefined\n waves.forEach((wave, index) => {\n const field = `strategy.waves[${index}]`\n assertExactKeys(wave, ['releaseOn', 'kind', 'routes'], field, ['kind'])\n if (wave.kind !== undefined && !(SITE_WAVE_KINDS as readonly string[]).includes(wave.kind)) {\n throw new Error(`${field}.kind must be one of ${SITE_WAVE_KINDS.join(', ')}.`)\n }\n const day = typeof wave.releaseOn === 'string' && ISO_DAY.test(wave.releaseOn) ? Date.parse(`${wave.releaseOn}T00:00:00Z`) : Number.NaN\n if (Number.isNaN(day) || new Date(day).toISOString().slice(0, 10) !== wave.releaseOn) {\n throw new Error(`${field}.releaseOn must be a YYYY-MM-DD date.`)\n }\n const routes: readonly string[] = wave.routes\n if (!Array.isArray(routes) || routes.length === 0) throw new Error(`${field}.routes must list at least one path or pattern.`)\n routes.forEach((route: string, routeIndex: number) => {\n assertRoute(route, `${field}.routes[${routeIndex}]`)\n if (seen.has(route)) throw new Error(`strategy.waves lists \"${route}\" in more than one wave.`)\n seen.add(route)\n })\n if (previous !== undefined) {\n const gap = (day - previous) / DAY_MS\n if (gap < SITE_WAVE_MIN_GAP_DAYS || gap > SITE_WAVE_MAX_GAP_DAYS) {\n throw new Error(\n `${field}.releaseOn is ${gap} days after the wave before; waves go out in date order, ${SITE_WAVE_MIN_GAP_DAYS} to ${SITE_WAVE_MAX_GAP_DAYS} days apart.`,\n )\n }\n }\n previous = day\n })\n // The schedule never holds pages open-ended: the next wave follows the last released one (or today) within 28 days.\n const next = waves.findIndex((wave) => wave.releaseOn > today)\n if (next !== -1) {\n const from = next > 0 ? waves[next - 1]!.releaseOn : today\n const gap = (Date.parse(`${waves[next]!.releaseOn}T00:00:00Z`) - Date.parse(`${from}T00:00:00Z`)) / DAY_MS\n if (gap > SITE_WAVE_MAX_GAP_DAYS) {\n throw new Error(\n `strategy.waves[${next}].releaseOn is ${gap} days after ${next > 0 ? 'the last released wave' : 'today'}; the next wave goes out within ${SITE_WAVE_MAX_GAP_DAYS} days, so no page waits open-ended.`,\n )\n }\n }\n}\n\n/** Validates a site strategy record and returns it with its literal types kept. */\nexport function defineSiteStrategy<const T extends SiteStrategy>(strategy: T): T {\n assertKnownKeys(strategy, ['competitors', 'look', 'navigation', 'phrases', 'waves', 'estate'], 'strategy')\n if (strategy.navigation !== undefined) assertNavigation(strategy.navigation, 'strategy.navigation')\n if (strategy.phrases !== undefined) assertPhrases(strategy.phrases)\n if (strategy.waves !== undefined) assertWaves(strategy.waves, sydneyToday())\n if (strategy.estate !== undefined) {\n assertExactKeys(strategy.estate, ['indexedNow', 'paths', 'slugs'], 'strategy.estate', ['paths', 'slugs'])\n const problem = estatePlanProblems(strategy.estate, strategy.waves ?? [], sydneyToday())[0]\n if (problem) throw new Error(`strategy.${problem}`)\n }\n if (strategy.look !== undefined) assertLook(strategy.look, 'strategy.look')\n if (strategy.competitors === undefined) return strategy\n if (!Array.isArray(strategy.competitors)) throw new Error('strategy.competitors must be a list.')\n strategy.competitors.forEach((competitor, index) => {\n const field = `strategy.competitors[${index}]`\n assertExactKeys(competitor, ['name', 'domain', 'trade', 'look'], field)\n assertText(competitor.name, `${field}.name`)\n assertText(competitor.trade, `${field}.trade`)\n if (typeof competitor.domain !== 'string' || !DOMAIN.test(competitor.domain)) {\n throw new Error(`${field}.domain must be a bare lowercase domain such as \"example.com.au\".`)\n }\n assertLook(competitor.look, `${field}.look`)\n })\n const domains = strategy.competitors.map((competitor) => competitor.domain)\n const duplicate = domains.find((domain, index) => domains.indexOf(domain) !== index)\n if (duplicate) throw new Error(`strategy.competitors lists \"${duplicate}\" more than once.`)\n return strategy\n}\n\n// ---------------------------------------------------------------------------\n// The decision card and typed decisions (3.14.0), recorded beside `defineSiteStrategy`\n// ---------------------------------------------------------------------------\n\n/** Job mode per money service (v2 §2.2): it sets which of phone and quote is styled primary, never their order. */\nexport const SITE_JOB_MODES = ['urgent', 'planned', 'mixed'] as const\nexport type SiteJobMode = (typeof SITE_JOB_MODES)[number]\n\n/** How a service is bought beside its job mode: as an add-on to another job, or in a season. */\nexport const SITE_JOB_PATTERNS = ['add-on', 'seasonal'] as const\nexport type SiteJobPattern = (typeof SITE_JOB_PATTERNS)[number]\n\n/**\n * Where a money service lives on location pages (v2 §4.4 step 1): the main trade owns the suburb page; a family of its\n * own has service-in-suburb pages; anything else is a section on the suburb page.\n */\nexport const SITE_LOCATION_ROLES = ['owns-suburb-page', 'service-in-suburb-pages', 'suburb-page-section'] as const\nexport type SiteLocationRole = (typeof SITE_LOCATION_ROLES)[number]\n\n/** The typed reasons Romie may give for not publishing a suburb (v2 §4.3), including the owner-set `too-far`. */\nexport const SITE_EXCLUSION_REASONS = ['rural', 'not-residential', 'water-access', 'too-far', 'not-a-real-suburb'] as const\nexport type SiteExclusionReason = (typeof SITE_EXCLUSION_REASONS)[number]\n\nexport const SITE_CONTACT_CHANNELS = ['phone', 'sms', 'whatsapp', 'email', 'form'] as const\nexport type SiteContactChannel = (typeof SITE_CONTACT_CHANNELS)[number]\n\n/** The seven fields of the decision card (v2 §12.2 step 2), at the top of `strategy.ts`. */\nexport interface SiteDecisionCard {\n desiredWorkAndArea: string\n currentEnquiryConstraint: string\n /** The dated evidence: Search Console, GA4, SERPs, reviews. */\n evidence: string\n selectedAction: string\n expectedMechanism: string\n successMeasure: string\n reviewDate: string\n}\n\n/** A money service: one the business sells as its own job, confirmed by Romie. */\nexport interface SiteMoneyService {\n /** The service page slug. */\n slug: string\n name: string\n jobMode: SiteJobMode\n pattern?: SiteJobPattern\n /** Whether the service has a page in every served suburb (its own family, or the suburb page itself). */\n suburbFamily: boolean\n onLocationPages: SiteLocationRole\n reason: string\n}\n\n/** The 90-day lead baseline, target and read dates (v2 §9.4). Counts are what GA4 and the profile recorded. */\nexport interface SiteLeadBaseline {\n /** YYYY-MM-DD, about 90 days. */\n window: { start: string; end: string }\n /** Provider-accepted form sends (`contact_form`). */\n acceptedForms: number\n /** `phone_link_click` events. */\n phoneTaps: number\n businessProfileCalls?: number | null\n qualifiedEnquiries?: number | null\n organicActions?: number\n paidActions?: number\n note?: string\n target: string\n /** Dates or milestones (\"day 28 after launch\"). */\n readDates: readonly string[]\n}\n\n/** A true reason to choose the business, with the claims-register ids or named sources behind it. */\nexport interface SiteReasonToChoose {\n text: string\n claims: readonly string[]\n}\n\n/** The owner's job economics; `null` until the owner says. Nothing renders from them. */\nexport interface SiteJobEconomics {\n /** Whole dollars. */\n averageJobValue: number | null\n /** A fraction from 0 to 1. */\n closeRate: number | null\n capacityWeeksBooked: number | null\n /** The minimum job or call-out fee, as the owner put it. */\n minimumJob: string | null\n unwantedJobs: readonly string[] | null\n preferredContact: SiteContactChannel | null\n}\n\n/** One of the owner's (at most five) questions, with its fallback and dates. */\nexport interface SiteOwnerQuestion {\n id: string\n question: string\n fallback: string\n /** YYYY-MM-DD. */\n drafted: string\n sent?: string\n answered?: string\n}\n\nexport interface SiteExclusion {\n suburb: string\n reason: SiteExclusionReason\n}\n\n/**\n * The typed decisions a site records beside its `siteStrategy` (v2 §2.4, §12.2 step 2): the decision card, the money\n * services with their job modes, the lead baseline, the reasons to choose, the owner's economics and questions.\n */\nexport interface SiteStrategyDecisions {\n /** YYYY-MM-DD. */\n recordedOn: string\n trade: string\n mainArea: string\n /** The home page's phrase, for example \"tree services sydney\". */\n homePhrase: string\n decisionCard: SiteDecisionCard\n moneyServices: readonly SiteMoneyService[]\n leadBaseline: SiteLeadBaseline\n /** Up to three (the spec asks for three; fewer is allowed so none is invented). */\n reasonsToChoose: readonly SiteReasonToChoose[]\n jobEconomics?: SiteJobEconomics\n /** The client's lane: where proof goes first. */\n homeTerritory?: readonly string[]\n tiers?: { head: string; standard: string; noPage: string }\n exclusions?: readonly SiteExclusion[]\n ownerQuestions?: readonly SiteOwnerQuestion[]\n}\n\nexport const SITE_MAX_OWNER_QUESTIONS = 5\nexport const SITE_MAX_REASONS_TO_CHOOSE = 3\nconst LEAD_WINDOW_DAYS = { min: 60, max: 120 } as const\n\nfunction assertIsoDate(value: unknown, field: string): number {\n const day = typeof value === 'string' && ISO_DAY.test(value) ? Date.parse(`${value}T00:00:00Z`) : Number.NaN\n if (Number.isNaN(day) || new Date(day).toISOString().slice(0, 10) !== value) throw new Error(`${field} must be a YYYY-MM-DD date.`)\n return day\n}\n\nfunction assertCount(value: unknown, field: string, nullable = false) {\n if (nullable && value === null) return\n if (typeof value !== 'number' || !Number.isInteger(value) || value < 0) throw new Error(`${field} must be a whole number, 0 or more.`)\n}\n\nfunction assertMoneyServices(services: readonly SiteMoneyService[]) {\n if (!Array.isArray(services) || services.length === 0) throw new Error('decisions.moneyServices must list at least one money service.')\n const slugs = new Set<string>()\n services.forEach((service, index) => {\n const field = `decisions.moneyServices[${index}]`\n assertExactKeys(service, ['slug', 'name', 'jobMode', 'pattern', 'suburbFamily', 'onLocationPages', 'reason'], field, ['pattern'])\n if (typeof service.slug !== 'string' || !/^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(service.slug)) throw new Error(`${field}.slug must be a kebab-case slug.`)\n if (slugs.has(service.slug)) throw new Error(`decisions.moneyServices lists \"${service.slug}\" more than once.`)\n slugs.add(service.slug)\n assertText(service.name, `${field}.name`, 80)\n assertText(service.reason, `${field}.reason`, 600)\n if (!(SITE_JOB_MODES as readonly string[]).includes(service.jobMode)) throw new Error(`${field}.jobMode must be one of ${SITE_JOB_MODES.join(', ')}.`)\n if (service.pattern !== undefined && !(SITE_JOB_PATTERNS as readonly string[]).includes(service.pattern)) {\n throw new Error(`${field}.pattern must be one of ${SITE_JOB_PATTERNS.join(', ')}.`)\n }\n if (!(SITE_LOCATION_ROLES as readonly string[]).includes(service.onLocationPages)) {\n throw new Error(`${field}.onLocationPages must be one of ${SITE_LOCATION_ROLES.join(', ')}.`)\n }\n if (typeof service.suburbFamily !== 'boolean' || service.suburbFamily !== (service.onLocationPages !== 'suburb-page-section')) {\n throw new Error(`${field}.suburbFamily must be true exactly when the service owns the suburb page or has its own service-in-suburb pages.`)\n }\n })\n if (services.filter((service) => service.onLocationPages === 'owns-suburb-page').length > 1) {\n throw new Error('decisions.moneyServices: only one money service owns the suburb page (the main trade).')\n }\n}\n\nfunction assertLeadBaseline(baseline: SiteLeadBaseline) {\n const field = 'decisions.leadBaseline'\n const keys = ['window', 'acceptedForms', 'phoneTaps', 'businessProfileCalls', 'qualifiedEnquiries', 'organicActions', 'paidActions', 'note', 'target', 'readDates']\n assertExactKeys(baseline, keys, field, ['businessProfileCalls', 'qualifiedEnquiries', 'organicActions', 'paidActions', 'note'])\n assertExactKeys(baseline.window, ['start', 'end'], `${field}.window`)\n const span = (assertIsoDate(baseline.window.end, `${field}.window.end`) - assertIsoDate(baseline.window.start, `${field}.window.start`)) / DAY_MS\n if (span < LEAD_WINDOW_DAYS.min || span > LEAD_WINDOW_DAYS.max) {\n throw new Error(`${field}.window spans ${span} days; the baseline covers the last 90 days.`)\n }\n assertCount(baseline.acceptedForms, `${field}.acceptedForms`)\n assertCount(baseline.phoneTaps, `${field}.phoneTaps`)\n if (baseline.businessProfileCalls !== undefined) assertCount(baseline.businessProfileCalls, `${field}.businessProfileCalls`, true)\n if (baseline.qualifiedEnquiries !== undefined) assertCount(baseline.qualifiedEnquiries, `${field}.qualifiedEnquiries`, true)\n if (baseline.organicActions !== undefined) assertCount(baseline.organicActions, `${field}.organicActions`)\n if (baseline.paidActions !== undefined) assertCount(baseline.paidActions, `${field}.paidActions`)\n if (baseline.note !== undefined) assertText(baseline.note, `${field}.note`, 600)\n assertText(baseline.target, `${field}.target`, 300)\n assertTextList(baseline.readDates, `${field}.readDates`, 1)\n}\n\nfunction assertReasons(reasons: readonly SiteReasonToChoose[]) {\n if (!Array.isArray(reasons) || reasons.length === 0) throw new Error('decisions.reasonsToChoose must list at least one true reason.')\n if (reasons.length > SITE_MAX_REASONS_TO_CHOOSE) throw new Error('decisions.reasonsToChoose takes at most three reasons.')\n reasons.forEach((reason, index) => {\n const field = `decisions.reasonsToChoose[${index}]`\n assertExactKeys(reason, ['text', 'claims'], field)\n assertText(reason.text, `${field}.text`, 300)\n assertTextList(reason.claims, `${field}.claims`, 1)\n })\n}\n\nfunction assertJobEconomics(economics: SiteJobEconomics) {\n const field = 'decisions.jobEconomics'\n assertExactKeys(economics, ['averageJobValue', 'closeRate', 'capacityWeeksBooked', 'minimumJob', 'unwantedJobs', 'preferredContact'], field)\n assertCount(economics.averageJobValue, `${field}.averageJobValue`, true)\n if (economics.closeRate !== null && (typeof economics.closeRate !== 'number' || !(economics.closeRate >= 0 && economics.closeRate <= 1))) {\n throw new Error(`${field}.closeRate must be a fraction from 0 to 1, or null.`)\n }\n if (economics.capacityWeeksBooked !== null && (typeof economics.capacityWeeksBooked !== 'number' || !(economics.capacityWeeksBooked >= 0))) {\n throw new Error(`${field}.capacityWeeksBooked must be 0 or more weeks, or null.`)\n }\n if (economics.minimumJob !== null) assertText(economics.minimumJob, `${field}.minimumJob`)\n if (economics.unwantedJobs !== null) assertTextList(economics.unwantedJobs, `${field}.unwantedJobs`, 1)\n if (economics.preferredContact !== null && !(SITE_CONTACT_CHANNELS as readonly string[]).includes(economics.preferredContact)) {\n throw new Error(`${field}.preferredContact must be one of ${SITE_CONTACT_CHANNELS.join(', ')}, or null.`)\n }\n}\n\nfunction assertOwnerQuestions(questions: readonly SiteOwnerQuestion[]) {\n if (!Array.isArray(questions)) throw new Error('decisions.ownerQuestions must be a list.')\n if (questions.length > SITE_MAX_OWNER_QUESTIONS) throw new Error('decisions.ownerQuestions holds at most five single questions per client.')\n const ids = new Set<string>()\n questions.forEach((question, index) => {\n const field = `decisions.ownerQuestions[${index}]`\n assertExactKeys(question, ['id', 'question', 'fallback', 'drafted', 'sent', 'answered'], field, ['sent', 'answered'])\n assertText(question.id, `${field}.id`, 40)\n if (ids.has(question.id)) throw new Error(`decisions.ownerQuestions lists \"${question.id}\" more than once.`)\n ids.add(question.id)\n assertText(question.question, `${field}.question`, 300)\n assertText(question.fallback, `${field}.fallback`, 300)\n const drafted = assertIsoDate(question.drafted, `${field}.drafted`)\n const sent = question.sent === undefined ? undefined : assertIsoDate(question.sent, `${field}.sent`)\n if (sent !== undefined && sent < drafted) throw new Error(`${field}.sent is before it was drafted.`)\n if (question.answered !== undefined) {\n const answered = assertIsoDate(question.answered, `${field}.answered`)\n if (answered < (sent ?? drafted)) throw new Error(`${field}.answered is before it was ${sent === undefined ? 'drafted' : 'sent'}.`)\n }\n })\n}\n\n/** Validates the decisions a site records beside its `siteStrategy` and returns them with their literal types kept. */\nexport function defineStrategyDecisions<const T extends SiteStrategyDecisions>(decisions: T): T {\n const keys = [\n 'recordedOn', 'trade', 'mainArea', 'homePhrase', 'decisionCard', 'moneyServices', 'leadBaseline', 'reasonsToChoose',\n 'jobEconomics', 'homeTerritory', 'tiers', 'exclusions', 'ownerQuestions',\n ]\n assertExactKeys(decisions, keys, 'decisions', ['jobEconomics', 'homeTerritory', 'tiers', 'exclusions', 'ownerQuestions'])\n assertIsoDate(decisions.recordedOn, 'decisions.recordedOn')\n assertText(decisions.trade, 'decisions.trade', 80)\n assertText(decisions.mainArea, 'decisions.mainArea', 80)\n assertText(decisions.homePhrase, 'decisions.homePhrase', 80)\n const cardKeys = ['desiredWorkAndArea', 'currentEnquiryConstraint', 'evidence', 'selectedAction', 'expectedMechanism', 'successMeasure', 'reviewDate'] as const\n assertExactKeys(decisions.decisionCard, cardKeys, 'decisions.decisionCard')\n for (const key of cardKeys) assertText(decisions.decisionCard[key], `decisions.decisionCard.${key}`, 600)\n assertMoneyServices(decisions.moneyServices)\n assertLeadBaseline(decisions.leadBaseline)\n assertReasons(decisions.reasonsToChoose)\n if (decisions.jobEconomics !== undefined) assertJobEconomics(decisions.jobEconomics)\n if (decisions.homeTerritory !== undefined) assertTextList(decisions.homeTerritory, 'decisions.homeTerritory', 1)\n if (decisions.tiers !== undefined) {\n assertExactKeys(decisions.tiers, ['head', 'standard', 'noPage'], 'decisions.tiers')\n for (const key of ['head', 'standard', 'noPage'] as const) assertText(decisions.tiers[key], `decisions.tiers.${key}`, 300)\n }\n if (decisions.exclusions !== undefined) {\n if (!Array.isArray(decisions.exclusions)) throw new Error('decisions.exclusions must be a list.')\n decisions.exclusions.forEach((exclusion, index) => {\n const field = `decisions.exclusions[${index}]`\n assertExactKeys(exclusion, ['suburb', 'reason'], field)\n assertText(exclusion.suburb, `${field}.suburb`, 80)\n if (!(SITE_EXCLUSION_REASONS as readonly string[]).includes(exclusion.reason)) {\n throw new Error(`${field}.reason must be one of ${SITE_EXCLUSION_REASONS.join(', ')}.`)\n }\n })\n }\n if (decisions.ownerQuestions !== undefined) assertOwnerQuestions(decisions.ownerQuestions)\n return decisions\n}\n\n// ---------------------------------------------------------------------------\n// The estate plan (3.14.0)\n// ---------------------------------------------------------------------------\n\nconst SLUG = /^[a-z0-9]+(?:-[a-z0-9]+)*$/\nconst PLACEHOLDER = { region: '{region}', suburb: '{suburb}' } as const\n\nfunction templateProblem(template: unknown, placeholder: string): boolean {\n if (typeof template !== 'string' || !template.endsWith(`/${placeholder}`)) return true\n const parent = template.slice(0, -placeholder.length - 1)\n return parent !== '' && (!ROUTE_PATTERN.test(parent) || parent.includes('*') || parent.includes('{'))\n}\n\nfunction parentOf(template: string | undefined): string | undefined {\n return template === undefined ? undefined : template.slice(0, template.lastIndexOf('/'))\n}\n\n/**\n * What breaks an estate plan, in plain sentences (empty when nothing does): malformed routes or paths, a page indexed\n * now that a wave still to come also lists, suburb renames other than \"{slug}-suburb\" and region and suburb pages that\n * would share a path. Conformance's LOC-INDEX reads the same plan against the built pages.\n */\nexport function estatePlanProblems(plan: SiteEstatePlan, waves: readonly SiteReleaseWave[], today: string = sydneyToday()): string[] {\n const problems: string[] = []\n if (!Array.isArray(plan.indexedNow)) return ['estate.indexedNow must be a list of paths or patterns.']\n plan.indexedNow.forEach((route, index) => {\n if (typeof route !== 'string' || !ROUTE_PATTERN.test(route) || (route.length > 1 && route.endsWith('/'))) {\n problems.push(`estate.indexedNow[${index}] must be a root-relative path or pattern such as \"/services/decking/*\".`)\n }\n })\n for (const wave of waves) {\n if (wave.releaseOn <= today) continue\n for (const route of wave.routes) {\n if (plan.indexedNow.includes(route)) problems.push(`\"${route}\" is indexed now and also in the wave of ${wave.releaseOn}; a page indexed now never waits for a wave.`)\n }\n }\n const paths = plan.paths ?? {}\n if (paths.region !== undefined && templateProblem(paths.region, PLACEHOLDER.region)) {\n problems.push('estate.paths.region must be a root-relative path ending in \"/{region}\".')\n }\n if (paths.suburb !== undefined && templateProblem(paths.suburb, PLACEHOLDER.suburb)) {\n problems.push('estate.paths.suburb must be a root-relative path ending in \"/{suburb}\".')\n }\n for (const template of paths.serviceInSuburb ?? []) {\n if (templateProblem(template, PLACEHOLDER.suburb)) problems.push(`estate.paths.serviceInSuburb \"${template}\" must be a root-relative path ending in \"/{suburb}\".`)\n else if (template === paths.suburb) problems.push(`estate.paths.serviceInSuburb \"${template}\" is also the suburb path.`)\n }\n const regions = plan.slugs?.regions ?? {}\n const suburbs = plan.slugs?.suburbs ?? {}\n const regionSlugs = new Map<string, string>()\n for (const [registry, slug] of Object.entries(regions)) {\n if (!SLUG.test(registry) || typeof slug !== 'string' || !SLUG.test(slug)) {\n problems.push(`estate.slugs.regions.${registry} must map a registry slug to a kebab-case slug.`)\n continue\n }\n if (regionSlugs.has(slug)) problems.push(`estate.slugs.regions gives \"${slug}\" to more than one region.`)\n regionSlugs.set(slug, registry)\n }\n for (const [registry, slug] of Object.entries(suburbs)) {\n if (!SLUG.test(registry) || slug !== `${registry}-suburb`) {\n problems.push(`estate.slugs.suburbs.${registry} is \"${String(slug)}\"; a suburb that clashes with a region takes \"${registry}-suburb\".`)\n }\n }\n const shared = paths.region !== undefined && paths.suburb !== undefined && parentOf(paths.region) === parentOf(paths.suburb)\n if (shared) {\n for (const slug of Object.values(suburbs)) {\n if (regionSlugs.has(slug)) problems.push(`The region \"${regionSlugs.get(slug)}\" and a suburb both take \"${slug}\" under ${parentOf(paths.suburb)}.`)\n }\n }\n return problems\n}\n\n/** A place's public slug in the estate: the plan's rename, or the registry slug. */\nexport function estatePublicSlug(plan: SiteEstatePlan, kind: 'region' | 'suburb', registrySlug: string): string {\n const renames = kind === 'region' ? plan.slugs?.regions : plan.slugs?.suburbs\n return renames && Object.hasOwn(renames, registrySlug) ? renames[registrySlug]! : registrySlug\n}\n\n/**\n * A location page's path: the family's path with the place's public slug. `template` picks a nested service-in-suburb\n * family (or its service-region hub, with `kind: 'region'`); it must be one of the plan's paths.\n */\nexport function estateLocationPath(plan: SiteEstatePlan, kind: 'region' | 'suburb', registrySlug: string, template?: string): string {\n const paths = plan.paths ?? {}\n const own = kind === 'region' ? paths.region : paths.suburb\n const known = [paths.region, paths.suburb, ...(paths.serviceInSuburb ?? [])].filter((value): value is string => value !== undefined)\n let chosen = template ?? own\n if (template !== undefined && !known.includes(template)) {\n // A service-in-suburb family's hub sits beside its suburb pages: \"/x/{suburb}\" also gives \"/x/{region}\".\n const hub = (paths.serviceInSuburb ?? []).find((candidate) => candidate.replace(/\\{suburb\\}$/, '{region}') === template)\n if (!hub) throw new Error(`\"${template}\" is not one of the estate's paths.`)\n chosen = template\n }\n if (chosen === undefined) throw new Error(`The estate plan records no ${kind} path.`)\n const parent = chosen.slice(0, chosen.lastIndexOf('/'))\n return `${parent}/${estatePublicSlug(plan, kind, registrySlug)}`\n}\n"]}
|
|
1
|
+
{"version":3,"file":"strategy.js","sourceRoot":"","sources":["../src/strategy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAIH,mGAAmG;AACnG,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,aAAa;IACb,WAAW;IACX,aAAa;IACb,eAAe;IACf,WAAW;IACX,gBAAgB;IAChB,cAAc;CACN,CAAA;AA4EV;;;GAGG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,SAAS,EAAE,QAAQ,CAAU,CAAA;AAgE7D;;;GAGG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,EAAE,CAAA;AACxC,MAAM,CAAC,MAAM,sBAAsB,GAAG,EAAE,CAAA;AAExC,MAAM,aAAa,GAAG,sDAAsD,CAAA;AAC5E,MAAM,OAAO,GAAG,qBAAqB,CAAA;AACrC,MAAM,MAA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;AACJ,CAAC","sourcesContent":["/**\n * The site strategy record (3.8.0). One literal per site, in `src/data/strategy.ts`, that the checks read.\n *\n * 3.8.0 holds what check D4 (same-trade distinctness) needs: the site's own look levers and the same-trade competitors\n * with theirs. `navigation` (3.9.0) is what Romie recorded for the menu: an exact order, labels outside the closed\n * list, whether Areas is a dropdown. 3.12.0 adds two optional parts the full tier reads: `phrases`, one owning page per\n * primary phrase (E10), and `waves`, the dated release schedule of a location estate (the location indexing guard).\n * Every location page is indexed (D4, 20 Oct 2026); the schedule only dates when each page enters the index and the\n * sitemap.\n *\n * The levers are recorded values, not measurements: the person building the look writes them down, and D4 compares\n * the records. A shared display font counts as the same lever, and an action hue within 20 degrees counts as the same.\n * Card style, photo treatment and the home sections are the same only when every part of them matches.\n */\n\nimport type { BrandlabRecordedNavigation } from './navigation.js'\n\n/** The seven look levers D4 compares (Site System v2 §7.7), in the order the record lists them. */\nexport const SITE_LOOK_LEVERS = [\n 'displayFont',\n 'actionHue',\n 'heroVariant',\n 'headerVariant',\n 'cardStyle',\n 'photoTreatment',\n 'homeSections',\n] as const\n\nexport type SiteLookLever = (typeof SITE_LOOK_LEVERS)[number]\n\n/** The card tokens the site's cards use. Two card styles are the same only when all three match. */\nexport interface SiteCardStyle {\n /** The corner radius token value, for example \"16px\" or \"0\". */\n radius: string\n /** The border token value, for example \"1px solid line\" or \"none\". */\n border: string\n /** The shadow token value, for example \"soft\" or \"none\". */\n shadow: string\n}\n\n/** How the site treats photographs. Two treatments are the same only when all three match. */\nexport interface SitePhotoTreatment {\n /** The crop ratio, for example \"4:3\" or \"16:9\". */\n cropRatio: string\n /** The scrim over photographs, for example \"light gradient\" or \"none\". */\n scrim: string\n /** The frame around photographs, for example \"rounded\" or \"square\". */\n frame: string\n}\n\n/** The home page's section order and its signature sections. */\nexport interface SiteHomeSections {\n /** The home page's sections in order, by section id. */\n sectionOrder: readonly string[]\n /** The sections or elements that make the home page recognisable, for example \"grass-edge divider\". May be empty. */\n signatures: readonly string[]\n}\n\n/** One site's look, as recorded. */\nexport interface SiteLook {\n /** The display (heading) font family, for example \"Plus Jakarta Sans\". */\n displayFont: string\n /** The hue of the main action colour in degrees: 0 up to, not including, 360. */\n actionHue: number\n /** The hero variant the site uses, as its skin names it. */\n heroVariant: string\n /** The header variant the site uses, as its skin names it. */\n headerVariant: string\n cardStyle: SiteCardStyle\n photoTreatment: SitePhotoTreatment\n homeSections: SiteHomeSections\n}\n\n/** A same-trade business with an overlapping service area, and its recorded look. */\nexport interface SiteCompetitor {\n name: string\n /** The bare domain, lowercase, for example \"example.com.au\". */\n domain: string\n /** The trade it shares with this site, for example \"tree services\". */\n trade: string\n look: SiteLook\n}\n\n/** A primary phrase and the one page that owns it (v2 §4.2, §5.3). */\nexport interface SitePhraseOwner {\n /** The searched phrase, for example \"blocked drains\" or \"plumber sydney\". */\n phrase: string\n /** The owning page's path, for example \"/services/blocked-drains\". */\n route: string\n}\n\n/** Phrase ownership: one page per primary phrase (E10). */\nexport interface SitePhrases {\n /**\n * The main trade, for example \"plumber\". The suburb page owns \"{mainTrade} {suburb}\" and the region page\n * \"{mainTrade} {region}\", so there is no service-in-suburb page or service-region hub for it.\n */\n mainTrade: string\n /** Every primary phrase with its owning page. No phrase has two owners. */\n owners: readonly SitePhraseOwner[]\n}\n\n/**\n * A wave's kind (3.14.0): `release` brings new pages (they may not be built before the day); `return` brings existing\n * pages of an existing estate back to the index (they are built and live now, noindex until the day).\n */\nexport const SITE_WAVE_KINDS = ['release', 'return'] as const\nexport type SiteWaveKind = (typeof SITE_WAVE_KINDS)[number]\n\n/** One wave of a location estate's release (v2 §4.4 step 8). */\nexport interface SiteReleaseWave {\n /** YYYY-MM-DD: from this day the wave's pages are indexable and in the sitemap. */\n releaseOn: string\n /** Defaults to `release` (3.14.0). */\n kind?: SiteWaveKind\n /** Paths or patterns: `*` matches within one path segment, `**` across segments, for example \"/services/decking/*\". */\n routes: readonly string[]\n}\n\n/**\n * Where an estate's location pages live (3.14.0): one path per family, with `{region}` or `{suburb}` as the last\n * segment. Service-in-suburb families may nest under a service (`/tree-services/stump-grinding/{suburb}`); their\n * service-region hubs take `{region}` in the same place.\n */\nexport interface SiteEstatePaths {\n region?: string\n suburb?: string\n serviceInSuburb?: readonly string[]\n}\n\n/**\n * An existing location estate's plan (3.14.0, D4 b): the pages indexed now, where the families live and the public\n * slugs that differ from the registry's. Every location page is indexed now or listed in a wave; a page indexed now\n * never waits for a wave. Where region and suburb pages share a parent, a region slug that is also a suburb's sends the\n * suburb to \"{slug}-suburb\" (AA: region `ryde`, suburb `ryde-suburb`). Public slugs apply on every location path.\n */\nexport interface SiteEstatePlan {\n /** Paths or patterns of the location pages indexable and in the sitemap today. */\n indexedNow: readonly string[]\n paths?: SiteEstatePaths\n slugs?: {\n /** Registry region slug → public slug, for example `{ 'ryde-area': 'ryde' }`. */\n regions?: Readonly<Record<string, string>>\n /** Registry suburb slug → public slug, always \"{slug}-suburb\", for example `{ ryde: 'ryde-suburb' }`. */\n suburbs?: Readonly<Record<string, string>>\n }\n}\n\n/**\n * Both fields are optional so a site can start the record before its look is settled; check D4 still fails a new\n * build or redesign whose record lacks either.\n */\nexport interface SiteStrategy {\n /** Same-trade competitors with overlapping regions, fellow Brandlab clients first. */\n competitors?: readonly SiteCompetitor[]\n /** This site's own look. */\n look?: SiteLook\n /** The menu order, labels or Areas dropdown Romie recorded, when he recorded one (N1 reproduces it exactly). */\n navigation?: BrandlabRecordedNavigation\n /** Phrase ownership (3.12.0). */\n phrases?: SitePhrases\n /**\n * The location estate's release waves, in date order (3.12.0). A location page a wave dates in the future may be\n * noindex or out of the sitemap until that day; every other location page is indexable and listed now.\n */\n waves?: readonly SiteReleaseWave[]\n /** An existing estate's plan: pages indexed now, family paths and public slugs (3.14.0). */\n estate?: SiteEstatePlan\n}\n\n/**\n * Consecutive waves go out at least 14 and at most 28 days apart, and the next wave still to come is at most 28 days\n * after the last one released (or after today when none is) (v2 §4.4 step 8: never all at once, never open-ended).\n */\nexport const SITE_WAVE_MIN_GAP_DAYS = 14\nexport const SITE_WAVE_MAX_GAP_DAYS = 28\n\nconst ROUTE_PATTERN = /^\\/(?:[A-Za-z0-9._~%*-]+(?:\\/[A-Za-z0-9._~%*-]+)*)?$/\nconst ISO_DAY = /^\\d{4}-\\d{2}-\\d{2}$/\nconst DAY_MS = 86_400_000\n\n/** A phrase as E10 compares it: lowercase words, \"&\" read as \"and\", punctuation dropped, a plural \"s\" dropped. */\nexport function normaliseSitePhrase(phrase: string): string {\n return phrase\n .toLowerCase()\n .replace(/&/g, ' and ')\n .replace(/[^a-z0-9]+/g, ' ')\n .trim()\n .split(' ')\n .map((word) => (word.length > 3 && word.endsWith('s') && !word.endsWith('ss') ? word.slice(0, -1) : word))\n .join(' ')\n}\n\n/** Whether a path matches a wave route: an exact path, or a pattern with `*` (one segment) and `**` (any depth). */\nexport function matchesWaveRoute(path: string, route: string): boolean {\n if (!route.includes('*')) return path === route\n const source = route\n .split(/(\\*\\*|\\*)/)\n .map((part) => (part === '**' ? '.*' : part === '*' ? '[^/]*' : part.replace(/[.+?^${}()|[\\]\\\\]/g, '\\\\$&')))\n .join('')\n return new RegExp(`^${source}$`).test(path)\n}\n\n/** The wave that dates a path, or undefined when no wave lists it. */\nexport function waveForRoute(waves: readonly SiteReleaseWave[], path: string): SiteReleaseWave | undefined {\n return waves.find((wave) => wave.routes.some((route) => matchesWaveRoute(path, route)))\n}\n\nconst DOMAIN = /^(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z]{2,}$/\n\nfunction assertText(value: unknown, field: string, maximum = 160) {\n if (\n typeof value !== 'string' ||\n !value.trim() ||\n value.trim() !== value ||\n value.length > maximum ||\n /[\\u0000-\\u001f\\u007f]/.test(value)\n ) {\n throw new Error(`${field} must be bounded, trimmed text.`)\n }\n}\n\nfunction assertKnownKeys(value: unknown, allowed: readonly string[], field: string) {\n if (\n !value ||\n typeof value !== 'object' ||\n Array.isArray(value) ||\n ![Object.prototype, null].includes(Object.getPrototypeOf(value))\n ) {\n throw new Error(`${field} must be a plain object.`)\n }\n const unknown = Object.keys(value).find((key) => !allowed.includes(key))\n if (unknown) throw new Error(`${field}.${unknown} is not a supported strategy key.`)\n}\n\nfunction assertExactKeys(value: unknown, allowed: readonly string[], field: string, optional: readonly string[] = []) {\n assertKnownKeys(value, allowed, field)\n const missing = allowed.find((key) => !optional.includes(key) && !Object.hasOwn(value as object, key))\n if (missing) throw new Error(`${field}.${missing} is required.`)\n}\n\nfunction assertTextList(values: unknown, field: string, minimum: number) {\n if (!Array.isArray(values) || values.length < minimum) {\n throw new Error(`${field} must be a list${minimum > 0 ? ' with at least one entry' : ''}.`)\n }\n values.forEach((value, index) => assertText(value, `${field}[${index}]`, 80))\n const duplicate = values.find((value, index) => values.indexOf(value) !== index)\n if (duplicate !== undefined) throw new Error(`${field} lists \"${duplicate}\" more than once.`)\n}\n\nfunction assertLook(look: SiteLook, field: string) {\n assertExactKeys(look, SITE_LOOK_LEVERS, field)\n assertText(look.displayFont, `${field}.displayFont`)\n if (typeof look.actionHue !== 'number' || !Number.isFinite(look.actionHue) || look.actionHue < 0 || look.actionHue >= 360) {\n throw new Error(`${field}.actionHue must be a hue in degrees from 0 up to, but not including, 360.`)\n }\n assertText(look.heroVariant, `${field}.heroVariant`)\n assertText(look.headerVariant, `${field}.headerVariant`)\n assertExactKeys(look.cardStyle, ['radius', 'border', 'shadow'], `${field}.cardStyle`)\n for (const token of ['radius', 'border', 'shadow'] as const) assertText(look.cardStyle[token], `${field}.cardStyle.${token}`)\n assertExactKeys(look.photoTreatment, ['cropRatio', 'scrim', 'frame'], `${field}.photoTreatment`)\n for (const token of ['cropRatio', 'scrim', 'frame'] as const) assertText(look.photoTreatment[token], `${field}.photoTreatment.${token}`)\n assertExactKeys(look.homeSections, ['sectionOrder', 'signatures'], `${field}.homeSections`)\n assertTextList(look.homeSections.sectionOrder, `${field}.homeSections.sectionOrder`, 1)\n assertTextList(look.homeSections.signatures, `${field}.homeSections.signatures`, 0)\n}\n\nconst RECORDED_DATE = /^\\d{4}-\\d{2}-\\d{2}$/\n\nfunction assertNavigation(navigation: BrandlabRecordedNavigation, field: string) {\n const allowed = ['order', 'labels', 'areas', 'setBy', 'recordedOn']\n assertExactKeys(navigation, allowed, field, ['order', 'labels', 'areas'])\n assertText(navigation.setBy, `${field}.setBy`)\n if (typeof navigation.recordedOn !== 'string' || !RECORDED_DATE.test(navigation.recordedOn) || Number.isNaN(Date.parse(navigation.recordedOn))) {\n throw new Error(`${field}.recordedOn must be the date it was recorded, as YYYY-MM-DD.`)\n }\n if (navigation.order !== undefined) assertTextList(navigation.order, `${field}.order`, 1)\n if (navigation.labels !== undefined) {\n assertExactKeys(navigation.labels, navigation.labels && typeof navigation.labels === 'object' ? Object.keys(navigation.labels) : [], `${field}.labels`)\n for (const [key, label] of Object.entries(navigation.labels)) {\n assertText(key, `${field}.labels key`, 80)\n assertText(label, `${field}.labels.${key}`, 80)\n }\n }\n if (navigation.areas !== undefined && navigation.areas !== 'link' && navigation.areas !== 'menu') {\n throw new Error(`${field}.areas must be 'link' or 'menu'.`)\n }\n}\n\nfunction assertRoute(value: unknown, field: string) {\n if (typeof value !== 'string' || !ROUTE_PATTERN.test(value) || (value.length > 1 && value.endsWith('/'))) {\n throw new Error(`${field} must be a root-relative path or pattern such as \"/services/decking/*\".`)\n }\n}\n\nfunction assertPhrases(phrases: SitePhrases) {\n assertExactKeys(phrases, ['mainTrade', 'owners'], 'strategy.phrases')\n assertText(phrases.mainTrade, 'strategy.phrases.mainTrade', 80)\n if (!Array.isArray(phrases.owners)) throw new Error('strategy.phrases.owners must be a list.')\n const owners = new Map<string, string>()\n phrases.owners.forEach((owner, index) => {\n const field = `strategy.phrases.owners[${index}]`\n assertExactKeys(owner, ['phrase', 'route'], field)\n assertText(owner.phrase, `${field}.phrase`, 80)\n assertRoute(owner.route, `${field}.route`)\n if (owner.route.includes('*')) throw new Error(`${field}.route must be one page's path, not a pattern.`)\n const key = normaliseSitePhrase(owner.phrase)\n const other = owners.get(key)\n if (other !== undefined && other !== owner.route) {\n throw new Error(`strategy.phrases gives \"${owner.phrase}\" two owners, ${other} and ${owner.route}; one page owns each phrase.`)\n }\n owners.set(key, owner.route)\n })\n}\n\n/** Today's date in Sydney, YYYY-MM-DD. */\nexport function sydneyToday(date: Date = new Date()): string {\n return new Intl.DateTimeFormat('en-CA', { timeZone: 'Australia/Sydney', year: 'numeric', month: '2-digit', day: '2-digit' }).format(date)\n}\n\nfunction assertWaves(waves: readonly SiteReleaseWave[], today: string) {\n if (!Array.isArray(waves)) throw new Error('strategy.waves must be a list.')\n const seen = new Set<string>()\n let previous: number | undefined\n waves.forEach((wave, index) => {\n const field = `strategy.waves[${index}]`\n assertExactKeys(wave, ['releaseOn', 'kind', 'routes'], field, ['kind'])\n if (wave.kind !== undefined && !(SITE_WAVE_KINDS as readonly string[]).includes(wave.kind)) {\n throw new Error(`${field}.kind must be one of ${SITE_WAVE_KINDS.join(', ')}.`)\n }\n const day = typeof wave.releaseOn === 'string' && ISO_DAY.test(wave.releaseOn) ? Date.parse(`${wave.releaseOn}T00:00:00Z`) : Number.NaN\n if (Number.isNaN(day) || new Date(day).toISOString().slice(0, 10) !== wave.releaseOn) {\n throw new Error(`${field}.releaseOn must be a YYYY-MM-DD date.`)\n }\n const routes: readonly string[] = wave.routes\n if (!Array.isArray(routes) || routes.length === 0) throw new Error(`${field}.routes must list at least one path or pattern.`)\n routes.forEach((route: string, routeIndex: number) => {\n assertRoute(route, `${field}.routes[${routeIndex}]`)\n if (seen.has(route)) throw new Error(`strategy.waves lists \"${route}\" in more than one wave.`)\n seen.add(route)\n })\n if (previous !== undefined) {\n const gap = (day - previous) / DAY_MS\n if (gap < SITE_WAVE_MIN_GAP_DAYS || gap > SITE_WAVE_MAX_GAP_DAYS) {\n throw new Error(\n `${field}.releaseOn is ${gap} days after the wave before; waves go out in date order, ${SITE_WAVE_MIN_GAP_DAYS} to ${SITE_WAVE_MAX_GAP_DAYS} days apart.`,\n )\n }\n }\n previous = day\n })\n // The schedule never holds pages open-ended: the next wave follows the last released one (or today) within 28 days.\n const next = waves.findIndex((wave) => wave.releaseOn > today)\n if (next !== -1) {\n const from = next > 0 ? waves[next - 1]!.releaseOn : today\n const gap = (Date.parse(`${waves[next]!.releaseOn}T00:00:00Z`) - Date.parse(`${from}T00:00:00Z`)) / DAY_MS\n if (gap > SITE_WAVE_MAX_GAP_DAYS) {\n throw new Error(\n `strategy.waves[${next}].releaseOn is ${gap} days after ${next > 0 ? 'the last released wave' : 'today'}; the next wave goes out within ${SITE_WAVE_MAX_GAP_DAYS} days, so no page waits open-ended.`,\n )\n }\n }\n}\n\n/** Validates a site strategy record and returns it with its literal types kept. */\nexport function defineSiteStrategy<const T extends SiteStrategy>(strategy: T): T {\n assertKnownKeys(strategy, ['competitors', 'look', 'navigation', 'phrases', 'waves', 'estate'], 'strategy')\n if (strategy.navigation !== undefined) assertNavigation(strategy.navigation, 'strategy.navigation')\n if (strategy.phrases !== undefined) assertPhrases(strategy.phrases)\n if (strategy.waves !== undefined) assertWaves(strategy.waves, sydneyToday())\n if (strategy.estate !== undefined) {\n assertExactKeys(strategy.estate, ['indexedNow', 'paths', 'slugs'], 'strategy.estate', ['paths', 'slugs'])\n const problem = estatePlanProblems(strategy.estate, strategy.waves ?? [], sydneyToday())[0]\n if (problem) throw new Error(`strategy.${problem}`)\n }\n if (strategy.look !== undefined) assertLook(strategy.look, 'strategy.look')\n if (strategy.competitors === undefined) return strategy\n if (!Array.isArray(strategy.competitors)) throw new Error('strategy.competitors must be a list.')\n strategy.competitors.forEach((competitor, index) => {\n const field = `strategy.competitors[${index}]`\n assertExactKeys(competitor, ['name', 'domain', 'trade', 'look'], field)\n assertText(competitor.name, `${field}.name`)\n assertText(competitor.trade, `${field}.trade`)\n if (typeof competitor.domain !== 'string' || !DOMAIN.test(competitor.domain)) {\n throw new Error(`${field}.domain must be a bare lowercase domain such as \"example.com.au\".`)\n }\n assertLook(competitor.look, `${field}.look`)\n })\n const domains = strategy.competitors.map((competitor) => competitor.domain)\n const duplicate = domains.find((domain, index) => domains.indexOf(domain) !== index)\n if (duplicate) throw new Error(`strategy.competitors lists \"${duplicate}\" more than once.`)\n return strategy\n}\n\n// ---------------------------------------------------------------------------\n// The decision card and typed decisions (3.14.0), recorded beside `defineSiteStrategy`\n// ---------------------------------------------------------------------------\n\n/** Job mode per money service (v2 §2.2): it sets which of phone and quote is styled primary, never their order. */\nexport const SITE_JOB_MODES = ['urgent', 'planned', 'mixed'] as const\nexport type SiteJobMode = (typeof SITE_JOB_MODES)[number]\n\n/** How a service is bought beside its job mode: as an add-on to another job, or in a season. */\nexport const SITE_JOB_PATTERNS = ['add-on', 'seasonal'] as const\nexport type SiteJobPattern = (typeof SITE_JOB_PATTERNS)[number]\n\n/**\n * Where a money service lives on location pages (v2 §4.4 step 1): the main trade owns the suburb page; a family of its\n * own has service-in-suburb pages; anything else is a section on the suburb page.\n */\nexport const SITE_LOCATION_ROLES = ['owns-suburb-page', 'service-in-suburb-pages', 'suburb-page-section'] as const\nexport type SiteLocationRole = (typeof SITE_LOCATION_ROLES)[number]\n\n/** The typed reasons Romie may give for not publishing a suburb (v2 §4.3), including the owner-set `too-far`. */\nexport const SITE_EXCLUSION_REASONS = ['rural', 'not-residential', 'water-access', 'too-far', 'not-a-real-suburb'] as const\nexport type SiteExclusionReason = (typeof SITE_EXCLUSION_REASONS)[number]\n\nexport const SITE_CONTACT_CHANNELS = ['phone', 'sms', 'whatsapp', 'email', 'form'] as const\nexport type SiteContactChannel = (typeof SITE_CONTACT_CHANNELS)[number]\n\n/** The seven fields of the decision card (v2 §12.2 step 2), at the top of `strategy.ts`. */\nexport interface SiteDecisionCard {\n desiredWorkAndArea: string\n currentEnquiryConstraint: string\n /** The dated evidence: Search Console, GA4, SERPs, reviews. */\n evidence: string\n selectedAction: string\n expectedMechanism: string\n successMeasure: string\n reviewDate: string\n}\n\n/** A money service: one the business sells as its own job, confirmed by Romie. */\nexport interface SiteMoneyService {\n /** The service page slug. */\n slug: string\n name: string\n jobMode: SiteJobMode\n pattern?: SiteJobPattern\n /** Whether the service has a page in every served suburb (its own family, or the suburb page itself). */\n suburbFamily: boolean\n onLocationPages: SiteLocationRole\n reason: string\n}\n\n/** The 90-day lead baseline, target and read dates (v2 §9.4). Counts are what GA4 and the profile recorded. */\nexport interface SiteLeadBaseline {\n /** YYYY-MM-DD, about 90 days. */\n window: { start: string; end: string }\n /** Provider-accepted form sends (`contact_form`). */\n acceptedForms: number\n /** `phone_link_click` events. */\n phoneTaps: number\n businessProfileCalls?: number | null\n qualifiedEnquiries?: number | null\n organicActions?: number\n paidActions?: number\n note?: string\n target: string\n /** Dates or milestones (\"day 28 after launch\"). */\n readDates: readonly string[]\n}\n\n/** A true reason to choose the business, with the claims-register ids or named sources behind it. */\nexport interface SiteReasonToChoose {\n text: string\n claims: readonly string[]\n}\n\n/** The owner's job economics; `null` until the owner says. Nothing renders from them. */\nexport interface SiteJobEconomics {\n /** Whole dollars. */\n averageJobValue: number | null\n /** A fraction from 0 to 1. */\n closeRate: number | null\n capacityWeeksBooked: number | null\n /** The minimum job or call-out fee, as the owner put it. */\n minimumJob: string | null\n unwantedJobs: readonly string[] | null\n preferredContact: SiteContactChannel | null\n}\n\n/** One of the owner's (at most five) questions, with its fallback and dates. */\nexport interface SiteOwnerQuestion {\n id: string\n question: string\n fallback: string\n /** YYYY-MM-DD. */\n drafted: string\n sent?: string\n answered?: string\n}\n\nexport interface SiteExclusion {\n suburb: string\n reason: SiteExclusionReason\n}\n\n/**\n * The typed decisions a site records beside its `siteStrategy` (v2 §2.4, §12.2 step 2): the decision card, the money\n * services with their job modes, the lead baseline, the reasons to choose, the owner's economics and questions.\n */\nexport interface SiteStrategyDecisions {\n /** YYYY-MM-DD. */\n recordedOn: string\n trade: string\n mainArea: string\n /** The home page's phrase, for example \"tree services sydney\". */\n homePhrase: string\n decisionCard: SiteDecisionCard\n moneyServices: readonly SiteMoneyService[]\n leadBaseline: SiteLeadBaseline\n /** Up to three (the spec asks for three; fewer is allowed so none is invented). */\n reasonsToChoose: readonly SiteReasonToChoose[]\n jobEconomics?: SiteJobEconomics\n /** The client's lane: where proof goes first. */\n homeTerritory?: readonly string[]\n tiers?: { head: string; standard: string; noPage: string }\n exclusions?: readonly SiteExclusion[]\n ownerQuestions?: readonly SiteOwnerQuestion[]\n}\n\nexport const SITE_MAX_OWNER_QUESTIONS = 5\nexport const SITE_MAX_REASONS_TO_CHOOSE = 3\nconst LEAD_WINDOW_DAYS = { min: 60, max: 120 } as const\n\nfunction assertIsoDate(value: unknown, field: string): number {\n const day = typeof value === 'string' && ISO_DAY.test(value) ? Date.parse(`${value}T00:00:00Z`) : Number.NaN\n if (Number.isNaN(day) || new Date(day).toISOString().slice(0, 10) !== value) throw new Error(`${field} must be a YYYY-MM-DD date.`)\n return day\n}\n\nfunction assertCount(value: unknown, field: string, nullable = false) {\n if (nullable && value === null) return\n if (typeof value !== 'number' || !Number.isInteger(value) || value < 0) throw new Error(`${field} must be a whole number, 0 or more.`)\n}\n\nfunction assertMoneyServices(services: readonly SiteMoneyService[]) {\n if (!Array.isArray(services) || services.length === 0) throw new Error('decisions.moneyServices must list at least one money service.')\n const slugs = new Set<string>()\n services.forEach((service, index) => {\n const field = `decisions.moneyServices[${index}]`\n assertExactKeys(service, ['slug', 'name', 'jobMode', 'pattern', 'suburbFamily', 'onLocationPages', 'reason'], field, ['pattern'])\n if (typeof service.slug !== 'string' || !/^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(service.slug)) throw new Error(`${field}.slug must be a kebab-case slug.`)\n if (slugs.has(service.slug)) throw new Error(`decisions.moneyServices lists \"${service.slug}\" more than once.`)\n slugs.add(service.slug)\n assertText(service.name, `${field}.name`, 80)\n assertText(service.reason, `${field}.reason`, 600)\n if (!(SITE_JOB_MODES as readonly string[]).includes(service.jobMode)) throw new Error(`${field}.jobMode must be one of ${SITE_JOB_MODES.join(', ')}.`)\n if (service.pattern !== undefined && !(SITE_JOB_PATTERNS as readonly string[]).includes(service.pattern)) {\n throw new Error(`${field}.pattern must be one of ${SITE_JOB_PATTERNS.join(', ')}.`)\n }\n if (!(SITE_LOCATION_ROLES as readonly string[]).includes(service.onLocationPages)) {\n throw new Error(`${field}.onLocationPages must be one of ${SITE_LOCATION_ROLES.join(', ')}.`)\n }\n if (typeof service.suburbFamily !== 'boolean' || service.suburbFamily !== (service.onLocationPages !== 'suburb-page-section')) {\n throw new Error(`${field}.suburbFamily must be true exactly when the service owns the suburb page or has its own service-in-suburb pages.`)\n }\n })\n if (services.filter((service) => service.onLocationPages === 'owns-suburb-page').length > 1) {\n throw new Error('decisions.moneyServices: only one money service owns the suburb page (the main trade).')\n }\n}\n\nfunction assertLeadBaseline(baseline: SiteLeadBaseline) {\n const field = 'decisions.leadBaseline'\n const keys = ['window', 'acceptedForms', 'phoneTaps', 'businessProfileCalls', 'qualifiedEnquiries', 'organicActions', 'paidActions', 'note', 'target', 'readDates']\n assertExactKeys(baseline, keys, field, ['businessProfileCalls', 'qualifiedEnquiries', 'organicActions', 'paidActions', 'note'])\n assertExactKeys(baseline.window, ['start', 'end'], `${field}.window`)\n const span = (assertIsoDate(baseline.window.end, `${field}.window.end`) - assertIsoDate(baseline.window.start, `${field}.window.start`)) / DAY_MS\n if (span < LEAD_WINDOW_DAYS.min || span > LEAD_WINDOW_DAYS.max) {\n throw new Error(`${field}.window spans ${span} days; the baseline covers the last 90 days.`)\n }\n assertCount(baseline.acceptedForms, `${field}.acceptedForms`)\n assertCount(baseline.phoneTaps, `${field}.phoneTaps`)\n if (baseline.businessProfileCalls !== undefined) assertCount(baseline.businessProfileCalls, `${field}.businessProfileCalls`, true)\n if (baseline.qualifiedEnquiries !== undefined) assertCount(baseline.qualifiedEnquiries, `${field}.qualifiedEnquiries`, true)\n if (baseline.organicActions !== undefined) assertCount(baseline.organicActions, `${field}.organicActions`)\n if (baseline.paidActions !== undefined) assertCount(baseline.paidActions, `${field}.paidActions`)\n if (baseline.note !== undefined) assertText(baseline.note, `${field}.note`, 600)\n assertText(baseline.target, `${field}.target`, 300)\n assertTextList(baseline.readDates, `${field}.readDates`, 1)\n}\n\nfunction assertReasons(reasons: readonly SiteReasonToChoose[]) {\n if (!Array.isArray(reasons) || reasons.length === 0) throw new Error('decisions.reasonsToChoose must list at least one true reason.')\n if (reasons.length > SITE_MAX_REASONS_TO_CHOOSE) throw new Error('decisions.reasonsToChoose takes at most three reasons.')\n reasons.forEach((reason, index) => {\n const field = `decisions.reasonsToChoose[${index}]`\n assertExactKeys(reason, ['text', 'claims'], field)\n assertText(reason.text, `${field}.text`, 300)\n assertTextList(reason.claims, `${field}.claims`, 1)\n })\n}\n\nfunction assertJobEconomics(economics: SiteJobEconomics) {\n const field = 'decisions.jobEconomics'\n assertExactKeys(economics, ['averageJobValue', 'closeRate', 'capacityWeeksBooked', 'minimumJob', 'unwantedJobs', 'preferredContact'], field)\n assertCount(economics.averageJobValue, `${field}.averageJobValue`, true)\n if (economics.closeRate !== null && (typeof economics.closeRate !== 'number' || !(economics.closeRate >= 0 && economics.closeRate <= 1))) {\n throw new Error(`${field}.closeRate must be a fraction from 0 to 1, or null.`)\n }\n if (economics.capacityWeeksBooked !== null && (typeof economics.capacityWeeksBooked !== 'number' || !(economics.capacityWeeksBooked >= 0))) {\n throw new Error(`${field}.capacityWeeksBooked must be 0 or more weeks, or null.`)\n }\n if (economics.minimumJob !== null) assertText(economics.minimumJob, `${field}.minimumJob`)\n if (economics.unwantedJobs !== null) assertTextList(economics.unwantedJobs, `${field}.unwantedJobs`, 1)\n if (economics.preferredContact !== null && !(SITE_CONTACT_CHANNELS as readonly string[]).includes(economics.preferredContact)) {\n throw new Error(`${field}.preferredContact must be one of ${SITE_CONTACT_CHANNELS.join(', ')}, or null.`)\n }\n}\n\nfunction assertOwnerQuestions(questions: readonly SiteOwnerQuestion[]) {\n if (!Array.isArray(questions)) throw new Error('decisions.ownerQuestions must be a list.')\n if (questions.length > SITE_MAX_OWNER_QUESTIONS) throw new Error('decisions.ownerQuestions holds at most five single questions per client.')\n const ids = new Set<string>()\n questions.forEach((question, index) => {\n const field = `decisions.ownerQuestions[${index}]`\n assertExactKeys(question, ['id', 'question', 'fallback', 'drafted', 'sent', 'answered'], field, ['sent', 'answered'])\n assertText(question.id, `${field}.id`, 40)\n if (ids.has(question.id)) throw new Error(`decisions.ownerQuestions lists \"${question.id}\" more than once.`)\n ids.add(question.id)\n assertText(question.question, `${field}.question`, 300)\n assertText(question.fallback, `${field}.fallback`, 300)\n const drafted = assertIsoDate(question.drafted, `${field}.drafted`)\n const sent = question.sent === undefined ? undefined : assertIsoDate(question.sent, `${field}.sent`)\n if (sent !== undefined && sent < drafted) throw new Error(`${field}.sent is before it was drafted.`)\n if (question.answered !== undefined) {\n const answered = assertIsoDate(question.answered, `${field}.answered`)\n if (answered < (sent ?? drafted)) throw new Error(`${field}.answered is before it was ${sent === undefined ? 'drafted' : 'sent'}.`)\n }\n })\n}\n\n/** Validates the decisions a site records beside its `siteStrategy` and returns them with their literal types kept. */\nexport function defineStrategyDecisions<const T extends SiteStrategyDecisions>(decisions: T): T {\n const keys = [\n 'recordedOn', 'trade', 'mainArea', 'homePhrase', 'decisionCard', 'moneyServices', 'leadBaseline', 'reasonsToChoose',\n 'jobEconomics', 'homeTerritory', 'tiers', 'exclusions', 'ownerQuestions',\n ]\n assertExactKeys(decisions, keys, 'decisions', ['jobEconomics', 'homeTerritory', 'tiers', 'exclusions', 'ownerQuestions'])\n assertIsoDate(decisions.recordedOn, 'decisions.recordedOn')\n assertText(decisions.trade, 'decisions.trade', 80)\n assertText(decisions.mainArea, 'decisions.mainArea', 80)\n assertText(decisions.homePhrase, 'decisions.homePhrase', 80)\n const cardKeys = ['desiredWorkAndArea', 'currentEnquiryConstraint', 'evidence', 'selectedAction', 'expectedMechanism', 'successMeasure', 'reviewDate'] as const\n assertExactKeys(decisions.decisionCard, cardKeys, 'decisions.decisionCard')\n for (const key of cardKeys) assertText(decisions.decisionCard[key], `decisions.decisionCard.${key}`, 600)\n assertMoneyServices(decisions.moneyServices)\n assertLeadBaseline(decisions.leadBaseline)\n assertReasons(decisions.reasonsToChoose)\n if (decisions.jobEconomics !== undefined) assertJobEconomics(decisions.jobEconomics)\n if (decisions.homeTerritory !== undefined) assertTextList(decisions.homeTerritory, 'decisions.homeTerritory', 1)\n if (decisions.tiers !== undefined) {\n assertExactKeys(decisions.tiers, ['head', 'standard', 'noPage'], 'decisions.tiers')\n for (const key of ['head', 'standard', 'noPage'] as const) assertText(decisions.tiers[key], `decisions.tiers.${key}`, 300)\n }\n if (decisions.exclusions !== undefined) {\n if (!Array.isArray(decisions.exclusions)) throw new Error('decisions.exclusions must be a list.')\n decisions.exclusions.forEach((exclusion, index) => {\n const field = `decisions.exclusions[${index}]`\n assertExactKeys(exclusion, ['suburb', 'reason'], field)\n assertText(exclusion.suburb, `${field}.suburb`, 80)\n if (!(SITE_EXCLUSION_REASONS as readonly string[]).includes(exclusion.reason)) {\n throw new Error(`${field}.reason must be one of ${SITE_EXCLUSION_REASONS.join(', ')}.`)\n }\n })\n }\n if (decisions.ownerQuestions !== undefined) assertOwnerQuestions(decisions.ownerQuestions)\n return decisions\n}\n\n// ---------------------------------------------------------------------------\n// The estate plan (3.14.0)\n// ---------------------------------------------------------------------------\n\nconst SLUG = /^[a-z0-9]+(?:-[a-z0-9]+)*$/\nconst PLACEHOLDER = { region: '{region}', suburb: '{suburb}' } as const\n\nfunction templateProblem(template: unknown, placeholder: string): boolean {\n if (typeof template !== 'string' || !template.endsWith(`/${placeholder}`)) return true\n const parent = template.slice(0, -placeholder.length - 1)\n return parent !== '' && (!ROUTE_PATTERN.test(parent) || parent.includes('*') || parent.includes('{'))\n}\n\nfunction parentOf(template: string | undefined): string | undefined {\n return template === undefined ? undefined : template.slice(0, template.lastIndexOf('/'))\n}\n\n/**\n * What breaks an estate plan, in plain sentences (empty when nothing does): malformed routes or paths, a page indexed\n * now that a wave still to come also lists, suburb renames other than \"{slug}-suburb\" and region and suburb pages that\n * would share a path. Conformance's LOC-INDEX reads the same plan against the built pages.\n */\nexport function estatePlanProblems(plan: SiteEstatePlan, waves: readonly SiteReleaseWave[], today: string = sydneyToday()): string[] {\n const problems: string[] = []\n if (!Array.isArray(plan.indexedNow)) return ['estate.indexedNow must be a list of paths or patterns.']\n plan.indexedNow.forEach((route, index) => {\n if (typeof route !== 'string' || !ROUTE_PATTERN.test(route) || (route.length > 1 && route.endsWith('/'))) {\n problems.push(`estate.indexedNow[${index}] must be a root-relative path or pattern such as \"/services/decking/*\".`)\n }\n })\n for (const wave of waves) {\n if (wave.releaseOn <= today) continue\n for (const route of wave.routes) {\n if (plan.indexedNow.includes(route)) problems.push(`\"${route}\" is indexed now and also in the wave of ${wave.releaseOn}; a page indexed now never waits for a wave.`)\n }\n }\n const paths = plan.paths ?? {}\n if (paths.region !== undefined && templateProblem(paths.region, PLACEHOLDER.region)) {\n problems.push('estate.paths.region must be a root-relative path ending in \"/{region}\".')\n }\n if (paths.suburb !== undefined && templateProblem(paths.suburb, PLACEHOLDER.suburb)) {\n problems.push('estate.paths.suburb must be a root-relative path ending in \"/{suburb}\".')\n }\n for (const template of paths.serviceInSuburb ?? []) {\n if (templateProblem(template, PLACEHOLDER.suburb)) problems.push(`estate.paths.serviceInSuburb \"${template}\" must be a root-relative path ending in \"/{suburb}\".`)\n else if (template === paths.suburb) problems.push(`estate.paths.serviceInSuburb \"${template}\" is also the suburb path.`)\n }\n const regions = plan.slugs?.regions ?? {}\n const suburbs = plan.slugs?.suburbs ?? {}\n const regionSlugs = new Map<string, string>()\n for (const [registry, slug] of Object.entries(regions)) {\n if (!SLUG.test(registry) || typeof slug !== 'string' || !SLUG.test(slug)) {\n problems.push(`estate.slugs.regions.${registry} must map a registry slug to a kebab-case slug.`)\n continue\n }\n if (regionSlugs.has(slug)) problems.push(`estate.slugs.regions gives \"${slug}\" to more than one region.`)\n regionSlugs.set(slug, registry)\n }\n for (const [registry, slug] of Object.entries(suburbs)) {\n if (!SLUG.test(registry) || slug !== `${registry}-suburb`) {\n problems.push(`estate.slugs.suburbs.${registry} is \"${String(slug)}\"; a suburb that clashes with a region takes \"${registry}-suburb\".`)\n }\n }\n const shared = paths.region !== undefined && paths.suburb !== undefined && parentOf(paths.region) === parentOf(paths.suburb)\n if (shared) {\n for (const slug of Object.values(suburbs)) {\n if (regionSlugs.has(slug)) problems.push(`The region \"${regionSlugs.get(slug)}\" and a suburb both take \"${slug}\" under ${parentOf(paths.suburb)}.`)\n }\n }\n return problems\n}\n\n/** A place's public slug in the estate: the plan's rename, or the registry slug. */\nexport function estatePublicSlug(plan: SiteEstatePlan, kind: 'region' | 'suburb', registrySlug: string): string {\n const renames = kind === 'region' ? plan.slugs?.regions : plan.slugs?.suburbs\n return renames && Object.hasOwn(renames, registrySlug) ? renames[registrySlug]! : registrySlug\n}\n\n/**\n * A location page's path: the family's path with the place's public slug. `template` picks a nested service-in-suburb\n * family (or its service-region hub, with `kind: 'region'`); it must be one of the plan's paths.\n */\nexport function estateLocationPath(plan: SiteEstatePlan, kind: 'region' | 'suburb', registrySlug: string, template?: string): string {\n const paths = plan.paths ?? {}\n const own = kind === 'region' ? paths.region : paths.suburb\n const known = [paths.region, paths.suburb, ...(paths.serviceInSuburb ?? [])].filter((value): value is string => value !== undefined)\n let chosen = template ?? own\n if (template !== undefined && !known.includes(template)) {\n // A service-in-suburb family's hub sits beside its suburb pages: \"/x/{suburb}\" also gives \"/x/{region}\".\n const hub = (paths.serviceInSuburb ?? []).find((candidate) => candidate.replace(/\\{suburb\\}$/, '{region}') === template)\n if (!hub) throw new Error(`\"${template}\" is not one of the estate's paths.`)\n chosen = template\n }\n if (chosen === undefined) throw new Error(`The estate plan records no ${kind} path.`)\n const parent = chosen.slice(0, chosen.lastIndexOf('/'))\n return `${parent}/${estatePublicSlug(plan, kind, registrySlug)}`\n}\n\n// ---------------------------------------------------------------------------\n// Link or plain text (3.15.0)\n// ---------------------------------------------------------------------------\n\n/** Whether a location page is linked (`link`) or named as plain text (`text`) on the site's indexable pages. */\nexport type EstateLinkState = 'link' | 'text'\n\nexport interface EstateLinkOptions {\n /** The estate plan (`siteStrategy.estate`). */\n readonly estate?: SiteEstatePlan\n /** The release and return waves (`siteStrategy.waves`). */\n readonly waves?: readonly SiteReleaseWave[]\n /** The day the page is built for: YYYY-MM-DD in Sydney, or a moment read as that day in Sydney. Defaults to today. */\n readonly on?: string | Date\n}\n\nfunction linkDay(on: string | Date | undefined): string {\n if (on === undefined) return sydneyToday()\n if (on instanceof Date) return sydneyToday(on)\n if (!ISO_DAY.test(on) || Number.isNaN(Date.parse(on))) throw new Error(`\"${on}\" is not a day; give it as YYYY-MM-DD.`)\n return on\n}\n\n/**\n * Whether an indexable page may link a location page (D4 return waves; LOC-INDEX reads the same plan): a page indexed\n * now and a page whose wave is due (`releaseOn` on or before `on`) are links; a page still waiting for its wave is plain\n * text, because indexable pages never link a noindex location page. With an estate plan, a page it does not account for\n * is plain text too (LOC-INDEX fails it until it is listed); without one, a page no wave dates is live now. `path` is\n * the public path, as `estateLocationPath` builds it (renamed slugs, nested service-in-suburb families).\n */\nexport function estateLinkState(path: string, { estate, waves = [], on }: EstateLinkOptions): EstateLinkState {\n const day = linkDay(on)\n if (estate?.indexedNow.some((route) => matchesWaveRoute(path, route))) return 'link'\n const wave = waveForRoute(waves, path)\n if (wave) return wave.releaseOn <= day ? 'link' : 'text'\n return estate ? 'text' : 'link'\n}\n\n/** One `Coverage` entry: a link to the area's page, or the area's name as plain text while its page waits for its wave. */\nexport interface CoverageEntry {\n readonly label: string\n readonly href?: string\n}\n\nexport interface CoverageEntryOptions<P> extends EstateLinkOptions {\n /** The place's public path. Defaults to the plan's suburb path (`estateLocationPath(estate, 'suburb', slug)`). */\n readonly pathFor?: (place: P) => string\n}\n\n/**\n * `Coverage` entries for a list of places (a region's suburbs from the registry, in the order given): each live page is\n * a link, each page still waiting for its wave the place's name as plain text, so a region page can list every suburb\n * in the region and still count it in \"All {n} areas\".\n */\nexport function coverageEntries<P extends { readonly slug: string; readonly name: string }>(\n places: readonly P[],\n options: CoverageEntryOptions<P>,\n): CoverageEntry[] {\n const { estate, pathFor } = options\n if (!pathFor && !estate?.paths?.suburb) throw new Error('coverageEntries needs pathFor, or an estate plan with a suburb path.')\n const day = linkDay(options.on)\n return places.map((place) => {\n const href = pathFor ? pathFor(place) : estateLocationPath(estate!, 'suburb', place.slug)\n return estateLinkState(href, { ...options, on: day }) === 'link' ? { label: place.name, href } : { label: place.name }\n })\n}\n"]}
|