import{r as s,j as e}from"./vendor-react-AXa6hZO5.js";import{b as a,a as o,T as t}from"./c70a3d12b-BI7Bbafv.js";import{a as r,U as i,V as n,X as d,d as m,Y as l,Z as c,_ as j}from"./index-D35RxkWr.js";import{b as p,B as f}from"./c6eedc03a-C8LSdtro.js";import{u,M as v}from"./vendor-intl-BdADXLLt.js";import"./vendor-query-B8PP3rYl.js";import"./vendor-luxon-Y8l99kBI.js";import"./vendor-zod-1gcJXWab.js";import"./vendor-radix-jAWPQP1f.js";import"./vendor-lodash-D-zrMTUO.js";import"./vendor-zustand-CcZsBpBq.js";import"./vendor-infra-DayZK7Ds.js";import"./vendor-router-B4CxQ1po.js";import"./c365fd3fe-Dmpsm876.js";import"./vendor-motion-DGh7M6mr.js";import"./vendor-growthbook-XJcBFzji.js";import"./vendor-icons-DsiQAprm.js";import"./tree-sitter-BFuuT2ac.js";const h=s.memo(({enabled:h,onDismiss:x,onAction:g})=>{const M=p(),b=u(),{conversation:w}=r(),k=w?.id,y=i(),{allModelOptions:C}=n();d(s=>s.model);const N=a(k??"")?.model,{dismiss:S}=m(),z=l(s=>k?s.initialModelByConversation.get(k):void 0),A=s.useCallback(()=>{g({action:"start_new_chat"}),M.push(y?`/project/${y}`:"/new")},[g,y,M]),B=s.useCallback(()=>{S(c),x()},[S,x]),D=C.find(s=>s.model===N)?.name;return h&&D&&z&&N!==z?e.jsx(o,{variant:"main",icon:j,className:"w-full mb-3",message:e.jsx(v,{defaultMessage:"Switched to {currentName}. A fresh chat gets you faster replies that use less of your message limit.",id:"Fx6BT4eqau",values:{currentName:D}}),customAction:e.jsxs("div",{className:"flex flex-col gap-2 items-end",children:[e.jsxs("div",{className:"flex gap-2",children:[e.jsx(f,{size:"sm",variant:"secondary",onClick:x,children:b.formatMessage({defaultMessage:"Keep going",id:"JiaScEwUsv"})}),e.jsx(f,{size:"sm",variant:"primary",onClick:A,children:b.formatMessage({defaultMessage:"Start new chat",id:"KcA+xo4hhh"})})]}),e.jsx(t,{onClick:B,className:"text-xs text-text-400",children:e.jsx(v,{defaultMessage:"Don't ask me again",id:"fouhDohWSi"})})]})}):null});h.displayName="ModelSwitchedChatBanner";export{h as ModelSwitchedChatBanner};
