@wjarka/cezarion 0.18.0-dev.7847 → 0.18.0-dev.7864

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 (33) hide show
  1. package/package.json +2 -2
  2. package/web/dist/assets/{activity-motion-CUiNY01w.js → activity-motion-Djgfr4BR.js} +1 -1
  3. package/web/dist/assets/{activity-route-Cz-rvbZ2.js → activity-route-CLmY_b61.js} +1 -1
  4. package/web/dist/assets/{chunk-BO2N2NFS-CM5F_Wdn.js → chunk-BO2N2NFS-y7WHTKOf.js} +4 -4
  5. package/web/dist/assets/{commit-diff-panel-DMI0GCL1.js → commit-diff-panel-D-oVsbVi.js} +1 -1
  6. package/web/dist/assets/{diff-DI4VzuYN.js → diff-B24jjrQd.js} +2 -2
  7. package/web/dist/assets/{diff-view-D_4gizCK.js → diff-view-Bm2zScMG.js} +1 -1
  8. package/web/dist/assets/{file-preview-Bi4gKafB.js → file-preview-BfjbLW39.js} +1 -1
  9. package/web/dist/assets/{git-toolbar-rD304H-0.js → git-toolbar-BrYOg59q.js} +1 -1
  10. package/web/dist/assets/{github-DZQgKb40.js → github-Bz9XYDMM.js} +1 -1
  11. package/web/dist/assets/{global-activity-route-DlY7H1rT.js → global-activity-route-BafNHfLS.js} +1 -1
  12. package/web/dist/assets/{highlighted-body-OFNGDK62-D2OLwPBs.js → highlighted-body-OFNGDK62-D62LjTH2.js} +1 -1
  13. package/web/dist/assets/{index-D4lUB-OA.js → index-WeSdteYZ.js} +3 -3
  14. package/web/dist/assets/markdown-twEr0qCN.js +4 -0
  15. package/web/dist/assets/mermaid-GHXKKRXX-C7OP146z.js +1 -0
  16. package/web/dist/assets/{preview-pane-connected-Dggh7YST.js → preview-pane-connected-Bo8pHl2j.js} +1 -1
  17. package/web/dist/assets/{repo-git-7kwazD3R.js → repo-git-DQWv--Qn.js} +1 -1
  18. package/web/dist/assets/{report-reader-Dg2ojBc_.js → report-reader-4oGG3Se7.js} +1 -1
  19. package/web/dist/assets/{reports-DaN1XZ5g.js → reports-DNerAT8g.js} +1 -1
  20. package/web/dist/assets/{run-header-GF37CaAZ.js → run-header-DeyjkCoC.js} +1 -1
  21. package/web/dist/assets/{skills-CXU7ZjvL.js → skills-C8MBWEQN.js} +1 -1
  22. package/web/dist/assets/{task-changes-BuVilcOg.js → task-changes-CQRx1eKQ.js} +1 -1
  23. package/web/dist/assets/{task-commits-DDWgrNtx.js → task-commits-B4ZCZUoh.js} +1 -1
  24. package/web/dist/assets/{task-files-D-vyiZrz.js → task-files-DFbWrnO0.js} +1 -1
  25. package/web/dist/assets/{task-github-item-DQHmhrMu.js → task-github-item-DX0X2N_q.js} +1 -1
  26. package/web/dist/assets/task-thread-B7dKPXaT.js +9 -0
  27. package/web/dist/assets/{thread-state-Cd3Q9ZdX.js → thread-state-Cq_aBDjM.js} +1 -1
  28. package/web/dist/assets/{use-hand-to-agent-state-DMy1raU0.js → use-hand-to-agent-state-DHEEAr6b.js} +1 -1
  29. package/web/dist/assets/{workflows-KeaSZ0DF.js → workflows-DmJXA1-k.js} +1 -1
  30. package/web/dist/index.html +1 -1
  31. package/web/dist/assets/markdown-doq86ner.js +0 -4
  32. package/web/dist/assets/mermaid-GHXKKRXX-DCw6rSYC.js +0 -1
  33. package/web/dist/assets/task-thread-CQN8oXtT.js +0 -9
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{l as r,t as i,u as a}from"./button-C1fD-ZFr.js";import{Dr as o,Er as s,Jt as c,Ln as l,Pt as u,nt as d,r as f,ti as p,tt as m,w as h}from"./project-scope-context-Dlbq88xo.js";import{A as g,At as _,E as v,Et as y,Ft as b,Kt as x,Q as S,Y as C,Yt as w,p as T,t as E}from"./queries-BtkCvBtK.js";import{t as D}from"./useQuery-D89BPQpm.js";import{a as O,o as k,r as A,tt as j}from"./use-desktop-NTwdvSZg.js";import{n as M}from"./toaster-Cxgzn9ip.js";import{s as N}from"./runners-M0-6Uumh.js";import{Y as ee,c as P,ct as F,ft as I,g as L,it as R,k as te,l as z,m as ne,ot as re,r as ie,tt as ae,u as oe,ut as se,y as ce}from"./design-icons-B6-0w7Aw.js";import{t as le}from"./eye-B8okNWXU.js";import{a as ue,i as B}from"./format-BNCkW110.js";import{t as de}from"./message-square-B-MD-8rD.js";import{t as fe}from"./play-CmVAj_fu.js";import{a as pe,i as me,o as he,r as ge,s as _e,t as ve}from"./dialog-DSwzMeY3.js";import{d as V,t as ye,y as H}from"./prompt-template-menu-DBFmXFq5.js";import{t as U}from"./project-router-CFmb6NlX.js";import{F as W,I as be,L as G,M as xe,P as Se,R as Ce,S as we,_ as Te,a as Ee,b as De,c as Oe,d as ke,f as Ae,g as je,n as Me,r as Ne,s as Pe,t as K,u as Fe,v as Ie,w as Le,x as Re}from"./picker-pill-B8HQMHMO.js";import{d as ze,f as q,i as Be,o as Ve,p as He,s as Ue,t as We,u as Ge}from"./skills-pM_PouEs.js";import{B as Ke,F as qe,L as Je,P as Ye,U as Xe,_n as Ze,z as Qe}from"./index-D4lUB-OA.js";import{t as $e}from"./markdown-doq86ner.js";import{t as et}from"./diff-DI4VzuYN.js";import{t as tt}from"./tab-link-B8m0q2sJ.js";var J=e(t(),1),Y=n(),nt={squash:`Squash and merge`,merge:`Create a merge commit`,rebase:`Rebase and merge`};function X({state:e}){let t=`size-4 shrink-0`;return e===`passing`?(0,Y.jsx)(P,{size:16,"aria-hidden":`true`,"data-slot":`gh-merge-status-passing`,className:r(t,`text-success`)}):e===`failing`?(0,Y.jsx)(L,{size:16,"aria-hidden":`true`,"data-slot":`gh-merge-status-failing`,className:r(t,`text-danger`)}):e===`pending`?(0,Y.jsx)(ue,{"aria-hidden":`true`,"data-slot":`gh-merge-status-pending`,className:r(t,`animate-spin text-warning`)}):(0,Y.jsx)(ne,{size:16,"aria-hidden":`true`,"data-slot":`gh-merge-status-unknown`,className:r(t,`text-soft-foreground`)})}function rt(e){return e?.available?e.mergeState:null}function it(e,t){return e&&t?.methods.includes(e)?e:t?.defaultMethod??t?.methods[0]??null}function at(e){return e.state===`merged`?`Merged`:e.state===`closed`?`Closed`:e.isDraft?`Draft`:e.mergeable===`conflicting`?`Conflicts must be resolved`:e.canMerge?`Ready to merge`:e.eligibility===`unknown`?`Merge blocked · Requirements unknown`:`Merge blocked`}function ot(e){return e===`approved`||e===`not-required`?`passing`:e===`unknown`?`unknown`:`failing`}function st(e){return e===`mergeable`?`passing`:e===`conflicting`?`failing`:`unknown`}function ct(e){return e===`conflicting`?`present`:e===`mergeable`?`none`:`unknown`}function lt(e){return e===!0?` · required`:e===null?` · requiredness unknown`:``}function ut(e){return e?.available===!1?e.reason:`GitHub could not load merge requirements.`}function dt(e,t,n){return!!(e&&(t.canMerge||t.canOverride&&n))}function Z(e){return e?nt[e]:`Merge`}function ft(e){return e===`conflicting`?`true`:void 0}function pt({check:e}){return(0,Y.jsxs)(`li`,{className:`flex items-center justify-between gap-3`,children:[(0,Y.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,Y.jsx)(X,{state:e.state}),(0,Y.jsxs)(`span`,{children:[e.name,` · `,e.state,lt(e.required)]})]}),e.url&&a(e.url)?(0,Y.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,className:`text-muted-foreground underline`,children:`details`}):null]})}function mt({reason:e}){return(0,Y.jsxs)(`section`,{"data-slot":`gh-merge-unavailable`,className:`mt-6 rounded-lg border border-border bg-card p-4 text-sm`,children:[(0,Y.jsx)(`p`,{className:`font-medium`,children:`Merge status unavailable`}),(0,Y.jsx)(`p`,{className:`mt-1 text-xs text-soft-foreground`,children:e})]})}function ht({state:e,selectedMethod:t,overrideRules:n,mergeEnabled:a,refreshPending:o,onRefresh:s,onRunAgent:c,onConfirm:l,onMethodChange:u,onOverrideChange:d}){let f=at(e),p=ot(e.reviewDecision),m=st(e.mergeable);return(0,Y.jsxs)(`div`,{className:`flex items-start gap-3`,children:[e.canMerge?(0,Y.jsx)(P,{size:16,"aria-hidden":`true`,className:`mt-0.5 size-5 shrink-0 text-success`}):(0,Y.jsx)(re,{size:16,"aria-hidden":`true`,className:`mt-0.5 size-5 shrink-0 text-warning`}),(0,Y.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,Y.jsx)(`h3`,{className:`font-semibold`,children:f}),(0,Y.jsxs)(i,{type:`button`,variant:`ghost`,size:`sm`,disabled:o,onClick:s,children:[(0,Y.jsx)(ee,{size:16,"aria-hidden":`true`,className:r(`size-3.5`,o&&`animate-spin`)}),`Refresh`]})]}),(0,Y.jsxs)(`p`,{className:`mt-1 font-mono text-[11px] text-soft-foreground`,children:[e.headRef,` (`,e.headSha.slice(0,7),`) → `,e.baseRef]}),(0,Y.jsxs)(`ul`,{className:`mt-3 space-y-2 text-xs`,children:[(0,Y.jsxs)(`li`,{className:`flex items-center gap-2`,children:[(0,Y.jsx)(X,{state:p}),(0,Y.jsxs)(`span`,{children:[`Reviews: `,e.reviewDecision.replaceAll(`-`,` `)]})]}),(0,Y.jsxs)(`li`,{className:`flex items-center gap-2`,children:[(0,Y.jsx)(X,{state:m}),(0,Y.jsxs)(`span`,{children:[`Conflicts: `,ct(e.mergeable)]})]}),e.checks.length===0?(0,Y.jsx)(`li`,{children:`No checks configured`}):e.checks.map(e=>(0,Y.jsx)(pt,{check:e},e.name)),e.blockers.map(e=>(0,Y.jsx)(`li`,{className:`text-soft-foreground`,children:e.message},e.code))]}),e.mergeable===`conflicting`&&c?(0,Y.jsx)(i,{className:`mt-4`,onClick:c,children:`Run agent on this PR`}):null,e.canOverride?(0,Y.jsxs)(`label`,{className:`mt-4 flex cursor-pointer items-start gap-2 rounded-md border border-warning/40 bg-warning/5 p-3 text-xs`,children:[(0,Y.jsx)(`input`,{type:`checkbox`,checked:n,onChange:e=>d(e.target.checked),className:`mt-0.5 size-4 accent-accent-strong`}),(0,Y.jsxs)(`span`,{children:[(0,Y.jsx)(`span`,{className:`block font-medium`,children:`Merge without waiting for requirements`}),(0,Y.jsx)(`span`,{className:`mt-0.5 block text-soft-foreground`,children:`GitHub will allow this only if your permissions can bypass the repository rules.`})]})]}):null,e.eligibility===`unknown`?(0,Y.jsx)(`p`,{className:`mt-4 text-xs text-muted-foreground`,children:`GitHub could not confirm review and branch-protection requirements. Passing checks do not establish merge readiness.`}):null,e.state===`open`&&e.methods.length>0?(0,Y.jsxs)(`div`,{className:`mt-4 flex flex-col flex-wrap gap-2 sm:flex-row`,children:[(0,Y.jsx)(`select`,{"aria-label":`Merge method`,value:t??``,onChange:e=>u(e.target.value),className:`h-9 min-w-0 flex-1 rounded-md border border-input bg-background px-3 text-sm`,children:e.methods.map(e=>(0,Y.jsx)(`option`,{value:e,children:nt[e]},e))}),(0,Y.jsx)(i,{disabled:!a,onClick:l,children:Z(t)})]}):null]})]})}function gt({number:e,state:t,selectedMethod:n,confirming:r,overrideRules:a,mergePending:o,mergeError:s,onOpenChange:c,onMerge:l}){return(0,Y.jsx)(ve,{open:r,onOpenChange:c,children:(0,Y.jsxs)(ge,{"data-slot":`gh-merge-confirm`,showCloseButton:!1,children:[(0,Y.jsxs)(he,{children:[(0,Y.jsxs)(_e,{children:[Z(n),` pull request #`,e,`?`]}),(0,Y.jsx)(me,{asChild:!0,children:(0,Y.jsxs)(`div`,{children:[(0,Y.jsxs)(`p`,{children:[`This will merge “`,t.title,`” into `,t.baseRef,`. GitHub will re-check the exact reviewed head before changing the repository.`]}),a&&t.canOverride?(0,Y.jsx)(`p`,{"data-slot":`gh-bypass-warning`,className:`mt-4 text-sm text-warning`,children:`You are asking GitHub to bypass unmet repository requirements; GitHub may refuse if your permissions do not allow it.`}):null]})})]}),s?(0,Y.jsx)(`p`,{className:`text-sm text-danger`,children:s.message}):null,(0,Y.jsxs)(pe,{children:[(0,Y.jsx)(i,{variant:`outline`,disabled:o,onClick:()=>c(!1),children:`Cancel`}),(0,Y.jsx)(i,{disabled:o,onClick:l,children:o?`Merging…`:Z(n)})]})]})})}function _t({number:e,onRunAgent:t}){let n=p(),r=S(),i=D({queryKey:E.githubMergeState(e),queryFn:({signal:t})=>d(e,{},{signal:t}),retry:!1}),a=rt(i.data),[o,s]=(0,J.useState)(null),[c,l]=(0,J.useState)(!1),[f,m]=(0,J.useState)(!1),h=w({mutationFn:t=>d(e,{refresh:!0}),onSuccess:(e,t)=>n.setQueryData(t,e),onError:e=>M(e instanceof Error?e.message:String(e),{tone:`danger`})}),g=it(o,a),_=()=>({mergeState:E.githubMergeState(e),list:E.githubPages(50),comments:E.githubComments(`pr`,e),item:E.githubItem(`pr`,e),refStatus:r===void 0?void 0:E.githubRefStatusOf(r)}),v=w({mutationFn:t=>{if(!a||!g)throw Error(`No merge method is available.`);return u(e,{method:g,expectedHeadSha:a.headSha,...f&&a.canOverride?{overrideRules:!0}:{}})},onSuccess:(t,r)=>{l(!1),M(`Pull request #${e} merged`),n.invalidateQueries({queryKey:r.mergeState}),n.invalidateQueries({queryKey:r.list}),n.invalidateQueries({queryKey:r.comments}),n.invalidateQueries({queryKey:r.item}),r.refStatus&&n.invalidateQueries({queryKey:r.refStatus})},onError:(e,t)=>{M(e instanceof Error?e.message:String(e),{tone:`danger`}),n.invalidateQueries({queryKey:t.mergeState})}});return i.isPending?(0,Y.jsx)(H,{"data-slot":`gh-merge-loading`,className:`mt-6 h-32 w-full`}):a?(0,Y.jsxs)(`section`,{"data-slot":`gh-merge-box`,"data-eligibility":a.eligibility,"data-conflicting":ft(a.mergeable),"aria-live":`polite`,className:`mt-6 rounded-lg border border-border bg-card p-4`,children:[(0,Y.jsx)(ht,{state:a,selectedMethod:g,overrideRules:f,mergeEnabled:dt(g,a,f),refreshPending:h.isPending,onRefresh:()=>h.mutate(E.githubMergeState(e)),onRunAgent:t,onConfirm:()=>l(!0),onMethodChange:s,onOverrideChange:m}),(0,Y.jsx)(gt,{number:e,state:a,selectedMethod:g,confirming:c,overrideRules:f,mergePending:v.isPending,mergeError:v.error,onOpenChange:l,onMerge:()=>v.mutate(_())})]}):(0,Y.jsx)(mt,{reason:ut(i.data)})}function vt(e){let t=new Set;for(let n of e)for(let e of n.labels)t.add(e);return[...t].sort((e,t)=>e.toLowerCase().localeCompare(t.toLowerCase()))}function yt(e,t={}){let n=(t.query??``).trim().toLowerCase(),r=t.labels??[],i=n.replace(/^#/,``),a=i!==``&&/^\d+$/.test(i);return e.filter(e=>r.length>0&&!r.every(t=>e.labels.includes(t))||t.assignees?.length&&!e.assignees?.some(e=>t.assignees.some(t=>t.toLowerCase()===e.toLowerCase()))||t.author!==void 0&&e.author.toLowerCase()!==t.author.toLowerCase()||t.includeNumbers&&!t.includeNumbers.has(e.number)||t.excludeNumbers?.has(e.number)||t.projectId&&e.projectIds!==void 0&&!e.projectIds.includes(t.projectId)?!1:n===``?!0:a?String(e.number).includes(i):`#${e.number} ${e.title} ${e.author} ${e.body??``}`.toLowerCase().includes(n))}function bt(e,t){let n=e.trim();if(n===``)return!1;let r=n.replace(/^#/,``);return/^\d+$/.test(r)?!t.some(e=>e.number===Number(r)):t.length===0}function xt(e){if(!e||!/^[0-9a-fA-F]{6}$/.test(e))return{borderColor:`var(--border)`,color:`var(--muted-foreground)`};let t=`#${e}`;return{backgroundColor:`${t}22`,borderColor:`${t}66`,color:`color-mix(in srgb, ${t} 50%, var(--foreground))`}}function St({label:e,color:t,plain:n=!1}){return(0,Y.jsx)(`span`,{"data-slot":`gh-label`,"data-label":e,style:n?void 0:xt(t),className:n?`text-[11px] font-normal text-muted-foreground`:`rounded-full border px-1.5 py-px text-[12px] font-medium`,children:e})}function Ct(e){return e===`pr`?`pull request`:`issue`}function wt(e,t,n){return e===`pr`&&!!(t||n)}function Tt({backLink:e}){return e?(0,Y.jsxs)(U,{to:e.to,"data-slot":`gh-back`,className:`mb-3 inline-flex items-center gap-1.5 text-xs font-medium text-muted-foreground hover:text-foreground md:hidden`,children:[(0,Y.jsx)(ie,{size:16,"aria-hidden":`true`,className:`size-3.5`}),`Back to the list`]}):null}function Et({item:e,kindWord:t,commentCount:n,hasDiffStat:r,additions:i,deletions:o}){return(0,Y.jsxs)(`p`,{"data-slot":`gh-meta`,className:`flex flex-wrap items-center gap-x-1.5 font-mono text-[11px] text-soft-foreground`,children:[(0,Y.jsxs)(`span`,{children:[`#`,e.number]}),`·`,(0,Y.jsx)(`span`,{children:t}),`·`,(0,Y.jsxs)(`span`,{children:[`opened by `,e.author]}),`·`,(0,Y.jsxs)(`span`,{children:[B(e.createdAt),` ago`]}),n?(0,Y.jsxs)(Y.Fragment,{children:[`·`,(0,Y.jsx)(Xt,{count:n})]}):null,r?(0,Y.jsxs)(Y.Fragment,{children:[`·`,(0,Y.jsxs)(`span`,{"data-slot":`gh-diffstat`,children:[(0,Y.jsxs)(`span`,{className:`text-success`,children:[`+`,i??0]}),` `,(0,Y.jsxs)(`span`,{className:`text-danger`,children:[`−`,o??0]})]})]}):null,`·`,a(e.url)?(0,Y.jsxs)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,"data-slot":`gh-open-link`,className:`inline-flex items-center gap-0.5 text-muted-foreground hover:text-foreground hover:underline`,children:[`open on GitHub`,(0,Y.jsx)(j,{"aria-hidden":`true`,className:`size-2.5`})]}):(0,Y.jsx)(`span`,{"data-slot":`gh-open-link`,className:`text-muted-foreground`,children:`open on GitHub`})]})}function Dt({item:e,subNav:t,changes:n}){return e.kind===`pr`?t?(0,Y.jsxs)(`nav`,{"aria-label":`Pull request detail`,className:`mt-4 flex border-b border-border`,children:[(0,Y.jsx)(tt,{to:V(`prs`,t.filter,e.number),active:!n,children:`Conversation`}),(0,Y.jsx)(tt,{to:V(`prs`,t.filter,e.number,`/changes`),active:n,children:`Changes`})]}):(0,Y.jsx)(U,{to:V(`prs`,null,e.number,`/changes`),"data-slot":`gh-files-changed`,className:`mt-3 inline-flex items-center gap-1 text-xs font-medium text-muted-foreground hover:text-foreground hover:underline`,children:`Files changed`}):null}function Ot({item:e,colors:t,checks:n}){return e.labels.length>0||n?(0,Y.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center gap-1.5`,children:[e.labels.map(e=>(0,Y.jsx)(St,{label:e,color:t[e]},e)),n?(0,Y.jsx)(Zt,{checks:n,url:e.url}):null]}):null}function kt({item:e,colors:t,body:n}){return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`div`,{"data-slot":`gh-body`,className:`mt-5 text-sm`,children:n?(0,Y.jsx)($e,{children:n}):(0,Y.jsx)(`p`,{className:`text-soft-foreground`,children:`(no description)`})}),(0,Y.jsx)(Mt,{item:e,colors:t})]})}function At({item:e,colors:t,checks:n,comments:r,backLink:i,subNav:a,onRunAgent:o,afterHeading:s,children:c}){let l=a?.changes??!1,u=Ct(e.kind),d=v(e.kind,e.number,!l).data?.detail,f=d?.body??e.body,p=d?.additions??e.additions,m=d?.deletions??e.deletions,h=wt(e.kind,p,m),g=r??e.comments;return(0,Y.jsxs)(`article`,{"data-slot":`gh-detail-inner`,className:`min-w-0 px-4 py-4 md:px-7 md:py-5`,children:[(0,Y.jsx)(Tt,{backLink:i}),(0,Y.jsxs)(`div`,{"data-slot":`gh-description-card`,className:e.kind===`pr`?`rounded-xl border border-border bg-card p-6`:void 0,children:[e.kind===`pr`?(0,Y.jsxs)(`h2`,{className:`mb-4 text-[22px] leading-snug font-normal`,children:[`#`,e.number,` `,e.title]}):null,(0,Y.jsx)(Et,{item:e,kindWord:u,commentCount:g,hasDiffStat:h,additions:p,deletions:m}),e.kind===`pr`?null:(0,Y.jsx)(`h2`,{className:`mt-2 text-[22px] leading-snug font-normal`,children:e.title}),s,(0,Y.jsx)(Dt,{item:e,subNav:a,changes:l}),(0,Y.jsx)(Ot,{item:e,colors:t,checks:n}),l&&e.kind===`pr`?(0,Y.jsx)(jt,{item:e}):(0,Y.jsx)(kt,{item:e,colors:t,body:f})]}),e.kind===`pr`?(0,Y.jsx)(_t,{number:e.number,onRunAgent:o}):null,c]})}function jt({item:e}){let t=p(),n=g(e.number),[o,s]=(0,J.useState)(``),[c,l]=(0,J.useState)(null),u=n.data,d=u?.available?u.files.filter(e=>e.path.toLowerCase().includes(o.toLowerCase())):[],f=d.findIndex(e=>e.path===c);(0,J.useEffect)(()=>{d.length>0&&!d.some(e=>e.path===c)&&l(d[0].path)},[u?.available?u.headSha:``,o]);let h=async()=>{let n=u?.available?u.headSha:null,r=E.githubPrChanges(e.number),i=await m(e.number,{refresh:!0});t.setQueryData(r,i),i.available&&n&&n!==i.headSha&&(l(i.files[0]?.path??null),M(`The reviewed revision changed.`))};if(n.isPending)return(0,Y.jsx)(`p`,{"aria-live":`polite`,className:`mt-6 text-sm text-muted-foreground`,children:`Loading changed files…`});if(n.isError||!u)return(0,Y.jsx)(`p`,{className:`mt-6 text-sm text-danger`,children:`Changed files could not be loaded.`});if(!u.available)return(0,Y.jsx)(`p`,{className:`mt-6 text-sm text-muted-foreground`,children:u.reason});let _=d.map(e=>({path:e.path,...e.previousPath?{oldPath:e.previousPath}:{},status:e.status===`removed`?`deleted`:e.status===`changed`?`modified`:e.status,adds:e.additions,dels:e.deletions,binary:e.patchUnavailableReason===`binary`,patch:e.patch??``})),v=a(e.url)?`${e.url}/files`:null,y=d.find(e=>e.path===c);return(0,Y.jsxs)(`section`,{"data-slot":`gh-pr-changes`,className:`mt-5 min-w-0`,children:[(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-xs`,children:[(0,Y.jsxs)(`strong`,{children:[u.files.length,` changed files`]}),(0,Y.jsxs)(`span`,{className:`text-success`,children:[`+`,u.additions]}),(0,Y.jsxs)(`span`,{className:`text-danger`,children:[`−`,u.deletions]}),(0,Y.jsxs)(`span`,{className:`font-mono text-muted-foreground`,title:u.headSha,children:[`head `,u.headSha.slice(0,8)]}),(0,Y.jsx)(i,{type:`button`,variant:`outline`,size:`sm`,className:`ml-auto min-h-11`,onClick:()=>void h(),children:`Refresh`})]}),u.truncated?(0,Y.jsxs)(`p`,{role:`status`,className:`mt-3 rounded-md border border-warning/40 bg-warning/10 p-3 text-xs`,children:[u.reason??`This response is incomplete.`,` `,v?(0,Y.jsx)(`a`,{href:v,target:`_blank`,rel:`noopener noreferrer`,className:`underline`,children:`Open all files on GitHub`}):null]}):null,(0,Y.jsxs)(`div`,{className:`mt-4 grid min-w-0 gap-4 lg:grid-cols-[240px_minmax(0,1fr)]`,children:[(0,Y.jsxs)(`aside`,{className:`min-w-0`,children:[(0,Y.jsx)(`input`,{"aria-label":`Filter changed files`,value:o,onChange:e=>s(e.target.value),placeholder:`Filter files…`,className:`min-h-11 w-full rounded-md border border-input bg-background px-3 text-sm`}),(0,Y.jsx)(`select`,{"aria-label":`Select changed file`,value:c??``,onChange:e=>l(e.target.value),className:`mt-2 min-h-11 w-full rounded-md border border-input bg-background px-2 text-sm lg:hidden`,children:d.map(e=>(0,Y.jsx)(`option`,{children:e.path},e.path))}),(0,Y.jsx)(`ul`,{className:`mt-2 hidden max-h-[60vh] overflow-auto lg:block`,children:d.map(e=>(0,Y.jsx)(`li`,{children:(0,Y.jsxs)(`button`,{type:`button`,onClick:()=>l(e.path),className:r(`min-h-11 w-full truncate rounded px-2 text-left text-xs`,c===e.path&&`bg-muted font-medium`),title:e.path,children:[e.status,` · `,e.path,` `,(0,Y.jsxs)(`span`,{className:`text-success`,children:[`+`,e.additions]}),` `,(0,Y.jsxs)(`span`,{className:`text-danger`,children:[`−`,e.deletions]})]})},e.path))})]}),(0,Y.jsxs)(`div`,{className:`min-w-0`,children:[(0,Y.jsxs)(`div`,{className:`mb-2 flex justify-end gap-1`,children:[(0,Y.jsx)(i,{"aria-label":`Previous file`,variant:`outline`,size:`icon`,className:`min-h-11 min-w-11`,disabled:f<=0,onClick:()=>l(d[f-1]?.path??null),children:(0,Y.jsx)(Ze,{})}),(0,Y.jsx)(i,{"aria-label":`Next file`,variant:`outline`,size:`icon`,className:`min-h-11 min-w-11`,disabled:f<0||f>=d.length-1,onClick:()=>l(d[f+1]?.path??null),children:(0,Y.jsx)(oe,{size:16})})]}),d.length===0?(0,Y.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No changed files match this filter.`}):(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(et,{files:_.filter(e=>e.path===c),wrap:!0,className:`min-w-0`}),y&&!y.patch?(0,Y.jsxs)(`p`,{className:`rounded-b border border-border p-3 text-xs text-muted-foreground`,children:[`Patch unavailable: `,y.patchUnavailableReason??`not-provided`,`.`]}):null]})]})]})]})}function Mt({item:e,colors:t}){let n=v(e.kind,e.number),r=n.data,i=(0,J.useMemo)(()=>{let e=[...(r?.comments??[]).map(e=>({row:`comment`,comment:e})),...(r?.events??[]).map(e=>({row:`event`,event:e}))],t=e=>{let t=Date.parse(Nt(e));return Number.isNaN(t)?-1/0:t};return e.sort((e,n)=>t(e)-t(n))},[r?.comments,r?.events]);return n.isPending?(0,Y.jsxs)(`section`,{"data-slot":`gh-thread-loading`,className:`mt-6 border-t border-border pt-5`,children:[(0,Y.jsx)(H,{className:`mb-3 h-3 w-24`}),(0,Y.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,Y.jsx)(H,{className:`h-14 w-full`}),(0,Y.jsx)(H,{className:`h-14 w-full`})]})]}):!r||!r.available?(0,Y.jsxs)(`section`,{"data-slot":`gh-thread-error`,className:`mt-6 border-t border-border pt-5 text-xs text-soft-foreground`,children:[(0,Y.jsxs)(`span`,{children:[`Couldn’t load comments — `,r?.reason??(n.error instanceof Error?n.error.message:`could not load comments`),`. `]}),(0,Y.jsxs)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex items-center gap-0.5 text-muted-foreground hover:text-foreground hover:underline`,children:[`open on GitHub`,(0,Y.jsx)(j,{"aria-hidden":`true`,className:`size-2.5`})]})]}):i.length===0?null:(0,Y.jsxs)(`section`,{"data-slot":`gh-thread`,className:`mt-6 border-t border-border pt-5`,children:[(0,Y.jsxs)(`h3`,{"data-slot":`gh-thread-header`,className:`mb-4 text-[11px] font-semibold tracking-wide text-soft-foreground uppercase`,children:[`Activity · `,r.comments.length,` comment`,r.comments.length===1?``:`s`]}),(0,Y.jsx)(`ul`,{className:`flex flex-col gap-5`,children:Pt(i).map(e=>e.group===`commits`?(0,Y.jsx)(Ft,{commits:e.commits,colors:t},e.commits[0].id):e.entry.row===`comment`?(0,Y.jsx)(Kt,{comment:e.entry.comment},`${e.entry.comment.kind}-${e.entry.comment.id}`):(0,Y.jsx)(Lt,{event:e.entry.event,colors:t},e.entry.event.id))}),r.truncated?(0,Y.jsxs)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,"data-slot":`gh-thread-truncated`,className:`mt-4 inline-flex items-center gap-0.5 text-xs text-soft-foreground hover:text-foreground hover:underline`,children:[`thread truncated — open on GitHub`,(0,Y.jsx)(j,{"aria-hidden":`true`,className:`size-2.5`})]}):null]})}var Nt=e=>e.row===`comment`?e.comment.createdAt:e.event.createdAt;function Pt(e){let t=[],n=[],r=()=>{n.length!==0&&(n.length===1?t.push({group:`single`,entry:{row:`event`,event:n[0]}}):t.push({group:`commits`,commits:n}),n=[])};for(let i of e){if(i.row===`event`&&i.event.kind===`committed`&&i.row===`event`){let e=n[n.length-1];e&&e.actor!==i.event.actor&&r(),n.push(i.event);continue}r(),t.push({group:`single`,entry:i})}return r(),t}function Ft({commits:e,colors:t}){let[n,r]=(0,J.useState)(!1),i=e[0]?.actor??`?`;return n?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`li`,{"data-slot":`gh-commit-group`,"data-open":`true`,className:`min-w-0`,children:(0,Y.jsxs)(`button`,{type:`button`,"aria-expanded":!0,onClick:()=>r(!1),className:`flex items-center gap-1.5 font-mono text-[11px] text-soft-foreground hover:text-foreground`,children:[(0,Y.jsx)(`span`,{"aria-hidden":`true`,children:It.committed}),(0,Y.jsx)(`span`,{className:`font-sans font-medium text-foreground`,children:i}),(0,Y.jsxs)(`span`,{children:[`added `,e.length,` commits`]})]})}),e.map(e=>(0,Y.jsx)(Lt,{event:e,colors:t},e.id))]}):(0,Y.jsx)(`li`,{"data-slot":`gh-commit-group`,"data-open":`false`,className:`min-w-0`,children:(0,Y.jsxs)(`button`,{type:`button`,"aria-expanded":!1,onClick:()=>r(!0),className:`flex items-center gap-1.5 font-mono text-[11px] text-soft-foreground hover:text-foreground`,children:[(0,Y.jsx)(`span`,{"aria-hidden":`true`,children:It.committed}),(0,Y.jsx)(`span`,{className:`font-sans font-medium text-foreground`,children:i}),(0,Y.jsxs)(`span`,{children:[`added `,e.length,` commits`]}),(0,Y.jsx)(`span`,{className:`shrink-0`,children:B(e[e.length-1].createdAt)})]})})}var It={committed:`⚙`,labeled:`◆`,unlabeled:`◇`,assigned:`◍`,unassigned:`◌`,merged:`⑃`,closed:`⊘`,reopened:`⊙`,head_ref_force_pushed:`↻`,"cross-referenced":`↗`,renamed:`✎`};function Lt({event:e,colors:t}){return(0,Y.jsxs)(`li`,{"data-slot":`gh-event-row`,"data-kind":e.kind,className:r(`flex min-w-0 items-center gap-1.5 font-mono text-[11px] text-soft-foreground`,e.kind===`merged`&&`text-accent-foreground`),children:[(0,Y.jsx)(`span`,{"aria-hidden":`true`,className:`shrink-0`,children:It[e.kind]}),(0,Y.jsx)(`span`,{className:`font-sans font-medium text-foreground`,children:e.actor}),(0,Y.jsx)(Ut,{event:e,colors:t}),(0,Y.jsx)(`span`,{className:`shrink-0`,children:B(e.createdAt)}),e.url?(0,Y.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,"aria-label":`open ${e.kind} on GitHub`,className:`ml-auto shrink-0 text-muted-foreground hover:text-foreground`,children:(0,Y.jsx)(j,{"aria-hidden":`true`,className:`size-2.5`})}):null]})}function Rt({event:e}){return(0,Y.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,Y.jsx)(`span`,{className:`shrink-0`,children:`committed`}),e.sha?(0,Y.jsx)(`span`,{className:`shrink-0 text-muted-foreground`,children:e.sha.slice(0,7)}):null,e.message?(0,Y.jsx)(`span`,{className:`truncate font-sans text-foreground`,children:e.message}):null,(0,Y.jsx)(Wt,{checks:e.checks})]})}function zt({event:e,colors:t}){return(0,Y.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,Y.jsx)(`span`,{className:`shrink-0`,children:e.kind===`labeled`?`added the`:`removed the`}),e.label?(0,Y.jsx)(`span`,{"data-slot":`gh-event-label`,style:xt(e.label.color??t[e.label.name]),className:`max-w-[12rem] truncate rounded-full border px-1.5 py-px font-sans text-[12px]`,children:e.label.name}):null,(0,Y.jsx)(`span`,{className:`shrink-0`,children:`label`})]})}function Bt({event:e}){return(0,Y.jsxs)(`span`,{className:`truncate`,children:[e.kind===`assigned`?`assigned`:`unassigned`,` `,e.subject??`someone`]})}function Vt({event:e}){return(0,Y.jsxs)(`span`,{className:`truncate`,children:[`referenced this in `,e.refNumber?`#${e.refNumber}`:`another thread`,e.refTitle?` ${e.refTitle}`:``]})}var Ht={committed:e=>(0,Y.jsx)(Rt,{event:e}),labeled:(e,t)=>(0,Y.jsx)(zt,{event:e,colors:t}),unlabeled:(e,t)=>(0,Y.jsx)(zt,{event:e,colors:t}),assigned:e=>(0,Y.jsx)(Bt,{event:e}),unassigned:e=>(0,Y.jsx)(Bt,{event:e}),merged:()=>(0,Y.jsx)(`span`,{children:`merged this`}),closed:()=>(0,Y.jsx)(`span`,{children:`closed this`}),reopened:()=>(0,Y.jsx)(`span`,{children:`reopened this`}),head_ref_force_pushed:()=>(0,Y.jsx)(`span`,{children:`force-pushed`}),renamed:e=>(0,Y.jsxs)(`span`,{className:`truncate`,children:[`renamed this to `,e.subject??`—`]}),"cross-referenced":e=>(0,Y.jsx)(Vt,{event:e})};function Ut({event:e,colors:t}){return Ht[e.kind]?.(e,t)??null}function Wt({checks:e}){return e?(0,Y.jsx)(`span`,{"data-slot":`gh-commit-checks`,"data-checks":e,"aria-label":`checks ${e}`,className:r(`shrink-0`,Yt[e]),children:Jt[e]}):null}var Gt={approved:{label:`approved`,tone:`border-success/40 text-success`},changes_requested:{label:`changes requested`,tone:`border-danger/40 text-danger`},commented:{label:`commented`,tone:`border-border text-muted-foreground`},dismissed:{label:`dismissed`,tone:`border-border text-muted-foreground`}};function Kt({comment:e}){let t=e.reviewState?Gt[e.reviewState]:null;return(0,Y.jsxs)(`li`,{"data-slot":`gh-thread-entry`,"data-kind":e.kind,className:`min-w-0`,children:[(0,Y.jsxs)(`div`,{className:`mb-1.5 flex items-center gap-1.5 font-mono text-[11px] text-soft-foreground`,children:[(0,Y.jsx)(qt,{url:e.avatarUrl,login:e.author}),(0,Y.jsx)(`span`,{className:`font-sans font-medium text-foreground`,children:e.author}),(0,Y.jsx)(`span`,{children:B(e.createdAt)}),t?(0,Y.jsx)(`span`,{"data-slot":`gh-review-chip`,"data-review-state":e.reviewState,className:r(`rounded-full border px-1.5 py-px font-sans text-[12px] font-medium`,t.tone),children:t.label}):null,(0,Y.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,"aria-label":`open comment on GitHub`,className:`ml-auto shrink-0 text-muted-foreground hover:text-foreground`,children:(0,Y.jsx)(j,{"aria-hidden":`true`,className:`size-2.5`})})]}),(0,Y.jsx)(`div`,{"data-slot":`gh-thread-body`,className:`text-sm`,children:e.body?(0,Y.jsx)($e,{children:e.body}):(0,Y.jsx)(`p`,{className:`text-soft-foreground`,children:`(no body)`})})]})}function qt({url:e,login:t}){let[n,r]=(0,J.useState)(!1);return e&&!n?(0,Y.jsx)(`img`,{src:e,alt:``,width:16,height:16,loading:`lazy`,onError:()=>r(!0),"data-slot":`gh-avatar`,className:`size-4 shrink-0 rounded-full`}):(0,Y.jsx)(`span`,{"data-slot":`gh-avatar-fallback`,"aria-hidden":`true`,className:`flex size-4 shrink-0 items-center justify-center rounded-full bg-muted text-[8px] font-semibold text-muted-foreground uppercase`,children:t.slice(0,1)||`?`})}var Jt={passing:`✓`,failing:`✗`,pending:`○`},Yt={passing:`text-success`,failing:`text-danger`,pending:`text-muted-foreground`};function Xt({count:e}){return e?(0,Y.jsxs)(`span`,{"data-slot":`gh-comment-count`,"data-count":e,"aria-label":`${e} comment${e===1?``:`s`}`,className:`inline-flex shrink-0 items-center gap-0.5`,children:[(0,Y.jsx)(de,{"aria-hidden":`true`,className:`size-3`}),e]}):null}function Zt({checks:e,url:t}){let n=r(`text-[11px] font-medium`,Yt[e],t&&`hover:underline`),i=`${Jt[e]} checks ${e}`;return t?(0,Y.jsx)(`a`,{href:`${t}/checks`,target:`_blank`,rel:`noopener noreferrer`,"data-slot":`gh-checks`,"data-checks":e,className:n,children:i}):(0,Y.jsx)(`span`,{"data-slot":`gh-checks`,"data-checks":e,className:n,children:i})}function Qt({checks:e}){return(0,Y.jsx)(`span`,{"data-slot":`gh-row-checks`,"data-checks":e,title:`checks ${e}`,"aria-label":`checks ${e}`,className:r(`shrink-0 font-sans text-[11px] font-semibold`,Yt[e]),children:Jt[e]})}function Q(e){return`${e.kind===`pr`?`Address GitHub pull request`:`Fix GitHub issue`} #${e.number}: ${e.title}\n\n${e.url}`}function $t(e,t=[]){let n=Q(e);return e.body?.trim()&&(n+=`\n\n---\n\n${e.body.trim()}`),t.length&&(n+=en(t)),n}function en(e){return`\n\nUse these skills where relevant: ${e.join(`, `)}.`}function tn(e,t){return e.replace(/\{\{\s*number\s*\}\}/gi,()=>`#${t.number}`).replace(/\{\{\s*title\s*\}\}/gi,()=>t.title).replace(/\{\{\s*url\s*\}\}/gi,()=>t.url)}function nn(e,t){if(e.includes(t.url))return!0;let n=t.kind===`pr`?String.raw`(?:pull\s+request|pr)`:String.raw`issue`;return new RegExp(String.raw`\b${n}\s*#?\s*${t.number}\b`,`i`).test(e)}function rn(e,t,n){let r=(n??``).trim();if(!r)return $t(e,t);let i=Q(e),a=r.startsWith(i)?i+tn(r.slice(i.length),e):tn(r,e),o=nn(a,e)?a:`${i}\n\n${a}`;return t.length?o+en(t):o}function an(e){let t=[];for(let n of e.slice(0,8)){let e=new Set(t.map(e=>e.id)),r=n;for(let t=2;e.has(r);t++)r=`${n}-${t}`;t.push({id:r,name:n,skill:n,prompt:`{{task}}`})}return t}function on(e,t,n,r,i={}){return t?{...i,workflow:t,task:rn(e,n.map(e=>e.id),r)}:n.length?{...i,steps:an(n.map(e=>e.id)).map((e,t)=>({...e,...n[t]?.path===void 0?{}:{skillPath:n[t].path}})),task:rn(e,[],r)}:{...i,workflow:`quick-task`,task:rn(e,[],r)}}function sn(e){let t=C(),n=T(),r=N(),i=o(t.data,r.data),a=s(t.data,r.data),c=n.data?.defaultRunner,l=we(e.runner,i,c??i[0]??`claude`),u=n.data?.modelsLocked===!0,{accounts:d,repoAccount:f}=qe(),p=d.some(t=>t.provider===l&&t.id===e.account)?e.account:null,m=x(l,!0,p??f?.[l]),h=Re(u?null:e.model,l,r.data,n.data?.defaultModels,m.data),g=Te(h,m.data);return{runner:l,runnerExplicit:e.runner!==null,model:h,effort:u?``:De(e.effort,g),effortOptions:g,runners:i,uninstalled:a,defaultRunner:c,canRun:t.isSuccess&&i.length>0,modelsLocked:u,providerPending:t.isPending,providerError:t.isError,accounts:d,account:p,repoAccount:f}}function cn(e){return{runner:Le(e.runner,e.defaultRunner,e.runnerExplicit),model:e.modelsLocked?void 0:e.model||void 0,effort:e.modelsLocked?void 0:e.effort||void 0}}function ln(e){return{...cn(e),...e.account?{agentProfile:e.account}:{}}}function un(e,t){let{runners:n,uninstalled:r}=e;return n.length>1||r.length>0||n.some(e=>Ye(t,e))}function dn({pick:e,onChange:t,disabled:n=!1,accounts:r=!1,layout:i}){let a=(0,J.useRef)(null),o=(0,J.useRef)(null),[s,c]=(0,J.useState)(()=>typeof window<`u`&&window.innerWidth<=767);(0,J.useLayoutEffect)(()=>{let e=a.current;if(i!==`row`||!e)return;let t=()=>{let t=window.innerWidth<=767||e.getBoundingClientRect().width<550,n=document.activeElement;o.current=n instanceof HTMLElement&&e.contains(n)?n:null,c(t)};t();let n=typeof ResizeObserver>`u`?null:new ResizeObserver(t);return n?.observe(e),window.addEventListener(`resize`,t),()=>{n?.disconnect(),window.removeEventListener(`resize`,t)}},[i]),(0,J.useLayoutEffect)(()=>{let e=o.current;o.current=null,e&&e.isConnected&&document.activeElement!==e&&e.focus()},[s]);let l=sn(e),{runner:u,model:d,effort:f,effortOptions:p,runners:m,canRun:h,modelsLocked:g}=l,_=T(),v=N(),y=x(u,!0,l.account??l.repoAccount?.[u]),b=Ie(u,v.data,y.data,[e.model,_.data?.defaultModels?.[u]]),S=n||!h,C=r?l.accounts:[],w=un(l,C)?(0,Y.jsx)(Ne,{icon:(0,Y.jsx)(R,{"aria-hidden":`true`,className:`size-[18px] shrink-0 text-accent-text`}),fieldLabel:!0,runners:m,uninstalled:l.uninstalled,value:u,accounts:C,account:r?l.account:null,repoAccount:r?l.repoAccount:void 0,disabled:S,onPick:(n,i)=>t(r?{runner:n,account:i,model:n===u?e.model:null,effort:e.effort}:{runner:n,account:null,model:null,effort:e.effort})},`runner`):null,E=(0,Y.jsx)(K,{icon:(0,Y.jsx)(ce,{"aria-hidden":`true`,className:`size-[18px] shrink-0 text-accent-text`}),fieldLabel:!0,slot:`model-pill`,ariaLabel:`Model`,label:d===``?`Default`:b.find(e=>e.id===d).label,value:d,disabled:S,readOnly:g===!0,disabledHint:g?`Model selection is locked to native coding-agent settings.`:void 0,onPick:n=>{let r=Te(n,y.data);t({...e,model:n,effort:e.effort===null?null:De(e.effort,r)})},options:b.map(e=>({value:e.id,label:e.label,desc:e.desc})),status:je(u,v.data,y)},`model`),D=(0,Y.jsx)(K,{icon:(0,Y.jsx)(te,{"aria-hidden":`true`,className:`size-[18px] shrink-0 text-accent-text`}),fieldLabel:!0,slot:`effort-pill`,ariaLabel:`Effort`,label:p.find(e=>e.value===f)?.label??`auto`,value:f,disabled:S,readOnly:g===!0,disabledHint:g?`Effort selection is locked to native coding-agent settings.`:void 0,onPick:n=>t({...e,effort:n}),options:p.map(e=>({value:e.value,label:e.label,desc:e.desc}))},`effort`);return i===`row`?(0,Y.jsx)(`div`,{ref:a,"data-slot":`engine-row-box`,children:(0,Y.jsx)(`div`,{"data-slot":`engine-row`,className:`engine-row`,role:`group`,"aria-label":`Agent settings`,children:(0,Y.jsx)(Me,{children:s?[w,D,E]:[w,E,D]})})}):(0,Y.jsxs)(Me,{children:[w,E,D]})}var fn={workflow:null,skills:[]},pn=`cez-followup-selection`;function mn(e){let t=e&&typeof e==`object`?e:{};return{workflow:typeof t.workflow==`string`?t.workflow:null,skills:Array.isArray(t.skills)?t.skills.flatMap(e=>typeof e==`string`?[{id:e}]:!e||typeof e!=`object`||typeof e.id!=`string`?[]:[{id:e.id,...typeof e.path==`string`?{path:e.path}:{}}]):[]}}function hn(){try{let e=localStorage.getItem(pn);return e?mn(JSON.parse(e)):{...fn}}catch{return{...fn}}}function gn(e){try{localStorage.setItem(pn,JSON.stringify(e))}catch{}}var $=`cez-followup-prompt:`;function _n(e){try{return localStorage.getItem($+e)??``}catch{return``}}function vn(e,t){try{t===``?localStorage.removeItem($+e):localStorage.setItem($+e,t)}catch{}}function yn({item:e,workflows:t,skills:n,workflow:r,onWorkflowChange:o,selectedSkills:s,onSkillsChange:l,engine:u,onEngineChange:d,queuedRunId:f,onQueued:m}){let g=p(),_=y(),v=e.kind===`pr`?`PR`:`issue`,x=sn(u),S=b(x.runner,x.account),C=s.filter(e=>S.unchecked||e.path===void 0||n.some(t=>t.id===e.id&&(e.path===void 0||t.path===e.path))),T=C.length!==s.length,[D]=(0,J.useState)(()=>Q(e)),[O,k]=(0,J.useState)(()=>_n(e.url)||D),A=(0,J.useRef)(null),j=(0,J.useRef)(null);(0,J.useEffect)(()=>{vn(e.url,O===D?``:O)},[e.url,O,D]);let N=(0,J.useMemo)(()=>Fe(_.data?.promptTemplates),[_.data?.promptTemplates]),ee=e=>{let t=A.current,n=Ae({prompt:O,base:D,selectionStart:t?.selectionStart??null,focused:document.activeElement===t,remembered:j.current}),r=Oe(O,n,e);k(r.text),j.current=r.caret,requestAnimationFrame(()=>{A.current?.focus(),A.current?.setSelectionRange(r.caret,r.caret)})},F=Pe(N,C.map(e=>e.id)),I=(0,J.useRef)(O);I.current=O;let L=(0,J.useRef)(``);(0,J.useEffect)(()=>{let e=ke(I.current,L.current,F,D);L.current=e.applied,e.text!==I.current&&k(e.text)},[F,D]);let R=w({mutationFn:async()=>!x.canRun||T?null:h(on(e,r,C,O,ln(x))),onSuccess:t=>{if(t===null)return;let n=t;n&&m(e.url,n.id),M(`Added to the queue — ${v} #${e.number}`),C.length>0&&_.data!==void 0&&c({skillUsage:C.reduce((e,t)=>We(e,t.id),_.data.skillUsage)}).then(()=>g.invalidateQueries({queryKey:E.uiState})).catch(()=>{}),vn(e.url,``),k(D),L.current=``,g.invalidateQueries({queryKey:E.runs.all})},onError:e=>M(e.message,{tone:`danger`})}),te=e=>{Qe({key:e.key,shiftKey:e.shiftKey,metaKey:e.metaKey,ctrlKey:e.ctrlKey,altKey:e.altKey,repeat:e.repeat,isComposing:e.nativeEvent.isComposing})&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),!R.isPending&&x.canRun&&R.mutate())},z=e=>l(s.some(t=>q(t)===q(e))?s.filter(t=>q(t)!==q(e)):[...s,Ue(e)]);return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`section`,{"data-slot":`gh-hand`,className:`mt-7 rounded-lg border border-border bg-card p-4`,children:[(0,Y.jsx)(`h3`,{className:`text-xl font-normal text-foreground`,children:`Hand this to the agent`}),(0,Y.jsxs)(`label`,{className:`gh-field gh-prompt-field`,children:[(0,Y.jsx)(`span`,{children:`Instructions for the agent`}),(0,Y.jsx)(Xe,{ref:A,"data-slot":`gh-custom-prompt`,"aria-label":`Custom prompt`,"aria-keyshortcuts":`Control+Enter Meta+Enter`,value:O,onChange:e=>k(e.target.value),onSelect:e=>{j.current=e.currentTarget.selectionStart},onKeyDown:te,placeholder:`Instructions for the agent… (#${e.number} and its link are always sent)`,className:`mt-3 min-h-20 text-[13px]`})]}),(0,Y.jsx)(ye,{templates:N,onInsert:ee}),(0,Y.jsxs)(`div`,{className:`gh-handoff-settings`,children:[(0,Y.jsxs)(`div`,{className:`gh-field`,children:[(0,Y.jsx)(`span`,{children:`Workflow`}),(0,Y.jsx)(xn,{workflows:t,value:r,onChange:o})]}),(0,Y.jsxs)(`div`,{className:`gh-field`,children:[(0,Y.jsx)(`span`,{children:`Skills · select one or more`}),(0,Y.jsx)(Cn,{skills:n,skillUsage:_.data?.skillUsage,selected:s,onToggle:z})]}),s.length>0?(0,Y.jsx)(`div`,{"data-slot":`gh-skill-chips`,className:`mt-2.5 flex flex-wrap gap-1.5`,children:s.map(e=>(0,Y.jsx)(bn,{skill:e,skills:n,unchecked:S.unchecked,onRemove:()=>z(e)},q(e)))}):null,T?(0,Y.jsx)(`p`,{role:`alert`,children:`A selected skill path is unavailable. Remove it or choose a current copy before starting.`}):null,(0,Y.jsx)(dn,{layout:`row`,pick:u,onChange:d,disabled:R.isPending||!x.canRun,accounts:!0}),(0,Y.jsxs)(`div`,{className:`gh-field`,children:[(0,Y.jsx)(`span`,{children:`Account`}),(0,Y.jsx)(Sn,{resolved:x,disabled:R.isPending||!x.canRun,onPick:e=>d({...u,account:e})})]}),!x.providerPending&&!x.canRun?(0,Y.jsxs)(`span`,{"data-slot":`gh-provider-gate`,className:`inline-flex flex-wrap items-center gap-1 text-xs text-muted-foreground`,children:[x.providerError?`Provider authentication could not be verified.`:`Connect an agent provider to run this item.`,(0,Y.jsx)(U,{to:`/settings/agent-defaults#providers`,className:`font-medium text-foreground underline underline-offset-4`,children:`Configure providers`})]}):null]}),(0,Y.jsxs)(`p`,{className:`text-[11px] leading-relaxed text-muted-foreground`,children:[e.kind===`pr`?`PR`:`Issue`,` number and link remain attached to the task. Edit the prompt before starting. Cmd/Ctrl+Enter submits; Enter adds a new line.`]})]}),(0,Y.jsxs)(`div`,{"data-slot":`gh-handoff-actions`,className:`mt-[22px] flex flex-wrap items-center gap-2.5`,children:[a(e.url)?(0,Y.jsx)(i,{asChild:!0,variant:`outline`,children:(0,Y.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,children:`Open in GitHub`})}):null,(0,Y.jsxs)(i,{variant:`primary`,"data-action":`gh-run`,disabled:R.isPending||!x.canRun||T,onClick:()=>R.mutate(),children:[(0,Y.jsx)(fe,{"aria-hidden":`true`,className:`size-3.5`}),`Run agent on this `,v]}),(0,Y.jsx)(`kbd`,{"aria-hidden":`true`,className:`rounded-[5px] border border-b-2 border-border bg-card px-[5px] py-px font-mono text-[11px] font-medium text-muted-foreground`,children:Ke()}),f?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`span`,{"data-slot":`gh-queued`,className:`flex items-center gap-1 text-xs font-medium text-success`,children:[(0,Y.jsx)(P,{size:16,"aria-hidden":`true`,className:`size-3.5`}),`queued`]}),(0,Y.jsx)(U,{to:`/tasks/${f}`,"data-slot":`gh-view-run`,className:`text-xs font-semibold text-accent-text hover:underline`,children:`View task →`})]}):null]})]})}function bn({skill:e,skills:t,unchecked:n,onRemove:r}){let i=t.find(t=>t.id===e.id&&(e.path===void 0||t.path===e.path)),a=[i?.name??e.id,e.path].filter(Boolean).join(` · `),o=!n&&e.path!==void 0&&!i?` (unavailable)`:n||!i?` (unchecked)`:``;return(0,Y.jsxs)(`button`,{type:`button`,"data-slot":`gh-skill-chip`,"data-skill":e.id,onClick:r,title:`Remove skill ${a}`,"aria-label":`Remove skill ${a}`,className:`inline-flex min-h-11 items-center gap-2 rounded-lg border border-border bg-card px-3 text-xs font-medium text-foreground transition-colors hover:bg-danger/10 hover:text-danger`,children:[a,o,(0,Y.jsx)(I,{size:16,"aria-hidden":`true`,className:`size-3`})]})}function xn({workflows:e,value:t,onChange:n}){let[i,a]=(0,J.useState)(!1),[o,s]=(0,J.useState)(``),c=(0,J.useRef)(null),l=ze(e,o);return(0,Y.jsxs)(A,{open:i,onOpenChange:e=>{a(e),e||s(``)},children:[(0,Y.jsx)(k,{asChild:!0,children:(0,Y.jsxs)(`button`,{type:`button`,"data-slot":`gh-workflow-trigger`,"aria-label":`Choose a workflow`,className:r(Ee,t&&`border-foreground/60 font-mono text-[11px] font-semibold text-foreground`),children:[(0,Y.jsx)(se,{size:16,"aria-hidden":`true`,className:`size-3 shrink-0 text-accent-icon`}),(0,Y.jsx)(`span`,{className:`min-w-0 max-w-44 truncate`,children:t??`workflow`}),(0,Y.jsx)(z,{size:16,"aria-hidden":`true`,className:`size-2.5 shrink-0 text-soft-foreground`})]})}),(0,Y.jsx)(O,{align:`start`,sideOffset:8,className:`w-[320px] max-w-[calc(100vw-2rem)] p-0`,children:(0,Y.jsxs)(xe,{shouldFilter:!1,children:[(0,Y.jsx)(be,{placeholder:`search workflows…`,value:o,onValueChange:s,onInput:()=>c.current?.scrollTo(0,0)}),(0,Y.jsxs)(Ce,{ref:c,"data-slot":`gh-workflow-menu`,className:`max-h-[min(16rem,calc(var(--radix-popover-content-available-height)-3rem))]`,children:[l.length===0?(0,Y.jsx)(Se,{children:`Nothing matches.`}):null,(0,Y.jsx)(W,{children:l.map(e=>{let r=t===e.name;return(0,Y.jsxs)(G,{value:`workflow ${e.name}`,keywords:He(e.name,e.description),"data-slot":`gh-workflow-option`,"data-workflow":e.name,onSelect:()=>{n(r?null:e.name),a(!1)},children:[(0,Y.jsx)(`span`,{className:`shrink-0 font-mono text-xs`,children:e.name}),e.description?(0,Y.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-xs text-soft-foreground`,children:e.description}):null,r?(0,Y.jsx)(P,{size:16,"aria-hidden":`true`,className:`ml-auto size-3.5 shrink-0 text-link-foreground`}):null]},e.name)})})]})]})})]})}function Sn({resolved:e,disabled:t,onPick:n}){let r=e.accounts.filter(t=>t.provider===e.runner),i=[...r.some(e=>e.id==="default")?[]:[{value:l,label:`Default`}],...r.map(e=>({value:e.id,label:e.label,desc:e.configDir}))],a=e.account??e.repoAccount?.[e.runner]??`default`;return(0,Y.jsx)(K,{icon:(0,Y.jsx)(F,{"aria-hidden":`true`,className:`size-[18px] shrink-0 text-accent-text`}),slot:`account-pill`,ariaLabel:`Account`,label:i.find(e=>e.value===a)?.label??`Default`,value:a,options:i,disabled:t,onPick:n})}function Cn({skills:e,skillUsage:t,selected:n,onToggle:i}){let[a,o]=(0,J.useState)(!1),[s,c]=(0,J.useState)(``),[l,u]=(0,J.useState)(null),d=(0,J.useRef)(null),{mostUsed:f,project:p,global:m,ranked:h}=Ge(e,s,t),g=(e,t)=>{let a=n.some(t=>q(t)===q(e));return(0,Y.jsxs)(G,{value:q(e),keywords:He(e.name,e.description),"data-slot":`gh-skill-option`,"data-skill":e.id,"data-selected":a?`true`:void 0,onSelect:()=>i(Ue(e)),children:[(0,Y.jsx)(`span`,{className:r(`shrink-0 font-mono text-xs`,t&&`font-semibold`),children:e.name}),e.path?(0,Y.jsx)(`span`,{className:`min-w-0 truncate text-xs`,children:e.path}):null,e.description?(0,Y.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-xs text-soft-foreground`,children:e.description}):null,(0,Y.jsx)(`button`,{type:`button`,"data-slot":`gh-skill-view`,"aria-label":`View skill ${e.name}`,title:`View skill`,onClick:t=>{t.preventDefault(),t.stopPropagation(),u(e)},className:`ml-auto shrink-0 rounded-sm p-0.5 text-soft-foreground transition-colors hover:text-foreground`,children:(0,Y.jsx)(le,{"aria-hidden":`true`,className:`size-3.5`})}),a?(0,Y.jsx)(P,{size:16,"aria-hidden":`true`,className:`size-3.5 shrink-0 text-link-foreground`}):null]},q(e))};return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(Je,{skill:l,onClose:()=>u(null)}),(0,Y.jsxs)(A,{open:a,onOpenChange:e=>{o(e),e||c(``)},children:[(0,Y.jsx)(k,{asChild:!0,children:(0,Y.jsxs)(`button`,{type:`button`,"data-slot":`gh-skills-trigger`,"aria-label":`Choose skills`,className:r(Ee,n.length>0&&`border-foreground/60 font-semibold text-foreground`),children:[(0,Y.jsx)(ae,{size:16,"aria-hidden":`true`,className:`size-3 shrink-0 text-accent-icon`}),`skills`,n.length>0?` · ${n.length}`:``,(0,Y.jsx)(z,{size:16,"aria-hidden":`true`,className:`size-2.5 shrink-0 text-soft-foreground`})]})}),(0,Y.jsx)(O,{align:`start`,sideOffset:8,className:`w-[336px] max-w-[calc(100vw-2rem)] p-0`,children:(0,Y.jsxs)(xe,{shouldFilter:!1,children:[(0,Y.jsx)(be,{placeholder:`search skills…`,value:s,onValueChange:c,onInput:()=>d.current?.scrollTo(0,0)}),(0,Y.jsxs)(Ce,{ref:d,"data-slot":`gh-skill-menu`,className:`max-h-[min(16rem,calc(var(--radix-popover-content-available-height)-3rem))]`,children:[s.trim()&&!e.some(e=>e.id===s.trim())?(0,Y.jsx)(W,{children:(0,Y.jsxs)(G,{value:`typed-skill`,onSelect:()=>i({id:s.trim()}),children:[`Use skill id “`,s.trim(),`” (unchecked)`]})}):null,(h?h.length===0:f.length===0&&p.length===0&&m.length===0)?(0,Y.jsx)(Se,{children:`Nothing matches.`}):null,h?h.length>0?(0,Y.jsx)(W,{children:h.map(e=>g(e,Be(e)))}):null:(0,Y.jsxs)(Y.Fragment,{children:[f.length>0?(0,Y.jsx)(W,{heading:`Most used`,children:f.map(e=>g(e,Be(e)))}):null,p.length>0?(0,Y.jsx)(W,{heading:`Project skills`,children:p.map(e=>g(e,!0))}):null,m.length>0?(0,Y.jsx)(W,{heading:`Global`,children:m.map(e=>g(e,!1))}):null]})]})]})})]})]})}var wn=new WeakMap;function Tn(){let e=hn(),t={workflow:e.workflow,selectedSkills:e.skills,engine:{runner:null,model:null,effort:null,account:null},queued:new Map},n=new Set;return{snapshot:()=>t,subscribe:e=>(n.add(e),()=>{n.delete(e)}),update:e=>{t={...t,...e},(e.workflow!==void 0||e.selectedSkills!==void 0)&&gn({workflow:t.workflow,skills:[...t.selectedSkills]}),n.forEach(e=>e())}}}function En(){let e=p(),{projectId:t}=f(),n=wn.get(e);n||wn.set(e,n=new Map);let r=n.get(t);r||n.set(t,r=Tn());let{snapshot:i,subscribe:a,update:o}=r,s=(0,J.useSyncExternalStore)(a,i,i),c=_(),l=sn(s.engine),u=b(l.runner,l.account),d=y(),m=c.data?.workflows;(0,J.useEffect)(()=>{m&&s.workflow!==null&&!m.some(e=>e.name===s.workflow)&&o({workflow:null})},[o,m,s.workflow]);let h=(0,J.useMemo)(()=>Ve(u.data??[],d.data?.skillUsage),[u.data,d.data?.skillUsage]);return{...s,workflows:c,skillList:h,skillsUnchecked:u.unchecked,setWorkflow:e=>o({workflow:e}),setSelectedSkills:e=>o({selectedSkills:e}),setEngine:e=>o({engine:e}),onQueued:(e,t)=>o({queued:new Map(i().queued).set(e,t)})}}export{Xt as a,Pt as c,xt as d,bt as f,Qt as i,vt as l,yn as n,At as o,$t as r,St as s,En as t,yt as u};
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{l as r,t as i,u as a}from"./button-C1fD-ZFr.js";import{Dr as o,Er as s,Jt as c,Ln as l,Pt as u,nt as d,r as f,ti as p,tt as m,w as h}from"./project-scope-context-Dlbq88xo.js";import{A as g,At as _,E as v,Et as y,Ft as b,Kt as x,Q as S,Y as C,Yt as w,p as T,t as E}from"./queries-BtkCvBtK.js";import{t as D}from"./useQuery-D89BPQpm.js";import{a as O,o as k,r as A,tt as j}from"./use-desktop-NTwdvSZg.js";import{n as M}from"./toaster-Cxgzn9ip.js";import{s as N}from"./runners-M0-6Uumh.js";import{Y as ee,c as P,ct as F,ft as I,g as L,it as R,k as te,l as z,m as ne,ot as re,r as ie,tt as ae,u as oe,ut as se,y as ce}from"./design-icons-B6-0w7Aw.js";import{t as le}from"./eye-B8okNWXU.js";import{a as ue,i as B}from"./format-BNCkW110.js";import{t as de}from"./message-square-B-MD-8rD.js";import{t as fe}from"./play-CmVAj_fu.js";import{a as pe,i as me,o as he,r as ge,s as _e,t as ve}from"./dialog-DSwzMeY3.js";import{d as V,t as ye,y as H}from"./prompt-template-menu-DBFmXFq5.js";import{t as U}from"./project-router-CFmb6NlX.js";import{F as W,I as be,L as G,M as xe,P as Se,R as Ce,S as we,_ as Te,a as Ee,b as De,c as Oe,d as ke,f as Ae,g as je,n as Me,r as Ne,s as Pe,t as K,u as Fe,v as Ie,w as Le,x as Re}from"./picker-pill-B8HQMHMO.js";import{d as ze,f as q,i as Be,o as Ve,p as He,s as Ue,t as We,u as Ge}from"./skills-pM_PouEs.js";import{B as Ke,F as qe,L as Je,P as Ye,U as Xe,_n as Ze,z as Qe}from"./index-WeSdteYZ.js";import{t as $e}from"./markdown-twEr0qCN.js";import{t as et}from"./diff-B24jjrQd.js";import{t as tt}from"./tab-link-B8m0q2sJ.js";var J=e(t(),1),Y=n(),nt={squash:`Squash and merge`,merge:`Create a merge commit`,rebase:`Rebase and merge`};function X({state:e}){let t=`size-4 shrink-0`;return e===`passing`?(0,Y.jsx)(P,{size:16,"aria-hidden":`true`,"data-slot":`gh-merge-status-passing`,className:r(t,`text-success`)}):e===`failing`?(0,Y.jsx)(L,{size:16,"aria-hidden":`true`,"data-slot":`gh-merge-status-failing`,className:r(t,`text-danger`)}):e===`pending`?(0,Y.jsx)(ue,{"aria-hidden":`true`,"data-slot":`gh-merge-status-pending`,className:r(t,`animate-spin text-warning`)}):(0,Y.jsx)(ne,{size:16,"aria-hidden":`true`,"data-slot":`gh-merge-status-unknown`,className:r(t,`text-soft-foreground`)})}function rt(e){return e?.available?e.mergeState:null}function it(e,t){return e&&t?.methods.includes(e)?e:t?.defaultMethod??t?.methods[0]??null}function at(e){return e.state===`merged`?`Merged`:e.state===`closed`?`Closed`:e.isDraft?`Draft`:e.mergeable===`conflicting`?`Conflicts must be resolved`:e.canMerge?`Ready to merge`:e.eligibility===`unknown`?`Merge blocked · Requirements unknown`:`Merge blocked`}function ot(e){return e===`approved`||e===`not-required`?`passing`:e===`unknown`?`unknown`:`failing`}function st(e){return e===`mergeable`?`passing`:e===`conflicting`?`failing`:`unknown`}function ct(e){return e===`conflicting`?`present`:e===`mergeable`?`none`:`unknown`}function lt(e){return e===!0?` · required`:e===null?` · requiredness unknown`:``}function ut(e){return e?.available===!1?e.reason:`GitHub could not load merge requirements.`}function dt(e,t,n){return!!(e&&(t.canMerge||t.canOverride&&n))}function Z(e){return e?nt[e]:`Merge`}function ft(e){return e===`conflicting`?`true`:void 0}function pt({check:e}){return(0,Y.jsxs)(`li`,{className:`flex items-center justify-between gap-3`,children:[(0,Y.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,Y.jsx)(X,{state:e.state}),(0,Y.jsxs)(`span`,{children:[e.name,` · `,e.state,lt(e.required)]})]}),e.url&&a(e.url)?(0,Y.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,className:`text-muted-foreground underline`,children:`details`}):null]})}function mt({reason:e}){return(0,Y.jsxs)(`section`,{"data-slot":`gh-merge-unavailable`,className:`mt-6 rounded-lg border border-border bg-card p-4 text-sm`,children:[(0,Y.jsx)(`p`,{className:`font-medium`,children:`Merge status unavailable`}),(0,Y.jsx)(`p`,{className:`mt-1 text-xs text-soft-foreground`,children:e})]})}function ht({state:e,selectedMethod:t,overrideRules:n,mergeEnabled:a,refreshPending:o,onRefresh:s,onRunAgent:c,onConfirm:l,onMethodChange:u,onOverrideChange:d}){let f=at(e),p=ot(e.reviewDecision),m=st(e.mergeable);return(0,Y.jsxs)(`div`,{className:`flex items-start gap-3`,children:[e.canMerge?(0,Y.jsx)(P,{size:16,"aria-hidden":`true`,className:`mt-0.5 size-5 shrink-0 text-success`}):(0,Y.jsx)(re,{size:16,"aria-hidden":`true`,className:`mt-0.5 size-5 shrink-0 text-warning`}),(0,Y.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,Y.jsx)(`h3`,{className:`font-semibold`,children:f}),(0,Y.jsxs)(i,{type:`button`,variant:`ghost`,size:`sm`,disabled:o,onClick:s,children:[(0,Y.jsx)(ee,{size:16,"aria-hidden":`true`,className:r(`size-3.5`,o&&`animate-spin`)}),`Refresh`]})]}),(0,Y.jsxs)(`p`,{className:`mt-1 font-mono text-[11px] text-soft-foreground`,children:[e.headRef,` (`,e.headSha.slice(0,7),`) → `,e.baseRef]}),(0,Y.jsxs)(`ul`,{className:`mt-3 space-y-2 text-xs`,children:[(0,Y.jsxs)(`li`,{className:`flex items-center gap-2`,children:[(0,Y.jsx)(X,{state:p}),(0,Y.jsxs)(`span`,{children:[`Reviews: `,e.reviewDecision.replaceAll(`-`,` `)]})]}),(0,Y.jsxs)(`li`,{className:`flex items-center gap-2`,children:[(0,Y.jsx)(X,{state:m}),(0,Y.jsxs)(`span`,{children:[`Conflicts: `,ct(e.mergeable)]})]}),e.checks.length===0?(0,Y.jsx)(`li`,{children:`No checks configured`}):e.checks.map(e=>(0,Y.jsx)(pt,{check:e},e.name)),e.blockers.map(e=>(0,Y.jsx)(`li`,{className:`text-soft-foreground`,children:e.message},e.code))]}),e.mergeable===`conflicting`&&c?(0,Y.jsx)(i,{className:`mt-4`,onClick:c,children:`Run agent on this PR`}):null,e.canOverride?(0,Y.jsxs)(`label`,{className:`mt-4 flex cursor-pointer items-start gap-2 rounded-md border border-warning/40 bg-warning/5 p-3 text-xs`,children:[(0,Y.jsx)(`input`,{type:`checkbox`,checked:n,onChange:e=>d(e.target.checked),className:`mt-0.5 size-4 accent-accent-strong`}),(0,Y.jsxs)(`span`,{children:[(0,Y.jsx)(`span`,{className:`block font-medium`,children:`Merge without waiting for requirements`}),(0,Y.jsx)(`span`,{className:`mt-0.5 block text-soft-foreground`,children:`GitHub will allow this only if your permissions can bypass the repository rules.`})]})]}):null,e.eligibility===`unknown`?(0,Y.jsx)(`p`,{className:`mt-4 text-xs text-muted-foreground`,children:`GitHub could not confirm review and branch-protection requirements. Passing checks do not establish merge readiness.`}):null,e.state===`open`&&e.methods.length>0?(0,Y.jsxs)(`div`,{className:`mt-4 flex flex-col flex-wrap gap-2 sm:flex-row`,children:[(0,Y.jsx)(`select`,{"aria-label":`Merge method`,value:t??``,onChange:e=>u(e.target.value),className:`h-9 min-w-0 flex-1 rounded-md border border-input bg-background px-3 text-sm`,children:e.methods.map(e=>(0,Y.jsx)(`option`,{value:e,children:nt[e]},e))}),(0,Y.jsx)(i,{disabled:!a,onClick:l,children:Z(t)})]}):null]})]})}function gt({number:e,state:t,selectedMethod:n,confirming:r,overrideRules:a,mergePending:o,mergeError:s,onOpenChange:c,onMerge:l}){return(0,Y.jsx)(ve,{open:r,onOpenChange:c,children:(0,Y.jsxs)(ge,{"data-slot":`gh-merge-confirm`,showCloseButton:!1,children:[(0,Y.jsxs)(he,{children:[(0,Y.jsxs)(_e,{children:[Z(n),` pull request #`,e,`?`]}),(0,Y.jsx)(me,{asChild:!0,children:(0,Y.jsxs)(`div`,{children:[(0,Y.jsxs)(`p`,{children:[`This will merge “`,t.title,`” into `,t.baseRef,`. GitHub will re-check the exact reviewed head before changing the repository.`]}),a&&t.canOverride?(0,Y.jsx)(`p`,{"data-slot":`gh-bypass-warning`,className:`mt-4 text-sm text-warning`,children:`You are asking GitHub to bypass unmet repository requirements; GitHub may refuse if your permissions do not allow it.`}):null]})})]}),s?(0,Y.jsx)(`p`,{className:`text-sm text-danger`,children:s.message}):null,(0,Y.jsxs)(pe,{children:[(0,Y.jsx)(i,{variant:`outline`,disabled:o,onClick:()=>c(!1),children:`Cancel`}),(0,Y.jsx)(i,{disabled:o,onClick:l,children:o?`Merging…`:Z(n)})]})]})})}function _t({number:e,onRunAgent:t}){let n=p(),r=S(),i=D({queryKey:E.githubMergeState(e),queryFn:({signal:t})=>d(e,{},{signal:t}),retry:!1}),a=rt(i.data),[o,s]=(0,J.useState)(null),[c,l]=(0,J.useState)(!1),[f,m]=(0,J.useState)(!1),h=w({mutationFn:t=>d(e,{refresh:!0}),onSuccess:(e,t)=>n.setQueryData(t,e),onError:e=>M(e instanceof Error?e.message:String(e),{tone:`danger`})}),g=it(o,a),_=()=>({mergeState:E.githubMergeState(e),list:E.githubPages(50),comments:E.githubComments(`pr`,e),item:E.githubItem(`pr`,e),refStatus:r===void 0?void 0:E.githubRefStatusOf(r)}),v=w({mutationFn:t=>{if(!a||!g)throw Error(`No merge method is available.`);return u(e,{method:g,expectedHeadSha:a.headSha,...f&&a.canOverride?{overrideRules:!0}:{}})},onSuccess:(t,r)=>{l(!1),M(`Pull request #${e} merged`),n.invalidateQueries({queryKey:r.mergeState}),n.invalidateQueries({queryKey:r.list}),n.invalidateQueries({queryKey:r.comments}),n.invalidateQueries({queryKey:r.item}),r.refStatus&&n.invalidateQueries({queryKey:r.refStatus})},onError:(e,t)=>{M(e instanceof Error?e.message:String(e),{tone:`danger`}),n.invalidateQueries({queryKey:t.mergeState})}});return i.isPending?(0,Y.jsx)(H,{"data-slot":`gh-merge-loading`,className:`mt-6 h-32 w-full`}):a?(0,Y.jsxs)(`section`,{"data-slot":`gh-merge-box`,"data-eligibility":a.eligibility,"data-conflicting":ft(a.mergeable),"aria-live":`polite`,className:`mt-6 rounded-lg border border-border bg-card p-4`,children:[(0,Y.jsx)(ht,{state:a,selectedMethod:g,overrideRules:f,mergeEnabled:dt(g,a,f),refreshPending:h.isPending,onRefresh:()=>h.mutate(E.githubMergeState(e)),onRunAgent:t,onConfirm:()=>l(!0),onMethodChange:s,onOverrideChange:m}),(0,Y.jsx)(gt,{number:e,state:a,selectedMethod:g,confirming:c,overrideRules:f,mergePending:v.isPending,mergeError:v.error,onOpenChange:l,onMerge:()=>v.mutate(_())})]}):(0,Y.jsx)(mt,{reason:ut(i.data)})}function vt(e){let t=new Set;for(let n of e)for(let e of n.labels)t.add(e);return[...t].sort((e,t)=>e.toLowerCase().localeCompare(t.toLowerCase()))}function yt(e,t={}){let n=(t.query??``).trim().toLowerCase(),r=t.labels??[],i=n.replace(/^#/,``),a=i!==``&&/^\d+$/.test(i);return e.filter(e=>r.length>0&&!r.every(t=>e.labels.includes(t))||t.assignees?.length&&!e.assignees?.some(e=>t.assignees.some(t=>t.toLowerCase()===e.toLowerCase()))||t.author!==void 0&&e.author.toLowerCase()!==t.author.toLowerCase()||t.includeNumbers&&!t.includeNumbers.has(e.number)||t.excludeNumbers?.has(e.number)||t.projectId&&e.projectIds!==void 0&&!e.projectIds.includes(t.projectId)?!1:n===``?!0:a?String(e.number).includes(i):`#${e.number} ${e.title} ${e.author} ${e.body??``}`.toLowerCase().includes(n))}function bt(e,t){let n=e.trim();if(n===``)return!1;let r=n.replace(/^#/,``);return/^\d+$/.test(r)?!t.some(e=>e.number===Number(r)):t.length===0}function xt(e){if(!e||!/^[0-9a-fA-F]{6}$/.test(e))return{borderColor:`var(--border)`,color:`var(--muted-foreground)`};let t=`#${e}`;return{backgroundColor:`${t}22`,borderColor:`${t}66`,color:`color-mix(in srgb, ${t} 50%, var(--foreground))`}}function St({label:e,color:t,plain:n=!1}){return(0,Y.jsx)(`span`,{"data-slot":`gh-label`,"data-label":e,style:n?void 0:xt(t),className:n?`text-[11px] font-normal text-muted-foreground`:`rounded-full border px-1.5 py-px text-[12px] font-medium`,children:e})}function Ct(e){return e===`pr`?`pull request`:`issue`}function wt(e,t,n){return e===`pr`&&!!(t||n)}function Tt({backLink:e}){return e?(0,Y.jsxs)(U,{to:e.to,"data-slot":`gh-back`,className:`mb-3 inline-flex items-center gap-1.5 text-xs font-medium text-muted-foreground hover:text-foreground md:hidden`,children:[(0,Y.jsx)(ie,{size:16,"aria-hidden":`true`,className:`size-3.5`}),`Back to the list`]}):null}function Et({item:e,kindWord:t,commentCount:n,hasDiffStat:r,additions:i,deletions:o}){return(0,Y.jsxs)(`p`,{"data-slot":`gh-meta`,className:`flex flex-wrap items-center gap-x-1.5 font-mono text-[11px] text-soft-foreground`,children:[(0,Y.jsxs)(`span`,{children:[`#`,e.number]}),`·`,(0,Y.jsx)(`span`,{children:t}),`·`,(0,Y.jsxs)(`span`,{children:[`opened by `,e.author]}),`·`,(0,Y.jsxs)(`span`,{children:[B(e.createdAt),` ago`]}),n?(0,Y.jsxs)(Y.Fragment,{children:[`·`,(0,Y.jsx)(Xt,{count:n})]}):null,r?(0,Y.jsxs)(Y.Fragment,{children:[`·`,(0,Y.jsxs)(`span`,{"data-slot":`gh-diffstat`,children:[(0,Y.jsxs)(`span`,{className:`text-success`,children:[`+`,i??0]}),` `,(0,Y.jsxs)(`span`,{className:`text-danger`,children:[`−`,o??0]})]})]}):null,`·`,a(e.url)?(0,Y.jsxs)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,"data-slot":`gh-open-link`,className:`inline-flex items-center gap-0.5 text-muted-foreground hover:text-foreground hover:underline`,children:[`open on GitHub`,(0,Y.jsx)(j,{"aria-hidden":`true`,className:`size-2.5`})]}):(0,Y.jsx)(`span`,{"data-slot":`gh-open-link`,className:`text-muted-foreground`,children:`open on GitHub`})]})}function Dt({item:e,subNav:t,changes:n}){return e.kind===`pr`?t?(0,Y.jsxs)(`nav`,{"aria-label":`Pull request detail`,className:`mt-4 flex border-b border-border`,children:[(0,Y.jsx)(tt,{to:V(`prs`,t.filter,e.number),active:!n,children:`Conversation`}),(0,Y.jsx)(tt,{to:V(`prs`,t.filter,e.number,`/changes`),active:n,children:`Changes`})]}):(0,Y.jsx)(U,{to:V(`prs`,null,e.number,`/changes`),"data-slot":`gh-files-changed`,className:`mt-3 inline-flex items-center gap-1 text-xs font-medium text-muted-foreground hover:text-foreground hover:underline`,children:`Files changed`}):null}function Ot({item:e,colors:t,checks:n}){return e.labels.length>0||n?(0,Y.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center gap-1.5`,children:[e.labels.map(e=>(0,Y.jsx)(St,{label:e,color:t[e]},e)),n?(0,Y.jsx)(Zt,{checks:n,url:e.url}):null]}):null}function kt({item:e,colors:t,body:n}){return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`div`,{"data-slot":`gh-body`,className:`mt-5 text-sm`,children:n?(0,Y.jsx)($e,{children:n}):(0,Y.jsx)(`p`,{className:`text-soft-foreground`,children:`(no description)`})}),(0,Y.jsx)(Mt,{item:e,colors:t})]})}function At({item:e,colors:t,checks:n,comments:r,backLink:i,subNav:a,onRunAgent:o,afterHeading:s,children:c}){let l=a?.changes??!1,u=Ct(e.kind),d=v(e.kind,e.number,!l).data?.detail,f=d?.body??e.body,p=d?.additions??e.additions,m=d?.deletions??e.deletions,h=wt(e.kind,p,m),g=r??e.comments;return(0,Y.jsxs)(`article`,{"data-slot":`gh-detail-inner`,className:`min-w-0 px-4 py-4 md:px-7 md:py-5`,children:[(0,Y.jsx)(Tt,{backLink:i}),(0,Y.jsxs)(`div`,{"data-slot":`gh-description-card`,className:e.kind===`pr`?`rounded-xl border border-border bg-card p-6`:void 0,children:[e.kind===`pr`?(0,Y.jsxs)(`h2`,{className:`mb-4 text-[22px] leading-snug font-normal`,children:[`#`,e.number,` `,e.title]}):null,(0,Y.jsx)(Et,{item:e,kindWord:u,commentCount:g,hasDiffStat:h,additions:p,deletions:m}),e.kind===`pr`?null:(0,Y.jsx)(`h2`,{className:`mt-2 text-[22px] leading-snug font-normal`,children:e.title}),s,(0,Y.jsx)(Dt,{item:e,subNav:a,changes:l}),(0,Y.jsx)(Ot,{item:e,colors:t,checks:n}),l&&e.kind===`pr`?(0,Y.jsx)(jt,{item:e}):(0,Y.jsx)(kt,{item:e,colors:t,body:f})]}),e.kind===`pr`?(0,Y.jsx)(_t,{number:e.number,onRunAgent:o}):null,c]})}function jt({item:e}){let t=p(),n=g(e.number),[o,s]=(0,J.useState)(``),[c,l]=(0,J.useState)(null),u=n.data,d=u?.available?u.files.filter(e=>e.path.toLowerCase().includes(o.toLowerCase())):[],f=d.findIndex(e=>e.path===c);(0,J.useEffect)(()=>{d.length>0&&!d.some(e=>e.path===c)&&l(d[0].path)},[u?.available?u.headSha:``,o]);let h=async()=>{let n=u?.available?u.headSha:null,r=E.githubPrChanges(e.number),i=await m(e.number,{refresh:!0});t.setQueryData(r,i),i.available&&n&&n!==i.headSha&&(l(i.files[0]?.path??null),M(`The reviewed revision changed.`))};if(n.isPending)return(0,Y.jsx)(`p`,{"aria-live":`polite`,className:`mt-6 text-sm text-muted-foreground`,children:`Loading changed files…`});if(n.isError||!u)return(0,Y.jsx)(`p`,{className:`mt-6 text-sm text-danger`,children:`Changed files could not be loaded.`});if(!u.available)return(0,Y.jsx)(`p`,{className:`mt-6 text-sm text-muted-foreground`,children:u.reason});let _=d.map(e=>({path:e.path,...e.previousPath?{oldPath:e.previousPath}:{},status:e.status===`removed`?`deleted`:e.status===`changed`?`modified`:e.status,adds:e.additions,dels:e.deletions,binary:e.patchUnavailableReason===`binary`,patch:e.patch??``})),v=a(e.url)?`${e.url}/files`:null,y=d.find(e=>e.path===c);return(0,Y.jsxs)(`section`,{"data-slot":`gh-pr-changes`,className:`mt-5 min-w-0`,children:[(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-xs`,children:[(0,Y.jsxs)(`strong`,{children:[u.files.length,` changed files`]}),(0,Y.jsxs)(`span`,{className:`text-success`,children:[`+`,u.additions]}),(0,Y.jsxs)(`span`,{className:`text-danger`,children:[`−`,u.deletions]}),(0,Y.jsxs)(`span`,{className:`font-mono text-muted-foreground`,title:u.headSha,children:[`head `,u.headSha.slice(0,8)]}),(0,Y.jsx)(i,{type:`button`,variant:`outline`,size:`sm`,className:`ml-auto min-h-11`,onClick:()=>void h(),children:`Refresh`})]}),u.truncated?(0,Y.jsxs)(`p`,{role:`status`,className:`mt-3 rounded-md border border-warning/40 bg-warning/10 p-3 text-xs`,children:[u.reason??`This response is incomplete.`,` `,v?(0,Y.jsx)(`a`,{href:v,target:`_blank`,rel:`noopener noreferrer`,className:`underline`,children:`Open all files on GitHub`}):null]}):null,(0,Y.jsxs)(`div`,{className:`mt-4 grid min-w-0 gap-4 lg:grid-cols-[240px_minmax(0,1fr)]`,children:[(0,Y.jsxs)(`aside`,{className:`min-w-0`,children:[(0,Y.jsx)(`input`,{"aria-label":`Filter changed files`,value:o,onChange:e=>s(e.target.value),placeholder:`Filter files…`,className:`min-h-11 w-full rounded-md border border-input bg-background px-3 text-sm`}),(0,Y.jsx)(`select`,{"aria-label":`Select changed file`,value:c??``,onChange:e=>l(e.target.value),className:`mt-2 min-h-11 w-full rounded-md border border-input bg-background px-2 text-sm lg:hidden`,children:d.map(e=>(0,Y.jsx)(`option`,{children:e.path},e.path))}),(0,Y.jsx)(`ul`,{className:`mt-2 hidden max-h-[60vh] overflow-auto lg:block`,children:d.map(e=>(0,Y.jsx)(`li`,{children:(0,Y.jsxs)(`button`,{type:`button`,onClick:()=>l(e.path),className:r(`min-h-11 w-full truncate rounded px-2 text-left text-xs`,c===e.path&&`bg-muted font-medium`),title:e.path,children:[e.status,` · `,e.path,` `,(0,Y.jsxs)(`span`,{className:`text-success`,children:[`+`,e.additions]}),` `,(0,Y.jsxs)(`span`,{className:`text-danger`,children:[`−`,e.deletions]})]})},e.path))})]}),(0,Y.jsxs)(`div`,{className:`min-w-0`,children:[(0,Y.jsxs)(`div`,{className:`mb-2 flex justify-end gap-1`,children:[(0,Y.jsx)(i,{"aria-label":`Previous file`,variant:`outline`,size:`icon`,className:`min-h-11 min-w-11`,disabled:f<=0,onClick:()=>l(d[f-1]?.path??null),children:(0,Y.jsx)(Ze,{})}),(0,Y.jsx)(i,{"aria-label":`Next file`,variant:`outline`,size:`icon`,className:`min-h-11 min-w-11`,disabled:f<0||f>=d.length-1,onClick:()=>l(d[f+1]?.path??null),children:(0,Y.jsx)(oe,{size:16})})]}),d.length===0?(0,Y.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No changed files match this filter.`}):(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(et,{files:_.filter(e=>e.path===c),wrap:!0,className:`min-w-0`}),y&&!y.patch?(0,Y.jsxs)(`p`,{className:`rounded-b border border-border p-3 text-xs text-muted-foreground`,children:[`Patch unavailable: `,y.patchUnavailableReason??`not-provided`,`.`]}):null]})]})]})]})}function Mt({item:e,colors:t}){let n=v(e.kind,e.number),r=n.data,i=(0,J.useMemo)(()=>{let e=[...(r?.comments??[]).map(e=>({row:`comment`,comment:e})),...(r?.events??[]).map(e=>({row:`event`,event:e}))],t=e=>{let t=Date.parse(Nt(e));return Number.isNaN(t)?-1/0:t};return e.sort((e,n)=>t(e)-t(n))},[r?.comments,r?.events]);return n.isPending?(0,Y.jsxs)(`section`,{"data-slot":`gh-thread-loading`,className:`mt-6 border-t border-border pt-5`,children:[(0,Y.jsx)(H,{className:`mb-3 h-3 w-24`}),(0,Y.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,Y.jsx)(H,{className:`h-14 w-full`}),(0,Y.jsx)(H,{className:`h-14 w-full`})]})]}):!r||!r.available?(0,Y.jsxs)(`section`,{"data-slot":`gh-thread-error`,className:`mt-6 border-t border-border pt-5 text-xs text-soft-foreground`,children:[(0,Y.jsxs)(`span`,{children:[`Couldn’t load comments — `,r?.reason??(n.error instanceof Error?n.error.message:`could not load comments`),`. `]}),(0,Y.jsxs)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex items-center gap-0.5 text-muted-foreground hover:text-foreground hover:underline`,children:[`open on GitHub`,(0,Y.jsx)(j,{"aria-hidden":`true`,className:`size-2.5`})]})]}):i.length===0?null:(0,Y.jsxs)(`section`,{"data-slot":`gh-thread`,className:`mt-6 border-t border-border pt-5`,children:[(0,Y.jsxs)(`h3`,{"data-slot":`gh-thread-header`,className:`mb-4 text-[11px] font-semibold tracking-wide text-soft-foreground uppercase`,children:[`Activity · `,r.comments.length,` comment`,r.comments.length===1?``:`s`]}),(0,Y.jsx)(`ul`,{className:`flex flex-col gap-5`,children:Pt(i).map(e=>e.group===`commits`?(0,Y.jsx)(Ft,{commits:e.commits,colors:t},e.commits[0].id):e.entry.row===`comment`?(0,Y.jsx)(Kt,{comment:e.entry.comment},`${e.entry.comment.kind}-${e.entry.comment.id}`):(0,Y.jsx)(Lt,{event:e.entry.event,colors:t},e.entry.event.id))}),r.truncated?(0,Y.jsxs)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,"data-slot":`gh-thread-truncated`,className:`mt-4 inline-flex items-center gap-0.5 text-xs text-soft-foreground hover:text-foreground hover:underline`,children:[`thread truncated — open on GitHub`,(0,Y.jsx)(j,{"aria-hidden":`true`,className:`size-2.5`})]}):null]})}var Nt=e=>e.row===`comment`?e.comment.createdAt:e.event.createdAt;function Pt(e){let t=[],n=[],r=()=>{n.length!==0&&(n.length===1?t.push({group:`single`,entry:{row:`event`,event:n[0]}}):t.push({group:`commits`,commits:n}),n=[])};for(let i of e){if(i.row===`event`&&i.event.kind===`committed`&&i.row===`event`){let e=n[n.length-1];e&&e.actor!==i.event.actor&&r(),n.push(i.event);continue}r(),t.push({group:`single`,entry:i})}return r(),t}function Ft({commits:e,colors:t}){let[n,r]=(0,J.useState)(!1),i=e[0]?.actor??`?`;return n?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`li`,{"data-slot":`gh-commit-group`,"data-open":`true`,className:`min-w-0`,children:(0,Y.jsxs)(`button`,{type:`button`,"aria-expanded":!0,onClick:()=>r(!1),className:`flex items-center gap-1.5 font-mono text-[11px] text-soft-foreground hover:text-foreground`,children:[(0,Y.jsx)(`span`,{"aria-hidden":`true`,children:It.committed}),(0,Y.jsx)(`span`,{className:`font-sans font-medium text-foreground`,children:i}),(0,Y.jsxs)(`span`,{children:[`added `,e.length,` commits`]})]})}),e.map(e=>(0,Y.jsx)(Lt,{event:e,colors:t},e.id))]}):(0,Y.jsx)(`li`,{"data-slot":`gh-commit-group`,"data-open":`false`,className:`min-w-0`,children:(0,Y.jsxs)(`button`,{type:`button`,"aria-expanded":!1,onClick:()=>r(!0),className:`flex items-center gap-1.5 font-mono text-[11px] text-soft-foreground hover:text-foreground`,children:[(0,Y.jsx)(`span`,{"aria-hidden":`true`,children:It.committed}),(0,Y.jsx)(`span`,{className:`font-sans font-medium text-foreground`,children:i}),(0,Y.jsxs)(`span`,{children:[`added `,e.length,` commits`]}),(0,Y.jsx)(`span`,{className:`shrink-0`,children:B(e[e.length-1].createdAt)})]})})}var It={committed:`⚙`,labeled:`◆`,unlabeled:`◇`,assigned:`◍`,unassigned:`◌`,merged:`⑃`,closed:`⊘`,reopened:`⊙`,head_ref_force_pushed:`↻`,"cross-referenced":`↗`,renamed:`✎`};function Lt({event:e,colors:t}){return(0,Y.jsxs)(`li`,{"data-slot":`gh-event-row`,"data-kind":e.kind,className:r(`flex min-w-0 items-center gap-1.5 font-mono text-[11px] text-soft-foreground`,e.kind===`merged`&&`text-accent-foreground`),children:[(0,Y.jsx)(`span`,{"aria-hidden":`true`,className:`shrink-0`,children:It[e.kind]}),(0,Y.jsx)(`span`,{className:`font-sans font-medium text-foreground`,children:e.actor}),(0,Y.jsx)(Ut,{event:e,colors:t}),(0,Y.jsx)(`span`,{className:`shrink-0`,children:B(e.createdAt)}),e.url?(0,Y.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,"aria-label":`open ${e.kind} on GitHub`,className:`ml-auto shrink-0 text-muted-foreground hover:text-foreground`,children:(0,Y.jsx)(j,{"aria-hidden":`true`,className:`size-2.5`})}):null]})}function Rt({event:e}){return(0,Y.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,Y.jsx)(`span`,{className:`shrink-0`,children:`committed`}),e.sha?(0,Y.jsx)(`span`,{className:`shrink-0 text-muted-foreground`,children:e.sha.slice(0,7)}):null,e.message?(0,Y.jsx)(`span`,{className:`truncate font-sans text-foreground`,children:e.message}):null,(0,Y.jsx)(Wt,{checks:e.checks})]})}function zt({event:e,colors:t}){return(0,Y.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,Y.jsx)(`span`,{className:`shrink-0`,children:e.kind===`labeled`?`added the`:`removed the`}),e.label?(0,Y.jsx)(`span`,{"data-slot":`gh-event-label`,style:xt(e.label.color??t[e.label.name]),className:`max-w-[12rem] truncate rounded-full border px-1.5 py-px font-sans text-[12px]`,children:e.label.name}):null,(0,Y.jsx)(`span`,{className:`shrink-0`,children:`label`})]})}function Bt({event:e}){return(0,Y.jsxs)(`span`,{className:`truncate`,children:[e.kind===`assigned`?`assigned`:`unassigned`,` `,e.subject??`someone`]})}function Vt({event:e}){return(0,Y.jsxs)(`span`,{className:`truncate`,children:[`referenced this in `,e.refNumber?`#${e.refNumber}`:`another thread`,e.refTitle?` ${e.refTitle}`:``]})}var Ht={committed:e=>(0,Y.jsx)(Rt,{event:e}),labeled:(e,t)=>(0,Y.jsx)(zt,{event:e,colors:t}),unlabeled:(e,t)=>(0,Y.jsx)(zt,{event:e,colors:t}),assigned:e=>(0,Y.jsx)(Bt,{event:e}),unassigned:e=>(0,Y.jsx)(Bt,{event:e}),merged:()=>(0,Y.jsx)(`span`,{children:`merged this`}),closed:()=>(0,Y.jsx)(`span`,{children:`closed this`}),reopened:()=>(0,Y.jsx)(`span`,{children:`reopened this`}),head_ref_force_pushed:()=>(0,Y.jsx)(`span`,{children:`force-pushed`}),renamed:e=>(0,Y.jsxs)(`span`,{className:`truncate`,children:[`renamed this to `,e.subject??`—`]}),"cross-referenced":e=>(0,Y.jsx)(Vt,{event:e})};function Ut({event:e,colors:t}){return Ht[e.kind]?.(e,t)??null}function Wt({checks:e}){return e?(0,Y.jsx)(`span`,{"data-slot":`gh-commit-checks`,"data-checks":e,"aria-label":`checks ${e}`,className:r(`shrink-0`,Yt[e]),children:Jt[e]}):null}var Gt={approved:{label:`approved`,tone:`border-success/40 text-success`},changes_requested:{label:`changes requested`,tone:`border-danger/40 text-danger`},commented:{label:`commented`,tone:`border-border text-muted-foreground`},dismissed:{label:`dismissed`,tone:`border-border text-muted-foreground`}};function Kt({comment:e}){let t=e.reviewState?Gt[e.reviewState]:null;return(0,Y.jsxs)(`li`,{"data-slot":`gh-thread-entry`,"data-kind":e.kind,className:`min-w-0`,children:[(0,Y.jsxs)(`div`,{className:`mb-1.5 flex items-center gap-1.5 font-mono text-[11px] text-soft-foreground`,children:[(0,Y.jsx)(qt,{url:e.avatarUrl,login:e.author}),(0,Y.jsx)(`span`,{className:`font-sans font-medium text-foreground`,children:e.author}),(0,Y.jsx)(`span`,{children:B(e.createdAt)}),t?(0,Y.jsx)(`span`,{"data-slot":`gh-review-chip`,"data-review-state":e.reviewState,className:r(`rounded-full border px-1.5 py-px font-sans text-[12px] font-medium`,t.tone),children:t.label}):null,(0,Y.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,"aria-label":`open comment on GitHub`,className:`ml-auto shrink-0 text-muted-foreground hover:text-foreground`,children:(0,Y.jsx)(j,{"aria-hidden":`true`,className:`size-2.5`})})]}),(0,Y.jsx)(`div`,{"data-slot":`gh-thread-body`,className:`text-sm`,children:e.body?(0,Y.jsx)($e,{children:e.body}):(0,Y.jsx)(`p`,{className:`text-soft-foreground`,children:`(no body)`})})]})}function qt({url:e,login:t}){let[n,r]=(0,J.useState)(!1);return e&&!n?(0,Y.jsx)(`img`,{src:e,alt:``,width:16,height:16,loading:`lazy`,onError:()=>r(!0),"data-slot":`gh-avatar`,className:`size-4 shrink-0 rounded-full`}):(0,Y.jsx)(`span`,{"data-slot":`gh-avatar-fallback`,"aria-hidden":`true`,className:`flex size-4 shrink-0 items-center justify-center rounded-full bg-muted text-[8px] font-semibold text-muted-foreground uppercase`,children:t.slice(0,1)||`?`})}var Jt={passing:`✓`,failing:`✗`,pending:`○`},Yt={passing:`text-success`,failing:`text-danger`,pending:`text-muted-foreground`};function Xt({count:e}){return e?(0,Y.jsxs)(`span`,{"data-slot":`gh-comment-count`,"data-count":e,"aria-label":`${e} comment${e===1?``:`s`}`,className:`inline-flex shrink-0 items-center gap-0.5`,children:[(0,Y.jsx)(de,{"aria-hidden":`true`,className:`size-3`}),e]}):null}function Zt({checks:e,url:t}){let n=r(`text-[11px] font-medium`,Yt[e],t&&`hover:underline`),i=`${Jt[e]} checks ${e}`;return t?(0,Y.jsx)(`a`,{href:`${t}/checks`,target:`_blank`,rel:`noopener noreferrer`,"data-slot":`gh-checks`,"data-checks":e,className:n,children:i}):(0,Y.jsx)(`span`,{"data-slot":`gh-checks`,"data-checks":e,className:n,children:i})}function Qt({checks:e}){return(0,Y.jsx)(`span`,{"data-slot":`gh-row-checks`,"data-checks":e,title:`checks ${e}`,"aria-label":`checks ${e}`,className:r(`shrink-0 font-sans text-[11px] font-semibold`,Yt[e]),children:Jt[e]})}function Q(e){return`${e.kind===`pr`?`Address GitHub pull request`:`Fix GitHub issue`} #${e.number}: ${e.title}\n\n${e.url}`}function $t(e,t=[]){let n=Q(e);return e.body?.trim()&&(n+=`\n\n---\n\n${e.body.trim()}`),t.length&&(n+=en(t)),n}function en(e){return`\n\nUse these skills where relevant: ${e.join(`, `)}.`}function tn(e,t){return e.replace(/\{\{\s*number\s*\}\}/gi,()=>`#${t.number}`).replace(/\{\{\s*title\s*\}\}/gi,()=>t.title).replace(/\{\{\s*url\s*\}\}/gi,()=>t.url)}function nn(e,t){if(e.includes(t.url))return!0;let n=t.kind===`pr`?String.raw`(?:pull\s+request|pr)`:String.raw`issue`;return new RegExp(String.raw`\b${n}\s*#?\s*${t.number}\b`,`i`).test(e)}function rn(e,t,n){let r=(n??``).trim();if(!r)return $t(e,t);let i=Q(e),a=r.startsWith(i)?i+tn(r.slice(i.length),e):tn(r,e),o=nn(a,e)?a:`${i}\n\n${a}`;return t.length?o+en(t):o}function an(e){let t=[];for(let n of e.slice(0,8)){let e=new Set(t.map(e=>e.id)),r=n;for(let t=2;e.has(r);t++)r=`${n}-${t}`;t.push({id:r,name:n,skill:n,prompt:`{{task}}`})}return t}function on(e,t,n,r,i={}){return t?{...i,workflow:t,task:rn(e,n.map(e=>e.id),r)}:n.length?{...i,steps:an(n.map(e=>e.id)).map((e,t)=>({...e,...n[t]?.path===void 0?{}:{skillPath:n[t].path}})),task:rn(e,[],r)}:{...i,workflow:`quick-task`,task:rn(e,[],r)}}function sn(e){let t=C(),n=T(),r=N(),i=o(t.data,r.data),a=s(t.data,r.data),c=n.data?.defaultRunner,l=we(e.runner,i,c??i[0]??`claude`),u=n.data?.modelsLocked===!0,{accounts:d,repoAccount:f}=qe(),p=d.some(t=>t.provider===l&&t.id===e.account)?e.account:null,m=x(l,!0,p??f?.[l]),h=Re(u?null:e.model,l,r.data,n.data?.defaultModels,m.data),g=Te(h,m.data);return{runner:l,runnerExplicit:e.runner!==null,model:h,effort:u?``:De(e.effort,g),effortOptions:g,runners:i,uninstalled:a,defaultRunner:c,canRun:t.isSuccess&&i.length>0,modelsLocked:u,providerPending:t.isPending,providerError:t.isError,accounts:d,account:p,repoAccount:f}}function cn(e){return{runner:Le(e.runner,e.defaultRunner,e.runnerExplicit),model:e.modelsLocked?void 0:e.model||void 0,effort:e.modelsLocked?void 0:e.effort||void 0}}function ln(e){return{...cn(e),...e.account?{agentProfile:e.account}:{}}}function un(e,t){let{runners:n,uninstalled:r}=e;return n.length>1||r.length>0||n.some(e=>Ye(t,e))}function dn({pick:e,onChange:t,disabled:n=!1,accounts:r=!1,layout:i}){let a=(0,J.useRef)(null),o=(0,J.useRef)(null),[s,c]=(0,J.useState)(()=>typeof window<`u`&&window.innerWidth<=767);(0,J.useLayoutEffect)(()=>{let e=a.current;if(i!==`row`||!e)return;let t=()=>{let t=window.innerWidth<=767||e.getBoundingClientRect().width<550,n=document.activeElement;o.current=n instanceof HTMLElement&&e.contains(n)?n:null,c(t)};t();let n=typeof ResizeObserver>`u`?null:new ResizeObserver(t);return n?.observe(e),window.addEventListener(`resize`,t),()=>{n?.disconnect(),window.removeEventListener(`resize`,t)}},[i]),(0,J.useLayoutEffect)(()=>{let e=o.current;o.current=null,e&&e.isConnected&&document.activeElement!==e&&e.focus()},[s]);let l=sn(e),{runner:u,model:d,effort:f,effortOptions:p,runners:m,canRun:h,modelsLocked:g}=l,_=T(),v=N(),y=x(u,!0,l.account??l.repoAccount?.[u]),b=Ie(u,v.data,y.data,[e.model,_.data?.defaultModels?.[u]]),S=n||!h,C=r?l.accounts:[],w=un(l,C)?(0,Y.jsx)(Ne,{icon:(0,Y.jsx)(R,{"aria-hidden":`true`,className:`size-[18px] shrink-0 text-accent-text`}),fieldLabel:!0,runners:m,uninstalled:l.uninstalled,value:u,accounts:C,account:r?l.account:null,repoAccount:r?l.repoAccount:void 0,disabled:S,onPick:(n,i)=>t(r?{runner:n,account:i,model:n===u?e.model:null,effort:e.effort}:{runner:n,account:null,model:null,effort:e.effort})},`runner`):null,E=(0,Y.jsx)(K,{icon:(0,Y.jsx)(ce,{"aria-hidden":`true`,className:`size-[18px] shrink-0 text-accent-text`}),fieldLabel:!0,slot:`model-pill`,ariaLabel:`Model`,label:d===``?`Default`:b.find(e=>e.id===d).label,value:d,disabled:S,readOnly:g===!0,disabledHint:g?`Model selection is locked to native coding-agent settings.`:void 0,onPick:n=>{let r=Te(n,y.data);t({...e,model:n,effort:e.effort===null?null:De(e.effort,r)})},options:b.map(e=>({value:e.id,label:e.label,desc:e.desc})),status:je(u,v.data,y)},`model`),D=(0,Y.jsx)(K,{icon:(0,Y.jsx)(te,{"aria-hidden":`true`,className:`size-[18px] shrink-0 text-accent-text`}),fieldLabel:!0,slot:`effort-pill`,ariaLabel:`Effort`,label:p.find(e=>e.value===f)?.label??`auto`,value:f,disabled:S,readOnly:g===!0,disabledHint:g?`Effort selection is locked to native coding-agent settings.`:void 0,onPick:n=>t({...e,effort:n}),options:p.map(e=>({value:e.value,label:e.label,desc:e.desc}))},`effort`);return i===`row`?(0,Y.jsx)(`div`,{ref:a,"data-slot":`engine-row-box`,children:(0,Y.jsx)(`div`,{"data-slot":`engine-row`,className:`engine-row`,role:`group`,"aria-label":`Agent settings`,children:(0,Y.jsx)(Me,{children:s?[w,D,E]:[w,E,D]})})}):(0,Y.jsxs)(Me,{children:[w,E,D]})}var fn={workflow:null,skills:[]},pn=`cez-followup-selection`;function mn(e){let t=e&&typeof e==`object`?e:{};return{workflow:typeof t.workflow==`string`?t.workflow:null,skills:Array.isArray(t.skills)?t.skills.flatMap(e=>typeof e==`string`?[{id:e}]:!e||typeof e!=`object`||typeof e.id!=`string`?[]:[{id:e.id,...typeof e.path==`string`?{path:e.path}:{}}]):[]}}function hn(){try{let e=localStorage.getItem(pn);return e?mn(JSON.parse(e)):{...fn}}catch{return{...fn}}}function gn(e){try{localStorage.setItem(pn,JSON.stringify(e))}catch{}}var $=`cez-followup-prompt:`;function _n(e){try{return localStorage.getItem($+e)??``}catch{return``}}function vn(e,t){try{t===``?localStorage.removeItem($+e):localStorage.setItem($+e,t)}catch{}}function yn({item:e,workflows:t,skills:n,workflow:r,onWorkflowChange:o,selectedSkills:s,onSkillsChange:l,engine:u,onEngineChange:d,queuedRunId:f,onQueued:m}){let g=p(),_=y(),v=e.kind===`pr`?`PR`:`issue`,x=sn(u),S=b(x.runner,x.account),C=s.filter(e=>S.unchecked||e.path===void 0||n.some(t=>t.id===e.id&&(e.path===void 0||t.path===e.path))),T=C.length!==s.length,[D]=(0,J.useState)(()=>Q(e)),[O,k]=(0,J.useState)(()=>_n(e.url)||D),A=(0,J.useRef)(null),j=(0,J.useRef)(null);(0,J.useEffect)(()=>{vn(e.url,O===D?``:O)},[e.url,O,D]);let N=(0,J.useMemo)(()=>Fe(_.data?.promptTemplates),[_.data?.promptTemplates]),ee=e=>{let t=A.current,n=Ae({prompt:O,base:D,selectionStart:t?.selectionStart??null,focused:document.activeElement===t,remembered:j.current}),r=Oe(O,n,e);k(r.text),j.current=r.caret,requestAnimationFrame(()=>{A.current?.focus(),A.current?.setSelectionRange(r.caret,r.caret)})},F=Pe(N,C.map(e=>e.id)),I=(0,J.useRef)(O);I.current=O;let L=(0,J.useRef)(``);(0,J.useEffect)(()=>{let e=ke(I.current,L.current,F,D);L.current=e.applied,e.text!==I.current&&k(e.text)},[F,D]);let R=w({mutationFn:async()=>!x.canRun||T?null:h(on(e,r,C,O,ln(x))),onSuccess:t=>{if(t===null)return;let n=t;n&&m(e.url,n.id),M(`Added to the queue — ${v} #${e.number}`),C.length>0&&_.data!==void 0&&c({skillUsage:C.reduce((e,t)=>We(e,t.id),_.data.skillUsage)}).then(()=>g.invalidateQueries({queryKey:E.uiState})).catch(()=>{}),vn(e.url,``),k(D),L.current=``,g.invalidateQueries({queryKey:E.runs.all})},onError:e=>M(e.message,{tone:`danger`})}),te=e=>{Qe({key:e.key,shiftKey:e.shiftKey,metaKey:e.metaKey,ctrlKey:e.ctrlKey,altKey:e.altKey,repeat:e.repeat,isComposing:e.nativeEvent.isComposing})&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),!R.isPending&&x.canRun&&R.mutate())},z=e=>l(s.some(t=>q(t)===q(e))?s.filter(t=>q(t)!==q(e)):[...s,Ue(e)]);return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`section`,{"data-slot":`gh-hand`,className:`mt-7 rounded-lg border border-border bg-card p-4`,children:[(0,Y.jsx)(`h3`,{className:`text-xl font-normal text-foreground`,children:`Hand this to the agent`}),(0,Y.jsxs)(`label`,{className:`gh-field gh-prompt-field`,children:[(0,Y.jsx)(`span`,{children:`Instructions for the agent`}),(0,Y.jsx)(Xe,{ref:A,"data-slot":`gh-custom-prompt`,"aria-label":`Custom prompt`,"aria-keyshortcuts":`Control+Enter Meta+Enter`,value:O,onChange:e=>k(e.target.value),onSelect:e=>{j.current=e.currentTarget.selectionStart},onKeyDown:te,placeholder:`Instructions for the agent… (#${e.number} and its link are always sent)`,className:`mt-3 min-h-20 text-[13px]`})]}),(0,Y.jsx)(ye,{templates:N,onInsert:ee}),(0,Y.jsxs)(`div`,{className:`gh-handoff-settings`,children:[(0,Y.jsxs)(`div`,{className:`gh-field`,children:[(0,Y.jsx)(`span`,{children:`Workflow`}),(0,Y.jsx)(xn,{workflows:t,value:r,onChange:o})]}),(0,Y.jsxs)(`div`,{className:`gh-field`,children:[(0,Y.jsx)(`span`,{children:`Skills · select one or more`}),(0,Y.jsx)(Cn,{skills:n,skillUsage:_.data?.skillUsage,selected:s,onToggle:z})]}),s.length>0?(0,Y.jsx)(`div`,{"data-slot":`gh-skill-chips`,className:`mt-2.5 flex flex-wrap gap-1.5`,children:s.map(e=>(0,Y.jsx)(bn,{skill:e,skills:n,unchecked:S.unchecked,onRemove:()=>z(e)},q(e)))}):null,T?(0,Y.jsx)(`p`,{role:`alert`,children:`A selected skill path is unavailable. Remove it or choose a current copy before starting.`}):null,(0,Y.jsx)(dn,{layout:`row`,pick:u,onChange:d,disabled:R.isPending||!x.canRun,accounts:!0}),(0,Y.jsxs)(`div`,{className:`gh-field`,children:[(0,Y.jsx)(`span`,{children:`Account`}),(0,Y.jsx)(Sn,{resolved:x,disabled:R.isPending||!x.canRun,onPick:e=>d({...u,account:e})})]}),!x.providerPending&&!x.canRun?(0,Y.jsxs)(`span`,{"data-slot":`gh-provider-gate`,className:`inline-flex flex-wrap items-center gap-1 text-xs text-muted-foreground`,children:[x.providerError?`Provider authentication could not be verified.`:`Connect an agent provider to run this item.`,(0,Y.jsx)(U,{to:`/settings/agent-defaults#providers`,className:`font-medium text-foreground underline underline-offset-4`,children:`Configure providers`})]}):null]}),(0,Y.jsxs)(`p`,{className:`text-[11px] leading-relaxed text-muted-foreground`,children:[e.kind===`pr`?`PR`:`Issue`,` number and link remain attached to the task. Edit the prompt before starting. Cmd/Ctrl+Enter submits; Enter adds a new line.`]})]}),(0,Y.jsxs)(`div`,{"data-slot":`gh-handoff-actions`,className:`mt-[22px] flex flex-wrap items-center gap-2.5`,children:[a(e.url)?(0,Y.jsx)(i,{asChild:!0,variant:`outline`,children:(0,Y.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,children:`Open in GitHub`})}):null,(0,Y.jsxs)(i,{variant:`primary`,"data-action":`gh-run`,disabled:R.isPending||!x.canRun||T,onClick:()=>R.mutate(),children:[(0,Y.jsx)(fe,{"aria-hidden":`true`,className:`size-3.5`}),`Run agent on this `,v]}),(0,Y.jsx)(`kbd`,{"aria-hidden":`true`,className:`rounded-[5px] border border-b-2 border-border bg-card px-[5px] py-px font-mono text-[11px] font-medium text-muted-foreground`,children:Ke()}),f?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`span`,{"data-slot":`gh-queued`,className:`flex items-center gap-1 text-xs font-medium text-success`,children:[(0,Y.jsx)(P,{size:16,"aria-hidden":`true`,className:`size-3.5`}),`queued`]}),(0,Y.jsx)(U,{to:`/tasks/${f}`,"data-slot":`gh-view-run`,className:`text-xs font-semibold text-accent-text hover:underline`,children:`View task →`})]}):null]})]})}function bn({skill:e,skills:t,unchecked:n,onRemove:r}){let i=t.find(t=>t.id===e.id&&(e.path===void 0||t.path===e.path)),a=[i?.name??e.id,e.path].filter(Boolean).join(` · `),o=!n&&e.path!==void 0&&!i?` (unavailable)`:n||!i?` (unchecked)`:``;return(0,Y.jsxs)(`button`,{type:`button`,"data-slot":`gh-skill-chip`,"data-skill":e.id,onClick:r,title:`Remove skill ${a}`,"aria-label":`Remove skill ${a}`,className:`inline-flex min-h-11 items-center gap-2 rounded-lg border border-border bg-card px-3 text-xs font-medium text-foreground transition-colors hover:bg-danger/10 hover:text-danger`,children:[a,o,(0,Y.jsx)(I,{size:16,"aria-hidden":`true`,className:`size-3`})]})}function xn({workflows:e,value:t,onChange:n}){let[i,a]=(0,J.useState)(!1),[o,s]=(0,J.useState)(``),c=(0,J.useRef)(null),l=ze(e,o);return(0,Y.jsxs)(A,{open:i,onOpenChange:e=>{a(e),e||s(``)},children:[(0,Y.jsx)(k,{asChild:!0,children:(0,Y.jsxs)(`button`,{type:`button`,"data-slot":`gh-workflow-trigger`,"aria-label":`Choose a workflow`,className:r(Ee,t&&`border-foreground/60 font-mono text-[11px] font-semibold text-foreground`),children:[(0,Y.jsx)(se,{size:16,"aria-hidden":`true`,className:`size-3 shrink-0 text-accent-icon`}),(0,Y.jsx)(`span`,{className:`min-w-0 max-w-44 truncate`,children:t??`workflow`}),(0,Y.jsx)(z,{size:16,"aria-hidden":`true`,className:`size-2.5 shrink-0 text-soft-foreground`})]})}),(0,Y.jsx)(O,{align:`start`,sideOffset:8,className:`w-[320px] max-w-[calc(100vw-2rem)] p-0`,children:(0,Y.jsxs)(xe,{shouldFilter:!1,children:[(0,Y.jsx)(be,{placeholder:`search workflows…`,value:o,onValueChange:s,onInput:()=>c.current?.scrollTo(0,0)}),(0,Y.jsxs)(Ce,{ref:c,"data-slot":`gh-workflow-menu`,className:`max-h-[min(16rem,calc(var(--radix-popover-content-available-height)-3rem))]`,children:[l.length===0?(0,Y.jsx)(Se,{children:`Nothing matches.`}):null,(0,Y.jsx)(W,{children:l.map(e=>{let r=t===e.name;return(0,Y.jsxs)(G,{value:`workflow ${e.name}`,keywords:He(e.name,e.description),"data-slot":`gh-workflow-option`,"data-workflow":e.name,onSelect:()=>{n(r?null:e.name),a(!1)},children:[(0,Y.jsx)(`span`,{className:`shrink-0 font-mono text-xs`,children:e.name}),e.description?(0,Y.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-xs text-soft-foreground`,children:e.description}):null,r?(0,Y.jsx)(P,{size:16,"aria-hidden":`true`,className:`ml-auto size-3.5 shrink-0 text-link-foreground`}):null]},e.name)})})]})]})})]})}function Sn({resolved:e,disabled:t,onPick:n}){let r=e.accounts.filter(t=>t.provider===e.runner),i=[...r.some(e=>e.id==="default")?[]:[{value:l,label:`Default`}],...r.map(e=>({value:e.id,label:e.label,desc:e.configDir}))],a=e.account??e.repoAccount?.[e.runner]??`default`;return(0,Y.jsx)(K,{icon:(0,Y.jsx)(F,{"aria-hidden":`true`,className:`size-[18px] shrink-0 text-accent-text`}),slot:`account-pill`,ariaLabel:`Account`,label:i.find(e=>e.value===a)?.label??`Default`,value:a,options:i,disabled:t,onPick:n})}function Cn({skills:e,skillUsage:t,selected:n,onToggle:i}){let[a,o]=(0,J.useState)(!1),[s,c]=(0,J.useState)(``),[l,u]=(0,J.useState)(null),d=(0,J.useRef)(null),{mostUsed:f,project:p,global:m,ranked:h}=Ge(e,s,t),g=(e,t)=>{let a=n.some(t=>q(t)===q(e));return(0,Y.jsxs)(G,{value:q(e),keywords:He(e.name,e.description),"data-slot":`gh-skill-option`,"data-skill":e.id,"data-selected":a?`true`:void 0,onSelect:()=>i(Ue(e)),children:[(0,Y.jsx)(`span`,{className:r(`shrink-0 font-mono text-xs`,t&&`font-semibold`),children:e.name}),e.path?(0,Y.jsx)(`span`,{className:`min-w-0 truncate text-xs`,children:e.path}):null,e.description?(0,Y.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-xs text-soft-foreground`,children:e.description}):null,(0,Y.jsx)(`button`,{type:`button`,"data-slot":`gh-skill-view`,"aria-label":`View skill ${e.name}`,title:`View skill`,onClick:t=>{t.preventDefault(),t.stopPropagation(),u(e)},className:`ml-auto shrink-0 rounded-sm p-0.5 text-soft-foreground transition-colors hover:text-foreground`,children:(0,Y.jsx)(le,{"aria-hidden":`true`,className:`size-3.5`})}),a?(0,Y.jsx)(P,{size:16,"aria-hidden":`true`,className:`size-3.5 shrink-0 text-link-foreground`}):null]},q(e))};return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(Je,{skill:l,onClose:()=>u(null)}),(0,Y.jsxs)(A,{open:a,onOpenChange:e=>{o(e),e||c(``)},children:[(0,Y.jsx)(k,{asChild:!0,children:(0,Y.jsxs)(`button`,{type:`button`,"data-slot":`gh-skills-trigger`,"aria-label":`Choose skills`,className:r(Ee,n.length>0&&`border-foreground/60 font-semibold text-foreground`),children:[(0,Y.jsx)(ae,{size:16,"aria-hidden":`true`,className:`size-3 shrink-0 text-accent-icon`}),`skills`,n.length>0?` · ${n.length}`:``,(0,Y.jsx)(z,{size:16,"aria-hidden":`true`,className:`size-2.5 shrink-0 text-soft-foreground`})]})}),(0,Y.jsx)(O,{align:`start`,sideOffset:8,className:`w-[336px] max-w-[calc(100vw-2rem)] p-0`,children:(0,Y.jsxs)(xe,{shouldFilter:!1,children:[(0,Y.jsx)(be,{placeholder:`search skills…`,value:s,onValueChange:c,onInput:()=>d.current?.scrollTo(0,0)}),(0,Y.jsxs)(Ce,{ref:d,"data-slot":`gh-skill-menu`,className:`max-h-[min(16rem,calc(var(--radix-popover-content-available-height)-3rem))]`,children:[s.trim()&&!e.some(e=>e.id===s.trim())?(0,Y.jsx)(W,{children:(0,Y.jsxs)(G,{value:`typed-skill`,onSelect:()=>i({id:s.trim()}),children:[`Use skill id “`,s.trim(),`” (unchecked)`]})}):null,(h?h.length===0:f.length===0&&p.length===0&&m.length===0)?(0,Y.jsx)(Se,{children:`Nothing matches.`}):null,h?h.length>0?(0,Y.jsx)(W,{children:h.map(e=>g(e,Be(e)))}):null:(0,Y.jsxs)(Y.Fragment,{children:[f.length>0?(0,Y.jsx)(W,{heading:`Most used`,children:f.map(e=>g(e,Be(e)))}):null,p.length>0?(0,Y.jsx)(W,{heading:`Project skills`,children:p.map(e=>g(e,!0))}):null,m.length>0?(0,Y.jsx)(W,{heading:`Global`,children:m.map(e=>g(e,!1))}):null]})]})]})})]})]})}var wn=new WeakMap;function Tn(){let e=hn(),t={workflow:e.workflow,selectedSkills:e.skills,engine:{runner:null,model:null,effort:null,account:null},queued:new Map},n=new Set;return{snapshot:()=>t,subscribe:e=>(n.add(e),()=>{n.delete(e)}),update:e=>{t={...t,...e},(e.workflow!==void 0||e.selectedSkills!==void 0)&&gn({workflow:t.workflow,skills:[...t.selectedSkills]}),n.forEach(e=>e())}}}function En(){let e=p(),{projectId:t}=f(),n=wn.get(e);n||wn.set(e,n=new Map);let r=n.get(t);r||n.set(t,r=Tn());let{snapshot:i,subscribe:a,update:o}=r,s=(0,J.useSyncExternalStore)(a,i,i),c=_(),l=sn(s.engine),u=b(l.runner,l.account),d=y(),m=c.data?.workflows;(0,J.useEffect)(()=>{m&&s.workflow!==null&&!m.some(e=>e.name===s.workflow)&&o({workflow:null})},[o,m,s.workflow]);let h=(0,J.useMemo)(()=>Ve(u.data??[],d.data?.skillUsage),[u.data,d.data?.skillUsage]);return{...s,workflows:c,skillList:h,skillsUnchecked:u.unchecked,setWorkflow:e=>o({workflow:e}),setSelectedSkills:e=>o({selectedSkills:e}),setEngine:e=>o({engine:e}),onQueued:(e,t)=>o({queued:new Map(i().queued).set(e,t)})}}export{Xt as a,Pt as c,xt as d,bt as f,Qt as i,vt as l,yn as n,At as o,$t as r,St as s,En as t,yt as u};
@@ -1,4 +1,4 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{E as r,l as i,t as a}from"./button-C1fD-ZFr.js";import{Bt as o,E as s,Ut as c,a as l,j as u,ti as d}from"./project-scope-context-Dlbq88xo.js";import{At as f,Et as p,Ft as ee,Yt as m,t as te}from"./queries-BtkCvBtK.js";import{n as h}from"./toaster-Cxgzn9ip.js";import{J as g,S as _,X as v,at as y,b as ne,c as re,ft as ie,i as b,l as x,lt as S,n as ae,ot as oe,st as C,tt as se,v as w,x as T}from"./design-icons-B6-0w7Aw.js";import{i as E,p as ce,r as D,t as O}from"./dropdown-menu-D4zMgwkC.js";import{i as k,o as A,r as j,s as le,t as M}from"./dialog-DSwzMeY3.js";import{_ as ue,a as de,d as fe,g as pe,h as N,i as P,l as me,m as F,o as he,p as ge,r as _e,s as ve,t as ye,v as I}from"./sortable.esm-zp_qkYGV.js";import{i as L,l as be,o as xe}from"./skills-pM_PouEs.js";import{t as Se}from"./centered-state-CiiA8Vgw.js";import{O as Ce,U as R,dt as z,ft as B,gt as V,ht as H,lt as U,mt as W,pt as G,tn as K,ut as we}from"./index-D4lUB-OA.js";var q=e(t(),1);function J(e){let t=[];for(let n of e){if(n.command||!n.skill||n.prompt!==void 0&&n.prompt!==`{{task}}`||n.name!==void 0&&n.name!==n.skill||n.timeoutMs!==void 0||n.model||n.effort!==void 0||n.runner||n.agentProfile||n.allowedTools||n.bashAllowlist||n.onFail)return null;t.push(n.skill)}return t.length?t:null}function Te(e,t){let n=new Set(t.map(e=>e.id)),r=e;for(let t=2;n.has(r);t++)r=`${e}-${t}`;return{id:r,name:e,skill:e,prompt:`{{task}}`}}function Ee(e,t,n){let r=[...e];return r.splice(Math.max(0,Math.min(n,r.length)),0,t),r}function De(e,t,n){if(t===n||t<0||t>=e.length||n<0||n>=e.length)return[...e];let r=[...e],[i]=r.splice(t,1);return i===void 0?[...e]:(r.splice(n,0,i),r)}function Oe(e,t){return e.filter((e,n)=>n!==t)}function Y(e){let t=String(e),n=/^[A-Za-z0-9._][A-Za-z0-9 ._/-]*$/.test(t)&&!t.endsWith(` `),r=/^(true|false|yes|no|on|off|null|~)$/i.test(t)||/^[-+.]?\d/.test(t);return n&&!r?t:JSON.stringify(t)}function X(e,t,n){let r=` `.repeat(n);return t.includes(`
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{E as r,l as i,t as a}from"./button-C1fD-ZFr.js";import{Bt as o,E as s,Ut as c,a as l,j as u,ti as d}from"./project-scope-context-Dlbq88xo.js";import{At as f,Et as p,Ft as ee,Yt as m,t as te}from"./queries-BtkCvBtK.js";import{n as h}from"./toaster-Cxgzn9ip.js";import{J as g,S as _,X as v,at as y,b as ne,c as re,ft as ie,i as b,l as x,lt as S,n as ae,ot as oe,st as C,tt as se,v as w,x as T}from"./design-icons-B6-0w7Aw.js";import{i as E,p as ce,r as D,t as O}from"./dropdown-menu-D4zMgwkC.js";import{i as k,o as A,r as j,s as le,t as M}from"./dialog-DSwzMeY3.js";import{_ as ue,a as de,d as fe,g as pe,h as N,i as P,l as me,m as F,o as he,p as ge,r as _e,s as ve,t as ye,v as I}from"./sortable.esm-zp_qkYGV.js";import{i as L,l as be,o as xe}from"./skills-pM_PouEs.js";import{t as Se}from"./centered-state-CiiA8Vgw.js";import{O as Ce,U as R,dt as z,ft as B,gt as V,ht as H,lt as U,mt as W,pt as G,tn as K,ut as we}from"./index-WeSdteYZ.js";var q=e(t(),1);function J(e){let t=[];for(let n of e){if(n.command||!n.skill||n.prompt!==void 0&&n.prompt!==`{{task}}`||n.name!==void 0&&n.name!==n.skill||n.timeoutMs!==void 0||n.model||n.effort!==void 0||n.runner||n.agentProfile||n.allowedTools||n.bashAllowlist||n.onFail)return null;t.push(n.skill)}return t.length?t:null}function Te(e,t){let n=new Set(t.map(e=>e.id)),r=e;for(let t=2;n.has(r);t++)r=`${e}-${t}`;return{id:r,name:e,skill:e,prompt:`{{task}}`}}function Ee(e,t,n){let r=[...e];return r.splice(Math.max(0,Math.min(n,r.length)),0,t),r}function De(e,t,n){if(t===n||t<0||t>=e.length||n<0||n>=e.length)return[...e];let r=[...e],[i]=r.splice(t,1);return i===void 0?[...e]:(r.splice(n,0,i),r)}function Oe(e,t){return e.filter((e,n)=>n!==t)}function Y(e){let t=String(e),n=/^[A-Za-z0-9._][A-Za-z0-9 ._/-]*$/.test(t)&&!t.endsWith(` `),r=/^(true|false|yes|no|on|off|null|~)$/i.test(t)||/^[-+.]?\d/.test(t);return n&&!r?t:JSON.stringify(t)}function X(e,t,n){let r=` `.repeat(n);return t.includes(`
2
2
  `)?[`${r}${e}: |`,...t.split(`
3
3
  `).map(e=>`${r} ${e}`)]:[`${r}${e}: ${Y(t)}`]}function ke(e){let t=[];return e.name&&e.name!==e.id&&t.push(` name: ${Y(e.name)}`),e.skill&&t.push(` skill: ${Y(e.skill)}`),t}function Ae(e){let t=[];return e.model&&t.push(` model: ${Y(e.model)}`),e.timeoutMs!==void 0&&t.push(` timeoutMs: ${e.timeoutMs}`),e.effort!==void 0&&t.push(` effort: ${Y(e.effort)}`),e.runner&&t.push(` runner: ${Y(e.runner)}`),e.agentProfile&&t.push(` agentProfile: ${Y(e.agentProfile)}`),t}function Z(e){let t=[];return e.allowedTools&&t.push(` allowedTools: [${e.allowedTools.map(Y).join(`, `)}]`),e.bashAllowlist&&t.push(` bashAllowlist: [${e.bashAllowlist.map(Y).join(`, `)}]`),t}function je(e){return e.onFail?[` onFail:`,` retry: ${Y(e.onFail.retry)}`,` max: ${e.onFail.max??2}`]:[]}function Me(e){return[` - id: ${Y(e.id)}`,...ke(e),...e.prompt?X(`prompt`,e.prompt,4):[],...Ae(e),...Z(e),...e.command?X(`command`,e.command,4):[],...je(e)]}function Ne(e,t,n){let r=[`name: ${Y(e.trim()||`my-workflow`)}`];t.trim()&&r.push(...X(`description`,t.trim(),0));let i=J(n);if(i){r.push(`skills:`);for(let e of i)r.push(` - ${Y(e)}`)}else if(n.length){r.push(`steps:`);for(let e of n)r.push(...Me(e))}else r.push(`skills: []`);return`${r.join(`
4
4
  `)}\n`}function Pe(e){return e.trim().toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-+|-+$/g,``)||`workflow`}function Fe(e){let t=J(e)?`skill`:`step`;return`${e.length} ${t}${e.length===1?``:`s`}`}function Ie(e,t){let n=new Set,r=[];for(let t of e.steps.slice(0,8)){let e=t.id||`step`,i=e;for(let t=2;n.has(i);t++)i=`${e}-${t}`;n.add(i),r.push({...t,id:i})}return{name:e.name?.trim()||t,steps:r}}function Le(e,t,n){let r=J(n);return{name:e.trim(),...t.trim()?{description:t.trim()}:{},...r?{skills:r}:{steps:[...n]}}}var Q=n();function Re({workflows:e,draft:t,trimmedName:n,nameRef:r,onDraft:i,onLoadWorkflow:a}){return(0,Q.jsxs)(`section`,{"data-slot":`wb-metadata`,className:`flex min-w-0 flex-col gap-3`,children:[(0,Q.jsxs)(`div`,{"data-slot":`wb-load`,className:`flex flex-col items-start gap-2`,children:[(0,Q.jsx)(`label`,{htmlFor:`workflow-load`,className:`text-xs text-muted-foreground`,children:`Load an existing workflow`}),(0,Q.jsxs)(`div`,{className:`relative max-w-full`,children:[(0,Q.jsx)(x,{"aria-hidden":`true`,className:`pointer-events-none absolute left-3 top-3.5 size-4 text-muted-foreground`}),(0,Q.jsxs)(`select`,{id:`workflow-load`,value:e.some(e=>e.name===n)?n:``,onChange:t=>{let n=e.find(e=>e.name===t.target.value);n&&a(n)},className:`h-11 max-w-full rounded-lg border border-border bg-card pl-9 pr-3 text-xs font-medium appearance-none focus-visible:outline-2 focus-visible:outline-ring`,children:[(0,Q.jsx)(`option`,{value:``,disabled:!0,children:`Choose a workflow`}),e.map(e=>(0,Q.jsx)(`option`,{value:e.name,"data-slot":`wb-load-option`,"data-name":e.name,children:e.name},e.name))]})]})]}),(0,Q.jsx)(`label`,{htmlFor:`workflow-name`,className:`text-xs font-semibold`,children:`Workflow name`}),(0,Q.jsx)(K,{id:`workflow-name`,ref:r,"data-slot":`wb-name`,"aria-label":`Workflow name`,spellCheck:!1,value:t.name,onChange:e=>i({...t,name:e.target.value}),className:`h-12 bg-card text-sm`}),(0,Q.jsx)(`label`,{htmlFor:`workflow-description`,className:`text-xs font-semibold`,children:`Description`}),(0,Q.jsx)(R,{id:`workflow-description`,"data-slot":`wb-description`,"aria-label":`Description`,value:t.description,onChange:e=>i({...t,description:e.target.value}),className:`min-h-[72px] bg-card p-3.5 text-sm`})]})}function ze({savedFile:e,autoOpen:t,onImportToggle:n,onExport:r,onAutoToggle:i,onDeleteRequest:o}){return(0,Q.jsxs)(`div`,{"data-slot":`wb-actions`,className:`grid grid-cols-[max-content_max-content] items-center justify-start gap-2 sm:flex sm:flex-wrap [&_button]:min-h-11 [&_button]:border [&_button]:border-border [&_button]:bg-card`,children:[(0,Q.jsxs)(a,{type:`button`,variant:`ghost`,size:`sm`,"data-slot":`wb-import`,className:`col-span-2 justify-self-start`,onClick:n,children:[(0,Q.jsx)(C,{"aria-hidden":`true`,className:`size-3`}),`Import`]}),(0,Q.jsxs)(a,{type:`button`,variant:`ghost`,size:`sm`,"data-slot":`wb-export`,className:`col-span-2 justify-self-start`,title:`Download workflow.yaml`,onClick:r,children:[(0,Q.jsx)(ne,{"aria-hidden":`true`,className:`size-3`}),`Export`]}),(0,Q.jsxs)(a,{type:`button`,variant:`ghost`,size:`sm`,"data-slot":`wb-auto`,"aria-expanded":t,title:`Describe a chain — the agent builds it`,onClick:i,children:[(0,Q.jsx)(S,{"aria-hidden":`true`,className:`size-3`}),`Auto`]}),e?(0,Q.jsxs)(a,{type:`button`,variant:`ghost`,size:`sm`,"data-slot":`wb-delete`,className:`text-danger hover:text-danger`,title:`Delete the saved workflow file`,onClick:o,children:[(0,Q.jsx)(y,{"aria-hidden":`true`,className:`size-3`}),`Delete`]}):null]})}function Be({text:e,onTextChange:t,pending:n,onRun:r,onCancel:i}){return(0,Q.jsxs)(`div`,{"data-slot":`wb-auto-panel`,className:`rounded-xl border border-border bg-card p-5 [&_button]:min-h-11`,children:[(0,Q.jsx)(`h2`,{className:`text-lg font-normal`,children:`Build a chain from a prompt`}),(0,Q.jsx)(`p`,{className:`mt-4 text-[13px] leading-relaxed text-muted-foreground`,children:`Describe the outcome. An agent proposes a title and ordered skill/check steps. Review the result, edit it, then Save.`}),(0,Q.jsx)(R,{"data-slot":`wb-auto-text`,"aria-label":`Describe the chain to build`,rows:3,autoFocus:!0,placeholder:`e.g. Fix the bug, run the tests, then review the diff for regressions.`,value:e,onChange:e=>t(e.target.value),onKeyDown:e=>{(e.metaKey||e.ctrlKey)&&e.key===`Enter`&&(e.preventDefault(),r())},className:`mt-4 min-h-[108px] bg-background p-4 text-sm`}),(0,Q.jsxs)(`div`,{className:`mt-3 flex items-center gap-1.5`,children:[(0,Q.jsxs)(a,{type:`button`,variant:`primary`,size:`sm`,"data-slot":`wb-auto-run`,disabled:n||e.trim()===``,onClick:r,children:[(0,Q.jsx)(S,{"aria-hidden":`true`,className:`size-3`}),n?`Building…`:`Build chain`]}),(0,Q.jsxs)(a,{type:`button`,variant:`ghost`,size:`sm`,"data-slot":`wb-auto-cancel`,onClick:i,children:[(0,Q.jsx)(ie,{"aria-hidden":`true`,className:`size-4`}),`Cancel`]})]}),(0,Q.jsx)(`p`,{className:`mt-4 text-xs text-muted-foreground`,children:`Creates an editable draft. Review the generated name and steps before saving.`})]})}function Ve({open:e,onOpenChange:t,text:n,onTextChange:r,error:i,pending:o,onRun:s,onCancel:c}){return(0,Q.jsx)(M,{open:e,onOpenChange:t,children:(0,Q.jsxs)(j,{showCloseButton:!1,"data-slot":`wb-import-panel`,className:`max-md:translate-x-0 max-md:translate-y-0 sm:max-w-[660px] rounded-xl border border-border bg-card p-5 [&_button]:min-h-11`,children:[(0,Q.jsx)(le,{className:`text-xl font-normal`,children:`Import workflow YAML`}),(0,Q.jsx)(k,{className:`sr-only`,children:`Paste a portable workflow definition to import.`}),(0,Q.jsx)(R,{"data-slot":`wb-import-text`,"aria-label":`Workflow YAML to import`,rows:4,spellCheck:!1,placeholder:`name: my-flow
@@ -59,7 +59,7 @@
59
59
  }
60
60
  })()
61
61
  </script>
62
- <script type="module" crossorigin src="/assets/index-D4lUB-OA.js"></script>
62
+ <script type="module" crossorigin src="/assets/index-WeSdteYZ.js"></script>
63
63
  <link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-QTnfLwEv.js">
64
64
  <link rel="modulepreload" crossorigin href="/assets/react-runtime-CCIEwYL0.js">
65
65
  <link rel="modulepreload" crossorigin href="/assets/bundle-mjs-BT31bpU6.js">
@@ -1,4 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{C as r,S as i,d as a,w as o}from"./button-C1fD-ZFr.js";import{i as s}from"./bundle-mjs-BT31bpU6.js";import{G as c,J as l,K as u,W as d,dt as f,ft as ee,gt as p,ht as m,lt as h,mt as g,pt as te,ut as ne}from"./index-D4lUB-OA.js";import{i as re,n as _}from"./chunk-BO2N2NFS-CM5F_Wdn.js";var v=e(t(),1),y=n();function b({isOpen:e,onClose:t,onConfirm:n,url:r}){return(0,y.jsx)(h,{open:e,onOpenChange:e=>{e||t()},children:(0,y.jsxs)(ee,{"data-slot":`link-safety-dialog`,children:[(0,y.jsxs)(m,{children:[(0,y.jsx)(p,{children:`Open this link?`}),(0,y.jsxs)(te,{children:[`It leaves Squawk in a new tab. The words of a link in a transcript are the agent's — the address below is where it actually goes.`,(0,y.jsx)(`span`,{"data-slot":`link-safety-url`,className:`mt-3 block wrap-anywhere rounded-md border border-border bg-muted px-3 py-2 font-mono text-xs text-foreground`,children:r})]})]}),(0,y.jsxs)(g,{children:[(0,y.jsx)(f,{children:`Cancel`}),(0,y.jsx)(ne,{onClick:n,children:`Open link`})]})]})})}var x=String.raw`https?:\/\/(?:cdn\.jsdelivr\.net\/npm|unpkg\.com)\/`,ie=[{id:`tailwind-v3`,script:/^https?:\/\/cdn\.tailwindcss\.com(?:\/[\d.]+)?\/?(?:[?#]|$)/i},{id:`tailwind`,script:new RegExp(String.raw`^${x}@tailwindcss\/browser@4(?:\.[.\d]*)?(?:\/dist\/index\.global(?:\.min)?\.js)?\/?(?:[?#]|$)`,`i`)},{id:`mermaid`,script:new RegExp(String.raw`^${x}mermaid@11(?:\.[.\d]*)?\/dist\/mermaid(?:\.esm)?(?:\.min)?\.m?js(?:[?#]|$)`,`i`)}],S=new RegExp(String.raw`(['"])(${x}mermaid@11(?:\.[.\d]*)?(?:\/dist\/mermaid(?:\.esm)?(?:\.min)?\.mjs|\/\+esm)?)\1`,`gi`);function C(e){let t=e.trim();return ie.find(e=>e.script.test(t))?.id??null}function w(e){let t=new DOMParser().parseFromString(e,`text/html`),n=new Set;for(let e of t.querySelectorAll(`script`)){let t=e.getAttribute(`src`),r=t===null?null:C(t);r&&n.add(r===`tailwind-v3`?`tailwind`:r).add(r),t===null&&e.getAttribute(`type`)===`module`&&(e.textContent??``).search(S)>=0&&n.add(`mermaid`),S.lastIndex=0}return[...n].sort()}var T={tailwind:async()=>(await s(()=>import(`./index.global-D3Ga_D3Y.js`),[])).default,"tailwind-v3":()=>Promise.resolve(se),mermaid:async()=>(await s(()=>import(`./mermaid.min-3O9YjB2l.js`),[])).default};async function E(e){let t=await Promise.all(e.map(e=>T[e]().then(t=>[e,t],()=>null)));return Object.fromEntries(t.filter(e=>e!==null))}function ae(){let e={colors:`color`,fontFamily:`font`,fontSize:`text`,fontWeight:`font-weight`,spacing:`spacing`,borderRadius:`radius`,boxShadow:`shadow`,dropShadow:`drop-shadow`,blur:`blur`,screens:`breakpoint`,letterSpacing:`tracking`,lineHeight:`leading`,maxWidth:`container`,animation:`animate`,aspectRatio:`aspect`},t=e=>typeof e==`object`&&!!e&&!Array.isArray(e),n=t=>Object.hasOwn(e,t)?e[t]:void 0,r=(e,n,i,a)=>{if(t(a)){for(let[t,o]of Object.entries(a))r(e,n,t===`DEFAULT`?i:i?`${i}-${t}`:t,o);return}let o=i?`--${n}-${i}`:`--${n}`;if(n===`text`&&Array.isArray(a)){e.push(`${o}: ${String(a[0])};`);let n=t(a[1])?a[1].lineHeight:a[1];typeof n==`string`&&e.push(`${o}--line-height: ${n};`);return}typeof a==`string`||typeof a==`number`?e.push(`${o}: ${a};`):Array.isArray(a)&&e.push(`${o}: ${a.join(`, `)};`)},i=e=>{let[t,n]=Array.isArray(e)?e:[e];if(t!==`class`&&t!==`selector`)return``;let r=typeof n==`string`?n:`.dark`;return`@custom-variant dark (&:where(${r}, ${r} *));\n`},a=e=>{let a=t(e)?e:{},o=t(a.theme)?a.theme:{},s=[];for(let[e,t]of Object.entries(o)){let i=n(e);i&&(s.push(`--${i}-*: initial;`),r(s,i,``,t))}for(let[e,i]of Object.entries(t(o.extend)?o.extend:{})){let t=n(e);t&&r(s,t,``,i)}return`${i(a.darkMode)}@theme {\n${s.join(`
2
- `)}\n}`},o=document.createElement(`style`);o.setAttribute(`type`,`text/tailwindcss`),document.currentScript?.before(o);let s={};Object.defineProperty(globalThis,"tailwind",{configurable:!0,value:{get config(){return s},set config(e){s=e,o.textContent=a(e)}}})}var oe=`(${ae.toString()})()`,se=[`@import "tailwindcss/theme.css";@import "tailwindcss/preflight.css";@import "tailwindcss/utilities.css";`,`@theme{`,`--color-slate-50:#f8fafc;--color-slate-100:#f1f5f9;--color-slate-200:#e2e8f0;--color-slate-300:#cbd5e1;--color-slate-400:#94a3b8;--color-slate-500:#64748b;--color-slate-600:#475569;--color-slate-700:#334155;--color-slate-800:#1e293b;--color-slate-900:#0f172a;--color-slate-950:#020617;`,`--color-gray-50:#f9fafb;--color-gray-100:#f3f4f6;--color-gray-200:#e5e7eb;--color-gray-300:#d1d5db;--color-gray-400:#9ca3af;--color-gray-500:#6b7280;--color-gray-600:#4b5563;--color-gray-700:#374151;--color-gray-800:#1f2937;--color-gray-900:#111827;--color-gray-950:#030712;`,`--color-zinc-50:#fafafa;--color-zinc-100:#f4f4f5;--color-zinc-200:#e4e4e7;--color-zinc-300:#d4d4d8;--color-zinc-400:#a1a1aa;--color-zinc-500:#71717a;--color-zinc-600:#52525b;--color-zinc-700:#3f3f46;--color-zinc-800:#27272a;--color-zinc-900:#18181b;--color-zinc-950:#09090b;`,`--color-neutral-50:#fafafa;--color-neutral-100:#f5f5f5;--color-neutral-200:#e5e5e5;--color-neutral-300:#d4d4d4;--color-neutral-400:#a3a3a3;--color-neutral-500:#737373;--color-neutral-600:#525252;--color-neutral-700:#404040;--color-neutral-800:#262626;--color-neutral-900:#171717;--color-neutral-950:#0a0a0a;`,`--color-stone-50:#fafaf9;--color-stone-100:#f5f5f4;--color-stone-200:#e7e5e4;--color-stone-300:#d6d3d1;--color-stone-400:#a8a29e;--color-stone-500:#78716c;--color-stone-600:#57534e;--color-stone-700:#44403c;--color-stone-800:#292524;--color-stone-900:#1c1917;--color-stone-950:#0c0a09;`,`--color-red-50:#fef2f2;--color-red-100:#fee2e2;--color-red-200:#fecaca;--color-red-300:#fca5a5;--color-red-400:#f87171;--color-red-500:#ef4444;--color-red-600:#dc2626;--color-red-700:#b91c1c;--color-red-800:#991b1b;--color-red-900:#7f1d1d;--color-red-950:#450a0a;`,`--color-orange-50:#fff7ed;--color-orange-100:#ffedd5;--color-orange-200:#fed7aa;--color-orange-300:#fdba74;--color-orange-400:#fb923c;--color-orange-500:#f97316;--color-orange-600:#ea580c;--color-orange-700:#c2410c;--color-orange-800:#9a3412;--color-orange-900:#7c2d12;--color-orange-950:#431407;`,`--color-amber-50:#fffbeb;--color-amber-100:#fef3c7;--color-amber-200:#fde68a;--color-amber-300:#fcd34d;--color-amber-400:#fbbf24;--color-amber-500:#f59e0b;--color-amber-600:#d97706;--color-amber-700:#b45309;--color-amber-800:#92400e;--color-amber-900:#78350f;--color-amber-950:#451a03;`,`--color-yellow-50:#fefce8;--color-yellow-100:#fef9c3;--color-yellow-200:#fef08a;--color-yellow-300:#fde047;--color-yellow-400:#facc15;--color-yellow-500:#eab308;--color-yellow-600:#ca8a04;--color-yellow-700:#a16207;--color-yellow-800:#854d0e;--color-yellow-900:#713f12;--color-yellow-950:#422006;`,`--color-lime-50:#f7fee7;--color-lime-100:#ecfccb;--color-lime-200:#d9f99d;--color-lime-300:#bef264;--color-lime-400:#a3e635;--color-lime-500:#84cc16;--color-lime-600:#65a30d;--color-lime-700:#4d7c0f;--color-lime-800:#3f6212;--color-lime-900:#365314;--color-lime-950:#1a2e05;`,`--color-green-50:#f0fdf4;--color-green-100:#dcfce7;--color-green-200:#bbf7d0;--color-green-300:#86efac;--color-green-400:#4ade80;--color-green-500:#22c55e;--color-green-600:#16a34a;--color-green-700:#15803d;--color-green-800:#166534;--color-green-900:#14532d;--color-green-950:#052e16;`,`--color-emerald-50:#ecfdf5;--color-emerald-100:#d1fae5;--color-emerald-200:#a7f3d0;--color-emerald-300:#6ee7b7;--color-emerald-400:#34d399;--color-emerald-500:#10b981;--color-emerald-600:#059669;--color-emerald-700:#047857;--color-emerald-800:#065f46;--color-emerald-900:#064e3b;--color-emerald-950:#022c22;`,`--color-teal-50:#f0fdfa;--color-teal-100:#ccfbf1;--color-teal-200:#99f6e4;--color-teal-300:#5eead4;--color-teal-400:#2dd4bf;--color-teal-500:#14b8a6;--color-teal-600:#0d9488;--color-teal-700:#0f766e;--color-teal-800:#115e59;--color-teal-900:#134e4a;--color-teal-950:#042f2e;`,`--color-cyan-50:#ecfeff;--color-cyan-100:#cffafe;--color-cyan-200:#a5f3fc;--color-cyan-300:#67e8f9;--color-cyan-400:#22d3ee;--color-cyan-500:#06b6d4;--color-cyan-600:#0891b2;--color-cyan-700:#0e7490;--color-cyan-800:#155e75;--color-cyan-900:#164e63;--color-cyan-950:#083344;`,`--color-sky-50:#f0f9ff;--color-sky-100:#e0f2fe;--color-sky-200:#bae6fd;--color-sky-300:#7dd3fc;--color-sky-400:#38bdf8;--color-sky-500:#0ea5e9;--color-sky-600:#0284c7;--color-sky-700:#0369a1;--color-sky-800:#075985;--color-sky-900:#0c4a6e;--color-sky-950:#082f49;`,`--color-blue-50:#eff6ff;--color-blue-100:#dbeafe;--color-blue-200:#bfdbfe;--color-blue-300:#93c5fd;--color-blue-400:#60a5fa;--color-blue-500:#3b82f6;--color-blue-600:#2563eb;--color-blue-700:#1d4ed8;--color-blue-800:#1e40af;--color-blue-900:#1e3a8a;--color-blue-950:#172554;`,`--color-indigo-50:#eef2ff;--color-indigo-100:#e0e7ff;--color-indigo-200:#c7d2fe;--color-indigo-300:#a5b4fc;--color-indigo-400:#818cf8;--color-indigo-500:#6366f1;--color-indigo-600:#4f46e5;--color-indigo-700:#4338ca;--color-indigo-800:#3730a3;--color-indigo-900:#312e81;--color-indigo-950:#1e1b4b;`,`--color-violet-50:#f5f3ff;--color-violet-100:#ede9fe;--color-violet-200:#ddd6fe;--color-violet-300:#c4b5fd;--color-violet-400:#a78bfa;--color-violet-500:#8b5cf6;--color-violet-600:#7c3aed;--color-violet-700:#6d28d9;--color-violet-800:#5b21b6;--color-violet-900:#4c1d95;--color-violet-950:#2e1065;`,`--color-purple-50:#faf5ff;--color-purple-100:#f3e8ff;--color-purple-200:#e9d5ff;--color-purple-300:#d8b4fe;--color-purple-400:#c084fc;--color-purple-500:#a855f7;--color-purple-600:#9333ea;--color-purple-700:#7e22ce;--color-purple-800:#6b21a8;--color-purple-900:#581c87;--color-purple-950:#3b0764;`,`--color-fuchsia-50:#fdf4ff;--color-fuchsia-100:#fae8ff;--color-fuchsia-200:#f5d0fe;--color-fuchsia-300:#f0abfc;--color-fuchsia-400:#e879f9;--color-fuchsia-500:#d946ef;--color-fuchsia-600:#c026d3;--color-fuchsia-700:#a21caf;--color-fuchsia-800:#86198f;--color-fuchsia-900:#701a75;--color-fuchsia-950:#4a044e;`,`--color-pink-50:#fdf2f8;--color-pink-100:#fce7f3;--color-pink-200:#fbcfe8;--color-pink-300:#f9a8d4;--color-pink-400:#f472b6;--color-pink-500:#ec4899;--color-pink-600:#db2777;--color-pink-700:#be185d;--color-pink-800:#9d174d;--color-pink-900:#831843;--color-pink-950:#500724;`,`--color-rose-50:#fff1f2;--color-rose-100:#ffe4e6;--color-rose-200:#fecdd3;--color-rose-300:#fda4af;--color-rose-400:#fb7185;--color-rose-500:#f43f5e;--color-rose-600:#e11d48;--color-rose-700:#be123c;--color-rose-800:#9f1239;--color-rose-900:#881337;--color-rose-950:#4c0519;`,`--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";`,`--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;`,`--text-xs--line-height:1rem;--text-sm--line-height:1.25rem;--text-base--line-height:1.5rem;--text-lg--line-height:1.75rem;`,`--text-xl--line-height:1.75rem;--text-2xl--line-height:2rem;--text-3xl--line-height:2.25rem;--text-4xl--line-height:2.5rem;`,`--shadow-sm:0 1px 2px 0 rgb(0 0 0 / 0.05);--radius-sm:0.125rem;--blur-sm:4px;`,`}`,`body{line-height:inherit}`,`*,::after,::before,::backdrop,::file-selector-button{border-color:var(--color-gray-200,currentColor)}`,`input::placeholder,textarea::placeholder{color:var(--color-gray-400)}`,`button:not(:disabled),[role="button"]:not(:disabled){cursor:pointer}`].join(`
3
- `),D=`default-src 'none'; script-src 'unsafe-inline' data:; img-src data:; media-src data:; font-src data:; style-src 'unsafe-inline' data:; form-action 'none'; base-uri 'none'`,ce=`${D}; frame-src 'none'`,O=`allow-scripts allow-popups allow-popups-to-escape-sandbox`,k=`clipboard-write`,A=`data:text/javascript,export%20default%20globalThis.mermaid`;function j(e){return/\.html?$/i.test(e)}var M=/^(?:https?:|mailto:)/i,N=/^data:/i,P=`http://www.w3.org/1999/xlink`,F=/^(?:[a-z][a-z\d+.-]*:|\/\/)/i,I=/url\(\s*(['"]?)([^'")]*)\1\s*\)|@import\s+(['"])([^'"]+)\3/gi,L=[`src`,`href`,`xlink:href`,`poster`,`background`],R=/(?:^|,)\s*(data:\S+|[^,\s]+)/gi,z=/\b(?:preconnect|dns-prefetch|prefetch|preload|modulepreload|prerender)\b/i;function B(e,t){let n=e.trim();!n||n.startsWith(`#`)||N.test(n)||(F.test(n)?t.remote++:t.relative++)}function V(e,t){for(let n of e.matchAll(I))B(n[2]??n[4]??``,t)}function H(e,t){let n=e.createElement(`script`);return n.textContent=t.replace(/<\/script/gi,`<\\/script`),n}function U(e,t){let n=e.createElement(`style`);return n.setAttribute(`type`,`text/tailwindcss`),n.textContent=t,n}var W=`http://www.w3.org/2000/svg`;function G(e){return e.namespaceURI===W?e.getAttribute(`href`)??e.getAttributeNS(P,`href`):e.getAttribute(`src`)}function le(e,t,n,r){let i=r===void 0?[]:[U(e,r),H(e,oe)],a=H(e,n),o=t.hasAttribute(`defer`)||t.hasAttribute(`async`)||t.getAttribute(`type`)===`module`;o&&e.body.append(a),t.replaceWith(...i,...o?[]:[a])}function K(e,t,n){let r=new Set,i=new Set;for(let a of[...e.querySelectorAll(`script`)]){let o=G(a);if(o!==null&&N.test(o.trim()))continue;if(o===null){if(a.getAttribute(`type`)===`module`)for(let e of(a.textContent??``).matchAll(S))i.add(e[2]);continue}let s=C(o),c=s===`tailwind-v3`?`tailwind`:s,l=c?n[c]:void 0;if(!c||l===void 0||s===`tailwind-v3`&&n[`tailwind-v3`]===void 0){t.scripts++,a.remove();continue}if(r.has(c)){a.remove();continue}r.add(c),le(e,a,l,s===`tailwind-v3`?n[`tailwind-v3`]:void 0)}if(!i.size)return;if(n.mermaid===void 0){t.scripts+=i.size;return}let a=e.createElement(`script`);a.setAttribute(`type`,`importmap`),a.textContent=JSON.stringify({imports:Object.fromEntries([...i].map(e=>[e,A]))}),e.head.prepend(a,...r.has(`mermaid`)?[]:[H(e,n.mermaid)])}function ue(e,t,n){let r=t=>{let n=[...e.querySelectorAll(t)];return n.forEach(e=>e.remove()),n.length};K(e,t,n),t.embeds=r(`iframe, frame, frameset, object, embed, portal`),r(`base, meta[http-equiv]`);for(let t of e.querySelectorAll(`link`))z.test(t.getAttribute(`rel`)??``)&&t.remove();for(let t of e.querySelectorAll(`[ping]`))t.removeAttribute(`ping`);for(let n of e.querySelectorAll(`form`))t.forms++,n.removeAttribute(`action`);for(let t of e.querySelectorAll(`[formaction]`))t.removeAttribute(`formaction`)}function de(e,t){for(let n of e.querySelectorAll(`a, area`)){let e=n.getAttribute(`href`)??n.getAttributeNS(P,`href`);if(e===null)continue;let r=e.trim();if(r.startsWith(`#`)){n.setAttribute(`href`,`about:srcdoc${r}`),n.removeAttributeNS(P,`href`),n.removeAttribute(`target`);continue}if(M.test(r)){n.setAttribute(`target`,`_blank`),n.setAttribute(`rel`,`noopener noreferrer`);continue}F.test(r)||t.relative++,n.removeAttribute(`href`),n.removeAttributeNS(P,`href`),n.removeAttribute(`target`)}}function fe(e,t){for(let n of e.querySelectorAll(`[style]`))V(n.getAttribute(`style`),t);for(let n of e.querySelectorAll(`style`))/^(?:text\/css)?$/i.test(n.getAttribute(`type`)?.trim()??``)&&V(n.textContent??``,t);for(let n of e.querySelectorAll(`link[href]`))B(n.getAttribute(`href`),t);for(let n of e.querySelectorAll(`img, source, video, audio, track, input, image, use, body, table, td`)){for(let e of L){let r=n.getAttribute(e);r!==null&&B(r,t)}for(let e of(n.getAttribute(`srcset`)??``).matchAll(R))B(e[1],t)}}function pe(e,t={}){let n=new DOMParser().parseFromString(e,`text/html`),r={scripts:0,remote:0,relative:0,forms:0,embeds:0};ue(n,r,t),de(n,r),fe(n,r);let i=n.createElement(`meta`);i.setAttribute(`http-equiv`,`Content-Security-Policy`),i.setAttribute(`content`,D);let a=n.createElement(`meta`);return a.setAttribute(`name`,`referrer`),a.setAttribute(`content`,`no-referrer`),n.head.prepend(i,a),{srcdoc:`<!DOCTYPE html>${n.documentElement.outerHTML}`,blocked:r}}var q=e=>e.replace(/&/g,`&amp;`).replace(/"/g,`&quot;`);function me(e,t){return`<!DOCTYPE html><html><head><meta http-equiv="Content-Security-Policy" content="${ce}"><meta name="referrer" content="no-referrer"><style>html,body{margin:0;height:100%;overflow:hidden}iframe{display:block;border:0;width:100%;height:100%}</style></head><body><iframe title="${q(t)}" sandbox="${O}" allow="${k}" referrerpolicy="no-referrer" srcdoc="${q(e)}"></iframe></body></html>`}var J=(0,v.createContext)(null),he=/^[0-9a-f-]{36}$/i,ge=/^(\/p\/[^/?#]+\/tasks\/[^/?#]+)\/files\?(artifact=[^&#]*)$/;function Y(e){let t=new URLSearchParams(e);return[...t.keys()].length===1&&he.test(t.get(`artifact`)??``)}function _e(e,t,n){if(e.startsWith(`${t}?artifact=`))return Y(e.slice(t.length+1))?n+e.slice(t.length):null;let r=ge.exec(e);return r&&Y(r[2])?`${r[1]}/report?${r[2]}`:void 0}var ve=/^\/(?:api|p|tasks|new|settings|skills|workflows|git|github|inbox|automations)(?:\/|[?#]|$)/;function ye(e,t){let n=/^[a-z]:[\\/]/i.test(e),r=/^file:/i.test(e);if(!n&&/^[a-z][a-z\d+.-]*:/i.test(e)&&!r)return null;let i=r?e:decodeURIComponent(e);if(/[\u0000-\u001f]/.test(i))return null;if(!t||i.startsWith(`/`)||n||r)return i;let a=t.replaceAll(`\\`,`/`);return a.slice(0,a.lastIndexOf(`/`)+1)+i}function X(e,t){if(!e||/[\u0000-\u001f]/.test(e)||e.startsWith(`#`)||e.startsWith(`//`))return null;let n=e.indexOf(`#`),r=n<0?e:e.slice(0,n),i=n<0?``:e.slice(n),a=t.projectId?`/p/${encodeURIComponent(t.projectId)}`:``,o=`/tasks/${encodeURIComponent(t.runId)}/files`,s=`/tasks/${encodeURIComponent(t.runId)}/report`,c=_e(r,o,a+s);if(c!==void 0)return c===null?null:c+i;if(ve.test(r))return null;let l=ye(r,t.basePath);return l===null?null:`${a}${j(l)?s:o}?path=${encodeURIComponent(l)}${i}`}var Z=`text-accent-text underline underline-offset-2`;function be({href:e,children:t,internal:n,...r}){let[a,o]=(0,v.useState)(!1),s=i();return e?n?s?(0,y.jsx)(xe,{...r,href:e,children:t}):(0,y.jsx)(`a`,{...r,href:e,"data-streamdown":`link`,className:Z,children:t}):(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`a`,{...r,href:e,"data-streamdown":`link`,className:`cursor-pointer ${Z}`,onClick:e=>{e.preventDefault(),o(!0)},children:t}),(0,y.jsx)(b,{isOpen:a,url:e,onClose:()=>o(!1),onConfirm:()=>{window.open(e,`_blank`,`noreferrer`),o(!1)}})]}):(0,y.jsx)(`span`,{children:t})}function xe({href:e,children:t,...n}){let i=o(),a=r();return(0,y.jsx)(`a`,{...n,href:e,"data-streamdown":`link`,className:Z,onClick:t=>Q(t,i,e,a),children:t})}function Q(e,t,n,r){e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||(e.preventDefault(),t(n,{state:{readerFrom:r.pathname+r.search,filesRestoreKey:r.key}}))}var Se={name:`shiki`,type:`code-highlighter`,getThemes:()=>[d,d],getSupportedLanguages:()=>l(),supportsLanguage:e=>l().includes(String(e).toLowerCase()),highlight:({code:e,language:t},n)=>u(e,String(t))||(c(e,String(t)).then(e=>n?.(e)),null)};function Ce(){let e=t=>{if(!t.children)return;let n=[];for(let r of t.children)if(r.type===`text`&&r.value?.includes(`
4
- `)){let e=r.value.split(/\r?\n/);e.forEach((t,r)=>{r>0&&!(t===``&&r===e.length-1)&&n.push({type:`break`}),t&&n.push({type:`text`,value:t})})}else e(r),n.push(r);t.children=n};return e}var $=[...Object.values(_),Ce],we=[`p`,`strong`,`em`,`del`,`code`,`a`],Te={p:`span`,a:`span`},Ee={enabled:!0,renderModal:e=>(0,y.jsx)(b,{...e})},De=`https://refused.invalid/`,Oe=0,ke=(0,v.memo)(function({children:e,breaks:t=!1,inline:n=!1,document:r=!1,imageSrc:i}){let o=(0,v.useContext)(J),s=(0,v.useMemo)(()=>{let e={instance:++Oe},n=new Set;function a(){let e=t=>{if((t.type===`link`||t.type===`definition`)&&t.url&&o){let e=X(t.url,o);e&&(t.url=e,n.add(e))}t.children?.forEach(e)};return e}let s=new Set;function c(){let e=t=>{if(t.type===`image`&&t.url&&i){let e=i(t.url);t.url=e?new URL(e,window.location.href).href:De,e&&s.add(t.url)}t.children?.forEach(e)};return e}let l=o?[[a,e]]:[],u=r&&i?[[c,e]]:[];return{remark:[...t?$:Object.values(_),...l,...u],components:{...o||r?{a:({href:e,children:t})=>r&&!o&&!/^(?:https?:|mailto:|#)/i.test(e??``)?(0,y.jsx)(`span`,{children:t}):(0,y.jsx)(be,{href:e,internal:n.has(e??``),children:t})}:{},...r?{img:({src:e,alt:t})=>typeof e==`string`&&s.has(e)?(0,y.jsx)(`img`,{src:e,alt:t??``,loading:`lazy`}):(0,y.jsxs)(`span`,{className:`text-muted-foreground`,children:[`[Image: `,t||`embedded image`,`]`]})}:{}}}},[o,t,r,i]);return(0,y.jsx)(re,{className:n?`thread-markdown thread-markdown-inline`:`thread-markdown`,plugins:{code:Se},shikiTheme:[d,d],...a({remarkPlugins:o||r&&i?s.remark:t?$:void 0,allowedElements:n?we:void 0,unwrapDisallowed:n||void 0,components:n?Te:o||r?s.components:void 0}),linkSafety:Ee,controls:{code:{copy:!0,download:!1},table:!1,mermaid:!1},lineNumbers:!1,children:e})});export{k as a,pe as c,E as d,X as i,me as l,Q as n,O as o,J as r,j as s,ke as t,w as u};
@@ -1 +0,0 @@
1
- import{o as e}from"./chunk-BO2N2NFS-CM5F_Wdn.js";export{e as Mermaid};