@staff0rd/assist 0.1197.0 → 0.1198.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/agent/commands/github.md +3 -1
- package/dist/.build-files +46 -45
- package/dist/{addPhase-N73554MQ.js → addPhase-572KZDOK.js} +2 -2
- package/dist/{ask-PLVOYYSQ.js → ask-XTA5XMDM.js} +3 -3
- package/dist/{askCheck-3JRXFKWA.js → askCheck-5AEU7R3U.js} +2 -2
- package/dist/{askDesign-JEJFPAEZ.js → askDesign-PP37KDLX.js} +3 -3
- package/dist/{askQuestion-QRQSYRXK.js → askQuestion-SBC6XZHQ.js} +2 -2
- package/dist/built-version +1 -1
- package/dist/{chunk-N7MKYWPX.js → chunk-42SUHCAB.js} +1 -1
- package/dist/chunk-BTLMJ735.js +26 -0
- package/dist/{chunk-IEDFQBJI.js → chunk-EPVBZE3T.js} +13 -30
- package/dist/{chunk-O3YZV2FA.js → chunk-IPEA3FVY.js} +1 -1
- package/dist/{chunk-ABLDOQ4B.js → chunk-JAZX2JSS.js} +22 -1
- package/dist/{chunk-D24GLTCK.js → chunk-KU3BOP7V.js} +1 -1
- package/dist/chunk-O7L27TQP.js +14 -0
- package/dist/{chunk-SZNARW4L.js → chunk-OL3XIGSW.js} +1 -1
- package/dist/{chunk-CSOKDY43.js → chunk-ONP7DDB6.js} +1 -1
- package/dist/{chunk-6SKKK2RR.js → chunk-OSFBFZ4O.js} +1 -1
- package/dist/{chunk-VLJWAMAH.js → chunk-OWAUNGD6.js} +1 -1
- package/dist/{chunk-DPCFT55U.js → chunk-P5LQVJWN.js} +0 -8
- package/dist/{chunk-G7UI2W7U.js → chunk-PSSNCOG4.js} +1 -1
- package/dist/{chunk-Y74CGS5C.js → chunk-S6RW5GNM.js} +6 -4
- package/dist/{chunk-Q4TGGE5L.js → chunk-VHRROHRC.js} +1 -1
- package/dist/{chunk-3EGHC5DC.js → chunk-XJKVJATG.js} +1 -1
- package/dist/{chunk-RBR2DXCS.js → chunk-YLEBZYTG.js} +1 -1
- package/dist/commands/sessions/web/bundle.js +1 -1
- package/dist/{comment-5VFL65DI.js → comment-CEDFMOXC.js} +4 -4
- package/dist/{commentIssue-JQCEL3GH.js → commentIssue-PT3WJ7WF.js} +31 -13
- package/dist/{createIssue-ZEZ4APQ7.js → createIssue-RHHIMF44.js} +9 -8
- package/dist/{doctorNodes-R5LSHBSG.js → doctorNodes-WNMQMS73.js} +3 -3
- package/dist/{edit-CGFJYKXA.js → edit-IBDT3I4O.js} +9 -7
- package/dist/{editIssue-X4C4ULTM.js → editIssue-XGP2RL2O.js} +9 -8
- package/dist/{editIssueComment-L6RLH4GX.js → editIssueComment-G7XE73QZ.js} +24 -13
- package/dist/index.js +46 -38
- package/dist/{postSlackMessage-LCK42KAO.js → postSlackMessage-QVUIQY6T.js} +3 -3
- package/dist/{propose-OCR3WXJK.js → propose-XTDFZXZI.js} +2 -2
- package/dist/{raise-SJ5JLPBS.js → raise-PXY3YLOB.js} +9 -7
- package/dist/{reply-VL6NV6IF.js → reply-VPQL6VJB.js} +3 -3
- package/dist/{restartNode-JKNJHOBN.js → restartNode-L4UYWD5P.js} +5 -5
- package/dist/{review-Q2HDUBAA.js → review-36GCDNOH.js} +13 -6
- package/dist/{rulesAdd-DR25M5KY.js → rulesAdd-MTHY5RTQ.js} +3 -3
- package/dist/{runDaemon-H26DPNF2.js → runDaemon-QPMNLZPK.js} +6 -5
- package/dist/{runExtract-7H2MKKFQ.js → runExtract-2QQLXAU7.js} +2 -2
- package/dist/{signExtension-HFA73PC5.js → signExtension-RWAKXX4Q.js} +1 -1
- package/dist/{slack-VILAGICW.js → slack-6ML35TRH.js} +3 -3
- package/dist/{updateNode-YY3552ZX.js → updateNode-GUHTGV4N.js} +5 -5
- package/dist/{updatePlan-QZVWDL2U.js → updatePlan-CFOXHKSR.js} +2 -2
- package/dist/{web-LO36XJET.js → web-D5PMDPIG.js} +7 -6
- package/dist/{web-UIJZ6XQT.js → web-HGJRIJAG.js} +7 -6
- package/dist/{wontfix-XV5XJADI.js → wontfix-3ZV2NW5C.js} +3 -3
- package/package.json +1 -1
- package/dist/chunk-JJKRUHWS.js +0 -22
- package/dist/{chunk-QS2S63AF.js → chunk-HCDJLCN4.js} +3 -3
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
} from "./chunk-JM57BCD6.js";
|
|
11
11
|
import {
|
|
12
12
|
firstBrokenHop
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-OL3XIGSW.js";
|
|
14
14
|
import {
|
|
15
15
|
describePeerError,
|
|
16
16
|
fetchPeerJson
|
|
@@ -47,7 +47,7 @@ import {
|
|
|
47
47
|
import {
|
|
48
48
|
ASSIST_VERSION,
|
|
49
49
|
PROTOCOL_VERSION
|
|
50
|
-
} from "./chunk-
|
|
50
|
+
} from "./chunk-42SUHCAB.js";
|
|
51
51
|
import {
|
|
52
52
|
findLinkSpec
|
|
53
53
|
} from "./chunk-J2PPCMCR.js";
|
|
@@ -141,12 +141,14 @@ import {
|
|
|
141
141
|
import {
|
|
142
142
|
fetchProjectV2
|
|
143
143
|
} from "./chunk-YQ3CNWB3.js";
|
|
144
|
+
import {
|
|
145
|
+
isStagedAttachmentPath
|
|
146
|
+
} from "./chunk-O7L27TQP.js";
|
|
144
147
|
import {
|
|
145
148
|
attachmentContentType,
|
|
146
|
-
isStagedAttachmentPath,
|
|
147
149
|
stageAttachment,
|
|
148
150
|
stagedAttachmentsDir
|
|
149
|
-
} from "./chunk-
|
|
151
|
+
} from "./chunk-P5LQVJWN.js";
|
|
150
152
|
import {
|
|
151
153
|
assignIssueToSelf
|
|
152
154
|
} from "./chunk-SDMBTSYP.js";
|
|
@@ -4140,7 +4140,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
4140
4140
|
`)){let n=t[t.length-1];r.startsWith("@@")||n===void 0?t.push(r):t[t.length-1]=`${n}
|
|
4141
4141
|
${r}`}return t}function DXr(e){return IXr(e??"").filter(t=>t.startsWith("@@"))}function Xjo(e){return Number(/^@@ -(\d+)/.exec(e)?.[1]??1)}function Zjo(e){return/^@@[^@]*@@/.exec(e)?.[0]??e.split(`
|
|
4142
4142
|
`)[0]??""}function MXr(e,t){return e.reduce((r,n)=>r+LXr(n,t),0)}function NXr(e,t,r){let n=DXr(e.patch),o=[],i=[];return n.forEach((a,s)=>{let l=r.get(`${e.path}#${s}`)??[];l.includes(t)?o.push(a):i.push({oldStart:Xjo(a),header:Zjo(a),slice:l[0]??0})}),o.length===0||i.length===0?e:{...e,patch:o.join(`
|
|
4143
|
-
`),additions:MXr(o,"+"),deletions:MXr(o,"-"),split:{hunks:o.length,of:n.length,elsewhere:i}}}function OXr(e){return e.flatMap(t=>{if(t.kind==="dir")return OXr(t.children);let{kind:r,name:n,...o}=t;return[o]})}function Qjo(e){let t=new Map;return e.forEach((r,n)=>{for(let o of r.hunks)t.set(o,[...t.get(o)??[],n+1])}),t}function BXr(e,t,r=new Set,n=new Set){let o=OXr(e.tree).filter(a=>!r.has(a.path)).map(a=>n.has(a.path)?{...a,critical:!0}:a),i=Qjo(t);return t.map((a,s)=>{let l=new Set(a.hunks.map(jj));return AXr(o.filter(u=>l.has(u.path)).map(u=>NXr(u,s+1,i)))})}function Jjo(e,t){let r=-1,n=0;return t.forEach((o,i)=>{let a=o.hunks.filter(s=>jj(s)===e).length;a>n&&(r=i,n=a)}),r}function $Xr(e,t){let r=t.map(()=>[]);for(let n of e)r[Jjo(n.path,t)]?.push(n);return r}function FXr(e,t){let r=BXr(e.structure,t,new Set(e.tests.map(i=>i.path)),new Set(e.criticalDiffs.map(i=>i.path))),n=$Xr(e.tests,t),o=kPe(t);return t.map((i,a)=>{let s=a+1;return{number:s,slice:i,structure:r[a]??e.structure,tests:n[a]??[],critical:e.criticalDiffs.filter(l=>o.get(l.path)?.some(u=>u.number===s))}})}function zXr(e){if(!e.slices)return;let t=FXr(e,e.slices);return{entries:TXr(e,t),slicing:{count:t.length,noCritical:new Set(t.filter(r=>r.critical.length===0).map(r=>r.number))}}}function HXr(e){if(!(!e.repo||!e.headSha))return`${e.repo}#${e.prNumber}@${e.headSha}`}var kgt="assist:high-level-progress:",eYo=`${kgt}head:`,tYo=720*60*60*1e3,ule=e=>`${kgt}${e}`,_gt=e=>`${eYo}${e}`,Cgt=e=>fl(e)[0];function rYo(e,t){let r=e?Cgt(ule(e)):void 0;return e&&Vv(ule(e)),r??(t?Cgt(_gt(t)):void 0)}function UXr(e,t,r){return jx(kgt,tYo),Cgt(ule(e))??rYo(t,r)}function WXr(e,t,r){Dl(ule(e),[r]),t&&Dl(_gt(t),[r])}function VXr(e,t){Vv(ule(e)),t&&Vv(_gt(t))}function GXr(e){let t=e;return typeof t?.id=="string"&&typeof t.title=="string"&&typeof t.reason=="string"&&(t.kind==="deterministic"||t.kind==="manual")&&["pass","fail","manual"].includes(t.status)}function vN(e,t){return Array.isArray(e)?t?e.filter(t):e:[]}var Egt=e=>typeof e=="string"?e:"";function qXr(e){return{repo:Egt(e.repo),prNumber:typeof e.prNumber=="number"?e.prNumber:0,headSha:Egt(e.headSha),body:Egt(e.body)}}var Rgt={repo:"",prNumber:0,headSha:"",body:"",checks:[],structure:{tree:[],added:0,removed:0,modified:0,additions:0,deletions:0},criticalDiffs:[],criticalPaths:[],tests:[],testPaths:[],collapsedPaths:[]};function jXr(e){let t;try{t=JSON.parse(e)}catch{return Rgt}return typeof t!="object"||t===null?Rgt:{...qXr(t),checks:vN(t.checks,GXr),structure:{...Rgt.structure,...t.structure},criticalDiffs:vN(t.criticalDiffs),criticalPaths:vN(t.criticalPaths),tests:vN(t.tests),testPaths:vN(t.testPaths),collapsedPaths:vN(t.collapsedPaths),...Array.isArray(t.slices)?{slices:t.slices}:{},...t.manualTesting?{manualTesting:t.manualTesting}:{},...t.saved?{saved:t.saved}:{},...t.draft?{draft:t.draft}:{}}}function YXr(e){let t=(0,KPe.useMemo)(()=>jXr(e.body),[e.body]),r=(0,KPe.useMemo)(()=>zXr(t),[t]),n=HXr(t),o=(0,KPe.useMemo)(()=>UXr(e.requestId,e.supersedes,n)??t.draft??t.saved,[e.requestId,e.supersedes,n,t]);return{payload:t,sliced:r,progress:o,head:n}}var KXr=S(re(),1);function XXr(e){let[t,r]=(0,KXr.useState)(()=>e?.reviewComments??[]);return{queued:t,onQueue:n=>r(o=>[...o,n]),onRemove:n=>r(o=>o.filter((i,a)=>a!==n)),onEdit:(n,o)=>r(i=>i.map((a,s)=>s===n?{...a,note:o}:a))}}var ZXr=S(re(),1);function QXr(e,t,r,n){(0,ZXr.useEffect)(()=>{WXr(e,t,{items:r,reviewComments:n})},[e,t,r,n])}function eZr(e,t,r){let{payload:n,sliced:o,progress:i,head:a}=YXr(e),s=xXr(n.checks,i,o?.slicing),l=XXr(i),u=uXr(o?.entries??[]),{comments:d,sentTo:f,clearSent:p}=Ij(t,r),h={...d,onQueue:l.onQueue};QXr(e.requestId,a,s.items,l.queued);let m=(0,JXr.useMemo)(()=>mXr(n),[n]);return{payload:n,checklist:s,queue:l,details:hXr(n,h),counts:m,sentTo:f,clearSent:p,sliced:o,nav:u,diffComments:h,head:a}}var NS=S(_(),1);function tZr({preview:e,session:t,sendInput:r,onDecision:n}){let o=eZr(e,t,r);return(0,NS.jsxs)(H,{sx:a0,children:[(0,NS.jsx)(Dh,{preview:e,draft:!1}),(0,NS.jsx)(rY,{items:e.metadata??[]}),(0,NS.jsx)(qn,{}),(0,NS.jsx)(KKr,{payload:o.payload,checklist:o.checklist,details:o.details,counts:o.counts,sliced:o.sliced,nav:o.nav,comments:o.diffComments}),(0,NS.jsx)(qn,{}),(0,NS.jsx)(lXr,{pane:o,onDecision:(i,a)=>{VXr(e.requestId,o.head),n(i,a)}}),(0,NS.jsx)(pf,{sessionName:o.sentTo,onClose:o.clearSent})]})}var cZr=S(re(),1);var bN=S(_(),1);function nYo(e){return e.topLeft===null?"Click the top-left box":e.bottomRight===null?"Now click the bottom-right box":"Both anchors picked"}function rZr({selection:e,onConfirm:t,onReject:r}){let n=e.topLeft!==null&&e.bottomRight!==null;return(0,bN.jsxs)(St,{direction:"row",spacing:1,sx:{p:2,alignItems:"center",justifyContent:"flex-end"},children:[(0,bN.jsx)(be,{variant:"body2",sx:{flex:1,color:"text.secondary"},children:nYo(e)}),(0,bN.jsx)(nt,{color:"error",variant:"outlined",onClick:r,children:"Cancel"}),(0,bN.jsx)(nt,{variant:"outlined",onClick:e.reset,children:"Start over"}),(0,bN.jsx)(nt,{color:"success",variant:"contained",disabled:!n,onClick:t,children:"Extract boxes"})]})}var oYo={"top-left":ic.miro.topLeft,"bottom-right":ic.miro.bottomRight};function nZr(e,t){let r=e.right-e.left,n=e.bottom-e.top;return{width:r,height:n,fontSize:Math.max(6,Math.min(n*.3,r/6,28)),radius:Math.min(8,n/4),colour:t?oYo[t]:ic.miro.box,opacity:t?.75:.35,strokeWidth:Math.max(1,r*.004)}}var dle=S(_(),1);function oZr({box:e,role:t,onSelect:r}){let n=nZr(e,t);return(0,dle.jsxs)("g",{role:"button",tabIndex:0,"aria-label":t?`${e.text} (${t})`:e.text,onClick:()=>r(e.id),onKeyDown:o=>{o.key==="Enter"&&r(e.id)},style:{cursor:"pointer"},children:[(0,dle.jsx)("rect",{x:e.left,y:e.top,width:n.width,height:n.height,rx:n.radius,fill:n.colour,fillOpacity:n.opacity,stroke:n.colour,strokeWidth:n.strokeWidth}),(0,dle.jsx)("text",{x:e.left+n.width/2,y:e.top+n.height/2,textAnchor:"middle",dominantBaseline:"central",fontSize:n.fontSize,fill:ic.miro.text,children:e.text})]})}function iZr(e){if(e.length===0)return"0 0 100 100";let t=Math.min(...e.map(a=>a.left)),r=Math.min(...e.map(a=>a.top)),n=Math.max(...e.map(a=>a.right))-t,o=Math.max(...e.map(a=>a.bottom))-r,i=Math.max(n*.02,8);return`${t-i} ${r-i} ${n+i*2} ${o+i*2}`}var XPe=S(_(),1);function aZr({boxes:e,selection:t}){return(0,XPe.jsx)(H,{sx:{flex:1,minHeight:0,overflow:"auto",p:2},children:(0,XPe.jsx)("svg",{role:"img","aria-label":"Miro board boxes",viewBox:iZr(e),preserveAspectRatio:"xMidYMid meet",style:{width:"100%",height:"100%"},children:e.map(r=>(0,XPe.jsx)(oZr,{box:r,role:t.roleOf(r.id),onSelect:t.choose},r.id))})})}function iYo(e){return typeof e?.id=="string"&&typeof e.text=="string"&&[e.left,e.top,e.right,e.bottom].every(t=>typeof t=="number"&&Number.isFinite(t))}function sZr(e){try{let t=JSON.parse(e);return Array.isArray(t?.boxes)?t.boxes.filter(iYo):[]}catch{return[]}}var Pgt=S(re(),1);function lZr(){let[e,t]=(0,Pgt.useState)(null),[r,n]=(0,Pgt.useState)(null);return{topLeft:e,bottomRight:r,choose:s=>{if(e===null||r!==null){t(s),n(null);return}n(s)},reset:()=>{t(null),n(null)},roleOf:s=>s===e?"top-left":s===r?"bottom-right":null}}var $3=S(_(),1);function uZr({preview:e,onDecision:t}){let r=(0,cZr.useMemo)(()=>sZr(e.body),[e.body]),n=lZr();return(0,$3.jsxs)(H,{sx:a0,children:[(0,$3.jsx)(Dh,{preview:e,draft:!1}),(0,$3.jsx)(qn,{}),(0,$3.jsx)(aZr,{boxes:r,selection:n}),(0,$3.jsx)(qn,{}),(0,$3.jsx)(rZr,{selection:n,onConfirm:()=>{let{topLeft:i,bottomRight:a}=n;i===null||a===null||t("approve",Gc({topLeft:i,bottomRight:a}))},onReject:()=>t("reject",Gc())})]})}var HZr=S(re(),1);function dZr(e){let t=[];return e.map(r=>(t.length=r+1,t[r]=(t[r]??0)+1,t.map(n=>n??1).join(".")))}function ZPe(e){return e*22}function fZr(e){return Math.round(e/22)}var pZr={display:"flex",alignItems:"flex-start",gap:.25,"& .criterion-action":{opacity:0,transition:"opacity 120ms"},"&:hover .criterion-action":{opacity:1},"&:focus-within .criterion-action":{opacity:1},"& .criterion-action:focus-visible":{opacity:1}},hZr={p:.25,mt:"2px",color:"text.disabled",cursor:"grab",touchAction:"none","&:active":{cursor:"grabbing"}},mZr={fontFamily:"fontFamilyMono",fontSize:"0.8rem",color:"text.secondary",minWidth:32,pt:"5px",textAlign:"right",userSelect:"none",whiteSpace:"nowrap"},gZr={flex:1,fontSize:"inherit",lineHeight:1.5,px:.75,py:0,borderRadius:1,"&:hover":{bgcolor:"action.hover"},"&.Mui-focused":{bgcolor:"action.selected"}},Agt={p:.25,mt:"2px"},yZr={position:"absolute",right:8,height:2,borderRadius:1,bgcolor:"primary.main",pointerEvents:"none"};var bZr=S(_(),1),aYo=8;function vZr({drag:e}){return e?(0,bZr.jsx)(H,{sx:yZr,style:{top:e.top-1,left:aYo+ZPe(e.depth)}}):null}var xZr=S(_(),1),SZr=ot((0,xZr.jsx)("path",{d:"M11 18c0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2 2 .9 2 2m-2-8c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0-6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m6 4c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2m0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2"}),"DragIndicator");var Lgt=S(_(),1);function TZr({number:e,onGrip:t}){return(0,Lgt.jsx)(Mt,{size:"small",className:"criterion-action",sx:hZr,"aria-label":`Reorder criterion ${e}`,onPointerDown:t,children:(0,Lgt.jsx)(SZr,{fontSize:"inherit"})})}var dk=S(_(),1);function wZr({number:e,onAdd:t,onDelete:r}){return(0,dk.jsxs)(dk.Fragment,{children:[(0,dk.jsx)(Mt,{size:"small",className:"criterion-action",sx:Agt,"aria-label":`Add criterion after ${e}`,onClick:t,children:(0,dk.jsx)(Kd,{fontSize:"inherit"})}),(0,dk.jsx)(Mt,{size:"small",className:"criterion-action",sx:Agt,"aria-label":`Delete criterion ${e}`,onClick:r,children:(0,dk.jsx)(_o,{fontSize:"inherit"})})]})}var QPe=S(re(),1);function CZr(e,t){return e==="start"?0:e==="end"?t:Math.min(Math.max(e,0),t)}function kZr(e){let t=(0,QPe.useRef)(null);return(0,QPe.useEffect)(()=>{let r=t.current;if(!e||!r)return;r.focus();let n=CZr(e.caret,r.value.length);r.setSelectionRange(n,n)},[e]),t}var xN=S(_(),1);function _Zr({index:e,number:t,item:r,outline:n,dragging:o,onGrip:i}){let a=kZr(n.focus?.index===e?n.focus:null),s={marginLeft:ZPe(r.depth),opacity:o?.4:1};return(0,xN.jsxs)(H,{sx:pZr,"data-criterion-row":!0,style:s,children:[(0,xN.jsx)(TZr,{number:t,onGrip:i}),(0,xN.jsx)(H,{component:"span",sx:mZr,"aria-hidden":"true",children:`${t}.`}),(0,xN.jsx)(Hi,{multiline:!0,value:r.text,sx:gZr,inputRef:a,inputProps:{"aria-label":`Criterion ${t}`},onChange:l=>n.onText(e,l.target.value),onKeyDown:l=>n.onKeyDown(e,l)}),(0,xN.jsx)(wZr,{number:t,onAdd:()=>n.onAdd(e),onDelete:()=>n.onDelete(e)})]})}var DZr=S(re(),1);function EZr(e,t,{key:r,shift:n,alt:o,caret:i,text:a}){return o||n?null:r==="ArrowUp"&&i===0&&t>0?{kind:"focus",index:t-1}:r==="ArrowDown"&&i===a.length&&t<e.length-1?{kind:"focus",index:t+1}:null}function F3(e){if(e.length===0)return[{text:"",depth:0}];let t=-1;return e.map(r=>{let n=Math.min(Math.max(r.depth,0),t+1);return t=n,r.depth===n?r:{...r,depth:n}})}function JPe(e,t,r,n){let o=e[t]?.depth??0,i=e.map((a,s)=>s===t?{...a,text:r}:a);return{items:F3([...i.slice(0,t+1),{text:n,depth:o},...i.slice(t+1)]),index:t+1}}function dg(e,t){let r=t+1;for(;r<e.length&&e[r].depth>e[t].depth;)r+=1;return r}function eAe(e,t){let r=e[t].depth;for(let n=t-1;n>=0;n-=1){if(e[n].depth<r)return-1;if(e[n].depth===r)return n}return-1}function RZr(e,t){let r=dg(e,t);return r<e.length&&e[r].depth===e[t].depth?r:-1}function PZr(e,t,r){let n=r<0?eAe(e,t):RZr(e,t);if(n<0)return null;let o=dg(e,t),i=e.slice(t,o),a=[...e.slice(0,t),...e.slice(o)],s=r<0?n:dg(e,n)-(o-t);return{items:[...a.slice(0,s),...i,...a.slice(s)],index:s}}function tAe(e,t){let r=dg(e,t),n=e.map((o,i)=>i>t&&i<r?{...o,depth:o.depth-1}:o).filter((o,i)=>i!==t);return{items:F3(n),index:Math.max(0,t-1)}}function AZr(e,t,r){if(r<0&&e[t].depth===0||r>0&&eAe(e,t)<0)return null;let n=dg(e,t);return e.map((o,i)=>i>=t&&i<n?{...o,depth:o.depth+r}:o)}function rAe(e,t){return e?{kind:"edit",edit:e,caret:t}:null}function sYo(e,t,{caret:r,text:n}){let o=n.slice(0,r);return rAe(JPe(e,t,o,n.slice(r)),"start")}function lYo(e,t,{shift:r,caret:n}){let o=AZr(e,t,r?-1:1);return rAe(o?{items:o,index:t}:null,n)}function LZr(e,t,r){let{key:n,shift:o,alt:i,caret:a,text:s}=r;return n==="Enter"&&!o?sYo(e,t,r):n==="Tab"?lYo(e,t,r):i&&(n==="ArrowUp"||n==="ArrowDown")?rAe(PZr(e,t,n==="ArrowUp"?-1:1),a):n==="Backspace"&&a===0&&s===""?rAe(tAe(e,t),"end"):null}function IZr(e,t,r){return LZr(e,t,r)??EZr(e,t,r)}function MZr(e,t){let[r,n]=(0,DZr.useState)(null),o=(a,s)=>{a&&(t(a.items),n({index:a.index,caret:s}))};return{focus:r,onKeyDown:(a,s)=>{let l=s.currentTarget;(s.key==="Enter"||s.key==="Tab")&&s.preventDefault();let u=IZr(e,a,{key:s.key,shift:s.shiftKey,alt:s.altKey,caret:l.selectionStart??0,text:l.value});u&&(s.preventDefault(),u.kind==="focus"?n({index:u.index,caret:"end"}):o(u.edit,u.caret))},onDrop:a=>o(a,"end"),onText:(a,s)=>t(e.map((l,u)=>u===a?{...l,text:s}:l)),onAdd:a=>o(JPe(e,a,e[a].text,""),"start"),onDelete:a=>o(tAe(e,a),"end")}}var FZr=S(re(),1);function cYo(e,t,r,n){let o=t.length;for(let a=0;a<e.length;a+=1)if(n<e[a].top+e[a].height/2){o=a;break}let i=dg(t,r);return o>r&&o<i?r:o}function uYo(e,t,r,n){let o=dg(e,t),i=r-1,a=i>=t&&i<o?t-1:i,s=a>=0?e[a].depth+1:0;return Math.max(0,Math.min(e[t].depth+fZr(n),s))}function dYo(e,t){if(t<e.length)return e[t].top;let r=e[e.length-1];return r?r.top+r.height:0}function NZr(e,t,r,n,o){let i=cYo(e,t,r,o);return{target:i,depth:uYo(t,r,i,n),top:dYo(e,i)}}function fYo(e){let t=e.getBoundingClientRect().top;return{boxes:Array.from(e.querySelectorAll("[data-criterion-row]")).map(n=>{let o=n.getBoundingClientRect();return{top:o.top-t,height:o.height}}),origin:t}}function OZr(e,t,r,n){return o=>{let{boxes:i,origin:a}=fYo(t);return NZr(i,e,r,o.clientX-n,o.clientY-a)}}function BZr(e,t,r,n,o){let i=new AbortController,a=null,s=d=>{a=r(d),n(a)},l=()=>{i.abort(),a&&o(a)},u={signal:i.signal};return e.setPointerCapture(t),e.addEventListener("pointermove",s,u),e.addEventListener("pointerup",l,u),e.addEventListener("pointercancel",l,u),s}function $Zr(e,t,r,n){let o=dg(e,t),i=n-e[t].depth,a=e.slice(t,o).map(u=>({...u,depth:Math.max(0,u.depth+i)})),s=[...e.slice(0,t),...e.slice(o)],l=r>t?r-a.length:r;return{items:F3([...s.slice(0,l),...a,...s.slice(l)]),index:l}}function zZr(e,t,r){let[n,o]=(0,FZr.useState)(null);return{drag:n,onGrip:a=>s=>{let l=t.current;if(!l||s.pointerType==="mouse"&&s.button!==0)return;s.preventDefault(),BZr(s.currentTarget,s.pointerId,OZr(e,l,a,s.clientX),d=>o({from:a,depth:d.depth,top:d.top}),d=>{o(null),r($Zr(e,a,d.target,d.depth))})(s)}}}var fle=S(_(),1),pYo={my:1,px:1,py:.5,border:1,borderColor:"divider",borderRadius:1,position:"relative",userSelect:"text",cursor:"auto"},hYo=[{text:"",depth:0}];function UZr({items:e,onChange:t}){let r=(0,HZr.useRef)(null),n=e.length>0?e:hYo,o=MZr(n,t),{drag:i,onGrip:a}=zZr(n,r,o.onDrop),s=dZr(n.map(l=>l.depth));return(0,fle.jsxs)(H,{sx:pYo,ref:r,"data-preview-skip":!0,"aria-label":"Acceptance criteria",children:[n.map((l,u)=>(0,fle.jsx)(_Zr,{index:u,number:s[u],item:l,outline:o,dragging:i?.from===u,onGrip:a(u)},`criterion-${u}`)),(0,fle.jsx)(vZr,{drag:i})]})}var WZr=S(_(),1),VZr=ot((0,WZr.jsx)("path",{d:"M2 17h2v.5H3v1h1v.5H2v1h3v-4H2zm1-9h1V4H2v1h1zm-1 3h1.8L2 13.1v.9h3v-1H3.2L5 10.9V10H2zm5-6v2h14V5zm0 14h14v-2H7zm0-6h14v-2H7z"}),"FormatListNumbered");var ple=S(_(),1),mYo={insert:"Add acceptance criteria",convert:"Convert to outline"};function GZr({kind:e,onClick:t}){return(0,ple.jsx)(H,{sx:{my:1},"data-preview-skip":!0,children:(0,ple.jsx)(nt,{size:"small",variant:"outlined",startIcon:e==="insert"?(0,ple.jsx)(Kd,{}):(0,ple.jsx)(VZr,{}),onClick:t,children:mYo[e]})})}var hle=S(re(),1);function qZr(e,t,{color:r,pin:n}){let o=D6(e),i=[],a=o.nextNode();for(;a;){let u=a;if(t.intersectsNode(u)){let d=u===t.startContainer?t.startOffset:0,f=u===t.endContainer?t.endOffset:u.length;d<f&&i.push({node:u,start:d,end:f})}a=o.nextNode()}let l=i.map(u=>gYo(u.node,u.start,u.end,r)).at(-1);l&&n&&(l.dataset.pin=n)}function gYo(e,t,r,n){let o=document.createRange();o.setStart(e,t),o.setEnd(e,r);let i=document.createElement("mark");return i.className="pr-comment",i.style.backgroundColor=n,o.surroundContents(i),i}function jZr(e){for(let t of e.querySelectorAll("mark.pr-comment"))if(t.parentNode){for(;t.firstChild;)t.before(t.firstChild);t.remove()}}function YZr(e,t){for(let r of t){let n=_Nt(e,r);n&&qZr(e,n,r)}}var mle=S(_(),1);function KZr({content:e,control:t,trailing:r,ranges:n,contentRef:o}){let i=(0,hle.useMemo)(()=>BD(e),[e]),a=(0,hle.useMemo)(()=>BD(r??""),[r]);return(0,hle.useLayoutEffect)(()=>{let s=o.current;s&&(jZr(s),YZr(s,n))},[i,a,n,o]),(0,mle.jsxs)(H,{ref:o,children:[(0,mle.jsx)(DD,{segments:i,skipDiagramText:!0}),t,t?(0,mle.jsx)(DD,{segments:a,skipDiagramText:!0}):null]})}var SN=e=>e.split(",").map(t=>`&& .markdown ${t.trim()}`).join(", ");function nAe(e){let{color:t,radius:r}=e.tokens;return{px:2.5,py:2,fontSize:14,lineHeight:1.6,[SN("")]:{lineHeight:1.6},[SN("h1, h2, h3, h4, h5, h6")]:{fontSize:15,fontWeight:600,lineHeight:1.4,mt:2,mb:1},[SN("ul, ol")]:{pl:2.5,mb:2},[SN("li")]:{mb:"6px"},[SN("code")]:{fontFamily:e.typography.fontFamilyMono,fontSize:"0.86em",px:"5px",py:0,bgcolor:t.raised,border:1,borderColor:t.lineSoft,borderRadius:"4px"},[SN("pre")]:{bgcolor:t.raised,border:1,borderColor:t.lineSoft,borderRadius:`${r.sm}px`},[SN("pre code")]:{border:0,px:0,bgcolor:"transparent"}}}var XZr=e=>({flex:1,overflow:"auto",position:"relative",userSelect:"none",cursor:"text",wordBreak:"break-word","& .markdown":{...j$(e),maxWidth:"none"},"& a":{color:"primary.main"},"& mark.pr-comment":{color:"inherit",borderRadius:"2px"},...nAe(e)});var oY=S(_(),1);function ZZr({content:e,control:t,trailing:r,ranges:n,wrapperRef:o,contentRef:i,dragRects:a,dragColor:s,onMouseDown:l,footer:u}){return(0,oY.jsxs)(H,{ref:o,onMouseDown:l,sx:XZr,children:[(0,oY.jsx)(KZr,{content:e,control:t,trailing:r,ranges:n,contentRef:i}),u&&(0,oY.jsx)(H,{sx:{userSelect:"text"},children:u}),(0,oY.jsx)(B$,{rects:a,color:s})]})}function QZr(e){let t=new Map,r=[];for(let n of e){if(!n.group){r.push(n);continue}t.set(n.group,[...t.get(n.group)??[],n])}return{groups:[...t],ungrouped:r}}var oAe=S(re(),1),JZr=S(_(),1);function Igt({label:e,value:t,onCommit:r,listId:n}){let[o,i]=(0,oAe.useState)(t);return(0,oAe.useEffect)(()=>i(t),[t]),(0,JZr.jsx)(An,{size:"small",variant:"standard",fullWidth:!0,label:e,value:o,onChange:s=>i(s.target.value),onBlur:()=>{let s=o.trim();i(t),s!==t&&r(s)},onKeyDown:s=>{s.key==="Enter"&&s.target.blur()},onMouseDown:s=>s.stopPropagation(),slotProps:{htmlInput:{list:n}}})}var gle=S(_(),1),Dgt="screenshot-groups";function yYo(e){return(e.split(/[\\/]/).pop()??e).replace(/\.[^.]+$/,"")}function eQr({screenshot:e,onUpdate:t}){return(0,gle.jsxs)(St,{direction:"row",spacing:1,sx:{mt:.5},children:[(0,gle.jsx)(Igt,{label:"Caption",value:e.alt,onCommit:r=>t(e.id,{alt:r||yYo(e.path)})}),(0,gle.jsx)(Igt,{label:"Group",value:e.group??"",listId:Dgt,onCommit:r=>t(e.id,{group:r})})]})}var z3=S(_(),1),tQr={display:"block",maxWidth:"100%",borderRadius:1,border:1,borderColor:"divider"},vYo={position:"absolute",top:4,right:4,bgcolor:"background.paper","&:hover":{bgcolor:"background.paper"}};function rQr({screenshot:e,onRemove:t,onUpdate:r}){let n=e.contentType.startsWith("video/");return(0,z3.jsxs)(H,{sx:{position:"relative"},children:[n?(0,z3.jsx)(H,{component:"video",controls:!0,src:e.url,"aria-label":"screenshot",sx:tQr}):(0,z3.jsx)(H,{component:"img",src:e.url,alt:"screenshot",sx:tQr}),(0,z3.jsx)(Mt,{size:"small","aria-label":"Remove screenshot",sx:vYo,onMouseDown:o=>o.stopPropagation(),onClick:()=>t(e.id),children:(0,z3.jsx)(_o,{fontSize:"small"})}),(0,z3.jsx)(eQr,{screenshot:e,onUpdate:r})]})}var h0=S(_(),1);function bYo(){return(0,h0.jsxs)(St,{direction:"row",spacing:1,sx:{alignItems:"center"},children:[(0,h0.jsx)(ao,{size:16}),(0,h0.jsx)(be,{variant:"caption",color:"text.secondary",children:"Attaching screenshot or video\u2026"})]})}function xYo({error:e}){return(0,h0.jsx)(be,{variant:"caption",color:"error",sx:{wordBreak:"break-word"},children:e})}function nQr({uploads:e,empty:t}){return e.length>0?(0,h0.jsx)(h0.Fragment,{children:e.map(r=>r.error?(0,h0.jsx)(xYo,{error:r.error},r.id):(0,h0.jsx)(bYo,{},r.id))}):t?(0,h0.jsx)(be,{variant:"caption",color:"text.secondary",children:"Drop or paste an image or video to attach"}):null}var m0=S(_(),1),SYo={display:"grid",gridTemplateColumns:"repeat(2, minmax(0, 1fr))",gap:1};function oQr({screenshots:e,uploads:t,onRemove:r,onUpdate:n}){let{groups:o,ungrouped:i}=QZr(e),a=s=>(0,m0.jsx)(rQr,{screenshot:s,onRemove:r,onUpdate:n},s.id);return(0,m0.jsxs)(H,{sx:{mt:3},children:[e.length>0&&(0,m0.jsx)(H,{component:"h2",children:"Screenshots"}),(0,m0.jsx)("datalist",{id:Dgt,children:o.map(([s])=>(0,m0.jsx)("option",{value:s},s))}),o.map(([s,l])=>(0,m0.jsxs)(H,{sx:{mb:2},children:[(0,m0.jsx)(H,{component:"h3",children:s}),(0,m0.jsx)(H,{sx:SYo,children:l.map(a)})]},s)),(0,m0.jsxs)(St,{spacing:1,children:[i.map(a),(0,m0.jsx)(nQr,{uploads:t,empty:e.length===0})]})]})}var yle=S(_(),1);function TYo(e){let t=e.criteria;if(!t)return{content:e.body};let r={content:t.before,trailing:t.after};return t.kind==="outline"?{...r,control:(0,yle.jsx)(UZr,{items:t.items,onChange:e.onCriteriaChange})}:{...r,control:(0,yle.jsx)(GZr,{kind:t.kind,onClick:t.kind==="insert"?e.onCriteriaInsert:e.onCriteriaConvert})}}function iAe({pane:e,screenshots:t}){return(0,yle.jsx)(ZZr,{...TYo(e),ranges:e.ranges,wrapperRef:e.wrapperRef,contentRef:e.contentRef,dragRects:e.dragRects,dragColor:e.dragColor,onMouseDown:e.onMouseDown,footer:t?(0,yle.jsx)(oQr,{screenshots:e.screenshots,uploads:e.uploads,onRemove:e.removeScreenshot,onUpdate:e.updateScreenshot}):void 0})}var iQr=e=>({display:"grid",gap:1,maxHeight:220,overflow:"auto",px:2,py:1.25,borderTop:1,borderColor:e.tokens.color.lineSoft}),aQr={fontSize:11,fontWeight:600,letterSpacing:"0.06em",textTransform:"uppercase",color:"text.secondary"},sQr=e=>({display:"grid",gridTemplateColumns:"minmax(0, 1fr) auto",gap:"4px 8px",px:1.25,py:1,borderRadius:`${e.tokens.radius.sm}px`,bgcolor:e.tokens.color.raised,border:1,borderColor:e.tokens.color.lineSoft,fontSize:12.5}),lQr={gridColumn:2,gridRow:1,width:20,height:20,color:"text.disabled","& .MuiSvgIcon-root":{fontSize:14}};var fk=S(_(),1);function cQr({comments:e,colors:t,onRemove:r}){return(0,fk.jsxs)(H,{sx:iQr,children:[(0,fk.jsxs)(be,{sx:aQr,children:["Comments (",e.length,")"]}),e.map((n,o)=>(0,fk.jsxs)(H,{sx:sQr,children:[(0,fk.jsx)(D$,{text:n.quote,sx:{gridColumn:1,borderLeft:2,pl:1,borderColor:t[o]}}),(0,fk.jsx)(H,{sx:{gridColumn:1,wordBreak:"break-word"},children:n.note}),(0,fk.jsx)(Mt,{"aria-label":"Remove comment",onClick:()=>r(n.id),sx:lQr,children:(0,fk.jsx)(_o,{})})]},n.id))]})}var dQr=S(_(),1);function uQr(e){return e.comments.length===0?null:(0,dQr.jsx)(cQr,{...e})}var fQr=S(_(),1),aAe=ot((0,fQr.jsx)("path",{d:"M20 18c1.1 0 1.99-.9 1.99-2L22 6c0-1.1-.9-2-2-2H4c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2H0v2h24v-2zM4 6h16v10H4z"}),"Computer");var vQr=S(re(),1);var pQr=S(_(),1),hQr=ot((0,pQr.jsx)("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2"}),"Circle");var g0="0.1197.0";var wYo={connected:"success.main",connecting:"warning.main",disconnected:"error.main","version-blocked":"error.main"};function mQr(e){return e?wYo[e]:"success.main"}function gQr(e){return e.split("-")[0].split(".").map(Number)}function yQr(e,t){if(!e||!t||e===t)return;let r=gQr(e),n=gQr(t);for(let o=0;o<Math.max(r.length,n.length);o++){let i=(r[o]??0)-(n[o]??0);if(Number.isNaN(i))return;if(i!==0)return i<0?"behind":"ahead"}}var sAe=S(re(),1),Mgt=(0,sAe.createContext)(null);function lAe(){return(0,sAe.useContext)(Mgt)}var TN=S(_(),1),CYo={height:16,fontSize:10},kYo={opacity:.6,fontSize:"0.85em"};function _Yo(e,t){if(t===e.local)return"this machine";let r=e.links.find(n=>n.name===t);return r?r.error?`${r.state}: ${r.error}`:r.state:""}function H3({nodes:e,name:t,showVersion:r=!1}){let n=lAe()??g0,o=e.links.find(a=>a.name===t),i=yQr(o?.peerVersion,n);return(0,TN.jsx)(lr,{title:_Yo(e,t),placement:"right",children:(0,TN.jsxs)(H,{component:"span",sx:{display:"inline-flex",alignItems:"center",gap:.75},children:[(0,TN.jsx)(hQr,{sx:{fontSize:8,color:mQr(o?.state)}}),t,r&&o?.peerVersion&&(0,TN.jsxs)(H,{component:"span",sx:kYo,children:["v",o.peerVersion]}),i&&(0,TN.jsx)(vn,{label:i,size:"small",color:i==="behind"?"warning":"info",sx:CYo})]})})}var y0=S(_(),1),EYo={textTransform:"none"};function cAe({nodes:e,options:t,target:r,onPick:n}){let[o,i]=(0,vQr.useState)(null);return(0,y0.jsxs)(y0.Fragment,{children:[(0,y0.jsx)(nt,{size:"small",color:"inherit",startIcon:(0,y0.jsx)(aAe,{fontSize:"small"}),"aria-label":"Start on node","aria-haspopup":"menu",onClick:a=>i(a.currentTarget),sx:EYo,children:(0,y0.jsx)(H3,{nodes:e,name:r.node})}),(0,y0.jsx)(hi,{anchorEl:o,open:!!o,onClose:()=>i(null),children:t.map(({name:a,cwd:s})=>(0,y0.jsx)(Br,{disabled:!s,selected:a===r.node,onClick:()=>{n(a),i(null)},children:(0,y0.jsx)(Vu,{primary:(0,y0.jsx)(H3,{nodes:e,name:a}),secondary:s?void 0:"no clone"})},a))})]})}var bQr=S(re(),1);function RYo(e,t){return e?.toLowerCase()===t.toLowerCase()}function uAe(e,t){let{nodes:r,names:n,visible:o}=ds(),{repos:i,selectedCwd:a,selectedNode:s,cloneOn:l,originOf:u}=_n(),[d,f]=(0,bQr.useState)(),p=e&&u(e)?e:a,h=t?i.find(b=>RYo(u(b),t)):p,m=n.map(b=>({name:b,cwd:h?l(h,b):void 0})),g=b=>m.find(x=>x.name===b&&x.cwd),y=g(d)??g(s??r?.local)??m.find(b=>b.cwd),v=o&&y?.cwd?{node:y.name,cwd:y.cwd}:void 0;return{nodes:r,visible:o,options:m,target:v,pick:f}}var U3=S(_(),1);function xQr({canStart:e,startOrigin:t,cwd:r,onApprove:n,onApproveAndStart:o}){let i=oge(),a=uAe(r,t);return(0,U3.jsxs)(U3.Fragment,{children:[(0,U3.jsx)(nt,{color:"primary",variant:e?"tonal":"contained",onClick:n,...e?{}:i,children:"Approve"}),e&&a.nodes&&a.target&&(0,U3.jsx)(cAe,{nodes:a.nodes,options:a.options,target:a.target,onPick:a.pick}),e&&(0,U3.jsx)(nt,{color:"primary",variant:"contained",onClick:()=>o(a.target),...i,children:"Approve & start"})]})}var Ngt=S(_(),1),PYo={"& .MuiFormControlLabel-label":{fontSize:12}};function vle({label:e,title:t,checked:r,onChange:n}){return(0,Ngt.jsx)($d,{control:(0,Ngt.jsx)(Mp,{size:"small",checked:r,onChange:o=>n(o.target.checked)}),label:e,title:t,sx:PYo})}var wN=S(_(),1);function dAe({chain:e,newPr:t,onChange:r}){return(0,wN.jsxs)(St,{direction:"row",sx:{mr:"auto"},children:[t&&(0,wN.jsx)(vle,{label:"Draft",title:"Create the PR as a draft rather than ready for review",checked:e.draft,onChange:n=>r({...e,draft:n,autoMerge:n?!1:e.autoMerge})}),(0,wN.jsx)(vle,{label:"Auto-merge (squash)",title:"Squash-merge the PR automatically once its required checks pass",checked:e.autoMerge,onChange:n=>r({...e,autoMerge:n,draft:n?!1:e.draft})}),(0,wN.jsx)(vle,{label:"Review PR",title:"After raising, run a review that posts its findings and then addresses them",checked:e.reviewAfter,onChange:n=>r({...e,reviewAfter:n})}),(0,wN.jsx)(vle,{label:"Post to Slack",title:"Announce the PR in Slack at the tail of the chain",checked:e.announceAfter,onChange:n=>r({...e,announceAfter:n})})]})}var CN=S(_(),1);function SQr({commentCount:e,chain:t,newPr:r,canStart:n,startOrigin:o,onChainChange:i,onApprove:a,cwd:s,onApproveAndStart:l,onReject:u,onRequestChanges:d}){return(0,CN.jsxs)(St,{direction:"row",spacing:1,sx:{px:2,py:1.5,alignItems:"center",justifyContent:"flex-end"},children:[t&&(0,CN.jsx)(dAe,{chain:t,newPr:r,onChange:i}),(0,CN.jsx)(nt,{color:"error",variant:"outlined",onClick:u,children:"Reject"}),e>0&&(0,CN.jsxs)(nt,{color:"warning",variant:"tonal",onClick:d,children:["Request changes (",e,")"]}),(0,CN.jsx)(xQr,{canStart:n,startOrigin:o,cwd:s,onApprove:a,onApproveAndStart:l})]})}var wQr=S(_(),1);function TQr({comments:e,cwd:t,onDecision:r,chain:n,newPr:o,canStart:i,startOrigin:a,onChainChange:s}){let l=()=>e.map(u=>({quote:u.quote,note:u.note}));return(0,wQr.jsx)(SQr,{commentCount:e.length,chain:n,newPr:o,canStart:i,startOrigin:a,onChainChange:s,onApprove:()=>r("approve",l()),cwd:t,onApproveAndStart:u=>r("approve",l(),u??!0),onReject:()=>r("reject",[]),onRequestChanges:()=>r("reject",l())})}var pk=S(_(),1);function CQr(e){let{comments:t,commentColors:r,pending:n,cwd:o,unavailable:i,onAdd:a,onQueue:s,onCite:l,onAddRule:u,onRemove:d,onCancel:f,onCollapse:p,editable:h}=e;return(0,pk.jsxs)(pk.Fragment,{children:[(0,pk.jsx)(uQr,{comments:t,colors:r,onRemove:d}),(0,pk.jsx)(qn,{}),(0,pk.jsx)(TQr,{...e}),(0,pk.jsx)(bye,{pending:n,editable:h,cwd:o,unavailable:i,onAdd:a,onQueue:s,onCite:l,onAddRule:u,onCancel:f,onCollapse:p})]})}var ble=S(_(),1),AYo={px:2,pb:2,display:"flex",alignItems:"center",gap:1.5,minWidth:0},LYo={color:"text.secondary",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"};function kQr({url:e}){return(0,ble.jsxs)(H,{sx:AYo,children:[(0,ble.jsx)(nt,{variant:"contained",href:e,target:"_blank",rel:"noopener noreferrer",sx:{flexShrink:0},children:"Open design \u2197"}),(0,ble.jsx)(be,{variant:"body2",sx:LYo,title:e,children:e})]})}var Ogt=S(_(),1);function _Qr({preview:e}){let t=e.kind==="design"?e.metadata?.[0]?.url:void 0;return t?(0,Ogt.jsx)(kQr,{url:t}):(0,Ogt.jsx)(rY,{items:e.metadata??[]})}function EQr({preview:e,pane:t,cwd:r,isPr:n,editable:o,sender:i,onCite:a,onAddRule:s}){return{comments:t.comments,commentColors:t.commentColors,pending:t.pending,cwd:r,unavailable:i.unavailable,onAdd:i.onSend,onQueue:t.onAdd,onCite:a,onAddRule:s,onRemove:t.remove,onCancel:t.onCancel,onCollapse:t.onCollapse,onDecision:t.onDecide,chain:n?t.chain:void 0,editable:o,newPr:n&&e.prNumber===null,canStart:e.kind==="backlog-item"&&e.canStart===!0,startOrigin:e.startOrigin,onChainChange:t.setChain}}function iY(e){let t=e??"pr";return{isPr:t==="pr",screenshots:t==="pr"||t==="github-issue"||t==="github-issue-edit",editable:t==="github-issue-edit",closeOnly:t==="show"}}function RQr(e,t){return e?`${e}:${t??"pr"}`:void 0}function fAe(e,t,r,n){return{...iY(e.kind),requestId:e.requestId,supersedes:e.supersedes,sessionId:t,cwd:r,onDecision:n,screenshotScope:RQr(t,e.kind),seededScreenshots:e.screenshots??[],chainDefaults:{draft:e.draft===!0,reviewAfter:e.reviewAfter??!0},initialBody:e.body}}function PQr(e,t,r,n){if(!(!e||!t))return o=>{r!==void 0&&dl(t,e,s_e({quote:r,note:o})),n()}}function AQr(e,t,r,n){if(!(!e||!t))return o=>{r!==void 0&&dl(t,e,qx(r,aye(o))),n()}}function pAe(e,t,r,n){return{onCite:AQr(e,t,r,n),onAddRule:PQr(e,t,r,n)}}function LQr(e){return{criteria:e.criteria,onCriteriaChange:e.writeCriteria,onCriteriaInsert:e.insertCriteria,onCriteriaConvert:e.convertCriteria}}var zQr=S(re(),1);var hk=S(re(),1);var IQr="assist:pr-preview-comments:",Bgt=e=>`${IQr}${e}`;function $gt(e){return fl(Bgt(e))}function xle(e,t){Dl(Bgt(e),t)}function hAe(e){Vv(Bgt(e))}function DQr(){jx(IQr)}function MQr(e){let t=D6(e),r="";for(let n=t.nextNode();n;n=t.nextNode())r+=n.textContent??"";return r}function IYo(e,t,r){let n=-1;for(let o=e.indexOf(t);o!==-1;o=e.indexOf(t,o+1))(n===-1||Math.abs(o-r)<Math.abs(n-r))&&(n=o);return n}function NQr(e,t){return e.flatMap(r=>{let n=IYo(t,r.quote,r.start);return n===-1?[]:[{...r,start:n,end:n+r.quote.length}]})}function OQr(e,t,r){let n=$gt(e);if(n.length>0||!t||!r)return n;let o=NQr($gt(t),MQr(r));return xle(e,o),hAe(t),o}function BQr(e,t,r){let[n,o]=(0,hk.useState)([]),i=(0,hk.useRef)(0);(0,hk.useEffect)(()=>{DQr(),o(OQr(e,t,r.current).map(l=>({...l,id:i.current++})))},[e,t,r]);let a=(0,hk.useCallback)(l=>{o(u=>{let d=[...u,{...l,id:i.current++}];return xle(e,d),d})},[e]),s=(0,hk.useCallback)(l=>{o(u=>{let d=u.filter(f=>f.id!==l);return xle(e,d),d})},[e]);return{comments:n,add:a,remove:s}}function $Qr(e,t){let r=e.map((i,a)=>yG(a).solid),n=yG(e.length).fill,o=e.map((i,a)=>({start:i.start,end:i.end,color:yG(a).fill,pin:String(a+1)}));return t&&o.push({start:t.start,end:t.end,color:n}),{commentColors:r,dragColor:n,ranges:o}}function FQr(e,t,r,n){return{onAdd:o=>{e&&t({quote:e.quote,note:o,start:e.start,end:e.end}),n()},onCollapse:()=>{e&&r(e.quote),n()}}}function HQr(e,t,r){let{wrapperRef:n,contentRef:o,pending:i,dragRects:a,onMouseDown:s,clear:l,select:u}=qy(),{comments:d,add:f,remove:p}=BQr(e,t,o),{commentColors:h,dragColor:m,ranges:g}=(0,zQr.useMemo)(()=>$Qr(d,i),[d,i]),{onAdd:y,onCollapse:v}=FQr(i,f,r,l);return{wrapperRef:n,contentRef:o,onMouseDown:s,comments:d,commentColors:h,remove:p,pending:i,ranges:g,dragRects:a,dragColor:m,onAdd:y,onCollapse:v,onCancel:l,onSelect:u}}var gAe=S(re(),1);var Fgt="assist:preview-screenshots:",zgt=e=>`${Fgt}${e}`,mAe=e=>`${Fgt}seeded:${e}`;function UQr(e){return e?(jx(Fgt),fl(zgt(e)).filter(t=>typeof t.path=="string")):[]}function kN(e,t){e&&Dl(zgt(e),t.map(({path:r,alt:n,group:o,contentType:i,seeded:a})=>({path:r,alt:n,group:o,contentType:i,seeded:a})))}function WQr(e){e&&(Vv(zgt(e)),Vv(mAe(e)))}var _N=S(re(),1);var VQr={"image/png":"png","image/jpeg":"jpg","image/gif":"gif","image/webp":"webp","image/svg+xml":"svg","video/mp4":"mp4","video/webm":"webm","video/quicktime":"mov"};function DYo(e){let t=e.split(".").pop()?.toLowerCase();return Object.entries(VQr).find(([,n])=>n===t)?.[0]??"application/octet-stream"}function GQr(e){return e.map(t=>({...t,contentType:DYo(t.path),seeded:!0}))}function qQr(e,t,r){if(!e)return GQr(r);let n=UQr(e);if(fl(mAe(e))[0]===t)return n;let o=[...GQr(r),...n.filter(i=>!i.seeded)];return kN(e,o),Dl(mAe(e),[t]),o}function jQr(e,t){let r=new URLSearchParams({path:e});return t&&r.set("node",t),ov(`/api/pr-preview/image?${r}`)}function YQr(e,t,r){let[n,o]=(0,_N.useState)([]),i=(0,_N.useRef)(0),a=ur(),s=(0,_N.useRef)(r);return s.current=r,(0,_N.useEffect)(()=>{o(qQr(e,t,s.current).map(l=>({...l,url:jQr(l.path,a),id:i.current++})))},[e,t,a]),{screenshots:n,setScreenshots:o,nextId:i}}var KQr=S(re(),1);function XQr(e,t){return(0,KQr.useCallback)((r,n)=>{t(o=>{let i=o.map(a=>a.id===r?{...a,...n}:a);return kN(e,i),i})},[e,t])}function ZQr(e,t,r){let{screenshots:n,setScreenshots:o,nextId:i}=YQr(e,t,r),a=(0,gAe.useCallback)(d=>{o(f=>{let p=[...f,{...d,id:i.current++}];return kN(e,p),p})},[e,o,i]),s=(0,gAe.useCallback)(d=>{o(f=>{let p=f.find(m=>m.id===d);p?.url.startsWith("blob:")&&URL.revokeObjectURL(p.url);let h=f.filter(m=>m.id!==d);return kN(e,h),h})},[e,o]),l=XQr(e,o),u=(0,gAe.useCallback)(()=>WQr(e),[e]);return{screenshots:n,add:a,remove:s,update:l,clearPersisted:u}}var aY=S(re(),1);async function QQr(e,t,r){let n=new URLSearchParams;t&&n.set("cwd",t),r&&n.set("node",r),e instanceof File&&e.name&&n.set("name",e.name);let o=await Wt(`/api/pr-preview/upload-image?${n}`,{method:"POST",headers:{"Content-Type":e.type||"application/octet-stream"},body:e,timeoutMs:12e4}),i=await o.json().catch(()=>null);if(!o.ok||!i?.path)throw new Error(i?.error??"Failed to attach file");return{path:i.path,alt:i.alt??"screenshot"}}var rJr=S(re(),1);function JQr(e){return e.startsWith("image/")||e.startsWith("video/")}function eJr(e){if(!e)return null;for(let t of e.items)if(t.kind==="file"&&JQr(t.type)){let r=t.getAsFile();if(r)return r}return null}function tJr(e){return e?Array.from(e.files).find(t=>JQr(t.type))??null:null}function nJr(e,t){return(0,rJr.useEffect)(()=>{if(!t)return;let o=i=>{let a=eJr(i.clipboardData);a&&(i.preventDefault(),e(a))};return globalThis.addEventListener("paste",o),()=>globalThis.removeEventListener("paste",o)},[e,t]),t?{onDrop:o=>{let i=tJr(o.dataTransfer);i&&(o.preventDefault(),e(i))},onDragOver:o=>{Array.from(o.dataTransfer.items).some(i=>i.kind==="file")&&o.preventDefault()}}:{onDrop:void 0,onDragOver:void 0}}function oJr(e,t,r){let[n,o]=(0,aY.useState)([]),i=(0,aY.useRef)(0),a=ur(),s=(0,aY.useCallback)(async d=>{let f=i.current++;o(p=>[...p.filter(h=>!h.error),{id:f}]);try{let p=await QQr(d,e,a);t({...p,url:URL.createObjectURL(d),contentType:d.type}),o(h=>h.filter(m=>m.id!==f))}catch(p){let h=p instanceof Error?p.message:"Failed to attach file";o(m=>m.map(g=>g.id===f?{id:f,error:h}:g))}},[e,a,t]),{onDrop:l,onDragOver:u}=nJr(s,r);return{uploads:n,onDrop:l,onDragOver:u}}function iJr({cwd:e,screenshots:t,screenshotScope:r,requestId:n,seededScreenshots:o}){let{screenshots:i,add:a,remove:s,update:l,clearPersisted:u}=ZQr(t?r:void 0,n,t?o:[]),{uploads:d,onDrop:f,onDragOver:p}=oJr(e,a,t);return{screenshots:i,removeScreenshot:s,updateScreenshot:l,decision:{attachments:()=>i.map(({path:h,alt:m,group:g})=>g?{path:h,alt:m,group:g}:{path:h,alt:m}),clearPersisted:u},uploads:d,onDrop:f,onDragOver:p}}var hJr=S(re(),1);var aJr="assist:pr-preview-chain:",Hgt=e=>`${aJr}${e}`;function sJr(e){if(e)return fl(Hgt(e))[0]}function lJr(e,t){e&&Dl(Hgt(e),[t])}function cJr(e){e&&Vv(Hgt(e))}function uJr(){jx(aJr)}function dJr(e,t,r){if(!e)return{reviewAfter:!1,announceAfter:!1,draft:!1,autoMerge:!1};uJr();let n=sJr(t);return{reviewAfter:n?.reviewAfter??r.reviewAfter,announceAfter:n?.announceAfter??!0,draft:n?.draft??r.draft,autoMerge:n?.autoMerge??!1}}function fJr(e,t,r,n,o){return{comments:t,screenshots:n,reviewAfter:e&&r.reviewAfter,announceAfter:e&&r.announceAfter,draft:r.draft,autoMerge:e&&r.autoMerge,...o===void 0?{}:{body:o}}}function pJr(e,t){return!e||t===!1?{}:t===!0?{autostart:!0}:{autostart:!0,startOn:t}}function mJr(e,t,r,n,o,i,a){let[s,l]=(0,hJr.useState)(()=>dJr(n,t,o));return{chain:s,setChain:f=>{l(f),lJr(t,f)},onDecide:(f,p,h=!1)=>{let m=f==="approve";r(f,{...fJr(m,p,s,m?i.attachments():[],a()),...pJr(m,h)}),hAe(e),m&&(cJr(t),i.clearPersisted())}}}var kJr=S(re(),1);var MYo=/^ {0,3}#{1,6}[ \t]+acceptance criteria[ \t]*$/i,NYo=/^ {0,3}#{1,6}[ \t]/;function W3(e){let t=e.split(`
|
|
4143
|
+
`),additions:MXr(o,"+"),deletions:MXr(o,"-"),split:{hunks:o.length,of:n.length,elsewhere:i}}}function OXr(e){return e.flatMap(t=>{if(t.kind==="dir")return OXr(t.children);let{kind:r,name:n,...o}=t;return[o]})}function Qjo(e){let t=new Map;return e.forEach((r,n)=>{for(let o of r.hunks)t.set(o,[...t.get(o)??[],n+1])}),t}function BXr(e,t,r=new Set,n=new Set){let o=OXr(e.tree).filter(a=>!r.has(a.path)).map(a=>n.has(a.path)?{...a,critical:!0}:a),i=Qjo(t);return t.map((a,s)=>{let l=new Set(a.hunks.map(jj));return AXr(o.filter(u=>l.has(u.path)).map(u=>NXr(u,s+1,i)))})}function Jjo(e,t){let r=-1,n=0;return t.forEach((o,i)=>{let a=o.hunks.filter(s=>jj(s)===e).length;a>n&&(r=i,n=a)}),r}function $Xr(e,t){let r=t.map(()=>[]);for(let n of e)r[Jjo(n.path,t)]?.push(n);return r}function FXr(e,t){let r=BXr(e.structure,t,new Set(e.tests.map(i=>i.path)),new Set(e.criticalDiffs.map(i=>i.path))),n=$Xr(e.tests,t),o=kPe(t);return t.map((i,a)=>{let s=a+1;return{number:s,slice:i,structure:r[a]??e.structure,tests:n[a]??[],critical:e.criticalDiffs.filter(l=>o.get(l.path)?.some(u=>u.number===s))}})}function zXr(e){if(!e.slices)return;let t=FXr(e,e.slices);return{entries:TXr(e,t),slicing:{count:t.length,noCritical:new Set(t.filter(r=>r.critical.length===0).map(r=>r.number))}}}function HXr(e){if(!(!e.repo||!e.headSha))return`${e.repo}#${e.prNumber}@${e.headSha}`}var kgt="assist:high-level-progress:",eYo=`${kgt}head:`,tYo=720*60*60*1e3,ule=e=>`${kgt}${e}`,_gt=e=>`${eYo}${e}`,Cgt=e=>fl(e)[0];function rYo(e,t){let r=e?Cgt(ule(e)):void 0;return e&&Vv(ule(e)),r??(t?Cgt(_gt(t)):void 0)}function UXr(e,t,r){return jx(kgt,tYo),Cgt(ule(e))??rYo(t,r)}function WXr(e,t,r){Dl(ule(e),[r]),t&&Dl(_gt(t),[r])}function VXr(e,t){Vv(ule(e)),t&&Vv(_gt(t))}function GXr(e){let t=e;return typeof t?.id=="string"&&typeof t.title=="string"&&typeof t.reason=="string"&&(t.kind==="deterministic"||t.kind==="manual")&&["pass","fail","manual"].includes(t.status)}function vN(e,t){return Array.isArray(e)?t?e.filter(t):e:[]}var Egt=e=>typeof e=="string"?e:"";function qXr(e){return{repo:Egt(e.repo),prNumber:typeof e.prNumber=="number"?e.prNumber:0,headSha:Egt(e.headSha),body:Egt(e.body)}}var Rgt={repo:"",prNumber:0,headSha:"",body:"",checks:[],structure:{tree:[],added:0,removed:0,modified:0,additions:0,deletions:0},criticalDiffs:[],criticalPaths:[],tests:[],testPaths:[],collapsedPaths:[]};function jXr(e){let t;try{t=JSON.parse(e)}catch{return Rgt}return typeof t!="object"||t===null?Rgt:{...qXr(t),checks:vN(t.checks,GXr),structure:{...Rgt.structure,...t.structure},criticalDiffs:vN(t.criticalDiffs),criticalPaths:vN(t.criticalPaths),tests:vN(t.tests),testPaths:vN(t.testPaths),collapsedPaths:vN(t.collapsedPaths),...Array.isArray(t.slices)?{slices:t.slices}:{},...t.manualTesting?{manualTesting:t.manualTesting}:{},...t.saved?{saved:t.saved}:{},...t.draft?{draft:t.draft}:{}}}function YXr(e){let t=(0,KPe.useMemo)(()=>jXr(e.body),[e.body]),r=(0,KPe.useMemo)(()=>zXr(t),[t]),n=HXr(t),o=(0,KPe.useMemo)(()=>UXr(e.requestId,e.supersedes,n)??t.draft??t.saved,[e.requestId,e.supersedes,n,t]);return{payload:t,sliced:r,progress:o,head:n}}var KXr=S(re(),1);function XXr(e){let[t,r]=(0,KXr.useState)(()=>e?.reviewComments??[]);return{queued:t,onQueue:n=>r(o=>[...o,n]),onRemove:n=>r(o=>o.filter((i,a)=>a!==n)),onEdit:(n,o)=>r(i=>i.map((a,s)=>s===n?{...a,note:o}:a))}}var ZXr=S(re(),1);function QXr(e,t,r,n){(0,ZXr.useEffect)(()=>{WXr(e,t,{items:r,reviewComments:n})},[e,t,r,n])}function eZr(e,t,r){let{payload:n,sliced:o,progress:i,head:a}=YXr(e),s=xXr(n.checks,i,o?.slicing),l=XXr(i),u=uXr(o?.entries??[]),{comments:d,sentTo:f,clearSent:p}=Ij(t,r),h={...d,onQueue:l.onQueue};QXr(e.requestId,a,s.items,l.queued);let m=(0,JXr.useMemo)(()=>mXr(n),[n]);return{payload:n,checklist:s,queue:l,details:hXr(n,h),counts:m,sentTo:f,clearSent:p,sliced:o,nav:u,diffComments:h,head:a}}var NS=S(_(),1);function tZr({preview:e,session:t,sendInput:r,onDecision:n}){let o=eZr(e,t,r);return(0,NS.jsxs)(H,{sx:a0,children:[(0,NS.jsx)(Dh,{preview:e,draft:!1}),(0,NS.jsx)(rY,{items:e.metadata??[]}),(0,NS.jsx)(qn,{}),(0,NS.jsx)(KKr,{payload:o.payload,checklist:o.checklist,details:o.details,counts:o.counts,sliced:o.sliced,nav:o.nav,comments:o.diffComments}),(0,NS.jsx)(qn,{}),(0,NS.jsx)(lXr,{pane:o,onDecision:(i,a)=>{VXr(e.requestId,o.head),n(i,a)}}),(0,NS.jsx)(pf,{sessionName:o.sentTo,onClose:o.clearSent})]})}var cZr=S(re(),1);var bN=S(_(),1);function nYo(e){return e.topLeft===null?"Click the top-left box":e.bottomRight===null?"Now click the bottom-right box":"Both anchors picked"}function rZr({selection:e,onConfirm:t,onReject:r}){let n=e.topLeft!==null&&e.bottomRight!==null;return(0,bN.jsxs)(St,{direction:"row",spacing:1,sx:{p:2,alignItems:"center",justifyContent:"flex-end"},children:[(0,bN.jsx)(be,{variant:"body2",sx:{flex:1,color:"text.secondary"},children:nYo(e)}),(0,bN.jsx)(nt,{color:"error",variant:"outlined",onClick:r,children:"Cancel"}),(0,bN.jsx)(nt,{variant:"outlined",onClick:e.reset,children:"Start over"}),(0,bN.jsx)(nt,{color:"success",variant:"contained",disabled:!n,onClick:t,children:"Extract boxes"})]})}var oYo={"top-left":ic.miro.topLeft,"bottom-right":ic.miro.bottomRight};function nZr(e,t){let r=e.right-e.left,n=e.bottom-e.top;return{width:r,height:n,fontSize:Math.max(6,Math.min(n*.3,r/6,28)),radius:Math.min(8,n/4),colour:t?oYo[t]:ic.miro.box,opacity:t?.75:.35,strokeWidth:Math.max(1,r*.004)}}var dle=S(_(),1);function oZr({box:e,role:t,onSelect:r}){let n=nZr(e,t);return(0,dle.jsxs)("g",{role:"button",tabIndex:0,"aria-label":t?`${e.text} (${t})`:e.text,onClick:()=>r(e.id),onKeyDown:o=>{o.key==="Enter"&&r(e.id)},style:{cursor:"pointer"},children:[(0,dle.jsx)("rect",{x:e.left,y:e.top,width:n.width,height:n.height,rx:n.radius,fill:n.colour,fillOpacity:n.opacity,stroke:n.colour,strokeWidth:n.strokeWidth}),(0,dle.jsx)("text",{x:e.left+n.width/2,y:e.top+n.height/2,textAnchor:"middle",dominantBaseline:"central",fontSize:n.fontSize,fill:ic.miro.text,children:e.text})]})}function iZr(e){if(e.length===0)return"0 0 100 100";let t=Math.min(...e.map(a=>a.left)),r=Math.min(...e.map(a=>a.top)),n=Math.max(...e.map(a=>a.right))-t,o=Math.max(...e.map(a=>a.bottom))-r,i=Math.max(n*.02,8);return`${t-i} ${r-i} ${n+i*2} ${o+i*2}`}var XPe=S(_(),1);function aZr({boxes:e,selection:t}){return(0,XPe.jsx)(H,{sx:{flex:1,minHeight:0,overflow:"auto",p:2},children:(0,XPe.jsx)("svg",{role:"img","aria-label":"Miro board boxes",viewBox:iZr(e),preserveAspectRatio:"xMidYMid meet",style:{width:"100%",height:"100%"},children:e.map(r=>(0,XPe.jsx)(oZr,{box:r,role:t.roleOf(r.id),onSelect:t.choose},r.id))})})}function iYo(e){return typeof e?.id=="string"&&typeof e.text=="string"&&[e.left,e.top,e.right,e.bottom].every(t=>typeof t=="number"&&Number.isFinite(t))}function sZr(e){try{let t=JSON.parse(e);return Array.isArray(t?.boxes)?t.boxes.filter(iYo):[]}catch{return[]}}var Pgt=S(re(),1);function lZr(){let[e,t]=(0,Pgt.useState)(null),[r,n]=(0,Pgt.useState)(null);return{topLeft:e,bottomRight:r,choose:s=>{if(e===null||r!==null){t(s),n(null);return}n(s)},reset:()=>{t(null),n(null)},roleOf:s=>s===e?"top-left":s===r?"bottom-right":null}}var $3=S(_(),1);function uZr({preview:e,onDecision:t}){let r=(0,cZr.useMemo)(()=>sZr(e.body),[e.body]),n=lZr();return(0,$3.jsxs)(H,{sx:a0,children:[(0,$3.jsx)(Dh,{preview:e,draft:!1}),(0,$3.jsx)(qn,{}),(0,$3.jsx)(aZr,{boxes:r,selection:n}),(0,$3.jsx)(qn,{}),(0,$3.jsx)(rZr,{selection:n,onConfirm:()=>{let{topLeft:i,bottomRight:a}=n;i===null||a===null||t("approve",Gc({topLeft:i,bottomRight:a}))},onReject:()=>t("reject",Gc())})]})}var HZr=S(re(),1);function dZr(e){let t=[];return e.map(r=>(t.length=r+1,t[r]=(t[r]??0)+1,t.map(n=>n??1).join(".")))}function ZPe(e){return e*22}function fZr(e){return Math.round(e/22)}var pZr={display:"flex",alignItems:"flex-start",gap:.25,"& .criterion-action":{opacity:0,transition:"opacity 120ms"},"&:hover .criterion-action":{opacity:1},"&:focus-within .criterion-action":{opacity:1},"& .criterion-action:focus-visible":{opacity:1}},hZr={p:.25,mt:"2px",color:"text.disabled",cursor:"grab",touchAction:"none","&:active":{cursor:"grabbing"}},mZr={fontFamily:"fontFamilyMono",fontSize:"0.8rem",color:"text.secondary",minWidth:32,pt:"5px",textAlign:"right",userSelect:"none",whiteSpace:"nowrap"},gZr={flex:1,fontSize:"inherit",lineHeight:1.5,px:.75,py:0,borderRadius:1,"&:hover":{bgcolor:"action.hover"},"&.Mui-focused":{bgcolor:"action.selected"}},Agt={p:.25,mt:"2px"},yZr={position:"absolute",right:8,height:2,borderRadius:1,bgcolor:"primary.main",pointerEvents:"none"};var bZr=S(_(),1),aYo=8;function vZr({drag:e}){return e?(0,bZr.jsx)(H,{sx:yZr,style:{top:e.top-1,left:aYo+ZPe(e.depth)}}):null}var xZr=S(_(),1),SZr=ot((0,xZr.jsx)("path",{d:"M11 18c0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2 2 .9 2 2m-2-8c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0-6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m6 4c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2m0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2"}),"DragIndicator");var Lgt=S(_(),1);function TZr({number:e,onGrip:t}){return(0,Lgt.jsx)(Mt,{size:"small",className:"criterion-action",sx:hZr,"aria-label":`Reorder criterion ${e}`,onPointerDown:t,children:(0,Lgt.jsx)(SZr,{fontSize:"inherit"})})}var dk=S(_(),1);function wZr({number:e,onAdd:t,onDelete:r}){return(0,dk.jsxs)(dk.Fragment,{children:[(0,dk.jsx)(Mt,{size:"small",className:"criterion-action",sx:Agt,"aria-label":`Add criterion after ${e}`,onClick:t,children:(0,dk.jsx)(Kd,{fontSize:"inherit"})}),(0,dk.jsx)(Mt,{size:"small",className:"criterion-action",sx:Agt,"aria-label":`Delete criterion ${e}`,onClick:r,children:(0,dk.jsx)(_o,{fontSize:"inherit"})})]})}var QPe=S(re(),1);function CZr(e,t){return e==="start"?0:e==="end"?t:Math.min(Math.max(e,0),t)}function kZr(e){let t=(0,QPe.useRef)(null);return(0,QPe.useEffect)(()=>{let r=t.current;if(!e||!r)return;r.focus();let n=CZr(e.caret,r.value.length);r.setSelectionRange(n,n)},[e]),t}var xN=S(_(),1);function _Zr({index:e,number:t,item:r,outline:n,dragging:o,onGrip:i}){let a=kZr(n.focus?.index===e?n.focus:null),s={marginLeft:ZPe(r.depth),opacity:o?.4:1};return(0,xN.jsxs)(H,{sx:pZr,"data-criterion-row":!0,style:s,children:[(0,xN.jsx)(TZr,{number:t,onGrip:i}),(0,xN.jsx)(H,{component:"span",sx:mZr,"aria-hidden":"true",children:`${t}.`}),(0,xN.jsx)(Hi,{multiline:!0,value:r.text,sx:gZr,inputRef:a,inputProps:{"aria-label":`Criterion ${t}`},onChange:l=>n.onText(e,l.target.value),onKeyDown:l=>n.onKeyDown(e,l)}),(0,xN.jsx)(wZr,{number:t,onAdd:()=>n.onAdd(e),onDelete:()=>n.onDelete(e)})]})}var DZr=S(re(),1);function EZr(e,t,{key:r,shift:n,alt:o,caret:i,text:a}){return o||n?null:r==="ArrowUp"&&i===0&&t>0?{kind:"focus",index:t-1}:r==="ArrowDown"&&i===a.length&&t<e.length-1?{kind:"focus",index:t+1}:null}function F3(e){if(e.length===0)return[{text:"",depth:0}];let t=-1;return e.map(r=>{let n=Math.min(Math.max(r.depth,0),t+1);return t=n,r.depth===n?r:{...r,depth:n}})}function JPe(e,t,r,n){let o=e[t]?.depth??0,i=e.map((a,s)=>s===t?{...a,text:r}:a);return{items:F3([...i.slice(0,t+1),{text:n,depth:o},...i.slice(t+1)]),index:t+1}}function dg(e,t){let r=t+1;for(;r<e.length&&e[r].depth>e[t].depth;)r+=1;return r}function eAe(e,t){let r=e[t].depth;for(let n=t-1;n>=0;n-=1){if(e[n].depth<r)return-1;if(e[n].depth===r)return n}return-1}function RZr(e,t){let r=dg(e,t);return r<e.length&&e[r].depth===e[t].depth?r:-1}function PZr(e,t,r){let n=r<0?eAe(e,t):RZr(e,t);if(n<0)return null;let o=dg(e,t),i=e.slice(t,o),a=[...e.slice(0,t),...e.slice(o)],s=r<0?n:dg(e,n)-(o-t);return{items:[...a.slice(0,s),...i,...a.slice(s)],index:s}}function tAe(e,t){let r=dg(e,t),n=e.map((o,i)=>i>t&&i<r?{...o,depth:o.depth-1}:o).filter((o,i)=>i!==t);return{items:F3(n),index:Math.max(0,t-1)}}function AZr(e,t,r){if(r<0&&e[t].depth===0||r>0&&eAe(e,t)<0)return null;let n=dg(e,t);return e.map((o,i)=>i>=t&&i<n?{...o,depth:o.depth+r}:o)}function rAe(e,t){return e?{kind:"edit",edit:e,caret:t}:null}function sYo(e,t,{caret:r,text:n}){let o=n.slice(0,r);return rAe(JPe(e,t,o,n.slice(r)),"start")}function lYo(e,t,{shift:r,caret:n}){let o=AZr(e,t,r?-1:1);return rAe(o?{items:o,index:t}:null,n)}function LZr(e,t,r){let{key:n,shift:o,alt:i,caret:a,text:s}=r;return n==="Enter"&&!o?sYo(e,t,r):n==="Tab"?lYo(e,t,r):i&&(n==="ArrowUp"||n==="ArrowDown")?rAe(PZr(e,t,n==="ArrowUp"?-1:1),a):n==="Backspace"&&a===0&&s===""?rAe(tAe(e,t),"end"):null}function IZr(e,t,r){return LZr(e,t,r)??EZr(e,t,r)}function MZr(e,t){let[r,n]=(0,DZr.useState)(null),o=(a,s)=>{a&&(t(a.items),n({index:a.index,caret:s}))};return{focus:r,onKeyDown:(a,s)=>{let l=s.currentTarget;(s.key==="Enter"||s.key==="Tab")&&s.preventDefault();let u=IZr(e,a,{key:s.key,shift:s.shiftKey,alt:s.altKey,caret:l.selectionStart??0,text:l.value});u&&(s.preventDefault(),u.kind==="focus"?n({index:u.index,caret:"end"}):o(u.edit,u.caret))},onDrop:a=>o(a,"end"),onText:(a,s)=>t(e.map((l,u)=>u===a?{...l,text:s}:l)),onAdd:a=>o(JPe(e,a,e[a].text,""),"start"),onDelete:a=>o(tAe(e,a),"end")}}var FZr=S(re(),1);function cYo(e,t,r,n){let o=t.length;for(let a=0;a<e.length;a+=1)if(n<e[a].top+e[a].height/2){o=a;break}let i=dg(t,r);return o>r&&o<i?r:o}function uYo(e,t,r,n){let o=dg(e,t),i=r-1,a=i>=t&&i<o?t-1:i,s=a>=0?e[a].depth+1:0;return Math.max(0,Math.min(e[t].depth+fZr(n),s))}function dYo(e,t){if(t<e.length)return e[t].top;let r=e[e.length-1];return r?r.top+r.height:0}function NZr(e,t,r,n,o){let i=cYo(e,t,r,o);return{target:i,depth:uYo(t,r,i,n),top:dYo(e,i)}}function fYo(e){let t=e.getBoundingClientRect().top;return{boxes:Array.from(e.querySelectorAll("[data-criterion-row]")).map(n=>{let o=n.getBoundingClientRect();return{top:o.top-t,height:o.height}}),origin:t}}function OZr(e,t,r,n){return o=>{let{boxes:i,origin:a}=fYo(t);return NZr(i,e,r,o.clientX-n,o.clientY-a)}}function BZr(e,t,r,n,o){let i=new AbortController,a=null,s=d=>{a=r(d),n(a)},l=()=>{i.abort(),a&&o(a)},u={signal:i.signal};return e.setPointerCapture(t),e.addEventListener("pointermove",s,u),e.addEventListener("pointerup",l,u),e.addEventListener("pointercancel",l,u),s}function $Zr(e,t,r,n){let o=dg(e,t),i=n-e[t].depth,a=e.slice(t,o).map(u=>({...u,depth:Math.max(0,u.depth+i)})),s=[...e.slice(0,t),...e.slice(o)],l=r>t?r-a.length:r;return{items:F3([...s.slice(0,l),...a,...s.slice(l)]),index:l}}function zZr(e,t,r){let[n,o]=(0,FZr.useState)(null);return{drag:n,onGrip:a=>s=>{let l=t.current;if(!l||s.pointerType==="mouse"&&s.button!==0)return;s.preventDefault(),BZr(s.currentTarget,s.pointerId,OZr(e,l,a,s.clientX),d=>o({from:a,depth:d.depth,top:d.top}),d=>{o(null),r($Zr(e,a,d.target,d.depth))})(s)}}}var fle=S(_(),1),pYo={my:1,px:1,py:.5,border:1,borderColor:"divider",borderRadius:1,position:"relative",userSelect:"text",cursor:"auto"},hYo=[{text:"",depth:0}];function UZr({items:e,onChange:t}){let r=(0,HZr.useRef)(null),n=e.length>0?e:hYo,o=MZr(n,t),{drag:i,onGrip:a}=zZr(n,r,o.onDrop),s=dZr(n.map(l=>l.depth));return(0,fle.jsxs)(H,{sx:pYo,ref:r,"data-preview-skip":!0,"aria-label":"Acceptance criteria",children:[n.map((l,u)=>(0,fle.jsx)(_Zr,{index:u,number:s[u],item:l,outline:o,dragging:i?.from===u,onGrip:a(u)},`criterion-${u}`)),(0,fle.jsx)(vZr,{drag:i})]})}var WZr=S(_(),1),VZr=ot((0,WZr.jsx)("path",{d:"M2 17h2v.5H3v1h1v.5H2v1h3v-4H2zm1-9h1V4H2v1h1zm-1 3h1.8L2 13.1v.9h3v-1H3.2L5 10.9V10H2zm5-6v2h14V5zm0 14h14v-2H7zm0-6h14v-2H7z"}),"FormatListNumbered");var ple=S(_(),1),mYo={insert:"Add acceptance criteria",convert:"Convert to outline"};function GZr({kind:e,onClick:t}){return(0,ple.jsx)(H,{sx:{my:1},"data-preview-skip":!0,children:(0,ple.jsx)(nt,{size:"small",variant:"outlined",startIcon:e==="insert"?(0,ple.jsx)(Kd,{}):(0,ple.jsx)(VZr,{}),onClick:t,children:mYo[e]})})}var hle=S(re(),1);function qZr(e,t,{color:r,pin:n}){let o=D6(e),i=[],a=o.nextNode();for(;a;){let u=a;if(t.intersectsNode(u)){let d=u===t.startContainer?t.startOffset:0,f=u===t.endContainer?t.endOffset:u.length;d<f&&i.push({node:u,start:d,end:f})}a=o.nextNode()}let l=i.map(u=>gYo(u.node,u.start,u.end,r)).at(-1);l&&n&&(l.dataset.pin=n)}function gYo(e,t,r,n){let o=document.createRange();o.setStart(e,t),o.setEnd(e,r);let i=document.createElement("mark");return i.className="pr-comment",i.style.backgroundColor=n,o.surroundContents(i),i}function jZr(e){for(let t of e.querySelectorAll("mark.pr-comment"))if(t.parentNode){for(;t.firstChild;)t.before(t.firstChild);t.remove()}}function YZr(e,t){for(let r of t){let n=_Nt(e,r);n&&qZr(e,n,r)}}var mle=S(_(),1);function KZr({content:e,control:t,trailing:r,ranges:n,contentRef:o}){let i=(0,hle.useMemo)(()=>BD(e),[e]),a=(0,hle.useMemo)(()=>BD(r??""),[r]);return(0,hle.useLayoutEffect)(()=>{let s=o.current;s&&(jZr(s),YZr(s,n))},[i,a,n,o]),(0,mle.jsxs)(H,{ref:o,children:[(0,mle.jsx)(DD,{segments:i,skipDiagramText:!0}),t,t?(0,mle.jsx)(DD,{segments:a,skipDiagramText:!0}):null]})}var SN=e=>e.split(",").map(t=>`&& .markdown ${t.trim()}`).join(", ");function nAe(e){let{color:t,radius:r}=e.tokens;return{px:2.5,py:2,fontSize:14,lineHeight:1.6,[SN("")]:{lineHeight:1.6},[SN("h1, h2, h3, h4, h5, h6")]:{fontSize:15,fontWeight:600,lineHeight:1.4,mt:2,mb:1},[SN("ul, ol")]:{pl:2.5,mb:2},[SN("li")]:{mb:"6px"},[SN("code")]:{fontFamily:e.typography.fontFamilyMono,fontSize:"0.86em",px:"5px",py:0,bgcolor:t.raised,border:1,borderColor:t.lineSoft,borderRadius:"4px"},[SN("pre")]:{bgcolor:t.raised,border:1,borderColor:t.lineSoft,borderRadius:`${r.sm}px`},[SN("pre code")]:{border:0,px:0,bgcolor:"transparent"}}}var XZr=e=>({flex:1,overflow:"auto",position:"relative",userSelect:"none",cursor:"text",wordBreak:"break-word","& .markdown":{...j$(e),maxWidth:"none"},"& a":{color:"primary.main"},"& mark.pr-comment":{color:"inherit",borderRadius:"2px"},...nAe(e)});var oY=S(_(),1);function ZZr({content:e,control:t,trailing:r,ranges:n,wrapperRef:o,contentRef:i,dragRects:a,dragColor:s,onMouseDown:l,footer:u}){return(0,oY.jsxs)(H,{ref:o,onMouseDown:l,sx:XZr,children:[(0,oY.jsx)(KZr,{content:e,control:t,trailing:r,ranges:n,contentRef:i}),u&&(0,oY.jsx)(H,{sx:{userSelect:"text"},children:u}),(0,oY.jsx)(B$,{rects:a,color:s})]})}function QZr(e){let t=new Map,r=[];for(let n of e){if(!n.group){r.push(n);continue}t.set(n.group,[...t.get(n.group)??[],n])}return{groups:[...t],ungrouped:r}}var oAe=S(re(),1),JZr=S(_(),1);function Igt({label:e,value:t,onCommit:r,listId:n}){let[o,i]=(0,oAe.useState)(t);return(0,oAe.useEffect)(()=>i(t),[t]),(0,JZr.jsx)(An,{size:"small",variant:"standard",fullWidth:!0,label:e,value:o,onChange:s=>i(s.target.value),onBlur:()=>{let s=o.trim();i(t),s!==t&&r(s)},onKeyDown:s=>{s.key==="Enter"&&s.target.blur()},onMouseDown:s=>s.stopPropagation(),slotProps:{htmlInput:{list:n}}})}var gle=S(_(),1),Dgt="screenshot-groups";function yYo(e){return(e.split(/[\\/]/).pop()??e).replace(/\.[^.]+$/,"")}function eQr({screenshot:e,onUpdate:t}){return(0,gle.jsxs)(St,{direction:"row",spacing:1,sx:{mt:.5},children:[(0,gle.jsx)(Igt,{label:"Caption",value:e.alt,onCommit:r=>t(e.id,{alt:r||yYo(e.path)})}),(0,gle.jsx)(Igt,{label:"Group",value:e.group??"",listId:Dgt,onCommit:r=>t(e.id,{group:r})})]})}var z3=S(_(),1),tQr={display:"block",maxWidth:"100%",borderRadius:1,border:1,borderColor:"divider"},vYo={position:"absolute",top:4,right:4,bgcolor:"background.paper","&:hover":{bgcolor:"background.paper"}};function rQr({screenshot:e,onRemove:t,onUpdate:r}){let n=e.contentType.startsWith("video/");return(0,z3.jsxs)(H,{sx:{position:"relative"},children:[n?(0,z3.jsx)(H,{component:"video",controls:!0,src:e.url,"aria-label":"screenshot",sx:tQr}):(0,z3.jsx)(H,{component:"img",src:e.url,alt:"screenshot",sx:tQr}),(0,z3.jsx)(Mt,{size:"small","aria-label":"Remove screenshot",sx:vYo,onMouseDown:o=>o.stopPropagation(),onClick:()=>t(e.id),children:(0,z3.jsx)(_o,{fontSize:"small"})}),(0,z3.jsx)(eQr,{screenshot:e,onUpdate:r})]})}var h0=S(_(),1);function bYo(){return(0,h0.jsxs)(St,{direction:"row",spacing:1,sx:{alignItems:"center"},children:[(0,h0.jsx)(ao,{size:16}),(0,h0.jsx)(be,{variant:"caption",color:"text.secondary",children:"Attaching screenshot or video\u2026"})]})}function xYo({error:e}){return(0,h0.jsx)(be,{variant:"caption",color:"error",sx:{wordBreak:"break-word"},children:e})}function nQr({uploads:e,empty:t}){return e.length>0?(0,h0.jsx)(h0.Fragment,{children:e.map(r=>r.error?(0,h0.jsx)(xYo,{error:r.error},r.id):(0,h0.jsx)(bYo,{},r.id))}):t?(0,h0.jsx)(be,{variant:"caption",color:"text.secondary",children:"Drop or paste an image or video to attach"}):null}var m0=S(_(),1),SYo={display:"grid",gridTemplateColumns:"repeat(2, minmax(0, 1fr))",gap:1};function oQr({screenshots:e,uploads:t,onRemove:r,onUpdate:n}){let{groups:o,ungrouped:i}=QZr(e),a=s=>(0,m0.jsx)(rQr,{screenshot:s,onRemove:r,onUpdate:n},s.id);return(0,m0.jsxs)(H,{sx:{mt:3},children:[e.length>0&&(0,m0.jsx)(H,{component:"h2",children:"Screenshots"}),(0,m0.jsx)("datalist",{id:Dgt,children:o.map(([s])=>(0,m0.jsx)("option",{value:s},s))}),o.map(([s,l])=>(0,m0.jsxs)(H,{sx:{mb:2},children:[(0,m0.jsx)(H,{component:"h3",children:s}),(0,m0.jsx)(H,{sx:SYo,children:l.map(a)})]},s)),(0,m0.jsxs)(St,{spacing:1,children:[i.map(a),(0,m0.jsx)(nQr,{uploads:t,empty:e.length===0})]})]})}var yle=S(_(),1);function TYo(e){let t=e.criteria;if(!t)return{content:e.body};let r={content:t.before,trailing:t.after};return t.kind==="outline"?{...r,control:(0,yle.jsx)(UZr,{items:t.items,onChange:e.onCriteriaChange})}:{...r,control:(0,yle.jsx)(GZr,{kind:t.kind,onClick:t.kind==="insert"?e.onCriteriaInsert:e.onCriteriaConvert})}}function iAe({pane:e,screenshots:t}){return(0,yle.jsx)(ZZr,{...TYo(e),ranges:e.ranges,wrapperRef:e.wrapperRef,contentRef:e.contentRef,dragRects:e.dragRects,dragColor:e.dragColor,onMouseDown:e.onMouseDown,footer:t?(0,yle.jsx)(oQr,{screenshots:e.screenshots,uploads:e.uploads,onRemove:e.removeScreenshot,onUpdate:e.updateScreenshot}):void 0})}var iQr=e=>({display:"grid",gap:1,maxHeight:220,overflow:"auto",px:2,py:1.25,borderTop:1,borderColor:e.tokens.color.lineSoft}),aQr={fontSize:11,fontWeight:600,letterSpacing:"0.06em",textTransform:"uppercase",color:"text.secondary"},sQr=e=>({display:"grid",gridTemplateColumns:"minmax(0, 1fr) auto",gap:"4px 8px",px:1.25,py:1,borderRadius:`${e.tokens.radius.sm}px`,bgcolor:e.tokens.color.raised,border:1,borderColor:e.tokens.color.lineSoft,fontSize:12.5}),lQr={gridColumn:2,gridRow:1,width:20,height:20,color:"text.disabled","& .MuiSvgIcon-root":{fontSize:14}};var fk=S(_(),1);function cQr({comments:e,colors:t,onRemove:r}){return(0,fk.jsxs)(H,{sx:iQr,children:[(0,fk.jsxs)(be,{sx:aQr,children:["Comments (",e.length,")"]}),e.map((n,o)=>(0,fk.jsxs)(H,{sx:sQr,children:[(0,fk.jsx)(D$,{text:n.quote,sx:{gridColumn:1,borderLeft:2,pl:1,borderColor:t[o]}}),(0,fk.jsx)(H,{sx:{gridColumn:1,wordBreak:"break-word"},children:n.note}),(0,fk.jsx)(Mt,{"aria-label":"Remove comment",onClick:()=>r(n.id),sx:lQr,children:(0,fk.jsx)(_o,{})})]},n.id))]})}var dQr=S(_(),1);function uQr(e){return e.comments.length===0?null:(0,dQr.jsx)(cQr,{...e})}var fQr=S(_(),1),aAe=ot((0,fQr.jsx)("path",{d:"M20 18c1.1 0 1.99-.9 1.99-2L22 6c0-1.1-.9-2-2-2H4c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2H0v2h24v-2zM4 6h16v10H4z"}),"Computer");var vQr=S(re(),1);var pQr=S(_(),1),hQr=ot((0,pQr.jsx)("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2"}),"Circle");var g0="0.1198.1";var wYo={connected:"success.main",connecting:"warning.main",disconnected:"error.main","version-blocked":"error.main"};function mQr(e){return e?wYo[e]:"success.main"}function gQr(e){return e.split("-")[0].split(".").map(Number)}function yQr(e,t){if(!e||!t||e===t)return;let r=gQr(e),n=gQr(t);for(let o=0;o<Math.max(r.length,n.length);o++){let i=(r[o]??0)-(n[o]??0);if(Number.isNaN(i))return;if(i!==0)return i<0?"behind":"ahead"}}var sAe=S(re(),1),Mgt=(0,sAe.createContext)(null);function lAe(){return(0,sAe.useContext)(Mgt)}var TN=S(_(),1),CYo={height:16,fontSize:10},kYo={opacity:.6,fontSize:"0.85em"};function _Yo(e,t){if(t===e.local)return"this machine";let r=e.links.find(n=>n.name===t);return r?r.error?`${r.state}: ${r.error}`:r.state:""}function H3({nodes:e,name:t,showVersion:r=!1}){let n=lAe()??g0,o=e.links.find(a=>a.name===t),i=yQr(o?.peerVersion,n);return(0,TN.jsx)(lr,{title:_Yo(e,t),placement:"right",children:(0,TN.jsxs)(H,{component:"span",sx:{display:"inline-flex",alignItems:"center",gap:.75},children:[(0,TN.jsx)(hQr,{sx:{fontSize:8,color:mQr(o?.state)}}),t,r&&o?.peerVersion&&(0,TN.jsxs)(H,{component:"span",sx:kYo,children:["v",o.peerVersion]}),i&&(0,TN.jsx)(vn,{label:i,size:"small",color:i==="behind"?"warning":"info",sx:CYo})]})})}var y0=S(_(),1),EYo={textTransform:"none"};function cAe({nodes:e,options:t,target:r,onPick:n}){let[o,i]=(0,vQr.useState)(null);return(0,y0.jsxs)(y0.Fragment,{children:[(0,y0.jsx)(nt,{size:"small",color:"inherit",startIcon:(0,y0.jsx)(aAe,{fontSize:"small"}),"aria-label":"Start on node","aria-haspopup":"menu",onClick:a=>i(a.currentTarget),sx:EYo,children:(0,y0.jsx)(H3,{nodes:e,name:r.node})}),(0,y0.jsx)(hi,{anchorEl:o,open:!!o,onClose:()=>i(null),children:t.map(({name:a,cwd:s})=>(0,y0.jsx)(Br,{disabled:!s,selected:a===r.node,onClick:()=>{n(a),i(null)},children:(0,y0.jsx)(Vu,{primary:(0,y0.jsx)(H3,{nodes:e,name:a}),secondary:s?void 0:"no clone"})},a))})]})}var bQr=S(re(),1);function RYo(e,t){return e?.toLowerCase()===t.toLowerCase()}function uAe(e,t){let{nodes:r,names:n,visible:o}=ds(),{repos:i,selectedCwd:a,selectedNode:s,cloneOn:l,originOf:u}=_n(),[d,f]=(0,bQr.useState)(),p=e&&u(e)?e:a,h=t?i.find(b=>RYo(u(b),t)):p,m=n.map(b=>({name:b,cwd:h?l(h,b):void 0})),g=b=>m.find(x=>x.name===b&&x.cwd),y=g(d)??g(s??r?.local)??m.find(b=>b.cwd),v=o&&y?.cwd?{node:y.name,cwd:y.cwd}:void 0;return{nodes:r,visible:o,options:m,target:v,pick:f}}var U3=S(_(),1);function xQr({canStart:e,startOrigin:t,cwd:r,onApprove:n,onApproveAndStart:o}){let i=oge(),a=uAe(r,t);return(0,U3.jsxs)(U3.Fragment,{children:[(0,U3.jsx)(nt,{color:"primary",variant:e?"tonal":"contained",onClick:n,...e?{}:i,children:"Approve"}),e&&a.nodes&&a.target&&(0,U3.jsx)(cAe,{nodes:a.nodes,options:a.options,target:a.target,onPick:a.pick}),e&&(0,U3.jsx)(nt,{color:"primary",variant:"contained",onClick:()=>o(a.target),...i,children:"Approve & start"})]})}var Ngt=S(_(),1),PYo={"& .MuiFormControlLabel-label":{fontSize:12}};function vle({label:e,title:t,checked:r,onChange:n}){return(0,Ngt.jsx)($d,{control:(0,Ngt.jsx)(Mp,{size:"small",checked:r,onChange:o=>n(o.target.checked)}),label:e,title:t,sx:PYo})}var wN=S(_(),1);function dAe({chain:e,newPr:t,onChange:r}){return(0,wN.jsxs)(St,{direction:"row",sx:{mr:"auto"},children:[t&&(0,wN.jsx)(vle,{label:"Draft",title:"Create the PR as a draft rather than ready for review",checked:e.draft,onChange:n=>r({...e,draft:n,autoMerge:n?!1:e.autoMerge})}),(0,wN.jsx)(vle,{label:"Auto-merge (squash)",title:"Squash-merge the PR automatically once its required checks pass",checked:e.autoMerge,onChange:n=>r({...e,autoMerge:n,draft:n?!1:e.draft})}),(0,wN.jsx)(vle,{label:"Review PR",title:"After raising, run a review that posts its findings and then addresses them",checked:e.reviewAfter,onChange:n=>r({...e,reviewAfter:n})}),(0,wN.jsx)(vle,{label:"Post to Slack",title:"Announce the PR in Slack at the tail of the chain",checked:e.announceAfter,onChange:n=>r({...e,announceAfter:n})})]})}var CN=S(_(),1);function SQr({commentCount:e,chain:t,newPr:r,canStart:n,startOrigin:o,onChainChange:i,onApprove:a,cwd:s,onApproveAndStart:l,onReject:u,onRequestChanges:d}){return(0,CN.jsxs)(St,{direction:"row",spacing:1,sx:{px:2,py:1.5,alignItems:"center",justifyContent:"flex-end"},children:[t&&(0,CN.jsx)(dAe,{chain:t,newPr:r,onChange:i}),(0,CN.jsx)(nt,{color:"error",variant:"outlined",onClick:u,children:"Reject"}),e>0&&(0,CN.jsxs)(nt,{color:"warning",variant:"tonal",onClick:d,children:["Request changes (",e,")"]}),(0,CN.jsx)(xQr,{canStart:n,startOrigin:o,cwd:s,onApprove:a,onApproveAndStart:l})]})}var wQr=S(_(),1);function TQr({comments:e,cwd:t,onDecision:r,chain:n,newPr:o,canStart:i,startOrigin:a,onChainChange:s}){let l=()=>e.map(u=>({quote:u.quote,note:u.note}));return(0,wQr.jsx)(SQr,{commentCount:e.length,chain:n,newPr:o,canStart:i,startOrigin:a,onChainChange:s,onApprove:()=>r("approve",l()),cwd:t,onApproveAndStart:u=>r("approve",l(),u??!0),onReject:()=>r("reject",[]),onRequestChanges:()=>r("reject",l())})}var pk=S(_(),1);function CQr(e){let{comments:t,commentColors:r,pending:n,cwd:o,unavailable:i,onAdd:a,onQueue:s,onCite:l,onAddRule:u,onRemove:d,onCancel:f,onCollapse:p,editable:h}=e;return(0,pk.jsxs)(pk.Fragment,{children:[(0,pk.jsx)(uQr,{comments:t,colors:r,onRemove:d}),(0,pk.jsx)(qn,{}),(0,pk.jsx)(TQr,{...e}),(0,pk.jsx)(bye,{pending:n,editable:h,cwd:o,unavailable:i,onAdd:a,onQueue:s,onCite:l,onAddRule:u,onCancel:f,onCollapse:p})]})}var ble=S(_(),1),AYo={px:2,pb:2,display:"flex",alignItems:"center",gap:1.5,minWidth:0},LYo={color:"text.secondary",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"};function kQr({url:e}){return(0,ble.jsxs)(H,{sx:AYo,children:[(0,ble.jsx)(nt,{variant:"contained",href:e,target:"_blank",rel:"noopener noreferrer",sx:{flexShrink:0},children:"Open design \u2197"}),(0,ble.jsx)(be,{variant:"body2",sx:LYo,title:e,children:e})]})}var Ogt=S(_(),1);function _Qr({preview:e}){let t=e.kind==="design"?e.metadata?.[0]?.url:void 0;return t?(0,Ogt.jsx)(kQr,{url:t}):(0,Ogt.jsx)(rY,{items:e.metadata??[]})}function EQr({preview:e,pane:t,cwd:r,isPr:n,editable:o,sender:i,onCite:a,onAddRule:s}){return{comments:t.comments,commentColors:t.commentColors,pending:t.pending,cwd:r,unavailable:i.unavailable,onAdd:i.onSend,onQueue:t.onAdd,onCite:a,onAddRule:s,onRemove:t.remove,onCancel:t.onCancel,onCollapse:t.onCollapse,onDecision:t.onDecide,chain:n?t.chain:void 0,editable:o,newPr:n&&e.prNumber===null,canStart:e.kind==="backlog-item"&&e.canStart===!0,startOrigin:e.startOrigin,onChainChange:t.setChain}}function iY(e){let t=e??"pr";return{isPr:t==="pr",screenshots:t==="pr"||t==="github-issue"||t==="github-issue-edit"||t==="github-issue-comment",editable:t==="github-issue-edit",closeOnly:t==="show"}}function RQr(e,t){return e?`${e}:${t??"pr"}`:void 0}function fAe(e,t,r,n){return{...iY(e.kind),requestId:e.requestId,supersedes:e.supersedes,sessionId:t,cwd:r,onDecision:n,screenshotScope:RQr(t,e.kind),seededScreenshots:e.screenshots??[],chainDefaults:{draft:e.draft===!0,reviewAfter:e.reviewAfter??!0},initialBody:e.body}}function PQr(e,t,r,n){if(!(!e||!t))return o=>{r!==void 0&&dl(t,e,s_e({quote:r,note:o})),n()}}function AQr(e,t,r,n){if(!(!e||!t))return o=>{r!==void 0&&dl(t,e,qx(r,aye(o))),n()}}function pAe(e,t,r,n){return{onCite:AQr(e,t,r,n),onAddRule:PQr(e,t,r,n)}}function LQr(e){return{criteria:e.criteria,onCriteriaChange:e.writeCriteria,onCriteriaInsert:e.insertCriteria,onCriteriaConvert:e.convertCriteria}}var zQr=S(re(),1);var hk=S(re(),1);var IQr="assist:pr-preview-comments:",Bgt=e=>`${IQr}${e}`;function $gt(e){return fl(Bgt(e))}function xle(e,t){Dl(Bgt(e),t)}function hAe(e){Vv(Bgt(e))}function DQr(){jx(IQr)}function MQr(e){let t=D6(e),r="";for(let n=t.nextNode();n;n=t.nextNode())r+=n.textContent??"";return r}function IYo(e,t,r){let n=-1;for(let o=e.indexOf(t);o!==-1;o=e.indexOf(t,o+1))(n===-1||Math.abs(o-r)<Math.abs(n-r))&&(n=o);return n}function NQr(e,t){return e.flatMap(r=>{let n=IYo(t,r.quote,r.start);return n===-1?[]:[{...r,start:n,end:n+r.quote.length}]})}function OQr(e,t,r){let n=$gt(e);if(n.length>0||!t||!r)return n;let o=NQr($gt(t),MQr(r));return xle(e,o),hAe(t),o}function BQr(e,t,r){let[n,o]=(0,hk.useState)([]),i=(0,hk.useRef)(0);(0,hk.useEffect)(()=>{DQr(),o(OQr(e,t,r.current).map(l=>({...l,id:i.current++})))},[e,t,r]);let a=(0,hk.useCallback)(l=>{o(u=>{let d=[...u,{...l,id:i.current++}];return xle(e,d),d})},[e]),s=(0,hk.useCallback)(l=>{o(u=>{let d=u.filter(f=>f.id!==l);return xle(e,d),d})},[e]);return{comments:n,add:a,remove:s}}function $Qr(e,t){let r=e.map((i,a)=>yG(a).solid),n=yG(e.length).fill,o=e.map((i,a)=>({start:i.start,end:i.end,color:yG(a).fill,pin:String(a+1)}));return t&&o.push({start:t.start,end:t.end,color:n}),{commentColors:r,dragColor:n,ranges:o}}function FQr(e,t,r,n){return{onAdd:o=>{e&&t({quote:e.quote,note:o,start:e.start,end:e.end}),n()},onCollapse:()=>{e&&r(e.quote),n()}}}function HQr(e,t,r){let{wrapperRef:n,contentRef:o,pending:i,dragRects:a,onMouseDown:s,clear:l,select:u}=qy(),{comments:d,add:f,remove:p}=BQr(e,t,o),{commentColors:h,dragColor:m,ranges:g}=(0,zQr.useMemo)(()=>$Qr(d,i),[d,i]),{onAdd:y,onCollapse:v}=FQr(i,f,r,l);return{wrapperRef:n,contentRef:o,onMouseDown:s,comments:d,commentColors:h,remove:p,pending:i,ranges:g,dragRects:a,dragColor:m,onAdd:y,onCollapse:v,onCancel:l,onSelect:u}}var gAe=S(re(),1);var Fgt="assist:preview-screenshots:",zgt=e=>`${Fgt}${e}`,mAe=e=>`${Fgt}seeded:${e}`;function UQr(e){return e?(jx(Fgt),fl(zgt(e)).filter(t=>typeof t.path=="string")):[]}function kN(e,t){e&&Dl(zgt(e),t.map(({path:r,alt:n,group:o,contentType:i,seeded:a})=>({path:r,alt:n,group:o,contentType:i,seeded:a})))}function WQr(e){e&&(Vv(zgt(e)),Vv(mAe(e)))}var _N=S(re(),1);var VQr={"image/png":"png","image/jpeg":"jpg","image/gif":"gif","image/webp":"webp","image/svg+xml":"svg","video/mp4":"mp4","video/webm":"webm","video/quicktime":"mov"};function DYo(e){let t=e.split(".").pop()?.toLowerCase();return Object.entries(VQr).find(([,n])=>n===t)?.[0]??"application/octet-stream"}function GQr(e){return e.map(t=>({...t,contentType:DYo(t.path),seeded:!0}))}function qQr(e,t,r){if(!e)return GQr(r);let n=UQr(e);if(fl(mAe(e))[0]===t)return n;let o=[...GQr(r),...n.filter(i=>!i.seeded)];return kN(e,o),Dl(mAe(e),[t]),o}function jQr(e,t){let r=new URLSearchParams({path:e});return t&&r.set("node",t),ov(`/api/pr-preview/image?${r}`)}function YQr(e,t,r){let[n,o]=(0,_N.useState)([]),i=(0,_N.useRef)(0),a=ur(),s=(0,_N.useRef)(r);return s.current=r,(0,_N.useEffect)(()=>{o(qQr(e,t,s.current).map(l=>({...l,url:jQr(l.path,a),id:i.current++})))},[e,t,a]),{screenshots:n,setScreenshots:o,nextId:i}}var KQr=S(re(),1);function XQr(e,t){return(0,KQr.useCallback)((r,n)=>{t(o=>{let i=o.map(a=>a.id===r?{...a,...n}:a);return kN(e,i),i})},[e,t])}function ZQr(e,t,r){let{screenshots:n,setScreenshots:o,nextId:i}=YQr(e,t,r),a=(0,gAe.useCallback)(d=>{o(f=>{let p=[...f,{...d,id:i.current++}];return kN(e,p),p})},[e,o,i]),s=(0,gAe.useCallback)(d=>{o(f=>{let p=f.find(m=>m.id===d);p?.url.startsWith("blob:")&&URL.revokeObjectURL(p.url);let h=f.filter(m=>m.id!==d);return kN(e,h),h})},[e,o]),l=XQr(e,o),u=(0,gAe.useCallback)(()=>WQr(e),[e]);return{screenshots:n,add:a,remove:s,update:l,clearPersisted:u}}var aY=S(re(),1);async function QQr(e,t,r){let n=new URLSearchParams;t&&n.set("cwd",t),r&&n.set("node",r),e instanceof File&&e.name&&n.set("name",e.name);let o=await Wt(`/api/pr-preview/upload-image?${n}`,{method:"POST",headers:{"Content-Type":e.type||"application/octet-stream"},body:e,timeoutMs:12e4}),i=await o.json().catch(()=>null);if(!o.ok||!i?.path)throw new Error(i?.error??"Failed to attach file");return{path:i.path,alt:i.alt??"screenshot"}}var rJr=S(re(),1);function JQr(e){return e.startsWith("image/")||e.startsWith("video/")}function eJr(e){if(!e)return null;for(let t of e.items)if(t.kind==="file"&&JQr(t.type)){let r=t.getAsFile();if(r)return r}return null}function tJr(e){return e?Array.from(e.files).find(t=>JQr(t.type))??null:null}function nJr(e,t){return(0,rJr.useEffect)(()=>{if(!t)return;let o=i=>{let a=eJr(i.clipboardData);a&&(i.preventDefault(),e(a))};return globalThis.addEventListener("paste",o),()=>globalThis.removeEventListener("paste",o)},[e,t]),t?{onDrop:o=>{let i=tJr(o.dataTransfer);i&&(o.preventDefault(),e(i))},onDragOver:o=>{Array.from(o.dataTransfer.items).some(i=>i.kind==="file")&&o.preventDefault()}}:{onDrop:void 0,onDragOver:void 0}}function oJr(e,t,r){let[n,o]=(0,aY.useState)([]),i=(0,aY.useRef)(0),a=ur(),s=(0,aY.useCallback)(async d=>{let f=i.current++;o(p=>[...p.filter(h=>!h.error),{id:f}]);try{let p=await QQr(d,e,a);t({...p,url:URL.createObjectURL(d),contentType:d.type}),o(h=>h.filter(m=>m.id!==f))}catch(p){let h=p instanceof Error?p.message:"Failed to attach file";o(m=>m.map(g=>g.id===f?{id:f,error:h}:g))}},[e,a,t]),{onDrop:l,onDragOver:u}=nJr(s,r);return{uploads:n,onDrop:l,onDragOver:u}}function iJr({cwd:e,screenshots:t,screenshotScope:r,requestId:n,seededScreenshots:o}){let{screenshots:i,add:a,remove:s,update:l,clearPersisted:u}=ZQr(t?r:void 0,n,t?o:[]),{uploads:d,onDrop:f,onDragOver:p}=oJr(e,a,t);return{screenshots:i,removeScreenshot:s,updateScreenshot:l,decision:{attachments:()=>i.map(({path:h,alt:m,group:g})=>g?{path:h,alt:m,group:g}:{path:h,alt:m}),clearPersisted:u},uploads:d,onDrop:f,onDragOver:p}}var hJr=S(re(),1);var aJr="assist:pr-preview-chain:",Hgt=e=>`${aJr}${e}`;function sJr(e){if(e)return fl(Hgt(e))[0]}function lJr(e,t){e&&Dl(Hgt(e),[t])}function cJr(e){e&&Vv(Hgt(e))}function uJr(){jx(aJr)}function dJr(e,t,r){if(!e)return{reviewAfter:!1,announceAfter:!1,draft:!1,autoMerge:!1};uJr();let n=sJr(t);return{reviewAfter:n?.reviewAfter??r.reviewAfter,announceAfter:n?.announceAfter??!0,draft:n?.draft??r.draft,autoMerge:n?.autoMerge??!1}}function fJr(e,t,r,n,o){return{comments:t,screenshots:n,reviewAfter:e&&r.reviewAfter,announceAfter:e&&r.announceAfter,draft:r.draft,autoMerge:e&&r.autoMerge,...o===void 0?{}:{body:o}}}function pJr(e,t){return!e||t===!1?{}:t===!0?{autostart:!0}:{autostart:!0,startOn:t}}function mJr(e,t,r,n,o,i,a){let[s,l]=(0,hJr.useState)(()=>dJr(n,t,o));return{chain:s,setChain:f=>{l(f),lJr(t,f)},onDecide:(f,p,h=!1)=>{let m=f==="approve";r(f,{...fJr(m,p,s,m?i.attachments():[],a()),...pJr(m,h)}),hAe(e),m&&(cJr(t),i.clearPersisted())}}}var kJr=S(re(),1);var MYo=/^ {0,3}#{1,6}[ \t]+acceptance criteria[ \t]*$/i,NYo=/^ {0,3}#{1,6}[ \t]/;function W3(e){let t=e.split(`
|
|
4144
4144
|
`),r=t.findIndex(a=>MYo.test(a));if(r===-1)return null;let n=r+1;for(;n<t.length&&!NYo.test(t[n]);)n+=1;let o=r+1;for(;o<n&&t[o].trim()==="";)o+=1;let i=n;for(;i>o&&t[i-1].trim()==="";)i-=1;return o===n&&(o=r+1,i=r+1),{before:t.slice(0,o),lines:t.slice(o,i),after:t.slice(i)}}function yAe(e){let t=0;for(let r of e)t+=r===" "?4:1;return t}function vAe(e){let t=[];return e.map(r=>{for(;t.length>0&&r<t[t.length-1];)t.pop();return(t.length===0||r>t[t.length-1])&&t.push(r),t.length-1})}var OYo=" ";function BYo({text:e,depth:t}){let r=`${OYo.repeat(t)}1.`;return e===""?r:`${r} ${e}`}function bAe(e,t){let r=W3(e);return r?[...r.before,...t.map(BYo),...r.after].join(`
|
|
4145
4145
|
`):e}var $Yo=/^([ \t]*)(?:[-*+]|\d+[.)])(?:[ \t]+(.*))?$/,FYo=/^\[[ xX]\][ \t]*/;function zYo(e){return e.slice(0,e.length-e.trimStart().length)}function gJr(e){let t=W3(e);if(!t)return e;let r=t.lines.filter(o=>o.trim()!=="").map(o=>{let i=$Yo.exec(o);return{width:yAe(i?i[1]:zYo(o)),text:(i?i[2]??"":o.trim()).replace(FYo,"")}}),n=vAe(r.map(o=>o.width));return bAe(e,F3(r.map((o,i)=>({text:o.text,depth:n[i]}))))}var yJr=`## Acceptance criteria
|
|
4146
4146
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
comment
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-OWAUNGD6.js";
|
|
4
|
+
import "./chunk-PSSNCOG4.js";
|
|
5
5
|
import "./chunk-ZLRZR64W.js";
|
|
6
6
|
import "./chunk-SO3IBV6J.js";
|
|
7
7
|
import "./chunk-C3MGHR3N.js";
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-KU3BOP7V.js";
|
|
9
|
+
import "./chunk-HCDJLCN4.js";
|
|
10
10
|
import "./chunk-P7SERZI6.js";
|
|
11
11
|
import "./chunk-3VDV7VHX.js";
|
|
12
12
|
import "./chunk-ZFX4EZMW.js";
|
|
@@ -1,15 +1,24 @@
|
|
|
1
|
+
import {
|
|
2
|
+
appendScreenshots,
|
|
3
|
+
attachArgs,
|
|
4
|
+
parseScreenshotSpecs,
|
|
5
|
+
runGhWithAttachments
|
|
6
|
+
} from "./chunk-EPVBZE3T.js";
|
|
1
7
|
import {
|
|
2
8
|
reviewProposedIssueComment
|
|
3
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-BTLMJ735.js";
|
|
4
10
|
import {
|
|
5
11
|
validateProposedContent
|
|
6
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-JAZX2JSS.js";
|
|
7
13
|
import "./chunk-AVLELL42.js";
|
|
8
14
|
import "./chunk-C3MGHR3N.js";
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
15
|
+
import "./chunk-KU3BOP7V.js";
|
|
16
|
+
import "./chunk-HCDJLCN4.js";
|
|
11
17
|
import "./chunk-P7SERZI6.js";
|
|
12
18
|
import "./chunk-3VDV7VHX.js";
|
|
19
|
+
import "./chunk-B7B26YPF.js";
|
|
20
|
+
import "./chunk-O7L27TQP.js";
|
|
21
|
+
import "./chunk-P5LQVJWN.js";
|
|
13
22
|
import "./chunk-GIHVMELY.js";
|
|
14
23
|
import "./chunk-2EW62DM5.js";
|
|
15
24
|
import "./chunk-GNNMJOUE.js";
|
|
@@ -22,8 +31,7 @@ import "./chunk-Q6PZLPK4.js";
|
|
|
22
31
|
import "./chunk-JJKKIBF5.js";
|
|
23
32
|
|
|
24
33
|
// src/commands/github/issue/commentIssue.ts
|
|
25
|
-
|
|
26
|
-
var USAGE = "Usage: assist github issue comment <number> --body <body> [-R <owner>/<repo>]";
|
|
34
|
+
var USAGE = "Usage: assist github issue comment <number> --body <body> [-R <owner>/<repo>] [--screenshot '[Group/]Caption=path']";
|
|
27
35
|
async function commentIssue(numberArg, options) {
|
|
28
36
|
const number = Number.parseInt(numberArg, 10);
|
|
29
37
|
if (!Number.isInteger(number) || number <= 0 || !options.body) {
|
|
@@ -37,14 +45,24 @@ async function commentIssue(numberArg, options) {
|
|
|
37
45
|
"",
|
|
38
46
|
body
|
|
39
47
|
);
|
|
40
|
-
|
|
41
|
-
const
|
|
48
|
+
const screenshots = parseScreenshotSpecs(options.screenshot);
|
|
49
|
+
const decision = await reviewProposedIssueComment(
|
|
50
|
+
`Comment on ${target}`,
|
|
51
|
+
body,
|
|
52
|
+
screenshots
|
|
53
|
+
);
|
|
54
|
+
const attachments = decision ? decision.screenshots ?? [] : screenshots;
|
|
55
|
+
const args = [
|
|
56
|
+
"issue",
|
|
57
|
+
"comment",
|
|
58
|
+
String(number),
|
|
59
|
+
"--body",
|
|
60
|
+
appendScreenshots(body, attachments)
|
|
61
|
+
];
|
|
42
62
|
if (options.repo) args.push("--repo", options.repo);
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
process.exit(1);
|
|
47
|
-
}
|
|
63
|
+
args.push(...attachArgs(attachments));
|
|
64
|
+
const output = runGhWithAttachments(args, attachments).trim();
|
|
65
|
+
if (output) console.log(output);
|
|
48
66
|
console.log(`Comment posted to ${target}`);
|
|
49
67
|
}
|
|
50
68
|
export {
|
|
@@ -9,17 +9,17 @@ import {
|
|
|
9
9
|
fetchIssueNodeId,
|
|
10
10
|
resolveCreateIssueParent
|
|
11
11
|
} from "./chunk-TZ5PVDAR.js";
|
|
12
|
+
import "./chunk-WYVUP7Z3.js";
|
|
12
13
|
import {
|
|
13
14
|
appendScreenshots,
|
|
14
15
|
attachArgs,
|
|
15
16
|
parseScreenshotSpecs,
|
|
16
|
-
runGhWithAttachments
|
|
17
|
-
|
|
18
|
-
} from "./chunk-IEDFQBJI.js";
|
|
19
|
-
import "./chunk-WYVUP7Z3.js";
|
|
17
|
+
runGhWithAttachments
|
|
18
|
+
} from "./chunk-EPVBZE3T.js";
|
|
20
19
|
import {
|
|
20
|
+
stageScreenshots,
|
|
21
21
|
validateProposedContent
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-JAZX2JSS.js";
|
|
23
23
|
import {
|
|
24
24
|
resolveIssueRepoTarget
|
|
25
25
|
} from "./chunk-DPHNPX75.js";
|
|
@@ -30,15 +30,16 @@ import "./chunk-C3MGHR3N.js";
|
|
|
30
30
|
import "./chunk-FVZP4ULO.js";
|
|
31
31
|
import {
|
|
32
32
|
awaitPreviewApproval
|
|
33
|
-
} from "./chunk-
|
|
34
|
-
import "./chunk-
|
|
33
|
+
} from "./chunk-KU3BOP7V.js";
|
|
34
|
+
import "./chunk-HCDJLCN4.js";
|
|
35
35
|
import "./chunk-P7SERZI6.js";
|
|
36
36
|
import "./chunk-3VDV7VHX.js";
|
|
37
37
|
import "./chunk-B7B26YPF.js";
|
|
38
38
|
import {
|
|
39
39
|
fetchProjectV2
|
|
40
40
|
} from "./chunk-YQ3CNWB3.js";
|
|
41
|
-
import "./chunk-
|
|
41
|
+
import "./chunk-O7L27TQP.js";
|
|
42
|
+
import "./chunk-P5LQVJWN.js";
|
|
42
43
|
import {
|
|
43
44
|
assertProjectScope,
|
|
44
45
|
setProjectItemStatus
|
|
@@ -9,10 +9,10 @@ import {
|
|
|
9
9
|
import {
|
|
10
10
|
buildDoctorProbes,
|
|
11
11
|
diagnoseLink
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-ONP7DDB6.js";
|
|
13
13
|
import "./chunk-VABNWHSE.js";
|
|
14
14
|
import "./chunk-DS2YJZZY.js";
|
|
15
|
-
import "./chunk-
|
|
15
|
+
import "./chunk-42SUHCAB.js";
|
|
16
16
|
import {
|
|
17
17
|
loadLinkSpecs
|
|
18
18
|
} from "./chunk-J2PPCMCR.js";
|
|
@@ -30,7 +30,7 @@ import {
|
|
|
30
30
|
detectPlatform
|
|
31
31
|
} from "./chunk-E36L7ASL.js";
|
|
32
32
|
import "./chunk-GIHVMELY.js";
|
|
33
|
-
import "./chunk-
|
|
33
|
+
import "./chunk-XJKVJATG.js";
|
|
34
34
|
import "./chunk-5QM5VR3J.js";
|
|
35
35
|
import "./chunk-UFSOFNXQ.js";
|
|
36
36
|
import "./chunk-FLDRXYEM.js";
|
|
@@ -5,15 +5,16 @@ import {
|
|
|
5
5
|
import {
|
|
6
6
|
renderWhy,
|
|
7
7
|
validatePrContent
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-VHRROHRC.js";
|
|
9
9
|
import {
|
|
10
10
|
appendScreenshots,
|
|
11
11
|
attachArgs,
|
|
12
12
|
parseScreenshotSpecs,
|
|
13
|
-
runGhWithAttachments
|
|
13
|
+
runGhWithAttachments
|
|
14
|
+
} from "./chunk-EPVBZE3T.js";
|
|
15
|
+
import {
|
|
14
16
|
stageScreenshots
|
|
15
|
-
} from "./chunk-
|
|
16
|
-
import "./chunk-ABLDOQ4B.js";
|
|
17
|
+
} from "./chunk-JAZX2JSS.js";
|
|
17
18
|
import {
|
|
18
19
|
getCurrentPr
|
|
19
20
|
} from "./chunk-SO3IBV6J.js";
|
|
@@ -22,12 +23,13 @@ import "./chunk-C3MGHR3N.js";
|
|
|
22
23
|
import "./chunk-FVZP4ULO.js";
|
|
23
24
|
import {
|
|
24
25
|
awaitPreviewApproval
|
|
25
|
-
} from "./chunk-
|
|
26
|
-
import "./chunk-
|
|
26
|
+
} from "./chunk-KU3BOP7V.js";
|
|
27
|
+
import "./chunk-HCDJLCN4.js";
|
|
27
28
|
import "./chunk-P7SERZI6.js";
|
|
28
29
|
import "./chunk-3VDV7VHX.js";
|
|
29
30
|
import "./chunk-B7B26YPF.js";
|
|
30
|
-
import "./chunk-
|
|
31
|
+
import "./chunk-O7L27TQP.js";
|
|
32
|
+
import "./chunk-P5LQVJWN.js";
|
|
31
33
|
import "./chunk-HR7HIPYM.js";
|
|
32
34
|
import "./chunk-GIHVMELY.js";
|
|
33
35
|
import "./chunk-2EW62DM5.js";
|
|
@@ -3,18 +3,18 @@ import {
|
|
|
3
3
|
fetchIssueNodeId,
|
|
4
4
|
resolveCreateIssueParent
|
|
5
5
|
} from "./chunk-TZ5PVDAR.js";
|
|
6
|
+
import "./chunk-WYVUP7Z3.js";
|
|
6
7
|
import {
|
|
7
8
|
appendScreenshots,
|
|
8
9
|
attachArgs,
|
|
9
10
|
parseScreenshotSpecs,
|
|
10
11
|
renderScreenshotsSection,
|
|
11
|
-
runGhWithAttachments
|
|
12
|
-
|
|
13
|
-
} from "./chunk-IEDFQBJI.js";
|
|
14
|
-
import "./chunk-WYVUP7Z3.js";
|
|
12
|
+
runGhWithAttachments
|
|
13
|
+
} from "./chunk-EPVBZE3T.js";
|
|
15
14
|
import {
|
|
15
|
+
stageScreenshots,
|
|
16
16
|
validateProposedContent
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-JAZX2JSS.js";
|
|
18
18
|
import {
|
|
19
19
|
resolveIssueRepoTarget
|
|
20
20
|
} from "./chunk-DPHNPX75.js";
|
|
@@ -28,8 +28,8 @@ import {
|
|
|
28
28
|
import "./chunk-FVZP4ULO.js";
|
|
29
29
|
import {
|
|
30
30
|
awaitPreviewApproval
|
|
31
|
-
} from "./chunk-
|
|
32
|
-
import "./chunk-
|
|
31
|
+
} from "./chunk-KU3BOP7V.js";
|
|
32
|
+
import "./chunk-HCDJLCN4.js";
|
|
33
33
|
import "./chunk-P7SERZI6.js";
|
|
34
34
|
import {
|
|
35
35
|
readBodyArgument
|
|
@@ -37,7 +37,8 @@ import {
|
|
|
37
37
|
import "./chunk-QRTB7PVR.js";
|
|
38
38
|
import "./chunk-3VDV7VHX.js";
|
|
39
39
|
import "./chunk-B7B26YPF.js";
|
|
40
|
-
import "./chunk-
|
|
40
|
+
import "./chunk-O7L27TQP.js";
|
|
41
|
+
import "./chunk-P5LQVJWN.js";
|
|
41
42
|
import "./chunk-4BVUY25U.js";
|
|
42
43
|
import "./chunk-ZFX4EZMW.js";
|
|
43
44
|
import "./chunk-HR7HIPYM.js";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
reviewProposedIssueComment
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-BTLMJ735.js";
|
|
4
4
|
import {
|
|
5
5
|
validateProposedContent
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-JAZX2JSS.js";
|
|
7
7
|
import {
|
|
8
8
|
resolveIssueRepoTarget
|
|
9
9
|
} from "./chunk-DPHNPX75.js";
|
|
@@ -11,10 +11,11 @@ import "./chunk-SO3IBV6J.js";
|
|
|
11
11
|
import "./chunk-YIBSK5OC.js";
|
|
12
12
|
import "./chunk-AVLELL42.js";
|
|
13
13
|
import "./chunk-C3MGHR3N.js";
|
|
14
|
-
import "./chunk-
|
|
15
|
-
import "./chunk-
|
|
14
|
+
import "./chunk-KU3BOP7V.js";
|
|
15
|
+
import "./chunk-HCDJLCN4.js";
|
|
16
16
|
import "./chunk-P7SERZI6.js";
|
|
17
17
|
import "./chunk-3VDV7VHX.js";
|
|
18
|
+
import "./chunk-P5LQVJWN.js";
|
|
18
19
|
import "./chunk-HR7HIPYM.js";
|
|
19
20
|
import "./chunk-GIHVMELY.js";
|
|
20
21
|
import "./chunk-2EW62DM5.js";
|
|
@@ -29,6 +30,18 @@ import "./chunk-JJKKIBF5.js";
|
|
|
29
30
|
|
|
30
31
|
// src/commands/github/issue/editIssueComment.ts
|
|
31
32
|
import { execFileSync } from "child_process";
|
|
33
|
+
|
|
34
|
+
// src/commands/github/issue/commentUrl.ts
|
|
35
|
+
function commentUrl(raw) {
|
|
36
|
+
try {
|
|
37
|
+
const parsed = JSON.parse(raw);
|
|
38
|
+
return parsed.html_url;
|
|
39
|
+
} catch {
|
|
40
|
+
return void 0;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// src/commands/github/issue/editIssueComment.ts
|
|
32
45
|
var USAGE = "Usage: assist github issue edit-comment <comment-id> --body <body> [-R <owner>/<repo>]";
|
|
33
46
|
async function editIssueComment(commentIdArg, options) {
|
|
34
47
|
const commentId = Number.parseInt(commentIdArg, 10);
|
|
@@ -44,7 +57,13 @@ async function editIssueComment(commentIdArg, options) {
|
|
|
44
57
|
"",
|
|
45
58
|
body
|
|
46
59
|
);
|
|
47
|
-
await reviewProposedIssueComment(`Amend ${target}`, body);
|
|
60
|
+
const decision = await reviewProposedIssueComment(`Amend ${target}`, body);
|
|
61
|
+
if (decision?.screenshots?.length) {
|
|
62
|
+
console.error(
|
|
63
|
+
`Screenshots cannot be uploaded to an amended comment; ${target} was left unchanged. Post them in a new comment with assist github issue comment --screenshot instead.`
|
|
64
|
+
);
|
|
65
|
+
process.exit(1);
|
|
66
|
+
}
|
|
48
67
|
const args = [
|
|
49
68
|
"api",
|
|
50
69
|
"-X",
|
|
@@ -64,14 +83,6 @@ async function editIssueComment(commentIdArg, options) {
|
|
|
64
83
|
}
|
|
65
84
|
console.log(`Comment updated: ${commentUrl(raw) ?? target}`);
|
|
66
85
|
}
|
|
67
|
-
function commentUrl(raw) {
|
|
68
|
-
try {
|
|
69
|
-
const parsed = JSON.parse(raw);
|
|
70
|
-
return parsed.html_url;
|
|
71
|
-
} catch {
|
|
72
|
-
return void 0;
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
86
|
export {
|
|
76
87
|
editIssueComment
|
|
77
88
|
};
|