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{L as c,S as l,V as u,_ as d}from"./index-CxCnkDVM.js";import{t as f}from"./lib-B6rgJiZ9.js";var p=e(t(),1),m=o(),h=(0,p.memo)(function({skills:e,className:t}){return e.length===0?null:(0,m.jsx)(`div`,{className:i(`flex items-center gap-1 flex-wrap justify-end`,t),children:e.map(e=>(0,m.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 g(e,t){let n=t??(typeof navigator>`u`?null:navigator.clipboard);return n?n.writeText(e).then(()=>!0,()=>!1):Promise.resolve(!1)}var _=(0,p.memo)(function({content:e}){let t=r({id:`message.user.prompt`,c3ComponentId:`c3-111`,c3ComponentLabel:`messages`}),o=(0,p.useMemo)(()=>l(e),[e]),[_,v]=(0,p.useState)(!1),y=(0,p.useCallback)(async()=>{await g(o.content)&&(v(!0),setTimeout(()=>v(!1),2e3))},[o.content]);return(0,m.jsxs)(`div`,{className:`flex w-full min-w-0 flex-col items-end gap-1.5`,...n(t),children:[o.skills?(0,m.jsx)(h,{skills:o.skills}):null,(0,m.jsx)(`div`,{className:`flex w-full min-w-0 justify-end gap-2 pt-2`,children:(0,m.jsxs)(`div`,{className:`group/user-message relative max-w-full min-w-0 sm:max-w-[80%] sm:min-w-[120px]`,children:[(0,m.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`,!_&&`hover:border-foreground/20 hover:bg-background hover:text-foreground`,_&&`border-emerald-500/30 bg-emerald-500/10 text-emerald-300 !opacity-100`),"aria-label":_?`Copied prompt`:`Copy prompt`,onClick:y,children:_?(0,m.jsx)(u,{className:`h-3 w-3`}):(0,m.jsx)(c,{className:`h-3 w-3`})}),(0,m.jsx)(`div`,{className:`max-w-full overflow-hidden rounded-[20px] py-1.5 px-3.5 bg-logo/[0.10] dark:bg-logo/[0.16] 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:(0,m.jsx)(f,{remarkPlugins:[s],components:d(),children:o.content})})]})})]})});export{_ as UserMessage};