{
  "version": 3,
  "sources": ["review-feed.js"],
  "sourcesContent": ["/* review-feed.js — one feed for a page: everything on it, from every channel, in time order.\n *\n * Kolin, 2026-10-30: \"one main portal where all the feedback is laid out despite having different mechanisms to\n * gather inputs.\" Feedback (requests) and comments are one list now, told apart by how they're drawn. Around them,\n * the rest of the page's story: each saved revision, sign-offs, edits made by hand in the studio or through the Claude\n * connector, and Klaude's work. A new channel (email next, then others) only has to say which channel a note came from.\n *\n * Pure: the room hands it what it already loaded (notes, versions, sign-offs, Klaude's turns) and draws what comes back.\n */\n\n// Where something came from. A note says its own channel when it has one (email, later); otherwise it was left in the room.\nexport const CHANNELS = {\n  room: { word: \"Room\", icon: \"mouse-pointer-2\" },\n  email: { word: \"Email\", icon: \"mail\" },\n  studio: { word: \"Studio\", icon: \"pencil-line\" },\n  claude: { word: \"Claude\", icon: \"messages-square\" },\n  klaude: { word: \"Klaude\", icon: \"sparkles\" },\n};\nexport const noteChannel = (n) => (n && CHANNELS[n.channel] ? n.channel : \"room\");\n// A turn Claude saved through the Resonate connector is Claude's; a hand edit or a restore is the studio's; the rest is Klaude's work.\nexport const turnChannel = (t) => (t.via_claude ? \"claude\" : t.kind === \"edit\" || t.kind === \"restore\" ? \"studio\" : \"klaude\");\n\nconst at = (x) => Date.parse(x && x.created_at) || 0;\nconst byTime = (a, b) => at(a) - at(b) || String(a.id).localeCompare(String(b.id));\n\n// One number per note across the whole page, in the order they were left, so C7 stays C7 on every revision and in\n// every channel. Requests and comments share the count.\nexport function noteNumbers(notes) {\n  const nums = new Map();\n  [...(notes || [])].sort(byTime).forEach((n, i) => nums.set(n.id, i + 1));\n  return nums;\n}\n\n// The turns that belong in the feed, and as what: an edit (by hand or through Claude), Klaude's work on notes or on\n// something asked of it, a first draft. Setup turns (the live page copied, an import, a fact) and remix takes are\n// the Klaude tab's business; so are turns that failed or were canceled.\nconst DRAFTS = new Set([\"create\", \"new\", \"html\", \"improve\"]);\nconst SKIP = new Set([\"baseline\", \"import\", \"company_fact\", \"remix\"]);\nexport function turnItem(t) {\n  if (!t || SKIP.has(t.kind)) return null;\n  if (t.status === \"queued\" || t.status === \"running\") return { type: \"working\", turn: t, at: at(t) };\n  if (t.status !== \"done\") return null;\n  if (t.kind === \"edit\" || t.kind === \"restore\") return { type: \"edit\", turn: t, channel: turnChannel(t), at: at(t) };\n  if (DRAFTS.has(t.kind)) return { type: \"klaude\", turn: t, first: true, channel: \"klaude\", at: at(t) };\n  return { type: \"klaude\", turn: t, channel: turnChannel(t), at: at(t) };\n}\n\n// The saved revisions people review, oldest first.\nexport const readyVersions = (versions) => (versions || []).filter((v) => v.deploy_state === \"ready\").sort(byTime);\n\n// Edits made since the newest revision: on the draft, in no revision yet, so nobody has approved them.\nexport function unreviewedEdits(turns, versions) {\n  const vs = readyVersions(versions), newest = vs[vs.length - 1];\n  if (!newest) return [];\n  return (turns || []).filter((t) => t.status === \"done\" && (t.kind === \"edit\" || t.kind === \"restore\") && at(t) > at(newest)).sort(byTime);\n}\n\n// The feed itself, oldest first, as items the room draws:\n//   chapter   a saved revision ({ version, index })\n//   folded    the revisions before the newest one, folded to a line ({ versions, requests, done, approvals })\n//   note      a request or a comment ({ note, channel })\n//   approval  a sign-off ({ signoff, version })\n//   edit      a hand edit or one through Claude ({ turn, channel, unreviewed })\n//   klaude    Klaude's work ({ turn, first })\n//   working   Klaude working now ({ turn })\n//   unreviewed  a line after the newest revision: edits since then nobody has approved ({ count })\n// filter: \"all\" or \"open\" (open requests and comments only). channel: one of CHANNELS, or \"\" for all. person: a uid, or \"\".\n// open: revision ids whose fold was opened.\nexport function buildFeed({ notes = [], versions = [], signoffs = [], turns = [], filter = \"all\", channel = \"\", person = \"\", open = [] } = {}) {\n  const vs = readyVersions(versions), newest = vs[vs.length - 1];\n  const nameOf = (vid) => (vs.find((v) => v.id === vid) || {}).name || \"\";\n  const late = new Set(unreviewedEdits(turns, versions).map((t) => t.id));\n  const onlyOpen = filter === \"open\";\n  const keep = (it) => (!channel || it.channel === channel) && (!person || it.uid === person);\n\n  let items = [];\n  for (const n of notes) if (!onlyOpen || n.status === \"open\") items.push({ type: \"note\", note: n, channel: noteChannel(n), uid: n.author_uid, at: at(n) });\n  if (!onlyOpen) {\n    for (const s of signoffs) items.push({ type: \"approval\", signoff: s, version: nameOf(s.version_id), channel: s.channel || \"room\", uid: s.uid, at: at(s) });\n    for (const t of turns) { const it = turnItem(t); if (it && it.type !== \"working\") items.push({ ...it, uid: t.author_uid, unreviewed: late.has(t.id) }); }\n  }\n  items = items.filter(keep);\n  // Revisions mark the time line whatever the filter: they're how the feed reads.\n  vs.forEach((v, i) => items.push({ type: \"chapter\", version: v, index: i + 1, at: at(v) }));\n  items.sort((a, b) => a.at - b.at || (a.type === \"chapter\" ? -1 : b.type === \"chapter\" ? 1 : 0));\n\n  // The edits since the newest revision, said once, right after it: the ones this view shows.\n  const lateShown = items.filter((it) => it.type === \"edit\" && it.unreviewed).length;\n  if (newest && lateShown) {\n    const i = items.findIndex((it) => it.type === \"chapter\" && it.version.id === newest.id);\n    items.splice(i + 1, 0, { type: \"unreviewed\", count: lateShown, at: at(newest) });\n  }\n  // Klaude at work now goes last.\n  for (const t of turns) { const it = turnItem(t); if (it && it.type === \"working\" && !onlyOpen && (!channel || channel === \"klaude\")) items.push(it); }\n\n  // Everything before the newest revision folds to one line, unless it was opened.\n  if (vs.length > 1 && !open.includes(\"older\")) {\n    const cut = items.findIndex((it) => it.type === \"chapter\" && it.version.id === newest.id);\n    const before = items.slice(0, cut), notesBefore = before.filter((it) => it.type === \"note\");\n    const fold = { type: \"folded\", versions: vs.slice(0, -1).map((v) => v.name), requests: notesBefore.filter((it) => it.note.kind === \"suggest\").length,\n      done: notesBefore.filter((it) => it.note.status !== \"open\").length, open: notesBefore.filter((it) => it.note.status === \"open\").length,\n      approvals: before.filter((it) => it.type === \"approval\" && it.signoff.decision === \"approve\").length };\n    // A note before the cut that's still open stays in view: it's still to do.\n    items = [fold, ...before.filter((it) => it.type === \"note\" && it.note.status === \"open\"), ...items.slice(cut)];\n  }\n  return items;\n}\n\n// ── The page's story, as the panel tells it (Kolin, 2026-10-30) ─────────────\n// Two ways to read it: Feedback (since the newest revision) and History (everything since the first draft). Klaude\n// leads the review; the panel is the record of what changed and what people said, not a set of controls.\n\n// Everything in time order, nothing folded.\nexport const pageStory = (args = {}) => buildFeed({ ...args, open: [\"older\"] });\n// From the newest revision on (all of it when there's no revision yet).\nexport function sinceNewest(items) {\n  let i = -1;\n  items.forEach((it, k) => { if (it.type === \"chapter\") i = k; });\n  return i < 0 ? items : items.slice(i);\n}\n// \"C3\", \"C3 and C4\", \"C3, C4 and C5\".\nexport function joinIds(ids) {\n  const l = (ids || []).filter(Boolean);\n  return l.length < 2 ? l.join(\"\") : `${l.slice(0, -1).join(\", \")} and ${l[l.length - 1]}`;\n}\nconst cut = (s, n) => { const t = String(s || \"\").replace(/\\s+/g, \" \").trim(); return t.length > n ? `${t.slice(0, n - 1).trimEnd()}…` : t; };\n// Where a note was left, in words: on the words it's about, on a part of the page, or nothing for the whole page.\nexport function anchorWords(a) {\n  if (!a || a.type === \"page\") return \"\";\n  if (a.type === \"text\" && a.exact) return `on “${cut(a.exact, 60)}”`;\n  // An element's label reads mid-sentence: \"on the headline\", but an acronym or a name keeps its capital.\n  const hint = cut(a.hint, 60).replace(/^(The|A|An|This|Our|Your)\\b/, (w) => w.toLowerCase());\n  return a.hint ? `on ${hint}` : \"on part of the page\";\n}\nconst STATUS_WORD = { resolved: \"Done\", wont: \"Won't do\", approved: \"Approved\" };\n// A note as a line of the story: what they did, where, their words, and its tags (its number, where it stands).\nexport function noteWords(n, num = 0) {\n  const tags = [num ? `C${num}` : \"\", STATUS_WORD[n.status] || \"\", n.status === \"open\" && n.klaude && n.klaude.state === \"question\" ? \"Klaude asked a question\" : \"\"].filter(Boolean);\n  const replies = Math.max(0, (n.messages || []).length - 1);\n  if (replies) tags.push(replies === 1 ? \"1 reply\" : `${replies} replies`);\n  return { verb: n.kind === \"suggest\" ? \"asked for a change\" : \"commented\", on: anchorWords(n.anchor), quote: ((n.messages || [])[0] || {}).body || \"\", tags };\n}\n// A day heading for the timeline: Today, Yesterday, or the date (\"Oct 27\").\nexport function dayLabel(iso, now = new Date()) {\n  const d = new Date(iso), y = new Date(now); y.setDate(now.getDate() - 1);\n  if (d.toDateString() === now.toDateString()) return \"Today\";\n  if (d.toDateString() === y.toDateString()) return \"Yesterday\";\n  return d.toLocaleDateString(\"en-US\", { month: \"short\", day: \"numeric\", ...(d.getFullYear() !== now.getFullYear() ? { year: \"numeric\" } : {}) });\n}\n\n// ── Feedback first (Kolin, 2026-10-31) ──────────────────────────────────────\n// Everyone opens on Feedback: Klaude's welcome, a few good places to start, the story since the newest revision, one\n// line saying where things stand, and one box to tell Klaude what to change. These are its words, kept here so the\n// tests can read every one. Customer-facing: plain, \"we\" and \"you\", Klaude by name, no em dashes.\n\nconst first = (n) => { const w = String(n || \"\").trim().split(/\\s+/).filter(Boolean); return w.find((x) => x.replace(/[.,]/g, \"\").length > 1) || w[0] || \"\"; };\n// \"Dana\", \"Dana and Sam\", \"Dana, Sam and Resonate\".\nexport function namesLine(names) {\n  const l = [...new Set((names || []).filter(Boolean))];\n  return l.length < 2 ? l.join(\"\") : `${l.slice(0, -1).join(\", \")} and ${l[l.length - 1]}`;\n}\n\n// A note that names someone in the room with @ is a question for them, not a change for Klaude: \"@Dana\" or \"@Dana Lee\"\n// (the name's case doesn't matter). → the people it names, each once.\nexport function mentionsIn(text, people) {\n  const t = ` ${String(text || \"\")}`.toLowerCase(), out = [];\n  for (const p of people || []) {\n    const full = String(p && p.name || \"\").replace(/\\s*\\([^)]*\\)\\s*$/, \"\").trim().toLowerCase();\n    if (!full) continue;\n    const said = [full, first(full)].filter(Boolean).some((n) => new RegExp(`[\\\\s(]@${n.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\")}(?![\\\\p{L}\\\\d])`, \"u\").test(t));\n    if (said && !out.some((x) => x.uid === p.uid)) out.push(p);\n  }\n  return out;\n}\n// What the box makes of what's typed: a change for Klaude (stored as kind \"suggest\", which the quiet-window sweep sends,\n// functions/api/review/_feedback.js), or, when it names someone, a comment for them.\nexport const noteKindFor = (text, people) => (mentionsIn(text, people).length ? \"comment\" : \"suggest\");\n\nconst KLAUDE = \"00000000-0000-4000-8000-00000000c1a0\";\n// The notes waiting for Klaude: open changes nobody has sent yet. They go `quiet` minutes after the last one (longer when\n// one came by email: a group answering a thread at once makes one revision). → { n, at } (at: when Klaude starts), or null.\nexport function waitingOf(notes, { quiet = 10, emailQuiet = 30 } = {}) {\n  // On the draft, only notes left in the room's box go by themselves (the server's sweep, _feedback.js).\n  const w = (notes || []).filter((n) => n && n.status === \"open\" && n.kind === \"suggest\" && !n.klaude && n.author_uid !== KLAUDE && (n.version_id || (n.source && n.source.via === \"box\")));\n  if (!w.length) return null;\n  const last = w.reduce((m, n) => Math.max(m, Date.parse(n.updated_at || n.created_at) || 0, Date.parse(n.created_at) || 0), 0);\n  const mins = w.some((n) => n.channel === \"email\") ? Math.max(quiet, emailQuiet) : quiet;\n  return { n: w.length, at: last + mins * 60e3, ids: w.map((n) => n.id) };\n}\n// \"in 8 minutes\", \"in a minute\", \"in a moment\".\nexport function startsIn(at, now = Date.now()) {\n  const m = Math.ceil((at - now) / 60e3);\n  return m <= 0 ? \"in a moment\" : m === 1 ? \"in a minute\" : `in ${m} minutes`;\n}\n// Under a note just left: when Klaude takes it. auto: notes go by themselves after the quiet window; team: the viewer sends them.\nexport function startsLine({ at = 0, auto = true, team = false, now = Date.now() } = {}) {\n  if (auto) return `Klaude will start on this ${startsIn(at, now)}, unless you add more.`;\n  return team ? \"Klaude starts on this when you press Send now.\" : \"Thanks. Resonate sends your notes to Klaude.\";\n}\n// Under the box: who else reads what's typed there.\nexport function seenByLine(names) {\n  const l = namesLine(names);\n  return l ? `${l} ${(names || []).filter(Boolean).length === 1 ? \"sees\" : \"see\"} your notes too.` : \"Klaude reads your notes. Nobody else is on this page yet.\";\n}\n\n// Klaude's welcome, when the viewer hasn't said anything about the newest revision: what the page is, and what happens next.\n//   first: the viewer's first name. title: the page's. rewrite: one of their own pages, rewritten. next: the revision\n//   Klaude sends after their notes (\"Revision 2\"). you: the page is the viewer's own (else they're on the team making it).\nexport function welcomeLine({ first: name = \"\", title = \"\", rewrite = false, next = \"\", you = true } = {}) {\n  const hi = name ? `Hi ${name}. ` : \"Hi. \";\n  const what = rewrite ? `${you ? \"your page\" : \"the page\"}, rewritten` : `${you ? \"your\" : \"the\"} new page`;\n  const t = String(title || \"\").trim();\n  return `${hi}Here's ${what}${t ? `, “${t}”` : \"\"}. Tell me anything you'd change, big or small. I'll make the changes and send ${you ? \"you \" : \"\"}${next || \"the next revision\"}.`;\n}\n\n// Three good places to start, each tied to a block on the page (account/review-agent.js \"starts\"): its headline, its main\n// picture, and the first section that says something about what they sell (else the first section). found:\n// { headline?, photo?, claim? }, each { anchor, label, n? } (n: the section's number on the page). → the prompts, in order.\nconst clip = (s, n) => { const t = String(s || \"\").replace(/\\s+/g, \" \").trim(); return t.length > n ? `${t.slice(0, n - 1).trimEnd()}…` : t; };\nexport function startPrompts(found, { you = true } = {}) {\n  const f = found || {}, out = [];\n  if (f.headline) out.push({ key: \"headline\", tag: \"H1\", q: you ? \"Does the headline sound like you?\" : \"Does the headline sound like them?\", sub: clip(f.headline.label, 70) || \"The first thing readers see\", about: \"Headline\", ph: \"e.g. Make it shorter, or say it the way you would\" });\n  if (f.photo) out.push({ key: \"photo\", tag: \"IMG\", q: \"Is this the right picture?\", sub: clip(f.photo.label, 70) || \"The main picture on the page\", about: \"Main picture\", ph: \"e.g. Use the one of me speaking\" });\n  if (f.claim) out.push({ key: \"claim\", tag: f.claim.n ? `§${f.claim.n}` : \"H2\", q: \"Anything we got wrong here?\", sub: clip(f.claim.label, 70) || \"The first section about what you offer\", about: clip(f.claim.label, 40) || \"This section\", ph: \"e.g. We do this twice a month, not weekly\" });\n  return out.map((p) => ({ ...p, anchor: f[p.key].anchor }));\n}\n\n// Where things stand, in one line, as Klaude says it. The room works out the facts; this says them, in order of what\n// matters most. Every field is optional.\n//   customer   speaking to a customer (we and you)        archived   the room takes nothing new\n//   publishing going live now, on `site`                  busy       Klaude is working on the page\n//   off        no runner is taking work (the team)        held       changes made in Claude wait for approval\n//   asks       questions Klaude has for this viewer       waiting    { n, at, auto, send } notes waiting for Klaude\n//                                                         (send: this viewer can send them now)\n//   hold       on hold: nothing goes live                 live       live on `site`\n//   approved   approved by someone (not live yet)         visible    open to search on the studio\n//   rev        the newest revision's name                 mine       this viewer approved the newest revision\n//   decides    this viewer approves                       waitingOn  first names of whoever approves, still to\n//   goesLive   approving it publishes it                  next       the revision after this one\n//   visible    open to search on the studio itself        changes    live, with newer changes not live yet\n// → { tone: \"work\" | \"wait\" | \"go\" | \"ok\" | \"quiet\", text }\nexport function statusLine(x = {}, now = Date.now()) {\n  const c = !!x.customer, site = x.site || \"\";\n  if (x.archived) return { tone: \"quiet\", text: \"This room is archived. Its notes stay readable.\" };\n  if (x.publishing) return { tone: \"work\", text: `Going live${site ? ` on ${site}` : \"\"} now. It takes a minute.` };\n  if (x.busy) return { tone: \"work\", text: c ? `I'm making your changes. ${x.next || \"The next revision\"} shows up here when it's ready.` : `Klaude is working on the page. ${x.next || \"The next revision\"} shows up here when it's ready.` };\n  if (x.held) return { tone: \"go\", text: \"Changes made in Claude are waiting. People see the approved version until you keep them.\" };\n  if (x.asks) return { tone: \"go\", text: x.asks === 1 ? \"I have a question for you before I change the page.\" : `I have ${x.asks} questions for you before I change the page.` };\n  if (x.waiting && x.waiting.n) {\n    const w = x.waiting, notes = w.n === 1 ? \"your note\" : `${w.n} notes`;\n    if (x.off && !c) return { tone: \"wait\", text: `${w.n === 1 ? \"A note is\" : `${w.n} notes are`} waiting, and Klaude is off right now. It picks them up when it's back.` };\n    if (w.auto) return { tone: \"wait\", text: c ? `I'll start on ${notes} ${startsIn(w.at, now)}, unless you add more.` : `Klaude starts on ${w.n === 1 ? \"1 note\" : `${w.n} notes`} ${startsIn(w.at, now)}, unless someone adds more.` };\n    // Not by itself here: whoever can send presses Send now; anyone else's notes reach Klaude when the team sends them.\n    if (w.send) return { tone: \"wait\", text: c ? `${w.n === 1 ? \"Your note is\" : `${w.n} notes are`} waiting. Press Send now and I'll start.` : `${w.n === 1 ? \"1 note is\" : `${w.n} notes are`} waiting for Klaude. Send now when you're ready.` };\n    return { tone: \"wait\", text: c ? \"Thanks. Resonate sends your notes to Klaude.\" : `${w.n === 1 ? \"1 note is\" : `${w.n} notes are`} waiting for the team to send ${w.n === 1 ? \"it\" : \"them\"} to Klaude.` };\n  }\n  if (x.hold) return { tone: \"wait\", text: \"On hold. It won't go live until someone releases it.\" };\n  if (x.live) return { tone: \"ok\", text: `Live${site ? ` on ${site}` : \"\"}. Search engines and AI assistants can find it.${x.changes ? \" Newer changes are waiting for review.\" : \"\"}` };\n  if (x.approved) return { tone: x.visible ? \"ok\" : \"go\", text: x.visible ? \"Approved and visible on the studio: search engines and AI assistants can find it there.\" : `Approved.${x.goesLive ? \"\" : \" One step left: make it visible to search and AI.\"}` };\n  if (x.rev) {\n    if (x.mine) return { tone: \"ok\", text: `You approved ${x.rev}.${x.waitingOn && x.waitingOn.length ? ` Waiting on ${namesLine(x.waitingOn)}.` : \"\"}` };\n    if (x.decides) return { tone: \"go\", text: `${x.rev} is ready. Approve it${x.goesLive ? \" and it goes live\" : \"\"}, or tell me what to change.` };\n    return { tone: \"wait\", text: `${x.rev} is ready.${x.waitingOn && x.waitingOn.length ? ` ${namesLine(x.waitingOn)} ${x.waitingOn.length === 1 ? \"approves\" : \"approve\"} it.` : \"\"} Tell me anything you'd change.` };\n  }\n  if (x.visible) return { tone: \"ok\", text: \"Live on the studio: search engines and AI assistants can find it there.\" };\n  if (x.off && !c) return { tone: \"wait\", text: \"Klaude is off right now. Notes wait until it's back.\" };\n  return { tone: \"quiet\", text: c ? \"I'm still writing this page. You'll get an email when it's ready.\" : \"The draft is ready. Tell Klaude what to change, or save it as a revision.\" };\n}\n\n// The room's \"Change for this page\" sheet, as a page rule (functions/api/_golive.js cleanPageRule): each choice with\n// its \"if nobody answers\" as the brand's rules screen sets it (account/brand/golive.js), never left to a default that\n// would publish on the date with no yes. \"brand\" goes back to the brand's rule.\nexport function sheetRule(pick) {\n  if (pick === \"all\") return { mode: \"approve\", who: \"all\", quiet: \"wait\" };\n  if (pick === \"date\") return { mode: \"date\", who: \"any\", quiet: \"live\" };\n  if (pick === \"manual\") return { mode: \"manual\", who: \"any\", quiet: \"wait\" };\n  return { mode: \"brand\" };\n}\n\n// ── Where a page stands, read one way (review of PR #741, S11) ───────────────\n// The header's chip, its three dots, the panel's address line and Klaude's status line all read this, so they can't\n// disagree. Live is on their own site or store; a page only on the studio, open to search, is visible there, not live.\n//   x  { live, visible, approved, changes (the draft has what the live page doesn't), publishing, held, revisions }\n// → \"held\" | \"publishing\" | \"live-changes\" | \"live\" | \"visible\" | \"approved\" | \"review\" | \"draft\"\nexport function stageOf(x = {}) {\n  if (x.held) return \"held\";\n  if (x.publishing) return \"publishing\";\n  if (x.live) return x.changes ? \"live-changes\" : \"live\";\n  if (x.visible) return \"visible\";\n  if (x.approved) return \"approved\";\n  return x.revisions ? \"review\" : \"draft\";\n}\n// The chip beside the title, and the dot it lights (0 draft, 1 confirmed, 2 out there).\nexport function stageChip(stage, site = \"\") {\n  return {\n    held: [\"On hold\", 1], publishing: [\"Going live\", 1], \"live-changes\": [\"Live · changes in review\", 2], live: [`Live${site ? ` on ${site}` : \"\"}`, 2],\n    visible: [\"Live on the studio\", 2], approved: [\"Approved\", 1], review: [\"In review\", 0], draft: [\"Draft\", 0],\n  }[stage] || [\"In review\", 0];\n}\n\n// ── Going through a revision with Klaude (the ideal room, board 2) ───────────\n// A revision made from people's notes: Klaude takes the viewer through each change it made, one at a time (who asked,\n// how, their words, what it did), with Looks right or Not quite on each, then the one Approve.\n//\n// The notes a revision answered: done by Klaude after the revision before it was saved, and by the time this one was.\n// A minute's grace on both for the two clocks (a note's time is the Worker's, a revision's the database's).\nconst GRACE_MS = 60e3;\nconst doneAt = (n) => Date.parse(n && n.klaude && n.klaude.at) || 0;\nexport function revisionNotes({ version, versions, notes } = {}) {\n  const vs = readyVersions(versions), i = vs.findIndex((v) => version && v.id === version.id);\n  if (i < 0) return [];\n  const hi = at(vs[i]) + GRACE_MS, lo = i ? at(vs[i - 1]) + GRACE_MS : -Infinity;\n  return (notes || []).filter((n) => n && n.klaude && n.klaude.state === \"done\" && doneAt(n) > lo && doneAt(n) <= hi).sort(byTime);\n}\n// The change on the page a note led to, out of the revision's own list (versions \"changes\"): the one sharing the most\n// words with what Klaude said it did and where (each counted twice), and with what was asked. Two of Klaude's words or\n// four of the note's at least, else -1.\n// What Klaude said comes first because a long note asks for many things and its words land everywhere.\nconst wordSet = (s) => new Set(String(s || \"\").toLowerCase().replace(/[‘’]/g, \"'\").split(/[^\\p{L}\\p{N}']+/u).filter((w) => w.length > 3));\nexport function changeFor(list, note) {\n  if (!note) return -1;\n  const k = note.klaude || {}, a = note.anchor || {};\n  const did = wordSet([a.exact, a.hint, ...(k.blocks || []), k.said].filter(Boolean).join(\" \"));\n  const asked = wordSet([note.suggestion, ((note.messages || [])[0] || {}).body].filter(Boolean).join(\" \"));\n  let best = -1, score = 3;\n  (list || []).forEach((c, i) => {\n    if (!c) return;\n    const have = wordSet(`${c.before || \"\"} ${c.after || \"\"} ${c.section || \"\"}`);\n    let n = 0;\n    for (const w of did) if (have.has(w)) n += 2;\n    for (const w of asked) if (have.has(w) && !did.has(w)) n++;\n    if (n > score) { score = n; best = i; }\n  });\n  return best;\n}\n// One change, in words: where on the page, what kind of change, and what Klaude did (its sentence, and the words\n// before and after when the change was found on the page).\nconst KIND_WORD = { added: \"Added\", removed: \"Removed\", changed: \"Rewrote\" };\nconst upFirst = (s) => String(s || \"\").replace(/^\\p{Ll}/u, (c) => c.toUpperCase());\nexport function walkStep(note, change = null) {\n  const k = (note && note.klaude) || {}, a = (note && note.anchor) || {}, c = change || null;\n  const named = (k.blocks || []).find((b) => String(b).trim());\n  const block = named || (c && c.tag === \"h1\" ? \"Headline\" : c && c.head ? clip(c.after || c.before, 40) : c && c.section ? clip(c.section, 40) : \"\") || clip(a.hint, 40) || \"The page\";\n  return {\n    id: note.id, block: upFirst(clip(block, 48)), kind: c ? KIND_WORD[c.kind] || \"Changed\" : \"Changed\", found: !!c && c.kind !== \"removed\",\n    quote: clip(((note.messages || [])[0] || {}).body, 280), said: clip(k.said, 280),\n    before: c && c.kind !== \"added\" ? clip(c.before, 240) : \"\", after: c && c.kind !== \"removed\" ? clip(c.after, 240) : \"\",\n  };\n}\n// What Klaude says above the walk-through. n: the changes; mine: how many came from the viewer's own notes; you: the\n// page is the viewer's (else they're on the team); at: the step in view (n once they're through); step: it (from\n// walkStep); tally: from walkTally, once they're through.\nexport function walkIntro({ rev = \"\", n = 0, mine = 0, you = true, first: name = \"\", at: i = 0, step = null, tally = null, next = \"\" } = {}) {\n  if (i >= n && tally) {\n    const thanks = name ? `Thanks, ${name}.` : \"Thanks.\";\n    if (tally.redo) return `${thanks} I'll make ${tally.redo === 1 ? \"that change\" : \"those changes\"} in ${next || \"the next revision\"}.`;\n    if (tally.open) return `${tally.open === 1 ? \"One change is\" : `${tally.open} changes are`} still to look at. Pick ${tally.open === 1 ? \"it\" : \"one\"} above.`;\n    return n === 1 ? `That's the one change. ${thanks}` : `That's all ${n}. ${thanks}`;\n  }\n  if (i === 0) {\n    const whose = mine >= n ? (you ? \"your notes\" : \"the notes\") : you ? \"your team's notes\" : \"the team's notes\";\n    const time = n <= 2 ? \"about a minute\" : `about ${Math.ceil(n / 2)} minutes`;\n    const what = n === 1 ? `I made 1 change from ${whose}. Let's look at it together.` : `I made ${n} changes from ${whose}. Let's go through them together; it takes ${time}.`;\n    return `${rev ? `${rev} is ready. ` : \"\"}${what}`;\n  }\n  if (step && !step.found) return step.kind === \"Removed\" ? \"This one was taken out, so it isn't on the page any more.\" : \"I couldn't point to this one on the page, so here it is in words.\";\n  return \"Next one. The page shows where it is.\";\n}\n// Where the viewer stands: how many look right, need another pass, or are still to look at; and the line that says so.\nexport function walkTally(ids, res = {}) {\n  let ok = 0, redo = 0;\n  for (const id of ids || []) { if (res[id] === \"ok\") ok++; else if (res[id] === \"redo\") redo++; }\n  const n = (ids || []).length, open = n - ok - redo;\n  const title = !redo && !open ? (n === 1 ? \"The change looks right\" : `All ${n} changes look right`)\n    : [ok ? `${ok} ${ok === 1 ? \"looks\" : \"look\"} right` : \"\", redo ? `${redo} ${redo === 1 ? \"needs\" : \"need\"} another pass` : \"\", open ? `${open} not looked at yet` : \"\"].filter(Boolean).join(\", \");\n  return { ok, redo, open, all: !redo && !open, title };\n}\n"],
  "mappings": "AAWO,aAAM,SAAW,CACtB,KAAM,CAAE,KAAM,OAAQ,KAAM,iBAAkB,EAC9C,MAAO,CAAE,KAAM,QAAS,KAAM,MAAO,EACrC,OAAQ,CAAE,KAAM,SAAU,KAAM,aAAc,EAC9C,OAAQ,CAAE,KAAM,SAAU,KAAM,iBAAkB,EAClD,OAAQ,CAAE,KAAM,SAAU,KAAM,UAAW,CAC7C,EACa,YAAeA,GAAOA,GAAK,SAASA,EAAE,OAAO,EAAIA,EAAE,QAAU,OAE7D,YAAeC,GAAOA,EAAE,WAAa,SAAWA,EAAE,OAAS,QAAUA,EAAE,OAAS,UAAY,SAAW,SAEpH,MAAMC,EAAMC,GAAM,KAAK,MAAMA,GAAKA,EAAE,UAAU,GAAK,EAC7CC,EAAS,CAACC,EAAGC,IAAMJ,EAAGG,CAAC,EAAIH,EAAGI,CAAC,GAAK,OAAOD,EAAE,EAAE,EAAE,cAAc,OAAOC,EAAE,EAAE,CAAC,EAI1E,gBAAS,YAAYC,EAAO,CACjC,MAAMC,EAAO,IAAI,IACjB,OAAC,GAAID,GAAS,CAAC,CAAE,EAAE,KAAKH,CAAM,EAAE,QAAQ,CAAC,EAAG,IAAMI,EAAK,IAAI,EAAE,GAAI,EAAI,CAAC,CAAC,EAChEA,C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,IAAM,EAAI,yBAA2B,OAAOA,CAAC,sBACzE,CAACqG,EAAK,GAAGA,CAAE,IAAIA,IAAO,EAAI,QAAU,MAAM,SAAW,GAAIC,EAAO,GAAGA,CAAI,IAAIA,IAAS,EAAI,QAAU,MAAM,gBAAkB,GAAIlF,EAAO,GAAGA,CAAI,qBAAuB,EAAE,EAAE,OAAO,OAAO,EAAE,KAAK,IAAI,EACpM,MAAO,CAAE,GAAAiF,EAAI,KAAAC,EAAM,KAAAlF,EAAM,IAAK,CAACkF,GAAQ,CAAClF,EAAM,MAAA4C,CAAM,CACtD",
  "names": ["n", "t", "at", "x", "byTime", "a", "b", "notes", "nums", "DRAFTS", "SKIP", "versions", "v", "turns", "vs", "newest", "signoffs", "filter", "channel", "person", "open", "nameOf", "vid", "late", "onlyOpen", "keep", "it", "items", "s", "i", "lateShown", "cut", "before", "notesBefore", "args", "k", "ids", "l", "hint", "w", "STATUS_WORD", "num", "tags", "replies", "iso", "now", "d", "y", "first", "names", "text", "people", "out", "p", "full", "KLAUDE", "quiet", "emailQuiet", "last", "m", "mins", "auto", "team", "name", "title", "rewrite", "next", "you", "hi", "what", "clip", "found", "f", "c", "site", "pick", "stage", "GRACE_MS", "doneAt", "version", "lo", "wordSet", "list", "note", "did", "asked", "best", "score", "have", "KIND_WORD", "upFirst", "change", "block", "rev", "mine", "step", "tally", "thanks", "whose", "time", "res", "ok", "redo", "id"]
}
