import{o as s}from"./rolldown-runtime-iuO8RvI4.js";import{ut as e}from"./vendor-all-0-fRSUBfCr.js";import{Mb as o,Uy as r,bi as i,jb as a}from"./shared-0-C4kdVF7Y.js";import{Mi as n,ki as d}from"./vendor-frame-CwiylG4Y.js";import{X as l,wn as t}from"./shared-6-Cf_fMhRZ.js";import{nn as m}from"./vendor-all-2-BJdkbLSj.js";import{R as c}from"./shared-frame-DbQbH4Yr.js";import{D as p}from"./vendor-all-3-CWo5e8Lw.js";var u=s(n());var f=d(),j=(0,u.memo)(({sessionId:s,permissions:n,isScheduledTask:d,source:j,sessionHref:h,onOpenSession:v})=>{const x=function(){const s=t();return(0,u.useCallback)((i,n,d,l,t)=>{if(t?.respond&&("once"===l||"deny"===l||"always"===l))return s(i,t.toolUseId),void t.respond(l,d).catch(e);r?.respondToToolPermission?(s(i,n),r.respondToToolPermission(n,l,d)):o.error(a.DESKTOP_API,"respondToToolPermission not available")},[s])}(),{track:y}=i();return(0,f.jsx)(p,{reducedMotion:"always",children:(0,f.jsx)("div",{className:"[&>*]:!my-0 [&>*>*]:!border-0 [&>*>*]:!shadow-none",children:(0,f.jsx)(l,{toolPermissionRequests:n,onToolDecision:(0,u.useCallback)((e,o,r,i)=>{x(s,e,r,i,n.find(s=>s.toolUseId===o)),y({event_key:"claudeai.cowork.inline_review.decision",session_id:s,source:j,decision:i})},[x,s,j,y,n]),isScheduledTask:d,disableKeyboardShortcuts:!0,emptyState:(0,u.useMemo)(()=>void 0===h?void 0:(0,f.jsxs)("div",{className:"flex flex-col items-start gap-3 p-4",children:[(0,f.jsx)("span",{className:"text-body text-secondary",children:(0,f.jsx)(m,{defaultMessage:"Nothing needs your review right now",id:"BCQeGx4qSS"})}),(0,f.jsx)(c,{variant:"secondary",size:"sm",href:h,onClick:v,children:(0,f.jsx)(m,{defaultMessage:"Open session",id:"lTKuAGoTLG"})})]}),[h,v])})})})});export{j as InlineToolApproval};