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