@fabiofiorita/porcelain 0.82.2 → 0.82.3

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.
Files changed (39) hide show
  1. package/README.md +1 -1
  2. package/package.json +1 -1
  3. package/server/src/cli/main.mjs +145 -71
  4. package/web/dist/assets/_-CjuX8204.js +1 -0
  5. package/web/dist/assets/_paired-CsufHhzG.js +1 -0
  6. package/web/dist/assets/{_paired-CqcR1ikJ.js → _paired-DGwd1y4R.js} +1 -1
  7. package/web/dist/assets/_paired-Uw-2dNDo.js +1 -0
  8. package/web/dist/assets/{_paired--LzhIV8q.js → _paired-dxbWzSKv.js} +1 -1
  9. package/web/dist/assets/{_section-C3rzCQs1.js → _section-BVyF13W-.js} +1 -1
  10. package/web/dist/assets/_worktreeId-CHJpLdGv.js +1 -0
  11. package/web/dist/assets/_worktreeId-CsufHhzG.js +1 -0
  12. package/web/dist/assets/_worktreeId-Uw-2dNDo.js +1 -0
  13. package/web/dist/assets/{_worktreeId-BDJbQ5Cn.js → _worktreeId-jnE7LHzn.js} +1 -1
  14. package/web/dist/assets/{access-WT1uwdZk.js → access-Be5-I3uN.js} +1 -1
  15. package/web/dist/assets/connected-workspace-bG1owcgt.js +1 -0
  16. package/web/dist/assets/{desktop-actions-WJQHB849.js → desktop-actions-BF1FmtLQ.js} +22 -22
  17. package/web/dist/assets/{edit-file-CG3WhqLS.js → edit-file-C2FNFMOI.js} +1 -1
  18. package/web/dist/assets/{file-editor-DGtg0rP2.js → file-editor-oLgfLZbs.js} +1 -1
  19. package/web/dist/assets/index-HBCxqMtr.css +2 -0
  20. package/web/dist/assets/{index-Bk8Ig0Ne.js → index-jwdWY-Oe.js} +3 -3
  21. package/web/dist/assets/{lazyRouteComponent-DpO3HGey.js → lazyRouteComponent-jhdvs2sU.js} +1 -1
  22. package/web/dist/assets/{pair-CqLMCfsc.js → pair-FC2KSEZT.js} +1 -1
  23. package/web/dist/assets/pair-Uw-2dNDo.js +1 -0
  24. package/web/dist/assets/{settings-page-RYnO3e6i.js → settings-page-_25QMUsD.js} +108 -108
  25. package/web/dist/assets/{useMatch-Dht53RCg.js → useMatch-BNfVF2UU.js} +1 -1
  26. package/web/dist/assets/useRouterState-GOqQRnzK.js +1 -0
  27. package/web/dist/assets/{workspace-error-CIsCnenX.js → workspace-error-BtARcbMJ.js} +1 -1
  28. package/web/dist/assets/{workspace-pending-oH5nDvO6.js → workspace-pending-CF3GKXTj.js} +1 -1
  29. package/web/dist/index.html +8 -8
  30. package/web/dist/assets/_-b1prKmSp.js +0 -1
  31. package/web/dist/assets/_paired-B07BAuB3.js +0 -1
  32. package/web/dist/assets/_paired-D-U8zru5.js +0 -1
  33. package/web/dist/assets/_worktreeId-B07BAuB3.js +0 -1
  34. package/web/dist/assets/_worktreeId-D-U8zru5.js +0 -1
  35. package/web/dist/assets/_worktreeId-D1NaqSVx.js +0 -1
  36. package/web/dist/assets/connected-workspace-DcS6e5zB.js +0 -1
  37. package/web/dist/assets/index-BoONRxa4.css +0 -2
  38. package/web/dist/assets/pair-D-U8zru5.js +0 -1
  39. package/web/dist/assets/useRouterState-DCsGUMtp.js +0 -1
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{Ms as t,Qo as n,Xo as r,gs as i,ks as a}from"./access-WT1uwdZk.js";var o=e(t(),1),s=o.createContext(void 0),c=o.createContext(void 0),l={};function u(e,t){let n=o.useRef();return r=>{let i=e?.select?e.select(r):r;return e?.structuralSharing??t.options.defaultStructuralSharing?n.current=a(n.current,i):i}}function d(e){let t=n(),a=o.useContext(e.from?c:s),d=e.from??a,f=t.stores.getMatchStore(d),p=u(e,t),m=r(f,e=>e?p(e):l);if(m!==l)return m;(e.shouldThrow??!0)&&i()}export{u as n,s as r,d as t};
1
+ import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{Ms as t,Qo as n,Xo as r,gs as i,ks as a}from"./access-Be5-I3uN.js";var o=e(t(),1),s=o.createContext(void 0),c=o.createContext(void 0),l={};function u(e,t){let n=o.useRef();return r=>{let i=e?.select?e.select(r):r;return e?.structuralSharing??t.options.defaultStructuralSharing?n.current=a(n.current,i):i}}function d(e){let t=n(),a=o.useContext(e.from?c:s),d=e.from??a,f=t.stores.getMatchStore(d),p=u(e,t),m=r(f,e=>e?p(e):l);if(m!==l)return m;(e.shouldThrow??!0)&&i()}export{u as n,s as r,d as t};
@@ -0,0 +1 @@
1
+ import{Qo as e,Xo as t}from"./access-Be5-I3uN.js";import{n}from"./useMatch-BNfVF2UU.js";function r(r){let i=e({warn:r?.router===void 0}),a=r?.router||i;return t(a.stores.__store,n(r,a))}export{r as t};
@@ -1 +1 @@
1
- import{Qo as e,R as t,Wo as n,sa as r,ts as i}from"./access-WT1uwdZk.js";var a=n(),o=i();function s(n){let i=(0,a.c)(5),{reset:s}=n,c=e(),l;i[0]!==s||i[1]!==c?(l=()=>{s(),c.invalidate()},i[0]=s,i[1]=c,i[2]=l):l=i[2];let u=l;r(u);let d;return i[3]===u?d=i[4]:(d=(0,o.jsx)(t,{title:`Could not display the workspace`,description:`Porcelain will retry when the connection returns or this window becomes active again.`,onRetry:u}),i[3]=u,i[4]=d),d}export{s as t};
1
+ import{Qo as e,R as t,Wo as n,sa as r,ts as i}from"./access-Be5-I3uN.js";var a=n(),o=i();function s(n){let i=(0,a.c)(5),{reset:s}=n,c=e(),l;i[0]!==s||i[1]!==c?(l=()=>{s(),c.invalidate()},i[0]=s,i[1]=c,i[2]=l):l=i[2];let u=l;r(u);let d;return i[3]===u?d=i[4]:(d=(0,o.jsx)(t,{title:`Could not display the workspace`,description:`Porcelain will retry when the connection returns or this window becomes active again.`,onRetry:u}),i[3]=u,i[4]=d),d}export{s as t};
@@ -1 +1 @@
1
- import{B as e,V as t,Wo as n,bn as r,ts as i}from"./access-WT1uwdZk.js";var a=n(),o=i();function s(){let n=(0,a.c)(3),i;n[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,o.jsxs)(`div`,{className:`hidden w-66 shrink-0 flex-col gap-6 rounded-xl bg-sidebar p-4 md:flex`,children:[(0,o.jsx)(`span`,{className:`font-medium`,children:`Porcelain`}),[`first`,`second`,`third`].map(c)]}),n[0]=i):i=n[0];let s;n[1]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,o.jsx)(`div`,{className:`flex h-12 items-center border-b px-4`,children:(0,o.jsx)(t,{className:`h-7 w-16`})}),n[1]=s):s=n[1];let l;return n[2]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,o.jsxs)(`div`,{role:`status`,"aria-label":`Loading environment`,className:`flex min-h-svh w-full gap-2 bg-muted p-2`,children:[i,(0,o.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col rounded-paper border bg-background`,children:[s,(0,o.jsxs)(`p`,{className:`flex items-center gap-2 px-6 pt-4 text-ui text-muted-foreground`,children:[(0,o.jsx)(r,{className:`size-3.5`}),` Loading environment…`]}),(0,o.jsx)(e,{label:`Loading workspace`,caption:!1})]})]}),n[2]=l):l=n[2],l}function c(e){return(0,o.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,o.jsx)(t,{className:`h-5 w-32`}),(0,o.jsx)(t,{className:`ml-4 h-4 w-4/5`}),(0,o.jsx)(t,{className:`ml-4 h-4 w-2/3`})]},e)}export{s as t};
1
+ import{B as e,V as t,Wo as n,bn as r,ts as i}from"./access-Be5-I3uN.js";var a=n(),o=i();function s(){let n=(0,a.c)(3),i;n[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,o.jsxs)(`div`,{className:`hidden w-66 shrink-0 flex-col gap-6 rounded-xl bg-sidebar p-4 md:flex`,children:[(0,o.jsx)(`span`,{className:`font-medium`,children:`Porcelain`}),[`first`,`second`,`third`].map(c)]}),n[0]=i):i=n[0];let s;n[1]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,o.jsx)(`div`,{className:`flex h-12 items-center border-b px-4`,children:(0,o.jsx)(t,{className:`h-7 w-16`})}),n[1]=s):s=n[1];let l;return n[2]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,o.jsxs)(`div`,{role:`status`,"aria-label":`Loading environment`,className:`flex min-h-svh w-full gap-2 bg-muted p-2`,children:[i,(0,o.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col rounded-paper border bg-background`,children:[s,(0,o.jsxs)(`p`,{className:`flex items-center gap-2 px-6 pt-4 text-ui text-muted-foreground`,children:[(0,o.jsx)(r,{className:`size-3.5`}),` Loading environment…`]}),(0,o.jsx)(e,{label:`Loading workspace`,caption:!1})]})]}),n[2]=l):l=n[2],l}function c(e){return(0,o.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,o.jsx)(t,{className:`h-5 w-32`}),(0,o.jsx)(t,{className:`ml-4 h-4 w-4/5`}),(0,o.jsx)(t,{className:`ml-4 h-4 w-2/3`})]},e)}export{s as t};
@@ -14,23 +14,23 @@
14
14
  <meta name="theme-color" content="#ffffff" media="(prefers-color-scheme: light)" />
15
15
  <meta name="theme-color" content="#171717" media="(prefers-color-scheme: dark)" />
16
16
  <title>Porcelain</title>
17
- <script type="module" crossorigin src="/assets/index-Bk8Ig0Ne.js"></script>
17
+ <script type="module" crossorigin src="/assets/index-jwdWY-Oe.js"></script>
18
18
  <link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-XKyaHtl9.js">
19
- <link rel="modulepreload" crossorigin href="/assets/access-WT1uwdZk.js">
19
+ <link rel="modulepreload" crossorigin href="/assets/access-Be5-I3uN.js">
20
20
  <link rel="modulepreload" crossorigin href="/assets/root-DLTE-HSj.js">
21
- <link rel="modulepreload" crossorigin href="/assets/useMatch-Dht53RCg.js">
22
- <link rel="modulepreload" crossorigin href="/assets/lazyRouteComponent-DpO3HGey.js">
21
+ <link rel="modulepreload" crossorigin href="/assets/useMatch-BNfVF2UU.js">
22
+ <link rel="modulepreload" crossorigin href="/assets/lazyRouteComponent-jhdvs2sU.js">
23
23
  <link rel="modulepreload" crossorigin href="/assets/preload-helper-7y9sWmk5.js">
24
24
  <link rel="modulepreload" crossorigin href="/assets/unwrapDefault-ByDmBtHB.js">
25
25
  <link rel="modulepreload" crossorigin href="/assets/lib-6HYXi0_j.js">
26
26
  <link rel="modulepreload" crossorigin href="/assets/hastToHtml-yWaxTNYJ.js">
27
27
  <link rel="modulepreload" crossorigin href="/assets/constants-CmGPilXJ.js">
28
28
  <link rel="modulepreload" crossorigin href="/assets/formatCSSVariablePrefix-KRh9vnZf.js">
29
- <link rel="modulepreload" crossorigin href="/assets/edit-file-CG3WhqLS.js">
29
+ <link rel="modulepreload" crossorigin href="/assets/edit-file-C2FNFMOI.js">
30
30
  <link rel="modulepreload" crossorigin href="/assets/resolveLanguages-BkDrap64.js">
31
- <link rel="modulepreload" crossorigin href="/assets/settings-page-RYnO3e6i.js">
32
- <link rel="modulepreload" crossorigin href="/assets/workspace-pending-oH5nDvO6.js">
33
- <link rel="stylesheet" crossorigin href="/assets/index-BoONRxa4.css">
31
+ <link rel="modulepreload" crossorigin href="/assets/settings-page-_25QMUsD.js">
32
+ <link rel="modulepreload" crossorigin href="/assets/workspace-pending-CF3GKXTj.js">
33
+ <link rel="stylesheet" crossorigin href="/assets/index-HBCxqMtr.css">
34
34
  </head>
35
35
  <body>
36
36
  <div id="root"></div>
