import{T as v,E as b}from"./index.esm.3fe50213.js";import{d as y,s as C,b5 as V,r as B,p as w,W as x,a_ as E,e as N,f as T,h as r,u as a,n as F,q as O,aq as k,_ as I}from"./index.0308b213.js";const R={class:"editor-container"},S=y({props:{modelValue:{default:""},disabled:{type:Boolean,default:!1},height:{default:500},mode:{default:"default"}},emits:["update:modelValue"],setup(s,{expose:u,emit:i}){const n=s,m=C(()=>{let e={};return e.height=`${n.height}px`,e}),l=V();let o=B("");w(()=>n.modelValue,e=>{o.value=e},{immediate:!0});const{token:c}=x(),f={},p={placeholder:"\u8BF7\u8F93\u5165\u5185\u5BB9",MENU_CONF:{uploadImage:{server:window.location.protocol+"//"+window.location.host+"/adminapi/upload/image",fieldName:"file",maxNumberOfFiles:1,headers:{token:c,version:k},customInsert(e,d){const t=e.data.uri;d(t,"",t)}}}},h=e=>{l.value=e},_=e=>{i("update:modelValue",e.getHtml())},g=()=>{o.value=""};return E(()=>{var e;l.value&&((e=l.value)==null||e.destroy())}),u({clear:g}),(e,d)=>(N(),T("div",R,[r(a(v),{class:"editor-toolbar",editor:a(l),"default-config":f,mode:s.mode},null,8,["editor","mode"]),r(a(b),{style:F(a(m)),modelValue:a(o),"onUpdate:modelValue":d[0]||(d[0]=t=>O(o)?o.value=t:o=t),"default-config":p,mode:s.mode,onOnCreated:h,onOnChange:_},null,8,["style","modelValue","mode"])]))}});const z=I(S,[["__scopeId","data-v-4bb104ee"]]);export{z as T};
