import{G as e,Ri as t,T as n,Y as r,j as i,mt as a,rt as o,tt as s,zi as c}from"./app-server-manager-signals-Yn0WSnoY.js";import{G as l,R as u,h as d}from"./vscode-api-DjORcpSo.js";var f=l(d,e=>[]),p=u(d,(e,{get:t})=>t(f,e).some(e=>t(i,e)===!0)),m=u(d,(e,{get:t})=>t(f,e).filter(e=>t(n,e)===!0)),h=u(d,(e,{get:t})=>{let r=t(n,e);return e==null||r==null?r:r||t(m,e).length>0});function g(e,t,n){e.set(f,t,e=>[...e,n])}function _(e,t,n){e.set(f,t,e=>e.filter(e=>e!==n))}var v=u(d,(t,{get:n})=>b({hasInProgressSideChat:n(p,t),isResponseInProgress:n(i,t),resumeState:n(o,t),threadRuntimeStatus:n(a,t),latestTurnHasSystemError:n(e,t)===!0})),y=u(d,(e,{get:t})=>x({pendingRequestType:t(r,e)?.type??null,requests:t(s,e),resumeState:t(o,e),threadRuntimeStatus:t(a,e)}));function b({hasInProgressSideChat:e,isResponseInProgress:t,latestTurnHasSystemError:n,resumeState:r,threadRuntimeStatus:i}){return e?`loading`:i?.type===`systemError`?`error`:r===`needs_resume`?i?.type===`active`?`loading`:`idle`:n?`error`:t===!0?`loading`:`idle`}function x({pendingRequestType:e,requests:n,resumeState:r,threadRuntimeStatus:i}){return n==null||r==null?null:r===`needs_resume`?i?.type===`active`&&i.activeFlags.includes(`waitingOnApproval`)&&t(n)?`approval`:i?.type===`active`&&i.activeFlags.includes(`waitingOnUserInput`)?`response`:null:c(e)?`approval`:e===`userInput`?`response`:null}export{_ as a,h as i,v as n,m as o,g as r,y as t};
//# sourceMappingURL=local-task-row-signals-n-BIuX3z.js.map