import{T as U,E as T}from"./style-72b27c88-1782572373740v=1.0.0.js";import{i as D,j as A,_ as M}from"./index-f6f689f9-1782572373740v=1.0.0.js";import{E as O}from"./eleVendor-48a7d3b8-1782572373740v=1.0.0.js";import{y as E,s as S,n as W,c as g,r as z,X as I,al as y,z as s,A as c,B as u,R as d,u as r,M as f,E as R,J as C,O as h,D as K}from"./vendor-866bb149-1782572373740v=1.0.0.js";const j={id:"editor-main-container"},H={key:0,class:"toolbar-container"},J={id:"content"},L={id:"editor-container"},X={key:0,id:"title-container"},q={id:"editor-text-area"},G={key:0,class:"button"},P=E({name:"WangEditor"}),Q=E({...P,props:{value:{},title:{},toolbarConfig:{default:()=>({insertKeys:{index:105,keys:["myFullScreen"]},excludeKeys:["insertVideo","codeBlock","group-video","fullScreen","insertLink"]})},editorConfig:{default:()=>({placeholder:"\u8BF7\u8F93\u5165\u5185\u5BB9...",MENU_CONF:{}})},height:{default:"500px"},mode:{default:"default"},hideToolBar:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},showEditorAll:{type:Boolean}},emits:["update:value","update:title","update:full","check-validate","edit"],setup(F,{expose:b,emit:B}){const l=S(),V=e=>{l.value=e},n=F;n.disabled&&W(()=>{l.value.disable()});const m=B,v=g({get(){return n.value},set(e){l.value.isEmpty()&&(e=""),m("update:value",e)}}),_=g({get(){return n.title},set(e){m("update:title",e)}}),a=z(!1);n.editorConfig.MENU_CONF.uploadImage={async customUpload(e,t){if(!k())return;const i=new FormData;i.append("image",e);try{const o=await D(i);if(o.code!=200){O.warning(o.message);return}t(o.data.imgUrl)}catch{}},metaWithUrl:!0},n.editorConfig.MENU_CONF.myFullScreen={toggleFull(){a.value=!a.value}};const k=e=>!0;n.editorConfig.MENU_CONF.uploadVideo={async customUpload(e,t){if(!w())return;let i=new FormData;i.append("file",e);try{const{data:o}=await A(i);t(o.fileUrl)}catch{}}};const w=e=>!0;I(()=>{!l.value||l.value.destroy()}),b({editor:l});const x=()=>{a.value=!1},N=()=>{a.value=!1};return(e,t)=>{const i=y("el-input"),o=y("el-button");return s(),c("div",{class:K([r(a)?"w-e-full-screen-container":"editor-box"])},[u("div",j,[e.hideToolBar?f("v-if",!0):(s(),c("div",H,[d(r(U),{class:"editor-toolbar",editor:l.value,defaultConfig:e.toolbarConfig},null,8,["editor","defaultConfig"])])),u("div",J,[u("div",L,[r(a)?(s(),c("div",X,[d(i,{modelValue:_.value,"onUpdate:modelValue":t[0]||(t[0]=p=>_.value=p),type:"textarea",class:"textarea",autosize:"",placeholder:"\u8BF7\u8F93\u5165\u6587\u7AE0\u7684\u6807\u9898",maxlength:"50","show-word-limit":""},null,8,["modelValue"])])):f("v-if",!0),u("div",q,[d(r(T),{style:R([{height:r(a)?"":e.height},{background:"#ffffff"}]),modelValue:v.value,"onUpdate:modelValue":t[1]||(t[1]=p=>v.value=p),defaultConfig:e.editorConfig,onOnCreated:V,id:"editor"},null,8,["style","modelValue","defaultConfig"])]),f(` <div class="button_box" v-show="showEditorAll && !valueFull">\r
						<el-button type="primary" @click="handleToEditor">\u5168\u5C4F\u7F16\u8F91</el-button>\r
					</div> `)]),r(a)?(s(),c("div",G,[u("div",null,[d(o,{type:"primary",onClick:N},{default:C(()=>t[2]||(t[2]=[h("\u7ACB\u5373\u521B\u5EFA",-1)])),_:1,__:[2]}),d(o,{onClick:x},{default:C(()=>t[3]||(t[3]=[h("\u8FD4\u56DE",-1)])),_:1,__:[3]})])])):f("v-if",!0)])])],2)}}});const te=M(Q,[["__scopeId","data-v-29a7a6c6"]]);export{te as W};
