import{p as t,i as X,b as Y,a as q,f as A}from"./i18n-Dnhn5Rxr.js";import{R as D,y as E,t as F,a as G,T as H,X as J,W as K,V as L,w as n,a5 as _,Y as N,u as O,x as h}from"./index-DWyDLubb.js";import{a as Q}from"./actions-CLThs9VH.js";import{c as g,a as S}from"./utils.svelte-CCyS_0CY.js";import{C as U}from"./Check-DUAHzS2-.js";import{C as Z}from"./Copy-ChCbTvli.js";import{I as $}from"./ScrollFade.svelte_svelte_type_style_lang-DPHOQHBm.js";import{I as ee}from"./IconButtonWrapper-D0s9l4wW.js";import{M as te}from"./MarkdownCode-B8HQ3LiU.js";var ae=K('<div data-testid="markdown"><!> <!></div>');function ce(v,e){D(e,!0);let b=t(e,"elem_classes",19,()=>[]),k=t(e,"visible",3,!0),o=t(e,"min_height",3,void 0),y=t(e,"rtl",3,!1),w=t(e,"sanitize_html",3,!0),x=t(e,"line_breaks",3,!1),C=t(e,"latex_delimiters",19,()=>[]),I=t(e,"header_links",3,!1),d=t(e,"height",3,void 0),z=t(e,"show_copy_button",3,!1),M=t(e,"loading_status",3,void 0),T=t(e,"onchange",3,()=>{}),p=t(e,"oncopy",3,i=>{}),s=O(!1),l;E(()=>{e.value&&T()()});async function j(){"clipboard"in navigator&&(await navigator.clipboard.writeText(e.value),p()({value:e.value}),B())}function B(){h(s,!0),l&&clearTimeout(l),l=setTimeout(()=>{h(s,!1)},1e3)}var a=ae();let m,u;var c=L(a);{var W=i=>{ee(i,{children:(r,f)=>{{let R=_(()=>n(s)?U:Z),V=_(()=>n(s)?"Copied conversation":"Copy conversation");$(r,{get Icon(){return n(R)},onclick:j,get label(){return n(V)}})}},$$slots:{default:!0}})};X(c,i=>{z()&&i(W)})}var P=J(c,2);te(P,{get message(){return e.value},get latex_delimiters(){return C()},get sanitize_html(){return w()},get line_breaks(){return x()},chatbot:!1,get header_links(){return I()},get theme_mode(){return e.theme_mode}}),N(a),Q(a,i=>S?.(i)),F((i,r,f)=>{m=Y(a,1,`prose ${i??""}`,"svelte-1xjkzpp",m,{hide:!k()}),q(a,"dir",y()?"rtl":"ltr"),u=A(a,r,u,f),a.dir=a.dir},[()=>b()?.join(" ")||"",()=>d()?`max-height: ${g(d())}; overflow-y: auto;`:"",()=>({"min-height":o()&&M()?.status!=="pending"?g(o()):void 0})]),G(v,a),H()}export{ce as M};
