import{o as s}from"./rolldown-runtime-iuO8RvI4.js";import{Tu as e}from"./shared-0-C4kdVF7Y.js";import{Mi as a,ki as r}from"./vendor-frame-CwiylG4Y.js";import{Ls as t,Xl as i,nl as o,ol as n}from"./shared-1-3-6x7RKF.js";import{nn as l,rn as m}from"./vendor-all-2-BJdkbLSj.js";import{$ as d,R as c}from"./shared-frame-DbQbH4Yr.js";import{al as h,ks as f,wa as u}from"./shared-4-6CEyRAHb.js";import{xc as x}from"./shared-3-D-Ux4aGn.js";import{At as j,Et as p}from"./shared-7-VxUxSmVa.js";var v=s(a()),g=r(),N=(0,v.memo)(({currentName:s,onDismiss:e,onStartNewChat:a,onNever:r})=>{const t=m();return(0,g.jsx)(u,{variant:"neutral",icon:(0,g.jsx)(d,{name:"ChatAdd",size:"md"}),className:"w-full mb-3 !items-start",children:(0,g.jsxs)("div",{className:"flex w-full items-start justify-between gap-4",children:[(0,g.jsx)("div",{className:"min-w-0",children:(0,g.jsx)(l,{defaultMessage:"Switched to {currentName}. A fresh chat gets you faster replies that use less of your message limit.",id:"Fx6BT4eqau",values:{currentName:s}})}),(0,g.jsxs)("div",{className:"flex shrink-0 flex-col items-end gap-2",children:[(0,g.jsxs)("div",{className:"flex gap-2",children:[(0,g.jsx)(c,{variant:"secondary",onClick:e,children:t.formatMessage({defaultMessage:"Keep going",id:"JiaScEwUsv"})}),(0,g.jsx)(c,{variant:"primary",onClick:a,children:t.formatMessage({defaultMessage:"Start new chat",id:"KcA+xo4hhh"})})]}),(0,g.jsx)(h,{onClick:r,className:"text-xs text-text-400",children:(0,g.jsx)(l,{defaultMessage:"Don\u2019t ask me again",id:"+xRY6yy3uz"})})]})]})})}),w=(0,v.memo)(({enabled:s,onDismiss:a,onAction:r})=>{const l=e(),{conversation:m}=f(),d=m?.id,c=o(),{nameFor:h,hasModel:u}=x("chat");n(s=>s.model);const w=t(d??"")?.model,{dismiss:k}=i(),C=j(s=>d?s.initialModelByConversation.get(d):void 0),M=(0,v.useCallback)(()=>{r({action:"start_new_chat"}),l.push(c?`/project/${c}`:"/new")},[r,c,l]),y=(0,v.useCallback)(()=>{k(p),a()},[k,a]),b=h(w);return s&&u(w)&&C&&w!==C?(0,g.jsx)(N,{currentName:b,onDismiss:a,onStartNewChat:M,onNever:y}):null});export{w as ModelSwitchedChatBanner};