import{d as B,t as E,r as o,a4 as H,o as v,c as g,b as w,e as _,u as e,Z as T,a0 as q,H as z,Q as I,g as M,a5 as N}from"../../../../common/index.DXvi0yH9.js";/* empty css                                                                                       *//* empty css                                                                                 */import"../../../../common/Confirmation.vue_vue_type_script_setup_true_lang.BvpajMdU.js";import{_ as j}from"../../../../common/LabelControl.vue_vue_type_script_setup_true_lang.B_b65Eg0.js";import{_ as L}from"../../../../common/Tooltip.vue_vue_type_script_setup_true_lang.BBmniJxI.js";import"../../../../common/transition.CRNcmuQX.js";import"../../../../common/keyboard.D4P2wQc7.js";import"../../../../common/open-closed.CQX5sZkx.js";import"../../../../common/micro-task.CxIZtCgj.js";const $={class:"stwlite-tw-flex stwlite-tw-items-center stwlite-tw-mb-2 stwlite-tw-gap-2"},A={class:"stwlite-tw-flex stwlite-tw-items-center stwlite-tw-min-w-72 stwlite-tw-mb-2 stwlite-tw-gap-2"},O=["id","name","placeholder","disabled"],Q=["innerHTML"],X=B({__name:"TextAreaControl",props:{params:{type:Object,required:!0}},emits:["input","fieldData"],setup(b,{emit:h}){var d,c;const x=b,{params:y}=E(x),t=y.value,l=o((t==null?void 0:t.default)||""),k=o((d=t.editor)!=null?d:!1),r=h,n=o((c=t.disabled)!=null?c:!1),s=o([]),u=o(!1),i=t.id;l.value!==""&&!n.value&&(s.value[i]=l.value,r("fieldData",s.value));const C=()=>{s.value[i]=l,r("fieldData",s.value)},V=a=>{s.value[i]=a,r("fieldData",s.value)};return k.value&&!u.value&&H(i,{tinymce:{plugins:"charmap colorpicker compat3x directionality fullscreen hr image lists media paste tabfocus textcolor wordpress wpautoresize wpdialogs wpeditimage wpemoji wpgallery wplink wptextpattern wpview",toolbar1:"formatselect bold italic | bullist numlist | blockquote | alignleft aligncenter alignright | link unlink | wp_more | spellchecker",wp_theme:!0,setup:a=>{a.on("init",()=>{u.value=!0,a.setContent(N(l.value))}),a.on("change",()=>{V(a.getContent())})}},mediaButtons:!0,quicktags:!0}),(a,p)=>{var m,f;return v(),g("div",null,[w("div",$,[_(e(j),{params:e(t)},null,8,["params"])]),w("div",A,[T(w("textarea",{id:e(i),"onUpdate:modelValue":p[0]||(p[0]=D=>l.value=D),name:e(t).id,placeholder:e(t).placeholder,rows:4,disabled:n.value,class:z(["stwlite-tw-block stwlite-tw-w-full stwlite-tw-px-3 stwlite-tw-py-2 stwlite-tw-border stwlite-tw-border-gray-300 stwlite-tw-rounded-md stwlite-tw-shadow-sm stwlite-tw-placeholder-gray-400 focus:stwlite-tw-outline-none",n.value?"stwlite-tw-bg-gray-100 stwlite-tw-text-gray-500 stwlite-tw-cursor-not-allowed":"stwlite-tw-bg-white stwlite-tw-text-gray-900"]),onInput:C},null,42,O),[[q,l.value]]),_(e(L),{params:e(t)},null,8,["params"])]),e(t).description!=="undefined"?(v(),g("p",{key:0,class:"stwlite-tw-text-sm stwlite-tw-text-gray-600 stwlite-tw-mt-2",innerHTML:e(I)((f=(m=e(t))==null?void 0:m.description)!=null?f:"")},null,8,Q)):M("",!0)])}}});export{X as default};
