import{T as b,E as y}from"./@wangeditor.4fd390b4.js";import{_ as w}from"./picker.f5e784c0.js";import{i as m}from"./index.71fc8348.js";import{d as V,s as f,r as x,b as c,D as U,o as k,c as B,T as i,u as t,j as E,Z as R}from"./@vue.108c970a.js";const F=V({__name:"index",props:{modelValue:{default:""},mode:{default:"default"},height:{default:"100%"},width:{default:"auto"},toolbarConfig:{default:()=>({})}},emits:["update:modelValue"],setup(l,{emit:p}){const a=l,d=f(),n=f(),r=x("");let s;const g={MENU_CONF:{uploadImage:{customBrowseAndUpload(e){var o;r.value="image",(o=n.value)==null||o.showPopup(-1),s=e}},uploadVideo:{customBrowseAndUpload(e){var o;r.value="video",(o=n.value)==null||o.showPopup(-1),s=e}}}},h=c(()=>({height:m(a.height),width:m(a.width)})),u=c({get(){return a.modelValue},set(e){p("update:modelValue",e)}}),v=e=>{e.forEach(o=>{s(o)})};U(()=>{const e=d.value;e!=null&&e.destroy()});const _=e=>{d.value=e};return(e,o)=>(k(),B("div",{class:"border border-br flex flex-col",style:R(t(h))},[i(t(b),{class:"border-b border-br",editor:t(d),defaultConfig:l.toolbarConfig,mode:l.mode},null,8,["editor","defaultConfig","mode"]),i(t(y),{class:"overflow-y-auto flex-1",modelValue:t(u),"onUpdate:modelValue":o[0]||(o[0]=C=>E(u)?u.value=C:null),defaultConfig:g,mode:l.mode,onOnCreated:_},null,8,["modelValue","mode"]),i(w,{ref_key:"materialPickerRef",ref:n,type:r.value,limit:-1,"hidden-upload":"",onChange:v},null,8,["type"])],4))}});export{F as _};
