import{r as e}from"./rolldown-runtime-DIIn1E2Q.js";import{s as t}from"./vendor-primevue-DGevbYGF.js";import{Bt as n,D as r,G as i,I as a,O as o,R as s,Rt as c,b as l,et as u,j as d,kt as f,q as p,ut as m,v as h,vt as g}from"./vendor-vue-core-BdhYaYlO.js";import"./vendor-markdown-th9BvURy.js";import{t as _}from"./markdownRendererUtil-J4WlXR5e.js";var v=[`innerHTML`],y=s({__name:`WidgetMarkdown`,props:i({widget:{}},{modelValue:{default:``},modelModifiers:{}}),emits:[`update:modelValue`],setup(e){let i=m(e,`modelValue`),s=f(!1),y=f(),b=r(()=>_(i.value||``)),startEditing=async()=>{s.value||e.widget.options?.read_only||(s.value=!0,await p(),y.value?.$el?.focus())},handleBlur=()=>{s.value=!1};return(e,r)=>(u(),d(`div`,{class:`widget-markdown relative w-full`,onDblclick:startEditing},[o(`div`,{class:n([`comfy-markdown-content size-full min-h-[60px] overflow-y-auto rounded-lg text-sm`,s.value===!1?`visible`:`invisible`]),tabindex:`0`,"data-capture-wheel":`true`,innerHTML:b.value},null,10,v),g(a(c(t),{ref_key:`textareaRef`,ref:y,modelValue:i.value,"onUpdate:modelValue":r[0]||=e=>i.value=e,"aria-label":`${e.$t(`g.edit`)} ${e.widget.name||e.$t(`g.markdown`)} ${e.$t(`g.content`)}`,class:`absolute inset-0 min-h-[60px] w-full resize-none`,pt:{root:{class:`text-sm w-full h-full`,onBlur:handleBlur}},"data-capture-wheel":`true`,onPointerdownCapture:r[1]||=l(()=>{},[`stop`]),onPointermoveCapture:r[2]||=l(()=>{},[`stop`]),onPointerupCapture:r[3]||=l(()=>{},[`stop`]),onClick:r[4]||=l(()=>{},[`stop`]),onKeydown:r[5]||=l(()=>{},[`stop`])},null,8,[`modelValue`,`aria-label`,`pt`]),[[h,s.value]])],32))}});export{y as default};
//# sourceMappingURL=WidgetMarkdown-B21SmGpv.js.map