import{r as e,j as s}from"./vendor-react-Dp9pL_Wn.js";import{o as a,u as o,C as r,n as t,E as i,F as n,c as d,B as m,T as c}from"./c6eedc03a-CsEFTfjy.js";import{u as l,M as j}from"./vendor-intl-D2wGIp4M.js";import{U as p,V as v}from"./index-DhMXk6CR.js";import{B as u,I as h}from"./vendor-ant-cds-bBedrtIN.js";import"./vendor-base-ui-DNypCIlh.js";import"./vendor-radix-Ch96tRrt.js";import"./vendor-base-5_f7mmWg.js";import"./vendor-zod-0xcuG3aM.js";import"./vendor-zustand-BeF8W8xk.js";import"./vendor-icons-CokWnmlw.js";import"./vendor-lodash-BvMLws5K.js";import"./vendor-router-qG5OCEmI.js";import"./vendor-query-BwvgHhJ1.js";import"./vendor-zod-v3-CZy0YPWu.js";import"./vendor-motion-EDlUw66k.js";import"./vendor-luxon-CZxT8ieM.js";import"./vendor-growthbook-C66YtMMX.js";import"./vendor-infra-DayZK7Ds.js";import"./caf7c7e06-DJYXCm3T.js";import"./c5669b8e4-DFSq88jr.js";import"./c5f4e1303-CiyIFgnl.js";import"./cbaad2c48-DaP34LG2.js";import"./vendor-virtual-DRz8lJfQ.js";const x=e.memo(({currentName:e,onDismiss:a,onStartNewChat:o,onNever:r})=>{const t=l();return s.jsx(m,{variant:"neutral",icon:s.jsx(h,{name:"ChatAdd",size:"md"}),className:"w-full mb-3 !items-start",children:s.jsxs("div",{className:"flex w-full items-start justify-between gap-4",children:[s.jsx("div",{className:"min-w-0",children:s.jsx(j,{defaultMessage:"Switched to {currentName}. A fresh chat gets you faster replies that use less of your message limit.",id:"Fx6BT4eqau",values:{currentName:e}})}),s.jsxs("div",{className:"flex shrink-0 flex-col items-end gap-2",children:[s.jsxs("div",{className:"flex gap-2",children:[s.jsx(u,{variant:"secondary",onClick:a,children:t.formatMessage({defaultMessage:"Keep going",id:"JiaScEwUsv"})}),s.jsx(u,{variant:"primary",onClick:o,children:t.formatMessage({defaultMessage:"Start new chat",id:"KcA+xo4hhh"})})]}),s.jsx(c,{onClick:r,className:"text-xs text-text-400",children:s.jsx(j,{defaultMessage:"Don\u2019t ask me again",id:"+xRY6yy3uz"})})]})]})})});x.displayName="ModelSwitchedChatBannerContent";const f=e.memo(({enabled:m,onDismiss:c,onAction:l})=>{const j=a(),{conversation:u}=o(),h=u?.id,f=r(),{nameFor:g,hasModel:N}=t("chat");i(e=>e.model);const w=n(h??"")?.model,{dismiss:C}=d(),y=p(e=>h?e.initialModelByConversation.get(h):void 0),b=e.useCallback(()=>{l({action:"start_new_chat"}),j.push(f?`/project/${f}`:"/new")},[l,f,j]),M=e.useCallback(()=>{C(v),c()},[C,c]),k=g(w);return m&&N(w)&&y&&w!==y?s.jsx(x,{currentName:k,onDismiss:c,onStartNewChat:b,onNever:M}):null});f.displayName="ModelSwitchedChatBanner";export{f as ModelSwitchedChatBanner,x as ModelSwitchedChatBannerContent};
