@fabiofiorita/porcelain 0.88.3 → 0.89.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/package.json +1 -1
- package/server/src/cli/main.mjs +56 -16
- package/web/dist/assets/_paired-BQkrI4SM.js +1 -0
- package/web/dist/assets/_paired-Bvuo9ETq.js +2 -0
- package/web/dist/assets/{access-B1ddZlps.js → access-Czr_5Nvq.js} +14 -14
- package/web/dist/assets/{edit-file-D4o1bywx.js → edit-file-CoGaqr7C.js} +1 -1
- package/web/dist/assets/{file-editor-MXkoMjoi.js → file-editor-CqYmInQP.js} +1 -1
- package/web/dist/assets/index-Bq6FLWHL.css +2 -0
- package/web/dist/assets/{index-BCzkwtUi.js → index-Ry3CvuRB.js} +3 -3
- package/web/dist/assets/pair-BQkrI4SM.js +1 -0
- package/web/dist/assets/{pair-DKAxtXy2.js → pair-Dl38bMAd.js} +1 -1
- package/web/dist/assets/{pair-B1zlXYYv.js → pair-W3dVdOPG.js} +2 -2
- package/web/dist/assets/{settings-page-DxR05fZi.js → settings-page-Br9q_UKH.js} +15 -15
- package/web/dist/assets/{useNavigate-BZWuXWB6.js → useNavigate-CSjcsPKp.js} +1 -1
- package/web/dist/assets/{workspace-error-Dc7KW7tw.js → workspace-error-B9TOlwBf.js} +1 -1
- package/web/dist/index.html +7 -7
- package/web/dist/assets/_paired-BKE-zKoJ.js +0 -1
- package/web/dist/assets/_paired-Cqn24txY.js +0 -2
- package/web/dist/assets/index-DVaGWkQe.css +0 -2
- package/web/dist/assets/pair-BKE-zKoJ.js +0 -1
package/README.md
CHANGED
package/package.json
CHANGED
package/server/src/cli/main.mjs
CHANGED
|
@@ -316,6 +316,7 @@ var walkthroughContentSchema = Schema4.Struct({
|
|
|
316
316
|
Schema4.Struct({
|
|
317
317
|
title: Schema4.String,
|
|
318
318
|
explanation: Schema4.String,
|
|
319
|
+
paths: Schema4.optional(Schema4.Array(Schema4.String)),
|
|
319
320
|
blocks: Schema4.Array(walkthroughBlockSchema)
|
|
320
321
|
})
|
|
321
322
|
),
|
|
@@ -3113,11 +3114,17 @@ var pullRequestActionRefusalSchema = Schema44.Literals([
|
|
|
3113
3114
|
// packages/reviews/src/models/draft-comment.ts
|
|
3114
3115
|
import { Schema as Schema45 } from "effect";
|
|
3115
3116
|
var commentSideSchema = Schema45.Literals(["additions", "deletions"]);
|
|
3117
|
+
var commentSurfaceSchema = Schema45.Literals([
|
|
3118
|
+
"branch-file",
|
|
3119
|
+
"change",
|
|
3120
|
+
"file"
|
|
3121
|
+
]);
|
|
3116
3122
|
var draftCommentAnchorSchema = Schema45.Union([
|
|
3117
3123
|
Schema45.Struct({
|
|
3118
3124
|
kind: Schema45.Literal("lines"),
|
|
3119
3125
|
path: Schema45.String,
|
|
3120
3126
|
side: commentSideSchema,
|
|
3127
|
+
surface: Schema45.optional(commentSurfaceSchema),
|
|
3121
3128
|
start: Schema45.Int,
|
|
3122
3129
|
end: Schema45.Int,
|
|
3123
3130
|
text: Schema45.String
|
|
@@ -8265,6 +8272,7 @@ var commentAnchorRequestSchema = Schema192.Union([
|
|
|
8265
8272
|
kind: Schema192.Literal("lines"),
|
|
8266
8273
|
path: relativePathSchema,
|
|
8267
8274
|
side: commentSideSchema,
|
|
8275
|
+
surface: Schema192.optional(commentSurfaceSchema),
|
|
8268
8276
|
start: lineNumber,
|
|
8269
8277
|
end: lineNumber,
|
|
8270
8278
|
text: Schema192.String.check(Schema192.isMaxLength(MAX_SNAPSHOT_LENGTH))
|
|
@@ -13838,6 +13846,7 @@ var proseFields = {
|
|
|
13838
13846
|
stillUnclear: walkthroughContentSchema.fields.stillUnclear
|
|
13839
13847
|
};
|
|
13840
13848
|
var stopFields = {
|
|
13849
|
+
paths: Schema247.optional(Schema247.Array(Schema247.String)),
|
|
13841
13850
|
title: Schema247.String,
|
|
13842
13851
|
explanation: Schema247.String
|
|
13843
13852
|
};
|
|
@@ -13929,7 +13938,9 @@ Return JSON with:
|
|
|
13929
13938
|
- title: 3 to 7 words naming what this change does. It becomes the worktree's name in a sidebar. No ticket numbers, no file names.
|
|
13930
13939
|
- summary: at most 3 sentences, before and after.
|
|
13931
13940
|
- growth: how the system's shape changed, each with change ("added", "changed" or "removed"), what and note (one line). Empty if the shape did not change.
|
|
13941
|
+
- Use recorded decisions as context. When the reason for a choice is known, explain it and ask only what is still open. If the build conversation is unavailable, describe what the change establishes. Missing historical rationale alone does not create a decision.
|
|
13932
13942
|
- stops: the tour, empty when outcome is "nothing". Usually 2 to 6, at most 8, each building on the last: data shape or contract first, then what implements it, then what uses it. Each stop has:
|
|
13943
|
+
- paths: assign changed files to the step that owns their behavior, independently of evidence. Use exact repo-relative files or directory prefixes ending in /. More specific paths take precedence. Include tests alongside the behavior they prove. Cover the main implementation, tests and tooling in meaningful groups. Leave genuinely unrelated files outside the tour.
|
|
13933
13944
|
- title: a claim about what this stop accomplishes, not a file name.
|
|
13934
13945
|
- explanation: 2 to 4 sentences, before and after. Never narrate code line by line.
|
|
13935
13946
|
- ${job.run.writer.provider === "codex" ? "blockIds: IDs returned by the Porcelain MCP tools, in reading order. If the tools are deferred, look up the Porcelain Walkthrough tools by name. Call the tool once for each block you place. Use [] if no block helps." : "blocks: array of block requests in reading order. Each has a kind as listed below. Use [] if no block helps."}
|
|
@@ -13939,7 +13950,7 @@ Return JSON with:
|
|
|
13939
13950
|
Block catalog:
|
|
13940
13951
|
- diff_excerpt: path, side ("new" or "old"), start, end and caption. Choose 3 to 25 lines within one hunk of the captured diff. For a rename, use the old path only on the old side.
|
|
13941
13952
|
- before_after: before and after, each with assetId and shows. Use two different existing PR images you inspected that actually depict before and after. Omit if either is missing.
|
|
13942
|
-
- files: files, each with path and note. Use changed paths from the capture.
|
|
13953
|
+
- files: files, each with path and note. Use changed paths from the capture. Show representative files. Use paths for complete membership.
|
|
13943
13954
|
- checks: headOid, the captured head (${job.run.headOid}). Only use when results are recorded above. Porcelain supplies the results.
|
|
13944
13955
|
- callout: attention with kind ("tradeoff", "contract", "product", "risk" or "accessibility"), note (why it matters) and question (the decision). comparison is optional and has columns (two options, each a short label naming what the product would do), rows (up to six pairs of short text cells) and implemented (the column the captured change already does, copied exactly; omit it when the change does neither). Use only for a real decision or risk.
|
|
13945
13956
|
- diagram: layout ("flow" left to right, "layers" top to bottom, or "sequence" where edge order is time), optional title, nodes (2 to 12) and edges (1 to 20). Each node has id, label (a code name of at most 28 characters), optional kind ("file", "function", "type", "component", "route", "table", "test" or "external"), note (one line, at most 80 characters), mark ("added", "changed", "removed" or "unchanged") and anchor (path, with optional lines: side, start and end within one hunk of the captured diff). Each edge has from, to, optional label of at most 24 characters ("calls", "reads", "returns"\u2026) and mark ("added" or "removed"). Node ids are unique and every edge joins two different nodes, or the diagram is dropped. Use one only when relationships matter: a new call path, a changed data flow or a moved responsibility. Anchor nodes to changed files and real lines. Never draw anything the diff does not show.
|
|
@@ -26941,7 +26952,6 @@ var BeginWalkthroughService = class _BeginWalkthroughService extends Context218.
|
|
|
26941
26952
|
import { Context as Context219, DateTime as DateTime20, Effect as Effect263, Layer as Layer157 } from "effect";
|
|
26942
26953
|
|
|
26943
26954
|
// packages/walkthroughs/src/rules/qualify-walkthrough.ts
|
|
26944
|
-
var LEFTOVER_TITLE = "Everything else";
|
|
26945
26955
|
function withUniqueTitles(stops) {
|
|
26946
26956
|
const taken = new Set(stops.map((stop) => stop.title));
|
|
26947
26957
|
const seen = /* @__PURE__ */ new Set();
|
|
@@ -27049,32 +27059,62 @@ function qualifyDiagram(block, job) {
|
|
|
27049
27059
|
})
|
|
27050
27060
|
};
|
|
27051
27061
|
}
|
|
27062
|
+
function fileOwner(owners, path) {
|
|
27063
|
+
let key = path;
|
|
27064
|
+
while (key) {
|
|
27065
|
+
const owner = owners.get(key);
|
|
27066
|
+
if (owner) return owner;
|
|
27067
|
+
key = key.slice(0, key.lastIndexOf("/", key.length - 2) + 1);
|
|
27068
|
+
}
|
|
27069
|
+
return void 0;
|
|
27070
|
+
}
|
|
27052
27071
|
function qualifyWalkthrough(content, job, evidence) {
|
|
27053
27072
|
if (content.outcome === "nothing")
|
|
27054
27073
|
return { ...content, stops: [], stillUnclear: [] };
|
|
27055
27074
|
const covered = /* @__PURE__ */ new Set();
|
|
27056
27075
|
const excerptedHunks = /* @__PURE__ */ new Set();
|
|
27057
|
-
const
|
|
27076
|
+
const owners = /* @__PURE__ */ new Map();
|
|
27077
|
+
const members = content.stops.map((stop) => {
|
|
27078
|
+
const files = /* @__PURE__ */ new Set();
|
|
27079
|
+
for (const path of stop.paths ?? []) {
|
|
27080
|
+
if (!owners.has(path)) owners.set(path, files);
|
|
27081
|
+
}
|
|
27082
|
+
return files;
|
|
27083
|
+
});
|
|
27084
|
+
const assigned = /* @__PURE__ */ new Set();
|
|
27085
|
+
for (const { path } of job.files) {
|
|
27086
|
+
const owner = fileOwner(owners, path);
|
|
27087
|
+
if (owner) {
|
|
27088
|
+
owner.add(path);
|
|
27089
|
+
assigned.add(path);
|
|
27090
|
+
}
|
|
27091
|
+
}
|
|
27092
|
+
const stops = content.stops.map((stop, index) => {
|
|
27058
27093
|
const qualified = stop.blocks.flatMap((block) => {
|
|
27059
27094
|
const match = qualifyBlock(block, job, evidence, covered, excerptedHunks);
|
|
27060
27095
|
return match === void 0 ? [] : [match];
|
|
27061
27096
|
});
|
|
27062
27097
|
for (const item of qualified)
|
|
27063
27098
|
for (const path of item.paths) covered.add(path);
|
|
27064
|
-
|
|
27099
|
+
const paths = members[index];
|
|
27100
|
+
for (const { block, paths: cited } of qualified) {
|
|
27101
|
+
const anchors = block.kind === "diagram" ? block.nodes.flatMap(
|
|
27102
|
+
(node) => node.anchor ? [node.anchor.path] : []
|
|
27103
|
+
) : [];
|
|
27104
|
+
for (const path of [...cited, ...anchors]) {
|
|
27105
|
+
if (!assigned.has(path)) {
|
|
27106
|
+
paths?.add(path);
|
|
27107
|
+
assigned.add(path);
|
|
27108
|
+
}
|
|
27109
|
+
}
|
|
27110
|
+
}
|
|
27111
|
+
return {
|
|
27112
|
+
title: stop.title,
|
|
27113
|
+
explanation: stop.explanation,
|
|
27114
|
+
...owners.size > 0 || stop.paths !== void 0 ? { paths: [...paths ?? []] } : {},
|
|
27115
|
+
blocks: qualified.map((item) => item.block)
|
|
27116
|
+
};
|
|
27065
27117
|
});
|
|
27066
|
-
const [first, ...rest] = job.files.filter((file) => !covered.has(file.path)).map((file) => ({ path: file.path, note: "Supporting change" }));
|
|
27067
|
-
if (first !== void 0) {
|
|
27068
|
-
const block = { kind: "files", files: [first, ...rest] };
|
|
27069
|
-
const leftover = stops.find((stop) => stop.title === LEFTOVER_TITLE);
|
|
27070
|
-
if (leftover) leftover.blocks.push(block);
|
|
27071
|
-
else
|
|
27072
|
-
stops.push({
|
|
27073
|
-
title: LEFTOVER_TITLE,
|
|
27074
|
-
explanation: "These changed files complete the change.",
|
|
27075
|
-
blocks: [block]
|
|
27076
|
-
});
|
|
27077
|
-
}
|
|
27078
27118
|
return {
|
|
27079
27119
|
...content,
|
|
27080
27120
|
outcome: content.outcome === "needs_you" && !stops.some(
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./workspace-error-B9TOlwBf.js";var t=e;export{t as errorComponent};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{Ac as t,B as n,C as r,Dc as i,Do as a,Eo as o,Fa as s,Fd as c,Fo as l,G as u,Gl as d,Gs as f,Gt as p,H as m,Hl as h,Ho as g,I as _,Io as v,It as y,Jc as b,Jt as x,K as S,Kt as C,L as w,Ll as T,Ls as E,Lt as D,Nc as O,Oa as k,Oc as A,Oo as j,P as M,Pl as N,Qc as P,R as F,Rs as I,Rt as L,So as R,T as z,Tc as B,Ti as V,To as H,Tr as ee,Uo as U,Ut as te,V as ne,Vo as W,W as re,Wc as ie,Ws as ae,Wt as G,Xc as oe,Zc as se,_a as ce,_c as le,_s as ue,_u as K,bc as q,bo as J,da as de,dn as fe,dt as pe,du as me,ea as he,el as ge,fn as _e,fu as ve,gn as ye,gs as be,ha as xe,hc as Se,hs as Ce,hu as we,ia as Te,ja as Ee,jc as De,js as Oe,l as ke,li as Ae,ma as je,mn as Me,na as Ne,nn as Pe,oa as Fe,p as Ie,pa as Le,pn as Re,pu as ze,q as Be,ql as Ve,qt as He,ra as Ue,rl as We,sa as Ge,ta as Ke,ua as qe,uo as Je,vc as Ye,vs as Xe,w as Ze,wc as Qe,wo as $e,xo as et,xs as tt,yc as nt,ys as rt,z as it,zt as at}from"./access-Czr_5Nvq.js";import{i as ot,n as st,t as ct}from"./useNavigate-CSjcsPKp.js";import{$ as lt,$n as ut,$t as dt,A as ft,An as pt,At as mt,B as ht,Bn as gt,Bt as _t,C as vt,Cn as yt,Ct as bt,D as xt,Dn as St,Dt as Ct,E as wt,En as Tt,Et,F as Dt,Fn as Ot,Ft as kt,G as At,Gn as jt,Gt as Mt,H as Nt,Hn as Pt,Ht as Ft,I as It,In as Lt,It as Rt,J as zt,Jn as Bt,Jt as Vt,K as Ht,Kn as Ut,Kt as Wt,L as Gt,Ln as Kt,M as qt,Mn as Jt,Mt as Yt,N as Xt,Nn as Zt,Nt as Qt,O as $t,On as en,Ot as tn,P as nn,Pn as rn,Q as an,Qn as on,Qt as sn,R as cn,Rn as ln,Rt as un,S as dn,Sn as fn,St as pn,T as mn,Tn as hn,Tt as gn,U as _n,Un as vn,Ut as yn,V as bn,Vn as xn,Vt as Sn,W as Cn,Wn as wn,Wt as Tn,X as En,Xn as Dn,Xt as On,Y as kn,Yn as An,Yt as jn,Z as Mn,Zn as Nn,Zt as Pn,_ as Fn,_n as In,_t as Ln,a as Rn,an as zn,at as Bn,b as Vn,bn as Hn,bt as Un,c as Wn,cn as Gn,ct as Kn,d as qn,dn as Jn,dt as Yn,en as Xn,er as Zn,et as Qn,f as $n,fn as er,ft as tr,g as nr,gn as rr,gt as ir,h as ar,hn as or,ht as sr,i as cr,in as lr,ir as ur,it as dr,j as fr,jn as pr,jt as mr,k as hr,kn as gr,kt as _r,l as vr,ln as yr,lt as br,m as xr,mn as Sr,mt as Cr,n as wr,nn as Tr,nr as Er,nt as Dr,o as Or,on as kr,ot as Ar,p as jr,pn as Mr,pt as Nr,q as Pr,qn as Fr,qt as Ir,r as Lr,rn as Rr,rr as zr,rt as Br,s as Vr,sn as Hr,st as Ur,tn as Wr,tt as Gr,un as Kr,ut as qr,v as Jr,vn as Yr,vt as Xr,wn as Zr,wt as Qr,x as $r,xn as ei,xt as ti,y as ni,yn as ri,yt as ii,z as ai,zn as oi}from"./settings-page-Br9q_UKH.js";import{L as si,N as ci,R as li,X as ui,Z as di,_i as fi,_r as pi,an as mi,b as hi,d as gi,et as _i,fi as vi,ft as yi,g as bi,gi as xi,gr as Si,gt as Ci,hi as wi,hn as Ti,ht as Ei,l as Di,lt as Oi,m as ki,mi as Ai,mt as ji,nr as Mi,p as Ni,pi as Pi,tt as Fi,v as Ii,x as Li,y as Ri,z as zi}from"./edit-file-CoGaqr7C.js";import{d as Bi,f as Vi,r as Hi}from"./sides-711aNttp.js";import{t as Ui}from"./workspace-error-B9TOlwBf.js";function Wi(e){let t=ge({warn:e?.router===void 0}),n=e?.router||t;return P(n.stores.__store,ot(e,n))}var Y=e(N(),1),X=We(),Z=b();function Gi(e,t,n){return Math.min(Math.max(e,t),n)}function Ki(e){if(!Number.isFinite(e)||Number.isInteger(e))return 0;let[t,n]=String(e).toLowerCase().split(`e`),r=(t.split(`.`)[1]??``).length;return Math.max(0,r-Number(n??0))}function qi(e,t){return Number(e.toFixed(Math.min(t,100)))}function Ji(e,t){return Number((e/t).toPrecision(15))}function Yi(e){return Number.isFinite(e.min)?e.min:0}function Xi(e){return Math.max(Ki(e.step),Ki(Yi(e)))}function Zi(e){if(!Number.isFinite(e.max)||!(e.step>0))return e.max;let t=Yi(e);return qi(t+Math.floor(Ji(e.max-t,e.step))*e.step,Xi(e))}function Qi(e,t,n=Math.round){if(!(t.step>0))return e;let r=Yi(t);return qi(r+n(Ji(e-r,t.step))*t.step,Xi(t))}function $i(e,t){return t.step>0?qi(Gi(Qi(e,t),t.min,Zi(t)),Xi(t)):Gi(e,t.min,t.max)}function ea(e,t,n){if(!(n.step>0))return Gi(e+t,n.min,n.max);let r=Yi(n),i=Ji(e-r,n.step);return qi(Gi(r+((Number.isInteger(i)?i:t>0?Math.floor(i):Math.ceil(i))+t)*n.step,n.min,Zi(n)),Xi(n))}function ta(e,t,n){return t.size===`large`?$i(Gi(e+t.direction*(n.largeStep??n.step*10),n.min,n.max),n):t.size===`small`&&n.smallStep?ea(e,t.direction,{...n,step:n.smallStep}):ea(e,t.direction,n)}var na=new Map;function ra(e,t={}){let n=`${e??``}|${JSON.stringify(t)}`,r=na.get(n);return r||(r=new Intl.NumberFormat(e,t),na.set(n,r)),r}var ia=new WeakMap;function aa(e){let t=ra(void 0,e),n=ia.get(t);return n===void 0&&(n=t.resolvedOptions().maximumFractionDigits??0,ia.set(t,n)),n}function oa(e,t){let n={...e};if(n.maximumFractionDigits===void 0&&n.maximumSignificantDigits===void 0){let r=Ki(t)+(n.style===`percent`?-2:0);n.maximumFractionDigits=Math.max(n.minimumFractionDigits??0,r,aa(e))}return n}function sa(e,t,n){if(e===null||!Number.isFinite(e))return``;if(typeof n==`function`)return n(e);let r=ra(t,n),i=r.format(e);if(e<0&&!r.formatToParts(e).some(e=>e.type===`integer`)){let e=r.formatToParts(-3),t=e.findIndex(e=>e.type===`minusSign`);return`${e.slice(0,t+1).map(e=>e.value).join(``)}${i}`}return i}function ca(e){let t=e.split(`/`).map(e=>e.trim()===``?NaN:Number(e));return t.every(Number.isFinite)?t:null}var la={name:`chevron-left`,size:24,node:[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]};la.node;var ua=$e(la),da=typeof window>`u`?Y.useEffect:Y.useLayoutEffect;function fa({fileDiff:e,oldFile:t,newFile:n,options:r,editorOptions:i,editStateKey:a,lineAnnotations:o,selectedLines:s,prerenderedHTML:c,metrics:l,hasGutterRenderUtility:u,hasCustomHeader:d,disableWorkerPool:f,edit:p,onEditChange:m,onEditComplete:h}){let g=yt(),_=s!==void 0,v=(0,Y.useContext)(gr),y=Zt(),[b,x]=(0,Y.useState)(),S=rn(e=>m?.(e)),C=m==null?void 0:S,w=(0,Y.useRef)(null),T=rn(r=>{let i=h?.(r)??`reject`;return i===`accept`&&(w.current={fileDiff:{installed:r.fileDiff,stale:r.originalFileDiff},filePair:e==null?{fileDiff:r.fileDiff,installed:{oldFile:r.oldFile,newFile:r.newFile},stale:{oldFile:t??null,newFile:n??null}}:null,annotations:{installed:r.lineAnnotations,stale:r.originalLineAnnotations}}),i}),E=h==null?void 0:T,D=pa({acceptedCache:w,fileDiff:e,newFile:n,oldFile:t,parseDiffOptions:r?.parseDiffOptions}),O=(0,Y.useRef)(null),k=fn(),A=ha(w,D,o),j=ei(O,A)??{fileDiff:D,lineAnnotations:o??pi},M=(0,Y.useRef)(null),N=(0,Y.useRef)(null),P=rn(()=>{if(y==null)throw Error(`FileDiff: EditContext is not attached`);return y(`file-diff`,i??{},a)}),F=rn(e=>{if(e!=null){if(O.current!=null)throw Error(`useFileDiffInstance: An instance should not already exist when a node is created`);g==null?O.current=new Tt(va({controlledSelection:_,hasCustomHeader:d,hasGutterRenderUtility:u,onEditChange:C,onEditComplete:E,options:r}),f?void 0:v,k):O.current=new hn(va({controlledSelection:_,hasCustomHeader:d,hasGutterRenderUtility:u,onEditChange:C,onEditComplete:E,options:r}),g,l,f?void 0:v,k),O.current.hydrate({fileDiff:D,fileContainer:e,lineAnnotations:o,prerenderedHTML:c})}else{if(O.current==null)throw Error(`useFileDiffInstance: A FileDiff instance should exist when unmounting`);N.current=null,O.current.cleanUp(),O.current=null,M.current=null}});da(()=>{let{current:e}=O;if(e==null)return;let t=va({controlledSelection:_,hasCustomHeader:d,hasGutterRenderUtility:u,onEditChange:C,onEditComplete:E,options:r}),n=!Ti(e.options,t);if(e.setOptions(t),!p&&(N.current=null,M.current!=null)){let{current:e}=M;M.current=null,e()}let i=_a(D,o,w);if(e.render({forceRender:n,fileDiff:i.fileDiff,lineAnnotations:i.lineAnnotations}),s!==void 0&&e.setSelectedLines(s),!p||M.current!=null)return;if(y==null)throw Error(`FileDiff: EditContext is not attached`);let a=()=>{O.current===e&&M.current==null&&e.__canAttachEditor()&&(M.current=ya(e,P),k())};if(e.__canAttachEditor()){N.current=null,a();return}let c=e.__prepareForEditing();if(c==null){N.current=null;return}if(N.current?.promise===c)return;let l={promise:c};N.current=l,c.then(()=>{N.current===l&&(a(),N.current=null)}).catch(e=>{N.current===l&&(N.current=null,x(e))})});let I=(0,Y.useCallback)(()=>O.current?.getHoveredLine(),[]),L=(0,Y.useCallback)(e=>O.current?.getAnnotationSlotName(e)??Mi(e),[]);if(b!=null)throw b;return{...j,ref:F,getHoveredLine:I,getAnnotationSlotName:L}}function pa({acceptedCache:e,fileDiff:t,newFile:n,oldFile:r,parseDiffOptions:i}){return(0,Y.useMemo)(()=>{if(t!=null)return t;let{current:a}=e,o=a?.filePair;if(a!=null&&o!=null){if(ma(r,n,o.stale)||ma(r,n,o.installed))return o.fileDiff;a.filePair=null}return St(r??null,n??null,i)},[e,t,r,n,i])}function ma(e,t,n){return mi(e??void 0,n.oldFile??void 0)&&mi(t??void 0,n.newFile??void 0)}function ha(e,t,n){"use no memo";return ga(t,n,e.current)}function ga(e,t,n){return{fileDiff:n?.fileDiff!=null&&pt(e,n.fileDiff.stale)?n.fileDiff.installed:e,lineAnnotations:n?.annotations!=null&&t===n.annotations.stale?n.annotations.installed:t}}function _a(e,t,n){let{current:r}=n,i=ga(e,t,r);return r==null||(r.fileDiff!=null&&!pt(e,r.fileDiff.stale)&&(r.fileDiff=null),t!==r.annotations?.stale&&(r.annotations=null),r.fileDiff==null&&r.annotations==null&&r.filePair==null&&(n.current=null)),i}function va({options:e,controlledSelection:t,hasCustomHeader:n,hasGutterRenderUtility:r,onEditChange:i,onEditComplete:a}){return{...e,controlledSelection:t,renderCustomHeader:n?Jt:e?.renderCustomHeader,renderGutterUtility:r?Jt:e?.renderGutterUtility,onEditChange:i,onEditComplete:a}}function ya(e,t){let n=t();try{return n.edit(e)}catch(e){throw n.cleanUp(),e}}function ba({fileDiff:e,options:t,editorOptions:n,editStateKey:r,metrics:i,lineAnnotations:a,selectedLines:o,className:s,style:c,prerenderedHTML:l,renderAnnotation:u,renderCustomHeader:d,renderHeaderPrefix:f,renderHeaderFilenameSuffix:p,renderHeaderMetadata:m,renderGutterUtility:h,disableWorkerPool:g=!1,edit:_=!1,onEditChange:v,onEditComplete:y}){let{ref:b,getHoveredLine:x,getAnnotationSlotName:S,fileDiff:C,lineAnnotations:w}=fa({fileDiff:e,options:t,editorOptions:n,editStateKey:r,metrics:i,lineAnnotations:a,selectedLines:o,prerenderedHTML:l,hasGutterRenderUtility:h!=null,hasCustomHeader:d!=null,disableWorkerPool:g,edit:_,onEditChange:v,onEditComplete:y}),T=pr({fileDiff:C,renderCustomHeader:d,renderHeaderPrefix:f,renderHeaderFilenameSuffix:p,renderHeaderMetadata:m,renderAnnotation:u,renderGutterUtility:h,lineAnnotations:w,getHoveredLine:x,getAnnotationSlotName:S});return(0,X.jsx)(Si,{ref:b,className:s,style:c,children:Zr(T,l)})}var xa=7;function Sa(e,t){return e!==void 0&&e!==t?e.slice(0,xa):void 0}var Ca=(e,t)=>t.length>0?`${e}: ${t.join(`, `)}`:e;function wa(e,t){let n=hi(e,t?.status);return{checks:li(e),live:Li(e,t?.status),headline:n,lead:Ca(n.label,n.names),moved:Sa(t?.detail?.headSha,e.headOid)}}function Ta(e,t){let n=t===`failed`||t===`running`;return{names:e.results.filter(e=>!n||e.tone===t).map(e=>e.name),passing:n?e.results.filter(e=>e.tone===`passed`).length:0,more:e.more}}function Ea({passing:e,more:t}){return[e>0?` and ${e} passing`:``,t?`${e>0?`,`:``} and more`:``].join(``)}function Da(e,t){let n=c(K(e));return n===void 0?me(e)?{status:`failed`}:{status:`reading`}:{status:`read`,value:t(n)}}function Oa(e,t){return e.conversations.filter(e=>e.anchor.kind===t.kind&&(e.anchor.kind===`walkthrough`||t.kind===`stop`&&e.anchor.title===t.title))}function ka(e){return e.messages.filter(e=>e.author===`developer`)}function Aa(e,t){return e.messages.find(e=>e.author===`agent`&&e.replyTo===t)}function ja(e,t){return(e?.conversations??[]).filter(({anchor:e})=>e.kind===`walkthrough`||!t.includes(e.title))}function Ma(e){return e instanceof Error&&e.message.length>0?e.message:`The request failed. Try again.`}function Na(e){return ka(e).map(t=>({message:t,reply:Aa(e,t.id)}))}function Pa(e,t){return e?Oa(e,{kind:`stop`,title:t}):[]}function Fa([e,t],n,{runId:r,title:i}){let a=e.text.trim(),o=e.sending||n.waiting;return{text:e.text,failure:e.failure?.runId===r?e.failure.message:void 0,waiting:o,change:e=>t(t=>({...t,text:e,failure:void 0})),send:()=>{a&&!o&&(t(e=>({...e,failure:void 0,sending:!0})),n.run({anchor:{kind:`stop`,title:i},text:a}).then(()=>t(t=>({...t,text:t.text===e.text?``:t.text,sending:!1})),n=>t(t=>({...t,failure:t.text===e.text?{runId:r,message:Ma(n)}:void 0,sending:!1}))))}}}function Ia(e){let t=e.walkthrough.status===`read`?e.walkthrough.value:void 0;return{name:Pr(t??{walkthrough:void 0,freshness:`unknown`}),pending:e.walkthrough.status===`reading`,guided:t?.walkthrough!==void 0}}var La=[`queued`,`evidence`,`transcript`,`writing`,`validating`,`ready`],Ra={queued:`Queued`,evidence:`Reading pull request evidence`,transcript:`Reading the coding conversation`,writing:`Writing the walkthrough`,validating:`Checking the walkthrough`,ready:`Walkthrough saved`,failed:`Update failed`};function za(e,t){if(!t)return e;let n=e.attempt??e.walkthrough;return n&&(n.id===t.id||n.createdAt>t.createdAt||n.branch!==t.branch)?e:e.walkthrough?.state.status===`ready`&&t.state.status!==`ready`?{...e,attempt:t}:{walkthrough:t,freshness:`unknown`}}function Ba(e,t,n=!1){let r=e.progress??[],i=r.at(-1),a=e.state.status===`failed`?`failed`:e.state.status===`ready`?`ready`:i?.stage??(e.state.status===`queued`?`queued`:`writing`),o=r.filter(e=>e.stage!==`failed`).at(-1)?.stage,s=a===`failed`?Math.max(0,La.findIndex(e=>e===o)):Math.max(0,La.findIndex(e=>e===a));return{label:t?`Requesting update`:n&&a===`failed`?`Writing failed`:Ra[a],completed:t?0:s,total:La.length-1,entries:r,steps:La.map(e=>Ra[e]),active:t||e.state.status===`queued`||e.state.status===`running`}}function Va(e){switch(e){case`current`:return`Up to date with the current work.`;case`unknown`:return;case`changed`:return`The work changed after this walkthrough’s snapshot. Update to include the latest changes.`}}function Ha(e,t){let n=e.worktree.find(e=>e.path===t),r=n?.comparisons.find(e=>e.scope===`unmerged`||`kind`in e&&e.kind===`deleted`);return{local:n,held:r&&{kind:`worktree`,change:r}}}function Ua(e,t){let{local:n,held:r}=Ha(e,t);return r||(e.branch===void 0?e.branchFailed||n?{kind:`file`}:void 0:e.branch.find(e=>e.path===t)?.status===`deleted`?{kind:`branch`}:{kind:`file`})}var Wa=16,Ga={right:16,down:24},Ka={right:12,down:20},qa={right:32,down:8},Ja=24,Ya=16,Xa=2,Za=6,Qa=8,$a=28,eo=32,to=32,Q=e=>Math.round(e*10)/10;function no(e,t){let n=Math.atan2(e.y-t.y,e.x-t.x),r=Math.PI/7;return[e,{x:e.x-Za*Math.cos(n-r),y:e.y-Za*Math.sin(n-r)},{x:e.x-Za*Math.cos(n+r),y:e.y-Za*Math.sin(n+r)}].map(e=>`${Q(e.x)},${Q(e.y)}`).join(` `)}function ro(e,t,n){let r=n?(t.x-e.x)/2:(t.y-e.y)/2,i=n?{x:e.x+r,y:e.y}:{x:e.x,y:e.y+r},a=n?{x:t.x-r,y:t.y}:{x:t.x,y:t.y-r};return{path:`M${Q(e.x)} ${Q(e.y)} C${Q(i.x)} ${Q(i.y)} ${Q(a.x)} ${Q(a.y)} ${Q(t.x)} ${Q(t.y)}`,arrow:no(t,a),middle:{x:Q((e.x+3*i.x+3*a.x+t.x)/8),y:Q((e.y+3*i.y+3*a.y+t.y)/8)}}}function io(e,t){let n=new Map(e.map(e=>[e,[]]));t.forEach((e,t)=>n.get(e.from)?.push(t));let r=new Map,i=new Set,a=e=>{r.set(e,`open`);for(let o of n.get(e)??[]){let e=t[o]?.to;if(e===void 0)continue;let n=r.get(e);n===`open`?i.add(o):n===void 0&&a(e)}r.set(e,`done`)},o=new Set(t.map(e=>e.to));for(let t of e)!o.has(t)&&!r.has(t)&&a(t);for(let t of e)r.has(t)||a(t);let s=t.map((e,t)=>i.has(t)?{from:e.to,to:e.from}:e),c=new Map(e.map(e=>[e,0]));for(let t=0;t<e.length;t+=1)for(let e of s){let t=(c.get(e.from)??0)+1;(c.get(e.to)??0)<t&&c.set(e.to,t)}for(let t of e){let e=s.filter(e=>e.from===t).map(e=>c.get(e.to)??0);!s.some(e=>e.to===t)&&e.length>0&&c.set(t,Math.min(...e)-1)}let l=[...new Set(c.values())].sort((e,t)=>e-t);return new Map([...c].map(([e,t])=>[e,l.indexOf(t)]))}function ao(e,t,n){let r=Math.max(...e.map(e=>n.get(e)??0))+1,i=Array.from({length:r},()=>[]);for(let t of e)i[n.get(t)??0]?.push(t);let a=()=>new Map(i.flatMap(e=>e.map((e,t)=>[e,t]))),o=(e,r)=>t.flatMap(t=>{let i=t.from===e?t.to:t.to===e?t.from:void 0;if(i===void 0)return[];let a=n.get(i)??0,o=n.get(e)??0;return(r?a<o:a>o)?[i]:[]});for(let e=0;e<4;e+=1){let t=e%2==0,n=a(),r=t?i:[...i].reverse();for(let e of r){let r=new Map(e.map((e,r)=>{let i=o(e,t);return[e,i.length===0?r:i.reduce((e,t)=>e+(n.get(t)??0),0)/i.length]}));e.sort((e,t)=>(r.get(e)??0)-(r.get(t)??0))}}return i}function oo(e,t){let n=new Map;return{points:n,chains:e.map((e,r)=>{let i=(t.get(e.from)??0)*2,a=(t.get(e.to)??0)*2,o=Math.min(i,a),s=Math.max(i,a),c=o+1+2*Math.floor((s-o-1)/4),l=[];for(let t=o+1;t<s;t+=1){let i=`\u0000${r}:${t}`;n.set(i,{id:i,edge:r,label:e.label!==void 0&&t===c}),l.push(i)}return{levels:[o,...l.map((e,t)=>o+1+t),s],ids:i<=a?l:[...l].reverse(),ahead:i<=a}})}}function so(e,t,n){let r=n===`right`,i=e.nodes.map(e=>e.id),a=new Map(e.nodes.map(e=>[e.id,t.node(e)])),o=io(i,e.edges),{points:s,chains:c}=oo(e.edges,o);for(let n of s.values()){let r=e.edges[n.edge]?.label,i=n.label&&r!==void 0?t.label(r):Xa;a.set(n.id,{width:i,height:n.label?Ya:Xa})}let l=new Map([...i.map(e=>[e,(o.get(e)??0)*2]),...c.flatMap(e=>e.ids.map(t=>[t,(e.ahead?e.levels[1+e.ids.indexOf(t)]:e.levels[e.ids.length-e.ids.indexOf(t)])??0]))]),u=e.edges.flatMap((e,t)=>{let n=c[t];if(n===void 0)return[];let r=[e.from,...n.ids,e.to];return r.slice(1).map((e,t)=>({from:r[t]??e,to:e}))}),d=ao([...i,...s.keys()],u,l),f=e=>r?a.get(e)?.width??0:a.get(e)?.height??0,p=e=>r?a.get(e)?.height??0:a.get(e)?.width??0,m=d.map((e,t)=>Math.max(t%2==1?qa[n]:0,...e.map(f))),h=d.map(e=>e.reduce((e,t)=>e+p(t),0)+Math.max(0,e.length-1)*Ga[n]),g=Math.max(...h),_=new Map,v=[],y=Wa;d.forEach((e,t)=>{let i=Wa+(g-(h[t]??0))/2,o=m[t]??0;for(let t of e){let e=a.get(t)?.width??0,s=a.get(t)?.height??0,c=y+(o-f(t))/2;_.set(t,r?{x:c,y:i,width:e,height:s}:{x:i,y:c,width:e,height:s}),i+=p(t)+Ga[n]}v.push({start:y,end:y+o}),y+=o+(t<d.length-1?Ka[n]:0)});let b=new Map;e.edges.forEach((e,t)=>{let n=[e.from,e.to].sort().join(`\0`);b.set(n,[...b.get(n)??[],t])});let x=(e,t)=>r?{x:e,y:t}:{x:t,y:e},S=e=>r?e.y+e.height/2:e.x+e.width/2,C=e.edges.flatMap((e,t)=>{let n=_.get(e.from),i=_.get(e.to),a=c[t];if(n===void 0||i===void 0||a===void 0)return[];let o=b.get([e.from,e.to].sort().join(`\0`))??[],u=(o.indexOf(t)-(o.length-1)/2)*2*Qa,d=a.ahead?1:-1,f=e=>v[l.get(e)??0],p=f(e.from),m=f(e.to);if(p===void 0||m===void 0)return[];let h=e=>r?a.ahead?e.x+e.width:e.x:a.ahead?e.y+e.height:e.y,g=e=>r?a.ahead?e.x:e.x+e.width:a.ahead?e.y:e.y+e.height,y=[x(h(n),S(n)+u),x(a.ahead?p.end:p.start,S(n)+u)],C;for(let e of a.ids){let t=_.get(e),n=f(e);if(t===void 0||n===void 0)continue;let r=S(t);y.push(x(a.ahead?n.start:n.end,r),x(a.ahead?n.end:n.start,r)),s.get(e)?.label&&(C=x((n.start+n.end)/2,r))}y.push(x(a.ahead?m.start:m.end,S(i)+u),x(g(i),S(i)+u));let w=[];for(let e=1;e<y.length;e+=1){let t=y[e-1],n=y[e],i=r?t.y===n.y:t.x===n.x;w.push(i?`L${Q(n.x)} ${Q(n.y)}`:ro(t,n,r).path.replace(/^M\S+ \S+ /,``))}let T=y[0],E=y.at(-1),D=x((r?E.x:E.y)-d*Za,r?E.y:E.x),O=C??y[Math.floor(y.length/2)-1]??x(0,0);return[{index:t,path:`M${Q(T.x)} ${Q(T.y)} ${w.join(` `)}`,arrow:no(E,D),label:e.label===void 0?void 0:{x:Q(O.x),y:Q(O.y)}}]}),w=y+Wa,T=g+32;return{placement:n,width:Q(r?w:T),height:Q(r?T:w),nodes:i.flatMap(e=>{let t=_.get(e);return t===void 0?[]:[{id:e,x:Q(t.x),y:Q(t.y),width:t.width,height:t.height}]}),edges:C,lifelines:[]}}function co(e,t){let n=e.nodes.map(e=>t.node(e)),r=new Map(e.nodes.map((e,t)=>[e.id,t])),i=n.slice(1).map((e,t)=>(n[t]?.width??0)/2+e.width/2+to),a=e.edges.map(e=>{let n=r.get(e.from)??0,i=r.get(e.to)??0;return{low:Math.min(n,i),high:Math.max(n,i),need:e.label?t.label(e.label)+Ja:0}}).sort((e,t)=>e.high-e.low-(t.high-t.low));for(let e of a){let t=i.slice(e.low,e.high).reduce((e,t)=>e+t,0);if(t<e.need){let n=(e.need-t)/(e.high-e.low);for(let t=e.low;t<e.high;t+=1)i[t]=(i[t]??0)+n}}let o=Math.max(...n.map(e=>e.height)),s=[];n.forEach((e,t)=>{s.push(t===0?Wa+e.width/2:(s[t-1]??0)+(i[t-1]??0))});let c=Wa+o,l=c+$a,u=l+Math.max(0,e.edges.length-1)*eo,d=e.edges.flatMap((e,t)=>{let n=s[r.get(e.from)??-1],i=s[r.get(e.to)??-1];if(n===void 0||i===void 0)return[];let a=l+t*eo,o=Math.sign(i-n),c={x:n+o*2,y:a},u={x:i-o*2,y:a};return[{index:t,path:`M${Q(c.x)} ${a} L${Q(u.x)} ${a}`,arrow:no(u,c),label:e.label===void 0?void 0:{x:Q((n+i)/2),y:a-9}}]}),f=n.at(-1)?.width??0;return{placement:`sequence`,width:Q((s.at(-1)??0)+f/2+Wa),height:Q(u+16+Wa),nodes:e.nodes.map((e,t)=>{let r=n[t]??{width:0,height:0};return{id:e.id,x:Q((s[t]??0)-r.width/2),y:Wa+(o-r.height)/2,width:r.width,height:r.height}}),edges:d,lifelines:s.map(e=>({x:Q(e),top:c,bottom:u+16}))}}function lo(e,t,n){if(e.layout===`sequence`)return co(e,t);if(e.layout===`layers`)return so(e,t,`down`);let r=so(e,t,`right`);if(r.width<=n)return r;let i=so(e,t,`down`);return i.width<r.width?i:r}function uo(e,t){let n=new Set,r=new Set([t]);return e.edges.forEach((e,i)=>{(e.from===t||e.to===t)&&(n.add(i),r.add(e.from),r.add(e.to))}),{nodes:r,edges:n}}function fo(e,t){let n=t=>e.nodes.find(e=>e.id===t)?.label??t,r=t=>e.layout===`sequence`?`${t+1}. `:``,i=e=>e.mark===`added`?` (new)`:e.mark===`removed`?` (removed)`:``;return e.edges.flatMap((e,a)=>{let o=e.label===void 0?``:` (${e.label})`;return e.from===t?[`${r(a)}To ${n(e.to)}${o}${i(e)}`]:e.to===t?[`${r(a)}From ${n(e.from)}${o}${i(e)}`]:[]})}function po(e,t,n){if(n===`first`)return e.nodes[0]?.id??t;if(n===`last`)return e.nodes.at(-1)?.id??t;let r=e=>({x:e.x+e.width/2,y:e.y+e.height/2}),i=e.nodes.find(e=>e.id===t);if(i===void 0)return e.nodes[0]?.id??t;let a=r(i),o=n===`left`||n===`right`,s=n===`right`||n===`down`?1:-1,c=e.nodes.flatMap(e=>{if(e.id===t)return[];let n=r(e),c=(o?n.x-a.x:n.y-a.y)*s,l=Math.abs(o?n.y-a.y:n.x-a.x),u=o?(i.height+e.height)/2:(i.width+e.width)/2;return c>1?[{id:e.id,along:c,aside:l,band:l<u}]:[]}),l=c.filter(e=>e.band),u=l.length>0?l:c,d=Math.min(...u.map(e=>e.along));return u.filter(e=>e.along<=d+8).sort((e,t)=>e.aside-t.aside)[0]?.id??t}var mo=30,ho=44,go=8;function _o(e){return{node:t=>{let n=t.mark&&t.mark!==`unchanged`?e.sign:0,r=n+t.label.length*e.label+(t.anchor?e.chevron:0),i=t.note?n+t.note.length*e.note:0;return{width:Math.round(Math.min(e.max,Math.max(e.min,Math.max(r,i)+e.padding))),height:t.note?ho:mo}},label:t=>t.length*e.edge+go}}var vo={added:`new`,changed:`changed`,removed:`removed`,unchanged:`unchanged`};function yo(e){return e.mark===void 0||e.mark===`unchanged`?void 0:nn({change:e.mark,what:``,note:``})}function bo(e){return[e.kind,e.mark===void 0?void 0:vo[e.mark]].filter(Boolean).join(`, `)}function xo(e,t){let n=bo(t),r=fo(e,t.id),i=``;return t.anchor?.kind===`lines`&&(i=`Shows ${t.anchor.excerpt.path}, ${t.anchor.excerpt.lines}.`),t.anchor?.kind===`file`&&(i=`Shows ${t.anchor.path}.`),[n?`${n}.`:``,r.length>0?`${r.join(`; `)}.`:``,i].filter(Boolean).join(` `)}function So(e,t){return e.mark===`added`?`add`:e.mark===`removed`?`del`:t?`lit`:`rest`}function Co(e){let t=(0,Z.c)(3),{children:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,X.jsx)(Lt,{}),t[0]=r):r=t[0];let i;return t[1]===n?i=t[2]:(i=(0,X.jsxs)(X.Fragment,{children:[r,(0,X.jsx)(Qt,{children:n})]}),t[1]=n,t[2]=i),i}function wo(e){let t=(0,Z.c)(6),{children:n}=e,[r,i]=(0,Y.useState)(!0),a=_e(),o;t[0]===a?o=t[1]:(o=a&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(Ft,{connection:a}),(0,X.jsx)(kt,{connection:a}),(0,X.jsx)(yn,{connection:a})]}),t[0]=a,t[1]=o);let s;return t[2]!==n||t[3]!==r||t[4]!==o?(s=(0,X.jsx)(Co,{children:(0,X.jsxs)(Sn,{open:r,onOpenChange:i,children:[n,o]})}),t[2]=n,t[3]=r,t[4]=o,t[5]=s):s=t[5],s}function To(e,t){return{connection:t.connection,scope:{projectId:e.projectId,worktreeId:e.worktreeId}}}var Eo=T(e=>Vn(e).pipe(d,Ve(0)));function Do(e,n){let r=(0,Z.c)(12),i;r[0]!==n||r[1]!==e?(i=Eo(To(e,n)),r[0]=n,r[1]=e,r[2]=i):i=r[2];let a=i,o=O(a),s,l,u;if(r[3]!==o){let e=c(K(o));s=o,l=e,u=e?Br(e):void 0,r[3]=o,r[4]=s,r[5]=l,r[6]=u}else s=r[4],l=r[5],u=r[6];let d=t(a),f;return r[7]!==s||r[8]!==l||r[9]!==u||r[10]!==d?(f={result:s,read:l,phase:u,refresh:d},r[7]=s,r[8]=l,r[9]=u,r[10]=d,r[11]=f):f=r[11],f}function Oo(e,t){let{phase:n}=Do(e,t);return n?.kind===`ready`?n:void 0}function ko(e,t,n){let r=(0,Z.c)(2),i=Jn(e,t.connection,n).result,a;return r[0]===i?a=r[1]:(a=c(K(i))?.files??[],r[0]=i,r[1]=a),a}function Ao(e,t){let n=(0,Z.c)(2),{read:r}=Do(e,t),i;return n[0]===r?i=n[1]:(i=r?dr(r):`Review`,n[0]=r,n[1]=i),i}function jo(e,t){let n=(0,Z.c)(2),{result:r}=Do(e,t),i;return n[0]===r?i=n[1]:(i=Ia({walkthrough:Da(r,Mo)}),n[0]=r,n[1]=i),i}function Mo(e){return e}var No=T(e=>h(t=>{let n=t($r(e));return we(n,e=>{let n=URL.createObjectURL(new Blob([Uint8Array.from(e)]));return t.addFinalizer(()=>URL.revokeObjectURL(n)),n})}));function Po(e){let n=(0,Z.c)(3),r={...To(e.scope,e.context),runId:e.runId,assetId:e.assetId},i=O(No(r)),a=t($r(r)),o;return n[0]!==i||n[1]!==a?(o={url:i,retry:a},n[0]=i,n[1]=a,n[2]=o):o=n[2],o}function Fo(e,n,r,i,a,o){let s=(0,Z.c)(10),c;s[0]!==a||s[1]!==n||s[2]!==o||s[3]!==r||s[4]!==e||s[5]!==i?(c=Vn({...To(e,n),excerpt:{runId:r,step:i,block:a,...o===void 0?{}:{node:o}}}),s[0]=a,s[1]=n,s[2]=o,s[3]=r,s[4]=e,s[5]=i,s[6]=c):c=s[6];let l=c,u=O(l),d=t(l),f;return s[7]!==u||s[8]!==d?(f={result:u,retry:d},s[7]=u,s[8]=d,s[9]=f):f=s[9],f}function Io(e,t,n,r,a){let o=(0,Z.c)(8),s;o[0]!==t.connection||o[1]!==e.projectId||o[2]!==e.worktreeId?(s=_n({connection:t.connection,scope:{projectId:e.projectId,worktreeId:e.worktreeId}}),o[0]=t.connection,o[1]=e.projectId,o[2]=e.worktreeId,o[3]=s):s=o[3];let l;o[4]===Symbol.for(`react.memo_cache_sentinel`)?(l={mode:`promiseExit`},o[4]=l):l=o[4];let[u,d]=i(s,l),f=c(K(Sr(e,t.connection))),p;o[5]!==t.connection||o[6]!==e.projectId?(p=V({connection:t.connection,projectId:e.projectId}),o[5]=t.connection,o[6]=e.projectId,o[7]=p):p=o[7];let m=O(p);return Cn([u,d],{pulls:m,branch:f?.branch?.name??r?.branch,displayedRun:r,base:n,writer:a})}function Lo(e,t){let n=(0,Z.c)(14),{connection:r}=e.context,{projectId:i}=e.scope,a=De(Cr),o;n[0]!==r||n[1]!==i||n[2]!==t.branch||n[3]!==t.pullRequestNumber?(o=ar({connection:r,projectId:i,branch:t.branch,pullRequestNumber:t.pullRequestNumber}),n[0]=r,n[1]=i,n[2]=t.branch,n[3]=t.pullRequestNumber,n[4]=o):o=n[4];let s=O(o);if(!s)return;let c;n[5]!==r||n[6]!==e||n[7]!==a||n[8]!==i||n[9]!==s?(c=t=>{a(t===void 0?void 0:{projectId:i,number:s.number,name:t}),e.onOpen(Xr({projectId:i,number:s.number,environmentId:r.environmentId,shownOn:r.environmentId}))},n[5]=r,n[6]=e,n[7]=a,n[8]=i,n[9]=s,n[10]=c):c=n[10];let l;return n[11]!==s||n[12]!==c?(l={...s,openCheck:c},n[11]=s,n[12]=c,n[13]=l):l=n[13],l}function $(e){let t=(0,Z.c)(4),{text:n}=e,r;t[0]===n?r=t[1]:(r=an(n).map(Ro),t[0]=n,t[1]=r);let i;return t[2]===r?i=t[3]:(i=(0,X.jsx)(X.Fragment,{children:r}),t[2]=r,t[3]=i),i}function Ro(e,t){return e.kind===`code`?(0,X.jsx)(`code`,{className:`rounded bg-muted px-1 py-px font-mono text-[0.86em]`,children:e.text},t):e.text}var zo=a(`group/bubble relative flex w-fit max-w-[80%] min-w-0 flex-col gap-1 group-data-[align=end]/message:self-end data-[align=end]:self-end data-[variant=ghost]:max-w-full`,{variants:{variant:{default:`*:data-[slot=bubble-content]:bg-primary *:data-[slot=bubble-content]:text-primary-foreground [&>[data-slot=bubble-content]:is(button,a):hover]:bg-primary/80`,secondary:`*:data-[slot=bubble-content]:bg-secondary *:data-[slot=bubble-content]:text-secondary-foreground dark:*:data-[slot=bubble-content]:bg-input/30 [&>[data-slot=bubble-content]:is(button,a):hover]:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)]`,muted:`*:data-[slot=bubble-content]:bg-muted [&>[data-slot=bubble-content]:is(button,a):hover]:bg-[color-mix(in_oklch,var(--muted),var(--foreground)_5%)]`,tinted:`*:data-[slot=bubble-content]:bg-[oklch(from_var(--primary)_0.93_calc(c*0.4)_h)] *:data-[slot=bubble-content]:text-foreground dark:*:data-[slot=bubble-content]:bg-[oklch(from_var(--primary)_0.3_calc(c*0.4)_h)] [&>[data-slot=bubble-content]:is(button,a):hover]:bg-[oklch(from_var(--primary)_0.88_calc(c*0.5)_h)] dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-[oklch(from_var(--primary)_0.35_calc(c*0.5)_h)]`,outline:`*:data-[slot=bubble-content]:border-border *:data-[slot=bubble-content]:bg-background [&>[data-slot=bubble-content]:is(button,a):hover]:bg-muted [&>[data-slot=bubble-content]:is(button,a):hover]:text-foreground dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-input/30`,ghost:`border-none *:data-[slot=bubble-content]:rounded-none *:data-[slot=bubble-content]:bg-transparent *:data-[slot=bubble-content]:p-0 [&>[data-slot=bubble-content]:is(button,a):hover]:bg-muted [&>[data-slot=bubble-content]:is(button,a):hover]:text-foreground dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-muted/50`,destructive:`*:data-[slot=bubble-content]:bg-destructive/10 *:data-[slot=bubble-content]:text-destructive dark:*:data-[slot=bubble-content]:bg-destructive/20 [&>[data-slot=bubble-content]:is(button,a):hover]:bg-destructive/20 dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-destructive/30`}},defaultVariants:{variant:`default`}});function Bo({variant:e=`default`,align:t=`start`,className:n,...r}){return(0,X.jsx)(`div`,{"data-slot":`bubble`,"data-variant":e,"data-align":t,className:j(zo({variant:e}),n),...r})}function Vo({className:e,render:t,...n}){return p({defaultTagName:`div`,props:U({className:j(`w-fit max-w-full min-w-0 overflow-hidden rounded-lg border border-transparent px-2.5 py-1.5 text-xs/relaxed wrap-break-word group-data-[align=end]/bubble:self-end [button]:text-left [button,a]:transition-colors [button,a]:outline-none [button,a]:focus-visible:border-ring [button,a]:focus-visible:ring-2 [button,a]:focus-visible:ring-ring/30`,e)},n),render:t,state:{slot:`bubble-content`}})}a(`absolute z-10 flex w-fit shrink-0 items-center justify-center gap-1 rounded-full bg-muted px-1.5 py-0.5 text-xs ring-2 ring-card has-[button]:p-0`,{variants:{side:{top:`top-0 -translate-y-3/4`,bottom:`bottom-0 translate-y-3/4`},align:{start:`left-3`,end:`right-3`}},defaultVariants:{side:`bottom`,align:`end`}});function Ho({className:e,...t}){return(0,X.jsx)(`div`,{"data-slot":`message-group`,className:j(`flex min-w-0 flex-col gap-1.5`,e),...t})}function Uo({className:e,align:t=`start`,...n}){return(0,X.jsx)(`div`,{"data-slot":`message`,"data-align":t,className:j(`group/message relative flex w-full min-w-0 gap-1.5 text-xs/relaxed data-[align=end]:flex-row-reverse`,e),...n})}function Wo({className:e,...t}){return(0,X.jsx)(`div`,{"data-slot":`message-content`,className:j(`flex w-full min-w-0 flex-col gap-2 wrap-break-word group-data-[align=end]/message:*:data-slot:self-end`,e),...t})}function Go({className:e,...t}){return(0,X.jsx)(`div`,{"data-slot":`message-header`,className:j(`flex max-w-full min-w-0 items-center px-2.5 text-[0.625rem] font-medium text-muted-foreground group-has-data-[variant=ghost]/message:px-0`,e),...t})}function Ko({scope:e,context:t,run:n}){return{connection:t.connection,runId:n.id,scope:{projectId:e.projectId,worktreeId:e.worktreeId}}}function qo(e){let n=(0,Z.c)(10),r;n[0]===e?r=n[1]:(r=dn(Ko(e)),n[0]=e,n[1]=r);let i=r,a=O(i),o;n[2]===a?o=n[3]:(o=c(K(a)),n[2]=a,n[3]=o);let s;n[4]===a?s=n[5]:(s=me(a),n[4]=a,n[5]=s);let l=t(i),u;return n[6]!==o||n[7]!==s||n[8]!==l?(u={view:o,failed:s,refresh:l},n[6]=o,n[7]=s,n[8]=l,n[9]=u):u=n[9],u}function Jo(e){let t=(0,Z.c)(3),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={mode:`promiseExit`},t[0]=n):n=t[0];let r=i(e,n),a;return t[1]===r?a=t[2]:(a=tn(r),t[1]=r,t[2]=a),a}function Yo(e){let t=(0,Z.c)(4),n;t[0]===e?n=t[1]:(n=Nt(Ko(e)),t[0]=e,t[1]=n);let r=Jo(n.retryAnswer),i;return t[2]===r?i=t[3]:(i={retry:r},t[2]=r,t[3]=i),i}function Xo(e,t){let n=(0,Z.c)(7),[r,i]=(0,Y.useState)(),a=Yo(e),o;n[0]!==a.retry||n[1]!==t?(o=()=>{i(void 0),a.retry.run(t).catch(e=>i(Ma(e)))},n[0]=a.retry,n[1]=t,n[2]=o):o=n[2];let s=o,c;return n[3]!==a.retry.waiting||n[4]!==r||n[5]!==s?(c={failure:r,waiting:a.retry.waiting,retry:s},n[3]=a.retry.waiting,n[4]=r,n[5]=s,n[6]=c):c=n[6],c}function Zo(e,t){let n=Ko(e);return Fa(i(xr(n,e.run,t)),Jo(Nt(n).addMessage),{runId:n.runId,title:t})}function Qo(e){let t=(0,Z.c)(8),n;t[0]===e?n=t[1]:(n=Nt(Ko(e)),t[0]=e,t[1]=n);let r=Jo(n.decideCall),[i,a]=(0,Y.useState)(),o;t[2]===r?o=t[3]:(o=e=>{a(void 0),r.run(Fn(e)).catch(e=>a(Ma(e)))},t[2]=r,t[3]=o);let s;return t[4]!==r.waiting||t[5]!==i||t[6]!==o?(s={failure:i,waiting:r.waiting,decide:o},t[4]=r.waiting,t[5]=i,t[6]=o,t[7]=s):s=t[7],s}function $o(e,t){let n=(0,Z.c)(11),r;n[0]!==e.context||n[1]!==e.scope?(r={scope:e.scope,context:e.context},n[0]=e.context,n[1]=e.scope,n[2]=r):r=n[2];let i=gn(r),[a,o]=(0,Y.useState)(!1),[s,c]=(0,Y.useState)(),l;n[3]!==i.add||n[4]!==t?(l=e=>{c(void 0),i.add.run({anchor:{kind:`step`,title:t},text:e}).then(()=>o(!0),()=>c(`The comment was not saved. Try again.`))},n[3]=i.add,n[4]=t,n[5]=l):l=n[5];let u;return n[6]!==a||n[7]!==i.add.waiting||n[8]!==s||n[9]!==l?(u={added:a,failure:s,waiting:i.add.waiting,add:l},n[6]=a,n[7]=i.add.waiting,n[8]=s,n[9]=l,n[10]=u):u=n[10],u}function es(e){let t=(0,Z.c)(40),{message:n,question:r,stepTitle:i,owner:a}=e,[o,s]=(0,Y.useState)(!1),[c,l]=(0,Y.useState)(!1),u;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(u=()=>e=>{if(!e)return;let t=()=>l(e.scrollHeight>e.clientHeight);t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},t[0]=u):u=t[0];let[d]=(0,Y.useState)(u),{failure:f,waiting:p,retry:m}=Xo(a,n.replyTo),h=n.state,g=ye(a.context),_;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,X.jsx)(Go,{children:`Walkthrough agent`}),t[1]=_):_=t[1];let v;t[2]!==o||t[3]!==h.status||t[4]!==h.text?(v=h.status===`answered`?(0,X.jsx)(`span`,{ref:d,className:o?void 0:`line-clamp-3`,children:(0,X.jsx)($,{text:h.text})}):null,t[2]=o,t[3]=h.status,t[4]=h.text,t[5]=v):v=t[5];let y;t[6]===h.status?y=t[7]:(y=h.status===`answering`&&(0,X.jsx)(`span`,{role:`status`,className:`text-muted-foreground`,children:`Working…`}),t[6]=h.status,t[7]=y);let b;t[8]!==h.failure||t[9]!==h.status?(b=h.status===`failed`&&(0,X.jsx)(`span`,{children:h.failure.message}),t[8]=h.failure,t[9]=h.status,t[10]=b):b=t[10];let x;t[11]!==v||t[12]!==y||t[13]!==b?(x=(0,X.jsx)(Bo,{variant:`ghost`,className:`max-w-full`,children:(0,X.jsxs)(Vo,{className:`whitespace-pre-wrap`,children:[v,y,b]})}),t[11]=v,t[12]=y,t[13]=b,t[14]=x):x=t[14];let S;t[15]!==c||t[16]!==o||t[17]!==h.status?(S=h.status===`answered`&&!o&&c&&(0,X.jsx)(H,{variant:`link`,size:`flush`,onClick:()=>s(!0),children:`Read all`}),t[15]=c,t[16]=o,t[17]=h.status,t[18]=S):S=t[18];let C;t[19]!==m||t[20]!==h.status||t[21]!==p||t[22]!==g?(C=h.status===`failed`&&(0,X.jsx)(H,{variant:`link`,size:`flush`,disabled:p||!!g,"aria-description":g,onClick:()=>m(),children:`Try again`}),t[19]=m,t[20]=h.status,t[21]=p,t[22]=g,t[23]=C):C=t[23];let w;t[24]!==a||t[25]!==r||t[26]!==h.status||t[27]!==h.text||t[28]!==i?(w=h.status===`answered`&&i!==void 0&&(0,X.jsx)(ts,{owner:a,stepTitle:i,text:Yt(r,h.text)}),t[24]=a,t[25]=r,t[26]=h.status,t[27]=h.text,t[28]=i,t[29]=w):w=t[29];let T;t[30]!==S||t[31]!==C||t[32]!==w?(T=(0,X.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[S,C,w]}),t[30]=S,t[31]=C,t[32]=w,t[33]=T):T=t[33];let E;t[34]===f?E=t[35]:(E=f&&(0,X.jsx)(`p`,{role:`alert`,className:`text-caption text-destructive`,children:f}),t[34]=f,t[35]=E);let D;return t[36]!==T||t[37]!==E||t[38]!==x?(D=(0,X.jsx)(Uo,{children:(0,X.jsxs)(Wo,{children:[_,x,T,E]})}),t[36]=T,t[37]=E,t[38]=x,t[39]=D):D=t[39],D}function ts(e){let t=(0,Z.c)(13),{owner:n,stepTitle:r,text:i}=e,a=$o(n,r),o=ye(n.context);if(a.added){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,X.jsx)(`span`,{role:`status`,className:`text-caption text-muted-foreground`,children:`Added to the review`}),t[0]=e):e=t[0],e}let s=a.waiting||!!o,c;t[1]!==a||t[2]!==i?(c=()=>a.add(i),t[1]=a,t[2]=i,t[3]=c):c=t[3];let l;t[4]!==s||t[5]!==c||t[6]!==o?(l=(0,X.jsx)(H,{variant:`link`,size:`flush`,disabled:s,"aria-description":o,onClick:c,children:`Add to review`}),t[4]=s,t[5]=c,t[6]=o,t[7]=l):l=t[7];let u;t[8]===a.failure?u=t[9]:(u=a.failure&&(0,X.jsx)(`span`,{role:`alert`,className:`text-caption text-destructive`,children:a.failure}),t[8]=a.failure,t[9]=u);let d;return t[10]!==l||t[11]!==u?(d=(0,X.jsxs)(X.Fragment,{children:[l,u]}),t[10]=l,t[11]=u,t[12]=d):d=t[12],d}function ns({conversation:e,owner:t,stepTitle:n}){return Na(e).map(({message:e,reply:r})=>(0,X.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,X.jsx)(Uo,{align:`end`,children:(0,X.jsx)(Wo,{children:(0,X.jsx)(Bo,{align:`end`,variant:`secondary`,children:(0,X.jsx)(Vo,{className:`whitespace-pre-wrap`,children:(0,X.jsx)($,{text:e.text})})})})}),r&&(0,X.jsx)(es,{owner:t,message:r,question:e.text,stepTitle:n})]},e.id))}function rs(e){let t=(0,Z.c)(53),{owner:n,title:r,placeholder:i,onComment:a}=e,o=ye(n.context),{text:s,failure:c,waiting:l,change:u,send:d}=Zo(n,r),f;t[0]!==d||t[1]!==o?(f=()=>{o||d()},t[0]=d,t[1]=o,t[2]=f):f=t[2];let p=f,m;t[3]===u?m=t[4]:(m=()=>u(``),t[3]=u,t[4]=m);let{waiting:h,failure:g,submit:_}=Et(a,m),v;t[5]!==_||t[6]!==s||t[7]!==o?(v=()=>{let e=s.trim();e&&!o&&_(e)},t[5]=_,t[6]=s,t[7]=o,t[8]=v):v=t[8];let y=v,b;t[9]===u?b=t[10]:(b=e=>u(e.target.value),t[9]=u,t[10]=b);let S;t[11]===p?S=t[12]:(S=e=>{e.key===`Enter`&&!e.shiftKey&&!e.nativeEvent.isComposing&&(e.preventDefault(),p())},t[11]=p,t[12]=S);let w;t[13]!==i||t[14]!==b||t[15]!==S||t[16]!==s?(w=(0,X.jsx)(Pn,{value:s,rows:1,maxLength:8e3,"aria-label":i,placeholder:i,className:`min-h-9`,onChange:b,onKeyDown:S}),t[13]=i,t[14]=b,t[15]=S,t[16]=s,t[17]=w):w=t[17];let T;t[18]!==y||t[19]!==h||t[20]!==a||t[21]!==s||t[22]!==o?(T=a&&(0,X.jsx)(On,{size:`xs`,variant:`outline`,focusableWhenDisabled:!0,disabled:!s.trim()||h||!!o,"aria-description":o,onClick:y,children:`Comment`}),t[18]=y,t[19]=h,t[20]=a,t[21]=s,t[22]=o,t[23]=T):T=t[23];let E=a?`xs`:`icon-xs`,D=a?`Ask`:`Send`,O;t[24]!==s||t[25]!==l||t[26]!==o?(O=!s.trim()||l||!!o,t[24]=s,t[25]=l,t[26]=o,t[27]=O):O=t[27];let k=a&&`Ask`,A;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,X.jsx)(ut,{}),t[28]=A):A=t[28];let j;t[29]!==p||t[30]!==O||t[31]!==k||t[32]!==E||t[33]!==D||t[34]!==o?(j=(0,X.jsx)(x,{render:(0,X.jsxs)(On,{size:E,variant:`default`,"aria-label":D,focusableWhenDisabled:!0,disabled:O,"aria-description":o,onClick:p,children:[k,A]})}),t[29]=p,t[30]=O,t[31]=k,t[32]=E,t[33]=D,t[34]=o,t[35]=j):j=t[35];let M=a?`Ask the Walkthrough agent`:`Send`,N;t[36]===M?N=t[37]:(N=(0,X.jsx)(He,{children:M}),t[36]=M,t[37]=N);let P;t[38]!==j||t[39]!==N?(P=(0,X.jsxs)(C,{children:[j,N]}),t[38]=j,t[39]=N,t[40]=P):P=t[40];let F;t[41]!==P||t[42]!==T?(F=(0,X.jsxs)(jn,{align:`inline-end`,children:[T,P]}),t[41]=P,t[42]=T,t[43]=F):F=t[43];let I;t[44]!==F||t[45]!==w?(I=(0,X.jsxs)(Vt,{children:[w,F]}),t[44]=F,t[45]=w,t[46]=I):I=t[46];let L;t[47]!==g||t[48]!==c?(L=(c??g)&&(0,X.jsx)(`p`,{role:`alert`,className:`text-caption text-destructive`,children:c??g}),t[47]=g,t[48]=c,t[49]=L):L=t[49];let R;return t[50]!==I||t[51]!==L?(R=(0,X.jsxs)(X.Fragment,{children:[I,L]}),t[50]=I,t[51]=L,t[52]=R):R=t[52],R}function is(e){let t=(0,Z.c)(16),{owner:n,title:r}=e,i;t[0]!==n.context||t[1]!==n.scope?(i={scope:n.scope,context:n.context},t[0]=n.context,t[1]=n.scope,t[2]=i):i=t[2];let a=i,{view:o}=Ct(a),s,c,l;if(t[3]!==a||t[4]!==r||t[5]!==o){l=Symbol.for(`react.early_return_sentinel`);bb0:{let e;t[9]===r?e=t[10]:(e=e=>e.kind===`step`&&e.title===r,t[9]=r,t[10]=e);let n=mt(o,e);if(n.length===0){l=null;break bb0}s=`flex flex-col gap-2`;let i;t[11]===a?i=t[12]:(i=e=>(0,X.jsx)(Qr,{owner:a,comment:e},e.id),t[11]=a,t[12]=i),c=n.map(i)}t[3]=a,t[4]=r,t[5]=o,t[6]=s,t[7]=c,t[8]=l}else s=t[6],c=t[7],l=t[8];if(l!==Symbol.for(`react.early_return_sentinel`))return l;let u;return t[13]!==s||t[14]!==c?(u=(0,X.jsx)(`div`,{className:s,children:c}),t[13]=s,t[14]=c,t[15]=u):u=t[15],u}function as(e){let t=(0,Z.c)(31),{owner:n,title:r,stepTitle:i}=e,{view:a,failed:o,refresh:s}=qo(n),c;t[0]!==n.context||t[1]!==n.scope?(c={scope:n.scope,context:n.context},t[0]=n.context,t[1]=n.scope,t[2]=c):c=t[2];let l=gn(c),u,d,f;if(t[3]!==o||t[4]!==n||t[5]!==s||t[6]!==i||t[7]!==r||t[8]!==a){let e=Pa(a,r);u=`flex flex-col gap-3`,t[12]!==o||t[13]!==s?(d=o&&(0,X.jsxs)(`p`,{role:`alert`,className:`text-caption`,children:[`Comments could not be read.`,` `,(0,X.jsx)(H,{variant:`link`,size:`flush`,onClick:s,children:`Try again`})]}),t[12]=o,t[13]=s,t[14]=d):d=t[14],f=e.length>0&&(0,X.jsx)(`div`,{className:`border-t pt-3`,children:(0,X.jsx)(Ho,{children:e.map(e=>(0,X.jsx)(ns,{owner:n,conversation:e,stepTitle:i},e.runId))})}),t[3]=o,t[4]=n,t[5]=s,t[6]=i,t[7]=r,t[8]=a,t[9]=u,t[10]=d,t[11]=f}else u=t[9],d=t[10],f=t[11];let p;t[15]!==n||t[16]!==i?(p=(0,X.jsx)(is,{owner:n,title:i}),t[15]=n,t[16]=i,t[17]=p):p=t[17];let m;t[18]!==l.add||t[19]!==i?(m=e=>l.add.run({anchor:{kind:`step`,title:i},text:e}),t[18]=l.add,t[19]=i,t[20]=m):m=t[20];let h;t[21]!==n||t[22]!==m||t[23]!==r?(h=(0,X.jsx)(rs,{owner:n,title:r,placeholder:`Comment on this step, or ask the agent`,onComment:m}),t[21]=n,t[22]=m,t[23]=r,t[24]=h):h=t[24];let g;return t[25]!==u||t[26]!==d||t[27]!==f||t[28]!==p||t[29]!==h?(g=(0,X.jsxs)(`div`,{className:u,children:[d,f,p,h]}),t[25]=u,t[26]=d,t[27]=f,t[28]=p,t[29]=h,t[30]=g):g=t[30],g}function os(e){let t=(0,Z.c)(18),{owner:n,titles:r}=e,{view:i}=qo(n),a,o,s,c,l;if(t[0]!==n||t[1]!==r||t[2]!==i){l=Symbol.for(`react.early_return_sentinel`);bb0:{let e=ja(i,r);if(e.length===0){l=null;break bb0}s=`flex flex-col gap-3 border-t pt-5`,t[8]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,X.jsx)(`h2`,{className:`text-ui font-semibold`,children:`Earlier comments`}),t[8]=c):c=t[8],a=Ho;let u;t[9]===n?u=t[10]:(u=(e,t)=>(0,X.jsx)(ns,{owner:n,conversation:e,stepTitle:void 0},`${e.runId}:${t}`),t[9]=n,t[10]=u),o=e.map(u)}t[0]=n,t[1]=r,t[2]=i,t[3]=a,t[4]=o,t[5]=s,t[6]=c,t[7]=l}else a=t[3],o=t[4],s=t[5],c=t[6],l=t[7];if(l!==Symbol.for(`react.early_return_sentinel`))return l;let u;t[11]!==a||t[12]!==o?(u=(0,X.jsx)(a,{children:o}),t[11]=a,t[12]=o,t[13]=u):u=t[13];let d;return t[14]!==s||t[15]!==c||t[16]!==u?(d=(0,X.jsxs)(`section`,{className:s,children:[c,u]}),t[14]=s,t[15]=c,t[16]=u,t[17]=d):d=t[17],d}function ss(e){let t=(0,Z.c)(3),{copy:n}=e,r=n.message&&` ${n.message}`,i;return t[0]!==n.title||t[1]!==r?(i=(0,X.jsxs)(`p`,{role:`alert`,className:`min-w-0 flex-1 basis-64 font-medium text-pretty`,children:[n.title,r]}),t[0]=n.title,t[1]=r,t[2]=i):i=t[2],i}function cs(e){let t=(0,Z.c)(76),{run:n,requesting:r,first:i,reused:a,freshness:o,failure:s,onUpdate:c,writeBlock:l,controls:u}=e,d=r!==void 0&&r,f=i!==void 0&&i,p=a!==void 0&&a,m,h,g,_,v,y,b,x,S,C,w,T,E,D;if(t[0]!==u||t[1]!==s||t[2]!==f||t[3]!==o||t[4]!==c||t[5]!==d||t[6]!==p||t[7]!==n||t[8]!==l){x=Symbol.for(`react.early_return_sentinel`);bb0:{if(m=Ba(n,d,f),n.state.status===`ready`&&!m.active&&!d&&!s){let e=o===`changed`,r;t[23]!==e||t[24]!==p||t[25]!==n.state.writtenAt?(r=p&&!e?`Already up to date: the saved walkthrough was reused.`:(0,X.jsxs)(X.Fragment,{children:[`Saved`,` `,(0,X.jsx)(`time`,{dateTime:n.state.writtenAt,children:new Date(n.state.writtenAt).toLocaleString(void 0,{dateStyle:`medium`,timeStyle:`short`})}),e&&` · Behind the current work`]}),t[23]=e,t[24]=p,t[25]=n.state.writtenAt,t[26]=r):r=t[26];let i;t[27]===r?i=t[28]:(i=(0,X.jsx)(`p`,{role:`status`,children:r}),t[27]=r,t[28]=i);let a;t[29]!==e||t[30]!==u||t[31]!==c||t[32]!==l?(a=c&&u?.({label:`Update walkthrough`,variant:e?`outline`:`ghost`,disabled:!!l,description:l,onClick:c}),t[29]=e,t[30]=u,t[31]=c,t[32]=l,t[33]=a):a=t[33];let s;t[34]!==i||t[35]!==a?(s=(0,X.jsxs)(`section`,{"aria-label":`Walkthrough status`,className:`flex flex-wrap items-center justify-between gap-2 text-caption text-muted-foreground`,children:[i,a]}),t[34]=i,t[35]=a,t[36]=s):s=t[36],x=s;break bb0}T=`Walkthrough status`,E=`flex flex-col gap-3 rounded-lg border p-4 text-ui`;let e=s&&!m.active?(0,X.jsx)(ss,{copy:Dr(s.failure,s.writer)}):(0,X.jsx)(`p`,{role:`status`,className:`font-medium`,children:m.label}),r=!m.active&&c&&u?.({label:s?`Try again`:`Update walkthrough`,disabled:!!l,description:l,onClick:c});t[37]!==e||t[38]!==r?(D=(0,X.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[e,r]}),t[37]=e,t[38]=r,t[39]=D):D=t[39],t[40]!==n.state.status||t[41]!==n.state.writtenAt?(h=n.state.status===`ready`&&(0,X.jsxs)(`p`,{className:`text-caption text-muted-foreground`,children:[`Last written`,` `,(0,X.jsx)(`time`,{dateTime:n.state.writtenAt,children:new Date(n.state.writtenAt).toLocaleString()})]}),t[40]=n.state.status,t[41]=n.state.writtenAt,t[42]=h):h=t[42],t[43]!==d||t[44]!==p?(g=p&&!d&&(0,X.jsx)(`p`,{className:`text-caption text-muted-foreground`,children:`This snapshot already has a walkthrough. The saved version was reused.`}),t[43]=d,t[44]=p,t[45]=g):g=t[45];let i=m.total,a=m.completed,O=m.label,k=n.state.status===`failed`?`bg-destructive`:`bg-primary`,A;t[46]===k?A=t[47]:(A=j(`h-full`,k),t[46]=k,t[47]=A);let M=`${m.completed/m.total*100}%`,N;t[48]===M?N=t[49]:(N={width:M},t[48]=M,t[49]=N);let P;t[50]!==A||t[51]!==N?(P=(0,X.jsx)(`div`,{className:A,style:N}),t[50]=A,t[51]=N,t[52]=P):P=t[52],_=(0,X.jsx)(`div`,{role:`progressbar`,"aria-label":`Walkthrough stages`,"aria-valuemin":0,"aria-valuemax":i,"aria-valuenow":a,"aria-valuetext":O,className:`h-1.5 overflow-hidden rounded-full bg-muted`,children:P}),v=(0,X.jsx)(`ol`,{"aria-label":`Update stages`,className:`flex flex-wrap gap-x-4 gap-y-1 text-caption text-muted-foreground`,children:m.steps.map((e,t)=>{let r=!d&&t===m.completed,i=t<m.completed;return(0,X.jsxs)(`li`,{"aria-current":r?`step`:void 0,className:j(`flex items-center gap-1`,r&&`font-medium text-foreground`,r&&n.state.status===`failed`&&`text-destructive`),children:[i?(0,X.jsx)(R,{"aria-label":`Done`,className:`size-3 shrink-0 text-add-fg`}):(0,X.jsxs)(`span`,{className:`tabular-nums`,children:[t+1,`.`]}),e]},e)})}),t[53]===d?y=t[54]:(y=d&&(0,X.jsx)(`p`,{children:`Sending the request and capturing the current work.`}),t[53]=d,t[54]=y),b=o&&(m.active||Va(o))&&(0,X.jsx)(`p`,{className:`text-foreground-2`,children:m.active?`Showing the saved walkthrough while the update runs.`:Va(o)}),t[55]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,X.jsx)(`summary`,{className:`cursor-pointer text-muted-foreground`,children:`Writing log`}),t[55]=w):w=t[55],S=`mt-2 flex flex-col gap-2 text-caption text-foreground-2`,C=m.entries.map(ls)}t[0]=u,t[1]=s,t[2]=f,t[3]=o,t[4]=c,t[5]=d,t[6]=p,t[7]=n,t[8]=l,t[9]=m,t[10]=h,t[11]=g,t[12]=_,t[13]=v,t[14]=y,t[15]=b,t[16]=x,t[17]=S,t[18]=C,t[19]=w,t[20]=T,t[21]=E,t[22]=D}else m=t[9],h=t[10],g=t[11],_=t[12],v=t[13],y=t[14],b=t[15],x=t[16],S=t[17],C=t[18],w=t[19],T=t[20],E=t[21],D=t[22];if(x!==Symbol.for(`react.early_return_sentinel`))return x;let O;t[56]===m.entries.length?O=t[57]:(O=m.entries.length===0&&(0,X.jsx)(`li`,{children:`This walkthrough predates the writing log. Its recorded status is shown above.`}),t[56]=m.entries.length,t[57]=O);let k;t[58]!==O||t[59]!==S||t[60]!==C?(k=(0,X.jsxs)(`ol`,{className:S,children:[C,O]}),t[58]=O,t[59]=S,t[60]=C,t[61]=k):k=t[61];let A;t[62]!==k||t[63]!==w?(A=(0,X.jsxs)(`details`,{children:[w,k]}),t[62]=k,t[63]=w,t[64]=A):A=t[64];let M;return t[65]!==h||t[66]!==g||t[67]!==_||t[68]!==v||t[69]!==y||t[70]!==b||t[71]!==A||t[72]!==T||t[73]!==E||t[74]!==D?(M=(0,X.jsxs)(`section`,{"aria-label":T,className:E,children:[D,h,g,_,v,y,b,A]}),t[65]=h,t[66]=g,t[67]=_,t[68]=v,t[69]=y,t[70]=b,t[71]=A,t[72]=T,t[73]=E,t[74]=D,t[75]=M):M=t[75],M}function ls(e,t){return(0,X.jsxs)(`li`,{children:[(0,X.jsx)(`time`,{dateTime:e.at,className:`mr-2 font-mono`,children:new Date(e.at).toLocaleString()}),e.message]},`${e.at}:${t}`)}function us(e){let t=(0,Z.c)(8),{label:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=/^(.*\s)([0-9a-f]{7})$/,t[0]=r):r=t[0];let i;t[1]===n?i=t[2]:(i=r.exec(n),t[1]=n,t[2]=i);let a=i;if(!a)return n;let o;t[3]===a[2]?o=t[4]:(o=(0,X.jsx)(`span`,{className:`font-mono`,children:a[2]}),t[3]=a[2],t[4]=o);let s;return t[5]!==a[1]||t[6]!==o?(s=(0,X.jsxs)(X.Fragment,{children:[a[1],o]}),t[5]=a[1],t[6]=o,t[7]=s):s=t[7],s}function ds(e,{orientation:t=`horizontal`,dir:n=`ltr`,arrows:r=`all`}={}){if(Vi(e))return null;if(e.key===`Home`)return{bound:`min`};if(e.key===`End`)return{bound:`max`};if(e.key===`PageUp`||e.key===`PageDown`)return{direction:e.key===`PageUp`?1:-1,size:`large`};let i=n===`rtl`&&t===`horizontal`?-1:1,a=r===`horizontal`?0:e.key===`ArrowUp`?1:e.key===`ArrowDown`?-1:0,o=r===`vertical`?0:e.key===`ArrowRight`?i:e.key===`ArrowLeft`?-i:0,s=a||o;return s?{direction:s,size:e.shiftKey?`large`:e.altKey?`small`:`step`}:null}function fs(e,t,n){return ps(t>0?e[t-1]:void 0,e[t+1],n)}function ps(e,t,n){let r=n.minStepsBetweenThumbs*n.step,i=Zi(n),a=Gi(e===void 0?n.min:e+r,n.min,i);return{lower:a,upper:Gi(t===void 0?i:t-r,a,i)}}function ms(e,t,n,r){let{lower:i,upper:a}=fs(e,t,r),o=Gi($i(n,r),i,a);if(o===e[t])return e;let s=e.slice();return s[t]=o,s}function hs(e,t){return e.map(e=>Gi(e,t.min,t.max)).sort((e,t)=>e-t)}function gs(e,{shiftKey:t=!1,rtl:n=!1,orientation:r=`horizontal`}={},i,a,o){let s=ds({key:e,shiftKey:t},{orientation:r,dir:n?`rtl`:`ltr`});return s?`bound`in s?s.bound===`min`?a.lower:a.upper:ta(i,s,o):null}function _s(e,t){let n=0;for(let r=1;r<e.length;r++)Math.abs(e[r]-t)<Math.abs(e[n]-t)&&(n=r);let r=vs(e,n);return r.length===1?{index:n,stack:r}:t<e[n]?{index:r[0],stack:r}:t>e[n]?{index:r[r.length-1],stack:r}:{index:null,stack:r}}function vs(e,t){let n=[];for(let r=0;r<e.length;r++)e[r]===e[t]&&n.push(r);return n}function ys(e,t){return t<0?e[0]:e[e.length-1]}function bs(e,t){return t.max>t.min?xs((Gi(e,t.min,t.max)-t.min)/(t.max-t.min)*100):0}function xs(e){return Math.round(e*1e4)/1e4}function Ss(e,t,{rtl:n=!1,vertical:r=!1}={}){let i=r?(t.top+t.height-e.y)/t.height:n?(t.left+t.width-e.x)/t.width:(e.x-t.left)/t.width;return Number.isFinite(i)?Gi(i,0,1):0}function Cs(e,t){return t.min+Gi(e,0,1)*(t.max-t.min)}var ws=e=>rt(e)||e.readOnly,Ts=e=>Array.isArray(e)?e:[e];function Es(e){let t={};return Ts(e).forEach((e,n)=>t[n]=e),t}function Ds(e,t){return Array.isArray(t)?e[t.length]===void 0&&t.every((t,n)=>Object.is(e[n],t)):Object.is(e[0],t)&&e[1]===void 0}var Os=(e,t)=>Array.isArray(t)?e:e[0];function ks(e){return{min:e.min,max:e.max,step:e.step,largeStep:e.largeStep,minStepsBetweenThumbs:e.minStepsBetweenThumbs}}function As(e){return{min:e.min??0,max:e.max??100,step:e.step&&e.step>0?e.step:1}}function js(e,t){let n=As(t);return Array.isArray(e)?hs(e,n):Gi(e,n.min,n.max)}function Ms(e){let t=As(e);return{...t,largeStep:e.largeStep??t.step*10,minStepsBetweenThumbs:e.minStepsBetweenThumbs??0,orientation:Oe(e.orientation,`horizontal`),disabled:!!e.disabled,readOnly:!!e.readOnly,required:!!e.required,name:e.name,form:e.form,format:e.format,locale:e.locale}}function Ns(e,t){let n=typeof t.format==`function`?t.format:oa(t.format,t.step);return sa(e,f(t),n)}function Ps(e){return e.join(`/`)}function Fs(e){return Array.isArray(e.value)?Ps(e.value):String(e.value)}function Is(e){let{store:t,options:n,element:r}=e,i=E(e),a=I(e),o=Hi(e.onDestroy),s,c,l=()=>ks(t.get()),u=()=>Ts(t.get().value),d=()=>{let e=r(`root`);return Xe(e)?e:r(`input`)};function f(e,n,r,a,o=!0){if(e===u())return!1;let s=i(`value`,Os(e,t.get().value),{reason:n,event:r,thumb:a});return s&&(a!==null&&t.set({last:a}),o&&ue(d(),[`input`])),s}function p(e,n,r,i=null,o=!0){let s=t.get().value;q(e,s)||(a(`value`,s,{reason:n,event:r,thumb:i}),o&&ue(d(),[`change`]))}let m=e=>r(`thumb-input`,String(e));function h(e,r,a){let o=Ts(js(e,n())),s=o.reduce((e,t,n)=>ms(e,n,t,l()),o);return!q(s,u())&&i(`value`,Os(s.slice(),t.get().value),{reason:r,event:a,thumb:null})}let g={getValue:()=>t.get().value,setValue:(e,{reason:n=`imperative`,event:r}={})=>!ws(t.get())&&h(e,n,r),focus:(e=0)=>m(e)?.focus(),internal:{press(e,n){if(!o.accepts(e)||ws(t.get())||s)return;let i=(r(`track`)??n).getBoundingClientRect(),a=Bi(n),c=t.get().orientation===`vertical`,u=(e,t)=>Cs(Ss({x:e,y:t},i,{rtl:a,vertical:c}),l()),d=e.target.closest(`[data-slot="slider-thumb"]`),f=d&&n.contains(d)?Number(d.getAttribute(`data-index`)??0):null;e.preventDefault();let p=g.internal.begin(u(e.clientX,e.clientY),f,e);m(p)?.focus({preventScroll:!0}),o.start(n,e,{onMove:e=>g.internal.move(u(e.x,e.y),e.event),onEnd:e=>g.internal.end(e)})},begin(e,n,r){let i=t.get().value,a,o,c=0;n===null?({index:a,stack:o}=_s(u(),e),a!==null&&f(ms(u(),a,e,l()),`track-press`,r,a)):(o=vs(u(),n),a=o.length>1?null:n,c=e-u()[n]);let d=a??o[0];return s={index:a,stack:o,offset:c,start:i,reason:`track-press`,event:r},t.set({active:d}),d},move(e,n){if(!s)return;let r=e-s.offset;if(s.index===null){let e=Math.sign(r-u()[s.stack[0]]);if(e===0)return;s.index=ys(s.stack,e),m(s.index)?.focus({preventScroll:!0}),t.set({active:s.index})}f(ms(u(),s.index,r,l()),`drag`,n,s.index)&&(s.reason=`drag`,s.event=n)},end(e){let n=s;s=void 0,t.set({active:null}),n&&p(n.start,n.reason,e,n.index)},adjust(e,n,r){if(t.get().readOnly)return;let i=t.get().value;f(ms(u(),e,n,l()),`accessibility-adjust`,r,e,!1),p(i,`accessibility-adjust`,r,e,!1)},keydown(e,n,r){let i=t.get();if(rt(i))return;let a=u()[n]??i.min,o=gs(e.key,{shiftKey:e.shiftKey,rtl:Bi(r),orientation:i.orientation},a,fs(u(),n,l()),l());o!==null&&(e.preventDefault(),i.readOnly||(c??={start:i.value,thumb:n},c.event=e,f(ms(u(),n,o,l()),`step-key`,e,n)))},commitKeys(e){if(!c)return;let{start:t,thumb:n,event:r}=c;c=void 0,p(t,`step-key`,e??r,n)},reset(){tt(n().value,n().defaultValue)||i(`value`,t.get().initial,{reason:`reset`,thumb:null})},restore(e){let n=ca(e);n&&h(Os(n,t.get().value),`restore`)},setFormDisabled(e){t.set({formDisabled:e})},submitted:()=>t.get().name===void 0?null:Fs(t.get()),syncInput(e,n){let{lower:r,upper:i}=fs(u(),n,l()),a=String(r),o=String(i),s=String(u()[n]??t.get().min);e.min!==a&&(e.min=a),e.max!==o&&(e.max=o),e.value!==s&&(e.value=s)}}};Qe(e,[`value`],(e,t,n)=>{let{min:r,max:i}=As(n);if(n.value!==void 0||!(r<=i))return;let a=js(t.value,n);if(!q(a,t.value))return{value:a}});let _={value:t.get().value,thumbValues:t.get().thumbValues};return B(e,[`thumbValues`],({value:e})=>{if(!Ds(nt(t).thumbValues,e))return q(e,_.value)||(_={value:e,thumbValues:Es(e)}),{thumbValues:_.thumbValues}}),t.subscribe(()=>{s&&ws(t.get())&&(o.cancel(),g.internal.end())}),g}var Ls=Is;function Rs(e){let t=e===null?null:ca(e);if(t)return t.length===1?t[0]:t}function zs(e){return{value:e.value,...Bs(e)}}function Bs(e){return{disabled:rt(e),readOnly:e.readOnly,required:e.required,dragging:e.active!==null,orientation:e.orientation}}var Vs=(e,t)=>e.thumbValues[t]??e.min;function Hs(e){return{"data-orientation":e.orientation,"data-disabled":rt(e)?``:void 0,"data-readonly":e.readOnly?``:void 0,"data-required":e.required?``:void 0,"data-dragging":e.active===null?void 0:``}}function Us(e,t,n){n||=0;let r=e.orientation===`vertical`;return oi({position:`absolute`,...r?{bottom:`${n}%`,left:`50%`,translate:`-50% 50%`}:{"inset-inline":`calc(${n}% - 50%) calc(50% - ${n}%)`,"margin-inline":`auto`,"justify-self":`center`,top:`50%`,translate:`0 -50%`},"z-index":e.active===t?2:e.last===t?1:void 0,"--slider-thumb-position":`${n}%`})}function Ws(e){let t=ks(e),n=Ts(e.value),r=n.length>1?bs(n[0],t):0,i=bs(n[n.length-1],t),a=Math.round((i-r)*1e4)/1e4,o=e.orientation===`vertical`;return oi({position:`absolute`,[o?`bottom`:`inset-inline-start`]:`${r}%`,[o?`height`:`width`]:`${a}%`,...o?{left:0,right:0}:{top:0,bottom:0},"--slider-indicator-start":`${r}%`,"--slider-indicator-size":`${a}%`})}var Gs=oi({position:`absolute`,inset:0,width:`100%`,height:`100%`,margin:0,padding:0,border:0,opacity:0,overflow:`hidden`,"clip-path":`inset(50%)`,"white-space":`nowrap`,"pointer-events":`none`}),Ks=(e,t,n)=>n===0&&e.thumbInputId||`${t}-thumb-${n}`,qs=Se({name:`slider`,options:{value:Rs,defaultValue:Rs,onValueChange:`callback`,onValueCommit:`callback`,min:`number`,max:`number`,step:`number`,largeStep:`number`,minStepsBetweenThumbs:`number`,orientation:`string`,disabled:`boolean`,readOnly:`boolean`,required:`boolean`,name:`string`,form:`string`,format:`value`,locale:`string`,controller:`value`,thumbInputId:`string`},state:e=>{let t=js(e.value??e.defaultValue??e.min??0,e);return{...Ms(e),value:t,initial:js(e.defaultValue??t,e),formDisabled:!1,pageLocale:null,active:null,last:null,thumbValues:Es(t),thumbInputId:e.thumbInputId??null}},sync:e=>({...Ms(e),...e.defaultValue===void 0?{}:{initial:js(e.defaultValue,e)},...e.value===void 0?{}:{value:js(e.value,e)},...e.thumbInputId===void 0?{}:{thumbInputId:e.thumbInputId}}),commits:[`value`],api:Ls,slots:e=>({root:e({role:`group`,state:zs,attrs:(e,{id:t})=>({id:e.thumbInputId&&Ts(e.value).length>1?`${t}-group`:void 0,...Hs(e)}),bind:(e,{api:t,store:n})=>(ae(e,e=>n.set({pageLocale:e})),Ce(e,{value:t.internal.submitted,state:()=>Fs(n.get()),restore:t.internal.restore,valueMissing:()=>!1,message:()=>``,anchor:()=>e.querySelector(`[data-slot="slider-thumb-input"]`)??e,focus:()=>t.focus(),reset:t.internal.reset,disabled:t.internal.setFormDisabled,subscribe:n.subscribe}))}),control:e({state:zs,attrs:e=>({...Hs(e),style:`touch-action:none`}),on:{pointerdown:(e,{api:t,el:n})=>n&&t.internal.press(e,n)}}),track:e({state:zs,attrs:e=>({...Hs(e),style:`position:relative`})}),indicator:e({state:zs,attrs:e=>({...Hs(e),style:Ws(e)})}),thumb:e({props:{index:`number`},selects:Ye({value:[],thumbValues:({props:e})=>[String(e.index??0)],last:({props:e})=>[e.index??0]}),state:(e,{props:t})=>{let n=t.index??0,r=Vs(e,n);return{...Bs(e),index:n,thumbValue:r,percent:bs(r,ks(e))}},attrs:(e,{props:t})=>{let n=t.index??0,r=bs(Vs(e,n),ks(e));return{...Hs(e),"data-index":String(n),"data-dragging":e.active===n?``:void 0,style:Us(e,n,r)}}}),"thumb-input":e({role:`slider`,focus:`native`,keys:[`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`,`shift+ArrowUp`,`shift+ArrowDown`,`shift+ArrowLeft`,`shift+ArrowRight`,`PageUp`,`PageDown`,`Home`,`End`],props:{index:{kind:`number`,from:`thumb`}},selects:Ye({value:[],thumbValues:({props:e})=>{let t=e.index??0;return[String(t-1),String(t),String(t+1)]},active:[],last:[]}),attrs:(e,{id:t,props:n})=>{let r=n.index??0,i=Vs(e,r),{lower:a,upper:o}=ps(e.thumbValues[r-1],e.thumbValues[r+1],ks(e));return{type:`range`,id:Ks(e,t,r),min:String(a),max:String(o),step:String(e.step),value:String(i),"aria-valuenow":void 0,"aria-valuetext":Ns(i,e),"aria-orientation":e.orientation,disabled:rt(e)?``:void 0,"aria-readonly":e.readOnly?`true`:void 0,"data-disabled":rt(e)?``:void 0,"data-readonly":e.readOnly?``:void 0,style:Gs}},on:{keydown:(e,{api:t,el:n,props:r})=>n&&t.internal.keydown(e,r.index??0,n),keyup:(e,{api:t})=>t.internal.commitKeys(e),focusout:(e,{api:t})=>t.internal.commitKeys(),input:(e,{api:t,el:n,props:r})=>{let i=n;t.internal.adjust(r.index??0,i.valueAsNumber,e),t.internal.syncInput(i,r.index??0)}},bind:(e,t)=>{let{api:n,props:r}=t,i=e,a=r.index??0,o=()=>n.internal.syncInput(i,a);o();let s=[le(t,o)];return()=>s.forEach(e=>e())}}),value:e({role:`status`,state:e=>({...zs(e),text:Ts(e.value).map(t=>Ns(t,e)).join(` – `)}),attrs:(e,{id:t})=>({for:Ts(e.value).map((n,r)=>Ks(e,t,r)).join(` `),"aria-live":`off`,...Hs(e)})}),input:e({attrs:e=>({type:`hidden`,name:e.name,value:Fs(e),form:e.form,disabled:e.disabled?``:void 0}),bind:(e,{api:t,store:n})=>be(e,{value:()=>Fs(n.get()),subscribe:n.subscribe,focus:()=>t.focus(),reset:t.internal.reset,disabled:t.internal.setFormDisabled})})}),agent:{actions:[`setValue`]}}),Js=l(qs,{control:`div`,track:`div`,indicator:`div`,value:`output`}),Ys=Y.createContext(null);function Xs(e){let t=Y.useContext(Ys);if(!t)throw Error(`${e} must be used inside <Slider>.`);return t}function Zs(e,t){return n=>(0,X.jsxs)(X.Fragment,{children:[typeof e==`function`?e(n):e,t]})}function Qs({value:e,defaultValue:t,onValueChange:n,onValueCommit:i,min:a,max:o,step:s,largeStep:c,minStepsBetweenThumbs:l,orientation:u,disabled:d,readOnly:f,required:p,name:m,form:h,format:_,locale:y,controller:b,debug:x,render:S,children:C,...w}){let T=Ze(),E=z(),D=g(qs,{value:e,defaultValue:t,onValueChange:n,onValueCommit:i,min:a,max:o,step:s,largeStep:c,minStepsBetweenThumbs:l,orientation:u,disabled:d||T?.disabled,readOnly:f,required:p,name:m??T?.name,form:h,format:_,locale:y,controller:b,debug:x,thumbInputId:E}),O=e??t,k=Array.isArray(O)&&O.length>1,A=Y.useMemo(()=>v(D,{field:k?null:T}),[D,k,T]),j={...w,children:Zs(C,(0,X.jsx)($s,{})),render:r(k?T:null,`div`,S)};return(0,X.jsx)(Ys.Provider,{value:A,children:W(D,`root`,{},j)})}function $s(){return W(qs,`input`,{},{},`input`)}var ec=Js.Control,tc=Js.Track,nc=Js.Indicator;function rc({index:e=0,children:t,"aria-label":n,"aria-labelledby":r,"aria-describedby":i,...a}){let o={index:e,id:String(e)},s=(0,X.jsx)(ic,{...o,"aria-label":n,"aria-labelledby":r,"aria-describedby":i});return W(qs,`thumb`,o,{...a,children:Zs(t,s)})}function ic({index:e,id:t,...n}){let{field:r}=Xs(`SliderThumb`),i=e=>{let{value:t,...n}=r?r.props(e):e;return(0,X.jsx)(`input`,{...n,defaultValue:t})};return W(qs,`thumb-input`,{index:e,id:t},{...n,render:i},`input`)}function ac({className:e,thumbLabel:t,...n}){return(0,X.jsx)(Qs,{"data-slot":`slider`,className:j(`w-full touch-none select-none`,e),...n,children:(0,X.jsx)(ec,{className:`flex h-5 w-full items-center`,children:(0,X.jsxs)(tc,{className:`relative h-1 w-full rounded-full bg-muted`,children:[(0,X.jsx)(nc,{className:`h-full rounded-full bg-border-strong`}),(0,X.jsx)(rc,{"aria-label":t,className:`size-3.5 rounded-full border border-border-strong bg-background shadow-sm has-[:focus-visible]:ring-2 has-[:focus-visible]:ring-ring`})]})})})}function oc(e){let t=(0,Z.c)(16),{label:n,icon:r,disabled:i,onClick:a,shortcut:o}=e,s=i||void 0,c=i?void 0:a,l;t[0]!==n||t[1]!==o||t[2]!==s||t[3]!==c?(l=(0,X.jsx)(H,{size:`icon-sm`,variant:`ghost`,"aria-label":n,"aria-keyshortcuts":o,"aria-disabled":s,className:`aria-disabled:cursor-default aria-disabled:hover:bg-transparent`,onClick:c}),t[0]=n,t[1]=o,t[2]=s,t[3]=c,t[4]=l):l=t[4];let u;t[5]!==r||t[6]!==l?(u=(0,X.jsx)(x,{render:l,children:r}),t[5]=r,t[6]=l,t[7]=u):u=t[7];let d;t[8]===o?d=t[9]:(d=o&&(0,X.jsx)(dt,{children:o}),t[8]=o,t[9]=d);let f;t[10]!==n||t[11]!==d?(f=(0,X.jsxs)(He,{children:[n,d]}),t[10]=n,t[11]=d,t[12]=f):f=t[12];let p;return t[13]!==u||t[14]!==f?(p=(0,X.jsxs)(C,{children:[u,f]}),t[13]=u,t[14]=f,t[15]=p):p=t[15],p}function sc(e){let t=(0,Z.c)(6),{label:n,heading:r,children:i}=e,a;t[0]===r?a=t[1]:(a=(0,X.jsx)(`div`,{className:`flex min-h-8 items-center gap-2 border-b bg-muted/50 px-3 py-1 text-caption text-muted-foreground`,children:r}),t[0]=r,t[1]=a);let o;return t[2]!==i||t[3]!==n||t[4]!==a?(o=(0,X.jsxs)(`section`,{"aria-label":n,className:`min-w-0 overflow-hidden rounded-md border`,children:[a,i]}),t[2]=i,t[3]=n,t[4]=a,t[5]=o):o=t[5],o}function cc(e){let t=(0,Z.c)(17),{scope:n,context:r,run:i,item:a,className:o,style:s,opened:c,framed:l}=e,u=c!==void 0&&c,d=l===void 0||l,f;t[0]!==r||t[1]!==a.assetId||t[2]!==i.id||t[3]!==n?(f={scope:n,context:r,runId:i.id,assetId:a.assetId},t[0]=r,t[1]=a.assetId,t[2]=i.id,t[3]=n,t[4]=f):f=t[4];let{url:p,retry:m}=Po(f);if(ze(p)){let e;return t[5]!==o||t[6]!==s||t[7]!==p.value?(e=(0,X.jsx)(`img`,{src:p.value,alt:``,loading:`lazy`,decoding:`async`,className:o,style:s}),t[5]=o,t[6]=s,t[7]=p.value,t[8]=e):e=t[8],e}let h;t[9]===p?h=t[10]:(h=me(p)&&!p.waiting,t[9]=p,t[10]=h);let g=h;if(!u){let e;return t[11]!==g||t[12]!==d?(e=d?(0,X.jsx)(`span`,{role:g?`alert`:void 0,className:`grid aspect-video w-full place-items-center rounded-sm border bg-muted px-3 text-center text-caption text-muted-foreground`,children:g?`This screenshot could not be loaded.`:(0,X.jsx)(y,{label:`Reading the screenshot`})}):null,t[11]=g,t[12]=d,t[13]=e):e=t[13],e}if(g){let e;return t[14]===m?e=t[15]:(e=(0,X.jsx)(L,{role:`alert`,message:`This screenshot could not be loaded.`,action:(0,X.jsx)(H,{variant:`outline`,size:`sm`,onClick:m,children:`Try again`})}),t[14]=m,t[15]=e),e}let _;return t[16]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,X.jsx)(`div`,{className:`grid min-h-48 place-items-center`,children:(0,X.jsx)(y,{label:`Reading the screenshot`})}),t[16]=_):_=t[16],_}function lc(e){let t=(0,Z.c)(11),{scope:n,context:r,run:i,items:a}=e,o;if(t[0]!==r||t[1]!==a||t[2]!==i||t[3]!==n){let e;t[5]!==r||t[6]!==i||t[7]!==n?(e=(e,t)=>(0,X.jsx)(cc,{scope:n,context:r,run:i,item:e,framed:!1,className:`h-12 w-auto max-w-20 rounded-sm border object-cover object-top`},t),t[5]=r,t[6]=i,t[7]=n,t[8]=e):e=t[8],o=a.map(e),t[0]=r,t[1]=a,t[2]=i,t[3]=n,t[4]=o}else o=t[4];let s;return t[9]===o?s=t[10]:(s=(0,X.jsx)(`span`,{"aria-hidden":!0,className:`flex shrink-0 gap-1.5`,children:o}),t[9]=o,t[10]=s),s}function uc(e){let t=(0,Z.c)(7),{item:n}=e,r;t[0]===n.label?r=t[1]:(r=(0,X.jsx)(`span`,{className:`font-medium text-foreground`,children:n.label}),t[0]=n.label,t[1]=r);let i;t[2]===n.shows?i=t[3]:(i=(0,X.jsx)($,{text:n.shows}),t[2]=n.shows,t[3]=i);let a;return t[4]!==r||t[5]!==i?(a=(0,X.jsxs)(`span`,{className:`text-caption text-muted-foreground`,children:[r,` `,i]}),t[4]=r,t[5]=i,t[6]=a):a=t[6],a}function dc(e){let t=(0,Z.c)(9),{source:n,items:r,onEnlarge:i}=e,a;if(t[0]!==r||t[1]!==i||t[2]!==n){let e;t[4]!==i||t[5]!==n?(e=(e,t)=>(0,X.jsxs)(`button`,{type:`button`,"aria-label":e.enlarge,onClick:()=>i(t),className:`group flex min-w-0 flex-col gap-1.5 text-left focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring`,children:[(0,X.jsx)(cc,{...n,item:e,className:`max-h-80 w-auto max-w-full self-start rounded-sm border group-hover:opacity-90`}),(0,X.jsx)(uc,{item:e})]},t),t[4]=i,t[5]=n,t[6]=e):e=t[6],a=r.map(e),t[0]=r,t[1]=i,t[2]=n,t[3]=a}else a=t[3];let o;return t[7]===a?o=t[8]:(o=(0,X.jsx)(`div`,{className:`grid grid-cols-2 gap-3 p-3`,children:a}),t[7]=a,t[8]=o),o}function fc(e){let t=(0,Z.c)(33),{source:n,before:r,after:i}=e,[a,o]=(0,Y.useState)(50),s;t[0]!==r||t[1]!==n?(s=(0,X.jsx)(cc,{...n,item:r,className:`block w-full`}),t[0]=r,t[1]=n,t[2]=s):s=t[2];let c=`inset(0 0 0 ${a}%)`,l;t[3]===c?l=t[4]:(l={clipPath:c},t[3]=c,t[4]=l);let u;t[5]!==i||t[6]!==n||t[7]!==l?(u=(0,X.jsx)(cc,{...n,item:i,framed:!1,className:`absolute inset-0 size-full object-contain object-left-top`,style:l}),t[5]=i,t[6]=n,t[7]=l,t[8]=u):u=t[8];let d=`${a}%`,f;t[9]===d?f=t[10]:(f=(0,X.jsx)(`span`,{"aria-hidden":!0,className:`absolute inset-y-0 w-px bg-foreground/60`,style:{left:d}}),t[9]=d,t[10]=f);let p;t[11]!==s||t[12]!==u||t[13]!==f?(p=(0,X.jsxs)(`div`,{className:`relative mx-auto w-full max-w-56 overflow-hidden rounded-sm border bg-muted`,children:[s,u,f]}),t[11]=s,t[12]=u,t[13]=f,t[14]=p):p=t[14];let m;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,X.jsx)(`span`,{children:`Before`}),t[15]=m):m=t[15];let h;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(h=e=>o(typeof e==`number`?e:50),t[16]=h):h=t[16];let g;t[17]===a?g=t[18]:(g=(0,X.jsx)(ac,{value:a,onValueChange:h,thumbLabel:`Divide before and after`}),t[17]=a,t[18]=g);let _;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,X.jsx)(`span`,{children:`After`}),t[19]=_):_=t[19];let v;t[20]===g?v=t[21]:(v=(0,X.jsxs)(`div`,{className:`mx-auto flex w-full max-w-sm items-center gap-3 text-caption text-muted-foreground`,children:[m,g,_]}),t[20]=g,t[21]=v);let y;t[22]===r?y=t[23]:(y=(0,X.jsx)(uc,{item:r}),t[22]=r,t[23]=y);let b;t[24]===i?b=t[25]:(b=(0,X.jsx)(uc,{item:i}),t[24]=i,t[25]=b);let x;t[26]!==y||t[27]!==b?(x=(0,X.jsxs)(`div`,{className:`mx-auto grid w-full max-w-sm grid-cols-2 gap-3`,children:[y,b]}),t[26]=y,t[27]=b,t[28]=x):x=t[28];let S;return t[29]!==v||t[30]!==x||t[31]!==p?(S=(0,X.jsxs)(`div`,{className:`flex flex-col gap-2 p-3`,children:[p,v,x]}),t[29]=v,t[30]=x,t[31]=p,t[32]=S):S=t[32],S}function pc(e){let t=(0,Z.c)(41),{scope:n,context:r,run:i,items:a}=e,[o,s]=(0,Y.useState)(null),[c,l]=(0,Y.useState)(`side`),u=o===null?void 0:a[o],d;t[0]!==r||t[1]!==i||t[2]!==n?(d={scope:n,context:r,run:i},t[0]=r,t[1]=i,t[2]=n,t[3]=d):d=t[3];let f=d,[p,m]=a,h;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,X.jsx)(`span`,{className:`flex-1`,children:`Before and after`}),t[4]=h):h=t[4];let g;t[5]!==m||t[6]!==p||t[7]!==c?(g=p&&m&&(0,X.jsx)(gi,{value:c,onValueChange:e=>l(e===`overlay`?`overlay`:`side`),children:(0,X.jsxs)(Ni,{"aria-label":`Compare`,className:`h-6!`,children:[(0,X.jsx)(ki,{value:`side`,children:`Side by side`}),(0,X.jsx)(ki,{value:`overlay`,children:`Slider`})]})}),t[5]=m,t[6]=p,t[7]=c,t[8]=g):g=t[8];let _;t[9]===g?_=t[10]:(_=(0,X.jsxs)(X.Fragment,{children:[h,g]}),t[9]=g,t[10]=_);let v;t[11]!==m||t[12]!==p||t[13]!==a||t[14]!==c||t[15]!==f?(v=c===`overlay`&&p&&m?(0,X.jsx)(fc,{source:f,before:p,after:m}):(0,X.jsx)(dc,{source:f,items:a,onEnlarge:s}),t[11]=m,t[12]=p,t[13]=a,t[14]=c,t[15]=f,t[16]=v):v=t[16];let y;t[17]!==_||t[18]!==v?(y=(0,X.jsx)(sc,{label:`Before and after`,heading:_,children:v}),t[17]=_,t[18]=v,t[19]=y):y=t[19];let b=u!==void 0,x;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(x=e=>{e||s(null)},t[20]=x):x=t[20];let S;t[21]===u?S=t[22]:(S=u&&(0,X.jsxs)(X.Fragment,{children:[u.label,` · `,(0,X.jsx)($,{text:u.shows})]}),t[21]=u,t[22]=S);let C;t[23]===S?C=t[24]:(C=(0,X.jsx)(ri,{children:S}),t[23]=S,t[24]=C);let w;t[25]!==u||t[26]!==f?(w=u&&(0,X.jsx)(cc,{...f,item:u,className:`mx-auto max-h-[72vh] rounded-lg border`,opened:!0}),t[25]=u,t[26]=f,t[27]=w):w=t[27];let T;t[28]!==a.length||t[29]!==o?(T=a.length>1&&o!==null&&(0,X.jsxs)(`div`,{className:`flex items-center justify-center gap-3 text-caption text-muted-foreground`,children:[(0,X.jsx)(oc,{label:`Previous screenshot`,icon:(0,X.jsx)(ua,{}),disabled:o===0,onClick:()=>s(o-1)}),o+1,` of `,a.length,(0,X.jsx)(oc,{label:`Next screenshot`,icon:(0,X.jsx)(J,{}),disabled:o===a.length-1,onClick:()=>s(o+1)})]}),t[28]=a.length,t[29]=o,t[30]=T):T=t[30];let E;t[31]!==C||t[32]!==w||t[33]!==T?(E=(0,X.jsxs)(rr,{className:`max-h-[92vh] overflow-auto sm:max-w-[min(92vw,52rem)]`,children:[C,w,T]}),t[31]=C,t[32]=w,t[33]=T,t[34]=E):E=t[34];let D;t[35]!==E||t[36]!==b?(D=(0,X.jsx)(or,{open:b,onOpenChange:x,children:E}),t[35]=E,t[36]=b,t[37]=D):D=t[37];let O;return t[38]!==D||t[39]!==y?(O=(0,X.jsxs)(X.Fragment,{children:[y,D]}),t[38]=D,t[39]=y,t[40]=O):O=t[40],O}var mc=52;function hc(e,t=`smooth`){let n=document.getElementById(e),r=n?.closest(`[data-review-scroll]`);if(!n||!r)return;let i=e.startsWith(`walkthrough-`)?mc:16;r.scrollTo({top:r.scrollTop+n.getBoundingClientRect().top-r.getBoundingClientRect().top-i,behavior:t})}var gc=e=>`walkthrough-step-${e}`,_c=(e,t)=>`walkthrough-call-${e}-${t}`;function vc(e){let t=(0,Z.c)(10),{label:n,detail:r,children:i}=e,a;t[0]===r?a=t[1]:(a=r&&(0,X.jsx)(`span`,{className:`tabular-nums`,children:r}),t[0]=r,t[1]=a);let o;t[2]!==n||t[3]!==a?(o=(0,X.jsxs)(`dt`,{className:`flex flex-col pt-1 text-caption text-muted-foreground`,children:[n,a]}),t[2]=n,t[3]=a,t[4]=o):o=t[4];let s;t[5]===i?s=t[6]:(s=(0,X.jsx)(`dd`,{className:`flex min-w-0 flex-col`,children:i}),t[5]=i,t[6]=s);let c;return t[7]!==o||t[8]!==s?(c=(0,X.jsxs)(`div`,{className:`grid gap-x-4 gap-y-1 border-t py-2.5 first:border-t-0 @xl:grid-cols-[7rem_minmax(0,1fr)]`,children:[o,s]}),t[7]=o,t[8]=s,t[9]=c):c=t[9],c}function yc(e){let t=(0,Z.c)(11),{onClick:n,target:r,centered:i,children:a}=e,o=i!==void 0&&i?`items-center`:`items-baseline`,s;t[0]===o?s=t[1]:(s=j(`-mx-2 flex min-h-7 gap-2 rounded-md px-2 py-1 text-left text-ui hover:bg-muted focus-visible:outline-2 focus-visible:outline-ring`,o),t[0]=o,t[1]=s);let c;t[2]===a?c=t[3]:(c=(0,X.jsx)(`span`,{className:`flex min-w-0 flex-1 items-baseline gap-2`,children:a}),t[2]=a,t[3]=c);let l;t[4]===r?l=t[5]:(l=(0,X.jsx)(`span`,{className:`shrink-0 text-caption text-muted-foreground`,children:r}),t[4]=r,t[5]=l);let u;return t[6]!==n||t[7]!==s||t[8]!==c||t[9]!==l?(u=(0,X.jsxs)(`button`,{type:`button`,onClick:n,className:s,children:[c,l]}),t[6]=n,t[7]=s,t[8]=c,t[9]=l,t[10]=u):u=t[10],u}function bc(e){let t=(0,Z.c)(8),{content:n,decisions:r,onJump:i}=e,a,o;if(t[0]!==n||t[1]!==r||t[2]!==i){o=Symbol.for(`react.early_return_sentinel`);bb0:{let e=wt(n,r);if(e.length===0){let e;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,X.jsx)(`p`,{className:`py-1 text-ui text-muted-foreground`,children:`Nothing needs your decision.`}),t[5]=e):e=t[5],o=e;break bb0}let s;t[6]===i?s=t[7]:(s=e=>{let{attention:t,stop:n,step:r,callIndex:a,decided:o,state:s}=e;return(0,X.jsx)(yc,{target:`Step ${r}`,onClick:()=>i(_c(r,a)),children:(0,X.jsxs)(`span`,{className:`flex min-w-0 flex-col gap-0.5 @md:flex-row @md:items-baseline @md:gap-2`,children:[(0,X.jsxs)(`span`,{className:j(`flex shrink-0 items-baseline gap-1 text-caption @md:w-28`,s===`decided`?`text-muted-foreground`:`text-warn`),children:[s===`decided`&&(0,X.jsx)(R,{role:`img`,"aria-label":ft(s,``),className:`size-3 shrink-0 self-center text-add-fg`}),s===`needs-commit`&&(0,X.jsx)(Nn,{role:`img`,"aria-label":ft(s,``),className:`size-3 shrink-0 self-center`}),mn(t)]}),(0,X.jsxs)(`span`,{className:`flex min-w-0 flex-col gap-0.5`,children:[(0,X.jsxs)(`span`,{className:`font-medium text-pretty`,children:[(0,X.jsx)($,{text:t.question}),o?.option&&(0,X.jsxs)(`span`,{className:`font-normal text-muted-foreground`,children:[` `,`· `,o.option]})]}),s===`needs-commit`&&(0,X.jsx)(`span`,{className:`text-caption text-warn`,children:`Needs a new commit: this change does not do this yet.`}),(0,X.jsx)(`span`,{className:`text-pretty text-foreground-2`,children:(0,X.jsx)($,{text:n.explanation})})]})]})},`${r}:${a}`)},t[6]=i,t[7]=s),a=e.map(s)}t[0]=n,t[1]=r,t[2]=i,t[3]=a,t[4]=o}else a=t[3],o=t[4];return o===Symbol.for(`react.early_return_sentinel`)?a:o}function xc(e){let t=(0,Z.c)(9),{name:n,pull:r}=e;if(!r){let e;return t[0]===n?e=t[1]:(e=(0,X.jsx)(`span`,{children:n}),t[0]=n,t[1]=e),e}let i=`Open on #${r.number}`,a;t[2]!==n||t[3]!==r?(a=()=>r.openCheck(n),t[2]=n,t[3]=r,t[4]=a):a=t[4];let o;return t[5]!==n||t[6]!==i||t[7]!==a?(o=(0,X.jsx)(`button`,{type:`button`,title:i,onClick:a,className:`rounded-sm underline decoration-border underline-offset-2 hover:decoration-foreground focus-visible:outline-2 focus-visible:outline-ring`,children:n}),t[5]=n,t[6]=i,t[7]=a,t[8]=o):o=t[8],o}function Sc({names:e,pull:t}){return e.map((n,r)=>(0,X.jsxs)(`span`,{children:[(0,X.jsxs)(`span`,{className:`whitespace-nowrap`,children:[(0,X.jsx)(xc,{name:n,pull:t}),r<e.length-1&&(0,X.jsx)(`span`,{className:`text-muted-foreground`,children:`,`})]}),r<e.length-1&&` `]},`${n}:${r}`))}function Cc(e){return e.stops.flatMap((e,t)=>e.blocks.flatMap(e=>e.kind===`checks`?[{block:e,step:t+1}]:[]))}function wc(e){let t=(0,Z.c)(6),{step:n,onJump:r}=e,i;t[0]!==r||t[1]!==n?(i=()=>r(gc(n)),t[0]=r,t[1]=n,t[2]=i):i=t[2];let a;return t[3]!==n||t[4]!==i?(a=(0,X.jsxs)(`button`,{type:`button`,onClick:i,className:`shrink-0 rounded-sm text-caption leading-5 text-muted-foreground hover:text-foreground focus-visible:outline-2 focus-visible:outline-ring`,children:[`Step `,n]}),t[3]=n,t[4]=i,t[5]=a):a=t[5],a}function Tc(e){let t=(0,Z.c)(41),{block:n,step:r,pull:i,onJump:a}=e,o,s,c;t[0]===n.checks?(o=t[1],s=t[2],c=t[3]):(s=li(n.checks),o=Ta(s,ci(n.checks.state).tone),c=Ea(o),t[0]=n.checks,t[1]=o,t[2]=s,t[3]=c);let l=c,u=i?.status,d;t[4]!==n.checks||t[5]!==u?(d=hi(n.checks,u),t[4]=n.checks,t[5]=u,t[6]=d):d=t[6];let f=d,p=i?.detail?.headSha,m;t[7]!==n.checks.headOid||t[8]!==p?(m=Sa(p,n.checks.headOid),t[7]=n.checks.headOid,t[8]=p,t[9]=m):m=t[9];let h=m,g;t[10]!==o.names||t[11]!==i?(g=(0,X.jsx)(Sc,{names:o.names,pull:i}),t[10]=o.names,t[11]=i,t[12]=g):g=t[12];let _;t[13]===l?_=t[14]:(_=l&&(0,X.jsx)(`span`,{className:`text-muted-foreground`,children:l}),t[13]=l,t[14]=_);let v;t[15]!==g||t[16]!==_?(v=(0,X.jsxs)(X.Fragment,{children:[g,_]}),t[15]=g,t[16]=_,t[17]=v):v=t[17];let y=v,b;t[18]===f.tone?b=t[19]:(b=(0,X.jsx)(`span`,{className:`flex h-5 shrink-0 items-center`,children:(0,X.jsx)(Bn,{tone:f.tone})}),t[18]=f.tone,t[19]=b);let x;t[20]!==o.names.length||t[21]!==f.label||t[22]!==f.names||t[23]!==f.note||t[24]!==y||t[25]!==i||t[26]!==s?(x=f.note?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`span`,{children:[f.label,f.names.length>0&&(0,X.jsx)(`span`,{className:`text-muted-foreground`,children:`: `}),(0,X.jsx)(Sc,{names:f.names,pull:i})]}),(0,X.jsxs)(`span`,{className:`text-caption text-muted-foreground`,children:[(0,X.jsx)(us,{label:f.note}),o.names.length>0&&`: `,y]})]}):(0,X.jsxs)(`span`,{children:[(0,X.jsx)(us,{label:s.label}),o.names.length>0&&(0,X.jsx)(`span`,{className:`text-muted-foreground`,children:`: `}),y]}),t[20]=o.names.length,t[21]=f.label,t[22]=f.names,t[23]=f.note,t[24]=y,t[25]=i,t[26]=s,t[27]=x):x=t[27];let S;t[28]!==h||t[29]!==i?(S=h&&i&&(0,X.jsxs)(`span`,{className:`text-caption text-warn`,children:[`#`,i.number,` is now at `,(0,X.jsx)(`span`,{className:`font-mono`,children:h})]}),t[28]=h,t[29]=i,t[30]=S):S=t[30];let C;t[31]!==x||t[32]!==S?(C=(0,X.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-0.5 text-pretty`,children:[x,S]}),t[31]=x,t[32]=S,t[33]=C):C=t[33];let w;t[34]!==a||t[35]!==r?(w=(0,X.jsx)(wc,{step:r,onJump:a}),t[34]=a,t[35]=r,t[36]=w):w=t[36];let T;return t[37]!==C||t[38]!==w||t[39]!==b?(T=(0,X.jsxs)(`div`,{className:`flex min-h-7 items-start gap-2 py-1 text-ui`,children:[b,C,w]}),t[37]=C,t[38]=w,t[39]=b,t[40]=T):T=t[40],T}function Ec(e){let t=(0,Z.c)(35),{run:n,content:r,owner:i,pull:a,checks:o,onJump:s}=e,c,l,u,d;if(t[0]!==o||t[1]!==r.stops||t[2]!==s||t[3]!==i||t[4]!==a||t[5]!==n){l=r.stops.flatMap(Dc);let e;if(t[10]===n?e=t[11]:(e=ai(n),t[10]=n,t[11]=e),c=e,t[12]!==o||t[13]!==s||t[14]!==a){let e;t[16]!==s||t[17]!==a?(e=e=>{let{block:t,step:n}=e;return(0,X.jsx)(Tc,{block:t,step:n,pull:a,onJump:s},`checks:${n}`)},t[16]=s,t[17]=a,t[18]=e):e=t[18],u=o.map(e),t[12]=o,t[13]=s,t[14]=a,t[15]=u}else u=t[15];let f;t[19]!==s||t[20]!==i||t[21]!==n?(f=(e,t)=>{let{step:r,block:a}=e;return(0,X.jsx)(yc,{target:`Step ${r}`,centered:!0,onClick:()=>s(gc(r)),children:(0,X.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-center gap-3`,children:[(0,X.jsx)(lc,{scope:i.scope,context:i.context,run:n,items:a.screenshots}),(0,X.jsxs)(`span`,{className:`flex min-w-0 flex-col gap-0.5`,children:[(0,X.jsx)(`span`,{className:`text-pretty`,children:(0,X.jsx)($,{text:Gt(a.screenshots)})}),(0,X.jsx)(`span`,{className:`text-caption text-muted-foreground`,children:`Shown in the before and after screenshots`})]})]})},`images:${r}:${t}`)},t[19]=s,t[20]=i,t[21]=n,t[22]=f):f=t[22],d=l.map(f),t[0]=o,t[1]=r.stops,t[2]=s,t[3]=i,t[4]=a,t[5]=n,t[6]=c,t[7]=l,t[8]=u,t[9]=d}else c=t[6],l=t[7],u=t[8],d=t[9];let f;t[23]===c?f=t[24]:(f=c&&(0,X.jsx)(`p`,{className:`py-1 text-ui text-muted-foreground`,children:c}),t[23]=c,t[24]=f);let p;t[25]!==o.length||t[26]!==c||t[27]!==l||t[28]!==n?(p=!c&&o.length===0&&l.length===0&&(0,X.jsxs)(`p`,{className:`py-1 text-ui text-muted-foreground`,children:[`No checks or screenshots were captured for`,` `,(0,X.jsx)(`span`,{className:`font-mono`,children:n.headOid.slice(0,7)}),`.`]}),t[25]=o.length,t[26]=c,t[27]=l,t[28]=n,t[29]=p):p=t[29];let m;return t[30]!==u||t[31]!==d||t[32]!==f||t[33]!==p?(m=(0,X.jsxs)(X.Fragment,{children:[u,d,f,p]}),t[30]=u,t[31]=d,t[32]=f,t[33]=p,t[34]=m):m=t[34],m}function Dc(e,t){return e.blocks.flatMap(e=>e.kind===`images`?[{step:t+1,block:e}]:[])}var Oc=e=>e.stops.some(e=>e.blocks.some(e=>e.kind===`images`));function kc(e){let t=(0,Z.c)(3),{label:n,children:r}=e,i;return t[0]!==r||t[1]!==n?(i=(0,X.jsx)(`dl`,{"aria-label":n,className:`flex flex-col rounded-lg border px-4 py-1`,children:r}),t[0]=r,t[1]=n,t[2]=i):i=t[2],i}function Ac(e){let t=(0,Z.c)(49),{run:n,content:r,owner:i,pull:a,onJump:o,notSaid:s,comments:c,scope:l}=e,{view:u}=qo(i),d=u?.decisions,f;t[0]!==r||t[1]!==d?(f=At(r,d),t[0]=r,t[1]=d,t[2]=f):f=t[2];let p=f,m,h,g,_,v,y,b;if(t[3]!==r||t[4]!==o||t[5]!==p.decided||t[6]!==p.total||t[7]!==a||t[8]!==l||t[9]!==u?.decisions){let e=Cc(r);({changed:h,unchanged:b}=zi(e.map(jc),a?.status)),g=l?bn({...l,pullRequest:a?.number,checkedCommit:e[0]?.block.checks.headOid}):void 0,m=kc,_=`Before you merge`;let n=p.total===1?`Your call`:`Your calls`,i=p.total===0?void 0:`${p.decided} of ${p.total} decided`,s=u?.decisions,c;t[17]!==r||t[18]!==o||t[19]!==s?(c=(0,X.jsx)(bc,{content:r,decisions:s,onJump:o}),t[17]=r,t[18]=o,t[19]=s,t[20]=c):c=t[20],t[21]!==n||t[22]!==i||t[23]!==c?(v=(0,X.jsx)(vc,{label:n,detail:i,children:c}),t[21]=n,t[22]=i,t[23]=c,t[24]=v):v=t[24],y=h.length>0&&(0,X.jsx)(vc,{label:`Checks`,children:h.map(e=>{let{block:t,step:n}=e;return(0,X.jsx)(Tc,{block:t,step:n,pull:a,onJump:o},`checks:${n}`)})}),t[3]=r,t[4]=o,t[5]=p.decided,t[6]=p.total,t[7]=a,t[8]=l,t[9]=u?.decisions,t[10]=m,t[11]=h,t[12]=g,t[13]=_,t[14]=v,t[15]=y,t[16]=b}else m=t[10],h=t[11],g=t[12],_=t[13],v=t[14],y=t[15],b=t[16];let x;t[25]!==h||t[26]!==r||t[27]!==o||t[28]!==i||t[29]!==a||t[30]!==n||t[31]!==b?(x=(b.length>0||h.length===0||Oc(r))&&(0,X.jsx)(vc,{label:`Verified`,children:(0,X.jsx)(Ec,{run:n,content:r,owner:i,pull:a,checks:b,onJump:o})}),t[25]=h,t[26]=r,t[27]=o,t[28]=i,t[29]=a,t[30]=n,t[31]=b,t[32]=x):x=t[32];let S;t[33]!==g||t[34]!==o?(S=(g?.uncommitted||g?.uncovered)&&(0,X.jsxs)(vc,{label:`Scope`,children:[g.uncommitted&&(0,X.jsx)(`p`,{className:`py-1 text-ui text-pretty`,children:g.uncommitted}),g.uncovered&&(0,X.jsx)(yc,{target:`Below the steps`,onClick:()=>o(`review-not-covered`),children:(0,X.jsx)(`span`,{className:`min-w-0 text-pretty`,children:g.uncovered})})]}),t[33]=g,t[34]=o,t[35]=S):S=t[35];let C;t[36]===s?C=t[37]:(C=s&&(0,X.jsx)(vc,{label:`Not verified`,children:s}),t[36]=s,t[37]=C);let w;t[38]===c?w=t[39]:(w=c&&(0,X.jsx)(vc,{label:`Comments`,children:c}),t[38]=c,t[39]=w);let T;return t[40]!==m||t[41]!==_||t[42]!==v||t[43]!==y||t[44]!==x||t[45]!==S||t[46]!==C||t[47]!==w?(T=(0,X.jsxs)(m,{label:_,children:[v,y,x,S,C,w]}),t[40]=m,t[41]=_,t[42]=v,t[43]=y,t[44]=x,t[45]=S,t[46]=C,t[47]=w,t[48]=T):T=t[48],T}function jc(e){return{...e,checks:e.block.checks}}function Mc(e,t){let n=jt(e,[t.span],3,t.side);if(n)try{return en(n,{throwOnError:!0})}catch{return}}function Nc(e){let t=0,n=0,r=!1;for(let i of e.split(`
|
|
2
|
+
`))if(i.startsWith(`@@`))r=!0;else if(r)i.startsWith(`+`)?t+=1:i.startsWith(`-`)&&(n+=1);else continue;return t+n===0?void 0:{additions:t,deletions:n}}function Pc(e,t,n){n.kind===`file`?e.onOpen({kind:`file`,path:t}):n.kind===`branch`?e.onOpen({kind:`branch-file`,path:t}):e.onOpen({kind:`change`,path:t},n.change?{path:t,entry:wn(n.change)}:void 0)}function Fc(e,t,n,r){let i=(0,Z.c)(15),a=Jn(e,t,n).result,o,s,l,u,d,f;if(i[0]!==a||i[1]!==t||i[2]!==r||i[3]!==e){let n=c(K(a)),p;i[10]===r?p=i[11]:(p=e=>r.includes(e.path),i[10]=r,i[11]=p),o=(n?.files??[]).filter(p),s=er,l=e,u=t,d=n?vn(n):null,f=o.map(Kt),i[0]=a,i[1]=t,i[2]=r,i[3]=e,i[4]=o,i[5]=s,i[6]=l,i[7]=u,i[8]=d,i[9]=f}else o=i[4],s=i[5],l=i[6],u=i[7],d=i[8],f=i[9];let p=s(l,u,d,f),m;return i[12]!==o||i[13]!==p?(m=e=>{let t=o.find(t=>t.path===e);if(!t)return;let n=p.patches.get(Kt(t).join(`\0`));return n?.kind===`text`?Nc(n.patch):void 0},i[12]=o,i[13]=p,i[14]=m):m=i[14],m}function Ic(e,t){let n=(0,Z.c)(23),r=Jn(e.scope,e.context.connection,e.base).result,i=Mr(e.scope,e.context.connection),a;n[0]===r?a=n[1]:(a=c(K(r)),n[0]=r,n[1]=a);let o=a?.files,s;n[2]===r?s=n[3]:(s=me(r),n[2]=r,n[3]=s);let l;n[4]!==o||n[5]!==s||n[6]!==i.changes?(l={branch:o,branchFailed:s,worktree:i.changes},n[4]=o,n[5]=s,n[6]=i.changes,n[7]=l):l=n[7];let u=l,d;n[8]!==e.interaction.hidden||n[9]!==t?(d=e.interaction.hidden===!0?[]:t,n[8]=e.interaction.hidden,n[9]=t,n[10]=d):d=n[10];let f=Fc(e.scope,e.context.connection,e.base,d),p;n[11]===u?p=n[12]:(p=e=>Ua(u,e),n[11]=u,n[12]=p);let m;n[13]===i.changes?m=n[14]:(m=e=>i.changes.some(t=>t.path===e),n[13]=i.changes,n[14]=m);let h;n[15]!==e||n[16]!==u?(h=t=>{let n=Ua(u,t);n&&Pc(e,t,n)},n[15]=e,n[16]=u,n[17]=h):h=n[17];let g;return n[18]!==f||n[19]!==p||n[20]!==m||n[21]!==h?(g={opening:p,size:f,uncommitted:m,open:h},n[18]=f,n[19]=p,n[20]=m,n[21]=h,n[22]=g):g=n[22],g}function Lc(e){let t=(0,Z.c)(44),{document:n,runId:r,step:i,excerpt:a}=e,{result:o,retry:s}=Fo(n.scope,n.context,r,i,a.position,a.node),{dark:c}=Fi(),{preferences:l}=_i(),u;t[0]!==n.context||t[1]!==n.scope?(u={scope:n.scope,context:n.context},t[0]=n.context,t[1]=n.scope,t[2]=u):u=t[2];let d=u,{view:f}=Ct(d),[p,m]=(0,Y.useState)();if(ve(o)){let e;return t[3]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,X.jsx)(`div`,{className:`px-3 py-2`,children:(0,X.jsx)(y,{label:`Loading captured lines`})}),t[3]=e):e=t[3],e}if(me(o)){let e;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,X.jsx)(`p`,{children:`The captured diff could not be read.`}),t[4]=e):e=t[4];let n;return t[5]===s?n=t[6]:(n=(0,X.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 px-3 py-2 text-ui`,role:`alert`,children:[e,(0,X.jsx)(H,{size:`sm`,variant:`outline`,onClick:s,children:`Try again`})]}),t[5]=s,t[6]=n),n}let h=o.value,g;t[7]!==h.capturedPatch||t[8]!==h.capturedRunId||t[9]!==h.walkthrough?.id||t[10]!==a||t[11]!==r?(g=(h.capturedRunId??h.walkthrough?.id)===r&&h.capturedPatch?Mc(h.capturedPatch,a):void 0,t[7]=h.capturedPatch,t[8]=h.capturedRunId,t[9]=h.walkthrough?.id,t[10]=a,t[11]=r,t[12]=g):g=t[12];let _=g;if(!_){let e;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,X.jsx)(`p`,{children:`These lines are unavailable in the saved walkthrough.`}),t[13]=e):e=t[13];let r;return t[14]!==n||t[15]!==i?(r=(0,X.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 px-3 py-2 text-ui`,children:[e,(0,X.jsx)(H,{variant:`outline`,size:`sm`,onClick:()=>n.onOpen({kind:`walkthrough-step`,step:i}),children:`Open step code`})]}),t[14]=n,t[15]=i,t[16]=r):r=t[16],r}let v=a.side===`old`?`deletions`:`additions`,b,x,S;if(t[17]!==p||t[18]!==a.path||t[19]!==_||t[20]!==f?.comments){let e=new Map,n=(t,n)=>{let r=`${t}:${n}`,i=e.get(r)??{side:t,line:n,drafts:[]};return e.set(r,i),i};for(let e of f?.comments??[]){let t=e.anchor;e.publication.status===`draft`&&t.kind===`lines`&&t.path===a.path&&n(t.side,t.end).drafts.push(e)}p&&n(p.side,p.end),b=ba,x=_,S=[...e.values()].map(Rc),t[17]=p,t[18]=a.path,t[19]=_,t[20]=f?.comments,t[21]=b,t[22]=x,t[23]=S}else b=t[21],x=t[22],S=t[23];let C;t[24]!==p||t[25]!==a.path||t[26]!==_||t[27]!==d?(C=e=>{let t=e.metadata,n=p?.side===t.side&&p.end===t.line;return(0,X.jsx)(bt,{owner:d,drafts:t.drafts,anchor:n?{kind:`lines`,path:a.path,...p,text:pn(_,p)}:void 0,composing:n,onClose:()=>m(void 0),className:`mx-3 my-2`})},t[24]=p,t[25]=a.path,t[26]=_,t[27]=d,t[28]=C):C=t[28];let w=c?`dark`:`light`,T;t[29]===Symbol.for(`react.memo_cache_sentinel`)?(T=e=>m(ti(e)),t[29]=T):T=t[29];let E;t[30]!==l.lineOverflow||t[31]!==w?(E={preferredHighlighter:yi,theme:Ei,themeType:w,overflow:l.lineOverflow,disableFileHeader:!0,unsafeCSS:`${ji}${Oi}${Ci}`,diffStyle:`unified`,enableGutterUtility:!0,onGutterUtilityClick:T},t[30]=l.lineOverflow,t[31]=w,t[32]=E):E=t[32];let D;t[33]!==a.end||t[34]!==a.start||t[35]!==v?(D={start:a.start,end:a.end,side:v,endSide:v},t[33]=a.end,t[34]=a.start,t[35]=v,t[36]=D):D=t[36];let O;return t[37]!==b||t[38]!==x||t[39]!==S||t[40]!==C||t[41]!==E||t[42]!==D?(O=(0,X.jsx)(b,{fileDiff:x,lineAnnotations:S,renderAnnotation:C,options:E,selectedLines:D}),t[37]=b,t[38]=x,t[39]=S,t[40]=C,t[41]=E,t[42]=D,t[43]=O):O=t[43],O}function Rc(e){return{side:e.side,lineNumber:e.line,metadata:e}}function zc(e){let t=(0,Z.c)(48),{inFullDiff:n,...r}=e,i=n!==void 0&&n,[a,o]=(0,Y.useState)(!0),s=a&&!i,{excerpt:c,document:l}=r,u;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(u=[],t[0]=u):u=t[0];let d=Ic(l,u),f=d.opening(c.path),p;t[1]===c.caption?p=t[2]:(p=c.caption&&(0,X.jsx)(`figcaption`,{className:`text-ui text-foreground-2`,children:(0,X.jsx)($,{text:c.caption})}),t[1]=c.caption,t[2]=p);let m=s&&`border-b`,h;t[3]===m?h=t[4]:(h=j(`flex min-h-8 items-center gap-1 bg-muted/50 pr-1`,m),t[3]=m,t[4]=h);let g=`${s?`Hide`:`Show`} the lines: ${c.path} · ${c.lines}`,_;t[5]!==a||t[6]!==o?(_=()=>o(!a),t[5]=a,t[6]=o,t[7]=_):_=t[7];let v=s&&`rotate-90`,y;t[8]===v?y=t[9]:(y=j(`size-3.5 shrink-0`,v),t[8]=v,t[9]=y);let b;t[10]===y?b=t[11]:(b=(0,X.jsx)(J,{"aria-hidden":!0,className:y}),t[10]=y,t[11]=b);let x;t[12]===c.path?x=t[13]:(x=(0,X.jsx)(`span`,{className:`text-foreground wrap-anywhere`,children:c.path}),t[12]=c.path,t[13]=x);let S;t[14]===c.lines?S=t[15]:(S=(0,X.jsx)(`span`,{children:c.lines}),t[14]=c.lines,t[15]=S);let C;t[16]===i?C=t[17]:(C=i&&(0,X.jsx)(`span`,{className:`font-sans`,children:`· in the full diff below`}),t[16]=i,t[17]=C);let w;t[18]!==x||t[19]!==S||t[20]!==C?(w=(0,X.jsxs)(`span`,{className:`flex min-w-0 flex-wrap items-baseline gap-x-1.5`,children:[x,S,C]}),t[18]=x,t[19]=S,t[20]=C,t[21]=w):w=t[21];let T;t[22]!==i||t[23]!==s||t[24]!==b||t[25]!==w||t[26]!==g||t[27]!==_?(T=(0,X.jsxs)(`button`,{type:`button`,"aria-expanded":s,disabled:i,"aria-label":g,onClick:_,className:`flex min-w-0 flex-1 items-center gap-1.5 self-stretch px-2 py-1 text-left font-mono text-caption text-muted-foreground hover:text-foreground focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-ring`,children:[b,w]}),t[22]=i,t[23]=s,t[24]=b,t[25]=w,t[26]=g,t[27]=_,t[28]=T):T=t[28];let E=f===void 0,D;t[29]!==d||t[30]!==c.path?(D=()=>d.open(c.path),t[29]=d,t[30]=c.path,t[31]=D):D=t[31];let O;t[32]!==E||t[33]!==D?(O=(0,X.jsx)(H,{size:`sm`,variant:`ghost`,disabled:E,onClick:D,children:`Open file`}),t[32]=E,t[33]=D,t[34]=O):O=t[34];let k;t[35]!==T||t[36]!==O||t[37]!==h?(k=(0,X.jsxs)(`div`,{className:h,children:[T,O]}),t[35]=T,t[36]=O,t[37]=h,t[38]=k):k=t[38];let A;t[39]!==s||t[40]!==r?(A=s&&(0,X.jsx)(Lc,{...r}),t[39]=s,t[40]=r,t[41]=A):A=t[41];let M;t[42]!==k||t[43]!==A?(M=(0,X.jsxs)(`div`,{className:`min-w-0 overflow-hidden rounded-md border`,children:[k,A]}),t[42]=k,t[43]=A,t[44]=M):M=t[44];let N;return t[45]!==M||t[46]!==p?(N=(0,X.jsxs)(`figure`,{className:`flex min-w-0 flex-col gap-1.5`,children:[p,M]}),t[45]=M,t[46]=p,t[47]=N):N=t[47],N}var Bc=_o({label:8.1,note:5.6,edge:5.4,padding:24,sign:12,chevron:16,min:88,max:232}),Vc=4,Hc={ArrowLeft:`left`,ArrowRight:`right`,ArrowUp:`up`,ArrowDown:`down`,Home:`first`,End:`last`};function Uc(){let e=(0,Z.c)(4),[t,n]=(0,Y.useState)(0),r;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=()=>e=>{if(!e)return;let t=new ResizeObserver(()=>n(e.clientWidth));return t.observe(e),n(e.clientWidth),()=>t.disconnect()},e[0]=r):r=e[0];let[i]=(0,Y.useState)(r),a;return e[1]!==i||e[2]!==t?(a={frame:i,width:t},e[1]=i,e[2]=t,e[3]=a):a=e[3],a}function Wc(e){let t=(0,Z.c)(21),{document:n,path:r,note:i}=e,a;t[0]===r?a=t[1]:(a=[r],t[0]=r,t[1]=a);let o=Ic(n,a),s;t[2]===i?s=t[3]:(s=i&&(0,X.jsx)(`p`,{className:`text-ui text-foreground-2`,children:i}),t[2]=i,t[3]=s);let c;t[4]===r?c=t[5]:(c=(0,X.jsx)(`span`,{className:`min-w-0 flex-1 font-mono text-caption text-foreground wrap-anywhere`,children:r}),t[4]=r,t[5]=c);let l;t[6]!==o||t[7]!==r?(l=o.opening(r),t[6]=o,t[7]=r,t[8]=l):l=t[8];let u=l===void 0,d;t[9]!==o||t[10]!==r?(d=()=>o.open(r),t[9]=o,t[10]=r,t[11]=d):d=t[11];let f;t[12]!==u||t[13]!==d?(f=(0,X.jsx)(H,{size:`sm`,variant:`ghost`,disabled:u,onClick:d,children:`Open file`}),t[12]=u,t[13]=d,t[14]=f):f=t[14];let p;t[15]!==c||t[16]!==f?(p=(0,X.jsxs)(`div`,{className:`flex min-h-8 min-w-0 items-center gap-1 rounded-md border bg-muted/50 pr-1 pl-3`,children:[c,f]}),t[15]=c,t[16]=f,t[17]=p):p=t[17];let m;return t[18]!==s||t[19]!==p?(m=(0,X.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1.5`,children:[s,p]}),t[18]=s,t[19]=p,t[20]=m):m=t[20],m}function Gc(e){let t=(0,Z.c)(24),{document:n,title:r,node:i}=e,a;t[0]!==n.context||t[1]!==n.scope?(a={scope:n.scope,context:n.context},t[0]=n.context,t[1]=n.scope,t[2]=a):a=t[2];let o=a,{view:s}=Ct(o),[c,l]=(0,Y.useState)(!1),u;t[3]!==i||t[4]!==r?(u=e=>e.kind===`node`&&e.title===r&&e.node===i,t[3]=i,t[4]=r,t[5]=u):u=t[5];let d;t[6]!==u||t[7]!==s?(d=mt(s,u),t[6]=u,t[7]=s,t[8]=d):d=t[8];let f=d,p;t[9]!==i||t[10]!==r?(p={kind:`node`,title:r,node:i},t[9]=i,t[10]=r,t[11]=p):p=t[11];let m;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(m=()=>l(!1),t[12]=m):m=t[12];let h;t[13]!==c||t[14]!==f||t[15]!==o||t[16]!==p?(h=(0,X.jsx)(bt,{owner:o,drafts:f,anchor:p,composing:c,onClose:m}),t[13]=c,t[14]=f,t[15]=o,t[16]=p,t[17]=h):h=t[17];let g;t[18]!==c||t[19]!==i?(g=!c&&(0,X.jsx)(`span`,{children:(0,X.jsxs)(H,{size:`sm`,variant:`ghost`,onClick:()=>l(!0),children:[(0,X.jsx)(Fr,{"data-icon":`inline-start`}),`Comment on `,i]})}),t[18]=c,t[19]=i,t[20]=g):g=t[20];let _;return t[21]!==h||t[22]!==g?(_=(0,X.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[h,g]}),t[21]=h,t[22]=g,t[23]=_):_=t[23],_}function Kc(e,t){let n=(0,Z.c)(6),r;n[0]!==e.context||n[1]!==e.scope?(r={scope:e.scope,context:e.context},n[0]=e.context,n[1]=e.scope,n[2]=r):r=n[2];let{view:i}=Ct(r),a;return n[3]!==t||n[4]!==i?(a=mr(i,t),n[3]=t,n[4]=i,n[5]=a):a=n[5],a}function qc(e){let t=(0,Z.c)(22),{diagram:n,document:r,runId:i,step:a,title:o}=e,s=Kc(r,o),{frame:c,width:l}=Uc(),u=lo(n,Bc,l===0?1/0:l),[d,f]=(0,Y.useState)(n.nodes[0]?.id??``),[p,m]=(0,Y.useState)(),[h,g]=(0,Y.useState)(),[_,v]=(0,Y.useState)(),y=(0,Y.useId)(),b=p??h,x=b===void 0?void 0:uo(n,b),S;if(t[0]!==_||t[1]!==n.nodes){let e;t[3]===_?e=t[4]:(e=e=>e.id===_,t[3]=_,t[4]=e),S=n.nodes.find(e),t[0]=_,t[1]=n.nodes,t[2]=S}else S=t[2];let C=S,w=l===0||u.width<=l,T=(e,t)=>{let n=Bc.label(t)/2+Vc;return Math.min(Math.max(e,n),u.width-n)},E=e=>{if(e.key===`Escape`&&_!==void 0){e.preventDefault(),e.stopPropagation(),v(void 0);return}let t=Hc[e.key];if(t===void 0)return;e.preventDefault(),e.stopPropagation();let n=po(u,d,t);f(n),e.currentTarget.querySelector(`[data-node="${CSS.escape(n)}"]`)?.focus()},D;t[5]!==n.title||t[6]!==w?(D=(n.title||!w)&&(0,X.jsxs)(`figcaption`,{className:`flex min-h-8 items-center gap-3 border-b bg-muted/50 px-3 py-1 text-caption text-muted-foreground`,children:[(0,X.jsx)(`span`,{className:`min-w-0 flex-1`,children:n.title}),!w&&(0,X.jsx)(`span`,{className:`shrink-0`,children:`Scrolls sideways`})]}),t[5]=n.title,t[6]=w,t[7]=D):D=t[7];let O=w&&`mx-auto`,k;t[8]===O?k=t[9]:(k=j(`relative`,O),t[8]=O,t[9]=k);let A;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(A=e=>{e.currentTarget.contains(e.relatedTarget)||g(void 0)},t[10]=A):A=t[10];let M=u.width,N=u.height,P=u.edges.map(e=>{let t=n.edges[e.index];if(!e.label||!t?.label)return null;let r=x?.edges.has(e.index)===!0,i=So(t,r);return(0,X.jsx)(`text`,{x:T(e.label.x,t.label),y:e.label.y,textAnchor:`middle`,dominantBaseline:`middle`,paintOrder:`stroke`,strokeWidth:4,strokeLinejoin:`round`,className:j(`stroke-card text-2xs transition-opacity duration-100`,x!==void 0&&!r&&`opacity-25`,i===`add`&&`fill-add-fg`,i===`del`&&`fill-del-fg`,i===`lit`&&`fill-foreground`,i===`rest`&&`fill-muted-foreground`),children:t.label},e.index)}),F;t[11]!==u||t[12]!==P?(F=(0,X.jsx)(`svg`,{"aria-hidden":!0,width:M,height:N,className:`pointer-events-none absolute inset-0 overflow-visible`,children:P}),t[11]=u,t[12]=P,t[13]=F):F=t[13];let I;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(I=(0,X.jsx)(Rr,{orientation:`horizontal`,className:`absolute inset-x-0 bottom-0`}),t[14]=I):I=t[14];let L;return t[15]!==C||t[16]!==y||t[17]!==r||t[18]!==i||t[19]!==a||t[20]!==o?(L=C?.anchor&&(0,X.jsxs)(`div`,{id:y,className:`flex min-w-0 flex-col gap-2`,children:[C.anchor.kind===`lines`?(0,X.jsx)(zc,{document:r,runId:i,step:a,excerpt:C.anchor.excerpt},C.id):(0,X.jsx)(Wc,{document:r,path:C.anchor.path,note:C.note},C.id),(0,X.jsx)(Gc,{document:r,title:o,node:C.label},`comments:${C.id}`)]}),t[15]=C,t[16]=y,t[17]=r,t[18]=i,t[19]=a,t[20]=o,t[21]=L):L=t[21],(0,X.jsxs)(`figure`,{className:`flex min-w-0 flex-col gap-2`,children:[(0,X.jsxs)(`div`,{className:`min-w-0 overflow-hidden rounded-md border`,children:[D,(0,X.jsxs)(zn,{className:`relative min-w-0`,children:[(0,X.jsx)(lr,{ref:c,"data-wide-fade":``,className:`min-w-0 overflow-y-hidden`,children:(0,X.jsxs)(`div`,{className:k,style:{width:u.width,height:u.height},children:[(0,X.jsxs)(`svg`,{"aria-hidden":!0,width:u.width,height:u.height,className:`absolute inset-0 overflow-visible`,children:[u.lifelines.map(Jc),u.edges.map(e=>{let t=n.edges[e.index];if(t===void 0)return null;let r=x?.edges.has(e.index)===!0,i=x!==void 0&&!r,a=So(t,r);return(0,X.jsxs)(`g`,{className:j(`transition-opacity duration-100`,i&&`opacity-25`),children:[(0,X.jsx)(`path`,{d:e.path,fill:`none`,strokeWidth:1,strokeDasharray:t.mark===`removed`?`4 3`:void 0,className:j(a===`add`&&`stroke-add-fg`,a===`del`&&`stroke-del-fg`,a===`lit`&&`stroke-foreground`,a===`rest`&&`stroke-muted-foreground/60`)}),(0,X.jsx)(`polygon`,{points:e.arrow,className:j(a===`add`&&`fill-add-fg`,a===`del`&&`fill-del-fg`,a===`lit`&&`fill-foreground`,a===`rest`&&`fill-muted-foreground/60`)})]},e.index)})]}),(0,X.jsx)(`ul`,{"aria-label":n.title??`Diagram`,className:`absolute inset-0`,onKeyDown:E,onBlur:A,children:u.nodes.map(e=>{let t=n.nodes.find(t=>t.id===e.id);if(t===void 0)return null;let r=yo(t),i=_===t.id,a=x!==void 0&&!x.nodes.has(t.id),o=t.kind!==`external`,c=(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`span`,{className:`flex min-w-0 items-baseline gap-1 text-caption`,children:[r&&(0,X.jsx)(`span`,{"aria-hidden":!0,className:j(`w-2 shrink-0 font-mono`,t.mark===`added`&&`text-add-fg`,t.mark===`removed`&&`text-del-fg`,t.mark===`changed`&&`text-muted-foreground`),children:r}),(0,X.jsx)(G,{text:t.label,className:j(`min-w-0 flex-1`,o&&`font-mono`,t.mark===`removed`&&`text-muted-foreground line-through`,t.mark===`unchanged`&&`text-foreground-2`)}),t.anchor&&(0,X.jsx)(J,{"aria-hidden":!0,className:j(`size-3 shrink-0 self-center text-muted-foreground`,i&&`rotate-90 text-foreground`)})]}),t.note&&(0,X.jsx)(`span`,{className:`flex min-w-0 text-2xs`,children:(0,X.jsx)(G,{text:t.note,className:j(`min-w-0 flex-1 text-muted-foreground`,r&&`pl-3`)})}),(0,X.jsxs)(`span`,{className:`sr-only`,children:[` `,xo(n,t)]})]}),l={"data-node":t.id,tabIndex:t.id===d?0:-1,onFocus:()=>{f(t.id),g(t.id)},onPointerEnter:()=>m(t.id),onPointerLeave:()=>m(void 0),className:j(`flex size-full flex-col justify-center gap-0.5 rounded-md border px-2.5 text-left focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring`,t.mark===`added`&&`border-add-fg/40 bg-add-bg`,t.mark===`removed`&&`border-dashed border-del-fg/50 bg-card`,t.mark!==`added`&&t.mark!==`removed`&&`bg-card`,t.anchor?`cursor-pointer shadow-row hover:border-foreground/40`:`cursor-default`,i&&`border-foreground/60 ring-1 ring-foreground/20`)};return(0,X.jsxs)(`li`,{className:j(`absolute transition-opacity duration-100`,a&&`opacity-35`),style:{left:e.x,top:e.y,width:e.width,height:e.height},children:[s.has(t.label)&&(0,X.jsx)(`span`,{role:`img`,"aria-label":`${s.get(t.label)} comments`,className:`pointer-events-none absolute -top-1.5 -right-1.5 flex size-4 items-center justify-center rounded-full border bg-card text-muted-foreground`,children:(0,X.jsx)(Ut,{"aria-hidden":!0,className:`size-2.5`})}),t.anchor?(0,X.jsx)(`button`,{type:`button`,...l,"aria-expanded":i,"aria-controls":i?y:void 0,onClick:()=>{f(t.id),v(i?void 0:t.id)},children:c}):(0,X.jsx)(`div`,{...l,children:c})]},t.id)})}),F]})}),I]})]}),L]})}function Jc(e,t){return(0,X.jsx)(`line`,{x1:e.x,x2:e.x,y1:e.top,y2:e.bottom,className:`stroke-border`},t)}function Yc(e){let t=(0,Z.c)(9),{size:n}=e,r=n.additions===0?`text-muted-foreground`:`text-add-fg`,i;t[0]!==n.additions||t[1]!==r?(i=(0,X.jsxs)(`span`,{className:r,children:[`+`,n.additions]}),t[0]=n.additions,t[1]=r,t[2]=i):i=t[2];let a=n.deletions===0?`text-muted-foreground`:`text-del-fg`,o;t[3]!==n.deletions||t[4]!==a?(o=(0,X.jsxs)(`span`,{className:a,children:[`−`,n.deletions]}),t[3]=n.deletions,t[4]=a,t[5]=o):o=t[5];let s;return t[6]!==i||t[7]!==o?(s=(0,X.jsxs)(`span`,{className:`shrink-0 font-mono text-caption tabular-nums`,children:[i,` `,o]}),t[6]=i,t[7]=o,t[8]=s):s=t[8],s}function Xc(e){let t=(0,Z.c)(7),{size:n,uncommitted:r}=e,i;t[0]===n?i=t[1]:(i=n&&(0,X.jsx)(Yc,{size:n}),t[0]=n,t[1]=i);let a;t[2]===r?a=t[3]:(a=r&&(0,X.jsx)(`span`,{className:`text-caption text-muted-foreground`,children:`Uncommitted`}),t[2]=r,t[3]=a);let o;return t[4]!==i||t[5]!==a?(o=(0,X.jsxs)(`span`,{className:`flex shrink-0 items-baseline gap-2`,children:[i,a]}),t[4]=i,t[5]=a,t[6]=o):o=t[6],o}function Zc(e){let t=(0,Z.c)(9),{block:n,document:r}=e,i;t[0]===n.files?i=t[1]:(i=n.files.map(Qc),t[0]=n.files,t[1]=i);let a=Ic(r,i),o;if(t[2]!==n.files||t[3]!==a){let e;t[5]===a?e=t[6]:(e=e=>{let t=a.opening(e.path),n=a.size(e.path);return(0,X.jsx)(`li`,{children:(0,X.jsxs)(`button`,{type:`button`,disabled:t===void 0,"aria-busy":t===void 0,className:`grid w-full grid-cols-[minmax(0,1fr)_auto] items-baseline gap-x-3 gap-y-0.5 px-3 py-1.5 text-left hover:bg-muted focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-ring disabled:hover:bg-transparent`,onClick:()=>a.open(e.path),children:[(0,X.jsx)(`span`,{className:`font-mono text-caption wrap-anywhere`,children:e.path}),(0,X.jsx)(Xc,{size:n,uncommitted:a.uncommitted(e.path)}),e.note&&(0,X.jsx)(`span`,{className:`col-span-2 text-caption text-muted-foreground`,children:(0,X.jsx)($,{text:e.note})})]})},e.path)},t[5]=a,t[6]=e),o=n.files.map(e),t[2]=n.files,t[3]=a,t[4]=o}else o=t[4];let s;return t[7]===o?s=t[8]:(s=(0,X.jsx)(`ul`,{"aria-label":`Files`,className:`divide-y overflow-hidden rounded-md border`,children:o}),t[7]=o,t[8]=s),s}function Qc(e){return e.path}function $c(e){let t=(0,Z.c)(19),{block:n,pull:r}=e,i,a,o,s,c,l;if(t[0]!==n.checks||t[1]!==r){let{checks:e,live:u,headline:d,lead:f,moved:p}=wa(n.checks,r);a=e,i=sc,c=d.note?`${f}. ${d.note}`:f,l=(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(Bn,{tone:d.tone}),d.note?(0,X.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-wrap items-baseline gap-x-3 gap-y-0.5`,children:[(0,X.jsx)(`span`,{className:`min-w-0 text-foreground wrap-anywhere`,children:f}),(0,X.jsx)(`span`,{className:`ml-auto`,children:(0,X.jsx)(us,{label:d.note})})]}):(0,X.jsx)(`span`,{children:(0,X.jsx)(us,{label:f})}),p&&r&&(0,X.jsxs)(`span`,{className:`ml-auto text-warn`,children:[`#`,r.number,` is now at`,` `,(0,X.jsx)(`span`,{className:`font-mono`,children:p})]})]}),o=`flex flex-col py-1`,s=a.results.map((e,t)=>{let n=si(e,u);return(0,X.jsx)(`li`,{children:(0,X.jsxs)(`button`,{type:`button`,disabled:!r,title:r?`Open on #${r.number}`:void 0,onClick:()=>r?.openCheck(e.name),className:`flex h-7 w-full min-w-0 items-center gap-2 px-3 text-left text-ui hover:bg-muted focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-ring disabled:hover:bg-transparent`,children:[(0,X.jsx)(Bn,{tone:n.tone,label:n.label}),(0,X.jsx)(G,{text:e.name,className:`min-w-0 flex-1`}),(0,X.jsx)(`span`,{className:`shrink-0 text-caption text-muted-foreground`,children:n.detail})]})},`${e.name}:${t}`)}),t[0]=n.checks,t[1]=r,t[2]=i,t[3]=a,t[4]=o,t[5]=s,t[6]=c,t[7]=l}else i=t[2],a=t[3],o=t[4],s=t[5],c=t[6],l=t[7];let u;t[8]!==o||t[9]!==s?(u=(0,X.jsx)(`ul`,{className:o,children:s}),t[8]=o,t[9]=s,t[10]=u):u=t[10];let d;t[11]===a.more?d=t[12]:(d=a.more&&(0,X.jsx)(`p`,{className:`border-t px-3 py-1.5 text-caption text-muted-foreground`,children:`More checks on the pull request`}),t[11]=a.more,t[12]=d);let f;return t[13]!==i||t[14]!==c||t[15]!==l||t[16]!==u||t[17]!==d?(f=(0,X.jsxs)(i,{label:c,heading:l,children:[u,d]}),t[13]=i,t[14]=c,t[15]=l,t[16]=u,t[17]=d,t[18]=f):f=t[18],f}function el({blocks:e,step:t,title:n,run:r,document:i,pull:a,linesInFullDiff:o=!1}){return e.map((e,s)=>{switch(e.kind){case`excerpt`:return(0,X.jsx)(zc,{document:i,runId:r.id,step:t,excerpt:e.excerpt,inFullDiff:o},s);case`images`:return(0,X.jsx)(pc,{scope:i.scope,context:i.context,run:r,items:e.screenshots},s);case`files`:return(0,X.jsx)(Zc,{block:e,document:i},s);case`checks`:return(0,X.jsx)($c,{block:e,pull:a},s);case`diagram`:return(0,X.jsx)(qc,{diagram:e.diagram,document:i,runId:r.id,step:t,title:n},s)}})}function tl(e){let t=(0,Z.c)(15),{comparison:n,choose:r}=e,i;t[0]===n.columns?i=t[1]:(i=n.columns.map(il),t[0]=n.columns,t[1]=i);let a;t[2]===i?a=t[3]:(a=(0,X.jsx)(`thead`,{children:(0,X.jsx)(`tr`,{className:`bg-muted/50`,children:i})}),t[2]=i,t[3]=a);let o;t[4]===n.rows?o=t[5]:(o=n.rows.map(nl),t[4]=n.rows,t[5]=o);let s;t[6]===o?s=t[7]:(s=(0,X.jsx)(`tbody`,{children:o}),t[6]=o,t[7]=s);let c;t[8]!==r||t[9]!==n.columns?(c=r&&(0,X.jsx)(`tfoot`,{children:(0,X.jsx)(`tr`,{className:`border-t bg-muted/30`,children:n.columns.map((e,t)=>(0,X.jsx)(`td`,{className:`px-3 py-2 align-top not-last:border-r`,children:r(e)},t))})}),t[8]=r,t[9]=n.columns,t[10]=c):c=t[10];let l;return t[11]!==a||t[12]!==s||t[13]!==c?(l=(0,X.jsx)(`div`,{className:`overflow-hidden rounded-md border bg-background`,children:(0,X.jsxs)(`table`,{className:`w-full table-fixed border-collapse text-ui`,children:[a,s,c]})}),t[11]=a,t[12]=s,t[13]=c,t[14]=l):l=t[14],l}function nl(e,t){return(0,X.jsx)(`tr`,{className:`border-b last:border-b-0`,children:e.map(rl)},t)}function rl(e,t){return(0,X.jsx)(`td`,{className:`px-3 py-1.5 align-top text-foreground-2 wrap-anywhere not-last:border-r`,children:(0,X.jsx)($,{text:e})},t)}function il(e,t){return(0,X.jsx)(`th`,{scope:`col`,className:`border-b px-3 py-1.5 text-left align-bottom text-caption font-medium text-foreground not-last:border-r`,children:(0,X.jsx)($,{text:e})},t)}function al(e){let t=(0,Z.c)(51),n,r;t[0]===e?(n=t[1],r=t[2]):({document:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i=Oo(r.scope,r.context),a=ko(r.scope,r.context,r.base),o=n.step,s=i?.content.stops[o-1];if(!i||!s){let e;return t[3]===r?e=t[4]:(e=(0,X.jsx)(L,{message:`The walkthrough changed since this tab was opened.`,action:(0,X.jsx)(H,{variant:`outline`,size:`sm`,onClick:()=>r.onOpen({kind:`review`}),children:`Open review`})}),t[3]=r,t[4]=e),e}let c=i.content.stops.length,l=`Step ${o} of ${c}`,u;t[5]===l?u=t[6]:(u=(0,X.jsx)(`span`,{className:`mr-2 font-normal text-muted-foreground`,children:l}),t[5]=l,t[6]=u);let d;t[7]===s.title?d=t[8]:(d=(0,X.jsx)($,{text:s.title}),t[7]=s.title,t[8]=d);let f;t[9]!==u||t[10]!==d?(f=(0,X.jsxs)(X.Fragment,{children:[u,d]}),t[9]=u,t[10]=d,t[11]=f):f=t[11];let p;t[12]===s.title?p=t[13]:(p=zt(s.title),t[12]=s.title,t[13]=p);let m=`${l}: ${p}`,h;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,X.jsx)(ua,{}),t[14]=h):h=t[14];let g=o===1,_;t[15]!==r||t[16]!==o?(_=()=>r.onOpen({kind:`walkthrough-step`,step:o-1}),t[15]=r,t[16]=o,t[17]=_):_=t[17];let v;t[18]!==g||t[19]!==_?(v=(0,X.jsx)(oc,{label:`Previous step`,icon:h,disabled:g,onClick:_}),t[18]=g,t[19]=_,t[20]=v):v=t[20];let y;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,X.jsx)(J,{}),t[21]=y):y=t[21];let b=o===c,x;t[22]!==r||t[23]!==o?(x=()=>r.onOpen({kind:`walkthrough-step`,step:o+1}),t[22]=r,t[23]=o,t[24]=x):x=t[24];let S;t[25]!==b||t[26]!==x?(S=(0,X.jsx)(oc,{label:`Next step`,icon:y,disabled:b,onClick:x}),t[25]=b,t[26]=x,t[27]=S):S=t[27];let C;t[28]!==S||t[29]!==v?(C=(0,X.jsxs)(`span`,{className:`flex items-center`,children:[v,S]}),t[28]=S,t[29]=v,t[30]=C):C=t[30];let w;t[31]!==C||t[32]!==f||t[33]!==m?(w={title:f,titleLabel:m,after:C},t[31]=C,t[32]=f,t[33]=m,t[34]=w):w=t[34];let T=w,E;t[35]!==a||t[36]!==s?(E=lt(s,a),t[35]=a,t[36]=s,t[37]=E):E=t[37];let D=E;if(D.length===0){let e;t[38]!==T.after||t[39]!==T.title||t[40]!==T.titleLabel?(e=(0,X.jsx)(qr,{inline:!0,title:T.title,titleLabel:T.titleLabel,children:T.after}),t[38]=T.after,t[39]=T.title,t[40]=T.titleLabel,t[41]=e):e=t[41];let n;t[42]===s.explanation?n=t[43]:(n=(0,X.jsx)(`p`,{className:`overflow-auto p-4 text-ui`,children:(0,X.jsx)($,{text:s.explanation})}),t[42]=s.explanation,t[43]=n);let r;return t[44]!==e||t[45]!==n?(r=(0,X.jsxs)(`section`,{className:`flex min-h-0 flex-1 flex-col`,children:[e,n]}),t[44]=e,t[45]=n,t[46]=r):r=t[46],r}let O;return t[47]!==T||t[48]!==D||t[49]!==r?(O=(0,X.jsx)(ul,{...r,only:D,heading:T}),t[47]=T,t[48]=D,t[49]=r,t[50]=O):O=t[50],O}function ol(e){let t=(0,Z.c)(40),{document:n,entry:r,code:i,label:a,branch:o,eager:s,bleed:c}=e,l=c===void 0?`-mx-5 @3xl:-mx-8`:c,[u,d]=(0,Y.useState)(25),[f,p]=(0,Y.useState)(s);s&&!f&&p(!0);let m;t[0]!==o||t[1]!==i?(m=o?i.branch:[],t[0]=o,t[1]=i,t[2]=m):m=t[2];let h=m;if(h.length===0&&i.worktree.length===0)return null;if(!f){let e=`Code: ${a}`,n;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(n=sl(()=>p(!0)),t[3]=n):n=t[3];let r;t[4]===l?r=t[5]:(r=j(`flex flex-col gap-2`,l),t[4]=l,t[5]=r);let o;t[6]===h?o=t[7]:(o=(0,X.jsx)(cl,{title:`Branch`,paths:h}),t[6]=h,t[7]=o);let s;t[8]!==i.worktree||t[9]!==u?(s=i.worktree.slice(0,u),t[8]=i.worktree,t[9]=u,t[10]=s):s=t[10];let c;t[11]===s?c=t[12]:(c=(0,X.jsx)(cl,{title:`Uncommitted`,paths:s}),t[11]=s,t[12]=c);let d;return t[13]!==e||t[14]!==r||t[15]!==o||t[16]!==c?(d=(0,X.jsxs)(`div`,{role:`group`,"aria-label":e,ref:n,className:r,children:[o,c]}),t[13]=e,t[14]=r,t[15]=o,t[16]=c,t[17]=d):d=t[17],d}let g;t[18]!==n.interaction||t[19]!==r?(g=e=>({...n.interaction,active:!1,quiet:!0,toolbarTarget:null,fileTarget:void 0,entry:`${r}:${e}`}),t[18]=n.interaction,t[19]=r,t[20]=g):g=t[20];let _=g,v=`Code: ${a}`,y;t[21]===l?y=t[22]:(y=j(`flex flex-col gap-2`,l),t[21]=l,t[22]=y);let b;t[23]!==o||t[24]!==h||t[25]!==n||t[26]!==_||t[27]!==a?(b=h.length>0&&(0,X.jsx)(`section`,{"aria-label":`${a}: branch`,className:`flex flex-col`,children:(0,X.jsx)(Ur,{...n,compared:o,only:h,fullHeight:!0,interaction:_(`branch`),heading:{title:`Branch`,titleLabel:`${a}: branch`}})}),t[23]=o,t[24]=h,t[25]=n,t[26]=_,t[27]=a,t[28]=b):b=t[28];let x;t[29]!==i.worktree||t[30]!==n||t[31]!==_||t[32]!==a||t[33]!==u?(x=i.worktree.length>0&&(0,X.jsx)(`section`,{"aria-label":`${a}: uncommitted`,className:`flex flex-col`,children:(0,X.jsx)(jr,{...n,only:i.worktree,limit:u,onReadMore:()=>d(u+25),fullHeight:!0,interaction:_(`uncommitted`),heading:{title:`Uncommitted`,titleLabel:`${a}: uncommitted`}})}),t[29]=i.worktree,t[30]=n,t[31]=_,t[32]=a,t[33]=u,t[34]=x):x=t[34];let S;return t[35]!==v||t[36]!==y||t[37]!==b||t[38]!==x?(S=(0,X.jsxs)(`div`,{role:`group`,"aria-label":v,className:y,children:[b,x]}),t[35]=v,t[36]=y,t[37]=b,t[38]=x,t[39]=S):S=t[39],S}function sl(e){return t=>{if(!t)return;let n=new IntersectionObserver(t=>{t.some(e=>e.isIntersecting)&&e()},{root:t.closest(`[data-review-scroll]`),rootMargin:`600px 0px`});return n.observe(t),()=>n.disconnect()}}function cl(e){let t=(0,Z.c)(9),{title:n,paths:r}=e;if(r.length===0)return null;let i;t[0]===n?i=t[1]:(i=(0,X.jsx)(`h3`,{className:`border-b px-4 py-2.5 text-ui font-semibold`,children:n}),t[0]=n,t[1]=i);let a;t[2]===r?a=t[3]:(a=r.slice(0,25).map(ll),t[2]=r,t[3]=a);let o;t[4]===a?o=t[5]:(o=(0,X.jsx)(`ul`,{children:a}),t[4]=a,t[5]=o);let s;return t[6]!==i||t[7]!==o?(s=(0,X.jsxs)(`section`,{className:`flex flex-col`,children:[i,o]}),t[6]=i,t[7]=o,t[8]=s):s=t[8],s}function ll(e){return(0,X.jsx)(`li`,{className:`min-h-40 px-4 py-3 font-mono text-caption text-muted-foreground`,children:e},e)}function ul(e){let t=(0,Z.c)(9),n=Mr(e.scope,e.context.connection),[r,i]=(0,Y.useState)(`branch`),a;t[0]!==n||t[1]!==r||t[2]!==e?(a=t=>{let{branch:a,worktree:o}=Gr({branch:t.files,worktree:n.changes,only:e.only}),s=a.length>0&&o.length>0,c=t=>({...e.interaction,active:e.interaction.active&&(!s||r===t),toolbarTarget:s&&r!==t?null:e.interaction.toolbarTarget,entry:s?`${e.interaction.entry}:${t}`:e.interaction.entry});return(0,X.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,X.jsx)(br,{scope:e.scope,context:e.context,interaction:e.interaction,branchFiles:t.files,changes:n,committed:a,dirty:o,range:xn(t)}),s&&(0,X.jsx)(qr,{inline:!0,title:e.heading.title,titleLabel:e.heading.titleLabel,children:e.heading.after}),(0,X.jsxs)(`div`,{className:s?`min-h-0 flex-1 overflow-auto`:`flex min-h-0 flex-1 flex-col`,children:[a.length>0&&(0,X.jsx)(`section`,{"aria-label":`Branch code`,className:`flex min-h-0 flex-1 flex-col`,onFocusCapture:()=>i(`branch`),onPointerDownCapture:()=>i(`branch`),children:(0,X.jsx)(Ur,{...e,only:a,fullHeight:s,interaction:c(`branch`),heading:s?{title:`Branch`,titleLabel:`Branch`}:e.heading})}),o.length>0&&(0,X.jsx)(`section`,{"aria-label":`Uncommitted code`,className:`flex min-h-0 flex-1 flex-col`,onFocusCapture:()=>i(`uncommitted`),onPointerDownCapture:()=>i(`uncommitted`),children:(0,X.jsx)(jr,{...e,only:o,fullHeight:s,interaction:c(`uncommitted`),heading:s?{title:`Uncommitted`,titleLabel:`Uncommitted`}:e.heading})}),a.length===0&&o.length===0&&(0,X.jsx)(L,{message:`These files no longer have changes.`})]})]})},t[0]=n,t[1]=r,t[2]=e,t[3]=a):a=t[3];let o;return t[4]!==e.base||t[5]!==e.context||t[6]!==e.scope||t[7]!==a?(o=(0,X.jsx)(Yn,{scope:e.scope,context:e.context,base:e.base,children:a}),t[4]=e.base,t[5]=e.context,t[6]=e.scope,t[7]=a,t[8]=o):o=t[8],o}var dl=60;function fl(e){return t=>{let n=t?.closest(`[data-review-scroll]`);if(!t||!n)return;let r=()=>{let r=n.getBoundingClientRect().top+dl,i=Array.from(t.children),a=0;i.forEach((e,t)=>{e.getBoundingClientRect().top<=r&&(a=t+1)});let o=n.scrollTop>0&&n.scrollTop+n.clientHeight>=n.scrollHeight-2,s=i.at(-1),c=s!==void 0&&s.getBoundingClientRect().top<n.getBoundingClientRect().bottom,l=o&&c?i.length:a,u=i[l-1]?.querySelector(`h2`),d=t.previousElementSibling?.getBoundingClientRect().bottom;e(l,u!=null&&d!==void 0&&u.getBoundingClientRect().bottom<=d)};return r(),n.addEventListener(`scroll`,r,{passive:!0}),()=>n.removeEventListener(`scroll`,r)}}function pl(e){let t=(0,Z.c)(31),{stops:n,current:r,titled:i,outside:a,onStep:o,onJump:s}=e,c=Math.max(r,1),l=n[c-1],u=r===0?`${n.length} ${n.length===1?`step`:`steps`}`:`Step ${c} of ${n.length}`,d;t[0]===u?d=t[1]:(d=(0,X.jsx)(`span`,{className:`shrink-0 text-caption text-muted-foreground tabular-nums`,children:u}),t[0]=u,t[1]=d);let f;t[2]!==r||t[3]!==l||t[4]!==i?(f=i&&r>0&&(0,X.jsx)(G,{text:zt(l.title),className:`min-w-0 flex-1 font-medium`}),t[2]=r,t[3]=l,t[4]=i,t[5]=f):f=t[5];let p;t[6]!==d||t[7]!==f?(p=(0,X.jsxs)(`p`,{className:`flex min-w-0 flex-1 items-baseline gap-2 text-ui`,children:[d,f]}),t[6]=d,t[7]=f,t[8]=p):p=t[8];let m;t[9]!==s||t[10]!==a?(m=a>0&&(0,X.jsxs)(`button`,{type:`button`,onClick:()=>s(`review-not-covered`),className:`hidden shrink-0 text-caption text-muted-foreground hover:text-foreground @2xl:block`,children:[a===1?`1 file`:`${a} files`,` not in a step`]}),t[9]=s,t[10]=a,t[11]=m):m=t[11];let h;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,X.jsx)(on,{}),t[12]=h):h=t[12];let g=r<=1,_;t[13]===o?_=t[14]:(_=()=>o(-1),t[13]=o,t[14]=_);let v;t[15]!==g||t[16]!==_?(v=(0,X.jsx)(oc,{label:`Previous step`,shortcut:`K`,icon:h,disabled:g,onClick:_}),t[15]=g,t[16]=_,t[17]=v):v=t[17];let y;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,X.jsx)(et,{}),t[18]=y):y=t[18];let b=r>=n.length,x;t[19]===o?x=t[20]:(x=()=>o(1),t[19]=o,t[20]=x);let S;t[21]!==b||t[22]!==x?(S=(0,X.jsx)(oc,{label:`Next step`,shortcut:`J`,icon:y,disabled:b,onClick:x}),t[21]=b,t[22]=x,t[23]=S):S=t[23];let C;t[24]!==S||t[25]!==v?(C=(0,X.jsxs)(`span`,{className:`flex shrink-0 items-center`,children:[v,S]}),t[24]=S,t[25]=v,t[26]=C):C=t[26];let w;return t[27]!==C||t[28]!==p||t[29]!==m?(w=(0,X.jsx)(`nav`,{"aria-label":`Step navigation`,className:`sticky top-0 z-10 -mx-5 bg-card px-5 @3xl:-mx-8 @3xl:px-8`,children:(0,X.jsxs)(`div`,{className:`flex h-11 items-center gap-3 border-b`,children:[p,m,C]})}),t[27]=C,t[28]=p,t[29]=m,t[30]=w):w=t[30],w}function ml({stop:e,step:t,decision:n}){return e.callouts.map(({attention:e,comparison:r},i)=>(0,X.jsxs)(`section`,{id:_c(t,i),"aria-label":`Your call: ${mn(e)}`,className:`flex flex-col gap-2 border-l-2 border-warn pl-4`,children:[(0,X.jsxs)(`p`,{className:`text-caption font-medium text-warn`,children:[`Your call · `,mn(e)]}),(0,X.jsx)(`h3`,{className:`text-section font-semibold text-pretty`,children:(0,X.jsx)($,{text:e.question})}),(0,X.jsx)(`p`,{className:`text-ui text-foreground-2`,children:(0,X.jsx)($,{text:e.note})}),n?n({step:t,index:i,comparison:r}):r&&(0,X.jsx)(tl,{comparison:r})]},i))}function hl(e){let t=(0,Z.c)(29),{props:n,code:r,branch:i,eager:a,step:o,open:s,onOpen:c}=e,l;t[0]!==i||t[1]!==r?(l=i?r:{...r,branch:[]},t[0]=i,t[1]=r,t[2]=l):l=t[2];let u;t[3]===l?u=t[4]:(u=kn(l),t[3]=l,t[4]=u);let d=u;if(d===0)return null;let f;t[5]!==c||t[6]!==s?(f=()=>c(!s),t[5]=c,t[6]=s,t[7]=f):f=t[7];let p=s&&`rotate-90`,m;t[8]===p?m=t[9]:(m=j(`size-3.5`,p),t[8]=p,t[9]=m);let h;t[10]===m?h=t[11]:(h=(0,X.jsx)(J,{"aria-hidden":!0,className:m}),t[10]=m,t[11]=h);let g=d===1?`1 file`:`${d} files`,_;t[12]===g?_=t[13]:(_=(0,X.jsxs)(`span`,{className:`tabular-nums`,children:[`· `,g]}),t[12]=g,t[13]=_);let v;t[14]!==s||t[15]!==f||t[16]!==h||t[17]!==_?(v=(0,X.jsxs)(`button`,{type:`button`,"aria-expanded":s,onClick:f,className:`-mx-2 flex h-8 items-center gap-1.5 self-start rounded-md px-2 text-left text-caption text-muted-foreground hover:text-foreground focus-visible:outline-2 focus-visible:outline-ring`,children:[h,`Full diff of this step`,_]}),t[14]=s,t[15]=f,t[16]=h,t[17]=_,t[18]=v):v=t[18];let y;t[19]!==i||t[20]!==r||t[21]!==a||t[22]!==s||t[23]!==n||t[24]!==o?(y=s&&(0,X.jsx)(ol,{document:n,entry:`review:step-${o}`,code:r,branch:i,eager:a,label:`Step ${o}`,bleed:``}),t[19]=i,t[20]=r,t[21]=a,t[22]=s,t[23]=n,t[24]=o,t[25]=y):y=t[25];let b;return t[26]!==y||t[27]!==v?(b=(0,X.jsxs)(`div`,{className:`flex flex-col`,children:[v,y]}),t[26]=y,t[27]=v,t[28]=b):b=t[28],b}function gl(e){let t=(0,Z.c)(55),{stop:n,step:r,run:i,props:a,code:o,branch:s,eager:c,conversation:l,decision:u,pull:d}=e,[f,p]=(0,Y.useState)(!1),m;t[0]===r?m=t[1]:(m=gc(r),t[0]=r,t[1]=m);let h;t[2]===r?h=t[3]:(h=gc(r),t[2]=r,t[3]=h);let g=`${h}-title`,_;t[4]===r?_=t[5]:(_=gc(r),t[4]=r,t[5]=_);let v=`${_}-title`,y;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,X.jsx)(`span`,{className:`sr-only`,children:`Step `}),t[6]=y):y=t[6];let b;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,X.jsx)(`span`,{className:`sr-only`,children:`: `}),t[7]=b):b=t[7];let x;t[8]===r?x=t[9]:(x=(0,X.jsxs)(`span`,{className:`shrink-0 font-normal text-muted-foreground tabular-nums`,children:[y,r,b]}),t[8]=r,t[9]=x);let S;t[10]===n.title?S=t[11]:(S=(0,X.jsx)(`span`,{className:`min-w-0`,children:(0,X.jsx)($,{text:n.title})}),t[10]=n.title,t[11]=S);let C;t[12]!==v||t[13]!==x||t[14]!==S?(C=(0,X.jsxs)(`h2`,{id:v,className:`flex gap-2.5 text-section font-semibold text-pretty`,children:[x,S]}),t[12]=v,t[13]=x,t[14]=S,t[15]=C):C=t[15];let w;t[16]===n.explanation?w=t[17]:(w=(0,X.jsx)(`p`,{className:`text-prose text-foreground-2`,children:(0,X.jsx)($,{text:n.explanation})}),t[16]=n.explanation,t[17]=w);let T;t[18]!==C||t[19]!==w?(T=(0,X.jsxs)(`header`,{className:`flex flex-col gap-1`,children:[C,w]}),t[18]=C,t[19]=w,t[20]=T):T=t[20];let E;t[21]!==u||t[22]!==r||t[23]!==n?(E=(0,X.jsx)(ml,{stop:n,step:r,decision:u}),t[21]=u,t[22]=r,t[23]=n,t[24]=E):E=t[24];let D=n.blocks,O;t[25]===n.title?O=t[26]:(O=zt(n.title),t[25]=n.title,t[26]=O);let k;t[27]!==f||t[28]!==a||t[29]!==d||t[30]!==i||t[31]!==r||t[32]!==n.blocks||t[33]!==O?(k=(0,X.jsx)(el,{blocks:D,step:r,title:O,run:i,document:a,pull:d,linesInFullDiff:f}),t[27]=f,t[28]=a,t[29]=d,t[30]=i,t[31]=r,t[32]=n.blocks,t[33]=O,t[34]=k):k=t[34];let A;t[35]!==s||t[36]!==o||t[37]!==f||t[38]!==c||t[39]!==a||t[40]!==r?(A=o&&(0,X.jsx)(hl,{props:a,code:o,branch:s,eager:c,step:r,open:f,onOpen:p}),t[35]=s,t[36]=o,t[37]=f,t[38]=c,t[39]=a,t[40]=r,t[41]=A):A=t[41];let j;t[42]!==l||t[43]!==r?(j=l?.({step:r}),t[42]=l,t[43]=r,t[44]=j):j=t[44];let M;t[45]!==T||t[46]!==E||t[47]!==k||t[48]!==A||t[49]!==j||t[50]!==g?(M=(0,X.jsxs)(`article`,{"aria-labelledby":g,className:`flex min-w-0 flex-col gap-4`,children:[T,E,k,A,j]}),t[45]=T,t[46]=E,t[47]=k,t[48]=A,t[49]=j,t[50]=g,t[51]=M):M=t[51];let N;return t[52]!==m||t[53]!==M?(N=(0,X.jsx)(`li`,{id:m,className:`border-t py-6 first:border-t-0 first:pt-5`,children:M}),t[52]=m,t[53]=M,t[54]=N):N=t[54],N}function _l(e){let t=(0,Z.c)(7),{onStep:n,onComment:r}=e,i;t[0]===n?i=t[1]:(i=()=>n(1),t[0]=n,t[1]=i);let a;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(a={ignoreInputs:!0},t[2]=a):a=t[2],vi(`J`,i,a);let o;t[3]===n?o=t[4]:(o=()=>n(-1),t[3]=n,t[4]=o);let s;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(s={ignoreInputs:!0},t[5]=s):s=t[5],vi(`K`,o,s);let c;return t[6]===Symbol.for(`react.memo_cache_sentinel`)?(c={ignoreInputs:!0,preventDefault:!0},t[6]=c):c=t[6],vi(ui.comment,r,c),null}function vl(e){let t=document.getElementById(gc(e))?.querySelector(`textarea`);t?.scrollIntoView({block:`center`}),t?.focus()}function yl(e){let t=(0,Z.c)(41),{content:n,run:r,props:i,code:a,branch:o,eager:s,outside:c,conversation:l,decision:u,pull:d,onJump:f}=e,p;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(p={current:0,titled:!1},t[0]=p):p=t[0];let[m,h]=(0,Y.useState)(p),{current:g,titled:_}=m,v=n.stops.length,y;t[1]!==g||t[2]!==v?(y=(e,t)=>{let n=t===void 0?`smooth`:t;hc(gc(Math.min(Math.max(g+e,1),v)),n)},t[1]=g,t[2]=v,t[3]=y):y=t[3];let b=y,x=Hn()&&i.interaction.active&&i.interaction.hidden!==!0;if(v===0)return null;let S;t[4]!==g||t[5]!==x||t[6]!==b?(S=x&&(0,X.jsx)(_l,{onStep:e=>b(e,`auto`),onComment:()=>vl(Math.max(g,1))}),t[4]=g,t[5]=x,t[6]=b,t[7]=S):S=t[7];let C;t[8]!==n.stops||t[9]!==g||t[10]!==f||t[11]!==c||t[12]!==b||t[13]!==_?(C=(0,X.jsx)(pl,{stops:n.stops,current:g,titled:_,outside:c,onStep:b,onJump:f}),t[8]=n.stops,t[9]=g,t[10]=f,t[11]=c,t[12]=b,t[13]=_,t[14]=C):C=t[14];let w;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(w=fl((e,t)=>h(n=>n.current===e&&n.titled===t?n:{current:e,titled:t})),t[15]=w):w=t[15];let T;if(t[16]!==o||t[17]!==a||t[18]!==n.stops||t[19]!==l||t[20]!==u||t[21]!==s||t[22]!==i||t[23]!==d||t[24]!==r){let e;t[26]!==o||t[27]!==a||t[28]!==l||t[29]!==u||t[30]!==s||t[31]!==i||t[32]!==d||t[33]!==r?(e=(e,t)=>(0,X.jsx)(gl,{stop:e,step:t+1,run:r,props:i,code:a[t],branch:o,eager:s[t]??!0,conversation:l,decision:u,pull:d},t),t[26]=o,t[27]=a,t[28]=l,t[29]=u,t[30]=s,t[31]=i,t[32]=d,t[33]=r,t[34]=e):e=t[34],T=n.stops.map(e),t[16]=o,t[17]=a,t[18]=n.stops,t[19]=l,t[20]=u,t[21]=s,t[22]=i,t[23]=d,t[24]=r,t[25]=T}else T=t[25];let E;t[35]===T?E=t[36]:(E=(0,X.jsx)(`ol`,{ref:w,className:`flex flex-col`,children:T}),t[35]=T,t[36]=E);let D;return t[37]!==S||t[38]!==C||t[39]!==E?(D=(0,X.jsxs)(`section`,{"aria-label":`Steps`,"aria-keyshortcuts":`J K C`,className:`flex flex-col`,children:[S,C,E]}),t[37]=S,t[38]=C,t[39]=E,t[40]=D):D=t[40],D}function bl(e){let t=(0,Z.c)(37),{owner:n,step:r,index:i,comparison:a}=e,{view:o,failed:s}=qo(n),{decide:c,waiting:l,failure:u}=Qo(n),d=ye(n.context),f=l||!!d||o===void 0,p,m,h,g;if(t[0]!==a||t[1]!==c||t[2]!==f||t[3]!==i||t[4]!==r||t[5]!==o?.decisions||t[6]!==d){let e=nr(o?.decisions,r,i),n=xt(a);p=hr(a,e);let s=new Map(n.map(xl)),l;t[11]!==s||t[12]!==c||t[13]!==f||t[14]!==i||t[15]!==r||t[16]!==d?(l=e=>{let t=s.get(e);return t===void 0?null:(0,X.jsxs)(`div`,{className:`flex flex-col items-start gap-1.5`,children:[(0,X.jsx)(H,{size:`sm`,variant:`outline`,disabled:f,"aria-label":`Choose ${e}`,"aria-description":[t.implemented?`In this change.`:void 0,t.effect,d].filter(Boolean).join(` `)||void 0,onClick:()=>c({step:r,call:i,decided:!0,option:e}),children:`Choose`}),(0,X.jsxs)(`span`,{className:`flex min-w-0 flex-wrap items-center gap-x-2 gap-y-0.5`,children:[t.implemented&&(0,X.jsx)(Ie,{variant:`outline`,children:`In this change`}),t.effect&&(0,X.jsx)(`span`,{className:`text-caption text-pretty text-muted-foreground`,children:t.effect})]})]})},t[11]=s,t[12]=c,t[13]=f,t[14]=i,t[15]=r,t[16]=d,t[17]=l):l=t[17];let u=l,_;t[18]!==n||t[19]!==a||t[20]!==c||t[21]!==f||t[22]!==i||t[23]!==r||t[24]!==d?(_=n.length>0?(0,X.jsx)(`p`,{className:`text-caption text-muted-foreground`,children:$t(a)}):(0,X.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,X.jsx)(H,{size:`sm`,variant:`outline`,className:`self-start`,disabled:f,"aria-description":d,onClick:()=>c({step:r,call:i,decided:!0}),children:`Mark decided`}),(0,X.jsx)(`p`,{className:`text-caption text-muted-foreground`,children:$t(a)})]}),t[18]=n,t[19]=a,t[20]=c,t[21]=f,t[22]=i,t[23]=r,t[24]=d,t[25]=_):_=t[25];let v=_;m=`flex flex-col gap-2`,h=a&&(0,X.jsx)(tl,{comparison:a,choose:e?void 0:u}),g=e?(0,X.jsxs)(`p`,{role:`status`,className:`flex flex-wrap items-center gap-x-2 gap-y-1 text-ui`,children:[p===`needs-commit`?(0,X.jsx)(Nn,{"aria-hidden":!0,className:`size-3.5 shrink-0 text-warn`}):(0,X.jsx)(R,{"aria-hidden":!0,className:`size-3.5 shrink-0 text-add-fg`}),(0,X.jsx)(`span`,{className:`font-medium`,children:Jr(e)}),(0,X.jsx)(`time`,{dateTime:e.decidedAt,className:`text-caption text-muted-foreground`,children:ni(e.decidedAt)}),(0,X.jsx)(H,{variant:`link`,size:`sm`,disabled:f,"aria-description":d,onClick:()=>c({step:r,call:i,decided:!1}),children:`Undo`})]}):v,t[0]=a,t[1]=c,t[2]=f,t[3]=i,t[4]=r,t[5]=o?.decisions,t[6]=d,t[7]=p,t[8]=m,t[9]=h,t[10]=g}else p=t[7],m=t[8],h=t[9],g=t[10];let _;t[26]===p?_=t[27]:(_=p===`needs-commit`&&(0,X.jsx)(`p`,{className:`text-caption text-warn`,children:`Needs a new commit: this change does not do this yet.`}),t[26]=p,t[27]=_);let v;t[28]!==s||t[29]!==u?(v=(u??(s?`Decisions could not be read.`:void 0))&&(0,X.jsx)(`p`,{role:`alert`,className:`text-caption text-destructive`,children:u??`Decisions could not be read.`}),t[28]=s,t[29]=u,t[30]=v):v=t[30];let y;return t[31]!==m||t[32]!==h||t[33]!==g||t[34]!==_||t[35]!==v?(y=(0,X.jsxs)(`div`,{className:m,children:[h,g,_,v]}),t[31]=m,t[32]=h,t[33]=g,t[34]=_,t[35]=v,t[36]=y):y=t[36],y}function xl(e){return[e.option,e]}function Sl(e,t){let n=(0,Z.c)(8),r;n[0]===e?r=n[1]:(r=he(e),n[0]=e,n[1]=r);let[i,a]=Di(r),o;n[2]!==t||n[3]!==a?(o=async(e,n,r)=>{let i=e.walkthroughSettings?.mode??`manual`;try{await a({projectId:e.id,mode:i,writer:n})}catch{Je({title:`The project default was not saved`,type:`error`});return}t(),Je({title:`${r} is the default for ${e.name}`,type:`success`})},n[2]=t,n[3]=a,n[4]=o):o=n[4];let s;return n[5]!==i.waiting||n[6]!==o?(s={saving:i.waiting,save:o},n[5]=i.waiting,n[6]=o,n[7]=s):s=n[7],s}function Cl(e){let t=(0,Z.c)(65),{document:r,writer:i}=e,{connection:a}=r.context,o;t[0]===r.scope?o=t[1]:(o=e=>e.id===r.scope.projectId,t[0]=r.scope,t[1]=o);let s=kr(a).projects.find(o),c;t[2]===i?c=t[3]:(c=()=>i.choose(void 0),t[2]=i,t[3]=c);let l=Sl(a,c),{settings:d,writer:f}=i;if(!d||!f||d.models.length===0)return null;let{models:p}=d,h;t[4]===f?h=t[5]:(h=de(f),t[4]=f,t[5]=h);let g=h,v;t[6]!==p||t[7]!==f?(v=Le(f,p),t[6]=p,t[7]=f,t[8]=v):v=t[8];let y=v,b=je(p),x;if(t[9]!==p||t[10]!==f.model||t[11]!==f.provider){let e;t[13]!==f.model||t[14]!==f.provider?(e=e=>e.provider===f.provider&&e.model===f.model,t[13]=f.model,t[14]=f.provider,t[15]=e):e=t[15],x=p.find(e),t[9]=p,t[10]=f.model,t[11]=f.provider,t[12]=x}else x=t[12];let C=x,T=qe(f,p),E=C?.label??f.model,D=s?.walkthroughSettings?.writer,O=Ge(D,f,p),k;t[16]!==i||t[17]!==p||t[18]!==f?(k=e=>i.choose(Fe(e,f,p)),t[16]=i,t[17]=p,t[18]=f,t[19]=k):k=t[19];let A=k,j=`Writer: ${y}`,N;t[20]===j?N=t[21]:(N=(0,X.jsx)(H,{variant:`ghost`,size:`sm`,"aria-label":j,className:`max-w-full min-w-0`}),t[20]=j,t[21]=N);let P;t[22]===y?P=t[23]:(P=(0,X.jsx)(G,{text:y}),t[22]=y,t[23]=P);let I;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(I=(0,X.jsx)(et,{"aria-hidden":`true`}),t[24]=I):I=t[24];let L;t[25]!==N||t[26]!==P?(L=(0,X.jsxs)(Be,{render:N,children:[P,I]}),t[25]=N,t[26]=P,t[27]=L):L=t[27];let R;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(R=(0,X.jsx)(w,{children:(0,X.jsx)(it,{children:`Writer for the next run`})}),t[28]=R):R=t[28];let z;t[29]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,X.jsx)(m,{}),t[29]=z):z=t[29];let B;t[30]!==E||t[31]!==f.latest?(B=f.latest===void 0&&(0,X.jsx)(G,{text:E,className:`ml-auto text-muted-foreground`}),t[30]=E,t[31]=f.latest,t[32]=B):B=t[32];let V;t[33]===B?V=t[34]:(V=(0,X.jsxs)(S,{children:[`Exact model`,B]}),t[33]=B,t[34]=V);let ee=b.map(Tl),U;t[35]!==A||t[36]!==g||t[37]!==ee?(U=(0,X.jsx)(u,{className:`w-52`,children:(0,X.jsx)(n,{value:g,onValueChange:A,children:ee})}),t[35]=A,t[36]=g,t[37]=ee,t[38]=U):U=t[38];let te;t[39]!==V||t[40]!==U?(te=(0,X.jsxs)(re,{children:[V,U]}),t[39]=V,t[40]=U,t[41]=te):te=t[41];let ne=re,W;t[42]===f.effort?W=t[43]:(W=(0,X.jsxs)(S,{children:[`Effort`,(0,X.jsx)(`span`,{className:`ml-auto text-muted-foreground`,children:f.effort})]}),t[42]=f.effort,t[43]=W);let ie=u,ae=n,oe=f.effort,se;t[44]!==i||t[45]!==f?(se=e=>i.choose(ce(f,e)),t[44]=i,t[45]=f,t[46]=se):se=t[46];let le=T.map(wl),ue;t[47]!==ae||t[48]!==se||t[49]!==le||t[50]!==f.effort?(ue=(0,X.jsx)(ae,{value:oe,onValueChange:se,children:le}),t[47]=ae,t[48]=se,t[49]=le,t[50]=f.effort,t[51]=ue):ue=t[51];let K;t[52]!==ie||t[53]!==ue?(K=(0,X.jsx)(ie,{className:`w-36`,children:ue}),t[52]=ie,t[53]=ue,t[54]=K):K=t[54];let q;t[55]!==ne||t[56]!==W||t[57]!==K?(q=(0,X.jsxs)(ne,{children:[W,K]}),t[55]=ne,t[56]=W,t[57]=K,t[58]=q):q=t[58];let J;return t[59]!==O||t[60]!==y||t[61]!==s||t[62]!==l||t[63]!==f?(J=s&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(m,{}),(0,X.jsx)(F,{disabled:O||l.saving,onSelect:()=>l.save(s,f,y),children:O?`Project default`:`Make project default`})]}),t[59]=O,t[60]=y,t[61]=s,t[62]=l,t[63]=f,t[64]=J):J=t[64],(0,X.jsxs)(M,{children:[L,(0,X.jsxs)(_,{align:`start`,className:`w-64`,children:[R,(0,X.jsx)(n,{value:g,onValueChange:A,children:b.map(Dl)}),z,te,q,J]})]})}function wl(e){return(0,X.jsx)(ne,{closeOnSelect:!0,value:e,children:e},e)}function Tl(e){return(0,X.jsxs)(w,{children:[(0,X.jsx)(it,{children:e.label}),e.exact.map(El)]},e.provider)}function El(e){return(0,X.jsx)(ne,{closeOnSelect:!0,value:e.key,children:e.label},e.key)}function Dl(e){return e.latest.length>0?(0,X.jsxs)(w,{children:[(0,X.jsx)(it,{children:e.label}),e.latest.map(Ol)]},e.provider):null}function Ol(e){return(0,X.jsxs)(ne,{closeOnSelect:!0,value:e.key,children:[e.label,(0,X.jsx)(`span`,{className:`mr-5 ml-auto text-muted-foreground`,children:e.model})]},e.key)}function kl(e){let t=(0,Z.c)(9),{document:n}=e,{connection:r}=n.context,i=_e(),a=kr(r),s;if(t[0]!==n.scope||t[1]!==a.projects){let e;t[3]===n.scope?e=t[4]:(e=e=>e.id===n.scope.projectId,t[3]=n.scope,t[4]=e),s=a.projects.find(e),t[0]=n.scope,t[1]=a.projects,t[2]=s}else s=t[2];let c=s,l;return t[5]!==r||t[6]!==i?.environmentId||t[7]!==c?(l=c?.walkthroughSettings?.writer?(0,X.jsx)(H,{variant:`ghost`,size:`sm`,onClick:()=>void yr.open({payload:{project:c,remote:r.environmentId===i?.environmentId?null:r.environmentId}}),children:`Project walkthrough settings`}):(0,X.jsx)(oe,{to:`/settings/$section`,params:{section:`git`},className:o({variant:`ghost`,size:`sm`}),children:`Settings → Changes & Git`}),t[5]=r,t[6]=i?.environmentId,t[7]=c,t[8]=l):l=t[8],l}function Al(e){let t=(0,Z.c)(46),{document:n,writer:r,action:i,existingMessage:a,signedOut:o,actionFirst:s}=e,c=s!==void 0&&s,l=r.noWriters||!!r.status?.block,u;t[0]!==o||t[1]!==r?(u=Te(r,o),t[0]=o,t[1]=r,t[2]=u):u=t[2];let d=u,f;t[3]!==a||t[4]!==r?(f=xe(r,a),t[3]=a,t[4]=r,t[5]=f):f=t[5];let p=f,m=!r.noWriters&&!r.failed&&!!r.status?.block,h;t[6]!==i||t[7]!==c||t[8]!==l?(h=i&&!l&&(0,X.jsx)(H,{size:`sm`,variant:i.variant??`outline`,className:c?`order-first mr-1`:void 0,disabled:i.disabled,"aria-description":i.description,onClick:i.onClick,children:i.label}),t[6]=i,t[7]=c,t[8]=l,t[9]=h):h=t[9];let g=h;if(d&&!m){let e=r.failed?`alert`:`status`,n;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,X.jsx)(Nn,{"aria-hidden":!0,className:`mt-0.75 size-3.5 shrink-0 text-muted-foreground`}),t[10]=n):n=t[10];let a=p??`Sign in on the connected computer, then check again.`,o;t[11]===a?o=t[12]:(o=(0,X.jsxs)(`p`,{className:`flex min-w-0 flex-1 basis-56 items-start gap-2 text-ui text-foreground-2`,children:[n,(0,X.jsx)(`span`,{className:`min-w-0 text-pretty`,children:a})]}),t[11]=a,t[12]=o);let s=i?.variant==="default"&&l?`default`:`outline`,u;t[13]!==s||t[14]!==r.checking||t[15]!==r.refresh?(u=(0,X.jsx)(pe,{pending:r.checking,variant:s,size:`sm`,onClick:r.refresh,children:`Check again`}),t[13]=s,t[14]=r.checking,t[15]=r.refresh,t[16]=u):u=t[16];let d;t[17]!==u||t[18]!==e||t[19]!==o?(d=(0,X.jsxs)(`div`,{role:e,className:`flex w-full min-w-0 flex-wrap items-center gap-x-3 gap-y-2 rounded-lg border bg-muted px-3 py-2`,children:[o,u]}),t[17]=u,t[18]=e,t[19]=o,t[20]=d):d=t[20];let f=d,m;t[21]!==i||t[22]!==l?(m=i&&!l&&(0,X.jsx)(H,{size:`sm`,variant:i.variant??`outline`,disabled:i.disabled,"aria-description":i.description,onClick:i.onClick,children:i.label}),t[21]=i,t[22]=l,t[23]=m):m=t[23];let h=m,g=c&&h,_=!c&&h,v;return t[24]!==f||t[25]!==g||t[26]!==_?(v=(0,X.jsxs)(`div`,{className:`flex w-full min-w-0 flex-col items-start gap-2`,children:[g,f,_]}),t[24]=f,t[25]=g,t[26]=_,t[27]=v):v=t[27],v}let _;t[28]!==n||t[29]!==r?(_=!r.noWriters&&(0,X.jsx)(Cl,{document:n,writer:r}),t[28]=n,t[29]=r,t[30]=_):_=t[30];let v;t[31]===p?v=t[32]:(v=p&&(0,X.jsx)(`p`,{className:`min-w-0 text-caption text-muted-foreground`,children:p}),t[31]=p,t[32]=v);let y;t[33]!==d||t[34]!==r.checking||t[35]!==r.refresh?(y=d&&(0,X.jsx)(pe,{pending:r.checking,variant:`ghost`,size:`sm`,onClick:r.refresh,children:`Check again`}),t[33]=d,t[34]=r.checking,t[35]=r.refresh,t[36]=y):y=t[36];let b;t[37]!==n||t[38]!==m?(b=m&&(0,X.jsx)(kl,{document:n}),t[37]=n,t[38]=m,t[39]=b):b=t[39];let x;return t[40]!==g||t[41]!==_||t[42]!==v||t[43]!==y||t[44]!==b?(x=(0,X.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-x-1 gap-y-1`,children:[_,v,y,b,g]}),t[40]=g,t[41]=_,t[42]=v,t[43]=y,t[44]=b,t[45]=x):x=t[45],x}function jl(e){let t=(0,Z.c)(17),{document:n,writer:r,waiting:i,onWrite:a}=e,{connection:o}=n.context,{failed:s,noWriters:l,status:u}=r,d=ye(n.context)??u?.block,f=Kr(n.scope,o,n.base===void 0),p=c(K(f.result)),m=n.base??p?.defaultRef,h=c(K(Jn(n.scope,o,n.base).result)),g=Mr(n.scope,o).changes.length,_=Fl({base:m?ln(m):`the default branch`,commits:h?.commits,files:h?.files.length,uncommitted:g}),v=u===void 0&&!s&&!l,y;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,X.jsx)(`h1`,{id:`walkthrough-start`,className:`text-subpage-title font-semibold tracking-tight`,children:`No walkthrough yet.`}),t[0]=y):y=t[0];let b;t[1]===_?b=t[2]:(b=_&&(0,X.jsx)(`p`,{className:`text-prose text-foreground-2`,children:_}),t[1]=_,t[2]=b);let x;t[3]===b?x=t[4]:(x=(0,X.jsxs)(`header`,{className:`flex flex-col gap-1`,children:[y,b]}),t[3]=b,t[4]=x);let S=!!d||v||i,C;t[5]!==a||t[6]!==S||t[7]!==d?(C={label:`Write walkthrough`,variant:`default`,disabled:S,description:d,onClick:a},t[5]=a,t[6]=S,t[7]=d,t[8]=C):C=t[8];let w;t[9]!==n||t[10]!==C||t[11]!==r?(w=(0,X.jsx)(Al,{document:n,writer:r,actionFirst:!0,action:C}),t[9]=n,t[10]=C,t[11]=r,t[12]=w):w=t[12];let T;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(T=(0,X.jsx)(`dl`,{"aria-label":`What the walkthrough adds`,className:`grid grid-cols-[auto_minmax(0,1fr)] gap-x-3 gap-y-1 text-caption`,children:Nl.map(Ml)}),t[13]=T):T=t[13];let E;return t[14]!==x||t[15]!==w?(E=(0,X.jsxs)(`section`,{"aria-labelledby":`walkthrough-start`,className:`flex flex-col gap-4`,children:[x,w,T]}),t[14]=x,t[15]=w,t[16]=E):E=t[16],E}function Ml(e){let[t,n]=e;return(0,X.jsxs)(`div`,{className:`contents`,children:[(0,X.jsx)(`dt`,{className:`text-foreground-2`,children:t}),(0,X.jsx)(`dd`,{className:`text-muted-foreground`,children:n})]},t)}var Nl=[[`Your calls`,`Decisions only you can make, each linked to its step.`],[`Verified`,`Pull request checks and screenshots at the commit it reads.`],[`Steps`,`The change in reading order, every claim beside its lines.`]];function Pl(e,t,n){return e===1?`1 ${t}`:`${e} ${n}`}function Fl({base:e,commits:t,files:n,uncommitted:r}){if(t===void 0||n===void 0)return;let i=[...t>0?[Pl(t,`commit`,`commits`)]:[],...n>0?[Pl(n,`changed file`,`changed files`)]:[],...r>0?[Pl(r,`uncommitted file`,`uncommitted files`)]:[]];if(i.length===0)return;let a=i.pop();return`It reads ${i.length>0?`${i.join(`, `)} and ${a}`:a} since ${e}.`}function Il(e){let t=(0,Z.c)(18),{connection:n}=e.context,r;t[0]!==n||t[1]!==e.scope.projectId?(r=Ke(n,e.scope.projectId),t[0]=n,t[1]=e.scope.projectId,t[2]=r):r=t[2];let a=O(r),o;t[3]===n?o=t[4]:(o=Ne(n),t[3]=n,t[4]=o);let[s,c]=i(o),l;t[5]!==n||t[6]!==e.scope?(l=Ae(n,e.scope),t[5]=n,t[6]=e.scope,t[7]=l):l=t[7];let[u,d]=i(l),f;t[8]!==u||t[9]!==a?(f=Ue(a,u),t[8]=u,t[9]=a,t[10]=f):f=t[10];let p=a.waiting||s.waiting,m;t[11]===c?m=t[12]:(m=()=>c(void 0),t[11]=c,t[12]=m);let h;return t[13]!==d||t[14]!==f||t[15]!==p||t[16]!==m?(h={...f,choose:d,checking:p,refresh:m},t[13]=d,t[14]=f,t[15]=p,t[16]=m,t[17]=h):h=t[17],h}function Ll(e){let t=(0,Z.c)(16),{document:n,run:r,content:i}=e,{projectId:a}=n.scope,o=Lo(n,r),s;t[0]!==i||t[1]!==n.context.connection||t[2]!==n.scope||t[3]!==r.headOid||t[4]!==r.id?(s=vt({connection:n.context.connection,scope:n.scope,runId:r.id,headOid:r.headOid,content:i}),t[0]=i,t[1]=n.context.connection,t[2]=n.scope,t[3]=r.headOid,t[4]=r.id,t[5]=s):s=t[5];let c=O(s),l=o?.detail;if(!o||!l)return null;let u=o.number,d=`Pull request #${u}`,f;t[6]!==n.context||t[7]!==o||t[8]!==u||t[9]!==a||t[10]!==l||t[11]!==c?(f=l.state===`open`?(0,X.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-1 gap-y-1.5`,children:[(0,X.jsx)(Rt,{context:n.context,projectId:a,pull:l,label:`Merge #${u}`,review:c,reason:Ii({status:o.status,baseBranch:l.baseBranch,mergeMethods:l.mergeMethods,review:c}).waitsFor}),(0,X.jsxs)(H,{variant:`link`,size:`sm`,onClick:()=>o.openCheck(void 0),children:[`Open #`,u]})]}):(0,X.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1.5`,children:[(0,X.jsxs)(`p`,{className:`text-ui text-muted-foreground`,children:[`#`,u,` is `,l.state,`.`]}),(0,X.jsx)(un,{context:n.context,projectId:a,number:u})]}),t[6]=n.context,t[7]=o,t[8]=u,t[9]=a,t[10]=l,t[11]=c,t[12]=f):f=t[12];let p;return t[13]!==d||t[14]!==f?(p=(0,X.jsx)(`section`,{"aria-label":d,className:`flex flex-col gap-2 border-t pt-5`,children:f}),t[13]=d,t[14]=f,t[15]=p):p=t[15],p}function Rl(e){let t=(0,Z.c)(23),{document:n,run:r,content:i,pull:a}=e,o;t[0]!==i||t[1]!==n.context.connection||t[2]!==n.scope||t[3]!==r.headOid||t[4]!==r.id?(o=vt({connection:n.context.connection,scope:n.scope,runId:r.id,headOid:r.headOid,content:i}),t[0]=i,t[1]=n.context.connection,t[2]=n.scope,t[3]=r.headOid,t[4]=r.id,t[5]=o):o=t[5];let s=O(o),c,l,u,d,f,p;if(t[6]!==a||t[7]!==s){p=Symbol.for(`react.early_return_sentinel`);bb0:{let e=Ri({pull:a,review:s});if(!e){p=null;break bb0}let{label:t,icon:n,quiet:r,pullState:i}=e;c=i,l=`status`,u=`Merge status`,d=`flex flex-wrap items-center justify-between gap-x-3 gap-y-1.5`,f=t&&(0,X.jsxs)(`p`,{className:j(`flex min-w-0 items-start gap-2 text-ui font-medium text-pretty`,r&&`font-normal text-muted-foreground`),children:[(0,X.jsx)(`span`,{className:`flex h-4.5 shrink-0 items-center`,children:(0,X.jsx)(Bn,{tone:n})}),(0,X.jsx)(`span`,{className:`min-w-0`,children:t})]})}t[6]=a,t[7]=s,t[8]=c,t[9]=l,t[10]=u,t[11]=d,t[12]=f,t[13]=p}else c=t[8],l=t[9],u=t[10],d=t[11],f=t[12],p=t[13];if(p!==Symbol.for(`react.early_return_sentinel`))return p;let m;t[14]!==a||t[15]!==c?(m=a&&(0,X.jsxs)(`button`,{type:`button`,onClick:()=>a.openCheck(void 0),className:`flex h-6 shrink-0 items-center gap-1.5 rounded-md border px-2 text-caption text-foreground-2 hover:bg-muted hover:text-foreground focus-visible:outline-2 focus-visible:outline-ring`,children:[(0,X.jsx)(An,{"aria-hidden":!0,className:`size-3.5`}),(0,X.jsxs)(`span`,{className:`font-medium tabular-nums`,children:[`#`,a.number]}),c&&(0,X.jsx)(`span`,{className:`text-muted-foreground`,children:c}),(0,X.jsx)(`span`,{className:`sr-only`,children:`, open the pull request`})]}),t[14]=a,t[15]=c,t[16]=m):m=t[16];let h;return t[17]!==l||t[18]!==u||t[19]!==d||t[20]!==f||t[21]!==m?(h=(0,X.jsxs)(`div`,{role:l,"aria-label":u,className:d,children:[f,m]}),t[17]=l,t[18]=u,t[19]=d,t[20]=f,t[21]=m,t[22]=h):h=t[22],h}function zl(e){let t=(0,Z.c)(2),{children:n}=e,r;return t[0]===n?r=t[1]:(r=(0,X.jsx)(`div`,{className:`mx-auto flex w-full max-w-192 flex-col gap-10 px-5 py-8 @3xl:px-8 @3xl:py-12`,children:n}),t[0]=n,t[1]=r),r}function Bl(e){let t=(0,Z.c)(13),{run:n,content:r,writer:i,files:a}=e,o,s;if(t[0]!==r||t[1]!==a||t[2]!==n||t[3]!==i?.settings?.models){let e=i?.settings?.models.find(e=>e.provider===n.writer.provider&&e.model===n.writer.model)?.label??n.writer.model;o=`whitespace-pre-line font-mono text-caption text-muted-foreground`,s=ht(n,r,r?e:void 0,a).split(` · `).map(Vl),t[0]=r,t[1]=a,t[2]=n,t[3]=i?.settings?.models,t[4]=o,t[5]=s}else o=t[4],s=t[5];let c;t[6]!==r||t[7]!==n?(c=!r&&ai(n)?`\n${ai(n)}`:``,t[6]=r,t[7]=n,t[8]=c):c=t[8];let l;return t[9]!==o||t[10]!==s||t[11]!==c?(l=(0,X.jsxs)(`p`,{className:o,children:[s,c]}),t[9]=o,t[10]=s,t[11]=c,t[12]=l):l=t[12],l}function Vl(e,t){return(0,X.jsxs)(`span`,{children:[t>0&&` · `,(0,X.jsx)(`span`,{className:`whitespace-nowrap`,children:e})]},e)}function Hl(e){let t=(0,Z.c)(5),{content:n}=e,r;if(t[0]!==n.title){let e;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(e=/\.$/,t[2]=e):e=t[2],r=n.title.replace(e,``),t[0]=n.title,t[1]=r}else r=t[1];let i;return t[3]===r?i=t[4]:(i=(0,X.jsx)(`h1`,{className:`text-subpage-title font-semibold tracking-tight text-balance`,children:(0,X.jsx)($,{text:r})}),t[3]=r,t[4]=i),i}function Ul(e){let t=(0,Z.c)(8),[n,r]=(0,Y.useState)(!1),i;t[0]!==e||t[1]!==n?(i=e(n),t[0]=e,t[1]=n,t[2]=i):i=t[2];let a=i,o;t[3]===a.hidden?o=t[4]:(o=a.hidden>0?(0,X.jsx)(Wl,{hidden:a.hidden,onClick:()=>r(!0)}):null,t[3]=a.hidden,t[4]=o);let s;return t[5]!==a||t[6]!==o?(s={...a,more:o},t[5]=a,t[6]=o,t[7]=s):s=t[7],s}function Wl(e){let t=(0,Z.c)(3),{hidden:n,onClick:r}=e,i;return t[0]!==n||t[1]!==r?(i=(0,X.jsx)(`div`,{className:`-ml-2`,children:(0,X.jsxs)(H,{variant:`link`,size:`sm`,onClick:r,children:[n,` more`]})}),t[0]=n,t[1]=r,t[2]=i):i=t[2],i}function Gl(e){let t=(0,Z.c)(10),{content:n}=e,r;t[0]===n?r=t[1]:(r=e=>qt(n,e),t[0]=n,t[1]=r);let{shown:i,more:a}=Ul(r),o;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,X.jsx)(`h2`,{className:`text-ui font-semibold`,children:`How the system grew`}),t[2]=o):o=t[2];let s;t[3]===i?s=t[4]:(s=i.map(Kl),t[3]=i,t[4]=s);let c;t[5]===s?c=t[6]:(c=(0,X.jsx)(`ul`,{className:`flex flex-col gap-1.5`,children:s}),t[5]=s,t[6]=c);let l;return t[7]!==a||t[8]!==c?(l=(0,X.jsxs)(`section`,{className:`flex flex-col gap-2`,children:[o,c,a]}),t[7]=a,t[8]=c,t[9]=l):l=t[9],l}function Kl(e,t){return(0,X.jsxs)(`li`,{className:`grid grid-cols-[1rem_minmax(0,1fr)] text-prose`,children:[(0,X.jsx)(`span`,{"aria-label":e.change,className:j(`font-mono`,e.change===`added`&&`text-add-fg`,e.change===`removed`&&`text-del-fg`,e.change===`changed`&&`text-muted-foreground`),children:nn(e)}),(0,X.jsxs)(`span`,{className:`wrap-anywhere`,children:[(0,X.jsxs)(`span`,{className:`font-medium`,children:[(0,X.jsx)($,{text:e.what}),`.`]}),` `,(0,X.jsx)(`span`,{className:`text-foreground-2`,children:(0,X.jsx)($,{text:e.note})})]})]},`${t}:${e.what}`)}function ql(e){let t=(0,Z.c)(12),{content:n}=e,r;t[0]===n?r=t[1]:(r=e=>Xt(n,e),t[0]=n,t[1]=r);let{explained:i,unclear:a,more:o}=Ul(r),s;t[2]===a?s=t[3]:(s=a.map(Yl),t[2]=a,t[3]=s);let c;t[4]===i?c=t[5]:(c=i.map(Jl),t[4]=i,t[5]=c);let l;t[6]!==s||t[7]!==c?(l=(0,X.jsxs)(`ul`,{className:`flex flex-col gap-1 py-1 text-ui`,children:[s,c]}),t[6]=s,t[7]=c,t[8]=l):l=t[8];let u;return t[9]!==o||t[10]!==l?(u=(0,X.jsxs)(X.Fragment,{children:[l,o]}),t[9]=o,t[10]=l,t[11]=u):u=t[11],u}function Jl(e,t){return(0,X.jsxs)(`li`,{children:[(0,X.jsx)(`span`,{className:`font-medium`,children:(0,X.jsx)($,{text:e.point})}),` `,(0,X.jsx)(`span`,{className:`text-muted-foreground`,children:(0,X.jsx)($,{text:e.answer})})]},`${t}:${e.point}`)}function Yl(e,t){return(0,X.jsx)(`li`,{children:(0,X.jsx)($,{text:e})},`${t}:${e}`)}function Xl(e){let t=(0,Z.c)(124),{run:n,content:r,freshness:i,props:a,onUpdate:o,writeBlock:s,writer:c,updateFailure:l,progressRun:u,requesting:d,reused:f,code:p}=e,m;t[0]!==a||t[1]!==n?(m={...a,run:n},t[0]=a,t[1]=n,t[2]=m):m=t[2];let h=m,g=Lo(a,n),_;t[3]===r?_=t[4]:(_=Xt(r,!1).total>0?(0,X.jsx)(ql,{content:r}):void 0,t[3]=r,t[4]=_);let v=_,y=p.branch!==void 0,b;t[5]!==p.sections.outside||t[6]!==y?(b=Qn(p.sections.outside,y),t[5]=p.sections.outside,t[6]=y,t[7]=b):b=t[7];let x=b,S=x.length,C;t[8]!==r.stops||t[9]!==h?(C=e=>{let{step:t}=e,n=r.stops[t-1].title;return(0,X.jsx)(as,{owner:h,title:n,stepTitle:zt(n)},n)},t[8]=r.stops,t[9]=h,t[10]=C):C=t[10];let w=C,T;t[11]===h?T=t[12]:(T=e=>{let{step:t,index:n,comparison:r}=e;return(0,X.jsx)(bl,{owner:h,step:t,index:n,comparison:r})},t[11]=h,t[12]=T);let E=T,D;t[13]!==a||t[14]!==l?.failure.message||t[15]!==c?(D=e=>(0,X.jsx)(Al,{document:a,writer:c,action:e,existingMessage:l?.failure.message}),t[13]=a,t[14]=l?.failure.message,t[15]=c,t[16]=D):D=t[16];let O;t[17]!==i||t[18]!==o||t[19]!==u||t[20]!==d||t[21]!==f||t[22]!==D||t[23]!==l||t[24]!==s?(O=(0,X.jsx)(cs,{run:u,requesting:d,reused:f,freshness:i,failure:l,onUpdate:o,writeBlock:s,controls:D}),t[17]=i,t[18]=o,t[19]=u,t[20]=d,t[21]=f,t[22]=D,t[23]=l,t[24]=s,t[25]=O):O=t[25];let k=O,A;t[26]!==p.branch||t[27]!==p.uncommitted?(A=p.branch?{committed:p.branch.files.map(Ql),uncommitted:p.uncommitted}:null,t[26]=p.branch,t[27]=p.uncommitted,t[28]=A):A=t[28];let j;t[29]!==r||t[30]!==n||t[31]!==A||t[32]!==c?(j=(0,X.jsx)(Bl,{run:n,content:r,writer:c,files:A}),t[29]=r,t[30]=n,t[31]=A,t[32]=c,t[33]=j):j=t[33];let M;t[34]===r?M=t[35]:(M=(0,X.jsx)(Hl,{content:r}),t[34]=r,t[35]=M);let N;t[36]!==r||t[37]!==a||t[38]!==g||t[39]!==n?(N=(0,X.jsx)(Rl,{document:a,run:n,content:r,pull:g}),t[36]=r,t[37]=a,t[38]=g,t[39]=n,t[40]=N):N=t[40];let P;t[41]===r.summary?P=t[42]:(P=(0,X.jsx)(`p`,{className:`text-prose text-foreground-2`,children:(0,X.jsx)($,{text:r.summary})}),t[41]=r.summary,t[42]=P);let F;t[43]!==k||t[44]!==j||t[45]!==M||t[46]!==N||t[47]!==P?(F=(0,X.jsxs)(`header`,{className:`flex flex-col gap-3`,children:[j,M,N,P,k]}),t[43]=k,t[44]=j,t[45]=M,t[46]=N,t[47]=P,t[48]=F):F=t[48];let I=F;if(r.outcome===`nothing`){let e;t[49]===a?e=t[50]:(e=(0,X.jsx)(Un,{owner:a}),t[49]=a,t[50]=e);let i;t[51]!==r||t[52]!==v||t[53]!==h||t[54]!==g||t[55]!==n||t[56]!==e?(i=(0,X.jsx)(Ac,{run:n,content:r,owner:h,pull:g,notSaid:v,onJump:hc,comments:e}),t[51]=r,t[52]=v,t[53]=h,t[54]=g,t[55]=n,t[56]=e,t[57]=i):i=t[57];let o;t[58]!==p.branch||t[59]!==p.sections.outside||t[60]!==a?(o=(0,X.jsx)(ol,{document:a,entry:`review:all`,code:p.sections.outside,branch:p.branch,eager:!0,label:`Every changed file`}),t[58]=p.branch,t[59]=p.sections.outside,t[60]=a,t[61]=o):o=t[61];let s;t[62]===Symbol.for(`react.memo_cache_sentinel`)?(s=[],t[62]=s):s=t[62];let c;t[63]===h?c=t[64]:(c=(0,X.jsx)(os,{owner:h,titles:s}),t[63]=h,t[64]=c);let l;t[65]!==r||t[66]!==a||t[67]!==n?(l=(0,X.jsx)(Ll,{document:a,run:n,content:r}),t[65]=r,t[66]=a,t[67]=n,t[68]=l):l=t[68];let u;return t[69]!==I||t[70]!==i||t[71]!==o||t[72]!==c||t[73]!==l?(u=(0,X.jsxs)(zl,{children:[I,i,o,c,l]}),t[69]=I,t[70]=i,t[71]=o,t[72]=c,t[73]=l,t[74]=u):u=t[74],u}let L;t[75]===a?L=t[76]:(L=(0,X.jsx)(Un,{owner:a}),t[75]=a,t[76]=L);let R;t[77]!==p.uncommitted||t[78]!==x?(R={uncommitted:p.uncommitted,uncovered:x},t[77]=p.uncommitted,t[78]=x,t[79]=R):R=t[79];let z;t[80]!==r||t[81]!==v||t[82]!==h||t[83]!==g||t[84]!==n||t[85]!==L||t[86]!==R?(z=(0,X.jsx)(Ac,{run:n,content:r,owner:h,pull:g,notSaid:v,onJump:hc,comments:L,scope:R}),t[80]=r,t[81]=v,t[82]=h,t[83]=g,t[84]=n,t[85]=L,t[86]=R,t[87]=z):z=t[87];let B;t[88]===r?B=t[89]:(B=r.growth.length>0&&(0,X.jsx)(Gl,{content:r}),t[88]=r,t[89]=B);let V;t[90]!==p.branch||t[91]!==p.eager.steps||t[92]!==p.sections.steps||t[93]!==r||t[94]!==w||t[95]!==E||t[96]!==S||t[97]!==a||t[98]!==g||t[99]!==n?(V=(0,X.jsx)(yl,{content:r,run:n,props:a,code:p.sections.steps,branch:p.branch,eager:p.eager.steps,outside:S,conversation:w,decision:E,pull:g,onJump:hc}),t[90]=p.branch,t[91]=p.eager.steps,t[92]=p.sections.steps,t[93]=r,t[94]=w,t[95]=E,t[96]=S,t[97]=a,t[98]=g,t[99]=n,t[100]=V):V=t[100];let H;t[101]===r.stops?H=t[102]:(H=r.stops.map(Zl),t[101]=r.stops,t[102]=H);let ee;t[103]!==h||t[104]!==H?(ee=(0,X.jsx)(os,{owner:h,titles:H}),t[103]=h,t[104]=H,t[105]=ee):ee=t[105];let U;t[106]!==p.branch||t[107]!==p.eager.outside||t[108]!==p.sections.outside||t[109]!==S||t[110]!==a?(U=tu(p.sections.outside,p.branch)&&(0,X.jsxs)(`details`,{"aria-labelledby":`review-not-covered`,className:`flex flex-col gap-2.5 border-t pt-5`,children:[(0,X.jsxs)(`summary`,{id:`review-not-covered`,className:`text-section font-semibold text-pretty`,children:[`Other changed files (`,S,`)`]}),(0,X.jsx)(ol,{document:a,entry:`review:not-covered`,code:p.sections.outside,branch:p.branch,eager:p.eager.outside,label:`Other changed files`})]}),t[106]=p.branch,t[107]=p.eager.outside,t[108]=p.sections.outside,t[109]=S,t[110]=a,t[111]=U):U=t[111];let te;t[112]!==r||t[113]!==a||t[114]!==n?(te=(0,X.jsx)(Ll,{document:a,run:n,content:r}),t[112]=r,t[113]=a,t[114]=n,t[115]=te):te=t[115];let ne;return t[116]!==I||t[117]!==z||t[118]!==B||t[119]!==V||t[120]!==ee||t[121]!==U||t[122]!==te?(ne=(0,X.jsxs)(zl,{children:[I,z,B,V,ee,U,te]}),t[116]=I,t[117]=z,t[118]=B,t[119]=V,t[120]=ee,t[121]=U,t[122]=te,t[123]=ne):ne=t[123],ne}function Zl(e){return e.title}function Ql(e){return e.path}function $l(e){let t=(0,Z.c)(5),{run:n,children:r}=e,i;t[0]===n?i=t[1]:(i=(0,X.jsxs)(`header`,{className:`flex flex-col gap-3`,children:[(0,X.jsx)(Bl,{run:n}),(0,X.jsx)(cs,{run:n,first:!0})]}),t[0]=n,t[1]=i);let a;return t[2]!==r||t[3]!==i?(a=(0,X.jsxs)(zl,{children:[i,r]}),t[2]=r,t[3]=i,t[4]=a):a=t[4],a}function eu(e){let t=(0,Z.c)(21),{run:n,failure:r,waiting:i,onRetry:a,writeBlock:o,document:s,writer:c,children:l}=e,u;t[0]!==s||t[1]!==r.message||t[2]!==c?(u=e=>(0,X.jsx)(Al,{document:s,writer:c,existingMessage:r.message,action:e}),t[0]=s,t[1]=r.message,t[2]=c,t[3]=u):u=t[3];let d=u,f=i||!!o,p,m,h;if(t[4]!==r||t[5]!==a||t[6]!==d||t[7]!==n||t[8]!==f||t[9]!==i||t[10]!==o){let e={label:`Try again`,disabled:f,description:o,onClick:a};p=zl,m=`flex flex-col gap-3`,h=n?(0,X.jsx)(cs,{run:n,requesting:i,first:!0,failure:{failure:r,writer:n.writer},onUpdate:a,writeBlock:o,controls:d}):(0,X.jsxs)(`section`,{"aria-label":`Walkthrough status`,className:`flex flex-wrap items-center justify-between gap-2 rounded-lg border p-4 text-ui`,children:[(0,X.jsx)(ss,{copy:fr(r,n)}),d(e)]}),t[4]=r,t[5]=a,t[6]=d,t[7]=n,t[8]=f,t[9]=i,t[10]=o,t[11]=p,t[12]=m,t[13]=h}else p=t[11],m=t[12],h=t[13];let g;t[14]!==m||t[15]!==h?(g=(0,X.jsx)(`header`,{className:m,children:h}),t[14]=m,t[15]=h,t[16]=g):g=t[16];let _;return t[17]!==p||t[18]!==l||t[19]!==g?(_=(0,X.jsxs)(p,{children:[g,l]}),t[17]=p,t[18]=l,t[19]=g,t[20]=_):_=t[20],_}var tu=(e,t)=>t!==void 0&&e.branch.length>0||e.worktree.length>0;function nu(e,t){let n=(0,Z.c)(14),r=e.interaction.hidden===!0,i=Ar(Mr(e.scope,e.context.connection),r),a=Ar(Jn(e.scope,e.context.connection,e.base).result,r),o,s,l;if(n[0]!==i.changes||n[1]!==t||n[2]!==a){o=c(K(a));let e=Mn({content:t?.outcome===`nothing`?void 0:t,branch:o?.files??[],worktree:i.changes});s=e,l=Ht(e,o!==void 0,25),n[0]=i.changes,n[1]=t,n[2]=a,n[3]=o,n[4]=s,n[5]=l}else o=n[3],s=n[4],l=n[5];let u;n[6]===i.changes?u=n[7]:(u=i.changes.map(ru),n[6]=i.changes,n[7]=u);let d=o!==void 0,f;return n[8]!==o||n[9]!==s||n[10]!==l||n[11]!==u||n[12]!==d?(f={sections:s,eager:l,branch:o,uncommitted:u,settled:d},n[8]=o,n[9]=s,n[10]=l,n[11]=u,n[12]=d,n[13]=f):f=n[13],f}function ru(e){return e.path}function iu(e){let t=(0,Z.c)(24),n=Il(e),r=ye(e.context)??n.status?.block,{result:i,phase:a,read:o,refresh:s}=Do(e.scope,e.context),c=Io(e.scope,e.context,e.base,a&&a.kind!==`unwritten`?a.run:void 0,n.next),l;t[0]!==a||t[1]!==o||t[2]!==c?(l=o?Br(za(o,c.accepted)):a,t[0]=a,t[1]=o,t[2]=c,t[3]=l):l=t[3];let u=l,d=nu(e,u?.kind===`ready`?u.content:void 0),f;t[4]!==d.branch||t[5]!==d.sections.outside||t[6]!==e?(f=(0,X.jsx)(ol,{document:e,entry:`review:all`,code:d.sections.outside,branch:d.branch,eager:!0,label:`Every changed file`}),t[4]=d.branch,t[5]=d.sections.outside,t[6]=e,t[7]=f):f=t[7];let p=f;if(u===void 0){let e;return t[8]!==p||t[9]!==s||t[10]!==i?(e=me(i)?(0,X.jsx)(`div`,{"data-review-scroll":``,className:`@container h-full overflow-auto`,children:(0,X.jsxs)(zl,{children:[(0,X.jsx)(D,{className:`px-0`,description:`The walkthrough could not be read.`,onRetry:s}),p]})}):(0,X.jsx)(at,{label:`Loading walkthrough`}),t[8]=p,t[9]=s,t[10]=i,t[11]=e):e=t[11],e}let m;t[12]!==d||t[13]!==p||t[14]!==u||t[15]!==e||t[16]!==c||t[17]!==r||t[18]!==n?(m=()=>{let t=Dt(u,c.failure);if(t)return(0,X.jsx)(eu,{run:t.run,failure:t.failure,waiting:c.waiting,onRetry:c.start,writeBlock:r,document:e,writer:n,children:p});switch(u.kind){case`unwritten`:return d.settled&&!tu(d.sections.outside,d.branch)?(0,X.jsx)($n,{...e}):(0,X.jsxs)(zl,{children:[(0,X.jsx)(jl,{document:e,writer:n,waiting:c.waiting,onWrite:c.start}),p]});case`writing`:return(0,X.jsx)($l,{run:u.run,children:p});case`failed`:return(0,X.jsx)(eu,{run:u.run,failure:u.failure,waiting:c.waiting,onRetry:c.start,writeBlock:r,document:e,writer:n,children:p});case`ready`:{let t=It(u,c);return(0,X.jsx)(Xl,{run:u.run,content:u.content,freshness:u.freshness,props:e,onUpdate:c.start,writeBlock:r,writer:n,progressRun:u.attempt??u.run,requesting:c.waiting,reused:c.accepted?.state.status===`ready`&&c.accepted.id===u.run.id,updateFailure:t.failure,code:d},u.run.id)}}},t[12]=d,t[13]=p,t[14]=u,t[15]=e,t[16]=c,t[17]=r,t[18]=n,t[19]=m):m=t[19];let h=m,g;t[20]===h?g=t[21]:(g=h(),t[20]=h,t[21]=g);let _;return t[22]===g?_=t[23]:(_=(0,X.jsx)(`div`,{"data-review-scroll":``,className:`@container h-full overflow-auto`,children:g}),t[22]=g,t[23]=_),_}var au={open:{text:`Call`,label:`Your call`,className:`text-warn`},"needs-commit":{text:`Needs commit`,label:`Your call, needs a new commit`,className:`text-warn`},decided:{text:`Decided`,label:`Your call, decided`,className:`text-muted-foreground`}};function ou(e){let t=(0,Z.c)(6),{owner:n,content:r,step:i}=e,{view:a}=qo(n),o=cn(r,i,a?.decisions);if(!o)return null;let s=au[o],c=s.label,l;t[0]===s.className?l=t[1]:(l=j(`shrink-0 text-2xs font-medium`,s.className),t[0]=s.className,t[1]=l);let u;return t[2]!==s.label||t[3]!==s.text||t[4]!==l?(u=(0,X.jsx)(`span`,{role:`img`,"aria-label":c,className:l,children:s.text}),t[2]=s.label,t[3]=s.text,t[4]=l,t[5]=u):u=t[5],u}function su(e,t){let n=(0,Z.c)(8),r;n[0]!==t||n[1]!==e?(r={scope:e,context:t},n[0]=t,n[1]=e,n[2]=r):r=n[2];let{view:i}=Ct(r),a;n[3]===i?a=n[4]:(a=_r(i),n[3]=i,n[4]=a);let o=a,s;return n[5]!==o||n[6]!==i?(s=(e,t)=>{let n=zt(e.title);return t.reduce((e,t)=>e+(o.get(t)??0),0)+mt(i,e=>(e.kind===`step`||e.kind===`node`)&&e.title===n).length},n[5]=o,n[6]=i,n[7]=s):s=n[7],s}function cu(e){let t=(0,Z.c)(23),{path:n,where:r,onOpen:i}=e,a=r===`worktree`?`Uncommitted`:`Committed`,o=r===`worktree`?`Uncommitted`:`Branch`,s=`${n}\n${a}: listed under ${o}, not in this list`,c;t[0]===n?c=t[1]:(c=Pt(n),t[0]=n,t[1]=c);let l=`${c} · ${a}, listed under ${o}`,u;t[2]!==i||t[3]!==n||t[4]!==r?(u=()=>i(r===`worktree`?{kind:`change`,path:n}:{kind:`branch-file`,path:n}),t[2]=i,t[3]=n,t[4]=r,t[5]=u):u=t[5];let d,f;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(d=j(Wn,`text-muted-foreground`),f=(0,X.jsx)(`span`,{className:`w-3.5 shrink-0`}),t[6]=d,t[7]=f):(d=t[6],f=t[7]);let p;t[8]===n?p=t[9]:(p=(0,X.jsx)(Ot,{path:n,className:`size-3.5 shrink-0 opacity-60`}),t[8]=n,t[9]=p);let m;t[10]===n?m=t[11]:(m=Pt(n),t[10]=n,t[11]=m);let h;t[12]===m?h=t[13]:(h=(0,X.jsx)(G,{className:`min-w-0 flex-1`,text:m}),t[12]=m,t[13]=h);let g;t[14]===a?g=t[15]:(g=(0,X.jsx)(`span`,{className:`shrink-0 text-2xs`,children:a}),t[14]=a,t[15]=g);let _;return t[16]!==s||t[17]!==g||t[18]!==l||t[19]!==u||t[20]!==p||t[21]!==h?(_=(0,X.jsxs)(`button`,{type:`button`,title:s,"aria-label":l,onClick:u,className:d,children:[f,p,h,g]}),t[16]=s,t[17]=g,t[18]=l,t[19]=u,t[20]=p,t[21]=h,t[22]=_):_=t[22],_}function lu(e){let t=(0,Z.c)(27),{steps:n,review:r,pathOf:i,activeEntry:a,onOpen:o,row:s,comments:c,elsewhere:l,callMark:u}=e,d=bi(r.context.connection),f;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(f={},t[0]=f):f=t[0];let[p,m]=(0,Y.useState)(f);if(n.length===0)return null;let h;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,X.jsxs)(`p`,{className:`flex px-2 pt-2 pb-1 text-2xs text-muted-foreground`,children:[(0,X.jsx)(`span`,{children:`By step`}),(0,X.jsx)(`span`,{className:`ml-auto`,children:`Reviewed`})]}),t[1]=h):h=t[1];let g;if(t[2]!==a||t[3]!==u||t[4]!==c||t[5]!==l||t[6]!==o||t[7]!==p||t[8]!==i||t[9]!==r||t[10]!==s||t[11]!==d||t[12]!==n){let e;t[14]!==a||t[15]!==u||t[16]!==c||t[17]!==l||t[18]!==o||t[19]!==p||t[20]!==i||t[21]!==r||t[22]!==s||t[23]!==d?(e=e=>{let{stop:t,step:n,files:f}=e,h=c(t,e.paths),g=f.length+e.elsewhere.length,_=p[n]??(f.length>0&&g<=8),v=_?et:J,y=d?f.filter(e=>!gt(i(e))):f,b=d?f.filter(e=>gt(i(e))):[],x={kind:`walkthrough-step`,step:n},S=a===Ln(x);return(0,X.jsxs)(`div`,{role:`group`,"aria-label":`Step ${n}`,className:`flex flex-col`,children:[(0,X.jsxs)(Kn,{...r,label:`Actions for step ${n}`,committed:e.code.branch,dirty:e.code.worktree,children:[(0,X.jsx)(`button`,{type:`button`,className:`shrink-0 p-1`,"aria-label":`${_?`Collapse`:`Expand`} step ${n}`,"aria-expanded":_,onClick:()=>m(e=>({...e,[n]:!_})),children:(0,X.jsx)(v,{className:`size-3`})}),(0,X.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,X.jsxs)(Vr,{plain:!0,label:`Step ${n}`,active:S,onOpen:()=>o(x),children:[(0,X.jsx)(`span`,{className:`w-3.5 shrink-0 text-center font-mono text-2xs text-muted-foreground`,children:n}),(0,X.jsx)(G,{className:`min-w-0 flex-1`,text:zt(t.title)}),t.callouts.length>0&&u(n),h>0&&(0,X.jsxs)(`span`,{"aria-label":h===1?`1 comment`:`${h} comments`,className:`flex shrink-0 items-center gap-0.5 text-2xs text-muted-foreground tabular-nums`,children:[(0,X.jsx)(Ut,{"aria-hidden":!0,className:`size-3`}),h]}),(0,X.jsx)(`span`,{className:`sr-only`,children:g===1?`1 file`:`${g} files`})]})})]}),_&&(0,X.jsxs)(`div`,{className:`pl-3`,children:[y.map(s),b.length>0&&(0,X.jsxs)(`details`,{children:[(0,X.jsxs)(`summary`,{className:`cursor-pointer px-2 py-1 text-caption text-muted-foreground`,children:[`Specs (`,b.length,`)`]}),b.map(s)]}),e.elsewhere.map(e=>(0,X.jsx)(cu,{path:e,where:l,onOpen:o},e))]})]},n)},t[14]=a,t[15]=u,t[16]=c,t[17]=l,t[18]=o,t[19]=p,t[20]=i,t[21]=r,t[22]=s,t[23]=d,t[24]=e):e=t[24],g=n.map(e),t[2]=a,t[3]=u,t[4]=c,t[5]=l,t[6]=o,t[7]=p,t[8]=i,t[9]=r,t[10]=s,t[11]=d,t[12]=n,t[13]=g}else g=t[13];let _;return t[25]===g?_=t[26]:(_=(0,X.jsxs)(`div`,{className:`mt-1 flex flex-col`,children:[h,g]}),t[25]=g,t[26]=_),_}function uu(e,t,n,r,i){return e.stops.flatMap((e,a)=>{let o=t.steps[a];if(o===void 0)return[];let{here:s,elsewhere:c}=En(o,n),l=r.filter(e=>s.includes(i(e)));return[{stop:e,code:o,step:a+1,files:l,elsewhere:c,paths:[...l.map(i),...c]}]})}function du(e){let t=(0,Z.c)(13),{files:n,row:r,context:i}=e,a=bi(i.connection),o,s;if(t[0]!==n||t[1]!==r||t[2]!==a){s=Symbol.for(`react.early_return_sentinel`);bb0:{let e=a?n.filter(pu):[],i;t[5]!==n||t[6]!==a?(i=a?n.filter(fu):n,t[5]=n,t[6]=a,t[7]=i):i=t[7];let c=i;if(!n.length){s=null;break bb0}let l;t[8]===n.length?l=t[9]:(l=(0,X.jsxs)(`summary`,{className:`cursor-pointer px-2 py-1 text-caption`,children:[`Other changed files (`,n.length,`)`]}),t[8]=n.length,t[9]=l);let u;t[10]!==c||t[11]!==r?(u=c.map(r),t[10]=c,t[11]=r,t[12]=u):u=t[12],o=(0,X.jsxs)(`details`,{className:`mt-2`,children:[l,u,e.length>0&&(0,X.jsxs)(`details`,{className:`pl-3`,children:[(0,X.jsxs)(`summary`,{className:`cursor-pointer px-2 py-1 text-caption`,children:[`Specs (`,e.length,`)`]}),e.map(r)]})]})}t[0]=n,t[1]=r,t[2]=a,t[3]=o,t[4]=s}else o=t[3],s=t[4];return s===Symbol.for(`react.early_return_sentinel`)?o:s}function fu(e){return!gt(e.path)}function pu(e){return gt(e.path)}function mu(e){let t=(0,Z.c)(41),{scope:n,context:r,base:i,items:a,row:o,activeEntry:s,onOpen:l}=e,u=Oo(n,r),d=su(n,r),f=Mr(n,r.connection),p=Jn(n,r.connection,i).result,m=c(K(p)),h=Mn({content:u?.content,branch:a,worktree:f.changes}),g=Fc(n,r.connection,i,h.steps.flatMap(_u));if(!u||u.content.stops.length===0){let e;if(t[0]!==a||t[1]!==o){let n;t[3]===o?n=t[4]:(n=e=>o(e),t[3]=o,t[4]=n),e=a.map(n),t[0]=a,t[1]=o,t[2]=e}else e=t[2];let n;return t[5]===e?n=t[6]:(n=(0,X.jsx)(X.Fragment,{children:e}),t[5]=e,t[6]=n),n}let _=uu(u.content,h,`branch`,a,gu),v=new Set(h.outside.branch),y=lu,b=xn(m),x;t[7]===m?.files?x=t[8]:(x=m?.files??[],t[7]=m?.files,t[8]=x);let S;t[9]!==r||t[10]!==n||t[11]!==b||t[12]!==x||t[13]!==f?(S={scope:n,context:r,range:b,branchFiles:x,changes:f},t[9]=r,t[10]=n,t[11]=b,t[12]=x,t[13]=f,t[14]=S):S=t[14];let C;t[15]!==o||t[16]!==g?(C=e=>{let t=g(e.path);return o(e,{tick:!0,trailing:t&&(0,X.jsx)(Yc,{size:t})})},t[15]=o,t[16]=g,t[17]=C):C=t[17];let w;t[18]!==r||t[19]!==u.content||t[20]!==u.run||t[21]!==n?(w=e=>(0,X.jsx)(ou,{owner:{scope:n,context:r,run:u.run},content:u.content,step:e}),t[18]=r,t[19]=u.content,t[20]=u.run,t[21]=n,t[22]=w):w=t[22];let T;t[23]!==y||t[24]!==s||t[25]!==d||t[26]!==l||t[27]!==_||t[28]!==S||t[29]!==C||t[30]!==w?(T=(0,X.jsx)(y,{review:S,pathOf:hu,steps:_,activeEntry:s,onOpen:l,row:C,comments:d,elsewhere:`worktree`,callMark:w}),t[23]=y,t[24]=s,t[25]=d,t[26]=l,t[27]=_,t[28]=S,t[29]=C,t[30]=w,t[31]=T):T=t[31];let E=a.filter(e=>v.has(e.path)),D;t[32]===o?D=t[33]:(D=e=>o(e,{tick:!0}),t[32]=o,t[33]=D);let O;t[34]!==r||t[35]!==E||t[36]!==D?(O=(0,X.jsx)(du,{files:E,row:D,context:r}),t[34]=r,t[35]=E,t[36]=D,t[37]=O):O=t[37];let k;return t[38]!==T||t[39]!==O?(k=(0,X.jsxs)(X.Fragment,{children:[T,O]}),t[38]=T,t[39]=O,t[40]=k):k=t[40],k}function hu(e){return e.path}function gu(e){return e.path}function _u(e){return e.branch}function vu(e){let t=(0,Z.c)(57),{scope:n,context:r,base:i,paths:a,row:o,activeEntry:s,onOpen:l}=e,u=Oo(n,r),d=Jn(n,r.connection,i).result,f=c(K(d)),p=Mr(n,r.connection),m=su(n,r);if(a.length===0){let e=u?`Nothing uncommitted.`:`No changes`,n;return t[0]===e?n=t[1]:(n=(0,X.jsx)(`p`,{className:`p-3 text-sm text-muted-foreground`,children:e}),t[0]=e,t[1]=n),n}let h;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(h=Ln(ir),t[2]=h):h=t[2];let g=s===h,_;t[3]===l?_=t[4]:(_=()=>l(ir),t[3]=l,t[4]=_);let v,y;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,X.jsx)(Dn,{className:`size-3.5 shrink-0 text-muted-foreground`}),y=(0,X.jsx)(`span`,{className:`min-w-0 flex-1`,children:`All changes`}),t[5]=v,t[6]=y):(v=t[5],y=t[6]);let b;t[7]===a.length?b=t[8]:(b=(0,X.jsx)(`span`,{className:`ml-auto text-2xs text-muted-foreground tabular-nums`,children:a.length}),t[7]=a.length,t[8]=b);let x;t[9]!==g||t[10]!==_||t[11]!==b?(x=(0,X.jsxs)(Vr,{plain:!0,label:`All changes`,active:g,onOpen:_,children:[v,y,b]}),t[9]=g,t[10]=_,t[11]=b,t[12]=x):x=t[12];let S=x;if(!u||u.content.stops.length===0){let e;if(t[13]!==a||t[14]!==o){let n;t[16]===o?n=t[17]:(n=e=>o(e),t[16]=o,t[17]=n),e=a.map(n),t[13]=a,t[14]=o,t[15]=e}else e=t[15];let n;return t[18]!==S||t[19]!==e?(n=(0,X.jsxs)(`div`,{className:`flex flex-col`,children:[S,e]}),t[18]=S,t[19]=e,t[20]=n):n=t[20],n}let C;t[21]===a?C=t[22]:(C=e=>a.includes(e.path),t[21]=a,t[22]=C);let w=Mn({content:u.content,branch:f?.files??[],worktree:p.changes.filter(C)}),T=uu(u.content,w,`worktree`,a,xu),E=new Set(w.outside.worktree),D=lu,O=xn(f),k;t[23]===f?.files?k=t[24]:(k=f?.files??[],t[23]=f?.files,t[24]=k);let A;t[25]!==r||t[26]!==n||t[27]!==O||t[28]!==k||t[29]!==p?(A={scope:n,context:r,range:O,branchFiles:k,changes:p},t[25]=r,t[26]=n,t[27]=O,t[28]=k,t[29]=p,t[30]=A):A=t[30];let j;t[31]===o?j=t[32]:(j=e=>o(e,{tick:!0}),t[31]=o,t[32]=j);let M;t[33]!==r||t[34]!==u.content||t[35]!==u.run||t[36]!==n?(M=e=>(0,X.jsx)(ou,{owner:{scope:n,context:r,run:u.run},content:u.content,step:e}),t[33]=r,t[34]=u.content,t[35]=u.run,t[36]=n,t[37]=M):M=t[37];let N;t[38]!==D||t[39]!==s||t[40]!==m||t[41]!==l||t[42]!==T||t[43]!==A||t[44]!==j||t[45]!==M?(N=(0,X.jsx)(D,{review:A,pathOf:bu,steps:T,activeEntry:s,onOpen:l,row:j,comments:m,elsewhere:`branch`,callMark:M}),t[38]=D,t[39]=s,t[40]=m,t[41]=l,t[42]=T,t[43]=A,t[44]=j,t[45]=M,t[46]=N):N=t[46];let P=a.filter(e=>E.has(e)).map(yu),F;t[47]===o?F=t[48]:(F=e=>o(e.path,{tick:!0}),t[47]=o,t[48]=F);let I;t[49]!==r||t[50]!==P||t[51]!==F?(I=(0,X.jsx)(du,{files:P,row:F,context:r}),t[49]=r,t[50]=P,t[51]=F,t[52]=I):I=t[52];let L;return t[53]!==S||t[54]!==N||t[55]!==I?(L=(0,X.jsxs)(`div`,{className:`flex flex-col`,children:[S,N,I]}),t[53]=S,t[54]=N,t[55]=I,t[56]=L):L=t[56],L}function yu(e){return{path:e}}function bu(e){return e}function xu(e){return e}var Su={branch:mu,uncommitted:vu};function Cu(e){let t=(0,Z.c)(2),n;return t[0]===e?n=t[1]:(n=(0,X.jsx)(Or,{...e,grouping:Su}),t[0]=e,t[1]=n),n}function wu(e){let t=(0,Z.c)(9),n;t[0]!==e.projectId||t[1]!==e.worktree.id?(n={projectId:e.projectId,worktreeId:e.worktree.id},t[0]=e.projectId,t[1]=e.worktree.id,t[2]=n):n=t[2];let r;t[3]===e?r=t[4]:(r=(0,X.jsx)(Tu,{...e}),t[3]=e,t[4]=r);let i;return t[5]!==e.context.connection||t[6]!==n||t[7]!==r?(i=(0,X.jsx)(qn,{connection:e.context.connection,scope:n,children:r}),t[5]=e.context.connection,t[6]=n,t[7]=r,t[8]=i):i=t[8],i}function Tu(e){let t=(0,Z.c)(13),n;t[0]!==e.projectId||t[1]!==e.worktree.id?(n={projectId:e.projectId,worktreeId:e.worktree.id},t[0]=e.projectId,t[1]=e.worktree.id,t[2]=n):n=t[2];let r=n,i=jo(r,e.context),a=Ao(r,e.context),o;t[3]!==e.worktree.id||t[4]!==a?(o=Nr({worktreeId:e.worktree.id,title:a}),t[3]=e.worktree.id,t[4]=a,t[5]=o):o=t[5],A(o);let s;t[6]!==i.guided||t[7]!==i.pending?(s={pending:i.pending,guided:i.guided},t[6]=i.guided,t[7]=i.pending,t[8]=s):s=t[8];let c=s,l=i.guided?Cu:Or,u;return t[9]!==c||t[10]!==e||t[11]!==l?(u=(0,X.jsx)(vr,{...e,review:iu,changesNavigation:l,walkthroughCode:al,firstDocument:c}),t[9]=c,t[10]=e,t[11]=l,t[12]=u):u=t[12],u}function Eu(e){let t={projectId:e.projectId,worktreeId:e.worktreeId};return e.remote===null?se({to:`/$projectId/$worktreeId`,params:t}):se({to:`/remotes/$environmentId/$projectId/$worktreeId`,params:{environmentId:e.remote,...t}})}function Du(e,t){let n=(0,Z.c)(2),r=Hr(e,t,Ou),i;return n[0]===r?i=n[1]:(i=()=>r?r():void Gn.open({payload:{remote:null}}),n[0]=r,n[1]=i),i}function Ou(e){return Je({title:`Could not open the project`,description:s(e),type:`error`})}function ku(e){let t=(0,Z.c)(12),{connection:n,empty:r,settingsOpen:i}=e,a=st(),o=Me(),{setOpenMobile:s}=Ir(),c;t[0]!==r||t[1]!==a||t[2]!==s?(c=e=>(s(!1),a({...Eu(e),replace:r})),t[0]=r,t[1]=a,t[2]=s,t[3]=c):c=t[3];let l=c,u=Du(n,l),d;t[4]!==a||t[5]!==u||t[6]!==i?(d=ee(e=>{typeof e==`object`||i||(e===`open-settings`?a({to:`/settings/$section`,params:{section:wr}}):u())}),t[4]=a,t[5]=u,t[6]=i,t[7]=d):d=t[7],A(d);let f;return t[8]!==n||t[9]!==l||t[10]!==o?(f=(0,X.jsx)(Wr,{connection:n,remotes:o,onOpened:l}),t[8]=n,t[9]=l,t[10]=o,t[11]=f):f=t[11],f}function Au(e){let t=(0,Z.c)(7),{icon:n,tone:r}=e,i=(r===void 0?`default`:r)===`destructive`?`bg-destructive/10 text-destructive`:`bg-muted text-foreground`,a;t[0]===i?a=t[1]:(a=j(`grid size-10 shrink-0 place-items-center rounded-xl`,i),t[0]=i,t[1]=a);let o;t[2]===n?o=t[3]:(o=(0,X.jsx)(n,{className:`size-5`}),t[2]=n,t[3]=o);let s;return t[4]!==a||t[5]!==o?(s=(0,X.jsx)(`span`,{"aria-hidden":`true`,className:a,children:o}),t[4]=a,t[5]=o,t[6]=s):s=t[6],s}function ju(e){let t=(0,Z.c)(4),{keys:n}=e,r;t[0]===n?r=t[1]:(r=n.split(`+`).map(Mu),t[0]=n,t[1]=r);let i;return t[2]===r?i=t[3]:(i=(0,X.jsx)(Xn,{children:r}),t[2]=r,t[3]=i),i}function Mu(e){return(0,X.jsx)(dt,{className:`min-w-6 justify-center`,children:Pi(e)},e)}function Nu(e){let t=(0,Z.c)(6),{open:n,onOpenChange:r}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,X.jsx)(Au,{icon:Bt}),t[0]=i):i=t[0];let a;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,X.jsxs)(Yr,{className:`flex-row items-center text-left`,children:[i,(0,X.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[(0,X.jsx)(ri,{children:`Keyboard shortcuts`}),(0,X.jsx)(In,{children:`None of them fire while you are typing.`})]})]}),t[1]=a):a=t[1];let o;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,X.jsxs)(rr,{initialFocus:`[data-dialog-close]`,className:`max-h-[85svh] grid-rows-[auto_minmax(0,1fr)] overflow-hidden sm:max-w-xl`,children:[a,(0,X.jsx)(Tr,{className:`-mr-3 min-h-0`,children:(0,X.jsx)(`div`,{className:`flex flex-col gap-5 pr-3`,children:di.map(Pu)})})]}),t[2]=o):o=t[2];let s;return t[3]!==r||t[4]!==n?(s=(0,X.jsx)(or,{open:n,onOpenChange:r,children:o}),t[3]=r,t[4]=n,t[5]=s):s=t[5],s}function Pu(e){return(0,X.jsxs)(`section`,{"aria-labelledby":`shortcuts-${e.title}`,children:[(0,X.jsx)(`h3`,{id:`shortcuts-${e.title}`,className:`mb-1 text-xs font-medium tracking-wide text-muted-foreground uppercase`,children:e.title}),(0,X.jsx)(`dl`,{className:`divide-y rounded-xl border`,children:e.items.map(Fu)})]},e.title)}function Fu(e){return(0,X.jsxs)(`div`,{className:`flex items-center justify-between gap-4 px-3 py-2`,children:[(0,X.jsx)(`dt`,{className:`text-sm`,children:e.label}),(0,X.jsx)(`dd`,{className:`shrink-0`,children:(0,X.jsx)(ju,{keys:e.keys})})]},e.keys)}var Iu={"not-found":`Page not found`,"missing-worktree":`Worktree not found`,empty:`Select a worktree on the left`};function Lu(e){let t=(0,Z.c)(120),{review:n,remote:r,unavailable:i,connecting:a,remoteStatus:o,showRemoteNotice:s,notice:c,background:l}=e,u=a!==void 0&&a,d=l!==void 0&&l,f=sn(),p=O(te),m=De(te),h;t[0]!==d||t[1]!==p||t[2]!==m?(h=e=>{e&&p&&!d&&(e.focus(),document.activeElement===e&&m(!1))},t[0]=d,t[1]=p,t[2]=m,t[3]=h):h=t[3];let g=h,_;t[4]!==g||t[5]!==f?(_=e=>{f.attach(e),g(e)},t[4]=g,t[5]=f,t[6]=_):_=t[6];let v;t[7]!==_||t[8]!==f.element?(v={element:f.element,attach:_},t[7]=_,t[8]=f.element,t[9]=v):v=t[9];let y=v,[b,x]=(0,Y.useState)(!1),[S,C]=(0,Y.useState)(!1),{setOpenMobile:w,isMobile:T,open:E,openMobile:D}=Ir(),A;t[10]===w?A=t[11]:(A=(e,t)=>{x(!e&&t.reason===`escape-key`),w(e)},t[10]=w,t[11]=A);let j;t[12]!==y||t[13]!==b||t[14]!==g?(j=e=>{!e&&b&&(x(!1),y.element?.focus()),e||g(y.element)},t[12]=y,t[13]=b,t[14]=g,t[15]=j):j=t[15];let M;t[16]!==A||t[17]!==j?(M={onOpenChange:A,onOpenChangeComplete:j},t[16]=A,t[17]=j,t[18]=M):M=t[18];let N=M,P=st(),F=ge(),I;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(I={select:Ru},t[19]=I):I=t[19];let R=Zn(I),z=fe(),B=kr(z.connection),V;t[20]===B?V=t[21]:(V=Ee(B,k(B)?.id),t[20]=B,t[21]=V);let H=V,ee=!c&&B.projects.length===0,U=Iu[c??`empty`];Me();let ne=fe(r?.connection),W;t[22]!==o||t[23]!==ne?(W={...ne,remoteStatus:o},t[22]=o,t[23]=ne,t[24]=W):W=t[24];let re=W,ie=r?.remote.environmentId??null,ae;t[25]!==n||t[26]!==ie?(ae=n&&{remote:ie,projectId:n.selection.projectId,worktreeId:n.selection.worktree.id},t[25]=n,t[26]=ie,t[27]=ae):ae=t[27];let G=ae,oe=n?.selection.worktree.id??``,se;t[28]===oe?se=t[29]:(se=tr(oe),t[28]=oe,t[29]=se);let ce=O(se),le;t[30]!==ce||t[31]!==r||t[32]!==n?(le=n?ii({firstDocument:ce,entry:n.search.entry,surface:n.search.surface,project:n.inventory.projects.find(e=>e.id===n.selection.projectId)?.name,environment:r||n.inventory.environment.custom?n.inventory.environment.name:void 0}):`Porcelain`,t[30]=ce,t[31]=r,t[32]=n,t[33]=le):le=t[33],cr(d?void 0:le);let ue;t[34]!==P||t[35]!==n||t[36]!==w?(ue=e=>(w(!1),P({...Eu(e),replace:n===void 0})),t[34]=P,t[35]=n,t[36]=w,t[37]=ue):ue=t[37];let K=ue,q=Du(z.connection,K),J;t[38]!==T||t[39]!==D||t[40]!==w?(J=()=>{let e=T&&D;return w(!1),{settingsFromNavigator:e}},t[38]=T,t[39]=D,t[40]=w,t[41]=J):J=t[41];let de=J,pe;t[42]!==de||t[43]!==P?(pe=e=>{P({to:`/settings/$section`,params:{section:e===void 0?wr:e},state:de()})},t[42]=de,t[43]=P,t[44]=pe):pe=t[44];let me=pe,he;t[45]!==z.connection||t[46]!==P||t[47]!==n?.search||t[48]!==w||t[49]!==G?(he=e=>{if(e.pullRequest.state!==`available`||!e.pullRequest.number)return;w(!1);let t=G??(e.worktreeId?{remote:e.environmentId===z.connection.environmentId?null:e.environmentId,projectId:e.projectId,worktreeId:e.worktreeId}:void 0);if(!t)return;let r=Ln(Xr({projectId:e.projectId,number:e.pullRequest.number,environmentId:e.environmentId,shownOn:t.remote??z.connection.environmentId}));P({...Eu(t),search:{...n?.search??{},entry:r}})},t[45]=z.connection,t[46]=P,t[47]=n?.search,t[48]=w,t[49]=G,t[50]=he):he=t[50];let _e;t[51]===q?_e=t[52]:(_e=e=>e?void Gn.open({payload:{remote:e.remote.environmentId}}):q(),t[51]=q,t[52]=_e);let ve,ye;t[53]===me?(ve=t[54],ye=t[55]):(ve=()=>me(),ye=()=>me(`computers`),t[53]=me,t[54]=ve,t[55]=ye);let be;t[56]!==de||t[57]!==P?(be=e=>{P({to:`/settings/$section/$environmentId`,params:{section:`computers`,environmentId:e},state:de()})},t[56]=de,t[57]=P,t[58]=be):be=t[58];let xe;t[59]===Symbol.for(`react.memo_cache_sentinel`)?(xe=()=>C(!0),t[59]=xe):xe=t[59];let Se;t[60]!==s||t[61]!==G||t[62]!==void 0||t[63]!==he||t[64]!==_e||t[65]!==ve||t[66]!==ye||t[67]!==be?(Se={remotes:void 0,selected:G,showRemoteNotice:s,onOpenPullRequest:he,onOpenProject:_e,onOpenSettings:ve,onManageComputers:ye,onOpenRemotes:be,onOpenShortcuts:xe},t[60]=s,t[61]=G,t[62]=void 0,t[63]=he,t[64]=_e,t[65]=ve,t[66]=ye,t[67]=be,t[68]=Se):Se=t[68];let Ce=Se,we;t[69]!==R||t[70]!==P||t[71]!==F||t[72]!==G?(we=(e,t)=>{if(!G)return;let n=Eu(G);if(F.buildLocation({}).pathname!==F.buildLocation(n).pathname)return;let r=t?.implicitReview===!0||R&&!(`entry`in e);P({...n,search:t=>({...t,...e}),replace:t?.replace??!1,state:r?{implicitReview:!0}:{}})},t[69]=R,t[70]=P,t[71]=F,t[72]=G,t[73]=we):we=t[73];let Te=we,Oe;t[74]===me?Oe=t[75]:(Oe=()=>me(),t[74]=me,t[75]=Oe);let ke;t[76]===Symbol.for(`react.memo_cache_sentinel`)?(ke={ignoreInputs:!0},t[76]=ke):ke=t[76],vi(ui.openSettings,Oe,ke);let Ae,je;t[77]===Symbol.for(`react.memo_cache_sentinel`)?(Ae=()=>C(!0),je={ignoreInputs:!0},t[77]=Ae,t[78]=je):(Ae=t[77],je=t[78]),vi(ui.openShortcuts,Ae,je);let Ne;t[79]!==T||t[80]!==N||t[81]!==Ce||t[82]!==K?(Ne=T&&(0,X.jsx)(Mt,{variant:`floating`,...N,children:(0,X.jsx)(Tn,{...Ce,onSelect:e=>void K(e)})}),t[79]=T,t[80]=N,t[81]=Ce,t[82]=K,t[83]=Ne):Ne=t[83];let Pe;t[84]===K?Pe=t[85]:(Pe=e=>void K(e),t[84]=K,t[85]=Pe);let Fe;t[86]!==Ce||t[87]!==Pe?(Fe={...Ce,onSelect:Pe},t[86]=Ce,t[87]=Pe,t[88]=Fe):Fe=t[88];let Ie;t[89]!==u||t[90]!==re||t[91]!==ee||t[92]!==R||t[93]!==T||t[94]!==U||t[95]!==y||t[96]!==Ce||t[97]!==c||t[98]!==Te||t[99]!==E||t[100]!==q||t[101]!==D||t[102]!==H||t[103]!==r||t[104]!==n||t[105]!==w||t[106]!==ie||t[107]!==i?(Ie=n?(0,X.jsx)(wu,{navigationTrigger:y,worktree:n.selection.worktree,projectId:n.selection.projectId,search:R&&n.search.entry===void 0?{...n.search,entry:sr}:n.search,onSearch:Te,context:re},`${ie??``}:${n.selection.worktree.id}`):(0,X.jsx)(zu,{navigationTrigger:y,isMobile:T,open:E,openMobile:D,children:(0,X.jsx)(Bu,{remote:r,connecting:u,unavailable:i,firstRun:ee,onOpenRemotes:Ce.onOpenRemotes,onOpenProject:()=>{w(!1),q()},notice:(0,X.jsx)(L,{message:U,action:(0,X.jsx)(Vu,{notice:c,recovery:H})})})}),t[89]=u,t[90]=re,t[91]=ee,t[92]=R,t[93]=T,t[94]=U,t[95]=y,t[96]=Ce,t[97]=c,t[98]=Te,t[99]=E,t[100]=q,t[101]=D,t[102]=H,t[103]=r,t[104]=n,t[105]=w,t[106]=ie,t[107]=i,t[108]=Ie):Ie=t[108];let Le;t[109]!==T||t[110]!==E||t[111]!==Fe||t[112]!==Ie?(Le=(0,X.jsx)(_t,{navigator:Fe,isMobile:T,open:E,children:Ie}),t[109]=T,t[110]=E,t[111]=Fe,t[112]=Ie,t[113]=Le):Le=t[113];let Re;t[114]===S?Re=t[115]:(Re=(0,X.jsx)(Nu,{open:S,onOpenChange:C}),t[114]=S,t[115]=Re);let ze;return t[116]!==Ne||t[117]!==Le||t[118]!==Re?(ze=(0,X.jsxs)(X.Fragment,{children:[Ne,Le,Re]}),t[116]=Ne,t[117]=Le,t[118]=Re,t[119]=ze):ze=t[119],ze}function Ru(e){return e.state.implicitReview===!0}function zu(e){let t=(0,Z.c)(12),{navigationTrigger:n,isMobile:r,open:i,openMobile:a,children:o}=e,s;t[0]===n?s=t[1]:(s=e=>n.attach(e),t[0]=n,t[1]=s);let c=r?a:i,l;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(l=Ai(wi(ui.toggleNavigator,ie())),t[2]=l):l=t[2];let u;t[3]!==s||t[4]!==c?(u=(0,X.jsx)(x,{render:(0,X.jsx)(Wt,{ref:s,className:`absolute top-3 left-3`,"aria-label":`Toggle Sidebar`,"aria-expanded":c,"aria-keyshortcuts":l})}),t[3]=s,t[4]=c,t[5]=u):u=t[5];let d;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,X.jsxs)(He,{side:`right`,children:[`Toggle sidebar`,(0,X.jsx)(dt,{children:Pi(ui.toggleNavigator)})]}),t[6]=d):d=t[6];let f;t[7]===u?f=t[8]:(f=(0,X.jsxs)(C,{children:[u,d]}),t[7]=u,t[8]=f);let p;return t[9]!==o||t[10]!==f?(p=(0,X.jsxs)(`div`,{className:`relative grid h-full min-h-0 place-items-center rounded-paper border bg-card p-8 max-md:rounded-none max-md:border-0 [&>[data-slot=state-notice]]:justify-center [&>[data-slot=state-notice]]:text-center`,children:[f,o]}),t[9]=o,t[10]=f,t[11]=p):p=t[11],p}function Bu(e){let t=(0,Z.c)(14),{remote:n,connecting:r,unavailable:i,firstRun:a,onOpenRemotes:o,onOpenProject:s,notice:c}=e;if(n&&r){let e=`Connecting to ${n.remote.name}`,r;return t[0]===e?r=t[1]:(r=(0,X.jsx)(at,{label:e}),t[0]=e,t[1]=r),r}if(n&&i){let e;t[2]===n.connection.liveUpdates?e=t[3]:(e=()=>n.connection.liveUpdates.retry(),t[2]=n.connection.liveUpdates,t[3]=e);let r;t[4]!==o||t[5]!==n.remote.environmentId?(r=()=>o(n.remote.environmentId),t[4]=o,t[5]=n.remote.environmentId,t[6]=r):r=t[6];let a;return t[7]!==n.remote.name||t[8]!==e||t[9]!==r||t[10]!==i?(a=(0,X.jsx)(ke,{name:n.remote.name,status:i,onRetry:e,onOpenRemotes:r}),t[7]=n.remote.name,t[8]=e,t[9]=r,t[10]=i,t[11]=a):a=t[11],a}if(a){let e;return t[12]===s?e=t[13]:(e=(0,X.jsx)(H,{size:`sm`,onClick:s,children:`Open project`}),t[12]=s,t[13]=e),e}return c}function Vu(e){let t=(0,Z.c)(11),{notice:n,recovery:r}=e;if(n===`missing-worktree`&&r){let e;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=j(o({size:`sm`})),t[0]=e):e=t[0];let n;t[1]!==r.projectId||t[2]!==r.worktree.id?(n={projectId:r.projectId,worktreeId:r.worktree.id},t[1]=r.projectId,t[2]=r.worktree.id,t[3]=n):n=t[3];let i;return t[4]!==e||t[5]!==n?(i=(0,X.jsx)(oe,{className:e,to:`/$projectId/$worktreeId`,params:n,children:`Open available worktree`}),t[4]=e,t[5]=n,t[6]=i):i=t[6],i}if(n){let e;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(e=j(o({variant:`outline`,size:`sm`})),t[7]=e):e=t[7];let n;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(n={},t[8]=n):n=t[8];let r;return t[9]===e?r=t[10]:(r=(0,X.jsx)(oe,{className:e,to:`/`,search:n,children:`Back to workspace`}),t[9]=e,t[10]=r),r}return null}function Hu(e){let t=(0,Z.c)(19),{projectId:n,worktreeId:r,search:i,remote:a,settled:o,remoteStatus:s,showRemoteNotice:c,background:l}=e,{connection:u}=fe(a?.connection),d=kr(u),f;t[0]!==d||t[1]!==r?(f=Ee(d,r),t[0]=d,t[1]=r,t[2]=f):f=t[2];let p=f;if(p?.projectId!==n){if(!o){let e;return t[3]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,X.jsx)(Rn,{}),t[3]=e):e=t[3],e}let e;return t[4]!==i||t[5]!==r?(e=(0,X.jsx)(ct,{to:`/`,search:{...i,worktree:r},replace:!0}),t[4]=i,t[5]=r,t[6]=e):e=t[6],e}let m;t[7]!==d||t[8]!==i||t[9]!==p?(m={selection:p,search:i,inventory:d},t[7]=d,t[8]=i,t[9]=p,t[10]=m):m=t[10];let h;t[11]===a?h=t[12]:(h=a?{remote:a}:{},t[11]=a,t[12]=h);let g;return t[13]!==l||t[14]!==s||t[15]!==c||t[16]!==m||t[17]!==h?(g=(0,X.jsx)(Wu,{review:m,...h,remoteStatus:s,showRemoteNotice:c,background:l}),t[13]=l,t[14]=s,t[15]=c,t[16]=m,t[17]=h,t[18]=g):g=t[18],g}var Uu=h(void 0);function Wu(e){let t=(0,Z.c)(4),n;t[0]===e.remote?n=t[1]:(n=e.remote?Pe(e.remote.remote.environmentId):Uu,t[0]=e.remote,t[1]=n),A(n);let r;return t[2]===e?r=t[3]:(r=(0,X.jsx)(Lu,{...e}),t[2]=e,t[3]=r),r}var Gu={kind:`home`,pathname:`/`,search:{}};function Ku(e){if(!e)return Gu;let{pathname:t}=e;switch(e.routeId){case`/_paired/`:return{kind:`home`,pathname:t,search:e.search};case`/_paired/$projectId/$worktreeId`:return{kind:`worktree`,pathname:t,projectId:e.params.projectId,worktreeId:e.params.worktreeId,search:e.search};case`/_paired/remotes/$environmentId/$projectId/$worktreeId`:return{kind:`remote`,pathname:t,environmentId:e.params.environmentId,projectId:e.params.projectId,worktreeId:e.params.worktreeId,search:e.search};case`/_paired/settings/$section/`:case`/_paired/settings/$section/$environmentId`:return Lr(e.params.section,`environmentId`in e.params?e.params.environmentId:void 0)?{kind:`settings`}:{kind:`not-found`,pathname:t};default:return{kind:`not-found`,pathname:t}}}function qu(e){let t=(0,Z.c)(9),n;t[0]===e?n=t[1]:(n=JSON.stringify(e),t[0]=e,t[1]=n);let r=n,i;t[2]!==e||t[3]!==r?(i=()=>({key:r,view:e.kind===`settings`?Gu:e}),t[2]=e,t[3]=r,t[4]=i):i=t[4];let[a,o]=(0,Y.useState)(i);e.kind!==`settings`&&a.key!==r&&o({key:r,view:e});let s;return t[5]!==a||t[6]!==e||t[7]!==r?(s=e.kind===`settings`?{workspace:a.view,workspaceKey:a.key,settingsOpen:!0}:{workspace:e,workspaceKey:r,settingsOpen:!1},t[5]=a,t[6]=e,t[7]=r,t[8]=s):s=t[8],s}function Ju(e){let t=(0,Z.c)(18),{view:n,settled:r,background:i,resetKey:a}=e,o=fi(),s=!i,c;t[0]!==o.hotkey||t[1]!==s?(c={...o.hotkey,enabled:s},t[0]=o.hotkey,t[1]=s,t[2]=c):c=t[2];let l;t[3]!==o||t[4]!==c?(l={...o,hotkey:c},t[3]=o,t[4]=c,t[5]=l):l=t[5];let u;t[6]===a?u=t[7]:(u=()=>a,t[6]=a,t[7]=u);let d;t[8]!==i||t[9]!==r||t[10]!==n?(d=(0,X.jsx)(Yu,{view:n,settled:r,background:i}),t[8]=i,t[9]=r,t[10]=n,t[11]=d):d=t[11];let f;t[12]!==u||t[13]!==d?(f=(0,X.jsx)(ur,{getResetKey:u,errorComponent:Ui,children:d}),t[12]=u,t[13]=d,t[14]=f):f=t[14];let p;return t[15]!==l||t[16]!==f?(p=(0,X.jsx)(xi,{defaultOptions:l,children:f}),t[15]=l,t[16]=f,t[17]=p):p=t[17],p}function Yu(e){let t=(0,Z.c)(19),{view:n,settled:r,background:i}=e;switch(n.kind){case`home`:{let e;return t[0]!==i||t[1]!==r||t[2]!==n.search?(e=(0,X.jsx)(Xu,{search:n.search,settled:r,background:i}),t[0]=i,t[1]=r,t[2]=n.search,t[3]=e):e=t[3],e}case`worktree`:{let e;return t[4]!==i||t[5]!==r||t[6]!==n.projectId||t[7]!==n.search||t[8]!==n.worktreeId?(e=(0,X.jsx)(Hu,{projectId:n.projectId,worktreeId:n.worktreeId,search:n.search,settled:r,background:i}),t[4]=i,t[5]=r,t[6]=n.projectId,t[7]=n.search,t[8]=n.worktreeId,t[9]=e):e=t[9],e}case`remote`:{let e;return t[10]!==i||t[11]!==r||t[12]!==n.environmentId||t[13]!==n.projectId||t[14]!==n.search||t[15]!==n.worktreeId?(e=(0,X.jsx)(Zu,{environmentId:n.environmentId,projectId:n.projectId,worktreeId:n.worktreeId,search:n.search,settled:r,background:i},n.environmentId),t[10]=i,t[11]=r,t[12]=n.environmentId,t[13]=n.projectId,t[14]=n.search,t[15]=n.worktreeId,t[16]=e):e=t[16],e}case`not-found`:{let e;return t[17]===i?e=t[18]:(e=(0,X.jsx)(Lu,{notice:`not-found`,background:i}),t[17]=i,t[18]=e),e}}}function Xu(e){let t=(0,Z.c)(18),{search:n,settled:r,background:i}=e,a,o;t[0]===n?(a=t[1],o=t[2]):({worktree:o,...a}=n,t[0]=n,t[1]=a,t[2]=o);let{connection:s}=fe(),c=kr(s),l;t[3]!==c||t[4]!==o?(l=o===void 0?Ee(c,k(c)?.id):Ee(c,o),t[3]=c,t[4]=o,t[5]=l):l=t[5];let u=l;if(u&&r){let e;t[6]!==u.projectId||t[7]!==u.worktree.id?(e={projectId:u.projectId,worktreeId:u.worktree.id},t[6]=u.projectId,t[7]=u.worktree.id,t[8]=e):e=t[8];let n;t[9]!==a||t[10]!==o?(n=o===void 0?{}:a,t[9]=a,t[10]=o,t[11]=n):n=t[11];let r;return t[12]!==e||t[13]!==n?(r=(0,X.jsx)(ct,{to:`/$projectId/$worktreeId`,params:e,search:n,replace:!0}),t[12]=e,t[13]=n,t[14]=r):r=t[14],r}let d=o!==void 0&&r?`missing-worktree`:void 0,f;return t[15]!==i||t[16]!==d?(f=(0,X.jsx)(Lu,{notice:d,background:i}),t[15]=i,t[16]=d,t[17]=f):f=t[17],f}function Zu(e){let t=(0,Z.c)(7);Re(e.environmentId);{if(!e.settled){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,X.jsx)(Rn,{}),t[0]=e):e=t[0],e}let n;return t[1]!==e.search||t[2]!==e.worktreeId?(n=(0,X.jsx)(ct,{to:`/`,search:{...e.search,worktree:e.worktreeId},replace:!0}),t[1]=e.search,t[2]=e.worktreeId,t[3]=n):n=t[3],n}}function Qu(){let e=(0,Z.c)(11),t=_e(),n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={select:ed},e[0]=n):n=e[0];let{workspace:r,workspaceKey:i,settingsOpen:a}=qu(Er(n)),o;e[1]===r?o=e[2]:(o={select:e=>e.status===`idle`&&e.location.pathname===r.pathname},e[1]=r,e[2]=o);let s=Wi(o),c;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(c={select:$u},e[3]=c):c=e[3];let l=Wi(c),u;return e[4]!==t||e[5]!==l||e[6]!==a||e[7]!==s||e[8]!==r||e[9]!==i?(u=t?(0,X.jsxs)(wo,{children:[(0,X.jsx)(Ju,{view:r,settled:s,background:a,resetKey:i}),(0,X.jsx)(zr,{}),(0,X.jsx)(ku,{connection:t,empty:l,settingsOpen:a})]}):(0,X.jsx)(ct,{to:`/pair`,replace:!0}),e[4]=t,e[5]=l,e[6]=a,e[7]=s,e[8]=r,e[9]=i,e[10]=u):u=e[10],u}function $u(e){return e.location.pathname===`/`}function ed(e){return Ku(e.at(-1))}export{Qu as component};
|