import{t as e}from"./jsx-runtime-CutOxEx1.js";import{r as t}from"./norm-f7iXVy-b.js";import{f as n,t as r}from"./cloudModel-CkCu0fP6.js";var i=(e,i)=>{let a=t(e),o=t(i);return!a&&!o?``:a===`glm_agent`?`GLM 智能代理`:r.find(e=>{let t=n(e.value);return t?.provider===a&&t?.model===o})?.label||[a,o].filter(Boolean).join(` / `)},a=e=>{if(!e||typeof e!=`object`)return null;let n={fromProvider:t(e?.fromProvider||e?.from_provider),fromModel:t(e?.fromModel||e?.from_model),provider:t(e?.provider),model:t(e?.model),reason:t(e?.reason),stage:t(e?.stage)};return!n.fromProvider&&!n.fromModel&&!n.provider&&!n.model&&!n.reason&&!n.stage?null:n},o=e=>{let t=a(e);return t?{fromLabel:i(t.fromProvider||``,t.fromModel||``),toLabel:i(t.provider||``,t.model||``)}:{fromLabel:``,toLabel:``}},s=e=>{let{toLabel:t}=o(e);return t?`已自动切换到 ${t} 继续完成`:``},c=e=>{let{fromLabel:t,toLabel:n}=o(e);return n?t&&t!==n?`本次结果已从 ${t} 自动切换到 ${n} 后完成。`:`本次结果已自动切换到 ${n} 模型完成。`:``},l=e(),u={display:`inline-flex`,alignItems:`center`,padding:`4px 10px`,borderRadius:999,border:`1px solid rgba(244, 136, 53, 0.18)`,background:`rgba(255,255,255,0.6)`,color:`var(--text-1)`,fontSize:12,fontWeight:700,lineHeight:1.2};function d({raw:e,variant:t=`notice`,className:n,style:r,textStyle:i}){let a=t===`hint`?c(e):s(e),{fromLabel:d,toLabel:f}=o(e);return a?(0,l.jsxs)(`div`,{className:n,style:r,children:[d||f?(0,l.jsxs)(`div`,{style:{display:`flex`,flexWrap:`wrap`,gap:8,marginBottom:8},children:[d?(0,l.jsx)(`span`,{style:u,children:d}):null,d&&f&&d!==f?(0,l.jsx)(`span`,{style:{...u,padding:`4px 8px`},children:`→`}):null,f?(0,l.jsx)(`span`,{style:u,children:f}):null]}):null,(0,l.jsx)(`div`,{style:i,children:a})]}):null}export{s as n,c as r,d as t};