import{r as o,j as s}from"./vendor-react-Dp9pL_Wn.js";import{L as e,G as r,H as i,I as n}from"./c2ee0272b-DPDuX889.js";import{M as d}from"./vendor-intl-D2wGIp4M.js";import{V as t,X as a}from"./index-XoaBlZfC.js";import{n as m}from"./vendor-lodash-BvMLws5K.js";import{B as c}from"./vendor-ant-cds-BLsR_p72.js";import{M as l}from"./vendor-motion-EDlUw66k.js";import"./vendor-base-ui-N1VQ4ctE.js";import"./vendor-radix-Dv3qPI0v.js";import"./vendor-base-5_f7mmWg.js";import"./vendor-zod-B8MhECV7.js";import"./vendor-zustand-BeF8W8xk.js";import"./vendor-icons-DGChWNxR.js";import"./vendor-router-qG5OCEmI.js";import"./vendor-query-CRl6sF7K.js";import"./vendor-zod-v3-CZy0YPWu.js";import"./vendor-luxon-CZxT8ieM.js";import"./vendor-infra-DayZK7Ds.js";import"./vendor-growthbook-HDTqppl-.js";import"./c9a5287df-D_Z7ffFR.js";import"./c51e217b4-CQax1dv1.js";import"./c627fcdb6-1_bsVTpt.js";import"./vendor-virtual-DRz8lJfQ.js";const p=o.memo(({sessionId:p,permissions:j,isScheduledTask:v,source:u,sessionHref:f,onOpenSession:x})=>{const h=function(){const s=t();return o.useCallback((o,n,d,t,a)=>{if(a?.respond&&("once"===t||"deny"===t||"always"===t))return s(o,a.toolUseId),void a.respond(t,d).catch(m);e?.respondToToolPermission?(s(o,n),e.respondToToolPermission(n,t,d)):r.error(i.DESKTOP_API,"respondToToolPermission not available")},[s])}(),{track:b}=n(),y=o.useCallback((o,s,e,r)=>{h(p,o,e,r,j.find(o=>o.toolUseId===s)),b({event_key:"claudeai.cowork.inline_review.decision",session_id:p,source:u,decision:r})},[h,p,u,b,j]),T=o.useMemo(()=>void 0===f?void 0:s.jsxs("div",{className:"flex flex-col items-start gap-3 p-4",children:[s.jsx("span",{className:"text-body text-secondary",children:s.jsx(d,{defaultMessage:"Nothing needs your review right now",id:"BCQeGx4qSS"})}),s.jsx(c,{variant:"secondary",size:"sm",href:f,onClick:x,children:s.jsx(d,{defaultMessage:"Open session",id:"lTKuAGoTLG"})})]}),[f,x]);return s.jsx(l,{reducedMotion:"always",children:s.jsx("div",{className:"[&>*]:!my-0 [&>*>*]:!border-0 [&>*>*]:!shadow-none",children:s.jsx(a,{toolPermissionRequests:j,onToolDecision:y,isScheduledTask:v,disableKeyboardShortcuts:!0,emptyState:T})})})});export{p as InlineToolApproval};
