import{r as e}from"./rolldown-runtime-DIIn1E2Q.js";import"./vendor-primevue-CIZeDNer.js";import"./vendor-firebase-yTFzdAQf.js";import{A as t,D as n,G as r,Ht as i,I as a,K as o,Lt as s,O as c,R as l,_t as u,b as d,et as f,j as p,k as m,lt as h,ut as g,zt as _}from"./vendor-vue-core-IZuWV8u3.js";import"./vendor-other-DOjudfJ1.js";import"./useFeatureFlags-Clsy1Hhz.js";import"./api-BoVM1fMt.js";import"./vendor-markdown-th9BvURy.js";import"./colorUtil-CaOYwqZT.js";import"./i18n-CbR4AZxs.js";import"./vendor-reka-ui-NsM8zEZd.js";import{t as v}from"./src-B6n4nS3q.js";import{t as y}from"./Button-BonqIZfE.js";import{_t as b,li as x}from"./dialogService-DeXt-oC-.js";import"./extensionStore-B_7jnXF_.js";import"./dialogStore-qTsCyKDB.js";import"./userStore-ClejTuyc.js";import{r as S}from"./widgetTypes-C7uVk06B.js";import"./useErrorHandling-DSpiCwxA.js";import"./useExternalLink-C6SjfMkA.js";import"./vendor-tiptap-nOCIQysJ.js";import"./markdownRendererUtil-DO0bU-vH.js";import"./Popover-CTWL6O4Q.js";import{t as C}from"./Textarea-DPhr4t0L.js";import{o as w,r as T}from"./widgetPropFilter-Dy-SfJ-m.js";import{t as E}from"./layout-D00FkF_k.js";var D=[`for`],O=l({__name:`WidgetTextarea`,props:r({widget:{},placeholder:{default:``}},{modelValue:{default:``},modelModifiers:{}}),emits:[`update:modelValue`],setup(e){let r=g(e,`modelValue`),l=S(),{copyToClipboard:O}=x(),k=n(()=>w(e.widget.options,T)),A=n(()=>e.widget.label||e.widget.name),j=h(),M=n(()=>!!(e.widget.options?.read_only||e.widget.options?.disabled));function handleContextMenu(e){if(b()){e.stopPropagation();return}e.preventDefault()}function handleCopy(){O(r.value)}return(e,n)=>(f(),p(`div`,{class:_(s(v)(`group relative rounded-lg transition-all focus-within:ring focus-within:ring-component-node-widget-background-highlighted hover:bg-component-node-widget-background-hovered`,e.widget.borderStyle))},[s(l)?t(``,!0):(f(),p(`label`,{key:0,for:s(j),class:`pointer-events-none absolute top-1.5 left-3 z-10 text-xxs text-muted-foreground`},i(A.value),9,D)),a(C,o(k.value,{id:s(j),modelValue:r.value,"onUpdate:modelValue":n[0]||=e=>r.value=e,class:s(v)(s(E),`size-full resize-none text-xs`,!s(l)&&`pt-5`),placeholder:e.placeholder,readonly:M.value,"data-capture-wheel":`true`,onPointerdownCapture:n[1]||=d(()=>{},[`stop`]),onPointermoveCapture:n[2]||=d(()=>{},[`stop`]),onPointerupCapture:n[3]||=d(()=>{},[`stop`]),onContextmenuCapture:handleContextMenu}),null,16,[`id`,`modelValue`,`class`,`placeholder`,`readonly`]),M.value?(f(),m(y,{key:1,variant:`textonly`,size:`icon`,class:`invisible absolute top-1.5 right-1.5 z-10 group-focus-within:visible group-hover:visible hover:bg-base-foreground/10`,title:e.$t(`g.copyToClipboard`),"aria-label":e.$t(`g.copyToClipboard`),onClick:handleCopy,onPointerdownCapture:n[4]||=d(()=>{},[`stop`])},{default:u(()=>n[5]||=[c(`i`,{class:`icon-[lucide--copy] size-4 text-component-node-foreground`},null,-1)]),_:1},8,[`title`,`aria-label`])):t(``,!0)],2))}});export{O as default};
//# sourceMappingURL=WidgetTextarea-DGi0xm_C.js.map