epiq 1.12.3 → 1.12.4

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/dist/gui/main.js CHANGED
@@ -1381,7 +1381,7 @@ Please change the parent <Route path="${S}"> to <Route path="${S==="/"?"*":`${S}
1381
1381
  ${a}px circle at ${f.x}px ${f.y}px,
1382
1382
  ${r},
1383
1383
  transparent 100%
1384
- )`,mask:"linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0)",WebkitMask:"linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0)",maskComposite:"exclude",WebkitMaskComposite:"xor",transition:"opacity 140ms ease"}}),(0,Ld.jsx)("div",{style:{position:"relative",height:"100%",display:"flex",flexDirection:"column",minHeight:0},children:(0,Ld.jsx)(IC.Provider,{value:C,children:t})})]})};var Bt=T(M(),1),fm={background:v.panel2,border:`1px solid ${v.line}`,borderRadius:6,padding:"2px 6px",color:v.primary},MH=({repoRoot:e,message:t,recentProjects:n=[],onRetry:i,onOpen:r})=>(0,Bt.jsx)("div",{"data-testid":"init-project-screen",style:{height:"100vh",background:v.bg,color:v.primary,fontFamily:Dl,display:"flex",alignItems:"center",justifyContent:"center",padding:30},children:(0,Bt.jsx)(Fl,{proximityReach:300,style:{width:520,background:v.panel},children:(0,Bt.jsxs)("div",{style:{padding:28,display:"flex",flexDirection:"column",gap:16},children:[(0,Bt.jsx)("div",{style:{color:v.accent,fontSize:10,letterSpacing:1,textTransform:"uppercase"},children:"Initialize project"}),(0,Bt.jsx)("h1",{style:{margin:0,fontSize:16,fontWeight:700},children:"This folder is not an epiq project yet"}),(0,Bt.jsxs)("div",{style:{fontSize:12,color:v.secondary,lineHeight:1.7},children:["No ",(0,Bt.jsx)("span",{style:fm,children:".epiq/project.json"})," was found in this directory or any of its parents:"]}),(0,Bt.jsx)("div",{style:{...fm,fontSize:12,padding:"10px 12px",wordBreak:"break-all"},children:e}),(0,Bt.jsxs)("div",{style:{fontSize:12,color:v.secondary,lineHeight:1.7},children:["To start tracking issues here, run ",(0,Bt.jsx)("span",{style:fm,children:"epiq"})," ","in that folder and type ",(0,Bt.jsx)("span",{style:fm,children:":init"}),". That creates, commits and pushes"," ",(0,Bt.jsx)("span",{style:fm,children:".epiq/project.json"}),". Then come back and reload."]}),n.length>0&&(0,Bt.jsxs)("div",{"data-testid":"recent-projects",style:{display:"flex",flexDirection:"column",gap:8},children:[(0,Bt.jsx)("div",{style:{color:v.accent,fontSize:10,letterSpacing:1,textTransform:"uppercase"},children:"Or open a recent project"}),n.map(o=>(0,Bt.jsxs)("div",{"data-testid":"recent-project",style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:12,fontSize:12},children:[(0,Bt.jsxs)("div",{style:{minWidth:0},children:[(0,Bt.jsx)("div",{style:{fontWeight:700},children:o.name}),(0,Bt.jsx)("div",{style:{color:v.dim,fontSize:10,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:o.root,children:o.root})]}),(0,Bt.jsx)(oe,{variant:"primary",onClick:()=>r(o.root),"data-testid":"open-recent-project",children:"open"})]},o.projectId))]}),(0,Bt.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:12,marginTop:4},children:[(0,Bt.jsx)("span",{style:{fontSize:10,color:v.dim},children:t}),(0,Bt.jsx)(oe,{variant:"primary",onClick:i,children:"check again"})]})]})})});var er=T(j(),1),DH=T(ws(),1);var ev=T(j(),1),tv=(e,t,n=[])=>{let i=(0,ev.useRef)(null);return(0,ev.useEffect)(()=>{if(!e)return;let r=a=>{let l=a.target;i.current?.contains(l)||n.some(u=>u.current?.contains(l))||t()},o=a=>{a.key==="Escape"&&t()};return document.addEventListener("mousedown",r),document.addEventListener("keydown",o),()=>{document.removeEventListener("mousedown",r),document.removeEventListener("keydown",o)}},[e,t]),i};var MC=T(M(),1),Ar=({size:e=16})=>(0,MC.jsx)("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,MC.jsx)("polyline",{points:"6 9 12 15 18 9"})});var Kr=T(M(),1),Pl=({label:e,color:t=v.dim,width:n,minWidth:i,disabled:r=!1,testId:o,title:a,popupRole:l="listbox",popupLabel:s,triggerStyle:u,chevronSize:c=12,leading:d,portal:f=!1,open:h,onOpenChange:m,children:y})=>{let[S,p]=(0,er.useState)(!1),g=(h??S)&&!r,b=O=>{h===void 0&&p(O),m?.(O)},x=()=>b(!1);(0,er.useEffect)(()=>{r&&(p(!1),h&&m?.(!1))},[r]);let C=(0,er.useId)(),w=(0,er.useRef)(null),E=(0,er.useRef)(null),L=tv(g,x,[w]),R=sq(f&&g,E),k=(0,Kr.jsx)("div",{ref:w,id:C,role:l,"aria-label":s,style:{...SC,minWidth:i??n??SC.minWidth,...f&&R?{position:"fixed",left:R.left,top:R.top,marginTop:0,fontFamily:Dl}:{}},children:y(x)});return(0,Kr.jsxs)("div",{ref:L,style:{position:"relative",flexShrink:0},children:[(0,Kr.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6},children:[d,(0,Kr.jsxs)("button",{ref:E,type:"button","data-testid":o,onClick:()=>b(!g),disabled:r,"aria-haspopup":l==="group"?"true":l,"aria-controls":g?C:void 0,"aria-expanded":g,title:a,style:{...Xb(t,r),...n?{width:n}:{},...u},children:[(0,Kr.jsx)("span",{style:mH,children:e}),(0,Kr.jsx)("span",{style:{display:"inline-flex",flexShrink:0},children:(0,Kr.jsx)(Ar,{size:c})})]})]}),g&&(f?R&&(0,DH.createPortal)(k,document.body):k)]})},sq=(e,t)=>{let[n,i]=(0,er.useState)(null);return(0,er.useLayoutEffect)(()=>{if(!e)return;let r=()=>{let o=t.current?.getBoundingClientRect();o&&i({left:o.left,top:o.bottom+6})};return r(),window.addEventListener("resize",r),window.addEventListener("scroll",r,!0),()=>{window.removeEventListener("resize",r),window.removeEventListener("scroll",r,!0)}},[e,t]),n},Ir=({children:e,selected:t=!1,onSelect:n,role:i,testId:r,title:o,style:a})=>{let[l,s]=(0,er.useState)(!1),u={display:"flex",alignItems:"center",justifyContent:"space-between",gap:10,width:"100%",boxSizing:"border-box",border:"none",borderRadius:6,padding:"6px 8px",background:t?v.line:l?pH:"transparent",color:t?v.accent:v.primary,fontFamily:"inherit",fontSize:11,textAlign:"left",...a},c={onMouseEnter:()=>s(!0),onMouseLeave:()=>s(!1)};return n?(0,Kr.jsx)("button",{type:"button",role:i,"aria-selected":i?t:void 0,"data-testid":r,title:o,onClick:n,style:{...u,cursor:"pointer"},...c,children:e}):(0,Kr.jsx)("div",{"data-testid":r,title:o,onClick:d=>{d.target===d.currentTarget&&d.currentTarget.querySelector("input, button")?.click()},style:{...u,cursor:"pointer"},...c,children:e})};var zl=T(M(),1),uq=200,_H=({value:e,items:t,placeholder:n="Select...",onSelect:i,testId:r})=>(0,zl.jsx)(Pl,{portal:!0,label:e?.label??n,title:e?.label,width:uq,testId:r,chevronSize:14,triggerStyle:{fontSize:12,padding:"5px 8px 5px 10px"},children:o=>t.map(a=>{let l=a.id===e?.id;return(0,zl.jsxs)(Ir,{role:"option",selected:l,testId:r?`${r}-option`:void 0,onSelect:()=>{o(),i(a.id)},style:{gap:12,padding:"8px 10px"},children:[(0,zl.jsx)("span",{children:a.label}),(0,zl.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:10},children:[a.hint?(0,zl.jsx)("span",{style:{color:v.dim},children:a.hint}):null,(0,zl.jsx)("span",{"aria-hidden":!l,style:{width:"1ch",textAlign:"right"},children:l?"\u2713":""})]})]},a.id)})});var Ad=T(j(),1),zH=T(ws(),1);var HH=T(j(),1);var fu=T(M(),1),cq=()=>typeof navigator<"u"&&/Mac|iPhone|iPad/.test(navigator.userAgent),OH=({children:e})=>(0,fu.jsx)("kbd",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:18,height:18,padding:"0 4px",boxSizing:"border-box",borderRadius:4,background:v.panel2,border:`1px solid ${v.line}`,color:v.secondary,font:"inherit",fontSize:W.label,lineHeight:1},children:e}),NH=({onOpen:e})=>{let[t,n]=(0,HH.useState)(!1);return(0,fu.jsxs)("button",{type:"button","data-testid":"command-palette-hint",onClick:e,onMouseEnter:()=>n(!0),onMouseLeave:()=>n(!1),title:"Open the command palette","aria-label":"Open the command palette",style:{display:"inline-flex",alignItems:"center",gap:7,background:t?v.hover:"transparent",border:"none",borderRadius:6,padding:"3px 6px",color:v.dim2,fontSize:W.label,fontFamily:"inherit",cursor:"pointer",whiteSpace:"nowrap"},children:[(0,fu.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:3},children:[(0,fu.jsx)(OH,{children:cq()?"\u2318":"Ctrl"}),(0,fu.jsx)(OH,{children:"K"})]}),"commands"]})};var FH=T(M(),1),nv=({user:e,index:t,isFocus:n})=>(0,FH.jsx)("span",{title:e.name,style:{width:18,height:18,borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",background:"transparent",color:e.color,border:`1px solid ${e.color}`,fontSize:11,fontWeight:700,marginLeft:t===0?0:4,flexShrink:0},children:e.name.at(0)?.toUpperCase()},e.id);var PH="1.12.3";var yt=T(M(),1),BH=({state:e,connection:t,onReconnect:n,scrubbing:i,syncStatus:r,onOpenCommands:o,board:a,identity:l})=>{let s=(0,Ad.useRef)(null),u=tv(l.open,l.onDismiss,[s]),[c,d]=(0,Ad.useState)(null);(0,Ad.useLayoutEffect)(()=>{if(!l.open)return;let m=()=>{let y=u.current?.getBoundingClientRect();y&&d({right:Math.max(8,window.innerWidth-y.right),top:y.bottom+8})};return m(),window.addEventListener("resize",m),window.addEventListener("scroll",m,!0),()=>{window.removeEventListener("resize",m),window.removeEventListener("scroll",m,!0)}},[l.open,u]);let f=r.status==="synced"?v.green:r.status==="failed"?v.red:r.status==="offline"?v.dim:v.accent,h=t!=="connected"?"Not connected":r.status==="failed"?`Sync failed \u2014 ${r.msg}`:r.msg;return(0,yt.jsx)(Fl,{as:"header",borderRadius:0,borderColor:v.line,glowOpacity:.08,style:{height:56,padding:"0 30px",borderLeft:"none",borderRight:"none",borderTop:"none"},children:(0,yt.jsxs)("div",{style:{height:"100%",width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between"},children:[(0,yt.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:14},children:[(0,yt.jsx)("div",{style:{color:v.accent,fontSize:12,fontWeight:700},children:":epiq"}),(0,yt.jsx)("span",{style:{color:v.dim,fontSize:12},children:"/"}),a,(0,yt.jsx)(NH,{onOpen:o})]}),(0,yt.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:24},children:[(0,yt.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:12,fontSize:11,whiteSpace:"nowrap"},children:[i&&(0,yt.jsxs)(yt.Fragment,{children:[(0,yt.jsx)("span",{style:{color:v.accent,fontWeight:700},children:"Read-only"}),(0,yt.jsx)("span",{style:{color:v.dim},children:"|"})]}),(0,yt.jsx)("span",{"data-testid":"sync-dot",title:h,style:{display:"inline-flex",alignItems:"center",justifyContent:"center",padding:"5px 7px"},children:(0,yt.jsx)("span",{style:{width:4,height:4,borderRadius:999,background:t==="connected"?f:v.dim}})}),(0,yt.jsx)("span",{style:{color:v.dim},children:"|"}),t==="connected"?(0,yt.jsx)("span",{style:{color:v.dim},children:"connected"}):t==="connecting"?(0,yt.jsx)("span",{style:{color:v.dim},children:"connecting\u2026"}):t==="reconnecting"?(0,yt.jsx)("span",{"data-testid":"reconnecting",style:{color:v.accent},children:"reconnecting\u2026"}):(0,yt.jsx)(oe,{"data-testid":"connection-lost",variant:"ghost",onClick:n,title:"Not connected \u2014 reconnect now",style:{color:v.red,fontSize:10},children:"reconnect"}),(0,yt.jsx)("span",{style:{color:v.dim},children:"|"}),(0,yt.jsx)("span",{style:{color:v.dim},children:"v"+PH})]}),e?.user&&(0,yt.jsxs)("div",{ref:u,style:{position:"relative"},children:[(0,yt.jsx)("button",{onClick:l.onToggle,"aria-label":"Your identity on this board",style:{background:"transparent",border:"none",cursor:"pointer",display:"flex",padding:0},children:(0,yt.jsx)(nv,{user:e.user})}),l.open&&c&&(0,zH.createPortal)((0,yt.jsx)("div",{ref:s,style:{position:"fixed",right:c.right,top:c.top,zIndex:60,maxHeight:`calc(100vh - ${c.top+16}px)`,display:"flex"},children:l.panel}),document.body)]})]})]})})};var wn=T(j(),1);var DC=T(j(),1);var dq="rgba(255, 135, 135, 0.14)",iv=({armed:e,hovered:t})=>({display:"flex",alignItems:"center",justifyContent:"space-between",gap:8,padding:"6px 8px",borderRadius:6,background:e?dq:t?v.line:"transparent",boxShadow:e?`inset 0 0 0 1px ${v.red}`:void 0});var Id=T(M(),1),rv=({size:e=13})=>(0,Id.jsxs)("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,Id.jsx)("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),(0,Id.jsx)("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"}),(0,Id.jsx)("circle",{cx:"12",cy:"16.5",r:"2.1",fill:"currentColor",stroke:"none"})]});var hu=T(M(),1),ov=({size:e=14})=>(0,hu.jsxs)("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,hu.jsx)("polyline",{points:"3 6 5 6 21 6"}),(0,hu.jsx)("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"}),(0,hu.jsx)("line",{x1:"10",y1:"11",x2:"10",y2:"17"}),(0,hu.jsx)("line",{x1:"14",y1:"11",x2:"14",y2:"17"})]});var Bn=T(M(),1),UH=({contributors:e,onRemove:t,onClose:n})=>{let[i,r]=(0,DC.useState)(null),[o,a]=(0,DC.useState)(null),l=[...e].sort((s,u)=>s.name.localeCompare(u.name));return(0,Bn.jsx)("div",{style:{position:"fixed",inset:0,background:"rgba(0, 0, 0, 0.25)",backdropFilter:"blur(.5px)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e3},onMouseDown:n,children:(0,Bn.jsxs)("div",{onMouseDown:s=>s.stopPropagation(),style:{marginTop:"-100px",width:460,background:v.panel,border:`1px solid ${v.line}`,borderRadius:12,padding:20,display:"flex",flexDirection:"column",gap:14},children:[(0,Bn.jsx)("div",{style:{color:v.secondary,fontSize:10,letterSpacing:1,textTransform:"uppercase"},children:"Manage external contributors"}),(0,Bn.jsx)("div",{style:{fontSize:12,color:v.secondary},children:"Remove contributors from the suggestion lists. Locked ones have contributed, so their name is in the immutable log either way."}),(0,Bn.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:2,maxHeight:260,overflowY:"auto"},children:l.map(s=>{let u=s.hasAuthoredAnywhere,c=i===s.id;return(0,Bn.jsxs)("div",{"data-testid":"manage-contributor-row","data-armed":c?"true":"false",onMouseEnter:()=>a(s.id),onMouseLeave:()=>a(d=>d===s.id?null:d),style:iv({armed:c,hovered:o===s.id}),children:[(0,Bn.jsxs)("span",{style:{fontSize:12,color:s.color,opacity:u?.5:1},children:["@",s.name]}),u?(0,Bn.jsx)("span",{title:"Has contributed \u2014 their name is in the immutable log either way",style:{display:"flex",color:v.dim,opacity:.7,padding:"3px 6px"},children:(0,Bn.jsx)(rv,{})}):s.isRemoved?(0,Bn.jsx)("span",{style:{color:v.dim,fontSize:10},children:"removed"}):(0,Bn.jsxs)(oe,{variant:"ghost",title:c?`Click again to remove @${s.name}`:`Remove @${s.name}`,onClick:()=>{if(!c)return r(s.id);t(s.id),r(null)},style:{display:"flex",alignItems:"center",gap:6,color:c?v.red:v.dim,...c?{border:`1px solid ${v.red}`}:{}},children:[c&&(0,Bn.jsx)("span",{style:{fontSize:10},children:"confirm"}),(0,Bn.jsx)(ov,{})]})]},s.id)})}),(0,Bn.jsx)("div",{style:{display:"flex",justifyContent:"flex-end"},children:(0,Bn.jsx)(oe,{variant:"ghost",onClick:n,children:"close"})})]})})};var _C=T(j(),1);var _i=T(M(),1),GH=({tags:e,onDelete:t,onClose:n})=>{let[i,r]=(0,_C.useState)(null),[o,a]=(0,_C.useState)(null),l=[...e].sort((s,u)=>s.name.localeCompare(u.name));return(0,_i.jsx)("div",{style:{position:"fixed",inset:0,background:"rgba(0, 0, 0, 0.25)",backdropFilter:"blur(.5px)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e3},onMouseDown:n,children:(0,_i.jsxs)("div",{onMouseDown:s=>s.stopPropagation(),style:{marginTop:"-100px",width:460,background:v.panel,border:`1px solid ${v.line}`,borderRadius:12,padding:20,display:"flex",flexDirection:"column",gap:14},children:[(0,_i.jsx)("div",{style:{color:v.secondary,fontSize:10,letterSpacing:1,textTransform:"uppercase"},children:"Manage tags"}),(0,_i.jsx)("div",{style:{fontSize:12,color:v.secondary},children:"Delete tags across the whole workspace. A deleted tag comes off every ticket at once; its history stays in the log."}),(0,_i.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:2,maxHeight:260,overflowY:"auto"},children:l.map(s=>{let u=i===s.id,c=o===s.id;return(0,_i.jsxs)("div",{"data-testid":"manage-tag-row","data-armed":u?"true":"false",onMouseEnter:()=>a(s.id),onMouseLeave:()=>a(d=>d===s.id?null:d),style:iv({armed:u,hovered:c}),children:[(0,_i.jsx)("span",{style:{fontSize:12,color:s.color},children:s.name}),(0,_i.jsxs)(oe,{variant:"ghost",testId:"delete-tag",title:u?`Click again to delete "${s.name}" everywhere`:`Delete "${s.name}"`,onClick:()=>{if(!u)return r(s.id);t(s.id),r(null)},style:{display:"flex",alignItems:"center",gap:6,color:u?v.red:v.dim,...u?{border:`1px solid ${v.red}`}:{}},children:[u&&(0,_i.jsx)("span",{style:{fontSize:10},children:"confirm"}),(0,_i.jsx)(ov,{})]})]},s.id)})}),(0,_i.jsx)("div",{style:{display:"flex",justifyContent:"flex-end"},children:(0,_i.jsx)(oe,{variant:"ghost",onClick:n,children:"close"})})]})})};var Md=T(j(),1);var $H=T(M(),1),fq=async e=>{try{return await navigator.clipboard.writeText(e),!0}catch{return!1}},Dd=({refValue:e})=>{let[t,n]=(0,Md.useState)(!1),i=(0,Md.useRef)(void 0);return(0,Md.useEffect)(()=>()=>clearTimeout(i.current),[]),(0,$H.jsx)("button",{type:"button","data-testid":"copy-ref",title:`Copy ${e}`,onClick:async r=>{r.stopPropagation(),await fq(e)&&(n(!0),clearTimeout(i.current),i.current=setTimeout(()=>n(!1),1200))},style:{fontFamily:"monospace",fontSize:"inherit",color:t?v.green:v.dim,background:"transparent",border:"none",padding:0,cursor:"pointer",transition:"color 120ms ease"},onMouseEnter:r=>{t||(r.currentTarget.style.color=v.accent)},onMouseLeave:r=>{r.currentTarget.style.color=t?v.green:v.dim},children:t?"copied!":e})};var tr=T(M(),1),VH=({size:e=14})=>(0,tr.jsx)("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinejoin:"round","aria-hidden":"true",children:(0,tr.jsx)("path",{d:"M8 5.5 19 12 8 18.5Z"})}),qH=({size:e=14})=>(0,tr.jsxs)("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true",children:[(0,tr.jsx)("line",{x1:"9",y1:"5.5",x2:"9",y2:"18.5"}),(0,tr.jsx)("line",{x1:"15",y1:"5.5",x2:"15",y2:"18.5"})]}),WH=({size:e=14})=>(0,tr.jsxs)("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,tr.jsx)("path",{d:"M20 12a8 8 0 1 1-2.6-5.9"}),(0,tr.jsx)("polyline",{points:"20 3 20 8 15 8"})]}),av=({size:e=14})=>(0,tr.jsxs)("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true",children:[(0,tr.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"}),(0,tr.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"})]});var OC=T(M(),1),lv=({size:e=14})=>(0,OC.jsx)("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,OC.jsx)("path",{d:"M4 6h16l-6 7v7l-4-2.5V13z"})});var HC=T(M(),1),jH=({narrowed:e,capped:t,disabled:n,onChange:i})=>(0,HC.jsx)(Te,{testId:"ticket-only",pressed:e,disabled:n,title:e&&t?"Too many events to single out \u2014 show all":e?"Show the whole timeline":"Narrow log and timeline to ticket",onClick:()=>i(!e),children:(0,HC.jsx)(lv,{size:ge})});var hm=T(M(),1),YH=({size:e=16})=>(0,hm.jsxs)("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,hm.jsx)("polyline",{points:"4 6 9 12 4 18"}),(0,hm.jsx)("polyline",{points:"20 6 15 12 20 18"})]});var mm=T(M(),1),KH=({size:e=16})=>(0,mm.jsxs)("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,mm.jsx)("polyline",{points:"9 6 4 12 9 18"}),(0,mm.jsx)("polyline",{points:"15 6 20 12 15 18"})]});var Lo=T(j(),1);var pm=T(M(),1),xt=({title:e,action:t,children:n,first:i=!1})=>(0,pm.jsxs)("section",{style:{padding:i?"0px 0 20px 0":"20px 0",borderTop:i?"none":`1px solid ${v.line}`},children:[(0,pm.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",gap:12},children:[(0,pm.jsx)("span",{style:{color:v.secondary,fontSize:W.label,textTransform:"uppercase",letterSpacing:"0.08em"},children:e}),t]}),n]});var hq="/media/",NC=e=>`${hq}${e}`;var mu=T(j(),1);var XH="image/png,image/jpeg,image/gif,image/webp",mq="rgba(118, 212, 255, 0.08)",_d=e=>e==null?[]:Array.from(e).filter(t=>t.type.startsWith("image/")),pq=(e,t,n)=>{let i=Math.max(0,Math.min(t,e.length)),r=e.slice(0,i),o=e.slice(i),a=r===""||r.endsWith(`
1384
+ )`,mask:"linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0)",WebkitMask:"linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0)",maskComposite:"exclude",WebkitMaskComposite:"xor",transition:"opacity 140ms ease"}}),(0,Ld.jsx)("div",{style:{position:"relative",height:"100%",display:"flex",flexDirection:"column",minHeight:0},children:(0,Ld.jsx)(IC.Provider,{value:C,children:t})})]})};var Bt=T(M(),1),fm={background:v.panel2,border:`1px solid ${v.line}`,borderRadius:6,padding:"2px 6px",color:v.primary},MH=({repoRoot:e,message:t,recentProjects:n=[],onRetry:i,onOpen:r})=>(0,Bt.jsx)("div",{"data-testid":"init-project-screen",style:{height:"100vh",background:v.bg,color:v.primary,fontFamily:Dl,display:"flex",alignItems:"center",justifyContent:"center",padding:30},children:(0,Bt.jsx)(Fl,{proximityReach:300,style:{width:520,background:v.panel},children:(0,Bt.jsxs)("div",{style:{padding:28,display:"flex",flexDirection:"column",gap:16},children:[(0,Bt.jsx)("div",{style:{color:v.accent,fontSize:10,letterSpacing:1,textTransform:"uppercase"},children:"Initialize project"}),(0,Bt.jsx)("h1",{style:{margin:0,fontSize:16,fontWeight:700},children:"This folder is not an epiq project yet"}),(0,Bt.jsxs)("div",{style:{fontSize:12,color:v.secondary,lineHeight:1.7},children:["No ",(0,Bt.jsx)("span",{style:fm,children:".epiq/project.json"})," was found in this directory or any of its parents:"]}),(0,Bt.jsx)("div",{style:{...fm,fontSize:12,padding:"10px 12px",wordBreak:"break-all"},children:e}),(0,Bt.jsxs)("div",{style:{fontSize:12,color:v.secondary,lineHeight:1.7},children:["To start tracking issues here, run ",(0,Bt.jsx)("span",{style:fm,children:"epiq"})," ","in that folder and type ",(0,Bt.jsx)("span",{style:fm,children:":init"}),". That creates, commits and pushes"," ",(0,Bt.jsx)("span",{style:fm,children:".epiq/project.json"}),". Then come back and reload."]}),n.length>0&&(0,Bt.jsxs)("div",{"data-testid":"recent-projects",style:{display:"flex",flexDirection:"column",gap:8},children:[(0,Bt.jsx)("div",{style:{color:v.accent,fontSize:10,letterSpacing:1,textTransform:"uppercase"},children:"Or open a recent project"}),n.map(o=>(0,Bt.jsxs)("div",{"data-testid":"recent-project",style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:12,fontSize:12},children:[(0,Bt.jsxs)("div",{style:{minWidth:0},children:[(0,Bt.jsx)("div",{style:{fontWeight:700},children:o.name}),(0,Bt.jsx)("div",{style:{color:v.dim,fontSize:10,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:o.root,children:o.root})]}),(0,Bt.jsx)(oe,{variant:"primary",onClick:()=>r(o.root),"data-testid":"open-recent-project",children:"open"})]},o.projectId))]}),(0,Bt.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:12,marginTop:4},children:[(0,Bt.jsx)("span",{style:{fontSize:10,color:v.dim},children:t}),(0,Bt.jsx)(oe,{variant:"primary",onClick:i,children:"check again"})]})]})})});var er=T(j(),1),DH=T(ws(),1);var ev=T(j(),1),tv=(e,t,n=[])=>{let i=(0,ev.useRef)(null);return(0,ev.useEffect)(()=>{if(!e)return;let r=a=>{let l=a.target;i.current?.contains(l)||n.some(u=>u.current?.contains(l))||t()},o=a=>{a.key==="Escape"&&t()};return document.addEventListener("mousedown",r),document.addEventListener("keydown",o),()=>{document.removeEventListener("mousedown",r),document.removeEventListener("keydown",o)}},[e,t]),i};var MC=T(M(),1),Ar=({size:e=16})=>(0,MC.jsx)("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,MC.jsx)("polyline",{points:"6 9 12 15 18 9"})});var Kr=T(M(),1),Pl=({label:e,color:t=v.dim,width:n,minWidth:i,disabled:r=!1,testId:o,title:a,popupRole:l="listbox",popupLabel:s,triggerStyle:u,chevronSize:c=12,leading:d,portal:f=!1,open:h,onOpenChange:m,children:y})=>{let[S,p]=(0,er.useState)(!1),g=(h??S)&&!r,b=O=>{h===void 0&&p(O),m?.(O)},x=()=>b(!1);(0,er.useEffect)(()=>{r&&(p(!1),h&&m?.(!1))},[r]);let C=(0,er.useId)(),w=(0,er.useRef)(null),E=(0,er.useRef)(null),L=tv(g,x,[w]),R=sq(f&&g,E),k=(0,Kr.jsx)("div",{ref:w,id:C,role:l,"aria-label":s,style:{...SC,minWidth:i??n??SC.minWidth,...f&&R?{position:"fixed",left:R.left,top:R.top,marginTop:0,fontFamily:Dl}:{}},children:y(x)});return(0,Kr.jsxs)("div",{ref:L,style:{position:"relative",flexShrink:0},children:[(0,Kr.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6},children:[d,(0,Kr.jsxs)("button",{ref:E,type:"button","data-testid":o,onClick:()=>b(!g),disabled:r,"aria-haspopup":l==="group"?"true":l,"aria-controls":g?C:void 0,"aria-expanded":g,title:a,style:{...Xb(t,r),...n?{width:n}:{},...u},children:[(0,Kr.jsx)("span",{style:mH,children:e}),(0,Kr.jsx)("span",{style:{display:"inline-flex",flexShrink:0},children:(0,Kr.jsx)(Ar,{size:c})})]})]}),g&&(f?R&&(0,DH.createPortal)(k,document.body):k)]})},sq=(e,t)=>{let[n,i]=(0,er.useState)(null);return(0,er.useLayoutEffect)(()=>{if(!e)return;let r=()=>{let o=t.current?.getBoundingClientRect();o&&i({left:o.left,top:o.bottom+6})};return r(),window.addEventListener("resize",r),window.addEventListener("scroll",r,!0),()=>{window.removeEventListener("resize",r),window.removeEventListener("scroll",r,!0)}},[e,t]),n},Ir=({children:e,selected:t=!1,onSelect:n,role:i,testId:r,title:o,style:a})=>{let[l,s]=(0,er.useState)(!1),u={display:"flex",alignItems:"center",justifyContent:"space-between",gap:10,width:"100%",boxSizing:"border-box",border:"none",borderRadius:6,padding:"6px 8px",background:t?v.line:l?pH:"transparent",color:t?v.accent:v.primary,fontFamily:"inherit",fontSize:11,textAlign:"left",...a},c={onMouseEnter:()=>s(!0),onMouseLeave:()=>s(!1)};return n?(0,Kr.jsx)("button",{type:"button",role:i,"aria-selected":i?t:void 0,"data-testid":r,title:o,onClick:n,style:{...u,cursor:"pointer"},...c,children:e}):(0,Kr.jsx)("div",{"data-testid":r,title:o,onClick:d=>{d.target===d.currentTarget&&d.currentTarget.querySelector("input, button")?.click()},style:{...u,cursor:"pointer"},...c,children:e})};var zl=T(M(),1),uq=200,_H=({value:e,items:t,placeholder:n="Select...",onSelect:i,testId:r})=>(0,zl.jsx)(Pl,{portal:!0,label:e?.label??n,title:e?.label,width:uq,testId:r,chevronSize:14,triggerStyle:{fontSize:12,padding:"5px 8px 5px 10px"},children:o=>t.map(a=>{let l=a.id===e?.id;return(0,zl.jsxs)(Ir,{role:"option",selected:l,testId:r?`${r}-option`:void 0,onSelect:()=>{o(),i(a.id)},style:{gap:12,padding:"8px 10px"},children:[(0,zl.jsx)("span",{children:a.label}),(0,zl.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:10},children:[a.hint?(0,zl.jsx)("span",{style:{color:v.dim},children:a.hint}):null,(0,zl.jsx)("span",{"aria-hidden":!l,style:{width:"1ch",textAlign:"right"},children:l?"\u2713":""})]})]},a.id)})});var Ad=T(j(),1),zH=T(ws(),1);var HH=T(j(),1);var fu=T(M(),1),cq=()=>typeof navigator<"u"&&/Mac|iPhone|iPad/.test(navigator.userAgent),OH=({children:e})=>(0,fu.jsx)("kbd",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:18,height:18,padding:"0 4px",boxSizing:"border-box",borderRadius:4,background:v.panel2,border:`1px solid ${v.line}`,color:v.secondary,font:"inherit",fontSize:W.label,lineHeight:1},children:e}),NH=({onOpen:e})=>{let[t,n]=(0,HH.useState)(!1);return(0,fu.jsxs)("button",{type:"button","data-testid":"command-palette-hint",onClick:e,onMouseEnter:()=>n(!0),onMouseLeave:()=>n(!1),title:"Open the command palette","aria-label":"Open the command palette",style:{display:"inline-flex",alignItems:"center",gap:7,background:t?v.hover:"transparent",border:"none",borderRadius:6,padding:"3px 6px",color:v.dim2,fontSize:W.label,fontFamily:"inherit",cursor:"pointer",whiteSpace:"nowrap"},children:[(0,fu.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:3},children:[(0,fu.jsx)(OH,{children:cq()?"\u2318":"Ctrl"}),(0,fu.jsx)(OH,{children:"K"})]}),"commands"]})};var FH=T(M(),1),nv=({user:e,index:t,isFocus:n})=>(0,FH.jsx)("span",{title:e.name,style:{width:18,height:18,borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",background:"transparent",color:e.color,border:`1px solid ${e.color}`,fontSize:11,fontWeight:700,marginLeft:t===0?0:4,flexShrink:0},children:e.name.at(0)?.toUpperCase()},e.id);var PH="1.12.4";var yt=T(M(),1),BH=({state:e,connection:t,onReconnect:n,scrubbing:i,syncStatus:r,onOpenCommands:o,board:a,identity:l})=>{let s=(0,Ad.useRef)(null),u=tv(l.open,l.onDismiss,[s]),[c,d]=(0,Ad.useState)(null);(0,Ad.useLayoutEffect)(()=>{if(!l.open)return;let m=()=>{let y=u.current?.getBoundingClientRect();y&&d({right:Math.max(8,window.innerWidth-y.right),top:y.bottom+8})};return m(),window.addEventListener("resize",m),window.addEventListener("scroll",m,!0),()=>{window.removeEventListener("resize",m),window.removeEventListener("scroll",m,!0)}},[l.open,u]);let f=r.status==="synced"?v.green:r.status==="failed"?v.red:r.status==="offline"?v.dim:v.accent,h=t!=="connected"?"Not connected":r.status==="failed"?`Sync failed \u2014 ${r.msg}`:r.msg;return(0,yt.jsx)(Fl,{as:"header",borderRadius:0,borderColor:v.line,glowOpacity:.08,style:{height:56,padding:"0 30px",borderLeft:"none",borderRight:"none",borderTop:"none"},children:(0,yt.jsxs)("div",{style:{height:"100%",width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between"},children:[(0,yt.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:14},children:[(0,yt.jsx)("div",{style:{color:v.accent,fontSize:12,fontWeight:700},children:":epiq"}),(0,yt.jsx)("span",{style:{color:v.dim,fontSize:12},children:"/"}),a,(0,yt.jsx)(NH,{onOpen:o})]}),(0,yt.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:24},children:[(0,yt.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:12,fontSize:11,whiteSpace:"nowrap"},children:[i&&(0,yt.jsxs)(yt.Fragment,{children:[(0,yt.jsx)("span",{style:{color:v.accent,fontWeight:700},children:"Read-only"}),(0,yt.jsx)("span",{style:{color:v.dim},children:"|"})]}),(0,yt.jsx)("span",{"data-testid":"sync-dot",title:h,style:{display:"inline-flex",alignItems:"center",justifyContent:"center",padding:"5px 7px"},children:(0,yt.jsx)("span",{style:{width:4,height:4,borderRadius:999,background:t==="connected"?f:v.dim}})}),(0,yt.jsx)("span",{style:{color:v.dim},children:"|"}),t==="connected"?(0,yt.jsx)("span",{style:{color:v.dim},children:"connected"}):t==="connecting"?(0,yt.jsx)("span",{style:{color:v.dim},children:"connecting\u2026"}):t==="reconnecting"?(0,yt.jsx)("span",{"data-testid":"reconnecting",style:{color:v.accent},children:"reconnecting\u2026"}):(0,yt.jsx)(oe,{"data-testid":"connection-lost",variant:"ghost",onClick:n,title:"Not connected \u2014 reconnect now",style:{color:v.red,fontSize:10},children:"reconnect"}),(0,yt.jsx)("span",{style:{color:v.dim},children:"|"}),(0,yt.jsx)("span",{style:{color:v.dim},children:"v"+PH})]}),e?.user&&(0,yt.jsxs)("div",{ref:u,style:{position:"relative"},children:[(0,yt.jsx)("button",{onClick:l.onToggle,"aria-label":"Your identity on this board",style:{background:"transparent",border:"none",cursor:"pointer",display:"flex",padding:0},children:(0,yt.jsx)(nv,{user:e.user})}),l.open&&c&&(0,zH.createPortal)((0,yt.jsx)("div",{ref:s,style:{position:"fixed",right:c.right,top:c.top,zIndex:60,maxHeight:`calc(100vh - ${c.top+16}px)`,display:"flex"},children:l.panel}),document.body)]})]})]})})};var wn=T(j(),1);var DC=T(j(),1);var dq="rgba(255, 135, 135, 0.14)",iv=({armed:e,hovered:t})=>({display:"flex",alignItems:"center",justifyContent:"space-between",gap:8,padding:"6px 8px",borderRadius:6,background:e?dq:t?v.line:"transparent",boxShadow:e?`inset 0 0 0 1px ${v.red}`:void 0});var Id=T(M(),1),rv=({size:e=13})=>(0,Id.jsxs)("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,Id.jsx)("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),(0,Id.jsx)("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"}),(0,Id.jsx)("circle",{cx:"12",cy:"16.5",r:"2.1",fill:"currentColor",stroke:"none"})]});var hu=T(M(),1),ov=({size:e=14})=>(0,hu.jsxs)("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,hu.jsx)("polyline",{points:"3 6 5 6 21 6"}),(0,hu.jsx)("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"}),(0,hu.jsx)("line",{x1:"10",y1:"11",x2:"10",y2:"17"}),(0,hu.jsx)("line",{x1:"14",y1:"11",x2:"14",y2:"17"})]});var Bn=T(M(),1),UH=({contributors:e,onRemove:t,onClose:n})=>{let[i,r]=(0,DC.useState)(null),[o,a]=(0,DC.useState)(null),l=[...e].sort((s,u)=>s.name.localeCompare(u.name));return(0,Bn.jsx)("div",{style:{position:"fixed",inset:0,background:"rgba(0, 0, 0, 0.25)",backdropFilter:"blur(.5px)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e3},onMouseDown:n,children:(0,Bn.jsxs)("div",{onMouseDown:s=>s.stopPropagation(),style:{marginTop:"-100px",width:460,background:v.panel,border:`1px solid ${v.line}`,borderRadius:12,padding:20,display:"flex",flexDirection:"column",gap:14},children:[(0,Bn.jsx)("div",{style:{color:v.secondary,fontSize:10,letterSpacing:1,textTransform:"uppercase"},children:"Manage external contributors"}),(0,Bn.jsx)("div",{style:{fontSize:12,color:v.secondary},children:"Remove contributors from the suggestion lists. Locked ones have contributed, so their name is in the immutable log either way."}),(0,Bn.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:2,maxHeight:260,overflowY:"auto"},children:l.map(s=>{let u=s.hasAuthoredAnywhere,c=i===s.id;return(0,Bn.jsxs)("div",{"data-testid":"manage-contributor-row","data-armed":c?"true":"false",onMouseEnter:()=>a(s.id),onMouseLeave:()=>a(d=>d===s.id?null:d),style:iv({armed:c,hovered:o===s.id}),children:[(0,Bn.jsxs)("span",{style:{fontSize:12,color:s.color,opacity:u?.5:1},children:["@",s.name]}),u?(0,Bn.jsx)("span",{title:"Has contributed \u2014 their name is in the immutable log either way",style:{display:"flex",color:v.dim,opacity:.7,padding:"3px 6px"},children:(0,Bn.jsx)(rv,{})}):s.isRemoved?(0,Bn.jsx)("span",{style:{color:v.dim,fontSize:10},children:"removed"}):(0,Bn.jsxs)(oe,{variant:"ghost",title:c?`Click again to remove @${s.name}`:`Remove @${s.name}`,onClick:()=>{if(!c)return r(s.id);t(s.id),r(null)},style:{display:"flex",alignItems:"center",gap:6,color:c?v.red:v.dim,...c?{border:`1px solid ${v.red}`}:{}},children:[c&&(0,Bn.jsx)("span",{style:{fontSize:10},children:"confirm"}),(0,Bn.jsx)(ov,{})]})]},s.id)})}),(0,Bn.jsx)("div",{style:{display:"flex",justifyContent:"flex-end"},children:(0,Bn.jsx)(oe,{variant:"ghost",onClick:n,children:"close"})})]})})};var _C=T(j(),1);var _i=T(M(),1),GH=({tags:e,onDelete:t,onClose:n})=>{let[i,r]=(0,_C.useState)(null),[o,a]=(0,_C.useState)(null),l=[...e].sort((s,u)=>s.name.localeCompare(u.name));return(0,_i.jsx)("div",{style:{position:"fixed",inset:0,background:"rgba(0, 0, 0, 0.25)",backdropFilter:"blur(.5px)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e3},onMouseDown:n,children:(0,_i.jsxs)("div",{onMouseDown:s=>s.stopPropagation(),style:{marginTop:"-100px",width:460,background:v.panel,border:`1px solid ${v.line}`,borderRadius:12,padding:20,display:"flex",flexDirection:"column",gap:14},children:[(0,_i.jsx)("div",{style:{color:v.secondary,fontSize:10,letterSpacing:1,textTransform:"uppercase"},children:"Manage tags"}),(0,_i.jsx)("div",{style:{fontSize:12,color:v.secondary},children:"Delete tags across the whole workspace. A deleted tag comes off every ticket at once; its history stays in the log."}),(0,_i.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:2,maxHeight:260,overflowY:"auto"},children:l.map(s=>{let u=i===s.id,c=o===s.id;return(0,_i.jsxs)("div",{"data-testid":"manage-tag-row","data-armed":u?"true":"false",onMouseEnter:()=>a(s.id),onMouseLeave:()=>a(d=>d===s.id?null:d),style:iv({armed:u,hovered:c}),children:[(0,_i.jsx)("span",{style:{fontSize:12,color:s.color},children:s.name}),(0,_i.jsxs)(oe,{variant:"ghost",testId:"delete-tag",title:u?`Click again to delete "${s.name}" everywhere`:`Delete "${s.name}"`,onClick:()=>{if(!u)return r(s.id);t(s.id),r(null)},style:{display:"flex",alignItems:"center",gap:6,color:u?v.red:v.dim,...u?{border:`1px solid ${v.red}`}:{}},children:[u&&(0,_i.jsx)("span",{style:{fontSize:10},children:"confirm"}),(0,_i.jsx)(ov,{})]})]},s.id)})}),(0,_i.jsx)("div",{style:{display:"flex",justifyContent:"flex-end"},children:(0,_i.jsx)(oe,{variant:"ghost",onClick:n,children:"close"})})]})})};var Md=T(j(),1);var $H=T(M(),1),fq=async e=>{try{return await navigator.clipboard.writeText(e),!0}catch{return!1}},Dd=({refValue:e})=>{let[t,n]=(0,Md.useState)(!1),i=(0,Md.useRef)(void 0);return(0,Md.useEffect)(()=>()=>clearTimeout(i.current),[]),(0,$H.jsx)("button",{type:"button","data-testid":"copy-ref",title:`Copy ${e}`,onClick:async r=>{r.stopPropagation(),await fq(e)&&(n(!0),clearTimeout(i.current),i.current=setTimeout(()=>n(!1),1200))},style:{fontFamily:"monospace",fontSize:"inherit",color:t?v.green:v.dim,background:"transparent",border:"none",padding:0,cursor:"pointer",transition:"color 120ms ease"},onMouseEnter:r=>{t||(r.currentTarget.style.color=v.accent)},onMouseLeave:r=>{r.currentTarget.style.color=t?v.green:v.dim},children:t?"copied!":e})};var tr=T(M(),1),VH=({size:e=14})=>(0,tr.jsx)("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinejoin:"round","aria-hidden":"true",children:(0,tr.jsx)("path",{d:"M8 5.5 19 12 8 18.5Z"})}),qH=({size:e=14})=>(0,tr.jsxs)("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true",children:[(0,tr.jsx)("line",{x1:"9",y1:"5.5",x2:"9",y2:"18.5"}),(0,tr.jsx)("line",{x1:"15",y1:"5.5",x2:"15",y2:"18.5"})]}),WH=({size:e=14})=>(0,tr.jsxs)("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,tr.jsx)("path",{d:"M20 12a8 8 0 1 1-2.6-5.9"}),(0,tr.jsx)("polyline",{points:"20 3 20 8 15 8"})]}),av=({size:e=14})=>(0,tr.jsxs)("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true",children:[(0,tr.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"}),(0,tr.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"})]});var OC=T(M(),1),lv=({size:e=14})=>(0,OC.jsx)("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,OC.jsx)("path",{d:"M4 6h16l-6 7v7l-4-2.5V13z"})});var HC=T(M(),1),jH=({narrowed:e,capped:t,disabled:n,onChange:i})=>(0,HC.jsx)(Te,{testId:"ticket-only",pressed:e,disabled:n,title:e&&t?"Too many events to single out \u2014 show all":e?"Show the whole timeline":"Narrow log and timeline to ticket",onClick:()=>i(!e),children:(0,HC.jsx)(lv,{size:ge})});var hm=T(M(),1),YH=({size:e=16})=>(0,hm.jsxs)("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,hm.jsx)("polyline",{points:"4 6 9 12 4 18"}),(0,hm.jsx)("polyline",{points:"20 6 15 12 20 18"})]});var mm=T(M(),1),KH=({size:e=16})=>(0,mm.jsxs)("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,mm.jsx)("polyline",{points:"9 6 4 12 9 18"}),(0,mm.jsx)("polyline",{points:"15 6 20 12 15 18"})]});var Lo=T(j(),1);var pm=T(M(),1),xt=({title:e,action:t,children:n,first:i=!1})=>(0,pm.jsxs)("section",{style:{padding:i?"0px 0 20px 0":"20px 0",borderTop:i?"none":`1px solid ${v.line}`},children:[(0,pm.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",gap:12},children:[(0,pm.jsx)("span",{style:{color:v.secondary,fontSize:W.label,textTransform:"uppercase",letterSpacing:"0.08em"},children:e}),t]}),n]});var hq="/media/",NC=e=>`${hq}${e}`;var mu=T(j(),1);var XH="image/png,image/jpeg,image/gif,image/webp",mq="rgba(118, 212, 255, 0.08)",_d=e=>e==null?[]:Array.from(e).filter(t=>t.type.startsWith("image/")),pq=(e,t,n)=>{let i=Math.max(0,Math.min(t,e.length)),r=e.slice(0,i),o=e.slice(i),a=r===""||r.endsWith(`
1385
1385
  `)?"":`
1386
1386
  `,l=o===""||o.startsWith(`
1387
1387
  `)?"":`
@@ -1794,7 +1794,7 @@ ${JK()} {
1794
1794
  ::-webkit-scrollbar-corner {
1795
1795
  background: transparent;
1796
1796
  }
1797
- `});var Or=T(j(),1),$B=T(ws(),1);var qB=T(M(),1),L0="epiqTip",GB=e=>{if(!(e instanceof Element))return null;let t=e.closest("[title], [data-epiq-tip]"),n=e.closest(`[${qd}]`);return n&&(!t||t.contains(n))?null:t instanceof HTMLElement?t:null},VB=()=>{let e=(0,Or.useRef)(null),t=(0,Or.useRef)(null),n=(0,Or.useRef)(null),i=(0,Or.useRef)(null),[r,o]=(0,Or.useState)(null),[a,l]=(0,Or.useState)(null);return(0,Or.useEffect)(()=>{let s=()=>{t.current!==null&&clearTimeout(t.current),t.current=null},u=()=>{let S=n.current;if(!S)return;let p=S.dataset[L0];p!==void 0&&(S.setAttribute("title",p),delete S.dataset[L0]),n.current=null},c=()=>{s(),u(),i.current=null,o(null)},d=(S,p)=>{S.dataset[L0]=p,S.removeAttribute("title"),n.current=S},f=(S,p)=>{s(),i.current=S,t.current=setTimeout(()=>{d(S,p),o({label:p,trigger:S})},500)},h=S=>{let p=GB(S.target);if(!p)return c();if(p===n.current)return;let g=p.getAttribute("title")??p.dataset[L0];c(),g&&f(p,g)},m=S=>{let p=GB(S.target),g=p?.getAttribute("title");c(),p&&g&&(i.current=p,o({label:g,trigger:p}))},y=Wv(c,()=>i.current);return document.addEventListener("mouseover",h),document.addEventListener("focusin",m),document.addEventListener("focusout",c),()=>{c(),y(),document.removeEventListener("mouseover",h),document.removeEventListener("focusin",m),document.removeEventListener("focusout",c)}},[]),(0,Or.useEffect)(()=>{if(!r)return l(null);let s=e.current;s&&l(qv(r.trigger.getBoundingClientRect(),s.getBoundingClientRect()))},[r]),(0,Or.useEffect)(()=>{if(!r)return;let s=setInterval(()=>{r.trigger.isConnected||o(null)},250);return()=>clearInterval(s)},[r]),r?(0,$B.createPortal)((0,qB.jsx)("div",{ref:e,role:"tooltip","data-testid":"tooltip",style:{position:"fixed",left:a?.left??0,top:a?.top??0,opacity:a?1:0,transition:"opacity 80ms ease-out",zIndex:1e3,pointerEvents:"none",maxWidth:320,padding:"5px 8px",borderRadius:4,background:"#000",border:`1px solid ${v.line}`,boxShadow:"0 4px 14px rgba(0, 0, 0, 0.55)",color:v.primary,fontFamily:Ot,fontSize:W.meta,lineHeight:1.4,whiteSpace:"pre-wrap"},children:r.label}),document.body):null};var op=T(M(),1),VT=({message:e,onDismiss:t})=>(0,op.jsxs)("div",{style:{position:"fixed",bottom:20,right:20,zIndex:1e3,maxWidth:360,display:"flex",alignItems:"flex-start",gap:8,fontSize:12,color:v.primary,background:v.panel,border:`1px solid ${v.red}`,borderRadius:8,padding:"10px 12px",boxShadow:"0 4px 16px rgba(0, 0, 0, 0.4)"},children:[(0,op.jsx)("span",{style:{flex:1,minWidth:0,overflowWrap:"anywhere"},children:e}),(0,op.jsx)("button",{onClick:t,style:{background:"transparent",border:"none",color:v.dim,cursor:"pointer",fontSize:14,lineHeight:1,padding:0},children:"\xD7"})]});var se=T(j(),1);var $n={scope:"all",offset:0,zoom:null,layout:"even",only:{},windowOnly:!1,ticketOnly:!1},AX=["scope","offset","from","to","layout","view","only","window","ticket"],WB="epiq.board.selection",IX=e=>[...new Set(e)],qT=e=>Gn.some(t=>e[t]!==void 0),rs=(e,t)=>t===null?void 0:e[t],of=(e,t,n)=>{let i={...e},r=n===void 0?[]:pi(n);return n===void 0||r!==null&&r.length===0?delete i[t]:i[t]=n,i},jB=(e,t)=>{let n=e[t];return n===void 0?"off":pi(n)===null?"all":"some"},YB=(e,t,n)=>of(e,t,n?"all":void 0),MX=e=>{let t={};for(let n of Gn){let i=e[n];if(i===void 0)continue;let r=pi(i);r===null?t[n]="all":r.length>0&&(t[n]=IX(r))}return t},DX=e=>e!==null&&Number.isFinite(e.start)&&Number.isFinite(e.end)&&e.end>e.start?e:null,A0=e=>{let t=DX(e.zoom);return{...e,zoom:t,offset:t!==null||e.scope==="all"||!Number.isInteger(e.offset)||e.offset<0?0:e.offset,windowOnly:e.ticketOnly?!1:e.windowOnly,only:MX(e.only)}},KB=e=>e.scope===$n.scope&&e.offset===$n.offset&&e.zoom===null&&e.layout===$n.layout&&!qT(e.only)&&e.windowOnly===$n.windowOnly&&e.ticketOnly===$n.ticketOnly,XB=(e,t)=>{let n=t.scope!==void 0&&t.scope!==e.scope,i=t.zoom!==void 0?t.zoom:t.scope!==void 0?null:e.zoom,r=t.ticketOnly!==void 0?t.ticketOnly:t.scope!==void 0||t.zoom!==void 0?!1:e.ticketOnly;return A0({...e,...t,zoom:i,ticketOnly:r,offset:n?0:t.offset??e.offset})},WT=e=>({offset:e.offset,zoom:e.zoom,windowOnly:e.windowOnly,ticketOnly:e.ticketOnly}),QB={query:"",values:WT($n)},ZB=(e,t,n)=>e.query===t?e:{query:t,values:WT(n)},JB=(e,t)=>({query:e.query,values:WT(t)}),jT=e=>AX.some(t=>e.has(t)),e8=";",t8=":",n8="*",_X=e=>{let t=Gn.flatMap(n=>{let i=e[n];if(i===void 0)return[];let r=pi(i);return[`${n}${t8}${r===null?n8:r.join(",")}`]});return t.length===0?null:t.join(e8)},OX=(e,t)=>{if(e===null)return{};let n={};for(let i of e.split(e8)){if(i==="")continue;let r=i.indexOf(t8),o=r===-1?_r(t):i.slice(0,r);if(o===null||!qm(o))continue;let a=r===-1?i:i.slice(r+1);n[o]=a===n8?"all":a.split(",").filter(Boolean)}return n},i8=e=>{if(!jT(e))return null;let t=e.get("scope"),n=e.get("layout"),i=e.get("from"),r=e.get("to"),o=e.get("view"),a=c0(o)?o:"all";return A0({scope:h0(t)?t:$n.scope,offset:Number(e.get("offset")??0),zoom:i===null||r===null?null:{start:Number(i),end:Number(r)},layout:t0(n)?n:$n.layout,only:OX(e.get("only"),a),windowOnly:e.get("window")==="1",ticketOnly:e.get("ticket")==="1"})},YT=(e,t)=>{let n=(r,o)=>{o===null?e.delete(r):e.set(r,o)},i=A0(t);n("scope",i.scope===$n.scope?null:i.scope),n("offset",i.offset===0?null:String(i.offset)),n("from",i.zoom===null?null:String(i.zoom.start)),n("to",i.zoom===null?null:String(i.zoom.end)),n("layout",i.layout===$n.layout?null:i.layout),n("view",null),n("only",_X(i.only)),n("window",i.windowOnly?"1":null),n("ticket",i.ticketOnly?"1":null)},HX=(e,t)=>{if(Array.isArray(e)){let r=_r(t);return r===null?{}:{[r]:e.map(String)}}if(typeof e!="object"||e===null)return{};let n=e,i={};for(let r of Gn){let o=n[r];o==="all"?i[r]="all":Array.isArray(o)&&(i[r]=o.map(String))}return i},r8=()=>{try{let e=localStorage.getItem(WB);if(!e)return $n;let t=JSON.parse(e);if(typeof t!="object"||t===null)return $n;let{scope:n,layout:i,view:r,only:o}=t,a=c0(r)?r:"all";return A0({scope:h0(String(n))?n:$n.scope,offset:0,zoom:null,layout:t0(String(i))?i:$n.layout,only:HX(o,a),windowOnly:$n.windowOnly,ticketOnly:$n.ticketOnly})}catch{return $n}},KT=e=>{try{let{scope:t,layout:n,only:i}=e;localStorage.setItem(WB,JSON.stringify({scope:t,layout:n,only:i}))}catch{}},I0=(e,t)=>{let n=e.map(o=>o.id);if(t===void 0)return new Set(n);let i=pi(t);if(i===null)return new Set;let r=new Set(i);return new Set(n.filter(o=>!r.has(o)))},o8=(e,t,n,i)=>{let r=t.map(l=>l.id),o=pi(e),a=new Set(e===void 0?[]:o===null?r:o);if(i?a.add(n):a.delete(n),a.size!==0)return r.every(l=>a.has(l))?"all":[...a]},M0=(e,t)=>e!==null&&e.length===1&&e[0]===t?null:[t],a8=(e,t,n)=>{if(t===null)return[...e];let i=new Set(e.map(o=>o.id)),r=t.filter(o=>!i.has(o)).map(o=>n.find(a=>a.id===o)).filter(o=>!!o);return r.length===0?[...e]:[...e,...r]};var D0=(e,t)=>{let n=(e.trim().split(/\s+/)[0]??"").toUpperCase();return n&&t.has(n)?n:null};var XT=(e,t)=>new Map(e.flatMap(n=>n.swimlanes.flatMap(i=>i.issues.filter(r=>t===null||n.id===t||r.boardIds.includes(t)).map(r=>[r.ref,r.id])))),_0=({everyBoard:e,thisBoard:t,ticketFocus:n,everyBoardPlotted:i=!1})=>n||i?e:t,O0=(e,t,n,i,r)=>{if(!t&&!n)return e;let o=new Set(i.keys());return e.filter(a=>{let l=D0(a.subject,o);if(l===null)return!1;let s=i.get(l);return s!==void 0&&(r===null||r.has(s))})};var QT=T(M(),1),l8=({size:e=16})=>(0,QT.jsx)("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,QT.jsx)("polyline",{points:"15 18 9 12 15 6"})});var ii=T(j(),1);var Fa=T(j(),1),H0=({canvasRef:e,sizeRef:t,paint:n,onSettled:i})=>{let r=(0,Fa.useRef)(null),o=(0,Fa.useRef)(i);o.current=i;let a=(0,Fa.useCallback)(()=>{if(r.current!==null)return;let s=()=>{r.current=null,n(performance.now())?r.current=requestAnimationFrame(s):o.current()};r.current=requestAnimationFrame(s)},[n]);(0,Fa.useEffect)(()=>{let s=e.current,u=s?.parentElement;if(!s||!u)return;let c=()=>{let f=window.devicePixelRatio||1,{width:h,height:m}=u.getBoundingClientRect();t.current={width:h,height:m},s.width=Math.round(h*f),s.height=Math.round(m*f),s.style.width=`${h}px`,s.style.height=`${m}px`,s.getContext("2d")?.setTransform(f,0,0,f,0,0),n(performance.now())};c();let d=new ResizeObserver(c);return d.observe(u),()=>d.disconnect()},[n,e,t]),(0,Fa.useEffect)(()=>()=>{r.current!==null&&cancelAnimationFrame(r.current)},[]);let l=(0,Fa.useCallback)(()=>r.current!==null,[]);return{run:a,isPainting:l}};var c8=T(M(),1),s8=7,NX=(e,t,n,i)=>{let r=null,o=s8*s8;for(let a of e)if(!a.leaving)for(let l of a.points){let s=l.fraction*i-t,u=Po+l.hourFraction*_u-n,c=s*s+u*u;c<=o&&(o=c,r=l)}return r},FX=.08,PX=2.2,u8=({layers:e,animate:t,highlightId:n,onPointEnter:i,onPointLeave:r,onPressCommit:o})=>{let a=(0,ii.useRef)(null),l=(0,ii.useRef)({width:0,height:0}),s=(0,ii.useRef)(e);s.current=e;let u=(0,ii.useMemo)(()=>n!==null&&e.some(x=>x.points.some(C=>C.id===n))?n:null,[e,n]),c=(0,ii.useRef)(u);c.current=u;let d=(0,ii.useRef)(new Map),f=(0,ii.useRef)(null),[h,m]=(0,ii.useState)(!1),y=(0,ii.useCallback)(x=>{let C=a.current,w=C?.getContext("2d");if(!C||!w)return!1;let{width:E,height:L}=l.current;w.clearRect(0,0,E,L);let R=!1;for(let k of s.current){let O=d.current.get(k.id),N=O?x-O.startedAt:null,H=N===null||N>=$m;if(O&&!H&&(R=!0),!(O?.mode==="out"&&H))for(let F of k.points){let P=O==null||H?1:O.mode==="in"?$k(F.key,N):Vk(F.key,N);if(P<=0)continue;let V=c.current,U=V!==null&&F.id===V,X=P*(U?PX:1),ae=F.fraction*E,A=Po+F.hourFraction*_u;w.globalAlpha=V===null?F.opacity:U?1:FX,w.fillStyle=F.color,w.beginPath(),w.arc(ae,A,F.radius*X,0,Math.PI*2),w.fill(),U&&(w.globalAlpha=.25,w.beginPath(),w.arc(ae,A,F.radius*X*2.4,0,Math.PI*2),w.fill())}}return w.globalAlpha=1,R},[]),{run:S,isPainting:p}=H0({canvasRef:a,sizeRef:l,paint:y,onSettled:()=>m(!1)}),g=e.map(x=>`${x.id}:${x.generation}:${x.leaving}`).join("|");(0,ii.useEffect)(()=>{let x=new Set;for(let C of e){x.add(C.id);let w=`${C.generation}:${C.leaving}`,E=`${C.id}@${w}`;if(d.current.get(C.id)?.marker!==E){if(!t){d.current.delete(C.id);continue}d.current.set(C.id,{mode:C.leaving?"out":"in",startedAt:performance.now(),marker:E}),C.leaving||m(!0)}}for(let C of[...d.current.keys()])x.has(C)||d.current.delete(C);t?S():y(performance.now())},[g,t,S,y]),(0,ii.useEffect)(()=>{p()||y(performance.now())},[e,u,y,p]);let b=x=>{let C=x.currentTarget.getBoundingClientRect();return NX(s.current,x.clientX-C.left,x.clientY-C.top,C.width)};return(0,c8.jsx)("canvas",{ref:a,"data-testid":"scatter-canvas","data-entrance":h?"playing":"done","data-highlight":u??"",style:{position:"absolute",inset:0},onMouseMove:x=>{let C=b(x);C?.key!==f.current&&(f.current=C?.key??null,C?i(C):r())},onMouseLeave:()=>{f.current=null,r()},onPointerDown:x=>o(b(x)?.commitSha??null)})};var qt=T(j(),1);var h8=T(M(),1),zX=1.5,BX=3,UX=1.2,GX=2,$X=.38,VX=.07,qX=.12,WX=1.8,d8=600,jX=e=>1-Math.pow(1-e,3),YX=90,KX=.005,XX=16,ap=(e,t,n)=>e+(t-e)*n,f8=({chart:e,fractionForTime:t,fractionToTime:n,color:i,animate:r,generation:o,focusIssue:a,onPathEnter:l,onPathLeave:s,onPressPath:u})=>{let c=(0,qt.useRef)(null),d=(0,qt.useRef)({width:0,height:0}),f=(0,qt.useRef)(null),h=(0,qt.useRef)(null),[m,y]=(0,qt.useState)(!1),S=(0,qt.useMemo)(()=>e.paths.map(H=>({path:H,xs:H.vertices.map(F=>t(F.t))})),[e,t]),p=(0,qt.useRef)(S);p.current=S;let g=(0,qt.useMemo)(()=>Bm(e.strands),[e.strands]),b=(0,qt.useRef)({geometry:g,strands:e.strands});b.current={geometry:g,strands:e.strands};let x=(0,qt.useRef)(a);x.current=a;let C=(0,qt.useRef)(new Map),w=(0,qt.useRef)(0),E=(0,qt.useRef)(null),L=(0,qt.useRef)(r);L.current=r;let R=(0,qt.useRef)(i);R.current=i;let k=(0,qt.useCallback)(H=>{let F=c.current,P=F?.getContext("2d");if(!F||!P)return!1;let{width:V,height:U}=d.current,{geometry:X,strands:ae}=b.current,A=ae.length,me=(J,Le)=>n0(X,J,Le,ae[J].slots);P.clearRect(0,0,V,U),P.strokeStyle=R.current,P.fillStyle=R.current,P.lineCap="round",P.lineJoin="round",P.globalAlpha=qX,P.lineWidth=1;for(let J=0;J<A;J++){let Le=Math.round(Zd(X,J))+.5;P.beginPath(),P.moveTo(0,Le),P.lineTo(V,Le),P.stroke()}let pe=f.current,I=pe===null?null:H-pe,ue=I!==null&&I<d8,be=ue?jX(I/d8)*V:V;P.save(),P.beginPath(),P.rect(0,0,be,U),P.clip();let ke=x.current,Je=E.current;E.current=H;let Q=L.current?1-Math.exp(-(Je===null?XX:H-Je)/YX):1,re=!1,fe=(J,Le)=>{let Ge=ap(J,Le,Q);return Math.abs(Le-Ge)<KX?Le:(re=!0,Ge)};w.current=fe(w.current,ke===null?0:1);let Ue=w.current,De=new Set;for(let{path:J,xs:Le}of p.current){De.add(J.issue);let Ge=fe(C.current.get(J.issue)??0,ke!==null&&J.issue===ke?1:0);C.current.set(J.issue,Ge),P.globalAlpha=ap(ap($X,VX,Ue),1,Ge),P.lineWidth=ap(UX,GX,Ge),P.strokeStyle=J.color??R.current,P.fillStyle=P.strokeStyle,P.beginPath();let Rt=J.vertices[0],$e=Le[0]*V,Ve=me(Rt.strand,Rt.slot);P.moveTo($e,Ve);for(let st=1;st<J.vertices.length;st++){let Ke=J.vertices[st],Wt=Le[st]*V,Ht=me(Ke.strand,Ke.slot);if(Ht===Ve)P.lineTo(Wt,Ve);else{let Wn=Math.min(BX,(Wt-$e)/2);P.lineTo(Wt-Wn,Ve),P.bezierCurveTo(Wt,Ve,Wt,Ht,Wt+Wn,Ht)}$e=Wt,Ve=Ht}P.stroke(),J.closed&&(P.beginPath(),P.arc($e,Ve,WX*ap(1,1.5,Ge),0,Math.PI*2),P.fill())}for(let J of[...C.current.keys()])De.has(J)||C.current.delete(J);return P.restore(),P.globalAlpha=1,!ue&&!re&&(E.current=null),ue||re},[]),{run:O}=H0({canvasRef:c,sizeRef:d,paint:k,onSettled:()=>y(!1)});(0,qt.useEffect)(()=>{if(!r){f.current=null,k(performance.now());return}f.current=performance.now(),y(!0),O()},[o,r,O,k]),(0,qt.useEffect)(()=>{O()},[S,a,i,O]);let N=H=>{let F=H.currentTarget.getBoundingClientRect(),P=(H.clientX-F.left)/Math.max(1,F.width),V=n(P),U=ET(e.paths,V,H.clientY-F.top,X=>n0(g,X.strand,X.slot,e.strands[X.strand].slots),zX);return U===null?null:{path:U,t:V,fraction:P}};return(0,h8.jsx)("canvas",{ref:c,"data-testid":"flow-canvas","data-entrance":m?"playing":"done","data-paths":e.paths.length,"data-focus":a??"",style:{position:"absolute",inset:0},onMouseMove:H=>{let F=N(H),P=F?.path.issue??null;H.currentTarget.style.cursor=F?"pointer":"",!(F===null&&h.current===null)&&(h.current=P,F?l(F):s())},onMouseLeave:()=>{h.current=null,s()},onPointerDown:H=>u(N(H)?.path.issue??null)})};var P0=T(j(),1);var os=T(M(),1),m8=({size:e=16})=>(0,os.jsxs)("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round","aria-hidden":"true",children:[(0,os.jsx)("line",{x1:"3",y1:"8.5",x2:"3",y2:"15.5"}),(0,os.jsx)("line",{x1:"7.5",y1:"4.5",x2:"7.5",y2:"19.5"}),(0,os.jsx)("line",{x1:"12",y1:"7",x2:"12",y2:"17"}),(0,os.jsx)("line",{x1:"16.5",y1:"3",x2:"16.5",y2:"21"}),(0,os.jsx)("line",{x1:"21",y1:"9.5",x2:"21",y2:"14.5"})]});var Uo=T(M(),1),p8=({size:e=14,lit:t=!1})=>(0,Uo.jsxs)("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[t?(0,Uo.jsxs)(Uo.Fragment,{children:[(0,Uo.jsx)("circle",{cx:"12",cy:"12",r:"9",className:"epiq-live-ripple"}),(0,Uo.jsx)("circle",{cx:"12",cy:"12",r:"9",className:"epiq-live-ripple epiq-live-ripple--trailing"})]}):(0,Uo.jsx)("circle",{cx:"12",cy:"12",r:"9",opacity:.55}),(0,Uo.jsx)("circle",{cx:"12",cy:"12",r:"4",fill:t?"currentColor":"none"})]});var lp=T(M(),1),g8=({size:e=16})=>(0,lp.jsxs)("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,lp.jsx)("path",{d:"M3 3h18l-9 10z",fill:"currentColor",stroke:"none"}),(0,lp.jsx)("path",{d:"M12 13v8"})]});var af=T(M(),1),y8=({size:e=14})=>(0,af.jsxs)("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,af.jsx)("path",{d:"M20.5 12a8.5 8.5 0 1 1-2.6-6.1"}),(0,af.jsx)("path",{d:"M19.6 2.9v3.6h-3.6"}),(0,af.jsx)("path",{d:"M10.4 8.8 15.2 12l-4.8 3.2z",fill:"currentColor"})]});var lf=T(M(),1),b8=({size:e=16})=>(0,lf.jsxs)("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,lf.jsx)("path",{d:"M3 6h5l4 6h4l4 6h1"}),(0,lf.jsx)("path",{d:"M3 12h6",opacity:"0.45"}),(0,lf.jsx)("path",{d:"M3 18h9",opacity:"0.45"})]});var Pa=T(M(),1),N0=({size:e=14})=>(0,Pa.jsxs)("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true",children:[(0,Pa.jsx)("line",{x1:"4",y1:"6",x2:"4.01",y2:"6"}),(0,Pa.jsx)("line",{x1:"9",y1:"6",x2:"20",y2:"6"}),(0,Pa.jsx)("line",{x1:"4",y1:"12",x2:"4.01",y2:"12"}),(0,Pa.jsx)("line",{x1:"9",y1:"12",x2:"16",y2:"12"}),(0,Pa.jsx)("line",{x1:"4",y1:"18",x2:"4.01",y2:"18"}),(0,Pa.jsx)("line",{x1:"9",y1:"18",x2:"19",y2:"18"})]});var Pu=T(M(),1),v8=({size:e=14})=>(0,Pu.jsxs)("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true",children:[(0,Pu.jsx)("line",{x1:"3",y1:"8",x2:"21",y2:"8"}),(0,Pu.jsx)("line",{x1:"7",y1:"8",x2:"7",y2:"13"}),(0,Pu.jsx)("line",{x1:"12",y1:"8",x2:"12",y2:"17"}),(0,Pu.jsx)("line",{x1:"17",y1:"8",x2:"17",y2:"13"})]});var as=T(M(),1),S8=({size:e=16})=>(0,as.jsxs)("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"currentColor",stroke:"none","aria-hidden":"true",children:[(0,as.jsx)("circle",{cx:"4.5",cy:"8",r:"2.2"}),(0,as.jsx)("circle",{cx:"9.5",cy:"17",r:"2.2"}),(0,as.jsx)("circle",{cx:"13",cy:"6.5",r:"2.2"}),(0,as.jsx)("circle",{cx:"17",cy:"14.5",r:"2.2"}),(0,as.jsx)("circle",{cx:"20.5",cy:"8.5",r:"2.2"})]});var Ze=T(M(),1),E8={opacity:.4,cursor:"not-allowed"},QX={tickets:"Tickets",comments:"Comments",tagging:"Tags",assigning:"Assignees"},x8={background:"transparent",border:"none",padding:0,display:"inline-flex",alignItems:"center",color:v.secondary,cursor:"pointer"},sf={all:"Board",...QX,contributors:"Contributors"},ZX={commenter:"comments",tag:"tagging",assignee:"assigning",actor:"contributors"},JX={commenter:"Only tickets with comments",tag:"Only tagged tickets",assignee:"Only assigned tickets",actor:"Only tickets touched in this window"},eQ=162,tQ={display:"flex",flexDirection:"column",gap:2,marginLeft:5,paddingLeft:8,borderLeft:`1px solid ${v.line}`},nQ={background:"transparent",border:`1px solid ${v.line}`,borderRadius:4,color:v.dim,fontFamily:"inherit",fontSize:10,lineHeight:1,padding:"2px 4px",cursor:"pointer"},F0=({label:e,selected:t,color:n,disabled:i,onSelect:r})=>(0,Ze.jsxs)("button",{type:"button",role:"radio","aria-checked":t,disabled:i,onClick:r,style:{display:"flex",alignItems:"center",gap:8,background:"transparent",border:"none",padding:0,fontSize:11,fontFamily:"inherit",color:t?n:v.dim,cursor:i?"not-allowed":"pointer",opacity:i?.4:1},children:[(0,Ze.jsx)("span",{style:{width:12,height:12,borderRadius:"50%",border:`1px solid ${t?n:v.dim}`,display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:t&&(0,Ze.jsx)("span",{style:{width:6,height:6,borderRadius:"50%",background:n}})}),e]}),iQ=[],rQ=new Set,w8=({connected:e,showIssues:t,view:n,identitiesByAxis:i,hiddenIdsByAxis:r,axisStates:o,narrowed:a,expanded:l,expandedAxis:s,filtered:u,onChangeShowIssues:c,onToggleAxis:d,onToggleIdentity:f,onOnlyIdentity:h,onToggleExpanded:m,onSetExpandedAxis:y})=>{let S=_r(n),p=S===null?iQ:i[S],g=S===null?rQ:r[S],b=jm(p,g),x=u&&g.size>0&&S!==null,C=u&&a&&!x&&b===null,w=b?`${sf[n]}: ${b.name}`:x?`${sf[n]} (multi)`:C?`${sf[n]} (filtered)`:`${sf[n]} (all)`,E=b?.color??(x||C?v.dim2:Ou(n));return(0,Ze.jsx)(Pl,{open:l,onOpenChange:L=>L!==l&&m(),testId:"series-select",label:w,color:E,width:eQ,minWidth:178,disabled:!t||!e,title:u?"Choose what to plot":"Too many events to split by kind",popupRole:"group",popupLabel:"Filter the board",leading:(0,Ze.jsx)(Ma,{label:null,testId:"show-board-events",title:"Show board events",checked:t,activeColor:E,disabled:!e,onChange:c}),children:()=>Gn.map(L=>{let R=ZX[L],k=o[L],O=s===L,N=sf[R].toLowerCase();return(0,Ze.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:2},children:[(0,Ze.jsxs)(Ir,{style:{justifyContent:"flex-start",gap:3},children:[(0,Ze.jsx)(Ma,{label:sf[R],checked:k==="all",mixed:k==="some",activeColor:Ou(R),disabled:!t||!u,title:JX[L],onChange:H=>d(L,H)}),(0,Ze.jsx)("button",{type:"button","data-testid":`filter-axis-${L}`,disabled:!t||!u,onClick:()=>y(O?null:L),title:O?`Hide ${N}`:`Pick ${N}`,"aria-expanded":O,style:{...x8,color:k==="some"?Ou(R):x8.color},children:O?(0,Ze.jsx)(Ar,{size:12}):(0,Ze.jsx)(nr,{size:12})})]}),O&&i[L].length>0&&(0,Ze.jsx)("div",{role:"group","aria-label":`Which ${N} to show`,style:{...tQ,maxHeight:132,overflowY:"auto"},children:i[L].map(H=>(0,Ze.jsxs)(Ir,{children:[(0,Ze.jsx)(Ma,{label:H.name,checked:!r[L].has(H.id),activeColor:H.color,disabled:!t,onChange:F=>f(L,H.id,F)}),(0,Ze.jsx)("button",{type:"button",title:`Show only ${H.name}`,disabled:!t,onClick:()=>h(L,H.id),style:nQ,children:"only"})]},H.id))})]},L)})})},oQ=150,C8=({connected:e,idle:t,showCommits:n,linkedOnly:i,linesMeasure:r,onChangeShowCommits:o,onChangeLinkedOnly:a,onChangeLinesMeasure:l})=>{let s=e&&!t;return(0,Ze.jsx)(Pl,{testId:"commit-select",label:`${r?"Lines":"Commits"} (${i?"linked":"all"})`,color:v.green,width:oQ,minWidth:160,disabled:!n||!s,title:t?"Flow draws tickets only":"Choose which commits to plot",popupRole:"group",leading:(0,Ze.jsx)(Ma,{label:null,testId:"show-commits",title:t?"Flow draws tickets only":"Show commits",checked:n,activeColor:v.green,disabled:!s,onChange:o}),children:u=>{let c=f=>{a(f),u()},d=f=>{l(f),u()};return(0,Ze.jsxs)(Ze.Fragment,{children:[(0,Ze.jsxs)("div",{role:"radiogroup","aria-label":"Which commits to plot",style:{display:"contents"},children:[(0,Ze.jsx)(Ir,{children:(0,Ze.jsx)(F0,{label:"All",selected:!i,color:v.green,onSelect:()=>c(!1)})}),(0,Ze.jsx)(Ir,{children:(0,Ze.jsx)(F0,{label:"Linked",selected:i,color:v.green,onSelect:()=>c(!0)})})]}),(0,Ze.jsx)("div",{"aria-hidden":!0,style:{height:1,background:v.line,margin:"3px 0"}}),(0,Ze.jsxs)("div",{role:"radiogroup","aria-label":"What the bars measure",style:{display:"contents"},children:[(0,Ze.jsx)(Ir,{children:(0,Ze.jsx)(F0,{label:"Commit count",selected:!r,color:v.green,onSelect:()=>d(!1)})}),(0,Ze.jsx)(Ir,{children:(0,Ze.jsx)(F0,{label:"Lines (+/-)",selected:r,color:v.green,onSelect:()=>d(!0)})})]})]})}})},aQ=108,k8=({scope:e,zoomed:t,connected:n,onChangeScope:i})=>(0,Ze.jsx)(Pl,{testId:"scope-select",label:t?"Zoom":tf(e),color:v.primary,width:aQ,disabled:!n,title:"Choose the window",children:r=>ef.map(o=>(0,Ze.jsx)(Ir,{role:"option",selected:!t&&e===o,onSelect:()=>{i(o),r()},children:tf(o)},o))});var Re=T(M(),1),lQ={background:v.panel2,border:`1px solid ${v.line}`,borderRadius:3,color:v.secondary,padding:"3px 7px",cursor:"pointer",display:"inline-flex",alignItems:"center"},T8=({connected:e,scope:t,zoomed:n,windowOnly:i,windowFilterable:r,canPlay:o,playTitle:a,onPlay:l,following:s,canFollow:u,followTitle:c,onChangeFollowing:d,narrow:f,ticketFocus:h,textFilter:m,onChangeTextFilter:y,layoutMode:S,showIssues:p,showCommits:g,linkedCommitsOnly:b,onChangeLinkedCommitsOnly:x,linesMeasure:C,onChangeLinesMeasure:w,allBoards:E,boardView:L,identitiesByAxis:R,hiddenIdsByAxis:k,axisStates:O,narrowed:N,categoriesExpanded:H,expandedAxis:F,categoriesFiltered:P,isScrubbing:V,onReturnToLive:U,onChangeScope:X,onChangeWindowOnly:ae,onChangeLayoutMode:A,onChangeShowIssues:me,onChangeShowCommits:pe,onChangeAllBoards:I,onToggleAxis:ue,onToggleIdentity:be,onOnlyIdentity:ke,onToggleCategoriesExpanded:Je,onSetExpandedAxis:Q})=>{let re=!Hu(t,n);return(0,Re.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:20,flex:"1 1 0",minWidth:0},children:[(0,Re.jsxs)(sp,{label:"View",style:{gap:2},children:[(0,Re.jsx)(Te,{title:"Volume per period","aria-label":"Volume",pressed:S==="even",disabled:!e,onClick:()=>A("even"),children:(0,Re.jsx)(m8,{size:ge})}),(0,Re.jsx)(Te,{title:"Events by moment and time of day","aria-label":"Events",pressed:S==="real",disabled:!e,onClick:()=>A("real"),children:(0,Re.jsx)(S8,{size:ge})}),(0,Re.jsx)(Te,{title:"Flow between swimlanes, one line per ticket","aria-label":"Flow",pressed:S==="flow",disabled:!e,onClick:()=>A("flow"),children:(0,Re.jsx)(b8,{size:ge})})]}),(0,Re.jsx)(sp,{label:"Scope",children:f?(0,Re.jsx)(k8,{scope:t,zoomed:n,connected:e,onChangeScope:X}):(0,Re.jsxs)("div",{style:{display:"flex",gap:2},children:[ef.map(fe=>(0,Re.jsx)("button",{"aria-pressed":!n&&!h&&t===fe,disabled:!e,onClick:()=>X(fe),style:{...Kd(!n&&!h&&t===fe),...e?{}:E8},children:tf(fe)},fe)),(0,Re.jsx)("button",{title:h?"Held while narrowed to a ticket":n?"Zoomed by a drag \u2014 pick a period to leave":"Drag across the chart to zoom","aria-pressed":n&&!h,disabled:!0,style:{...Kd(n&&!h),opacity:n&&!h?1:.35,cursor:"default"},children:"Zoom"})]})}),(0,Re.jsx)(sp,{label:"Narrow",children:(0,Re.jsx)(ZT,{title:h?"Already narrowed to a ticket":re?"Pick a period first":r?"Narrow board to timeline window":"Too many events to tell tickets apart",on:i,disabled:h||re||!r||!e&&!i,onChange:ae})}),(0,Re.jsx)("div",{"aria-hidden":!0,style:{flex:"1 1 0",minWidth:0}}),(0,Re.jsxs)(sp,{label:"Filter",style:{gap:10,minWidth:0},children:[(0,Re.jsx)(C8,{connected:e,idle:S==="flow",showCommits:g,linkedOnly:b,linesMeasure:C,onChangeShowCommits:pe,onChangeLinkedOnly:x,onChangeLinesMeasure:w}),(0,Re.jsx)(w8,{connected:e,showIssues:p,view:L,identitiesByAxis:R,hiddenIdsByAxis:k,axisStates:O,narrowed:N,expanded:H,expandedAxis:F,filtered:P,onChangeShowIssues:me,onToggleAxis:ue,onToggleIdentity:be,onOnlyIdentity:ke,onToggleExpanded:Je,onSetExpandedAxis:Q}),(0,Re.jsx)(JT,{value:m,onChange:y})]}),(0,Re.jsxs)(sp,{label:"Play",style:{gap:6},children:[(0,Re.jsx)(eR,{following:s,disabled:!u,title:c,onChange:d}),(0,Re.jsx)(tR,{canPlay:o,playTitle:a,onPlay:l})]})]})},sp=({label:e,style:t,children:n})=>{let i=(0,P0.useContext)(IC),r=(0,P0.useRef)(null),o=r.current?.getBoundingClientRect(),a=o?`${i.x-o.left}px ${i.y-o.top}px`:"0 0";return(0,Re.jsxs)("div",{"data-group-label":e,style:{position:"relative",display:"flex",alignItems:"center",alignSelf:"stretch",...t},children:[(0,Re.jsxs)("span",{ref:r,"aria-hidden":!0,style:{position:"absolute",left:0,bottom:"100%",marginBottom:3,fontSize:8,lineHeight:1,letterSpacing:"0.1em",textTransform:"uppercase",whiteSpace:"nowrap",pointerEvents:"none",userSelect:"none"},children:[(0,Re.jsx)("span",{style:{color:v.dim,opacity:.6},children:e}),(0,Re.jsx)("span",{style:{position:"absolute",inset:0,color:"transparent",backgroundImage:`radial-gradient(${i.radius}px circle at ${a}, ${i.color}, transparent 100%)`,WebkitBackgroundClip:"text",backgroundClip:"text",opacity:i.strength,transition:"opacity 140ms ease"},children:e})]}),n]})},ZT=({on:e,disabled:t=!1,title:n,onChange:i})=>(0,Re.jsx)(Te,{testId:"spotlight",title:n,"aria-label":"Narrow board to timeline window",pressed:e,disabled:t,onClick:()=>i(!e),children:(0,Re.jsx)(lv,{size:ge})}),JT=({value:e,onChange:t})=>{let n=e.trim()!=="";return(0,Re.jsx)("input",{"data-testid":"text-filter",type:"search",value:e,placeholder:"ref or title","aria-label":"Filter tickets by ref or title",title:"Filter tickets by ref or title",spellCheck:!1,onChange:i=>t(i.target.value),onKeyDown:i=>{i.key==="Escape"&&(t(""),i.currentTarget.blur())},style:{...Xb(n?v.accent:v.primary,!1),width:110,minWidth:70,flexShrink:1,boxShadow:n?`0 0 0 1px ${v.accent}`:void 0,outline:"none"}})},R8=({collapsed:e,onToggleCollapsed:t,logOpen:n,onChangeLogOpen:i})=>(0,Re.jsxs)("div",{style:{...Xd,fontSize:11,whiteSpace:"nowrap"},children:[(0,Re.jsx)(Te,{testId:"log-toggle",title:n?"Hide the event log":"Show the event log",pressed:n,onClick:()=>i(!n),children:(0,Re.jsx)(N0,{size:ge})}),(0,Re.jsx)(Te,{testId:"timeline-toggle",title:e?"Show time travel":"Hide time travel",pressed:!e,"aria-expanded":!e,onClick:t,children:(0,Re.jsx)(v8,{size:ge})})]}),L8=({isScrubbing:e,onReturnToLive:t})=>e?(0,Re.jsx)("button",{onClick:t,onPointerDown:n=>n.stopPropagation(),onMouseMove:n=>n.stopPropagation(),title:"Put the board back at now","aria-label":"Now",style:{...lQ,position:"absolute",right:2,top:"50%",transform:"translateY(-50%)",zIndex:4,background:v.accent,border:`1px solid ${v.accent}`,color:v.bg,display:"inline-flex",alignItems:"center",padding:"3px 4px",cursor:"pointer"},children:(0,Re.jsx)(g8,{size:ge})}):null,eR=({following:e,disabled:t,title:n,onChange:i})=>(0,Re.jsx)("span",{style:{...Xd,...t?{background:"transparent",borderColor:"transparent"}:{}},children:(0,Re.jsx)(Te,{testId:"live-toggle",title:n,"aria-label":"Follow the newest event",pressed:e,disabled:t,tone:"solid",label:e?"LIVE":void 0,onClick:()=>i(!e),children:(0,Re.jsx)(p8,{size:ge,lit:e})})}),tR=({canPlay:e,playTitle:t,onPlay:n})=>(0,Re.jsx)("span",{style:{...Xd,...e?{}:{background:"transparent",borderColor:"transparent"}},children:(0,Re.jsx)(Te,{testId:"theatre-play",title:t,"aria-label":"Play the board's history",disabled:!e,onClick:n,children:(0,Re.jsx)(y8,{size:ge})})});var Go=T(j(),1);var Be=T(M(),1),A8=({boundaries:e,hovered:t,fractionForTime:n})=>(0,Be.jsx)(Be.Fragment,{children:e.map(({time:i,label:r})=>(0,Be.jsx)("div",{"data-testid":"segment-boundary","aria-hidden":!0,style:{position:"absolute",left:`${n(i)*100}%`,top:0,bottom:0,width:1,background:Tk,pointerEvents:"none"},children:r!==null&&!(t&&i>=t.start&&i<t.end)&&(0,Be.jsx)("span",{style:{position:"absolute",top:1,left:3,fontSize:8,lineHeight:1,color:Rk,whiteSpace:"nowrap"},children:r})},i))}),I8=({segment:e,fractionForTime:t})=>{let n=t(e.start);return(0,Be.jsx)("div",{style:{position:"absolute",left:`${n*100}%`,width:`${(t(e.end)-n)*100}%`,top:0,bottom:0,background:kk,pointerEvents:"none",overflow:"visible"},children:(0,Be.jsx)("span",{style:{position:"absolute",top:1,left:3,fontSize:8,lineHeight:1,color:v.dim2,whiteSpace:"nowrap"},children:e.label})})},M8=({from:e,to:t})=>{let n=Math.min(e,t);return(0,Be.jsx)("div",{"data-testid":"scrubber-range-selection",style:{position:"absolute",left:`${n*100}%`,width:`${Math.abs(t-e)*100}%`,top:0,bottom:0,background:Pk,borderLeft:`1px solid ${i0}`,borderRight:`1px solid ${i0}`,boxSizing:"border-box",pointerEvents:"none",zIndex:4}})},nR=({color:e,anchor:t})=>(0,Be.jsx)("div",{style:{position:"absolute",left:0,right:0,...t==="bottom"?{bottom:0}:{},...t==="top"?{top:0}:{},height:t==="top"?1:2,borderRadius:999,background:e,opacity:t==="centre"?.14:.2}}),D8={position:"absolute",left:2,fontSize:9,lineHeight:1,color:v.secondary,padding:"2px 4px",borderRadius:2,background:"rgba(0, 0, 0, 0.55)",pointerEvents:"none"},_8=()=>(0,Be.jsx)(Be.Fragment,{children:[["00:00",{top:Po-2}],["12:00",{top:"50%",transform:"translateY(-50%)"}],["24:00",{bottom:Po-2}]].map(([e,t])=>(0,Be.jsx)("span",{style:{...D8,...t},children:e},e))}),O8=({strands:e,geometry:t})=>(0,Be.jsx)(Be.Fragment,{children:e.map((n,i)=>(0,Be.jsx)("span",{style:{...D8,top:Zd(t,i),transform:"translateY(-50%)",maxWidth:150,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:n.title},n.id))}),H8=({animate:e,children:t})=>(0,Be.jsx)("div",{style:{position:"absolute",inset:0,pointerEvents:"none",animation:e?Vm:void 0,contain:"layout paint"},children:t}),iR=({index:e,bucketCount:t})=>(0,Be.jsx)("div",{style:{position:"absolute",left:`${e*(100/t)}%`,top:0,bottom:0,width:`${100/t}%`,minWidth:2,background:Lk,pointerEvents:"none"}}),sQ=({bars:e,bucketCount:t,firstBar:n,lastBar:i,color:r,direction:o,animate:a})=>{let l=100/t,s=o0(t),u=o==="up",[c,d]=(0,Go.useState)(!0);return(0,Go.useEffect)(()=>{let f=setTimeout(()=>d(!1),l0);return()=>clearTimeout(f)},[]),(0,Be.jsx)(Be.Fragment,{children:e.map(({index:f,intensity:h})=>(0,Be.jsx)("div",{style:{position:"absolute",left:`${f*l}%`,...u?{bottom:0}:{top:0},width:s,height:3+h*(Fo-3),borderRadius:u?"1px 1px 0 0":"0 0 1px 1px",background:r,opacity:.35+h*.65,transformOrigin:u?"bottom":"top",animation:a&&c?a0(f,n,i):void 0,pointerEvents:"none"}},f))})},rR=(0,Go.memo)(sQ),uQ=({segments:e,bucketCount:t,firstBar:n,lastBar:i,colors:r,animate:o})=>{let a=100/t,l=o0(t),[s,u]=(0,Go.useState)(!0);return(0,Go.useEffect)(()=>{let c=setTimeout(()=>u(!1),l0);return()=>clearTimeout(c)},[]),(0,Be.jsx)(Be.Fragment,{children:e.map(({index:c,top:d,bottom:f})=>{let h=d+f,{height:m,share:y}=Yk(d,f,Fo);return(0,Be.jsxs)("div",{"data-testid":"line-bar","data-share":y.toFixed(3),style:{position:"absolute",left:`${c*a}%`,top:0,width:l,height:m,display:"flex",flexDirection:"column",borderRadius:"0 0 1px 1px",overflow:"hidden",opacity:.35+Math.min(1,h)*.65,transformOrigin:"top",animation:o&&s?a0(c,n,i):void 0,pointerEvents:"none"},children:[(0,Be.jsx)("div",{style:{height:`${y*100}%`,background:r.top}}),(0,Be.jsx)("div",{style:{flex:1,background:r.bottom}})]},c)})})},N8=(0,Go.memo)(uQ),F8=({from:e})=>(0,Be.jsx)("div",{"data-testid":"scrubber-unapplied",style:{position:"absolute",left:`${e*100}%`,right:0,top:0,bottom:0,backgroundColor:_k,backgroundImage:Dk,borderLeft:e>0?`1px solid ${Ok}`:void 0,zIndex:2,pointerEvents:"none"}}),P8=({fraction:e,parked:t,onGrab:n})=>{let[i,r]=(0,Go.useState)(!1),o=t?Ik:Ak,a={onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!1),onPointerDown:n};return(0,Be.jsxs)(Be.Fragment,{children:[(0,Be.jsx)("div",{...a,"data-testid":"scrubber-needle-grip",style:{position:"absolute",left:`${e*100}%`,top:0,bottom:0,width:r0,transform:`translateX(${-r0/2}px)`,zIndex:3,pointerEvents:"auto",cursor:"ew-resize"}}),(0,Be.jsx)("div",{style:{position:"absolute",left:`${e*100}%`,top:0,bottom:0,width:t?2:1,background:o,boxShadow:t?Mk:void 0,zIndex:3,transform:`translateX(${t?-1:-.5}px)`,pointerEvents:"none"}}),(0,Be.jsx)("div",{...a,style:{position:"absolute",left:`${e*100}%`,top:i?-8:-6,width:0,height:0,borderLeft:`${i?6:5}px solid transparent`,borderRight:`${i?6:5}px solid transparent`,borderTop:`${i?8:7}px solid ${o}`,zIndex:3,transform:`translateX(${i?-6:-5}px)`,pointerEvents:"auto",cursor:"ew-resize"}})]})},oR=({label:e,rows:t,segmentLabel:n,stripeColor:i,fraction:r,trackWidthPx:o,empty:a=!1,testId:l})=>(0,Be.jsxs)("div",{"data-testid":l,style:{position:"absolute",top:"100%",marginTop:6,left:pn(r*o-Gm/2,0,Math.max(0,o-Gm)),width:Gm,boxSizing:"border-box",display:"flex",flexDirection:"column",gap:2,textAlign:"left",background:v.panel,border:`1px solid ${v.line}`,borderLeft:`3px solid ${a?v.dim:i}`,borderRadius:3,padding:"6px 10px",pointerEvents:"none",zIndex:5},children:[n&&(0,Be.jsx)("div",{style:{fontSize:10,color:v.dim},children:n}),(0,Be.jsx)("div",{style:{fontSize:11,fontWeight:600,color:a?v.secondary:v.primary,whiteSpace:"normal",wordBreak:"break-word"},children:e}),t.map((s,u)=>(0,Be.jsx)("div",{style:{fontSize:11,color:a?v.dim:v.secondary,whiteSpace:"normal",wordBreak:"break-word"},children:s},u))]});var uf=T(j(),1),Hr=180,up=(e,t=Hr)=>{let[n,i]=(0,uf.useState)(e),[r,o]=(0,uf.useState)(e),[a,l]=(0,uf.useState)(e);return(0,uf.useEffect)(()=>{if(t===0){i(e),o(e),l(e);return}if(e){i(!0);let u=0,c=requestAnimationFrame(()=>{u=requestAnimationFrame(()=>o(!0))}),d=setTimeout(()=>l(!0),t);return()=>{cancelAnimationFrame(c),cancelAnimationFrame(u),clearTimeout(d)}}l(!1),o(!1);let s=setTimeout(()=>i(!1),t);return()=>clearTimeout(s)},[e,t]),{mounted:n,shown:r,settled:a}};var ye=T(M(),1),cQ=1440*60*1e3,dQ={top:v.red,bottom:v.green};var z8=({side:e,onPage:t})=>(0,ye.jsx)("span",{className:Du,onPointerDown:n=>n.stopPropagation(),onMouseMove:n=>n.stopPropagation(),style:{position:"absolute",top:"50%",[e==="earlier"?"left":"right"]:-(xd+4),transform:"translateY(-50%)",display:"inline-flex",cursor:"default"},children:(0,ye.jsx)(Te,{testId:e==="earlier"?"page-earlier":"page-later",title:e==="earlier"?"Earlier":"Later",onClick:t,children:e==="earlier"?(0,ye.jsx)(l8,{size:ge}):(0,ye.jsx)(nr,{size:ge})})}),B8=({collapsed:e,onToggleCollapsed:t,canPlay:n,playTitle:i,onPlay:r,logOpen:o,onChangeLogOpen:a,standDown:l,controls:s,chart:u})=>{let{axis:c,layoutMode:d,animate:f,windowKey:h,on:m}=u,y=Bm(u.flowChart.strands),S=up(!e,f?Hr:0),p=up(u.showCommits,f?Hr:0);return(0,ye.jsxs)(Fl,{as:"div",borderColor:v.line,borderRadius:0,style:{borderLeft:"none",borderRight:"none",borderTop:"none",padding:"18px 30px",overflow:"visible",pointerEvents:l?"none":void 0},children:[(0,ye.jsx)("style",{children:Wk}),(0,ye.jsx)("style",{children:qk}),(0,ye.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:e?0:Um},children:[(0,ye.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:20,opacity:l?.3:1,transition:"opacity 240ms ease"},children:[(0,ye.jsx)(R8,{collapsed:e,onToggleCollapsed:t,logOpen:o,onChangeLogOpen:a}),e?(0,ye.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:12},children:[(0,ye.jsx)(JT,{value:s.textFilter,onChange:s.onChangeTextFilter}),s.windowOnly&&(0,ye.jsx)(ZT,{on:!0,title:"Show every ticket again",onChange:s.onChangeWindowOnly}),(0,ye.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:6},children:[(0,ye.jsx)(eR,{following:s.following,disabled:!s.canFollow,title:s.followTitle,onChange:s.onChangeFollowing}),(0,ye.jsx)(tR,{canPlay:n,playTitle:i,onPlay:r})]})]}):(0,ye.jsx)(T8,{...s,canPlay:n,playTitle:i,onPlay:r})]}),S.mounted&&(0,ye.jsx)("div",{style:{display:"grid",gridTemplateRows:S.shown?"1fr":"0fr",transition:f?`grid-template-rows ${Hr}ms ease`:void 0},children:(0,ye.jsx)("div",{style:{overflow:S.settled?"visible":"hidden",minHeight:0},children:(0,ye.jsxs)("div",{"data-testid":"scrubber-track","data-axis-span":Math.round(c.span),ref:u.pageRef,className:s0,onPointerDown:m.onPointerDown,onPointerMove:m.onPointerMove,onPointerUp:m.onPointerEnd,onPointerCancel:m.onPointerEnd,onMouseMove:m.onTrackMouseMove,onMouseLeave:m.onTrackMouseLeave,style:{position:"relative",display:"flex",flexDirection:"column",gap:d==="even"&&!(u.showIssues&&u.showCommits)?0:8,transition:f?`gap ${Hr}ms ease`:void 0,cursor:u.connected?"crosshair":"default",userSelect:"none",WebkitUserSelect:"none"},children:[u.scoped&&(0,ye.jsx)("div",{"aria-hidden":!0,"data-testid":"scrubber-scoped",style:{position:"absolute",inset:`${-Fk}px ${-Nk}px`,border:`1px solid ${Hk}`,borderRadius:2,pointerEvents:"none"}}),(0,ye.jsx)("div",{"aria-hidden":!0,style:{position:"absolute",left:0,right:0,top:-Um,height:Um}}),(0,ye.jsx)(A8,{boundaries:u.segmentBoundaries,hovered:u.hoveredGrain,fractionForTime:c.fractionForTime}),u.hoveredSegment&&(0,ye.jsx)(I8,{segment:u.hoveredSegment,fractionForTime:c.fractionForTime}),(0,ye.jsxs)("div",{ref:u.trackRef,style:{position:"relative",width:"100%",height:d==="real"?_u:d==="flow"?y.height:u.showIssues?Fo:0,paddingTop:d==="real"?Po:0,paddingBottom:d==="real"?Po:0,boxSizing:"content-box",display:"flex",alignItems:"center",transition:f?`height ${Hr}ms ease`:void 0},children:[(d==="real"||d==="even"&&u.showIssues)&&(0,ye.jsx)(nR,{color:u.issueSeriesColor,anchor:d==="even"?"bottom":"centre"}),d==="real"&&c.span>=cQ&&(0,ye.jsx)(_8,{}),u.showIssues&&d==="even"&&(0,ye.jsxs)(ye.Fragment,{children:[u.hoveredBucketIndex!==null&&(0,ye.jsx)(iR,{index:u.hoveredBucketIndex,bucketCount:c.bucketCount}),(0,ye.jsx)(H8,{animate:f,children:(0,ye.jsx)(rR,{bars:u.issueBars,bucketCount:c.bucketCount,firstBar:u.issueBarRange[0],lastBar:u.issueBarRange[1],color:u.issueSeriesColor,direction:"up",animate:f})},`issues-${h}`)]}),d==="real"&&(0,ye.jsx)(u8,{layers:u.scatterLayers,animate:f,highlightId:u.highlightEventId,onPointEnter:m.onScatterPointEnter,onPointLeave:m.onScatterPointLeave,onPressCommit:m.onPressCommit}),d==="flow"&&(0,ye.jsxs)(ye.Fragment,{children:[(0,ye.jsx)(f8,{chart:u.flowChart,fractionForTime:c.fractionForTime,fractionToTime:c.fractionToTime,color:u.issueSeriesColor,animate:f,generation:h,focusIssue:u.flowFocusIssue,onPathEnter:m.onFlowPathEnter,onPathLeave:m.onFlowPathLeave,onPressPath:m.onPressFlowPath}),(0,ye.jsx)(O8,{strands:u.flowChart.strands,geometry:y})]})]}),d==="even"&&(0,ye.jsx)("div",{style:{height:u.showCommits?Fo:0,overflow:"hidden",flexShrink:0,transition:f?`height ${Hr}ms ease`:void 0},children:p.mounted&&(0,ye.jsxs)("div",{onMouseEnter:m.onCommitTrackMouseEnter,onMouseMove:m.onCommitTrackMouseMove,onMouseLeave:m.onCommitTrackMouseLeave,style:{position:"relative",width:"100%",height:Fo,animation:f?Vm:void 0},children:[(0,ye.jsx)(nR,{color:v.green,anchor:"top"}),u.hoveredCommitBucketIndex!==null&&(0,ye.jsx)(iR,{index:u.hoveredCommitBucketIndex,bucketCount:c.bucketCount}),u.linesMeasure?(0,ye.jsx)(N8,{segments:u.lineBars,bucketCount:c.bucketCount,firstBar:u.lineBarRange[0],lastBar:u.lineBarRange[1],colors:dQ,animate:f}):(0,ye.jsx)(rR,{bars:u.commitBars,bucketCount:c.bucketCount,firstBar:u.commitBarRange[0],lastBar:u.commitBarRange[1],color:v.green,direction:"down",animate:f})]},`commits-${h}`)}),u.unappliedFrom!==null&&(0,ye.jsx)(F8,{from:u.unappliedFrom}),u.thumbFraction!==null&&(0,ye.jsx)(P8,{fraction:u.thumbFraction,parked:s.isScrubbing,onGrab:m.onGrabNeedle}),!l&&(0,ye.jsx)(L8,{isScrubbing:s.isScrubbing,onReturnToLive:s.onReturnToLive}),u.rangeSelection&&(0,ye.jsx)(M8,{...u.rangeSelection}),u.boardHint&&(0,ye.jsx)(oR,{...u.boardHint,testId:"board-hint",segmentLabel:u.hoveredSegment?.label,stripeColor:u.issueSeriesColor,trackWidthPx:u.trackWidthPx}),u.commitHint&&(0,ye.jsx)(oR,{...u.commitHint,segmentLabel:u.hoveredSegment?.label,stripeColor:v.green,trackWidthPx:u.trackWidthPx}),u.paging.earlier&&(0,ye.jsx)(z8,{side:"earlier",onPage:m.onPageEarlier}),u.paging.later&&(0,ye.jsx)(z8,{side:"later",onPage:m.onPageLater}),u.paging.label!==null&&(0,ye.jsx)("span",{"data-testid":"scrubber-window-label",style:{position:"absolute",top:1,right:0,padding:"0 0 0 4px",fontSize:8,lineHeight:1,color:v.dim,background:v.panel,whiteSpace:"nowrap",pointerEvents:"none"},children:u.paging.label})]})})})]})]})};var G8=T(M(),1),fQ=120,hQ=[],mQ=new Set,pQ={strands:[],paths:[]},gQ=e=>`${e} board event${e===1?"":"s"}`,yQ="epiq.timeScrubber.collapsed",bQ="epiq.timeScrubber.allBoards",vQ="epiq.timeScrubber.categoriesExpanded",SQ="epiq.timeScrubber.expandedAxis",xQ="epiq.timeScrubber.linesMeasure",U8=({timeline:e,commits:t,historyId:n,timeTravel:i,onScrub:r,onReturnToLive:o,onRequestHistory:a,boardId:l,connected:s,socketEpoch:u,highlightEventId:c,onInspectCommit:d,onOpenIssue:f,selection:h,onChangeSelection:m,selectedIssue:y,textFilter:S,onChangeTextFilter:p,queryIssueIds:g,knownIdentities:b,refreshOn:x,onPlayTheatre:C,theatreOpen:w,logOpen:E,onChangeLogOpen:L,following:R,onChangeFollowing:k,showIssues:O,onChangeShowIssues:N,showCommits:H,onChangeShowCommits:F,linkedCommitsOnly:P,onChangeLinkedCommitsOnly:V,issueIdByRef:U,boardIssueIdByRef:X,lanes:ae,laneTitles:A,issueSummaryById:me})=>{let{scope:pe,offset:I,zoom:ue,layout:be,only:ke,windowOnly:Je,ticketOnly:Q}=h,re=Wm(ke),fe=!_a(),Ue=jk(),De=(0,se.useRef)(null),J=(0,se.useRef)(0),Le=(0,se.useRef)(null),[Ge,Rt]=(0,se.useState)(null),[$e,Ve]=(0,se.useState)(null),st=(0,se.useRef)(null),Ke=(0,se.useRef)(null),Wt=(0,se.useRef)(!1),Ht=(0,se.useRef)(null),Wn=(0,se.useRef)(null),[io,Wo]=_t(yQ,!1),[z,Z]=_t(vQ,!1),[he,Ce]=_t(xQ,!1),[Oe,Nt]=JO(SQ,qm),[mt,Jt]=_t(bQ,!1),ri=be==="real"&&fe?$m:0,Ct=u0(O,ri),Ae=u0(H,ri),[Ft,un]=(0,se.useState)(null),[za,Gt]=(0,se.useState)(null),[ie,Ba]=(0,se.useState)(null),[Fi,ro]=(0,se.useState)(null),[lr,In]=(0,se.useState)(null),[en,bi]=(0,se.useState)(null),$t=Q&&y!==null,sr=$t?{start:y.createdAt,end:Date.now()}:null,us=$t?y.id:null,Mn=(0,se.useMemo)(()=>Ym(us,g),[us,g]),cs=$t?`${y.id}:${y.createdAt}`:null,ds=sr??ue??mT(pe,I);(0,se.useEffect)(()=>{s&&($a.current=a(ds?.start,ds?.end,mt))},[pe,I,ue?.start,ue?.end,cs,l,mt,s,u,x]);let Gu=B=>m({layout:B}),$u=B=>{Ur(),m({scope:B})},jo=B=>{if(Ur(),!ue){m({offset:B});return}let ee=ue.end-ue.start,Ee=(B-I)*ee,tt=Math.min(Date.now(),ue.end-Ee);m({zoom:{start:tt-ee,end:tt}})},Vu=ue?ue.end>=Date.now():I===0,fs=s&&!$t&&(pe!=="all"||ue!==null),hs={earlier:fs,later:fs&&!Vu,label:$t||ue!==null||pe!=="all"&&I!==0?pT(pe,I,ds,ue!==null||$t):null},ut=(0,se.useRef)(null),vi=(0,se.useRef)(jo);vi.current=jo;let zr=(0,se.useRef)(hs);zr.current=hs;let Ua=(0,se.useRef)(I);Ua.current=I,(0,se.useEffect)(()=>{let B=ut.current;if(!B)return;let ee=gT(),Ee=tt=>{if(!yT(tt.deltaX,tt.deltaY))return;tt.preventDefault();let jn=ee.feed(tt.deltaX,tt.deltaY,tt.timeStamp),{earlier:so,later:kf}=zr.current;jn===-1&&so?vi.current(Ua.current+1):jn===1&&kf&&vi.current(Ua.current-1)};return B.addEventListener("wheel",Ee,{passive:!1}),()=>B.removeEventListener("wheel",Ee)},[io]);let Br=(B,ee)=>{let Ee=Math.min(B,ee),tt=Math.max(Bk,Math.abs(ee-B));Ur(),m({zoom:{start:Ee,end:Ee+tt}})},ms=(B,ee)=>m({only:YB(ke,B,ee)}),ps=(B,ee)=>m({only:of(ke,B,M0(pi(rs(ke,B)),ee)??"all")}),Yo=(B,ee,Ee)=>m({only:of(ke,B,o8(rs(ke,B),ur[B],ee,Ee))}),qu=B=>{Ur(),Jt(B)},Wu=(0,se.useMemo)(()=>{let B=pi(rs(ke,_r(re)));return JSON.stringify([re,B===null?null:[...B].sort()])},[re,ke]),Ga=(0,se.useRef)(0),Ko=(0,se.useRef)(!0),Ur=()=>{Ko.current=!0},gs=(0,se.useRef)({timeline:e,commits:t}),$a=(0,se.useRef)(null);!(st.current!==null||Ke.current!==null)&&$a.current!==null&&n===$a.current&&($a.current=null,gs.current={timeline:e,commits:t},Ko.current&&(Ko.current=!1,Ga.current+=1));let jt=gs.current,He=(0,se.useMemo)(()=>oT(jt.timeline,jt.commits),[jt]),K=(e?.events.length??0)>0,ur=(0,se.useMemo)(()=>{let B=Zk(jt.timeline),ee={};for(let Ee of Gn)ee[Ee]=a8(B[Ee],pi(rs(ke,Ee)),b[Ee]);return ee},[jt,ke,b]),ys=(0,se.useMemo)(()=>{let B={};for(let ee of Gn)B[ee]=jB(ke,ee);return B},[ke]),bs=(0,se.useMemo)(()=>{let B={};for(let ee of Gn)B[ee]=I0(ur[ee],rs(ke,ee));return B},[ur,ke]),Xo=_r(re),vs=Xo===null?hQ:ur[Xo],cr=Xo===null?mQ:bs[Xo],Y0=(0,se.useMemo)(()=>jm(vs,cr),[vs,cr]),ju=(0,se.useMemo)(()=>lT(He,jt.timeline,re,cr,Mn),[He,jt,re,cr,Mn]),yp=_0({everyBoard:U,thisBoard:X,ticketFocus:$t,everyBoardPlotted:mt}),dr=(0,se.useMemo)(()=>O0(jt.commits,P,$t,yp,Mn),[jt.commits,P,$t,yp,Mn]),oo=(0,se.useMemo)(()=>sT(He,dr),[He,dr]),bp=(0,se.useMemo)(()=>eT(jt.timeline,re,cr,Mn),[jt,re,cr,Mn]),vp=(0,se.useMemo)(()=>{let B=new Map;for(let[ee,Ee]of me)Ee.assignee&&B.set(ee,Ee.assignee.color);return B},[me]),Ss=(0,se.useMemo)(()=>be==="flow"?vT(O?jt.timeline:null,ae,A,re,cr,Mn,vp):pQ,[be,O,jt,ae,A,re,cr,Mn,vp]),Sp=(0,se.useMemo)(()=>{if(Fi)return Fi.path.issue;if(c!==null){let B=Ss.paths.find(ee=>ee.vertices.some(Ee=>Ee.eventId===c));if(B)return B.issue}return y?.id??null},[Fi,c,Ss,y]),Va=Ge!==null||$e!==null,K0=(0,se.useMemo)(()=>dr.map(B=>({key:B.sha,id:null,t:B.time,fraction:He.fractionForTime(B.time),hourFraction:d0(B.time),radius:2,color:v.green,opacity:.55,title:`${B.subject} \u2014 ${eo(zm(B)).label} (${B.linesChanged.toLocaleString()} lines)`,commitSha:B.sha})),[dr,He]),xp=(0,se.useMemo)(()=>bp.map(B=>({key:B.key,id:B.id,t:B.t,fraction:He.fractionForTime(B.t),hourFraction:d0(B.t),radius:B.size/2,color:B.color,opacity:B.opacity,title:Jk(B),commitSha:null})),[bp,He]),yf=(0,se.useMemo)(()=>{let B=Oa(ju,1);return ju.flatMap((ee,Ee)=>ee>0?[{index:Ee,intensity:ee/B}]:[])},[ju]),Yu=(0,se.useMemo)(()=>{let B=Oa(Array.from(oo.values(),ee=>ee.count),1);return Array.from(oo,([ee,Ee])=>({index:ee,intensity:Ee.count/B}))},[oo]),bf=(0,se.useMemo)(()=>{let B=Oa(Array.from(oo.values(),ee=>ee.insertions+ee.deletions),1);return Array.from(oo,([ee,Ee])=>{let tt=Ee.insertions+Ee.deletions,jn=uT(tt,B);return{index:ee,top:tt===0?0:jn*Ee.deletions/tt,bottom:tt===0?0:jn*Ee.insertions/tt}}).filter(ee=>ee.top+ee.bottom>0)},[oo]),qa=(0,se.useMemo)(()=>Km(bf.map(B=>({index:B.index,intensity:1}))),[bf]),X0=(0,se.useMemo)(()=>Km(yf),[yf]),Ep=(0,se.useMemo)(()=>Km(Yu),[Yu]),wp=(0,se.useRef)(l);(0,se.useEffect)(()=>{l===null||l===wp.current||(wp.current=l,Ur())},[l]);let Ku=`${be}-${Ga.current}-${Wu}`,Wa=(0,se.useMemo)(()=>[...Ae.mounted?[{id:"commits",points:K0,generation:Ku,leaving:Ae.leaving}]:[],...Ct.mounted?[{id:"issues",points:xp,generation:Ku,leaving:Ct.leaving}]:[]],[K0,xp,Ae,Ct,Ku]),Xu=i.mode==="scrub"&&i.asOfTime!==null?i.asOfTime>=He.earliest&&i.asOfTime<=He.latest?He.fractionForTime(i.asOfTime):null:Vu?1:null,Q0=i.mode==="scrub"&&i.asOfTime!==null?i.asOfTime<He.earliest?0:i.asOfTime>He.latest?null:He.fractionForTime(i.asOfTime):null,Cp=B=>{let ee=De.current;if(!ee)return 0;let Ee=ee.getBoundingClientRect();return pn((B-Ee.left)/Math.max(1,Ee.width),0,1)},Qo=(B,ee)=>{if(!s||w||!aT(He))return;let Ee=He.fractionToTime(B);if(Ee===Le.current)return;let tt=Date.now();!ee&&tt-J.current<fQ||(J.current=tt,Le.current=Ee,r(Ee))};(0,se.useEffect)(()=>{i.mode!=="scrub"&&(Le.current=null)},[i.mode]);let Z0=()=>{Wt.current=!1;let B=Ht.current;Ht.current=null;let ee=Wn.current;Wn.current=null;let Ee=st.current,tt=Ke.current;if(st.current=null,Ke.current=null,Ee!==null){Qo(Ee,!0),Rt(null),Ve(null);return}if(tt===null)return;let{from:jn,to:so}=tt;Ve(null);let kf=De.current?.clientWidth??0;if(Math.abs(so-jn)*kf<zk){if(B!==null){d(B);return}if(ee!==null){f(ee);return}Qo(jn,!0);return}Br(He.fractionToTime(jn),He.fractionToTime(so))},ja=B=>{let ee=B.currentTarget.getBoundingClientRect();return pn((B.clientX-ee.left)/Math.max(1,ee.width),0,1)},vf=B=>pn(Math.floor(ja(B)*He.bucketCount),0,He.bucketCount-1),Sf=B=>B!==null&&B<He.bucketCount?He.bucketTimeAt(B):void 0,kp=B=>(B+.5)/He.bucketCount,xf=(0,se.useCallback)(B=>{if(B.commitSha){let ee=dr.find(Ee=>Ee.sha===B.commitSha);ee&&(Ba({commit:ee,fraction:B.fraction}),un(null));return}Ba(null),un({label:No(new Date(B.t)),detail:B.title,t:B.t,fraction:B.fraction})},[dr]),J0=(0,se.useCallback)(()=>{un(null),Ba(null)},[]),eS=(0,se.useCallback)(B=>{ro(B)},[]),tS=(0,se.useCallback)(()=>{ro(null)},[]),nS=(0,se.useMemo)(()=>{if(be!=="flow"||Fi===null)return null;let{path:B,t:ee,fraction:Ee}=Fi,tt=me.get(B.issue),jn=xT(B,ee),so=jn===null?null:Ss.strands[jn]?.title??null;return{label:No(new Date(ee)),rows:[tt?`${tt.ref} ${tt.title}`:B.issue,...so===null?[]:[`In ${so}`],...tt?.assignee?[`Assigned to ${tt.assignee.name}`]:[]],fraction:Ee}},[be,Fi,me,Ss]),Qu=Sf(lr),Ef=lr!==null?ju[lr]:void 0,wf=be==="flow"?nS:be==="even"?O&&Qu!==void 0&&Ef!==void 0?{label:Xm(Qu,Qu+He.bucketMs),rows:[gQ(Ef)],fraction:kp(lr),empty:Ef===0}:null:Ft?{label:Ft.label,rows:[Ft.detail],fraction:Ft.fraction}:null,ao=en!==null?oo.get(en):void 0,xs=Sf(en),iS=be==="flow"?null:be==="even"?ao&&xs!==void 0?{label:Xm(xs,xs+He.bucketMs),rows:[`${ao.count} commit${ao.count===1?"":"s"}`,he?`+${ao.insertions.toLocaleString()} \u2212${ao.deletions.toLocaleString()}`:`${ao.linesChanged.toLocaleString()} lines changed`],fraction:kp(en)}:null:ie?{label:No(new Date(ie.commit.time)),rows:[ie.commit.subject,`${eo(zm(ie.commit)).label} \u2022 ${ie.commit.linesChanged.toLocaleString()} lines`],fraction:ie.fraction}:null,Zu=(be==="even"?Qu??Sf(en):Fi?.t??Ft?.t??ie?.commit.time??(za!==null?He.fractionToTime(za):void 0))??null,rS=fT(He.span),Es=dT(He.span),Cf=(0,se.useMemo)(()=>hT(He.earliest,He.latest,Es),[He,Es]),lo=$e!==null,oS=$e&&{label:Xm(He.fractionToTime(Math.min($e.from,$e.to)),He.fractionToTime(Math.max($e.from,$e.to))),rows:["Release to zoom the window to this stretch"],fraction:($e.from+$e.to)/2},aS=s?zT(e)?"Play this window of the board's history":e&&e.events.length===0&&e.buckets.length>0?"Too many events in this window to play it \u2014 narrow the window":"Not enough history in this window to play":"Not while the connection is down";return(0,G8.jsx)(B8,{collapsed:io,onToggleCollapsed:()=>Wo(!io),canPlay:s&&!w&&zT(e),playTitle:aS,onPlay:C,logOpen:E,onChangeLogOpen:L,standDown:w,controls:{connected:s,scope:pe,zoomed:ue!==null,windowOnly:Je,following:R,onChangeFollowing:k,canFollow:s&&!w&&i.mode!=="scrub",followTitle:s?w?"A movie is playing":i.mode==="scrub"?"The board is in the past \u2014 put it back at now first":R?"Stop following the newest event":"Follow the newest event":"Offline \u2014 nothing is arriving",windowFilterable:ns(e),narrow:Ue,ticketFocus:$t,textFilter:S,onChangeTextFilter:p,layoutMode:be,showIssues:O,showCommits:H,linkedCommitsOnly:P,onChangeLinkedCommitsOnly:V,linesMeasure:he,onChangeLinesMeasure:Ce,allBoards:mt,onChangeScope:$u,onChangeWindowOnly:B=>m({windowOnly:B}),onChangeLayoutMode:Gu,onChangeShowIssues:N,onChangeShowCommits:F,onChangeAllBoards:qu,boardView:re,identitiesByAxis:ur,hiddenIdsByAxis:bs,axisStates:ys,narrowed:qT(ke),categoriesExpanded:z,expandedAxis:Oe,categoriesFiltered:K,isScrubbing:i.mode==="scrub",onReturnToLive:o,onToggleAxis:ms,onToggleIdentity:Yo,onOnlyIdentity:ps,onToggleCategoriesExpanded:()=>Z(!z),onSetExpandedAxis:Nt},chart:{scoped:Je&&Hu(pe,ue!==null)&&ns(e),trackRef:De,pageRef:ut,paging:hs,axis:He,layoutMode:be,animate:fe,windowKey:Ku,showIssues:O,showCommits:H,issueScatter:Ct,commitScatter:Ae,issueBars:yf,issueBarRange:X0,commitBars:Yu,commitBarRange:Ep,linesMeasure:he,lineBars:bf,lineBarRange:qa,scatterLayers:Wa,flowChart:Ss,flowFocusIssue:Sp,issueSeriesColor:Y0?.color??Ou(re),dragging:Va,rangeSelection:$e,commits:dr,hoveredCommitSha:ie?.commit.sha??null,hoveredBucketIndex:lo?null:lr,hoveredCommitBucketIndex:lo?null:en,hoveredSegment:Zu!==null&&!lo?Jd(Zu,rS):null,segmentBoundaries:Cf,hoveredGrain:Zu!==null&&!lo?Jd(Zu,Es):null,connected:s,thumbFraction:Ge??Xu,unappliedFrom:Ge??Q0,highlightEventId:c,trackWidthPx:De.current?.clientWidth??0,boardHint:lo?oS:wf,commitHint:lo?null:iS,on:{onPageEarlier:()=>jo(I+1),onPageLater:()=>jo(I-1),onPointerDown:B=>{B.currentTarget.setPointerCapture(B.pointerId);let ee=Cp(B.clientX);if(!Wt.current){Ke.current={from:ee,to:ee},Ve({from:ee,to:ee});return}st.current=ee,Rt(ee),Qo(ee,!0)},onPointerMove:B=>{let ee=Ke.current;if(st.current===null&&ee===null)return;let Ee=Cp(B.clientX);if(ee!==null){Ke.current={from:ee.from,to:Ee},Ve({from:ee.from,to:Ee});return}st.current=Ee,Rt(Ee),Qo(Ee,!1)},onPointerEnd:Z0,onGrabNeedle:()=>{Wt.current=!0},onTrackMouseMove:B=>{if(be==="even"){In(vf(B));return}Gt(ja(B))},onTrackMouseLeave:()=>{In(null),Gt(null)},onCommitTrackMouseEnter:()=>In(null),onCommitTrackMouseMove:B=>{B.stopPropagation(),bi(vf(B))},onCommitTrackMouseLeave:()=>bi(null),onScatterPointEnter:xf,onScatterPointLeave:J0,onFlowPathEnter:eS,onFlowPathLeave:tS,onPressFlowPath:B=>{Wn.current=B},onPressCommit:B=>{Ht.current=B}}}})};var cf=T(j(),1);var Ut=T(M(),1),$8=.02,V8=2,aR=9,q8=24,EQ=e=>({background:"transparent",border:`1px solid ${e?v.accent:v.line}`,color:e?v.accent:v.secondary,borderRadius:3,width:q8,height:q8,display:"inline-flex",alignItems:"center",justifyContent:"center",cursor:"pointer",flexShrink:0,padding:0,transition:"color 160ms ease, border-color 160ms ease"}),W8=({plan:e,playback:t,onExit:n})=>{let i=!_a(),r=(0,cf.useRef)(null),{progress:o,playing:a,done:l,speed:s,cursor:u,current:c,currentTime:d,totalCount:f,toggle:h,cycleSpeed:m,seekTo:y,beginSeek:S,endSeek:p}=t,g=(0,cf.useRef)(n);g.current=n;let b=(0,cf.useRef)(h);b.current=h,(0,cf.useEffect)(()=>{let C=w=>{let E=w.target,L=E?.tagName??"";if(!(E&&(E.isContentEditable||["INPUT","TEXTAREA","SELECT"].includes(L)))){if(w.key==="Escape"){w.preventDefault(),g.current();return}L!=="BUTTON"&&(w.key===" "||w.key==="Spacebar")&&(w.preventDefault(),b.current())}};return document.addEventListener("keydown",C),()=>document.removeEventListener("keydown",C)},[]);let x=C=>{let w=C.currentTarget.getBoundingClientRect();return pn((C.clientX-w.left)/Math.max(1,w.width),0,1)};return(0,Ut.jsxs)(Ut.Fragment,{children:[(0,Ut.jsx)("style",{children:kB}),(0,Ut.jsx)("div",{"data-testid":"theatre-vignette",style:{position:"fixed",inset:0,pointerEvents:"none",zIndex:40,background:"radial-gradient(120% 90% at 50% 45%, rgba(6,7,10,0) 35%, rgba(6,7,10,0.72) 100%)",animation:i?"epiqTheatreFade 320ms ease-out":void 0}}),(0,Ut.jsxs)("div",{"data-testid":"theatre-player",role:"group","aria-label":"History player",style:{position:"fixed",left:0,right:0,bottom:0,zIndex:50,display:"flex",flexDirection:"column",gap:9,padding:"11px 30px 13px",borderTop:`1px solid ${v.line}`,background:"rgba(13, 16, 22, 0.94)",backdropFilter:"blur(14px)",WebkitBackdropFilter:"blur(14px)",animation:i?"epiqTheatreRise 260ms ease-out":void 0},children:[(0,Ut.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:14},children:[(0,Ut.jsx)(Te,{testId:"theatre-toggle",title:l?"Play again":a?"Pause":"Play","aria-label":l?"Play again":a?"Pause":"Play",pressed:a,onClick:h,children:l?(0,Ut.jsx)(WH,{size:ge}):a?(0,Ut.jsx)(qH,{size:ge}):(0,Ut.jsx)(VH,{size:ge})}),(0,Ut.jsxs)("div",{"data-testid":"theatre-progress",role:"slider","aria-label":"Playback position","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(o*100),tabIndex:0,ref:r,onPointerDown:C=>{C.currentTarget.setPointerCapture(C.pointerId),S(),y(x(C))},onPointerMove:C=>{C.currentTarget.hasPointerCapture(C.pointerId)&&y(x(C))},onPointerUp:C=>{C.currentTarget.releasePointerCapture(C.pointerId),p()},onPointerCancel:p,onKeyDown:C=>{let w=C.key==="ArrowLeft"?-$8:C.key==="ArrowRight"?$8:null;w!==null&&(C.preventDefault(),y(o+w))},style:{position:"relative",flex:1,height:18,display:"flex",alignItems:"center",cursor:"pointer",touchAction:"none"},children:[(0,Ut.jsx)("div",{style:{position:"absolute",left:0,right:0,height:V8,borderRadius:999,background:"rgba(122, 157, 214, 0.22)"}}),(0,Ut.jsx)("div",{style:{position:"absolute",left:0,width:`${o*100}%`,height:V8,borderRadius:999,background:`linear-gradient(90deg, #b3a5ff, ${v.accent})`}}),(0,Ut.jsx)("div",{style:{position:"absolute",left:`${o*100}%`,width:aR,height:aR,marginLeft:-aR/2,borderRadius:"50%",background:v.accent,boxShadow:"0 0 5px rgba(118, 212, 255, 0.35)"}})]}),(0,Ut.jsxs)("button",{type:"button","data-testid":"theatre-speed",onClick:m,title:"Playback speed",style:{...EQ(!1),width:34,fontFamily:"inherit",fontSize:W.label,color:v.accent},children:[s,"\xD7"]}),(0,Ut.jsx)(Te,{testId:"theatre-exit",title:"Close the player","aria-label":"Close the history player",onClick:n,children:(0,Ut.jsx)(av,{size:ge})})]}),(0,Ut.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:12,fontSize:W.meta,minHeight:16},children:[(0,Ut.jsx)("span",{"data-testid":"theatre-time",style:{color:v.accent,fontVariantNumeric:"tabular-nums",flexShrink:0},children:No(new Date(d))}),(0,Ut.jsxs)("span",{"data-testid":"theatre-count",style:{color:v.dim2,fontVariantNumeric:"tabular-nums",flexShrink:0},children:[u+1,"/",f," edits"]}),(0,Ut.jsx)("span",{"data-testid":"theatre-caption",style:{color:v.secondary,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",animation:i?"epiqTheatreCaption 220ms ease-out":void 0},children:c?c.label:`Opening on the board before ${No(new Date(e.events[0].t))}`},c?.id??"start")]})]})]})};var Tt=T(j(),1);var dp=["time","kind","actor","diff","label"],lR={time:"Time",actor:"Actor",kind:"Type",diff:"Diff",label:"Label"},cp=e=>`epiq.eventLog.${e}`,wQ=e=>`epiq-log--no-${e}`,j8=e=>dp.filter(t=>!e[t]).map(wQ).join(" "),Y8=()=>{let[e,t]=_t(cp("time"),!0),[n,i]=_t(cp("actor"),!0),[r,o]=_t(cp("kind"),!0),[a,l]=_t(cp("diff"),!0),[s,u]=_t(cp("label"),!0),c={time:t,actor:i,kind:o,diff:l,label:u};return{fields:{time:e,actor:n,kind:r,diff:a,label:s},setField:(d,f)=>c[d](f)}};var CQ=110,kQ=48,K8=e=>Math.max(1,Math.floor((e-kQ)/CQ)),sR=(e,t)=>e.name<t.name?-1:e.name>t.name?1:0,X8=(e,t=Number.POSITIVE_INFINITY)=>{let n=new Map;for(let a of e){if(!a.actor)continue;let l=n.get(a.actor.name);l?l.lines++:n.set(a.actor.name,{name:a.actor.name,lines:1})}let i=[...n.values()],r=({name:a})=>({name:a});if(i.length<=t)return i.sort(sR).map(r);let o=i.sort((a,l)=>l.lines-a.lines||sR(a,l)).slice(0,Math.max(1,t-1)).sort(sR);return[...o.map(r),{name:`+${i.length-o.length} more`,others:!0}]},Q8=e=>new Map(e.map((t,n)=>[t.name,n])),Z8=(e,t,n)=>{if(!e.actor)return null;let i=n.get(e.actor.name);if(i!==void 0)return i;let r=t.length-1;return t[r]?.others?r:null},TQ="epiq.eventLog.split",J8=()=>_t(TQ,!1);var fp=T(M(),1),uR=({field:e,fields:t,spoken:n,onChangeField:i})=>(0,fp.jsx)(Ma,{testId:`log-field-${e}`,label:lR[e],checked:t[e]&&!n,disabled:n,activeColor:v.dim,title:n?"The lane says who":`${t[e]?"Hide":"Show"} the ${lR[e].toLowerCase()} on each line`,onChange:r=>i(e,r)}),eU=({fields:e,onChangeField:t,spokenField:n})=>(0,fp.jsx)(Pl,{label:"View options",testId:"log-fields-menu",title:"Choose what each line shows",chevronSize:14,popupRole:"group",children:()=>dp.map(i=>(0,fp.jsx)(Ir,{children:(0,fp.jsx)(uR,{field:i,fields:e,spoken:i===n,onChangeField:t})},i))});var df=T(M(),1),tU=({size:e=16})=>(0,df.jsxs)("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,df.jsx)("rect",{x:"3",y:"4",width:"18",height:"16",rx:"2"}),(0,df.jsx)("line",{x1:"9",y1:"4",x2:"9",y2:"20"}),(0,df.jsx)("line",{x1:"15",y1:"4",x2:"15",y2:"20"})]});var Nr=T(j(),1),nU=({storageKey:e,fallback:t,min:n,max:i,grows:r})=>{let[o,a]=(0,Nr.useState)(()=>{let m=Number(localStorage.getItem(e));return Number.isFinite(m)&&m>=n?m:t}),[l,s]=(0,Nr.useState)(!1),u=(0,Nr.useRef)(o);(0,Nr.useEffect)(()=>{u.current=o},[o]);let c=(0,Nr.useRef)(null),d=(0,Nr.useCallback)(m=>{let y=c.current;if(!y)return;let S=r==="right"?m.clientX-y.pointer:y.pointer-m.clientX;a(Math.min(y.max,Math.max(n,y.size+S)))},[r,n]),f=(0,Nr.useCallback)(()=>{c.current=null,s(!1),document.removeEventListener("pointermove",d),document.removeEventListener("pointerup",f),document.body.style.cursor="",document.body.style.userSelect="",localStorage.setItem(e,String(u.current))},[d,e]);return(0,Nr.useEffect)(()=>()=>{c.current&&f()},[f]),{width:o,dragging:l,onPointerDown:m=>{m.preventDefault(),c.current={pointer:m.clientX,size:u.current,max:i()},s(!0),document.addEventListener("pointermove",d),document.addEventListener("pointerup",f),document.body.style.cursor="ew-resize",document.body.style.userSelect="none"}}};var ff=T(M(),1),iU=({size:e=14})=>(0,ff.jsxs)("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,ff.jsx)("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"}),(0,ff.jsx)("polyline",{points:"15 3 21 3 21 9"}),(0,ff.jsx)("line",{x1:"10",y1:"14",x2:"21",y2:"3"})]});var at=T(M(),1),RQ=440,LQ=280,AQ=1e3,IQ=.6,MQ="epiq.eventLog.width",DQ=xd,_Q=400,OQ=gi*2,HQ=({fields:e,onChangeField:t,split:n,onChangeSplit:i,canSplit:r,folded:o,children:a})=>(0,at.jsxs)("div",{"data-testid":"event-log-header",style:{display:"flex",alignItems:"center",gap:12,flexShrink:0,height:DQ,padding:`${8}px ${ep}px ${8}px 30px`,borderBottom:`1px solid ${v.line}`},children:[o?(0,at.jsx)(eU,{fields:e,onChangeField:t,spokenField:n&&r?"actor":null}):dp.map(l=>(0,at.jsx)(uR,{field:l,fields:e,spoken:l==="actor"&&n&&r,onChangeField:t},l)),(0,at.jsxs)("span",{style:{marginLeft:"auto",display:"inline-flex",alignItems:"center"},children:[(0,at.jsx)(Te,{testId:"log-split",title:r?"Give each actor a lane of their own":"Nobody signed these lines","aria-label":"Split",pressed:n&&r,disabled:!r,onClick:()=>i(!n),children:(0,at.jsx)(tU,{size:ge})}),a]})]}),NQ=({lanes:e})=>(0,at.jsx)("div",{"data-testid":"log-lane-heads",className:Jm,children:e.map(t=>(0,at.jsx)("span",{title:t.name,children:eo(t.name).label},t.name))}),FQ=({entries:e,moment:t,bottomClearance:n,onOpen:i,at:r=null,followedLine:o=null,eventsUnlisted:a=!1,onPinnedChange:l,onHoverEvent:s,layout:u="panel",revealed:c=!0,settled:d=!0,onPopOut:f,onDock:h})=>{let m=!_a(),{fields:y,setField:S}=Y8(),[p,g]=J8(),b=(0,Tt.useRef)(null),x=(0,Tt.useRef)(null),[C,w]=(0,Tt.useState)(()=>new Map),[E,L]=(0,Tt.useState)(()=>new Set),R=(0,Tt.useMemo)(()=>b0(e),[e]),k=(0,Tt.useMemo)(()=>y0(R),[R]),O=e[e.length-1]?.id??null,[N,H]=(0,Tt.useState)(null),[F,P]=(0,Tt.useState)(0),V=(0,Tt.useMemo)(()=>X8(e,K8(F)),[e,F]),U=(0,Tt.useMemo)(()=>Q8(V),[V]),X=p&&V.length>0,ae=(0,Tt.useMemo)(()=>N===null?Math.min(tB,R.length):nB(R,N),[R,N]),A=(0,Tt.useRef)(!0),me=()=>{let Q=b.current;if(!Q)return;let re=A.current;A.current=Q.scrollHeight-Q.scrollTop-Q.clientHeight<=OQ,re!==A.current&&l?.(A.current)};(0,Tt.useEffect)(()=>{l?.(A.current)},[l]),(0,Tt.useLayoutEffect)(()=>{let Q=b.current;if(!Q)return;let re=()=>{let Ue=Q.clientHeight-n-gi*2;H(Math.max(1,Math.floor(Ue/gi))),P(Q.clientWidth)};re();let fe=new ResizeObserver(re);return fe.observe(Q),()=>fe.disconnect()},[n]);let pe=(0,Tt.useRef)(null),I=()=>{let Q=pe.current,re=x.current;!Q||!re||Q.offsetTop<re.offsetTop+re.offsetHeight||(Q.style.top="0px",Q.style.opacity="0")};(0,Tt.useLayoutEffect)(()=>{let Q=b.current;!Q||!A.current||(I(),Q.scrollTop=Q.scrollHeight)},[O,R.length,C,ae]),(0,Tt.useLayoutEffect)(()=>{let Q=b.current;Q&&(A.current=!0,l?.(!0),I(),Q.scrollTop=Q.scrollHeight)},[t,l]);let ue=(0,Tt.useRef)(new Set);(0,Tt.useEffect)(()=>{let Q=x.current,re=ue.current,fe=R.flatMap((De,J)=>MT(R,J,C,ae)?[De.key,...De.entries.map(Le=>Le.id)]:[De.key]),Ue=fe.filter(De=>!re.has(De)).length;ue.current=new Set(fe),!(!Q||!m||O===null||Ue===0||!A.current)&&Q.animate(rB(Ue),oB)},[O,m]);let be=Q=>{let re=pe.current;if(!re)return;let fe=RT(Q);fe&&(re.style.top=`${fe.offsetTop}px`),re.style.opacity=fe?"1":"0",fe&&X?(re.style.right="auto",re.style.left=`${fe.offsetLeft+fe.offsetWidth-re.offsetWidth}px`):X||(re.style.right="",re.style.left="")},ke=nU({storageKey:MQ,fallback:RQ,min:LQ,max:()=>Math.min(AQ,window.innerWidth*IQ),grows:"right"}),Je=u==="window";return(0,at.jsxs)("aside",{"data-testid":"event-log","data-settled":d?"true":"false","aria-live":"off",style:{position:"relative",width:Je?"100%":c?ke.width:0,flexShrink:0,minHeight:0,display:"flex",flexDirection:"column",overflow:d?void 0:"hidden",transition:Je||ke.dragging||!m?void 0:`width ${Hr}ms ease`,borderRight:Je?"none":`1px solid ${v.edgeOnChrome}`,boxShadow:Je?void 0:"10px 0 24px rgba(0, 0, 0, 0.45)",background:v.chrome,[OT]:V.length},children:[(0,at.jsx)("style",{children:v0}),!Je&&(0,at.jsx)(Nb,{edge:"right",active:ke.dragging,onPointerDown:ke.onPointerDown,testId:"event-log-resize"}),(0,at.jsxs)("div",{style:{width:Je?"100%":ke.width,flex:1,minHeight:0,display:"flex",flexDirection:"column"},children:[(0,at.jsxs)(HQ,{fields:y,onChangeField:S,split:p,onChangeSplit:g,canSplit:V.length>0,folded:F>0&&F<_Q,children:[f&&(0,at.jsx)(Te,{testId:"log-pop-out",title:"Open the log in its own window",onClick:f,children:(0,at.jsx)(iU,{size:ge})}),h&&(0,at.jsx)(Te,{testId:"log-dock",title:"Put the log back beside the board",onClick:h,children:(0,at.jsx)(N0,{size:ge})})]}),(0,at.jsxs)("div",{ref:b,className:`epiq-log-pane ${j8(y)} ${X?Nu:""}`.replace(/\s+/g," ").trim(),onScroll:me,onClick:Q=>{let re=Yz(Q.target);re&&i(re)},onMouseOver:Q=>{be(Q.target),s?.(Q.target.closest("[data-event-id]")?.getAttribute("data-event-id")??null)},onMouseLeave:()=>{be(null),s?.(null)},"data-testid":"event-log-scroll",style:{flex:1,minHeight:0,overflowY:"auto",overflowX:"hidden",position:"relative",display:"flex",flexDirection:"column",padding:`0 ${ep}px ${n+gi*2}px 30px`},children:[(0,at.jsxs)("span",{ref:pe,className:g0,"data-testid":"log-row-arrow","aria-hidden":"true",children:[(0,at.jsx)("span",{style:{fontSize:9,fontWeight:600,letterSpacing:.5,textTransform:"uppercase"},children:"View"}),(0,at.jsx)(Jv,{size:11})]}),X&&(0,at.jsx)(NQ,{lanes:V}),(0,at.jsxs)("div",{ref:x,style:{marginTop:"auto"},children:[a&&(0,at.jsx)("div",{"data-testid":"log-events-unlisted",style:{display:"flex",alignItems:"center",gap:6,margin:`4px ${ep}px 8px`,padding:"5px 8px",borderLeft:`2px solid ${v.dim2}`,color:v.dim2,fontSize:W.meta,lineHeight:1.4},children:"Too many events in this window to list one by one \u2014 narrow the window to read them. The chart above still counts them all."}),R.map((Q,re)=>{let fe=MT(R,re,C,ae),{shown:Ue,hidden:De}=iB(Q,E.has(Q.key));return(0,at.jsxs)("div",{style:y.actor&&!X?{[is]:k[re]}:void 0,children:[(0,at.jsx)(S0,{label:Q.label,count:Q.entries.length,open:fe,onToggle:()=>w(J=>{let Le=new Map(J);return Le.set(Q.key,!fe),Le})}),fe&&(0,at.jsxs)("div",{className:_T,children:[De>0&&(0,at.jsx)(x0,{hidden:De,label:Q.label,onExpand:()=>L(J=>new Set(J).add(Q.key))}),Ue.map(J=>(0,at.jsx)(E0,{entry:J,showLabel:y.label,followed:J.id===o,lane:X?Z8(J,V,U):void 0},J.id))]})]},Q.key)})]})]})]})]})},z0=(0,Tt.memo)(FQ);var hp=T(M(),1),rU=()=>(0,hp.jsxs)("div",{"data-testid":"follow-banner",style:{display:"flex",alignItems:"center",justifyContent:"center",gap:8,padding:"6px 12px",borderTop:`2px solid ${v.accent}`,color:v.primary,fontSize:11,letterSpacing:.3,pointerEvents:"none"},children:[(0,hp.jsx)("strong",{style:{color:v.accent,letterSpacing:.6},children:"LIVE"}),(0,hp.jsx)("span",{children:"The board navigates on events. Click anywhere to opt out."})]});var oU=T(j(),1),aU="epiq.aside.dock",PQ=()=>localStorage.getItem(aU)==="bottom"?"bottom":"right",lU=()=>{let[e,t]=(0,oU.useState)(PQ);return[e,n=>{t(n),localStorage.setItem(aU,n)}]};var Ni=T(j(),1);var zQ=(e,t)=>{let n=e.toLowerCase(),i=[],r=0;for(let o of t){let a=n.indexOf(o,r);if(a===-1)return null;i.push(a),r=a+1}return i},BQ=(e,t,n)=>{let i=e.toLowerCase().startsWith(t)?1e3:0,r=0;for(let o=1;o<n.length;o+=1)n[o]===n[o-1]+1&&(r+=1);return i+r*10-(n[0]??0)},cR=(e,t,n={})=>{let{recentIds:i=[],rank:r=()=>0,limit:o}=n,a=t.trim().toLowerCase(),l=u=>o===void 0?u:u.slice(0,o);if(!a){let u=new Map(i.map((d,f)=>[d,i.length-f])),c=[...e].map((d,f)=>({item:d,hits:[],score:0,index:f})).sort((d,f)=>{let h=r(d.item)-r(f.item);if(h!==0)return h;let m=(u.get(f.item.id)??0)-(u.get(d.item.id)??0);return m!==0?m:d.index-f.index});return l(c.map(({item:d,hits:f,score:h})=>({item:d,hits:f,score:h})))}let s=e.flatMap(u=>{let c=zQ(u.title,a);return c?[{item:u,hits:c,score:BQ(u.title,a,c)}]:[u.id,...u.keywords??[]].some(f=>f.toLowerCase().includes(a))?[{item:u,hits:[],score:0}]:[]});return l(s.sort((u,c)=>{let d=r(u.item)-r(c.item);return d!==0?d:c.score-u.score}))};var Fr={PALETTE:"?",EXIT:"exit",INIT:"init",OPEN:"open",HELP:"help",NEW:"new",TAG:"tag",UNTAG:"untag",MOVE:"move",PEEK:"peek",REPLAY:"replay",FILTER:"filter",ASSIGN:"assign",UNASSIGN:"unassign",DELETE:"delete",CLOSE_ISSUE:"close",RE_OPEN_ISSUE:"reopen",COMMENT:"comment",CONFIG:"config",EDIT:"edit",YANK:"yank",SYNC:"sync",EXPORT:"export",NONE:""};var sU=e=>e.issue?null:"Open a ticket first",mp=e=>e.connected?e.scrubbing?"Read-only while viewing history":null:"Not connected",zu=e=>mp(e)??sU(e),UQ=e=>{let t=mp(e);return t||(e.board?e.board.readonly?"This board is read-only":null:"No board on screen")},uU=()=>[{id:Fr.NEW,title:"New ticket",group:"Board",keywords:["create","add","issue"],unavailable:mp,run:e=>e.handlers.createIssue()},{id:"gui:search",title:"Search all tickets",group:"Board",keywords:["search","find","goto","jump","filter"],unavailable:e=>e.tickets.length?null:"No tickets to search",getArguments:e=>e.tickets.map(t=>({id:t.id,title:t.title,keywords:[t.ref],hint:`${t.boardTitle} \xB7 ${t.ref}`})),run:(e,t)=>{let n=e.tickets.find(i=>i.id===t?.id);n&&e.handlers.openIssue(n.id,n.boardRef)}},{id:"gui:swimlane",title:"New swimlane",group:"Board",keywords:["column","lane","create"],unavailable:mp,run:e=>e.handlers.createSwimlane()},{id:"gui:board",title:"New board",group:"Board",keywords:["create","add","project","another"],unavailable:mp,run:e=>e.handlers.createBoard()},{id:"gui:board:rename",title:"Rename board",group:"Board",keywords:["title","edit","name"],unavailable:UQ,run:e=>e.handlers.renameBoard()},{id:Fr.COMMENT,title:"Comment on ticket",group:"Ticket",unavailable:zu,run:e=>{e.issue&&e.handlers.commentOnIssue(e.issue.id)}},{id:Fr.TAG,title:"Add a tag",group:"Ticket",keywords:["label"],unavailable:zu,getArguments:e=>{let t=new Set(e.issue?.tags.map(n=>n.id));return e.tags.filter(n=>!t.has(n.id)).map(n=>({id:n.id,title:n.name,color:n.color}))},freeTextArgument:e=>e.trim()?{id:`new:${e.trim()}`,title:e.trim()}:null,run:(e,t)=>{e.issue&&t&&e.handlers.addIssueTag(e.issue.id,t.title)}},{id:Fr.UNTAG,title:"Remove a tag",group:"Ticket",keywords:["label"],unavailable:e=>zu(e)??(e.issue?.tags.length?null:"This ticket has no tags"),getArguments:e=>(e.issue?.tags??[]).map(t=>({id:t.id,title:t.name,color:t.color})),run:(e,t)=>{e.issue&&t&&e.handlers.removeIssueTag(e.issue.id,t.id)}},{id:Fr.ASSIGN,title:"Assign someone",group:"Ticket",keywords:["owner","who"],unavailable:zu,getArguments:e=>{let t=new Set(e.issue?.assignees.map(n=>n.id));return e.contributors.filter(n=>!n.isRemoved&&!t.has(n.id)).map(n=>({id:n.id,title:n.name,color:n.color,hint:n.isSelf?"you":void 0}))},run:(e,t)=>{e.issue&&t&&e.handlers.addIssueAssignee(e.issue.id,t.id)}},{id:Fr.UNASSIGN,title:"Unassign someone",group:"Ticket",unavailable:e=>zu(e)??(e.issue?.assignees.length?null:"Nobody is assigned"),getArguments:e=>(e.issue?.assignees??[]).map(t=>({id:t.id,title:t.name,color:t.color})),run:(e,t)=>{e.issue&&t&&e.handlers.removeIssueAssignee(e.issue.id,t.id)}},{id:Fr.CLOSE_ISSUE,title:"Close ticket",group:"Ticket",keywords:["done","resolve"],unavailable:e=>zu(e)??(e.issue?.isClosed?"Already closed":null),run:e=>{e.issue&&e.handlers.closeIssue(e.issue.id)}},{id:Fr.RE_OPEN_ISSUE,title:"Reopen ticket",group:"Ticket",unavailable:e=>zu(e)??(e.issue?.isClosed?null:"This ticket is open"),run:e=>{e.issue&&e.handlers.reopenIssue(e.issue.id)}},{id:Fr.YANK,title:"Copy ticket reference",group:"Ticket",keywords:["yank","clipboard","ref"],unavailable:sU,run:e=>{e.issue&&e.handlers.copyRef(e.issue.ref)}},{id:Fr.SYNC,title:"Sync with the remote",group:"Board",keywords:["push","pull","git"],unavailable:e=>e.connected?null:"Not connected",run:e=>e.handlers.sync()},{id:Fr.REPLAY,title:"Play the board back",group:"History",keywords:["replay","theatre","movie"],unavailable:e=>e.connected?null:"Not connected",run:e=>e.handlers.startTheatre()},{id:"gui:live",title:"Return to live",group:"History",keywords:["now","present","exit history"],unavailable:e=>e.scrubbing?null:"The board is already live",run:e=>e.handlers.returnToLive()},{id:"gui:log",title:"Toggle the event log",group:"View",keywords:["history","panel"],unavailable:()=>null,run:e=>e.handlers.toggleLog()}],cU=e=>t=>t.unavailable(e)===null?0:1;var yi=T(M(),1),GQ=({text:e,hits:t})=>{if(t.length===0)return(0,yi.jsx)(yi.Fragment,{children:e});let n=new Set(t);return(0,yi.jsx)(yi.Fragment,{children:[...e].map((i,r)=>n.has(r)?(0,yi.jsx)("span",{style:{color:v.accent},children:i},r):(0,yi.jsx)("span",{children:i},r))})},dU=({title:e,hits:t,group:n,reason:i,hint:r,color:o,selected:a,hasArguments:l,onHover:s,onRun:u})=>(0,yi.jsxs)("button",{type:"button",role:"option","aria-selected":a,"aria-disabled":!!i,title:i??void 0,onMouseMove:s,onClick:u,style:{display:"flex",alignItems:"center",gap:8,width:"100%",textAlign:"left",background:a?v.hover:"transparent",border:"none",borderLeft:`2px solid ${a?v.accent:"transparent"}`,color:i?v.dim:v.primary,fontSize:W.ui,fontFamily:"inherit",padding:"7px 12px",cursor:i?"default":"pointer"},children:[o&&(0,yi.jsx)("span",{"aria-hidden":!0,style:{width:7,height:7,borderRadius:2,background:o,flexShrink:0,opacity:i?.4:1}}),(0,yi.jsxs)("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:[(0,yi.jsx)(GQ,{text:e,hits:t}),l&&(0,yi.jsx)("span",{style:{color:v.dim},children:" \u2026"})]}),(0,yi.jsx)("span",{style:{fontSize:W.label,color:v.dim,flexShrink:0,whiteSpace:"nowrap"},children:i??r??n})]});var no=T(M(),1),$Q=8,dR=50,fU=({commands:e,context:t,recentIds:n,onRun:i,onClose:r})=>{let[o,a]=(0,Ni.useState)(""),[l,s]=(0,Ni.useState)(null),[u,c]=(0,Ni.useState)(0),d=(0,Ni.useRef)(null),f=(0,Ni.useRef)(null),h=(0,Ni.useMemo)(()=>l?[]:cR(e,o,{recentIds:n,rank:cU(t),limit:dR}),[l,o,e,n,t]),m=(0,Ni.useMemo)(()=>{if(!l)return[];let b=cR(l.options,o,{limit:dR}),x=l.command.freeTextArgument?.(o),C=b.some(w=>w.item.title.toLowerCase()===o.trim().toLowerCase());return x&&!C?[...b,{item:{...x,hint:"new"},hits:[],score:0}]:b},[l,o]),y=l?m:h,S=y.length>=dR;(0,Ni.useEffect)(()=>{c(0)},[o,l]),(0,Ni.useEffect)(()=>{d.current?.focus()},[l]),(0,Ni.useEffect)(()=>{f.current?.children[u]?.scrollIntoView({block:"nearest"})},[u]);let p=b=>{let x=y[b];if(!x)return;if(l){l.command.run(t,x.item),i(l.command),r();return}let C=x.item;if(C.unavailable(t))return;let w=C.getArguments?.(t);if(w){s({command:C,options:w}),a("");return}C.run(t),i(C),r()};return(0,no.jsx)("div",{"data-testid":"command-palette",style:{position:"fixed",inset:0,background:"rgba(0, 0, 0, 0.35)",backdropFilter:"blur(1px)",display:"flex",alignItems:"flex-start",justifyContent:"center",paddingTop:"12vh",zIndex:1100},onMouseDown:r,children:(0,no.jsxs)("div",{onMouseDown:b=>b.stopPropagation(),onKeyDown:b=>{if(b.key==="Escape")return b.preventDefault(),l?s(null):r();if(b.key==="ArrowDown"||b.key==="n"&&b.ctrlKey)return b.preventDefault(),c(x=>Math.min(x+1,y.length-1));if(b.key==="ArrowUp"||b.key==="p"&&b.ctrlKey)return b.preventDefault(),c(x=>Math.max(x-1,0));if(b.key==="Enter")return b.preventDefault(),p(u);if(b.key==="Backspace"&&l&&o==="")return b.preventDefault(),s(null)},style:{width:"min(560px, calc(100vw - 32px))",background:v.panel,border:`1px solid ${v.edge}`,borderRadius:8,boxShadow:"0 16px 48px rgba(0, 0, 0, 0.55)",overflow:"hidden"},children:[(0,no.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"10px 12px",borderBottom:`1px solid ${v.line}`},children:[l&&(0,no.jsx)("span",{style:{fontSize:W.label,color:v.accent,border:`1px solid ${v.line}`,borderRadius:4,padding:"2px 6px",flexShrink:0},children:l.command.title}),(0,no.jsx)("input",{ref:d,autoFocus:!0,value:o,onChange:b=>a(b.target.value),placeholder:l?"Pick one\u2026":"Type a command\u2026","aria-label":"Command palette",style:{flex:1,background:"transparent",border:"none",outline:"none",color:v.primary,fontSize:W.prose,fontFamily:"inherit"}})]}),(0,no.jsxs)("div",{ref:f,role:"listbox",style:{maxHeight:$Q*34,overflowY:"auto",padding:"4px 0"},children:[y.length===0&&(0,no.jsxs)("div",{style:{padding:"12px",fontSize:W.ui,color:v.dim},children:["Nothing matches \u201C",o,"\u201D"]}),y.map((b,x)=>{let C=l?null:b.item,w=l?b.item:null;return(0,no.jsx)(dU,{title:C?.title??w?.title??"",hits:b.hits,group:C?.group,reason:C?.unavailable(t),hint:w?.hint,color:w?.color,hasArguments:!!C?.getArguments,selected:x===u,onHover:()=>c(x),onRun:()=>p(x)},b.item.id)}),S&&(0,no.jsx)("div",{style:{padding:"6px 12px",fontSize:W.label,color:v.dim},children:"More matches \u2014 keep typing to narrow"})]})]})})};var hU=T(j(),1),mU="epiq.gui.recentCommands",pU=6,VQ=()=>{try{let e=JSON.parse(localStorage.getItem(mU)??"[]");return Array.isArray(e)?e.filter(t=>typeof t=="string").slice(0,pU):[]}catch{return[]}},qQ=(e,t)=>[t,...e.filter(n=>n!==t)].slice(0,pU),gU=()=>{let[e,t]=(0,hU.useState)(VQ);return{ids:e,remember:n=>{t(i=>{let r=qQ(i,n);try{localStorage.setItem(mU,JSON.stringify(r))}catch{}return r})}}};var B0=T(j(),1),WQ=e=>{let t=e;if(!t)return!1;let n=t.tagName;return n==="INPUT"||n==="TEXTAREA"||n==="SELECT"||t.isContentEditable},yU=()=>{let[e,t]=(0,B0.useState)(!1);return(0,B0.useEffect)(()=>{let n=i=>{let r=i.key==="k"&&(i.metaKey||i.ctrlKey),o=i.key===":"&&!i.metaKey&&!i.ctrlKey;!r&&!o||!e&&WQ(i.target)||e&&!r||(i.preventDefault(),t(!e))};return document.addEventListener("keydown",n),()=>document.removeEventListener("keydown",n)},[e]),{open:e,setOpen:t}};var jQ=(e,t)=>{if(e.length===0)return{at:"start"};if(t==="end")return{at:"end"};let n=Math.max(0,Math.min(t,e.length));return n===0?{at:"before",sibling:e[0].id}:n>=e.length?{at:"end"}:{at:"before",sibling:e[n].id}},YQ=(e,t,n,i)=>{let r=null,o=null,a=e.boards.flatMap(u=>u.swimlanes).find(u=>u.id===n);for(let u of e.boards){for(let c of u.swimlanes){let d=c.issues.find(f=>f.id===t);if(d){r=d,o=c.id;break}}if(r)break}if(!r||!o||!a)return null;let l=o===a.id?a.issues.filter(u=>u.id!==t):a.issues,s=jQ(l,i);return{movedIssue:r,position:s,sourceParentId:o,targetParentId:a.id}},KQ=(e,t,n,i,r)=>({...e,boards:e.boards.map(o=>({...o,swimlanes:o.swimlanes.map(a=>{let l=a.issues.filter(c=>c.id!==t);if(a.id!==n)return{...a,issues:l};let s=[...l],u=i==="end"?s.length:Math.max(0,Math.min(i,s.length));return s.splice(u,0,r),{...a,issues:s}})}))}),bU=(e,t,n)=>(i,r,o)=>{if(!e)return;let a=e;for(let[s,u]of i.entries()){let c=o==="end"?"end":o+s,d=YQ(a,u,r,c);d&&(a=KQ(a,u,r,c,d.movedIssue),n("issues:move",{issueId:u,parentId:r,position:d.position}))}let l=a;t(s=>s&&l)};var XQ="move.node",vU=({createdAt:e,enteredLaneAt:t,now:n,history:i,lanes:r,currentLaneId:o})=>{let a=new Map(r.map((u,c)=>[u.id,c])),l=0,s=0;for(let u of i){if(u.action!==XQ||!u.parentId)continue;let c=a.get(u.parentId);c!==void 0&&s!==null&&c<s&&l++,c!==void 0&&(s=c)}return{ageMs:Math.max(0,n-e),timesSentBack:l,inLaneMs:Math.max(0,n-t),laneTitle:r.find(u=>u.id===o)?.title??""}};var fR=e=>e.trim().toLocaleLowerCase(),QQ=(e,t)=>fR(e).includes(fR(t)),hR=(e,t)=>fR(t)?XP(e.id,t)||QQ(e.title,t):!0;var dt=e=>{if(e)return typeof e=="object"&&e!==null&&"value"in e?e.value??void 0:typeof e=="object"&&e!==null&&"content"in e&&e.content?.[0]?.text?JSON.parse(e.content[0].text).value:e},SU=(e,t)=>{let n=e.find(o=>o.id===t);if(n)return n;let i=t.replace(/-/g,"").toUpperCase(),r=e.filter(o=>o.ref===i);return r.length===1?r[0]??null:null},xU=(e,t)=>SU(e.boards.flatMap(n=>n.swimlanes.flatMap(i=>i.issues)),t),EU=(e,t)=>SU(e.boards,t),mR=(e,t,n)=>({...e,boards:e.boards.map(i=>({...i,swimlanes:i.swimlanes.flatMap(r=>{if(r.id!==t)return[r];let o=n(r);return o?[o]:[]})}))}),$o=(e,t,n)=>({...e,boards:e.boards.map(i=>({...i,swimlanes:i.swimlanes.map(r=>({...r,issues:r.issues.map(o=>o.id===t?n(o):o)}))}))});var pp=T(j(),1);var ZQ=[],JQ=(e,t)=>!t||e.board===null||e.board===t,eZ=(e,t,n)=>e&&t&&n?.capped===!0,tZ=(e,t,n)=>e?t??-1/0:n?.mode==="scrub"&&n.asOfTime!==null?n.asOfTime:1/0,wU=({open:e,timeline:t,boardId:n,commits:i,selection:r,selectedIssueId:o,queryIssueIds:a,linkedCommitsOnly:l,boardIssueIdByRef:s,issueIdByRef:u,showIssues:c,showCommits:d,playing:f,playheadTime:h,timeTravel:m})=>{let{only:y,ticketOnly:S}=r,p=Wm(y),g=S&&o!==null?o:null,b=(0,pp.useMemo)(()=>Ym(g,a),[g,a]),x=(0,pp.useMemo)(()=>{if(!e)return ZQ;let L=t?.events??[],R=_r(p),k=I0(Qk(t,R),rs(y,R));return Qz(c?L.filter(O=>JQ(O,n)&&ts(O,p,k,b)):[],d?O0(i,l,g!==null,_0({everyBoard:u,thisBoard:s,ticketFocus:g!==null}),b):[])},[e,t,n,i,p,y,g,b,l,s,u,c,d]),C=tZ(f,h,m),w=(0,pp.useMemo)(()=>eB(x,C,f),[x,C,f]),E=eZ(e,c,t);return(0,pp.useMemo)(()=>({entries:w,moment:C,eventsUnlisted:E}),[w,C,E])};var Bu=T(j(),1);var pR={line:null},nZ=(e,t)=>e.kind==="commit"||t.kind==="commit"?e.kind===t.kind&&e.kind==="commit"&&t.kind==="commit"&&e.sha===t.sha:e.issueId===t.issueId&&e.tab===t.tab,CU=({entries:e,newestId:t,mark:n,pinned:i,at:r})=>{let o=n.line===null;if(!o){if(t===null||t===n.line)return{open:null,mark:n};if(!i)return{open:null,mark:n}}let a=null;for(let l=e.length-1;l>=0;l--){let s=e[l];if(!s||!o&&s.id===n.line)break;let u=TT(s);if(u){a=u;break}}return a?r&&nZ(r,a)?{open:null,mark:{line:t}}:{open:a,mark:{line:t}}:{open:null,mark:{line:t}}};var kU=({following:e,live:t,pinned:n,entries:i,at:r,onOpen:o})=>{let[a,l]=(0,Bu.useState)(null),s=(0,Bu.useRef)(pR),u=i[i.length-1]?.id??null,c=(0,Bu.useRef)({entries:i,at:r,onOpen:o});return c.current={entries:i,at:r,onOpen:o},(0,Bu.useEffect)(()=>{if(!e){s.current=pR,l(null);return}if(!t)return;let d=c.current,f=CU({entries:d.entries,newestId:u,mark:s.current,pinned:n,at:d.at});s.current=f.mark,f.mark.line!==null&&l(f.mark.line),f.open&&d.onOpen(f.open,{replace:!0})},[e,t,u,n]),{followedLine:a}};var gR=T(j(),1),TU=T(j(),1),iZ='[data-testid="event-log"], [data-testid="live-toggle"]',RU=({logOpen:e,live:t,onOpenLog:n})=>{let[i,r]=(0,TU.useState)(!1);return(0,gR.useEffect)(()=>{(!t||!e)&&r(!1)},[t,e]),(0,gR.useEffect)(()=>{if(!i)return;let o=l=>l instanceof Element&&l.closest(iZ)!==null,a=l=>{o(l.target)||r(!1)};return document.addEventListener("click",a,!0),document.addEventListener("dragstart",a,!0),()=>{document.removeEventListener("click",a,!0),document.removeEventListener("dragstart",a,!0)}},[i]),{following:i,setFollowing:o=>{o&&!e&&n(),r(o)}}};var An=T(j(),1),yR="/log",rZ="epiq-log",oZ="popup=yes,width=520,height=760",bR=e=>typeof e=="object"&&e!==null,aZ=e=>bR(e)&&(e.kind==="commit"&&typeof e.sha=="string"||e.kind==="ticket"&&typeof e.issueId=="string"&&(e.tab==="comments"||e.tab==="overview")&&(e.comment===void 0||typeof e.comment=="string")),lZ=e=>{if(!bR(e))return null;switch(e.type){case"epiq-log:ready":return{type:"epiq-log:ready"};case"epiq-log:closed":return{type:"epiq-log:closed"};case"epiq-log:open":return aZ(e.destination)?{type:"epiq-log:open",destination:e.destination,replace:e.replace===!0}:null;case"epiq-log:pinned":return typeof e.pinned=="boolean"?{type:"epiq-log:pinned",pinned:e.pinned}:null;default:return null}},sZ=e=>bR(e)&&e.type==="epiq-log:lines"&&Array.isArray(e.entries)&&typeof e.moment=="number"?{type:"epiq-log:lines",entries:e.entries,moment:e.moment,followedLine:typeof e.followedLine=="string"?e.followedLine:null,eventsUnlisted:e.eventsUnlisted===!0}:null,LU=(e,t)=>t!==null&&e.origin===window.location.origin&&e.source===t,AU=({entries:e,moment:t,followedLine:n,eventsUnlisted:i,open:r,onOpen:o,onPinnedChange:a})=>{let[l,s]=(0,An.useState)(null),u=(0,An.useRef)({entries:e,moment:t,followedLine:n,eventsUnlisted:i});u.current={entries:e,moment:t,followedLine:n,eventsUnlisted:i};let c=(0,An.useRef)(o);c.current=o;let d=(0,An.useRef)(a);d.current=a;let f=(0,An.useCallback)((m,y)=>{let S={type:"epiq-log:lines",entries:y.entries,moment:y.moment,followedLine:y.followedLine,eventsUnlisted:y.eventsUnlisted};m.postMessage(S,window.location.origin)},[]),h=(0,An.useCallback)(()=>{let m=window.open(yR,rZ,oZ);s(m)},[]);return(0,An.useEffect)(()=>{if(!l)return;let m=p=>{if(!LU(p,l))return;let g=lZ(p.data);g&&(g.type==="epiq-log:ready"?f(l,u.current):g.type==="epiq-log:open"?c.current(g.destination,{replace:g.replace}):g.type==="epiq-log:pinned"?d.current(g.pinned):s(null))},y=window.setInterval(()=>{l.closed&&s(null)},1e3),S=()=>l.close();return window.addEventListener("message",m),window.addEventListener("pagehide",S),()=>{window.clearInterval(y),window.removeEventListener("message",m),window.removeEventListener("pagehide",S)}},[l,f]),(0,An.useEffect)(()=>{l&&f(l,{entries:e,moment:t,followedLine:n,eventsUnlisted:i})},[l,e,t,n,i,f]),(0,An.useEffect)(()=>{r||!l||(l.close(),s(null))},[r,l]),{poppedOut:l!==null&&r,popOut:h}},IU=()=>{let[e]=(0,An.useState)(()=>window.opener??null),[t,n]=(0,An.useState)(null);(0,An.useEffect)(()=>{if(!e)return;let o=s=>e.postMessage(s,window.location.origin),a=s=>{if(!LU(s,e))return;let u=sZ(s.data);u&&n(u)},l=()=>o({type:"epiq-log:closed"});return window.addEventListener("message",a),window.addEventListener("pagehide",l),o({type:"epiq-log:ready"}),()=>{window.removeEventListener("message",a),window.removeEventListener("pagehide",l)}},[e]);let i=(0,An.useCallback)((o,a)=>{e?.postMessage({type:"epiq-log:open",destination:o,replace:a?.replace===!0},window.location.origin)},[e]),r=(0,An.useCallback)(o=>{e?.postMessage({type:"epiq-log:pinned",pinned:o},window.location.origin)},[e]);return{lines:t,board:e,open:i,reportPinned:r}};var ls=T(j(),1);var MU=()=>{let[e,t]=im(),n=jT(e),i=(0,ls.useRef)(QB),r=e.toString(),o=(0,ls.useMemo)(()=>i8(e)??{...r8(),...i.current.values},[e]);i.current=ZB(i.current,r,o),(0,ls.useEffect)(()=>{if(n){KT(o);return}KB(o)||t(l=>{let s=new URLSearchParams(l);return YT(s,o),s},{replace:!0})},[e]);let a=(0,ls.useCallback)(l=>{let s=XB(o,l);KT(s),i.current=JB(i.current,s),t(u=>{let c=new URLSearchParams(u);return YT(c,s),c},{replace:!0})},[o,t]);return[o,a]};var gn=T(j(),1);var DU=new Set(["sync","email:link","email:unlink","issues:create","board:create","board:edit:title","swimlane:create","swimlane:edit:title","swimlane:delete","swimlane:move","issues:move","issue:close","issue:reopen","issue:edit:title","issue:edit:description","issue:tag:add","issue:tag:remove","contributor:remove","tag:remove","issue:assignee:add","issue:assignee:remove","issue:comment:add","issue:comment:delete"]);var _U=()=>{let e=0;return{sent(t){DU.has(t)&&(e+=1)},received(t){(t==="error"||t?.endsWith(":result"))&&(e=Math.max(0,e-1))},reset(){e=0},holdsState(){return e>0}}};var uZ=()=>typeof window>"u"?1:window.__epiqReconnectScale??1,OU=e=>e>=5?null:Math.min(8e3,500*2**e)*uZ();var U0=new WeakMap,G0=(e,t)=>{if(!e)return;let n=JSON.stringify(t);if(e.readyState===WebSocket.OPEN){e.send(n);return}if(e.readyState!==WebSocket.CONNECTING)return;let i=U0.get(e);if(i){i.push(n);return}U0.set(e,[n]),e.addEventListener("open",()=>{for(let r of U0.get(e)??[])e.send(r);U0.delete(e)},{once:!0})};var vR=(e,t)=>e===void 0||e===t,cZ=e=>`${e.protocol==="https:"?"wss":"ws"}://${e.host}/ws`,HU=({onMessage:e})=>{let t=(0,gn.useRef)(null),[n,i]=(0,gn.useState)(!1),[r,o]=(0,gn.useState)(0),[a,l]=(0,gn.useState)(0),[s,u]=(0,gn.useState)(!1),c=(0,gn.useRef)(0),d=(0,gn.useRef)(null),[f]=(0,gn.useState)(_U),h=(0,gn.useRef)(e);h.current=e;let m=(0,gn.useCallback)(x=>{G0(t.current,x)},[]),y=(0,gn.useCallback)((x,C)=>{f.sent(x),G0(t.current,{type:x,payload:C})},[f]),S=(0,gn.useCallback)(()=>m({type:"state:get"}),[m]),p=(0,gn.useCallback)(()=>f.holdsState(),[f]),g=(0,gn.useRef)({send:y,sendRaw:m,requestState:S,holdsState:p});g.current={send:y,sendRaw:m,requestState:S,holdsState:p};let b=(0,gn.useCallback)(()=>{c.current=0,u(!1),l(x=>x+1)},[]);return(0,gn.useEffect)(()=>{let x=new WebSocket(cZ(window.location));t.current=x;let C=!1;return x.addEventListener("open",()=>{i(!0),o(w=>w+1),c.current=0,u(!1),f.reset(),G0(x,{type:"state:get"})}),x.addEventListener("close",()=>{if(t.current===x&&(t.current=null),C)return;i(!1),f.reset();let w=OU(c.current);if(w===null){u(!0);return}c.current+=1,d.current=window.setTimeout(()=>l(E=>E+1),w)}),x.addEventListener("message",w=>{let E=JSON.parse(w.data);f.received(E.type),h.current(E,g.current)}),()=>{C=!0,d.current!==null&&(clearTimeout(d.current),d.current=null),t.current===x&&(t.current=null),x.close()}},[a,f]),{connected:n,socketEpoch:r,reconnectExhausted:s,reconnectNow:b,send:y,sendRaw:m,requestState:S,holdsState:p}};var Cn=T(j(),1);var NU=(e,t,n)=>e===null||e.issueId!==t||e.signature!==n||e.error!==null,FU=({issueId:e,boardState:t,paused:n,sendRaw:i})=>{let[r,o]=(0,Cn.useState)(null),[a,l]=(0,Cn.useState)(null),[s,u]=(0,Cn.useState)({});(0,Cn.useEffect)(()=>{if(!e){o(null);return}n||i({type:"issue:get",payload:{issueId:e}})},[e,t,n,i]),(0,Cn.useEffect)(()=>{if(!e){l(null);return}l({issueId:e,loading:!0,error:null,commits:[]}),i({type:"issue:commits:get",payload:{issueId:e}})},[e,i]);let[c,d]=(0,Cn.useState)(null);(0,Cn.useEffect)(()=>{d(null)},[e]);let f=(0,Cn.useCallback)((b,x)=>{d(C=>NU(C,b,x)?{issueId:b,signature:x,loading:!0,error:null,stats:null}:C)},[]);(0,Cn.useEffect)(()=>{c?.loading&&i({type:"issue:stats:get",payload:{issueId:c.issueId}})},[c?.issueId,c?.signature,c?.loading,i]);let[h,m]=(0,Cn.useState)(null);(0,Cn.useEffect)(()=>{m(null)},[e]);let y=(0,Cn.useCallback)((b,x)=>{m(C=>NU(C,b,x)?{issueId:b,signature:x,loading:!0,error:null,diff:null}:C)},[]);(0,Cn.useEffect)(()=>{h?.loading&&i({type:"issue:squashed-diff:get",payload:{issueId:h.issueId}})},[h?.issueId,h?.signature,h?.loading,i]);let S=(0,Cn.useCallback)(b=>{u(x=>({...x,[b]:{loading:!0,error:null,files:null}})),i({type:"commit:diff:get",payload:{sha:b}})},[i]),p=(0,Cn.useCallback)((b,x)=>{o(C=>C&&C.issueId===b?{...C,comments:x(C.comments)}:C)},[]),g=(0,Cn.useCallback)(b=>{if(b.type==="issue"){let x=dt(b.payload);x&&o(x);return}if(b.type==="issue:commits:result"){let{issueId:x,result:C}=b.payload;if(C?.status==="fail"){l(E=>E&&E.issueId===x?{...E,loading:!1,error:C.message}:E);return}let w=dt(C);w&&l(E=>E&&E.issueId===x?{...E,loading:!1,error:null,commits:w}:E);return}if(b.type==="issue:stats:result"){let{issueId:x,result:C}=b.payload;if(C?.status==="fail"){d(E=>E&&E.issueId===x?{...E,loading:!1,error:C.message}:E);return}let w=dt(C);w&&d(E=>E&&E.issueId===x?{...E,loading:!1,error:null,stats:w}:E);return}if(b.type==="issue:squashed-diff:result"){let{issueId:x,result:C}=b.payload;if(C?.status==="fail"){m(E=>E&&E.issueId===x?{...E,loading:!1,error:C.message}:E);return}let w=dt(C);w&&m(E=>E&&E.issueId===x?{...E,loading:!1,error:null,diff:w}:E);return}if(b.type==="commit:diff:result"){let{sha:x,result:C}=b.payload;if(C?.status==="fail"){u(E=>E[x]?{...E,[x]:{loading:!1,error:C.message,files:null}}:E);return}let w=dt(C);w&&u(E=>E[w.sha]?{...E,[w.sha]:{loading:!1,error:null,files:w.files}}:E)}},[]);return{detail:r,commits:a,stats:c,loadStats:f,squashed:h,loadSquashedDiff:y,commitDiffs:s,loadCommitDiff:S,updateComments:p,onMessage:g}};var Vo=T(j(),1);var dZ={},fZ=5e3,PU=({socketEpoch:e,sendRaw:t})=>{let[n,i]=(0,Vo.useState)(dZ),r=(0,Vo.useRef)(0),o=(0,Vo.useCallback)(()=>{r.current=Date.now(),t({type:"diff-stats:get"})},[t]);(0,Vo.useEffect)(()=>{e!==0&&o()},[e,o]),(0,Vo.useEffect)(()=>{let l=()=>{document.visibilityState!=="hidden"&&(Date.now()-r.current<fZ||o())};return window.addEventListener("focus",l),document.addEventListener("visibilitychange",l),()=>{window.removeEventListener("focus",l),document.removeEventListener("visibilitychange",l)}},[o]);let a=(0,Vo.useCallback)(l=>{if(l.type!=="diff-stats")return;let s=dt(l.payload);s&&i(s)},[]);return{stats:n,onMessage:a}};var Pr=T(j(),1);var hZ=e=>{let t=new Map;if(!e)return t;for(let n of e.boards??[])for(let i of n.swimlanes??[])for(let r of i.issues??[])t.set(r.ref,{issueId:r.id,ref:r.ref,title:r.title,board:n.title,lane:i.title,isClosed:r.isClosed,tags:r.tags??[],assignees:r.assignees??[],commentCount:(e.commentsByIssueId?.[r.id]??[]).length});return t},zU=({state:e,sendRaw:t})=>{let[n,i]=(0,Pr.useState)({}),r=(0,Pr.useRef)(new Set);(0,Pr.useEffect)(()=>{r.current.clear()},[e]);let o=(0,Pr.useMemo)(()=>hZ(e),[e]),a=(0,Pr.useCallback)(u=>{let c=o.get(u);return c?{...c,excerpt:n[c.issueId]?.excerpt}:null},[o,n]),l=(0,Pr.useCallback)(u=>{let c=o.get(u);if(!c)return;let{issueId:d}=c;n[d]?.from!==e&&(r.current.has(d)||(r.current.add(d),t({type:"issue:preview:get",payload:{issueId:d}})))},[o,n,e,t]),s=(0,Pr.useCallback)(u=>{if(u.type!=="issue:preview:result")return;let{issueId:c,result:d}=u.payload;r.current.delete(c);let f=dt(d);f&&i(h=>e?{...h,[f.issueId]:{excerpt:f.excerpt,from:e}}:h)},[e]);return{previewFor:a,requestPreview:l,onMessage:s}};var hf=T(j(),1);var BU=({swimlaneId:e,sendRaw:t})=>{let[n,i]=(0,hf.useState)(null);(0,hf.useEffect)(()=>{if(!e){i(null);return}i({swimlaneId:e,loading:!0,error:null,stats:null}),t({type:"swimlane:stats:get",payload:{swimlaneId:e}})},[e,t]);let r=(0,hf.useCallback)(o=>{if(o.type!=="swimlane:stats:result")return;let{swimlaneId:a,result:l}=o.payload;if(l?.status==="fail"){i(u=>u&&u.swimlaneId===a?{...u,loading:!1,error:l.message}:u);return}let s=dt(l);s&&i(u=>u&&u.swimlaneId===a?{...u,loading:!1,error:null,stats:s}:u)},[]);return{stats:n,onMessage:r}};var qo=T(j(),1);var UU=({open:e,sendRaw:t})=>{let[n,i]=(0,qo.useState)({loading:!1,data:null,candidates:[],scanError:null,lastError:null,changed:0}),r=(0,qo.useRef)(!1);(0,qo.useEffect)(()=>{e&&(i(s=>({...s,loading:!0,lastAction:null})),t({type:"emails:get"}))},[e,t]);let o=(0,qo.useCallback)(s=>{if(s.type==="failed"){if(!r.current)return;r.current=!1,i(h=>({...h,loading:!1,lastError:String(s.payload)}));return}if(s.type!=="emails")return;r.current=!1;let u=s.suggestions,c=dt(u)?.candidates??[],d=u?.status==="fail"?String(u.message??"Could not read this history"):null,f=dt(s.payload);if(!f){i(h=>({...h,loading:!1,lastError:s.payload?.message??"Could not read linked addresses"}));return}i(h=>({loading:!1,data:f,candidates:c,scanError:d,lastError:s.lastAction&&!s.lastAction.ok?String(s.lastAction.message):null,changed:s.lastAction?.ok===!0?h.changed+1:h.changed}))},[]),a=(0,qo.useCallback)((s,u)=>{r.current=!0,i(c=>({...c,loading:!0,lastError:null})),t({type:"email:link",payload:{email:s,contributorId:u}})},[t]),l=(0,qo.useCallback)((s,u)=>{r.current=!0,i(c=>({...c,loading:!0,lastError:null})),t({type:"email:unlink",payload:{email:s,contributorId:u}})},[t]);return{...n,onMessage:o,link:a,unlink:l}};var mf=T(j(),1);var GU=({open:e,changed:t,sendRaw:n})=>{let[i,r]=(0,mf.useState)({loading:!1,data:null,error:null});(0,mf.useEffect)(()=>{e&&(r(a=>({...a,loading:!0,error:null})),n({type:"me:stats:get"}))},[e,t,n]);let o=(0,mf.useCallback)(a=>{if(a.type!=="me:stats")return;let l=dt(a.payload);r({loading:!1,data:l??null,error:l?null:a.payload?.message??"Could not count"})},[]);return{...i,onMessage:o}};var Uu=T(j(),1);var $U=({open:e,sendRaw:t})=>{let[n,i]=(0,Uu.useState)({loading:!1,data:null,lastError:null,answeredAt:0});(0,Uu.useEffect)(()=>{e&&(i(a=>({...a,loading:!0,lastError:null})),t({type:"settings:get"}))},[e,t]);let r=(0,Uu.useCallback)(a=>{if(a.type!=="settings")return;let l=dt(a.payload);if(!l){i(s=>({...s,loading:!1,lastError:a.payload?.message??"Could not read your settings",answeredAt:s.answeredAt+1}));return}i(s=>({loading:!1,data:l,lastError:a.lastAction&&!a.lastAction.ok?String(a.lastAction.message):null,answeredAt:s.answeredAt+1}))},[]),o=(0,Uu.useCallback)(a=>{i(l=>({...l,loading:!0,lastError:null})),t({type:"settings:set",payload:a})},[t]);return{...n,onMessage:r,change:o}};var SR={color:v.dim,fontSize:W.label,textTransform:"uppercase",letterSpacing:.6},ss={...SR,paddingTop:18,paddingBottom:8},or={color:v.dim,fontSize:W.meta,marginTop:4,lineHeight:1.5},$0={background:"transparent",border:`1px solid ${v.line}`,borderRadius:4,cursor:"pointer",fontFamily:Ot,fontSize:W.meta,padding:"3px 8px",whiteSpace:"nowrap"},V0={background:v.panel2,border:`1px solid ${v.line}`,borderRadius:6,padding:"10px 12px"};var W0=T(j(),1);var pf=T(M(),1),VU=28,mZ=16,qU=1,xR=10,ER=2,pZ=VU-2*qU-xR-ER,WU=({label:e,checked:t,onChange:n,activeColor:i=v.accent,disabled:r,title:o,testId:a})=>(0,pf.jsxs)("label",{title:o,"data-testid":a,style:{display:"flex",alignItems:"center",gap:8,fontSize:11,color:t?i:v.dim,cursor:r?"not-allowed":"pointer",opacity:r?.4:1,whiteSpace:"nowrap",flexShrink:0},children:[(0,pf.jsxs)("span",{style:{position:"relative",display:"inline-block",width:VU,height:mZ,borderRadius:999,background:t?i:v.panel,border:`${qU}px solid ${t?i:v.dim}`,boxSizing:"border-box",flexShrink:0,transition:"background 120ms ease, border-color 120ms ease"},children:[(0,pf.jsx)("input",{type:"checkbox",role:"switch",checked:t,disabled:r,onChange:l=>n(l.target.checked),style:{position:"absolute",inset:0,width:"100%",height:"100%",margin:0,opacity:0,cursor:"inherit"}}),(0,pf.jsx)("span",{"aria-hidden":!0,style:{position:"absolute",top:ER,left:t?pZ:ER,width:xR,height:xR,borderRadius:999,background:t?v.panel2:v.dim,transition:"left 120ms ease, background 120ms ease",pointerEvents:"none"}})]}),e]});var Vn=T(M(),1),wR=3e3/1e3,q0=864e5/1e3,gp=e=>String(Math.round(e/1e3)),jU=({state:e,onChange:t})=>{let n=e.data,[i,r]=(0,W0.useState)("");if((0,W0.useEffect)(()=>{n&&r(gp(n.intervalMs))},[n?.intervalMs,e.answeredAt]),!n)return(0,Vn.jsxs)(Vn.Fragment,{children:[(0,Vn.jsx)("div",{style:ss,children:"Auto sync"}),(0,Vn.jsx)("div",{style:{...or,marginTop:0},children:e.lastError??"Reading\u2026"})]});let o=Number(i),a=i===gp(n.intervalMs),l=!a&&i.trim()!==""&&(!Number.isFinite(o)||o<wR||o>q0),s=()=>{if(a)return;if(l||i.trim()===""){r(gp(n.intervalMs));return}let u=Math.round(o)*1e3;if(u===n.intervalMs){r(gp(n.intervalMs));return}t({autoSyncIntervalMs:u})};return(0,Vn.jsxs)(Vn.Fragment,{children:[(0,Vn.jsx)("div",{style:ss,children:"Auto sync"}),(0,Vn.jsxs)("div",{"data-testid":"identity-autosync",style:{...V0,display:"flex",alignItems:"center",justifyContent:"space-between",gap:12},children:[(0,Vn.jsx)(WU,{testId:"autosync-toggle",label:n.enabled?"on":"off",checked:n.enabled,onChange:u=>t({autoSync:u})}),(0,Vn.jsxs)("label",{style:{display:"flex",alignItems:"center",gap:6,color:v.dim,fontSize:W.meta},children:["every",(0,Vn.jsx)("input",{"data-testid":"autosync-interval",type:"number",min:wR,max:q0,step:1,value:i,onChange:u=>r(u.target.value),onBlur:s,onKeyDown:u=>{u.key==="Enter"&&u.currentTarget.blur(),u.key==="Escape"&&(u.stopPropagation(),r(gp(n.intervalMs)))},style:{width:52,background:v.panel,color:l?v.red:v.primary,border:`1px solid ${l?v.red:v.line}`,borderRadius:4,padding:"3px 6px",font:"inherit",fontSize:W.meta,outline:"none",textAlign:"right"}}),"s"]})]}),l?(0,Vn.jsx)("div",{style:{...or,color:v.red},children:o>q0?`${q0} seconds \u2014 a day \u2014 is the longest interval.`:`${wR} seconds is the shortest interval.`}):e.lastError?(0,Vn.jsx)("div",{style:{...or,color:v.red},children:e.lastError}):n.enabled&&n.blockedReason&&(0,Vn.jsxs)("div",{style:{...or,color:v.red},children:["Not running \u2014 ",n.blockedReason,"."]})]})};var qn=T(M(),1),YU=({state:e})=>{let t=e.data;return t?(0,qn.jsxs)(qn.Fragment,{children:[(0,qn.jsx)("div",{style:ss,children:"Your work here"}),(0,qn.jsxs)("div",{"data-testid":"identity-stats",children:[(0,qn.jsx)(Jr,{left:"commits",right:t.scanned?String(t.commits):"\u2014"}),(0,qn.jsx)(Jr,{left:"tickets opened",right:String(t.tickets)}),(0,qn.jsx)(Jr,{left:"comments",right:String(t.comments)}),(0,qn.jsx)(Jr,{left:"joined",right:t.joinedAt===null?"not yet":(0,qn.jsx)("span",{title:Hd(t.joinedAt),children:$l(t.joinedAt)}),last:!0})]}),t.scanned&&t.claimedEmails===0&&(0,qn.jsx)("div",{style:or,children:"No git address is yours yet, so no commit counts as one \u2014 claim one below."})]}):(0,qn.jsxs)(qn.Fragment,{children:[(0,qn.jsx)("div",{style:ss,children:"Your work here"}),(0,qn.jsx)("div",{style:{...or,marginTop:0,color:e.error?v.red:v.dim},children:e.error??"Counting\u2026"})]})};var lt=T(M(),1),bZ={color:v.primary,fontSize:W.ui},vZ={fontSize:W.ui,overflowWrap:"anywhere"},SZ=e=>eo(e.name).label,xZ=e=>{let t=new Set(e.data?.mine??[]),n=e.data?.git??null,i=new Map,r=o=>{let a=i.get(o);if(a)return a;let l={email:o,mine:t.has(o),claimants:[],signsHere:n?.email===o,looksLikeYours:!1,commits:null,names:[]};return i.set(o,l),l};for(let o of t)r(o);n&&r(n.email);for(let o of e.data?.emails??[])r(o.email).claimants=o.claimants.map(SZ);for(let o of e.candidates){let a=r(o.email);a.commits=o.commits,a.names=o.names,a.looksLikeYours=o.looksLikeYours}return[...i.values()].sort((o,a)=>o.mine!==a.mine?o.mine?-1:1:o.signsHere!==a.signsHere?o.signsHere?-1:1:(a.commits??0)-(o.commits??0))},EZ=({row:e})=>{let t=[];if(e.signsHere&&t.push("your git identity here"),e.claimants.length>1?t.push((0,lt.jsxs)("span",{children:[(0,lt.jsx)("span",{style:{letterSpacing:.6},children:"CONTESTED:"})," claimed by"," ",e.claimants.join(" and "),", resolves to nobody"]},"contested")):!e.mine&&e.claimants.length===1&&t.push(`claimed by ${e.claimants[0]}`),e.commits!==null){let n=e.signsHere?"":` as ${e.names.join(", ")||"unknown"}`;t.push(`${e.commits} commit${e.commits===1?"":"s"}${n}`)}return t.length===0?null:(0,lt.jsx)("div",{style:or,children:t.map((n,i)=>(0,lt.jsxs)("span",{children:[i>0?" \xB7 ":"",n]},i))})},KU=({title:e,rows:t,children:n})=>t.length===0?null:(0,lt.jsxs)(lt.Fragment,{children:[(0,lt.jsx)("div",{style:ss,children:e}),t.map(i=>(0,lt.jsxs)("div",{"data-testid":`identity-row-${i.email}`,style:{...V0,display:"flex",alignItems:"flex-start",gap:12,marginBottom:8},children:[(0,lt.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,lt.jsx)("div",{style:{...vZ,color:i.mine?v.primary:v.dim2},children:i.email}),(0,lt.jsx)(EZ,{row:i})]}),n(i)]},i.email))]}),XU=({state:e,stats:t,settings:n,me:i,onLink:r,onUnlink:o,onChangeSettings:a})=>{let l=xZ(e),s=l.filter(d=>d.claimants.length>0),c=l.filter(d=>d.claimants.length===0);return(0,lt.jsxs)("div",{"data-testid":"identity-panel",style:{background:v.panel,border:`1px solid ${v.edge}`,borderRadius:6,padding:"16px 18px 14px",width:440,display:"flex",flexDirection:"column",minHeight:0,color:v.primary,fontFamily:Ot,fontSize:W.ui},children:[(0,lt.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:9},children:[(0,lt.jsx)("span",{style:bZ,children:i?eo(i.name).label:"Not configured"}),(0,lt.jsx)("span",{style:SR,children:"on this board"})]}),e.lastError&&(0,lt.jsx)("div",{style:{...or,paddingTop:10,color:v.red},children:e.lastError}),(0,lt.jsxs)("div",{style:{overflowY:"auto",minHeight:0,scrollbarGutter:"stable"},children:[(0,lt.jsx)(YU,{state:t}),(0,lt.jsx)(jU,{state:n,onChange:a}),e.scanError?(0,lt.jsx)("div",{style:{...or,paddingTop:16,color:v.red},children:e.scanError}):(0,lt.jsxs)(lt.Fragment,{children:[(0,lt.jsx)(KU,{title:"Claimed git addresses",rows:s,children:d=>d.mine?(0,lt.jsx)("button",{onClick:()=>o(d.email),style:{...$0,color:v.dim2},title:"Stop this address resolving to you. The record of the claim stays in the log.",children:"Unclaim"}):(0,lt.jsx)("button",{onClick:()=>r(d.email),style:{...$0,color:v.dim2},title:"Claim this address as well. While two people claim it, commits by it resolve to neither of you.",children:"Claim too"})}),(0,lt.jsx)(KU,{title:"Unclaimed",rows:c,children:d=>(0,lt.jsx)("button",{onClick:()=>r(d.email),style:{...$0,color:v.accent},title:"Every commit by this address becomes yours, back to the first one. Permanent, and it reaches every clone.",children:"This is me"})}),s.length===0&&c.length===0&&(0,lt.jsx)("div",{style:{...or,paddingTop:16},children:"No addresses in this repository\u2019s history yet."})]})]})]})};var JU=T(j(),1);var wZ=[.8,.7,.6,.5,.4],CZ=(e,t,n)=>new Promise(i=>e.toBlob(i,t,n)),kZ=(e,t)=>`${e.replace(/\.[a-z0-9]+$/i,"")||"image"}.${t}`,QU=async(e,t=500)=>{let n=t*1024;if(e.type==="image/gif")return e.size<=n?{blob:e,name:e.name}:{error:`GIFs are attached as-is and this one exceeds ${t} KB`};let i;try{i=await createImageBitmap(e)}catch{return{error:"Not a supported image"}}let r=Math.min(1,1600/Math.max(i.width,i.height)),o=document.createElement("canvas");o.width=Math.max(1,Math.round(i.width*r)),o.height=Math.max(1,Math.round(i.height*r));let a=o.getContext("2d");if(!a)return i.close(),{error:"Unable to process image"};a.drawImage(i,0,0,o.width,o.height),i.close();for(let l of wZ){let s=await CZ(o,"image/webp",l);if(s&&s.size<=n)return{blob:s,name:kZ(e.name,"webp")}}return{error:`Unable to compress image under ${t} KB`}},ZU=e=>new Promise((t,n)=>{let i=new FileReader;i.onload=()=>{let o=String(i.result??"").split(",")[1];if(!o){n(new Error("Unable to encode image"));return}t(o)},i.onerror=()=>n(new Error("Unable to read image")),i.readAsDataURL(e)});var e4=({send:e,setState:t,contributors:n,updateComments:i,attachmentMaxKb:r})=>{let[o,a]=(0,JU.useState)({state:"idle"});return{attachmentUploadStatus:o,editIssueTitle:(E,L)=>{t(R=>R&&$o(R,E,k=>({...k,title:L}))),e("issue:edit:title",{issueId:E,title:L})},editIssueDescription:(E,L)=>{t(R=>R&&$o(R,E,k=>({...k,description:L}))),e("issue:edit:description",{issueId:E,description:L})},addIssueTag:(E,L)=>{t(R=>R&&$o(R,E,k=>k.tags.some(O=>O.name===L)?k:{...k,tags:[...k.tags,{id:`placeholder-tag-${L}`,name:L,color:v.dim}]})),e("issue:tag:add",{issueId:E,tagName:L})},removeIssueTag:(E,L)=>{t(R=>R&&$o(R,E,k=>({...k,tags:k.tags.filter(O=>O.id!==L)}))),e("issue:tag:remove",{issueId:E,tagId:L})},addIssueAssignee:(E,L)=>{let R=n.find(k=>k.id===L);t(k=>!k||!R?k:$o(k,E,O=>O.assignees.some(N=>N.id===L)?O:{...O,assignees:[...O.assignees,R]})),e("issue:assignee:add",{issueId:E,assigneeId:L})},removeContributor:E=>{e("contributor:remove",{contributorId:E})},removeTag:E=>{e("tag:remove",{tagId:E})},addExternalIssueAssignee:(E,L)=>{t(R=>R&&$o(R,E,k=>k.assignees.some(O=>O.name===L)?k:{...k,assignees:[...k.assignees,{id:`placeholder-assignee-${L}`,name:L,color:v.dim}]})),e("issue:assignee:add",{issueId:E,assigneeName:L,createUnlinked:!0})},removeIssueAssignee:(E,L)=>{t(R=>R&&$o(R,E,k=>({...k,assignees:k.assignees.filter(O=>O.id!==L)}))),e("issue:assignee:remove",{issueId:E,assigneeId:L})},closeIssue:E=>{t(L=>L&&$o(L,E,R=>({...R,isClosed:!0}))),e("issue:close",{issueId:E})},reopenIssue:E=>{t(L=>L&&$o(L,E,R=>({...R,isClosed:!1}))),e("issue:reopen",{issueId:E})},addIssueComment:(E,L)=>{t(R=>{if(!R)return R;let k=R.commentsByIssueId[E]??[],O={id:`placeholder-comment-${crypto.randomUUID()}`,issueId:E,body:L,isDeleted:!1,author:R.user,createdAt:new Date().getTime()};return{...R,commentsByIssueId:{...R.commentsByIssueId,[E]:[...k,O]}}}),e("issue:comment:add",{issueId:E,body:L})},deleteIssueComment:(E,L)=>{i(E,R=>R.filter(k=>k.id!==L)),e("issue:comment:delete",{issueId:E,commentId:L})},editIssueComment:(E,L,R)=>{i(E,k=>k.map(O=>O.id===L?{...O,body:R}:O)),e("issue:comment:edit",{issueId:E,commentId:L,body:R})},uploadIssueAttachments:async(E,L)=>{let R=[];for(let k of L){a({state:"uploading",name:k.name});let O=await QU(k,r);if("error"in O)return a({state:"error",message:O.error}),R;try{let N=await ZU(O.blob),H=await fetch("/api/attachments",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({issueId:E,name:O.name,dataBase64:N})}),F=await H.json();if(!H.ok)return a({state:"error",message:F?.message??"Upload failed"}),R;let P=dt(F);P&&t(P);let V=F?.attachment?.markdown;V&&R.push(V)}catch(N){return a({state:"error",message:N instanceof Error?N.message:"Upload failed"}),R}}return a({state:"idle"}),R},deleteIssueAttachment:async(E,L)=>{try{let R=await fetch(`/api/attachments/${encodeURIComponent(L)}`,{method:"DELETE"}),k=await R.json();if(!R.ok){a({state:"error",message:k?.message??"Unable to delete attachment"});return}let O=dt(k);O&&t(O)}catch(R){a({state:"error",message:R instanceof Error?R.message:"Unable to delete attachment"})}}}};var CR=T(j(),1),t4=({send:e,setState:t,selectedBoard:n})=>{let[i,r]=(0,CR.useState)(null),[o,a]=(0,CR.useState)(null);return{createBoardTitle:i,setCreateBoardTitle:r,createBoard:()=>{if(i===null)return;let c=i.trim()||"New board";r(null),e("board:create",{title:c})},renameBoard:o,setRenameBoard:a,openRenameBoard:()=>{!n||n.readonly||a({boardId:n.id,title:n.title})},submitRenameBoard:()=>{if(!o)return;let{boardId:c}=o,d=o.title.trim();a(null),d&&(t(f=>f&&{...f,boards:f.boards.map(h=>h.id===c?{...h,title:d}:h)}),e("board:edit:title",{boardId:c,title:d}))}}};var j0=T(j(),1);var n4=({send:e,setState:t,selectedBoard:n,visibleSwimlanes:i})=>{let[r,o]=(0,j0.useState)(null),[a,l]=(0,j0.useState)(null),[s,u]=(0,j0.useState)(null),c=()=>{if(r===null||!n)return;let y=r.trim()||"New swimlane",S=n.id;o(null),t(p=>p&&{...p,boards:p.boards.map(g=>g.id===S?{...g,swimlanes:[...g.swimlanes,{id:`pending-swimlane-${y}`,title:y,readonly:!0,issues:[]}]}:g)}),e("swimlane:create",{title:y,boardId:S})},d=y=>{let S=i.find(p=>p.id===y);S&&l({swimlaneId:y,title:S.title})},f=()=>{if(!a)return;let{swimlaneId:y}=a,S=a.title.trim();l(null),S&&(t(p=>p&&mR(p,y,g=>({...g,title:S}))),e("swimlane:edit:title",{swimlaneId:y,title:S}))},h=n?.swimlanes.find(y=>y.id===s)??null;return{createSwimlaneTitle:r,setCreateSwimlaneTitle:o,renameSwimlane:a,setRenameSwimlane:l,setDeleteSwimlaneId:u,deletingSwimlane:h,createSwimlane:c,openRenameSwimlane:d,submitRenameSwimlane:f,confirmDeleteSwimlane:()=>{s&&(t(y=>y&&mR(y,s,()=>null)),e("swimlane:delete",{swimlaneId:s}),u(null))}}};var i4=e=>{let t=0,n={};return{open(){return t+=1,n={requestId:t},t},accept(i,r){if(i===void 0||i!==n.requestId)return;n={...n,...r};let{timeline:o,commits:a}=n;!o||!a||(n={},e({requestId:i,timeline:o,commits:a}))}}};var _e=T(M(),1),TZ={},r4=4,RZ=400,LZ="epiq.timeScrubber.showLog",AZ="epiq.timeScrubber.showIssues",IZ="epiq.timeScrubber.showCommits",MZ="epiq.diffTab.compacted",DZ="epiq.timeScrubber.linkedCommitsOnly",_Z={opacity:.3,pointerEvents:"none",transition:"opacity 240ms ease"},GT=()=>(0,_e.jsx)("div",{"data-testid":"ticket-drop-indicator",style:{height:2,background:v.accent,borderRadius:999,margin:"4px 8px 8px",boxShadow:`0 0 12px ${v.accent}`}}),o4=()=>{let{boardId:e}=Zw(),t=_b("/board/:boardId/issue/:issueId"),n=_b("/board/:boardId/:issueId"),i=t?.params.issueId??n?.params.issueId,[r,o]=im(),[a,l]=MU(),s=(0,ne.useRef)(()=>{}),{connected:u,socketEpoch:c,reconnectExhausted:d,reconnectNow:f,send:h,sendRaw:m,requestState:y}=HU({onMessage:(_,G)=>s.current(_,G)}),[S,p]=(0,ne.useState)({status:"synced",msg:"idle"}),[g,b]=(0,ne.useState)(null),[x,C]=(0,ne.useState)(null),[w,E]=(0,ne.useState)([]),[L,R]=(0,ne.useState)({requestId:0,timeline:null,commits:[]}),[k]=(0,ne.useState)(()=>i4(R)),[O,N]=(0,ne.useState)(null),[H,F]=(0,ne.useState)(0),[P,V]=_t(LZ,!1),U=up(P,_a()?0:Hr),[X,ae]=_t(AZ,!0),[A,me]=_t(IZ,!0),[pe,I]=_t(DZ,!0),[ue,be]=(0,ne.useState)(null),[ke,Je]=(0,ne.useState)(ru),[Q,re]=lU(),[fe,Ue]=(0,ne.useState)(null),[De,J]=(0,ne.useState)(null),[Le,Ge]=(0,ne.useState)(null),[Rt,$e]=(0,ne.useState)(null),[Ve,st]=(0,ne.useState)([]),[Ke,Wt]=(0,ne.useState)(!1),[Ht,Wn]=(0,ne.useState)(null),[io,Wo]=(0,ne.useState)(null),[z,Z]=(0,ne.useState)(null),he=(0,ne.useRef)(null),Ce=(0,ne.useRef)(null),Oe=(0,ne.useRef)(void 0),Nt=r.get("tab"),mt=Nt==="comments"||Nt==="code"||Nt==="stats"?Nt:"overview",Jt=r.get("comment"),ri=gN(r)??mN(r),Ct=yd(),Ae=(g&&e?EU(g,e):null)??g?.boards?.[0]??null,Ft=Ae?.id??null,un=(0,ne.useRef)(Ft);un.current=Ft;let za=(0,ne.useRef)(Ct);za.current=Ct;let Gt=Ae?.ref??e,ie=g&&i?xU(g,i):null;(0,ne.useEffect)(()=>{let _=G=>{if(!ie||ie.readonly)return;let q=G.target;if(q&&(q.tagName==="INPUT"||q.tagName==="TEXTAREA"||q.isContentEditable))return;let qe=Array.from(G.clipboardData?.items??[]).filter(We=>We.kind==="file"&&We.type.startsWith("image/")).map(We=>We.getAsFile()).filter(We=>!!We);qe.length!==0&&(G.preventDefault(),ee(ie.id,qe))};return window.addEventListener("paste",_),()=>window.removeEventListener("paste",_)});let Ba=()=>{Gt&&Ct(`/board/${Gt}`)},[Fi,ro]=(0,ne.useState)(null),lr=g?.commentsByIssueId??TZ,{detail:In,commits:en,commitDiffs:bi,loadCommitDiff:$t,stats:sr,loadStats:us,squashed:Mn,loadSquashedDiff:cs,updateComments:ds,onMessage:Gu}=FU({issueId:ie?.id??null,boardState:g,paused:O!==null,sendRaw:m}),{stats:$u,onMessage:jo}=BU({swimlaneId:Fi,sendRaw:m}),{stats:Vu,onMessage:fs}=PU({socketEpoch:c,sendRaw:m}),{previewFor:hs,requestPreview:ut,onMessage:vi}=zU({state:g,sendRaw:m}),[zr,Ua]=(0,ne.useState)(!1),Br=UU({open:zr,sendRaw:m}),ms=$U({open:zr,sendRaw:m}),ps=GU({open:zr,changed:Br.changed,sendRaw:m}),Yo=en?.issueId===ie?.id?en?.commits[0]?.sha??"":"";(0,ne.useEffect)(()=>{mt!=="stats"||!ie||us(ie.id,Yo)},[mt,ie?.id,Yo,us]);let[qu,Wu]=_t(MZ,!1),Ga=VC(r),Ko=Ga?Ga==="flat":qu,Ur=Ko&&!ri,gs=_=>{Wu(_),o(G=>{let q=new URLSearchParams(G);return cv(q,_),q},{replace:!0})};(0,ne.useEffect)(()=>{mt!=="code"||!ie||VC(r)||ri||o(_=>{let G=new URLSearchParams(_);return cv(G,Ko),G},{replace:!0})},[mt,ie?.id,r,Ko,ri]),(0,ne.useEffect)(()=>{mt!=="code"||!Ur||!ie||Yo&&cs(ie.id,Yo)},[mt,Ur,ie?.id,Yo,cs]);let $a=(0,ne.useMemo)(()=>{if(!ie||!g)return null;let _=g.boards.find(q=>q.swimlanes.some(qe=>qe.issues.some(We=>We.id===ie.id))),G=_?.swimlanes.find(q=>q.issues.some(qe=>qe.id===ie.id));return!_||!G?null:vU({createdAt:ie.createdAt,enteredLaneAt:ie.enteredLaneAt,now:Date.now(),history:In?.issueId===ie.id?In.history:[],lanes:_.swimlanes,currentLaneId:G.id})},[ie?.id,g,In]),Gr=(0,ne.useMemo)(()=>Zz(ie&&In?.issueId===ie.id?In.history:[],ie&&en?.issueId===ie.id?en.commits:[]),[ie?.id,In,en]),[jt,He]=(0,ne.useState)(""),K=(0,ne.useMemo)(()=>tT(a.only),[a.only]),ur=a.only.actor!==void 0,ys=(0,ne.useMemo)(()=>ur?iT(L.timeline):null,[ur,L.timeline]),bs=a.zoom!==null,Xo=(0,ne.useMemo)(()=>a.windowOnly&&Hu(a.scope,bs)?nT(L.timeline):null,[a.windowOnly,a.scope,bs,L.timeline]),vs=a.ticketOnly&&ie?ie.id:null,cr=pi(a.only.tag),Y0=cr?.length===1?cr[0]??null:null,ju=_=>l({only:of(a.only,"tag",M0(cr,_)??void 0)}),yp=(0,ne.useMemo)(()=>{let _=new Map;for(let q of[...g?.contributors??[],...w])_.has(q.id)||_.set(q.id,q);let G=[..._.values()];return{tag:g?.tags??[],commenter:G,assignee:G,actor:G}},[g?.tags,g?.contributors,w]),dr=(0,ne.useMemo)(()=>XT(g?.boards??[],null),[g?.boards]),oo=(0,ne.useMemo)(()=>XT(g?.boards??[],Ft),[g?.boards,Ft]),bp=(0,ne.useMemo)(()=>(Ae?.swimlanes??[]).map(({id:_,title:G})=>({id:_,title:G})),[Ae]),vp=(0,ne.useMemo)(()=>new Map((g?.boards??[]).flatMap(_=>_.swimlanes.map(G=>[G.id,G.title]))),[g?.boards]),Ss=(0,ne.useMemo)(()=>new Map((g?.boards??[]).flatMap(_=>_.swimlanes.flatMap(G=>G.issues.map(q=>[q.id,{ref:q.ref,title:q.title,assignee:q.assignees[0]??null}])))),[g?.boards]),Sp=(0,ne.useMemo)(()=>{let _=jt.trim();return!_||!Ae?null:new Set(Ae.swimlanes.flatMap(G=>G.issues.filter(q=>hR(q,_)).map(q=>q.id)))},[Ae,jt]),{visibleSwimlanes:Va,hiddenIssueCount:K0}=(0,ne.useMemo)(()=>{let _=Ae?.swimlanes??[],G=jt.trim();if(K.length===0&&!G&&Xo===null&&!vs)return{visibleSwimlanes:_,hiddenIssueCount:0};let q=0;return{visibleSwimlanes:_.map(We=>{let fr=We.issues.filter(uo=>rT(uo,{commenterIds:(lr[uo.id]??[]).map(M4=>M4.author.id),actorIds:ys===null?null:[...ys.get(uo.id)??[]]},K)&&hR(uo,G)&&(Xo===null||Xo.has(uo.id))&&(!vs||uo.id===vs));return q+=We.issues.length-fr.length,{...We,issues:fr}}),hiddenIssueCount:q}},[Ae,K,jt,lr,ys,Xo,vs]),xp=g?.attachmentsByIssueId??{},yf=(_,G)=>{if(Gu(_),jo(_),fs(_),vi(_),_.type==="state"&&!G.holdsState()){let q=dt(_.payload);q&&(b(q),C(null))}if(_.type==="state:unavailable"&&C(_.payload),_.type==="project:open:result"){let q=_.payload;q.status!=="success"&&C(qe=>qe&&{...qe,message:q.message})}if(_.type==="issues:create:result"){let q=Ce.current;Ce.current=null;let qe=dt(_.payload),We=Oe.current;Oe.current=void 0,qe&&Gt&&vR(We,Gt)&&za.current(`/board/${Gt}/issue/${Xl(qe.id)}?tab=overview`),q&&qe&&G.sendRaw({type:"issue:comment:add",payload:{issueId:q.originIssueId,body:`Filed \`${Xl(qe.id)}\` from a code selection on this ticket.`}})}if(_.type==="board:create:result"){let q=dt(_.payload);q&&za.current(`/board/${q.ref}`)}if(_.type==="failed"&&(J(typeof _.payload=="string"?_.payload:"The board refused that change"),G.requestState()),_.type==="error"&&(J(typeof _.message=="string"?_.message:"The board could not read that change"),G.requestState()),_.type==="timeline"){let q=dt(_.payload);q&&k.accept(_.requestId,{timeline:q})}if((_.type==="contributor:remove:result"||_.type==="issue:assignee:add:result")&&G.sendRaw({type:"contributors:get",payload:{boardId:un.current}}),_.type==="contributor:remove:result"&&_.payload?.status==="fail"&&Ue(`Couldn't remove a contributor: ${_.payload.message}`),_.type==="tag:remove:result"&&_.payload?.status==="fail"&&Ue(`Couldn't delete a tag: ${_.payload.message}`),Br.onMessage(_),ms.onMessage(_),ps.onMessage(_),_.type==="contributors"){let q=dt(_.payload);q&&vR(_.boardId,un.current)&&E(q)}if(_.type==="commits"){let q=dt(_.payload);q&&k.accept(_.requestId,{commits:q})}if(_.type==="commit:diff:result"){let{sha:q,result:qe}=_.payload;if(qe?.status==="fail")be(We=>We&&We.sha===q?{...We,loading:!1,error:qe.message}:We);else{let We=dt(qe);We&&be(fr=>fr&&fr.sha===We.sha?{...fr,loading:!1,error:null,files:We.files}:fr)}}_.type==="time-travel:result"&&(F(q=>q+1),_.payload?.status==="fail"&&(console.log("Time travel failed",_),G.requestState())),_.type==="sync-status"&&p(_.payload)};s.current=yf,(0,ne.useEffect)(()=>{let _=g?.boards?.[0];!e&&_&&Ct(`/board/${_.ref}`,{replace:!0})},[e,g,Ct]),(0,ne.useEffect)(()=>{let _=G=>{he.current&&!he.current.contains(G.target)&&Wt(!1)};return document.addEventListener("mousedown",_),()=>document.removeEventListener("mousedown",_)},[]);let Yu=()=>{Ge(null),$e(null)},bf=_=>{st(G=>G.includes(_)?G.filter(q=>q!==_):[...G,_])},qa=()=>st([]),[X0,Ep]=(0,ne.useState)(""),[wp,Ku]=(0,ne.useState)(""),Wa=(g?.boards??[]).flatMap(_=>_.swimlanes).flatMap(_=>_.issues).filter(_=>Ve.includes(_.id)),Xu=_=>{for(let G of Wa)_(G.id)},Q0=(_,{toggle:G}={toggle:!1})=>{if(G)return bf(_);be(null),ro(null),st([_]),Gt&&Ct(`/board/${Gt}/issue/${Xl(_)}?tab=${mt}`)},Cp=_=>{be(null),qa(),Ba(),ro(G=>G===_?null:_)},Qo=(0,ne.useMemo)(()=>new Set(dr.keys()),[dr]),Z0=(0,ne.useMemo)(()=>({isKnownRef:_=>Qo.has(_),onOpen:_=>{Gt&&Ct(`/board/${Gt}/issue/${_}`)}}),[Qo,Gt,Ct]),ja=(_,G,q=Gt,qe,We=!1,fr)=>{if(!q)return;be(null);let uo=new URLSearchParams({tab:G});qe&&cv(uo,qe==="flat"),fr&&uo.set("comment",fr),Ct(`/board/${q}/issue/${Xl(_)}?${uo}`,{replace:We})},vf=(_,G,q)=>{ro(null),st([_]),ja(_,G,Gt,q)},Sf=_=>vf(_,"comments"),kp=_=>vf(_,"code","flat"),xf=(_,G)=>{if(_.kind==="commit"){_R(_.sha,G?.replace);return}ja(_.issueId,_.tab,void 0,void 0,G?.replace,_.comment)},J0=_=>{o(G=>{let q=new URLSearchParams(G);return q.set("tab","code"),pN(q,_),q})},eS=_=>{o(G=>{let q=new URLSearchParams(G);return q.set("tab",_),WC(q),fN(q),q},{replace:!0})},tS=_=>{if(_.issueRef&&_.issueRef!==ie?.ref){if(!Gt)return;let G=new URLSearchParams({tab:"code"});qC(G,_),Ct(`/board/${Gt}/issue/${_.issueRef}?${G}`);return}o(G=>{let q=new URLSearchParams(G);return q.set("tab","code"),qC(q,_),q})},{attachmentUploadStatus:nS,editIssueTitle:Qu,editIssueDescription:Ef,addIssueTag:wf,removeIssueTag:ao,addIssueAssignee:xs,removeContributor:iS,removeTag:Zu,addExternalIssueAssignee:rS,removeIssueAssignee:Es,closeIssue:Cf,reopenIssue:lo,addIssueComment:oS,deleteIssueComment:aS,editIssueComment:B,uploadIssueAttachments:ee,deleteIssueAttachment:Ee}=e4({send:h,setState:b,contributors:w,updateComments:ds,attachmentMaxKb:g?.attachmentMaxKb}),tt=_=>{h("time-travel:scrub",{targetTime:_})},jn=()=>{h("time-travel:live",{})},so=()=>{L.timeline&&N(wB(L.timeline))},kf=()=>{N(null),jn()},Tp=CB({plan:O,ack:H,onSeek:tt}),[c4,kR]=(0,ne.useState)(0);(0,ne.useEffect)(()=>{if(O)return;let _=()=>kR(q=>q+1);if(a.windowOnly){_();return}if(!P)return;let G=window.setTimeout(_,RZ);return()=>window.clearTimeout(G)},[g,O,a.windowOnly,P]),(0,ne.useEffect)(()=>{O||Br.changed!==0&&kR(_=>_+1)},[Br.changed,O]);let TR=ue?{kind:"commit",sha:ue.sha}:ie?{kind:"ticket",issueId:ie.id,tab:mt==="comments"?"comments":"overview",...Jt?{comment:Jt}:{}}:null,{entries:lS,moment:RR,eventsUnlisted:LR}=wU({open:P,timeline:L.timeline,boardId:Ft??null,commits:L.commits,selection:a,selectedIssueId:ie?.id??null,queryIssueIds:Sp,linkedCommitsOnly:pe,boardIssueIdByRef:oo,issueIdByRef:dr,showIssues:X,showCommits:A,playing:O!==null,playheadTime:Tp.current?.t??null,timeTravel:g?.timeTravel}),[d4,AR]=(0,ne.useState)(!0),IR=u&&g?.timeTravel?.mode!=="scrub"&&!O,{following:sS,setFollowing:f4}=RU({logOpen:P,live:IR,onOpenLog:()=>V(!0)}),{followedLine:MR}=kU({following:sS,live:IR,pinned:d4,entries:lS,at:TR,onOpen:xf}),DR=AU({entries:lS,moment:RR,followedLine:MR,eventsUnlisted:LR,open:P,onOpen:xf,onPinnedChange:AR});(0,ne.useEffect)(()=>{u||N(null)},[u]);let h4=(0,ne.useCallback)((_,G,q)=>{let qe=_!==void 0?{start:_,end:G}:void 0,We=k.open();return m({type:"timeline:get",payload:{...qe,boardId:q?void 0:Ft??void 0,requestId:We}}),m({type:"commits:get",payload:{...qe,requestId:We}}),We},[Ft]),m4=(0,ne.useCallback)(()=>{m({type:"contributors:get",payload:{boardId:un.current}})},[]);(0,ne.useEffect)(()=>{E([]),st([])},[Ft]);let _R=(0,ne.useCallback)((_,G=!1)=>{let q=L.commits.find(We=>We.sha===_)?.subject??"",qe=D0(q,Qo);if(qe&&Gt){be(null),Ct(`/board/${Gt}/issue/${qe}?tab=code&commit=${_}`,{replace:G});return}be({sha:_,loading:!0,error:null,files:null}),m({type:"commit:diff:get",payload:{sha:_}})},[L.commits,Qo,Gt,Ct]),p4=(0,ne.useCallback)(()=>be(null),[]);(0,ne.useEffect)(()=>{be(null)},[e,i]),(0,ne.useEffect)(()=>{if(!fe)return;let _=setTimeout(()=>Ue(null),8e3);return()=>clearTimeout(_)},[fe]),(0,ne.useEffect)(()=>{if(!De)return;let _=setTimeout(()=>J(null),8e3);return()=>clearTimeout(_)},[De]);let g4=_=>{Wt(!1),Yu(),Ct(`/board/${Xl(_)}`)},y4=_=>{Wn({swimlaneId:_,title:""})},OR=_=>{Oe.current=Gt,h("issues:create",_)},b4=()=>{if(!Ht)return;let _=Ht.title.trim()||"New issue",G=Ht.swimlaneId;Wn(null),OR({title:_,parentId:G})},{createSwimlaneTitle:HR,setCreateSwimlaneTitle:Rp,renameSwimlane:NR,setRenameSwimlane:FR,setDeleteSwimlaneId:PR,deletingSwimlane:Tf,createSwimlane:v4,openRenameSwimlane:S4,submitRenameSwimlane:x4,confirmDeleteSwimlane:E4}=n4({send:h,setState:b,selectedBoard:Ae,visibleSwimlanes:Va}),{createBoardTitle:zR,setCreateBoardTitle:uS,createBoard:w4,renameBoard:BR,setRenameBoard:UR,openRenameBoard:C4,submitRenameBoard:k4}=t4({send:h,setState:b,selectedBoard:Ae}),T4=(0,ne.useMemo)(()=>(g?.boards??[]).flatMap(_=>_.swimlanes.flatMap(G=>G.issues.map(q=>({id:q.id,ref:q.ref,title:q.title,boardTitle:_.title,boardRef:_.ref})))),[g]),cS=yU(),GR=gU(),R4=(0,ne.useMemo)(()=>uU(),[]),L4={connected:u,scrubbing:g?.timeTravel?.mode==="scrub",issue:ie,board:Ae?{id:Ae.id,title:Ae.title,readonly:Ae.readonly}:null,tags:g?.tags??[],tickets:T4,contributors:w,handlers:{createIssue:()=>{let _=Va[0]?.id;_&&Wn({swimlaneId:_,title:""})},createSwimlane:()=>Rp(""),createBoard:()=>uS(""),renameBoard:C4,openIssue:(_,G)=>ja(_,"overview",G),closeIssue:Cf,reopenIssue:lo,addIssueTag:wf,removeIssueTag:ao,addIssueAssignee:xs,removeIssueAssignee:Es,commentOnIssue:_=>ja(_,"comments"),copyRef:_=>void navigator.clipboard?.writeText(_),sync:()=>h("sync",{}),startTheatre:so,returnToLive:jn,toggleLog:()=>V(!P)}},Ju=!u&&g!==null,$R=(0,ne.useMemo)(()=>Ju?Va.map(_=>({..._,readonly:!0,issues:_.issues.map(G=>({...G,readonly:!0}))})):Va,[Ju,Va]),Lp=g?.timeTravel?.mode==="scrub"?null:$R.find(_=>_.id===Fi)??null,A4=_=>{let G=z;if(Z(null),!G||!_||!Ae)return;let q=Va.findIndex(qe=>qe.id===G.swimlaneId);q!==-1&&AB(g,b,h)(_,Ae.id,G.side==="left"?q:q+1)},I4=(_,G,q)=>{let qe=Ae?.swimlanes[0]?.id;if(!qe)return;let We=q.range.side??"additions",fr=[...q.note?[q.note,""]:[],`Filed from a code selection on \`${G}\`.`,"",uv({filePath:q.filePath,start:q.range.start,side:We,end:q.range.end,endSide:q.range.endSide??We,note:q.note,sha:q.sha,issueRef:G}),`\`${q.filePath}\` ${La(q.range)}`,"```",q.snippet,"```"].join(`
1797
+ `});var Or=T(j(),1),$B=T(ws(),1);var qB=T(M(),1),L0="epiqTip",GB=e=>{if(!(e instanceof Element))return null;let t=e.closest("[title], [data-epiq-tip]"),n=e.closest(`[${qd}]`);return n&&(!t||t.contains(n))?null:t instanceof HTMLElement?t:null},VB=()=>{let e=(0,Or.useRef)(null),t=(0,Or.useRef)(null),n=(0,Or.useRef)(null),i=(0,Or.useRef)(null),[r,o]=(0,Or.useState)(null),[a,l]=(0,Or.useState)(null);return(0,Or.useEffect)(()=>{let s=()=>{t.current!==null&&clearTimeout(t.current),t.current=null},u=()=>{let S=n.current;if(!S)return;let p=S.dataset[L0];p!==void 0&&(S.setAttribute("title",p),delete S.dataset[L0]),n.current=null},c=()=>{s(),u(),i.current=null,o(null)},d=(S,p)=>{S.dataset[L0]=p,S.removeAttribute("title"),n.current=S},f=(S,p)=>{s(),i.current=S,t.current=setTimeout(()=>{d(S,p),o({label:p,trigger:S})},500)},h=S=>{let p=GB(S.target);if(!p)return c();if(p===n.current)return;let g=p.getAttribute("title")??p.dataset[L0];c(),g&&f(p,g)},m=S=>{let p=GB(S.target),g=p?.getAttribute("title");c(),p&&g&&(i.current=p,o({label:g,trigger:p}))},y=Wv(c,()=>i.current);return document.addEventListener("mouseover",h),document.addEventListener("focusin",m),document.addEventListener("focusout",c),()=>{c(),y(),document.removeEventListener("mouseover",h),document.removeEventListener("focusin",m),document.removeEventListener("focusout",c)}},[]),(0,Or.useEffect)(()=>{if(!r)return l(null);let s=e.current;s&&l(qv(r.trigger.getBoundingClientRect(),s.getBoundingClientRect()))},[r]),(0,Or.useEffect)(()=>{if(!r)return;let s=setInterval(()=>{r.trigger.isConnected||o(null)},250);return()=>clearInterval(s)},[r]),r?(0,$B.createPortal)((0,qB.jsx)("div",{ref:e,role:"tooltip","data-testid":"tooltip",style:{position:"fixed",left:a?.left??0,top:a?.top??0,opacity:a?1:0,transition:"opacity 80ms ease-out",zIndex:1e3,pointerEvents:"none",maxWidth:320,padding:"5px 8px",borderRadius:4,background:"#000",border:`1px solid ${v.line}`,boxShadow:"0 4px 14px rgba(0, 0, 0, 0.55)",color:v.primary,fontFamily:Ot,fontSize:W.meta,lineHeight:1.4,whiteSpace:"pre-wrap"},children:r.label}),document.body):null};var op=T(M(),1),VT=({message:e,onDismiss:t})=>(0,op.jsxs)("div",{style:{position:"fixed",bottom:20,right:20,zIndex:1e3,maxWidth:360,display:"flex",alignItems:"flex-start",gap:8,fontSize:12,color:v.primary,background:v.panel,border:`1px solid ${v.red}`,borderRadius:8,padding:"10px 12px",boxShadow:"0 4px 16px rgba(0, 0, 0, 0.4)"},children:[(0,op.jsx)("span",{style:{flex:1,minWidth:0,overflowWrap:"anywhere"},children:e}),(0,op.jsx)("button",{onClick:t,style:{background:"transparent",border:"none",color:v.dim,cursor:"pointer",fontSize:14,lineHeight:1,padding:0},children:"\xD7"})]});var se=T(j(),1);var $n={scope:"all",offset:0,zoom:null,layout:"even",only:{},windowOnly:!1,ticketOnly:!1},AX=["scope","offset","from","to","layout","view","only","window","ticket"],WB="epiq.board.selection",IX=e=>[...new Set(e)],qT=e=>Gn.some(t=>e[t]!==void 0),rs=(e,t)=>t===null?void 0:e[t],of=(e,t,n)=>{let i={...e},r=n===void 0?[]:pi(n);return n===void 0||r!==null&&r.length===0?delete i[t]:i[t]=n,i},jB=(e,t)=>{let n=e[t];return n===void 0?"off":pi(n)===null?"all":"some"},YB=(e,t,n)=>of(e,t,n?"all":void 0),MX=e=>{let t={};for(let n of Gn){let i=e[n];if(i===void 0)continue;let r=pi(i);r===null?t[n]="all":r.length>0&&(t[n]=IX(r))}return t},DX=e=>e!==null&&Number.isFinite(e.start)&&Number.isFinite(e.end)&&e.end>e.start?e:null,A0=e=>{let t=DX(e.zoom);return{...e,zoom:t,offset:t!==null||e.scope==="all"||!Number.isInteger(e.offset)||e.offset<0?0:e.offset,windowOnly:e.ticketOnly?!1:e.windowOnly,only:MX(e.only)}},KB=e=>e.scope===$n.scope&&e.offset===$n.offset&&e.zoom===null&&e.layout===$n.layout&&!qT(e.only)&&e.windowOnly===$n.windowOnly&&e.ticketOnly===$n.ticketOnly,XB=(e,t)=>{let n=t.scope!==void 0&&t.scope!==e.scope,i=t.zoom!==void 0?t.zoom:t.scope!==void 0?null:e.zoom,r=t.ticketOnly!==void 0?t.ticketOnly:t.scope!==void 0||t.zoom!==void 0?!1:e.ticketOnly;return A0({...e,...t,zoom:i,ticketOnly:r,offset:n?0:t.offset??e.offset})},WT=e=>({offset:e.offset,zoom:e.zoom,windowOnly:e.windowOnly,ticketOnly:e.ticketOnly}),QB={query:"",values:WT($n)},ZB=(e,t,n)=>e.query===t?e:{query:t,values:WT(n)},JB=(e,t)=>({query:e.query,values:WT(t)}),jT=e=>AX.some(t=>e.has(t)),e8=";",t8=":",n8="*",_X=e=>{let t=Gn.flatMap(n=>{let i=e[n];if(i===void 0)return[];let r=pi(i);return[`${n}${t8}${r===null?n8:r.join(",")}`]});return t.length===0?null:t.join(e8)},OX=(e,t)=>{if(e===null)return{};let n={};for(let i of e.split(e8)){if(i==="")continue;let r=i.indexOf(t8),o=r===-1?_r(t):i.slice(0,r);if(o===null||!qm(o))continue;let a=r===-1?i:i.slice(r+1);n[o]=a===n8?"all":a.split(",").filter(Boolean)}return n},i8=e=>{if(!jT(e))return null;let t=e.get("scope"),n=e.get("layout"),i=e.get("from"),r=e.get("to"),o=e.get("view"),a=c0(o)?o:"all";return A0({scope:h0(t)?t:$n.scope,offset:Number(e.get("offset")??0),zoom:i===null||r===null?null:{start:Number(i),end:Number(r)},layout:t0(n)?n:$n.layout,only:OX(e.get("only"),a),windowOnly:e.get("window")==="1",ticketOnly:e.get("ticket")==="1"})},YT=(e,t)=>{let n=(r,o)=>{o===null?e.delete(r):e.set(r,o)},i=A0(t);n("scope",i.scope===$n.scope?null:i.scope),n("offset",i.offset===0?null:String(i.offset)),n("from",i.zoom===null?null:String(i.zoom.start)),n("to",i.zoom===null?null:String(i.zoom.end)),n("layout",i.layout===$n.layout?null:i.layout),n("view",null),n("only",_X(i.only)),n("window",i.windowOnly?"1":null),n("ticket",i.ticketOnly?"1":null)},HX=(e,t)=>{if(Array.isArray(e)){let r=_r(t);return r===null?{}:{[r]:e.map(String)}}if(typeof e!="object"||e===null)return{};let n=e,i={};for(let r of Gn){let o=n[r];o==="all"?i[r]="all":Array.isArray(o)&&(i[r]=o.map(String))}return i},r8=()=>{try{let e=localStorage.getItem(WB);if(!e)return $n;let t=JSON.parse(e);if(typeof t!="object"||t===null)return $n;let{scope:n,layout:i,view:r,only:o}=t,a=c0(r)?r:"all";return A0({scope:h0(String(n))?n:$n.scope,offset:0,zoom:null,layout:t0(String(i))?i:$n.layout,only:HX(o,a),windowOnly:$n.windowOnly,ticketOnly:$n.ticketOnly})}catch{return $n}},KT=e=>{try{let{scope:t,layout:n,only:i}=e;localStorage.setItem(WB,JSON.stringify({scope:t,layout:n,only:i}))}catch{}},I0=(e,t)=>{let n=e.map(o=>o.id);if(t===void 0)return new Set(n);let i=pi(t);if(i===null)return new Set;let r=new Set(i);return new Set(n.filter(o=>!r.has(o)))},o8=(e,t,n,i)=>{let r=t.map(l=>l.id),o=pi(e),a=new Set(e===void 0?[]:o===null?r:o);if(i?a.add(n):a.delete(n),a.size!==0)return r.every(l=>a.has(l))?"all":[...a]},M0=(e,t)=>e!==null&&e.length===1&&e[0]===t?null:[t],a8=(e,t,n)=>{if(t===null)return[...e];let i=new Set(e.map(o=>o.id)),r=t.filter(o=>!i.has(o)).map(o=>n.find(a=>a.id===o)).filter(o=>!!o);return r.length===0?[...e]:[...e,...r]};var D0=(e,t)=>{let n=(e.trim().split(/\s+/)[0]??"").toUpperCase();return n&&t.has(n)?n:null};var XT=(e,t)=>new Map(e.flatMap(n=>n.swimlanes.flatMap(i=>i.issues.filter(r=>t===null||n.id===t||r.boardIds.includes(t)).map(r=>[r.ref,r.id])))),_0=({everyBoard:e,thisBoard:t,ticketFocus:n,everyBoardPlotted:i=!1})=>n||i?e:t,O0=(e,t,n,i,r)=>{if(!t&&!n)return e;let o=new Set(i.keys());return e.filter(a=>{let l=D0(a.subject,o);if(l===null)return!1;let s=i.get(l);return s!==void 0&&(r===null||r.has(s))})};var QT=T(M(),1),l8=({size:e=16})=>(0,QT.jsx)("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,QT.jsx)("polyline",{points:"15 18 9 12 15 6"})});var ii=T(j(),1);var Fa=T(j(),1),H0=({canvasRef:e,sizeRef:t,paint:n,onSettled:i})=>{let r=(0,Fa.useRef)(null),o=(0,Fa.useRef)(i);o.current=i;let a=(0,Fa.useCallback)(()=>{if(r.current!==null)return;let s=()=>{r.current=null,n(performance.now())?r.current=requestAnimationFrame(s):o.current()};r.current=requestAnimationFrame(s)},[n]);(0,Fa.useEffect)(()=>{let s=e.current,u=s?.parentElement;if(!s||!u)return;let c=()=>{let f=window.devicePixelRatio||1,{width:h,height:m}=u.getBoundingClientRect();t.current={width:h,height:m},s.width=Math.round(h*f),s.height=Math.round(m*f),s.style.width=`${h}px`,s.style.height=`${m}px`,s.getContext("2d")?.setTransform(f,0,0,f,0,0),n(performance.now())};c();let d=new ResizeObserver(c);return d.observe(u),()=>d.disconnect()},[n,e,t]),(0,Fa.useEffect)(()=>()=>{r.current!==null&&cancelAnimationFrame(r.current)},[]);let l=(0,Fa.useCallback)(()=>r.current!==null,[]);return{run:a,isPainting:l}};var c8=T(M(),1),s8=7,NX=(e,t,n,i)=>{let r=null,o=s8*s8;for(let a of e)if(!a.leaving)for(let l of a.points){let s=l.fraction*i-t,u=Po+l.hourFraction*_u-n,c=s*s+u*u;c<=o&&(o=c,r=l)}return r},FX=.08,PX=2.2,u8=({layers:e,animate:t,highlightId:n,onPointEnter:i,onPointLeave:r,onPressCommit:o})=>{let a=(0,ii.useRef)(null),l=(0,ii.useRef)({width:0,height:0}),s=(0,ii.useRef)(e);s.current=e;let u=(0,ii.useMemo)(()=>n!==null&&e.some(x=>x.points.some(C=>C.id===n))?n:null,[e,n]),c=(0,ii.useRef)(u);c.current=u;let d=(0,ii.useRef)(new Map),f=(0,ii.useRef)(null),[h,m]=(0,ii.useState)(!1),y=(0,ii.useCallback)(x=>{let C=a.current,w=C?.getContext("2d");if(!C||!w)return!1;let{width:E,height:L}=l.current;w.clearRect(0,0,E,L);let R=!1;for(let k of s.current){let O=d.current.get(k.id),N=O?x-O.startedAt:null,H=N===null||N>=$m;if(O&&!H&&(R=!0),!(O?.mode==="out"&&H))for(let F of k.points){let P=O==null||H?1:O.mode==="in"?$k(F.key,N):Vk(F.key,N);if(P<=0)continue;let V=c.current,U=V!==null&&F.id===V,X=P*(U?PX:1),ae=F.fraction*E,A=Po+F.hourFraction*_u;w.globalAlpha=V===null?F.opacity:U?1:FX,w.fillStyle=F.color,w.beginPath(),w.arc(ae,A,F.radius*X,0,Math.PI*2),w.fill(),U&&(w.globalAlpha=.25,w.beginPath(),w.arc(ae,A,F.radius*X*2.4,0,Math.PI*2),w.fill())}}return w.globalAlpha=1,R},[]),{run:S,isPainting:p}=H0({canvasRef:a,sizeRef:l,paint:y,onSettled:()=>m(!1)}),g=e.map(x=>`${x.id}:${x.generation}:${x.leaving}`).join("|");(0,ii.useEffect)(()=>{let x=new Set;for(let C of e){x.add(C.id);let w=`${C.generation}:${C.leaving}`,E=`${C.id}@${w}`;if(d.current.get(C.id)?.marker!==E){if(!t){d.current.delete(C.id);continue}d.current.set(C.id,{mode:C.leaving?"out":"in",startedAt:performance.now(),marker:E}),C.leaving||m(!0)}}for(let C of[...d.current.keys()])x.has(C)||d.current.delete(C);t?S():y(performance.now())},[g,t,S,y]),(0,ii.useEffect)(()=>{p()||y(performance.now())},[e,u,y,p]);let b=x=>{let C=x.currentTarget.getBoundingClientRect();return NX(s.current,x.clientX-C.left,x.clientY-C.top,C.width)};return(0,c8.jsx)("canvas",{ref:a,"data-testid":"scatter-canvas","data-entrance":h?"playing":"done","data-highlight":u??"",style:{position:"absolute",inset:0},onMouseMove:x=>{let C=b(x);C?.key!==f.current&&(f.current=C?.key??null,C?i(C):r())},onMouseLeave:()=>{f.current=null,r()},onPointerDown:x=>o(b(x)?.commitSha??null)})};var qt=T(j(),1);var h8=T(M(),1),zX=1.5,BX=3,UX=1.2,GX=2,$X=.38,VX=.07,qX=.12,WX=1.8,d8=600,jX=e=>1-Math.pow(1-e,3),YX=90,KX=.005,XX=16,ap=(e,t,n)=>e+(t-e)*n,f8=({chart:e,fractionForTime:t,fractionToTime:n,color:i,animate:r,generation:o,focusIssue:a,onPathEnter:l,onPathLeave:s,onPressPath:u})=>{let c=(0,qt.useRef)(null),d=(0,qt.useRef)({width:0,height:0}),f=(0,qt.useRef)(null),h=(0,qt.useRef)(null),[m,y]=(0,qt.useState)(!1),S=(0,qt.useMemo)(()=>e.paths.map(H=>({path:H,xs:H.vertices.map(F=>t(F.t))})),[e,t]),p=(0,qt.useRef)(S);p.current=S;let g=(0,qt.useMemo)(()=>Bm(e.strands),[e.strands]),b=(0,qt.useRef)({geometry:g,strands:e.strands});b.current={geometry:g,strands:e.strands};let x=(0,qt.useRef)(a);x.current=a;let C=(0,qt.useRef)(new Map),w=(0,qt.useRef)(0),E=(0,qt.useRef)(null),L=(0,qt.useRef)(r);L.current=r;let R=(0,qt.useRef)(i);R.current=i;let k=(0,qt.useCallback)(H=>{let F=c.current,P=F?.getContext("2d");if(!F||!P)return!1;let{width:V,height:U}=d.current,{geometry:X,strands:ae}=b.current,A=ae.length,me=(J,Le)=>n0(X,J,Le,ae[J].slots);P.clearRect(0,0,V,U),P.strokeStyle=R.current,P.fillStyle=R.current,P.lineCap="round",P.lineJoin="round",P.globalAlpha=qX,P.lineWidth=1;for(let J=0;J<A;J++){let Le=Math.round(Zd(X,J))+.5;P.beginPath(),P.moveTo(0,Le),P.lineTo(V,Le),P.stroke()}let pe=f.current,I=pe===null?null:H-pe,ue=I!==null&&I<d8,be=ue?jX(I/d8)*V:V;P.save(),P.beginPath(),P.rect(0,0,be,U),P.clip();let ke=x.current,Je=E.current;E.current=H;let Q=L.current?1-Math.exp(-(Je===null?XX:H-Je)/YX):1,re=!1,fe=(J,Le)=>{let Ge=ap(J,Le,Q);return Math.abs(Le-Ge)<KX?Le:(re=!0,Ge)};w.current=fe(w.current,ke===null?0:1);let Ue=w.current,De=new Set;for(let{path:J,xs:Le}of p.current){De.add(J.issue);let Ge=fe(C.current.get(J.issue)??0,ke!==null&&J.issue===ke?1:0);C.current.set(J.issue,Ge),P.globalAlpha=ap(ap($X,VX,Ue),1,Ge),P.lineWidth=ap(UX,GX,Ge),P.strokeStyle=J.color??R.current,P.fillStyle=P.strokeStyle,P.beginPath();let Rt=J.vertices[0],$e=Le[0]*V,Ve=me(Rt.strand,Rt.slot);P.moveTo($e,Ve);for(let st=1;st<J.vertices.length;st++){let Ke=J.vertices[st],Wt=Le[st]*V,Ht=me(Ke.strand,Ke.slot);if(Ht===Ve)P.lineTo(Wt,Ve);else{let Wn=Math.min(BX,(Wt-$e)/2);P.lineTo(Wt-Wn,Ve),P.bezierCurveTo(Wt,Ve,Wt,Ht,Wt+Wn,Ht)}$e=Wt,Ve=Ht}P.stroke(),J.closed&&(P.beginPath(),P.arc($e,Ve,WX*ap(1,1.5,Ge),0,Math.PI*2),P.fill())}for(let J of[...C.current.keys()])De.has(J)||C.current.delete(J);return P.restore(),P.globalAlpha=1,!ue&&!re&&(E.current=null),ue||re},[]),{run:O}=H0({canvasRef:c,sizeRef:d,paint:k,onSettled:()=>y(!1)});(0,qt.useEffect)(()=>{if(!r){f.current=null,k(performance.now());return}f.current=performance.now(),y(!0),O()},[o,r,O,k]),(0,qt.useEffect)(()=>{O()},[S,a,i,O]);let N=H=>{let F=H.currentTarget.getBoundingClientRect(),P=(H.clientX-F.left)/Math.max(1,F.width),V=n(P),U=ET(e.paths,V,H.clientY-F.top,X=>n0(g,X.strand,X.slot,e.strands[X.strand].slots),zX);return U===null?null:{path:U,t:V,fraction:P}};return(0,h8.jsx)("canvas",{ref:c,"data-testid":"flow-canvas","data-entrance":m?"playing":"done","data-paths":e.paths.length,"data-focus":a??"",style:{position:"absolute",inset:0},onMouseMove:H=>{let F=N(H),P=F?.path.issue??null;H.currentTarget.style.cursor=F?"pointer":"",!(F===null&&h.current===null)&&(h.current=P,F?l(F):s())},onMouseLeave:()=>{h.current=null,s()},onPointerDown:H=>u(N(H)?.path.issue??null)})};var P0=T(j(),1);var os=T(M(),1),m8=({size:e=16})=>(0,os.jsxs)("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round","aria-hidden":"true",children:[(0,os.jsx)("line",{x1:"3",y1:"8.5",x2:"3",y2:"15.5"}),(0,os.jsx)("line",{x1:"7.5",y1:"4.5",x2:"7.5",y2:"19.5"}),(0,os.jsx)("line",{x1:"12",y1:"7",x2:"12",y2:"17"}),(0,os.jsx)("line",{x1:"16.5",y1:"3",x2:"16.5",y2:"21"}),(0,os.jsx)("line",{x1:"21",y1:"9.5",x2:"21",y2:"14.5"})]});var Uo=T(M(),1),p8=({size:e=14,lit:t=!1})=>(0,Uo.jsxs)("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[t?(0,Uo.jsxs)(Uo.Fragment,{children:[(0,Uo.jsx)("circle",{cx:"12",cy:"12",r:"9",className:"epiq-live-ripple"}),(0,Uo.jsx)("circle",{cx:"12",cy:"12",r:"9",className:"epiq-live-ripple epiq-live-ripple--trailing"})]}):(0,Uo.jsx)("circle",{cx:"12",cy:"12",r:"9",opacity:.55}),(0,Uo.jsx)("circle",{cx:"12",cy:"12",r:"4",fill:t?"currentColor":"none"})]});var lp=T(M(),1),g8=({size:e=16})=>(0,lp.jsxs)("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,lp.jsx)("path",{d:"M3 3h18l-9 10z",fill:"currentColor",stroke:"none"}),(0,lp.jsx)("path",{d:"M12 13v8"})]});var af=T(M(),1),y8=({size:e=14})=>(0,af.jsxs)("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,af.jsx)("path",{d:"M20.5 12a8.5 8.5 0 1 1-2.6-6.1"}),(0,af.jsx)("path",{d:"M19.6 2.9v3.6h-3.6"}),(0,af.jsx)("path",{d:"M10.4 8.8 15.2 12l-4.8 3.2z",fill:"currentColor"})]});var lf=T(M(),1),b8=({size:e=16})=>(0,lf.jsxs)("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,lf.jsx)("path",{d:"M3 6h5l4 6h4l4 6h1"}),(0,lf.jsx)("path",{d:"M3 12h6",opacity:"0.45"}),(0,lf.jsx)("path",{d:"M3 18h9",opacity:"0.45"})]});var Pa=T(M(),1),N0=({size:e=14})=>(0,Pa.jsxs)("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true",children:[(0,Pa.jsx)("line",{x1:"4",y1:"6",x2:"4.01",y2:"6"}),(0,Pa.jsx)("line",{x1:"9",y1:"6",x2:"20",y2:"6"}),(0,Pa.jsx)("line",{x1:"4",y1:"12",x2:"4.01",y2:"12"}),(0,Pa.jsx)("line",{x1:"9",y1:"12",x2:"16",y2:"12"}),(0,Pa.jsx)("line",{x1:"4",y1:"18",x2:"4.01",y2:"18"}),(0,Pa.jsx)("line",{x1:"9",y1:"18",x2:"19",y2:"18"})]});var Pu=T(M(),1),v8=({size:e=14})=>(0,Pu.jsxs)("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true",children:[(0,Pu.jsx)("line",{x1:"3",y1:"8",x2:"21",y2:"8"}),(0,Pu.jsx)("line",{x1:"7",y1:"8",x2:"7",y2:"13"}),(0,Pu.jsx)("line",{x1:"12",y1:"8",x2:"12",y2:"17"}),(0,Pu.jsx)("line",{x1:"17",y1:"8",x2:"17",y2:"13"})]});var as=T(M(),1),S8=({size:e=16})=>(0,as.jsxs)("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"currentColor",stroke:"none","aria-hidden":"true",children:[(0,as.jsx)("circle",{cx:"4.5",cy:"8",r:"2.2"}),(0,as.jsx)("circle",{cx:"9.5",cy:"17",r:"2.2"}),(0,as.jsx)("circle",{cx:"13",cy:"6.5",r:"2.2"}),(0,as.jsx)("circle",{cx:"17",cy:"14.5",r:"2.2"}),(0,as.jsx)("circle",{cx:"20.5",cy:"8.5",r:"2.2"})]});var Ze=T(M(),1),E8={opacity:.4,cursor:"not-allowed"},QX={tickets:"Tickets",comments:"Comments",tagging:"Tags",assigning:"Assignees"},x8={background:"transparent",border:"none",padding:0,display:"inline-flex",alignItems:"center",color:v.secondary,cursor:"pointer"},sf={all:"Board",...QX,contributors:"Contributors"},ZX={commenter:"comments",tag:"tagging",assignee:"assigning",actor:"contributors"},JX={commenter:"Only tickets with comments",tag:"Only tagged tickets",assignee:"Only assigned tickets",actor:"Only tickets touched in this window"},eQ=162,tQ={display:"flex",flexDirection:"column",gap:2,marginLeft:5,paddingLeft:8,borderLeft:`1px solid ${v.line}`},nQ={background:"transparent",border:`1px solid ${v.line}`,borderRadius:4,color:v.dim,fontFamily:"inherit",fontSize:10,lineHeight:1,padding:"2px 4px",cursor:"pointer"},F0=({label:e,selected:t,color:n,disabled:i,onSelect:r})=>(0,Ze.jsxs)("button",{type:"button",role:"radio","aria-checked":t,disabled:i,onClick:r,style:{display:"flex",alignItems:"center",gap:8,background:"transparent",border:"none",padding:0,fontSize:11,fontFamily:"inherit",color:t?n:v.dim,cursor:i?"not-allowed":"pointer",opacity:i?.4:1},children:[(0,Ze.jsx)("span",{style:{width:12,height:12,borderRadius:"50%",border:`1px solid ${t?n:v.dim}`,display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:t&&(0,Ze.jsx)("span",{style:{width:6,height:6,borderRadius:"50%",background:n}})}),e]}),iQ=[],rQ=new Set,w8=({connected:e,showIssues:t,view:n,identitiesByAxis:i,hiddenIdsByAxis:r,axisStates:o,narrowed:a,expanded:l,expandedAxis:s,filtered:u,onChangeShowIssues:c,onToggleAxis:d,onToggleIdentity:f,onOnlyIdentity:h,onToggleExpanded:m,onSetExpandedAxis:y})=>{let S=_r(n),p=S===null?iQ:i[S],g=S===null?rQ:r[S],b=jm(p,g),x=u&&g.size>0&&S!==null,C=u&&a&&!x&&b===null,w=b?`${sf[n]}: ${b.name}`:x?`${sf[n]} (multi)`:C?`${sf[n]} (filtered)`:`${sf[n]} (all)`,E=b?.color??(x||C?v.dim2:Ou(n));return(0,Ze.jsx)(Pl,{open:l,onOpenChange:L=>L!==l&&m(),testId:"series-select",label:w,color:E,width:eQ,minWidth:178,disabled:!t||!e,title:u?"Choose what to plot":"Too many events to split by kind",popupRole:"group",popupLabel:"Filter the board",leading:(0,Ze.jsx)(Ma,{label:null,testId:"show-board-events",title:"Show board events",checked:t,activeColor:E,disabled:!e,onChange:c}),children:()=>Gn.map(L=>{let R=ZX[L],k=o[L],O=s===L,N=sf[R].toLowerCase();return(0,Ze.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:2},children:[(0,Ze.jsxs)(Ir,{style:{justifyContent:"flex-start",gap:3},children:[(0,Ze.jsx)(Ma,{label:sf[R],checked:k==="all",mixed:k==="some",activeColor:Ou(R),disabled:!t||!u,title:JX[L],onChange:H=>d(L,H)}),(0,Ze.jsx)("button",{type:"button","data-testid":`filter-axis-${L}`,disabled:!t||!u,onClick:()=>y(O?null:L),title:O?`Hide ${N}`:`Pick ${N}`,"aria-expanded":O,style:{...x8,color:k==="some"?Ou(R):x8.color},children:O?(0,Ze.jsx)(Ar,{size:12}):(0,Ze.jsx)(nr,{size:12})})]}),O&&i[L].length>0&&(0,Ze.jsx)("div",{role:"group","aria-label":`Which ${N} to show`,style:{...tQ,maxHeight:132,overflowY:"auto"},children:i[L].map(H=>(0,Ze.jsxs)(Ir,{children:[(0,Ze.jsx)(Ma,{label:H.name,checked:!r[L].has(H.id),activeColor:H.color,disabled:!t,onChange:F=>f(L,H.id,F)}),(0,Ze.jsx)("button",{type:"button",title:`Show only ${H.name}`,disabled:!t,onClick:()=>h(L,H.id),style:nQ,children:"only"})]},H.id))})]},L)})})},oQ=150,C8=({connected:e,idle:t,showCommits:n,linkedOnly:i,linesMeasure:r,onChangeShowCommits:o,onChangeLinkedOnly:a,onChangeLinesMeasure:l})=>{let s=e&&!t;return(0,Ze.jsx)(Pl,{testId:"commit-select",label:`${r?"Lines":"Commits"} (${i?"linked":"all"})`,color:v.green,width:oQ,minWidth:160,disabled:!n||!s,title:t?"Flow draws tickets only":"Choose which commits to plot",popupRole:"group",leading:(0,Ze.jsx)(Ma,{label:null,testId:"show-commits",title:t?"Flow draws tickets only":"Show commits",checked:n,activeColor:v.green,disabled:!s,onChange:o}),children:u=>{let c=f=>{a(f),u()},d=f=>{l(f),u()};return(0,Ze.jsxs)(Ze.Fragment,{children:[(0,Ze.jsxs)("div",{role:"radiogroup","aria-label":"Which commits to plot",style:{display:"contents"},children:[(0,Ze.jsx)(Ir,{children:(0,Ze.jsx)(F0,{label:"All",selected:!i,color:v.green,onSelect:()=>c(!1)})}),(0,Ze.jsx)(Ir,{children:(0,Ze.jsx)(F0,{label:"Linked",selected:i,color:v.green,onSelect:()=>c(!0)})})]}),(0,Ze.jsx)("div",{"aria-hidden":!0,style:{height:1,background:v.line,margin:"3px 0"}}),(0,Ze.jsxs)("div",{role:"radiogroup","aria-label":"What the bars measure",style:{display:"contents"},children:[(0,Ze.jsx)(Ir,{children:(0,Ze.jsx)(F0,{label:"Commit count",selected:!r,color:v.green,onSelect:()=>d(!1)})}),(0,Ze.jsx)(Ir,{children:(0,Ze.jsx)(F0,{label:"Lines (+/-)",selected:r,color:v.green,onSelect:()=>d(!0)})})]})]})}})},aQ=108,k8=({scope:e,zoomed:t,connected:n,onChangeScope:i})=>(0,Ze.jsx)(Pl,{testId:"scope-select",label:t?"Zoom":tf(e),color:v.primary,width:aQ,disabled:!n,title:"Choose the window",children:r=>ef.map(o=>(0,Ze.jsx)(Ir,{role:"option",selected:!t&&e===o,onSelect:()=>{i(o),r()},children:tf(o)},o))});var Re=T(M(),1),lQ={background:v.panel2,border:`1px solid ${v.line}`,borderRadius:3,color:v.secondary,padding:"3px 7px",cursor:"pointer",display:"inline-flex",alignItems:"center"},T8=({connected:e,scope:t,zoomed:n,windowOnly:i,windowFilterable:r,canPlay:o,playTitle:a,onPlay:l,following:s,canFollow:u,followTitle:c,onChangeFollowing:d,narrow:f,ticketFocus:h,textFilter:m,onChangeTextFilter:y,layoutMode:S,showIssues:p,showCommits:g,linkedCommitsOnly:b,onChangeLinkedCommitsOnly:x,linesMeasure:C,onChangeLinesMeasure:w,allBoards:E,boardView:L,identitiesByAxis:R,hiddenIdsByAxis:k,axisStates:O,narrowed:N,categoriesExpanded:H,expandedAxis:F,categoriesFiltered:P,isScrubbing:V,onReturnToLive:U,onChangeScope:X,onChangeWindowOnly:ae,onChangeLayoutMode:A,onChangeShowIssues:me,onChangeShowCommits:pe,onChangeAllBoards:I,onToggleAxis:ue,onToggleIdentity:be,onOnlyIdentity:ke,onToggleCategoriesExpanded:Je,onSetExpandedAxis:Q})=>{let re=!Hu(t,n);return(0,Re.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:20,flex:"1 1 0",minWidth:0},children:[(0,Re.jsxs)(sp,{label:"View",style:{gap:2},children:[(0,Re.jsx)(Te,{title:"Volume per period","aria-label":"Volume",pressed:S==="even",disabled:!e,onClick:()=>A("even"),children:(0,Re.jsx)(m8,{size:ge})}),(0,Re.jsx)(Te,{title:"Events by moment and time of day","aria-label":"Events",pressed:S==="real",disabled:!e,onClick:()=>A("real"),children:(0,Re.jsx)(S8,{size:ge})}),(0,Re.jsx)(Te,{title:"Flow between swimlanes, one line per ticket","aria-label":"Flow",pressed:S==="flow",disabled:!e,onClick:()=>A("flow"),children:(0,Re.jsx)(b8,{size:ge})})]}),(0,Re.jsx)(sp,{label:"Scope",children:f?(0,Re.jsx)(k8,{scope:t,zoomed:n,connected:e,onChangeScope:X}):(0,Re.jsxs)("div",{style:{display:"flex",gap:2},children:[ef.map(fe=>(0,Re.jsx)("button",{"aria-pressed":!n&&!h&&t===fe,disabled:!e,onClick:()=>X(fe),style:{...Kd(!n&&!h&&t===fe),...e?{}:E8},children:tf(fe)},fe)),(0,Re.jsx)("button",{title:h?"Held while narrowed to a ticket":n?"Zoomed by a drag \u2014 pick a period to leave":"Drag across the chart to zoom","aria-pressed":n&&!h,disabled:!0,style:{...Kd(n&&!h),opacity:n&&!h?1:.35,cursor:"default"},children:"Zoom"})]})}),(0,Re.jsx)(sp,{label:"Narrow",children:(0,Re.jsx)(ZT,{title:h?"Already narrowed to a ticket":re?"Pick a period first":r?"Narrow board to timeline window":"Too many events to tell tickets apart",on:i,disabled:h||re||!r||!e&&!i,onChange:ae})}),(0,Re.jsx)("div",{"aria-hidden":!0,style:{flex:"1 1 0",minWidth:0}}),(0,Re.jsxs)(sp,{label:"Filter",style:{gap:10,minWidth:0},children:[(0,Re.jsx)(C8,{connected:e,idle:S==="flow",showCommits:g,linkedOnly:b,linesMeasure:C,onChangeShowCommits:pe,onChangeLinkedOnly:x,onChangeLinesMeasure:w}),(0,Re.jsx)(w8,{connected:e,showIssues:p,view:L,identitiesByAxis:R,hiddenIdsByAxis:k,axisStates:O,narrowed:N,expanded:H,expandedAxis:F,filtered:P,onChangeShowIssues:me,onToggleAxis:ue,onToggleIdentity:be,onOnlyIdentity:ke,onToggleExpanded:Je,onSetExpandedAxis:Q}),(0,Re.jsx)(JT,{value:m,onChange:y})]}),(0,Re.jsxs)(sp,{label:"Play",style:{gap:6},children:[(0,Re.jsx)(eR,{following:s,disabled:!u,title:c,onChange:d}),(0,Re.jsx)(tR,{canPlay:o,playTitle:a,onPlay:l})]})]})},sp=({label:e,style:t,children:n})=>{let i=(0,P0.useContext)(IC),r=(0,P0.useRef)(null),o=r.current?.getBoundingClientRect(),a=o?`${i.x-o.left}px ${i.y-o.top}px`:"0 0";return(0,Re.jsxs)("div",{"data-group-label":e,style:{position:"relative",display:"flex",alignItems:"center",alignSelf:"stretch",...t},children:[(0,Re.jsxs)("span",{ref:r,"aria-hidden":!0,style:{position:"absolute",left:0,bottom:"100%",marginBottom:4,fontSize:8,lineHeight:1,letterSpacing:"0.1em",textTransform:"uppercase",whiteSpace:"nowrap",pointerEvents:"none",userSelect:"none"},children:[(0,Re.jsx)("span",{style:{color:v.dim,opacity:.6},children:e}),(0,Re.jsx)("span",{style:{position:"absolute",inset:0,color:"transparent",backgroundImage:`radial-gradient(${i.radius}px circle at ${a}, ${i.color}, transparent 100%)`,WebkitBackgroundClip:"text",backgroundClip:"text",opacity:i.strength,transition:"opacity 140ms ease"},children:e})]}),n]})},ZT=({on:e,disabled:t=!1,title:n,onChange:i})=>(0,Re.jsx)(Te,{testId:"spotlight",title:n,"aria-label":"Narrow board to timeline window",pressed:e,disabled:t,onClick:()=>i(!e),children:(0,Re.jsx)(lv,{size:ge})}),JT=({value:e,onChange:t})=>{let n=e.trim()!=="";return(0,Re.jsx)("input",{"data-testid":"text-filter",type:"search",value:e,placeholder:"ref or title","aria-label":"Filter tickets by ref or title",title:"Filter tickets by ref or title",spellCheck:!1,onChange:i=>t(i.target.value),onKeyDown:i=>{i.key==="Escape"&&(t(""),i.currentTarget.blur())},style:{...Xb(n?v.accent:v.primary,!1),width:110,minWidth:70,flexShrink:1,boxShadow:n?`0 0 0 1px ${v.accent}`:void 0,outline:"none"}})},R8=({collapsed:e,onToggleCollapsed:t,logOpen:n,onChangeLogOpen:i})=>(0,Re.jsxs)("div",{style:{...Xd,fontSize:11,whiteSpace:"nowrap"},children:[(0,Re.jsx)(Te,{testId:"log-toggle",title:n?"Hide the event log":"Show the event log",pressed:n,onClick:()=>i(!n),children:(0,Re.jsx)(N0,{size:ge})}),(0,Re.jsx)(Te,{testId:"timeline-toggle",title:e?"Show time travel":"Hide time travel",pressed:!e,"aria-expanded":!e,onClick:t,children:(0,Re.jsx)(v8,{size:ge})})]}),L8=({isScrubbing:e,onReturnToLive:t})=>e?(0,Re.jsx)("button",{onClick:t,onPointerDown:n=>n.stopPropagation(),onMouseMove:n=>n.stopPropagation(),title:"Put the board back at now","aria-label":"Now",style:{...lQ,position:"absolute",right:2,top:"50%",transform:"translateY(-50%)",zIndex:4,background:v.accent,border:`1px solid ${v.accent}`,color:v.bg,display:"inline-flex",alignItems:"center",padding:"3px 4px",cursor:"pointer"},children:(0,Re.jsx)(g8,{size:ge})}):null,eR=({following:e,disabled:t,title:n,onChange:i})=>(0,Re.jsx)("span",{style:{...Xd,...t?{background:"transparent",borderColor:"transparent"}:{}},children:(0,Re.jsx)(Te,{testId:"live-toggle",title:n,"aria-label":"Follow the newest event",pressed:e,disabled:t,tone:"solid",label:e?"LIVE":void 0,onClick:()=>i(!e),children:(0,Re.jsx)(p8,{size:ge,lit:e})})}),tR=({canPlay:e,playTitle:t,onPlay:n})=>(0,Re.jsx)("span",{style:{...Xd,...e?{}:{background:"transparent",borderColor:"transparent"}},children:(0,Re.jsx)(Te,{testId:"theatre-play",title:t,"aria-label":"Play the board's history",disabled:!e,onClick:n,children:(0,Re.jsx)(y8,{size:ge})})});var Go=T(j(),1);var Be=T(M(),1),A8=({boundaries:e,hovered:t,fractionForTime:n})=>(0,Be.jsx)(Be.Fragment,{children:e.map(({time:i,label:r})=>(0,Be.jsx)("div",{"data-testid":"segment-boundary","aria-hidden":!0,style:{position:"absolute",left:`${n(i)*100}%`,top:0,bottom:0,width:1,background:Tk,pointerEvents:"none"},children:r!==null&&!(t&&i>=t.start&&i<t.end)&&(0,Be.jsx)("span",{style:{position:"absolute",top:1,left:3,fontSize:8,lineHeight:1,color:Rk,whiteSpace:"nowrap"},children:r})},i))}),I8=({segment:e,fractionForTime:t})=>{let n=t(e.start);return(0,Be.jsx)("div",{style:{position:"absolute",left:`${n*100}%`,width:`${(t(e.end)-n)*100}%`,top:0,bottom:0,background:kk,pointerEvents:"none",overflow:"visible"},children:(0,Be.jsx)("span",{style:{position:"absolute",top:1,left:3,fontSize:8,lineHeight:1,color:v.dim2,whiteSpace:"nowrap"},children:e.label})})},M8=({from:e,to:t})=>{let n=Math.min(e,t);return(0,Be.jsx)("div",{"data-testid":"scrubber-range-selection",style:{position:"absolute",left:`${n*100}%`,width:`${Math.abs(t-e)*100}%`,top:0,bottom:0,background:Pk,borderLeft:`1px solid ${i0}`,borderRight:`1px solid ${i0}`,boxSizing:"border-box",pointerEvents:"none",zIndex:4}})},nR=({color:e,anchor:t})=>(0,Be.jsx)("div",{style:{position:"absolute",left:0,right:0,...t==="bottom"?{bottom:0}:{},...t==="top"?{top:0}:{},height:t==="top"?1:2,borderRadius:999,background:e,opacity:t==="centre"?.14:.2}}),D8={position:"absolute",left:2,fontSize:9,lineHeight:1,color:v.secondary,padding:"2px 4px",borderRadius:2,background:"rgba(0, 0, 0, 0.55)",pointerEvents:"none"},_8=()=>(0,Be.jsx)(Be.Fragment,{children:[["00:00",{top:Po-2}],["12:00",{top:"50%",transform:"translateY(-50%)"}],["24:00",{bottom:Po-2}]].map(([e,t])=>(0,Be.jsx)("span",{style:{...D8,...t},children:e},e))}),O8=({strands:e,geometry:t})=>(0,Be.jsx)(Be.Fragment,{children:e.map((n,i)=>(0,Be.jsx)("span",{style:{...D8,top:Zd(t,i),transform:"translateY(-50%)",maxWidth:150,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:n.title},n.id))}),H8=({animate:e,children:t})=>(0,Be.jsx)("div",{style:{position:"absolute",inset:0,pointerEvents:"none",animation:e?Vm:void 0,contain:"layout paint"},children:t}),iR=({index:e,bucketCount:t})=>(0,Be.jsx)("div",{style:{position:"absolute",left:`${e*(100/t)}%`,top:0,bottom:0,width:`${100/t}%`,minWidth:2,background:Lk,pointerEvents:"none"}}),sQ=({bars:e,bucketCount:t,firstBar:n,lastBar:i,color:r,direction:o,animate:a})=>{let l=100/t,s=o0(t),u=o==="up",[c,d]=(0,Go.useState)(!0);return(0,Go.useEffect)(()=>{let f=setTimeout(()=>d(!1),l0);return()=>clearTimeout(f)},[]),(0,Be.jsx)(Be.Fragment,{children:e.map(({index:f,intensity:h})=>(0,Be.jsx)("div",{style:{position:"absolute",left:`${f*l}%`,...u?{bottom:0}:{top:0},width:s,height:3+h*(Fo-3),borderRadius:u?"1px 1px 0 0":"0 0 1px 1px",background:r,opacity:.35+h*.65,transformOrigin:u?"bottom":"top",animation:a&&c?a0(f,n,i):void 0,pointerEvents:"none"}},f))})},rR=(0,Go.memo)(sQ),uQ=({segments:e,bucketCount:t,firstBar:n,lastBar:i,colors:r,animate:o})=>{let a=100/t,l=o0(t),[s,u]=(0,Go.useState)(!0);return(0,Go.useEffect)(()=>{let c=setTimeout(()=>u(!1),l0);return()=>clearTimeout(c)},[]),(0,Be.jsx)(Be.Fragment,{children:e.map(({index:c,top:d,bottom:f})=>{let h=d+f,{height:m,share:y}=Yk(d,f,Fo);return(0,Be.jsxs)("div",{"data-testid":"line-bar","data-share":y.toFixed(3),style:{position:"absolute",left:`${c*a}%`,top:0,width:l,height:m,display:"flex",flexDirection:"column",borderRadius:"0 0 1px 1px",overflow:"hidden",opacity:.35+Math.min(1,h)*.65,transformOrigin:"top",animation:o&&s?a0(c,n,i):void 0,pointerEvents:"none"},children:[(0,Be.jsx)("div",{style:{height:`${y*100}%`,background:r.top}}),(0,Be.jsx)("div",{style:{flex:1,background:r.bottom}})]},c)})})},N8=(0,Go.memo)(uQ),F8=({from:e})=>(0,Be.jsx)("div",{"data-testid":"scrubber-unapplied",style:{position:"absolute",left:`${e*100}%`,right:0,top:0,bottom:0,backgroundColor:_k,backgroundImage:Dk,borderLeft:e>0?`1px solid ${Ok}`:void 0,zIndex:2,pointerEvents:"none"}}),P8=({fraction:e,parked:t,onGrab:n})=>{let[i,r]=(0,Go.useState)(!1),o=t?Ik:Ak,a={onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!1),onPointerDown:n};return(0,Be.jsxs)(Be.Fragment,{children:[(0,Be.jsx)("div",{...a,"data-testid":"scrubber-needle-grip",style:{position:"absolute",left:`${e*100}%`,top:0,bottom:0,width:r0,transform:`translateX(${-r0/2}px)`,zIndex:3,pointerEvents:"auto",cursor:"ew-resize"}}),(0,Be.jsx)("div",{style:{position:"absolute",left:`${e*100}%`,top:0,bottom:0,width:t?2:1,background:o,boxShadow:t?Mk:void 0,zIndex:3,transform:`translateX(${t?-1:-.5}px)`,pointerEvents:"none"}}),(0,Be.jsx)("div",{...a,style:{position:"absolute",left:`${e*100}%`,top:i?-8:-6,width:0,height:0,borderLeft:`${i?6:5}px solid transparent`,borderRight:`${i?6:5}px solid transparent`,borderTop:`${i?8:7}px solid ${o}`,zIndex:3,transform:`translateX(${i?-6:-5}px)`,pointerEvents:"auto",cursor:"ew-resize"}})]})},oR=({label:e,rows:t,segmentLabel:n,stripeColor:i,fraction:r,trackWidthPx:o,empty:a=!1,testId:l})=>(0,Be.jsxs)("div",{"data-testid":l,style:{position:"absolute",top:"100%",marginTop:6,left:pn(r*o-Gm/2,0,Math.max(0,o-Gm)),width:Gm,boxSizing:"border-box",display:"flex",flexDirection:"column",gap:2,textAlign:"left",background:v.panel,border:`1px solid ${v.line}`,borderLeft:`3px solid ${a?v.dim:i}`,borderRadius:3,padding:"6px 10px",pointerEvents:"none",zIndex:5},children:[n&&(0,Be.jsx)("div",{style:{fontSize:10,color:v.dim},children:n}),(0,Be.jsx)("div",{style:{fontSize:11,fontWeight:600,color:a?v.secondary:v.primary,whiteSpace:"normal",wordBreak:"break-word"},children:e}),t.map((s,u)=>(0,Be.jsx)("div",{style:{fontSize:11,color:a?v.dim:v.secondary,whiteSpace:"normal",wordBreak:"break-word"},children:s},u))]});var uf=T(j(),1),Hr=180,up=(e,t=Hr)=>{let[n,i]=(0,uf.useState)(e),[r,o]=(0,uf.useState)(e),[a,l]=(0,uf.useState)(e);return(0,uf.useEffect)(()=>{if(t===0){i(e),o(e),l(e);return}if(e){i(!0);let u=0,c=requestAnimationFrame(()=>{u=requestAnimationFrame(()=>o(!0))}),d=setTimeout(()=>l(!0),t);return()=>{cancelAnimationFrame(c),cancelAnimationFrame(u),clearTimeout(d)}}l(!1),o(!1);let s=setTimeout(()=>i(!1),t);return()=>clearTimeout(s)},[e,t]),{mounted:n,shown:r,settled:a}};var ye=T(M(),1),cQ=1440*60*1e3,dQ={top:v.red,bottom:v.green};var z8=({side:e,onPage:t})=>(0,ye.jsx)("span",{className:Du,onPointerDown:n=>n.stopPropagation(),onMouseMove:n=>n.stopPropagation(),style:{position:"absolute",top:"50%",[e==="earlier"?"left":"right"]:-(xd+4),transform:"translateY(-50%)",display:"inline-flex",cursor:"default"},children:(0,ye.jsx)(Te,{testId:e==="earlier"?"page-earlier":"page-later",title:e==="earlier"?"Earlier":"Later",onClick:t,children:e==="earlier"?(0,ye.jsx)(l8,{size:ge}):(0,ye.jsx)(nr,{size:ge})})}),B8=({collapsed:e,onToggleCollapsed:t,canPlay:n,playTitle:i,onPlay:r,logOpen:o,onChangeLogOpen:a,standDown:l,controls:s,chart:u})=>{let{axis:c,layoutMode:d,animate:f,windowKey:h,on:m}=u,y=Bm(u.flowChart.strands),S=up(!e,f?Hr:0),p=up(u.showCommits,f?Hr:0);return(0,ye.jsxs)(Fl,{as:"div",borderColor:v.line,borderRadius:0,style:{borderLeft:"none",borderRight:"none",borderTop:"none",padding:"20px 30px 18px",overflow:"visible",pointerEvents:l?"none":void 0},children:[(0,ye.jsx)("style",{children:Wk}),(0,ye.jsx)("style",{children:qk}),(0,ye.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:e?0:Um},children:[(0,ye.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:20,opacity:l?.3:1,transition:"opacity 240ms ease"},children:[(0,ye.jsx)(R8,{collapsed:e,onToggleCollapsed:t,logOpen:o,onChangeLogOpen:a}),e?(0,ye.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:12},children:[(0,ye.jsx)(JT,{value:s.textFilter,onChange:s.onChangeTextFilter}),s.windowOnly&&(0,ye.jsx)(ZT,{on:!0,title:"Show every ticket again",onChange:s.onChangeWindowOnly}),(0,ye.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:6},children:[(0,ye.jsx)(eR,{following:s.following,disabled:!s.canFollow,title:s.followTitle,onChange:s.onChangeFollowing}),(0,ye.jsx)(tR,{canPlay:n,playTitle:i,onPlay:r})]})]}):(0,ye.jsx)(T8,{...s,canPlay:n,playTitle:i,onPlay:r})]}),S.mounted&&(0,ye.jsx)("div",{style:{display:"grid",gridTemplateRows:S.shown?"1fr":"0fr",transition:f?`grid-template-rows ${Hr}ms ease`:void 0},children:(0,ye.jsx)("div",{style:{overflow:S.settled?"visible":"hidden",minHeight:0},children:(0,ye.jsxs)("div",{"data-testid":"scrubber-track","data-axis-span":Math.round(c.span),ref:u.pageRef,className:s0,onPointerDown:m.onPointerDown,onPointerMove:m.onPointerMove,onPointerUp:m.onPointerEnd,onPointerCancel:m.onPointerEnd,onMouseMove:m.onTrackMouseMove,onMouseLeave:m.onTrackMouseLeave,style:{position:"relative",display:"flex",flexDirection:"column",gap:d==="even"&&!(u.showIssues&&u.showCommits)?0:8,transition:f?`gap ${Hr}ms ease`:void 0,cursor:u.connected?"crosshair":"default",userSelect:"none",WebkitUserSelect:"none"},children:[u.scoped&&(0,ye.jsx)("div",{"aria-hidden":!0,"data-testid":"scrubber-scoped",style:{position:"absolute",inset:`${-Fk}px ${-Nk}px`,border:`1px solid ${Hk}`,borderRadius:2,pointerEvents:"none"}}),(0,ye.jsx)("div",{"aria-hidden":!0,style:{position:"absolute",left:0,right:0,top:-Um,height:Um}}),(0,ye.jsx)(A8,{boundaries:u.segmentBoundaries,hovered:u.hoveredGrain,fractionForTime:c.fractionForTime}),u.hoveredSegment&&(0,ye.jsx)(I8,{segment:u.hoveredSegment,fractionForTime:c.fractionForTime}),(0,ye.jsxs)("div",{ref:u.trackRef,style:{position:"relative",width:"100%",height:d==="real"?_u:d==="flow"?y.height:u.showIssues?Fo:0,paddingTop:d==="real"?Po:0,paddingBottom:d==="real"?Po:0,boxSizing:"content-box",display:"flex",alignItems:"center",transition:f?`height ${Hr}ms ease`:void 0},children:[(d==="real"||d==="even"&&u.showIssues)&&(0,ye.jsx)(nR,{color:u.issueSeriesColor,anchor:d==="even"?"bottom":"centre"}),d==="real"&&c.span>=cQ&&(0,ye.jsx)(_8,{}),u.showIssues&&d==="even"&&(0,ye.jsxs)(ye.Fragment,{children:[u.hoveredBucketIndex!==null&&(0,ye.jsx)(iR,{index:u.hoveredBucketIndex,bucketCount:c.bucketCount}),(0,ye.jsx)(H8,{animate:f,children:(0,ye.jsx)(rR,{bars:u.issueBars,bucketCount:c.bucketCount,firstBar:u.issueBarRange[0],lastBar:u.issueBarRange[1],color:u.issueSeriesColor,direction:"up",animate:f})},`issues-${h}`)]}),d==="real"&&(0,ye.jsx)(u8,{layers:u.scatterLayers,animate:f,highlightId:u.highlightEventId,onPointEnter:m.onScatterPointEnter,onPointLeave:m.onScatterPointLeave,onPressCommit:m.onPressCommit}),d==="flow"&&(0,ye.jsxs)(ye.Fragment,{children:[(0,ye.jsx)(f8,{chart:u.flowChart,fractionForTime:c.fractionForTime,fractionToTime:c.fractionToTime,color:u.issueSeriesColor,animate:f,generation:h,focusIssue:u.flowFocusIssue,onPathEnter:m.onFlowPathEnter,onPathLeave:m.onFlowPathLeave,onPressPath:m.onPressFlowPath}),(0,ye.jsx)(O8,{strands:u.flowChart.strands,geometry:y})]})]}),d==="even"&&(0,ye.jsx)("div",{style:{height:u.showCommits?Fo:0,overflow:"hidden",flexShrink:0,transition:f?`height ${Hr}ms ease`:void 0},children:p.mounted&&(0,ye.jsxs)("div",{onMouseEnter:m.onCommitTrackMouseEnter,onMouseMove:m.onCommitTrackMouseMove,onMouseLeave:m.onCommitTrackMouseLeave,style:{position:"relative",width:"100%",height:Fo,animation:f?Vm:void 0},children:[(0,ye.jsx)(nR,{color:v.green,anchor:"top"}),u.hoveredCommitBucketIndex!==null&&(0,ye.jsx)(iR,{index:u.hoveredCommitBucketIndex,bucketCount:c.bucketCount}),u.linesMeasure?(0,ye.jsx)(N8,{segments:u.lineBars,bucketCount:c.bucketCount,firstBar:u.lineBarRange[0],lastBar:u.lineBarRange[1],colors:dQ,animate:f}):(0,ye.jsx)(rR,{bars:u.commitBars,bucketCount:c.bucketCount,firstBar:u.commitBarRange[0],lastBar:u.commitBarRange[1],color:v.green,direction:"down",animate:f})]},`commits-${h}`)}),u.unappliedFrom!==null&&(0,ye.jsx)(F8,{from:u.unappliedFrom}),u.thumbFraction!==null&&(0,ye.jsx)(P8,{fraction:u.thumbFraction,parked:s.isScrubbing,onGrab:m.onGrabNeedle}),!l&&(0,ye.jsx)(L8,{isScrubbing:s.isScrubbing,onReturnToLive:s.onReturnToLive}),u.rangeSelection&&(0,ye.jsx)(M8,{...u.rangeSelection}),u.boardHint&&(0,ye.jsx)(oR,{...u.boardHint,testId:"board-hint",segmentLabel:u.hoveredSegment?.label,stripeColor:u.issueSeriesColor,trackWidthPx:u.trackWidthPx}),u.commitHint&&(0,ye.jsx)(oR,{...u.commitHint,segmentLabel:u.hoveredSegment?.label,stripeColor:v.green,trackWidthPx:u.trackWidthPx}),u.paging.earlier&&(0,ye.jsx)(z8,{side:"earlier",onPage:m.onPageEarlier}),u.paging.later&&(0,ye.jsx)(z8,{side:"later",onPage:m.onPageLater}),u.paging.label!==null&&(0,ye.jsx)("span",{"data-testid":"scrubber-window-label",style:{position:"absolute",top:1,right:0,padding:"0 0 0 4px",fontSize:8,lineHeight:1,color:v.dim,background:v.panel,whiteSpace:"nowrap",pointerEvents:"none"},children:u.paging.label})]})})})]})]})};var G8=T(M(),1),fQ=120,hQ=[],mQ=new Set,pQ={strands:[],paths:[]},gQ=e=>`${e} board event${e===1?"":"s"}`,yQ="epiq.timeScrubber.collapsed",bQ="epiq.timeScrubber.allBoards",vQ="epiq.timeScrubber.categoriesExpanded",SQ="epiq.timeScrubber.expandedAxis",xQ="epiq.timeScrubber.linesMeasure",U8=({timeline:e,commits:t,historyId:n,timeTravel:i,onScrub:r,onReturnToLive:o,onRequestHistory:a,boardId:l,connected:s,socketEpoch:u,highlightEventId:c,onInspectCommit:d,onOpenIssue:f,selection:h,onChangeSelection:m,selectedIssue:y,textFilter:S,onChangeTextFilter:p,queryIssueIds:g,knownIdentities:b,refreshOn:x,onPlayTheatre:C,theatreOpen:w,logOpen:E,onChangeLogOpen:L,following:R,onChangeFollowing:k,showIssues:O,onChangeShowIssues:N,showCommits:H,onChangeShowCommits:F,linkedCommitsOnly:P,onChangeLinkedCommitsOnly:V,issueIdByRef:U,boardIssueIdByRef:X,lanes:ae,laneTitles:A,issueSummaryById:me})=>{let{scope:pe,offset:I,zoom:ue,layout:be,only:ke,windowOnly:Je,ticketOnly:Q}=h,re=Wm(ke),fe=!_a(),Ue=jk(),De=(0,se.useRef)(null),J=(0,se.useRef)(0),Le=(0,se.useRef)(null),[Ge,Rt]=(0,se.useState)(null),[$e,Ve]=(0,se.useState)(null),st=(0,se.useRef)(null),Ke=(0,se.useRef)(null),Wt=(0,se.useRef)(!1),Ht=(0,se.useRef)(null),Wn=(0,se.useRef)(null),[io,Wo]=_t(yQ,!1),[z,Z]=_t(vQ,!1),[he,Ce]=_t(xQ,!1),[Oe,Nt]=JO(SQ,qm),[mt,Jt]=_t(bQ,!1),ri=be==="real"&&fe?$m:0,Ct=u0(O,ri),Ae=u0(H,ri),[Ft,un]=(0,se.useState)(null),[za,Gt]=(0,se.useState)(null),[ie,Ba]=(0,se.useState)(null),[Fi,ro]=(0,se.useState)(null),[lr,In]=(0,se.useState)(null),[en,bi]=(0,se.useState)(null),$t=Q&&y!==null,sr=$t?{start:y.createdAt,end:Date.now()}:null,us=$t?y.id:null,Mn=(0,se.useMemo)(()=>Ym(us,g),[us,g]),cs=$t?`${y.id}:${y.createdAt}`:null,ds=sr??ue??mT(pe,I);(0,se.useEffect)(()=>{s&&($a.current=a(ds?.start,ds?.end,mt))},[pe,I,ue?.start,ue?.end,cs,l,mt,s,u,x]);let Gu=B=>m({layout:B}),$u=B=>{Ur(),m({scope:B})},jo=B=>{if(Ur(),!ue){m({offset:B});return}let ee=ue.end-ue.start,Ee=(B-I)*ee,tt=Math.min(Date.now(),ue.end-Ee);m({zoom:{start:tt-ee,end:tt}})},Vu=ue?ue.end>=Date.now():I===0,fs=s&&!$t&&(pe!=="all"||ue!==null),hs={earlier:fs,later:fs&&!Vu,label:$t||ue!==null||pe!=="all"&&I!==0?pT(pe,I,ds,ue!==null||$t):null},ut=(0,se.useRef)(null),vi=(0,se.useRef)(jo);vi.current=jo;let zr=(0,se.useRef)(hs);zr.current=hs;let Ua=(0,se.useRef)(I);Ua.current=I,(0,se.useEffect)(()=>{let B=ut.current;if(!B)return;let ee=gT(),Ee=tt=>{if(!yT(tt.deltaX,tt.deltaY))return;tt.preventDefault();let jn=ee.feed(tt.deltaX,tt.deltaY,tt.timeStamp),{earlier:so,later:kf}=zr.current;jn===-1&&so?vi.current(Ua.current+1):jn===1&&kf&&vi.current(Ua.current-1)};return B.addEventListener("wheel",Ee,{passive:!1}),()=>B.removeEventListener("wheel",Ee)},[io]);let Br=(B,ee)=>{let Ee=Math.min(B,ee),tt=Math.max(Bk,Math.abs(ee-B));Ur(),m({zoom:{start:Ee,end:Ee+tt}})},ms=(B,ee)=>m({only:YB(ke,B,ee)}),ps=(B,ee)=>m({only:of(ke,B,M0(pi(rs(ke,B)),ee)??"all")}),Yo=(B,ee,Ee)=>m({only:of(ke,B,o8(rs(ke,B),ur[B],ee,Ee))}),qu=B=>{Ur(),Jt(B)},Wu=(0,se.useMemo)(()=>{let B=pi(rs(ke,_r(re)));return JSON.stringify([re,B===null?null:[...B].sort()])},[re,ke]),Ga=(0,se.useRef)(0),Ko=(0,se.useRef)(!0),Ur=()=>{Ko.current=!0},gs=(0,se.useRef)({timeline:e,commits:t}),$a=(0,se.useRef)(null);!(st.current!==null||Ke.current!==null)&&$a.current!==null&&n===$a.current&&($a.current=null,gs.current={timeline:e,commits:t},Ko.current&&(Ko.current=!1,Ga.current+=1));let jt=gs.current,He=(0,se.useMemo)(()=>oT(jt.timeline,jt.commits),[jt]),K=(e?.events.length??0)>0,ur=(0,se.useMemo)(()=>{let B=Zk(jt.timeline),ee={};for(let Ee of Gn)ee[Ee]=a8(B[Ee],pi(rs(ke,Ee)),b[Ee]);return ee},[jt,ke,b]),ys=(0,se.useMemo)(()=>{let B={};for(let ee of Gn)B[ee]=jB(ke,ee);return B},[ke]),bs=(0,se.useMemo)(()=>{let B={};for(let ee of Gn)B[ee]=I0(ur[ee],rs(ke,ee));return B},[ur,ke]),Xo=_r(re),vs=Xo===null?hQ:ur[Xo],cr=Xo===null?mQ:bs[Xo],Y0=(0,se.useMemo)(()=>jm(vs,cr),[vs,cr]),ju=(0,se.useMemo)(()=>lT(He,jt.timeline,re,cr,Mn),[He,jt,re,cr,Mn]),yp=_0({everyBoard:U,thisBoard:X,ticketFocus:$t,everyBoardPlotted:mt}),dr=(0,se.useMemo)(()=>O0(jt.commits,P,$t,yp,Mn),[jt.commits,P,$t,yp,Mn]),oo=(0,se.useMemo)(()=>sT(He,dr),[He,dr]),bp=(0,se.useMemo)(()=>eT(jt.timeline,re,cr,Mn),[jt,re,cr,Mn]),vp=(0,se.useMemo)(()=>{let B=new Map;for(let[ee,Ee]of me)Ee.assignee&&B.set(ee,Ee.assignee.color);return B},[me]),Ss=(0,se.useMemo)(()=>be==="flow"?vT(O?jt.timeline:null,ae,A,re,cr,Mn,vp):pQ,[be,O,jt,ae,A,re,cr,Mn,vp]),Sp=(0,se.useMemo)(()=>{if(Fi)return Fi.path.issue;if(c!==null){let B=Ss.paths.find(ee=>ee.vertices.some(Ee=>Ee.eventId===c));if(B)return B.issue}return y?.id??null},[Fi,c,Ss,y]),Va=Ge!==null||$e!==null,K0=(0,se.useMemo)(()=>dr.map(B=>({key:B.sha,id:null,t:B.time,fraction:He.fractionForTime(B.time),hourFraction:d0(B.time),radius:2,color:v.green,opacity:.55,title:`${B.subject} \u2014 ${eo(zm(B)).label} (${B.linesChanged.toLocaleString()} lines)`,commitSha:B.sha})),[dr,He]),xp=(0,se.useMemo)(()=>bp.map(B=>({key:B.key,id:B.id,t:B.t,fraction:He.fractionForTime(B.t),hourFraction:d0(B.t),radius:B.size/2,color:B.color,opacity:B.opacity,title:Jk(B),commitSha:null})),[bp,He]),yf=(0,se.useMemo)(()=>{let B=Oa(ju,1);return ju.flatMap((ee,Ee)=>ee>0?[{index:Ee,intensity:ee/B}]:[])},[ju]),Yu=(0,se.useMemo)(()=>{let B=Oa(Array.from(oo.values(),ee=>ee.count),1);return Array.from(oo,([ee,Ee])=>({index:ee,intensity:Ee.count/B}))},[oo]),bf=(0,se.useMemo)(()=>{let B=Oa(Array.from(oo.values(),ee=>ee.insertions+ee.deletions),1);return Array.from(oo,([ee,Ee])=>{let tt=Ee.insertions+Ee.deletions,jn=uT(tt,B);return{index:ee,top:tt===0?0:jn*Ee.deletions/tt,bottom:tt===0?0:jn*Ee.insertions/tt}}).filter(ee=>ee.top+ee.bottom>0)},[oo]),qa=(0,se.useMemo)(()=>Km(bf.map(B=>({index:B.index,intensity:1}))),[bf]),X0=(0,se.useMemo)(()=>Km(yf),[yf]),Ep=(0,se.useMemo)(()=>Km(Yu),[Yu]),wp=(0,se.useRef)(l);(0,se.useEffect)(()=>{l===null||l===wp.current||(wp.current=l,Ur())},[l]);let Ku=`${be}-${Ga.current}-${Wu}`,Wa=(0,se.useMemo)(()=>[...Ae.mounted?[{id:"commits",points:K0,generation:Ku,leaving:Ae.leaving}]:[],...Ct.mounted?[{id:"issues",points:xp,generation:Ku,leaving:Ct.leaving}]:[]],[K0,xp,Ae,Ct,Ku]),Xu=i.mode==="scrub"&&i.asOfTime!==null?i.asOfTime>=He.earliest&&i.asOfTime<=He.latest?He.fractionForTime(i.asOfTime):null:Vu?1:null,Q0=i.mode==="scrub"&&i.asOfTime!==null?i.asOfTime<He.earliest?0:i.asOfTime>He.latest?null:He.fractionForTime(i.asOfTime):null,Cp=B=>{let ee=De.current;if(!ee)return 0;let Ee=ee.getBoundingClientRect();return pn((B-Ee.left)/Math.max(1,Ee.width),0,1)},Qo=(B,ee)=>{if(!s||w||!aT(He))return;let Ee=He.fractionToTime(B);if(Ee===Le.current)return;let tt=Date.now();!ee&&tt-J.current<fQ||(J.current=tt,Le.current=Ee,r(Ee))};(0,se.useEffect)(()=>{i.mode!=="scrub"&&(Le.current=null)},[i.mode]);let Z0=()=>{Wt.current=!1;let B=Ht.current;Ht.current=null;let ee=Wn.current;Wn.current=null;let Ee=st.current,tt=Ke.current;if(st.current=null,Ke.current=null,Ee!==null){Qo(Ee,!0),Rt(null),Ve(null);return}if(tt===null)return;let{from:jn,to:so}=tt;Ve(null);let kf=De.current?.clientWidth??0;if(Math.abs(so-jn)*kf<zk){if(B!==null){d(B);return}if(ee!==null){f(ee);return}Qo(jn,!0);return}Br(He.fractionToTime(jn),He.fractionToTime(so))},ja=B=>{let ee=B.currentTarget.getBoundingClientRect();return pn((B.clientX-ee.left)/Math.max(1,ee.width),0,1)},vf=B=>pn(Math.floor(ja(B)*He.bucketCount),0,He.bucketCount-1),Sf=B=>B!==null&&B<He.bucketCount?He.bucketTimeAt(B):void 0,kp=B=>(B+.5)/He.bucketCount,xf=(0,se.useCallback)(B=>{if(B.commitSha){let ee=dr.find(Ee=>Ee.sha===B.commitSha);ee&&(Ba({commit:ee,fraction:B.fraction}),un(null));return}Ba(null),un({label:No(new Date(B.t)),detail:B.title,t:B.t,fraction:B.fraction})},[dr]),J0=(0,se.useCallback)(()=>{un(null),Ba(null)},[]),eS=(0,se.useCallback)(B=>{ro(B)},[]),tS=(0,se.useCallback)(()=>{ro(null)},[]),nS=(0,se.useMemo)(()=>{if(be!=="flow"||Fi===null)return null;let{path:B,t:ee,fraction:Ee}=Fi,tt=me.get(B.issue),jn=xT(B,ee),so=jn===null?null:Ss.strands[jn]?.title??null;return{label:No(new Date(ee)),rows:[tt?`${tt.ref} ${tt.title}`:B.issue,...so===null?[]:[`In ${so}`],...tt?.assignee?[`Assigned to ${tt.assignee.name}`]:[]],fraction:Ee}},[be,Fi,me,Ss]),Qu=Sf(lr),Ef=lr!==null?ju[lr]:void 0,wf=be==="flow"?nS:be==="even"?O&&Qu!==void 0&&Ef!==void 0?{label:Xm(Qu,Qu+He.bucketMs),rows:[gQ(Ef)],fraction:kp(lr),empty:Ef===0}:null:Ft?{label:Ft.label,rows:[Ft.detail],fraction:Ft.fraction}:null,ao=en!==null?oo.get(en):void 0,xs=Sf(en),iS=be==="flow"?null:be==="even"?ao&&xs!==void 0?{label:Xm(xs,xs+He.bucketMs),rows:[`${ao.count} commit${ao.count===1?"":"s"}`,he?`+${ao.insertions.toLocaleString()} \u2212${ao.deletions.toLocaleString()}`:`${ao.linesChanged.toLocaleString()} lines changed`],fraction:kp(en)}:null:ie?{label:No(new Date(ie.commit.time)),rows:[ie.commit.subject,`${eo(zm(ie.commit)).label} \u2022 ${ie.commit.linesChanged.toLocaleString()} lines`],fraction:ie.fraction}:null,Zu=(be==="even"?Qu??Sf(en):Fi?.t??Ft?.t??ie?.commit.time??(za!==null?He.fractionToTime(za):void 0))??null,rS=fT(He.span),Es=dT(He.span),Cf=(0,se.useMemo)(()=>hT(He.earliest,He.latest,Es),[He,Es]),lo=$e!==null,oS=$e&&{label:Xm(He.fractionToTime(Math.min($e.from,$e.to)),He.fractionToTime(Math.max($e.from,$e.to))),rows:["Release to zoom the window to this stretch"],fraction:($e.from+$e.to)/2},aS=s?zT(e)?"Play this window of the board's history":e&&e.events.length===0&&e.buckets.length>0?"Too many events in this window to play it \u2014 narrow the window":"Not enough history in this window to play":"Not while the connection is down";return(0,G8.jsx)(B8,{collapsed:io,onToggleCollapsed:()=>Wo(!io),canPlay:s&&!w&&zT(e),playTitle:aS,onPlay:C,logOpen:E,onChangeLogOpen:L,standDown:w,controls:{connected:s,scope:pe,zoomed:ue!==null,windowOnly:Je,following:R,onChangeFollowing:k,canFollow:s&&!w&&i.mode!=="scrub",followTitle:s?w?"A movie is playing":i.mode==="scrub"?"The board is in the past \u2014 put it back at now first":R?"Stop following the newest event":"Follow the newest event":"Offline \u2014 nothing is arriving",windowFilterable:ns(e),narrow:Ue,ticketFocus:$t,textFilter:S,onChangeTextFilter:p,layoutMode:be,showIssues:O,showCommits:H,linkedCommitsOnly:P,onChangeLinkedCommitsOnly:V,linesMeasure:he,onChangeLinesMeasure:Ce,allBoards:mt,onChangeScope:$u,onChangeWindowOnly:B=>m({windowOnly:B}),onChangeLayoutMode:Gu,onChangeShowIssues:N,onChangeShowCommits:F,onChangeAllBoards:qu,boardView:re,identitiesByAxis:ur,hiddenIdsByAxis:bs,axisStates:ys,narrowed:qT(ke),categoriesExpanded:z,expandedAxis:Oe,categoriesFiltered:K,isScrubbing:i.mode==="scrub",onReturnToLive:o,onToggleAxis:ms,onToggleIdentity:Yo,onOnlyIdentity:ps,onToggleCategoriesExpanded:()=>Z(!z),onSetExpandedAxis:Nt},chart:{scoped:Je&&Hu(pe,ue!==null)&&ns(e),trackRef:De,pageRef:ut,paging:hs,axis:He,layoutMode:be,animate:fe,windowKey:Ku,showIssues:O,showCommits:H,issueScatter:Ct,commitScatter:Ae,issueBars:yf,issueBarRange:X0,commitBars:Yu,commitBarRange:Ep,linesMeasure:he,lineBars:bf,lineBarRange:qa,scatterLayers:Wa,flowChart:Ss,flowFocusIssue:Sp,issueSeriesColor:Y0?.color??Ou(re),dragging:Va,rangeSelection:$e,commits:dr,hoveredCommitSha:ie?.commit.sha??null,hoveredBucketIndex:lo?null:lr,hoveredCommitBucketIndex:lo?null:en,hoveredSegment:Zu!==null&&!lo?Jd(Zu,rS):null,segmentBoundaries:Cf,hoveredGrain:Zu!==null&&!lo?Jd(Zu,Es):null,connected:s,thumbFraction:Ge??Xu,unappliedFrom:Ge??Q0,highlightEventId:c,trackWidthPx:De.current?.clientWidth??0,boardHint:lo?oS:wf,commitHint:lo?null:iS,on:{onPageEarlier:()=>jo(I+1),onPageLater:()=>jo(I-1),onPointerDown:B=>{B.currentTarget.setPointerCapture(B.pointerId);let ee=Cp(B.clientX);if(!Wt.current){Ke.current={from:ee,to:ee},Ve({from:ee,to:ee});return}st.current=ee,Rt(ee),Qo(ee,!0)},onPointerMove:B=>{let ee=Ke.current;if(st.current===null&&ee===null)return;let Ee=Cp(B.clientX);if(ee!==null){Ke.current={from:ee.from,to:Ee},Ve({from:ee.from,to:Ee});return}st.current=Ee,Rt(Ee),Qo(Ee,!1)},onPointerEnd:Z0,onGrabNeedle:()=>{Wt.current=!0},onTrackMouseMove:B=>{if(be==="even"){In(vf(B));return}Gt(ja(B))},onTrackMouseLeave:()=>{In(null),Gt(null)},onCommitTrackMouseEnter:()=>In(null),onCommitTrackMouseMove:B=>{B.stopPropagation(),bi(vf(B))},onCommitTrackMouseLeave:()=>bi(null),onScatterPointEnter:xf,onScatterPointLeave:J0,onFlowPathEnter:eS,onFlowPathLeave:tS,onPressFlowPath:B=>{Wn.current=B},onPressCommit:B=>{Ht.current=B}}}})};var cf=T(j(),1);var Ut=T(M(),1),$8=.02,V8=2,aR=9,q8=24,EQ=e=>({background:"transparent",border:`1px solid ${e?v.accent:v.line}`,color:e?v.accent:v.secondary,borderRadius:3,width:q8,height:q8,display:"inline-flex",alignItems:"center",justifyContent:"center",cursor:"pointer",flexShrink:0,padding:0,transition:"color 160ms ease, border-color 160ms ease"}),W8=({plan:e,playback:t,onExit:n})=>{let i=!_a(),r=(0,cf.useRef)(null),{progress:o,playing:a,done:l,speed:s,cursor:u,current:c,currentTime:d,totalCount:f,toggle:h,cycleSpeed:m,seekTo:y,beginSeek:S,endSeek:p}=t,g=(0,cf.useRef)(n);g.current=n;let b=(0,cf.useRef)(h);b.current=h,(0,cf.useEffect)(()=>{let C=w=>{let E=w.target,L=E?.tagName??"";if(!(E&&(E.isContentEditable||["INPUT","TEXTAREA","SELECT"].includes(L)))){if(w.key==="Escape"){w.preventDefault(),g.current();return}L!=="BUTTON"&&(w.key===" "||w.key==="Spacebar")&&(w.preventDefault(),b.current())}};return document.addEventListener("keydown",C),()=>document.removeEventListener("keydown",C)},[]);let x=C=>{let w=C.currentTarget.getBoundingClientRect();return pn((C.clientX-w.left)/Math.max(1,w.width),0,1)};return(0,Ut.jsxs)(Ut.Fragment,{children:[(0,Ut.jsx)("style",{children:kB}),(0,Ut.jsx)("div",{"data-testid":"theatre-vignette",style:{position:"fixed",inset:0,pointerEvents:"none",zIndex:40,background:"radial-gradient(120% 90% at 50% 45%, rgba(6,7,10,0) 35%, rgba(6,7,10,0.72) 100%)",animation:i?"epiqTheatreFade 320ms ease-out":void 0}}),(0,Ut.jsxs)("div",{"data-testid":"theatre-player",role:"group","aria-label":"History player",style:{position:"fixed",left:0,right:0,bottom:0,zIndex:50,display:"flex",flexDirection:"column",gap:9,padding:"11px 30px 13px",borderTop:`1px solid ${v.line}`,background:"rgba(13, 16, 22, 0.94)",backdropFilter:"blur(14px)",WebkitBackdropFilter:"blur(14px)",animation:i?"epiqTheatreRise 260ms ease-out":void 0},children:[(0,Ut.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:14},children:[(0,Ut.jsx)(Te,{testId:"theatre-toggle",title:l?"Play again":a?"Pause":"Play","aria-label":l?"Play again":a?"Pause":"Play",pressed:a,onClick:h,children:l?(0,Ut.jsx)(WH,{size:ge}):a?(0,Ut.jsx)(qH,{size:ge}):(0,Ut.jsx)(VH,{size:ge})}),(0,Ut.jsxs)("div",{"data-testid":"theatre-progress",role:"slider","aria-label":"Playback position","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(o*100),tabIndex:0,ref:r,onPointerDown:C=>{C.currentTarget.setPointerCapture(C.pointerId),S(),y(x(C))},onPointerMove:C=>{C.currentTarget.hasPointerCapture(C.pointerId)&&y(x(C))},onPointerUp:C=>{C.currentTarget.releasePointerCapture(C.pointerId),p()},onPointerCancel:p,onKeyDown:C=>{let w=C.key==="ArrowLeft"?-$8:C.key==="ArrowRight"?$8:null;w!==null&&(C.preventDefault(),y(o+w))},style:{position:"relative",flex:1,height:18,display:"flex",alignItems:"center",cursor:"pointer",touchAction:"none"},children:[(0,Ut.jsx)("div",{style:{position:"absolute",left:0,right:0,height:V8,borderRadius:999,background:"rgba(122, 157, 214, 0.22)"}}),(0,Ut.jsx)("div",{style:{position:"absolute",left:0,width:`${o*100}%`,height:V8,borderRadius:999,background:`linear-gradient(90deg, #b3a5ff, ${v.accent})`}}),(0,Ut.jsx)("div",{style:{position:"absolute",left:`${o*100}%`,width:aR,height:aR,marginLeft:-aR/2,borderRadius:"50%",background:v.accent,boxShadow:"0 0 5px rgba(118, 212, 255, 0.35)"}})]}),(0,Ut.jsxs)("button",{type:"button","data-testid":"theatre-speed",onClick:m,title:"Playback speed",style:{...EQ(!1),width:34,fontFamily:"inherit",fontSize:W.label,color:v.accent},children:[s,"\xD7"]}),(0,Ut.jsx)(Te,{testId:"theatre-exit",title:"Close the player","aria-label":"Close the history player",onClick:n,children:(0,Ut.jsx)(av,{size:ge})})]}),(0,Ut.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:12,fontSize:W.meta,minHeight:16},children:[(0,Ut.jsx)("span",{"data-testid":"theatre-time",style:{color:v.accent,fontVariantNumeric:"tabular-nums",flexShrink:0},children:No(new Date(d))}),(0,Ut.jsxs)("span",{"data-testid":"theatre-count",style:{color:v.dim2,fontVariantNumeric:"tabular-nums",flexShrink:0},children:[u+1,"/",f," edits"]}),(0,Ut.jsx)("span",{"data-testid":"theatre-caption",style:{color:v.secondary,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",animation:i?"epiqTheatreCaption 220ms ease-out":void 0},children:c?c.label:`Opening on the board before ${No(new Date(e.events[0].t))}`},c?.id??"start")]})]})]})};var Tt=T(j(),1);var dp=["time","kind","actor","diff","label"],lR={time:"Time",actor:"Actor",kind:"Type",diff:"Diff",label:"Label"},cp=e=>`epiq.eventLog.${e}`,wQ=e=>`epiq-log--no-${e}`,j8=e=>dp.filter(t=>!e[t]).map(wQ).join(" "),Y8=()=>{let[e,t]=_t(cp("time"),!0),[n,i]=_t(cp("actor"),!0),[r,o]=_t(cp("kind"),!0),[a,l]=_t(cp("diff"),!0),[s,u]=_t(cp("label"),!0),c={time:t,actor:i,kind:o,diff:l,label:u};return{fields:{time:e,actor:n,kind:r,diff:a,label:s},setField:(d,f)=>c[d](f)}};var CQ=110,kQ=48,K8=e=>Math.max(1,Math.floor((e-kQ)/CQ)),sR=(e,t)=>e.name<t.name?-1:e.name>t.name?1:0,X8=(e,t=Number.POSITIVE_INFINITY)=>{let n=new Map;for(let a of e){if(!a.actor)continue;let l=n.get(a.actor.name);l?l.lines++:n.set(a.actor.name,{name:a.actor.name,lines:1})}let i=[...n.values()],r=({name:a})=>({name:a});if(i.length<=t)return i.sort(sR).map(r);let o=i.sort((a,l)=>l.lines-a.lines||sR(a,l)).slice(0,Math.max(1,t-1)).sort(sR);return[...o.map(r),{name:`+${i.length-o.length} more`,others:!0}]},Q8=e=>new Map(e.map((t,n)=>[t.name,n])),Z8=(e,t,n)=>{if(!e.actor)return null;let i=n.get(e.actor.name);if(i!==void 0)return i;let r=t.length-1;return t[r]?.others?r:null},TQ="epiq.eventLog.split",J8=()=>_t(TQ,!1);var fp=T(M(),1),uR=({field:e,fields:t,spoken:n,onChangeField:i})=>(0,fp.jsx)(Ma,{testId:`log-field-${e}`,label:lR[e],checked:t[e]&&!n,disabled:n,activeColor:v.dim,title:n?"The lane says who":`${t[e]?"Hide":"Show"} the ${lR[e].toLowerCase()} on each line`,onChange:r=>i(e,r)}),eU=({fields:e,onChangeField:t,spokenField:n})=>(0,fp.jsx)(Pl,{label:"View options",testId:"log-fields-menu",title:"Choose what each line shows",chevronSize:14,popupRole:"group",children:()=>dp.map(i=>(0,fp.jsx)(Ir,{children:(0,fp.jsx)(uR,{field:i,fields:e,spoken:i===n,onChangeField:t})},i))});var df=T(M(),1),tU=({size:e=16})=>(0,df.jsxs)("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,df.jsx)("rect",{x:"3",y:"4",width:"18",height:"16",rx:"2"}),(0,df.jsx)("line",{x1:"9",y1:"4",x2:"9",y2:"20"}),(0,df.jsx)("line",{x1:"15",y1:"4",x2:"15",y2:"20"})]});var Nr=T(j(),1),nU=({storageKey:e,fallback:t,min:n,max:i,grows:r})=>{let[o,a]=(0,Nr.useState)(()=>{let m=Number(localStorage.getItem(e));return Number.isFinite(m)&&m>=n?m:t}),[l,s]=(0,Nr.useState)(!1),u=(0,Nr.useRef)(o);(0,Nr.useEffect)(()=>{u.current=o},[o]);let c=(0,Nr.useRef)(null),d=(0,Nr.useCallback)(m=>{let y=c.current;if(!y)return;let S=r==="right"?m.clientX-y.pointer:y.pointer-m.clientX;a(Math.min(y.max,Math.max(n,y.size+S)))},[r,n]),f=(0,Nr.useCallback)(()=>{c.current=null,s(!1),document.removeEventListener("pointermove",d),document.removeEventListener("pointerup",f),document.body.style.cursor="",document.body.style.userSelect="",localStorage.setItem(e,String(u.current))},[d,e]);return(0,Nr.useEffect)(()=>()=>{c.current&&f()},[f]),{width:o,dragging:l,onPointerDown:m=>{m.preventDefault(),c.current={pointer:m.clientX,size:u.current,max:i()},s(!0),document.addEventListener("pointermove",d),document.addEventListener("pointerup",f),document.body.style.cursor="ew-resize",document.body.style.userSelect="none"}}};var ff=T(M(),1),iU=({size:e=14})=>(0,ff.jsxs)("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,ff.jsx)("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"}),(0,ff.jsx)("polyline",{points:"15 3 21 3 21 9"}),(0,ff.jsx)("line",{x1:"10",y1:"14",x2:"21",y2:"3"})]});var at=T(M(),1),RQ=440,LQ=280,AQ=1e3,IQ=.6,MQ="epiq.eventLog.width",DQ=xd,_Q=400,OQ=gi*2,HQ=({fields:e,onChangeField:t,split:n,onChangeSplit:i,canSplit:r,folded:o,children:a})=>(0,at.jsxs)("div",{"data-testid":"event-log-header",style:{display:"flex",alignItems:"center",gap:12,flexShrink:0,height:DQ,padding:`${8}px ${ep}px ${8}px 30px`,borderBottom:`1px solid ${v.line}`},children:[o?(0,at.jsx)(eU,{fields:e,onChangeField:t,spokenField:n&&r?"actor":null}):dp.map(l=>(0,at.jsx)(uR,{field:l,fields:e,spoken:l==="actor"&&n&&r,onChangeField:t},l)),(0,at.jsxs)("span",{style:{marginLeft:"auto",display:"inline-flex",alignItems:"center"},children:[(0,at.jsx)(Te,{testId:"log-split",title:r?"Give each actor a lane of their own":"Nobody signed these lines","aria-label":"Split",pressed:n&&r,disabled:!r,onClick:()=>i(!n),children:(0,at.jsx)(tU,{size:ge})}),a]})]}),NQ=({lanes:e})=>(0,at.jsx)("div",{"data-testid":"log-lane-heads",className:Jm,children:e.map(t=>(0,at.jsx)("span",{title:t.name,children:eo(t.name).label},t.name))}),FQ=({entries:e,moment:t,bottomClearance:n,onOpen:i,at:r=null,followedLine:o=null,eventsUnlisted:a=!1,onPinnedChange:l,onHoverEvent:s,layout:u="panel",revealed:c=!0,settled:d=!0,onPopOut:f,onDock:h})=>{let m=!_a(),{fields:y,setField:S}=Y8(),[p,g]=J8(),b=(0,Tt.useRef)(null),x=(0,Tt.useRef)(null),[C,w]=(0,Tt.useState)(()=>new Map),[E,L]=(0,Tt.useState)(()=>new Set),R=(0,Tt.useMemo)(()=>b0(e),[e]),k=(0,Tt.useMemo)(()=>y0(R),[R]),O=e[e.length-1]?.id??null,[N,H]=(0,Tt.useState)(null),[F,P]=(0,Tt.useState)(0),V=(0,Tt.useMemo)(()=>X8(e,K8(F)),[e,F]),U=(0,Tt.useMemo)(()=>Q8(V),[V]),X=p&&V.length>0,ae=(0,Tt.useMemo)(()=>N===null?Math.min(tB,R.length):nB(R,N),[R,N]),A=(0,Tt.useRef)(!0),me=()=>{let Q=b.current;if(!Q)return;let re=A.current;A.current=Q.scrollHeight-Q.scrollTop-Q.clientHeight<=OQ,re!==A.current&&l?.(A.current)};(0,Tt.useEffect)(()=>{l?.(A.current)},[l]),(0,Tt.useLayoutEffect)(()=>{let Q=b.current;if(!Q)return;let re=()=>{let Ue=Q.clientHeight-n-gi*2;H(Math.max(1,Math.floor(Ue/gi))),P(Q.clientWidth)};re();let fe=new ResizeObserver(re);return fe.observe(Q),()=>fe.disconnect()},[n]);let pe=(0,Tt.useRef)(null),I=()=>{let Q=pe.current,re=x.current;!Q||!re||Q.offsetTop<re.offsetTop+re.offsetHeight||(Q.style.top="0px",Q.style.opacity="0")};(0,Tt.useLayoutEffect)(()=>{let Q=b.current;!Q||!A.current||(I(),Q.scrollTop=Q.scrollHeight)},[O,R.length,C,ae]),(0,Tt.useLayoutEffect)(()=>{let Q=b.current;Q&&(A.current=!0,l?.(!0),I(),Q.scrollTop=Q.scrollHeight)},[t,l]);let ue=(0,Tt.useRef)(new Set);(0,Tt.useEffect)(()=>{let Q=x.current,re=ue.current,fe=R.flatMap((De,J)=>MT(R,J,C,ae)?[De.key,...De.entries.map(Le=>Le.id)]:[De.key]),Ue=fe.filter(De=>!re.has(De)).length;ue.current=new Set(fe),!(!Q||!m||O===null||Ue===0||!A.current)&&Q.animate(rB(Ue),oB)},[O,m]);let be=Q=>{let re=pe.current;if(!re)return;let fe=RT(Q);fe&&(re.style.top=`${fe.offsetTop}px`),re.style.opacity=fe?"1":"0",fe&&X?(re.style.right="auto",re.style.left=`${fe.offsetLeft+fe.offsetWidth-re.offsetWidth}px`):X||(re.style.right="",re.style.left="")},ke=nU({storageKey:MQ,fallback:RQ,min:LQ,max:()=>Math.min(AQ,window.innerWidth*IQ),grows:"right"}),Je=u==="window";return(0,at.jsxs)("aside",{"data-testid":"event-log","data-settled":d?"true":"false","aria-live":"off",style:{position:"relative",width:Je?"100%":c?ke.width:0,flexShrink:0,minHeight:0,display:"flex",flexDirection:"column",overflow:d?void 0:"hidden",transition:Je||ke.dragging||!m?void 0:`width ${Hr}ms ease`,borderRight:Je?"none":`1px solid ${v.edgeOnChrome}`,boxShadow:Je?void 0:"10px 0 24px rgba(0, 0, 0, 0.45)",background:v.chrome,[OT]:V.length},children:[(0,at.jsx)("style",{children:v0}),!Je&&(0,at.jsx)(Nb,{edge:"right",active:ke.dragging,onPointerDown:ke.onPointerDown,testId:"event-log-resize"}),(0,at.jsxs)("div",{style:{width:Je?"100%":ke.width,flex:1,minHeight:0,display:"flex",flexDirection:"column"},children:[(0,at.jsxs)(HQ,{fields:y,onChangeField:S,split:p,onChangeSplit:g,canSplit:V.length>0,folded:F>0&&F<_Q,children:[f&&(0,at.jsx)(Te,{testId:"log-pop-out",title:"Open the log in its own window",onClick:f,children:(0,at.jsx)(iU,{size:ge})}),h&&(0,at.jsx)(Te,{testId:"log-dock",title:"Put the log back beside the board",onClick:h,children:(0,at.jsx)(N0,{size:ge})})]}),(0,at.jsxs)("div",{ref:b,className:`epiq-log-pane ${j8(y)} ${X?Nu:""}`.replace(/\s+/g," ").trim(),onScroll:me,onClick:Q=>{let re=Yz(Q.target);re&&i(re)},onMouseOver:Q=>{be(Q.target),s?.(Q.target.closest("[data-event-id]")?.getAttribute("data-event-id")??null)},onMouseLeave:()=>{be(null),s?.(null)},"data-testid":"event-log-scroll",style:{flex:1,minHeight:0,overflowY:"auto",overflowX:"hidden",position:"relative",display:"flex",flexDirection:"column",padding:`0 ${ep}px ${n+gi*2}px 30px`},children:[(0,at.jsxs)("span",{ref:pe,className:g0,"data-testid":"log-row-arrow","aria-hidden":"true",children:[(0,at.jsx)("span",{style:{fontSize:9,fontWeight:600,letterSpacing:.5,textTransform:"uppercase"},children:"View"}),(0,at.jsx)(Jv,{size:11})]}),X&&(0,at.jsx)(NQ,{lanes:V}),(0,at.jsxs)("div",{ref:x,style:{marginTop:"auto"},children:[a&&(0,at.jsx)("div",{"data-testid":"log-events-unlisted",style:{display:"flex",alignItems:"center",gap:6,margin:`4px ${ep}px 8px`,padding:"5px 8px",borderLeft:`2px solid ${v.dim2}`,color:v.dim2,fontSize:W.meta,lineHeight:1.4},children:"Too many events in this window to list one by one \u2014 narrow the window to read them. The chart above still counts them all."}),R.map((Q,re)=>{let fe=MT(R,re,C,ae),{shown:Ue,hidden:De}=iB(Q,E.has(Q.key));return(0,at.jsxs)("div",{style:y.actor&&!X?{[is]:k[re]}:void 0,children:[(0,at.jsx)(S0,{label:Q.label,count:Q.entries.length,open:fe,onToggle:()=>w(J=>{let Le=new Map(J);return Le.set(Q.key,!fe),Le})}),fe&&(0,at.jsxs)("div",{className:_T,children:[De>0&&(0,at.jsx)(x0,{hidden:De,label:Q.label,onExpand:()=>L(J=>new Set(J).add(Q.key))}),Ue.map(J=>(0,at.jsx)(E0,{entry:J,showLabel:y.label,followed:J.id===o,lane:X?Z8(J,V,U):void 0},J.id))]})]},Q.key)})]})]})]})]})},z0=(0,Tt.memo)(FQ);var hp=T(M(),1),rU=()=>(0,hp.jsxs)("div",{"data-testid":"follow-banner",style:{display:"flex",alignItems:"center",justifyContent:"center",gap:8,padding:"6px 12px",borderTop:`2px solid ${v.accent}`,color:v.primary,fontSize:11,letterSpacing:.3,pointerEvents:"none"},children:[(0,hp.jsx)("strong",{style:{color:v.accent,letterSpacing:.6},children:"LIVE"}),(0,hp.jsx)("span",{children:"The board navigates on events. Click anywhere to opt out."})]});var oU=T(j(),1),aU="epiq.aside.dock",PQ=()=>localStorage.getItem(aU)==="bottom"?"bottom":"right",lU=()=>{let[e,t]=(0,oU.useState)(PQ);return[e,n=>{t(n),localStorage.setItem(aU,n)}]};var Ni=T(j(),1);var zQ=(e,t)=>{let n=e.toLowerCase(),i=[],r=0;for(let o of t){let a=n.indexOf(o,r);if(a===-1)return null;i.push(a),r=a+1}return i},BQ=(e,t,n)=>{let i=e.toLowerCase().startsWith(t)?1e3:0,r=0;for(let o=1;o<n.length;o+=1)n[o]===n[o-1]+1&&(r+=1);return i+r*10-(n[0]??0)},cR=(e,t,n={})=>{let{recentIds:i=[],rank:r=()=>0,limit:o}=n,a=t.trim().toLowerCase(),l=u=>o===void 0?u:u.slice(0,o);if(!a){let u=new Map(i.map((d,f)=>[d,i.length-f])),c=[...e].map((d,f)=>({item:d,hits:[],score:0,index:f})).sort((d,f)=>{let h=r(d.item)-r(f.item);if(h!==0)return h;let m=(u.get(f.item.id)??0)-(u.get(d.item.id)??0);return m!==0?m:d.index-f.index});return l(c.map(({item:d,hits:f,score:h})=>({item:d,hits:f,score:h})))}let s=e.flatMap(u=>{let c=zQ(u.title,a);return c?[{item:u,hits:c,score:BQ(u.title,a,c)}]:[u.id,...u.keywords??[]].some(f=>f.toLowerCase().includes(a))?[{item:u,hits:[],score:0}]:[]});return l(s.sort((u,c)=>{let d=r(u.item)-r(c.item);return d!==0?d:c.score-u.score}))};var Fr={PALETTE:"?",EXIT:"exit",INIT:"init",OPEN:"open",HELP:"help",NEW:"new",TAG:"tag",UNTAG:"untag",MOVE:"move",PEEK:"peek",REPLAY:"replay",FILTER:"filter",ASSIGN:"assign",UNASSIGN:"unassign",DELETE:"delete",CLOSE_ISSUE:"close",RE_OPEN_ISSUE:"reopen",COMMENT:"comment",CONFIG:"config",EDIT:"edit",YANK:"yank",SYNC:"sync",EXPORT:"export",NONE:""};var sU=e=>e.issue?null:"Open a ticket first",mp=e=>e.connected?e.scrubbing?"Read-only while viewing history":null:"Not connected",zu=e=>mp(e)??sU(e),UQ=e=>{let t=mp(e);return t||(e.board?e.board.readonly?"This board is read-only":null:"No board on screen")},uU=()=>[{id:Fr.NEW,title:"New ticket",group:"Board",keywords:["create","add","issue"],unavailable:mp,run:e=>e.handlers.createIssue()},{id:"gui:search",title:"Search all tickets",group:"Board",keywords:["search","find","goto","jump","filter"],unavailable:e=>e.tickets.length?null:"No tickets to search",getArguments:e=>e.tickets.map(t=>({id:t.id,title:t.title,keywords:[t.ref],hint:`${t.boardTitle} \xB7 ${t.ref}`})),run:(e,t)=>{let n=e.tickets.find(i=>i.id===t?.id);n&&e.handlers.openIssue(n.id,n.boardRef)}},{id:"gui:swimlane",title:"New swimlane",group:"Board",keywords:["column","lane","create"],unavailable:mp,run:e=>e.handlers.createSwimlane()},{id:"gui:board",title:"New board",group:"Board",keywords:["create","add","project","another"],unavailable:mp,run:e=>e.handlers.createBoard()},{id:"gui:board:rename",title:"Rename board",group:"Board",keywords:["title","edit","name"],unavailable:UQ,run:e=>e.handlers.renameBoard()},{id:Fr.COMMENT,title:"Comment on ticket",group:"Ticket",unavailable:zu,run:e=>{e.issue&&e.handlers.commentOnIssue(e.issue.id)}},{id:Fr.TAG,title:"Add a tag",group:"Ticket",keywords:["label"],unavailable:zu,getArguments:e=>{let t=new Set(e.issue?.tags.map(n=>n.id));return e.tags.filter(n=>!t.has(n.id)).map(n=>({id:n.id,title:n.name,color:n.color}))},freeTextArgument:e=>e.trim()?{id:`new:${e.trim()}`,title:e.trim()}:null,run:(e,t)=>{e.issue&&t&&e.handlers.addIssueTag(e.issue.id,t.title)}},{id:Fr.UNTAG,title:"Remove a tag",group:"Ticket",keywords:["label"],unavailable:e=>zu(e)??(e.issue?.tags.length?null:"This ticket has no tags"),getArguments:e=>(e.issue?.tags??[]).map(t=>({id:t.id,title:t.name,color:t.color})),run:(e,t)=>{e.issue&&t&&e.handlers.removeIssueTag(e.issue.id,t.id)}},{id:Fr.ASSIGN,title:"Assign someone",group:"Ticket",keywords:["owner","who"],unavailable:zu,getArguments:e=>{let t=new Set(e.issue?.assignees.map(n=>n.id));return e.contributors.filter(n=>!n.isRemoved&&!t.has(n.id)).map(n=>({id:n.id,title:n.name,color:n.color,hint:n.isSelf?"you":void 0}))},run:(e,t)=>{e.issue&&t&&e.handlers.addIssueAssignee(e.issue.id,t.id)}},{id:Fr.UNASSIGN,title:"Unassign someone",group:"Ticket",unavailable:e=>zu(e)??(e.issue?.assignees.length?null:"Nobody is assigned"),getArguments:e=>(e.issue?.assignees??[]).map(t=>({id:t.id,title:t.name,color:t.color})),run:(e,t)=>{e.issue&&t&&e.handlers.removeIssueAssignee(e.issue.id,t.id)}},{id:Fr.CLOSE_ISSUE,title:"Close ticket",group:"Ticket",keywords:["done","resolve"],unavailable:e=>zu(e)??(e.issue?.isClosed?"Already closed":null),run:e=>{e.issue&&e.handlers.closeIssue(e.issue.id)}},{id:Fr.RE_OPEN_ISSUE,title:"Reopen ticket",group:"Ticket",unavailable:e=>zu(e)??(e.issue?.isClosed?null:"This ticket is open"),run:e=>{e.issue&&e.handlers.reopenIssue(e.issue.id)}},{id:Fr.YANK,title:"Copy ticket reference",group:"Ticket",keywords:["yank","clipboard","ref"],unavailable:sU,run:e=>{e.issue&&e.handlers.copyRef(e.issue.ref)}},{id:Fr.SYNC,title:"Sync with the remote",group:"Board",keywords:["push","pull","git"],unavailable:e=>e.connected?null:"Not connected",run:e=>e.handlers.sync()},{id:Fr.REPLAY,title:"Play the board back",group:"History",keywords:["replay","theatre","movie"],unavailable:e=>e.connected?null:"Not connected",run:e=>e.handlers.startTheatre()},{id:"gui:live",title:"Return to live",group:"History",keywords:["now","present","exit history"],unavailable:e=>e.scrubbing?null:"The board is already live",run:e=>e.handlers.returnToLive()},{id:"gui:log",title:"Toggle the event log",group:"View",keywords:["history","panel"],unavailable:()=>null,run:e=>e.handlers.toggleLog()}],cU=e=>t=>t.unavailable(e)===null?0:1;var yi=T(M(),1),GQ=({text:e,hits:t})=>{if(t.length===0)return(0,yi.jsx)(yi.Fragment,{children:e});let n=new Set(t);return(0,yi.jsx)(yi.Fragment,{children:[...e].map((i,r)=>n.has(r)?(0,yi.jsx)("span",{style:{color:v.accent},children:i},r):(0,yi.jsx)("span",{children:i},r))})},dU=({title:e,hits:t,group:n,reason:i,hint:r,color:o,selected:a,hasArguments:l,onHover:s,onRun:u})=>(0,yi.jsxs)("button",{type:"button",role:"option","aria-selected":a,"aria-disabled":!!i,title:i??void 0,onMouseMove:s,onClick:u,style:{display:"flex",alignItems:"center",gap:8,width:"100%",textAlign:"left",background:a?v.hover:"transparent",border:"none",borderLeft:`2px solid ${a?v.accent:"transparent"}`,color:i?v.dim:v.primary,fontSize:W.ui,fontFamily:"inherit",padding:"7px 12px",cursor:i?"default":"pointer"},children:[o&&(0,yi.jsx)("span",{"aria-hidden":!0,style:{width:7,height:7,borderRadius:2,background:o,flexShrink:0,opacity:i?.4:1}}),(0,yi.jsxs)("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:[(0,yi.jsx)(GQ,{text:e,hits:t}),l&&(0,yi.jsx)("span",{style:{color:v.dim},children:" \u2026"})]}),(0,yi.jsx)("span",{style:{fontSize:W.label,color:v.dim,flexShrink:0,whiteSpace:"nowrap"},children:i??r??n})]});var no=T(M(),1),$Q=8,dR=50,fU=({commands:e,context:t,recentIds:n,onRun:i,onClose:r})=>{let[o,a]=(0,Ni.useState)(""),[l,s]=(0,Ni.useState)(null),[u,c]=(0,Ni.useState)(0),d=(0,Ni.useRef)(null),f=(0,Ni.useRef)(null),h=(0,Ni.useMemo)(()=>l?[]:cR(e,o,{recentIds:n,rank:cU(t),limit:dR}),[l,o,e,n,t]),m=(0,Ni.useMemo)(()=>{if(!l)return[];let b=cR(l.options,o,{limit:dR}),x=l.command.freeTextArgument?.(o),C=b.some(w=>w.item.title.toLowerCase()===o.trim().toLowerCase());return x&&!C?[...b,{item:{...x,hint:"new"},hits:[],score:0}]:b},[l,o]),y=l?m:h,S=y.length>=dR;(0,Ni.useEffect)(()=>{c(0)},[o,l]),(0,Ni.useEffect)(()=>{d.current?.focus()},[l]),(0,Ni.useEffect)(()=>{f.current?.children[u]?.scrollIntoView({block:"nearest"})},[u]);let p=b=>{let x=y[b];if(!x)return;if(l){l.command.run(t,x.item),i(l.command),r();return}let C=x.item;if(C.unavailable(t))return;let w=C.getArguments?.(t);if(w){s({command:C,options:w}),a("");return}C.run(t),i(C),r()};return(0,no.jsx)("div",{"data-testid":"command-palette",style:{position:"fixed",inset:0,background:"rgba(0, 0, 0, 0.35)",backdropFilter:"blur(1px)",display:"flex",alignItems:"flex-start",justifyContent:"center",paddingTop:"12vh",zIndex:1100},onMouseDown:r,children:(0,no.jsxs)("div",{onMouseDown:b=>b.stopPropagation(),onKeyDown:b=>{if(b.key==="Escape")return b.preventDefault(),l?s(null):r();if(b.key==="ArrowDown"||b.key==="n"&&b.ctrlKey)return b.preventDefault(),c(x=>Math.min(x+1,y.length-1));if(b.key==="ArrowUp"||b.key==="p"&&b.ctrlKey)return b.preventDefault(),c(x=>Math.max(x-1,0));if(b.key==="Enter")return b.preventDefault(),p(u);if(b.key==="Backspace"&&l&&o==="")return b.preventDefault(),s(null)},style:{width:"min(560px, calc(100vw - 32px))",background:v.panel,border:`1px solid ${v.edge}`,borderRadius:8,boxShadow:"0 16px 48px rgba(0, 0, 0, 0.55)",overflow:"hidden"},children:[(0,no.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"10px 12px",borderBottom:`1px solid ${v.line}`},children:[l&&(0,no.jsx)("span",{style:{fontSize:W.label,color:v.accent,border:`1px solid ${v.line}`,borderRadius:4,padding:"2px 6px",flexShrink:0},children:l.command.title}),(0,no.jsx)("input",{ref:d,autoFocus:!0,value:o,onChange:b=>a(b.target.value),placeholder:l?"Pick one\u2026":"Type a command\u2026","aria-label":"Command palette",style:{flex:1,background:"transparent",border:"none",outline:"none",color:v.primary,fontSize:W.prose,fontFamily:"inherit"}})]}),(0,no.jsxs)("div",{ref:f,role:"listbox",style:{maxHeight:$Q*34,overflowY:"auto",padding:"4px 0"},children:[y.length===0&&(0,no.jsxs)("div",{style:{padding:"12px",fontSize:W.ui,color:v.dim},children:["Nothing matches \u201C",o,"\u201D"]}),y.map((b,x)=>{let C=l?null:b.item,w=l?b.item:null;return(0,no.jsx)(dU,{title:C?.title??w?.title??"",hits:b.hits,group:C?.group,reason:C?.unavailable(t),hint:w?.hint,color:w?.color,hasArguments:!!C?.getArguments,selected:x===u,onHover:()=>c(x),onRun:()=>p(x)},b.item.id)}),S&&(0,no.jsx)("div",{style:{padding:"6px 12px",fontSize:W.label,color:v.dim},children:"More matches \u2014 keep typing to narrow"})]})]})})};var hU=T(j(),1),mU="epiq.gui.recentCommands",pU=6,VQ=()=>{try{let e=JSON.parse(localStorage.getItem(mU)??"[]");return Array.isArray(e)?e.filter(t=>typeof t=="string").slice(0,pU):[]}catch{return[]}},qQ=(e,t)=>[t,...e.filter(n=>n!==t)].slice(0,pU),gU=()=>{let[e,t]=(0,hU.useState)(VQ);return{ids:e,remember:n=>{t(i=>{let r=qQ(i,n);try{localStorage.setItem(mU,JSON.stringify(r))}catch{}return r})}}};var B0=T(j(),1),WQ=e=>{let t=e;if(!t)return!1;let n=t.tagName;return n==="INPUT"||n==="TEXTAREA"||n==="SELECT"||t.isContentEditable},yU=()=>{let[e,t]=(0,B0.useState)(!1);return(0,B0.useEffect)(()=>{let n=i=>{let r=i.key==="k"&&(i.metaKey||i.ctrlKey),o=i.key===":"&&!i.metaKey&&!i.ctrlKey;!r&&!o||!e&&WQ(i.target)||e&&!r||(i.preventDefault(),t(!e))};return document.addEventListener("keydown",n),()=>document.removeEventListener("keydown",n)},[e]),{open:e,setOpen:t}};var jQ=(e,t)=>{if(e.length===0)return{at:"start"};if(t==="end")return{at:"end"};let n=Math.max(0,Math.min(t,e.length));return n===0?{at:"before",sibling:e[0].id}:n>=e.length?{at:"end"}:{at:"before",sibling:e[n].id}},YQ=(e,t,n,i)=>{let r=null,o=null,a=e.boards.flatMap(u=>u.swimlanes).find(u=>u.id===n);for(let u of e.boards){for(let c of u.swimlanes){let d=c.issues.find(f=>f.id===t);if(d){r=d,o=c.id;break}}if(r)break}if(!r||!o||!a)return null;let l=o===a.id?a.issues.filter(u=>u.id!==t):a.issues,s=jQ(l,i);return{movedIssue:r,position:s,sourceParentId:o,targetParentId:a.id}},KQ=(e,t,n,i,r)=>({...e,boards:e.boards.map(o=>({...o,swimlanes:o.swimlanes.map(a=>{let l=a.issues.filter(c=>c.id!==t);if(a.id!==n)return{...a,issues:l};let s=[...l],u=i==="end"?s.length:Math.max(0,Math.min(i,s.length));return s.splice(u,0,r),{...a,issues:s}})}))}),bU=(e,t,n)=>(i,r,o)=>{if(!e)return;let a=e;for(let[s,u]of i.entries()){let c=o==="end"?"end":o+s,d=YQ(a,u,r,c);d&&(a=KQ(a,u,r,c,d.movedIssue),n("issues:move",{issueId:u,parentId:r,position:d.position}))}let l=a;t(s=>s&&l)};var XQ="move.node",vU=({createdAt:e,enteredLaneAt:t,now:n,history:i,lanes:r,currentLaneId:o})=>{let a=new Map(r.map((u,c)=>[u.id,c])),l=0,s=0;for(let u of i){if(u.action!==XQ||!u.parentId)continue;let c=a.get(u.parentId);c!==void 0&&s!==null&&c<s&&l++,c!==void 0&&(s=c)}return{ageMs:Math.max(0,n-e),timesSentBack:l,inLaneMs:Math.max(0,n-t),laneTitle:r.find(u=>u.id===o)?.title??""}};var fR=e=>e.trim().toLocaleLowerCase(),QQ=(e,t)=>fR(e).includes(fR(t)),hR=(e,t)=>fR(t)?XP(e.id,t)||QQ(e.title,t):!0;var dt=e=>{if(e)return typeof e=="object"&&e!==null&&"value"in e?e.value??void 0:typeof e=="object"&&e!==null&&"content"in e&&e.content?.[0]?.text?JSON.parse(e.content[0].text).value:e},SU=(e,t)=>{let n=e.find(o=>o.id===t);if(n)return n;let i=t.replace(/-/g,"").toUpperCase(),r=e.filter(o=>o.ref===i);return r.length===1?r[0]??null:null},xU=(e,t)=>SU(e.boards.flatMap(n=>n.swimlanes.flatMap(i=>i.issues)),t),EU=(e,t)=>SU(e.boards,t),mR=(e,t,n)=>({...e,boards:e.boards.map(i=>({...i,swimlanes:i.swimlanes.flatMap(r=>{if(r.id!==t)return[r];let o=n(r);return o?[o]:[]})}))}),$o=(e,t,n)=>({...e,boards:e.boards.map(i=>({...i,swimlanes:i.swimlanes.map(r=>({...r,issues:r.issues.map(o=>o.id===t?n(o):o)}))}))});var pp=T(j(),1);var ZQ=[],JQ=(e,t)=>!t||e.board===null||e.board===t,eZ=(e,t,n)=>e&&t&&n?.capped===!0,tZ=(e,t,n)=>e?t??-1/0:n?.mode==="scrub"&&n.asOfTime!==null?n.asOfTime:1/0,wU=({open:e,timeline:t,boardId:n,commits:i,selection:r,selectedIssueId:o,queryIssueIds:a,linkedCommitsOnly:l,boardIssueIdByRef:s,issueIdByRef:u,showIssues:c,showCommits:d,playing:f,playheadTime:h,timeTravel:m})=>{let{only:y,ticketOnly:S}=r,p=Wm(y),g=S&&o!==null?o:null,b=(0,pp.useMemo)(()=>Ym(g,a),[g,a]),x=(0,pp.useMemo)(()=>{if(!e)return ZQ;let L=t?.events??[],R=_r(p),k=I0(Qk(t,R),rs(y,R));return Qz(c?L.filter(O=>JQ(O,n)&&ts(O,p,k,b)):[],d?O0(i,l,g!==null,_0({everyBoard:u,thisBoard:s,ticketFocus:g!==null}),b):[])},[e,t,n,i,p,y,g,b,l,s,u,c,d]),C=tZ(f,h,m),w=(0,pp.useMemo)(()=>eB(x,C,f),[x,C,f]),E=eZ(e,c,t);return(0,pp.useMemo)(()=>({entries:w,moment:C,eventsUnlisted:E}),[w,C,E])};var Bu=T(j(),1);var pR={line:null},nZ=(e,t)=>e.kind==="commit"||t.kind==="commit"?e.kind===t.kind&&e.kind==="commit"&&t.kind==="commit"&&e.sha===t.sha:e.issueId===t.issueId&&e.tab===t.tab,CU=({entries:e,newestId:t,mark:n,pinned:i,at:r})=>{let o=n.line===null;if(!o){if(t===null||t===n.line)return{open:null,mark:n};if(!i)return{open:null,mark:n}}let a=null;for(let l=e.length-1;l>=0;l--){let s=e[l];if(!s||!o&&s.id===n.line)break;let u=TT(s);if(u){a=u;break}}return a?r&&nZ(r,a)?{open:null,mark:{line:t}}:{open:a,mark:{line:t}}:{open:null,mark:{line:t}}};var kU=({following:e,live:t,pinned:n,entries:i,at:r,onOpen:o})=>{let[a,l]=(0,Bu.useState)(null),s=(0,Bu.useRef)(pR),u=i[i.length-1]?.id??null,c=(0,Bu.useRef)({entries:i,at:r,onOpen:o});return c.current={entries:i,at:r,onOpen:o},(0,Bu.useEffect)(()=>{if(!e){s.current=pR,l(null);return}if(!t)return;let d=c.current,f=CU({entries:d.entries,newestId:u,mark:s.current,pinned:n,at:d.at});s.current=f.mark,f.mark.line!==null&&l(f.mark.line),f.open&&d.onOpen(f.open,{replace:!0})},[e,t,u,n]),{followedLine:a}};var gR=T(j(),1),TU=T(j(),1),iZ='[data-testid="event-log"], [data-testid="live-toggle"]',RU=({logOpen:e,live:t,onOpenLog:n})=>{let[i,r]=(0,TU.useState)(!1);return(0,gR.useEffect)(()=>{(!t||!e)&&r(!1)},[t,e]),(0,gR.useEffect)(()=>{if(!i)return;let o=l=>l instanceof Element&&l.closest(iZ)!==null,a=l=>{o(l.target)||r(!1)};return document.addEventListener("click",a,!0),document.addEventListener("dragstart",a,!0),()=>{document.removeEventListener("click",a,!0),document.removeEventListener("dragstart",a,!0)}},[i]),{following:i,setFollowing:o=>{o&&!e&&n(),r(o)}}};var An=T(j(),1),yR="/log",rZ="epiq-log",oZ="popup=yes,width=520,height=760",bR=e=>typeof e=="object"&&e!==null,aZ=e=>bR(e)&&(e.kind==="commit"&&typeof e.sha=="string"||e.kind==="ticket"&&typeof e.issueId=="string"&&(e.tab==="comments"||e.tab==="overview")&&(e.comment===void 0||typeof e.comment=="string")),lZ=e=>{if(!bR(e))return null;switch(e.type){case"epiq-log:ready":return{type:"epiq-log:ready"};case"epiq-log:closed":return{type:"epiq-log:closed"};case"epiq-log:open":return aZ(e.destination)?{type:"epiq-log:open",destination:e.destination,replace:e.replace===!0}:null;case"epiq-log:pinned":return typeof e.pinned=="boolean"?{type:"epiq-log:pinned",pinned:e.pinned}:null;default:return null}},sZ=e=>bR(e)&&e.type==="epiq-log:lines"&&Array.isArray(e.entries)&&typeof e.moment=="number"?{type:"epiq-log:lines",entries:e.entries,moment:e.moment,followedLine:typeof e.followedLine=="string"?e.followedLine:null,eventsUnlisted:e.eventsUnlisted===!0}:null,LU=(e,t)=>t!==null&&e.origin===window.location.origin&&e.source===t,AU=({entries:e,moment:t,followedLine:n,eventsUnlisted:i,open:r,onOpen:o,onPinnedChange:a})=>{let[l,s]=(0,An.useState)(null),u=(0,An.useRef)({entries:e,moment:t,followedLine:n,eventsUnlisted:i});u.current={entries:e,moment:t,followedLine:n,eventsUnlisted:i};let c=(0,An.useRef)(o);c.current=o;let d=(0,An.useRef)(a);d.current=a;let f=(0,An.useCallback)((m,y)=>{let S={type:"epiq-log:lines",entries:y.entries,moment:y.moment,followedLine:y.followedLine,eventsUnlisted:y.eventsUnlisted};m.postMessage(S,window.location.origin)},[]),h=(0,An.useCallback)(()=>{let m=window.open(yR,rZ,oZ);s(m)},[]);return(0,An.useEffect)(()=>{if(!l)return;let m=p=>{if(!LU(p,l))return;let g=lZ(p.data);g&&(g.type==="epiq-log:ready"?f(l,u.current):g.type==="epiq-log:open"?c.current(g.destination,{replace:g.replace}):g.type==="epiq-log:pinned"?d.current(g.pinned):s(null))},y=window.setInterval(()=>{l.closed&&s(null)},1e3),S=()=>l.close();return window.addEventListener("message",m),window.addEventListener("pagehide",S),()=>{window.clearInterval(y),window.removeEventListener("message",m),window.removeEventListener("pagehide",S)}},[l,f]),(0,An.useEffect)(()=>{l&&f(l,{entries:e,moment:t,followedLine:n,eventsUnlisted:i})},[l,e,t,n,i,f]),(0,An.useEffect)(()=>{r||!l||(l.close(),s(null))},[r,l]),{poppedOut:l!==null&&r,popOut:h}},IU=()=>{let[e]=(0,An.useState)(()=>window.opener??null),[t,n]=(0,An.useState)(null);(0,An.useEffect)(()=>{if(!e)return;let o=s=>e.postMessage(s,window.location.origin),a=s=>{if(!LU(s,e))return;let u=sZ(s.data);u&&n(u)},l=()=>o({type:"epiq-log:closed"});return window.addEventListener("message",a),window.addEventListener("pagehide",l),o({type:"epiq-log:ready"}),()=>{window.removeEventListener("message",a),window.removeEventListener("pagehide",l)}},[e]);let i=(0,An.useCallback)((o,a)=>{e?.postMessage({type:"epiq-log:open",destination:o,replace:a?.replace===!0},window.location.origin)},[e]),r=(0,An.useCallback)(o=>{e?.postMessage({type:"epiq-log:pinned",pinned:o},window.location.origin)},[e]);return{lines:t,board:e,open:i,reportPinned:r}};var ls=T(j(),1);var MU=()=>{let[e,t]=im(),n=jT(e),i=(0,ls.useRef)(QB),r=e.toString(),o=(0,ls.useMemo)(()=>i8(e)??{...r8(),...i.current.values},[e]);i.current=ZB(i.current,r,o),(0,ls.useEffect)(()=>{if(n){KT(o);return}KB(o)||t(l=>{let s=new URLSearchParams(l);return YT(s,o),s},{replace:!0})},[e]);let a=(0,ls.useCallback)(l=>{let s=XB(o,l);KT(s),i.current=JB(i.current,s),t(u=>{let c=new URLSearchParams(u);return YT(c,s),c},{replace:!0})},[o,t]);return[o,a]};var gn=T(j(),1);var DU=new Set(["sync","email:link","email:unlink","issues:create","board:create","board:edit:title","swimlane:create","swimlane:edit:title","swimlane:delete","swimlane:move","issues:move","issue:close","issue:reopen","issue:edit:title","issue:edit:description","issue:tag:add","issue:tag:remove","contributor:remove","tag:remove","issue:assignee:add","issue:assignee:remove","issue:comment:add","issue:comment:delete"]);var _U=()=>{let e=0;return{sent(t){DU.has(t)&&(e+=1)},received(t){(t==="error"||t?.endsWith(":result"))&&(e=Math.max(0,e-1))},reset(){e=0},holdsState(){return e>0}}};var uZ=()=>typeof window>"u"?1:window.__epiqReconnectScale??1,OU=e=>e>=5?null:Math.min(8e3,500*2**e)*uZ();var U0=new WeakMap,G0=(e,t)=>{if(!e)return;let n=JSON.stringify(t);if(e.readyState===WebSocket.OPEN){e.send(n);return}if(e.readyState!==WebSocket.CONNECTING)return;let i=U0.get(e);if(i){i.push(n);return}U0.set(e,[n]),e.addEventListener("open",()=>{for(let r of U0.get(e)??[])e.send(r);U0.delete(e)},{once:!0})};var vR=(e,t)=>e===void 0||e===t,cZ=e=>`${e.protocol==="https:"?"wss":"ws"}://${e.host}/ws`,HU=({onMessage:e})=>{let t=(0,gn.useRef)(null),[n,i]=(0,gn.useState)(!1),[r,o]=(0,gn.useState)(0),[a,l]=(0,gn.useState)(0),[s,u]=(0,gn.useState)(!1),c=(0,gn.useRef)(0),d=(0,gn.useRef)(null),[f]=(0,gn.useState)(_U),h=(0,gn.useRef)(e);h.current=e;let m=(0,gn.useCallback)(x=>{G0(t.current,x)},[]),y=(0,gn.useCallback)((x,C)=>{f.sent(x),G0(t.current,{type:x,payload:C})},[f]),S=(0,gn.useCallback)(()=>m({type:"state:get"}),[m]),p=(0,gn.useCallback)(()=>f.holdsState(),[f]),g=(0,gn.useRef)({send:y,sendRaw:m,requestState:S,holdsState:p});g.current={send:y,sendRaw:m,requestState:S,holdsState:p};let b=(0,gn.useCallback)(()=>{c.current=0,u(!1),l(x=>x+1)},[]);return(0,gn.useEffect)(()=>{let x=new WebSocket(cZ(window.location));t.current=x;let C=!1;return x.addEventListener("open",()=>{i(!0),o(w=>w+1),c.current=0,u(!1),f.reset(),G0(x,{type:"state:get"})}),x.addEventListener("close",()=>{if(t.current===x&&(t.current=null),C)return;i(!1),f.reset();let w=OU(c.current);if(w===null){u(!0);return}c.current+=1,d.current=window.setTimeout(()=>l(E=>E+1),w)}),x.addEventListener("message",w=>{let E=JSON.parse(w.data);f.received(E.type),h.current(E,g.current)}),()=>{C=!0,d.current!==null&&(clearTimeout(d.current),d.current=null),t.current===x&&(t.current=null),x.close()}},[a,f]),{connected:n,socketEpoch:r,reconnectExhausted:s,reconnectNow:b,send:y,sendRaw:m,requestState:S,holdsState:p}};var Cn=T(j(),1);var NU=(e,t,n)=>e===null||e.issueId!==t||e.signature!==n||e.error!==null,FU=({issueId:e,boardState:t,paused:n,sendRaw:i})=>{let[r,o]=(0,Cn.useState)(null),[a,l]=(0,Cn.useState)(null),[s,u]=(0,Cn.useState)({});(0,Cn.useEffect)(()=>{if(!e){o(null);return}n||i({type:"issue:get",payload:{issueId:e}})},[e,t,n,i]),(0,Cn.useEffect)(()=>{if(!e){l(null);return}l({issueId:e,loading:!0,error:null,commits:[]}),i({type:"issue:commits:get",payload:{issueId:e}})},[e,i]);let[c,d]=(0,Cn.useState)(null);(0,Cn.useEffect)(()=>{d(null)},[e]);let f=(0,Cn.useCallback)((b,x)=>{d(C=>NU(C,b,x)?{issueId:b,signature:x,loading:!0,error:null,stats:null}:C)},[]);(0,Cn.useEffect)(()=>{c?.loading&&i({type:"issue:stats:get",payload:{issueId:c.issueId}})},[c?.issueId,c?.signature,c?.loading,i]);let[h,m]=(0,Cn.useState)(null);(0,Cn.useEffect)(()=>{m(null)},[e]);let y=(0,Cn.useCallback)((b,x)=>{m(C=>NU(C,b,x)?{issueId:b,signature:x,loading:!0,error:null,diff:null}:C)},[]);(0,Cn.useEffect)(()=>{h?.loading&&i({type:"issue:squashed-diff:get",payload:{issueId:h.issueId}})},[h?.issueId,h?.signature,h?.loading,i]);let S=(0,Cn.useCallback)(b=>{u(x=>({...x,[b]:{loading:!0,error:null,files:null}})),i({type:"commit:diff:get",payload:{sha:b}})},[i]),p=(0,Cn.useCallback)((b,x)=>{o(C=>C&&C.issueId===b?{...C,comments:x(C.comments)}:C)},[]),g=(0,Cn.useCallback)(b=>{if(b.type==="issue"){let x=dt(b.payload);x&&o(x);return}if(b.type==="issue:commits:result"){let{issueId:x,result:C}=b.payload;if(C?.status==="fail"){l(E=>E&&E.issueId===x?{...E,loading:!1,error:C.message}:E);return}let w=dt(C);w&&l(E=>E&&E.issueId===x?{...E,loading:!1,error:null,commits:w}:E);return}if(b.type==="issue:stats:result"){let{issueId:x,result:C}=b.payload;if(C?.status==="fail"){d(E=>E&&E.issueId===x?{...E,loading:!1,error:C.message}:E);return}let w=dt(C);w&&d(E=>E&&E.issueId===x?{...E,loading:!1,error:null,stats:w}:E);return}if(b.type==="issue:squashed-diff:result"){let{issueId:x,result:C}=b.payload;if(C?.status==="fail"){m(E=>E&&E.issueId===x?{...E,loading:!1,error:C.message}:E);return}let w=dt(C);w&&m(E=>E&&E.issueId===x?{...E,loading:!1,error:null,diff:w}:E);return}if(b.type==="commit:diff:result"){let{sha:x,result:C}=b.payload;if(C?.status==="fail"){u(E=>E[x]?{...E,[x]:{loading:!1,error:C.message,files:null}}:E);return}let w=dt(C);w&&u(E=>E[w.sha]?{...E,[w.sha]:{loading:!1,error:null,files:w.files}}:E)}},[]);return{detail:r,commits:a,stats:c,loadStats:f,squashed:h,loadSquashedDiff:y,commitDiffs:s,loadCommitDiff:S,updateComments:p,onMessage:g}};var Vo=T(j(),1);var dZ={},fZ=5e3,PU=({socketEpoch:e,sendRaw:t})=>{let[n,i]=(0,Vo.useState)(dZ),r=(0,Vo.useRef)(0),o=(0,Vo.useCallback)(()=>{r.current=Date.now(),t({type:"diff-stats:get"})},[t]);(0,Vo.useEffect)(()=>{e!==0&&o()},[e,o]),(0,Vo.useEffect)(()=>{let l=()=>{document.visibilityState!=="hidden"&&(Date.now()-r.current<fZ||o())};return window.addEventListener("focus",l),document.addEventListener("visibilitychange",l),()=>{window.removeEventListener("focus",l),document.removeEventListener("visibilitychange",l)}},[o]);let a=(0,Vo.useCallback)(l=>{if(l.type!=="diff-stats")return;let s=dt(l.payload);s&&i(s)},[]);return{stats:n,onMessage:a}};var Pr=T(j(),1);var hZ=e=>{let t=new Map;if(!e)return t;for(let n of e.boards??[])for(let i of n.swimlanes??[])for(let r of i.issues??[])t.set(r.ref,{issueId:r.id,ref:r.ref,title:r.title,board:n.title,lane:i.title,isClosed:r.isClosed,tags:r.tags??[],assignees:r.assignees??[],commentCount:(e.commentsByIssueId?.[r.id]??[]).length});return t},zU=({state:e,sendRaw:t})=>{let[n,i]=(0,Pr.useState)({}),r=(0,Pr.useRef)(new Set);(0,Pr.useEffect)(()=>{r.current.clear()},[e]);let o=(0,Pr.useMemo)(()=>hZ(e),[e]),a=(0,Pr.useCallback)(u=>{let c=o.get(u);return c?{...c,excerpt:n[c.issueId]?.excerpt}:null},[o,n]),l=(0,Pr.useCallback)(u=>{let c=o.get(u);if(!c)return;let{issueId:d}=c;n[d]?.from!==e&&(r.current.has(d)||(r.current.add(d),t({type:"issue:preview:get",payload:{issueId:d}})))},[o,n,e,t]),s=(0,Pr.useCallback)(u=>{if(u.type!=="issue:preview:result")return;let{issueId:c,result:d}=u.payload;r.current.delete(c);let f=dt(d);f&&i(h=>e?{...h,[f.issueId]:{excerpt:f.excerpt,from:e}}:h)},[e]);return{previewFor:a,requestPreview:l,onMessage:s}};var hf=T(j(),1);var BU=({swimlaneId:e,sendRaw:t})=>{let[n,i]=(0,hf.useState)(null);(0,hf.useEffect)(()=>{if(!e){i(null);return}i({swimlaneId:e,loading:!0,error:null,stats:null}),t({type:"swimlane:stats:get",payload:{swimlaneId:e}})},[e,t]);let r=(0,hf.useCallback)(o=>{if(o.type!=="swimlane:stats:result")return;let{swimlaneId:a,result:l}=o.payload;if(l?.status==="fail"){i(u=>u&&u.swimlaneId===a?{...u,loading:!1,error:l.message}:u);return}let s=dt(l);s&&i(u=>u&&u.swimlaneId===a?{...u,loading:!1,error:null,stats:s}:u)},[]);return{stats:n,onMessage:r}};var qo=T(j(),1);var UU=({open:e,sendRaw:t})=>{let[n,i]=(0,qo.useState)({loading:!1,data:null,candidates:[],scanError:null,lastError:null,changed:0}),r=(0,qo.useRef)(!1);(0,qo.useEffect)(()=>{e&&(i(s=>({...s,loading:!0,lastAction:null})),t({type:"emails:get"}))},[e,t]);let o=(0,qo.useCallback)(s=>{if(s.type==="failed"){if(!r.current)return;r.current=!1,i(h=>({...h,loading:!1,lastError:String(s.payload)}));return}if(s.type!=="emails")return;r.current=!1;let u=s.suggestions,c=dt(u)?.candidates??[],d=u?.status==="fail"?String(u.message??"Could not read this history"):null,f=dt(s.payload);if(!f){i(h=>({...h,loading:!1,lastError:s.payload?.message??"Could not read linked addresses"}));return}i(h=>({loading:!1,data:f,candidates:c,scanError:d,lastError:s.lastAction&&!s.lastAction.ok?String(s.lastAction.message):null,changed:s.lastAction?.ok===!0?h.changed+1:h.changed}))},[]),a=(0,qo.useCallback)((s,u)=>{r.current=!0,i(c=>({...c,loading:!0,lastError:null})),t({type:"email:link",payload:{email:s,contributorId:u}})},[t]),l=(0,qo.useCallback)((s,u)=>{r.current=!0,i(c=>({...c,loading:!0,lastError:null})),t({type:"email:unlink",payload:{email:s,contributorId:u}})},[t]);return{...n,onMessage:o,link:a,unlink:l}};var mf=T(j(),1);var GU=({open:e,changed:t,sendRaw:n})=>{let[i,r]=(0,mf.useState)({loading:!1,data:null,error:null});(0,mf.useEffect)(()=>{e&&(r(a=>({...a,loading:!0,error:null})),n({type:"me:stats:get"}))},[e,t,n]);let o=(0,mf.useCallback)(a=>{if(a.type!=="me:stats")return;let l=dt(a.payload);r({loading:!1,data:l??null,error:l?null:a.payload?.message??"Could not count"})},[]);return{...i,onMessage:o}};var Uu=T(j(),1);var $U=({open:e,sendRaw:t})=>{let[n,i]=(0,Uu.useState)({loading:!1,data:null,lastError:null,answeredAt:0});(0,Uu.useEffect)(()=>{e&&(i(a=>({...a,loading:!0,lastError:null})),t({type:"settings:get"}))},[e,t]);let r=(0,Uu.useCallback)(a=>{if(a.type!=="settings")return;let l=dt(a.payload);if(!l){i(s=>({...s,loading:!1,lastError:a.payload?.message??"Could not read your settings",answeredAt:s.answeredAt+1}));return}i(s=>({loading:!1,data:l,lastError:a.lastAction&&!a.lastAction.ok?String(a.lastAction.message):null,answeredAt:s.answeredAt+1}))},[]),o=(0,Uu.useCallback)(a=>{i(l=>({...l,loading:!0,lastError:null})),t({type:"settings:set",payload:a})},[t]);return{...n,onMessage:r,change:o}};var SR={color:v.dim,fontSize:W.label,textTransform:"uppercase",letterSpacing:.6},ss={...SR,paddingTop:18,paddingBottom:8},or={color:v.dim,fontSize:W.meta,marginTop:4,lineHeight:1.5},$0={background:"transparent",border:`1px solid ${v.line}`,borderRadius:4,cursor:"pointer",fontFamily:Ot,fontSize:W.meta,padding:"3px 8px",whiteSpace:"nowrap"},V0={background:v.panel2,border:`1px solid ${v.line}`,borderRadius:6,padding:"10px 12px"};var W0=T(j(),1);var pf=T(M(),1),VU=28,mZ=16,qU=1,xR=10,ER=2,pZ=VU-2*qU-xR-ER,WU=({label:e,checked:t,onChange:n,activeColor:i=v.accent,disabled:r,title:o,testId:a})=>(0,pf.jsxs)("label",{title:o,"data-testid":a,style:{display:"flex",alignItems:"center",gap:8,fontSize:11,color:t?i:v.dim,cursor:r?"not-allowed":"pointer",opacity:r?.4:1,whiteSpace:"nowrap",flexShrink:0},children:[(0,pf.jsxs)("span",{style:{position:"relative",display:"inline-block",width:VU,height:mZ,borderRadius:999,background:t?i:v.panel,border:`${qU}px solid ${t?i:v.dim}`,boxSizing:"border-box",flexShrink:0,transition:"background 120ms ease, border-color 120ms ease"},children:[(0,pf.jsx)("input",{type:"checkbox",role:"switch",checked:t,disabled:r,onChange:l=>n(l.target.checked),style:{position:"absolute",inset:0,width:"100%",height:"100%",margin:0,opacity:0,cursor:"inherit"}}),(0,pf.jsx)("span",{"aria-hidden":!0,style:{position:"absolute",top:ER,left:t?pZ:ER,width:xR,height:xR,borderRadius:999,background:t?v.panel2:v.dim,transition:"left 120ms ease, background 120ms ease",pointerEvents:"none"}})]}),e]});var Vn=T(M(),1),wR=3e3/1e3,q0=864e5/1e3,gp=e=>String(Math.round(e/1e3)),jU=({state:e,onChange:t})=>{let n=e.data,[i,r]=(0,W0.useState)("");if((0,W0.useEffect)(()=>{n&&r(gp(n.intervalMs))},[n?.intervalMs,e.answeredAt]),!n)return(0,Vn.jsxs)(Vn.Fragment,{children:[(0,Vn.jsx)("div",{style:ss,children:"Auto sync"}),(0,Vn.jsx)("div",{style:{...or,marginTop:0},children:e.lastError??"Reading\u2026"})]});let o=Number(i),a=i===gp(n.intervalMs),l=!a&&i.trim()!==""&&(!Number.isFinite(o)||o<wR||o>q0),s=()=>{if(a)return;if(l||i.trim()===""){r(gp(n.intervalMs));return}let u=Math.round(o)*1e3;if(u===n.intervalMs){r(gp(n.intervalMs));return}t({autoSyncIntervalMs:u})};return(0,Vn.jsxs)(Vn.Fragment,{children:[(0,Vn.jsx)("div",{style:ss,children:"Auto sync"}),(0,Vn.jsxs)("div",{"data-testid":"identity-autosync",style:{...V0,display:"flex",alignItems:"center",justifyContent:"space-between",gap:12},children:[(0,Vn.jsx)(WU,{testId:"autosync-toggle",label:n.enabled?"on":"off",checked:n.enabled,onChange:u=>t({autoSync:u})}),(0,Vn.jsxs)("label",{style:{display:"flex",alignItems:"center",gap:6,color:v.dim,fontSize:W.meta},children:["every",(0,Vn.jsx)("input",{"data-testid":"autosync-interval",type:"number",min:wR,max:q0,step:1,value:i,onChange:u=>r(u.target.value),onBlur:s,onKeyDown:u=>{u.key==="Enter"&&u.currentTarget.blur(),u.key==="Escape"&&(u.stopPropagation(),r(gp(n.intervalMs)))},style:{width:52,background:v.panel,color:l?v.red:v.primary,border:`1px solid ${l?v.red:v.line}`,borderRadius:4,padding:"3px 6px",font:"inherit",fontSize:W.meta,outline:"none",textAlign:"right"}}),"s"]})]}),l?(0,Vn.jsx)("div",{style:{...or,color:v.red},children:o>q0?`${q0} seconds \u2014 a day \u2014 is the longest interval.`:`${wR} seconds is the shortest interval.`}):e.lastError?(0,Vn.jsx)("div",{style:{...or,color:v.red},children:e.lastError}):n.enabled&&n.blockedReason&&(0,Vn.jsxs)("div",{style:{...or,color:v.red},children:["Not running \u2014 ",n.blockedReason,"."]})]})};var qn=T(M(),1),YU=({state:e})=>{let t=e.data;return t?(0,qn.jsxs)(qn.Fragment,{children:[(0,qn.jsx)("div",{style:ss,children:"Your work here"}),(0,qn.jsxs)("div",{"data-testid":"identity-stats",children:[(0,qn.jsx)(Jr,{left:"commits",right:t.scanned?String(t.commits):"\u2014"}),(0,qn.jsx)(Jr,{left:"tickets opened",right:String(t.tickets)}),(0,qn.jsx)(Jr,{left:"comments",right:String(t.comments)}),(0,qn.jsx)(Jr,{left:"joined",right:t.joinedAt===null?"not yet":(0,qn.jsx)("span",{title:Hd(t.joinedAt),children:$l(t.joinedAt)}),last:!0})]}),t.scanned&&t.claimedEmails===0&&(0,qn.jsx)("div",{style:or,children:"No git address is yours yet, so no commit counts as one \u2014 claim one below."})]}):(0,qn.jsxs)(qn.Fragment,{children:[(0,qn.jsx)("div",{style:ss,children:"Your work here"}),(0,qn.jsx)("div",{style:{...or,marginTop:0,color:e.error?v.red:v.dim},children:e.error??"Counting\u2026"})]})};var lt=T(M(),1),bZ={color:v.primary,fontSize:W.ui},vZ={fontSize:W.ui,overflowWrap:"anywhere"},SZ=e=>eo(e.name).label,xZ=e=>{let t=new Set(e.data?.mine??[]),n=e.data?.git??null,i=new Map,r=o=>{let a=i.get(o);if(a)return a;let l={email:o,mine:t.has(o),claimants:[],signsHere:n?.email===o,looksLikeYours:!1,commits:null,names:[]};return i.set(o,l),l};for(let o of t)r(o);n&&r(n.email);for(let o of e.data?.emails??[])r(o.email).claimants=o.claimants.map(SZ);for(let o of e.candidates){let a=r(o.email);a.commits=o.commits,a.names=o.names,a.looksLikeYours=o.looksLikeYours}return[...i.values()].sort((o,a)=>o.mine!==a.mine?o.mine?-1:1:o.signsHere!==a.signsHere?o.signsHere?-1:1:(a.commits??0)-(o.commits??0))},EZ=({row:e})=>{let t=[];if(e.signsHere&&t.push("your git identity here"),e.claimants.length>1?t.push((0,lt.jsxs)("span",{children:[(0,lt.jsx)("span",{style:{letterSpacing:.6},children:"CONTESTED:"})," claimed by"," ",e.claimants.join(" and "),", resolves to nobody"]},"contested")):!e.mine&&e.claimants.length===1&&t.push(`claimed by ${e.claimants[0]}`),e.commits!==null){let n=e.signsHere?"":` as ${e.names.join(", ")||"unknown"}`;t.push(`${e.commits} commit${e.commits===1?"":"s"}${n}`)}return t.length===0?null:(0,lt.jsx)("div",{style:or,children:t.map((n,i)=>(0,lt.jsxs)("span",{children:[i>0?" \xB7 ":"",n]},i))})},KU=({title:e,rows:t,children:n})=>t.length===0?null:(0,lt.jsxs)(lt.Fragment,{children:[(0,lt.jsx)("div",{style:ss,children:e}),t.map(i=>(0,lt.jsxs)("div",{"data-testid":`identity-row-${i.email}`,style:{...V0,display:"flex",alignItems:"flex-start",gap:12,marginBottom:8},children:[(0,lt.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,lt.jsx)("div",{style:{...vZ,color:i.mine?v.primary:v.dim2},children:i.email}),(0,lt.jsx)(EZ,{row:i})]}),n(i)]},i.email))]}),XU=({state:e,stats:t,settings:n,me:i,onLink:r,onUnlink:o,onChangeSettings:a})=>{let l=xZ(e),s=l.filter(d=>d.claimants.length>0),c=l.filter(d=>d.claimants.length===0);return(0,lt.jsxs)("div",{"data-testid":"identity-panel",style:{background:v.panel,border:`1px solid ${v.edge}`,borderRadius:6,padding:"16px 18px 14px",width:440,display:"flex",flexDirection:"column",minHeight:0,color:v.primary,fontFamily:Ot,fontSize:W.ui},children:[(0,lt.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:9},children:[(0,lt.jsx)("span",{style:bZ,children:i?eo(i.name).label:"Not configured"}),(0,lt.jsx)("span",{style:SR,children:"on this board"})]}),e.lastError&&(0,lt.jsx)("div",{style:{...or,paddingTop:10,color:v.red},children:e.lastError}),(0,lt.jsxs)("div",{style:{overflowY:"auto",minHeight:0,scrollbarGutter:"stable"},children:[(0,lt.jsx)(YU,{state:t}),(0,lt.jsx)(jU,{state:n,onChange:a}),e.scanError?(0,lt.jsx)("div",{style:{...or,paddingTop:16,color:v.red},children:e.scanError}):(0,lt.jsxs)(lt.Fragment,{children:[(0,lt.jsx)(KU,{title:"Claimed git addresses",rows:s,children:d=>d.mine?(0,lt.jsx)("button",{onClick:()=>o(d.email),style:{...$0,color:v.dim2},title:"Stop this address resolving to you. The record of the claim stays in the log.",children:"Unclaim"}):(0,lt.jsx)("button",{onClick:()=>r(d.email),style:{...$0,color:v.dim2},title:"Claim this address as well. While two people claim it, commits by it resolve to neither of you.",children:"Claim too"})}),(0,lt.jsx)(KU,{title:"Unclaimed",rows:c,children:d=>(0,lt.jsx)("button",{onClick:()=>r(d.email),style:{...$0,color:v.accent},title:"Every commit by this address becomes yours, back to the first one. Permanent, and it reaches every clone.",children:"This is me"})}),s.length===0&&c.length===0&&(0,lt.jsx)("div",{style:{...or,paddingTop:16},children:"No addresses in this repository\u2019s history yet."})]})]})]})};var JU=T(j(),1);var wZ=[.8,.7,.6,.5,.4],CZ=(e,t,n)=>new Promise(i=>e.toBlob(i,t,n)),kZ=(e,t)=>`${e.replace(/\.[a-z0-9]+$/i,"")||"image"}.${t}`,QU=async(e,t=500)=>{let n=t*1024;if(e.type==="image/gif")return e.size<=n?{blob:e,name:e.name}:{error:`GIFs are attached as-is and this one exceeds ${t} KB`};let i;try{i=await createImageBitmap(e)}catch{return{error:"Not a supported image"}}let r=Math.min(1,1600/Math.max(i.width,i.height)),o=document.createElement("canvas");o.width=Math.max(1,Math.round(i.width*r)),o.height=Math.max(1,Math.round(i.height*r));let a=o.getContext("2d");if(!a)return i.close(),{error:"Unable to process image"};a.drawImage(i,0,0,o.width,o.height),i.close();for(let l of wZ){let s=await CZ(o,"image/webp",l);if(s&&s.size<=n)return{blob:s,name:kZ(e.name,"webp")}}return{error:`Unable to compress image under ${t} KB`}},ZU=e=>new Promise((t,n)=>{let i=new FileReader;i.onload=()=>{let o=String(i.result??"").split(",")[1];if(!o){n(new Error("Unable to encode image"));return}t(o)},i.onerror=()=>n(new Error("Unable to read image")),i.readAsDataURL(e)});var e4=({send:e,setState:t,contributors:n,updateComments:i,attachmentMaxKb:r})=>{let[o,a]=(0,JU.useState)({state:"idle"});return{attachmentUploadStatus:o,editIssueTitle:(E,L)=>{t(R=>R&&$o(R,E,k=>({...k,title:L}))),e("issue:edit:title",{issueId:E,title:L})},editIssueDescription:(E,L)=>{t(R=>R&&$o(R,E,k=>({...k,description:L}))),e("issue:edit:description",{issueId:E,description:L})},addIssueTag:(E,L)=>{t(R=>R&&$o(R,E,k=>k.tags.some(O=>O.name===L)?k:{...k,tags:[...k.tags,{id:`placeholder-tag-${L}`,name:L,color:v.dim}]})),e("issue:tag:add",{issueId:E,tagName:L})},removeIssueTag:(E,L)=>{t(R=>R&&$o(R,E,k=>({...k,tags:k.tags.filter(O=>O.id!==L)}))),e("issue:tag:remove",{issueId:E,tagId:L})},addIssueAssignee:(E,L)=>{let R=n.find(k=>k.id===L);t(k=>!k||!R?k:$o(k,E,O=>O.assignees.some(N=>N.id===L)?O:{...O,assignees:[...O.assignees,R]})),e("issue:assignee:add",{issueId:E,assigneeId:L})},removeContributor:E=>{e("contributor:remove",{contributorId:E})},removeTag:E=>{e("tag:remove",{tagId:E})},addExternalIssueAssignee:(E,L)=>{t(R=>R&&$o(R,E,k=>k.assignees.some(O=>O.name===L)?k:{...k,assignees:[...k.assignees,{id:`placeholder-assignee-${L}`,name:L,color:v.dim}]})),e("issue:assignee:add",{issueId:E,assigneeName:L,createUnlinked:!0})},removeIssueAssignee:(E,L)=>{t(R=>R&&$o(R,E,k=>({...k,assignees:k.assignees.filter(O=>O.id!==L)}))),e("issue:assignee:remove",{issueId:E,assigneeId:L})},closeIssue:E=>{t(L=>L&&$o(L,E,R=>({...R,isClosed:!0}))),e("issue:close",{issueId:E})},reopenIssue:E=>{t(L=>L&&$o(L,E,R=>({...R,isClosed:!1}))),e("issue:reopen",{issueId:E})},addIssueComment:(E,L)=>{t(R=>{if(!R)return R;let k=R.commentsByIssueId[E]??[],O={id:`placeholder-comment-${crypto.randomUUID()}`,issueId:E,body:L,isDeleted:!1,author:R.user,createdAt:new Date().getTime()};return{...R,commentsByIssueId:{...R.commentsByIssueId,[E]:[...k,O]}}}),e("issue:comment:add",{issueId:E,body:L})},deleteIssueComment:(E,L)=>{i(E,R=>R.filter(k=>k.id!==L)),e("issue:comment:delete",{issueId:E,commentId:L})},editIssueComment:(E,L,R)=>{i(E,k=>k.map(O=>O.id===L?{...O,body:R}:O)),e("issue:comment:edit",{issueId:E,commentId:L,body:R})},uploadIssueAttachments:async(E,L)=>{let R=[];for(let k of L){a({state:"uploading",name:k.name});let O=await QU(k,r);if("error"in O)return a({state:"error",message:O.error}),R;try{let N=await ZU(O.blob),H=await fetch("/api/attachments",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({issueId:E,name:O.name,dataBase64:N})}),F=await H.json();if(!H.ok)return a({state:"error",message:F?.message??"Upload failed"}),R;let P=dt(F);P&&t(P);let V=F?.attachment?.markdown;V&&R.push(V)}catch(N){return a({state:"error",message:N instanceof Error?N.message:"Upload failed"}),R}}return a({state:"idle"}),R},deleteIssueAttachment:async(E,L)=>{try{let R=await fetch(`/api/attachments/${encodeURIComponent(L)}`,{method:"DELETE"}),k=await R.json();if(!R.ok){a({state:"error",message:k?.message??"Unable to delete attachment"});return}let O=dt(k);O&&t(O)}catch(R){a({state:"error",message:R instanceof Error?R.message:"Unable to delete attachment"})}}}};var CR=T(j(),1),t4=({send:e,setState:t,selectedBoard:n})=>{let[i,r]=(0,CR.useState)(null),[o,a]=(0,CR.useState)(null);return{createBoardTitle:i,setCreateBoardTitle:r,createBoard:()=>{if(i===null)return;let c=i.trim()||"New board";r(null),e("board:create",{title:c})},renameBoard:o,setRenameBoard:a,openRenameBoard:()=>{!n||n.readonly||a({boardId:n.id,title:n.title})},submitRenameBoard:()=>{if(!o)return;let{boardId:c}=o,d=o.title.trim();a(null),d&&(t(f=>f&&{...f,boards:f.boards.map(h=>h.id===c?{...h,title:d}:h)}),e("board:edit:title",{boardId:c,title:d}))}}};var j0=T(j(),1);var n4=({send:e,setState:t,selectedBoard:n,visibleSwimlanes:i})=>{let[r,o]=(0,j0.useState)(null),[a,l]=(0,j0.useState)(null),[s,u]=(0,j0.useState)(null),c=()=>{if(r===null||!n)return;let y=r.trim()||"New swimlane",S=n.id;o(null),t(p=>p&&{...p,boards:p.boards.map(g=>g.id===S?{...g,swimlanes:[...g.swimlanes,{id:`pending-swimlane-${y}`,title:y,readonly:!0,issues:[]}]}:g)}),e("swimlane:create",{title:y,boardId:S})},d=y=>{let S=i.find(p=>p.id===y);S&&l({swimlaneId:y,title:S.title})},f=()=>{if(!a)return;let{swimlaneId:y}=a,S=a.title.trim();l(null),S&&(t(p=>p&&mR(p,y,g=>({...g,title:S}))),e("swimlane:edit:title",{swimlaneId:y,title:S}))},h=n?.swimlanes.find(y=>y.id===s)??null;return{createSwimlaneTitle:r,setCreateSwimlaneTitle:o,renameSwimlane:a,setRenameSwimlane:l,setDeleteSwimlaneId:u,deletingSwimlane:h,createSwimlane:c,openRenameSwimlane:d,submitRenameSwimlane:f,confirmDeleteSwimlane:()=>{s&&(t(y=>y&&mR(y,s,()=>null)),e("swimlane:delete",{swimlaneId:s}),u(null))}}};var i4=e=>{let t=0,n={};return{open(){return t+=1,n={requestId:t},t},accept(i,r){if(i===void 0||i!==n.requestId)return;n={...n,...r};let{timeline:o,commits:a}=n;!o||!a||(n={},e({requestId:i,timeline:o,commits:a}))}}};var _e=T(M(),1),TZ={},r4=4,RZ=400,LZ="epiq.timeScrubber.showLog",AZ="epiq.timeScrubber.showIssues",IZ="epiq.timeScrubber.showCommits",MZ="epiq.diffTab.compacted",DZ="epiq.timeScrubber.linkedCommitsOnly",_Z={opacity:.3,pointerEvents:"none",transition:"opacity 240ms ease"},GT=()=>(0,_e.jsx)("div",{"data-testid":"ticket-drop-indicator",style:{height:2,background:v.accent,borderRadius:999,margin:"4px 8px 8px",boxShadow:`0 0 12px ${v.accent}`}}),o4=()=>{let{boardId:e}=Zw(),t=_b("/board/:boardId/issue/:issueId"),n=_b("/board/:boardId/:issueId"),i=t?.params.issueId??n?.params.issueId,[r,o]=im(),[a,l]=MU(),s=(0,ne.useRef)(()=>{}),{connected:u,socketEpoch:c,reconnectExhausted:d,reconnectNow:f,send:h,sendRaw:m,requestState:y}=HU({onMessage:(_,G)=>s.current(_,G)}),[S,p]=(0,ne.useState)({status:"synced",msg:"idle"}),[g,b]=(0,ne.useState)(null),[x,C]=(0,ne.useState)(null),[w,E]=(0,ne.useState)([]),[L,R]=(0,ne.useState)({requestId:0,timeline:null,commits:[]}),[k]=(0,ne.useState)(()=>i4(R)),[O,N]=(0,ne.useState)(null),[H,F]=(0,ne.useState)(0),[P,V]=_t(LZ,!1),U=up(P,_a()?0:Hr),[X,ae]=_t(AZ,!0),[A,me]=_t(IZ,!0),[pe,I]=_t(DZ,!0),[ue,be]=(0,ne.useState)(null),[ke,Je]=(0,ne.useState)(ru),[Q,re]=lU(),[fe,Ue]=(0,ne.useState)(null),[De,J]=(0,ne.useState)(null),[Le,Ge]=(0,ne.useState)(null),[Rt,$e]=(0,ne.useState)(null),[Ve,st]=(0,ne.useState)([]),[Ke,Wt]=(0,ne.useState)(!1),[Ht,Wn]=(0,ne.useState)(null),[io,Wo]=(0,ne.useState)(null),[z,Z]=(0,ne.useState)(null),he=(0,ne.useRef)(null),Ce=(0,ne.useRef)(null),Oe=(0,ne.useRef)(void 0),Nt=r.get("tab"),mt=Nt==="comments"||Nt==="code"||Nt==="stats"?Nt:"overview",Jt=r.get("comment"),ri=gN(r)??mN(r),Ct=yd(),Ae=(g&&e?EU(g,e):null)??g?.boards?.[0]??null,Ft=Ae?.id??null,un=(0,ne.useRef)(Ft);un.current=Ft;let za=(0,ne.useRef)(Ct);za.current=Ct;let Gt=Ae?.ref??e,ie=g&&i?xU(g,i):null;(0,ne.useEffect)(()=>{let _=G=>{if(!ie||ie.readonly)return;let q=G.target;if(q&&(q.tagName==="INPUT"||q.tagName==="TEXTAREA"||q.isContentEditable))return;let qe=Array.from(G.clipboardData?.items??[]).filter(We=>We.kind==="file"&&We.type.startsWith("image/")).map(We=>We.getAsFile()).filter(We=>!!We);qe.length!==0&&(G.preventDefault(),ee(ie.id,qe))};return window.addEventListener("paste",_),()=>window.removeEventListener("paste",_)});let Ba=()=>{Gt&&Ct(`/board/${Gt}`)},[Fi,ro]=(0,ne.useState)(null),lr=g?.commentsByIssueId??TZ,{detail:In,commits:en,commitDiffs:bi,loadCommitDiff:$t,stats:sr,loadStats:us,squashed:Mn,loadSquashedDiff:cs,updateComments:ds,onMessage:Gu}=FU({issueId:ie?.id??null,boardState:g,paused:O!==null,sendRaw:m}),{stats:$u,onMessage:jo}=BU({swimlaneId:Fi,sendRaw:m}),{stats:Vu,onMessage:fs}=PU({socketEpoch:c,sendRaw:m}),{previewFor:hs,requestPreview:ut,onMessage:vi}=zU({state:g,sendRaw:m}),[zr,Ua]=(0,ne.useState)(!1),Br=UU({open:zr,sendRaw:m}),ms=$U({open:zr,sendRaw:m}),ps=GU({open:zr,changed:Br.changed,sendRaw:m}),Yo=en?.issueId===ie?.id?en?.commits[0]?.sha??"":"";(0,ne.useEffect)(()=>{mt!=="stats"||!ie||us(ie.id,Yo)},[mt,ie?.id,Yo,us]);let[qu,Wu]=_t(MZ,!1),Ga=VC(r),Ko=Ga?Ga==="flat":qu,Ur=Ko&&!ri,gs=_=>{Wu(_),o(G=>{let q=new URLSearchParams(G);return cv(q,_),q},{replace:!0})};(0,ne.useEffect)(()=>{mt!=="code"||!ie||VC(r)||ri||o(_=>{let G=new URLSearchParams(_);return cv(G,Ko),G},{replace:!0})},[mt,ie?.id,r,Ko,ri]),(0,ne.useEffect)(()=>{mt!=="code"||!Ur||!ie||Yo&&cs(ie.id,Yo)},[mt,Ur,ie?.id,Yo,cs]);let $a=(0,ne.useMemo)(()=>{if(!ie||!g)return null;let _=g.boards.find(q=>q.swimlanes.some(qe=>qe.issues.some(We=>We.id===ie.id))),G=_?.swimlanes.find(q=>q.issues.some(qe=>qe.id===ie.id));return!_||!G?null:vU({createdAt:ie.createdAt,enteredLaneAt:ie.enteredLaneAt,now:Date.now(),history:In?.issueId===ie.id?In.history:[],lanes:_.swimlanes,currentLaneId:G.id})},[ie?.id,g,In]),Gr=(0,ne.useMemo)(()=>Zz(ie&&In?.issueId===ie.id?In.history:[],ie&&en?.issueId===ie.id?en.commits:[]),[ie?.id,In,en]),[jt,He]=(0,ne.useState)(""),K=(0,ne.useMemo)(()=>tT(a.only),[a.only]),ur=a.only.actor!==void 0,ys=(0,ne.useMemo)(()=>ur?iT(L.timeline):null,[ur,L.timeline]),bs=a.zoom!==null,Xo=(0,ne.useMemo)(()=>a.windowOnly&&Hu(a.scope,bs)?nT(L.timeline):null,[a.windowOnly,a.scope,bs,L.timeline]),vs=a.ticketOnly&&ie?ie.id:null,cr=pi(a.only.tag),Y0=cr?.length===1?cr[0]??null:null,ju=_=>l({only:of(a.only,"tag",M0(cr,_)??void 0)}),yp=(0,ne.useMemo)(()=>{let _=new Map;for(let q of[...g?.contributors??[],...w])_.has(q.id)||_.set(q.id,q);let G=[..._.values()];return{tag:g?.tags??[],commenter:G,assignee:G,actor:G}},[g?.tags,g?.contributors,w]),dr=(0,ne.useMemo)(()=>XT(g?.boards??[],null),[g?.boards]),oo=(0,ne.useMemo)(()=>XT(g?.boards??[],Ft),[g?.boards,Ft]),bp=(0,ne.useMemo)(()=>(Ae?.swimlanes??[]).map(({id:_,title:G})=>({id:_,title:G})),[Ae]),vp=(0,ne.useMemo)(()=>new Map((g?.boards??[]).flatMap(_=>_.swimlanes.map(G=>[G.id,G.title]))),[g?.boards]),Ss=(0,ne.useMemo)(()=>new Map((g?.boards??[]).flatMap(_=>_.swimlanes.flatMap(G=>G.issues.map(q=>[q.id,{ref:q.ref,title:q.title,assignee:q.assignees[0]??null}])))),[g?.boards]),Sp=(0,ne.useMemo)(()=>{let _=jt.trim();return!_||!Ae?null:new Set(Ae.swimlanes.flatMap(G=>G.issues.filter(q=>hR(q,_)).map(q=>q.id)))},[Ae,jt]),{visibleSwimlanes:Va,hiddenIssueCount:K0}=(0,ne.useMemo)(()=>{let _=Ae?.swimlanes??[],G=jt.trim();if(K.length===0&&!G&&Xo===null&&!vs)return{visibleSwimlanes:_,hiddenIssueCount:0};let q=0;return{visibleSwimlanes:_.map(We=>{let fr=We.issues.filter(uo=>rT(uo,{commenterIds:(lr[uo.id]??[]).map(M4=>M4.author.id),actorIds:ys===null?null:[...ys.get(uo.id)??[]]},K)&&hR(uo,G)&&(Xo===null||Xo.has(uo.id))&&(!vs||uo.id===vs));return q+=We.issues.length-fr.length,{...We,issues:fr}}),hiddenIssueCount:q}},[Ae,K,jt,lr,ys,Xo,vs]),xp=g?.attachmentsByIssueId??{},yf=(_,G)=>{if(Gu(_),jo(_),fs(_),vi(_),_.type==="state"&&!G.holdsState()){let q=dt(_.payload);q&&(b(q),C(null))}if(_.type==="state:unavailable"&&C(_.payload),_.type==="project:open:result"){let q=_.payload;q.status!=="success"&&C(qe=>qe&&{...qe,message:q.message})}if(_.type==="issues:create:result"){let q=Ce.current;Ce.current=null;let qe=dt(_.payload),We=Oe.current;Oe.current=void 0,qe&&Gt&&vR(We,Gt)&&za.current(`/board/${Gt}/issue/${Xl(qe.id)}?tab=overview`),q&&qe&&G.sendRaw({type:"issue:comment:add",payload:{issueId:q.originIssueId,body:`Filed \`${Xl(qe.id)}\` from a code selection on this ticket.`}})}if(_.type==="board:create:result"){let q=dt(_.payload);q&&za.current(`/board/${q.ref}`)}if(_.type==="failed"&&(J(typeof _.payload=="string"?_.payload:"The board refused that change"),G.requestState()),_.type==="error"&&(J(typeof _.message=="string"?_.message:"The board could not read that change"),G.requestState()),_.type==="timeline"){let q=dt(_.payload);q&&k.accept(_.requestId,{timeline:q})}if((_.type==="contributor:remove:result"||_.type==="issue:assignee:add:result")&&G.sendRaw({type:"contributors:get",payload:{boardId:un.current}}),_.type==="contributor:remove:result"&&_.payload?.status==="fail"&&Ue(`Couldn't remove a contributor: ${_.payload.message}`),_.type==="tag:remove:result"&&_.payload?.status==="fail"&&Ue(`Couldn't delete a tag: ${_.payload.message}`),Br.onMessage(_),ms.onMessage(_),ps.onMessage(_),_.type==="contributors"){let q=dt(_.payload);q&&vR(_.boardId,un.current)&&E(q)}if(_.type==="commits"){let q=dt(_.payload);q&&k.accept(_.requestId,{commits:q})}if(_.type==="commit:diff:result"){let{sha:q,result:qe}=_.payload;if(qe?.status==="fail")be(We=>We&&We.sha===q?{...We,loading:!1,error:qe.message}:We);else{let We=dt(qe);We&&be(fr=>fr&&fr.sha===We.sha?{...fr,loading:!1,error:null,files:We.files}:fr)}}_.type==="time-travel:result"&&(F(q=>q+1),_.payload?.status==="fail"&&(console.log("Time travel failed",_),G.requestState())),_.type==="sync-status"&&p(_.payload)};s.current=yf,(0,ne.useEffect)(()=>{let _=g?.boards?.[0];!e&&_&&Ct(`/board/${_.ref}`,{replace:!0})},[e,g,Ct]),(0,ne.useEffect)(()=>{let _=G=>{he.current&&!he.current.contains(G.target)&&Wt(!1)};return document.addEventListener("mousedown",_),()=>document.removeEventListener("mousedown",_)},[]);let Yu=()=>{Ge(null),$e(null)},bf=_=>{st(G=>G.includes(_)?G.filter(q=>q!==_):[...G,_])},qa=()=>st([]),[X0,Ep]=(0,ne.useState)(""),[wp,Ku]=(0,ne.useState)(""),Wa=(g?.boards??[]).flatMap(_=>_.swimlanes).flatMap(_=>_.issues).filter(_=>Ve.includes(_.id)),Xu=_=>{for(let G of Wa)_(G.id)},Q0=(_,{toggle:G}={toggle:!1})=>{if(G)return bf(_);be(null),ro(null),st([_]),Gt&&Ct(`/board/${Gt}/issue/${Xl(_)}?tab=${mt}`)},Cp=_=>{be(null),qa(),Ba(),ro(G=>G===_?null:_)},Qo=(0,ne.useMemo)(()=>new Set(dr.keys()),[dr]),Z0=(0,ne.useMemo)(()=>({isKnownRef:_=>Qo.has(_),onOpen:_=>{Gt&&Ct(`/board/${Gt}/issue/${_}`)}}),[Qo,Gt,Ct]),ja=(_,G,q=Gt,qe,We=!1,fr)=>{if(!q)return;be(null);let uo=new URLSearchParams({tab:G});qe&&cv(uo,qe==="flat"),fr&&uo.set("comment",fr),Ct(`/board/${q}/issue/${Xl(_)}?${uo}`,{replace:We})},vf=(_,G,q)=>{ro(null),st([_]),ja(_,G,Gt,q)},Sf=_=>vf(_,"comments"),kp=_=>vf(_,"code","flat"),xf=(_,G)=>{if(_.kind==="commit"){_R(_.sha,G?.replace);return}ja(_.issueId,_.tab,void 0,void 0,G?.replace,_.comment)},J0=_=>{o(G=>{let q=new URLSearchParams(G);return q.set("tab","code"),pN(q,_),q})},eS=_=>{o(G=>{let q=new URLSearchParams(G);return q.set("tab",_),WC(q),fN(q),q},{replace:!0})},tS=_=>{if(_.issueRef&&_.issueRef!==ie?.ref){if(!Gt)return;let G=new URLSearchParams({tab:"code"});qC(G,_),Ct(`/board/${Gt}/issue/${_.issueRef}?${G}`);return}o(G=>{let q=new URLSearchParams(G);return q.set("tab","code"),qC(q,_),q})},{attachmentUploadStatus:nS,editIssueTitle:Qu,editIssueDescription:Ef,addIssueTag:wf,removeIssueTag:ao,addIssueAssignee:xs,removeContributor:iS,removeTag:Zu,addExternalIssueAssignee:rS,removeIssueAssignee:Es,closeIssue:Cf,reopenIssue:lo,addIssueComment:oS,deleteIssueComment:aS,editIssueComment:B,uploadIssueAttachments:ee,deleteIssueAttachment:Ee}=e4({send:h,setState:b,contributors:w,updateComments:ds,attachmentMaxKb:g?.attachmentMaxKb}),tt=_=>{h("time-travel:scrub",{targetTime:_})},jn=()=>{h("time-travel:live",{})},so=()=>{L.timeline&&N(wB(L.timeline))},kf=()=>{N(null),jn()},Tp=CB({plan:O,ack:H,onSeek:tt}),[c4,kR]=(0,ne.useState)(0);(0,ne.useEffect)(()=>{if(O)return;let _=()=>kR(q=>q+1);if(a.windowOnly){_();return}if(!P)return;let G=window.setTimeout(_,RZ);return()=>window.clearTimeout(G)},[g,O,a.windowOnly,P]),(0,ne.useEffect)(()=>{O||Br.changed!==0&&kR(_=>_+1)},[Br.changed,O]);let TR=ue?{kind:"commit",sha:ue.sha}:ie?{kind:"ticket",issueId:ie.id,tab:mt==="comments"?"comments":"overview",...Jt?{comment:Jt}:{}}:null,{entries:lS,moment:RR,eventsUnlisted:LR}=wU({open:P,timeline:L.timeline,boardId:Ft??null,commits:L.commits,selection:a,selectedIssueId:ie?.id??null,queryIssueIds:Sp,linkedCommitsOnly:pe,boardIssueIdByRef:oo,issueIdByRef:dr,showIssues:X,showCommits:A,playing:O!==null,playheadTime:Tp.current?.t??null,timeTravel:g?.timeTravel}),[d4,AR]=(0,ne.useState)(!0),IR=u&&g?.timeTravel?.mode!=="scrub"&&!O,{following:sS,setFollowing:f4}=RU({logOpen:P,live:IR,onOpenLog:()=>V(!0)}),{followedLine:MR}=kU({following:sS,live:IR,pinned:d4,entries:lS,at:TR,onOpen:xf}),DR=AU({entries:lS,moment:RR,followedLine:MR,eventsUnlisted:LR,open:P,onOpen:xf,onPinnedChange:AR});(0,ne.useEffect)(()=>{u||N(null)},[u]);let h4=(0,ne.useCallback)((_,G,q)=>{let qe=_!==void 0?{start:_,end:G}:void 0,We=k.open();return m({type:"timeline:get",payload:{...qe,boardId:q?void 0:Ft??void 0,requestId:We}}),m({type:"commits:get",payload:{...qe,requestId:We}}),We},[Ft]),m4=(0,ne.useCallback)(()=>{m({type:"contributors:get",payload:{boardId:un.current}})},[]);(0,ne.useEffect)(()=>{E([]),st([])},[Ft]);let _R=(0,ne.useCallback)((_,G=!1)=>{let q=L.commits.find(We=>We.sha===_)?.subject??"",qe=D0(q,Qo);if(qe&&Gt){be(null),Ct(`/board/${Gt}/issue/${qe}?tab=code&commit=${_}`,{replace:G});return}be({sha:_,loading:!0,error:null,files:null}),m({type:"commit:diff:get",payload:{sha:_}})},[L.commits,Qo,Gt,Ct]),p4=(0,ne.useCallback)(()=>be(null),[]);(0,ne.useEffect)(()=>{be(null)},[e,i]),(0,ne.useEffect)(()=>{if(!fe)return;let _=setTimeout(()=>Ue(null),8e3);return()=>clearTimeout(_)},[fe]),(0,ne.useEffect)(()=>{if(!De)return;let _=setTimeout(()=>J(null),8e3);return()=>clearTimeout(_)},[De]);let g4=_=>{Wt(!1),Yu(),Ct(`/board/${Xl(_)}`)},y4=_=>{Wn({swimlaneId:_,title:""})},OR=_=>{Oe.current=Gt,h("issues:create",_)},b4=()=>{if(!Ht)return;let _=Ht.title.trim()||"New issue",G=Ht.swimlaneId;Wn(null),OR({title:_,parentId:G})},{createSwimlaneTitle:HR,setCreateSwimlaneTitle:Rp,renameSwimlane:NR,setRenameSwimlane:FR,setDeleteSwimlaneId:PR,deletingSwimlane:Tf,createSwimlane:v4,openRenameSwimlane:S4,submitRenameSwimlane:x4,confirmDeleteSwimlane:E4}=n4({send:h,setState:b,selectedBoard:Ae,visibleSwimlanes:Va}),{createBoardTitle:zR,setCreateBoardTitle:uS,createBoard:w4,renameBoard:BR,setRenameBoard:UR,openRenameBoard:C4,submitRenameBoard:k4}=t4({send:h,setState:b,selectedBoard:Ae}),T4=(0,ne.useMemo)(()=>(g?.boards??[]).flatMap(_=>_.swimlanes.flatMap(G=>G.issues.map(q=>({id:q.id,ref:q.ref,title:q.title,boardTitle:_.title,boardRef:_.ref})))),[g]),cS=yU(),GR=gU(),R4=(0,ne.useMemo)(()=>uU(),[]),L4={connected:u,scrubbing:g?.timeTravel?.mode==="scrub",issue:ie,board:Ae?{id:Ae.id,title:Ae.title,readonly:Ae.readonly}:null,tags:g?.tags??[],tickets:T4,contributors:w,handlers:{createIssue:()=>{let _=Va[0]?.id;_&&Wn({swimlaneId:_,title:""})},createSwimlane:()=>Rp(""),createBoard:()=>uS(""),renameBoard:C4,openIssue:(_,G)=>ja(_,"overview",G),closeIssue:Cf,reopenIssue:lo,addIssueTag:wf,removeIssueTag:ao,addIssueAssignee:xs,removeIssueAssignee:Es,commentOnIssue:_=>ja(_,"comments"),copyRef:_=>void navigator.clipboard?.writeText(_),sync:()=>h("sync",{}),startTheatre:so,returnToLive:jn,toggleLog:()=>V(!P)}},Ju=!u&&g!==null,$R=(0,ne.useMemo)(()=>Ju?Va.map(_=>({..._,readonly:!0,issues:_.issues.map(G=>({...G,readonly:!0}))})):Va,[Ju,Va]),Lp=g?.timeTravel?.mode==="scrub"?null:$R.find(_=>_.id===Fi)??null,A4=_=>{let G=z;if(Z(null),!G||!_||!Ae)return;let q=Va.findIndex(qe=>qe.id===G.swimlaneId);q!==-1&&AB(g,b,h)(_,Ae.id,G.side==="left"?q:q+1)},I4=(_,G,q)=>{let qe=Ae?.swimlanes[0]?.id;if(!qe)return;let We=q.range.side??"additions",fr=[...q.note?[q.note,""]:[],`Filed from a code selection on \`${G}\`.`,"",uv({filePath:q.filePath,start:q.range.start,side:We,end:q.range.end,endSide:q.range.endSide??We,note:q.note,sha:q.sha,issueRef:G}),`\`${q.filePath}\` ${La(q.range)}`,"```",q.snippet,"```"].join(`
1798
1798
  `);Ce.current={originIssueId:_,originRef:G},OR({title:q.title,parentId:qe,description:fr,tagNames:["from-code-comment"]})};return x?(0,_e.jsx)(MH,{repoRoot:x.repoRoot,message:x.message,recentProjects:x.recentProjects,onRetry:y,onOpen:_=>h("project:open",{root:_})}):(0,_e.jsx)(oz,{value:Z0,children:(0,_e.jsxs)("div",{style:{height:"100vh",background:v.bg,color:v.primary,fontFamily:Dl,display:"flex",flexDirection:"column"},children:[(0,_e.jsx)(R0,{}),(0,_e.jsx)(VB,{}),(0,_e.jsx)(tz,{previewFor:hs,onHover:ut}),fe&&(0,_e.jsx)(VT,{message:fe,onDismiss:()=>Ue(null)}),De&&(0,_e.jsx)(VT,{message:De,onDismiss:()=>J(null)}),(0,_e.jsxs)("div",{style:{background:v.chrome},children:[sS&&(0,_e.jsx)(rU,{}),(0,_e.jsx)("div",{style:O?_Z:void 0,children:(0,_e.jsx)(BH,{state:g,connection:u?"connected":Ju?d?"lost":"reconnecting":"connecting",onReconnect:f,scrubbing:g?.timeTravel?.mode==="scrub",syncStatus:S,onOpenCommands:()=>cS.setOpen(!0),board:(0,_e.jsx)(_H,{testId:"board-switcher",value:Ae?{id:Ae.id,label:Ae.title}:null,items:g?.boards.map(_=>({id:_.id,label:_.title,hint:fi(_.swimlanes.reduce((G,q)=>G+q.issues.length,0),"issue")}))??[],placeholder:"Loading...",onSelect:g4}),identity:{open:zr,onToggle:()=>Ua(_=>!_),onDismiss:()=>Ua(!1),panel:(0,_e.jsx)(XU,{state:Br,stats:ps,settings:ms,me:g?.user??null,onLink:Br.link,onUnlink:Br.unlink,onChangeSettings:ms.change})}})}),(0,_e.jsx)(U8,{timeline:L.timeline,commits:L.commits,historyId:L.requestId,boardId:Ft,connected:u,socketEpoch:c,onRequestHistory:h4,onInspectCommit:_R,onOpenIssue:_=>ja(_,"overview"),highlightEventId:io,timeTravel:g?.timeTravel??{mode:"live",asOfTime:null},onScrub:tt,onReturnToLive:jn,onPlayTheatre:so,theatreOpen:O!==null,logOpen:P,onChangeLogOpen:V,showIssues:X,onChangeShowIssues:ae,showCommits:A,onChangeShowCommits:me,linkedCommitsOnly:pe,onChangeLinkedCommitsOnly:I,issueIdByRef:dr,boardIssueIdByRef:oo,lanes:bp,laneTitles:vp,issueSummaryById:Ss,selection:a,onChangeSelection:l,selectedIssue:ie?{id:ie.id,createdAt:ie.createdAt}:null,textFilter:jt,onChangeTextFilter:He,queryIssueIds:Sp,knownIdentities:yp,refreshOn:c4,following:sS,onChangeFollowing:f4})]}),(0,_e.jsxs)("div",{style:{display:"flex",flexDirection:Q==="bottom"?"column":"row",flex:1,overflow:"hidden",position:"relative",opacity:Ju?.55:1,transition:"opacity 160ms ease"},children:[(0,_e.jsxs)("div",{style:{display:"flex",flex:1,minWidth:0,minHeight:0,overflow:"hidden"},children:[U.mounted&&!DR.poppedOut&&(0,_e.jsx)(z0,{revealed:U.shown,settled:U.settled,entries:lS,moment:RR,onHoverEvent:Wo,bottomClearance:O?BT:0,onOpen:xf,at:TR,followedLine:MR,eventsUnlisted:LR,onPinnedChange:AR,onPopOut:DR.popOut}),(0,_e.jsx)("main",{onClick:()=>{qa(),ro(null)},style:{padding:`0 0 0 ${r4}px`,flex:1,minWidth:0,minHeight:0,display:"flex",flexDirection:"column",overflow:"hidden"},children:(0,_e.jsxs)("div",{style:{display:"flex",gap:8,flex:1,minHeight:0,overflowX:"auto",overflowY:"hidden",pointerEvents:O?"none":void 0,paddingBottom:O?BT:0,transition:"padding-bottom 240ms ease"},children:[$R.map(_=>(0,_e.jsx)(HB,{swimlane:_,live:g?.timeTravel?.mode!=="scrub",diffStats:Vu,statsOpen:Fi===_.id,onOpenStats:Cp,selected:!1,selectedIssueId:ie?.id??null,commentsByIssueId:lr,dragOver:Le===_.id,dropIndex:Rt?.swimlaneId===_.id?Rt.index:null,onSelectIssue:Q0,onSelectIssueComments:Sf,onSelectIssueCode:kp,isolatedTagId:Y0,onFilterByTag:ju,onCreateIssue:y4,onRenameSwimlane:S4,onDeleteSwimlane:PR,dropSide:z?.swimlaneId===_.id?z.side:null,onSwimlaneDragOver:(G,q)=>Z({swimlaneId:G,side:q}),onSwimlaneDragEnd:()=>Z(null),onDropSwimlane:A4,onDropIssue:(G,q,qe)=>{let We=Ve.includes(G)?Ve:[G];bU(g,b,h)(We,q,qe),qa()},theatre:O?{flashIssueId:Tp.current?.issue??null,flashKey:Tp.current?.id??null}:null,pickedIssueIds:Ve,onDragOver:Ge,onDragOverIssue:(G,q)=>$e({swimlaneId:G,index:q}),onDragLeave:Yu},_.id)),Ae&&!Ae.readonly&&!Ju&&(0,_e.jsx)(QO,{onClick:()=>Rp("")}),Q==="right"&&(O||!ue&&!(ie&&g?.user))&&(0,_e.jsx)("div",{style:{width:ru(),flexShrink:0}}),(0,_e.jsx)("div",{style:{width:r4,flexShrink:0}})]})})]}),!O&&ue&&(0,_e.jsx)(Ca,{dock:Q,onWidthChange:Je,children:({isFullscreen:_,toggleFullscreen:G})=>(0,_e.jsx)(IH,{sha:ue.sha,files:ue.files,loading:ue.loading,error:ue.error,diffStyle:ke>=rm?"split":"unified",onClose:p4,isFullscreen:_,toggleFullscreen:G,dock:Q,onDock:re})}),!O&&!ue&&Lp&&(0,_e.jsx)(zB,{dock:Q,swimlane:Lp,state:$u,onClose:()=>ro(null)}),!O&&!ue&&!Lp&&Wa.length>1&&(0,_e.jsx)(hB,{dock:Q,issues:Wa,knownTags:g?.tags??[],knownAssignees:w,tagName:X0,assigneeName:wp,onChangeTagName:Ep,onChangeAssigneeName:Ku,onAddTag:_=>{Xu(G=>wf(G,_)),Ep("")},onRemoveTag:_=>Xu(G=>ao(G,_)),onAddAssignee:_=>Xu(G=>xs(G,_)),onRemoveAssignee:_=>Xu(G=>Es(G,_)),onCloseIssues:()=>{for(let _ of Wa)_.isClosed||Cf(_.id);qa()},onReopenIssues:()=>{for(let _ of Wa)_.isClosed&&lo(_.id);qa()},onClear:qa}),!O&&!ue&&!Lp&&Wa.length<=1&&ie&&g?.user&&(0,_e.jsx)(cB,{dock:Q,onDock:re,whoAmI:g.user,issue:(()=>{let _=In?.issueId===ie.id?{...ie,description:In.description}:ie;return Ju?{..._,readonly:!0}:_})(),activeTab:mt,comments:In?.issueId===ie.id?In.comments:[],onChangeTab:eS,onClose:Ba,timelineNarrowed:a.ticketOnly,timelineCapped:a.ticketOnly&&!ns(L.timeline),canNarrowTimeline:u||a.ticketOnly,onChangeTimelineNarrowed:_=>l({ticketOnly:_}),onEditTitle:Qu,onEditDescription:Ef,onAddTag:wf,onRemoveTag:ao,onAddAssignee:xs,onAddExternalAssignee:rS,onRemoveContributor:iS,onDeleteTag:Zu,onRemoveAssignee:Es,onAddComment:oS,onDeleteComment:aS,onEditComment:B,onFileTicket:I4,onOpenDiffLocation:tS,diffFocus:ri,focusedCommentId:Jt,attachments:xp[ie.id]??[],attachmentUploadStatus:nS,onUploadAttachments:ee,onDeleteAttachment:Ee,commits:en?.issueId===ie.id?en.commits:[],commitsLoading:en?.issueId===ie.id?en.loading:!0,commitsError:en?.issueId===ie.id?en.error:null,commitDiffsBySha:bi,onLoadCommitDiff:$t,diffView:{compacted:Ur,onChangeCompacted:gs,squashed:Mn?.issueId===ie.id?Mn.diff:null,loading:Mn?.issueId===ie.id?Mn.loading:!0,error:Mn?.issueId===ie.id?Mn.error:null},stats:sr?.issueId===ie.id?sr.stats:null,statsLoading:sr?.issueId===ie.id?sr.loading:!0,onOpenStatsFile:J0,boardStats:$a,activity:Gr,statsError:sr?.issueId===ie.id?sr.error:null,onReopenIssue:lo,onCloseIssue:Cf,knownTags:g.tags??[],knownAssignees:w,onOpenAssigneePicker:m4})]}),O&&(0,_e.jsx)(W8,{plan:O,playback:Tp,onExit:kf}),Ht&&(0,_e.jsx)(_l,{eyebrow:"New issue",fieldLabel:"title",placeholder:"issue name",title:Ht.title,onChangeTitle:_=>Wn(G=>G&&{...G,title:_}),onCreate:b4,onClose:()=>Wn(null)}),NR&&(0,_e.jsx)(_l,{eyebrow:"Rename swimlane",fieldLabel:"title",placeholder:"swimlane name",confirmLabel:"rename",title:NR.title,onChangeTitle:_=>FR(G=>G&&{...G,title:_}),onCreate:x4,onClose:()=>FR(null)}),Tf&&(0,_e.jsx)(ZO,{eyebrow:"Delete swimlane",heading:`Delete "${Tf.title}"?`,body:Tf.issues.length>0?`This also deletes the ${Tf.issues.length} ticket${Tf.issues.length===1?"":"s"} in it. Their history stays in the event log, but they leave the board.`:"The swimlane is empty, so nothing else goes with it.",confirmLabel:"delete",onConfirm:E4,onClose:()=>PR(null)}),zR!==null&&(0,_e.jsx)(_l,{eyebrow:"New board",fieldLabel:"title",placeholder:"board name",title:zR,onChangeTitle:uS,onCreate:w4,onClose:()=>uS(null)}),BR&&(0,_e.jsx)(_l,{eyebrow:"Rename board",fieldLabel:"title",placeholder:"board name",confirmLabel:"rename",title:BR.title,onChangeTitle:_=>UR(G=>G&&{...G,title:_}),onCreate:k4,onClose:()=>UR(null)}),HR!==null&&(0,_e.jsx)(_l,{eyebrow:"New swimlane",fieldLabel:"title",placeholder:"swimlane name",title:HR,onChangeTitle:Rp,onCreate:v4,onClose:()=>Rp(null)}),cS.open&&(0,_e.jsx)(fU,{commands:R4,context:L4,recentIds:GR.ids,onRun:_=>GR.remember(_.id),onClose:()=>cS.setOpen(!1)})]})})};var a4=T(j(),1);var gf=T(M(),1),l4=()=>{let{lines:e,board:t,open:n,reportPinned:i}=IU();return(0,a4.useEffect)(()=>{document.title="epiq \u2014 event log"},[]),(0,gf.jsxs)("div",{style:{height:"100vh",background:v.chrome,color:v.primary,fontFamily:Dl,display:"flex"},children:[(0,gf.jsx)(R0,{}),t?(0,gf.jsx)(z0,{layout:"window",entries:e?.entries??[],moment:e?.moment??1/0,bottomClearance:0,onOpen:n,followedLine:e?.followedLine??null,eventsUnlisted:e?.eventsUnlisted??!1,onPinnedChange:i,onDock:()=>window.close()}):(0,gf.jsx)("p",{"data-testid":"log-window-orphan",style:{margin:"auto",color:v.dim,fontSize:W.meta},children:"Open the log from a board to see it here."})]})};var ar=T(M(),1),s4=(0,ar.jsx)(bw,{poolOptions:LH,highlighterOptions:AH,children:(0,ar.jsx)(tH,{children:(0,ar.jsx)(o4,{})})});(0,u4.createRoot)(document.getElementById("root")).render((0,ar.jsx)(cC,{children:(0,ar.jsxs)(oC,{children:[(0,ar.jsx)(nu,{path:yR,element:(0,ar.jsx)(l4,{})}),(0,ar.jsx)(nu,{path:"/",element:s4}),(0,ar.jsx)(nu,{path:"/board/:boardId/*",element:s4}),(0,ar.jsx)(nu,{path:"*",element:(0,ar.jsx)(iC,{to:"/",replace:!0})})]})}));
1799
1799
  /*! Bundled license information:
1800
1800
 
package/dist/index.js CHANGED
@@ -25,7 +25,7 @@ ${s.message}`);let i=await Dm(e),c=o!==null&&i!==null&&o!==i;return u(c?"Pulled
25
25
  `+t.message);let o=t.value.stdout.trim().split(`
26
26
  `).filter(Boolean).filter(i=>i!==gt);if(o.length===0)return u("State branch is storage-only",!1);let r=await U({args:["rm","-r","--ignore-unmatch","--",...o],cwd:e});if(a(r))return l(`Failed to clean storage branch
27
27
  ${r.message}`);let s=await gr({cwd:e,message:"[epiq:repair-storage-branch]",pathspec:o});return a(s)?l(s.message):u("Cleaned storage branch",!0)},Zt=gc(async(e=process.cwd())=>{let t=await U({args:["rev-parse","--show-toplevel"],cwd:e});return a(t)?l("Not inside a Git repository"):u("Resolved repo root",t.value.stdout.trim())},e=>Et.resolve(e)),vL=gc(async e=>{let t=await U({args:["rev-parse","--git-dir"],cwd:e});if(a(t))return l(t.message);let n=t.value.stdout.trim(),o=Et.isAbsolute(n)?n:Et.join(e,n);return u("Resolved git dir",o)},e=>Et.resolve(e));var CL=process.env.IS_LOCAL==="true",gt=".epiq",Fn="events",wc="media",HI="project.json",Po=e=>gn.join(e,gt),pr=e=>gn.join(Po(e),HI),St=e=>gn.join(Po(e),Fn),gs=e=>gn.join(Po(e),wc),sp=e=>gn.join(e,gt),WI=e=>{let t=gn.join(e,gt);return fs.existsSync(t)&&fs.statSync(t).isDirectory()},hs=e=>{let t=pr(e);return fs.existsSync(t)&&fs.statSync(t).isFile()},Hi=e=>{let t=gn.resolve(e);for(;;){if(WI(t))return u("Resolved closest .epiq root",t);let n=gn.dirname(t);if(n===t)return l("No .epiq directory found in any parent");t=n}},Tc="No .epiq/project.json found in any parent",oe=e=>{let t=gn.resolve(e);for(;;){if(hs(t))return u("Resolved closest epiq project root",t);let n=gn.dirname(t);if(n===t)return l(Tc);t=n}},ip=e=>{let t=St(e);try{return fs.mkdirSync(t,{recursive:!0}),u("Resolved events dir",t)}catch(n){return l(n instanceof Error?`Failed to ensure events dir: ${n.message}`:"Failed to ensure events dir")}},Ie=async()=>{let e=await Zt(process.cwd());if(a(e))return e;let t=me({repoRoot:e.value});return a(t)?t:u("Resolved persist root",t.value)};import{accessSync as GI,copyFileSync as VI,existsSync as zi,mkdirSync as ap,readdirSync as lp,readFileSync as zI,renameSync as KI,rmSync as qI,statSync as cp,unlinkSync as YI,writeFileSync as XI}from"node:fs";import hr from"node:path";var Mc=e=>typeof e=="object"&&e!==null&&"code"in e&&typeof e.code=="string",rt={writeToFile:(e,t)=>{try{let n=hr.dirname(e);zi(n)||ap(n,{recursive:!0});let o=typeof t=="string"?t:JSON.stringify(t,null,2);XI(e,o,"utf-8")}catch(n){logger.error(`Failed to write file at ${e}:`,n)}},readFile:e=>{try{return zI(e,"utf-8")}catch(t){return logger.error(`Failed to read file at ${e}:`,t),null}},readFileJSON(e){try{let t=rt.readFile(e);return t===null?null:JSON.parse(t)}catch(t){return logger.error(`Failed to read JSON at ${e}:`,t),null}},dirExists:e=>{try{return zi(e)&&cp(e).isDirectory()}catch{return!1}},async fileExists(e){try{return await GI(e),!0}catch{return!1}},mkDir:e=>ap(e,{recursive:!0}),locateFolder:e=>{let t=process.cwd(),{root:n}=hr.parse(t);for(;;){let o=hr.join(t,e);try{if(zi(o)&&cp(o).isDirectory())return o}catch{logger.error(`Unable to locate folder ${e}`)}if(t===n)break;t=hr.dirname(t)}return null},readFirstJSON(e){try{if(!rt.dirExists(e))return null;let t=lp(e).filter(o=>o.endsWith(".json")).sort()[0];if(!t)return null;let n=hr.join(e,t);return rt.readFileJSON(n)}catch(t){return logger.error(`Could not read first JSON in folder ${e}`,t),null}},listDir:e=>{try{return rt.dirExists(e)?lp(e):[]}catch(t){return logger.error(`Failed to list dir ${e}`,t),[]}},rmFile(e){try{YI(e)}catch(t){(!Mc(t)||t.code!=="ENOENT")&&logger.error(`Unable to remove file ${e}`)}},rmDir(e){try{qI(e,{recursive:!0,force:!0})}catch(t){(!Mc(t)||t.code!=="ENOENT")&&logger.error(`Unable to remove dir ${e}`)}},moveFile(e,t,n){if(this.mkDir(hr.dirname(t)),!n?.overwrite&&zi(t))throw new Error(`moveFile: destination exists: ${t}`);n?.overwrite&&this.rmFile(t);try{KI(e,t)}catch(o){if(Mc(o)&&o.code==="EXDEV"){VI(e,t),this.rmFile(e);return}throw o}}};var QI={logLevel:"info",userId:"",userName:"",preferredEditor:"",autoSync:!1},up=en.object({logLevel:en.enum(["info","error","debug"]),preferredEditor:en.string().optional(),userName:en.string().optional(),userId:en.string().optional(),autoSync:en.boolean().nullable().optional(),autoSyncDebounceMs:en.number().optional(),attachmentMaxKb:en.number().optional(),viewMode:en.enum(["dense","wide"]).optional(),declinedEmailBoards:en.array(en.string()).optional()}).partial(),ZI="config.json",mp=Bn,Pc=()=>JI.join(mp(),ZI),Lc=()=>{try{return rt.mkDir(mp()),u(`Ensured ~/${Jt} exists`,null)}catch{return l(`Unable to create ~/${Jt}`)}},eE=e=>{let t;try{t=JSON.parse(e)}catch{return l(`Invalid ~/${Jt}/config.json JSON`)}let n=up.safeParse(t??{});return n.success?u("Parsed config",n.data):l(`Invalid ~/${Jt}/config.json shape: ${n.error.issues.map(o=>o.path.join(".")||o.message).join(", ")}`)},hn=()=>{let e=Lc();if(a(e))return l(e.message);let t=Pc(),n=rt.readFile(t);return n==null||n.trim()===""?u("No config found, using empty config",{logLevel:"info",autoSync:null,preferredEditor:"",userId:"",userName:"",autoSyncIntervalMs:1e4}):eE(n)},pp=e=>{let t=Lc();if(a(t))return l(t.message);let n=up.safeParse(e);if(!n.success)return l(`Invalid config: ${n.error.issues.map(r=>r.path.join(".")||r.message).join(", ")}`);let o=Pc();try{return rt.writeToFile(o,JSON.stringify(n.data,null,2)+`
28
- `),u("Config written",null)}catch{return l(`Unable to write ~/${Jt}/config.json`)}},Ut=e=>{let t=hn();if(a(t))return l("Failed to read existing config");let n={...t.value,...e};return pp(n)},ht=()=>{let e=Pc(),t=Lc();if(a(t))return l(`Unable to create ~/${Jt}`);if(!(rt.readFile(e)!==null)){let b=pp(QI);if(a(b))throw new Error(`Unable to create ~/${Jt}/config.json`)}let o=hn();if(a(o))throw new Error(o.message||"Unable to load settings");let{preferredEditor:r,userName:s,userId:i,declinedEmailBoards:c,autoSync:d,autoSyncDebounceMs:p,attachmentMaxKb:m,logLevel:f,viewMode:g}=o.value,h=dr({userId:i,userName:s});if(a(h))return l(h.message);let x=h.value??{userId:i,userName:s};return!x.userName||!x.userId?l(`User name or ID not configured in ~/${Jt}/config.json`):(process.env.EPIQ_LOG_LEVEL=f,u("successfully loaded settings",{gitEmail:null,gitName:null,declinedEmailBoards:c??[],logLevel:f??"debug",preferredEditor:r??"",userName:x.userName,userId:x.userId,autoSync:d??!1,autoSyncIntervalMs:p??1e4,attachmentMaxKb:m??null,viewMode:g??"dense"}))};import{useSyncExternalStore as tE}from"react";var ys={logLevel:"info",autoSyncIntervalMs:null,attachmentMaxKb:null,autoSync:null,preferredEditor:null,userName:null,userId:null,gitEmail:null,gitName:null,declinedEmailBoards:[],viewMode:null},kc=new Set,nE=()=>{for(let e of kc)e()},V=()=>ys,fp=()=>tE(e=>(kc.add(e),()=>{kc.delete(e)}),()=>ys),je=e=>(ys={...ys,...e},nE(),ys);var kt="1.12.3";import aE from"node:os";import lE from"node:path";import vs from"chalk";var Ki=["\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2557 ","\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2550\u2588\u2588\u2557","\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2551","\u2588\u2588\u2554\u2550\u2550\u255D \u2588\u2588\u2554\u2550\u2550\u2550\u255D \u2588\u2588\u2551\u2588\u2588\u2551\u2584\u2584 \u2588\u2588\u2551","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2551 \u2588\u2588\u2551\u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D","\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D\u255A\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u2550\u2550\u2580\u2580\u255D "];var it={bg:"#1a1b26",fg:"#c8d3ff",grayDark:"#3a3e54",gray:"#46507a",grayLight:"#969bb5",cyan:"#88d5ee",cyanSoft:"#8fe6fb",blue:"#5b8cff",magenta:"#a78bfa",magentaSoft:"#c4b5fd",green:"#8fdc8c",yellow:"#f1c27d",red:"#ff7a90",white:"#ffffff"},y={accent:it.cyan,accent2:it.magenta,primary:it.white,secondary:it.grayDark,secondary2:it.grayLight,gray:it.gray,green:it.green,yellow:it.yellow,red:it.red};import yr from"chalk";var L={red:it.red,yellow:it.yellow,green:it.green,blue:it.blue,magenta:it.magenta,cyan:it.cyan},qi={urgent:L.red,critical:L.red,important:L.red,blocker:L.red,asap:L.red,immediate:L.red,fail:L.red,failure:L.red,broken:L.red,bug:L.red,error:L.red,incident:L.red,outage:L.red,production:L.red,crash:L.red,security:L.red,warning:L.yellow,warn:L.yellow,risky:L.yellow,risk:L.yellow,attention:L.yellow,pending:L.yellow,review:L.yellow,"needs-review":L.yellow,qa:L.yellow,testing:L.yellow,test:L.yellow,validate:L.yellow,verification:L.yellow,staging:L.yellow,check:L.yellow,"follow-up":L.yellow,followup:L.yellow,waiting:L.yellow,blocked:L.yellow,hold:L.yellow,done:L.green,complete:L.green,completed:L.green,success:L.green,ok:L.green,stable:L.green,resolved:L.green,fixed:L.green,closed:L.green,merged:L.green,released:L.green,deployed:L.green,approved:L.green,verified:L.green,working:L.green,healthy:L.green,pass:L.green,passing:L.green,info:L.blue,information:L.blue,note:L.blue,docs:L.blue,documentation:L.blue,doc:L.blue,guide:L.blue,help:L.blue,explanation:L.blue,detail:L.blue,details:L.blue,context:L.blue,design:L.blue,discussion:L.blue,proposal:L.blue,idea:L.blue,feature:L.magenta,enhancement:L.magenta,improvement:L.magenta,refactor:L.magenta,refactoring:L.magenta,cleanup:L.magenta,optimize:L.magenta,optimization:L.magenta,perf:L.magenta,performance:L.magenta,upgrade:L.magenta,migration:L.magenta,modernize:L.magenta,debt:L.magenta,todo:L.cyan,next:L.cyan,planned:L.cyan,plan:L.cyan,future:L.cyan,backlog:L.cyan,investigate:L.cyan,explore:L.cyan,prototype:L.cyan};var Bc={stringColor:{saturation:50,lightness:60},gradient:{stops:[[174,150,240],[92,138,232],[102,204,226]]}},Oc=(e,t,n)=>Math.max(t,Math.min(n,e)),Dc=(e,t,n)=>e+(t-e)*n,hp=e=>{let t=0;for(let n=0;n<e.length;n++)t=t*31+e.charCodeAt(n)>>>0;return t},oE=e=>e.toLowerCase().trim(),rE=(e,t,n)=>{let o=t/100,r=n/100,s=(1-Math.abs(2*r-1))*o,i=e/60,c=s*(1-Math.abs(i%2-1)),d=0,p=0,m=0;i>=0&&i<1?(d=s,p=c):i>=1&&i<2?(d=c,p=s):i>=2&&i<3?(p=s,m=c):i>=3&&i<4?(p=c,m=s):i>=4&&i<5?(d=c,m=s):(d=s,m=c);let f=r-s/2;return[Math.round((d+f)*255),Math.round((p+f)*255),Math.round((m+f)*255)]},Fc=([e,t,n])=>`#${e.toString(16).padStart(2,"0")}${t.toString(16).padStart(2,"0")}${n.toString(16).padStart(2,"0")}`,gp=e=>{let t=e.replace("#","");return[parseInt(t.slice(0,2),16),parseInt(t.slice(2,4),16),parseInt(t.slice(4,6),16)]},yp=(e,t,n)=>{let o=Oc(n,0,1);return[Math.round(Dc(e[0],t[0],o)),Math.round(Dc(e[1],t[1],o)),Math.round(Dc(e[2],t[2],o))]};var sE=(e,t,n)=>yp(e,t,n),_c=e=>{let t=hp(e)%360,n=rE(t,Bc.stringColor.saturation,Bc.stringColor.lightness);return Fc(n)},ze=(e,t=qi)=>{let n=oE(e??"");return n&&t[n]?t[n]:_c(n)};var Yi=e=>{let t=Bc.gradient.stops,n=Oc(e,0,1);if(t.length===0)return[0,0,0];if(t.length===1)return t[0];let o=t.length-1,r=n*o,s=Math.min(Math.floor(r),o-1),i=r-s;return sE(t[s],t[s+1],i)},vp=(e,t)=>{if(e.length===0)return"#000000";if(e.length===1)return e[0];let n=e.length-1,o=Oc(t,0,1)*n,r=Math.min(Math.floor(o),n-1);return Fc(yp(gp(e[r]),gp(e[r+1]),o-r))},Xi=e=>Fc(Yi(e)),Ji=e=>hp(e.toLowerCase().trim())/4294967295,bp=e=>{let t=Ji(e);return Yi(t)},iE=e=>{let[t,n,o]=bp(e);return{normal:r=>yr.bgRgb(t,n,o).black(r),cursor:r=>yr.bgRgb(t,n,o).white.bold(r)}},jc=e=>{let[t,n,o]=bp(e);return{fg:r=>yr.rgb(t,n,o)(r),fgCursor:r=>yr.rgb(t,n,o).inverse(r),bg:r=>yr.bgRgb(t,n,o).black(r),bgCursor:r=>yr.bgRgb(t,n,o).white.bold(r)}},Qi=e=>iE(e).normal(` ${e} `);var Zi=" ",Ep=vs.hex(y.secondary2),xp=vs.hex(y.gray),cE=()=>{let t=Ki[0].length+Ki.length*2;return Ki.map((n,o)=>Array.from(n).map((r,s)=>{let[i,c,d]=Yi((s+o*2)/t);return vs.rgb(i,c,d)(r)}).join(""))},dE=e=>{let t=aE.homedir();return e===t||e.startsWith(t+lE.sep)?"~"+e.slice(t.length):e},Ip=(e,t)=>`${Zi}${vs.hex(y.accent)("\u279C")} ${Ep(e.padEnd(9))}${t}`,$c=({url:e,repoRoot:t,version:n,reused:o})=>["",...cE().map(r=>Zi+r),"",`${Zi}${Ep("gui")} ${xp(`\xB7 v${n}`)}`,"",Ip("Local",vs.hex(y.accent).bold(e)),Ip("Project",dE(t)),"",Zi+xp(o?"already running for this project \xB7 opened in your browser":"press ctrl+c to stop"),""].join(`
28
+ `),u("Config written",null)}catch{return l(`Unable to write ~/${Jt}/config.json`)}},Ut=e=>{let t=hn();if(a(t))return l("Failed to read existing config");let n={...t.value,...e};return pp(n)},ht=()=>{let e=Pc(),t=Lc();if(a(t))return l(`Unable to create ~/${Jt}`);if(!(rt.readFile(e)!==null)){let b=pp(QI);if(a(b))throw new Error(`Unable to create ~/${Jt}/config.json`)}let o=hn();if(a(o))throw new Error(o.message||"Unable to load settings");let{preferredEditor:r,userName:s,userId:i,declinedEmailBoards:c,autoSync:d,autoSyncDebounceMs:p,attachmentMaxKb:m,logLevel:f,viewMode:g}=o.value,h=dr({userId:i,userName:s});if(a(h))return l(h.message);let x=h.value??{userId:i,userName:s};return!x.userName||!x.userId?l(`User name or ID not configured in ~/${Jt}/config.json`):(process.env.EPIQ_LOG_LEVEL=f,u("successfully loaded settings",{gitEmail:null,gitName:null,declinedEmailBoards:c??[],logLevel:f??"debug",preferredEditor:r??"",userName:x.userName,userId:x.userId,autoSync:d??!1,autoSyncIntervalMs:p??1e4,attachmentMaxKb:m??null,viewMode:g??"dense"}))};import{useSyncExternalStore as tE}from"react";var ys={logLevel:"info",autoSyncIntervalMs:null,attachmentMaxKb:null,autoSync:null,preferredEditor:null,userName:null,userId:null,gitEmail:null,gitName:null,declinedEmailBoards:[],viewMode:null},kc=new Set,nE=()=>{for(let e of kc)e()},V=()=>ys,fp=()=>tE(e=>(kc.add(e),()=>{kc.delete(e)}),()=>ys),je=e=>(ys={...ys,...e},nE(),ys);var kt="1.12.4";import aE from"node:os";import lE from"node:path";import vs from"chalk";var Ki=["\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2557 ","\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2550\u2588\u2588\u2557","\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2551","\u2588\u2588\u2554\u2550\u2550\u255D \u2588\u2588\u2554\u2550\u2550\u2550\u255D \u2588\u2588\u2551\u2588\u2588\u2551\u2584\u2584 \u2588\u2588\u2551","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2551 \u2588\u2588\u2551\u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D","\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D\u255A\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u2550\u2550\u2580\u2580\u255D "];var it={bg:"#1a1b26",fg:"#c8d3ff",grayDark:"#3a3e54",gray:"#46507a",grayLight:"#969bb5",cyan:"#88d5ee",cyanSoft:"#8fe6fb",blue:"#5b8cff",magenta:"#a78bfa",magentaSoft:"#c4b5fd",green:"#8fdc8c",yellow:"#f1c27d",red:"#ff7a90",white:"#ffffff"},y={accent:it.cyan,accent2:it.magenta,primary:it.white,secondary:it.grayDark,secondary2:it.grayLight,gray:it.gray,green:it.green,yellow:it.yellow,red:it.red};import yr from"chalk";var L={red:it.red,yellow:it.yellow,green:it.green,blue:it.blue,magenta:it.magenta,cyan:it.cyan},qi={urgent:L.red,critical:L.red,important:L.red,blocker:L.red,asap:L.red,immediate:L.red,fail:L.red,failure:L.red,broken:L.red,bug:L.red,error:L.red,incident:L.red,outage:L.red,production:L.red,crash:L.red,security:L.red,warning:L.yellow,warn:L.yellow,risky:L.yellow,risk:L.yellow,attention:L.yellow,pending:L.yellow,review:L.yellow,"needs-review":L.yellow,qa:L.yellow,testing:L.yellow,test:L.yellow,validate:L.yellow,verification:L.yellow,staging:L.yellow,check:L.yellow,"follow-up":L.yellow,followup:L.yellow,waiting:L.yellow,blocked:L.yellow,hold:L.yellow,done:L.green,complete:L.green,completed:L.green,success:L.green,ok:L.green,stable:L.green,resolved:L.green,fixed:L.green,closed:L.green,merged:L.green,released:L.green,deployed:L.green,approved:L.green,verified:L.green,working:L.green,healthy:L.green,pass:L.green,passing:L.green,info:L.blue,information:L.blue,note:L.blue,docs:L.blue,documentation:L.blue,doc:L.blue,guide:L.blue,help:L.blue,explanation:L.blue,detail:L.blue,details:L.blue,context:L.blue,design:L.blue,discussion:L.blue,proposal:L.blue,idea:L.blue,feature:L.magenta,enhancement:L.magenta,improvement:L.magenta,refactor:L.magenta,refactoring:L.magenta,cleanup:L.magenta,optimize:L.magenta,optimization:L.magenta,perf:L.magenta,performance:L.magenta,upgrade:L.magenta,migration:L.magenta,modernize:L.magenta,debt:L.magenta,todo:L.cyan,next:L.cyan,planned:L.cyan,plan:L.cyan,future:L.cyan,backlog:L.cyan,investigate:L.cyan,explore:L.cyan,prototype:L.cyan};var Bc={stringColor:{saturation:50,lightness:60},gradient:{stops:[[174,150,240],[92,138,232],[102,204,226]]}},Oc=(e,t,n)=>Math.max(t,Math.min(n,e)),Dc=(e,t,n)=>e+(t-e)*n,hp=e=>{let t=0;for(let n=0;n<e.length;n++)t=t*31+e.charCodeAt(n)>>>0;return t},oE=e=>e.toLowerCase().trim(),rE=(e,t,n)=>{let o=t/100,r=n/100,s=(1-Math.abs(2*r-1))*o,i=e/60,c=s*(1-Math.abs(i%2-1)),d=0,p=0,m=0;i>=0&&i<1?(d=s,p=c):i>=1&&i<2?(d=c,p=s):i>=2&&i<3?(p=s,m=c):i>=3&&i<4?(p=c,m=s):i>=4&&i<5?(d=c,m=s):(d=s,m=c);let f=r-s/2;return[Math.round((d+f)*255),Math.round((p+f)*255),Math.round((m+f)*255)]},Fc=([e,t,n])=>`#${e.toString(16).padStart(2,"0")}${t.toString(16).padStart(2,"0")}${n.toString(16).padStart(2,"0")}`,gp=e=>{let t=e.replace("#","");return[parseInt(t.slice(0,2),16),parseInt(t.slice(2,4),16),parseInt(t.slice(4,6),16)]},yp=(e,t,n)=>{let o=Oc(n,0,1);return[Math.round(Dc(e[0],t[0],o)),Math.round(Dc(e[1],t[1],o)),Math.round(Dc(e[2],t[2],o))]};var sE=(e,t,n)=>yp(e,t,n),_c=e=>{let t=hp(e)%360,n=rE(t,Bc.stringColor.saturation,Bc.stringColor.lightness);return Fc(n)},ze=(e,t=qi)=>{let n=oE(e??"");return n&&t[n]?t[n]:_c(n)};var Yi=e=>{let t=Bc.gradient.stops,n=Oc(e,0,1);if(t.length===0)return[0,0,0];if(t.length===1)return t[0];let o=t.length-1,r=n*o,s=Math.min(Math.floor(r),o-1),i=r-s;return sE(t[s],t[s+1],i)},vp=(e,t)=>{if(e.length===0)return"#000000";if(e.length===1)return e[0];let n=e.length-1,o=Oc(t,0,1)*n,r=Math.min(Math.floor(o),n-1);return Fc(yp(gp(e[r]),gp(e[r+1]),o-r))},Xi=e=>Fc(Yi(e)),Ji=e=>hp(e.toLowerCase().trim())/4294967295,bp=e=>{let t=Ji(e);return Yi(t)},iE=e=>{let[t,n,o]=bp(e);return{normal:r=>yr.bgRgb(t,n,o).black(r),cursor:r=>yr.bgRgb(t,n,o).white.bold(r)}},jc=e=>{let[t,n,o]=bp(e);return{fg:r=>yr.rgb(t,n,o)(r),fgCursor:r=>yr.rgb(t,n,o).inverse(r),bg:r=>yr.bgRgb(t,n,o).black(r),bgCursor:r=>yr.bgRgb(t,n,o).white.bold(r)}},Qi=e=>iE(e).normal(` ${e} `);var Zi=" ",Ep=vs.hex(y.secondary2),xp=vs.hex(y.gray),cE=()=>{let t=Ki[0].length+Ki.length*2;return Ki.map((n,o)=>Array.from(n).map((r,s)=>{let[i,c,d]=Yi((s+o*2)/t);return vs.rgb(i,c,d)(r)}).join(""))},dE=e=>{let t=aE.homedir();return e===t||e.startsWith(t+lE.sep)?"~"+e.slice(t.length):e},Ip=(e,t)=>`${Zi}${vs.hex(y.accent)("\u279C")} ${Ep(e.padEnd(9))}${t}`,$c=({url:e,repoRoot:t,version:n,reused:o})=>["",...cE().map(r=>Zi+r),"",`${Zi}${Ep("gui")} ${xp(`\xB7 v${n}`)}`,"",Ip("Local",vs.hex(y.accent).bold(e)),Ip("Project",dE(t)),"",Zi+xp(o?"already running for this project \xB7 opened in your browser":"press ctrl+c to stop"),""].join(`
29
29
  `);import{spawn as uE}from"node:child_process";import bs from"node:process";var Sp=(e=bs.platform,t=bs.env)=>e==="darwin"||e==="win32"||!!(t.DISPLAY||t.WAYLAND_DISPLAY||t.BROWSER),Rp=e=>{let t=bs.platform==="darwin"?"open":bs.platform==="win32"?"cmd":"xdg-open",n=bs.platform==="win32"?["/c","start","",e]:[e];try{let o=uE(t,n,{detached:!0,stdio:"ignore"});o.on("error",r=>{logger.info(`[gui] could not open a browser: ${r.message}`)}),o.unref()}catch(o){logger.info(`[gui] could not open a browser: ${String(o)}`)}};import{readFile as px,stat as WT}from"node:fs/promises";import{createHash as GT}from"node:crypto";import Ro from"chalk";import Vv from"string-width";import{decodeTime as Cp}from"ulid";var ea=1440*60*1e3,xs=(e,t=Date.now())=>e>t+ea?t:e,De=e=>xs(Cp(e)),vr=e=>{let t=Date.now()+ea,n=e.find(r=>r!==null&&r<=t)??null;if(n===null)return[...e];let o=null;return e.map(r=>{if(r===null)return null;let s=r<=t?r:o??n;return o=s,s})},br=e=>{try{return u("Decoded date",new Date(De(e)))}catch(t){return l("Decoding failed + "+t.message)}},to=e=>{if(!e?.id)return null;try{return Cp(e.id)}catch{return null}};var mE="Unknown",ta=(e,t)=>t?.length?t:e?.length?e:mE,Ke=(e,t)=>{let n=ta(e,t);return{id:e?.length?e:n,name:n,color:ze(n)}};var xr="removed",yt=(e,t)=>{let n=e.find(o=>o.context===t);return n!==void 0?u("Found node",n):l("Unable to find node in breadcrumb")},Np=["png","jpg","gif","webp"];var Ze=e=>e.trim().toLowerCase(),no=e=>{let t=Ze(e);return t.length>0&&t.length<=254&&/^[^\s@]+@[^\s@]+$/.test(t)},Is=(e,t)=>`${Ze(e)} ${t}`,Uc=e=>!e.tombstoned,Es=(e,t)=>{let n=Ze(t),o=new Set;for(let r of Object.values(e))Uc(r)&&r.email===n&&o.add(r.contributor);return[...o]},yn=(e,t)=>{let n=new Set;for(let o of Object.values(e))Uc(o)&&o.contributor===t&&n.add(o.email);return[...n]},Ap=e=>{let t=new Map;for(let o of Object.values(e)){if(!Uc(o))continue;let r=t.get(o.email)??new Set;r.add(o.contributor),t.set(o.email,r)}let n=new Map;for(let[o,r]of t){let[s]=[...r];r.size===1&&s&&n.set(o,s)}return n};var na=(e,t)=>e===t.authorId||e===t.contributor;var re={WORKSPACE:"WORKSPACE",BOARD:"BOARD",SWIMLANE:"SWIMLANE",TICKET:"TICKET",FIELD:"FIELD",FIELD_LIST:"FIELD_LIST",TEXT:"TEXT",COMMENT:"COMMENT"};function Hc(e){return e.context===re.WORKSPACE}function _(e){return e.context===re.TICKET}function oo(e){return e.context===re.TEXT}function at(e){return e.context===re.FIELD}function Ss(e){return e.context===re.FIELD_LIST}var vn=e=>e.context===re.SWIMLANE,ro=e=>e.context===re.BOARD,Rs=e=>e.context===re.COMMENT;import{useSyncExternalStore as _A}from"react";var I={DEFAULT:"default",MOVE:"move",HELP:"help",COMMAND_LINE:"cmd-line",PALETTE:"palette",IDENTITY:"identity"};var wp=(e,t)=>e.ctrl&&e.name==="w"||e.meta&&e.name==="backspace"||t==="",Tp=(e,t)=>e.meta&&e.name==="b"||t==="\x1Bb",Mp=(e,t)=>e.meta&&e.name==="f"||t==="\x1Bf",Pp=(e,t)=>{if(Tp(e,e.sequence))return E.MoveCursorLeftOfWord;if(Mp(e,e.sequence))return E.MoveCursorRightOfWord;if(wp(e,e.sequence))return E.EraseInputWord;switch(e.name){case"tab":return E.AutoCompleteCommand;case"up":return E.GetLastCommandFromHistory;case"down":return E.GetNextCommandFromHistory;case"left":return E.MoveCursorLeft;case"right":return E.MoveCursorRight;case"return":return E.Confirm;case"backspace":return t?E.EraseInput:E.ExitCommandLine;case"escape":return E.ExitCommandLine;default:return E.CaptureInput}},Lp=(e,t)=>{if(Tp(e,e.sequence))return E.MoveCursorLeftOfWord;if(Mp(e,e.sequence))return E.MoveCursorRightOfWord;if(wp(e,e.sequence))return E.EraseInputWord;switch(e.name){case"tab":return E.AutoCompleteCommand;case"up":return E.NavPreviousItem;case"down":return E.NavNextItem;case"left":return E.MoveCursorLeft;case"right":return E.MoveCursorRight;case"return":return E.Confirm;case"backspace":return t?E.EraseInput:E.ExitCommandLine;case"escape":return E.ExitCommandLine;default:return E.CaptureInput}};import kp from"string-width";function oa(e,t){let n=Math.min(e.length,t.length),o=0;for(;o<n&&e[o]===t[o];)o++;return o}var _n=(e,t)=>t<=0?"":e.length<=t?e:t<=3?"...".slice(0,t):e.slice(0,t-3)+"...",pE=/\u001B\[[0-9;]*m/,Wc="\x1B[0m",fE=e=>[...new Intl.Segmenter(void 0,{granularity:"grapheme"}).segment(e)].map(({segment:t})=>t),jn=(e,t)=>{if(t<=0)return"";if(kp(e)<=t)return e;if(t<=3)return"...".slice(0,t);let o=t-3,r="",s=0,i=!1;for(let c of e.split(/(\u001B\[[0-9;]*m)/))if(c!==""){if(pE.test(c)){r+=c,i=c!==Wc&&c!=="\x1B[m";continue}for(let d of fE(c)){let p=kp(d);if(s+p>o)return`${r}...${i?Wc:""}`;r+=d,s+=p}}return`${r}...${i?Wc:""}`},Ee=e=>typeof e!="string"?"":e.replace(/[\x00-\x08\x0B-\x1F\x7F]/g,"").replace(/[\r\n\t]/g," ").replace(/\s+/g," ").trim(),Dp=e=>e.charAt(0).toUpperCase()+e.slice(1);var Bp=e=>{let t=new Map;for(let n of e){let o=n.toLowerCase();for(let r=1;r<=n.length;r++){let s=o.slice(0,r),i=t.get(s);i?i.push(n):t.set(s,[n])}}return t},Op=(e,t)=>t?e.get(t)??[]:[];var Fp=new WeakMap,gE=e=>{let t=Fp.get(e);return t||(t=Bp(e),Fp.set(e,t)),t};var _p=({wordList:e,inputToMatch:t,overlapThreshold:n=1})=>{let o=t.toLowerCase();return Op(gE(e),o).filter(s=>oa(o,s.toLowerCase())>=n)};var hE={hint:"",hints:[],overlap:0,remainder:""},$p=({inputToMatch:e,lastWord:t,isLastWordCompleted:n,inputString:o},r,s=[])=>{if(n||e===""){let[c]=s;return s.length===1&&c&&!o.trim()?jp("",[c]):hE}let i=_p({wordList:r,inputToMatch:e,overlapThreshold:1});return jp(t,i)},jp=(e,t)=>{let n=t[0]??"",o=oa(e.toLowerCase(),n.toLowerCase()),[r,s]=n.split(":"),i=o<(r??"").length,c=!!s,m=(c&&i?r:n)+(c&&i?":":" "),f=m.slice(o);return{hint:m,hints:t,overlap:o,remainder:f}};import Cs from"node:fs";import Ns from"node:path";import{z as Ir}from"zod";var ra="recent-projects.json",yE=20,vE=Ir.object({projectId:Ir.string().min(1),root:Ir.string().min(1),lastOpenedAt:Ir.number().finite()}),bE=Ir.object({projects:Ir.array(vE)}),Hp=()=>Ns.join(Bn(),ra),Er=e=>Ns.basename(e)||e,Up=e=>{let t=Ns.resolve(e);try{return Cs.realpathSync(t)}catch{return t}},Wp=(e,t)=>t.lastOpenedAt-e.lastOpenedAt,Gp=e=>{if(!hs(e.root))return!1;let t=fn(e.root);return!a(t)&&t.value===e.projectId},Vp=()=>{let e=Hp();if(!Cs.existsSync(e))return u("No recent projects recorded",[]);let t;try{t=JSON.parse(Cs.readFileSync(e,"utf8"))}catch(o){return l(`Invalid ${ra}: ${o instanceof Error?o.message:String(o)}`)}let n=bE.safeParse(t);return n.success?u("Read recent projects",n.data.projects):l(`Invalid ${ra} shape: ${n.error.issues.map(o=>o.path.join(".")||o.message).join(", ")}`)},xE=e=>{let t=Hp();try{Cs.mkdirSync(Ns.dirname(t),{recursive:!0}),Cs.writeFileSync(t,JSON.stringify({projects:e},null,2)+`
30
30
  `,"utf8")}catch(n){return l(`Unable to write ${ra}: ${n instanceof Error?n.message:String(n)}`)}return u("Recorded recent project",e)},$n=({exclude:e}={})=>{let t=Vp();if(a(t))return t;let n=e===void 0?null:Up(e);return u("Listed recent projects",t.value.filter(o=>n===null||Up(o.root)!==n).filter(Gp).sort(Wp))},sa=({root:e,now:t=Date.now()})=>{let n=Ns.resolve(e),o=fn(n);if(a(o))return l(o.message);let r=o.value,s=Vp(),i=a(s)?[]:s.value,c=[{projectId:r,root:n,lastOpenedAt:t},...i.filter(d=>d.projectId!==r&&d.root!==n)].filter(Gp).sort(Wp).slice(0,yE);return xE(c)};var Gc=null,zp=e=>{Gc=e},Kp=e=>Gc?Gc(e):[];var qp=[],Sr=e=>{qp=e},Rr=()=>qp;var Un=()=>{let e=V(),t=!!e.userName?.trim(),n=!!e.preferredEditor?.trim(),o=e.autoSync===!0||e.autoSync===!1,r=Yp(),s=r.length>0?null:Vc(),i=s!==null&&(e.declinedEmailBoards??[]).includes(s),c=r.length>0||i||s===null;return{isSetupDone:n&&t&&o&&c,isSetPreferredEditor:n,isSetUserName:t,userName:e.userName,preferredEditor:e.preferredEditor,autoSync:e.autoSync===void 0?null:e.autoSync,isSetAutoSync:o,isSetEmails:c,claimedEmails:r,emailSetupDeclined:i}},Vc=()=>{let e=oe(process.cwd());if(a(e))return null;let t=fn(e.value);return a(t)?null:t.value||null},Yp=()=>{let{userId:e}=V();return e?Kp(e):[]},Xp=()=>Yp().length>0;var zc=()=>{let e=oe(process.cwd());if(a(e))return!1;let t=Mt(e.value);return ve(t)},Jp=e=>e===!0?"on":e===!1?"off":null,Qp=e=>e==="on"?!0:e==="off"?!1:null,Zp=()=>{let e=Un();if(!e.isSetUserName)return"config username ";if(!e.isSetPreferredEditor)return"config editor ";if(!e.isSetAutoSync)return"config autoSync ";if(!zc())return"init";if(!e.isSetEmails){let{gitEmail:t}=V(),n=Rr()[0]??t;return n&&no(n)?`config emails ${n}`:"config emails "}return null};var IE=["00KM6CZ900T7180RM46K0JAYNF","00JR3R8E00A1Z4X9FGP9DV0SM5"],[he,ia]=IE;var EE=e=>e.props.tags??[],SE=e=>e.props.assignees??[],bn=e=>EE(e).map(t=>N.getTag(t)).filter(t=>!!t),xn=e=>SE(e).map(t=>N.getContributor(t)).filter(t=>!!t),aa=()=>{let{breadCrumb:e,selectedNode:t}=v(),n=[...e,t].find(o=>o?.context==="TICKET");return!n||!_(n)?l("Invalid untag target"):u("Retrieved tags from ticket in breadcrumb",bn(n))},la=()=>{let{breadCrumb:e,selectedNode:t}=v(),n=[...e,t].find(o=>o?.context==="TICKET");return!n||!_(n)?l("Invalid unassign target"):u("Retrieved assignees from ticket in breadcrumb",xn(n))};var C={PALETTE:"?",EXIT:"exit",INIT:"init",OPEN:"open",HELP:"help",NEW:"new",TAG:"tag",UNTAG:"untag",MOVE:"move",PEEK:"peek",REPLAY:"replay",FILTER:"filter",ASSIGN:"assign",UNASSIGN:"unassign",DELETE:"delete",CLOSE_ISSUE:"close",RE_OPEN_ISSUE:"reopen",COMMENT:"comment",CONFIG:"config",EDIT:"edit",YANK:"yank",SYNC:"sync",EXPORT:"export",NONE:""};var RE=/^(\d+)(h|d|w|mo|y)$/,CE=/^(\d{4})-(\d{2})-(\d{2})(?:(?::|\s)(\d{2}):(\d{2}))?$/,NE=({year:e,month:t,day:n,hour:o=0,minute:r=0})=>{let s=new Date(e,t-1,n,o,r);return s.getFullYear()===e&&s.getMonth()===t-1&&s.getDate()===n&&s.getHours()===o&&s.getMinutes()===r},AE=(e,t=new Date)=>{let n=e.match(RE);if(!n)return null;let[,o,r]=n,s=Number(o);if(!Number.isInteger(s)||s<=0)return null;let i=new Date(t);switch(r){case"h":return i.setHours(i.getHours()-s),i;case"d":return i.setDate(i.getDate()-s),i;case"w":return i.setDate(i.getDate()-s*7),i;case"mo":return i.setMonth(i.getMonth()-s),i;case"y":return i.setFullYear(i.getFullYear()-s),i;default:return null}},wE=e=>{let t=e.match(CE);if(!t)return null;let[,n,o,r,s,i]=t,c=Number(n),d=Number(o),p=Number(r),m=s?Number(s):0,f=i?Number(i):0;return NE({year:c,month:d,day:p,hour:m,minute:f})?new Date(c,d-1,p,m,f):null},ko=e=>{let t=e.trim().toLowerCase();return AE(t)??wE(t)};var ef=/^(\d+)(s|m)?$/,ca=e=>{let t=e.trim().toLowerCase().match(ef);if(!t)return null;let n=Number(t[1]);return!Number.isInteger(n)||n<=0?null:t[2]==="m"?n*6e4:n*1e3},da=(e,t)=>{let n=(t??"").trim().split(/\s+/).filter(Boolean),o=n.length>0&&ef.test(n.at(-1))?n.pop():"";return{dateInput:e||n.join(" "),durationInput:o}},tf=({date:e,horizonDate:t})=>t?e.getTime()>=t.getTime():!0,TE=[{unit:"h",from:1,to:24},{unit:"d",from:1,to:7},{unit:"w",from:1,to:52},{unit:"mo",from:1,to:12},{unit:"y",from:1,to:5}],Kc=(e=TE)=>{let t=[];for(let{unit:n,from:o,to:r}of e)for(let s=o;s<=r;s++)t.push(`${s}${n}`);return t};var ME=["BOARD","TICKET","SWIMLANE","COMMENT"],ye={EDITOR:"editor",VIEW:"view",USERNAME:"username",EMAILS:"emails",EMAILS_UNCLAIM:"emails-unclaim",AUTOSYNC:"autoSync",SYNC_DEBOUNCE_MS:"syncDebounceMs",ATTACHMENT_MAX_KB:"attachmentMaxKb",LOG_LEVEL:"logLevel"},Dt={TITLE:"title",DESCRIPTION:"description",COMMENT:"comment"},qe={REF:"ref",TITLE:"title",DESCRIPTION:"description",TAGS:"tags",ASSIGNEES:"assignees"},PE=[ye.EDITOR,ye.VIEW,ye.USERNAME,ye.EMAILS,ye.EMAILS_UNCLAIM,ye.AUTOSYNC,ye.SYNC_DEBOUNCE_MS,ye.ATTACHMENT_MAX_KB,ye.LOG_LEVEL],LE=(e=v().selectedNode?.context)=>{switch(e){case"TICKET":return[Dt.TITLE,Dt.DESCRIPTION];case"BOARD":case"SWIMLANE":return[Dt.TITLE];case"COMMENT":return[Dt.COMMENT];default:return[]}},Yc=[String(3e3),"5000","15000","30000","60000"],Xc=["250","500","1000"],rf=["10s","20s","30s","45s"],Do=[C.EXIT,C.SYNC,C.HELP,C.EXPORT,C.CONFIG,C.YANK],ua=[C.NEW,C.EDIT,C.DELETE,C.MOVE],qc=[C.TAG,C.UNTAG,C.ASSIGN,C.UNASSIGN,C.CLOSE_ISSUE,C.RE_OPEN_ISSUE,C.EDIT,C.COMMENT],nf=[C.FILTER,C.PEEK,C.REPLAY],kE={WORKSPACE:[...Do,...ua],BOARD:[...nf,...Do,...ua],SWIMLANE:[...nf,...Do,...ua],TICKET:[...Do,...ua,...qc],FIELD:[...Do,...qc],FIELD_LIST:[...Do,...qc],TEXT:[...Do],COMMENT:[C.EDIT,C.DELETE,C.YANK]},DE=e=>e==="WORKSPACE"?["board"]:["issue","swimlane","board"],As=({breadCrumb:e,selectedNode:t})=>[...e,t].find(n=>n!=null&&_(n)),of=e=>e.parentNodeId===he,BE=({selectedNode:e,breadCrumb:t})=>{let n=LE(e?.context);return As({breadCrumb:t,selectedNode:e})?n.includes(Dt.DESCRIPTION)?n:[...n,Dt.DESCRIPTION]:n},OE=({selectedNode:e,breadCrumb:t})=>{let n=As({breadCrumb:t,selectedNode:e});return n?[qe.REF,qe.TITLE,...n.props?.description?.trim()?[qe.DESCRIPTION]:[],...bn(n).length>0?[qe.TAGS]:[],...xn(n).length>0?[qe.ASSIGNEES]:[]]:e?[qe.REF,qe.TITLE]:[]},Jc=()=>{let e=$n({exclude:process.cwd()});return a(e)?[]:[...e.value.map((t,n)=>String(n+1)),...e.value.map(t=>t.root)]},FE=({selectedNode:e,readOnly:t,breadCrumb:n})=>{let{isSetupDone:o}=Un();if(!o)return[C.HELP,C.CONFIG];if(!zc())return[C.HELP,C.INIT,C.OPEN];if(t)return[C.HELP,C.PEEK,C.REPLAY,C.EXPORT,C.CONFIG,C.YANK];let r=e?.context,s=r&&ME.includes(r),i=[...new Set([...n,e].map(d=>d?.context).flatMap(d=>d?kE[d]:[]))],c=As({breadCrumb:n,selectedNode:e});return i.filter(d=>d===C.MOVE?!1:d===C.YANK?!!(c??e):d===C.EDIT?s||!!c:d===C.DELETE?s:d===C.UNTAG?!!(c&&bn(c).length>0):d===C.UNASSIGN?!!(c&&xn(c).length>0):d===C.RE_OPEN_ISSUE?!!(c&&of(c)):d===C.CLOSE_ISSUE?!!(c&&!of(c)):!0)},Be=(e,{contextNode:t,selectedNode:n,readOnly:o,breadCrumb:r}=v())=>{let s=t.context??"WORKSPACE";return{[C.NONE]:FE({breadCrumb:r,readOnly:o,selectedNode:n}),[C.EXIT]:["confirm"],[C.EXPORT]:[],[C.SYNC]:[],[C.INIT]:[],[C.OPEN]:e===C.OPEN?Jc():[],[C.HELP]:[],[C.PEEK]:[...Kc(),"now","prev","next"],[C.REPLAY]:[...Kc()],[C.EDIT]:BE({selectedNode:n,breadCrumb:r}),[C.YANK]:OE({selectedNode:n,breadCrumb:r}),[C.COMMENT]:[],[C.DELETE]:["confirm"],[C.RE_OPEN_ISSUE]:["confirm"],[C.CLOSE_ISSUE]:["confirm"],[C.MOVE]:["start","confirm","next","previous","jump-next","jump-previous","to-next","to-previous","cancel"],[C.FILTER]:["tag","assignee","actor","description","title","ref","clear"],[C.TAG]:[...new Set([...Object.keys(qi),...N.getExistingTags()])],[C.UNTAG]:[...aa()?.value?.map(({name:c})=>c)??[]],[C.UNASSIGN]:[...la()?.value?.map(({name:c})=>c)??[]],[C.ASSIGN]:N.getExistingAssignees(),[C.NEW]:DE(s),[C.CONFIG]:[...PE]}[e]??[]};import bf from"chalk";var sf=["vim","nvim","nano","micro","emacs","hx","code","code-insiders","subl","notepad","notepad++","idea","webstorm","default","system","$EDITOR","$VISUAL"];import HE from"zod";import _E from"node:crypto";import ws from"node:fs";import cf from"node:path";var af="/media/",lf=e=>`${af}${e}`,Qc=(e,t)=>`![${e}](${lf(t)})`;var In=500,jE=/^[a-f0-9]{64}\.(png|jpg|gif|webp)$/,Oo=(e,t)=>`${e}.${t}`,$E=e=>jE.test(e),df=e=>e.length>=8&&e.subarray(0,8).equals(Buffer.from([137,80,78,71,13,10,26,10]))?u("Sniffed image type","png"):e.length>=3&&e[0]===255&&e[1]===216&&e[2]===255?u("Sniffed image type","jpg"):e.length>=6&&(e.subarray(0,6).equals(Buffer.from("GIF87a","ascii"))||e.subarray(0,6).equals(Buffer.from("GIF89a","ascii")))?u("Sniffed image type","gif"):e.length>=12&&e.subarray(0,4).equals(Buffer.from("RIFF","ascii"))&&e.subarray(8,12).equals(Buffer.from("WEBP","ascii"))?u("Sniffed image type","webp"):l(`Unsupported image format. Allowed: ${Np.join(", ")}`),uf=e=>_E.createHash("sha256").update(e).digest("hex"),UE=(e,t=In)=>{if(e.length===0)return l("Attachment is empty");if(e.length>t*1024)return l(`Attachment exceeds the ${t} KB size cap (${Math.ceil(e.length/1024)} KB)`);let n=df(e);return a(n)?n:u("Validated attachment data",{hash:uf(e),ext:n.value,bytes:e.length})},mf=(e,t,n=In)=>{let o=UE(t,n);if(a(o))return o;let r=gs(e),s=cf.join(r,Oo(o.value.hash,o.value.ext));try{ws.existsSync(s)||(ws.mkdirSync(r,{recursive:!0}),ws.writeFileSync(s,t))}catch(i){return l(`Unable to write attachment blob: ${i instanceof Error?i.message:String(i)}`)}return u("Wrote attachment blob",o.value)},pf=(e,t,n=In)=>{if(!$E(t))return l("Invalid attachment file name");let o=cf.join(gs(e),t);if(!ws.existsSync(o))return l("Attachment blob not found");let r;try{r=ws.readFileSync(o)}catch(d){return l(`Unable to read attachment blob: ${d instanceof Error?d.message:String(d)}`)}if(r.length>n*1024)return l(`Attachment exceeds the ${n} KB size cap and will not be served`);let[s,i]=t.split(".");if(uf(r)!==s)return l("Attachment blob does not match its content hash");let c=df(r);return a(c)?c:c.value!==i?l("Attachment blob content does not match its extension"):u("Resolved attachment blob",{filePath:o,ext:i,bytes:r.length})};var Ts=50,Ms=5e3,ff=()=>{let e=se().commandMeta.inputString,t=HE.coerce.number().int().min(Ts).max(Ms).safeParse(e);if(!t.success)return l(`Attachment size cap must be ${Ts}-${Ms} KB (default ${In})`);let n=Ut({attachmentMaxKb:t.data});return a(n)?n:(je({attachmentMaxKb:t.data}),u(`Attachment size cap set to ${t.data} KB`,null))};var lt=(e,t,n)=>t.length>n?`${e} cannot exceed ${n} characters (got ${t.length})`:null;import{createHash as WE}from"node:crypto";var GE="0123456789ABCDEFGHJKMNPQRSTVWXYZ",VE=e=>{let t=WE("sha256").update(e).digest(),n=0n;for(let r=0;r<16;r++)n=n<<8n|BigInt(t[r]);let o="";for(let r=0;r<26;r++){let s=BigInt((25-r)*5);o+=GE[Number(n>>s&31n)]}return o},gf=new Map,Me=(e,t)=>{let n=`${e}:virtual:${t}`,o=gf.get(n);if(o!==void 0)return o;let r=VE(n);return gf.set(n,r),r};import hf from"chalk";var Se=e=>hf.dim(e),$e=e=>hf.hex(y.primary)(e),Ue=({prefix:e="",wordList:t,postfix:n="",noOfHints:o=100,inputString:r,minLengthForHints:s=1})=>{let i=r.trim();if(i.length<s)return"";let m=[...t.filter(Boolean).filter(f=>f.startsWith(i))].sort((f,g)=>Ji(f)-Ji(g)).slice(0,o).map(f=>Qi(f)).join(" ");return m?`${Se(e)}${m}${Se(n)}`:""};var En={None:"none",Invalid:"invalid",Valid:"valid"};var zE=["BOARD","TICKET","SWIMLANE"],yf=()=>{let e=v().selectedNode;if(!e?.context)return z({message:Se("Missing target context")});if(zE.includes(e.context))return ie();if(e.parentNodeId){let t=v().nodes[e.parentNodeId];if(t?.id===Me(t?.parentNodeId??"","comments"))return ie()}return z({message:Se("Command not available in this context")})},fe="<ENTER> to confirm",KE=()=>{let{userId:e}=V(),t=de();return!e||a(t)?[]:yn(t.value.emailLinks,e)},ie=(e="",t=[],n=!0)=>({message:n?Se(e):e,validity:En.Valid,completionWordList:t}),z=({message:e,completionWordList:t=[]})=>({validity:En.Invalid,message:e,completionWordList:t}),Nr=e=>e.length===0,vf=(e,t)=>{let n=yt(v().breadCrumb,"BOARD");if(a(n))return z({message:$e("Command is not applicable in this context")});let o=br(n.value.id);return a(o)?z({message:$e(`Unable to ${t}: board id is not a valid ULID`)}):tf({date:e,horizonDate:o.value})?null:z({message:$e(`nothing to ${t} before ${o.value.toISOString().slice(0,16).replace("T"," ")}`)})},ma=e=>` ${bf.hex("#000").bgHex(ze(e))(` ${e} `)} `,Zc=({modifier:e})=>{let t="confirm";return e===t?ie(fe):z({message:Nr(e)?Se("if you are certain, enter ")+Qi(t):"",completionWordList:[t]})},qE=({list:e,hint:t,onValue:n})=>({modifier:o,inputString:r})=>e.includes(o)?r.trim().length<1?z({message:Se(n)}):ie():z({message:Nr(o)?t:"",completionWordList:[...e]}),Cr=({hint:e,onOk:t})=>({modifier:n,inputString:o})=>Nr(n)&&Nr(o)?z({message:e,completionWordList:[]}):ie(t??fe),YE=({modifier:e,inputString:t})=>{let n=Jc();return!Nr(e)||!Nr(t)?ie(fe):z({message:n.length?Se("number from the list, or a path"):Se("path to an epiq project"),completionWordList:n})},XE=({modifier:e,inputString:t})=>{let n=Be(C.CONFIG);if(!n.includes(e))return z({message:Ue({prefix:"... ",wordList:n,inputString:e,minLengthForHints:0}),completionWordList:n});switch(e){case ye.EDITOR:{let o=[...sf];return t.trim()?o.includes(t.trim())?ie(fe):z({message:Ue({prefix:"editors: ",wordList:o,inputString:t,minLengthForHints:0}),completionWordList:o}):z({message:Ue({prefix:"editors: ",wordList:o,inputString:t,minLengthForHints:0}),completionWordList:o})}case ye.VIEW:{let o=["dense","wide"];return o.includes(t.trim())?ie(fe):z({message:Ue({prefix:"view... ",wordList:o,inputString:t,minLengthForHints:0}),completionWordList:o})}case ye.USERNAME:{let o=V().gitName,r=o?[o]:[],s=t.trim(),i=r.filter(p=>p.startsWith(s)),d=i.length===1&&i[0]===s?"":Ue({prefix:"name: ",wordList:r,inputString:s,minLengthForHints:0});return s?d?ie(`${d} ${Se(fe)}`,r,!1):ie(fe,r):z({message:d||$e("Enter a user name. Saved in ")+bf.bgBlack("~/.epiq-global/config.json"),completionWordList:r})}case ye.EMAILS:{let o=V().gitEmail,r=Rr(),s=r.length>0||!o?r:[o],i=[...s,"none"],c=t.trim(),d=(x,b)=>z({message:Ue({prefix:x,wordList:i,noOfHints:3,inputString:b,minLengthForHints:0}),completionWordList:i});if(!c)return ie(`${fe} to see your addresses, or name one`,i);let p=c.split(/[,\s]+/).filter(Boolean),m=p[p.length-1]??"",f=x=>x==="none"||s.includes(x.toLowerCase()),g=x=>i.some(b=>b.startsWith(x.toLowerCase())),h=p.filter(x=>!f(x)&&!g(x));return h.length>0?z({message:$e(`no address here matches ${h.join(", ")} \u2014 pick one from the list, or its number`),completionWordList:i}):f(m)?ie(fe):d("",m)}case ye.EMAILS_UNCLAIM:{let o=KE(),r=t.trim();return o.length===0?z({message:$e("you have not claimed any addresses"),completionWordList:[]}):r&&o.includes(r.toLowerCase())?ie(fe):z({message:Ue({prefix:"give an address back ",wordList:o,noOfHints:3,inputString:r,minLengthForHints:0}),completionWordList:o})}case ye.LOG_LEVEL:{let o=["debug","error","info"],r=t.trim();return o.includes(r)?ie(fe):z({message:Ue({prefix:"one of: ",wordList:[...o],inputString:r,postfix:" persisted in ~/.epiq-global/config.json",minLengthForHints:0}),completionWordList:[...o]})}case ye.AUTOSYNC:{let o=["on","off"],r=V().autoSync;if(!o.includes(t.trim())){let s=Jp(r);return z({message:Ue({prefix:`should auto-sync (recommended)${s!==null?", currently: "+s:""} `,wordList:o,noOfHints:3,inputString:t,minLengthForHints:0}),completionWordList:o})}return ie(fe)}case ye.ATTACHMENT_MAX_KB:{let o=V().attachmentMaxKb,r=Number.parseInt(t.trim(),10);if(!t.trim()||Number.isNaN(r)||r<Ts||r>Ms){let s=Ue({prefix:" examples: ",wordList:Xc,minLengthForHints:0,inputString:t});return z({message:$e(`provide a size cap in KB (${Ts}-${Ms}). current: ${o??In} KB.`)+s,completionWordList:Xc})}return ie(fe)}case ye.SYNC_DEBOUNCE_MS:{let o=V().autoSyncIntervalMs,r=ur(t);if(!t.trim()||r===null){let s=Ue({prefix:" examples: ",wordList:Yc,minLengthForHints:0,inputString:t});return z({message:$e(`provide a duration between ${3e3}ms and ${864e5}ms. current duration: ${o}ms.`)+s,completionWordList:Yc})}return ie(fe)}default:return z({message:$e("Unknown config option"),completionWordList:n})}},JE=({modifier:e,inputString:t})=>{let n=Be(C.EDIT);if(!n.length)return z({message:$e("Command not available in this context")});if(!n.includes(e)){let o=Ue({prefix:"edit... ",wordList:n,inputString:e,minLengthForHints:0});return z({message:o||$e("Unknown edit option"),completionWordList:n})}switch(e){case Dt.COMMENT:return t.trim()?ie(fe):z({message:Se("write a comment...")});case Dt.TITLE:return ie(fe);case Dt.DESCRIPTION:{let{preferredEditor:o}=V();return o?ie(Se("<ENTER> to edit in ")+o):z({message:"No editor selected"})}default:return z({message:$e("Unknown edit option"),completionWordList:n})}},QE=({modifier:e})=>{let t=Be(C.YANK);return t.length?t.includes(e)?ie(fe+Se(" and copy to clipboard")):z({message:Ue({prefix:"yank... ",wordList:t,inputString:e,minLengthForHints:0}),completionWordList:t}):z({message:$e("Nothing selected to copy from")})},ZE={[C.EXPORT]:()=>ie(fe+Se(", and create export markdown file")),[C.PEEK]:e=>{let t=e.modifier;if(t==="now"||t==="prev"||t==="next")return ie(fe);let n={message:Se("historical state from: '1h', '2d', '23h', '1mo', '2y', 'prev', 'next' or full date as YYYY-MM-DD")},o=t||e.inputString.trim(),r=ko(o);if(!o||!r)return z(n);let s=vf(r,"peek");return s||ie(fe)},[C.REPLAY]:e=>{let{dateInput:t,durationInput:n}=da(e.modifier,e.inputString),o={message:Se("replay forward from: '1h', '2d', '1mo', '2y' or full date as YYYY-MM-DD, with optional duration (e.g. '2y 30s')")},r=ko(t);if(!t||!r)return z(o);let s=vf(r,"replay");return s||(n&&ca(n)===null?z({message:$e("duration must be positive (e.g. 30s, 2m, or a number of seconds)")}):ie("<ENTER> to replay board history",n?rf:[]))},[C.EXIT]:()=>ie(fe+Se(" and exit the application")),[C.INIT]:()=>ie(fe),[C.OPEN]:YE,[C.PALETTE]:()=>ie(fe),[C.FILTER]:e=>{if(e.modifier==="clear")return ie(fe);let t=s=>Be(C.FILTER).includes(s);if(!e.modifier||!t(e.modifier))return z({message:Ue({wordList:Be(C.FILTER),inputString:e.inputString,minLengthForHints:0}),completionWordList:Be(C.FILTER)});let n=Object.values(v().tags).map(s=>s.name),o=Object.values(v().contributors).map(s=>s.name),r=e.modifier==="tag"?n:e.modifier==="assignee"?o:[];return e.inputString?r.length&&!r.includes(e.inputString.trim())?z({message:Ue({prefix:`existing ${e.modifier}s... `,wordList:r,noOfHints:10,inputString:e.inputString,minLengthForHints:0}),completionWordList:r}):ie():z({message:Ue({prefix:"one of... ",wordList:r,noOfHints:10,inputString:e.inputString,minLengthForHints:0}),completionWordList:r})},[C.NONE]:e=>{let t=Be(C.NONE);return z({message:Ue({prefix:"... ",wordList:t,inputString:e.inputString,minLengthForHints:0}),completionWordList:t})},[C.NEW]:e=>qE({list:Be(C.NEW),hint:Ue({wordList:Be(C.NEW),noOfHints:3,inputString:e.inputString,minLengthForHints:0}),onValue:"provide a name..."})(e),[C.HELP]:()=>ie(fe),[C.EDIT]:JE,[C.COMMENT]:e=>{let t=Cr({hint:Se(`write a comment (max ${4e3} char)...`),onOk:Se(`(${e.inputString.length}/${4e3})`)})(e);return t.validity===En.Invalid?t:e.inputString.length>4e3?ie($e("max input exceeded")):t},[C.CONFIG]:XE,[C.YANK]:QE,[C.DELETE]:e=>{let t=yf();return t.validity==="invalid"?t:Zc(e)},[C.CLOSE_ISSUE]:e=>Zc(e),[C.RE_OPEN_ISSUE]:e=>Zc(e),[C.MOVE]:e=>{let t=yf();return t.validity==="invalid"?t:Cr({hint:Ue({prefix:"hey hacker! These commands are blocked for you... ",wordList:Be(C.MOVE),noOfHints:10,inputString:e.inputString})})(e)},[C.TAG]:e=>{let n=N.getExistingTags().slice(0,10).map(ma).join("");return Cr({hint:n.length?Se("create tag or reuse:")+n+Se(""):Se("create tag ...")})(e)},[C.UNTAG]:e=>{let t=aa();if(a(t))return z({message:$e("Invalid untag target"),completionWordList:[]});let n=t.value.map(({name:o})=>o).map(ma).slice(0,10);return n.length?Cr({hint:Se(" ... ")+n.join("")})(e):z({message:$e("Issue has no tags"),completionWordList:[]})},[C.ASSIGN]:e=>{let t=N.getExistingAssignees().map(ma).slice(0,10);return Cr({hint:Se("assignees... ")+t.join("")})(e)},[C.UNASSIGN]:e=>{let t=la();if(a(t))return z({message:$e("Invalid unassign target"),completionWordList:[]});let n=t.value.map(({name:o})=>o).map(ma).slice(0,10);return n.length?Cr({hint:Se("remove assignee... ")+n.join("")})(e):z({message:$e("Issue has no assignees"),completionWordList:[]})},[C.SYNC]:()=>ie(fe)},xf=Object.fromEntries(Object.entries(ZE).map(([e,t])=>[e,{validate:(n,o,r)=>t({modifier:o,command:n,inputString:r})}]));var pa=["add","fix","bug","log","run","api","cli","ui","ux","test","mock","stub","sync","hash","sign","fork","push","pull","lock","warn","leak","hang","node","seed","lint","edit","save","load","read","send","drop","swap","wrap","port","host","role","user","auth","flag","diff","perf","docs","todo","task","team","epic","spec","remove","update","change","improve","enhance","refactor","rewrite","redesign","implement","build","create","delete","rename","migrate","upgrade","downgrade","revert","rollback","restore","replace","deprecate","cleanup","simplify","optimize","stabilize","harden","document","clarify","investigate","debug","reproduce","triage","mitigate","remediate","resolve","escalate","verify","validate","benchmark","profile","audit","monitor","instrument","configure","provision","deploy","release","publish","integrate","automate","support","enable","disable","prevent","handle","ensure","prioritize","estimate","schedule","track","install","uninstall","enforce","expose","extract","inject","override","extend","customize","localize","translate","redirect","forward","dispatch","broadcast","subscribe","unsubscribe","register","allocate","reserve","persist","retrieve","archive","expire","refresh","reload","reset","recover","replay","retry","scaffold","bootstrap","finalize","terminate","suspend","resume","cancel","abort","notify","alert","trigger","debounce","frontend","backend","fullstack","infrastructure","architecture","integration","application","environment","framework","platform","service","component","module","gateway","pipeline","container","orchestrator","middleware","endpoint","interface","database","datastore","cache","queue","scheduler","worker","daemon","runtime","library","package","plugin","extension","webhook","microservice","monolith","repository","namespace","cluster","sandbox","tenant","dashboard","console","portal","client","server","browser","mobile","desktop","kernel","driver","protocol","schema","migration","fixture","template","snippet","config","manifest","bundle","exception","incident","defect","regression","degradation","malfunction","instability","intermittent","workaround","failure","outage","crash","freeze","corruption","inconsistency","severity","criticality","diagnostics","analysis","blocker","flaky","timeout","mismatch","misconfiguration","boundary","overflow","underflow","panic","stacktrace","breakage","breaking","oversight","ambiguity","discrepancy","anomaly","authorize","authenticate","confidentiality","availability","accessibility","reliability","compliance","governance","encrypt","decrypt","integrity","traceability","accountability","protection","privileges","permissions","sanitize","escape","vulnerability","exposure","secrets","credentials","certificate","session","cookie","identity","tokenization","rotation","scanning","hardening","threat","exploit","payload","injection","phishing","breach","dependency","orchestrate","synchronize","compatibility","incompatibility","interoperability","observability","telemetry","discovery","registration","coordination","distribution","isolation","virtualization","networking","routing","proxy","firewall","balancer","failover","topology","replica","shard","region","capacity","quota","metrics","logging","tracing","alerting","monitoring","heartbeat","liveness","rollover","serialize","deserialize","initialize","instantiate","propagate","aggregate","consolidate","normalize","standardize","transform","reconcile","correlate","index","partition","enrich","filter","stream","batch","parse","encode","decode","compress","decompress","deduplicate","paginate","query","ingest","export","import","backup","snapshot","mapping","record","dataset","metadata","checksum","rollup","lookup","cursor","truncate","concurrency","parallelism","contention","deadlock","throttle","backpressure","fragmentation","saturation","exhaustion","replicate","redundancy","obsolescence","starvation","overload","latency","throughput","scalability","bottleneck","memoize","prefetch","warmup","autoscale","horizontal","vertical","elasticity","recursion","allocation","leakage","garbage","collection","pooling","buffering","caching","eviction","staleness","modularize","encapsulate","abstraction","extensibility","configurability","maintainability","recoverability","readability","testability","debuggability","reusability","simplicity","consistency","linting","formatting","typecheck","coverage","tooling","scaffolding","boilerplate","technical","cleanliness","naming","comments","docstring","testing","unittest","mocking","stubbing","assertion","smoke","sanity","fuzzing","flakiness","harness","scenario","baseline","performance","functionality","requirement","recommendation","improvement","enhancement","description","acceptance","criteria","deliverable","milestone","iteration","backlog","roadmap","followup","hotfix","patch","changelog","rollout","feature","spike","proposal","specification","priority","sprint","story","subtask","assignee","reviewer","reproduction","context","expected","actual","impact","workflow","version","tracking","discussion","decision","tradeoff","feedback","approval","planning","breakdown","scoping"];var eS=3,tS=new Set(["the","and","for","are","but","not","you","all","any","can","was","one","our","out","use","this","that","with","have","from","will","your","they","them","then","than","when","what","were","been","into","should","would","could","about"]),nS=e=>{let t=[];for(let n of Object.values(e.nodes)){n.title&&t.push(n.title);let o=n.props;typeof o.description=="string"&&t.push(o.description),typeof o.value=="string"&&t.push(o.value)}for(let n of Object.values(e.tags))t.push(n.name);for(let n of Object.values(e.contributors))t.push(n.name);for(let n of Object.values(e.comments))t.push(n.md);return t},oS=e=>e.toLowerCase().split(/[^a-z0-9]+/).filter(t=>t.length>=eS&&!tS.has(t)&&!/^\d+$/.test(t)),rS=e=>{let t=new Map;for(let s of nS(e))for(let i of oS(s))t.set(i,(t.get(i)??0)+1);let n=[...t.entries()].sort((s,i)=>i[1]-s[1]||s[0].localeCompare(i[0])).map(([s])=>s),o=new Set(n),r=pa.filter(s=>!o.has(s));return[...n,...r]},If=pa,Ef=-1,Sf=()=>{let e=de();if(a(e))return pa;let t=e.value,n=t.eventLog.length;return n!==Ef&&(If=rS(t),Ef=n),If};var Rf=e=>Object.values(C).includes(e),Cf=(e,t)=>{let n=e.command??"",{modifier:o,target:r,inputString:s}=e,{message:i,validity:c,completionWordList:d}=xf[n].validate(n,o,s),p=n!==C.PEEK&&n!==C.REPLAY,m=r==="command"||r==="modifier"?Be(n):p?Sf():[],{mode:f}=v(),g=f===I.COMMAND_LINE?i??"":"",h=[...d,...m];return{validity:c,command:e.command,modifier:e.modifier,inputString:e.inputString,infoMessage:g,autoCompletion:t?$p(e,h,d):{hint:"",hints:[],remainder:"",overlap:0}}};var Nf=e=>{let t=e.trimStart(),n=iS(t),o=n[0]??"",r=n[1]??"",s=/\s$/.test(e),i=aS(e),c=Rf(o)?o:null,d=c!==null,p=o!=="",m=c?Be(c)??[]:[],f=c&&m.includes(r)?r:"",g="word";n.length===0||n.length===1&&!s?g="command":(n.length===1&&s||n.length===2&&!s)&&(g="modifier");let h=s?"":i,x=sS(t,c,f);return{raw:e,trimmedStart:t,words:n,firstWord:o,lastWord:i,hasCommand:p,command:c,isCommandKeyword:d,isLastWordCompleted:s,modifier:f,target:g,inputToMatch:h,inputString:x}},sS=(e,t,n)=>{let o=e;return t&&o.startsWith(t)&&(o=o.slice(t.length)),o=o.replace(/^\s+/,""),n&&o.startsWith(n)&&(o=o.slice(n.length),o=o.replace(/^\s+/,"")),o},iS=e=>e.trim()?e.trim().split(/\s+/):[],aS=e=>e.trimEnd().split(/\s+/).at(-1)??"";import{useSyncExternalStore as lS}from"react";var Ar=e=>e===ed||e===":",ed=" ",Ls=40,ct={commandHistory:[],value:"",commandHistoryIndex:-1,cursorPosition:0,commandIsPending:!1,commandMeta:{command:null,modifier:"",infoMessage:"",inputString:"",validity:En.None,autoCompletion:{hint:"",hints:[],remainder:"",overlap:0}}},td=new Set,Af=()=>{for(let e of td)e()},nd=e=>(td.add(e),()=>td.delete(e)),Wt=e=>{let n=e(ct),o=Nf(n.value),r=n.cursorPosition===n.value.length;ct={...n,commandMeta:Cf(o,r)},Af()},ks=({message:e,status:t})=>{let n=structuredClone(ct);return n.commandMeta={...n.commandMeta,infoMessage:e??"",validity:t==="fail"?"invalid":"valid"},n.commandIsPending=!0,ct=n,Af(),u(e,null)},od=e=>{Wt(t=>({...t,cursorPosition:Math.max(0,Math.min(t.value.length,t.cursorPosition+e))}))},rd=e=>{Wt(t=>{let{value:n,cursorPosition:o}=t,r=o;if(e==="left"){for(;r>0&&Ar(n[r-1]);)r--;for(;r>0&&!Ar(n[r-1]);)r--}else{for(;r<n.length&&!Ar(n[r]);)r++;for(;r<n.length&&Ar(n[r]);)r++}return{...t,cursorPosition:r}})},wf=()=>{Wt(e=>{let t=e.value.slice(e.cursorPosition),n=Math.max(0,e.cursorPosition-1);return{...e,value:e.value.slice(0,n)+t,cursorPosition:n,commandIsPending:!1}})},Tf=()=>{Wt(e=>{let{value:t,cursorPosition:n}=e,o=n;for(;o>0&&Ar(t[o-1]);)o--;for(;o>0&&!Ar(t[o-1]);)o--;let r=t.slice(n);return{...e,value:t.slice(0,o)+r,cursorPosition:o,commandIsPending:!1}})},fa=e=>{Wt(t=>{let n=Math.max(0,Math.min(t.cursorPosition,t.value.length)),o=t.value.slice(0,n),r=t.value.slice(n),s=e(o,t.commandMeta.autoCompletion),i=s+r,c=Math.max(0,Math.min(s.length,i.length));return{...t,value:i,cursorPosition:c,commandIsPending:!1}})},Mf=()=>{Wt(e=>({...e,commandIsPending:!0}))},J=e=>{Wt(t=>({...t,value:e,cursorPosition:e.length,commandIsPending:!1}))},Pf=({addToHistory:e=!0,line:t})=>{Wt(n=>{let o=t??n.value;return{...n,commandHistory:e&&o.trim()?[o,...n.commandHistory].slice(0,Ls):n.commandHistory,commandHistoryIndex:-1,commandIsPending:!1,value:"",cursorPosition:0}})},Lf=e=>{Wt(t=>({...t,commandHistory:e.slice(0,Ls),commandHistoryIndex:-1}))},kf=()=>{Wt(e=>e.commandHistoryIndex===-1?e:{...e,commandHistoryIndex:-1})},Df=()=>{Wt(e=>{let t=Math.min(e.commandHistoryIndex+1,e.commandHistory.length-1),n=e.commandHistory[t]??"";return{...e,commandHistoryIndex:t,value:n,cursorPosition:n.length}})},Bf=()=>{Wt(e=>{let t=Math.max(e.commandHistoryIndex-1,-1),n=t===-1?"":e.commandHistory[t]??"";return{...e,commandHistoryIndex:t,value:n,cursorPosition:n.length}})},se=()=>ct,Of=()=>lS(nd,se,se),ga=()=>{let[e,...t]=ct.value.split(ed);return t.join(ed).trim()};var E={NavPreviousItem:"navPreviousItem",NavNextItem:"navNextItem",NavPreviousItemJump:"navPreviousItemJump",NavNextItemJump:"navNextItemJump",NavToPreviousContainer:"navToPreviousContainer",NavToNextContainer:"navToNextContainer",MovePreviousItem:"movePreviousItem",MoveNextItem:"moveNextItem",MovePreviousItemJump:"movePreviousItemJump",MoveNextItemJump:"moveNextItemJump",MoveToPreviousContainer:"moveToPreviousContainer",MoveToNextContainer:"moveToNextContainer",Confirm:"confirm",Exit:"exit",ViewHelp:"viewHelp",HideHelp:"hideHelp",InitMove:"initMove",ConfirmMove:"confirmMove",Delete:"Delete",InitCommandPalette:"initCommandPalette",InitCommandLine:"initCommandLine",ExitCommandLine:"exitCommandLine",CaptureInput:"captureInput",EraseInput:"eraseInput",AddItem:"addItem",GetLastCommandFromHistory:"getLastCommandFromHistory",GetNextCommandFromHistory:"getNextCommandFromHistory",AutoCompleteCommand:"autoCompleteCommand",MoveCursorLeft:"MoveCursorLeft",MoveCursorRight:"MoveCursorRight",MoveCursorLeftOfWord:"MoveCursorLeftOfWord",MoveCursorRightOfWord:"MoveCursorRightOfWord",EraseInputWord:"EraseInputWord",None:"None",Edit:"edit",EditTitle:"editTitle",EditDescription:"editDescription",Yank:"yank",OpenInEditor:"openInEditor",MarkDiffLine:"markDiffLine",CommentOnDiffLine:"commentOnDiffLine",SetViewDense:"SetViewDense",SetViewWide:"SetViewWide"},cS=e=>e.shift===!0,dS={[E.NavPreviousItem]:E.NavPreviousItemJump,[E.NavNextItem]:E.NavNextItemJump,[E.MovePreviousItem]:E.MovePreviousItemJump,[E.MoveNextItem]:E.MoveNextItemJump};function uS(e){switch(e.name){case"up":case"down":case"left":case"right":return e.name;default:return null}}function mS(e){switch(e.name){case"k":return"up";case"j":return"down";case"h":return"left";case"l":return"right";default:return null}}function pS(e,t,n){let o=v().contextNode.childNavigationAcrossParents;switch(t){case"up":return e==="vertical"?n.prevItem:o?n.prevContainer:null;case"down":return e==="vertical"?n.nextItem:o?n.nextContainer:null;case"left":return e==="horizontal"?n.prevItem:o?n.prevContainer:null;case"right":return e==="horizontal"?n.nextItem:o?n.nextContainer:null}}function Ff(e,t){let n=se();if(e.sequence==="?"&&t!==I.PALETTE)return E.InitCommandPalette;if(e.sequence===":"&&t!==I.COMMAND_LINE)return E.InitCommandLine;if(t===I.MOVE)switch(e.name){case"m":case"return":return E.ConfirmMove}if(t===I.COMMAND_LINE)return Pp(e,n.value);if(t===I.PALETTE)return Lp(e,n.value);let o=uS(e)||mS(e);if(o)return fS(o,t,cS(e));if(e.ctrl&&e.name==="c")return E.Exit;switch(e.name){case"r":return E.EditTitle;case"e":return E.EditDescription;case"n":return E.AddItem;case"m":return E.InitMove;case"d":return E.Delete;case"y":return E.Yank;case"o":return E.OpenInEditor;case"s":return E.MarkDiffLine;case"c":return E.CommentOnDiffLine;case"return":return E.Confirm;case"space":return E.Confirm;case"v":return V().viewMode==="wide"?E.SetViewDense:E.SetViewWide;case"q":case"escape":return E.Exit;default:return null}}function fS(e,t,n=!1){let o=t===I.MOVE?{prevItem:E.MovePreviousItem,nextItem:E.MoveNextItem,prevContainer:E.MoveToPreviousContainer,nextContainer:E.MoveToNextContainer}:{prevItem:E.NavPreviousItem,nextItem:E.NavNextItem,prevContainer:E.NavToPreviousContainer,nextContainer:E.NavToNextContainer},r=pS(v().contextNode.childRenderAxis,e,o);return!r||!n?r:dS[r]??r}import{ulid as yS}from"ulid";var Ds=24n,gS=Ds*4n,tn=(1n<<gS)-1n,hS=/^[0-9a-f]+$/;function _f(e){return!e||!hS.test(e)?l(`Invalid hex rank: ${e}`):u("Converted rank to bigint",BigInt("0x"+e))}function Bt(e,t=Ds){if(e<0n)return l("Negative rank not allowed");let n=e.toString(16);return u("Converted bigint to hex rank",n.padStart(Number(t),"0"))}function vt(e,t){if(!e&&!t)return Bt(tn/2n,Ds);let n=e?_f(e):u("Resolved lower bound",0n);if(a(n))return n;let o=t?_f(t):u("Resolved upper bound",tn);if(a(o))return o;let r=n.value,s=o.value;if(s<=r)return l("Neighbouring ranks leave no space between them");let i=(r+s)/2n;return i===r||i===s?l("No rank space available between neighbors"):Bt(i,Ds)}function jf(e){if(e<=0)return u("Resolved empty rank list",[]);let t=BigInt(e),n=[];for(let o=0;o<e;o++){let r=tn*BigInt(o+1)/(t+1n),s=Bt(r,Ds);if(a(s))return s;n.push(s.value)}return u("Resolved evenly spaced ranks",n)}var D=({userId:e})=>({userId:e}),$f=e=>({action:e.action,payload:e.payload});var sd=["init.workspace","add.workspace","add.board","add.swimlane","add.issue","add.field","edit.title","delete.node","create.tag","tombstone.tag","restore.tag","create.contributor","rename.contributor","tombstone.contributor","restore.contributor","add.issue.assignee","remove.issue.assignee","add.issue.tag","remove.issue.tag","move.node","edit.description","add.issue.comment","edit.issue.comment","delete.issue.comment","add.issue.attachment","delete.issue.attachment","close.issue","reopen.issue","lock.node","rebalance.children","link.contributor.user","link.contributor.email","unlink.contributor.email"];var dB=new Set(sd);var id=(e,t)=>{let n=be(e),o=jf(n.length);if(a(o))return o;let r={};for(let s=0;s<n.length;s++){let i=n[s],c=o.value[s];if(!i||!c)return l("Unable to assign rebalance rank");r[i.id]=c}return u("Created rebalance event",{id:yS(),action:"rebalance.children",payload:{parent:e,ranks:r},...D(t)})};import{z as Fo}from"zod";var Uf=1,Hf=Fo.tuple([Fo.string().min(1),Fo.string().min(1).nullable()]),vS=Fo.looseObject({v:Fo.literal(Uf),id:Hf}),RB=Fo.looseObject({v:Fo.number().int().positive(),id:Hf}),bS=e=>Object.prototype.hasOwnProperty.call(e,"__proto__"),xS=e=>{let t={};for(let n of Object.keys(e))n!=="__proto__"&&(t[n]=e[n]);return t},Wf=e=>{if(typeof e!="object"||e===null||Array.isArray(e))return l("Invalid persisted event envelope: expected an object");let{v:t,id:n}=e;if(typeof t!="number"||!Number.isSafeInteger(t)||t<=0)return l("Invalid persisted event envelope: v");if(!Array.isArray(n)||n.length!==2)return l("Invalid persisted event envelope: id");let[o,r]=n;return typeof o!="string"||o.length===0?l("Invalid persisted event envelope: id.0"):r!==null&&(typeof r!="string"||r.length===0)?l("Invalid persisted event envelope: id.1"):u("Parsed persisted event envelope",bS(e)?xS(e):e)};var IS=[1];var ES=new Set(IS),ad=e=>ES.has(e),Gf=e=>{let t=vS.safeParse(e);return t.success?u("Parsed persisted event",t.data):l(`Invalid persisted event: ${t.error.issues.map(n=>n.path.join(".")||n.message).join(", ")}`)},ld=(e,t)=>{let n={[e.action]:e.payload,v:Uf,id:t};return Gf(n)};import _s from"node:fs";import Ea from"node:path";import{decodeTime as PS}from"ulid";import{z as gd}from"zod";import cd from"node:fs";import SS from"node:path";var Bs=e=>e?.code==="ENOENT",dd=3,ud=e=>cd.readdirSync(e).filter(t=>t.endsWith(".jsonl")).sort(),et=e=>{let t=St(e);for(let n=1;;n++){if(!cd.existsSync(t))return"none";let o=[],r=!1;for(let s of ud(t))try{let{size:i,mtimeMs:c}=cd.statSync(SS.join(t,s));o.push(`${s}:${i}:${c}`)}catch(i){if(!Bs(i))throw i;if(n<dd){r=!0;break}}if(!r)return o.join("|")}},Vf=e=>new Map(e.split("|").filter(Boolean).map(t=>{let n=t.indexOf(":");return[t.slice(0,n),t.slice(n+1)]})),md=(e,t,n)=>{let o=Vf(t),r=et(e),s=Vf(r);for(let[i,c]of s)if(i!==n&&o.get(i)!==c)return null;for(let i of o.keys())if(i!==n&&!s.has(i))return null;return r},so=null,ha=e=>so&&so.root===e?so.signature:null,wr=(e,t)=>{so={root:e,signature:t}},zf=(e,t)=>{if(!so||so.root!==e)return;let n=md(e,so.signature,t);so=n===null?null:{root:e,signature:n}};import He from"node:fs";import _o from"node:path";import{ulid as RS}from"ulid";var va="~pending",pd=/~pending(-[0-9a-z]+)*$/i,qf=/-f(\d+)$/,Yf=e=>{let t=e.indexOf(".");return t===-1?`${e}${va}`:e.slice(0,t)+va+e.slice(t)},ba=e=>{let t=e.indexOf(".");return t===-1?[e,""]:[e.slice(0,t),e.slice(t)]},CS=e=>{let[t,n]=ba(e);return pd.test(t)?t.replace(pd,"")+n:null},fd=e=>e.replace(pd,""),jo=e=>e.endsWith(".jsonl")&&CS(e)!==null,Os=e=>fd(ba(e)[0]),Xf=e=>{let[t]=ba(e),n=qf.exec(t);return n&&jo(e)?Number(n[1]):null},NS=e=>Yf(e).replace(va,`${va}-${RS().toLowerCase()}`),AS=(e,t)=>{let[n,o]=ba(e);return`${n.replace(qf,"")}-f${t}${o}`},Jf=(e,t)=>_o.join(St(e),Yf(t)),wS=(e,t)=>Math.max(0,He.statSync(e).size-(Xf(t)??0)),Qf=e=>{let t=St(e);try{return He.existsSync(t)?He.readdirSync(t).filter(jo).some(n=>wS(_o.join(t,n),n)>0):!1}catch{return!0}},TS=3,Zf=(e,t)=>{for(let n=1;;n++){let o=He.openSync(e,"a"),r;try{He.writeSync(o,t),r=He.fstatSync(o).ino}finally{He.closeSync(o)}let s;try{s=He.statSync(e).ino}catch{s=null}if(s===r||n>=TS)return}},MS=e=>{let t;try{t=He.openSync(e,"r")}catch{return!0}try{let{size:n}=He.fstatSync(t);if(n===0)return!0;let o=Buffer.alloc(1);return He.readSync(t,o,0,1,n-1),o[0]===10}finally{He.closeSync(t)}},ya=10,Kf=(e,t,n=!1)=>{let o=n?t.length:t.lastIndexOf(ya)+1;if(o===0)return{bytes:0,lines:0};let r=t.subarray(0,o);if(r.toString("utf8").trim().length===0)return{bytes:o,lines:0};He.appendFileSync(e,Buffer.concat([Buffer.from(MS(e)?"":`
31
31
  `),r,Buffer.from(r[r.length-1]===ya?"":`
package/dist/mcp.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- var gI=Object.defineProperty;var g=(e,t)=>()=>(e&&(t=e(e=0)),t);var ss=(e,t)=>{for(var n in t)gI(e,n,{get:t[n],enumerable:!0})};var bm={};ss(bm,{failed:()=>a,isFail:()=>l,isSuccess:()=>_t,resultStatuses:()=>Tn,succeeded:()=>d});var Tn,a,d,l,_t,N=g(()=>{"use strict";Tn={Success:"success",Fail:"fail"},a=e=>({status:Tn.Fail,message:e,value:null}),d=(e,t)=>({status:Tn.Success,message:e,value:t}),l=e=>e.status==="fail",_t=e=>e.status==="success"});var Em={};ss(Em,{ACTOR_ID_ENV:()=>is,ACTOR_NAME_ENV:()=>Ft,applyActorNameArgument:()=>Ml,deriveActorId:()=>Im,isValidUserId:()=>Ai,isValidUserName:()=>as,resolveEnvActor:()=>Tl});import hI from"node:crypto";var Ft,is,xm,vI,wl,Ai,as,ro,Im,Tl,Ml,xr=g(()=>{"use strict";N();Ft="EPIQ_USER_NAME",is="EPIQ_USER_ID",xm="0123456789ABCDEFGHJKMNPQRSTVWXYZ",vI=26,wl=80,Ai=e=>/^[0-9A-HJKMNP-TV-Z]{26}$/.test(e),as=e=>e.trim().length>0&&e.length<=wl,ro=e=>e.trim().toLowerCase(),Im=e=>{let t=hI.createHash("sha256").update(`epiq:actor:${ro(e)}`).digest(),n="";for(let r=0;r<vI;r++)n+=xm[(t[r]??0)%xm.length];return n},Tl=(e,t=process.env)=>{let n=(t[Ft]??"").trim(),r=(t[is]??"").trim();return n?as(n)?!r&&e.userId&&e.userName&&ro(e.userName)===ro(n)?d("Actor override names the configured user",{userId:e.userId,userName:e.userName}):r&&!Ai(r)?a(`${is} must be 26 characters of Crockford base32`):r&&e.userId&&r===e.userId?a(`${is} is the configured user's own id; using it under a different name would rename them on the board`):d("Resolved actor from environment",{userId:r||Im(n),userName:r?n:ro(n)}):a(`${Ft} must be 1-${wl} characters of text`):r?a(`${is} is set without ${Ft}`):d("No actor override",null)},Ml=(e,t,n=process.env)=>{let r=e.trim();if(!as(r))return a(`${t} must be 1-${wl} characters of text`);let o=(n[Ft]??"").trim();return o&&ro(o)!==ro(r)?a(`${t} names ${r}, but ${Ft} names ${o}`):(o||(n[Ft]=r),d("Applied actor name argument",o||r))}});var kl,Sm=g(()=>{"use strict";kl="1.12.3"});var Rm={};ss(Rm,{parseMcpArgs:()=>bI});var yI,bI,Nm=g(()=>{"use strict";Sm();yI=`epiq-mcp ${kl}
2
+ var gI=Object.defineProperty;var g=(e,t)=>()=>(e&&(t=e(e=0)),t);var ss=(e,t)=>{for(var n in t)gI(e,n,{get:t[n],enumerable:!0})};var bm={};ss(bm,{failed:()=>a,isFail:()=>l,isSuccess:()=>_t,resultStatuses:()=>Tn,succeeded:()=>d});var Tn,a,d,l,_t,N=g(()=>{"use strict";Tn={Success:"success",Fail:"fail"},a=e=>({status:Tn.Fail,message:e,value:null}),d=(e,t)=>({status:Tn.Success,message:e,value:t}),l=e=>e.status==="fail",_t=e=>e.status==="success"});var Em={};ss(Em,{ACTOR_ID_ENV:()=>is,ACTOR_NAME_ENV:()=>Ft,applyActorNameArgument:()=>Ml,deriveActorId:()=>Im,isValidUserId:()=>Ai,isValidUserName:()=>as,resolveEnvActor:()=>Tl});import hI from"node:crypto";var Ft,is,xm,vI,wl,Ai,as,ro,Im,Tl,Ml,xr=g(()=>{"use strict";N();Ft="EPIQ_USER_NAME",is="EPIQ_USER_ID",xm="0123456789ABCDEFGHJKMNPQRSTVWXYZ",vI=26,wl=80,Ai=e=>/^[0-9A-HJKMNP-TV-Z]{26}$/.test(e),as=e=>e.trim().length>0&&e.length<=wl,ro=e=>e.trim().toLowerCase(),Im=e=>{let t=hI.createHash("sha256").update(`epiq:actor:${ro(e)}`).digest(),n="";for(let r=0;r<vI;r++)n+=xm[(t[r]??0)%xm.length];return n},Tl=(e,t=process.env)=>{let n=(t[Ft]??"").trim(),r=(t[is]??"").trim();return n?as(n)?!r&&e.userId&&e.userName&&ro(e.userName)===ro(n)?d("Actor override names the configured user",{userId:e.userId,userName:e.userName}):r&&!Ai(r)?a(`${is} must be 26 characters of Crockford base32`):r&&e.userId&&r===e.userId?a(`${is} is the configured user's own id; using it under a different name would rename them on the board`):d("Resolved actor from environment",{userId:r||Im(n),userName:r?n:ro(n)}):a(`${Ft} must be 1-${wl} characters of text`):r?a(`${is} is set without ${Ft}`):d("No actor override",null)},Ml=(e,t,n=process.env)=>{let r=e.trim();if(!as(r))return a(`${t} must be 1-${wl} characters of text`);let o=(n[Ft]??"").trim();return o&&ro(o)!==ro(r)?a(`${t} names ${r}, but ${Ft} names ${o}`):(o||(n[Ft]=r),d("Applied actor name argument",o||r))}});var kl,Sm=g(()=>{"use strict";kl="1.12.4"});var Rm={};ss(Rm,{parseMcpArgs:()=>bI});var yI,bI,Nm=g(()=>{"use strict";Sm();yI=`epiq-mcp ${kl}
3
3
 
4
4
  Usage: epiq-mcp [name]
5
5
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "epiq",
3
- "version": "1.12.3",
3
+ "version": "1.12.4",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "description": "EPIQ - ergonomic, distributed CLI-first issue tracker TUI ready for the agentic era",
@@ -69,7 +69,7 @@
69
69
  "dist"
70
70
  ],
71
71
  "dependencies": {
72
- "@modelcontextprotocol/sdk": "^1.29.0",
72
+ "@modelcontextprotocol/sdk": "^1.32.1",
73
73
  "@pierre/diffs": "^1.3.6",
74
74
  "@xterm/headless": "^6.0.0",
75
75
  "ink": "^6.8.0",
@@ -77,7 +77,7 @@
77
77
  "react": "^19.2.4",
78
78
  "react-dom": "^19.2.6",
79
79
  "react-markdown": "^10.1.0",
80
- "react-router-dom": "^7.17.0",
80
+ "react-router-dom": "^7.18.4",
81
81
  "remark-breaks": "^4.0.0",
82
82
  "remark-gfm": "^4.0.1",
83
83
  "string-width": "^8.2.0",
@@ -97,9 +97,9 @@
97
97
  "@typescript-eslint/eslint-plugin": "^8.46.0",
98
98
  "@typescript-eslint/parser": "^8.46.0",
99
99
  "@vdemedes/prettier-config": "^2.0.1",
100
- "@vitest/coverage-v8": "4.1.2",
100
+ "@vitest/coverage-v8": "4.1.11",
101
101
  "chalk": "^5.2.0",
102
- "esbuild": "^0.25.0",
102
+ "esbuild": "^0.28.2",
103
103
  "eslint": "^9.39.1",
104
104
  "eslint-plugin-react": "^7.37.5",
105
105
  "eslint-plugin-react-hooks": "^7.0.1",
@@ -110,7 +110,7 @@
110
110
  "tsx": "^4.20.3",
111
111
  "typescript": "^5.0.3",
112
112
  "typescript-eslint": "^8.46.0",
113
- "vitest": "4.1.2"
113
+ "vitest": "4.1.11"
114
114
  },
115
115
  "prettier": "@vdemedes/prettier-config"
116
116
  }