import{s as e}from"./chunk-Bj-mKKzh.js";import{t}from"./react-CClhXMB2.js";import{c as n,i as r}from"./uiIdentityOverlay-Ba7GNj7m.js";import{n as i,t as a}from"./button-DO50qOGv.js";import{t as o}from"./jsx-runtime-CyI9ICYU.js";import{s}from"./lib--QVjyxmL.js";import{C as c,F as l,R as u,S as d,U as f,_ as p,z as m}from"./index-N9uRPknx.js";import{t as h}from"./lib-B6rgJiZ9.js";var g=e(t(),1),_=o(),v=(0,g.memo)(function({skills:e,className:t}){return e.length===0?null:(0,_.jsx)(`div`,{className:i(`flex items-center gap-1 flex-wrap justify-end`,t),children:e.map(e=>(0,_.jsxs)(`span`,{className:`inline-flex items-center px-1.5 py-0.5 rounded text-[11px] font-mono text-muted-foreground`,children:[`/`,e]},e))})});function y(e,t){let n=t??(typeof navigator>`u`?null:navigator.clipboard);return n?n.writeText(e).then(()=>!0,()=>!1):Promise.resolve(!1)}var b=(0,g.memo)(function({content:e}){let t=r({id:`message.user.prompt`,c3ComponentId:`c3-111`,c3ComponentLabel:`messages`}),o=(0,g.useMemo)(()=>c(e),[e]),{attachments:b,text:x}=(0,g.useMemo)(()=>d(o.content),[o.content]),[S,C]=(0,g.useState)(!1),w=(0,g.useCallback)(async()=>{await y(o.content)&&(C(!0),setTimeout(()=>C(!1),2e3))},[o.content]);return(0,_.jsxs)(`div`,{className:`flex w-full min-w-0 flex-col items-end gap-1.5`,...n(t),children:[o.skills?(0,_.jsx)(v,{skills:o.skills}):null,(0,_.jsx)(`div`,{className:`flex w-full min-w-0 justify-end gap-2 pt-2`,children:(0,_.jsxs)(`div`,{className:`group/user-message relative max-w-full min-w-0 sm:max-w-[80%] sm:min-w-[120px]`,children:[(0,_.jsx)(a,{type:`button`,variant:`ghost`,size:`icon`,className:i(`absolute top-2 right-2 z-10 h-7 w-7 rounded-full border border-border/50 bg-background/80 p-0 text-muted-foreground backdrop-blur-sm`,`opacity-0 transition-opacity duration-150`,`group-hover/user-message:opacity-100`,`group-active/user-message:opacity-100`,!S&&`hover:border-foreground/20 hover:bg-background hover:text-foreground`,S&&`border-emerald-500/30 bg-emerald-500/10 text-emerald-300 !opacity-100`),"aria-label":S?`Copied prompt`:`Copy prompt`,onClick:w,children:S?(0,_.jsx)(f,{className:`h-3 w-3`}):(0,_.jsx)(m,{className:`h-3 w-3`})}),(0,_.jsxs)(`div`,{className:`max-w-full overflow-hidden rounded-[20px] py-1.5 px-3.5 bg-[color-mix(in_srgb,var(--logo)_10%,hsl(var(--background)))] dark:bg-[color-mix(in_srgb,var(--logo)_16%,hsl(var(--background)))] text-foreground border border-logo/25 dark:border-logo/30 shadow-sm prose prose-sm dark:prose-invert break-normal [overflow-wrap:break-word] [&_p]:whitespace-pre-line [&_p]:break-normal [&_p]:[overflow-wrap:break-word]`,children:[b.length>0?(0,_.jsx)(`div`,{className:`not-prose mb-1.5 flex flex-wrap justify-end gap-1.5`,children:b.map((e,t)=>(0,_.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 rounded-lg border border-logo/25 bg-background/40 px-2 py-1 text-xs text-foreground/90`,title:e.storedName,children:[e.isImage?(0,_.jsx)(l,{className:`h-3.5 w-3.5 shrink-0`}):(0,_.jsx)(u,{className:`h-3.5 w-3.5 shrink-0`}),(0,_.jsx)(`span`,{className:`max-w-[180px] truncate`,children:e.storedName})]},`${e.storedName}-${t}`))}):null,x?(0,_.jsx)(h,{remarkPlugins:[s],components:p(),children:x}):null]})]})})]})});export{b as UserMessage};