import{r as e}from"./rolldown-runtime-DCMCV6zW.js";import{s as t}from"./vendor-primevue-7po8Zk9v.js";import{$ as n,A as r,D as i,E as a,Et as o,F as s,Ft as c,K as l,L as u,Lt as d,W as f,_ as p,gt as m,lt as h,y as g}from"./vendor-vue-core-D3IvUUeM.js";import"./vendor-markdown-yjaB1jgA.js";import{t as _}from"./markdownRendererUtil-D5cHPoK2.js";var v=[`innerHTML`],y=u({__name:`WidgetMarkdown`,props:f({widget:{}},{modelValue:{default:``},modelModifiers:{}}),emits:[`update:modelValue`],setup(e){let u=h(e,`modelValue`),f=o(!1),y=o(),b=a(()=>_(u.value||``)),startEditing=async()=>{f.value||e.widget.options?.read_only||(f.value=!0,await l(),y.value?.$el?.focus())},handleBlur=()=>{f.value=!1};return(e,a)=>(n(),r(`div`,{class:`widget-markdown relative w-full`,onDblclick:startEditing},[i(`div`,{class:d([`comfy-markdown-content size-full min-h-[60px] overflow-y-auto rounded-lg text-sm`,f.value===!1?`visible`:`invisible`]),innerHTML:b.value},null,10,v),m(s(c(t),{ref_key:`textareaRef`,ref:y,modelValue:u.value,"onUpdate:modelValue":a[0]||=e=>u.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:a[1]||=g(()=>{},[`stop`]),onPointermoveCapture:a[2]||=g(()=>{},[`stop`]),onPointerupCapture:a[3]||=g(()=>{},[`stop`]),onClick:a[4]||=g(()=>{},[`stop`]),onKeydown:a[5]||=g(()=>{},[`stop`])},null,8,[`modelValue`,`aria-label`,`pt`]),[[p,f.value]])],32))}});export{y as default};
//# sourceMappingURL=WidgetMarkdown-B30-ibh7.js.map