import{n as e,s as t}from"./rolldown-runtime-BG2f4sTM.js";import{$y as n,Dq as r,Dvt as i,F_ as a,I_ as o,L_ as s,Mft as c,Mlt as l,N_t as u,Nlt as d,Nvt as f,O_t as p,Oq as m,Rft as h,Tq as g,Vft as _,Vy as v,Wft as y,cv as b,gut as x,hut as S,iL as C,ib as w,jft as T,lv as E,nb as D,odt as O,rL as k,rb as A,sdt as j}from"./app-initial-BHB6SClA.js";function M({conversationId:e,hostId:t}){let n=u(T),i=y(),[o,c]=(0,N.useState)(!1),{agentMode:l,setAgentMode:f}=m({conversationId:e,hostId:t}),{setPreferredNonFullAccessMode:p}=r({conversationId:e,hostId:t}),h=async()=>{if(!o){c(!0);try{await A(n,{conversationId:e,setAgentMode:f,setPreferredNonFullAccessMode:p,startAgentMode:l})}catch(t){j.error(`Failed to enable Auto-review`,{safe:{conversationId:e},sensitive:{error:t}}),n.get(d).danger(i.formatMessage({id:`approvalRequest.autoReviewNudge.enableFailed`,defaultMessage:`Could not enable Auto-review — try again`,description:`Toast shown when enabling Auto-review from an approval request fails`}))}finally{c(!1)}}};return(0,P.jsx)(a,{children:(0,P.jsxs)(`form`,{className:`flex flex-col`,onSubmit:e=>{e.preventDefault(),h()},children:[(0,P.jsxs)(`div`,{className:`flex flex-col gap-5 px-4 pt-4 pb-5`,children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-token-description-foreground`,children:[(0,P.jsx)(b,{className:`icon-sm shrink-0`}),(0,P.jsx)(_,{id:`approvalRequest.autoReviewNudge.title`,defaultMessage:`Want fewer approval prompts?`,description:`Title for the Auto-review offer shown after several manual approvals`})]}),(0,P.jsx)(`div`,{className:`text-base leading-6`,children:(0,P.jsx)(_,{id:`approvalRequest.autoReviewNudge.description`,defaultMessage:`ChatGPT can automatically approve eligible actions while it works. This may use more credits. <a>Learn more.</a>`,description:`Description for the Auto-review offer shown after several manual approvals`,values:{a:e=>(0,P.jsx)(k,{className:`cursor-interaction rounded-sm underline focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-token-focus-border`,href:v,initiator:`open_in_browser_bridge`,isBrowserSidebarEnabled:!1,children:e},`auto-review-learn-more`)}})})]}),(0,P.jsxs)(`div`,{className:`flex flex-wrap justify-end gap-2 border-t border-token-border/50 px-3 py-2`,children:[(0,P.jsx)(S,{color:`outline`,disabled:o,size:`composer`,onClick:()=>{D(n,e)},children:(0,P.jsx)(_,{id:`approvalRequest.autoReviewNudge.keepManual`,defaultMessage:`Keep manual approvals`,description:`Action to keep manual approvals and permanently dismiss the Auto-review offer`})}),(0,P.jsxs)(S,{autoFocus:!0,color:`primary`,disabled:o,size:`composer`,type:`submit`,children:[(0,P.jsx)(_,{id:`approvalRequest.autoReviewNudge.enable`,defaultMessage:`Approve for me`,description:`Action to enable Auto-review from a standalone approval offer`}),(0,P.jsx)(s,{variant:`primary`,children:`⏎`})]})]})]})})}var N,P;e((()=>{p(),N=t(f(),1),h(),x(),C(),l(),n(),E(),c(),O(),w(),o(),g(),P=i()}))();export{M as AutoReviewApprovalNudge};
//# sourceMappingURL=auto-review-approval-nudge-bOcekUG0.js.map