@@ -1 +0,0 @@
1
- import{Wo as e,ts as t}from"./access-WT1uwdZk.js";import{t as n}from"./connected-workspace-DcS6e5zB.js";var r=e(),i=t(),a=()=>{let e=(0,r.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,i.jsx)(n,{notice:`not-found`}),e[0]=t):t=e[0],t};export{a as component};
@@ -1 +0,0 @@
1
- import{t as e}from"./workspace-error-CIsCnenX.js";var t=e;export{t as errorComponent};
@@ -1 +0,0 @@
1
- import{t as e}from"./workspace-error-CIsCnenX.js";var t=e;export{t as errorComponent};
@@ -1 +0,0 @@
1
- import{t as e}from"./workspace-error-CIsCnenX.js";var t=e;export{t as errorComponent};
@@ -1 +0,0 @@
1
- import{t as e}from"./workspace-error-CIsCnenX.js";var t=e;export{t as errorComponent};
@@ -1 +0,0 @@
1
- import{An as e,Jo as t,Wo as n,ts as r}from"./access-WT1uwdZk.js";import"./edit-file-CG3WhqLS.js";import"./settings-page-RYnO3e6i.js";import"./connected-workspace-DcS6e5zB.js";import"./workspace-pending-oH5nDvO6.js";import{t as i}from"./index-Bk8Ig0Ne.js";var a=n(),o=r();function s(){let n=(0,a.c)(9),{environmentId:r,projectId:s,worktreeId:c}=i.useParams(),l=i.useSearch();e(r);{let e;return n[0]!==l||n[1]!==c?(e=(0,o.jsx)(t,{to:`/`,search:{...l,worktree:c},replace:!0}),n[0]=l,n[1]=c,n[2]=e):e=n[2],e}}export{s as component};
@@ -1 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{$s as t,Aa as n,B as r,Bs as i,Ca as a,Ci as o,Da as s,Fs as c,Gs as l,Hc as u,Ho as d,Io as f,Ko as p,L as m,Lo as h,Ma as g,Ms as _,N as v,Oa as y,On as b,Qo as x,R as S,Ui as C,Us as w,V as T,Wo as E,Yi as D,Yo as O,ai as k,bi as A,bn as j,c as M,ca as N,cc as ee,ci as te,cn as ne,da as P,dc as F,fi as I,g as re,h as L,hl as R,ja as ie,jn as ae,ka as z,lc as oe,li as se,oc as B,ol as ce,pa as V,qi as le,to as ue,ts as de,ua as H,uc as fe,ul as U,xi as W,xn as pe,z as me,zo as he}from"./access-WT1uwdZk.js";import{$ as G,B as K,Fn as q,In as ge,L as _e,M as ve,N as ye,P as be,Un as J,V as xe,Vn as Se,Y as Ce,_t as we,at as Te,et as Ee,it as De,lt as Oe,m as ke,n as Ae,nt as je,rt as Me,tt as Ne,vt as Pe,x as Fe,z as Ie}from"./settings-page-RYnO3e6i.js";import{$r as Le,G as Re,Qr as ze,W as Be,Xr as Ve,Zr as Y,ei as He}from"./edit-file-CG3WhqLS.js";import{_ as Ue,a as We,b as Ge,c as Ke,d as qe,f as Je,g as Ye,h as Xe,i as Ze,l as Qe,m as $e,n as et,o as tt,p as nt,r as rt,s as it,u as at,v as ot}from"./desktop-actions-WJQHB849.js";var st={name:`chevron-left`,size:24,node:[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]};st.node;var ct=y(st),lt={name:`compass`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z`,key:`9ktpf1`}]]};lt.node;var ut=y(lt),dt={name:`folder-x`,size:24,node:[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}],[`path`,{d:`m9.5 10.5 5 5`,key:`ra9qjz`}],[`path`,{d:`m14.5 10.5-5 5`,key:`l2rkpq`}]]};dt.node;var ft=y(dt);function pt(e){let t=e.walkthrough;if(t===void 0)return{kind:`unwritten`};switch(t.state.status){case`queued`:case`running`:return{kind:`writing`,run:t};case`failed`:return{kind:`failed`,run:t,failure:t.state.failure};case`ready`:return{kind:`ready`,run:t,content:t.state.content,outOfDate:e.outOfDate,attempt:e.attempt}}}function mt(e){return e.walkthrough===void 0?`changes`:`walkthrough`}var ht=[`One`,`Two`,`Three`,`Four`,`Five`];function gt(e){return e.stops.flatMap((e,t)=>e.attention===void 0?[]:[{stop:e,step:t+1,attention:e.attention}])}function _t(e){let t=gt(e).length;return e.outcome===`nothing`?`Nothing needs you.`:e.outcome===`worth_knowing`||t===0?`Worth knowing.`:t===1?`One call is yours.`:`${ht[t-1]??t} calls are yours.`}function vt(e,t=[]){let n=[...e.excerpts.map(e=>e.path),...e.files.map(e=>e.path)],r=t.flatMap(e=>e.oldPath!==void 0&&n.includes(e.oldPath)?[e.path]:[]);return[...new Set([...n,...r])]}function yt(e){return new Set(e.stops.flatMap(e=>vt(e))).size}function bt(e,t){return e.has(t.path)||t.oldPath!==void 0&&e.has(t.oldPath)}function xt(e,t,n=[]){let r=new Set;return{steps:e.stops.map((e,i)=>{let a=new Set(vt(e,n)),o=t.filter(e=>bt(a,e));for(let e of o)r.add(e);return{stop:e,step:i+1,files:o}}),outside:t.filter(e=>!r.has(e))}}var St={claude:`Claude`,codex:`Codex`},Ct={claude:`claude auth login`,codex:`codex login`};function wt(e,t){let n=St[t.provider];switch(e.kind){case`signed_out`:return{title:`Sign in to ${n} again with ${Ct[t.provider]}, then try again.`,message:``,command:Ct[t.provider]};case`agent_not_installed`:return{title:`${n} isn't installed here.`,message:e.message};case`timed_out`:return{title:`The walkthrough took too long.`,message:e.message};case`unusable_output`:return{title:`${n} wrote something unreadable.`,message:e.message};case`other`:return{title:`The walkthrough didn't finish.`,message:e.message}}}var Tt=new Set([`signed_out`,`agent_not_installed`,`timed_out`,`unusable_output`,`other`]);function Et(e){return typeof e==`string`&&Tt.has(e)}function Dt(e){return typeof e==`object`&&e&&`kind`in e&&`message`in e&&Et(e.kind)&&typeof e.message==`string`?{kind:e.kind,message:e.message}:{kind:`other`,message:e instanceof Error&&e.message!==``?e.message:`Porcelain could not start the walkthrough.`}}function Ot(e){let t=(e.branch===void 0?void 0:e.pullRequests?.find(t=>t.headBranch===e.branch&&t.state===`open`)?.number)??e.displayedRun?.pullRequestNumber;return{...e.base===void 0?{}:{base:e.base},...t===void 0?{}:{pullRequestNumber:t}}}function kt(e){let t=pt(e);return t.kind===`ready`?At(t.content.title).replace(/\.$/,``):`Walkthrough`}function At(e){return e.replaceAll("`",``)}function jt(e){return e.split(/(`[^`]+`)/).filter(e=>e!==``).map(e=>e.length>2&&e.startsWith("`")&&e.endsWith("`")?{kind:`code`,text:e.slice(1,-1)}:{kind:`text`,text:e})}function Mt({branch:e,worktree:t,only:n}){let r=e=>[...new Set(e.filter(e=>n===void 0||n.includes(e.path)||e.oldPath!==void 0&&n.includes(e.oldPath)).map(e=>e.path))],i=t.flatMap(e=>[e,...(e.comparisons??[]).flatMap(t=>`oldPath`in t?[{path:e.path,oldPath:t.oldPath}]:[])]);return{branch:r(e),worktree:r(i)}}var X=e(_(),1),Z=E(),Nt=c(e=>le(e.connection).fn(u(`Walkthroughs.start`)(function*(n){let r=yield*D(e.connection,t=>t.walkthroughs.startWalkthrough({params:{worktreeId:e.scope.worktreeId},payload:n}));return yield*t([C.reviewSurface(e.connection.environmentId,e.scope,[`walkthrough`])]),r})));function Pt([e,t],n){let r=R(F(n.pulls)),i=Ot({...n,pullRequests:r?.kind===`available`?r.pullRequests:void 0});return{waiting:oe(e),failure:B(e)?Dt(U(e.cause)):void 0,start:()=>void t(i)}}var Ft=c(({connection:e,scope:n,runId:r})=>{let i=le(e),a={worktreeId:n.worktreeId,runId:r},o=t([C.reviewSurface(e.environmentId,n,[`walkthrough-conversations`])]),s=e=>({...a,messageId:e});return{addMessage:i.fn(u(`Walkthroughs.addMessage`)(function*(t){let n=yield*D(e,e=>e.walkthroughs.addWalkthroughMessage({params:a,payload:t}));return yield*o,n})),retryAnswer:i.fn(u(`Walkthroughs.retryAnswer`)(function*(t){let n=yield*D(e,e=>e.walkthroughs.retryWalkthroughAnswer({params:s(t)}));return yield*o,n})),saveMessage:i.fn(u(`Walkthroughs.saveMessage`)(function*(t){let n=yield*D(e,e=>e.walkthroughs.saveWalkthroughMessage({params:s(t.messageId),payload:{saved:t.saved}}));return yield*o,n})),postMessage:i.fn(u(`Walkthroughs.postMessage`)(function*(t){let n=yield*D(e,e=>e.walkthroughs.postWalkthroughMessage({params:s(t)}));return yield*o,n})),readBrief:i.fn(u(`Walkthroughs.readBrief`)(function*(t){return(yield*D(e,e=>e.walkthroughs.readWalkthroughBrief({params:a,query:t===void 0?{}:{messageId:t}}))).text})),postSavedMessages:i.fn(u(`Walkthroughs.postSavedMessages`)(function*(){let t=yield*D(e,e=>e.walkthroughs.postSavedWalkthroughMessages({params:a}));return yield*o,t}))}});function It([e,t]){return{waiting:oe(e),run:async e=>{let n=await t(e);if(ce(n))throw U(n.cause);return n.value}}}var Lt=u(`Walkthroughs.readConversations`)(function*({connection:e,scope:t,runId:n}){return yield*D(e,e=>e.walkthroughs.listWalkthroughConversations({params:{worktreeId:t.worktreeId,runId:n}}))}),Rt=c(e=>o(e.connection,e.scope,[`walkthrough-conversations`,e.runId],Lt(e),le(e.connection)).pipe(W)),zt=c(e=>A(e,[`walkthrough`],t=>t.walkthroughs.readWalkthrough({params:{worktreeId:e.scope.worktreeId}}),t=>t.walkthrough===void 0||t.walkthrough.worktreeId===e.scope.worktreeId)),Bt=c(e=>A(e,[`walkthrough-asset`,e.runId,e.assetId],t=>t.walkthroughs.readWalkthroughAsset({params:{worktreeId:e.scope.worktreeId,runId:e.runId,assetId:e.assetId}})));function Vt(e,t){let n=R(F(e));return n===void 0?B(e)?{status:`failed`}:{status:`reading`}:{status:`read`,value:t(n)}}function Ht(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 Ut(e){return e.messages.filter(e=>e.author===`developer`)}function Wt(e,t){return e.messages.find(e=>e.author===`agent`&&e.replyTo===t)}function Gt(e){return e.conversations.flatMap(Ut).filter(e=>e.post.status===`saved`).length}function Kt(e){return e===void 0||e.post.status===`none`?`available`:e.post.status}function qt(e,t){return(e?.conversations??[]).filter(({anchor:e})=>e.kind===`walkthrough`||!t.includes(e.title))}function Jt(e){return typeof e==`object`&&e&&(`status`in e&&e.status===409||`name`in e&&e.name===`WalkthroughRepositoryChangedError`)?{text:`Nothing was posted. Copy the brief instead.`,copy:!0}:{text:e instanceof Error?e.message:`The request failed. Try again.`,copy:!1}}var Yt=/^[a-z][a-z\d+.-]*:\/\/[^/?#\s]+(\/[^?#\s]*)?(?:[?#]\S*)?$/i,Xt=/\/(?:pull|issues)\/([1-9]\d*)\/?$/;function Zt(e){let t=Yt.exec(e)?.[1]??``,n=Xt.exec(t)?.[1];return n===void 0?`Posted comment`:`Posted on #${n}`}function Qt(e){return e===void 0?{single:`Copy as prompt`,together:`Copy together`}:{single:`Post on #${e}`,together:`Post together on #${e}`}}function $t(e){return Ut(e).map(t=>({message:t,reply:Wt(e,t.id)}))}function en(e,t){return e?Ht(e,{kind:`stop`,title:t}):[]}function tn(e){let t=e?Gt(e):0;if(t!==0)return t===1?`1 comment saved`:`${t} comments saved`}function nn(e){let{outcome:t}=e;return t.status===`brief`?{kind:`brief`,text:t.text}:t.status!==`posted`||t.notPosted.length===0?{kind:`done`}:{kind:`still-saved`,messages:e.view.conversations.flatMap(Ut).filter(e=>t.notPosted.includes(e.id))}}function rn(e){let t=e.walkthrough.status===`read`?e.walkthrough.value:void 0;return{name:mt(t??{walkthrough:void 0,outOfDate:!1}),pending:e.walkthrough.status===`reading`,guided:t?.walkthrough!==void 0,companion:t!==void 0&&t.walkthrough===void 0}}var an={product:`Product call`,contract:`Contract call`,tradeoff:`Tradeoff`,risk:`Risk to accept`,accessibility:`Accessibility call`};function on(e){return an[e.kind]}var sn={added:`+`,changed:`~`,removed:`−`};function cn(e){return sn[e.change]}var ln=4,un=7,dn=3;function fn(e,t){let n=e.growth;return{shown:t?n:n.slice(0,ln),hidden:t?0:Math.max(0,n.length-ln)}}function pn(e,t){let n=e.onlyInTranscript.length+e.stillUnclear.length,r=t?e.onlyInTranscript:e.onlyInTranscript.slice(0,dn),i=t?e.stillUnclear:e.stillUnclear.slice(0,Math.max(0,dn-r.length));return{explained:r,unclear:i,total:n,hidden:n-r.length-i.length}}function mn(e,t){let n=t?yt(t):0;return[...e.pullRequestNumber===void 0?[]:[`#${e.pullRequestNumber}`],...n>0?[n===1?`1 file`:`${n} files`]:[],`written for ${e.headOid.slice(0,un)}${e.includesUncommitted?` and uncommitted work`:``}`].join(` · `)}function hn(e,t){return wt(e,t?.writer??{provider:`claude`,model:``,effort:`high`})}function gn(e,t){let n=e.attempt,r=n?.state.status,i=n?.state.status===`failed`?{failure:n.state.failure,writer:n.writer}:void 0;return{updating:t.waiting||r===`queued`||r===`running`,failure:t.failure?{failure:t.failure,writer:n?.writer??e.run.writer}:i}}function _n(e){switch(e.evidenceUnavailable){case`head_mismatch`:return`Screenshots and checks are not shown: the pull request is at another commit. Push, then update.`;case`github_account`:return`Screenshots and checks are not shown: choose a GitHub account for this project, then update.`;case`github_unavailable`:return`Screenshots and checks are not shown: GitHub could not be reached. Try updating later.`;case void 0:return}}function vn(e,t){return{connection:t.connection,scope:{projectId:e.projectId,worktreeId:e.worktreeId}}}var yn=c(e=>zt(e).pipe(w,l(0)));function bn(e,t){let n=(0,Z.c)(12),r;n[0]!==t||n[1]!==e?(r=yn(vn(e,t)),n[0]=t,n[1]=e,n[2]=r):r=n[2];let i=r,a=d(i),o,s,c;if(n[3]!==a){let e=R(F(a));o=a,s=e,c=e?pt(e):void 0,n[3]=a,n[4]=o,n[5]=s,n[6]=c}else o=n[4],s=n[5],c=n[6];let l=he(i),u;return n[7]!==o||n[8]!==s||n[9]!==c||n[10]!==l?(u={result:o,read:s,phase:c,refresh:l},n[7]=o,n[8]=s,n[9]=c,n[10]=l,n[11]=u):u=n[11],u}function xn(e,t){let{phase:n}=bn(e,t);return n?.kind===`ready`?n:void 0}function Sn(e,t,n){let r=(0,Z.c)(2),i=Oe(e,t.connection,n).result,a;return r[0]===i?a=r[1]:(a=R(F(i))?.files??[],r[0]=i,r[1]=a),a}function Cn(e,t){let n=(0,Z.c)(2),{read:r}=bn(e,t),i;return n[0]===r?i=n[1]:(i=r?kt(r):`Walkthrough`,n[0]=r,n[1]=i),i}function wn(e,t){let n=(0,Z.c)(2),{result:r}=bn(e,t),i;return n[0]===r?i=n[1]:(i=rn({walkthrough:Vt(r,Tn)}),n[0]=r,n[1]=i),i}function Tn(e){return e}var En=c(e=>i(t=>{let n=t(Bt(e));return fe(n,e=>{let n=URL.createObjectURL(new Blob([Uint8Array.from(e)]));return t.addFinalizer(()=>URL.revokeObjectURL(n)),n})}));function Dn(e){let t=(0,Z.c)(5),n;return t[0]!==e.assetId||t[1]!==e.context||t[2]!==e.runId||t[3]!==e.scope?(n=En({...vn(e.scope,e.context),runId:e.runId,assetId:e.assetId}),t[0]=e.assetId,t[1]=e.context,t[2]=e.runId,t[3]=e.scope,t[4]=n):n=t[4],d(n)}function On(e,t,n,r){let i=(0,Z.c)(8),a;i[0]!==t.connection||i[1]!==e.projectId||i[2]!==e.worktreeId?(a=Nt({connection:t.connection,scope:{projectId:e.projectId,worktreeId:e.worktreeId}}),i[0]=t.connection,i[1]=e.projectId,i[2]=e.worktreeId,i[3]=a):a=i[3];let o;i[4]===Symbol.for(`react.memo_cache_sentinel`)?(o={mode:`promiseExit`},i[4]=o):o=i[4];let[s,c]=f(a,o),l=R(F(Pe(e,t.connection))),u;i[5]!==t.connection||i[6]!==e.projectId?(u=I({connection:t.connection,projectId:e.projectId}),i[5]=t.connection,i[6]=e.projectId,i[7]=u):u=i[7];let p=d(u);return Pt([s,c],{pulls:p,branch:l?.branch?.name,displayedRun:r,base:n})}var Q=de();function $(e){let t=(0,Z.c)(4),{text:n}=e,r;t[0]===n?r=t[1]:(r=jt(n).map(kn),t[0]=n,t[1]=r);let i;return t[2]===r?i=t[3]:(i=(0,Q.jsx)(Q.Fragment,{children:r}),t[2]=r,t[3]=i),i}function kn(e,t){return e.kind===`code`?(0,Q.jsx)(`code`,{className:`rounded bg-muted px-1 py-px font-mono text-[0.86em]`,children:e.text},t):e.text}var An=ie(`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 [&>[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 jn({variant:e=`default`,align:t=`start`,className:n,...r}){return(0,Q.jsx)(`div`,{"data-slot":`bubble`,"data-variant":e,"data-align":t,className:g(An({variant:e}),n),...r})}function Mn({className:e,render:t,...n}){return ne({defaultTagName:`div`,props:ue({className:g(`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`}})}ie(`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 Nn({className:e,...t}){return(0,Q.jsx)(`div`,{"data-slot":`message-group`,className:g(`flex min-w-0 flex-col gap-1.5`,e),...t})}function Pn({className:e,align:t=`start`,...n}){return(0,Q.jsx)(`div`,{"data-slot":`message`,"data-align":t,className:g(`group/message relative flex w-full min-w-0 gap-1.5 text-xs/relaxed data-[align=end]:flex-row-reverse`,e),...n})}function Fn({className:e,...t}){return(0,Q.jsx)(`div`,{"data-slot":`message-content`,className:g(`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 In({className:e,...t}){return(0,Q.jsx)(`div`,{"data-slot":`message-header`,className:g(`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 Ln({scope:e,context:t,runId:n}){return{connection:t.connection,runId:n,scope:{projectId:e.projectId,worktreeId:e.worktreeId}}}function Rn(e){let t=(0,Z.c)(10),n;t[0]===e?n=t[1]:(n=Rt(Ln(e)),t[0]=e,t[1]=n);let r=n,i=d(r),a;t[2]===i?a=t[3]:(a=R(F(i)),t[2]=i,t[3]=a);let o;t[4]===i?o=t[5]:(o=B(i),t[4]=i,t[5]=o);let s=he(r),c;return t[6]!==a||t[7]!==o||t[8]!==s?(c={view:a,failed:o,refresh:s},t[6]=a,t[7]=o,t[8]=s,t[9]=c):c=t[9],c}function zn(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=f(e,n),i;return t[1]===r?i=t[2]:(i=It(r),t[1]=r,t[2]=i),i}function Bn(e){let t=(0,Z.c)(9),n;t[0]===e?n=t[1]:(n=Ft(Ln(e)),t[0]=e,t[1]=n);let r=n,i=zn(r.addMessage),a=zn(r.retryAnswer),o=zn(r.saveMessage),s=zn(r.postMessage),c=zn(r.postSavedMessages),l=zn(r.readBrief),u;return t[2]!==i||t[3]!==a||t[4]!==o||t[5]!==s||t[6]!==c||t[7]!==l?(u={add:i,retry:a,save:o,post:s,postSaved:c,brief:l},t[2]=i,t[3]=a,t[4]=o,t[5]=s,t[6]=c,t[7]=l,t[8]=u):u=t[8],u}function Vn(e,t){let n=(0,Z.c)(17),r=Bn(e),[i,a]=(0,X.useState)(),o=r.post.waiting||r.postSaved.waiting||r.save.waiting||r.brief.waiting,s;n[0]===Symbol.for(`react.memo_cache_sentinel`)?(s=e=>a(Jt(e)),n[0]=s):s=n[0];let c=s,l;n[1]!==r.brief||n[2]!==t?.id?(l=()=>void r.brief.run(t?.id).then(Un,c),n[1]=r.brief,n[2]=t?.id,n[3]=l):l=n[3];let u=l,d;n[4]!==r.save||n[5]!==t?(d=e=>{t&&r.save.run({messageId:t.id,saved:e}).catch(c)},n[4]=r.save,n[5]=t,n[6]=d):d=n[6];let f=d,p;n[7]!==r.post||n[8]!==r.postSaved||n[9]!==t?(p=()=>{a(void 0),(t?r.post.run(t.id):r.postSaved.run(void 0)).then(e=>{let t=nn(e);t.kind===`brief`&&N(t.text,`brief`,!1),t.kind===`still-saved`&&a({text:`Still saved: ${t.messages.map(Hn).join(`; `)}. These comments belong to a different repository.`,copy:!1})},c)},n[7]=r.post,n[8]=r.postSaved,n[9]=t,n[10]=p):p=n[10];let m=p,h;return n[11]!==u||n[12]!==i||n[13]!==m||n[14]!==f||n[15]!==o?(h={notice:i,waiting:o,copy:u,save:f,post:m},n[11]=u,n[12]=i,n[13]=m,n[14]=f,n[15]=o,n[16]=h):h=n[16],h}function Hn(e){return e.text}function Un(e){e&&N(e,`brief`,!1)}function Wn(e,t){let n=(0,Z.c)(7),[r,i]=(0,X.useState)(),a=Bn(e),o;n[0]!==a.retry||n[1]!==t?(o=()=>{i(void 0),a.retry.run(t).catch(e=>i(Jt(e).text))},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 Gn(e){let t=(0,Z.c)(6),[n,r]=(0,X.useState)(),i=Bn(e),a;t[0]===i.add?a=t[1]:(a=(e,t)=>{r(void 0),i.add.run(e).then(t,e=>r(Jt(e).text))},t[0]=i.add,t[1]=a);let o;return t[2]!==i.add.waiting||t[3]!==n||t[4]!==a?(o={failure:n,waiting:i.add.waiting,send:a},t[2]=i.add.waiting,t[3]=n,t[4]=a,t[5]=o):o=t[5],o}function Kn(e){let t=(0,Z.c)(27),{owner:n,message:r,number:i}=e,{notice:a,waiting:o,copy:s,save:c,post:l}=Vn(n,r),u;t[0]===r?u=t[1]:(u=Kt(r),t[0]=r,t[1]=u);let d=u,f=i===void 0?s:l,p;t[2]===i?p=t[3]:(p=Qt(i),t[2]=i,t[3]=p);let m=p,h;t[4]!==r||t[5]!==d?(h=d===`posted`&&r?.post.status===`posted`?(0,Q.jsx)(`a`,{className:`text-caption text-muted-foreground hover:underline`,href:r.post.url,target:`_blank`,rel:`noreferrer`,children:Zt(r.post.url)}):null,t[4]=r,t[5]=d,t[6]=h):h=t[6];let g;t[7]!==c||t[8]!==d||t[9]!==o?(g=d===`saved`&&(0,Q.jsxs)(`span`,{className:`flex items-center gap-2 text-caption text-muted-foreground`,children:[`Saved for later`,(0,Q.jsx)(z,{variant:`link`,size:`sm`,disabled:o,onClick:()=>c(!1),children:`Undo`})]}),t[7]=c,t[8]=d,t[9]=o,t[10]=g):g=t[10];let _;t[11]!==f||t[12]!==m||t[13]!==r||t[14]!==c||t[15]!==d||t[16]!==o?(_=d===`available`&&(0,Q.jsxs)(`span`,{className:`flex flex-wrap items-center gap-3`,children:[(0,Q.jsx)(z,{size:`sm`,variant:r?`outline`:`default`,disabled:o,onClick:f,children:r?m.single:m.together}),r&&(0,Q.jsx)(z,{variant:`link`,size:`sm`,disabled:o,onClick:()=>c(!0),children:`Save for later`})]}),t[11]=f,t[12]=m,t[13]=r,t[14]=c,t[15]=d,t[16]=o,t[17]=_):_=t[17];let v;t[18]!==s||t[19]!==a||t[20]!==o?(v=a&&(0,Q.jsxs)(`div`,{role:`status`,className:`text-caption text-muted-foreground`,children:[a.text,a.copy&&(0,Q.jsx)(z,{variant:`link`,size:`sm`,disabled:o,onClick:()=>s(),children:`Copy`})]}),t[18]=s,t[19]=a,t[20]=o,t[21]=v):v=t[21];let y;return t[22]!==h||t[23]!==g||t[24]!==_||t[25]!==v?(y=(0,Q.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[h,g,_,v]}),t[22]=h,t[23]=g,t[24]=_,t[25]=v,t[26]=y):y=t[26],y}function qn(e){let t=(0,Z.c)(33),{message:n,children:r,owner:i}=e,[a,o]=(0,X.useState)(!1),[s,c]=(0,X.useState)(!1),l;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(l=()=>e=>{if(!e)return;let t=()=>c(e.scrollHeight>e.clientHeight);t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},t[0]=l):l=t[0];let[u]=(0,X.useState)(l),{failure:d,waiting:f,retry:p}=Wn(i,n.replyTo),m=n.state,h;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,Q.jsx)(In,{children:`Walkthrough agent`}),t[1]=h):h=t[1];let g;t[2]!==a||t[3]!==m.status||t[4]!==m.text?(g=m.status===`answered`?(0,Q.jsx)(`span`,{ref:u,className:a?void 0:`line-clamp-3`,children:(0,Q.jsx)($,{text:m.text})}):null,t[2]=a,t[3]=m.status,t[4]=m.text,t[5]=g):g=t[5];let _;t[6]===m.status?_=t[7]:(_=m.status===`answering`&&(0,Q.jsx)(`span`,{role:`status`,className:`text-muted-foreground`,children:`Working…`}),t[6]=m.status,t[7]=_);let v;t[8]!==m.failure||t[9]!==m.status?(v=m.status===`failed`&&(0,Q.jsx)(`span`,{children:m.failure.message}),t[8]=m.failure,t[9]=m.status,t[10]=v):v=t[10];let y;t[11]!==g||t[12]!==_||t[13]!==v?(y=(0,Q.jsx)(jn,{variant:`ghost`,className:`max-w-full`,children:(0,Q.jsxs)(Mn,{className:`whitespace-pre-wrap`,children:[g,_,v]})}),t[11]=g,t[12]=_,t[13]=v,t[14]=y):y=t[14];let b;t[15]!==s||t[16]!==a||t[17]!==m.status?(b=m.status===`answered`&&!a&&s&&(0,Q.jsx)(z,{variant:`link`,size:`sm`,onClick:()=>o(!0),children:`Read all`}),t[15]=s,t[16]=a,t[17]=m.status,t[18]=b):b=t[18];let x;t[19]!==p||t[20]!==m.status||t[21]!==f?(x=m.status===`failed`&&(0,Q.jsx)(z,{variant:`link`,size:`sm`,disabled:f,onClick:()=>p(),children:`Try again`}),t[19]=p,t[20]=m.status,t[21]=f,t[22]=x):x=t[22];let S;t[23]!==r||t[24]!==b||t[25]!==x?(S=(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[b,x,r]}),t[23]=r,t[24]=b,t[25]=x,t[26]=S):S=t[26];let C;t[27]===d?C=t[28]:(C=d&&(0,Q.jsx)(`p`,{role:`alert`,children:d}),t[27]=d,t[28]=C);let w;return t[29]!==C||t[30]!==y||t[31]!==S?(w=(0,Q.jsx)(Pn,{children:(0,Q.jsxs)(Fn,{children:[h,y,S,C]})}),t[29]=C,t[30]=y,t[31]=S,t[32]=w):w=t[32],w}function Jn({conversation:e,owner:t,number:n}){return $t(e).map(({message:e,reply:r})=>{let i=(0,Q.jsx)(Kn,{owner:t,message:e,number:n});return(0,Q.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,Q.jsx)(Pn,{align:`end`,children:(0,Q.jsx)(Fn,{children:(0,Q.jsx)(jn,{align:`end`,variant:`secondary`,children:(0,Q.jsx)(Mn,{className:`whitespace-pre-wrap`,children:(0,Q.jsx)($,{text:e.text})})})})}),r?(0,Q.jsx)(qn,{owner:t,message:r,children:i}):(0,Q.jsx)(`div`,{className:`flex justify-end`,children:i})]},e.id)})}function Yn(e){let t=(0,Z.c)(32),{owner:n,anchor:r,placeholder:i}=e,[a,o]=(0,X.useState)(``),{failure:s,waiting:c,send:l}=Gn(n),u;t[0]!==r||t[1]!==a||t[2]!==l||t[3]!==c?(u=()=>{let e=a.trim();e&&!c&&l({anchor:r,text:e},()=>o(e=>e===a?``:e))},t[0]=r,t[1]=a,t[2]=l,t[3]=c,t[4]=u):u=t[4];let d=u,f;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(f=e=>o(e.target.value),t[5]=f):f=t[5];let p;t[6]===d?p=t[7]:(p=e=>{e.key===`Enter`&&!e.shiftKey&&!e.nativeEvent.isComposing&&(e.preventDefault(),d())},t[6]=d,t[7]=p);let m;t[8]!==a||t[9]!==i||t[10]!==p?(m=(0,Q.jsx)(_e,{value:a,rows:1,maxLength:8e3,"aria-label":i,placeholder:i,className:`min-h-9`,onChange:f,onKeyDown:p}),t[8]=a,t[9]=i,t[10]=p,t[11]=m):m=t[11];let h;t[12]!==a||t[13]!==c?(h=!a.trim()||c,t[12]=a,t[13]=c,t[14]=h):h=t[14];let g;t[15]===d?g=t[16]:(g=()=>d(),t[15]=d,t[16]=g);let _;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,Q.jsx)(J,{}),t[17]=_):_=t[17];let v;t[18]!==h||t[19]!==g?(v=(0,Q.jsx)(V,{render:(0,Q.jsx)(be,{size:`icon-xs`,variant:`default`,"aria-label":`Send`,disabled:h,onClick:g,children:_})}),t[18]=h,t[19]=g,t[20]=v):v=t[20];let y;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,Q.jsx)(P,{children:`Send`}),t[21]=y):y=t[21];let b;t[22]===v?b=t[23]:(b=(0,Q.jsx)(ye,{align:`inline-end`,children:(0,Q.jsxs)(H,{children:[v,y]})}),t[22]=v,t[23]=b);let x;t[24]!==b||t[25]!==m?(x=(0,Q.jsxs)(ve,{children:[m,b]}),t[24]=b,t[25]=m,t[26]=x):x=t[26];let S;t[27]===s?S=t[28]:(S=s&&(0,Q.jsx)(`p`,{role:`alert`,className:`text-caption text-destructive`,children:s}),t[27]=s,t[28]=S);let C;return t[29]!==x||t[30]!==S?(C=(0,Q.jsxs)(Q.Fragment,{children:[x,S]}),t[29]=x,t[30]=S,t[31]=C):C=t[31],C}function Xn(e){let t=(0,Z.c)(22),{owner:n,title:r,call:i}=e,{view:a,failed:o,refresh:s}=Rn(n),c,l,u;if(t[0]!==o||t[1]!==n||t[2]!==s||t[3]!==r||t[4]!==a){let e=en(a,r);c=`flex flex-col gap-3`,t[8]!==o||t[9]!==s?(l=o&&(0,Q.jsxs)(`p`,{role:`alert`,className:`text-caption`,children:[`Comments could not be read.`,` `,(0,Q.jsx)(z,{variant:`link`,size:`sm`,onClick:s,children:`Try again`})]}),t[8]=o,t[9]=s,t[10]=l):l=t[10],u=e.length>0&&(0,Q.jsx)(`div`,{className:`border-t pt-3`,children:(0,Q.jsx)(Nn,{children:e.map(e=>(0,Q.jsx)(Jn,{owner:n,conversation:e,number:a?.pullRequestNumber},e.runId))})}),t[0]=o,t[1]=n,t[2]=s,t[3]=r,t[4]=a,t[5]=c,t[6]=l,t[7]=u}else c=t[5],l=t[6],u=t[7];let d;t[11]===r?d=t[12]:(d={kind:`stop`,title:r},t[11]=r,t[12]=d);let f=i?`Decide, or ask about this`:`Ask about this step`,p;t[13]!==n||t[14]!==d||t[15]!==f?(p=(0,Q.jsx)(Yn,{owner:n,anchor:d,placeholder:f}),t[13]=n,t[14]=d,t[15]=f,t[16]=p):p=t[16];let m;return t[17]!==c||t[18]!==l||t[19]!==u||t[20]!==p?(m=(0,Q.jsxs)(`div`,{className:c,children:[l,u,p]}),t[17]=c,t[18]=l,t[19]=u,t[20]=p,t[21]=m):m=t[21],m}function Zn(e){let t=(0,Z.c)(19),{owner:n,titles:r}=e,{view:i}=Rn(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=qt(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,Q.jsx)(`h2`,{className:`text-ui font-semibold`,children:`Earlier comments`}),t[8]=c):c=t[8],a=Nn;let u;t[9]!==n||t[10]!==i?.pullRequestNumber?(u=(e,t)=>(0,Q.jsx)(Jn,{owner:n,conversation:e,number:i?.pullRequestNumber},`${e.runId}:${t}`),t[9]=n,t[10]=i?.pullRequestNumber,t[11]=u):u=t[11],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[12]!==a||t[13]!==o?(u=(0,Q.jsx)(a,{children:o}),t[12]=a,t[13]=o,t[14]=u):u=t[14];let d;return t[15]!==s||t[16]!==c||t[17]!==u?(d=(0,Q.jsxs)(`section`,{className:s,children:[c,u]}),t[15]=s,t[16]=c,t[17]=u,t[18]=d):d=t[18],d}function Qn(e){let t=(0,Z.c)(10),{owner:n}=e,{view:r}=Rn(n),i;t[0]===r?i=t[1]:(i=tn(r),t[0]=r,t[1]=i);let a=i;if(!a)return null;let o;t[2]===a?o=t[3]:(o=(0,Q.jsx)(`span`,{children:a}),t[2]=a,t[3]=o);let s=r?.pullRequestNumber,c;t[4]!==n||t[5]!==s?(c=(0,Q.jsx)(Kn,{owner:n,number:s}),t[4]=n,t[5]=s,t[6]=c):c=t[6];let l;return t[7]!==o||t[8]!==c?(l=(0,Q.jsx)(`div`,{className:`sticky bottom-4 z-30 flex justify-center`,children:(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center justify-center gap-3 rounded-full border bg-popover py-1.5 pr-1.5 pl-4 text-ui shadow-sm`,children:[o,c]})}),t[7]=o,t[8]=c,t[9]=l):l=t[9],l}function $n(e){let t=(0,Z.c)(12),{label:n,icon:r,disabled:i,onClick:a}=e,o;t[0]!==i||t[1]!==n||t[2]!==a?(o=(0,Q.jsx)(z,{size:`icon-sm`,variant:`ghost`,"aria-label":n,disabled:i,onClick:a}),t[0]=i,t[1]=n,t[2]=a,t[3]=o):o=t[3];let s;t[4]!==r||t[5]!==o?(s=(0,Q.jsx)(V,{render:o,children:r}),t[4]=r,t[5]=o,t[6]=s):s=t[6];let c;t[7]===n?c=t[8]:(c=(0,Q.jsx)(P,{children:n}),t[7]=n,t[8]=c);let l;return t[9]!==s||t[10]!==c?(l=(0,Q.jsxs)(H,{children:[s,c]}),t[9]=s,t[10]=c,t[11]=l):l=t[11],l}function er(e){let t=(0,Z.c)(11),{scope:n,context:r,run:i,item:a,className:o,placeholder:s}=e,c;t[0]!==r||t[1]!==a.assetId||t[2]!==i.id||t[3]!==n?(c={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]=c):c=t[4];let l=Dn(c);if(B(l)){let e;return t[5]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Q.jsx)(`span`,{className:`flex h-56 w-full items-center justify-center rounded-lg border p-3 text-center text-caption text-muted-foreground`,children:`This screenshot could not be loaded.`}),t[5]=e):e=t[5],e}if(!ee(l)){let e;return t[6]===s?e=t[7]:(e=(0,Q.jsx)(`span`,{className:`block overflow-hidden rounded-lg border`,children:(0,Q.jsx)(T,{className:s})}),t[6]=s,t[7]=e),e}let u;return t[8]!==o||t[9]!==l.value?(u=(0,Q.jsx)(`img`,{src:l.value,alt:``,loading:`lazy`,decoding:`async`,className:o}),t[8]=o,t[9]=l.value,t[10]=u):u=t[10],u}function tr(e){let t=(0,Z.c)(34),{scope:n,context:r,run:i,items:o}=e,[s,c]=(0,X.useState)(null),l=s===null?void 0:o[s],u;if(t[0]!==r||t[1]!==o||t[2]!==i||t[3]!==n){let e;t[5]!==r||t[6]!==i||t[7]!==n?(e=(e,t)=>(0,Q.jsxs)(`button`,{type:`button`,"aria-label":`Enlarge screenshot ${t+1}`,onClick:()=>c(t),className:`group flex w-34 shrink-0 flex-col gap-1.5 text-left`,children:[(0,Q.jsx)(er,{scope:n,context:r,run:i,item:e,className:`h-56 w-full rounded-lg border object-cover object-top transition-opacity group-hover:opacity-85`,placeholder:`h-56 w-full`}),(0,Q.jsx)(`span`,{className:`line-clamp-3 text-caption leading-4 text-muted-foreground`,children:(0,Q.jsx)($,{text:e.shows})})]},e.assetId),t[5]=r,t[6]=i,t[7]=n,t[8]=e):e=t[8],u=o.map(e),t[0]=r,t[1]=o,t[2]=i,t[3]=n,t[4]=u}else u=t[4];let d;t[9]===u?d=t[10]:(d=(0,Q.jsx)(`div`,{className:`-mx-5 flex gap-3 overflow-x-auto px-5 pb-1 @3xl:-mx-0 @3xl:px-0`,children:u}),t[9]=u,t[10]=d);let f=l!==void 0,p;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(p=e=>{e||c(null)},t[11]=p):p=t[11];let m;t[12]===l?m=t[13]:(m=l&&(0,Q.jsx)($,{text:l.shows}),t[12]=l,t[13]=m);let h;t[14]===m?h=t[15]:(h=(0,Q.jsx)(Me,{children:m}),t[14]=m,t[15]=h);let g;t[16]!==r||t[17]!==i||t[18]!==n||t[19]!==l?(g=l&&(0,Q.jsx)(er,{scope:n,context:r,run:i,item:l,className:`mx-auto max-h-[72vh] rounded-lg border`,placeholder:`h-96 w-full`}),t[16]=r,t[17]=i,t[18]=n,t[19]=l,t[20]=g):g=t[20];let _;t[21]!==o.length||t[22]!==s?(_=o.length>1&&s!==null&&(0,Q.jsxs)(`div`,{className:`flex items-center justify-center gap-3 text-caption text-muted-foreground`,children:[(0,Q.jsx)($n,{label:`Previous screenshot`,icon:(0,Q.jsx)(ct,{}),disabled:s===0,onClick:()=>c(s-1)}),s+1,` of `,o.length,(0,Q.jsx)($n,{label:`Next screenshot`,icon:(0,Q.jsx)(a,{}),disabled:s===o.length-1,onClick:()=>c(s+1)})]}),t[21]=o.length,t[22]=s,t[23]=_):_=t[23];let v;t[24]!==h||t[25]!==g||t[26]!==_?(v=(0,Q.jsxs)(Ee,{className:`max-h-[92vh] overflow-auto sm:max-w-[min(92vw,52rem)]`,children:[h,g,_]}),t[24]=h,t[25]=g,t[26]=_,t[27]=v):v=t[27];let y;t[28]!==f||t[29]!==v?(y=(0,Q.jsx)(G,{open:f,onOpenChange:p,children:v}),t[28]=f,t[29]=v,t[30]=y):y=t[30];let b;return t[31]!==y||t[32]!==d?(b=(0,Q.jsxs)(Q.Fragment,{children:[d,y]}),t[31]=y,t[32]=d,t[33]=b):b=t[33],b}var nr=e=>document.getElementById(e)?.scrollIntoView({behavior:`smooth`,block:`start`}),rr=e=>`walkthrough-step-${e}`;function ir(e){let t=(0,Z.c)(2),{children:n}=e,r;return t[0]===n?r=t[1]:(r=(0,Q.jsx)(`div`,{className:`mx-auto flex w-full max-w-180 flex-col gap-10 px-5 py-8 @3xl:px-8 @3xl:py-12`,children:n}),t[0]=n,t[1]=r),r}function ar(e){let t=(0,Z.c)(8),{run:n,content:r}=e,i;t[0]!==r||t[1]!==n?(i=mn(n,r),t[0]=r,t[1]=n,t[2]=i):i=t[2];let a;t[3]===n?a=t[4]:(a=_n(n)?`\n${_n(n)}`:``,t[3]=n,t[4]=a);let o;return t[5]!==i||t[6]!==a?(o=(0,Q.jsxs)(`p`,{className:`whitespace-pre-line font-mono text-caption text-muted-foreground`,children:[i,a]}),t[5]=i,t[6]=a,t[7]=o):o=t[7],o}function or(e){let t=(0,Z.c)(10),{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;t[3]===r?i=t[4]:(i=(0,Q.jsxs)(`span`,{className:`text-muted-foreground`,children:[r,`.`]}),t[3]=r,t[4]=i);let a;t[5]===n?a=t[6]:(a=_t(n),t[5]=n,t[6]=a);let o;return t[7]!==i||t[8]!==a?(o=(0,Q.jsxs)(`h1`,{className:`text-subpage-title font-semibold tracking-tight text-balance @3xl:text-page-title`,children:[i,` `,a]}),t[7]=i,t[8]=a,t[9]=o):o=t[9],o}function sr(e){let t=(0,Z.c)(8),[n,r]=(0,X.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,Q.jsx)(cr,{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 cr(e){let t=(0,Z.c)(3),{hidden:n,onClick:r}=e,i;return t[0]!==n||t[1]!==r?(i=(0,Q.jsx)(`div`,{className:`-ml-2`,children:(0,Q.jsxs)(z,{variant:`link`,size:`sm`,onClick:r,children:[n,` more`]})}),t[0]=n,t[1]=r,t[2]=i):i=t[2],i}function lr(e){let t=(0,Z.c)(10),{content:n}=e,r;t[0]===n?r=t[1]:(r=e=>fn(n,e),t[0]=n,t[1]=r);let{shown:i,more:a}=sr(r),o;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,Q.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(ur),t[3]=i,t[4]=s);let c;t[5]===s?c=t[6]:(c=(0,Q.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,Q.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 ur(e,t){return(0,Q.jsxs)(`li`,{className:`grid grid-cols-[1rem_minmax(0,1fr)] text-prose`,children:[(0,Q.jsx)(`span`,{"aria-label":e.change,className:g(`font-mono`,e.change===`added`&&`text-add-fg`,e.change===`removed`&&`text-del-fg`,e.change===`changed`&&`text-muted-foreground`),children:cn(e)}),(0,Q.jsxs)(`span`,{className:`wrap-anywhere`,children:[(0,Q.jsxs)(`span`,{className:`font-medium`,children:[(0,Q.jsx)($,{text:e.what}),`.`]}),` `,(0,Q.jsx)(`span`,{className:`text-foreground-2`,children:(0,Q.jsx)($,{text:e.note})})]})]},`${t}:${e.what}`)}function dr(e){let t=(0,Z.c)(13),{content:n}=e,r;t[0]===n?r=t[1]:(r=e=>pn(n,e),t[0]=n,t[1]=r);let{explained:i,unclear:a,total:o,more:s}=sr(r);if(o===0)return null;let c;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,Q.jsx)(`h2`,{className:`text-ui font-semibold`,children:`What the code doesn't say`}),t[2]=c):c=t[2];let l;t[3]===i?l=t[4]:(l=i.map(pr),t[3]=i,t[4]=l);let u;t[5]===a?u=t[6]:(u=a.map(fr),t[5]=a,t[6]=u);let d;t[7]!==l||t[8]!==u?(d=(0,Q.jsxs)(`ul`,{className:`flex flex-col gap-2 text-prose`,children:[l,u]}),t[7]=l,t[8]=u,t[9]=d):d=t[9];let f;return t[10]!==s||t[11]!==d?(f=(0,Q.jsxs)(`section`,{className:`flex flex-col gap-2 border-t pt-5`,children:[c,d,s]}),t[10]=s,t[11]=d,t[12]=f):f=t[12],f}function fr(e,t){return(0,Q.jsx)(`li`,{className:`text-foreground-2`,children:(0,Q.jsx)($,{text:e})},`${t}:${e}`)}function pr(e,t){return(0,Q.jsxs)(`li`,{children:[(0,Q.jsx)(`span`,{children:(0,Q.jsx)($,{text:e.point})}),` `,(0,Q.jsx)(`span`,{className:`text-foreground-2`,children:(0,Q.jsx)($,{text:e.answer})})]},`${t}:${e.point}`)}function mr(e){let t=(0,Z.c)(12),{content:n,conversation:r}=e,i,a,o,s;if(t[0]!==n||t[1]!==r){s=Symbol.for(`react.early_return_sentinel`);bb0:{let e=gt(n);if(e.length===0){s=null;break bb0}i=`your-calls`,a=`flex scroll-mt-6 flex-col gap-3`;let c;t[6]===r?c=t[7]:(c=e=>{let{attention:t,step:n}=e;return(0,Q.jsxs)(`article`,{className:`flex flex-col gap-3 rounded-xl border bg-card p-4 @3xl:p-5`,children:[(0,Q.jsxs)(`div`,{className:`flex items-baseline justify-between gap-3 text-caption text-muted-foreground`,children:[(0,Q.jsx)(`span`,{children:on(t)}),(0,Q.jsxs)(`button`,{type:`button`,className:`hover:text-foreground`,onClick:()=>nr(rr(n)),children:[`Step `,n]})]}),(0,Q.jsx)(`h2`,{className:`text-section font-semibold text-pretty`,children:(0,Q.jsx)($,{text:t.question})}),(0,Q.jsx)(`p`,{className:`text-prose text-foreground-2`,children:(0,Q.jsx)($,{text:t.note})}),r?.({kind:`call`,step:n})]},n)},t[6]=r,t[7]=c),o=e.map(c)}t[0]=n,t[1]=r,t[2]=i,t[3]=a,t[4]=o,t[5]=s}else i=t[2],a=t[3],o=t[4],s=t[5];if(s!==Symbol.for(`react.early_return_sentinel`))return s;let c;return t[8]!==i||t[9]!==a||t[10]!==o?(c=(0,Q.jsx)(`section`,{id:i,className:a,children:o}),t[8]=i,t[9]=a,t[10]=o,t[11]=c):c=t[11],c}function hr(e){let t=(0,Z.c)(30),{stop:n,step:r,run:i,props:a,conversation:o}=e,c;t[0]===r?c=t[1]:(c=rr(r),t[0]=r,t[1]=c);let l;t[2]===n.attention?l=t[3]:(l=n.attention&&(0,Q.jsx)(`button`,{type:`button`,className:`ml-2 text-foreground hover:underline`,onClick:gr,children:`Your call`}),t[2]=n.attention,t[3]=l);let u;t[4]!==r||t[5]!==l?(u=(0,Q.jsxs)(`p`,{className:`whitespace-pre-line font-mono text-caption text-muted-foreground`,children:[`Step `,r,l]}),t[4]=r,t[5]=l,t[6]=u):u=t[6];let d;t[7]===n.title?d=t[8]:(d=(0,Q.jsx)(`h2`,{className:`text-lg leading-6 font-semibold text-pretty`,children:(0,Q.jsx)($,{text:n.title})}),t[7]=n.title,t[8]=d);let f;t[9]===n.explanation?f=t[10]:(f=(0,Q.jsx)(`p`,{className:`text-prose text-foreground-2`,children:(0,Q.jsx)($,{text:n.explanation})}),t[9]=n.explanation,t[10]=f);let p;t[11]!==a||t[12]!==i||t[13]!==n.evidence?(p=n.evidence.length>0&&(0,Q.jsx)(tr,{scope:a.scope,context:a.context,run:i,items:n.evidence}),t[11]=a,t[12]=i,t[13]=n.evidence,t[14]=p):p=t[14];let m;t[15]!==a||t[16]!==r||t[17]!==n?(m=vt(n).length>0&&(0,Q.jsxs)($e,{"aria-label":`See the code for step ${r}`,children:[(0,Q.jsx)(Xe,{children:`See the code`}),(0,Q.jsxs)(H,{children:[(0,Q.jsx)(V,{render:(0,Q.jsx)(z,{variant:`outline`,size:`icon`,"aria-label":`Open code for step ${r} in split view`,onClick:()=>a.onOpen({kind:`walkthrough-step`,step:r},{toSide:!0})}),children:(0,Q.jsx)(Se,{"aria-hidden":`true`})}),(0,Q.jsx)(P,{children:`Open in split view`})]}),(0,Q.jsxs)(H,{children:[(0,Q.jsx)(V,{render:(0,Q.jsx)(z,{variant:`outline`,size:`icon`,"aria-label":`See the code for step ${r}`,onClick:()=>a.onOpen({kind:`walkthrough-step`,step:r})}),children:(0,Q.jsx)(s,{"aria-hidden":`true`})}),(0,Q.jsx)(P,{children:`Open in a new tab`})]})]}),t[15]=a,t[16]=r,t[17]=n,t[18]=m):m=t[18];let h;t[19]!==o||t[20]!==r?(h=o?.({kind:`step`,step:r}),t[19]=o,t[20]=r,t[21]=h):h=t[21];let g;return t[22]!==c||t[23]!==u||t[24]!==d||t[25]!==f||t[26]!==p||t[27]!==m||t[28]!==h?(g=(0,Q.jsxs)(`li`,{id:c,className:`flex scroll-mt-6 flex-col gap-2.5 border-t pt-5`,children:[u,d,f,p,m,h]}),t[22]=c,t[23]=u,t[24]=d,t[25]=f,t[26]=p,t[27]=m,t[28]=h,t[29]=g):g=t[29],g}function gr(){return nr(`your-calls`)}function _r(e){let t=(0,Z.c)(98),{run:n,content:r,outOfDate:i,props:a,onUpdate:o,updating:s,updateFailure:c}=e,l;t[0]!==a||t[1]!==n.id?(l={...a,runId:n.id},t[0]=a,t[1]=n.id,t[2]=l):l=t[2];let u=l,d;t[3]!==r.stops||t[4]!==u?(d=e=>{let{kind:t,step:n}=e,i=r.stops[n-1].title;return(0,Q.jsx)(Xn,{owner:u,title:i,call:t===`call`},i)},t[3]=r.stops,t[4]=u,t[5]=d):d=t[5];let f=d,p;t[6]===i?p=t[7]:(p=i&&(0,Q.jsx)(`span`,{children:`The work changed after this was written.`}),t[6]=i,t[7]=p);let m;t[8]===o?m=t[9]:(m=(0,Q.jsx)(z,{size:`sm`,variant:`outline`,onClick:o,children:`Update walkthrough`}),t[8]=o,t[9]=m);let h;t[10]!==p||t[11]!==m?(h=(0,Q.jsxs)(Q.Fragment,{children:[p,m]}),t[10]=p,t[11]=m,t[12]=h):h=t[12];let g=h;if(s){let e;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Q.jsx)(`span`,{role:`status`,children:`Updating…`}),t[13]=e):e=t[13],g=e}else if(c){let e;t[14]!==c.failure||t[15]!==c.writer?(e=wt(c.failure,c.writer),t[14]=c.failure,t[15]=c.writer,t[16]=e):e=t[16];let n=c.failure.kind!==`signed_out`&&` ${c.failure.message}`,r;t[17]!==e.title||t[18]!==n?(r=(0,Q.jsxs)(`span`,{role:`alert`,children:[e.title,n]}),t[17]=e.title,t[18]=n,t[19]=r):r=t[19];let i;t[20]===o?i=t[21]:(i=(0,Q.jsx)(z,{size:`sm`,variant:`outline`,onClick:o,children:`Try again`}),t[20]=o,t[21]=i);let a;t[22]!==r||t[23]!==i?(a=(0,Q.jsxs)(Q.Fragment,{children:[r,i]}),t[22]=r,t[23]=i,t[24]=a):a=t[24],g=a}let _;t[25]===g?_=t[26]:(_=(0,Q.jsx)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1 text-ui text-foreground-2`,children:g}),t[25]=g,t[26]=_);let v=_;if(r.outcome===`nothing`){let e;t[27]!==r||t[28]!==n?(e=(0,Q.jsx)(ar,{run:n,content:r}),t[27]=r,t[28]=n,t[29]=e):e=t[29];let o;t[30]===r?o=t[31]:(o=(0,Q.jsx)(or,{content:r}),t[30]=r,t[31]=o);let l;t[32]===r.summary?l=t[33]:(l=(0,Q.jsx)(`p`,{className:`text-prose text-foreground-2`,children:(0,Q.jsx)($,{text:r.summary})}),t[32]=r.summary,t[33]=l);let d=(i||n.evidenceUnavailable||s||c)&&v,f;t[34]===a?f=t[35]:(f=(0,Q.jsx)(`div`,{className:`-ml-2`,children:(0,Q.jsx)(z,{variant:`link`,size:`sm`,onClick:()=>a.onOpen({kind:`walkthrough-changes`}),children:`See the change`})}),t[34]=a,t[35]=f);let p;t[36]!==d||t[37]!==f||t[38]!==e||t[39]!==o||t[40]!==l?(p=(0,Q.jsxs)(`header`,{className:`flex flex-col gap-3`,children:[e,o,l,d,f]}),t[36]=d,t[37]=f,t[38]=e,t[39]=o,t[40]=l,t[41]=p):p=t[41];let m;t[42]===Symbol.for(`react.memo_cache_sentinel`)?(m=[],t[42]=m):m=t[42];let h,g;t[43]===u?(h=t[44],g=t[45]):(h=(0,Q.jsx)(Zn,{owner:u,titles:m}),g=(0,Q.jsx)(Qn,{owner:u}),t[43]=u,t[44]=h,t[45]=g);let _;return t[46]!==p||t[47]!==h||t[48]!==g?(_=(0,Q.jsxs)(ir,{children:[p,h,g]}),t[46]=p,t[47]=h,t[48]=g,t[49]=_):_=t[49],_}let y;t[50]!==r||t[51]!==n?(y=(0,Q.jsx)(ar,{run:n,content:r}),t[50]=r,t[51]=n,t[52]=y):y=t[52];let b;t[53]===r?b=t[54]:(b=(0,Q.jsx)(or,{content:r}),t[53]=r,t[54]=b);let x;t[55]===r.summary?x=t[56]:(x=(0,Q.jsx)(`p`,{className:`text-prose text-foreground-2`,children:(0,Q.jsx)($,{text:r.summary})}),t[55]=r.summary,t[56]=x);let S=(i||n.evidenceUnavailable||s||c)&&v,C;t[57]!==S||t[58]!==y||t[59]!==b||t[60]!==x?(C=(0,Q.jsxs)(`header`,{className:`flex flex-col gap-3`,children:[y,b,x,S]}),t[57]=S,t[58]=y,t[59]=b,t[60]=x,t[61]=C):C=t[61];let w;t[62]!==r||t[63]!==f?(w=(0,Q.jsx)(mr,{content:r,conversation:f}),t[62]=r,t[63]=f,t[64]=w):w=t[64];let T;t[65]===r?T=t[66]:(T=r.growth.length>0&&(0,Q.jsx)(lr,{content:r}),t[65]=r,t[66]=T);let E;if(t[67]!==r.stops||t[68]!==f||t[69]!==a||t[70]!==n){let e;t[72]!==f||t[73]!==a||t[74]!==n?(e=(e,t)=>(0,Q.jsx)(hr,{stop:e,step:t+1,run:n,props:a,conversation:f},t),t[72]=f,t[73]=a,t[74]=n,t[75]=e):e=t[75],E=r.stops.map(e),t[67]=r.stops,t[68]=f,t[69]=a,t[70]=n,t[71]=E}else E=t[71];let D;t[76]===E?D=t[77]:(D=(0,Q.jsx)(`ol`,{className:`flex flex-col gap-10`,children:E}),t[76]=E,t[77]=D);let O;t[78]===r?O=t[79]:(O=(0,Q.jsx)(dr,{content:r}),t[78]=r,t[79]=O);let k;t[80]===r.stops?k=t[81]:(k=r.stops.map(vr),t[80]=r.stops,t[81]=k);let A;t[82]!==u||t[83]!==k?(A=(0,Q.jsx)(Zn,{owner:u,titles:k}),t[82]=u,t[83]=k,t[84]=A):A=t[84];let j;t[85]===a?j=t[86]:(j=(0,Q.jsx)(`footer`,{className:`border-t pt-5`,children:(0,Q.jsx)(`div`,{className:`-ml-2`,children:(0,Q.jsx)(z,{variant:`link`,size:`sm`,onClick:()=>a.onOpen({kind:`walkthrough-changes`}),children:`See every changed file`})})}),t[85]=a,t[86]=j);let M;t[87]===u?M=t[88]:(M=(0,Q.jsx)(Qn,{owner:u}),t[87]=u,t[88]=M);let N;return t[89]!==C||t[90]!==w||t[91]!==T||t[92]!==D||t[93]!==O||t[94]!==A||t[95]!==j||t[96]!==M?(N=(0,Q.jsxs)(ir,{children:[C,w,T,D,O,A,j,M]}),t[89]=C,t[90]=w,t[91]=T,t[92]=D,t[93]=O,t[94]=A,t[95]=j,t[96]=M,t[97]=N):N=t[97],N}function vr(e){return e.title}function yr(e){let t=(0,Z.c)(6),{waiting:n,onWrite:r}=e,i,a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Q.jsx)(`h1`,{className:`text-subpage-title font-semibold tracking-tight @3xl:text-page-title`,children:`No walkthrough yet.`}),a=(0,Q.jsx)(`p`,{className:`text-prose text-foreground-2`,children:`A fresh agent reads this change and explains it. It never edits the code.`}),t[0]=i,t[1]=a):(i=t[0],a=t[1]);let o;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,Q.jsx)(Ge,{"data-icon":`inline-start`}),t[2]=o):o=t[2];let s;return t[3]!==r||t[4]!==n?(s=(0,Q.jsx)(ir,{children:(0,Q.jsxs)(`header`,{className:`flex flex-col items-start gap-3`,children:[i,a,(0,Q.jsxs)(z,{disabled:n,onClick:r,children:[o,`Write walkthrough`]})]})}),t[3]=r,t[4]=n,t[5]=s):s=t[5],s}function br(e){let t=(0,Z.c)(7),{run:n}=e,r;t[0]===n?r=t[1]:(r=(0,Q.jsx)(ar,{run:n}),t[0]=n,t[1]=r);let i,a,o;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Q.jsxs)(`p`,{className:`flex items-center gap-2 text-prose text-foreground-2`,children:[(0,Q.jsx)(j,{}),`Reading the change`]}),a=(0,Q.jsx)(T,{className:`h-9 w-4/5`}),o=(0,Q.jsx)(T,{className:`h-20 w-full`}),t[2]=i,t[3]=a,t[4]=o):(i=t[2],a=t[3],o=t[4]);let s;return t[5]===r?s=t[6]:(s=(0,Q.jsx)(ir,{children:(0,Q.jsxs)(`header`,{role:`status`,className:`flex flex-col gap-3`,children:[r,i,a,o]})}),t[5]=r,t[6]=s),s}function xr(e){let t=(0,Z.c)(14),{run:n,failure:r,waiting:i,onRetry:a}=e,o;t[0]!==r||t[1]!==n?(o=hn(r,n),t[0]=r,t[1]=n,t[2]=o):o=t[2];let s=o,c;t[3]===s.title?c=t[4]:(c=(0,Q.jsx)(`h1`,{className:`text-subpage-title font-semibold tracking-tight`,children:s.title}),t[3]=s.title,t[4]=c);let l;t[5]===s.message?l=t[6]:(l=s.message&&(0,Q.jsx)(`p`,{className:`text-prose text-foreground-2`,children:s.message}),t[5]=s.message,t[6]=l);let u;t[7]!==a||t[8]!==i?(u=(0,Q.jsx)(z,{disabled:i,onClick:a,children:`Try again`}),t[7]=a,t[8]=i,t[9]=u):u=t[9];let d;return t[10]!==c||t[11]!==l||t[12]!==u?(d=(0,Q.jsx)(ir,{children:(0,Q.jsxs)(`header`,{className:`flex flex-col items-start gap-3`,children:[c,l,u]})}),t[10]=c,t[11]=l,t[12]=u,t[13]=d):d=t[13],d}function Sr(e){let t=(0,Z.c)(11),{result:n,phase:i,refresh:a}=bn(e.scope,e.context),o=On(e.scope,e.context,e.base,i&&i.kind!==`unwritten`?i.run:void 0);if(i===void 0){let e;return t[0]!==a||t[1]!==n?(e=B(n)?(0,Q.jsx)(S,{description:`The walkthrough could not be read.`,onRetry:a}):(0,Q.jsx)(r,{label:`Loading walkthrough`}),t[0]=a,t[1]=n,t[2]=e):e=t[2],e}let s;t[3]!==i||t[4]!==e||t[5]!==o?(s=()=>{let t=o.failure&&(i.kind===`unwritten`||i.kind===`failed`)?o.failure:void 0;if(t)return(0,Q.jsx)(xr,{run:i.kind===`failed`?i.run:void 0,failure:t,waiting:o.waiting,onRetry:o.start});switch(i.kind){case`unwritten`:return(0,Q.jsx)(yr,{waiting:o.waiting,onWrite:o.start});case`writing`:return(0,Q.jsx)(br,{run:i.run});case`failed`:return(0,Q.jsx)(xr,{run:i.run,failure:i.failure,waiting:o.waiting,onRetry:o.start});case`ready`:{let t=gn(i,o);return(0,Q.jsx)(_r,{run:i.run,content:i.content,outOfDate:i.outOfDate,props:e,onUpdate:o.start,updating:t.updating,updateFailure:t.failure},i.run.id)}}},t[3]=i,t[4]=e,t[5]=o,t[6]=s):s=t[6];let c=s,l;t[7]===c?l=t[8]:(l=c(),t[7]=c,t[8]=l);let u;return t[9]===l?u=t[10]:(u=(0,Q.jsx)(`div`,{className:`@container h-full overflow-auto`,children:l}),t[9]=l,t[10]=u),u}function Cr(e){let t=(0,Z.c)(14),{steps:n,activeEntry:r,onOpen:i,row:a}=e,[o,s]=(0,X.useState)(null);if(n.length===0)return null;let c;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,Q.jsx)(`p`,{className:`px-2 pt-2 pb-1 text-2xs text-muted-foreground`,children:`By step`}),t[0]=c):c=t[0];let l;if(t[1]!==r||t[2]!==i||t[3]!==o||t[4]!==a||t[5]!==n){let e;t[7]!==r||t[8]!==i||t[9]!==o||t[10]!==a?(e=e=>{let{stop:t,step:n,files:c}=e,l={kind:`walkthrough-step`,step:n},u=r===Ue(l);return(0,Q.jsxs)(`div`,{className:`flex flex-col`,children:[(0,Q.jsxs)(We,{plain:!0,label:`Step ${n}`,active:u,onOpen:()=>{s(n),i(l)},children:[(0,Q.jsx)(`span`,{className:`w-3.5 shrink-0 text-center font-mono text-2xs text-muted-foreground`,children:n}),(0,Q.jsx)(pe,{className:`min-w-0 flex-1`,text:At(t.title)}),t.attention&&(0,Q.jsx)(`span`,{role:`img`,"aria-label":`Your call`,className:`size-1.5 shrink-0 rounded-full bg-foreground`}),(0,Q.jsx)(`span`,{className:`ml-auto text-2xs text-muted-foreground tabular-nums`,children:c.length})]}),(o===n||u)&&(0,Q.jsx)(`div`,{className:`pl-3`,children:c.map(a)})]},n)},t[7]=r,t[8]=i,t[9]=o,t[10]=a,t[11]=e):e=t[11],l=n.map(e),t[1]=r,t[2]=i,t[3]=o,t[4]=a,t[5]=n,t[6]=l}else l=t[6];let u;return t[12]===l?u=t[13]:(u=(0,Q.jsxs)(`div`,{className:`mt-1 flex flex-col`,children:[c,l]}),t[12]=l,t[13]=u),u}function wr(e){let t=(0,Z.c)(6),{files:n,row:r}=e;if(n.length===0)return null;let i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Q.jsx)(`p`,{className:`px-2 pt-2 pb-1 text-2xs text-muted-foreground`,children:`Not in the walkthrough yet`}),t[0]=i):i=t[0];let a;t[1]!==n||t[2]!==r?(a=n.map(r),t[1]=n,t[2]=r,t[3]=a):a=t[3];let o;return t[4]===a?o=t[5]:(o=(0,Q.jsxs)(`div`,{className:`mt-1 flex flex-col`,children:[i,a]}),t[4]=a,t[5]=o),o}function Tr(e){let t=(0,Z.c)(22),{scope:n,context:r,items:i,row:a,activeEntry:o,onOpen:s}=e,c=xn(n,r);if(!c||c.content.stops.length===0){let e;t[0]!==i||t[1]!==a?(e=i.map(a),t[0]=i,t[1]=a,t[2]=e):e=t[2];let n;return t[3]===e?n=t[4]:(n=(0,Q.jsx)(Q.Fragment,{children:e}),t[3]=e,t[4]=n),n}let l,u,d;t[5]!==i||t[6]!==c.content?(u=xt(c.content,i),l=Cr,d=u.steps.filter(Er),t[5]=i,t[6]=c.content,t[7]=l,t[8]=u,t[9]=d):(l=t[7],u=t[8],d=t[9]);let f;t[10]!==l||t[11]!==o||t[12]!==s||t[13]!==a||t[14]!==d?(f=(0,Q.jsx)(l,{steps:d,activeEntry:o,onOpen:s,row:a}),t[10]=l,t[11]=o,t[12]=s,t[13]=a,t[14]=d,t[15]=f):f=t[15];let p;t[16]!==u.outside||t[17]!==a?(p=(0,Q.jsx)(wr,{files:u.outside,row:a}),t[16]=u.outside,t[17]=a,t[18]=p):p=t[18];let m;return t[19]!==f||t[20]!==p?(m=(0,Q.jsxs)(Q.Fragment,{children:[f,p]}),t[19]=f,t[20]=p,t[21]=m):m=t[21],m}function Er(e){return e.files.length>0}function Dr(e){let t=(0,Z.c)(38),{scope:n,context:r,base:i,paths:a,row:o,activeEntry:s,onOpen:c}=e,l=xn(n,r),u=Sn(n,r,i);if(a.length===0){let e=l?`Nothing uncommitted.`:`No changes`,n;return t[0]===e?n=t[1]:(n=(0,Q.jsx)(`p`,{className:`p-3 text-sm text-muted-foreground`,children:e}),t[0]=e,t[1]=n),n}let d;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(d=Ue(Ye),t[2]=d):d=t[2];let f=s===d,p;t[3]===c?p=t[4]:(p=()=>c(Ye),t[3]=c,t[4]=p);let m,h;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,Q.jsx)(ge,{className:`size-3.5 shrink-0 text-muted-foreground`}),h=(0,Q.jsx)(`span`,{className:`min-w-0 flex-1`,children:`All changes`}),t[5]=m,t[6]=h):(m=t[5],h=t[6]);let g;t[7]===a.length?g=t[8]:(g=(0,Q.jsx)(`span`,{className:`ml-auto text-2xs text-muted-foreground tabular-nums`,children:a.length}),t[7]=a.length,t[8]=g);let _;t[9]!==f||t[10]!==p||t[11]!==g?(_=(0,Q.jsxs)(We,{plain:!0,label:`All changes`,active:f,onOpen:p,children:[m,h,g]}),t[9]=f,t[10]=p,t[11]=g,t[12]=_):_=t[12];let v=_;if(!l||l.content.stops.length===0){let e;t[13]!==a||t[14]!==o?(e=a.map(o),t[13]=a,t[14]=o,t[15]=e):e=t[15];let n;return t[16]!==v||t[17]!==e?(n=(0,Q.jsxs)(`div`,{className:`flex flex-col`,children:[v,e]}),t[16]=v,t[17]=e,t[18]=n):n=t[18],n}let y,b;if(t[19]!==a||t[20]!==l.content||t[21]!==u){let e=a.map(kr);y=xt(l.content,e,u),b=y.steps.filter(Or),t[19]=a,t[20]=l.content,t[21]=u,t[22]=y,t[23]=b}else y=t[22],b=t[23];let x=b,S;t[24]!==s||t[25]!==c||t[26]!==o||t[27]!==x?(S=x.length>0&&(0,Q.jsx)(Cr,{steps:x,activeEntry:s,onOpen:c,row:e=>o(e.path)}),t[24]=s,t[25]=c,t[26]=o,t[27]=x,t[28]=S):S=t[28];let C;t[29]===o?C=t[30]:(C=e=>o(e.path),t[29]=o,t[30]=C);let w;t[31]!==y.outside||t[32]!==C?(w=(0,Q.jsx)(wr,{files:y.outside,row:C}),t[31]=y.outside,t[32]=C,t[33]=w):w=t[33];let T;return t[34]!==v||t[35]!==w||t[36]!==S?(T=(0,Q.jsxs)(`div`,{className:`flex flex-col`,children:[v,S,w]}),t[34]=v,t[35]=w,t[36]=S,t[37]=T):T=t[37],T}function Or(e){return e.files.length>0}function kr(e){return{path:e}}var Ar={branch:Tr,uncommitted:Dr};function jr(e){let t=(0,Z.c)(2),n;return t[0]===e?n=t[1]:(n=(0,Q.jsx)(Ze,{...e,grouping:Ar}),t[0]=e,t[1]=n),n}function Mr(e){let t=(0,Z.c)(45),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=xn(r.scope,r.context),o=Sn(r.scope,r.context,r.base),s=n.kind===`walkthrough-step`?n.step:void 0,c=s===void 0?void 0:i?.content.stops[s-1];if(!i||n.kind===`walkthrough-step`&&!c){let e;return t[3]===r?e=t[4]:(e=(0,Q.jsx)(me,{title:`This step isn't available`,description:`The walkthrough changed since this tab was opened. Open the Walkthrough tab for the current steps.`,children:(0,Q.jsx)(z,{variant:`outline`,onClick:()=>r.onOpen({kind:`walkthrough`}),children:`Open walkthrough`})}),t[3]=r,t[4]=e),e}if(s===void 0||c===void 0){let e;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(e={title:`All changes`,titleLabel:`All changes`},t[5]=e):e=t[5];let n;return t[6]===r?n=t[7]:(n=(0,Q.jsx)(Nr,{...r,heading:e}),t[6]=r,t[7]=n),n}let l=i.content.stops.length,u=`Step ${s} of ${l}`,d;t[8]===u?d=t[9]:(d=(0,Q.jsx)(`span`,{className:`mr-2 font-normal text-muted-foreground`,children:u}),t[8]=u,t[9]=d);let f;t[10]===c.title?f=t[11]:(f=(0,Q.jsx)($,{text:c.title}),t[10]=c.title,t[11]=f);let p;t[12]!==d||t[13]!==f?(p=(0,Q.jsxs)(Q.Fragment,{children:[d,f]}),t[12]=d,t[13]=f,t[14]=p):p=t[14];let m;t[15]===c.title?m=t[16]:(m=At(c.title),t[15]=c.title,t[16]=m);let h=`${u}: ${m}`,g;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,Q.jsx)(ct,{}),t[17]=g):g=t[17];let _=s===1,v;t[18]!==r||t[19]!==s?(v=()=>r.onOpen({kind:`walkthrough-step`,step:s-1}),t[18]=r,t[19]=s,t[20]=v):v=t[20];let y;t[21]!==_||t[22]!==v?(y=(0,Q.jsx)($n,{label:`Previous step`,icon:g,disabled:_,onClick:v}),t[21]=_,t[22]=v,t[23]=y):y=t[23];let b;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,Q.jsx)(a,{}),t[24]=b):b=t[24];let x=s===l,S;t[25]!==r||t[26]!==s?(S=()=>r.onOpen({kind:`walkthrough-step`,step:s+1}),t[25]=r,t[26]=s,t[27]=S):S=t[27];let C;t[28]!==x||t[29]!==S?(C=(0,Q.jsx)($n,{label:`Next step`,icon:b,disabled:x,onClick:S}),t[28]=x,t[29]=S,t[30]=C):C=t[30];let w;t[31]!==C||t[32]!==y?(w=(0,Q.jsxs)(`span`,{className:`flex items-center`,children:[y,C]}),t[31]=C,t[32]=y,t[33]=w):w=t[33];let T;t[34]!==w||t[35]!==p||t[36]!==h?(T={title:p,titleLabel:h,after:w},t[34]=w,t[35]=p,t[36]=h,t[37]=T):T=t[37];let E=T,D;t[38]!==o||t[39]!==c?(D=vt(c,o),t[38]=o,t[39]=c,t[40]=D):D=t[40];let O=D,k;return t[41]!==E||t[42]!==O||t[43]!==r?(k=(0,Q.jsx)(Nr,{...r,only:O,heading:E}),t[41]=E,t[42]=O,t[43]=r,t[44]=k):k=t[44],k}function Nr(e){let t=(0,Z.c)(9),n=we(e.scope,e.context.connection),[r,i]=(0,X.useState)(`branch`),a;t[0]!==n.changes||t[1]!==r||t[2]!==e?(a=t=>{let{branch:a,worktree:o}=Mt({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,Q.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[s&&(0,Q.jsx)(at,{inline:!0,title:e.heading.title,titleLabel:e.heading.titleLabel,children:e.heading.after}),(0,Q.jsxs)(`div`,{className:s?`min-h-0 flex-1 overflow-auto`:`flex min-h-0 flex-1 flex-col`,children:[a.length>0&&(0,Q.jsx)(`section`,{"aria-label":`Branch code`,className:`flex min-h-0 flex-1 flex-col`,onFocusCapture:()=>i(`branch`),onPointerDownCapture:()=>i(`branch`),children:(0,Q.jsx)(Qe,{...e,only:a,fullHeight:s,interaction:c(`branch`),heading:s?{title:`Branch`,titleLabel:`Branch`}:e.heading})}),o.length>0&&(0,Q.jsx)(`section`,{"aria-label":`Uncommitted code`,className:`flex min-h-0 flex-1 flex-col`,onFocusCapture:()=>i(`uncommitted`),onPointerDownCapture:()=>i(`uncommitted`),children:(0,Q.jsx)(Ke,{...e,only:o,fullHeight:s,interaction:c(`uncommitted`),heading:s?{title:`Uncommitted`,titleLabel:`Uncommitted`}:e.heading})}),a.length===0&&o.length===0&&(0,Q.jsx)(me,{title:`No changed files`,description:`These files no longer have changes in the branch or working tree.`})]})]})},t[0]=n.changes,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,Q.jsx)(qe,{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}function Pr(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,Q.jsx)(Fr,{...e}),t[3]=e,t[4]=r);let i;return t[5]!==e.context.connection||t[6]!==n||t[7]!==r?(i=(0,Q.jsx)(it,{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 Fr(e){let t=(0,Z.c)(15),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=wn(r,e.context),a=i.name===`walkthrough`,o=Cn(r,e.context),s=a||e.search.entry===`walkthrough`?o:`Changes`,c;t[3]!==e.worktree.id||t[4]!==s?(c=nt({worktreeId:e.worktree.id,title:s}),t[3]=e.worktree.id,t[4]=s,t[5]=c):c=t[5],h(c);let l=a?`Walkthrough`:void 0,u;t[6]!==l||t[7]!==i.companion||t[8]!==i.guided||t[9]!==i.pending?(u={title:l,pending:i.pending,guided:i.guided,companion:i.companion},t[6]=l,t[7]=i.companion,t[8]=i.guided,t[9]=i.pending,t[10]=u):u=t[10];let d=u,f=i.guided?jr:Ze,p;return t[11]!==d||t[12]!==e||t[13]!==f?(p=(0,Q.jsx)(tt,{...e,walkthrough:Sr,changesNavigation:f,walkthroughCode:Mr,firstDocument:d}),t[11]=d,t[12]=e,t[13]=f,t[14]=p):p=t[14],p}function Ir(e){let t=(0,Z.c)(2),n;t[0]===e?n=t[1]:(n=v(e),t[0]=e,t[1]=n),h(n)}function Lr(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=g(`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,Q.jsx)(n,{className:`size-5`}),t[2]=n,t[3]=o);let s;return t[4]!==a||t[5]!==o?(s=(0,Q.jsx)(`span`,{"aria-hidden":`true`,className:a,children:o}),t[4]=a,t[5]=o,t[6]=s):s=t[6],s}function Rr(e){let t=(0,Z.c)(4),{keys:n}=e,r;t[0]===n?r=t[1]:(r=n.split(`+`).map(zr),t[0]=n,t[1]=r);let i;return t[2]===r?i=t[3]:(i=(0,Q.jsx)(xe,{children:r}),t[2]=r,t[3]=i),i}function zr(e){return(0,Q.jsx)(K,{className:`min-w-6 justify-center`,children:Y(e)},e)}function Br(e){let t=(0,Z.c)(6),{open:n,onOpenChange:r}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Q.jsx)(Lr,{icon:q}),t[0]=i):i=t[0];let a;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Q.jsxs)(je,{className:`flex-row items-center text-left`,children:[i,(0,Q.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[(0,Q.jsx)(Me,{children:`Keyboard shortcuts`}),(0,Q.jsx)(Ne,{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,Q.jsxs)(Ee,{className:`max-h-[85svh] grid-rows-[auto_minmax(0,1fr)] overflow-hidden sm:max-w-xl`,children:[a,(0,Q.jsx)(Ce,{className:`-mr-3 min-h-0`,children:(0,Q.jsx)(`div`,{className:`flex flex-col gap-5 pr-3`,children:Re.map(Vr)})})]}),t[2]=o):o=t[2];let s;return t[3]!==r||t[4]!==n?(s=(0,Q.jsx)(G,{open:n,onOpenChange:r,children:o}),t[3]=r,t[4]=n,t[5]=s):s=t[5],s}function Vr(e){return(0,Q.jsxs)(`section`,{"aria-labelledby":`shortcuts-${e.title}`,children:[(0,Q.jsx)(`h3`,{id:`shortcuts-${e.title}`,className:`mb-1 text-xs font-medium tracking-wide text-muted-foreground uppercase`,children:e.title}),(0,Q.jsx)(`dl`,{className:`divide-y rounded-xl border`,children:e.items.map(Hr)})]},e.title)}function Hr(e){return(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-4 px-3 py-2`,children:[(0,Q.jsx)(`dt`,{className:`text-sm`,children:e.label}),(0,Q.jsx)(`dd`,{className:`shrink-0`,children:(0,Q.jsx)(Rr,{keys:e.keys})})]},e.keys)}var Ur={"not-found":{title:`Page not found`,description:`This URL does not open a page in Porcelain.`,icon:ut},"missing-worktree":{title:`Worktree not found`,description:`This URL has an invalid or unavailable worktree ID.`,icon:ft},empty:{title:`Select a worktree`,description:`Choose one on the left to open its review.`,icon:ge}};function Wr(e){let t=(0,Z.c)(111),{review:r,remote:i,unavailable:a,notice:o,children:s,settingsOpen:c}=e,l=c!==void 0&&c,u=Ie(),[f,h]=(0,X.useState)(!1),[_,v]=(0,X.useState)(!1),{setOpenMobile:y,isMobile:S,open:C,openMobile:w}=re(),T;t[0]===y?T=t[1]:(T=(e,t)=>{h(!e&&t.reason===`escape-key`),y(e)},t[0]=y,t[1]=T);let E;t[2]!==u||t[3]!==f?(E=e=>{!e&&f&&(h(!1),u.element?.focus())},t[2]=u,t[3]=f,t[4]=E):E=t[4];let D;t[5]!==T||t[6]!==E?(D={onOpenChange:T,onOpenChangeComplete:E},t[5]=T,t[6]=E,t[7]=D):D=t[7];let A=D,j=O(),N=x(),ee=b(),ne=De(ee.connection),P,F,I,L,R;if(t[8]!==ne||t[9]!==o){L=te(ne,k(ne)?.id),F=!o&&ne.projects.length===0;let e;t[15]!==F||t[16]!==o?(e=F?{title:`Open your first project`,description:`Open a Git repository to see its worktrees and review changes.`,icon:ge}:Ur[o??`empty`],t[15]=F,t[16]=o,t[17]=e):e=t[17],I=e,P=I.icon,R=se(L?.worktree.branch||void 0),t[8]=ne,t[9]=o,t[10]=P,t[11]=F,t[12]=I,t[13]=L,t[14]=R}else P=t[10],F=t[11],I=t[12],L=t[13],R=t[14];let ie=R;ae();let oe=b(i?.connection),B=i?.remote.environmentId??null,ce;t[18]!==r||t[19]!==B?(ce=r&&{remote:B,projectId:r.selection.projectId,worktreeId:r.selection.worktree.id},t[18]=r,t[19]=B,t[20]=ce):ce=t[20];let V=ce,le=r?.selection.worktree.id??``,ue;t[21]===le?ue=t[22]:(ue=Je(le),t[21]=le,t[22]=ue);let de=d(ue),H;t[23]!==de||t[24]!==i||t[25]!==r?(H=r?ot({firstDocument:de,entry:r.search.entry,surface:r.search.surface,project:r.inventory.projects.find(e=>e.id===r.selection.projectId)?.name,environment:i||r.inventory.environment.custom?r.inventory.environment.name:void 0}):`Porcelain`,t[23]=de,t[24]=i,t[25]=r,t[26]=H):H=t[26],Ir(H);let fe;t[27]!==j||t[28]!==r?(fe=e=>j({...rt(e),replace:r===void 0}),t[27]=j,t[28]=r,t[29]=fe):fe=t[29];let U=fe,W=et(ee.connection,U),he;t[30]!==j||t[31]!==y?(he=e=>{let t=e===void 0?Ae:e;y(!1),j({to:`/settings/$section`,params:{section:t}})},t[30]=j,t[31]=y,t[32]=he):he=t[32];let G=he,K;t[33]!==ee.connection||t[34]!==j||t[35]!==r?.search||t[36]!==y||t[37]!==V?(K=e=>{if(e.pullRequest.state!==`available`||!e.pullRequest.number)return;let t=Ue({kind:`pull-request`,projectId:e.projectId,number:e.pullRequest.number,environmentId:e.environmentId});y(!1);let n=V??(e.worktreeId?{remote:e.environmentId===ee.connection.environmentId?null:e.environmentId,projectId:e.projectId,worktreeId:e.worktreeId}:void 0);n&&j({...rt(n),search:{...r?.search??{},entry:t}})},t[33]=ee.connection,t[34]=j,t[35]=r?.search,t[36]=y,t[37]=V,t[38]=K):K=t[38];let q;t[39]===W?q=t[40]:(q=e=>e?Te.openWithPayload({remote:e.remote.environmentId}):W(),t[39]=W,t[40]=q);let _e;t[41]===G?_e=t[42]:(_e=()=>G(),t[41]=G,t[42]=_e);let ve;t[43]!==j||t[44]!==y?(ve=e=>{y(!1),j({to:`/settings/$section/$environmentId`,params:{section:`computers`,environmentId:e}})},t[43]=j,t[44]=y,t[45]=ve):ve=t[45];let ye;t[46]===Symbol.for(`react.memo_cache_sentinel`)?(ye=()=>v(!0),t[46]=ye):ye=t[46];let be;t[47]!==l||t[48]!==V||t[49]!==void 0||t[50]!==K||t[51]!==q||t[52]!==_e||t[53]!==ve?(be={settingsOpen:l,remotes:void 0,selected:V,onOpenPullRequest:K,onOpenProject:q,onOpenSettings:_e,onOpenRemotes:ve,onOpenShortcuts:ye},t[47]=l,t[48]=V,t[49]=void 0,t[50]=K,t[51]=q,t[52]=_e,t[53]=ve,t[54]=be):be=t[54];let J=be,xe;t[55]!==j||t[56]!==N||t[57]!==V?(xe=(e,t)=>{if(!V)return;let n=rt(V);N.buildLocation({}).pathname===N.buildLocation(n).pathname&&j({...n,search:t=>({...t,...e}),...t})},t[55]=j,t[56]=N,t[57]=V,t[58]=xe):xe=t[58];let Se=xe,Ce;t[59]===G?Ce=t[60]:(Ce=()=>G(),t[59]=G,t[60]=Ce);let we;t[61]===Symbol.for(`react.memo_cache_sentinel`)?(we={ignoreInputs:!0},t[61]=we):we=t[61],Ve(Be.openSettings,Ce,we);let Ee,Oe;t[62]===Symbol.for(`react.memo_cache_sentinel`)?(Ee=()=>v(!0),Oe={ignoreInputs:!0},t[62]=Ee,t[63]=Oe):(Ee=t[62],Oe=t[63]),Ve(Be.openShortcuts,Ee,Oe);let je;t[64]!==s||t[65]!==u?(je=typeof s==`function`?s(u):s,t[64]=s,t[65]=u,t[66]=je):je=t[66];let Me=je,Ne;t[67]!==S||t[68]!==A||t[69]!==J||t[70]!==U||t[71]!==y?(Ne=S&&(0,Q.jsx)(M,{variant:`floating`,...A,children:(0,Q.jsx)(Fe,{...J,onSelect:e=>{U(e),y(!1)}})}),t[67]=S,t[68]=A,t[69]=J,t[70]=U,t[71]=y,t[72]=Ne):Ne=t[72];let Pe;t[73]===U?Pe=t[74]:(Pe=e=>void U(e),t[73]=U,t[74]=Pe);let Le;t[75]!==J||t[76]!==Pe?(Le={...J,onSelect:Pe},t[75]=J,t[76]=Pe,t[77]=Le):Le=t[77];let Re;t[78]!==P||t[79]!==Me||t[80]!==oe||t[81]!==F||t[82]!==S||t[83]!==I.description||t[84]!==I.title||t[85]!==u||t[86]!==J||t[87]!==o||t[88]!==Se||t[89]!==C||t[90]!==W||t[91]!==w||t[92]!==L||t[93]!==ie||t[94]!==i||t[95]!==r||t[96]!==y||t[97]!==B||t[98]!==a?(Re=Me??(r?(0,Q.jsx)(Pr,{navigationTrigger:u,worktree:r.selection.worktree,projectId:r.selection.projectId,search:r.search,onSearch:Se,context:oe},`${B??``}:${r.selection.worktree.id}`):(0,Q.jsx)(Gr,{navigationTrigger:u,isMobile:S,open:C,openMobile:w,children:i&&a?(0,Q.jsx)(m,{name:i.remote.name,status:a,onOpenRemotes:()=>J.onOpenRemotes(i.remote.environmentId)}):(0,Q.jsxs)(me,{title:I.title,description:I.description,icon:(0,Q.jsx)(P,{}),children:[F&&(0,Q.jsx)(z,{variant:`outline`,onClick:()=>{y(!1),W()},children:`Open project`}),!o&&L&&(0,Q.jsxs)(`div`,{className:`flex w-full min-w-0 flex-col gap-2`,children:[(0,Q.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`First that needs you`}),(0,Q.jsx)(p,{className:`flex min-w-0 flex-col rounded-lg border p-3 text-ui hover:bg-accent`,to:`/$projectId/$worktreeId`,params:{projectId:L.projectId,worktreeId:L.worktree.id},children:(0,Q.jsx)(pe,{text:ie,className:`font-medium`})})]}),o===`missing-worktree`&&L&&(0,Q.jsx)(p,{className:g(n()),to:`/$projectId/$worktreeId`,params:{projectId:L.projectId,worktreeId:L.worktree.id},children:`Open available worktree`}),o&&(0,Q.jsx)(p,{className:g(n({variant:`outline`})),to:`/`,search:{},children:`Back to workspace`})]})})),t[78]=P,t[79]=Me,t[80]=oe,t[81]=F,t[82]=S,t[83]=I.description,t[84]=I.title,t[85]=u,t[86]=J,t[87]=o,t[88]=Se,t[89]=C,t[90]=W,t[91]=w,t[92]=L,t[93]=ie,t[94]=i,t[95]=r,t[96]=y,t[97]=B,t[98]=a,t[99]=Re):Re=t[99];let ze;t[100]!==S||t[101]!==C||t[102]!==Le||t[103]!==Re?(ze=(0,Q.jsx)(ke,{navigator:Le,isMobile:S,open:C,children:Re}),t[100]=S,t[101]=C,t[102]=Le,t[103]=Re,t[104]=ze):ze=t[104];let Y;t[105]===_?Y=t[106]:(Y=(0,Q.jsx)(Br,{open:_,onOpenChange:v}),t[105]=_,t[106]=Y);let He;return t[107]!==Ne||t[108]!==ze||t[109]!==Y?(He=(0,Q.jsxs)(Q.Fragment,{children:[Ne,ze,Y]}),t[107]=Ne,t[108]=ze,t[109]=Y,t[110]=He):He=t[110],He}function Gr(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=ze(Le(Be.toggleNavigator,He())),t[2]=l):l=t[2];let u;t[3]!==s||t[4]!==c?(u=(0,Q.jsx)(V,{render:(0,Q.jsx)(L,{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,Q.jsxs)(P,{side:`right`,children:[`Toggle sidebar`,(0,Q.jsx)(K,{children:Y(Be.toggleNavigator)})]}),t[6]=d):d=t[6];let f;t[7]===u?f=t[8]:(f=(0,Q.jsxs)(H,{children:[u,d]}),t[7]=u,t[8]=f);let p;return t[9]!==o||t[10]!==f?(p=(0,Q.jsxs)(`div`,{className:`relative grid h-full min-h-0 place-items-center rounded-paper border bg-card p-8`,children:[f,o]}),t[9]=o,t[10]=f,t[11]=p):p=t[11],p}export{Ir as n,Wr as t};