@fullstackhouse/cerber 0.41.0 → 0.42.0-pr.78.3c3a21c

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 CHANGED
@@ -52,7 +52,7 @@ requests.*
52
52
 
53
53
  ## Quick start
54
54
 
55
- Requires Node 20+, an authenticated [`gh`](https://cli.github.com/), `git`, and
55
+ Requires Node 22+, an authenticated [`gh`](https://cli.github.com/), `git`, and
56
56
  a logged-in [`claude`](https://claude.com/claude-code) CLI. No API keys, no
57
57
  config, no database. The cockpit wants a browser from 2024 on (Chrome/Edge 123,
58
58
  Safari 17.5, Firefox 120).
package/dist/cli/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import { Command } from "commander";
3
- import { createRequire } from "node:module";
3
+ import { version } from "../core/version.js";
4
4
  import readline from "node:readline/promises";
5
5
  import { artifactId, artifactKey } from "../core/artifact.js";
6
6
  import { listCheckouts, removeCheckout } from "../core/checkout.js";
@@ -17,19 +17,6 @@ import { isReviewRunning } from "../runner/inflight.js";
17
17
  import { startDaemon } from "../server/daemon.js";
18
18
  import { cockpitUrl, startServer } from "../server/index.js";
19
19
  const program = new Command();
20
- /**
21
- * The published version, read from the manifest rather than typed here — a
22
- * hand-maintained copy drifted to 0.5.0 while 0.30.0 shipped, and `--version`
23
- * is the first thing anyone runs to decide whether a project is alive.
24
- *
25
- * In the published package that manifest is the one the release bumped, so this
26
- * is the real version wherever anyone installed cerber. In a clone it reads
27
- * `0.0.0-development`, because nothing commits the bump back to `main` and a
28
- * number left behind there would quietly describe the release before last. A
29
- * sentinel cannot drift: it says "built from source", which is true, instead of
30
- * naming a version this build is not.
31
- */
32
- const { version } = createRequire(import.meta.url)("../../package.json");
33
20
  /**
34
21
  * Stop before the work starts when a tool cerber shells out to is missing or
35
22
  * logged out, rather than letting it surface as an empty queue or a retrying
@@ -0,0 +1,15 @@
1
+ import { createRequire } from "node:module";
2
+ /**
3
+ * The published version, read from the manifest rather than typed here — a
4
+ * hand-maintained copy drifted to 0.5.0 while 0.30.0 shipped, and `--version`
5
+ * is the first thing anyone runs to decide whether a project is alive. The
6
+ * cockpit's settings screen shows the same string, read off the running server.
7
+ *
8
+ * In the published package that manifest is the one the release bumped, so this
9
+ * is the real version wherever anyone installed cerber. In a clone it reads
10
+ * `0.0.0-development`, because nothing commits the bump back to `main` and a
11
+ * number left behind there would quietly describe the release before last. A
12
+ * sentinel cannot drift: it says "built from source", which is true, instead of
13
+ * naming a version this build is not.
14
+ */
15
+ export const { version } = createRequire(import.meta.url)("../../package.json");
@@ -12,6 +12,7 @@ import { toMarkdown } from "../core/export.js";
12
12
  import { currentLogin, fetchAssignableUsers, fetchPrDiff, fetchPrInfo, handOffReview, parsePrRef, postIssueComment, postReplies, submitReview, } from "../core/gh.js";
13
13
  import { z } from "zod";
14
14
  import { DaemonConfigSchema, configPath, loadConfig, saveConfig } from "../core/config.js";
15
+ import { version } from "../core/version.js";
15
16
  import { refreshArtifact, userOwnsStatus } from "../core/refresh.js";
16
17
  import { withWriter } from "../core/history.js";
17
18
  import { TrustRuleError, describeRule, explainRule, parseTrustRule } from "../core/trust.js";
@@ -121,10 +122,18 @@ export async function buildApp(opts) {
121
122
  return [];
122
123
  }
123
124
  });
125
+ // Full ConfigView — the cockpit replaces its config state with this
126
+ // wholesale, so every config route answers with all of it.
127
+ const configView = (trust, daemon) => ({
128
+ version,
129
+ path: configPath(),
130
+ trust: trustView(trust),
131
+ daemon,
132
+ });
124
133
  app.get("/api/config", async (c) => {
125
134
  try {
126
135
  const config = await loadConfig();
127
- return c.json({ path: configPath(), trust: trustView(config.trust), daemon: config.daemon });
136
+ return c.json(configView(config.trust, config.daemon));
128
137
  }
129
138
  catch (err) {
130
139
  return c.json({ error: err instanceof Error ? err.message : String(err) }, 500);
@@ -146,7 +155,7 @@ export async function buildApp(opts) {
146
155
  const daemon = DaemonConfigSchema.parse({ ...config.daemon, ...body });
147
156
  await saveConfig({ ...config, daemon });
148
157
  opts.daemon?.reconfigure({ ...config, daemon });
149
- return c.json({ path: configPath(), trust: trustView(config.trust), daemon });
158
+ return c.json(configView(config.trust, daemon));
150
159
  }
151
160
  catch (err) {
152
161
  if (err instanceof z.ZodError) {
@@ -189,9 +198,7 @@ export async function buildApp(opts) {
189
198
  const trust = remove === true ? without : [...without, canonical];
190
199
  await saveConfig({ ...config, trust });
191
200
  opts.daemon?.reconfigure({ ...config, trust });
192
- // Full ConfigView — the cockpit replaces its config state with this
193
- // wholesale, so omitting daemon would crash the Settings toggles.
194
- return c.json({ path: configPath(), trust: trustView(trust), daemon: config.daemon });
201
+ return c.json(configView(trust, config.daemon));
195
202
  }
196
203
  catch (err) {
197
204
  return c.json({ error: err instanceof Error ? err.message : String(err) }, 500);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fullstackhouse/cerber",
3
- "version": "0.41.0",
3
+ "version": "0.42.0-pr.78.3c3a21c",
4
4
  "description": "AI code-review cockpit: Claude reviews your PRs into local artifacts; nothing reaches GitHub until you say so.",
5
5
  "license": "MIT",
6
6
  "keywords": [
@@ -23,7 +23,7 @@
23
23
  "cerber": "dist/cli/index.js"
24
24
  },
25
25
  "engines": {
26
- "node": ">=20"
26
+ "node": ">=22"
27
27
  },
28
28
  "files": [
29
29
  "dist",
@@ -1 +1 @@
1
- :host,:root{--d2h-bg-color:#fff;--d2h-border-color:#ddd;--d2h-dim-color:rgba(0,0,0,.3);--d2h-line-border-color:#eee;--d2h-file-header-bg-color:#f7f7f7;--d2h-file-header-border-color:#d8d8d8;--d2h-empty-placeholder-bg-color:#f1f1f1;--d2h-empty-placeholder-border-color:#e1e1e1;--d2h-selected-color:#c8e1ff;--d2h-ins-bg-color:#dfd;--d2h-ins-border-color:#b4e2b4;--d2h-ins-highlight-bg-color:#97f295;--d2h-ins-label-color:#399839;--d2h-del-bg-color:#fee8e9;--d2h-del-border-color:#e9aeae;--d2h-del-highlight-bg-color:#ffb6ba;--d2h-del-label-color:#c33;--d2h-change-del-color:#fdf2d0;--d2h-change-ins-color:#ded;--d2h-info-bg-color:#f8fafd;--d2h-info-border-color:#d5e4f2;--d2h-change-label-color:#d0b44c;--d2h-moved-label-color:#3572b0;--d2h-dark-color:#e6edf3;--d2h-dark-bg-color:#0d1117;--d2h-dark-border-color:#30363d;--d2h-dark-dim-color:#6e7681;--d2h-dark-line-border-color:#21262d;--d2h-dark-file-header-bg-color:#161b22;--d2h-dark-file-header-border-color:#30363d;--d2h-dark-empty-placeholder-bg-color:hsla(215,8%,47%,.1);--d2h-dark-empty-placeholder-border-color:#30363d;--d2h-dark-selected-color:rgba(56,139,253,.1);--d2h-dark-ins-bg-color:rgba(46,160,67,.15);--d2h-dark-ins-border-color:rgba(46,160,67,.4);--d2h-dark-ins-highlight-bg-color:rgba(46,160,67,.4);--d2h-dark-ins-label-color:#3fb950;--d2h-dark-del-bg-color:rgba(248,81,73,.1);--d2h-dark-del-border-color:rgba(248,81,73,.4);--d2h-dark-del-highlight-bg-color:rgba(248,81,73,.4);--d2h-dark-del-label-color:#f85149;--d2h-dark-change-del-color:rgba(210,153,34,.2);--d2h-dark-change-ins-color:rgba(46,160,67,.25);--d2h-dark-info-bg-color:rgba(56,139,253,.1);--d2h-dark-info-border-color:rgba(56,139,253,.4);--d2h-dark-change-label-color:#d29922;--d2h-dark-moved-label-color:#3572b0}.d2h-wrapper{text-align:left}.d2h-file-header{background-color:#f7f7f7;background-color:var(--d2h-file-header-bg-color);border-bottom:1px solid #d8d8d8;border-bottom:1px solid var(--d2h-file-header-border-color);display:-webkit-box;display:-ms-flexbox;display:flex;font-family:Source Sans Pro,Helvetica Neue,Helvetica,Arial,sans-serif;height:35px;padding:5px 10px}.d2h-file-header.d2h-sticky-header{position:sticky;top:0;z-index:1}.d2h-file-stats{display:-webkit-box;display:-ms-flexbox;display:flex;font-size:14px;margin-left:auto}.d2h-lines-added{border:1px solid #b4e2b4;border:1px solid var(--d2h-ins-border-color);border-radius:5px 0 0 5px;color:#399839;color:var(--d2h-ins-label-color);padding:2px;text-align:right;vertical-align:middle}.d2h-lines-deleted{border:1px solid #e9aeae;border:1px solid var(--d2h-del-border-color);border-radius:0 5px 5px 0;color:#c33;color:var(--d2h-del-label-color);margin-left:1px;padding:2px;text-align:left;vertical-align:middle}.d2h-file-name-wrapper{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;font-size:15px;width:100%}.d2h-file-name{overflow-x:hidden;text-overflow:ellipsis;white-space:nowrap}.d2h-file-wrapper{border:1px solid #ddd;border:1px solid var(--d2h-border-color);border-radius:3px;margin-bottom:1em}.d2h-file-collapse{-webkit-box-pack:end;-ms-flex-pack:end;cursor:pointer;display:none;font-size:12px;justify-content:flex-end;-webkit-box-align:center;-ms-flex-align:center;align-items:center;border:1px solid #ddd;border:1px solid var(--d2h-border-color);border-radius:3px;padding:4px 8px}.d2h-file-collapse.d2h-selected{background-color:#c8e1ff;background-color:var(--d2h-selected-color)}.d2h-file-collapse-input{margin:0 4px 0 0}.d2h-diff-table{border-collapse:collapse;font-family:Menlo,Consolas,monospace;font-size:13px;width:100%}.d2h-files-diff{display:-webkit-box;display:-ms-flexbox;display:flex;width:100%}.d2h-file-diff{overflow-y:hidden}.d2h-file-diff.d2h-d-none,.d2h-files-diff.d2h-d-none{display:none}.d2h-file-side-diff{display:inline-block;overflow-x:scroll;overflow-y:hidden;width:50%}.d2h-code-line{padding:0 8em;width:calc(100% - 16em)}.d2h-code-line,.d2h-code-side-line{display:inline-block;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;white-space:nowrap}.d2h-code-side-line{padding:0 4.5em;width:calc(100% - 9em)}.d2h-code-line-ctn{background:none;display:inline-block;padding:0;word-wrap:normal;-webkit-user-select:text;-moz-user-select:text;-ms-user-select:text;user-select:text;vertical-align:middle;white-space:pre;width:100%}.d2h-code-line del,.d2h-code-side-line del{background-color:#ffb6ba;background-color:var(--d2h-del-highlight-bg-color)}.d2h-code-line del,.d2h-code-line ins,.d2h-code-side-line del,.d2h-code-side-line ins{border-radius:.2em;display:inline-block;margin-top:-1px;-webkit-text-decoration:none;text-decoration:none}.d2h-code-line ins,.d2h-code-side-line ins{background-color:#97f295;background-color:var(--d2h-ins-highlight-bg-color);text-align:left}.d2h-code-line-prefix{background:none;display:inline;padding:0;word-wrap:normal;white-space:pre}.line-num1{float:left}.line-num1,.line-num2{-webkit-box-sizing:border-box;box-sizing:border-box;overflow:hidden;padding:0 .5em;text-overflow:ellipsis;width:3.5em}.line-num2{float:right}.d2h-code-linenumber{background-color:#fff;background-color:var(--d2h-bg-color);border:solid #eee;border:solid var(--d2h-line-border-color);border-width:0 1px;-webkit-box-sizing:border-box;box-sizing:border-box;color:#0000004d;color:var(--d2h-dim-color);cursor:pointer;display:inline-block;position:absolute;text-align:right;width:7.5em}.d2h-code-linenumber:after{content:"​"}.d2h-code-side-linenumber{background-color:#fff;background-color:var(--d2h-bg-color);border:solid #eee;border:solid var(--d2h-line-border-color);border-width:0 1px;-webkit-box-sizing:border-box;box-sizing:border-box;color:#0000004d;color:var(--d2h-dim-color);cursor:pointer;display:inline-block;overflow:hidden;padding:0 .5em;position:absolute;text-align:right;text-overflow:ellipsis;width:4em}.d2h-code-side-linenumber:after{content:"​"}.d2h-code-side-emptyplaceholder,.d2h-emptyplaceholder{background-color:#f1f1f1;background-color:var(--d2h-empty-placeholder-bg-color);border-color:#e1e1e1;border-color:var(--d2h-empty-placeholder-border-color)}.d2h-code-line-prefix,.d2h-code-linenumber,.d2h-code-side-linenumber,.d2h-emptyplaceholder{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.d2h-code-linenumber,.d2h-code-side-linenumber{direction:rtl}.d2h-del{background-color:#fee8e9;background-color:var(--d2h-del-bg-color);border-color:#e9aeae;border-color:var(--d2h-del-border-color)}.d2h-ins{background-color:#dfd;background-color:var(--d2h-ins-bg-color);border-color:#b4e2b4;border-color:var(--d2h-ins-border-color)}.d2h-info{background-color:#f8fafd;background-color:var(--d2h-info-bg-color);border-color:#d5e4f2;border-color:var(--d2h-info-border-color);color:#0000004d;color:var(--d2h-dim-color)}.d2h-file-diff .d2h-del.d2h-change{background-color:#fdf2d0;background-color:var(--d2h-change-del-color)}.d2h-file-diff .d2h-ins.d2h-change{background-color:#ded;background-color:var(--d2h-change-ins-color)}.d2h-file-list-wrapper{margin-bottom:10px}.d2h-file-list-wrapper a{-webkit-text-decoration:none;text-decoration:none}.d2h-file-list-wrapper a,.d2h-file-list-wrapper a:visited{color:#3572b0;color:var(--d2h-moved-label-color)}.d2h-file-list-header{text-align:left}.d2h-file-list-title{font-weight:700}.d2h-file-list-line{display:-webkit-box;display:-ms-flexbox;display:flex;text-align:left}.d2h-file-list{display:block;list-style:none;margin:0;padding:0}.d2h-file-list>li{border-bottom:1px solid #ddd;border-bottom:1px solid var(--d2h-border-color);margin:0;padding:5px 10px}.d2h-file-list>li:last-child{border-bottom:none}.d2h-file-switch{cursor:pointer;display:none;font-size:10px}.d2h-icon{fill:currentColor;margin-right:10px;vertical-align:middle}.d2h-deleted{color:#c33;color:var(--d2h-del-label-color)}.d2h-added{color:#399839;color:var(--d2h-ins-label-color)}.d2h-changed{color:#d0b44c;color:var(--d2h-change-label-color)}.d2h-moved{color:#3572b0;color:var(--d2h-moved-label-color)}.d2h-tag{background-color:#fff;background-color:var(--d2h-bg-color);display:-webkit-box;display:-ms-flexbox;display:flex;font-size:10px;margin-left:5px;padding:0 2px}.d2h-deleted-tag{border:1px solid #c33;border:1px solid var(--d2h-del-label-color)}.d2h-added-tag{border:1px solid #399839;border:1px solid var(--d2h-ins-label-color)}.d2h-changed-tag{border:1px solid #d0b44c;border:1px solid var(--d2h-change-label-color)}.d2h-moved-tag{border:1px solid #3572b0;border:1px solid var(--d2h-moved-label-color)}.d2h-dark-color-scheme{background-color:#0d1117;background-color:var(--d2h-dark-bg-color);color:#e6edf3;color:var(--d2h-dark-color)}.d2h-dark-color-scheme .d2h-file-header{background-color:#161b22;background-color:var(--d2h-dark-file-header-bg-color);border-bottom:#30363d;border-bottom:var(--d2h-dark-file-header-border-color)}.d2h-dark-color-scheme .d2h-lines-added{border:1px solid rgba(46,160,67,.4);border:1px solid var(--d2h-dark-ins-border-color);color:#3fb950;color:var(--d2h-dark-ins-label-color)}.d2h-dark-color-scheme .d2h-lines-deleted{border:1px solid rgba(248,81,73,.4);border:1px solid var(--d2h-dark-del-border-color);color:#f85149;color:var(--d2h-dark-del-label-color)}.d2h-dark-color-scheme .d2h-code-line del,.d2h-dark-color-scheme .d2h-code-side-line del{background-color:#f8514966;background-color:var(--d2h-dark-del-highlight-bg-color)}.d2h-dark-color-scheme .d2h-code-line ins,.d2h-dark-color-scheme .d2h-code-side-line ins{background-color:#2ea04366;background-color:var(--d2h-dark-ins-highlight-bg-color)}.d2h-dark-color-scheme .d2h-diff-tbody{border-color:#30363d;border-color:var(--d2h-dark-border-color)}.d2h-dark-color-scheme .d2h-code-side-linenumber{background-color:#0d1117;background-color:var(--d2h-dark-bg-color);border-color:#21262d;border-color:var(--d2h-dark-line-border-color);color:#6e7681;color:var(--d2h-dark-dim-color)}.d2h-dark-color-scheme .d2h-files-diff .d2h-code-side-emptyplaceholder,.d2h-dark-color-scheme .d2h-files-diff .d2h-emptyplaceholder{background-color:#6e76811a;background-color:var(--d2h-dark-empty-placeholder-bg-color);border-color:#30363d;border-color:var(--d2h-dark-empty-placeholder-border-color)}.d2h-dark-color-scheme .d2h-code-linenumber{background-color:#0d1117;background-color:var(--d2h-dark-bg-color);border-color:#21262d;border-color:var(--d2h-dark-line-border-color);color:#6e7681;color:var(--d2h-dark-dim-color)}.d2h-dark-color-scheme .d2h-del{background-color:#f851491a;background-color:var(--d2h-dark-del-bg-color);border-color:#f8514966;border-color:var(--d2h-dark-del-border-color)}.d2h-dark-color-scheme .d2h-ins{background-color:#2ea04326;background-color:var(--d2h-dark-ins-bg-color);border-color:#2ea04366;border-color:var(--d2h-dark-ins-border-color)}.d2h-dark-color-scheme .d2h-info{background-color:#388bfd1a;background-color:var(--d2h-dark-info-bg-color);border-color:#388bfd66;border-color:var(--d2h-dark-info-border-color);color:#6e7681;color:var(--d2h-dark-dim-color)}.d2h-dark-color-scheme .d2h-file-diff .d2h-del.d2h-change{background-color:#d2992233;background-color:var(--d2h-dark-change-del-color)}.d2h-dark-color-scheme .d2h-file-diff .d2h-ins.d2h-change{background-color:#2ea04340;background-color:var(--d2h-dark-change-ins-color)}.d2h-dark-color-scheme .d2h-file-wrapper{border:1px solid #30363d;border:1px solid var(--d2h-dark-border-color)}.d2h-dark-color-scheme .d2h-file-collapse{border:1px solid #0d1117;border:1px solid var(--d2h-dark-bg-color)}.d2h-dark-color-scheme .d2h-file-collapse.d2h-selected{background-color:#388bfd1a;background-color:var(--d2h-dark-selected-color)}.d2h-dark-color-scheme .d2h-file-list-wrapper a,.d2h-dark-color-scheme .d2h-file-list-wrapper a:visited{color:#3572b0;color:var(--d2h-dark-moved-label-color)}.d2h-dark-color-scheme .d2h-file-list>li{border-bottom:1px solid #0d1117;border-bottom:1px solid var(--d2h-dark-bg-color)}.d2h-dark-color-scheme .d2h-deleted{color:#f85149;color:var(--d2h-dark-del-label-color)}.d2h-dark-color-scheme .d2h-added{color:#3fb950;color:var(--d2h-dark-ins-label-color)}.d2h-dark-color-scheme .d2h-changed{color:#d29922;color:var(--d2h-dark-change-label-color)}.d2h-dark-color-scheme .d2h-moved{color:#3572b0;color:var(--d2h-dark-moved-label-color)}.d2h-dark-color-scheme .d2h-tag{background-color:#0d1117;background-color:var(--d2h-dark-bg-color)}.d2h-dark-color-scheme .d2h-deleted-tag{border:1px solid #f85149;border:1px solid var(--d2h-dark-del-label-color)}.d2h-dark-color-scheme .d2h-added-tag{border:1px solid #3fb950;border:1px solid var(--d2h-dark-ins-label-color)}.d2h-dark-color-scheme .d2h-changed-tag{border:1px solid #d29922;border:1px solid var(--d2h-dark-change-label-color)}.d2h-dark-color-scheme .d2h-moved-tag{border:1px solid #3572b0;border:1px solid var(--d2h-dark-moved-label-color)}@media(prefers-color-scheme:dark){.d2h-auto-color-scheme{background-color:#0d1117;background-color:var(--d2h-dark-bg-color);color:#e6edf3;color:var(--d2h-dark-color)}.d2h-auto-color-scheme .d2h-file-header{background-color:#161b22;background-color:var(--d2h-dark-file-header-bg-color);border-bottom:#30363d;border-bottom:var(--d2h-dark-file-header-border-color)}.d2h-auto-color-scheme .d2h-lines-added{border:1px solid rgba(46,160,67,.4);border:1px solid var(--d2h-dark-ins-border-color);color:#3fb950;color:var(--d2h-dark-ins-label-color)}.d2h-auto-color-scheme .d2h-lines-deleted{border:1px solid rgba(248,81,73,.4);border:1px solid var(--d2h-dark-del-border-color);color:#f85149;color:var(--d2h-dark-del-label-color)}.d2h-auto-color-scheme .d2h-code-line del,.d2h-auto-color-scheme .d2h-code-side-line del{background-color:#f8514966;background-color:var(--d2h-dark-del-highlight-bg-color)}.d2h-auto-color-scheme .d2h-code-line ins,.d2h-auto-color-scheme .d2h-code-side-line ins{background-color:#2ea04366;background-color:var(--d2h-dark-ins-highlight-bg-color)}.d2h-auto-color-scheme .d2h-diff-tbody{border-color:#30363d;border-color:var(--d2h-dark-border-color)}.d2h-auto-color-scheme .d2h-code-side-linenumber{background-color:#0d1117;background-color:var(--d2h-dark-bg-color);border-color:#21262d;border-color:var(--d2h-dark-line-border-color);color:#6e7681;color:var(--d2h-dark-dim-color)}.d2h-auto-color-scheme .d2h-files-diff .d2h-code-side-emptyplaceholder,.d2h-auto-color-scheme .d2h-files-diff .d2h-emptyplaceholder{background-color:#6e76811a;background-color:var(--d2h-dark-empty-placeholder-bg-color);border-color:#30363d;border-color:var(--d2h-dark-empty-placeholder-border-color)}.d2h-auto-color-scheme .d2h-code-linenumber{background-color:#0d1117;background-color:var(--d2h-dark-bg-color);border-color:#21262d;border-color:var(--d2h-dark-line-border-color);color:#6e7681;color:var(--d2h-dark-dim-color)}.d2h-auto-color-scheme .d2h-del{background-color:#f851491a;background-color:var(--d2h-dark-del-bg-color);border-color:#f8514966;border-color:var(--d2h-dark-del-border-color)}.d2h-auto-color-scheme .d2h-ins{background-color:#2ea04326;background-color:var(--d2h-dark-ins-bg-color);border-color:#2ea04366;border-color:var(--d2h-dark-ins-border-color)}.d2h-auto-color-scheme .d2h-info{background-color:#388bfd1a;background-color:var(--d2h-dark-info-bg-color);border-color:#388bfd66;border-color:var(--d2h-dark-info-border-color);color:#6e7681;color:var(--d2h-dark-dim-color)}.d2h-auto-color-scheme .d2h-file-diff .d2h-del.d2h-change{background-color:#d2992233;background-color:var(--d2h-dark-change-del-color)}.d2h-auto-color-scheme .d2h-file-diff .d2h-ins.d2h-change{background-color:#2ea04340;background-color:var(--d2h-dark-change-ins-color)}.d2h-auto-color-scheme .d2h-file-wrapper{border:1px solid #30363d;border:1px solid var(--d2h-dark-border-color)}.d2h-auto-color-scheme .d2h-file-collapse{border:1px solid #0d1117;border:1px solid var(--d2h-dark-bg-color)}.d2h-auto-color-scheme .d2h-file-collapse.d2h-selected{background-color:#388bfd1a;background-color:var(--d2h-dark-selected-color)}.d2h-auto-color-scheme .d2h-file-list-wrapper a,.d2h-auto-color-scheme .d2h-file-list-wrapper a:visited{color:#3572b0;color:var(--d2h-dark-moved-label-color)}.d2h-auto-color-scheme .d2h-file-list>li{border-bottom:1px solid #0d1117;border-bottom:1px solid var(--d2h-dark-bg-color)}.d2h-dark-color-scheme .d2h-deleted{color:#f85149;color:var(--d2h-dark-del-label-color)}.d2h-auto-color-scheme .d2h-added{color:#3fb950;color:var(--d2h-dark-ins-label-color)}.d2h-auto-color-scheme .d2h-changed{color:#d29922;color:var(--d2h-dark-change-label-color)}.d2h-auto-color-scheme .d2h-moved{color:#3572b0;color:var(--d2h-dark-moved-label-color)}.d2h-auto-color-scheme .d2h-tag{background-color:#0d1117;background-color:var(--d2h-dark-bg-color)}.d2h-auto-color-scheme .d2h-deleted-tag{border:1px solid #f85149;border:1px solid var(--d2h-dark-del-label-color)}.d2h-auto-color-scheme .d2h-added-tag{border:1px solid #3fb950;border:1px solid var(--d2h-dark-ins-label-color)}.d2h-auto-color-scheme .d2h-changed-tag{border:1px solid #d29922;border:1px solid var(--d2h-dark-change-label-color)}.d2h-auto-color-scheme .d2h-moved-tag{border:1px solid #3572b0;border:1px solid var(--d2h-dark-moved-label-color)}}:root{color-scheme:light dark;--bg: light-dark(#fcfcfd, #0f1115);--surface: light-dark(#ffffff, #161920);--sunken: light-dark(#f7f8fa, #13161b);--sunken-2: light-dark(#f0f1f3, #1e2229);--raised: light-dark(#fbfbfc, #1a1d24);--fg: light-dark(#14171a, #e6e8eb);--fg-2: light-dark(#3a3f45, #c9cdd3);--fg-3: light-dark(#4a5058, #b1b7bf);--muted: light-dark(#6b7178, #8f959e);--faint: light-dark(#9aa0a8, #737a84);--fainter: light-dark(#b6bbc1, #50565f);--line: light-dark(#e6e8eb, #262a31);--line-2: light-dark(#dcdfe4, #31363e);--line-3: light-dark(#eef0f2, #1d2026);--accent: light-dark(#3d4fd6, #8b96ee);--accent-dark: light-dark(#2c3aa8, #aeb6f5);--accent-wash: light-dark(#f4f5ff, #1a1e36);--accent-ink: light-dark(#26307a, #c3c9f8);--green: light-dark(#1a7f5a, #4cc38a);--amber: light-dark(#a06a00, #e0a53a);--amber-ink: light-dark(#57430a, #ecd29a);--red: light-dark(#c2314a, #f07087);--on-fill: #fff;--accent-fill: light-dark(#3d4fd6, #4b58d6);--green-fill: light-dark(#1a7f5a, #1b7453);--amber-fill: light-dark(#a06a00, #8f5f00);--red-fill: light-dark(#c2314a, #b52d45);--syn-keyword: light-dark(#d73a49, #ff7b72);--syn-entity: light-dark(#6f42c1, #d2a8ff);--syn-constant: light-dark(#005cc5, #79c0ff);--syn-string: light-dark(#032f62, #a5d6ff);--syn-variable: light-dark(#e36209, #ffa657);--syn-comment: light-dark(#6a737d, #8b949e);--syn-tag: light-dark(#22863a, #7ee787);--syn-heading: light-dark(#005cc5, #79c0ff);--syn-bullet: light-dark(#735c0f, #f2cc60);--syn-ins: light-dark(#22863a, #aff5b4);--syn-ins-bg: light-dark(#f0fff4, #033a16);--syn-del: light-dark(#b31d28, #ffdcd7);--syn-del-bg: light-dark(#ffeef0, #67060c);--d2h-bg-color: light-dark(#fff, #161920);--d2h-border-color: light-dark(#ddd, #31363e);--d2h-dim-color: light-dark(rgba(0, 0, 0, .3), #6e7681);--d2h-line-border-color: light-dark(#eee, #262a31);--d2h-file-header-bg-color: light-dark(#f7f7f7, #1a1d24);--d2h-file-header-border-color: light-dark(#d8d8d8, #31363e);--d2h-empty-placeholder-bg-color: light-dark(#f1f1f1, hsla(215, 8%, 47%, .1));--d2h-empty-placeholder-border-color: light-dark(#e1e1e1, #31363e);--d2h-selected-color: light-dark(#c8e1ff, rgba(56, 139, 253, .1));--d2h-ins-bg-color: light-dark(#dfd, rgba(46, 160, 67, .15));--d2h-ins-border-color: light-dark(#b4e2b4, rgba(46, 160, 67, .4));--d2h-ins-highlight-bg-color: light-dark(#97f295, rgba(46, 160, 67, .4));--d2h-ins-label-color: light-dark(#399839, #3fb950);--d2h-del-bg-color: light-dark(#fee8e9, rgba(248, 81, 73, .1));--d2h-del-border-color: light-dark(#e9aeae, rgba(248, 81, 73, .4));--d2h-del-highlight-bg-color: light-dark(#ffb6ba, rgba(248, 81, 73, .4));--d2h-del-label-color: light-dark(#c33, #f85149);--d2h-change-del-color: light-dark(#fdf2d0, rgba(210, 153, 34, .2));--d2h-change-ins-color: light-dark(#ded, rgba(46, 160, 67, .25));--d2h-info-bg-color: light-dark(#f8fafd, rgba(56, 139, 253, .1));--d2h-info-border-color: light-dark(#d5e4f2, rgba(56, 139, 253, .4));--d2h-change-label-color: light-dark(#d0b44c, #d29922);--d2h-moved-label-color: light-dark(#3572b0, #58a6ff);--mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;--prose: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Helvetica, sans-serif;--measure: 1560px}:root[data-theme=light]{color-scheme:light}:root[data-theme=dark]{color-scheme:dark}*{box-sizing:border-box}body{margin:0;font-family:var(--mono);font-size:12px;color:var(--fg);background:var(--bg)}:root{accent-color:var(--accent)}::selection{background:color-mix(in srgb,var(--accent) 28%,transparent)}a{color:var(--accent)}a:hover{color:var(--accent-dark)}h1,h2,h3{font-size:13px;font-weight:700;margin:0}.app{padding-bottom:48px}.wrap{max-width:var(--measure);margin:0 auto;padding:0 40px}.bar-inner{max-width:var(--measure);margin:0 auto;padding:0 40px;display:flex;align-items:center;gap:14px}.grow{flex-grow:1}.pad{padding:24px 40px}.muted,.faint{color:var(--faint)}.warn{color:var(--amber)}.danger{color:var(--red)}.add{color:var(--green)}.del{color:var(--red)}.icon{flex-shrink:0}.lab{font-size:10px;letter-spacing:.14em;text-transform:uppercase;color:var(--faint)}.key{font-size:10px;border:1px solid var(--line-2);border-bottom-width:2px;border-radius:3px;padding:1px 5px;color:var(--muted);background:var(--surface)}.hint{display:inline-flex;gap:5px;align-items:center;font-size:10.5px;color:var(--faint);white-space:nowrap}.prose{font-family:var(--prose);font-size:13px;line-height:1.6;color:var(--fg-2);text-wrap:pretty;max-width:720px}.prose.lead{font-size:13.5px;line-height:1.62;color:var(--fg)}.error{color:var(--red);background:color-mix(in srgb,var(--red) 6%,transparent);border:1px solid color-mix(in srgb,var(--red) 30%,transparent);padding:8px 12px;border-radius:4px;margin:10px 0}.empty{text-align:center;color:var(--faint);margin:64px auto;flex-direction:column}.empty pre{display:inline-block;background:var(--line-3);padding:8px 16px;border-radius:4px}button{font:inherit;cursor:pointer}.btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;font-size:11px;color:var(--fg-3);border:1px solid var(--line-2);border-radius:4px;padding:6px 10px;background:var(--surface);white-space:nowrap;text-decoration:none}.btn:hover:not(:disabled){color:var(--fg);border-color:var(--fainter)}.btn:disabled{opacity:.5;cursor:default}.btn-sm{font-size:10.5px;padding:3px 8px;gap:5px}.btn-accent{color:var(--accent);border-color:color-mix(in srgb,var(--accent) 35%,transparent)}.btn-keep-on{color:var(--on-fill);background:var(--green-fill);border-color:var(--green-fill)}.btn-keep-on:hover:not(:disabled){color:var(--on-fill);background:color-mix(in srgb,var(--green-fill) 88%,var(--fg));border-color:color-mix(in srgb,var(--green-fill) 88%,var(--fg))}.btn-drop-on{color:var(--red);border-color:color-mix(in srgb,var(--red) 40%,transparent)}.btn-dark{color:var(--bg);background:var(--fg);border-color:var(--fg);font-size:11.5px;padding:7px 14px}.btn-dark:hover:not(:disabled){color:var(--bg);background:color-mix(in srgb,var(--fg) 82%,var(--bg));border-color:color-mix(in srgb,var(--fg) 82%,var(--bg))}.btn-dark:disabled{color:var(--faint);background:var(--sunken-2);border-color:var(--line-2)}.btn-dashed{display:inline-flex;align-items:center;gap:5px;font-size:10.5px;color:var(--muted);border:1px dashed var(--line-2);border-radius:4px;padding:5px 10px;background:transparent;margin-top:10px}.btn-primary{display:flex;align-items:center;justify-content:center;gap:8px;height:40px;padding:0 14px;font-size:12px;font-weight:500;color:var(--on-fill);background:var(--accent-fill);border:1px solid var(--accent-fill);border-radius:4px}.btn-primary .key{border-color:color-mix(in srgb,var(--on-fill) 30%,transparent);color:color-mix(in srgb,var(--on-fill) 75%,transparent);background:transparent}.link{display:inline-flex;align-items:center;gap:5px;font:inherit;font-size:11px;color:var(--accent);background:none;border:none;padding:0;text-decoration:none}.link:hover:not(:disabled){color:var(--accent-dark)}.link:disabled{color:var(--faint);cursor:default}.topbar{border-bottom:1px solid var(--line);background:var(--surface)}.topbar .bar-inner{padding-top:14px;padding-bottom:14px}.brand{display:inline-flex;align-items:center;gap:7px;font-size:15px;font-weight:700;letter-spacing:-.02em;color:var(--fg);text-decoration:none}.brand .logo{color:var(--accent);flex-shrink:0}.tagline{font-size:11px;color:var(--faint)}.topbar-link{font-size:11px;color:var(--muted);text-decoration:none;border-left:1px solid var(--line);padding-left:14px;display:inline-flex;align-items:center}.topbar-link:hover{color:var(--fg)}.bell{background:none;border:0;border-left:1px solid var(--line);padding:0 0 0 14px;font-family:inherit;cursor:pointer}.bell-on,.bell-ask{color:var(--accent)}.bell-blocked{color:var(--fainter);cursor:help}.bell-daemon{color:var(--accent);cursor:help}.daemon-bar{border-bottom:1px solid var(--line);background:var(--sunken);font-size:11px;color:var(--muted)}.daemon-bar .bar-inner{padding-top:8px;padding-bottom:8px;gap:18px;flex-wrap:wrap}.daemon-bar b{color:var(--fg);font-weight:400}.daemon-live{display:inline-flex;align-items:center;gap:6px;color:var(--fg)}.daemon-bar .warn{display:inline-flex;align-items:center;gap:6px}.dot{width:5px;height:5px;border-radius:999px;background:var(--green);display:inline-block}.dot-off{background:var(--fainter)}.tabs{display:flex;align-items:center;gap:2px;padding-top:14px}.tab{font-size:12px;padding:6px 12px;border:none;border-bottom:2px solid transparent;border-radius:4px 4px 0 0;background:none;color:var(--muted)}.tab:hover{color:var(--fg)}.tab-on{color:var(--fg);font-weight:500;border-bottom-color:var(--accent)}.tab-count{color:var(--fainter);margin-left:4px}.tab-on .tab-count{color:var(--accent)}.tab-split{width:1px;flex-shrink:0;align-self:stretch;margin:4px 10px 6px;background:var(--line-2)}.tab-filed{color:var(--faint)}.tab-filed:hover,.tab-filed.tab-on{color:var(--muted)}.tab-requests{color:var(--amber)}.tab-requests:hover,.tab-requests.tab-on{color:var(--amber);border-bottom-color:var(--amber)}.tab-requests .tab-count,.tab-requests.tab-on .tab-count{color:var(--amber)}.empty-tab{padding:22px 10px;font-size:12.5px;max-width:88ch}.empty-tab .btn{margin-top:10px}.table-head,.row{display:flex;gap:12px;align-items:center}.table-head{font-size:10px;letter-spacing:.12em;text-transform:uppercase;color:var(--faint);padding:12px 10px 7px;border-bottom:1px solid var(--line-2)}.row{font-size:12px;padding:8px 10px;cursor:pointer;border-bottom:1px solid var(--line-3);border-left:2px solid transparent}.row:hover{background:var(--sunken)}.row-on{background:var(--accent-wash);border-left-color:var(--accent)}.row-on .col-caret{color:var(--accent)}.row-on .col-title{font-weight:500}.tag-done{flex-shrink:0;color:var(--muted);background:var(--line-3)}.tag-awaiting{flex-shrink:0;color:var(--amber);background:color-mix(in srgb,var(--amber) 10%,transparent)}.pull{display:flex;align-items:center;gap:6px;position:relative;color:var(--muted)}.tabs .pull{margin-right:16px}.empty .pull{justify-content:center;margin-top:10px}.pull:hover,.pull:focus-within{color:var(--fg-3)}.pull-input{width:200px;max-width:100%;font:inherit;font-size:12px;padding:2px 0;color:var(--fg);background:transparent;border:none;border-bottom:1px solid transparent;transition:width .12s ease,border-color .12s ease}.pull-input:hover::placeholder{color:var(--fg)}.pull-input:focus{outline:none;width:320px;border-bottom-color:var(--accent)}.pull-input::placeholder{color:var(--muted);transition:color .12s ease}.btn-small{padding:2px 8px;font-size:10px}.pull-error{position:absolute;top:100%;right:0;z-index:5;margin-top:4px;max-width:360px;padding:5px 8px;font-size:11px;line-height:1.4;color:var(--red);background:var(--bg);border:1px solid var(--line-2);border-radius:4px;box-shadow:0 2px 8px color-mix(in srgb,var(--fg) 8%,transparent)}.tag-draft{flex-shrink:0;color:var(--muted);background:var(--line-3)}.col-caret{width:12px;flex-shrink:0;color:transparent}.col-slug{width:184px;flex-shrink:0;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.col-title{flex-grow:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.col-author{width:104px;flex-shrink:0;color:var(--faint);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.col-verdict{width:152px;flex-shrink:0;text-align:right;font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.col-comments{width:26px;flex-shrink:0;text-align:right;color:var(--muted)}.col-size{width:104px;flex-shrink:0;text-align:right;color:var(--muted)}.col-age{width:44px;flex-shrink:0;text-align:right;color:var(--faint)}.table-head .col-verdict,.table-head .col-slug,.table-head .col-author{color:var(--faint);font-weight:400}.cursor-strip{display:flex;gap:18px;align-items:flex-start;border:1px solid var(--line-2);border-top:none;border-radius:0 0 4px 4px;background:var(--surface);padding:14px 16px}.cursor-strip-body{flex-grow:1;min-width:0}.strip-prose{--strip-cap: 196px;--strip-fade: 46px;margin:6px 0 0;max-width:700px;max-height:var(--strip-cap);overflow:hidden}.strip-prose-clipped{-webkit-mask-image:linear-gradient(#000 calc(var(--strip-cap) - var(--strip-fade)),transparent var(--strip-cap));mask-image:linear-gradient(#000 calc(var(--strip-cap) - var(--strip-fade)),transparent var(--strip-cap))}.cursor-strip-body .md p{margin:5px 0}.cursor-strip-body .md ul,.cursor-strip-body .md ol{margin:5px 0;padding-left:17px}.cursor-strip-body .md li{margin:2px 0}.cursor-strip-body .md li::marker{color:var(--faint)}.cursor-strip-body .md strong{font-weight:600;color:var(--fg)}.cursor-strip-meta{font-size:10.5px;color:var(--faint);margin-top:8px}.cursor-strip-actions{display:flex;flex-direction:column;gap:6px;width:176px;flex-shrink:0}.cursor-strip-row{display:flex;gap:6px}.cursor-strip-row .btn{flex-grow:1;padding:7px 0}.review-top{position:sticky;top:0;z-index:20;background:var(--surface)}.crumb{border-bottom:1px solid var(--line);background:var(--surface);font-size:11.5px;color:var(--muted)}.crumb .bar-inner{padding-top:12px;padding-bottom:12px;gap:12px}.crumb a{text-decoration:none}.crumb-sep{color:var(--line-2)}.crumb-slug{color:var(--fg)}.crumb-next{font-size:11px;max-width:300px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.walk{display:inline-flex;gap:2px}.walk-btn{display:inline-flex;align-items:center;justify-content:center;padding:4px 6px;border:1px solid var(--line-2);border-radius:3px;background:var(--surface);color:var(--fg-3)}.walk-btn:disabled{color:var(--fainter);border-color:var(--line-3);cursor:default}.review-head{border-bottom:1px solid var(--line);background:var(--surface)}.review-head .wrap{padding-top:20px;padding-bottom:16px}.review-head-top,.review-head-meta{display:flex;align-items:center;gap:14px}.review-head-top{margin-bottom:8px}.review-title{font-size:19px;font-weight:700;letter-spacing:-.025em;color:var(--fg);text-decoration:none}.review-title:hover{color:var(--accent)}.review-head-meta{font-size:11px;color:var(--muted);gap:10px;flex-wrap:wrap}.verdict-pick{display:inline-flex;align-items:center;gap:5px;font-size:10.5px;padding:4px 9px;border-radius:4px;border:1px solid transparent;background:none;color:var(--faint);white-space:nowrap}.verdict-pick:hover{color:var(--fg-3)}.verdict-pick-on{background:var(--sunken-2);border-color:var(--line-2);font-weight:500}.review-body{display:grid;align-items:start;grid-template-columns:236px minmax(0,1fr);grid-template-areas:"rail main" "rail cockpit"}.rail{grid-area:rail}.main{grid-area:main}.cockpit{grid-area:cockpit;min-width:0;padding-bottom:18px}.rail{padding:22px 20px 22px 0;position:sticky;top:var(--top-h, 0px);z-index:5;max-height:calc(100vh - var(--top-h, 0px));overflow-y:auto}@media(min-width:1600px){.review{--measure: 2100px}.review-body{grid-template-columns:236px minmax(0,1fr) clamp(420px,34%,680px);grid-template-areas:"rail main cockpit"}.cockpit{position:sticky;top:var(--top-h, 0px);height:calc(100vh - var(--top-h, 0px));padding:22px 0 18px 22px;display:flex;flex-direction:column;justify-content:space-between;gap:10px}.cockpit .chat-panel{flex:0 1 auto;display:flex;flex-direction:column;min-height:120px;margin:0}.cockpit .chat-panel .card-body{display:flex;flex-direction:column;min-height:0}.cockpit .chat-log{flex:1 1 auto;min-height:0;overflow-y:auto}.cockpit .verdict-bar{margin-top:0}.cockpit-decide{flex:0 0 auto;max-height:65%;overflow-y:auto}}.chapter,.comment,.card-summary,.card-why,.chat-panel,.send-panel,.sent-strip,.verdict-bar{scroll-margin-top:calc(var(--top-h, 0px) + 12px)}.rail-lab{display:block;margin-top:22px}.rail-jumps{display:flex;flex-direction:column;align-items:flex-start;gap:7px}.rail .rail-jumps .lab{margin-bottom:0}.rail-lab-btn{display:block;width:100%;text-align:left;font:inherit;padding:0;background:none;border:none}.rail-lab-btn:hover{color:var(--fg)}.rail .lab{margin-bottom:10px}.rail-item{display:flex;align-items:center;gap:6px;width:100%;text-align:left;font:inherit;font-size:11.5px;line-height:1.5;padding:5px 0 5px 9px;margin-left:-11px;background:none;border:none;border-left:2px solid transparent;color:var(--muted)}.rail-item:hover{color:var(--fg)}.rail-item-on{border-left-color:var(--accent);color:var(--fg);font-weight:500}.rail-item-done{color:var(--fainter)}.rail-item-here{color:var(--accent)}.rail-group{margin-bottom:2px}.rail-count{font-size:10.5px;color:var(--fainter)}.rail-comment{display:flex;align-items:center;gap:6px;width:100%;font:inherit;font-size:11px;text-align:left;padding:3px 0 3px 20px;margin-left:-11px;background:none;border:none;border-left:2px solid transparent;color:var(--muted)}.rail-comment:hover{color:var(--fg)}.rail-comment-loc{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.rail-comment-dropped{opacity:.55}.rail-comment-dropped .rail-comment-loc{text-decoration:line-through}.rail-dot{font-size:8px}.comment-flash{animation:comment-flash 1.8s ease-out}@keyframes comment-flash{0%,60%{background:var(--accent-wash);box-shadow:inset 0 0 0 2px color-mix(in srgb,var(--accent) 45%,transparent)}}.rail-facts{font-size:11.5px;line-height:1.85;color:var(--muted)}.rail-facts b{color:var(--fg);font-weight:400}.main{min-width:0;padding:22px 0 0}.card{border:1px solid var(--line);border-radius:4px;background:var(--surface);margin-bottom:10px}.card-head{display:flex;align-items:baseline;gap:12px;flex-wrap:wrap;padding:11px 16px;border-bottom:1px solid var(--line-3)}.card-head .faint{font-size:11px}.card-body{padding:14px 16px}.card-body .lab{display:block;margin-bottom:7px}.card-body .prose{margin:0}.card-body .btn{margin-top:12px}.card-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.card-why{margin-bottom:8px}.chapter{border:1px solid var(--line);border-radius:4px;background:var(--surface);margin-bottom:10px;overflow:clip}.chapter-head{display:flex;align-items:center;gap:10px;padding:11px 16px;cursor:pointer;-webkit-user-select:none;user-select:none}.chapter-head-sticky{position:sticky;top:var(--top-h, 0px);z-index:4;flex-wrap:wrap;background:var(--surface)}.chapter-head-stuck{box-shadow:0 1px 0 var(--line)}.chapter-about-idle{visibility:hidden}.chapter-head-about{flex-basis:100%;max-height:40vh;overflow-y:auto;cursor:auto;-webkit-user-select:text;user-select:text}.chapter-sticky{--file-top: calc(var(--top-h, 0px) + var(--chapter-head-h, 0px))}.chapter-sticky .diff .d2h-file-header,.chapter-sticky .md-file-head{position:sticky;top:var(--file-top);z-index:3}.chapter-sticky .d2h-file-wrapper,.chapter-sticky .md-file{scroll-margin-top:var(--file-top)}.chapter-sticky .comment{scroll-margin-top:calc(var(--file-top) + 60px)}.chapter-body{padding:14px 16px 16px;border-top:1px solid var(--line-3)}.chapter-meta{font-size:11px;font-weight:400}.chapter-explanation{margin:0 0 14px}.comment{border:1px solid var(--line);border-radius:4px;background:var(--raised);padding:12px 14px;margin:8px 0}.comment-dropped{opacity:.5}.comment-dropped .comment-body{text-decoration:line-through}.comment-head{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-bottom:6px}.comment-loc{font-size:10.5px;color:var(--faint)}.comment-body{font-size:13px;line-height:1.58;color:var(--fg);max-width:640px}.comment-edit,.body-edit,.add-comment textarea,.chat-input{width:100%;font-family:var(--mono);font-size:12.5px;line-height:1.55;color:var(--fg);padding:10px 12px;border:1px solid var(--line-2);border-radius:4px;background:var(--surface);resize:vertical}.add-comment{border:1px dashed var(--line-2);border-radius:4px;padding:10px 12px;margin:10px 0;display:flex;flex-direction:column;gap:8px}.add-comment-row{display:flex;gap:8px;align-items:center}.add-comment select,.add-comment input{font:inherit;font-size:11.5px;padding:5px 7px;border:1px solid var(--line-2);border-radius:4px;background:var(--surface)}.file-comments:not(:empty){padding:8px 12px 0;border-bottom:1px solid var(--line);background:var(--raised)}.file-comments .comment{margin:0 0 8px}.md-file .file-comments:not(:empty){border-bottom:none;background:none}.inline-comment-row td{padding:0;background:var(--raised);border-top:1px solid var(--line);border-bottom:1px solid var(--line);white-space:normal}.inline-comment-row .comment{margin:0;border:none;border-radius:0;padding-left:44px;max-width:none}.line-composer-row td{padding:0;background:var(--accent-wash);border-top:1px solid var(--line);border-bottom:1px solid var(--line);white-space:normal}.line-composer{display:flex;flex-direction:column;gap:8px;padding:10px 12px 10px 44px;max-width:760px;font-family:var(--mono)}.line-composer-head{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.line-composer-actions{display:flex;align-items:center;gap:8px}.diff{margin-top:8px;font-size:11.5px}.diff .line-add{position:absolute;top:0;right:0;bottom:0;left:0;width:100%;padding:0;border:0;background:none;cursor:pointer;opacity:0}.diff tr:hover .line-add{opacity:1}.diff .line-add:before{content:"+";position:absolute;left:1px;top:50%;transform:translateY(-50%);width:13px;height:13px;border-radius:3px;background:var(--accent-fill);color:var(--on-fill);font-family:var(--mono);font-size:11px;font-weight:700;line-height:12px;text-align:center;direction:ltr}.diff .d2h-file-header,.diff .d2h-file-name{font-family:var(--mono);font-size:11px}.diff .d2h-code-line{white-space:normal;width:calc(100% - 9em);padding-right:1em}.diff .d2h-code-line-ctn{display:inline;width:auto;white-space:pre-wrap;overflow-wrap:anywhere}.diff .d2h-code-line ins,.diff .d2h-code-line del{display:inline}.diff .hljs{display:inline;padding:0;background:transparent;color:inherit}.hljs-doctag,.hljs-keyword,.hljs-meta .hljs-keyword,.hljs-template-tag,.hljs-template-variable,.hljs-type,.hljs-variable.language_{color:var(--syn-keyword)}.hljs-title,.hljs-title.class_,.hljs-title.class_.inherited__,.hljs-title.function_{color:var(--syn-entity)}.hljs-attr,.hljs-attribute,.hljs-literal,.hljs-meta,.hljs-number,.hljs-operator,.hljs-variable,.hljs-selector-attr,.hljs-selector-class,.hljs-selector-id{color:var(--syn-constant)}.hljs-regexp,.hljs-string,.hljs-meta .hljs-string{color:var(--syn-string)}.hljs-built_in,.hljs-symbol{color:var(--syn-variable)}.hljs-subst{color:var(--fg)}.hljs-comment,.hljs-code,.hljs-formula{color:var(--syn-comment)}.hljs-name,.hljs-quote,.hljs-selector-tag,.hljs-selector-pseudo{color:var(--syn-tag)}.hljs-section{color:var(--syn-heading);font-weight:700}.hljs-bullet{color:var(--syn-bullet)}.hljs-emphasis{font-style:italic}.hljs-strong{font-weight:700}.hljs-addition{color:var(--syn-ins);background-color:var(--syn-ins-bg)}.hljs-deletion{color:var(--syn-del);background-color:var(--syn-del-bg)}.freshness{background:color-mix(in srgb,var(--amber) 7%,transparent);border:1px solid color-mix(in srgb,var(--amber) 30%,transparent);color:var(--amber-ink);padding:10px 12px;border-radius:4px;margin-bottom:10px;line-height:1.55;font-size:11.5px}.freshness code{background:color-mix(in srgb,var(--fg) 6%,transparent);padding:1px 4px;border-radius:3px}.freshness-running{background:color-mix(in srgb,var(--accent) 6%,transparent);border-color:color-mix(in srgb,var(--accent) 30%,transparent);color:var(--accent-ink)}.freshness .btn{margin-left:8px}.chat-panel{margin:18px 0 10px}.chat-log{display:flex;flex-direction:column;gap:14px;margin-bottom:14px}.history{list-style:none;margin:0;padding:0}.history-row{display:flex;align-items:baseline;gap:10px;padding:3px 0;border-bottom:1px solid var(--line-3);font-size:11.5px}.history-row:last-child{border-bottom:0}.history-at{color:var(--muted);white-space:nowrap;flex-shrink:0;min-width:92px}.history-by{color:var(--faint);white-space:nowrap;flex-shrink:0;min-width:60px}.history-what{color:var(--fg-2)}.history-cause{color:var(--fainter);margin-left:auto;padding-left:12px;white-space:nowrap;flex-shrink:0}.chat-turn{border-left:2px solid var(--line-2);padding:2px 0 2px 12px}.chat-turn-user{border-left-color:var(--accent)}.chat-turn-pending{border-left-style:dashed}.chat-steer{margin-top:8px}.chat-turn-who{font-size:10.5px;color:var(--faint);margin-bottom:4px}.chat-turn-body{max-width:700px;color:var(--fg)}.chat-revision{font-size:10.5px;color:var(--green);margin-top:6px}.chat-refusal{font-size:10.5px;color:var(--amber);margin-top:6px}.chat-waiting{font-size:11.5px;color:var(--muted);margin-top:6px}.chat-progress{list-style:none;margin:0;padding:0}.chat-progress li{opacity:.55;padding:1px 0}.chat-progress li.now{opacity:1}.chat-progress li.now:after{content:"…"}.chat-failed{font-size:11.5px;color:var(--red);margin-top:6px}.chat-refs{display:flex;align-items:center;gap:6px;flex-wrap:wrap;margin-bottom:8px}.chat-ref{font-size:10.5px;font-family:var(--mono);padding:3px 9px;border:1px solid var(--line-2);border-radius:999px;color:var(--muted);background:transparent}.chat-refs-pending .chat-ref{cursor:pointer;color:var(--accent);border-color:color-mix(in srgb,var(--accent) 35%,transparent)}.chat-actions{display:flex;align-items:center;gap:12px;margin-top:10px}.send-panel{border:1px solid var(--line-2);border-radius:4px;background:var(--sunken);padding:16px 18px}.verdict-bar+.send-panel{border-radius:0 0 4px 4px}.send-top{display:flex;align-items:baseline;gap:12px;margin-bottom:14px}.send-top .faint{font-size:11px}.send-top .link{text-decoration:underline;text-underline-offset:2px}.send-action{display:flex;align-items:center;gap:16px;flex-wrap:wrap}.send-note{margin:0 0 10px;font-size:12px;color:var(--fg-2)}.send-btn{display:inline-flex;align-items:center;gap:10px;height:44px;padding:0 20px;font-size:13px;font-weight:500;color:var(--on-fill);border:none;border-radius:4px;box-shadow:0 1px 2px color-mix(in srgb,var(--fg) 12%,transparent)}.send-btn:disabled{opacity:.6;cursor:default}.send-btn .key{border-color:color-mix(in srgb,var(--on-fill) 30%,transparent);color:color-mix(in srgb,var(--on-fill) 80%,transparent);background:transparent}.verdict-bar{display:flex;align-items:center;gap:8px;flex-wrap:wrap;border:1px solid var(--line-2);border-bottom:none;border-radius:4px 4px 0 0;background:var(--surface);padding:10px 18px;margin-top:18px}.verdict-bar .lab{margin-right:4px}.verdict-bar .faint{font-size:10.5px}.send-footer{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-top:16px;padding-top:14px;border-top:1px solid var(--line-2);font-size:10.5px}.body-preview{margin-top:14px;padding:14px 16px;background:var(--surface);border:1px solid var(--line);border-radius:4px;font-family:var(--prose);font-size:12.5px;line-height:1.62;color:var(--fg-2);white-space:pre-wrap;max-width:760px;max-height:420px;overflow:auto}.body-edit-wrap{margin-top:14px;max-width:760px}.body-edit-wrap .body-md{margin-top:4px}.body-source{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-top:8px;max-width:760px;font-size:11px}.handoff-dialog{width:min(560px,calc(100vw - 32px));padding:0;border:1px solid var(--line-2);border-radius:6px;background:var(--surface);color:var(--fg);box-shadow:0 12px 32px color-mix(in srgb,var(--fg) 22%,transparent)}.handoff-dialog::backdrop{background:#0e111473}.handoff-body{padding:16px 18px 18px}.handoff-dialog .send-top{margin-bottom:12px}.handoff-who{display:flex;align-items:center;gap:6px;flex-wrap:wrap;margin-bottom:10px}.handoff-at{font-family:var(--mono);font-size:13px;color:var(--fg-3)}.handoff-login{width:15ch;font-family:var(--mono);font-size:13px;color:var(--fg);padding:6px 8px;border:1px solid var(--line-2);border-radius:4px;background:var(--sunken)}.handoff-combo{position:relative}.handoff-options{position:absolute;z-index:1;top:calc(100% + 4px);left:0;min-width:100%;max-height:232px;overflow-y:auto;margin:0;padding:4px;list-style:none;border:1px solid var(--line-2);border-radius:4px;background:var(--surface);box-shadow:0 6px 18px color-mix(in srgb,var(--fg) 16%,transparent)}.handoff-options li{display:flex;align-items:baseline;gap:10px;padding:5px 8px;border-radius:3px;white-space:nowrap;cursor:pointer}.handoff-options li.on{background:var(--sunken-2)}.handoff-option-login{font-family:var(--mono);font-size:12.5px}.handoff-options .faint{font-size:10.5px}.handoff-with-review{margin:12px 0 4px}.handoff-with-review label{display:flex;align-items:center;gap:8px;font-size:11.5px;cursor:pointer}.handoff-with-review p{margin:8px 0 0;font-size:11px;line-height:1.55}.handoff-with-review .body-preview{margin-top:8px;max-height:180px;font-size:11.5px}.handoff-who-note{margin:-4px 0 10px;font-size:11px}.handoff-says{margin:10px 0 14px;font-size:11.5px;line-height:1.55}.sent-strip{display:flex;align-items:baseline;gap:12px;flex-wrap:wrap;border:1px solid color-mix(in srgb,var(--green) 40%,transparent);background:color-mix(in srgb,var(--green) 7%,transparent);border-radius:4px;padding:14px 16px;font-size:11.5px}.sent-strip strong{color:var(--green);font-size:13px;white-space:nowrap}.sent-strip a{display:inline-flex;align-items:center;gap:5px;white-space:nowrap;text-decoration:none}.post-actions{display:flex;align-items:center;gap:12px;margin-top:12px;font-size:10.5px}.post-actions .link{font-size:10.5px;color:var(--muted)}.post-actions .link:hover{color:var(--fg)}.md-preview{display:flex;flex-direction:column;gap:3px;margin:6px 0 2px;padding:2px 0 2px 12px;border-left:2px solid var(--line-2)}.md-preview .md{color:var(--fg-3)}.md-file{border:1px solid var(--line-2);border-radius:4px;background:var(--surface);margin:8px 0;overflow:clip}.md-file-head{display:flex;align-items:center;gap:8px;padding:8px 12px;border-bottom:1px solid var(--line);background:var(--bg);font-size:11.5px}.md-file-name{color:var(--fg);font-weight:600}.md-block{position:relative;padding:0 16px 0 32px}.md-block .md{max-width:760px}.md-block-changed:before{content:"";position:absolute;left:16px;top:2px;bottom:2px;width:2px;border-radius:2px;background:var(--accent)}.md-block-add{position:absolute;left:4px;top:4px;display:flex;align-items:center;justify-content:center;width:18px;height:18px;padding:0;border:none;border-radius:3px;background:var(--accent-fill);color:var(--on-fill);cursor:pointer;opacity:0;transition:opacity 90ms}.md-block:hover .md-block-add,.md-block-add:focus-visible{opacity:1}.md-gap{margin:4px 0;padding:4px 16px;border-top:1px solid var(--line-3);border-bottom:1px solid var(--line-3);background:var(--bg);color:var(--faint);font-size:10.5px}.md-file .comment{margin:8px 16px}.md-file .line-composer{padding-left:32px;font-family:var(--mono)}.d2h-file-header .md-read-toggle{margin-left:auto}.file-viewed{display:inline-flex;align-items:center;gap:4px;margin-left:auto;font-size:11px;color:var(--muted);cursor:pointer;-webkit-user-select:none;user-select:none}.d2h-file-header .md-read-toggle+.file-viewed,.md-file-head .btn+.file-viewed{margin-left:8px}.file-viewed-on:not(.file-peek)>:not(.d2h-file-header){display:none}.file-viewed-on .d2h-file-header,.md-file-head-viewed{cursor:pointer}.file-viewed-on:not(.file-peek) .d2h-file-header,.md-file-head-folded{opacity:.7}.md:not(.md-doc)>:first-child{margin-top:0}.md:not(.md-doc)>:last-child{margin-bottom:0}.md p{margin:8px 0}.md code{font-family:var(--mono);font-size:.9em;background:var(--sunken-2);padding:1px 5px;border-radius:3px}.md pre{background:var(--sunken);border:1px solid var(--line);border-radius:4px;padding:10px 12px;overflow-x:auto}.md pre code{background:none;padding:0;font-size:11.5px}.md ul,.md ol{margin:8px 0;padding-left:24px}.md blockquote{margin:8px 0;padding-left:12px;border-left:2px solid var(--line-2);color:var(--muted)}.md h1,.md h2,.md h3,.md h4{font-size:1em;font-weight:650;letter-spacing:-.01em;margin:18px 0 2px;color:var(--fg)}.md-doc h1{font-size:1.5em;margin-top:4px}.md-doc h2{font-size:1.22em;margin-top:22px}.md-doc h3{font-size:1.06em}.md-doc h1,.md-doc h2{padding-bottom:4px;border-bottom:1px solid var(--line)}.md h1+p,.md h2+p,.md h3+p,.md h4+p,.md h1+ul,.md h2+ul,.md h3+ul,.md h4+ul{margin-top:4px}.settings{max-width:780px;margin:0 auto;padding:24px 40px 64px;font-family:var(--prose);font-size:13px;line-height:1.6;color:var(--fg-2)}.settings .back{display:inline-block;font-family:var(--mono);font-size:11.5px;text-decoration:none;margin-bottom:16px}.settings h1{font-family:var(--mono);font-size:15px;margin:32px 0 8px}.settings h2{font-family:var(--mono);font-size:13px;margin:28px 0 8px}.settings code{font-family:var(--mono);font-size:.92em;background:var(--sunken-2);padding:1px 5px;border-radius:3px}.inbox-toggle{display:block;margin:8px 0}.trust-add{display:flex;gap:8px;margin:20px 0 12px}.trust-add input{flex:1;font:inherit;padding:7px 10px;color:var(--fg);border:1px solid var(--line-2);border-radius:4px;background:var(--surface)}.trust-table{border-collapse:collapse;width:100%}.trust-table td{padding:6px 10px 6px 0;border-bottom:1px solid var(--line);vertical-align:baseline}.trust-actions{text-align:right}.trust-deny code{text-decoration:line-through}.tone-approve{color:var(--green)}.tone-comment{color:var(--amber)}.tone-changes{color:var(--red)}.tone-running,.tone-sent,.tone-none{color:var(--muted);font-weight:400}.tone-failed{color:var(--red)}.tone-awaiting{color:var(--accent)}.tone-bg-approve{background:var(--green-fill)}.tone-bg-comment{background:var(--amber-fill)}.tone-bg-changes{background:var(--red-fill)}.tone-border-approve{border-left:2px solid var(--green)}.tone-border-comment{border-left:2px solid var(--amber)}.tone-border-changes{border-left:2px solid var(--red)}.tone-border-none{border-left:2px solid var(--line-2)}.chip{font-size:11.5px;font-weight:500;padding:3px 9px;border-radius:3px;border:1px solid currentColor;background:color-mix(in srgb,var(--fg) 3%,transparent);white-space:nowrap}.chip-btn{display:inline-flex;align-items:center;gap:6px;font-family:inherit}.chip-btn:hover{background:color-mix(in srgb,var(--fg) 7%,transparent)}.tag{font-size:10px;letter-spacing:.06em;padding:1px 6px;border-radius:3px;color:var(--muted);background:var(--sunken-2);white-space:nowrap}.tag-yours{color:var(--accent);background:color-mix(in srgb,var(--accent) 9%,transparent)}.tag-kept{color:var(--green);background:color-mix(in srgb,var(--green) 10%,transparent)}.tag-drift{color:var(--amber);background:color-mix(in srgb,var(--amber) 10%,transparent)}.tag-added{color:var(--green);background:color-mix(in srgb,var(--green) 10%,transparent)}.sev-counts{display:flex;align-items:center;gap:7px;flex-wrap:wrap;font-size:12px;color:var(--muted);margin-bottom:6px}.verdict-hint{display:flex;align-items:center;gap:10px;flex-wrap:wrap;background:color-mix(in srgb,var(--amber) 7%,transparent);border:1px solid color-mix(in srgb,var(--amber) 30%,transparent);color:var(--amber-ink);padding:10px 12px;border-radius:4px}.raised{margin:2px 0 8px;padding:6px 10px;border-left:2px solid color-mix(in srgb,var(--amber) 55%,transparent);background:color-mix(in srgb,var(--amber) 5%,transparent);border-radius:0 3px 3px 0}.raised-head{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.raised-head a{font-size:10.5px}.tag-raised{display:inline-flex;align-items:center;gap:4px;color:var(--amber);background:color-mix(in srgb,var(--amber) 10%,transparent)}.raised-reason{margin:4px 0 0;font-size:12px;line-height:1.5;color:var(--muted);max-width:640px}.raised-fate{color:var(--fg)}
1
+ :host,:root{--d2h-bg-color:#fff;--d2h-border-color:#ddd;--d2h-dim-color:rgba(0,0,0,.3);--d2h-line-border-color:#eee;--d2h-file-header-bg-color:#f7f7f7;--d2h-file-header-border-color:#d8d8d8;--d2h-empty-placeholder-bg-color:#f1f1f1;--d2h-empty-placeholder-border-color:#e1e1e1;--d2h-selected-color:#c8e1ff;--d2h-ins-bg-color:#dfd;--d2h-ins-border-color:#b4e2b4;--d2h-ins-highlight-bg-color:#97f295;--d2h-ins-label-color:#399839;--d2h-del-bg-color:#fee8e9;--d2h-del-border-color:#e9aeae;--d2h-del-highlight-bg-color:#ffb6ba;--d2h-del-label-color:#c33;--d2h-change-del-color:#fdf2d0;--d2h-change-ins-color:#ded;--d2h-info-bg-color:#f8fafd;--d2h-info-border-color:#d5e4f2;--d2h-change-label-color:#d0b44c;--d2h-moved-label-color:#3572b0;--d2h-dark-color:#e6edf3;--d2h-dark-bg-color:#0d1117;--d2h-dark-border-color:#30363d;--d2h-dark-dim-color:#6e7681;--d2h-dark-line-border-color:#21262d;--d2h-dark-file-header-bg-color:#161b22;--d2h-dark-file-header-border-color:#30363d;--d2h-dark-empty-placeholder-bg-color:hsla(215,8%,47%,.1);--d2h-dark-empty-placeholder-border-color:#30363d;--d2h-dark-selected-color:rgba(56,139,253,.1);--d2h-dark-ins-bg-color:rgba(46,160,67,.15);--d2h-dark-ins-border-color:rgba(46,160,67,.4);--d2h-dark-ins-highlight-bg-color:rgba(46,160,67,.4);--d2h-dark-ins-label-color:#3fb950;--d2h-dark-del-bg-color:rgba(248,81,73,.1);--d2h-dark-del-border-color:rgba(248,81,73,.4);--d2h-dark-del-highlight-bg-color:rgba(248,81,73,.4);--d2h-dark-del-label-color:#f85149;--d2h-dark-change-del-color:rgba(210,153,34,.2);--d2h-dark-change-ins-color:rgba(46,160,67,.25);--d2h-dark-info-bg-color:rgba(56,139,253,.1);--d2h-dark-info-border-color:rgba(56,139,253,.4);--d2h-dark-change-label-color:#d29922;--d2h-dark-moved-label-color:#3572b0}.d2h-wrapper{text-align:left}.d2h-file-header{background-color:#f7f7f7;background-color:var(--d2h-file-header-bg-color);border-bottom:1px solid #d8d8d8;border-bottom:1px solid var(--d2h-file-header-border-color);display:-webkit-box;display:-ms-flexbox;display:flex;font-family:Source Sans Pro,Helvetica Neue,Helvetica,Arial,sans-serif;height:35px;padding:5px 10px}.d2h-file-header.d2h-sticky-header{position:sticky;top:0;z-index:1}.d2h-file-stats{display:-webkit-box;display:-ms-flexbox;display:flex;font-size:14px;margin-left:auto}.d2h-lines-added{border:1px solid #b4e2b4;border:1px solid var(--d2h-ins-border-color);border-radius:5px 0 0 5px;color:#399839;color:var(--d2h-ins-label-color);padding:2px;text-align:right;vertical-align:middle}.d2h-lines-deleted{border:1px solid #e9aeae;border:1px solid var(--d2h-del-border-color);border-radius:0 5px 5px 0;color:#c33;color:var(--d2h-del-label-color);margin-left:1px;padding:2px;text-align:left;vertical-align:middle}.d2h-file-name-wrapper{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;font-size:15px;width:100%}.d2h-file-name{overflow-x:hidden;text-overflow:ellipsis;white-space:nowrap}.d2h-file-wrapper{border:1px solid #ddd;border:1px solid var(--d2h-border-color);border-radius:3px;margin-bottom:1em}.d2h-file-collapse{-webkit-box-pack:end;-ms-flex-pack:end;cursor:pointer;display:none;font-size:12px;justify-content:flex-end;-webkit-box-align:center;-ms-flex-align:center;align-items:center;border:1px solid #ddd;border:1px solid var(--d2h-border-color);border-radius:3px;padding:4px 8px}.d2h-file-collapse.d2h-selected{background-color:#c8e1ff;background-color:var(--d2h-selected-color)}.d2h-file-collapse-input{margin:0 4px 0 0}.d2h-diff-table{border-collapse:collapse;font-family:Menlo,Consolas,monospace;font-size:13px;width:100%}.d2h-files-diff{display:-webkit-box;display:-ms-flexbox;display:flex;width:100%}.d2h-file-diff{overflow-y:hidden}.d2h-file-diff.d2h-d-none,.d2h-files-diff.d2h-d-none{display:none}.d2h-file-side-diff{display:inline-block;overflow-x:scroll;overflow-y:hidden;width:50%}.d2h-code-line{padding:0 8em;width:calc(100% - 16em)}.d2h-code-line,.d2h-code-side-line{display:inline-block;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;white-space:nowrap}.d2h-code-side-line{padding:0 4.5em;width:calc(100% - 9em)}.d2h-code-line-ctn{background:none;display:inline-block;padding:0;word-wrap:normal;-webkit-user-select:text;-moz-user-select:text;-ms-user-select:text;user-select:text;vertical-align:middle;white-space:pre;width:100%}.d2h-code-line del,.d2h-code-side-line del{background-color:#ffb6ba;background-color:var(--d2h-del-highlight-bg-color)}.d2h-code-line del,.d2h-code-line ins,.d2h-code-side-line del,.d2h-code-side-line ins{border-radius:.2em;display:inline-block;margin-top:-1px;-webkit-text-decoration:none;text-decoration:none}.d2h-code-line ins,.d2h-code-side-line ins{background-color:#97f295;background-color:var(--d2h-ins-highlight-bg-color);text-align:left}.d2h-code-line-prefix{background:none;display:inline;padding:0;word-wrap:normal;white-space:pre}.line-num1{float:left}.line-num1,.line-num2{-webkit-box-sizing:border-box;box-sizing:border-box;overflow:hidden;padding:0 .5em;text-overflow:ellipsis;width:3.5em}.line-num2{float:right}.d2h-code-linenumber{background-color:#fff;background-color:var(--d2h-bg-color);border:solid #eee;border:solid var(--d2h-line-border-color);border-width:0 1px;-webkit-box-sizing:border-box;box-sizing:border-box;color:#0000004d;color:var(--d2h-dim-color);cursor:pointer;display:inline-block;position:absolute;text-align:right;width:7.5em}.d2h-code-linenumber:after{content:"​"}.d2h-code-side-linenumber{background-color:#fff;background-color:var(--d2h-bg-color);border:solid #eee;border:solid var(--d2h-line-border-color);border-width:0 1px;-webkit-box-sizing:border-box;box-sizing:border-box;color:#0000004d;color:var(--d2h-dim-color);cursor:pointer;display:inline-block;overflow:hidden;padding:0 .5em;position:absolute;text-align:right;text-overflow:ellipsis;width:4em}.d2h-code-side-linenumber:after{content:"​"}.d2h-code-side-emptyplaceholder,.d2h-emptyplaceholder{background-color:#f1f1f1;background-color:var(--d2h-empty-placeholder-bg-color);border-color:#e1e1e1;border-color:var(--d2h-empty-placeholder-border-color)}.d2h-code-line-prefix,.d2h-code-linenumber,.d2h-code-side-linenumber,.d2h-emptyplaceholder{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.d2h-code-linenumber,.d2h-code-side-linenumber{direction:rtl}.d2h-del{background-color:#fee8e9;background-color:var(--d2h-del-bg-color);border-color:#e9aeae;border-color:var(--d2h-del-border-color)}.d2h-ins{background-color:#dfd;background-color:var(--d2h-ins-bg-color);border-color:#b4e2b4;border-color:var(--d2h-ins-border-color)}.d2h-info{background-color:#f8fafd;background-color:var(--d2h-info-bg-color);border-color:#d5e4f2;border-color:var(--d2h-info-border-color);color:#0000004d;color:var(--d2h-dim-color)}.d2h-file-diff .d2h-del.d2h-change{background-color:#fdf2d0;background-color:var(--d2h-change-del-color)}.d2h-file-diff .d2h-ins.d2h-change{background-color:#ded;background-color:var(--d2h-change-ins-color)}.d2h-file-list-wrapper{margin-bottom:10px}.d2h-file-list-wrapper a{-webkit-text-decoration:none;text-decoration:none}.d2h-file-list-wrapper a,.d2h-file-list-wrapper a:visited{color:#3572b0;color:var(--d2h-moved-label-color)}.d2h-file-list-header{text-align:left}.d2h-file-list-title{font-weight:700}.d2h-file-list-line{display:-webkit-box;display:-ms-flexbox;display:flex;text-align:left}.d2h-file-list{display:block;list-style:none;margin:0;padding:0}.d2h-file-list>li{border-bottom:1px solid #ddd;border-bottom:1px solid var(--d2h-border-color);margin:0;padding:5px 10px}.d2h-file-list>li:last-child{border-bottom:none}.d2h-file-switch{cursor:pointer;display:none;font-size:10px}.d2h-icon{fill:currentColor;margin-right:10px;vertical-align:middle}.d2h-deleted{color:#c33;color:var(--d2h-del-label-color)}.d2h-added{color:#399839;color:var(--d2h-ins-label-color)}.d2h-changed{color:#d0b44c;color:var(--d2h-change-label-color)}.d2h-moved{color:#3572b0;color:var(--d2h-moved-label-color)}.d2h-tag{background-color:#fff;background-color:var(--d2h-bg-color);display:-webkit-box;display:-ms-flexbox;display:flex;font-size:10px;margin-left:5px;padding:0 2px}.d2h-deleted-tag{border:1px solid #c33;border:1px solid var(--d2h-del-label-color)}.d2h-added-tag{border:1px solid #399839;border:1px solid var(--d2h-ins-label-color)}.d2h-changed-tag{border:1px solid #d0b44c;border:1px solid var(--d2h-change-label-color)}.d2h-moved-tag{border:1px solid #3572b0;border:1px solid var(--d2h-moved-label-color)}.d2h-dark-color-scheme{background-color:#0d1117;background-color:var(--d2h-dark-bg-color);color:#e6edf3;color:var(--d2h-dark-color)}.d2h-dark-color-scheme .d2h-file-header{background-color:#161b22;background-color:var(--d2h-dark-file-header-bg-color);border-bottom:#30363d;border-bottom:var(--d2h-dark-file-header-border-color)}.d2h-dark-color-scheme .d2h-lines-added{border:1px solid rgba(46,160,67,.4);border:1px solid var(--d2h-dark-ins-border-color);color:#3fb950;color:var(--d2h-dark-ins-label-color)}.d2h-dark-color-scheme .d2h-lines-deleted{border:1px solid rgba(248,81,73,.4);border:1px solid var(--d2h-dark-del-border-color);color:#f85149;color:var(--d2h-dark-del-label-color)}.d2h-dark-color-scheme .d2h-code-line del,.d2h-dark-color-scheme .d2h-code-side-line del{background-color:#f8514966;background-color:var(--d2h-dark-del-highlight-bg-color)}.d2h-dark-color-scheme .d2h-code-line ins,.d2h-dark-color-scheme .d2h-code-side-line ins{background-color:#2ea04366;background-color:var(--d2h-dark-ins-highlight-bg-color)}.d2h-dark-color-scheme .d2h-diff-tbody{border-color:#30363d;border-color:var(--d2h-dark-border-color)}.d2h-dark-color-scheme .d2h-code-side-linenumber{background-color:#0d1117;background-color:var(--d2h-dark-bg-color);border-color:#21262d;border-color:var(--d2h-dark-line-border-color);color:#6e7681;color:var(--d2h-dark-dim-color)}.d2h-dark-color-scheme .d2h-files-diff .d2h-code-side-emptyplaceholder,.d2h-dark-color-scheme .d2h-files-diff .d2h-emptyplaceholder{background-color:#6e76811a;background-color:var(--d2h-dark-empty-placeholder-bg-color);border-color:#30363d;border-color:var(--d2h-dark-empty-placeholder-border-color)}.d2h-dark-color-scheme .d2h-code-linenumber{background-color:#0d1117;background-color:var(--d2h-dark-bg-color);border-color:#21262d;border-color:var(--d2h-dark-line-border-color);color:#6e7681;color:var(--d2h-dark-dim-color)}.d2h-dark-color-scheme .d2h-del{background-color:#f851491a;background-color:var(--d2h-dark-del-bg-color);border-color:#f8514966;border-color:var(--d2h-dark-del-border-color)}.d2h-dark-color-scheme .d2h-ins{background-color:#2ea04326;background-color:var(--d2h-dark-ins-bg-color);border-color:#2ea04366;border-color:var(--d2h-dark-ins-border-color)}.d2h-dark-color-scheme .d2h-info{background-color:#388bfd1a;background-color:var(--d2h-dark-info-bg-color);border-color:#388bfd66;border-color:var(--d2h-dark-info-border-color);color:#6e7681;color:var(--d2h-dark-dim-color)}.d2h-dark-color-scheme .d2h-file-diff .d2h-del.d2h-change{background-color:#d2992233;background-color:var(--d2h-dark-change-del-color)}.d2h-dark-color-scheme .d2h-file-diff .d2h-ins.d2h-change{background-color:#2ea04340;background-color:var(--d2h-dark-change-ins-color)}.d2h-dark-color-scheme .d2h-file-wrapper{border:1px solid #30363d;border:1px solid var(--d2h-dark-border-color)}.d2h-dark-color-scheme .d2h-file-collapse{border:1px solid #0d1117;border:1px solid var(--d2h-dark-bg-color)}.d2h-dark-color-scheme .d2h-file-collapse.d2h-selected{background-color:#388bfd1a;background-color:var(--d2h-dark-selected-color)}.d2h-dark-color-scheme .d2h-file-list-wrapper a,.d2h-dark-color-scheme .d2h-file-list-wrapper a:visited{color:#3572b0;color:var(--d2h-dark-moved-label-color)}.d2h-dark-color-scheme .d2h-file-list>li{border-bottom:1px solid #0d1117;border-bottom:1px solid var(--d2h-dark-bg-color)}.d2h-dark-color-scheme .d2h-deleted{color:#f85149;color:var(--d2h-dark-del-label-color)}.d2h-dark-color-scheme .d2h-added{color:#3fb950;color:var(--d2h-dark-ins-label-color)}.d2h-dark-color-scheme .d2h-changed{color:#d29922;color:var(--d2h-dark-change-label-color)}.d2h-dark-color-scheme .d2h-moved{color:#3572b0;color:var(--d2h-dark-moved-label-color)}.d2h-dark-color-scheme .d2h-tag{background-color:#0d1117;background-color:var(--d2h-dark-bg-color)}.d2h-dark-color-scheme .d2h-deleted-tag{border:1px solid #f85149;border:1px solid var(--d2h-dark-del-label-color)}.d2h-dark-color-scheme .d2h-added-tag{border:1px solid #3fb950;border:1px solid var(--d2h-dark-ins-label-color)}.d2h-dark-color-scheme .d2h-changed-tag{border:1px solid #d29922;border:1px solid var(--d2h-dark-change-label-color)}.d2h-dark-color-scheme .d2h-moved-tag{border:1px solid #3572b0;border:1px solid var(--d2h-dark-moved-label-color)}@media(prefers-color-scheme:dark){.d2h-auto-color-scheme{background-color:#0d1117;background-color:var(--d2h-dark-bg-color);color:#e6edf3;color:var(--d2h-dark-color)}.d2h-auto-color-scheme .d2h-file-header{background-color:#161b22;background-color:var(--d2h-dark-file-header-bg-color);border-bottom:#30363d;border-bottom:var(--d2h-dark-file-header-border-color)}.d2h-auto-color-scheme .d2h-lines-added{border:1px solid rgba(46,160,67,.4);border:1px solid var(--d2h-dark-ins-border-color);color:#3fb950;color:var(--d2h-dark-ins-label-color)}.d2h-auto-color-scheme .d2h-lines-deleted{border:1px solid rgba(248,81,73,.4);border:1px solid var(--d2h-dark-del-border-color);color:#f85149;color:var(--d2h-dark-del-label-color)}.d2h-auto-color-scheme .d2h-code-line del,.d2h-auto-color-scheme .d2h-code-side-line del{background-color:#f8514966;background-color:var(--d2h-dark-del-highlight-bg-color)}.d2h-auto-color-scheme .d2h-code-line ins,.d2h-auto-color-scheme .d2h-code-side-line ins{background-color:#2ea04366;background-color:var(--d2h-dark-ins-highlight-bg-color)}.d2h-auto-color-scheme .d2h-diff-tbody{border-color:#30363d;border-color:var(--d2h-dark-border-color)}.d2h-auto-color-scheme .d2h-code-side-linenumber{background-color:#0d1117;background-color:var(--d2h-dark-bg-color);border-color:#21262d;border-color:var(--d2h-dark-line-border-color);color:#6e7681;color:var(--d2h-dark-dim-color)}.d2h-auto-color-scheme .d2h-files-diff .d2h-code-side-emptyplaceholder,.d2h-auto-color-scheme .d2h-files-diff .d2h-emptyplaceholder{background-color:#6e76811a;background-color:var(--d2h-dark-empty-placeholder-bg-color);border-color:#30363d;border-color:var(--d2h-dark-empty-placeholder-border-color)}.d2h-auto-color-scheme .d2h-code-linenumber{background-color:#0d1117;background-color:var(--d2h-dark-bg-color);border-color:#21262d;border-color:var(--d2h-dark-line-border-color);color:#6e7681;color:var(--d2h-dark-dim-color)}.d2h-auto-color-scheme .d2h-del{background-color:#f851491a;background-color:var(--d2h-dark-del-bg-color);border-color:#f8514966;border-color:var(--d2h-dark-del-border-color)}.d2h-auto-color-scheme .d2h-ins{background-color:#2ea04326;background-color:var(--d2h-dark-ins-bg-color);border-color:#2ea04366;border-color:var(--d2h-dark-ins-border-color)}.d2h-auto-color-scheme .d2h-info{background-color:#388bfd1a;background-color:var(--d2h-dark-info-bg-color);border-color:#388bfd66;border-color:var(--d2h-dark-info-border-color);color:#6e7681;color:var(--d2h-dark-dim-color)}.d2h-auto-color-scheme .d2h-file-diff .d2h-del.d2h-change{background-color:#d2992233;background-color:var(--d2h-dark-change-del-color)}.d2h-auto-color-scheme .d2h-file-diff .d2h-ins.d2h-change{background-color:#2ea04340;background-color:var(--d2h-dark-change-ins-color)}.d2h-auto-color-scheme .d2h-file-wrapper{border:1px solid #30363d;border:1px solid var(--d2h-dark-border-color)}.d2h-auto-color-scheme .d2h-file-collapse{border:1px solid #0d1117;border:1px solid var(--d2h-dark-bg-color)}.d2h-auto-color-scheme .d2h-file-collapse.d2h-selected{background-color:#388bfd1a;background-color:var(--d2h-dark-selected-color)}.d2h-auto-color-scheme .d2h-file-list-wrapper a,.d2h-auto-color-scheme .d2h-file-list-wrapper a:visited{color:#3572b0;color:var(--d2h-dark-moved-label-color)}.d2h-auto-color-scheme .d2h-file-list>li{border-bottom:1px solid #0d1117;border-bottom:1px solid var(--d2h-dark-bg-color)}.d2h-dark-color-scheme .d2h-deleted{color:#f85149;color:var(--d2h-dark-del-label-color)}.d2h-auto-color-scheme .d2h-added{color:#3fb950;color:var(--d2h-dark-ins-label-color)}.d2h-auto-color-scheme .d2h-changed{color:#d29922;color:var(--d2h-dark-change-label-color)}.d2h-auto-color-scheme .d2h-moved{color:#3572b0;color:var(--d2h-dark-moved-label-color)}.d2h-auto-color-scheme .d2h-tag{background-color:#0d1117;background-color:var(--d2h-dark-bg-color)}.d2h-auto-color-scheme .d2h-deleted-tag{border:1px solid #f85149;border:1px solid var(--d2h-dark-del-label-color)}.d2h-auto-color-scheme .d2h-added-tag{border:1px solid #3fb950;border:1px solid var(--d2h-dark-ins-label-color)}.d2h-auto-color-scheme .d2h-changed-tag{border:1px solid #d29922;border:1px solid var(--d2h-dark-change-label-color)}.d2h-auto-color-scheme .d2h-moved-tag{border:1px solid #3572b0;border:1px solid var(--d2h-dark-moved-label-color)}}:root{color-scheme:light dark;--bg: light-dark(#fcfcfd, #0f1115);--surface: light-dark(#ffffff, #161920);--sunken: light-dark(#f7f8fa, #13161b);--sunken-2: light-dark(#f0f1f3, #1e2229);--raised: light-dark(#fbfbfc, #1a1d24);--fg: light-dark(#14171a, #e6e8eb);--fg-2: light-dark(#3a3f45, #c9cdd3);--fg-3: light-dark(#4a5058, #b1b7bf);--muted: light-dark(#6b7178, #8f959e);--faint: light-dark(#9aa0a8, #737a84);--fainter: light-dark(#b6bbc1, #50565f);--line: light-dark(#e6e8eb, #262a31);--line-2: light-dark(#dcdfe4, #31363e);--line-3: light-dark(#eef0f2, #1d2026);--accent: light-dark(#3d4fd6, #8b96ee);--accent-dark: light-dark(#2c3aa8, #aeb6f5);--accent-wash: light-dark(#f4f5ff, #1a1e36);--accent-ink: light-dark(#26307a, #c3c9f8);--green: light-dark(#1a7f5a, #4cc38a);--amber: light-dark(#a06a00, #e0a53a);--amber-ink: light-dark(#57430a, #ecd29a);--red: light-dark(#c2314a, #f07087);--on-fill: #fff;--accent-fill: light-dark(#3d4fd6, #4b58d6);--green-fill: light-dark(#1a7f5a, #1b7453);--amber-fill: light-dark(#a06a00, #8f5f00);--red-fill: light-dark(#c2314a, #b52d45);--syn-keyword: light-dark(#d73a49, #ff7b72);--syn-entity: light-dark(#6f42c1, #d2a8ff);--syn-constant: light-dark(#005cc5, #79c0ff);--syn-string: light-dark(#032f62, #a5d6ff);--syn-variable: light-dark(#e36209, #ffa657);--syn-comment: light-dark(#6a737d, #8b949e);--syn-tag: light-dark(#22863a, #7ee787);--syn-heading: light-dark(#005cc5, #79c0ff);--syn-bullet: light-dark(#735c0f, #f2cc60);--syn-ins: light-dark(#22863a, #aff5b4);--syn-ins-bg: light-dark(#f0fff4, #033a16);--syn-del: light-dark(#b31d28, #ffdcd7);--syn-del-bg: light-dark(#ffeef0, #67060c);--d2h-bg-color: light-dark(#fff, #161920);--d2h-border-color: light-dark(#ddd, #31363e);--d2h-dim-color: light-dark(rgba(0, 0, 0, .3), #6e7681);--d2h-line-border-color: light-dark(#eee, #262a31);--d2h-file-header-bg-color: light-dark(#f7f7f7, #1a1d24);--d2h-file-header-border-color: light-dark(#d8d8d8, #31363e);--d2h-empty-placeholder-bg-color: light-dark(#f1f1f1, hsla(215, 8%, 47%, .1));--d2h-empty-placeholder-border-color: light-dark(#e1e1e1, #31363e);--d2h-selected-color: light-dark(#c8e1ff, rgba(56, 139, 253, .1));--d2h-ins-bg-color: light-dark(#dfd, rgba(46, 160, 67, .15));--d2h-ins-border-color: light-dark(#b4e2b4, rgba(46, 160, 67, .4));--d2h-ins-highlight-bg-color: light-dark(#97f295, rgba(46, 160, 67, .4));--d2h-ins-label-color: light-dark(#399839, #3fb950);--d2h-del-bg-color: light-dark(#fee8e9, rgba(248, 81, 73, .1));--d2h-del-border-color: light-dark(#e9aeae, rgba(248, 81, 73, .4));--d2h-del-highlight-bg-color: light-dark(#ffb6ba, rgba(248, 81, 73, .4));--d2h-del-label-color: light-dark(#c33, #f85149);--d2h-change-del-color: light-dark(#fdf2d0, rgba(210, 153, 34, .2));--d2h-change-ins-color: light-dark(#ded, rgba(46, 160, 67, .25));--d2h-info-bg-color: light-dark(#f8fafd, rgba(56, 139, 253, .1));--d2h-info-border-color: light-dark(#d5e4f2, rgba(56, 139, 253, .4));--d2h-change-label-color: light-dark(#d0b44c, #d29922);--d2h-moved-label-color: light-dark(#3572b0, #58a6ff);--mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;--prose: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Helvetica, sans-serif;--measure: 1560px}:root[data-theme=light]{color-scheme:light}:root[data-theme=dark]{color-scheme:dark}*{box-sizing:border-box}body{margin:0;font-family:var(--mono);font-size:12px;color:var(--fg);background:var(--bg)}:root{accent-color:var(--accent)}::selection{background:color-mix(in srgb,var(--accent) 28%,transparent)}a{color:var(--accent)}a:hover{color:var(--accent-dark)}h1,h2,h3{font-size:13px;font-weight:700;margin:0}.app{padding-bottom:48px}.wrap{max-width:var(--measure);margin:0 auto;padding:0 40px}.bar-inner{max-width:var(--measure);margin:0 auto;padding:0 40px;display:flex;align-items:center;gap:14px}.grow{flex-grow:1}.pad{padding:24px 40px}.muted,.faint{color:var(--faint)}.warn{color:var(--amber)}.danger{color:var(--red)}.add{color:var(--green)}.del{color:var(--red)}.icon{flex-shrink:0}.lab{font-size:10px;letter-spacing:.14em;text-transform:uppercase;color:var(--faint)}.key{font-size:10px;border:1px solid var(--line-2);border-bottom-width:2px;border-radius:3px;padding:1px 5px;color:var(--muted);background:var(--surface)}.hint{display:inline-flex;gap:5px;align-items:center;font-size:10.5px;color:var(--faint);white-space:nowrap}.prose{font-family:var(--prose);font-size:13px;line-height:1.6;color:var(--fg-2);text-wrap:pretty;max-width:720px}.prose.lead{font-size:13.5px;line-height:1.62;color:var(--fg)}.error{color:var(--red);background:color-mix(in srgb,var(--red) 6%,transparent);border:1px solid color-mix(in srgb,var(--red) 30%,transparent);padding:8px 12px;border-radius:4px;margin:10px 0}.empty{text-align:center;color:var(--faint);margin:64px auto;flex-direction:column}.empty pre{display:inline-block;background:var(--line-3);padding:8px 16px;border-radius:4px}button{font:inherit;cursor:pointer}.btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;font-size:11px;color:var(--fg-3);border:1px solid var(--line-2);border-radius:4px;padding:6px 10px;background:var(--surface);white-space:nowrap;text-decoration:none}.btn:hover:not(:disabled){color:var(--fg);border-color:var(--fainter)}.btn:disabled{opacity:.5;cursor:default}.btn-sm{font-size:10.5px;padding:3px 8px;gap:5px}.btn-accent{color:var(--accent);border-color:color-mix(in srgb,var(--accent) 35%,transparent)}.btn-keep-on{color:var(--on-fill);background:var(--green-fill);border-color:var(--green-fill)}.btn-keep-on:hover:not(:disabled){color:var(--on-fill);background:color-mix(in srgb,var(--green-fill) 88%,var(--fg));border-color:color-mix(in srgb,var(--green-fill) 88%,var(--fg))}.btn-drop-on{color:var(--red);border-color:color-mix(in srgb,var(--red) 40%,transparent)}.btn-dark{color:var(--bg);background:var(--fg);border-color:var(--fg);font-size:11.5px;padding:7px 14px}.btn-dark:hover:not(:disabled){color:var(--bg);background:color-mix(in srgb,var(--fg) 82%,var(--bg));border-color:color-mix(in srgb,var(--fg) 82%,var(--bg))}.btn-dark:disabled{color:var(--faint);background:var(--sunken-2);border-color:var(--line-2)}.btn-dashed{display:inline-flex;align-items:center;gap:5px;font-size:10.5px;color:var(--muted);border:1px dashed var(--line-2);border-radius:4px;padding:5px 10px;background:transparent;margin-top:10px}.btn-primary{display:flex;align-items:center;justify-content:center;gap:8px;height:40px;padding:0 14px;font-size:12px;font-weight:500;color:var(--on-fill);background:var(--accent-fill);border:1px solid var(--accent-fill);border-radius:4px}.btn-primary .key{border-color:color-mix(in srgb,var(--on-fill) 30%,transparent);color:color-mix(in srgb,var(--on-fill) 75%,transparent);background:transparent}.link{display:inline-flex;align-items:center;gap:5px;font:inherit;font-size:11px;color:var(--accent);background:none;border:none;padding:0;text-decoration:none}.link:hover:not(:disabled){color:var(--accent-dark)}.link:disabled{color:var(--faint);cursor:default}.topbar{border-bottom:1px solid var(--line);background:var(--surface)}.topbar .bar-inner{padding-top:14px;padding-bottom:14px}.brand{display:inline-flex;align-items:center;gap:7px;font-size:15px;font-weight:700;letter-spacing:-.02em;color:var(--fg);text-decoration:none}.brand .logo{color:var(--accent);flex-shrink:0}.tagline{font-size:11px;color:var(--faint)}.topbar-link{font-size:11px;color:var(--muted);text-decoration:none;border-left:1px solid var(--line);padding-left:14px;display:inline-flex;align-items:center}.topbar-link:hover{color:var(--fg)}.bell{background:none;border:0;border-left:1px solid var(--line);padding:0 0 0 14px;font-family:inherit;cursor:pointer}.bell-on,.bell-ask{color:var(--accent)}.bell-blocked{color:var(--fainter);cursor:help}.bell-daemon{color:var(--accent);cursor:help}.daemon-bar{border-bottom:1px solid var(--line);background:var(--sunken);font-size:11px;color:var(--muted)}.daemon-bar .bar-inner{padding-top:8px;padding-bottom:8px;gap:18px;flex-wrap:wrap}.daemon-bar b{color:var(--fg);font-weight:400}.daemon-live{display:inline-flex;align-items:center;gap:6px;color:var(--fg)}.daemon-bar .warn{display:inline-flex;align-items:center;gap:6px}.dot{width:5px;height:5px;border-radius:999px;background:var(--green);display:inline-block}.dot-off{background:var(--fainter)}.tabs{display:flex;align-items:center;gap:2px;padding-top:14px}.tab{font-size:12px;padding:6px 12px;border:none;border-bottom:2px solid transparent;border-radius:4px 4px 0 0;background:none;color:var(--muted)}.tab:hover{color:var(--fg)}.tab-on{color:var(--fg);font-weight:500;border-bottom-color:var(--accent)}.tab-count{color:var(--fainter);margin-left:4px}.tab-on .tab-count{color:var(--accent)}.tab-split{width:1px;flex-shrink:0;align-self:stretch;margin:4px 10px 6px;background:var(--line-2)}.tab-filed{color:var(--faint)}.tab-filed:hover,.tab-filed.tab-on{color:var(--muted)}.tab-requests{color:var(--amber)}.tab-requests:hover,.tab-requests.tab-on{color:var(--amber);border-bottom-color:var(--amber)}.tab-requests .tab-count,.tab-requests.tab-on .tab-count{color:var(--amber)}.empty-tab{padding:22px 10px;font-size:12.5px;max-width:88ch}.empty-tab .btn{margin-top:10px}.table-head,.row{display:flex;gap:12px;align-items:center}.table-head{font-size:10px;letter-spacing:.12em;text-transform:uppercase;color:var(--faint);padding:12px 10px 7px;border-bottom:1px solid var(--line-2)}.row{font-size:12px;padding:8px 10px;cursor:pointer;border-bottom:1px solid var(--line-3);border-left:2px solid transparent}.row:hover{background:var(--sunken)}.row-on{background:var(--accent-wash);border-left-color:var(--accent)}.row-on .col-caret{color:var(--accent)}.row-on .col-title{font-weight:500}.tag-done{flex-shrink:0;color:var(--muted);background:var(--line-3)}.tag-awaiting{flex-shrink:0;color:var(--amber);background:color-mix(in srgb,var(--amber) 10%,transparent)}.pull{display:flex;align-items:center;gap:6px;position:relative;color:var(--muted)}.tabs .pull{margin-right:16px}.empty .pull{justify-content:center;margin-top:10px}.pull:hover,.pull:focus-within{color:var(--fg-3)}.pull-input{width:200px;max-width:100%;font:inherit;font-size:12px;padding:2px 0;color:var(--fg);background:transparent;border:none;border-bottom:1px solid transparent;transition:width .12s ease,border-color .12s ease}.pull-input:hover::placeholder{color:var(--fg)}.pull-input:focus{outline:none;width:320px;border-bottom-color:var(--accent)}.pull-input::placeholder{color:var(--muted);transition:color .12s ease}.btn-small{padding:2px 8px;font-size:10px}.pull-error{position:absolute;top:100%;right:0;z-index:5;margin-top:4px;max-width:360px;padding:5px 8px;font-size:11px;line-height:1.4;color:var(--red);background:var(--bg);border:1px solid var(--line-2);border-radius:4px;box-shadow:0 2px 8px color-mix(in srgb,var(--fg) 8%,transparent)}.tag-draft{flex-shrink:0;color:var(--muted);background:var(--line-3)}.col-caret{width:12px;flex-shrink:0;color:transparent}.col-slug{width:184px;flex-shrink:0;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.col-title{flex-grow:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.col-author{width:104px;flex-shrink:0;color:var(--faint);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.col-verdict{width:152px;flex-shrink:0;text-align:right;font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.col-comments{width:26px;flex-shrink:0;text-align:right;color:var(--muted)}.col-size{width:104px;flex-shrink:0;text-align:right;color:var(--muted)}.col-age{width:44px;flex-shrink:0;text-align:right;color:var(--faint)}.table-head .col-verdict,.table-head .col-slug,.table-head .col-author{color:var(--faint);font-weight:400}.cursor-strip{display:flex;gap:18px;align-items:flex-start;border:1px solid var(--line-2);border-top:none;border-radius:0 0 4px 4px;background:var(--surface);padding:14px 16px}.cursor-strip-body{flex-grow:1;min-width:0}.strip-prose{--strip-cap: 196px;--strip-fade: 46px;margin:6px 0 0;max-width:700px;max-height:var(--strip-cap);overflow:hidden}.strip-prose-clipped{-webkit-mask-image:linear-gradient(#000 calc(var(--strip-cap) - var(--strip-fade)),transparent var(--strip-cap));mask-image:linear-gradient(#000 calc(var(--strip-cap) - var(--strip-fade)),transparent var(--strip-cap))}.cursor-strip-body .md p{margin:5px 0}.cursor-strip-body .md ul,.cursor-strip-body .md ol{margin:5px 0;padding-left:17px}.cursor-strip-body .md li{margin:2px 0}.cursor-strip-body .md li::marker{color:var(--faint)}.cursor-strip-body .md strong{font-weight:600;color:var(--fg)}.cursor-strip-meta{font-size:10.5px;color:var(--faint);margin-top:8px}.cursor-strip-actions{display:flex;flex-direction:column;gap:6px;width:176px;flex-shrink:0}.cursor-strip-row{display:flex;gap:6px}.cursor-strip-row .btn{flex-grow:1;padding:7px 0}.review-top{position:sticky;top:0;z-index:20;background:var(--surface)}.crumb{border-bottom:1px solid var(--line);background:var(--surface);font-size:11.5px;color:var(--muted)}.crumb .bar-inner{padding-top:12px;padding-bottom:12px;gap:12px}.crumb a{text-decoration:none}.crumb-sep{color:var(--line-2)}.crumb-slug{color:var(--fg)}.crumb-next{font-size:11px;max-width:300px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.walk{display:inline-flex;gap:2px}.walk-btn{display:inline-flex;align-items:center;justify-content:center;padding:4px 6px;border:1px solid var(--line-2);border-radius:3px;background:var(--surface);color:var(--fg-3)}.walk-btn:disabled{color:var(--fainter);border-color:var(--line-3);cursor:default}.review-head{border-bottom:1px solid var(--line);background:var(--surface)}.review-head .wrap{padding-top:20px;padding-bottom:16px}.review-head-top,.review-head-meta{display:flex;align-items:center;gap:14px}.review-head-top{margin-bottom:8px}.review-title{font-size:19px;font-weight:700;letter-spacing:-.025em;color:var(--fg);text-decoration:none}.review-title:hover{color:var(--accent)}.review-head-meta{font-size:11px;color:var(--muted);gap:10px;flex-wrap:wrap}.verdict-pick{display:inline-flex;align-items:center;gap:5px;font-size:10.5px;padding:4px 9px;border-radius:4px;border:1px solid transparent;background:none;color:var(--faint);white-space:nowrap}.verdict-pick:hover{color:var(--fg-3)}.verdict-pick-on{background:var(--sunken-2);border-color:var(--line-2);font-weight:500}.review-body{display:grid;align-items:start;grid-template-columns:236px minmax(0,1fr);grid-template-areas:"rail main" "rail cockpit"}.rail{grid-area:rail}.main{grid-area:main}.cockpit{grid-area:cockpit;min-width:0;padding-bottom:18px}.rail{padding:22px 20px 22px 0;position:sticky;top:var(--top-h, 0px);z-index:5;max-height:calc(100vh - var(--top-h, 0px));overflow-y:auto}@media(min-width:1600px){.review{--measure: 2100px}.review-body{grid-template-columns:236px minmax(0,1fr) clamp(420px,34%,680px);grid-template-areas:"rail main cockpit"}.cockpit{position:sticky;top:var(--top-h, 0px);height:calc(100vh - var(--top-h, 0px));padding:22px 0 18px 22px;display:flex;flex-direction:column;justify-content:space-between;gap:10px}.cockpit .chat-panel{flex:0 1 auto;display:flex;flex-direction:column;min-height:120px;margin:0}.cockpit .chat-panel .card-body{display:flex;flex-direction:column;min-height:0}.cockpit .chat-log{flex:1 1 auto;min-height:0;overflow-y:auto}.cockpit .verdict-bar{margin-top:0}.cockpit-decide{flex:0 0 auto;max-height:65%;overflow-y:auto}}.chapter,.comment,.card-summary,.card-why,.chat-panel,.send-panel,.sent-strip,.verdict-bar{scroll-margin-top:calc(var(--top-h, 0px) + 12px)}.rail-lab{display:block;margin-top:22px}.rail-jumps{display:flex;flex-direction:column;align-items:flex-start;gap:7px}.rail .rail-jumps .lab{margin-bottom:0}.rail-lab-btn{display:block;width:100%;text-align:left;font:inherit;padding:0;background:none;border:none}.rail-lab-btn:hover{color:var(--fg)}.rail .lab{margin-bottom:10px}.rail-item{display:flex;align-items:center;gap:6px;width:100%;text-align:left;font:inherit;font-size:11.5px;line-height:1.5;padding:5px 0 5px 9px;margin-left:-11px;background:none;border:none;border-left:2px solid transparent;color:var(--muted)}.rail-item:hover{color:var(--fg)}.rail-item-on{border-left-color:var(--accent);color:var(--fg);font-weight:500}.rail-item-done{color:var(--fainter)}.rail-item-here{color:var(--accent)}.rail-group{margin-bottom:2px}.rail-count{font-size:10.5px;color:var(--fainter)}.rail-comment{display:flex;align-items:center;gap:6px;width:100%;font:inherit;font-size:11px;text-align:left;padding:3px 0 3px 20px;margin-left:-11px;background:none;border:none;border-left:2px solid transparent;color:var(--muted)}.rail-comment:hover{color:var(--fg)}.rail-comment-loc{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.rail-comment-dropped{opacity:.55}.rail-comment-dropped .rail-comment-loc{text-decoration:line-through}.rail-dot{font-size:8px}.comment-flash{animation:comment-flash 1.8s ease-out}@keyframes comment-flash{0%,60%{background:var(--accent-wash);box-shadow:inset 0 0 0 2px color-mix(in srgb,var(--accent) 45%,transparent)}}.rail-facts{font-size:11.5px;line-height:1.85;color:var(--muted)}.rail-facts b{color:var(--fg);font-weight:400}.main{min-width:0;padding:22px 0 0}.card{border:1px solid var(--line);border-radius:4px;background:var(--surface);margin-bottom:10px}.card-head{display:flex;align-items:baseline;gap:12px;flex-wrap:wrap;padding:11px 16px;border-bottom:1px solid var(--line-3)}.card-head .faint{font-size:11px}.card-body{padding:14px 16px}.card-body .lab{display:block;margin-bottom:7px}.card-body .prose{margin:0}.card-body .btn{margin-top:12px}.card-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.card-why{margin-bottom:8px}.chapter{border:1px solid var(--line);border-radius:4px;background:var(--surface);margin-bottom:10px;overflow:clip}.chapter-head{display:flex;align-items:center;gap:10px;padding:11px 16px;cursor:pointer;-webkit-user-select:none;user-select:none}.chapter-head-sticky{position:sticky;top:var(--top-h, 0px);z-index:4;flex-wrap:wrap;background:var(--surface)}.chapter-head-stuck{box-shadow:0 1px 0 var(--line)}.chapter-about-idle{visibility:hidden}.chapter-head-about{flex-basis:100%;max-height:40vh;overflow-y:auto;cursor:auto;-webkit-user-select:text;user-select:text}.chapter-sticky{--file-top: calc(var(--top-h, 0px) + var(--chapter-head-h, 0px))}.chapter-sticky .diff .d2h-file-header,.chapter-sticky .md-file-head{position:sticky;top:var(--file-top);z-index:3}.chapter-sticky .d2h-file-wrapper,.chapter-sticky .md-file{scroll-margin-top:var(--file-top)}.chapter-sticky .comment{scroll-margin-top:calc(var(--file-top) + 60px)}.chapter-body{padding:14px 16px 16px;border-top:1px solid var(--line-3)}.chapter-meta{font-size:11px;font-weight:400}.chapter-explanation{margin:0 0 14px}.comment{border:1px solid var(--line);border-radius:4px;background:var(--raised);padding:12px 14px;margin:8px 0}.comment-dropped{opacity:.5}.comment-dropped .comment-body{text-decoration:line-through}.comment-head{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-bottom:6px}.comment-loc{font-size:10.5px;color:var(--faint)}.comment-body{font-size:13px;line-height:1.58;color:var(--fg);max-width:640px}.comment-edit,.body-edit,.add-comment textarea,.chat-input{width:100%;font-family:var(--mono);font-size:12.5px;line-height:1.55;color:var(--fg);padding:10px 12px;border:1px solid var(--line-2);border-radius:4px;background:var(--surface);resize:vertical}.add-comment{border:1px dashed var(--line-2);border-radius:4px;padding:10px 12px;margin:10px 0;display:flex;flex-direction:column;gap:8px}.add-comment-row{display:flex;gap:8px;align-items:center}.add-comment select,.add-comment input{font:inherit;font-size:11.5px;padding:5px 7px;border:1px solid var(--line-2);border-radius:4px;background:var(--surface)}.file-comments:not(:empty){padding:8px 12px 0;border-bottom:1px solid var(--line);background:var(--raised)}.file-comments .comment{margin:0 0 8px}.md-file .file-comments:not(:empty){border-bottom:none;background:none}.inline-comment-row td{padding:0;background:var(--raised);border-top:1px solid var(--line);border-bottom:1px solid var(--line);white-space:normal}.inline-comment-row .comment{margin:0;border:none;border-radius:0;padding-left:44px;max-width:none}.line-composer-row td{padding:0;background:var(--accent-wash);border-top:1px solid var(--line);border-bottom:1px solid var(--line);white-space:normal}.line-composer{display:flex;flex-direction:column;gap:8px;padding:10px 12px 10px 44px;max-width:760px;font-family:var(--mono)}.line-composer-head{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.line-composer-actions{display:flex;align-items:center;gap:8px}.diff{margin-top:8px;font-size:11.5px}.diff .line-add{position:absolute;top:0;right:0;bottom:0;left:0;width:100%;padding:0;border:0;background:none;cursor:pointer;opacity:0}.diff tr:hover .line-add{opacity:1}.diff .line-add:before{content:"+";position:absolute;left:1px;top:50%;transform:translateY(-50%);width:13px;height:13px;border-radius:3px;background:var(--accent-fill);color:var(--on-fill);font-family:var(--mono);font-size:11px;font-weight:700;line-height:12px;text-align:center;direction:ltr}.diff .d2h-file-header,.diff .d2h-file-name{font-family:var(--mono);font-size:11px}.diff .d2h-code-line{white-space:normal;width:calc(100% - 9em);padding-right:1em}.diff .d2h-code-line-ctn{display:inline;width:auto;white-space:pre-wrap;overflow-wrap:anywhere}.diff .d2h-code-line ins,.diff .d2h-code-line del{display:inline}.diff .hljs{display:inline;padding:0;background:transparent;color:inherit}.hljs-doctag,.hljs-keyword,.hljs-meta .hljs-keyword,.hljs-template-tag,.hljs-template-variable,.hljs-type,.hljs-variable.language_{color:var(--syn-keyword)}.hljs-title,.hljs-title.class_,.hljs-title.class_.inherited__,.hljs-title.function_{color:var(--syn-entity)}.hljs-attr,.hljs-attribute,.hljs-literal,.hljs-meta,.hljs-number,.hljs-operator,.hljs-variable,.hljs-selector-attr,.hljs-selector-class,.hljs-selector-id{color:var(--syn-constant)}.hljs-regexp,.hljs-string,.hljs-meta .hljs-string{color:var(--syn-string)}.hljs-built_in,.hljs-symbol{color:var(--syn-variable)}.hljs-subst{color:var(--fg)}.hljs-comment,.hljs-code,.hljs-formula{color:var(--syn-comment)}.hljs-name,.hljs-quote,.hljs-selector-tag,.hljs-selector-pseudo{color:var(--syn-tag)}.hljs-section{color:var(--syn-heading);font-weight:700}.hljs-bullet{color:var(--syn-bullet)}.hljs-emphasis{font-style:italic}.hljs-strong{font-weight:700}.hljs-addition{color:var(--syn-ins);background-color:var(--syn-ins-bg)}.hljs-deletion{color:var(--syn-del);background-color:var(--syn-del-bg)}.freshness{background:color-mix(in srgb,var(--amber) 7%,transparent);border:1px solid color-mix(in srgb,var(--amber) 30%,transparent);color:var(--amber-ink);padding:10px 12px;border-radius:4px;margin-bottom:10px;line-height:1.55;font-size:11.5px}.freshness code{background:color-mix(in srgb,var(--fg) 6%,transparent);padding:1px 4px;border-radius:3px}.freshness-running{background:color-mix(in srgb,var(--accent) 6%,transparent);border-color:color-mix(in srgb,var(--accent) 30%,transparent);color:var(--accent-ink)}.freshness .btn{margin-left:8px}.chat-panel{margin:18px 0 10px}.chat-log{display:flex;flex-direction:column;gap:14px;margin-bottom:14px}.history{list-style:none;margin:0;padding:0}.history-row{display:flex;align-items:baseline;gap:10px;padding:3px 0;border-bottom:1px solid var(--line-3);font-size:11.5px}.history-row:last-child{border-bottom:0}.history-at{color:var(--muted);white-space:nowrap;flex-shrink:0;min-width:92px}.history-by{color:var(--faint);white-space:nowrap;flex-shrink:0;min-width:60px}.history-what{color:var(--fg-2)}.history-cause{color:var(--fainter);margin-left:auto;padding-left:12px;white-space:nowrap;flex-shrink:0}.chat-turn{border-left:2px solid var(--line-2);padding:2px 0 2px 12px}.chat-turn-user{border-left-color:var(--accent)}.chat-turn-pending{border-left-style:dashed}.chat-steer{margin-top:8px}.chat-turn-who{font-size:10.5px;color:var(--faint);margin-bottom:4px}.chat-turn-body{max-width:700px;color:var(--fg)}.chat-revision{font-size:10.5px;color:var(--green);margin-top:6px}.chat-refusal{font-size:10.5px;color:var(--amber);margin-top:6px}.chat-waiting{font-size:11.5px;color:var(--muted);margin-top:6px}.chat-progress{list-style:none;margin:0;padding:0}.chat-progress li{opacity:.55;padding:1px 0}.chat-progress li.now{opacity:1}.chat-progress li.now:after{content:"…"}.chat-failed{font-size:11.5px;color:var(--red);margin-top:6px}.chat-refs{display:flex;align-items:center;gap:6px;flex-wrap:wrap;margin-bottom:8px}.chat-ref{font-size:10.5px;font-family:var(--mono);padding:3px 9px;border:1px solid var(--line-2);border-radius:999px;color:var(--muted);background:transparent}.chat-refs-pending .chat-ref{cursor:pointer;color:var(--accent);border-color:color-mix(in srgb,var(--accent) 35%,transparent)}.chat-actions{display:flex;align-items:center;gap:12px;margin-top:10px}.send-panel{border:1px solid var(--line-2);border-radius:4px;background:var(--sunken);padding:16px 18px}.verdict-bar+.send-panel{border-radius:0 0 4px 4px}.send-top{display:flex;align-items:baseline;gap:12px;margin-bottom:14px}.send-top .faint{font-size:11px}.send-top .link{text-decoration:underline;text-underline-offset:2px}.send-action{display:flex;align-items:center;gap:16px;flex-wrap:wrap}.send-note{margin:0 0 10px;font-size:12px;color:var(--fg-2)}.send-btn{display:inline-flex;align-items:center;gap:10px;height:44px;padding:0 20px;font-size:13px;font-weight:500;color:var(--on-fill);border:none;border-radius:4px;box-shadow:0 1px 2px color-mix(in srgb,var(--fg) 12%,transparent)}.send-btn:disabled{opacity:.6;cursor:default}.send-btn .key{border-color:color-mix(in srgb,var(--on-fill) 30%,transparent);color:color-mix(in srgb,var(--on-fill) 80%,transparent);background:transparent}.verdict-bar{display:flex;align-items:center;gap:8px;flex-wrap:wrap;border:1px solid var(--line-2);border-bottom:none;border-radius:4px 4px 0 0;background:var(--surface);padding:10px 18px;margin-top:18px}.verdict-bar .lab{margin-right:4px}.verdict-bar .faint{font-size:10.5px}.send-footer{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-top:16px;padding-top:14px;border-top:1px solid var(--line-2);font-size:10.5px}.body-preview{margin-top:14px;padding:14px 16px;background:var(--surface);border:1px solid var(--line);border-radius:4px;font-family:var(--prose);font-size:12.5px;line-height:1.62;color:var(--fg-2);white-space:pre-wrap;max-width:760px;max-height:420px;overflow:auto}.body-edit-wrap{margin-top:14px;max-width:760px}.body-edit-wrap .body-md{margin-top:4px}.body-source{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-top:8px;max-width:760px;font-size:11px}.handoff-dialog{width:min(560px,calc(100vw - 32px));padding:0;border:1px solid var(--line-2);border-radius:6px;background:var(--surface);color:var(--fg);box-shadow:0 12px 32px color-mix(in srgb,var(--fg) 22%,transparent)}.handoff-dialog::backdrop{background:#0e111473}.handoff-body{padding:16px 18px 18px}.handoff-dialog .send-top{margin-bottom:12px}.handoff-who{display:flex;align-items:center;gap:6px;flex-wrap:wrap;margin-bottom:10px}.handoff-at{font-family:var(--mono);font-size:13px;color:var(--fg-3)}.handoff-login{width:15ch;font-family:var(--mono);font-size:13px;color:var(--fg);padding:6px 8px;border:1px solid var(--line-2);border-radius:4px;background:var(--sunken)}.handoff-combo{position:relative}.handoff-options{position:absolute;z-index:1;top:calc(100% + 4px);left:0;min-width:100%;max-height:232px;overflow-y:auto;margin:0;padding:4px;list-style:none;border:1px solid var(--line-2);border-radius:4px;background:var(--surface);box-shadow:0 6px 18px color-mix(in srgb,var(--fg) 16%,transparent)}.handoff-options li{display:flex;align-items:baseline;gap:10px;padding:5px 8px;border-radius:3px;white-space:nowrap;cursor:pointer}.handoff-options li.on{background:var(--sunken-2)}.handoff-option-login{font-family:var(--mono);font-size:12.5px}.handoff-options .faint{font-size:10.5px}.handoff-with-review{margin:12px 0 4px}.handoff-with-review label{display:flex;align-items:center;gap:8px;font-size:11.5px;cursor:pointer}.handoff-with-review p{margin:8px 0 0;font-size:11px;line-height:1.55}.handoff-with-review .body-preview{margin-top:8px;max-height:180px;font-size:11.5px}.handoff-who-note{margin:-4px 0 10px;font-size:11px}.handoff-says{margin:10px 0 14px;font-size:11.5px;line-height:1.55}.sent-strip{display:flex;align-items:baseline;gap:12px;flex-wrap:wrap;border:1px solid color-mix(in srgb,var(--green) 40%,transparent);background:color-mix(in srgb,var(--green) 7%,transparent);border-radius:4px;padding:14px 16px;font-size:11.5px}.sent-strip strong{color:var(--green);font-size:13px;white-space:nowrap}.sent-strip a{display:inline-flex;align-items:center;gap:5px;white-space:nowrap;text-decoration:none}.post-actions{display:flex;align-items:center;gap:12px;margin-top:12px;font-size:10.5px}.post-actions .link{font-size:10.5px;color:var(--muted)}.post-actions .link:hover{color:var(--fg)}.md-preview{display:flex;flex-direction:column;gap:3px;margin:6px 0 2px;padding:2px 0 2px 12px;border-left:2px solid var(--line-2)}.md-preview .md{color:var(--fg-3)}.md-file{border:1px solid var(--line-2);border-radius:4px;background:var(--surface);margin:8px 0;overflow:clip}.md-file-head{display:flex;align-items:center;gap:8px;padding:8px 12px;border-bottom:1px solid var(--line);background:var(--bg);font-size:11.5px}.md-file-name{color:var(--fg);font-weight:600}.md-block{position:relative;padding:0 16px 0 32px}.md-block .md{max-width:760px}.md-block-changed:before{content:"";position:absolute;left:16px;top:2px;bottom:2px;width:2px;border-radius:2px;background:var(--accent)}.md-block-add{position:absolute;left:4px;top:4px;display:flex;align-items:center;justify-content:center;width:18px;height:18px;padding:0;border:none;border-radius:3px;background:var(--accent-fill);color:var(--on-fill);cursor:pointer;opacity:0;transition:opacity 90ms}.md-block:hover .md-block-add,.md-block-add:focus-visible{opacity:1}.md-gap{margin:4px 0;padding:4px 16px;border-top:1px solid var(--line-3);border-bottom:1px solid var(--line-3);background:var(--bg);color:var(--faint);font-size:10.5px}.md-file .comment{margin:8px 16px}.md-file .line-composer{padding-left:32px;font-family:var(--mono)}.d2h-file-header .md-read-toggle{margin-left:auto}.file-viewed{display:inline-flex;align-items:center;gap:4px;margin-left:auto;font-size:11px;color:var(--muted);cursor:pointer;-webkit-user-select:none;user-select:none}.d2h-file-header .md-read-toggle+.file-viewed,.md-file-head .btn+.file-viewed{margin-left:8px}.file-viewed-on:not(.file-peek)>:not(.d2h-file-header){display:none}.file-viewed-on .d2h-file-header,.md-file-head-viewed{cursor:pointer}.file-viewed-on:not(.file-peek) .d2h-file-header,.md-file-head-folded{opacity:.7}.md:not(.md-doc)>:first-child{margin-top:0}.md:not(.md-doc)>:last-child{margin-bottom:0}.md p{margin:8px 0}.md code{font-family:var(--mono);font-size:.9em;background:var(--sunken-2);padding:1px 5px;border-radius:3px}.md pre{background:var(--sunken);border:1px solid var(--line);border-radius:4px;padding:10px 12px;overflow-x:auto}.md pre code{background:none;padding:0;font-size:11.5px}.md ul,.md ol{margin:8px 0;padding-left:24px}.md blockquote{margin:8px 0;padding-left:12px;border-left:2px solid var(--line-2);color:var(--muted)}.md h1,.md h2,.md h3,.md h4{font-size:1em;font-weight:650;letter-spacing:-.01em;margin:18px 0 2px;color:var(--fg)}.md-doc h1{font-size:1.5em;margin-top:4px}.md-doc h2{font-size:1.22em;margin-top:22px}.md-doc h3{font-size:1.06em}.md-doc h1,.md-doc h2{padding-bottom:4px;border-bottom:1px solid var(--line)}.md h1+p,.md h2+p,.md h3+p,.md h4+p,.md h1+ul,.md h2+ul,.md h3+ul,.md h4+ul{margin-top:4px}.settings{max-width:780px;margin:0 auto;padding:24px 40px 64px;font-family:var(--prose);font-size:13px;line-height:1.6;color:var(--fg-2)}.settings .back{display:inline-block;font-family:var(--mono);font-size:11.5px;text-decoration:none;margin-bottom:16px}.settings h1{font-family:var(--mono);font-size:15px;margin:32px 0 8px}.settings h2{font-family:var(--mono);font-size:13px;margin:28px 0 8px}.settings .settings-version{margin-top:40px;font-family:var(--mono);font-size:11.5px}.settings code{font-family:var(--mono);font-size:.92em;background:var(--sunken-2);padding:1px 5px;border-radius:3px}.inbox-toggle{display:block;margin:8px 0}.trust-add{display:flex;gap:8px;margin:20px 0 12px}.trust-add input{flex:1;font:inherit;padding:7px 10px;color:var(--fg);border:1px solid var(--line-2);border-radius:4px;background:var(--surface)}.trust-table{border-collapse:collapse;width:100%}.trust-table td{padding:6px 10px 6px 0;border-bottom:1px solid var(--line);vertical-align:baseline}.trust-actions{text-align:right}.trust-deny code{text-decoration:line-through}.tone-approve{color:var(--green)}.tone-comment{color:var(--amber)}.tone-changes{color:var(--red)}.tone-running,.tone-sent,.tone-none{color:var(--muted);font-weight:400}.tone-failed{color:var(--red)}.tone-awaiting{color:var(--accent)}.tone-bg-approve{background:var(--green-fill)}.tone-bg-comment{background:var(--amber-fill)}.tone-bg-changes{background:var(--red-fill)}.tone-border-approve{border-left:2px solid var(--green)}.tone-border-comment{border-left:2px solid var(--amber)}.tone-border-changes{border-left:2px solid var(--red)}.tone-border-none{border-left:2px solid var(--line-2)}.chip{font-size:11.5px;font-weight:500;padding:3px 9px;border-radius:3px;border:1px solid currentColor;background:color-mix(in srgb,var(--fg) 3%,transparent);white-space:nowrap}.chip-btn{display:inline-flex;align-items:center;gap:6px;font-family:inherit}.chip-btn:hover{background:color-mix(in srgb,var(--fg) 7%,transparent)}.tag{font-size:10px;letter-spacing:.06em;padding:1px 6px;border-radius:3px;color:var(--muted);background:var(--sunken-2);white-space:nowrap}.tag-yours{color:var(--accent);background:color-mix(in srgb,var(--accent) 9%,transparent)}.tag-kept{color:var(--green);background:color-mix(in srgb,var(--green) 10%,transparent)}.tag-drift{color:var(--amber);background:color-mix(in srgb,var(--amber) 10%,transparent)}.tag-added{color:var(--green);background:color-mix(in srgb,var(--green) 10%,transparent)}.sev-counts{display:flex;align-items:center;gap:7px;flex-wrap:wrap;font-size:12px;color:var(--muted);margin-bottom:6px}.verdict-hint{display:flex;align-items:center;gap:10px;flex-wrap:wrap;background:color-mix(in srgb,var(--amber) 7%,transparent);border:1px solid color-mix(in srgb,var(--amber) 30%,transparent);color:var(--amber-ink);padding:10px 12px;border-radius:4px}.raised{margin:2px 0 8px;padding:6px 10px;border-left:2px solid color-mix(in srgb,var(--amber) 55%,transparent);background:color-mix(in srgb,var(--amber) 5%,transparent);border-radius:0 3px 3px 0}.raised-head{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.raised-head a{font-size:10.5px}.tag-raised{display:inline-flex;align-items:center;gap:4px;color:var(--amber);background:color-mix(in srgb,var(--amber) 10%,transparent)}.raised-reason{margin:4px 0 0;font-size:12px;line-height:1.5;color:var(--muted);max-width:640px}.raised-fate{color:var(--fg)}
@@ -247,4 +247,4 @@ Please report this to https://github.com/markedjs/marked.`,l){let s="<p>An error
247
247
  ${x.patch}`):T.push({kind:"diff",paths:[x.path],patch:x.patch})}if(g.length===0)return d.jsx("p",{className:"muted",children:"No diff for this chapter."});const N=new Set(g.map(x=>x.path)),D=x=>a.filter(C=>x(C.path));return d.jsxs(d.Fragment,{children:[T.map(x=>{const C=new Set(x.paths);if(x.kind==="read"){const I=x.paths[0];return d.jsx(AN,{path:I,doc:m.get(I),comments:D(A=>A===I),renderComment:r,readOnly:s,chatBusy:u,onAddLineComment:f,onAskAboutLine:p,onShowDiff:()=>v(A=>({...A,[I]:!1})),viewedState:y},`read:${I}`)}return d.jsx(TN,{patch:x.patch,comments:D(I=>C.has(I)),renderComment:r,readOnly:s,chatBusy:u,onAddLineComment:f,onAskAboutLine:p,onRead:I=>v(A=>({...A,[I]:!0})),viewedState:y},`diff:${x.paths[0]}`)}),D(x=>!N.has(x)).map(r)]})}function kN({check:l,raised:a,held:r,replies:s}){if(!l)return null;const u=[r>0&&`${r} left out`,s>0&&`${s} as replies`].filter(Boolean),f=a>0?d.jsxs("div",{className:"warn",title:"Findings another reviewer already raised on the PR — each card says who, and what Send does with it.",children:[a," already raised",u.length>0?` · ${u.join(" · ")}`:""]}):null;return l.checkingSince?d.jsxs(d.Fragment,{children:[f,d.jsx("div",{className:"faint",children:"checking what others already raised…"})]}):l.error?d.jsxs(d.Fragment,{children:[f,d.jsx("div",{className:"warn",title:l.error,children:"couldn't check what others already raised"})]}):f||(l.remarks.length>0?d.jsx("div",{className:"faint",children:"none already raised by others"}):null)}function ON({comment:l,readOnly:a,onDecide:r}){var y;const s=l.alreadyRaised;if(!s)return null;const u=fN(l,a),f=s.where.kind==="thread",p=!a&&l.status!=="dropped";return d.jsxs("div",{className:"raised",children:[d.jsxs("div",{className:"raised-head",children:[d.jsxs("span",{className:"tag tag-raised",children:[d.jsx(Ze,{name:"comment"}),"already raised by @",s.by," · ",hN(s)]}),s.url&&d.jsxs("a",{href:s.url,target:"_blank",rel:"noreferrer",className:"faint",children:["see it on GitHub ",d.jsx(Ze,{name:"external"})]}),d.jsx("span",{className:"grow"}),p&&d.jsxs(d.Fragment,{children:[f&&d.jsx("button",{className:`btn btn-sm${s.decision==="reply"?" btn-keep-on":""}`,title:"Send posts this as a reply in their thread instead of a new comment — for when it adds something",onClick:()=>r(s.decision==="reply"?null:"reply"),children:"reply in their thread"}),d.jsx("button",{className:`btn btn-sm${s.decision==="send"?" btn-keep-on":""}`,title:"Send posts it as a comment of its own all the same",onClick:()=>r(s.decision==="send"?null:"send"),children:"send anyway"})]})]}),d.jsxs("p",{className:"raised-reason",children:[s.reason,u&&d.jsxs("span",{className:"raised-fate",children:[" — ",(y=s.replied)!=null&&y.url?d.jsx("a",{href:s.replied.url,target:"_blank",rel:"noreferrer",children:u}):u,"."]})]})]})}function yy({comment:l,onUpdate:a,onDelete:r,onDiscuss:s,readOnly:u,flash:f}){const[p,y]=F.useState(!1),[g,m]=F.useState(l.body),b=l.status==="approved",v=l.status==="dropped",_=l.origin==="user"?"yours":v?"dropped":b?"kept":"drafted";return d.jsxs("div",{id:`c-${l.id}`,className:`comment comment-${l.status}${f?" comment-flash":""}`,children:[d.jsxs("div",{className:"comment-head",children:[d.jsxs("span",{className:"comment-loc",children:[l.path,l.line!=null?`:${l.line}`:""]}),d.jsx("span",{className:`tag tag-${l.origin==="user"?"yours":_}`,children:_}),l.drifted?d.jsx("span",{className:"tag tag-drift",title:"The code this comment pointed at is gone from the diff, so it can't post inline.",children:"drifted — posts in the body"}):l.line==null&&d.jsx("span",{className:"tag tag-drift",title:"A comment with no line — either about the file as a whole, or on a line the PR removed, which GitHub can't take inline.",children:"on the file — posts in the body"}),!l.drifted&&l.originalLine!=null&&l.originalLine!==l.line&&d.jsxs("span",{className:"faint",title:"This comment followed its code to a new line.",children:["was :",l.originalLine]}),d.jsx("span",{className:"grow"}),!u&&(p?d.jsxs(d.Fragment,{children:[d.jsx("button",{className:"btn btn-sm",onClick:()=>{a({body:g}),y(!1)},children:"save"}),d.jsx("button",{className:"btn btn-sm",onClick:()=>{m(l.body),y(!1)},children:"cancel"})]}):d.jsxs(d.Fragment,{children:[d.jsxs("button",{className:`btn btn-sm${b?" btn-keep-on":""}`,title:"Keep this comment — it posts with the review",onClick:()=>a({status:b?"draft":"approved"}),children:[d.jsx(Ze,{name:"check"}),"keep"]}),d.jsxs("button",{className:"btn btn-sm",title:"Edit the wording",onClick:()=>y(!0),children:[d.jsx(Ze,{name:"edit"}),"edit"]}),d.jsxs("button",{className:`btn btn-sm${v?" btn-drop-on":""}`,title:"Drop it — stays local, never posts",onClick:()=>a({status:v?"draft":"dropped"}),children:[d.jsx(Ze,{name:"drop"}),v?"dropped":"drop"]}),s&&d.jsxs("button",{className:"btn btn-sm btn-accent",title:"Point the chat at this comment",onClick:s,children:[d.jsx(Ze,{name:"comment"}),"discuss"]}),l.origin==="user"&&d.jsx("button",{className:"btn btn-sm",title:"Delete the comment you wrote",onClick:r,children:"✕"})]}))]}),d.jsx(ON,{comment:l,readOnly:u,onDecide:T=>a({raisedDecision:T})}),p?d.jsxs(d.Fragment,{children:[d.jsx("textarea",{className:"comment-edit",value:g,onChange:T=>m(T.target.value),rows:Math.max(3,g.split(`
248
248
  `).length)}),d.jsx(Ys,{className:"comment-body",text:rg(g,l.severity??null)})]}):d.jsx(ni,{className:"comment-body prose",text:rg(l.body,l.severity??null)})]})}function CN({files:l,chapterId:a,onAdd:r}){const[s,u]=F.useState(!1),[f,p]=F.useState(l[0]??""),[y,g]=F.useState(""),[m,b]=F.useState("");return s?d.jsxs("div",{className:"add-comment",children:[d.jsxs("div",{className:"add-comment-row",children:[d.jsx("select",{value:f,onChange:v=>p(v.target.value),children:l.map(v=>d.jsx("option",{value:v,children:v},v))}),d.jsx("input",{placeholder:"line (optional)",value:y,onChange:v=>g(v.target.value.replace(/\D/g,"")),size:12})]}),d.jsx("textarea",{placeholder:"Your comment…",value:m,onChange:v=>b(v.target.value),rows:3}),d.jsx(Ys,{className:"comment-body",text:m}),d.jsxs("div",{className:"add-comment-row",children:[d.jsx("button",{className:"btn",disabled:!m.trim()||!f,onClick:()=>{r({path:f,line:y?Number(y):null,body:m.trim(),chapterId:a}),b(""),g(""),u(!1)},children:"add"}),d.jsx("button",{className:"btn",onClick:()=>u(!1),children:"cancel"})]})]}):d.jsxs("button",{className:"btn btn-dashed",onClick:()=>u(!0),children:[d.jsx(Ze,{name:"plus"}),"add a comment of your own"]})}const MN=2e3;function DN({chapter:l,n:a,diff:r,comments:s,open:u,heavy:f,onToggle:p,onUpdateComment:y,onDeleteComment:g,onAddComment:m,onDiscuss:b,onAskAboutLine:v,chatBusy:_,readOnly:T,anchorRef:N,flash:D,viewedState:x,sticky:C,stuck:I}){const[A,Q]=F.useState(!1);F.useEffect(()=>{I||Q(!1)},[I]);const V=C&&I&&u,ie=F.useRef(null),H=F.useRef(null);F.useEffect(()=>{const M=ie.current,ee=H.current;if(!C||!M||!ee)return;const fe=()=>M.style.setProperty("--chapter-head-h",`${ee.offsetHeight}px`);fe();const we=new ResizeObserver(fe);return we.observe(ee),()=>{we.disconnect(),M.style.removeProperty("--chapter-head-h")}},[C]);const R=()=>{p(),V&&requestAnimationFrame(()=>{var M;return(M=ie.current)==null?void 0:M.scrollIntoView({block:"start"})})},q=F.useMemo(()=>N_(r,l.files),[r,l.files]),J=l.files.filter(M=>x.viewed.has(M)).length,K=F.useMemo(()=>hy(q,s),[q,s]),me=F.useMemo(()=>new Set(ja(q).map(M=>M.path)),[q]),ce=s.filter(M=>!K.includes(M)&&!me.has(M.path)),Se=s.filter(M=>K.includes(M)||me.has(M.path)),he=M=>d.jsx(yy,{comment:M,onUpdate:ee=>y(M.id,ee),onDelete:()=>g(M.id),onDiscuss:b&&(()=>b({target:"comment",id:M.id})),readOnly:T,flash:D===M.id},M.id);return d.jsxs("section",{className:`chapter${C?" chapter-sticky":""}`,ref:M=>{ie.current=M,N(M)},children:[d.jsxs("header",{ref:H,className:`chapter-head${C?" chapter-head-sticky":""}${V?" chapter-head-stuck":""}`,onClick:R,children:[d.jsx("span",{className:"faint",children:u?"▾":"▸"}),d.jsxs("h3",{children:[a," · ",l.title]}),d.jsxs("span",{className:"faint chapter-meta",children:[l.files.length," file",l.files.length===1?"":"s",s.length>0?` · ${s.length} comment${s.length===1?"":"s"}`:" · no comments",J>0&&` · ${J}/${l.files.length} viewed`,f!=null&&!u&&d.jsx("span",{title:"Drawing this many lines at once would leave the page too slow to scroll. Open it if you want it — nothing else on the page is affected.",children:` · ${f.toLocaleString()} lines to draw, folded to keep the page quick`})]}),d.jsx("span",{className:"grow"}),C&&u&&d.jsx("button",{className:`btn btn-sm${V?"":" chapter-about-idle"}`,"aria-expanded":A,onClick:M=>{M.stopPropagation(),Q(ee=>!ee)},children:A?"hide explanation":"what this chapter is about"}),b&&d.jsxs("button",{className:"btn btn-sm",onClick:M=>{M.stopPropagation(),b({target:"chapter",id:l.id})},children:[d.jsx(Ze,{name:"comment"}),"discuss"]}),V&&A&&d.jsx("div",{className:"chapter-head-about",onClick:M=>M.stopPropagation(),children:d.jsx(ni,{className:"prose",text:l.explanation})})]}),u&&d.jsxs("div",{className:"chapter-body",children:[d.jsx(ni,{className:"prose chapter-explanation",text:l.explanation}),ce.map(he),d.jsx(RN,{patch:q,comments:Se,renderComment:he,readOnly:T,chatBusy:_,onAddLineComment:(M,ee)=>m({path:M.path,line:M.side==="new"?M.line:null,body:ee,chapterId:l.id}),onAskAboutLine:v,viewedState:x}),!T&&l.files.length>0&&d.jsx(CN,{files:l.files,chapterId:l.id,onAdd:m})]})]})}function LN(l,a){switch(l.kind){case"summary":return"rewrote the summary";case"verdict":return`changed the verdict to ${l.verdict.recommendation.replace("_"," ")}`;case"chapter":{const r=a.chapters.find(s=>s.id===l.chapterId);return`rewrote the "${(r==null?void 0:r.title)??l.chapterId}" chapter`}case"comment-edit":{const r=a.comments.find(s=>s.id===l.commentId);return r?`rewrote the comment on ${r.path}:${r.line??"file"}`:"rewrote a comment"}case"comment-drop":{const r=a.comments.find(s=>s.id===l.commentId);return r?`dropped the comment on ${r.path}:${r.line??"file"}`:"dropped a comment"}case"comment-add":return`added a comment on ${l.path}:${l.line??"file"}`}}function Hd(l,a){var s;if(l.target==="summary")return"the summary";if(l.target==="verdict")return"the verdict";if(l.target==="chapter")return((s=a.chapters.find(u=>u.id===l.id))==null?void 0:s.title)??"a chapter";if(l.target==="line")return l.path==null||l.line==null?"a line of the diff":`${l.path}:${l.line}${l.side==="old"?" (removed)":""}`;const r=a.comments.find(u=>u.id===l.id);return r?`${r.path}:${r.line??"file"}`:"a comment"}function zN({turn:l,artifact:a}){return d.jsxs("div",{className:`chat-turn chat-turn-${l.role}`,children:[d.jsx("div",{className:"chat-turn-who",children:l.role==="user"?l.steer?"You, while it worked":"You":"Reviewer"}),l.refs.length>0&&d.jsx("div",{className:"chat-refs",children:l.refs.map((r,s)=>d.jsx("span",{className:"chat-ref",children:Hd(r,a)},s))}),d.jsx(ni,{className:"chat-turn-body prose",text:l.body}),l.revisions.map((r,s)=>d.jsxs("div",{className:"chat-revision",children:["↳ ",LN(r,a)]},s)),l.refused.map((r,s)=>d.jsxs("div",{className:"chat-refusal",title:r.reason,children:["⃠ left alone — ",r.reason]},s))]})}function jN({artifact:l,reviewKey:a,refs:r,onClearRefs:s,onDropRef:u,onArtifact:f,readOnly:p,inputRef:y,anchorRef:g}){const[m,b]=F.useState(""),[v,_]=F.useState(!1),[T,N]=F.useState(null),[D]=my(),x=l.chat??[],C=l.pendingChat??null,I=C!=null&&C.error==null,A=v||I,Q=(H,R,q)=>{!H||A||(_(!0),N(null),Rd(a,{message:H,refs:R}).then(J=>{f(J),q==null||q()}).catch(J=>N(String(J.message??J))).finally(()=>_(!1)))},V=H=>{_(!0),N(null),r0(a,H).then(R=>{var q;f(R),b(""),(q=y.current)==null||q.focus()}).catch(R=>N(String(R.message??R))).finally(()=>_(!1))},ie=()=>{const H=m.trim();if(!(!H||v)){if(I)return V(H);Q(H,r,()=>{var R;b(""),s(),(R=y.current)==null||R.focus()})}};return d.jsxs("section",{className:"card chat-panel",ref:g,children:[d.jsxs("header",{className:"card-head",children:[d.jsx("h2",{children:"talk to the reviewer"}),d.jsx("span",{className:"faint",children:"it revises the draft as you go · nothing here reaches GitHub — only send does"})]}),d.jsxs("div",{className:"card-body",children:[(x.length>0||C)&&d.jsxs("div",{className:"chat-log",children:[x.map(H=>d.jsx(zN,{turn:H,artifact:l},H.id)),C&&d.jsxs("div",{className:"chat-turn chat-turn-user chat-turn-pending",children:[d.jsx("div",{className:"chat-turn-who",children:"You"}),C.refs.length>0&&d.jsx("div",{className:"chat-refs",children:C.refs.map((H,R)=>d.jsx("span",{className:"chat-ref",children:Hd(H,l)},R))}),d.jsx(ni,{className:"chat-turn-body prose",text:C.message}),(C.steers??[]).map((H,R)=>d.jsxs("div",{className:"chat-steer",children:[d.jsx("div",{className:"chat-turn-who",children:"You, while it worked"}),d.jsx(ni,{className:"chat-turn-body prose",text:H})]},R)),C.error?d.jsxs("div",{className:"chat-failed",children:["✕ this turn didn't finish — ",C.error,!p&&d.jsxs(d.Fragment,{children:[" ",d.jsx("button",{className:"btn btn-sm",onClick:()=>Q([C.message,...C.steers??[]].join(`
249
249
 
250
- `),C.refs),children:"ask again"})," ",d.jsx("button",{className:"btn btn-sm",onClick:()=>o0(a).then(f).catch(H=>N(String(H.message??H))),children:"dismiss"})]})]}):d.jsx("div",{className:"chat-waiting",children:C.progress.length>0?d.jsx("ol",{className:"chat-progress",children:C.progress.map((H,R)=>d.jsx("li",{className:R===C.progress.length-1?"now":void 0,children:H},R))}):"Thinking… it re-reads the code before answering."})]})]}),p?d.jsx("p",{className:"faint",children:"This review was sent — the conversation is kept as a record, but it can't continue."}):d.jsxs(d.Fragment,{children:[r.length>0&&d.jsxs("div",{className:"chat-refs chat-refs-pending",children:[d.jsx("span",{className:"faint",children:"about:"}),r.map((H,R)=>d.jsxs("button",{className:"chat-ref",onClick:()=>u(R),title:"Remove",children:[Hd(H,l)," ✕"]},R))]}),d.jsx("textarea",{ref:y,className:"chat-input",rows:2,value:m,readOnly:v,placeholder:I?"steer it — it reads this before its next step":x.length===0?"the summary restates the author's claims — say what you actually verified":"say more…",onChange:H=>b(H.target.value),title:D==="enter"?"Enter sends · Shift+Enter for a new line":"⌘↵ sends · Enter for a new line",onKeyDown:H=>{yN(D,{...H,isComposing:H.nativeEvent.isComposing})&&(H.preventDefault(),ie())}}),d.jsx(Ys,{className:"chat-turn-body",text:m}),d.jsxs("div",{className:"chat-actions",children:[d.jsxs("button",{className:"btn btn-dark",onClick:ie,disabled:v||m.trim()==="",title:I?"Add this to the turn it's working on":void 0,children:[d.jsx(Ze,{name:"send"}),v?"sending…":I?"steer":"send message",d.jsx(za,{children:D==="enter"?"↵":"⌘↵"})]}),d.jsx("span",{className:"grow"}),l.preChat&&d.jsx("button",{className:"btn btn-sm",disabled:A,title:"Put the review back the way the AI first wrote it. The conversation stays.",onClick:()=>{_(!0),c0(a).then(f).catch(H=>N(String(H.message??H))).finally(()=>_(!1))},children:"reset the review"})]})]}),T&&d.jsx("div",{className:"error",children:T})]})]})}function vy(l){const a=F.useRef(null),r=F.useCallback(()=>{const s=a.current;s&&(s.style.height="auto",s.style.height=`${Math.min(s.scrollHeight+2,window.innerHeight*.7)}px`)},[]);return F.useEffect(r,[l,r]),F.useEffect(()=>(window.addEventListener("resize",r),()=>window.removeEventListener("resize",r)),[r]),a}function UN({initial:l,onSave:a,onCancel:r}){const[s,u]=F.useState(l),[f,p]=F.useState(!1),[y,g]=F.useState(null),m=vy(s),b=()=>{f||(p(!0),g(null),a(s).catch(v=>{g(String((v==null?void 0:v.message)??v)),p(!1)}))};return d.jsxs("div",{className:"body-edit-wrap",children:[d.jsx("textarea",{ref:m,className:"body-edit",autoFocus:!0,value:s,onChange:v=>u(v.target.value),rows:10,onKeyDown:v=>{v.key==="Enter"&&(v.metaKey||v.ctrlKey)&&(v.preventDefault(),b()),v.key==="Escape"&&!f&&r()}}),d.jsx(Ys,{className:"body-md",text:s}),y&&d.jsx("p",{className:"error",children:y}),d.jsxs("div",{className:"card-actions",children:[d.jsxs("button",{className:"btn btn-sm",onClick:b,disabled:f,children:[f?"saving…":"save this body",d.jsx(za,{children:"⌘↵"})]}),d.jsx("button",{className:"btn btn-sm",onClick:r,disabled:f,children:"cancel"}),d.jsx("span",{className:"faint",children:"this is exactly what posts — the review above stays as it reads"})]})]})}const BN=l=>l?`@${l} — handing this review over to you.`:"";function IN({artifact:l,reviewKey:a,onConfirm:r,onCancel:s}){const[u]=F.useState(Qb),[f,p]=F.useState(""),[y,g]=F.useState(""),[m,b]=F.useState(!1),[v,_]=F.useState(!1),[T,N]=F.useState(null),[D,x]=F.useState(null),[C,I]=F.useState(null),[A,Q]=F.useState(!1),[V,ie]=F.useState(null),[H,R]=F.useState(null),[q,J]=F.useState(!1),[K,me]=F.useState(-1),ce=vy(y),Se=F.useRef(null),he=kd(f),M=Vb(he),ee=l.summary!==""||l.comments.length>0,fe=!_b(l)&&ee,we=_b(l)&&l.sent==null&&ee,Le=A?JSON.stringify([l.bodyOverride,l.summary,l.chapters.map(Z=>[Z.title,Z.explanation]),l.comments.map(Z=>{var ye,Ne;return[Z.path,Z.line,Z.body,Z.severity,Z.status,Z.drifted,(ye=Z.alreadyRaised)==null?void 0:ye.decision,(Ne=Z.alreadyRaised)==null?void 0:Ne.where]})]):"";F.useEffect(()=>{if(!A)return;let Z=!1;return R(null),ie(null),Kb(a,"COMMENT").then(ye=>!Z&&ie(ye)).catch(ye=>{Z||(ie(null),R(String((ye==null?void 0:ye.message)??ye)))}),()=>{Z=!0}},[A,a,Le]);const S=!A||V!=null;F.useEffect(()=>{var Z;K<0||(Z=document.getElementById(`handoff-option-${K}`))==null||Z.scrollIntoView({block:"nearest"})},[K]);const z=F.useMemo(()=>E0(D??[],u),[D,u]),B=F.useMemo(()=>_0(z,f),[z,f]);F.useEffect(()=>{let Z=!1;return f0(a).then(ye=>!Z&&x(ye.logins)).catch(ye=>!Z&&I(String((ye==null?void 0:ye.message)??ye))),()=>{Z=!0}},[a]);const se=Z=>{p(Z),m||g(BN(kd(Z)))},pe=Z=>{se(Z),J(!1),me(-1)};F.useLayoutEffect(()=>{var Z;(Z=Se.current)==null||Z.showModal()},[]);const ve=()=>{v||!M||!S||(_(!0),N(null),r(he,y.trim(),A).catch(Z=>{N(String((Z==null?void 0:Z.message)??Z)),_(!1)}))};return d.jsx("dialog",{className:"handoff-dialog",ref:Se,"aria-label":`Hand off ${l.id}`,onCancel:Z=>{Z.preventDefault(),v||s()},onClick:Z=>{Z.target===Se.current&&!v&&s()},children:d.jsxs("div",{className:"handoff-body",children:[d.jsxs("div",{className:"send-top",children:[d.jsx("span",{className:"lab",children:"hand off"}),d.jsx("span",{className:"grow"}),d.jsx("span",{className:"faint",children:l.id})]}),d.jsxs("div",{className:"handoff-who",children:[d.jsx("span",{className:"handoff-at",children:"@"}),d.jsxs("div",{className:"handoff-combo",children:[d.jsx("input",{className:"handoff-login",autoFocus:!0,value:f,spellCheck:!1,placeholder:"github login",role:"combobox","aria-expanded":q&&B.length>0,"aria-controls":"handoff-options","aria-autocomplete":"list","aria-activedescendant":K>=0?`handoff-option-${K}`:void 0,onFocus:()=>J(!0),onBlur:()=>J(!1),onChange:Z=>{se(Z.target.value),J(!0),me(0)},onKeyDown:Z=>{const ye=q&&B.length>0;if(Z.key==="ArrowDown"||Z.key==="ArrowUp"){if(Z.preventDefault(),!ye)return J(!0);const Ne=Z.key==="ArrowDown"?1:-1;me(Ge=>(Ge+Ne+B.length)%B.length);return}if(Z.key==="Enter"){const Ne=ye&&K>=0?B[K]:void 0;Ne&&Ne.login.toLowerCase()!==he.toLowerCase()?pe(Ne.login):ve();return}Z.key==="Escape"&&ye&&(Z.preventDefault(),J(!1),me(-1))}}),q&&B.length>0&&d.jsx("ul",{className:"handoff-options",id:"handoff-options",role:"listbox",children:B.map((Z,ye)=>d.jsxs("li",{id:`handoff-option-${ye}`,role:"option","aria-selected":ye===K,className:ye===K?"on":void 0,onMouseEnter:()=>me(ye),onMouseDown:Ne=>{Ne.preventDefault(),pe(Z.login)},children:[d.jsxs("span",{className:"handoff-option-login",children:["@",Z.login]}),Z.recent&&d.jsx("span",{className:"faint",children:"handed to before"})]},Z.login))})]})]}),C&&d.jsx("p",{className:"faint handoff-who-note",children:"cerber could not read who this repo takes reviews from — type the login instead."}),d.jsx("textarea",{ref:ce,className:"body-edit",rows:2,value:y,onChange:Z=>{b(!0),g(Z.target.value)},onKeyDown:Z=>{Z.key==="Enter"&&(Z.metaKey||Z.ctrlKey)&&(Z.preventDefault(),ve())}}),d.jsxs("div",{className:"body-source",children:[d.jsx("span",{className:"faint",children:y.trim()?"goes on the PR as a plain comment, not a review":"nothing will be posted — only the review request moves"}),y.trim()!==""&&d.jsx("button",{className:"link",onClick:()=>{b(!0),g("")},disabled:v,children:"post no note"})]}),we&&d.jsx("p",{className:"faint handoff-says",children:"You already reviewed this PR, so this draft can't ride along — a handoff that carried it would be your second review. Send it yourself if that is what you mean."}),fe&&d.jsxs("div",{className:"handoff-with-review",children:[d.jsxs("label",{children:[d.jsx("input",{type:"checkbox",checked:A,disabled:v,onChange:Z=>Q(Z.target.checked)}),d.jsxs("span",{children:["also post the review — ",d.jsx("span",{className:"faint",children:Bd(l)})]})]}),A&&d.jsxs(d.Fragment,{children:[d.jsxs("p",{className:"faint",children:["Posts as a ",d.jsx("strong",{children:"comment"}),", never an approval or a change request: you are handing over the verdict, so it is @",M?he:"them","'s to make. The findings keep their grades."]}),H?d.jsxs("p",{className:"error",children:["cerber could not build the body this would post, so it will not post one:"," ",H]}):V?d.jsx("pre",{className:"body-preview",children:V.body}):d.jsx("p",{className:"faint",children:"building the body…"})]})]}),T&&d.jsx("p",{className:"error",children:T}),d.jsxs("p",{className:"faint handoff-says",children:[M?d.jsxs(d.Fragment,{children:["@",he]}):"They"," will be asked for this review and you will be taken off it."," ",A?"This row goes under sent, with the review on the PR.":l.sent?"This row stays under sent.":"This row is filed under settled, and comes back if anybody asks you again."]}),d.jsxs("div",{className:"card-actions",children:[d.jsxs("button",{className:"btn btn-sm",onClick:ve,disabled:v||!M||!S,children:[d.jsx(Ze,{name:"arrowRight"}),v?"handing over…":M?`hand off to @${he}`:"hand off",d.jsx(za,{children:"⌘↵"})]}),d.jsx("button",{className:"btn btn-sm",onClick:s,disabled:v,children:"cancel"})]})]})})}function HN({artifact:l,reviewKey:a,event:r,sending:s,checking:u,onSend:f,error:p,footer:y,next:g,onAdvance:m,onBody:b,anchorRef:v}){const[_,T]=F.useState(null),[N,D]=F.useState(null),[x,C]=F.useState(l.bodyOverride!=null),[I,A]=F.useState(!1),Q=l.bodyOverride!=null,V=l.priorSends??[];F.useEffect(()=>{Q&&C(!0)},[Q]);const ie=x&&!I?JSON.stringify([l.bodyOverride,l.summary,l.chapters.map(H=>[H.title,H.explanation]),l.comments.map(H=>{var R,q;return[H.path,H.line,H.body,H.severity,H.status,H.drifted,(R=H.alreadyRaised)==null?void 0:R.decision,(q=H.alreadyRaised)==null?void 0:q.where]})]):"";return F.useEffect(()=>{if(!x||I)return;let H=!1;return T(null),D(null),Kb(a,r).then(R=>{H||(T(R),D(null))}).catch(R=>{H||D(String(R))}),()=>{H=!0}},[a,r,ie,x,I]),l.sent?d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"sent-strip",ref:v,children:[d.jsxs("strong",{children:["✔ sent as ",Ud[l.sent.event]]}),d.jsxs("span",{className:"faint",children:[new Date(l.sent.at).toLocaleString()," · ",Bd(l),l.sent.auto?" · auto-sent by the daemon":"",V.length>0?` · review ${Sb(l)} on this PR`:""]}),d.jsx("span",{className:"grow"}),l.sent.url&&d.jsxs("a",{href:l.sent.url,target:"_blank",rel:"noreferrer",children:["view on GitHub ",d.jsx(Ze,{name:"external"})]}),d.jsxs("button",{className:"btn",onClick:m,children:[g?`next review: ${g.pr.repo}#${g.pr.number}`:"back to the queue",d.jsx(Ze,{name:"arrowRight"})]})]}),d.jsx("div",{className:"post-actions",children:y})]}):d.jsxs("div",{className:"send-panel",ref:v,children:[d.jsxs("div",{className:"send-top",children:[d.jsx("span",{className:"lab",children:"send to github"}),d.jsx("span",{className:"grow"}),d.jsx("span",{className:"faint",children:Bd(l)}),d.jsxs("button",{className:"link",onClick:()=>C(!x),disabled:I,title:I?"save or cancel the body you are writing first":void 0,children:[d.jsx(Ze,{name:"eye"}),x?"hide what gets posted":"see what gets posted"]})]}),V.length>0&&d.jsxs("p",{className:"send-note",children:["This posts review ",Sb(l)+1," on this PR. What you sent before stays on GitHub — a new one sits beside it rather than replacing it."]}),d.jsx("div",{className:"send-action",children:d.jsxs("button",{className:`send-btn tone-bg-${cN[r]}`,disabled:s||u,onClick:f,children:[d.jsx(Ze,{name:r==="APPROVE"?"approve":r==="COMMENT"?"comment":"changes",size:15}),s?"sending…":u?"checking what others already raised…":`${Ud[r]} on ${l.id}`," ",d.jsx(za,{children:"s"})]})}),p&&d.jsx("p",{className:"error",children:p}),x&&d.jsxs(d.Fragment,{children:[N&&d.jsx("p",{className:"error",children:N}),_?I?d.jsx(UN,{initial:_.body,onSave:H=>b(H).then(()=>A(!1)),onCancel:()=>A(!1)}):d.jsxs(d.Fragment,{children:[d.jsx("pre",{className:"body-preview",children:_.body}),d.jsxs("div",{className:"body-source",children:[Q?d.jsxs(d.Fragment,{children:[d.jsx("span",{className:"faint",children:"you wrote this body — it no longer follows the summary or the comments"}),d.jsx("button",{className:"link",onClick:()=>b(null).catch(H=>D(String((H==null?void 0:H.message)??H))),children:"build it from the review again"})]}):d.jsx("span",{className:"faint",children:"built from the summary, the walkthrough and the folded comments"}),d.jsxs("button",{className:"link",onClick:()=>A(!0),children:[d.jsx(Ze,{name:"edit"}),Q?"keep editing it":"write it yourself"]})]})]}):!N&&d.jsx("p",{className:"faint",children:"building the body…"})]}),d.jsx("div",{className:"send-footer",children:y})]})}function xb({sends:l}){const a=l[l.length-1],r=l.length===1,s=f=>new Date(f).toLocaleDateString(),u=Ud[a.event];return d.jsxs("div",{children:[d.jsxs("strong",{children:["You already sent ",r?"a review":`${l.length} reviews`," on this PR",r?"":", the last"," on ",s(a.at),r?` — ${u}`:` as ${u}`,"."]})," ",a.url?d.jsx("a",{href:a.url,target:"_blank",rel:"noreferrer",children:r?"It is still on GitHub":"The last is still on GitHub"}):r?"It is still on GitHub":"The last is still on GitHub",", untouched by the draft below — a re-review replaces what cerber holds, never what was posted. Sending this one would be review ",l.length+1,"."]})}function qN({filed:l}){var s,u,f;const a=((s=l.review)==null?void 0:s.url)??((u=l.reply)==null?void 0:u.url)??null,r=p=>new Date(p).toLocaleDateString();return l.reason==="own-reply"&&l.reply?d.jsxs("div",{children:[d.jsxs("strong",{children:["You answered on this PR on ",r(l.reply.at),", and nobody has replied since."]})," ","So cerber filed this draft under settled: GitHub does not count a"," ",a?d.jsx("a",{href:a,target:"_blank",rel:"noreferrer",children:"comment"}):"comment"," ","as a review, but the PR is with its author either way. Nothing here was changed or sent — the draft is still yours to send."]}):l.reason==="request-withdrawn"?d.jsxs("div",{children:[d.jsx("strong",{children:"Nobody is asking for this review any more."})," The request that put this PR in the inbox was taken back on or before ",r(l.at),", and you had said nothing on the PR, so cerber filed the draft under settled rather than leaving it out for you. Nothing here was changed or sent — the draft is still yours to send."]}):d.jsxs("div",{children:[d.jsxs("strong",{children:["You reviewed this PR on GitHub on ",r(((f=l.review)==null?void 0:f.at)??l.at),"."]})," ","So cerber filed this draft under settled, GitHub having stopped asking you for a review and shown one of your own"," ",a?d.jsx("a",{href:a,target:"_blank",rel:"noreferrer",children:"already on the PR"}):"already on the PR",". Nothing here was changed or sent — the draft is still yours to send."]})}function GN({entries:l,open:a,onToggle:r,anchorRef:s}){const u=f=>{const p=new Date(f);return Number.isNaN(p.getTime())?f:`${p.toLocaleDateString(void 0,{month:"short",day:"2-digit"})} ${p.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}`};return d.jsxs("section",{className:"card",ref:s,children:[d.jsxs("header",{className:"card-head",children:[d.jsx("h2",{children:"history"}),d.jsx("span",{className:"faint",children:l.length>0?`${l.length} entr${l.length===1?"y":"ies"} — what cerber did to this row, and when`:"nothing recorded"}),d.jsx("span",{className:"grow"}),d.jsxs("button",{className:"btn btn-sm","aria-expanded":a,onClick:r,children:[d.jsx(Ze,{name:a?"up":"down",size:12}),a?"hide":"show"]})]}),a&&d.jsx("div",{className:"card-body",children:l.length===0?d.jsx("div",{className:"faint",children:"This review predates cerber keeping a history — it starts at the next thing that happens to it."}):d.jsx("ol",{className:"history",children:l.map((f,p)=>({e:f,i:p})).reverse().map(({e:f,i:p})=>d.jsxs("li",{className:"history-row",title:f.at,children:[d.jsx("span",{className:"history-at",children:u(f.at)}),d.jsx("span",{className:"history-by",children:f.by}),d.jsx("span",{className:"history-what",children:f.what}),f.cause&&d.jsx("span",{className:"history-cause",children:f.cause})]},`${p}-${f.at}`))})})]})}function $N({handoff:l,sent:a,hasDraft:r}){const s=new Date(l.at).toLocaleDateString();return d.jsxs("div",{children:[d.jsxs("strong",{children:["You handed this to @",l.to," on ",s,"."]})," ","GitHub asks them for this review now",l.withdrewYours?" and no longer asks you":" — but cerber could not take your own request off, so it is asking both of you","."," ",l.note?l.note.url?d.jsxs(d.Fragment,{children:["A"," ",d.jsx("a",{href:l.note.url,target:"_blank",rel:"noreferrer",children:"note"})," ","on the PR says so."]}):d.jsx(d.Fragment,{children:"A note on the PR says so."}):d.jsx(d.Fragment,{children:"No note was posted — only the request moved."})," ",a?d.jsx(d.Fragment,{children:"Your review of it is on the PR — the draft below is what went."}):r?d.jsx(d.Fragment,{children:"The draft below was never sent. It is still yours to read, or to send."}):d.jsx(d.Fragment,{children:"Nothing was drafted here, and nothing was sent."})]})}function YN({artifact:l,freshness:a,rerunning:r,onRerun:s}){const u=l.status==="running",f=(a==null?void 0:a.prState)??l.pr.state,p=f==="CLOSED"||f==="MERGED",y=l.refresh,g=a!=null&&a.changed?y:null,m=!p&&dN(l,a)?l.sent:null;if(u)return d.jsxs("div",{className:"freshness",children:[(l.sent?[]:l.priorSends??[]).length>0&&d.jsx(xb,{sends:l.priorSends??[]}),d.jsxs("div",{className:"freshness-running",children:[d.jsx("strong",{children:"Re-reviewing…"})," Claude is reading the current head. This page updates itself when the run lands — it takes a few minutes."]})]});const b=l.filed,v=l.handoff,_=l.sent?[]:l.priorSends??[];return!p&&!g&&!m&&!b&&!v&&_.length===0?null:d.jsxs("div",{className:"freshness",children:[_.length>0&&d.jsx(xb,{sends:_}),v&&d.jsx($N,{handoff:v,sent:l.sent,hasDraft:l.summary!==""||l.comments.length>0}),b&&d.jsx(qN,{filed:b}),p&&d.jsxs("div",{children:[d.jsxs("strong",{children:["This PR is ",f==="MERGED"?"merged":"closed","."]})," A review can still be sent, but nobody is waiting for it."]}),g&&d.jsxs("div",{children:[d.jsx("strong",{children:"The PR moved on since this review."})," Now at"," ",d.jsx("code",{children:g.toSha.slice(0,7)}),", reviewed at"," ",d.jsx("code",{children:g.fromSha.slice(0,7)}),"."," ",g.moved>0&&d.jsxs(d.Fragment,{children:[g.moved," comment(s) followed the code. "]}),g.drifted>0&&d.jsxs(d.Fragment,{children:[g.drifted," could not — the code they point at is gone, so they will post in the review body instead of inline."," "]}),"The summary and verdict still describe the commit that was reviewed.",!l.sent&&d.jsx("button",{className:"btn btn-sm",disabled:r,onClick:()=>s(),children:r?"starting…":"re-review at the new head"})]}),m&&d.jsxs("div",{children:[d.jsx("strong",{children:"The PR moved on since you sent this review."})," ",(a==null?void 0:a.headSha)&&l.pr.headSha&&d.jsxs(d.Fragment,{children:["Now at ",d.jsx("code",{children:a.headSha.slice(0,7)}),", sent at"," ",d.jsx("code",{children:l.pr.headSha.slice(0,7)}),"."," "]}),"What you sent stays exactly as it was posted — cerber never re-anchors a review that is already on GitHub. Answering the new commits means a new draft, which replaces this one here and leaves what was posted alone.",d.jsx("button",{className:"btn btn-sm",disabled:r,onClick:()=>s(),children:r?"starting…":"re-review at the new head"})]})]})}function FN({reviewKey:l}){var va,Wn,Ea,Jt,Fn;const[a,r]=F.useState(null),[s,u]=F.useState(null),[f,p]=F.useState(null),[y,g]=F.useState(null),[m,b]=F.useState(!1),[v,_]=F.useState([]),[T,N]=F.useState(new Set),D=G=>N(de=>new Set(de).add(G)),[x,C]=F.useState(!1),[I,A]=F.useState([]),Q=F.useRef(null),[V,ie]=F.useState(new Set),[H,R]=F.useState(new Set),q=F.useRef(Promise.resolve()),J=F.useRef(0),[K,me]=F.useState(0),ce=F.useRef(new Map),[Se]=fy(),[he,M]=F.useState(null),ee=F.useRef(null),fe=F.useRef(null),we=F.useRef(null),Le=F.useRef(null),S=F.useRef(null),z=F.useRef(null),[B,se]=F.useState(!1),pe=F.useRef(null),[ve,Z]=F.useState(!1),[ye,Ne]=F.useState(!1),[Ge,$e]=F.useState(null),[Me,Dt]=F.useState(null);F.useEffect(()=>{if(!Me)return;const G=setTimeout(()=>Dt(null),1800);return()=>clearTimeout(G)},[Me]);const Pe=G=>{var de,ge;A(Te=>Te.some(Ye=>Ye.target===G.target&&Ye.id===G.id)?Te:[...Te,G]),(de=Q.current)==null||de.scrollIntoView({behavior:"smooth",block:"center"}),(ge=Q.current)==null||ge.focus()};F.useEffect(()=>{let G=!1;return window.scrollTo({top:0}),r(null),u(null),p(null),g(null),$e(null),Ne(!1),ug(l).then(de=>{if(!G)return r(de),s0(l).then(ge=>{G||(p(ge),ge.changed&&r(ge.artifact))}).catch(ge=>!G&&g(String(ge.message??ge))).then(()=>{if(!(G||de.sent||de.status==="running"||de.comments.length===0))return Ne(!0),d0(l).then(ge=>!G&&r(ge)).catch(()=>{}).finally(()=>!G&&Ne(!1))})}).catch(de=>!G&&u(String(de))),()=>{G=!0}},[l]),F.useEffect(()=>{Qd().then(_).catch(()=>{})},[]),F.useEffect(()=>{const G=pe.current;if(!G)return;const de=()=>document.documentElement.style.setProperty("--top-h",`${G.offsetHeight}px`);de();const ge=new ResizeObserver(de);return ge.observe(G),()=>{ge.disconnect(),document.documentElement.style.removeProperty("--top-h")}},[a==null?void 0:a.id]);const Hn=(a==null?void 0:a.pendingChat)!=null&&a.pendingChat.error==null,it=F.useRef(null),fn=((va=a==null?void 0:a.raisedCheck)==null?void 0:va.checkingSince)!=null||ye;F.useEffect(()=>{if((a==null?void 0:a.status)!=="running"&&!Hn&&!fn)return;const G=setInterval(()=>{ug(l).then(de=>{var ge;if(r(de),de.status!=="running"){b(!1);const Te=it.current;Te!=null&&de.sent&&(((ge=de.run)==null?void 0:ge.startedAt)??"none")===Te&&u("The re-review didn't start, so nothing here changed — the review you sent is untouched. The history below says why."),it.current=null}}).catch(()=>{})},3e3);return()=>clearInterval(G)},[a==null?void 0:a.status,Hn,fn,l]);const Ot=(a==null?void 0:a.sent)!=null,Gt=F.useMemo(()=>M_(v,l,T),[v,l,T]),Wt=Gt.findIndex(G=>G.key===l),Lt=(Wt>0?Gt[Wt-1]:null)??null,vt=(Wt>=0&&Wt<Gt.length-1?Gt[Wt+1]:null)??null,Ln=G=>{window.location.hash=`#/r/${encodeURIComponent(G)}`},lt=()=>{vt?Ln(vt.key):window.location.hash="#/"},mt=F.useMemo(()=>{if(!a)return[];const G=R_(a.diff,a.chapters);return G.length>0?[...a.chapters,{id:"__other",title:"other changes",explanation:"Files not assigned to any chapter by the AI.",files:G}]:a.chapters},[a]);F.useEffect(()=>{let G=0;const de=()=>{var Re;G=0;const Ye=parseFloat(getComputedStyle(document.documentElement).getPropertyValue("--top-h"))||0,un=Ye+16;let oe=null;for(const Be of mt){const Je=(Re=ce.current.get(Be.id))==null?void 0:Re.getBoundingClientRect();Je&&Je.top<=un&&Je.bottom>un&&(oe={id:Be.id,stuck:Je.top<Ye-1})}M(Be=>(Be==null?void 0:Be.id)===(oe==null?void 0:oe.id)&&(Be==null?void 0:Be.stuck)===(oe==null?void 0:oe.stuck)?Be:oe)},ge=()=>{G||(G=requestAnimationFrame(de))};de(),window.addEventListener("scroll",ge,{passive:!0}),window.addEventListener("resize",ge);const Te=new ResizeObserver(ge);return Te.observe(document.body),()=>{cancelAnimationFrame(G),window.removeEventListener("scroll",ge),window.removeEventListener("resize",ge),Te.disconnect()}},[mt]);const At=F.useMemo(()=>{const G=k_((a==null?void 0:a.diff)??""),de=new Set(ja((a==null?void 0:a.diff)??"").filter(Te=>cf(Te.path)&&uf(Te.patch).isNew).map(Te=>Te.path)),ge=Te=>{const Ye=G.get(Te)??0;return de.has(Te)?Math.round(Ye/4):Ye};return new Map(mt.map(Te=>[Te.id,Te.files.reduce((Ye,un)=>Ye+ge(un),0)]))},[a==null?void 0:a.diff,mt]),_n=G=>{const de=At.get(G)??0;return de>MN?de:null},hn=G=>V.has(G)?_n(G)!=null:_n(G)==null,qn=G=>ie(de=>{const ge=new Set(de);return ge.has(G)?ge.delete(G):ge.add(G),ge});F.useEffect(()=>{ie(new Set),R(new Set)},[l]);const Sn=F.useMemo(()=>Object.fromEntries(ja((a==null?void 0:a.diff)??"").map(G=>[G.path,O_(G.patch)])),[a==null?void 0:a.diff]),wn=F.useMemo(()=>new Set(Object.keys(Sn).filter(G=>{var de;return((de=a==null?void 0:a.viewed)==null?void 0:de[G])===Sn[G]})),[Sn,a==null?void 0:a.viewed]),It={viewed:wn,peeked:H,onToggleViewed:G=>{const de=wn.has(G)?null:Sn[G]??null;R(Te=>{const Ye=new Set(Te);return Ye.delete(G),Ye}),r(Te=>{if(!Te)return Te;const Ye={...Te.viewed};return de===null?delete Ye[G]:Ye[G]=de,{...Te,viewed:Ye}});const ge=++J.current;q.current=q.current.then(()=>t0(l,G,de)).then(Te=>{ge===J.current&&r(Ye=>Ye&&Ye.id===Te.id?{...Ye,viewed:Te.viewed}:Ye)}).catch(Te=>u(String(Te)))},onTogglePeek:G=>R(de=>{const ge=new Set(de);return ge.has(G)?ge.delete(G):ge.add(G),ge})},pn=G=>{const de=mt[G];return de?(me(G),hn(de.id)||qn(de.id),de):null},Rt=(...G)=>{for(const de of G)if(de.current)return de.current.scrollIntoView({behavior:"smooth",block:"start"})},Gn=G=>{var ge;const de=pn(G);de&&((ge=ce.current.get(de.id))==null||ge.scrollIntoView({behavior:"smooth",block:"start"}))},$n=(G,de)=>{var Te;pn(G);const ge=(Te=a==null?void 0:a.comments.find(Ye=>Ye.id===de))==null?void 0:Te.path;ge&&wn.has(ge)&&R(Ye=>new Set(Ye).add(ge)),Dt(de),gy(de)},mn=uN(a==null?void 0:a.verdict);F.useEffect(()=>$e(null),[mn]);const He=()=>{!a||a.sent||ve||fn||(Z(!0),$e(null),u0(l,mn).then(({replyError:G,...de})=>{r(de),G&&$e(`Sent — but ${G}`),D(l)}).catch(G=>$e(String(G.message??G))).finally(()=>Z(!1)))};if(F.useEffect(()=>{const G=de=>{wN(de.target)||de.metaKey||de.ctrlKey||de.altKey||(de.key==="["&&Lt?Ln(Lt.key):de.key==="]"&&vt?Ln(vt.key):de.key==="n"?Gn(Math.min(mt.length-1,K+1)):de.key==="N"?Gn(Math.max(0,K-1)):de.key==="s"&&!Ot&&He())};return window.addEventListener("keydown",G),()=>window.removeEventListener("keydown",G)},[Lt==null?void 0:Lt.key,vt==null?void 0:vt.key,mt,K,Ot,mn,a==null?void 0:a.sent,ve,fn]),s&&!a)return d.jsx("p",{className:"error pad",children:s});if(!a)return d.jsx("p",{className:"muted pad",children:"Loading…"});const gn=G=>{var de;b(!0),u(null),it.current=a.sent?((de=a.run)==null?void 0:de.startedAt)??"none":null,Pb(l,G).then(r).catch(ge=>{u(String(ge)),b(!1)})},Ht=G=>G.then(r).catch(de=>u(String(de))),$t=G=>io(l,{status:G}).then(()=>{D(l),lt()}).catch(de=>u(String(de))),O=(G,de,ge)=>h0(l,{to:G,note:de,postReview:ge}).then(({artifact:Te,noteError:Ye,sendError:un,replyError:oe})=>{v0(G),r(Te),C(!1),D(l);const Re=[un&&`the review did not post: ${un}`,oe,Ye&&`the note did not post: ${Ye}`].filter(Boolean);Re.length>0?u(`Handed to @${G}, but ${Re.join("; and ")}`):lt()}),ne=(G,de)=>Ht(n0(l,G,de)),be=G=>Ht(i0(l,G)),je=G=>Ht(a0(l,G)),Qe=a.comments.filter(G=>!G.chapterId||!mt.some(de=>de.id===G.chapterId)),{inline:st,folded:Ae,dropped:_e,held:Ue,replies:Ct}=py(a),bt=a.comments.filter(G=>G.alreadyRaised&&G.status!=="dropped").length,jn=a.comments.filter(G=>G.status!=="dropped"&&G.drifted).length,Un=a.verdict?wb[a.verdict.recommendation]:"none",ba=mN(a),Pt=pN(a),St=a.pendingChat!=null&&a.pendingChat.error==null,Kt=a.status==="running"||St,ut=()=>Ht(Rd(l,{message:"Some findings were dropped, edited or re-graded after this review was drafted. Update the summary and verdict to match what still stands — do not re-review the whole PR.",refs:[{target:"verdict",id:null}]})),Yn=(G,de)=>{Ht(Rd(l,{message:de,refs:[{target:"line",id:null,path:G.path,line:G.line,side:G.side}]}).then(ge=>{var Te;return(Te=Le.current)==null||Te.scrollIntoView({behavior:"smooth",block:"start"}),ge}))},ii=(Wn=a.run)!=null&&Wn.trusted?"ran the code":(Ea=a.run)!=null&&Ea.withSource?"read the full source":a.run?"read the diff only":"no run yet",ya=G=>{var de;return d.jsxs("button",{className:`verdict-pick${((de=a.verdict)==null?void 0:de.recommendation)===G?` verdict-pick-on tone-${wb[G]}`:""}`,title:G==="approve"?"Approve":G==="comment"?"Comment without blocking":"Request changes",onClick:()=>Ht(io(l,{verdictRecommendation:G})),children:[d.jsx(Ze,{name:_N[G]}),G.replace("_"," ")]},G)};return d.jsxs("div",{className:"review",children:[d.jsxs("div",{className:"review-top",ref:pe,children:[d.jsx("div",{className:"crumb",children:d.jsxs("div",{className:"bar-inner",children:[d.jsx("a",{href:"#/",children:"← queue"}),d.jsx("span",{className:"crumb-sep",children:"/"}),d.jsx("span",{className:"crumb-slug",children:a.id}),d.jsxs("span",{className:"walk",children:[d.jsx("button",{className:"walk-btn",disabled:!Lt,title:Lt?`[ — ${Lt.id}: ${Lt.pr.title}`:"no more reviews this way",onClick:()=>Lt&&Ln(Lt.key),children:d.jsx(Ze,{name:"chevronLeft"})}),d.jsx("button",{className:"walk-btn",disabled:!vt,title:vt?`] — ${vt.id}: ${vt.pr.title}`:"no more reviews this way",onClick:()=>vt&&Ln(vt.key),children:d.jsx(Ze,{name:"chevronRight"})})]}),Wt>=0&&d.jsxs("span",{className:"faint",children:[Wt+1," of ",Gt.length," awaiting"]}),d.jsx("span",{className:"faint crumb-next",children:vt?`next: ${vt.pr.title}`:Wt>=0?"last in the queue":""}),d.jsx("span",{className:"grow"}),d.jsx("a",{href:"#/settings",className:"topbar-link",title:"settings","aria-label":"settings",children:d.jsx(Ze,{name:"settings",size:15})})]})}),d.jsx("div",{className:"review-head",children:d.jsxs("div",{className:"wrap",children:[d.jsxs("div",{className:"review-head-top",children:[d.jsx("a",{className:"review-title",href:a.pr.url,target:"_blank",rel:"noreferrer",children:a.pr.title}),d.jsx("span",{className:"grow"}),a.verdict&&(Ot?d.jsxs("span",{className:`chip tone-${Un}`,children:[a.verdict.recommendation.replace("_"," "),Pt&&` · ${Pt}`," · ",a.verdict.confidence,"%"]}):d.jsxs("button",{className:`chip chip-btn tone-${Un}`,title:"change it, or send — both are at the foot of the page",onClick:()=>Rt(ee,S),children:[a.verdict.recommendation.replace("_"," "),Pt&&` · ${Pt}`," · ",a.verdict.confidence,"%",d.jsx(Ze,{name:"down",size:12})]})),a.status!=="running"&&d.jsxs("button",{className:"btn btn-sm",disabled:m,title:Ot?"Draft a new review at the current head. What you sent stays on GitHub — this replaces the draft here, and sending again posts a second review":a.run?"Review the current head again — this draft is replaced, comments and all":"Draft a review of this PR",onClick:()=>gn(!0),children:[d.jsx(Ze,{name:"rerun"}),m?"starting…":a.run?"re-review at head":"review now"]})]}),d.jsxs("div",{className:"review-head-meta",children:[d.jsx("span",{children:a.pr.author}),d.jsx("span",{className:"crumb-sep",children:"·"}),d.jsxs("span",{children:[a.pr.headRefName," → ",a.pr.baseRefName,a.pr.headSha?` · ${a.pr.headSha.slice(0,7)}`:""]}),d.jsx("span",{className:"crumb-sep",children:"·"}),d.jsxs("span",{children:[a.pr.changedFiles,"f ",d.jsxs("span",{className:"add",children:["+",a.pr.additions]})," ",d.jsxs("span",{className:"del",children:["−",a.pr.deletions]})]}),d.jsx("span",{className:"crumb-sep",children:"·"}),d.jsx("span",{title:"Whether the run read a local checkout of the PR head, or the diff alone.",children:ii}),((Jt=a.run)==null?void 0:Jt.costUsd)!=null&&d.jsxs(d.Fragment,{children:[d.jsx("span",{className:"crumb-sep",children:"·"}),d.jsxs("span",{title:"What this review would cost at API token rates. Riding a Claude subscription, it draws on your usage limits instead.",children:["≈$",a.run.costUsd.toFixed(2)," at API rates"]})]}),d.jsx("span",{className:"crumb-sep",children:"·"}),d.jsx("span",{title:"Where this review has got to: drafted, settled locally, or sent.",children:a.status})]})]})})]}),d.jsxs("div",{className:"wrap review-body",children:[d.jsxs("aside",{className:"rail",children:[d.jsxs("div",{className:"rail-jumps",children:[d.jsx("button",{className:"lab rail-lab-btn",onClick:()=>Rt(fe),children:"summary"}),a.verdict&&d.jsx("button",{className:"lab rail-lab-btn",onClick:()=>Rt(we),children:"why"}),d.jsx("button",{className:"lab rail-lab-btn",onClick:()=>{var G;Rt(Le),(G=Q.current)==null||G.focus()},children:"chat"}),d.jsx("button",{className:"lab rail-lab-btn",onClick:()=>{se(!0),Rt(z)},children:"history"})]}),mt.length>0&&d.jsxs(d.Fragment,{children:[d.jsx("button",{className:"lab rail-lab rail-lab-btn",onClick:()=>Gn(0),children:"changes"}),mt.map((G,de)=>{const ge=G.files.length>0&&G.files.every(Te=>wn.has(Te));return d.jsxs("div",{className:"rail-group",children:[d.jsxs("button",{className:`rail-item${hn(G.id)?" rail-item-on":""}${ge?" rail-item-done":""}${(he==null?void 0:he.id)===G.id?" rail-item-here":""}`,onClick:()=>Gn(de),children:[d.jsxs("span",{className:"grow",children:[de+1," · ",G.title]}),d.jsxs("span",{className:"rail-count",title:ge?"every file viewed":void 0,children:[ge?"✓ ":"",G.files.length,"f"]})]}),a.comments.filter(Te=>Te.chapterId===G.id).map(Te=>d.jsxs("button",{className:`rail-comment${Te.status==="dropped"?" rail-comment-dropped":""}`,title:`${Te.path}${Te.line!=null?`:${Te.line}`:""} — ${Te.body}`,onClick:()=>$n(de,Te.id),children:[d.jsx("span",{className:`rail-dot tone-${SN(Te,Un)}`,children:"●"}),d.jsxs("span",{className:"rail-comment-loc",children:[Te.path.split("/").pop(),Te.line!=null?`:${Te.drifted?"~":""}${Te.line}`:""]})]},Te.id))]},G.id)})]}),d.jsx("button",{className:`lab rail-lab-btn${mt.length>0?" rail-lab":""}`,onClick:()=>Rt(ee,S),children:"verdict"}),d.jsxs("div",{className:"rail-facts",children:[d.jsxs("div",{children:[a.comments.length-_e.length," keeping · ",_e.length," dropped"]}),d.jsxs("div",{children:[st.length," inline · ",Ae.length," folded into body"]}),jn>0&&d.jsxs("div",{className:"warn",title:"The code these comments pointed at is gone from the diff.",children:[jn," drifted"]}),d.jsx(kN,{check:a.raisedCheck??null,raised:bt,held:Ue.length,replies:Ct.length})]})]}),d.jsxs("div",{className:"main",children:[d.jsx(YN,{artifact:a,freshness:f,rerunning:m,onRerun:gn}),y&&d.jsxs("div",{className:"freshness",title:y,children:[d.jsx("strong",{children:"Couldn't check GitHub for newer commits."})," This is the review as it was drafted — if the PR has moved on since, nothing here knows it yet."]}),s&&d.jsx("div",{className:"error",children:s}),((Fn=a.run)==null?void 0:Fn.error)&&d.jsxs("div",{className:"error",children:["Run failed: ",a.run.error]}),d.jsx("div",{className:"card card-summary",ref:fe,children:d.jsxs("div",{className:"card-body",children:[d.jsx("div",{className:"lab",children:"summary"}),d.jsx(ni,{className:"prose lead",text:a.summary||"(no summary)"}),!Ot&&d.jsxs("button",{className:"btn btn-sm",onClick:()=>Pe({target:"summary",id:null}),children:[d.jsx(Ze,{name:"comment"}),"discuss the summary"]})]})}),a.verdict&&d.jsx("div",{className:`card card-why tone-border-${Un}`,ref:we,children:d.jsxs("div",{className:"card-body",children:[d.jsx("div",{className:"lab",children:"why"}),d.jsxs("div",{className:"sev-counts",children:[Td(a)&&d.jsx("span",{title:"Live findings by grade. Only blockers block.",children:Td(a)}),Td(a)&&d.jsx("span",{className:"crumb-sep",children:"·"}),d.jsxs("span",{title:"How sure the review is that its own findings and grades are right — not how good an idea merging is. That is the verdict, and it follows from the blockers.",children:[a.verdict.confidence,"% sure of the findings"]})]}),d.jsx(ni,{className:"prose lead",text:a.verdict.reasoning}),!Ot&&d.jsxs("button",{className:"btn btn-sm",onClick:()=>Pe({target:"verdict",id:null}),children:[d.jsx(Ze,{name:"comment"}),"discuss the verdict"]})]})}),mt.map((G,de)=>d.jsx(DN,{chapter:G,n:de+1,diff:a.diff,comments:a.comments.filter(ge=>ge.chapterId===G.id),open:hn(G.id),heavy:_n(G.id),onToggle:()=>qn(G.id),onUpdateComment:ne,onDeleteComment:be,onAddComment:je,onDiscuss:Ot?void 0:Pe,onAskAboutLine:Yn,chatBusy:St,readOnly:Ot,flash:Me,viewedState:It,sticky:Se,stuck:(he==null?void 0:he.id)===G.id&&he.stuck,anchorRef:ge=>{ge?ce.current.set(G.id,ge):ce.current.delete(G.id)}},G.id)),Qe.length>0&&d.jsxs("section",{className:"card",children:[d.jsxs("header",{className:"card-head",children:[d.jsx("h2",{children:"unattached comments"}),d.jsx("span",{className:"faint",children:"not part of any chapter — they post in the body"})]}),d.jsx("div",{className:"card-body",children:Qe.map(G=>d.jsx(yy,{comment:G,onUpdate:de=>ne(G.id,de),onDelete:()=>be(G.id),onDiscuss:Ot?void 0:()=>Pe({target:"comment",id:G.id}),readOnly:Ot},G.id))})]}),d.jsx(GN,{entries:a.history??[],open:B,onToggle:()=>se(G=>!G),anchorRef:z})]}),d.jsxs("aside",{className:"cockpit",children:[d.jsx(jN,{artifact:a,reviewKey:l,refs:I,onClearRefs:()=>A([]),onDropRef:G=>A(de=>de.filter((ge,Te)=>Te!==G)),onArtifact:r,readOnly:Ot,inputRef:Q,anchorRef:Le}),d.jsxs("div",{className:"cockpit-decide",children:[!Ot&&ba&&d.jsxs("div",{className:"verdict-hint",children:[d.jsxs("span",{children:[d.jsx("strong",{children:ba})," — the verdict was written before those edits."]}),d.jsxs("button",{className:"btn btn-sm",onClick:ut,disabled:St,children:[d.jsx(Ze,{name:"comment"}),St?"the reviewer is busy…":"ask the reviewer to re-true it"]})]}),a.verdict&&!Ot&&d.jsxs("div",{className:"verdict-bar",ref:ee,children:[d.jsx("span",{className:"lab",children:"verdict"}),["approve","comment","request_changes"].map(ya)]}),d.jsx(HN,{artifact:a,reviewKey:l,event:mn,sending:ve,checking:fn,onSend:He,error:Ge,next:vt,onAdvance:lt,onBody:G=>io(l,{bodyOverride:G}).then(r),anchorRef:S,footer:d.jsxs(d.Fragment,{children:[!Ot&&d.jsx("span",{className:"faint",children:"not sending?"}),!Ot&&d.jsxs(d.Fragment,{children:[d.jsxs("button",{className:"btn btn-sm",title:vt?`Settle it locally and go to ${vt.id}`:"Settle it locally and go back to the queue",onClick:()=>$t("reviewed"),children:[d.jsx(Ze,{name:"check"}),"mark reviewed"]}),d.jsxs("button",{className:"btn btn-sm",title:vt?`Leave it and go to ${vt.id}`:"Leave it and go back to the queue",onClick:()=>$t("skipped"),children:[d.jsx(Ze,{name:"skip"}),"skip"]})]}),d.jsxs("button",{className:"btn btn-sm",title:Kt?"Wait for the run to finish — a handoff settles the row it is rewriting":"Move GitHub's review request to somebody else, and settle this row",onClick:()=>C(!0),disabled:x||Kt,children:[d.jsx(Ze,{name:"arrowRight"}),"hand off"]}),d.jsxs("a",{className:"btn btn-sm",href:p0(l),children:[d.jsx(Ze,{name:"download"}),"export .md"]})]})}),x&&d.jsx(IN,{artifact:a,reviewKey:l,onConfirm:O,onCancel:()=>C(!1)})]})]})]})]})}const Ab="cerber.notify.seen.v2",PN="cerber.notify.seen",qd="cerber.notify",KN=1e4,Is=l=>l.status==="ready",Gd=l=>{try{return localStorage.getItem(l)}catch{return null}},$d=(l,a)=>{try{localStorage.setItem(l,a)}catch{}};function ZN(l,a){return l?!!(l.enabled&&l.pollEnabled&&l.autoReview):a}function Ey(l,a){return l.announceable===!1||l.status==="running"?!1:l.status==="awaiting"?!a:!0}const _y=":draft",so=l=>`${l.key}${_y}`,Sy=l=>Is(l)?so(l):l.key;function XN(l,a,r){const s=new Set(a);return qs(l).filter(u=>Ey(u,r)&&!s.has(Sy(u)))}function VN(l,a,r=[]){const s=new Set(r),u=new Set(qs(l).map(p=>p.key)),f=[];for(const p of l){if(u.has(p.key)&&!Ey(p,a)){for(const y of[p.key,so(p)])s.has(y)&&f.push(y);continue}f.push(p.key),(Is(p)||!u.has(p.key)||s.has(so(p)))&&f.push(so(p))}return f}const xd=l=>`${l.pr.repo}#${l.pr.number}`,QN={approve:"approves",comment:"comments",request_changes:"requests changes"};function WN(l){const a=l.verdict?QN[l.verdict.recommendation]:"drafted",r=l.blockerCount??0;return r===0?a:`${a} · ${r} blocker${r===1?"":"s"}`}function JN(l){if(l.length===0)return null;const a=`cerber:${l.map(Sy).sort().join("|")}`;if(l.length===1){const u=l[0];return{title:Is(u)?`${xd(u)} draft ready`:`${xd(u)} awaits your review`,body:Is(u)?`${WN(u)} — ${u.pr.title}`:`${u.pr.title} — ${u.pr.author}`,tag:a,key:u.key}}const r=l.slice(0,3).map(xd),s=l.length-r.length;return{title:l.every(Is)?`${l.length} drafts ready`:`${l.length} PRs await your review`,body:s>0?`${r.join(", ")} and ${s} more`:r.join(", "),tag:a,key:null}}const eT=new Set(["127.0.0.1","localhost","::1","[::1]"]);function tT(l,a=window.location.hostname){return!(l!=null&&l.enabled)||!l.notify?!1:eT.has(a)}function Hl(){return typeof Notification>"u"?"unsupported":Notification.permission==="denied"?"blocked":Gd(qd)==="off"?"off":Notification.permission==="granted"?"on":"ask"}async function nT(){const l=Hl();if(l==="unsupported"||l==="blocked")return l;if(l==="on")return $d(qd,"off"),Hl();if($d(qd,"on"),Notification.permission==="default")try{await Notification.requestPermission()}catch{}return Hl()}function aT(l){const a=new Notification(l.title,{body:l.body,tag:l.tag,icon:"/favicon.svg"});a.onclick=()=>{window.focus(),window.location.hash=l.key?`#/r/${encodeURIComponent(l.key)}`:"#/",a.close()}}function iT(l,a){const r=l??a;if(!r)return null;let s;try{s=JSON.parse(r)}catch{return null}if(!Array.isArray(s))return null;const u=s.filter(f=>typeof f=="string");return l?u:u.flatMap(f=>[f,`${f}${_y}`])}function lT(){const l=F.useRef(null),a=F.useRef(!0),[r,s]=F.useState(!1);return F.useEffect(()=>{let u=!0;l.current=iT(Gd(Ab),Gd(PN));const f=()=>Promise.all([Qd(),Fb().catch(()=>null)]).then(([y,g])=>{if(!u)return;const m=tT(g);s(m),a.current=ZN(g,a.current);const b=a.current,v=l.current;if(l.current=VN(y,b,v??[]),$d(Ab,JSON.stringify(l.current)),!v||Hl()!=="on"||m||document.visibilityState==="visible"&&document.hasFocus())return;const _=JN(XN(y,v,b));_&&aT(_)}).catch(()=>{});f();const p=setInterval(f,KN);return()=>{u=!1,clearInterval(p)}},[]),r}function wy(){const[l,a]=F.useState(Hl);return F.useEffect(()=>{const r=()=>a(Hl());return window.addEventListener("focus",r),()=>window.removeEventListener("focus",r)},[]),[l,()=>void nT().then(a)]}const ro=l=>{window.location.hash=`#/r/${encodeURIComponent(l)}`};function sT(l){const a=l,r=a==null?void 0:a.tagName;return r==="INPUT"||r==="TEXTAREA"||r==="SELECT"||(a==null?void 0:a.isContentEditable)===!0}function rT({daemon:l}){return l!=null&&l.enabled?d.jsx("div",{className:"daemon-bar",children:d.jsxs("div",{className:"bar-inner",children:[l.pollEnabled?d.jsxs("span",{className:"daemon-live",children:[d.jsx("span",{className:"dot"}),l.repos.length>0?l.repos.join(", "):"PRs awaiting you"," · every"," ",Math.round(l.intervalMs/6e4),"m"]}):d.jsxs("span",{className:"daemon-live",children:[d.jsx("span",{className:"dot dot-off"}),"polling off (settings) — local reviews only"]}),d.jsxs("span",{children:["auto-review ",d.jsx("b",{children:l.autoReview?"on":"off"})]}),d.jsxs("span",{children:["auto-send ",d.jsx("b",{children:l.autoSend==="on"?"on":"shadow"})," ≥",l.autoSendThreshold,"%",l.autoSend==="on"?` · ${l.autoSent} sent`:` · ${l.autoSendCandidates} candidate${l.autoSendCandidates===1?"":"s"}`]}),l.trustedRuns&&d.jsxs("span",{className:"warn",title:"Trust rules are set and auto-review is on: reviews of matching PRs run their code unattended. Settings → Trusted PRs, or serve --no-trust.",children:[d.jsx(Ze,{name:"zap",size:12})," trusted PRs run with Bash"]}),d.jsx("span",{className:"grow"}),l.lastPollError?d.jsx("span",{className:"danger",title:l.lastPollError,children:"discovery offline — showing local reviews only"}):d.jsx("span",{className:"faint",children:l.polling?"polling now…":[l.lastSummary?`last: ${l.lastSummary}`:null,l.nextPollAt?`next ${new Date(l.nextPollAt).toLocaleTimeString()}`:null].filter(Boolean).join(" · ")})]})}):null}function oT({r:l,selected:a,onSelect:r,onOpen:s,awaiting:u}){const f=K_(l),p=U_(l),y=u?Y_(l,u):null;return d.jsxs("div",{className:`row${a?" row-on":""}`,onClick:s,onMouseEnter:r,role:"button",tabIndex:-1,children:[d.jsx("span",{className:"col-caret",children:"›"}),d.jsxs("span",{className:"col-slug",title:`${l.pr.owner}/${l.pr.repo}#${l.pr.number}`,children:[l.pr.repo,"#",l.pr.number]}),d.jsx("span",{className:"col-author",title:l.pr.author,children:l.pr.author}),d.jsx("span",{className:"col-title",title:l.pr.title,children:l.pr.title}),l.pr.isDraft&&d.jsx("span",{className:"tag tag-draft",title:"Still a draft — its author asked for your review anyway",children:"draft"}),y&&d.jsx("span",{className:"tag tag-awaiting",title:y.title,children:y.label}),p&&d.jsx("span",{className:"tag tag-done",children:p}),d.jsx("span",{className:"col-comments",children:l.commentCount||""}),d.jsx("span",{className:"col-size",children:l.pr.changedFiles>0?d.jsxs(d.Fragment,{children:[l.pr.changedFiles,"f ",d.jsxs("span",{className:"add",children:["+",l.pr.additions]})," ",d.jsxs("span",{className:"del",children:["−",l.pr.deletions]})]}):"—"}),d.jsx("span",{className:`col-verdict tone-${f.tone}`,children:f.label}),d.jsx("span",{className:"col-age",children:Yb(l.updatedAt)})]})}function Rb({autoFocus:l}){const[a,r]=F.useState(""),[s,u]=F.useState(!1),[f,p]=F.useState(null),y=g=>{g.preventDefault();const m=a.trim();!m||s||(u(!0),p(null),l0(m).then(b=>ro(b.key)).catch(b=>{p(String(b instanceof Error?b.message:b)),u(!1)}))};return d.jsxs("form",{className:"pull",onSubmit:y,children:[d.jsx(Ze,{name:"plus"}),d.jsx("input",{className:"pull-input",value:a,autoFocus:l,disabled:s,onChange:g=>{r(g.target.value),f&&p(null)},placeholder:"paste a PR URL to review it","aria-label":"Review any PR by URL"}),a.trim()&&d.jsx("button",{className:"btn btn-small",type:"submit",disabled:s,children:s?"starting…":"review"}),f&&d.jsx("span",{className:"pull-error",children:f})]})}function cT({text:l}){const a=F.useRef(null),[r,s]=F.useState(!1);return F.useLayoutEffect(()=>{const u=a.current;if(!u)return;const f=()=>s(u.scrollHeight-u.clientHeight>4);f();const p=new ResizeObserver(f);return p.observe(u),()=>p.disconnect()},[l]),d.jsx("div",{ref:a,className:`strip-prose${r?" strip-prose-clipped":""}`,children:d.jsx(ni,{className:"prose",text:l})})}function uT(){var J;const[l,a]=F.useState(null),[r,s]=F.useState(null),[u,f]=F.useState(null),[p,y]=F.useState(new Set),[g,m]=F.useState("inbox"),[b,v]=F.useState(null),_=F.useRef(!0);F.useEffect(()=>(_.current=!0,()=>{_.current=!1}),[]);const T=()=>{Qd().then(K=>_.current&&a(K)).catch(K=>_.current&&f(String(K))),Fb().then(K=>_.current&&s(K)).catch(()=>{})};F.useEffect(()=>{T();const K=setInterval(T,1e4);return()=>clearInterval(K)},[]);const N=l??[],D=F.useMemo(()=>z_(N,r),[N,r]),x=D.requests,C=j_(g,D),I=D[C];F.useEffect(()=>{C!==g&&m(C)},[C,g]);const A=I.find(K=>K.key===b)??I[0]??null,Q=K=>{y(me=>new Set(me).add(K)),Pb(K).then(()=>T()).catch(me=>_.current&&f(String(me))).finally(()=>{_.current&&y(me=>{const ce=new Set(me);return ce.delete(K),ce})})};if(F.useEffect(()=>{const K=me=>{if(sT(me.target)||me.metaKey||me.ctrlKey||me.altKey)return;const ce=I.findIndex(he=>he.key===(A==null?void 0:A.key)),Se=he=>{const M=I[Math.min(I.length-1,Math.max(0,ce+he))];M&&v(M.key)};me.key==="j"||me.key==="ArrowDown"?(me.preventDefault(),Se(1)):me.key==="k"||me.key==="ArrowUp"?(me.preventDefault(),Se(-1)):me.key==="Enter"&&A?ro(A.key):me.key==="r"&&A&&A.status!=="running"&&A.status!=="sent"&&Q(A.key)};return window.addEventListener("keydown",K),()=>window.removeEventListener("keydown",K)},[I,A==null?void 0:A.key]),u&&!l)return d.jsx("p",{className:"error",children:u});if(!l)return d.jsx("p",{className:"muted pad",children:"Loading…"});const V=I.reduce((K,me)=>K+(me.costUsd??0),0),ie=A?X_(A,r):null,H=A?p.has(A.key):!1,R=Ad.filter(K=>D[K].length>0),q=K=>d.jsxs("button",{className:`tab${C===K?" tab-on":""}${Ad.includes(K)?" tab-filed":""}${K==="requests"?" tab-requests":""}`,title:Cu[K].title,onClick:()=>m(K),children:[Cu[K].label," ",d.jsx("span",{className:"tab-count",children:D[K].length})]},K);return d.jsxs(d.Fragment,{children:[d.jsx(rT,{daemon:r}),u&&d.jsx("div",{className:"wrap",children:d.jsx("p",{className:"error",children:u})}),N.length===0?d.jsx("div",{className:"wrap",children:d.jsxs("div",{className:"empty",children:[r!=null&&r.enabled?d.jsxs("p",{children:["Inbox empty — nothing awaits your review.",r.lastPollError?" (Discovery is offline; check gh auth.)":""]}):d.jsx("p",{children:"No reviews yet."}),d.jsx(Rb,{autoFocus:!0})]})}):d.jsxs("div",{className:"wrap",children:[d.jsxs("div",{className:"tabs",children:[C_.map(q),R.length>0&&d.jsx("span",{className:"tab-split","aria-hidden":"true"}),R.map(q),d.jsx("span",{className:"grow"}),d.jsx(Rb,{}),V>0&&d.jsxs("span",{className:"faint",title:"What these reviews would cost at API token rates. Riding a Claude subscription, they draw on your usage limits instead.",children:["≈$",V.toFixed(2)," at API rates"]})]}),d.jsxs("div",{className:"table-head",children:[d.jsx("span",{className:"col-caret"}),d.jsx("span",{className:"col-slug",children:"repo#pr"}),d.jsx("span",{className:"col-author",children:"author"}),d.jsx("span",{className:"col-title",children:"title"}),d.jsx("span",{className:"col-comments",children:"c"}),d.jsx("span",{className:"col-size",children:"size"}),d.jsx("span",{className:"col-verdict",children:"verdict"}),d.jsx("span",{className:"col-age",children:"upd"})]}),I.length===0?d.jsx("div",{className:"empty-tab",children:C==="inbox"&&x.length>0?d.jsxs(d.Fragment,{children:[d.jsx("p",{children:F_(x)}),d.jsxs("button",{className:"btn",onClick:()=>m("requests"),children:[d.jsx(Ze,{name:"arrowRight"}),"show ",x.length===1?"it":`all ${x.length}`]})]}):d.jsx("p",{className:"muted",children:C==="inbox"?`Inbox empty — nothing awaits your review.${r!=null&&r.enabled&&r.lastPollError?" (Discovery is offline; check gh auth.)":""}`:`Nothing ${Cu[C].label} right now.`})}):I.map(K=>d.jsx(oT,{r:K,selected:K.key===(A==null?void 0:A.key),onSelect:()=>v(K.key),onOpen:()=>ro(K.key),awaiting:L_(K,x)?B_(K,r):null},K.key)),A&&ie&&d.jsxs("div",{className:"cursor-strip",children:[d.jsxs("div",{className:"cursor-strip-body",children:[d.jsxs("div",{className:"lab",children:[A.pr.owner,"/",A.pr.repo,"#",A.pr.number,A.pr.headRefName&&A.pr.baseRefName?` · ${A.pr.headRefName} → ${A.pr.baseRefName}`:""]}),d.jsx(cT,{text:ie.reasoning}),d.jsxs("div",{className:"cursor-strip-meta",children:[ie.meta.join(" · "),((J=A.sent)==null?void 0:J.url)&&d.jsxs(d.Fragment,{children:[" · ",d.jsx("a",{href:A.sent.url,target:"_blank",rel:"noreferrer",children:"view on GitHub"})]})]})]}),d.jsxs("div",{className:"cursor-strip-actions",children:[d.jsxs("button",{className:"btn-primary",onClick:()=>ro(A.key),children:[d.jsx(Ze,{name:"arrowRight"}),"open review ",d.jsx(za,{children:"↵"})]}),d.jsxs("div",{className:"cursor-strip-row",children:[d.jsxs("button",{className:"btn",disabled:A.status==="sent"||A.status==="skipped",title:"Set the local queue status to skipped. Nothing is sent.",onClick:()=>io(A.key,{status:"skipped"}).then(T).catch(K=>f(String(K))),children:[d.jsx(Ze,{name:"skip"}),"skip"]}),d.jsxs("button",{className:"btn",disabled:H||A.status==="running",title:A.status==="sent"?"Draft a review of the PR's current head. What you sent stays on GitHub.":"Draft a review of the PR's current head.",onClick:()=>Q(A.key),children:[d.jsx(Ze,{name:"rerun"}),H?"starting…":A.status==="awaiting"||A.status==="failed"?"review now":"re-review"]})]})]})]})]})]})}const go="cerber.theme";function Ny(l){return l==="light"||l==="dark"?l:"system"}function dT(){try{return Ny(localStorage.getItem(go))}catch{return"system"}}function Ty(l,a=document.documentElement){l==="system"?delete a.dataset.theme:a.dataset.theme=l}function fT(l,a){try{const r=a??localStorage;l==="system"?r.removeItem(go):r.setItem(go,l)}catch{}}function hT(){xy(Ty)}function xy(l){const a=r=>{(r.key===go||r.key===null)&&l(Ny(r.newValue))};return window.addEventListener("storage",a),()=>window.removeEventListener("storage",a)}function pT(){const[l,a]=F.useState(dT);return F.useEffect(()=>xy(a),[]),[l,s=>{fT(s),Ty(s),a(s)}]}const mT=[{rule:"@acme/*",meaning:"anyone in the acme org"},{rule:"@acme/devs",meaning:"anyone on that GitHub team"},{rule:"@teammate",meaning:"one person, by login"},{rule:"!@acme/contractors",meaning:"deny — beats every rule above"}],kb=l=>l instanceof Error?l.message:String(l),gT={unsupported:"this browser has no notifications to give",blocked:"this browser has blocked notifications for cerber",off:"tell me when a review is ready for me",ask:"tell me when a review is ready for me (the browser will ask first)",on:"tell me when a review is ready for me"},bT=[{choice:"system",label:"follow this machine"},{choice:"light",label:"light"},{choice:"dark",label:"dark"}],yT=[{choice:"mod-enter",label:"⌘↵ sends a chat message, Enter starts a new line"},{choice:"enter",label:"Enter sends a chat message, Shift+Enter starts a new line"}];function vT({daemonAnnounces:l}){const[a,r]=wy(),[s,u]=pT(),[f,p]=fy(),[y,g]=my(),[m,b]=F.useState(null),[v,_]=F.useState(""),[T,N]=F.useState(null),[D,x]=F.useState(!1);F.useEffect(()=>{m0().then(b).catch(A=>N(kb(A)))},[]);const C=A=>{x(!0),N(null),A.then(b).catch(Q=>N(kb(Q))).finally(()=>x(!1))};if(T&&!m)return d.jsx("p",{className:"error",children:T});if(!m)return d.jsx("p",{className:"muted",children:"Loading…"});const I=l&&m.daemon.poll&&m.daemon.notify;return d.jsxs("div",{className:"settings",children:[d.jsx("a",{href:"#/",className:"back",children:"← queue"}),d.jsx("h1",{children:"Inbox"}),d.jsx("p",{children:"By default cerber keeps the queue itself: it polls GitHub for PRs awaiting your review and drafts a review for each, so they're ready when you open the cockpit. Nothing is ever sent without you. Changes apply on the next poll — no restart."}),d.jsxs("label",{className:"inbox-toggle",children:[d.jsx("input",{type:"checkbox",checked:m.daemon.poll,disabled:D,onChange:A=>C(Lu({poll:A.target.checked}))})," ","poll GitHub for PRs awaiting my review (every ",m.daemon.intervalMinutes,"m)"]}),d.jsxs("label",{className:"inbox-toggle",children:[d.jsx("input",{type:"checkbox",checked:m.daemon.autoReview,disabled:D||!m.daemon.poll,onChange:A=>C(Lu({autoReview:A.target.checked}))})," ","draft a review automatically (off: awaiting PRs wait for a click)"]}),d.jsxs("p",{className:"muted",children:["Interval, concurrency and a repo filter live in ",d.jsx("code",{children:m.path})," under"," ",d.jsx("code",{children:"daemon"})," — hand-editable, like everything here."]}),d.jsx("h1",{children:"Notifications"}),d.jsx("p",{children:'When a PR is worth coming back for, cerber says so: one desktop notification per poll. With auto-review on that moment is the draft landing, not the PR arriving — a tap that leads to "no run yet" costs you the walk back and gives you nothing — and the notification names what the review found. A PR nobody is drafting (auto-review off, or a run that failed) is announced as it lands, since that is all the news there will be — and if a retry then drafts it after all, that is new news and you are told. Several at once fold into one notification, and a PR whose draft has been announced never arrives twice, however its next re-review ends.'}),d.jsxs("label",{className:"inbox-toggle",children:[d.jsx("input",{type:"checkbox",checked:m.daemon.notify,disabled:D||!m.daemon.poll,onChange:A=>C(Lu({notify:A.target.checked}))})," ","tell this machine when a review is ready for you (no cockpit tab required)"]}),d.jsxs("p",{className:"muted",children:["This is the one that works while you're somewhere else: it rides the poll, so it needs nothing open but ",d.jsx("code",{children:"serve"})," itself. It hands the notification to whatever this machine already has — Notification Centre on macOS,"," ",d.jsx("code",{children:"notify-send"})," on Linux — and stays quiet where there is neither. On macOS it"," ",d.jsx("strong",{children:"opens that review when you click it"}),', through a small app cerber builds for the job (the first one asks you to allow notifications from "Cerber"); a'," ",d.jsx("code",{children:"notify-send"})," tap announces the PR but has no click to give."]}),d.jsxs("label",{className:"inbox-toggle",children:[d.jsx("input",{type:"checkbox",checked:a==="on",disabled:a==="unsupported"||a==="blocked"||I,onChange:r})," ",I?"let this browser announce them instead":gT[a]]}),d.jsx("p",{className:"muted",children:I?d.jsx(d.Fragment,{children:"Standing down while the machine's own notification is on — two popups for one PR is one too many. Untick the machine one above and this browser takes over: it names the PR and opens that review on click just the same, but only while a cockpit tab is open and this browser has granted the permission."}):d.jsxs(d.Fragment,{children:["Per-browser, not per-machine: the permission belongs to this browser, so the switch lives here rather than in ",d.jsx("code",{children:m.path}),". Granting it is the browser's prompt, not cerber's — a browser that has blocked cerber has to be un-blocked from the padlock next to the address bar. Nothing is announced while you're looking straight at the cockpit."]})}),d.jsx("h1",{id:"appearance",children:"Appearance"}),d.jsx("div",{role:"radiogroup","aria-labelledby":"appearance",children:bT.map(({choice:A,label:Q})=>d.jsxs("label",{className:"inbox-toggle",children:[d.jsx("input",{type:"radio",name:"theme",checked:s===A,onChange:()=>u(A)})," ",Q]},A))}),d.jsxs("p",{className:"muted",children:["Per-browser, like the notification switch: it's about this screen, not your reviews, so it lives here rather than in ",d.jsx("code",{children:m.path}),"."]}),d.jsx("h1",{children:"Review page"}),d.jsxs("label",{className:"inbox-toggle",children:[d.jsx("input",{type:"checkbox",checked:f,onChange:A=>p(A.target.checked)})," ","keep chapter titles and file headers pinned while scrolling"]}),d.jsx("p",{className:"muted",children:"Ten files into a chapter you still see which one you're in, and the pinned title can open the chapter's explanation. Deep in a long file its name and Viewed box stay in reach. Per-browser, like the theme."}),yT.map(({choice:A,label:Q})=>d.jsxs("label",{className:"inbox-toggle",children:[d.jsx("input",{type:"radio",name:"send-key",checked:y===A,onChange:()=>g(A)})," ",Q]},A)),d.jsx("p",{className:"muted",children:"In the conversation with the reviewer. ⌘↵ sends under either choice, and the other boxes — comments, the review body, a handoff note — always take ⌘↵, since what goes in them runs to several lines. Per-browser, like the theme."}),d.jsx("h1",{children:"Trusted PRs"}),d.jsxs("p",{children:["Every review reads the PR's code. A ",d.jsx("strong",{children:"trusted"})," review may also run it — the test that covers the change, a typecheck, ",d.jsx("code",{children:"git log"})," — so it can report what happened instead of guessing. That means executing code from the PR on this machine, the same as checking the branch out and running the tests yourself."]}),d.jsxs("p",{className:"muted",children:["Trust the people, not the code: nothing about a PR can earn it. Rules live in"," ",d.jsx("code",{children:m.path}),"."]}),d.jsx("p",{className:"muted",children:'Only people can be trusted — there is no way to trust a repository. Anyone can open a PR against a repo you own, so trusting the repo would trust them too. Membership is checked against GitHub when the review runs, and a check that fails counts as "not a member".'}),d.jsxs("div",{className:"trust-add",children:[d.jsx("input",{value:v,"aria-label":"Trust rule",placeholder:"@org/*, @org/team, @login, !deny",disabled:D,onChange:A=>_(A.target.value),onKeyDown:A=>{A.key==="Enter"&&!D&&v.trim()&&(C(Du(v.trim())),_(""))}}),d.jsx("button",{className:"btn",disabled:D||!v.trim(),onClick:()=>{C(Du(v.trim())),_("")},children:"trust"})]}),T&&d.jsx("p",{className:"error",children:T}),m.trust.length===0?d.jsx("p",{className:"muted",children:"Nobody is trusted yet — every review reads the checkout and runs nothing."}):d.jsx("table",{className:"trust-table",children:d.jsx("tbody",{children:m.trust.map(A=>d.jsxs("tr",{className:A.denies?"trust-deny":void 0,children:[d.jsx("td",{children:d.jsx("code",{children:A.rule})}),d.jsx("td",{className:"muted",children:A.explanation}),d.jsx("td",{className:"trust-actions",children:d.jsx("button",{className:"btn",disabled:D,onClick:()=>C(Du(A.rule,!0)),children:"remove"})})]},A.rule))})}),d.jsx("h2",{children:"Rule syntax"}),d.jsx("table",{className:"trust-table",children:d.jsx("tbody",{children:mT.map(A=>d.jsxs("tr",{children:[d.jsx("td",{children:d.jsx("code",{children:A.rule})}),d.jsx("td",{className:"muted",children:A.meaning})]},A.rule))})}),d.jsxs("p",{className:"muted",children:["A trusted review is handed no GitHub credentials — no token, no ",d.jsx("code",{children:"gh"})," login, no git or ssh identity — so a push fails to authenticate rather than being merely discouraged. It is not a sandbox though: it has ",d.jsx("code",{children:"Bash"})," and this machine, so trust people you would let run their branch here anyway. The daemon reviews unattended, so with rules set it runs matching PRs' code with nobody watching — start it with ",d.jsx("code",{children:"--no-trust"})," to prevent that."]})]})}function Ob(){const l=window.location.hash,a=l.match(/^#\/r\/(.+)$/);return a?{view:"detail",key:decodeURIComponent(a[1])}:l==="#/settings"?{view:"settings"}:{view:"queue"}}const Cb={unsupported:"",blocked:"This browser blocked notifications for cerber. Turn them back on in its site settings — the padlock next to the address bar.",off:"Notifications off. Click to be told when a review is ready for you.",ask:"Click to be told when a review is ready for you — the browser will ask you first.",on:"Telling you when a review is ready for you. Click to stop."},Mb="cerber taps this machine itself when a PR is worth coming back for — no tab required. The browser's own bell would be a second popup about one PR, so it stands down. Turn the machine one off in Settings to have this browser announce them instead.";function ET({daemonAnnounces:l}){const[a,r]=wy();return l?d.jsx("span",{className:"topbar-link bell bell-daemon",role:"img",title:Mb,"aria-label":Mb,children:d.jsx(Ze,{name:"bell",size:15})}):a==="unsupported"?null:d.jsx("button",{className:`topbar-link bell bell-${a}`,title:Cb[a],"aria-label":Cb[a],"aria-pressed":a==="on",onClick:r,children:d.jsx(Ze,{name:a==="on"?"bell":"bellOff",size:15})})}function _T(){const[l,a]=F.useState(Ob()),r=lT();return F.useEffect(()=>{const s=()=>a(Ob());return window.addEventListener("hashchange",s),()=>window.removeEventListener("hashchange",s)},[]),l.view==="detail"?d.jsx("div",{className:"app",children:d.jsx(FN,{reviewKey:l.key})}):d.jsxs("div",{className:"app",children:[d.jsx("header",{className:"topbar",children:d.jsxs("div",{className:"bar-inner",children:[d.jsxs("a",{href:"#/",className:"brand",children:[d.jsx(NS,{}),"cerber"]}),d.jsx("span",{className:"tagline",children:"nothing reaches GitHub until you say so"}),d.jsx("span",{className:"grow"}),l.view==="queue"&&d.jsxs(d.Fragment,{children:[d.jsxs("span",{className:"hint",children:[d.jsx(za,{children:"j"}),d.jsx(za,{children:"k"}),"move"]}),d.jsxs("span",{className:"hint",children:[d.jsx(za,{children:"↵"}),"open"]}),d.jsxs("span",{className:"hint",children:[d.jsx(za,{children:"r"}),"review now"]})]}),d.jsx(ET,{daemonAnnounces:r}),d.jsx("a",{href:"#/settings",className:"topbar-link",title:"settings","aria-label":"settings",children:d.jsx(Ze,{name:"settings",size:15})})]})}),l.view==="queue"?d.jsx(uT,{}):d.jsx(vT,{daemonAnnounces:r})]})}hT();HE.createRoot(document.getElementById("root")).render(d.jsx(LE.StrictMode,{children:d.jsx(_T,{})}));
250
+ `),C.refs),children:"ask again"})," ",d.jsx("button",{className:"btn btn-sm",onClick:()=>o0(a).then(f).catch(H=>N(String(H.message??H))),children:"dismiss"})]})]}):d.jsx("div",{className:"chat-waiting",children:C.progress.length>0?d.jsx("ol",{className:"chat-progress",children:C.progress.map((H,R)=>d.jsx("li",{className:R===C.progress.length-1?"now":void 0,children:H},R))}):"Thinking… it re-reads the code before answering."})]})]}),p?d.jsx("p",{className:"faint",children:"This review was sent — the conversation is kept as a record, but it can't continue."}):d.jsxs(d.Fragment,{children:[r.length>0&&d.jsxs("div",{className:"chat-refs chat-refs-pending",children:[d.jsx("span",{className:"faint",children:"about:"}),r.map((H,R)=>d.jsxs("button",{className:"chat-ref",onClick:()=>u(R),title:"Remove",children:[Hd(H,l)," ✕"]},R))]}),d.jsx("textarea",{ref:y,className:"chat-input",rows:2,value:m,readOnly:v,placeholder:I?"steer it — it reads this before its next step":x.length===0?"the summary restates the author's claims — say what you actually verified":"say more…",onChange:H=>b(H.target.value),title:D==="enter"?"Enter sends · Shift+Enter for a new line":"⌘↵ sends · Enter for a new line",onKeyDown:H=>{yN(D,{...H,isComposing:H.nativeEvent.isComposing})&&(H.preventDefault(),ie())}}),d.jsx(Ys,{className:"chat-turn-body",text:m}),d.jsxs("div",{className:"chat-actions",children:[d.jsxs("button",{className:"btn btn-dark",onClick:ie,disabled:v||m.trim()==="",title:I?"Add this to the turn it's working on":void 0,children:[d.jsx(Ze,{name:"send"}),v?"sending…":I?"steer":"send message",d.jsx(za,{children:D==="enter"?"↵":"⌘↵"})]}),d.jsx("span",{className:"grow"}),l.preChat&&d.jsx("button",{className:"btn btn-sm",disabled:A,title:"Put the review back the way the AI first wrote it. The conversation stays.",onClick:()=>{_(!0),c0(a).then(f).catch(H=>N(String(H.message??H))).finally(()=>_(!1))},children:"reset the review"})]})]}),T&&d.jsx("div",{className:"error",children:T})]})]})}function vy(l){const a=F.useRef(null),r=F.useCallback(()=>{const s=a.current;s&&(s.style.height="auto",s.style.height=`${Math.min(s.scrollHeight+2,window.innerHeight*.7)}px`)},[]);return F.useEffect(r,[l,r]),F.useEffect(()=>(window.addEventListener("resize",r),()=>window.removeEventListener("resize",r)),[r]),a}function UN({initial:l,onSave:a,onCancel:r}){const[s,u]=F.useState(l),[f,p]=F.useState(!1),[y,g]=F.useState(null),m=vy(s),b=()=>{f||(p(!0),g(null),a(s).catch(v=>{g(String((v==null?void 0:v.message)??v)),p(!1)}))};return d.jsxs("div",{className:"body-edit-wrap",children:[d.jsx("textarea",{ref:m,className:"body-edit",autoFocus:!0,value:s,onChange:v=>u(v.target.value),rows:10,onKeyDown:v=>{v.key==="Enter"&&(v.metaKey||v.ctrlKey)&&(v.preventDefault(),b()),v.key==="Escape"&&!f&&r()}}),d.jsx(Ys,{className:"body-md",text:s}),y&&d.jsx("p",{className:"error",children:y}),d.jsxs("div",{className:"card-actions",children:[d.jsxs("button",{className:"btn btn-sm",onClick:b,disabled:f,children:[f?"saving…":"save this body",d.jsx(za,{children:"⌘↵"})]}),d.jsx("button",{className:"btn btn-sm",onClick:r,disabled:f,children:"cancel"}),d.jsx("span",{className:"faint",children:"this is exactly what posts — the review above stays as it reads"})]})]})}const BN=l=>l?`@${l} — handing this review over to you.`:"";function IN({artifact:l,reviewKey:a,onConfirm:r,onCancel:s}){const[u]=F.useState(Qb),[f,p]=F.useState(""),[y,g]=F.useState(""),[m,b]=F.useState(!1),[v,_]=F.useState(!1),[T,N]=F.useState(null),[D,x]=F.useState(null),[C,I]=F.useState(null),[A,Q]=F.useState(!1),[V,ie]=F.useState(null),[H,R]=F.useState(null),[q,J]=F.useState(!1),[K,me]=F.useState(-1),ce=vy(y),Se=F.useRef(null),he=kd(f),M=Vb(he),ee=l.summary!==""||l.comments.length>0,fe=!_b(l)&&ee,we=_b(l)&&l.sent==null&&ee,Le=A?JSON.stringify([l.bodyOverride,l.summary,l.chapters.map(Z=>[Z.title,Z.explanation]),l.comments.map(Z=>{var ye,Ne;return[Z.path,Z.line,Z.body,Z.severity,Z.status,Z.drifted,(ye=Z.alreadyRaised)==null?void 0:ye.decision,(Ne=Z.alreadyRaised)==null?void 0:Ne.where]})]):"";F.useEffect(()=>{if(!A)return;let Z=!1;return R(null),ie(null),Kb(a,"COMMENT").then(ye=>!Z&&ie(ye)).catch(ye=>{Z||(ie(null),R(String((ye==null?void 0:ye.message)??ye)))}),()=>{Z=!0}},[A,a,Le]);const S=!A||V!=null;F.useEffect(()=>{var Z;K<0||(Z=document.getElementById(`handoff-option-${K}`))==null||Z.scrollIntoView({block:"nearest"})},[K]);const z=F.useMemo(()=>E0(D??[],u),[D,u]),B=F.useMemo(()=>_0(z,f),[z,f]);F.useEffect(()=>{let Z=!1;return f0(a).then(ye=>!Z&&x(ye.logins)).catch(ye=>!Z&&I(String((ye==null?void 0:ye.message)??ye))),()=>{Z=!0}},[a]);const se=Z=>{p(Z),m||g(BN(kd(Z)))},pe=Z=>{se(Z),J(!1),me(-1)};F.useLayoutEffect(()=>{var Z;(Z=Se.current)==null||Z.showModal()},[]);const ve=()=>{v||!M||!S||(_(!0),N(null),r(he,y.trim(),A).catch(Z=>{N(String((Z==null?void 0:Z.message)??Z)),_(!1)}))};return d.jsx("dialog",{className:"handoff-dialog",ref:Se,"aria-label":`Hand off ${l.id}`,onCancel:Z=>{Z.preventDefault(),v||s()},onClick:Z=>{Z.target===Se.current&&!v&&s()},children:d.jsxs("div",{className:"handoff-body",children:[d.jsxs("div",{className:"send-top",children:[d.jsx("span",{className:"lab",children:"hand off"}),d.jsx("span",{className:"grow"}),d.jsx("span",{className:"faint",children:l.id})]}),d.jsxs("div",{className:"handoff-who",children:[d.jsx("span",{className:"handoff-at",children:"@"}),d.jsxs("div",{className:"handoff-combo",children:[d.jsx("input",{className:"handoff-login",autoFocus:!0,value:f,spellCheck:!1,placeholder:"github login",role:"combobox","aria-expanded":q&&B.length>0,"aria-controls":"handoff-options","aria-autocomplete":"list","aria-activedescendant":K>=0?`handoff-option-${K}`:void 0,onFocus:()=>J(!0),onBlur:()=>J(!1),onChange:Z=>{se(Z.target.value),J(!0),me(0)},onKeyDown:Z=>{const ye=q&&B.length>0;if(Z.key==="ArrowDown"||Z.key==="ArrowUp"){if(Z.preventDefault(),!ye)return J(!0);const Ne=Z.key==="ArrowDown"?1:-1;me(Ge=>(Ge+Ne+B.length)%B.length);return}if(Z.key==="Enter"){const Ne=ye&&K>=0?B[K]:void 0;Ne&&Ne.login.toLowerCase()!==he.toLowerCase()?pe(Ne.login):ve();return}Z.key==="Escape"&&ye&&(Z.preventDefault(),J(!1),me(-1))}}),q&&B.length>0&&d.jsx("ul",{className:"handoff-options",id:"handoff-options",role:"listbox",children:B.map((Z,ye)=>d.jsxs("li",{id:`handoff-option-${ye}`,role:"option","aria-selected":ye===K,className:ye===K?"on":void 0,onMouseEnter:()=>me(ye),onMouseDown:Ne=>{Ne.preventDefault(),pe(Z.login)},children:[d.jsxs("span",{className:"handoff-option-login",children:["@",Z.login]}),Z.recent&&d.jsx("span",{className:"faint",children:"handed to before"})]},Z.login))})]})]}),C&&d.jsx("p",{className:"faint handoff-who-note",children:"cerber could not read who this repo takes reviews from — type the login instead."}),d.jsx("textarea",{ref:ce,className:"body-edit",rows:2,value:y,onChange:Z=>{b(!0),g(Z.target.value)},onKeyDown:Z=>{Z.key==="Enter"&&(Z.metaKey||Z.ctrlKey)&&(Z.preventDefault(),ve())}}),d.jsxs("div",{className:"body-source",children:[d.jsx("span",{className:"faint",children:y.trim()?"goes on the PR as a plain comment, not a review":"nothing will be posted — only the review request moves"}),y.trim()!==""&&d.jsx("button",{className:"link",onClick:()=>{b(!0),g("")},disabled:v,children:"post no note"})]}),we&&d.jsx("p",{className:"faint handoff-says",children:"You already reviewed this PR, so this draft can't ride along — a handoff that carried it would be your second review. Send it yourself if that is what you mean."}),fe&&d.jsxs("div",{className:"handoff-with-review",children:[d.jsxs("label",{children:[d.jsx("input",{type:"checkbox",checked:A,disabled:v,onChange:Z=>Q(Z.target.checked)}),d.jsxs("span",{children:["also post the review — ",d.jsx("span",{className:"faint",children:Bd(l)})]})]}),A&&d.jsxs(d.Fragment,{children:[d.jsxs("p",{className:"faint",children:["Posts as a ",d.jsx("strong",{children:"comment"}),", never an approval or a change request: you are handing over the verdict, so it is @",M?he:"them","'s to make. The findings keep their grades."]}),H?d.jsxs("p",{className:"error",children:["cerber could not build the body this would post, so it will not post one:"," ",H]}):V?d.jsx("pre",{className:"body-preview",children:V.body}):d.jsx("p",{className:"faint",children:"building the body…"})]})]}),T&&d.jsx("p",{className:"error",children:T}),d.jsxs("p",{className:"faint handoff-says",children:[M?d.jsxs(d.Fragment,{children:["@",he]}):"They"," will be asked for this review and you will be taken off it."," ",A?"This row goes under sent, with the review on the PR.":l.sent?"This row stays under sent.":"This row is filed under settled, and comes back if anybody asks you again."]}),d.jsxs("div",{className:"card-actions",children:[d.jsxs("button",{className:"btn btn-sm",onClick:ve,disabled:v||!M||!S,children:[d.jsx(Ze,{name:"arrowRight"}),v?"handing over…":M?`hand off to @${he}`:"hand off",d.jsx(za,{children:"⌘↵"})]}),d.jsx("button",{className:"btn btn-sm",onClick:s,disabled:v,children:"cancel"})]})]})})}function HN({artifact:l,reviewKey:a,event:r,sending:s,checking:u,onSend:f,error:p,footer:y,next:g,onAdvance:m,onBody:b,anchorRef:v}){const[_,T]=F.useState(null),[N,D]=F.useState(null),[x,C]=F.useState(l.bodyOverride!=null),[I,A]=F.useState(!1),Q=l.bodyOverride!=null,V=l.priorSends??[];F.useEffect(()=>{Q&&C(!0)},[Q]);const ie=x&&!I?JSON.stringify([l.bodyOverride,l.summary,l.chapters.map(H=>[H.title,H.explanation]),l.comments.map(H=>{var R,q;return[H.path,H.line,H.body,H.severity,H.status,H.drifted,(R=H.alreadyRaised)==null?void 0:R.decision,(q=H.alreadyRaised)==null?void 0:q.where]})]):"";return F.useEffect(()=>{if(!x||I)return;let H=!1;return T(null),D(null),Kb(a,r).then(R=>{H||(T(R),D(null))}).catch(R=>{H||D(String(R))}),()=>{H=!0}},[a,r,ie,x,I]),l.sent?d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"sent-strip",ref:v,children:[d.jsxs("strong",{children:["✔ sent as ",Ud[l.sent.event]]}),d.jsxs("span",{className:"faint",children:[new Date(l.sent.at).toLocaleString()," · ",Bd(l),l.sent.auto?" · auto-sent by the daemon":"",V.length>0?` · review ${Sb(l)} on this PR`:""]}),d.jsx("span",{className:"grow"}),l.sent.url&&d.jsxs("a",{href:l.sent.url,target:"_blank",rel:"noreferrer",children:["view on GitHub ",d.jsx(Ze,{name:"external"})]}),d.jsxs("button",{className:"btn",onClick:m,children:[g?`next review: ${g.pr.repo}#${g.pr.number}`:"back to the queue",d.jsx(Ze,{name:"arrowRight"})]})]}),d.jsx("div",{className:"post-actions",children:y})]}):d.jsxs("div",{className:"send-panel",ref:v,children:[d.jsxs("div",{className:"send-top",children:[d.jsx("span",{className:"lab",children:"send to github"}),d.jsx("span",{className:"grow"}),d.jsx("span",{className:"faint",children:Bd(l)}),d.jsxs("button",{className:"link",onClick:()=>C(!x),disabled:I,title:I?"save or cancel the body you are writing first":void 0,children:[d.jsx(Ze,{name:"eye"}),x?"hide what gets posted":"see what gets posted"]})]}),V.length>0&&d.jsxs("p",{className:"send-note",children:["This posts review ",Sb(l)+1," on this PR. What you sent before stays on GitHub — a new one sits beside it rather than replacing it."]}),d.jsx("div",{className:"send-action",children:d.jsxs("button",{className:`send-btn tone-bg-${cN[r]}`,disabled:s||u,onClick:f,children:[d.jsx(Ze,{name:r==="APPROVE"?"approve":r==="COMMENT"?"comment":"changes",size:15}),s?"sending…":u?"checking what others already raised…":`${Ud[r]} on ${l.id}`," ",d.jsx(za,{children:"s"})]})}),p&&d.jsx("p",{className:"error",children:p}),x&&d.jsxs(d.Fragment,{children:[N&&d.jsx("p",{className:"error",children:N}),_?I?d.jsx(UN,{initial:_.body,onSave:H=>b(H).then(()=>A(!1)),onCancel:()=>A(!1)}):d.jsxs(d.Fragment,{children:[d.jsx("pre",{className:"body-preview",children:_.body}),d.jsxs("div",{className:"body-source",children:[Q?d.jsxs(d.Fragment,{children:[d.jsx("span",{className:"faint",children:"you wrote this body — it no longer follows the summary or the comments"}),d.jsx("button",{className:"link",onClick:()=>b(null).catch(H=>D(String((H==null?void 0:H.message)??H))),children:"build it from the review again"})]}):d.jsx("span",{className:"faint",children:"built from the summary, the walkthrough and the folded comments"}),d.jsxs("button",{className:"link",onClick:()=>A(!0),children:[d.jsx(Ze,{name:"edit"}),Q?"keep editing it":"write it yourself"]})]})]}):!N&&d.jsx("p",{className:"faint",children:"building the body…"})]}),d.jsx("div",{className:"send-footer",children:y})]})}function xb({sends:l}){const a=l[l.length-1],r=l.length===1,s=f=>new Date(f).toLocaleDateString(),u=Ud[a.event];return d.jsxs("div",{children:[d.jsxs("strong",{children:["You already sent ",r?"a review":`${l.length} reviews`," on this PR",r?"":", the last"," on ",s(a.at),r?` — ${u}`:` as ${u}`,"."]})," ",a.url?d.jsx("a",{href:a.url,target:"_blank",rel:"noreferrer",children:r?"It is still on GitHub":"The last is still on GitHub"}):r?"It is still on GitHub":"The last is still on GitHub",", untouched by the draft below — a re-review replaces what cerber holds, never what was posted. Sending this one would be review ",l.length+1,"."]})}function qN({filed:l}){var s,u,f;const a=((s=l.review)==null?void 0:s.url)??((u=l.reply)==null?void 0:u.url)??null,r=p=>new Date(p).toLocaleDateString();return l.reason==="own-reply"&&l.reply?d.jsxs("div",{children:[d.jsxs("strong",{children:["You answered on this PR on ",r(l.reply.at),", and nobody has replied since."]})," ","So cerber filed this draft under settled: GitHub does not count a"," ",a?d.jsx("a",{href:a,target:"_blank",rel:"noreferrer",children:"comment"}):"comment"," ","as a review, but the PR is with its author either way. Nothing here was changed or sent — the draft is still yours to send."]}):l.reason==="request-withdrawn"?d.jsxs("div",{children:[d.jsx("strong",{children:"Nobody is asking for this review any more."})," The request that put this PR in the inbox was taken back on or before ",r(l.at),", and you had said nothing on the PR, so cerber filed the draft under settled rather than leaving it out for you. Nothing here was changed or sent — the draft is still yours to send."]}):d.jsxs("div",{children:[d.jsxs("strong",{children:["You reviewed this PR on GitHub on ",r(((f=l.review)==null?void 0:f.at)??l.at),"."]})," ","So cerber filed this draft under settled, GitHub having stopped asking you for a review and shown one of your own"," ",a?d.jsx("a",{href:a,target:"_blank",rel:"noreferrer",children:"already on the PR"}):"already on the PR",". Nothing here was changed or sent — the draft is still yours to send."]})}function GN({entries:l,open:a,onToggle:r,anchorRef:s}){const u=f=>{const p=new Date(f);return Number.isNaN(p.getTime())?f:`${p.toLocaleDateString(void 0,{month:"short",day:"2-digit"})} ${p.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}`};return d.jsxs("section",{className:"card",ref:s,children:[d.jsxs("header",{className:"card-head",children:[d.jsx("h2",{children:"history"}),d.jsx("span",{className:"faint",children:l.length>0?`${l.length} entr${l.length===1?"y":"ies"} — what cerber did to this row, and when`:"nothing recorded"}),d.jsx("span",{className:"grow"}),d.jsxs("button",{className:"btn btn-sm","aria-expanded":a,onClick:r,children:[d.jsx(Ze,{name:a?"up":"down",size:12}),a?"hide":"show"]})]}),a&&d.jsx("div",{className:"card-body",children:l.length===0?d.jsx("div",{className:"faint",children:"This review predates cerber keeping a history — it starts at the next thing that happens to it."}):d.jsx("ol",{className:"history",children:l.map((f,p)=>({e:f,i:p})).reverse().map(({e:f,i:p})=>d.jsxs("li",{className:"history-row",title:f.at,children:[d.jsx("span",{className:"history-at",children:u(f.at)}),d.jsx("span",{className:"history-by",children:f.by}),d.jsx("span",{className:"history-what",children:f.what}),f.cause&&d.jsx("span",{className:"history-cause",children:f.cause})]},`${p}-${f.at}`))})})]})}function $N({handoff:l,sent:a,hasDraft:r}){const s=new Date(l.at).toLocaleDateString();return d.jsxs("div",{children:[d.jsxs("strong",{children:["You handed this to @",l.to," on ",s,"."]})," ","GitHub asks them for this review now",l.withdrewYours?" and no longer asks you":" — but cerber could not take your own request off, so it is asking both of you","."," ",l.note?l.note.url?d.jsxs(d.Fragment,{children:["A"," ",d.jsx("a",{href:l.note.url,target:"_blank",rel:"noreferrer",children:"note"})," ","on the PR says so."]}):d.jsx(d.Fragment,{children:"A note on the PR says so."}):d.jsx(d.Fragment,{children:"No note was posted — only the request moved."})," ",a?d.jsx(d.Fragment,{children:"Your review of it is on the PR — the draft below is what went."}):r?d.jsx(d.Fragment,{children:"The draft below was never sent. It is still yours to read, or to send."}):d.jsx(d.Fragment,{children:"Nothing was drafted here, and nothing was sent."})]})}function YN({artifact:l,freshness:a,rerunning:r,onRerun:s}){const u=l.status==="running",f=(a==null?void 0:a.prState)??l.pr.state,p=f==="CLOSED"||f==="MERGED",y=l.refresh,g=a!=null&&a.changed?y:null,m=!p&&dN(l,a)?l.sent:null;if(u)return d.jsxs("div",{className:"freshness",children:[(l.sent?[]:l.priorSends??[]).length>0&&d.jsx(xb,{sends:l.priorSends??[]}),d.jsxs("div",{className:"freshness-running",children:[d.jsx("strong",{children:"Re-reviewing…"})," Claude is reading the current head. This page updates itself when the run lands — it takes a few minutes."]})]});const b=l.filed,v=l.handoff,_=l.sent?[]:l.priorSends??[];return!p&&!g&&!m&&!b&&!v&&_.length===0?null:d.jsxs("div",{className:"freshness",children:[_.length>0&&d.jsx(xb,{sends:_}),v&&d.jsx($N,{handoff:v,sent:l.sent,hasDraft:l.summary!==""||l.comments.length>0}),b&&d.jsx(qN,{filed:b}),p&&d.jsxs("div",{children:[d.jsxs("strong",{children:["This PR is ",f==="MERGED"?"merged":"closed","."]})," A review can still be sent, but nobody is waiting for it."]}),g&&d.jsxs("div",{children:[d.jsx("strong",{children:"The PR moved on since this review."})," Now at"," ",d.jsx("code",{children:g.toSha.slice(0,7)}),", reviewed at"," ",d.jsx("code",{children:g.fromSha.slice(0,7)}),"."," ",g.moved>0&&d.jsxs(d.Fragment,{children:[g.moved," comment(s) followed the code. "]}),g.drifted>0&&d.jsxs(d.Fragment,{children:[g.drifted," could not — the code they point at is gone, so they will post in the review body instead of inline."," "]}),"The summary and verdict still describe the commit that was reviewed.",!l.sent&&d.jsx("button",{className:"btn btn-sm",disabled:r,onClick:()=>s(),children:r?"starting…":"re-review at the new head"})]}),m&&d.jsxs("div",{children:[d.jsx("strong",{children:"The PR moved on since you sent this review."})," ",(a==null?void 0:a.headSha)&&l.pr.headSha&&d.jsxs(d.Fragment,{children:["Now at ",d.jsx("code",{children:a.headSha.slice(0,7)}),", sent at"," ",d.jsx("code",{children:l.pr.headSha.slice(0,7)}),"."," "]}),"What you sent stays exactly as it was posted — cerber never re-anchors a review that is already on GitHub. Answering the new commits means a new draft, which replaces this one here and leaves what was posted alone.",d.jsx("button",{className:"btn btn-sm",disabled:r,onClick:()=>s(),children:r?"starting…":"re-review at the new head"})]})]})}function FN({reviewKey:l}){var va,Wn,Ea,Jt,Fn;const[a,r]=F.useState(null),[s,u]=F.useState(null),[f,p]=F.useState(null),[y,g]=F.useState(null),[m,b]=F.useState(!1),[v,_]=F.useState([]),[T,N]=F.useState(new Set),D=G=>N(de=>new Set(de).add(G)),[x,C]=F.useState(!1),[I,A]=F.useState([]),Q=F.useRef(null),[V,ie]=F.useState(new Set),[H,R]=F.useState(new Set),q=F.useRef(Promise.resolve()),J=F.useRef(0),[K,me]=F.useState(0),ce=F.useRef(new Map),[Se]=fy(),[he,M]=F.useState(null),ee=F.useRef(null),fe=F.useRef(null),we=F.useRef(null),Le=F.useRef(null),S=F.useRef(null),z=F.useRef(null),[B,se]=F.useState(!1),pe=F.useRef(null),[ve,Z]=F.useState(!1),[ye,Ne]=F.useState(!1),[Ge,$e]=F.useState(null),[Me,Dt]=F.useState(null);F.useEffect(()=>{if(!Me)return;const G=setTimeout(()=>Dt(null),1800);return()=>clearTimeout(G)},[Me]);const Pe=G=>{var de,ge;A(Te=>Te.some(Ye=>Ye.target===G.target&&Ye.id===G.id)?Te:[...Te,G]),(de=Q.current)==null||de.scrollIntoView({behavior:"smooth",block:"center"}),(ge=Q.current)==null||ge.focus()};F.useEffect(()=>{let G=!1;return window.scrollTo({top:0}),r(null),u(null),p(null),g(null),$e(null),Ne(!1),ug(l).then(de=>{if(!G)return r(de),s0(l).then(ge=>{G||(p(ge),ge.changed&&r(ge.artifact))}).catch(ge=>!G&&g(String(ge.message??ge))).then(()=>{if(!(G||de.sent||de.status==="running"||de.comments.length===0))return Ne(!0),d0(l).then(ge=>!G&&r(ge)).catch(()=>{}).finally(()=>!G&&Ne(!1))})}).catch(de=>!G&&u(String(de))),()=>{G=!0}},[l]),F.useEffect(()=>{Qd().then(_).catch(()=>{})},[]),F.useEffect(()=>{const G=pe.current;if(!G)return;const de=()=>document.documentElement.style.setProperty("--top-h",`${G.offsetHeight}px`);de();const ge=new ResizeObserver(de);return ge.observe(G),()=>{ge.disconnect(),document.documentElement.style.removeProperty("--top-h")}},[a==null?void 0:a.id]);const Hn=(a==null?void 0:a.pendingChat)!=null&&a.pendingChat.error==null,it=F.useRef(null),fn=((va=a==null?void 0:a.raisedCheck)==null?void 0:va.checkingSince)!=null||ye;F.useEffect(()=>{if((a==null?void 0:a.status)!=="running"&&!Hn&&!fn)return;const G=setInterval(()=>{ug(l).then(de=>{var ge;if(r(de),de.status!=="running"){b(!1);const Te=it.current;Te!=null&&de.sent&&(((ge=de.run)==null?void 0:ge.startedAt)??"none")===Te&&u("The re-review didn't start, so nothing here changed — the review you sent is untouched. The history below says why."),it.current=null}}).catch(()=>{})},3e3);return()=>clearInterval(G)},[a==null?void 0:a.status,Hn,fn,l]);const Ot=(a==null?void 0:a.sent)!=null,Gt=F.useMemo(()=>M_(v,l,T),[v,l,T]),Wt=Gt.findIndex(G=>G.key===l),Lt=(Wt>0?Gt[Wt-1]:null)??null,vt=(Wt>=0&&Wt<Gt.length-1?Gt[Wt+1]:null)??null,Ln=G=>{window.location.hash=`#/r/${encodeURIComponent(G)}`},lt=()=>{vt?Ln(vt.key):window.location.hash="#/"},mt=F.useMemo(()=>{if(!a)return[];const G=R_(a.diff,a.chapters);return G.length>0?[...a.chapters,{id:"__other",title:"other changes",explanation:"Files not assigned to any chapter by the AI.",files:G}]:a.chapters},[a]);F.useEffect(()=>{let G=0;const de=()=>{var Re;G=0;const Ye=parseFloat(getComputedStyle(document.documentElement).getPropertyValue("--top-h"))||0,un=Ye+16;let oe=null;for(const Be of mt){const Je=(Re=ce.current.get(Be.id))==null?void 0:Re.getBoundingClientRect();Je&&Je.top<=un&&Je.bottom>un&&(oe={id:Be.id,stuck:Je.top<Ye-1})}M(Be=>(Be==null?void 0:Be.id)===(oe==null?void 0:oe.id)&&(Be==null?void 0:Be.stuck)===(oe==null?void 0:oe.stuck)?Be:oe)},ge=()=>{G||(G=requestAnimationFrame(de))};de(),window.addEventListener("scroll",ge,{passive:!0}),window.addEventListener("resize",ge);const Te=new ResizeObserver(ge);return Te.observe(document.body),()=>{cancelAnimationFrame(G),window.removeEventListener("scroll",ge),window.removeEventListener("resize",ge),Te.disconnect()}},[mt]);const At=F.useMemo(()=>{const G=k_((a==null?void 0:a.diff)??""),de=new Set(ja((a==null?void 0:a.diff)??"").filter(Te=>cf(Te.path)&&uf(Te.patch).isNew).map(Te=>Te.path)),ge=Te=>{const Ye=G.get(Te)??0;return de.has(Te)?Math.round(Ye/4):Ye};return new Map(mt.map(Te=>[Te.id,Te.files.reduce((Ye,un)=>Ye+ge(un),0)]))},[a==null?void 0:a.diff,mt]),_n=G=>{const de=At.get(G)??0;return de>MN?de:null},hn=G=>V.has(G)?_n(G)!=null:_n(G)==null,qn=G=>ie(de=>{const ge=new Set(de);return ge.has(G)?ge.delete(G):ge.add(G),ge});F.useEffect(()=>{ie(new Set),R(new Set)},[l]);const Sn=F.useMemo(()=>Object.fromEntries(ja((a==null?void 0:a.diff)??"").map(G=>[G.path,O_(G.patch)])),[a==null?void 0:a.diff]),wn=F.useMemo(()=>new Set(Object.keys(Sn).filter(G=>{var de;return((de=a==null?void 0:a.viewed)==null?void 0:de[G])===Sn[G]})),[Sn,a==null?void 0:a.viewed]),It={viewed:wn,peeked:H,onToggleViewed:G=>{const de=wn.has(G)?null:Sn[G]??null;R(Te=>{const Ye=new Set(Te);return Ye.delete(G),Ye}),r(Te=>{if(!Te)return Te;const Ye={...Te.viewed};return de===null?delete Ye[G]:Ye[G]=de,{...Te,viewed:Ye}});const ge=++J.current;q.current=q.current.then(()=>t0(l,G,de)).then(Te=>{ge===J.current&&r(Ye=>Ye&&Ye.id===Te.id?{...Ye,viewed:Te.viewed}:Ye)}).catch(Te=>u(String(Te)))},onTogglePeek:G=>R(de=>{const ge=new Set(de);return ge.has(G)?ge.delete(G):ge.add(G),ge})},pn=G=>{const de=mt[G];return de?(me(G),hn(de.id)||qn(de.id),de):null},Rt=(...G)=>{for(const de of G)if(de.current)return de.current.scrollIntoView({behavior:"smooth",block:"start"})},Gn=G=>{var ge;const de=pn(G);de&&((ge=ce.current.get(de.id))==null||ge.scrollIntoView({behavior:"smooth",block:"start"}))},$n=(G,de)=>{var Te;pn(G);const ge=(Te=a==null?void 0:a.comments.find(Ye=>Ye.id===de))==null?void 0:Te.path;ge&&wn.has(ge)&&R(Ye=>new Set(Ye).add(ge)),Dt(de),gy(de)},mn=uN(a==null?void 0:a.verdict);F.useEffect(()=>$e(null),[mn]);const He=()=>{!a||a.sent||ve||fn||(Z(!0),$e(null),u0(l,mn).then(({replyError:G,...de})=>{r(de),G&&$e(`Sent — but ${G}`),D(l)}).catch(G=>$e(String(G.message??G))).finally(()=>Z(!1)))};if(F.useEffect(()=>{const G=de=>{wN(de.target)||de.metaKey||de.ctrlKey||de.altKey||(de.key==="["&&Lt?Ln(Lt.key):de.key==="]"&&vt?Ln(vt.key):de.key==="n"?Gn(Math.min(mt.length-1,K+1)):de.key==="N"?Gn(Math.max(0,K-1)):de.key==="s"&&!Ot&&He())};return window.addEventListener("keydown",G),()=>window.removeEventListener("keydown",G)},[Lt==null?void 0:Lt.key,vt==null?void 0:vt.key,mt,K,Ot,mn,a==null?void 0:a.sent,ve,fn]),s&&!a)return d.jsx("p",{className:"error pad",children:s});if(!a)return d.jsx("p",{className:"muted pad",children:"Loading…"});const gn=G=>{var de;b(!0),u(null),it.current=a.sent?((de=a.run)==null?void 0:de.startedAt)??"none":null,Pb(l,G).then(r).catch(ge=>{u(String(ge)),b(!1)})},Ht=G=>G.then(r).catch(de=>u(String(de))),$t=G=>io(l,{status:G}).then(()=>{D(l),lt()}).catch(de=>u(String(de))),O=(G,de,ge)=>h0(l,{to:G,note:de,postReview:ge}).then(({artifact:Te,noteError:Ye,sendError:un,replyError:oe})=>{v0(G),r(Te),C(!1),D(l);const Re=[un&&`the review did not post: ${un}`,oe,Ye&&`the note did not post: ${Ye}`].filter(Boolean);Re.length>0?u(`Handed to @${G}, but ${Re.join("; and ")}`):lt()}),ne=(G,de)=>Ht(n0(l,G,de)),be=G=>Ht(i0(l,G)),je=G=>Ht(a0(l,G)),Qe=a.comments.filter(G=>!G.chapterId||!mt.some(de=>de.id===G.chapterId)),{inline:st,folded:Ae,dropped:_e,held:Ue,replies:Ct}=py(a),bt=a.comments.filter(G=>G.alreadyRaised&&G.status!=="dropped").length,jn=a.comments.filter(G=>G.status!=="dropped"&&G.drifted).length,Un=a.verdict?wb[a.verdict.recommendation]:"none",ba=mN(a),Pt=pN(a),St=a.pendingChat!=null&&a.pendingChat.error==null,Kt=a.status==="running"||St,ut=()=>Ht(Rd(l,{message:"Some findings were dropped, edited or re-graded after this review was drafted. Update the summary and verdict to match what still stands — do not re-review the whole PR.",refs:[{target:"verdict",id:null}]})),Yn=(G,de)=>{Ht(Rd(l,{message:de,refs:[{target:"line",id:null,path:G.path,line:G.line,side:G.side}]}).then(ge=>{var Te;return(Te=Le.current)==null||Te.scrollIntoView({behavior:"smooth",block:"start"}),ge}))},ii=(Wn=a.run)!=null&&Wn.trusted?"ran the code":(Ea=a.run)!=null&&Ea.withSource?"read the full source":a.run?"read the diff only":"no run yet",ya=G=>{var de;return d.jsxs("button",{className:`verdict-pick${((de=a.verdict)==null?void 0:de.recommendation)===G?` verdict-pick-on tone-${wb[G]}`:""}`,title:G==="approve"?"Approve":G==="comment"?"Comment without blocking":"Request changes",onClick:()=>Ht(io(l,{verdictRecommendation:G})),children:[d.jsx(Ze,{name:_N[G]}),G.replace("_"," ")]},G)};return d.jsxs("div",{className:"review",children:[d.jsxs("div",{className:"review-top",ref:pe,children:[d.jsx("div",{className:"crumb",children:d.jsxs("div",{className:"bar-inner",children:[d.jsx("a",{href:"#/",children:"← queue"}),d.jsx("span",{className:"crumb-sep",children:"/"}),d.jsx("span",{className:"crumb-slug",children:a.id}),d.jsxs("span",{className:"walk",children:[d.jsx("button",{className:"walk-btn",disabled:!Lt,title:Lt?`[ — ${Lt.id}: ${Lt.pr.title}`:"no more reviews this way",onClick:()=>Lt&&Ln(Lt.key),children:d.jsx(Ze,{name:"chevronLeft"})}),d.jsx("button",{className:"walk-btn",disabled:!vt,title:vt?`] — ${vt.id}: ${vt.pr.title}`:"no more reviews this way",onClick:()=>vt&&Ln(vt.key),children:d.jsx(Ze,{name:"chevronRight"})})]}),Wt>=0&&d.jsxs("span",{className:"faint",children:[Wt+1," of ",Gt.length," awaiting"]}),d.jsx("span",{className:"faint crumb-next",children:vt?`next: ${vt.pr.title}`:Wt>=0?"last in the queue":""}),d.jsx("span",{className:"grow"}),d.jsx("a",{href:"#/settings",className:"topbar-link",title:"settings","aria-label":"settings",children:d.jsx(Ze,{name:"settings",size:15})})]})}),d.jsx("div",{className:"review-head",children:d.jsxs("div",{className:"wrap",children:[d.jsxs("div",{className:"review-head-top",children:[d.jsx("a",{className:"review-title",href:a.pr.url,target:"_blank",rel:"noreferrer",children:a.pr.title}),d.jsx("span",{className:"grow"}),a.verdict&&(Ot?d.jsxs("span",{className:`chip tone-${Un}`,children:[a.verdict.recommendation.replace("_"," "),Pt&&` · ${Pt}`," · ",a.verdict.confidence,"%"]}):d.jsxs("button",{className:`chip chip-btn tone-${Un}`,title:"change it, or send — both are at the foot of the page",onClick:()=>Rt(ee,S),children:[a.verdict.recommendation.replace("_"," "),Pt&&` · ${Pt}`," · ",a.verdict.confidence,"%",d.jsx(Ze,{name:"down",size:12})]})),a.status!=="running"&&d.jsxs("button",{className:"btn btn-sm",disabled:m,title:Ot?"Draft a new review at the current head. What you sent stays on GitHub — this replaces the draft here, and sending again posts a second review":a.run?"Review the current head again — this draft is replaced, comments and all":"Draft a review of this PR",onClick:()=>gn(!0),children:[d.jsx(Ze,{name:"rerun"}),m?"starting…":a.run?"re-review at head":"review now"]})]}),d.jsxs("div",{className:"review-head-meta",children:[d.jsx("span",{children:a.pr.author}),d.jsx("span",{className:"crumb-sep",children:"·"}),d.jsxs("span",{children:[a.pr.headRefName," → ",a.pr.baseRefName,a.pr.headSha?` · ${a.pr.headSha.slice(0,7)}`:""]}),d.jsx("span",{className:"crumb-sep",children:"·"}),d.jsxs("span",{children:[a.pr.changedFiles,"f ",d.jsxs("span",{className:"add",children:["+",a.pr.additions]})," ",d.jsxs("span",{className:"del",children:["−",a.pr.deletions]})]}),d.jsx("span",{className:"crumb-sep",children:"·"}),d.jsx("span",{title:"Whether the run read a local checkout of the PR head, or the diff alone.",children:ii}),((Jt=a.run)==null?void 0:Jt.costUsd)!=null&&d.jsxs(d.Fragment,{children:[d.jsx("span",{className:"crumb-sep",children:"·"}),d.jsxs("span",{title:"What this review would cost at API token rates. Riding a Claude subscription, it draws on your usage limits instead.",children:["≈$",a.run.costUsd.toFixed(2)," at API rates"]})]}),d.jsx("span",{className:"crumb-sep",children:"·"}),d.jsx("span",{title:"Where this review has got to: drafted, settled locally, or sent.",children:a.status})]})]})})]}),d.jsxs("div",{className:"wrap review-body",children:[d.jsxs("aside",{className:"rail",children:[d.jsxs("div",{className:"rail-jumps",children:[d.jsx("button",{className:"lab rail-lab-btn",onClick:()=>Rt(fe),children:"summary"}),a.verdict&&d.jsx("button",{className:"lab rail-lab-btn",onClick:()=>Rt(we),children:"why"}),d.jsx("button",{className:"lab rail-lab-btn",onClick:()=>{var G;Rt(Le),(G=Q.current)==null||G.focus()},children:"chat"}),d.jsx("button",{className:"lab rail-lab-btn",onClick:()=>{se(!0),Rt(z)},children:"history"})]}),mt.length>0&&d.jsxs(d.Fragment,{children:[d.jsx("button",{className:"lab rail-lab rail-lab-btn",onClick:()=>Gn(0),children:"changes"}),mt.map((G,de)=>{const ge=G.files.length>0&&G.files.every(Te=>wn.has(Te));return d.jsxs("div",{className:"rail-group",children:[d.jsxs("button",{className:`rail-item${hn(G.id)?" rail-item-on":""}${ge?" rail-item-done":""}${(he==null?void 0:he.id)===G.id?" rail-item-here":""}`,onClick:()=>Gn(de),children:[d.jsxs("span",{className:"grow",children:[de+1," · ",G.title]}),d.jsxs("span",{className:"rail-count",title:ge?"every file viewed":void 0,children:[ge?"✓ ":"",G.files.length,"f"]})]}),a.comments.filter(Te=>Te.chapterId===G.id).map(Te=>d.jsxs("button",{className:`rail-comment${Te.status==="dropped"?" rail-comment-dropped":""}`,title:`${Te.path}${Te.line!=null?`:${Te.line}`:""} — ${Te.body}`,onClick:()=>$n(de,Te.id),children:[d.jsx("span",{className:`rail-dot tone-${SN(Te,Un)}`,children:"●"}),d.jsxs("span",{className:"rail-comment-loc",children:[Te.path.split("/").pop(),Te.line!=null?`:${Te.drifted?"~":""}${Te.line}`:""]})]},Te.id))]},G.id)})]}),d.jsx("button",{className:`lab rail-lab-btn${mt.length>0?" rail-lab":""}`,onClick:()=>Rt(ee,S),children:"verdict"}),d.jsxs("div",{className:"rail-facts",children:[d.jsxs("div",{children:[a.comments.length-_e.length," keeping · ",_e.length," dropped"]}),d.jsxs("div",{children:[st.length," inline · ",Ae.length," folded into body"]}),jn>0&&d.jsxs("div",{className:"warn",title:"The code these comments pointed at is gone from the diff.",children:[jn," drifted"]}),d.jsx(kN,{check:a.raisedCheck??null,raised:bt,held:Ue.length,replies:Ct.length})]})]}),d.jsxs("div",{className:"main",children:[d.jsx(YN,{artifact:a,freshness:f,rerunning:m,onRerun:gn}),y&&d.jsxs("div",{className:"freshness",title:y,children:[d.jsx("strong",{children:"Couldn't check GitHub for newer commits."})," This is the review as it was drafted — if the PR has moved on since, nothing here knows it yet."]}),s&&d.jsx("div",{className:"error",children:s}),((Fn=a.run)==null?void 0:Fn.error)&&d.jsxs("div",{className:"error",children:["Run failed: ",a.run.error]}),d.jsx("div",{className:"card card-summary",ref:fe,children:d.jsxs("div",{className:"card-body",children:[d.jsx("div",{className:"lab",children:"summary"}),d.jsx(ni,{className:"prose lead",text:a.summary||"(no summary)"}),!Ot&&d.jsxs("button",{className:"btn btn-sm",onClick:()=>Pe({target:"summary",id:null}),children:[d.jsx(Ze,{name:"comment"}),"discuss the summary"]})]})}),a.verdict&&d.jsx("div",{className:`card card-why tone-border-${Un}`,ref:we,children:d.jsxs("div",{className:"card-body",children:[d.jsx("div",{className:"lab",children:"why"}),d.jsxs("div",{className:"sev-counts",children:[Td(a)&&d.jsx("span",{title:"Live findings by grade. Only blockers block.",children:Td(a)}),Td(a)&&d.jsx("span",{className:"crumb-sep",children:"·"}),d.jsxs("span",{title:"How sure the review is that its own findings and grades are right — not how good an idea merging is. That is the verdict, and it follows from the blockers.",children:[a.verdict.confidence,"% sure of the findings"]})]}),d.jsx(ni,{className:"prose lead",text:a.verdict.reasoning}),!Ot&&d.jsxs("button",{className:"btn btn-sm",onClick:()=>Pe({target:"verdict",id:null}),children:[d.jsx(Ze,{name:"comment"}),"discuss the verdict"]})]})}),mt.map((G,de)=>d.jsx(DN,{chapter:G,n:de+1,diff:a.diff,comments:a.comments.filter(ge=>ge.chapterId===G.id),open:hn(G.id),heavy:_n(G.id),onToggle:()=>qn(G.id),onUpdateComment:ne,onDeleteComment:be,onAddComment:je,onDiscuss:Ot?void 0:Pe,onAskAboutLine:Yn,chatBusy:St,readOnly:Ot,flash:Me,viewedState:It,sticky:Se,stuck:(he==null?void 0:he.id)===G.id&&he.stuck,anchorRef:ge=>{ge?ce.current.set(G.id,ge):ce.current.delete(G.id)}},G.id)),Qe.length>0&&d.jsxs("section",{className:"card",children:[d.jsxs("header",{className:"card-head",children:[d.jsx("h2",{children:"unattached comments"}),d.jsx("span",{className:"faint",children:"not part of any chapter — they post in the body"})]}),d.jsx("div",{className:"card-body",children:Qe.map(G=>d.jsx(yy,{comment:G,onUpdate:de=>ne(G.id,de),onDelete:()=>be(G.id),onDiscuss:Ot?void 0:()=>Pe({target:"comment",id:G.id}),readOnly:Ot},G.id))})]}),d.jsx(GN,{entries:a.history??[],open:B,onToggle:()=>se(G=>!G),anchorRef:z})]}),d.jsxs("aside",{className:"cockpit",children:[d.jsx(jN,{artifact:a,reviewKey:l,refs:I,onClearRefs:()=>A([]),onDropRef:G=>A(de=>de.filter((ge,Te)=>Te!==G)),onArtifact:r,readOnly:Ot,inputRef:Q,anchorRef:Le}),d.jsxs("div",{className:"cockpit-decide",children:[!Ot&&ba&&d.jsxs("div",{className:"verdict-hint",children:[d.jsxs("span",{children:[d.jsx("strong",{children:ba})," — the verdict was written before those edits."]}),d.jsxs("button",{className:"btn btn-sm",onClick:ut,disabled:St,children:[d.jsx(Ze,{name:"comment"}),St?"the reviewer is busy…":"ask the reviewer to re-true it"]})]}),a.verdict&&!Ot&&d.jsxs("div",{className:"verdict-bar",ref:ee,children:[d.jsx("span",{className:"lab",children:"verdict"}),["approve","comment","request_changes"].map(ya)]}),d.jsx(HN,{artifact:a,reviewKey:l,event:mn,sending:ve,checking:fn,onSend:He,error:Ge,next:vt,onAdvance:lt,onBody:G=>io(l,{bodyOverride:G}).then(r),anchorRef:S,footer:d.jsxs(d.Fragment,{children:[!Ot&&d.jsx("span",{className:"faint",children:"not sending?"}),!Ot&&d.jsxs(d.Fragment,{children:[d.jsxs("button",{className:"btn btn-sm",title:vt?`Settle it locally and go to ${vt.id}`:"Settle it locally and go back to the queue",onClick:()=>$t("reviewed"),children:[d.jsx(Ze,{name:"check"}),"mark reviewed"]}),d.jsxs("button",{className:"btn btn-sm",title:vt?`Leave it and go to ${vt.id}`:"Leave it and go back to the queue",onClick:()=>$t("skipped"),children:[d.jsx(Ze,{name:"skip"}),"skip"]})]}),d.jsxs("button",{className:"btn btn-sm",title:Kt?"Wait for the run to finish — a handoff settles the row it is rewriting":"Move GitHub's review request to somebody else, and settle this row",onClick:()=>C(!0),disabled:x||Kt,children:[d.jsx(Ze,{name:"arrowRight"}),"hand off"]}),d.jsxs("a",{className:"btn btn-sm",href:p0(l),children:[d.jsx(Ze,{name:"download"}),"export .md"]})]})}),x&&d.jsx(IN,{artifact:a,reviewKey:l,onConfirm:O,onCancel:()=>C(!1)})]})]})]})]})}const Ab="cerber.notify.seen.v2",PN="cerber.notify.seen",qd="cerber.notify",KN=1e4,Is=l=>l.status==="ready",Gd=l=>{try{return localStorage.getItem(l)}catch{return null}},$d=(l,a)=>{try{localStorage.setItem(l,a)}catch{}};function ZN(l,a){return l?!!(l.enabled&&l.pollEnabled&&l.autoReview):a}function Ey(l,a){return l.announceable===!1||l.status==="running"?!1:l.status==="awaiting"?!a:!0}const _y=":draft",so=l=>`${l.key}${_y}`,Sy=l=>Is(l)?so(l):l.key;function XN(l,a,r){const s=new Set(a);return qs(l).filter(u=>Ey(u,r)&&!s.has(Sy(u)))}function VN(l,a,r=[]){const s=new Set(r),u=new Set(qs(l).map(p=>p.key)),f=[];for(const p of l){if(u.has(p.key)&&!Ey(p,a)){for(const y of[p.key,so(p)])s.has(y)&&f.push(y);continue}f.push(p.key),(Is(p)||!u.has(p.key)||s.has(so(p)))&&f.push(so(p))}return f}const xd=l=>`${l.pr.repo}#${l.pr.number}`,QN={approve:"approves",comment:"comments",request_changes:"requests changes"};function WN(l){const a=l.verdict?QN[l.verdict.recommendation]:"drafted",r=l.blockerCount??0;return r===0?a:`${a} · ${r} blocker${r===1?"":"s"}`}function JN(l){if(l.length===0)return null;const a=`cerber:${l.map(Sy).sort().join("|")}`;if(l.length===1){const u=l[0];return{title:Is(u)?`${xd(u)} draft ready`:`${xd(u)} awaits your review`,body:Is(u)?`${WN(u)} — ${u.pr.title}`:`${u.pr.title} — ${u.pr.author}`,tag:a,key:u.key}}const r=l.slice(0,3).map(xd),s=l.length-r.length;return{title:l.every(Is)?`${l.length} drafts ready`:`${l.length} PRs await your review`,body:s>0?`${r.join(", ")} and ${s} more`:r.join(", "),tag:a,key:null}}const eT=new Set(["127.0.0.1","localhost","::1","[::1]"]);function tT(l,a=window.location.hostname){return!(l!=null&&l.enabled)||!l.notify?!1:eT.has(a)}function Hl(){return typeof Notification>"u"?"unsupported":Notification.permission==="denied"?"blocked":Gd(qd)==="off"?"off":Notification.permission==="granted"?"on":"ask"}async function nT(){const l=Hl();if(l==="unsupported"||l==="blocked")return l;if(l==="on")return $d(qd,"off"),Hl();if($d(qd,"on"),Notification.permission==="default")try{await Notification.requestPermission()}catch{}return Hl()}function aT(l){const a=new Notification(l.title,{body:l.body,tag:l.tag,icon:"/favicon.svg"});a.onclick=()=>{window.focus(),window.location.hash=l.key?`#/r/${encodeURIComponent(l.key)}`:"#/",a.close()}}function iT(l,a){const r=l??a;if(!r)return null;let s;try{s=JSON.parse(r)}catch{return null}if(!Array.isArray(s))return null;const u=s.filter(f=>typeof f=="string");return l?u:u.flatMap(f=>[f,`${f}${_y}`])}function lT(){const l=F.useRef(null),a=F.useRef(!0),[r,s]=F.useState(!1);return F.useEffect(()=>{let u=!0;l.current=iT(Gd(Ab),Gd(PN));const f=()=>Promise.all([Qd(),Fb().catch(()=>null)]).then(([y,g])=>{if(!u)return;const m=tT(g);s(m),a.current=ZN(g,a.current);const b=a.current,v=l.current;if(l.current=VN(y,b,v??[]),$d(Ab,JSON.stringify(l.current)),!v||Hl()!=="on"||m||document.visibilityState==="visible"&&document.hasFocus())return;const _=JN(XN(y,v,b));_&&aT(_)}).catch(()=>{});f();const p=setInterval(f,KN);return()=>{u=!1,clearInterval(p)}},[]),r}function wy(){const[l,a]=F.useState(Hl);return F.useEffect(()=>{const r=()=>a(Hl());return window.addEventListener("focus",r),()=>window.removeEventListener("focus",r)},[]),[l,()=>void nT().then(a)]}const ro=l=>{window.location.hash=`#/r/${encodeURIComponent(l)}`};function sT(l){const a=l,r=a==null?void 0:a.tagName;return r==="INPUT"||r==="TEXTAREA"||r==="SELECT"||(a==null?void 0:a.isContentEditable)===!0}function rT({daemon:l}){return l!=null&&l.enabled?d.jsx("div",{className:"daemon-bar",children:d.jsxs("div",{className:"bar-inner",children:[l.pollEnabled?d.jsxs("span",{className:"daemon-live",children:[d.jsx("span",{className:"dot"}),l.repos.length>0?l.repos.join(", "):"PRs awaiting you"," · every"," ",Math.round(l.intervalMs/6e4),"m"]}):d.jsxs("span",{className:"daemon-live",children:[d.jsx("span",{className:"dot dot-off"}),"polling off (settings) — local reviews only"]}),d.jsxs("span",{children:["auto-review ",d.jsx("b",{children:l.autoReview?"on":"off"})]}),d.jsxs("span",{children:["auto-send ",d.jsx("b",{children:l.autoSend==="on"?"on":"shadow"})," ≥",l.autoSendThreshold,"%",l.autoSend==="on"?` · ${l.autoSent} sent`:` · ${l.autoSendCandidates} candidate${l.autoSendCandidates===1?"":"s"}`]}),l.trustedRuns&&d.jsxs("span",{className:"warn",title:"Trust rules are set and auto-review is on: reviews of matching PRs run their code unattended. Settings → Trusted PRs, or serve --no-trust.",children:[d.jsx(Ze,{name:"zap",size:12})," trusted PRs run with Bash"]}),d.jsx("span",{className:"grow"}),l.lastPollError?d.jsx("span",{className:"danger",title:l.lastPollError,children:"discovery offline — showing local reviews only"}):d.jsx("span",{className:"faint",children:l.polling?"polling now…":[l.lastSummary?`last: ${l.lastSummary}`:null,l.nextPollAt?`next ${new Date(l.nextPollAt).toLocaleTimeString()}`:null].filter(Boolean).join(" · ")})]})}):null}function oT({r:l,selected:a,onSelect:r,onOpen:s,awaiting:u}){const f=K_(l),p=U_(l),y=u?Y_(l,u):null;return d.jsxs("div",{className:`row${a?" row-on":""}`,onClick:s,onMouseEnter:r,role:"button",tabIndex:-1,children:[d.jsx("span",{className:"col-caret",children:"›"}),d.jsxs("span",{className:"col-slug",title:`${l.pr.owner}/${l.pr.repo}#${l.pr.number}`,children:[l.pr.repo,"#",l.pr.number]}),d.jsx("span",{className:"col-author",title:l.pr.author,children:l.pr.author}),d.jsx("span",{className:"col-title",title:l.pr.title,children:l.pr.title}),l.pr.isDraft&&d.jsx("span",{className:"tag tag-draft",title:"Still a draft — its author asked for your review anyway",children:"draft"}),y&&d.jsx("span",{className:"tag tag-awaiting",title:y.title,children:y.label}),p&&d.jsx("span",{className:"tag tag-done",children:p}),d.jsx("span",{className:"col-comments",children:l.commentCount||""}),d.jsx("span",{className:"col-size",children:l.pr.changedFiles>0?d.jsxs(d.Fragment,{children:[l.pr.changedFiles,"f ",d.jsxs("span",{className:"add",children:["+",l.pr.additions]})," ",d.jsxs("span",{className:"del",children:["−",l.pr.deletions]})]}):"—"}),d.jsx("span",{className:`col-verdict tone-${f.tone}`,children:f.label}),d.jsx("span",{className:"col-age",children:Yb(l.updatedAt)})]})}function Rb({autoFocus:l}){const[a,r]=F.useState(""),[s,u]=F.useState(!1),[f,p]=F.useState(null),y=g=>{g.preventDefault();const m=a.trim();!m||s||(u(!0),p(null),l0(m).then(b=>ro(b.key)).catch(b=>{p(String(b instanceof Error?b.message:b)),u(!1)}))};return d.jsxs("form",{className:"pull",onSubmit:y,children:[d.jsx(Ze,{name:"plus"}),d.jsx("input",{className:"pull-input",value:a,autoFocus:l,disabled:s,onChange:g=>{r(g.target.value),f&&p(null)},placeholder:"paste a PR URL to review it","aria-label":"Review any PR by URL"}),a.trim()&&d.jsx("button",{className:"btn btn-small",type:"submit",disabled:s,children:s?"starting…":"review"}),f&&d.jsx("span",{className:"pull-error",children:f})]})}function cT({text:l}){const a=F.useRef(null),[r,s]=F.useState(!1);return F.useLayoutEffect(()=>{const u=a.current;if(!u)return;const f=()=>s(u.scrollHeight-u.clientHeight>4);f();const p=new ResizeObserver(f);return p.observe(u),()=>p.disconnect()},[l]),d.jsx("div",{ref:a,className:`strip-prose${r?" strip-prose-clipped":""}`,children:d.jsx(ni,{className:"prose",text:l})})}function uT(){var J;const[l,a]=F.useState(null),[r,s]=F.useState(null),[u,f]=F.useState(null),[p,y]=F.useState(new Set),[g,m]=F.useState("inbox"),[b,v]=F.useState(null),_=F.useRef(!0);F.useEffect(()=>(_.current=!0,()=>{_.current=!1}),[]);const T=()=>{Qd().then(K=>_.current&&a(K)).catch(K=>_.current&&f(String(K))),Fb().then(K=>_.current&&s(K)).catch(()=>{})};F.useEffect(()=>{T();const K=setInterval(T,1e4);return()=>clearInterval(K)},[]);const N=l??[],D=F.useMemo(()=>z_(N,r),[N,r]),x=D.requests,C=j_(g,D),I=D[C];F.useEffect(()=>{C!==g&&m(C)},[C,g]);const A=I.find(K=>K.key===b)??I[0]??null,Q=K=>{y(me=>new Set(me).add(K)),Pb(K).then(()=>T()).catch(me=>_.current&&f(String(me))).finally(()=>{_.current&&y(me=>{const ce=new Set(me);return ce.delete(K),ce})})};if(F.useEffect(()=>{const K=me=>{if(sT(me.target)||me.metaKey||me.ctrlKey||me.altKey)return;const ce=I.findIndex(he=>he.key===(A==null?void 0:A.key)),Se=he=>{const M=I[Math.min(I.length-1,Math.max(0,ce+he))];M&&v(M.key)};me.key==="j"||me.key==="ArrowDown"?(me.preventDefault(),Se(1)):me.key==="k"||me.key==="ArrowUp"?(me.preventDefault(),Se(-1)):me.key==="Enter"&&A?ro(A.key):me.key==="r"&&A&&A.status!=="running"&&A.status!=="sent"&&Q(A.key)};return window.addEventListener("keydown",K),()=>window.removeEventListener("keydown",K)},[I,A==null?void 0:A.key]),u&&!l)return d.jsx("p",{className:"error",children:u});if(!l)return d.jsx("p",{className:"muted pad",children:"Loading…"});const V=I.reduce((K,me)=>K+(me.costUsd??0),0),ie=A?X_(A,r):null,H=A?p.has(A.key):!1,R=Ad.filter(K=>D[K].length>0),q=K=>d.jsxs("button",{className:`tab${C===K?" tab-on":""}${Ad.includes(K)?" tab-filed":""}${K==="requests"?" tab-requests":""}`,title:Cu[K].title,onClick:()=>m(K),children:[Cu[K].label," ",d.jsx("span",{className:"tab-count",children:D[K].length})]},K);return d.jsxs(d.Fragment,{children:[d.jsx(rT,{daemon:r}),u&&d.jsx("div",{className:"wrap",children:d.jsx("p",{className:"error",children:u})}),N.length===0?d.jsx("div",{className:"wrap",children:d.jsxs("div",{className:"empty",children:[r!=null&&r.enabled?d.jsxs("p",{children:["Inbox empty — nothing awaits your review.",r.lastPollError?" (Discovery is offline; check gh auth.)":""]}):d.jsx("p",{children:"No reviews yet."}),d.jsx(Rb,{autoFocus:!0})]})}):d.jsxs("div",{className:"wrap",children:[d.jsxs("div",{className:"tabs",children:[C_.map(q),R.length>0&&d.jsx("span",{className:"tab-split","aria-hidden":"true"}),R.map(q),d.jsx("span",{className:"grow"}),d.jsx(Rb,{}),V>0&&d.jsxs("span",{className:"faint",title:"What these reviews would cost at API token rates. Riding a Claude subscription, they draw on your usage limits instead.",children:["≈$",V.toFixed(2)," at API rates"]})]}),d.jsxs("div",{className:"table-head",children:[d.jsx("span",{className:"col-caret"}),d.jsx("span",{className:"col-slug",children:"repo#pr"}),d.jsx("span",{className:"col-author",children:"author"}),d.jsx("span",{className:"col-title",children:"title"}),d.jsx("span",{className:"col-comments",children:"c"}),d.jsx("span",{className:"col-size",children:"size"}),d.jsx("span",{className:"col-verdict",children:"verdict"}),d.jsx("span",{className:"col-age",children:"upd"})]}),I.length===0?d.jsx("div",{className:"empty-tab",children:C==="inbox"&&x.length>0?d.jsxs(d.Fragment,{children:[d.jsx("p",{children:F_(x)}),d.jsxs("button",{className:"btn",onClick:()=>m("requests"),children:[d.jsx(Ze,{name:"arrowRight"}),"show ",x.length===1?"it":`all ${x.length}`]})]}):d.jsx("p",{className:"muted",children:C==="inbox"?`Inbox empty — nothing awaits your review.${r!=null&&r.enabled&&r.lastPollError?" (Discovery is offline; check gh auth.)":""}`:`Nothing ${Cu[C].label} right now.`})}):I.map(K=>d.jsx(oT,{r:K,selected:K.key===(A==null?void 0:A.key),onSelect:()=>v(K.key),onOpen:()=>ro(K.key),awaiting:L_(K,x)?B_(K,r):null},K.key)),A&&ie&&d.jsxs("div",{className:"cursor-strip",children:[d.jsxs("div",{className:"cursor-strip-body",children:[d.jsxs("div",{className:"lab",children:[A.pr.owner,"/",A.pr.repo,"#",A.pr.number,A.pr.headRefName&&A.pr.baseRefName?` · ${A.pr.headRefName} → ${A.pr.baseRefName}`:""]}),d.jsx(cT,{text:ie.reasoning}),d.jsxs("div",{className:"cursor-strip-meta",children:[ie.meta.join(" · "),((J=A.sent)==null?void 0:J.url)&&d.jsxs(d.Fragment,{children:[" · ",d.jsx("a",{href:A.sent.url,target:"_blank",rel:"noreferrer",children:"view on GitHub"})]})]})]}),d.jsxs("div",{className:"cursor-strip-actions",children:[d.jsxs("button",{className:"btn-primary",onClick:()=>ro(A.key),children:[d.jsx(Ze,{name:"arrowRight"}),"open review ",d.jsx(za,{children:"↵"})]}),d.jsxs("div",{className:"cursor-strip-row",children:[d.jsxs("button",{className:"btn",disabled:A.status==="sent"||A.status==="skipped",title:"Set the local queue status to skipped. Nothing is sent.",onClick:()=>io(A.key,{status:"skipped"}).then(T).catch(K=>f(String(K))),children:[d.jsx(Ze,{name:"skip"}),"skip"]}),d.jsxs("button",{className:"btn",disabled:H||A.status==="running",title:A.status==="sent"?"Draft a review of the PR's current head. What you sent stays on GitHub.":"Draft a review of the PR's current head.",onClick:()=>Q(A.key),children:[d.jsx(Ze,{name:"rerun"}),H?"starting…":A.status==="awaiting"||A.status==="failed"?"review now":"re-review"]})]})]})]})]})]})}const go="cerber.theme";function Ny(l){return l==="light"||l==="dark"?l:"system"}function dT(){try{return Ny(localStorage.getItem(go))}catch{return"system"}}function Ty(l,a=document.documentElement){l==="system"?delete a.dataset.theme:a.dataset.theme=l}function fT(l,a){try{const r=a??localStorage;l==="system"?r.removeItem(go):r.setItem(go,l)}catch{}}function hT(){xy(Ty)}function xy(l){const a=r=>{(r.key===go||r.key===null)&&l(Ny(r.newValue))};return window.addEventListener("storage",a),()=>window.removeEventListener("storage",a)}function pT(){const[l,a]=F.useState(dT);return F.useEffect(()=>xy(a),[]),[l,s=>{fT(s),Ty(s),a(s)}]}const mT=[{rule:"@acme/*",meaning:"anyone in the acme org"},{rule:"@acme/devs",meaning:"anyone on that GitHub team"},{rule:"@teammate",meaning:"one person, by login"},{rule:"!@acme/contractors",meaning:"deny — beats every rule above"}],kb=l=>l instanceof Error?l.message:String(l),gT={unsupported:"this browser has no notifications to give",blocked:"this browser has blocked notifications for cerber",off:"tell me when a review is ready for me",ask:"tell me when a review is ready for me (the browser will ask first)",on:"tell me when a review is ready for me"},bT=[{choice:"system",label:"follow this machine"},{choice:"light",label:"light"},{choice:"dark",label:"dark"}],yT=[{choice:"mod-enter",label:"⌘↵ sends a chat message, Enter starts a new line"},{choice:"enter",label:"Enter sends a chat message, Shift+Enter starts a new line"}];function vT({daemonAnnounces:l}){const[a,r]=wy(),[s,u]=pT(),[f,p]=fy(),[y,g]=my(),[m,b]=F.useState(null),[v,_]=F.useState(""),[T,N]=F.useState(null),[D,x]=F.useState(!1);F.useEffect(()=>{m0().then(b).catch(A=>N(kb(A)))},[]);const C=A=>{x(!0),N(null),A.then(b).catch(Q=>N(kb(Q))).finally(()=>x(!1))};if(T&&!m)return d.jsx("p",{className:"error",children:T});if(!m)return d.jsx("p",{className:"muted",children:"Loading…"});const I=l&&m.daemon.poll&&m.daemon.notify;return d.jsxs("div",{className:"settings",children:[d.jsx("a",{href:"#/",className:"back",children:"← queue"}),d.jsx("h1",{children:"Inbox"}),d.jsx("p",{children:"By default cerber keeps the queue itself: it polls GitHub for PRs awaiting your review and drafts a review for each, so they're ready when you open the cockpit. Nothing is ever sent without you. Changes apply on the next poll — no restart."}),d.jsxs("label",{className:"inbox-toggle",children:[d.jsx("input",{type:"checkbox",checked:m.daemon.poll,disabled:D,onChange:A=>C(Lu({poll:A.target.checked}))})," ","poll GitHub for PRs awaiting my review (every ",m.daemon.intervalMinutes,"m)"]}),d.jsxs("label",{className:"inbox-toggle",children:[d.jsx("input",{type:"checkbox",checked:m.daemon.autoReview,disabled:D||!m.daemon.poll,onChange:A=>C(Lu({autoReview:A.target.checked}))})," ","draft a review automatically (off: awaiting PRs wait for a click)"]}),d.jsxs("p",{className:"muted",children:["Interval, concurrency and a repo filter live in ",d.jsx("code",{children:m.path})," under"," ",d.jsx("code",{children:"daemon"})," — hand-editable, like everything here."]}),d.jsx("h1",{children:"Notifications"}),d.jsx("p",{children:'When a PR is worth coming back for, cerber says so: one desktop notification per poll. With auto-review on that moment is the draft landing, not the PR arriving — a tap that leads to "no run yet" costs you the walk back and gives you nothing — and the notification names what the review found. A PR nobody is drafting (auto-review off, or a run that failed) is announced as it lands, since that is all the news there will be — and if a retry then drafts it after all, that is new news and you are told. Several at once fold into one notification, and a PR whose draft has been announced never arrives twice, however its next re-review ends.'}),d.jsxs("label",{className:"inbox-toggle",children:[d.jsx("input",{type:"checkbox",checked:m.daemon.notify,disabled:D||!m.daemon.poll,onChange:A=>C(Lu({notify:A.target.checked}))})," ","tell this machine when a review is ready for you (no cockpit tab required)"]}),d.jsxs("p",{className:"muted",children:["This is the one that works while you're somewhere else: it rides the poll, so it needs nothing open but ",d.jsx("code",{children:"serve"})," itself. It hands the notification to whatever this machine already has — Notification Centre on macOS,"," ",d.jsx("code",{children:"notify-send"})," on Linux — and stays quiet where there is neither. On macOS it"," ",d.jsx("strong",{children:"opens that review when you click it"}),', through a small app cerber builds for the job (the first one asks you to allow notifications from "Cerber"); a'," ",d.jsx("code",{children:"notify-send"})," tap announces the PR but has no click to give."]}),d.jsxs("label",{className:"inbox-toggle",children:[d.jsx("input",{type:"checkbox",checked:a==="on",disabled:a==="unsupported"||a==="blocked"||I,onChange:r})," ",I?"let this browser announce them instead":gT[a]]}),d.jsx("p",{className:"muted",children:I?d.jsx(d.Fragment,{children:"Standing down while the machine's own notification is on — two popups for one PR is one too many. Untick the machine one above and this browser takes over: it names the PR and opens that review on click just the same, but only while a cockpit tab is open and this browser has granted the permission."}):d.jsxs(d.Fragment,{children:["Per-browser, not per-machine: the permission belongs to this browser, so the switch lives here rather than in ",d.jsx("code",{children:m.path}),". Granting it is the browser's prompt, not cerber's — a browser that has blocked cerber has to be un-blocked from the padlock next to the address bar. Nothing is announced while you're looking straight at the cockpit."]})}),d.jsx("h1",{id:"appearance",children:"Appearance"}),d.jsx("div",{role:"radiogroup","aria-labelledby":"appearance",children:bT.map(({choice:A,label:Q})=>d.jsxs("label",{className:"inbox-toggle",children:[d.jsx("input",{type:"radio",name:"theme",checked:s===A,onChange:()=>u(A)})," ",Q]},A))}),d.jsxs("p",{className:"muted",children:["Per-browser, like the notification switch: it's about this screen, not your reviews, so it lives here rather than in ",d.jsx("code",{children:m.path}),"."]}),d.jsx("h1",{children:"Review page"}),d.jsxs("label",{className:"inbox-toggle",children:[d.jsx("input",{type:"checkbox",checked:f,onChange:A=>p(A.target.checked)})," ","keep chapter titles and file headers pinned while scrolling"]}),d.jsx("p",{className:"muted",children:"Ten files into a chapter you still see which one you're in, and the pinned title can open the chapter's explanation. Deep in a long file its name and Viewed box stay in reach. Per-browser, like the theme."}),yT.map(({choice:A,label:Q})=>d.jsxs("label",{className:"inbox-toggle",children:[d.jsx("input",{type:"radio",name:"send-key",checked:y===A,onChange:()=>g(A)})," ",Q]},A)),d.jsx("p",{className:"muted",children:"In the conversation with the reviewer. ⌘↵ sends under either choice, and the other boxes — comments, the review body, a handoff note — always take ⌘↵, since what goes in them runs to several lines. Per-browser, like the theme."}),d.jsx("h1",{children:"Trusted PRs"}),d.jsxs("p",{children:["Every review reads the PR's code. A ",d.jsx("strong",{children:"trusted"})," review may also run it — the test that covers the change, a typecheck, ",d.jsx("code",{children:"git log"})," — so it can report what happened instead of guessing. That means executing code from the PR on this machine, the same as checking the branch out and running the tests yourself."]}),d.jsxs("p",{className:"muted",children:["Trust the people, not the code: nothing about a PR can earn it. Rules live in"," ",d.jsx("code",{children:m.path}),"."]}),d.jsx("p",{className:"muted",children:'Only people can be trusted — there is no way to trust a repository. Anyone can open a PR against a repo you own, so trusting the repo would trust them too. Membership is checked against GitHub when the review runs, and a check that fails counts as "not a member".'}),d.jsxs("div",{className:"trust-add",children:[d.jsx("input",{value:v,"aria-label":"Trust rule",placeholder:"@org/*, @org/team, @login, !deny",disabled:D,onChange:A=>_(A.target.value),onKeyDown:A=>{A.key==="Enter"&&!D&&v.trim()&&(C(Du(v.trim())),_(""))}}),d.jsx("button",{className:"btn",disabled:D||!v.trim(),onClick:()=>{C(Du(v.trim())),_("")},children:"trust"})]}),T&&d.jsx("p",{className:"error",children:T}),m.trust.length===0?d.jsx("p",{className:"muted",children:"Nobody is trusted yet — every review reads the checkout and runs nothing."}):d.jsx("table",{className:"trust-table",children:d.jsx("tbody",{children:m.trust.map(A=>d.jsxs("tr",{className:A.denies?"trust-deny":void 0,children:[d.jsx("td",{children:d.jsx("code",{children:A.rule})}),d.jsx("td",{className:"muted",children:A.explanation}),d.jsx("td",{className:"trust-actions",children:d.jsx("button",{className:"btn",disabled:D,onClick:()=>C(Du(A.rule,!0)),children:"remove"})})]},A.rule))})}),d.jsx("h2",{children:"Rule syntax"}),d.jsx("table",{className:"trust-table",children:d.jsx("tbody",{children:mT.map(A=>d.jsxs("tr",{children:[d.jsx("td",{children:d.jsx("code",{children:A.rule})}),d.jsx("td",{className:"muted",children:A.meaning})]},A.rule))})}),d.jsxs("p",{className:"muted",children:["A trusted review is handed no GitHub credentials — no token, no ",d.jsx("code",{children:"gh"})," login, no git or ssh identity — so a push fails to authenticate rather than being merely discouraged. It is not a sandbox though: it has ",d.jsx("code",{children:"Bash"})," and this machine, so trust people you would let run their branch here anyway. The daemon reviews unattended, so with rules set it runs matching PRs' code with nobody watching — start it with ",d.jsx("code",{children:"--no-trust"})," to prevent that."]}),d.jsxs("p",{className:"muted settings-version",children:["cerber ",m.version]})]})}function Ob(){const l=window.location.hash,a=l.match(/^#\/r\/(.+)$/);return a?{view:"detail",key:decodeURIComponent(a[1])}:l==="#/settings"?{view:"settings"}:{view:"queue"}}const Cb={unsupported:"",blocked:"This browser blocked notifications for cerber. Turn them back on in its site settings — the padlock next to the address bar.",off:"Notifications off. Click to be told when a review is ready for you.",ask:"Click to be told when a review is ready for you — the browser will ask you first.",on:"Telling you when a review is ready for you. Click to stop."},Mb="cerber taps this machine itself when a PR is worth coming back for — no tab required. The browser's own bell would be a second popup about one PR, so it stands down. Turn the machine one off in Settings to have this browser announce them instead.";function ET({daemonAnnounces:l}){const[a,r]=wy();return l?d.jsx("span",{className:"topbar-link bell bell-daemon",role:"img",title:Mb,"aria-label":Mb,children:d.jsx(Ze,{name:"bell",size:15})}):a==="unsupported"?null:d.jsx("button",{className:`topbar-link bell bell-${a}`,title:Cb[a],"aria-label":Cb[a],"aria-pressed":a==="on",onClick:r,children:d.jsx(Ze,{name:a==="on"?"bell":"bellOff",size:15})})}function _T(){const[l,a]=F.useState(Ob()),r=lT();return F.useEffect(()=>{const s=()=>a(Ob());return window.addEventListener("hashchange",s),()=>window.removeEventListener("hashchange",s)},[]),l.view==="detail"?d.jsx("div",{className:"app",children:d.jsx(FN,{reviewKey:l.key})}):d.jsxs("div",{className:"app",children:[d.jsx("header",{className:"topbar",children:d.jsxs("div",{className:"bar-inner",children:[d.jsxs("a",{href:"#/",className:"brand",children:[d.jsx(NS,{}),"cerber"]}),d.jsx("span",{className:"tagline",children:"nothing reaches GitHub until you say so"}),d.jsx("span",{className:"grow"}),l.view==="queue"&&d.jsxs(d.Fragment,{children:[d.jsxs("span",{className:"hint",children:[d.jsx(za,{children:"j"}),d.jsx(za,{children:"k"}),"move"]}),d.jsxs("span",{className:"hint",children:[d.jsx(za,{children:"↵"}),"open"]}),d.jsxs("span",{className:"hint",children:[d.jsx(za,{children:"r"}),"review now"]})]}),d.jsx(ET,{daemonAnnounces:r}),d.jsx("a",{href:"#/settings",className:"topbar-link",title:"settings","aria-label":"settings",children:d.jsx(Ze,{name:"settings",size:15})})]})}),l.view==="queue"?d.jsx(uT,{}):d.jsx(vT,{daemonAnnounces:r})]})}hT();HE.createRoot(document.getElementById("root")).render(d.jsx(LE.StrictMode,{children:d.jsx(_T,{})}));
@@ -14,8 +14,8 @@
14
14
  </script>
15
15
  <link rel="icon" type="image/svg+xml" href="/favicon.svg" />
16
16
  <title>cerber</title>
17
- <script type="module" crossorigin src="/assets/index-BFMebSDr.js"></script>
18
- <link rel="stylesheet" crossorigin href="/assets/index-BjMp9wRh.css">
17
+ <script type="module" crossorigin src="/assets/index-LWGU30De.js"></script>
18
+ <link rel="stylesheet" crossorigin href="/assets/index-C_G8PR0E.css">
19
19
  </head>
20
20
  <body>
21
21
  <div id="root"></div>