import{n as e,s as t}from"./rolldown-runtime-Czos8NxU.js";import{Bt as n,El as r,qo as i,vl as a}from"./app-initial~app-main~worktree-init-v2-page~appgen-settings-page~page~appgen-publication-ter~fzo5ij6p-BKVLyD1q.js";import{Bo as o,Dw as s,Ew as c,Hs as l,Us as u,zo as d}from"./app-initial~app-main~onboarding-page-CNHnOMz8.js";import{Sx as f,nx as p,rx as m,yx as h}from"./app-initial~app-main~new-thread-panel-page-BZHGOlMi.js";import{va as g,ya as _}from"./app-initial~app-main~remote-conversation-page~new-thread-panel-page~onboarding-page~appgen-~o4yhvtva-CRxLUCiX.js";function v({className:e=`icon-sm shrink-0`,checks:t}){let n=y(t),r=p(`text-token-description-foreground`,e);if(n.length===0)return(0,b.jsx)(l,{className:r});let i=n.length>1?C:0,a=0;return(0,b.jsx)(`svg`,{"aria-hidden":!0,className:r,fill:`none`,viewBox:`0 0 18 18`,children:(0,b.jsx)(`g`,{transform:`rotate(-90 9 9)`,children:n.map(e=>{let t=S*e.ratio,n=`${Math.max(t-i,.001)} ${S}`,r=-(a+i/2);return a+=t,(0,b.jsx)(`circle`,{cx:`9`,cy:`9`,r:x,stroke:e.color,strokeDasharray:n,strokeDashoffset:r,strokeLinecap:`butt`,strokeWidth:`1.7`},e.key)})})})}function y(e){let t=e.length;if(t===0)return[];let n={failing:e.filter(e=>e.status===`failing`).length,passing:e.filter(e=>e.status===`passing`).length,pending:e.filter(e=>e.status===`pending`).length,skipped:e.filter(e=>e.status===`skipped`).length,unknown:e.filter(e=>e.status===`unknown`).length};return[{color:`var(--color-token-charts-green)`,count:n.passing,key:`passing`},{color:`var(--color-token-charts-red)`,count:n.failing,key:`failing`},{color:`var(--color-token-charts-yellow)`,count:n.pending,key:`pending`},{color:`var(--color-token-description-foreground)`,count:n.skipped+n.unknown,key:`skipped`}].filter(e=>e.count>0).map(e=>({color:e.color,key:e.key,ratio:e.count/t}))}var b,x,S,C,w=e((()=>{m(),u(),b=a(),x=5.75,S=2*Math.PI*x,C=1.5})),T,E,D=e((()=>{t(r()),T=a(),E=e=>(0,T.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:20,height:20,fill:`currentColor`,viewBox:`0 0 20 20`,...e,children:(0,T.jsx)(`path`,{d:`M10.012 1.669a8.343 8.343 0 0 1 8.343 8.343 8.343 8.343 0 0 1-8.343 8.343 8.343 8.343 0 0 1-8.343-8.343 8.343 8.343 0 0 1 8.343-8.343Zm0 1.668a6.675 6.675 0 1 0 0 13.35 6.675 6.675 0 0 0 0-13.35Zm0 1.669a5.007 5.007 0 1 1 0 10.012V5.006Z`})})}));function O({checks:e,ciStatus:t}){if(e.length===0)switch(t){case`failing`:return(0,A.jsx)(d,{className:`icon-sm shrink-0 text-token-charts-red`});case`none`:return(0,A.jsx)(c,{className:`icon-sm shrink-0`});case`passing`:return(0,A.jsx)(g,{className:`icon-sm shrink-0 text-token-charts-green`});case`pending`:return(0,A.jsx)(E,{className:`icon-sm shrink-0 text-token-charts-yellow`})}return t===`none`?(0,A.jsx)(c,{className:`icon-sm shrink-0`}):(0,A.jsx)(v,{checks:e})}function k(e){switch(e){case`failing`:return(0,A.jsx)(f,{id:`localConversation.pullRequest.actions.checksFailing`,defaultMessage:`Checks failing`,description:`Status row shown when pull request checks are failing`});case`none`:return(0,A.jsx)(f,{id:`localConversation.pullRequest.actions.noCiChecks`,defaultMessage:`No CI checks`,description:`Status row shown when the pull request currently has no CI checks`});case`passing`:return(0,A.jsx)(f,{id:`localConversation.pullRequest.actions.checksSuccessful`,defaultMessage:`Checks successful`,description:`Status row shown when pull request checks are passing`});case`pending`:return(0,A.jsx)(f,{id:`localConversation.pullRequest.actions.checksPending`,defaultMessage:`Checks pending`,description:`Status row shown when pull request checks are still pending`})}}var A,j=e((()=>{h(),_(),D(),s(),o(),w(),A=a()}));function M({automations:e,conversationId:t,includePausedAutomations:n=!1}){return t==null?null:e.find(e=>i(e)&&(e.status===`ACTIVE`||n&&e.status===`PAUSED`)&&e.targetThreadId===t)??null}var N=e((()=>{n()}));export{j as a,v as c,k as i,w as l,N as n,E as o,O as r,D as s,M as t};
//# sourceMappingURL=app-initial~app-main~remote-conversation-page~pull-requests-page~projects-index-page~hotkey~ek7ayrmo-CaMd9sil.js.map